From 66d0950a8238fd6d571fdf8f808fc4b7351ed404 Mon Sep 17 00:00:00 2001 From: value <z1292839451@163.com> Date: 星期五, 07 六月 2024 03:07:31 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/master' --- src/components/do/b1-ins-order/add.vue | 128 ++++++--- src/components/do/b1-ins-order/equip-config.vue | 550 +++++++++++++++++++++++++++++++++++++++ src/main.js | 4 src/components/do/b1-inspect-order-plan/Inspection.vue | 140 +++++++++ 4 files changed, 766 insertions(+), 56 deletions(-) diff --git a/src/components/do/b1-ins-order/add.vue b/src/components/do/b1-ins-order/add.vue index 6470cca..4da5604 100644 --- a/src/components/do/b1-ins-order/add.vue +++ b/src/components/do/b1-ins-order/add.vue @@ -100,7 +100,7 @@ <template> <div class="ins_order_add"> - <div v-show="!configShow"> + <div v-show="!configShow&&!equipConfigShow"> <el-row class="title"> <el-col :span="6" style="padding-left: 20px;">濮旀墭鍗曚俊鎭� 鎬讳环锛�<span style="color: #3A7BFA">锟{total}}</span></el-col> @@ -116,8 +116,10 @@ <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="openEquipConfig" + v-if="PROJECT==='瑁呭鐢电紗'">鐢电紗閰嶇疆</el-button> <el-button size="medium" type="primary" @click="openConfig" - v-if="this.addObj.sampleType==='鍏夌紗'">鍏夌氦閰嶇疆</el-button> + v-if="addObj.sampleType==='鍏夌紗'">鍏夌氦閰嶇疆</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" @@ -130,7 +132,7 @@ </el-col> </el-row> </div> - <div class="search" v-show="!configShow"> + <div class="search" v-show="!configShow&&!equipConfigShow"> <el-row> <el-col class="search_thing" :span="6"> <div class="search_label">濮旀墭缂栧彿锛�</div> @@ -298,7 +300,7 @@ </el-col> </el-row> </div> - <div v-show="!configShow"> + <div v-show="!configShow&&!equipConfigShow"> <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> @@ -482,9 +484,12 @@ </el-row> </span> </el-dialog> - <fiberOpticConfig :currentId="currentId" @saveFiberopticConfig="getTotal()" v-if="configShow" :active="active" /> - <el-dialog title="妫�娴嬪埌鐗规畩椤癸紝璇蜂綔鍑轰互涓嬮�夋嫨" :visible.sync="bsm1Dia" width="500px" :show-close="false" - :before-close="beforeClose"> + <fiberOpticConfig :currentId="currentId" + @saveFiberopticConfig="getTotal()" + v-if="configShow" :active="active" /> + <equipConfig :currentId="currentId" + v-if="equipConfigShow" :active="active"/> + <el-dialog title="妫�娴嬪埌鐗规畩椤癸紝璇蜂綔鍑轰互涓嬮�夋嫨" :visible.sync="bsm1Dia" width="500px" :show-close="false" :before-close="beforeClose"> <div class="body" style="max-height: 60vh;"> <el-row v-if="bsm1"> <el-col class="search_thing" :span="22"> @@ -528,13 +533,14 @@ </template> <script> - import { Main } from 'element-ui' -import ValueTable from '../../tool/value-table.vue' + import ValueTable from '../../tool/value-table.vue' import fiberOpticConfig from './fiberoptic-config.vue' + import equipConfig from './equip-config.vue' export default { components: { ValueTable, - fiberOpticConfig + fiberOpticConfig, + equipConfig }, props: { active: { @@ -663,6 +669,7 @@ bsm1: false, bsm1Val: null, bsm1Dia: false, + equipConfigShow: false, bsm2: false, bsm2Val: null, bsm2Dia: false, @@ -820,53 +827,61 @@ this.$message.error('璇疯緭鍏ユ牱鍝佸瀷鍙�') } else if (!this.sampleList.every(m => m.standardMethodListId)) { this.$message.error('璇烽�夋嫨妫�楠屾爣鍑�') - } else if (this.totalArr.find(a => a.ask!=null&&a.ask.includes('RTS')) && !this.RTS) { + } else if (this.totalArr.find(a => a.ask!=null&&a.ask.includes('RTS')&&a.state==1) && !this.RTS) { this.$message.error('璇疯緭鍏TS') } else { let sampleList = this.HaveJson(this.sampleList) - let isRTS = this.totalArr.find(a => a.ask!=null&&a.ask.includes('RTS')) - if (isRTS) { - sampleList.forEach(item => { - if (item.insProduct && item.insProduct.length > 0) { - item.insProduct.forEach(a => { - let ask = this.handleAsk(a.ask) - if (ask) { - a.ask = ask + let isRTS = this.totalArr.find(a=>a.ask!=null&&a.ask.includes('RTS')&&a.state==1) + if(isRTS){ + sampleList.forEach(item=>{ + if(item.insProduct&&item.insProduct.length>0){ + item.insProduct.forEach(a=>{ + if(a.state==1){ + let ask = this.handleAsk(a.ask) + if(ask&&a.state==1){ + a.ask = ask + } } }) } // 鍏夌氦甯﹂」鐩� - if (item.bushing && item.bushing.length > 0) { - item.bushing.forEach(a => { - if (a.fiber && a.fiber.length > 0) { - a.fiber.forEach(b => { - if (b.productList && b.productList.length > 0) { - b.productList.forEach(c => { - let ask = this.handleAsk(c.ask) - if (ask) { - c.ask = ask + if(item.bushing&&item.bushing.length>0){ + item.bushing.forEach(a=>{ + if(a.fiber&&a.fiber.length>0){ + a.fiber.forEach(b=>{ + if(b.productList&&b.productList.length>0){ + b.productList.forEach(c=>{ + if(c.state==1){ + let ask = this.handleAsk(c.ask) + if(ask&&c.state==1){ + c.ask = ask + } } }) } }) } - if (a.fibers && a.fibers.length > 0) { - a.fibers.forEach(b => { - if (b.productList && b.productList.length > 0) { - b.productList.forEach(c => { - let ask = this.handleAsk(c.ask) - if (ask) { - c.ask = ask + if(a.fibers&&a.fibers.length>0){ + a.fibers.forEach(b=>{ + if(b.productList&&b.productList.length>0){ + b.productList.forEach(c=>{ + if(c.state==1){ + let ask = this.handleAsk(c.ask) + if(ask&&c.state==1){ + c.ask = ask + } } }) } - if (b.fiber && b.fiber.length > 0) { - b.fiber.forEach(c => { - if (c.productList && c.productList.length > 0) { - c.productList.forEach(d => { - let ask = this.handleAsk(d.ask) - if (ask) { - d.ask = ask + if(b.fiber&&b.fiber.length>0){ + b.fiber.forEach(c=>{ + if(c.productList&&c.productList.length>0){ + c.productList.forEach(d=>{ + if(d.state==1){ + let ask = this.handleAsk(d.ask) + if(ask){ + d.ask = ask + } } }) } @@ -1498,6 +1513,35 @@ }) } }, + openEquipConfig(){ + if (this.active === 1) { + if (this.sampleIds.length === 0) { + this.$message.error("鏈�夋嫨鏍峰搧") + return + } + this.equipConfigShow = true + } else { + if (this.sampleId === null) { + this.$message.error('鏈�変腑鏍峰搧') + return + } + // this.$axios.post(this.$api.insBushing.selectBushingBySampleId, { + // sampleId: this.sampleId + // }).then(res => { + // if (res.data.length === 0) { + // this.$message.error('璇ユ牱鍝佹病鏈夐厤缃厜绾�') + // return + // } + // for (var i in this.sampleList) { + // if (this.sampleList[i].id = this.sampleId) { + // this.sampleList[i].bushing = res.data + // break + // } + // } + // this.configShow = true + // }) + } + }, upBsm1(val) { let sections = JSON.parse(this.bsmRow.section); let asks = JSON.parse(this.bsmRow.ask); diff --git a/src/components/do/b1-ins-order/equip-config.vue b/src/components/do/b1-ins-order/equip-config.vue new file mode 100644 index 0000000..2b5ed3f --- /dev/null +++ b/src/components/do/b1-ins-order/equip-config.vue @@ -0,0 +1,550 @@ +<template> + <div class="ins_order_config"> + <div> + <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="addChild" v-if="active==1">娣诲姞瀛愭牱鍝�</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> + </el-col> + </el-row> + </div> + <div class="center"> + <el-table class="el-table sampleTable" ref="sampleTable" :data="sampleList" height="50%" tooltip-effect="dark" + border highlight-current-row @row-click="rowClick" style="margin-top: 10px;" + @current-change="selectSample"> + <!-- <el-table-column type="selection" width="60" :selectable="selectable" v-if="active==1"></el-table-column> --> + <el-table-column type="index" label="搴忓彿" width="65" align="center"></el-table-column> + <el-table-column prop="sample" label="鏍峰搧鍚嶇О" align="center" min-width="100"> + <template slot-scope="scope"> + <el-input size="small" v-model="scope.row.sample" clearable :readonly="active>1"></el-input> + </template> + </el-table-column> + <el-table-column prop="sampleCode" label="鏍峰搧缂栧彿" min-width="140" align="center"> + <template slot-scope="scope"> + <el-input size="small" v-model="scope.row.sampleCode" clearable placeholder="涓嶅~鍐欏垯绯荤粺鑷姩鐢熸垚" + :readonly="active>1"></el-input> + </template> + </el-table-column> + <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%;"> + <el-option v-for="item in models" :key="item.value" :label="item.label" :value="item.value"> + </el-option> + </el-select> + </template> + </el-table-column> + <el-table-column prop="modelNum" label="鍨嬪彿鍙傛暟" width="130" align="center" v-if="!(active>1)"> + <template slot-scope="scope"> + <el-input size="small" v-model="scope.row.modelNum" clearable placeholder="闈炲繀濉�" + @keyup.enter.native="methodChange(scope.row.standardMethodListId, scope.row)" + @clear="methodChange(scope.row.standardMethodListId, scope.row)"></el-input> + </template> + </el-table-column> + <el-table-column prop="standardMethodListId" label="妫�楠屾爣鍑�" align="center" min-width="100"> + <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%;"> + <el-option v-for="item in methods" :key="item.id" :label="item.code" :value="item.id"> + </el-option> + </el-select> + </template> + </el-table-column> + <el-table-column prop="joinName" label="閰嶅鏍峰搧鍚嶇О" width="140" align="center"> + <template slot-scope="scope"> + <el-input size="small" type="textarea" :autosize="{ minRows: 1, maxRows: 1}" + v-model="scope.row.joinName" :disabled="active!=1"></el-input> + </template> + </el-table-column> + <el-table-column prop="joinModel" label="閰嶅鏍峰搧鍨嬪彿" width="140" align="center"> + <template slot-scope="scope"> + <el-input size="small" type="textarea" :autosize="{ minRows: 1, maxRows: 1}" + v-model="scope.row.joinModel" :disabled="active!=1"></el-input> + </template> + </el-table-column> + <el-table-column prop="joinNum" label="閰嶅鏍峰搧鏁伴噺" width="140" align="center"> + <template slot-scope="scope"> + <el-input-number size="small" v-model="scope.row.joinNum" :min="1" :max="100" :precision="0" + :controls="false" style="width: 80%;" :disabled="active!=1"></el-input-number> + </template> + </el-table-column> + </el-table> + <el-table class="el-table" ref="productTable" :data="productList" height="50%" tooltip-effect="dark" border + @selection-change="selectProduct" style="margin-bottom: 10px;" @select="upProductSelect" + :row-class-name="tableRowClassName" v-loading="getProductLoad" @select-all="handleAll"> + <el-table-column type="selection" width="65" :selectable="selectable" v-if="active==1"></el-table-column> + <el-table-column prop="inspectionItem" label="妫�楠岄」" min-width="140" show-overflow-tooltip></el-table-column> + <el-table-column prop="inspectionItemSubclass" label="妫�楠岄」瀛愰」" min-width="140" + show-overflow-tooltip></el-table-column> + <el-table-column prop="sonLaboratory" label="瀛愬疄楠屽" min-width="130" show-overflow-tooltip :filters="filters" + :filter-method="filterHandler"></el-table-column> + <el-table-column prop="methodS" label="璇曢獙鏂规硶" min-width="120" show-overflow-tooltip> + </el-table-column> + <el-table-column prop="unit" label="璁¢噺鍗曚綅" width="100" show-overflow-tooltip></el-table-column> + <el-table-column prop="price" label="鍗曚环" width="100" show-overflow-tooltip></el-table-column> + <el-table-column prop="section" label="鍖洪棿" min-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" + :autosize="{ minRows: 1, maxRows: 3}" @change="e=>requestChange(e,scope.row)" + v-if="active==1&&isAskOnlyRead"></el-input> + <span v-else>{{ scope.row.ask }}</span> + </template> + </el-table-column> + </el-table> + </div> + <el-dialog title="閫夋嫨瀛愭牱鍝�" :visible.sync="selectStandardTree" width="400px"> + <div class="body" style="height: 60vh;overflow-y: auto;user-select: none;" v-if="selectStandardTree"> + <el-row style="margin-bottom: 10px;"> + <el-col :span="24"> + <label>鏍峰搧鏁伴噺锛�</label> + <el-input-number v-model="addObj.sampleNum" :min="1" label="璇疯緭鍏ユ暟閲�" size="small"></el-input-number> + </el-col> + </el-row> + <el-row> + <el-col :span="24"> + <el-input placeholder="杈撳叆鍏抽敭瀛楄繘琛屾悳绱�" suffix-icon="el-icon-search" v-model="search" size="small" + style="margin-bottom: 5px;" clearable @blur="searchFilter" @clear="searchFilter" + @keyup.enter.native="searchFilter"></el-input> + </el-col> + </el-row> + <el-tree :data="list" ref="tree" :props="{ children: 'children', label: 'label' }" node-key="label" + :filter-node-method="filterNode" @node-click="handleNodeClick" highlight-current @node-expand="nodeOpen" + @node-collapse="nodeClose" :default-expanded-keys="expandedKeys" @dblclick.native="activeStandardTree"> + <div class="custom-tree-node" slot-scope="{ node, data }"> + <el-row> + <el-col :span="24"> + <span><i + :class="`node_i ${data.children != undefined ? (data.code==='[1]'?'el-icon-folder-opened':'el-icon-folder') : 'el-icon-tickets'}`"></i> + {{ data.code }} {{ data.label }}</span> + </el-col> + </el-row> + </div> + </el-tree> + </div> + <span slot="footer" class="dialog-footer"> + <el-button @click="selectStandardTree = false">鍙� 娑�</el-button> + <el-button type="primary" @click="activeStandardTree">纭� 瀹�</el-button> + </span> + </el-dialog> + <el-dialog title="妫�娴嬪埌鐗规畩椤癸紝璇蜂綔鍑轰互涓嬮�夋嫨" :visible.sync="bsm1Dia" width="500px" :show-close="false" :before-close="beforeClose"> + <div class="body" style="max-height: 60vh;"> + <el-row v-if="bsm1"> + <el-col class="search_thing" :span="22"> + <div class="search_label"><span class="required-span">* </span>鎶ゅ瀵嗗害锛�</div> + <div class="search_input"> + <el-radio-group v-model="bsm1Val" @input="upBsm1"> + <el-radio v-for="(a, ai) in JSON.parse(bsmRow.section)" :key="ai" :label="a"></el-radio> + </el-radio-group> + </div> + </el-col> + <el-col class="search_thing" :span="22"> + <div class="search_label">瑕佹眰鍊硷細</div> + <div class="search_input" v-show="bsm1Val!==null&&bsm1Val!==''"> + <el-radio-group v-model="bsm1Val" @input="upBsm1"> + <el-radio v-for="(a, ai) in JSON.parse(bsmRow.section)" :key="ai" :label="a">{{JSON.parse(bsmRow.ask)[ai]}}</el-radio> + </el-radio-group> + </div> + </el-col> + </el-row> + </div> + </el-dialog> + </div> +</template> + +<script> + export default { + props: { + active: { + type: Number, + default: () => 0 + }, + }, + data(){ + return { + saveLoad:false, + sampleList:[], + productList:[], + getProductLoad:false, + filters:[], + sampleIds:[], + isAskOnlyRead: false, + selectStandardTree: false, + search:'', + expandedKeys:[], + addObj:{ + sampleNum:1, + }, + selectTree:null, + models:[], + sample: { + sampleCode: null, + laboratory: null, + factory: null, + sampleType: null, + sample: null, + model: null, + modelNum: null, + sampleNum: 1, + isLeave: 0, + unit: null + }, + currentMethod:null, + methods:[], + methodLoad: false, + sampleId:null, + bsmRow: null, + bsm1: false, + bsm1Val:null, + bsm1Dia:false, + list:[] + } + }, + methods:{ + save(){}, + outConfig(){ + this.$parent.equipConfigShow = false + }, + addChild(){ + this.selectStandardTree = true + }, + selectSample(val){ + this.sampleIds = [val.id] + }, + 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 = [] + this.sampleIds.push(row.id) + } + this.productList = row.insProduct + setTimeout(() => { + this.productList.forEach(a => { + if (a.state == 1) this.toggleSelection(a) + }) + }, 200) + }, + toggleSelection(row) { + this.$refs.productTable.toggleRowSelection(row, true); + }, + selectable() { + if (this.active > 1) { + return false + } else { + return true + } + }, + handleChangeModel(e){ + let num = this.selectTree.split('-').length; + if (num == 4) { + this.selectTree = this.selectTree + ' - ' + e + } else { + let arr = this.selectTree.split('-') + let arr0 = arr.slice(0, arr.length - 1) + this.selectTree = arr0.join('-') + '- ' + e + } + }, + 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 + this.$axios.post(this.$api.standardTree.selectStandardProductList, { + model: row.model + '-' + row.modelNum, + standardMethodListId: val, + factory: this.selectTree, + }, { + headers: { + 'Content-Type': 'application/json' + } + }).then(res => { + res.data.forEach(a => { + a.state = 0 + }) + row.insProduct = this.HaveJson(res.data) + this.getProductLoad = false + this.productList = row.insProduct + this.$refs.sampleTable.setCurrentRow(row) + setTimeout(() => { + this.productList.forEach(a => { + if (a.state == 1) this.toggleSelection(a) + }) + }, 200) + }) + }, + methodFocus() { + this.selectsStandardMethodByFLSSM() + }, + selectsStandardMethodByFLSSM(){ + this.methodLoad = true + this.$axios.post(this.$api.standardTree.selectsStandardMethodByFLSSM, { + tree: this.selectTree + }).then(res => { + this.methodLoad = false + try { + if (res.data.standardMethodList.length == 0 && this.selectTree.split('-').length == 5) { + let arr = this.selectTree.split('-') + let arr0 = arr.slice(0, arr.length - 1) + let selectTree = arr0.join('-').substring(0, arr0.join('-').length - 1) + this.$axios.post(this.$api.standardTree.selectsStandardMethodByFLSSM, { + tree: selectTree + }).then(ress => { + this.methods = ress.data.standardMethodList + }) + } else { + this.methods = res.data.standardMethodList + } + } catch (e) {} + }) + }, + selectProduct(val){ + this.productIds = [] + val.forEach(a => { + this.productIds.push(a.id) + }) + }, + upProductSelect(selection, row){ + row.state = row.state == 1 ? 0 : 1 + if (row.bsm === '1' && row.section !== '' && row.section !== null && row.state === 1) { + if(row.section.indexOf('[') > -1){ + this.bsmRow = this.HaveJson(row) + } + this.bsm1 = true + this.bsm1Dia = true + } else if (row.bsm === '1' && row.section !== '' && row.section !== null && row.state === 0) { + this.bsm1 = false + } + this.sampleList.map(item => { + if (this.sampleIds.indexOf(item.id) > -1) { + item.insProduct.map(m => { + if (m.id == row.id) { + m.state = row.state; + } + return m; + }) + } + return item + }) + }, + tableRowClassName({ + row, + rowIndex + }) { + if (row.state === 0) { + return 'warning-row'; + } + return ''; + }, + handleAll(){ + if (e.length > 0) { + this.productList.map(m => { + m.state = 1 + return m + }) + } else { + this.productList.map(m => { + m.state = 0 + return m + }) + } + this.productList.forEach(p=>{ + if (p.bsm === '1' && p.section !== '' && p.section !== null && p.state === 1) { + if(p.section.indexOf('[') > -1){ + this.bsmRow = this.HaveJson(p) + } + this.bsm1 = true + this.bsm1Dia = true + } else if (p.bsm === '1' && p.section !== '' && p.section !== null && p.state === 0) { + this.bsm1 = false + } + }) + if (e.length > 0) { + this.sampleList.map(item => { + if (this.sampleIds.indexOf(item.id) > -1) { + item.insProduct.map(m => { + m.state = 1 + return m; + }) + } + return item + }) + } else { + this.sampleList.map(item => { + if (this.sampleIds.indexOf(item.id) > -1) { + item.insProduct.map(m => { + m.state = 0 + return m; + }) + } + return item + }) + } + this.$nextTick(() => { + this.$refs.productTable.doLayout() + }) + }, + filterHandler(value, row, column) { + const property = column['property']; + return row[property] === value; + }, + requestChange(e, row) { + this.sampleList.map(item => { + if (this.sampleIds.indexOf(item.id) > -1) { + item.insProduct.map(m => { + if (m.id == row.id) { + m.ask = e; + } + return m; + }) + } + return item + }) + }, + activeStandardTree() { + let trees = this.selectTree.split(" - ") + if (trees.length < 4) { + this.$message.error('鏈�夋嫨瀛愪骇鍝�') + return + } + this.addObj.factory = trees[0] + this.addObj.laboratory = trees[1] + this.addObj.sampleType = trees[2] + this.addObj.sample = trees[3] + this.addObj.model = (trees[4] == undefined ? null : trees[4]) + this.selectStandardTree = false + this.sampleList = [] + for (var i = 0; i < this.addObj.sampleNum; i++) { + this.sample.joinName = null + this.sample.joinModel = null + this.sample.joinNum = 1 + this.sample.sample = this.addObj.sample + this.sample.model = this.addObj.model + this.sample.unit = this.addObj.unit + this.sample.standardMethodListId = null + this.sample.insProduct = [] + this.sample.id = this.count + this.sampleList.push(this.HaveJson(this.sample)) + this.count++ + } + this.$refs.sampleTable.doLayout() + }, + searchFilter() { + this.$refs.tree.filter(this.search) + }, + filterNode(value, data) { + if (!value) return true; + return data.label.indexOf(value) !== -1; + }, + handleNodeClick(val, node, el){ + this.selectTree = '' + this.models = val.children + this.getNodeParent(node) + this.selectTree = this.selectTree.replace(' - ', '') + let data = this.selectTree.split(' - ') + let data2 = '' + for (let index = data.length - 1; index >= 0; index--) { + data2 += " - " + data[index] + } + this.selectTree = data2.replace(' - ', '') + }, + getNodeParent(val) { + if (val.parent != null) { + this.selectTree += ' - ' + val.label + this.getNodeParent(val.parent) + } + }, + nodeOpen(data, node, el) { + $($(el.$el).find('.node_i')[0]).attr('class', 'node_i el-icon-folder-opened') + }, + nodeClose(data, node, el) { + $($(el.$el).find('.node_i')[0]).attr('class', 'node_i el-icon-folder') + }, + beforeClose(done){ + if(this.bsm1){ + if(this.bsm1Val===null || this.bsm1Val === ''){ + this.$message.error('鐗规畩椤圭洰蹇呴』澶勭悊') + return + } + } + done() + }, + upBsm1(val) { + let sections = JSON.parse(this.bsmRow.section); + let asks = JSON.parse(this.bsmRow.ask); + let tells = JSON.parse(this.bsmRow.tell); + let manHours = JSON.parse(this.bsmRow.manHour); + let prices = JSON.parse(this.bsmRow.price); + for (var a in sections) { + if(val === sections[a]){ + this.productList.forEach(p=>{ + if(p.id === this.bsmRow.id){ + p.section = sections[a] + p.ask = asks[a] + p.tell = tells[a] + p.manHour = manHours[a] + p.price = prices[a] + } + }) + break + } + } + }, + } + } +</script> +<style scoped> + .ins_order_config { + width: 100%; + height: 100%; + overflow-y: auto; + overflow-x: hidden; + } + + .ins_order_config::-webkit-scrollbar { + width: 0; + } + + .title { + height: 60px; + line-height: 60px; + } + + .center { + width: 100%; + height: calc(100% - 70px); + } + + + >>>.all-disabled .el-checkbox__input .el-checkbox__inner { + background-color: #edf2fc; + border-color: #dcdfe6; + cursor: not-allowed; + } + .node_i { + color: orange; + font-size: 18px; + } + + .el-select-dropdown__item { + display: flex; + align-items: center; + justify-content: space-between; + } +</style> diff --git a/src/components/do/b1-inspect-order-plan/Inspection.vue b/src/components/do/b1-inspect-order-plan/Inspection.vue index 827a5b0..f58373c 100644 --- a/src/components/do/b1-inspect-order-plan/Inspection.vue +++ b/src/components/do/b1-inspect-order-plan/Inspection.vue @@ -191,7 +191,11 @@ <template> <div v-loading="loading" class="inspection"> <el-row class="title"> - <el-col :span="12" style="padding-left: 20px;">妫�楠屽崟璇︽儏</el-col> + <el-col :span="12" style="padding-left: 20px;">妫�楠屽崟璇︽儏 + <span style="color: #3A7BFA;"> 鏍峰搧</span> + <span v-if="currentFiberOpticTape" style="color: #3A7BFA;"> - 鍏夌氦甯�</span> + <span v-if="currentFiberOptic" style="color: #3A7BFA;"> - 鍏夌氦</span> + </el-col> <el-col :span="12" style="text-align: right;"> <el-button size="small" type="primary" @click="fiberOpticVisible=true" v-if="fiberOptic.length>0">鍏夌氦鍒囨崲</el-button> <el-button size="small" type="primary" @click="fiberOpticTapeVisible=true" v-if="fiberOpticTape.length>0">鍏夌氦甯﹀垏鎹�</el-button> @@ -251,7 +255,7 @@ :rowspan="n.v.mc&&n.v.mc.rs?n.v.mc.rs:1" :style="`background:${n.v.bg};color:${n.v.fc};font-size:${n.v.fs}px;width:${handleWidth(n)}px !important;height:${item.style.rowlen[n.r]}px;font-wight:${n.v.bl?'bold':''};`"> <div class="content" :class="`content-h-${n.v.ht} content-v-${n.v.vt}`" - :style="`width:${handleWidth(n)}px !important;min-height:${item.style.rowlen[n.r]}px;`"> + :style="`width:${handleWidth(n)}px !important;min-height:${item.style.rowlen[n.r]}px;background:${n.v.bg};`"> <template v-if="n.v.ps!=undefined && n.v.ps.value==='妫�楠屽��' && state==1"> <el-input v-if="getInspectionValueType(n.i) == 1" class="table_input" v-model="n.v.v" :disabled="getInspectionItemType(n.i) == 1 || (n.u != userId && n.u != undefined && n.u != '')" @@ -305,13 +309,41 @@ </template> <template v-else-if="n.v.ps!=undefined && n.v.ps.value==='鏍峰搧缂栧彿'"> <div style="display: flex;flex-wrap: nowrap;align-items: center;width: 100%" :title="currentSample.sampleCode"> - <i class="el-icon-caret-left table_caret" style="width: 16px;" @click="caretSample(-1)"></i> + <i class="el-icon-caret-left table_caret" style="width: 16px;" @click="caretSample(-1)" v-if="!currentFiberOpticTape&&!currentFiberOptic"></i> <div :style="`font-family:${n.v.ff} !important;overflow: hidden;white-space: nowrap;width: calc(100% - 32px);`">{{currentSample.sampleCode}}</div> - <i class="el-icon-caret-right table_caret" style="width: 16px;" @click="caretSample(1)"></i> + <i class="el-icon-caret-right table_caret" style="width: 16px;" + v-if="!currentFiberOpticTape&&!currentFiberOptic"@click="caretSample(1)"></i> </div> </template> <template v-else-if="n.v.ps!=undefined && n.v.ps.value==='鏍峰搧鍨嬪彿'"> <div :style="`font-family:${n.v.ff} !important;`" v-if="currentSample.model!==undefined&¤tSample.model!==null">{{currentSample.model}}</div> + </template> + <template v-else-if="n.v.ps!=undefined && n.v.ps.value==='濂楃'"> + <div style="display: flex;flex-wrap: nowrap;align-items: center;"> + <!-- <i class="el-icon-caret-left table_caret" @click="caretBushing(-1)"></i> --> + <div :style="`font-family:${n.v.ff} !important;`">{{currentBushing?currentBushing.color:''}}</div> + <!-- <i class="el-icon-caret-right table_caret" @click="caretBushing(1)"></i> --> + </div> + </template> + <template v-else-if="n.v.ps!=undefined && n.v.ps.value==='鍏夌氦甯�'"> + <div style="display: flex;flex-wrap: nowrap;align-items: center;"> + <i class="el-icon-caret-left table_caret" @click="caretTape(-1) + " v-if="currentFiberOpticTape"></i> + <div :style="`font-family:${n.v.ff} !important;`">{{currentFiberOpticTape?currentFiberOpticTape.code:''}}</div> + <i class="el-icon-caret-right table_caret" + v-if="currentFiberOpticTape" + @click="caretTape(1)"></i> + </div> + </template> + <template v-else-if="n.v.ps!=undefined && n.v.ps.value==='鍏夌氦'"> + <div style="display: flex;flex-wrap: nowrap;align-items: center;"> + <i class="el-icon-caret-left table_caret" @click="caretOptic(-1)" + v-if="currentFiberOptic"></i> + <div :style="`font-family:${n.v.ff} !important;`">{{currentFiberOptic?currentFiberOptic.color:''}} + </div> + <i + v-if="currentFiberOptic" class="el-icon-caret-right table_caret" @click="caretOptic(1)"></i> + </div> </template> <span v-else :style="`font-family:${n.v.ff} !important;`">{{n.v.v}}</span> </div> @@ -328,7 +360,7 @@ :on-success="handleSuccessUp" :show-file-list="false" accept='.jpg,.jpeg,.png,.gif,.doc,.docx,.xls,.xlsx,.ppt,.pptx,.pdf,.zip,.rar' :headers="headers" :on-change="beforeUpload" :on-error="onError" ref='upload'> - <el-button size="small" type="primary" :loading="upLoading">闄勪欢涓婁紶</el-button></el-upload> + <el-button size="small" type="primary">闄勪欢涓婁紶</el-button></el-upload> <ValueTable class="value-table" ref="fileList" :url="$api.insOrderPlan.getFileList" :componentData="componentData0" :delUrl="$api.insOrderPlan.delfile" @@ -337,7 +369,7 @@ <el-drawer title="鍏夌氦鍒囨崲" :visible.sync="fiberOpticVisible" :size="500"> <el-table class="el-table" ref="fiberOpticTable" :data="fiberOptic" height="100%" tooltip-effect="dark" border highlight-current-row @row-click="handleChangeOptic" :row-class-name="tableRowClassName" - :current-row-key="currentKey" :row-key="record=>record.index" v-if="fiberOpticVisible"> + :current-row-key="currentKey2" :row-key="record=>record.index" v-if="fiberOpticVisible"> <el-table-column type="index" align="center" label="搴忓彿" width="70px" :key="Math.random()"> </el-table-column> <el-table-column prop="bushColor" label="绠″鑹叉爣" min-width="100px" show-overflow-tooltip></el-table-column> @@ -350,7 +382,7 @@ <el-drawer title="鍏夌氦甯﹀垏鎹�" :visible.sync="fiberOpticTapeVisible" :size="500"> <el-table class="el-table" ref="fiberOpticTapeTable" :data="fiberOpticTape" height="100%" tooltip-effect="dark" border highlight-current-row @row-click="handleChangeTape" :row-class-name="tableRowClassName" - :current-row-key="currentKey" :row-key="record=>record.index" v-if="fiberOpticTapeVisible"> + :current-row-key="currentKey1" :row-key="record=>record.index" v-if="fiberOpticTapeVisible"> <el-table-column type="index" align="center" label="搴忓彿" width="70px" :key="Math.random()"> </el-table-column> <el-table-column prop="code" label="鍏夌氦甯︾紪鍙�" min-width="110px" show-overflow-tooltip></el-table-column> @@ -363,7 +395,7 @@ <el-drawer title="濂楃鍒囨崲" :visible.sync="bushingVisible" :size="500"> <el-table class="el-table" ref="bushingTable" :data="bushing" height="100%" tooltip-effect="dark" border highlight-current-row @row-click="handleChangeBushing" :row-class-name="tableRowClassName" - :current-row-key="currentKey" :row-key="record=>record.index" v-if="bushingVisible"> + :current-row-key="currentKey0" :row-key="record=>record.index" v-if="bushingVisible"> <el-table-column type="index" align="center" label="搴忓彿" width="70px" :key="Math.random()"> </el-table-column> <el-table-column prop="color" label="绠¤壊鏍�" min-width="100px" show-overflow-tooltip></el-table-column> @@ -484,7 +516,6 @@ isIndex: true, showSelect: false, select: false, - selectMethod: '', sort: false, init:false, do: [ @@ -535,6 +566,9 @@ ps: {}, param: {}, currentKey: 1, + currentKey0: 1, + currentKey1: 1, + currentKey2: 1, comparisonList: [], excelMethodList: [], equipOptions: [], @@ -667,6 +701,7 @@ this.fiberOpticTape = row.fibers; } this.bushingVisible = false; + this.currentKey0 = row.index }, async handleChangeOptic(row, column, event){ this.currentFiberOptic = row; @@ -683,7 +718,7 @@ this.fiberOpticVisible = false; let list = await this.getCurrentProduct(row.id,2) this.getTableLists0(list) - this.currentKey = row.index + this.currentKey2 = row.index }, async handleChangeTape(row, column, event){ this.currentFiberOpticTape = row; @@ -707,7 +742,7 @@ // 閰嶇疆鍏夌氦 this.fiberOptic = row.fiber; } - this.currentKey = row.index + this.currentKey1 = row.index }, async handleChangeSample(row, column, event) { this.param = {} @@ -1637,6 +1672,85 @@ }) this.getTableLists() }, + caretBushing(num){ + let index = this.currentKey0 + num + if(index < 1){ + this.$message.error('褰撳墠鏄涓�涓绠�') + return + } else if(index > this.bushing.length){ + this.$message.error('褰撳墠鏄渶鍚庝竴涓绠�') + return + } + this.currentKey0 = index + this.currentBushing = this.HaveJson(this.bushing[index - 1]) + this.fiberOpticTape = [] + this.currentFiberOpticTape = null; + this.fiberOptic = [] + this.currentFiberOptic = null; + if( this.currentBushing.fiber&& this.currentBushing.fiber.length>0){ + // 鐩存帴閰嶇疆鍏夌氦 + this.fiberOptic = this.currentBushing.fiber; + }else if( this.currentBushing.fibers&& this.currentBushing.fibers.length>0){ + // 閰嶇疆鍏夌氦甯﹀悗锛屽啀閰嶇疆鍏夌氦 + this.fiberOpticTape = this.currentBushing.fibers; + } + }, + async caretTape(num){ + let index = this.currentKey1 + num + if(index < 1){ + this.$message.error('褰撳墠鏄涓�涓厜绾ゅ甫') + return + } else if(index > this.fiberOpticTape.length){ + this.$message.error('褰撳墠鏄渶鍚庝竴涓厜绾ゅ甫') + return + } + this.currentKey1 = index + this.currentFiberOpticTape = this.HaveJson(this.fiberOpticTape[index - 1]) + this.param = {} + this.fiberOptic = [] + this.currentFiberOptic = null; + this.currentFiberOpticTape.productList.forEach(a => { + this.param[a.id] = { + insValue: [], + comValue: [], + resValue: null, + equipValue: [], + equipName: [], + insResult: null + } + }) + this.fiberOpticTapeVisible = false; + let list = await this.getCurrentProduct(this.currentFiberOpticTape.id,1) + this.getTableLists0(list) + if(this.currentFiberOpticTape.fiber&&this.currentFiberOpticTape.fiber.length>0){ + // 閰嶇疆鍏夌氦 + this.fiberOptic = this.currentFiberOpticTape.fiber; + } + }, + async caretOptic(num){ + let index = this.currentKey2 + num + if(index < 1){ + this.$message.error('褰撳墠鏄涓�涓厜绾�') + return + } else if(index > this.fiberOptic.length){ + this.$message.error('褰撳墠鏄渶鍚庝竴涓厜绾�') + return + } + this.currentKey2 = index + this.currentFiberOptic = this.HaveJson(this.fiberOptic[index - 1]) + this.currentFiberOptic.productList.forEach(a => { + this.param[a.id] = { + insValue: [], + comValue: [], + resValue: null, + equipValue: [], + equipName: [], + insResult: null + } + }) + let list = await this.getCurrentProduct(this.currentFiberOptic.id,2) + this.getTableLists0(list) + }, handleSuccessUp(response, ) { this.upLoading = false; if (response.code == 200) { @@ -1665,10 +1779,10 @@ if (res.code === 200) { let url = ''; if(res.data.type==1){ - url = this.javaApi+'/img/'+res.data.url + url = this.javaApi+'/img/'+res.data.fileUrl file.downloadIamge(url,row.fileName) }else{ - url = this.javaApi+'/word/'+res.data.url + url = this.javaApi+'/word/'+res.data.fileUrl const link = document.createElement('a'); link.href = url; link.download = row.fileName; diff --git a/src/main.js b/src/main.js index 18e552a..518112d 100644 --- a/src/main.js +++ b/src/main.js @@ -11,10 +11,12 @@ import api from './assets/api/controller.js' import swal from 'sweetalert' +// 椤圭洰鍒囨崲 +Vue.prototype.PROJECT = '妫�娴嬩腑蹇�' //椤圭洰鍚嶇О锛氭娴嬩腑蹇冦�佽澶囩數缂� //鏈湴 Vue.prototype.LOCATIONVUE = "http://127.0.0.1:80"; const javaApi = 'http://192.168.11.200:8001';//鏉� -// const javaApi = 'http://192.168.11.249:8001';//寮� +// const javaApi = 'http://192.168.144.249:8001';//寮� // const javaApi = 'http://172.20.10.3:8001';//濮� // const javaApi = 'http://192.168.11.2:8001';//鏌� // const javaApi = 'http://127.0.0.1:8001';//鏅� -- Gitblit v1.9.3