haoxuan
2024-04-16 d3642faa7f79bc1e8992e528ad102587a2c44499
新增行的时候点击范围修改
1个文件已修改
56 ■■■■ 已修改文件
src/views/systemSetting/silkStandardSetting/index.vue 56 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/systemSetting/silkStandardSetting/index.vue
@@ -55,7 +55,7 @@
          prop: "checkItem",
          projectName: true,
          isCallMethod: true,
          getCallMethod: this.getCheckItemName
          getCallMethod: this.getCheckItemName,
        },
        { label: "开始纤度", prop: "startFineness", inputFloat: true },
        { label: "结束纤度", prop: "endFineness", inputFloat: true },
@@ -91,7 +91,21 @@
        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)
@@ -126,11 +140,16 @@
          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() {
@@ -138,14 +157,15 @@
        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) {
@@ -162,6 +182,7 @@
          price2: 0,
          price3: 0
        })
        this.silkTableList.tableData=this.tableData
      }else{
        this.$message.error('请先解锁再新增!')
      }
@@ -251,7 +272,13 @@
    // 添加列
    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 })
@@ -275,6 +302,13 @@
          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)