This commit is contained in:
2024-07-31 08:46:23 +08:00
parent 048a7c13b3
commit 64f2569789
14 changed files with 871 additions and 504 deletions
@@ -90,12 +90,12 @@ layout("/layouts/platform.html"){
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="项目编号" prop="projectCode">
<el-input disabled placeholder="选择活动类型自动生成"
v-model="formData.projectCode"></el-input>
</el-form-item>
</el-col>
<!-- <el-col :span="12">
<el-form-item label="项目编号" prop="projectCode">
<el-input disabled placeholder="选择活动类型自动生成"
v-model="formData.projectCode"></el-input>
</el-form-item>
</el-col>-->
<el-col :span="12">
<el-form-item label="活动项目类型" prop="projectTypeCode">
<el-select placeholder="请选择活动类型" style="width: 100%;"
@@ -164,9 +164,9 @@ layout("/layouts/platform.html"){
</el-col>
<el-col :span="12">
<el-form-item label="活动地址" prop="address">
<el-form-item label="活动地址" prop="venue">
<el-input maxlength="50" placeholder="请填写活动地址" type="text"
v-model="formData.address"></el-input>
v-model="formData.venue"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
@@ -321,7 +321,7 @@ layout("/layouts/platform.html"){
projectTypeCode: [{required: true, message: '必填', trigger: ['blur', 'change']}],
activity_type: [{required: true, message: '必填', trigger: ['blur', 'change']}],
plannedDate: [{required: true, message: '必填', trigger: ['blur', 'change']}],
address: [{required: true, message: '必填', trigger: ['blur', 'change']}],
venue: [{required: true, message: '必填', trigger: ['blur', 'change']}],
activity_number: [{required: true, message: '必填', trigger: ['blur', 'change']}],
mobile: [{required: true, message: '必填', trigger: ['blur', 'change']}],
}
@@ -424,7 +424,7 @@ layout("/layouts/platform.html"){
spinner: 'el-icon-loading',
background: COVER_LAYER_COLOR
});
const formData = JSON.parse(JSON.stringify(this.formData))
const formData = clone(this.formData)
const {plannedDate} = formData
if (plannedDate && plannedDate.length) {
formData.startPlannedDate = formData.plannedDate[0]
@@ -432,19 +432,18 @@ layout("/layouts/platform.html"){
formData.startTime = formData.plannedDate[0]
formData.endTime = formData.plannedDate[1]
formData.plannedDate = undefined
}
const resp = await $.post("/platform/jf/activity_bx/apply/doAdd", {
activityBx: JSON.stringify(formData),
sign: this.formData.sign
const url = "/platform/jf/activity_bx/apply"
const resp = await $.post(url + (formData.id ? "/doEdit" : "/doAdd"), {
activityBx: JSON.stringify(formData)
})
closeLoadingFunc(loading, resp, async () => {
location.reload();
}, (data, msg) => {
this.$message.error(msg);
})
// 添加成功 跳转到申请记录页面
//window.location.href = '/platform/jf/activity_bx/reimbursement'
loading.close()
if (resp.code === 0) {
sublime.jumpPagePjax("/platform/jf/activity_bx/reimbursement")
} else {
this.$message.error(resp.msg);
}
}
})
},
@@ -462,34 +461,40 @@ layout("/layouts/platform.html"){
apply_time: moment().format('YYYY-MM-DD'),
activity_card_number: '${@shiro.getPrincipalProperty("bank_number")}'
}
this.activityType = await getActivityTwoLevelType("40000")
this.projectType = await getActivityTwoLevelType("50000")
if ("${@shiro.hasRole('H04')&&!(@shiro.hasRole('A06')||@shiro.hasRole('sysadmin')||@shiro.hasRole('H02'))}" === 'true') {
this.$set(this.formData, "activity_type", "40002")
this.$set(this.formData, "fundsUnitName", '${@shiro.getPrincipalProperty("union").getUnionname()}')
} else if ("${@shiro.hasRole('H02')&&!(@shiro.hasRole('H04')||@shiro.hasRole('sysadmin')||@shiro.hasRole('A06'))}" === 'true') {
this.$set(this.formData, "activity_type", "40003")
} else if ("${(@shiro.hasRole('xghng')||@shiro.hasRole('H10'))&&!(@shiro.hasRole('H04')||@shiro.hasRole('sysadmin')||@shiro.hasRole('H02'))}" === 'true') {
this.$set(this.formData, "activity_type", "40001")
this.$set(this.formData, "fundsUnitName", '校工会')
}
if (this.formData.activity_type) {
await this.getProjectCodeChange()
}
},
findOne(id){
async findOne(id) {
const resp = await $.get("/platform/jf/activity_bx/reimbursement/findOne", {id})
if (resp.code === 0) {
resp.data.activity_type = resp.data.activity_type + ""
resp.data.plannedDate = [resp.data.startPlannedDate, resp.data.endPlannedDate]
this.formData = resp.data
}
}
},
async created() {
this.activityType = await getActivityTwoLevelType("40000")
this.projectType = await getActivityTwoLevelType("50000")
const id = GetQueryString("id")
if (id){
if (id) {
this.findOne(id)
}else{
} else {
this.init()
}
if ("${@shiro.hasRole('H04')&&!(@shiro.hasRole('A06')||@shiro.hasRole('sysadmin')||@shiro.hasRole('H02'))}" === 'true') {
this.$set(this.formData, "activity_type", "40002")
this.$set(this.formData, "fundsUnitName", '${@shiro.getPrincipalProperty("union").getUnionname()}')
} else if ("${@shiro.hasRole('H02')&&!(@shiro.hasRole('H04')||@shiro.hasRole('sysadmin')||@shiro.hasRole('A06'))}" === 'true') {
this.$set(this.formData, "activity_type", "40003")
} else if ("${(@shiro.hasRole('xghng')||@shiro.hasRole('H10'))&&!(@shiro.hasRole('H04')||@shiro.hasRole('sysadmin')||@shiro.hasRole('H02'))}" === 'true') {
this.$set(this.formData, "activity_type", "40001")
this.$set(this.formData, "fundsUnitName", '校工会')
}
}
})
</script>