|
@@ -123,7 +123,34 @@
|
|
|
</el-dialog>
|
|
|
<!-- 全部配送人员对话框 -->
|
|
|
<el-dialog :title="title2" :visible.sync="open2" width="750px" append-to-body :before-close="cancel2" :close-on-click-modal="false" >
|
|
|
- <el-button type="warning" icon="el-icon-circle-plus-outline" size="mini" @click="peopleChange()" style="margin:-50px 0 30px">配餐员批量处理</el-button>
|
|
|
+ <el-form :model="queryParams2" ref="queryForm2" :inline="true" v-show="showSearch" label-width="68px">
|
|
|
+ <el-form-item label="用户名称" prop="name">
|
|
|
+ <el-input
|
|
|
+ v-model="queryParams2.name"
|
|
|
+ placeholder="请输入用户名称"
|
|
|
+ clearable
|
|
|
+ size="small"
|
|
|
+ style="width: 140px"
|
|
|
+ @keyup.enter.native="handleQuery"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item>
|
|
|
+ <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery2">搜索</el-button>
|
|
|
+ <el-button type="primary" icon="el-icon-refresh" size="mini" @click="resetQuery2">重置</el-button>
|
|
|
+ <el-button type="warning" icon="el-icon-circle-plus-outline" size="mini" @click="peopleChange()" style="margin:-50px 10px 30px">配餐员批量处理</el-button>
|
|
|
+ <!-- <el-button
|
|
|
+ type="success"
|
|
|
+ plain
|
|
|
+ icon="el-icon-download"
|
|
|
+ size="mini"
|
|
|
+ @click="handleExport"
|
|
|
+ :loading="exportLoading"
|
|
|
+ style="margin-left:0px;"
|
|
|
+ >配送人员导出</el-button> -->
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+
|
|
|
+
|
|
|
<el-table v-loading="loading" :data="userList2" @selection-change="handleSelectionChange" height="60vh">
|
|
|
<el-table-column type="selection" width="50" align="center" />
|
|
|
<el-table-column label="sid" align="center" key="sid" prop="sid" v-if="columns[0].visible" show-overflow-tooltip />
|
|
@@ -167,7 +194,7 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { getPeople, updataPeople,bumen, people} from "@/api/recharge/cateringManagement";
|
|
|
+import { getPeople, updataPeople,bumen, people, staffExport} from "@/api/recharge/cateringManagement";
|
|
|
import Treeselect from "@riophae/vue-treeselect";
|
|
|
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
|
|
|
|
|
@@ -231,6 +258,12 @@ export default {
|
|
|
status: undefined,
|
|
|
deptId: undefined
|
|
|
},
|
|
|
+ // 查询参数2
|
|
|
+ queryParams2: {
|
|
|
+ current: 1,
|
|
|
+ size: 500,
|
|
|
+ name: undefined,
|
|
|
+ },
|
|
|
// 列信息
|
|
|
columns: [
|
|
|
{ key: 0, label: `用户编号`, visible: true },
|
|
@@ -286,10 +319,12 @@ export default {
|
|
|
for(let i =0;i<data1.length;i++){
|
|
|
data1[i].isSend = "0"
|
|
|
data1[i].people = "0"
|
|
|
+ data1[i].dreUserId = undefined
|
|
|
for(let a=0;a<data2.length;a++){
|
|
|
if(data1[i].sid == data2[a].sid ){
|
|
|
data1[i].isSend = data2[a].isSend ? "1" : "0"
|
|
|
data1[i].delFlag = data2[a].delFlag ? "1" : "0"
|
|
|
+ data1[i].dreUserId = data2[a].dreUserId
|
|
|
data1[i].people = "1"
|
|
|
}
|
|
|
}
|
|
@@ -304,6 +339,7 @@ export default {
|
|
|
}else{
|
|
|
this.userList = response.data.records
|
|
|
}
|
|
|
+
|
|
|
this.total = response.data.total;
|
|
|
this.loading = false;
|
|
|
|
|
@@ -367,15 +403,26 @@ export default {
|
|
|
this.queryParams.currnt = 1;
|
|
|
this.getList();
|
|
|
},
|
|
|
+ /** 搜索按钮操作 */
|
|
|
+ handleQuery2() {
|
|
|
+ // this.queryParams2.currnt = 1;
|
|
|
+ // this.queryParams2.size = 500;
|
|
|
+ this.allPeopleShow();
|
|
|
+ },
|
|
|
/** 重置按钮操作 */
|
|
|
resetQuery() {
|
|
|
this.dateRange = [];
|
|
|
this.resetForm("queryForm");
|
|
|
this.handleQuery();
|
|
|
},
|
|
|
+ resetQuery2(){
|
|
|
+ this.resetForm("queryForm2");
|
|
|
+ this.handleQuery2();
|
|
|
+ },
|
|
|
// 多选框选中数据
|
|
|
handleSelectionChange(selection) {
|
|
|
this.ids = selection.map(item => item.sid);
|
|
|
+ this.zid = selection.map(item => item.dreUserId);
|
|
|
this.single = selection.length != 1;
|
|
|
this.multiple = !selection.length;
|
|
|
},
|
|
@@ -401,6 +448,7 @@ export default {
|
|
|
peopleChange(){
|
|
|
if(this.ids.length>0){
|
|
|
this.open = true
|
|
|
+ this.form = {isSend:"1",people:"1"}
|
|
|
}else{
|
|
|
this.$message.error('请勾选需要批量处理的人员选项')
|
|
|
}
|
|
@@ -410,40 +458,42 @@ export default {
|
|
|
if(this.open){
|
|
|
let data = []
|
|
|
for(let i =0;i<this.ids.length;i++){
|
|
|
- data[i] = {userId:undefined,isSend:undefined,delFlag:undefined}
|
|
|
+ data[i] = {userId:undefined,isSend:undefined,delFlag:undefined,id:undefined}
|
|
|
data[i].userId = this.ids[i]
|
|
|
- data[i].isSend = this.form.isSend
|
|
|
+ data[i].isSend = this.form.isSend == '1' ? 1 : 0
|
|
|
data[i].delFlag = this.form.people == "1" ? true : false
|
|
|
+ data[i].id = this.zid[i]
|
|
|
}
|
|
|
updataPeople(data).then(response =>{
|
|
|
this.msgSuccess(`人员批量处理完成`)
|
|
|
this.loading = false;
|
|
|
this.open = false
|
|
|
this.getList();
|
|
|
- this.form = {isSend:"1",people:"1"}
|
|
|
+ if(this.open2){
|
|
|
+ this.allPeopleShow()
|
|
|
+ }
|
|
|
}).catch(err=>{
|
|
|
this.open = false
|
|
|
this.loading = false;
|
|
|
- this.form = {isSend:"1",people:"1"}
|
|
|
})
|
|
|
}
|
|
|
- if(this.open2){
|
|
|
- this.allPeopleShow()
|
|
|
- }
|
|
|
+
|
|
|
|
|
|
},
|
|
|
- /** 查看所有配送员 */
|
|
|
+ /** 查看所有配送员按钮 */
|
|
|
allPeople(){
|
|
|
this.open2 = true
|
|
|
this.allPeopleShow()
|
|
|
},
|
|
|
+ /** 查看所有配送员 */
|
|
|
allPeopleShow(){
|
|
|
- getPeople({current:1,size:500}).then(res => {
|
|
|
+ getPeople(this.queryParams2).then(res => {
|
|
|
let data = res.data.records
|
|
|
for(let i =0;i<data.length;i++){
|
|
|
data[i].deptName = JSON.parse(data[i].dept).name
|
|
|
data[i].people = "1"
|
|
|
data[i].isSend = data[i].isSend ? "1" : "0"
|
|
|
+ data[i].id = data.dreUserId
|
|
|
}
|
|
|
this.userList2 = data
|
|
|
})
|
|
@@ -455,7 +505,7 @@ export default {
|
|
|
row.isSend = "0"
|
|
|
}
|
|
|
}else{
|
|
|
- let data = [{userId:undefined,delFlag:undefined,isSend:undefined}]
|
|
|
+ let data = [{userId:undefined,delFlag:undefined,isSend:undefined,id:undefined}]
|
|
|
if(row.people == "1"){
|
|
|
data[0].isSend= row.isSend
|
|
|
data[0].delFlag = true
|
|
@@ -463,6 +513,7 @@ export default {
|
|
|
data[0].isSend = 0
|
|
|
data[0].delFlag = false
|
|
|
}
|
|
|
+ data[0].id = row.dreUserId
|
|
|
data[0].userId = row.sid
|
|
|
updataPeople(data).then(response =>{
|
|
|
if(data[0].delFlag){
|
|
@@ -471,16 +522,28 @@ export default {
|
|
|
this.msgSuccess(`人员解绑完成`)
|
|
|
}
|
|
|
this.getList();
|
|
|
- this.form = {isSend:"1",people:"1"}
|
|
|
+ if(this.open2){
|
|
|
+ this.allPeopleShow()
|
|
|
+ }
|
|
|
}).catch(err=>{
|
|
|
this.getList();
|
|
|
- this.form = {isSend:"1",people:"1"}
|
|
|
})
|
|
|
}
|
|
|
+
|
|
|
+ // if(this.open2){
|
|
|
+ // if(row.people == "1"){
|
|
|
+ // data[0].isSend= row.isSend
|
|
|
+ // data[0].delFlag = true
|
|
|
+ // }else{
|
|
|
+ // data[0].isSend = 0
|
|
|
+ // data[0].delFlag = false
|
|
|
+ // }
|
|
|
+ // this.allPeopleShow()
|
|
|
+ // }
|
|
|
},
|
|
|
/**公众号推送单独设置 */
|
|
|
handleSend(row){
|
|
|
- let data = [{userId:undefined,delFlag:undefined,isSend:undefined}]
|
|
|
+ let data = [{userId:undefined,delFlag:undefined,isSend:undefined,id:undefined}]
|
|
|
if(row.isSend == "1"){
|
|
|
data[0].isSend = 1
|
|
|
if(row.people == "0"){
|
|
@@ -490,9 +553,11 @@ export default {
|
|
|
data[0].delFlag= true
|
|
|
}
|
|
|
}else{
|
|
|
+ data[0].delFlag = row.people == "1" ? true : false
|
|
|
data[0].isSend= 0
|
|
|
data[0].delFlag= row.people == "1" ? true : false
|
|
|
}
|
|
|
+ data[0].id = row.dreUserId
|
|
|
data[0].userId = row.sid
|
|
|
updataPeople(data).then(response =>{
|
|
|
if(data[0].delFlag){
|
|
@@ -500,13 +565,38 @@ export default {
|
|
|
}else{
|
|
|
this.msgSuccess(`公众号推送解绑完成`)
|
|
|
}
|
|
|
- this.form = {isSend:"1",people:"1"}
|
|
|
this.getList();
|
|
|
+ if(this.open2){
|
|
|
+ this.allPeopleShow()
|
|
|
+ }
|
|
|
}).catch(err=>{
|
|
|
this.getList();
|
|
|
- this.form = {isSend:"1",people:"1"}
|
|
|
})
|
|
|
},
|
|
|
+ /** 导出按钮操作 */
|
|
|
+ // handleExport() {
|
|
|
+ // let queryParams = {...this.queryParams};
|
|
|
+ // delete queryParams.current
|
|
|
+ // delete queryParams.size
|
|
|
+ // this.exportLoading = true;
|
|
|
+ // staffExport(queryParams).then(response =>{
|
|
|
+ // this.exportLoading = false;
|
|
|
+ // localStorage.setItem('fileExportId', response.data)
|
|
|
+ // this.$router.push({path:'/recharge/fileExport'})
|
|
|
+ // // setTimeout(()=>{
|
|
|
+ // // listRecharge({current:1,size:1,id:response.id}).then(res=>{
|
|
|
+ // // var a = document.createElement("a"); //创建一个<a></a>标签
|
|
|
+ // // a.href = res.data.records[0].url; // 给a标签的href属性值加上地址,注意,这里是绝对路径,不用加 点.
|
|
|
+ // // a.download = "配餐记录" + getNowTime(); //设置下载文件文件名,这里加上.xlsx指定文件类型,pdf文件就指定.fpd即可
|
|
|
+ // // a.style.display = "none"; // 障眼法藏起来a标签
|
|
|
+ // // document.body.appendChild(a); // 将a标签追加到文档对象中
|
|
|
+ // // a.click(); // 模拟点击了a标签,会触发a标签的href的读取,浏览器就会自动下载了
|
|
|
+ // // a.remove();
|
|
|
+ // // this.exportLoading = false;
|
|
|
+ // // })
|
|
|
+ // // },1000)
|
|
|
+ // })
|
|
|
+ // }
|
|
|
}
|
|
|
};
|
|
|
</script>
|