src/components/makepager/CommonFormTableView.vue
@@ -267,48 +267,17 @@
              <el-form-item v-else-if="item.product" label=" " :prop="'tableData.' + scope.$index + '.' + item.prop">
                <div class="custom-name">
                  <span v-if="scope.row.isEdit || scope.row.editable">{{ scope.row.productName }}</span>
                  <!-- <el-select
                    v-else
                  <template v-else>
                    <SimpleSearchInput
                    v-model="scope.row[item.prop]"
                    placeholder="请选择"
                    size="mini"
                    filterable
                    style="width: 80%"
                    clearable
                    @clear="setValueNull(scope.row[item.prop])"
                    @change="
                      (val) => {
                        selProductClick(val)
                      }
                    "
                      :echoValue="scope.row[item.prop]"
                      :echoName="scope.row[item.prop]"
                      checkedNum="1"
                      :clearable="true"
                      @select-user="selProductClick"
                  >
                    <el-option
                      v-for="(item, index) in productNameOptions"
                      :key="index"
                      :label="item.name"
                      :value="{
                        value: item.id,
                        label: item.name,
                        amount: item.amount,
                        unit: item.unit,
                        categoryId: item.categoryId,
                        categoryName: item.categoryName
                      }"
                    >
                    </el-option>
                  </el-select> -->
                  <el-autocomplete
                    v-else
                    style="width: 100%"
                    v-model="scope.row.productName"
                    :fetch-suggestions="
                      (queryString, callback) => {
                        querySearchAsync(queryString, callback, 'product')
                      }
                    "
                    value-key="name"
                    @select="handleSelectClient('product', $event)"
                  ></el-autocomplete>
                    </SimpleSearchInput>
                  </template>
                </div>
              </el-form-item>
              <!-- 产品类别 -->
@@ -540,7 +509,6 @@
        page: 1,
        pageSize: 100
      }).then((res) => {
        // console.log(res.data)
        if (res.code === 200) {
          if (res.data && res.data.length > 0) {
            this.productNameOptions = res.data
@@ -584,7 +552,6 @@
      if (results.length === 0) {
        this.productTypeNameOptions = []
      }
      console.log(results, "results", value)
      this.$emit("querySearchData", queryString, results, value)
    },
    createStateFilter(queryString) {
@@ -603,7 +570,6 @@
        locationId: 0,
        productId: ""
      }).then((res) => {
        console.log(res)
        if (res.code === 200) {
          const list = res.data ? res.data : []
          this.selLocationOptions = list.locationList
@@ -636,12 +602,10 @@
        page: 1,
        pageSize: 100
      }).then((res) => {
        console.log(res, "newlocal")
        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
@@ -658,12 +622,10 @@
        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) {
            this.locacionName = list[0]?.name
            this.locacionId = list[0]?.id
@@ -680,7 +642,6 @@
        page: 1,
        pageSize: 100
      }).then((res) => {
        console.log(res, "newlocal")
        if (res.code === 200) {
          const list = res.data ? res.data : []
          this.selSonLocationOptions = list
@@ -695,7 +656,6 @@
    // 获取公司列表
    async getCompanyList() {
      await getCompanyList().then((res) => {
        console.log(res)
        if (res.code === 200) {
          this.companyOptions = res.data
        }
@@ -704,7 +664,6 @@
    selProductNameClick(item) {
      this.productIndex = this.tableList.tableData.length - 1
      this.tableList.tableData.map((ite, index) => {
        console.log(ite)
        if (index === this.productIndex) {
          ite.productId = item.id
          ite.productName = item.name
@@ -716,20 +675,21 @@
    // 选择产品
    selProductClick(item) {
      if (this.isReorder) {
        this.productId = item.value
        this.productName = item.label
        this.productId = item.id
        this.productName = item.name
        this.getAmountAndPrediction(item, "product")
      } else {
        this.tableList.tableData.map((ite) => {
          if (ite.productName.label === item.label) {
            ite.productId = item.value
            ite.productName = item.label
        this.tableList.tableData.map((ite, index) => {
          if (index === 0) {
            ite.productId = item.id
            ite.productName = item.name
            ite.categoryId = item.categoryId
            ite.productCategory = item.categoryName
            ite.amount = item.amount
            ite.unit = item.unit
          }
        })
        this.$emit("selProductClick", "product", this.tableList.tableData[0])
      }
      if (this.isinventory) {
@@ -806,7 +766,6 @@
          locationId: item.value,
          productId: ""
        }).then((res) => {
          console.log(res)
          if (res.code === 200) {
            const list = res.data ? res.data : []
            this.productNameOptions = list.productList
@@ -822,28 +781,28 @@
    // 获取在库与预测数量
    getAmountAndPrediction(item, val, ite) {
      console.log(item, val, ite)
      console.log(this.productName)
      console.log(this.tableList.tableData)
      if (this.productName.length > 0) {
        getAmountAndPrediction({
          locationId: val === "product" ? this.locacionId : ite.value,
          productId: val === "product" ? item.value : this.productId
        }).then((res) => {
          if (res.code === 200) {
            this.tableList.tableData.map((ite) => {
              if (ite.productName.label === this.productName) {
            this.tableList.tableData.map((ite, index) => {
              if (index == 0) {
                ite.amount = res.data.amount
                ite.prediction = res.data.prediction
                ite.productId = item.id
                ite.productName = item.name
                ite.unit = item.unit
              }
            })
            this.$emit("selProductClick", this.tableList.tableData[0])
          }
        })
      }
    },
    // 选择路线
    selRouteClick(item, prop) {
      console.log("33333333333333")
      this.$emit("selRouteClick", item, prop)
    },
    // 选择单位/用户
@@ -891,7 +850,6 @@
    },
    commonInputChange(val, prop, row) {
      console.log(val, prop)
      console.log(row)
      this.$emit("inputContent", val, prop, row)
    },
    // 清空
@@ -902,7 +860,6 @@
    clearupClient(row, scope) {
      this.productIndex = scope.$index
      this.tableList.tableData.map((ite, index) => {
        console.log(scope.$index)
        if (scope.$index && scope.$index >= 0) {
          if (index === this.productIndex) {
            ite.name = ""