first commit

This commit is contained in:
2026-09-08 19:49:21 +08:00
commit ebffbab428
7320 changed files with 1477614 additions and 0 deletions
@@ -0,0 +1,516 @@
<!--#
layout("/mobile/platform.html"){
#-->
<div id="app" v-cloak>
<van-nav-bar title="填写慰问申请" left-arrow placeholder fixed
@click-left="history.back()"></van-nav-bar>
<van-form ref="addForm" :show-error-message="false" input-align="right">
<van-cell-group inset class="mt10">
<van-field readonly value="${@shiro.getPrincipalProperty('username')}" name="manager_name"
label="申请人"></van-field>
<van-field readonly :value="formData.apply_time" name="apply_time"
label="申请时间"
></van-field>
<van-field @input="userRemoteMethod" name="be_user_name"
required
v-model="formData.be_user_name" label="慰问对象" placeholder="请输入慰问对象"
:rules="[{ required: true, message: '请填写慰问对象' }]"></van-field>
<van-field v-model="formData.mobile" name="mobile" type="tel"
label="联系电话" placeholder="输入慰问对象后自动获取" maxlength="11" required
:rules="[{ required: true, message: '请输入慰问对象联系电话' },
{ pattern: /^1[3-9]\d{9}$/, message: '请输入正确的手机号码' }]"></van-field>
<van-action-sheet v-model="sheetShow"
:actions="userList"
cancel-text="重新输入姓名或工号查询"
@cancel="userList = [];formData.be_user_name=null;"
:close-on-click-overlay="false"
@select="onUserSelect">
</van-action-sheet>
<van-field @input="payeeUserRemoteMethod" name="payee_name"
required
v-model="formData.payee_name" label="收款人" placeholder="请输入收款人"
:rules="[{ required: true, message: '请填写收款人' }]"></van-field>
<van-action-sheet v-model="payeeSheetShow"
:actions="payeeUserList"
cancel-text="重新输入姓名或工号查询"
@cancel="payeeOnCancel"
:close-on-click-overlay="false"
@select="payeeOnUserSelect">
</van-action-sheet>
<van-field v-model="formData.payee_bank_number" name="payee_bank_number" type="number"
label="收款人银行卡" placeholder="请输入收款人银行卡" required
:rules="[{ required: true, message: '请输入收款人银行卡' }]"></van-field>
<van-field v-model="formData.payee_bank_name" name="payee_bank_name"
label="收款人开户行" placeholder="请输入收款人开户行" required
:rules="[{ required: true, message: '请输入收款人开户行' }]"></van-field>
<van-field readonly clickable name="type" :value="formData.typeName"
required
label="慰问类型"
@click="showTypePicker = true" placeholder="点击选择慰问类型"
:rules="[{ required:true, message: '请选择慰问类型'}]"></van-field>
<van-popup v-model:show="showTypePicker" position="bottom" round>
<van-picker show-toolbar :columns="typeColumns" @confirm="onTypeConfirm"
@cancel="showTypePicker = false">
</van-picker>
</van-popup>
<van-field readonly clickable name="way" :value="formData.wayName"
label="慰问方式"
required
placeholder="点击选择慰问方式"
:rules="[{ required:true, message: '请选择慰问方式'}]"></van-field>
<van-popup v-model:show="showWayPicker" position="bottom" round>
<van-picker show-toolbar :columns="wayColumns" @confirm="onWayConfirm"
@cancel="showWayPicker = false">
</van-picker>
</van-popup>
<van-field v-model="formData.money" name="money" type="number" label="慰问金额" readonly
placeholder="选择慰问类型自动匹配金额"
:rules="[{ required:true, message: '请填写慰问金额' }]"></van-field>
<van-field
required
:rules="[{ required:true, message: '请填写慰问时间' }]"
readonly
clickable
name="occur_time"
:value="formData.occur_time"
label="慰问时间"
placeholder="点击选择慰问时间"
@click="showOccurTime = true"
></van-field>
<van-calendar v-model="showOccurTime"
@confirm="onOccurTimeConfirm"
:min-date="minDate"
:max-date="maxDate"
:color="themeColor"></van-calendar>
<van-field v-if="formData.way === '慰问品 (C)'"
v-model="formData.goods_desc" name="goods_desc" label="慰问品"
placeholder="请输入选择的慰问品的名称、编号、规格等" required
:rules="[{ required:true, message: '请输入慰问品名称、编号、规格等' }]">
<template #button>
<van-button size="small" type="primary" @click.stop="previewGoodsAlbum">预览</van-button>
</template>
</van-field>
<!--生育(孩次),与 PC 端保持相同的类型显示逻辑。-->
<van-field v-if="formData.type === '29cf78eea88d40128f639b9ae7b6aaaa'"
readonly clickable required
:value="formData.birth_child_num"
name="birth_child_num" label="孩次"
placeholder="请选择孩次"
@click="showChildPicker = true"
:rules="[{ required:true, message: '请选择孩次' }]">
</van-field>
<van-popup v-model:show="showChildPicker" position="bottom" round>
<van-picker show-toolbar :columns="childColumns" @confirm="onChildConfirm"
@cancel="showChildPicker = false">
</van-picker>
</van-popup>
<template
v-if="['c7175af55693441e8233be4552cef9d5','0872ea0b95aa463fb8d98c46bdf72537'].includes(formData.type)">
<van-field :value="formData.hospital_stay"
readonly clickable required
@click="hospital_stay = true"
name="hospital_stay" label="住院时间"
placeholder="请选择住院时间"
:rules="[{ required:true, message: '请选择住院时间' }]"></van-field>
<van-calendar v-model="hospital_stay" type="range" @confirm="onConfirm"
:min-date="new Date('1999-01-01')"
:color="themeColor"></van-calendar>
<van-field v-model="formData.the_hospital" name="the_hospital" name="type" label="所在医院"
placeholder="请填写所在医院" required
:rules="[{ required:true, message: '请填写所在医院' }]"></van-field>
</template>
<van-field v-if="['0872ea0b95aa463fb8d98c46bdf72537'].includes(formData.type)"
v-model="formData.inpatientSurgicalName"
name="inpatientSurgicalName" label="手术名称"
placeholder="请填写手术名称"
required
:rules="[{ required:true, message: '请填写手术名称' }]">
</van-field>
<!--直系亲属去世-->
<van-field v-if="['925020dd63754aaea985c5672982a7f4'].includes(formData.type)"
v-model="formData.deadImmediateFamily"
name="deadImmediateFamily" label="直系亲属"
placeholder="配偶、父亲、母亲、子女"
required
:rules="[{ required:true, message: '请填写直系亲属' }]">
</van-field>
<van-field v-model="formData.remark" name="remark" label="申请事由" style="flex-flow: column"
required
:rules="[{ required:true, message: '请填写申请事由' }]"
placeholder="请填写申请事由"
input-align="left"
rows="3" maxlength="200" type="textarea" show-word-limit autosize>
<template #label>
<div class="mb10">申请事由</div>
</template>
</van-field>
</van-cell-group>
<van-cell-group inset class="mt10">
<van-field name="files" label="附&emsp;&emsp;件" required
style="flex-flow: column" input-align="left">
<template #label>
<div class="mb10">&emsp;&emsp;</div>
</template>
<template #input>
<vant-file-upload :files.sync="formData.files"></vant-file-upload>
<div v-if="uploadFileDesc" class="text-danger" style="color: #da3e16;">上传附件说明:{{uploadFileDesc}}</div>
</template>
</van-field>
</van-cell-group>
<van-cell-group inset class="mt10">
<van-field label="签字" required style="flex-flow: column">
<template #label>
<div class="mb10">&emsp;&emsp;</div>
</template>
<template #input>
<mobile-sign ref="signature" :my_sign.sync="formData.sign"></mobile-sign>
</template>
</van-field>
</van-cell-group>
<div style="display: flex; gap: 10px; margin: 20px 20px 10px 20px">
<van-button @click="saveDraft()" style="border-radius: 10px; flex: 1" block plain type="primary"
:color="themeColor" text="保存"></van-button>
<van-button @click="onSubmit()" style="border-radius: 10px; flex: 1" block type="info"
:color="themeColor">
提交
</van-button>
</div>
</van-form>
</div>
<script>
var vue = new Vue({
el: '#app',
mixins: [mobileMixins],
data() {
return {
goods: [],
payeeSheetShow: false,
payeeUserList: [],
hospital_stay: false,
userList: [],
formData: {
mobile: '',
goodsAlbum: [],
goods_desc: ''
},
showTypePicker: false,
showWayPicker: false,
showChildPicker: false,
sheetShow: false,
typeColumns: [],
wayColumns: [],
childColumns: [
{value: '一孩', text: '一孩'},
{value: '二孩', text: '二孩'},
{value: '三孩', text: '三孩'}
],
files: [],
showOccurTime: false,
// minDate: moment().subtract(5, 'year')._d,
minDate: new Date(2010, 1, 1),
maxDate: new Date(),
money: 0,
uploadFileDesc: '',
editId: ''
}
},
watch: {
"formData.money"(val) {
if (val > this.money) {
this.$notify({
title: '警告',
message: '金额超过规定金额' + this.money + "(元)",
type: 'warning'
});
this.$set(this.formData, "money", this.money)
}
}
},
components: {
'mobile-sign': httpVueLoader('/components/sign/mobileSign.vue?v=' + new Date().getTime()),
},
methods: {
priceInput() {
let num = 0
this.goods.forEach(v => {
num += parseFloat(v.price)
})
this.$set(this.formData, "money", num)
},
onOccurTimeConfirm(val) {
this.$set(this.formData, "occur_time", moment(val).format("YYYY-MM-DD"))
this.showOccurTime = false
},
onConfirm(date) {
const [start, end] = date;
this.hospital_stay = false;
this.formData.hospital_stay = moment(start).format('YYYY-MM-DD') + "-" + moment(end).format('YYYY-MM-DD');
this.$set(this.formData, "hospital_stay_1", moment(start).format('YYYY-MM-DD'))
this.$set(this.formData, "hospital_stay_2", moment(end).format('YYYY-MM-DD'))
},
async userRemoteMethod(event) {
if (event) {
const arr = await this.queryUser(event)
this.userList = arr.map(v => {
return {
name: v.username + "(" + v.loginname + ")", id: v.id
}
})
this.sheetShow = true
}
},
async payeeUserRemoteMethod(event) {
if (event) {
const arr = await this.queryUser(event)
this.payeeUserList = arr.map(v => {
return {
name: v.username + "(" + v.loginname + ")", id: v.id
}
})
this.payeeSheetShow = true
}
},
async queryUser(query) {
const {data} = await $.get("/platform/fw/condolence/apply/queryUser", {query})
return data
},
// 选择慰问对象后读取其联系电话,避免提交时使用申请人的手机号。
async getUserData(userId) {
if (!userId) {
return {}
}
const {data} = await $.get("/platform/fw/condolence/apply/getUserData", {userId})
return data || {}
},
async onUserSelect(u) {
this.$set(this.formData, 'be_user', u.id)
this.$set(this.formData, 'be_user_name', u.name)
const userData = await this.getUserData(u.id)
this.$set(this.formData, 'mobile', userData.mobile || '')
this.sheetShow = false
},
payeeOnCancel(){
if (!this.formData.payee){
this.$set(this.formData, 'payee_name', '')
}
this.payeeUserList = []
},
payeeOnUserSelect(u) {
this.$set(this.formData, 'payee', u.id)
this.$set(this.formData, 'payee_name', u.name)
this.payeeSheetShow = false
},
async onTypeConfirm(val) {
this.$set(this.formData, "typeName", val.text)
this.$set(this.formData, "type", val.value)
const {data, code, msg} = await $.get("/platform/condolence/type/findOne", {id: val.value})
this.$set(this, "money", data.money)
await this.moneyChange(val.value)
this.showTypePicker = false;
},
onWayConfirm(val) {
this.$set(this.formData, "wayName", val.text)
this.$set(this.formData, "way", val.value)
this.showWayPicker = false;
},
onChildConfirm(val) {
this.$set(this.formData, "birth_child_num", val.value)
this.showChildPicker = false
},
async moneyChange(id) {
const {data, code, msg} = await $.get("/platform/condolence/type/findOne", {id})
if (data) {
// 编辑回填时先同步金额上限,避免金额监听器因上限仍为 0 将金额重置为 0。
this.$set(this, "money", data.money)
this.$set(this.formData, "money", data.money)
this.$set(this.formData, "wayName", data.way)
this.$set(this.formData, "way", data.way)
this.$set(this.formData, "goodsAlbum", data.goodsAlbum || [])
this.$set(this, "uploadFileDesc", data.uploadFileDesc || '')
}
},
// 预览慰问品画册,未配置 PDF 时给出明确提示。
previewGoodsAlbum() {
const goodsAlbum = this.formData.goodsAlbum
if (!goodsAlbum || !goodsAlbum.length) {
vant.Toast('暂无慰问品画册')
return
}
const pdfStreamUrl = encodeURIComponent(FILE_STREAM_PREVIEW_ADDRESS + '?id=' + goodsAlbum[0].id)
window.location.href = '/mobile/condolence/apply/preview?file=' + pdfStreamUrl
},
async loadEditData(id) {
const resp = await $.get('/platform/fw/condolence/findOne', {id: id})
if (!resp.data) {
this.$toast.fail('获取申请信息失败')
return
}
const data = resp.data
condolence.toFormData(data)
this.$set(data, 'typeName', data.typename)
this.$set(data, 'wayName', data.way)
this.$set(data, 'be_user_name', data.be_username)
this.$set(data, 'payee_name', data.payee_username)
// 编辑时回填当前申请保存的签字图片,交由签字组件导入画布。
this.$set(data, 'sign', data.manager_sign_data || '')
this.$set(data, 'goods', data.Goods || data.goods || [])
if (data.starting_time && data.end_time) {
this.$set(data, 'hospital_stay', data.starting_time + '-' + data.end_time)
this.$set(data, 'hospital_stay_1', data.starting_time)
this.$set(data, 'hospital_stay_2', data.end_time)
}
// 先设置金额上限,再回填表单,避免金额监听器使用初始值 0 校验编辑数据。
const typeResp = await $.get('/platform/condolence/type/findOne', {id: data.type})
if (typeResp.data) {
this.$set(this, 'money', typeResp.data.money)
}
this.$set(this, 'formData', data)
this.$set(this, 'goods', data.goods || [])
this.$set(this, 'editId', id)
await this.moneyChange(data.type)
// 编辑数据和签字画布均为异步初始化,下一次渲染后再次导入原申请签字,确保画布完成回显。
if (data.manager_sign_data) {
this.$nextTick(() => {
if (this.$refs.signature) {
this.$refs.signature.importSign(data.manager_sign_data)
}
})
}
},
async onSubmit() {
if (!this.formData.files) {
vant.Toast('请上传附件材料!')
return
}
// 签字组件不是 Vant 原生表单控件,提交前单独校验画布,避免空签字绕过表单校验。
if (this.$refs.signature.checkNull()) {
this.$toast.fail('请签字!')
return
}
this.$refs.signature.submitSign()
/* if (this.$refs.signature.checkNull()) {
vant.Toast('请签名!')
return
}*/
await this.$refs.signature.updateSign()
const formData = clone(this.formData)
formData.files = JSON.stringify(formData.files)
formData.goods = this.goods
this.$refs['addForm'].validate().then(async () => {
this.$toast.loading('提交中...')
const url = this.editId ? '/platform/fw/condolence/apply/doEdit' : '/platform/fw/condolence/apply/doAdd'
const res = await $.post(url, {
data: JSON.stringify(formData),
sign: formData.sign,
hospital_stay_1: formData.hospital_stay_1,
hospital_stay_2: formData.hospital_stay_2
})
if (res.code === 0) {
this.$toast.success(this.editId ? '修改成功' : '申请成功');
setTimeout(() => {
location.replace('/mobile/condolence/apply')
}, 1000)
} else {
this.$toast.fail('申请失败');
}
})
},
async saveDraft() {
// 保存草稿前先读取当前画布签字,否则签字只停留在画布中,不会写入申请数据。
if (this.$refs.signature) {
this.$refs.signature.submitSign()
}
const formData = clone(this.formData)
formData.files = JSON.stringify(formData.files || [])
formData.goods = this.goods
this.$toast.loading({message: '保存中...', forbidClick: true})
const res = await $.post('/platform/fw/condolence/apply/doSave', {
data: JSON.stringify(formData),
sign: formData.sign || '',
hospital_stay_1: formData.hospital_stay_1,
hospital_stay_2: formData.hospital_stay_2
})
if (res.code === 0) {
this.$toast.success('保存成功')
setTimeout(() => {
location.replace('/mobile/condolence/apply')
}, 1000)
} else {
this.$toast.fail(res.msg || '保存失败')
}
},
},
mounted() {
this.$nextTick(() => {
// 新增申请加载用户默认签字,编辑申请由详情数据回填原申请签字。
if (this.$refs.signature && !GetQueryString('id')) {
this.$refs.signature.getMySign()
}
})
},
async created() {
const {code, data} = await $.get("/platform/condolence/type/getAll")
data.forEach(v => {
this.typeColumns.push({value: v.id, text: v.name + "(" + v.code + ")"})
})
for (let i in condolence.way) {
this.wayColumns.push({value: condolence.way[i], text: condolence.way[i]})
}
const id = GetQueryString('id')
if (id) {
await this.loadEditData(id)
} else {
this.$set(this.formData, 'apply_time', moment().format('YYYY-MM-DD'))
}
}
})
</script>
<style>
.up_down > .van-cell {
flex-flow: column;
}
.up_down > .van-cell > .van-field__label {
width: 100%;
}
.van-cell, .van-picker button, .submit .van-button--normal {
font-size: 16px;
}
.van-divider {
margin: 10px 0;
}
</style>
<!--#
}
#-->
@@ -0,0 +1,38 @@
<!--#
layout("/mobile/platform.html"){
#-->
<style>
</style>
<div id="app" v-cloak>
<van-nav-bar title="慰问申请信息" left-arrow placeholder fixed
@click-left="history.back()"></van-nav-bar>
<div>
<condolence-info :id.sync="id"></condolence-info>
</div>
</div>
<script>
var vue = new Vue({
el: '#app',
mixins: [mobileMixins],
data() {
return {
id: "",
state_id: ""
}
},
components: {
'condolence-info': httpVueLoader('/components/condolence/mobile/common.vue?v=' + new Date().getTime()),
},
async created() {
this.id = GetQueryString('id')
this.state_id = GetQueryString('state_id')
}
})
</script>
<!--#
}
#-->
@@ -0,0 +1,219 @@
<!--#
layout("/mobile/platform.html"){
#-->
<style>
.list-card {
position: relative;
width: auto;
margin: 10px 0 20px;
overflow: hidden;
background-color: #ffffff;
border-radius: 6px;
box-shadow: 0 8px 12px #ebedf0;
}
.apply_btn {
animation: come .5s;
position: fixed;top: 20%;right: 0
}
.apply-card-actions {
display: flex;
justify-content: flex-end;
align-items: center;
border-top: 1px solid #eeeeee;
margin: 0 16px;
padding: 10px 0 4px;
}
.apply-card-actions .action-btn {
margin-left: 10px;
padding: 4px 2px;
color: #1989fa;
font-size: 14px;
line-height: 20px;
cursor: pointer;
}
.apply-card-actions .action-btn.delete {
color: #ee0a24;
}
.apply-card-actions .action-btn .fa {
margin-right: 4px;
}
@keyframes come {
from {
right: -100px;
}
to {
right: 0px;
}
}
</style>
<div id="app" v-cloak>
<m-page-loading v-if="mLoading"></m-page-loading>
<van-nav-bar title="慰问申请列表" left-arrow placeholder fixed @click-left="history.back()"></van-nav-bar>
<div class="search-fixed">
<van-dropdown-menu active-color="#1989fa">
<van-dropdown-item v-model="pageForm.year" :options="yearOption" @change="yearChange"></van-dropdown-item>
<van-dropdown-item v-model="pageForm.type" :options="typeOption" @change="typeChange"></van-dropdown-item>
</van-dropdown-menu>
</div>
<div style="margin: 60px auto 0 auto">
<van-list v-model="loading" :finished="finished" :finished-text="tableData.length>0?'没有更多了':''"
@load="pageData">
<div v-for="o in tableData" class="list-card" @click="openInfo(o)">
<van-cell-group>
<van-cell :border="false" title="被慰问人">
<span class="van-ellipsis" style="font-size: 16px;" :style="{color:themeColor}">
{{o.be_username}}
</span>
</van-cell>
<van-cell :border="false" title="申请时间">{{o.apply_time}}</van-cell>
<van-cell :border="false" title="慰问类型">{{o.type_name}}</van-cell>
<van-cell :border="false" title="慰问方式">{{o.way}}</van-cell>
<van-cell :border="false" title="所属单位">{{o.be_unitname}}</van-cell>
<van-cell :border="false" title="审核状态">
<span :style="'color:'+o.state_color">{{ o.state_name }}</span>
</van-cell>
</van-cell-group>
<div class="apply-card-actions" @click.stop>
<div class="action-btn" @click.stop="openInfo(o)">
<i class="fa fa-eye"></i>
<span>查看</span>
</div>
<div class="action-btn" @click.stop="openEdit(o)" v-if="canEdit(o)">
<i class="fa fa-edit"></i>
<span>编辑</span>
</div>
<div class="action-btn delete" @click.stop="doDelete(o)">
<i class="fa fa-trash"></i>
<span>删除</span>
</div>
</div>
</div>
</van-list>
<!-- <van-button v-show="visible" class="apply_btn" @click.stop="openApply" plain hairline>-->
<!-- <template #icon>-->
<!-- <svg t="1634200664904" class="icon" viewBox="0 0 1024 1024" version="1.1"-->
<!-- xmlns="http://www.w3.org/2000/svg" p-id="3163" width="32" height="32">-->
<!-- <path d="M837.632 160.768c64 0 117.248 53.248 117.248 117.248v470.528c0 64-53.248 117.248-117.248 117.248H187.904c-64 2.048-117.248-50.688-117.248-114.688V278.016c0-64 53.248-117.248 117.248-117.248h649.728z m66.048 590.848V274.944c0-32.768-28.16-60.416-60.416-60.416H184.832c-32.768 0-60.416 28.16-60.416 60.416v479.232c0 32.768 28.16 60.416 60.416 60.416h657.92c32.768-2.56 60.928-28.16 60.928-62.976zM387.072 317.44"-->
<!-- fill="#2E77ED" p-id="3164"></path>-->
<!-- <path d="M326.144 709.632c-14.848 0-26.624-12.288-26.624-27.136V455.68c0-14.848 12.288-27.136 27.136-27.136S353.28 440.832 353.28 455.68v226.816c-0.512 15.36-12.288 27.136-27.136 27.136z"-->
<!-- fill="#FFBB12" p-id="3165"></path>-->
<!-- <path d="M569.856 442.368c0-14.848 12.288-26.624 27.136-26.624H757.76c14.848 0 27.136 12.288 27.136 27.136s-12.288 26.624-27.136 26.624h-160.768c-15.36 0-27.136-12.288-27.136-27.136zM569.856 682.496c0-14.848 12.288-26.624 27.136-26.624H757.76c14.848 0 27.136 12.288 27.136 27.136s-12.288 26.624-27.136 26.624h-160.768c-15.36 0-27.136-12.288-27.136-27.136zM569.856 553.472c0-14.848 12.288-26.624 27.136-26.624H757.76c14.848 0 27.136 12.288 27.136 27.136s-12.288 26.624-27.136 26.624h-160.768c-15.36 0-27.136-12.288-27.136-27.136z"-->
<!-- fill="#2E77ED" p-id="3166"></path>-->
<!-- <path d="M228.352 509.44c-10.24-10.752-10.24-27.648 0-37.888l78.336-78.336c10.752-10.752 27.648-10.752 37.888 0s10.24 27.648 0 37.888L266.24 509.44c-10.24 10.752-27.136 10.752-37.888 0z"-->
<!-- fill="#FFBB12" p-id="3167"></path>-->
<!-- <path d="M306.688 393.216c10.752-10.24 27.648-10.24 37.888 0l78.336 78.336c10.752 10.752 10.752 27.648 0 37.888s-27.648 10.24-37.888 0L306.688 431.104c-10.24-10.752-10.24-27.648 0-37.888z"-->
<!-- fill="#FFBB12" p-id="3168"></path>-->
<!-- </svg>-->
<!-- </template>-->
<!-- 申请-->
<!-- </van-button>-->
</div>
<van-empty v-if="mLoading==false&&tableData.length==0" class="custom-image" image="/none.svg"
description="暂无数据">
</van-empty>
</div>
<script>
var vue = new Vue({
el: '#app',
mixins: [mobileMixins],
data() {
return {
visible: true,
typeOption: [
{value: null, text: '全部'}
],
yearOption: [],
pageForm: {
// 首次加载时直接携带当前年份,避免列表组件先于 created 回调发起无年份条件的查询。
year: new Date().getFullYear(),
type: null
}
}
},
components: {
'mobile-sign': httpVueLoader('/components/sign/mobileSign.vue'),
},
methods: {
openApply() {
window.location.href = '/mobile/condolence/apply/for'
},
openInfo(row) {
window.location.href = '/mobile/condolence/apply/info?id=' + row.id + '&state_id=' + row.state_id
},
openEdit(row) {
window.location.href = '/mobile/condolence/apply/for?id=' + row.id
},
// 编辑权限与详情页保持一致,退回修改和可编辑的初始状态才显示编辑按钮。
canEdit(row) {
return [-1, 1990, 1995, 2000, 2010, 2012].includes(Number(row.state_id))
},
async doDelete(row) {
const confirm = await vant.Dialog.confirm({
title: '提示',
message: '确定要删除吗?',
})
if (confirm === 'confirm') {
const resp = await $.post('/platform/fw/condolence/doDelete', {id: row.id})
if (resp.code === 0) {
this.$toast.success('删除成功')
this.$set(this, 'tableData', this.tableData.filter(item => item.id !== row.id))
} else {
this.$toast.fail(resp.msg || '删除失败')
}
}
},
yearChange(val) {
this.$set(this.pageForm, 'year', val)
this.onRefresh()
},
typeChange(val) {
this.$set(this.pageForm, 'type', val)
this.onRefresh()
},
listenTouch() {
this.$nextTick(() => {
const app = document.querySelector("#app")
app.addEventListener('touchstart', () => {
this.visible = false
})
app.addEventListener('touchend', () => {
this.visible = true
})
})
}
},
mounted() {
this.listenTouch()
},
async created() {
this.mLoading = true
for (let i = new Date().getFullYear() - 10; i <= new Date().getFullYear(); i++) {
this.yearOption.unshift({value: i, text: i + '年'},)
}
const {code, data} = await $.get("/platform/condolence/type/getAll")
data.forEach(v => {
this.typeOption.push({value: v.id, text: v.name + v.code})
})
this.$set(this.pageForm, "year", this.yearOption[0].value)
this.$set(this.pageForm, "type", this.typeOption[0].value)
this.mLoading = false
}
})
</script>
<!--#
}
#-->
@@ -0,0 +1,152 @@
<!--#
layout("/mobile/platform.html"){
#-->
<div id="app" v-cloak>
<m-page-loading v-if="mLoading"></m-page-loading>
<van-nav-bar title="慰问审核" left-arrow placeholder fixed
@click-left="history.go(-1)"></van-nav-bar>
<div class="search-fixed">
<van-dropdown-menu :active-color="themeColor">
<van-dropdown-item v-model="pageForm.year" @change="yearChange"
:options="yearList"></van-dropdown-item>
<van-dropdown-item v-model="pageForm.isAudit" @change="yearChange"
:options="auditList"></van-dropdown-item>
<van-dropdown-item v-model="pageForm.type" @change="yearChange"
:options="mCondolence.typeList"></van-dropdown-item>
<van-dropdown-item v-model="pageForm.unionId" @change="yearChange"
:options="mCommon.unionList"></van-dropdown-item>
<van-dropdown-item v-model="pageForm.unitId" @change="yearChange"
:options="mCommon.unitList"></van-dropdown-item>
</van-dropdown-menu>
</div>
<div style="margin: 70px auto 0">
<van-list v-model="mLoading" :finished="finished"
:finished-text="tableData.length>0?'没有更多了':''"
@load="pageData">
<div v-for="o in tableData" class="list-card" @click="openView(o)">
<van-cell-group inset>
<van-cell :border="false" title="被慰问人">
<span class="van-ellipsis" style="font-size: 16px;"
:style="{color:themeColor}">
{{o.be_username}}
</span>
</van-cell>
<van-cell :border="false" title="申&ensp;请&ensp;人">{{o.sqr_username}}</van-cell>
<van-cell :border="false" title="所在单位">{{o.be_unitname}}</van-cell>
<van-cell :border="false" title="所在工会">{{o.be_unionname}}</van-cell>
<van-cell :border="false" title="慰问类型">{{o.type_name}}</van-cell>
<van-cell :border="false" title="慰问方式">{{o.way}}</van-cell>
<van-cell :border="false" title="申请时间">{{o.apply_time}}</van-cell>
<van-cell :border="false" title="审核状态">
<span :style="'color:'+o.state_color">{{ o.state_name }}</span>
</van-cell>
</van-cell-group>
</div>
</van-list>
<van-empty v-if="mLoading==false&&tableData.length==0" class="custom-image"
image="/none.svg"
description="暂无数据">
</van-empty>
</div>
</div>
<script>
var vue = new Vue({
el: '#app',
mixins: [mobileMixins],
data() {
return {
unitList: [],
unionList: [],
yearList: [],
auditList: [
{text: '未审核', value: false},
{text: '已审核', value: true},
],
handle: true,
pageForm: {
year: new Date().getFullYear(),
isAudit: false,
},
}
},
methods: {
openView(o) {
window.location.href = '/mobile/condolence/audit/auditHtml?state_id=' + o.state_id + '&id=' + o.id
},
yearChange() {
this.tableData = []
this.refreshing = true;
this.finished = false;
this.pageForm.pageNumber = 0
this.flushUnits()
},
pageData() {
this.mLoading = true
$.get(loc() + '/pageData', this.pageForm, (res) => {
if (res.code === 0) {
this.tableData = this.tableData.concat(res.data.list)
if (this.tableData.length === res.data.totalCount) {
this.finished = true
} else {
this.pageForm.pageNumber++
}
}
})
this.mLoading = false
},
async flushUnits() {
//this.$set(this.pageForm, "unitId", "")
if ("${@shiro.hasRole('sysadmin')||@shiro.hasRole('A06')||@shiro.hasRole('H03')}" === 'true') {
await mCommon.getUnitList(this.pageForm.unionId)
} else {
await mCommon.getUnitList("${@shiro.getPrincipalProperty('unit').getUnionid()}")
}
},
async init() {
let nowYear = new Date().getFullYear()
for (let i = nowYear; i >= nowYear - 9; i--) {
this.yearList.push({text: i, value: i})
}
await mCondolence.getType()
await mCommon.getUnionList()
if (mCondolence.typeList && mCondolence.typeList.length > 0) {
this.$set(this.pageForm, "type", mCondolence.typeList[0].value)
}
if (mCommon.unionList && mCommon.unionList.length > 0) {
this.$set(this.pageForm, "unionId", mCommon.unionList[0].value)
}
if (mCommon.unitList && mCommon.unitList.length > 0) {
this.$set(this.pageForm, "unitId", mCommon.unitList[0].value)
}
}
},
async created() {
this.init()
this.flushUnits()
if (GetQueryString("audit") === '1') {
this.pageForm.isAudit = true
}
}
})
window.addEventListener('pageshow', e => {
if (e.persisted || (window.performance && window.performance.navigation.type === 2)) {
vue.init()
vue.yearChange()
}
})
</script>
<!--#
}
#-->
@@ -0,0 +1,141 @@
<!--#
layout("/mobile/platform.html"){
#-->
<div id="app" v-cloak>
<van-nav-bar title="慰问审核" left-arrow placeholder fixed
@click-left="history.back()"></van-nav-bar>
<condolence-info ref="info" :id.sync="id" title="二级党组织审核" :handle="handle">
<template #handle>
<div class="van-cell-group__title mt20">
<div class="van-sidebar-item van-sidebar-item--select">
二级党组织审核
</div>
</div>
<van-form>
<van-field readonly left-icon="contact"
value="${@shiro.getPrincipalProperty('username')}"
name="username"
label="审核人员"
></van-field>
<van-field v-model="formData.time" label="审核时间" left-icon="clock-o"
readonly></van-field>
<van-field v-model="formData.money" label="慰问金额" type="number"
left-icon="balance-list-o"
required :rules="[{ required:true, message: '请输入慰问金额' }]"
></van-field>
<van-field v-model="formData.opinion"
left-icon="chat-o"
rows="1"
required
:rules="[{ required:true, message: '请输入审核意见' }]"
autosize
label="审核意见"
type="textarea"
placeholder="请输入审核意见"
></van-field>
<van-field label="签字" required style="flex-flow: column">
<template #label>
<div class="mb10">&emsp;&emsp;</div>
</template>
<template #input>
<mobile-sign ref="signature" :my_sign.sync="formData.sign"></mobile-sign>
</template>
</van-field>
<van-row gutter="20" style="margin-top: 30px;padding: 0 25px">
<van-col span="8">
<van-button :color="themeColor" plain block @click="doAudit(1)">拒 绝
</van-button>
</van-col>
<van-col span="8">
<van-button :color="themeColor" block @click="doAudit(2)">返回修改
</van-button>
</van-col>
<van-col span="8">
<van-button :color="themeColor" block @click="doAudit(3)">通 过
</van-button>
</van-col>
</van-row>
</van-form>
</template>
</condolence-info>
</div>
<script>
var vue = new Vue({
el: '#app',
mixins: [mobileMixins],
data() {
return {
handle: true,
id: "",
formData: {},
}
},
components: {
'mobile-sign': httpVueLoader('/components/sign/mobileSign.vue'),
'condolence-info': httpVueLoader('/components/condolence/mobile/common.vue?v=' + new Date().getTime()),
},
methods: {
async doAudit(pass) {
if (!this.formData.opinion) {
this.$toast.fail('请填写审核意见');
return
}
this.$refs.signature.submitSign()
/* if (this.$refs.signature.checkNull()) {
vant.Toast('请签名!')
return
}*/
await this.$refs.signature.updateSign()
this.formData.pass = pass
const resp = await $.post("/platform/fw/condolence/fr/doReview", this.formData)
if (resp.code === 0) {
this.$toast.success('审核成功')
setTimeout(() => {
window.history.back()
}, 1000)
} else {
this.$toast.fail('审核失败');
}
},
},
async created() {
this.id = GetQueryString("id")
const {data} = await $.get("/platform/fw/condolence/findOne", {id: this.id})
this.formData = {
id: this.id,
username: "${@shiro.getPrincipalProperty('username')}",
time: moment().format('YYYY-MM-DD'),
opinion: null,
sign: "",
money: data.money
}
}
})
</script>
<!--#
}
#-->
@@ -0,0 +1,34 @@
<!--#
layout("/mobile/platform.html"){
#-->
<div id="app" v-cloak>
<van-nav-bar title="慰问品画册" left-arrow placeholder fixed
@click-left="history.back()"></van-nav-bar>
<iframe v-if="pdfUrl" :src="pdfUrl"
style="width: 100%; height: calc(100vh - 46px); border: 0; display: block;"></iframe>
<van-empty v-else description="暂无预览文件"></van-empty>
</div>
<script>
var vue = new Vue({
el: '#app',
mixins: [mobileMixins],
data() {
return {
pdfUrl: ''
}
},
async created() {
const file = GetQueryString('file')
if (file) {
// 预览地址通过参数传入,使用当前页面 iframe 承载 PDF.js,保留应用返回导航。
this.$set(this, 'pdfUrl', '/assets/platform/plugins/pdfJs/web/viewer.html?file=' + file)
}
}
})
</script>
<!--#
}
#-->
@@ -0,0 +1,136 @@
<!--#
layout("/mobile/platform.html"){
#-->
<div id="app" v-cloak>
<van-nav-bar title="慰问审核" left-arrow placeholder fixed
@click-left="history.back()"></van-nav-bar>
<condolence-info ref="info" :id.sync="id" title="校工会审核" :handle="handle">
<template #handle>
<div class="van-cell-group__title mt10">
<div class="van-sidebar-item van-sidebar-item--select">
校工会审核
</div>
</div>
<van-form>
<van-field readonly
left-icon="contact"
value="${@shiro.getPrincipalProperty('username')}"
name="username"
label="审核人员"
></van-field>
<van-field v-model="formData.time" label="审核时间" left-icon="clock-o"
readonly></van-field>
<van-field v-model="formData.opinion"
rows="1"
required
left-icon="chat-o"
autosize
label="审核意见"
type="textarea"
placeholder="请输入审核意见"
></van-field>
<van-field label="签字" required style="flex-flow: column">
<template #label>
<div class="mb10">&emsp;&emsp;</div>
</template>
<template #input>
<mobile-sign ref="signature" :my_sign.sync="formData.sign"></mobile-sign>
</template>
</van-field>
<van-row gutter="20" style="margin-top: 30px;padding: 0 25px">
<van-col span="8">
<van-button :color="themeColor" plain block @click="doAudit(1)">拒 绝
</van-button>
</van-col>
<van-col span="8">
<van-button color="red" block plain @click="doAudit(2)">返回修改
</van-button>
</van-col>
<van-col span="8">
<van-button :color="themeColor" block @click="doAudit(3)">通 过
</van-button>
</van-col>
</van-row>
</van-form>
</template>
</condolence-info>
</div>
<script>
var vue = new Vue({
el: '#app',
mixins: [mobileMixins],
data() {
return {
handle: true,
id: "",
formData: {},
}
},
components: {
'mobile-sign': httpVueLoader('/components/sign/mobileSign.vue?v=' + new Date().getTime()),
'condolence-info': httpVueLoader('/components/condolence/mobile/common.vue?v=' + new Date().getTime()),
},
methods: {
async doAudit(pass) {
if (!this.formData.opinion) {
this.$toast.fail('请填写审核意见');
return
}
// 审核签字由独立画布维护,不能只依赖 van-field 的 required 属性。
if (this.$refs.signature.checkNull()) {
this.$toast.fail('请签字!')
return
}
this.$refs.signature.submitSign()
/* if (this.$refs.signature.checkNull()) {
vant.Toast('请签名!')
return
}*/
await this.$refs.signature.updateSign()
this.formData.pass = pass
const resp = await $.post("/platform/fw/condolence/vcr/doReview", this.formData)
if (resp.code === 0) {
this.$toast.success('审核成功');
setTimeout(() => {
history.back()
}, 1000)
} else {
this.$toast.fail('审核失败');
}
},
},
async created() {
this.id = GetQueryString("id")
this.formData = {
id: this.id,
username: "${@shiro.getPrincipalProperty('username')}",
time: moment().format('YYYY-MM-DD'),
opinion: null,
sign: ""
}
}
})
</script>
<!--#
}
#-->
@@ -0,0 +1,137 @@
<!--#
layout("/mobile/platform.html"){
#-->
<div id="app" v-cloak>
<van-nav-bar title="慰问审核" left-arrow placeholder fixed
@click-left="history.back()"></van-nav-bar>
<condolence-info ref="info" :id.sync="id" title="单位领导审核" :handle="handle">
<template #handle>
<div class="van-cell-group__title mt10">
<div class="van-sidebar-item van-sidebar-item--select">
单位领导审核
</div>
</div>
<van-form>
<van-field
readonly
left-icon="contact"
value="${@shiro.getPrincipalProperty('username')}"
name="username"
label="审核人员"
></van-field>
<van-field v-model="formData.time" label="审核时间" left-icon="clock-o"
readonly></van-field>
<van-field v-model="formData.opinion"
left-icon="chat-o"
required
rows="1"
autosize
label="审核意见"
type="textarea"
placeholder="请输入审核意见"
></van-field>
<van-field label="签字" required style="flex-flow: column">
<template #label>
<div class="mb10">&emsp;&emsp;</div>
</template>
<template #input>
<mobile-sign ref="signature" :my_sign.sync="formData.sign"></mobile-sign>
</template>
</van-field>
<van-row gutter="20" style="margin-top: 30px;padding: 0 25px">
<van-col span="8">
<van-button :color="themeColor" plain block @click="doAudit(1)">拒 绝
</van-button>
</van-col>
<van-col span="8">
<van-button color="red" block @click="doAudit(2)">返回修改
</van-button>
</van-col>
<van-col span="8">
<van-button :color="themeColor" block @click="doAudit(3)">通 过
</van-button>
</van-col>
</van-row>
</van-form>
</template>
</condolence-info>
</div>
<script>
var vue = new Vue({
el: '#app',
mixins: [mobileMixins],
data() {
return {
handle: true,
id: "",
formData: {},
}
},
components: {
'mobile-sign': httpVueLoader('/components/sign/mobileSign.vue?v=' + new Date().getTime()),
'condolence-info': httpVueLoader('/components/condolence/mobile/common.vue?v=' + new Date().getTime()),
},
methods: {
async doAudit(pass) {
if (!this.formData.opinion) {
this.$toast.fail('请填写审核意见');
return
}
// 审核签字由独立画布维护,不能只依赖 van-field 的 required 属性。
if (this.$refs.signature.checkNull()) {
this.$toast.fail('请签字!')
return
}
this.$refs.signature.submitSign()
/* if (this.$refs.signature.checkNull()) {
vant.Toast('请签名!')
return
}*/
await this.$refs.signature.updateSign()
this.formData.pass = pass
const resp = await $.post("/platform/fw/condolence/ucr/doReview", this.formData)
if (resp.code === 0) {
await doCompletes();
this.$toast.success('审核成功');
setTimeout(() => {
history.back()
}, 1000)
} else {
this.$toast.fail('审核失败');
}
},
},
async created() {
this.id = GetQueryString("id")
this.formData = {
id: this.id,
username: "${@shiro.getPrincipalProperty('username')}",
time: moment().format('YYYY-MM-DD'),
opinion: null,
sign: ""
}
}
})
</script>
<!--#
}
#-->