瀏覽代碼

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

QuKatie 3 年之前
父節點
當前提交
fc034c789f
共有 30 個文件被更改,包括 965 次插入508 次删除
  1. 16 0
      src/api/basicData/receipt.js
  2. 13 0
      src/api/importTrade/purchase.js
  3. 8 0
      src/api/importTrade/receipt.js
  4. 43 25
      src/components/procurement/config/mainList.json
  5. 86 0
      src/components/procurement/index.vue
  6. 0 59
      src/components/procurement/procurementDetail.vue
  7. 1 1
      src/components/selectComponent/customerSelect.vue
  8. 4 1
      src/page/index/tags.vue
  9. 1 2
      src/router/views/index.js
  10. 1 0
      src/store/getters.js
  11. 16 3
      src/store/modules/ifdetail.js
  12. 5 3
      src/views/businessManagement/deliveryNotice/configuration/mainList.json
  13. 51 22
      src/views/businessManagement/deliveryNotice/detailsPageEdit.vue
  14. 51 5
      src/views/businessManagement/deliveryNotice/index.vue
  15. 1 2
      src/views/businessManagement/purchaseOrder/configuration/customerContact.json
  16. 4 2
      src/views/businessManagement/purchaseOrder/configuration/mainList.json
  17. 52 26
      src/views/businessManagement/purchaseOrder/detailsPageEdit.vue
  18. 37 0
      src/views/businessManagement/purchaseOrder/index.vue
  19. 8 7
      src/views/businessManagement/receipt/configuration/customerContact.json
  20. 6 3
      src/views/businessManagement/receipt/configuration/mainList.json
  21. 144 151
      src/views/businessManagement/receipt/detailsPageEdit.vue
  22. 51 7
      src/views/businessManagement/receipt/index.vue
  23. 7 4
      src/views/businessManagement/salesOrder/configuration/mainList.json
  24. 27 6
      src/views/businessManagement/salesOrder/detailsPageEdit.vue
  25. 37 2
      src/views/businessManagement/salesOrder/index.vue
  26. 31 38
      src/views/importTrade/receipt/config/customerContact.json
  27. 113 53
      src/views/importTrade/receipt/detailsPageEdit.vue
  28. 30 38
      src/views/purchase/contract/config/customerContact.json
  29. 119 46
      src/views/purchase/contract/detailsPage.vue
  30. 2 2
      src/views/wel/components/butCard.vue

+ 16 - 0
src/api/basicData/receipt.js

@@ -120,3 +120,19 @@ export function corpstypeTree() {
         method: 'get'
     })
 }
+//确认发货
+export function sendInGoods(data) {
+  return request({
+    url: '/api/blade-deliver-goods/delivery/comfire',
+    method: 'post',
+    data: data
+  })
+}
+// 撤销发货
+export function revokeInGoods(data) {
+  return request({
+    url: '/api/blade-deliver-goods/delivery/cancel',
+    method: 'post',
+    data: data
+  })
+}

+ 13 - 0
src/api/importTrade/purchase.js

@@ -60,3 +60,16 @@ export function getSysNo(prefix) {
     params: {prefix}
   })
 }
+
+//获取采购明细列表
+export function getItemListByConditions(current,size,params) {
+  return request({
+    url: '/api/trade-purchase/purchase-order/getItemListByConditions',
+    method: 'get',
+    params: {
+      ...params,
+      current,
+      size,
+    }
+  })
+}

+ 8 - 0
src/api/importTrade/receipt.js

@@ -68,3 +68,11 @@ export function confirmReceipt(data) {
     data: data
   })
 }
+//撤销收货
+export function repealReceipt(data) {
+  return request({
+    url: 'api/blade-deliver-goods/importDelivery/cancel',
+    method: 'post',
+    data: data
+  })
+}

+ 43 - 25
src/components/procurement/config/mainList.json

@@ -17,59 +17,77 @@
   "border": true,
   "index": true,
   "selection": true,
-  "menuWidth": 180,
+  "menu": false,
+  "menuWidth": 0,
   "dialogClickModal": false,
   "column":[
     {
+      "label": "合同号",
+      "prop": "orderNo",
+      "search": true,
+      "index": 1,
+      "width":180
+    },
+    {
       "label": "提单号",
       "prop": "billNo",
-      "index": 1,
+      "index": 2,
       "width":180
-    },{
+    },
+    {
+      "label": "供应商",
+      "prop": "strCorpName",
+      "search": true,
+      "index": 3,
+      "width":180
+    },
+    {
       "label": "货物品种",
       "prop": "priceCategory",
-      "index": 2,
+      "index": 4,
       "width":120
     },{
-      "label": "货物详情",
-      "prop": "itemDescription",
-      "index": 3,
-      "width":180
+      "label": "规格名称",
+      "prop": "itemType",
+      "index": 5,
+      "width":120
     },{
-      "label": "箱号",
-      "prop": "containerNo",
-      "index": 4,
-      "width":100
+      "label": "件数",
+      "prop": "purchaseQuantity",
+      "index": 6,
+      "width":120
     },{
       "label": "发票净重(吨)",
       "prop": "invoiceWeight",
-      "index": 5,
+      "index": 7,
       "width":120
     },{
       "label": "码单重量(吨)",
       "prop": "billWeight",
-      "index": 6,
-      "width":120
-    },{
-      "label": "件数",
-      "prop": "purchaseQuantity",
-      "index": 7,
+      "index": 8,
       "width":120
     },{
       "label": "单价",
       "prop": "price",
-      "index": 8,
+      "index": 9,
       "width":120
     },{
       "label": "合同金额",
       "prop": "amount",
-      "index": 9,
-      "width":120
-    },{
-      "label": "税率",
-      "prop": "taxRate",
       "index": 10,
       "width":120
+    },{
+      "label": "采购日期",
+      "prop": "promentDate",
+      "hide": true,
+      "type": "date",
+      "format": "yyyy-MM-dd",
+      "valueFormat": "yyyy-MM-dd",
+      "unlinkPanels": true,
+      "searchRange": true,
+      "search": true,
+      "index": 6,
+      "width":150
     }
   ]
 }

+ 86 - 0
src/components/procurement/index.vue

@@ -0,0 +1,86 @@
+<template>
+  <div>
+    <avue-crud :option="option"
+               :table-loading="loading"
+               :data="data"
+               ref="crud"
+               @refresh-change="refreshChange"
+               @selection-change="selectionChange"
+               @search-change="searchChange"
+               :page.sync="page"
+               @on-load="onLoad">
+    </avue-crud>
+    <div style="margin-left: 90%">
+       <span slot="footer" class="dialog-footer" >
+           <el-button @click="closeFun()">取 消</el-button>
+           <el-button type="primary" @click="importProMent" :disabled="selectPromentList.length == 0">导入</el-button>
+       </span>
+    </div>
+  </div>
+</template>
+
+<script>
+  import option from './config/mainList.json'
+  import {getItemListByConditions} from "@/api/importTrade/purchase";
+
+  export default {
+    name: "index",
+    props: {
+      itemId: {
+        type: String
+      },
+      closeFun: {
+        type: Function
+      }
+    },
+    data(){
+      return {
+        option:option,
+        loading:false,
+        data:[],
+        selectPromentList:[],
+        page: {
+          pageSize: 10,
+          pagerCount: 5,
+          total: 0,
+        },
+      }
+    },
+    created() {
+
+    },
+    methods:{
+      refreshChange(){
+        this.onLoad(this.page);
+      },
+      searchChange(params,done){
+        this.onLoad(this.page, params);
+        done()
+      },
+      selectionChange(row){
+        this.selectPromentList = row
+      },
+      onLoad(page, params = {}){
+        this.loading = true;
+        if (params.promentDate != undefined) {
+          params.startDate = params.promentDate[0]+ " " + "00:00:00";
+          params.endDate = params.promentDate[1] + " " + "23:59:59";
+          this.$delete(params,'promentDate')
+        }
+        params.tradeType = "JK"
+        getItemListByConditions(page.currentPage, page.pageSize,params).then(res=>{
+          this.data = res.data.data.records
+          this.page.total = res.data.data.total
+        }).finally(()=>{
+          this.loading = false;
+        })
+      },
+      importProMent(){
+        this.$emit('importProMent',this.selectPromentList);
+      }
+    }
+  }
+</script>
+<style scoped>
+
+</style>

+ 0 - 59
src/components/procurement/procurementDetail.vue

@@ -1,59 +0,0 @@
-<template>
-    <div>
-      <avue-crud :option="option"
-                 :table-loading="loading"
-                 :data="data"
-                 ref="crud"
-                 @refresh-change="refreshChange"
-                 :page.sync="page"
-                 @on-load="onLoad">
-      </avue-crud>
-       <span slot="footer" class="dialog-footer" >
-          <el-button type="primary"  @click="closeFun()">关 闭</el-button>
-         <el-button type="primary"  @click="closeFun()">导 入</el-button>
-       </span>
-    </div>
-</template>
-
-<script>
-  import option from "./config/mainList.json"
-
-   export default {
-        name: "detail",
-      props:{
-          status:{
-            type:String
-          },
-        closeFun:{
-          type:Function
-        }
-      },
-      data(){
-          return {
-            option:option,
-            loading:false,
-            data:[],
-            page: {
-              pageSize: 10,
-              pagerCount: 5,
-              total: 0,
-            },
-          }
-      },
-      created() {
-
-      },
-      methods:{
-        refreshChange(){
-
-        },
-        onLoad(){
-
-        }
-      }
-    }
-</script>
-
-<style scoped>
-
-</style>

+ 1 - 1
src/components/selectComponent/customerSelect.vue

@@ -4,7 +4,7 @@
         v-model="value"
         size="small"
         :placeholder="configuration.placeholder"
-        style="border-right: none;"
+        style="border-right: none;width: 100%"
         :disabled="disabled?disabled:false"
         :multiple="configuration.multiple?configuration.multiple:false"
         :collapse-tags="configuration.collapseTags?configuration.collapseTags:false">

+ 4 - 1
src/page/index/tags.vue

@@ -141,9 +141,12 @@ export default {
         if (tag.label == "收货单(E)") {
           this.$store.commit("REC_OUT_DETAIL");
         }
-        if (tag.label == "国内发货单") {
+        if (tag.label == "发货单(N)") {
           this.$store.commit("IN_OUT_DETAIL");
         }
+        if (tag.label == "收货单(N)") {
+          this.$store.commit("DOM_OUT_DETAIL");
+        }
         if (tag.label == "发货单(I)") {
           this.$store.commit("GO_OUT_DETAIL");
         }

+ 1 - 2
src/router/views/index.js

@@ -146,7 +146,7 @@ export default [{
                 name: '发货单(N)',
                 meta: {
                     i18n: 'businessManagement/deliveryNotice/index',
-                    keepAlive: true,
+                  keepAlive: true,
                 },
                 component: () => import( /* webpackChunkName: "views" */ '@/views/businessManagement/deliveryNotice/index')
             }
@@ -209,7 +209,6 @@ export default [{
                 path: '/businessManagement/receipt/index',
                 name: '收货单(N)',
                 meta: {
-                    i18n: 'businessManagement/receipt/index',
                     keepAlive: true,
                 },
                 component: () => import( /* webpackChunkName: "views" */ '@/views/businessManagement/receipt/index')

+ 1 - 0
src/store/getters.js

@@ -26,6 +26,7 @@ const getters = {
   logsFlag: (state, getters) => getters.logsLen === 0,
   flowRoutes: state => state.dict.flowRoutes,
   inStatus: state => state.ifdetail.inStatus,
+  domTakeStatus: state => state.ifdetail.domTakeStatus,
   goStatus: state => state.ifdetail.goStatus,
   takeStatus: state => state.ifdetail.takeStatus,
   outStatus: state => state.ifdetail.outStatus,

+ 16 - 3
src/store/modules/ifdetail.js

@@ -1,6 +1,7 @@
 const ifdetail = {
   state: {
-    inStatus: false, //国内
+    inStatus: false, //国内发货
+    domTakeStatus: false, // 国内收货
     goStatus: false, //进口发货单
     takeStatus: false, //进口发货单
     outStatus: false, //出口发货单
@@ -9,7 +10,7 @@ const ifdetail = {
   },
   actions: {},
   mutations: {
-    //国内状态
+    //国内状态发货单
     // 进入详情页
     IN_IN_DETAIL(state) {
       state.inStatus = true;
@@ -18,6 +19,15 @@ const ifdetail = {
     IN_OUT_DETAIL(state) {
       state.inStatus = false;
     },
+    // 国内收货单状态
+    // 进入详情页
+    DOM_IN_DETAIL(state) {
+      state.domTakeStatus = true;
+    },
+    //退出详情页
+    DOM_OUT_DETAIL(state) {
+      state.domTakeStatus = false;
+    },
     //进口发货单状态
     // 进入详情页
     GO_IN_DETAIL(state) {
@@ -74,9 +84,12 @@ const ifdetail = {
       for (let item in state) {
         state[item] = false
       }
-      if (tag.label == '国内发货单') {
+      if (tag.label == '发货单(N)') {
         state.inStatus = true;
       }
+      if (tag.label == '收货单(N)') {
+        state.domTakeStatus = true;
+      }
       if (tag.label == '进口发货单') {
         state.goStatus = true;
       }

+ 5 - 3
src/views/businessManagement/deliveryNotice/configuration/mainList.json

@@ -58,7 +58,7 @@
             "search": true,
             "index": 4,
             "width":100,
-          "overHidden": true
+            "overHidden": true
         },{
             "label": "匹配订单号",
             "prop": "srcOrderNo",
@@ -99,7 +99,8 @@
             "prop": "businessDate",
             "search": true,
             "index": 8,
-            "width":100
+            "width":100,
+            "pickerOptions": {}
         },{
             "type": "date",
             "unlinkPanels": true,
@@ -110,7 +111,8 @@
             "prop": "createTime",
             "search": true,
             "index": 8,
-            "width":100
+            "width":100,
+            "pickerOptions": {}
         }
     ]
 }

+ 51 - 22
src/views/businessManagement/deliveryNotice/detailsPageEdit.vue

@@ -274,6 +274,7 @@ import optionTwoCost from "./configuration/mainListCost.json"
 import {getDeptLazyTree,getDeptLazyTreeTwo, customerList} from "@/api/basicData/basicFeesDesc";
 import {customerList as wareHouseType} from "@/api/basicData/basicStorageType"
 import {customerList as selectWareHouse} from "@/api/basicData/basicStorageDesc"
+import {selectGoodsNum} from "@/api/basicData/inventoryAccount"
 
 export default {
   name: "detailsPage",
@@ -566,7 +567,6 @@ export default {
       let id = this.detailData.id
       this.queryData(id)
     }else if (this.detailData.form){
-      console.log(this.detailData.form)
       this.form = JSON.parse(this.detailData.form);
       delete this.form.createTime
       delete this.form.id
@@ -587,8 +587,10 @@ export default {
       this.$set(this.form, 'totalCost', 0)
       this.contactsData.forEach(item => {
         this.$set(item, "srcId", item.id)
-        this.$set(item, "actualQuantity", item.orderQuantity)
+        this.$set(item, "actualQuantity", (Number(item.orderQuantity) - Number(item.actualQuantity)))
         this.$set(item, "deliveryAmount", item.amount)
+        this.$set(item, "inventoryNumber", item.storageQuantity)
+        this.$set(item, "inventoryAmount", 0)
         this.form.deliveryAmount += Number(item.deliveryAmount)
         this.form.totalQuantity += Number(item.actualQuantity)
         this.form.totalCost += Number(item.deliveryAmount)
@@ -679,12 +681,19 @@ export default {
             delete item.id
             delete item.pid
           })
+          this.form.deliveryStatus == '录入'
         }
       });
     },
     // 出库数量变化时调用
     actualQuantityChange(row) {
-      row.deliveryAmount = Number(row.actualQuantity) * Number(row.scale)
+      if (row.scale) {
+        row.deliveryAmount = Number(row.actualQuantity) * Number(row.scale)
+        this.contactsData.forEach(item => {
+          this.form.deliveryAmount += Number(item.deliveryAmount)
+          this.form.totalQuantity += Number(item.actualQuantity)
+        })
+      }
     },
     // 类别变换时触发
     warehouseTreeChange(id) {
@@ -726,6 +735,7 @@ export default {
     //商品新增触发
     commoditySelection() {
       this.dialogVisible = !this.dialogVisible
+      this.tableData = []
       this.commodityData = false
     },
     //点击费用明细选择触发
@@ -750,6 +760,12 @@ export default {
         this.contactsData[this.choiceIndexT].typeno = this.tableData[0].typeno
         this.contactsData[this.choiceIndexT].specificationAndModel = this.tableData[0].specificationAndModel
         this.contactsData[this.choiceIndexT].itemId = this.tableData[0].id
+        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
@@ -789,27 +805,32 @@ export default {
       if (this.tableData.length > 0) {
         for (let item in this.tableData) {
           console.log(this.tableData[item])
-          this.$set(this.tableData[item], 'specificationAndModel', this.tableData[item].specs)
-          this.tableData[item].itemId = this.tableData[item].id
-          this.tableData[item].priceCategory = this.tableData[item].goodsTypeName
-          delete this.tableData[item].goodsTypeName
-          delete this.tableData[item].id
-          delete this.tableData[item].status
-          delete this.tableData[item].isDeleted
-          this.$set(this.tableData[item], 'inventoryNumber', 0)
-          this.$set(this.tableData[item], 'actualQuantity', 0)
-          this.$set(this.tableData[item], 'inventoryAmount', 0)
-          this.$set(this.tableData[item], 'deliveryAmount', 0)
-          this.tableData[item].price = 0
-          this.tableData[item].amount = 0
-          this.tableData[item].sort = this.maxGoodsNum + 1
-          this.maxGoodsNum++
-          this.$refs.crudContact.rowCellAdd(this.tableData[item]);
-          console.log(this.contactsData)
-          this.$refs.crudContact.rowCell(this.tableData[item], this.contactsData.length - 1)
+          selectGoodsNum({
+            goodsId: this.tableData[item].id,
+            typeno: this.tableData[item].specs
+          }).then(res =>{
+            this.tableData[item].storageQuantity =  res.data.data
+            this.$set(this.tableData[item], 'specificationAndModel', this.tableData[item].specs)
+            this.tableData[item].itemId = this.tableData[item].id
+            this.tableData[item].priceCategory = this.tableData[item].goodsTypeName
+            delete this.tableData[item].goodsTypeName
+            delete this.tableData[item].id
+            delete this.tableData[item].status
+            delete this.tableData[item].isDeleted
+            this.$set(this.tableData[item], 'inventoryNumber', 0)
+            this.$set(this.tableData[item], 'actualQuantity', 0)
+            this.$set(this.tableData[item], 'inventoryAmount', 0)
+            this.$set(this.tableData[item], 'deliveryAmount', 0)
+            this.tableData[item].price = 0
+            this.tableData[item].amount = 0
+            this.tableData[item].sort = this.maxGoodsNum + 1
+            this.maxGoodsNum++
+            this.$refs.crudContact.rowCellAdd(this.tableData[item]);
+            console.log(this.contactsData)
+            this.$refs.crudContact.rowCell(this.tableData[item], this.contactsData.length - 1)
+          })
         }
       }
-      this.tableData = []
       this.dialogVisible = false
     },
     closeGoods() {
@@ -1056,6 +1077,14 @@ export default {
     sendOutGoods() {
       this.$refs["form"].validate((valid) => {
         if (valid) {
+          if (this.contactsData.length == 0) {
+            return this.$message.error('商品信息为空')
+          }
+          for (let item in this.contactsData) {
+            if (!this.contactsData[item].id) {
+              return this.$message.error('有商品未保存,请先保存')
+            }
+          }
           //商品信息
           this.form.deliveryItemsList = this.contactsData
           this.form.deliveryFeesList = this.advantageProjectData

+ 51 - 5
src/views/businessManagement/deliveryNotice/index.vue

@@ -118,12 +118,53 @@ export default {
   },
   async created() {
     this.option = await this.getColumnData(this.getColumnName(20), option);
-    if (this.$route.query.form) {
-      this.detailData = {
-        form: this.$route.query.form,
-      };
-      this.isShow = false;
+    if (parseInt(this.option.column.length / 4) !== this.option.column.length / 4){
+      const num = 4 - Number(this.option.column.length % 4)
+      this.option.searchMenuSpan = num * 6;
+      this.option.searchMenuPosition = "right";
     }
+    this.option.column.forEach(item => {
+      if (item.pickerOptions) {
+        item.pickerOptions = {
+          shortcuts: [{
+            text: '最近一周',
+            onClick(picker) {
+              const end = new Date();
+              const start = new Date();
+              start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
+              picker.$emit('pick', [start, end]);
+            }
+          }, {
+            text: '最近一个月',
+            onClick(picker) {
+              const end = new Date();
+              const start = new Date();
+              start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
+              picker.$emit('pick', [start, end]);
+            }
+          }, {
+            text: '最近三个月',
+            onClick(picker) {
+              const end = new Date();
+              const start = new Date();
+              start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
+              picker.$emit('pick', [start, end]);
+            }
+          }]
+        }
+      }
+    })
+  },
+  activated() {
+    setTimeout(() => {
+      if (this.$route.query.form) {
+        this.detailData = {
+          form: this.$route.query.form,
+        };
+        this.$store.commit("IN_IN_DETAIL");
+        this.isShow = false;
+      }
+    }, 100);
   },
   methods: {
     //删除列表后面的删除按钮触发触发(row, index, done)
@@ -187,6 +228,7 @@ export default {
         id: row.id,
       };
       this.isShow = false;
+      this.$store.commit("IN_IN_DETAIL");
     },
     //新增跳转页面
     beforeOpen(row, index) {
@@ -194,12 +236,14 @@ export default {
         id: row.id,
       };
       this.isShow = false;
+      this.$store.commit("IN_IN_DETAIL");
     },
     editOpen(row, index) {
       this.detailData = {
         id: row.id,
       };
       this.isShow = false;
+      this.$store.commit("IN_IN_DETAIL");
     },
     // 复制新单
     copyOrder() {
@@ -208,6 +252,7 @@ export default {
         copyId: id,
       };
       this.isShow = false;
+      this.$store.commit("IN_IN_DETAIL");
     },
     //点击新增时触发
     beforeClose(done) {
@@ -273,6 +318,7 @@ export default {
     goBack() {
       this.detailData=this.$options.data().detailData
       this.isShow = true;
+      this.$store.commit("IN_OUT_DETAIL");
     },
     //列保存触发
     async saveColumn() {

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

@@ -94,7 +94,7 @@
       ]
     },{
       "label": "订货数量",
-      "prop": "orderQuantity",
+      "prop": "purchaseQuantity",
       "index": 5,
       "width":100,
       "cell": false,
@@ -126,7 +126,6 @@
       "index": 6,
       "width":100,
       "cell": false,
-      "slot": true,
       "rules": [
         {
           "required": false,

+ 4 - 2
src/views/businessManagement/purchaseOrder/configuration/mainList.json

@@ -83,7 +83,8 @@
             "valueFormat": "yyyy-MM-dd",
             "search": true,
             "index": 8,
-            "width":100
+            "width":100,
+            "pickerOptions": {}
         },{
           "label": "合同日期",
           "type": "date",
@@ -95,7 +96,8 @@
           "width":100,
           "format": "yyyy-MM-dd",
           "valueFormat": "yyyy-MM-dd",
-          "overHidden": true
+          "overHidden": true,
+          "pickerOptions": {}
         }
     ]
 }

+ 52 - 26
src/views/businessManagement/purchaseOrder/detailsPageEdit.vue

@@ -56,14 +56,14 @@
               @selection-change="productSelection"
               @saveColumn="saveColumn('goods')"
           >
-            <template slot="orderQuantity" slot-scope="{ row }">
+            <template slot="purchaseQuantity" slot-scope="{ row }">
               <el-input
                 v-if="row.$cellEdit"
-                v-model="row.orderQuantity"
+                v-model="row.purchaseQuantity"
                 oninput='this.value=this.value.replace(/[^\-?\d.]/g,"").replace(/^(\-)*(\d+)\.(\d\d).*$/, "$1$2.$3")'                size="small"
                 @input="changeContractAmt(row)"
               ></el-input>
-              <span v-else>{{ row.orderQuantity }}</span>
+              <span v-else>{{ row.purchaseQuantity }}</span>
             </template>
             <template slot="price" slot-scope="{ row }">
               <el-input
@@ -115,7 +115,7 @@
                          icon="el-icon-plus"
                          size="small"
                          :disabled="selection.length < 1"
-                         @click="generateShipmentC">生成收货单
+                         @click="getShipmentC">生成收货单
               </el-button>
               <el-button type="info" :size="size" icon="el-icon-printer">报 表</el-button>
             </template>
@@ -410,6 +410,7 @@ import bankOfDeposit from "./configuration/bankOfDeposit.json"
 import commodity from "./configuration/commodity.json"
 import optionTwoCost from "./configuration/mainListCost.json"
 import {getDeptLazyTree, customerList} from "@/api/basicData/basicFeesDesc";
+import {selectGoodsNum} from "@/api/basicData/inventoryAccount"
 
 export default {
   name: "detailsPage",
@@ -628,6 +629,7 @@ export default {
   },
   //初始化查询
   async created() {
+    // this.customerContact = 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 => {
@@ -669,7 +671,7 @@ export default {
         }
         this.configuration.dicData = this.form.corpsName
         let feesData = []
-        this.form.orderFeesList.forEach(item => {
+        this.advantageProjectData.forEach(item => {
           let a = {
             cname: item.corpName,
             id: item.corpId
@@ -730,6 +732,20 @@ export default {
     copyOrder() {
       this.queryData(this.form.id, true)
     },
+    getShipmentC() {
+      console.log(this.$store.getters.domTakeStatus)
+      if (this.$store.getters.domTakeStatus) {
+        this.$alert("收货单存在,请保存发货单再进行操作", "温馨提示", {
+          confirmButtonText: "确定",
+          type: "warning",
+          callback: action => {
+            console.log(action);
+          }
+        });
+      } else {
+        this.generateShipmentC();
+      }
+    },
     //生成收货单
     generateShipmentC() {
       let lsit = []
@@ -756,7 +772,7 @@ export default {
         orderItemIds: lsit
       }
       generateShipment(data).then(res => {
-        console.log(res.data.data)
+        this.$router.$avueRouter.closeTag("/businessManagement/receipt/index");
         this.$router.push({
           path: "/businessManagement/receipt/index",
           query: {form: JSON.stringify(res.data.data)},
@@ -794,6 +810,7 @@ export default {
     //商品新增触发
     commoditySelection() {
       this.dialogVisible = !this.dialogVisible
+      this.tableData = []
       this.commodityData = false
     },
     //点击费用明细选择触发
@@ -822,6 +839,12 @@ export default {
         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
@@ -861,24 +884,27 @@ export default {
       // this.contactsData = this.contactsData.concat(this.tableData)
       if (this.tableData.length > 0) {
         for (let item in this.tableData) {
-          console.log(this.tableData[item])
-          this.tableData[item].itemId = this.tableData[item].id
-          this.tableData[item].priceCategory = this.tableData[item].goodsTypeName
-          delete 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++
-          this.$refs.crudContact.rowCellAdd(this.tableData[item]);
-          this.$refs.crudContact.rowCell(this.tableData[item], this.contactsData.length - 1)
+          selectGoodsNum({
+            goodsId: this.tableData[item].id,
+            typeno: this.tableData[item].specs
+          }).then(res => {
+            this.tableData[item].storageQuantity =  res.data.data
+            this.tableData[item].itemId = this.tableData[item].id
+            this.tableData[item].priceCategory = this.tableData[item].goodsTypeName
+            delete 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++
+            this.$refs.crudContact.rowCellAdd(this.tableData[item]);
+            this.$refs.crudContact.rowCell(this.tableData[item], this.contactsData.length - 1)
+          })
         }
       }
-      this.tableData = []
       this.dialogVisible = false
     },
     closeGoods() {
@@ -1065,15 +1091,15 @@ export default {
     },
     // 计算费用
     changeContractAmt(row) {
-      let orderQuantity = 0;
+      let purchaseQuantity = 0;
       let price = 0;
       if (row.price) {
         price = row.price;
       }
-      if (row.orderQuantity) {
-        orderQuantity = row.orderQuantity;
+      if (row.purchaseQuantity) {
+        purchaseQuantity = row.purchaseQuantity;
       }
-      this.$set(row, "amount", Number(orderQuantity) * Number(price)).toFixed(2);
+      this.$set(row, "amount", Number(purchaseQuantity) * Number(price)).toFixed(2);
     },
     // 去重
     removeRepeat() {

+ 37 - 0
src/views/businessManagement/purchaseOrder/index.vue

@@ -113,6 +113,43 @@ export default {
   async created() {
     // this.option = option
     this.option = await this.getColumnData(this.getColumnName(17), option);
+    console.log(this.option.column.length)
+    if (parseInt(this.option.column.length / 4) !== this.option.column.length / 4){
+      const num = 4 - Number(this.option.column.length % 4)
+      this.option.searchMenuSpan = num * 6;
+      this.option.searchMenuPosition = "right";
+    }
+    this.option.column.forEach(item => {
+      if (item.pickerOptions) {
+        item.pickerOptions = {
+          shortcuts: [{
+            text: '最近一周',
+            onClick(picker) {
+              const end = new Date();
+              const start = new Date();
+              start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
+              picker.$emit('pick', [start, end]);
+            }
+          }, {
+            text: '最近一个月',
+            onClick(picker) {
+              const end = new Date();
+              const start = new Date();
+              start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
+              picker.$emit('pick', [start, end]);
+            }
+          }, {
+            text: '最近三个月',
+            onClick(picker) {
+              const end = new Date();
+              const start = new Date();
+              start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
+              picker.$emit('pick', [start, end]);
+            }
+          }]
+        }
+      }
+    })
   },
   methods: {
     //删除列表后面的删除按钮触发触发(row, index, done)

+ 8 - 7
src/views/businessManagement/receipt/configuration/customerContact.json

@@ -124,28 +124,29 @@
         }
       ]
     },{
-      "label": "入库数量",
-      "prop": "actualQuantity",
+      "label": "采购金额",
+      "prop": "purchaseAmount",
       "index": 6,
       "width":100,
       "cell": true,
       "rules": [
         {
           "required": false,
-          "message": "请输入入库数量",
+          "message": "请输入采购金额",
           "trigger": "blur"
         }
       ]
     },{
-      "label": "采购金额",
-      "prop": "purchaseAmount",
+      "label": "入库数量",
+      "prop": "actualQuantity",
       "index": 6,
       "width":100,
-      "cell": true,
+      "cell": false,
+      "slot": true,
       "rules": [
         {
           "required": false,
-          "message": "请输入采购金额",
+          "message": "请输入入库数量",
           "trigger": "blur"
         }
       ]

+ 6 - 3
src/views/businessManagement/receipt/configuration/mainList.json

@@ -101,7 +101,8 @@
             "prop": "businessDate",
             "search": true,
             "index": 8,
-            "width":100
+            "width":100,
+            "pickerOptions": {}
         },{
             "type": "date",
             "unlinkPanels": true,
@@ -112,7 +113,8 @@
             "prop": "createTime",
             "search": true,
             "index": 8,
-            "width":100
+            "width":100,
+            "pickerOptions": {}
         },{
           "label": "合同日期",
           "type": "date",
@@ -124,7 +126,8 @@
           "width":100,
           "format": "yyyy-MM-dd",
           "valueFormat": "yyyy-MM-dd",
-          "overHidden": true
+          "overHidden": true,
+          "pickerOptions": {}
         }
     ]
 }

+ 144 - 151
src/views/businessManagement/receipt/detailsPageEdit.vue

@@ -9,6 +9,20 @@
       </div>
       <el-button
         class="el-button--small-yh add-customer-btn"
+        style="right: 245px;"
+        type="primary"
+        @click="revokeInGoods"
+        v-if="form.deliveryStatus !== '录入'"
+      >撤销收货</el-button>
+      <el-button
+        class="el-button--small-yh add-customer-btn"
+        style="right: 245px;"
+        type="primary"
+        @click="sendInGoods"
+        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>
@@ -82,6 +96,15 @@
               >{{ row.$cellEdit ? '保存' : '修改' }}
               </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>
             <template slot="menuLeft" slot-scope="{size}">
               <el-button type="primary"
                          icon="el-icon-plus"
@@ -229,138 +252,6 @@
                      :disabled="tableDataCost.length !== 1">导入</el-button>
         </span>
     </el-dialog>
-    <!--打印-->
-    <el-dialog
-        title="打印单"
-        append-to-body
-        class="el-dialogDeep"
-        :visible.sync="printVisible"
-        width="100%"
-        fullscreen
-        :close-on-click-modal="false"
-        :close-on-press-escape="false">
-      <div class="print-div">
-        <div
-            style="
-            display: flex;
-            flex-direction: column;
-            justify-content: center;
-            align-item: center;
-            font-size: 24px;
-            margin-bottom: 5px;
-            width: 100%;
-            text-align: center;
-          "
-        >
-          <div><b>VITAL INDUSTRIAL GROUP LIMITED</b></div>
-          <div>NO.37 DONGHAI ROAD, QINGDAO, CHINA</div>
-          <div>TEL:0086-532-86019080 FAX:0086-532-86019080</div>
-          <div>
-            <b>COMMERCIAL INVOICE</b>
-            <span style="float: right">ORIGINAL</span>
-          </div>
-        </div>
-        <div class="print_table" style="display: flex">
-          <table
-              border="0"
-              cellspacing="0"
-              cellpadding="0"
-              style="width: 100%; line-height: 30px"
-          >
-            <tr>
-              <td colspan="5" rowspan="3">MESSERS:</td>
-              <td colspan="2">INVOICE NO.</td>
-              <td colspan="3"></td>
-            </tr>
-            <tr>
-              <td colspan="2">DATE</td>
-              <td colspan="3"></td>
-            </tr>
-            <tr>
-              <td colspan="2">INCOTERM .</td>
-              <td colspan="3"></td>
-            </tr>
-            <tr>
-              <td colspan="5">PI NO.:</td>
-              <td colspan="2">DELIVERY PORT</td>
-              <td colspan="3"></td>
-            </tr>
-            <tr>
-              <td rowspan="2">NO.</td>
-              <td rowspan="2">DESCRIPTION</td>
-              <td>THICK</td>
-              <td>LENGTH</td>
-              <td>WIDTH</td>
-              <td rowspan="2">SHEETS</td>
-              <td rowspan="2">CRATES</td>
-              <td>UNIT PRICE</td>
-              <td>TOTAL</td>
-              <td>T. AMOUNT</td>
-            </tr>
-            <tr>
-              <td>mm</td>
-              <td>mm</td>
-              <td>mm</td>
-              <td>US$/M²</td>
-              <td>M²</td>
-              <td>US$</td>
-            </tr>
-            <tr>
-              <td>1</td>
-              <td></td>
-              <td></td>
-              <td></td>
-              <td></td>
-              <td></td>
-              <td></td>
-              <td></td>
-              <td></td>
-              <td></td>
-            </tr>
-            <tr>
-              <td>2</td>
-              <td></td>
-              <td></td>
-              <td></td>
-              <td></td>
-              <td></td>
-              <td></td>
-              <td></td>
-              <td></td>
-              <td></td>
-            </tr>
-            <tr>
-              <td>3</td>
-              <td></td>
-              <td></td>
-              <td></td>
-              <td></td>
-              <td></td>
-              <td></td>
-              <td></td>
-              <td></td>
-              <td></td>
-            </tr>
-            <tr>
-              <td colspan="9" style="text-align: right">FUMIGATION COST:</td>
-              <td></td>
-            </tr>
-            <tr>
-              <td colspan="9" style="text-align: right">INSURANCE:</td>
-              <td></td>
-            </tr>
-            <tr>
-              <td colspan="9" style="text-align: right">TOTAL:</td>
-              <td>0.00</td>
-            </tr>
-          </table>
-        </div>
-        <div class="print-footer" style="margin-top: 8px">
-          <div style="font-weight: bold">TOTAL AMOUNT: U.S. DOLLARS NINE THOUSAND FORTY SIX CENTS TWENTY FIVE ONLY.
-          </div>
-        </div>
-      </div>
-    </el-dialog>
   </div>
 </template>
 
@@ -372,7 +263,9 @@ import {
   corpsbank,
   corpsfiles,
   corpsitem,
-  getList
+  getList,
+  sendInGoods,
+  revokeInGoods
 } from "@/api/basicData/receipt"
 import customerContact from "./configuration/customerContact.json"
 import advantageProject from "./configuration/advantageProject.json"
@@ -382,6 +275,7 @@ import optionTwoCost from "./configuration/mainListCost.json"
 import {getDeptLazyTree, customerList,getDeptLazyTreeTwo} from "@/api/basicData/basicFeesDesc";
 import {customerList as wareHouseType} from "@/api/basicData/basicStorageType"
 import {customerList as selectWareHouse} from "@/api/basicData/basicStorageDesc"
+import {selectGoodsNum} from "@/api/basicData/inventoryAccount"
 
 export default {
   name: "detailsPage",
@@ -562,6 +456,7 @@ export default {
           },{
             label: '入库金额',
             prop: 'deliveryAmount',
+            disabled: true,
             rules: [
               {
                 required: true,
@@ -572,6 +467,7 @@ export default {
           }, {
             label: '采购金额',
             prop: 'purchaseAmount',
+            disabled: true,
             rules: [
               {
                 required: true,
@@ -582,6 +478,7 @@ export default {
           },{
             label: '入库数量',
             prop: 'totalQuantity',
+            disabled: true,
             rules: [
               {
                 required: true,
@@ -671,7 +568,6 @@ export default {
     if (this.detailData.id) {
       this.queryData(this.detailData.id)
     }else if (this.detailData.form){
-      console.log(this.detailData.form)
       this.form = JSON.parse(this.detailData.form);
       delete this.form.createTime
       delete this.form.id
@@ -687,7 +583,21 @@ export default {
         this.configuration.dicData = this.configuration.dicData.concat(this.form.belongToCorpList)
       }
       delete this.form.belongToCorpList
+      this.$set(this.form, 'deliveryAmount', 0)
+      this.$set(this.form, 'totalQuantity', 0)
+      this.$set(this.form, 'purchaseAmount', 0)
       this.contactsData.forEach(item => {
+        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, 'scale', (item.deliveryAmount / item.actualQuantity))
+        this.form.deliveryAmount += Number(item.deliveryAmount)
+        this.form.totalQuantity += Number(item.actualQuantity)
+        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
         delete item.pid
       })
@@ -706,6 +616,12 @@ export default {
         this.advantageProjectData = this.form.deliveryFeesList
         this.bankOfDepositData = this.form.deliveryFilesList
         this.configuration.dicData = this.form.corpName
+        this.contactsData.forEach(item => {
+          // this.form.deliveryAmount += Number(item.deliveryAmount)
+          // this.form.totalQuantity += Number(item.actualQuantity)
+          // 入库金额和入库数量的比例
+          this.$set(item, 'scale', (item.deliveryAmount / item.actualQuantity))
+        })
         let feesData = []
         this.form.deliveryFeesList.forEach(item => {
           let a = {
@@ -763,12 +679,19 @@ export default {
             delete item.id
             delete item.pid
           })
+          form.deliveryStatus == '录入'
         }
       });
     },
     copyOrder() {
       this.queryData(this.form.id, true)
     },
+    // 入库数量变化时调用
+    actualQuantityChange(row) {
+      if (row.scale) {
+        row.deliveryAmount = Number(row.actualQuantity) * Number(row.scale)
+      }
+    },
     // 类别变换时触发
     warehouseTreeChange(id) {
       this.warehouseName = []
@@ -809,6 +732,7 @@ export default {
     //商品新增触发
     commoditySelection() {
       this.dialogVisible = !this.dialogVisible
+      this.tableData = []
       this.commodityData = false
     },
     //点击费用明细选择触发
@@ -833,6 +757,12 @@ export default {
         this.contactsData[this.choiceIndexT].typeno = this.tableData[0].typeno
         this.contactsData[this.choiceIndexT].specificationAndModel = this.tableData[0].specificationAndModel
         this.contactsData[this.choiceIndexT].itemId = this.tableData[0].id
+        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
@@ -872,25 +802,29 @@ export default {
       // this.contactsData = this.contactsData.concat(this.tableData)
       if (this.tableData.length > 0) {
         for (let item in this.tableData) {
-          console.log(this.tableData[item])
-          this.tableData[item].itemId = this.tableData[item].id
-          this.tableData[item].priceCategory = this.tableData[item].goodsTypeName
-          delete this.tableData[item].goodsTypeName
-          delete this.tableData[item].id
-          delete this.tableData[item].status
-          delete this.tableData[item].isDeleted
-          this.$set(this.tableData[item], 'specificationAndModel', this.tableData[item].specs)
-          this.$set(this.tableData[item], 'purchaseQuantity', 0)
-          this.$set(this.tableData[item], 'actualQuantity', 0)
-          this.$set(this.tableData[item], 'purchaseAmount', 0)
-          this.$set(this.tableData[item], 'deliveryAmount', 0)
-          this.tableData[item].sort = this.maxGoodsNum + 1
-          this.maxGoodsNum++
-          this.$refs.crudContact.rowCellAdd(this.tableData[item]);
-          this.$refs.crudContact.rowCell(this.tableData[item], this.contactsData.length - 1)
+          selectGoodsNum({
+            goodsId: this.tableData[item].id,
+            typeno: this.tableData[item].specs
+          }).then(res => {
+            this.tableData[item].storageQuantity =  res.data.data
+            this.tableData[item].itemId = this.tableData[item].id
+            this.tableData[item].priceCategory = this.tableData[item].goodsTypeName
+            delete this.tableData[item].goodsTypeName
+            delete this.tableData[item].id
+            delete this.tableData[item].status
+            delete this.tableData[item].isDeleted
+            this.$set(this.tableData[item], 'specificationAndModel', this.tableData[item].specs)
+            this.$set(this.tableData[item], 'purchaseQuantity', 0)
+            this.$set(this.tableData[item], 'actualQuantity', 0)
+            this.$set(this.tableData[item], 'purchaseAmount', 0)
+            this.$set(this.tableData[item], 'deliveryAmount', 0)
+            this.tableData[item].sort = this.maxGoodsNum + 1
+            this.maxGoodsNum++
+            this.$refs.crudContact.rowCellAdd(this.tableData[item]);
+            this.$refs.crudContact.rowCell(this.tableData[item], this.contactsData.length - 1)
+          })
         }
       }
-      this.tableData = []
       this.dialogVisible = false
     },
     closeGoods() {
@@ -1087,11 +1021,70 @@ export default {
       this.configuration.dicData = this.configuration.dicData.concat(data)
       this.removeRepeat()
     },
+    // 确认收货
+    sendInGoods() {
+      this.$refs["form"].validate((valid) => {
+        if (valid) {
+          if (this.contactsData.length == 0) {
+            return this.$message.error('商品信息为空')
+          }
+          for (let item in this.contactsData) {
+            if (!this.contactsData[item].id) {
+              return this.$message.error('有商品未保存,请先保存')
+            }
+          }
+          //商品信息
+          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;
+        }
+      });
+    },
+    // 撤销收货
+    revokeInGoods() {
+      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(",")
+          }
+          revokeInGoods(this.form).then(res => {
+            this.$message.success('撤销成功')
+            this.queryData(res.data.data.id)
+          })
+        } else {
+          return false;
+        }
+      });
+    },
     //修改提交触发
     editCustomer(isBack = false) {
       console.log(this.form)
       this.$refs["form"].validate((valid) => {
         if (valid) {
+          this.form.deliveryAmount = 0
+          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 = (this.form.deliveryAmount).toFixed(2)
+            this.form.purchaseAmount = (this.form.purchaseAmount).toFixed(2)
+          })
           //商品信息
           this.form.deliveryItemsList = this.contactsData
           this.form.deliveryFeesList = this.advantageProjectData

+ 51 - 7
src/views/businessManagement/receipt/index.vue

@@ -91,14 +91,53 @@ export default {
   },
   async created() {
     this.option = await this.getColumnData(this.getColumnName(23), option);
-    // this.onLoad()
-    if (this.$route.query.form) {
-      console.log(this.$route.query.form)
-      this.detailData = {
-        form: this.$route.query.form,
-      };
-      this.isShow = false;
+    if (parseInt(this.option.column.length / 4) !== this.option.column.length / 4){
+      const num = 4 - Number(this.option.column.length % 4)
+      this.option.searchMenuSpan = num * 6;
+      this.option.searchMenuPosition = "right";
     }
+    this.option.column.forEach(item => {
+      if (item.pickerOptions) {
+        item.pickerOptions = {
+          shortcuts: [{
+            text: '最近一周',
+            onClick(picker) {
+              const end = new Date();
+              const start = new Date();
+              start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
+              picker.$emit('pick', [start, end]);
+            }
+          }, {
+            text: '最近一个月',
+            onClick(picker) {
+              const end = new Date();
+              const start = new Date();
+              start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
+              picker.$emit('pick', [start, end]);
+            }
+          }, {
+            text: '最近三个月',
+            onClick(picker) {
+              const end = new Date();
+              const start = new Date();
+              start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
+              picker.$emit('pick', [start, end]);
+            }
+          }]
+        }
+      }
+    })
+  },
+  activated() {
+    setTimeout(() => {
+      if (this.$route.query.form) {
+        this.detailData = {
+          form: this.$route.query.form,
+        };
+        this.$store.commit("DOM_IN_DETAIL");
+        this.isShow = false;
+      }
+    }, 100);
   },
   methods: {
     //删除列表后面的删除按钮触发触发(row, index, done)
@@ -162,6 +201,7 @@ export default {
         id: row.id,
       };
       this.isShow = false;
+      this.$store.commit("DOM_IN_DETAIL");
     },
     //新增跳转页面
     beforeOpen(row, index) {
@@ -169,12 +209,14 @@ export default {
         id: row.id,
       };
       this.isShow = false;
+      this.$store.commit("DOM_IN_DETAIL");
     },
     editOpen(row, index) {
       this.detailData = {
         id: row.id,
       };
       this.isShow = false;
+      this.$store.commit("DOM_IN_DETAIL");
     },
     // 复制新单
     copyOrder() {
@@ -183,6 +225,7 @@ export default {
         copyId: id,
       };
       this.isShow = false;
+      this.$store.commit("DOM_IN_DETAIL");
     },
     //点击新增时触发
     beforeClose(done) {
@@ -249,6 +292,7 @@ export default {
     goBack() {
       this.detailData=this.$options.data().detailData
       this.isShow = true;
+      this.$store.commit("DOM_OUT_DETAIL");
     },
     //列保存触发
     async saveColumn() {

+ 7 - 4
src/views/businessManagement/salesOrder/configuration/mainList.json

@@ -125,7 +125,8 @@
           "width":100,
           "format": "yyyy-MM-dd",
           "valueFormat": "yyyy-MM-dd",
-          "overHidden": true
+          "overHidden": true,
+          "pickerOptions": {}
         },
         {
             "label": "要求发货日期",
@@ -138,7 +139,8 @@
             "width":100,
             "format": "yyyy-MM-dd",
             "valueFormat": "yyyy-MM-dd",
-          "overHidden": true
+            "overHidden": true,
+            "pickerOptions": {}
       },{
             "label": "要求到货日期",
             "type": "date",
@@ -150,14 +152,15 @@
             "width":100,
             "format": "yyyy-MM-dd",
             "valueFormat": "yyyy-MM-dd",
-        "overHidden": true
+            "overHidden": true,
+            "pickerOptions": {}
       },{
             "label": "公司户头",
             "prop": "banksAccountName",
             "search": true,
             "index": 8,
             "width":100,
-        "overHidden": true
+            "overHidden": true
         }
     ]
 }

+ 27 - 6
src/views/businessManagement/salesOrder/detailsPageEdit.vue

@@ -121,7 +121,7 @@
                          icon="el-icon-plus"
                          size="small"
                          :disabled="selection.length < 1"
-                         @click="generateShipmentD">生成发货单
+                         @click="getShipmentD">生成发货单
               </el-button>
               <el-button type="info" :size="size" icon="el-icon-printer">报 表</el-button>
             </template>
@@ -1082,9 +1082,12 @@ export default {
           })
         }
         let goodsNum = []
+        let purchaseAmount = 0
         this.contactsData.forEach(item => {
           goodsNum.push(item.sort)
+          purchaseAmount += Number(item.purchaseAmount)
         })
+        this.form.grossProfitRate = (((Number(this.form.grossProfit) - Number(purchaseAmount)) / Number(this.form.grossProfit)) * 100).toFixed()
         if (goodsNum.length == 0) {
           this.maxGoodsNum = 0;
         } else {
@@ -1093,6 +1096,7 @@ export default {
           })
         }
         if (isCopy) {
+          this.$set(this.form, 'orderStatus', '录入')
           delete this.form.id
           this.contactsData.forEach(item => {
             delete item.id
@@ -1145,6 +1149,19 @@ export default {
     policy() {
       this.policyDialog = !this.policyDialog
     },
+    getShipmentD() {
+      if (this.$store.getters.inStatus) {
+        this.$alert("发货单存在,请保存发货单再进行操作", "温馨提示", {
+          confirmButtonText: "确定",
+          type: "warning",
+          callback: action => {
+            console.log(action);
+          }
+        });
+      } else {
+        this.generateShipmentD();
+      }
+    },
     //生成发货单
     generateShipmentD() {
       let lsit = []
@@ -1171,7 +1188,7 @@ export default {
         orderItemIds: lsit
       }
       generateShipment(data).then(res => {
-        console.log(res.data.data)
+        this.$router.$avueRouter.closeTag("/businessManagement/deliveryNotice/index");
         this.$router.push({
           path: "/businessManagement/deliveryNotice/index",
           query: {form: JSON.stringify(res.data.data)},
@@ -1269,7 +1286,6 @@ export default {
             goodsId: this.tableData[item].id,
             typeno: this.tableData[item].specs
           }).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
@@ -1567,9 +1583,14 @@ export default {
             this.form.grossProfit += Number(item.amount)
           })
           // 计算毛利率
-          if (this.form.orderAmount) {
-            this.form.grossProfitRate = ((Number(this.form.grossProfit) / Number(this.form.orderAmount)) * 100).toFixed(2)
-          }
+          // if (this.form.orderAmount) {
+          //   this.form.grossProfitRate = ((Number(this.form.grossProfit) / Number(this.form.orderAmount)) * 100).toFixed(2)
+          // }
+          // 计算应收账款
+          this.$set(this.form, 'debitAmount', 0)
+          this.contactsData.forEach(item => {
+            this.form.debitAmount += Number(item.amount)
+          })
           //商品信息
           this.form.orderItemsList = this.contactsData
           this.form.orderFeesList = this.advantageProjectData

+ 37 - 2
src/views/businessManagement/salesOrder/index.vue

@@ -75,6 +75,7 @@
 import option from "./configuration/mainList.json";
 import {customerList, typeSave, deleteDetails} from "@/api/basicData/configuration"
 import detailPage from "./detailsPageEdit";
+import search from "../../../page/index/search";
 
 export default {
   name: "customerInformation",
@@ -112,11 +113,45 @@ export default {
   async created() {
     this.option = await this.getColumnData(this.getColumnName(14), option);
     if (parseInt(this.option.column.length / 4) !== this.option.column.length / 4){
-      this.option.searchMenuSpan = 6;
-      this.option.searchMenuPosition = "center";
+      const num = 4 - Number(this.option.column.length % 4)
+      this.option.searchMenuSpan = num * 6;
+      this.option.searchMenuPosition = "right";
     }
+    this.option.column.forEach(item => {
+      if (item.pickerOptions) {
+        item.pickerOptions = {
+          shortcuts: [{
+            text: '最近一周',
+            onClick(picker) {
+              const end = new Date();
+              const start = new Date();
+              start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
+              picker.$emit('pick', [start, end]);
+            }
+          }, {
+            text: '最近一个月',
+            onClick(picker) {
+              const end = new Date();
+              const start = new Date();
+              start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
+              picker.$emit('pick', [start, end]);
+            }
+          }, {
+            text: '最近三个月',
+            onClick(picker) {
+              const end = new Date();
+              const start = new Date();
+              start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
+              picker.$emit('pick', [start, end]);
+            }
+          }]
+        }
+      }
+    })
   },
   methods: {
+    // 获取日期
+    getDate() {},
     //删除列表后面的删除按钮触发触发(row, index, done)
     rowDel(row, index, done) {
       this.$confirm("确定将选择数据删除?", {

+ 31 - 38
src/views/importTrade/receipt/config/customerContact.json

@@ -12,7 +12,7 @@
   "searchMenuSpan": 6,
   "dialogWidth": "60%",
   "align": "center",
-  "delBtn":true,
+  "delBtn":false,
   "tree": true,
   "border": true,
   "index": true,
@@ -35,7 +35,7 @@
     },{
       "label": "合同号",
       "prop": "contractNumber",
-      "index": 1,
+      "index": 2,
       "width":150,
       "rules": [
         {
@@ -47,21 +47,8 @@
     },{
       "label": "货物品种",
       "prop": "priceCategory",
-      "index": 2,
-      "width":120,
-      "rules": [
-        {
-          "required": false,
-          "message": " ",
-          "trigger": "blur"
-        }
-      ]
-    },{
-      "label": "货物详情",
-      "prop": "itemDescription",
       "index": 3,
-      "width":150,
-      "cell": true,
+      "width":200,
       "rules": [
         {
           "required": false,
@@ -70,18 +57,16 @@
         }
       ]
     },
-    {
-      "label": "箱号",
-      "prop": "containerNo",
+   {
+      "label": "件数",
+      "prop": "actualQuantity",
       "index": 4,
       "width":120
-    },
-   {
-      "label": "发票净重(吨)",
-      "prop": "invoiceWeight",
-      "index": 6,
+    },{
+      "label": "单价",
+      "prop": "price",
+      "index": 5,
       "width":120,
-      "cell": true,
       "rules": [
         {
           "required": false,
@@ -90,11 +75,10 @@
         }
       ]
     },{
-      "label": "码单重量(吨)",
-      "prop": "billWeight",
-      "index": 7,
+      "label": "合同金额",
+      "prop": "contractAmount",
+      "index": 6,
       "width":120,
-      "cell": true,
       "rules": [
         {
           "required": false,
@@ -103,10 +87,17 @@
         }
       ]
     },{
-      "label": "件数",
-      "prop": "actualQuantity",
+      "label": "箱号",
+      "prop": "containerNo",
+      "index": 7,
+      "cell": true,
+      "width":120
+    },{
+      "label": "发票净重(吨)",
+      "prop": "invoiceWeight",
       "index": 8,
       "width":120,
+      "cell": true,
       "rules": [
         {
           "required": false,
@@ -115,10 +106,11 @@
         }
       ]
     },{
-      "label": "单价",
-      "prop": "price",
+      "label": "码单重量(吨)",
+      "prop": "billWeight",
       "index": 9,
       "width":120,
+      "cell": true,
       "rules": [
         {
           "required": false,
@@ -127,10 +119,11 @@
         }
       ]
     },{
-      "label": "合同金额",
-      "prop": "contractAmount",
-      "index": 9,
-      "width":120,
+      "label": "货物详情",
+      "prop": "itemDescription",
+      "index": 10,
+      "width":150,
+      "cell": true,
       "rules": [
         {
           "required": false,
@@ -141,7 +134,7 @@
     },{
       "label": "税率",
       "prop": "taxRate",
-      "index": 10,
+      "index": 11,
       "width":120,
       "cell": true,
       "rules": [

+ 113 - 53
src/views/importTrade/receipt/detailsPageEdit.vue

@@ -9,7 +9,8 @@
       <el-button type="primary"
                  class="el-button--small-yh add-customer-btn-three"
                  :disabled="!form.id"
-                 @click.stop="confirmReceipt">确认收货
+                 @click.stop="confirmReceipt">
+        {{receiptDisable ?"撤销收货":"确认收货"}}
       </el-button>
       <el-button type="success"
                  class="el-button--small-yh add-customer-btn-two"
@@ -19,7 +20,7 @@
       <el-button
         class="el-button--small-yh add-customer-btn"
         type="primary"
-        :disabled="disabled"
+        :disabled="disabled || receiptDisable"
         @click="editCustomer"
       >{{ form.id ? '确认修改' : '确认新增' }}
       </el-button>
@@ -31,13 +32,13 @@
           <el-row>
             <el-col v-for="(item,index) in basicData.column" :key="index" :span="item.span?item.span:8">
               <el-form-item :label="item.label" :prop="item.prop" :rules="item.rules">
-                <el-date-picker v-if="item.type === 'datetime'" style="width: 100%;" v-model="form[item.prop]" size="small" type="date" placeholder="请选择日期" value-format="yyyy-MM-dd HH:mm:ss"/>
+                <el-date-picker v-if="item.type === 'datetime'" style="width: 100%;" v-model="form[item.prop]" :disabled="receiptDisable" size="small" type="date" placeholder="请选择日期" value-format="yyyy-MM-dd HH:mm:ss"/>
                 <selectComponent v-else-if="item.prop === 'corpId'" v-model="form[item.prop]" :configuration="configuration"/>
-                <el-select v-else-if="item.prop === 'storageId'" style="width: 100%"   v-model="form[item.prop]" size="small" placeholder="请选择" clearable filterable>
+                <el-select v-else-if="item.prop === 'storageId'" style="width: 100%" :disabled="receiptDisable"  v-model="form[item.prop]" size="small" placeholder="请选择" clearable filterable>
                   <el-option v-for="(item,index) in storageIdDic" :key="index" :label="item.cname" :value="item.id"></el-option>
                 </el-select>
-                <el-input type="textarea" v-else-if="(item.prop === 'deliveryRemarks')" v-model="form[item.prop]"   size="small" autocomplete="off" placeholder="请输入"></el-input>
-                <el-input v-else v-model="form[item.prop]" size="small" :disabled="item.disabled?true:false" placeholder="请输入" autocomplete="off"></el-input>
+                <el-input type="textarea" v-else-if="(item.prop === 'deliveryRemarks')" v-model="form[item.prop]"  :disabled="receiptDisable" size="small" autocomplete="off" placeholder="请输入"></el-input>
+                <el-input v-else v-model="form[item.prop]" size="small" :disabled="item.disabled?true:false || receiptDisable" placeholder="请输入" autocomplete="off"></el-input>
               </el-form-item>
             </el-col>
           </el-row>
@@ -55,7 +56,7 @@
             @row-del="rowDel"
           >
             <template slot-scope="{row}" slot="billNo">
-              <span v-if="row.$cellEdit" style="float: left;color: #F56C6C;">*</span>
+              <span v-if="row.$cellEdit" class="required_fields">*</span>
               <el-input
                 v-if="row.$cellEdit"
                 v-model="row.billNo"
@@ -67,10 +68,10 @@
               <span v-else>{{ row.billNo }}</span>
             </template>
             <template slot-scope="{row}" slot="contractNumber">
-              <span v-if="row.$cellEdit" style="float: left;color: #F56C6C;">*</span>
+              <span v-if="row.$cellEdit" class="required_fields">*</span>
               <el-select
                 v-if="row.$cellEdit"
-                style="width:90%"
+                style="width:90% !important;"
                 v-model="row.contractNumber"
                 placeholder=" "
                 size="small"
@@ -82,14 +83,24 @@
                   v-for="(item,index) in contractDic"
                   :key="index"
                   :label="item.orderNo"
+                  @change="sumOrderNo()"
                   :value="item.orderNo"
                 ></el-option>
               </el-select>
               <span v-else>{{ row.contractNumber }}</span>
             </template>
             <template slot="priceCategory" slot-scope="{row,index}">
-              <span style="margin-left: 12px;padding-top: 2px">{{ row.priceCategoryNames }}</span>
-              <el-button v-if="row.$cellEdit" type="text" size="mini" style="float: right" @click="choice(row)">选择</el-button>
+              <span v-if="row.$cellEdit" class="required_fields">*</span>
+              <el-input
+                v-if="row.$cellEdit"
+                v-model="row.priceCategoryNames"
+                size="small"
+                placeholder="请点击右侧按钮选择"
+                :disabled="true"
+                style="width: 63%"
+              ></el-input>
+              <el-button v-if="row.$cellEdit" size="small" icon="el-icon-search" @click="choice(row)"></el-button>
+              <span v-else>{{ row.priceCategoryNames }}</span>
             </template>
             <template slot="invoiceWeight" slot-scope="{ row }">
               <el-input
@@ -125,9 +136,11 @@
               <span v-else>{{ row.price }}</span>
             </template>
             <template slot="actualQuantity" slot-scope="{ row }">
+              <span v-if="row.$cellEdit" class="required_fields">*</span>
               <el-input
                 v-if="row.$cellEdit"
                 v-model="row.actualQuantity"
+                style="width: 93%"
                 placeholder="请输入"
                 size="small"
                 oninput='this.value=this.value.replace(/[^(\d.)]/g,"").replace(/^(\d+)\.(\d\d).*$/, "$1.$2")'
@@ -139,14 +152,23 @@
               <el-button
                 type="text"
                 size="small"
+                :disabled="receiptDisable"
                 @click="rowCell(row,index)"
               >{{ row.$cellEdit ? '保存' : '修改' }}
               </el-button>
+              <el-button
+                type="text"
+                size="small"
+                :disabled="receiptDisable"
+                @click="rowDel(row,index)"
+              >删除
+              </el-button>
             </template>
             <template slot="menuLeft" slot-scope="{size}">
               <el-button type="primary"
                          icon="el-icon-plus"
                          size="small"
+                         :disabled="receiptDisable"
                          @click="commoditySelection"
               >录入明细
               </el-button>
@@ -202,9 +224,6 @@
       <span slot="footer" class="dialog-footer">
           <el-button @click="dialogVisible = false">取 消</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
@@ -215,10 +234,12 @@
       width="60%"
       :close-on-click-modal="false"
       :destroy-on-close="true"
-      :close-on-press-escape="false">
+      :modal-append-to-body='false'
+      :close-on-press-escape="false"
+      v-dialog-drag>
       <procurement-detail
-        :status="132"
-        :closeFun="procurementClose"
+        @closeFun="!procurementDialog"
+       @importProMent="importProMent"
       >
       </procurement-detail>
     </el-dialog>
@@ -235,7 +256,8 @@ import {detailReceiptList,
   removeGoodsItem,
   getStorage,
   getInventory,
-  confirmReceipt
+  confirmReceipt,
+  repealReceipt
 } from "@/api/importTrade/receipt"
 import {
   getList
@@ -244,7 +266,8 @@ import upLoadOption from "../../exportTrade/purchaseContract/config/uploadList.j
 import {detailListData } from "@/api/importTrade/purchase";
 import { contrastObj,contrastList } from "@/util/contrastData";
 import { getOrgOrderNo } from "@/api/importTrade/salesContract"
-import { procurementDetail } from "@/components/procurement/procurementDetail";
+import  procurementDetail from "@/components/procurement/index";
+import _ from "lodash";
 
 export default {
   name: "detailsPageEdit",
@@ -260,6 +283,7 @@ export default {
     return {
       form: {},
       disabled: false,
+      receiptDisable:false,
       customerContact: customerContact,
       contactsForm: {},
       contactsData: [],
@@ -435,6 +459,8 @@ export default {
       detailReceiptList(id).then(res => {
         this.form = res.data.data;
         this.oldForm = Object.assign({},res.data.data);
+        this.receiptDisable = res.data.data.deliveryStatus === "已收货" ?   true :false
+        this.configuration.disabled = this.receiptDisable
         if(this.form.companyName){
           this.configuration.dicData = this.form.companyName
         }
@@ -448,35 +474,40 @@ export default {
         }
       })
     }
-    // else{
-    //   getSysNo("JK-SH").then(res =>{
-    //     this.$set(this.form,"sysNo", res.data.data)
-    //   })
-    // }
     if(this.detailData.params){
       detailListData(this.detailData.params.id).then(res =>{
-        // this.form.orderNo =  res.data.data.orderNo;
-        // this.form.saleman =  res.data.data.salesName;
-        // this.configuration.dicData = res.data.data.corpsName
-        // this.form.corpId = res.data.data.corpsName[0].cname
+        const orderNoList = [];
         res.data.data.itemsVOList.forEach((item,index) =>{
           this.detailData.params.orderItemIds.forEach((e,i) =>{
             if(e ==  index){
               item.srcId =  item.id;
               item.contractNumber =  res.data.data.orderNo;
-              item.actualQuantity =  item.purchaseQuantity;
+              orderNoList.push(item.contractNumber)
+              if(item.actualQuantity !== 0){   //如果收过货
+                item.actualQuantity = _.subtract(item.purchaseQuantity, item.actualQuantity); //收货件数 = 采购件数 - 已收件数
+              }else{
+                item.actualQuantity =  item.purchaseQuantity;
+              }
               item.contractAmount =  item.amount;
               delete item.id
-              delete item.actualQuantity
               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,'saleman',res.data.data.salesName)
+        this.$set(this.form,'corpId',res.data.data.corpsName[0].id)
+        this.$set(this.configuration,'dicData', res.data.data.corpsName)
       })
     }
   },
   methods: {
+    sumOrderNo(){
+      //拿到所有明细合同号 去重加逗号放到主表合同号
+      const contractNumberList =  this.contactsData.map(item =>{item.contractNumber})
+      this.$set(this.form,'orderNo', Array.from(new Set(contractNumberList)).join(","))
+    },
     //合计
     totalChange(){
       let invoiceList =  this.contactsData.map(item => {
@@ -499,7 +530,8 @@ export default {
       getOrgOrderNo(row.billNo).then(res =>{
         if(res.data){
           this.contractDic = res.data;
-          row.contractNumber =  res.data[0].orderNo
+          row.contractNumber =  res.data[0].orderNo;
+          this.sumOrderNo()
         }
       }).catch(()=>{
         row.contractNumber = ''
@@ -511,7 +543,7 @@ export default {
         row.price = "";
         row.contractAmount = 0
       } else {
-        row.contractAmount = (row.actualQuantity * row.price).toFixed(2);
+        row.contractAmount = _.multiply(row.actualQuantity,row.price).toFixed(2);
       }
     },
     //件数
@@ -520,7 +552,7 @@ export default {
         row.actualQuantity = "";
         row.contractAmount = 0
       } else {
-        row.contractAmount = (row.actualQuantity * row.price).toFixed(2);
+        row.contractAmount = _.multiply(row.actualQuantity,row.price).toFixed(2);
       }
     },
     //新增商品信息保存触发
@@ -568,12 +600,18 @@ 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 == null) {
+            return this.$message.error(`请输入第${i + 1}行的件数`);
+          }
         }
         if (valid) {
           let submitDto = {
@@ -587,6 +625,7 @@ export default {
               detailReceiptList(res.data.data.id).then(res => {
                 this.form = res.data.data;
                 this.oldForm = Object.assign({},res.data.data);
+                this.receiptDisable = res.data.data.deliveryStatus === "已收货" ?   true :false
                 this.configuration.dicData = this.form.companyName
                 if(this.form.deliveryItemsList){
                   this.contactsData = this.form.deliveryItemsList
@@ -612,7 +651,7 @@ export default {
       if(contrastObj(this.form,this.oldForm) || contrastList(this.contactsData,this.oldContactsData)
         || contrastList(this.upLoadData,this.oldUpLoadData)
       ){
-        this.$confirm("请先保存在进行收货?", {
+        this.$confirm("请先保存在进行操作!", {
           confirmButtonText: "保存",
           cancelButtonText: "取消",
           type: "warning"
@@ -620,17 +659,42 @@ export default {
           this.editCustomer()
         })
       }else{
-        this.$confirm("是否确认收货?", {
-          confirmButtonText: "确定",
-          cancelButtonText: "取消",
-          type: "warning"
-        }).then(()=>{
-          this.form.deliveryItemsList = this.contactsData;
-          confirmReceipt(this.form).then(res =>{
+        if(!this.receiptDisable){
+          this.$confirm("是否确认收货?", {
+            confirmButtonText: "确定",
+            cancelButtonText: "取消",
+            type: "warning"
+          }).then(()=>{
+            this.form.deliveryItemsList = this.contactsData;
+            confirmReceipt(this.form).then(res =>{
+              if(res.data.success){
+                this.$message.success("收货成功!")
+                this.receiptDisable = res.data.data.deliveryStatus === "已收货" ?   true :false
+              }
+            })
           })
-        })
+        }else{
+          this.$confirm("是否撤销收货!", {
+            confirmButtonText: "确定",
+            cancelButtonText: "取消",
+            type: "warning"
+          }).then(()=>{
+            this.form.deliveryItemsList = this.contactsData;
+            repealReceipt(this.form).then(res =>{
+              if(res.data.success){
+                this.$message.success("撤销成功!")
+                this.receiptDisable = res.data.data.deliveryStatus === "已收货" ?   true :false
+              }
+            })
+          })
+        }
       }
     },
+    //导入采购明细
+    importProMent(list){
+      this.procurementDialog = false;
+      this.$refs.crudContact.rowCellAdd(list);
+    },
     //上传文件保存
     upLoadSave(row, done, loading){
       this.upLoadData.push(row)
@@ -677,14 +741,6 @@ export default {
         this.contactsData[this.selectKind].priceCategory = this.tableData[0].id;
         this.contactsData[this.selectKind].itemDescription = this.tableData[0].cnameDescription;
         this.$set(this.contactsData[this.selectKind],'priceCategoryNames',this.tableData[0].cname)
-        // let  params = {
-        //   corpId : this.form.corpId,
-        //   storageId: this.form.storageId,
-        //   goodId:  this.contactsData[this.selectKind].priceCategory,
-        //   cntrNo: this.contactsData[this.selectKind].containerNo ,
-        //   billNo: this.contactsData[this.selectKind].billNo ,
-        //   contractNumber:  this.contactsData[this.selectKind].contractNumber,
-        // }
         this.dialogVisible = !this.dialogVisible
         this.selectKind = -1;
       }
@@ -817,7 +873,11 @@ export default {
 ::v-deep .el-form-item {
   margin-bottom: 0;
 }
-
+.required_fields{
+  color: #F56C6C;
+  display:inline-block;
+  width: 7%
+}
 .add-customer-btn-two {
   position: fixed;
   right: 150px;

+ 30 - 38
src/views/purchase/contract/config/customerContact.json

@@ -11,7 +11,7 @@
   "refreshBtn": false,
   "searchMenuSpan": 6,
   "align": "center",
-  "delBtn":true,
+  "delBtn":false,
   "dialogWidth": "60%",
   "tree": true,
   "border": true,
@@ -37,7 +37,7 @@
       "label": "货物品种",
       "prop": "priceCategory",
       "index": 2,
-      "width":120,
+      "width":200,
       "cell": false,
       "rules": [
         {
@@ -47,24 +47,26 @@
         }
       ]
     },{
-      "label": "货物详情",
-      "prop": "itemDescription",
+      "label": "规格型号",
+      "prop": "itemType",
       "index": 3,
-      "width":180,
-      "cell": true,
-      "rules": [
-        {
-          "required": false,
-          "message": " ",
-          "trigger": "blur"
-        }
-      ]
-    },{
-      "label": "箱号",
-      "prop": "cntrNo",
+      "width":150
+    },
+    {
+      "label": "件数",
+      "prop": "purchaseQuantity",
       "index": 4,
-      "width":100,
-      "cell": true,
+      "width":120
+    },{
+      "label": "单价",
+      "prop": "price",
+      "index": 5,
+      "width":120
+    },{
+      "label": "合同金额",
+      "prop": "amount",
+      "index": 6,
+      "width":120,
       "rules": [
         {
           "required": false,
@@ -74,11 +76,10 @@
       ]
     },
     {
-      "label": "已数量",
+      "label": "已数量",
       "prop": "actualQuantity",
-      "index": 4,
+      "index": 7,
       "width":100,
-      "cell": true,
       "rules": [
         {
           "required": false,
@@ -89,7 +90,7 @@
     },{
       "label": "发票净重(吨)",
       "prop": "invoiceWeight",
-      "index": 5,
+      "index": 8,
       "width":120,
       "rules": [
         {
@@ -101,23 +102,14 @@
     },{
       "label": "码单重量(吨)",
       "prop": "billWeight",
-      "index": 6,
-      "width":120
-    },{
-      "label": "件数",
-      "prop": "purchaseQuantity",
-      "index": 7,
-      "width":120
-    },{
-      "label": "单价",
-      "prop": "price",
-      "index": 8,
+      "index": 9,
       "width":120
     },{
-      "label": "合同金额",
-      "prop": "amount",
-      "index": 9,
-      "width":120,
+      "label": "货物详情",
+      "prop": "itemDescription",
+      "index": 10,
+      "width":180,
+      "cell": true,
       "rules": [
         {
           "required": false,
@@ -128,7 +120,7 @@
     },{
       "label": "税率",
       "prop": "taxRate",
-      "index": 10,
+      "index": 11,
       "width":120,
       "cell": true,
       "rules": [

+ 119 - 46
src/views/purchase/contract/detailsPage.vue

@@ -67,28 +67,63 @@
             @row-update="rowUpdate"
             @row-del="rowDel"
           >
-            <template slot="price" slot-scope="{ row }">
+            <template slot="priceCategory" slot-scope="{row,index}">
+              <span v-if="row.$cellEdit" class="required_fields">*</span>
               <el-input
                 v-if="row.$cellEdit"
-                v-model="row.price"
-                placeholder="请输入"
+                v-model="row.priceCategoryNames"
                 size="small"
-                oninput='this.value=this.value.replace(/[^(\d.)]/g,"").replace(/^(\d+)\.(\d\d).*$/, "$1.$2")'
-                @input="priceChange(row)"
+                placeholder="请点击右侧按钮选择"
+                :disabled="true"
+                style="width: 63%"
               ></el-input>
-              <span v-else>{{ row.price }}</span>
+              <el-button v-if="row.$cellEdit" size="small" icon="el-icon-search" @click="choice(row)"></el-button>
+              <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
+              >
+                <el-option
+                  v-for="(item,index) in row.specificationList"
+                  :key="index"
+                  :label="item.value"
+                  :value="item.value"
+                >
+                </el-option>
+              </el-select>
+              <span v-else>{{ row.itemType }}</span>
             </template>
             <template slot="purchaseQuantity" slot-scope="{ row }">
+              <span v-if="row.$cellEdit" class="required_fields">*</span>
               <el-input
                 v-if="row.$cellEdit"
                 v-model="row.purchaseQuantity"
                 placeholder="请输入"
                 size="small"
+                style="width: 93%"
                 oninput='this.value=this.value.replace(/[^(\d.)]/g,"").replace(/^(\d+)\.(\d\d).*$/, "$1.$2")'
                 @input="quantityChange(row)"
               ></el-input>
               <span v-else>{{ row.purchaseQuantity }}</span>
             </template>
+            <template slot="price" slot-scope="{ row }">
+              <el-input
+                v-if="row.$cellEdit"
+                v-model="row.price"
+                placeholder="请输入"
+                size="small"
+                oninput='this.value=this.value.replace(/[^(\d.)]/g,"").replace(/^(\d+)\.(\d\d).*$/, "$1.$2")'
+                @input="priceChange(row)"
+              ></el-input>
+              <span v-else>{{ row.price }}</span>
+            </template>
             <template slot="invoiceWeight" slot-scope="{ row }">
               <el-input
                 v-if="row.$cellEdit"
@@ -111,17 +146,21 @@
               ></el-input>
               <span v-else>{{ row.billWeight }}</span>
             </template>
-            <template slot="priceCategory" slot-scope="{row,index}">
-              <span style="margin-left: 12px;padding-top: 2px">{{ row.priceCategoryNames }}</span>
-              <el-button v-if="row.$cellEdit" type="text" size="mini" style="float: right" @click="choice(row)">选择</el-button>
-            </template>
             <template slot-scope="{row,index}" slot="menu">
               <el-button
                 type="text"
                 size="small"
+                :disabled="row.actualQuantity !=0"
                 @click="rowCell(row,index)"
               >{{ row.$cellEdit ? '修改完成' : '修改' }}
               </el-button>
+              <el-button
+                type="text"
+                size="small"
+                :disabled="row.actualQuantity !=0"
+                @click="rowDel(row,index)"
+              >删除
+              </el-button>
             </template>
             <template slot="menuLeft" slot-scope="{size}">
               <el-button type="primary"
@@ -141,7 +180,7 @@
                          size="small"
                          :disabled="selectContact.length == 0"
                          @click="beforePage(false)"
-              >收货单
+              >生成收货单
               </el-button>
               <el-button type="info"
                          size="small"
@@ -249,10 +288,12 @@ import {detailListData, submitData,getSysNo} from "@/api/importTrade/purchase";
 import commodity from "./config/commodity.json"
 import feeInfo from "@/components/fee-info/main";
 import uploadFile from "@/components/upload-file/main";
+import _ from "lodash";
 //商品详情接口
 import {corpsattn, corpsbank,  getDeptLazyTreeS} from "@/api/basicData/configuration"
 import { getList } from "@/api/basicData/commodityType"
 import { contrastObj,contrastList } from "@/util/contrastData";
+import {getSpecification} from "@/api/exportTrade/purchaseContract";
 export default {
   name: "detailsPage",
   props: {
@@ -678,7 +719,7 @@ export default {
         row.price = "";
         row.amount = 0
       } else {
-        row.amount = (row.purchaseQuantity * row.price).toFixed(2);
+        row.amount = _.multiply(row.purchaseQuantity, row.price).toFixed(2);
       }
     },
     currencyChange(value){
@@ -688,7 +729,7 @@ export default {
           this.form.rmbAmount = this.form.orderAmount
         }else{
           this.form.exchangeRate = 6.3843
-          this.form.rmbAmount = this.form.orderAmount * 6.3843
+          this.form.rmbAmount =  _.multiply(this.form.orderAmount, 6.3843)
         }
       }
     },
@@ -715,7 +756,7 @@ export default {
         row.purchaseQuantity = "";
         row.amount = 0
       } else {
-        row.amount = (row.purchaseQuantity * row.price).toFixed(2);
+        row.amount =_.multiply(row.purchaseQuantity,row.price).toFixed(2);
       }
     },
     //修改提交触发
@@ -739,6 +780,15 @@ export default {
             if (this.contactsData[j].billNo == null) {
               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}行的件数`);
+            }
           }
           let submitDto = {
             ...this.form,
@@ -796,43 +846,55 @@ export default {
           id:this.form.id,
           orderItemIds:this.selectContact.map(i=>{return i.$index})
         }
-        if(type){
-          //进入付款管理
-          if(this.$store.getters.payStatus){
-            this.$alert("付款页面已存在,请保存付款页面再进行操作", "温馨提示", {
-              confirmButtonText: "确定",
-              type: 'warning',
-              callback: action => {
-              }
-            });
-          }else{
-            this.$router.$avueRouter.closeTag('/financialManagement/payment');
-            this.$router.push({
-              path: "/financialManagement/payment",
-              query: {params: params},
-            });
-          }
+        if(contrastObj(this.form,this.oldForm) || contrastList(this.contactsData,this.oldContactsData)
+          || contrastList(this.orderFeesList,this.oldFeesList) || contrastList(this.orderFilesList,this.oldFilesList)
+        ){
+          this.$confirm("您已改动数据,是否先保存在进行操作!", {
+            confirmButtonText: "保存",
+            cancelButtonText: "取消",
+            type: "warning"
+          }).then(() => {
+            this.editCustomer();
+          })
         }else{
-          //进入收货单
-          if(this.$store.getters.takeStatus){
-            this.$alert("收货单页面已存在,请保存收货单再进行操作", "温馨提示", {
-              confirmButtonText: "确定",
-              type: 'warning',
-              callback: action => {
-              }
-            });
+          if(type){
+            //进入付款管理
+            if(this.$store.getters.payStatus){
+              this.$alert("付款页面已存在,请关闭付款页面再进行操作", "温馨提示", {
+                confirmButtonText: "确定",
+                type: 'warning',
+                callback: action => {
+                }
+              });
+            }else{
+              this.$router.$avueRouter.closeTag('/financialManagement/payment');
+              this.$router.push({
+                path: "/financialManagement/payment",
+                query: {params: params},
+              });
+            }
           }else{
-            //关闭一下存在的列表页
-            this.$router.$avueRouter.closeTag('/importTrade/receipt/index');
-            this.$router.push({
-              path: "/importTrade/receipt/index",
-              query: {params: params},
-            });
+            //进入收货单
+            if(this.$store.getters.takeStatus){
+              this.$alert("收货单页面已存在,请关闭收货单再进行操作", "温馨提示", {
+                confirmButtonText: "确定",
+                type: 'warning',
+                callback: action => {
+                }
+              });
+            }else{
+              //关闭一下存在的列表页
+              this.$router.$avueRouter.closeTag('/importTrade/receipt/index');
+              this.$router.push({
+                path: "/importTrade/receipt/index",
+                query: {params: params},
+              });
+            }
           }
         }
       }else{
         this.$confirm("列表内存在新录入数据,是否先保存此数据?", {
-          confirmButtonText: "确定",
+          confirmButtonText: "保存",
           cancelButtonText: "取消",
           type: "warning"
         }).then(() => {
@@ -851,8 +913,14 @@ export default {
         this.contactsData[this.selectKind].priceCategory = this.tableData[0].id;
         this.contactsData[this.selectKind].itemId = this.tableData[0].id;
         this.$set(this.contactsData[this.selectKind],'priceCategoryNames',this.tableData[0].cname)
+        getSpecification({ goodId: this.tableData[0].id}).then(res =>{
+          this.$set(this.contactsData[this.selectKind],'itemType',res.data.data.map(item =>item)[0])
+          this.$set(this.contactsData[this.selectKind],'specificationList',res.data.data.map(item => ({ value: item })))
+        }).finally(()=>{
+          this.selectKind = -1
+        })
         this.dialogVisible = !this.dialogVisible
-        this.selectKind = -1
+
       }
     },
     //新增商品明细保存触发
@@ -1033,6 +1101,11 @@ export default {
   right: 150px;
   top: 115px;
 }
+.required_fields{
+  color: #F56C6C;
+  display:inline-block;
+  width: 7%
+}
 .add-customer-btn {
   position: fixed;
   right: 36px;

+ 2 - 2
src/views/wel/components/butCard.vue

@@ -1,6 +1,6 @@
 <template>
   <div style="padding:5px">
-    <div class="card">
+    <div class="card el-button--primary">
       <div class="card-content">
         <i :class="iconName"></i>
         <div>{{ name }}</div>
@@ -28,7 +28,7 @@ export default {
 
 <style lang="scss" scoped>
 .card{
-  background: #ff7d13;
+  //background: #ff7d13;
   display: flex;
   justify-content: center;
   align-items: center;