|
@@ -0,0 +1,767 @@
|
|
|
+<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="warning"
|
|
|
+ class="el-button--small-yh"
|
|
|
+ size="small"
|
|
|
+ :loading="buttonLoading"
|
|
|
+ :disabled="!form.id"
|
|
|
+ @click.stop="confirmSettlement"
|
|
|
+ >{{financeButton?"付费":"撤销付费"}}
|
|
|
+ </el-button>
|
|
|
+ <el-button class="el-button--small-yh"
|
|
|
+ type="primary"
|
|
|
+ size="small"
|
|
|
+ :loading="buttonLoading"
|
|
|
+ @click.stop="saveSettlement"
|
|
|
+ >保存数据
|
|
|
+ </el-button>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <el-tabs v-model="activeName" @tab-click="handleClick" style="padding: 3% 0 0 1%;background: #FFFFFF">
|
|
|
+ <el-tab-pane label="费用明细" name="first" :key="'first'">
|
|
|
+ </el-tab-pane>
|
|
|
+ <el-tab-pane label="开票信息" name="second" :key="'second'">
|
|
|
+ </el-tab-pane>
|
|
|
+ </el-tabs>
|
|
|
+
|
|
|
+ <div class="customer-main" style="margin-top: 1px" v-if="show">
|
|
|
+ <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 && form.id"
|
|
|
+ @getCorpData="returnBack"
|
|
|
+ style="width: 100%"
|
|
|
+ ></crop-select>
|
|
|
+ </template>
|
|
|
+ <template slot="accountNo">
|
|
|
+ <el-select v-model="form.accountNo"
|
|
|
+ placeholder="请选择"
|
|
|
+ :disabled="!financeDisabled && form.id"
|
|
|
+ @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"
|
|
|
+ @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"
|
|
|
+ @click="selectPurchase">选择采购合同
|
|
|
+ </el-button>
|
|
|
+ </template>
|
|
|
+ <template slot-scope="scope" slot="menu">
|
|
|
+ <el-button
|
|
|
+ type="text"
|
|
|
+ size="small"
|
|
|
+ icon="el-icon-edit"
|
|
|
+ :disabled="!financeButton"
|
|
|
+ @click.stop="rowCell(scope.row,scope.index)"
|
|
|
+ > {{ scope.row.$cellEdit ? '修改完成' : '修改' }}
|
|
|
+ </el-button>
|
|
|
+ <el-button
|
|
|
+ type="text"
|
|
|
+ size="small"
|
|
|
+ icon="el-icon-delete"
|
|
|
+ :disabled="!financeButton"
|
|
|
+ @click.stop="rowDel(scope.row,scope.index)"
|
|
|
+ >删除
|
|
|
+ </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"
|
|
|
+ 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"
|
|
|
+ @closeFun="closeBillDetail"
|
|
|
+ @importProMent="importProMent"
|
|
|
+ >
|
|
|
+ </bill-detail>
|
|
|
+ </el-dialog>
|
|
|
+ </div>
|
|
|
+ <div class="customer-main" style="margin-top: 1px" v-if="!show">
|
|
|
+ <containerTitle title="开票信息"></containerTitle>
|
|
|
+ <basic-container>
|
|
|
+ <avue-form class="trading-form" ref="forms" v-model="forms" :option="options">
|
|
|
+ </avue-form>
|
|
|
+ </basic-container>
|
|
|
+ <containerTitle title="明细列表"></containerTitle>
|
|
|
+ <basic-container>
|
|
|
+ <avue-crud :option="itemsOptions"
|
|
|
+ :data="dataLists"
|
|
|
+ ref="cruds"
|
|
|
+ v-model="itemsForms"
|
|
|
+ @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"
|
|
|
+ @click="">录入
|
|
|
+ </el-button>
|
|
|
+ </template>
|
|
|
+ <template slot-scope="scope" slot="menu">
|
|
|
+ <el-button
|
|
|
+ type="text"
|
|
|
+ size="small"
|
|
|
+ icon="el-icon-edit"
|
|
|
+ :disabled="!financeButton"
|
|
|
+ @click.stop="rowCell(scope.row,scope.index)"
|
|
|
+ > {{ scope.row.$cellEdit ? '修改完成' : '修改' }}
|
|
|
+ </el-button>
|
|
|
+ <el-button
|
|
|
+ type="text"
|
|
|
+ size="small"
|
|
|
+ icon="el-icon-delete"
|
|
|
+ :disabled="!financeButton"
|
|
|
+ @click.stop="rowDel(scope.row,scope.index)"
|
|
|
+ >删除
|
|
|
+ </el-button>
|
|
|
+ </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"
|
|
|
+ @closeFun="closeBillDetail"
|
|
|
+ @importProMent="importProMent"
|
|
|
+ >
|
|
|
+ </bill-detail>
|
|
|
+ </el-dialog>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+ import option from "./configuration/detailsPage.json";
|
|
|
+ import options from "./configuration/invoicepage.json";
|
|
|
+ import { getDetail,editFinance } from "@/api/financialManagement/financialManagement"
|
|
|
+ import { getDetails,modify,cancelModify,saveOrEdit } from "@/api/financialManagement/paymentRequest";
|
|
|
+ import { contrastObj,contrastList } from "@/util/contrastData";
|
|
|
+ import billDetail from "@/components/bill/billDetailList";
|
|
|
+ import { getlistBankBy } from "@/api/financialManagement/paymentRequest";
|
|
|
+ import _ from "lodash";
|
|
|
+
|
|
|
+ export default {
|
|
|
+ name: "outputInvoiceDetailsPage",
|
|
|
+ props: {
|
|
|
+ detailData: {
|
|
|
+ type: Object
|
|
|
+ }
|
|
|
+ },
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ form: {},
|
|
|
+ itemsForm:{},
|
|
|
+ show:true,
|
|
|
+ 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: 'sysNo',
|
|
|
+ span: 8,
|
|
|
+ disabled: true
|
|
|
+ },{
|
|
|
+ label: '合同号',
|
|
|
+ prop: 'srcOrderno',
|
|
|
+ span: 8,
|
|
|
+ rules: [
|
|
|
+ {
|
|
|
+ required: false,
|
|
|
+ message: ' ',
|
|
|
+ trigger: 'blur'
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ }, {
|
|
|
+ label: '往来单位',
|
|
|
+ prop: 'corpId',
|
|
|
+ sort:true,
|
|
|
+ span: 8,
|
|
|
+ rules: [
|
|
|
+ {
|
|
|
+ required: true,
|
|
|
+ message: ' ',
|
|
|
+ trigger: 'blur'
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ {
|
|
|
+ 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: '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: 'settlementDate',
|
|
|
+ format:"yyyy-MM-dd",
|
|
|
+ valueFormat:"yyyy-MM-dd 00:00:00",
|
|
|
+ span: 8,
|
|
|
+ type:"date",
|
|
|
+ rules: [
|
|
|
+ {
|
|
|
+ required: false,
|
|
|
+ message: ' ',
|
|
|
+ trigger: 'blur'
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '制单人',
|
|
|
+ prop: 'createUserName',
|
|
|
+ span: 8,
|
|
|
+ disabled:true,
|
|
|
+ rules: [
|
|
|
+ {
|
|
|
+ required: false,
|
|
|
+ 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:[],
|
|
|
+
|
|
|
+ activeName:'first',
|
|
|
+ forms:{},
|
|
|
+ options:{
|
|
|
+ menuBtn: false,
|
|
|
+ labelWidth: 100,
|
|
|
+ column: [
|
|
|
+ {
|
|
|
+ label: '发票号',
|
|
|
+ prop: 'sysNo',
|
|
|
+ span: 8,
|
|
|
+ },{
|
|
|
+ label: '开票日期',
|
|
|
+ prop: 'srcOrderno',
|
|
|
+ span: 8,
|
|
|
+ rules: [
|
|
|
+ {
|
|
|
+ required: false,
|
|
|
+ message: ' ',
|
|
|
+ trigger: 'blur'
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ }, {
|
|
|
+ label: '开票抬头',
|
|
|
+ prop: 'corpId',
|
|
|
+ sort:true,
|
|
|
+ span: 8,
|
|
|
+ rules: [
|
|
|
+ {
|
|
|
+ required: true,
|
|
|
+ message: ' ',
|
|
|
+ trigger: 'blur'
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ {
|
|
|
+ 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'
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ },
|
|
|
+ itemsOptions: options,
|
|
|
+ }
|
|
|
+ },
|
|
|
+ components:{
|
|
|
+ billDetail
|
|
|
+ },
|
|
|
+ created() {
|
|
|
+ //币别
|
|
|
+ this.getWorkDicts("currency").then(res =>{
|
|
|
+ this.currencyDic = res.data.data
|
|
|
+ })
|
|
|
+
|
|
|
+ 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: {
|
|
|
+ handleClick(tab){
|
|
|
+ if(tab.name === "first"){
|
|
|
+ this.show = true
|
|
|
+ }else{
|
|
|
+ this.show = false
|
|
|
+ }
|
|
|
+ },
|
|
|
+ //选择客户
|
|
|
+ returnBack(corpValue){
|
|
|
+ this.corpId = corpValue.id
|
|
|
+ getlistBankBy(corpValue.id).then(res =>{
|
|
|
+ this.$set(this.form,"bankList",res.data)
|
|
|
+ })
|
|
|
+ },
|
|
|
+ //选择卡号
|
|
|
+ accountNoChange(value){
|
|
|
+ this.form.bankList.forEach(item =>{
|
|
|
+ if(item.accountNo == value){
|
|
|
+ this.$set(this.form,"accountBank",item.accountBank)
|
|
|
+ this.$set(this.form,"accountName",item.accountName)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ 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
|
|
|
+ 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){
|
|
|
+ this.$refs.crud.rowCell(row, index)
|
|
|
+ // row.$cellEdit = !row.$cellEdit
|
|
|
+ },
|
|
|
+ rowDel(row,index){
|
|
|
+ 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("是否确认付费?", "提示", {
|
|
|
+ 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.buttonLoading = true
|
|
|
+ this.form.billNo = this.dataList.map(item =>{return item.billNo}).join(",")
|
|
|
+
|
|
|
+ const params = {
|
|
|
+ ...this.form,
|
|
|
+ billType:"付费",
|
|
|
+ itemsList:this.dataList
|
|
|
+ }
|
|
|
+ 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");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ saveSettlement(){
|
|
|
+ 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
|
|
|
+ }
|
|
|
+
|
|
|
+ saveOrEdit(params).then(res=>{
|
|
|
+ this.$message.success("操作成功!")
|
|
|
+ this.afterEcho(res.data.data)
|
|
|
+ done();
|
|
|
+ }).finally(()=>{
|
|
|
+ this.buttonLoading = false
|
|
|
+ })
|
|
|
+ }})
|
|
|
+ },
|
|
|
+ afterEcho(data){
|
|
|
+ this.form = data;
|
|
|
+ this.oldForm = Object.assign({},data);
|
|
|
+ this.financeDisabled = this.form.financeStatus == "待结算"?true:false;
|
|
|
+ //审核状态为空时 说明为新单进来
|
|
|
+ if(this.financeDisabled){
|
|
|
+ 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)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ else{
|
|
|
+ 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)
|
|
|
+ }
|
|
|
+ },
|
|
|
+ verificationData(){
|
|
|
+ if(contrastObj(this.form,this.oldForm) || contrastList(this.dataList,this.oldDataList)
|
|
|
+ ){
|
|
|
+ this.$confirm("数据发生变化,请先提交保存!", "提示", {
|
|
|
+ confirmButtonText: "保存",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning",
|
|
|
+ }).then(() => {
|
|
|
+ this.saveSettlement()
|
|
|
+ }).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.$emit("goBack");
|
|
|
+ })
|
|
|
+ }else{
|
|
|
+ this.$emit("goBack");
|
|
|
+ }
|
|
|
+ },
|
|
|
+ }
|
|
|
+ }
|
|
|
+</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>
|