From 36ca85c695cc3d6a6a645aca796d36b718249aee Mon Sep 17 00:00:00 2001 From: spring <2396852758@qq.com> Date: 星期三, 26 二月 2025 15:03:35 +0800 Subject: [PATCH] 修改高低温、功率试验单位 --- src/components/do/b1-inspect-order-plan/humidity.vue | 321 +++++++++++++++++++++------------------- src/components/do/b1-ins-order/add.vue | 32 ++- src/components/do/b1-inspect-order-plan/power-capacity.vue | 124 ++++++++------- 3 files changed, 253 insertions(+), 224 deletions(-) diff --git a/src/components/do/b1-ins-order/add.vue b/src/components/do/b1-ins-order/add.vue index 7aa1d95..1ee8edd 100644 --- a/src/components/do/b1-ins-order/add.vue +++ b/src/components/do/b1-ins-order/add.vue @@ -2505,20 +2505,30 @@ let isHaveAsk = this.totalArr.filter( a => (a.ask === null || a.ask == "") && a.state == 1 ); - let isHaveAsk0 = this.totalArr.filter( - a => - (a.ask == "/" || + let arr = [] + sampleList.forEach(m => { + m.insProduct.forEach(a => { + arr.push(a) + }) + }) + let isHaveAsk0 = arr.filter( + a => { + if (a.ask) { + a.ask = String(a.ask) + } + return (a.ask == "/" || a.ask == "-" || a.ask == "鈥斺��" || (/\d/.test(a.ask) && - ((a.ask && a.ask.includes("<")) || - a.ask.includes(">") || - a.ask.includes("=") || - a.ask.includes("锛�") || - a.ask.includes("锛�") || - a.ask.includes("鈮�") || - a.ask.includes("鈮�")))) && - a.state == 1 + a.ask && typeof a.ask === 'string' && a.ask.includes("<") || + a.ask.includes(">") || + a.ask.includes("=") || + a.ask.includes("锛�") || + a.ask.includes("锛�") || + a.ask.includes("鈮�") || + a.ask.includes("鈮�") || a.ask.includes(":"))) && + a.state == 1 + } ); let stateArr = this.totalArr.filter(a => a.state == 1); if (isHaveAsk.length > 0) { diff --git a/src/components/do/b1-inspect-order-plan/humidity.vue b/src/components/do/b1-inspect-order-plan/humidity.vue index 5eead4d..880331e 100644 --- a/src/components/do/b1-inspect-order-plan/humidity.vue +++ b/src/components/do/b1-inspect-order-plan/humidity.vue @@ -1,97 +1,105 @@ <template> <div> <table border="1" cellpadding="10" class="thermal-table" style="margin-bottom: 20px;"> - <template v-for="(item,index) in insProductList"> + <template v-for="(item, index) in insProductList"> <tr> - <td style="font-size: 18px;font-weight: 500;background-color: #F0F1F5;padding: 10px 0;box-sizing: border-box;" :colspan="insProductList&&insProductList.find(m=>m.list0.length==6)?7:6">{{ item.inspectionItemSubclass }}</td> + <td style="font-size: 18px;font-weight: 500;background-color: #F0F1F5;padding: 10px 0;box-sizing: border-box;" + :colspan="insProductList && insProductList.find(m => m.list0.length == 6) ? 7 : 6">{{ + item.inspectionItemSubclass }} + </td> </tr> <tr> <td style="font-size: 16px;background-color: #F0F1F5;">瑙勬牸鍨嬪彿</td> - <td>{{item.model}}</td> + <td>{{ item.model }}</td> <td style="font-size: 16px;background-color: #F0F1F5;">璇曢獙鏂规硶</td> - <td>{{item.methodS}}</td> + <td>{{ item.methodS }}</td> <td style="font-size: 16px;background-color: #F0F1F5;">璁惧缂栧彿</td> - <td :colspan="insProductList&&insProductList.find(m=>m.list0.length==6)?2:1"> - <el-select v-model="item.equipValue" placeholder="璇烽�夋嫨" size="small" :disabled="state>1" @focus="methodFocus(item)" @change="m=>handleEquip(m,item)"> - <el-option - v-for="item in equipOptions" - :key="item.value" - :label="item.value" - :value="item.value"> + <td :colspan="insProductList && insProductList.find(m => m.list0.length == 6) ? 2 : 1"> + <el-select v-model="item.equipValue" placeholder="璇烽�夋嫨" size="small" :disabled="state > 1" + @focus="methodFocus(item)" @change="m => handleEquip(m, item)"> + <el-option v-for="item in equipOptions" :key="item.value" :label="item.value" :value="item.value"> </el-option> </el-select> </td> </tr> <tr> <td style="font-size: 16px;background-color: #F0F1F5;">璇曢獙瑕佹眰</td> - <td colspan="3" style="text-align: left;">{{item.tell}}</td> + <td colspan="3" style="text-align: left;">{{ item.tell }}</td> <td style="font-size: 16px;background-color: #F0F1F5;">璁惧鍚嶇О</td> - <td :colspan="insProductList&&insProductList.find(m=>m.list0.length==6)?2:1">{{ item.equipName }}</td> + <td :colspan="insProductList && insProductList.find(m => m.list0.length == 6) ? 2 : 1">{{ item.equipName }} + </td> </tr> <tr> <td style="font-size: 16px;background-color: #F0F1F5;">瀹為獙鍓嶆牱鍝佹鏌�</td> - <td :colspan="item.beforeCheck=='鐮存崯'?1:(insProductList&&insProductList.find(m=>m.list0.length==6)?3:2)"> - <el-select v-model="item.beforeCheck" placeholder="璇烽�夋嫨" size="small" :disabled="state>1" @change="save(item)"> - <el-option - v-for="item in options" - :key="item.value" - :label="item.label" - :value="item.value"> + <td + :colspan="item.beforeCheck == '鐮存崯' ? 1 : (insProductList && insProductList.find(m => m.list0.length == 6) ? 3 : 2)"> + <el-select v-model="item.beforeCheck" placeholder="璇烽�夋嫨" size="small" :disabled="state > 1" + @change="save(item)"> + <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value"> </el-option> </el-select> </td> - <td v-if="item.beforeCheck=='鐮存崯'"> - <el-input v-model="item.beforeNote" placeholder="鐮存崯璇存槑" size="small" :disabled="state>1" style="display: inline-block;width: 100%;" @change="save(item)" type="textarea" - :rows="3"></el-input> + <td v-if="item.beforeCheck == '鐮存崯'"> + <el-input v-model="item.beforeNote" placeholder="鐮存崯璇存槑" size="small" :disabled="state > 1" + style="display: inline-block;width: 100%;" @change="save(item)" type="textarea" :rows="3"></el-input> </td> <td style="font-size: 16px;background-color: #F0F1F5;">瀹為獙鍚庢牱鍝佹鏌�</td> - <td :colspan="item.afterCheck=='鐮存崯'?1:2"> - <el-select v-model="item.afterCheck" placeholder="璇烽�夋嫨" size="small" :disabled="state>1" @change="save(item)"> - <el-option - v-for="item in options" - :key="item.value" - :label="item.label" - :value="item.value"> + <td :colspan="item.afterCheck == '鐮存崯' ? 1 : 2"> + <el-select v-model="item.afterCheck" placeholder="璇烽�夋嫨" size="small" :disabled="state > 1" + @change="save(item)"> + <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value"> </el-option> </el-select> </td> - <td v-if="item.afterCheck=='鐮存崯'" :colspan="insProductList&&insProductList.find(m=>m.list0.length==6)?2:1"> - <el-input v-model="item.afterNote" placeholder="鐮存崯璇存槑" size="small" :disabled="state>1" style="display: inline-block;width: 100%;" @change="save(item)" type="textarea" - :rows="3"></el-input> + <td v-if="item.afterCheck == '鐮存崯'" + :colspan="insProductList && insProductList.find(m => m.list0.length == 6) ? 2 : 1"> + <el-input v-model="item.afterNote" placeholder="鐮存崯璇存槑" size="small" :disabled="state > 1" + style="display: inline-block;width: 100%;" @change="save(item)" type="textarea" :rows="3"></el-input> </td> </tr> - <tr v-if="item.inspectionItemSubclass&&item.inspectionItemSubclass.includes('浣�')"> + <tr v-if="item.inspectionItemSubclass && item.inspectionItemSubclass.includes('浣�')"> <td>鐢佃皟缁撴灉</td> - <td v-for="(m,i) in item.list0" :key="i"> - <el-input v-model="m.value" :placeholder="'绗�'+(i+1)+'娆�'" size="small" :disabled="state>1" style="display: inline-block;width: 50%;" @change="save(item)"></el-input> - <el-button icon="el-icon-minus" circle size="mini" type="danger" - :disabled="state>1" style="margin: 5px;display: inline-block;" @click="deleteList(item.list0,i,m)" ></el-button> - <el-button icon="el-icon-plus" circle size="mini" type="primary" :disabled="state>1" style="margin: 5px;display: inline-block;" v-if="i==item.list0.length-1&&i<5" @click="addList(item.list0,item.list0.length-1)"></el-button> + <td v-for="(m, i) in item.list0" :key="i"> + <el-input v-model="m.value" :placeholder="'绗�' + (i + 1) + '娆�'" size="small" :disabled="state > 1" + style="display: inline-block;width: 50%;" @change="save(item)"></el-input> + <el-button icon="el-icon-minus" circle size="mini" type="danger" :disabled="state > 1" + style="margin: 5px;display: inline-block;" @click="deleteList(item.list0, i, m)"></el-button> + <el-button icon="el-icon-plus" circle size="mini" type="primary" :disabled="state > 1" + style="margin: 5px;display: inline-block;" v-if="i == item.list0.length - 1 && i < 5" + @click="addList(item.list0, item.list0.length - 1)"></el-button> </td> </tr> <tr style="background-color: #F0F1F5;"> - <td colspan="2">鏃堕棿</td> - <td colspan="1">娓╁害</td> - <td colspan="1">婀垮害</td> - <td :colspan="insProductList&&insProductList.find(m=>m.list0.length==6)?3:2">鎿嶄綔</td> + <td colspan="1">鏃堕棿</td> + <td colspan="1">娓╁害(鈩�)</td> + <td colspan="1">婀垮害(%)</td> + <td colspan="1">娓╁害鍙樺寲閫熺巼(鈩�/min)</td> + <td :colspan="insProductList && insProductList.find(m => m.list0.length == 6) ? 3 : 2">鎿嶄綔</td> </tr> - <tr v-for="(m,i) in item.list" :key="i+item.id"> - <td colspan="2"> - <el-date-picker - v-model="m.time" - placeholder="鏃堕棿" size="small" editable format="yyyy-MM-dd HH:mm" value-format="yyyy-MM-dd HH:mm" style="width: 100%;" @change="save(item)" :disabled="state>1" type="datetime"> - </el-date-picker> + <tr v-for="(m, i) in item.list" :key="i + item.id"> + <td colspan="1"> + <el-date-picker v-model="m.time" placeholder="鏃堕棿" size="small" editable format="yyyy-MM-dd HH:mm" + value-format="yyyy-MM-dd HH:mm" style="width: 100%;" @change="save(item)" :disabled="state > 1" + type="datetime"> + </el-date-picker> </td> <td colspan="1"> - <el-input v-model="m.temperature" placeholder="娓╁害" size="small" @change ="a=>handleReplace(m,'鈩�','temperature',item)" :disabled="state>1"></el-input> + <el-input v-model="m.temperature" placeholder="娓╁害" size="small" + @change="a => handleReplace(m, '鈩�', 'temperature', item)" :disabled="state > 1"></el-input> </td> <td colspan="1"> - <el-input v-model="m.humidity" placeholder="婀垮害" size="small" @change ="a=>handleReplace(m,'%rh','humidity',item)" :disabled="state>1"></el-input> + <el-input v-model="m.humidity" placeholder="婀垮害" size="small" + @change="a => handleReplace(m, '%', 'humidity', item)" :disabled="state > 1"></el-input> </td> - <td :colspan="insProductList&&insProductList.find(m=>m.list0.length==6)?3:2"> - <el-button icon="el-icon-minus" circle size="mini" type="danger" - @click="deleteList(item.list,i,item)" :disabled="state>1" style="margin: 5px;"></el-button> - <el-button icon="el-icon-plus" circle size="mini" type="primary" @click="addList(item.list,i,'out')" :disabled="state>1" style="margin: 5px;"></el-button> + <td colspan="1"> + <el-input v-model="m.change" placeholder="娓╁害鍙樺寲閫熺巼" size="small" + @change="a => handleReplace(m, '鈩�/min', 'change', item)" :disabled="state > 1"></el-input> + </td> + <td :colspan="insProductList && insProductList.find(m => m.list0.length == 6) ? 3 : 2"> + <el-button icon="el-icon-minus" circle size="mini" type="danger" @click="deleteList(item.list, i, item)" + :disabled="state > 1" style="margin: 5px;"></el-button> + <el-button icon="el-icon-plus" circle size="mini" type="primary" @click="addList(item.list, i, 'out')" + :disabled="state > 1" style="margin: 5px;"></el-button> </td> </tr> </template> @@ -101,21 +109,21 @@ <script> export default { - props:['insProduct','orderId','sampleId','state','isLook','num'], + props: ['insProduct', 'orderId', 'sampleId', 'state', 'isLook', 'num'], data() { return { - equipOptions:[], - insProductList:[], - options:[ - {value: '瀹屽ソ', label: '瀹屽ソ'}, - {value: '鐮存崯', label: '鐮存崯'} + equipOptions: [], + insProductList: [], + options: [ + { value: '瀹屽ソ', label: '瀹屽ソ' }, + { value: '鐮存崯', label: '鐮存崯' } ] } }, - watch:{ - insProduct:{ - deep:true, - handler:function(newVal,oldVal){ + watch: { + insProduct: { + deep: true, + handler: function (newVal, oldVal) { this.init() } } @@ -124,77 +132,80 @@ this.init() }, methods: { - init(){ + init() { this.insProductList = this.HaveJson(this.insProduct) - this.insProductList.forEach(item=>{ - if(!item.insProductResult){ + this.insProductList.forEach(item => { + if (!item.insProductResult) { // 鍒濆鍖� - this.$set(item,'list',[]) - this.$set(item,'list0',[]) + this.$set(item, 'list', []) + this.$set(item, 'list0', []) item.list.push({}) item.list0.push({}) - item.list.forEach(m=>{ - this.$set(m,'time','') - this.$set(m,'temperature','') - this.$set(m,'humidity','') + item.list.forEach(m => { + this.$set(m, 'time', '') + this.$set(m, 'temperature', '') + this.$set(m, 'humidity', '') + this.$set(m, 'change', '') }) - this.$set(item,'equipValue','') - this.$set(item,'equipName','') - this.$set(item,'beforeCheck','') - this.$set(item,'afterCheck','') - this.$set(item,'afterNote','') - this.$set(item,'beforeNote','') - }else{ + this.$set(item, 'equipValue', '') + this.$set(item, 'equipName', '') + this.$set(item, 'beforeCheck', '') + this.$set(item, 'afterCheck', '') + this.$set(item, 'afterNote', '') + this.$set(item, 'beforeNote', '') + } else { // 璧嬪�� - this.$set(item,'list',JSON.parse(item.insProductResult.insValue)) - item.list.forEach(m=>{ - this.$set(m,'time',m.time) - this.$set(m,'temperature',m.temperature) - this.$set(m,'humidity',m.humidity) + this.$set(item, 'list', JSON.parse(item.insProductResult.insValue)) + item.list.forEach(m => { + this.$set(m, 'time', m.time) + this.$set(m, 'temperature', m.temperature) + this.$set(m, 'temperature', m.temperature) + this.$set(m, 'humidity', m.humidity) }) - if(item.insProductResult.comValue){ - this.$set(item,'list0',JSON.parse(item.insProductResult.comValue)) - item.list0.forEach((m,i)=>{ - this.$set(m,'value',m.value) + if (item.insProductResult.comValue) { + this.$set(item, 'list0', JSON.parse(item.insProductResult.comValue)) + item.list0.forEach((m, i) => { + this.$set(m, 'value', m.value) }) - }else{ - this.$set(item,'list0',[]) + } else { + this.$set(item, 'list0', []) item.list0.push({}) } - this.$set(item,'equipValue',item.insProductResult.equipValue?JSON.parse(item.insProductResult.equipValue)[0].v:'') - this.$set(item,'equipName',item.insProductResult.equipName?JSON.parse(item.insProductResult.equipName)[0].v:'') - this.$set(item,'beforeCheck',item.insProductResult.beforeCheck) - this.$set(item,'afterCheck',item.insProductResult.afterCheck) - this.$set(item,'afterNote',item.insProductResult.afterNote) - this.$set(item,'beforeNote',item.insProductResult.beforeNote) + this.$set(item, 'equipValue', item.insProductResult.equipValue ? JSON.parse(item.insProductResult.equipValue)[0].v : '') + this.$set(item, 'equipName', item.insProductResult.equipName ? JSON.parse(item.insProductResult.equipName)[0].v : '') + this.$set(item, 'beforeCheck', item.insProductResult.beforeCheck) + this.$set(item, 'afterCheck', item.insProductResult.afterCheck) + this.$set(item, 'afterNote', item.insProductResult.afterNote) + this.$set(item, 'beforeNote', item.insProductResult.beforeNote) } }) }, - deleteList(arr,i,item){ - if(arr.length>1){ - arr.splice(i,1) + deleteList(arr, i, item) { + if (arr.length > 1) { + arr.splice(i, 1) this.save(item) - }else{ + } else { this.$message({ type: 'warning', message: '涓嶈兘鍐嶅垹闄や簡' }) } }, - addList(arr,i,type){ - if(type=='out'){ - arr.splice(i+1,0,{ - value:'', + addList(arr, i, type) { + if (type == 'out') { + arr.splice(i + 1, 0, { + value: '', }) - }else{ - arr.splice(i+1,0,{ - time:'', - temperature:'', - humidity:'' + } else { + arr.splice(i + 1, 0, { + time: '', + temperature: '', + humidity: '', + change: '' }) } }, - async methodFocus(item){ + async methodFocus(item) { this.equipOptions = await this.getEquipOptions(item) }, // 鑾峰彇璁惧閫夐」 id:涓烘楠岄」id @@ -219,11 +230,11 @@ * @param {any} m - 鏂扮殑璁惧鍊� * @param {Object} item - 璁惧瀵硅薄 */ - handleEquip(m,item){ + handleEquip(m, item) { this.$delete(item, 'equipValue') this.$set(item, 'equipValue', m) this.$delete(item, 'equipName') - this.$set(item, 'equipName', this.equipOptions.find(m=>m.value==item.equipValue).label) + this.$set(item, 'equipName', this.equipOptions.find(m => m.value == item.equipValue).label) this.save(item) }, /** @@ -234,31 +245,32 @@ * @param {any} v - 鏈娇鐢ㄧ殑鍙傛暟锛堜繚鐣欎互鍖归厤鍏朵粬閲嶈浇锛� * @returns {void} 鏃犺繑鍥炲�� */ - handleReplace(m,unit,v,item){ - if(m[v]&&!`${m[v]}`.includes(unit)){ - m[v] = m[v]+unit + handleReplace(m, unit, v, item) { + if (m[v] && !`${m[v]}`.includes(unit)) { + m[v] = m[v] + unit } - if(m[v]){ + if (m[v]) { this.save(item) } }, - save(item){ + save(item) { this.$axios.post(this.$api.insOrderPlan.saveInsContext3, { - insProductId:item.id, - insValue:JSON.stringify(item.list), - comValue:JSON.stringify(item.list0), - equipValue:item.equipValue, - equipName:item.equipName, - num:this.num, - beforeCheck:item.beforeCheck, - afterCheck:item.afterCheck, - afterNote:item.afterNote, - beforeNote:item.beforeNote, + insProductId: item.id, + insValue: JSON.stringify(item.list), + comValue: JSON.stringify(item.list0), + equipValue: item.equipValue, + equipName: item.equipName, + num: this.num, + beforeCheck: item.beforeCheck, + afterCheck: item.afterCheck, + afterNote: item.afterNote, + beforeNote: item.beforeNote, }, { - headers: { - 'Content-Type': 'application/json' - }, - noQs:true}).then(res => { + headers: { + 'Content-Type': 'application/json' + }, + noQs: true + }).then(res => { if (res.code === 201) { this.$message.error('淇濆瓨澶辫触') return @@ -273,24 +285,27 @@ </script> <style scoped> - .thermal-table{ - min-width: calc(100% - 10px); - margin: 5px 5px 0; - table-layout: fixed; - } - .thermal-table td { - min-width: 70px; - text-align: center; - font-size: 14px; - word-wrap: break-word; - white-space: normal; - padding: 5px; - } - .thermal-table .el-input{ - display: flex; - align-items: center; - } - >>>.el-input__inner { - text-align: center; - } +.thermal-table { + min-width: calc(100% - 10px); + margin: 5px 5px 0; + table-layout: fixed; +} + +.thermal-table td { + min-width: 70px; + text-align: center; + font-size: 14px; + word-wrap: break-word; + white-space: normal; + padding: 5px; +} + +.thermal-table .el-input { + display: flex; + align-items: center; +} + +>>>.el-input__inner { + text-align: center; +} </style> diff --git a/src/components/do/b1-inspect-order-plan/power-capacity.vue b/src/components/do/b1-inspect-order-plan/power-capacity.vue index a2bd49f..4a40fcd 100644 --- a/src/components/do/b1-inspect-order-plan/power-capacity.vue +++ b/src/components/do/b1-inspect-order-plan/power-capacity.vue @@ -2,28 +2,26 @@ <div> <table border="1" cellpadding="10" class="thermal-table" style="margin-bottom: 20px;"> <tr> - <td style="font-size: 18px;font-weight: 500;background-color: #F0F1F5;padding: 10px 0;box-sizing: border-box;" colspan="6">{{ currentInfo.inspectionItemSubclass }}</td> + <td style="font-size: 18px;font-weight: 500;background-color: #F0F1F5;padding: 10px 0;box-sizing: border-box;" + colspan="6">{{ currentInfo.inspectionItemSubclass }}</td> </tr> <tr> <td style="font-size: 16px;background-color: #F0F1F5;">瑙勬牸鍨嬪彿</td> - <td>{{currentInfo.model}}</td> + <td>{{ currentInfo.model }}</td> <td style="font-size: 16px;background-color: #F0F1F5;">璇曢獙鏂规硶</td> - <td>{{currentInfo.methodS}}</td> + <td>{{ currentInfo.methodS }}</td> <td style="font-size: 16px;background-color: #F0F1F5;">璁惧缂栧彿</td> <td> - <el-select v-model="currentInfo.equipValue" placeholder="璇烽�夋嫨" size="small" :disabled="state>1" @focus="methodFocus(item)" @change="m=>handleEquip(m,currentInfo)"> - <el-option - v-for="item in equipOptions" - :key="item.value" - :label="item.label" - :value="item.value"> + <el-select v-model="currentInfo.equipValue" placeholder="璇烽�夋嫨" size="small" :disabled="state > 1" + @focus="methodFocus(item)" @change="m => handleEquip(m, currentInfo)"> + <el-option v-for="item in equipOptions" :key="item.value" :label="item.label" :value="item.value"> </el-option> </el-select> </td> </tr> <tr> <td style="font-size: 16px;background-color: #F0F1F5;">璇曢獙瑕佹眰</td> - <td colspan="3" style="text-align: left;">{{currentInfo.tell}}</td> + <td colspan="3" style="text-align: left;">{{ currentInfo.tell }}</td> <td style="font-size: 16px;background-color: #F0F1F5;">璁惧鍚嶇О</td> <td>{{ currentInfo.equipName }}</td> </tr> @@ -32,13 +30,15 @@ <td colspan="3" style="font-size: 16px;background-color: #F0F1F5;">骞冲潎鍔熺巼瀹归噺(W)</td> <td colspan="2" style="font-size: 16px;background-color: #F0F1F5;">宄板�煎姛鐜囧閲�(W)</td> </tr> - <tr v-for="(item,index) in currentInfo.list" :key="index"> - <td>{{index+1}}</td> + <tr v-for="(item, index) in currentInfo.list" :key="index"> + <td>{{ index + 1 }}</td> <td colspan="3"> - <el-input v-model="item.power" placeholder="" size="small" @change="m=>save(currentInfo)" :disabled="state>1"></el-input> + <el-input v-model="item.power" placeholder="" size="small" @change="m => save(currentInfo)" + :disabled="state > 1"></el-input> </td> <td colspan="2"> - <el-input v-model="item.peakPower" placeholder="" size="small" @change="m=>save(currentInfo)" :disabled="state>1"></el-input> + <el-input v-model="item.peakPower" placeholder="" size="small" @change="m => save(currentInfo)" + :disabled="state > 1"></el-input> </td> </tr> </table> @@ -47,17 +47,17 @@ <script> export default { - props:['insProduct','orderId','sampleId','state','isLook','num'], + props: ['insProduct', 'orderId', 'sampleId', 'state', 'isLook', 'num'], data() { return { - currentInfo:{}, - equipOptions:[], + currentInfo: {}, + equipOptions: [], } }, watch: { - insProduct:{ - deep:true, - handler(val){ + insProduct: { + deep: true, + handler(val) { this.init() } } @@ -66,25 +66,25 @@ this.init() }, methods: { - init(){ + init() { this.currentInfo = this.HaveJson(this.insProduct[0]) - if(!this.currentInfo.insProductResult){ + if (!this.currentInfo.insProductResult) { // 娌℃湁妫�楠屾椂鍒濆鍖� this.$set(this.currentInfo, 'equipValue', '') this.$set(this.currentInfo, 'equipName', '') let portNum = Number(this.currentInfo.ask.split(':')[1]) this.$set(this.currentInfo, 'list', []) - for(let i=0;i<portNum;i++){ - this.$set(this.currentInfo.list,i, {'power':null,'peakPower':null}) + for (let i = 0; i < portNum; i++) { + this.$set(this.currentInfo.list, i, { 'power': null, 'peakPower': null }) } - }else{ + } else { // 鏈夋楠屾椂鍒濆鍖� - this.$set(this.currentInfo,'equipValue',this.currentInfo.insProductResult.equipValue?JSON.parse(this.currentInfo.insProductResult.equipValue)[0].v:'') - this.$set(this.currentInfo,'equipName',this.currentInfo.insProductResult.equipName?JSON.parse(this.currentInfo.insProductResult.equipName)[0].v:'') + this.$set(this.currentInfo, 'equipValue', this.currentInfo.insProductResult.equipValue ? JSON.parse(this.currentInfo.insProductResult.equipValue)[0].v : '') + this.$set(this.currentInfo, 'equipName', this.currentInfo.insProductResult.equipName ? JSON.parse(this.currentInfo.insProductResult.equipName)[0].v : '') this.currentInfo.list = JSON.parse(this.currentInfo.insProductResult.insValue) } }, - async methodFocus(item){ + async methodFocus(item) { this.equipOptions = await this.getEquipOptions(item) }, // 鑾峰彇璁惧閫夐」 id:涓烘楠岄」id @@ -108,25 +108,26 @@ * @param {any} m - 鏂扮殑璁惧鍊� * @param {Object} item - 璁惧瀵硅薄 */ - handleEquip(m,item){ + handleEquip(m, item) { this.$delete(item, 'equipValue') this.$set(item, 'equipValue', m) this.$delete(item, 'equipName') - this.$set(item, 'equipName', this.equipOptions.find(m=>m.value==item.equipValue).label) + this.$set(item, 'equipName', this.equipOptions.find(m => m.value == item.equipValue).label) this.save(item) }, - save(item){ + save(item) { this.$axios.post(this.$api.insOrderPlan.saveInsContext3, { - insProductId:item.id, - insValue:JSON.stringify(item.list), - equipValue:item.equipValue, - equipName:item.equipName, - num:this.num, + insProductId: item.id, + insValue: JSON.stringify(item.list), + equipValue: item.equipValue, + equipName: item.equipName, + num: this.num, }, { - headers: { - 'Content-Type': 'application/json' - }, - noQs:true}).then(res => { + headers: { + 'Content-Type': 'application/json' + }, + noQs: true + }).then(res => { if (res.code === 201) { this.$message.error('淇濆瓨澶辫触') return @@ -141,24 +142,27 @@ </script> <style lang="css" scoped> -.thermal-table{ - min-width: calc(100% - 10px); - margin: 5px 5px 0; - table-layout: fixed; - } - .thermal-table td { - min-width: 70px; - text-align: center; - font-size: 14px; - word-wrap: break-word; - white-space: normal; - padding: 5px; - } - .thermal-table .el-input{ - display: flex; - align-items: center; - } - >>>.el-input__inner { - text-align: center; - } +.thermal-table { + min-width: calc(100% - 10px); + margin: 5px 5px 0; + table-layout: fixed; +} + +.thermal-table td { + min-width: 70px; + text-align: center; + font-size: 14px; + word-wrap: break-word; + white-space: normal; + padding: 5px; +} + +.thermal-table .el-input { + display: flex; + align-items: center; +} + +>>>.el-input__inner { + text-align: center; +} </style> -- Gitblit v1.9.3