zuozhengqing
2023-11-06 e7ccd2a06e4cdf3709e699507e1e15379ded5b83
Merge branch 'dev' of http://192.168.5.5:10010/r/web/WMS into dev
23个文件已修改
737 ■■■■ 已修改文件
src/api/common/other.js 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/overview/overview.js 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/product/reorderRules.js 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/reportForm/inventoryRwport.js 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/warehouseManage/warehouse.js 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/common/untils/request.js 61 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/makepager/CommonFormTableView.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/makepager/FormBtnsView.vue 23 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/makepager/SearchCommonView.vue 136 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/operate/orderPoint/index.vue 184 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/overview/AddOverviewDialog.vue 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/overview/OverviewListView.vue 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/overview/index.vue 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/productManage/product/AddProductDialog.vue 46 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/productManage/product/index.vue 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/productManage/productCategory/AddProductCategoryDialog.vue 59 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/productManage/reorderRules/index.vue 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/reportForm/inventoryReport/index.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/warehouseManage/bussinessType/AddBussinessType.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/warehouseManage/bussinessType/index.vue 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/warehouseManage/listingRules/index.vue 45 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/warehouseManage/position/index.vue 39 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/warehouseManage/warehouse/index.vue 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/common/other.js
@@ -1,9 +1,11 @@
// import request from "@/common/untils/request.js"
import axios from "axios"
import request from "@/common/untils/request";
// 查询公司列表
export const getCompanyList = async (data) => {
  return await axios.get(`/api-wms/v1/company/company`, {
export const getCompanyList = (data) => {
  return request({
    url: "/api-wms/v1/company/company",
    method: "get",
    params: data
  })
}
src/api/overview/overview.js
@@ -1,15 +1,18 @@
import request from "@/common/untils/request.js"
import axios from "axios"
// 查询业务类型列表
export const getOperationType = async (data) => {
  return await axios.get(`/api-wms/v1/operationType/operationType`, {
export const getOperationType =  (data) => {
  return request({
    url: "/api-wms/v1/operationType/operationType",
    method: "get",
    params: data
  })
}
// 查询业务类型列表--内部调拨
export const getListTransfer = async (data) => {
  return await axios.get(`/api-wms/v1/operationType/listTransfer`, {
export const getListTransfer = (data) => {
  return request({
    url: "/api-wms/v1/operationType/listTransfer",
    method: "get",
    params: data
  })
}
src/api/product/reorderRules.js
@@ -39,11 +39,10 @@
    data
  })
}
// 获取位置列表
export function getLocationList(data) {
// 获取位置列表树
export function getLocationTreeList() {
  return request({
    url: "/api-wms/v1/location/getLocationList",
    method: "post",
    data
    url: "/api-wms/v1/location/getLocationTreeList",
    method: "get"
  })
}
src/api/reportForm/inventoryRwport.js
@@ -1,6 +1,5 @@
// 库存报表
import request from "@/common/untils/request.js"
import axios from "axios"
// 获取库存报表
@@ -13,8 +12,10 @@
}
// 仓库类型列表
export const getWarehouseList = async (data) => {
  return await axios.get(`/api-wms/v1/warehouse/warehouse`, {
export const getWarehouseList = (data) => {
  return request({
    url: "/api-wms/v1/warehouse/warehouse",
    method: "get",
    params: data
  })
}
src/api/warehouseManage/warehouse.js
@@ -1,9 +1,10 @@
import request from "@/common/untils/request.js"
import axios from "axios"
// 仓库列表
export const getWarehouseList = async (data) => {
  return await axios.get(`/api-wms/v1/warehouse/warehouse`, {
export const getWarehouseList = (data) => {
  return request({
    url: "/api-wms/v1/warehouse/warehouse",
    method: "get",
    params: data
  })
}
@@ -32,8 +33,10 @@
  })
}
// 业务类型  列表
export const getOperationTypeList = async (data) => {
  return await axios.get(`/api-wms/v1/operationType/operationType`, {
export const getOperationTypeList = (data) => {
  return request({
    url: "/api-wms/v1/operationType/operationType",
    method: "get",
    params: data
  })
}
src/common/untils/request.js
@@ -3,6 +3,35 @@
// import router from '@/router'
// 开发环境下将自己的token复制到这里, 也可以在浏览器中手动添加token到cookie中,cookie中的token优先
const DEV_TOKEN =  ''
function environmentType(){
  let type
  if (location.href.includes('192.168.20.119')) {
    type = 'test'
  } else if (location.href.includes('192.168') || location.href.includes('localhost')) {
    type = 'dev'
  } else {
    type = 'prod'
  }
  return type
}
const isDev = environmentType() === 'dev'
const getApsPage = () => {
  // 首页部署在各个环境的端口
  const loginPathMap = {
    prod:`//${window.location.hostname}:9080`,
    test:`//192.168.20.119:9080`,
    // 想跳到本地启动的登录页的话需要把dev改成你本地项目路径
    dev: `//192.168.20.124:8081`
  }
  return loginPathMap[environmentType()]
}
const Axios = axios.create({
  responseType: "json",
  withCredentials: true // 是否允许带cookie这些
@@ -11,11 +40,16 @@
/* //POST传参序列化(添加请求拦截器) */
Axios.interceptors.request.use(
  (config) => {
    // 若是有做鉴权token , 就给头部带上token
    // let token = util.cookies.get("token");
    // if (token != undefined) {
    //   config.headers.Authorization = "Bearer " + token;
    // }
    let token = document.cookie.replace(
        /(?:(?:^|.*;\s*)token\s*=\s*([^;]*).*$)|^.*$/,
        "$1",
    );
    if (isDev){
      token = token || DEV_TOKEN
    }
    if (token) {
      config.headers.Authorization = "Bearer " + token;
    }
    return config
  },
@@ -30,6 +64,14 @@
    /* //对响应数据做些事 */
    if (res.data.code === 200) {
      return res.data ? res.data : {}
    }else if([2012,2013,2014,2015].includes(res.data.code)){
      if (isDev){
        alert("JWT失效")
      }else {
        //   JWT鉴权失效 跳转到登录页
        window.location = getApsPage()+'/login'
      }
      return Promise.reject(res.data)
    } else {
      Message({
        message: res.data.msg,
@@ -40,6 +82,15 @@
    }
  },
  (error) => {
    if (error.response.status === 401){
      if (isDev){
        alert("JWT失效")
      }else {
        //   JWT鉴权失效 跳转到登录页
        window.location = getApsPage()+'/login'
      }
    }
    let { message } = error
    if (message === "Network Error") {
      message = "后端接口连接异常"
src/components/makepager/CommonFormTableView.vue
@@ -504,8 +504,8 @@
    async getCompanyList() {
      await getCompanyList().then((res) => {
        console.log(res)
        if (res.data.code === 200) {
          this.companyOptions = res.data.data
        if (res.code === 200) {
          this.companyOptions = res.data
        }
      })
    },
src/components/makepager/FormBtnsView.vue
@@ -7,7 +7,8 @@
        <div class="right-label">额外的价格</div>
      </div>
    </div> -->
    <div v-if="!showProduct && !showWarehouse && !showPosition && !addProduct"
    <div
      v-if="!showProduct && !showWarehouse && !showPosition && !addProduct"
         class="sub-number left_border cursor_pointer"
         @click="inLibraryClick()"
    >
@@ -48,21 +49,25 @@
        <div class="right-label">BOM</div>
      </div>
    </div> -->
    <div v-if="!showProduct && !showWarehouse && !showPosition" class="sub-number no-cursor">
    <div
      v-if="!showProduct && !showWarehouse && !showPosition"
      class="sub-number yes-cursor"
      @click="reorderRulesClick"
    >
      <div class="left"><i class="el-icon-refresh"></i></div>
      <div class="right">
        <div class="right-label">{{ (countObject?.reorderRule ?? 0) }}</div>
        <div class="right-label">{{ countObject?.reorderRule ?? 0 }}</div>
        <div class="right-label">重订货规则</div>
      </div>
    </div>
    <div v-if="showProduct" class="sub-number left_border yes-cursor" @click="productClick">
      <div class="left"><i class="el-icon-s-fold"></i></div>
      <div class="right">
        <div class="right-label">{{ (countObject?.product ?? 0) }}</div>
        <div class="right-label">{{ countObject?.product ?? 0 }}</div>
        <div class="right-label">产品</div>
      </div>
    </div>
    <div v-if="!showWarehouse" class="sub-number left_border no-cursor">
    <div v-if="!showWarehouse" class="sub-number left_border yes-cursor" @click="listingRulesClick">
      <div class="left"><i class="el-icon-refresh"></i></div>
      <div class="right">
        <div class="right-one">上架规则</div>
@@ -153,6 +158,14 @@
    // 在库
    inLibraryClick(){
      this.$emit("inLibraryClick")
    },
    // 上架规则
    listingRulesClick() {
      this.$emit("listingRulesClick")
    },
    // 重订货规则
    reorderRulesClick() {
      this.$emit("reorderRulesClick")
    }
  }
}
src/components/makepager/SearchCommonView.vue
@@ -2,7 +2,9 @@
  <div class="search-list">
    <div class="search-top">
      <div class="left">
        <el-button v-if="showAdd" :disabled="isDisabled" type="primary" size="mini" @click="addBtn">{{ addTitle }}</el-button>
        <el-button v-if="showAdd" :disabled="isDisabled" type="primary" size="mini" @click="addBtn">{{
          addTitle
        }}</el-button>
        <el-button v-if="showDiscard" size="mini" @click="discardBtn" style="margin-left: 0px">{{ "取消" }}</el-button>
        <div class="download" @click="downloadClick" :style="{ cursor: showDownload ? 'pointer' : 'no-drop' }">
          <img src="@/assets/img/xiazai.png" style="width: 13px" />
@@ -49,19 +51,60 @@
            @change="searchClick"
            @clear="clearClick"
          >
            <template v-if="selectArr?.length > 0" slot="prepend">
              <div style="display: flex">
                <div v-for="(val, i) in selectArr" :key="i" class="pre-views">
                  <span style="margin-left: 5px">{{ val?.title ?? val }}</span>
                  <i @click="delSelectClick(val)" class="el-icon-close" style="margint: 0 5px"></i>
                </div>
              </div>
            </template>
            <i slot="suffix" class="el-icon-search" style="cursor: pointer" @click="searchClick"></i>
          </el-input>
        </template>
        <div class="search-Btn">
          <div class="common">
          <div v-if="showSreen" class="common no-cursor">
            <img src="@/assets/img/shaixuan.png" style="width: 10px" />
            <span>筛选</span>
          </div>
          <div class="common">
          <el-dropdown
            v-else
            style="
              cursor: pointer;
              font-weight: 500;
              font-size: 16px;
              line-height: 1;
              letter-spacing: 0.09px;
              color: #202224;
            "
            trigger="click"
            :hide-on-click="false"
            placement="bottom"
            @command="switchKeywords($event, selList)"
          >
            <div class="common yes-cursor">
              <img src="@/assets/img/shaixuan.png" style="width: 10px" />
              <span>筛选</span>
            </div>
            <el-dropdown-menu slot="dropdown">
              <el-dropdown-item
                v-for="(item, key) in screenArray"
                :key="key"
                :command="item.title"
                :class="{ selected: status == item.title }"
              >
                <div class="dropdown-view">
                  <i v-show="getClass(selList, item)" class="el-icon-check icon-view"></i>
                  {{ item.title }}
                </div>
              </el-dropdown-item>
            </el-dropdown-menu>
          </el-dropdown>
          <div class="common no-cursor">
            <i class="el-icon-s-fold"></i>
            <span>分组</span>
          </div>
          <div class="common">
          <div class="common no-cursor">
            <i class="el-icon-star-on"></i>
            <span>收藏</span>
          </div>
@@ -177,6 +220,18 @@
    inputName: {
      type: String,
      default: ""
    },
    showSreen: {
      type: Boolean,
      default: true
    },
    searchTaskMap: {
      type: Array,
      default: () => []
    },
    screenArray: {
      type: Array,
      default: () => []
    }
  },
  watch: {
@@ -184,11 +239,27 @@
      this.searchInput = val
    }
  },
  computed: {
    getClass() {
      return function (row, i) {
        return row.includes(i.title) ? "selected" : null
      }
    }
  },
  data() {
    return {
      searchInput: "",
      searchSelValue: this.searchSel
      searchSelValue: this.searchSel,
      status: "",
      selList: [],
      selectArr: []
    }
  },
  mounted() {
    this.searchTaskMap.forEach((ele) => {
      this.selList.push(ele.title)
    })
    this.selectArr = this.searchTaskMap
  },
  methods: {
    // 搜索
@@ -218,6 +289,31 @@
    // 模具-检查配置
    inspectionConfigClick() {
      this.$emit("inspectionConfigClick")
    },
    switchKeywords(command, item) {
      console.log("index", command, item)
      this.status = command
      const oldValue = item
      console.log(oldValue)
      this.selectArr = oldValue
      if (item.includes(command)) {
        oldValue.splice(
          oldValue.findIndex((e) => e === command),
          1
        )
      } else {
        oldValue.push(command)
      }
      this.$emit("switchKeywords", item)
    },
    // 删除筛选内容
    delSelectClick(item) {
      console.log(item)
      this.selectArr.splice(
        this.selectArr.findIndex((e) => e === item),
        1
      )
      this.$emit("delSelectClick", item)
    }
  }
}
@@ -301,7 +397,7 @@
      margin-right: 20px;
      margin-left: 20px;
      .el-icon-search {
        margin-top: 22px;
        margin-top: 10px;
      }
      .search-Btn {
        display: flex;
@@ -313,7 +409,16 @@
        .common {
          width: 50px;
          text-align: center;
          cursor: no-drop;
        }
      }
      .pre-views {
        border: 1px solid #c0c0c0;
        font-size: 12px;
        margin-right: 5px;
        border-radius: 3px;
        background: #f0f0f0;
        &:last-child {
          margin-right: 0px;
        }
      }
    }
@@ -323,6 +428,17 @@
  }
  .yellow {
    background: #e6a23c;
  }
}
.selected {
  color: #606266;
}
.dropdown-view {
  position: relative;
  .icon-view {
    position: absolute;
    left: -15px;
    top: 11px;
  }
}
@@ -343,7 +459,8 @@
      width: 130px;
    }
    .input-with-select .el-input-group__prepend {
      background-color: #da2323;
      padding: 0 10px;
      background-color: #ffffff;
    }
    // .el-input__suffix {
    //   // 处理前缀图标不垂直居中的问题
@@ -363,5 +480,8 @@
      padding-right: 20px;
    }
  }
  .el-dropdown-menu__item {
    padding-left: 20px;
  }
}
</style>
src/views/operate/orderPoint/index.vue
@@ -1,29 +1,55 @@
<template>
  <div class="rightContent">
    <div class="top">
      <SearchCommonView :add-title="addTitle" :show-discard="showDiscard" :show-apply="false" :placeholder="'请输入位置/产品'"
        :amount-view="false" @addCommonClick="addProductClick" @searchClick="getList"
        @discardBtnClick="discardBtnClick" />
      <SearchCommonView
        :add-title="addTitle"
        :show-discard="showDiscard"
        :show-apply="false"
        :placeholder="'请输入位置/产品'"
        :amount-view="false"
        :search-task-map="searchTaskMap"
        :show-sreen="false"
        :screen-array="screenArray"
        @addCommonClick="addProductClick"
        @searchClick="getList"
        @discardBtnClick="discardBtnClick"
        @delSelectClick="delSelectClick"
        @switchKeywords="switchKeywords"
      />
    </div>
    <div class="content_wrap">
      <div class="con_left">
          <p>位置</p>
          <div class="stash">
            <template>
              <el-tree :data="datas" :props="defaultProps" @node-click="handleNodeClick"></el-tree>
            <el-tree :data="datas" :props="defaultProps" @node-click="handleNodeClick">
              <span class="span-ellipsis" slot-scope="{ node }">
                <span :title="node.label">{{ node.label }}</span>
              </span>
            </el-tree>
            </template>
          </div>
      </div>
      <div class="list-view">
        <div class="table">
          <CommonFormTableView ref="tablelistRef" :isReorder="true" :product-table-list="tableList"
            @inputContent="inputContent" @selLocationClick="selLocationClick" @selProductClick="selProductClick"
            @tableRowClick="tableRowClick" @selRouteClick="selRouteClick">
          <CommonFormTableView
            ref="tablelistRef"
            :isReorder="true"
            :product-table-list="tableList"
            @inputContent="inputContent"
            @selLocationClick="selLocationClick"
            @selProductClick="selProductClick"
            @tableRowClick="tableRowClick"
            @selRouteClick="selRouteClick"
          >
            <template slot="tableButton">
              <el-table-column label="操作" width="180" align="center">
                <template slot-scope="scope">
                  <span v-if="scope.row.isEdit && scope.row.isView" @click.stop="handleOrderOnceClick(scope.row)"
                    class="yes-cursor">
                  <span
                    v-if="scope.row.isEdit && scope.row.isView"
                    @click.stop="handleOrderOnceClick(scope.row)"
                    class="yes-cursor"
                  >
                    <i class="el-icon-truck"></i>
                    <span>订购一次</span>
                  </span>
@@ -43,7 +69,13 @@
<script>
import CommonFormTableView from "@/components/makepager/CommonFormTableView"
import pageMixin from "@/components/makepager/pager/mixin/pageMixin"
import { getReorderRuleList, addReorderRule, updateReorderRule, orderAgain,getLocationList } from "@/api/product/reorderRules"
import {
  getReorderRuleList,
  addReorderRule,
  updateReorderRule,
  orderAgain,
  getLocationTreeList
} from "@/api/product/reorderRules"
import { currentTime } from "@/common/config/index"
export default {
  name: "ReorderRules",
@@ -54,44 +86,9 @@
  data() {
    return {
      datas:[],
      // datas: [{
      //     label: '一级 1',
      //     children: [{
      //       label: '二级 1-1',
      //       children: [{
      //         label: '三级 1-1-1'
      //       }]
      //     }]
      //   }, {
      //     label: '一级 2',
      //     children: [{
      //       label: '二级 2-1',
      //       children: [{
      //         label: '三级 2-1-1'
      //       }]
      //     }, {
      //       label: '二级 2-2',
      //       children: [{
      //         label: '三级 2-2-1'
      //       }]
      //     }]
      //   }, {
      //     label: '一级 3',
      //     children: [{
      //       label: '二级 3-1',
      //       children: [{
      //         label: '三级 3-1-1'
      //       }]
      //     }, {
      //       label: '二级 3-2',
      //       children: [{
      //         label: '三级 3-2-1'
      //       }]
      //     }]
      // }],
      defaultProps: {
        children: 'children',
        label: 'jointName'
        children: "children",
        label: "jointName"
      },
      addTitle: "新建",
      showDiscard: false,
@@ -109,11 +106,15 @@
      maxInventory: 0,
      orderNumber: 0,
      unit: "",
      reorderId: 0
      reorderId: 0,
      searchTaskMap: [],
      type: "bh",
      screenArray: [{ id: "0", type: "bh", title: "重新订购" }]
    }
  },
  created() {
    this.setTable()
    this.searchTaskMap = [{ id: "0", type: this.type, title: "重新订购" }]
    this.getData()
    this.getLocationList()
  },
@@ -137,14 +138,17 @@
      }
    },
    // 请求数据
    async getData() {
    async getData(data) {
      await getReorderRuleList({
        locationId: data?.id,
        type: this.type,
        keyWord: data?.jointName,
        page: this.pagerOptions.currPage,
        pageSize: this.pagerOptions.pageSize
      }).then((res) => {
        if (res.code === 200) {
          console.log(res)
          const list = res.data.map((item) => {
          const list = res.data?.map((item) => {
            let orderNum = 0
            if (parseFloat(item.minInventory) - parseFloat(item.prediction) > 0) {
              orderNum = this.caculateOrderNumber(
@@ -356,54 +360,31 @@
    },
    //树点击
    handleNodeClick(data) {
      console.log(data,"sss");
      getReorderRuleList({
        locationId:data.id,
        page:1,
        pageSize:15,
        type:"",
        keyWord:data.jointName,
      }).then((res)=>{
        console.log(res,"res999")
        if (res.code === 200) {
          console.log(res)
          const list = res.data.map((item) => {
            let orderNum = 0
            if (parseFloat(item.minInventory) - parseFloat(item.prediction) > 0) {
              orderNum = this.caculateOrderNumber(
                parseFloat(item.minInventory),
                parseFloat(item.maxInventory),
                parseFloat(item.prediction)
              )
            }
            return {
              ...item,
              productName: item.product.name,
              locationName: item.location.name,
              isSet: false,
              isEdit: true,
              editable: true,
              isOrder: true,
              isView: item?.minInventory - item?.prediction > 0 ? true : false,
              orderNumber: orderNum
            }
          })
          this.tableList.tableData = list || []
          this.tableData = list || []
          this.pagerOptions.totalCount = res.total
        }
      })
      console.log(data, "sss")
      this.getData(data)
    },
    async getLocationList(){
      await getLocationList({
        categoryId:"",
        keyWord:"",
        // page:1,
        // pageSize:,
      }).then((res)=>{
        this.datas=res.data
      await getLocationTreeList().then((res) => {
        this.datas = [
          {
            id: 0,
            jointName: "全部",
            children: []
          },
          ...res.data
        ]
        console.log(res,"res666")
      })
    },
    // 删除type
    delSelectClick() {
      this.type = ""
      this.getData()
    },
    switchKeywords(item) {
      console.log(item, "switchKeywords")
      this.type = item?.length > 0 ? "bh" : ""
      this.getData()
    }
  }
}
@@ -422,7 +403,10 @@
  display: flex;
  justify-content: space-between;
  .con_left {
    width: 200px;
      max-height: calc(100% - 40px);
      overflow: hidden;
      width: 190px;
      margin-right: 10px;
    .el-checkbox-group {
      width:100%;
      display: flex;
@@ -432,7 +416,7 @@
      display: flex;
      flex-direction: column;
      .el-tree{
        background-color: #E6ECF2;
          background-color: #e6ecf2;
      }
    }
  }
@@ -440,6 +424,12 @@
    flex: 1;
  }
}
  .span-ellipsis {
    width: 100%;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    font-size: 13px;
  }
}
</style>
src/views/overview/AddOverviewDialog.vue
@@ -365,8 +365,8 @@
    async getCompanyList() {
      await getCompanyList().then((res) => {
        console.log(res)
        if (res.data.code === 200) {
          this.companyOptions = res.data.data
        if (res.code === 200) {
          this.companyOptions = res.data
        }
      })
    },
@@ -391,9 +391,9 @@
        page: 0,
        pageSize: 0
      }).then((res) => {
        console.log(res.data.data)
        if (res.data.code === 200) {
          const list = res.data.data.map((item) => {
        console.log(res.data)
        if (res.code === 200) {
          const list = res.data.map((item) => {
            return {
              name: item.name,
              id: item.id
src/views/overview/OverviewListView.vue
@@ -8,8 +8,10 @@
        :add-title="'新建'"
        :placeholder="'请输入单号/来源单据'"
        :amount-view="false"
        :search-task-map="searchTaskMap"
        @addCommonClick="addBtnClick"
        @searchClick="getList"
        @delSelectClick="delSelectClick"
      />
    </div>
    <div class="list-view">
@@ -79,7 +81,8 @@
      displayEdit: false,
      formLabel: "",
      toLabel: "",
      addName: ""
      addName: "",
      searchTaskMap: []
    }
  },
  created() {
@@ -95,6 +98,8 @@
      sessionStorage.setItem("paramsData", JSON.stringify(params))
    }
    this.params = params
    this.searchTaskMap =
      this.params.status > 0 ? [{ id: this.params.id, title: this.getStatus(this.params.status) }] : []
    this.getData()
    // console.log(this.$route.params.workType)
  },
@@ -275,7 +280,12 @@
    },
    // 状态
    getStatus(val) {
      return val === 1 ? "草稿" : val === 3 ? "就绪" : "完成"
      return val === 1 ? "草稿" : val === 3 ? "就绪" : val === 4 ? "完成" : ""
    },
    // 删除搜索状态
    delSelectClick() {
      this.params.status = 0
      this.getData()
    }
  }
}
src/views/overview/index.vue
@@ -99,15 +99,15 @@
        page: this.pagerOptions.currPage,
        pageSize: this.pagerOptions.pageSize
      }).then((res) => {
        console.log(res.data.data)
        if (res.data.code === 200) {
          const list = res.data.data.map((item) => {
        console.log(res.data)
        if (res.code === 200) {
          const list = res.data.map((item) => {
            return {
              ...item
            }
          })
          this.tableList = list || []
          this.pagerOptions.totalCount = res.data.total
          this.pagerOptions.totalCount = res.total
        }
      })
    },
src/views/productManage/product/AddProductDialog.vue
@@ -43,6 +43,8 @@
            :show-procure="showProcure"
            :countObject="statisticsMap"
            :show-sale="showSale"
            @listingRulesClick="listingRulesClick"
            @reorderRulesClick="reorderRulesClick"
          />
          <div class="bottom">
            <el-tabs v-model="activeName" type="card">
@@ -559,19 +561,21 @@
     * 非必填项后端返回的是数字 0,表单需要空串才能视为未选择回显
     */
    setOptionalFieldsToEmpty(){
      ['productType','categoryId']
          .filter(filed => this.editConfig.infomation[filed] === 0)
          .forEach(filed => {
            this.editConfig.infomation[filed] = ''
      let arr = ["productType", "categoryId"]
      arr
        .filter((filed) => this.editConfig.infomation[filed] === 0)
        .forEach((filed) => {
          this.editConfig.infomation[filed] = ""
          })
    },
    /**
     * 后端只接受数字形式, 保存时还得再转回去
     */
    unsetFieldsToNumber(){
      ['productType','categoryId']
          .filter(filed => this.editConfig.infomation[filed] === '')
          .forEach(filed => {
      let arr = ["productType", "categoryId"]
      arr
        .filter((filed) => this.editConfig.infomation[filed] === "")
        .forEach((filed) => {
            this.editConfig.infomation[filed] = 0
          })
    },
@@ -779,6 +783,34 @@
        })
      }
    },
    // 上架规则
    listingRulesClick() {
      this.$refs.form.validate((valid) => {
        if (valid) {
          this.$router.push({
            path: "/warehouseManage/listingRules",
            query: {
              productName: this.editConfig.infomation.name,
              productId: this.editConfig.title === "新建" ? "" : this.editConfig.infomation.id
            }
          })
        }
      })
    },
    // 重订购规则
    reorderRulesClick() {
      this.$refs.form.validate((valid) => {
        if (valid) {
          this.$router.push({
            path: "/productManage/reorderRules",
            query: {
              productName: this.editConfig.infomation.name,
              productId: this.editConfig.title === "新建" ? "" : this.editConfig.infomation.id
            }
          })
        }
      })
    },
    // 可销售/可采购
    checkboxChange(val, param) {
      if (val === "采购") {
src/views/productManage/product/index.vue
@@ -5,8 +5,10 @@
        :add-title="'新建'"
        :placeholder="'请输入产品名称'"
        :amount-view="false"
        :search-task-map="searchTaskMap"
        @addCommonClick="addBtnClick"
        @searchClick="searchClick"
        @delSelectClick="delSelectClick"
      />
    </div>
    <div class="list-view">
@@ -54,11 +56,7 @@
      </div>
      <!-- 列表形式 -->
      <div v-if="isIconIndex === '2'" class="product-list">
        <TableCommonView
          ref="tableListRef"
          :table-list="tableList"
          @selTableCol="selTableCol"
        >
        <TableCommonView ref="tableListRef" :table-list="tableList" @selTableCol="selTableCol">
          <template slot="tableButton">
            <el-table-column label="操作" width="90" align="center">
              <template slot-scope="scope">
@@ -114,15 +112,18 @@
      url: "https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg",
      pageSizes: [15, 30],
      keyWord: "",
      categoryId: null
      categoryId: null,
      searchTaskMap: []
    }
  },
  created() {
    this.setTable()
    let query = this.$route.query
    if (query) {
      console.log("ssssss")
      this.categoryId = query.id ? Number(query.id) : null
      this.pagerOptions.currPage = 1
      this.searchTaskMap = query.id ? [{ categoryId: this.categoryId, title: query.categoryName }] : []
    }
    this.getData()
  },
@@ -290,6 +291,11 @@
        this.pagerOptions.pageSize = 15
      }
      this.getData()
    },
    // 删除产品类型
    delSelectClick() {
      this.categoryId = 0
      this.getData()
    }
  }
}
src/views/productManage/productCategory/AddProductCategoryDialog.vue
@@ -38,7 +38,12 @@
        size="mini"
      >
        <div class="basic-info">
          <FormBtnsView :showProduct="true" :countObject="statisticsMap" @productClick="productClick" />
          <FormBtnsView
            :showProduct="true"
            :countObject="statisticsMap"
            @productClick="productClick"
            @listingRulesClick="listingRulesClick"
          />
          <div class="basic-info-view">
            <!-- <el-row> -->
            <!-- <el-col :span="24">
@@ -173,7 +178,7 @@
import { addProductCategory, updateProductCategory, deleteProductCategory } from "@/api/product/productCategory"
import { getDataByType } from "@/api/data"
import {getProductList} from "@/api/product/product";
import { getProductList } from "@/api/product/product"
export default {
  name: "AddProductCategoryDialog",
  props: {
@@ -184,7 +189,7 @@
          visible: false,
          title: "新建",
          infomation: { type: [] },
          autoEdit: false,
          autoEdit: false
        }
      }
    },
@@ -198,12 +203,12 @@
  components: {},
  computed: {
    modalTitle(){
      if (this.editConfig.title === '编辑' && this.editConfig.autoEdit){
        return '编辑'
      }else if (this.editConfig.title === '编辑') {
        return !this.showEdit ? '编辑' : '查看'
      if (this.editConfig.title === "编辑" && this.editConfig.autoEdit) {
        return "编辑"
      } else if (this.editConfig.title === "编辑") {
        return !this.showEdit ? "编辑" : "查看"
      }else {
        return '新建'
        return "新建"
      }
    }
  },
@@ -243,36 +248,40 @@
     * 非必填项后端返回的是数字 0,表单需要空串才能视为未选择回显
     */
    setOptionalFieldsToEmpty(){
      ['parentId','costingMethod','inventoryValuation','forceRemovalStrategy']
          .filter(filed => this.editConfig.infomation[filed] === 0)
          .forEach(filed => {
            this.editConfig.infomation[filed] = ''
      let arr = ["parentId", "costingMethod", "inventoryValuation", "forceRemovalStrategy"]
      arr
        .filter((filed) => this.editConfig.infomation[filed] === 0)
        .forEach((filed) => {
          this.editConfig.infomation[filed] = ""
          })
    },
    /**
     * 后端只接受数字形式, 保存时还得再转回去
     */
    unsetFieldsToNumber(){
      ['parentId','costingMethod','inventoryValuation','forceRemovalStrategy']
          .filter(filed => this.editConfig.infomation[filed] === '')
          .forEach(filed => {
      let arr = ["parentId", "costingMethod", "inventoryValuation", "forceRemovalStrategy"]
      arr
        .filter((filed) => this.editConfig.infomation[filed] === "")
        .forEach((filed) => {
            this.editConfig.infomation[filed] = 0
          })
    },
    // 获取产品数量
    getProductCount(){
      getProductList({
        keyWord: '',
        keyWord: "",
        categoryId: this.editConfig.title === "新建" ? null : this.editConfig.infomation.id,
        page: 1,
        pageSize: 1
      }).then((res) => {
      })
        .then((res) => {
        if (res.code === 200) {
          this.statisticsMap.product = res?.total ?? 0
        }else{
          this.statisticsMap.product = 0
        }
      }).catch(err=>{
        })
        .catch((err) => {
        console.error(err)
        this.statisticsMap.product = 0
      })
@@ -374,6 +383,20 @@
          })
        }
      })
    },
    // 上架规则
    listingRulesClick() {
      this.$refs.form.validate((valid) => {
        if (valid) {
          this.$router.push({
            path: "/warehouseManage/listingRules",
            query: {
              categoryName: this.editConfig.infomation.name,
              id: this.editConfig.title === "新建" ? "" : this.editConfig.infomation.id
            }
          })
        }
      })
    }
  }
}
src/views/productManage/reorderRules/index.vue
@@ -7,9 +7,11 @@
        :show-apply="false"
        :placeholder="'请输入位置/产品'"
        :amount-view="false"
        :search-task-map="searchTaskMap"
        @addCommonClick="addProductClick"
        @searchClick="getList"
        @discardBtnClick="discardBtnClick"
        @delSelectClick="delSelectClick"
      />
    </div>
    <div class="list-view">
@@ -76,11 +78,21 @@
      maxInventory: 0,
      orderNumber: 0,
      unit: "",
      reorderId: 0
      reorderId: 0,
      queryProductId: null,
      searchTaskMap: []
    }
  },
  created() {
    this.setTable()
    let query = this.$route.query
    if (query) {
      this.queryProductId = query.productId?.length ? query.productId : null
      this.pagerOptions.currPage = 1
      this.searchTaskMap =
        query.productId?.length > 0 ? [{ productId: this.queryProductId, title: query.productName }] : []
      console.log(this.searchTaskMap)
    }
    this.getData()
  },
  methods: {
@@ -105,6 +117,7 @@
    // 请求数据
    async getData() {
      await getReorderRuleList({
        productId: this.queryProductId ? this.queryProductId : null,
        page: this.pagerOptions.currPage,
        pageSize: this.pagerOptions.pageSize
      }).then((res) => {
@@ -319,6 +332,11 @@
    // 获取当前时间
    currentTime() {
      return currentTime()
    },
    // 删除产品
    delSelectClick() {
      this.queryProductId = ""
      this.getData()
    }
  }
}
src/views/reportForm/inventoryReport/index.vue
@@ -399,8 +399,8 @@
        page: this.pagerOptions.currPage,
        pageSize: this.pagerOptions.pageSize
      }).then((res) => {
        if (res.data.code === 200) {
          this.warehouseList = res.data.data
        if (res.code === 200) {
          this.warehouseList = res.data
        }
      })
    }
src/views/warehouseManage/bussinessType/AddBussinessType.vue
@@ -280,8 +280,8 @@
        page: 0,
        pageSize: 0
      }).then((res) => {
        if (res.data.code == 200) {
          this.warehouseList = res.data.data ? res.data.data : []
        if (res.code == 200) {
          this.warehouseList = res.data ? res.data : []
        }
      })
    },
src/views/warehouseManage/bussinessType/index.vue
@@ -108,10 +108,10 @@
        page: this.pagerOptions.currPage,
        pageSize: this.pagerOptions.pageSize
      }).then((res) => {
        if (res.data.code === 200) {
          const list = res.data.data
        if (res.code === 200) {
          const list = res.data
          this.tableList.tableInfomation = list || []
          this.pagerOptions.totalCount = res.data.data.total
          this.pagerOptions.totalCount = res.total
        }
      })
    },
src/views/warehouseManage/listingRules/index.vue
@@ -4,12 +4,14 @@
      <SearchCommonView
        :add-title="addTitle"
        :show-discard="showDiscard"
        :placeholder="'请输入位置/产品'"
        :placeholder="'请输入产品/产品类别'"
        :amount-view="false"
        :search-task-map="searchTaskMap"
        @addCommonClick="addProductClick"
        @searchClick="getList"
        @discardBtnClick="discardBtnClick"
        @applyBtnClick="applyBtnClick"
        @delSelectClick="delSelectClick"
      />
    </div>
    <div class="list-view">
@@ -94,10 +96,27 @@
      currentRowId: 0,
      rowIndex:-1,
      RuleType:0,
      queryProductId: null,
      categoryId: null,
      searchTaskMap: []
    }
  },
  created() {
    this.setTable()
    let query = this.$route.query
    if (query) {
      console.log("aaaaaaaaaaaaa", query)
      this.queryProductId = query.productId?.length ? query.productId : null
      this.categoryId = query.id ? Number(query.id) : null
      this.pagerOptions.currPage = 1
      this.searchTaskMap =
        query?.id > 0
          ? [{ categoryId: this.categoryId, title: query.categoryName }]
          : query.productId?.length > 0
          ? [{ productId: this.queryProductId, title: query.productName }]
          : []
      console.log(this.searchTaskMap)
    }
    this.getData()
  },
  methods: {
@@ -118,7 +137,8 @@
    // 请求数据
    async getData() {
      await getListingRulesList({
        // keyword: this.keyword,
        productId: this.queryProductId ? this.queryProductId : null,
        productCategoryId: this.categoryId ? this.categoryId : null,
        page: this.pagerOptions.currPage,
        pageSize: this.pagerOptions.pageSize
      }).then((res) => {
@@ -181,7 +201,7 @@
      } else {
        if (this.areaId === 0) {
          this.$message.error("请选择当前产品到达位置")
        } else if (this.productId === 0 && this.productCategoryId==='') {
        } else if (this.productId === 0 && this.productCategoryId === "") {
          this.$message.error("请选择产品或产品类别")
        } else if (this.subLocationId === 0) {
          this.$message.error("请选择存储到子位置")
@@ -204,8 +224,8 @@
              id: this.currentRowId,
              areaId: this.areaId,
              locationId: this.subLocationId,
              productCategoryId: this.productCategoryId||'',
              productId: this.productId||''
            productCategoryId: this.productCategoryId || "",
            productId: this.productId || ""
          }).then((res) => {
            console.log(res)
            if (res.code === 200) {
@@ -300,7 +320,10 @@
        this.subLocationId = row.locationId
        this.productCategoryId = row.productCategoryId
        this.productId = row.productId
        if(this.tableList.tableData[rowIndex].productName===""||this.tableList.tableData[rowIndex].productName===" "){
        if (
          this.tableList.tableData[rowIndex].productName === "" ||
          this.tableList.tableData[rowIndex].productName === " "
        ) {
          this.tableList.tableColumn[1].product=false
          this.tableList.tableColumn[2].productType=true
        }else{
@@ -356,8 +379,8 @@
        this.productCategoryId=item.value
      }else{
        this.tableList.tableColumn[1].product=false
        this.tableList.tableData[this.rowIndex].productName=' '
        this.productId=''
        this.tableList.tableData[this.rowIndex].productName = " "
        this.productId = ""
        this.productCategoryId=this.tableList.tableData[this.rowIndex].productCategoryId
      }
    },
@@ -370,6 +393,12 @@
          this.getData()
        }
      })
    },
    // 删除产品类型
    delSelectClick() {
      this.categoryId = 0
      this.queryProductId = ""
      this.getData()
    }
  },
  watch:{
src/views/warehouseManage/position/index.vue
@@ -5,32 +5,20 @@
        :add-title="'新建'"
        :placeholder="'请输入单号'"
        :amount-view="false"
        :search-task-map="searchTaskMap"
        @addCommonClick="addBtnClick"
        @searchClick="getList"
        @delSelectClick="delSelectClick"
      />
    </div>
    <div class="list-view">
      <div class="table">
        <TableCommonView
          ref="tableListRef"
          :table-list="tableList"
          :show-checkcol="false"
        >
        <TableCommonView ref="tableListRef" :table-list="tableList" :show-checkcol="false">
        <template slot="tableButton">
            <el-table-column label="操作" width="120" fixed="right">
              <template slot-scope="scope">
                <el-button
                  @click="tableRowClick(scope.row,'edit')"
                  type="text"
                  size="small"
                  >编辑</el-button
                >
                <el-button
                  type="text"
                  size="small"
                  @click="tableRowClick(scope.row,'look')"
                  >查看</el-button
                >
                <el-button @click="tableRowClick(scope.row, 'edit')" type="text" size="small">编辑</el-button>
                <el-button type="text" size="small" @click="tableRowClick(scope.row, 'look')">查看</el-button>
              </template>
            </el-table-column>
          </template>
@@ -70,11 +58,14 @@
        title: "新建",
        infomation: {}
      },
      positionTypeList: getDataByType("positionType")
      positionTypeList: getDataByType("positionType"),
      searchTaskMap: [],
      type: 3
    }
  },
  created() {
    this.setTable()
    this.searchTaskMap = [{ id: "3", title: "内部位置" }]
    this.getData()
  },
  methods: {
@@ -134,6 +125,7 @@
    // 请求数据
    async getData() {
      await getLocationList({
        type: this.type,
        keyword: this.keyword,
        page: this.pagerOptions.currPage,
        pageSize: this.pagerOptions.pageSize
@@ -157,9 +149,11 @@
    },
    // 行点击
    tableRowClick(row,val) {
      this.editConfig.title =  val=='look'?'查看':"编辑"
      this.editConfig.title = val == "look" ? "查看" : "编辑"
      this.editConfig.infomation = { ...row }
      this.editConfig.infomation.parentId = this.editConfig.infomation.parentId?Number(this.editConfig.infomation.parentId):null
      this.editConfig.infomation.parentId = this.editConfig.infomation.parentId
        ? Number(this.editConfig.infomation.parentId)
        : null
      this.editConfig.visible = true
    },
    // 新建
@@ -178,6 +172,11 @@
      }
      this.editConfig.visible = true
      this.editConfig.title = "新建"
    },
    // 删除位置
    delSelectClick() {
      this.type = 0
      this.getData()
    }
  }
}
src/views/warehouseManage/warehouse/index.vue
@@ -125,10 +125,10 @@
        page: this.pagerOptions.currPage,
        pageSize: this.pagerOptions.pageSize
      }).then((res) => {
        if (res.data.code == 200) {
          const list = res.data.data?res.data.data:[]
        if (res.code == 200) {
          const list = res.data?res.data:[]
          this.tableList.tableInfomation = list
          this.pagerOptions.totalCount = res.data.total
          this.pagerOptions.totalCount = res.total
        }
      })
    },