瀏覽代碼

9.库存查询,修改重复明细信息提示信息
10.销售订单 撤销发货单的提示信息需要修改
11.用户管理 用户角色错误
12.明细信息为空时不可生成出库工单
13.库存查询列表,库存预警/是否上架值为空
14. 生成发货单的数量不能大于库存数

Qukatie 1 周之前
父節點
當前提交
c695fa3845

+ 68 - 0
src/api/reservoirArea/index.js

@@ -0,0 +1,68 @@
+import request from '@/router/axios';
+
+export const getWarehouseTree = (params) => {
+  return request({
+    url: '/api/gubersail-admin/storageDesc/listAll',
+    method: 'get',
+    params:params
+  })
+}
+
+export const getList = (current, size, params) => {
+  return request({
+    url: '/api/gubersail-admin/warehouse/list',
+    method: 'get',
+    params: {
+      ...params,
+      current,
+      size,
+    }
+  })
+}
+
+export const getwarehouseList = (tenantId) => {
+  return request({
+    url: '/api/gubersail-admin/warehouse/select',
+    method: 'get',
+    params: {
+      tenantId
+    }
+  })
+}
+
+export const getDetail = (id) => {
+  return request({
+    url: '/api/gubersail-admin/warehouse/detail',
+    method: 'get',
+    params: {
+      id
+    }
+  })
+}
+
+export const remove = (ids) => {
+  return request({
+    url: '/api/gubersail-admin/warehouse/remove',
+    method: 'post',
+    params: {
+      ids,
+    }
+  })
+}
+
+export const add = (row) => {
+  return request({
+    url: '/api/gubersail-admin/warehouse/submit',
+    method: 'post',
+    data: row
+  })
+}
+
+export const update = (row) => {
+  return request({
+    url: '/api/gubersail-admin/warehouse/submit',
+    method: 'post',
+    data: row
+  })
+}
+

+ 1 - 1
src/permission.js

@@ -65,7 +65,7 @@ router.beforeEach((to, from, next) => {
             name: 'tagList'
           })
           if (tagList.filter(item => item.label == to.name).length > 1) {
-            return MessageBox.alert(`请关闭重复的${to.name}标签,否则无法进行操作!`,'警告', { type: 'error' });
+            return MessageBox.alert(`请关闭重复的${to.name}标签,否则无法进行操作!`,'提示', { type: 'warning' });
           }
         }
         next()

+ 14 - 0
src/router/views/index.js

@@ -497,6 +497,20 @@ export default [
         }]
     },
     {
+        path: '/reservoirArea/index',
+        component: Layout,
+        hidden: true,
+        children: [{
+            path: '/reservoirArea/index',
+            name: '库区管理',
+            meta: {
+                i18n: '/reservoirArea/index',
+                keepAlive: true,
+            },
+            component: () => import( /* webpackChunkName: "views" */ '@/views/reservoirArea/index.vue')
+        }]
+    },
+    {
         path: '/store/index',
         component: Layout,
         hidden: true,

+ 5 - 11
src/views/inventory/index.vue

@@ -102,7 +102,7 @@ export default {
       treeData: [],
       loading: false,
       corpTypeVisible: false,
-      search: { whether: "0", ifGrounding: "1" },
+      search: { whether: "0", upAndDownShelves: 1 },
       form: {},
       dataList: [],
       stockSum: {}, // 合计数据
@@ -291,12 +291,6 @@ export default {
             width: 100,
           },
           {
-            label: "库存预警",
-            prop: "inventoryAlert",
-            overHidden: true,
-            width: 100,
-          },
-          {
             label: "是否显示零库存",
             prop: "whether",
             overHidden: true,
@@ -320,21 +314,21 @@ export default {
           },
           {
             label: "是否上架",
-            prop: "ifGrounding",
+            prop: "upAndDownShelves",
             overHidden: true,
             search: true,
             type: "select",
             dicData: [
               {
                 label: "未上架",
-                value: "0",
+                value: 0,
               },
               {
                 label: "已上架",
-                value: "1",
+                value: 1,
               },
             ],
-            searchValue: "1",
+            searchValue: 1,
           },
         ],
       },

+ 5 - 4
src/views/outboundWorkOrder/index.vue

@@ -154,10 +154,11 @@
           <template slot-scope="{ row, index }" slot="sendNum">
             <el-input-number
               v-model="row.sendNum"
-              placeholder="请输入发数量"
+              placeholder="请输入发数量"
               :controls="false"
               :precision="0"
               :min="0"
+              :max="Number(row.inventory)"
               size="small"
               style="width: 100%"
             ></el-input-number>
@@ -229,7 +230,7 @@ export default {
             overHidden: true,
           },
           {
-            label: "发货数",
+            label: "发货数",
             prop: "sendNum",
             width: 100,
             overHidden: true,
@@ -649,7 +650,7 @@ export default {
     },
     rowDel(form, index) {
       console.log(form);
-      this.$confirm("此操作将永久删除该行, 是否继续?", "提示", {
+      this.$confirm("是否撤销生成发货单?", "提示", {
         confirmButtonText: "确定",
         cancelButtonText: "取消",
         type: "warning",
@@ -658,7 +659,7 @@ export default {
           remove(form.id).then((res) => {
             this.$message({
               type: "success",
-              message: "删除成功!",
+              message: "操作成功!",
             });
             this.dataList.splice(index, 1);
             this.onLoad(this.page);

+ 272 - 0
src/views/reservoirArea/index.vue

@@ -0,0 +1,272 @@
+<template>
+  <basic-container>
+    <el-row>
+      <el-col :span="4">
+        <avue-tree style="height: 84vh;" ref="tree" :option="treeOption" :data="treeData" @node-click="nodeClick"> </avue-tree>
+      </el-col>
+      <el-col :span="20">
+        <avue-crud
+          :option="option"
+          :table-loading="loading"
+          :data="data"
+          :page.sync="page"
+          :permission="permissionList"
+          :before-open="beforeOpen"
+          v-model="form"
+          ref="crud"
+          @row-update="rowUpdate"
+          @row-save="rowSave"
+          @row-del="rowDel"
+          @search-change="searchChange"
+          @search-reset="searchReset"
+          @selection-change="selectionChange"
+          @current-change="currentChange"
+          @size-change="sizeChange"
+          @refresh-change="refreshChange"
+          @on-load="onLoad"
+        >
+        </avue-crud>
+      </el-col>
+    </el-row>
+  </basic-container>
+</template>
+
+<script>
+// @ts-nocheck
+import { getWarehouseTree, getList, getDetail, add, update, remove } from "@/api/reservoirArea/index.js";
+
+export default {
+  data() {
+    return {
+      storageId: null,
+      treeData: [],
+      treeOption: {
+        addBtn: false,
+        menu: false,
+        size: "small",
+        props: {
+          labelText: "仓库",
+          label: "cname",
+          value: "id",
+        },
+      },
+      form: {},
+      query: {},
+      loading: true,
+      page: {
+        pageSize: 10,
+        currentPage: 1,
+        total: 0,
+      },
+      selectionList: [],
+      option: {
+        height: "auto",
+        calcHeight: 30,
+        tip: false,
+        searchShow: true,
+        searchMenuSpan: 12,
+        border: true,
+        index: true,
+        viewBtn: false,
+        selection: true,
+        dialogClickModal: false,
+        column: [
+          {
+            label: "库区编码",
+            prop: "code",
+            search: true,
+            overHidden: true,
+            rules: [
+              {
+                required: true,
+                message: " ",
+                trigger: "blur",
+              },
+            ],
+          },
+          {
+            label: "库区名称",
+            prop: "cname",
+            search: true,
+            overHidden: true,
+            rules: [
+              {
+                required: true,
+                message: " ",
+                trigger: "blur",
+              },
+            ],
+          },
+          {
+            label: "备注",
+            prop: "remarks",
+            type: "textarea",
+            minRows: 3,
+            span: 24,
+            overHidden: true,
+          },
+        ],
+      },
+      data: [],
+    };
+  },
+  computed: {
+    ids() {
+      let ids = [];
+      this.selectionList.forEach((ele) => {
+        ids.push(ele.id);
+      });
+      return ids.join(",");
+    },
+  },
+  created() {
+    this.getTree();
+  },
+  methods: {
+    nodeClick(data) {
+      this.storageId = data.id;
+      this.onLoad(this.page, this.query);
+    },
+    getTree() {
+      getWarehouseTree()
+        .then((res) => {
+          this.treeData = res.data.data;
+        })
+        .finally(() => {
+          this.loading = false;
+        });
+    },
+    rowSave(row, done, loading) {
+      add(row)
+        .then(() => {
+          this.onLoad(this.page);
+          this.$message({
+            type: "success",
+            message: "操作成功!",
+          });
+          done();
+        })
+        .catch(() => {
+          loading();
+        });
+    },
+    rowUpdate(row, index, done, loading) {
+      update(row).then(
+        () => {
+          this.onLoad(this.page);
+          this.$message({
+            type: "success",
+            message: "操作成功!",
+          });
+          done();
+        },
+        (error) => {
+          window.console.log(error);
+          loading();
+        }
+      );
+    },
+    rowDel(row) {
+      this.$confirm("确定将选择数据删除?", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning",
+      })
+        .then(() => {
+          return remove(row.id);
+        })
+        .then(() => {
+          this.onLoad(this.page);
+          this.$message({
+            type: "success",
+            message: "操作成功!",
+          });
+        });
+    },
+    handleDelete() {
+      if (this.selectionList.length === 0) {
+        this.$message.warning("请选择至少一条数据");
+        return;
+      }
+      this.$confirm("确定将选择数据删除?", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning",
+      })
+        .then(() => {
+          return remove(this.ids);
+        })
+        .then(() => {
+          this.onLoad(this.page);
+          this.$message({
+            type: "success",
+            message: "操作成功!",
+          });
+          this.$refs.crud.toggleSelection();
+        });
+    },
+    beforeOpen(done, type) {
+      if (["add"].includes(type)) {
+        if (!this.storageId) {
+          return this.$message.error("请选择仓库");
+        }
+        this.form = {
+          storageId: this.storageId,
+        };
+      }
+      if (["edit", "view"].includes(type)) {
+        getDetail(this.form.id).then((res) => {
+          this.form = res.data.data;
+        });
+      }
+      done();
+    },
+    searchReset() {
+      this.storageId = null;
+      this.$refs.tree.setCurrentKey(null);
+      this.query = {};
+      this.onLoad(this.page);
+    },
+    searchChange(params, done) {
+      this.query = params;
+      this.page.currentPage = 1;
+      this.onLoad(this.page, params);
+      done();
+    },
+    selectionChange(list) {
+      this.selectionList = list;
+    },
+    selectionClear() {
+      this.selectionList = [];
+      this.$refs.crud.toggleSelection();
+    },
+    currentChange(currentPage) {
+      this.page.currentPage = currentPage;
+    },
+    sizeChange(pageSize) {
+      this.page.pageSize = pageSize;
+    },
+    refreshChange() {
+      this.onLoad(this.page, this.query);
+    },
+    onLoad(page, params = {}) {
+      this.loading = true;
+      let obj = {
+        ...Object.assign(params, this.query),
+        storageId: this.storageId,
+      };
+      getList(page.currentPage, page.pageSize, obj)
+        .then((res) => {
+          this.data = res.data.data.records;
+          this.page.total = res.data.data.total;
+          this.selectionClear();
+        })
+        .finally(() => {
+          this.loading = false;
+        });
+    },
+  },
+};
+</script>
+
+<style></style>

+ 18 - 1
src/views/saleOrder/detailsPage.vue

@@ -1929,7 +1929,7 @@ export default {
     },
     //生成退货单
     getReturns() {
-       this.$message.error("开发中");
+      this.$message.error("开发中");
       // this.$confirm("您确定要退货吗?", {
       //   confirmButtonText: "确定",
       //   cancelButtonText: "取消",
@@ -2362,6 +2362,23 @@ export default {
       });
     },
     orderConfirmation() {
+      if (this.form.orderItemsList.length == 0) {
+        this.$message.warning("请添加商品");
+        return;
+      }
+      for (let i in this.form.orderItemsList) {
+        this.form.orderItemsList[i].subTotalMoney = Number(
+          this.form.orderItemsList[i].goodsNum * this.form.orderItemsList[i].price
+        )
+          ? Number(this.form.orderItemsList[i].goodsNum * this.form.orderItemsList[i].price).toFixed(2)
+          : 0;
+        if (this.form.orderItemsList[i].goodsNum <= 0) {
+          return this.$message.warning(`销售明细序号${Number(i) + 1}的数量不能为零`);
+        }
+        if (!this.form.orderItemsList[i].sendNum) {
+          this.form.orderItemsList[i].sendNum = 0;
+        }
+      }
       let obj = {
         bsType: "XS",
         ...this.form,

+ 3 - 3
src/views/system/user.vue

@@ -565,9 +565,9 @@ export default {
                 props: {
                   label: "title"
                 },
-                // checkStrictly: true,
-                leafOnly: true,
-                slot: true,
+                checkStrictly: true,
+                // leafOnly: true,
+                // slot: true,
                 rules: [
                   {
                     required: true,

+ 4 - 13
src/views/warehouse/index.vue

@@ -18,8 +18,8 @@
       @on-load="onLoad"
       @tree-load="treeLoad"
     >
-      <template slot-scope="{ type, size, row, $index }" slot="menuLeft">
-        <el-button icon="el-icon-plus" type="primary" :size="size" @click="addRow">新增</el-button>
+      <template slot-scope="{ row, $index }" slot="menuLeft">
+        <el-button icon="el-icon-plus" type="primary" @click="addRow">新增</el-button>
       </template>
     </avue-crud>
   </basic-container>
@@ -34,9 +34,7 @@ export default {
     return {
       query: {},
       loading: false,
-      form: {
-        positioner: []
-      },
+      form: {},
       option: {
         addBtn: false,
         headerAlign: "center",
@@ -135,7 +133,6 @@ export default {
         total: 0,
         pageSizes: [10, 20, 30, 40, 50, 100, 200, 300, 400, 500]
       },
-      treeDeptId: "",
       corpTypeListCk: [],
       flag: false
     };
@@ -214,12 +211,6 @@ export default {
     },
     //新增按钮触发
     addRow(row) {
-      // @ts-ignore
-      getUser(JSON.parse(localStorage.getItem("saber-userInfo")).content.user_id).then(res => {
-        this.form.salesCompanyName = res.data.data.deptName;
-        this.form.salesCompanyId = res.data.data.deptId;
-      });
-      this.form.positioner = [];
       this.$refs.crud.rowAdd();
     },
     //新增子项和新增触发查询所有
@@ -227,7 +218,7 @@ export default {
       if (["add", "edit"].includes(type)) {
         this.option.column.forEach(e => {
           if (e.prop == "storageTypeId") {
-            this.$set(this.option.column, 3, { ...e, value: this.treeDeptId });
+            this.$set(this.option.column, 3, { ...e});
           }
         });
       }