From bc0e477594c5a916c014fb20dbb3797afd037ea0 Mon Sep 17 00:00:00 2001 From: value <z1292839451@163.com> Date: 星期六, 01 六月 2024 09:48:20 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/master' --- src/components/do/b1-ins-order/fiberoptic-config.vue | 90 ++++++++++++++++++++++++++++++++------------ 1 files changed, 65 insertions(+), 25 deletions(-) diff --git a/src/components/do/b1-ins-order/fiberoptic-config.vue b/src/components/do/b1-ins-order/fiberoptic-config.vue index 538c42c..98a4a92 100644 --- a/src/components/do/b1-ins-order/fiberoptic-config.vue +++ b/src/components/do/b1-ins-order/fiberoptic-config.vue @@ -4,7 +4,7 @@ <el-row class="title"> <el-col :span="6" style="padding-left: 20px;">鍏夌氦閰嶇疆</el-col> <el-col :span="18" style="text-align: right;"> - <el-button size="medium" type="primary" @click="save" :loading="saveLoad">淇� 瀛�</el-button> + <el-button size="medium" type="primary" @click="save" :loading="saveLoad" v-if="active==1">淇� 瀛�</el-button> <el-button size="medium" @click="outConfig"> <span style="color: #3A7BFA;">杩� 鍥�</span> </el-button> @@ -22,7 +22,7 @@ <label style="width: 70px;">鏍峰搧鍨嬪彿</label> <span style="font-size: 14px;">{{models}}</span> </div> - <el-radio-group v-model="packageInfo.radio" size="small" @change="upNum()"> + <el-radio-group v-model="packageInfo.radio" size="small" @change="upNum()" :disabled="active!=1"> <el-radio :label="0">鍏ㄦ</el-radio> <el-radio :label="1">鎶芥</el-radio> </el-radio-group> @@ -31,25 +31,29 @@ style="display: flex;align-items: center;justify-content: space-between;margin-bottom: 8px;padding: 0 12px;box-sizing: border-box;"> <div class="search-item" style="margin-right: 10px;"> <label>濂楃鏁扮洰</label> - <el-input v-model="packageInfo.num1" placeholder="璇疯緭鍏�" size="small" @change="upNum"></el-input> + <el-input v-model="packageInfo.num1" placeholder="璇疯緭鍏�" size="small" @change="upNum" :disabled="active!=1"></el-input> </div> <div class="search-item" style="margin-right: 10px;"> <label style="width: 70px;">鏍囧噯閲�</label> - <el-input v-model="packageInfo.standNum" placeholder="璇疯緭鍏�" size="small" @change="upNum"></el-input> + <el-input v-model="packageInfo.standNum" placeholder="璇疯緭鍏�" size="small" @change="upNum" :disabled="active!=1"></el-input> </div> <div class="search-item"> <label style="width: 70px;">妫�娴嬮噺</label> <el-input v-model="packageInfo.testNum" placeholder="璇疯緭鍏�" size="small" @change="upNum" - :disabled="packageInfo.radio===0"></el-input> + :disabled="packageInfo.radio===0||active!=1"></el-input> </div> </div> <el-table ref="table0" :data="bushing" tooltip-effect="dark" style="width: 100%" height="203px" size="small" - @selection-change="handleSelectionChange1"> - <el-table-column type="selection" width="45"> + @selection-change="handleSelectionChange1" + :header-cell-class-name="setClassName0"> + <el-table-column + type="selection" + width="45" + :selectable="()=>(active==1)"> </el-table-column> <el-table-column label="绠¤壊鏍�" show-overflow-tooltip> <template slot-scope="scope"> - <el-select v-model="scope.row.color" size="mini"> + <el-select v-model="scope.row.color" size="mini" :disabled="active!=1"> <el-option v-for="(color,i) in colors" :key="i" :label="color.lable" :value="color.value"></el-option> </el-select> @@ -74,7 +78,7 @@ @select="upProductSelect" > <el-table-column type="selection" width="55" - :selectable="()=>(currentDetectionItems||this.multiFiberList.length > 0)"> + :selectable="()=>((currentDetectionItems||this.multiFiberList.length > 0)&&active==1)"> </el-table-column> <el-table-column label="瀹為獙瀹�" show-overflow-tooltip prop="sonLaboratory" ></el-table-column> <el-table-column prop="inspectionItem" label="妫�楠岄」" show-overflow-tooltip> @@ -91,7 +95,8 @@ </el-table-column> <el-table-column prop="ask" label="妫�娴嬭姹�" show-overflow-tooltip width="200px"> <template slot-scope="scope"> - <el-input v-model="scope.row.ask" placeholder="璇疯緭鍏�" size="small"></el-input> + <el-input v-model="scope.row.ask" placeholder="璇疯緭鍏�" size="small" :disabled="active!=1" v-if="!isAskOnlyRead"></el-input> + <span v-else>{{ scope.row.ask }}</span> </template> </el-table-column> </el-table> @@ -103,15 +108,15 @@ <div class="grid-content"> <h5>鍏夌氦甯� <el-button size="mini" type="primary" class="btns" @click="addFibers" - :disabled="packageInfo.ismiers===false||miresModel===null||miresStandard===null">鐢熸垚鍏夌氦甯�</el-button> - <el-button size="mini" class="btns" @click="clearFibers" :disabled="selectBushing.length === 0">娓呴櫎</el-button> + :disabled="packageInfo.ismiers===false||miresModel===null||miresStandard===null" v-if="active==1">鐢熸垚鍏夌氦甯�</el-button> + <el-button size="mini" class="btns" @click="clearFibers" :disabled="selectBushing.length === 0" v-if="active==1">娓呴櫎</el-button> </h5> <div style="display: flex;align-items: center;justify-content: space-between;margin:4px 0 6px 0;padding: 0 12px;box-sizing: border-box;"> <div class="search-item" style="width: 50%;margin-right: 16px;"> <label style="width: 80px;">绾ゅ甫绫诲瀷</label> <el-select v-model="miresModel" placeholder="璇烽�夋嫨" size="small" style="width: 100%;" - :disabled="selectBushing.length===0"> + :disabled="selectBushing.length===0||active!=1"> <el-option v-for="(item,a) in miresModels" :key="a" :label="item.label" :value="item.value"> </el-option> </el-select> @@ -119,7 +124,7 @@ <div class="search-item" style="width: 50%;"> <label style="width: 80px;">鍙傝�冩爣鍑�</label> <el-select v-model="miresStandard" placeholder="璇烽�夋嫨" size="small" style="width: 100%;" - :disabled="miresModel===null" @focus="selectsStandardMethodByFLSSM2()" + :disabled="miresModel===null||active!=1" @focus="selectsStandardMethodByFLSSM2()" @change="(value)=>methodChange2(value)"> <el-option v-for="item in miresStandards" :key="item.id" :label="item.code" :value="item.id"> </el-option> @@ -127,8 +132,12 @@ </div> </div> <el-table ref="table2" :data="fibersList" tooltip-effect="dark" style="width: 100%" height="270px" - size="small" @selection-change="handleSelectionChange" highlight-current-row @row-click="rowClickFiber"> - <el-table-column type="selection" width="55"> + size="small" @selection-change="handleSelectionChange" highlight-current-row @row-click="(row, column, event)=>rowClickFiber(row, column, event,0)" + :header-cell-class-name="setClassName0"> + <el-table-column + type="selection" + width="55" + :selectable="()=>(active==1)"> </el-table-column> <el-table-column prop="code" label="鍏夌氦甯︾紪鍙�" show-overflow-tooltip align="center"> </el-table-column> @@ -144,13 +153,13 @@ <el-col :span="12"> <div class="grid-content"> <h5>鍏夌氦<el-button size="mini" type="primary" class="btns" @click="addFiber" - :disabled="mireModel===null||mireStandard===null">鍏夌氦閰嶈壊</el-button></h5> + :disabled="mireModel===null||mireStandard===null" v-if="active==1">鍏夌氦閰嶈壊</el-button></h5> <div style="display: flex;align-items: center;justify-content: space-between;margin: 4px 0 6px 0;padding: 0 12px;box-sizing: border-box;"> <div class="search-item" style="width: 50%;margin-right: 16px;"> <label style="width: 80px;">鍏夌氦绫诲瀷</label> <el-select v-model="mireModel" placeholder="璇烽�夋嫨" size="small" style="width: 100%;" - :disabled="selectBushing.length===0"> + :disabled="selectBushing.length===0||active!=1"> <el-option v-for="(item,a) in mireModels" :key="a" :label="item.label" :value="item.value"> </el-option> </el-select> @@ -158,7 +167,7 @@ <div class="search-item" style="width: 50%;"> <label style="width: 80px;">鍙傝�冩爣鍑�</label> <el-select v-model="mireStandard" placeholder="璇烽�夋嫨" size="small" style="width: 100%;" - :disabled="mireModel===null" @focus="selectsStandardMethodByFLSSM()" + :disabled="mireModel===null||active!=1" @focus="selectsStandardMethodByFLSSM()" @change="(value)=>methodChange(value)" :loading="mireStandardLoading"> <el-option v-for="item in mireStandards" :key="item.id" :label="item.code" :value="item.id"> </el-option> @@ -167,14 +176,18 @@ </div> <el-table ref="table3" :data="fiberList" tooltip-effect="dark" style="width: 100%" height="270px" size="small" highlight-current-row @selection-change="handleSelectionChange4" - @row-click="rowClickFiber"> - <el-table-column type="selection" width="55"> + @row-click="(row, column, event)=>rowClickFiber(row, column, event,1)" + :header-cell-class-name="setClassName0"> + <el-table-column + type="selection" + width="55" + :selectable="()=>(active==1)"> </el-table-column> <el-table-column prop="bushColor" label="绠″鑹叉爣" width="90" align="center"> </el-table-column> <el-table-column prop="color" label="鍏夌氦鑹叉爣" width="120"> <template slot-scope="scope"> - <el-select v-model="scope.row.color" size="mini"> + <el-select v-model="scope.row.color" size="mini" :disabled="active!=1"> <el-option v-for="(color,i) in colors" :key="i" :label="color.lable" :value="color.value"></el-option> </el-select> @@ -194,6 +207,12 @@ <script> export default { + props: { + active: { + type: Number, + default: () => 0 + }, + }, data() { return { saveLoad: false, @@ -231,12 +250,13 @@ detectionItems:[], currentDetectionItems:null, mireStandardLoading:false, - multiFiberList:[] + multiFiberList:[], + isAskOnlyRead:true } }, computed: { isAllDisabled() { - return this.multiFiberList.length > 0||this.currentDetectionItems + return this.multiFiberList.length > 0||this.currentDetectionItems||this.active!=1 }, }, watch: { @@ -525,7 +545,22 @@ } }) }, - rowClickFiber(row, column, event){ + rowClickFiber(row, column, event,type){ + if(type==0){ + let standard = this.miresStandards.find(a => a.id == this.miresStandard) + if(standard&&standard.code=='濮旀墭瑕佹眰'){ + this.isAskOnlyRead = false; + }else{ + this.isAskOnlyRead = true; + } + }else{ + let standard = this.mireStandards.find(a => a.id == this.mireStandard) + if(standard&&standard.code=='濮旀墭瑕佹眰'){ + this.isAskOnlyRead = false; + }else{ + this.isAskOnlyRead = true; + } + } this.currentDetectionItems = row this.detectionItems = row.productList if(this.detectionItems === null) return @@ -620,6 +655,11 @@ return 'all-disabled' } }, + setClassName0({ column }){ + if (column.type == 'selection' && this.active!=1) { + return 'all-disabled' + } + }, clearFibers(){ this.packageInfo.ismiers = false this.fibersList = [] -- Gitblit v1.9.3