浏览代码

修改bug

Qukatie 2 年之前
父节点
当前提交
be0be6afd8

+ 42 - 35
src/api/basicData/purchaseOrder.js

@@ -11,7 +11,7 @@ export function customerList(data) {
 //采购资料列表查看明细
 export function detail(data) {
     return request({
-        url: '/api/trade-purchase/purchase-order/'+data,
+        url: '/api/trade-purchase/purchase-order/' + data,
         method: 'get'
     })
 }
@@ -29,7 +29,7 @@ export function deleteDetails(data) {
         url: '/api/trade-purchase/purchase-order/remove',
         method: 'post',
         params: {
-            ids:data
+            ids: data
         }
     })
 }
@@ -39,7 +39,7 @@ export function corpsattn(data) {
         url: '/api/trade-purchase/purchase-order/removeByItem',
         method: 'post',
         data: {
-            id:data
+            id: data
         }
     })
 }
@@ -49,7 +49,7 @@ export function corpsbank(data) {
         url: '/api/trade-purchase/purchase-order/removeByFiles',
         method: 'post',
         data: {
-            id:data
+            id: data
         }
     })
 }
@@ -59,7 +59,7 @@ export function corpsfiles(data) {
         url: '/api/blade-client/corpsfiles/update',
         method: 'post',
         data: {
-            id:data
+            id: data
         }
     })
 }
@@ -69,12 +69,12 @@ export function corpsitem(data) {
         url: '/api/trade-purchase/purchase-order/removeByFees',
         method: 'post',
         data: {
-            id:data
+            id: data
         }
     })
 }
 //查询采购类型主页下拉
-export function getDeptLazyTree(parentId){
+export function getDeptLazyTree(parentId) {
     return request({
         url: '/api/blade-client/corpstype/lazy-tree',
         method: 'get',
@@ -96,7 +96,7 @@ export const getDeptLazyTreeS = (parentId) => {
 //政策列表查看明细
 export function detailList(data) {
     return request({
-        url: '/api/blade-mocha-item/salespolicy/detail?id='+data,
+        url: '/api/blade-mocha-item/salespolicy/detail?id=' + data,
         method: 'get'
     })
 }
@@ -121,35 +121,35 @@ export function corpstypeTree() {
     })
 }
 // 获取系统编号
-export function getSysNo(prefix){
-  return request({
-    url: '/api/trade-purchase/purchase-order/getSysNo',
-    method: 'get',
-    params: {
-      prefix
-    }
-  })
+export function getSysNo(prefix) {
+    return request({
+        url: '/api/trade-purchase/purchase-order/getSysNo',
+        method: 'get',
+        params: {
+            prefix
+        }
+    })
 }
 //生成收货单
 export function generateShipment(data) {
-  return request({
-    url: '/api/blade-purchase-sales/order/deliverGoods',
-    method: 'post',
-    data:data
-  })
+    return request({
+        url: '/api/blade-purchase-sales/order/deliverGoods',
+        method: 'post',
+        data: data
+    })
 }
 
 // 获取销售订单明细
-export function getGNMarketDetailsList(current,size,params) {
-  return request({
-    url: '/api/blade-purchase-sales/order/orderItemsList',
-    method: 'get',
-    params: {
-      ...params,
-      current,
-      size,
-    }
-  })
+export function getGNMarketDetailsList(current, size, params) {
+    return request({
+        url: '/api/blade-purchase-sales/order/orderItemsList',
+        method: 'get',
+        params: {
+            ...params,
+            current,
+            size,
+        }
+    })
 }
 export function genfactory(data) {
     return request({
@@ -160,8 +160,15 @@ export function genfactory(data) {
 }
 export function getApplyAmount(query) {
     return request({
-      url: '/api/trade-finance/settlement/getApplyAmount',
-      method: 'get',
-      params: query
+        url: '/api/trade-finance/settlement/getApplyAmount',
+        method: 'get',
+        params: query
+    })
+}
+export const getStoragelist = (data) => {
+    return request({
+        url: '/api/blade-client/storagedesc/storage/list',
+        method: 'get',
+        params: data
     })
-  }
+}

+ 7 - 0
src/api/basicData/salesOrder.js

@@ -115,3 +115,10 @@ export function orderRemove(data) {
     }
   })
 }
+export const getStoragelist = (data) => {
+  return request({
+      url: '/api/blade-client/storagedesc/storage/list',
+      method: 'get',
+      params: data
+  })
+}

+ 10 - 7
src/views/exportTrade/customerInquiry/components/goodsInfo.vue

@@ -609,7 +609,8 @@ export default {
                     row.remarks = null;
                     row.exchangeRate = this.form.exchangeRate;
                     row.productRemark = e.ename;
-                    row.attributeList = this.getAttribute(e.goodsSpecificationList)
+                    row.attributeList = this.getAttribute(e.goodsSpecificationList);
+                    row.referrerReason = e.referrerReason
                 }
             })
         },
@@ -704,7 +705,8 @@ export default {
                     remarks: null,
                     exchangeRate: this.form.exchangeRate,
                     productRemark: e.ename,
-                    attributeList: this.getAttribute(e.goodsSpecificationList)
+                    attributeList: this.getAttribute(e.goodsSpecificationList),
+                    referrerReason:e.referrerReason
                 }
             });
             this.$refs.crud.rowAdd()
@@ -789,7 +791,7 @@ export default {
                     }
                 })
                 let num = 0;
-                num = divide(divide(numSum, this.form.totalValue,10), this.form.exchangeRate,10)
+                num = divide(divide(numSum, this.form.totalValue, 10), this.form.exchangeRate, 10)
                 this.$confirm("总运费:" + divide(numSum, this.form.exchangeRate) + ",单价分摊运费:" + num + ",是否继续更新?", {
                     confirmButtonText: "确定",
                     cancelButtonText: "取消",
@@ -822,7 +824,7 @@ export default {
                     }
                 })
                 let num = 0;
-                num = divide(numSum, this.form.totalValue,10)
+                num = divide(numSum, this.form.totalValue, 10)
                 this.$confirm("总运费:" + numSum + ",单价分摊运费:" + num + ",是否继续更新?", {
                     confirmButtonText: "确定",
                     cancelButtonText: "取消",
@@ -1160,7 +1162,7 @@ export default {
             const itemProp = row.itemProp ? row.itemProp : ''
             const partsDescribe = row.partsDescribe ? row.partsDescribe : ''
             const productRemark =
-                ename + "\n" + 
+                ename + "\n" +
                 itemDescription + "\n" +
                 itemProp + "\n" +
                 partsDescribe
@@ -1203,8 +1205,9 @@ export default {
             done()
         },
         handleRowUpdate(row, index, done, loading) {
-            this.data[index] = row
-            // this.$refs.crud.rowUpdate()
+            // this.data[index] = row
+            this.$set(this.data, index, row)
+            // this.$refs.crud.rowUpdate(row)
             loading()
             done()
         },

+ 5 - 4
src/views/exportTrade/salesContract/components/goodsInfo.vue

@@ -602,7 +602,8 @@ export default {
           row.remarks = null;
           row.exchangeRate = this.form.exchangeRate;
           row.productRemark = e.ename;
-          row.attributeList = this.getAttribute(e.goodsSpecificationList)
+          row.attributeList = this.getAttribute(e.goodsSpecificationList),
+          row.referrerReason = e.referrerReason
         }
       })
     },
@@ -701,7 +702,8 @@ export default {
           remarks: null,
           exchangeRate: this.form.exchangeRate,
           productRemark: e.ename,
-          attributeList: this.getAttribute(e.goodsSpecificationList)
+          attributeList: this.getAttribute(e.goodsSpecificationList),
+          referrerReason:e.referrerReason
         }
       });
       this.$refs.crud.rowAdd()
@@ -1186,8 +1188,7 @@ export default {
       done()
     },
     handleRowUpdate(row, index, done, loading) {
-      this.data[index] = row
-      // this.$refs.crud.rowUpdate()
+      this.$set(this.data,index,row)
       loading()
       done()
     },

+ 38 - 4
src/views/purchaseOrder/detailsPage.vue

@@ -36,10 +36,17 @@
             <crop-select v-model="form.corpId" corpType="GYS" :disabled="detailData.status == 1"
               @getCorpData="getCorpData"></crop-select>
           </template>
+               <template slot="storageId">
+                      <el-select v-model="form.storageId" placeholder="请选择" size="small" filterable @change="storageChange"
+                        :disabled="detailData.status == 1 || data.length > 0">
+                        <el-option v-for="item in storageoptions" :key="item.id" :label="item.cname" :value="item.id">
+                        </el-option>
+                      </el-select>
+                    </template>
         </avue-form>
       </trade-card>
       <trade-card title="商品信息" v-loading="loadingBtn">
-        <avue-form ref="form" class="trading-form" v-model="form" :option="option2">
+        <avue-form class="trading-form" v-model="form" :option="option2">
           <template slot="thisUsedProfit">
             <el-input-number v-model="form.thisUsedProfit" :disabled="detailData.status == 1" @change="amountChange"
               placeholder="请输入" size="small" :controls="false" style="width:100%;"></el-input-number>
@@ -121,7 +128,7 @@
 
 <script>
 import { optionList } from "./js/optionList";
-import { getDetails, submit, getCorpDetails, remove, getAllgoods, save, fixSave, revoke, collectPayment } from "@/api/basicData/salesOrder";
+import { getDetails, submit, getCorpDetails, remove, getAllgoods, save, fixSave, revoke, collectPayment, getStoragelist } from "@/api/basicData/salesOrder";
 import feeInfo from "./components/feeInfo.vue";
 import reportDialog from "@/components/report-dialog/main";
 import { multiply, sum, subtract } from "@/util/calculate";
@@ -195,13 +202,25 @@ export default {
             valueFormat: "yyyy-MM-dd 00:00:00",
             span: 8,
           },
+                {
+                      label: "仓库",
+                      prop: "storageId",
+                      rules: [
+                        {
+                          required: true,
+                          message: "",
+                          trigger: "blur"
+                        }
+                      ],
+                      span: 8,
+                    },
           {
             label: "备注",
             prop: "orderRemark",
             placeholder: "打印时显示",
             type: "textarea",
             minRows: 3,
-            span: 24,
+            span: 16,
           }
         ]
       },
@@ -414,6 +433,10 @@ export default {
       this.getWorkDicts("unit").then(res => {
         this.findObject(this.optionList.column, "unit").dicData = res.data.data;
       });
+      getStoragelist().then(res => {
+        this.storageoptions = res.data;
+        this.findObject(this.optionList.column, "storageId").dicData = res.data;
+      })
       this.$refs.crud.init();
     },
     cellStyle() {
@@ -488,13 +511,24 @@ export default {
         this.findObject(this.option.column, "arrivalAddress").dicData = []
       }
     },
+       storageChange(row) {
+          // console.log(row)
+
+        },
     getAddress(row) {
       getCorpDetails({ id: row.corpId }).then(res => {
         this.findObject(this.option.column, "arrivalAddress").dicData = res.data.data.corpsAddrList;
       })
     },
     addRow() {
-      this.data.push({ $cellEdit: true })
+            this.$refs["form"].validate((valid, done) => {
+              done();
+              if (valid) {
+                this.data.push({ $cellEdit: true, storageId: this.form.storageId })
+              } else {
+                return false;
+              }
+            });
     },
     rowCell(row, index) {
       if (row.$cellEdit == true) {

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

@@ -57,7 +57,7 @@
 <script>
 import detailsPage from "./detailsPage";
 import { option } from "./js/optionList";
-import { getList, getCorpsAll, gainUser,getCorpType,getAllgoods } from "@/api/basicData/salesOrder";
+import { getList, getCorpsAll, gainUser,getCorpType} from "@/api/basicData/salesOrder";
 export default {
   name: "index",
   data() {
@@ -174,9 +174,6 @@ export default {
       getCorpType({ corpType: 'GYS' }).then(res => {
         this.findObject(this.option.column, "corpType").dicData= res.data.data
       });
-      getAllgoods().then(res => {
-        this.findObject(this.option.column, "cname").dicData= res.data.data
-      });
       this.$refs.crud.init();
     },
     searchCriteriaSwitch(type) {

+ 5 - 18
src/views/purchaseOrder/js/optionList.js

@@ -36,7 +36,7 @@ export const option = {
     {
       label: "电话",
       prop: "corpTel",
-      search: true,
+      // search: true,
       overHidden: true,
       index: 3
     },
@@ -57,21 +57,21 @@ export const option = {
       label: "已送货",
       prop: "deliveringAmount",
       overHidden: true,
-      search: true,
+      // search: true,
       index: 6
     },
     {
       label: "未付款",
       prop: "balanceAmount",
       overHidden: true,
-      search: true,
+      // search: true,
       index: 7
     },
     {
       label: "已付款",
       prop: "settlmentAmount",
       overHidden: true,
-      search: true,
+      // search: true,
       index: 8
     },
     {
@@ -84,23 +84,10 @@ export const option = {
       label: "送货状态",
       prop: "status",
       type: 'select',
-      search: true,
+      // search: true,
       index: 10
     },
     {
-      label: "产品",
-      prop: "cname",
-      type: "select",
-      dicData: [],
-      search: true,
-      filterable:true,
-      props: {
-        label: "cname",
-        value: "cname"
-      },
-      index: 11
-    },
-    {
       label: "供应商分类",
       prop: "corpType",
       type: "tree",

+ 43 - 17
src/views/salesOrder/detailsPage.vue

@@ -37,10 +37,17 @@
             <crop-select v-model="form.corpId" corpType="KH" :disabled="detailData.status == 1"
               @getCorpData="getCorpData"></crop-select>
           </template>
+          <template slot="storageId">
+            <el-select v-model="form.storageId" placeholder="请选择" size="small" filterable @change="storageChange"
+              :disabled="detailData.status == 1 || data.length > 0">
+              <el-option v-for="item in storageoptions" :key="item.id" :label="item.cname" :value="item.id">
+              </el-option>
+            </el-select>
+          </template>
         </avue-form>
       </trade-card>
       <trade-card title="商品信息" v-loading="loadingBtn">
-        <avue-form ref="form" class="trading-form" v-model="form" :option="option2">
+        <avue-form class="trading-form" v-model="form" :option="option2">
           <template slot="thisUsedProfit">
             <el-input-number v-model="form.thisUsedProfit" :disabled="detailData.status == 1" @change="amountChange"
               placeholder="请输入" size="small" :controls="false" style="width:100%;"></el-input-number>
@@ -123,10 +130,11 @@
 
 <script>
 import { optionList } from "./js/optionList";
-import { getDetails, submit, getCorpDetails, remove, getAllgoods, save, fixSave, revoke, collectPayment } from "@/api/basicData/salesOrder";
+import { getDetails, submit, getCorpDetails, remove, getAllgoods, save, fixSave, revoke, collectPayment, getStoragelist } from "@/api/basicData/salesOrder";
 import feeInfo from "./components/feeInfo.vue";
 import reportDialog from "@/components/report-dialog/main";
 import { multiply, sum, subtract } from "@/util/calculate";
+import { fdatasync } from "fs";
 export default {
   name: "index",
   data() {
@@ -198,12 +206,24 @@ export default {
             span: 8,
           },
           {
+            label: "仓库",
+            prop: "storageId",
+            rules: [
+              {
+                required: true,
+                message: "",
+                trigger: "blur"
+              }
+            ],
+            span: 8,
+          },
+          {
             label: "备注",
             prop: "orderRemark",
             placeholder: "打印时显示",
             type: "textarea",
             minRows: 3,
-            span: 24,
+            span: 16,
           }
         ]
       },
@@ -376,7 +396,8 @@ export default {
       optionList: {},
       goodsoptions: [],
       settlementList: [],
-      orderFilesList: []
+      orderFilesList: [],
+      storageoptions: []
     };
   },
   props: {
@@ -416,6 +437,10 @@ export default {
       this.getWorkDicts("unit").then(res => {
         this.findObject(this.optionList.column, "unit").dicData = res.data.data;
       });
+      getStoragelist().then(res => {
+        this.storageoptions = res.data;
+        this.findObject(this.optionList.column, "storageId").dicData = res.data;
+      })
       this.$refs.crud.init();
     },
     cellStyle() {
@@ -481,23 +506,34 @@ export default {
     getCorpData(row) {
       if (row) {
         this.form.corpsName = row.cname
-        this.form.corpTel=row.tel
+        this.form.corpTel = row.tel
         getCorpDetails({ id: row.id }).then(res => {
           this.findObject(this.option.column, "arrivalAddress").dicData = res.data.data.corpsAddrList;
         })
       } else {
         this.form.corpsName = null
-        this.form.corpTel=null
+        this.form.corpTel = null
         this.findObject(this.option.column, "arrivalAddress").dicData = []
       }
     },
+    storageChange(row) {
+      // console.log(row)
+
+    },
     getAddress(row) {
       getCorpDetails({ id: row.corpId }).then(res => {
         this.findObject(this.option.column, "arrivalAddress").dicData = res.data.data.corpsAddrList;
       })
     },
     addRow() {
-      this.data.push({ $cellEdit: true })
+      this.$refs["form"].validate((valid, done) => {
+        done();
+        if (valid) {
+          this.data.push({ $cellEdit: true, storageId: this.form.storageId })
+        } else {
+          return false;
+        }
+      });
     },
     rowCell(row, index) {
       if (row.$cellEdit == true) {
@@ -697,16 +733,6 @@ export default {
       this.$emit("goBack");
     }
   },
-  watch: {
-    // data: function (rows) {
-    //   let val = 0
-    //   rows.forEach(e => {
-    //     val = sum(val, e.amount)
-    //     this.form.purchaseAmount = val
-    //     this.form.orderAmount = subtract(this.form.purchaseAmount, this.form.thisUsedProfit)
-    //   })
-    // }
-  }
 };
 </script>
 

+ 1 - 4
src/views/salesOrder/index.vue

@@ -57,7 +57,7 @@
 <script>
 import detailsPage from "./detailsPage";
 import { option } from "./js/optionList";
-import { getList, getCorpsAll, gainUser, getCorpType, getAllgoods, orderRemove } from "@/api/basicData/salesOrder";
+import { getList, getCorpsAll, gainUser, getCorpType, orderRemove } from "@/api/basicData/salesOrder";
 export default {
   name: "index",
   data() {
@@ -174,9 +174,6 @@ export default {
       getCorpType({ corpType: 'KH' }).then(res => {
         this.findObject(this.option.column, "corpType").dicData = res.data.data
       });
-      getAllgoods().then(res => {
-        this.findObject(this.option.column, "cname").dicData = res.data.data
-      });
       this.$refs.crud.init();
     },
     searchCriteriaSwitch(type) {

+ 21 - 23
src/views/salesOrder/js/optionList.js

@@ -35,7 +35,7 @@ export const option = {
     {
       label: "电话",
       prop: "corpTel",
-      search: true,
+      // search: true,
       overHidden: true,
       index: 3
     },
@@ -56,21 +56,21 @@ export const option = {
       label: "已送货",
       prop: "deliveringAmount",
       overHidden: true,
-      search: true,
+      // search: true,
       index: 6
     },
     {
       label: "未收款",
       prop: "balanceAmount",
       overHidden: true,
-      search: true,
+      // search: true,
       index: 7
     },
     {
       label: "已收款",
       prop: "settlmentAmount",
       overHidden: true,
-      search: true,
+      // search: true,
       index: 8
     },
     {
@@ -83,28 +83,15 @@ export const option = {
       label: "送货状态",
       prop: "status",
       type: 'select',
-      search: true,
+      // search: true,
       index: 10
     },
     {
-      label: "产品",
-      prop: "cname",
-      type: "select",
-      dicData: [],
-      search: true,
-      filterable:true,
-      props: {
-        label: "cname",
-        value: "cname"
-      },
-      index: 11
-    },
-    {
       label: "客户分类",
       prop: "corpType",
       type: "tree",
       dicData: [],
-      filterable:true,
+      filterable: true,
       props: {
         label: "title",
         value: "id"
@@ -118,7 +105,7 @@ export const option = {
       label: "制单人",
       prop: "createUser",
       type: "select",
-      filterable:true,
+      filterable: true,
       props: {
         label: "name",
         value: "id"
@@ -166,7 +153,7 @@ export const optionList = {
     {
       label: "产品",
       prop: "cname",
-      width:'250px',
+      width: '250px',
       overHidden: true
     },
     {
@@ -175,6 +162,17 @@ export const optionList = {
       overHidden: true
     },
     {
+      label: "仓库",
+      prop: "storageId",
+      overHidden: true,
+      type: "select",
+      props: {
+        label: "cname",
+        value: "id"
+      },
+      dicData: []
+    },
+    {
       label: "数量",
       prop: "storageInQuantity",
       overHidden: true
@@ -187,7 +185,7 @@ export const optionList = {
         label: "dictValue",
         value: "dictValue"
       },
-      dicData:[],
+      dicData: [],
       cell: true,
       overHidden: true
     },
@@ -262,7 +260,7 @@ export const feeOption = {
         label: "dictValue",
         value: "dictValue"
       },
-      dicData:[],
+      dicData: [],
       cell: true,
       overHidden: true
     },

+ 19 - 1
src/views/statisticAnalysis/salesProfit/index.vue

@@ -57,6 +57,9 @@
         <template slot-scope="{ row }" slot="purchasePrice">
           <span>{{ row.purchasePrice | decimalFormat }}</span>
         </template>
+        <template slot-scope="{ row }" slot="outFactoryPrice">
+          <span>{{ row.outFactoryPrice | decimalFormat }}</span>
+        </template>
         <template slot-scope="{ row }" slot="amount">
           <span>{{ row.amount | decimalFormat }}</span>
         </template>
@@ -208,6 +211,12 @@ export default {
             width: 100
           },
           {
+            label: "出厂金额",
+            prop: "outFactoryPrice",
+            overHidden: true,
+            width: 100
+          },
+          {
             label: "销售金额",
             prop: "amount",
             overHidden: true,
@@ -448,7 +457,8 @@ export default {
             item.property == "grossProfit" ||
             item.property == "fd" ||
             item.property == "fc" ||
-            item.property == "singleTicketMargin"
+            item.property == "singleTicketMargin"||
+            item.property == "outFactoryPrice"
           ) {
             let amountSum = 0;
             let purchaseAmountSum = 0;
@@ -456,6 +466,7 @@ export default {
             let fdSum = 0;
             let fcSum = 0;
             let singleTicketMarginSum = 0;
+            let outFactoryPriceSum=0
             data.forEach(e => {
               amountSum = _.add(amountSum, Number(e.amount));
               purchaseAmountSum = _.add(
@@ -469,6 +480,10 @@ export default {
                 singleTicketMarginSum,
                 Number(e.singleTicketMargin)
               );
+              outFactoryPriceSum= _.add(
+                outFactoryPriceSum,
+                Number(e.outFactoryPrice)
+              );
             });
             //入库金额总计
             if (item.property == "purchasePrice") {
@@ -489,6 +504,9 @@ export default {
             if (item.property == "singleTicketMargin") {
               sums[index] = micrometerFormat(singleTicketMarginSum);
             }
+            if (item.property == "outFactoryPrice") {
+              sums[index] = micrometerFormat(outFactoryPriceSum);
+            }
           }
         });
       }