Browse Source

进口修改

qinbai 3 years ago
parent
commit
bad7e4b8a7

+ 11 - 2
src/views/importTrade/invoice/detailsPageEdit.vue

@@ -649,12 +649,21 @@ export default {
     editCustomer(status) {
       this.$refs["form"].validate((valid) => {
         for (let i = 0; i < this.contactsData.length; i++) {
-          if (this.contactsData[i].billNo == null) {
+          if (this.contactsData[i].billNo === "") {
             return this.$message.error(`请输入第${i + 1}行的提单号`);
           }
-          if (this.contactsData[i].contractNumber == null) {
+          if (this.contactsData[i].contractNumber === "") {
             return this.$message.error(`请输入第${i + 1}行的合同号`);
           }
+          if (this.contactsData[i].priceCategory === "") {
+            return this.$message.error(`请输入第${i + 1}行的货物品种`);
+          }
+          if (this.contactsData[i].actualQuantity === "") {
+            return this.$message.error(`请输入第${i + 1}行的件数`);
+          }
+          if (this.contactsData[i].actualQuantity == 0) {
+            return this.$message.error(`请输入第${i + 1}行的件数`);
+          }
         }
         if (valid) {
           let submitDto = {

+ 4 - 1
src/views/importTrade/receipt/detailsPageEdit.vue

@@ -609,7 +609,10 @@ export default {
           if (this.contactsData[i].priceCategory === "") {
             return this.$message.error(`请输入第${i + 1}行的货物品种`);
           }
-          if (this.contactsData[i].actualQuantity == null) {
+          if (this.contactsData[i].actualQuantity === "") {
+            return this.$message.error(`请输入第${i + 1}行的件数`);
+          }
+          if (this.contactsData[i].actualQuantity == 0) {
             return this.$message.error(`请输入第${i + 1}行的件数`);
           }
         }

+ 26 - 9
src/views/importTrade/receipt/index.vue

@@ -77,7 +77,7 @@ export default {
       form: {},
       show:true,
       detailData:{},
-      option: option,
+      option: {},
       parentId: 0,
       dataList: [],
       page: {
@@ -90,14 +90,19 @@ export default {
   components:{
     detailPage
   },
-  created() {
-    if(this.$route.query.params){
-      this.detailData={
-        params:this.$route.query.params
+  async created() {
+    this.option = await this.getColumnData(this.getColumnName(38), option);
+  },
+  activated() {
+    setTimeout(() => {
+      if(this.$route.query.params){
+        this.detailData={
+          params:this.$route.query.params
+        }
+        this.show = false;
+        this.$store.commit("TAKE_IN_DETAIL");
       }
-      this.show = false;
-      this.$store.commit("TAKE_IN_DETAIL");
-    }
+    }, 100);
   },
   methods: {
     //删除列表后面的删除按钮触发触发(row, index, done)
@@ -231,7 +236,19 @@ export default {
     goBack() {
       this.detailData=this.$options.data().detailData
       this.show = true;
-    }
+    },
+    //列保存触发
+    async saveColumn() {
+      const inSave = await this.saveColumnData(
+        this.getColumnName(40),
+        this.option
+      );
+      if (inSave) {
+        this.$message.success("保存成功");
+        //关闭窗口
+        this.$refs.crud.$refs.dialogColumn.columnBox = false;
+      }
+    },
   }
 }
 </script>

+ 8 - 0
src/views/purchase/contract/config/mainList.json

@@ -20,6 +20,14 @@
   "addBtnText": "新单",
   "expand": true,
   "rowKey": "id",
+  "showSummary": true,
+  "summaryText": "合计",
+  "sumColumnList": [
+    {
+      "name": "orderAmount",
+      "type": "sum"
+    }
+  ],
   "column":[
     {
       "label": "合同号",

+ 30 - 17
src/views/purchase/contract/detailsPage.vue

@@ -41,6 +41,7 @@
                     :value="data.value"
                   ></el-option>
                 </el-select>
+                <el-input type="age" v-else-if="item.prop === 'orderAmount'" v-model="form[item.prop]" :disabled="item.disabled?true:false" size="small" autocomplete="off" @input="currencyChange" placeholder="请输入"></el-input>
                 <selectComponent v-else-if="item.prop === 'corpId'" v-model="form[item.prop]" :configuration="configuration"/>
                 <selectComponent v-else-if="item.prop === 'purchaserId'" v-model="form[item.prop]" :configuration="pConfiguration"/>
                 <el-select v-else-if="item.prop === 'orderType'"  style="width: 100%"  v-model="form[item.prop]" size="small" placeholder="请选择" clearable filterable>
@@ -71,6 +72,7 @@
             @row-click="handleRowClick"
             @row-update="rowUpdate"
             @row-del="rowDel"
+            @saveColumn="saveColumn"
           >
             <template slot="priceCategory" slot-scope="{row,index}">
               <span v-if="row.$cellEdit" class="required_fields">*</span>
@@ -86,14 +88,15 @@
               <span v-else>{{ row.priceCategoryNames }}</span>
             </template>
             <template slot="itemType" slot-scope="{row,index}">
-              <span v-if="row.$cellEdit"  class="required_fields">*</span>
               <el-select
                 v-if="row.$cellEdit"
                 v-model="row.itemType"
                 size="small"
                 style="width:90% !important;"
-                clearable
                 filterable
+                allow-create
+                default-first-option
+                clearable
               >
                 <el-option
                   v-for="(item,index) in row.specificationList"
@@ -294,6 +297,7 @@ import {corpsattn, corpsbank,  getDeptLazyTreeS} from "@/api/basicData/configura
 import { getList } from "@/api/basicData/commodityType"
 import { contrastObj,contrastList } from "@/util/contrastData";
 import {getSpecification} from "@/api/exportTrade/purchaseContract";
+import option from "./config/mainList.json";
 export default {
   name: "detailsPage",
   props: {
@@ -305,7 +309,7 @@ export default {
     return {
       form: {},
       disabled: false,
-      customerContact: customerContact,
+      customerContact: {},
       contactsForm: {},
       contactsData: [],
       dialogVisible:false,
@@ -669,7 +673,8 @@ export default {
       },
     }
   },
-  created() {
+  async created() {
+    this.customerContact = await this.getColumnData(this.getColumnName(37), customerContact);
     //币别
     this.getWorkDicts("currency").then(res =>{
       this.currencyDic = res.data.data
@@ -700,13 +705,10 @@ export default {
           this.oldFilesList = this.deepClone(res.data.data.orderFilesList)
         }
       })
+    }else{
+      this.$set(this.form,"currency","人民币")
+      this.$set(this.form,"exchangeRate",1)
     }
-    //赋值去掉
-    // else{
-    //   getSysNo("JK-CG").then(res =>{
-    //     this.$set(this.form,"sysNo", res.data.data)
-    //   })
-    // }
   },
   components: {
     feeInfo,
@@ -722,15 +724,17 @@ export default {
         row.amount = _.multiply(row.purchaseQuantity, row.price).toFixed(2);
       }
     },
-    currencyChange(value){
+    currencyChange(){
       if(this.form.orderAmount){
-        if(value === "人民币"){
+        if(this.form.currency === "人民币"){
           this.form.exchangeRate = 1
           this.form.rmbAmount = this.form.orderAmount
         }else{
           this.form.exchangeRate = 6.3843
           this.form.rmbAmount =  _.multiply(this.form.orderAmount, 6.3843)
         }
+      }else{
+        this.form.rmbAmount = ""
       }
     },
     //合计
@@ -777,19 +781,16 @@ export default {
           }
           const orderFilesList = this.$refs.uploadFile.submitData();
           for (let j = 0; j < this.contactsData.length; j++) {
-            if (this.contactsData[j].billNo == null) {
+            if (this.contactsData[j].billNo === "") {
               return this.$message.error(`请输入采购明细第${j + 1}行的提单号`);
             }
             if (this.contactsData[j].priceCategory === "") {
               return this.$message.error(`请输入采购明细第${j + 1}行的货物品种`);
             }
-            if (this.contactsData[j].itemType === "") {
-              return this.$message.error(`请输入采购明细第${j + 1}行的规格型号`);
-            }
             if (this.contactsData[j].purchaseQuantity === "") {
               return this.$message.error(`请输入采购明细第${j + 1}行的件数`);
             }
-            if (this.importInventoryData[j].purchaseQuantity === 0) {
+            if (this.contactsData[j].purchaseQuantity == 0) {
               return this.$message.error(`采购明细第${j + 1}行的件数不能为0`);
             }
           }
@@ -1074,6 +1075,18 @@ export default {
         this.$emit("goBack");
       }
     },
+    //列保存触发
+    async saveColumn() {
+      const inSave = await this.saveColumnData(
+        this.getColumnName(37),
+        this.customerContact
+      );
+      if (inSave) {
+        this.$message.success("保存成功");
+        //关闭窗口
+        this.$refs.crud.$refs.dialogColumn.columnBox = false;
+      }
+    },
   }
 }
 </script>

+ 16 - 2
src/views/salesManagement/salesContract/detailsPage.vue

@@ -286,6 +286,7 @@ import {getSysNo} from "@/api/importTrade/purchase";
 import uploadFile from "@/components/upload-file/main";
 import { contrastObj,contrastList } from "@/util/contrastData";
 import _ from "lodash";
+import option from "./config/mainList.json";
 
 export default {
   name: "detailsPage",
@@ -656,7 +657,8 @@ export default {
       oldFilesList:[],
     }
   },
-  created() {
+  async created() {
+    this.importInventory = await this.getColumnData(this.getColumnName(39), importInventory);
     //币别
     this.getWorkDicts("currency").then(res =>{
       this.currencyDic = res.data.data
@@ -763,7 +765,7 @@ export default {
           if (this.importInventoryData[j].orderQuantity === "") {
             return this.$message.error(`请输入销售明细第${j + 1}行的件数`);
           }
-          if (this.importInventoryData[j].orderQuantity === 0) {
+          if (this.importInventoryData[j].orderQuantity == 0) {
             return this.$message.error(`销售明细第${j + 1}行的件数不能为0`);
           }
         }
@@ -1050,6 +1052,18 @@ export default {
         this.$emit("goBack");
       }
     },
+    //列保存触发
+    async saveColumn() {
+      const inSave = await this.saveColumnData(
+        this.getColumnName(39),
+        this.importInventory
+      );
+      if (inSave) {
+        this.$message.success("保存成功");
+        //关闭窗口
+        this.$refs.crud.$refs.dialogColumn.columnBox = false;
+      }
+    },
   },
 }
 </script>

+ 19 - 3
src/views/salesManagement/salesContract/index.vue

@@ -17,7 +17,8 @@
                @size-change="sizeChange"
                @refresh-change="refreshChange"
                @on-load="onLoad"
-               @expand-change="expandChange">
+               @expand-change="expandChange"
+               @saveColumn="saveColumn">
       <template slot-scope="{row,size}" slot="search">
       </template>
       <template slot-scope="scope" slot="expand">
@@ -90,7 +91,7 @@ export default {
   name: "index",
   data() {
     return {
-      option: option,
+      option: {},
       dataList: [],
       show:true,
       page: {
@@ -106,6 +107,9 @@ export default {
   components:{
     detailPage
   },
+  async created() {
+    this.option = await this.getColumnData(this.getColumnName(38), option);
+  },
   methods: {
     //删除列表后面的删除按钮触发触发(row, index, done)
     rowDel(row, index, done) {
@@ -245,7 +249,19 @@ export default {
     goBack() {
       this.detailData=this.$options.data().detailData
       this.show = true;
-    }
+    },
+    //列保存触发
+    async saveColumn() {
+      const inSave = await this.saveColumnData(
+        this.getColumnName(38),
+        this.option
+      );
+      if (inSave) {
+        this.$message.success("保存成功");
+        //关闭窗口
+        this.$refs.crud.$refs.dialogColumn.columnBox = false;
+      }
+    },
   },
 }
 </script>