慰问、会员入会接入待办
This commit is contained in:
@@ -223,9 +223,12 @@ layout("/mobile/platform.html"){
|
||||
roles: [],
|
||||
active: 1,
|
||||
needCount: 0,
|
||||
needRequestId: 0,
|
||||
needItems: [],
|
||||
activeName: '0',
|
||||
completedItems: [],
|
||||
completedLoading: false,
|
||||
completedRequestId: 0,
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
@@ -244,7 +247,8 @@ layout("/mobile/platform.html"){
|
||||
location.href = o.mobileHref
|
||||
},
|
||||
toHref(o) {
|
||||
location.href = o.mobileUrl + '?audit=1';
|
||||
// 详情链接已携带申请 ID,保留查询参数。
|
||||
location.href = o.mobileUrl;
|
||||
},
|
||||
/**
|
||||
* 入学登记待办
|
||||
@@ -256,20 +260,111 @@ layout("/mobile/platform.html"){
|
||||
this.needItems = this.needItems.concat(data.filter(v => v.number > 0))
|
||||
}
|
||||
},*/
|
||||
async getNeedItems() {
|
||||
const {data, code} = await $.get('/platform/needItems/getNeedItems')
|
||||
if (code === 0) {
|
||||
const obj = data.filter(v => {
|
||||
return v.mobileHref != null && v.count > 0
|
||||
/**
|
||||
* requestId 为本轮刷新序号,忽略旧请求,避免返回页面或切换页签时覆盖新数据。
|
||||
* 通用接口 data 为待办数组,使用 count 和 mobileHref;完成后继续加载慰问待办。
|
||||
*/
|
||||
getNeedItems(requestId) {
|
||||
return $.post('/platform/needItems/getNeedItems')
|
||||
.then((res) => {
|
||||
if (requestId === this.needRequestId && res.code === 0) {
|
||||
this.$set(this, 'needItems', (res.data || []).filter(v => v.mobileHref && v.count > 0
|
||||
&& v.mobileHref.split('?')[0] !== '/mobile/member/audit'
|
||||
&& !['/platform/member/apply/audit/union', '/platform/member/apply/audit/school'].includes((v.href || '').split('?')[0])))
|
||||
}
|
||||
})
|
||||
.always(() => {
|
||||
if (requestId === this.needRequestId) {
|
||||
this.getCondolenceAgenda(requestId)
|
||||
}
|
||||
})
|
||||
this.needItems = obj
|
||||
}
|
||||
},
|
||||
async getCompletes() {
|
||||
const {data, code} = await $.get('/platform/sys/completed/getCompletes')
|
||||
if (code === 0) {
|
||||
this.completedItems = data;
|
||||
}
|
||||
/**
|
||||
* 复用 PC 慰问待办的菜单权限和统计口径,将 label/number 转为手机模板的 name/count。
|
||||
* 仅映射手机端已有审核页面的三个节点,历史常务副主席节点不提供手机办理入口。
|
||||
*/
|
||||
getCondolenceAgenda(requestId) {
|
||||
const auditUrls = [
|
||||
'/platform/fw/condolence/ucr/union',
|
||||
'/platform/fw/condolence/fr',
|
||||
'/platform/fw/condolence/vcr/school'
|
||||
]
|
||||
return $.post('/platform/condolence/agent/getAgenda')
|
||||
.then((res) => {
|
||||
if (requestId !== this.needRequestId || res.code !== 0) {
|
||||
return
|
||||
}
|
||||
const items = (res.data || []).filter(v => auditUrls.includes(v.url) && v.number > 0)
|
||||
.map(v => ({
|
||||
title: v.title,
|
||||
name: v.label,
|
||||
count: v.number,
|
||||
mobileHref: '/mobile/condolence/audit'
|
||||
}))
|
||||
this.$set(this, 'needItems', this.needItems.concat(items))
|
||||
})
|
||||
.always(() => {
|
||||
if (requestId === this.needRequestId) {
|
||||
this.getMemberApplyAgenda(requestId)
|
||||
}
|
||||
})
|
||||
},
|
||||
/**
|
||||
* 无需业务参数;后端按会话权限返回今年会员入会节点,字段与首页待办卡片一致。
|
||||
* 专用数据替代通用配置中的同业务卡片,避免双计数;失败不影响已加载的慰问待办。
|
||||
*/
|
||||
getMemberApplyAgenda(requestId) {
|
||||
return $.post('/platform/member/agenda/getMobileAgenda')
|
||||
.then((res) => {
|
||||
if (requestId !== this.needRequestId) return
|
||||
if (res.code === 0) {
|
||||
const items = (res.data || []).filter(v => v.count > 0 && v.mobileHref)
|
||||
this.$set(this, 'needItems', this.needItems.concat(items))
|
||||
} else {
|
||||
vant.Toast.fail('会员入会待办加载失败,请重试')
|
||||
}
|
||||
}, () => {
|
||||
if (requestId === this.needRequestId) vant.Toast.fail('会员入会待办加载失败,请重试')
|
||||
})
|
||||
.always(() => {
|
||||
if (requestId === this.needRequestId) this.$set(this, 'needCount', this.needItems.length)
|
||||
})
|
||||
},
|
||||
/**
|
||||
* 两个接口均无需传办理人,按当前会话返回本人今年已办。
|
||||
* 各业务独立合并;全部请求结束后关闭 loading,旧刷新结果不得覆盖当前列表。
|
||||
*/
|
||||
getCompletes() {
|
||||
const requestId = this.completedRequestId + 1
|
||||
this.$set(this, 'completedRequestId', requestId)
|
||||
this.$set(this, 'completedItems', [])
|
||||
this.$set(this, 'completedLoading', true)
|
||||
const sources = [
|
||||
{url: '/platform/condolence/agent/getCompletes', label: '慰问'},
|
||||
{url: '/platform/member/agenda/getCompletes', label: '会员入会'}
|
||||
]
|
||||
let remaining = sources.length
|
||||
const requests = sources.map(source => $.post(source.url)
|
||||
.then((res) => {
|
||||
if (requestId !== this.completedRequestId) return
|
||||
if (res.code === 0) {
|
||||
const items = this.completedItems.concat(res.data || [])
|
||||
// 现有日期字段统一交给 moment 解析,兼容日期字符串和时间戳。
|
||||
items.sort((a, b) => (moment(b.auditTime).valueOf() || 0) - (moment(a.auditTime).valueOf() || 0))
|
||||
this.$set(this, 'completedItems', items)
|
||||
} else {
|
||||
vant.Toast.fail(source.label + '已办加载失败,请重试')
|
||||
}
|
||||
}, () => {
|
||||
if (requestId === this.completedRequestId) vant.Toast.fail(source.label + '已办加载失败,请重试')
|
||||
})
|
||||
.always(() => {
|
||||
remaining--
|
||||
if (requestId === this.completedRequestId && remaining === 0) {
|
||||
this.$set(this, 'completedLoading', false)
|
||||
}
|
||||
}))
|
||||
return $.when.apply($, requests)
|
||||
},
|
||||
/**
|
||||
* 会员个人核对待办
|
||||
@@ -291,12 +386,13 @@ layout("/mobile/platform.html"){
|
||||
this.needItems = this.needItems.concat(data.filter(v => v.count > 0))
|
||||
}
|
||||
},
|
||||
async initData() {
|
||||
await this.getNeedItems();
|
||||
// await this.getMemberCheckSelfAgenda()
|
||||
// await this.getWelfareCheckSelfAgenda()
|
||||
// await this.getCompletes();
|
||||
this.needCount = this.needItems.length
|
||||
initData() {
|
||||
this.getCompletes()
|
||||
// 每轮重新合并通用、慰问和会员入会待办,防止重复追加;刷新序号隔离尚未完成的旧请求。
|
||||
this.$set(this, 'needRequestId', this.needRequestId + 1)
|
||||
this.$set(this, 'needItems', [])
|
||||
this.$set(this, 'needCount', 0)
|
||||
return this.getNeedItems(this.needRequestId)
|
||||
},
|
||||
async setNeedItems() {
|
||||
const {data, code} = await $.get('/platform/needItems/getNeedItems')
|
||||
|
||||
@@ -59,9 +59,10 @@ layout("/mobile/platform.html"){
|
||||
{text: '已审核', value: true},
|
||||
],
|
||||
handle: true,
|
||||
queryVersion: 0,
|
||||
pageForm: {
|
||||
year: new Date().getFullYear(),
|
||||
isAudit: false,
|
||||
year: GetQueryString("isAudit") === "true" ? null : new Date().getFullYear(),
|
||||
isAudit: GetQueryString("isAudit") === "true",
|
||||
},
|
||||
}
|
||||
},
|
||||
@@ -70,6 +71,7 @@ layout("/mobile/platform.html"){
|
||||
},
|
||||
methods: {
|
||||
yearChange() {
|
||||
this.queryVersion++
|
||||
this.pageForm.pageNumber = 1
|
||||
this.tableData = []
|
||||
this.finished = false
|
||||
@@ -77,40 +79,32 @@ layout("/mobile/platform.html"){
|
||||
},
|
||||
onLoad() {
|
||||
this.loading = true
|
||||
$.post(loc() + '/pageData', this.pageForm).then(res => {
|
||||
// 捕获本次筛选条件,筛选切换后忽略旧请求,避免串页。
|
||||
const requestKey = this.queryVersion || 0
|
||||
$.post('/mobile/member/audit/pageData', Object.assign({}, this.pageForm)).then(res => {
|
||||
if (requestKey !== (this.queryVersion || 0)) return
|
||||
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.finished = this.tableData.length >= res.data.totalCount || res.data.list.length === 0
|
||||
if (!this.finished) this.pageForm.pageNumber++
|
||||
} else {
|
||||
this.finished = true
|
||||
this.$toast.fail(res.msg || '加载失败')
|
||||
}
|
||||
this.loading = false
|
||||
}).fail(() => {
|
||||
if (requestKey !== (this.queryVersion || 0)) return
|
||||
this.finished = true
|
||||
this.$toast.fail('加载失败,请重新筛选后重试')
|
||||
}).always(() => {
|
||||
if (requestKey === (this.queryVersion || 0)) this.loading = false
|
||||
})
|
||||
},
|
||||
/* pageData() {
|
||||
this.mLoading = true
|
||||
setTimeout(async () => {
|
||||
$.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
|
||||
}, 600)
|
||||
},*/
|
||||
openView(o) {
|
||||
window.location.href = '/mobile/member/audit/findOne?stateId=' + o.stateId + '&record_id=' + o.id + '&user_id=' + o.userId
|
||||
window.location.href = '/mobile/member/audit/findOne?stateId=' + o.stateId + '&record_id=' + o.id + '&user_id=' + o.userId + '&done=' + this.pageForm.isAudit
|
||||
},
|
||||
},
|
||||
async created() {
|
||||
created() {
|
||||
this.yearList = [{text: '全部年份', value: null}]
|
||||
let nowYear = new Date().getFullYear()
|
||||
for (let i = nowYear; i >= nowYear - 9; i--) {
|
||||
this.yearList.push({text: i, value: i})
|
||||
|
||||
@@ -26,7 +26,6 @@ layout("/mobile/platform.html"){
|
||||
<van-field v-model="formData.auditTime" label="审核时间" readonly></van-field>
|
||||
|
||||
<van-field
|
||||
required
|
||||
v-model="formData.auditOpinion"
|
||||
rows="1"
|
||||
autosize
|
||||
@@ -46,12 +45,12 @@ layout("/mobile/platform.html"){
|
||||
|
||||
<van-row gutter="20" style="margin-top: 30px;padding: 0 25px">
|
||||
<van-col span="12">
|
||||
<van-button :color="themeColor" plain block @click="doAudit(false)">拒 绝
|
||||
<van-button :color="themeColor" plain block :loading="formLoading" :disabled="formLoading" @click="doAudit(false)">拒 绝
|
||||
</van-button>
|
||||
</van-col>
|
||||
|
||||
<van-col span="12">
|
||||
<van-button :color="themeColor" block @click="doAudit(true)">通 过
|
||||
<van-button :color="themeColor" block :loading="formLoading" :disabled="formLoading" @click="doAudit(true)">通 过
|
||||
</van-button>
|
||||
</van-col>
|
||||
</van-row>
|
||||
@@ -72,6 +71,7 @@ layout("/mobile/platform.html"){
|
||||
data() {
|
||||
return {
|
||||
handle: true,
|
||||
formLoading: false,
|
||||
id: "",
|
||||
formData: {},
|
||||
}
|
||||
@@ -81,25 +81,27 @@ layout("/mobile/platform.html"){
|
||||
'mobile-sign': httpVueLoader('/components/sign/mobileSign.vue'),
|
||||
},
|
||||
methods: {
|
||||
async doAudit(pass) {
|
||||
if (!this.formData.auditOpinion) {
|
||||
this.$toast.fail('请填写审核意见');
|
||||
return
|
||||
}
|
||||
this.formData.auditPass = pass
|
||||
const resp = await $.post("/platform/member/apply/audit/doAudit", this.formData)
|
||||
requestLaterFun(resp, (data) => {
|
||||
this.$toast.success('审核成功');
|
||||
setTimeout(() => {
|
||||
location.href = '/mobile/member/audit'
|
||||
}, 1000)
|
||||
}, () => {
|
||||
this.$toast.fail('审核失败');
|
||||
}, () => {
|
||||
doAudit(pass) {
|
||||
if (this.formLoading) return
|
||||
// 与 PC 共用审核参数;提交前读取手写签名,避免仅提交历史签名。
|
||||
this.$refs.signature.submitSign()
|
||||
this.$set(this.formData, 'auditPass', pass)
|
||||
this.formLoading = true
|
||||
$.post('/platform/member/apply/audit/doAudit', this.formData).then(resp => {
|
||||
requestLaterFun(resp, () => {
|
||||
this.$toast.success('审核成功')
|
||||
location.replace('/mobile/member/audit')
|
||||
}, () => {
|
||||
this.$toast.fail('审核失败')
|
||||
}, () => {})
|
||||
}).fail(() => {
|
||||
this.$toast.fail('审核失败,请稍后重试')
|
||||
}).always(() => {
|
||||
this.formLoading = false
|
||||
})
|
||||
},
|
||||
},
|
||||
async created() {
|
||||
created() {
|
||||
const record_id = GetQueryString("record_id")
|
||||
const user_id = GetQueryString("user_id")
|
||||
setTimeout(() => {
|
||||
|
||||
@@ -26,7 +26,7 @@ layout("/mobile/platform.html"){
|
||||
|
||||
<van-field v-model="formData.auditTime" label="审核时间" readonly></van-field>
|
||||
|
||||
<van-field required
|
||||
<van-field
|
||||
v-model="formData.auditOpinion"
|
||||
rows="1"
|
||||
autosize
|
||||
@@ -45,12 +45,12 @@ layout("/mobile/platform.html"){
|
||||
|
||||
<van-row gutter="20" style="margin-top: 30px;padding: 0 25px">
|
||||
<van-col span="12">
|
||||
<van-button :color="themeColor" plain block @click="doAudit(false)">拒 绝
|
||||
<van-button :color="themeColor" plain block :loading="formLoading" :disabled="formLoading" @click="doAudit(false)">拒 绝
|
||||
</van-button>
|
||||
</van-col>
|
||||
|
||||
<van-col span="12">
|
||||
<van-button :color="themeColor" block @click="doAudit(true)">通 过
|
||||
<van-button :color="themeColor" block :loading="formLoading" :disabled="formLoading" @click="doAudit(true)">通 过
|
||||
</van-button>
|
||||
</van-col>
|
||||
</van-row>
|
||||
@@ -70,6 +70,7 @@ layout("/mobile/platform.html"){
|
||||
data() {
|
||||
return {
|
||||
handle: true,
|
||||
formLoading: false,
|
||||
id: "",
|
||||
formData: {},
|
||||
}
|
||||
@@ -80,25 +81,27 @@ layout("/mobile/platform.html"){
|
||||
},
|
||||
methods: {
|
||||
|
||||
async doAudit(pass) {
|
||||
if (!this.formData.auditOpinion) {
|
||||
this.$toast.fail('请填写审核意见');
|
||||
return
|
||||
}
|
||||
this.formData.auditPass = pass
|
||||
const resp = await $.post("/platform/member/apply/audit/doAudit", this.formData)
|
||||
requestLaterFun(resp, (data) => {
|
||||
this.$toast.success('审核成功');
|
||||
setTimeout(() => {
|
||||
location.href = '/mobile/member/audit'
|
||||
}, 1000)
|
||||
}, () => {
|
||||
this.$toast.fail('审核失败');
|
||||
}, () => {
|
||||
doAudit(pass) {
|
||||
if (this.formLoading) return
|
||||
// 与 PC 共用审核参数;提交前读取手写签名,避免仅提交历史签名。
|
||||
this.$refs.signature.submitSign()
|
||||
this.$set(this.formData, 'auditPass', pass)
|
||||
this.formLoading = true
|
||||
$.post('/platform/member/apply/audit/doAudit', this.formData).then(resp => {
|
||||
requestLaterFun(resp, () => {
|
||||
this.$toast.success('审核成功')
|
||||
location.replace('/mobile/member/audit')
|
||||
}, () => {
|
||||
this.$toast.fail('审核失败')
|
||||
}, () => {})
|
||||
}).fail(() => {
|
||||
this.$toast.fail('审核失败,请稍后重试')
|
||||
}).always(() => {
|
||||
this.formLoading = false
|
||||
})
|
||||
},
|
||||
},
|
||||
async created() {
|
||||
created() {
|
||||
const record_id = GetQueryString("record_id")
|
||||
const user_id = GetQueryString("user_id")
|
||||
setTimeout(() => {
|
||||
|
||||
@@ -288,7 +288,8 @@
|
||||
pageForm: {
|
||||
source: source,
|
||||
searchName: "u.username",
|
||||
audit: 2
|
||||
// 已办入口默认显示本阶段已审核记录。
|
||||
audit: new URLSearchParams(window.location.search).get("audit") === "1" ? 1 : 2
|
||||
},
|
||||
unions: [],
|
||||
tableColumns: [
|
||||
|
||||
Reference in New Issue
Block a user