365 lines
14 KiB
HTML
365 lines
14 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.caseCode"></van-cell>
|
|
<van-cell title="建议立案结果"></van-cell>
|
|
<template>
|
|
<van-radio-group v-model="formData.resultCode" direction="horizontal"
|
|
style="font-size: 12px;padding: 10px 0 10px 26px;box-sizing: border-box;background: #FFFFFF;"
|
|
@change="resultCodeChange">
|
|
<van-radio v-for="item in resultOptions" :name="item.code" shape="square"
|
|
checked-color="themeColor">
|
|
{{item.name}}
|
|
</van-radio>
|
|
</van-radio-group>
|
|
|
|
<template v-if="formData.resultCode!='notGive'">
|
|
<van-field
|
|
input-align="right"
|
|
readonly
|
|
v-model="formData.hostUnitName"
|
|
show-word-limit
|
|
label="承办单位"
|
|
placeholder="请输入承办单位"
|
|
@click="host_showPicker = true"
|
|
></van-field>
|
|
<van-field
|
|
input-align="right"
|
|
readonly
|
|
v-model="formData.helpUnitName"
|
|
show-word-limit
|
|
label="协办单位"
|
|
placeholder="请输入协办单位"
|
|
@click="help_showPicker = true"
|
|
></van-field>
|
|
</template>
|
|
|
|
</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 type="flex" :gutter="20" style="padding: 20px 0px">
|
|
|
|
<van-col span="24" style="padding: 0 10px">
|
|
<van-button :color="themeColor" block size="large" @click="doAudit(true)">提 交</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
|
|
: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)"
|
|
>
|
|
<template #right-icon>
|
|
<van-checkbox :name="x" @click.stop="host_toggle(x.id)"
|
|
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"
|
|
: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',
|
|
caseCode: '',
|
|
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: {
|
|
async resultCodeChange(val) {
|
|
const {data} = await $.get('/platform/proposal/transact/secretary/generateCaseCode', {resultCode: val})
|
|
this.$set(this.formData, 'caseCode', data)
|
|
},
|
|
async doAudit(flag) {
|
|
this.formData.flag = flag
|
|
if (this.formData.flag === true) {
|
|
if (this.formData.resultCode === '') {
|
|
vant.Toast('请选择建议立案结果');
|
|
return
|
|
}
|
|
|
|
if (['determine', 'opinion'].includes(this.formData.resultCode)) {
|
|
if (this.formData.hostUnit.length === 0) {
|
|
vant.Toast('请选择主办单位');
|
|
return
|
|
}
|
|
}
|
|
|
|
if (this.formData.opinion === '') {
|
|
vant.Toast('请输入审核意见');
|
|
return
|
|
}
|
|
|
|
const resultName = this.resultOptions.find(v => v.code === this.formData.resultCode).name
|
|
vant.Dialog.confirm({
|
|
title: '提示',
|
|
message: '请确认是否' + resultName + "?",
|
|
}).then(async () => {
|
|
await this.doAudit2()
|
|
}).catch(() => {
|
|
|
|
});
|
|
|
|
|
|
} else {
|
|
vant.Dialog.confirm({
|
|
title: '提示',
|
|
message: '您确定要将此提案退回到提案人吗?',
|
|
}).then(async () => {
|
|
await this.doAudit2()
|
|
}).catch(() => {
|
|
|
|
});
|
|
}
|
|
|
|
|
|
},
|
|
async doAudit2() {
|
|
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,
|
|
caseCode: this.formData.caseCode,
|
|
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 = await mProposal.GetProposalStateCode(this.proposalId) === 500
|
|
this.$refs.info.openView(this.proposalId)
|
|
}, 1200)
|
|
} else {
|
|
loading.type = 'fail'
|
|
loading.message = '提交失败,请联系管理员'
|
|
}
|
|
},
|
|
|
|
//点击cell单元格切换选中状态
|
|
host_toggle(id) {
|
|
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
|
|
}
|
|
await this.resultCodeChange(this.formData.resultCode)
|
|
|
|
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 = await mProposal.GetProposalStateCode(this.proposalId) === 500
|
|
this.unitList = await 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>
|
|
|
|
|
|
<!--#
|
|
}
|
|
#--> |