diff --git a/hb_client/src/api/mtm.js b/hb_client/src/api/mtm.js index 940a086..07d16f7 100644 --- a/hb_client/src/api/mtm.js +++ b/hb_client/src/api/mtm.js @@ -226,6 +226,36 @@ export function deleteOutputmaterial(id, data) { data }) } +//其他材料 +export function getOthermaterialList(query) { + return request({ + url: '/mtm/othermaterial/', + method: 'get', + params: query + }) +} +export function createOthermaterial(data) { + return request({ + url: '/mtm/othermaterial/', + method: 'post', + data + }) +} +export function updateOthermaterial(id, data) { + return request({ + url: `/mtm/othermaterial/${id}/`, + method: 'put', + data + }) +} +export function deleteOthermaterial(id, data) { + return request({ + url: `/mtm/othermaterial/${id}/`, + method: 'delete', + data + }) +} + //子工序 export function getUsedstepList(query) { diff --git a/hb_client/src/views/em/equipment.vue b/hb_client/src/views/em/equipment.vue index 2b89c67..740b0d3 100644 --- a/hb_client/src/views/em/equipment.vue +++ b/hb_client/src/views/em/equipment.vue @@ -79,7 +79,7 @@ - + @@ -208,8 +208,13 @@ - - + + diff --git a/hb_client/src/views/mtm/productprocess.vue b/hb_client/src/views/mtm/productprocess.vue index c2b2eac..a8e421e 100644 --- a/hb_client/src/views/mtm/productprocess.vue +++ b/hb_client/src/views/mtm/productprocess.vue @@ -232,13 +232,16 @@ - + + :key="item.id" + :label="item.name" + :value="item.id"> + {{ item.name }} + {{ item.specification }} + @@ -330,12 +333,14 @@ - + + :key="item.id" + :label="item.name" + :value="item.id"> + {{ item.name }} + {{ item.specification }} @@ -359,6 +364,103 @@ + + + 新增 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {{ item.name }} + {{ item.specification }} + + + + + + + + + +
+ 取消 + 确认 +
+
+
+ 新增 @@ -532,7 +634,8 @@ import { getMaterialList,getMaterial,getInputmaterialList,createInputmaterial,updateInputmaterial ,deleteInputmaterial,getOutputmaterialList,createOutputmaterial,updateOutputmaterial,deleteOutputmaterial, getUsedstepList,createUsedstep,deleteUsedstep,getStepList,gettechdocList,createtechdoc,updatetechdoc,deletetechdoc -,getsubproducationList,createsubproducation,updatesubproducation,deletesubproducation,getProcessList } from "@/api/mtm"; +,getsubproducationList,createsubproducation,updatesubproducation,deletesubproducation,getProcessList , +getOthermaterialList,createOthermaterial,deleteOthermaterial} from "@/api/mtm"; import { quillEditor } from 'vue-quill-editor' import 'quill/dist/quill.core.css' import 'quill/dist/quill.snow.css' @@ -548,6 +651,7 @@ const defaultinputmaterial = { const defaultoutputmaterial = { }; +const defaultother = {}; const defaultusedstep = { }; @@ -569,11 +673,13 @@ export default { editorOption: {} , processOptions:[], is_main:false, + othermaterial:defaultother, techdoc: defaulttechdoc, subproducation:defaultsubproducation, inputmaterial: defaultinputmaterial, techdoctableData:"", outputtableData:"", + othertableData:"", outputmaterial: defaultoutputmaterial, usedsteptableData:"", usedstep: defaultusedstep, @@ -601,6 +707,9 @@ export default { listQueryusedstep: { page: 0, }, + listQueryother: { + page: 0, + }, listQuerytechdoc:{ page: 0, }, @@ -619,6 +728,8 @@ export default { dialogVisibleusedstep:false, dialogTypet: "new", dialogVisiblet:false, + dialogVisibleother:false, + dialogTypeother: "new", listLoading: true, }; @@ -648,7 +759,7 @@ export default { this.listLoading = true; getMaterialList({pageoff:true}).then((response) => { if (response.data) { - this.materialoptions = genTree(response.data); + this.materialoptions = response.data; } this.listLoading = false; }); @@ -680,29 +791,16 @@ export default { handlespChange(row){ this.subproduction = row.id; this.processes = row.process; - this.getmaterialList();//物料列表 + this.getInputmaterialLists();//输入物料 this.getOutputmaterialLists();//输出物料 + this.getOthermaterialLists();//辅助工装 this.getstepList();//子工序 this. getUsedstepLists();// this.gettechdocLists();//技术文件 }, - //工艺点击信息 - - stepclick(id) - { - this.process = id; - // alert(this.process) - this.getmaterialList();//物料列表 - this.getInputmaterialLists();//输入物料 - - this.getOutputmaterialLists();//输出物料 - this.getstepList();//子工序 - this. getUsedstepLists();// - this.gettechdocLists();//技术文件 - - }, + //产品分解 getsubproducationList(){ @@ -798,6 +896,7 @@ export default { this.$nextTick(() => { this.$refs["Form"].clearValidate(); }); + this.getmaterialList();//物料列表 }, handleinputEdit(scope) { this.inputmaterial = Object.assign({}, scope.row); // copy obj @@ -878,6 +977,7 @@ export default { this.$nextTick(() => { this.$refs["Forms"].clearValidate(); }); + this.getmaterialList();//物料列表 }, handleoutputEdit(scope) { this.outputmaterial = Object.assign({}, scope.row); // copy obj @@ -931,6 +1031,84 @@ export default { } }); }, + + //输入其他物料列表 + + getOthermaterialLists(){ + + this.listQueryother.subproduction=this.subproduction; + getOthermaterialList(this.listQueryother).then((response) => { + if (response.data) { + + this.othertableData = response.data;//工装列表 + + } + }) + }, + //输入其他物料 + handleotherCreate() { + this.othermaterial = Object.assign({}, defaultother); + this.dialogTypeother = "new"; + this.dialogVisibleother = true; + this.$nextTick(() => { + this.$refs["Formother"].clearValidate(); + }); + this.getmaterialList();//物料列表 + }, + handleotherEdit(scope) { + this.othermaterial = Object.assign({}, scope.row); // copy obj + this.dialogTypeother = "edit"; + this.dialogVisibleother = true; + this.$nextTick(() => { + this.$refs["Formother"].clearValidate(); + }); + }, + handleotherDelete(scope) { + this.$confirm("确认删除?", "警告", { + confirmButtonText: "确认", + cancelButtonText: "取消", + type: "error", + }) + .then(async () => { + await deleteOthermaterial(scope.row.id); + this.getOthermaterialLists() + this.$message.success("成功"); + }) + .catch((err) => { + console.error(err); + }); + }, + async otherconfirm(form) { + this.$refs[form].validate((valid) => { + if (valid) { + const isEdit = this.dialogTypeother === "edit"; + if (isEdit) { + this.othermaterial.subproduction=this.subproduction; + updateOthermaterial(this.othermaterial.id, this.othermaterial).then((res) => { + if (res.code >= 200) { + this.getOthermaterialLists() + this.dialogVisibleother = false; + this.$message.success("成功"); + } + }); + } else { + this.othermaterial.subproduction=this.subproduction; + createOthermaterial(this.othermaterial).then((res) => { + if (res.code >= 200) { + this.getOthermaterialLists() + this.dialogVisibleother = false; + this.$message.success("成功"); + } + }); + } + } else { + return false; + } + }); + }, + + + //子工序列表 getUsedstepLists(){