| | |
| | | prop: "checkItem", |
| | | projectName: true, |
| | | isCallMethod: true, |
| | | getCallMethod: this.getCheckItemName |
| | | getCallMethod: this.getCheckItemName, |
| | | }, |
| | | { label: "开始纤度", prop: "startFineness", inputFloat: true }, |
| | | { label: "结束纤度", prop: "endFineness", inputFloat: true }, |
| | |
| | | if (res.code === 200) { |
| | | if (res.data.length > 0) { |
| | | this.tableData = [] |
| | | this.tableColumn = this.defaultColumn |
| | | this.tableColumn = [ |
| | | { |
| | | label: "检查项目名称", |
| | | prop: "checkItem", |
| | | projectName: true, |
| | | isCallMethod: true, |
| | | getCallMethod: this.getCheckItemName, |
| | | }, |
| | | { label: "开始纤度", prop: "startFineness", inputFloat: true }, |
| | | { label: "结束纤度", prop: "endFineness", inputFloat: true }, |
| | | { label: "野纤", prop: "rankA", inputFloat: true }, |
| | | { label: "大野", prop: "rankB", inputFloat: true }, |
| | | { label: "特野", prop: "rankC", inputFloat: true } |
| | | ] |
| | | // this.tableColumn=this.defaultColumn |
| | | this.columnDataProcess(res.data[0].dynamicsRanks) |
| | | this.rankObj = {} |
| | | this.allDataProcess(res.data) |
| | |
| | | inputFloat: true |
| | | } |
| | | }) |
| | | let currentIndex=0 |
| | | this.tableColumn.map((item, index) => { |
| | | if (item.prop == 'rankA') { |
| | | currentIndex = index |
| | | } |
| | | }) |
| | | this.columnNum = list.length + 1 |
| | | for (let j = 0; j < list.length; j++) { |
| | | this.tableColumn.splice(2, 0, list[j]) |
| | | this.tableColumn.splice(currentIndex, 0, list[j]) |
| | | } |
| | | console.log(this.tableColumn) |
| | | this.silkTableList.tableColumn = this.tableColumn |
| | | }, |
| | | setTableForm() { |
| | |
| | | tableData: this.tableData, |
| | | isReturn: false, |
| | | tableColumn: [ |
| | | { label: "检查项目名称", prop: "projectName", projectName: true }, |
| | | { label: "开始纤度", prop: "start", inputFloat: true }, |
| | | { label: "结束纤度", prop: "end", inputFloat: true }, |
| | | { label: "野纤", prop: "price1", inputFloat: true }, |
| | | { label: "大野", prop: "price2", inputFloat: true }, |
| | | { label: "特野", prop: "price3", inputFloat: true } |
| | | { label: "检查项目名称", prop: "checkItem", projectName: true }, |
| | | { label: "开始纤度", prop: "startFineness", inputFloat: true }, |
| | | { label: "结束纤度", prop: "endFineness", inputFloat: true }, |
| | | { label: "野纤", prop: "rankA", inputFloat: true }, |
| | | { label: "大野", prop: "rankB", inputFloat: true }, |
| | | { label: "特野", prop: "rankC", inputFloat: true } |
| | | ] |
| | | } |
| | | this.tableColumn=this.silkTableList.tableColumn |
| | | }, |
| | | // 搜索 |
| | | onFilterSearch(searchText) { |
| | |
| | | price2: 0, |
| | | price3: 0 |
| | | }) |
| | | this.silkTableList.tableData=this.tableData |
| | | }else{ |
| | | this.$message.error('请先解锁再新增!') |
| | | } |
| | |
| | | // 添加列 |
| | | addColumnClick() { |
| | | let propStr = "prop" + this.columnNum |
| | | this.tableColumn.splice(2, 0, { label: "", prop: propStr, inputFloat: true, addColumn: true }) |
| | | let currentIndex=0 |
| | | this.tableColumn.map((item, index) => { |
| | | if (item.prop == 'rankA') { |
| | | currentIndex = index |
| | | } |
| | | }) |
| | | this.tableColumn.splice(currentIndex, 0, { label: "", prop: propStr, inputFloat: true, addColumn: true }) |
| | | this.$set(this.dataObj, propStr, 0) |
| | | this.$set(this.rankObj, propStr, 0) |
| | | this.columnInputList.push({ rankProp: propStr, rankName: "", rankValue: 0 }) |
| | |
| | | currentIndex = index |
| | | } |
| | | }) |
| | | let columnInputIndex=0 |
| | | this.columnInputList.forEach((item,index) => { |
| | | if (item.rankProp == prop) { |
| | | columnInputIndex = index |
| | | } |
| | | }) |
| | | this.columnInputList.splice(columnInputIndex,1) |
| | | this.tableColumn.splice(currentIndex, 1) |
| | | this.silkTableList.tableColumn = this.tableColumn |
| | | this.$delete(this.dataObj, prop) |