Files
2026-09-08 19:49:21 +08:00

382 lines
15 KiB
HTML

<!--#
layout("/mobile/platform.html"){
#-->
<div id="app" v-cloak>
<van-nav-bar title="确认承办单位" fixed placeholder safe-area-inset-top></van-nav-bar>
<proposal-info :proposal_id="proposalId" title="确认承办单位" :handle="handle" ref="info">
<template #handle>
<div class="van-cell-group__title">
<div class="van-sidebar-item van-sidebar-item--select">
确认承办单位
</div>
</div>
<van-form>
<van-cell-group class="info">
<van-cell title="审核时间" :value="formData.auditTime"></van-cell>
<van-cell title="立案结果" :value="formData.resultName"></van-cell>
<template v-if="formData.resultCode!='notGive'">
<van-field
input-align="right"
readonly
v-model="formData.hostUnitName"
show-word-limit
label="主办单位"
placeholder="请选择主办单位"
@click="host_showPickerClick"
></van-field>
<van-field
autosize
input-align="right"
readonly
type="textarea"
v-model="formData.helpUnitName"
show-word-limit
label="协办单位"
placeholder="请选择协办单位"
@click="help_showPickerClick"
></van-field>
</template>
<van-field
input-align="right"
v-model="formData.opinion"
rows="2"
autosize
label="审核意见"
type="textarea"
maxlength="1000"
placeholder="请输入审核意见"
show-word-limit
></van-field>
</van-cell-group>
<van-row gutter="20" style="padding: 0 10px">
<van-col span="24">
<van-button :color="themeColor" block size="large" @click="doAudit">提交
</van-button>
</van-col>
</van-row>
</van-form>
</template>
</proposal-info>
<van-popup v-model="host_showPicker" @click-close-icon="host_dwselclose"
get-container="#app"
round position="bottom" safe-area-inset-bottom
:lazy-render="false"
:close-on-click-overlay="false" :style="{ height: '80%'}">
<div style="padding:0px 20px;margin-top:20px;box-sizing: border-box;max-height: calc(100% - 100px);overflow-y: auto">
<van-checkbox-group v-model="hostUnit" checked-color="#081776" style="font-size: 12px">
<van-cell-group>
<van-index-bar highlight-color="red" :sticky="false">
<template v-for="c,ci in unitOptions">
<van-index-anchor :index="c.k"></van-index-anchor>
<template v-for="x,xi in c.v">
<van-cell
clickable
:key="x.id"
:title="x.unitName"
@click="host_toggle(x.id,$event)"
>
<template #right-icon>
<van-checkbox :name="x" ref="host_checkboxes"></van-checkbox>
</template>
</van-cell>
</template>
</template>
</van-index-bar>
</van-cell-group>
</van-checkbox-group>
</div>
<div style="position: absolute;width: 80%;bottom: 10px;left: 50%;transform: translateX(-50%)">
<van-button :color="themeColor" block @click="host_dwselclose">确定</van-button>
</div>
</van-popup>
<van-popup v-model="help_showPicker"
@click-close-icon="help_dwselclose"
get-container="#app"
round position="bottom"
safe-area-inset-bottom
:close-on-click-overlay="false"
:lazy-render="false"
:style="{ height: '80%'}">
<div style="padding:0px 20px;margin-top:20px;box-sizing: border-box;max-height: calc(100% - 100px);overflow-y: auto">
<van-checkbox-group v-model="helpUnit" checked-color="#081776" style="font-size: 12px">
<van-cell-group>
<van-index-bar highlight-color="red" :sticky="false">
<template v-for="c,ci in unitOptions">
<van-index-anchor :index="c.k"></van-index-anchor>
<template v-for="x,xi in c.v">
<van-cell
clickable
:key="x.id"
:title="x.unitName"
@click="help_toggle(x.id)"
>
<template #right-icon>
<van-checkbox :name="x" @click.stop="help_toggle(x.id)"
ref="help_checkboxes"></van-checkbox>
</template>
</van-cell>
</template>
</template>
</van-index-bar>
</van-cell-group>
</van-checkbox-group>
</div>
<div style="position: absolute;width: 80%;bottom: 10px;left: 50%;transform: translateX(-50%)">
<van-button :color="themeColor" block @click="help_dwselclose">确定</van-button>
</div>
</van-popup>
</div>
<script>
var vue = new Vue({
el: '#app',
mixins: [mobileMixins],
data() {
return {
host_showPicker: false,
help_showPicker: false,
showPopover: false,
resultOptions: [],
handle: true,
proposalId: GetQueryString('proposal_id'),
formData: {
username: "${@shiro.getPrincipalProperty('username')}",
loginName: "${@shiro.getPrincipalProperty('loginname')}",
auditTime: moment().format('YYYY-MM-DD'),
resultCode: 'determine',
proposalId: GetQueryString('proposal_id'),
flag: true,
hostUnit: '',
helpUnit: [],
opinion: '',
hostUnitName: '',
helpUnitName: ''
},
unitList: [],
unitOptions: [],
hostUnit: [],
helpUnit: []
}
},
components: {
'proposal-info': httpVueLoader('/components/proposal/wechat/ProposalInfo.vue?v=' + new Date().getTime()),
},
methods: {
host_showPickerClick() {
this.host_showPicker = true
this.$refs.host_checkboxes.some(v => {
if (this.formData.hostUnit === v.name.id && v.checked == false) {
v.toggle()
return true
}
})
},
help_showPickerClick() {
this.help_showPicker = true
this.$refs.help_checkboxes.map(v => {
if (this.formData.helpUnit.includes(v.name.id) && v.checked == false) {
v.toggle()
}
})
},
async checkUnderTake() {
const {data} = await $.get('/platform/proposal/transact/case/checkUnderTake', {
hostUnit: this.formData.hostUnit,
helpUnit: this.formData.helpUnit
})
return data
},
async doAudit() {
if (['determine', 'opinion'].includes(this.formData.resultCode)) {
if (this.formData.hostUnit.length === 0) {
vant.Toast('请选择主办单位');
return
}
}
if (this.formData.opinion === '') {
vant.Toast('请输入审核意见');
return
}
const emptyUserUnderTakes = await this.checkUnderTake()
if (emptyUserUnderTakes !== '') {
vant.Toast(emptyUserUnderTakes);
return
}
vant.Dialog.confirm({
title: '提示',
message: '确定提交吗?',
}).then(async () => {
const loading = this.$toast({
duration: 0,
message: '提交中...',
forbidClick: true,
loadingType: 'spinner',
type: 'loading',
overlay: true
});
const resp = await $.post("/platform/proposal/transact/audit/doAudit", {
audit: JSON.stringify(this.formData),
resultCode: this.formData.resultCode,
hostUnit: this.formData.hostUnit,
helpUnit: JSON.stringify(this.formData.helpUnit),
flag: this.formData.flag
})
if (resp.code === 0) {
setTimeout(async () => {
loading.type = 'success'
loading.message = '提交成功'
loading.close()
this.handle = [700, 850].includes(await mProposal.GetProposalStateCode(this.proposalId))
this.$refs.info.openView(this.proposalId)
}, 1200)
} else {
loading.type = 'fail'
loading.message = '提交失败,请联系管理员'
}
}).catch(() => {
});
},
//点击cell单元格切换选中状态
host_toggle(id, event) {
this.hostUnit = []
this.$refs.host_checkboxes.some(v => {
if (v.name.id === id) {
v.toggle()
return true
}
})
},
//点击cell单元格切换选中状态
help_toggle(id) {
this.$refs.help_checkboxes.some(v => {
if (v.name.id === id) {
v.toggle()
return true
}
})
},
host_dwselclose() {
if (this.hostUnit.length > 0) {
this.formData.hostUnitName = this.hostUnit[0].unitName
this.formData.hostUnit = this.hostUnit[0].id
}
if (this.formData.helpUnit.includes(this.formData.hostUnit)) {
vant.Toast('单位重复')
return
}
this.host_showPicker = false
},
help_dwselclose() {
if (this.helpUnit.length > 0) {
this.formData.helpUnit = this.helpUnit.map(v => v.id)
this.formData.helpUnitName = this.helpUnit.map(v => v.unitName).toString()
}
if (this.formData.helpUnit.includes(this.formData.hostUnit)) {
vant.Toast('协办单位中存在您已选择的主办单位!请检查确认后提交')
return
}
this.help_showPicker = false
},
},
async created() {
const proposal_id = GetQueryString("proposal_id")
const biz_key = GetQueryString("biz_key")
if (proposal_id === '' || biz_key === '') {
vant.Dialog.alert({
title: '提示',
message: '非法参数',
showConfirmButton: false
}).then(() => {
})
return
}
const lastIndex = window.location.href.lastIndexOf('&')
if (window.location.href.substr(lastIndex + 1, 6) === 'ticket') {
window.document.location.replace(window.location.href.substring(0, lastIndex))
}
const py = new Pinyin()
this.resultOptions = await getDictByCode("proposal_result")
this.handle = [700, 850].includes(await mProposal.GetProposalStateCode(this.proposalId))
if (this.handle) {
const data = await findOrganizer(this.proposalId)
const resultCode = await mProposal.GetProposalResultCode(this.proposalId)
this.formData.proposalId = this.proposalId
this.formData.resultCode = resultCode
this.formData.resultName = this.resultOptions.find(v => v.code === resultCode).name
if (data.length) {
const host = data.find(v => {
return v.undertakeType === 1
})
this.formData.hostUnit = host.undertakeId
this.formData.hostUnitName = host.unitName
this.formData.helpUnit = data.filter(v => {
return v.undertakeType === 2
}).map(v => {
return v.undertakeId
})
this.formData.helpUnitName = data.filter(v => {
return v.undertakeType === 2
}).map(v => {
return v.unitName
}).toString()
}
}
this.unitList = await mProposal.getProposalUndertake()
const pyArr = [...Array(26).keys()].map(i => String.fromCharCode(i + 65))
pyArr.forEach(p => {
const c = this.unitList.filter(x => {
return py.getCamelChars(x.unitName).substr(0, 1) === p
})
this.unitOptions.push({k: p, v: c})
})
}
})
</script>
<!--#
}
#-->