From ef9eb48046f8dfbb3c18b0f45befcbeddbdf6899 Mon Sep 17 00:00:00 2001
From: value <z1292839451@163.com>
Date: 星期三, 29 五月 2024 03:56:23 +0800
Subject: [PATCH] 光纤配置数据回显和保存
---
src/components/do/b1-ins-order/add.vue | 93 ++++++++++++++++++++++++++++++++++++++++------
1 files changed, 80 insertions(+), 13 deletions(-)
diff --git a/src/components/do/b1-ins-order/add.vue b/src/components/do/b1-ins-order/add.vue
index 8967cea..e6dfa2a 100644
--- a/src/components/do/b1-ins-order/add.vue
+++ b/src/components/do/b1-ins-order/add.vue
@@ -92,7 +92,7 @@
<template>
<div class="ins_order_add">
- <div>
+ <div v-show="!configShow">
<el-row class="title">
<el-col :span="6" style="padding-left: 20px;">濮旀墭鍗曚俊鎭�</el-col>
<el-col :span="18" style="text-align: right;">
@@ -107,6 +107,7 @@
<el-button size="medium" @click="templateDia=true" v-show="active==1">
<span style="color: #3A7BFA;">淇濆瓨妯℃澘</span>
</el-button>
+ <el-button size="medium" type="primary" @click="openConfig">鍏夌氦閰嶇疆</el-button>
<el-button size="medium" type="primary" @click="save" :loading="saveLoad" v-show="active==1">鎻愪氦</el-button>
<!-- 瀹℃牳 -->
<el-button size="medium" @click="upInsOrderOfState(2)" :loading="saveLoad" v-show="active==3"
@@ -119,7 +120,7 @@
</el-col>
</el-row>
</div>
- <div class="search">
+ <div class="search" v-show="!configShow">
<el-row>
<el-col class="search_thing" :span="6">
<div class="search_label">濮旀墭缂栧彿锛�</div>
@@ -197,7 +198,9 @@
<el-col class="search_thing" :span="6">
<div class="search_label"><span class="required-span">* </span>鏉ユ牱鏂瑰紡锛�</div>
<div class="search_input">
- <el-input size="small" clearable v-model="addObj.formType" :readonly="active>1"></el-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">
@@ -242,6 +245,30 @@
<el-input size="small" placeholder="璇疯緭鍏�" clearable v-model="addObj.otcCode" :readonly="active>1"></el-input>
</div>
</el-col>
+ <el-col class="search_thing" :span="6">
+ <div class="search_label"><span class="required-span">* </span>宸ョ▼鍚嶇О锛�</div>
+ <div class="search_input">
+ <el-input size="small" placeholder="璇疯緭鍏�" clearable v-model="addObj.engineering" :readonly="active>1"></el-input>
+ </div>
+ </el-col>
+ <el-col class="search_thing" :span="6">
+ <div class="search_label"><span class="required-span">* </span>宸ョ▼鍚嶇ОEN锛�</div>
+ <div class="search_input">
+ <el-input size="small" placeholder="璇疯緭鍏�" clearable v-model="addObj.engineeringEn" :readonly="active>1"></el-input>
+ </div>
+ </el-col>
+ <el-col class="search_thing" :span="6">
+ <div class="search_label"><span class="required-span">* </span>鐢熶骇鍗曚綅锛�</div>
+ <div class="search_input">
+ <el-input size="small" placeholder="璇疯緭鍏�" clearable v-model="addObj.production" :readonly="active>1"></el-input>
+ </div>
+ </el-col>
+ <el-col class="search_thing" :span="6">
+ <div class="search_label"><span class="required-span">* </span>鐢熶骇鍗曚綅EN锛�</div>
+ <div class="search_input">
+ <el-input size="small" placeholder="璇疯緭鍏�" clearable v-model="addObj.productionEn" :readonly="active>1"></el-input>
+ </div>
+ </el-col>
<el-col class="search_thing" :span="6" style="align-items: flex-start;margin: 8px 0;">
<div class="search_label">澶囨敞锛�</div>
<div class="search_input">
@@ -251,7 +278,7 @@
</el-col>
</el-row>
</div>
- <div>
+ <div v-show="!configShow">
<el-table class="el-table sampleTable" ref="sampleTable" :data="sampleList" height="250px" tooltip-effect="dark"
border @selection-change="selectSample" highlight-current-row @row-click="rowClick" style="margin-top: 10px;">
<el-table-column type="selection" width="60" :selectable="selectable" v-if="active==1"></el-table-column>
@@ -270,7 +297,7 @@
<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" @change="handleChangeModel" :disabled="active>1" style="width: 100%;" disabled>
+ size="small" @change="handleChangeModel" :disabled="active>1" style="width: 100%;">
<el-option v-for="item in models" :key="item.value" :label="item.label" :value="item.value">
</el-option>
</el-select>
@@ -346,7 +373,7 @@
<el-table-column prop="section" label="鍖洪棿" width="120" show-overflow-tooltip></el-table-column>
<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"
+ <el-input size="small" placeholder="瑕佹眰鍊�" v-model="scope.row.ask" clearable type="textarea" readonly
:autosize="{ minRows: 1, maxRows: 3}" @change="e=>requestChange(e,scope.row)" :readonly="active>1"></el-input>
</template>
</el-table-column>
@@ -513,14 +540,17 @@
</el-row>
</span>
</el-dialog>
+ <fiberOpticConfig :currentId="currentId" v-if="configShow"/>
</div>
</template>
<script>
import ValueTable from '../../tool/value-table.vue'
+ import fiberOpticConfig from './fiberoptic-config.vue'
export default {
components: {
- ValueTable
+ ValueTable,
+ fiberOpticConfig
},
props: {
active: {
@@ -560,7 +590,11 @@
isLeave: 0,
orderType: null,
send: 1,
- formType: '閫佹'
+ formType: '閫佹',
+ engineering: null,
+ engineeringEn: null,
+ production: null,
+ productionEn: null,
},
sample: {
sampleCode: null,
@@ -634,7 +668,9 @@
tell: '',
noLoading: false,
orderType: [],
- filters: []
+ filters: [],
+ formType: [],
+ configShow: false,
}
},
watch: {
@@ -653,6 +689,7 @@
this.selectStandardMethods()
this.selectEnumByCategoryForOrderType()
this.selectEnumByCategoryForSonLaboratory()
+ this.selectEnumByCategoryForSampleForm()
if (this.active != 1) {
// 鏌ョ湅/瀹℃牳娴佺▼
// 璇锋眰鎺ュ彛锛屽洖鏄炬暟鎹�
@@ -667,6 +704,10 @@
this.addObj.sampleNum = this.sampleList.length
this.$nextTick(() => {
this.$refs.sampleTable.doLayout()
+ if(this.addObj.sampleNum>0){
+ this.$refs.sampleTable.setCurrentRow(this.sampleList[0],true)
+ this.rowClick(this.sampleList[0])
+ }
})
})
}
@@ -718,6 +759,14 @@
this.$message.error('璇疯緭鍏ユ潵鏍锋柟寮�')
} else if (!this.addObj.orderType) {
this.$message.error('璇烽�夋嫨妫�楠岀被鍒�')
+ }else if (!this.addObj.engineering) {
+ this.$message.error('璇疯緭鍏ュ伐绋嬪悕绉�')
+ } else if (!this.addObj.engineeringEn) {
+ this.$message.error('璇疯緭鍏ュ伐绋嬪悕绉癊N')
+ }else if (!this.addObj.production) {
+ this.$message.error('璇疯緭鍏ョ敓浜у崟浣�')
+ }else if (!this.addObj.productionEn) {
+ this.$message.error('璇疯緭鍏ョ敓浜у崟浣岴N')
} else if (this.sampleList.length < 1) {
this.$message.error('璇锋坊鍔犱竴涓牱鍝�')
} else if (!this.sampleList.every(m => m.sample)) {
@@ -868,8 +917,8 @@
},
activeStandardTree() {
let trees = this.selectTree.split(" - ")
- if (trees.length < 5) {
- this.$message.error('鏈�夋嫨鍨嬪彿')
+ if (trees.length < 4) {
+ this.$message.error('鏈�夋嫨浜у搧')
return
}
this.addObj.factory = trees[0]
@@ -1122,12 +1171,23 @@
}
})
},
+ selectEnumByCategoryForSampleForm() {
+ this.$axios.post(this.$api.enums.selectEnumByCategory, {
+ category: "鏉ユ牱鏂瑰紡"
+ }).then(res => {
+ this.formType = res.data
+ if(this.formType.length > 0){
+ this.addObj.formType = this.formType[0].value
+ }
+ })
+ },
methodChange(val, row) {
if(val===null||val==='')return
this.getProductLoad = true
this.$axios.post(this.$api.standardTree.selectStandardProductList, {
- model: this.addObj.model + '-' + row.modelNum,
- standardMethodListId: val
+ model: row.model + '-' + row.modelNum,
+ standardMethodListId: val,
+ factory: this.selectTree,
}, {
headers: {
'Content-Type': 'application/json'
@@ -1262,6 +1322,13 @@
filterHandler(value, row, column) {
const property = column['property'];
return row[property] === value;
+ },
+ openConfig(){
+ if(this.sampleIds.length===0){
+ this.$message.error("鏈�夋嫨鏍峰搧")
+ return
+ }
+ this.configShow = true
}
}
}
--
Gitblit v1.9.3