|
@@ -26,9 +26,9 @@
|
|
|
<!--用户数据-->
|
|
|
<el-col :span="20" :xs="24">
|
|
|
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
|
|
|
- <el-form-item label="用户名称" prop="userName">
|
|
|
+ <el-form-item label="用户名称" prop="name">
|
|
|
<el-input
|
|
|
- v-model="queryParams.userName"
|
|
|
+ v-model="queryParams.name"
|
|
|
placeholder="请输入用户名称"
|
|
|
clearable
|
|
|
size="small"
|
|
@@ -36,22 +36,13 @@
|
|
|
@keyup.enter.native="handleQuery"
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="手机号码" prop="phonenumber">
|
|
|
- <el-input
|
|
|
- v-model="queryParams.phonenumber"
|
|
|
- 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="handleQuery">搜索</el-button>
|
|
|
<el-button type="primary" icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
|
|
- <el-button
|
|
|
+ <el-button type="warning" icon="el-icon-circle-plus-outline" size="mini" @click="peopleChange()">配餐员批量处理</el-button>
|
|
|
+ <!-- <el-button type="warning" icon="el-icon-circle-plus-outline" size="mini" @click="peopleChange(0)">配餐员批量解绑</el-button> -->
|
|
|
+ <el-button type="success" icon="el-icon-circle-plus-outline" size="mini" @click="allPeople">查看所有配送员</el-button>
|
|
|
+ <!-- <el-button
|
|
|
type="primary"
|
|
|
plain
|
|
|
icon="el-icon-plus"
|
|
@@ -67,184 +58,116 @@
|
|
|
:disabled="multiple"
|
|
|
@click="handleDelete"
|
|
|
v-hasPermi="['system:user:remove']"
|
|
|
- >删除</el-button>
|
|
|
+ >删除</el-button> -->
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
|
|
|
<el-table v-loading="loading" :data="userList" @selection-change="handleSelectionChange" height="calc(100vh - 12vh - 120px)">
|
|
|
<el-table-column type="selection" width="50" align="center" />
|
|
|
- <el-table-column label="用户编号" align="center" key="userId" prop="userId" v-if="columns[0].visible" show-overflow-tooltip />
|
|
|
- <el-table-column label="用户名称" align="center" key="userName" prop="userName" v-if="columns[1].visible" show-overflow-tooltip />
|
|
|
- <el-table-column label="用户昵称" align="center" key="nickName" prop="nickName" v-if="columns[2].visible" show-overflow-tooltip />
|
|
|
- <el-table-column label="部门" align="center" key="deptName" prop="dept.deptName" v-if="columns[3].visible" show-overflow-tooltip />
|
|
|
- <el-table-column label="手机号码" align="center" key="phonenumber" prop="phonenumber" v-if="columns[4].visible" show-overflow-tooltip />
|
|
|
- <el-table-column label="配餐状态" align="center" key="status" v-if="columns[5].visible">
|
|
|
+ <el-table-column label="sid" align="center" key="sid" prop="sid" v-if="columns[0].visible" show-overflow-tooltip />
|
|
|
+ <el-table-column label="用户名称" align="center" key="userName" prop="name" v-if="columns[1].visible" show-overflow-tooltip />
|
|
|
+ <el-table-column label="部门" align="center" key="deptName" prop="deptName" v-if="columns[3].visible" show-overflow-tooltip />
|
|
|
+ <el-table-column label="配送员设置" align="center" key="people" v-if="columns[5].visible" >
|
|
|
<template slot-scope="scope">
|
|
|
<el-switch
|
|
|
- v-model="scope.row.status"
|
|
|
- active-value="0"
|
|
|
- inactive-value="1"
|
|
|
- @change="handleStatusChange(scope.row)"
|
|
|
+ v-model="scope.row.people"
|
|
|
+ active-value="1"
|
|
|
+ inactive-value="0"
|
|
|
+ @change="handlePeople('row',scope.row)"
|
|
|
+ ></el-switch>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="公众号推送设置" align="center" key="isSend" v-if="columns[5].visible" >
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-switch
|
|
|
+ v-model="scope.row.isSend"
|
|
|
+ active-value="1"
|
|
|
+ inactive-value="0"
|
|
|
+ @change="handleSend(scope.row)"
|
|
|
></el-switch>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
+ <!-- 添加或修改参数配置对话框 -->
|
|
|
+ <el-dialog :title="title" :visible.sync="open" width="750px" append-to-body :before-close="cancel" :close-on-click-modal="false" >
|
|
|
+ <el-form ref="form" :model="form" label-width="140px" >
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="配送员设置:" prop="people">
|
|
|
+ <el-switch
|
|
|
+ v-model="form.people"
|
|
|
+ active-value="1"
|
|
|
+ inactive-value="0"
|
|
|
+ @change="handlePeople('form',form)"
|
|
|
+ >
|
|
|
+ </el-switch>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="公众号推送信息:" prop="isSend">
|
|
|
+ <el-switch
|
|
|
+ v-model="form.isSend"
|
|
|
+ active-value="1"
|
|
|
+ inactive-value="0"
|
|
|
+ >
|
|
|
+ </el-switch>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </el-form>
|
|
|
+ <div slot="footer" class="dialog-footer">
|
|
|
+ <el-button type="primary" @click="submitForm(1)" v-if="!loading">确 定</el-button>
|
|
|
+ <el-button :loading="loading" type="primary" @click="submitForm" v-else>提交中...</el-button>
|
|
|
+ <el-button @click="cancel">取 消</el-button>
|
|
|
+ </div>
|
|
|
+ </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-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 />
|
|
|
+ <el-table-column label="用户名称" align="center" key="userName" prop="name" v-if="columns[1].visible" show-overflow-tooltip />
|
|
|
+ <el-table-column label="部门" align="center" key="deptName" prop="deptName" v-if="columns[3].visible" show-overflow-tooltip />
|
|
|
+ <el-table-column label="配送员设置" align="center" key="people" v-if="columns[5].visible" >
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-switch
|
|
|
+ v-model="scope.row.people"
|
|
|
+ active-value="1"
|
|
|
+ inactive-value="0"
|
|
|
+ @change="handlePeople('row',scope.row)"
|
|
|
+ ></el-switch>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="公众号推送设置" align="center" key="isSend" v-if="columns[5].visible" >
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-switch
|
|
|
+ v-model="scope.row.isSend"
|
|
|
+ active-value="1"
|
|
|
+ inactive-value="0"
|
|
|
+ @change="handleSend(scope.row)"
|
|
|
+ ></el-switch>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ </el-dialog>
|
|
|
|
|
|
<pagination
|
|
|
v-show="total>0"
|
|
|
:total="total"
|
|
|
- :page.sync="queryParams.pageNo"
|
|
|
- :limit.sync="queryParams.pageSize"
|
|
|
+ :page.sync="queryParams.current"
|
|
|
+ :limit.sync="queryParams.size"
|
|
|
@pagination="getList"
|
|
|
/>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
|
|
|
- <!-- 添加或修改参数配置对话框 -->
|
|
|
- <el-dialog :title="title" :visible.sync="open" width="600px" append-to-body :before-close="cancel" :close-on-click-modal="false">
|
|
|
- <el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
|
|
- <el-row>
|
|
|
- <el-col :span="12">
|
|
|
- <el-form-item label="用户昵称" prop="nickName">
|
|
|
- <el-input v-model.trim="form.nickName" placeholder="请输入用户昵称" maxlength="15" show-word-limit />
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- <el-col :span="12">
|
|
|
- <el-form-item label="归属部门" prop="deptId">
|
|
|
- <treeselect v-model="form.deptId" :options="deptOptions" :show-count="true" placeholder="请选择归属部门" />
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- </el-row>
|
|
|
- <el-row>
|
|
|
- <el-col :span="12">
|
|
|
- <el-form-item label="手机号码" prop="phonenumber">
|
|
|
- <el-input v-model.trim="form.phonenumber" placeholder="请输入手机号码" maxlength="11" show-word-limit/>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- <el-col :span="12">
|
|
|
- <el-form-item label="邮箱" prop="email">
|
|
|
- <el-input v-model.trim="form.email" placeholder="请输入邮箱" maxlength="40" show-word-limit />
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- </el-row>
|
|
|
- <el-row>
|
|
|
- <el-col :span="12">
|
|
|
- <el-form-item v-if="form.userId == undefined" label="用户名称" prop="userName">
|
|
|
- <el-input v-model.trim="form.userName" placeholder="请输入用户名称" maxlength="30" />
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- <el-col :span="12">
|
|
|
- <el-form-item v-if="form.userId == undefined" label="用户密码" prop="password">
|
|
|
- <el-input v-model.trim="form.password" placeholder="请输入用户密码" type="password" maxlength="20" show-password @input="onInput()" />
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- </el-row>
|
|
|
- <el-row>
|
|
|
- <el-col :span="12">
|
|
|
- <el-form-item label="用户性别">
|
|
|
- <el-select v-model="form.sex" placeholder="请选择">
|
|
|
- <el-option
|
|
|
- v-for="dict in sexOptions"
|
|
|
- :key="dict.dictValue"
|
|
|
- :label="dict.dictLabel"
|
|
|
- :value="dict.dictValue"
|
|
|
- ></el-option>
|
|
|
- </el-select>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- <el-col :span="12">
|
|
|
- <el-form-item label="状态">
|
|
|
- <el-radio-group v-model="form.status">
|
|
|
- <el-radio
|
|
|
- v-for="dict in statusOptions"
|
|
|
- :key="dict.dictValue"
|
|
|
- :label="dict.dictValue"
|
|
|
- >{{dict.dictLabel}}</el-radio>
|
|
|
- </el-radio-group>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- </el-row>
|
|
|
- <el-row>
|
|
|
- <el-col :span="12">
|
|
|
- <el-form-item label="岗位" prop="postId">
|
|
|
- <el-select v-model.trim="form.postId" placeholder="请选择" @change='changeUnit'>
|
|
|
- <el-option
|
|
|
- v-for="item in postOptions"
|
|
|
- :key="item.postId"
|
|
|
- :label="item.postName"
|
|
|
- :value="item.postId"
|
|
|
- :disabled="item.status == 1"
|
|
|
- ></el-option>
|
|
|
- </el-select>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- <el-col :span="12">
|
|
|
- <el-form-item label="角色" prop="roleId">
|
|
|
- <!-- multiple -->
|
|
|
- <el-select v-model="form.roleId" placeholder="请选择" >
|
|
|
- <el-option
|
|
|
- v-for="item in roleOptions"
|
|
|
- :key="item.roleId"
|
|
|
- :label="item.roleName"
|
|
|
- :value="item.roleId"
|
|
|
- :disabled="item.status == 1"
|
|
|
- ></el-option>
|
|
|
- </el-select>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- </el-row>
|
|
|
- <el-row>
|
|
|
- <el-col :span="24">
|
|
|
- <el-form-item label="备注">
|
|
|
- <el-input v-model.trim="form.remark" type="textarea" placeholder="请输入内容" maxlength="30" show-word-limit></el-input>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- </el-row>
|
|
|
- </el-form>
|
|
|
- <div slot="footer" class="dialog-footer">
|
|
|
- <el-button type="primary" @click="submitForm" v-if="!loading">确 定</el-button>
|
|
|
- <el-button :loading="loading" type="primary" v-else>提交中...</el-button>
|
|
|
- <el-button @click="cancel">取 消</el-button>
|
|
|
- </div>
|
|
|
- </el-dialog>
|
|
|
|
|
|
- <!-- 用户导入对话框 -->
|
|
|
- <el-dialog :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body :before-close="cancel" :close-on-click-modal="false">
|
|
|
- <el-upload
|
|
|
- ref="upload"
|
|
|
- :limit="1"
|
|
|
- accept=".xlsx, .xls"
|
|
|
- :headers="upload.headers"
|
|
|
- :action="upload.url + '?updateSupport=' + upload.updateSupport"
|
|
|
- :disabled="upload.isUploading"
|
|
|
- :on-progress="handleFileUploadProgress"
|
|
|
- :on-success="handleFileSuccess"
|
|
|
- :auto-upload="false"
|
|
|
- drag
|
|
|
- >
|
|
|
- <i class="el-icon-upload"></i>
|
|
|
- <div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
|
|
|
- <div class="el-upload__tip text-center" slot="tip">
|
|
|
- <div class="el-upload__tip" slot="tip">
|
|
|
- <el-checkbox v-model="upload.updateSupport" /> 是否更新已经存在的用户数据
|
|
|
- </div>
|
|
|
- <span>仅允许导入xls、xlsx格式文件。</span>
|
|
|
- <el-link type="primary" :underline="false" style="font-size:12px;vertical-align: baseline;" @click="importTemplate">下载模板</el-link>
|
|
|
- </div>
|
|
|
- </el-upload>
|
|
|
- <div slot="footer" class="dialog-footer">
|
|
|
- <el-button type="primary" @click="submitFileForm" v-if="!loading">确 定</el-button>
|
|
|
- <el-button :loading="loading" type="primary" v-else>提交中...</el-button>
|
|
|
- <el-button @click="upload.open = false">取 消</el-button>
|
|
|
- </div>
|
|
|
- </el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { listUser, getUser, delUser, addUser, updateUser, exportUser, resetUserPwd, changeUserStatus, importTemplate } from "@/api/system/user";
|
|
|
-import { getToken } from "@/utils/auth";
|
|
|
-import { treeselect } from "@/api/system/dept";
|
|
|
+import { getPeople, updataPeople,bumen, people} from "@/api/recharge/cateringManagement";
|
|
|
import Treeselect from "@riophae/vue-treeselect";
|
|
|
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
|
|
|
|
|
@@ -270,7 +193,7 @@ export default {
|
|
|
// 用户表格数据
|
|
|
userList: null,
|
|
|
// 弹出层标题
|
|
|
- title: "",
|
|
|
+ title: "人员配送信息处理",
|
|
|
// 部门树选项
|
|
|
deptOptions: undefined,
|
|
|
// 是否显示弹出层
|
|
@@ -282,15 +205,8 @@ export default {
|
|
|
// 日期范围
|
|
|
dateRange: [],
|
|
|
// 状态数据字典
|
|
|
- statusOptions: [],
|
|
|
- // 性别状态字典
|
|
|
- sexOptions: [],
|
|
|
- // 岗位选项
|
|
|
- postOptions: [],
|
|
|
- // 角色选项
|
|
|
- roleOptions: [],
|
|
|
- // 表单参数
|
|
|
- form: {},
|
|
|
+
|
|
|
+
|
|
|
defaultProps: {
|
|
|
children: "children",
|
|
|
label: "label"
|
|
@@ -305,16 +221,12 @@ export default {
|
|
|
isUploading: false,
|
|
|
// 是否更新已经存在的用户数据
|
|
|
updateSupport: 0,
|
|
|
- // 设置上传的请求头部
|
|
|
- headers: { Authorization: "Bearer " + getToken() },
|
|
|
- // 上传的地址
|
|
|
- url: process.env.VUE_APP_BASE_API + "/system/user/importData"
|
|
|
},
|
|
|
// 查询参数
|
|
|
queryParams: {
|
|
|
- pageNum: 1,
|
|
|
- pageSize: 10,
|
|
|
- userName: undefined,
|
|
|
+ current: 1,
|
|
|
+ size: 10,
|
|
|
+ name: undefined,
|
|
|
phonenumber: undefined,
|
|
|
status: undefined,
|
|
|
deptId: undefined
|
|
@@ -329,40 +241,16 @@ export default {
|
|
|
{ key: 5, label: `状态`, visible: true },
|
|
|
{ key: 6, label: `创建时间`, visible: true }
|
|
|
],
|
|
|
- // 表单校验
|
|
|
- rules: {
|
|
|
- userName: [
|
|
|
- { required: true, message: "用户名称不能为空", trigger: "blur" },
|
|
|
- { min: 2, max: 20, message: '用户名称长度必须介于 2 和 20 之间', trigger: 'blur' }
|
|
|
- ],
|
|
|
- nickName: [
|
|
|
- { required: true, message: "用户昵称不能为空", trigger: "blur" }
|
|
|
- ],
|
|
|
- password: [
|
|
|
- { required: true, message: "用户密码不能为空", trigger: "blur" },
|
|
|
- { min: 1, max: 20, message: '用户密码长度必须介于 5 和 20 之间', trigger: 'blur' }
|
|
|
- ],
|
|
|
- email: [
|
|
|
- { required: true, message: "邮箱地址不能为空", trigger: "blur" },
|
|
|
- {
|
|
|
- type: "email",
|
|
|
- message: "'请输入正确的邮箱地址",
|
|
|
- trigger: ["blur", "change"]
|
|
|
- }
|
|
|
- ],
|
|
|
- phonenumber: [
|
|
|
- { required: true, message: "手机号码不能为空", trigger: "blur" },
|
|
|
- {
|
|
|
- pattern: /^1[2|3|4|5|6|7|8|9][0-9]\d{8}$/,
|
|
|
- message: "请输入正确的手机号码",
|
|
|
- trigger: "blur"
|
|
|
- }
|
|
|
- ],
|
|
|
- roleId:[
|
|
|
- { required: true, message: "用户角色不能为空", trigger: "change"},
|
|
|
- ],
|
|
|
+ form:{
|
|
|
+ isSend:"1",
|
|
|
+ people:"1",
|
|
|
+ },
|
|
|
+ title2:"全部配餐人员信息",
|
|
|
+ open2:false,
|
|
|
+ userList2:[],
|
|
|
+
|
|
|
+
|
|
|
|
|
|
- }
|
|
|
};
|
|
|
},
|
|
|
watch: {
|
|
@@ -372,23 +260,8 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
created() {
|
|
|
- this.getList();
|
|
|
this.getTreeselect();
|
|
|
- //显示状态
|
|
|
- this.getDicts("sys_show_hide").then(response => {
|
|
|
- this.visibleOptions = response.data;
|
|
|
- });
|
|
|
- //菜单状态
|
|
|
- this.getDicts("sys_normal_disable").then(response => {
|
|
|
- this.statusOptions = response.data;
|
|
|
- });
|
|
|
- //性别状态
|
|
|
- this.getDicts("sys_user_sex").then(response => {
|
|
|
- this.sexOptions = response.data;
|
|
|
- });
|
|
|
- this.getConfigKey("sys.user.initPassword").then(response => {
|
|
|
- this.initPassword = response.msg;
|
|
|
- });
|
|
|
+ this.getList();
|
|
|
},
|
|
|
methods: {
|
|
|
//强制el-input刷新
|
|
@@ -401,19 +274,49 @@ export default {
|
|
|
/** 查询用户列表 */
|
|
|
getList() {
|
|
|
this.loading = true;
|
|
|
- listUser(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
|
|
|
- this.userList = response.data.rows;
|
|
|
- this.total = response.data.total;
|
|
|
- this.loading = false;
|
|
|
+ people(this.queryParams).then(response => {
|
|
|
+ let data1 = response.data.records
|
|
|
+ for(let i =0;i<data1.length;i++){
|
|
|
+ data1[i].deptName = JSON.parse(data1[i].dept).name
|
|
|
+ }
|
|
|
+ if(data1.length>0){
|
|
|
+ getPeople({current:1,size:500}).then(res => {
|
|
|
+ let data2 = res.data.records
|
|
|
+ if(data2.length>0){
|
|
|
+ for(let i =0;i<data1.length;i++){
|
|
|
+ data1[i].isSend = "0"
|
|
|
+ data1[i].people = "0"
|
|
|
+ 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].people = "1"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ for(let i =0;i<data1.length;i++){
|
|
|
+ data1[i].isSend = 0
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.userList = data1;
|
|
|
+ })
|
|
|
+ }else{
|
|
|
+ this.userList = response.data.records
|
|
|
}
|
|
|
- );
|
|
|
+ this.total = response.data.total;
|
|
|
+ this.loading = false;
|
|
|
+
|
|
|
+ })
|
|
|
},
|
|
|
/** 查询部门下拉树结构 */
|
|
|
getTreeselect() {
|
|
|
- treeselect().then(response => {
|
|
|
+ bumen({current:1}).then(response => {
|
|
|
this.deptOptions = response.data;
|
|
|
- console.log(response.data)
|
|
|
});
|
|
|
+ // treeselect().then(response => {
|
|
|
+ // this.deptOptions = response.data;
|
|
|
+ // });
|
|
|
},
|
|
|
// 筛选节点
|
|
|
filterNode(value, data) {
|
|
@@ -425,21 +328,6 @@ export default {
|
|
|
this.queryParams.deptId = data.id;
|
|
|
this.getList();
|
|
|
},
|
|
|
- // 用户状态修改
|
|
|
- handleStatusChange(row) {
|
|
|
- let text = row.status === "0" ? "启用" : "停用";
|
|
|
- this.$confirm('确认要"' + text + '""' + row.userName + '"用户吗?', "警告", {
|
|
|
- confirmButtonText: "确定",
|
|
|
- cancelButtonText: "取消",
|
|
|
- type: "warning"
|
|
|
- }).then(function() {
|
|
|
- return changeUserStatus(row.userId, row.status);
|
|
|
- }).then(() => {
|
|
|
- this.msgSuccess(text + "成功");
|
|
|
- }).catch(function() {
|
|
|
- row.status = row.status === "0" ? "1" : "0";
|
|
|
- });
|
|
|
- },
|
|
|
// 取消按钮
|
|
|
cancel() {
|
|
|
this.open = false;
|
|
@@ -447,6 +335,13 @@ export default {
|
|
|
this.reset();
|
|
|
})
|
|
|
},
|
|
|
+ // 取消按钮
|
|
|
+ cancel2() {
|
|
|
+ this.open2 = false;
|
|
|
+ setTimeout(()=>{
|
|
|
+ this.reset();
|
|
|
+ })
|
|
|
+ },
|
|
|
// 表单重置
|
|
|
reset() {
|
|
|
this.form = {
|
|
@@ -469,7 +364,7 @@ export default {
|
|
|
},
|
|
|
/** 搜索按钮操作 */
|
|
|
handleQuery() {
|
|
|
- this.queryParams.pageNum = 1;
|
|
|
+ this.queryParams.currnt = 1;
|
|
|
this.getList();
|
|
|
},
|
|
|
/** 重置按钮操作 */
|
|
@@ -480,7 +375,7 @@ export default {
|
|
|
},
|
|
|
// 多选框选中数据
|
|
|
handleSelectionChange(selection) {
|
|
|
- this.ids = selection.map(item => item.userId);
|
|
|
+ this.ids = selection.map(item => item.sid);
|
|
|
this.single = selection.length != 1;
|
|
|
this.multiple = !selection.length;
|
|
|
},
|
|
@@ -497,147 +392,121 @@ export default {
|
|
|
break;
|
|
|
}
|
|
|
},
|
|
|
- /** 新增按钮操作 */
|
|
|
- handleAdd() {
|
|
|
- this.getTreeselect();
|
|
|
- getUser().then(response => {
|
|
|
- this.postOptions = response.data.posts
|
|
|
- this.roleOptions = response.data.roles;
|
|
|
- this.open = true;
|
|
|
- this.title = "添加用户";
|
|
|
- this.form.password = this.initPassword;
|
|
|
-
|
|
|
- });
|
|
|
+ /** 导入按钮操作 */
|
|
|
+ handleImport() {
|
|
|
+ this.upload.title = "用户导入";
|
|
|
+ this.upload.open = true;
|
|
|
},
|
|
|
- /** 修改按钮操作 */
|
|
|
- handleUpdate(row) {
|
|
|
- this.getTreeselect();
|
|
|
- const userId = row.userId || this.ids;
|
|
|
- getUser(userId).then(response => {
|
|
|
- this.form = response.data.data;
|
|
|
- this.postOptions = response.data.posts
|
|
|
-
|
|
|
- this.roleOptions = response.data.roles;
|
|
|
-
|
|
|
-
|
|
|
- this.form.postId = response.data.postIds[0]
|
|
|
- this.form.roleId = response.data.roleIds[0]
|
|
|
- this.open = true;
|
|
|
- this.title = "修改用户";
|
|
|
- this.form.password = "";
|
|
|
+ /** 人员批量处理button */
|
|
|
+ peopleChange(){
|
|
|
+ if(this.ids.length>0){
|
|
|
+ this.open = true
|
|
|
+ }else{
|
|
|
+ this.$message.error('请勾选需要批量处理的人员选项')
|
|
|
+ }
|
|
|
+ },
|
|
|
+ /** 人员批量处理*/
|
|
|
+ submitForm(){
|
|
|
+ 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 = this.ids[i]
|
|
|
+ data[i].isSend = this.form.isSend
|
|
|
+ data[i].delFlag = this.form.people == "1" ? true : false
|
|
|
+ }
|
|
|
+ updataPeople(data).then(response =>{
|
|
|
+ this.msgSuccess(`人员批量处理完成`)
|
|
|
+ this.loading = false;
|
|
|
+ this.open = false
|
|
|
+ this.getList();
|
|
|
+ this.form = {isSend:"1",people:"1"}
|
|
|
+ }).catch(err=>{
|
|
|
+ this.open = false
|
|
|
+ this.loading = false;
|
|
|
+ this.form = {isSend:"1",people:"1"}
|
|
|
+ })
|
|
|
+ }
|
|
|
+ if(this.open2){
|
|
|
+ this.allPeopleShow()
|
|
|
+ }
|
|
|
|
|
|
- });
|
|
|
},
|
|
|
- /** 重置密码按钮操作 */
|
|
|
- handleResetPwd(row) {
|
|
|
- this.$prompt('请输入"' + row.userName + '"的新密码', "提示", {
|
|
|
- confirmButtonText: "确定",
|
|
|
- cancelButtonText: "取消",
|
|
|
- closeOnClickModal: false,
|
|
|
- inputPattern: /^.{5,20}$/,
|
|
|
- inputErrorMessage: "用户密码长度必须介于 5 和 20 之间",
|
|
|
- }).then(({ value }) => {
|
|
|
- resetUserPwd(row.userId, value).then(response => {
|
|
|
- this.msgSuccess("修改成功,新密码是:" + value);
|
|
|
- });
|
|
|
- }).catch(() => {});
|
|
|
+ /** 查看所有配送员 */
|
|
|
+ allPeople(){
|
|
|
+ this.open2 = true
|
|
|
+ this.allPeopleShow()
|
|
|
},
|
|
|
- /** 分配角色操作 */
|
|
|
- handleAuthRole: function(row) {
|
|
|
- const userId = row.userId;
|
|
|
- this.$router.push("/system/role");
|
|
|
+ allPeopleShow(){
|
|
|
+ getPeople({current:1,size:500}).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"
|
|
|
+ }
|
|
|
+ this.userList2 = data
|
|
|
+ })
|
|
|
},
|
|
|
- /** 提交按钮 */
|
|
|
- submitForm: function() {
|
|
|
- this.$refs["form"].validate(valid => {
|
|
|
- if (valid) {
|
|
|
- this.loading = true
|
|
|
- let postIds = []
|
|
|
- let roleIds = []
|
|
|
- if(this.form.postId){
|
|
|
- postIds.push(this.form.postId)
|
|
|
+ /**配送员单独设置 */
|
|
|
+ handlePeople(name,row){
|
|
|
+ if(name == "form"){
|
|
|
+ if(row.people == "0"){
|
|
|
+ row.isSend = "0"
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ let data = [{userId:undefined,delFlag:undefined,isSend:undefined}]
|
|
|
+ if(row.people == "1"){
|
|
|
+ data[0].isSend= row.isSend
|
|
|
+ data[0].delFlag = true
|
|
|
+ }else{
|
|
|
+ data[0].isSend = 0
|
|
|
+ data[0].delFlag = false
|
|
|
+ }
|
|
|
+ data[0].userId = row.sid
|
|
|
+ updataPeople(data).then(response =>{
|
|
|
+ if(data[0].delFlag){
|
|
|
+ this.msgSuccess(`人员绑定完成`)
|
|
|
+ }else{
|
|
|
+ this.msgSuccess(`人员解绑完成`)
|
|
|
}
|
|
|
- roleIds.push(this.form.roleId)
|
|
|
- this.form.postIds = postIds
|
|
|
- this.form.roleIds = roleIds
|
|
|
- if (this.form.userId != undefined) {
|
|
|
- updateUser(this.form).then(response => {
|
|
|
- this.loading = false
|
|
|
- this.msgSuccess("修改成功");
|
|
|
- this.open = false;
|
|
|
- this.getList();
|
|
|
- }).catch(err=>{
|
|
|
- this.loading = false
|
|
|
- });
|
|
|
- } else {
|
|
|
- addUser(this.form).then(response => {
|
|
|
- this.loading = false
|
|
|
- this.msgSuccess("新增成功");
|
|
|
- this.open = false;
|
|
|
- this.getList();
|
|
|
- }).catch(err=>{
|
|
|
- this.loading = false
|
|
|
- });
|
|
|
+ this.getList();
|
|
|
+ this.form = {isSend:"1",people:"1"}
|
|
|
+ }).catch(err=>{
|
|
|
+ this.getList();
|
|
|
+ this.form = {isSend:"1",people:"1"}
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
+ /**公众号推送单独设置 */
|
|
|
+ handleSend(row){
|
|
|
+ let data = [{userId:undefined,delFlag:undefined,isSend:undefined}]
|
|
|
+ if(row.isSend == "1"){
|
|
|
+ data[0].isSend = 1
|
|
|
+ if(row.people == "0"){
|
|
|
+ row.people == "1"
|
|
|
+ data[0].delFlag= true
|
|
|
+ }else{
|
|
|
+ data[0].delFlag= true
|
|
|
}
|
|
|
+ }else{
|
|
|
+ data[0].isSend= 0
|
|
|
+ data[0].delFlag= row.people == "1" ? true : false
|
|
|
}
|
|
|
- });
|
|
|
- },
|
|
|
- /** 删除按钮操作 */
|
|
|
- handleDelete(row) {
|
|
|
- const userIds = row.userId || this.ids;
|
|
|
- this.$confirm('是否确认删除用户编号为"' + userIds + '"的数据项?', "警告", {
|
|
|
- confirmButtonText: "确定",
|
|
|
- cancelButtonText: "取消",
|
|
|
- type: "warning"
|
|
|
- }).then(function() {
|
|
|
- return delUser(userIds);
|
|
|
- }).then(() => {
|
|
|
+ data[0].userId = row.sid
|
|
|
+ updataPeople(data).then(response =>{
|
|
|
+ if(data[0].delFlag){
|
|
|
+ this.msgSuccess(`公众号推送绑定完成`)
|
|
|
+ }else{
|
|
|
+ this.msgSuccess(`公众号推送解绑完成`)
|
|
|
+ }
|
|
|
+ this.form = {isSend:"1",people:"1"}
|
|
|
this.getList();
|
|
|
- this.msgSuccess("删除成功");
|
|
|
- }).catch(() => {});
|
|
|
- },
|
|
|
- /** 导出按钮操作 */
|
|
|
- handleExport() {
|
|
|
- const queryParams = this.queryParams;
|
|
|
- this.$confirm('是否确认导出所有用户数据项?', "警告", {
|
|
|
- confirmButtonText: "确定",
|
|
|
- cancelButtonText: "取消",
|
|
|
- type: "warning"
|
|
|
- }).then(() => {
|
|
|
- this.exportLoading = true;
|
|
|
- return exportUser(queryParams);
|
|
|
- }).then(response => {
|
|
|
- this.download(response.msg);
|
|
|
- this.exportLoading = false;
|
|
|
- }).catch(() => {});
|
|
|
- },
|
|
|
- /** 导入按钮操作 */
|
|
|
- handleImport() {
|
|
|
- this.upload.title = "用户导入";
|
|
|
- this.upload.open = true;
|
|
|
- },
|
|
|
- /** 下载模板操作 */
|
|
|
- importTemplate() {
|
|
|
- importTemplate().then(response => {
|
|
|
- this.download(response.msg);
|
|
|
- });
|
|
|
- },
|
|
|
- // 文件上传中处理
|
|
|
- handleFileUploadProgress(event, file, fileList) {
|
|
|
- this.upload.isUploading = true;
|
|
|
- },
|
|
|
- // 文件上传成功处理
|
|
|
- handleFileSuccess(response, file, fileList) {
|
|
|
- this.upload.open = false;
|
|
|
- this.upload.isUploading = false;
|
|
|
- this.$refs.upload.clearFiles();
|
|
|
- this.$alert(response.msg, "导入结果", { dangerouslyUseHTMLString: true });
|
|
|
- this.getList();
|
|
|
+ }).catch(err=>{
|
|
|
+ this.getList();
|
|
|
+ this.form = {isSend:"1",people:"1"}
|
|
|
+ })
|
|
|
},
|
|
|
- // 提交上传文件
|
|
|
- submitFileForm() {
|
|
|
- this.$refs.upload.submit();
|
|
|
- }
|
|
|
}
|
|
|
};
|
|
|
</script>
|