From b0d1fd908650d0210e6b1a6612d7234a3f622e90 Mon Sep 17 00:00:00 2001 From: haoxuan <haoxuan> Date: 星期四, 11 四月 2024 14:58:03 +0800 Subject: [PATCH] 纤度登记表模块 获取组别的数据修改为获取车间的组别的接口+入参数据处理 --- src/views/productManage/silkRegisterForm/addPage.vue | 117 ++++++++++++++++++++++++++++++++++++++-------------------- 1 files changed, 76 insertions(+), 41 deletions(-) diff --git a/src/views/productManage/silkRegisterForm/addPage.vue b/src/views/productManage/silkRegisterForm/addPage.vue index 16d2de0..f93ce75 100644 --- a/src/views/productManage/silkRegisterForm/addPage.vue +++ b/src/views/productManage/silkRegisterForm/addPage.vue @@ -80,6 +80,7 @@ v-model="form.name" placeholder="璇烽�夋嫨" class="select-width" + @change="getGroupNumber" > <el-option v-for="item in nameList" @@ -110,14 +111,15 @@ <el-form-item label="缁勫埆" prop="workshopGroup" class="form-item"> <el-select v-model="form.workshopGroup" - placeholder="璇烽�夋嫨" + placeholder="璇峰厛閫夋嫨杞﹂棿" + no-data-text="璇峰厛閫夋嫨杞﹂棿" class="select-width" > <el-option v-for="item in workshopGroupList" - :key="item.ID" - :label="item.name" - :value="item.ID" + :key="item" + :label="item" + :value="item" > </el-option> </el-select> @@ -319,9 +321,17 @@ </el-table-column> <el-table-column prop="finenessGradeye" label="閲庣氦" width="120"> </el-table-column> - <el-table-column prop="finenessGradebig" label="澶ч噹" show-overflow-tooltip> + <el-table-column + prop="finenessGradebig" + label="澶ч噹" + show-overflow-tooltip + > </el-table-column> - <el-table-column prop="finenessGradeSpecial" label="鐗归噹" width="120"> + <el-table-column + prop="finenessGradeSpecial" + label="鐗归噹" + width="120" + > </el-table-column> <el-table-column prop="finenessGrade" @@ -414,10 +424,10 @@ </template> <script> +// getWorkshopManageList, import { saveRegister, getDictList, - getWorkshopManageList, getRegisterDetails, } from "@/api/productManage/silkRegisterForm.js"; import { @@ -426,6 +436,7 @@ } from "@/api/productManage/silkInspectForm.js"; import pageMixin from "@/components/makepager/pager/mixin/pageMixin"; import CommonFormTableView from "@/components/makepager/CommonFormTableView"; +import { getWorkshopManageGroup } from "@/api/productManage/productRegisterForm.js"; export default { name: "silkRegisterAddPage", props: {}, @@ -574,10 +585,11 @@ JSON.stringify(response.data ? response.data : {}) ); this.form = config; + this.getGroupNumber() this.tableList.tableData = config.finenessList ? config.finenessList : []; - this.tableData=this.tableList.tableData + this.tableData = this.tableList.tableData; } } ); @@ -615,27 +627,25 @@ this.form.finishDate = config.finenessRegister.finishDate; this.form.circle = config.finenessRegister.circle; this.getTableHeader(); - let arr= response.data.items - ? response.data.items - : []; - for(let i in arr){ - let round=arr[i].finenessRoundingItems - if(arr[i].finenessGrade){ - if(arr[i].finenessGrade.indexOf('閲庣氦')>-1){ - arr[i].finenessGradeye=arr[i].finenessGrade - }else if(arr[i].finenessGrade.indexOf('澶ч噹')>-1){ - arr[i].finenessGradebig=arr[i].finenessGrade - }else if(arr[i].finenessGrade.indexOf('鐗归噹')>-1){ - arr[i].finenessGradeSpecial=arr[i].finenessGrade - } - } - if(round){ - for(let j in round){ - arr[i][round[j].fineness]=round[j].quantity - } - } + let arr = response.data.items ? response.data.items : []; + for (let i in arr) { + let round = arr[i].finenessRoundingItems; + if (arr[i].finenessGrade) { + if (arr[i].finenessGrade.indexOf("閲庣氦") > -1) { + arr[i].finenessGradeye = arr[i].finenessGrade; + } else if (arr[i].finenessGrade.indexOf("澶ч噹") > -1) { + arr[i].finenessGradebig = arr[i].finenessGrade; + } else if (arr[i].finenessGrade.indexOf("鐗归噹") > -1) { + arr[i].finenessGradeSpecial = arr[i].finenessGrade; + } } - this.tableTwoList.tableInfomation =arr; + if (round) { + for (let j in round) { + arr[i][round[j].fineness] = round[j].quantity; + } + } + } + this.tableTwoList.tableInfomation = arr; } }); } @@ -711,11 +721,11 @@ } }); //缁勫埆 - getWorkshopManageList().then((res) => { - if (res.code == 200) { - this.workshopGroupList = res.data || []; - } - }); + // getWorkshopManageList().then((res) => { + // if (res.code == 200) { + // this.workshopGroupList = res.data || []; + // } + // }); //搴勫彛 getDictList({ dictType: 0, @@ -724,6 +734,31 @@ this.marketList = res.data || []; } }); + }, + getGroupNumber() { + if (this.form.name) { + //缁勫埆 + let number = ""; + for (let i in this.nameList) { + if (this.nameList[i].name == this.form.name) { + number = this.nameList[i].number; + break; + } + } + getWorkshopManageGroup({ number: number }).then((res) => { + if (res.code == 200) { + this.workshopGroupList = []; + let workshopGroupList = res.data || {}; + if (Object.keys(workshopGroupList).length > 0) { + for (let i in workshopGroupList) { + this.workshopGroupList.push(workshopGroupList[i]); + } + } + } + }); + } else { + this.workshopGroupList = []; + } }, inputStart() { this.form.circleTwo = this.form.circle + "-" + this.form.totalCircle; @@ -800,13 +835,13 @@ sum: "", }, ]; - }else{ - this.form.measureFineness='' - this.form.twiceChange='' - this.form.cleanliness='' - this.form.purity='' - this.form.marketProcessOrderNumber='' - this.form.inspector='' + } else { + this.form.measureFineness = ""; + this.form.twiceChange = ""; + this.form.cleanliness = ""; + this.form.purity = ""; + this.form.marketProcessOrderNumber = ""; + this.form.inspector = ""; } }, // 淇濆瓨 @@ -868,7 +903,7 @@ message: "淇濆瓨鎴愬姛锛�", type: "success", }); - this.getDetailsData() + this.getDetailsData(); } this.isAddloading = false; }) -- Gitblit v1.8.0