|
|
|
@ -0,0 +1,792 @@
|
|
|
|
|
<template>
|
|
|
|
|
<div :style="{margin: '0 auto',width:'100%'}">
|
|
|
|
|
<el-row :gutter="15" class="">
|
|
|
|
|
<el-form ref="formRef" :model="dataForm" :rules="dataRule" size="small" label-width="100px" label-position="right"
|
|
|
|
|
:disabled="setting.readonly">
|
|
|
|
|
<template v-if="!loading && formOperates">
|
|
|
|
|
<!-- 具体表单 -->
|
|
|
|
|
<el-col :span="24">
|
|
|
|
|
<div style="padding:15px 0px">
|
|
|
|
|
<span style="color: #409EFF;">▋</span>
|
|
|
|
|
<span style="font-size: 14px;font-weight: 500;color:rgb(102, 102, 102);">单据类型</span>
|
|
|
|
|
</div>
|
|
|
|
|
<div>
|
|
|
|
|
<span style="font-size: 14px;font-weight: 500;color:rgb(102, 102, 102);">
|
|
|
|
|
不同的单据类型,需要选择不同的收货信息。
|
|
|
|
|
</span>
|
|
|
|
|
</div>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="24" v-if="judgeShow('type')">
|
|
|
|
|
<jnpf-form-tip-item label="类型" v-if="judgeShow('type')" prop="type">
|
|
|
|
|
<JnpfRadio v-model="dataForm.type" @change="changeData('type',-1)" :disabled="true"
|
|
|
|
|
optionType="button" direction="horizontal" size="medium" :options="typeOptions" :props="typeProps">
|
|
|
|
|
</JnpfRadio>
|
|
|
|
|
</jnpf-form-tip-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="24">
|
|
|
|
|
<div style="padding:15px 0px">
|
|
|
|
|
<span style="color: #409EFF;">▋</span>
|
|
|
|
|
<span style="font-size: 14px;font-weight: 500;color:rgb(102, 102, 102);">基础信息</span>
|
|
|
|
|
</div>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="8" v-if="judgeShow('code')">
|
|
|
|
|
<jnpf-form-tip-item label="单据编号" v-if="judgeShow('code')" prop="code">
|
|
|
|
|
<JnpfInput v-model="dataForm.code" @change="changeData('code',-1)" placeholder="系统自动生成"
|
|
|
|
|
:disabled="true" readonly :style='{"width":"100%"}'>
|
|
|
|
|
</JnpfInput>
|
|
|
|
|
</jnpf-form-tip-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="8" v-if="judgeShow('settlementId')">
|
|
|
|
|
<jnpf-form-tip-item label="结算单号" v-if="judgeShow('settlementId')" prop="settlementId">
|
|
|
|
|
<JnpfPopupSelect v-model="dataForm.settlementId" @change="changeData('settlementId',-1)" :rowIndex="null"
|
|
|
|
|
:formData="dataForm" :templateJson="interfaceRes.settlementId" placeholder="请选择"
|
|
|
|
|
:disabled="true" propsValue="id" popupWidth="800px" popupTitle="选择数据"
|
|
|
|
|
popupType="dialog" relationField='code' field='settlementId' interfaceId="547745774990039365"
|
|
|
|
|
:pageSize="20" :columnOptions="settlementIdcolumnOptions" clearable :style='{"width":"100%"}'>
|
|
|
|
|
</JnpfPopupSelect>
|
|
|
|
|
</jnpf-form-tip-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="8" v-if="judgeShow('payee')">
|
|
|
|
|
<jnpf-form-tip-item label="收款方" v-if="judgeShow('payee')" prop="payee">
|
|
|
|
|
<JnpfInput v-model="dataForm.payee" @change="changeData('payee',-1)" placeholder="请输入"
|
|
|
|
|
:disabled="true" clearable :style='{"width":"100%"}'>
|
|
|
|
|
</JnpfInput>
|
|
|
|
|
</jnpf-form-tip-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="8" v-if="judgeShow('payer')">
|
|
|
|
|
<jnpf-form-tip-item label="付款方" v-if="judgeShow('payer')" prop="payer">
|
|
|
|
|
<JnpfInput v-model="dataForm.payer" @change="changeData('payer',-1)" placeholder="请输入"
|
|
|
|
|
:disabled="true" clearable :style='{"width":"100%"}'>
|
|
|
|
|
</JnpfInput>
|
|
|
|
|
</jnpf-form-tip-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
|
|
|
|
|
<el-col :span="8" v-if="judgeShow('settlableAmount')">
|
|
|
|
|
<jnpf-form-tip-item label="可结金额" v-if="judgeShow('settlableAmount')" prop="settlableAmount">
|
|
|
|
|
<JnpfInput v-model="dataForm.settlableAmount" @change="changeData('settlableAmount',-1)" placeholder="请输入"
|
|
|
|
|
:disabled="true" addonAfter="元" clearable :style='{"width":"100%"}'>
|
|
|
|
|
</JnpfInput>
|
|
|
|
|
</jnpf-form-tip-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
<!-- <el-col :span="8" v-if="judgeShow('applyAmount')">
|
|
|
|
|
<jnpf-form-tip-item label="申请金额" v-if="judgeShow('applyAmount')" prop="applyAmount">
|
|
|
|
|
<JnpfInput v-model="dataForm.applyAmount" @change="changeData('applyAmount',-1)" placeholder="请输入"
|
|
|
|
|
:disabled="judgeWrite('applyAmount')" addonAfter="元" clearable :style='{"width":"100%"}'>
|
|
|
|
|
</JnpfInput>
|
|
|
|
|
</jnpf-form-tip-item>
|
|
|
|
|
</el-col> -->
|
|
|
|
|
<el-col :span="8" v-if="judgeShow('paymentAmount')">
|
|
|
|
|
<jnpf-form-tip-item label="收付款金额" v-if="judgeShow('paymentAmount')" prop="paymentAmount">
|
|
|
|
|
<JnpfInputNumber v-model="dataForm.paymentAmount" @change="changeData('paymentAmount',-1)" placeholder="请输入"
|
|
|
|
|
:disabled="judgeWrite('paymentAmount')" addonAfter="元" clearable :style='{"width":"100%"}' :max="Number(dataForm.settlableAmount)" min="0">
|
|
|
|
|
</JnpfInputNumber>
|
|
|
|
|
</jnpf-form-tip-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="24" v-if="judgeShow('remark')">
|
|
|
|
|
<jnpf-form-tip-item label="备注" v-if="judgeShow('remark')" prop="remark">
|
|
|
|
|
<JnpfTextarea v-model="dataForm.remark" @change="changeData('remark',-1)" placeholder="请输入"
|
|
|
|
|
:disabled="judgeWrite('remark')" :style='{"width":"100%"}' true type="textarea"
|
|
|
|
|
:autosize='{"minRows":4,"maxRows":4}'>
|
|
|
|
|
</JnpfTextarea>
|
|
|
|
|
</jnpf-form-tip-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="24" v-if="judgeShow('-${html.relationField}')">
|
|
|
|
|
<jnpf-form-tip-item label-width="0">
|
|
|
|
|
<div class="JNPF-common-title">
|
|
|
|
|
<h2>最后结算明细(票据明细)</h2>
|
|
|
|
|
</div>
|
|
|
|
|
<el-table :data="dataForm.cwpaymentsummaryList" size='mini' border>
|
|
|
|
|
<el-table-column type="index" width="50" label="序号" align="center" fixed="left" />
|
|
|
|
|
<el-table-column label="商品" v-if="judgeShow('cwpaymentsummary-productId')" prop="productId" align="center" width="200" fixed="left">
|
|
|
|
|
<template slot="header">
|
|
|
|
|
<span class="required-sign" v-if="judgeRequired('cwpaymentsummaryList-productId')">*</span>商品
|
|
|
|
|
</template>
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<JnpfPopupSelect v-model="scope.row.productId"
|
|
|
|
|
:rowIndex="scope.$index"
|
|
|
|
|
:formData="dataForm" :templateJson="interfaceRes.voucherproductproductId" placeholder="请选择"
|
|
|
|
|
:disabled="true"
|
|
|
|
|
propsValue="id" popupWidth="800px" popupTitle="选择数据" popupType="dialog" relationField='name'
|
|
|
|
|
:field="'productId' + scope.$index" interfaceId="529919666429100229" :pageSize="20"
|
|
|
|
|
:columnOptions="voucherproductproductIdcolumnOptions" clearable :style='{ "width": "100%" }'>
|
|
|
|
|
</JnpfPopupSelect>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column label="规格" v-if="judgeShow('cwpaymentsummary-spec')" prop="spec" align="center" width="150">
|
|
|
|
|
<template slot="header">
|
|
|
|
|
<span class="required-sign" v-if="judgeRequired('cwpaymentsummaryList-spec')">*</span>规格
|
|
|
|
|
</template>
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<JnpfInput v-model="scope.row.spec" @change="changeData('cwpaymentsummary-spec',scope.$index)"
|
|
|
|
|
placeholder="请输入"
|
|
|
|
|
:disabled="true" clearable
|
|
|
|
|
:style='{"width":"100%"}'>
|
|
|
|
|
</JnpfInput>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column label="结算单位" v-if="judgeShow('cwpaymentsummary-settlementUnit')" prop="settlementUnit" align="center" width="150">
|
|
|
|
|
<template slot="header">
|
|
|
|
|
<span class="required-sign" v-if="judgeRequired('cwpaymentsummaryList-settlementUnit')">*</span>结算单位
|
|
|
|
|
</template>
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<JnpfInput v-model="scope.row.settlementUnit"
|
|
|
|
|
@change="changeData('cwpaymentsummary-settlementUnit',scope.$index)" placeholder="请输入"
|
|
|
|
|
:disabled="true"
|
|
|
|
|
clearable :style='{"width":"100%"}'>
|
|
|
|
|
</JnpfInput>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column label="结算数量" v-if="judgeShow('cwpaymentsummary-settlementSum')" prop="settlementSum" align="center" width="150">
|
|
|
|
|
<template slot="header">
|
|
|
|
|
<span class="required-sign" v-if="judgeRequired('cwpaymentsummaryList-settlementSum')">*</span>结算数量
|
|
|
|
|
</template>
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<JnpfInput v-model="scope.row.settlementSum"
|
|
|
|
|
@change="changeData('cwpaymentsummary-settlementSum',scope.$index)" placeholder="请输入"
|
|
|
|
|
:addonAfter="scope.row.settlementUnit" :disabled="true"
|
|
|
|
|
clearable :style='{"width":"100%"}'>
|
|
|
|
|
</JnpfInput>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column label="结算单价(含税)" v-if="judgeShow('cwpaymentsummary-settlementPrice')"
|
|
|
|
|
prop="settlementPrice" align="center" width="200">
|
|
|
|
|
<template slot="header">
|
|
|
|
|
<span class="required-sign"
|
|
|
|
|
v-if="judgeRequired('cwpaymentsummaryList-settlementPrice')">*</span>结算单价(含税)
|
|
|
|
|
</template>
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<JnpfInput v-model="scope.row.settlementPrice"
|
|
|
|
|
@change="changeData('cwpaymentsummary-settlementPrice',scope.$index)" placeholder="请输入"
|
|
|
|
|
:disabled="true"
|
|
|
|
|
:addonAfter="'/' + scope.row.settlementUnit" addonBefore="¥"
|
|
|
|
|
clearable :style='{"width":"100%"}'>
|
|
|
|
|
</JnpfInput>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column label="结算小计(含税)" v-if="judgeShow('cwpaymentsummary-settlementSubtotal')"
|
|
|
|
|
prop="settlementSubtotal" align="center" width="200">
|
|
|
|
|
<template slot="header">
|
|
|
|
|
<span class="required-sign"
|
|
|
|
|
v-if="judgeRequired('cwpaymentsummaryList-settlementSubtotal')">*</span>结算小计(含税)
|
|
|
|
|
</template>
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<JnpfInput v-model="scope.row.settlementSubtotal"
|
|
|
|
|
@change="changeData('cwpaymentsummary-settlementSubtotal',scope.$index)" placeholder="请输入"
|
|
|
|
|
:disabled="true"
|
|
|
|
|
addonBefore="¥"
|
|
|
|
|
clearable :style='{"width":"100%"}'>
|
|
|
|
|
</JnpfInput>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column label="税率" v-if="judgeShow('cwpaymentsummary-settlementSubtotal')"
|
|
|
|
|
prop="settlementSubtotal" align="center" width="200">
|
|
|
|
|
<template slot="header">
|
|
|
|
|
<span class="required-sign"
|
|
|
|
|
v-if="judgeRequired('cwpaymentsummaryList-settlementSubtotal')">*</span>税率
|
|
|
|
|
</template>
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<JnpfInput v-model="scope.row.rate"
|
|
|
|
|
@change="changeData('cwpaymentsummary-settlementSubtotal',scope.$index)" placeholder="请输入"
|
|
|
|
|
:disabled="true"
|
|
|
|
|
addonAfter="%"
|
|
|
|
|
clearable :style='{"width":"100%"}'>
|
|
|
|
|
</JnpfInput>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column label="结算单价(不含税)" v-if="judgeShow('cwpaymentsummary-settlementPriceNo')"
|
|
|
|
|
prop="settlementPriceNo" align="center" width="250">
|
|
|
|
|
<template slot="header">
|
|
|
|
|
<span class="required-sign"
|
|
|
|
|
v-if="judgeRequired('cwpaymentsummaryList-settlementPriceNo')">*</span>结算单价(不含税)
|
|
|
|
|
</template>
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<JnpfInput v-model="scope.row.settlementPriceNo"
|
|
|
|
|
@change="changeData('cwpaymentsummary-settlementPriceNo',scope.$index)" placeholder="请输入"
|
|
|
|
|
:addonAfter="'/' + scope.row.settlementUnit" addonBefore="¥" :disabled="true"
|
|
|
|
|
clearable :style='{"width":"100%"}'>
|
|
|
|
|
</JnpfInput>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column label="结算小计(不含税)" v-if="judgeShow('cwpaymentsummary-settlementSubtotalNo')"
|
|
|
|
|
prop="settlementSubtotalNo" align="center" width="200">
|
|
|
|
|
<template slot="header">
|
|
|
|
|
<span class="required-sign"
|
|
|
|
|
v-if="judgeRequired('cwpaymentsummaryList-settlementSubtotalNo')">*</span>结算小计(不含税)
|
|
|
|
|
</template>
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<JnpfInput v-model="scope.row.settlementSubtotalNo"
|
|
|
|
|
@change="changeData('cwpaymentsummary-settlementSubtotalNo',scope.$index)" placeholder="请输入"
|
|
|
|
|
addonBefore="¥" :disabled="true"
|
|
|
|
|
clearable :style='{"width":"100%"}'>
|
|
|
|
|
</JnpfInput>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column label="其他费用" v-if="judgeShow('cwpaymentsummary-otherType')" prop="otherType" align="center" width="200">
|
|
|
|
|
<template slot="header">
|
|
|
|
|
<span class="required-sign" v-if="judgeRequired('cwpaymentsummaryList-otherType')">*</span>其他费用
|
|
|
|
|
</template>
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<JnpfInput v-model="scope.row.otherExpenses"
|
|
|
|
|
@change="otherTypeChange(scope.row,scope.$index)" placeholder="请输入"
|
|
|
|
|
:disabled="true"
|
|
|
|
|
addonBefore="¥" clearable :style='{"width":"100%"}'>
|
|
|
|
|
</JnpfInput>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column label="结算合计(含税)" v-if="judgeShow('cwpaymentsummary-settlementTotal')"
|
|
|
|
|
prop="settlementTotal" align="center" width="200">
|
|
|
|
|
<template slot="header">
|
|
|
|
|
<span class="required-sign"
|
|
|
|
|
v-if="judgeRequired('cwpaymentsummaryList-settlementTotal')">*</span>结算合计(含税)
|
|
|
|
|
</template>
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<JnpfInput v-model="scope.row.settlementTotal"
|
|
|
|
|
@change="changeData('cwpaymentsummary-settlementTotal',scope.$index)" placeholder="请输入"
|
|
|
|
|
addonBefore="¥" :disabled="true"
|
|
|
|
|
clearable :style='{"width":"100%"}'>
|
|
|
|
|
</JnpfInput>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column label="结算合计(不含税)" v-if="judgeShow('cwpaymentsummary-settlementTotalNo')"
|
|
|
|
|
prop="settlementTotalNo" align="center" width="200">
|
|
|
|
|
<template slot="header">
|
|
|
|
|
<span class="required-sign"
|
|
|
|
|
v-if="judgeRequired('cwpaymentsummaryList-settlementTotalNo')">*</span>结算合计(不含税)
|
|
|
|
|
</template>
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<JnpfInput v-model="scope.row.settlementTotalNo"
|
|
|
|
|
@change="changeData('cwpaymentsummary-settlementTotalNo',scope.$index)" placeholder="请输入"
|
|
|
|
|
addonBefore="¥" :disabled="true"
|
|
|
|
|
clearable :style='{"width":"100%"}'>
|
|
|
|
|
</JnpfInput>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
</el-table>
|
|
|
|
|
<!-- <div class="table-actions" @click="addcwpaymentsummaryList()" v-if="!judgeWrite('cwpaymentsummaryList')">
|
|
|
|
|
<el-button type="text" icon="el-icon-plus">加载票据</el-button>
|
|
|
|
|
</div> -->
|
|
|
|
|
</jnpf-form-tip-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
<!-- 表单结束 -->
|
|
|
|
|
</template>
|
|
|
|
|
<SelectDialog v-if="selectDialogVisible" :config="currTableConf" :formData="dataForm" ref="selectDialog"
|
|
|
|
|
@select="addForSelect" @close="selectDialogVisible=false" />
|
|
|
|
|
</el-form>
|
|
|
|
|
</el-row>
|
|
|
|
|
<UserBox v-if="userBoxVisible" ref="userBox" @submit="submit" />
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
import request from '@/utils/request'
|
|
|
|
|
import {
|
|
|
|
|
mapGetters
|
|
|
|
|
} from "vuex";
|
|
|
|
|
import {
|
|
|
|
|
getFormById
|
|
|
|
|
} from '@/api/workFlow/FormDesign'
|
|
|
|
|
import comMixin from '@/views/workFlow/workFlowForm/mixin';
|
|
|
|
|
import {
|
|
|
|
|
getDataInterfaceRes
|
|
|
|
|
} from '@/api/systemData/dataInterface'
|
|
|
|
|
import {
|
|
|
|
|
getDictionaryDataSelector
|
|
|
|
|
} from '@/api/systemData/dictionary'
|
|
|
|
|
import {
|
|
|
|
|
getDefaultCurrentValueUserId
|
|
|
|
|
} from '@/api/permission/user'
|
|
|
|
|
import {
|
|
|
|
|
getDefaultCurrentValueDepartmentId
|
|
|
|
|
} from '@/api/permission/organize'
|
|
|
|
|
import {
|
|
|
|
|
getDateDay,
|
|
|
|
|
getLaterData,
|
|
|
|
|
getBeforeData,
|
|
|
|
|
getBeforeTime,
|
|
|
|
|
getLaterTime
|
|
|
|
|
} from '@/components/Generator/utils/index.js'
|
|
|
|
|
import {
|
|
|
|
|
thousandsFormat
|
|
|
|
|
} from "@/components/Generator/utils/index"
|
|
|
|
|
export default {
|
|
|
|
|
mixins: [comMixin],
|
|
|
|
|
components: {},
|
|
|
|
|
props: [],
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
|
dataFormSubmitType: 0,
|
|
|
|
|
continueBtnLoading: false,
|
|
|
|
|
index: 0,
|
|
|
|
|
prevDis: false,
|
|
|
|
|
nextDis: false,
|
|
|
|
|
allList: [],
|
|
|
|
|
visible: false,
|
|
|
|
|
loading: false,
|
|
|
|
|
btnLoading: false,
|
|
|
|
|
formRef: 'formRef',
|
|
|
|
|
setting: {},
|
|
|
|
|
eventType: '',
|
|
|
|
|
userBoxVisible: false,
|
|
|
|
|
selectDialogVisible: false,
|
|
|
|
|
currTableConf: {},
|
|
|
|
|
dataValueAll: {},
|
|
|
|
|
addTableConf: {
|
|
|
|
|
cwpaymentsummaryList: {
|
|
|
|
|
"popupType": "dialog",
|
|
|
|
|
"hasPage": true,
|
|
|
|
|
"popupTitle": "选择数据",
|
|
|
|
|
"pageSize": 20,
|
|
|
|
|
"columnOptions": [],
|
|
|
|
|
"interfaceId": "",
|
|
|
|
|
"interfaceName": "",
|
|
|
|
|
"relationOptions": [],
|
|
|
|
|
"templateJson": [],
|
|
|
|
|
"popupWidth": "800px"
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
//可选范围默认值
|
|
|
|
|
ableAll: {},
|
|
|
|
|
tableRows: {
|
|
|
|
|
cwpaymentsummaryList: {
|
|
|
|
|
productId: '',
|
|
|
|
|
productIdOptions: [],
|
|
|
|
|
spec: '',
|
|
|
|
|
specOptions: [],
|
|
|
|
|
settlementUnit: '',
|
|
|
|
|
settlementUnitOptions: [],
|
|
|
|
|
settlementSum: '',
|
|
|
|
|
settlementSumOptions: [],
|
|
|
|
|
settlementPrice: '',
|
|
|
|
|
settlementPriceOptions: [],
|
|
|
|
|
settlementSubtotal: '',
|
|
|
|
|
settlementSubtotalOptions: [],
|
|
|
|
|
settlementPriceNo: '',
|
|
|
|
|
settlementPriceNoOptions: [],
|
|
|
|
|
settlementSubtotalNo: '',
|
|
|
|
|
settlementSubtotalNoOptions: [],
|
|
|
|
|
otherType: '',
|
|
|
|
|
otherTypeOptions: [],
|
|
|
|
|
otherExpenses: '',
|
|
|
|
|
otherExpensesOptions: [],
|
|
|
|
|
settlementTotal: '',
|
|
|
|
|
settlementTotalOptions: [],
|
|
|
|
|
settlementTotalNo: '',
|
|
|
|
|
settlementTotalNoOptions: [],
|
|
|
|
|
remark: '',
|
|
|
|
|
remarkOptions: [],
|
|
|
|
|
enabledmark: undefined
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
Vmodel: "",
|
|
|
|
|
currVmodel: "",
|
|
|
|
|
dataForm: {
|
|
|
|
|
type: "1",
|
|
|
|
|
creatorUserId: undefined,
|
|
|
|
|
creatorTime: undefined,
|
|
|
|
|
lastModifyTime: undefined,
|
|
|
|
|
lastModifyUserId: undefined,
|
|
|
|
|
code: undefined,
|
|
|
|
|
settlementId: undefined,
|
|
|
|
|
payee: undefined,
|
|
|
|
|
payer: undefined,
|
|
|
|
|
payDate: undefined,
|
|
|
|
|
settlableAmount: undefined,
|
|
|
|
|
applyAmount: undefined,
|
|
|
|
|
paymentAmount: undefined,
|
|
|
|
|
remark: undefined,
|
|
|
|
|
cwpaymentsummaryList: [],
|
|
|
|
|
version: 0,
|
|
|
|
|
},
|
|
|
|
|
tableRequiredData: {},
|
|
|
|
|
dataRule: {
|
|
|
|
|
type: [{
|
|
|
|
|
required: true,
|
|
|
|
|
message: '请至少选择一个',
|
|
|
|
|
trigger: 'change'
|
|
|
|
|
}, ],
|
|
|
|
|
settlableAmount: [{
|
|
|
|
|
pattern: /^([1-9][\d]*|0)(\.[\d]+)?$/,
|
|
|
|
|
message: '请输入正确的金额',
|
|
|
|
|
trigger: 'blur'
|
|
|
|
|
}, ],
|
|
|
|
|
applyAmount: [{
|
|
|
|
|
pattern: /^([1-9][\d]*|0)(\.[\d]+)?$/,
|
|
|
|
|
message: '请输入正确的金额',
|
|
|
|
|
trigger: 'blur'
|
|
|
|
|
}, ],
|
|
|
|
|
paymentAmount: [{
|
|
|
|
|
pattern: /^([1-9][\d]*|0)(\.[\d]+)?$/,
|
|
|
|
|
message: '请输入正确的金额',
|
|
|
|
|
trigger: 'blur'
|
|
|
|
|
}, ],
|
|
|
|
|
},
|
|
|
|
|
voucherproductproductIdcolumnOptions: [{ "label": "商品编码", "value": "code" }, { "label": "商品名称", "value": "name" }, { "label": "规格", "value": "spec" },],
|
|
|
|
|
typeOptions: [{
|
|
|
|
|
"fullName": "采购付款",
|
|
|
|
|
"id": "1"
|
|
|
|
|
}, {
|
|
|
|
|
"fullName": "销售付款",
|
|
|
|
|
"id": "2"
|
|
|
|
|
}, {
|
|
|
|
|
"fullName": "其他付款",
|
|
|
|
|
"id": "3"
|
|
|
|
|
}],
|
|
|
|
|
typeProps: {
|
|
|
|
|
"label": "fullName",
|
|
|
|
|
"value": "id"
|
|
|
|
|
},
|
|
|
|
|
settlementIdcolumnOptions: [{
|
|
|
|
|
"label": "结算单号",
|
|
|
|
|
"value": "code"
|
|
|
|
|
}, {
|
|
|
|
|
"label": "类型",
|
|
|
|
|
"value": "type"
|
|
|
|
|
}, {
|
|
|
|
|
"label": "应结金额",
|
|
|
|
|
"value": "payable_amount"
|
|
|
|
|
}, {
|
|
|
|
|
"label": "已结金额",
|
|
|
|
|
"value": "settled_amount"
|
|
|
|
|
}, {
|
|
|
|
|
"label": "可结金额",
|
|
|
|
|
"value": "settlable_amount"
|
|
|
|
|
}, ],
|
|
|
|
|
childIndex: -1,
|
|
|
|
|
isEdit: false,
|
|
|
|
|
interfaceRes: {
|
|
|
|
|
type: [],
|
|
|
|
|
creatorUserId: [],
|
|
|
|
|
creatorTime: [],
|
|
|
|
|
lastModifyTime: [],
|
|
|
|
|
lastModifyUserId: [],
|
|
|
|
|
code: [],
|
|
|
|
|
settlementId: [],
|
|
|
|
|
voucherproductproductId: [],
|
|
|
|
|
payee: [],
|
|
|
|
|
payer: [],
|
|
|
|
|
payDate: [],
|
|
|
|
|
settlableAmount: [],
|
|
|
|
|
applyAmount: [],
|
|
|
|
|
paymentAmount: [],
|
|
|
|
|
remark: [],
|
|
|
|
|
cwpaymentsummaryproductId: [],
|
|
|
|
|
cwpaymentsummaryspec: [],
|
|
|
|
|
cwpaymentsummarysettlementUnit: [],
|
|
|
|
|
cwpaymentsummarysettlementSum: [],
|
|
|
|
|
cwpaymentsummarysettlementPrice: [],
|
|
|
|
|
cwpaymentsummarysettlementSubtotal: [],
|
|
|
|
|
cwpaymentsummarysettlementPriceNo: [],
|
|
|
|
|
cwpaymentsummarysettlementSubtotalNo: [],
|
|
|
|
|
cwpaymentsummaryotherType: [],
|
|
|
|
|
cwpaymentsummaryotherExpenses: [],
|
|
|
|
|
cwpaymentsummarysettlementTotal: [],
|
|
|
|
|
cwpaymentsummarysettlementTotalNo: [],
|
|
|
|
|
cwpaymentsummaryremark: [],
|
|
|
|
|
},
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
computed: {
|
|
|
|
|
formOperates() {
|
|
|
|
|
return this.setting.formOperates
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
watch: {},
|
|
|
|
|
created() {
|
|
|
|
|
this.getFormById()
|
|
|
|
|
if (this.dataForm.id == null || this.dataForm.id == '' && this.dataForm.id == undefined || this.dataForm.id ==
|
|
|
|
|
0) {
|
|
|
|
|
this.initDefaultData()
|
|
|
|
|
}
|
|
|
|
|
this.dataValueAll = JSON.parse(JSON.stringify(this.dataForm))
|
|
|
|
|
},
|
|
|
|
|
mounted() {
|
|
|
|
|
this.initCwpaymentreceiptData();
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
changeData(model, index) {
|
|
|
|
|
this.isEdit = false
|
|
|
|
|
this.childIndex = index
|
|
|
|
|
let modelAll = model.split("-");
|
|
|
|
|
let faceMode = "";
|
|
|
|
|
for (let i = 0; i < modelAll.length; i++) {
|
|
|
|
|
faceMode += modelAll[i];
|
|
|
|
|
}
|
|
|
|
|
for (let key in this.interfaceRes) {
|
|
|
|
|
if (key != faceMode) {
|
|
|
|
|
let faceReList = this.interfaceRes[key]
|
|
|
|
|
for (let i = 0; i < faceReList.length; i++) {
|
|
|
|
|
if (faceReList[i].relationField == model) {
|
|
|
|
|
let options = 'get' + key + 'Options';
|
|
|
|
|
if (this[options]) {
|
|
|
|
|
this[options]()
|
|
|
|
|
}
|
|
|
|
|
this.changeData(key, index)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
changeDataFormData(type, data, model, index, defaultValue) {
|
|
|
|
|
if (!this.isEdit) {
|
|
|
|
|
if (type == 2) {
|
|
|
|
|
for (let i = 0; i < this.dataForm[data].length; i++) {
|
|
|
|
|
if (index == -1) {
|
|
|
|
|
this.dataForm[data][i][model] = defaultValue
|
|
|
|
|
} else if (index == i) {
|
|
|
|
|
this.dataForm[data][i][model] = defaultValue
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
this.dataForm[data] = defaultValue
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
dataAll() {},
|
|
|
|
|
selfGetInfo(dataForm) {
|
|
|
|
|
this.dataInfo(dataForm)
|
|
|
|
|
},
|
|
|
|
|
beforeSubmit() {
|
|
|
|
|
const _data = this.dataList()
|
|
|
|
|
return _data
|
|
|
|
|
},
|
|
|
|
|
selfInit() {
|
|
|
|
|
this.dataAll()
|
|
|
|
|
},
|
|
|
|
|
getFormById() {
|
|
|
|
|
getFormById("547733293450172677").then(res => {
|
|
|
|
|
this.dataForm.flowId = res.data && res.data.flowId
|
|
|
|
|
// this.encode = res.data&&res.data.encode
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
exist() {
|
|
|
|
|
let isOk = true
|
|
|
|
|
for (let key in this.tableRequiredData) {
|
|
|
|
|
if (this.dataForm[key] && Array.isArray(this.dataForm[key])) {
|
|
|
|
|
for (let i = 0; i < this.dataForm[key].length; i++) {
|
|
|
|
|
let item = this.dataForm[key][i]
|
|
|
|
|
inner: for (let id in item) {
|
|
|
|
|
let arr = this.tableRequiredData[key].filter(o => o.id === id) || []
|
|
|
|
|
if (!arr.length) continue inner
|
|
|
|
|
if (arr[0].required) {
|
|
|
|
|
let msg = `${arr[0].name}不能为空`
|
|
|
|
|
let boo = true
|
|
|
|
|
if (arr[0].dataType === 'array') {
|
|
|
|
|
boo = !this.jnpf.isEmptyArray(item[id])
|
|
|
|
|
} else {
|
|
|
|
|
boo = !this.jnpf.isEmpty(item[id])
|
|
|
|
|
}
|
|
|
|
|
if (!boo) {
|
|
|
|
|
this.$message({
|
|
|
|
|
message: msg,
|
|
|
|
|
type: 'error',
|
|
|
|
|
duration: 1000
|
|
|
|
|
})
|
|
|
|
|
isOk = false
|
|
|
|
|
break
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (!this.cwpaymentsummaryExist()) return
|
|
|
|
|
return isOk
|
|
|
|
|
},
|
|
|
|
|
cwpaymentsummaryExist() {
|
|
|
|
|
let isOk = true;
|
|
|
|
|
for (let i = 0; i < this.dataForm.cwpaymentsummaryList.length; i++) {
|
|
|
|
|
const e = this.dataForm.cwpaymentsummaryList[i];
|
|
|
|
|
}
|
|
|
|
|
return isOk;
|
|
|
|
|
},
|
|
|
|
|
clearData() {
|
|
|
|
|
this.dataForm = JSON.parse(JSON.stringify(this.dataValueAll))
|
|
|
|
|
},
|
|
|
|
|
//初始化默认数据
|
|
|
|
|
initDefaultData() {
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
addcwpaymentsummaryList() {
|
|
|
|
|
let item = {
|
|
|
|
|
productId: undefined,
|
|
|
|
|
spec: undefined,
|
|
|
|
|
settlementUnit: undefined,
|
|
|
|
|
settlementSum: undefined,
|
|
|
|
|
settlementPrice: undefined,
|
|
|
|
|
settlementSubtotal: undefined,
|
|
|
|
|
settlementPriceNo: undefined,
|
|
|
|
|
settlementSubtotalNo: undefined,
|
|
|
|
|
otherType: undefined,
|
|
|
|
|
otherExpenses: undefined,
|
|
|
|
|
settlementTotal: undefined,
|
|
|
|
|
settlementTotalNo: undefined,
|
|
|
|
|
remark: undefined,
|
|
|
|
|
}
|
|
|
|
|
this.getcwpaymentsummaryList(item)
|
|
|
|
|
},
|
|
|
|
|
delcwpaymentsummaryList(index) {
|
|
|
|
|
this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
|
|
|
|
|
type: 'warning'
|
|
|
|
|
}).then(() => {
|
|
|
|
|
this.dataForm.cwpaymentsummaryList.splice(index, 1);
|
|
|
|
|
}).catch(() => {});
|
|
|
|
|
},
|
|
|
|
|
getcwpaymentsummaryList(value) {
|
|
|
|
|
let item = {
|
|
|
|
|
...this.tableRows.cwpaymentsummaryList,
|
|
|
|
|
...value
|
|
|
|
|
}
|
|
|
|
|
this.dataForm.cwpaymentsummaryList.push(item)
|
|
|
|
|
this.childIndex = this.dataForm.cwpaymentsummaryList.length - 1
|
|
|
|
|
this.isEdit = true
|
|
|
|
|
this.isEdit = false
|
|
|
|
|
this.childIndex = -1
|
|
|
|
|
},
|
|
|
|
|
openSelectDialog(key) {
|
|
|
|
|
this.currTableConf = this.addTableConf[key]
|
|
|
|
|
this.currVmodel = key
|
|
|
|
|
this.selectDialogVisible = true
|
|
|
|
|
this.$nextTick(() => {
|
|
|
|
|
this.$refs.selectDialog.init()
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
addForSelect(data) {
|
|
|
|
|
for (let i = 0; i < data.length; i++) {
|
|
|
|
|
let t = data[i]
|
|
|
|
|
if (this['get' + this.currVmodel]) {
|
|
|
|
|
this['get' + this.currVmodel](t)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
dateTime(timeRule, timeType, timeTarget, timeValueData, dataValue) {
|
|
|
|
|
let timeDataValue = null;
|
|
|
|
|
let timeValue = Number(timeValueData)
|
|
|
|
|
if (timeRule) {
|
|
|
|
|
if (timeType == 1) {
|
|
|
|
|
timeDataValue = timeValue
|
|
|
|
|
} else if (timeType == 2) {
|
|
|
|
|
timeDataValue = dataValue
|
|
|
|
|
} else if (timeType == 3) {
|
|
|
|
|
timeDataValue = new Date().getTime()
|
|
|
|
|
} else if (timeType == 4) {
|
|
|
|
|
let previousDate = '';
|
|
|
|
|
if (timeTarget == 1 || timeTarget == 2) {
|
|
|
|
|
previousDate = getDateDay(timeTarget, timeType, timeValue)
|
|
|
|
|
timeDataValue = new Date(previousDate).getTime()
|
|
|
|
|
} else if (timeTarget == 3) {
|
|
|
|
|
previousDate = getBeforeData(timeValue)
|
|
|
|
|
timeDataValue = new Date(previousDate).getTime()
|
|
|
|
|
} else {
|
|
|
|
|
timeDataValue = getBeforeTime(timeTarget, timeValue).getTime()
|
|
|
|
|
}
|
|
|
|
|
} else if (timeType == 5) {
|
|
|
|
|
let previousDate = '';
|
|
|
|
|
if (timeTarget == 1 || timeTarget == 2) {
|
|
|
|
|
previousDate = getDateDay(timeTarget, timeType, timeValue)
|
|
|
|
|
timeDataValue = new Date(previousDate).getTime()
|
|
|
|
|
} else if (timeTarget == 3) {
|
|
|
|
|
previousDate = getLaterData(timeValue)
|
|
|
|
|
timeDataValue = new Date(previousDate).getTime()
|
|
|
|
|
} else {
|
|
|
|
|
timeDataValue = getLaterTime(timeTarget, timeValue).getTime()
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return timeDataValue;
|
|
|
|
|
},
|
|
|
|
|
time(timeRule, timeType, timeTarget, timeValue, formatType, dataValue) {
|
|
|
|
|
let format = formatType == 'HH:mm' ? 'HH:mm:00' : formatType
|
|
|
|
|
let timeDataValue = null
|
|
|
|
|
if (timeRule) {
|
|
|
|
|
if (timeType == 1) {
|
|
|
|
|
timeDataValue = timeValue || '00:00:00'
|
|
|
|
|
if (timeDataValue.split(':').length == 3) {
|
|
|
|
|
timeDataValue = timeDataValue
|
|
|
|
|
} else {
|
|
|
|
|
timeDataValue = timeDataValue + ':00'
|
|
|
|
|
}
|
|
|
|
|
} else if (timeType == 2) {
|
|
|
|
|
timeDataValue = dataValue
|
|
|
|
|
} else if (timeType == 3) {
|
|
|
|
|
timeDataValue = this.jnpf.toDate(new Date(), format)
|
|
|
|
|
} else if (timeType == 4) {
|
|
|
|
|
let previousDate = '';
|
|
|
|
|
previousDate = getBeforeTime(timeTarget, timeValue)
|
|
|
|
|
timeDataValue = this.jnpf.toDate(previousDate, format)
|
|
|
|
|
} else if (timeType == 5) {
|
|
|
|
|
let previousDate = '';
|
|
|
|
|
previousDate = getLaterTime(timeTarget, timeValue)
|
|
|
|
|
timeDataValue = this.jnpf.toDate(previousDate, format)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return timeDataValue;
|
|
|
|
|
},
|
|
|
|
|
dataList() {
|
|
|
|
|
var _data = this.dataForm;
|
|
|
|
|
return _data;
|
|
|
|
|
},
|
|
|
|
|
dataInfo(dataAll) {
|
|
|
|
|
let _dataAll = dataAll
|
|
|
|
|
this.dataForm = _dataAll
|
|
|
|
|
this.isEdit = true
|
|
|
|
|
this.dataAll()
|
|
|
|
|
for (let i = 0; i < _dataAll.cwpaymentsummaryList.length; i++) {
|
|
|
|
|
this.childIndex = i
|
|
|
|
|
}
|
|
|
|
|
this.childIndex = -1
|
|
|
|
|
},
|
|
|
|
|
initCwpaymentreceiptData(){
|
|
|
|
|
const data = this.setting.selectData
|
|
|
|
|
if(data){
|
|
|
|
|
request({
|
|
|
|
|
url: `/api/scm/Cwsettlement/${data.id}`,
|
|
|
|
|
method: 'GET'
|
|
|
|
|
}).then(res => {
|
|
|
|
|
this.dataForm.settlementId = res.data.id;
|
|
|
|
|
this.dataForm.settlementCode = res.data.code;
|
|
|
|
|
this.dataForm.type = res.data.type;
|
|
|
|
|
this.dataForm.settlableAmount = res.data.settlableAmount;
|
|
|
|
|
this.dataForm.paymentAmount = res.data.settlableAmount;
|
|
|
|
|
this.dataForm.payee = res.data.cwsettlementpaymentreceiptList[1].name;
|
|
|
|
|
this.dataForm.payer = res.data.cwsettlementpaymentreceiptList[0].name;
|
|
|
|
|
this.dataForm.cwpaymentsummaryList = res.data.cwsettlementsummaryList;
|
|
|
|
|
/* this.dataForm.cwpaymentsummaryList.forEach(item => {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
`settlement_sum` decimal(32,6) DEFAULT NULL COMMENT '结算数量',
|
|
|
|
|
`settlement_price` decimal(32,6) DEFAULT NULL COMMENT '结算单价(含税)',
|
|
|
|
|
`settlement_subtotal` decimal(32,6) DEFAULT NULL COMMENT '结算小计(含税)',
|
|
|
|
|
`rate` varchar(255) DEFAULT NULL COMMENT '税率',
|
|
|
|
|
`settlement_price_no` decimal(32,6) DEFAULT NULL COMMENT '结算单价(不含税)',
|
|
|
|
|
`settlement_subtotal_no` decimal(32,6) DEFAULT NULL COMMENT '结算小计(不含税)',
|
|
|
|
|
`other_type` char(1) DEFAULT NULL COMMENT '其他费用类型(1:增加(+) 2:减少(-))',
|
|
|
|
|
`other_expenses` decimal(32,6) DEFAULT NULL COMMENT '其他费用',
|
|
|
|
|
`settlement_total` decimal(32,6) DEFAULT NULL COMMENT '结算合计(含税)',
|
|
|
|
|
`settlement_total_no` decimal(32,6) DEFAULT NULL COMMENT '结算合计(不含税)',
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//费用单总价/数量总和 = 单价增加量(含税单价)
|
|
|
|
|
item.settlementPrice = this.jnpf.floatAdd(item.settlementPrice, this.jnpf.floatDiv(costAmount, summarySettlementSum));//汇总结算含税单价
|
|
|
|
|
//结算小计(含税)=含税单价*数量
|
|
|
|
|
item.settlementSubtotal = this.jnpf.floatMul(item.settlementPrice, item.settlementSum)
|
|
|
|
|
//结算合计(含税)= 结算小计+其他费用
|
|
|
|
|
item.settlementTotal = item.settlementSubtotal + item.otherExpenses
|
|
|
|
|
//结算单价(不含税)
|
|
|
|
|
item.settlementPriceNo = this.jnpf.floatDiv(Number(item.settlementPrice), this.jnpf.floatDiv(this.jnpf.floatAdd(100 + Number(item.rate)), 100));
|
|
|
|
|
//结算小计(不含税)
|
|
|
|
|
item.settlementSubtotalNo = this.jnpf.floatMul(Number(item.settlementSum), Number(item.settlementPriceNo));
|
|
|
|
|
//应收/应付合计(含税)
|
|
|
|
|
settlementAmount = this.jnpf.floatAdd(settlementAmount, item.settlementTotal);
|
|
|
|
|
}) */
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
}
|
|
|
|
|
</script>
|