commit
This commit is contained in:
@@ -79,13 +79,25 @@
|
||||
|
||||
<el-form-item label="" label-width="0" v-for="(nr,idx) in formData.nrs" :key="idx">
|
||||
<el-row type="flex" justify="space-between">
|
||||
<el-input v-model="nr.content" v-if="!is_view" maxlength="30" style="width: 50%" placeholder="请填写考核内容">
|
||||
<template slot="prepend"><span>{{ idx + 1 }}</span></template>
|
||||
</el-input>
|
||||
<span style="background-color: #F6F7FA;" v-else>{{ idx + 1 }} {{ nr.content }}</span>
|
||||
<div style="width: 80%">
|
||||
<el-input v-model="nr.content" :disabled="is_view" maxlength="30" style="width: 68%" placeholder="请填写考核内容">
|
||||
<template slot="prepend"><span>{{ idx + 1 }}</span></template>
|
||||
</el-input>
|
||||
<el-select v-model="nr.auditUser" :disabled="is_view" placeholder="请根据姓名或工号选择审核人" style="width: 300px"
|
||||
remote reserve-keyword :remote-method="selectUser"
|
||||
clearable filterable>
|
||||
<el-option
|
||||
v-for="item in userOptions"
|
||||
:key="item.loginName"
|
||||
:label="item.userName + item.loginName + '(' + item.unitName + ')'"
|
||||
:value="item.loginName">
|
||||
</el-option>
|
||||
</el-select>
|
||||
|
||||
</div>
|
||||
<div style="display: flex; gap: 10px;">
|
||||
<el-button v-if="!is_view" size="small" icon="el-icon-plus" type="primary"
|
||||
@click="formData.nrs.push({bzs:[{}]})">
|
||||
@click="formData.nrs.push({bzs:[{}], auditUser: ''})">
|
||||
添加内容
|
||||
</el-button>
|
||||
<el-button v-if="!is_view" size="small" :disabled="formData.nrs.length<=1" type="danger"
|
||||
@@ -195,7 +207,7 @@
|
||||
|
||||
<el-table-column v-if="!is_view" label="操作" width="100px">
|
||||
<template v-slot="{row,$index}">
|
||||
<el-button size="mini" :disabled="nr.bzs.length<=1 || (!row.canDelete && row.id)" type="danger" icon="el-icon-delete"
|
||||
<el-button size="mini" :disabled="nr.bzs.length<=1 || (!row.canDelete && row.id !== null)" type="danger" icon="el-icon-delete"
|
||||
@click="nr.bzs.splice($index,1)"></el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
@@ -217,7 +229,7 @@
|
||||
</template>
|
||||
|
||||
|
||||
<script nonce="${cspNonce!}">
|
||||
<script>
|
||||
|
||||
const METHOD_NAME = "change"
|
||||
|
||||
@@ -232,7 +244,8 @@ module.exports = {
|
||||
default: function() {
|
||||
return {
|
||||
nrs: [{
|
||||
bzs: [{}]
|
||||
bzs: [{}],
|
||||
auditUser: '',
|
||||
}],
|
||||
};
|
||||
}
|
||||
@@ -265,10 +278,23 @@ module.exports = {
|
||||
{moduleName:'二级教代会',id:'secteameet'},
|
||||
{moduleName:'慰问/补助',id:'ConandDif'},
|
||||
],
|
||||
formData:{}
|
||||
formData:{},
|
||||
userOptions: [],
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
async selectUser(query) {
|
||||
if (query) {
|
||||
this.userOptions = []
|
||||
this.userOptions = await this.getUserList(query)
|
||||
}
|
||||
},
|
||||
async getUserList(query) {
|
||||
const resp = await this.$axios.post("/platform/ghkh/Xjkhzb/getUserByKeyWord", {
|
||||
keyWord: query,
|
||||
})
|
||||
return resp.data
|
||||
},
|
||||
async getByZbData() {
|
||||
this.$axios.post('/platform/ghkh/khzb/edit', {id: this.formData.zbId}).then(res => {
|
||||
if (res.code === 0) {
|
||||
@@ -328,16 +354,17 @@ module.exports = {
|
||||
return sums;
|
||||
}
|
||||
},
|
||||
created() {
|
||||
async created() {
|
||||
this.getZbList()
|
||||
if (!this.form_data || !Object.keys(this.form_data).length) {
|
||||
this.formData = {
|
||||
nrs: [{
|
||||
bzs: [{}]
|
||||
bzs: [{}],
|
||||
auditUser: '',
|
||||
}],
|
||||
}
|
||||
}else{
|
||||
this.formData=this.form_data
|
||||
} else {
|
||||
this.formData = this.form_data
|
||||
// 初始化时间范围数据用于编辑
|
||||
if (this.formData.startDateTime && this.formData.endDateTime) {
|
||||
this.$set(this.formData, 'fillTimeRange', [this.formData.startDateTime, this.formData.endDateTime]);
|
||||
@@ -345,6 +372,19 @@ module.exports = {
|
||||
if (this.formData.startApplyTime && this.formData.endApplyTime) {
|
||||
this.$set(this.formData, 'appealTimeRange', [this.formData.startApplyTime, this.formData.endApplyTime]);
|
||||
}
|
||||
// 回显审核人
|
||||
if (this.formData.nrs.length > 0) {
|
||||
const users = [...new Set(
|
||||
this.formData.nrs
|
||||
.map(o => o.auditUser)
|
||||
.filter(o => o != null && o !== '')
|
||||
)]
|
||||
let array = []
|
||||
for (const o of users) {
|
||||
array = array.concat(await this.getUserList(o))
|
||||
}
|
||||
this.userOptions = array
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
<template v-else>
|
||||
<file-upload
|
||||
:value.sync="data.files"
|
||||
:upload_number="20"
|
||||
:upload_number="50"
|
||||
upload_mode="drag"
|
||||
upload_result_category="array"
|
||||
complete_result
|
||||
@@ -40,7 +40,7 @@
|
||||
|
||||
</el-form>
|
||||
</template>
|
||||
<script nonce="${cspNonce!}">
|
||||
<script>
|
||||
|
||||
const METHOD_NAME = "change"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user