From 6ef9e5189ac1888b8c4c504d5c5d3f431807ff56 Mon Sep 17 00:00:00 2001
From: spring <2396852758@qq.com>
Date: 星期六, 15 三月 2025 11:57:40 +0800
Subject: [PATCH] 修改电路试验单位
---
src/components/do/b1-inspect-order-plan/power-capacity.vue | 124 +++++++++++++++++++++--------------------
1 files changed, 64 insertions(+), 60 deletions(-)
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 19a9d2a..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)
- this.$set(this.currentInfo, 'equipName', this.currentInfo.insProductResult.equipName)
+ 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