Browse Source

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

QuKatie 3 years ago
parent
commit
91ebbd0792
43 changed files with 1060 additions and 554 deletions
  1. 19 1
      src/api/approval/processConfig.js
  2. 267 259
      src/components/finance/applyPayment.vue
  3. 60 0
      src/views/approval/businessApproval/config/mainList.json
  4. 152 0
      src/views/approval/businessApproval/index.vue
  5. 1 0
      src/views/approval/processConfig/config/mainList.json
  6. 35 17
      src/views/approval/processConfig/index.vue
  7. 1 1
      src/views/businessManagement/deliveryNotice/configuration/advantageProject.json
  8. 1 1
      src/views/businessManagement/deliveryNotice/configuration/bankOfDeposit.json
  9. 1 1
      src/views/businessManagement/deliveryNotice/configuration/customerContact.json
  10. 20 9
      src/views/businessManagement/deliveryNotice/detailsPageEdit.vue
  11. 1 1
      src/views/businessManagement/purchaseOrder/configuration/advantageProject.json
  12. 1 1
      src/views/businessManagement/purchaseOrder/configuration/bankOfDeposit.json
  13. 1 1
      src/views/businessManagement/purchaseOrder/configuration/customerContact.json
  14. 3 3
      src/views/businessManagement/purchaseOrder/configuration/mainList.json
  15. 42 30
      src/views/businessManagement/purchaseOrder/detailsPageEdit.vue
  16. 78 2
      src/views/businessManagement/purchaseOrder/index.vue
  17. 1 1
      src/views/businessManagement/receipt/configuration/advantageProject.json
  18. 1 1
      src/views/businessManagement/receipt/configuration/bankOfDeposit.json
  19. 1 1
      src/views/businessManagement/receipt/configuration/customerContact.json
  20. 21 4
      src/views/businessManagement/receipt/detailsPageEdit.vue
  21. 1 1
      src/views/businessManagement/salesOrder/configuration/advantageProject.json
  22. 1 1
      src/views/businessManagement/salesOrder/configuration/bankOfDeposit.json
  23. 1 1
      src/views/businessManagement/salesOrder/configuration/customerContact.json
  24. 3 1
      src/views/businessManagement/salesOrder/configuration/mainList.json
  25. 89 55
      src/views/businessManagement/salesOrder/detailsPageEdit.vue
  26. 46 5
      src/views/businessManagement/salesOrder/index.vue
  27. 3 0
      src/views/financialManagement/paymentRequest/configuration/detailsPage.json
  28. 9 33
      src/views/financialManagement/paymentRequest/paymentRequestDetails.vue
  29. 6 2
      src/views/financialManagement/paymentSettle/configuration/detailsPage.json
  30. 26 9
      src/views/financialManagement/paymentSettle/paymentSettleDetailsPage.vue
  31. 17 4
      src/views/financialManagement/receiptSettle/receiptSettleDetailsPage.vue
  32. 8 2
      src/views/importTrade/invoice/config/customerContact.json
  33. 2 2
      src/views/importTrade/invoice/config/mainList.json
  34. 8 6
      src/views/importTrade/invoice/detailsPageEdit.vue
  35. 8 2
      src/views/importTrade/receipt/config/customerContact.json
  36. 2 2
      src/views/importTrade/receipt/config/mainList.json
  37. 9 10
      src/views/importTrade/receipt/detailsPageEdit.vue
  38. 1 1
      src/views/purchase/contract/config/customerContact.json
  39. 11 4
      src/views/purchase/contract/config/mainList.json
  40. 54 48
      src/views/purchase/contract/detailsPage.vue
  41. 7 0
      src/views/purchase/stockBill/config/mainList.json
  42. 4 4
      src/views/salesManagement/salesContract/config/mainList.json
  43. 37 27
      src/views/salesManagement/salesContract/detailsPage.vue

+ 19 - 1
src/api/approval/processConfig.js

@@ -20,7 +20,9 @@ export function removeList(data) {
   return request({
     url: '/api/blade-check/auditpaths/remove',
     method: 'post',
-    data: data,
+    params: {
+      ids:data
+    },
   })
 }
 // 查看详情
@@ -31,3 +33,19 @@ export function detailData(params) {
     params: params,
   })
 }
+//业务审批配置列表
+export function getBusinList(params) {
+  return request({
+    url: '/api/blade-check/auditpathsacts/list',
+    method: 'get',
+    params: params,
+  })
+}
+
+export function businModify(data) {
+  return request({
+    url: '/api/blade-check/auditpathsacts/modify',
+    method: 'post',
+    data: data,
+  })
+}

+ 267 - 259
src/components/finance/applyPayment.vue

@@ -2,7 +2,8 @@
   <div>
     <div v-for="(item, index) in list" :key="index">
       <el-row>
-        <el-col :span="24"><span class="delete_group" v-if="list.length !== 1"  @click="deleteGroup(index)">删除组</span></el-col>
+        <el-col :span="24"><span class="delete_group" v-if="list.length !== 1" @click="deleteGroup(index)">删除组</span>
+        </el-col>
       </el-row>
       <basic-container>
         <avue-form class="trading-form" :option="option" ref="form" v-model="item.form">
@@ -60,283 +61,290 @@
 </template>
 
 <script>
-  import { applyLoan,paymentApply } from "@/api/financialManagement/paymentRequest";
-  import _ from "lodash";
+import {applyLoan, paymentApply} from "@/api/financialManagement/paymentRequest";
+import _ from "lodash";
 
-    export default {
-      name: "applyPayment",
-      props:{
-        billType:{
-          type:String
-        },
-        billData:{
-          type:Object
-        },
-        choceFun:{
-          type:Function
-        },
-        arrList: {
-          type: Array,
-          default: [],
-        }
+export default {
+  name: "applyPayment",
+  props: {
+    billType: {
+      type: String
+    },
+    billData: {
+      type: Object
+    },
+    choceFun: {
+      type: Function
+    },
+    arrList: {
+      type: Array,
+      default: []
+    }
+
+  },
+  data() {
+    return {
+      form: {
+        form: {}
       },
-      data(){
-        return{
-          form:{
-            form:{}
-          },
-          list:[],
-          currencyDic:[],
-          corpId:"",
-          configuration:{
-            multipleChoices:false,
-            multiple:false,
-            disabled:true,
-            searchShow:true,
-            collapseTags:false,
-            placeholder:'请点击右边按钮选择',
-            dicData:[]
-          },
-          breakConfiguration:{
-            multipleChoices:false,
-            multiple:false,
-            disabled:true,
-            searchShow:true,
-            collapseTags:false,
-            placeholder:'请点击右边按钮选择',
-            dicData:[]
-          },
-          option:{
-            emptyBtn: false,
-            submitBtn: false,
-            labelWidth: 120,
-            menuSpan: 8,
-            column: [
-              {
-                label: this.billData.optionType === "JK"?"合同号":"订单号",
-                prop: 'srcOrderno',
-                span: 8,
-                disabled:true,
-                rules: [
-                  {
-                    required: true,
-                    message: ' ',
-                    trigger: 'blur'
-                  }
-                ]
-              },
+      list: [],
+      currencyDic: [],
+      corpId: "",
+      configuration: {
+        multipleChoices: false,
+        multiple: false,
+        disabled: true,
+        searchShow: true,
+        collapseTags: false,
+        placeholder: '请点击右边按钮选择',
+        dicData: []
+      },
+      breakConfiguration: {
+        multipleChoices: false,
+        multiple: false,
+        disabled: true,
+        searchShow: true,
+        collapseTags: false,
+        placeholder: '请点击右边按钮选择',
+        dicData: []
+      },
+      option: {
+        emptyBtn: false,
+        submitBtn: false,
+        labelWidth: 120,
+        menuSpan: 8,
+        column: [
+          {
+            label: this.billData.optionType === "JK" ? "合同号" : "订单号",
+            prop: 'srcOrderno',
+            span: 8,
+            disabled: true,
+            rules: [
               {
-                label: '客户名称',
-                prop: 'corpId',
-                span: 16,
-                rules: [
-                  {
-                    required: true,
-                    message: ' ',
-                    trigger: 'blur'
-                  }
-                ]
-              },
-              this.billData.optionType === "JK"?
+                required: true,
+                message: ' ',
+                trigger: 'blur'
+              }
+            ]
+          },
+          {
+            label: '客户名称',
+            prop: 'corpId',
+            span: 16,
+            rules: [
               {
-                label: '提单号',
-                prop: 'billNo',
-                span: 8,
-                rules: [
-                  {
-                    required: true,
-                    message: ' ',
-                    trigger: 'blur'
-                  }
-                ]
-              }:{display:false},
+                required: true,
+                message: ' ',
+                trigger: 'blur'
+              }
+            ]
+          },
+          this.billData.optionType === "JK" ?
+            {
+              label: '提单号',
+              prop: 'billNo',
+              span: 8,
+              rules: [
+                {
+                  required: true,
+                  message: ' ',
+                  trigger: 'blur'
+                }
+              ]
+            } : {display: false},
+          {
+            label: '费用名称',
+            prop: 'costType',
+            span: 8,
+            rules: [
               {
-                label: '费用名称',
-                prop: 'costType',
-                span: 8,
-                rules: [
-                  {
-                    required: true,
-                    message: ' ',
-                    trigger: 'blur'
-                  }
-                ]
-              },
+                required: true,
+                message: ' ',
+                trigger: 'blur'
+              }
+            ]
+          },
+          {
+            label: this.billData.optionType === "JK" ? '合同日期' : "订单日期",
+            type: "date",
+            prop: 'accDate',
+            span: 8,
+            rules: [
               {
-                label: this.billData.optionType === "JK"?'合同日期':"订单日期",
-                type:"date",
-                prop: 'accDate',
-                span: 8,
-                rules: [
-                  {
-                    required: true,
-                    message: ' ',
-                    trigger: 'blur'
-                  }
-                ]
-              },
+                required: true,
+                message: ' ',
+                trigger: 'blur'
+              }
+            ]
+          },
+          {
+            label: '金额',
+            prop: 'amount',
+            span: 8,
+            rules: [
               {
-                label: '单价',
-                prop: 'price',
-                span: 8,
-                rules: [
-                  {
-                    pattern: /(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/,
-                    message: ' ',
-                    trigger: 'blur'
-                  },
-                  {
-                    required: true,
-                    message: ' ',
-                    trigger: 'blur'
-                  }
-                ]
+                pattern: /(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/,
+                message: ' ',
+                trigger: 'blur'
               },
               {
-                label: '金额',
-                prop: 'amount',
-                span: 8,
-                rules: [
-                  {
-                    pattern: /(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/,
-                    message: ' ',
-                    trigger: 'blur'
-                  },
-                  {
-                    required: true,
-                    message: ' ',
-                    trigger: 'blur'
-                  }
-                ]
-              },
+                required: true,
+                message: ' ',
+                trigger: 'blur'
+              }
+            ]
+          },
+          {
+            label: '单价',
+            prop: 'price',
+            span: 8,
+            rules: [
               {
-              label: this.billType == ("采购申请货款" || "销售申请退款")?'付款日期':"收款日期",
-              prop: 'date',
-                type:'date',
-                span: 8,
-                rules: [
-                  {
-                    required: false,
-                    message: ' ',
-                    trigger: 'blur'
-                  }
-                ]
+                pattern: /(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/,
+                message: ' ',
+                trigger: 'blur'
               },
               {
-                label: '计价单位',
-                prop: 'unit',
-                type:"select",
-                span: 8,
-                rules: [
-                  {
-                    required: true,
-                    message: ' ',
-                    trigger: 'blur'
-                  }
-                ],
-                dicUrl: "/api/blade-system/dict-biz/dictionary?code=unit",
-                props: {
-                  label: "dictValue",
-                  value: "dictKey"
-                }
-              },
+                required: false,
+                message: ' ',
+                trigger: 'blur'
+              }
+            ]
+          },
+          {
+            label: '计价单位',
+            prop: 'unit',
+            type: "select",
+            span: 8,
+            rules: [
               {
-                label: '币别',
-                prop: 'currency',
-                span: 8,
-                type:"select",
-                dicUrl: "/api/blade-system/dict-biz/dictionary?code=currency",
-                props: {
-                  label: "dictValue",
-                  value: "dictKey"
-                },
-                rules: [
-                  {
-                    required: true,
-                    message: ' ',
-                    trigger: 'blur'
-                  }
-                ]
-              },
+                required: false,
+                message: ' ',
+                trigger: 'blur'
+              }
+            ],
+            dicUrl: "/api/blade-system/dict-biz/dictionary?code=unit",
+            props: {
+              label: "dictValue",
+              value: "dictKey"
+            }
+          },
+          {
+            label: '币别',
+            prop: 'currency',
+            span: 8,
+            type: "select",
+            dicUrl: "/api/blade-system/dict-biz/dictionary?code=currency",
+            props: {
+              label: "dictValue",
+              value: "dictKey"
+            },
+            rules: [
               {
-                label: '汇率',
-                prop: 'exchangeRate',
-                span: 8,
-                rules: [
-                  {
-                    required: true,
-                    message: ' ',
-                    trigger: 'blur'
-                  }
-                ]
-              },
+                required: true,
+                message: ' ',
+                trigger: 'blur'
+              }
+            ]
+          },
+          {
+            label: '汇率',
+            prop: 'exchangeRate',
+            span: 8,
+            rules: [
               {
-                label: '税率',
-                prop: 'taxRate',
-                span: 8,
-                rules: [
-                  {
-                    required: true,
-                    message: ' ',
-                    trigger: 'blur'
-                  }
-                ]
-              },
+                required: true,
+                message: ' ',
+                trigger: 'blur'
+              }
+            ]
+          },
+          {
+            label: '税率',
+            prop: 'taxRate',
+            value:0,
+            span: 8,
+            rules: [
               {
-                label: '备注',
-                prop: 'remarks',
-                span: 24,
-                type: 'textarea',
-                row: true,
-                minRows: 2,
-                isRules: false
+                required: true,
+                message: ' ',
+                trigger: 'blur'
               }
             ]
           },
-        }
+          {
+            label: '备注',
+            prop: 'remarks',
+            span: 24,
+            type: 'textarea',
+            row: true,
+            minRows: 2,
+            isRules: false
+          }
+        ]
       },
-      created() {
-        //币别
-        this.getWorkDicts("currency").then(res =>{
-          this.currencyDic = res.data.data
-        })
-        if (this.arrList.length == 0) {
-          this.form.form = this.billData
-          this.corpId =  this.billData.corpId
-          this.configuration.dicData = this.billData.corpsName
-        }
-        if (this.arrList.length > 0) {
-          this.list = this.arrList
+    }
+  },
+  created() {
+    //币别
+    this.getWorkDicts("currency").then(res => {
+      this.currencyDic = res.data.data
+    })
+    if (this.arrList.length == 0) {
+      this.form.form = this.billData
+      if(this.billData.billNoList && this.billData.billNoList.length === 1){
+        this.form.form.billNo = this.billData.billNoList[0]
+      }
+      this.corpId = this.billData.corpId
+      this.configuration.dicData = this.billData.corpsName
+      this.addForm();
+    }
+    if (this.arrList.length > 0) {
+      this.list = this.arrList
+      this.corpId = this.list[0].form.corpId
+      let arr = []
+      this.list.forEach(item => {
+        let a = {
+          id: item.form.corpId,
+          cname: item.form.corpsName
         }
-        this.addForm();
-      },
-      methods:{
-        addForm(){
-          //去除form身上双向绑定
-          this.list.push(JSON.parse(JSON.stringify(this.form)))
-        },
-        deleteGroup(index){
-          this.list.splice(index, 1);
-        },
-        //计算单价  数量
-        // calculate(valueForm){
-        //   if(valueForm.price && valueForm.quantity){
-        //     valueForm.amount = _.multiply(valueForm.price, valueForm.quantity).toFixed(2);
-        //   }
-        // },
-        //币别选择
-        currencyChange(valueForm){
-          if(valueForm.currency === "USD"){
-            valueForm.exchangeRate = 6.3686;
-          }else{
-            valueForm.exchangeRate = 1;
-          }
-        },
-        async submit(){
-          let result = [];
-          await this.handleRulesValid(["form"],result)
-          if (result.some(item => item)) {
-            const itemsList =  this.list.map(item =>{ item.form.corpId = this.corpId; return item.form})
+        arr.push(a)
+      })
+      this.configuration.dicData = this.configuration.dicData.concat(arr)
+    }
+  },
+  methods: {
+    addForm() {
+      //去除form身上双向绑定
+      this.list.push(JSON.parse(JSON.stringify(this.form)))
+    },
+    deleteGroup(index) {
+      this.list.splice(index, 1);
+    },
+    //计算单价  数量
+    // calculate(valueForm){
+    //   if(valueForm.price && valueForm.quantity){
+    //     valueForm.amount = _.multiply(valueForm.price, valueForm.quantity).toFixed(2);
+    //   }
+    // },
+    //币别选择
+    currencyChange(valueForm) {
+      if (valueForm.currency === "CNY") {
+        valueForm.exchangeRate = 1;
+      } else  if (valueForm.currency === "USD"){
+        valueForm.exchangeRate = 6.3686;
+      }else{
+        valueForm.exchangeRate = 7.1749;
+      }
+    },
+    async submit() {
+      let result = [];
+      await this.handleRulesValid(["form"], result)
+      if (result.some(item => item)) {
+        const itemsList = this.list.map(item => {
+          item.form.corpId = this.corpId;
+          return item.form
+        })
 
             const params = {
               billType : this.billType,
@@ -344,7 +352,7 @@
               itemsList: itemsList
             }
             // 采购申请货款   销售申请退款 都会走申请 走审核   => 付款申请
-            if(this.billType === "采购申请货款" || this.billType === "销售申请退款" ){
+            if(this.billType === "申请"){
               applyLoan(params).then(res =>{
                 if(res.data.success){
                   this.$message.success("操作成功!")
@@ -369,7 +377,7 @@
               })
             }
             //采购退款结算 销售收款结算  不需申请请核 直接结算  => 结算
-            if(this.billType === "采购退款结算" || this.billType === "销售收款结算"){
+            if(this.billType === "收费"){
               paymentApply(params).then(res=>{
                 if(res.data.success){
                   this.$message.success("操作成功!")

+ 60 - 0
src/views/approval/businessApproval/config/mainList.json

@@ -0,0 +1,60 @@
+{
+  "searchShow": true,
+  "searchMenuSpan": 16,
+  "border": true,
+  "index": true,
+  "viewBtn": false,
+  "editBtn": false,
+  "delBtn": false,
+  "addBtn": false,
+  "align": "center",
+  "menuWidth": 180,
+  "showSummary": true,
+  "searchIcon": true,
+  "searchIndex": 2,
+  "searchLabelWidth": 120,
+  "searchSpan": 8,
+  "searchMenuPosition": "right",
+  "column": [
+    {
+      "label": "活动名",
+      "prop": "actName",
+      "search": true,
+      "index": 1,
+      "width": 400,
+      "overHidden": true
+    },
+    {
+      "label": "审核条件",
+      "prop": "reviewConditions",
+      "type":"select",
+      "index": 2,
+      "width": 350,
+      "dicData": [
+        {
+          "label": "正常审批",
+          "value":"O"
+        },
+        {
+          "label": "非正常审批",
+          "value": "I"
+        }
+      ],
+      "overHidden": true
+    },
+    {
+      "label": "审核路径",
+      "prop": "pathId",
+      "type": "select",
+      "index": 3,
+      "slot": true,
+      "dicUrl": "/api/blade-check/auditpaths/list",
+      "props": {
+        "label": "pathName",
+        "value": "id"
+      },
+      "width": 700,
+      "overHidden": true
+    }
+  ]
+}

+ 152 - 0
src/views/approval/businessApproval/index.vue

@@ -0,0 +1,152 @@
+<template>
+  <basic-container>
+    <avue-crud :option="option"
+               :data="dataList"
+               ref="crud"
+               v-model="form"
+               :page.sync="page"
+               :search.sync="search"
+               :table-loading="loading"
+               @search-change="searchChange"
+               @search-reset="searchReset"
+               @selection-change="selectionChange"
+               @current-change="currentChange"
+               @size-change="sizeChange"
+               @row-update="rowUpdate"
+               @refresh-change="refreshChange"
+               @on-load="onLoad">
+      <template slot-scope="scope" slot="menu">
+        <el-button
+          type="text"
+          size="small"
+          @click.stop="rowCell(scope.row,scope.index)"
+        >{{ scope.row.$cellEdit ? '保存' : '修改' }}
+        </el-button>
+      </template>
+      <template slot="pathId" slot-scope="{row,index}">
+        <el-select v-if="row.$cellEdit"
+                    v-model="row.pathId"
+                    size="small"
+                     placeholder="请选择"
+                     clearable
+                     filterable>
+          <el-option v-for="(item,index) in pathIdDic"
+                     :key="index"
+                     :label="item.pathName"
+                     :value="item.id"
+          ></el-option>
+        </el-select>
+        <span v-else>{{ row.pathName }}</span>
+      </template>
+    </avue-crud>
+  </basic-container>
+</template>
+
+<script>
+  import option from "./config/mainList.json";
+  import { getList,getBusinList,businModify } from "@/api/approval/processConfig";
+
+  export default {
+    data() {
+      return {
+        loading : false,
+        form: {},
+        search:{},
+        show:true,
+        detailData:{},
+        option: option,
+        parentId:0,
+        dataList: [],
+        pathIdDic:[],
+        page: {
+          pageSize: 10,
+          pagerCount: 5,
+          total: 0,
+        },
+        query:{},
+      }
+    },
+    created() {
+      getList().then(res =>{
+        this.pathIdDic  = res.data.data.records
+      })
+    },
+    mounted() {
+
+    },
+
+    methods: {
+      //新单打开
+      addReceipt(row){
+
+      },
+      //编辑打开
+      editOpen(row, status){
+
+      },
+      rowDel(row, index, done) {
+
+      },
+      rowUpdate(row, index, done) {
+        done(row);
+      },
+      rowCell(row, index) {
+        if(row.$cellEdit){
+          let data = []
+          data.push(row)
+          businModify(data).then(res =>{
+            if(res.data.success){
+              this.$message.success("保存成功!")
+              this.onLoad(this.page, this.search);
+            }
+          })
+        }
+        this.$refs.crud.rowCell(row, index)
+      },
+      //点击搜索按钮触发
+      searchChange(params, done) {
+        this.query = params;
+        this.page.currentPage = 1;
+        this.onLoad(this.page, params);
+        done()
+      },
+      searchReset() {
+        console.log('1')
+      },
+      selectionChange() {
+        console.log('1')
+      },
+      currentChange() {
+        console.log('1')
+      },
+      sizeChange() {
+        console.log('1')
+      },
+      refreshChange() {
+        this.onLoad(this.page, this.search);
+      },
+      onLoad(page, params = {}) {
+        this.loading = true;
+        params = {
+          ...params,
+          current: page.currentPage,
+          size: page.pageSize,
+        }
+        getBusinList(params).then(res=>{
+          this.dataList = res.data.data.records
+          this.page.total = res.data.data.total
+        }).finally(()=>{
+          this.loading = false;
+        })
+      },
+      goBack() {
+        this.detailData=this.$options.data().detailData
+        this.show = true;
+      }
+    }
+  }
+</script>
+
+<style scoped>
+
+</style>

+ 1 - 0
src/views/approval/processConfig/config/mainList.json

@@ -12,6 +12,7 @@
   "showSummary": true,
   "searchIcon": true,
   "searchIndex": 2,
+  "searchLabelWidth": 120,
   "searchSpan": 8,
   "searchMenuPosition": "right",
   "column": [

+ 35 - 17
src/views/approval/processConfig/index.vue

@@ -130,13 +130,20 @@
           </el-select>
         </template>
         <template slot="auditUserId" slot-scope="{row,index}">
-          <el-select
+          <el-input
             v-model="row.auditUserId"
-            filterable
-            multiple
-            collapse-tags
-            placeholder="审核人"
-          ></el-select>
+          >
+          </el-input>
+<!--          <el-select-->
+<!--            v-model="row.auditUserId"-->
+<!--            filterable-->
+<!--            multiple-->
+<!--            collapse-tags-->
+<!--            placeholder="审核人"-->
+<!--          >-->
+<!--            <el-option>-->
+<!--            </el-option>-->
+<!--          </el-select>-->
         </template>
         <template slot="menuLeft">
           <el-button
@@ -236,9 +243,7 @@ export default {
     },
     // 编辑
     editOpen(row) {
-      console.log(row)
       detailData({id: row.id}).then(res => {
-        console.log(res)
         this.dataForm = res.data.data
         this.detailData = res.data.data.auditPathsLevels
       })
@@ -251,15 +256,17 @@ export default {
         cancelButtonText: "取消",
         type: "warning"
       }).then(() => {
-        return removeList(row.id);
-      }).then(() => {
-        this.$message({
-          type: "success",
-          message: "操作成功!"
-        });
-        this.page.currentPage = 1;
-        this.onLoad(this.page);
-      });
+        removeList(row.id).then(res =>{
+          if(res.data.success){
+            this.$message({
+              type: "success",
+              message: "操作成功!"
+            });
+            this.page.currentPage = 1;
+            this.onLoad(this.page);
+          }
+        })
+      })
     },
     //点击搜索按钮触发
     searchChange(params, done) {
@@ -317,6 +324,17 @@ export default {
           }
         }
       };
+      const params ={
+        ...this.dataForm,
+        auditPathsLevels : this.detailData
+      }
+      modify(params).then(res =>{
+        if(res.data.success){
+          this.$message.success("操作成功!")
+          this.visible = false
+          this.refreshChange()
+        }
+      })
     },
   },
 }

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

@@ -16,7 +16,7 @@
   "index": false,
   "refreshBtn": false,
   "selection": true,
-  "menuWidth": 300,
+  "menuWidth": 130,
   "dialogClickModal": false,
   "showSummary": true,
   "sumText": "合计",

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

@@ -11,7 +11,7 @@
   "border": true,
   "index": true,
   "selection": true,
-  "menuWidth": 300,
+  "menuWidth": 130,
   "dialogClickModal": false,
   "addBtn":false,
   "editBtn":false,

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

@@ -16,7 +16,7 @@
   "border": true,
   "index": false,
   "selection": true,
-  "menuWidth": 300,
+  "menuWidth": 130,
   "dialogClickModal": false,
   "showSummary": true,
   "summaryText": "合计",

+ 20 - 9
src/views/businessManagement/deliveryNotice/detailsPageEdit.vue

@@ -1245,8 +1245,7 @@ export default {
       this.removeRepeat()
     },
     //修改提交触发
-    editCustomer(isBack = false) {
-      console.log(this.form)
+    editCustomer(isBack = false, type) {
       this.$refs["form"].validate((valid) => {
         if (valid) {
           //商品信息
@@ -1267,6 +1266,23 @@ export default {
             } else {
               this.queryData(res.data.data.id)
             }
+            if (type == '发货') {
+              this.$nextTick(() => {
+                this.form.deliveryItemsList = this.contactsData
+                this.form.deliveryFeesList = this.advantageProjectData
+                this.form.deliveryFilesList = this.bankOfDepositData
+                if (typeof this.form.corpsTypeId == 'object') {
+                  this.form.corpsTypeId = this.form.corpsTypeId.join(",")
+                }
+                this.pageLoading = true
+                sendOutGoods(this.form).then(res => {
+                  this.$message.success('发货成功')
+                  this.queryData(res.data.data.id)
+                }).finally(() => {
+                  this.pageLoading = false
+                })
+              })
+            }
           }).catch(() => {
             this.saveLoading = false
           })
@@ -1306,11 +1322,6 @@ export default {
           if (this.contactsData.length == 0) {
             return this.$message.error('商品信息为空')
           }
-          // for (let item in this.contactsData) {
-          //   if (!this.contactsData[item].id) {
-          //     return this.$message.error('有商品未保存,请先保存')
-          //   }
-          // }
           if (contrastObj(this.form, this.oldForm) ||
             contrastList(this.contactsData, this.oldGoodsList) ||
             contrastList(this.advantageProjectData, this.oldFeesList) ||
@@ -1320,8 +1331,8 @@ export default {
               confirmButtonText: "确定",
               cancelButtonText: "取消",
               type: "warning"
-            }).then(() => {
-              this.editCustomer(false)
+            }).then(async () => {
+              await this.editCustomer(false, '发货')
             }).catch(() => {
               this.$message.info('已取消')
             })

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

@@ -16,7 +16,7 @@
   "index": false,
   "refreshBtn": false,
   "selection": true,
-  "menuWidth": 300,
+  "menuWidth": 130,
   "dialogClickModal": false,
   "showSummary": true,
   "sumText": "合计",

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

@@ -11,7 +11,7 @@
   "border": true,
   "index": true,
   "selection": true,
-  "menuWidth": 300,
+  "menuWidth": 130,
   "dialogClickModal": false,
   "addBtn":false,
   "editBtn":false,

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

@@ -16,7 +16,7 @@
   "border": true,
   "index": false,
   "selection": true,
-  "menuWidth": 300,
+  "menuWidth": 130,
   "dialogClickModal": false,
   "showSummary": true,
   "summaryText": "合计",

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

@@ -20,8 +20,8 @@
   "searchSpan": 8,
   "column": [
     {
-      "label": "销售订单号",
-      "prop": "orgOrderNo",
+      "label": "采购订单号",
+      "prop": "orderNo",
       "search": true,
       "index": 1,
       "width": 100,
@@ -135,7 +135,7 @@
     },
     {
       "label": "来源单号",
-      "prop": "srcOrderNo",
+      "prop": "orgOrderNo",
       "search": false,
       "index": 13,
       "width": 100,

+ 42 - 30
src/views/businessManagement/purchaseOrder/detailsPageEdit.vue

@@ -19,10 +19,15 @@
           class="el-button--small-yh"
           :disabled="detailData.seeDisabled || !this.form.id"
           type="warning"
-          @click="applyPayment"
+          @click="applyPayment('申请')"
         >
           申请货款
         </el-button>
+        <el-button type="warning"
+                   size="small"
+                   class="el-button--small-yh "
+                   @click.stop="applyPayment('收费')">退款
+        </el-button>
         <el-button
           size="small"
           class="el-button--small-yh"
@@ -30,6 +35,8 @@
           @click="copyOrder"
           :disabled="detailData.seeDisabled || !this.form.id"
         >
+
+
           复制新单
         </el-button>
         <el-button
@@ -543,7 +550,7 @@ export default {
             ]
           }, {
             label: '来源单号',
-            prop: 'srcOrderNo',
+            prop: 'orgOrderNo',
             rules: [
               {
                 required: false,
@@ -603,7 +610,7 @@ export default {
               }
             ]
           }, {
-            label: '运费',
+            label: '预估运费',
             prop: 'oceanFreight',
             type: 'number',
             rules: [
@@ -626,7 +633,8 @@ export default {
             ]
           }, {
             label: '已付金额',
-            prop: 'a',
+            prop: 'settlmentAmount',
+            type: 'number',
             rules: [
               {
                 required: false,
@@ -822,7 +830,6 @@ export default {
       }, [])
     },
     getShipmentC() {
-      console.log(this.$store.getters.domTakeStatus)
       if (this.$store.getters.domTakeStatus) {
         this.$alert("收货单存在,请保存发货单再进行操作", "温馨提示", {
           confirmButtonText: "确定",
@@ -847,31 +854,15 @@ export default {
           confirmButtonText: "确定",
           cancelButtonText: "取消",
           type: "warning"
-        }).then(() => {
-          this.editCustomer(false)
+        }).then(async () => {
+          await this.editCustomer(false, '收货')
         }).catch(() => {
           this.$message({
             type: 'info',
             message: '已取消'
           });
-          // this.selection.forEach(item => {
-          //   lsit.push(item.id)
-          // })
-          // // lsit.push(this.selection[item].id)
-          // let data = {
-          //   id: this.form.id,
-          //   orderItemIds: lsit
-          // }
-          // generateShipment(data).then(res => {
-          //   this.$router.$avueRouter.closeTag("/businessManagement/receipt/index");
-          //   this.$router.push({
-          //     path: "/businessManagement/receipt/index",
-          //     query: {form: JSON.stringify(res.data.data)},
-          //   });
-          // })
         })
       } else {
-        // lsit.push(this.selection[item].id)
         this.selection.forEach(item => {
           lsit.push(item.id)
         })
@@ -1231,8 +1222,7 @@ export default {
       this.removeRepeat()
     },
     //修改提交触发
-    editCustomer(isBack = false) {
-      console.log(this.form)
+    editCustomer(isBack = false, type) {
       this.$refs["form"].validate((valid) => {
         if (valid) {
           for (let item in this.contactsData) {
@@ -1247,6 +1237,7 @@ export default {
           if (typeof this.form.corpsTypeId == 'object') {
             this.form.corpsTypeId = this.form.corpsTypeId.join(",")
           }
+
           this.saveLoading = true
           this.form.billType = 'CG'
           this.$set(this.form, 'tradeType', 'GN')
@@ -1259,13 +1250,31 @@ export default {
             } else {
               this.queryData(res.data.data)
             }
+            if (type == '收货') {
+              let lsit = []
+              this.selection.forEach(item => {
+                lsit.push(item.id)
+              })
+              let data = {
+                id: this.form.id,
+                orderItemIds: lsit
+              }
+              generateShipment(data).then(res => {
+                this.$router.$avueRouter.closeTag("/businessManagement/receipt/index");
+                this.$router.push({
+                  path: "/businessManagement/receipt/index",
+                  query: {form: JSON.stringify(res.data.data)},
+                });
+              })
+            }
           })
         } else {
           return false;
         }
       });
     },
-    beforeBillData(type){
+    beforeBillData(bool,type){
+      this.billType = type
       //采购明细提单号 list
       this.billData = {
         srcOrderno:this.form.srcOrderNo,
@@ -1273,14 +1282,17 @@ export default {
         corpsName:this.form.corpsName,
         corpId:this.form.corpId,
         srcParentId: this.form.id,
+        currency: 'CNY',
+        exchangeRate: '1',
+        taxRate: '0',
+        accDate: this.form.businesDate,
       }
-      if(type){ //申请货款
+      if(bool){ //申请货款
         this.billData.srcId = -1
       }
-      console.log(this.billData )
     },
     //申请货款
-    applyPayment(){
+    applyPayment(type){
       // if (contrastObj(this.form, this.oldForm) ||
       //   contrastList(this.contactsData, this.oldGoodsList) ||
       //   contrastList(this.advantageProjectData, this.oldFeesList) ||
@@ -1294,7 +1306,7 @@ export default {
       //     this.editCustomer();
       //   })
       // }else{
-        this.beforeBillData(true);
+        this.beforeBillData(true,type);
         this.applyPaymentDialog = true;
       // }
 

+ 78 - 2
src/views/businessManagement/purchaseOrder/index.vue

@@ -21,8 +21,9 @@
                  @tree-load="treeLoad"
                  @saveColumn="saveColumn">
         <template slot="menuLeft" slot-scope="{size}">
-          <el-button type="success" :size="size" @click="copyOrder" :disabled="single">复制新单</el-button>
+          <el-button type="success" :size="size" icon="el-icon-copy-document" @click="copyOrder" :disabled="single">复制新单</el-button>
           <el-button type="info" :size="size" icon="el-icon-printer">报 表</el-button>
+          <el-button type="warning" :size="size" icon="el-icon-thumb" :disabled="multiple" @click="applyPayment">申请货款</el-button>
         </template>
         <template slot-scope="scope" slot="orgOrderNo">
           <span style="color: #409EFF;cursor: pointer" @click.stop="beforeOpenPage(scope.row,scope.index)">{{ scope.row.orgOrderNo }}</span>
@@ -71,6 +72,27 @@
       :detailData="detailData"
       v-else
     ></detail-page>
+
+    <el-dialog
+      title="账单"
+      append-to-body
+      class="el-dialogDeep"
+      :visible.sync="applyPaymentDialog"
+      width="60%"
+      :close-on-click-modal="false"
+      :destroy-on-close="true"
+      :close-on-press-escape="false"
+      v-dialog-drag
+    >
+      <apply-payment
+        v-if="applyPaymentDialog"
+        :billType="billType"
+        :billData="billData"
+        :arrList="applyPaymentList"
+        @choceFun="choceFun"
+      >
+      </apply-payment>
+    </el-dialog>
   </div>
 </template>
 
@@ -79,6 +101,7 @@ import option from "./configuration/mainList.json";
 import {customerList, deleteDetails} from "@/api/basicData/purchaseOrder"
 import detailPage from "./detailsPageEdit";
 import { defaultDate } from "@/util/date";
+import ApplyPayment from "@/components/finance/applyPayment";
 
 export default {
   name: "customerInformation",
@@ -88,7 +111,8 @@ export default {
     }
   },
   components: {
-    detailPage
+    detailPage,
+    ApplyPayment,
   },
   data() {
     return {
@@ -119,6 +143,10 @@ export default {
       selection: [],
       isShow: true,
       detailData: {},
+      billType:"申请",  //账单类型
+      billData:{},     //账单需要数据
+      applyPaymentDialog:false,//生成账单组件
+      applyPaymentList: [],
     }
   },
   async created() {
@@ -257,8 +285,11 @@ export default {
       console.log('1')
     },
     selectionChange(list) {
+      console.log(list)
+      this.selection = []
       this.selection = list;
       this.single = list.length !== 1;
+      this.multiple = list.length == 0
     },
     currentChange() {
       console.log('1')
@@ -300,6 +331,10 @@ export default {
       });
     },
     goBack() {
+      this.selection = []
+      this.applyPaymentList = []
+      this.single = true
+      this.multiple = true
       this.detailData=this.$options.data().detailData
       this.isShow = true;
     },
@@ -320,6 +355,47 @@ export default {
         this.$refs.crud.$refs.dialogColumn.columnBox = false;
       }
     },
+    // 申请货款
+    applyPayment() {
+      this.applyPaymentList = []
+      if (this.selection.length > 1) {
+        for (let item in this.selection) {
+          if (this.selection[0].corpId !== this.selection[item].corpId) {
+            return this.$message.error('批量结算供应商必须一致')
+          }
+        }
+      }
+      let a = []
+      console.log(this.selection)
+      this.selection.forEach(item => {
+        let form = {
+          form: {
+            srcOrderno:item.orderNo,
+            itemType:"采购",
+            corpsName:item.strCorpName,
+            corpId:item.corpId,
+            srcParentId: item.id,
+            currency: 'CNY',
+            exchangeRate: '1',
+            taxRate: '0',
+            accDate: item.businesDate,
+          }
+        }
+        a.push(form)
+      })
+      this.applyPaymentList = [...a]
+      // this.beforeBillData(true);
+      this.applyPaymentDialog = true;
+    },
+    beforeBillData(type) {
+      if(type){ //申请货款
+        // this.billData.srcId = -1
+      }
+    },
+    //关闭账单
+    choceFun(){
+      this.applyPaymentDialog  = false
+    },
   }
 }
 </script>

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

@@ -16,7 +16,7 @@
   "index": false,
   "refreshBtn": false,
   "selection": true,
-  "menuWidth": 300,
+  "menuWidth": 130,
   "dialogClickModal": false,
   "showSummary": true,
   "sumText": "合计",

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

@@ -11,7 +11,7 @@
   "border": true,
   "index": true,
   "selection": true,
-  "menuWidth": 300,
+  "menuWidth": 130,
   "dialogClickModal": false,
   "addBtn":false,
   "editBtn":false,

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

@@ -16,7 +16,7 @@
   "border": true,
   "index": false,
   "selection": true,
-  "menuWidth": 300,
+  "menuWidth": 130,
   "dialogClickModal": false,
   "showSummary": true,
   "summaryText": "合计",

+ 21 - 4
src/views/businessManagement/receipt/detailsPageEdit.vue

@@ -28,7 +28,7 @@
           @click="sendInGoods"
           size="small"
           v-if="form.deliveryStatus == '录入'"
-          :disabled="detailData.seeDisabled"
+          :disabled="detailData.seeDisabled || !this.form.id"
         >确认收货</el-button>
         <el-button
           class="el-button--small-yh"
@@ -1220,8 +1220,8 @@ export default {
               confirmButtonText: "确定",
               cancelButtonText: "取消",
               type: "warning"
-            }).then(() => {
-              this.editCustomer(false)
+            }).then(async () => {
+              await this.editCustomer(false, '收货')
             }).catch(() => {
               this.$message.info('已取消')
             })
@@ -1270,7 +1270,7 @@ export default {
       });
     },
     //修改提交触发
-    editCustomer(isBack = false) {
+    editCustomer(isBack = false, type) {
       this.$refs["form"].validate((valid) => {
         if (valid) {
           this.form.deliveryAmount = 0
@@ -1300,6 +1300,23 @@ export default {
             } else {
               this.queryData(res.data.data.id)
             }
+            if (type == '收货') {
+              this.$nextTick(() => {
+                this.form.deliveryItemsList = this.contactsData
+                this.form.deliveryFeesList = this.advantageProjectData
+                this.form.deliveryFilesList = this.bankOfDepositData
+                if (typeof this.form.corpsTypeId == 'object') {
+                  this.form.corpsTypeId = this.form.corpsTypeId.join(",")
+                }
+                this.pageLoading = true
+                sendInGoods(this.form).then(res => {
+                  this.$message.success('收货成功')
+                  this.queryData(res.data.data.id)
+                }).finally(() => {
+                  this.pageLoading = false
+                })
+              })
+            }
           })
         }
       });

+ 1 - 1
src/views/businessManagement/salesOrder/configuration/advantageProject.json

@@ -16,7 +16,7 @@
   "index": false,
   "refreshBtn": false,
   "selection": true,
-  "menuWidth": 300,
+  "menuWidth": 130,
   "dialogClickModal": false,
   "showSummary": true,
   "sumText": "合计",

+ 1 - 1
src/views/businessManagement/salesOrder/configuration/bankOfDeposit.json

@@ -11,7 +11,7 @@
   "border": true,
   "index": true,
   "selection": true,
-  "menuWidth": 300,
+  "menuWidth": 130,
   "dialogClickModal": false,
   "addBtn":false,
   "editBtn":false,

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

@@ -16,7 +16,7 @@
   "border": true,
   "index": false,
   "selection": true,
-  "menuWidth": 300,
+  "menuWidth": 130,
   "dialogClickModal": false,
   "showSummary": true,
   "summaryText": "合计",

+ 3 - 1
src/views/businessManagement/salesOrder/configuration/mainList.json

@@ -20,6 +20,8 @@
   "searchIcon": true,
   "searchIndex": 2,
   "searchSpan": 8,
+  "expand": true,
+  "expandWidth": 38,
   "summaryText": "合计",
   "sumColumnList": [
     {
@@ -38,7 +40,7 @@
   "column": [
     {
       "label": "销售订单号",
-      "prop": "orgOrderNo",
+      "prop": "orderNo",
       "search": true,
       "index": 1,
       "width": 100,

+ 89 - 55
src/views/businessManagement/salesOrder/detailsPageEdit.vue

@@ -19,10 +19,17 @@
           type="warning"
           :disabled="detailData.seeDisabled"
           size="small"
-          @click="applySettlement"
+          @click="applySettlement('收费')"
         >生成账单</el-button>
         <el-button
           class="el-button--small-yh"
+          type="warning"
+          :disabled="detailData.seeDisabled"
+          size="small"
+          @click="applySettlement('申请')"
+        >退款</el-button>
+        <el-button
+          class="el-button--small-yh"
           type="primary"
           :disabled="detailData.seeDisabled"
           size="small"
@@ -617,7 +624,7 @@ export default {
       saveLoading: false,
       disabled: false,
       form: {},
-      billType:"销售",  //账单类型
+      billType:"收费",  //账单类型
       billData:{},     //账单需要数据
       applySettlementDialog:false,//生成账单组件
       configuration: {
@@ -1111,14 +1118,14 @@ export default {
             prop: 'packageRemarks',
             rules: [
               {
-                required: true,
+                required: false,
                 message: ' ',
                 trigger: 'blur'
               }
             ]
           }, {
             label: '销售订单号',
-            prop: 'orgOrderNo',
+            prop: 'orderNo',
             disabled: true,
             rules: [
               {
@@ -1383,21 +1390,10 @@ export default {
           confirmButtonText: "确定",
           cancelButtonText: "取消",
           type: "warning"
-        }).then(() => {
-          this.editCustomer(false)
+        }).then(async () => {
+          await this.editCustomer(false, '采购')
         }).catch(() => {
           this.$message.info('已取消')
-          // this.$confirm("是否生成采购单?", {
-          //   confirmButtonText: "确定",
-          //   cancelButtonText: "取消",
-          //   type: "warning"
-          // }).then(() => {
-          //   saveSell(this.form.id).then(res => {
-          //     if (res.data.code == 200) {
-          //       this.$message.success("生成成功");
-          //     }
-          //   });
-          // });
         })
       } else {
         this.$confirm("是否生成采购单?", {
@@ -1478,6 +1474,20 @@ export default {
       this.pageLoading = false
       let goodsData = []
       res.data.forEach(item => {
+        getMarketPrice({code: item.code}).then(res => {
+          if (res.data.data.length > 0) {
+            this.$set(item, 'price', res.data.data[0].salesPrice)
+          } else {
+            this.$set(item, 'price', '0')
+          }
+        })
+        getPurchasePrice({code: item.code}).then(res => {
+          if (res.data.data.length > 0) {
+            this.$set(item, 'purchaseAmount', res.data.data[0].purchasePrice)
+          } else {
+            this.$set(item, 'purchaseAmount', '0')
+          }
+        })
         this.$set(item, 'priceType', '一般')
         this.$set(item, 'actualQuantity', '0')
         this.$set(item, 'purchaseAmount', '0')
@@ -1522,7 +1532,7 @@ export default {
       }
     },
     //生成发货单
-    generateShipmentD() {
+    async generateShipmentD() {
       let lsit = []
       if (contrastObj(this.form, this.oldForm) ||
         contrastList(this.contactsData, this.oldGoodsList) ||
@@ -1534,29 +1544,14 @@ export default {
           cancelButtonText: "取消",
           type: "warning"
         }).then(() => {
-          this.editCustomer(false)
+          this.editCustomer(false, '发货')
         }).catch(() => {
           this.$message({
             type: 'info',
             message: '已取消'
           });
-          // this.selection.forEach(item => {
-          //   lsit.push(item.id)
-          // })
-          // let data = {
-          //   id: this.form.id,
-          //   orderItemIds: lsit
-          // }
-          // generateShipment(data).then(res => {
-          //   this.$router.$avueRouter.closeTag("/businessManagement/deliveryNotice/index");
-          //   this.$router.push({
-          //     path: "/businessManagement/deliveryNotice/index",
-          //     query: {form: JSON.stringify(res.data.data)},
-          //   });
-          // })
         })
       } else {
-        // lsit.push(this.selection[item].id)
         this.selection.forEach(item => {
           lsit.push(item.id)
         })
@@ -1574,7 +1569,7 @@ export default {
       }
     },
     // 生成结算
-    applySettlement() {
+    applySettlement(type) {
       if (contrastObj(this.form, this.oldForm) ||
         contrastList(this.contactsData, this.oldGoodsList) ||
         contrastList(this.advantageProjectData, this.oldFeesList) ||
@@ -1589,20 +1584,25 @@ export default {
         }).catch(() => {
         })
       } else {
-        this.beforeBillData(true)
+        this.beforeBillData(true,type)
         this.applySettlementDialog = true;
       }
     },
     //生成账单 拿到主表信息
-    beforeBillData(type){
+    beforeBillData(bool,type){
+      this.billType = type
       this.billData = {
         srcOrderno:this.form.orgOrderNo,
         itemType:"销售",
         corpsName:this.form.corpName,
         corpId:this.form.corpId,
         srcParentId: this.form.id,
+        currency: 'CNY',
+        exchangeRate: '1',
+        taxRate: '0',
+        accDate: this.form.businesDate,
       }
-      if(type){ //申请货款
+      if(bool){ //申请货款
         this.billData.srcId = -1
       }
     },
@@ -1738,7 +1738,20 @@ export default {
             this.$set(this.tableData[item], 'orderQuantity', 0)
             this.$set(this.tableData[item], 'actualQuantity', 0)
             this.$set(this.tableData[item], 'purchaseAmount', '0')
-            this.tableData[item].price = '0'
+            getMarketPrice({code: this.tableData[item].code}).then(res => {
+              if (res.data.data.length > 0) {
+                this.$set(this.tableData[item], 'price', res.data.data[0].salesPrice)
+              } else {
+                this.$set(this.tableData[item], 'price', '0')
+              }
+            })
+            getPurchasePrice({code: this.tableData[item].code}).then(res => {
+              if (res.data.data.length > 0) {
+                this.$set(this.tableData[item], 'purchaseAmount', res.data.data[0].purchasePrice)
+              } else {
+                this.$set(this.tableData[item], 'purchaseAmount', '0')
+              }
+            })
             this.tableData[item].amount = 0
             this.tableData[item].sort = this.maxGoodsNum + 1
             delete this.tableData[item].id
@@ -2073,7 +2086,7 @@ export default {
       done();
     },
     //修改提交触发
-    editCustomer(isBack = false) {
+    editCustomer(isBack = false, type) {
       this.$refs["form"].validate((valid) => {
         if (valid) {
           for (let item in this.contactsData) {
@@ -2081,8 +2094,14 @@ export default {
               return this.$message.error('商品信息第'+ (parseInt(item) + 1) + '行订货数量不能小于发货数量')
             }
           }
+          let packFee;
+          if (this.form.packageRemarks) {
+            packFee = this.advantageProjectData.findIndex(item => item.feeName == '包装费')
+          }
+          if (packFee == -1) {
+            return this.$message.error('费用明细未有包装费')
+          }
           // 计算毛利额
-          // this.$set(this.form, 'grossProfit', 0)
           this.$set(this.form, 'orderAmount', 0)
           // 成本价
           let purchaseAmount = 0
@@ -2091,25 +2110,11 @@ export default {
             if (item.purchaseAmount) {
               purchaseAmount += (Number(item.purchaseAmount) * Number(item.orderQuantity)).toFixed(2)
             }
-            // this.form.grossProfit += Number(item.amount)
             this.form.orderAmount = (Number(this.form.orderAmount) + Number(item.amount)).toFixed(2)
           })
-          // this.form.grossProfit = (Number(this.form.orderAmount) - Number(purchaseAmount)).toFixed(2)
-          // if (this.form.orderAmount && this.form.overPayment) {
-          //   this.form.debitAmount = Number(this.form.orderAmount) - Number(this.form.overPayment)
-          // }
           if (this.form.orderAmount && this.form.settlmentAmount) {
             this.$set(this.form, "balanceAmount", (Number(this.form.orderAmount) - Number(this.form.settlmentAmount)).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
@@ -2127,6 +2132,35 @@ export default {
             } else {
               this.queryData(res.data.data.id)
             }
+            if (type == '发货') {
+              let lsit = []
+              this.selection.forEach(item => {
+                lsit.push(item.id)
+              })
+              let data = {
+                id: this.form.id,
+                orderItemIds: lsit
+              }
+              generateShipment(data).then(res => {
+                this.$router.$avueRouter.closeTag("/businessManagement/deliveryNotice/index");
+                this.$router.push({
+                  path: "/businessManagement/deliveryNotice/index",
+                  query: {form: JSON.stringify(res.data.data)},
+                });
+              })
+            } else if (type == '采购') {
+              this.$confirm("是否生成采购单?", {
+                confirmButtonText: "确定",
+                cancelButtonText: "取消",
+                type: "warning"
+              }).then(() => {
+                saveSell(this.form.id).then(res => {
+                  if (res.data.code == 200) {
+                    this.$message.success("生成成功");
+                  }
+                });
+              });
+            }
           }).finally(() => {
             this.saveLoading = false
           })

+ 46 - 5
src/views/businessManagement/salesOrder/index.vue

@@ -24,8 +24,25 @@
                  @tree-load="treeLoad"
                  :cell-style="tableRowClassName"
                  :table-loading="loading"
+                 @expand-change="expandChange"
       >
-        <template slot-scope="scope" slot="orgOrderNo">
+        <template slot-scope="scope" slot="expand">
+          <el-table :data="scope.row.insideList" v-loading="scope.row.loading">
+            <el-table-column  label="产品分类" prop="priceCategory" align="center" show-overflow-tooltip width="200"></el-table-column>
+            <el-table-column  label="价格类别" prop="priceType" align="center" show-overflow-tooltip width="180"></el-table-column>
+            <el-table-column  label="商品名称" prop="cname" align="center" show-overflow-tooltip width="120"></el-table-column>
+            <el-table-column  label="编码" prop="code" align="center" show-overflow-tooltip width="120"></el-table-column>
+            <el-table-column  label="规格型号" prop="typeno" align="center" show-overflow-tooltip width="120"></el-table-column>
+            <el-table-column  label="供应商" prop="corpId" align="center" show-overflow-tooltip width="120"></el-table-column>
+            <el-table-column  label="订货数量" prop="orderQuantity" align="center" show-overflow-tooltip width="180"></el-table-column>
+            <el-table-column  label="发货数量" prop="actualQuantity" align="center" show-overflow-tooltip width="200"></el-table-column>
+            <el-table-column  label="库存" prop="storageQuantity" align="center" show-overflow-tooltip width="200"></el-table-column>
+            <el-table-column  label="采购价格" prop="purchaseAmount" align="center" show-overflow-tooltip width="200"></el-table-column>
+            <el-table-column  label="最新单价" prop="price" align="center" show-overflow-tooltip width="200"></el-table-column>
+            <el-table-column  label="金额" prop="amount" align="center" show-overflow-tooltip width="200"></el-table-column>
+          </el-table>
+        </template>
+        <template slot-scope="scope" slot="orderNo">
           <span style="color: #409EFF;cursor: pointer" @click.stop="beforeOpenPage(scope.row,scope.index)">{{ scope.row.orgOrderNo }}</span>
         </template>
         <template slot="corpIdSearch">
@@ -169,9 +186,9 @@ export default {
   },
   methods: {
     tableRowClassName({row, column, rowIndex, columnIndex}) {
-      if (row.orderStatus == '录入' && columnIndex == 21){
+      if (row.orderStatus == '录入' && columnIndex == 19){
         return {
-          background: '#eceb3c'
+          background: '#eceb3c',
         }
       } else if (row.orderStatus == '成交') {
         return 'success-row'
@@ -306,8 +323,8 @@ export default {
         this.$delete(params,'requiredDeliveryDate')
       }
       if (params.requiredArrivalDate) {
-        params.arrivalStartDate = params.requiredArrivalDate[0]+ " " + "00:00:00"
-        params.arrivalEndDate = params.requiredArrivalDate[1]+ " " + "23:59:59"
+        params.arrivalDateStart = params.requiredArrivalDate[0]+ " " + "00:00:00"
+        params.arrivalDateEnd = params.requiredArrivalDate[1]+ " " + "23:59:59"
         this.$delete(params,'requiredArrivalDate')
       }
       if (params.actualDeliveryDate) {
@@ -342,9 +359,22 @@ export default {
       this.page.currentPage = 1;
       this.onLoad(this.page,this.search);
     },
+    // 表格展开触发
+    expandChange(row, index) {
+      if (row.loading) {
+        setTimeout(() => {
+          row.loading = false
+        }, 2000)
+      }
+    },
     onLoad(page, params) {
       if (this.search.businesDate && this.search.businesDate.length > 0) {
+        // delete this.search.createTime
+        // delete this.search.actualDeliveryDate
+        // delete this.search.requiredDeliveryDate
+        // delete this.search.requiredArrivalDate
         params = {
+          // ...this.search,
           ...params,
           orderStartDate: this.search.businesDate[0]+ " " + "00:00:00",
           orderEndDate: this.search.businesDate[1]+ " " + "23:59:59",
@@ -360,6 +390,10 @@ export default {
       this.loading = true;
       customerList(queryParams).then(res => {
         this.dataList = res.data.data.records
+        this.dataList.forEach(item => {
+          this.$set(item,'insideList',[])
+          this.$set(item,'loading', true)
+        })
         this.page.total = res.data.data.total
       }).finally(() => {
         this.loading = false;
@@ -375,10 +409,17 @@ export default {
     goBack() {
       this.detailData=this.$options.data().detailData
       this.isShow = true;
+      // this.searchChange(this.search)
     },
   }
 }
 </script>
 
 <style scoped>
+/deep/ .el-table__expanded-cell .el-table__header-wrapper .cell {
+  font-size: 8px !important;
+}
+/deep/ .el-table__body-wrapper .cell {
+  font-size: 8px;
+}
 </style>

+ 3 - 0
src/views/financialManagement/paymentRequest/configuration/detailsPage.json

@@ -59,6 +59,7 @@
     {
       "label": "数量",
       "prop": "quantity",
+      "hide": true,
       "index": 4,
       "width":120,
       "overHidden": true
@@ -73,6 +74,7 @@
     {
       "label": "金额",
       "prop": "amount",
+      "cell": true,
       "index": 6,
       "width":120,
       "overHidden": true
@@ -87,6 +89,7 @@
     {
       "label": "汇率",
       "prop": "exchangeRate",
+      "cell": true,
       "index": 8,
       "width":120,
       "overHidden": true

+ 9 - 33
src/views/financialManagement/paymentRequest/paymentRequestDetails.vue

@@ -24,7 +24,6 @@
                      size="small"
                      :loading="buttonLoading"
                      class="el-button--small-yh"
-                     :disabled="checkDisabled"
                      @click.stop="confirmEdit">确认修改
           </el-button>
         </div>
@@ -96,17 +95,6 @@
             </breakdown-select>
             <span v-else>{{ row.itemName }}</span>
           </template>
-          <template slot="quantity" slot-scope="{ row }">
-            <el-input
-              v-if="row.$cellEdit"
-              v-model="row.quantity"
-              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.quantity }}</span>
-          </template>
           <template slot="price" slot-scope="{ row }">
             <el-input
               v-if="row.$cellEdit"
@@ -114,7 +102,6 @@
               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>
@@ -288,7 +275,7 @@
               label: '备注',
               prop: 'remark',
               span:24,
-              row:2,
+              minRows: 2,
               rules: [
                 {
                   required: false,
@@ -330,22 +317,6 @@
       }
     },
     methods: {
-      priceChange(row){
-        if (!row.price) {
-          row.price = "";
-          row.amount = 0
-        } else {
-          row.amount = _.multiply(row.quantity, row.price).toFixed(2);
-        }
-      },
-      quantityChange(row){
-        if (!row.quantity) {
-          row.quantity = "";
-          row.amount = 0
-        } else {
-          row.amount = _.multiply(row.quantity, row.price).toFixed(2);
-        }
-      },
       //选择客户
       returnBack(corpValue){
         getlistBankBy(corpValue).then(res =>{
@@ -367,10 +338,12 @@
       },
       //选择币别 带汇率
       currencyChange(row){
-        if(row.currency === "USD"){
-            row.exchangeRate = 6.384300
+        if(row.currency === "CNY"){
+            row.exchangeRate = 1
+        }else if(row.currency === "USD"){
+          row.exchangeRate = 6.384300
         }else{
-          row.exchangeRate = 1
+          row.exchangeRate = 7.174900
         }
       },
       rowUpdate(row, index, done, loading) {
@@ -490,6 +463,9 @@
         this.checkDisabled = data.checkStatus === "未请核"?false:true;
         this.$set(this.option,"disabled",this.checkDisabled)
 
+        // const column = this.findObject(this.option.column, "remark");
+        // column.disabled = false;
+
         if(data.itemsList){
           this.dataList = data.itemsList
           this.oldDataList = this.deepClone(data.itemsList)

+ 6 - 2
src/views/financialManagement/paymentSettle/configuration/detailsPage.json

@@ -17,7 +17,7 @@
   "border": true,
   "index": true,
   "selection": false,
-  "menuWidth": 180,
+  "menuWidth": 220,
   "dialogClickModal": false,
   "showSummary": true,
   "summaryText": "合计",
@@ -25,6 +25,10 @@
     {
       "name": "amount",
       "type": "sum"
+    },
+    {
+      "name": "thisAmount",
+      "type": "sum"
     }
   ],
   "column": [
@@ -46,7 +50,7 @@
       "label": "费用名称",
       "prop": "itemName",
       "overHidden": true,
-      "width": 150,
+      "width": 200,
       "index": 4
     },
     {

+ 26 - 9
src/views/financialManagement/paymentSettle/paymentSettleDetailsPage.vue

@@ -8,11 +8,14 @@
         <div class="upper_right_button">
           <el-button type="warning"
                      class="el-button--small-yh"
+                     size="small"
+                     :disabled="!form.id"
                      @click.stop="confirmSettlement"
           >付费
           </el-button>
           <el-button class="el-button--small-yh"
                      type="primary"
+                     size="small"
                      @click.stop="saveSettlement"
           >{{form.id?"确认修改" :"确认新增"}}
           </el-button>
@@ -25,6 +28,7 @@
         <avue-form class="trading-form" ref="form" v-model="form" :option="option">
           <template slot="corpId">
             <select-component
+              :disabled="financeDisabled"
               v-model="form.corpId"
               @returnBack="returnBack"
               :configuration="configuration"
@@ -33,6 +37,7 @@
           <template slot="accountNo">
             <el-select v-model="form.accountNo"
                        placeholder="请选择"
+                       :disabled="financeDisabled"
                        @change="accountNoChange"
                        clearable
                        filterable>
@@ -246,7 +251,8 @@
                   trigger: 'blur'
                 }
               ]
-            }, {
+            },
+            {
               label: '制单日期',
               prop: 'createTime',
               span: 8,
@@ -261,10 +267,23 @@
               ]
             },
             {
+              label: '付款日期',
+              prop: 'time',
+              span: 8,
+              type:"date",
+              rules: [
+                {
+                  required: false,
+                  message: ' ',
+                  trigger: 'blur'
+                }
+              ]
+            },
+            {
               label: '备注',
               prop: 'remark',
               span:24,
-              row:2,
+              minRows: 2,
               rules: [
                 {
                   required: false,
@@ -328,7 +347,7 @@
 
     },
     mounted() {
-      option.height = window.innerHeight - 640 ;
+
     },
     methods: {
       //选择客户
@@ -384,7 +403,7 @@
 
         this.billDetailDialog = false;
       },
-      rowUpdate(row, index, done, loading) {
+      rowUpdate(row, index, done) {
         done(row);
       },
       rowCell(row,index){
@@ -448,7 +467,6 @@
       saveSettlement(){
         this.$refs["form"].validate((valid,done) => {
           if(valid){
-            console.log(132)
             this.form.billNo = this.dataList.map(item =>{return item.billNo}).join(",")
 
             const params = {
@@ -468,8 +486,7 @@
         this.form = data;
         this.oldForm = Object.assign({},data);
 
-        this.financeDisabled = data.financeStatus === "待结算"?false:true;
-        console.log(this.financeDisabled )
+        this.financeDisabled = data.financeStatus == ("待结算" || "结算完成")?true:false;
         this.$set(this.option,"disabled",this.financeDisabled)
 
         if(data.itemsList){
@@ -509,7 +526,7 @@
   .upper_right_button{
     display: flex;
     position: fixed;
-    right: 20px;
-    top: 43px;
+    right: 12px;
+    top: 47px;
   }
 </style>

+ 17 - 4
src/views/financialManagement/receiptSettle/receiptSettleDetailsPage.vue

@@ -9,7 +9,7 @@
           <el-button type="warning"
                      size="small"
                      class="el-button--small-yh"
-                     :disabled="financeDisabled"
+                     :disabled="financeDisabled || form.id"
                      @click.stop="confirmSettlement"
           >收费
           </el-button>
@@ -259,6 +259,19 @@
               ]
             },
             {
+              label: '收款日期',
+              prop: 'time',
+              span: 8,
+              type:"date",
+              rules: [
+                {
+                  required: false,
+                  message: ' ',
+                  trigger: 'blur'
+                }
+              ]
+            },
+            {
               label: '备注',
               prop: 'remark',
               span:24,
@@ -333,7 +346,7 @@
       // }
     },
     mounted() {
-      option.height = window.innerHeight - 640 ;
+
     },
     methods: {
       //选择客户
@@ -507,7 +520,7 @@
 .upper_right_button{
   display: flex;
   position: fixed;
-  right: 20px;
-  top: 43px;
+  right: 12px;
+  top: 47px;
 }
 </style>

+ 8 - 2
src/views/importTrade/invoice/config/customerContact.json

@@ -67,8 +67,14 @@
       "width":120
     },
     {
-      "label": "库存",
-      "prop": "inventoryNumber",
+      "label": "库存件数",
+      "prop": "inQuantity",
+      "index": 5,
+      "width":120
+    },
+    {
+      "label": "库存重量",
+      "prop": "inWeight",
       "index": 5,
       "width":120
     },

+ 2 - 2
src/views/importTrade/invoice/config/mainList.json

@@ -68,7 +68,7 @@
       "width":150
     },
     {
-      "label": "数",
+      "label": "数",
       "prop": "quantity",
       "overHidden": true,
       "index": 6,
@@ -82,7 +82,7 @@
       "width":100
     },
     {
-      "label": "发票净重",
+      "label": "发票数量",
       "prop": "invoiceWeight",
       "overHidden": true,
       "index": 8,

+ 8 - 6
src/views/importTrade/invoice/detailsPageEdit.vue

@@ -531,10 +531,12 @@ export default {
   methods: {
     //币别选择
     currencyChange(row){
-      if(row.currency === "USD"){
+      if(row.currency == "CNY"){
+        this.$set(row,"exRate",1)
+      }else if(row.currency == "USD"){
         this.$set(row,"exRate",6.3686)
       }else{
-        this.$set(row,"exRate",1)
+        this.$set(row,"exRate",7.1749)
       }
     },
     //货品物种
@@ -729,9 +731,9 @@ export default {
                 this.$message.success("发货成功!")
                 this.goodsDisable = res.data.data.deliveryStatus === "已发货" ? true : false
               }
-            }).finally(() => {
-              this.buttonLoading = false
             })
+          }).finally(() => {
+            this.buttonLoading = false
           })
         } else {
           this.$confirm("是否撤回发货?", {
@@ -746,9 +748,9 @@ export default {
                 this.$message.success("撤销成功!")
                 this.goodsDisable = res.data.data.deliveryStatus === "已发货" ? true : false
               }
-            }).finally(() => {
-              this.buttonLoading = false
             })
+          }).finally(() => {
+            this.buttonLoading = false
           })
         }
       }

+ 8 - 2
src/views/importTrade/receipt/config/customerContact.json

@@ -80,8 +80,14 @@
       "width":120
     },
     {
-      "label": "库存",
-      "prop": "inventoryNumber",
+      "label": "库存件数",
+      "prop": "inQuantity",
+      "index": 5,
+      "width":120
+    },
+    {
+      "label": "库存重量",
+      "prop": "inWeight",
       "index": 5,
       "width":120
     },

+ 2 - 2
src/views/importTrade/receipt/config/mainList.json

@@ -68,7 +68,7 @@
       "width":150
     },
     {
-      "label": "数",
+      "label": "数",
       "prop": "quantity",
       "overHidden": true,
       "index": 6,
@@ -82,7 +82,7 @@
       "width":100
     },
     {
-      "label": "发票重",
+      "label": "发票重",
       "prop": "invoiceWeight",
       "overHidden": true,
       "index": 8,

+ 9 - 10
src/views/importTrade/receipt/detailsPageEdit.vue

@@ -532,10 +532,8 @@ export default {
         this.$set(this.form,'saleman',res.data.data.salesName)
         this.$set(this.form,'corpId',res.data.data.corpsName[0].id)
         this.$set(this.form,'orgOrderNo', res.data.data.orgOrderNo)
-        // this.$set(this.form,'billWeight', res.data.data.orgOrderNo)
-        // this.$set(this.form,'invoiceWeight', res.data.data.orgOrderNo)
         this.$set(this.configuration,'dicData', res.data.data.corpsName)
-
+        this.totalChange();  //调用合计 算出重量
       }).finally(()=>{
         this.buttonLoading = false;
       })
@@ -544,10 +542,12 @@ export default {
   methods: {
     //币别选择
     currencyChange(row){
-      if(row.currency === "USD"){
+      if(row.currency == "CNY"){
+        this.$set(row,"exRate",1)
+      }else if(row.currency == "USD"){
         this.$set(row,"exRate",6.3686)
       }else{
-        this.$set(row,"exRate",1)
+        this.$set(row,"exRate",7.1749)
       }
     },
     //货物名称 回显
@@ -766,9 +766,9 @@ export default {
                 this.$message.success("收货成功!")
                 this.receiptDisable = res.data.data.deliveryStatus === "已收货" ?   true :false
               }
-            }).finally(()=>{
-              this.buttonLoading = false;
             })
+          }).finally(()=>{
+            this.buttonLoading = false;
           })
         }else{
           this.$confirm("是否撤销收货!", {
@@ -777,15 +777,14 @@ export default {
             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
               }
-            }).finally(()=>{
-              this.buttonLoading = false;
             })
+          }).finally(()=>{
+            this.buttonLoading = false;
           })
         }
       }

+ 1 - 1
src/views/purchase/contract/config/customerContact.json

@@ -128,7 +128,7 @@
       "label": "税率",
       "prop": "taxRate",
       "index": 10,
-      "width":120,
+      "width":180,
       "rules": [
         {
           "required": false,

+ 11 - 4
src/views/purchase/contract/config/mainList.json

@@ -80,7 +80,14 @@
       "width":150
     },
     {
-      "label": "数量",
+      "label": "合同金额",
+      "prop": "amount",
+      "overHidden": true,
+      "index": 5,
+      "width":100
+    },
+    {
+      "label": "件数",
       "prop": "orderQuantity",
       "overHidden": true,
       "index": 6,
@@ -94,21 +101,21 @@
       "width":100
     },
     {
-      "label": "发票重",
+      "label": "发票重",
       "prop": "invoiceWeight",
       "overHidden": true,
       "index": 8,
       "width":100
     },
     {
-      "label": "已收数",
+      "label": "已收数",
       "prop": "actualQuantity",
       "overHidden": true,
       "index": 9,
       "width":100
     },
     {
-      "label": "合同金额",
+      "label": "发票金额",
       "prop": "orderAmount",
       "overHidden": true,
       "index": 10,

+ 54 - 48
src/views/purchase/contract/detailsPage.vue

@@ -17,7 +17,7 @@
                    size="small"
                    class="el-button--small-yh "
                    :loading="buttonLoading"
-                   @click.stop="applyPayment()">申请货款
+                   @click.stop="applyPayment('申请')">申请货款
         </el-button>
 <!--        <el-button type="warning"
                    size="small"
@@ -31,6 +31,12 @@
                    @click="openApplicationDialog"
         >查看申请记录
         </el-button>
+        <el-button type="warning"
+                   size="small"
+                   class="el-button--small-yh "
+                   :loading="buttonLoading"
+                   @click.stop="applyPayment('收费')">退款
+        </el-button>
         <el-button type="success"
                    size="small"
                    :loading="buttonLoading"
@@ -66,25 +72,27 @@
                     :value="data.value"
                   ></el-option>
                 </el-select>
-                <el-input type="age" v-else-if="item.prop === 'orderAmount'" v-model="form[item.prop]" :disabled="takeDisabled" size="small" autocomplete="off" @input="currencyChange" placeholder="请输入"></el-input>
-                <selectComponent v-else-if="item.prop === 'corpId'" v-model="form[item.prop]" :disabled="takeDisabled" :configuration="configuration"/>
-                <selectComponent v-else-if="item.prop === 'purchaserId'" v-model="form[item.prop]" :disabled="takeDisabled" :configuration="pConfiguration"/>
-                <selectComponent v-else-if="item.prop === 'belongToCorpId'" v-model="form[item.prop]" :disabled="takeDisabled" :configuration="bConfiguration"/>
-                <el-select v-else-if="item.prop === 'orderType'"  style="width: 100%"  v-model="form[item.prop]" :disabled="takeDisabled" size="small" placeholder="请选择" clearable filterable>
+                <el-input type="age" v-else-if="item.prop === 'orderAmount'" v-model="form[item.prop]" :disabled="item.disabled?true:false || takeDisabled" size="small" autocomplete="off" @input="currencyChange" placeholder="请输入"></el-input>
+                <selectComponent v-else-if="item.prop === 'corpId'" v-model="form[item.prop]" :disabled="item.disabled?true:false || takeDisabled" :configuration="configuration"/>
+                <selectComponent v-else-if="item.prop === 'purchaserId'" v-model="form[item.prop]" :disabled="item.disabled?true:false || takeDisabled" :configuration="pConfiguration"/>
+                <selectComponent v-else-if="item.prop === 'belongToCorpId'" v-model="form[item.prop]" :disabled="item.disabled?true:false || takeDisabled" :configuration="bConfiguration"/>
+                <el-select v-else-if="item.prop === 'orderType'"  style="width: 100%"  v-model="form[item.prop]" :disabled="item.disabled?true:false || takeDisabled" size="small" placeholder="请选择" clearable filterable>
                   <el-option v-for="(item,index) in contractTypeDic" :key="index" :label="item.dictValue" :value="item.dictValue"></el-option>
                 </el-select>
-                <el-select v-else-if="item.prop === 'currency'" style="width: 100%"    v-model="form[item.prop]" size="small" placeholder="请选择" @change="currencyChange" clearable filterable>
+                <el-select v-else-if="item.prop === 'currency'" style="width: 100%"  :disabled="item.disabled?true:false || takeDisabled"  v-model="form[item.prop]" size="small" placeholder="请选择" @change="currencyChange('true')" clearable filterable>
                   <el-option v-for="(item,index) in currencyDic" :key="index" :label="item.dictValue"  :value="item.dictValue"></el-option>
                 </el-select>
-                <el-input type="age" v-else-if="item.type === 'unit'" v-model="form[item.prop]"  :disabled="item.disabled?true:false" size="small" autocomplete="off"  @change="currencyChange" placeholder="请输入">
-                  <template   slot="append">%</template>
-                </el-input>
                 <el-select v-else-if="item.prop === 'paymentType'"  style="width: 100%"  v-model="form[item.prop]" size="small" placeholder="请选择" clearable filterable>
                   <el-option v-for="(item,index) in paymentTypeDic" :key="index" :label="item.dictValue" :value="item.dictValue"></el-option>
                 </el-select>
-                <!--<div v-else-if="item.prop === 'advancePayment'">
-                  <el-input type="textarea" v-else-if="(item.prop === 'advancePayment')" v-model="form[item.prop]"   size="small" autocomplete="off" placeholder="请输入"></el-input>
-                </div>-->
+                <div v-else-if="item.prop === 'advancePayment'">
+                  <el-input type="age" v-model="form[item.prop]" style="width: 70%" :disabled="item.disabled?true:false || takeDisabled"  size="small" autocomplete="off" placeholder="请输入"></el-input>
+                  <el-select v-model="form['prepayCurrency']" size="small" style="width: 30%"  :disabled="item.disabled?true:false || takeDisabled" value="USD"   placeholder="请选择" clearable filterable>
+                    <el-option v-for="(item,index) in currencyDic" :key="index" :label="item.dictValue"  :value="item.dictValue"></el-option>
+                  </el-select>
+                </div>
+                <el-input type="age" v-else-if="item.prop === 'exchangeRate'" v-model="form[item.prop]"  :disabled="item.disabled?true:false || takeDisabled" size="small" autocomplete="off"  @change="currencyChange" placeholder="请输入">
+                </el-input>
                 <el-input type="textarea" v-else-if="(item.prop === 'orderRemark')" v-model="form[item.prop]"   size="small" autocomplete="off" placeholder="请输入"></el-input>
                 <el-input type="age" v-else v-model="form[item.prop]" :disabled="item.disabled?true:false || takeDisabled" size="small" autocomplete="off" placeholder="请输入"></el-input>
               </el-form-item>
@@ -210,8 +218,8 @@
                         size="small"
                         autocomplete="off"
                         placeholder="请输入">
-                <template slot="append"
-                >%</template>
+<!--                <template slot="append"
+                >%</template>-->
               </el-input>
               <span v-else>{{ row.taxRate }}</span>
             </template>
@@ -272,11 +280,11 @@
       :close-on-press-escape="false"
       v-dialog-drag
     >
-      <bill-application
+<!--      <bill-application
         :billType="billType"
         @choceApplication="choceApplication"
       >
-      </bill-application>
+      </bill-application>-->
     </el-dialog>
     <el-dialog
       append-to-body
@@ -309,7 +317,7 @@ import {detailListData, submitData} from "@/api/importTrade/purchase";
 import feeInfo from "@/components/fee-info/main";
 import uploadFile from "@/components/upload-file/main";
 import _ from "lodash";
-import  billApplication from "@/components/bill/billApplication";
+// import  billApplication from "@/components/bill/billApplication";
 //商品详情接口
 import { corpsattn } from "@/api/basicData/configuration"
 import { contrastObj,contrastList } from "@/util/contrastData";
@@ -324,8 +332,9 @@ export default {
   components: {
     ApplyPayment,
     feeInfo,
-    uploadFile,
-    billApplication
+    uploadFile
+/*    ,
+    billApplication*/
   },
   data() {
     return {
@@ -340,7 +349,7 @@ export default {
       commodityData: false,
       takeDisabled:false, //收货状态
       tableData: [],
-      billType:"采购申请货款",
+      billType:"",
       billData:{},
       contractTypeDic:[],
       currencyDic:[],
@@ -467,7 +476,6 @@ export default {
           },{
             label: '合同号',
             prop: 'orderNo',
-            disabled:this.takeDisabled,
             rules: [
               {
                 required: true,
@@ -478,7 +486,6 @@ export default {
           }, {
             label: '采购商',
             prop: 'purchaserId',
-            disabled:this.takeDisabled,
             span: 16,
             dicData: [],
             rules: [
@@ -492,7 +499,6 @@ export default {
           {
             label: '合同日期',
             prop: 'businesDate',
-            disabled: this.takeDisabled,
             type:'date',
             rules: [
               {
@@ -505,7 +511,6 @@ export default {
           {
             label: '所属公司',
             prop: 'belongToCorpId',
-            disabled:this.takeDisabled,
             span: 16,
             dicData: [],
             rules: [
@@ -519,7 +524,6 @@ export default {
          {
             label: '合同金额',
             prop: 'orderAmount',
-           disabled:this.takeDisabled,
             rules: [
               {
                 pattern: /(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/,
@@ -530,7 +534,6 @@ export default {
           }, {
             label: '合同重量',
             prop: 'contractWeight',
-            disabled:this.takeDisabled,
             rules: [
               {
                 required: false,
@@ -602,7 +605,6 @@ export default {
             prop: 'currency'
           }, {
             label: '汇率',
-            type:"unit",
             prop: 'exchangeRate',
           }, {
             label: '人民币金额',
@@ -663,7 +665,8 @@ export default {
                 trigger: 'blur'
               }
             ]
-          },{
+          },
+          {
             label: '已付金额',
             prop: 'settlmentAmount',
             disabled: true,
@@ -714,7 +717,7 @@ export default {
   async created() {
     this.customerContact = await this.getColumnData(this.getColumnName(37), customerContact);
     //币别
-    this.getWorkDicts("entrance_currency").then(res =>{
+    this.getWorkDicts("currency").then(res =>{
       this.currencyDic = res.data.data
     })
     this.getWorkDicts("contractType").then(res =>{
@@ -736,6 +739,11 @@ export default {
           this.oldContactsData = this.deepClone(res.data.data.itemsVOList)
           //明细列表内是否有 已经收货的 如果有  则禁用一些输入框
           this.takeDisabled = this.contactsData.map(item =>{if(item.actualQuantity != 0) return true}).some(item => {return item == true})
+          this.basicData.column.forEach(item =>{
+            if(item.prop == "businesDate" || item.prop == "requiredDeliveryDate"  || item.prop == "requiredArrivalDate" || item.prop == ""){
+              item.disabled = this.takeDisabled
+            }
+          })
         }
         if(res.data.data.orderFeesList){
           this.orderFeesList = res.data.data.orderFeesList
@@ -771,22 +779,19 @@ export default {
       }
     },
     //带出人民币
-    currencyChange(){
-      if(this.form.currency === "CNY" && this.form.exchangeRate == 6.368600){  //如果为人民币
-        this.form.exchangeRate = 1
-        if(this.form.orderAmount){   //合同金额不为0  赋值人民币金额
-          this.$set(this.form,"rmbAmount",this.form.orderAmount)
-        }
-      }else if(this.form.exchangeRate === 1){
-          this.form.exchangeRate = 6.3686
-          if(this.form.orderAmount){
-            this.$set(this.form,"rmbAmount",_.multiply(this.form.orderAmount, 6.3686).toFixed(2))
-          }
-      }else{
-        if(this.form.orderAmount && this.form.exchangeRate){
-          this.$set(this.form,"rmbAmount",_.multiply(this.form.orderAmount, this.form.exchangeRate).toFixed(2))
+    currencyChange(type){
+      if(type === "true"){
+        if(this.form.currency === "CNY"){  //如果为人民币
+          this.$set(this.form,"exchangeRate",1)
+        }else if(this.form.currency === "USD"){
+          this.$set(this.form,"exchangeRate",6.3686)
+        }else{
+          this.$set(this.form,"exchangeRate",7.1749)
         }
       }
+      if(this.form.orderAmount && this.form.orderAmount){
+        this.$set(this.form,"rmbAmount",_.multiply(this.form.orderAmount, this.form.exchangeRate).toFixed(2))
+      }
     },
     //合计
     totalChange(){
@@ -955,7 +960,8 @@ export default {
         })
       }
     },
-    beforeBillData(type){
+    beforeBillData(bool,type){
+      this.billType = type
       //采购明细提单号 list
       this.billData = {
         srcOrderno:this.form.orderNo,
@@ -969,12 +975,12 @@ export default {
         exchangeRate:this.form.exchangeRate,
         srcParentId:this.form.id,
       }
-      if(type){ //申请货款
+      if(bool){ //申请货款
         this.billData.srcId = -1
       }
     },
     // 付款
-    applyPayment(){
+    applyPayment(type){
       if(contrastObj(this.form,this.oldForm) || contrastList(this.contactsData,this.oldContactsData)
         || contrastList(this.orderFeesList,this.oldFeesList) || contrastList(this.orderFilesList,this.oldFilesList)
       ){
@@ -986,7 +992,7 @@ export default {
           this.editCustomer();
         })
       }else{
-        this.beforeBillData(true);
+        this.beforeBillData(true,type);
         this.applyPaymentDialog = true;
       }
     },

+ 7 - 0
src/views/purchase/stockBill/config/mainList.json

@@ -82,6 +82,13 @@
       "width": 150
     },
     {
+      "label": "可用库存",
+      "prop": "surplusRouteQuantity",
+      "overHidden": true,
+      "index": 6,
+      "width": 120
+    },
+    {
       "label": "入库件数",
       "prop": "inQuantity",
       "overHidden": true,

+ 4 - 4
src/views/salesManagement/salesContract/config/mainList.json

@@ -73,7 +73,7 @@
       "width":150
     },
     {
-      "label": "数",
+      "label": "数",
       "prop": "orderQuantity",
       "overHidden": true,
       "index": 5,
@@ -87,21 +87,21 @@
       "width":100
     },
     {
-      "label": "发票重",
+      "label": "发票重",
       "prop": "invoiceWeight",
       "overHidden": true,
       "index": 7,
       "width":100
     },
     {
-      "label": "已发数",
+      "label": "已发数",
       "prop": "invoiceWeight",
       "overHidden": true,
       "index": 8,
       "width":100
     },
     {
-      "label": "合同金额",
+      "label": "发票金额",
       "prop": "orderAmount",
       "overHidden": true,
       "search": true,

+ 37 - 27
src/views/salesManagement/salesContract/detailsPage.vue

@@ -19,7 +19,14 @@
                    class="el-button--small-yh"
                    :disabled="!form.id"
                    :loading="buttonLoading"
-                   @click.stop="applySettlement">生成账单
+                   @click.stop="applySettlement('收费')">生成账单
+        </el-button>
+        <el-button type="warning"
+                   size="small"
+                   class="el-button--small-yh"
+                   :disabled="!form.id"
+                   :loading="buttonLoading"
+                   @click.stop="applySettlement('申请')">退款
         </el-button>
         <el-button type="success"
                    size="small"
@@ -324,7 +331,7 @@ export default {
       currencyDic:[],
       contractDic:[],
       selectKind:-1,
-      billType:"销售",
+      billType:"",
       billData:{},
       configuration:{
         multipleChoices:false,
@@ -429,15 +436,11 @@ export default {
             ]
           },
           {
-            label: '已收金额',
-            prop: 'settlmentAmount',
+            label: '业务员',
+            prop: 'salesName',
+            dicData: [],
             rules: [
               {
-                pattern: /(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/,
-                message: ' ',
-                trigger: 'blur'
-              },
-              {
                 required: false,
                 message: ' ',
                 trigger: 'blur'
@@ -506,11 +509,16 @@ export default {
             ]
           },
           {
-            label: '计划交期',
-            prop: 'plannedDeliveryDate',
-            type: 'datetime',
+            label: '已收金额',
+            prop: 'settlmentAmount',
+            disabled: true,
             rules: [
               {
+                pattern: /(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/,
+                message: ' ',
+                trigger: 'blur'
+              },
+              {
                 required: false,
                 message: ' ',
                 trigger: 'blur'
@@ -542,9 +550,9 @@ export default {
             ]
           },
           {
-            label: '业务员',
-            prop: 'salesName',
-            dicData: [],
+            label: '计划交期',
+            prop: 'plannedDeliveryDate',
+            type: 'datetime',
             rules: [
               {
                 required: false,
@@ -667,7 +675,7 @@ export default {
   async created() {
     this.importInventory = await this.getColumnData(this.getColumnName(39), importInventory);
     //币别
-    this.getWorkDicts("entrance_currency").then(res =>{
+    this.getWorkDicts("currency").then(res =>{
       this.currencyDic = res.data.data
     })
     if (this.detailData.id) {
@@ -695,7 +703,7 @@ export default {
       })
     }else{
       this.$set(this.form,"currency","USD")
-      this.$set(this.form,"exchangeRate",6.3843)
+      this.$set(this.form,"exchangeRate",6.3686)
     }
   },
   components: {
@@ -730,13 +738,14 @@ export default {
     },
     //汇率
     currencyChange(value){
-      if(value === "CNY" &&  this.form.exchangeRate ==6.384300){
-        this.$set(this.form,"exchangeRate",1)
-        this.form.exchangeRate = 1
-        // this.form.rmbAmount = this.form.orderAmount
-      }else if( this.form.exchangeRate ===  1){
-        this.$set(this.form,"exchangeRate",6.384300)
-        // this.form.rmbAmount =  _.multiply(this.form.orderAmount, 6.3843)
+      if(this.form.exchangeRate == 1 || this.form.exchangeRate == 6.368600 || this.form.exchangeRate == 7.174900){
+        if(value == "CNY"){
+          this.$set(this.form,"exchangeRate",1)
+        }else if(value == "USD"){
+          this.$set(this.form,"exchangeRate",6.368600)
+        }else if(value == "EUR"){
+          this.$set(this.form,"exchangeRate",7.174900)
+        }
       }
     },
     //单价
@@ -757,7 +766,8 @@ export default {
         row.amount =_.multiply(row.billWeight,row.price).toFixed(2);
       }
     },
-    beforeBillData(type){
+    beforeBillData(bool,type){
+      this.billType = type
       this.billData = {
         srcOrderno:this.form.orderNo,
         itemType:"销售",
@@ -774,7 +784,7 @@ export default {
       }
     },
     //申请结算
-    applySettlement(){
+    applySettlement(type){
       if(contrastObj(this.form,this.oldForm) || contrastList(this.importInventoryData,this.oldInventoryData)
         || contrastList(this.orderFeesList,this.oldFeesList) || contrastList(this.orderFilesList,this.oldFilesList)
       ){
@@ -786,7 +796,7 @@ export default {
           this.editCustomer();
         })
       }else{
-        this.beforeBillData(true)
+        this.beforeBillData(true,type)
         this.applySettlementDialog = true;
         // this.$confirm("是否确认申请结算!", {
         //   confirmButtonText: "确定",