zuozhengqing
2023-10-28 4b4438e7231bff0f260b0c17761072503e2af7b1
上架规则,产品类别下拉框可编辑,出入库明细调整
4个文件已修改
114 ■■■■ 已修改文件
src/components/layout/components/appsidebar/index.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/makepager/CommonFormTableView.vue 52 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/reportForm/inboundOutboundDetail/index.vue 37 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/warehouseManage/listingRules/index.vue 23 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/layout/components/appsidebar/index.vue
@@ -59,7 +59,7 @@
          <el-menu-item index="/reportForm/inventoryReport">库存报表</el-menu-item>
          <el-menu-item index="/reportForm/locationReport">位置报表</el-menu-item>
          <!-- <el-menu-item index="/warehouseManage/bussinessType">某日库存</el-menu-item> -->
          <!-- <el-menu-item index="/productManage/product">出入库明细报表</el-menu-item> -->
          <el-menu-item index="/reportForm/inboundOutboundDetail">出入库明细报表</el-menu-item>
        </el-submenu>
      </el-menu>
    </div>
src/components/makepager/CommonFormTableView.vue
@@ -195,6 +195,32 @@
                  </el-select>
                </div>
              </el-form-item>
              <!-- 产品类型 -->
              <el-form-item v-else-if="item.productType" label=" " :prop="'tableData.' + scope.$index + '.' + item.prop">
                <div class="custom-name">
                  <span v-if="scope.row.isEdit || scope.row.editable">{{ scope.row[item.prop] }}</span>
                  <el-select
                    v-else
                    v-model="scope.row[item.prop]"
                    placeholder="请选择"
                    size="mini"
                    style="width: 80%"
                    @change="
                      (val) => {
                        selProductTypeClick(val)
                      }
                    "
                  >
                    <el-option
                      v-for="item in productTypeNameOptions"
                      :key="item.id"
                      :label="item.name"
                      :value="item.name"
                    >
                    </el-option>
                  </el-select>
                </div>
              </el-form-item>
              <!-- 用户 -->
              <el-form-item v-else-if="item.user" label=" " :prop="'tableData.' + scope.$index + '.' + item.prop">
                <div class="custom-name">
@@ -249,6 +275,7 @@
import { getLocationList } from "@/api/warehouseManage/warehouse"
import { getCompanyList } from "@/api/common/other"
import { getRuleList } from "@/api/operate/inventoryAdjustment"
import { getProductCategoryList } from "@/api/product/productCategory"
import SimpleSearchInput from "@/components/makepager/SimpleSearchInput"
// import SelectCommonDialog from "@/views/other/commonDialog/SelectCommonDialog"
export default {
@@ -298,6 +325,7 @@
      },
      productIndex: 0,
      productNameOptions: [],
      productTypeNameOptions: [],
      memberOptions: [{ id: 1, name: "管理员" }],
      selOptions: [
        { id: 1, name: "件" },
@@ -312,6 +340,7 @@
      this.getRuleList()
    } else {
      this.getProductList()
      this.getProductCategoryList()
    }
    if (this.islistingrules) {
      this.getLocationList()
@@ -351,6 +380,21 @@
          const list = res.data ? res.data : []
          this.selLocationOptions = list.locationList
          this.productNameOptions = list.productList
        }
      })
    },
    // 获取产品类型列表
    async getProductCategoryList(){
      await getProductCategoryList({
        categoryId:0,
        keyWord:"",
        page:1,
        pageSize:15
      }).then((res) => {
        console.log(res,"看看产品类型列表")
        if (res.code === 200) {
          const list = res.data ? res.data : []
          this.productTypeNameOptions = list
        }
      })
    },
@@ -417,6 +461,14 @@
      console.log(this.tableList.tableData)
      this.$emit("selProductClick", item)
    },
    // 选择产品类型
    selProductTypeClick(item) {
      if (this.isinventory) {
        this.getProductCategoryList()
      }
      console.log(this.tableList.tableData)
      this.$emit("selProductTypeClick", item)
    },
    // 选择位置
    selLocationClick(item, prop) {
      console.log(item)
src/views/reportForm/inboundOutboundDetail/index.vue
@@ -31,7 +31,7 @@
<script>
import pageMixin from "@/components/makepager/pager/mixin/pageMixin"
import { getHistory } from "@/api/reportForm/inventoryRwport"
import { getProductOperatonList } from "@/api/product/product"
// import { getProductOperatonList } from "@/api/product/product"
import AddOverviewDialog from "@/views/overview/AddOverviewDialog"
@@ -181,23 +181,32 @@
          }
        })
      } else {
        await getProductOperatonList({
          productId: this.params.id,
        // await getProductOperatonList({
        //   productId: this.params.id,
        //   page: this.pagerOptions.currPage,
        //   pageSize: this.pagerOptions.pageSize
        // }).then((res) => {
        //   if (res.code === 200) {
        //     const list = res.data.map((item) => {
        //       return {
        //         ...item,
        //         fromLocation: item.fromLocation.name,
        //         toLocation: item.toLocation.name,
        //         productName: this.params.name,
        //         amount: item.details[0].product.amount,
        //         unit: item.details[0].product.unit
        //       }
        //     })
        //     this.tableList.tableInfomation = list || []
        //     this.pagerOptions.totalCount = res.total
        //   }
        // })
        await getHistory({
          page: this.pagerOptions.currPage,
          pageSize: this.pagerOptions.pageSize
        }).then((res) => {
          if (res.code === 200) {
            const list = res.data.map((item) => {
              return {
                ...item,
                fromLocation: item.fromLocation.name,
                toLocation: item.toLocation.name,
                productName: this.params.name,
                amount: item.details[0].product.amount,
                unit: item.details[0].product.unit
              }
            })
            this.tableList.tableInfomation = list || []
            this.tableList.tableInfomation = res.data
            this.pagerOptions.totalCount = res.total
          }
        })
src/views/warehouseManage/listingRules/index.vue
@@ -21,6 +21,7 @@
          @tableRowClick="tableRowClick"
          @selLocationClick="selLocationClick"
          @selProductClick="selProductClick"
          @selProductTypeClick="selProductTypeClick"
        >
          <template slot="tableButton">
            <el-table-column label="操作" width="90" align="center">
@@ -89,7 +90,8 @@
      areaId: 0,
      productId: 0,
      subLocationId: 0,
      currentRowId: 0
      currentRowId: 0,
      rowIndex:0
    }
  },
  created() {
@@ -105,7 +107,7 @@
        tableColumn: [
          { label: "当产品到达", prop: "areaName", location: true },
          { label: "产品", prop: "productName", product: true },
          { label: "产品类别", prop: "productCategory" },
          { label: "产品类别", prop: "productCategory",productType: true },
          { label: "存储到子位置", prop: "subLocation", location: true }
          // { label: "公司", prop: "companyName", company: true }
        ]
@@ -147,6 +149,8 @@
    },
    // 新增
    addProductClick() {
      this.tableList.tableColumn[1].product=true
      this.tableList.tableColumn[2].productType=true
      console.log(this.tableData)
      this.isSel()
      if (this.isNoProduct && this.addTitle === "新建") {
@@ -222,6 +226,8 @@
    },
    // 取消
    discardBtnClick() {
      this.tableList.tableColumn[1].product=true
      this.tableList.tableColumn[2].productType=true
      if (this.isRowClick) {
        this.tableData.map((item) => {
          item.isEdit = true
@@ -265,7 +271,10 @@
    },
    // 行点击
    tableRowClick(row, rowIndex) {
      console.log("11111")
      // this.tableList.tableColumn[1].product=true
      // this.tableList.tableColumn[2].productType=true
      this.rowIndex=rowIndex
      console.log("11111",row,rowIndex)
      this.isSel()
      if (!this.isNoProduct && this.currentRowId === 0) {
        this.$message.error("请完成当前新建或取消新建")
@@ -324,10 +333,16 @@
    },
    // 选中产品方法
    selProductClick(item) {
      console.log(item)
      this.tableList.tableColumn[2].productType=false
      this.productId = item.value
      this.productCategoryId = item.categoryId
    },
    // 选中产品类型方法
    selProductTypeClick(item) {
      console.log(item,"产品类型",this.tableList.tableData[this.rowIndex])
      this.tableList.tableColumn[1].product=false
      this.tableList.tableData[this.rowIndex].productName='--'
    },
    // 删除
    async delClick(scope) {
      console.log(scope)