Forráskód Böngészése

Merge branch 'dev' of git.echepei.com:caojunjie/Smart_platform_ui into dev

caojunjie 3 éve
szülő
commit
9a9119723f

+ 43 - 19
src/views/businessManagement/purchaseOrder/detailsPageEdit.vue

@@ -230,7 +230,7 @@
                          icon="el-icon-plus"
                          size="small"
                          :disabled="selection.length < 1 || detailData.seeDisabled"
-                         @click="getShipmentC">生成采购确认
+                         @click="getShipmentC">生成工厂发货
               </el-button>
               <el-button type="info" :size="size" icon="el-icon-printer" @click.stop="openReport()">报 表</el-button>
             </template>
@@ -1469,25 +1469,49 @@ export default {
         pageLabel:"付费申请",
         checkType: 'ffsq'
       }
+      this.contactsData.map(e => {
+        const form = {
+          belongCompany: this.form.belongCompany,
+          srcOrderno:this.form.orderNo,
+          itemType:"采购",
+          corpsName:this.form.corpsName,
+          corpId:this.form.corpId,
+          srcParentId: this.form.id,
+          currency: 'CNY',
+          exchangeRate: '1',
+          taxRate: '0',
+          accDate: this.form.businesDate,
+          srcType: 1, // 1.采购or销售主表货款申请 2. 采购or销售-费用明细申请  3.收发货-费用明细
+          tradeType: 'GN',
+          optionType: 'GN',
+          amount: e.amount,
+          goodName: e.cname,
+          price: e.price,
+          unit: e.unit,
+          quantity: e.orderQuantity,
+          costType: this.feesOption.find(e => e.cname == '货款')? this.feesOption.find(e => e.cname == '货款').id: null,
+        }
+        arr.push(form)
+      })
       //采购明细提单号 list
-      this.billData = {
-        belongCompany: this.form.belongCompany,
-        srcOrderno:this.form.orderNo,
-        itemType:"采购",
-        corpsName:this.form.corpsName,
-        corpId:this.form.corpId,
-        srcParentId: this.form.id,
-        currency: 'CNY',
-        exchangeRate: '1',
-        taxRate: '0',
-        accDate: this.form.businesDate,
-        srcType: 1, // 1.采购or销售主表货款申请 2. 采购or销售-费用明细申请  3.收发货-费用明细
-        tradeType: 'GN',
-        optionType: 'GN',
-        amount: this.form.orderAmount,
-        costType: this.feesOption.find(e => e.cname == '货款').id
-      }
-      arr.push(this.billData)
+      // this.billData = {
+      //   belongCompany: this.form.belongCompany,
+      //   srcOrderno:this.form.orderNo,
+      //   itemType:"采购",
+      //   corpsName:this.form.corpsName,
+      //   corpId:this.form.corpId,
+      //   srcParentId: this.form.id,
+      //   currency: 'CNY',
+      //   exchangeRate: '1',
+      //   taxRate: '0',
+      //   accDate: this.form.businesDate,
+      //   srcType: 1, // 1.采购or销售主表货款申请 2. 采购or销售-费用明细申请  3.收发货-费用明细
+      //   tradeType: 'GN',
+      //   optionType: 'GN',
+      //   amount: this.form.orderAmount,
+      //   costType: this.feesOption.find(e => e.cname == '货款')? this.feesOption.find(e => e.cname == '货款').id: null,
+      // }
+      // arr.push(this.billData)
       let getFeeList = this.$refs.feeInfo.submitData().filter(item => item.feesType == 2)
       getFeeList.forEach(item => {
         let form = {

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

@@ -125,6 +125,7 @@ import { defaultDate } from "@/util/date";
 import ApplyPayment from "@/components/finance/applyPayment";
 import financialAccount from "../../../components/finance/financialAccount";
 import { gainUser } from "@/api/basicData/customerInquiry";
+import { customerList as feeList } from "@/api/basicData/basicFeesDesc";
 
 export default {
   name: "customerInformation",
@@ -178,6 +179,7 @@ export default {
       applyPaymentDialog:false,//生成账单组件
       financialAccountDialog:false,
       applyPaymentList: [],
+      feesOption: [],
     }
   },
   async created() {
@@ -191,6 +193,9 @@ export default {
     gainUser().then(res => {
       this.findObject(this.option.column, "createUser").dicData = res.data.data;
     })
+    feeList().then(res => {
+      this.feesOption = res.data.data.records
+    })
     let i = 0;
     this.option.column.forEach(item => {
       if (item.search) i++
@@ -512,7 +517,8 @@ export default {
           accDate: item.businesDate,
           srcType: 1,
           tradeType: 'GN',
-          amount: item.orderAmount
+          amount: item.orderAmount,
+          costType: this.feesOption.find(e => e.cname == '货款')? this.feesOption.find(e => e.cname == '货款').id: null,
         }
         a.push(form)
       })

+ 12 - 0
src/views/businessManagement/salesOrder/configuration/commodity.json

@@ -93,6 +93,12 @@
       "overHidden": true
     },
     {
+      "label": "尺寸",
+      "prop": "size",
+      "slot": true,
+      "overHidden": true
+    },
+    {
       "label": "产品类别",
       "prop": "category",
       "slot": true,
@@ -111,6 +117,12 @@
       "overHidden": true
     },
     {
+      "label": "订货数量",
+      "prop": "orderQuantity",
+      "slot": true,
+      "overHidden": true
+    },
+    {
       "label": "商品图片",
       "prop": "url",
       "type": "upload",

+ 18 - 10
src/views/businessManagement/salesOrder/configuration/customerContact.json

@@ -139,10 +139,18 @@
           "trigger": "blur"
         }
       ]
+    },
+    {
+      "label": "尺寸",
+      "prop": "size",
+      "index": 5,
+      "width":150,
+      "cell": false,
+      "overHidden": true
     },{
       "label": "供应商",
       "prop": "corpName",
-      "index": 5,
+      "index": 6,
       "width":250,
       "cell": false,
       "slot": true,
@@ -157,7 +165,7 @@
     },{
       "label": "质量胎",
       "prop": "shopQuality",
-      "index": 6,
+      "index": 7,
       "width":140,
       "cell": false,
       "slot": true,
@@ -172,7 +180,7 @@
     },{
       "label": "订货数量",
       "prop": "orderQuantity",
-      "index": 7,
+      "index": 8,
       "width":100,
       "cell": false,
       "slot": true,
@@ -187,7 +195,7 @@
     },{
       "label": "发货数量",
       "prop": "actualQuantity",
-      "index": 8,
+      "index": 9,
       "width":100,
       "cell": false,
       "slot": true,
@@ -202,7 +210,7 @@
     },{
       "label": "库存",
       "prop": "storageQuantity",
-      "index": 9,
+      "index": 10,
       "width":100,
       "cell": false,
       "overHidden": true,
@@ -217,7 +225,7 @@
     {
       "label": "采购价格",
       "prop": "purchaseAmount",
-      "index": 10,
+      "index": 11,
       "width":100,
       "cell": false,
       "slot": true,
@@ -232,7 +240,7 @@
     },{
       "label": "最新单价",
       "prop": "price",
-      "index": 11,
+      "index": 12,
       "width":100,
       "cell": false,
       "slot": false,
@@ -247,7 +255,7 @@
     },{
       "label": "金额",
       "prop": "amount",
-      "index": 12,
+      "index": 13,
       "width":100,
       "cell": false,
       "overHidden": true,
@@ -262,7 +270,7 @@
     {
       "label": "积分倍数",
       "prop": "integralMultiples",
-      "index": 13,
+      "index": 14,
       "width":100,
       "cell": false,
       "overHidden": true,
@@ -277,7 +285,7 @@
     {
       "label": "赠送积分",
       "prop": "integral",
-      "index": 14,
+      "index": 15,
       "width":100,
       "cell": false,
       "overHidden": true,

+ 99 - 29
src/views/businessManagement/salesOrder/detailsPageEdit.vue

@@ -226,6 +226,9 @@
                 <el-input type="age" v-else-if="item.prop === 'specialOfferOf'" v-model.trim="form[item.prop]" size="small" autocomplete="off" placeholder="请输入" :disabled="detailData.seeDisabled || browse" v-input-limit="2">
                   <template slot="append">%</template>
                 </el-input>
+                <el-input type="age" v-else-if="item.prop === 'largeScale'" v-model.trim="form[item.prop]" size="small" autocomplete="off" placeholder="请输入" :disabled="detailData.seeDisabled || browse" v-input-limit="2">
+                  <template slot="append">%</template>
+                </el-input>
                 <el-input
                   v-else-if="item.type == 'number'"
                   placeholder="请输入"
@@ -394,7 +397,7 @@
                          size="small"
                          :disabled="selection.length < 1 || detailData.seeDisabled || !form.status || form.status < 3"
                          @click="getShipmentD"
-                         v-show="goodsActives == 'goods'">生成客户确认
+                         v-show="goodsActives == 'goods'">生成客户收货
               </el-button>
               <el-button type="info"
                          :size="size"
@@ -489,6 +492,16 @@
                   <el-tab-pane label="已选定数据" name="importStaging"/>
                 </el-tabs>
               </template>
+              <template slot="orderQuantity" slot-scope="{row, index}">
+                <el-input-number
+                  v-model="row.orderQuantity"
+                  size="small"
+                  :controls="false"
+                  :precision="0"
+                  @input="amountChange(row)"
+                  style="width: 100%"
+                />
+              </template>
               <template slot-scope="scope" slot="menu">
                 <el-button
                   type="text"
@@ -1189,7 +1202,11 @@ export default {
                 trigger: 'blur'
               }
             ]
-          },{
+          }, {
+            label: '大尺寸占比',
+            prop: 'largeScale',
+            disabled: false,
+          }, {
             label: '单据状态',
             prop: 'orderStatus',
             disabled: true,
@@ -1621,7 +1638,9 @@ export default {
     if (this.detailData.copyId) {
       this.queryData(this.detailData.copyId, true)
     }
-    this.oldForm = Object.assign({}, this.form)
+    this.oldForm = Object.assign({}, this.form);
+    this.customerBuyFree.height = (window.innerHeight - 330) / 2;
+    this.optionPolicy.height = (window.innerHeight - 330) / 2;
   },
   methods: {
     getGoodsRow(event,row) {
@@ -1992,7 +2011,7 @@ export default {
         }
       }
       if (this.$store.getters.inStatus) {
-        this.$alert("客户确认存在,请保存客户确认再进行操作", "温馨提示", {
+        this.$alert("客户收货存在,请保存客户收货再进行操作", "温馨提示", {
           confirmButtonText: "确定",
           type: "warning",
           callback: action => {
@@ -2094,25 +2113,53 @@ export default {
       this.applyPaymentList = [];
       let arr = [];
       this.billType = type
-      this.billData = {
-        belongCompany: this.form.belongCompany,
-        srcOrderno:this.form.orgOrderNo,
-        itemType:"销售",
-        corpsName:this.form.corpName,
-        corpId:this.form.corpId,
-        srcParentId: this.form.id,
-        currency: 'CNY',
-        exchangeRate: '1',
-        taxRate: '0',
-        accDate: this.form.businesDate,
-        srcType: 1,
-        tradeType: 'GN',
-        optionType: 'GN',
-        chargeMember: this.form.chargeMember,
-        amount: this.form.balanceAmount,
-        costType: this.feesOption.find(e => e.cname == '货款').id
-      }
-      arr.push(this.billData)
+      const data = this.goodsActives === 'gift'? this.contactsData: this.goodsShowData
+      data.map(e => {
+        const form = {
+          belongCompany: this.form.belongCompany,
+          srcOrderno:this.form.orgOrderNo,
+          itemType:"销售",
+          corpsName:this.form.corpName,
+          corpId:this.form.corpId,
+          srcParentId: this.form.id,
+          currency: 'CNY',
+          exchangeRate: '1',
+          taxRate: '0',
+          accDate: this.form.businesDate,
+          srcType: 1,
+          tradeType: 'GN',
+          optionType: 'GN',
+          chargeMember: this.form.chargeMember,
+          amount: e.amount,
+          quantity: e.orderQuantity, // 数量
+          price: e.price,
+          unit: e.unit,
+          goodName: e.cname,
+          costType: this.feesOption.find(e => e.cname == '货款')? this.feesOption.find(e => e.cname == '货款').id: null,
+        }
+        arr.push(form)
+      })
+      // this.billData = {
+      //   belongCompany: this.form.belongCompany,
+      //   srcOrderno:this.form.orgOrderNo,
+      //   itemType:"销售",
+      //   corpsName:this.form.corpName,
+      //   corpId:this.form.corpId,
+      //   srcParentId: this.form.id,
+      //   currency: 'CNY',
+      //   exchangeRate: '1',
+      //   taxRate: '0',
+      //   accDate: this.form.businesDate,
+      //   srcType: 1,
+      //   tradeType: 'GN',
+      //   optionType: 'GN',
+      //   chargeMember: this.form.chargeMember,
+      //   amount: this.form.balanceAmount,
+      //   quantity: 0, // 数量
+      //   price: 0,
+      //   costType: this.feesOption.find(e => e.cname == '货款')? this.feesOption.find(e => e.cname == '货款').id: null,
+      // }
+      // arr.push(this.billData)
       let getFeeList = this.$refs.feeInfo.submitData().filter(item => item.feesType == 1)
       getFeeList.forEach(item => {
         let form = {
@@ -2350,10 +2397,11 @@ export default {
           this.goodsListSave[item].itemId = this.goodsListSave[item].id
           this.$set(this.goodsListSave[item], 'corpName', this.goodsListSave[item].corpName)
           this.$set(this.goodsListSave[item], 'itemType', this.goodsListSave[item].typeno)
-          this.$set(this.goodsListSave[item], 'orderQuantity', 1)
+          // this.$set(this.goodsListSave[item], 'orderQuantity', 1)
           this.$set(this.goodsListSave[item], 'actualQuantity', 0)
           this.$set(this.goodsListSave[item], 'invoiceWeight', this.goodsListSave[item].cartonWeight)
           this.$set(this.goodsListSave[item], 'shopQuality', 0)
+          this.$set(this.goodsListSave[item], 'inputMold', 0) // 判断是商品还是政策 商品 0 特价 1 买赠2
           this.goodsListSave[item].amount = 0
           if (this.goodsActives == "goods") {
             this.$set(this.goodsListSave[item], 'goodType', 0)
@@ -2413,10 +2461,11 @@ export default {
           this.tableData[item].itemId = this.tableData[item].id
           this.$set(this.tableData[item], 'corpName', this.tableData[item].corpName)
           this.$set(this.tableData[item], 'itemType', this.tableData[item].typeno)
-          this.$set(this.tableData[item], 'orderQuantity', 1)
+          // this.$set(this.tableData[item], 'orderQuantity', 1)
           this.$set(this.tableData[item], 'actualQuantity', 0)
           this.$set(this.tableData[item], 'shopQuality', 0)
           this.$set(this.tableData[item], 'invoiceWeight', this.tableData[item].cartonWeight)
+          this.$set(this.tableData[item], 'inputMold', 0)
           this.tableData[item].amount = 0
           if (this.goodsActives == "goods") {
             this.$set(this.tableData[item], 'goodType', 0)
@@ -2547,6 +2596,7 @@ export default {
           } else {
             this.$set(list[item], 'price', list[item].specialOffer)
           }
+          this.$set(list[item], 'inputMold', 1)
         } else {
           if (!list[item].salePrice) {
             getMarketPrice({code: list[item].code, isFreight: this.form.isFreight, isLabel: this.form.isLabel}).then(response => {
@@ -2559,6 +2609,8 @@ export default {
           } else {
             this.$set(list[item], 'price', list[item].salePrice)
           }
+          this.$set(list[item], 'inputMold', 2)
+          this.$set(buyFree[item], 'inputMold', 2)
           this.$set(buyFree[item], 'price', '0')
           this.$set(buyFree[item], 'orderQuantity',  list[item].salesVolume)
           this.$set(buyFree[item], 'itemType',  list[item].typeno)
@@ -2710,7 +2762,7 @@ export default {
       // this.policyLoading = true;
       this.policyForm = {};
       detailList(this.treePolicyId).then(res => {
-        this.policyForm = res.data.data
+        this.policyForm = res.data.data;
         //特价促销
         if(res.data.data.specialItemList) {
           this.dataPolicy = res.data.data.specialItemList
@@ -2801,7 +2853,6 @@ export default {
           const length = this.goodsActives === 'gift'? this.contactsData.length: this.goodsShowData.length
           for (let i = 0;i < length;i++) {
             const data = this.goodsActives === 'gift'? this.contactsData: this.goodsShowData;
-            console.log(data[i])
             if (Number(data[i].orderQuantity) > Number(data[i].storageQuantity)) {
               return this.$message.error('商品信息第' + (Number(i) + 1) + '行订货数量大于库存数量')
             }
@@ -2813,7 +2864,16 @@ export default {
             this.form.orderItemsList = this.goodsShowData.concat(this.giftData)
           }
           // 判断是否能保存
-          let goodsData = this.goodsShowData.filter(item => item.goodType == 0)
+          let goodsData = this.form.orderItemsList.filter(item => item.goodType == 0)
+          // 计算特价占比
+          let allNum = 0; // 总数量
+          let specialNum = 0; // 特价数量
+          let sizeNum = 0; // 大尺寸数量
+          goodsData.forEach(item => allNum += Number(item.orderQuantity));
+          goodsData.filter(item => item.inputMold === 1).forEach(item => specialNum += Number(item.orderQuantity));
+          goodsData.filter(item => Number(item.size) >= 17).forEach(item => sizeNum += Number(item.orderQuantity));
+          this.$set(this.form, 'specialOfferOf', (specialNum / allNum * 100).toFixed(2));
+          this.$set(this.form, 'largeScale', (sizeNum / allNum * 100).toFixed(2));
           for (let item in this.goodsData) {
             if (Number(goodsData[item].orderQuantity) > Number(goodsData[item].storageQuantity)) {
               return this.$message.error('商品信息第'+ (parseInt(item) + 1) + '行订货数量不能超过库存')
@@ -2841,7 +2901,7 @@ export default {
           // 销售金额
           this.form.orderAmount = 0;
           // 计算销售金额
-          this.goodsShowData.forEach(item => {
+          this.form.orderItemsList.forEach(item => {
             if (item.goodType == 0) {
               if (item.purchaseAmount) {
                 purchaseAmount += (Number(item.purchaseAmount) * Number(item.orderQuantity)).toFixed(2)
@@ -3378,6 +3438,16 @@ export default {
     closeChangeApprove() {
       this.changeApproveVis = false
     },
+    // 商品信息价格计算
+    amountChange(row) {
+      if (!row.orderQuantity) {
+        row.orderQuantity = 0;
+      }
+      if (!row.price) {
+        row.price = 0;
+      }
+      row.amount = Number(row.price) * Number(row.orderQuantity)
+    },
   },
   computed: {
     ...mapGetters(["userInfo", "permission"])

+ 19 - 7
src/views/businessManagement/salesOrder/index.vue

@@ -70,13 +70,11 @@
           >库 存</el-button>
         </template>
         <template slot-scope="scope" slot="menu">
-<!--          <el-button-->
-<!--            type="text"-->
-<!--            icon="el-icon-edit"-->
-<!--            size="small"-->
-<!--            @click.stop="editOpen(scope.row,scope.index)"-->
-<!--          >编辑-->
-<!--          </el-button>-->
+          <el-button
+            type="text"
+            size="small"
+            @click="saveSell(scope.row)"
+          >生成采购</el-button>
           <el-button
             type="text"
             icon="el-icon-delete"
@@ -551,6 +549,20 @@ export default {
         });
       })
     },
+    // 生成采购
+    saveSell(row) {
+      this.$confirm("是否生成采购单?", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      }).then(() => {
+        saveSell(row.id).then(res => {
+          if (res.data.code == 200) {
+            this.$message.success("生成成功");
+          }
+        })
+      })
+    },
   }
 }
 </script>