Merge branch 'master' of http://192.168.0.105:10010/r/zhba_regulatory
2 files modified
2 files added
| New file |
| | |
| | | import request from '@/router/axios'; |
| | | |
| | | export const getList = (current, size, params) => { |
| | | return request({ |
| | | url: '/api/blade-talk/talk/page', |
| | | method: 'get', |
| | | params: { |
| | | ...params, |
| | | current, |
| | | size, |
| | | } |
| | | }) |
| | | } |
| | | |
| | | export const getDetail = (id) => { |
| | | return request({ |
| | | url: '/api/blade-talk/talk/detail', |
| | | method: 'get', |
| | | params: { |
| | | id |
| | | } |
| | | }) |
| | | } |
| | | |
| | | export const remove = (ids) => { |
| | | return request({ |
| | | url: '/api/blade-talk/talk/remove', |
| | | method: 'post', |
| | | params: { |
| | | ids, |
| | | } |
| | | }) |
| | | } |
| | | |
| | | export const add = (row) => { |
| | | return request({ |
| | | url: '/api/blade-talk/talk/save', |
| | | method: 'post', |
| | | data: row |
| | | }) |
| | | } |
| | | |
| | | export const update = (row) => { |
| | | return request({ |
| | | url: '/api/blade-talk/talk/update', |
| | | method: 'post', |
| | | data: row |
| | | }) |
| | | } |
| | | |
| | |
| | | :key="gridData.type" |
| | | prop="punishtype" |
| | | label="处罚类别" |
| | | :formatter="punishType" |
| | | :show-overflow-tooltip="true" |
| | | width="150" |
| | | ></el-table-column> |
| | |
| | | return "正常"; |
| | | } |
| | | }, |
| | | punishType(row) { |
| | | if (row.punishtype === "0") { |
| | | return "警告"; |
| | | } else if (row.punishtype === "1") { |
| | | return "罚款"; |
| | | }else if (row.punishtype === "2") { |
| | | return "没收违法所得"; |
| | | }else if (row.punishtype === "3") { |
| | | return "没收非法财物"; |
| | | }else if (row.punishtype === "4") { |
| | | return "责令停止施工"; |
| | | }else if (row.punishtype === "5") { |
| | | return "责令停止使用"; |
| | | }else if (row.punishtype === "6") { |
| | | return "责令停止违法行为"; |
| | | }else if (row.punishtype === "7") { |
| | | return "责令停业"; |
| | | } |
| | | }, |
| | | |
| | | // 左侧表的接口返回数据 |
| | | initEchart() { |
| | |
| | | viewBtn: true, |
| | | dialogClickModal: false, |
| | | column: [ |
| | | { |
| | | label: "公司名称", |
| | | prop: "gsname", |
| | | // search: true, |
| | | // searchSpan: 4, |
| | | display: false |
| | | }, |
| | | // { |
| | | // label: "公司名称", |
| | | // prop: "gsname", |
| | | // // search: true, |
| | | // // searchSpan: 4, |
| | | // display: false |
| | | // }, |
| | | |
| | | { |
| | | label: "所属辖区", |
| | | prop: "jurname", |
| | | searchSpan: 4, |
| | | props: { |
| | | label: "title", |
| | | value: "id" |
| | | }, |
| | | // cascaderItem: ["city", "area"], |
| | | // dicUrl:subofficeOptions, |
| | | dicData: [], |
| | | search: true, |
| | | type: "tree", |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: "请选择所属辖区", |
| | | trigger: "blur" |
| | | } |
| | | ] |
| | | }, |
| | | { |
| | | label: "服务开始时间", |
| | | prop: "dispatcherTime", |
| | | display: false |
| | | }, |
| | | { |
| | | label: "服务到期时间", |
| | | prop: "end_time", |
| | | display: false |
| | | }, |
| | | // { |
| | | // label: "所属辖区", |
| | | // prop: "jurname", |
| | | // searchSpan: 4, |
| | | // props: { |
| | | // label: "title", |
| | | // value: "id" |
| | | // }, |
| | | // // cascaderItem: ["city", "area"], |
| | | // // dicUrl:subofficeOptions, |
| | | // dicData: [], |
| | | // search: true, |
| | | // type: "tree", |
| | | // rules: [ |
| | | // { |
| | | // required: true, |
| | | // message: "请选择所属辖区", |
| | | // trigger: "blur" |
| | | // } |
| | | // ] |
| | | // }, |
| | | { |
| | | label: "服务单位名称", |
| | | prop: "fwname", |
| | | prop: "name", |
| | | props: { |
| | | label: "name", |
| | | value: "id" |
| | |
| | | // display: false |
| | | }, |
| | | { |
| | | label: "保安派遣人数", |
| | | prop: "num", |
| | | label: "服务开始时间", |
| | | prop: "startTime", |
| | | display: false |
| | | }, |
| | | { |
| | | label: "服务到期时间", |
| | | prop: "endTime", |
| | | display: false |
| | | }, |
| | | // { |
| | | // label: "保安派遣人数", |
| | | // prop: "num", |
| | | // display: false |
| | | // }, |
| | | { |
| | | label: "联系人", |
| | | prop: "linkman", |
| | | display: false |
| | | }, |
| | | { |
| | | label: "联系电话", |
| | | prop: "phone", |
| | | display: false |
| | | } |
| | | // { |
| | |
| | | this.loading = true; |
| | | let param = {}; |
| | | // param["jurisdiction"] = params["jurname"] || ""; |
| | | // param["fid"] = params["fwname"] || ""; |
| | | param["id"] = params["name"] || ""; |
| | | param["deptId"] = this.deptid; |
| | | param["current"] = page.currentPage; |
| | | param["size"] = page.pageSize; |
| New file |
| | |
| | | <template> |
| | | <basic-container> |
| | | <avue-crud |
| | | :option="option" |
| | | :table-loading="loading" |
| | | :data="data" |
| | | :page.sync="page" |
| | | :permission="permissionList" |
| | | :before-open="beforeOpen" |
| | | :upload-preview="uploadPreview" |
| | | :upload-error="uploadError" |
| | | :upload-exceed="uploadExceed" |
| | | :upload-delete="uploadDelete" |
| | | :upload-before="uploadBefore" |
| | | :upload-after="uploadAfter" |
| | | v-model="form" |
| | | ref="crud" |
| | | @row-update="rowUpdate" |
| | | @row-save="rowSave" |
| | | @row-del="rowDel" |
| | | @search-change="searchChange" |
| | | @search-reset="searchReset" |
| | | @selection-change="selectionChange" |
| | | @current-change="currentChange" |
| | | @size-change="sizeChange" |
| | | @refresh-change="refreshChange" |
| | | @on-load="onLoad" |
| | | > |
| | | <template slot-scope="{ disabled, size }" slot="realNameSearch"> |
| | | <el-input |
| | | placeholder="姓名" |
| | | :disabled="disabled" |
| | | :size="size" |
| | | style="width: 200px" |
| | | v-on:input="inputs(findName)" |
| | | v-model="findName" |
| | | ></el-input> |
| | | </template> |
| | | <template slot="menuLeft"> |
| | | <el-button |
| | | type="danger" |
| | | size="small" |
| | | icon="el-icon-delete" |
| | | plain |
| | | v-if="permission.talk_delete" |
| | | @click="handleDelete" |
| | | >删 除 |
| | | </el-button> |
| | | </template> |
| | | </avue-crud> |
| | | </basic-container> |
| | | </template> |
| | | |
| | | <script> |
| | | import {getList, getDetail, add, update, remove} from "@/api/talk/talk"; |
| | | import {mapGetters} from "vuex"; |
| | | |
| | | export default { |
| | | data() { |
| | | var id = this.$store.getters.userInfo.dept_id; |
| | | return { |
| | | findName: "", |
| | | form: {}, |
| | | query: {}, |
| | | loading: true, |
| | | page: { |
| | | pageSize: 10, |
| | | currentPage: 1, |
| | | total: 0, |
| | | }, |
| | | selectionList: [], |
| | | option: { |
| | | height: "auto", |
| | | calcHeight: 30, |
| | | tip: false, |
| | | searchShow: true, |
| | | searchMenuSpan: 6, |
| | | border: true, |
| | | searchShowBtn: false, |
| | | index: true, |
| | | viewBtn: true, |
| | | selection: true, |
| | | dialogClickModal: false, |
| | | column: [ |
| | | { |
| | | label: "标题", |
| | | prop: "title", |
| | | search: true, |
| | | searchLabelWidth: 45, |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: "请输入标题", |
| | | trigger: "blur", |
| | | }, |
| | | ], |
| | | }, |
| | | { |
| | | label: "谈话对象", |
| | | prop: "realName", |
| | | search: true, |
| | | // type: "tree", |
| | | searchslot: true, |
| | | // dicUrl: `/api/blade-user/selectInr?deptid=` + id, |
| | | // props: { |
| | | // label: "realName", |
| | | // value: "id", |
| | | // }, |
| | | // rules: [ |
| | | // { |
| | | // required: true, |
| | | // message: "请输入谈话对象", |
| | | // trigger: "blur", |
| | | // }, |
| | | // ], |
| | | }, |
| | | { |
| | | label: "谈话内容", |
| | | prop: "talkcontent", |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: "请输入谈话内容", |
| | | trigger: "blur", |
| | | }, |
| | | ], |
| | | }, |
| | | { |
| | | label: "谈话时间", |
| | | prop: "talktime", |
| | | type: "date", |
| | | format: "yyyy-MM-dd hh:mm:ss", |
| | | valueFormat: "yyyy-MM-dd hh:mm:ss", |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: "请输入谈话时间", |
| | | trigger: "blur", |
| | | }, |
| | | ], |
| | | }, |
| | | { |
| | | label: "结论", |
| | | prop: "conclusion", |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: "请输入结论", |
| | | trigger: "blur", |
| | | }, |
| | | ], |
| | | }, |
| | | { |
| | | label: "评价", |
| | | prop: "evaluate", |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: "请输入评价", |
| | | trigger: "blur", |
| | | }, |
| | | ], |
| | | }, |
| | | { |
| | | label: '图片', |
| | | prop: 'imgurl', |
| | | // dataType: 'string', |
| | | type: 'upload', |
| | | propsHttp: { |
| | | res: 'data' |
| | | }, |
| | | span: 24, |
| | | listType: 'picture-card', |
| | | tip: '只能上传jpg/png文件,且不超过500kb', |
| | | action: '/api/blade-resource/oss/endpoint/put-files-talk?file=' |
| | | }, |
| | | ], |
| | | }, |
| | | data: [], |
| | | }; |
| | | }, |
| | | computed: { |
| | | ...mapGetters(["permission", "userInfo"]), |
| | | permissionList() { |
| | | return { |
| | | addBtn: this.vaildData(this.permission.talk_add, false), |
| | | viewBtn: this.vaildData(this.permission.talk_view, false), |
| | | delBtn: this.vaildData(this.permission.talk_delete, false), |
| | | editBtn: this.vaildData(this.permission.talk_edit, false), |
| | | }; |
| | | }, |
| | | ids() { |
| | | let ids = []; |
| | | this.selectionList.forEach((ele) => { |
| | | ids.push(ele.id); |
| | | }); |
| | | return ids.join(","); |
| | | }, |
| | | }, |
| | | methods: { |
| | | // searchChange(params, done) { |
| | | // console.log(params); |
| | | // done(); |
| | | // this.$message.success(JSON.stringify(params)); |
| | | // }, |
| | | |
| | | rowSave(row, done, loading) { |
| | | var d = []; |
| | | for (var k in row.imgurl) { |
| | | d.push(row.imgurl[k].value); |
| | | } |
| | | row.imgurl = d.join(','); |
| | | row.deptid = this.$store.getters.userInfo.dept_id; |
| | | add(row).then( |
| | | () => { |
| | | this.onLoad(this.page); |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!", |
| | | }); |
| | | done(); |
| | | }, |
| | | (error) => { |
| | | loading(); |
| | | window.console.log(error); |
| | | } |
| | | ); |
| | | }, |
| | | rowUpdate(row, index, done, loading) { |
| | | update(row).then( |
| | | () => { |
| | | this.onLoad(this.page); |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!", |
| | | }); |
| | | done(); |
| | | }, |
| | | (error) => { |
| | | loading(); |
| | | console.log(error); |
| | | } |
| | | ); |
| | | }, |
| | | rowDel(row) { |
| | | this.$confirm("确定将选择数据删除?", { |
| | | confirmButtonText: "确定", |
| | | cancelButtonText: "取消", |
| | | type: "warning", |
| | | }) |
| | | .then(() => { |
| | | return remove(row.id); |
| | | }) |
| | | .then(() => { |
| | | this.onLoad(this.page); |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!", |
| | | }); |
| | | }); |
| | | }, |
| | | handleDelete() { |
| | | if (this.selectionList.length === 0) { |
| | | this.$message.warning("请选择至少一条数据"); |
| | | return; |
| | | } |
| | | this.$confirm("确定将选择数据删除?", { |
| | | confirmButtonText: "确定", |
| | | cancelButtonText: "取消", |
| | | type: "warning", |
| | | }) |
| | | .then(() => { |
| | | return remove(this.ids); |
| | | }) |
| | | .then(() => { |
| | | this.onLoad(this.page); |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!", |
| | | }); |
| | | this.$refs.crud.toggleSelection(); |
| | | }); |
| | | }, |
| | | beforeOpen(done, type) { |
| | | if (["edit", "view"].includes(type)) { |
| | | getDetail(this.form.id).then((res) => { |
| | | this.form = res.data.data; |
| | | }); |
| | | } |
| | | done(); |
| | | }, |
| | | searchReset() { |
| | | this.query = {}; |
| | | this.onLoad(this.page); |
| | | }, |
| | | searchChange(params, done) { |
| | | console.log(params); |
| | | // this.query = params; |
| | | // this.page.currentPage = 1; |
| | | // this.onLoad(this.page, params); |
| | | done(); |
| | | }, |
| | | inputs(val) { |
| | | console.log(val); |
| | | }, |
| | | selectionChange(list) { |
| | | this.selectionList = list; |
| | | }, |
| | | selectionClear() { |
| | | this.selectionList = []; |
| | | this.$refs.crud.toggleSelection(); |
| | | }, |
| | | currentChange(currentPage) { |
| | | this.page.currentPage = currentPage; |
| | | }, |
| | | sizeChange(pageSize) { |
| | | this.page.pageSize = pageSize; |
| | | }, |
| | | refreshChange() { |
| | | this.onLoad(this.page, this.query); |
| | | }, |
| | | onLoad(page, params = {}) { |
| | | this.loading = true; |
| | | // console.log(1); |
| | | getList( |
| | | page.currentPage, |
| | | page.pageSize, |
| | | Object.assign(params, this.query) |
| | | ).then((res) => { |
| | | const data = res.data.data; |
| | | this.page.total = data.total; |
| | | this.data = data.records; |
| | | console.log(this.data); |
| | | this.loading = false; |
| | | this.selectionClear(); |
| | | }); |
| | | }, |
| | | }, |
| | | }; |
| | | </script> |
| | | |
| | | <style lang="scss" scoped> |
| | | .avue-form__menu--center .el-button { |
| | | float: left !important; |
| | | } |
| | | |
| | | .avue-form__menu--center .el-button:nth-child(1) { |
| | | margin-left: 30px !important; |
| | | } |
| | | </style> |