feat: 特殊慰问表单优化
This commit is contained in:
+26
-14
@@ -175,10 +175,13 @@ layout("/layouts/platform_h5.html"){
|
||||
<!-- 表单容器 -->
|
||||
<van-form ref="formRef" class="form-container specialcondolence-apply-form">
|
||||
|
||||
<van-tabs v-model="activeApplicationTab" :lazy-render="false">
|
||||
<van-tab title="基础信息" name="form">
|
||||
<!-- 基本信息 -->
|
||||
<section class="form-section">
|
||||
<h2 class="specialcondolence-card__title">基本信息</h2>
|
||||
<van-cell-group :border="false">
|
||||
<van-field v-model="formData.subject" name="subject" label="事项" maxlength="200" required placeholder="请输入特殊慰问事项" :rules="[{ validator: value => !!String(value || '').trim() && String(value).length <= 200, message: '请填写200字以内的事项' }]"></van-field>
|
||||
<van-field label="申请人姓名" :rules="[{ required: true }]" v-model="formData.applyUserName" readonly
|
||||
required name="applyUserName"></van-field>
|
||||
<van-field label="申请人工号" :rules="[{ required: true }]" v-model="formData.applyLoginName" readonly
|
||||
@@ -193,17 +196,6 @@ layout("/layouts/platform_h5.html"){
|
||||
<van-field v-model="formData.perMoney" name="perMoney" label="每人金额" type="number" required :rules="[{ validator: validateMoney, message: '金额须大于0且不超过10000元,最多两位小数' }]"></van-field>
|
||||
<van-field v-model="formData.occurTime" name="occurTime" label="慰问时间" readonly clickable is-link placeholder="请选择慰问时间" required :rules="[{ validator: value => $moment(value, 'YYYY-MM-DD', true).isValid(), message: '请选择有效慰问时间' }]" @click="showTimePickerClick"></van-field>
|
||||
<van-popup v-model="showTimePicker" position="bottom" round get-container="body"><van-datetime-picker v-model="formData.occurDate" type="date" :min-date="minDate" :max-date="new Date(2100, 11, 31)" title="请选择慰问时间" @confirm="confirmOccurTime" @cancel="showTimePicker = false"></van-datetime-picker></van-popup>
|
||||
<div v-for="(person, index) in formData.recipients" :key="index">
|
||||
<van-cell :title="'慰问对象 ' + (index + 1)"><van-button native-type="button" size="mini" @click="formData.recipients.splice(index, 1)">删除</van-button></van-cell>
|
||||
<h5-user-select v-model="person.helpUserId" :display-name="person.helpUserName" api="/platform/special_condolence/apply/listUser" label="慰问对象" placeholder="点击选择本工会人员" required :name="'recipients.' + index + '.helpUserId'" :rules="mobileRecipientRules('helpUserId', person)" @selected="(user, id) => recipientUserChange(person, index, id, user)"></h5-user-select>
|
||||
<van-field v-model="person.helpLoginName" label="工号" readonly placeholder="选人后带出,劳务派遣可空" :required="person.personType !== '劳务派遣人员'" :name="'recipients.' + index + '.helpLoginName'" :rules="mobileRecipientRules('helpLoginName', person)"></van-field>
|
||||
<van-field v-model="person.idCard" label="身份证号码" maxlength="18" required :name="'recipients.' + index + '.idCard'" :rules="mobileRecipientRules('idCard', person)"></van-field>
|
||||
<van-field v-model="person.bankOfDeposit" label="开户行" maxlength="100" required :name="'recipients.' + index + '.bankOfDeposit'" :rules="mobileRecipientRules('bankOfDeposit', person)"></van-field>
|
||||
<van-field v-model="person.bankUserName" label="户名" maxlength="100" required :name="'recipients.' + index + '.bankUserName'" :rules="mobileRecipientRules('bankUserName', person)"></van-field>
|
||||
<van-field v-model="person.bankCardNumber" label="收款账户" maxlength="30" required :name="'recipients.' + index + '.bankCardNumber'" :rules="mobileRecipientRules('bankCardNumber', person)"></van-field>
|
||||
</div>
|
||||
<van-field name="recipients" :value="recipientCount" :rules="[{ validator: value => Number(value) > 0, message: '请至少添加一位慰问对象' }]"><template #input><van-button native-type="button" size="small" type="info" plain @click="formData.recipients.push(newRecipient())">增加一行</van-button></template></van-field>
|
||||
<van-cell title="慰问金额合计" :value="'¥ ' + recipientTotal + '(' + recipientCount + '人)'"></van-cell>
|
||||
<van-field
|
||||
v-model="formData.remark"
|
||||
name="remark"
|
||||
@@ -254,6 +246,26 @@ layout("/layouts/platform_h5.html"){
|
||||
</van-cell-group>
|
||||
</section>
|
||||
|
||||
</van-tab>
|
||||
<van-tab title="慰问对象" name="recipients">
|
||||
<section class="form-section">
|
||||
<h2 class="specialcondolence-card__title">慰问对象</h2>
|
||||
<van-cell-group :border="false">
|
||||
<div v-for="(person, index) in formData.recipients" :key="index">
|
||||
<van-cell :title="'慰问对象 ' + (index + 1)"><van-button native-type="button" size="mini" @click="formData.recipients.splice(index, 1)">删除</van-button></van-cell>
|
||||
<h5-user-select v-model="person.helpUserId" :display-name="person.helpUserName" api="/platform/special_condolence/apply/listUser" label="慰问对象" placeholder="点击选择本工会人员" required :name="'recipients.' + index + '.helpUserId'" :rules="mobileRecipientRules('helpUserId', person)" @selected="(user, id) => recipientUserChange(person, index, id, user)"></h5-user-select>
|
||||
<van-field v-model="person.helpLoginName" label="工号" readonly placeholder="选人后带出,劳务派遣可空" :required="person.personType !== '劳务派遣人员'" :name="'recipients.' + index + '.helpLoginName'" :rules="mobileRecipientRules('helpLoginName', person)"></van-field>
|
||||
<van-field v-model="person.idCard" label="身份证号码" maxlength="18" required :name="'recipients.' + index + '.idCard'" :rules="mobileRecipientRules('idCard', person)"></van-field>
|
||||
<van-field v-model="person.bankOfDeposit" label="开户行" maxlength="100" required :name="'recipients.' + index + '.bankOfDeposit'" :rules="mobileRecipientRules('bankOfDeposit', person)"></van-field>
|
||||
<van-field v-model="person.bankUserName" label="户名" maxlength="100" required :name="'recipients.' + index + '.bankUserName'" :rules="mobileRecipientRules('bankUserName', person)"></van-field>
|
||||
<van-field v-model="person.bankCardNumber" label="收款账户" maxlength="30" required :name="'recipients.' + index + '.bankCardNumber'" :rules="mobileRecipientRules('bankCardNumber', person)"></van-field>
|
||||
</div>
|
||||
<van-field name="recipients" :value="recipientCount" :rules="[{ validator: value => Number(value) > 0, message: '请至少添加一位慰问对象' }]"><template #input><van-button native-type="button" size="small" type="info" plain @click="formData.recipients.push(newRecipient())">增加一行</van-button></template></van-field>
|
||||
<van-cell title="慰问金额合计" :value="'¥ ' + recipientTotal + '(' + recipientCount + '人)'"></van-cell>
|
||||
</van-cell-group>
|
||||
</section>
|
||||
</van-tab>
|
||||
</van-tabs>
|
||||
<!-- 提交按钮 -->
|
||||
<div class="form-actions specialcondolence-apply-actions">
|
||||
<van-button native-type="button" @click="onSave" round type="info" plain>保存申请</van-button>
|
||||
@@ -443,7 +455,7 @@ layout("/layouts/platform_h5.html"){
|
||||
}
|
||||
})
|
||||
})
|
||||
}).catch(() => {})
|
||||
}).catch(errors => this.showInvalidApplicationTab(errors))
|
||||
},
|
||||
async onSubmit() {
|
||||
this.$refs.formRef.validate().then(() => {
|
||||
@@ -462,7 +474,7 @@ layout("/layouts/platform_h5.html"){
|
||||
}
|
||||
})
|
||||
})
|
||||
})
|
||||
}).catch(errors => this.showInvalidApplicationTab(errors))
|
||||
},
|
||||
async onFinishTask() {
|
||||
this.$refs.formRef.validate().then(() => {
|
||||
@@ -484,7 +496,7 @@ layout("/layouts/platform_h5.html"){
|
||||
}
|
||||
})
|
||||
})
|
||||
})
|
||||
}).catch(errors => this.showInvalidApplicationTab(errors))
|
||||
},
|
||||
init() {
|
||||
if (this.bizId) {
|
||||
|
||||
+34
-18
@@ -17,9 +17,12 @@ const specialcondolenceInfo = {
|
||||
></van-nav-bar>
|
||||
<div class="specialcondolence-full-popup__scroll">
|
||||
<main class="specialcondolence-info-main">
|
||||
<van-tabs v-model="activeInfoTab" :lazy-render="false">
|
||||
<van-tab title="基础信息" name="form">
|
||||
<section class="specialcondolence-info-card">
|
||||
<h2 class="specialcondolence-info-card__title">基本信息</h2>
|
||||
<van-cell-group :border="false">
|
||||
<van-cell title="事项">{{ viewData.subject || '--' }}</van-cell>
|
||||
<van-cell title="申请人姓名">{{ viewData.applyUserName || '--' }}</van-cell>
|
||||
<van-cell title="申请人工号">{{ viewData.applyLoginName || '--' }}</van-cell>
|
||||
<van-cell title="申请人单位">{{ viewData.applyUnitName || '--' }}</van-cell>
|
||||
@@ -29,6 +32,28 @@ const specialcondolenceInfo = {
|
||||
<van-cell title="每人慰问金额" :value="viewData.perMoney"></van-cell>
|
||||
<van-cell title="慰问时间" :value="viewData.occurTime"></van-cell>
|
||||
</template>
|
||||
<van-cell title="申请事由">{{ viewData.remark || '暂无' }}</van-cell>
|
||||
<van-cell class="specialcondolence-info-long-cell" title="附件">
|
||||
<file-preview class="specialcondolence-attachments" :files="viewData.files" complete_result></file-preview>
|
||||
</van-cell>
|
||||
<van-cell class="specialcondolence-info-long-cell" title="签字">
|
||||
<van-image
|
||||
v-if="viewData.signature"
|
||||
:src="viewData.signature"
|
||||
class="specialcondolence-signature-image"
|
||||
fit="contain"
|
||||
></van-image>
|
||||
<span v-else>暂无签字</span>
|
||||
</van-cell>
|
||||
</van-cell-group>
|
||||
</section>
|
||||
|
||||
|
||||
</van-tab>
|
||||
<van-tab title="慰问对象" name="recipients">
|
||||
<section class="specialcondolence-info-card">
|
||||
<h2 class="specialcondolence-info-card__title">慰问对象</h2>
|
||||
<van-cell-group :border="false">
|
||||
<template v-for="(person, index) in viewData.recipients">
|
||||
<van-cell :title="'慰问对象 ' + (index + 1)" :value="person.helpUserName"></van-cell>
|
||||
<van-cell title="工号" :value="person.helpLoginName || '--'"></van-cell>
|
||||
@@ -53,25 +78,12 @@ const specialcondolenceInfo = {
|
||||
<van-cell title="出院时间">{{ viewData.leaveHospitalTime || '--' }}</van-cell>
|
||||
<van-cell title="当年第几次住院(次)">{{ viewData.thisYearHospitalizationNum || '--' }}</van-cell>
|
||||
</template>
|
||||
<van-cell title="申请事由">
|
||||
{{ viewData.remark || '暂无' }}
|
||||
</van-cell>
|
||||
</template>
|
||||
<van-cell class="specialcondolence-info-long-cell" title="附件">
|
||||
<file-preview class="specialcondolence-attachments" :files="viewData.files" complete_result></file-preview>
|
||||
</van-cell>
|
||||
<van-cell class="specialcondolence-info-long-cell" title="签字">
|
||||
<van-image
|
||||
v-if="viewData.signature"
|
||||
:src="viewData.signature"
|
||||
class="specialcondolence-signature-image"
|
||||
fit="contain"
|
||||
></van-image>
|
||||
<span v-else>暂无签字</span>
|
||||
</van-cell>
|
||||
</van-cell-group>
|
||||
</section>
|
||||
|
||||
</van-cell-group>
|
||||
</section>
|
||||
</van-tab>
|
||||
<van-tab title="审核记录" name="records">
|
||||
<van-empty v-if="!doneTasks.length" description="暂无审核记录"></van-empty>
|
||||
<section
|
||||
v-for="(task, index) in doneTasks"
|
||||
:key="task.id || index"
|
||||
@@ -110,6 +122,8 @@ const specialcondolenceInfo = {
|
||||
</van-cell-group>
|
||||
</section>
|
||||
|
||||
</van-tab>
|
||||
</van-tabs>
|
||||
<slot></slot>
|
||||
</main>
|
||||
</div>
|
||||
@@ -125,6 +139,7 @@ const specialcondolenceInfo = {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
activeInfoTab: 'form',
|
||||
visible: false,
|
||||
popupTitle: "慰问详情",
|
||||
viewData: {},
|
||||
@@ -144,6 +159,7 @@ const specialcondolenceInfo = {
|
||||
* row 传列表当前行,title 传顶部导航标题;无返回值。
|
||||
*/
|
||||
onOpen(row, title = "慰问详情") {
|
||||
this.activeInfoTab = 'form'
|
||||
this.$set(this, "row", row)
|
||||
this.$set(this, "popupTitle", title)
|
||||
this.$set(this, "viewData", {})
|
||||
|
||||
+1
-2
@@ -90,14 +90,13 @@ layout("/layouts/platform_h5.html"){
|
||||
<template #header="{index,row}">
|
||||
<div class="specialcondolence-card-header">
|
||||
<div class="specialcondolence-card-heading">
|
||||
<div class="specialcondolence-card-title">{{row.helpUserName || '--'}}</div>
|
||||
<div class="specialcondolence-card-title">{{row.subject || '--'}}</div>
|
||||
</div>
|
||||
<enum-tag class="specialcondolence-card-status" v-if="row.instanceState" :value="row.instanceState"
|
||||
name="ProcessInstanceStateEnum" label_key="message" size="small"></enum-tag>
|
||||
</div>
|
||||
</template>
|
||||
<template v-slot="{index,row}">
|
||||
<table-column label="慰问对象">{{row.helpUserName}}</table-column>
|
||||
<table-column label="申请人">{{row.applyUserName}}</table-column>
|
||||
<table-column label="所属工会">{{row.applyUnionName}}</table-column>
|
||||
<table-column label="所属单位">{{row.applyUnitName}}</table-column>
|
||||
|
||||
+1
-2
@@ -327,14 +327,13 @@ layout("/layouts/platform_h5.html"){
|
||||
<template #header="{index,row}">
|
||||
<div class="specialcondolence-card-header">
|
||||
<div class="specialcondolence-card-heading">
|
||||
<div class="specialcondolence-card-title">{{row.helpUserName || '--'}}</div>
|
||||
<div class="specialcondolence-card-title">{{row.subject || '--'}}</div>
|
||||
</div>
|
||||
<enum-tag class="specialcondolence-card-status" v-if="row.instanceState" :value="row.instanceState"
|
||||
name="ProcessInstanceStateEnum" label_key="message" size="small"></enum-tag>
|
||||
</div>
|
||||
</template>
|
||||
<template v-slot="{index,row}">
|
||||
<table-column label="慰问对象">{{row.helpUserName}}</table-column>
|
||||
<table-column label="申请人">{{row.applyUserName}}</table-column>
|
||||
<table-column label="所属工会">{{row.applyUnionName}}</table-column>
|
||||
<table-column label="所属单位">{{row.applyUnitName}}</table-column>
|
||||
|
||||
+1
-2
@@ -90,14 +90,13 @@ layout("/layouts/platform_h5.html"){
|
||||
<template #header="{index,row}">
|
||||
<div class="specialcondolence-card-header">
|
||||
<div class="specialcondolence-card-heading">
|
||||
<div class="specialcondolence-card-title">{{row.helpUserName || '--'}}</div>
|
||||
<div class="specialcondolence-card-title">{{row.subject || '--'}}</div>
|
||||
</div>
|
||||
<enum-tag class="specialcondolence-card-status" v-if="row.instanceState" :value="row.instanceState"
|
||||
name="ProcessInstanceStateEnum" label_key="message" size="small"></enum-tag>
|
||||
</div>
|
||||
</template>
|
||||
<template v-slot="{index,row}">
|
||||
<table-column label="慰问对象">{{row.helpUserName}}</table-column>
|
||||
<table-column label="申请人">{{row.applyUserName}}</table-column>
|
||||
<table-column label="所属工会">{{row.applyUnionName}}</table-column>
|
||||
<table-column label="所属单位">{{row.applyUnitName}}</table-column>
|
||||
|
||||
+1
-2
@@ -90,14 +90,13 @@ layout("/layouts/platform_h5.html"){
|
||||
<template #header="{index,row}">
|
||||
<div class="specialcondolence-card-header">
|
||||
<div class="specialcondolence-card-heading">
|
||||
<div class="specialcondolence-card-title">{{row.helpUserName || '--'}}</div>
|
||||
<div class="specialcondolence-card-title">{{row.subject || '--'}}</div>
|
||||
</div>
|
||||
<enum-tag class="specialcondolence-card-status" v-if="row.instanceState" :value="row.instanceState"
|
||||
name="ProcessInstanceStateEnum" label_key="message" size="small"></enum-tag>
|
||||
</div>
|
||||
</template>
|
||||
<template v-slot="{index,row}">
|
||||
<table-column label="慰问对象">{{row.helpUserName}}</table-column>
|
||||
<table-column label="申请人">{{row.applyUserName}}</table-column>
|
||||
<table-column label="所属工会">{{row.applyUnionName}}</table-column>
|
||||
<table-column label="所属单位">{{row.applyUnitName}}</table-column>
|
||||
|
||||
Reference in New Issue
Block a user