diff --git a/src/api/eqpt/measurementPlan/task.ts b/src/api/eqpt/measurementPlan/task.ts index 37e69a2..a291108 100644 --- a/src/api/eqpt/measurementPlan/task.ts +++ b/src/api/eqpt/measurementPlan/task.ts @@ -2,6 +2,7 @@ * r任务单管理接口 */ import request from '@/api/index' +import requestBus from '@/api/request' // 分页列表 export function getListPage(data: any, statusName: string) { if (statusName === '全部') { @@ -122,3 +123,15 @@ responseType: 'blob', }) } + +// 获取业务系统委托方名录列表 +export function getCustomerList() { + return requestBus({ + url: '/resource/customer/info/approval/listPage?limit=9999&offset=1', + method: 'post', + data: { + formId: 'zyglwtfml', + approvalStatus: '0', + }, + }) +} diff --git a/src/api/eqpt/measurementPlan/task.ts b/src/api/eqpt/measurementPlan/task.ts index 37e69a2..a291108 100644 --- a/src/api/eqpt/measurementPlan/task.ts +++ b/src/api/eqpt/measurementPlan/task.ts @@ -2,6 +2,7 @@ * r任务单管理接口 */ import request from '@/api/index' +import requestBus from '@/api/request' // 分页列表 export function getListPage(data: any, statusName: string) { if (statusName === '全部') { @@ -122,3 +123,15 @@ responseType: 'blob', }) } + +// 获取业务系统委托方名录列表 +export function getCustomerList() { + return requestBus({ + url: '/resource/customer/info/approval/listPage?limit=9999&offset=1', + method: 'post', + data: { + formId: 'zyglwtfml', + approvalStatus: '0', + }, + }) +} diff --git a/src/components/QRcodeDeviceDialog/index.vue b/src/components/QRcodeDeviceDialog/index.vue index e053348..b2673ad 100644 --- a/src/components/QRcodeDeviceDialog/index.vue +++ b/src/components/QRcodeDeviceDialog/index.vue @@ -23,7 +23,7 @@ checkoutList.value = val } // 扫描操作 -const onScanning = (code: string) => { +function onScanning(code: string) { scanStatus.value = '2' console.log(code, '获取到的设备的id')// 获取到的条形码 ElMessage.success('扫描成功,获取设备信息中') diff --git a/src/api/eqpt/measurementPlan/task.ts b/src/api/eqpt/measurementPlan/task.ts index 37e69a2..a291108 100644 --- a/src/api/eqpt/measurementPlan/task.ts +++ b/src/api/eqpt/measurementPlan/task.ts @@ -2,6 +2,7 @@ * r任务单管理接口 */ import request from '@/api/index' +import requestBus from '@/api/request' // 分页列表 export function getListPage(data: any, statusName: string) { if (statusName === '全部') { @@ -122,3 +123,15 @@ responseType: 'blob', }) } + +// 获取业务系统委托方名录列表 +export function getCustomerList() { + return requestBus({ + url: '/resource/customer/info/approval/listPage?limit=9999&offset=1', + method: 'post', + data: { + formId: 'zyglwtfml', + approvalStatus: '0', + }, + }) +} diff --git a/src/components/QRcodeDeviceDialog/index.vue b/src/components/QRcodeDeviceDialog/index.vue index e053348..b2673ad 100644 --- a/src/components/QRcodeDeviceDialog/index.vue +++ b/src/components/QRcodeDeviceDialog/index.vue @@ -23,7 +23,7 @@ checkoutList.value = val } // 扫描操作 -const onScanning = (code: string) => { +function onScanning(code: string) { scanStatus.value = '2' console.log(code, '获取到的设备的id')// 获取到的条形码 ElMessage.success('扫描成功,获取设备信息中') diff --git a/src/views/tested/MeasurementPlan/task/components/edit.vue b/src/views/tested/MeasurementPlan/task/components/edit.vue index 86b6bd2..4fbd6c8 100644 --- a/src/views/tested/MeasurementPlan/task/components/edit.vue +++ b/src/views/tested/MeasurementPlan/task/components/edit.vue @@ -6,7 +6,7 @@ import tableList from './tableList.vue' import ApprovalDialog from './ApprovalDialog.vue' import { getAdminDept, getUserDept, getUserList } from '@/api/system/user' -import { addTask, cancelTask, delTask, detailTask, submitTask, updateTask, valiateTask } from '@/api/eqpt/measurementPlan/task' +import { addTask, cancelTask, delTask, detailTask, getCustomerList, submitTask, updateTask, valiateTask } from '@/api/eqpt/measurementPlan/task' import { getDictByCode } from '@/api/system/dict' import useUserStore from '@/store/modules/user' import { delTextBtn, editBtn, submitBtn } from '@/utils/applyBtns' @@ -83,6 +83,7 @@ // 弹窗初始化 const processId = ref() const isAdmin = ref(false) +const isFirst = ref(true) const companyList = ref([]) // 单位列表 const initDialog = () => { dialogStatus.value = $route.params.type as string @@ -101,11 +102,15 @@ getAdminDept({}).then((res) => { companyList.value = res.data.map((item: any) => ({ id: item.id, value: item.id, name: item.fullName })) }) + isFirst.value = false } else { isAdmin.value = false - ruleForm.value.customerId = res.data.id - ruleForm.value.customerName = res.data.fullName + isFirst.value = false + setTimeout(() => { + ruleForm.value.customerId = res.data.id + ruleForm.value.customerName = res.data.fullName + }) } }) } @@ -117,18 +122,21 @@ ruleForm.value.isUrgent = String(res.data.data.isUrgent) ruleForm.value.isOnSiteCheck = String(res.data.data.isOnSiteCheck) processId.value = ruleForm.value.processId + setTimeout(() => { + isFirst.value = false + }) }) } } -onMounted(() => { - initDialog() -}) + // 获取是否加急下拉列表 const isUrgentList = ref<{ id: string; value: string; name: string }[]>() // 送检人列表 const personList = ref() // 检定单位 const measureCompanyList = ref<{ id: string; value: string; name: string }[]>() +// 委托方名录 +const customerList = ref([]) const fetchListData = () => { getDictByCode('isUrgent').then((res) => { isUrgentList.value = res.data @@ -141,8 +149,44 @@ getDictByCode('eqptmeasureCompany').then((res) => { measureCompanyList.value = res.data }) + getCustomerList().then((res) => { + customerList.value = res.data.rows + }) } -fetchListData() + +onMounted(async () => { + await fetchListData() + initDialog() +}) +// 自动填充委托方地址 +watch(() => ruleForm.value.customerId, (newVal) => { + if (isFirst.value) { + return + } + if (newVal) { + if (isAdmin.value) { + console.log('管理员') + // 委托方名称 + const name = companyList.value.filter(item => item.id === newVal)[0]?.name + // 寻找委托方地址 + if (customerList.value.filter((item: any) => item.customerName === name).length) { + ruleForm.value.customerAddress = customerList.value.filter((item: any) => item.customerName === name)[0].address + } + else { + ruleForm.value.customerAddress = '/' + } + } + else { + console.log('非管理员') + if (customerList.value.filter((item: any) => item.customerName === ruleForm.value.customerName).length) { + ruleForm.value.customerAddress = customerList.value.filter((item: any) => item.customerName === ruleForm.value.customerName)[0].address + } + else { + ruleForm.value.customerAddress = '/' + } + } + } +}) // 关闭弹窗 const close = () => { $router.back() @@ -264,7 +308,7 @@ ruleForm.value.id = submitId.value } ruleForm.value.customerSampleInfoList = tableRef.value.list - ruleForm.value.customerName = ruleForm.value.customerName ? ruleForm.value.customerName : companyList.value.filter(item => item.id === ruleForm.value.customerId)[0]?.name + ruleForm.value.customerName = companyList.value.filter(item => item.id === ruleForm.value.customerId)[0]?.name updateTask(ruleForm.value).then((res) => { submitId.value = res.data // close() @@ -451,11 +495,11 @@ - + + + + + + + + + + - + diff --git a/src/api/eqpt/measurementPlan/task.ts b/src/api/eqpt/measurementPlan/task.ts index 37e69a2..a291108 100644 --- a/src/api/eqpt/measurementPlan/task.ts +++ b/src/api/eqpt/measurementPlan/task.ts @@ -2,6 +2,7 @@ * r任务单管理接口 */ import request from '@/api/index' +import requestBus from '@/api/request' // 分页列表 export function getListPage(data: any, statusName: string) { if (statusName === '全部') { @@ -122,3 +123,15 @@ responseType: 'blob', }) } + +// 获取业务系统委托方名录列表 +export function getCustomerList() { + return requestBus({ + url: '/resource/customer/info/approval/listPage?limit=9999&offset=1', + method: 'post', + data: { + formId: 'zyglwtfml', + approvalStatus: '0', + }, + }) +} diff --git a/src/components/QRcodeDeviceDialog/index.vue b/src/components/QRcodeDeviceDialog/index.vue index e053348..b2673ad 100644 --- a/src/components/QRcodeDeviceDialog/index.vue +++ b/src/components/QRcodeDeviceDialog/index.vue @@ -23,7 +23,7 @@ checkoutList.value = val } // 扫描操作 -const onScanning = (code: string) => { +function onScanning(code: string) { scanStatus.value = '2' console.log(code, '获取到的设备的id')// 获取到的条形码 ElMessage.success('扫描成功,获取设备信息中') diff --git a/src/views/tested/MeasurementPlan/task/components/edit.vue b/src/views/tested/MeasurementPlan/task/components/edit.vue index 86b6bd2..4fbd6c8 100644 --- a/src/views/tested/MeasurementPlan/task/components/edit.vue +++ b/src/views/tested/MeasurementPlan/task/components/edit.vue @@ -6,7 +6,7 @@ import tableList from './tableList.vue' import ApprovalDialog from './ApprovalDialog.vue' import { getAdminDept, getUserDept, getUserList } from '@/api/system/user' -import { addTask, cancelTask, delTask, detailTask, submitTask, updateTask, valiateTask } from '@/api/eqpt/measurementPlan/task' +import { addTask, cancelTask, delTask, detailTask, getCustomerList, submitTask, updateTask, valiateTask } from '@/api/eqpt/measurementPlan/task' import { getDictByCode } from '@/api/system/dict' import useUserStore from '@/store/modules/user' import { delTextBtn, editBtn, submitBtn } from '@/utils/applyBtns' @@ -83,6 +83,7 @@ // 弹窗初始化 const processId = ref() const isAdmin = ref(false) +const isFirst = ref(true) const companyList = ref([]) // 单位列表 const initDialog = () => { dialogStatus.value = $route.params.type as string @@ -101,11 +102,15 @@ getAdminDept({}).then((res) => { companyList.value = res.data.map((item: any) => ({ id: item.id, value: item.id, name: item.fullName })) }) + isFirst.value = false } else { isAdmin.value = false - ruleForm.value.customerId = res.data.id - ruleForm.value.customerName = res.data.fullName + isFirst.value = false + setTimeout(() => { + ruleForm.value.customerId = res.data.id + ruleForm.value.customerName = res.data.fullName + }) } }) } @@ -117,18 +122,21 @@ ruleForm.value.isUrgent = String(res.data.data.isUrgent) ruleForm.value.isOnSiteCheck = String(res.data.data.isOnSiteCheck) processId.value = ruleForm.value.processId + setTimeout(() => { + isFirst.value = false + }) }) } } -onMounted(() => { - initDialog() -}) + // 获取是否加急下拉列表 const isUrgentList = ref<{ id: string; value: string; name: string }[]>() // 送检人列表 const personList = ref() // 检定单位 const measureCompanyList = ref<{ id: string; value: string; name: string }[]>() +// 委托方名录 +const customerList = ref([]) const fetchListData = () => { getDictByCode('isUrgent').then((res) => { isUrgentList.value = res.data @@ -141,8 +149,44 @@ getDictByCode('eqptmeasureCompany').then((res) => { measureCompanyList.value = res.data }) + getCustomerList().then((res) => { + customerList.value = res.data.rows + }) } -fetchListData() + +onMounted(async () => { + await fetchListData() + initDialog() +}) +// 自动填充委托方地址 +watch(() => ruleForm.value.customerId, (newVal) => { + if (isFirst.value) { + return + } + if (newVal) { + if (isAdmin.value) { + console.log('管理员') + // 委托方名称 + const name = companyList.value.filter(item => item.id === newVal)[0]?.name + // 寻找委托方地址 + if (customerList.value.filter((item: any) => item.customerName === name).length) { + ruleForm.value.customerAddress = customerList.value.filter((item: any) => item.customerName === name)[0].address + } + else { + ruleForm.value.customerAddress = '/' + } + } + else { + console.log('非管理员') + if (customerList.value.filter((item: any) => item.customerName === ruleForm.value.customerName).length) { + ruleForm.value.customerAddress = customerList.value.filter((item: any) => item.customerName === ruleForm.value.customerName)[0].address + } + else { + ruleForm.value.customerAddress = '/' + } + } + } +}) // 关闭弹窗 const close = () => { $router.back() @@ -264,7 +308,7 @@ ruleForm.value.id = submitId.value } ruleForm.value.customerSampleInfoList = tableRef.value.list - ruleForm.value.customerName = ruleForm.value.customerName ? ruleForm.value.customerName : companyList.value.filter(item => item.id === ruleForm.value.customerId)[0]?.name + ruleForm.value.customerName = companyList.value.filter(item => item.id === ruleForm.value.customerId)[0]?.name updateTask(ruleForm.value).then((res) => { submitId.value = res.data // close() @@ -451,11 +495,11 @@ - + + + + + - + diff --git a/src/views/tested/device/info/components/list.vue b/src/views/tested/device/info/components/list.vue index b3483a7..6f94889 100644 --- a/src/views/tested/device/info/components/list.vue +++ b/src/views/tested/device/info/components/list.vue @@ -1004,7 +1004,7 @@ type: 'html', // targetStyles: ['*'], // style: '@page {margin:0mm 0mm ;resolution: 1000dpi;}', - style: '@media print { @page {size: auto; margin: 0.2mm;resolution: 1000dpi; } body{margin:0 0px}}', + style: '@media print { @page { margin: 0mm;resolution: 500dpi; } body{margin:0 0px}}', // onPrintDialogClose: true, // targetStyles: ['*'], // 使用dom的所有样式,很重要 targetStyle: '*', @@ -1413,8 +1413,8 @@ - -
+ +
diff --git a/src/api/eqpt/measurementPlan/task.ts b/src/api/eqpt/measurementPlan/task.ts index 37e69a2..a291108 100644 --- a/src/api/eqpt/measurementPlan/task.ts +++ b/src/api/eqpt/measurementPlan/task.ts @@ -2,6 +2,7 @@ * r任务单管理接口 */ import request from '@/api/index' +import requestBus from '@/api/request' // 分页列表 export function getListPage(data: any, statusName: string) { if (statusName === '全部') { @@ -122,3 +123,15 @@ responseType: 'blob', }) } + +// 获取业务系统委托方名录列表 +export function getCustomerList() { + return requestBus({ + url: '/resource/customer/info/approval/listPage?limit=9999&offset=1', + method: 'post', + data: { + formId: 'zyglwtfml', + approvalStatus: '0', + }, + }) +} diff --git a/src/components/QRcodeDeviceDialog/index.vue b/src/components/QRcodeDeviceDialog/index.vue index e053348..b2673ad 100644 --- a/src/components/QRcodeDeviceDialog/index.vue +++ b/src/components/QRcodeDeviceDialog/index.vue @@ -23,7 +23,7 @@ checkoutList.value = val } // 扫描操作 -const onScanning = (code: string) => { +function onScanning(code: string) { scanStatus.value = '2' console.log(code, '获取到的设备的id')// 获取到的条形码 ElMessage.success('扫描成功,获取设备信息中') diff --git a/src/views/tested/MeasurementPlan/task/components/edit.vue b/src/views/tested/MeasurementPlan/task/components/edit.vue index 86b6bd2..4fbd6c8 100644 --- a/src/views/tested/MeasurementPlan/task/components/edit.vue +++ b/src/views/tested/MeasurementPlan/task/components/edit.vue @@ -6,7 +6,7 @@ import tableList from './tableList.vue' import ApprovalDialog from './ApprovalDialog.vue' import { getAdminDept, getUserDept, getUserList } from '@/api/system/user' -import { addTask, cancelTask, delTask, detailTask, submitTask, updateTask, valiateTask } from '@/api/eqpt/measurementPlan/task' +import { addTask, cancelTask, delTask, detailTask, getCustomerList, submitTask, updateTask, valiateTask } from '@/api/eqpt/measurementPlan/task' import { getDictByCode } from '@/api/system/dict' import useUserStore from '@/store/modules/user' import { delTextBtn, editBtn, submitBtn } from '@/utils/applyBtns' @@ -83,6 +83,7 @@ // 弹窗初始化 const processId = ref() const isAdmin = ref(false) +const isFirst = ref(true) const companyList = ref([]) // 单位列表 const initDialog = () => { dialogStatus.value = $route.params.type as string @@ -101,11 +102,15 @@ getAdminDept({}).then((res) => { companyList.value = res.data.map((item: any) => ({ id: item.id, value: item.id, name: item.fullName })) }) + isFirst.value = false } else { isAdmin.value = false - ruleForm.value.customerId = res.data.id - ruleForm.value.customerName = res.data.fullName + isFirst.value = false + setTimeout(() => { + ruleForm.value.customerId = res.data.id + ruleForm.value.customerName = res.data.fullName + }) } }) } @@ -117,18 +122,21 @@ ruleForm.value.isUrgent = String(res.data.data.isUrgent) ruleForm.value.isOnSiteCheck = String(res.data.data.isOnSiteCheck) processId.value = ruleForm.value.processId + setTimeout(() => { + isFirst.value = false + }) }) } } -onMounted(() => { - initDialog() -}) + // 获取是否加急下拉列表 const isUrgentList = ref<{ id: string; value: string; name: string }[]>() // 送检人列表 const personList = ref() // 检定单位 const measureCompanyList = ref<{ id: string; value: string; name: string }[]>() +// 委托方名录 +const customerList = ref([]) const fetchListData = () => { getDictByCode('isUrgent').then((res) => { isUrgentList.value = res.data @@ -141,8 +149,44 @@ getDictByCode('eqptmeasureCompany').then((res) => { measureCompanyList.value = res.data }) + getCustomerList().then((res) => { + customerList.value = res.data.rows + }) } -fetchListData() + +onMounted(async () => { + await fetchListData() + initDialog() +}) +// 自动填充委托方地址 +watch(() => ruleForm.value.customerId, (newVal) => { + if (isFirst.value) { + return + } + if (newVal) { + if (isAdmin.value) { + console.log('管理员') + // 委托方名称 + const name = companyList.value.filter(item => item.id === newVal)[0]?.name + // 寻找委托方地址 + if (customerList.value.filter((item: any) => item.customerName === name).length) { + ruleForm.value.customerAddress = customerList.value.filter((item: any) => item.customerName === name)[0].address + } + else { + ruleForm.value.customerAddress = '/' + } + } + else { + console.log('非管理员') + if (customerList.value.filter((item: any) => item.customerName === ruleForm.value.customerName).length) { + ruleForm.value.customerAddress = customerList.value.filter((item: any) => item.customerName === ruleForm.value.customerName)[0].address + } + else { + ruleForm.value.customerAddress = '/' + } + } + } +}) // 关闭弹窗 const close = () => { $router.back() @@ -264,7 +308,7 @@ ruleForm.value.id = submitId.value } ruleForm.value.customerSampleInfoList = tableRef.value.list - ruleForm.value.customerName = ruleForm.value.customerName ? ruleForm.value.customerName : companyList.value.filter(item => item.id === ruleForm.value.customerId)[0]?.name + ruleForm.value.customerName = companyList.value.filter(item => item.id === ruleForm.value.customerId)[0]?.name updateTask(ruleForm.value).then((res) => { submitId.value = res.data // close() @@ -451,11 +495,11 @@ - + + + + + - + diff --git a/src/views/tested/device/info/components/list.vue b/src/views/tested/device/info/components/list.vue index b3483a7..6f94889 100644 --- a/src/views/tested/device/info/components/list.vue +++ b/src/views/tested/device/info/components/list.vue @@ -1004,7 +1004,7 @@ type: 'html', // targetStyles: ['*'], // style: '@page {margin:0mm 0mm ;resolution: 1000dpi;}', - style: '@media print { @page {size: auto; margin: 0.2mm;resolution: 1000dpi; } body{margin:0 0px}}', + style: '@media print { @page { margin: 0mm;resolution: 500dpi; } body{margin:0 0px}}', // onPrintDialogClose: true, // targetStyles: ['*'], // 使用dom的所有样式,很重要 targetStyle: '*', @@ -1413,8 +1413,8 @@ - -
+ +
diff --git a/src/views/tested/device/info/components/printTag.vue b/src/views/tested/device/info/components/printTag.vue index 67bae68..4580932 100644 --- a/src/views/tested/device/info/components/printTag.vue +++ b/src/views/tested/device/info/components/printTag.vue @@ -72,10 +72,10 @@ .tag-container { background-color: #fff; width: 60mm; - height: 29mm; + height: 24mm; display: flex; - padding: 0 1.6mm; - transform: scaleY(0.9); + padding: 0 2mm; + // transform: scaleY(0.96); overflow: hidden; box-sizing: content-box; @@ -91,23 +91,23 @@ .info { display: flex; - font-size: 3mm; - font-family: "华文黑体"; + font-size: 3.1mm; + font-family: "微软雅黑"; } } .right-con { box-sizing: content-box; // padding-top: 2mm; - height: 28mm; + height: 24mm; display: flex; justify-content: center; flex-direction: column; - padding-left: 1mm; + padding-left: 0.5mm; .canvas { - width: 20mm; - height: 20mm; + width: 15mm; + height: 15mm; } } }