Browse Source

进口滴

qinbai 3 years ago
parent
commit
e77d6e0817

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

@@ -73,3 +73,16 @@ export function getItemListByConditions(current,size,params) {
     }
   })
 }
+//获取销售明细列表
+
+export function getMarketDetailsList(current,size,params) {
+  return request({
+    url: '/api/blade-purchase-sales/entranceOrder/orderItemsList',
+    method: 'get',
+    params: {
+      ...params,
+      current,
+      size,
+    }
+  })
+}

+ 93 - 0
src/components/procurement/config/market.json

@@ -0,0 +1,93 @@
+{
+  "lazy": true,
+  "tip": false,
+  "simplePage": true,
+  "searchShow": true,
+  "addBtn":false,
+  "editBtn":false,
+  "addRowBtn":false,
+  "cellBtn":false,
+  "cancelBtn":false,
+  "refreshBtn": false,
+  "searchMenuSpan": 6,
+  "align": "center",
+  "delBtn":true,
+  "dialogWidth": "60%",
+  "tree": true,
+  "border": true,
+  "index": true,
+  "selection": true,
+  "menu": false,
+  "menuWidth": 0,
+  "dialogClickModal": false,
+  "column":[
+    {
+      "label": "合同号",
+      "prop": "orderNo",
+      "search": true,
+      "index": 1,
+      "width":180
+    },
+    {
+      "label": "提单号",
+      "prop": "billNo",
+      "index": 2,
+      "width":180
+    },
+    {
+      "label": "客户",
+      "prop": "corpName",
+      "search": true,
+      "index": 3,
+      "width":180
+    },
+    {
+      "label": "货物品种",
+      "prop": "priceCategoryNames",
+      "index": 4,
+      "width":120
+    },{
+      "label": "规格名称",
+      "prop": "itemType",
+      "index": 5,
+      "width":120
+    },{
+      "label": "件数",
+      "prop": "purchaseQuantity",
+      "index": 6,
+      "width":120
+    },{
+      "label": "发票净重(吨)",
+      "prop": "invoiceWeight",
+      "index": 7,
+      "width":120
+    },{
+      "label": "码单重量(吨)",
+      "prop": "billWeight",
+      "index": 8,
+      "width":120
+    },{
+      "label": "单价",
+      "prop": "price",
+      "index": 9,
+      "width":120
+    },{
+      "label": "合同金额",
+      "prop": "amount",
+      "index": 10,
+      "width":120
+    },{
+      "label": "订单日期",
+      "prop": "marketDate",
+      "hide": true,
+      "type": "date",
+      "format": "yyyy-MM-dd",
+      "valueFormat": "yyyy-MM-dd",
+      "unlinkPanels": true,
+      "searchRange": true,
+      "search": true,
+      "index": 6,
+      "width":150
+    }
+  ]
+}

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

@@ -43,7 +43,7 @@
     },
     {
       "label": "货物品种",
-      "prop": "priceCategory",
+      "prop": "priceCategoryNames",
       "index": 4,
       "width":120
     },{

+ 86 - 0
src/components/procurement/market.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="importMarket" :disabled="selectMarketList.length == 0">导入</el-button>
+       </span>
+    </div>
+  </div>
+</template>
+
+<script>
+  import option from './config/market.json'
+  import {getMarketDetailsList} from "@/api/importTrade/purchase";
+
+  export default {
+    name: "index",
+    props: {
+      itemId: {
+        type: String
+      },
+      closeFun: {
+        type: Function
+      }
+    },
+    data(){
+      return {
+        option:option,
+        loading:false,
+        data:[],
+        selectMarketList:[],
+        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.selectMarketList = row
+      },
+      onLoad(page, params = {}){
+        this.loading = true;
+        if (params.marketDate != undefined) {
+          params.orderStartDate = params.marketDate[0]+ " " + "00:00:00";
+          params.orderEndDate = params.marketDate[1] + " " + "23:59:59";
+          this.$delete(params,'marketDate')
+        }
+        getMarketDetailsList(page.currentPage, page.pageSize,params).then(res=>{
+          this.data = res.data.data.records
+          this.page.total = res.data.data.total
+        })
+          .finally(()=>{
+          this.loading = false;
+        })
+      },
+      importMarket(){
+        this.$emit('importMarket',this.selectMarketList);
+      }
+    }
+  }
+</script>
+<style scoped>
+
+</style>

+ 1 - 1
src/components/procurement/index.vue → src/components/procurement/purchase.vue

@@ -20,7 +20,7 @@
 </template>
 
 <script>
-  import option from './config/mainList.json'
+  import option from './config/purchase.json'
   import {getItemListByConditions} from "@/api/importTrade/purchase";
 
   export default {

+ 34 - 1
src/enums/column-name.js

@@ -106,7 +106,40 @@ const columnName = [{
 }, {
   code: 35,
   name: '封装上传附件'
-}]
+},{
+  code: 36,
+  name: '进口采购订单'
+},{
+  code: 37,
+  name: '进口采购明细'
+},{
+  code: 38,
+  name: '进口销售订单'
+},{
+  code: 39,
+  name: '进口销售明细'
+},{
+  code: 40,
+  name: '进口收货单'
+},{
+  code: 41,
+  name: '进口收货明细'
+},{
+  code: 42,
+  name: '进口收货导入采购明细'
+},{
+  code: 43,
+  name: '进口发货单'
+},{
+  code: 44,
+  name: '进口发货明细'
+},{
+  code: 45,
+  name: '进口发货导入销售明细'
+}
+
+
+]
 export const getColumnName = (key) => {
   for (let index = 0; index < columnName.length; index++) {
     const element = columnName[index];

+ 30 - 55
src/views/importTrade/invoice/config/customerContact.json

@@ -5,12 +5,14 @@
   "searchShow": true,
   "addBtn":false,
   "editBtn":false,
+  "delBtn":false,
   "addRowBtn":false,
   "cellBtn":false,
   "cancelBtn":false,
   "refreshBtn": false,
   "searchMenuSpan": 6,
   "dialogWidth": "60%",
+  "align": "center",
   "tree": true,
   "border": true,
   "index": true,
@@ -22,31 +24,17 @@
       "label": "提单号",
       "prop": "billNo",
       "index": 1,
-      "width":150,
-      "rules": [
-        {
-          "required": true,
-          "message": " ",
-          "trigger": "blur"
-        }
-      ]
+      "width":150
     },{
       "label": "合同号",
       "prop": "contractNumber",
       "index": 2,
-      "width":150,
-      "rules": [
-        {
-          "required": true,
-          "message": " ",
-          "trigger": "blur"
-        }
-      ]
+      "width":150
     },{
       "label": "货物品种",
       "prop": "priceCategory",
       "index": 3,
-      "width":120,
+      "width":200,
       "rules": [
         {
           "required": false,
@@ -55,35 +43,24 @@
         }
       ]
     },{
-      "label": "货物详情",
-      "prop": "cname",
+      "label": "件数",
+      "prop": "actualQuantity",
       "index": 4,
-      "width":120,
-      "cell": true,
-      "rules": [
-        {
-          "required": false,
-          "message": " ",
-          "trigger": "blur"
-        }
-      ]
+      "width":120
     },{
-      "label": "箱号",
-      "prop": "cntrNo",
-      "index": 4,
-      "width":100,
-      "cell": true,
-      "rules": [
-        {
-          "required": false,
-          "message": " ",
-          "trigger": "blur"
-        }
-      ]
+      "label": "单价",
+      "prop": "price",
+      "index": 5,
+      "width":100
+    },{
+      "label": "合同金额",
+      "prop": "contractAmount",
+      "index": 6,
+      "width":120
     },{
       "label": "发票净重(吨)",
       "prop": "invoiceWeight",
-      "index": 5,
+      "index": 7,
       "width":120,
       "rules": [
         {
@@ -95,7 +72,7 @@
     },{
       "label": "码单重量(吨)",
       "prop": "billWeight",
-      "index": 6,
+      "index": 8,
       "width":120,
       "rules": [
         {
@@ -106,20 +83,18 @@
       ]
     },
    {
-      "label": "件数",
-      "prop": "actualQuantity",
-      "index": 7,
-      "width":120
-    },{
-      "label": "单价",
-      "prop": "price",
-      "index": 8,
-      "width":100
-    },{
-      "label": "合同金额",
-      "prop": "contractAmount",
+      "label": "货物详情",
+      "prop": "cname",
       "index": 9,
-      "width":120
+      "width":120,
+      "cell": true,
+      "rules": [
+        {
+          "required": false,
+          "message": " ",
+          "trigger": "blur"
+        }
+      ]
     },{
       "label": "税率",
       "prop": "taxRate",

+ 99 - 17
src/views/importTrade/invoice/detailsPageEdit.vue

@@ -56,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"
@@ -68,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"
@@ -80,6 +80,7 @@
               >
                 <el-option
                   style="width:90%"
+                  @change="sumOrderNo()"
                   v-for="(item,index) in contractDic"
                   :key="index"
                   :label="item.orderNo"
@@ -89,8 +90,17 @@
               <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" :disabled="goodsDisable" 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
@@ -126,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: 90%"
                 placeholder="请输入"
                 size="small"
                 oninput='this.value=this.value.replace(/[^(\d.)]/g,"").replace(/^(\d+)\.(\d\d).*$/, "$1.$2")'
@@ -144,14 +156,21 @@
                 @click="rowCell(row,index)"
               >{{ row.$cellEdit ? '保存' : '修改' }}
               </el-button>
+              <el-button
+                type="text"
+                size="small"
+                :disabled="goodsDisable"
+                @click="rowDel(row,index)"
+              >删除
+              </el-button>
             </template>
             <template slot="menuLeft" slot-scope="{size}">
               <el-button type="primary"
                          icon="el-icon-plus"
                          size="small"
                          :disabled="goodsDisable"
-                         @click="commoditySelection"
-              >新增
+                         @click="marketDialog = true"
+              >录入明细
               </el-button>
             </template>
           </avue-crud>
@@ -205,11 +224,28 @@
       <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>
+<!--          <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
+      title="导入销售"
+      append-to-body
+      class="el-dialogDeep"
+      :visible.sync="marketDialog"
+      width="60%"
+      :close-on-click-modal="false"
+      :destroy-on-close="true"
+      :modal-append-to-body='false'
+      :close-on-press-escape="false"
+      v-dialog-drag>
+      <market-detail
+        @closeFun="!marketDialog"
+        @importMarket="importMarket"
+      >
+      </market-detail>
+    </el-dialog>
   </div>
 </template>
 
@@ -228,6 +264,8 @@ import upLoadOption from "../../exportTrade/purchaseContract/config/uploadList.j
 import { contrastObj,contrastList } from "@/util/contrastData";
 import {getStorage} from "@/api/importTrade/receipt"
 import { getOrgOrderNo } from "@/api/importTrade/salesContract"
+import  marketDetail from "@/components/procurement/market";
+import _ from "lodash";
 
 export default {
   name: "detailsPageEdit",
@@ -236,11 +274,15 @@ export default {
       type: Object
     }
   },
+  components:{
+    marketDetail,
+  },
   data() {
     return {
       form: {},
       disabled: false,
       goodsDisable:false,
+      marketDialog:false,
       customerContact: customerContact,
       contactsForm: {},
       contactsData: [],
@@ -263,6 +305,16 @@ export default {
             prop: 'sysNo',
             disabled:true,
           }, {
+            label: '合同号',
+            prop: 'orderNo',
+            rules: [
+              {
+                required: true,
+                message: ' ',
+                trigger: 'blur'
+              }
+            ]
+          },{
             label: '客户名称',
             prop: 'corpId',
             type:'component',
@@ -393,7 +445,7 @@ export default {
         this.form = res.data.data;
         this.oldForm = Object.assign({},res.data.data);
         this.goodsDisable = res.data.data.deliveryStatus === "已发货" ?   true :false
-        // this.configuration.dicData = this.form.companyName
+        this.configuration.dicData = this.form.corpName
         if(this.form.deliveryItemsList){
           this.contactsData = this.form.deliveryItemsList
           this.oldContactsData = this.deepClone(this.form.deliveryItemsList)
@@ -412,14 +464,26 @@ export default {
         item.srcId = item.id
         item.contractNumber = item.orgOrderNo
         item.contractAmount = item.amount
+        if(item.actualQuantity !== 0){   //如果发过货
+          item.actualQuantity = _.subtract(item.orderQuantity, item.actualQuantity); //发货件数 =  总件数 - 已发件数
+        }else{
+          item.actualQuantity =  item.orderQuantity;
+        }
         delete item.actualQuantity
         delete item.id
       })
       this.contactsData = this.form.orderItemsList
+      this.sumOrderNo();
       delete this.form.orderItemsList
     }
   },
   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 => {
@@ -434,8 +498,9 @@ export default {
         }
         return parseFloat(item.billWeight);
       });
-      this.form.invoiceWeight = invoiceList.reduce((n,m) => n + m)
-      this.form.billWeight = billList.reduce((n,m) => n + m)
+
+      this.$set(this.form,"invoiceWeight", invoiceList.reduce((n,m) => n + m))
+      this.$set(this.form,"billWeight", billList.reduce((n,m) => n + m))
     },
     //提单号带出合同号
     bingOut(row){
@@ -454,7 +519,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);
       }
     },
     //件数
@@ -463,9 +528,21 @@ 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);
       }
     },
+    //导入销售明细
+    importMarket(list){
+      list.forEach(item =>{
+        item.contractNumber = item.orgOrderNo;
+        item.contractAmount = item.amount;
+        item.actualQuantity = item.orderQuantity;
+        delete item.id
+        this.$refs.crudContact.rowCellAdd(item);
+      })
+      this.sumOrderNo();
+      this.marketDialog = false;
+    },
     //选择货物品种
     choice(row){
       this.dialogVisible = true;
@@ -654,8 +731,8 @@ export default {
     },
     //商品新增触发
     commoditySelection() {
-      this.dialogVisible = !this.dialogVisible
-      this.commodityData = false
+      // this.dialogVisible = !this.dialogVisible
+      // this.commodityData = false
     },
     //导入页左商品类型查询
     nodeClick(data) {
@@ -788,6 +865,11 @@ export default {
     }
   }
 }
+.required_fields{
+  color: #F56C6C;
+  display:inline-block;
+  width: 7%
+}
 .add-customer-btn-three {
   position: fixed;
   right: 266px;

+ 0 - 6
src/views/importTrade/receipt/config/customerContact.json

@@ -87,12 +87,6 @@
         }
       ]
     },{
-      "label": "箱号",
-      "prop": "containerNo",
-      "index": 7,
-      "cell": true,
-      "width":120
-    },{
       "label": "发票净重(吨)",
       "prop": "invoiceWeight",
       "index": 8,

+ 7 - 8
src/views/importTrade/receipt/config/mainList.json

@@ -3,7 +3,7 @@
   "tip": false,
   "simplePage": true,
   "searchShow": true,
-  "searchMenuSpan": 6,
+  "searchMenuSpan": 12,
   "searchMenuPosition": "right",
   "align": "center",
   "dialogWidth": "60%",
@@ -35,6 +35,11 @@
       "label": "收货日期",
       "prop": "businessDate",
       "search": true,
+      "type": "date",
+      "format": "yyyy-MM-dd",
+      "valueFormat": "yyyy-MM-dd",
+      "unlinkPanels": true,
+      "searchRange": true,
       "index": 3,
       "width":150
     },{
@@ -44,13 +49,7 @@
       "index": 4,
       "width":120
     },{
-      "label": "销售公司",
-      "prop": "salesCompanyName",
-      "search": true,
-      "index": 5,
-      "width":150
-    },{
-      "label": "工厂/贸易商名称",
+      "label": "客户名称",
       "prop": "corpName",
       "index": 6,
       "width":150

+ 8 - 2
src/views/importTrade/receipt/detailsPageEdit.vue

@@ -266,7 +266,7 @@ 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/index";
+import  procurementDetail from "@/components/procurement/purchase";
 import _ from "lodash";
 
 export default {
@@ -692,8 +692,14 @@ export default {
     },
     //导入采购明细
     importProMent(list){
+      list.forEach(item =>{
+        item.contractNumber = item.orderNo;
+        item.contractAmount = item.amount;
+        item.actualQuantity = item.purchaseQuantity;
+        this.$refs.crudContact.rowCellAdd(item);
+      })
+      this.sumOrderNo();
       this.procurementDialog = false;
-      this.$refs.crudContact.rowCellAdd(list);
     },
     //上传文件保存
     upLoadSave(row, done, loading){

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

@@ -206,17 +206,26 @@ export default {
     sizeChange() {
       console.log('1')
     },
-    refreshChange() {
-      console.log('1')
+    refreshChange(params,done) {
+      this.onLoad(this.page,params)
+      done();
     },
     onLoad(page, params) {
       let queryParams = Object.assign({}, params, {
         size: page.pageSize,
         current: page.currentPage,
       })
+      this.loading = true
       selectReceiptList(queryParams).then(res => {
         this.dataList = res.data.data.records
         this.page.total = res.data.data.total
+        if (this.page.total) {
+          this.option.height = window.innerHeight - 350;
+        } else {
+          this.option.height = window.innerHeight - 305;
+        }
+      }).finally(()=>{
+        this.loading = false
       })
     },
     goBack() {

+ 16 - 12
src/views/purchase/contract/config/mainList.json

@@ -3,7 +3,7 @@
   "tip": false,
   "simplePage": true,
   "searchShow": true,
-  "searchMenuSpan": 12,
+  "searchMenuSpan": 6,
   "dialogWidth": "60%",
   "align": "center",
   "searchMenuPosition": "right",
@@ -25,6 +25,7 @@
       "label": "合同号",
       "prop": "orderNo",
       "search": true,
+      "searchIndex": 1,
       "index": 1,
       "width":100
     },
@@ -36,7 +37,6 @@
       "valueFormat": "yyyy-MM-dd",
       "unlinkPanels": true,
       "searchRange": true,
-      "search": true,
       "index": 2,
       "width":150
     },
@@ -44,12 +44,12 @@
       "label": "供应商",
       "prop": "strCorpName",
       "search": true,
+      "searchIndex": 2,
       "index": 3,
       "width":120
     },{
       "label": "采购商",
       "prop": "strPurchaserName",
-      "search": true,
       "index": 4,
       "width":120
     },
@@ -61,7 +61,6 @@
       "valueFormat": "yyyy-MM-dd",
       "unlinkPanels": true,
       "searchRange": true,
-      "search": true,
       "index": 5,
       "width":150
     },{
@@ -72,49 +71,54 @@
       "valueFormat": "yyyy-MM-dd",
       "unlinkPanels": true,
       "searchRange": true,
-      "search": true,
       "index": 6,
       "width":150
     },{
       "label": "合同金额",
       "prop": "orderAmount",
-      "search": false,
       "index": 7,
       "width":100
     },{
       "label": "币别",
       "prop": "currency",
-      "search": false,
       "index": 8,
       "width":100
     },{
       "label": "汇率",
       "prop": "exChangeRate",
-      "search": false,
       "index": 8,
       "width":100
     },{
       "label": "是否全部到货",
       "prop": "arrival",
-      "search": false,
       "index": 8,
       "width":100
     },{
       "label": "单据状态",
       "prop": "status",
-      "search": false,
       "index": 8,
       "width":100
     },{
       "label": "单据类型",
       "prop": "orderType",
-      "search": false,
       "index": 8,
       "width":100
     },{
       "label": "备注",
       "prop": "orderRemark",
-      "search": false,
+      "index": 8,
+      "width":100
+    },
+    {
+      "label": "采购日期",
+      "prop": "createTime",
+      "type": "date",
+      "format": "yyyy-MM-dd",
+      "valueFormat": "yyyy-MM-dd",
+      "unlinkPanels": true,
+      "searchRange": true,
+      "search": true,
+      "searchIndex": 3,
       "index": 8,
       "width":100
     }

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

@@ -6,6 +6,11 @@
                    @click="backToList">返回列表
         </el-button>
       </div>
+      <el-button type="primary"
+                 class="el-button--small-yh add-customer-btn-three"
+                 :disabled="true"
+                 @click.stop="">请核
+      </el-button>
       <el-button type="success"
                  class="el-button--small-yh add-customer-btn-two"
                  :disabled="true"
@@ -187,11 +192,6 @@
                          @click="applicationDialog = true,applicationData = contactsData"
               >查看申请记录
               </el-button>
-              <el-button type="info"
-                         size="small"
-                         @click=""
-              >审批流
-              </el-button>
             </template>
           </avue-crud>
         </basic-container>
@@ -778,16 +778,19 @@ export default {
           const orderFilesList = this.$refs.uploadFile.submitData();
           for (let j = 0; j < this.contactsData.length; j++) {
             if (this.contactsData[j].billNo == null) {
-              return this.$message.error(`请输入第${j + 1}行的提单号`);
+              return this.$message.error(`请输入采购明细第${j + 1}行的提单号`);
             }
             if (this.contactsData[j].priceCategory === "") {
-              return this.$message.error(`请输入第${j + 1}行的货物品种`);
+              return this.$message.error(`请输入采购明细第${j + 1}行的货物品种`);
             }
             if (this.contactsData[j].itemType === "") {
-              return this.$message.error(`请输入第${j + 1}行的规格型号`);
+              return this.$message.error(`请输入采购明细第${j + 1}行的规格型号`);
             }
             if (this.contactsData[j].purchaseQuantity === "") {
-              return this.$message.error(`请输入第${j + 1}行的件数`);
+              return this.$message.error(`请输入采购明细第${j + 1}行的件数`);
+            }
+            if (this.importInventoryData[j].purchaseQuantity === 0) {
+              return this.$message.error(`采购明细第${j + 1}行的件数不能为0`);
             }
           }
           let submitDto = {
@@ -1106,6 +1109,11 @@ export default {
   display:inline-block;
   width: 7%
 }
+.add-customer-btn-three {
+  position: fixed;
+  right: 266px;
+  top: 115px;
+}
 .add-customer-btn {
   position: fixed;
   right: 36px;

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

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

+ 33 - 48
src/views/salesManagement/salesContract/config/importInventory.json

@@ -47,112 +47,97 @@
       "label": "货物品种",
       "prop": "priceCategory",
       "index": 3,
-      "width":120
+      "width":200
     },{
-      "label": "货物详情",
-      "prop": "cname",
+      "label": "件数",
+      "prop": "orderQuantity",
       "index": 4,
       "width":120,
-      "cell": true,
       "rules": [
         {
           "required": false,
-          "message": "请输入货物详情",
+          "message": "请输入件数",
           "trigger": "blur"
         }
       ]
     },{
-      "label": "发票净重(吨)",
-      "prop": "invoiceWeight",
+      "label": "单价",
+      "prop": "price",
       "index": 5,
       "width":120,
       "rules": [
         {
           "required": false,
-          "message": "请输入发票净重(吨)",
+          "message": "请输入单价",
           "trigger": "blur"
         }
       ]
     },{
-      "label": "码单重量(吨)",
-      "prop": "billWeight",
+      "label": "合同金额",
+      "prop": "amount",
       "index": 6,
       "width":120,
       "rules": [
         {
           "required": false,
-          "message": "请输入码单重量(吨)",
+          "message": "请输入合同金额",
           "trigger": "blur"
         }
       ]
-    },
-    {
-      "label": "发货数量",
-      "prop": "actualQuantity",
+    }, {
+      "label": "库存",
+      "prop": "kucun",
       "index": 7,
       "width":120
     },
     {
-      "label": "箱号",
-      "prop": "cntrNo",
-      "index": 7,
-      "width":100,
-      "cell": true,
-      "rules": [
-        {
-          "required": false,
-          "message": " ",
-          "trigger": "blur"
-        }
-      ]
-    },
-    {
-      "label": "库存",
-      "prop": "kucun",
-      "index": 7,
+      "label": "发货数量",
+      "prop": "actualQuantity",
+      "index": 8,
       "width":120
     },
     {
-      "label": "件数",
-      "prop": "orderQuantity",
-      "cell": true,
-      "index": 7,
+      "label": "发票净重(吨)",
+      "prop": "invoiceWeight",
+      "index": 10,
       "width":120,
       "rules": [
         {
           "required": false,
-          "message": "请输入件数",
+          "message": "请输入发票净重(吨)",
           "trigger": "blur"
         }
       ]
     },{
-      "label": "单价",
-      "prop": "price",
-      "index": 8,
+      "label": "码单重量(吨)",
+      "prop": "billWeight",
+      "index": 11,
       "width":120,
       "rules": [
         {
           "required": false,
-          "message": "请输入单价",
+          "message": "请输入码单重量(吨)",
           "trigger": "blur"
         }
       ]
-    },{
-      "label": "合同金额",
-      "prop": "amount",
-      "index": 9,
+    },
+    {
+      "label": "货物详情",
+      "prop": "cname",
+      "index": 12,
       "width":120,
+      "cell": true,
       "rules": [
         {
           "required": false,
-          "message": "请输入合同金额",
+          "message": "请输入货物详情",
           "trigger": "blur"
         }
       ]
     },{
       "label": "税率",
       "prop": "taxRate",
-      "index": 10,
+      "index": 13,
       "width":120,
       "cell": true,
       "rules": [
@@ -165,7 +150,7 @@
     }, {
       "label": "备注",
       "prop": "remarks",
-      "index": 11,
+      "index": 14,
       "width":200,
       "cell": true,
       "rules": [

+ 2 - 20
src/views/salesManagement/salesContract/config/mainList.json

@@ -3,7 +3,7 @@
   "tip": false,
   "simplePage": true,
   "searchShow": true,
-  "searchMenuSpan": 18,
+  "searchMenuSpan": 6,
   "searchMenuPosition": "right",
   "dialogWidth": "60%",
   "tree": true,
@@ -22,31 +22,13 @@
   "rowKey": "id",
   "column":[
     {
-      "label": "合同日期",
-      "prop": "businessDate",
-      "type": "date",
-      "format": "yyyy-MM-dd",
-      "valueFormat": "yyyy-MM-dd",
-      "unlinkPanels": true,
-      "searchRange": true,
-      "search": true,
-      "index": 1,
-      "width":150
-    },
-    {
       "label": "合同号",
       "prop": "orderNo",
       "search": true,
       "index": 2,
       "width":150
     },{
-      "label": "销售公司",
-      "prop": "belongToCorpName",
-      "search": true,
-      "index": 3,
-      "width":120
-    },{
-      "label": "工厂/贸易商名称",
+      "label": "客户名称",
       "prop": "corpsName",
       "search": true,
       "index": 4,

+ 107 - 71
src/views/salesManagement/salesContract/detailsPage.vue

@@ -6,6 +6,11 @@
                    @click="backToList">返回列表
         </el-button>
       </div>
+      <el-button type="primary"
+                 class="el-button--small-yh add-customer-btn-three"
+                 :disabled="true"
+                 @click.stop="">请核
+      </el-button>
       <el-button type="success"
                  class="el-button--small-yh add-customer-btn-two"
                  :disabled="true"
@@ -47,8 +52,8 @@
             </el-col>
           </el-row>
         </basic-container>
-<!--        商品明细-->
-        <containerTitle title="商品明细"></containerTitle>
+<!--        销售明细-->
+        <containerTitle title="销售明细"></containerTitle>
         <basic-container style="margin-bottom: 10px">
           <avue-crud
             :option="importInventory"
@@ -60,30 +65,8 @@
             @row-del="rowDelList"
             @selection-change="productSelection"
           >
-            <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="orderQuantity" slot-scope="{ row }">
-              <el-input
-                v-if="row.$cellEdit"
-                v-model="row.orderQuantity"
-                placeholder="请输入"
-                size="small"
-                oninput='this.value=this.value.replace(/[^(\d.)]/g,"").replace(/^(\d+)\.(\d\d).*$/, "$1.$2")'
-                @input="quantityChange(row)"
-              ></el-input>
-              <span v-else>{{ row.orderQuantity }}</span>
-            </template>
             <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"
@@ -95,10 +78,10 @@
               <span v-else>{{ row.billNo }}</span>
             </template>
             <template slot-scope="{row}" slot="orgOrderNo">
-              <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.orgOrderNo"
                 placeholder=" "
                 size="small"
@@ -114,6 +97,43 @@
               </el-select>
               <span v-else>{{ row.orgOrderNo }}</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="orderQuantity" slot-scope="{ row }">
+              <span v-if="row.$cellEdit" class="required_fields">*</span>
+              <el-input
+                v-if="row.$cellEdit"
+                v-model="row.orderQuantity"
+                style="width: 90%"
+                placeholder="请输入"
+                size="small"
+                oninput='this.value=this.value.replace(/[^(\d.)]/g,"").replace(/^(\d+)\.(\d\d).*$/, "$1.$2")'
+                @input="quantityChange(row)"
+              ></el-input>
+              <span v-else>{{ row.orderQuantity }}</span>
+            </template>
+            <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.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
                 v-if="row.$cellEdit"
@@ -136,10 +156,6 @@
               ></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="menuLeft" slot-scope="{size}">
               <el-button type="primary"
                          icon="el-icon-plus"
@@ -187,7 +203,7 @@
       append-to-body
       class="el-dialogDeep"
       :visible.sync="dialogVisible"
-      width="80%"
+      width="60%"
       :close-on-click-modal="false"
       :destroy-on-close="true"
       :close-on-press-escape="false">
@@ -355,24 +371,12 @@ export default {
                 trigger: 'blur'
               }
             ]
-          }, {
-            label: '销售公司',
-            prop: 'belongToCorpId',
-            dicData: [],
-            rules: [
-              {
-                required: false,
-                message: ' ',
-                trigger: 'blur'
-              }
-            ]
-          }, {
-            label: '工厂/贸易商名称',
+          },  {
+            label: '客户名称',
             prop: 'corpId',
-            dicData: [],
             rules: [
               {
-                required: false,
+                required: true,
                 message: ' ',
                 trigger: 'blur'
               }
@@ -678,11 +682,6 @@ export default {
         }
       })
     }
-    // else{
-    //   getSysNo("JK-XS").then(res =>{
-    //     this.$set(this.form,"sysNo", res.data.data)
-    //   })
-    // }
   },
   components: {
     feeInfo,
@@ -703,8 +702,8 @@ export default {
         }
         return parseFloat(item.billWeight);
       });
-      this.form.invoiceWeight = invoiceList.reduce((n,m) => n + m)
-      this.form.billWeight = billList.reduce((n,m) => n + m)
+      this.$set(this.form,"invoiceWeight", invoiceList.reduce((n,m) => n + m))
+      this.$set(this.form,"billWeight", billList.reduce((n,m) => n + m))
     },
     //汇率
     currencyChange(value){
@@ -714,7 +713,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)
         }
       }
     },
@@ -724,7 +723,7 @@ export default {
         row.price = "";
         row.amount = 0
       } else {
-        row.amount = (row.orderQuantity * row.price).toFixed(2);
+        row.amount = _.multiply(row.orderQuantity, row.price).toFixed(2);
       }
     },
     //件数
@@ -733,7 +732,7 @@ export default {
         row.orderQuantity = "";
         row.amount = 0
       } else {
-        row.amount = (row.orderQuantity * row.price).toFixed(2);
+        row.amount =_.multiply(row.orderQuantity,row.price).toFixed(2);
       }
     },
     editCustomer(status) {
@@ -753,10 +752,19 @@ export default {
         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}行的提单号`);
+            return this.$message.error(`请输入销售明细第${j + 1}行的提单号`);
           }
           if (this.importInventoryData[j].orgOrderNo === "") {
-            return this.$message.error(`请输入商品明细第${j + 1}行的合同号`);
+            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) {
@@ -820,20 +828,32 @@ export default {
           id:this.form.id,
           orderItemIds:this.selection.map(i=>{return i.id})
         }
-        if(this.$store.getters.goStatus){
-          this.$alert("发货单已存在,请保存发货单再进行操作", "温馨提示", {
-            confirmButtonText: "确定",
-            type: 'warning',
-            callback: action => {
-            }
-          });
+        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{
-          generateShipment(params).then(res=>{
-            this.$router.push({
-              path: "/importTrade/invoice/index",
-              query: {form: JSON.stringify(res.data.data)},
+          if(this.$store.getters.goStatus){
+            this.$alert("发货单已存在,请保存发货单再进行操作", "温馨提示", {
+              confirmButtonText: "确定",
+              type: 'warning',
+              callback: action => {
+              }
             });
-          })
+          }else{
+            generateShipment(params).then(res=>{
+              this.$router.push({
+                path: "/importTrade/invoice/index",
+                query: {form: JSON.stringify(res.data.data)},
+              });
+            })
+          }
         }
       }else{
         this.$confirm("列表内存在新录入数据,是否先保存此数据?", {
@@ -901,6 +921,12 @@ export default {
         const data = res.data.data;
         this.page.total = data.total;
         this.data = data.records;
+        if (this.page.total) {
+          this.option.height = window.innerHeight - 350;
+        } else {
+          this.option.height = window.innerHeight - 305;
+        }
+      }).finally(()=>{
         this.loading = false;
       });
     },
@@ -1053,6 +1079,16 @@ export default {
   color: #323233;
   font-weight: 400;
 }
+.required_fields{
+  color: #F56C6C;
+  display:inline-block;
+  width: 7%
+}
+.add-customer-btn-three {
+  position: fixed;
+  right: 266px;
+  top: 115px;
+}
 
 .add-customer-btn {
   position: fixed;