|
@@ -14,9 +14,9 @@
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="list_item">
|
|
<div class="list_item">
|
|
- <!-- <div v-for="(item, index) in list" :key="index" class="text item">
|
|
|
|
- <el-button size="small" class="btn">{{ item }}</el-button>
|
|
|
|
- </div> -->
|
|
|
|
|
|
+ <div v-for="(item, index) in commonPersonList" :key="index" class="text">
|
|
|
|
+ <el-button size="small" class="btn" @click="selectedCommonPerson(item.userId)">{{ item.commonPersonName }}</el-button>
|
|
|
|
+ </div>
|
|
</div>
|
|
</div>
|
|
<span slot="footer" class="dialog-footer">
|
|
<span slot="footer" class="dialog-footer">
|
|
<el-input v-model="userName" disabled size="small" style="width: 100px; margin-right: 10px" />
|
|
<el-input v-model="userName" disabled size="small" style="width: 100px; margin-right: 10px" />
|
|
@@ -26,7 +26,7 @@
|
|
</template>
|
|
</template>
|
|
<script>
|
|
<script>
|
|
import { getLevelTreeSelect } from '@/api/system/employeenInfo'
|
|
import { getLevelTreeSelect } from '@/api/system/employeenInfo'
|
|
-import { selectListByDeptId } from '@/api/system/stockLocation'
|
|
|
|
|
|
+import { selectListByDeptId, updateCommonPerson, getCommonPerson } from '@/api/system/stockLocation'
|
|
import Treeselect from '@riophae/vue-treeselect'
|
|
import Treeselect from '@riophae/vue-treeselect'
|
|
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
|
|
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
|
|
export default {
|
|
export default {
|
|
@@ -39,7 +39,8 @@ export default {
|
|
depList: [], // 公司部门树
|
|
depList: [], // 公司部门树
|
|
postList: [], // 级别职称树
|
|
postList: [], // 级别职称树
|
|
personList: [], // 人员列表
|
|
personList: [], // 人员列表
|
|
- userName: '' //展示人名
|
|
|
|
|
|
+ userName: '', //展示人名
|
|
|
|
+ commonPersonList: [] // 常用人列表
|
|
}
|
|
}
|
|
},
|
|
},
|
|
components: { Treeselect },
|
|
components: { Treeselect },
|
|
@@ -47,6 +48,7 @@ export default {
|
|
this.init()
|
|
this.init()
|
|
this.getLevelList()
|
|
this.getLevelList()
|
|
this.selectPerson()
|
|
this.selectPerson()
|
|
|
|
+ this.getCommonPerson()
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
init(val, list) {
|
|
init(val, list) {
|
|
@@ -55,6 +57,14 @@ export default {
|
|
this.depList = list
|
|
this.depList = list
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
+ // 查询常用人
|
|
|
|
+ getCommonPerson() {
|
|
|
|
+ getCommonPerson(this.$store.state.user.userId).then(res => {
|
|
|
|
+ if (res.code === 200) {
|
|
|
|
+ this.commonPersonList = res.data
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ },
|
|
// 选择部门
|
|
// 选择部门
|
|
selectDept(node, instanceId) {
|
|
selectDept(node, instanceId) {
|
|
console.log(node)
|
|
console.log(node)
|
|
@@ -91,9 +101,20 @@ export default {
|
|
selectedPerson(e) {
|
|
selectedPerson(e) {
|
|
this.userName = this.personList.find(item => item.userId === e).realName
|
|
this.userName = this.personList.find(item => item.userId === e).realName
|
|
},
|
|
},
|
|
|
|
+ // 选定常用人
|
|
|
|
+ selectedCommonPerson(userId) {
|
|
|
|
+ this.userName = this.personList.find(item => item.userId === userId).realName
|
|
|
|
+ this.userId = userId
|
|
|
|
+ },
|
|
// 确认提交
|
|
// 确认提交
|
|
submit() {
|
|
submit() {
|
|
- if (this.userId) {
|
|
|
|
|
|
+ const exist = this.commonPersonList.some((item, index, c) => item.userId === this.userId)
|
|
|
|
+ if (this.userId && !exist) {
|
|
|
|
+ updateCommonPerson({ belongUserId: this.$store.state.user.userId, commonPersonName: this.userName, userId: this.userId }).then(res => {
|
|
|
|
+ this.$emit('selectedPerson', this.userId)
|
|
|
|
+ this.open = false
|
|
|
|
+ })
|
|
|
|
+ } else if (this.userId && exist) {
|
|
this.$emit('selectedPerson', this.userId)
|
|
this.$emit('selectedPerson', this.userId)
|
|
this.open = false
|
|
this.open = false
|
|
} else {
|
|
} else {
|