|
|
@@ -10,7 +10,7 @@
|
|
|
<div class="flex-align-center">
|
|
|
<el-input size="small" suffix-icon="el-icon-search" v-model="param.content.where.condition" placeholder="产品名称,编号" @keyup.enter.native="listData(param.content.pageNumber = 1)" @clear="listData(param.content.pageNumber = 1)" clearable></el-input>
|
|
|
</div>
|
|
|
- <el-button type="primary" size="mini" @click="onSbmit" :disabled="selectRowArr.length == 0">批量添加</el-button>
|
|
|
+ <el-button type="primary" size="mini" @click="onSbmit" :disabled="selectRowId.length == 0">批量添加</el-button>
|
|
|
</div>
|
|
|
<div class="produtMag-panel" style="margin-top: 10px">
|
|
|
<el-table
|
|
|
@@ -43,7 +43,7 @@
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
<div>
|
|
|
- <div style="float: left">已选:{{selectTotal}}个角色</div>
|
|
|
+ <div style="float: left">已选:{{selectRowId.length}}个人员</div>
|
|
|
<div style="margin-top:16px;text-align:right">
|
|
|
<el-pagination
|
|
|
background
|
|
|
@@ -51,7 +51,7 @@
|
|
|
@size-change="handleSizeChange"
|
|
|
@current-change="handleCurrentChange"
|
|
|
:current-page="currentPage"
|
|
|
- :page-sizes="[20, 50, 100, 200]"
|
|
|
+ :page-size="param.content.pageSize"
|
|
|
layout="total, prev, pager, next, jumper"
|
|
|
:total="total">
|
|
|
</el-pagination>
|
|
|
@@ -76,7 +76,6 @@ export default {
|
|
|
"content": {
|
|
|
"pageSize":20,
|
|
|
"pageNumber":1,
|
|
|
- "isExport":0,
|
|
|
"where": {
|
|
|
"condition": "",
|
|
|
}
|
|
|
@@ -84,23 +83,23 @@ export default {
|
|
|
},
|
|
|
list:[],
|
|
|
currentPage:0,
|
|
|
- selectTotal:0,
|
|
|
total:0,
|
|
|
- selectRowArr:[]
|
|
|
+ selectRowId:[],
|
|
|
+ selectAllData:[]
|
|
|
}
|
|
|
},
|
|
|
watch: {
|
|
|
- data (val) {
|
|
|
- this.data.forEach((row) => {
|
|
|
- this.allArr.forEach(item => {
|
|
|
- if (row == item.userid) {
|
|
|
+ list (val) {
|
|
|
+ this.list.forEach((row) => {
|
|
|
+ this.selectRowId.forEach(item => {
|
|
|
+ if (row.userid == item) {
|
|
|
this.$nextTick(() => {
|
|
|
this.$refs["tables"].toggleRowSelection(row, true);
|
|
|
})
|
|
|
}
|
|
|
})
|
|
|
});
|
|
|
- }
|
|
|
+ },
|
|
|
},
|
|
|
methods:{
|
|
|
async listData () {
|
|
|
@@ -112,17 +111,29 @@ export default {
|
|
|
this.currentPage = res.pageNumber
|
|
|
},
|
|
|
selectionChange (arrs,arr) {
|
|
|
- let index = this.selectRowArr.findIndex(item => item.userid == arr.userid)
|
|
|
+ let index = this.selectRowId.findIndex(item => item == arr.userid)
|
|
|
if (index != -1) {
|
|
|
- this.selectRowArr.splice(index,1)
|
|
|
+ this.selectAllData.splice(index,1)
|
|
|
+ this.selectRowId.splice(index,1)
|
|
|
} else {
|
|
|
- this.selectRowArr.push(arr)
|
|
|
+ this.selectRowId.push(arr.userid)
|
|
|
+ this.selectAllData.push(arr)
|
|
|
}
|
|
|
- console.log(this.selectRowArr);
|
|
|
+ },
|
|
|
+ normalSetId () {
|
|
|
+ this.listData()
|
|
|
+ this.selectAllData = this.data.userids.map(item => {
|
|
|
+ return {
|
|
|
+ userid: item,
|
|
|
+ name: this.data.usermsg[item]
|
|
|
+ }
|
|
|
+ })
|
|
|
+ console.log(this.selectAllData);
|
|
|
|
|
|
+ this.selectRowId = this.data.userids
|
|
|
},
|
|
|
onSbmit () {
|
|
|
- this.$emit('onResult',this.selectRowArr)
|
|
|
+ this.$emit('onResult',this.selectAllData)
|
|
|
this.drawer = false
|
|
|
},
|
|
|
handleSizeChange(val) {
|
|
|
@@ -137,10 +148,9 @@ export default {
|
|
|
},
|
|
|
},
|
|
|
mounted () {
|
|
|
- this.listData()
|
|
|
}
|
|
|
}
|
|
|
|
|
|
</script>
|
|
|
<style>
|
|
|
-</style>
|
|
|
+</style>
|