diff --git a/src/api/materials/company/types.ts b/src/api/materials/company/types.ts index 8fb437d..493630c 100644 --- a/src/api/materials/company/types.ts +++ b/src/api/materials/company/types.ts @@ -28,7 +28,6 @@ export interface CompanyVO { * 资质情况 */ qualification: string; - } export interface CompanyForm extends BaseEntity { @@ -61,11 +60,9 @@ export interface CompanyForm extends BaseEntity { * 资质情况 */ qualification?: string; - } -export interface CompanyQuery extends PageQuery { - +export interface CompanyQuery extends PageRequest { /** * 公司名称 */ @@ -86,11 +83,8 @@ export interface CompanyQuery extends PageQuery { */ qualification?: string; - /** - * 日期范围参数 - */ - params?: any; + /** + * 日期范围参数 + */ + params?: any; } - - - diff --git a/src/api/materials/materials/types.ts b/src/api/materials/materials/types.ts index a22fad5..33e32f6 100644 --- a/src/api/materials/materials/types.ts +++ b/src/api/materials/materials/types.ts @@ -93,7 +93,6 @@ export interface MaterialsVO { * 状态(0正常 1停用) */ status: string; - } export interface MaterialsForm extends BaseEntity { @@ -191,11 +190,9 @@ export interface MaterialsForm extends BaseEntity { * 状态(0正常 1停用) */ status?: string; - } -export interface MaterialsQuery extends PageQuery { - +export interface MaterialsQuery extends PageRequest { /** * 材料名称 */ @@ -281,11 +278,8 @@ export interface MaterialsQuery extends PageQuery { */ status?: string; - /** - * 日期范围参数 - */ - params?: any; + /** + * 日期范围参数 + */ + params?: any; } - - - diff --git a/src/api/materials/materialsInventory/types.ts b/src/api/materials/materialsInventory/types.ts index ed2697b..db3c5ca 100644 --- a/src/api/materials/materialsInventory/types.ts +++ b/src/api/materials/materialsInventory/types.ts @@ -63,7 +63,6 @@ export interface MaterialsInventoryVO { * 备注 */ remark: string; - } export interface MaterialsInventoryForm extends BaseEntity { @@ -131,11 +130,9 @@ export interface MaterialsInventoryForm extends BaseEntity { * 备注 */ remark?: string; - } -export interface MaterialsInventoryQuery extends PageQuery { - +export interface MaterialsInventoryQuery extends PageRequest { /** * 材料id */ @@ -191,11 +188,8 @@ export interface MaterialsInventoryQuery extends PageQuery { */ shipper?: string; - /** - * 日期范围参数 - */ - params?: any; + /** + * 日期范围参数 + */ + params?: any; } - - - diff --git a/src/api/project/constructionUser/types.ts b/src/api/project/constructionUser/types.ts index ea9ed35..d237cd3 100644 --- a/src/api/project/constructionUser/types.ts +++ b/src/api/project/constructionUser/types.ts @@ -1,3 +1,5 @@ +import { ContractorVO } from '@/api/project/contractor/types'; + export interface ConstructionUserVO { /** * 主键id @@ -34,6 +36,11 @@ export interface ConstructionUserVO { */ contractorId: string | number; + /** + * 分包公司 + */ + contractorVo: ContractorVO; + /** * 班组id */ @@ -138,7 +145,6 @@ export interface ConstructionUserVO { * 备注 */ remark: string; - } export interface ConstructionUserForm extends BaseEntity { @@ -281,11 +287,9 @@ export interface ConstructionUserForm extends BaseEntity { * 备注 */ remark?: string; - } export interface ConstructionUserQuery extends PageQuery { - /** * 微信id */ @@ -416,11 +420,8 @@ export interface ConstructionUserQuery extends PageQuery { */ salary?: number; - /** - * 日期范围参数 - */ - params?: any; + /** + * 日期范围参数 + */ + params?: any; } - - - diff --git a/src/types/global.d.ts b/src/types/global.d.ts index 229e181..26c3d8a 100644 --- a/src/types/global.d.ts +++ b/src/types/global.d.ts @@ -53,6 +53,7 @@ declare global { /** 其他参数 */ [key: string]: any; } + /** * 字典数据 数据配置 */ @@ -81,6 +82,7 @@ declare global { queryParams: D; rules: ElFormRules; } + /** * 分页查询参数 */ @@ -88,6 +90,14 @@ declare global { pageNum: number; pageSize: number; } + + declare interface PageRequest { + current: number; + pageSize: number; + sortField: string; + sortOrder: string; + } + declare interface LayoutSetting { /** * 是否显示顶部导航 diff --git a/src/views/materials/company/index.vue b/src/views/materials/company/index.vue index 60d8ee5..a531c78 100644 --- a/src/views/materials/company/index.vue +++ b/src/views/materials/company/index.vue @@ -7,8 +7,10 @@ - - + + + + 搜索 @@ -48,35 +50,23 @@ - - - {{ row.status === 0 ? '正常' : '不正常' }} - + + - - - - - - + + 修改 + 删除 + - + @@ -108,12 +98,12 @@ import { CompanyForm, CompanyQuery, CompanyVO } from '@/api/materials/company/ty import { useUserStoreHook } from '@/store/modules/user'; const { proxy } = getCurrentInstance() as ComponentInternalInstance; +const { sys_normal_disable } = toRefs(proxy?.useDict('sys_normal_disable')); // 获取用户 store const userStore = useUserStoreHook(); // 从 store 中获取项目列表和当前选中的项目 -const projectList = computed(() => userStore.projects); const currentProject = computed(() => userStore.selectedProject); const companyList = ref([]); const buttonLoading = ref(false); @@ -143,7 +133,7 @@ const initFormData: CompanyForm = { const data = reactive>({ form: { ...initFormData }, queryParams: { - pageNum: 1, + current: 1, pageSize: 10, companyName: undefined, projectId: currentProject.value.id, diff --git a/src/views/materials/materials/component/MaterialsInventoryAddDialog.vue b/src/views/materials/materials/component/MaterialsInventoryAddDialog.vue new file mode 100644 index 0000000..e6f2bc8 --- /dev/null +++ b/src/views/materials/materials/component/MaterialsInventoryAddDialog.vue @@ -0,0 +1,123 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/views/materials/materials/component/MaterialsInventoryTable.vue b/src/views/materials/materials/component/MaterialsInventoryTable.vue new file mode 100644 index 0000000..6a5385e --- /dev/null +++ b/src/views/materials/materials/component/MaterialsInventoryTable.vue @@ -0,0 +1,85 @@ + + + + + + + + + + + + + + + + + + + + + 删除 + + + + + + + + + + diff --git a/src/views/materials/materials/index.vue b/src/views/materials/materials/index.vue index c247dc8..f86b7d4 100644 --- a/src/views/materials/materials/index.vue +++ b/src/views/materials/materials/index.vue @@ -3,10 +3,15 @@ - + + + + + + 搜索 重置 @@ -39,57 +44,60 @@ - + + + + + + - - - - - - - - - - + + - + - - - {{ row.status === 0 ? '正常' : '异常' }} - + + - + - - - - - - + + 修改 + + 删除 + + 出入库 + - + - + @@ -132,12 +140,12 @@ - - - + + + + @@ -153,9 +162,11 @@ import { addMaterials, delMaterials, getMaterials, listMaterials, updateMaterials } from '@/api/materials/materials'; import { MaterialsForm, MaterialsQuery, MaterialsVO } from '@/api/materials/materials/types'; import { useUserStoreHook } from '@/store/modules/user'; +import MaterialsInventoryTable from '@/views/materials/materials/component/MaterialsInventoryTable.vue'; +import MaterialsInventoryAddDialog from '@/views/materials/materials/component/MaterialsInventoryAddDialog.vue'; const { proxy } = getCurrentInstance() as ComponentInternalInstance; - +const { sys_normal_disable } = toRefs(proxy?.useDict('sys_normal_disable')); // 获取用户 store const userStore = useUserStoreHook(); // 从 store 中获取项目列表和当前选中的项目 @@ -202,7 +213,7 @@ const initFormData: MaterialsForm = { const data = reactive>({ form: { ...initFormData }, queryParams: { - pageNum: 1, + current: 1, pageSize: 10, materialsName: undefined, companyId: undefined, @@ -230,6 +241,7 @@ const data = reactive>({ }); const { queryParams, form, rules } = toRefs(data); +const companyOptions = ref([]); /** 查询材料名称列表 */ const getList = async () => { @@ -237,6 +249,14 @@ const getList = async () => { const res = await listMaterials(queryParams.value); materialsList.value = res.data.records; total.value = res.data.total; + const companyMap = new Map(); + res.data.records.forEach((record) => { + const { id, companyName } = record.companyVo; + if (!companyMap.has(id)) { + companyMap.set(id, { id, companyName }); + } + }); + companyOptions.value = Array.from(companyMap.values()); loading.value = false; }; @@ -254,7 +274,7 @@ const reset = () => { /** 搜索按钮操作 */ const handleQuery = () => { - queryParams.value.pageNum = 1; + queryParams.value.current = 1; getList(); }; @@ -271,6 +291,21 @@ const handleSelectionChange = (selection: MaterialsVO[]) => { multiple.value = !selection.length; }; +// 存储当前展开行的 key 数组(只允许一个展开) +const expandedRowKeys = ref([]); +// row-key 函数:返回每一行的唯一标识 +const getRowKey = (row: any) => row.id; +/** 展开选中数据 */ +const handleExpandChange = async (selection: MaterialsVO, expanded: any) => { + if (expanded) { + // 展开当前行时,将其他展开行关闭,只保留当前行 id + expandedRowKeys.value = [selection.id]; + } else { + // 收起当前行时,从 expandedRowKeys 中移除 + expandedRowKeys.value = expandedRowKeys.value.filter((key) => key !== selection.id); + } +}; + /** 新增按钮操作 */ const handleAdd = () => { reset(); @@ -325,6 +360,13 @@ const handleExport = () => { ); }; +const dialogRef = ref(); +const currentMaterialsId = ref(0); +const handleAddMaterialsInventory = (row?: MaterialsVO) => { + currentMaterialsId.value = row.id ?? 0; + dialogRef.value.openDialog(); +}; + onMounted(() => { getList(); }); diff --git a/src/views/materials/materialsInventory/index.vue b/src/views/materials/materialsInventory/index.vue index bce03c5..016cf20 100644 --- a/src/views/materials/materialsInventory/index.vue +++ b/src/views/materials/materialsInventory/index.vue @@ -4,38 +4,11 @@ - 搜索 重置 @@ -49,27 +22,8 @@ - 新增 - - - 修改 - - - - 删除 - - - - 导出 + + 导出 @@ -78,61 +32,80 @@ - - - - - - - {{ parseTime(scope.row.outPutTime, '{y}-{m}-{d}') }} - + + + + {{ scope.row.number }} + + + + + + {{ scope.row.operator }} + + + + + + {{ parseTime(scope.row.outPutTime, '{y}年{m}月{d}日') }} + + + + + + + + + {{ scope.row.number }} + + + + + + {{ scope.row.operator }} + + + + + + + {{ parseTime(scope.row.outPutTime, '{y}年{m}月{d}日') }} + + + + + + + - - - - - - - - - - - - + + + 修改 + + + 删除 + + - - + - + - - - - + - + + + @@ -185,6 +158,7 @@ import { MaterialsInventoryForm, MaterialsInventoryQuery, MaterialsInventoryVO } import { useUserStoreHook } from '@/store/modules/user'; const { proxy } = getCurrentInstance() as ComponentInternalInstance; +const { out_put_type } = toRefs(proxy?.useDict('out_put_type')); // 获取用户 store const userStore = useUserStoreHook(); @@ -230,7 +204,7 @@ const initFormData: MaterialsInventoryForm = { const data = reactive>({ form: { ...initFormData }, queryParams: { - pageNum: 1, + current: 1, pageSize: 10, materialsId: undefined, projectId: currentProject.value.id, @@ -257,6 +231,7 @@ const data = reactive> }); const { queryParams, form, rules } = toRefs(data); +const materialsOptions = ref([]); /** 查询材料出/入库列表 */ const getList = async () => { @@ -264,6 +239,14 @@ const getList = async () => { const res = await listMaterialsInventory(queryParams.value); materialsInventoryList.value = res.data.records; total.value = res.data.total; + const materialsMap = new Map(); + res.data.records.forEach((record) => { + const { id, materialsName } = record.materialsVo; + if (!materialsMap.has(id)) { + materialsMap.set(id, { id, materialsName }); + } + }); + materialsOptions.value = Array.from(materialsMap.values()); loading.value = false; }; @@ -281,7 +264,7 @@ const reset = () => { /** 搜索按钮操作 */ const handleQuery = () => { - queryParams.value.pageNum = 1; + queryParams.value.current = 1; getList(); }; diff --git a/src/views/project/constructionUser/index.vue b/src/views/project/constructionUser/index.vue index 899bbdf..f60a39e 100644 --- a/src/views/project/constructionUser/index.vue +++ b/src/views/project/constructionUser/index.vue @@ -7,14 +7,14 @@ - - + + - - + + - - + + 搜索 @@ -32,13 +32,20 @@ 新增 - 修改 + + 修改 - 删除 + + 删除 @@ -52,19 +59,31 @@ - + + + {{ scope.row.ContractorVO.name }} + + - + + + + + - + - + + + + + @@ -91,7 +110,7 @@ - + @@ -191,6 +210,7 @@ import { ConstructionUserForm, ConstructionUserQuery, ConstructionUserVO } from import { useUserStoreHook } from '@/store/modules/user'; const { proxy } = getCurrentInstance() as ComponentInternalInstance; +const { type_of_work, user_sex_type, user_clock_type } = toRefs(proxy?.useDict('type_of_work', 'user_sex_type', 'user_clock_type')); // 获取用户 store const userStore = useUserStoreHook(); diff --git a/src/views/project/contractor/index.vue b/src/views/project/contractor/index.vue index cc6242c..69be2cb 100644 --- a/src/views/project/contractor/index.vue +++ b/src/views/project/contractor/index.vue @@ -7,7 +7,7 @@ - + 搜索 重置 diff --git a/src/views/project/project/index.vue b/src/views/project/project/index.vue index 5ece9c9..526dea7 100644 --- a/src/views/project/project/index.vue +++ b/src/views/project/project/index.vue @@ -10,51 +10,6 @@ - 搜索 重置 @@ -93,16 +48,18 @@ - - + + + + + - - + @@ -203,6 +160,7 @@ import { listProject, getProject, delProject, addProject, updateProject } from ' import { ProjectVO, ProjectQuery, ProjectForm } from '@/api/project/project/types'; const { proxy } = getCurrentInstance() as ComponentInternalInstance; +const { sys_normal_disable, project_category_type } = toRefs(proxy?.useDict('sys_normal_disable', 'project_category_type')); const projectList = ref([]); const buttonLoading = ref(false); @@ -215,7 +173,6 @@ const total = ref(0); const queryFormRef = ref(); const projectFormRef = ref(); - const dialog = reactive({ visible: false, title: '' @@ -273,12 +230,10 @@ const data = reactive>({ params: {} }, rules: { - id: [{ required: true, message: '不能为空', trigger: 'blur' }], punchRange: [{ required: true, message: '打卡范围不能为空', trigger: 'blur' }], - designTotal: [{ required: true, message: '设计总量不能为空', trigger: 'blur' }], - sort: [{ required: true, message: '排序字段不能为空', trigger: 'blur' }], - showHidden: [{ required: true, message: '显示隐藏不能为空', trigger: 'blur' }], - isDelete: [{ required: true, message: '是否删除不能为空', trigger: 'blur' }] + projectName: [{ required: true, message: '项目名称不能为空', trigger: 'blur' }], + shortName: [{ required: true, message: '项目简称不能为空', trigger: 'blur' }], + projectSite: [{ required: true, message: '项目地址不能为空', trigger: 'blur' }] } }); @@ -289,7 +244,7 @@ const getList = async () => { loading.value = true; const res = await listProject(queryParams.value); projectList.value = res.data.records; - total.value = res.total; + total.value = res.data.total; loading.value = false; }; /** 取消按钮 */