zuozhengqing
2023-11-15 e1a3c04432d808ca27e1158095d2564cd81ea379
表格公共组件修改合并
2个文件已修改
76 ■■■■ 已修改文件
src/components/makepager/CommonFormTableView.vue 65 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/warehouseManage/listingRules/index.vue 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/makepager/CommonFormTableView.vue
@@ -169,8 +169,41 @@
                  </el-select>
                </div>
              </el-form-item>
              <!-- 产品到达位置 -->
              <el-form-item v-else-if="item.toLocation" label=" " :prop="'tableData.' + scope.$index + '.' + item.prop">
                <div class="custom-name">
                  <span v-if="scope.row.isEdit || scope.row.editable">{{
                    scope.row[item.prop]?.label ?? scope.row[item.prop]
                  }}</span>
                  <el-select
                    v-else
                    v-model="scope.row[item.prop]"
                    placeholder="请选择"
                    size="mini"
                    filterable
                    style="width: 80%"
                    @change="
                      (val) => {
                        selLocationClick(val, item.prop)
                      }
                    "
                  >
                    <el-option
                      v-for="(item, index) in selToLocationOptions"
                      :key="index"
                      :label="item.jointName"
                      :value="{ value: item.id, label: item.jointName }"
                    >
                    </el-option>
                  </el-select>
                </div>
              </el-form-item>
              <!-- 子位置 -->
              <el-form-item v-else-if="item.sonLocation" label=" " :prop="'tableData.' + scope.$index + '.' + item.prop">
              <el-form-item
                v-else-if="item.sonLocation"
                label=" "
                :prop="'tableData.' + scope.$index + '.' + item.prop"
              >
                <div class="custom-name">
                  <span v-if="scope.row.isEdit || scope.row.editable">{{
                    scope.row[item.prop]?.label ?? scope.row[item.prop]
@@ -468,6 +501,7 @@
      ],
      selLocationOptions: [], // 位置
      selSonLocationOptions:[], //子位置
      selToLocationOptions: [], // 产品到达位置
      companyOptions: [], // 公司
      selRouteOptions: [{ id: 1, name: "制造" }], // 路线
      locacionName: "",
@@ -488,7 +522,7 @@
      this.getProductCategoryList()
    }
    if (this.islistingrules) {
      this.getLocationList()
      this.getToLocationList()
      // this.getCompanyList()
    }
    this.tableList = this.productTableList
@@ -519,7 +553,7 @@
      if (value === "product") {
        if(item.categoryId===0||item.categoryName===""){
          this.productTypeNameOptions =[]
          this.tableList.tableData[this.tableList.rowClickIndex].productCategory=''
          this.tableList.tableData[this.tableList.rowClickIndex].productCategory = ""
        }else{
          await getProductCategoryList({
            categoryId: item.categoryId,
@@ -539,7 +573,7 @@
      }
    },
    querySearchAsync(queryString, cb, value) {
      let restaurants=''
      let restaurants = ""
      if(value==="product"){
         restaurants = this.productNameOptions
      }else if(value==="productType"){
@@ -606,6 +640,28 @@
        if (res.code === 200) {
          const list = res.data ? res.data : []
          this.selLocationOptions = list
          this.selSonLocationOptions = list
          console.log(list, "999")
          if (this.isReorder) {
            this.locacionName = list[0]?.name
            this.locacionId = list[0]?.id
            this.$emit("selLocationClick", list[0], "locacionName")
          }
        }
      })
    },
    // 产品到达位置
    async getToLocationList() {
      await getLocationList({
        // keyword: "",
        type: 3,
        page: 1,
        pageSize: 100
      }).then((res) => {
        console.log(res, "newlocal")
        if (res.code === 200) {
          const list = res.data ? res.data : []
          this.selToLocationOptions = list
          this.selSonLocationOptions=list
            console.log(list,"999")
          if (this.isReorder) {
@@ -913,7 +969,6 @@
        font-size: 13px;
        cursor: pointer;
      }
    }
  }
}
src/views/warehouseManage/listingRules/index.vue
@@ -83,7 +83,7 @@
      categoryId: null,
      searchTaskMap: [],
      isCreate:false,
      thatRow:{},
      thatRow: {}
    }
  },
  created() {
@@ -111,7 +111,7 @@
        selectBox: false,
        selectIndex: true,
        tableColumn: [
          { label: "当产品到达", prop: "areaName", location: true },
          { label: "当产品到达", prop: "areaName", toLocation: true },
          { label: "产品", prop: "productName", product: true },
          { label: "产品类别", prop: "productCategory", productType: true },
          { label: "存储到子位置", prop: "subLocation", sonLocation: true }
@@ -279,7 +279,6 @@
    },
    // 行点击
    tableRowClick(row, rowIndex) {
      this.thatRow=row
      this.tableList.rowClickIndex=rowIndex
      this.rowIndex = rowIndex
@@ -310,7 +309,7 @@
    },
    querySearchData(queryString,results,value){
      if(this.isCreate){
        if(queryString===''){
        if (queryString === "") {
          this.tableList.tableColumn[1].product = true
          this.tableList.tableColumn[2].productType = true
        }else{
@@ -409,9 +408,7 @@
          this.tableList.tableColumn[2].productType = false
        }
      }else{
        if (
          this.tableList.tableData[newVal].productName === ""
        ) {
        if (this.tableList.tableData[newVal].productName === "") {
          this.tableList.tableColumn[1].product = false
          this.tableList.tableColumn[2].productType = true
        } else {