From 9f0421ca359101cfc56786b80cc5111932796da3 Mon Sep 17 00:00:00 2001
From: Administrator <admin>
Date: Fri, 20 Aug 2021 14:10:05 +0800
Subject: [PATCH] Merge branch 'master' of http://192.168.0.105:10010/r/zhba_enterprises
---
src/views/talk/talk.vue | 498 +++++++++++++++++++++++++++++++------------------------
1 files changed, 279 insertions(+), 219 deletions(-)
diff --git a/src/views/talk/talk.vue b/src/views/talk/talk.vue
index 5a14376..887de35 100644
--- a/src/views/talk/talk.vue
+++ b/src/views/talk/talk.vue
@@ -1,30 +1,44 @@
<template>
<basic-container>
- <avue-crud :option="option"
- :table-loading="loading"
- :data="data"
- :page.sync="page"
- :permission="permissionList"
- :before-open="beforeOpen"
- 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">
+ <avue-crud
+ :option="option"
+ :table-loading="loading"
+ :data="data"
+ :page.sync="page"
+ :permission="permissionList"
+ :before-open="beforeOpen"
+ 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
+ type="danger"
+ size="small"
+ icon="el-icon-delete"
+ plain
+ v-if="permission.talk_delete"
+ @click="handleDelete"
+ >删 除
</el-button>
</template>
</avue-crud>
@@ -32,235 +46,281 @@
</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() {
- return {
- 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,
- index: true,
- viewBtn: true,
- selection: true,
- dialogClickModal: false,
- column: [
- {
- label: "标题",
- prop: "title",
- search: true,
- rules: [{
+export default {
+ data() {
+ var id = this.$store.getters.userInfo.dept_id;
+ console.log(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: "谈话对象",
- search: true,
- prop: "realName",
- type: "tree",
- props: {
- label: "realName",
- value: "id",
+ trigger: "blur",
},
- dicUrl: `/api/blade-user/selectInr?deptid=`+this.$store.getters.userInfo.dept_id,
- rules: [{
- required: true,
- message: "请输入谈话对象",
- trigger: "blur"
- }]
- },
- {
- label: "谈话内容",
- prop: "talkcontent",
- rules: [{
+ ],
+ },
+ {
+ 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: [{
+ 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: [{
+ trigger: "blur",
+ },
+ ],
+ },
+ {
+ label: "结论",
+ prop: "conclusion",
+ rules: [
+ {
required: true,
message: "请输入结论",
- trigger: "blur"
- }]
- },
- {
- label: "评价",
- prop: "evaluate",
- rules: [{
+ trigger: "blur",
+ },
+ ],
+ },
+ {
+ label: "评价",
+ prop: "evaluate",
+ rules: [
+ {
required: true,
message: "请输入评价",
- trigger: "blur"
- }]
- },
- ]
- },
- data: []
+ trigger: "blur",
+ },
+ ],
+ },
+ ],
+ },
+ 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),
};
},
- 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(",");
- }
+ ids() {
+ let ids = [];
+ this.selectionList.forEach((ele) => {
+ ids.push(ele.id);
+ });
+ return ids.join(",");
},
- methods: {
- rowSave(row, done, loading) {
- add(row).then(() => {
- row.deptid=this.$store.getters.userInfo.dept_id
+ },
+ methods: {
+ // searchChange(params, done) {
+ // console.log(params);
+ // done();
+ // this.$message.success(JSON.stringify(params));
+ // },
+ rowSave(row, done, loading) {
+ 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);
- });
- },
- rowUpdate(row, index, done, loading) {
- update(row).then(() => {
+ }
+ );
+ },
+ rowUpdate(row, index, done, loading) {
+ update(row).then(
+ () => {
this.onLoad(this.page);
this.$message({
type: "success",
- message: "操作成功!"
+ message: "操作成功!",
});
done();
- }, error => {
+ },
+ (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: "操作成功!",
+ });
});
- },
- rowDel(row) {
- this.$confirm("确定将选择数据删除?", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning"
+ },
+ handleDelete() {
+ if (this.selectionList.length === 0) {
+ this.$message.warning("请选择至少一条数据");
+ return;
+ }
+ this.$confirm("确定将选择数据删除?", {
+ confirmButtonText: "确定",
+ cancelButtonText: "取消",
+ type: "warning",
+ })
+ .then(() => {
+ return remove(this.ids);
})
- .then(() => {
- return remove(row.id);
- })
- .then(() => {
- this.onLoad(this.page);
- this.$message({
- type: "success",
- message: "操作成功!"
- });
+ .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) {
- this.query = params;
- this.page.currentPage = 1;
- this.onLoad(this.page, params);
- done();
- },
- 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;
- 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;
- this.loading = false;
- this.selectionClear();
+ 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>
+<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>
--
Gitblit v1.9.3