From a28a7e0dc8992c39004ad0b34d2624390024f3af Mon Sep 17 00:00:00 2001 From: licp <lichunping@guanfang.com.cn> Date: 星期六, 14 九月 2024 15:41:19 +0800 Subject: [PATCH] 新增扫码报检、查看记录列表功能 --- src/components/do/b1-ins-order/add.vue | 59 ++++++++++++++++++++++++++++++----------------------------- 1 files changed, 30 insertions(+), 29 deletions(-) diff --git a/src/components/do/b1-ins-order/add.vue b/src/components/do/b1-ins-order/add.vue index 0f3c868..3780ba7 100644 --- a/src/components/do/b1-ins-order/add.vue +++ b/src/components/do/b1-ins-order/add.vue @@ -254,10 +254,18 @@ </div> </el-col> --> <el-col class="search_thing" :span="6"> - <div class="search_label"><span class="required-span">* </span>鏉ユ牱鏂瑰紡锛�</div> + <div class="search_label"><span class="required-span">* </span>璁㈠崟绫诲瀷锛�</div> <div class="search_input"> <el-select v-model="addObj.formType" size="small" :disabled="active>1" style="width: 100%;"> <el-option v-for="(a,ai) in formType" :key="ai" :label="a.label" :value="a.value"></el-option> + </el-select> + </div> + </el-col> + <el-col class="search_thing" :span="6" v-if="addObj.formType!='鍏朵粬鎴愬搧'&&addObj.formType"> + <div class="search_label"><span class="required-span">* </span>涓嬪彂鑷冲璞★細</div> + <div class="search_input"> + <el-select v-model="addObj.issueUser" size="small" :disabled="active>1" style="width: 100%;"> + <el-option v-for="(a,ai) in personList" :key="ai" :label="a.label" :value="a.value"></el-option> </el-select> </div> </el-col> @@ -367,8 +375,8 @@ <div class="search_thing"> <div class="search_label">妫�楠屾爣鍑嗭細</div> <div class="search_input"> - <el-select v-model="standardMethodListId" :placeholder="active>1 ? '' : '璇疯緭鍏�'" size="small" @focus="methodFocus" - :loading="methodLoad" @change="changeStandardMethodListId"> + <el-select v-model="standardMethodListId" :placeholder="active>1 ? '' : '璇疯緭閫夋嫨'" size="small" @focus="methodFocus" + :loading="methodLoad" multiple @change="changeStandardMethodListId"> <el-option v-for="item in methods" :key="item.id" :label="item.code" :value="item.id"> </el-option> </el-select> @@ -410,7 +418,7 @@ <template slot-scope="scope"> <el-select v-model="scope.row.standardMethodListId" :disabled="scope.row.model==null||active>1" placeholder="妫�楠屾爣鍑�" size="small" :loading="methodLoad" @change="(value)=>methodChange(value, scope.row)" - @focus="methodFocus" :readonly="active>1" style="width: 100%;" clearable @clear="productList = []"> + @focus="methodFocus" :readonly="active>1" style="width: 100%;" clearable @clear="productList = []" multiple> <el-option v-for="item in methods" :key="item.id" :label="item.code" :value="item.id"> </el-option> </el-select> @@ -1102,7 +1110,7 @@ RTS: '', totalArr: [], model: null, - standardMethodListId: null, + standardMethodListId: [], symbolList:[ 'RTS','A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'], inspectionItem:null, @@ -1137,7 +1145,7 @@ sonLaboratoryList:[], selectiveEcho: [], // 妫�楠屼笅鍗曠殑鏃跺�欏嬀閫夋楠岄」鐩�,濡傛灉浣跨敤绛涢�夋彁浜ゆ樉绀烘楠岄」鐩负绌� 鍥炴樉鍒楄〃 deaprtEnum:[], - standard:[] + standard:[], } }, watch: { @@ -1189,11 +1197,11 @@ }, 'addObj.sample'(val) { this.model = null - this.standardMethodListId = null + this.standardMethodListId = [] }, 'addObj.sampleNum'(val) { this.model = null - this.standardMethodListId = null + this.standardMethodListId = [] } }, mounted() { @@ -1219,7 +1227,10 @@ ...res.data.insOrder }; this.addObj.type = String(this.addObj.type) - this.sampleList = this.HaveJson(res.data.sampleProduct); + this.sampleList = this.HaveJson(res.data.sampleProduct) + this.sampleList.forEach(m=>{ + m.standardMethodListId = JSON.parse(m.standardMethodListId) + }); this.getProNum() this.addObj.sampleNum = this.sampleList.length this.$nextTick(() => { @@ -1233,6 +1244,7 @@ } }, methods: { + //鐗规畩鍊煎~鍐欏鐞� inputValueHandler(row,index){ if(row){ @@ -1626,7 +1638,7 @@ if (!this.addObj.type) { this.$message.error('鏈�夋嫨绱ф�ョ▼搴�') } else if (!this.addObj.formType) { - this.$message.error('璇疯緭鍏ユ潵鏍锋柟寮�') + this.$message.error('璇疯緭鍏ヨ鍗曠被鍨�') } else if (!this.addObj.orderType) { this.$message.error('璇烽�夋嫨妫�楠岀被鍒�') } else if (!this.addObj.production) { @@ -1641,9 +1653,11 @@ this.$message.error('璇疯緭鍏ユ牱鍝佸悕绉�') } else if (!this.sampleList.every(m => m.model)) { this.$message.error('璇疯緭鍏ユ牱鍝佸瀷鍙�') - } else if (!this.sampleList.every(m => m.standardMethodListId)) { + } else if (!this.sampleList.every(m => m.standardMethodListId&&m.standardMethodListId.length>0)) { this.$message.error('璇烽�夋嫨妫�楠屾爣鍑�') - } else { + } else if(this.addObj.formType&&this.addObj.formType!='鍏朵粬鎴愬搧'&&!this.addObj.issueUser){ + this.$message.error('璇烽�夋嫨涓嬪彂瀵硅薄') + }else{ //鏍¢獙妫�楠岄」鐨勮姹傚�煎拰瑕佹眰鎻忚堪,浠呭鎵樿姹� // if(this.active==1&&this.isAskOnlyRead){ // const isTrue = this.checkRequiredValueAndRemark(filterProductList) @@ -2243,7 +2257,7 @@ this.sample.sample = this.addObj.sample this.sample.model = this.addObj.model this.sample.unit = this.addObj.unit - this.sample.standardMethodListId = null + this.sample.standardMethodListId = [] this.sample.insProduct = [] this.sample.id = this.count this.sample.childSampleList = [] @@ -2288,7 +2302,7 @@ this.sample.sample = this.addObj.sample this.sample.model = this.addObj.model this.sample.unit = this.addObj.unit - this.sample.standardMethodListId = null + this.sample.standardMethodListId = [] this.sample.insProduct = [] this.sample.id = parseInt(i+1) this.sample.childSampleList = [] @@ -2328,12 +2342,6 @@ }, rowClick(row, column, event) { this.currentMethod = row - let obj = this.methods.find(a => a.id == this.currentMethod.standardMethodListId) - if (obj && obj.code == '濮旀墭瑕佹眰') { - this.isAskOnlyRead = true - } else { - this.isAskOnlyRead = false - } this.sampleId = row.id if (this.active !== 1) { this.sampleIds = [] @@ -2596,7 +2604,7 @@ }, selectEnumByCategoryForSampleForm() { this.$axios.post(this.$api.enums.selectEnumByCategory, { - category: "鏉ユ牱鏂瑰紡" + category: "璁㈠崟绫诲瀷" }).then(res => { this.formType = res.data if (this.formType.length > 0) { @@ -2607,20 +2615,13 @@ methodChange(val, row) { if (val === null || val === '') return this.currentMethod = row - let obj = this.methods.find(a => a.id == this.currentMethod.standardMethodListId) - if (obj && obj.code == '濮旀墭瑕佹眰') { - this.isAskOnlyRead = true - } else { - this.isAskOnlyRead = false - } this.getProductLoad = true let selectTreeList = this.selectTree.split(" - ") this.addObj.model&&(selectTreeList[selectTreeList.length - 1] = this.addObj.model) - console.log( this.selectTree); this.$axios.post(this.$api.standardTree.selectStandardProductList, { model: (this.addObj.model?this.addObj.model:row.model) + '-' + row.modelNum, - standardMethodListId: val, + standardMethodListId: val.join(','), factory: selectTreeList.join(" - "), }, { headers: { -- Gitblit v1.9.3