소스 검색

进口页面逻辑调整

qinbai 3 년 전
부모
커밋
2b3547bc0c

+ 1 - 1
src/components/procurement/config/purchase.json

@@ -52,7 +52,7 @@
       "index": 5,
       "width":120
     },{
-      "label": "数",
+      "label": "数",
       "prop": "orderQuantity",
       "index": 6,
       "width":120

+ 2 - 2
src/components/procurement/purchase.vue

@@ -11,9 +11,9 @@
                :page.sync="page"
                @on-load="onLoad">
     </avue-crud>
-    <div style="margin-left: 90%">
+    <div style="margin-left: 80%;padding: 15px">
        <span slot="footer" class="dialog-footer" >
-           <el-button @click="closeFun()">取 消</el-button>
+           <el-button @click="closeFun">取 消</el-button>
            <el-button type="primary" @click="importProMent" :disabled="selectPromentList.length == 0">导入</el-button>
        </span>
     </div>

+ 1 - 1
src/views/importTrade/invoice/config/customerContact.json

@@ -60,7 +60,7 @@
       ]
     },{
       "label": "库存",
-      "prop": "kuCun",
+      "prop": "inventoryNumber",
       "index": 4,
       "width":120
     },{

+ 141 - 62
src/views/importTrade/invoice/config/mainList.json

@@ -1,65 +1,144 @@
 {
-    "lazy": true,
-    "tip": false,
-    "simplePage": true,
-    "searchShow": true,
-    "searchMenuSpan": 6,
+  "lazy": true,
+  "tip": false,
+  "simplePage": true,
+  "searchShow": true,
+  "searchMenuSpan": 6,
+  "searchSpan": 8,
   "searchMenuPosition": "right",
-    "dialogWidth": "60%",
-    "tree": true,
-    "border": true,
-    "index": true,
-    "selection": true,
-    "viewBtn": false,
-    "editBtn": false,
-    "delBtn": false,
-    "menuWidth": 220,
-    "dialogClickModal": false,
-    "searchLabelWidth": 120,
-    "column":[
-        {
-            "label": "系统号",
-            "prop": "sysNo",
-            "search": true,
-            "index": 1,
-            "width":150
-        },
-        {
-            "label": "合同号",
-            "prop": "orderNo",
-            "search": true,
-            "index": 2,
-            "width":150
-        },{
-            "label": "发货日期",
-            "prop": "businessDate",
-            "search": true,
-            "index": 3,
-            "width":150
-        },{
-        "label": "业务员",
-        "prop": "saleman",
-        "search": true,
-        "index": 4,
-        "width":120
-      },{
-        "label": "仓库名称",
-        "prop": "storageId",
-        "search": true,
-        "index": 7,
-        "width":150
-      },{
-        "label": "发票重量",
-        "prop": "invoiceWeight",
-        "search": true,
-        "index": 9,
-        "width":120
-      },{
-        "label": "备注",
-        "prop": "deliveryRemarks",
-        "search": false,
-        "index": 10,
-        "width":120
-      }
-    ]
+  "dialogWidth": "60%",
+  "tree": true,
+  "border": true,
+  "index": true,
+  "selection": true,
+  "viewBtn": false,
+  "editBtn": false,
+  "delBtn": false,
+  "menuWidth": 220,
+  "searchIcon": true,
+  "searchIndex": 2,
+  "dialogClickModal": false,
+  "searchLabelWidth": 120,
+  "column":[
+    {
+      "label": "供应商",
+      "prop": "corpsName",
+      "search": true,
+      "searchOrder": 1,
+      "index": 2,
+      "width":120
+    },
+    {
+      "label": "合同号",
+      "prop": "orderNo",
+      "search": true,
+      "searchOrder": 2,
+      "index": 2,
+      "width":120
+    },
+    {
+      "label": "提单号",
+      "prop": "billNo",
+      "search": true,
+      "searchOrder": 3,
+      "index": 2,
+      "width":120
+    },
+    {
+      "label": "收货日期",
+      "prop": "businessDate",
+      "search": true,
+      "type": "date",
+      "format": "yyyy-MM-dd",
+      "valueFormat": "yyyy-MM-dd",
+      "unlinkPanels": true,
+      "searchRange": true,
+      "searchOrder": 4,
+      "index": 3,
+      "width":150
+    },
+    {
+      "label": "数量",
+      "prop": "quantity",
+      "overHidden": true,
+      "index": 6,
+      "width":100
+    },
+    {
+      "label": "码单重量",
+      "prop": "billWeight",
+      "overHidden": true,
+      "index": 7,
+      "width":100
+    },
+    {
+      "label": "发票净重",
+      "prop": "invoiceWeight",
+      "overHidden": true,
+      "index": 8,
+      "width":100
+    },
+    {
+      "label": "发货人",
+      "prop": "arrivalContact",
+      "search": true,
+      "searchOrder": 5,
+      "index": 4,
+      "width":120
+    },
+    {
+      "label": "收货电话",
+      "prop": "arrivalTel",
+      "search": true,
+      "searchOrder": 6,
+      "index": 4,
+      "width":120
+    },
+    {
+      "label": "收货地址",
+      "prop": "arrivalAddress",
+      "search": true,
+      "searchOrder": 7,
+      "index": 4,
+      "width":120
+    },
+    {
+      "label": "仓库",
+      "prop": "storageId",
+      "search": true,
+      "searchOrder": 8,
+      "index": 7,
+      "width":150
+    },
+    {
+      "label": "备注",
+      "prop": "deliveryRemarks",
+      "search": true,
+      "searchOrder": 8,
+      "index": 10,
+      "width":180
+    },
+    {
+      "label": "系统编号",
+      "prop": "sysNo",
+      "index": 9,
+      "width":120
+    },
+    {
+      "label": "制单人日期",
+      "prop": "createTime",
+      "search": true,
+      "searchOrder": 9,
+      "index": 9,
+      "width":120
+    },
+    {
+      "label": "制单人",
+      "prop": "createUserName",
+      "search": true,
+      "searchOrder": 10,
+      "index": 9,
+      "width":120
+    }
+  ]
 }

+ 35 - 13
src/views/importTrade/invoice/detailsPageEdit.vue

@@ -145,6 +145,7 @@
                 placeholder="请输入"
                 size="small"
                 oninput='this.value=this.value.replace(/[^(\d.)]/g,"").replace(/^(\d+)\.(\d\d).*$/, "$1.$2")'
+                @input="actualQuantityChange(row)"
               ></el-input>
               <span v-else>{{ row.actualQuantity }}</span>
             </template>
@@ -308,9 +309,10 @@ export default {
           }, {
             label: '合同号',
             prop: 'orderNo',
+            disabled:true,
             rules: [
               {
-                required: true,
+                required: false,
                 message: ' ',
                 trigger: 'blur'
               }
@@ -462,8 +464,9 @@ export default {
       this.form = JSON.parse(this.detailData.form);
       this.form.id = null
       this.form.sysNo = null
-      this.form.orderItemsList.forEach(item =>{
+      this.form.orderItemsList.forEach((item,index) =>{
         item.srcId = item.id
+        item.orgOrderNo = this.form.orgOrderNo
         item.contractNumber = item.orgOrderNo
         item.contractAmount = item.amount
         if(item.actualQuantity !== 0){   //如果发过货
@@ -471,6 +474,11 @@ export default {
         }else{
           item.actualQuantity =  item.orderQuantity;
         }
+        //码单重量 除以 数量     每个的码单重量
+        item.singleton = {
+          BQ : _.divide(item.billWeight, item.orderQuantity),
+          IQ : _.divide(item.invoiceWeight, item.orderQuantity)
+        }
         delete item.actualQuantity
         delete item.id
       })
@@ -498,18 +506,15 @@ export default {
     //码单合计
     totalChange(){
       let invoiceList =  this.contactsData.map(item => {
-        if(!item.invoiceWeight){
-          item.invoiceWeight = 0
-        }
-        return parseFloat(item.invoiceWeight);
+        if(item.invoiceWeight){
+          return parseFloat(item.invoiceWeight);
+        }else return 0
       });
       let billList =  this.contactsData.map(item => {
-        if(!item.billWeight){
-          item.billWeight = 0
-        }
-        return parseFloat(item.billWeight);
+        if(item.billWeight){
+          return parseFloat(item.billWeight);
+        }else return 0
       });
-
       this.$set(this.form,"invoiceWeight", invoiceList.reduce((n,m) => n + m))
       this.$set(this.form,"billWeight", billList.reduce((n,m) => n + m))
     },
@@ -535,10 +540,23 @@ export default {
           storageId:this.form.storageId,
         }
         selectGoodsNum(params).then(res =>{
-          this.$set(this.contactsData[row.$index],"kuCun",res.data.data)
+          this.$set(this.contactsData[row.$index],"inventoryNumber",res.data.data)
         })
       }
     },
+    actualQuantityChange(row){
+      if(row.singleton){
+        const _sing =   row.singleton
+        if( _sing.BQ !== 0){  //如果有值并且不为空 计算码单与发票
+          row.billWeight = _.multiply(_sing.BQ,row.actualQuantity)
+        }
+        if( _sing.IQ !== 0){
+          row.invoiceWeight = _.multiply(_sing.IQ,row.actualQuantity)
+          this.invoiceWeightChange(row)  //发票改变合同
+        }
+        this.totalChange()
+      }
+    },
     //单价
     priceChange(row) {
       if (!row.price) {
@@ -548,7 +566,6 @@ export default {
         row.contractAmount = _.multiply(row.invoiceWeight, row.price).toFixed(2);
       }
     },
-    //件数
     invoiceWeightChange(row) {
       if (!row.invoiceWeight) {
         row.invoiceWeight = "";
@@ -563,10 +580,15 @@ export default {
         item.contractNumber = item.orgOrderNo;
         item.contractAmount = item.amount;
         item.actualQuantity = item.orderQuantity;
+        item.singleton = {
+          BQ : _.divide(item.billWeight, item.orderQuantity),
+          IQ : _.divide(item.invoiceWeight, item.orderQuantity)
+        }
         this.selectInventory(item);
         delete item.id
         this.$refs.crudContact.rowCellAdd(item);
       })
+
       this.totalChange();  //计算码单 发票
       this.sumOrderNo();   //合并合同号
       this.marketDialog = false;

+ 1 - 1
src/views/importTrade/invoice/index.vue

@@ -92,7 +92,7 @@ export default {
     detailPage
   },
   async created() {
-    this.option = await this.getColumnData(this.getColumnName(43), option);
+    // this.option = await this.getColumnData(this.getColumnName(43), option);
   },
   activated() {
     setTimeout(() => {

+ 1 - 1
src/views/importTrade/receipt/config/customerContact.json

@@ -75,7 +75,7 @@
     },
     {
       "label": "库存",
-      "prop": "kuCun",
+      "prop": "inventoryNumber",
       "index": 4,
       "width":120
     },

+ 81 - 20
src/views/importTrade/receipt/config/mainList.json

@@ -4,6 +4,7 @@
   "simplePage": true,
   "searchShow": true,
   "searchMenuSpan": 12,
+  "searchSpan": 8,
   "searchMenuPosition": "right",
   "align": "center",
   "dialogWidth": "60%",
@@ -15,13 +16,16 @@
   "editBtn": false,
   "delBtn": false,
   "menuWidth": 220,
+  "searchIcon": true,
+  "searchIndex": 2,
   "dialogClickModal": false,
   "searchLabelWidth": 120,
   "column":[
     {
       "label": "供应商",
-      "prop": "corpId",
+      "prop": "corpsName",
       "search": true,
+      "searchOrder": 1,
       "index": 2,
       "width":120
     },
@@ -29,13 +33,15 @@
       "label": "合同号",
       "prop": "orderNo",
       "search": true,
+      "searchOrder": 2,
       "index": 2,
       "width":120
     },
     {
       "label": "提单号",
-      "prop": "orderNo",
+      "prop": "billNo",
       "search": true,
+      "searchOrder": 3,
       "index": 2,
       "width":120
     },
@@ -48,37 +54,92 @@
       "valueFormat": "yyyy-MM-dd",
       "unlinkPanels": true,
       "searchRange": true,
+      "searchOrder": 4,
       "index": 3,
       "width":150
-    },{
-      "label": "业务员",
-      "prop": "saleman",
+    },
+    {
+      "label": "数量",
+      "prop": "quantity",
+      "overHidden": true,
+      "index": 6,
+      "width":100
+    },
+    {
+      "label": "码单重量",
+      "prop": "billWeight",
+      "overHidden": true,
+      "index": 7,
+      "width":100
+    },
+    {
+      "label": "发票净重",
+      "prop": "invoiceWeight",
+      "overHidden": true,
+      "index": 8,
+      "width":100
+    },
+    {
+      "label": "发货人",
+      "prop": "arrivalContact",
       "search": true,
+      "searchOrder": 5,
       "index": 4,
       "width":120
-    },{
-      "label": "客户名称",
-      "prop": "corpName",
-      "index": 6,
-      "width":150
-    },{
-      "label": "仓库名称",
+    },
+    {
+      "label": "发货电话",
+      "prop": "arrivalTel",
+      "search": true,
+      "searchOrder": 6,
+      "index": 4,
+      "width":120
+    },
+    {
+      "label": "发货地址",
+      "prop": "arrivalAddress",
+      "search": true,
+      "searchOrder": 7,
+      "index": 4,
+      "width":120
+    },
+    {
+      "label": "仓库",
       "prop": "storageId",
       "search": true,
+      "searchOrder": 8,
       "index": 7,
       "width":150
-    },{
-      "label": "发票重量",
-      "prop": "invoiceWeight",
-      "search": true,
-      "index": 9,
-      "width":120
-    },{
+    },
+    {
       "label": "备注",
       "prop": "deliveryRemarks",
-      "search": false,
+      "search": true,
+      "searchOrder": 8,
       "index": 10,
       "width":180
+    },
+    {
+      "label": "系统编号",
+      "prop": "sysNo",
+      "index": 9,
+      "width":120
+    },
+    {
+      "label": "制单人日期",
+      "prop": "createTime",
+      "search": true,
+      "searchOrder": 9,
+      "index": 9,
+      "width":120
+    },
+    {
+      "label": "制单人",
+      "prop": "createUserName",
+      "search": true,
+      "searchOrder": 10,
+      "index": 9,
+      "width":120
     }
   ]
 }

+ 45 - 57
src/views/importTrade/receipt/detailsPageEdit.vue

@@ -236,8 +236,8 @@
       width="60%"
       :close-on-click-modal="false"
       :destroy-on-close="true"
-      :modal-append-to-body='false'
       :close-on-press-escape="false"
+      top="10vh"
       v-dialog-drag>
       <procurement-detail
         @closeFun="!procurementDialog"
@@ -287,6 +287,7 @@ export default {
     return {
       form: {},
       disabled: false,
+      skip:false,
       receiptDisable:false,
       customerContact: customerContact,
       contactsForm: {},
@@ -480,37 +481,31 @@ export default {
       })
     }
     if(this.detailData.params){
+      this.skip = true
       detailListData(this.detailData.params.id).then(res =>{
-        const orderNoList = [];
-        res.data.data.itemsVOList.forEach((item,index) =>{
-          this.detailData.params.orderItemIds.forEach((e,i) =>{
-            if(e ==  index){
-              item.srcId =  item.id;
-              item.orgOrderNo =  res.data.data.orgOrderNo;
-              item.contractNumber =  res.data.data.orderNo;
-              orderNoList.push(item.contractNumber)
-              if(item.actualQuantity !== 0){   //如果收过货
-                item.actualQuantity = _.subtract(item.orderQuantity, item.actualQuantity); //收货件数 = 采购件数 - 已收件数
-              }else{
-                item.actualQuantity =  item.orderQuantity;
-              }
-              item.contractAmount =  item.amount;
-              //如果件数 和 码单重量不为 0 或空   算出一件的重量  并记录每一行的
-              if(item.orderQuantity && item.orderQuantity!= "0"
-                && item.billWeight && item.billWeight!= "0"
-                && item.invoiceWeight && item.invoiceWeight!= "0"){
-                this.singleton[index]={
-                  BQ : _.divide(item.billWeight, item.orderQuantity),
-                  IQ : _.divide(item.invoiceWeight, item.orderQuantity)
-                }
-              }
-              delete item.id
-              this.$refs.crudContact.rowCellAdd(item);
-              this.$refs.crudContact.rowCell(item,this.contactsData.length - 1)
-            }
-          })
+        const orderNoList = [];  //合同号数据
+        this.detailData.params.orderItemIds.forEach((e,i) =>{
+          const item =   res.data.data.itemsVOList[e];
+          item.srcId =  item.id;
+          item.orgOrderNo =  res.data.data.orgOrderNo;
+          item.contractNumber =  res.data.data.orderNo;
+          orderNoList.push(item.contractNumber)
+          if(item.actualQuantity !== 0){   //如果收过货
+            item.actualQuantity = _.subtract(item.orderQuantity, item.actualQuantity); //收货件数 = 采购件数 - 已收件数
+          }else{
+            item.actualQuantity =  item.orderQuantity;
+          }
+          item.contractAmount =  item.amount;
+          //码单重量 除以 数量     每个的码单重量
+          item.singleton = {
+            BQ : _.divide(item.billWeight, item.orderQuantity),
+            IQ : _.divide(item.invoiceWeight, item.orderQuantity)
+          }
+          delete item.id
+          this.$refs.crudContact.rowCellAdd(item);
+          this.$refs.crudContact.rowCell(item,this.contactsData.length - 1)
         })
-        this.$set(this.form,'orderNo', Array.from(new Set(orderNoList)).join(","))
+        this.$set(this.form,'orderNo', Array.from(new Set(orderNoList)).join(","))  // 数组去重逗号隔开 那合同总
         this.$set(this.form,'saleman',res.data.data.salesName)
         this.$set(this.form,'corpId',res.data.data.corpsName[0].id)
         this.$set(this.form,'orgOrderNo', res.data.data.orgOrderNo)
@@ -535,7 +530,7 @@ export default {
           storageId:this.form.storageId,
         }
         selectGoodsNum(params).then(res =>{
-          this.$set(this.contactsData[row.$index],"kuCun",res.data.data)
+          this.$set(this.contactsData[row.$index],"inventoryNumber",res.data.data)
         })
       }
     },
@@ -548,29 +543,29 @@ export default {
       }
     },
     actualQuantityChange(row){
-      if(row.orderQuantity && row.orderQuantity!= "0"
-        && row.billWeight && row.billWeight!= "0"
-        && row.invoiceWeight && row.invoiceWeight!= "0"){
-        row.billWeight = _.multiply(this.singleton[row.$index].BQ,row.actualQuantity)
-        row.invoiceWeight = _.multiply(this.singleton[row.$index].IQ,row.actualQuantity)
+      if(row.singleton){
+        const _sing =   row.singleton
+        if( _sing.BQ !== 0){  //如果有值并且不为空 计算码单与发票
+          row.billWeight = _.multiply(_sing.BQ,row.actualQuantity)
+        }
+        if( _sing.IQ !== 0){
+          row.invoiceWeight = _.multiply(_sing.IQ,row.actualQuantity)
+          this.invoiceWeightChange(row)  //发票改变合同
+        }
         this.totalChange()
-        this.priceChange(row)
-        this.invoiceWeightChange(row)
       }
     },
     //合计
     totalChange(){
       let invoiceList =  this.contactsData.map(item => {
-        if(!item.invoiceWeight){
-          item.invoiceWeight = 0
-        }
-        return parseFloat(item.invoiceWeight);
+        if(item.invoiceWeight){
+          return parseFloat(item.invoiceWeight);
+        }else return 0
       });
       let billList =  this.contactsData.map(item => {
-        if(!item.billWeight){
-          item.billWeight = 0
-        }
-        return parseFloat(item.billWeight);
+        if(item.billWeight){
+          return parseFloat(item.billWeight);
+        }else return 0
       });
       this.$set(this.form,"invoiceWeight",invoiceList.reduce((n,m) => n + m))
       this.$set(this.form,"billWeight",billList.reduce((n,m) => n + m))
@@ -750,21 +745,14 @@ export default {
         item.contractNumber = item.orderNo;
         item.contractAmount = item.amount;
         item.actualQuantity = item.orderQuantity;
+        item.singleton = {
+          BQ : _.divide(item.billWeight, item.orderQuantity),
+          IQ : _.divide(item.invoiceWeight, item.orderQuantity)
+        }
         this.$refs.crudContact.rowCellAdd(item);
         this.selectInventory(item)
       })
 
-      this.contactsData.forEach((item,index)=>{
-        if(item.orderQuantity && item.orderQuantity!= "0"
-          && item.billWeight && item.billWeight!= "0"
-          && item.invoiceWeight && item.invoiceWeight!= "0"){
-          this.singleton[index]={
-            BQ : _.divide(item.billWeight, item.orderQuantity),
-            IQ : _.divide(item.invoiceWeight, item.orderQuantity)
-          }
-        }
-      })
-
       this.totalChange()
       this.sumOrderNo();   //合并合同号
       this.procurementDialog = false;

+ 2 - 3
src/views/importTrade/receipt/index.vue

@@ -78,7 +78,7 @@ export default {
       form: {},
       show:true,
       detailData:{},
-      option: {},
+      option: option,
       parentId: 0,
       dataList: [],
       page: {
@@ -92,7 +92,7 @@ export default {
     detailPage
   },
   async created() {
-    this.option = await this.getColumnData(this.getColumnName(40), option);
+    // this.option = await this.getColumnData(this.getColumnName(40), option);
   },
   activated() {
     setTimeout(() => {
@@ -195,7 +195,6 @@ export default {
     },
     //点击搜索按钮触发
     searchChange(params, done) {
-      console.log(params)
       this.page.currentPage = 1;
       this.onLoad(this.page, params);
       done()

+ 4 - 3
src/views/purchase/contract/config/commodity.json

@@ -4,10 +4,11 @@
   "calcHeight": 80,
   "tip": false,
   "addBtn": false,
-  "searchShow": false,
+  "searchShow": true,
   "searchShowBtn": false,
+  "searchMenuSpan": 12,
+  "searchMenuPosition": "right",
   "menu": false,
-  "searchMenuSpan": 6,
   "border": true,
   "index": true,
   "selection": true,
@@ -31,6 +32,7 @@
       "label": "商品名称",
       "prop": "cname",
       "slot": true,
+      "search": true,
       "width": 250,
       "rules": [
         {
@@ -43,7 +45,6 @@
     {
       "label": "规格编码",
       "prop": "typeno",
-      "search": true,
       "width": 200
     },
     {

+ 69 - 19
src/views/purchase/contract/config/mainList.json

@@ -6,6 +6,7 @@
   "searchMenuSpan": 6,
   "dialogWidth": "60%",
   "align": "center",
+  "searchSpan": 8,
   "searchMenuPosition": "right",
   "tree": true,
   "border": true,
@@ -18,7 +19,7 @@
   "dialogClickModal": false,
   "searchLabelWidth": 120,
   "searchIcon": true,
-  "searchIndex": 3,
+  "searchIndex": 2,
   "addBtnText": "新单",
   "expand": true,
   "column":[
@@ -26,19 +27,35 @@
       "label": "合同号",
       "prop": "orderNo",
       "search": true,
+      "searchOrder": 1,
       "index": 1,
+      "overHidden": true,
+      "width":150
+    },
+    {
+      "label": "提单号",
+      "prop": "billNo",
+      "search": true,
+      "searchOrder": 2,
+      "overHidden": true,
+      "index": 2,
       "width":150
     },
     {
       "label": "供应商",
       "prop": "strCorpName",
       "search": true,
-      "index": 2,
+      "overHidden": true,
+      "searchOrder": 3,
+      "index": 3,
       "width":200
-    },{
+    },
+    {
       "label": "采购商",
       "prop": "strPurchaserName",
-      "index": 3,
+      "overHidden": true,
+      "searchOrder": 4,
+      "index": 4,
       "width":200
     },
     {
@@ -49,40 +66,61 @@
       "valueFormat": "yyyy-MM-dd",
       "unlinkPanels": true,
       "searchRange": true,
+      "searchOrder": 5,
       "search": true,
-      "index": 4,
+      "overHidden": true,
+      "index": 5,
       "width":150
     },
     {
+      "label": "数量",
+      "prop": "orderQuantity",
+      "overHidden": true,
+      "index": 6,
+      "width":100
+    },
+    {
       "label": "码单重量",
       "prop": "billWeight",
-      "index": 5,
+      "overHidden": true,
+      "index": 7,
       "width":100
-    },{
+    },
+    {
       "label": "发票净重",
       "prop": "invoiceWeight",
-      "index": 6,
+      "overHidden": true,
+      "index": 8,
+      "width":100
+    },
+    {
+      "label": "已收数量",
+      "prop": "actualQuantity",
+      "overHidden": true,
+      "index": 9,
       "width":100
     },
     {
       "label": "合同金额",
       "prop": "orderAmount",
-      "search": true,
-      "index": 7,
+      "overHidden": true,
+      "index": 10,
       "width":100
     },
     {
       "label": "已付金额",
       "prop": "settlmentAmount",
-      "search": true,
-      "index": 8,
+      "overHidden": true,
+      "index": 11,
       "width":100
     },
     {
       "label": "业务员",
       "prop": "salesName",
+      "overHidden": true,
+      "searchOrder": 6,
       "search": true,
-      "index": 9,
+      "index": 12,
       "width":100
     },
     {
@@ -93,8 +131,10 @@
       "valueFormat": "yyyy-MM-dd",
       "unlinkPanels": true,
       "searchRange": true,
+      "overHidden": true,
       "search": true,
-      "index": 10,
+      "searchOrder": 7,
+      "index": 13,
       "width":150
     },
     {
@@ -105,8 +145,10 @@
       "valueFormat": "yyyy-MM-dd",
       "unlinkPanels": true,
       "searchRange": true,
+      "overHidden": true,
       "search": true,
-      "index": 11,
+      "searchOrder": 8,
+      "index": 14,
       "width":150
     },
     {
@@ -117,8 +159,10 @@
       "valueFormat": "yyyy-MM-dd",
       "unlinkPanels": true,
       "searchRange": true,
+      "overHidden": true,
       "search": true,
-      "index": 12,
+      "searchOrder": 9,
+      "index": 15,
       "width":150
     },
      {
@@ -129,8 +173,10 @@
       "valueFormat": "yyyy-MM-dd",
       "unlinkPanels": true,
       "searchRange": true,
+       "overHidden": true,
        "search": true,
-      "index": 13,
+       "searchOrder": 10,
+      "index": 16,
       "width":150
     },
     {
@@ -141,14 +187,18 @@
       "valueFormat": "yyyy-MM-dd",
       "unlinkPanels": true,
       "searchRange": true,
+      "overHidden": true,
       "search": true,
-      "index": 14,
+      "searchOrder": 11,
+      "index": 17,
       "width":150
     },
     {
       "label": "备注",
       "prop": "orderRemark",
-      "index": 15,
+      "overHidden": true,
+      "searchOrder": 12,
+      "index": 18,
       "width":200
     }
   ]

+ 49 - 62
src/views/purchase/contract/detailsPage.vue

@@ -6,28 +6,34 @@
                    @click="backToList">返回列表
         </el-button>
       </div>
-      <el-button type="primary"
-                 class="el-button--small-yh add-customer-btn-four"
-                 :disabled="true"
-                 @click.stop="">请核
-      </el-button>
-      <el-button type="warning"
-                 class="el-button--small-yh add-customer-btn-three"
-                 @click.stop="applyPayment()">申请货款
-      </el-button>
-      <el-button type="success"
-                 class="el-button--small-yh add-customer-btn-two"
-                 :disabled="true"
-                 @click.stop="">复制新单
-      </el-button>
-      <el-button
-        class="el-button--small-yh add-customer-btn"
-        type="primary"
-        :disabled="disabled"
-        @click="editCustomer"
-        :loading="butLoading"
-      >{{form.id?'确认修改':'确认新增'}}
-      </el-button>
+      <div class="upper_right_button">
+        <el-button type="primary"
+                   class="el-button--small-yh add-customer-btn-five"
+                   :disabled="true"
+                   @click.stop="">请核
+        </el-button>
+        <el-button type="warning"
+                   class="el-button--small-yh add-customer-btn-four"
+                   @click.stop="applyPayment()">申请货款
+        </el-button>
+        <el-button type="warning"
+                   class="el-button--small-yh add-customer-btn-three"
+                   @click.stop="">生成销售单
+        </el-button>
+        <el-button type="success"
+                   class="el-button--small-yh add-customer-btn-two"
+                   :disabled="true"
+                   @click.stop="">复制新单
+        </el-button>
+        <el-button
+          class="el-button--small-yh add-customer-btn"
+          type="primary"
+          :disabled="disabled"
+          @click="editCustomer"
+          :loading="butLoading"
+        >{{form.id?'确认修改':'确认新增'}}
+        </el-button>
+      </div>
     </div>
     <div style="margin-top: 60px">
       <el-form :model="form" ref="form" label-width="130px">
@@ -238,6 +244,7 @@
                        :table-loading="loading"
                        :data="data"
                        ref="crud"
+                       @search-change="searchChange"
                        @refresh-change="refreshChange"
                        @selection-change="selectionChange"
                        :page.sync="page"
@@ -248,9 +255,6 @@
       <span slot="footer" class="dialog-footer">
           <el-button @click="dialogVisible = false , selectKind = -1">取 消</el-button>
           <el-button type="primary" @click="commodityConfirm" v-if="selectKind != -1"  :disabled="tableData.length !== 1">确定</el-button>
-<!--          <el-button type="primary" @click="importGoods" v-if="commodityData !== true && selectKind == -1" :disabled="tableData.length !== 1">导入</el-button>-->
-<!--          <el-button type="primary" @click="importChoice"  v-if="commodityData === true  && selectKind == -1"-->
-<!--                     :disabled="tableData.length !== 1">导入<</el-button>-->
         </span>
     </el-dialog>
     <el-dialog
@@ -493,7 +497,7 @@ export default {
           },{
             label: '合同号',
             prop: 'orderNo',
-            disabled:false,
+            disabled:true,
             rules: [
               {
                 required: false,
@@ -772,16 +776,14 @@ export default {
     //合计
     totalChange(){
       let invoiceList =  this.contactsData.map(item => {
-        if(!item.invoiceWeight){
-          item.invoiceWeight = 0
-        }
-        return parseFloat(item.invoiceWeight);
+        if(item.invoiceWeight){
+          return parseFloat(item.invoiceWeight);
+        }else return 0
       });
       let billList =  this.contactsData.map(item => {
-        if(!item.billWeight){
-          item.billWeight = 0
-        }
-        return parseFloat(item.billWeight);
+        if(item.billWeight){
+          return parseFloat(item.billWeight);
+        }else return 0
       });
       this.form.invoiceWeight = invoiceList.reduce((n,m) => n + m)
       this.form.billWeight = billList.reduce((n,m) => n + m)
@@ -820,12 +822,13 @@ export default {
               return this.$message.error(`请输入采购明细第${j + 1}行的货物品种`);
             }
             if (this.contactsData[j].orderQuantity === "") {
-              return this.$message.error(`请输入采购明细第${j + 1}行的数`);
+              return this.$message.error(`请输入采购明细第${j + 1}行的数`);
             }
             if (this.contactsData[j].orderQuantity == 0) {
-              return this.$message.error(`采购明细第${j + 1}行的数不能为0`);
+              return this.$message.error(`采购明细第${j + 1}行的数不能为0`);
             }
           }
+          this.form.billNo = this.contactsData.map(item =>{return item.billNo}).join(",")
           let submitDto = {
             ...this.form,
             tradeType:"JK",
@@ -1045,19 +1048,15 @@ export default {
     },
     //商品新增触发
     commoditySelection() {
-      // const params ={
-      //   billWeight:"0",
-      //   invoiceWeight:"0",
-      //   price:"0",
-      //   purchaseQuantity:"0",
-      // }
       this.$refs.crudContact.rowCellAdd();
-      // this.dialogVisible = !this.dialogVisible
-      // this.commodityData = false
     },
     //点击行可编辑
     handleRowClick(row, event, column) {
     },
+    searchChange(params, done){
+      this.onLoad(this.page, params);
+      done()
+    },
     //刷新触发
     refreshChange() {
       this.treeDeptId = '';
@@ -1084,7 +1083,9 @@ export default {
       this.loading = true;
       getList(page.currentPage, page.pageSize, Object.assign(params, this.query), this.treeDeptId).then(res => {
         const data = res.data.data;
-        this.page.total = data.total;
+        if(data.total>10){
+          this.page.total = data.total;
+        }
         this.data = data.records;
         this.loading = false;
       });
@@ -1176,9 +1177,10 @@ export default {
   color: #323233;
   font-weight: 400;
 }
-.add-customer-btn-two {
+.upper_right_button{
+  display: flex;
   position: fixed;
-  right: 150px;
+  right: 20px;
   top: 115px;
 }
 .required_fields{
@@ -1186,21 +1188,6 @@ export default {
   display:inline-block;
   width: 7%
 }
-.add-customer-btn-three {
-  position: fixed;
-  right: 266px;
-  top: 115px;
-}
-.add-customer-btn-four {
-  position: fixed;
-  right: 385px;
-  top: 115px;
-}
-.add-customer-btn {
-  position: fixed;
-  right: 36px;
-  top: 115px;
-}
 ::v-deep .el-form-item {
   margin-bottom: 0;
 }

+ 18 - 3
src/views/purchase/contract/index.vue

@@ -222,21 +222,36 @@ export default {
     },
     onLoad(page, params) {
       if(params){
-        if (params.businesDate != undefined) {
+        if (params.businesDate != undefined) {  //合同
           params.businesStartDate = params.businesDate[0]+ " " + "00:00:00";
           params.businesEndDate = params.businesDate[1] + " " + "23:59:59";
           this.$delete(params,'businesDate')
         }
-        if (params.accountsCollectionDate!= undefined) {
+        if (params.requiredDeliveryDate!= undefined) {  //发货
+          params.requiredDeliveryStartDate = params.requiredDeliveryDate[0]+ " " + "00:00:00";
+          params.requiredDeliveryEndDate = params.requiredDeliveryDate[1] + " " + "23:59:59";
+          this.$delete(params,'requiredDeliveryDate')
+        }
+        if (params.requiredArrivalDate!= undefined) {  //到货
+          params.requiredArrivalStartDate = params.requiredArrivalDate[0]+ " " + "00:00:00";
+          params.requiredArrivalEndDate = params.requiredArrivalDate[1] + " " + "23:59:59";
+          this.$delete(params,'requiredArrivalDate')
+        }
+        if (params.accountsCollectionDate!= undefined) {  //付款
           params.accountsCollectionStartDate = params.accountsCollectionDate[0]+ " " + "00:00:00";
           params.accountsCollectionEndDate = params.accountsCollectionDate[1] + " " + "23:59:59";
           this.$delete(params,'accountsCollectionDate')
         }
-        if (params.dateOfArrival!= undefined) {
+        if (params.dateOfArrival!= undefined) {   //到港
           params.dateOfStartArrival = params.dateOfArrival[0]+ " " + "00:00:00";
           params.dateOfEndArrival = params.dateOfArrival[1] + " " + "23:59:59";
           this.$delete(params,'dateOfArrival')
         }
+        if (params.creditDate!= undefined) {  //信用
+          params.creditStartDate = params.creditDate[0]+ " " + "00:00:00";
+          params.creditEndDate = params.creditDate[1] + " " + "23:59:59";
+          this.$delete(params,'creditDate')
+        }
       }
       let queryParams = Object.assign({}, params, {
         size: page.pageSize,

+ 73 - 12
src/views/salesManagement/salesContract/config/mainList.json

@@ -4,6 +4,7 @@
   "simplePage": true,
   "searchShow": true,
   "searchMenuSpan": 6,
+  "searchSpan": 8,
   "searchMenuPosition": "right",
   "dialogWidth": "60%",
   "tree": true,
@@ -17,6 +18,8 @@
   "align": "center",
   "dialogClickModal": false,
   "searchLabelWidth": 120,
+  "searchIcon": true,
+  "searchIndex": 2,
   "addBtnText": "新单",
   "expand": true,
   "rowKey": "id",
@@ -24,48 +27,106 @@
     {
       "label": "合同号",
       "prop": "orderNo",
+      "overHidden": true,
       "search": true,
-      "index": 2,
+      "searchOrder": 1,
+      "index": 1,
       "width":150
-    },{
+    },
+    {
+      "label": "提单号",
+      "prop": "billNo",
+      "overHidden": true,
+      "search": true,
+      "searchOrder": 2,
+      "index": 2,
+      "width":180
+    },
+    {
       "label": "客户名称",
       "prop": "corpsName",
+      "overHidden": true,
       "search": true,
-      "index": 4,
+      "searchOrder": 3,
+      "index": 3,
       "width":150
     },
     {
       "label": "合同日期",
       "prop": "businesDate",
-      "search": false,
+      "overHidden": true,
+      "search": true,
+      "searchOrder": 4,
+      "index": 4,
+      "width":150
+    },
+    {
+      "label": "数量",
+      "prop": "orderQuantity",
+      "overHidden": true,
+      "index": 5,
+      "width":100
+    },
+    {
+      "label": "码单重量",
+      "prop": "billWeight",
+      "overHidden": true,
       "index": 6,
       "width":100
     },
     {
+      "label": "发票净重",
+      "prop": "invoiceWeight",
+      "overHidden": true,
+      "index": 7,
+      "width":100
+    },
+    {
+      "label": "已发数量",
+      "prop": "invoiceWeight",
+      "overHidden": true,
+      "index": 8,
+      "width":100
+    },
+    {
       "label": "合同金额",
       "prop": "orderAmount",
+      "overHidden": true,
       "search": true,
-      "index": 5,
+      "index": 9,
       "width":120
     },
     {
+      "label": "已付金额",
+      "prop": "settlmentAmount",
+      "overHidden": true,
+      "index": 10,
+      "width":100
+    },
+    {
       "label": "业务员",
       "prop": "salesName",
+      "overHidden": true,
       "search": true,
-      "index": 8,
+      "searchOrder": 5,
+      "index": 11,
       "width":120
     },{
       "label": "客户首付日期",
       "prop": "advanceCollectionDate",
-      "search": false,
-      "index": 8,
-      "width":120
+      "overHidden": true,
+      "search": true,
+      "searchOrder": 6,
+      "index": 12,
+      "width":150
     },{
       "label": "备注",
       "prop": "orderRemark",
-      "search": false,
-      "index": 8,
-      "width":100
+      "overHidden": true,
+      "search": true,
+      "searchOrder": 7,
+      "index": 13,
+      "width":200
     }
   ]
 }

+ 48 - 46
src/views/salesManagement/salesContract/detailsPage.vue

@@ -45,7 +45,7 @@
                 </el-select>
                 <selectComponent v-else-if="item.prop === 'corpId'" v-model="form[item.prop]" :configuration="configuration"/>
                 <selectComponent v-else-if="item.prop === 'belongToCorpId'" v-model="form[item.prop]" :configuration="bConfiguration"/>
-                <el-input type="age" v-else-if="item.prop === 'downPayment'" v-model="form[item.prop]"    :disabled="item.disabled?true:false" size="small" autocomplete="off" placeholder="请输入">
+                <el-input type="age" v-else-if="item.prop === 'downPayment'" v-model="form[item.prop]"  @change="downPaymentChange"  :disabled="item.disabled?true:false" size="small" autocomplete="off" placeholder="请输入">
                   <template slot="append">%</template>
                 </el-input>
                 <el-input type="textarea" v-else-if="(item.prop === 'orderRemark')" v-model="form[item.prop]"   size="small" autocomplete="off" placeholder="请输入"></el-input>
@@ -343,9 +343,10 @@ export default {
           }, {
             label: '合同号',
             prop: 'orderNo',
+            disabled:true,
             rules: [
               {
-                required: true,
+                required: false,
                 message: ' ',
                 trigger: 'blur'
               }
@@ -676,19 +677,23 @@ export default {
     uploadFile
   },
   methods: {
+    //首付比例  带出金额
+    downPaymentChange(){
+      if(this.form.orderAmount){
+        this.form.advancePayment = _.multiply(this.form.orderAmount,(this.form.downPayment*0.01)).toFixed(2)
+      }
+    },
     //合计
     totalChange(){
       let invoiceList =  this.importInventoryData.map(item => {
-        if(!item.invoiceWeight){
-          item.invoiceWeight = 0
-        }
-        return parseFloat(item.invoiceWeight);
+        if(item.invoiceWeight){
+          return parseFloat(item.invoiceWeight);
+        }else return 0
       });
       let billList =  this.importInventoryData.map(item => {
-        if(!item.billWeight){
-          item.billWeight = 0
-        }
-        return parseFloat(item.billWeight);
+        if(item.billWeight){
+          return parseFloat(item.billWeight);
+        }else return 0
       });
       this.$set(this.form,"invoiceWeight", invoiceList.reduce((n,m) => n + m))
       this.$set(this.form,"billWeight", billList.reduce((n,m) => n + m))
@@ -725,43 +730,46 @@ export default {
     },
     editCustomer(status) {
       this.$refs["form"].validate((valid) => {
-        let orderFeesList = this.$refs.feeInfo.submitData();
-        for (let i = 0; i < orderFeesList.length; i++) {
-          if (orderFeesList[i].corpId == null) {
-            return this.$message.error(`请输入第${i + 1}行的结算中心`);
-          }
-          if (orderFeesList[i].price == 0) {
-            return this.$message.error(`请正确输入第${i + 1}行的价格`);
-          }
-          if (orderFeesList[i].orderQuantity == 0) {
-            return this.$message.error(`请正确输入第${i + 1}行的数量`);
-          }
-        }
-        let orderUpLoadList = this.$refs.uploadFile.submitData();
-        for (let j = 0; j < this.importInventoryData.length; j++) {
-          if (this.importInventoryData[j].billNo === "") {
-            return this.$message.error(`请输入销售明细第${j + 1}行的提单号`);
-          }
-          if (this.importInventoryData[j].orgOrderNo === "") {
-            return this.$message.error(`请输入销售明细第${j + 1}行的合同号`);
-          }
-          if (this.importInventoryData[j].priceCategory === "") {
-            return this.$message.error(`请输入销售明细第${j + 1}行的货品物种`);
-          }
-          if (this.importInventoryData[j].orderQuantity === "") {
-            return this.$message.error(`请输入销售明细第${j + 1}行的件数`);
+        if (valid) {
+          let orderFeesList = this.$refs.feeInfo.submitData();
+          for (let i = 0; i < orderFeesList.length; i++) {
+            if (orderFeesList[i].corpId == null) {
+              return this.$message.error(`请输入第${i + 1}行的结算中心`);
+            }
+            if (orderFeesList[i].price == 0) {
+              return this.$message.error(`请正确输入第${i + 1}行的价格`);
+            }
+            if (orderFeesList[i].orderQuantity == 0) {
+              return this.$message.error(`请正确输入第${i + 1}行的数量`);
+            }
           }
-          if (this.importInventoryData[j].orderQuantity == 0) {
-            return this.$message.error(`销售明细第${j + 1}行的件数不能为0`);
+          let orderUpLoadList = this.$refs.uploadFile.submitData();
+          for (let j = 0; j < this.importInventoryData.length; j++) {
+            if (this.importInventoryData[j].billNo === "") {
+              return this.$message.error(`请输入销售明细第${j + 1}行的提单号`);
+            }
+            if (this.importInventoryData[j].orgOrderNo === "") {
+              return this.$message.error(`请输入销售明细第${j + 1}行的合同号`);
+            }
+            if (this.importInventoryData[j].priceCategory === "") {
+              return this.$message.error(`请输入销售明细第${j + 1}行的货品物种`);
+            }
+            if (this.importInventoryData[j].orderQuantity === "") {
+              return this.$message.error(`请输入销售明细第${j + 1}行的数量`);
+            }
+            if (this.importInventoryData[j].orderQuantity == 0) {
+              return this.$message.error(`销售明细第${j + 1}行的数量不能为0`);
+            }
           }
-        }
-        if (valid) {
+
+          this.form.billNo = this.importInventoryData.map(item =>{return item.billNo}).join(",")
           let submitDto = {
             ...this.form,
             orderItemsList: this.importInventoryData,
             orderFeesList: orderFeesList,
             orderUpLoadList:orderUpLoadList,
           };
+
           submitData(submitDto).then(res => {
             if(res.data.success){
               this.$message.success("操作成功!")
@@ -874,13 +882,7 @@ export default {
     },
     //商品明细导入
     newDetails(){
-      const params ={
-        billWeight:0,
-        invoiceWeight:0,
-        price:0,
-        orderQuantity:0,
-      }
-      this.$refs.importInventory.rowCellAdd(params);
+      this.$refs.importInventory.rowCellAdd();
     },
     //商品编辑
     rowCell(row, index) {

+ 2 - 2
src/views/salesManagement/salesContract/index.vue

@@ -91,7 +91,7 @@ export default {
   name: "index",
   data() {
     return {
-      option: {},
+      option: option,
       dataList: [],
       show:true,
       page: {
@@ -108,7 +108,7 @@ export default {
     detailPage
   },
   async created() {
-    this.option = await this.getColumnData(this.getColumnName(38), option);
+    // this.option = await this.getColumnData(this.getColumnName(38), option);
   },
   methods: {
     //删除列表后面的删除按钮触发触发(row, index, done)