| | |
| | | color: #bababa; |
| | | } |
| | | |
| | | .el-select .is-disabled { |
| | | .ins_order_add .el-select .is-disabled { |
| | | background: transparent !important; |
| | | } |
| | | |
| | | .el-select .is-disabled .el-input__inner { |
| | | .ins_order_add .el-select .is-disabled .el-input__inner { |
| | | background: transparent !important; |
| | | } |
| | | </style> |
| | | |
| | | <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;"> |
| | |
| | | <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" |
| | |
| | | </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> |
| | |
| | | <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"> |
| | |
| | | <el-radio :label="0">委托单位取回</el-radio> |
| | | <el-radio :label="1">实验室处理</el-radio> |
| | | </el-radio-group> |
| | | </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"> |
| | |
| | | </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> |
| | |
| | | <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"> |
| | | 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"> |
| | | @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="unit" label="单位" align="center" min-width="100"> |
| | | <!-- <el-table-column prop="unit" label="单位" align="center" min-width="100"> |
| | | <template slot-scope="scope"> |
| | | <el-select v-model="scope.row.unit" clearable size="small" style="width: 100%;" :disabled="active>1"> |
| | | <el-option v-for="(a, i) in units" :key="i" :label="a.label" :value="a.value"></el-option> |
| | | </el-select> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table-column> --> |
| | | <!-- <el-table-column prop="isLeave" label="是否留样" align="center" min-width="100"> |
| | | <template slot-scope="scope"> |
| | | <el-select v-model="scope.row.isLeave" size="small" :disabled="active>1"> |
| | |
| | | <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="manDay" label="预计时间(天)" width="120" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="manHourGroup" label="工时分组" width="100" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="manHour" label="工时系数" width="100" show-overflow-tooltip></el-table-column> |
| | | <!-- <el-table-column prop="deviceGroup" label="设备组" width="120" show-overflow-tooltip></el-table-column> --> |
| | | <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" |
| | | :autosize="{ minRows: 1, maxRows: 3}" @change="e=>requestChange(e,scope.row)" :readonly="active>1"></el-input> |
| | | :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> |
| | |
| | | <el-row> |
| | | <el-col :span="24"> |
| | | <span><i |
| | | :class="`node_i ${data.children != undefined ? 'el-icon-folder-opened' : 'el-icon-tickets'}`"></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> |
| | |
| | | </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: { |
| | |
| | | isLeave: 0, |
| | | orderType: null, |
| | | send: 1, |
| | | formType: '送检' |
| | | formType: '送检', |
| | | engineering: null, |
| | | engineeringEn: null, |
| | | production: null, |
| | | productionEn: null, |
| | | companyId: null |
| | | }, |
| | | sample: { |
| | | sampleCode: null, |
| | |
| | | sampleType: null, |
| | | sample: null, |
| | | model: null, |
| | | modelNum: null, |
| | | sampleNum: 1, |
| | | isLeave: 0, |
| | | unit: null |
| | |
| | | tell: '', |
| | | noLoading: false, |
| | | orderType: [], |
| | | filters: [] |
| | | filters: [], |
| | | formType: [], |
| | | configShow: false, |
| | | currentMethod: null, |
| | | isAskOnlyRead:false |
| | | } |
| | | }, |
| | | watch: { |
| | |
| | | this.selectStandardMethods() |
| | | this.selectEnumByCategoryForOrderType() |
| | | this.selectEnumByCategoryForSonLaboratory() |
| | | this.selectEnumByCategoryForSampleForm() |
| | | if (this.active != 1) { |
| | | // 查看/审核流程 |
| | | // 请求接口,回显数据 |
| | |
| | | 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]) |
| | | } |
| | | }) |
| | | }) |
| | | } |
| | |
| | | this.$message.error('未选择数据') |
| | | return |
| | | } |
| | | delete selects['orderBy'] |
| | | delete selects['updateUser'] |
| | | delete selects['updateTime'] |
| | | this.addObj.userId = selects.id |
| | | this.addObj.company = selects.company |
| | | this.addObj.custom = selects.name |
| | | this.addObj.code = selects.code |
| | | this.addObj.phone = selects.phone |
| | | this.addObj.companyId = selects.id |
| | | this.selectUserDia = false |
| | | }, |
| | | save() { |
| | | if (!this.addObj.custom) { |
| | | this.$message.error('未选择下单客户') |
| | | if (!this.addObj.companyId) { |
| | | this.$message.error('未选择客户单位') |
| | | return |
| | | } |
| | | if (!this.addObj.type) { |
| | |
| | | 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('请输入工程名称EN') |
| | | }else if (!this.addObj.production) { |
| | | this.$message.error('请输入生产单位') |
| | | }else if (!this.addObj.productionEn) { |
| | | this.$message.error('请输入生产单位EN') |
| | | } else if (this.sampleList.length < 1) { |
| | | this.$message.error('请添加一个样品') |
| | | } else if (!this.sampleList.every(m => m.sample)) { |
| | |
| | | this.$message.error('请输入样品型号') |
| | | } else if (!this.sampleList.every(m => m.standardMethodListId)) { |
| | | this.$message.error('请选择检验标准') |
| | | } else if (!this.sampleList.every(m => m.unit)) { |
| | | this.$message.error('请输入样品的单位') |
| | | } else { |
| | | this.saveLoad = true |
| | | this.$axios.post(this.$api.insOrder.addInsOrder, { |
| | | insOrder: this.addObj, |
| | | list: JSON.stringify(this.sampleList) |
| | | list: JSON.stringify(this.sampleList.map(a=>{ |
| | | a.model = a.model + ((a.modelNum==null||a.modelNum==''||a.modelNum=='null')?'':('-'+a.modelNum)) |
| | | return a |
| | | })) |
| | | }, { |
| | | headers: { |
| | | 'Content-Type': 'application/json' |
| | |
| | | this.$axios.get(this.$api.standardTree.selectStandardTreeList).then(res => { |
| | | this.list = res.data |
| | | this.list.forEach(a => { |
| | | a.children.forEach(b => { |
| | | this.expandedKeys.push(b.label) |
| | | }) |
| | | this.expandedKeys.push(a.label) |
| | | }) |
| | | }) |
| | | }, |
| | |
| | | activeStandardTree() { |
| | | let trees = this.selectTree.split(" - ") |
| | | if (trees.length < 4) { |
| | | this.$message.error('未选择样品') |
| | | this.$message.error('未选择产品') |
| | | return |
| | | } |
| | | this.addObj.factory = trees[0] |
| | |
| | | }) |
| | | }, |
| | | 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.productList = row.insProduct |
| | | setTimeout(() => { |
| | | this.productList.forEach(a => { |
| | |
| | | } |
| | | }) |
| | | }, |
| | | 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.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: this.addObj.model, |
| | | standardMethodListId: val |
| | | model: row.model + '-' + row.modelNum, |
| | | standardMethodListId: val, |
| | | factory: this.selectTree, |
| | | }, { |
| | | headers: { |
| | | 'Content-Type': 'application/json' |
| | |
| | | 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 |
| | | } |
| | | } |
| | | } |