From 0411b19ca8bd385338f313433c63d8d027398237 Mon Sep 17 00:00:00 2001
From: shuishen <1109946754@qq.com>
Date: Tue, 09 Jan 2024 18:53:50 +0800
Subject: [PATCH] 共治力量下页面调整
---
src/views/property/partyOrganization.vue | 912 +++++++++++++-------------
src/views/grid/gridman.vue | 14
src/views/gzll/owners.vue | 77 +-
src/views/property/propertyCompany.vue | 1014 ++++++++++++++---------------
4 files changed, 1,010 insertions(+), 1,007 deletions(-)
diff --git a/src/views/grid/gridman.vue b/src/views/grid/gridman.vue
index 8509b4d..fe6eac5 100644
--- a/src/views/grid/gridman.vue
+++ b/src/views/grid/gridman.vue
@@ -32,13 +32,16 @@
datetime: "",
selectionList: [],
option: {
+ labelWidth: 96,
+ searchLabelWidth: 96,
+ searchShow: true,
+ searchMenuSpan: 3,
+ menuWidth: 210,
+
height: "auto",
calcHeight: 54,
dialogWidth: 950,
tip: false,
- searchShow: true,
- searchMenuSpan: 3,
- menuWidth: 350,
border: true,
//stripe:true,
index: true,
@@ -105,6 +108,7 @@
},
{
+ width: 120,
label: "联系电话",
prop: "mobile",
searchSpan: 4,
@@ -119,7 +123,6 @@
},
{
- width: 156,
overHidden: true,
label: "所属社区",
addDisplay: false,
@@ -136,7 +139,6 @@
},
{
- width: 110,
overHidden: true,
label: "所属网格",
addDisplay: false,
@@ -151,9 +153,9 @@
},
{
+ width: 110,
label: "形象照",
prop: "picUrl",
- width: 80,
type: "upload",
listType: "picture-img",
action: "/api/blade-resource/oss/endpoint/put-file-attach",
diff --git a/src/views/gzll/owners.vue b/src/views/gzll/owners.vue
index 1ddf494..35b7f53 100644
--- a/src/views/gzll/owners.vue
+++ b/src/views/gzll/owners.vue
@@ -10,6 +10,11 @@
@click="manageMember(scope.row)">业委会成员
</el-button>
</template>
+
+ <template slot-scope="{ row, size }" slot="status">
+ <el-tag :size="size" :type="showStatus(row.status).type" v-text="showStatus(row.status).text">
+ </el-tag>
+ </template>
</avue-crud>
<el-drawer title="业委会成员" size="40%" append-to-body :visible.sync="memberFlag" :direction="'rtl'">
@@ -51,6 +56,12 @@
selectionList: [],
memberFlag: false,
option: {
+ labelWidth: 120,
+ searchLabelWidth: 96,
+ searchShow: true,
+ searchMenuSpan: 3,
+ menuWidth: 300,
+
// menu: false,
// addBtn: false,
border: true,
@@ -60,8 +71,6 @@
calcHeight: 54,
dialogWidth: 950,
tip: false,
- searchShow: true,
- searchMenuSpan: 3,
//stripe:true,
viewBtn: true,
excelBtn: true,
@@ -80,8 +89,6 @@
},
defaultExpandedKeys: ["361102003"],
cascader: ['principalId'],
- span: 10,
- labelWidth: 120,
overHidden: true,
rules: [{
required: true,
@@ -91,13 +98,12 @@
},
{
- span: 10,
- labelWidth: 120,
- offset: 2,
+ overHidden: true,
+ width: 120,
label: "业委会名称",
prop: "name",
search: true,
- searchLabelWidth: 136,
+ searchLabelWidth: 124,
rules: [{
required: true,
message: "请输入业委会名称",
@@ -106,8 +112,8 @@
},
{
- width: 220,
overHidden: true,
+ width: 220,
label: '小区名称',
addDisplay: false,
editDisplay: false,
@@ -121,8 +127,6 @@
display: false,
},
{
- span: 10,
- labelWidth: 120,
label: "业委会负责人",
prop: "principalId",
type: "tree",
@@ -141,10 +145,8 @@
},],
},
{
- span: 10,
- labelWidth: 120,
+ width: 120,
label: "负责人名称",
- offset: 2,
prop: "principalName",
rules: [{
required: true,
@@ -153,8 +155,7 @@
},],
},
{
- span: 10,
- labelWidth: 120,
+ width: 120,
label: "负责人手机号",
prop: "mobile",
rules: [{
@@ -165,10 +166,8 @@
},
{
- span: 10,
- labelWidth: 120,
+ width: 120,
label: "业委会届别",
- offset: 2,
prop: "session",
type: "number",
rules: [{
@@ -179,8 +178,7 @@
},
{
- span: 10,
- labelWidth: 120,
+ width: 100,
label: "成立时间",
prop: "establishTime",
type: "date",
@@ -190,14 +188,12 @@
{
span: 20,
- labelWidth: 120,
label: "所在地址",
prop: "location",
},
{
- span: 10,
- labelWidth: 120,
+ width: 124,
label: "任期开始时间",
prop: "startTime",
type: "date",
@@ -211,10 +207,8 @@
},
{
- span: 10,
- labelWidth: 120,
+ width: 124,
label: "任期结束时间",
- offset: 2,
prop: "endTime",
type: "date",
format: "yyyy-MM-dd",
@@ -231,7 +225,6 @@
label: "图片",
prop: "imageUrl",
type: "upload",
- labelWidth: 120,
listType: "picture-img",
action: "/api/blade-resource/oss/endpoint/put-file",
propsHttp: {
@@ -240,12 +233,11 @@
url: "link",
},
viewDisplay: false,
- span: 20,
+ span: 24,
},
{
- span: 10,
- labelWidth: 120,
+ span: 12,
label: "排序",
prop: "sort",
type: 'number',
@@ -257,10 +249,10 @@
},
{
- span: 10,
- labelWidth: 120,
+ width: 100,
+ span: 12,
label: "状态",
- offset: 2,
+ slot: true,
prop: "status",
type: 'switch',
activeColor: "#13ce66",
@@ -284,7 +276,6 @@
{
span: 20,
- labelWidth: 120,
label: "简介",
prop: "profile",
component: "AvueUeditor",
@@ -302,7 +293,6 @@
// {
// label: "简介",
// prop: "profile",
- // // labelWidth: 140,
// viewDisplay: false,
// type: "textarea"
// },
@@ -330,6 +320,21 @@
})
return ids.join(",")
},
+ showStatus () {
+ return (data) => {
+ if (data == 0) {
+ return {
+ text: '正常',
+ type: 'success'
+ }
+ } else {
+ return {
+ text: '关闭',
+ type: 'info'
+ }
+ }
+ }
+ }
},
methods: {
manageMember (row) {
diff --git a/src/views/property/partyOrganization.vue b/src/views/property/partyOrganization.vue
index 4475df4..90983f9 100644
--- a/src/views/property/partyOrganization.vue
+++ b/src/views/property/partyOrganization.vue
@@ -1,478 +1,480 @@
<template>
- <basic-container>
- <avue-crud :option="option" :table-loading="loading" :data="data" :page.sync="page" ref="crud" v-model="form"
- :permission="permissionList" @search-change="searchChange" @search-reset="searchReset"
- @row-update="rowUpdate" @row-save="rowSave" @row-del="rowDel"
- :before-open="beforeOpen"
- @selection-change="selectionChange" @current-change="currentChange" @size-change="sizeChange"
- @refresh-change="refreshChange" @on-load="onLoad">
+ <basic-container>
+ <avue-crud :option="option" :table-loading="loading" :data="data" :page.sync="page" ref="crud" v-model="form"
+ :permission="permissionList" @search-change="searchChange" @search-reset="searchReset" @row-update="rowUpdate"
+ @row-save="rowSave" @row-del="rowDel" :before-open="beforeOpen" @selection-change="selectionChange"
+ @current-change="currentChange" @size-change="sizeChange" @refresh-change="refreshChange" @on-load="onLoad">
- <template slot-scope="{row}" slot="phone">
- <el-button type="text" @click="showStringDispose(row, 'phoneNumberflag')">
- {{ textDispose(row, 'phoneNumberflag', 'phone') }}
- </el-button>
- </template>
+ <template slot-scope="{row, size}" slot="phone">
+ <el-button :size="size" type="text" @click="showStringDispose(row, 'phoneNumberflag')">
+ {{ textDispose(row, 'phoneNumberflag', 'phone') }}
+ </el-button>
+ </template>
- <template slot-scope="scope" slot="menu">
- <el-button type="text" icon="el-icon-circle-plus-outline" size="small"
- @click="manageMember(scope.row)">党成员
- </el-button>
- </template>
- </avue-crud>
+ <template slot-scope="{row, size, index}" slot="menu">
+ <el-button :size="size" type="text" icon="el-icon-circle-plus-outline" @click="manageMember(row)">党成员
+ </el-button>
+ </template>
+ </avue-crud>
- <el-drawer title="党成员" size="60%" append-to-body :visible.sync="memberFlag" :direction="'rtl'">
- <PartyOrganizationMember ref="partyOrganizationMember" />
- </el-drawer>
-
- </basic-container>
+ <el-drawer title="党成员" size="60%" append-to-body :visible.sync="memberFlag" :direction="'rtl'">
+ <PartyOrganizationMember ref="partyOrganizationMember" />
+ </el-drawer>
+ </basic-container>
</template>
<script>
-import {mapGetters} from "vuex";
-import {getDetail,getList,add,update,remove} from "@/api/partyOrganization/partyOrganization";
-import website from "@/config/website";
-import func from "@/util/func";
-import {validatePhone} from "@/util/validate";
-import PartyOrganizationMember from "@/views/property/components/partyOrganizationMember.vue";
+import { mapGetters } from "vuex"
+import { getDetail, getList, add, update, remove } from "@/api/partyOrganization/partyOrganization"
+import website from "@/config/website"
+import func from "@/util/func"
+import { validatePhone } from "@/util/validate"
+import PartyOrganizationMember from "@/views/property/components/partyOrganizationMember.vue"
const searchSpan = 4
export default {
- name: "partyOrganization",
- components: {PartyOrganizationMember},
- data () {
- return {
- form: {},
- query: {},
- loading: true,
- page: {
- pageSize: 10,
- currentPage: 1,
- total: 0,
- },
- datetime: "",
- selectionList: [],
- memberFlag: false,
- option: {
- // menu: false,
- // addBtn: false,
- border: true,
- index: true,
- selection: false,
- height: "auto",
- calcHeight: 54,
- dialogWidth: 950,
- tip: false,
- searchShow: true,
- searchMenuSpan: 3,
- //stripe:true,
- viewBtn: true,
- excelBtn: true,
- dialogClickModal: false,
- column: [
- {
- parent: false,
- label: "所属社区",
- prop: "areaId",
- search: true,
- searchSpan: searchSpan,
- width: 150,
- type: "tree",
- dicUrl: "/api/blade-system/region/tree",
- props: {
- label: "name",
- value: "id"
+ name: "partyOrganization",
+ components: { PartyOrganizationMember },
+ data () {
+ return {
+ form: {},
+ query: {},
+ loading: true,
+ page: {
+ pageSize: 10,
+ currentPage: 1,
+ total: 0,
},
- rules: [
- {
- required: true,
- message: "请选择所属社区",
- trigger: ["blur","change"]
- },
- ],
- },
+ datetime: "",
+ selectionList: [],
+ memberFlag: false,
+ option: {
+ labelWidth: 120,
+ searchLabelWidth: 96,
+ searchShow: true,
+ searchMenuSpan: 3,
+ menuWidth: 280,
- {
- label: "组织名称",
- prop: "organizationName",
- searchSpan: searchSpan,
- search: true,
- rules: [{
- required: true,
- message: "请输入组织名称",
- trigger: ["blur","change"]
- },],
- },
+ // menu: false,
+ // addBtn: false,
+ border: true,
+ index: true,
+ selection: false,
+ height: "auto",
+ calcHeight: 54,
+ dialogWidth: 950,
+ tip: false,
+ //stripe:true,
+ viewBtn: true,
+ excelBtn: true,
+ dialogClickModal: false,
+ column: [
+ {
+ parent: false,
+ label: "所属社区",
+ prop: "areaId",
+ search: true,
+ searchSpan: searchSpan,
+ width: 150,
+ type: "tree",
+ dicUrl: "/api/blade-system/region/tree",
+ props: {
+ label: "name",
+ value: "id"
+ },
+ rules: [
+ {
+ required: true,
+ message: "请选择所属社区",
+ trigger: ["blur", "change"]
+ },
+ ],
+ },
- {
- label: "组织类型",
- prop: "organizationType",
- checkStrictly: true,
- hide:true,
- dicUrl: "/api/blade-system/dict-biz/dictionary?code=organizationType",
- props: {
- label: "dictValue",
- value: "dictKey",
+ {
+ label: "组织名称",
+ prop: "organizationName",
+ searchSpan: searchSpan,
+ search: true,
+ rules: [{
+ required: true,
+ message: "请输入组织名称",
+ trigger: ["blur", "change"]
+ },],
+ },
+
+ {
+ label: "组织类型",
+ prop: "organizationType",
+ checkStrictly: true,
+ hide: true,
+ dicUrl: "/api/blade-system/dict-biz/dictionary?code=organizationType",
+ props: {
+ label: "dictValue",
+ value: "dictKey",
+ },
+ type: "select",
+ rules: [{
+ required: true,
+ message: "请选择组织类型",
+ trigger: ["blur", "change"]
+ },],
+ },
+
+ {
+ label: "支部类型",
+ prop: "branchType",
+ checkStrictly: true,
+ dicUrl: "/api/blade-system/dict-biz/dictionary?code=branchType",
+ props: {
+ label: "dictValue",
+ value: "dictKey",
+ },
+ type: "select",
+ rules: [{
+ required: true,
+ message: "请选择支部类型",
+ trigger: ["blur", "change"]
+ },],
+ },
+
+ {
+ width: 110,
+ label: "负责人",
+ prop: "chargePerson",
+ rules: [{
+ required: true,
+ message: "请输入负责人",
+ trigger: ["blur", "change"]
+ }]
+ },
+ {
+ width: 110,
+ label: "姓名",
+ prop: "name",
+ searchSpan: searchSpan,
+ searchLabelWidth: 66,
+ searchPlaceholder: "请输入负责人或党成员",
+ hide: true,
+ display: false,
+ search: true
+ },
+ {
+ width: 120,
+ label: "手机号",
+ prop: "phone",
+ slot: true,
+ rules: [{
+ required: true,
+ message: "请输入手机号",
+ validator: validatePhone,
+ trigger: ["blur", "change"],
+ }]
+ },
+
+ {
+ label: "成立时间",
+ prop: "establishmentDate",
+ hide: true,
+ type: "date",
+ format: "yyyy-MM-dd",
+ valueFormat: "yyyy-MM-dd",
+ row: true,
+ rules: [{
+ required: true,
+ message: "请选择成立时间",
+ trigger: ["blur", "change"]
+ }]
+ },
+
+ {
+ label: "图片",
+ prop: "urls",
+ hide: true,
+ type: "upload",
+ listType: "picture-img",
+ action: "/api/blade-resource/oss/endpoint/put-file",
+ propsHttp: {
+ res: "data",
+ name: 'name',
+ url: "link",
+ },
+ row: true
+ },
+ {
+ label: "排序",
+ prop: "sort",
+ hide: true,
+ type: 'number',
+ value: 999,
+ rules: [{
+ required: true,
+ message: "请输入排序",
+ trigger: ["blur", "change"],
+ },],
+ },
+
+ {
+ label: "状态",
+ hide: true,
+ prop: "status",
+ type: 'radio',
+ button: true,
+ activeColor: "#13ce66",
+ inactiveColor: "#ccc",
+ dicData: [
+ {
+ label: "正常",
+ value: 1
+ },
+ {
+ label: "关闭",
+ value: 2
+ },
+
+ ],
+ value: 1,
+ rules: [{
+ required: true,
+ message: "请输入排序",
+ trigger: ["blur", "change"]
+ },],
+ },
+
+ {
+ label: "简介",
+ prop: "profile",
+ span: 24,
+ component: "AvueUeditor",
+ options: {
+ action: "/api/blade-resource/oss/endpoint/put-file",
+ props: {
+ res: "data",
+ url: "link",
+ },
+ },
+ hide: true,
+ minRows: 6,
+ },
+
+ {
+ label: "党成员数",
+ prop: "memberCount",
+ display: false,
+ },
+ ],
},
- type: "select",
- rules: [{
- required: true,
- message: "请选择组织类型",
- trigger: ["blur","change"]
- }, ],
- },
-
- {
- label: "支部类型",
- prop: "branchType",
- checkStrictly: true,
- dicUrl: "/api/blade-system/dict-biz/dictionary?code=branchType",
- props: {
- label: "dictValue",
- value: "dictKey",
- },
- type: "select",
- rules: [{
- required: true,
- message: "请选择支部类型",
- trigger: ["blur","change"]
- }, ],
- },
-
- {
- label: "负责人",
- prop: "chargePerson",
- rules: [{
- required: true,
- message: "请输入负责人",
- trigger: ["blur","change"]
- }]
- },
- {
- label: "姓名",
- prop: "name",
- searchSpan: searchSpan,
- searchPlaceholder:"请输入负责人或党成员",
- hide:true,
- display: false,
- search: true
- },
- {
- label: "手机号",
- prop: "phone",
- slot: true,
- rules: [{
- required: true,
- message: "请输入手机号",
- validator: validatePhone,
- trigger: ["blur","change"],
- }]
- },
-
- {
- label: "成立时间",
- prop: "establishmentDate",
- hide:true,
- type: "date",
- format: "yyyy-MM-dd",
- valueFormat: "yyyy-MM-dd",
- row:true,
- rules: [{
- required: true,
- message: "请选择成立时间",
- trigger: ["blur","change"]
- }]
- },
-
- {
- label: "图片",
- prop: "urls",
- hide:true,
- type: "upload",
- listType: "picture-img",
- action: "/api/blade-resource/oss/endpoint/put-file",
- propsHttp: {
- res: "data",
- name: 'name',
- url: "link",
- },
- row:true
- },
- {
- label: "排序",
- prop: "sort",
- hide:true,
- type: 'number',
- value:999,
- rules: [{
- required: true,
- message: "请输入排序",
- trigger: ["blur","change"],
- },],
- },
-
- {
- label: "状态",
- hide:true,
- prop: "status",
- type: 'radio',
- button:true,
- activeColor: "#13ce66",
- inactiveColor: "#ccc",
- dicData: [
- {
- label: "正常",
- value: 1
- },
- {
- label: "关闭",
- value:2
- },
-
- ],
- value:1,
- rules: [{
- required: true,
- message: "请输入排序",
- trigger: ["blur","change"]
- },],
- },
-
- {
- label: "简介",
- prop: "profile",
- span:24,
- component: "AvueUeditor",
- options: {
- action: "/api/blade-resource/oss/endpoint/put-file",
- props: {
- res: "data",
- url: "link",
- },
- },
- hide: true,
- minRows: 6,
- },
-
- {
- label: "党成员数",
- prop: "memberCount",
- display:false,
- },
- ],
- },
- data: [],
- }
- },
- watch: {},
- computed: {
- ...mapGetters(["permission", "userInfo"]),
- permissionList () {
- return {
- addBtn: this.vaildData(this.permission.gridWorkLog_add, true),
- viewBtn: this.vaildData(this.permission.gridWorkLog_view, true),
- delBtn: this.vaildData(this.permission.gridWorkLog_delete, true),
- editBtn: this.vaildData(this.permission.gridWorkLog_edit, true),
- }
- },
- ids () {
- let ids = []
- this.selectionList.forEach((ele) => {
- ids.push(ele.id)
- })
- return ids.join(",")
- },
- textDispose () {
- return (row, flag, type) => {
- if (row[flag] || row[type] == null) {
- return row[type]
- } else {
- if (type == 'idCard') {
- return row[type].replace(/^(.{6})(?:\d+)(.{4})$/, "$1******$2")
- } else {
- return row[type].replace(/^(.{3})(?:\d+)(.{4})$/, "$1****$2")
- }
+ data: [],
}
- }
},
- },
- methods: {
- showStringDispose (row, type) {
- row[type] = !row[type]
- },
- manageMember (row) {
- this.memberFlag = true
- var that = this
- this.$nextTick(() => {
- that.$refs.partyOrganizationMember.init(row)
- })
- },
- rowSave (row, done, loading) {
- row.urls = func.join(row.urls)
- if (row.urls.length > 0) {
- var urls = []
- var split = row.urls.split(",")
- split.forEach(url => {
- var names = url.split("jczz/")
- urls.push(names[1])
- })
- row.urls = urls.join(",")
- }
- add(row).then(
- () => {
- this.onLoad(this.page)
- this.$message({
- type: "success",
- message: "操作成功!",
- })
- done()
- },
- (error) => {
- window.console.log(error)
- loading()
- }
- )
- },
- rowUpdate (row, index, done, loading) {
- if (row.urls.length > 0) {
- var urls = []
- var split = row.urls.split(",")
- split.forEach(url => {
- var names = url.split("jczz/")
- urls.push(names[1])
- })
- row.urls = urls.join(",")
- }
- update(row).then(
- () => {
- this.onLoad(this.page)
- this.$message({
- type: "success",
- message: "操作成功!",
- })
- done()
- },
- (error) => {
- window.console.log(error)
- loading()
- }
- )
- },
- 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
- const column = this.findObject(this.option.column, "principalId")
- let arr = []
- this.form.urls = website.minioUrl + this.form.urls
- arr.push(this.form.areaId)
- column.defaultExpandedKeys = arr
- })
- }
- // con
- 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,
- records: res.data.data.records.map(item => {
+ watch: {},
+ computed: {
+ ...mapGetters(["permission", "userInfo"]),
+ permissionList () {
return {
- ...item,
- 'phoneNumberflag': false,
- 'idCardflag': false
+ addBtn: this.vaildData(this.permission.gridWorkLog_add, true),
+ viewBtn: this.vaildData(this.permission.gridWorkLog_view, true),
+ delBtn: this.vaildData(this.permission.gridWorkLog_delete, true),
+ editBtn: this.vaildData(this.permission.gridWorkLog_edit, true),
}
- })
- }
-
- this.page.total = data.total
- this.data = data.records.map(item => {
- if (item.imageUrl && item.imageUrl.length > 0) {
- var urls = []
- var names = item.imageUrl.split(",")
- names.forEach(name => {
- urls.push(website.minioUrl + name)
+ },
+ ids () {
+ let ids = []
+ this.selectionList.forEach((ele) => {
+ ids.push(ele.id)
})
- item.imageUrl = urls.join(",")
- }
+ return ids.join(",")
+ },
+ textDispose () {
+ return (row, flag, type) => {
+ if (row[flag] || row[type] == null) {
+ return row[type]
+ } else {
+ if (type == 'idCard') {
+ return row[type].replace(/^(.{6})(?:\d+)(.{4})$/, "$1******$2")
+ } else {
+ return row[type].replace(/^(.{3})(?:\d+)(.{4})$/, "$1****$2")
+ }
+ }
+ }
+ },
+ },
+ methods: {
+ showStringDispose (row, type) {
+ row[type] = !row[type]
+ },
+ manageMember (row) {
+ this.memberFlag = true
+ var that = this
+ this.$nextTick(() => {
+ that.$refs.partyOrganizationMember.init(row)
+ })
+ },
+ rowSave (row, done, loading) {
+ row.urls = func.join(row.urls)
+ if (row.urls.length > 0) {
+ var urls = []
+ var split = row.urls.split(",")
+ split.forEach(url => {
+ var names = url.split("jczz/")
+ urls.push(names[1])
+ })
+ row.urls = urls.join(",")
+ }
+ add(row).then(
+ () => {
+ this.onLoad(this.page)
+ this.$message({
+ type: "success",
+ message: "操作成功!",
+ })
+ done()
+ },
+ (error) => {
+ window.console.log(error)
+ loading()
+ }
+ )
+ },
+ rowUpdate (row, index, done, loading) {
+ if (row.urls.length > 0) {
+ var urls = []
+ var split = row.urls.split(",")
+ split.forEach(url => {
+ var names = url.split("jczz/")
+ urls.push(names[1])
+ })
+ row.urls = urls.join(",")
+ }
+ update(row).then(
+ () => {
+ this.onLoad(this.page)
+ this.$message({
+ type: "success",
+ message: "操作成功!",
+ })
+ done()
+ },
+ (error) => {
+ window.console.log(error)
+ loading()
+ }
+ )
+ },
+ 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
+ const column = this.findObject(this.option.column, "principalId")
+ let arr = []
+ this.form.urls = website.minioUrl + this.form.urls
+ arr.push(this.form.areaId)
+ column.defaultExpandedKeys = arr
+ })
+ }
+ // con
+ 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()
+ },
- return item
- })
+ 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
- this.loading = false
- this.selectionClear()
- })
- }
- },
+ getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
+ const data = {
+ ...res.data.data,
+ records: res.data.data.records.map(item => {
+ return {
+ ...item,
+ 'phoneNumberflag': false,
+ 'idCardflag': false
+ }
+ })
+ }
+
+ this.page.total = data.total
+ this.data = data.records.map(item => {
+ if (item.imageUrl && item.imageUrl.length > 0) {
+ var urls = []
+ var names = item.imageUrl.split(",")
+ names.forEach(name => {
+ urls.push(website.minioUrl + name)
+ })
+ item.imageUrl = urls.join(",")
+ }
+
+ return item
+ })
+
+ this.loading = false
+ this.selectionClear()
+ })
+ }
+ },
}
</script>
-<style scoped>
-
-</style>
+<style scoped></style>
diff --git a/src/views/property/propertyCompany.vue b/src/views/property/propertyCompany.vue
index c22a526..039f539 100644
--- a/src/views/property/propertyCompany.vue
+++ b/src/views/property/propertyCompany.vue
@@ -1,541 +1,535 @@
<!-- 物业公司管理 -->
<template>
- <basic-container>
- <avue-crud :option="option" :table-loading="loading" :data="data" :page.sync="page" ref="crud" @row-del="rowDel"
- v-model="form" :permission="permissionList" @row-update="rowUpdate" @row-save="rowSave"
- :before-open="beforeOpen"
- @search-change="searchChange" @search-reset="searchReset" @selection-change="selectionChange"
- @current-change="currentChange" @size-change="sizeChange" @refresh-change="refreshChange"
- @on-load="onLoad">
- <template slot="menuLeft">
- <el-button size="small" icon="el-icon-delete" plain v-if="permission.propertyCompany_delete"
- @click="handleDelete">删 除
- </el-button>
- </template>
+ <basic-container>
+ <avue-crud :option="option" :table-loading="loading" :data="data" :page.sync="page" ref="crud" @row-del="rowDel"
+ v-model="form" :permission="permissionList" @row-update="rowUpdate" @row-save="rowSave"
+ :before-open="beforeOpen" @search-change="searchChange" @search-reset="searchReset"
+ @selection-change="selectionChange" @current-change="currentChange" @size-change="sizeChange"
+ @refresh-change="refreshChange" @on-load="onLoad">
+ <template slot="menuLeft">
+ <el-button size="small" icon="el-icon-delete" plain v-if="permission.propertyCompany_delete"
+ @click="handleDelete">删 除
+ </el-button>
+ </template>
- <template slot-scope="scope" slot="menu">
- <el-button v-if="permission.payInfo" type="text" icon="el-icon-circle-plus-outline" size="small"
- @click="openPayConfig(scope.row)">商户配置
- </el-button>
- </template>
+ <template slot-scope="{row, size, index}" slot="menu">
+ <el-button :size="size" v-if="permission.payInfo" type="text" icon="el-icon-circle-plus-outline"
+ @click="openPayConfig(row)">商户配置
+ </el-button>
+ </template>
+ </avue-crud>
+ <el-dialog title="商户配置" append-to-body :visible.sync="payInfoVisible" top="10vh" width="70%">
+ <el-tabs v-model="currentTab">
+ <el-tab-pane label="微信商户配置" name="wxInfo">
+ <avue-form ref="wxForm" :option="wxPayOption" v-model="wxPayForm" @submit="wxSubmit">
+ </avue-form>
+ </el-tab-pane>
+ <el-tab-pane label="支付宝商户配置" name="second">
+ <avue-form ref="aliForm" :option="aliPayOption" v-model="aliPayForm" @submit="aliSubmit">
+ </avue-form>
+ </el-tab-pane>
- </avue-crud>
+ </el-tabs>
- <el-dialog title="商户配置" append-to-body :visible.sync="payInfoVisible" top="10vh" width="70%">
- <el-tabs v-model="currentTab">
- <el-tab-pane label="微信商户配置" name="wxInfo">
- <avue-form ref="wxForm" :option="wxPayOption" v-model="wxPayForm" @submit="wxSubmit">
- </avue-form>
- </el-tab-pane>
- <el-tab-pane label="支付宝商户配置" name="second">
- <avue-form ref="aliForm" :option="aliPayOption" v-model="aliPayForm" @submit="aliSubmit">
- </avue-form>
- </el-tab-pane>
+ <!-- <div slot="footer" class="dialog-footer">-->
+ <!-- <el-button @click="payInfoVisible = false">取 消</el-button>-->
+ <!-- <el-button type="primary"@click="submit">提 交</el-button>-->
+ <!-- </div>-->
- </el-tabs>
-
- <!-- <div slot="footer" class="dialog-footer">-->
- <!-- <el-button @click="payInfoVisible = false">取 消</el-button>-->
- <!-- <el-button type="primary"@click="submit">提 交</el-button>-->
- <!-- </div>-->
-
- </el-dialog>
-
-
- </basic-container>
+ </el-dialog>
+ </basic-container>
</template>
<script>
import {
- getList,
- remove,
- update,
- add,
- getPropertyCompany,
- getPayConfig,
- saveOrUpdateWx, saveOrUpdateAli
-} from "@/api/property/propertyCompany";
-import {mapGetters} from "vuex";
-import website from '@/config/website';
-import func from "@/util/func";
+ getList,
+ remove,
+ update,
+ add,
+ getPropertyCompany,
+ getPayConfig,
+ saveOrUpdateWx, saveOrUpdateAli
+} from "@/api/property/propertyCompany"
+import { mapGetters } from "vuex"
+import website from '@/config/website'
+import func from "@/util/func"
const labelWidth = 120
export default {
- data() {
- return {
+ data () {
+ return {
+ currentTab: "wxInfo",
+ payInfoVisible: false,
+ currentRow: {},
- currentTab: "wxInfo",
- payInfoVisible: false,
- currentRow: {},
-
- form: {},
- query: {},
- loading: true,
- page: {
- pageSize: 10,
- currentPage: 1,
- total: 0,
- },
- datetime: "",
- selectionList: [],
- option: {
- height: "auto",
- calcHeight: 54,
- dialogWidth: 1150,
- tip: false,
- searchShow: true,
- searchMenuSpan: 3,
- menuWidth: 350,
- border: true,
- //stripe:true,
- index: true,
- viewBtn: true,
- selection: true,
- dialogClickModal: false,
- column: [
- {
- label: "物业公司名称",
- prop: "name",
- searchSpan: 6,
- search: true,
- searchLabelWidth: 120,
- span: 18,
- row: true,
- labelWidth: 120,
- width: 260,
- rules: [
- {
- required: true,
- message: "请输入物业公司名称",
- trigger: "blur",
- },
- ],
- },
- {
- label: '省份',
- prop: 'province',
- type: 'select',
- props: {
- label: 'name',
- value: 'code'
+ form: {},
+ query: {},
+ loading: true,
+ page: {
+ pageSize: 10,
+ currentPage: 1,
+ total: 0,
},
- hide: true,
- span: 6,
- labelWidth: 120,
- cascader: ['city'],
- dicUrl: `/api/blade-system/region/select`,
- rules: [
- {
- required: true,
- message: '请选择省份',
- trigger: 'blur'
- }
- ]
- },
- {
- label: '城市',
- prop: 'city',
- type: 'select',
- span: 6,
- labelWidth: 60,
- cascader: ['area'],
- props: {
- label: 'name',
- value: 'code'
+ datetime: "",
+ selectionList: [],
+ option: {
+ labelWidth: 120,
+ searchLabelWidth: 96,
+ searchShow: true,
+ searchMenuSpan: 3,
+ menuWidth: 280,
+
+ height: "auto",
+ calcHeight: 54,
+ dialogWidth: 1150,
+ tip: false,
+ border: true,
+ //stripe:true,
+ index: true,
+ viewBtn: true,
+ selection: true,
+ dialogClickModal: false,
+ column: [
+ {
+ overHidden: true,
+ label: "物业公司名称",
+ prop: "name",
+ searchSpan: 5,
+ searchLabelWidth: 124,
+ search: true,
+ span: 18,
+ row: true,
+ width: 260,
+ rules: [
+ {
+ required: true,
+ message: "请输入物业公司名称",
+ trigger: "blur",
+ },
+ ],
+ },
+ {
+ label: '省份',
+ prop: 'province',
+ type: 'select',
+ props: {
+ label: 'name',
+ value: 'code'
+ },
+ hide: true,
+ span: 6,
+ cascader: ['city'],
+ dicUrl: `/api/blade-system/region/select`,
+ rules: [
+ {
+ required: true,
+ message: '请选择省份',
+ trigger: 'blur'
+ }
+ ]
+ },
+ {
+ label: '城市',
+ prop: 'city',
+ type: 'select',
+ span: 6,
+ labelWidth: 60,
+ cascader: ['area'],
+ props: {
+ label: 'name',
+ value: 'code'
+ },
+ hide: true,
+ dicUrl: `/api/blade-system/region/select?code={{key}}`,
+ rules: [
+ {
+ required: true,
+ message: '请选择城市',
+ trigger: 'blur'
+ }
+ ]
+ },
+ {
+ label: '地区',
+ prop: 'area',
+ type: 'select',
+ span: 6,
+ labelWidth: 60,
+ props: {
+ label: 'name',
+ value: 'code'
+ },
+ hide: true,
+ dicUrl: `/api/blade-system/region/select?code={{key}}`,
+ rules: [
+ {
+ required: true,
+ message: '请选择地区',
+ trigger: 'blur'
+ }
+ ]
+ },
+ {
+ overHidden: true,
+ label: "地址",
+ prop: "address",
+ span: 18,
+ row: true,
+ },
+ {
+ label: "社会信用代码",
+ prop: "socialCreditCode",
+ },
+
+ {
+ label: "简介",
+ prop: "remark",
+ component: "AvueUeditor",
+ options: {
+ action: "/api/blade-resource/oss/endpoint/put-file-attach",
+ props: {
+ res: "data",
+ url: "link",
+ },
+ },
+ hide: true,
+ minRows: 6,
+ span: 24,
+ },
+ ],
},
- hide: true,
- dicUrl: `/api/blade-system/region/select?code={{key}}`,
- rules: [
- {
- required: true,
- message: '请选择城市',
- trigger: 'blur'
- }
- ]
- },
- {
- label: '地区',
- prop: 'area',
- type: 'select',
- span: 6,
- labelWidth: 60,
- props: {
- label: 'name',
- value: 'code'
+ data: [],
+
+ wxPayForm: {},
+ wxPayOption: {
+ emptyBtn: false,
+ height: "auto",
+ calcHeight: 180,
+ //stripe:true,
+ column: [
+ {
+ label: "appId",
+ labelWidth: labelWidth,
+ prop: "appId",
+ span: 24,
+ rules: [{
+ required: true,
+ message: "请输入appId",
+ trigger: ["blur", "change"]
+ },],
+ },
+ {
+ label: "mch-id",
+ labelWidth: labelWidth,
+ prop: "mchId",
+ span: 24,
+ rules: [{
+ required: true,
+ message: "请输入mch-id",
+ trigger: ["blur", "change"]
+ },],
+ },
+ {
+ label: "mchKey",
+ labelWidth: labelWidth,
+ prop: "mchKey",
+ rules: [{
+ required: true,
+ message: "请输入mchKey",
+ trigger: ["blur", "change"]
+ },],
+ span: 24,
+ },
+ {
+ label: "appSecret",
+ labelWidth: labelWidth,
+ prop: "appSecret",
+ rules: [{
+ required: true,
+ message: "请输入appSecret",
+ trigger: ["blur", "change"]
+ },],
+ span: 24,
+ },
+ {
+ label: '安全证书',
+ labelWidth: labelWidth,
+ prop: 'keyPath',
+ type: 'upload',
+ drag: true,
+ limit: 1,
+ loadText: '上传中,请稍等',
+ span: 24,
+ action: "/api/blade-resource/oss/endpoint/put-file",
+ propsHttp: {
+ res: "data",
+ name: 'name',
+ url: "link",
+ },
+ rules: [{
+ required: true,
+ message: "请上传安全证书",
+ trigger: ["blur", "change"]
+ },],
+ },
+ ],
},
- hide: true,
- dicUrl: `/api/blade-system/region/select?code={{key}}`,
- rules: [
- {
- required: true,
- message: '请选择地区',
- trigger: 'blur'
- }
- ]
- },
- {
- label: "地址",
- prop: "address",
- span: 18,
- labelWidth: 120,
- row: true,
- },
- {
- label: "社会信用代码",
- prop: "socialCreditCode",
- labelWidth: 120,
- },
- {
- label: "简介",
- prop: "remark",
- component: "AvueUeditor",
- labelWidth: 120,
- options: {
- action: "/api/blade-resource/oss/endpoint/put-file-attach",
- props: {
- res: "data",
- url: "link",
- },
- },
- hide: true,
- minRows: 6,
- span: 24,
- },
- ],
- },
- data: [],
+ aliPayForm: {},
+ aliPayOption: {
+ emptyBtn: false,
+ height: "auto",
+ calcHeight: 180,
+ //stripe:true,
+ column: [
+ {
+ label: "appId",
+ labelWidth: labelWidth,
+ prop: "appId",
+ span: 24,
+ rules: [{
+ required: true,
+ message: "请输入appId",
+ trigger: ["blur", "change"]
+ },],
+ },
+ {
+ label: "privateKey",
+ labelWidth: labelWidth,
+ prop: "privateKey",
+ span: 24,
+ rules: [{
+ required: true,
+ message: "请输入privateKey",
+ trigger: ["blur", "change"]
+ },],
+ },
+ {
+ label: "publicKey",
+ labelWidth: labelWidth,
+ prop: "publicKey",
+ span: 24,
+ rules: [{
+ required: true,
+ message: "请输入publicKey",
+ trigger: ["blur", "change"]
+ },],
+ },
+ ],
+ }
- wxPayForm: {},
- wxPayOption: {
- emptyBtn: false,
- height: "auto",
- calcHeight: 180,
- //stripe:true,
- column: [
- {
- label: "appId",
- labelWidth: labelWidth,
- prop: "appId",
- span: 24,
- rules: [{
- required: true,
- message: "请输入appId",
- trigger: ["blur", "change"]
- },],
- },
- {
- label: "mch-id",
- labelWidth: labelWidth,
- prop: "mchId",
- span: 24,
- rules: [{
- required: true,
- message: "请输入mch-id",
- trigger: ["blur", "change"]
- },],
- },
- {
- label: "mchKey",
- labelWidth: labelWidth,
- prop: "mchKey",
- rules: [{
- required: true,
- message: "请输入mchKey",
- trigger: ["blur", "change"]
- },],
- span: 24,
- },
- {
- label: "appSecret",
- labelWidth: labelWidth,
- prop: "appSecret",
- rules: [{
- required: true,
- message: "请输入appSecret",
- trigger: ["blur", "change"]
- },],
- span: 24,
- },
- {
- label: '安全证书',
- labelWidth: labelWidth,
- prop: 'keyPath',
- type: 'upload',
- drag: true,
- limit: 1,
- loadText: '上传中,请稍等',
- span: 24,
- action: "/api/blade-resource/oss/endpoint/put-file",
- propsHttp: {
- res: "data",
- name: 'name',
- url: "link",
- },
- rules: [{
- required: true,
- message: "请上传安全证书",
- trigger: ["blur", "change"]
- },],
- },
- ],
- },
-
- aliPayForm: {},
- aliPayOption: {
- emptyBtn: false,
- height: "auto",
- calcHeight: 180,
- //stripe:true,
- column: [
- {
- label: "appId",
- labelWidth: labelWidth,
- prop: "appId",
- span: 24,
- rules: [{
- required: true,
- message: "请输入appId",
- trigger: ["blur", "change"]
- },],
- },
- {
- label: "privateKey",
- labelWidth: labelWidth,
- prop: "privateKey",
- span: 24,
- rules: [{
- required: true,
- message: "请输入privateKey",
- trigger: ["blur", "change"]
- },],
- },
- {
- label: "publicKey",
- labelWidth: labelWidth,
- prop: "publicKey",
- span: 24,
- rules: [{
- required: true,
- message: "请输入publicKey",
- trigger: ["blur", "change"]
- },],
- },
- ],
- }
-
- };
- },
- watch: {},
- computed: {
- ...mapGetters(["permission", "userInfo"]),
- permissionList() {
- return {
- addBtn: this.vaildData(this.permission.propertyCompany_add, true),
- viewBtn: this.vaildData(this.permission.propertyCompany_view, true),
- delBtn: this.vaildData(this.permission.propertyCompany_delete, true),
- editBtn: this.vaildData(this.permission.propertyCompany_edit, true),
- };
- },
- ids() {
- let ids = [];
- this.selectionList.forEach((ele) => {
- ids.push(ele.id);
- });
- return ids.join(",");
- },
- },
- created() {
- },
- methods: {
-
- aliSubmit(form, done) {
-
- console.log("支付宝商户配置", this.aliPayForm)
-
- this.aliPayForm.propertyCompanyId = this.currentRow.id
- saveOrUpdateAli(this.aliPayForm).then(res => {
- this.$message({
- type: "success",
- message: "操作成功!",
- });
- done();
- })
-
- },
-
- wxSubmit(form, done) {
- this.wxPayForm.propertyCompanyId = this.currentRow.id
-
- this.wxPayForm.keyPath = func.join(this.wxPayForm.keyPath)
- if (this.wxPayForm.keyPath.length > 0) {
- var urls = []
- var split = this.wxPayForm.keyPath.split(",")
- split.forEach(url => {
- var names = url.split("jczz/")
- urls.push(names[1])
- })
- this.wxPayForm.keyPath = urls.join(",")
- }
-
- console.log("微信商户配置", this.wxPayForm)
- saveOrUpdateWx(this.wxPayForm).then(res => {
- this.$message({
- type: "success",
- message: "操作成功!",
- });
- done();
- })
- },
-
- openPayConfig(row) {
- this.currentRow = row
- //调接口获取商户数据
- getPayConfig(row.id).then(res => {
- let data = res.data.data
- this.wxPayForm = data.wxPayInfo ? data.wxPayInfo : {}
- this.aliPayForm = data.aliPayInfo ? data.aliPayInfo : {}
- })
- this.payInfoVisible = !this.payInfoVisible
- },
-
- rowSave(row, done, loading) {
- row.userid = this.userInfo.user_id;
- add(row).then(
- () => {
- this.onLoad(this.page);
- this.$message({
- type: "success",
- message: "操作成功!",
- });
- done();
- },
- (error) => {
- window.console.log(error);
- loading();
}
- );
},
- rowUpdate(row, index, done, loading) {
- update(row).then(
- () => {
- this.onLoad(this.page);
- this.$message({
- type: "success",
- message: "操作成功!",
- });
- done();
+ watch: {},
+ computed: {
+ ...mapGetters(["permission", "userInfo"]),
+ permissionList () {
+ return {
+ addBtn: this.vaildData(this.permission.propertyCompany_add, true),
+ viewBtn: this.vaildData(this.permission.propertyCompany_view, true),
+ delBtn: this.vaildData(this.permission.propertyCompany_delete, true),
+ editBtn: this.vaildData(this.permission.propertyCompany_edit, true),
+ }
},
- (error) => {
- window.console.log(error);
- loading();
+ ids () {
+ let ids = []
+ this.selectionList.forEach((ele) => {
+ ids.push(ele.id)
+ })
+ return ids.join(",")
+ },
+ },
+ created () {
+ },
+ methods: {
+
+ aliSubmit (form, done) {
+
+ console.log("支付宝商户配置", this.aliPayForm)
+
+ this.aliPayForm.propertyCompanyId = this.currentRow.id
+ saveOrUpdateAli(this.aliPayForm).then(res => {
+ this.$message({
+ type: "success",
+ message: "操作成功!",
+ })
+ done()
+ })
+
+ },
+
+ wxSubmit (form, done) {
+ this.wxPayForm.propertyCompanyId = this.currentRow.id
+
+ this.wxPayForm.keyPath = func.join(this.wxPayForm.keyPath)
+ if (this.wxPayForm.keyPath.length > 0) {
+ var urls = []
+ var split = this.wxPayForm.keyPath.split(",")
+ split.forEach(url => {
+ var names = url.split("jczz/")
+ urls.push(names[1])
+ })
+ this.wxPayForm.keyPath = urls.join(",")
+ }
+
+ console.log("微信商户配置", this.wxPayForm)
+ saveOrUpdateWx(this.wxPayForm).then(res => {
+ this.$message({
+ type: "success",
+ message: "操作成功!",
+ })
+ done()
+ })
+ },
+
+ openPayConfig (row) {
+ this.currentRow = row
+ //调接口获取商户数据
+ getPayConfig(row.id).then(res => {
+ let data = res.data.data
+ this.wxPayForm = data.wxPayInfo ? data.wxPayInfo : {}
+ this.aliPayForm = data.aliPayInfo ? data.aliPayInfo : {}
+ })
+ this.payInfoVisible = !this.payInfoVisible
+ },
+
+ rowSave (row, done, loading) {
+ row.userid = this.userInfo.user_id
+ add(row).then(
+ () => {
+ this.onLoad(this.page)
+ this.$message({
+ type: "success",
+ message: "操作成功!",
+ })
+ done()
+ },
+ (error) => {
+ window.console.log(error)
+ loading()
+ }
+ )
+ },
+ rowUpdate (row, index, done, loading) {
+ update(row).then(
+ () => {
+ this.onLoad(this.page)
+ this.$message({
+ type: "success",
+ message: "操作成功!",
+ })
+ done()
+ },
+ (error) => {
+ window.console.log(error)
+ loading()
+ }
+ )
+ },
+ rowDel (row) {
+ this.$confirm("确定将选择数据删除?", {
+ confirmButtonText: "确定",
+ cancelButtonText: "取消",
+ type: "warning",
+ })
+ .then(() => {
+ return remove(row.id)
+ })
+ .then(() => {
+ this.onLoad(this.page)
+ this.$message({
+ type: "success",
+ message: "操作成功!",
+ })
+ })
+ },
+ 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()
+ },
+ 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)) {
+ getPropertyCompany(this.form.id).then((res) => {
+ this.form = res.data.data
+ })
+ }
+ // con
+ done()
+ },
+ currentChange (currentPage) {
+ this.page.currentPage = currentPage
+ },
+ sizeChange (pageSize) {
+ this.page.pageSize = pageSize
+ },
+ refreshChange () {
+ this.onLoad(this.page, this.query)
+ },
+ onLoad (page, params = {}) {
+ const { dateTime } = this.query
+ let values = {
+ ...params,
+ }
+ if (dateTime) {
+ values = {
+ ...params,
+ startTime: dateTime[0],
+ endTime: dateTime[1],
+ ...this.query,
+ }
+ values.dateTime = null
+ }
+ this.loading = true
+ getList(page.currentPage, page.pageSize, values).then((res) => {
+ const data = res.data.data
+ this.page.total = data.total
+ this.data = data.records
+ this.loading = false
+ this.selectionClear()
+ })
}
- );
- },
- rowDel(row) {
- this.$confirm("确定将选择数据删除?", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning",
- })
- .then(() => {
- return remove(row.id);
- })
- .then(() => {
- this.onLoad(this.page);
- this.$message({
- type: "success",
- message: "操作成功!",
- });
- });
- },
- 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();
- },
- 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)) {
- getPropertyCompany(this.form.id).then((res) => {
- this.form = res.data.data;
- });
- }
- // con
- done();
- },
- currentChange(currentPage) {
- this.page.currentPage = currentPage;
- },
- sizeChange(pageSize) {
- this.page.pageSize = pageSize;
- },
- refreshChange() {
- this.onLoad(this.page, this.query);
- },
- onLoad(page, params = {}) {
- const {dateTime} = this.query;
- let values = {
- ...params,
- };
- if (dateTime) {
- values = {
- ...params,
- startTime: dateTime[0],
- endTime: dateTime[1],
- ...this.query,
- };
- values.dateTime = null;
- }
- this.loading = true;
- getList(page.currentPage, page.pageSize, values).then((res) => {
- const data = res.data.data;
- this.page.total = data.total;
- this.data = data.records;
- this.loading = false;
- this.selectionClear();
- });
}
- }
-};
+}
</script>
<style>
.avue-upload__icon {
- line-height: 6;
+ line-height: 6;
}
</style>
--
Gitblit v1.9.3