公共组件选择产品改为下拉可搜索框、库存调整、补货、上架规则、重订货规则修改
6个文件已修改
171 ■■■■■ 已修改文件
src/components/makepager/CommonFormTableView.vue 89 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/makepager/SimpleSearchInput.vue 28 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/operate/inventoryAdjustment/index.vue 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/operate/orderPoint/index.vue 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/productManage/reorderRules/index.vue 39 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/warehouseManage/listingRules/index.vue 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
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
                    v-model="scope.row[item.prop]"
                    placeholder="请选择"
                    size="mini"
                    filterable
                    style="width: 80%"
                    clearable
                    @clear="setValueNull(scope.row[item.prop])"
                    @change="
                      (val) => {
                        selProductClick(val)
                      }
                    "
                  >
                    <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
                      }"
                  <template v-else>
                    <SimpleSearchInput
                      v-model="scope.row[item.prop]"
                      :echoValue="scope.row[item.prop]"
                      :echoName="scope.row[item.prop]"
                      checkedNum="1"
                      :clearable="true"
                      @select-user="selProductClick"
                    >
                    </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
@@ -549,7 +517,7 @@
      })
    },
    async handleSelectClient(value, item) {
      this.$emit("selProductClick",value,item)
      this.$emit("selProductClick", value, item)
      if (value === "product") {
        if (item.categoryId === 0 || item.categoryName === "") {
          this.productTypeNameOptions = []
@@ -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 = ""
src/components/makepager/SimpleSearchInput.vue
@@ -44,20 +44,20 @@
          <ul class="infinite-list" @scroll="loadList">
            <div class="background_color_eee">
              <el-row :gutter="0">
                <el-col :span="8">
                <el-col :span="13">
                  <div class="grid-content bg-purple">
                    <span class="name">产品名称</span>
                  </div>
                </el-col>
                <el-col :span="8">
                  <div class="grid-content bg-purple">内部编码</div>
                  <div class="grid-content bg-purple">产品编码</div>
                </el-col>
                <el-col :span="5">
                <!-- <el-col :span="5">
                  <div class="grid-content bg-purple">在库数量</div>
                </el-col>
                </el-col> -->
                <el-col :span="3">
                  <div class="grid-content bg-purple">计量单位</div>
                  <div class="grid-content bg-purple">单位</div>
                </el-col>
              </el-row>
            </div>
@@ -70,22 +70,22 @@
                :class="selectValue == user.id ? 'highlight-color' : ''"
              >
                <el-row :gutter="0">
                  <el-col :span="8">
                  <el-col :span="13">
                    <div class="grid-content bg-purple" :title="user[obj.name]">
                      {{ user[obj.name] || "--" }}
                    </div>
                  </el-col>
                  <el-col :span="6">
                    <div class="grid-content bg-purple" :title="user.internalReference">
                      <span class="name">{{ user.internalReference || "--" }}</span>
                  <el-col :span="8">
                    <div class="grid-content bg-purple" :title="user.id">
                      <span class="name">{{ user.id || "--" }}</span>
                    </div>
                  </el-col>
                  <el-col :span="6">
                  <!-- <el-col :span="6">
                    <div class="grid-content bg-purple" :title="user.amount">
                      {{ user.amount || "--" }}
                    </div>
                  </el-col>
                  <el-col :span="4">
                  </el-col> -->
                  <el-col :span="3">
                    <div class="grid-content bg-purple" :title="user.unit">
                      {{ user.unit || "--" }}
                    </div>
@@ -371,9 +371,9 @@
<style lang="scss">
.user-simple-search-input-popper {
  max-width: 630px;
  max-width: 500px;
  .el-select-dropdown__wrap {
    min-width: 509px;
    min-width: 409px;
    width: 100%;
    min-height: 370px;
src/views/operate/inventoryAdjustment/index.vue
@@ -315,9 +315,8 @@
      this.locationId = item.value
    },
    // 选中产品方法
    selProductClick(item) {
      console.log(item)
      this.productId = item.value
    selProductClick(value, item) {
      this.productId = item.productId
    },
    // 获取当前时间
    currentTime() {
src/views/operate/orderPoint/index.vue
@@ -215,7 +215,7 @@
    },
    // 新增
    addProductClick() {
      console.log(this.addTitle)
      console.log(this.addTitle, "qqqqqqqqqqqq")
      this.isSel()
      if (this.isNoProduct && this.addTitle === "新建") {
        this.$refs.tablelistRef.getProductList()
@@ -356,8 +356,10 @@
    },
    // 选中产品方法
    selProductClick(item) {
      this.productId = item.value
      this.productId = item.productId
      this.unit = item.unit
      this.amount = item.amount
      this.prediction = item.prediction
    },
    // 选中路线方法
    selRouteClick(item, prop) {
@@ -383,7 +385,6 @@
          },
          ...res.data
        ]
        console.log(res, "res666")
      })
    },
    // 删除type
src/views/productManage/reorderRules/index.vue
@@ -81,7 +81,7 @@
      reorderId: 0,
      queryProductId: null,
      searchTaskMap: [],
      currentRowId:-1
      currentRowId: -1
    }
  },
  created() {
@@ -103,7 +103,7 @@
        selectBox: false,
        selectIndex: true,
        tableColumn: [
          { label: "产品", prop: "productName", product: true,width:"150px" },
          { label: "产品", prop: "productName", product: true, width: "150px" },
          { label: "位置", prop: "locationName", defaultLocation: true },
          { label: "在库数量", prop: "amount" },
          { label: "预测数量", prop: "prediction" },
@@ -135,7 +135,7 @@
            }
            return {
              ...item,
              productName:item.product.name,
              productName: item.product.name,
              locationName: item.location.name,
              isSet: false,
              isEdit: true,
@@ -215,17 +215,18 @@
        this.showDiscard = false
        let requestUrl = this.currentRowId === 0 ? addReorderRule : updateReorderRule
        let params = this.saveParams()
        requestUrl(params).then((res) => {
          if (res.code === 200) {
            let tipStr = this.currentRowId === 0 ? "添加成功" : "修改成功"
            this.$message.success(tipStr)
        requestUrl(params)
          .then((res) => {
            if (res.code === 200) {
              let tipStr = this.currentRowId === 0 ? "添加成功" : "修改成功"
              this.$message.success(tipStr)
              this.getData()
            }
          })
          .catch((err) => {
            this.getData()
          }
        })
        .catch((err) => {
          this.getData()
          console.log(err)
        })
            console.log(err)
          })
      }
    },
    saveParams() {
@@ -281,7 +282,7 @@
      if (!this.isNoProduct && this.currentRowId === 0) {
        this.$message.error("请完成当前新建或取消新建")
      } else {
        this.currentRowId = row.id||0
        this.currentRowId = row.id || 0
        this.addTitle = "保存"
        this.showDiscard = true
        this.isRowClick = true
@@ -318,11 +319,11 @@
      this.locationId = item?.value ?? item?.id
    },
    // 选中产品方法
    selProductClick(value,item){
      if(value==="product"){
      this.productId=item.id
      this.unit=item.unit
      }
    selProductClick(item) {
      this.productId = item.productId
      this.unit = item.unit
      this.amount = item.amount
      this.prediction = item.prediction
    },
    // 选中路线方法
    selRouteClick(item, prop) {
src/views/warehouseManage/listingRules/index.vue
@@ -368,10 +368,11 @@
    },
    // 选中产品方法
    selProductClick(value, item) {
      console.log(value, item)
      if (value === "product") {
        this.RuleType = 1
        this.tableList.tableColumn[2].productType = false
        this.productId = item.id
        this.productId = item.productId
        this.productCategoryId = item.categoryId
      } else if (value === "productType") {
        this.productCategoryId = item.id