diff --git a/src/api/quality/checkTypeProject.js b/src/api/quality/checkTypeProject.js index 1346424..429d0d3 100644 --- a/src/api/quality/checkTypeProject.js +++ b/src/api/quality/checkTypeProject.js @@ -55,3 +55,21 @@ export function changeStatus(id,status) { data: data }); } + +//批量添加检测项 +export function submitProjects(data) { + return request({ + url: '/quality/checkTypeProject/submitProjects', + method: 'post', + data: data + }); +} + +//获取检测项列表 +export function getProjectInfoList(query) { + return request({ + url: '/quality/checkTypeProject/getProjectInfoList', + method: 'get', + params: query + }); +} \ No newline at end of file diff --git a/src/views/mes/reportWork/index.vue b/src/views/mes/reportWork/index.vue index 140df50..aafa55b 100644 --- a/src/views/mes/reportWork/index.vue +++ b/src/views/mes/reportWork/index.vue @@ -773,7 +773,7 @@ export default { return; } const values = data.map(item => Number(item[column.property])); - if (!values.every(value => isNaN(value))) { + if (!values.every(value => isNaN(value))&& column.label!='用人数') { sums[index] = values.reduce((prev, curr) => { const value = Number(curr); if (!isNaN(value)) { diff --git a/src/views/quality/checkTypeProject/index.vue b/src/views/quality/checkTypeProject/index.vue index 35d6af4..3db50c2 100644 --- a/src/views/quality/checkTypeProject/index.vue +++ b/src/views/quality/checkTypeProject/index.vue @@ -105,8 +105,8 @@ @selection-change="handleSelectionChange" > - - + + @@ -221,6 +221,11 @@ 取 消 + + @@ -231,16 +236,17 @@ import { delCheckTypeProject, addCheckTypeProject, updateCheckTypeProject, - changeStatus + changeStatus, + submitProjects } from "@/api/quality/checkTypeProject"; import MaterialGroupAdd from "./MaterialGroupAdd.vue"; import {listCheckType} from "@/api/quality/checkType"; import {getProjectList} from "@/api/quality/project"; - +import SelectProject from "./selectProject.vue"; export default { name: "CheckTypeProject", dicts: ["qc_rule_prop",'unit'], - components: {MaterialGroupAdd,}, + components: {MaterialGroupAdd,SelectProject}, data() { return { // 遮罩层 @@ -355,6 +361,7 @@ export default { groupId: null, materialCode: null, projectNo: null, + projectInfos:[] }; this.resetForm("form"); }, @@ -414,12 +421,17 @@ export default { }, /** 新增按钮操作 */ handleAdd() { - this.reset(); - this.open = true; - this.title = "添加物料检验项目维护"; - this.form.groupId = this.groupId; - this.form.materialCode = this.materialCode; - this.form.typeId = this.editableTabsValue; + + if(this.groupId==null||this.materialCode){ + this.$modal.msgError("请点击左侧节点"); + return + }; + if(this.queryParams.typeId==null){ + this.$modal.msgError("请选择头部节点"); + retrun + }; + this.$refs.child.showFlag = true; + this.$refs.child.init(this.groupId,this.materialCode,this.queryParams.typeId); }, /** 修改按钮操作 */ handleUpdate(row) { @@ -525,6 +537,25 @@ export default { row.status = row.status === "0" ? "1" : "0"; }); }, + //检验项目添加确认 + onSelectProjects(objs) { + let _this = this; + objs.forEach(function(item,index,arr){ + item.projectId = item.id; + item.projectNo = item.orderNum; + item.unit = item.unitCode; + item.standardValue = item.checkStandard; + item.typeId = _this.queryParams.typeId; + item.groupId = _this.groupId; + item.materialCode = _this.materialCode; + + }); + submitProjects(objs).then(response => { + this.$modal.msgSuccess("提交成功"); + this.open = false; + this.getList(); + }); + }, }, }; diff --git a/src/views/quality/checkTypeProject/selectProject.vue b/src/views/quality/checkTypeProject/selectProject.vue new file mode 100644 index 0000000..7a30708 --- /dev/null +++ b/src/views/quality/checkTypeProject/selectProject.vue @@ -0,0 +1,170 @@ + + diff --git a/src/views/quality/project/index.vue b/src/views/quality/project/index.vue index 8d4d886..3540349 100644 --- a/src/views/quality/project/index.vue +++ b/src/views/quality/project/index.vue @@ -92,8 +92,8 @@ - - + + - +