From 7b5c250e4266e9e7e27a369c864e88316c8ac229 Mon Sep 17 00:00:00 2001 From: licp <lichunping@guanfang.com.cn> Date: 星期四, 21 三月 2024 13:15:57 +0800 Subject: [PATCH] 下单功能修改 --- src/components/do/b1-ins-order/add.vue | 113 +++++++++++++++++++++++++++++++++++++++++--------------- 1 files changed, 83 insertions(+), 30 deletions(-) diff --git a/src/components/do/b1-ins-order/add.vue b/src/components/do/b1-ins-order/add.vue index 04d9b43..9047fc3 100644 --- a/src/components/do/b1-ins-order/add.vue +++ b/src/components/do/b1-ins-order/add.vue @@ -211,7 +211,7 @@ border @selection-change="selectSample" highlight-current-row @row-click="rowClick" style="margin-top: 10px;"> <el-table-column type="selection" width="60"></el-table-column> <el-table-column type="index" label="搴忓彿" width="65" align="center"></el-table-column> - <el-table-column prop="sample" label="鏍峰搧鍚嶇О" align="center" show-overflow-tooltip min-width="100"> + <el-table-column prop="sample" label="鏍峰搧鍚嶇О" align="center" min-width="100"> <template slot-scope="scope"> <el-input size="small" v-model="scope.row.sample" clearable></el-input> </template> @@ -221,22 +221,22 @@ <el-input size="small" v-model="scope.row.sampleCode" clearable placeholder="涓嶅~鍐欏垯绯荤粺鑷姩鐢熸垚"></el-input> </template> </el-table-column> - <!-- <el-table-column prop="factory" label="宸ュ巶" align="center" show-overflow-tooltip min-width="100"> + <!-- <el-table-column prop="factory" label="宸ュ巶" align="center" min-width="100"> </el-table-column> - <el-table-column prop="laboratory" label="瀹為獙瀹�" align="center" show-overflow-tooltip min-width="100"> + <el-table-column prop="laboratory" label="瀹為獙瀹�" align="center" min-width="100"> </el-table-column> - <el-table-column prop="sampleType" label="鏍峰搧绫诲瀷" align="center" show-overflow-tooltip min-width="100"> + <el-table-column prop="sampleType" label="鏍峰搧绫诲瀷" align="center" min-width="100"> </el-table-column> --> - <el-table-column prop="model" label="鏍峰搧鍨嬪彿" align="center" show-overflow-tooltip min-width="100"> + <el-table-column prop="model" label="鏍峰搧鍨嬪彿" align="center" min-width="100"> <template slot-scope="scope"> <el-select v-model="scope.row.model" filterable allow-create default-first-option placeholder="鏍峰搧鍨嬪彿" - size="small"> + size="small" @change="handleChangeModel"> <el-option v-for="item in models" :key="item.value" :label="item.label" :value="item.value"> </el-option> </el-select> </template> </el-table-column> - <el-table-column prop="standardMethodListId" label="妫�楠屾爣鍑�" align="center" show-overflow-tooltip min-width="100"> + <el-table-column prop="standardMethodListId" label="妫�楠屾爣鍑�" align="center" min-width="100"> <template slot-scope="scope"> <el-select v-model="scope.row.method" :disabled="scope.row.model==null" filterable placeholder="妫�楠屾爣鍑�" size="small" :loading="methodLoad" @change="(value)=>methodChange(value, scope.row)" @focus="methodFocus"> @@ -245,14 +245,14 @@ </el-select> </template> </el-table-column> - <el-table-column prop="unit" label="鍗曚綅" align="center" show-overflow-tooltip min-width="100"> + <el-table-column prop="unit" label="鍗曚綅" align="center" min-width="100"> <template slot-scope="scope"> <el-select v-model="scope.row.unit" clearable size="small" style="width: 100%;"> <el-option v-for="(a, i) in units" :key="i" :label="a.label" :value="a.value"></el-option> </el-select> </template> </el-table-column> - <el-table-column prop="isLeave" label="鏄惁鐣欐牱" align="center" show-overflow-tooltip min-width="100"> + <el-table-column prop="isLeave" label="鏄惁鐣欐牱" align="center" min-width="100"> <template slot-scope="scope"> <el-select v-model="scope.row.isLeave" size="small"> <el-option label="鐣欐牱" :value="1"></el-option> @@ -303,7 +303,7 @@ <el-table-column prop="ask" label="瑕佹眰鍊�" min-width="220px"> <template slot-scope="scope"> <el-input size="small" placeholder="瑕佹眰鍊�" v-model="scope.row.ask" clearable type="textarea" - :autosize="{ minRows: 1, maxRows: 3}"></el-input> + :autosize="{ minRows: 1, maxRows: 3}" @change="e=>requestChange(e,scope.row)"></el-input> </template> </el-table-column> </el-table> @@ -639,6 +639,16 @@ this.$message.error('璇锋坊鍔犱竴涓牱鍝�') } else if (!this.sampleList.every(m => m.sampleCode)) { this.$message.error('杈撳叆鏍峰搧缂栧彿') + }else if (!this.sampleList.every(m => m.sample)) { + this.$message.error('杈撳叆鏍峰搧鍚嶇О') + }else if (!this.sampleList.every(m => m.model)) { + this.$message.error('杈撳叆鏍峰搧鍨嬪彿') + }else if (!this.sampleList.every(m => m.standardMethodListId)) { + this.$message.error('閫夋嫨妫�楠屾爣鍑�') + }else if (!this.sampleList.every(m => m.unit)) { + this.$message.error('杈撳叆鍗曚綅') + }else if (!this.sampleList.every(m => m.isLeave)) { + this.$message.error('鏄惁鐣欐牱') } else { this.saveLoad = true this.$axios.post(this.$api.insOrder.addInsOrder, { @@ -652,20 +662,7 @@ this.saveLoad = false if (res.code == 201) return this.$message.success('宸叉彁浜�') - // 濡傛灉绱ф�ョ▼搴︿负绱ф�ワ紝闇�瑕佺洿鎺ヤ笅鍙戜汉鍛� - if (this.addObj.type == 2) { - this.issuedDialogVisible = true; - this.$axios.post(this.$api.insOrder.selectOrderManDay, { - id: res.data - }).then(ress => { - // TODO 闇�瑕佸啀纭涓�涓嬭繑鍥炲�� - this.distributeData.orderId = res.data - // this.distributeData.sampleId = res.data.sampleId - this.distributeData.appointed = ress.data - }) - } else { - this.$parent.playOrder(0) - } + this.$parent.playOrder(0) }) } }, @@ -682,7 +679,18 @@ this.saveLoad = false if (res.code == 201) return this.$message.success('鎻愪氦鎴愬姛') - this.$parent.playOrder(0) + // 濡傛灉绱ф�ョ▼搴︿负绱ф�ワ紝闇�瑕佺洿鎺ヤ笅鍙戜汉鍛� + if (this.addObj.type == 2) { + this.issuedDialogVisible = true; + this.$axios.post(this.$api.insOrder.selectOrderManDay, { + id: this.currentId + }).then(ress => { + this.distributeData.orderId = this.currentId + this.distributeData.appointed = ress.data + }) + } else { + this.$parent.playOrder(0) + } }) }, // 涓嬪彂 @@ -698,7 +706,6 @@ this.upLoad = true; this.$axios.post(this.$api.insOrder.upInsOrder, { orderId: this.distributeData.orderId, - sampleId: this.distributeData.sampleId, appointed: this.distributeData.appointed, userId: this.distributeData.userId }).then(res => { @@ -793,7 +800,7 @@ this.count++ } this.$refs.sampleTable.doLayout() - this.selectsStandardMethodByFLSSM() + // this.selectsStandardMethodByFLSSM() }, selectsStandardMethodByFLSSM() { this.methodLoad = true @@ -801,7 +808,18 @@ tree: this.selectTree }).then(res => { this.methodLoad = false - this.methods = res.data.standardMethodList + if(res.data.standardMethodList.length==0&&this.selectTree.split('-').length==5){ + let arr = this.selectTree.split('-') + let arr0 = arr.slice(0,arr.length-1) + let selectTree = arr0.join('-').substring(0, arr0.join('-').length - 1) + this.$axios.post(this.$api.standardTree.selectsStandardMethodByFLSSM, { + tree: selectTree + }).then(ress => { + this.methods = ress.data.standardMethodList + }) + }else{ + this.methods = res.data.standardMethodList + } }) }, addStandardTree() { @@ -906,6 +924,17 @@ }, upProductSelect(selection, row) { row.state = row.state == 1 ? 0 : 1 + this.sampleList.map(item=>{ + if(this.sampleIds.indexOf(item.id)>-1){ + item.insProduct.map(m=>{ + if(m.id==row.id){ + m.state = row.state; + } + return m; + }) + } + return item + }) }, tableRowClassName({ row, @@ -1009,7 +1038,31 @@ }, methodFocus(){ this.selectsStandardMethodByFLSSM() - } + }, + handleChangeModel(e){ + let num = this.selectTree.split('-').length; + if(num==4){ + this.selectTree = this.selectTree + ' - '+ e + }else{ + let arr = this.selectTree.split('-') + let arr0 = arr.slice(0,arr.length-1) + this.selectTree = arr0.join('-')+ '- '+ e + } + }, + // 瑕佹眰鍊煎彉鍖栨椂 + requestChange(e,row){ + this.sampleList.map(item=>{ + if(this.sampleIds.indexOf(item.id)>-1){ + item.insProduct.map(m=>{ + if(m.id==row.id){ + m.ask = e; + } + return m; + }) + } + return item + }) + } } } -</script> \ No newline at end of file +</script> -- Gitblit v1.9.3