Parcourir la source

国内贸易修改

lichao il y a 3 ans
Parent
commit
94c0b392b5

+ 13 - 0
src/api/basicData/inventoryAccount.js

@@ -44,3 +44,16 @@ export function selectJKGoodsNum(data) {
     params: data
   })
 }
+
+// 库存账查询锁定库存订单信息
+export const getStock = (current, size, params) => {
+  return request({
+    url: '/api/blade-purchase-sales/order/ListMessage',
+    method: 'get',
+    params: {
+      ...params,
+      current,
+      size,
+    }
+  })
+}

+ 8 - 0
src/api/maintenance/integral.js

@@ -27,3 +27,11 @@ export function integralDetail(data) {
     params: data
   })
 }
+// 积分主表新增修改
+export function updateList(data) {
+  return request({
+    url: '/api/blade-mocha-item/businesspoints/submit',
+    method: 'post',
+    data: data
+  })
+}

+ 8 - 0
src/enums/column-name.js

@@ -219,6 +219,14 @@ const columnName = [{
     code: 66,
     name: '利润分析'
   },
+  {
+    code: 67,
+    name: '内贸锁定明细'
+  },
+  {
+    code: 68,
+    name: '返利'
+  },
 ]
 export const getColumnName = (key) => {
   for (let index = 0; index < columnName.length; index++) {

+ 16 - 1
src/router/views/index.js

@@ -745,5 +745,20 @@ export default [{
         component: () =>
           import( /* webpackChunkName: "views" */ '@/views/work/process/leave/detail')
       }]
-    }
+    },
+  {
+    path: '/businessManagement/inventoryAccount/detail',
+    component: Layout,
+    hidden: true,
+    children: [
+      {
+        path: '/businessManagement/inventoryAccount/detail',
+        name: '锁定订单明细',
+        meta: {
+          keepAlive:true,
+        },
+        component: () => import( /* webpackChunkName: "views" */ '@/views/businessManagement/inventoryAccount/detail')
+      }
+    ]
+  },
 ]

+ 12 - 5
src/views/businessManagement/deliveryNotice/detailsPageEdit.vue

@@ -141,6 +141,7 @@
               @row-update="rowUpdate"
               @row-del="rowDel"
               @saveColumn="saveColumn('goods')"
+              @resetColumn="resetColumn"
               :cell-style="goodsRowClassName"
           >
             <template slot="code" slot-scope="{row,index}">
@@ -1834,11 +1835,6 @@ export default {
     },
     // 保存列设置
     async saveColumn(name) {
-      /**
-       * 已定义全局方法,直接使用,saveColumnData保存列数据方法,参数传值(表格名称,当前表格的option数据)
-       * 已定义全局方法,直接使用,getColumnName方法用来获取枚举值,参数根据自己定义的code值获取中文名
-       * 一定要执行异步操作,要等接口成功返回,才能执行下一行代码
-       */
       if (name == 'goods') {
         const inSave = await this.saveColumnData(
           this.getColumnName(21),
@@ -1861,6 +1857,17 @@ export default {
         }
       }
     },
+    async resetColumn() {
+      const inSave = await this.delColumnData(
+        this.getColumnName(21),
+        customerContact
+      );
+      if (inSave) {
+        this.$message.success("重置成功");
+        //关闭窗口
+        this.$refs.crud.$refs.dialogColumn.columnBox = false;
+      }
+    },
     // 商品表格加色
     goodsRowClassName({row, column, rowIndex, columnIndex}) {
       if (Number(row.actualQuantity) > Number(row.inventoryNumber) && column.property == 'inventoryNumber') {

+ 1 - 1
src/views/businessManagement/deliveryNotice/index.vue

@@ -402,13 +402,13 @@ export default {
       }
     },
     async resetColumn() {
+      this.option = option;
       const inSave = await this.delColumnData(
         this.getColumnName(20),
         option
       );
       if (inSave) {
         this.$message.success("重置成功");
-        this.option = option;
         //关闭窗口
         this.$refs.crud.$refs.dialogColumn.columnBox = false;
       }

+ 49 - 0
src/views/businessManagement/inventoryAccount/configuration/detail.json

@@ -0,0 +1,49 @@
+{
+  "searchShow": true,
+  "searchMenuSpan": 8,
+  "border": true,
+  "index": true,
+  "viewBtn": false,
+  "editBtn": false,
+  "delBtn": false,
+  "addBtn": false,
+  "align": "center",
+  "menuWidth": "120",
+  "menu": false,
+  "showSummary": true,
+  "searchIcon": true,
+  "searchIndex": 2,
+  "selection": true,
+  "tip":false,
+  "expand": false,
+  "expandWidth": 38,
+  "column": [
+    {
+      "label": "订单编号",
+      "prop": "orderNo",
+      "search": false,
+      "index": 1,
+      "minWidth": 80,
+      "overHidden": true,
+      "searchSpan": 8
+    },
+    {
+      "label": "订单日期",
+      "prop": "businesDate",
+      "search": false,
+      "index": 1,
+      "minWidth": 80,
+      "overHidden": true,
+      "searchSpan": 8
+    },
+    {
+      "label": "客户名称",
+      "prop": "corpsName",
+      "search": false,
+      "index": 1,
+      "minWidth": 80,
+      "overHidden": true,
+      "searchSpan": 8
+    }
+  ]
+}

+ 135 - 0
src/views/businessManagement/inventoryAccount/detail.vue

@@ -0,0 +1,135 @@
+<template>
+  <basic-container>
+    <avue-crud
+      ref="crud"
+      :data="dataList"
+      :option="option"
+      v-model="form"
+      :page.sync="page"
+      :search.sync="search"
+      :table-loading="loading"
+      @saveColumn="saveColumn"
+      @resetColumn="resetColumn"
+      @search-change="searchChange"
+      @current-change="currentChange"
+      @size-change="sizeChange"
+      @refresh-change="refreshChange"
+      @on-load="onLoad"
+    >
+      <template slot="orderNo" slot-scope="{ row, index }">
+        <span style="color: #409EFF;cursor: pointer" @click.stop="beforeOpenPage(row, index)">{{ row.orderNo }}</span>
+      </template>
+    </avue-crud>
+  </basic-container>
+</template>
+
+<script>
+import option from "./configuration/detail.json";
+import {getStock} from "@/api/basicData/inventoryAccount";
+
+export default {
+  name: "detail",
+  data() {
+    return {
+      option: {},
+      dataList: [],
+      form: {},
+      page: {
+        pageSize: 10,
+        pagerCount: 5,
+        total: 0,
+      },
+      search: {},
+      loading: false,
+      params: null,
+    }
+  },
+  async created() {
+    this.option = option
+    // this.option = await this.getColumnData(this.getColumnName(67), option);
+  },
+  activated() {
+    this.params = {
+      corpId: this.$route.query.corpId,
+      itemId: this.$route.query.itemId,
+    }
+    this.onLoad(this.page)
+  },
+  methods: {
+    onLoad(page, params) {
+      if (!this.params) return
+      params = {...params, ...this.params}
+      this.dataList.forEach(item => {
+        this.$refs.crud.toggleRowExpansion(item, false)
+      })
+      this.loading = true;
+      getStock(page.currentPage, page.pageSize, params)
+        .then(res => {
+          this.dataList = res.data.data.records ? res.data.data.records : [];
+          this.page.total = res.data.data.total;
+          if (this.page.total) {
+            this.option.height = window.innerHeight - 260;
+          }
+        })
+        .finally(() => {
+          this.loading = false;
+        });
+    },
+    searchChange(params, done) {
+      this.onLoad(this.page, params);
+      done();
+    },
+    currentChange(val) {
+      this.page.currentPage = val;
+    },
+    sizeChange(val) {
+      this.page.currentPage = 1;
+      this.page.pageSize = val;
+    },
+    refreshChange() {
+      this.dataList.forEach(item => {
+        this.$refs.crud.toggleRowExpansion(item, false)
+      })
+      this.page.currentPage = 1;
+      this.onLoad(this.page, this.search);
+    },
+    async saveColumn() {
+      const inSave = await this.saveColumnData(
+        this.getColumnName(67),
+        this.option
+      );
+      if (inSave) {
+        this.$message.success("保存成功");
+        //关闭窗口
+        this.$refs.crud.$refs.dialogColumn.columnBox = false;
+      }
+    },
+    async resetColumn() {
+      this.option = option;
+      const inSave = await this.delColumnData(
+        this.getColumnName(67),
+        option
+      );
+      if (inSave) {
+        this.$message.success("重置成功");
+        //关闭窗口
+        this.$refs.crud.$refs.dialogColumn.columnBox = false;
+      }
+    },
+    // 跳转
+    beforeOpenPage(row,index) {
+      this.$router.$avueRouter.closeTag("/businessManagement/salesOrder/index");
+      this.$router.push({
+        path: "/businessManagement/salesOrder/index",
+        query: {
+          id: row.id
+        },
+      });
+    },
+  },
+}
+</script>
+
+<style scoped>
+
+</style>

+ 56 - 32
src/views/businessManagement/inventoryAccount/index.vue

@@ -1,6 +1,7 @@
 <template>
-  <basic-container>
-    <avue-crud
+  <div>
+    <basic-container v-if="show">
+      <avue-crud
         ref="crud"
         :option="option"
         :data="data"
@@ -10,50 +11,55 @@
         :table-loading="loading"
         @on-load="onLoad"
         @row-update="rowUpdate">
-      <template slot-scope="{row,index}" slot="menu">
-        <el-button
+        <template slot-scope="scope" slot="lockingQuantity">
+          <span v-if="Number(scope.row.lockingQuantity) > 0" style="color: #409EFF;cursor: pointer" @click.stop="viewCell(scope.row,scope.index)">{{ scope.row.lockingQuantity }}</span>
+          <span v-else>{{ scope.row.lockingQuantity }}</span>
+        </template>
+        <template slot-scope="{row,index}" slot="menu">
+          <el-button
             type="text"
             size="small"
             @click="rowCell(row,index)"
-        >{{ row.$cellEdit ? '保存' : '修改' }}
-        </el-button>
-        <el-button
+          >{{ row.$cellEdit ? '保存' : '修改' }}
+          </el-button>
+          <el-button
             type="text"
             size="small"
             @click="deletePrice(row,index)"
-        >删除
-        </el-button>
-      </template>
-      <template slot="menuLeft">
-        <el-button
+          >删除
+          </el-button>
+        </template>
+        <template slot="menuLeft">
+          <el-button
             type="primary"
             size="small"
             icon="el-icon-plus"
             @click="excelBox = !excelBox"
-        >导入
-        </el-button>
-        <el-button
+          >导入
+          </el-button>
+          <el-button
             type="success"
             icon="el-icon-download"
             size="small"
             @click="derivation()"
-        >下载模板
-        </el-button>
-        <el-button
+          >下载模板
+          </el-button>
+          <el-button
             type="info"
             icon="el-icon-printer"
             size="small"
-        >报 表
-        </el-button>
-      </template>
-    </avue-crud>
-    <el-dialog title="导入价格"
-               append-to-body
-               :visible.sync="excelBox"
-               width="555px">
-      <avue-form :option="excelOption" v-model="excelForm" :upload-after="uploadAfter"/>
-    </el-dialog>
-  </basic-container>
+          >报 表
+          </el-button>
+        </template>
+      </avue-crud>
+      <el-dialog title="导入价格"
+                 append-to-body
+                 :visible.sync="excelBox"
+                 width="555px">
+        <avue-form :option="excelOption" v-model="excelForm" :upload-after="uploadAfter"/>
+      </el-dialog>
+    </basic-container>
+  </div>
 </template>
 <script>
 import option from "./configuration/mainList.json"
@@ -94,7 +100,12 @@ export default {
         pagerCount: 5,
         total: 0,
         pageSizes: [10,50,100,200,300]
-      }
+      },
+      show: true,
+      params: {
+        corpId: null,
+        itemId: null
+      },
     }
   },
   created() {
@@ -188,7 +199,6 @@ export default {
       })
     },
     rowUpdate(form, index, done) {
-      console.log(form)
       typeSave(form).then(res => {
         this.$message({type: "success", message: form.id ? "修改成功!" : "新增成功!"});
         // this.page.currentPage = 1;
@@ -197,7 +207,21 @@ export default {
         // this.backToList()
       })
       done()
-    }
+    },
+    // 查看
+    viewCell(row, index) {
+      this.params.corpId = row.corpId
+      this.params.itemId = row.goodsId
+      this.$router.$avueRouter.closeTag("/businessManagement/inventoryAccount/detail");
+      this.$router.push({
+        path: "/businessManagement/inventoryAccount/detail",
+        query: {
+          corpId: row.corpId,
+          itemId: row.goodsId
+        },
+      });
+      // this.show = false;
+    },
   }
 }
 </script>

+ 15 - 6
src/views/businessManagement/purchaseOrder/detailsPageEdit.vue

@@ -140,6 +140,7 @@
               @row-del="rowDel"
               @selection-change="productSelection"
               @saveColumn="saveColumn('goods')"
+              @resetColumn="resetColumn"
           >
             <template slot="cname" slot-scope="{ row }">
               <goods-select v-if="row.$cellEdit" v-model="row.cname" @getRow="getGoodsRow($event, row)"
@@ -737,6 +738,7 @@ export default {
           }, {
             label: '来源单号',
             prop: 'orgOrderNo',
+            disabled: true,
             rules: [
               {
                 required: false,
@@ -861,8 +863,8 @@ export default {
   methods: {
     // 明细查询
     queryData(id, isCopy = false) {
+      this.pageLoading = true
       detail(id).then(res => {
-        console.log(res.data.data)
         this.form = res.data.data;
         if (!this.form.itemsVOList) {
           this.contactsData = []
@@ -955,6 +957,7 @@ export default {
         }
       }).finally(() => {
         this.saveLoading = false
+        this.pageLoading = false
       });
     },
     copyOrder() {
@@ -1540,11 +1543,6 @@ export default {
     },
     // 保存列设置
     async saveColumn(name) {
-      /**
-       * 已定义全局方法,直接使用,saveColumnData保存列数据方法,参数传值(表格名称,当前表格的option数据)
-       * 已定义全局方法,直接使用,getColumnName方法用来获取枚举值,参数根据自己定义的code值获取中文名
-       * 一定要执行异步操作,要等接口成功返回,才能执行下一行代码
-       */
       if (name == 'goods') {
         const inSave = await this.saveColumnData(
           this.getColumnName(18),
@@ -1567,6 +1565,17 @@ export default {
         }
       }
     },
+    async resetColumn() {
+      const inSave = await this.delColumnData(
+        this.getColumnName(18),
+        customerContact
+      );
+      if (inSave) {
+        this.$message.success("重置成功");
+        //关闭窗口
+        this.$refs.crud.$refs.dialogColumn.columnBox = false;
+      }
+    },
     returnBack(row) {
       this.$set(this.form, 'paymentType', row.paymentType)
       this.$set(this.form, 'packageRemarks', row.packageRemarks)

+ 1 - 1
src/views/businessManagement/purchaseOrder/index.vue

@@ -392,13 +392,13 @@ export default {
       }
     },
     async resetColumn() {
+      this.option = option;
       const inSave = await this.delColumnData(
         this.getColumnName(17),
         option
       );
       if (inSave) {
         this.$message.success("重置成功");
-        this.option = option;
         //关闭窗口
         this.$refs.crud.$refs.dialogColumn.columnBox = false;
       }

+ 12 - 5
src/views/businessManagement/receipt/detailsPageEdit.vue

@@ -112,6 +112,7 @@
               @row-update="rowUpdate"
               @row-del="rowDel"
               @saveColumn="saveColumn('goods')"
+              @resetColumn="resetColumn"
           >
             <template slot="code" slot-scope="{row,index}">
               <el-button type="text" size="mini" style="padding:4px 10px;float:left" :disabled="detailData.seeDisabled || !row.$cellEdit" @click="commodityChoice(row)">选择</el-button>
@@ -1378,11 +1379,6 @@ export default {
     },
     // 保存列设置
     async saveColumn(name) {
-      /**
-       * 已定义全局方法,直接使用,saveColumnData保存列数据方法,参数传值(表格名称,当前表格的option数据)
-       * 已定义全局方法,直接使用,getColumnName方法用来获取枚举值,参数根据自己定义的code值获取中文名
-       * 一定要执行异步操作,要等接口成功返回,才能执行下一行代码
-       */
       if (name == 'goods') {
         const inSave = await this.saveColumnData(
           this.getColumnName(24),
@@ -1405,6 +1401,17 @@ export default {
         }
       }
     },
+    async resetColumn() {
+      const inSave = await this.delColumnData(
+        this.getColumnName(24),
+        customerContact
+      );
+      if (inSave) {
+        this.$message.success("重置成功");
+        //关闭窗口
+        this.$refs.crud.$refs.dialogColumn.columnBox = false;
+      }
+    },
   }
 }
 </script>

+ 1 - 1
src/views/businessManagement/receipt/index.vue

@@ -399,13 +399,13 @@ export default {
       }
     },
     async resetColumn() {
+      this.option = option;
       const inSave = await this.delColumnData(
         this.getColumnName(23),
         option
       );
       if (inSave) {
         this.$message.success("重置成功");
-        this.option = option;
         //关闭窗口
         this.$refs.crud.$refs.dialogColumn.columnBox = false;
       }

+ 17 - 15
src/views/businessManagement/salesOrder/detailsPageEdit.vue

@@ -208,6 +208,7 @@
               @selection-change="productSelection"
               @row-del="rowDel"
               @saveColumn="saveColumn('goods')"
+              @resetColumn="resetColumn"
               :summary-method="summaryMethod"
               :table-loading="goodsLoading"
           >
@@ -1520,6 +1521,8 @@ export default {
     this.$set(this.form, 'convertIntegral' , 0)
     this.$set(this.form, 'profit' , 0)
     this.$set(this.form, 'paymentType', '预付')
+    this.$set(this.form, 'thisUsedProfit' , 0)
+    this.$set(this.form, 'createProfit' , 0)
     let date = new Date();
     let year = date.getFullYear();
     let month = date.getMonth() + 1;
@@ -2658,9 +2661,17 @@ export default {
     editCustomer(isBack = false, type) {
       this.$refs["form"].validate((valid) => {
         if (valid) {
-          for (let item in this.contactsData) {
-            if (Number(this.contactsData[item].orderQuantity) < Number(this.contactsData[item].actualQuantity)) {
-              return this.$message.error('商品信息第'+ (parseInt(item) + 1) + '行订货数量不能小于发货数量')
+          //商品信息
+          if (this.goodsShowData.findIndex(item => item.goodType == 0) == -1) {
+            this.form.orderItemsList = this.goodsShowData.concat(this.contactsData)
+          } else {
+            this.form.orderItemsList = this.goodsShowData.concat(this.giftData)
+          }
+          // 判断是否能保存
+          let goodsData = this.goodsShowData.filter(item => item.goodType == 0)
+          for (let item in this.goodsData) {
+            if (Number(goodsData[item].orderQuantity) > Number(goodsData[item].storageQuantity)) {
+              return this.$message.error('商品信息第'+ (parseInt(item) + 1) + '行订货数量不能超过库存')
             }
           }
           this.form.orderFeesList = this.$refs.feeInfo.submitData()
@@ -2672,6 +2683,9 @@ export default {
           if (packFee == -1) {
             return this.$message.error('费用明细未有包装费')
           }
+          // 产生返利、本次使用返利为空 默认为0
+          this.form.createProfit = this.form.createProfit? this.form.createProfit: 0
+          this.form.thisUsedProfit = this.form.thisUsedProfit? this.form.thisUsedProfit: 0
           // 计算毛利额
           this.$set(this.form, 'orderAmount', 0)
           // 成本价
@@ -2679,12 +2693,6 @@ export default {
           if (this.form.orderAmount && this.form.settlmentAmount) {
             this.$set(this.form, "balanceAmount", (Number(this.form.orderAmount) - Number(this.form.settlmentAmount)).toFixed(2));
           }
-          //商品信息
-          if (this.goodsShowData.findIndex(item => item.goodType == 0) == -1) {
-            this.form.orderItemsList = this.goodsShowData.concat(this.contactsData)
-          } else {
-            this.form.orderItemsList = this.goodsShowData.concat(this.giftData)
-          }
           // 销售金额
           this.form.orderAmount = 0;
           // 计算销售金额
@@ -2867,11 +2875,6 @@ export default {
     },
     // 保存列设置
     async saveColumn(name) {
-      /**
-       * 已定义全局方法,直接使用,saveColumnData保存列数据方法,参数传值(表格名称,当前表格的option数据)
-       * 已定义全局方法,直接使用,getColumnName方法用来获取枚举值,参数根据自己定义的code值获取中文名
-       * 一定要执行异步操作,要等接口成功返回,才能执行下一行代码
-       */
       if (name == 'goods') {
         const inSave = await this.saveColumnData(
           this.getColumnName(15),
@@ -2901,7 +2904,6 @@ export default {
       );
       if (inSave) {
         this.$message.success("重置成功");
-        this.option = option;
         //关闭窗口
         this.$refs.crud.$refs.dialogColumn.columnBox = false;
       }

+ 17 - 9
src/views/businessManagement/salesOrder/index.vue

@@ -186,6 +186,12 @@ export default {
       }
     })
   },
+  activated() {
+    if (this.$route.query.id) {
+      this.isShow = true
+      this.beforeOpenPage({id: this.$route.query.id})
+    }
+  },
   methods: {
     tableRowClassName({row, column, rowIndex, columnIndex}) {
       if (row.orderStatus == '录入' && columnIndex == 19){
@@ -362,14 +368,10 @@ export default {
       }
     },
     onLoad(page, params) {
-      // if (this.search.businesDate && this.search.businesDate.length > 0) {
-      //   params = {
-      //     ...params,
-      //     orderStartDate: this.search.businesDate[0]+ " " + "00:00:00",
-      //     orderEndDate: this.search.businesDate[1]+ " " + "23:59:59",
-      //   }
-      //   delete params.businesDate;
-      // }
+      // 重置掉展开
+      this.dataList.forEach(item => {
+        this.$refs.crud.toggleRowExpansion(item, false)
+      })
       let data = this.gobackSearch(params)
 
       let queryParams = Object.assign({}, data, {
@@ -399,6 +401,12 @@ export default {
     },
     goBack() {
       this.detailData=this.$options.data().detailData
+      if (this.$route.query) {
+        this.$router.$avueRouter.closeTag();
+        this.$router.push({
+          path: "/businessManagement/salesOrder/index"
+        });
+      }
       this.dataList.forEach(item => {
         this.$refs.crud.toggleRowExpansion(item, false)
       })
@@ -452,13 +460,13 @@ export default {
       }
     },
     async resetColumn() {
+      this.option = option;
       const inSave = await this.delColumnData(
         this.getColumnName(14),
         option
       );
       if (inSave) {
         this.$message.success("重置成功");
-        this.option = option;
         //关闭窗口
         this.$refs.crud.$refs.dialogColumn.columnBox = false;
       }