New file |
| | |
| | | import http from "@/http"; |
| | | |
| | | export function deleteMessage(params) { |
| | | return http.post('/sccg/message/delete', params); |
| | | } |
| | | |
| | | export function getMessageById(id) { |
| | | return http.get('/sccg/message/getMessage/' + id); |
| | | } |
| | | |
| | | export function getMessageList(params) { |
| | | return http.post('/sccg/message/list', params); |
| | | } |
| | | |
| | | export function sendMessage(params) { |
| | | return http.post('/sccg/message/sendMessage', params); |
| | | } |
| | | |
| | | export function updateMessage(id, params) { |
| | | return http.post('/sccg/message/update/' + id, params); |
| | | } |
New file |
| | |
| | | import http from "@/http"; |
| | | |
| | | export function addStoreInfo(params) { |
| | | return http.post('/sccg/store/storeinfo/add', params); |
| | | } |
| | | |
| | | export function importStoreInfo(params) { |
| | | return http.post('/sccg/store/storeinfo/add/excel', params); |
| | | } |
| | | |
| | | export function deleteStoreInfo(id) { |
| | | return http.get('/sccg/store/storeinfo/delete/' + id) |
| | | } |
| | | |
| | | export function getStoreInfoList(params) { |
| | | return http.get('/sccg/store/storeinfo/list', params); |
| | | } |
| | | |
| | | export function updateStoreInfo(params) { |
| | | return http.put('/sccg/store/storeinfo/update', params); |
| | | } |
| | | |
| | | export function getStoreInfoById(id) { |
| | | return http.get('/sccg/store/storeinfo/' + id); |
| | | } |
| | |
| | | import { getToken } from "@/utils/helper"; |
| | | import request from "@/utils/request"; |
| | | |
| | | const TEAM_CONSTRUCTION_URL = '/sccg/team_construction'; |
| | | const TOKEN = { |
| | | 'Authorization': getToken() |
| | | } |
| | | import http from "@/http"; |
| | | |
| | | export function addTeam(params) { |
| | | return request({ |
| | | method: 'post', |
| | | url: TEAM_CONSTRUCTION_URL + '/addition', |
| | | headers: { ...TOKEN }, |
| | | params |
| | | }); |
| | | return http.post('/sccg/team_construction/addition', params); |
| | | } |
| | | |
| | | export function deleteTeam(params) { |
| | | return request({ |
| | | method: 'delete', |
| | | url: TEAM_CONSTRUCTION_URL + '/deletion', |
| | | headers: { ...TOKEN }, |
| | | params |
| | | }); |
| | | return http.delete('/sccg/team_construction/deletion', params); |
| | | } |
| | | |
| | | export function exportTeamInfo(params) { |
| | | return request({ |
| | | method: 'post', |
| | | url: TEAM_CONSTRUCTION_URL + '/export', |
| | | headers: { ...TOKEN }, |
| | | params, |
| | | responseType: 'blob' |
| | | }); |
| | | return http.post('/sccg/team_construction/export', {}, params); |
| | | } |
| | | |
| | | export function importTeamInfo(data) { |
| | | return request({ |
| | | method: 'post', |
| | | url: TEAM_CONSTRUCTION_URL + '/import', |
| | | headers: { ...TOKEN, 'Content-Type': 'multipart/form-data' }, |
| | | data: data, |
| | | }); |
| | | return http.post('/sccg/team_construction/import', data); |
| | | } |
| | | |
| | | export function updateTeamInfo(params) { |
| | | return request({ |
| | | method: 'put', |
| | | url: TEAM_CONSTRUCTION_URL + '/modification', |
| | | headers: { ...TOKEN }, |
| | | params |
| | | }); |
| | | return http.put('/sccg/team_construction/modification', params); |
| | | } |
| | | |
| | | export function searchTeamInfo(params) { |
| | | return request({ |
| | | method: 'get', |
| | | url: TEAM_CONSTRUCTION_URL + '/query', |
| | | headers: { ...TOKEN }, |
| | | params |
| | | }); |
| | | return http.get('/sccg/team_construction/query', params); |
| | | } |
| | |
| | | } from './interceptor-handler' |
| | | import { |
| | | showFullScreenLoading |
| | | } from '../utils/loading' |
| | | // import { getStorage } from '@utils/storage' |
| | | } from '@/utils/loading' |
| | | |
| | | // URL 记录器 |
| | | import urlRecorder from './url-recorder' |
| | | |
| | | const axiosInstance = axios.create({ |
| | | // baseURL: `${process.env.VUE_APP_API_BASE_URL}`, |
| | | timeout: 1000 * 60 * 5 |
| | | }) |
| | | |
| | |
| | | url: addVersion(url), |
| | | params, |
| | | errorHandler: (!throwError && this.defaultErrorHandler) || null, |
| | | // headers: { 'Content-Type': 'application/json', token: thisToken }, |
| | | headers: { |
| | | 'Content-Type': 'application/json' |
| | | }, |
| | |
| | | * 通过post发送数据,使后端直接收到json格式的数据。并统一处理常见的错误 |
| | | * @param {string} url |
| | | * @param {object?} data={} |
| | | * @param {object} params={} |
| | | * @param {boolean?} throwError 是否不使用默认的异常处理方法,而把异常抛出来 |
| | | * @param {int?} timeout 超时时间,默认10秒 |
| | | * @return {Promise} 返回一个promise对象。其中then方法传递回包中的data数据;catch事件则传递整个回包,其参数为{data:{},status{code:123,message:'xxx'}} |
| | | */ |
| | | post(url, data = {}, throwError) { |
| | | post(url, data = {}, params = {}, throwError) { |
| | | const config = { |
| | | method: 'POST', |
| | | url, |
| | | params, |
| | | data: JSON.stringify(data), |
| | | errorHandler: (!throwError && this.defaultErrorHandler) || null, |
| | | headers: { |
| | |
| | | export function handleResponseSuccess(response) { |
| | | tryHideFullScreenLoading() |
| | | urlRecorder.remove(response.config) |
| | | const result = response.data |
| | | let result = response.data |
| | | |
| | | // return result.content |
| | | if (response.headers['content-disposition']) { |
| | | result = { |
| | | contentDisposition: response.headers['content-disposition'], |
| | | data: response.data |
| | | } |
| | | } |
| | | |
| | | if (result.code === 200) { |
| | | return result.data || result.content |
| | | } else if (result.code && result.code !== 0) { |
| | |
| | | */ |
| | | export function handleError(requestConfig, result) { |
| | | // 必须是Error对象,否则throw时vuex要报warning |
| | | // let err |
| | | // if (result instanceof Error) { |
| | | // err = result |
| | | // } else { |
| | | // err = new Error(result.msg) |
| | | // err.content = result.content |
| | | // err.code = result.code |
| | | // err.msg = result.msg |
| | | // } |
| | | if (requestConfig && requestConfig.errorHandler) { |
| | | result.url = requestConfig.url |
| | | requestConfig.errorHandler(result) |
| | |
| | | <div class="search"> |
| | | <span>来源查询:</span> |
| | | <div class="option"> |
| | | <el-select v-model="mystatus" placeholder="违规" @change="setMystatus"> |
| | | <el-select v-model="mystatus" placeholder="违规" @change="setMyStatus"> |
| | | <el-option v-for="item in typeList" :key="item.label" :label="item.name" |
| | | :value="item.value"> |
| | | </el-option> |
| | |
| | | <el-table-column :prop="mystatus === 1 ? 'type' :'site'" :label="mystatus===1 ? '小类名称' : '违建地点'" |
| | | min-width="10"> |
| | | </el-table-column> |
| | | <!-- <el-table-column :prop="mystatus === 1 ? 'actionCause' :'communityId'" |
| | | :label="mystatus===1 ? '案由' : '所属社区'" min-width="10"> |
| | | </el-table-column> --> |
| | | <el-table-column :prop="mystatus === 1 ? 'site' :''" :label="mystatus===1 ? '报警点位' : '违法建筑长、宽、高'" |
| | | :min-width="mystatus===1?'10' :'20' "> |
| | | <template slot-scope="scope"> |
| | |
| | | <!-- 详情页展示 --> |
| | | <el-dialog :visible.sync="dialogView" width="80%" title="基础信息(人工)" v-if="dialogView" |
| | | :before-close="handleClose"> |
| | | <MyDetail :info=info v-if="mystatus==1 ? true:false"></MyDetail> |
| | | <MyDetail :info=info v-if="mystatus === 1"></MyDetail> |
| | | <MyIllDetail :info=info v-else></MyIllDetail> |
| | | </el-dialog> |
| | | <!-- 调度 --> |
| | |
| | | <div class="funs"> |
| | | <div class="funsItem funs-sp"> |
| | | <el-checkbox v-model="all" @change="selectAll()" |
| | | :disabled="tableData.length !== 0 ? false : true">全选</el-checkbox> |
| | | :disabled="tableData.length === 0">全选</el-checkbox> |
| | | </div> |
| | | <div class="funsItem funs-sp"> |
| | | <el-checkbox v-model="unsame" @change="disSame(tableData)">反选</el-checkbox> |
| | |
| | | </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"> |
| | | :total="totalNum" :page-size="pageSize" @current-change="changeCurrentPage"> |
| | | </el-pagination> |
| | | </div> |
| | | </div> |
| | |
| | | }, |
| | | data() { |
| | | return { |
| | | tableData: [ |
| | | // { |
| | | // code:1, |
| | | // eventSource:1, |
| | | // category:1, |
| | | // type:1, |
| | | // actionCause:'案由1111', |
| | | // site:'你好', |
| | | // streetId:1, |
| | | // alarmTime:'2022-21-20', |
| | | // continueTime:'8小时', |
| | | // } |
| | | ], |
| | | tableData: [], |
| | | dialogCreate: false, |
| | | dialogView: false, |
| | | dialogNewAdd: false, |
| | |
| | | this.dialogDispatch = true; |
| | | }, |
| | | // 顶部下拉框 |
| | | setMystatus(value) { |
| | | console.log(value); |
| | | setMyStatus(value) { |
| | | this.statusArr[1] = value; |
| | | this.changeTypeChecked(value - 1); |
| | | this.getUserList(); |
| | | }, |
| | | // 选择违规违建 |
| | | setDialog({ flag, type }) { |
| | |
| | | }, |
| | | // 批量删除 |
| | | mulDelete(idArr) { |
| | | console.log(idArr instanceof Array); |
| | | const { statusArr } = this; |
| | | this.$confirm('您确定要批量删除案件吗?') |
| | | .then(_ => { |
| | |
| | | }, |
| | | // 执行下拉框操作 |
| | | selectChange(list) { |
| | | console.log(this.tempList); |
| | | if (this.tempList.length !== 0) { |
| | | if (list === 3) { |
| | | this.preMyIdx = list; |
| | |
| | | list.forEach(item => { |
| | | this.tempList.push(item.id); |
| | | }) |
| | | if (list.length === this.tableData.length) { |
| | | this.all = true; |
| | | } else { |
| | | this.all = false |
| | | } |
| | | this.all = list.length === this.tableData.length; |
| | | }, |
| | | // 全选 |
| | | selectAll() { |
| | |
| | | // 获取用户列表 |
| | | getUserList() { |
| | | const { currentPage, pageSize, statusArr } = this; |
| | | console.log(statusArr); |
| | | this.$axios({ |
| | | method: 'get', |
| | | url: `sccg/base_case/query?state=${statusArr[0]}¤t=${currentPage}&size=${pageSize}&resource=2&type=${statusArr[1]}` |
| | | }).then(res => { |
| | | this.totalNum = res.data.total; |
| | | this.tableData = res.data.records; |
| | | console.log(res); |
| | | }) |
| | | .catch(err => { |
| | | console.log(err) |
| | | this.tableData = []; |
| | | }) |
| | | }, |
| | | // 设置表格斑马纹 |
| | | tableRowClassName({ row, rowIndex }) { |
| | | if ((rowIndex + 1) % 2 == 0) { |
| | | if ((rowIndex + 1) % 2 === 0) { |
| | | return 'warning-row'; |
| | | } else { |
| | | return 'success-row'; |
| | | } |
| | | return ''; |
| | | }, |
| | | // 查看用户信息(不可修改) |
| | | handleFind(rowData) { |
| | | // this.dialogView = true; |
| | | // this.userInfo = rowData; |
| | | }, |
| | | // 当前页改变触发事件 |
| | | changeCurrentPage(page) { |
| | | this.currentPage = page; |
| | | this.getUserList(); |
| | | }, |
| | | // 上一页点击事件 |
| | | handlePrev(page) { |
| | | this.currentPage = page; |
| | | this.getUserList(); |
| | | }, |
| | | // 下一页点击事件 |
| | | handleNext(page) { |
| | | this.currentPage = page; |
| | | this.getUserList(); |
| | | }, |
| | | |
| | | changeDialog({ flag }) { |
| | | this.dialogNewAdd = flag; |
| | | this.dialogCreate = flag; |
| | | this.dialogView = flag; |
| | | this.dialogDispatch = flag; |
| | | // this.getUserList(); |
| | | }, |
| | | handleClose(done) { |
| | | this.$confirm('确认关闭?') |
| | |
| | | // 更改一级标签的选中 |
| | | changeNavChecked(idx) { |
| | | this.tagList.forEach((item, index) => { |
| | | if (index === idx) { |
| | | item.checked = true; |
| | | } else { |
| | | item.checked = false; |
| | | } |
| | | item.checked = index === idx; |
| | | }) |
| | | this.mystatus = 1 |
| | | this.typeList[0].checked = true; |
| | |
| | | // 更改违规/违建 |
| | | changeTypeChecked(idx) { |
| | | this.typeList.forEach((item, index) => { |
| | | if (index === idx) { |
| | | item.checked = true; |
| | | } else { |
| | | item.checked = false; |
| | | } |
| | | item.checked = index === idx; |
| | | }) |
| | | this.mystatus = idx + 1; |
| | | this.statusArr[1] = this.typeList[idx].value; |
| | |
| | | }, |
| | | // 获取案件信息 |
| | | getEventInfo(code) { |
| | | console.log('获取具体案件信息', code); |
| | | this.$axios({ |
| | | method: 'get', |
| | | url: `sccg/base_case/baseCaseDetail/${code}` |
| | | }) |
| | | .then(res => { |
| | | console.log(res); |
| | | this.info = res.data; |
| | | this.dialogView = true; |
| | | }) |
| | | }, |
| | | // 在学习 |
| | | handleLearn({ id }) { |
| | | console.log(id); |
| | | this.$axios({ |
| | | method: 'put', |
| | | url: 'sccg/base_case/case_status_update?caseId=' + id + '&state=' + 3 |
| | | }) |
| | | .then(res => { |
| | | console.log(res); |
| | | if (res.code === 200) { |
| | | this.$notify({ |
| | | title: '温馨提示', |
| | |
| | | type: 'success', |
| | | position: 'bottom-right' |
| | | }) |
| | | // this.$message({ |
| | | // type:'success', |
| | | // message:'操作成功', |
| | | // }) |
| | | this.getUserList(); |
| | | } else { |
| | | this.$message({ |
| | |
| | | }, |
| | | // 暂不处理 |
| | | handleNotDeal({ id }) { |
| | | console.log(id); |
| | | this.$axios({ |
| | | method: 'put', |
| | | url: 'sccg/base_case/case_status_update?caseId=' + id + '&state=' + 4 |
| | | }) |
| | | .then(res => { |
| | | console.log(res); |
| | | if (res.code === 200) { |
| | | this.$notify({ |
| | | title: '温馨提示', |
| | |
| | | type: 'success', |
| | | position: 'bottom-right' |
| | | }) |
| | | // this.$message({ |
| | | // type:'success', |
| | | // message:'操作成功', |
| | | // }) |
| | | this.getUserList(); |
| | | } else { |
| | | this.$message({ |
| | |
| | | |
| | | header { |
| | | background-color: #09152f; |
| | | border: 1pox solid #fff; |
| | | |
| | | .headerContent { |
| | | padding: 0 40px; |
| | |
| | | main { |
| | | background-color: #09152f; |
| | | margin-top: 20px; |
| | | padding-bottom: 50px; |
| | | border: 1pox solid #fff; |
| | | |
| | | .mainTitle { |
| | | line-height: 60px; |
| | |
| | | background-color: #09152f; |
| | | margin-top: 20px; |
| | | padding-bottom: 50px; |
| | | border: 1pox solid #fff; |
| | | |
| | | .mainTitle { |
| | | line-height: 60px; |
| | |
| | | } |
| | | |
| | | .el-button { |
| | | // background-color: #fff; |
| | | border: none; |
| | | } |
| | | |
| | |
| | | <el-form-item class="optionItem" label="店铺描述:" prop="description"> |
| | | <el-input type="textarea" :autosize="{ minRows: 2, maxRows: 4 }" maxlength="300" show-word-limit |
| | | v-model="store.description" placeholder="输入店铺描述"></el-input> |
| | | <!-- <el-input type="textarea" v-model="user.storedesc" placeholder="输入部门描述"></el-input> --> |
| | | </el-form-item> |
| | | <!-- 联系方式 --> |
| | | <el-form-item class="optionItem" label="联系方式:" prop="contact"> |
| | |
| | | }, |
| | | created() { |
| | | const { userInfo } = this; |
| | | // console.log(userInfo) |
| | | this.store = userInfo |
| | | this.getShopTypeList(); |
| | | // console.log(this.store) |
| | | }, |
| | | methods: { |
| | | // 获取字典 |
| | |
| | | <div class="aside"> |
| | | <div class="title">组织机构</div> |
| | | <div class="input"> |
| | | <el-input placeholder="输入组织机构名称"></el-input> |
| | | <el-input placeholder="输入组织机构名称" v-model="searchArea"></el-input> |
| | | </div> |
| | | <div class="menu"> |
| | | <el-tree :data="data" :props="defaultProps" @node-click="handleNodeClick"></el-tree> |
| | | <el-tree :data="areaData" :props="defaultProps" @node-click="handleNodeClick"></el-tree> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | <script> |
| | | |
| | | export default { |
| | | data() { |
| | | return { |
| | | data: [{ |
| | | label: '妙高街道', |
| | | children: [{ |
| | | label: '东街', |
| | | children: [{ |
| | | label: '螺蛳垵' |
| | | }] |
| | | }] |
| | | }, { |
| | | label: '云峰街道', |
| | | children: [{ |
| | | label: '东亭', |
| | | children: [{ |
| | | label: '隔溪' |
| | | }] |
| | | }, { |
| | | label: '马头', |
| | | children: [{ |
| | | label: '龙口' |
| | | }] |
| | | }] |
| | | }, { |
| | | label: '新路湾镇', |
| | | children: [{ |
| | | label: '新路湾镇', |
| | | children: [{ |
| | | label: '新路湾镇' |
| | | }] |
| | | }, { |
| | | label: '新路湾镇', |
| | | children: [{ |
| | | label: '新路湾镇' |
| | | }] |
| | | }] |
| | | }], |
| | | searchArea: null, |
| | | areaData: [], |
| | | defaultProps: { |
| | | children: 'children', |
| | | label: 'label' |
| | | } |
| | | }; |
| | | }, |
| | | |
| | | created() { |
| | | }, |
| | | |
| | | methods: { |
| | | handleNodeClick(data) { |
| | | console.log(data); |
| | | } |
| | | } |
| | | }; |
| | |
| | | <div class="updateUser"> |
| | | <main> |
| | | <div class="mainContent"> |
| | | <el-form ref="user" label-width="140px" autoComplete="on" :model="user" :rules="createUserRules" |
| | | <el-form ref="store" label-width="140px" autoComplete="on" :model="store" :rules="rules" |
| | | label-position="right"> |
| | | <!-- 店铺编号 --> |
| | | <el-form-item class="optionItem" label="店铺编号:" prop="storeNumber"> |
| | | <el-input v-model="user.storeNumber" placeholder="请填写店铺编号" :disabled="!updateFlag"></el-input> |
| | | <el-input v-model="store.storeNumber" placeholder="请填写店铺编号" :disabled="!updateFlag"></el-input> |
| | | </el-form-item> |
| | | <!-- 店铺名称 --> |
| | | <el-form-item class="optionItem" label="店铺名称:" prop="storeName"> |
| | | <el-input v-model="user.storeName" placeholder="请填写店名称" :disabled="!updateFlag"></el-input> |
| | | <el-input v-model="store.storeName" placeholder="请填写店名称" :disabled="!updateFlag"></el-input> |
| | | </el-form-item> |
| | | <!-- 店铺联系人 --> |
| | | <el-form-item class="optionItem" label="店铺联系人:" prop="storeOwner"> |
| | | <el-input v-model="user.storeOwner" placeholder="请填写店铺联系人" :disabled="!updateFlag"></el-input> |
| | | <el-form-item class="optionItem" label="店铺联系人:" prop="owner"> |
| | | <el-input v-model="store.owner" placeholder="请填写店铺联系人" :disabled="!updateFlag"></el-input> |
| | | </el-form-item> |
| | | <!-- 店铺联系电话 --> |
| | | <el-form-item class="optionItem" label="店铺联系电话:" prop="storePhone"> |
| | | <el-input v-model="user.storePhone" placeholder="请填写店铺联系电话" :disabled="!updateFlag"></el-input> |
| | | <el-form-item class="optionItem" label="店铺联系电话:" prop="contact"> |
| | | <el-input v-model="store.contact" placeholder="请填写店铺联系电话" :disabled="!updateFlag"></el-input> |
| | | </el-form-item> |
| | | <!-- 店铺详细地址 --> |
| | | <el-form-item class="optionItem" label="店铺详细地址:" prop="storeAddress"> |
| | | <el-input v-model="user.storeAddress" placeholder="请填写店铺详细地址" :disabled="!updateFlag"></el-input> |
| | | <el-input v-model="store.storeAddress" placeholder="请填写店铺详细地址" :disabled="!updateFlag"></el-input> |
| | | </el-form-item> |
| | | <!-- 关联摄像机 --> |
| | | <el-form-item class="optionItem" label="关联摄像机:" prop="storeMoni"> |
| | | <el-input v-model="user.storeMoni" placeholder="请填写关联摄像机" :disabled="!updateFlag"></el-input> |
| | | <el-form-item class="optionItem" label="关联摄像机:" prop="relationVideo"> |
| | | <el-input v-model="store.relationVideo" placeholder="请填写关联摄像机" :disabled="!updateFlag"></el-input> |
| | | </el-form-item> |
| | | <el-form-item v-if="updateFlag"> |
| | | <div class="optionBtn"> |
| | | <el-button type="primary" class="btn submit" @click.native.prevent="handleUser">提交 |
| | | </el-button> |
| | | <el-button type="primary" class="btn submit" @click.native.prevent="onSubmit">提交</el-button> |
| | | </div> |
| | | </el-form-item> |
| | | </el-form> |
| | | |
| | | </div> |
| | | </main> |
| | | </div> |
| | | </template> |
| | | <script> |
| | | import { deepClone } from "@/utils/helper"; |
| | | import { updateStoreInfo } from "@/api/operate/storeManagement"; |
| | | import { SUCCESS_CODE } from "@/utils"; |
| | | |
| | | export default { |
| | | data() { |
| | | const validateNumber = (rule,value,callback)=>{ |
| | | if(value){ |
| | | callback() |
| | | }else{ |
| | | callback(new Error('店铺编号不能为空')) |
| | | } |
| | | } |
| | | const validateName = (rule,value,callback)=>{ |
| | | if(value){ |
| | | callback() |
| | | }else{ |
| | | callback(new Error('店铺名称不能为空')) |
| | | } |
| | | } |
| | | const validateOwner = (rule,value,callback)=>{ |
| | | if(value){ |
| | | callback() |
| | | }else{ |
| | | callback(new Error('店铺联系人不能为空')) |
| | | } |
| | | } |
| | | const validatePhone = (rule,value,callback)=>{ |
| | | if(value){ |
| | | callback() |
| | | }else{ |
| | | callback(new Error('店铺联系电话不能为空')) |
| | | } |
| | | } |
| | | const validateAddress = (rule,value,callback)=>{ |
| | | if(value){ |
| | | callback() |
| | | }else{ |
| | | callback(new Error('店铺详细地址不能为空')) |
| | | } |
| | | } |
| | | const validateMoni = (rule,value,callback)=>{ |
| | | if(value){ |
| | | callback() |
| | | }else{ |
| | | callback(new Error('店铺关联摄像机不能为空')) |
| | | } |
| | | } |
| | | return { |
| | | user: { |
| | | store: { |
| | | storeNumber: '', |
| | | storeName: '', |
| | | storeOwner: '', |
| | | storePhone: '', |
| | | owner: '', |
| | | contact: '', |
| | | storeAddress: '', |
| | | storeMoni: '' |
| | | relationVideo: '' |
| | | }, |
| | | createUserRules: { |
| | | storeNumber: [ |
| | | {trigger:'blur',validator:validateNumber} |
| | | ], |
| | | storeName: [ |
| | | {trigger:'blur',validator:validateName} |
| | | ], |
| | | storeOwner: [ |
| | | {trigger:'blur',validator:validateOwner} |
| | | ], |
| | | storePhone: [ |
| | | {trigger:'blur',validator:validatePhone} |
| | | ], |
| | | storeAddress: [ |
| | | {trigger:'blur',validator:validateAddress} |
| | | ], |
| | | storeMoni: [ |
| | | {trigger:'blur',validator:validateMoni} |
| | | ] |
| | | rules: { |
| | | storeNumber: [{ required: true, trigger:'blur', message: '请输入店铺编号' }], |
| | | storeName: [{ required: true, trigger:'blur', message: '请输入店铺名称' }], |
| | | owner: [{ required: true, trigger:'blur', message: '请输入店铺联系人' }], |
| | | contact: [{ required: true, trigger:'blur', message: '请输入店铺联系电话:' }], |
| | | storeAddress: [{ required: true, trigger:'blur', message: '请输入店铺详细地址' }], |
| | | relationVideo: [{ required: false, trigger:'blur', message: '请输入关联摄像机' }] |
| | | }, |
| | | } |
| | | }, |
| | | created() { |
| | | const that = this; |
| | | this.user = JSON.parse(JSON.stringify(that.userInfo)); |
| | | this.store = deepClone(this.storeInfo); |
| | | }, |
| | | |
| | | methods: { |
| | | handleUser() { |
| | | this.$emit('handleUpdateData',this.user) |
| | | onSubmit() { |
| | | this.$refs.store.validate(valid => { |
| | | if (valid) { |
| | | updateStoreInfo(this.store) |
| | | .then(() => { |
| | | this.$message({ type: 'success', message: '操作成功' }); |
| | | this.$emit('closeDialog'); |
| | | }) |
| | | .catch(err => this.$message({ type: 'error', message: err })); |
| | | } else { |
| | | this.$message({ type: 'warning', message: '请检查必填项' }); |
| | | } |
| | | }); |
| | | } |
| | | }, |
| | | props: ['userInfo', 'updateFlag','handleUpdateData'] |
| | | props: ['storeInfo', 'updateFlag'] |
| | | } |
| | | </script> |
| | | <style lang="scss" scoped> |
| | |
| | | <div class="userList"> |
| | | <myAside /> |
| | | <div class="right"> |
| | | <myHeader @setDialog="changeDialog" @getSearch="getSearch"></myHeader> |
| | | <myMain :refresh="isFresh" :keyword="keyword" @resetFresh="resetFresh" /> |
| | | <header> |
| | | <div class="headerContent"> |
| | | <div class="find"> |
| | | <div class="search-item"> |
| | | <span>输入查询:</span> |
| | | <el-input style="flex: 1" placeholder="请输入店铺编号" v-model="storeCode" slot="prefix"></el-input> |
| | | </div> |
| | | <div class="search-item"> |
| | | <span>店铺状态:</span> |
| | | <el-select v-model="storeStatus" placeholder="选择店铺状态"> |
| | | <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value" /> |
| | | </el-select> |
| | | </div> |
| | | <div class="findBtn"> |
| | | <el-button type="primary" @click="search" icon="el-icon-search">查询</el-button> |
| | | <el-button icon="el-icon-delete-solid" @click="handleReset">重置</el-button> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </header> |
| | | <main> |
| | | <!-- 数据展示 --> |
| | | <el-table 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"> |
| | | <el-table-column type="selection" min-width="5"> |
| | | </el-table-column> |
| | | <el-table-column prop="storeNumber" label="店铺编号" min-width="10"> |
| | | </el-table-column> |
| | | <el-table-column prop="storeName" label="店铺名称" min-width="10"> |
| | | </el-table-column> |
| | | <el-table-column prop="owner" label="店铺联系人" min-width="10"> |
| | | </el-table-column> |
| | | <el-table-column prop="contact" label="店铺联系电话" min-width="10"> |
| | | </el-table-column> |
| | | <el-table-column prop="storeAddress" label="店铺详细地址" min-width="10"> |
| | | </el-table-column> |
| | | <el-table-column prop="relationVideo" label="关联摄像机" min-width="10"> |
| | | </el-table-column> |
| | | <el-table-column prop="operation" label="操作" min-width="20"> |
| | | <template slot-scope="scope"> |
| | | <div class="operation"> |
| | | <el-link icon="el-icon-edit" :underline="false" @click="handleView(scope.row, 'update')">编辑</el-link> |
| | | <el-link class="leftPx" icon="el-icon-delete-solid" :underline="false" @click="handleDelete(scope.row.id)">删除</el-link> |
| | | <el-link class="leftPx" icon="el-icon-edit" :underline="false">推送信息</el-link> |
| | | <el-link class="leftPx" icon="el-icon-edit" :underline="false" @click="handleView(scope.row, 'view')">查看</el-link> |
| | | </div> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <!-- 查看修改页面 --> |
| | | <el-dialog :visible.sync="dialogUpdate" width="45%" |
| | | :title="updateFlag ? '修改店铺信息' : '查看店铺信息'" :before-close="handleClose"> |
| | | <updateUser :updateFlag="updateFlag" :storeInfo="storeInfo" @closeDialog="closeDialog" /> |
| | | </el-dialog> |
| | | <!-- 分页 --> |
| | | <div class="pagination"> |
| | | <el-pagination background :current-page="currentPage" layout="prev, pager, next" :total="totalNum" |
| | | :page-size="pageSize" @current-change="changeCurrentPage"> |
| | | </el-pagination> |
| | | </div> |
| | | </main> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | <script> |
| | | import myHeader from "./components/header" |
| | | import myAside from "./components/aside" |
| | | import myMain from "./components/main" |
| | | import myAside from "./components/aside"; |
| | | import updateUser from "@/views/operate/fivepack/threepack/components/updateUser"; |
| | | import { getStoreInfoList, deleteStoreInfo } from "@/api/operate/storeManagement"; |
| | | import { SUCCESS_CODE } from "@/utils"; |
| | | |
| | | export default { |
| | | components: { |
| | | myHeader, |
| | | myMain, |
| | | myAside |
| | | components: { myAside, updateUser }, |
| | | |
| | | created() { |
| | | this.search(); |
| | | }, |
| | | |
| | | data() { |
| | | return { |
| | | isFresh: false, |
| | | keyword: '', |
| | | storeCode: null, |
| | | storeStatus: null, |
| | | options: [{ label: '经营', value: 1 }, { label: '倒闭', value: 2 }], |
| | | tableData: [], |
| | | dialogUpdate: false, |
| | | currentPage: 1, |
| | | totalNum: 0, |
| | | pageSize: 10, |
| | | userInfo: null, |
| | | updateFlag: false, |
| | | storeInfo: null |
| | | } |
| | | }, |
| | | |
| | | methods: { |
| | | // 获取搜索返回结果 |
| | | getSearch({ text }) { |
| | | this.keyword = text; |
| | | this.isFresh = true; |
| | | search() { |
| | | getStoreInfoList({ keyword: this.storeCode }) |
| | | .then(({ list, pageSize, totalPage }) => { |
| | | this.tableData = list; |
| | | this.pageSize = pageSize; |
| | | this.totalNum = totalPage; |
| | | }) |
| | | .catch(err => this.$message({ type: 'error', message: err })); |
| | | }, |
| | | // 获取刷新结果 |
| | | changeDialog({ flag }) { |
| | | console.log(flag); |
| | | this.isFresh = flag; |
| | | |
| | | handleReset() { |
| | | this.storeCode = ''; |
| | | this.storeStatus = null; |
| | | this.search(); |
| | | }, |
| | | // 重置isFresh |
| | | resetFresh({ flag }) { |
| | | this.isFresh = flag; |
| | | console.log(this.isFresh); |
| | | |
| | | handleView(row, type) { |
| | | this.dialogUpdate = true; |
| | | this.storeInfo = row; |
| | | this.updateFlag = type === 'update'; |
| | | }, |
| | | |
| | | handleDelete(id) { |
| | | deleteStoreInfo(id) |
| | | .then(() => { |
| | | this.$message({ type: 'success', message }); |
| | | this.search(); |
| | | }) |
| | | .catch(err => this.$message({ type: 'error', message: err })); |
| | | }, |
| | | |
| | | handleClose() { |
| | | this.dialogUpdate = false; |
| | | }, |
| | | |
| | | closeDialog() { |
| | | this.dialogUpdate = false; |
| | | this.search(); |
| | | }, |
| | | |
| | | changeCurrentPage(currentPage) { |
| | | this.currentPage = currentPage; |
| | | this.search(); |
| | | }, |
| | | |
| | | tableRowClassName({ row, rowIndex }) { |
| | | if ((rowIndex + 1) % 2 === 0) { |
| | | return "warning-row"; |
| | | } else { |
| | | return "success-row"; |
| | | } |
| | | }, |
| | | } |
| | | } |
| | | </script> |
| | |
| | | color: #4b9bb7; |
| | | display: flex; |
| | | height: 100%; |
| | | |
| | | .right{ |
| | | flex: 1; |
| | | height: 100%; |
| | | padding-left: 20px; |
| | | |
| | | .headerContent { |
| | | display: flex; |
| | | line-height: 100px; |
| | | justify-content: space-between; |
| | | align-items: center; |
| | | |
| | | .find { |
| | | display: flex; |
| | | } |
| | | |
| | | .search-item { |
| | | display: flex; |
| | | padding: 10px; |
| | | } |
| | | |
| | | .findBtn { |
| | | line-height: 100px; |
| | | margin-left: 15px; |
| | | display: flex; |
| | | align-items: center; |
| | | |
| | | .el-button { |
| | | padding: 12px 25px; |
| | | } |
| | | } |
| | | |
| | | .addBtn { |
| | | padding: 12px 30px; |
| | | margin-left: 20%; |
| | | } |
| | | } |
| | | |
| | | main { |
| | | background-color: #09152f; |
| | | margin-top: 20px; |
| | | padding-bottom: 50px; |
| | | |
| | | .mainTitle { |
| | | line-height: 60px; |
| | | } |
| | | |
| | | .el-link { |
| | | color: #4b9bb7; |
| | | } |
| | | |
| | | .leftPx { |
| | | margin-left: 10px; |
| | | } |
| | | |
| | | .pagination { |
| | | margin-top: 50px; |
| | | display: flex; |
| | | line-height: 50px; |
| | | justify-content: center; |
| | | |
| | | .el-pagination { |
| | | &::v-deep li, |
| | | &::v-deep .btn-prev, |
| | | &::v-deep .btn-next { |
| | | background-color: #071f39; |
| | | color: #4b9bb7; |
| | | } |
| | | } |
| | | } |
| | | |
| | | .el-table { |
| | | color: #4b9bb7; |
| | | font-size: 10px; |
| | | |
| | | &::v-deep .el-table__empty-block { |
| | | background-color: #09152f; |
| | | color: #4b9bb7; |
| | | } |
| | | |
| | | .operation { |
| | | display: flex; |
| | | |
| | | .el-button { |
| | | border: none; |
| | | } |
| | | |
| | | span:hover { |
| | | cursor: pointer; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | &::v-deep .el-dialog__header, |
| | | &::v-deep .el-dialog__body { |
| | |
| | | <header> |
| | | <div class="header-nav"> |
| | | <span class="nav-left">数据筛选</span> |
| | | <span class="nav-right">高级搜索</span> |
| | | <span class="nav-right" @click="showMoreParamsDialog">高级搜索</span> |
| | | </div> |
| | | <div class="header-content"> |
| | | <div class="search"> |
| | |
| | | </div> |
| | | <div class="message-kind"> |
| | | <span>消息分类:</span> |
| | | <el-select v-model="messageKind" placeholder="请选择消息分类"> |
| | | <el-option v-for="item in kindList" :key="item.id" :label="item.columnName" :value="item.id"> |
| | | <el-select v-model="messageType" placeholder="请选择消息分类"> |
| | | <el-option v-for="item in typeList" :key="item.id" :label="item.columnName" :value="item.id"> |
| | | </el-option> |
| | | </el-select> |
| | | </div> |
| | |
| | | </el-table-column> |
| | | <el-table-column prop="channelCode" label="消息分类" min-width="10"> |
| | | <template slot-scope="scope"> |
| | | <span>{{scope.row.channelCode === '01' ? '站内信':scope.row.channelCode |
| | | ==='02'?"邮件":'短信'}}</span> |
| | | <span>{{ getMessageType(scope.row.channelCode) }}</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="status" label="发布状态" min-width="5"> |
| | |
| | | <!-- 新建消息 --> |
| | | <el-dialog title="新建消息" :visible.sync="dialogCreate" v-if="dialogCreate" width="80%" |
| | | :before-close="handleConfirmClose"> |
| | | <MyCreate @closeMyDialog="closeDialog"></MyCreate> |
| | | <MyEdit @closeMyDialog="closeDialog" :type="'create'" :myDataRow="null"></MyEdit> |
| | | </el-dialog> |
| | | <!-- 消息详情 --> |
| | | <el-dialog title="消息详情" :visible.sync="dialogView" v-if="dialogView" width="45%" |
| | | :before-close="handleClose"> |
| | | <MyView @closeDialog="closeDialog" :myinfo="info">></MyView> |
| | | <MyView @closeDialog="closeDialog" :myDataRow="tableRowData">></MyView> |
| | | </el-dialog> |
| | | <!-- 编辑页面 --> |
| | | <el-dialog title="编辑消息" :visible.sync="dialogEdit" v-if="dialogEdit" width="80%" |
| | | :before-close="handleClose"> |
| | | <MyEdit @closeDialog="closeDialog" :myDataRow="info"></MyEdit> |
| | | <MyEdit @closeDialog="closeDialog" :myDataRow="tableRowData" :type="'update'"></MyEdit> |
| | | </el-dialog> |
| | | <!-- tools --> |
| | | <div class="tools"> |
| | |
| | | </div> |
| | | <div class="pagination"> |
| | | <el-pagination background :current-page="currentPage" layout="prev, pager, next" |
| | | :total="totalNum" :page-size="pageSize" @current-change="changeCurrentPage" |
| | | > |
| | | :total="totalNum" :page-size="pageSize" @current-change="changeCurrentPage"> |
| | | </el-pagination> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | <el-dialog |
| | | title="高级参数" |
| | | :visible.sync="isShowMoreParams" |
| | | width="30%" |
| | | :before-close="handleClose"> |
| | | </el-dialog> |
| | | </main> |
| | | </div> |
| | | </template> |
| | | <script> |
| | | import helper from '@/utils/mydate' |
| | | import MyView from './myview' |
| | | import MyCreate from './createUser' |
| | | // 引入编辑组件 |
| | | import MyEdit from './update' |
| | | import { deleteMessage, getMessageById, getMessageList } from "@/api/operate/messageManagement"; |
| | | import {SUCCESS_CODE} from "@/utils"; |
| | | |
| | | export default { |
| | | components: { |
| | | MyView, MyCreate,MyEdit |
| | | }, |
| | | components: { MyView, MyEdit }, |
| | | data() { |
| | | return { |
| | | tableData: [], |
| | | context: "", |
| | | tableRowData: null, |
| | | isShowMoreParams: false, |
| | | context: '', |
| | | dialogEdit:false, |
| | | dialogCreate: false, |
| | | dialogView: false, |
| | |
| | | ], |
| | | tempList: [], |
| | | messageStatus: 2, |
| | | messageKind: '00', |
| | | messageType: '00', |
| | | statusList: [ |
| | | { |
| | | label: '全部', |
| | |
| | | value: 1, |
| | | } |
| | | ], |
| | | kindList: [ |
| | | typeList: [ |
| | | { |
| | | id:'00', |
| | | columnName:'全部', |
| | |
| | | } |
| | | }, |
| | | created() { |
| | | const {setTableData} = this |
| | | setTableData(); |
| | | this.getMessageList(); |
| | | }, |
| | | |
| | | methods: { |
| | | // 查询 |
| | | handleSearch(){ |
| | | this.setTableData(); |
| | | this.getMessageList(); |
| | | }, |
| | | |
| | | // 重置 |
| | | handleReset(){ |
| | | |
| | | this.messageStatus = 2; |
| | | this.messageType = '00'; |
| | | this.context = ''; |
| | | }, |
| | | |
| | | // 查看 |
| | | handleView(data){ |
| | | this.info = data; |
| | | this.tableRowData = data; |
| | | this.dialogView = true; |
| | | }, |
| | | |
| | | // 编辑 |
| | | handleEdit(data){ |
| | | this.info = data; |
| | | this.tableRowData = data; |
| | | this.dialogEdit = true; |
| | | }, |
| | | |
| | | // 删除信息 |
| | | handleDelete(idarr) { |
| | | this.$confirm('确认删除?') |
| | | .then(_ => { |
| | | this.$axios({ |
| | | method: 'post', |
| | | url: 'sccg/message/delete?ids=' + idarr, |
| | | }) |
| | | .then(res => { |
| | | if (res.code === 200) { |
| | | this.$message({ |
| | | type: 'success', |
| | | message: '删除成功', |
| | | }) |
| | | this.setTableData(); |
| | | .then(() => { |
| | | deleteMessage(idarr) |
| | | .then(({ code, message }) => { |
| | | if (code === SUCCESS_CODE) { |
| | | this.getMessageList(); |
| | | this.$message({ type: 'success', message }); |
| | | } else { |
| | | this.$message({ |
| | | type: 'error', |
| | | message: res.message |
| | | }) |
| | | this.$message({ type: 'error', message }); |
| | | } |
| | | }) |
| | | .catch(err => { this.$message({ type: 'error', message: err }) }); |
| | | }) |
| | | }, |
| | | // 设置表格数据 |
| | | async setTableData() { |
| | | const arr = await this.getMessageList(); |
| | | this.tableData = arr.records; |
| | | this.totalNum = arr.total |
| | | }, |
| | | |
| | | // 获取消息数据 |
| | | async getMessageList() { |
| | | let arr = []; |
| | | const { currentPage, pageSize,context,messageStatus,messageKind } = this; |
| | | await this.$axios({ |
| | | method: 'post', |
| | | url: 'sccg/message/list', |
| | | data: { |
| | | body: "", |
| | | channelCode: messageKind === '00' ?'':messageKind, |
| | | createUser: '', |
| | | current: currentPage, |
| | | head: context, |
| | | messageType: "", |
| | | pageSize: pageSize, |
| | | randomCode: "", |
| | | remark: "", |
| | | sendTime: "", |
| | | status: messageStatus === 2 ? '':messageStatus, |
| | | targetFrom: "", |
| | | targetTo: "" |
| | | getMessageList() { |
| | | const messageParam = { |
| | | current: this.currentPage, |
| | | size: this.pageSize, |
| | | channelCode: this.messageType, |
| | | status: this.messageStatus, |
| | | head: this.context |
| | | } |
| | | getMessageList(messageParam) |
| | | .then(({ data }) => { |
| | | this.tableData = []; |
| | | }) |
| | | .then(res => { |
| | | arr = res.data; |
| | | }) |
| | | return arr; |
| | | .catch(err => { |
| | | this.$message({ type: 'error', message: err }); |
| | | }); |
| | | }, |
| | | |
| | | // 批量下拉框操作 |
| | | async selectChange(list) { |
| | | console.log(this.tempList); |
| | | if (this.tempList.length !== 0) { |
| | | this.preMyIdx = list; |
| | | if (list === 3) { |
| | |
| | | }) |
| | | } |
| | | }, |
| | | |
| | | // 批量操作 |
| | | mulUpdateStatus(idArr, flag) { |
| | | this.$confirm(flag === 1 ? "您确定要进行批量启用角色吗?" : '您确定要进行批量禁用角色吗?') |
| | |
| | | message: res.message |
| | | }) |
| | | } |
| | | console.log(res); |
| | | }) |
| | | }) |
| | | .catch(err => { console.log(err) }) |
| | | }, |
| | | |
| | | // 表格监听 |
| | | tableChange(list) { |
| | | this.tempList = []; |
| | | list.forEach(item => { |
| | | this.tempList.push(item.id); |
| | | }) |
| | | if (list.length === this.tableData.length) { |
| | | this.all = true; |
| | | } else { |
| | | this.all = false |
| | | } |
| | | this.all = list.length === this.tableData.length; |
| | | }, |
| | | |
| | | // 修改时间格式 |
| | | changeTime({ updateTime }) { |
| | | return helper(updateTime); |
| | | }, |
| | | |
| | | // 全选 |
| | | selectAll() { |
| | | this.$refs.multipleTable.toggleAllSelection(); |
| | | }, |
| | | |
| | | // 反选 |
| | | disSame(list) { |
| | | list.forEach(row => { |
| | | this.$refs.multipleTable.toggleRowSelection(row) |
| | | }) |
| | | }, |
| | | |
| | | // 设置表格斑马纹 |
| | | tableRowClassName({ row, rowIndex }) { |
| | | if ((rowIndex + 1) % 2 == 0) { |
| | | if ((rowIndex + 1) % 2 === 0) { |
| | | return 'warning-row'; |
| | | } else { |
| | | return 'success-row'; |
| | | } |
| | | return ''; |
| | | }, |
| | | |
| | | // 当前页改变触发事件 |
| | | changeCurrentPage(page) { |
| | | this.currentPage = page; |
| | | this.setTableData(); |
| | | this.getMessageList(); |
| | | }, |
| | | |
| | | showMoreParamsDialog() { |
| | | this.isShowMoreParams = true; |
| | | }, |
| | | |
| | | // 关闭弹窗 |
| | | handleClose(done) { |
| | | done(); |
| | | }, |
| | | |
| | | // 确认关闭弹窗 |
| | | handleConfirmClose(done) { |
| | | this.$confirm('确认关闭?') |
| | |
| | | console.log(err); |
| | | }) |
| | | }, |
| | | |
| | | // 自定义关闭弹窗 |
| | | closeDialog({ flag, index }) { |
| | | this.dialogCreate = flag; |
| | | this.dialogView = flag; |
| | | if (index === 1) { |
| | | this.setTableData(); |
| | | this.getMessageList(); |
| | | } |
| | | }, |
| | | |
| | | getMessageType(id) { |
| | | const result = this.typeList.find(item => item.id === id); |
| | | return result.columnName; |
| | | } |
| | | } |
| | | } |
| | |
| | | |
| | | header { |
| | | background-color: #09152f; |
| | | border: 1pox solid #fff; |
| | | |
| | | .header-nav { |
| | | line-height: 40px; |
| | |
| | | background-color: #09152f; |
| | | margin-top: 20px; |
| | | padding-bottom: 50px; |
| | | border: 1pox solid #fff; |
| | | |
| | | .el-link { |
| | | color: #4b9bb7; |
| | |
| | | } |
| | | }, |
| | | created() { |
| | | this.info = this.myinfo; |
| | | this.title = this.info.head; |
| | | this.sendTime = this.info.sendTime; |
| | | this.body = this.info.body; |
| | | const { head, sendTime, body } = this.tableRowData; |
| | | this.title = head; |
| | | this.sendTime = sendTime; |
| | | this.body = body; |
| | | }, |
| | | methods: { |
| | | |
| | | }, |
| | | props: ['closeMyDialog','myinfo'] |
| | | props: ['tableRowData'] |
| | | } |
| | | </script> |
| | | <style lang="scss" scoped> |
| | |
| | | </el-form-item> |
| | | <!-- 消息内容 --> |
| | | <el-form-item class="optionItem" label="消息内容:" prop="body"> |
| | | <MyEditor ref="edit" @getMyBody="getMyBody" :mybody='role.body'></MyEditor> |
| | | <!-- <el-input type="textarea" v-model="role.description" placeholder="请输入描述内容200字以内"></el-input> --> |
| | | <MyEditor ref="edit" @getMyBody="getMyBody"></MyEditor> |
| | | </el-form-item> |
| | | <!-- 提醒方式 --> |
| | | <el-form-item class="optionItem" label="提醒方式:" prop="channelCode"> |
| | |
| | | import MyEditor from '@/components/edit' |
| | | import MyColumnAdd from '@/views/operate/message/mycontrol/createUser' |
| | | import MyColView from '../messageView' |
| | | import { sendMessage, updateMessage } from "@/api/operate/messageManagement"; |
| | | |
| | | export default { |
| | | components: { MyEditor, MyColumnAdd,MyColView }, |
| | | props: ['type', 'myDataRow'], |
| | | data() { |
| | | const validateNickname = (rule, value, callback) => { |
| | | if (!value) { |
| | | callback(new Error("请填写消息栏目")); |
| | | } else { |
| | | callback(); |
| | | } |
| | | }; |
| | | const validatePass = (rule, value, callback) => { |
| | | if (!value) { |
| | | callback(); |
| | | } else { |
| | | callback(); |
| | | } |
| | | }; |
| | | const validateTruename = (rule, value, callback) => { |
| | | if (value.length !== 0) { |
| | | callback(); |
| | | } else { |
| | | callback(new Error('请选择接收对象')); |
| | | } |
| | | }; |
| | | return { |
| | | role: { |
| | | messageType: '', |
| | |
| | | }, |
| | | createRoleRules: { |
| | | messageType: [ |
| | | { required: true, trigger: "blur", validator: validateNickname }, |
| | | { required: true, trigger: ['blur', 'change'], message: '请输入消息栏目' }, |
| | | ], |
| | | head: [ |
| | | { required: false, trigger: "blur", validator: validatePass }, |
| | | { required: false, trigger: "blur" }, |
| | | ], |
| | | targetTo: [ |
| | | { required: false, trigger: "blur", validator: validateTruename }, |
| | | { required: false, trigger: "blur" }, |
| | | ], |
| | | }, |
| | | colList: [], |
| | |
| | | dialogView: false, |
| | | defaultProps: { |
| | | children: 'children', |
| | | label: 'departName', |
| | | // disabled: function (data, node) { |
| | | // if (data.createTime) { |
| | | // return !data.leaf |
| | | // } |
| | | // } |
| | | label: 'departName' |
| | | }, |
| | | checkedList: [], |
| | | tempNameArr:[], |
| | | info:{}, |
| | | sendUser:"" |
| | | sendUser: '' |
| | | } |
| | | }, |
| | | created() { |
| | | this.setColumnList(); |
| | | this.setDepartList(); |
| | | this.getColumnList(); |
| | | this.getDepartList(); |
| | | this.getLoginUserInfo(); |
| | | if (this.type === 'update' && this.myDataRow) { |
| | | this.role = this.myDataRow; |
| | | console.log(this.role); |
| | | } |
| | | }, |
| | | methods: { |
| | | // 关闭弹窗 |
| | |
| | | done(); |
| | | }) |
| | | }, |
| | | // 设置栏目 |
| | | async setColumnList() { |
| | | this.colList = await this.getColumnList(); |
| | | }, |
| | | |
| | | // 获取栏目 |
| | | async getColumnList() { |
| | | let arr; |
| | | await this.$axios({ |
| | | method: 'get', |
| | | url: 'sccg/message_column/getAllColumn' |
| | | }) |
| | | .then(res => { |
| | | console.log(res); |
| | | arr = res.data; |
| | | this.colList = res.data; |
| | | }) |
| | | return arr; |
| | | }, |
| | | // 关闭弹窗 |
| | | closeDialog({ flag, index }) { |
| | | this.dialogCreate = flag; |
| | | if (index === 1) { |
| | | // 重新设置栏目 |
| | | this.setColumnList(); |
| | | this.getColumnList(); |
| | | } |
| | | }, |
| | | |
| | | // 获取部门树 |
| | | async getDepartList() { |
| | | let arr |
| | | await this.$axios({ |
| | | method: 'get', |
| | | url: 'sccg/depart/tree' |
| | | }) |
| | | .then(res => { |
| | | arr = res.data |
| | | res.data.forEach(item => { |
| | | this.departList.push(this.setChildren(item)); |
| | | }); |
| | | }) |
| | | return arr; |
| | | }, |
| | | // 设置部门树 |
| | | async setDepartList() { |
| | | this.departList = await this.filterDepartList(); |
| | | }, |
| | | // 处理部门树 |
| | | async filterDepartList() { |
| | | let arr = await this.getDepartList(); |
| | | const { setChildren } = this; |
| | | // console.log(setChildren); |
| | | arr.forEach(item => { |
| | | setChildren(item); |
| | | }) |
| | | return arr; |
| | | }, |
| | | |
| | | // 递归children |
| | | setChildren(obj) { |
| | | if (obj.children !== null) { |
| | |
| | | }) |
| | | } |
| | | } |
| | | return obj; |
| | | }, |
| | | |
| | | // 选中id |
| | | handleCheck(data, node) { |
| | | let arr = [],nameArr = [] |
| | | console.log(node.checkedNodes) |
| | | node.checkedNodes.forEach(item => { |
| | | if(!item.hasOwnProperty('departType')){ |
| | | arr.push(item.id) |
| | | nameArr.push(item.departName) |
| | | this.checkedList.push(item.id) |
| | | this.tempNameArr.push(item.departName) |
| | | } |
| | | }) |
| | | this.checkedList = arr |
| | | this.tempNameArr = nameArr |
| | | console.log(this.tempNameArr) |
| | | this.role.targetTo = arr.length + '人' |
| | | this.role.targetTo = this.checkedList.length + '人' |
| | | }, |
| | | |
| | | // 新建/保存消息(1:新建,0保存消息) |
| | | handleSubmit(mystatus) { |
| | | console.log(mystatus); |
| | | if(mystatus===0){ |
| | | this.updateMessage(mystatus); |
| | | }else{ |
| | | this.newsMessage(mystatus); |
| | | } |
| | | }, |
| | | //修改消息 |
| | | updateMessage(mystatus){ |
| | | this.$refs.user.validate((valid) => { |
| | | if (valid) { |
| | | const { role, checkedList } = this; |
| | | console.log(checkedList); |
| | | this.$axios({ |
| | | method: 'post', |
| | | url: `sccg/message/update/${this.role.id}`, |
| | | data: { |
| | | body: role.body, |
| | | channelCode: `${role.channelCode}`, |
| | | head: role.head, |
| | | messageType: role.messageType, |
| | | const { body, head, messageType, targetFrom, channelCode } = this.role; |
| | | const params = { |
| | | body, |
| | | head, |
| | | messageType, |
| | | channelCode: `${channelCode}`, |
| | | sendTime: new Date(), |
| | | targetTo: checkedList.join(','), |
| | | targetFrom: `${role.targetFrom}`, |
| | | targetTo: this.checkedList.join(','), |
| | | targetFrom: `${targetFrom}`, |
| | | status: mystatus, |
| | | } |
| | | if (this.type === 'create') { |
| | | sendMessage(params) |
| | | .then(() => { |
| | | this.$emit('closeMyDialog'); |
| | | this.$message({ type: 'success', message: '操作成功' }); |
| | | }) |
| | | .then(res => { |
| | | if (res.code === 200) { |
| | | this.$message({ |
| | | type: 'success', |
| | | message: mystatus === 1 ? '发布成功' : '保存成功', |
| | | }) |
| | | this.$emit('closeMyDialog', { flag: false, index: 1 }); |
| | | } |
| | | }) |
| | | .catch(err => this.$message({ type: 'error', message: err })); |
| | | } else { |
| | | return false; |
| | | updateMessage(params) |
| | | .then(() => { |
| | | this.$emit('closeMyDialog'); |
| | | this.$message({ type: 'success', message: '操作成功' }); |
| | | }) |
| | | .catch(err => this.$message({ type: 'error', message: err })); |
| | | } |
| | | } else { |
| | | this.$message.error({ type: 'warning', message: '请检查必填项' }); |
| | | } |
| | | }) |
| | | }, |
| | | //发布消息 |
| | | newsMessage(mystatus){ |
| | | this.$refs.user.validate((valid) => { |
| | | if (valid) { |
| | | const { role, checkedList } = this; |
| | | console.log(checkedList); |
| | | this.$axios({ |
| | | method: 'post', |
| | | url: 'sccg/message/sendMessage', |
| | | data: { |
| | | id:role.id, |
| | | body: role.body, |
| | | channelCode: `${role.channelCode}`, |
| | | head: role.head, |
| | | messageType: role.messageType, |
| | | sendTime: new Date(), |
| | | targetTo: checkedList.join(','), |
| | | targetFrom: `${role.targetFrom}`, |
| | | status: mystatus, |
| | | } |
| | | }) |
| | | .then(res => { |
| | | if (res.code === 200) { |
| | | this.$message({ |
| | | type: 'success', |
| | | message: mystatus === 1 ? '发布成功' : '保存成功', |
| | | }) |
| | | this.$emit('closeMyDialog', { flag: false, index: 1 }); |
| | | } |
| | | }) |
| | | } else { |
| | | return false; |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | // 获得消息体 |
| | | getMyBody(obj) { |
| | | console.log(obj); |
| | | this.role.body = obj; |
| | | }, |
| | | |
| | | // 重置表单 |
| | | handleReset() { |
| | | this.$refs.edit.editor.txt.clear(); |
| | | // this.$refs.edit.wangEditor.txt.html('<p><br></p>') |
| | | this.setDepartList(); |
| | | this.$refs.user.resetFields(); |
| | | }, |
| | | |
| | | // 获取当前登录用户信息 |
| | | getLoginUserInfo() { |
| | | const name = sessionStorage.getItem('name'); |
| | |
| | | this.sendUser = res.data.username |
| | | }) |
| | | }, |
| | | |
| | | // 消息预览 |
| | | handleView() { |
| | | this.$refs.user.validate((valid) => { |
| | | if (valid) { |
| | | const { role,getColText,tempNameArr,sendUser } = this |
| | | const { body, head, channelCode } = this.role; |
| | | this.dialogView = true; |
| | | let info = {} |
| | | // 获得栏目消息 |
| | | info.channelCode = role.channelCode === '01'? '站内信': role.channelCode === '02' ? '邮件':'短信' |
| | | info.messageType = getColText(role.messageType) |
| | | info.body = role.body |
| | | info.head = role.head |
| | | info.targetTo = tempNameArr |
| | | info.targetFrom = sendUser |
| | | this.info = info |
| | | this.info = { |
| | | body, |
| | | head, |
| | | channelCode: channelCode === '01'? '站内信': channelCode === '02' ? '邮件':'短信', |
| | | messageType: this.getColText(this.role.messageType), |
| | | targetTo: this.tempNameArr, |
| | | targetFrom: this.sendUser |
| | | } |
| | | } else { |
| | | return false |
| | | this.$message({ type: 'warning', message: '请检查必填项' }); |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | // 获得栏目消息 |
| | | getColText(id){ |
| | | console.log(id) |
| | | const {colList} = this |
| | | let str = '' |
| | | colList.forEach(item=>{ |
| | | this.colList.forEach(item=>{ |
| | | item.id === id ? str = item.columnName : '' |
| | | }) |
| | | return str |
| | | return str; |
| | | } |
| | | }, |
| | | props: ['closeMyDialog','myDataRow'] |
| | | } |
| | | </script> |
| | | <style lang="scss" scoped> |
| | |
| | | text-align: left; |
| | | padding: 0 55px; |
| | | background-color: #09152f; |
| | | padding-bottom: 50px; |
| | | |
| | | .mainContent { |
| | | display: flex; |
| | |
| | | </div> |
| | | </div> |
| | | <div class="date-search contentItem"> |
| | | <!-- <span>按类型:</span> |
| | | <div class="search"> |
| | | <el-input placeholder="请输入编号"></el-input> |
| | | </div> --> |
| | | <div class="btn"> |
| | | <el-button icon="el-icon-plus" type="primary">搜索</el-button> |
| | | <!-- <el-button icon="el-icon-delete">重置</el-button> --> |
| | | </div> |
| | | </div> |
| | | </div> |
| | |
| | | <el-table-column :prop="myproblem === 1 ? 'continueTime' : 'materials'" |
| | | :label="myproblem === 1 ? '持续时间' : '违法建筑材料'" min-width="15"> |
| | | </el-table-column> |
| | | <!-- <el-table-column prop="operation" label="操作" min-width="15"> |
| | | <template slot-scope="scope"> |
| | | <div class="btn"> |
| | | <!-- v-if="instatus===7 ? true : false" --> |
| | | <!-- <span @click="handleExamine(scope.row)" v-if="instatus===7">审核</span> |
| | | <span @click="handleClosure(scope.row)" v-if="instatus===8">结案</span> |
| | | <span class="line" v-if="instatus !==9">|</span> |
| | | <span @click="JumpView(scope.row)">查看</span> |
| | | </div> |
| | | </template> |
| | | </el-table-column> --> |
| | | </el-table> |
| | | <!-- 审核页面 --> |
| | | <el-dialog :visible.sync="dialogExamine" width="80%" title="基础信息(人工)" v-if="dialogExamine" |
| | |
| | | <!-- 详情页面 --> |
| | | <el-dialog :visible.sync="dialogView" width="80%" title="基础信息(人工)" v-if="dialogView" |
| | | :before-close="handleNoClose"> |
| | | <MyDetail :info=info v-if="myproblem == 1 ? true : false" :mycode='code'></MyDetail> |
| | | <MyDetail :info=info v-if="myproblem === 1" :mycode='code'></MyDetail> |
| | | <MyIllDetail :info=info v-else :mycode="code"></MyIllDetail> |
| | | </el-dialog> |
| | | <!-- tools --> |
| | |
| | | </div> |
| | | </template> |
| | | <script> |
| | | import { getTypeList } from "@/utils/helper"; |
| | | export default { |
| | | data() { |
| | | |
| | | return { |
| | | |
| | | imagedata: { |
| | | code: "SJ202211010001", |
| | | questionType: "违规", |
| | | bigType: "违反国家有关标准编制城乡规划", |
| | | smallType: "在居民住宅楼、未配套设立专用烟道的商住综合楼、商住综合楼内与居住层相邻的商业楼层内新建、改建、扩建产生油烟、异味、废气的餐饮服务项目", |
| | | imagesId: "1", |
| | | uploadTime: "2022-10-31 20:20:01", |
| | | imageUrl:"https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fimg.fabao365.xuanfa.cn%2Fimage%2F202107%2F130f9d19f204302f.jpg&refer=http%3A%2F%2Fimg.fabao365.xuanfa.cn&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1670034077&t=974b018f9e27023a01d2d8ad3c7c44f2" |
| | | }, |
| | | } |
| | | }, |
| | | created() { |
| | | // const that = this; |
| | | // this.user = JSON.parse(JSON.stringify(that.userInfo)); |
| | | // console.log(this.user); |
| | | // this.user.parentId = this.user.parentId === 0 ? '暂无上级部门' : this.user.parentId; |
| | | // this.checkedList = this.user.userInfoDTOS; |
| | | // this.checkedList.forEach((e) => { |
| | | // this.checkedUser.push(e.userId); |
| | | // }); |
| | | // console.log(this.checkedUser) |
| | | // this.$axios({ |
| | | // method: "get", |
| | | // url: "sccg/depart/tree", |
| | | // }).then((res) => { |
| | | // that.departList = res.data; |
| | | // }); |
| | | // this.getUserList(this.user.id); |
| | | // // 获取部门类型 |
| | | // this.getDepartType(); |
| | | |
| | | }, |
| | | methods: { |
| | | // handleUser() { |
| | | // this.$refs["user"].validate((valid) => { |
| | | // if (valid) { |
| | | // const { user, checkedList } = this; |
| | | // const arr = []; |
| | | // checkedList.forEach((item) => { |
| | | // arr.push({ leader: item.leader, userId: item.id ? item.id : item.userId }); |
| | | // }); |
| | | // if (arr.length === 0) { |
| | | // this.$message({ |
| | | // type: 'warning', |
| | | // message: '请选择部门人员', |
| | | // }) |
| | | // } else { |
| | | // this.$axios |
| | | // .post("sccg/depart/update", { |
| | | // id: user.id, |
| | | // departName: user.departName, |
| | | // parentId: user.parentId === '暂无上级部门' ? 0 : user.parentId, |
| | | // departDes: user.departDes, |
| | | // departManagerList: arr, |
| | | // }) |
| | | // .then((res) => { |
| | | // this.$message({ |
| | | // message: res.message, |
| | | // type: res.code === 200 ? "success" : "warning", |
| | | // }); |
| | | // this.$emit("changeDialog", { flag: false }); |
| | | // this.getDepartList(); |
| | | // }); |
| | | // } |
| | | // } else { |
| | | // return false; |
| | | // } |
| | | // }); |
| | | // }, |
| | | // // 获取部门类型 |
| | | // async getDepartType() { |
| | | // this.typeList = await getTypeList(1, "08"); |
| | | // }, |
| | | |
| | | // // 设置领导 |
| | | // setLeader(idx) { |
| | | // if (this.updateFlag) { |
| | | // this.checkedList.forEach((item, index) => { |
| | | // item.leader = index === idx; |
| | | // }); |
| | | // } |
| | | // }, |
| | | |
| | | // // 获取所有用户信息 |
| | | // getUserList(id) { |
| | | // // 获取所有用户信息、用户查询(暂时支持电话号码) |
| | | // this.$axios.get(`/sccg/depart/query_surplus_exist_user?id=`+id).then((res) => { |
| | | // if (res.code === 200) { |
| | | // this.userList = res.data; |
| | | // } |
| | | // }); |
| | | // }, |
| | | // addUser() { |
| | | // this.checkedList = []; |
| | | // this.userList.forEach((item) => { |
| | | // this.checkedUser.forEach((child) => { |
| | | // if (item.id == child) { |
| | | // this.checkedList.push({ |
| | | // id: item.id, |
| | | // username: item.username, |
| | | // leader: false, |
| | | // }); |
| | | // } |
| | | // }); |
| | | // }); |
| | | // this.checkedList[0].leader = true; |
| | | // console.log(this.checkedList); |
| | | // this.openUser = false; |
| | | // }, |
| | | // }, |
| | | // props: ["userInfo", "updateFlag", "getDepartList", "changeDialog"], |
| | | }, |
| | | props: ['updateFlag'] |
| | | }; |
| | |
| | | main { |
| | | // border: 1px solid #fff; |
| | | text-align: left; |
| | | padding: 0 55px; |
| | | background-color: #09152f; |
| | | padding-bottom: 50px; |
| | | |
| | | // .mainTitle { |
| | | // color: #4b9bb7; |
| | | // font-weight: 600; |
| | | // line-height: 100px; |
| | | // font-size: 14px; |
| | | // } |
| | | |
| | | .mainContent { |
| | | display: flex; |
| | |
| | | </div> |
| | | </div> |
| | | <div class="findBtn"> |
| | | <el-button type="primary" @click="getUserList">查询</el-button> |
| | | <el-button type="primary" @click="getDepartmentList">查询</el-button> |
| | | </div> |
| | | </div> |
| | | </div> |
| | |
| | | </el-table-column> |
| | | </el-table> |
| | | <!-- 详情页展示 --> |
| | | <el-dialog :visible.sync="dialogView" width="80%" title="基础信息(人工)" v-if="dialogView" |
| | | <el-dialog :visible.sync="dialogView" width="80%" title="基础信息(人工)" |
| | | :before-close="handleClose"> |
| | | <MyDetail :info=info v-if="mystatus === 1"></MyDetail> |
| | | <MyIllDetail :info=info v-else></MyIllDetail> |
| | | </el-dialog> |
| | | |
| | | <el-dialog :visible.sync="dialogUpdate" width="40%" title="修改部门" v-if="dialogUpdate" |
| | | <el-dialog :visible.sync="dialogUpdate" width="40%" title="修改部门" |
| | | :before-close="handleClose"> |
| | | <updateUser @closeUpdateDialog="closeUpdateDialog()" :updateDepartmentData="updateDepartmentData" /> |
| | | |
| | | <update-user @closeUpdateDialog="closeUpdateDialog()" |
| | | :updateDepartmentData="updateDepartmentData" |
| | | :isUpdate="dialogType === 'update'" |
| | | /> |
| | | </el-dialog> |
| | | <el-dialog :visible.sync="dialogcheck" width="40%" title="查看" v-if="dialogcheck" |
| | | <el-dialog :visible.sync="dialogcheck" width="40%" title="查看" |
| | | :before-close="handleClose" > |
| | | <detailUser /> |
| | | </el-dialog> |
| | | |
| | | <el-dialog :visible.sync="dialogAdd" width="40%" title="添加部门" v-if="dialogAdd" |
| | | <el-dialog :visible.sync="dialogAdd" width="40%" title="添加部门" |
| | | :before-close="handleClose"> |
| | | <createUser @closeUpdateDialog="closeUpdateDialog()" /> |
| | | <update-user @closeUpdateDialog="closeUpdateDialog()" |
| | | :updateDepartmentData="updateDepartmentData" |
| | | :isUpdate="dialogType === 'add'" |
| | | /> |
| | | </el-dialog> |
| | | |
| | | <div class="tools"> |
| | |
| | | </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"> |
| | | :total="totalNum" :page-size="pageSize" @current-change="changeCurrentPage"> |
| | | </el-pagination> |
| | | </div> |
| | | </div> |
| | |
| | | </div> |
| | | </template> |
| | | <script> |
| | | import createUser from "./createUser"; |
| | | import updateUser from "./updateUser"; |
| | | import detailUser from "./detailUser"; |
| | | import { deleteTeam, exportTeamInfo, importTeamInfo, searchTeamInfo } from "@/api/system/portal/teamConstruction"; |
| | | import {SUCCESS_CODE} from "@/utils"; |
| | | |
| | | export default { |
| | | components: { |
| | | updateUser, createUser, detailUser |
| | | }, |
| | | components: { updateUser, detailUser }, |
| | | |
| | | data() { |
| | | return { |
| | |
| | | updateFlag: false, |
| | | userInfo: {}, |
| | | info: {}, |
| | | totalNum: 5, |
| | | totalNum: 1, |
| | | pageSize: 10, |
| | | currentPage: 1, |
| | | all: false, |
| | |
| | | caseId: '', |
| | | caseCode: null, |
| | | dialogAdd: false, |
| | | dialogType: 'update' |
| | | } |
| | | }, |
| | | |
| | |
| | | if (item.checked) { |
| | | this.statusArr[1] = item.value; |
| | | } |
| | | }) |
| | | this.getUserList(); |
| | | }); |
| | | this.getDepartmentList(); |
| | | }, |
| | | |
| | | methods: { |
| | |
| | | // 添加界面 |
| | | showAddDialog() { |
| | | this.dialogAdd = true; |
| | | this.dialogType = 'add'; |
| | | }, |
| | | |
| | | // 导出 |
| | |
| | | // 导入 |
| | | importTable(file) { |
| | | importTeamInfo({ 'multipartFile': file.file }) |
| | | .then(({ code, message }) => { |
| | | if (code === SUCCESS_CODE) { |
| | | this.$message({ type: 'success', message }); |
| | | this.getUserList(); |
| | | .then(() => { |
| | | this.$message({ type: 'success', message: '操作成功' }); |
| | | this.getDepartmentList(); |
| | | this.$refs.uploadFile.clearFiles(); |
| | | } else { |
| | | this.$message({ type: 'error', message }); |
| | | } |
| | | }) |
| | | .catch(err => { |
| | | this.$message({ type: 'error', message: err }); |
| | |
| | | closeUpdateDialog() { |
| | | this.dialogAdd = false; |
| | | this.dialogUpdate = false; |
| | | this.getUserList(); |
| | | this.getDepartmentList(); |
| | | }, |
| | | |
| | | // 顶部下拉框 |
| | | setMystatus(value) { |
| | | setMyStatus(value) { |
| | | this.statusArr[1] = value; |
| | | this.changeTypeChecked(value - 1); |
| | | this.getUserList(); |
| | | this.getDepartmentList(); |
| | | }, |
| | | |
| | | // 批量删除 |
| | |
| | | method: 'delete', |
| | | url: 'sccg/violations/batch_delete?ids=' + idArr, |
| | | }).then(res => { |
| | | this.getUserList(); |
| | | this.getDepartmentList(); |
| | | this.$message({ |
| | | message: res.message, |
| | | type: res.code === 200 ? 'success' : 'warning' |
| | |
| | | .then(({ code, message }) => { |
| | | if (code === SUCCESS_CODE) { |
| | | this.$message({ type: 'success', message }); |
| | | this.getUserList(); |
| | | this.getDepartmentList(); |
| | | } else { |
| | | this.$message({ type: 'error', message }); |
| | | } |
| | |
| | | }, |
| | | |
| | | // 获取用户列表 |
| | | getUserList() { |
| | | getDepartmentList() { |
| | | const searchInfo = { |
| | | current: this.currentPage, size: this.pageSize, departName: this.searchDepartment, status: this.searchStatus |
| | | }; |
| | | searchTeamInfo(searchInfo) |
| | | .then(({ data }) => { |
| | | this.tableData = data.records; |
| | | this.totalNum = data.total; |
| | | .then(({ records, total }) => { |
| | | this.tableData = records; |
| | | this.totalNum = total; |
| | | }) |
| | | .catch(err => { |
| | | console.log(err); |
| | | this.$message({ type: 'error', message: err }); |
| | | }); |
| | | }, |
| | | |
| | |
| | | }) |
| | | this.mystatus = idx + 1; |
| | | this.statusArr[1] = this.typeList[idx].value; |
| | | this.getUserList(); |
| | | this.getDepartmentList(); |
| | | }, |
| | | |
| | | // 设置表格斑马纹 |
| | |
| | | // 当前页改变触发事件 |
| | | changeCurrentPage(page) { |
| | | this.currentPage = page; |
| | | this.getUserList(); |
| | | }, |
| | | |
| | | // 上一页点击事件 |
| | | handlePrev(page) { |
| | | this.currentPage = page; |
| | | this.getUserList(); |
| | | }, |
| | | |
| | | // 下一页点击事件 |
| | | handleNext(page) { |
| | | this.currentPage = page; |
| | | this.getUserList(); |
| | | this.getDepartmentList(); |
| | | }, |
| | | |
| | | handleClose(done) { |
| | |
| | | // 关闭上传界面 |
| | | closeDialog({ flag }) { |
| | | this.dialogUpload = flag; |
| | | this.getUserList(); |
| | | }, |
| | | |
| | | // 处理时间 |
| | | filterTime(time) { |
| | | return helper(time); |
| | | this.getDepartmentList(); |
| | | } |
| | | } |
| | | } |
| | |
| | | label-position="right" |
| | | > |
| | | <!-- 部门名称 --> |
| | | <span style="heght:18px;display:block;line-height: 14px;"> |
| | | <span style="height:18px;display:block;line-height: 14px;"> |
| | | 执法人员结构 |
| | | </span> |
| | | <el-form-item class="optionItem" label="部门名称:" prop="name"> |
| | |
| | | </template> |
| | | <script> |
| | | import { deepClone } from "@/utils/helper"; |
| | | import { updateTeamInfo } from "@/api/system/portal/teamConstruction"; |
| | | import { SUCCESS_CODE } from "@/utils"; |
| | | import {addTeam, updateTeamInfo} from "@/api/system/portal/teamConstruction"; |
| | | |
| | | export default { |
| | | data() { |
| | | |
| | | return { |
| | | updateData: null, |
| | | rules: { |
| | |
| | | submitUpdate() { |
| | | this.$refs.user.validate((valid) => { |
| | | if (valid) { |
| | | if (this.isUpdate) { |
| | | updateTeamInfo(this.updateData) |
| | | .then(({ code, message }) => { |
| | | if (code === SUCCESS_CODE) { |
| | | .then(() => { |
| | | this.$emit('closeUpdateDialog'); |
| | | this.$message({ type: 'success', message }); |
| | | } else { |
| | | this.$message({ type: 'error', message }); |
| | | } |
| | | this.$message({ type: 'success', message: '操作成功' }); |
| | | }) |
| | | .catch(err => { |
| | | this.$message({ type: 'error', message: err }); |
| | | }); |
| | | } else { |
| | | addTeam(this.depart) |
| | | .then(() => { |
| | | this.$message({ type: 'success', message: '操作成功' }); |
| | | this.$emit('closeUpdateDialog'); |
| | | }) |
| | | .catch(err => { |
| | | this.$message({ type: 'error', message: err }); |
| | | }); |
| | | } |
| | | } else { |
| | | this.$message({ type: 'warning', message: '请检查必填项' }); |
| | | } |
| | |
| | | this.$emit('closeUpdateDialog'); |
| | | } |
| | | }, |
| | | props: ['updateDepartmentData'] |
| | | props: ['updateDepartmentData', 'isUpdate'] |
| | | }; |
| | | </script> |
| | | <style lang="scss" scoped> |