Ver código fonte

国内贸易修改完善

lichao 3 anos atrás
pai
commit
5bc8662fc7

+ 1 - 1
src/components/goodsSelect/index.vue

@@ -289,7 +289,7 @@ export default {
     removeRepeat() {
       let obj = []
       this.configuration.dicData = this.configuration.dicData.reduce((current,next) => {
-        obj[next.id] ? '': obj[next.id] = true && current.push(next)
+        obj[next.cname] ? '': obj[next.cname] = true && current.push(next)
         return current
       }, [])
     },

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

@@ -12,7 +12,7 @@
   "viewBtn": false,
   "editBtn": false,
   "delBtn": false,
-  "menuWidth": 300,
+  "menuWidth": 130,
   "dialogClickModal": false,
   "searchLabelWidth": 100,
   "showSummary": true,

+ 3 - 1
src/views/businessManagement/deliveryNotice/detailsPageEdit.vue

@@ -1314,10 +1314,12 @@ export default {
           if (typeof this.form.corpsTypeId == 'object') {
             this.form.corpsTypeId = this.form.corpsTypeId.join(",")
           }
+          this.pageLoading = true
           sendOutGoods(this.form).then(res => {
-            console.log(res)
             this.$message.success('发货成功')
             this.queryData(res.data.data.id)
+          }).finally(() => {
+            this.pageLoading = false
           })
         } else {
           return false;

+ 17 - 8
src/views/businessManagement/deliveryNotice/index.vue

@@ -25,6 +25,9 @@
           <el-button type="success" :size="size" @click="copyOrder" :disabled="single">复制新单</el-button>
           <el-button type="info" :size="size" icon="el-icon-printer">报 表</el-button>
         </template>
+        <template slot-scope="scope" slot="orgOrderNo">
+          <span style="color: #409EFF;cursor: pointer" @click.stop="beforeOpenPage(scope.row,scope.index)">{{ scope.row.orgOrderNo }}</span>
+        </template>
         <template slot="corpIdSearch">
           <select-component
             v-model="search.corpId"
@@ -38,7 +41,7 @@
           ></select-component>
         </template>
         <template slot-scope="scope" slot="corpId">
-          {{ scope.row.corpsName }}
+          <span style="color: #409EFF;cursor: pointer" @click.stop="beforeOpenPage(scope.row,scope.index)">{{ scope.row.corpsName }}</span>
         </template>
         <template slot-scope="scope" slot="salesCompany">
           {{ scope.row.salesCompanyName }}
@@ -56,13 +59,13 @@
           {{ scope.row.createUserName }}
         </template>
         <template slot-scope="scope" slot="menu">
-          <el-button
-            type="text"
-            icon="el-icon-view"
-            size="small"
-            @click.stop="beforeOpenPage(scope.row,scope.index)"
-          >查看
-          </el-button>
+<!--          <el-button-->
+<!--            type="text"-->
+<!--            icon="el-icon-view"-->
+<!--            size="small"-->
+<!--            @click.stop="beforeOpenPage(scope.row,scope.index)"-->
+<!--          >查看-->
+<!--          </el-button>-->
           <el-button
             type="text"
             icon="el-icon-edit"
@@ -348,6 +351,12 @@ export default {
     },
     goBack() {
       this.detailData=this.$options.data().detailData
+      if (this.$route.query) {
+        this.$router.$avueRouter.closeTag();
+        this.$router.push({
+          path: "/businessManagement/deliveryNotice/index"
+        });
+      }
       this.isShow = true;
       this.$store.commit("IN_OUT_DETAIL");
     },

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

@@ -119,7 +119,7 @@
       "index": 6,
       "width":100,
       "cell": false,
-      "slot": true,
+      "slot": false,
       "overHidden": true,
       "rules": [
         {

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

@@ -12,7 +12,7 @@
   "viewBtn": false,
   "editBtn": false,
   "delBtn": false,
-  "menuWidth": 300,
+  "menuWidth": 130,
   "dialogClickModal": false,
   "searchLabelWidth": 100,
   "searchIcon": true,

+ 5 - 4
src/views/businessManagement/purchaseOrder/detailsPageEdit.vue

@@ -581,7 +581,7 @@ export default {
             prop: 'banksAccountName',
             rules: [
               {
-                required: true,
+                required: false,
                 message: ' ',
                 trigger: 'blur'
               }
@@ -656,8 +656,9 @@ export default {
   //初始化查询
   async created() {
     this.rowHeight = (window.innerHeight - 130) + 'px'
-    // this.customerContact = customerContact
-    this.customerContact = await this.getColumnData(this.getColumnName(18), customerContact);
+    this.customerContact = customerContact
+    console.log(this.customerContact)
+    // this.customerContact = await this.getColumnData(this.getColumnName(18), customerContact);
     this.advantageProject = await this.getColumnData(this.getColumnName(19), advantageProject);
     this.getWorkDicts("payment_term").then(res => {
       this.paymentOption = res.data.data
@@ -800,7 +801,7 @@ export default {
     removeGoodsRepeat() {
       let obj = []
       this.goodsConfiguration.dicData = this.goodsConfiguration.dicData.reduce((current,next) => {
-        obj[next.id] ? '': obj[next.id] = true && current.push(next)
+        obj[next.cname] ? '': obj[next.cname] = true && current.push(next)
         return current
       }, [])
     },

+ 11 - 8
src/views/businessManagement/purchaseOrder/index.vue

@@ -23,6 +23,9 @@
           <el-button type="success" :size="size" @click="copyOrder" :disabled="single">复制新单</el-button>
           <el-button type="info" :size="size" icon="el-icon-printer">报 表</el-button>
         </template>
+        <template slot-scope="scope" slot="orgOrderNo">
+          <span style="color: #409EFF;cursor: pointer" @click.stop="beforeOpenPage(scope.row,scope.index)">{{ scope.row.orgOrderNo }}</span>
+        </template>
         <template slot="corpIdSearch">
           <select-component
             v-model="search.corpId"
@@ -30,19 +33,19 @@
           ></select-component>
         </template>
         <template slot-scope="scope" slot="corpId">
-          {{ scope.row.strCorpName }}
+          <span style="color: #409EFF;cursor: pointer" @click.stop="beforeOpenPage(scope.row,scope.index)">{{ scope.row.strCorpName }}</span>
         </template>
         <template slot-scope="scope" slot="createUser">
           {{ scope.row.createUserName }}
         </template>
         <template slot-scope="scope" slot="menu">
-          <el-button
-            type="text"
-            icon="el-icon-view"
-            size="small"
-            @click.stop="beforeOpenPage(scope.row,scope.index)"
-          >查看
-          </el-button>
+<!--          <el-button-->
+<!--            type="text"-->
+<!--            icon="el-icon-view"-->
+<!--            size="small"-->
+<!--            @click.stop="beforeOpenPage(scope.row,scope.index)"-->
+<!--          >查看-->
+<!--          </el-button>-->
           <el-button
             type="text"
             icon="el-icon-edit"

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

@@ -12,7 +12,7 @@
   "viewBtn": false,
   "editBtn": false,
   "delBtn": false,
-  "menuWidth": 300,
+  "menuWidth": 130,
   "dialogClickModal": false,
   "searchLabelWidth": 100,
   "searchIcon": true,

+ 40 - 26
src/views/businessManagement/receipt/detailsPageEdit.vue

@@ -751,12 +751,13 @@ export default {
         this.$set(item, "inventoryNumber", item.storageQuantity)
         this.$set(item, "srcId", item.id)
         this.$set(item, "deliveryAmount", item.amount)
-        this.$set(item, "actualQuantity", (Number(item.purchaseQuantity) - Number(item.actualQuantity)))
+        this.$set(item, "purchaseQuantity", Number(item.orderQuantity))
+        this.$set(item, "actualQuantity", (Number(item.orderQuantity) - Number(item.actualQuantity)))
         // 入库数量和入库金额的比例
-        this.$set(item, 'scale', (item.deliveryAmount / item.actualQuantity))
-        this.form.deliveryAmount += Number(item.deliveryAmount)
-        this.form.totalQuantity += Number(item.actualQuantity)
-        this.form.purchaseAmount += Number(item.deliveryAmount)
+        this.$set(item, 'scale', Number(item.deliveryAmount / item.actualQuantity))
+        this.form.deliveryAmount = Number(this.form.deliveryAmount) + Number(item.deliveryAmount)
+        this.form.totalQuantity = Number(this.form.totalQuantity) + Number(item.actualQuantity)
+        this.form.purchaseAmount = Number(this.form.purchaseAmount) + Number(item.deliveryAmount)
         this.form.deliveryAmount = (this.form.deliveryAmount).toFixed(2)
         this.form.purchaseAmount = (this.form.purchaseAmount).toFixed(2)
         delete item.id
@@ -857,9 +858,9 @@ export default {
     },
     // 入库数量变化时调用
     actualQuantityChange(row) {
-      if (row.scale) {
-        row.deliveryAmount = Number(row.actualQuantity) * Number(row.scale)
-      }
+      // if (row.scale) {
+      //   row.deliveryAmount = Number(row.actualQuantity) * Number(row.scale)
+      // }
     },
     // 类别变换时触发
     warehouseTreeChange(id) {
@@ -1206,23 +1207,36 @@ export default {
           if (this.contactsData.length == 0) {
             return this.$message.error('商品信息为空')
           }
-          for (let item in this.contactsData) {
-            if (!this.contactsData[item].id) {
-              return this.$message.error('有商品未保存,请先保存')
+          if (contrastObj(this.form, this.oldForm) ||
+            contrastList(this.contactsData, this.oldGoodsList) ||
+            contrastList(this.advantageProjectData, this.oldFeesList) ||
+            contrastList(this.bankOfDepositData, this.oldUploadList)
+          ) {
+            this.$confirm("数据发生变化未有提交记录, 是否保存?", "提示", {
+              confirmButtonText: "确定",
+              cancelButtonText: "取消",
+              type: "warning"
+            }).then(() => {
+              this.editCustomer(false)
+            }).catch(() => {
+              this.$message.info('已取消')
+            })
+          } else {
+            //商品信息
+            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(",")
             }
+            this.pageLoading = true
+            sendInGoods(this.form).then(res => {
+              this.$message.success('收货成功')
+              this.queryData(res.data.data.id)
+            }).finally(() => {
+              this.pageLoading = false
+            })
           }
-          //商品信息
-          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(",")
-          }
-          sendInGoods(this.form).then(res => {
-            console.log(res)
-            this.$message.success('收货成功')
-            this.queryData(res.data.data.id)
-          })
         } else {
           return false;
         }
@@ -1256,9 +1270,9 @@ export default {
           this.form.totalQuantity = 0
           this.form.purchaseAmount = 0
           this.contactsData.forEach(item => {
-            this.form.deliveryAmount += Number(item.deliveryAmount)
-            this.form.totalQuantity += Number(item.actualQuantity)
-            this.form.purchaseAmount += Number(item.deliveryAmount)
+            this.form.deliveryAmount = Number(this.form.deliveryAmount) + Number(item.deliveryAmount)
+            this.form.totalQuantity = Number(this.form.totalQuantity) + Number(item.actualQuantity)
+            this.form.purchaseAmount = Number(this.form.purchaseAmount) + Number(item.deliveryAmount)
             this.form.deliveryAmount = (this.form.deliveryAmount).toFixed(2)
             this.form.purchaseAmount = (this.form.purchaseAmount).toFixed(2)
           })

+ 17 - 8
src/views/businessManagement/receipt/index.vue

@@ -25,6 +25,9 @@
           <el-button type="success" :size="size" @click="copyOrder" :disabled="single">复制新单</el-button>
           <el-button type="info" :size="size" icon="el-icon-printer">报 表</el-button>
         </template>
+        <template slot-scope="scope" slot="orgOrderNo">
+          <span style="color: #409EFF;cursor: pointer" @click.stop="beforeOpenPage(scope.row,scope.index)">{{ scope.row.orgOrderNo }}</span>
+        </template>
         <template slot="corpIdSearch">
           <select-component
             v-model="search.corpId"
@@ -32,7 +35,7 @@
           ></select-component>
         </template>
         <template slot-scope="scope" slot="corpId">
-          {{ scope.row.corpsName }}
+          <span style="color: #409EFF;cursor: pointer" @click.stop="beforeOpenPage(scope.row,scope.index)">{{ scope.row.corpsName }}</span>
         </template>
         <template slot="salesCompanySearch">
           <select-component
@@ -56,13 +59,13 @@
           {{ scope.row.createUserName }}
         </template>
         <template slot-scope="scope" slot="menu">
-          <el-button
-            type="text"
-            icon="el-icon-view"
-            size="small"
-            @click.stop="beforeOpenPage(scope.row,scope.index)"
-          >查看
-          </el-button>
+<!--          <el-button-->
+<!--            type="text"-->
+<!--            icon="el-icon-view"-->
+<!--            size="small"-->
+<!--            @click.stop="beforeOpenPage(scope.row,scope.index)"-->
+<!--          >查看-->
+<!--          </el-button>-->
           <el-button
             type="text"
             icon="el-icon-edit"
@@ -355,6 +358,12 @@ export default {
     },
     goBack() {
       this.detailData=this.$options.data().detailData
+      if (this.$route.query) {
+        this.$router.$avueRouter.closeTag();
+        this.$router.push({
+          path: "/businessManagement/receipt/index"
+        });
+      }
       this.isShow = true;
       this.$store.commit("DOM_OUT_DETAIL");
     },

+ 15 - 0
src/views/businessManagement/salesOrder/configuration/customerContact.json

@@ -114,6 +114,21 @@
         }
       ]
     },{
+      "label": "供应商",
+      "prop": "corpId",
+      "index": 4,
+      "width":100,
+      "cell": false,
+      "slot": true,
+      "overHidden": true,
+      "rules": [
+        {
+          "required": false,
+          "message": "请输入供应商",
+          "trigger": "blur"
+        }
+      ]
+    },{
       "label": "订货数量",
       "prop": "orderQuantity",
       "index": 5,

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

@@ -124,6 +124,15 @@
               @row-del="rowDel"
               @saveColumn="saveColumn('goods')"
           >
+            <template slot="corpId" slot-scope="{ row, index }">
+              <customer-dialog
+                v-if="row.$cellEdit"
+                v-model="row.corpName"
+                :cropIndex="index"
+                @getcorpId="getcorpId"
+              ></customer-dialog>
+              <span v-else>{{ row.corpName }}</span>
+            </template>
             <template slot="code" slot-scope="{row,index}">
               <el-button
                 type="text"
@@ -519,6 +528,7 @@ import _ from "lodash";
 import option from "./configuration/mainList.json";
 import { contrastObj, contrastList } from "@/util/contrastData";
 import { getMarketPrice, getPurchasePrice } from "@/api/basicData/fees"
+import customerDialog from "@/components/customer-dialog/main";
 //账单组件
 import ApplyPayment from "../../../components/finance/applyPayment";
 
@@ -530,6 +540,7 @@ export default {
     }
   },
   components:{
+    customerDialog,
     ApplyPayment
   },
   data() {
@@ -1096,7 +1107,8 @@ export default {
   //初始化查询
   async created() {
     this.rowHeight = (window.innerHeight - 130) + 'px'
-    this.customerContact = await this.getColumnData(this.getColumnName(15), customerContact);
+    this.customerContact = customerContact
+    // this.customerContact = await this.getColumnData(this.getColumnName(15), customerContact);
     this.advantageProject = await this.getColumnData(this.getColumnName(16), advantageProject);
     this.getWorkDicts("payment_term").then(res => {
       this.paymentOption = res.data.data
@@ -1228,6 +1240,9 @@ export default {
     copyOrder() {
       this.queryData(this.form.id, true)
     },
+    getcorpId(row) {
+      this.contactsData[row.index].corpId = row.id;
+    },
     // 采购金额获取
     getPurchasePrice(row) {
       getPurchasePrice({code: row.code}).then(res => {
@@ -1242,20 +1257,46 @@ export default {
     },
     // 生成采购单
     saveSell() {
-      if (!this.form.id) {
-        return this.$message.error("此单据没有提交记录,请先提交");
-      }
-      this.$confirm("是否生成采购单?", {
-        confirmButtonText: "确定",
-        cancelButtonText: "取消",
-        type: "warning"
-      }).then(() => {
-        saveSell(this.form.id).then(res => {
-          if (res.data.code == 200) {
-            this.$message.success("生成成功");
-          }
+      // if (!this.form.id) {
+      //   return this.$message.error("此单据没有提交记录,请先提交");
+      // }
+      if (contrastObj(this.form, this.oldForm) ||
+        contrastList(this.contactsData, this.oldGoodsList) ||
+        contrastList(this.advantageProjectData, this.oldFeesList) ||
+        contrastList(this.bankOfDepositData, this.oldUploadList)
+      ) {
+        this.$confirm("数据发生变化未有提交记录, 是否保存?", "提示", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(() => {
+          this.editCustomer(false)
+        }).catch(() => {
+          this.$confirm("是否生成采购单?", {
+            confirmButtonText: "确定",
+            cancelButtonText: "取消",
+            type: "warning"
+          }).then(() => {
+            saveSell(this.form.id).then(res => {
+              if (res.data.code == 200) {
+                this.$message.success("生成成功");
+              }
+            });
+          });
+        })
+      } else {
+        this.$confirm("是否生成采购单?", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(() => {
+          saveSell(this.form.id).then(res => {
+            if (res.data.code == 200) {
+              this.$message.success("生成成功");
+            }
+          });
         });
-      });
+      }
     },
     //点击行可编辑
     handleRowClick(row, event, column) {
@@ -1414,7 +1455,7 @@ export default {
     removeGoodsRepeat() {
       let obj = []
       this.goodsConfiguration.dicData = this.goodsConfiguration.dicData.reduce((current,next) => {
-        obj[next.id] ? '': obj[next.id] = true && current.push(next)
+        obj[next.cname] ? '': obj[next.cname] = true && current.push(next)
         return current
       }, [])
     },