| | |
| | | highlight-current-row |
| | | :header-cell-style="this.$headerCellStyle" |
| | | :cell-style="this.$cellStyle" |
| | | :row-class-name="tableRowClassName" |
| | | @selection-change="handleSelectionChange" |
| | | @cell-dblclick="cellDblclick" |
| | | > |
| | | <el-table-column |
| | | type="index" |
| | |
| | | prop="stepcheckitem_desc" |
| | | label="检验标准描述" |
| | | > |
| | | <template slot-scope="{row}"> |
| | | <el-input v-if="row.isVisible===1" v-model="row.stepcheckitem_desc" placeholder="请输入" /> |
| | | <div v-else> {{ row.stepcheckitem_desc }}</div> |
| | | <template slot-scope="scope"> |
| | | <el-input |
| | | v-if="scope.row.isVisible===1||scope.row.index === tabClickIndex && tabClickLabel === '检验标准描述'" |
| | | v-model="scope.row.stepcheckitem_desc" |
| | | placeholder="请输入" |
| | | @keyup.enter.native="val=>keyUpEnterNative(val,scope.row)" |
| | | /> |
| | | <div |
| | | v-else |
| | | > {{ scope.row.stepcheckitem_desc }}</div> |
| | | |
| | | </template> |
| | | </el-table-column> |
| | | |
| | |
| | | // const SER_HZ = /^[\u4e00-\u9fa5]+$/ |
| | | import $ from 'jquery' |
| | | import { |
| | | DeleteStepCheckStaned, |
| | | MesOrderStepCheckItemList, |
| | | MesOrderStepCheckSearch, |
| | | MesOrderStepCheckSelect, SaveMesOrderStepCheckItem, |
| | |
| | | JYTableData: [], // 检验项信息表格 |
| | | JYSelectArr: [], // 检验下拉数组 |
| | | JYSelectedArr: [], // 已选检验项目数组 |
| | | multipleSelection: []// 表格多选框 |
| | | multipleSelection: [], // 表格多选框 |
| | | tabClickIndex: null, // 点击的单元格 |
| | | tabClickLabel: '' // 当前点击的列名 |
| | | } |
| | | }, |
| | | created() { |
| | |
| | | number = number === 0 ? (10 + Math.random()) : number |
| | | |
| | | // item.result = 0 // 0合格 1不良 |
| | | item.result = 'NG' |
| | | item.result = 'OK' |
| | | |
| | | item.isVisible = 0 |
| | | item.number = number |
| | | this.JYSelectedArr.push(item.code) |
| | | }) |
| | | this.$refs.multipleTable.toggleAllSelection() |
| | | }, |
| | | // changeRadioValue(val, row) { |
| | | // console.log(val, row.result, 20000) |
| | |
| | | it.result = 'NG' |
| | | } |
| | | }) |
| | | if (this.multipleSelection.length > 0) { |
| | | if (this.multipleSelection.length === this.JYTableData.length) { |
| | | this.checkResult = 'OK' |
| | | } else { |
| | | this.checkResult = 'NG' |
| | | } |
| | | |
| | | if (this.multipleSelection.length > 0 && this.multipleSelection.length === this.JYTableData.length) { |
| | | this.checkResult = 'OK' |
| | | } else { |
| | | this.checkResult = '' |
| | | this.checkResult = 'NG' |
| | | } |
| | | }, |
| | | // 检验项目编码(名称) |
| | |
| | | |
| | | let number = Math.random() * Math.random()// 作为删除时的标识符 |
| | | number = number === 0 ? (10 + Math.random()) : number |
| | | const data = { result: 'NG', code: '', name: '', stepcheckitem_desc: '', isVisible: 1, number } |
| | | const data = { result: 'OK', code: '', name: '', stepcheckitem_desc: '', isVisible: 1, number } |
| | | this.JYTableData.push(data) |
| | | this.$refs.multipleTable.toggleRowSelection(data, true) |
| | | }, |
| | | |
| | | // 确认 |
| | |
| | | } |
| | | }) |
| | | |
| | | if (this.multipleSelection.length > 0) { |
| | | if (this.multipleSelection.length === this.JYTableData.length) { |
| | | this.checkResult = 'OK' |
| | | } else { |
| | | this.checkResult = 'NG' |
| | | } |
| | | if (this.multipleSelection.length > 0 && this.multipleSelection.length === this.JYTableData.length) { |
| | | this.checkResult = 'OK' |
| | | } else { |
| | | this.checkResult = '' |
| | | this.checkResult = 'NG' |
| | | } |
| | | }, |
| | | // 取消 |
| | |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | // 删除 |
| | | del(row) { |
| | | this.JYTableData.forEach((item, index) => { |
| | |
| | | this.form.stepcode = '' |
| | | this.form.stepname = '' |
| | | }, |
| | | |
| | | // 单元格被点击时 |
| | | cellDblclick(row, column, cell, event) { |
| | | console.log(row, column, cell, event) |
| | | console.log(column.label) |
| | | console.log(row.index) |
| | | switch (column.label) { |
| | | case '检验标准描述': |
| | | this.tabClickIndex = row.index |
| | | this.tabClickLabel = column.label |
| | | break |
| | | // case '判责金额(元)': |
| | | // this.tabClickIndex = row.index |
| | | // this.tabClickLabel = column.label |
| | | // break |
| | | default: return |
| | | } |
| | | }, |
| | | // 回车事件 |
| | | keyUpEnterNative(val, row) { |
| | | this.tabClickLabel = '' |
| | | }, |
| | | |
| | | tableRowClassName({ row, rowIndex }) { |
| | | // 把每一行的索引放进row |
| | | row.index = rowIndex |
| | | }, |
| | | // 获取页面高度 |
| | | getHeight() { |
| | | this.$nextTick(() => { |