Jelajahi Sumber

修改国内贸易

lichao 3 tahun lalu
induk
melakukan
dada1baeb9

+ 3 - 2
src/views/businessManagement/deliveryNotice/configuration/customerContact.json

@@ -18,7 +18,7 @@
   "menuWidth": 300,
   "dialogClickModal": false,
   "showSummary": true,
-  "sumText": "合计",
+  "summaryText": "合计",
   "sumColumnList": [
     {
       "name": "deliveryAmount",
@@ -114,7 +114,8 @@
       "prop": "actualQuantity",
       "index": 6,
       "width":100,
-      "cell": true,
+      "cell": false,
+      "slot": true,
       "rules": [
         {
           "required": false,

+ 1 - 1
src/views/businessManagement/deliveryNotice/configuration/mainList.json

@@ -18,7 +18,7 @@
     "showSummary": true,
     "searchIcon": true,
     "searchIndex": 3,
-    "sumText": "合计",
+    "summaryText": "合计",
     "sumColumnList": [
       {
         "name": "deliveryAmount",

+ 66 - 4
src/views/businessManagement/deliveryNotice/detailsPageEdit.vue

@@ -9,6 +9,20 @@
       </div>
       <el-button
         class="el-button--small-yh add-customer-btn"
+        style="right: 245px;"
+        type="primary"
+        @click="revokeOutGoods"
+        v-if="form.deliveryStatus !== '录入'"
+      >撤销发货</el-button>
+      <el-button
+        class="el-button--small-yh add-customer-btn"
+        style="right: 245px;"
+        type="primary"
+        @click="sendOutGoods"
+        v-if="form.deliveryStatus == '录入'"
+      >确认发货</el-button>
+      <el-button
+        class="el-button--small-yh add-customer-btn"
         type="success" style="right: 140px;" @click="copyOrder">
         复制新单
       </el-button>
@@ -33,7 +47,7 @@
                                 size="small" type="datetime" placeholder="选择日期" value-format="yyyy-MM-dd HH:mm:ss" :disabled="item.disabled"/>
                 <selectComponent v-else-if="item.prop === 'corpId' || item.prop === 'salesCompany'" v-model="form[item.prop]"
                                  :configuration="configuration" style="width: 100%"/>
-                <el-select v-else-if="item.prop === 'deliveryStatus'" v-model="form[item.prop]" placeholder="请选择" clearable filterable style="width: 100%" size="small">
+                <el-select v-else-if="item.prop === 'deliveryStatus'" v-model="form[item.prop]" placeholder="请选择" clearable filterable style="width: 100%" size="small" :disabled="item.disabled">
                   <el-option v-for="(item,index) in statusOption" :key="index" :label="item.dictValue" :value="item.dictValue" size="small"></el-option>
                 </el-select>
                 <avue-input-tree
@@ -90,7 +104,15 @@
               >录入明细
               </el-button>
               <el-button type="info" :size="size" icon="el-icon-printer">报 表</el-button>
-              <el-button type="primary" size="small" @click="sendOutGoods">确认发货</el-button>
+            </template>
+            <template slot="actualQuantity" slot-scope="{ row }">
+              <el-input
+                v-if="row.$cellEdit"
+                v-model="row.actualQuantity"
+                v-input-limit="0"
+                @change="actualQuantityChange(row)"
+              ></el-input>
+              <span v-else>{{ row.actualQuantity }}</span>
             </template>
           </avue-crud>
         </basic-container>
@@ -241,7 +263,8 @@ import {
   corpsbank,
   corpsitem,
   getList,
-  sendOutGoods
+  sendOutGoods,
+  revokeOutGoods
 } from "@/api/basicData/deliveryNotice"
 import customerContact from "./configuration/customerContact.json"
 import advantageProject from "./configuration/advantageProject.json"
@@ -381,6 +404,7 @@ export default {
           }, {
             label: '单据状态',
             prop: 'deliveryStatus',
+            disabled: true,
             rules: [
               {
                 required: true,
@@ -431,6 +455,7 @@ export default {
           }, {
             label: '出库金额',
             prop: 'deliveryAmount',
+            disabled: true,
             rules: [
               {
                 required: true,
@@ -441,6 +466,7 @@ export default {
           }, {
             label: '出库数量',
             prop: 'totalQuantity',
+            disabled: true,
             rules: [
               {
                 required: true,
@@ -566,6 +592,8 @@ export default {
         this.form.deliveryAmount += Number(item.deliveryAmount)
         this.form.totalQuantity += Number(item.actualQuantity)
         this.form.totalCost += Number(item.deliveryAmount)
+        // 出库数量和出库金额的比例
+        this.$set(item, 'scale', (item.deliveryAmount / item.actualQuantity))
         delete item.id
         delete item.pid
       })
@@ -585,6 +613,15 @@ export default {
         this.advantageProjectData = this.form.deliveryFeesList
         this.bankOfDepositData = this.form.deliveryFilesList
         this.configuration.dicData = this.form.corpName
+        this.form.deliveryAmount = 0
+        this.form.totalQuantity = 0
+        this.contactsData.forEach(item => {
+          this.form.deliveryAmount += Number(item.deliveryAmount)
+          this.form.totalQuantity += Number(item.actualQuantity)
+          // 出库金额和出库数量的比例
+          this.$set(item, 'scale', (item.deliveryAmount / item.actualQuantity))
+        })
+        console.log(this.contactsData)
         if (this.form.companyName) {
           this.configuration.dicData = this.configuration.dicData.concat(this.form.companyName)
         }
@@ -645,6 +682,10 @@ export default {
         }
       });
     },
+    // 出库数量变化时调用
+    actualQuantityChange(row) {
+      row.deliveryAmount = Number(row.actualQuantity) * Number(row.scale)
+    },
     // 类别变换时触发
     warehouseTreeChange(id) {
       this.warehouseName = []
@@ -1025,12 +1066,33 @@ export default {
           sendOutGoods(this.form).then(res => {
             console.log(res)
             this.$message.success('发货成功')
+            this.queryData(res.data.data.id)
+          })
+        } else {
+          return false;
+        }
+      });
+    },
+    // 撤销发货
+    revokeOutGoods() {
+      this.$refs["form"].validate((valid) => {
+        if (valid) {
+          //商品信息
+          this.form.deliveryItemsList = this.contactsData
+          this.form.deliveryFeesList = this.advantageProjectData
+          this.form.deliveryFilesList = this.bankOfDepositData
+          if (typeof this.form.corpsTypeId == 'object') {
+            this.form.corpsTypeId = this.form.corpsTypeId.join(",")
+          }
+          revokeOutGoods(this.form).then(res => {
+            console.log(res)
+            this.$message.success('撤销成功')
+            this.queryData(res.data.data.id)
           })
         } else {
           return false;
         }
       });
-
     },
     // 保存列设置
     async saveColumn(name) {

+ 1 - 1
src/views/businessManagement/purchaseOrder/configuration/customerContact.json

@@ -18,7 +18,7 @@
   "menuWidth": 300,
   "dialogClickModal": false,
   "showSummary": true,
-  "sumText": "合计",
+  "summaryText": "合计",
   "sumColumnList": [
     {
       "name": "amount",

+ 1 - 1
src/views/businessManagement/receipt/configuration/customerContact.json

@@ -18,7 +18,7 @@
   "menuWidth": 300,
   "dialogClickModal": false,
   "showSummary": true,
-  "sumText": "合计",
+  "summaryText": "合计",
   "sumColumnList": [
     {
       "name": "purchaseAmount",

+ 1 - 1
src/views/businessManagement/receipt/configuration/mainList.json

@@ -18,7 +18,7 @@
     "searchIcon": true,
     "searchIndex": 3,
     "showSummary": true,
-    "sumText": "合计",
+    "summaryText": "合计",
     "sumColumnList": [
       {
         "name": "deliveryAmount",

+ 1 - 2
src/views/businessManagement/salesOrder/configuration/customerContact.json

@@ -18,7 +18,7 @@
   "menuWidth": 300,
   "dialogClickModal": false,
   "showSummary": true,
-  "sumText": "合计",
+  "summaryText": "合计",
   "sumColumnList": [
     {
       "name": "amount",
@@ -139,7 +139,6 @@
       "index": 6,
       "width":100,
       "cell": false,
-      "slot": true,
       "rules": [
         {
           "required": false,

+ 34 - 58
src/views/businessManagement/salesOrder/detailsPageEdit.vue

@@ -98,37 +98,6 @@
               ></el-input>
               <span v-else>{{ row.price }}</span>
             </template>
-            <template slot="storageQuantity" slot-scope="{ row }">
-              <el-input
-                v-if="row.$cellEdit"
-                v-model="row.storageQuantity"
-                size="small"
-                oninput='this.value=this.value.replace(/[^\-?\d.]/g,"").replace(/^(\-)*(\d+)\.(\d\d).*$/, "$1$2.$3")'
-              ></el-input>
-              <span v-else>{{ row.storageQuantity }}</span>
-            </template>
-            <template slot="actualQuantity" slot-scope="{ row }">
-              <el-input
-                v-if="row.$cellEdit"
-                v-model="row.actualQuantity"
-                size="small"
-                oninput='this.value=this.value.replace(/[^\-?\d.]/g,"").replace(/^(\-)*(\d+)\.(\d\d).*$/, "$1$2.$3")'
-              ></el-input>
-              <span v-else>{{ row.actualQuantity }}</span>
-            </template>
-<!--            <template slot="specificationAndModel" slot-scope="{ row }">-->
-<!--              <el-select-->
-<!--                v-if="row.$cellEdit && row.typeData.length > 0"-->
-<!--                v-model="row.specificationAndModel"-->
-<!--                size="small"-->
-<!--              ></el-select>-->
-<!--              <el-input-->
-<!--                v-else-if="row.$cellEdit && row.typeData.length == 0"-->
-<!--                v-model="row.specificationAndModel"-->
-<!--                size="small"-->
-<!--              ></el-input>-->
-<!--              <span v-else>{{ row.specificationAndModel }}</span>-->
-<!--            </template>-->
             <template slot-scope="{row,index}" slot="menu">
               <el-button
                   type="text"
@@ -1169,6 +1138,7 @@ export default {
     //商品新增触发
     commoditySelection() {
       this.dialogVisible = !this.dialogVisible
+      this.tableData = []
       this.commodityData = false
     },
     //政策价格导入
@@ -1249,9 +1219,12 @@ export default {
         this.contactsData[this.choiceIndexT].specificationAndModel = this.tableData[0].specs
         this.contactsData[this.choiceIndexT].itemId = this.tableData[0].id
         this.contactsData[this.choiceIndexT].priceCategory = this.tableData[0].goodsTypeName
-        this.contactsData[this.choiceIndexT].orderQuantity = 0
-        this.contactsData[this.choiceIndexT].price = 0
-        this.contactsData[this.choiceIndexT].amount = 0
+        selectGoodsNum({
+          goodsId: this.tableData[0].id,
+          typeno: this.tableData[0].specs
+        }).then(res => {
+          this.contactsData[this.choiceIndexT].storageQuantity =  res.data.data
+        })
       }
       this.dialogVisible = !this.dialogVisible
       this.commodityData = false
@@ -1291,32 +1264,31 @@ export default {
       // this.contactsData = this.contactsData.concat(this.tableData)
       if (this.tableData.length > 0) {
         for (let item in this.tableData) {
-          let data = {
+          // this.$set(this.tableData[item], 'storageQuantity', 0)
+          selectGoodsNum({
             goodsId: this.tableData[item].id,
             typeno: this.tableData[item].specs
-          }
-          selectGoodsNum(data).then(res => {
-            console.log(res.data)
+          }).then(res => {
+            console.log(this.tableData)
+            this.tableData[item].priceCategory = this.tableData[item].goodsTypeName
+            this.tableData[item].storageQuantity =  res.data.data
+            delete this.tableData[item].goodsTypeName
+            this.tableData[item].itemId = this.tableData[item].id
+            this.$set(this.tableData[item], 'specificationAndModel', this.tableData[item].specs)
+            this.$set(this.tableData[item], 'priceType', '一般')
+            this.$set(this.tableData[item], 'orderQuantity', 0)
+            this.$set(this.tableData[item], 'actualQuantity', 0)
+            this.tableData[item].price = 0
+            this.tableData[item].amount = 0
+            this.tableData[item].sort = this.maxGoodsNum + 1
+            this.maxGoodsNum++
+            delete this.tableData[item].id
+            this.$refs.crudContact.rowCellAdd(this.tableData[item]);
+            this.$refs.crudContact.rowCell(this.tableData[item], this.contactsData.length - 1)
           })
-          this.tableData[item].priceCategory = this.tableData[item].goodsTypeName
-          delete this.tableData[item].goodsTypeName
-          this.tableData[item].itemId = this.tableData[item].id
-          this.$set(this.tableData[item], 'specificationAndModel', this.tableData[item].specs)
-          this.$set(this.tableData[item], 'priceType', '一般')
-          this.$set(this.tableData[item], 'orderQuantity', 0)
-          this.$set(this.tableData[item], 'actualQuantity', 0)
-          this.$set(this.tableData[item], 'storageQuantity', 0)
-          this.tableData[item].price = 0
-          this.tableData[item].amount = 0
-          this.tableData[item].sort = this.maxGoodsNum + 1
-          this.maxGoodsNum++
-          delete this.tableData[item].id
-          this.$refs.crudContact.rowCellAdd(this.tableData[item]);
-          this.$refs.crudContact.rowCell(this.tableData[item], this.contactsData.length - 1)
         }
+        this.dialogVisible = false
       }
-      this.tableData = []
-      this.dialogVisible = false
     },
     closeGoods() {
       this.treeDataGoods = [];
@@ -1399,17 +1371,21 @@ export default {
     importPolicy() {
       let list = this.policyData.concat(this.policyDataTwo)
       for (let item in list) {
-        console.log(list[item])
+        selectGoodsNum({
+          goodsId: list[item].id,
+          typeno: list[item].specs
+        }).then(res => {
+          this.$set(list[item], 'storageQuantity', res.data.data)
+        })
         if (this.policyData.length > 0) {
           this.$set(list[item], 'price', list[item].specialOffer)
         } else {
           this.$set(list[item], 'price', list[item].salesPrice)
         }
         this.$set(list[item], 'actualQuantity', 0)
-        this.$set(list[item], 'storageQuantity', 0)
         this.$set(list[item], 'orderQuantity', 0)
         this.$set(list[item], 'amount', 0)
-        this.$set(list[item], 'priceCategory', this.policyForm.cname)
+        this.$set(list[item], 'priceCategory', list[item].productCategory)
         this.$set(list[item], 'priceType', this.policyForm.cname)
         this.$set(list[item], 'cname', list[item].productCategory)
         this.$set(list[item], 'sort', this.maxGoodsNum + 1)