| | |
| | | <template> |
| | | <basic-container> |
| | | <basic-container |
| | | :class="[ |
| | | $store.state.control.screenSize == 1366 ? 'smallSize' : 'normalSize', |
| | | $store.state.control.windowWidth >= 1024 ? 'tooRowSearch1' : '' |
| | | ]" |
| | | > |
| | | <avue-crud |
| | | class="tablesss" |
| | | :option="option" |
| | | :table-loading="loading" |
| | | :data="data" |
| | |
| | | @refresh-change="refreshChange" |
| | | @on-load="onLoad" |
| | | > |
| | | <template slot-scope="{ disabled, size }" slot="realNameSearch"> |
| | | <!-- <template slot-scope="{ disabled, size }" slot="realNameSearch"> |
| | | <el-input |
| | | placeholder="姓名" |
| | | :disabled="disabled" |
| | |
| | | v-on:input="inputs(findName)" |
| | | v-model="findName" |
| | | ></el-input> |
| | | </template> |
| | | </template> --> |
| | | <template slot="menuLeft"> |
| | | <el-button |
| | | type="danger" |
| | |
| | | plain |
| | | v-if="permission.talk_delete" |
| | | @click="handleDelete" |
| | | >删 除 |
| | | >删 除 |
| | | </el-button> |
| | | </template> |
| | | </avue-crud> |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | import {getList, getDetail, add, update, remove} from "@/api/talk/talk"; |
| | | import {mapGetters} from "vuex"; |
| | | import { getList, getDetail, add, update, remove } from "@/api/talk/talk"; |
| | | import { mapGetters } from "vuex"; |
| | | |
| | | export default { |
| | | data() { |
| | |
| | | pageSize: 10, |
| | | currentPage: 1, |
| | | total: 0, |
| | | ...this.$store.state.control.changePageSize |
| | | }, |
| | | selectionList: [], |
| | | option: { |
| | |
| | | index: true, |
| | | viewBtn: true, |
| | | selection: true, |
| | | // menu: false, |
| | | dialogClickModal: false, |
| | | ...this.$store.state.control.clearOtherBut, |
| | | column: [ |
| | | { |
| | | label: "标题", |
| | |
| | | { |
| | | required: true, |
| | | message: "请输入标题", |
| | | trigger: "blur", |
| | | }, |
| | | ], |
| | | trigger: "blur" |
| | | } |
| | | ] |
| | | }, |
| | | { |
| | | label: "谈话对象", |
| | | prop: "realName", |
| | | search: true, |
| | | // type: "tree", |
| | | searchslot: true, |
| | | // searchslot: true, |
| | | // dicUrl: `/api/blade-user/selectInr?deptid=` + id, |
| | | // props: { |
| | | // label: "realName", |
| | | // value: "id", |
| | | // }, |
| | | // rules: [ |
| | | // { |
| | | // required: true, |
| | | // message: "请输入谈话对象", |
| | | // trigger: "blur", |
| | | // }, |
| | | // ], |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: "请输入谈话对象", |
| | | trigger: "blur" |
| | | } |
| | | ] |
| | | }, |
| | | { |
| | | label: "谈话内容", |
| | |
| | | { |
| | | required: true, |
| | | message: "请输入谈话内容", |
| | | trigger: "blur", |
| | | }, |
| | | ], |
| | | trigger: "blur" |
| | | } |
| | | ] |
| | | }, |
| | | { |
| | | label: "谈话时间", |
| | |
| | | { |
| | | required: true, |
| | | message: "请输入谈话时间", |
| | | trigger: "blur", |
| | | }, |
| | | ], |
| | | trigger: "blur" |
| | | } |
| | | ] |
| | | }, |
| | | { |
| | | label: "结论", |
| | |
| | | { |
| | | required: true, |
| | | message: "请输入结论", |
| | | trigger: "blur", |
| | | }, |
| | | ], |
| | | trigger: "blur" |
| | | } |
| | | ] |
| | | }, |
| | | { |
| | | label: "评价", |
| | |
| | | { |
| | | required: true, |
| | | message: "请输入评价", |
| | | trigger: "blur", |
| | | }, |
| | | ], |
| | | trigger: "blur" |
| | | } |
| | | ] |
| | | }, |
| | | { |
| | | label: '图片', |
| | | prop: 'imgurl', |
| | | label: "图片", |
| | | prop: "imgurl", |
| | | // dataType: 'string', |
| | | type: 'upload', |
| | | type: "upload", |
| | | propsHttp: { |
| | | res: 'data' |
| | | res: "data" |
| | | }, |
| | | span: 24, |
| | | listType: 'picture-card', |
| | | tip: '只能上传jpg/png文件,且不超过500kb', |
| | | action: '/api/blade-resource/oss/endpoint/put-files-talk?file=' |
| | | }, |
| | | ], |
| | | listType: "picture-card", |
| | | tip: "只能上传jpg/png文件,且不超过500kb", |
| | | action: "/api/blade-resource/oss/endpoint/put-files-talk?file=" |
| | | } |
| | | ] |
| | | }, |
| | | data: [], |
| | | data: [] |
| | | }; |
| | | }, |
| | | computed: { |
| | |
| | | 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), |
| | | editBtn: this.vaildData(this.permission.talk_edit, false) |
| | | }; |
| | | }, |
| | | ids() { |
| | | let ids = []; |
| | | this.selectionList.forEach((ele) => { |
| | | this.selectionList.forEach(ele => { |
| | | ids.push(ele.id); |
| | | }); |
| | | return ids.join(","); |
| | | }, |
| | | } |
| | | }, |
| | | mounted() { |
| | | this.$store.commit("setWindowSizeHeightAdd"); |
| | | }, |
| | | methods: { |
| | | // searchChange(params, done) { |
| | | // console.log(params); |
| | | // done(); |
| | | // this.$message.success(JSON.stringify(params)); |
| | | // }, |
| | | searchChange(params, done) { |
| | | // console.log(params); |
| | | this.onLoad(this.page, params); |
| | | done(); |
| | | }, |
| | | |
| | | rowSave(row, done, loading) { |
| | | var d = []; |
| | | for (var k in row.imgurl) { |
| | | d.push(row.imgurl[k].value); |
| | | } |
| | | row.imgurl = d.join(','); |
| | | row.imgurl = d.join(","); |
| | | row.deptid = this.$store.getters.userInfo.dept_id; |
| | | add(row).then( |
| | | () => { |
| | | row.deptid = this.$store.getters.userInfo.dept_id; |
| | | this.onLoad(this.page); |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!", |
| | | message: "操作成功!" |
| | | }); |
| | | done(); |
| | | }, |
| | | (error) => { |
| | | error => { |
| | | loading(); |
| | | window.console.log(error); |
| | | } |
| | |
| | | this.onLoad(this.page); |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!", |
| | | message: "操作成功!" |
| | | }); |
| | | done(); |
| | | }, |
| | | (error) => { |
| | | error => { |
| | | loading(); |
| | | console.log(error); |
| | | } |
| | |
| | | this.$confirm("确定将选择数据删除?", { |
| | | confirmButtonText: "确定", |
| | | cancelButtonText: "取消", |
| | | type: "warning", |
| | | type: "warning" |
| | | }) |
| | | .then(() => { |
| | | return remove(row.id); |
| | |
| | | this.onLoad(this.page); |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!", |
| | | message: "操作成功!" |
| | | }); |
| | | }); |
| | | }, |
| | |
| | | this.$confirm("确定将选择数据删除?", { |
| | | confirmButtonText: "确定", |
| | | cancelButtonText: "取消", |
| | | type: "warning", |
| | | type: "warning" |
| | | }) |
| | | .then(() => { |
| | | return remove(this.ids); |
| | |
| | | this.onLoad(this.page); |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!", |
| | | message: "操作成功!" |
| | | }); |
| | | this.$refs.crud.toggleSelection(); |
| | | }); |
| | | }, |
| | | beforeOpen(done, type) { |
| | | if (["edit", "view"].includes(type)) { |
| | | getDetail(this.form.id).then((res) => { |
| | | getDetail(this.form.id).then(res => { |
| | | this.form = res.data.data; |
| | | }); |
| | | } |
| | |
| | | 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; |
| | |
| | | this.onLoad(this.page, this.query); |
| | | }, |
| | | onLoad(page, params = {}) { |
| | | if(this.userInfo.role_name == "公安管理员" || this.userInfo.role_name == "民警" || this.userInfo.role_name == "administrator"){ |
| | | params["jurisdiction"] = this.userInfo.jurisdiction; |
| | | }else{ |
| | | params["deptid"] = this.userInfo.dept_id; |
| | | } |
| | | this.loading = true; |
| | | // console.log(1); |
| | | getList( |
| | | page.currentPage, |
| | | page.pageSize, |
| | | Object.assign(params, this.query) |
| | | ).then((res) => { |
| | | ).then(res => { |
| | | const data = res.data.data; |
| | | this.page.total = data.total; |
| | | this.data = data.records; |
| | | console.log(this.data); |
| | | this.loading = false; |
| | | this.$store.commit("setWindowSizeHeightAdd"); |
| | | this.selectionClear(); |
| | | }); |
| | | }, |
| | | }, |
| | | } |
| | | } |
| | | }; |
| | | </script> |
| | | |