first commit
This commit is contained in:
@@ -0,0 +1,135 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
<style>
|
||||
|
||||
.el-card__header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
</style>
|
||||
<div id="app" v-cloak>
|
||||
|
||||
<guava ref="guava">
|
||||
<el-card shadow="never">
|
||||
<template #header>
|
||||
<div>
|
||||
<h3 style="color: #1867b0">新建考核指标</h3>
|
||||
</div>
|
||||
<div>
|
||||
<el-button type="primary" @click="doAdd()">
|
||||
提交
|
||||
</el-button>
|
||||
</div>
|
||||
</template>
|
||||
<template>
|
||||
<union-comment-zb ref="unionZb" :data="formData" @change="v=>{this.formData=v}"></union-comment-zb>
|
||||
</template>
|
||||
</el-card>
|
||||
</guava>
|
||||
|
||||
</div>
|
||||
|
||||
<script>
|
||||
const vue = new Vue({
|
||||
el: '#app',
|
||||
data() {
|
||||
return {
|
||||
v: 'index',
|
||||
formData: {},
|
||||
}
|
||||
},
|
||||
components: {
|
||||
'union-comment-zb': httpVueLoader('/components/wakeshome/review/UnionCommentZb.vue?v=' + moment(new Date()).unix()),
|
||||
},
|
||||
methods: {
|
||||
async doAdd() {
|
||||
const {
|
||||
annual,
|
||||
assessment,
|
||||
assessmentMode,
|
||||
scoringMode,
|
||||
commentTarget,
|
||||
activityGroupId
|
||||
} = this.formData
|
||||
let flag = true
|
||||
if (!annual) {
|
||||
this.$message.warning("年度不能为空")
|
||||
return
|
||||
}
|
||||
if (!assessment) {
|
||||
this.$message.warning("测评名称不能为空")
|
||||
return
|
||||
}
|
||||
if (!scoringMode) {
|
||||
this.$message.warning("打分模式不能为空")
|
||||
return
|
||||
}
|
||||
if (!assessmentMode) {
|
||||
this.$message.warning("评测模式不能为空")
|
||||
return
|
||||
}
|
||||
if (!commentTarget) {
|
||||
this.$message.warning("测评对象不能为空")
|
||||
return
|
||||
}
|
||||
if (commentTarget == 1 && !activityGroupId) {
|
||||
this.$message.warning("发送人员范围不能为空")
|
||||
return
|
||||
}
|
||||
this.formData.nrs.forEach(nr => {
|
||||
nr.bzs.forEach(bz => {
|
||||
if (!nr.content) {
|
||||
this.$message.error("测评内容不能为空")
|
||||
flag = false;
|
||||
throw Error()
|
||||
} else if (!bz.inspection) {
|
||||
this.$message.error("测评标准不能为空")
|
||||
flag = false;
|
||||
throw Error()
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
if (!(this.formData.applyTime && this.formData.applyTime.length > 0)) {
|
||||
this.$message.warning('评议时间不能为空')
|
||||
return
|
||||
}
|
||||
|
||||
if (this.formData.commentTarget == 3 && !(this.formData.unionIds && this.formData.unionIds.length > 0)) {
|
||||
this.$message.warning('请选择评议分工会')
|
||||
return
|
||||
}
|
||||
|
||||
if (flag) {
|
||||
if (this.formData.applyTime && this.formData.applyTime.length > 0) {
|
||||
this.formData.startTime = this.formData.applyTime[0]
|
||||
this.formData.endTime = this.formData.applyTime[1]
|
||||
}
|
||||
|
||||
const res = await $.post(loc() + "/doAdd", {kh_zb: JSON.stringify(this.formData)})
|
||||
if (res.code === 0) {
|
||||
this.$set(this.formData, "nrs", [{bzs: [{}]}])
|
||||
this.$set(this.formData, "annual", null)
|
||||
this.$set(this.formData, "assessment", null)
|
||||
this.$set(this.formData, "assessmentMode", null)
|
||||
this.$set(this.formData, "workersNum", null)
|
||||
this.$set(this.formData, "scoringMode", null)
|
||||
this.$set(this.formData, "activityGroupId", null)
|
||||
this.$set(this.formData, "commentTarget", null)
|
||||
this.$set(this.formData, "zbId", null)
|
||||
this.$set(this.formData, "applyTime", undefined)
|
||||
this.$message.success(res.msg);
|
||||
} else {
|
||||
this.$message.error(res.msg);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
</script>
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
Reference in New Issue
Block a user