From 95bad8cf82d39bb548f3a5358e4bf50e10d66db9 Mon Sep 17 00:00:00 2001 From: fengyuan_yang <1976974459@qq.com> Date: Sun, 23 Jun 2024 13:52:03 +0800 Subject: [PATCH] =?UTF-8?q?2024-06-23=20=E5=8A=9F=E8=83=BD=E4=BC=98?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/qc/qc.js | 15 +- src/views/modules/eam/eam_device_list.vue | 20 +- src/views/modules/qc/FAIResultEntry.vue | 111 ++++++- src/views/modules/qc/FQCResultEntry.vue | 117 +++++++- src/views/modules/qc/IPQCResultEntry.vue | 111 ++++++- src/views/modules/qc/IQCResultEntry.vue | 112 +++++++- src/views/modules/qc/qcItem.vue | 335 ++++++++++++++++++++-- src/views/modules/qc/qcTemplate.vue | 253 +++++++++++++--- 8 files changed, 978 insertions(+), 96 deletions(-) diff --git a/src/api/qc/qc.js b/src/api/qc/qc.js index 51f05d9..78d2e79 100644 --- a/src/api/qc/qc.js +++ b/src/api/qc/qc.js @@ -169,6 +169,15 @@ export const actionFQCInspection = data => createAPI(`/pms/qc/actionFQCInspectio export const dataAcquisition = data => createAPI(`/pms/qc/dataAcquisition`,'post',data) export const getEquipmentNoList = data => createAPI(`/pms/qc/getEquipmentNoList`,'post',data) export const getResponsibleOperatorList = data => createAPI(`/pms/qc/getResponsibleOperatorList`,'post',data) - - - +export const getDataContentList = data => createAPI(`/pms/qc/getDataContentList`,'post',data) +export const getObjectList = data => createAPI(`/pms/qc/getObjectList`,'post',data) +export const getObjectListBy = data => createAPI(`/pms/qc/getObjectListBy`,'post',data) +export const addItemObject = data => createAPI(`/pms/qc/addItemObject`,'post',data) +export const deleteItemObject = data => createAPI(`/pms/qc/deleteItemObject`,'post',data) +export const updateItemObject = data => createAPI(`/pms/qc/updateItemObject`,'post',data) +export const getIQCItemObjectList = data => createAPI(`/pms/qc/getIQCItemObjectList`,'post',data) +export const getFAIItemObjectList = data => createAPI(`/pms/qc/getFAIItemObjectList`,'post',data) +export const getFQCItemObjectList = data => createAPI(`/pms/qc/getFQCItemObjectList`,'post',data) +export const getIPQCItemObjectList = data => createAPI(`/pms/qc/getIPQCItemObjectList`,'post',data) +export const getInspectionStandards = data => createAPI(`/pms/qc/getInspectionStandards`,'post',data) +export const saveInspectionStandard = data => createAPI(`/pms/qc/saveInspectionStandard`,'post',data) diff --git a/src/views/modules/eam/eam_device_list.vue b/src/views/modules/eam/eam_device_list.vue index 25a45f7..391749e 100644 --- a/src/views/modules/eam/eam_device_list.vue +++ b/src/views/modules/eam/eam_device_list.vue @@ -4112,8 +4112,8 @@ this.itemModalFlag=true; }, - saveItemAvailable(){ - if(this.itemData.availableValue==''||this.itemData.availableValue==null){ + saveItemAvailable () { + if (this.itemData.availableValue == '' || this.itemData.availableValue == null) { this.$alert("请输入可选值!",'错误', { confirmButtonText: '确定' }) @@ -4140,7 +4140,7 @@ }) }, - deleteItemAvailable(row){ + deleteItemAvailable (row) { this.$confirm(`是否删除这个可选值?`, '提示', { confirmButtonText: '确定', cancelButtonText: '取消', @@ -4169,7 +4169,7 @@ }) }, - addPlanModal(type){ + addPlanModal (type) { this.planModalData = { flag: '1', objectList: [], @@ -4188,10 +4188,10 @@ planEndDate: '', userId: this.$store.state.user.name, remark: '', - }; - this.planModalDisableFlag = false; - this.getObjectList(); - this.planModalFlag = true; + } + this.planModalDisableFlag = false + this.getObjectList() + this.planModalFlag = true }, getObjectList(){ @@ -4200,11 +4200,11 @@ }) }, - selectionChangeHandle(val){ + selectionChangeHandle (val) { this.objectSelectionList = val }, - saveData(){ + saveData () { if (this.planModalData.planDesc == '' || this.planModalData.planDesc == null) { this.$alert('请输入计划描述 !', '错误', { confirmButtonText: '确定' diff --git a/src/views/modules/qc/FAIResultEntry.vue b/src/views/modules/qc/FAIResultEntry.vue index 0910768..e91e882 100644 --- a/src/views/modules/qc/FAIResultEntry.vue +++ b/src/views/modules/qc/FAIResultEntry.vue @@ -832,6 +832,53 @@ + + +
+ + + + + + + + +
+ + 保存 + 关闭 + +
+ @@ -875,6 +922,7 @@ actionFAIInspection, // 开始检验 dataAcquisition, // 数据采集 getResponsibleOperatorList, // 获取责任人列表 + getFAIItemObjectList, // 查询项目设备 } from "@/api/qc/qc.js" import {getTableDefaultListLanguage, getTableUserListLanguage} from "@/api/table.js" import Chooselist from '@/views/modules/common/Chooselist_eam' @@ -2259,7 +2307,36 @@ fixed: '', }, ], - acquisitionList: [] + acquisitionList: [], + ItemObjectModelFlag: false, + itemObjectList: [], + itemObjectColumnList: [ + { + columnProp: 'itemNo', + headerAlign: "center", + align: "center", + columnLabel: '项目编码', + columnHidden: false, + columnImage: false, + status: true, + columnWidth: 120, + }, + { + columnProp: 'itemDesc', + headerAlign: "center", + align: "left", + columnLabel: '项目名称', + columnHidden: false, + columnImage: false, + status: true, + columnWidth: 200, + }, + ], + actionData: { + site: '', + buNo: '', + inspectionNo: '' + } } }, @@ -3131,7 +3208,8 @@ deleteFile (row) { let tempData = { site: row.orderRef1, - inspectionNo: row.orderRef2 + inspectionNo: row.orderRef2, + buNo: row.orderRef4 } this.$confirm('确定要删除此文件?', '提示', { confirmButtonText: '确定', @@ -3297,17 +3375,37 @@ // 开始检验 actionModal (row) { + this.actionData = { + site: row.site, + buNo: row.buNo, + inspectionNo: row.inspectionNo + } + getFAIItemObjectList(this.actionData).then(({data}) => { + if (data && data.code === 0) { + this.itemObjectList = data.rows + this.ItemObjectModelFlag = true + } else { + this.$alert(data.msg, '错误', { + confirmButtonText: '确定' + }) + } + }) + }, + + // 开始检验 + actionModal2 () { this.$confirm(`确认开始检验?`, '提示', { confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning' }).then(() => { let tempData = { - site: row.site, - buNo: row.buNo, - inspectionNo: row.inspectionNo, + site: this.actionData.site, + buNo: this.actionData.buNo, + inspectionNo: this.actionData.inspectionNo, actionBy: this.$store.state.user.name, - state: '待检验' + state: '待检验', + equipmentList: this.itemObjectList } actionFAIInspection(tempData).then(({data}) => { if (data && data.code === 0) { @@ -3318,6 +3416,7 @@ duration: 1500, onClose: () => {} }) + this.ItemObjectModelFlag = false } else { this.$alert(data.msg, '错误', { confirmButtonText: '确定' diff --git a/src/views/modules/qc/FQCResultEntry.vue b/src/views/modules/qc/FQCResultEntry.vue index 2d18585..4500674 100644 --- a/src/views/modules/qc/FQCResultEntry.vue +++ b/src/views/modules/qc/FQCResultEntry.vue @@ -808,6 +808,53 @@ + + +
+ + + + + + + + +
+ + 保存 + 关闭 + +
+ @@ -852,6 +899,7 @@ actionFQCInspection, // 开始检验 dataAcquisition, // 数据采集 getResponsibleOperatorList, // 获取责任人列表 + getFQCItemObjectList, // 查询项目设备 } from "@/api/qc/qc.js" import {getTableDefaultListLanguage, getTableUserListLanguage} from "@/api/table.js" import Chooselist from '@/views/modules/common/Chooselist_eam' @@ -2234,7 +2282,36 @@ fixed: '', }, ], - acquisitionList: [] + acquisitionList: [], + ItemObjectModelFlag: false, + itemObjectList: [], + itemObjectColumnList: [ + { + columnProp: 'itemNo', + headerAlign: "center", + align: "center", + columnLabel: '项目编码', + columnHidden: false, + columnImage: false, + status: true, + columnWidth: 120, + }, + { + columnProp: 'itemDesc', + headerAlign: "center", + align: "left", + columnLabel: '项目名称', + columnHidden: false, + columnImage: false, + status: true, + columnWidth: 200, + }, + ], + actionData: { + site: '', + buNo: '', + inspectionNo: '' + } } }, @@ -3105,7 +3182,8 @@ deleteFile (row) { let tempData = { site: row.orderRef1, - inspectionNo: row.orderRef2 + inspectionNo: row.orderRef2, + buNo: row.orderRef4 } this.$confirm('确定要删除此文件?', '提示', { confirmButtonText: '确定', @@ -3271,17 +3349,37 @@ // 开始检验 actionModal (row) { + this.actionData = { + site: row.site, + buNo: row.buNo, + inspectionNo: row.inspectionNo + } + getFQCItemObjectList(this.actionData).then(({data}) => { + if (data && data.code === 0) { + this.itemObjectList = data.rows + this.ItemObjectModelFlag = true + } else { + this.$alert(data.msg, '错误', { + confirmButtonText: '确定' + }) + } + }) + }, + + // 开始检验 + actionModal2 () { this.$confirm(`确认开始检验?`, '提示', { confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning' }).then(() => { let tempData = { - site: row.site, - buNo: row.buNo, - inspectionNo: row.inspectionNo, + site: this.actionData.site, + buNo: this.actionData.buNo, + inspectionNo: this.actionData.inspectionNo, actionBy: this.$store.state.user.name, - state: '待检验' + state: '待检验', + equipmentList: this.itemObjectList } actionFQCInspection(tempData).then(({data}) => { if (data && data.code === 0) { @@ -3292,6 +3390,7 @@ duration: 1500, onClose: () => {} }) + this.ItemObjectModelFlag = false } else { this.$alert(data.msg, '错误', { confirmButtonText: '确定' @@ -3347,12 +3446,6 @@ // 子明细记录信息查询 subDetailModal (row) { - // this.subDetailData.inspectionNo = row.inspectionNo - // this.subDetailData.itemNo = row.itemNo - // this.subDetailData.itemDesc = row.itemDesc - // this.subDetailData.defaultValue = row.defaultValue - // this.subDetailData.maxValue = row.maxValue - // this.subDetailData.minValue = row.minValue this.subDetailData = row selectFQCSubDetailedRecord(this.subDetailData).then(({data}) => { this.tableData = data.rows diff --git a/src/views/modules/qc/IPQCResultEntry.vue b/src/views/modules/qc/IPQCResultEntry.vue index f5b7f47..ccb958a 100644 --- a/src/views/modules/qc/IPQCResultEntry.vue +++ b/src/views/modules/qc/IPQCResultEntry.vue @@ -830,6 +830,53 @@ + + +
+ + + + + + + + +
+ + 保存 + 关闭 + +
+ @@ -872,6 +919,7 @@ actionIPQCInspection, // 开始检验 dataAcquisition, // 数据采集 getResponsibleOperatorList, // 获取责任人列表 + getIPQCItemObjectList, // 查询项目设备 } from "@/api/qc/qc.js" import {getTableDefaultListLanguage, getTableUserListLanguage} from "@/api/table.js" import Chooselist from '@/views/modules/common/Chooselist_eam' @@ -2288,7 +2336,36 @@ fixed: '', }, ], - acquisitionList: [] + acquisitionList: [], + ItemObjectModelFlag: false, + itemObjectList: [], + itemObjectColumnList: [ + { + columnProp: 'itemNo', + headerAlign: "center", + align: "center", + columnLabel: '项目编码', + columnHidden: false, + columnImage: false, + status: true, + columnWidth: 120, + }, + { + columnProp: 'itemDesc', + headerAlign: "center", + align: "left", + columnLabel: '项目名称', + columnHidden: false, + columnImage: false, + status: true, + columnWidth: 200, + }, + ], + actionData: { + site: '', + buNo: '', + inspectionNo: '' + } } }, @@ -2778,7 +2855,8 @@ deleteFile (row) { let tempData = { site: row.orderRef1, - inspectionNo: row.orderRef2 + inspectionNo: row.orderRef2, + buNo: row.orderRef4 } this.$confirm('确定要删除此文件?', '提示', { confirmButtonText: '确定', @@ -3336,17 +3414,37 @@ // 开始检验 actionModal (row) { + this.actionData = { + site: row.site, + buNo: row.buNo, + inspectionNo: row.inspectionNo + } + getIPQCItemObjectList(this.actionData).then(({data}) => { + if (data && data.code === 0) { + this.itemObjectList = data.rows + this.ItemObjectModelFlag = true + } else { + this.$alert(data.msg, '错误', { + confirmButtonText: '确定' + }) + } + }) + }, + + // 开始检验 + actionModal2 () { this.$confirm(`确认开始检验?`, '提示', { confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning' }).then(() => { let tempData = { - site: row.site, - buNo: row.buNo, - inspectionNo: row.inspectionNo, + site: this.actionData.site, + buNo: this.actionData.buNo, + inspectionNo: this.actionData.inspectionNo, actionBy: this.$store.state.user.name, - state: '待检验' + state: '待检验', + equipmentList: this.itemObjectList } actionIPQCInspection(tempData).then(({data}) => { if (data && data.code === 0) { @@ -3357,6 +3455,7 @@ duration: 1500, onClose: () => {} }) + this.ItemObjectModelFlag = false } else { this.$alert(data.msg, '错误', { confirmButtonText: '确定' diff --git a/src/views/modules/qc/IQCResultEntry.vue b/src/views/modules/qc/IQCResultEntry.vue index 4baafc3..dc1f77c 100644 --- a/src/views/modules/qc/IQCResultEntry.vue +++ b/src/views/modules/qc/IQCResultEntry.vue @@ -546,6 +546,51 @@ + + + + + + + + + + + + 保存 + 关闭 + + + @@ -579,6 +624,7 @@ actionIQCInspection, // 开始检验 dataAcquisition, // 数据采集 getResponsibleOperatorList, // 获取责任人列表 + getIQCItemObjectList, // 查询项目设备 } from "@/api/qc/qc.js" import {getTableDefaultListLanguage, getTableUserListLanguage} from "@/api/table.js" import Chooselist from '@/views/modules/common/Chooselist_eam' @@ -1584,7 +1630,34 @@ fixed: '', }, ], - acquisitionList: [] + acquisitionList: [], + ItemObjectModelFlag: false, + itemObjectList: [], + itemObjectColumnList: [ + { + columnProp: 'itemNo', + headerAlign: "center", + align: "center", + columnLabel: '项目编码', + columnHidden: false, + columnImage: false, + status: true, + }, + { + columnProp: 'itemDesc', + headerAlign: "center", + align: "left", + columnLabel: '项目名称', + columnHidden: false, + columnImage: false, + status: true, + }, + ], + actionData: { + site: '', + buNo: '', + inspectionNo: '' + } } }, @@ -1991,7 +2064,8 @@ deleteFile (row) { let tempData = { site: row.orderRef1, - inspectionNo: row.orderRef2 + inspectionNo: row.orderRef2, + buNo: row.orderRef4 } this.$confirm('确定要删除此文件?', '提示', { confirmButtonText: '确定', @@ -2151,17 +2225,37 @@ // 开始检验 actionModal (row) { + this.actionData = { + site: row.site, + buNo: row.buNo, + inspectionNo: row.inspectionNo + } + getIQCItemObjectList(this.actionData).then(({data}) => { + if (data && data.code === 0) { + this.itemObjectList = data.rows + this.ItemObjectModelFlag = true + } else { + this.$alert(data.msg, '错误', { + confirmButtonText: '确定' + }) + } + }) + }, + + // 开始检验 + actionModal2 () { this.$confirm(`确认开始检验?`, '提示', { confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning' }).then(() => { let tempData = { - site: row.site, - buNo: row.buNo, - inspectionNo: row.inspectionNo, + site: this.actionData.site, + buNo: this.actionData.buNo, + inspectionNo: this.actionData.inspectionNo, actionBy: this.$store.state.user.name, - state: '待检验' + state: '待检验', + equipmentList: this.itemObjectList } actionIQCInspection(tempData).then(({data}) => { if (data && data.code === 0) { @@ -2172,6 +2266,7 @@ duration: 1500, onClose: () => {} }) + this.ItemObjectModelFlag = false } else { this.$alert(data.msg, '错误', { confirmButtonText: '确定' @@ -2726,4 +2821,9 @@ .numInput /deep/ .el-input__inner{ text-align: right; } +.el-table /deep/ .cell{ + height: auto; + line-height: 1.5; +} + diff --git a/src/views/modules/qc/qcItem.vue b/src/views/modules/qc/qcItem.vue index 8d77a56..b884d3e 100644 --- a/src/views/modules/qc/qcItem.vue +++ b/src/views/modules/qc/qcItem.vue @@ -65,7 +65,6 @@ :height="height" :data="dataList" border - v-loading="dataListLoading" style="width: 100%;"> 编辑 删除 + 采集设备配置 @@ -109,7 +109,7 @@ - + - - + + + + + + + + + + + + + v-for = "i in dataContentList" + :key = "i.contentDesc" + :label = "i.contentDesc" + :value = "i.contentDesc"> @@ -266,7 +276,6 @@ :data="methodList" @row-dblclick="getRowData" border - v-loading="dataListLoading" style="width: 100%;"> + + +
+ + + + + + + + + 查询 + + +
+ + + 可选设备: + + + + + + + + + + +
+ 添加>> +
+
+ 删除<< +
+
+ + 已有设备: + + + + + + + + + + + + +
+ + 保存 + 关闭 + +
+ @@ -307,11 +422,17 @@ queryMethodList, // 查询检验方法 getSiteAndBuByUserName, getEquipmentNoList, // 获取采集条件路径 + getDataContentList, // 获取采集数据内容 + getObjectList, // 获取设备列表 + getObjectListBy, + addItemObject, // 新增项目设备 + deleteItemObject, // 删除项目设备 + updateItemObject, // 修改项目设备 } from "@/api/qc/qc.js" import {getTableDefaultListLanguage, getTableUserListLanguage} from "@/api/table.js" import Chooselist from '@/views/modules/common/Chooselist_eam' import {userFavoriteList, saveUserFavorite, removeUserFavorite} from '@/api/userFavorite.js' - import qcUpload from "./qc_upload"; + import qcUpload from "./qc_upload" export default { components: { Chooselist, @@ -358,7 +479,6 @@ totalPage: 0, height: 200, dataList: [], - dataListLoading: false, modalFlag: false, modalDisableFlag: false, modalData: { @@ -390,7 +510,8 @@ collectionMethod: '', collectionMethodList: [], collectionCondition: '', - collectionConditionList: [] + collectionConditionList: [], + collectionDataContent: '' }, // 检验项目展示标头 columnList: [ @@ -819,6 +940,19 @@ authUpdate: false, authDelete: false, menuId: this.$route.meta.menuId, + dataContentList: [], + objectSelections1: [], + objectSelections2: [], + objectList1: [], + objectList2: [], + objectData: { + site: '', + buNo: '', + itemNo: '', + objectID: '', + objectDesc: '', + }, + objectModelFlag: false } }, @@ -846,6 +980,145 @@ }, methods: { + // 默认设备 + defaultChange (row) { + this.objectList2 = this.objectList2.map(val => { + if (val.objectID === row.objectID) { + return val + } + val.defaultFlag = 'N' + return val + }) + }, + + // 绑定项目的设备 + itemObjectModal (row) { + this.objectSelections1 = null + this.objectSelections2 = null + getObjectList(row).then(({data}) => { + this.objectList1 = data.row1 + this.objectList2 = data.row2 + }) + this.objectData = { + site: row.site, + buNo: row.buNo, + itemNo: row.itemNo, + objectID: '', + objectDesc: '', + } + this.objectModelFlag = true + }, + + // 选择设备 + getObjectList () { + // 查询所有设备 + getObjectListBy(this.objectData).then(({data}) => { + if (data && data.code === 0) { + this.objectList1 = data.rows + } else { + this.objectList1 = [] + } + }) + }, + + // 可选设备 + objectClickRow1 (row) { + this.$refs.objectTable1.toggleRowSelection(row) + }, + + // 已有设备 + objectClickRow2 (row) { + this.$refs.objectTable2.toggleRowSelection(row) + }, + + selectionObject1 (val) { + this.objectSelections1 = val + }, + + selectionObject2 (val) { + this.objectSelections2 = val + }, + + // 新增项目设备 + addObject () { + if (this.objectSelections1 == null || this.objectSelections1.length === 0) { + this.$message.warning('请选择可选设备!') + return + } + let inData = { + site: this.objectData.site, + buNo: this.objectData.buNo, + itemNo: this.objectData.itemNo, + objectList: this.objectSelections1 + } + addItemObject(inData).then(({data}) => { + if (data && data.code === 0) { + getObjectList(this.objectData).then(({data}) => { + this.objectList1 = data.row1 + this.objectList2 = data.row2 + }) + this.objectSelections1 = [] + } else { + this.$alert(data.msg, '错误', { + confirmButtonText: '确定' + }) + } + }) + }, + + // 删除项目设备 + deleteObject () { + if(this.objectSelections2 == null || this.objectSelections2.length === 0){ + this.$message.warning('请选择已有代理商!') + return + } + let inData = { + site: this.objectData.site, + buNo: this.objectData.buNo, + itemNo: this.objectData.itemNo, + objectList: this.objectSelections2 + } + deleteItemObject(inData).then(({data}) => { + if (data && data.code === 0) { + getObjectList(this.objectData).then(({data}) => { + this.objectList1 = data.row1 + this.objectList2 = data.row2 + }) + this.objectSelections2 = [] + } else { + this.$alert(data.msg, '错误', { + confirmButtonText: '确定' + }) + } + }) + }, + + // 修改项目设备 + updateItemObject () { + let inData = { + site: this.objectData.site, + buNo: this.objectData.buNo, + itemNo: this.objectData.itemNo, + objectList: this.objectList2 + } + updateItemObject(inData).then(({data}) => { + if (data && data.code === 0) { + this.getDataList() + this.$message({ + message: '操作成功', + type: 'success', + duration: 1500, + onClose: () => {} + }) + this.objectModelFlag = false + } else { + this.$alert(data.msg, '错误', { + confirmButtonText: '确定' + }) + } + }) + }, + // 获取用户的bu getSiteAndBuByUserName () { let tempData = { @@ -858,6 +1131,14 @@ }) }, + // bu改变事件 + buChangeFunction () { + this.modalData.collectionConditionList = '' + this.modalData.collectionDataContent = '' + this.getEquipmentNoList() + this.getDataContentList() + }, + // 获取采集条件路径 getEquipmentNoList () { let tempData = { @@ -870,6 +1151,18 @@ }) }, + // 获取采集数据内容 + getDataContentList () { + let tempData = { + bu: this.modalData.bu + } + getDataContentList(tempData).then(({data}) => { + if (data.code === 0) { + this.dataContentList = data.rows + } + }) + }, + // 获取基础数据列表S getBaseList (val,type) { this.tagNo = val @@ -986,9 +1279,13 @@ collectionMethod: '', collectionMethodList: [], collectionCondition: '', - collectionConditionList: [] + collectionConditionList: [], + collectionDataContent: '' } + // 获取采集条件路径 this.getEquipmentNoList() + // 获取采集数据内容 + this.getDataContentList() this.modalDisableFlag = false this.modalFlag = true }, @@ -1024,8 +1321,12 @@ collectionMethodList: row.collectionMethod == null || row.collectionMethod === '' ? [] : row.collectionMethod.split(','), collectionCondition: row.collectionCondition, collectionConditionList: row.collectionCondition == null || row.collectionCondition === '' ? [] : row.collectionCondition.split(','), + collectionDataContent: row.collectionDataContent } + // 获取采集条件路径 this.getEquipmentNoList() + // 获取采集数据内容 + this.getDataContentList() this.modalDisableFlag = true this.modalFlag = true }, @@ -1093,14 +1394,6 @@ this.$message.warning('请选择采集数据方式!') return } - if (this.modalData.collectionFlag === 'Y' && (this.modalData.collectionConditionList == null || this.modalData.collectionConditionList.length === 0)) { - this.$message.warning('请选择采集条件路径!') - return - } - // if (this.modalData.collectionFlag === 'Y' && (this.modalData.collectionSourceList.length !== this.modalData.collectionMethodList.length)) { - // this.$message.warning('采集数据的来源、方式不对应!') - // return - // } this.modalData.collectionSource = this.modalData.collectionSourceList.join(',') this.modalData.collectionMethod = this.modalData.collectionMethodList.join(',') this.modalData.collectionCondition = this.modalData.collectionConditionList.join(',') diff --git a/src/views/modules/qc/qcTemplate.vue b/src/views/modules/qc/qcTemplate.vue index e1c2f94..ab2183c 100644 --- a/src/views/modules/qc/qcTemplate.vue +++ b/src/views/modules/qc/qcTemplate.vue @@ -66,7 +66,6 @@ :height="height" :data="dataList" border - v-loading="dataListLoading" style="width: 100%;"> ;width:98%"> - - - + + + + + + + + + + + + + + + + + + + + + + + @@ -304,6 +303,67 @@ + + + 添加 + 删除 +
+ + + + + + + + + + + + + + + + + + + +
+ + 保存 + 关闭 + +
+
@@ -340,7 +400,6 @@ @row-click="itemClickRow1" @selection-change="selectionItem1" highlight-current-row - v-loading="dataListLoading" style="width: 100%"> { + if (data.code === 0) { + this.tableData = data.rows + } else { + this.tableData = [] + } + }) + this.inspectionStandardModalFlag = true + }, + + //表格的新增 + rowClassName ({ row, rowIndex }) { + row.xh = rowIndex + 1 + }, + + //单选框选中数据 + handleDetailSelectionChange (selection) { + this.checkedDetail = selection + }, + + // 点击新增 + handleAddBtn () { + let obj = { + collectionSource: '', + defaultValue: '', + minValue: '', + maxValue: '', + condition: '' + } + this.tableData.push(obj) + }, + + //删除 + handleDeleteBtn () { + if (this.checkedDetail.length === 0) { + this.$alert("请先选择要删除的数据", "提示", { + confirmButtonText: "确定", + }) + } else { + this.$confirm("请是否确认删除该检验标准?", "提示", { + confirmButtonText: "确定", + cancelButtonText: "取消", + type: "warning", + callback: (action) => { + if (action === "confirm") { + let val = this.checkedDetail + val.forEach((val, index) => { + this.tableData.forEach((v, i) => { + if (val.xh === v.xh) { + this.tableData.splice(i, 1) + } + }) + }) + this.$message({ + message: "删除成功!", + type: "success", + }) + return + } else { + this.$message({ + message: "已取消删除操作", + type: "warning", + }) + return + } + }, + }) + } + }, + + // 回车事件 + nextFocus1 (index) { + let a1 = `${index + 1}` + `a` + this.$nextTick(() => { + this.$refs[a1].focus() + }) + }, + nextFocus2 (index) { + let a2 = `${index + 1}` + `b` + this.$nextTick(() => { + this.$refs[a2].focus() + }) + }, + nextFocus3 (index) { + let a3 = `${index + 1}` + `c` + this.$nextTick(() => { + this.$refs[a3].focus() + }) + }, + + // 新增检验标准 + saveInspectionStandard () { + this.standardData.standardList = this.tableData + saveInspectionStandard(this.standardData).then(({data}) => { + if (data && data.code === 0) { + this.inspectionStandardModalFlag = false + this.tableData = [] + this.$message({ + message: '操作成功', + type: 'success', + duration: 1500, + onClose: () => {} + }) + } else { + this.$alert(data.msg, '错误', { + confirmButtonText: '确定' + }) + } + }) + }, + + // 获取用户的bu getSiteAndBuByUserName () { let tempData = { @@ -1124,7 +1314,6 @@ this.pageSize = data.page.pageSize this.totalPage = data.page.totalCount } - this.dataListLoading = false }) }, @@ -1288,7 +1477,7 @@ this.detailData.inspectionTypeName = row.inspectionTypeName templateDetailsSearch(this.detailData).then(({data}) => { this.detailList = data.rows - this.objectSearch() + //this.objectSearch() }) this.detailModelFlag = true },