commit
This commit is contained in:
@@ -0,0 +1,614 @@
|
||||
<!--#
|
||||
layout("/layouts/platform_h5.html"){
|
||||
#-->
|
||||
<div id="app">
|
||||
<van-nav-bar title="帮扶申请" left-text="返回" left-arrow @click-left="historyBack" placeholder fixed></van-nav-bar>
|
||||
|
||||
<div class="form-container">
|
||||
<van-form ref="formRef">
|
||||
<van-cell-group title="申请人信息" class="form-section">
|
||||
<van-field label="填写人姓名" :rules="[{ required: true }]" v-model="formData.proxyUserName" readonly
|
||||
required name="proxyUserName"></van-field>
|
||||
<van-field label="填写人工号" :rules="[{ required: true }]" v-model="formData.proxyLoginName" readonly
|
||||
required name="proxyLoginName"></van-field>
|
||||
<van-field label="申请模式" name="mode" required :rules="[{ required: true }]">
|
||||
<template #input>
|
||||
<van-radio-group v-model="formData.mode" @change="modeChange" direction="horizontal">
|
||||
<van-radio name="1" shape="square">申请本人</van-radio>
|
||||
<van-radio v-if="$auth.hasRoleOr('SYSADMIN, SCHOOL_UNION_ADMIN, BRANCH_UNION_CHAIRMAN, BRANCH_UNION_OPERATOR')"
|
||||
name="2" shape="square">替他人申请</van-radio>
|
||||
</van-radio-group>
|
||||
</template>
|
||||
</van-field>
|
||||
</van-cell-group>
|
||||
|
||||
<van-cell-group title="受助人信息" class="form-section">
|
||||
<template v-if="formData.mode == 2">
|
||||
<van-field label="受助人" :rules="[{ required: true }]" v-model="formData.userName"
|
||||
required name="userName" placeholder="请输入受补助人姓名后点击查询">
|
||||
<template #button>
|
||||
<van-button :disabled="formData.id" @click="queryRecipients(formData.userName)"
|
||||
size="small" type="primary">查询</van-button>
|
||||
</template>
|
||||
</van-field>
|
||||
|
||||
<van-action-sheet
|
||||
:actions="subsidizedList"
|
||||
:close-on-click-overlay="false"
|
||||
@cancel="subsidizedList = []"
|
||||
@select="onUserSelect"
|
||||
cancel-text="重新输入姓名或工号查询"
|
||||
v-model="userSheetShow">
|
||||
</van-action-sheet>
|
||||
|
||||
</template>
|
||||
<template v-else>
|
||||
<van-field label="受助人" :rules="[{ required: true }]" v-model="formData.userName" readonly
|
||||
required name="userName"></van-field>
|
||||
</template>
|
||||
|
||||
<van-field
|
||||
v-model="formData.sex"
|
||||
label="性别"
|
||||
required
|
||||
is-link
|
||||
placeholder="请选择性别"
|
||||
readonly
|
||||
:rules="[{ required: true }]"
|
||||
@click="showSexPicker = true"
|
||||
></van-field>
|
||||
<van-popup v-model="showSexPicker" position="bottom">
|
||||
<van-picker
|
||||
show-toolbar
|
||||
:columns="['男', '女']"
|
||||
@confirm="onSexConfirm"
|
||||
@cancel="showSexPicker=false"
|
||||
></van-picker>
|
||||
</van-popup>
|
||||
<van-field
|
||||
v-model="formData.birthday"
|
||||
label="出生年月"
|
||||
is-link
|
||||
placeholder="请填写出生年月"
|
||||
@click="showDatePicker = true"
|
||||
required
|
||||
:rules="[{ required: true }]"
|
||||
></van-field>
|
||||
<van-popup v-model="showDatePicker" position="bottom">
|
||||
<van-datetime-picker
|
||||
type="date"
|
||||
:min-date="new Date(1900, 0, 1)"
|
||||
:max-date="new Date()"
|
||||
@confirm="onDateConfirm"
|
||||
@cancel="showDatePicker=false"
|
||||
></van-datetime-picker>
|
||||
</van-popup>
|
||||
|
||||
<van-field
|
||||
v-model="formData.unionName"
|
||||
label="所在工会"
|
||||
placeholder="请选择所在工会"
|
||||
readonly
|
||||
:rules="[{ required: true }]"
|
||||
required
|
||||
></van-field>
|
||||
<van-field
|
||||
v-model="formData.unitName"
|
||||
label="所在单位"
|
||||
placeholder="请选择所在单位"
|
||||
readonly
|
||||
:rules="[{ required: true }]"
|
||||
required
|
||||
></van-field>
|
||||
<van-field
|
||||
v-model="formData.officialCapacity"
|
||||
label="职务职称"
|
||||
placeholder="请填写职务职称"
|
||||
maxlength="50"
|
||||
clearable
|
||||
required
|
||||
:rules="[{ required: true }]"
|
||||
></van-field>
|
||||
|
||||
<van-field
|
||||
v-model="formData.mobile"
|
||||
label="手机号码"
|
||||
placeholder="请填写手机号码"
|
||||
maxlength="11"
|
||||
clearable
|
||||
required
|
||||
:rules="[{ required: true }]"
|
||||
></van-field>
|
||||
<van-field
|
||||
v-model="formData.idCard"
|
||||
label="身份证号"
|
||||
placeholder="请填写身份证号"
|
||||
maxlength="18"
|
||||
clearable
|
||||
required
|
||||
:rules="[{ required: true }]"
|
||||
></van-field>
|
||||
|
||||
<van-field
|
||||
v-model="formData.monthlyIncome"
|
||||
label="本人月收入"
|
||||
type="number"
|
||||
placeholder="请填写本人月收入"
|
||||
:rules="[{ required: true }]"
|
||||
required
|
||||
></van-field>
|
||||
</van-cell-group>
|
||||
|
||||
<van-cell-group title="困难类型及材料" class="form-section">
|
||||
<van-field
|
||||
v-model="formData.subsidyStandards"
|
||||
label="困难类型"
|
||||
placeholder="请选择款项"
|
||||
is-link
|
||||
@click="showSubsidyPicker = true"
|
||||
required
|
||||
:rules="[{ required: true, message: '请选择款项' }]"
|
||||
></van-field>
|
||||
<van-popup v-model="showSubsidyPicker" position="bottom">
|
||||
<van-picker
|
||||
show-toolbar
|
||||
:columns="subsidyStandards"
|
||||
@confirm="onSubsidyConfirm"
|
||||
@cancel="showSubsidyPicker=false"
|
||||
></van-picker>
|
||||
</van-popup>
|
||||
|
||||
<van-field
|
||||
v-model="formData.bankCardNum"
|
||||
label="银行卡号"
|
||||
maxlength="20"
|
||||
clearable
|
||||
placeholder="请填写华夏银行工资卡号"
|
||||
:rules="[{ required: true }]"
|
||||
required
|
||||
></van-field>
|
||||
<div style="margin-left: 10px">
|
||||
<span style="color: #bc2a25">据学校要求,请您填写【<span style="color: red;font-weight: bolder">华夏银行工资卡号</span>】为收款账户</span>
|
||||
</div>
|
||||
|
||||
<van-field
|
||||
v-model="formData.reason"
|
||||
label="申请原因"
|
||||
type="textarea"
|
||||
placeholder="请简述申请原因"
|
||||
maxlength="500"
|
||||
required
|
||||
:rules="[{ required: true, message: '请简述申请原因' }]"
|
||||
></van-field>
|
||||
|
||||
<van-field name="familyList" label="家庭成员经济收入" @click="showDialog = true" required is-link
|
||||
label-width="60%"
|
||||
clickable
|
||||
class="family-list-field">
|
||||
</van-field>
|
||||
<van-list class="family-list-cell">
|
||||
<van-cell
|
||||
v-for="(member, index) in formData.familyList"
|
||||
:key="index"
|
||||
:title="member.name"
|
||||
:label="'年龄: ' + member.age + ' 岁, 关系: ' + member.relation + ', 月收入: ' + member.monthlyIncome + ' 元'"
|
||||
is-link
|
||||
@click="editMember(index)"
|
||||
>
|
||||
<template #right-icon>
|
||||
<van-icon name="delete" color="red" @click.stop="removeMember(index)"></van-icon>
|
||||
</template>
|
||||
</van-cell>
|
||||
</van-list>
|
||||
</van-cell-group>
|
||||
|
||||
<van-cell-group title="附件信息" class="form-section">
|
||||
<van-field class="more-text" name="avatar" label="">
|
||||
<template #input>
|
||||
<h5-file-upload
|
||||
slot="input"
|
||||
:value.sync="formData.files"
|
||||
:upload_number="10"
|
||||
upload_mode="file"
|
||||
upload_result_category="array"
|
||||
upload_result_type="url"
|
||||
complete_result
|
||||
></h5-file-upload>
|
||||
</template>
|
||||
</van-field>
|
||||
</van-cell-group>
|
||||
|
||||
<van-cell-group title="签字" class="form-section">
|
||||
<van-field class="more-text" name="signature" label="">
|
||||
<template #input>
|
||||
<h5-signature v-model="formData.sign" slot="input"></h5-signature>
|
||||
</template>
|
||||
</van-field>
|
||||
</van-cell-group>
|
||||
|
||||
<div class="form-actions">
|
||||
<van-button plain type="info" @click="onSave">保存</van-button>
|
||||
<van-button type="primary" @click="onSubmit" v-if="!taskId">提交</van-button>
|
||||
<van-button type="primary" @click="onFinishTask" v-else>提交</van-button>
|
||||
</div>
|
||||
</van-form>
|
||||
</div>
|
||||
|
||||
<van-dialog v-model="showDialog" class="family-dialog" title="添加家庭成员" show-cancel-button
|
||||
:before-close="handleBeforeClose">
|
||||
<van-cell-group>
|
||||
<van-field
|
||||
v-model="newMember.name"
|
||||
label="姓名"
|
||||
placeholder="请输入姓名"
|
||||
required
|
||||
></van-field>
|
||||
<van-field
|
||||
v-model="newMember.age"
|
||||
label="年龄(岁)"
|
||||
type="number"
|
||||
placeholder="请输入年龄"
|
||||
required
|
||||
></van-field>
|
||||
<van-field
|
||||
v-model="newMember.relation"
|
||||
label="关系"
|
||||
placeholder="请输入关系"
|
||||
required
|
||||
></van-field>
|
||||
<van-field
|
||||
v-model="newMember.monthlyIncome"
|
||||
label="月收入(元)"
|
||||
type="number"
|
||||
placeholder="请输入月收入"
|
||||
required
|
||||
></van-field>
|
||||
</van-cell-group>
|
||||
</van-dialog>
|
||||
|
||||
</div>
|
||||
|
||||
<script>
|
||||
new Vue({
|
||||
el: '#app',
|
||||
store,
|
||||
data() {
|
||||
return {
|
||||
bizId: GetQueryString("bizId"),
|
||||
taskId: GetQueryString("taskId"),
|
||||
showSexPicker: false,
|
||||
showDatePicker: false,
|
||||
showSubsidyPicker: false,
|
||||
formData: {
|
||||
id: GetQueryString("bizId"),
|
||||
mode: '1'
|
||||
},
|
||||
subsidyStandards: [
|
||||
'患重大疾病(癌症)',
|
||||
'本人家庭(仅指代本人及其配偶、子女共同组成的家庭)人均月收入低于1300元或本人配偶、子女患有重大疾病且自付医疗费用超过家庭年收入的80%',
|
||||
'患精神类疾病',
|
||||
'长期病休',
|
||||
'其他特殊情况'
|
||||
],
|
||||
newMember: {
|
||||
name: '',
|
||||
age: '',
|
||||
relation: '',
|
||||
monthlyIncome: ''
|
||||
},
|
||||
showDialog: false,
|
||||
isEditing: false,
|
||||
editingIndex: null,
|
||||
|
||||
// 替他人申请相关
|
||||
userSheetShow: false,
|
||||
subsidizedList: []
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
historyBack,
|
||||
|
||||
// 保存
|
||||
onSave() {
|
||||
this.$confirm("您确定保存吗?", "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
}).then(() => {
|
||||
this.$axios.post('/platform/difficultHelp/apply/save', {data: JSON.stringify(this.formData)}).then(res => {
|
||||
if (res.code === 0) {
|
||||
this.$message.success("保存成功")
|
||||
window.location.href = '/platform/difficultHelp/mine'
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
|
||||
// 提交
|
||||
onSubmit() {
|
||||
this.$confirm("您确定要提交吗?", "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
}).then(() => {
|
||||
const result = this.isValidIdCard(this.formData.idCard)
|
||||
if (result.status === 0) {
|
||||
this.$toast(result.msg)
|
||||
}
|
||||
const bankRes = this.validateCard(this.formData.bankCardNum)
|
||||
if (bankRes.status === 0) {
|
||||
this.$toast(bankRes.msg)
|
||||
}
|
||||
|
||||
this.$axios.post('/platform/difficultHelp/apply/submit', {
|
||||
data: JSON.stringify(this.formData)
|
||||
}).then(res => {
|
||||
if (res.code === 0) {
|
||||
this.$message.success("提交成功")
|
||||
window.location.href = '/platform/h5/difficultHelp/mine'
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
|
||||
onFinishTask() {
|
||||
this.$confirm("您确定要提交吗?", "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
}).then(() => {
|
||||
this.$axios.post('/platform/difficultHelp/apply/submitAgain', {
|
||||
data: JSON.stringify(this.formData),
|
||||
taskId: GetQueryString("taskId")
|
||||
}).then(res => {
|
||||
if (res.code === 0) {
|
||||
this.$message.success("提交成功")
|
||||
window.location.href = '/platform/difficultHelp/mine'
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
|
||||
// 查询受助人
|
||||
async queryRecipients(key) {
|
||||
if (this.formData.mode !== '2') {
|
||||
return
|
||||
}
|
||||
const res = await this.$axios.post('/platform/difficultHelp/apply/queryRecipients', { key })
|
||||
if (res.code === 0) {
|
||||
res.data.forEach((v) => {
|
||||
v.name = v.username;
|
||||
return v;
|
||||
});
|
||||
this.subsidizedList = res.data;
|
||||
this.userSheetShow = true;
|
||||
}
|
||||
},
|
||||
|
||||
onUserSelect(val) {
|
||||
const user = this.subsidizedList.find((item) => item.id === val.id)
|
||||
if (user) {
|
||||
this.$set(this.formData, "userId", user.id);
|
||||
this.$set(this.formData, "userName", user.username);
|
||||
this.$set(this.formData, "loginName", user.loginname);
|
||||
this.$set(this.formData, "sex", user.sex);
|
||||
this.$set(this.formData, "unitId", user.unitid);
|
||||
this.$set(this.formData, "unitName", user.unitName);
|
||||
this.$set(this.formData, "unionId", user.unionid);
|
||||
this.$set(this.formData, "unionName", user.unionName);
|
||||
this.$set(this.formData, "birthday", user.birthday);
|
||||
this.$set(this.formData, "mobile", user.mobile);
|
||||
} else {
|
||||
this.$set(this.formData, "userId", null);
|
||||
this.$set(this.formData, "userName", null);
|
||||
this.$set(this.formData, "loginName", null);
|
||||
this.$set(this.formData, "sex", null);
|
||||
this.$set(this.formData, "unitId", null);
|
||||
this.$set(this.formData, "unitName", null);
|
||||
this.$set(this.formData, "unionId", null);
|
||||
this.$set(this.formData, "unionName", null);
|
||||
this.$set(this.formData, "birthday", null);
|
||||
this.$set(this.formData, "mobile", null);
|
||||
}
|
||||
this.userSheetShow = false;
|
||||
},
|
||||
|
||||
onSexConfirm(value) {
|
||||
this.formData.sex = value;
|
||||
this.showSexPicker = false;
|
||||
},
|
||||
onDateConfirm(value) {
|
||||
this.formData.birthday = moment(value).format("YYYY-MM-DD");
|
||||
this.showDatePicker = false;
|
||||
},
|
||||
onSubsidyConfirm(value) {
|
||||
this.formData.subsidyStandards = value;
|
||||
this.showSubsidyPicker = false;
|
||||
},
|
||||
handleBeforeClose(action, done) {
|
||||
if (action === 'confirm') {
|
||||
if (!this.newMember.name || !this.newMember.age || !this.newMember.relation || !this.newMember.monthlyIncome) {
|
||||
this.$toast('请填写完整信息');
|
||||
done(false);
|
||||
} else {
|
||||
done()
|
||||
if (this.bizId) {
|
||||
this.updateMember();
|
||||
} else {
|
||||
this.addMember();
|
||||
}
|
||||
done();
|
||||
}
|
||||
} else {
|
||||
done()
|
||||
}
|
||||
},
|
||||
|
||||
addMember() {
|
||||
this.formData.familyList.push({...this.newMember});
|
||||
this.resetNewMember();
|
||||
},
|
||||
|
||||
editMember(index) {
|
||||
this.newMember = {...this.formData.familyList[index]};
|
||||
this.editingIndex = index;
|
||||
this.isEditing = true;
|
||||
this.showDialog = true;
|
||||
},
|
||||
updateMember() {
|
||||
this.formData.familyList.splice(this.editingIndex, 1, { ...this.newMember });
|
||||
this.resetNewMember();
|
||||
},
|
||||
removeMember(index) {
|
||||
this.formData.familyList.splice(index, 1);
|
||||
},
|
||||
resetNewMember() {
|
||||
this.newMember = {name: '', age: '', relation: '', monthlyIncome: ''};
|
||||
this.isEditing = false;
|
||||
this.editingIndex = null;
|
||||
},
|
||||
|
||||
findOne(id) {
|
||||
this.$axios.post('/platform/difficultHelp/mine/findOne', { id }).then(res => {
|
||||
if (res.code === 0) {
|
||||
this.formData = res.data
|
||||
}
|
||||
})
|
||||
},
|
||||
// 申请模式
|
||||
modeChange(val) {
|
||||
const user = this.$store.state.user
|
||||
if (val === "1") {
|
||||
this.$set(this.formData, 'userId', user.id)
|
||||
this.$set(this.formData, 'userName', user.username)
|
||||
this.$set(this.formData, 'loginName', user.loginname)
|
||||
this.$set(this.formData, 'proxyUserId', user.id)
|
||||
this.$set(this.formData, 'proxyUserName', user.username)
|
||||
this.$set(this.formData, 'proxyLoginName', user.loginname)
|
||||
this.$set(this.formData, 'mode', "1")
|
||||
this.$set(this.formData, 'sex', user.sex)
|
||||
this.$set(this.formData, 'unitId', user.unit.id)
|
||||
this.$set(this.formData, 'unitName', user.unit.name)
|
||||
this.$set(this.formData, 'unionId', user.union.id)
|
||||
this.$set(this.formData, 'unionName', user.union.name)
|
||||
this.$set(this.formData, 'monthlyIncome', null)
|
||||
this.$set(this.formData, 'birthday', user.birthday)
|
||||
this.$set(this.formData, 'mobile', user.mobile)
|
||||
this.$set(this.formData, 'homeAddress', user.homeAddress)
|
||||
this.$set(this.formData, 'subsidyStandards', null)
|
||||
this.$set(this.formData, 'reason', null)
|
||||
this.$set(this.formData, 'remarks', null)
|
||||
this.$set(this.formData, 'familyList', [])
|
||||
this.$set(this.formData, 'files', [])
|
||||
this.queryRecipients(user.loginname)
|
||||
} else {
|
||||
this.formData = {}
|
||||
this.$set(this.formData, 'proxyUserId', user.id)
|
||||
this.$set(this.formData, 'proxyUserName', user.username)
|
||||
this.$set(this.formData, 'proxyLoginName', user.loginname)
|
||||
this.$set(this.formData, 'mode', "2")
|
||||
this.$set(this.formData, 'familyList', [])
|
||||
this.$set(this.formData, 'files', [])
|
||||
}
|
||||
},
|
||||
/**
|
||||
* 检验身份证号
|
||||
* @param idCard
|
||||
* @returns {{status: number, msg: string}}
|
||||
*/
|
||||
isValidIdCard(idCard) {
|
||||
// 校验18位身份证号
|
||||
const format18 = /^(((([1][1-5])|([2][1-3])|([3][1-7])|([4][1-6])|([5][0-4])|([6][1-5])|([7][1])|([8][1-2]))\d{4})|(([9](([1][1-5])|([2][1-3])|([3][1-7])|([4][1-6])|([5][0-4])|([6][1-5])|([7][1])|([8][1-2])))\d{3}))(([1][9]\d{2})|([2]\d{3}))(([0][1-9])|([1][0-2]))(([0][1-9])|([1-2][0-9])|([3][0-1]))\d{3}[0-9xX]$/;
|
||||
// 校验15位身份证号
|
||||
const format15 = /^\d{15}$/;
|
||||
// 校验外国人永久居留身份证号
|
||||
const format15Foreign = /^[a-zA-Z]{3}[0-9]{4}[0-9]{2}((01|03|05|07|08|10|12)(0[1-9]|[1-2][0-9]|3[0-1])|(04|06|09|11)(0[1-9]|[1-2][0-9]|30)|02(0[1-9]|[1-2][0-9]))[0-9]{2}$/;
|
||||
|
||||
// 校验格式
|
||||
if (!(format18.test(idCard) || format15.test(idCard) || format15Foreign.test(idCard))) {
|
||||
return { status: 0, msg: '身份证号码格式不正确' };
|
||||
}
|
||||
|
||||
// 校验出生日期
|
||||
let year, month, day;
|
||||
if (idCard.length === 18) {
|
||||
year = idCard.substr(6, 4);
|
||||
month = idCard.substr(10, 2);
|
||||
day = idCard.substr(12, 2);
|
||||
} else if (idCard.length === 15) {
|
||||
year = '19' + idCard.substr(6, 2);
|
||||
month = idCard.substr(8, 2);
|
||||
day = idCard.substr(10, 2);
|
||||
} else {
|
||||
return { status: 0, msg: '身份证号码格式不正确' };
|
||||
}
|
||||
|
||||
const date = new Date(year, month - 1, day);
|
||||
if (date.getFullYear() !== parseInt(year, 10) || date.getMonth() + 1 !== parseInt(month, 10) || date.getDate() !== parseInt(day, 10)) {
|
||||
return { status: 0, msg: '身份证出生日期不正确' };
|
||||
}
|
||||
|
||||
// 校验18位身份证号的校验码
|
||||
if (idCard.length === 18) {
|
||||
const coefficients = [7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2];
|
||||
const checkCodeMap = ['1', '0', 'X', '9', '8', '7', '6', '5', '4', '3', '2'];
|
||||
let sum = 0;
|
||||
for (let i = 0; i < 17; i++) {
|
||||
sum += parseInt(idCard.charAt(i), 10) * coefficients[i];
|
||||
}
|
||||
const checkCode = checkCodeMap[sum % 11];
|
||||
if (checkCode.toUpperCase() !== idCard.charAt(17).toUpperCase()) {
|
||||
return { status: 0, msg: '身份证校验码不正确' };
|
||||
}
|
||||
}
|
||||
|
||||
return { status: 1, msg: '校验通过' };
|
||||
},
|
||||
/**
|
||||
* 校验银行卡号
|
||||
* @param bankCardNum
|
||||
* @returns {{status: number, msg: string}}
|
||||
*/
|
||||
validateCard(bankCardNum) {
|
||||
// 移除所有空格
|
||||
bankCardNum = bankCardNum.replace(/\s+/g, '');
|
||||
// 检查格式
|
||||
const cardRegex = /^\d{13,19}$/;
|
||||
if (!cardRegex.test(bankCardNum)) {
|
||||
return { status: 0, msg: "卡号格式不正确,请输入13到19位数字。" };
|
||||
}
|
||||
// 检查Luhn算法
|
||||
if (!/^\d+$/.test(bankCardNum)) {
|
||||
return { status: 0, msg: "无效的卡号,请检查后再试。" };
|
||||
}
|
||||
let sum = 0;
|
||||
let shouldDouble = false;
|
||||
for (let i = bankCardNum.length - 1; i >= 0; i--) {
|
||||
let digit = parseInt(bankCardNum.charAt(i));
|
||||
if (shouldDouble) {
|
||||
digit *= 2;
|
||||
if (digit > 9) {
|
||||
digit -= 9;
|
||||
}
|
||||
}
|
||||
sum += digit;
|
||||
shouldDouble = !shouldDouble;
|
||||
}
|
||||
if ((sum % 10) !== 0) {
|
||||
return { status: 0, msg: "无效的卡号,请检查后再试。" };
|
||||
}
|
||||
return { status: 200, msg: "卡号有效。" };
|
||||
}
|
||||
},
|
||||
async created() {
|
||||
if (this.bizId) {
|
||||
this.findOne(this.bizId)
|
||||
} else {
|
||||
this.modeChange("1")
|
||||
}
|
||||
}
|
||||
})
|
||||
</script>
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
+104
@@ -0,0 +1,104 @@
|
||||
<!--#
|
||||
layout("/layouts/platform_h5.html"){
|
||||
#-->
|
||||
<div id="app">
|
||||
<van-sticky>
|
||||
<van-nav-bar title="帮扶申请记录" left-text="返回" left-arrow @click-left="historyBack" placeholder fixed></van-nav-bar>
|
||||
<van-search
|
||||
v-model="pageForm.searchKeyword"
|
||||
placeholder="请输入工号或者姓名进行查询"
|
||||
show-action
|
||||
:reverse-color="false"
|
||||
input-align="left"
|
||||
@search="doSearch">
|
||||
<template #action>
|
||||
<div @click="doSearch">搜索</div>
|
||||
</template>
|
||||
</van-search>
|
||||
<van-dropdown-menu
|
||||
v-if="$auth.hasRoleOr('SYSADMIN,SCHOOL_UNION_ADMIN,BRANCH_UNION_CHAIRMAN')"
|
||||
:close-on-click-outside="false"
|
||||
:close-on-click-overlay="false"
|
||||
>
|
||||
<van-dropdown-item :options="unionList" @change="unionChange" v-model="pageForm.unionId"></van-dropdown-item>
|
||||
<van-dropdown-item :options="unitList" @change="doSearch" v-model="pageForm.unitId"></van-dropdown-item>
|
||||
</van-dropdown-menu>
|
||||
</van-sticky>
|
||||
|
||||
<table-list api="/platform/difficultHelp/mine/pageData" :page_form.sync="pageForm" ref="tableListRef" title="userName" @ready="doSearch">
|
||||
<template v-slot="{index,row}">
|
||||
<table-column label="受助人">{{row.userName + '(' + row.loginName + ')'}}</table-column>
|
||||
<table-column label="所属工会">{{row.unionName}}</table-column>
|
||||
<table-column label="工作单位">{{row.unitName}}</table-column>
|
||||
<table-column label="困难类型">{{row.subsidyStandards}}</table-column>
|
||||
<table-column label="填报时间">{{row.applyTime}}</table-column>
|
||||
<table-column label="当前节点">{{row.taskName}}</table-column>
|
||||
</template>
|
||||
<template #actions="{index,row}">
|
||||
<div class="action-btn" @click="onView(row)">
|
||||
<i class="fa fa-eye"></i>
|
||||
<span>查看</span>
|
||||
</div>
|
||||
<div class="action-btn" v-if="row.taskKey === 'startTask' || !row.instanceId"
|
||||
@click="onEdit(row)">
|
||||
<i class="fa fa-check-square-o"></i>
|
||||
<span>编辑</span>
|
||||
</div>
|
||||
<div class="action-btn delete" v-if="row.canRevoke" @click="onRevoke(row)">
|
||||
<i class="fa fa-undo"></i>
|
||||
<span>撤回</span>
|
||||
</div>
|
||||
</template>
|
||||
</table-list>
|
||||
|
||||
<van-popup v-model="infoShow" position="right" :style="{ height: '100%', width: '100%' }" safe-area-inset-bottom>
|
||||
<van-sticky>
|
||||
<van-nav-bar @click-left="infoShow=false" left-arrow left-text="返回" title="分工会审核"></van-nav-bar>
|
||||
</van-sticky>
|
||||
<info ref="infoRef">
|
||||
<div v-if="showApprovalForm">
|
||||
<div class="process-title">{{formData.taskName}}</div>
|
||||
<van-form ref="formRef">
|
||||
<van-field label="审核意见" name="tf_opinion" v-model="formData.tf_opinion"
|
||||
required :rules="[{required:true,message:'必填',trigger:['change','blur']}]">
|
||||
</van-field>
|
||||
</van-form>
|
||||
<div style="display: flex; justify-content: space-between; column-gap: 10px; padding: 10px">
|
||||
<van-button type="danger" block @click="handleTaskAction(6)">退回到发起人</van-button>
|
||||
<van-button type="danger" block @click="handleTaskAction(2)">拒绝申请</van-button>
|
||||
<van-button type="primary" block @click="handleTaskAction(1)">同意申请</van-button>
|
||||
</div>
|
||||
</div>
|
||||
</info>
|
||||
</van-popup>
|
||||
</div>
|
||||
<script>
|
||||
new Vue({
|
||||
el: '#app',
|
||||
store,
|
||||
data() {
|
||||
return {
|
||||
pageForm: {
|
||||
pageNo: 1,
|
||||
pageSize: 10,
|
||||
searchKeyword: '',
|
||||
unionId: '',
|
||||
unitId: ''
|
||||
},
|
||||
unionList: [],
|
||||
unitList: [],
|
||||
|
||||
infoShow: false
|
||||
}
|
||||
},
|
||||
components: {
|
||||
"info": INFO
|
||||
},
|
||||
methods: {
|
||||
|
||||
}
|
||||
})
|
||||
</script>
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
@@ -0,0 +1,39 @@
|
||||
const INFO = {
|
||||
template: /*language=HTML*/`
|
||||
`,
|
||||
data() {
|
||||
return {
|
||||
row: {},
|
||||
viewData: {},
|
||||
doneTasks: [],
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 打开
|
||||
onOpen(row) {
|
||||
this.row = row
|
||||
this.info()
|
||||
this.getDoneTasks()
|
||||
},
|
||||
// 获取申请信息
|
||||
info() {
|
||||
this.$axios.post("/platform/difficultHelp/mine/findOne", { id: this.row.id }).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.viewData = res.data
|
||||
}
|
||||
})
|
||||
},
|
||||
// 获取已办任务审批记录
|
||||
getDoneTasks() {
|
||||
this.$axios.post("/flow/common/doneTasks", { bizId: this.row.id }).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.doneTasks = res.data
|
||||
}
|
||||
})
|
||||
},
|
||||
// 查看流程图
|
||||
openChart(){
|
||||
this.$refs.snakerChartRef.onOpenFull(this.row.instanceProcessDefineId, this.row.instanceId)
|
||||
}
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,185 @@
|
||||
<!--#
|
||||
layout("/layouts/platform_h5.html"){
|
||||
#-->
|
||||
<div id="app">
|
||||
<van-sticky>
|
||||
<van-nav-bar title="帮扶申请记录" left-text="返回" left-arrow @click-left="historyBack" placeholder fixed></van-nav-bar>
|
||||
<van-search
|
||||
v-model="pageForm.searchKeyword"
|
||||
placeholder="请输入工号或者姓名进行查询"
|
||||
show-action
|
||||
:reverse-color="false"
|
||||
input-align="left"
|
||||
@search="doSearch">
|
||||
<template #action>
|
||||
<div @click="doSearch">搜索</div>
|
||||
</template>
|
||||
</van-search>
|
||||
<van-dropdown-menu
|
||||
v-if="$auth.hasRoleOr('SYSADMIN,SCHOOL_UNION_ADMIN,BRANCH_UNION_CHAIRMAN')"
|
||||
:close-on-click-outside="false"
|
||||
:close-on-click-overlay="false"
|
||||
>
|
||||
<van-dropdown-item :options="unionList" @change="unionChange" v-model="pageForm.unionId"></van-dropdown-item>
|
||||
<van-dropdown-item :options="unitList" @change="doSearch" v-model="pageForm.unitId"></van-dropdown-item>
|
||||
</van-dropdown-menu>
|
||||
</van-sticky>
|
||||
|
||||
<table-list api="/platform/difficultHelp/mine/pageData" :page_form.sync="pageForm" ref="tableListRef" title="userName" @ready="doSearch">
|
||||
<template v-slot="{index,row}">
|
||||
<table-column label="受助人">{{row.userName + '(' + row.loginName + ')'}}</table-column>
|
||||
<table-column label="所属工会">{{row.unionName}}</table-column>
|
||||
<table-column label="工作单位">{{row.unitName}}</table-column>
|
||||
<table-column label="困难类型">{{row.subsidyStandards}}</table-column>
|
||||
<table-column label="填报时间">{{row.applyTime}}</table-column>
|
||||
<table-column label="当前节点">{{row.taskName}}</table-column>
|
||||
</template>
|
||||
<template #actions="{index,row}">
|
||||
<div class="action-btn" @click="onView(row)">
|
||||
<i class="fa fa-eye"></i>
|
||||
<span>查看</span>
|
||||
</div>
|
||||
<div class="action-btn" v-if="row.taskKey === 'startTask' || !row.instanceId"
|
||||
@click="onEdit(row)">
|
||||
<i class="fa fa-edit"></i>
|
||||
<span>编辑</span>
|
||||
</div>
|
||||
<div class="action-btn delete" v-if="row.canRevoke" @click="onRevoke(row)">
|
||||
<i class="fa fa-undo"></i>
|
||||
<span>撤回</span>
|
||||
</div>
|
||||
<div class="action-btn delete" v-if="row.taskKey === 'startTask' || !row.instanceId"
|
||||
@click="onDelete(row.id)">
|
||||
<i class="fa fa-trash"></i>
|
||||
<span>删除</span>
|
||||
</div>
|
||||
</template>
|
||||
</table-list>
|
||||
|
||||
<van-popup v-model="infoShow" position="right" :style="{ height: '100%', width: '100%' }" safe-area-inset-bottom>
|
||||
<van-sticky>
|
||||
<van-nav-bar @click-left="infoShow=false" left-arrow left-text="返回" title="申请信息"></van-nav-bar>
|
||||
</van-sticky>
|
||||
<info ref="infoRef"></info>
|
||||
</van-popup>
|
||||
</div>
|
||||
<script>
|
||||
<!--#include("../common/info.js"){}#-->
|
||||
new Vue({
|
||||
el: '#app',
|
||||
store,
|
||||
data() {
|
||||
return {
|
||||
pageForm: {
|
||||
pageNumber: 1,
|
||||
pageSize: 10,
|
||||
totalCount: 0,
|
||||
searchKeyword: "",
|
||||
unionId: "",
|
||||
unitId: ""
|
||||
},
|
||||
unionList: [],
|
||||
unitList: [],
|
||||
|
||||
infoShow: false
|
||||
}
|
||||
},
|
||||
components: {
|
||||
"info": INFO
|
||||
},
|
||||
methods: {
|
||||
historyBack,
|
||||
|
||||
onView(row) {
|
||||
this.infoShow = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.infoRef.onOpen(row)
|
||||
})
|
||||
},
|
||||
|
||||
onEdit(row) {
|
||||
this.$pjaxReplace('/platform/h5/difficultHelp/apply?taskId=' + (row.startTaskId || '') + "&bizId=" + row.id)
|
||||
},
|
||||
|
||||
onRevoke(row) {
|
||||
this.$dialog.confirm({
|
||||
title: "提示",
|
||||
message: "您确定要撤销吗?",
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消"
|
||||
}).then(() => {
|
||||
this.$axios.post("/flow/common/revokeTask", { taskId: row.startTaskId }).then((resp) => {
|
||||
this.$toast.success(resp.msg)
|
||||
this.doSearch()
|
||||
})
|
||||
})
|
||||
},
|
||||
|
||||
onDelete(id) {
|
||||
this.$dialog.confirm({
|
||||
title: "提示",
|
||||
message: "您确定要删除吗?",
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消"
|
||||
}).then(() => {
|
||||
this.$axios.post("/platform/difficultHelp/mine/onDelete", { id }).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.doSearch()
|
||||
this.$toast.success(res.msg)
|
||||
} else {
|
||||
this.$toast.fail(res.msg)
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
|
||||
doSearch() {
|
||||
this.pageForm.pageNumber = 1
|
||||
this.pageForm.totalCount = 0
|
||||
this.$refs.tableListRef.doSearch()
|
||||
},
|
||||
unionChange() {
|
||||
this.$set(this.pageForm, "unitId", null)
|
||||
this.flushUnits()
|
||||
this.doSearch()
|
||||
},
|
||||
async initUnion() {
|
||||
const hasAdmin = this.$auth.hasRoleOr(["SYSADMIN", "SCHOOL_UNION_ADMIN"])
|
||||
const unionId = hasAdmin ? null : this.$store.state.user.union.id
|
||||
this.unionList = await this.$businessTool.listUnion(unionId)
|
||||
this.unionList.forEach((v) => {
|
||||
v.text = v.name
|
||||
v.value = v.id
|
||||
})
|
||||
if (hasAdmin) {
|
||||
this.unionList.unshift({ text: "全部工会", value: null })
|
||||
}
|
||||
if (this.unionList && this.unionList.length > 0) {
|
||||
this.$set(this.pageForm, "unionId", this.unionList[0].value)
|
||||
}
|
||||
},
|
||||
async flushUnits() {
|
||||
const hasAdmin = this.$auth.hasRoleOr(["SYSADMIN", "SCHOOL_UNION_ADMIN"])
|
||||
const unionId = hasAdmin ? this.pageForm.unionId : this.$store.state.user.union.id
|
||||
this.unitList = await this.$businessTool.listUnit(unionId)
|
||||
this.unitList.forEach((v) => {
|
||||
v.text = v.name
|
||||
v.value = v.id
|
||||
})
|
||||
if (hasAdmin && !this.pageForm.unionId) {
|
||||
this.unitList.unshift({ text: "全部单位", value: null })
|
||||
}
|
||||
if (this.unitList && this.unitList.length > 0) {
|
||||
this.$set(this.pageForm, "unitId", this.unitList[0].value)
|
||||
}
|
||||
},
|
||||
},
|
||||
async created() {
|
||||
await this.initUnion()
|
||||
await this.flushUnits()
|
||||
}
|
||||
})
|
||||
</script>
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Title</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user