104 lines
3.4 KiB
HTML
104 lines
3.4 KiB
HTML
<!--#
|
|
layout("/layouts/platform.html"){
|
|
#-->
|
|
<style>
|
|
|
|
|
|
</style>
|
|
<div id="app" v-cloak>
|
|
|
|
<el-row class="header navbar bg-white shadow" style="position :absolute">
|
|
<el-button type="primary" style="float: right;margin-top: 5px;" @click="doAdd()">提交</el-button>
|
|
</el-row>
|
|
|
|
<div style="padding: 50px 100px">
|
|
<kh-zb :data="formData" @change="v=>{this.formData=v}"></kh-zb>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<script>
|
|
const vue = new Vue({
|
|
el: '#app',
|
|
data() {
|
|
return {
|
|
v: 'index',
|
|
formData: {},
|
|
}
|
|
},
|
|
components: {
|
|
'kh-zb': httpVueLoader('/components/kh/KhZb.vue?v=' + moment(new Date()).unix()),
|
|
},
|
|
methods: {
|
|
doAdd() {
|
|
let flag = true
|
|
if (!this.formData.annual) {
|
|
this.$message({
|
|
message: "年度不能为空",
|
|
type: 'error'
|
|
})
|
|
return
|
|
}
|
|
if (!this.formData.assessment) {
|
|
this.$message({
|
|
message: "考核名称不能为空",
|
|
type: 'error'
|
|
})
|
|
return
|
|
}
|
|
this.formData.nrs.forEach(nr => {
|
|
nr.bzs.forEach(bz => {
|
|
if (!nr.content) {
|
|
this.$message({
|
|
message: "考核内容不能为空",
|
|
type: 'error'
|
|
})
|
|
flag = false;
|
|
throw Error()
|
|
} else if (!bz.inspection) {
|
|
this.$message({
|
|
message: "考核标准不能为空",
|
|
type: 'error'
|
|
})
|
|
flag = false;
|
|
throw Error()
|
|
} /*else if (!bz.score) {
|
|
this.$message({
|
|
message: "分数不能为空",
|
|
type: 'error'
|
|
})
|
|
flag = false;
|
|
throw Error()
|
|
}*/
|
|
})
|
|
})
|
|
if (flag) {
|
|
$.post(base + "/platform/ghkh/Xjkhzb/doAdd", {kh_zb: JSON.stringify(this.formData)}, (res) => {
|
|
this.formData.nrs.forEach(nr => {
|
|
nr.bzs.forEach(bz => {
|
|
nr.content = ""
|
|
bz.inspection = ""
|
|
bz.score = ""
|
|
bz.single_score = ''
|
|
bz.associatedmodule = ''
|
|
})
|
|
this.formData.annual = ""
|
|
this.formData.assessment = ""
|
|
})
|
|
this.$message({
|
|
message: res.msg,
|
|
type: 'success'
|
|
});
|
|
|
|
},
|
|
)
|
|
}
|
|
|
|
|
|
}
|
|
}
|
|
})
|
|
</script>
|
|
<!--#
|
|
}
|
|
#--> |