diff --git a/public/config/config.json b/public/config/config.json index 32d78df..187a5bc 100644 --- a/public/config/config.json +++ b/public/config/config.json @@ -1,6 +1,6 @@ { "title":"计量业务系统", - "versionByEqpt":"1.2.0.7", + "versionByEqpt":"1.2.0.9", "baseUrl": "http://111.198.10.15:21611", "baseUrlBusiness": "http://111.198.10.15:21606", "baseUrlLaboratory": "http://111.198.10.15:21610", diff --git a/public/config/config.json b/public/config/config.json index 32d78df..187a5bc 100644 --- a/public/config/config.json +++ b/public/config/config.json @@ -1,6 +1,6 @@ { "title":"计量业务系统", - "versionByEqpt":"1.2.0.7", + "versionByEqpt":"1.2.0.9", "baseUrl": "http://111.198.10.15:21611", "baseUrlBusiness": "http://111.198.10.15:21606", "baseUrlLaboratory": "http://111.198.10.15:21610", diff --git a/src/views/tested/device/info/components/edit.vue b/src/views/tested/device/info/components/edit.vue index 7722110..5df8a88 100644 --- a/src/views/tested/device/info/components/edit.vue +++ b/src/views/tested/device/info/components/edit.vue @@ -372,15 +372,17 @@ immediate: true, }) watch(() => ruleForm.value.companyId, (newVal) => { - if ($route.path.includes('detail') || isFrist.value) { - return - } + // if ($route.path.includes('detail')) { + // return + // } if (newVal) { if (isAdmin.value) { + ruleForm.value.deptId = '' getUserDeptSon({ companyId: newVal }).then((res) => { - // console.log(res.data, '11111') + console.log(res.data, '管理员部门') deptList.value = res.data.map((item: any) => ({ id: item.id, value: item.id, name: item.fullName })) if (deptList.value.length === 1) { + // if (isFrist.value) { return } ruleForm.value.deptId = deptList.value[0].id } }) @@ -404,22 +406,32 @@ ruleFormRef.value?.resetFields() const fetchDept = () => { getUserDept().then((res) => { - ruleForm.value.companyId = res.data.id - companyId.value = res.data.id - ruleForm.value.companyName = res.data.fullName if (res.data.fullName === '顶级' || res.data.version === '1') { - ruleForm.value.companyId = '' - ruleForm.value.companyName = '' + // if ($route.params.type === 'create') { + // ruleForm.value.companyId = '' + // ruleForm.value.companyName = '' + // } isAdmin.value = true getAdminDept({}).then((res) => { - console.log(res.data, '管理员') companyList.value = res.data.map((item: any) => ({ id: item.id, value: item.id, name: item.fullName })) }) + getUserDeptSon({ companyId: ruleForm.value.companyId }).then((res) => { + // console.log(res.data, '管理员部门') + deptList.value = res.data.map((item: any) => ({ id: item.id, value: item.id, name: item.fullName })) + if (deptList.value.length === 1) { + if (isFrist.value) { return } + ruleForm.value.deptId = deptList.value[0].id + } + }) } else { isAdmin.value = false + if ($route.params.type === 'update') { + ruleForm.value.companyId = res.data.id + companyId.value = res.data.id + ruleForm.value.companyName = res.data.fullName + } getUserDeptSon({ companyId: res.data.id }).then((res) => { - // console.log(res.data, '11111') deptList.value = res.data.map((item: any) => ({ id: item.id, value: item.id, name: item.fullName })) if (deptList.value.length === 1) { ruleForm.value.deptId = deptList.value[0].id @@ -448,11 +460,6 @@ isFrist.value = false }, 2000) } - // const fetchDept = (pid: string) => { - // getDeptTree({ pid }).then((res1) => { - // deptList.value = res1.data.filter((item: any) => item.pids.split(',').length === 3).map((item: any) => ({ id: item.id, value: item.id, name: item.fullName })) - // }) - // } if (statusName === '全部') { getInfoDetail({ equipmentId: $route.query.id as string }).then((res) => { ruleForm.value = res.data @@ -466,7 +473,6 @@ ruleForm.value.createTime = dayjs().format('YYYY-MM-DD HH:mm:ss') // 创建时间 } openSubmission() - // fetchDept('0') fetchDept() }) } @@ -474,7 +480,6 @@ getApprovalDetail({ id: $route.query.id as string }).then((res) => { ruleForm.value = res.data openSubmission() - // fetchDept('0') fetchDept() }) }