| | |
| | | <span>{{ currentEvent.conntinueTime }}</span> |
| | | </el-form-item> |
| | | <el-form-item label="关联店铺" prop="store"> |
| | | <el-select v-model="eventInfoData.store" @change="selectStoreChange" placeholder="请选择关联店铺"> |
| | | <el-select v-model="eventInfoData.store" clearable @change="selectStoreChange" placeholder="请选择关联店铺"> |
| | | <el-option v-for="store in storeList" :value="store.id" :label="store.storeName" :key="store.id" /> |
| | | </el-select> |
| | | </el-form-item> |
| | |
| | | color: #4b9bb7; |
| | | } |
| | | } |
| | | </style> |
| | | </style> |
| | |
| | | <template> |
| | | <div class="createUser"> |
| | | <main> |
| | | <div class="mainContent"> |
| | | <el-form ref="password" label-width="140px" :rules="passwordRules" autoComplete="on" :model="password" |
| | | label-position="right"> |
| | | <el-form-item class="optionItem" label="当前密码:" prop="oldPassword"> |
| | | <el-input type="password" v-model="password.oldPassword" placeholder="请填写当前密码"></el-input> |
| | | </el-form-item> |
| | | <el-form-item class="optionItems" label="新密码:" prop="newPassword"> |
| | | <el-input type="password" v-model="password.newPassword" placeholder="请填写新密码"></el-input> |
| | | </el-form-item> |
| | | <el-form-item class="optionItems" label="确定新密码:" prop="confirmPassword"> |
| | | <el-input type="password" v-model="password.confirmPassword" placeholder="请再次填写新密码"></el-input> |
| | | </el-form-item> |
| | | <el-form-item class="optionItems"> |
| | | <el-button type="primary" @click="onSubmit">提交</el-button> |
| | | </el-form-item> |
| | | </el-form> |
| | | </div> |
| | | </main> |
| | | </div> |
| | | <div class="createUser"> |
| | | <main> |
| | | <div class="mainContent"> |
| | | <el-form ref="password" label-width="140px" :rules="passwordRules" autoComplete="on" :model="password" |
| | | label-position="right"> |
| | | <el-form-item class="optionItem" label="当前密码:" prop="oldPassword"> |
| | | <el-input type="password" v-model="password.oldPassword" placeholder="请填写当前密码"></el-input> |
| | | </el-form-item> |
| | | <el-form-item class="optionItems" label="新密码:" prop="newPassword"> |
| | | <el-input type="password" v-model="password.newPassword" placeholder="请填写新密码"></el-input> |
| | | </el-form-item> |
| | | <el-form-item class="optionItems" label="确定新密码:" prop="confirmPassword"> |
| | | <el-input type="password" v-model="password.confirmPassword" placeholder="请再次填写新密码"></el-input> |
| | | </el-form-item> |
| | | <el-form-item class="optionItems"> |
| | | <el-button type="primary" @click="onSubmit">提交</el-button> |
| | | </el-form-item> |
| | | </el-form> |
| | | </div> |
| | | </main> |
| | | </div> |
| | | </template> |
| | | <script> |
| | | import users from "@/api/users"; |
| | | |
| | | export default { |
| | | data() { |
| | | return { |
| | | updatePasswordParam:{ |
| | | newPassword:"", |
| | | oldPassword:"", |
| | | username:"" |
| | | }, |
| | | password: { |
| | | oldPassword: null, |
| | | newPassword: null, |
| | | confirmPassword: null |
| | | }, |
| | | passwordRules: { |
| | | newPassword: [{ required: true, trigger: 'blur', message: '密码不能为空' }], |
| | | oldPassword: [{ required: true, trigger: 'blur', message: '新密码不能为空' }], |
| | | confirmPassword: [{ required: true, trigger: 'blur', message: '新密码不能为空' }], |
| | | }, |
| | | } |
| | | }, |
| | | created() { |
| | | }, |
| | | methods: { |
| | | onSubmit() { |
| | | this.$refs.password.validate(valid => { |
| | | if (valid) { |
| | | this.updatePasswordParam.oldPassword=this.password.oldPassword; |
| | | this.updatePasswordParam.username=sessionStorage.getItem('name'); |
| | | this.updatePasswordParam.newPassword=this.password.newPassword; |
| | | users.updatePassword(this.updatePasswordParam) |
| | | .then(() => { |
| | | this.$message.success('修改密码成功, 即将重新登录'); |
| | | this.logout(); |
| | | location.reload(); |
| | | }) |
| | | .catch(err => this.$message.error(err)) |
| | | data() { |
| | | const validatePass = (rule, value, callback) => { |
| | | if (!value) { |
| | | callback(new Error("用户密码不能为空")); |
| | | } else { |
| | | if (value.length < 6 || value.length > 16) { |
| | | callback(new Error("用户密码长度不合法")); |
| | | } else { |
| | | const rep = /^\w+$/; |
| | | if (!rep.test(value)) { |
| | | callback(new Error("密码只能是以数字、26个英文字母或者下划线组成的字符串")); |
| | | } else { |
| | | callback(); |
| | | } |
| | | }) |
| | | }, |
| | | logout() { |
| | | users.logout() |
| | | .then(() => { |
| | | sessionStorage.clear(); |
| | | }) |
| | | .catch(err => this.$message.error(err)) |
| | | } |
| | | } |
| | | }, |
| | | }; |
| | | return { |
| | | updatePasswordParam: { |
| | | newPassword: "", |
| | | oldPassword: "", |
| | | username: "" |
| | | }, |
| | | password: { |
| | | oldPassword: null, |
| | | newPassword: null, |
| | | confirmPassword: null |
| | | }, |
| | | passwordRules: { |
| | | newPassword: [ |
| | | {required: true, trigger: 'blur', message: '密码不能为空'}, |
| | | {validator: validatePass, trigger: 'blur'} |
| | | ], |
| | | oldPassword: [ |
| | | {required: true, trigger: 'blur', message: '新密码不能为空'}, |
| | | {validator: validatePass, trigger: 'blur'} |
| | | ], |
| | | confirmPassword: [ |
| | | {required: true, trigger: 'blur', message: '新密码不能为空'}, |
| | | {validator: validatePass, trigger: 'blur'} |
| | | ], |
| | | } |
| | | } |
| | | }, |
| | | created() { |
| | | }, |
| | | methods: { |
| | | onSubmit() { |
| | | this.$refs.password.validate(valid => { |
| | | if (valid) { |
| | | this.updatePasswordParam.oldPassword = this.password.oldPassword; |
| | | this.updatePasswordParam.username = sessionStorage.getItem('name'); |
| | | this.updatePasswordParam.newPassword = this.password.newPassword; |
| | | users.updatePassword(this.updatePasswordParam) |
| | | .then(() => { |
| | | this.$message.success('修改密码成功, 即将重新登录'); |
| | | this.logout(); |
| | | location.reload(); |
| | | }) |
| | | .catch(err => this.$message.error(err)) |
| | | } |
| | | }) |
| | | } |
| | | , |
| | | logout() { |
| | | users.logout() |
| | | .then(() => { |
| | | sessionStorage.clear(); |
| | | }) |
| | | .catch(err => this.$message.error(err)) |
| | | } |
| | | }, |
| | | } |
| | | </script> |
| | | <style lang="scss" scoped> |
| | | .createUser { |
| | | border-radius: 1px; |
| | | border-radius: 1px; |
| | | background-color: #09152f; |
| | | |
| | | main { |
| | | text-align: left; |
| | | padding: 0 55px; |
| | | background-color: #09152f; |
| | | padding-bottom: 50px; |
| | | |
| | | main { |
| | | text-align: left; |
| | | padding: 0 55px; |
| | | background-color: #09152f; |
| | | padding-bottom: 50px; |
| | | .mainContent { |
| | | display: flex; |
| | | justify-content: center; |
| | | padding-top: 50px; |
| | | |
| | | .mainContent { |
| | | display: flex; |
| | | justify-content: center; |
| | | padding-top: 50px; |
| | | .el-form-item__content { |
| | | width: 400px; |
| | | |
| | | .el-form-item__content { |
| | | width: 400px; |
| | | |
| | | .el-select { |
| | | width: 100%; |
| | | } |
| | | } |
| | | |
| | | .optionHandleSp { |
| | | display: flex; |
| | | |
| | | .areaNumber, |
| | | .moreNumber { |
| | | flex: 1; |
| | | } |
| | | |
| | | .telNumber { |
| | | flex: 2; |
| | | } |
| | | } |
| | | |
| | | .optionBtn { |
| | | display: flex; |
| | | margin-top: 20px; |
| | | |
| | | .btn { |
| | | padding: 12px 50px; |
| | | } |
| | | } |
| | | |
| | | .el-select { |
| | | width: 100%; |
| | | } |
| | | } |
| | | } |
| | | |
| | | &::v-deep .el-textarea__inner { |
| | | background-color: #09152f; |
| | | border: 1px solid #17324c; |
| | | } |
| | | .optionHandleSp { |
| | | display: flex; |
| | | |
| | | ::v-deep .el-form-item__label { |
| | | color: #4b9bb7; |
| | | } |
| | | .areaNumber, |
| | | .moreNumber { |
| | | flex: 1; |
| | | } |
| | | |
| | | ::v-deep .el-input__inner { |
| | | background-color: #09152f; |
| | | border: 1px solid #17324c; |
| | | .telNumber { |
| | | flex: 2; |
| | | } |
| | | } |
| | | |
| | | .optionBtn { |
| | | display: flex; |
| | | margin-top: 20px; |
| | | |
| | | .btn { |
| | | padding: 12px 50px; |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |
| | | |
| | | &::v-deep .el-textarea__inner { |
| | | background-color: #09152f; |
| | | border: 1px solid #17324c; |
| | | } |
| | | |
| | | ::v-deep .el-form-item__label { |
| | | color: #4b9bb7; |
| | | } |
| | | |
| | | ::v-deep .el-input__inner { |
| | | background-color: #09152f; |
| | | border: 1px solid #17324c; |
| | | } |
| | | } |
| | | </style> |
| | | </style> |
| | |
| | | { required: true, trigger: "blur", message: '请输入短信标题' }, |
| | | ], |
| | | targetTo: [ |
| | | { required: true , trigger: "blur", message: '请选择接收人' }, |
| | | { required: true , trigger: "blur", message: '请选择接收对象' }, |
| | | ], |
| | | body: [ |
| | | { required: true, trigger: ['blur', 'change'], validator: validateMessageContent } |
| | |
| | | }, |
| | | // 选中id |
| | | handleCheck(data, node) { |
| | | this.checkedList = [] |
| | | node.checkedNodes.forEach(item => { |
| | | if(!item.hasOwnProperty('departType')){ |
| | | this.checkedList.push(item.id) |
| | |
| | | sendMessage(params) |
| | | .then(() => { |
| | | this.$message({ type: 'success', message: '操作成功' }); |
| | | this.$emit('closeDialog'); |
| | | this.$emit('closeMyDialog'); |
| | | }) |
| | | .catch(err => this.$message({ type: 'error', message: err })); |
| | | } else { |
| | |
| | | } |
| | | } |
| | | } |
| | | </style> |
| | | </style> |
| | |
| | | <span>短信回执:</span> |
| | | <el-select v-model="messageStatus" placeholder="请选择"> |
| | | <el-option |
| | | v-for="item in statusList" |
| | | :key="item.value" |
| | | :label="item.label" |
| | | :value="item.label" |
| | | v-for="item in statusList" |
| | | :key="item.value" |
| | | :label="item.label" |
| | | :value="item.label" |
| | | > |
| | | </el-option> |
| | | </el-select> |
| | | </div> |
| | | <div class="find"> |
| | | <el-button type="primary" icon="el-icon-search" @click="getTableData" |
| | | >查询</el-button |
| | | >查询 |
| | | </el-button |
| | | > |
| | | <el-button icon="el-icon-delete-solid" @click="handleReset" |
| | | >重置</el-button |
| | | >重置 |
| | | </el-button |
| | | > |
| | | </div> |
| | | </div> |
| | |
| | | <div class="main-nav"> |
| | | <span>数据列表</span> |
| | | <el-button |
| | | class="button-addition" |
| | | type="primary" |
| | | icon="el-icon-plus" |
| | | @click="isShowDialog = true" |
| | | >添加</el-button |
| | | class="button-addition" |
| | | type="primary" |
| | | icon="el-icon-plus" |
| | | @click="isShowDialog = true" |
| | | >添加 |
| | | </el-button |
| | | > |
| | | </div> |
| | | <!-- 数据展示 --> |
| | | <el-table |
| | | ref="multipleTable" |
| | | :header-cell-style="{ |
| | | ref="multipleTable" |
| | | :header-cell-style="{ |
| | | background: '#06122c', |
| | | 'font-size': '12px', |
| | | color: '#4b9bb7', |
| | | 'font-weight': '650', |
| | | 'line-height': '45px', |
| | | }" |
| | | :data="tableData" |
| | | style="width: 100%" |
| | | :row-class-name="tableRowClassName" |
| | | @selection-change="tableChange" |
| | | :data="tableData" |
| | | style="width: 100%" |
| | | :row-class-name="tableRowClassName" |
| | | @selection-change="tableChange" |
| | | > |
| | | <el-table-column type="selection" min-width="5"> </el-table-column> |
| | | <el-table-column type="selection" min-width="5"></el-table-column> |
| | | <el-table-column label="ID" min-width="5" prop="id"> |
| | | <template slot-scope="scope">{{ scope.row.id }}</template> |
| | | </el-table-column> |
| | |
| | | <el-table-column prop="status" label="发布状态" min-width="5"> |
| | | <template slot-scope="scope"> |
| | | <span>{{ |
| | | statusList.find((item) => item.value === scope.row.status).label |
| | | }}</span> |
| | | statusList.find((item) => item.value === scope.row.status).label |
| | | }}</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="operation" label="操作" min-width="15"> |
| | | <template slot-scope="scope"> |
| | | <div class="operation"> |
| | | <el-link |
| | | class="leftPx" |
| | | icon="el-icon-delete-solid" |
| | | :underline="false" |
| | | @click="handleDelete([scope.row.id])" |
| | | >删除</el-link |
| | | class="leftPx" |
| | | icon="el-icon-delete-solid" |
| | | :underline="false" |
| | | @click="handleDelete([scope.row.id])" |
| | | >删除 |
| | | </el-link |
| | | > |
| | | <el-link |
| | | icon="el-icon-edit" |
| | | class="leftPx" |
| | | :underline="false" |
| | | @click="resend(scope.row)" |
| | | >重新发送</el-link |
| | | icon="el-icon-edit" |
| | | class="leftPx" |
| | | :underline="false" |
| | | @click="resend(scope.row)" |
| | | >重新发送 |
| | | </el-link |
| | | > |
| | | </div> |
| | | </template> |
| | |
| | | </el-table> |
| | | <!-- 新建消息 --> |
| | | <el-dialog |
| | | title="新建消息" |
| | | :destroy-on-close="true" |
| | | :key="dialogType" |
| | | :visible.sync="isShowDialog" |
| | | width="80%" |
| | | :before-close="handleConfirmClose" |
| | | title="新建消息" |
| | | :destroy-on-close="true" |
| | | :key="dialogType" |
| | | :visible.sync="isShowDialog" |
| | | width="80%" |
| | | :before-close="handleConfirmClose" |
| | | > |
| | | <MyCreate @closeMyDialog="closeDialog" :type="dialogType"></MyCreate> |
| | | </el-dialog> |
| | |
| | | <div class="funs"> |
| | | <div class="funsItem funs-sp"> |
| | | <el-checkbox v-model="all" @change="selectAll()" |
| | | >全选</el-checkbox |
| | | >全选 |
| | | </el-checkbox |
| | | > |
| | | </div> |
| | | <div class="funsItem funs-sp"> |
| | | <el-checkbox v-model="unsame" @change="disSame(tableData)" |
| | | >反选</el-checkbox |
| | | >反选 |
| | | </el-checkbox |
| | | > |
| | | </div> |
| | | <div class="funsItem"> |
| | | <el-select |
| | | v-model="myIdx" |
| | | placeholder="批量操作" |
| | | @change="selectChange" |
| | | v-model="myIdx" |
| | | placeholder="批量操作" |
| | | @change="selectChange" |
| | | > |
| | | <el-option |
| | | v-for="item in options" |
| | | :key="item.value" |
| | | :label="item.label" |
| | | :value="item.value" |
| | | v-for="item in options" |
| | | :key="item.value" |
| | | :label="item.label" |
| | | :value="item.value" |
| | | > |
| | | </el-option> |
| | | </el-select> |
| | |
| | | </div> |
| | | <div class="pagination"> |
| | | <el-pagination |
| | | background |
| | | :current-page="currentPage" |
| | | layout="prev, pager, next" |
| | | :total="totalNum" |
| | | :page-size="pageSize" |
| | | @current-change="changeCurrentPage" |
| | | background |
| | | :current-page="currentPage" |
| | | layout="prev, pager, next" |
| | | :total="totalNum" |
| | | :page-size="pageSize" |
| | | @current-change="changeCurrentPage" |
| | | > |
| | | </el-pagination> |
| | | </div> |
| | |
| | | // 删除信息 |
| | | handleDelete(ids) { |
| | | this.$confirm("确认删除?").then(() => { |
| | | deleteMessage({ ids: ids.join(",") }) |
| | | .then(() => { |
| | | this.$message({ type: "success", message: "操作成功" }); |
| | | this.getTableData(); |
| | | }) |
| | | .catch((err) => this.$message({ type: "error", message: err })); |
| | | deleteMessage({ids: ids.join(",")}) |
| | | .then(() => { |
| | | this.$message({type: "success", message: "操作成功"}); |
| | | this.getTableData(); |
| | | }) |
| | | .catch((err) => this.$message({type: "error", message: err})); |
| | | }); |
| | | }, |
| | | |
| | | getTableData() { |
| | | const respondResult = |
| | | this.messageStatus === "全部" ? null : this.messageStatus; |
| | | this.messageStatus === "全部" ? null : this.messageStatus; |
| | | getMessageList({ |
| | | channelCode: "02", |
| | | current: this.currentPage, |
| | |
| | | pageSize: this.pageSize, |
| | | head: this.context, |
| | | }) |
| | | .then(({ records, total }) => { |
| | | this.tableData = records; |
| | | this.totalNum = total; |
| | | }) |
| | | .catch((err) => { |
| | | this.$message({ type: "error", message: err }); |
| | | }); |
| | | .then(({records, total}) => { |
| | | this.tableData = records; |
| | | this.totalNum = total; |
| | | }) |
| | | .catch((err) => { |
| | | this.$message({type: "error", message: err}); |
| | | }); |
| | | }, |
| | | |
| | | resend(data) { |
| | |
| | | return; |
| | | } |
| | | sendMessage(data) |
| | | .then(() => { |
| | | this.$message.success("操作成功"); |
| | | this.getTableData(); |
| | | }) |
| | | .catch((err) => this.$message.error(`${err}`)); |
| | | .then(() => { |
| | | this.$message.success("操作成功"); |
| | | this.getTableData(); |
| | | }) |
| | | .catch((err) => this.$message.error(`${err}`)); |
| | | }, |
| | | |
| | | // 批量下拉框操作 |
| | |
| | | // 批量操作 |
| | | mulUpdateStatus(idArr, flag) { |
| | | this.$confirm( |
| | | flag === 1 |
| | | ? "您确定要进行批量启用角色吗?" |
| | | : "您确定要进行批量禁用角色吗?" |
| | | flag === 1 |
| | | ? "您确定要进行批量启用角色吗?" |
| | | : "您确定要进行批量禁用角色吗?" |
| | | ) |
| | | .then((_) => { |
| | | this.$axios({ |
| | | method: "post", |
| | | url: "sccg/role/updateStatusBatch?ids=" + idArr + "&status=" + flag, |
| | | }) |
| | | .then(() => { |
| | | this.getTableData(); |
| | | this.$message({ type: "success", message: "操作成功" }); |
| | | .then((_) => { |
| | | this.$axios({ |
| | | method: "post", |
| | | url: "sccg/role/updateStatusBatch?ids=" + idArr + "&status=" + flag, |
| | | }) |
| | | .catch((err) => { |
| | | this.$message({ type: "error", message: err }); |
| | | }); |
| | | }) |
| | | .catch((err) => {}); |
| | | .then(() => { |
| | | this.getTableData(); |
| | | this.$message({type: "success", message: "操作成功"}); |
| | | }) |
| | | .catch((err) => { |
| | | this.$message({type: "error", message: err}); |
| | | }); |
| | | }) |
| | | .catch((err) => { |
| | | }); |
| | | }, |
| | | // 表格监听 |
| | | tableChange(list) { |
| | |
| | | this.all = list.length === this.tableData.length; |
| | | }, |
| | | // 修改时间格式 |
| | | changeTime({ updateTime }) { |
| | | changeTime({updateTime}) { |
| | | return helper(updateTime); |
| | | }, |
| | | // 全选 |
| | |
| | | }); |
| | | }, |
| | | // 设置表格斑马纹 |
| | | tableRowClassName({ row, rowIndex }) { |
| | | tableRowClassName({row, rowIndex}) { |
| | | if ((rowIndex + 1) % 2 === 0) { |
| | | return "warning-row"; |
| | | } else { |
| | |
| | | min-width: 120px; |
| | | padding-left: 15px; |
| | | } |
| | | |
| | | .search, |
| | | .message-status, |
| | | .message-kind { |
| | |
| | | .find { |
| | | margin-left: 15px; |
| | | } |
| | | |
| | | .findBtn { |
| | | line-height: 100px; |
| | | margin-left: 15px; |
| | |
| | | padding: 0; |
| | | } |
| | | } |
| | | </style> |
| | | </style> |
| | |
| | | </div> |
| | | <div class="addUser"> |
| | | <el-button class="addBtn" type="primary" @click="dialogCreate = true" |
| | | >新增部门</el-button |
| | | >新增部门 |
| | | </el-button |
| | | > |
| | | <el-dialog |
| | | :visible.sync="dialogCreate" |
| | | title="新增部门信息" |
| | | width="45%" |
| | | v-if="dialogCreate" |
| | | :before-close="handleClose2" |
| | | :visible.sync="dialogCreate" |
| | | title="新增部门信息" |
| | | width="45%" |
| | | v-if="dialogCreate" |
| | | :before-close="handleClose2" |
| | | > |
| | | <createUser |
| | | :refresh="context === '' ? getUserList : search" |
| | | @changMyDialog="changMyDialog" |
| | | :refresh="context === '' ? getUserList : search" |
| | | @changMyDialog="changMyDialog" |
| | | /> |
| | | </el-dialog> |
| | | </div> |
| | |
| | | <div class="mainContent"> |
| | | <!-- 数据展示 --> |
| | | <el-table |
| | | ref="multipleTable" |
| | | :header-cell-style="{ |
| | | ref="multipleTable" |
| | | :header-cell-style="{ |
| | | background: '#06122c', |
| | | 'font-size': '12px', |
| | | color: '#4b9bb7', |
| | | 'font-weight': '650', |
| | | 'line-height': '45px', |
| | | }" |
| | | :data="tableData" |
| | | style="width: 100%" |
| | | :row-class-name="tableRowClassName" |
| | | @selection-change="tableChange" |
| | | :data="tableData" |
| | | style="width: 100%" |
| | | :row-class-name="tableRowClassName" |
| | | @selection-change="tableChange" |
| | | > |
| | | <el-table-column type="selection" min-width="5"> </el-table-column> |
| | | <el-table-column type="selection" min-width="5"></el-table-column> |
| | | <el-table-column prop="id" label="部门ID" min-width="5"> |
| | | <!-- <template slot-scope="scope">{{ scope.row.id }}</template> --> |
| | | </el-table-column> |
| | |
| | | <el-table-column prop="status" label="启用" min-width="5"> |
| | | <template slot-scope="scope"> |
| | | <el-switch |
| | | class="switchStyle" |
| | | v-model="scope.row.status" |
| | | active-color="#3fef9a" |
| | | inactive-color="#000212" |
| | | disabled |
| | | class="switchStyle" |
| | | v-model="scope.row.status" |
| | | active-color="#3fef9a" |
| | | inactive-color="#000212" |
| | | disabled |
| | | > |
| | | </el-switch> |
| | | </template> |
| | |
| | | </el-table> |
| | | <!-- 查看修改页面 --> |
| | | <el-dialog |
| | | :visible.sync="dialogUpdate" |
| | | width="45%" |
| | | :title="updateFlag ? '修改部门信息' : '查看部门信息'" |
| | | v-if="dialogUpdate" |
| | | :before-close="handleClose" |
| | | :visible.sync="dialogUpdate" |
| | | width="45%" |
| | | :title="updateFlag ? '修改部门信息' : '查看部门信息'" |
| | | v-if="dialogUpdate" |
| | | :before-close="handleClose" |
| | | > |
| | | <updateUser |
| | | :updateFlag="updateFlag" |
| | | :userInfo="userInfo" |
| | | :getDepartList="context === '' ? getUserList : search" |
| | | @changeDialog="changMyDialog" |
| | | :updateFlag="updateFlag" |
| | | :userInfo="userInfo" |
| | | :getDepartList="context === '' ? getUserList : search" |
| | | @changeDialog="changMyDialog" |
| | | /> |
| | | </el-dialog> |
| | | <!-- tools --> |
| | |
| | | <div class="funs"> |
| | | <div class="funsItem funs-sp"> |
| | | <el-checkbox v-model="all" @change="selectAll()" |
| | | >全选</el-checkbox |
| | | >全选 |
| | | </el-checkbox |
| | | > |
| | | </div> |
| | | <div class="funsItem funs-sp"> |
| | | <el-checkbox v-model="unsame" @change="disSame(tableData)" |
| | | >反选</el-checkbox |
| | | >反选 |
| | | </el-checkbox |
| | | > |
| | | </div> |
| | | <div class="funsItem"> |
| | | <el-select |
| | | v-model="myIdx" |
| | | placeholder="批量操作" |
| | | @change="selectChange" |
| | | v-model="myIdx" |
| | | placeholder="批量操作" |
| | | @change="selectChange" |
| | | > |
| | | <el-option |
| | | v-for="item in options" |
| | | :key="item.value" |
| | | :label="item.label" |
| | | :value="item.value" |
| | | :disabled="item.disabled" |
| | | v-for="item in options" |
| | | :key="item.value" |
| | | :label="item.label" |
| | | :value="item.value" |
| | | :disabled="item.disabled" |
| | | > |
| | | </el-option> |
| | | </el-select> |
| | |
| | | </div> |
| | | <div class="pagination"> |
| | | <el-pagination |
| | | background |
| | | :current-page="currentPage" |
| | | layout="prev, pager, next" |
| | | :total="totalNum" |
| | | :page-size="pageSize" |
| | | @current-change="changeCurrentPage" |
| | | @prev-click="handlePrev" |
| | | @next-click="handleNext" |
| | | background |
| | | :current-page="currentPage" |
| | | layout="prev, pager, next" |
| | | :total="totalNum" |
| | | :page-size="pageSize" |
| | | @current-change="changeCurrentPage" |
| | | @prev-click="handlePrev" |
| | | @next-click="handleNext" |
| | | > |
| | | </el-pagination> |
| | | </div> |
| | |
| | | <script> |
| | | import createUser from "./createUser"; |
| | | import updateUser from "./updateUser"; |
| | | |
| | | export default { |
| | | components: { |
| | | createUser, |
| | |
| | | selectChange(list) { |
| | | console.log(this.tempList); |
| | | if (this.tempList.length !== 0) { |
| | | if (list === 1) { |
| | | this.preMyIdx = list; |
| | | this.mulPut(this.tempList, list); |
| | | } |
| | | if (list === 2) { |
| | | this.preMyIdx = list; |
| | | this.mulPut(this.tempList); |
| | | } |
| | | if (list === 3) { |
| | | this.preMyIdx = list; |
| | | this.mulDelete(this.tempList); |
| | | this.mulDelete(this.tempList, list); |
| | | } |
| | | } else { |
| | | this.myIdx = this.preMyIdx; |
| | |
| | | }); |
| | | } |
| | | }, |
| | | mulPut(idArr, option) { |
| | | const status = option === 1 ? 1 : 0 |
| | | const tag = option === 1 ? "启用" : "禁用" |
| | | let list = JSON.parse(JSON.stringify(this.tableData)) |
| | | list = list.filter(x => idArr.indexOf(x.id) > -1) |
| | | list.forEach(x => x.status = status) |
| | | console.log(list) |
| | | this.$confirm(`您确定要批量${tag}部门吗?`) |
| | | .then((_) => { |
| | | this.$axios({ |
| | | method: "PUT", |
| | | url: "sccg/depart/batch_status", |
| | | data: list |
| | | }).then(res => { |
| | | console.log(res) |
| | | if (res.code === 200) { |
| | | this.$message({ |
| | | type: "success", |
| | | message: `批量${tag}部门成功` |
| | | }) |
| | | this.getUserList() |
| | | } else { |
| | | this.$message({ |
| | | type: "error", |
| | | message: res.message, |
| | | }) |
| | | } |
| | | }) |
| | | }) |
| | | }, |
| | | // 多条数据删除 |
| | | mulDelete(idArr) { |
| | | this.$confirm("您确定要批量删除部门吗?") |
| | | .then((_) => { |
| | | this.$axios({ |
| | | method: "post", |
| | | url: "sccg/depart/batch_deletion?ids=" + idArr, |
| | | }).then((res) => { |
| | | if (res.code === 200) { |
| | | this.$message({ |
| | | type: "success", |
| | | message: "批量删除部门成功", |
| | | }); |
| | | this.getUserList(); |
| | | } else { |
| | | this.$message({ |
| | | type: "error", |
| | | message: res.message, |
| | | }); |
| | | } |
| | | .then((_) => { |
| | | this.$axios({ |
| | | method: "post", |
| | | url: "sccg/depart/batch_deletion?ids=" + idArr, |
| | | }).then((res) => { |
| | | if (res.code === 200) { |
| | | this.$message({ |
| | | type: "success", |
| | | message: "批量删除部门成功", |
| | | }); |
| | | this.getUserList(); |
| | | } else { |
| | | this.$message({ |
| | | type: "error", |
| | | message: res.message, |
| | | }); |
| | | } |
| | | }); |
| | | }) |
| | | .catch((err) => { |
| | | console.log(err); |
| | | }); |
| | | }) |
| | | .catch((err) => { |
| | | console.log(err); |
| | | }); |
| | | }, |
| | | tableChange(list) { |
| | | this.tempList = []; |
| | |
| | | }); |
| | | }, |
| | | // 单条数据删除 |
| | | handleDelete({ id }) { |
| | | handleDelete({id}) { |
| | | this.$confirm("确认删除?") |
| | | .then((_) => { |
| | | this.$axios({ |
| | | method: "post", |
| | | url: "sccg/depart/delete", |
| | | data: { |
| | | id, |
| | | }, |
| | | }).then((res) => { |
| | | this.$message({ |
| | | type: res.code === 404 ? "warning" : "success", |
| | | message: res.message, |
| | | }); |
| | | .then((_) => { |
| | | this.$axios({ |
| | | method: "post", |
| | | url: "sccg/depart/delete", |
| | | data: { |
| | | id, |
| | | }, |
| | | }).then((res) => { |
| | | this.$message({ |
| | | type: res.code === 404 ? "warning" : "success", |
| | | message: res.message, |
| | | }); |
| | | |
| | | this.getUserList(); |
| | | this.getUserList(); |
| | | }); |
| | | }) |
| | | .catch((_) => { |
| | | }); |
| | | }) |
| | | .catch((_) => {}); |
| | | }, |
| | | // 修改状态 |
| | | handleChangeStatus(obj) { |
| | | let { id, status } = obj; |
| | | let {id, status} = obj; |
| | | status == true ? (status = 1) : (status = 0); |
| | | this.$axios |
| | | .post(`sccg/depart/status`, { id: id, status: status }) |
| | | .then((res) => { |
| | | if (res.code == 200) { |
| | | this.getUserList(); |
| | | } |
| | | }); |
| | | .post(`sccg/depart/status`, {id: id, status: status}) |
| | | .then((res) => { |
| | | if (res.code == 200) { |
| | | this.getUserList(); |
| | | } |
| | | }); |
| | | }, |
| | | // 获取用户列表 |
| | | getUserList() { |
| | |
| | | this.dialogCreate = false; |
| | | // 获取所有用户信息 |
| | | this.$axios |
| | | .get("sccg/depart/page", { |
| | | params: { |
| | | currentPage: this.currentPage, |
| | | pageSize: this.pageSize, |
| | | departName: this.context, |
| | | }, |
| | | }) |
| | | .then((res) => { |
| | | if (res.code === 200) { |
| | | res.data.records.forEach((item) => { |
| | | item.status == 0 ? (item.status = false) : (item.status = true); |
| | | }); |
| | | that.totalNum = res.data.total; |
| | | that.tableData = res.data.records; |
| | | } |
| | | }); |
| | | .get("sccg/depart/page", { |
| | | params: { |
| | | currentPage: this.currentPage, |
| | | pageSize: this.pageSize, |
| | | departName: this.context, |
| | | }, |
| | | }) |
| | | .then((res) => { |
| | | if (res.code === 200) { |
| | | res.data.records.forEach((item) => { |
| | | item.status == 0 ? (item.status = false) : (item.status = true); |
| | | }); |
| | | that.totalNum = res.data.total; |
| | | that.tableData = res.data.records; |
| | | } |
| | | }); |
| | | }, |
| | | search() { |
| | | const that = this; |
| | | this.dialogCreate = false; |
| | | // 获取所有用户信息 |
| | | this.$axios |
| | | .get("sccg/depart/page", { |
| | | params: { |
| | | currentPage: this.currentPage, |
| | | pageSize: this.pageSize, |
| | | departName: this.context, |
| | | }, |
| | | }) |
| | | .then((res) => { |
| | | if (res.code === 200) { |
| | | res.data.records.forEach((item) => { |
| | | item.status == 1 ? (item.status = true) : (item.status = false); |
| | | }); |
| | | that.totalNum = res.data.total; |
| | | that.tableData = res.data.records; |
| | | } |
| | | }); |
| | | .get("sccg/depart/page", { |
| | | params: { |
| | | currentPage: this.currentPage, |
| | | pageSize: this.pageSize, |
| | | departName: this.context, |
| | | }, |
| | | }) |
| | | .then((res) => { |
| | | if (res.code === 200) { |
| | | res.data.records.forEach((item) => { |
| | | item.status == 1 ? (item.status = true) : (item.status = false); |
| | | }); |
| | | that.totalNum = res.data.total; |
| | | that.tableData = res.data.records; |
| | | } |
| | | }); |
| | | }, |
| | | // 设置表格斑马纹 |
| | | tableRowClassName({ row, rowIndex }) { |
| | | tableRowClassName({row, rowIndex}) { |
| | | if ((rowIndex + 1) % 2 == 0) { |
| | | return "warning-row"; |
| | | } else { |
| | |
| | | this.search(); |
| | | }, |
| | | // 关闭dialog |
| | | changMyDialog({ flag }) { |
| | | changMyDialog({flag}) { |
| | | this.dialogUpdate = flag; |
| | | this.dialogCreate = flag; |
| | | }, |
| | | handleClose(done) { |
| | | if (this.updateFlag) { |
| | | this.$confirm("确认关闭?") |
| | | .then((_) => { |
| | | this.dialogUpdate = false; |
| | | this.dialogCreate = false; |
| | | done(); |
| | | }) |
| | | .catch((_) => {}); |
| | | .then((_) => { |
| | | this.dialogUpdate = false; |
| | | this.dialogCreate = false; |
| | | done(); |
| | | }) |
| | | .catch((_) => { |
| | | }); |
| | | } else { |
| | | done(); |
| | | } |
| | | }, |
| | | handleClose2(done) { |
| | | this.$confirm("确认关闭?") |
| | | .then((_) => { |
| | | done(); |
| | | }) |
| | | .catch((_) => {}); |
| | | .then((_) => { |
| | | done(); |
| | | }) |
| | | .catch((_) => { |
| | | }); |
| | | }, |
| | | }, |
| | | }; |
| | |
| | | |
| | | header { |
| | | background-color: #09152f; |
| | | border: 1pox solid #fff; |
| | | border: 1 pox solid #fff; |
| | | |
| | | .headerContent { |
| | | padding: 0 40px; |
| | |
| | | background-color: #09152f; |
| | | margin-top: 20px; |
| | | padding-bottom: 50px; |
| | | border: 1pox solid #fff; |
| | | border: 1 pox solid #fff; |
| | | |
| | | .mainTitle { |
| | | line-height: 60px; |
| | |
| | | justify-content: space-between; |
| | | align-items: center; |
| | | padding: 0 20px; |
| | | |
| | | .funs-sp { |
| | | border: 1px solid #17324c; |
| | | } |
| | | |
| | | .funs { |
| | | display: flex; |
| | | |
| | |
| | | .el-table { |
| | | color: #4b9bb7; |
| | | font-size: 10px; |
| | | |
| | | .operation { |
| | | display: flex; |
| | | |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | // &::v-deep .switchStyle .el-switch__label { |
| | | // position: absolute; |
| | | // display: none; |
| | |
| | | // } |
| | | } |
| | | } |
| | | </style> |
| | | </style> |
| | |
| | | if (!value) { |
| | | callback(new Error("用户密码不能为空")); |
| | | } else { |
| | | const rep = /^\w+$/; |
| | | if (!rep.test(value)) { |
| | | callback(new Error("密码只能是以数字、26个英文字母或者下划线组成的字符串")); |
| | | } else { |
| | | callback(); |
| | | if (value.length < 6 || value.length > 16){ |
| | | callback(new Error("用户密码长度不合法")); |
| | | }else { |
| | | const rep = /^\w+$/; |
| | | if (!rep.test(value)) { |
| | | callback(new Error("密码只能是以数字、26个英文字母或者下划线组成的字符串")); |
| | | } else { |
| | | callback(); |
| | | } |
| | | } |
| | | } |
| | | }; |
| | |
| | | } |
| | | } |
| | | } |
| | | </style> |
| | | </style> |