|
|
@@ -21,7 +21,7 @@
|
|
|
<div class="subform">
|
|
|
<div style="margin-bottom: 20px">
|
|
|
<el-select
|
|
|
- v-model="employeeId"
|
|
|
+ v-model="userId"
|
|
|
style="width: 82.5%; margin-right: 10px;"
|
|
|
multiple
|
|
|
filterable
|
|
|
@@ -34,17 +34,15 @@
|
|
|
:value="item.value"
|
|
|
:label="item.label"
|
|
|
>
|
|
|
- <!-- <span style="float: left">{{ item.nickname }}</span>
|
|
|
- <span style="float: right; color: #8492a6; font-size: 13px">{{ item.phone }}</span> -->
|
|
|
</el-option>
|
|
|
</el-select>
|
|
|
<el-button @click="chooseEmp">添加</el-button>
|
|
|
</div>
|
|
|
<el-table :data="emps">
|
|
|
- <el-table-column prop="nickname" label="用户名"></el-table-column>
|
|
|
+ <el-table-column prop="nickname" label="姓名"></el-table-column>
|
|
|
<el-table-column prop="phone" label="手机号"></el-table-column>
|
|
|
<el-table-column prop="artType" label="专业"></el-table-column>
|
|
|
- <el-table-column label="操作" v-if="formData.status == 'ASSIGN_EXPERT'">
|
|
|
+ <el-table-column label="操作">
|
|
|
<template slot-scope="{ row }">
|
|
|
<el-button @click="remove(row)" type="danger" size="mini" plain>移除</el-button>
|
|
|
</template>
|
|
|
@@ -53,19 +51,9 @@
|
|
|
</div>
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
- <el-form-item class="btn">
|
|
|
- <el-button @click="onSave" :loading="saving" type="primary" v-if="formData.status == 'ASSIGN_EXPERT'"
|
|
|
- >保存</el-button
|
|
|
- >
|
|
|
- <el-button
|
|
|
- type="danger"
|
|
|
- v-if="formData.status == 'REVIEW_PENDING'"
|
|
|
- @click="saveDismiss"
|
|
|
- :loading="loading"
|
|
|
- >
|
|
|
- 退回
|
|
|
- </el-button>
|
|
|
- </el-form-item>
|
|
|
+ <!-- <el-form-item> -->
|
|
|
+ <el-button @click="onSave" :loading="saving" type="primary">保存</el-button>
|
|
|
+ <!-- </el-form-item> -->
|
|
|
<!-- <div class="btn">
|
|
|
<el-button @click="$router.go(-1)">返回</el-button>
|
|
|
</div> -->
|
|
|
@@ -79,12 +67,11 @@ export default {
|
|
|
return {
|
|
|
saving: false,
|
|
|
formData: {},
|
|
|
- url: '/user/all1',
|
|
|
+ list: [],
|
|
|
rules: {},
|
|
|
- users: [],
|
|
|
emps: [],
|
|
|
- employeeId: '',
|
|
|
- employeeIds: [],
|
|
|
+ userId: '',
|
|
|
+ userIds: [],
|
|
|
dateRange: [],
|
|
|
audits: [],
|
|
|
grading: [],
|
|
|
@@ -100,29 +87,52 @@ export default {
|
|
|
closeDialog() {
|
|
|
this.$emit('close');
|
|
|
},
|
|
|
+ remove(row) {
|
|
|
+ console.log(row);
|
|
|
+ // this.emps.splice(row, 1);
|
|
|
+ this.emps.pop(row);
|
|
|
+ this.userIds.pop(this.userId);
|
|
|
+ // this.userIds.pop(row.id);
|
|
|
+ },
|
|
|
+ onSave() {
|
|
|
+ console.log(this.userIds);
|
|
|
+ },
|
|
|
+ chooseEmp() {
|
|
|
+ if (this.userId.length > 0) {
|
|
|
+ this.userId.forEach(index => {
|
|
|
+ console.log(index);
|
|
|
+ if (this.userIds.indexOf(index) < 0) {
|
|
|
+ this.emps.push(
|
|
|
+ this.users.find(item => {
|
|
|
+ return item.id === index;
|
|
|
+ })
|
|
|
+ );
|
|
|
+ this.userIds.push(index);
|
|
|
+ console.log(this.userIds);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ this.userId = '';
|
|
|
+ }
|
|
|
+ },
|
|
|
init(row) {
|
|
|
this.$http
|
|
|
- .post('user/all1', { body: 'json' })
|
|
|
+ .post('/user/all1', { size: 0, query: {}, size: 20, sort: '' }, { body: 'json' })
|
|
|
.then(res => {
|
|
|
- console.log(res);
|
|
|
- // this.artTypes = this.delChild(res);
|
|
|
+ this.users = res.content;
|
|
|
+ res.content.forEach(item => {
|
|
|
+ let nickname = item.nickname;
|
|
|
+ if (nickname.length < 3) {
|
|
|
+ nickname = nickname.slice(0, 1) + ' ' + nickname.slice(1);
|
|
|
+ }
|
|
|
+ this.expert.push({
|
|
|
+ label: nickname + '--' + item.phone + '--' + item.artType,
|
|
|
+ value: item.id
|
|
|
+ });
|
|
|
+ });
|
|
|
})
|
|
|
.catch(e => {
|
|
|
console.log(e);
|
|
|
});
|
|
|
- let keys = [...this.columnKeys].slice(0, 3).map(item => {
|
|
|
- return row[item];
|
|
|
- });
|
|
|
- let info = this.getInfo(this.showTable, keys);
|
|
|
- let aid = info.list.map(item => {
|
|
|
- return item.id;
|
|
|
- });
|
|
|
- this.$router.push({
|
|
|
- path: '/arrangeAssignExpert',
|
|
|
- query: {
|
|
|
- aid: aid.join(',')
|
|
|
- }
|
|
|
- });
|
|
|
}
|
|
|
}
|
|
|
};
|