From dcf9c9e0410fe1186239e3f8d6f7bdc789c08010 Mon Sep 17 00:00:00 2001 From: lzhe <lzhe@example.com> Date: 星期三, 05 六月 2024 18:00:39 +0800 Subject: [PATCH] 1 --- src/views/console/product-process/process-route/add-craft-version.vue | 150 +++++++++++++++++++++++++++----------------------- 1 files changed, 81 insertions(+), 69 deletions(-) diff --git a/src/views/console/product-process/process-route/add-craft-version.vue b/src/views/console/product-process/process-route/add-craft-version.vue index c4dc109..16f1926 100644 --- a/src/views/console/product-process/process-route/add-craft-version.vue +++ b/src/views/console/product-process/process-route/add-craft-version.vue @@ -14,37 +14,15 @@ <el-form :model="addStepForm0" :rules="addStepRules0" ref="dialogForm0" label-width="80px" label-position="center" class="addStepRules0" v-show="active == 0"> <el-row> <el-col :span="24"> - <el-form-item label="宸ヨ壓璺嚎" prop="name"> - <el-input v-model="addStepForm0.name" placeholder="宸ヨ壓璺嚎" clearable></el-input> - </el-form-item> - </el-col> - <el-col :span="24"> - <el-form-item label="浜у搧缂栧彿"> - <el-select v-model="addStepForm0.productId" style="width: 100%" placeholder="浜у搧缂栧彿"> - <el-option v-for="item in productList" :key="item.id" :label="item.name" :value="item.id"/> - </el-select> - </el-form-item> - </el-col> - <el-col :span="24"> - <el-form-item label="澶囨敞"> - <el-input v-model="addStepForm0.description" placeholder="澶囨敞" clearable></el-input> - </el-form-item> - </el-col> - </el-row> - </el-form> - <!-- 绗簩姝� --> - <el-form :model="addStepForm1" :rules="addStepRules1" ref="dialogForm1" label-width="80px" label-position="center" class="addStepRules0" v-show="active == 1"> - <el-row> - <el-col :span="24"> <el-row class="step1-top"> - <el-col :span="8"><span>宸ヨ壓璺嚎鍚嶇О</span><span>-</span></el-col> - <el-col :span="8"><span>鍏宠仈浜у搧</span><span>-</span></el-col> - <el-col :span="8"><span>宸ヨ壓璺嚎鎻忚堪</span><span>-</span></el-col> + <el-col :span="8"><span>宸ヨ壓璺嚎鍚嶇О</span><span style="margin-left: 12px">{{detail.name}}</span></el-col> + <el-col :span="8"><span>鍏宠仈浜у搧</span><span style="margin-left: 12px">{{detail.productName}}</span></el-col> + <el-col :span="8"><span>宸ヨ壓璺嚎鎻忚堪</span><span style="margin-left: 12px">{{detail.description}}</span></el-col> </el-row> </el-col> <el-col :span="24"> <el-form-item label="鐗堟湰鍚嶇О"> - <el-input v-model="addStepForm1.name" disabled placeholder="鐗堟湰鍚嶇О" clearable></el-input> + <el-input v-model="addStepForm0.name" disabled placeholder="鐗堟湰鍚嶇О" clearable></el-input> </el-form-item> </el-col> <el-col :span="24"> @@ -52,7 +30,7 @@ <el-tree-select node-key="id" :props="{ label: 'title',children: 'children',hasChildren: 'ids'}" - v-model="addStepForm1.groupIds" + v-model="addStepForm0.groupIds" placeholder="鍏宠仈浜х嚎" :data="step1TreeData" multiple @@ -65,8 +43,26 @@ </el-col> <el-col :span="24"> <el-form-item label="鎻忚堪"> - <el-input v-model="addStepForm1.description" placeholder="璇疯緭鍏ュ伐鑹鸿矾绾跨増鏈弿杩�" clearable></el-input> + <el-input v-model="addStepForm0.description" placeholder="璇疯緭鍏ュ伐鑹鸿矾绾跨増鏈弿杩�" clearable></el-input> </el-form-item> + </el-col> + </el-row> + </el-form> + <!-- 绗簩姝� --> + <el-form :model="addStepForm1" :rules="addStepRules1" ref="dialogForm1" label-width="80px" label-position="center" class="addStepRules1" v-show="active == 1"> + <el-row> + <el-col :span="24"> + <el-row class="step1-top"> + <el-col :span="8"><span>宸ヨ壓璺嚎鍚嶇О</span><span style="margin-left: 12px">{{detail.name}}</span></el-col> + <el-col :span="8"><span>鍏宠仈浜у搧</span><span style="margin-left: 12px">{{detail.productName}}</span></el-col> + <el-col :span="8"><span>宸ヨ壓璺嚎鎻忚堪</span><span style="margin-left: 12px">{{detail.description}}</span></el-col> + <el-col :span="8" style="margin-top: 6px;"><span>宸ヨ壓璺嚎鐗堟湰</span><span style="margin-left: 12px">{{versionDetail.name}}</span></el-col> + <el-col :span="8" style="margin-top: 6px;"><span>鍏宠仈浜х嚎</span><span style="margin-left: 12px">{{versionDetail.groupName}}</span></el-col> + <el-col :span="8" style="margin-top: 6px;"><span>宸ヨ壓璺嚎鎻忚堪</span><span style="margin-left: 12px">{{versionDetail.description}}</span></el-col> + </el-row> + </el-col> + <el-col :span="24"> + <workmanship :isCustomization = "false"></workmanship> </el-col> </el-row> </el-form> @@ -75,9 +71,10 @@ </template> <script> +import workmanship from './workmanship' //宸ヨ壓璺嚎 export default { name: 'add-craft', - components: {}, + components: {workmanship}, data() { var valiarrPass = (rule, value, callback) => { if (value.length == 0) { @@ -89,27 +86,38 @@ return { step1TreeData: [], active: 0, - //琛ㄥ崟鏁版嵁 - addStepForm0: { + detail: { name: "", - productId: "", + productName: "", description: "", }, + versionDetail: { + name: "", + groupName: "", + description: "" + }, + //琛ㄥ崟鏁版嵁 + addStepForm0: { + name: "", + groupIds: [], + description: "" + }, //楠岃瘉瑙勫垯 addStepRules0: { - name:[{required: true, message: '璇疯緭鍏ュ伐鑹鸿矾绾�'}], - }, + groupIds:[{validator: valiarrPass,required: true, trigger:'change'}], + },//琛ㄥ崟鏁版嵁 addStepForm1: { name: "", groupIds: [], description: "", - + description: "" }, //楠岃瘉瑙勫垯 addStepRules1: { - groupIds:[{validator: valiarrPass,required: true, trigger:'change'}], + //name:[{required: true, message: '璇疯緭鍏ュ伐鑹鸿矾绾�'}], }, + productList: [] } }, @@ -119,8 +127,8 @@ } }, mounted(){ - //this.getProductList(); //for step0 - // this.getGroupWorkstation(); //for step1 + this.getGroupWorkstation(); //for step0 + this.getDetail(this.$route.query.id); //for step0 }, methods: { getGroupWorkstation() { @@ -142,7 +150,34 @@ } }) this.step1TreeData = tree; - console.log(this.step1TreeData) + } + }) + }, + goStep1() { + var obj = Object.assign({},this.addStepForm0); + obj.craftId = this.$route.query.id; + obj.id = this.$route.query.craftId; + this.$refs.dialogForm0.validate(async (valid) => { + if (valid) { + this.$HTTP.put(`/api/blade-cps/production-craft-version/update`,obj).then(res=> { + if(res.code == 200) { + this.active = 1; + //this.getVersionDetail(res.data.id); + }else { + this.$alert(res.message, "鎻愮ず", {type: 'error'}); + } + }) + }else{ + return false; + } + }) + }, + getVersionDetail(id) { + this.$HTTP.get(`/api/blade-cps/production-craft-version/detail/${id}`).then(res=> { + if(res.code == 200) { + this.versionDetail = res.data; + }else { + this.$alert(res.message, "鎻愮ず", {type: 'error'}); } }) }, @@ -153,45 +188,22 @@ }, next() { if(this.active == 0) { - this.setStep0(); + this.goStep1(); }else if(this.active == 1) { }else if(this.active == 2) { } }, - setStep0() { - var obj = Object.assign({},this.addStepForm1); - obj.craftId = ""; - this.$refs.dialogForm1.validate(async (valid) => { - if (valid) { - this.$HTTP.post("/api/blade-cps/production-craft-version/insert",obj).then(res=> { - this.isSaveing = false; - if(res.code == 200) { - this.active = 2; - this.$message.success("鎿嶄綔鎴愬姛"); - }else { - console.log(res,123) - //this.$alert(res.message, "鎻愮ず", {type: 'error'}); - } - }) - }else{ - return false; - } - }) - }, getDetail(id) { this.$HTTP.get(`/api/blade-cps/craft-routing/detail?id=${this.$route.query.id}`).then(res=> { if(res.code == 200) { - this.addStepForm0 = res.data; - } - }) - }, - getProductList() { - this.$HTTP.get(`/api/blade-cps/craft-routing/not-band-craft?craftId=${this.$route.query.id}`).then(res=> { - if(res.code == 200) { - this.productList = res.data; - this.getDetail(); + this.detail = res.data; + res.data.dtos.forEach(item=> { + if(item.id == this.$route.query.craftId) { + this.addStepForm0.name = item.name; + } + }) } }) } -- Gitblit v1.9.3