| | |
| | | <!-- </el-col> --> |
| | | </el-row> |
| | | <el-row class="standard_table" v-loading="tableLoad"> |
| | | <el-table class="el-table" :data="standardList" style="width: 100%;" height="220px" tooltip-effect="dark" |
| | | <el-table class="el-table" :data="standardList" style="width: 100%;height: 220px !important;overflow-y: auto;" tooltip-effect="dark" |
| | | highlight-current-row @row-click="rowClick" ref="standard"> |
| | | <el-table-column prop="code" label="标准编号" show-overflow-tooltip> |
| | | <el-table-column prop="code" label="标准编号" show-overflow-tooltip width="180"> |
| | | <template slot-scope="scope"> |
| | | <span style="color: red;font-size: 14px;">{{scope.row['code']}}</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="name" label="标准名称" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="remark" label="备注" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="createUserName" label="创建人"></el-table-column> |
| | | <el-table-column prop="createTime" label="创建时间" width="250px"></el-table-column> |
| | | <!-- <el-table-column prop="createUserName" label="创建人"></el-table-column> |
| | | <el-table-column prop="createTime" label="创建时间" width="250px"></el-table-column> --> |
| | | <!-- <el-table-column label="操作" width="100" align="center" v-if="delStandardMethod"> |
| | | <template slot-scope="scope"> |
| | | <el-button type="text" size="small" @click="delStandardMethodByFLSSM(scope.row.id)">删除</el-button> |
| | |
| | | <el-row class="product_table" v-loading="tableLoad2"> |
| | | <el-table :data="productList" ref="productTable" style="width: 100%;" height="100%" tooltip-effect="dark" stripe |
| | | :fit="true" border @selection-change="handleSelectionChange" :row-class-name="tableRowClassName" |
| | | @select="upProductSelect"> |
| | | @select="upProductSelect" @select-all="handleAll"> |
| | | <el-table-column type="selection" width="65"> |
| | | </el-table-column> |
| | | <el-table-column prop="inspectionItem" label="检验项" min-width="140" show-overflow-tooltip></el-table-column> |
| | |
| | | <el-table-column prop="price" label="单价(元)" width="90" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="manHour" label="工时(H)" width="90" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="manHourGroup" 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> |
| | | </el-row> |
| | |
| | | <el-dialog title="分类添加" :visible.sync="addDia" width="400px"> |
| | | <div class="body"> |
| | | <el-row style="line-height: 50px;"> |
| | | <el-col :span="6" style="text-align: right;"> |
| | | <span class="required-span">* </span>工厂: |
| | | </el-col> |
| | | <el-col :span="6" style="text-align: right;">工厂:</el-col> |
| | | <el-col :span="16" :offset="1"> |
| | | <el-select v-model="addOb.factory" size="small" style="width: 100%;" clearable> |
| | | <el-option v-for="(a, ai) in factory" :key="ai" :value="a.value" :label="a.label"></el-option> |
| | | </el-select> |
| | | <el-input size="small" readonly v-model="addOb.factory"></el-input> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row style="line-height: 50px;"> |
| | | <el-col :span="6" style="text-align: right;">实验室:</el-col> |
| | | <el-col :span="16" :offset="1"> |
| | | <el-input size="small" readonly v-model="addOb.laboratory"></el-input> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row style="line-height: 50px;"> |
| | | <el-col :span="6" style="text-align: right;">样品大类:</el-col> |
| | | <el-col :span="16" :offset="1"> |
| | | <el-input size="small" readonly v-model="addOb.sampleType"></el-input> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row style="line-height: 50px;"> |
| | | <el-col :span="6" style="text-align: right;">样品名称:</el-col> |
| | | <el-col :span="16" :offset="1"> |
| | | <el-input v-model="addOb.sample" readonly size="small"></el-input> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row style="line-height: 50px;"> |
| | | <el-col :span="6" style="text-align: right;"> |
| | | <span class="required-span">* </span>实验室: |
| | | </el-col> |
| | | <el-col :span="16" :offset="1"> |
| | | <el-select v-model="addOb.laboratory" size="small" style="width: 100%;" clearable> |
| | | <el-option v-for="(a, ai) in laboratory" :key="ai" :value="a.value" :label="a.label"></el-option> |
| | | </el-select> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row style="line-height: 50px;"> |
| | | <el-col :span="6" style="text-align: right;"> |
| | | <span class="required-span">* </span>样品大类: |
| | | </el-col> |
| | | <el-col :span="16" :offset="1"> |
| | | <el-select v-model="addOb.sampleType" size="small" style="width: 100%;" clearable> |
| | | <el-option v-for="(a, ai) in sampleType" :key="ai" :value="a.value" :label="a.label"></el-option> |
| | | </el-select> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row style="line-height: 50px;"> |
| | | <el-col :span="6" style="text-align: right;"> |
| | | <span class="required-span">* </span>样品名称: |
| | | </el-col> |
| | | <el-col :span="16" :offset="1"> |
| | | <el-input v-model="addOb.sample" placeholder="请输入样品名称" clearable size="small"></el-input> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row style="line-height: 50px;"> |
| | | <el-col :span="6" style="text-align: right;"> |
| | | 型号: |
| | | <span class="required-span">* </span>型号: |
| | | </el-col> |
| | | <el-col :span="16" :offset="1"> |
| | | <el-input v-model="addOb.model" placeholder="请输入型号" clearable size="small"></el-input> |
| | |
| | | this.$confirm("是否删除该层级", "提示", { |
| | | type: "error" |
| | | }).then(() => { |
| | | this.treeLoad = true |
| | | // this.treeLoad = true |
| | | this.selectTree = '' |
| | | this.getNodeParent(node) |
| | | this.selectTree = this.selectTree.replace(' - ', '') |
| | |
| | | }).then(res => { |
| | | if (res.code == 201) return |
| | | this.$message.success('已删除') |
| | | this.selectStandardTreeList() |
| | | let arr = this.selectTree.split(' - '); |
| | | this.deleteStandard(this.list, arr[arr.length - 1]) |
| | | // this.selectStandardTreeList() |
| | | this.selectTree = '' |
| | | this.standardList = [] |
| | | this.productList = [] |
| | | }) |
| | | }).catch(e => {}) |
| | | }, |
| | | deleteStandard(arr, label) { |
| | | arr.forEach((item, index) => { |
| | | if(item.label == label){ |
| | | arr.splice(index, 1); |
| | | }else{ |
| | | item.children&&this.deleteStandard(item.children, label); |
| | | } |
| | | }) |
| | | }, |
| | | nodeOpen(data, node, el) { |
| | | $($(el.$el).find('.node_i')[0]).attr('class', 'node_i el-icon-folder-opened') |
| | |
| | | this.$axios.get(this.$api.standardTree.selectStandardTreeList).then(res => { |
| | | this.list = res.data |
| | | this.list.forEach(a => { |
| | | a.children.forEach(b => { |
| | | b.children.forEach(c => { |
| | | this.expandedKeys.push(c.label) |
| | | }) |
| | | // this.expandedKeys.push(b.label) |
| | | }) |
| | | this.expandedKeys.push(a.label) |
| | | }) |
| | | this.treeLoad = false |
| | | }) |
| | |
| | | }) |
| | | }, |
| | | addStandardTree() { |
| | | if (this.addOb.factory == null || this.addOb.factory == '') { |
| | | this.$message.error('工厂是必填项') |
| | | return |
| | | } |
| | | if (this.addOb.laboratory == null || this.addOb.laboratory == '') { |
| | | this.$message.error('实验室是必填项') |
| | | return |
| | | } |
| | | if (this.addOb.sampleType == null || this.addOb.sampleType == '') { |
| | | this.$message.error('样品大类是必填项') |
| | | return |
| | | } |
| | | if (this.addOb.sample == null || this.addOb.sample == '') { |
| | | this.$message.error('样品是必填项') |
| | | this.$message.error('产品不存在') |
| | | return |
| | | } |
| | | if (this.addOb.model == null || this.addOb.model == '') { |
| | | this.$message.error('请填写型号') |
| | | return |
| | | } |
| | | this.addLoad = true |
| | |
| | | } |
| | | this.$message.success('添加成功') |
| | | this.addDia = false |
| | | this.selectStandardTreeList() |
| | | this.list |
| | | .find(a => a.label == this.addOb.factory).children |
| | | .find(a => a.label == this.addOb.laboratory).children |
| | | .find(a => a.label == this.addOb.sampleType).children |
| | | .find(a => a.label == this.addOb.sample).children.push({ |
| | | code:'[5]', |
| | | label: this.addOb.model, |
| | | value: this.addOb.model, |
| | | }) |
| | | this.addLoad = false |
| | | }).catch(e => { |
| | | this.addDia = false |
| | |
| | | rowClick(row, column, event) { |
| | | this.tableLoad2 = true |
| | | this.$axios.post(this.$api.standardTree.selectStandardProductListByMethodId, { |
| | | id: row.id |
| | | id: row.id, |
| | | tree: this.selectTree |
| | | }).then(res => { |
| | | this.productList = res.data |
| | | setTimeout(() => { |
| | |
| | | this.$message.error('未保存') |
| | | return |
| | | } |
| | | this.$message.success('已保存') |
| | | // this.$message.success('已保存') |
| | | }) |
| | | }, |
| | | filterHandler(value, row, column) { |
| | | const property = column['property']; |
| | | return row[property] === value; |
| | | }, |
| | | handleAll(e) { |
| | | if (e.length > 0) { |
| | | this.productList.map(m => { |
| | | this.upProductSelect(null, m) |
| | | return m |
| | | }) |
| | | } else { |
| | | this.productList.map(m => { |
| | | this.upProductSelect(null, m) |
| | | return m |
| | | }) |
| | | } |
| | | } |
| | | } |
| | | } |