| | |
| | | </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"> |
| | | border highlight-current-row @row-click="rowClick" @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"> |
| | |
| | | </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 prop="num" label="样品数量" align="center" width="90"> |
| | | </el-table-column> |
| | | <el-table-column prop="joinModel" label="配套样品型号" width="140" align="center"> |
| | | <el-table-column label="操作" width="120"> |
| | | <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> |
| | | <el-button @click.native.prevent="deleteRow(scope.$index, sampleList)" type="text" |
| | | size="small">删除</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | |
| | | </el-table-column> |
| | | </el-table> |
| | | </div> |
| | | <el-dialog title="选择子样品" :visible.sync="selectStandardTree" width="400px"> |
| | | <el-dialog title="选择子样品" :visible.sync="selectStandardTree" width="400px" @closed="addObj.sampleNum = 1"> |
| | | <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"> |
| | |
| | | <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"> |
| | | <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">要求值:</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 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> |
| | |
| | | default: () => 0 |
| | | }, |
| | | }, |
| | | data(){ |
| | | data() { |
| | | return { |
| | | saveLoad:false, |
| | | sampleList:[], |
| | | productList:[], |
| | | getProductLoad:false, |
| | | filters:[], |
| | | sampleIds:[], |
| | | saveLoad: false, |
| | | sampleList: [], |
| | | productList: [], |
| | | getProductLoad: false, |
| | | filters: [], |
| | | sampleIds: [], |
| | | isAskOnlyRead: false, |
| | | selectStandardTree: false, |
| | | search:'', |
| | | expandedKeys:[], |
| | | addObj:{ |
| | | sampleNum:1, |
| | | search: '', |
| | | expandedKeys: [], |
| | | addObj: { |
| | | sampleNum: 1, |
| | | }, |
| | | selectTree:null, |
| | | models:[], |
| | | selectTree: null, |
| | | models: [], |
| | | sample: { |
| | | sampleCode: null, |
| | | laboratory: null, |
| | |
| | | isLeave: 0, |
| | | unit: null |
| | | }, |
| | | currentMethod:null, |
| | | methods:[], |
| | | currentMethod: null, |
| | | methods: [], |
| | | methodLoad: false, |
| | | sampleId:null, |
| | | sampleId: null, |
| | | bsmRow: null, |
| | | bsm1: false, |
| | | bsm1Val:null, |
| | | bsm1Dia:false, |
| | | list:[] |
| | | bsm1Val: null, |
| | | bsm1Dia: false, |
| | | list: [], |
| | | parentSample: [] |
| | | } |
| | | }, |
| | | methods:{ |
| | | save(){}, |
| | | outConfig(){ |
| | | mounted() { |
| | | this.selectStandardTreeList() |
| | | this.selectStandardMethods() |
| | | this.$parent.sampleIds.forEach(a => { |
| | | for (var i = 0; i < this.$parent.sampleList.length; i++) { |
| | | if (this.$parent.sampleList[i].id == a) { |
| | | this.sampleList = this.$parent.sampleList[i].childSampleList |
| | | this.parentSample.push(this.$parent.sampleList[i]) |
| | | break |
| | | } |
| | | } |
| | | }) |
| | | }, |
| | | methods: { |
| | | selectStandardTreeList() { |
| | | this.$axios.get(this.$api.standardTree.selectStandardTreeList).then(res => { |
| | | this.list = res.data |
| | | this.list.forEach(a => { |
| | | this.expandedKeys.push(a.label) |
| | | }) |
| | | }) |
| | | }, |
| | | save() { |
| | | if(this.sampleList.length === 0){ |
| | | this.$message.error('缺少配置无法保存') |
| | | return |
| | | } |
| | | this.parentSample.forEach(a=>{ |
| | | a.childSampleList = this.sampleList |
| | | }) |
| | | this.$message.success('已保存') |
| | | }, |
| | | deleteRow(index, rows) { |
| | | this.productList = [] |
| | | rows.splice(index, 1); |
| | | }, |
| | | outConfig() { |
| | | this.$parent.equipConfigShow = false |
| | | }, |
| | | addChild(){ |
| | | addChild() { |
| | | this.selectStandardTree = true |
| | | }, |
| | | selectSample(val){ |
| | | selectSample(val) { |
| | | if(val === null)return |
| | | this.sampleIds = [val.id] |
| | | }, |
| | | rowClick(row, column, event){ |
| | | rowClick(row, column, event) { |
| | | this.currentMethod = row |
| | | let obj = this.methods.find(a => a.id == this.currentMethod.standardMethodListId) |
| | | if (obj && obj.code == '委托要求') { |
| | |
| | | return true |
| | | } |
| | | }, |
| | | handleChangeModel(e){ |
| | | handleChangeModel(e) { |
| | | let num = this.selectTree.split('-').length; |
| | | if (num == 4) { |
| | | this.selectTree = this.selectTree + ' - ' + e |
| | |
| | | this.selectTree = arr0.join('-') + '- ' + e |
| | | } |
| | | }, |
| | | methodChange(val, row){ |
| | | methodChange(val, row) { |
| | | if (val === null || val === '') return |
| | | this.currentMethod = row |
| | | let obj = this.methods.find(a => a.id == this.currentMethod.standardMethodListId) |
| | |
| | | methodFocus() { |
| | | this.selectsStandardMethodByFLSSM() |
| | | }, |
| | | selectsStandardMethodByFLSSM(){ |
| | | selectStandardMethods() { |
| | | this.$axios.get(this.$api.standardTree.selectStandardMethodEnum).then(res => { |
| | | this.methods = res.data |
| | | }) |
| | | }, |
| | | selectsStandardMethodByFLSSM() { |
| | | this.methodLoad = true |
| | | this.$axios.post(this.$api.standardTree.selectsStandardMethodByFLSSM, { |
| | | tree: this.selectTree |
| | |
| | | } catch (e) {} |
| | | }) |
| | | }, |
| | | selectProduct(val){ |
| | | selectProduct(val) { |
| | | this.productIds = [] |
| | | val.forEach(a => { |
| | | this.productIds.push(a.id) |
| | | }) |
| | | }, |
| | | upProductSelect(selection, row){ |
| | | 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){ |
| | | if (row.section.indexOf('[') > -1) { |
| | | this.bsmRow = this.HaveJson(row) |
| | | } |
| | | this.bsm1 = true |
| | |
| | | } |
| | | return ''; |
| | | }, |
| | | handleAll(){ |
| | | handleAll(e) { |
| | | if (e.length > 0) { |
| | | this.productList.map(m => { |
| | | m.state = 1 |
| | |
| | | return m |
| | | }) |
| | | } |
| | | this.productList.forEach(p=>{ |
| | | this.productList.forEach(p => { |
| | | if (p.bsm === '1' && p.section !== '' && p.section !== null && p.state === 1) { |
| | | if(p.section.indexOf('[') > -1){ |
| | | if (p.section.indexOf('[') > -1) { |
| | | this.bsmRow = this.HaveJson(p) |
| | | } |
| | | this.bsm1 = true |
| | |
| | | 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.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.sample.num = this.addObj.sampleNum |
| | | this.sampleList.push(this.HaveJson(this.sample)) |
| | | this.count++ |
| | | this.$refs.sampleTable.doLayout() |
| | | }, |
| | | searchFilter() { |
| | |
| | | if (!value) return true; |
| | | return data.label.indexOf(value) !== -1; |
| | | }, |
| | | handleNodeClick(val, node, el){ |
| | | handleNodeClick(val, node, el) { |
| | | this.selectTree = '' |
| | | this.models = val.children |
| | | this.getNodeParent(node) |
| | |
| | | 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 === ''){ |
| | | beforeClose(done) { |
| | | if (this.bsm1) { |
| | | if (this.bsm1Val === null || this.bsm1Val === '') { |
| | | this.$message.error('特殊项目必须处理') |
| | | return |
| | | } |
| | |
| | | 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){ |
| | | 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] |
| | |
| | | |
| | | .center { |
| | | width: 100%; |
| | | height: calc(100% - 70px); |
| | | height: calc(100% - 60px); |
| | | } |
| | | |
| | | |
| | |
| | | border-color: #dcdfe6; |
| | | cursor: not-allowed; |
| | | } |
| | | |
| | | .node_i { |
| | | color: orange; |
| | | font-size: 18px; |