Browse Source

Merge remote-tracking branch 'origin/dev' into dev

wangzhuo 3 years ago
parent
commit
ea09838582

+ 8 - 1
src/api/basicData/salesOrder.js

@@ -121,4 +121,11 @@ export const getStoragelist = (data) => {
       method: 'get',
       params: data
   })
-}
+}
+export const offset = (data) => {
+  return request({
+      url: '/api/blade-purchase-sales/appParts/offset',
+      method: 'post',
+      data: data
+  })
+}

+ 8 - 0
src/api/landTransportation/index.js

@@ -363,4 +363,12 @@ export function checkAttachment(data) {
         params:data
     })
 }
+//更新账单
+export function generateBill(data) {
+    return request({
+        url: ' /api/blade-land/order/generateBill',
+        method: 'get',
+        params:data
+    })
+}
 

+ 8 - 0
src/enums/column-name.js

@@ -1120,6 +1120,14 @@ const columnName = [{
   }, {
     code: 249,
     name: '产品上架'
+  },
+  {
+    code: 250,
+    name: '付款结算(Z)'
+  },
+  {
+    code: 251,
+    name: '收款结算(Z)'
   }
 ]
 export const getColumnName = (key) => {

+ 3 - 0
src/views/approveData/index.vue

@@ -36,6 +36,8 @@
         <span v-else-if="scope.row.checkType == 'WASH'">洗箱</span>
         <span v-else-if="scope.row.checkType == 'BGJK'">报关进口</span>
         <span v-else-if="scope.row.checkType == 'BGCK'">报关出口</span>
+        <span v-else-if="scope.row.checkType == 'YPJ-XS'">易配件销售</span>
+        <span v-else-if="scope.row.checkType == 'YPJ-CG'">易配件采购</span>
       </template>
       <template slot="menuLeft">
         <el-button size="small" type="success" :disabled="selectionList.length == 0" @click.stop="batchCheck">批量审批
@@ -173,6 +175,7 @@ export default {
     },
     //跳转页面
     jumpPage(row) {
+      console.log(eval(row.pageStatus))
       if (row.url) {
         if (eval("(" + row.pageStatus + ")")) {
           this.$alert(

+ 86 - 0
src/views/financialManagement/collectionSettlement/configuration/detailsPage.json

@@ -0,0 +1,86 @@
+{
+  "lazy": true,
+  "tip": false,
+  "simplePage": true,
+  "searchShow": true,
+  "addBtn":false,
+  "editBtn":false,
+  "addRowBtn":false,
+  "cellBtn":false,
+  "cancelBtn":false,
+  "refreshBtn": false,
+  "searchMenuSpan": 6,
+  "align": "center",
+  "delBtn":false,
+  "dialogWidth": "60%",
+  "tree": true,
+  "border": true,
+  "index": true,
+  "stripe": true,
+  "selection": false,
+  "menuWidth": 150,
+  "dialogClickModal": false,
+  "showSummary": true,
+  "summaryText": "合计",
+  "sumColumnList": [
+    {
+      "name": "amount",
+      "type": "sum"
+    },
+    {
+      "name": "thisAmount",
+      "type": "sum"
+    }
+  ],
+  "column": [
+    {
+      "label": "合同号",
+      "prop": "srcOrderno",
+      "overHidden": true,
+      "width": 200,
+      "index": 2
+    },
+    {
+      "label": "提单号",
+      "prop": "billNo",
+      "overHidden": true,
+      "width": 200,
+      "index": 3
+    },
+    {
+      "label": "费用名称",
+      "prop": "itemName",
+      "overHidden": true,
+      "width": 150,
+      "index": 4
+    },
+    {
+      "label": "金额",
+      "prop": "amount",
+      "overHidden": true,
+      "width": 150,
+      "index": 7
+    },
+    {
+      "label": "本次金额",
+      "prop": "thisAmount",
+      "overHidden": true,
+      "width": 150,
+      "index": 7
+    },
+    {
+      "label": "币别",
+      "prop": "currency",
+      "index": 7,
+      "width": 120
+    },
+    {
+      "label": "备注",
+      "prop": "remarks",
+      "overHidden": true,
+      "index": 13,
+      "cell": true,
+      "width": 540
+    }
+  ]
+}

+ 177 - 0
src/views/financialManagement/collectionSettlement/configuration/mainList.json

@@ -0,0 +1,177 @@
+{
+  "lazy": true,
+  "tip": false,
+  "searchShow": true,
+  "searchMenuSpan": 24,
+  "dialogWidth": "60%",
+  "align": "center",
+  "searchSpan": 8,
+  "height": "auto",
+  "searchMenuPosition": "right",
+  "border": true,
+  "index": true,
+  "selection": false,
+  "viewBtn": false,
+  "editBtn": false,
+  "delBtn": false,
+  "menuWidth": 80,
+  "dialogClickModal": false,
+  "searchLabelWidth": 120,
+  "searchIcon": true,
+  "searchIndex": 2,
+  "addBtn":false,
+  "stripe": true,
+  "headerAlign": "center",
+  "showSummary": true,
+  "summaryText": "合计",
+  "sumColumnList": [
+    {
+      "name": "amount",
+      "type": "sum"
+    }
+  ],
+  "column": [
+    {
+      "label": "合同号",
+      "prop": "srcOrderno",
+      "overHidden": true,
+      "search": true,
+      "width": 150,
+      "index": 2
+    },
+    {
+      "label": "提单号",
+      "prop": "billNo",
+      "search": true,
+      "overHidden": true,
+      "width": 150,
+      "index": 3
+    },
+    {
+      "label": "往来单位",
+      "prop": "corpId",
+      "search": true,
+      "overHidden": true,
+      "width": 200,
+      "index": 4
+    },
+    {
+      "label": "单据状态",
+      "prop": "financeStatus",
+      "type": "select",
+      "search": true,
+      "overHidden": true,
+      "index": 1,
+      "width": 120,
+      "dicData": [
+        {
+          "label": "待结算",
+          "value":"待结算"
+        },
+        {
+          "label": "结算完成",
+          "value": "结算完成"
+        }
+      ]
+    },
+    {
+      "label": "人民币金额",
+      "prop": "amount",
+      "overHidden": true,
+      "search": true,
+      "width": 120,
+      "index": 5
+    },
+    {
+      "label": "外币金额",
+      "prop": "foreignAmount",
+      "overHidden": true,
+      "width": 120,
+      "index": 5
+    },
+    {
+      "label": "收款日期",
+      "prop": "settlementDate",
+      "overHidden": true,
+      "type": "date",
+      "search": true,
+      "unlinkPanels": true,
+      "searchRange": true,
+      "width": 150,
+      "index": 6
+    },{
+      "label": "完成时间",
+      "prop": "completionTime",
+      "overHidden": true,
+      "type": "date",
+      "search": true,
+      "format": "yyyy-MM-dd",
+      "valueFormat": "yyyy-MM-dd",
+      "unlinkPanels": true,
+      "searchRange": true,
+      "width": 150,
+      "index": 7
+    },{
+      "label": "银行名称",
+      "prop": "accountBank",
+      "overHidden": true,
+      "width": 150,
+      "index": 8
+    },
+    {
+      "label": "银行户头",
+      "prop": "accountName",
+      "search": true,
+      "overHidden": true,
+      "width": 150,
+      "index": 9
+    },
+    {
+      "label": "银行卡号",
+      "prop": "accountNo",
+      "overHidden": true,
+      "width": 150,
+      "index": 10
+    },
+    {
+      "label": "创建人",
+      "prop": "createUserName",
+      "overHidden": true,
+      "index": 11,
+      "width":100
+    },
+    {
+      "label": "创建日期",
+      "prop": "createTime",
+      "type": "date",
+      "format": "yyyy-MM-dd HH:mm:ss",
+      "overHidden": true,
+      "index": 12,
+      "width":160
+    },
+    {
+      "label": "修改人",
+      "prop": "updateUserName",
+      "overHidden": true,
+      "index": 13,
+      "width":100
+    },
+    {
+      "label": "修改日期",
+      "prop": "updateTime",
+      "type": "date",
+      "format": "yyyy-MM-dd HH:mm:ss",
+      "overHidden": true,
+      "index": 14,
+      "width":160
+    },
+    {
+      "label": "备注",
+      "prop": "remark",
+      "search": true,
+      "overHidden": true,
+      "index": 15,
+      "width": 120
+    }
+  ]
+}

+ 285 - 0
src/views/financialManagement/collectionSettlement/receiptSettle.vue

@@ -0,0 +1,285 @@
+<template>
+  <basic-container v-if="show">
+    <avue-crud :option="option"
+               :data="dataList"
+               ref="crud"
+               v-model="form"
+               :page.sync="page"
+               :search.sync="search"
+               :table-loading="loading"
+               :cell-style="cellStyle"
+               @search-change="searchChange"
+               @search-reset="searchReset"
+               @selection-change="selectionChange"
+               @current-change="currentChange"
+               @size-change="sizeChange"
+               @refresh-change="refreshChange"
+               @saveColumn="saveColumn"
+               @resetColumn="resetColumn"
+               @on-load="onLoad"
+               @search-criteria-switch="searchCriteriaSwitch">
+      <template slot="corpIdSearch">
+        <select-component
+          v-model="search.corpId"
+          :configuration="configuration"
+        ></select-component>
+      </template>
+      <template slot="menuLeft">
+        <el-button type="primary"
+                   size="small"
+                   icon="el-icon-plus"
+                   @click="addReceipt">创建单据
+        </el-button>
+        <el-button type="warning" size="small" icon="el-icon-top" @click.stop="openExport()">导出</el-button>
+      </template>
+      <template slot-scope="scope" slot="menu">
+        <el-button
+          type="text"
+          size="small"
+          icon="el-icon-delete"
+          @click.stop="rowDel(scope.row, scope.index)"
+        >删除
+        </el-button>
+      </template>
+      <template slot-scope="scope" slot="srcOrderno">
+        <span style="color: #409EFF;cursor: pointer" @click.stop="editOpen(scope.row)">{{ scope.row.srcOrderno }}</span>
+      </template>
+      <template slot-scope="scope" slot="corpId">
+        <span style="color: #409EFF;cursor: pointer" @click.stop="editOpen(scope.row)">{{ scope.row.corpName }}</span>
+      </template>
+    </avue-crud>
+  </basic-container>
+  <detail-page
+    ref="detail"
+    @goBack="goBack"
+    :detailData="detailData"
+    v-else
+  ></detail-page>
+</template>
+
+<script>
+  import option from "./configuration/mainList.json";
+  import {getList ,remove} from "@/api/financialManagement/financialManagement"
+  import detailPage from "./receiptSettleDetailsPage.vue";
+  import {getToken} from "@/util/auth";
+
+  export default {
+    data() {
+      return {
+        loading : false,
+        form: {},
+        search:{},
+        option: {},
+        parentId:0,
+        show:true,
+        detailData:{},
+        dataList: [{
+          canem:""
+        }],
+        page: {
+          pageSize: 10,
+          pagerCount: 5,
+          total: 0,
+        },
+        query:{},
+        configuration:{
+          multipleChoices:false,
+          multiple:false,
+          disabled:false,
+          searchShow:true,
+          collapseTags:false,
+          clearable:true,
+          placeholder:'请点击右边按钮选择',
+          dicData:[]
+        },
+      }
+    },
+    components:{
+      detailPage
+    },
+    async created() {
+      this.option = await this.getColumnData(this.getColumnName(64), option);
+      let i = 0;
+      this.option.column.forEach(item => {
+        if (item.search) i++
+      })
+      if (i % 3 !== 0) {
+        const num = 3 - Number(i % 3)
+        this.option.searchMenuSpan = num * 8;
+        this.option.searchMenuPosition = "right";
+      }
+    },
+    mounted() {
+      // this.option.height = window.innerHeight - 200;
+    },
+    methods: {
+      searchCriteriaSwitch(type){
+        if (type){
+          this.option.height = this.option.height - 90
+        }else {
+          this.option.height = this.option.height + 90
+        }
+        this.$refs.crud.getTableHeight()
+      },
+      //新单打开
+      addReceipt(row){
+        this.detailData = {
+          id: row.id,
+          status: 1
+        };
+        this.show = false;
+      },
+      //编辑打开
+      editOpen(row){
+        const data = {
+          moduleName: 'sf',
+          tableName: 'finance_settlement',
+          billId: row.id,
+          no: localStorage.getItem('browserID')
+        }
+        this.checkLock(data).then(res => {
+          if (res.data.code == 200) {
+            this.detailData = {
+              disabled: true,
+              id: row.id
+            };
+            this.show = false;
+          }
+        }).catch(error => {
+          this.detailData = {
+            disabled: true,
+            id: row.id
+          };
+          this.show = false;
+        })
+      },
+      rowDel(row, index, done) {
+        if(row.id){
+          this.$confirm("确定将选择数据删除?", {
+            confirmButtonText: "确定",
+            cancelButtonText: "取消",
+            type: "warning"
+          }).then(() => {
+            remove(row.id).then(res =>{
+              if(res.data.success){
+                this.$message.success("操作成功!");
+                this.onLoad(this.page);
+              }
+            })
+          });
+        }
+      },
+      //点击搜索按钮触发
+      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(val) {
+        this.page.currentPage = val
+      },
+      sizeChange() {
+        console.log('1')
+      },
+      refreshChange(params) {
+        this.onLoad(this.page,params)
+      },
+      paramsAdjustment(params) {
+        params = Object.assign({}, this.search);
+        if (params.settlementDate &&  params.settlementDate.length !==0 ) {  //合同
+          params.settlementStartDate = params.settlementDate[0]+ " " + "00:00:00";
+          params.settlementEndDate = params.settlementDate[1] + " " + "23:59:59";
+          this.$delete(params,'settlementDate')
+        }
+
+        if (params.completionTime &&  params.completionTime.length !==0 ) {
+          params.completionTimeStart = params.completionTime[0]+ " " + "00:00:00";
+          params.completionTimeEnd = params.completionTime[1] + " " + "23:59:59";
+          this.$delete(params,'completionTime')
+        }
+        return params
+      },
+      onLoad(page, params) {
+        this.loading = true
+        params = this.paramsAdjustment(params)
+        params.billType = "收费"
+        params.settlementType = 1
+
+        getList(page.currentPage, page.pageSize,params).then(res =>{
+          this.dataList = res.data.data.records
+          this.page.total = res.data.data.total
+          if (this.page.total) {
+            this.option.height = window.innerHeight - 240;
+          }
+        }).finally(()=>{
+          this.loading = false
+        })
+      },
+      goBack() {
+        this.detailData=this.$options.data().detailData
+        this.show = true;
+        this.onLoad(this.page,this.search)
+      },
+      cellStyle() {
+        return "padding:0;height:40px;";
+      },
+      //列保存触发
+      async saveColumn() {
+        const inSave = await this.saveColumnData(
+          this.getColumnName(64),
+          this.option
+        );
+        if (inSave) {
+          this.$message.success("保存成功");
+          //关闭窗口
+          this.$refs.crud.$refs.dialogColumn.columnBox = false;
+        }
+      },
+      async resetColumn() {
+        const inSave = await this.delColumnData(
+          this.getColumnName(64),
+          option
+        );
+        if (inSave) {
+          this.$message.success("重置成功");
+          this.option = option;
+          //关闭窗口
+          this.$refs.crud.$refs.dialogColumn.columnBox = false;
+        }
+      },
+      openExport() {
+        let params = JSON.parse(JSON.stringify(this.search))
+        if (params.settlementDate &&  params.settlementDate.length !==0 ) {  //合同
+          params.settlementStartDate = params.settlementDate[0]+ " " + "00:00:00";
+          params.settlementEndDate = params.settlementDate[1] + " " + "23:59:59";
+          this.$delete(params,'settlementDate')
+        }
+        if (params.completionTime &&  params.completionTime.length !==0 ) {
+          params.completionTimeStart = params.completionTime[0]+ " " + "00:00:00";
+          params.completionTimeEnd = params.completionTime[1] + " " + "23:59:59";
+          this.$delete(params,'completionTime')
+        }
+        params.billType = "收费"
+        params.settlementType = 1
+        const routeData = this.$router.resolve({
+          path: '/api/trade-finance/settlement/expenseExport',      //跳转目标窗口的地址
+          query: {
+            ...params    //括号内是要传递给新窗口的参数
+          }
+        })
+        window.open(routeData.href.slice(1, routeData.href.length) + '&' + `${this.website.tokenHeader}=${getToken()}`);
+      },
+    }
+  }
+</script>
+
+<style scoped>
+
+</style>

+ 928 - 0
src/views/financialManagement/collectionSettlement/receiptSettleDetailsPage.vue

@@ -0,0 +1,928 @@
+<template>
+  <div class="borderless">
+    <div class="customer-head">
+      <div class="customer-back">
+        <el-button type="danger" style="border: none;background: none;color: red" icon="el-icon-arrow-left"
+                   @click="backToList">返回列表
+        </el-button>
+        <div class="upper_right_button">
+          <el-button
+            type="primary"
+            size="small"
+            @click="editHandle"
+            v-if="editDisable"
+            :loading="buttonLoading"
+          >编 辑</el-button>
+          <el-button type="primary"
+                     size="small"
+                     :disabled="!form.id || editDisable"
+                     @click="postMessage"
+                     :loading="buttonLoading"
+          >发送消息</el-button>
+          <el-button type="warning"
+                     size="small"
+                     class="el-button--small-yh"
+                     :loading="buttonLoading"
+                     :disabled="!form.id || editDisable"
+                     v-if="form.id"
+                     @click.stop="confirmSettlement"
+          >{{financeDisabled?"收费":"撤销收费"}}
+          </el-button>
+          <el-button class="el-button--small-yh"
+                     type="primary"
+                     size="small"
+                     :loading="buttonLoading"
+                     :disabled="!financeDisabled || editDisable"
+                     @click.stop="saveSettlement"
+          >保存数据
+          </el-button>
+        </div>
+      </div>
+    </div>
+    <div class="customer-main">
+      <containerTitle title="基础信息"></containerTitle>
+      <basic-container>
+        <avue-form class="trading-form" ref="form" v-model="form" :option="option">
+          <template slot="corpId">
+            <crop-select
+              v-model="form.corpId"
+              corpType="KG"
+              :disabled="!financeDisabled || editDisable"
+              @getCorpData="returnBack"
+              style="width: 100%"
+            ></crop-select>
+          </template>
+          <template slot="salesCompany">
+            <crop-select
+              v-model="form.salesCompany"
+              corpType="GS"
+              :disabled="!financeDisabled || editDisable"
+              @getCorpData="getGSName"
+              style="width: 100%"
+            ></crop-select>
+          </template>
+          <template slot="accountNo">
+            <el-select v-model="form.accountNo"
+                       placeholder="请选择"
+                       :disabled="!financeDisabled || editDisable"
+                       @change="accountNoChange"
+                       clearable
+                       filterable>
+              <el-option v-for="(item,index) in form.bankList"
+                         :key="index"
+                         :label="item.accountNo"
+                         :value="item.accountNo"
+              >
+              </el-option>
+            </el-select>
+          </template>
+          <template slot="caseOverPayment">
+            <el-input
+              placeholder="请输入"
+              clearable
+              v-model="form.caseOverPayment"
+              @change="caseOverPaymentChange"
+              v-input-limit="2"
+              :disabled="dataList.length == 0 || !financeDisabled || editDisable"
+            ></el-input>
+          </template>
+          <template slot="remark">
+            <el-input type="textarea"
+                      v-model="form.remark"
+                      size="small"
+                      rows="2"
+                      autocomplete="off"
+                      placeholder="">
+            </el-input>
+          </template>
+        </avue-form>
+      </basic-container>
+      <containerTitle title="明细列表"></containerTitle>
+      <basic-container>
+        <avue-crud :option="itemsOption"
+                   :data="dataList"
+                   ref="crud"
+                   v-model="itemsForm"
+                   :page.sync="page"
+                   :cell-style="cellStyle"
+                   @search-reset="searchReset"
+                   @row-update="rowUpdate"
+                   @selection-change="selectionChange"
+                   @current-change="currentChange"
+                   @size-change="sizeChange"
+                   @refresh-change="refreshChange">
+          <template slot="menuLeft">
+            <el-button type="primary"
+                       size="small"
+                       icon="el-icon-shopping-cart-2"
+                       :disabled="!financeDisabled || editDisable"
+                       :buttonLoading="buttonLoading"
+                       @click="selectRecipt"
+            >选择销售合同
+            </el-button>
+            <el-button
+                :disabled="!form.id"
+              type="info"
+              size="small"
+              icon="el-icon-printer"
+              @click.stop="openReport"
+            >报表打印</el-button>
+          </template>
+          <template slot-scope="{ row }" slot="currency">
+            <el-select  v-if="row.$cellEdit" v-model="row.currency" size="small" placeholder="请选择 币别" clearable filterable>
+              <el-option v-for="(item,index) in currencyDic" :key="index" :label="item.dictValue"  :value="item.dictValue"></el-option>
+            </el-select>
+            <span v-else>{{ row.currency }}</span>
+          </template>
+          <template slot="thisAmount" slot-scope="{ row }">
+            <span v-if="row.$cellEdit" class="required_fields">*</span>
+            <el-input
+              v-if="row.$cellEdit"
+              v-model="row.thisAmount"
+              style="width: 90%"
+              placeholder="请输入"
+              size="small"
+              @input="thisAmountVerify(row)"
+              oninput='this.value=this.value.replace(/[^(\d.)]/g,"").replace(/^(\d+)\.(\d\d).*$/, "$1.$2")'
+            ></el-input>
+            <span v-else>{{ row.thisAmount }}</span>
+          </template>
+          <template slot-scope="scope" slot="menu">
+            <el-button
+              type="text"
+              size="small"
+              icon="el-icon-edit"
+              :disabled="!financeDisabled || editDisable"
+              @click.stop="rowCell(scope.row,scope.index)"
+            > {{ scope.row.$cellEdit ? '修改完成' : '修改' }}
+            </el-button>
+            <el-button
+              type="text"
+              size="small"
+              icon="el-icon-delete"
+              :disabled="!financeDisabled || editDisable"
+              @click.stop="rowDel(scope.row,scope.index)"
+            >删除
+            </el-button>
+          </template>
+          <template slot="srcOrderno" slot-scope="scope">
+            <span style="color: #409EFF;cursor: pointer" @click="jumpPage(scope.row, scope.index)">{{scope.row.srcOrderno}}</span>
+          </template>
+        </avue-crud>
+      </basic-container>
+      <el-dialog
+        title="导入销售"
+        append-to-body
+        class="el-dialogDeep"
+        :visible.sync="billDetailDialog"
+        width="60%"
+        :close-on-click-modal="false"
+        :destroy-on-close="true"
+        :close-on-press-escape="false"
+        top="10vh"
+        v-dialog-drag>
+        <bill-detail
+          :params="params"
+          :billType="billType"
+          :flag="1"
+          @closeFun="closeBillDetail"
+          @importProMent="importProMent"
+        >
+        </bill-detail>
+      </el-dialog>
+    </div>
+    <messagePost
+      v-if="messageVisble"
+      ref="messagePost"
+      @closeDialog="closeDialog"
+    ></messagePost>
+    <report-dialog
+        :switchDialog="switchDialog"
+        :reportId="form.id"
+        reportName="收款"
+        @onClose="onClose()"
+    />
+  </div>
+</template>
+
+<script>
+  import option from "./configuration/detailsPage.json";
+  import { getDetail } from "@/api/financialManagement/financialManagement"
+  import { getDetails,modify,cancelModify,saveOrEdit } from "@/api/financialManagement/paymentRequest";
+  import  billDetail from "@/components/bill/billDetailList";
+  import _ from "lodash";
+  import { getlistBankBy,deleteDetail } from "@/api/financialManagement/paymentRequest";
+  import { contrastObj,contrastList } from "@/util/contrastData";
+  import {getUserInfo} from "@/api/system/user";
+  import {getCorpDetail} from "@/api/maintenance/overpayment";
+  import { getlistBankBy as GYSGetBank } from "@/api/basicData/configuration"
+  import reportDialog from "@/components/report-dialog/main";
+
+  export default {
+    name: "receiptDetailsPage",
+    props: {
+      detailData: {
+        type: Object
+      }
+    },
+    components:{
+      billDetail,
+      reportDialog,
+    },
+    data() {
+      return {
+        category: '',
+        form: {},
+        itemsForm:{},
+        params:{},
+        buttonLoading:false,
+        itemsOption: option,
+        option: {
+          menuBtn: false,
+          labelWidth: 100,
+          column: [
+            {
+              label: '所属公司',
+              prop: 'salesCompany',
+              sort:true,
+              span: 8,
+              rules: [
+                {
+                  required: true,
+                  message: ' ',
+                  trigger: 'blur'
+                }
+              ]
+            },
+            {
+              label: '合同号',
+              prop: 'srcOrderno',
+              span: 8,
+              rules: [
+                {
+                  required: false,
+                  message: ' ',
+                  trigger: 'blur'
+                }
+              ]
+            },
+            {
+              label: '系统号',
+              prop: 'sysNo',
+              span: 8,
+              disabled: true
+            },
+            {
+              label: '银行账号',
+              prop: 'accountNo',
+              span: 8,
+              rules: [
+                {
+                  required: false,
+                  message: ' ',
+                  trigger: 'blur'
+                }
+              ]
+            },
+            {
+              label: '开户银行',
+              prop: 'accountBank',
+              span: 8,
+              rules: [
+                {
+                  required: false,
+                  message: ' ',
+                  trigger: 'blur'
+                }
+              ]
+            }, {
+              label: '银行户头',
+              prop: 'accountName',
+              span: 8,
+              rules: [
+                {
+                  required: false,
+                  message: ' ',
+                  trigger: 'blur'
+                }
+              ]
+            }, {
+              label: '科目编码',
+              prop: 'subjectNumber',
+              span: 8,
+              rules: [
+                {
+                  required: false,
+                  message: ' ',
+                  trigger: 'blur'
+                }
+              ]
+            },
+            {
+              label: '往来单位',
+              prop: 'corpId',
+              sort:true,
+              span: 8,
+              rules: [
+                {
+                  required: true,
+                  message: ' ',
+                  trigger: 'blur'
+                }
+              ]
+            },
+            {
+              label: '收款日期',
+              prop: 'settlementDate',
+              format:"yyyy-MM-dd",
+              valueFormat:"yyyy-MM-dd 00:00:00",
+              span: 8,
+              type:"date",
+              rules: [
+                {
+                  required: true,
+                  message: ' ',
+                  trigger: 'blur'
+                }
+              ]
+            },
+            {
+              label: '制单人',
+              prop: 'createUserName',
+              span: 8,
+              disabled:true,
+              rules: [
+                {
+                  required: false,
+                  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: false,
+                  message: ' ',
+                  trigger: 'blur'
+                }
+              ]
+            },
+            {
+              label: '外币金额',
+              prop: 'foreignAmount',
+              display: true,
+              span: 8,
+              rules: [
+                {
+                  pattern: /(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/,
+                  message: ' ',
+                  trigger: 'blur'
+                }
+              ]
+            },
+            {
+              label: '使用溢付款',
+              prop: 'caseOverPayment',
+              display: false,
+              span: 8,
+              rules: [
+                {
+                  pattern: /(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/,
+                  message: ' ',
+                  trigger: 'blur'
+                }
+              ]
+            },
+            {
+              label: '溢付款余额',
+              prop: 'overPayment',
+              display: false,
+              disabled: true,
+              span: 8,
+              // rules: [
+              //   {
+              //     pattern: /(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/,
+              //     message: ' ',
+              //     trigger: 'blur'
+              //   }
+              // ]
+            },
+            {
+              label: '制单日期',
+              prop: 'createTime',
+              span: 8,
+              type:"date",
+              disabled:true,
+              rules: [
+                {
+                  required: false,
+                  message: ' ',
+                  trigger: 'blur'
+                }
+              ]
+            },
+            {
+              label: '备注',
+              prop: 'remark',
+              span:24,
+              row:2,
+              rules: [
+                {
+                  required: false,
+                  message: ' ',
+                  trigger: 'blur'
+                }
+              ]
+            },
+          ],
+        },
+        id:'',
+        dataList: [],
+        currencyDic:[],
+        page: {
+          pageSize: 10,
+          pagerCount: 5,
+          total: 0,
+        },
+        billDetailDialog:false,
+        financeDisabled:true,
+        billType:"收费",
+        // 明细本次金额总计
+        allAmount: 0,
+        // 消息弹窗
+        messageVisble: false,
+        //新旧数据对比
+        oldForm:{},
+        oldDataList:[],
+        financeStatusDic:[{
+          value: '正常',
+          label: '正常'
+        },
+          {
+            value: '停用',
+            label: '停用'
+          }],
+        editDisable: false, //编辑状态禁用
+        switchDialog: false,
+        statementData: {},
+      }
+    },
+    created() {
+      // 人民币金额默认为0
+      this.$set(this.form,"amount", 0)
+      getUserInfo().then(res=>{
+        this.category = res.data.data.billType
+        if (this.category == 2) {
+          this.$set(this.form,"overPayment", 0)
+          this.$set(this.form,"caseOverPayment", 0)
+          this.option.column.forEach(item => {
+            if (item.prop == 'caseOverPayment' || item.prop == 'overPayment') {
+              item.display = true
+            }
+            if (item.prop == 'foreignAmount') {
+              item.display = false
+            }
+          })
+        }
+      })
+      //币别
+      this.getWorkDicts("currency").then(res =>{
+        this.currencyDic = res.data.data
+      })
+      this.detailData.disabled && (this.editDisable = true)
+      if (this.detailData.id) {
+        this.buttonLoading = true
+        this.id = this.detailData.id;//字符串转数字  超长用BigInt
+        getDetail(this.id).then(res => {
+          this.afterEcho(res.data.data)
+        }).finally(()=>{
+          this.buttonLoading = false
+        })
+      }else{
+        this.form.financeStatus = "待结算"
+        this.oldForm.financeStatus = "待结算"
+      }
+    },
+    mounted() {
+
+    },
+    methods: {
+      //选择客户
+      returnBack(corpValue){
+        this.corpId = corpValue.id
+        if (this.category != 2) {
+          getlistBankBy(corpValue.id).then(res =>{
+            this.$set(this.form,"bankList",res.data)
+          })
+        }
+
+        // 溢付款余额获取
+        if (this.category == 2) {
+          getCorpDetail({corpId:corpValue.id}).then(res => {
+            this.form.overPayment = res.data.data? res.data.data.balanceOverpaymen: 0
+          })
+        }
+      },
+      //选择卡号
+      accountNoChange(value){
+        let isTrue = false
+        this.form.bankList.forEach(item =>{
+          if(item.accountNo == value){
+            this.$set(this.form,"accountBank",item.accountBank)
+            this.$set(this.form,"accountName",item.accountName)
+            this.$set(this.form,"subjectNumber",item.subjectNumber)
+            isTrue = true
+          }
+        })
+        this.$nextTick(() => {
+          if (!isTrue) {
+            this.$set(this.form, 'accountBank', null)
+            this.$set(this.form, 'accountName', null)
+            this.$set(this.form,"subjectNumber",null)
+          }
+        })
+      },
+      //本次金额验证
+      thisAmountVerify(row){
+        if(parseFloat(row.thisAmount) > parseFloat(row.amount)){
+          this.$message.warning('本次金额不得大于金额!')
+          this.$set(row,'thisAmount','')
+        }
+      },
+      selectRecipt(){
+        if(!this.form.corpId){
+          this.$message.warning("请先选择客户!")
+          return
+        }
+        this.params = {
+          corpId: this.form.corpId
+        }
+        this.billDetailDialog = true;
+      },
+      closeBillDetail(){
+        this.billDetailDialog = false;
+      },
+      importProMent(list){
+        list.forEach((item,index) =>{
+          item.accId = item.id;
+          item.srcOrderno  = item.accSysNo
+          item.billNo  = item.srcBillNo
+          item.thisAmount = item.amount
+          delete item.id;
+          this.$refs.crud.rowCellAdd(item);
+        })
+        //明细列表所有合同号 去重 加, 为主表合同号
+        this.$set(this.form,'srcOrderno',Array.from(new Set(this.dataList.map(item =>{ return item.srcOrderno}))).join(','))
+
+        this.billDetailDialog = false;
+      },
+      rowUpdate(row, index, done) {
+        done(row);
+      },
+      rowCell(row,index){
+        // row.$cellEdit = !row.$cellEdit
+        // this.$refs.crud.rowCell(row, index)
+        if (row.$cellEdit == true) {
+        this.$set(row, "$cellEdit", false);
+      } else {
+        this.$set(row, "$cellEdit", true);
+      }
+      },
+      rowDel(row,index){
+        if (row.id) {
+          deleteDetail({ids: row.id}).then(res => {
+            this.$message({
+              type: "success",
+              message: "操作成功!"
+            });
+            this.dataList.splice(index, 1);
+          })
+        } else {
+          this.dataList.splice(index, 1);
+        }
+      },
+      searchReset() {
+        console.log('1')
+      },
+      selectionChange() {
+        console.log('1')
+      },
+      currentChange() {
+        console.log('1')
+      },
+      sizeChange() {
+        console.log('1')
+      },
+      refreshChange() {
+        console.log('1')
+      },
+      confirmSettlement(status){
+        if (!this.form.corpId) return this.$message.error('往来单位不能为空')
+        this.$refs["form"].validate((valid,done) => {
+          done();
+          if(valid && this.verificationData('收费')){
+            this.$confirm("是否确认" + (this.financeDisabled? '收费': '撤销收费'), "提示", {
+              confirmButtonText: "确认",
+              cancelButtonText: "取消",
+              type: "warning",
+            }).then(()=>{
+              for (let i = 0; i < this.dataList.length; i++) {
+                if (this.dataList[i].thisAmount == null || this.dataList[i].thisAmount == 0 ) {
+                  return this.$message.error(`第${i + 1}行的本次金额不能为空`);
+                }
+              }
+
+              this.form.billNo = this.dataList.map(item =>{return item.billNo}).join(",")
+
+              if (this.category == 2 && this.financeDisabled) {
+                this.allAmount = 0;
+                this.form.amount = this.form.amount? this.form.amount: 0
+                this.dataList.forEach(e => {
+                  this.allAmount = Number(this.allAmount) + Number(e.thisAmount)
+                })
+                if (this.allAmount == 0 && this.form.amount == 0) {
+                  return this.$message.error('人民币金额不能为空')
+                } else if (Number(this.allAmount) > 0 && (Number(this.form.amount) > Number(this.allAmount))) {
+                  this.form.caseOverPayment = 0;
+                } else if (Number(this.allAmount) > 0 && (Number(this.form.amount) < Number(this.allAmount))) {
+                  this.form.caseOverPayment = Number(this.allAmount) - Number(this.form.amount)
+                  if (Number(this.form.caseOverPayment) > Number(this.form.overPayment)) {
+                    return this.$message.error('溢付款余额不足,无法收费')
+                  }
+                }
+              }
+              const params = {
+                ...this.form,
+                billType:"收费",
+                itemsList:this.dataList
+              }
+              this.buttonLoading = true
+              if(this.financeDisabled){
+                modify(params).then(res =>{
+                  this.$message.success("操作成功!")
+                  this.afterEcho(res.data.data)
+                }).finally(()=>{
+                  this.buttonLoading = false
+                })
+              }else{
+                cancelModify(params).then(res =>{
+                  this.$message.success("操作成功!")
+                  this.afterEcho(res.data.data)
+                }).finally(()=>{
+                  this.buttonLoading = false
+                })
+              }
+            })
+            if(status === true){
+              this.$emit("goBack");
+              this.leaveDetailsKey(this.$route.name)
+            }
+          }
+        })
+      },
+      saveSettlement(type){
+        this.$refs["form"].validate((valid,done) => {
+          done();
+          if(valid){
+            for (let i = 0; i < this.dataList.length; i++) {
+              if (this.dataList[i].thisAmount === (null || "")) {
+                return this.$message.error(`第${i + 1}行的本次金额不能为空`);
+              }
+            }
+
+            this.buttonLoading = true
+            this.form.billNo = this.dataList.map(item =>{return item.billNo}).join(",")
+
+            const params = {
+              ...this.form,
+              billType:"收费",
+              itemsList:this.dataList,
+              settlementType:1
+            }
+
+            // 如果有id解锁,没有跳过
+            // this.form.id && this.unLock({moduleName: 'sf',tableName: 'finance_settlement', billId: this.form.id})
+            saveOrEdit(params).then(res=>{
+              this.$message.success("操作成功!")
+              // this.detailData.disabled = true
+              // this.editDisable = true
+              this.afterEcho(res.data.data, type)
+            }).finally(()=>{
+              this.buttonLoading = false
+            })
+          }})
+      },
+      async afterEcho(data, type){
+        this.form = data;
+        this.financeDisabled = this.form.financeStatus === "待结算"?true:false;
+        // 溢付款余额获取
+        if (this.category == 2) {
+          await getCorpDetail({corpId: this.form.corpId}).then(res => {
+            if (Number(this.form.overPayment) != (res.data.data? res.data.data.balanceOverpaymen: '0.00')) {
+              this.form.overPayment = res.data.data? res.data.data.balanceOverpaymen: '0.00'
+            }
+          })
+        }
+        this.oldForm = Object.assign({},this.form);
+
+        if(this.financeDisabled || !this.editDisable){
+          this.option.column.forEach(item =>{
+            if( item.prop === "remark"){
+              this.$set(item,"disabled",false)
+            }else if( item.prop === "createUserName" ||  item.prop === "createTime" ||  item.prop === "sysNo" || item.prop === "overPayment"){
+              this.$set(item,"disabled",true)
+            }else{
+              this.$set(item,"disabled",false)
+            }
+          })
+        }
+        if(this.financeDisabled === false || this.editDisable){
+          this.option.column.forEach(item =>{
+            if( item.prop === "remark"){
+              this.$set(item,"disabled",false)
+            }else if( item.prop === "createUserName" ||  item.prop === "createTime" ||  item.prop === "sysNo"){
+              this.$set(item,"disabled",true)
+            }else{
+              this.$set(item,"disabled",true)
+            }
+          })
+        }
+
+        if(data.itemsList){
+          this.dataList = data.itemsList
+          this.oldDataList = this.deepClone(data.itemsList)
+        }
+        if (type == '收费') {
+          this.confirmSettlement()
+        }
+      },
+      verificationData(type){
+        if(contrastObj(this.form,this.oldForm) || contrastList(this.dataList,this.oldDataList)
+        ){
+          this.$confirm("数据发生变化,请先提交保存!", "提示", {
+            confirmButtonText: "保存",
+            cancelButtonText: "取消",
+            type: "warning",
+          }).then(() => {
+            this.saveSettlement(type)
+          }).catch(()=>{
+            return false
+          })
+        }else{
+          return true
+        }
+      },
+      backToList(){
+        if(contrastObj(this.form,this.oldForm) || contrastList(this.dataList,this.oldDataList)
+        ){
+          this.$confirm("是否保存当前页面?", "提示", {
+            confirmButtonText: "保存",
+            cancelButtonText: "取消",
+            type: "warning",
+          }).then(() => {
+            this.saveSettlement()
+          }).catch(()=>{
+            !this.editDisable && this.form.id && this.unLock({moduleName: 'sf',tableName: 'finance_settlement', billId: this.form.id})
+            this.$emit("goBack");
+            this.leaveDetailsKey(this.$route.name)
+          })
+        }else{
+          !this.editDisable && this.form.id && this.unLock({moduleName: 'sf',tableName: 'finance_settlement', billId: this.form.id})
+          this.$emit("goBack");
+          this.leaveDetailsKey(this.$route.name)
+        }
+      },
+      // 溢付款更改时
+      caseOverPaymentChange() {
+        if (!this.form.caseOverPayment) this.form.caseOverPayment = 0;
+        if (Number(this.form.caseOverPayment) > Number(this.form.overPayment)) {
+          this.form.caseOverPayment = 0;
+          return this.$message.error('本次使用的溢付款不能超过总溢付款')
+        }
+      },
+      // 发送消息
+      postMessage() {
+        this.messageVisble = true
+        this.$nextTick(() => {
+          this.$refs.messagePost.init()
+        })
+      },
+      closeDialog() {
+        this.messageVisble = false
+      },
+      editHandle() {
+        const data = {
+          moduleName: 'sf',
+          tableName: 'finance_settlement',
+          billId: this.form.id,
+          no: localStorage.getItem('browserID'),
+          billNo: this.form.srcOrderno
+        }
+        this.checkLock(data).then(res => {
+          if (res.data.code == 200) {
+            this.onLock(data).then(response => {
+            })
+            this.inDetailsKey(this.$route.name, {
+              moduleName: 'sf',
+              tableName: 'finance_settlement',
+              billId: this.form.id,
+            })
+            this.detailData.disabled = false;
+            this.editDisable = false;
+            this.buttonLoading = true
+            getDetail(this.form.id).then(data => {
+              this.afterEcho(data.data.data)
+            }).finally(()=>{
+              this.buttonLoading = false
+            })
+          }
+        }).catch(error => {
+        }).finally(() => {
+          this.buttonLoading = false
+        })
+      },
+      getGSName(row) {
+        this.form.belongCompany = row.cname
+        if (this.category == 2) {
+          GYSGetBank(row.id).then(res =>{
+            this.$set(this.form,"bankList",res.data)
+            if (this.form.bankList.length > 0) {
+              this.form.accountNo = this.form.bankList[0].accountNo
+              this.form.accountName = this.form.bankList[0].accountName
+              this.form.accountBank = this.form.bankList[0].accountBank
+              this.form.subjectNumber = this.form.bankList[0].subjectNumber
+            }
+          })
+        }
+      },
+      cellStyle() {
+        return "padding:0;height:40px;";
+      },
+      openReport() {
+        this.statementData = {...this.search};
+        this.switchDialog = !this.switchDialog;
+      },
+      onClose(val) {
+        this.switchDialog = val;
+      },
+      // 跳转页面
+      jumpPage(row, index) {
+        if (this.category == 2) {
+          this.$router.$avueRouter.closeTag("/businessManagement/salesOrder/index");
+          this.$router.push({
+            path: "/businessManagement/salesOrder/index",
+            query: {
+              params: row.srcParentId
+            },
+          });
+        } else if (this.category == 3) {
+          this.$router.$avueRouter.closeTag("/salesManagement/salesContract/index");
+          this.$router.push({
+            path: "/salesManagement/salesContract/index",
+            query: {
+              params: row.srcParentId
+            },
+          });
+        } else if (this.category == 4) {
+          this.$router.$avueRouter.closeTag("/exportTrade/salesContract/index");
+          this.$router.push({
+            path: "/exportTrade/salesContract/index",
+            query: {
+              params: row.srcParentId
+            },
+          });
+        }
+      },
+    }
+  }
+</script>
+
+<style lang="scss" scoped>
+::v-deep .el-form-item {
+  margin-bottom: 0;
+}
+
+.trading-form ::v-deep .el-form-item {
+  margin-bottom: 8px !important;
+}
+.required_fields{
+  color: #F56C6C;
+  display:inline-block;
+  width: 7%
+}
+.upper_right_button{
+  display: flex;
+  position: fixed;
+  right: 12px;
+  top: 47px;
+}
+</style>

+ 86 - 0
src/views/financialManagement/paymentSettlement/configuration/detailsPage.json

@@ -0,0 +1,86 @@
+{
+  "lazy": true,
+  "tip": false,
+  "simplePage": true,
+  "searchShow": true,
+  "addBtn":false,
+  "editBtn":false,
+  "addRowBtn":false,
+  "cellBtn":false,
+  "cancelBtn":false,
+  "refreshBtn": false,
+  "searchMenuSpan": 6,
+  "align": "center",
+  "delBtn":false,
+  "dialogWidth": "60%",
+  "tree": true,
+  "border": true,
+  "index": true,
+  "stripe": true,
+  "selection": false,
+  "menuWidth": 150,
+  "dialogClickModal": false,
+  "showSummary": true,
+  "summaryText": "合计",
+  "sumColumnList": [
+    {
+      "name": "amount",
+      "type": "sum"
+    },
+    {
+      "name": "thisAmount",
+      "type": "sum"
+    }
+  ],
+  "column": [
+    {
+      "label": "合同号",
+      "prop": "srcOrderno",
+      "overHidden": true,
+      "width": 200,
+      "index": 2
+    },
+    {
+      "label": "提单号",
+      "prop": "billNo",
+      "overHidden": true,
+      "width": 200,
+      "index": 3
+    },
+    {
+      "label": "费用名称",
+      "prop": "itemName",
+      "overHidden": true,
+      "width": 200,
+      "index": 4
+    },
+    {
+      "label": "金额",
+      "prop": "amount",
+      "overHidden": true,
+      "width": 150,
+      "index": 7
+    },
+    {
+      "label": "本次金额",
+      "prop": "thisAmount",
+      "overHidden": true,
+      "width": 150,
+      "index": 7
+    },
+    {
+      "label": "币别",
+      "prop": "currency",
+      "index": 7,
+      "width": 120
+    },
+    {
+      "label": "备注",
+      "prop": "remarks",
+      "overHidden": true,
+      "index": 13,
+      "cell": true,
+      "width": 500
+    }
+  ]
+}

+ 178 - 0
src/views/financialManagement/paymentSettlement/configuration/mainList.json

@@ -0,0 +1,178 @@
+{
+  "lazy": true,
+  "tip": false,
+  "searchShow": true,
+  "searchMenuSpan": 24,
+  "dialogWidth": "60%",
+  "align": "center",
+  "height": "auto",
+  "searchSpan": 8,
+  "searchMenuPosition": "right",
+  "border": true,
+  "index": true,
+  "selection": false,
+  "viewBtn": false,
+  "editBtn": false,
+  "delBtn": false,
+  "menuWidth": 80,
+  "dialogClickModal": false,
+  "searchLabelWidth": 120,
+  "searchIcon": true,
+  "searchIndex": 2,
+  "addBtn":false,
+  "stripe": true,
+  "headerAlign": "center",
+  "showSummary": true,
+  "summaryText": "合计",
+  "sumColumnList": [
+    {
+      "name": "amount",
+      "type": "sum"
+    }
+  ],
+  "column": [
+    {
+      "label": "合同号",
+      "prop": "srcOrderno",
+      "overHidden": true,
+      "search": true,
+      "width": 150,
+      "index": 2
+    },
+    {
+      "label": "提单号",
+      "prop": "billNo",
+      "search": true,
+      "overHidden": true,
+      "width": 150,
+      "index": 3
+    },
+    {
+      "label": "往来单位",
+      "prop": "corpId",
+      "search": true,
+      "overHidden": true,
+      "width": 200,
+      "index": 4
+    },
+    {
+      "label": "单据状态",
+      "prop": "financeStatus",
+      "type": "select",
+      "search": true,
+      "overHidden": true,
+      "index": 1,
+      "width": 120,
+      "dicData": [
+        {
+          "label": "待结算",
+          "value":"待结算"
+        },
+        {
+          "label": "结算完成",
+          "value": "结算完成"
+        }
+      ]
+    },
+    {
+      "label": "人民币金额",
+      "prop": "amount",
+      "overHidden": true,
+      "search": true,
+      "width": 120,
+      "index": 5
+    },
+    {
+      "label": "外币金额",
+      "prop": "foreignAmount",
+      "overHidden": true,
+      "width": 120,
+      "index": 5
+    },{
+      "label": "结算日期",
+      "prop": "settlementDate",
+      "overHidden": true,
+      "type": "date",
+      "search": true,
+      "format": "yyyy-MM-dd",
+      "valueFormat": "yyyy-MM-dd",
+      "unlinkPanels": true,
+      "searchRange": true,
+      "width": 150,
+      "index": 6
+    },{
+      "label": "完成时间",
+      "prop": "completionTime",
+      "overHidden": true,
+      "type": "date",
+      "search": true,
+      "format": "yyyy-MM-dd",
+      "valueFormat": "yyyy-MM-dd",
+      "unlinkPanels": true,
+      "searchRange": true,
+      "width": 150,
+      "index": 7
+    },{
+      "label": "银行名称",
+      "prop": "accountBank",
+      "overHidden": true,
+      "width": 150,
+      "index": 8
+    },
+    {
+      "label": "银行户头",
+      "prop": "accountName",
+      "search": true,
+      "overHidden": true,
+      "width": 150,
+      "index": 9
+    },
+    {
+      "label": "银行卡号",
+      "prop": "accountNo",
+      "overHidden": true,
+      "width": 150,
+      "index": 10
+    },
+    {
+      "label": "创建人",
+      "prop": "createUserName",
+      "overHidden": true,
+      "index": 11,
+      "width":100
+    },
+    {
+      "label": "创建日期",
+      "prop": "createTime",
+      "type": "date",
+      "format": "yyyy-MM-dd HH:mm:ss",
+      "overHidden": true,
+      "index": 12,
+      "width":160
+    },
+    {
+      "label": "修改人",
+      "prop": "updateUserName",
+      "overHidden": true,
+      "index": 13,
+      "width":100
+    },
+    {
+      "label": "修改日期",
+      "prop": "updateTime",
+      "type": "date",
+      "format": "yyyy-MM-dd HH:mm:ss",
+      "overHidden": true,
+      "index": 14,
+      "width":160
+    },
+    {
+      "label": "备注",
+      "prop": "remark",
+      "search": true,
+      "overHidden": true,
+      "index": 15,
+      "width": 120
+    }
+  ]
+}

+ 300 - 0
src/views/financialManagement/paymentSettlement/paymentSettle.vue

@@ -0,0 +1,300 @@
+<template>
+  <basic-container v-if="show">
+    <avue-crud :option="option"
+               :data="dataList"
+               ref="crud"
+               v-model="form"
+               :page.sync="page"
+               :search.sync="search"
+               :table-loading="loading"
+               :cell-style="cellStyle"
+               @search-change="searchChange"
+               @search-reset="searchReset"
+               @selection-change="selectionChange"
+               @current-change="currentChange"
+               @size-change="sizeChange"
+               @refresh-change="refreshChange"
+               @saveColumn="saveColumn"
+               @resetColumn="resetColumn"
+               @on-load="onLoad"
+               @search-criteria-switch="searchCriteriaSwitch">
+      <template slot="corpIdSearch">
+        <crop-select v-model="search.corpId"
+                     :refresh="false"
+                     corpType="KG"/>
+      </template>
+      <template slot="menuLeft">
+        <el-button type="primary"
+                   size="small"
+                   icon="el-icon-plus"
+                   @click="addReceipt">创建单据
+        </el-button>
+        <el-button type="warning" size="small" icon="el-icon-top" @click.stop="openExport()">导出</el-button>
+      </template>
+      <template slot-scope="scope" slot="menu">
+        <el-button
+          type="text"
+          size="small"
+          icon="el-icon-delete"
+          @click.stop="rowDel(scope.row, scope.index)"
+        >删除
+        </el-button>
+      </template>
+      <template slot-scope="scope" slot="srcOrderno">
+        <span style="color: #409EFF;cursor: pointer" @click.stop="editOpen(scope.row)">{{ scope.row.srcOrderno }}</span>
+      </template>
+      <template slot-scope="scope" slot="corpId">
+        <span style="color: #409EFF;cursor: pointer" @click.stop="editOpen(scope.row)">{{ scope.row.corpName }}</span>
+      </template>
+    </avue-crud>
+  </basic-container>
+  <detail-page
+    ref="detail"
+    @goBack="goBack"
+    :detailData="detailData"
+    v-else
+  ></detail-page>
+</template>
+
+<script>
+  import option from "./configuration/mainList.json";
+  import {getList ,remove} from "@/api/financialManagement/financialManagement"
+  import detailPage from "./paymentSettleDetailsPage";
+  import {getToken} from "@/util/auth";
+
+  export default {
+    data() {
+      return {
+        loading : false,
+        form: {},
+        search:{},
+        show:true,
+        detailData:{},
+        option: {},
+        parentId:0,
+        dataList: [],
+        page: {
+          pageSize: 10,
+          pagerCount: 5,
+          total: 0,
+        },
+        query:{},
+        configuration:{
+          multipleChoices:false,
+          multiple:false,
+          disabled:false,
+          searchShow:true,
+          collapseTags:false,
+          clearable:true,
+          placeholder:'请点击右边按钮选择',
+          dicData:[]
+        },
+      }
+    },
+    activated() {
+      if(!this.show && !this.$store.getters.paySettle){
+        this.show = true;
+      }
+      setTimeout(() => {
+        if(this.$route.query.params  && this.show){
+          this.detailData={
+            id:this.$route.query.params
+          }
+          this.show = false;
+          this.$store.commit("PAY_IN_DETAIL");
+        }
+      }, 100);
+    },
+    components:{
+      detailPage
+    },
+    async created() {
+      this.option = await this.getColumnData(this.getColumnName(250), option);
+      let i = 0;
+      this.option.column.forEach(item => {
+        if (item.search) i++
+      })
+      if (i % 3 !== 0) {
+        const num = 3 - Number(i % 3)
+        this.option.searchMenuSpan = num * 8;
+        this.option.searchMenuPosition = "right";
+      }
+    },
+    mounted() {
+      // this.option.height = window.innerHeight - 200;
+    },
+    methods: {
+      //新单打开
+      addReceipt(row){
+        this.detailData = {
+          id: row.id,
+          status: 1
+        };
+        this.show = false;
+        this.$store.commit("PAY_IN_DETAIL");
+      },
+      //编辑打开
+      editOpen(row){
+        const data = {
+          moduleName: 'ff',
+          tableName: 'finance_settlement',
+          billId: row.id,
+          no: localStorage.getItem('browserID')
+        }
+        this.checkLock(data).then(res => {
+          if (res.data.code == 200) {
+            this.detailData = {
+              disabled: true,
+              id: row.id
+            };
+            this.show = false;
+            this.$store.commit("PAY_IN_DETAIL");
+          }
+        }).catch(error => {
+          this.detailData = {
+            disabled: true,
+            id: row.id
+          };
+          this.show = false;
+          this.$store.commit("PAY_IN_DETAIL");
+        })
+      },
+      rowDel(row, index, done) {
+        if(row.id){
+          this.$confirm("确定将选择数据删除?", {
+            confirmButtonText: "确定",
+            cancelButtonText: "取消",
+            type: "warning"
+          }).then(() => {
+            remove(row.id).then(res =>{
+              if(res.data.success){
+                this.$message.success("操作成功!");
+                this.onLoad(this.page);
+              }
+            })
+          });
+        }
+      },
+      //点击搜索按钮触发
+      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(val) {
+        this.page.currentPage = val
+      },
+      sizeChange() {
+        console.log('1')
+      },
+      refreshChange(params) {
+        this.onLoad(this.page,params)
+      },
+      paramsAdjustment(params) {
+        params = Object.assign({}, this.search);
+        if (params.settlementDate &&  params.settlementDate.length !==0 ) {  //合同
+          params.settlementStartDate = params.settlementDate[0]+ " " + "00:00:00";
+          params.settlementEndDate = params.settlementDate[1] + " " + "23:59:59";
+          this.$delete(params,'settlementDate')
+        }
+        if (params.completionTime &&  params.completionTime.length !==0 ) {
+          params.completionTimeStart = params.completionTime[0]+ " " + "00:00:00";
+          params.completionTimeEnd = params.completionTime[1] + " " + "23:59:59";
+          this.$delete(params,'completionTime')
+        }
+        return params
+      },
+      onLoad(page, params) {
+        this.loading = true
+        params =  this.paramsAdjustment(params)
+        params.billType = "付费"
+        params.settlementType = 1
+
+        getList(page.currentPage, page.pageSize,params).then(res =>{
+          this.dataList = res.data.data.records
+          this.page.total = res.data.data.total
+          if (this.page.total) {
+            this.option.height = window.innerHeight - 240;
+          }
+        }).finally(()=>{
+          this.loading = false
+        })
+      },
+      searchCriteriaSwitch(type){
+        if (type){
+          this.option.height = this.option.height - 90
+        }else {
+          this.option.height = this.option.height + 90
+        }
+        this.$refs.crud.getTableHeight()
+      },
+
+      goBack() {
+        this.detailData=this.$options.data().detailData
+        this.show = true;
+        this.onLoad(this.page,this.search)
+      },
+      cellStyle() {
+        return "padding:0;height:40px;";
+      },
+      //列保存触发
+      async saveColumn() {
+        const inSave = await this.saveColumnData(
+          this.getColumnName(250),
+          this.option
+        );
+        if (inSave) {
+          this.$message.success("保存成功");
+          //关闭窗口
+          this.$refs.crud.$refs.dialogColumn.columnBox = false;
+        }
+      },
+      async resetColumn() {
+        const inSave = await this.delColumnData(
+          this.getColumnName(250),
+          option
+        );
+        if (inSave) {
+          this.$message.success("重置成功");
+          this.option = option;
+          //关闭窗口
+          this.$refs.crud.$refs.dialogColumn.columnBox = false;
+        }
+      },
+      openExport() {
+        let params = JSON.parse(JSON.stringify(this.search))
+        if (params.settlementDate &&  params.settlementDate.length !==0 ) {  //合同
+          params.settlementStartDate = params.settlementDate[0]+ " " + "00:00:00";
+          params.settlementEndDate = params.settlementDate[1] + " " + "23:59:59";
+          this.$delete(params,'settlementDate')
+        }
+        if (params.completionTime &&  params.completionTime.length !==0 ) {
+          params.completionTimeStart = params.completionTime[0]+ " " + "00:00:00";
+          params.completionTimeEnd = params.completionTime[1] + " " + "23:59:59";
+          this.$delete(params,'completionTime')
+        }
+        params.billType = "付费"
+        params.settlementType = 1
+        console.log(params)
+        const routeData = this.$router.resolve({
+          path: '/api/trade-finance/settlement/expenseExport',      //跳转目标窗口的地址
+          query: {
+            ...params    //括号内是要传递给新窗口的参数
+          }
+        })
+        window.open(routeData.href.slice(1, routeData.href.length) + '&' + `${this.website.tokenHeader}=${getToken()}`);
+      },
+    }
+  }
+</script>
+
+<style scoped>
+
+</style>

+ 823 - 0
src/views/financialManagement/paymentSettlement/paymentSettleDetailsPage.vue

@@ -0,0 +1,823 @@
+<template>
+  <div class="borderless">
+    <div class="customer-head">
+      <div class="customer-back">
+        <el-button type="danger" style="border: none;background: none;color: red" icon="el-icon-arrow-left"
+          @click="backToList">返回列表
+        </el-button>
+        <div class="upper_right_button">
+          <el-button type="primary" size="small" @click="editHandle" v-if="editDisable">编 辑</el-button>
+          <el-button type="warning" class="el-button--small-yh" size="small" :loading="buttonLoading" v-if="form.id"
+            :disabled="!form.id || editDisable" @click.stop="confirmSettlement">{{ financeDisabled ? "付费" : "撤销付费" }}
+          </el-button>
+          <el-button class="el-button--small-yh" type="primary" size="small" :loading="buttonLoading"
+            @click.stop="saveSettlement" :disabled="editDisable">保存数据
+          </el-button>
+        </div>
+      </div>
+    </div>
+    <div class="customer-main">
+      <containerTitle title="基础信息"></containerTitle>
+      <basic-container>
+        <avue-form class="trading-form" ref="form" v-model="form" :option="option">
+          <template slot="caseOverPayment">
+            <el-input placeholder="请输入" clearable v-model="form.caseOverPayment" @change="caseOverPaymentChange"
+              v-input-limit="2" :disabled="dataList.length == 0 || (!financeDisabled && form.id) || editDisable">
+            </el-input>
+          </template>
+          <template slot="corpId">
+            <crop-select v-model="form.corpId" corpType="KG" :disabled="(!financeDisabled && form.id) || editDisable"
+              @getCorpData="returnBack" style="width: 100%"></crop-select>
+          </template>
+          <template slot="salesCompany">
+            <crop-select v-model="form.salesCompany" corpType="GS"
+              :disabled="(!financeDisabled && form.id) || editDisable" @getCorpData="getGSName" style="width: 100%">
+            </crop-select>
+          </template>
+          <template slot="accountNo">
+            <el-select v-model="form.accountNo" placeholder="请选择"
+              :disabled="(!financeDisabled && form.id) || editDisable" @change="accountNoChange" clearable filterable>
+              <el-option v-for="(item, index) in form.bankList" :key="index" :label="item.accountNo"
+                :value="item.accountNo">
+              </el-option>
+            </el-select>
+          </template>
+          <template slot="remark">
+            <el-input type="textarea" v-model="form.remark" size="small" rows="2" autocomplete="off" placeholder="">
+            </el-input>
+          </template>
+        </avue-form>
+      </basic-container>
+      <containerTitle title="明细列表"></containerTitle>
+      <basic-container>
+        <avue-crud :option="itemsOption" :data="dataList" ref="crud" v-model="itemsForm" :page.sync="page"
+          :cell-style="cellStyle" @search-reset="searchReset" @row-update="rowUpdate"
+          @selection-change="selectionChange">
+          <template slot="menuLeft">
+            <el-button type="primary" size="small" :loading="buttonLoading" icon="el-icon-shopping-cart-2"
+              :disabled="!financeButton || editDisable" @click="selectPurchase">选择采购合同
+            </el-button>
+            <el-button class="el-icon-download" type="info" size="small" :disabled="!form.id" @click="openReport">报表打印</el-button>
+          </template>
+          <template slot-scope="{ row,index }" slot="menu">
+            <el-button type="text" size="small" icon="el-icon-edit" :disabled="!financeButton || editDisable"
+              @click.stop="rowCell(row,index)"> {{row.$cellEdit ? '修改完成' : '修改' }}
+            </el-button>
+            <el-button type="text" size="small" icon="el-icon-delete" :disabled="!financeButton || editDisable"
+              @click.stop="rowDel(row,index)">删除
+            </el-button>
+          </template>
+          <template slot="srcOrderno" slot-scope="scope">
+            <span style="color: #409EFF;cursor: pointer"
+              @click="jumpPage(scope.row, scope.index)">{{ scope.row.srcOrderno }}</span>
+          </template>
+          <template slot-scope="{ row }" slot="currency">
+            <el-select v-if="row.$cellEdit" v-model="row.currency" size="small" placeholder="请选择 币别" clearable
+              filterable>
+              <el-option v-for="(item, index) in currencyDic" :key="index" :label="item.dictValue"
+                :value="item.dictValue"></el-option>
+            </el-select>
+            <span v-else>{{ row.currency }}</span>
+          </template>
+          <template slot="thisAmount" slot-scope="{ row }">
+            <span v-if="row.$cellEdit" class="required_fields">*</span>
+            <el-input v-if="row.$cellEdit" v-model="row.thisAmount" style="width: 90%" placeholder="请输入" size="small"
+              @input="thisAmountVerify(row)"
+              oninput='this.value=this.value.replace(/[^(\d.)]/g,"").replace(/^(\d+)\.(\d\d).*$/, "$1.$2")'></el-input>
+            <span v-else>{{ row.thisAmount }}</span>
+          </template>
+        </avue-crud>
+      </basic-container>
+      <el-dialog title="导入采购" append-to-body class="el-dialogDeep" :visible.sync="billDetailDialog" width="60%"
+        :close-on-click-modal="false" :destroy-on-close="true" :close-on-press-escape="false" top="10vh" v-dialog-drag>
+        <bill-detail :params="params" :billType="billType" :flag="1" @closeFun="closeBillDetail"
+          @importProMent="importProMent">
+        </bill-detail>
+      </el-dialog>
+      <!--    报表-->
+      <report-dialog
+          :switchDialog="switchDialog"
+          :reportId="form.id"
+          reportName="付款"
+          @onClose="onClose()"
+      />
+    </div>
+  </div>
+</template>
+
+<script>
+import option from "./configuration/detailsPage.json";
+import { getDetail} from "@/api/financialManagement/financialManagement"
+import { getDetails, modify, cancelModify, saveOrEdit, deleteDetail  } from "@/api/financialManagement/paymentRequest";
+import { contrastObj, contrastList } from "@/util/contrastData";
+import billDetail from "@/components/bill/billDetailList";
+import { getlistBankBy } from "@/api/financialManagement/paymentRequest";
+import { getlistBankBy as GYSGetBank } from "@/api/basicData/configuration"
+import _ from "lodash";
+import { getUserInfo } from "@/api/system/user";
+import { getCorpDetail } from "@/api/maintenance/overpayment";
+import reportDialog from "@/components/report-dialog/main.vue";
+
+export default {
+  name: "paymentDetailsPage",
+  props: {
+    detailData: {
+      type: Object
+    }
+  },
+  data() {
+    return {
+      form: {},
+      switchDialog:false,
+      itemsForm: {},
+      itemsOption: option,
+      billDetailDialog: false,
+      buttonLoading: false,
+      financeDisabled: false,
+      financeButton: true,
+      billType: "申请",
+      params: {},
+      id: "",
+      dataList: [],
+      currencyDic: [],
+      page: {
+        pageSize: 10,
+        pagerCount: 5,
+        total: 0,
+      },
+      query: {},
+      option: {
+        menuBtn: false,
+        labelWidth: 100,
+        column: [
+          {
+            label: '所属公司',
+            prop: 'salesCompany',
+            sort: true,
+            span: 8,
+            rules: [
+              {
+                required: true,
+                message: ' ',
+                trigger: 'blur'
+              }
+            ]
+          },
+          {
+            label: '合同号',
+            prop: 'srcOrderno',
+            span: 8,
+            rules: [
+              {
+                required: false,
+                message: ' ',
+                trigger: 'blur'
+              }
+            ]
+          },
+          {
+            label: '系统号',
+            prop: 'sysNo',
+            span: 8,
+            disabled: true
+          },
+          {
+            label: '银行账号',
+            prop: 'accountNo',
+            span: 8,
+            rules: [
+              {
+                required: false,
+                message: ' ',
+                trigger: 'blur'
+              }
+            ]
+          },
+          {
+            label: '开户银行',
+            prop: 'accountBank',
+            span: 8,
+            rules: [
+              {
+                required: false,
+                message: ' ',
+                trigger: 'blur'
+              }
+            ]
+          }, {
+            label: '银行户头',
+            prop: 'accountName',
+            span: 8,
+            rules: [
+              {
+                required: false,
+                message: ' ',
+                trigger: 'blur'
+              }
+            ]
+          }, {
+            label: '科目编码',
+            prop: 'subjectNumber',
+            span: 8,
+            rules: [
+              {
+                required: false,
+                message: ' ',
+                trigger: 'blur'
+              }
+            ]
+          },
+          {
+            label: '往来单位',
+            prop: 'corpId',
+            sort: true,
+            span: 8,
+            rules: [
+              {
+                required: true,
+                message: ' ',
+                trigger: 'blur'
+              }
+            ]
+          },
+          {
+            label: '付款日期',
+            prop: 'settlementDate',
+            format: "yyyy-MM-dd",
+            valueFormat: "yyyy-MM-dd 00:00:00",
+            span: 8,
+            type: "date",
+            rules: [
+              {
+                required: true,
+                message: ' ',
+                trigger: 'blur'
+              }
+            ]
+          },
+          {
+            label: '制单人',
+            prop: 'createUserName',
+            span: 8,
+            disabled: true,
+            rules: [
+              {
+                required: false,
+                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: false,
+                message: ' ',
+                trigger: 'blur'
+              }
+            ]
+          },
+          {
+            label: '外币金额',
+            prop: 'foreignAmount',
+            span: 8,
+            rules: [
+              {
+                pattern: /(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/,
+                message: ' ',
+                trigger: 'blur'
+              }
+            ]
+          },
+          {
+            label: '使用溢付款',
+            prop: 'caseOverPayment',
+            display: false,
+            span: 8,
+            rules: [
+              {
+                pattern: /(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/,
+                message: ' ',
+                trigger: 'blur'
+              }
+            ]
+          },
+          {
+            label: '溢付款余额',
+            prop: 'overPayment',
+            display: false,
+            disabled: true,
+            span: 8,
+            rules: [
+              {
+                pattern: /(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/,
+                message: ' ',
+                trigger: 'blur'
+              }
+            ]
+          },
+          {
+            label: '制单日期',
+            prop: 'createTime',
+            span: 8,
+            type: "date",
+            disabled: true,
+            rules: [
+              {
+                required: false,
+                message: ' ',
+                trigger: 'blur'
+              }
+            ]
+          },
+          {
+            label: '备注',
+            prop: 'remark',
+            span: 24,
+            minRows: 2,
+            rules: [
+              {
+                required: false,
+                message: ' ',
+                trigger: 'blur'
+              }
+            ]
+          },
+        ],
+      },
+      financeStatusDic: [{
+        label: '正常',
+        value: 0
+      }, {
+        label: '停用',
+        value: 1
+      }],
+      //顶部from数据
+      oldForm: {},
+      oldDataList: [],
+      category: '',
+      allAmount: 0,
+      editDisable: false,
+    }
+  },
+  components: {
+    billDetail,reportDialog
+  },
+  created() {
+    // 人民币金额默认为0
+    this.$set(this.form, "amount", 0)
+    getUserInfo().then(res => {
+      this.category = res.data.data.billType
+      if (this.category == 2) {
+        this.$set(this.form, "overPayment", 0)
+        this.$set(this.form, "caseOverPayment", 0)
+        this.option.column.forEach(item => {
+          if (item.prop == 'caseOverPayment' || item.prop == 'overPayment') {
+            item.display = true
+          }
+          if (item.prop == 'foreignAmount') {
+            item.display = false
+          }
+        })
+      }
+    })
+    //币别
+    this.getWorkDicts("currency").then(res => {
+      this.currencyDic = res.data.data
+    })
+    this.detailData.disabled && (this.editDisable = true)
+    if (this.detailData.id) {
+      this.buttonLoading = true
+      this.id = this.detailData.id;//字符串转数字  超长用BigInt
+      getDetail(this.id).then(res => {
+        this.afterEcho(res.data.data)
+      }).finally(() => {
+        this.buttonLoading = false
+      })
+    } else {
+      this.form.financeStatus = "待结算"
+      this.oldForm.financeStatus = "待结算"
+    }
+
+    if (this.detailData.params) {
+      this.buttonLoading = true
+      getDetails(this.detailData.params).then(res => {
+        delete res.data.data.id;
+        delete res.data.data.sysNo;
+        delete res.data.data.billType;
+        res.data.data.itemsList.map((items) => {
+          delete items.id;
+          items.thisAmount = items.amount
+        })
+        this.afterEcho(res.data.data)
+      }).finally(() => {
+        this.buttonLoading = false
+      })
+    }
+
+  },
+  mounted() {
+
+  },
+  methods: {
+    // 报表
+    openReport() {
+      this.switchDialog = !this.switchDialog;
+    },
+    // 报表关闭
+    onClose(val) {
+      this.switchDialog = val;
+    },
+    //选择客户
+    returnBack(corpValue) {
+      this.corpId = corpValue.id
+      if (this.category != 2) {
+        getlistBankBy(corpValue.id).then(res => {
+          this.$set(this.form, "bankList", res.data)
+        })
+      }
+
+      // 溢付款余额获取
+      if (this.category == 2) {
+        getCorpDetail({ corpId: corpValue.id }).then(res => {
+          this.form.overPayment = res.data.data ? res.data.data.balanceOverpaymen : 0
+        })
+      }
+    },
+    //选择卡号
+    accountNoChange(value) {
+      let isTrue = false
+      this.form.bankList.forEach(item => {
+        if (item.accountNo == value) {
+          this.$set(this.form, "accountBank", item.accountBank)
+          this.$set(this.form, "accountName", item.accountName)
+          this.$set(this.form, "subjectNumber", item.subjectNumber)
+          isTrue = true
+        }
+      })
+      this.$nextTick(() => {
+        if (!isTrue) {
+          this.$set(this.form, 'accountBank', null)
+          this.$set(this.form, 'accountName', null)
+          this.$set(this.form, "subjectNumber", null)
+        }
+      })
+    },
+    //本次金额验证
+    thisAmountVerify(row) {
+      if (parseFloat(row.thisAmount) > parseFloat(row.amount)) {
+        this.$message.warning('本次金额不得大于金额!')
+        this.$set(row, 'thisAmount', '')
+      }
+    },
+    selectPurchase() {
+      if (!this.form.corpId) {
+        this.$message.warning("请先选择客户!")
+        return
+      }
+      this.params = {
+        corpId: this.form.corpId
+      }
+      this.billDetailDialog = true;
+    },
+    closeBillDetail() {
+      this.billDetailDialog = false;
+    },
+    importProMent(list) {
+      list.forEach((item, index) => {
+        item.accId = item.id;
+        item.srcOrderno = item.accSysNo
+        item.billNo = item.srcBillNo
+        item.thisAmount = item.amount
+        delete item.id;
+
+        this.$refs.crud.rowCellAdd(item);
+      })
+      this.$set(this.form, 'srcOrderno', Array.from(new Set(this.dataList.map(item => { if (item.srcOrderno) { return item.srcOrderno } }))).join(','))
+      this.billDetailDialog = false;
+    },
+    rowUpdate(row, index, done) {
+      done(row);
+    },
+    rowCell(row, index) {
+      if (row.$cellEdit == true) {
+        this.$set(row, "$cellEdit", false);
+      } else {
+        this.$set(row, "$cellEdit", true);
+      }
+      // row.$cellEdit = !row.$cellEdit
+    },
+    rowDel(row, index) {
+      if (row.id) {
+          deleteDetail({ids: row.id}).then(res => {
+            this.$message({
+              type: "success",
+              message: "操作成功!"
+            });
+            this.dataList.splice(index, 1);
+          })
+        } else {
+          this.dataList.splice(index, 1);
+        }
+    },
+    searchReset() {
+      console.log('1')
+    },
+    selectionChange() {
+      console.log('1')
+    },
+    confirmSettlement(status) {
+      this.$refs["form"].validate((valid, done) => {
+        done();
+        if (valid && this.verificationData('付费')) {
+          this.$confirm("是否确认" + (this.financeDisabled ? '付费' : '撤销付费'), "提示", {
+            confirmButtonText: "确认",
+            cancelButtonText: "取消",
+            type: "warning",
+          }).then(() => {
+            for (let i = 0; i < this.dataList.length; i++) {
+              if (this.dataList[i].thisAmount == null || this.dataList[i].thisAmount == 0) {
+                return this.$message.error(`第${i + 1}行的本次金额不能为空`);
+              }
+            }
+            this.form.billNo = this.dataList.map(item => { return item.billNo }).join(",")
+
+            if (this.category == 2 && this.financeDisabled) {
+              this.allAmount = 0;
+              this.form.amount = this.form.amount ? this.form.amount : 0
+              this.dataList.forEach(e => {
+                this.allAmount = Number(this.allAmount) + Number(e.thisAmount)
+              })
+              if (this.allAmount == 0 && this.form.amount == 0) {
+                return this.$message.error('人民币金额不能为空')
+              } else if (Number(this.allAmount) > 0 && (Number(this.form.amount) > Number(this.allAmount))) {
+                this.form.caseOverPayment = 0;
+              } else if (Number(this.allAmount) > 0 && (Number(this.form.amount) < Number(this.allAmount))) {
+                this.form.caseOverPayment = Number(this.allAmount) - Number(this.form.amount)
+                if (Number(this.form.caseOverPayment) > Number(this.form.overPayment)) {
+                  return this.$message.error('溢付款余额不足,无法付费')
+                }
+              }
+            }
+            const params = {
+              ...this.form,
+              billType: "付费",
+              itemsList: this.dataList
+            }
+            this.buttonLoading = true
+            if (this.financeButton) {
+              modify(params).then(res => {
+                this.$message.success("操作成功!")
+                this.afterEcho(res.data.data)
+              }).finally(() => {
+                this.buttonLoading = false
+              })
+            } else {
+              cancelModify(params).then(res => {
+                this.$message.success("操作成功!")
+                this.afterEcho(res.data.data)
+              }).finally(() => {
+                this.buttonLoading = false
+              })
+            }
+
+          })
+          if (status === true) {
+            this.$emit("goBack");
+            this.leaveDetailsKey(this.$route.name)
+          }
+        }
+      })
+    },
+    saveSettlement(type) {
+      this.$refs["form"].validate((valid, done) => {
+        if (valid) {
+          for (let i = 0; i < this.dataList.length; i++) {
+            if (this.dataList[i].thisAmount == (null || "")) {
+              return this.$message.error(`第输入${i + 1}行的本次金额`);
+            }
+          }
+
+          this.buttonLoading = true
+          this.form.billNo = this.dataList.map(item => { return item.billNo }).join(",")
+
+          const params = {
+            ...this.form,
+            billType: "付费",
+            itemsList: this.dataList,
+            settlementType: 1
+          }
+          // 如果有id解锁,没有跳过
+          //             this.form.id && this.unLock({moduleName: 'ff',tableName: 'finance_settlement', billId: this.form.id})
+          saveOrEdit(params).then(res => {
+            this.$message.success("操作成功!")
+            // this.detailData.disabled = true
+            // this.editDisable = true
+            this.afterEcho(res.data.data, type)
+            done();
+          }).finally(() => {
+            this.buttonLoading = false
+          })
+        }
+      })
+    },
+    async afterEcho(data, type) {
+      this.form = data;
+      this.financeDisabled = this.form.financeStatus == "待结算" ? true : false;
+      if (this.category == 2) {
+        await getCorpDetail({ corpId: this.form.corpId }).then(res => {
+          if (Number(this.form.overPayment) != (res.data.data ? res.data.data.balanceOverpaymen : '0.00')) {
+            this.form.overPayment = res.data.data ? res.data.data.balanceOverpaymen : '0.00'
+          }
+        })
+      }
+      this.oldForm = Object.assign({}, this.form);
+      //审核状态为空时  说明为新单进来
+      if (this.financeDisabled || !this.editDisable) {
+        this.financeButton = true
+        this.option.column.forEach(item => {
+          if (item.prop === "remark" || item.prop === "settlementDate") {
+            this.$set(item, "disabled", false)
+          } else if (item.prop === "createUserName" || item.prop === "createTime" || item.prop === "sysNo") {
+            this.$set(item, "disabled", true)
+          } else {
+            this.$set(item, "disabled", false)
+          }
+        })
+      }
+      if (!this.financeDisabled || this.editDisable) {
+        this.financeButton = false
+        this.option.column.forEach(item => {
+          if (item.prop === "remark") {
+            this.$set(item, "disabled", false)
+          } else if (item.prop === "createUserName" || item.prop === "createTime" || item.prop === "sysNo") {
+            this.$set(item, "disabled", true)
+          } else {
+            this.$set(item, "disabled", true)
+          }
+        })
+      }
+
+      if (data.itemsList) {
+        this.dataList = data.itemsList
+        this.oldDataList = this.deepClone(data.itemsList)
+      }
+      if (type == '付费') {
+        this.confirmSettlement()
+      }
+    },
+    verificationData(type) {
+      if (contrastObj(this.form, this.oldForm) || contrastList(this.dataList, this.oldDataList)
+      ) {
+        this.$confirm("数据发生变化,请先提交保存!", "提示", {
+          confirmButtonText: "保存",
+          cancelButtonText: "取消",
+          type: "warning",
+        }).then(() => {
+          this.saveSettlement(type)
+        }).catch(() => {
+          return false
+        })
+      } else {
+        return true
+      }
+    },
+    backToList() {
+      if (contrastObj(this.form, this.oldForm) || contrastList(this.dataList, this.oldDataList)
+      ) {
+        this.$confirm("是否保存当前页面?", "提示", {
+          confirmButtonText: "保存",
+          cancelButtonText: "取消",
+          type: "warning",
+        }).then(() => {
+          this.saveSettlement()
+        }).catch(() => {
+          !this.editDisable && this.form.id && this.unLock({ moduleName: 'ff', tableName: 'finance_settlement', billId: this.form.id })
+          this.$emit("goBack");
+          this.leaveDetailsKey(this.$route.name)
+        })
+      } else {
+        !this.editDisable && this.form.id && this.unLock({ moduleName: 'ff', tableName: 'finance_settlement', billId: this.form.id })
+        this.$emit("goBack");
+        this.leaveDetailsKey(this.$route.name)
+      }
+    },
+    // 溢付款更改时
+    caseOverPaymentChange() {
+      if (!this.form.caseOverPayment) this.form.caseOverPayment = 0;
+      if (Number(this.form.caseOverPayment) > Number(this.form.overPayment)) {
+        this.form.caseOverPayment = 0;
+        return this.$message.error('本次使用的溢付款不能超过总溢付款')
+      }
+    },
+    editHandle() {
+      const data = {
+        moduleName: 'ff',
+        tableName: 'finance_settlement',
+        billId: this.form.id,
+        no: localStorage.getItem('browserID'),
+        billNo: this.form.srcOrderno
+      }
+      this.checkLock(data).then(res => {
+        if (res.data.code == 200) {
+          this.onLock(data).then(response => {
+          })
+          this.inDetailsKey(this.$route.name, {
+            moduleName: 'ff',
+            tableName: 'finance_settlement',
+            billId: this.form.id,
+          })
+          this.detailData.disabled = false;
+          this.editDisable = false;
+          this.buttonLoading = true
+          getDetail(this.form.id).then(data => {
+            this.afterEcho(data.data.data)
+          }).finally(() => {
+            this.buttonLoading = false
+          })
+        }
+      }).catch(error => {
+      }).finally(() => {
+        this.buttonLoading = false
+      })
+    },
+    getGSName(row) {
+      this.form.belongCompany = row.cname
+      if (this.category == 2) {
+        GYSGetBank(row.id).then(res => {
+          this.$set(this.form, "bankList", res.data)
+          console.log(res.data)
+          if (this.form.bankList.length > 0) {
+            this.form.accountNo = this.form.bankList[0].accountNo
+            this.form.accountName = this.form.bankList[0].accountName
+            this.form.accountBank = this.form.bankList[0].accountBank
+            this.form.subjectNumber = this.form.bankList[0].subjectNumber
+          }
+        })
+      }
+    },
+    cellStyle() {
+      return "padding:0;height:40px;";
+    },
+    // 跳转页面
+    jumpPage(row, index) {
+      if (this.category == 2) {
+        this.$router.$avueRouter.closeTag("/businessManagement/purchaseOrder/index");
+        this.$router.push({
+          path: "/businessManagement/purchaseOrder/index",
+          query: {
+            params: row.srcParentId
+          },
+        });
+      } else if (this.category == 3) {
+        this.$router.$avueRouter.closeTag("/purchase/contract/index");
+        this.$router.push({
+          path: "/purchase/contract/index",
+          query: {
+            params: row.srcParentId
+          },
+        });
+      } else if (this.category == 4) {
+        this.$router.$avueRouter.closeTag("/exportTrade/purchaseContract/index");
+        this.$router.push({
+          path: "/exportTrade/purchaseContract/index",
+          query: {
+            params: row.srcParentId
+          },
+        });
+      }
+    },
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+::v-deep .el-form-item {
+  margin-bottom: 0;
+}
+
+.trading-form ::v-deep .el-form-item {
+  margin-bottom: 8px !important;
+}
+
+.required_fields {
+  color: #F56C6C;
+  display: inline-block;
+  width: 7%
+}
+
+.upper_right_button {
+  display: flex;
+  position: fixed;
+  right: 12px;
+  top: 47px;
+}
+</style>

+ 16 - 1
src/views/landTransportation/dispatchingCars/detailPage.vue

@@ -26,6 +26,16 @@
         >返回台账
         </el-button>
       </div>
+      <div>
+        <div class="el-button&#45;&#45;small-yh add-customer-btn">
+          <el-button
+              type="warning"
+              size="small"
+              @click="updateFee"
+              v-if="goodsForm.synchronization == 1"
+          >更新费用</el-button>
+        </div>
+      </div>
     </div>
     <containerTitle title="委托信息" style="margin-top: 50px"></containerTitle>
     <basic-container>
@@ -601,7 +611,7 @@ import {
   recordingDetails,
   changeFleet,
   incidentalSubmit, saveFile, getFee, fleetList, conserveDispatch,
-  checkAttachment, sendACarCollection
+  checkAttachment, sendACarCollection, generateBill
 } from "@/api/landTransportation";
 import website from "@/config/website";
 import {getDeptTree} from "@/api/system/dept";
@@ -1641,6 +1651,11 @@ export default {
     this.KeyBoxTwo++
   },
   methods: {
+    updateFee(){
+      generateBill({id:this.goodsForm.id}).then(res=>{
+        this.$message.success("同步成功");
+      })
+    },
     schedulingFileSaving() {
       this.c_button = true
       conserveDispatch({

+ 56 - 8
src/views/salesOrder/detailsPage.vue

@@ -8,16 +8,20 @@
           </el-button>
         </div>
         <div class="add-customer-btn">
+          <el-button v-if="detailData.check" type="primary" size="small" class="el-button--small-yh"
+                     @click.stop="openCheckDialog">
+            审批
+          </el-button>
           <el-button type="info" icon="el-icon-printer" size="small" @click.stop="openReport()">报表打印
           </el-button>
           <el-button type="primary" size="small" v-if="detailData.status == 1 && form.confirmStatus == 0"
-            class="el-button--small-yh " @click.stop="openEdit">编辑
+                     class="el-button--small-yh " @click.stop="openEdit">编辑
           </el-button>
           <el-button type="primary" size="small" v-if="!form.id && detailData.status != 1" @click="editCustomer">
             保存数据
           </el-button>
           <el-button type="primary" size="small" v-if="form.id && detailData.status != 1 && form.confirmStatus == 0"
-            @click="fixSave">
+                     @click="fixSave">
             保存数据
           </el-button>
           <el-button type="primary" size="small" v-if="form.id && detailData.status != 1 && form.confirmStatus == 0"
@@ -120,33 +124,53 @@
           <el-button @click="addressVisible = false" type="primary">确 定</el-button>
         </div>
       </el-dialog>
-      <dictbiz-dialog ref="dictbiz" title="添加单位" code="unit" parentId="1585962784498225154" @closed="getAllWorkDicts">
+      <dictbiz-dialog ref="dictbiz" title="添加单位" code="unit" parentId="1585962784498225154"
+                      @closed="getAllWorkDicts">
       </dictbiz-dialog>
       <report-dialog :switchDialog="switchDialog" :reportId="form.id" reportName="配件系统-销售单" @onClose="onClose()">
       </report-dialog>
     </div>
+    <el-dialog append-to-body title="审批" class="el-dialogDeep" :visible.sync="checkDialog" width="50%"
+               :close-on-click-modal="false" :destroy-on-close="true" :close-on-press-escape="false" v-dialog-drag>
+      <check :checkData="checkData" :checkDetail="false" :idList="[]" @choceCheckFun="choceCheckFun">
+      </check>
+    </el-dialog>
   </div>
 </template>
 
 <script>
-import { optionList } from "./js/optionList";
-import { getDetails, submit, getCorpDetails, remove, getAllgoods, save, fixSave, revoke, collectPayment, getStoragelist } from "@/api/basicData/salesOrder";
+import {optionList} from "./js/optionList";
+import {
+  getDetails,
+  submit,
+  getCorpDetails,
+  remove,
+  getAllgoods,
+  save,
+  fixSave,
+  revoke,
+  collectPayment,
+  getStoragelist,
+  offset
+} from "@/api/basicData/salesOrder";
 import feeInfo from "./components/feeInfo.vue";
 import reportDialog from "@/components/report-dialog/main";
 import { multiply, sum, subtract } from "@/util/calculate";
-import { fdatasync } from "fs";
+import {fdatasync} from "fs";
+import check from "@/components/check/check";
 export default {
   name: "index",
   data() {
     return {
+      checkDialog: false,
+      checkData: {},
       switchDialog: false,
       activeName: 'first',
       loadingBtn: false,
       addressTitle: null,
       addressVisible: false,
       form: {},
-      form2: {
-      },
+      form2: {},
       form3: {
 
       },
@@ -407,9 +431,11 @@ export default {
   },
   components: {
     feeInfo,
+    check,
     reportDialog
   },
   async created() {
+    // console.log(this.detailData)
     this.optionList = await this.getColumnData(
       this.getColumnName(212),
       optionList
@@ -427,6 +453,28 @@ export default {
     });
   },
   methods: {
+    //打开审核
+    openCheckDialog() {
+      offset({id: this.form.id}).then(res => {
+        if (res.data.data == '操作成功') {
+          this.checkData = this.detailData.check;
+          this.checkDialog = true;
+        } else {
+          this.$confirm(res.data.data, {
+            confirmButtonText: "确定",
+            cancelButtonText: "取消",
+            type: "warning"
+          }).then(() => {
+            this.checkData = this.detailData.check;
+            this.checkDialog = true;
+          })
+        }
+      })
+    },
+    //关闭审核
+    choceCheckFun() {
+      this.checkDialog = false;
+    },
     openReport() {
       this.switchDialog = !this.switchDialog;
     },

+ 13 - 4
src/views/salesOrder/index.vue

@@ -53,7 +53,7 @@
     <details-page v-if="!show" @goBack="goBack()" :detailData="detailData" />
   </div>
 </template>
-  
+
 <script>
 import detailsPage from "./detailsPage";
 import { option } from "./js/optionList";
@@ -165,6 +165,16 @@ export default {
         this.editOpen({ id: this.$route.query.orderId }, 1);
       }, 100);
     }
+    if (this.$route.query.check) {
+      this.show = true
+      this.detailData = {
+        id: this.$route.query.check.billId,
+        check: this.$route.query.check,
+        auditId: this.$route.query.check.id,
+      };
+      this.show = false;
+      this.$store.commit("IN_PJXS_STATUS");
+    }
   },
   methods: {
     getAllWorkDicts() {
@@ -283,7 +293,7 @@ export default {
     },
     //返回列表
     goBack() {
-      if (this.$route.query.orderId) {
+      if (this.$route.query.orderId || this.$route.query.check) {
         this.$router.$avueRouter.closeTag(this.$route.fullPath);
         this.$router.push({
           path: "/salesOrder/index"
@@ -297,7 +307,7 @@ export default {
   }
 }
 </script>
-  
+
 <style  lang="scss"  scoped>
 .page-crad ::v-deep .basic-container__card {
   height: 94.2vh;
@@ -334,4 +344,3 @@ export default {
   }
 }
 </style>
-