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..ecd717e 100644
--- a/src/components/QRcodeDeviceDialog/index.vue
+++ b/src/components/QRcodeDeviceDialog/index.vue
@@ -3,10 +3,10 @@
import { ref } from 'vue'
import { ElMessage, ElMessageBox } from 'element-plus'
import scanImg from '@/assets/images/scan.png'
-import { getInfoDetail } from '@/api/eqpt/device/info'
-
+import { devcieOrderSelect, getInfoDetail } from '@/api/eqpt/device/info'
// 弹窗显示
const emits = defineEmits(['confirm'])
+const multipleTableRef = ref()
const dialogVisible = ref(false)
const scanStatus = ref('0')
const initDialog = () => {
@@ -23,7 +23,7 @@
checkoutList.value = val
}
// 扫描操作
-const onScanning = (code: string) => {
+function onScanning(code: string) {
scanStatus.value = '2'
console.log(code, '获取到的设备的id')// 获取到的条形码
ElMessage.success('扫描成功,获取设备信息中')
@@ -32,17 +32,35 @@
if ((res.data || {}).equipmentName) {
scanStatus.value = '2'
if (!list.value.filter((c: any) => c.id === (res.data || {}).id).length) {
- list.value.push({
- id: res.data.id,
- equipmentNo: res.data.equipmentNo,
+ // 先判断符不符合送检要求
+ devcieOrderSelect({
+ limit: '1',
+ offset: '1',
+ checkDestination: '1', // 鉴定去向 计量室
equipmentName: res.data.equipmentName,
- manufacturer: res.data.manufacturer,
- manufactureNo: res.data.manufactureNo,
- model: res.data.model,
- checkCycle: res.data.checkCycle,
- usePosition: res.data.usePosition,
directorName: res.data.directorName,
- } as any)
+ manufactureNo: res.data.manufactureNo,
+ manufacturer: res.data.manufacturer,
+ }).then((res1) => {
+ if (res1.data.rows.length) {
+ list.value.push({
+ id: res.data.id,
+ equipmentNo: res.data.equipmentNo,
+ equipmentName: res.data.equipmentName,
+ manufacturer: res.data.manufacturer,
+ manufactureNo: res.data.manufactureNo,
+ model: res.data.model,
+ checkCycle: res.data.checkCycle,
+ usePosition: res.data.usePosition,
+ directorName: res.data.directorName,
+ } as any)
+ // 自动选中
+ multipleTableRef.value!.toggleRowSelection(list.value[list.value.length - 1], undefined)
+ }
+ else {
+ ElMessage.warning('该设备不符合送检要求')
+ }
+ })
}
else {
ElMessage.warning('设备已扫描')
@@ -94,7 +112,7 @@
caseFormat = false
}
var char = String.fromCharCode(code)
- console.log(char, 'char')
+ // console.log(char, 'char')
if (codeString == '') {
codeString += char
}
@@ -106,7 +124,7 @@
}
window.onkeydown = function (e) {
- console.log('扫码枪识别成功')
+ // console.log('扫码枪识别成功')
var nextTime1 = new Date().getTime()
var lastTime1
if (e.which == 13) {
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..ecd717e 100644
--- a/src/components/QRcodeDeviceDialog/index.vue
+++ b/src/components/QRcodeDeviceDialog/index.vue
@@ -3,10 +3,10 @@
import { ref } from 'vue'
import { ElMessage, ElMessageBox } from 'element-plus'
import scanImg from '@/assets/images/scan.png'
-import { getInfoDetail } from '@/api/eqpt/device/info'
-
+import { devcieOrderSelect, getInfoDetail } from '@/api/eqpt/device/info'
// 弹窗显示
const emits = defineEmits(['confirm'])
+const multipleTableRef = ref()
const dialogVisible = ref(false)
const scanStatus = ref('0')
const initDialog = () => {
@@ -23,7 +23,7 @@
checkoutList.value = val
}
// 扫描操作
-const onScanning = (code: string) => {
+function onScanning(code: string) {
scanStatus.value = '2'
console.log(code, '获取到的设备的id')// 获取到的条形码
ElMessage.success('扫描成功,获取设备信息中')
@@ -32,17 +32,35 @@
if ((res.data || {}).equipmentName) {
scanStatus.value = '2'
if (!list.value.filter((c: any) => c.id === (res.data || {}).id).length) {
- list.value.push({
- id: res.data.id,
- equipmentNo: res.data.equipmentNo,
+ // 先判断符不符合送检要求
+ devcieOrderSelect({
+ limit: '1',
+ offset: '1',
+ checkDestination: '1', // 鉴定去向 计量室
equipmentName: res.data.equipmentName,
- manufacturer: res.data.manufacturer,
- manufactureNo: res.data.manufactureNo,
- model: res.data.model,
- checkCycle: res.data.checkCycle,
- usePosition: res.data.usePosition,
directorName: res.data.directorName,
- } as any)
+ manufactureNo: res.data.manufactureNo,
+ manufacturer: res.data.manufacturer,
+ }).then((res1) => {
+ if (res1.data.rows.length) {
+ list.value.push({
+ id: res.data.id,
+ equipmentNo: res.data.equipmentNo,
+ equipmentName: res.data.equipmentName,
+ manufacturer: res.data.manufacturer,
+ manufactureNo: res.data.manufactureNo,
+ model: res.data.model,
+ checkCycle: res.data.checkCycle,
+ usePosition: res.data.usePosition,
+ directorName: res.data.directorName,
+ } as any)
+ // 自动选中
+ multipleTableRef.value!.toggleRowSelection(list.value[list.value.length - 1], undefined)
+ }
+ else {
+ ElMessage.warning('该设备不符合送检要求')
+ }
+ })
}
else {
ElMessage.warning('设备已扫描')
@@ -94,7 +112,7 @@
caseFormat = false
}
var char = String.fromCharCode(code)
- console.log(char, 'char')
+ // console.log(char, 'char')
if (codeString == '') {
codeString += char
}
@@ -106,7 +124,7 @@
}
window.onkeydown = function (e) {
- console.log('扫码枪识别成功')
+ // console.log('扫码枪识别成功')
var nextTime1 = new Date().getTime()
var lastTime1
if (e.which == 13) {
diff --git a/src/components/scanEquipmentDialog/index.vue b/src/components/scanEquipmentDialog/index.vue
index c097677..a32607d 100644
--- a/src/components/scanEquipmentDialog/index.vue
+++ b/src/components/scanEquipmentDialog/index.vue
@@ -6,6 +6,7 @@
import scanImg from '@/assets/images/scan.png'
import { getDictByCode } from '@/api/system/dict'
import { getReadList, getReaderEquipmentList } from '@/api/reader'
+import { devcieOrderSelect } from '@/api/eqpt/device/info'
// 扫描状态,未开始0,正在扫描1,扫描结束2
const props = defineProps({
@@ -20,8 +21,10 @@
},
})
const emits = defineEmits(['confirm'])
+const $route = useRoute()
const dialogVisible = ref(false) // 弹窗显示
const multipleTableRef = ref()
+const loading = ref(false)
const scanStatus = ref('0')
const isBinding = ref(false) // 是否是标签绑定
const pageType = ref('') // 页面类型、表格list、需要提醒是否绑定,detail详情不提醒
@@ -108,7 +111,7 @@
})
}
else {
- getReaderEquipmentList(response.data).then((res) => {
+ getReaderEquipmentList(response.data).then(async (res) => {
list.value = res.data.map((item: { validDate: string; compulsoryVerification: string | number; mesureType: string ;managerState: string }) => {
return {
...item,
@@ -118,6 +121,35 @@
managerStateName: managerStateMap.value[item.managerState], // 管理状态
}
})
+ // 任务单-- 做校验全部勾选
+ if ($route.path.includes('meteringtask')) {
+ loading.value = true
+ // 任务单添加设备需要判断符不符合送检要求
+ const dataBak = JSON.parse(JSON.stringify(list.value))
+ list.value = []
+ await Promise.all(dataBak.map(async (item: any) => {
+ await devcieOrderSelect({
+ limit: 1,
+ offset: 1,
+ checkDestination: '1', // 鉴定去向 计量室
+ equipmentName: item.equipmentName,
+ directorName: item.directorName,
+ manufactureNo: item.manufactureNo,
+ manufacturer: item.manufacturer,
+ }).then((res) => {
+ if (res.data.rows.length) {
+ list.value.push({
+ ...item,
+ })
+ }
+ })
+ }))
+ // 自动全部勾选
+ multipleTableRef.value.toggleAllSelection()
+ loading.value = false
+ // 提示
+ ElMessage.warning(`共扫描到${dataBak.length}台设备,其中${dataBak.length - list.value.length}台不符合送检要求`)
+ }
})
}
}
@@ -167,7 +199,7 @@
扫描到 {{ list.length }} 个标签{{ list.length > 1 ? ',请选择需要绑定的标签' : '' }}
-
+
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..ecd717e 100644
--- a/src/components/QRcodeDeviceDialog/index.vue
+++ b/src/components/QRcodeDeviceDialog/index.vue
@@ -3,10 +3,10 @@
import { ref } from 'vue'
import { ElMessage, ElMessageBox } from 'element-plus'
import scanImg from '@/assets/images/scan.png'
-import { getInfoDetail } from '@/api/eqpt/device/info'
-
+import { devcieOrderSelect, getInfoDetail } from '@/api/eqpt/device/info'
// 弹窗显示
const emits = defineEmits(['confirm'])
+const multipleTableRef = ref()
const dialogVisible = ref(false)
const scanStatus = ref('0')
const initDialog = () => {
@@ -23,7 +23,7 @@
checkoutList.value = val
}
// 扫描操作
-const onScanning = (code: string) => {
+function onScanning(code: string) {
scanStatus.value = '2'
console.log(code, '获取到的设备的id')// 获取到的条形码
ElMessage.success('扫描成功,获取设备信息中')
@@ -32,17 +32,35 @@
if ((res.data || {}).equipmentName) {
scanStatus.value = '2'
if (!list.value.filter((c: any) => c.id === (res.data || {}).id).length) {
- list.value.push({
- id: res.data.id,
- equipmentNo: res.data.equipmentNo,
+ // 先判断符不符合送检要求
+ devcieOrderSelect({
+ limit: '1',
+ offset: '1',
+ checkDestination: '1', // 鉴定去向 计量室
equipmentName: res.data.equipmentName,
- manufacturer: res.data.manufacturer,
- manufactureNo: res.data.manufactureNo,
- model: res.data.model,
- checkCycle: res.data.checkCycle,
- usePosition: res.data.usePosition,
directorName: res.data.directorName,
- } as any)
+ manufactureNo: res.data.manufactureNo,
+ manufacturer: res.data.manufacturer,
+ }).then((res1) => {
+ if (res1.data.rows.length) {
+ list.value.push({
+ id: res.data.id,
+ equipmentNo: res.data.equipmentNo,
+ equipmentName: res.data.equipmentName,
+ manufacturer: res.data.manufacturer,
+ manufactureNo: res.data.manufactureNo,
+ model: res.data.model,
+ checkCycle: res.data.checkCycle,
+ usePosition: res.data.usePosition,
+ directorName: res.data.directorName,
+ } as any)
+ // 自动选中
+ multipleTableRef.value!.toggleRowSelection(list.value[list.value.length - 1], undefined)
+ }
+ else {
+ ElMessage.warning('该设备不符合送检要求')
+ }
+ })
}
else {
ElMessage.warning('设备已扫描')
@@ -94,7 +112,7 @@
caseFormat = false
}
var char = String.fromCharCode(code)
- console.log(char, 'char')
+ // console.log(char, 'char')
if (codeString == '') {
codeString += char
}
@@ -106,7 +124,7 @@
}
window.onkeydown = function (e) {
- console.log('扫码枪识别成功')
+ // console.log('扫码枪识别成功')
var nextTime1 = new Date().getTime()
var lastTime1
if (e.which == 13) {
diff --git a/src/components/scanEquipmentDialog/index.vue b/src/components/scanEquipmentDialog/index.vue
index c097677..a32607d 100644
--- a/src/components/scanEquipmentDialog/index.vue
+++ b/src/components/scanEquipmentDialog/index.vue
@@ -6,6 +6,7 @@
import scanImg from '@/assets/images/scan.png'
import { getDictByCode } from '@/api/system/dict'
import { getReadList, getReaderEquipmentList } from '@/api/reader'
+import { devcieOrderSelect } from '@/api/eqpt/device/info'
// 扫描状态,未开始0,正在扫描1,扫描结束2
const props = defineProps({
@@ -20,8 +21,10 @@
},
})
const emits = defineEmits(['confirm'])
+const $route = useRoute()
const dialogVisible = ref(false) // 弹窗显示
const multipleTableRef = ref()
+const loading = ref(false)
const scanStatus = ref('0')
const isBinding = ref(false) // 是否是标签绑定
const pageType = ref('') // 页面类型、表格list、需要提醒是否绑定,detail详情不提醒
@@ -108,7 +111,7 @@
})
}
else {
- getReaderEquipmentList(response.data).then((res) => {
+ getReaderEquipmentList(response.data).then(async (res) => {
list.value = res.data.map((item: { validDate: string; compulsoryVerification: string | number; mesureType: string ;managerState: string }) => {
return {
...item,
@@ -118,6 +121,35 @@
managerStateName: managerStateMap.value[item.managerState], // 管理状态
}
})
+ // 任务单-- 做校验全部勾选
+ if ($route.path.includes('meteringtask')) {
+ loading.value = true
+ // 任务单添加设备需要判断符不符合送检要求
+ const dataBak = JSON.parse(JSON.stringify(list.value))
+ list.value = []
+ await Promise.all(dataBak.map(async (item: any) => {
+ await devcieOrderSelect({
+ limit: 1,
+ offset: 1,
+ checkDestination: '1', // 鉴定去向 计量室
+ equipmentName: item.equipmentName,
+ directorName: item.directorName,
+ manufactureNo: item.manufactureNo,
+ manufacturer: item.manufacturer,
+ }).then((res) => {
+ if (res.data.rows.length) {
+ list.value.push({
+ ...item,
+ })
+ }
+ })
+ }))
+ // 自动全部勾选
+ multipleTableRef.value.toggleAllSelection()
+ loading.value = false
+ // 提示
+ ElMessage.warning(`共扫描到${dataBak.length}台设备,其中${dataBak.length - list.value.length}台不符合送检要求`)
+ }
})
}
}
@@ -167,7 +199,7 @@
扫描到 {{ list.length }} 个标签{{ list.length > 1 ? ',请选择需要绑定的标签' : '' }}
-
+
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..ecd717e 100644
--- a/src/components/QRcodeDeviceDialog/index.vue
+++ b/src/components/QRcodeDeviceDialog/index.vue
@@ -3,10 +3,10 @@
import { ref } from 'vue'
import { ElMessage, ElMessageBox } from 'element-plus'
import scanImg from '@/assets/images/scan.png'
-import { getInfoDetail } from '@/api/eqpt/device/info'
-
+import { devcieOrderSelect, getInfoDetail } from '@/api/eqpt/device/info'
// 弹窗显示
const emits = defineEmits(['confirm'])
+const multipleTableRef = ref()
const dialogVisible = ref(false)
const scanStatus = ref('0')
const initDialog = () => {
@@ -23,7 +23,7 @@
checkoutList.value = val
}
// 扫描操作
-const onScanning = (code: string) => {
+function onScanning(code: string) {
scanStatus.value = '2'
console.log(code, '获取到的设备的id')// 获取到的条形码
ElMessage.success('扫描成功,获取设备信息中')
@@ -32,17 +32,35 @@
if ((res.data || {}).equipmentName) {
scanStatus.value = '2'
if (!list.value.filter((c: any) => c.id === (res.data || {}).id).length) {
- list.value.push({
- id: res.data.id,
- equipmentNo: res.data.equipmentNo,
+ // 先判断符不符合送检要求
+ devcieOrderSelect({
+ limit: '1',
+ offset: '1',
+ checkDestination: '1', // 鉴定去向 计量室
equipmentName: res.data.equipmentName,
- manufacturer: res.data.manufacturer,
- manufactureNo: res.data.manufactureNo,
- model: res.data.model,
- checkCycle: res.data.checkCycle,
- usePosition: res.data.usePosition,
directorName: res.data.directorName,
- } as any)
+ manufactureNo: res.data.manufactureNo,
+ manufacturer: res.data.manufacturer,
+ }).then((res1) => {
+ if (res1.data.rows.length) {
+ list.value.push({
+ id: res.data.id,
+ equipmentNo: res.data.equipmentNo,
+ equipmentName: res.data.equipmentName,
+ manufacturer: res.data.manufacturer,
+ manufactureNo: res.data.manufactureNo,
+ model: res.data.model,
+ checkCycle: res.data.checkCycle,
+ usePosition: res.data.usePosition,
+ directorName: res.data.directorName,
+ } as any)
+ // 自动选中
+ multipleTableRef.value!.toggleRowSelection(list.value[list.value.length - 1], undefined)
+ }
+ else {
+ ElMessage.warning('该设备不符合送检要求')
+ }
+ })
}
else {
ElMessage.warning('设备已扫描')
@@ -94,7 +112,7 @@
caseFormat = false
}
var char = String.fromCharCode(code)
- console.log(char, 'char')
+ // console.log(char, 'char')
if (codeString == '') {
codeString += char
}
@@ -106,7 +124,7 @@
}
window.onkeydown = function (e) {
- console.log('扫码枪识别成功')
+ // console.log('扫码枪识别成功')
var nextTime1 = new Date().getTime()
var lastTime1
if (e.which == 13) {
diff --git a/src/components/scanEquipmentDialog/index.vue b/src/components/scanEquipmentDialog/index.vue
index c097677..a32607d 100644
--- a/src/components/scanEquipmentDialog/index.vue
+++ b/src/components/scanEquipmentDialog/index.vue
@@ -6,6 +6,7 @@
import scanImg from '@/assets/images/scan.png'
import { getDictByCode } from '@/api/system/dict'
import { getReadList, getReaderEquipmentList } from '@/api/reader'
+import { devcieOrderSelect } from '@/api/eqpt/device/info'
// 扫描状态,未开始0,正在扫描1,扫描结束2
const props = defineProps({
@@ -20,8 +21,10 @@
},
})
const emits = defineEmits(['confirm'])
+const $route = useRoute()
const dialogVisible = ref(false) // 弹窗显示
const multipleTableRef = ref()
+const loading = ref(false)
const scanStatus = ref('0')
const isBinding = ref(false) // 是否是标签绑定
const pageType = ref('') // 页面类型、表格list、需要提醒是否绑定,detail详情不提醒
@@ -108,7 +111,7 @@
})
}
else {
- getReaderEquipmentList(response.data).then((res) => {
+ getReaderEquipmentList(response.data).then(async (res) => {
list.value = res.data.map((item: { validDate: string; compulsoryVerification: string | number; mesureType: string ;managerState: string }) => {
return {
...item,
@@ -118,6 +121,35 @@
managerStateName: managerStateMap.value[item.managerState], // 管理状态
}
})
+ // 任务单-- 做校验全部勾选
+ if ($route.path.includes('meteringtask')) {
+ loading.value = true
+ // 任务单添加设备需要判断符不符合送检要求
+ const dataBak = JSON.parse(JSON.stringify(list.value))
+ list.value = []
+ await Promise.all(dataBak.map(async (item: any) => {
+ await devcieOrderSelect({
+ limit: 1,
+ offset: 1,
+ checkDestination: '1', // 鉴定去向 计量室
+ equipmentName: item.equipmentName,
+ directorName: item.directorName,
+ manufactureNo: item.manufactureNo,
+ manufacturer: item.manufacturer,
+ }).then((res) => {
+ if (res.data.rows.length) {
+ list.value.push({
+ ...item,
+ })
+ }
+ })
+ }))
+ // 自动全部勾选
+ multipleTableRef.value.toggleAllSelection()
+ loading.value = false
+ // 提示
+ ElMessage.warning(`共扫描到${dataBak.length}台设备,其中${dataBak.length - list.value.length}台不符合送检要求`)
+ }
})
}
}
@@ -167,7 +199,7 @@
扫描到 {{ list.length }} 个标签{{ list.length > 1 ? ',请选择需要绑定的标签' : '' }}
-
+
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..ecd717e 100644
--- a/src/components/QRcodeDeviceDialog/index.vue
+++ b/src/components/QRcodeDeviceDialog/index.vue
@@ -3,10 +3,10 @@
import { ref } from 'vue'
import { ElMessage, ElMessageBox } from 'element-plus'
import scanImg from '@/assets/images/scan.png'
-import { getInfoDetail } from '@/api/eqpt/device/info'
-
+import { devcieOrderSelect, getInfoDetail } from '@/api/eqpt/device/info'
// 弹窗显示
const emits = defineEmits(['confirm'])
+const multipleTableRef = ref()
const dialogVisible = ref(false)
const scanStatus = ref('0')
const initDialog = () => {
@@ -23,7 +23,7 @@
checkoutList.value = val
}
// 扫描操作
-const onScanning = (code: string) => {
+function onScanning(code: string) {
scanStatus.value = '2'
console.log(code, '获取到的设备的id')// 获取到的条形码
ElMessage.success('扫描成功,获取设备信息中')
@@ -32,17 +32,35 @@
if ((res.data || {}).equipmentName) {
scanStatus.value = '2'
if (!list.value.filter((c: any) => c.id === (res.data || {}).id).length) {
- list.value.push({
- id: res.data.id,
- equipmentNo: res.data.equipmentNo,
+ // 先判断符不符合送检要求
+ devcieOrderSelect({
+ limit: '1',
+ offset: '1',
+ checkDestination: '1', // 鉴定去向 计量室
equipmentName: res.data.equipmentName,
- manufacturer: res.data.manufacturer,
- manufactureNo: res.data.manufactureNo,
- model: res.data.model,
- checkCycle: res.data.checkCycle,
- usePosition: res.data.usePosition,
directorName: res.data.directorName,
- } as any)
+ manufactureNo: res.data.manufactureNo,
+ manufacturer: res.data.manufacturer,
+ }).then((res1) => {
+ if (res1.data.rows.length) {
+ list.value.push({
+ id: res.data.id,
+ equipmentNo: res.data.equipmentNo,
+ equipmentName: res.data.equipmentName,
+ manufacturer: res.data.manufacturer,
+ manufactureNo: res.data.manufactureNo,
+ model: res.data.model,
+ checkCycle: res.data.checkCycle,
+ usePosition: res.data.usePosition,
+ directorName: res.data.directorName,
+ } as any)
+ // 自动选中
+ multipleTableRef.value!.toggleRowSelection(list.value[list.value.length - 1], undefined)
+ }
+ else {
+ ElMessage.warning('该设备不符合送检要求')
+ }
+ })
}
else {
ElMessage.warning('设备已扫描')
@@ -94,7 +112,7 @@
caseFormat = false
}
var char = String.fromCharCode(code)
- console.log(char, 'char')
+ // console.log(char, 'char')
if (codeString == '') {
codeString += char
}
@@ -106,7 +124,7 @@
}
window.onkeydown = function (e) {
- console.log('扫码枪识别成功')
+ // console.log('扫码枪识别成功')
var nextTime1 = new Date().getTime()
var lastTime1
if (e.which == 13) {
diff --git a/src/components/scanEquipmentDialog/index.vue b/src/components/scanEquipmentDialog/index.vue
index c097677..a32607d 100644
--- a/src/components/scanEquipmentDialog/index.vue
+++ b/src/components/scanEquipmentDialog/index.vue
@@ -6,6 +6,7 @@
import scanImg from '@/assets/images/scan.png'
import { getDictByCode } from '@/api/system/dict'
import { getReadList, getReaderEquipmentList } from '@/api/reader'
+import { devcieOrderSelect } from '@/api/eqpt/device/info'
// 扫描状态,未开始0,正在扫描1,扫描结束2
const props = defineProps({
@@ -20,8 +21,10 @@
},
})
const emits = defineEmits(['confirm'])
+const $route = useRoute()
const dialogVisible = ref(false) // 弹窗显示
const multipleTableRef = ref()
+const loading = ref(false)
const scanStatus = ref('0')
const isBinding = ref(false) // 是否是标签绑定
const pageType = ref('') // 页面类型、表格list、需要提醒是否绑定,detail详情不提醒
@@ -108,7 +111,7 @@
})
}
else {
- getReaderEquipmentList(response.data).then((res) => {
+ getReaderEquipmentList(response.data).then(async (res) => {
list.value = res.data.map((item: { validDate: string; compulsoryVerification: string | number; mesureType: string ;managerState: string }) => {
return {
...item,
@@ -118,6 +121,35 @@
managerStateName: managerStateMap.value[item.managerState], // 管理状态
}
})
+ // 任务单-- 做校验全部勾选
+ if ($route.path.includes('meteringtask')) {
+ loading.value = true
+ // 任务单添加设备需要判断符不符合送检要求
+ const dataBak = JSON.parse(JSON.stringify(list.value))
+ list.value = []
+ await Promise.all(dataBak.map(async (item: any) => {
+ await devcieOrderSelect({
+ limit: 1,
+ offset: 1,
+ checkDestination: '1', // 鉴定去向 计量室
+ equipmentName: item.equipmentName,
+ directorName: item.directorName,
+ manufactureNo: item.manufactureNo,
+ manufacturer: item.manufacturer,
+ }).then((res) => {
+ if (res.data.rows.length) {
+ list.value.push({
+ ...item,
+ })
+ }
+ })
+ }))
+ // 自动全部勾选
+ multipleTableRef.value.toggleAllSelection()
+ loading.value = false
+ // 提示
+ ElMessage.warning(`共扫描到${dataBak.length}台设备,其中${dataBak.length - list.value.length}台不符合送检要求`)
+ }
})
}
}
@@ -167,7 +199,7 @@
扫描到 {{ list.length }} 个标签{{ list.length > 1 ? ',请选择需要绑定的标签' : '' }}
-
+
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..97b0543 100644
--- a/src/views/tested/device/info/components/printTag.vue
+++ b/src/views/tested/device/info/components/printTag.vue
@@ -72,12 +72,13 @@
.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;
+ border-top: 2mm solid transparent;
.left-info {
// height: 55mm;
@@ -91,23 +92,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;
}
}
}