commit
This commit is contained in:
+23
-19
@@ -36,6 +36,13 @@ layout("/layouts/platform.html"){
|
||||
.invoice-file-name:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
.invoice-field-title {
|
||||
color: #606266;
|
||||
font-size: 14px;
|
||||
line-height: 22px;
|
||||
margin-bottom: 6px;
|
||||
}
|
||||
</style>
|
||||
|
||||
<div id="app" v-cloak>
|
||||
@@ -509,26 +516,23 @@ layout("/layouts/platform.html"){
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="报销金额" prop="money">
|
||||
<div class="invoice-field-title">报销金额</div>
|
||||
<el-input v-model="formData.money" placeholder="自动汇总发票金额" readonly></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="发票张数" prop="invoiceNumber">
|
||||
<div class="invoice-field-title">发票张数</div>
|
||||
<el-input v-model="formData.invoiceNumber" placeholder="自动统计发票数量" readonly></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item prop="paymentNotes" label="支付内容">
|
||||
<div class="invoice-field-title">支付内容</div>
|
||||
<el-input maxlength="500" v-model="formData.paymentNotes" placeholder="请填写支付内容"
|
||||
type="textarea" :autosize="{ minRows: 4, maxRows: 8}"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item prop="notes" label="备注">
|
||||
<el-input maxlength="500" v-model="formData.notes" placeholder="补充说明"
|
||||
type="textarea" :autosize="{ minRows: 3, maxRows: 6}"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<div class="invoice-toolbar">
|
||||
<div>
|
||||
@@ -714,7 +718,6 @@ layout("/layouts/platform.html"){
|
||||
condolenceTime: [{required: true, message: "请选择慰问时间", trigger: ["change", "blur"]}],
|
||||
// invoiceNumber: [{required: true, message: "请填写发票张数", trigger: ["change", "blur"]}],
|
||||
// invoice: [{required: true, message: "请填写发票号码", trigger: ["change", "blur"]}],
|
||||
paymentNotes: [{required: true, message: "请填写支付内容", trigger: ["change", "blur"]}],
|
||||
activityName: [{required: true, message: "请填写活动名称", trigger: ["change", "blur"]}],
|
||||
money: [{required: true, message: "请填写报销金额", trigger: ["change", "blur"]}],
|
||||
mobile: [
|
||||
@@ -756,7 +759,7 @@ layout("/layouts/platform.html"){
|
||||
},
|
||||
computed: {
|
||||
showInvoiceTab() {
|
||||
return this.formData.reimburseProject !== "UNION_REIMBURSE_PROJECT_1"
|
||||
return !!this.formData.reimburseProject
|
||||
},
|
||||
bankHistoryUserNames() {
|
||||
const userNameMap = {}
|
||||
@@ -999,14 +1002,14 @@ layout("/layouts/platform.html"){
|
||||
this.$set(this.formData, "condolenceMoney", parseFloat(money).toFixed(2))
|
||||
this.$set(this.formData, "condolenceFilesNotes", uploadFileDesc)
|
||||
this.$set(this.formData, "typeName", name)
|
||||
this.rebuildInvoiceSummary()
|
||||
}
|
||||
},
|
||||
handleReimburseProjectChange(value) {
|
||||
if (value === "UNION_REIMBURSE_PROJECT_1") {
|
||||
this.$set(this, "activeTabName", "basic")
|
||||
this.$set(this.formData, "invoiceDetails", [])
|
||||
this.$set(this.formData, "invoiceNumber", "")
|
||||
this.$set(this.formData, "money", null)
|
||||
this.rebuildInvoiceSummary()
|
||||
} else {
|
||||
this.rebuildInvoiceSummary()
|
||||
this.normalizeFundBalance()
|
||||
@@ -1201,9 +1204,6 @@ layout("/layouts/platform.html"){
|
||||
})
|
||||
},
|
||||
rebuildInvoiceSummary() {
|
||||
if (this.formData.reimburseProject === "UNION_REIMBURSE_PROJECT_1") {
|
||||
return
|
||||
}
|
||||
let totalMoney = 0
|
||||
let fileCount = 0
|
||||
const invoiceDetails = this.formData.invoiceDetails || []
|
||||
@@ -1215,15 +1215,19 @@ layout("/layouts/platform.html"){
|
||||
fileCount = fileCount + 1
|
||||
}
|
||||
}
|
||||
this.$set(this.formData, "money", totalMoney ? totalMoney.toFixed(2) : "0.00")
|
||||
// 慰问类发票为可选附件;有发票按发票汇总金额,没有发票按慰问金额。
|
||||
if (this.formData.reimburseProject === "UNION_REIMBURSE_PROJECT_1") {
|
||||
const condolenceMoney = this.formData.condolenceMoney
|
||||
this.$set(this.formData, "money", fileCount > 0 ? (totalMoney ? totalMoney.toFixed(2) : "0.00") : condolenceMoney)
|
||||
} else {
|
||||
this.$set(this.formData, "money", totalMoney ? totalMoney.toFixed(2) : "0.00")
|
||||
}
|
||||
this.$set(this.formData, "invoiceNumber", String(fileCount))
|
||||
},
|
||||
validateInvoiceDetailsBeforeSubmit() {
|
||||
if (this.formData.reimburseProject === "UNION_REIMBURSE_PROJECT_1") {
|
||||
return true
|
||||
}
|
||||
const invoiceDetails = this.formData.invoiceDetails || []
|
||||
if (!invoiceDetails.length) {
|
||||
// 慰问类允许不填发票;如果填写了发票明细,则每条明细仍需完整。
|
||||
if (!invoiceDetails.length && this.formData.reimburseProject !== "UNION_REIMBURSE_PROJECT_1") {
|
||||
this.$message.warning("请至少维护一条发票明细")
|
||||
return false
|
||||
}
|
||||
@@ -1284,6 +1288,7 @@ layout("/layouts/platform.html"){
|
||||
// 提交验证
|
||||
validateBeforeSubmit() {
|
||||
return new Promise((resolve) => {
|
||||
this.rebuildInvoiceSummary()
|
||||
this.$refs.formRef.validate((valid) => {
|
||||
if (valid) {
|
||||
if (this.formData.reimburseFundSource === "UNION_REIMBURSE_FUND_SOURCE_3" && !this.formData.clubId) {
|
||||
@@ -1297,7 +1302,6 @@ layout("/layouts/platform.html"){
|
||||
return
|
||||
}
|
||||
this.normalizeFundBalance()
|
||||
this.rebuildInvoiceSummary()
|
||||
resolve(true)
|
||||
} else {
|
||||
this.$message.warning("请完善必填信息")
|
||||
|
||||
@@ -293,7 +293,7 @@ const unionReimburseInfo = {
|
||||
},
|
||||
computed: {
|
||||
showInvoiceTab() {
|
||||
return this.viewData.reimburseProject !== "UNION_REIMBURSE_PROJECT_1"
|
||||
return !!this.viewData.reimburseProject
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
||||
+24
-32
@@ -497,9 +497,7 @@ layout("/layouts/platform_h5.html"){
|
||||
placeholder="请填写报销事由"
|
||||
type="textarea"
|
||||
rows="2"
|
||||
autosize
|
||||
:rules="[{ required: true, message: '请填写报销事由' }]"
|
||||
required></van-field>
|
||||
autosize></van-field>
|
||||
<van-field label="备注"
|
||||
v-model="formData.notes"
|
||||
placeholder="需要填写:发票编号、开具方、金额"
|
||||
@@ -546,19 +544,6 @@ layout("/layouts/platform_h5.html"){
|
||||
</van-popup>
|
||||
</template>
|
||||
|
||||
<!-- 支付内容 -->
|
||||
<van-field
|
||||
v-if="formData.reimburseProject && formData.reimburseProject !== 'UNION_REIMBURSE_PROJECT_1'"
|
||||
label="支付内容"
|
||||
v-model="formData.paymentNotes"
|
||||
placeholder="请填写支付内容"
|
||||
type="textarea"
|
||||
rows="2"
|
||||
autosize
|
||||
required
|
||||
:rules="[{ required: true, message: '请填写支付内容' }]"
|
||||
></van-field>
|
||||
|
||||
<van-field class="more-text" name="files" required
|
||||
label="附件" :rules="[{ required: true, message: '请上传附件' }]">
|
||||
<template #input>
|
||||
@@ -574,8 +559,7 @@ layout("/layouts/platform_h5.html"){
|
||||
</template>
|
||||
</van-field>
|
||||
</van-cell-group>
|
||||
<van-cell-group title="电子发票" class="form-section"
|
||||
v-if="formData.reimburseProject && formData.reimburseProject !== 'UNION_REIMBURSE_PROJECT_1'">
|
||||
<van-cell-group title="电子发票" class="form-section" v-if="formData.reimburseProject">
|
||||
<van-field label="报销金额"
|
||||
v-model="formData.money"
|
||||
placeholder="自动汇总发票金额"
|
||||
@@ -584,6 +568,13 @@ layout("/layouts/platform_h5.html"){
|
||||
v-model="formData.invoiceNumber"
|
||||
placeholder="自动统计发票数量"
|
||||
readonly></van-field>
|
||||
<!-- 支付内容 -->
|
||||
<van-field label="支付内容"
|
||||
v-model="formData.paymentNotes"
|
||||
placeholder="请填写支付内容"
|
||||
type="textarea"
|
||||
rows="2"
|
||||
autosize></van-field>
|
||||
<div class="invoice-section">
|
||||
<div class="invoice-toolbar">
|
||||
<span>发票明细列表</span>
|
||||
@@ -1023,9 +1014,8 @@ layout("/layouts/platform_h5.html"){
|
||||
},
|
||||
handleReimburseProjectChange(value) {
|
||||
if (value === "UNION_REIMBURSE_PROJECT_1") {
|
||||
this.$set(this.formData, "invoiceDetails", [])
|
||||
this.$set(this.formData, "invoiceNumber", "")
|
||||
this.$set(this.formData, "money", "")
|
||||
this.rebuildInvoiceSummary()
|
||||
} else {
|
||||
this.rebuildInvoiceSummary()
|
||||
}
|
||||
@@ -1259,9 +1249,6 @@ layout("/layouts/platform_h5.html"){
|
||||
})
|
||||
},
|
||||
rebuildInvoiceSummary() {
|
||||
if (this.formData.reimburseProject === "UNION_REIMBURSE_PROJECT_1") {
|
||||
return
|
||||
}
|
||||
let totalMoney = 0
|
||||
let fileCount = 0
|
||||
const invoiceDetails = this.formData.invoiceDetails || []
|
||||
@@ -1273,15 +1260,19 @@ layout("/layouts/platform_h5.html"){
|
||||
fileCount = fileCount + 1
|
||||
}
|
||||
}
|
||||
this.$set(this.formData, "money", totalMoney ? totalMoney.toFixed(2) : "0.00")
|
||||
// 慰问类发票为可选附件;有发票按发票汇总金额,没有发票按慰问金额。
|
||||
if (this.formData.reimburseProject === "UNION_REIMBURSE_PROJECT_1") {
|
||||
const condolenceMoney = this.formData.condolenceMoney
|
||||
this.$set(this.formData, "money", fileCount > 0 ? (totalMoney ? totalMoney.toFixed(2) : "0.00") : condolenceMoney)
|
||||
} else {
|
||||
this.$set(this.formData, "money", totalMoney ? totalMoney.toFixed(2) : "0.00")
|
||||
}
|
||||
this.$set(this.formData, "invoiceNumber", String(fileCount))
|
||||
},
|
||||
validateInvoiceDetailsBeforeSubmit() {
|
||||
if (!this.formData.reimburseProject || this.formData.reimburseProject === "UNION_REIMBURSE_PROJECT_1") {
|
||||
return true
|
||||
}
|
||||
const invoiceDetails = this.formData.invoiceDetails || []
|
||||
if (!invoiceDetails.length) {
|
||||
// 慰问类允许不填发票;如果填写了发票明细,则每条明细仍需完整。
|
||||
if (!invoiceDetails.length && this.formData.reimburseProject !== "UNION_REIMBURSE_PROJECT_1") {
|
||||
this.$toast.fail("请至少维护一条发票明细")
|
||||
return false
|
||||
}
|
||||
@@ -1442,13 +1433,13 @@ layout("/layouts/platform_h5.html"){
|
||||
async onSubmit() {
|
||||
|
||||
this.normalizeContactFields()
|
||||
this.normalizeCondolenceDateFields()
|
||||
this.rebuildInvoiceSummary()
|
||||
this.$refs.formRef.validate().then(() => {
|
||||
// if (!this.formData.userSign) {
|
||||
// this.$toast.fail("请签名")
|
||||
// return
|
||||
// }
|
||||
this.normalizeCondolenceDateFields()
|
||||
this.rebuildInvoiceSummary()
|
||||
if (!this.validateInvoiceDetailsBeforeSubmit()) {
|
||||
return
|
||||
}
|
||||
@@ -1477,13 +1468,13 @@ layout("/layouts/platform_h5.html"){
|
||||
async onSubmitAgain() {
|
||||
|
||||
this.normalizeContactFields()
|
||||
this.normalizeCondolenceDateFields()
|
||||
this.rebuildInvoiceSummary()
|
||||
this.$refs.formRef.validate().then(() => {
|
||||
if (!this.formData.userSign) {
|
||||
this.$toast.fail("请签名")
|
||||
return
|
||||
}
|
||||
this.normalizeCondolenceDateFields()
|
||||
this.rebuildInvoiceSummary()
|
||||
if (!this.validateInvoiceDetailsBeforeSubmit()) {
|
||||
return
|
||||
}
|
||||
@@ -1578,6 +1569,7 @@ layout("/layouts/platform_h5.html"){
|
||||
this.$set(this.formData, "way", selectedType.way)
|
||||
this.$set(this.formData, "condolenceMoney", parseFloat(selectedType.money || 0).toFixed(2))
|
||||
this.$set(this.formData, "condolenceFilesNotes", selectedType.uploadFileDesc)
|
||||
this.rebuildInvoiceSummary()
|
||||
}
|
||||
},
|
||||
onCondolenceWayConfirm(o) {
|
||||
|
||||
@@ -92,7 +92,7 @@ const UNION_REIMBURSE_INFO = {
|
||||
</van-cell>
|
||||
</van-cell-group>
|
||||
|
||||
<van-cell-group title="电子发票" v-if="viewData.reimburseProject && viewData.reimburseProject !== 'UNION_REIMBURSE_PROJECT_1'">
|
||||
<van-cell-group title="电子发票" v-if="viewData.reimburseProject">
|
||||
<van-cell title="报销金额">{{ formatMoney(viewData.money) }}</van-cell>
|
||||
<van-cell title="发票张数">{{ viewData.invoiceNumber }}</van-cell>
|
||||
<van-cell title="发票明细列表">
|
||||
|
||||
Reference in New Issue
Block a user