first commit
This commit is contained in:
@@ -0,0 +1,144 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
|
||||
<style>
|
||||
.el-divider--horizontal {
|
||||
margin-top: 50px;
|
||||
margin-bottom: 40px;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
<div id="app" v-cloak style="padding: 20px 40px">
|
||||
<template>
|
||||
|
||||
<apply :form="formData" @radio="radioButton">
|
||||
|
||||
</apply>
|
||||
<div style="float: right;margin: 20px 0">
|
||||
<el-button type="primary" @click="operation">确 定</el-button>
|
||||
</div>
|
||||
|
||||
</template>
|
||||
|
||||
</div>
|
||||
|
||||
<script>
|
||||
function getQueryVariable(variable) {
|
||||
let query = window.location.search.substring(1);
|
||||
let vars = query.split("&");
|
||||
for (let i = 0; i < vars.length; i++) {
|
||||
let pair = vars[i].split("=");
|
||||
if (pair[0] == variable) {
|
||||
return pair[1];
|
||||
}
|
||||
}
|
||||
return '';
|
||||
}
|
||||
|
||||
|
||||
const vue = new Vue({
|
||||
el: '#app',
|
||||
mixins: [initTableMixins],
|
||||
components: {
|
||||
'apply': httpVueLoader('/components/difficulty/apply.vue'),
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
formData: {
|
||||
sqsj: moment().format('YYYY-MM-DD'),
|
||||
apply_mode: '1',
|
||||
zyzkyy: [],
|
||||
jtcys: [],
|
||||
jtfc: [],
|
||||
jtcc: [],
|
||||
},
|
||||
userData: {},
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
radioButton() {
|
||||
this.$set(this.formData, 'idcard', '${@shiro.getPrincipalProperty("idcard")}')
|
||||
this.$set(this.formData, 'sqr', '${@shiro.getPrincipalProperty("username")}')
|
||||
this.$set(this.formData, 'bbzrusername', this.formData.apply_mode == 1 ? "${@shiro.getPrincipalProperty('username')}" : null)
|
||||
this.$set(this.formData, 'sqrloginname', "${@shiro.getPrincipalProperty('loginname')}")
|
||||
this.$set(this.formData, 'sex', this.formData.apply_mode == 1 ? "${@shiro.getPrincipalProperty('sex')}" : null)
|
||||
this.$set(this.formData, 'idcard', this.formData.apply_mode == 1 ? "${@shiro.getPrincipalProperty('idcard')}" : null)
|
||||
this.$set(this.formData, 'birthday', this.formData.apply_mode == 1 ? "${@shiro.getPrincipalProperty('birthday')}" : null)
|
||||
this.$set(this.formData, 'lxfs', this.formData.apply_mode == 1 ? "${@shiro.getPrincipalProperty('mobile')}" : null)
|
||||
this.$set(this.formData, 'yhkh', this.formData.apply_mode == 1 ? "${@shiro.getPrincipalProperty('bank_number')}" : null)
|
||||
this.$set(this.formData, 'yhmc', this.formData.apply_mode == 1 ? "${@shiro.getPrincipalProperty('yhmc')}" : null)
|
||||
this.$set(this.formData, 'unitname', this.formData.apply_mode == 1 ? this.userData.unitname : null)
|
||||
this.$set(this.formData, 'zw', this.formData.apply_mode == 1 ? this.userData.zw : null)
|
||||
this.$set(this.formData, 'zzmm', this.formData.apply_mode == 1 ? this.userData.zzmm : null)
|
||||
this.$set(this.formData, 'mz', this.formData.apply_mode == 1 ? this.userData.mz : null)
|
||||
},
|
||||
async getUserData() {
|
||||
const resp = await $.post("/platform/knbf/sq/getUserData")
|
||||
requestLaterFun(resp, () => {
|
||||
this.userData = resp.data;
|
||||
}, () => {
|
||||
this.$notify.error({title: '失败', message: resp.msg});
|
||||
})
|
||||
},
|
||||
async operation() {
|
||||
let method = this.formData.id ? "/doEdit" : "/doAdd"
|
||||
/* this.$refs["addform"].validate(async (valid) => {
|
||||
if (valid) {*/
|
||||
const loading = this.$loading({
|
||||
lock: true,
|
||||
text: '正在提交...',
|
||||
spinner: 'el-icon-loading',
|
||||
background: COVER_LAYER_COLOR
|
||||
});
|
||||
const formData = Object.assign({}, this.formData);
|
||||
formData.zyzkyy = JSON.stringify(formData.zyzkyy)
|
||||
formData.jtcys = JSON.stringify(formData.jtcys)
|
||||
formData.jtfc = JSON.stringify(formData.jtfc)
|
||||
formData.jtcc = JSON.stringify(formData.jtcc)
|
||||
formData.files = JSON.stringify(formData.files)
|
||||
formData.applicantsign = formData.sqsign
|
||||
if (formData.apply_mode == 1) {
|
||||
formData.bbzrusername = "${@shiro.getPrincipalProperty('id')}"
|
||||
}
|
||||
const resp = await $.post(loc() + method, formData)
|
||||
requestLaterFun(resp, () => {
|
||||
window.location.href = '/platform/fw/difficulty/applylist'
|
||||
}, () => {
|
||||
this.$notify.error({title: '失败', message: resp.msg});
|
||||
}, () => {
|
||||
loading.close()
|
||||
})
|
||||
/* }
|
||||
}
|
||||
);*/
|
||||
},
|
||||
async openEdit(id) {
|
||||
const resp = await $.get("/platform/fw/difficulty/applylist/findOne", {id})
|
||||
requestLaterFun(resp, (data) => {
|
||||
console.log(data)
|
||||
data.zyzkyy = JSON.parse(data.zyzkyy)
|
||||
data.jtfc = JSON.parse(data.jtfc)
|
||||
data.jtcc = JSON.parse(data.jtcc)
|
||||
if (data.files) {
|
||||
data.files = JSON.parse(data.files)
|
||||
}
|
||||
this.formData = data
|
||||
})
|
||||
}
|
||||
},
|
||||
async created() {
|
||||
await this.getUserData()
|
||||
let id = getQueryVariable("id")
|
||||
id ? this.openEdit(id) : this.radioButton()
|
||||
|
||||
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
Reference in New Issue
Block a user