Browse Source

合并冲突

bugfix/member_move_out
jiangyy 4 years ago
parent
commit
a50cf26a76
  1. 2
      .env.production
  2. 2
      public/index.html
  3. 4
      src/assets/scss/modules/search.scss
  4. 8
      src/js/dai/request.js
  5. 13
      src/views/main-shuju/main.vue
  6. 16
      src/views/main.vue
  7. 58
      src/views/modules/base/community/buildTable.vue
  8. 40
      src/views/modules/base/community/community.vue
  9. 62
      src/views/modules/base/community/communityTable.vue
  10. 63
      src/views/modules/base/community/roomTable.vue
  11. 12
      src/views/modules/importRecord/index.vue
  12. 16
      src/views/modules/shequ/index.vue
  13. 286
      src/views/modules/workSys/elegantCate.vue
  14. 169
      src/views/modules/workSys/elegantEdit.vue

2
.env.production

@ -1,4 +1,4 @@
NODE_ENV=production NODE_ENV=production
VUE_APP_API_SERVER = https://epdc-shibei.elinkservice.cn/api VUE_APP_API_SERVER = https://epmet-cloud.elinkservice.cn/api
VUE_APP_NODE_ENV=prod VUE_APP_NODE_ENV=prod
VUE_APP_PUBLIC_PATH=epmet-oper VUE_APP_PUBLIC_PATH=epmet-oper

2
public/index.html

@ -64,7 +64,7 @@
<!-- 生产环境 --> <!-- 生产环境 -->
<% if (process.env.VUE_APP_NODE_ENV==='prod' ) { %> <% if (process.env.VUE_APP_NODE_ENV==='prod' ) { %>
<script> <script>
window.SITE_CONFIG['apiURL'] = 'https://epdc-shibei.elinkservice.cn/api' window.SITE_CONFIG['apiURL'] = 'https://epmet-cloud.elinkservice.cn/api'
</script> </script>
<% } %> <% } %>
</head> </head>

4
src/assets/scss/modules/search.scss

@ -26,13 +26,15 @@
.input { .input {
position: relative; position: relative;
select { .select-show {
border: none; border: none;
display: block;
font-size: 16px; font-size: 16px;
width: 90px; width: 90px;
line-height: 32px; line-height: 32px;
text-align: center; text-align: center;
color: #0082fb; color: #0082fb;
cursor: default;
} }
input { input {

8
src/js/dai/request.js

@ -2,7 +2,6 @@
| 请求接口封装 | | 请求接口封装 |
---------------------------------------------------------------*/ ---------------------------------------------------------------*/
import axios from "axios"; import axios from "axios";
import curry from "dai-js/tools/curry"; import curry from "dai-js/tools/curry";
import { Message } from "element-ui"; import { Message } from "element-ui";
@ -37,12 +36,7 @@ const request = curry(
// retData = Vue.$afterRequestHook(retData); // retData = Vue.$afterRequestHook(retData);
// } // }
if (res.data.code > 8000 && res.data.code < 10000) { if (res.data.code > 8000 && res.data.code < 10000) {
// message.error(res.data.msg); // Message.error(res.data.msg);
Message({
showClose: true,
message: res.data.msg,
duration: 0
})
} }
reslove(retData); reslove(retData);

13
src/views/main-shuju/main.vue

@ -1,6 +1,5 @@
<template> <template>
<div <div v-loading.fullscreen.lock="loading"
v-loading.fullscreen.lock="loading"
:element-loading-text="$t('loading')" :element-loading-text="$t('loading')"
:class="[ :class="[
'g-bd', 'g-bd',
@ -8,15 +7,12 @@
{ {
'z-sidebar--noside': true, 'z-sidebar--noside': true,
}, },
]" ]">
>
<template v-if="!loading"> <template v-if="!loading">
<main-navbar ref="ref_navbar" /> <main-navbar ref="ref_navbar" />
<div class="g-cnt"> <div class="g-cnt">
<main-content <main-content v-if="!$store.state.contentIsNeedRefresh"
v-if="!$store.state.contentIsNeedRefresh" @changeCustomerName="changeCustomerName" />
@changeCustomerName="changeCustomerName"
/>
</div> </div>
</template> </template>
</div> </div>
@ -115,6 +111,7 @@ export default {
localStorage.setItem("roleList", data.roleList); localStorage.setItem("roleList", data.roleList);
localStorage.setItem("customerId", data.customerId); localStorage.setItem("customerId", data.customerId);
localStorage.setItem("staffId", data.id); localStorage.setItem("staffId", data.id);
localStorage.setItem("agencyId", data.agencyId);
if (!localStorage.getItem("customerName")) { if (!localStorage.getItem("customerName")) {
localStorage.setItem("customerName", data.customerName || ""); localStorage.setItem("customerName", data.customerName || "");
} }

16
src/views/main.vue

@ -1,6 +1,5 @@
<template> <template>
<div <div v-loading.fullscreen.lock="loading"
v-loading.fullscreen.lock="loading"
:element-loading-text="$t('loading')" :element-loading-text="$t('loading')"
:class="[ :class="[
'aui-wrapper', 'aui-wrapper',
@ -10,16 +9,14 @@
$store.state.sidebarActiveSubMenuList.length == 0 || $store.state.inIframe, $store.state.sidebarActiveSubMenuList.length == 0 || $store.state.inIframe,
}, },
{ 'z-iframe': $store.state.inIframe }, { 'z-iframe': $store.state.inIframe },
]" ]">
>
<template v-if="!loading"> <template v-if="!loading">
<main-navbar ref="ref_navbar" v-if="!$store.state.inIframe" /> <main-navbar ref="ref_navbar"
v-if="!$store.state.inIframe" />
<main-sidebar v-if="!$store.state.inIframe" /> <main-sidebar v-if="!$store.state.inIframe" />
<div class="aui-content__wrapper"> <div class="aui-content__wrapper">
<main-content <main-content v-if="!$store.state.contentIsNeedRefresh"
v-if="!$store.state.contentIsNeedRefresh" @changeCustomerName="changeCustomerName" />
@changeCustomerName="changeCustomerName"
/>
</div> </div>
<main-theme-tools v-if="!$store.state.inIframe" /> <main-theme-tools v-if="!$store.state.inIframe" />
</template> </template>
@ -148,6 +145,7 @@ export default {
localStorage.setItem("roleList", data.roleList); localStorage.setItem("roleList", data.roleList);
localStorage.setItem("customerId", data.customerId); localStorage.setItem("customerId", data.customerId);
localStorage.setItem("staffId", data.id); localStorage.setItem("staffId", data.id);
localStorage.setItem("agencyId", data.agencyId);
if (!localStorage.getItem("customerName")) { if (!localStorage.getItem("customerName")) {
localStorage.setItem("customerName", data.customerName || ""); localStorage.setItem("customerName", data.customerName || "");
} }

58
src/views/modules/base/community/buildTable.vue

@ -41,7 +41,8 @@
size="small" size="small"
icon="el-icon-plus" icon="el-icon-plus"
@click="handleAdd">新增楼宇</el-button> @click="handleAdd">新增楼宇</el-button>
<div class="btn_upload"
v-if="showImportBtn">
<el-button style=";margin-left:10px" <el-button style=";margin-left:10px"
type="blue" type="blue"
size="small" size="small"
@ -83,6 +84,7 @@
type="red">导入房屋数据</el-button> type="red">导入房屋数据</el-button>
</el-upload> </el-upload>
</div> </div>
</div>
<div class="div_table"> <div class="div_table">
<el-table ref="ref_table" <el-table ref="ref_table"
@ -134,12 +136,14 @@
style="color:#1C6AFD;text-decoration: underline;" style="color:#1C6AFD;text-decoration: underline;"
size="small" size="small"
@click="handleDetail(scope.row)">查看</el-button> @click="handleDetail(scope.row)">查看</el-button>
<el-button type="text" <el-button v-if="scope.row.showBtn"
type="text"
style="color:#00A7A9;text-decoration: underline;" style="color:#00A7A9;text-decoration: underline;"
size="small" size="small"
@click="handleEdit(scope.row)">修改</el-button> @click="handleEdit(scope.row)">修改</el-button>
<el-button type="text" <el-button v-if="scope.row.showBtn"
type="text"
style="color:#D51010;text-decoration: underline;" style="color:#D51010;text-decoration: underline;"
size="small" size="small"
@click="handleDelete(scope.row)">删除</el-button> @click="handleDelete(scope.row)">删除</el-button>
@ -206,6 +210,7 @@ export default {
tableLoading: true, tableLoading: true,
selAllFlag: false, selAllFlag: false,
isIndeterminate: false,// isIndeterminate: false,//
// showImportBtn: false,//
agencyObj: {},// agencyObj: {},//
ownerName: '', ownerName: '',
@ -242,8 +247,17 @@ export default {
async loadTable (fromTree, treeObj) { async loadTable (fromTree, treeObj) {
this.tableLoading = true this.tableLoading = true
if (fromTree) { if (fromTree) {
this.agencyObj = treeObj this.agencyObj = treeObj
// if (this.agencyObj.pid === this.staffAgencyId) {//idid
// this.showImportBtn = true
// } else {
// this.showImportBtn = false
// }
} }
console.log(this.agencyObj) console.log(this.agencyObj)
const url = "/gov/org/building/buildinglist" const url = "/gov/org/building/buildinglist"
let params = { let params = {
@ -258,6 +272,14 @@ export default {
if (code === 0) { if (code === 0) {
this.total = data.total this.total = data.total
data.list.forEach(item => {
if (item.agencyId === this.staffAgencyId) {
item.showBtn = true
} else {
item.showBtn = false
}
});
this.tableData = data.list this.tableData = data.list
} else { } else {
this.$message.error(msg) this.$message.error(msg)
@ -410,10 +432,11 @@ export default {
this.$emit('refreshTree') this.$emit('refreshTree')
this.loadTable() this.loadTable()
} else if (code > 8000) { } else if (code > 8000) {
// this.$message({ this.$message({
// type: "success", showClose: true,
// message: msg message: msg,
// }); duration: 0
})
this.$emit('refreshTree') this.$emit('refreshTree')
this.loadTable() this.loadTable()
} else { } else {
@ -590,12 +613,12 @@ export default {
if (data.code === 0 && data.msg == 'success') { if (data.code === 0 && data.msg == 'success') {
// this.$message.success('') // this.$message.success('')
} else { } else {
this.$message({ // this.$message({
showClose: true, // showClose: true,
message: rspMsg, // message: rspMsg,
duration: 0, // duration: 0,
type: "error" // type: "error"
}) // })
// this.$message.error(rspMsg) // this.$message.error(rspMsg)
} }
this.$emit('refreshTree') this.$emit('refreshTree')
@ -660,7 +683,14 @@ export default {
} }
}, },
props: { props: {
staffAgencyId: {
type: String,
default: '',
},
showImportBtn: {
type: Boolean,
default: false,
},
} }
} }
</script> </script>

40
src/views/modules/base/community/community.vue

@ -29,13 +29,18 @@
<build-table v-if="selTreeObj.level==='neighborHood'" <build-table v-if="selTreeObj.level==='neighborHood'"
ref="ref_neighTable" ref="ref_neighTable"
:staffAgencyId="staffAgencyId"
:showImportBtn="showImportBtn"
@toNextLevel="toNextLevel" @toNextLevel="toNextLevel"
@refreshTree="refreshTree"></build-table> @refreshTree="refreshTree"></build-table>
<room-table v-else-if="selTreeObj.level==='building'" <room-table v-else-if="selTreeObj.level==='building'"
:staffAgencyId="staffAgencyId"
:showImportBtn="showImportBtn"
ref="ref_buildingTable" ref="ref_buildingTable"
@refreshTree="refreshTree"></room-table> @refreshTree="refreshTree"></room-table>
<community-table v-else <community-table v-else
@toNextLevel="toNextLevel" @toNextLevel="toNextLevel"
:staffAgencyId="staffAgencyId"
ref="ref_communityTable" ref="ref_communityTable"
@refreshTree="refreshTree"></community-table> @refreshTree="refreshTree"></community-table>
@ -67,7 +72,9 @@ export default {
selTreeObj: {}, selTreeObj: {},
centerPoint: [] centerPoint: [],
staffAgencyId: localStorage.getItem("agencyId"),
showImportBtn: false
} }
}, },
@ -78,6 +85,7 @@ export default {
this.treeLoading = true this.treeLoading = true
await this.loadOrgData() await this.loadOrgData()
await this.loadTree() await this.loadTree()
await this.$refs['ref_communityTable'].loadTable(true, this.selTreeObj) await this.$refs['ref_communityTable'].loadTable(true, this.selTreeObj)
if (this.treeData.length > 0) { if (this.treeData.length > 0) {
this.$nextTick(() => { this.$nextTick(() => {
@ -147,7 +155,12 @@ export default {
handleNodeClick (obj) { handleNodeClick (obj) {
this.getTreeObj(obj) this.getTreeObj(obj)
this.$nextTick(() => { this.$nextTick(() => {
if (obj.level === 'building') {// if (obj.level === 'building') {//
this.$refs['ref_buildingTable'].loadTable(true, this.selTreeObj) this.$refs['ref_buildingTable'].loadTable(true, this.selTreeObj)
@ -196,18 +209,31 @@ export default {
// idtypeidid // idtypeidid
// idtypeid // idtypeid
if (obj.level === 'building') {// if (obj.level === 'building') {//
let communityNode = this.$refs.ref_tree.getNode(obj.pid) let neighborHoodNode = this.$refs.ref_tree.getNode(obj.pid)//
obj.communityId = communityNode.data.id
obj.communityName = communityNode.data.label
} else if (obj.level === 'neighborHood') {// let gridNode = this.$refs.ref_tree.getNode(neighborHoodNode.data.pid)//
let agencyNode = this.$refs.ref_tree.getNode(gridNode.data.pid)//
obj.agencyId = agencyNode.data.id
obj.agencyName = agencyNode.data.label
if (obj.agencyId === this.staffAgencyId) {
this.showImportBtn = true
} else {
this.showImportBtn = false
}
} else if (obj.level === 'neighborHood') {//
let gridNode = this.$refs.ref_tree.getNode(obj.pid) let gridNode = this.$refs.ref_tree.getNode(obj.pid)
let agencyNode = this.$refs.ref_tree.getNode(gridNode.data.pid) let agencyNode = this.$refs.ref_tree.getNode(gridNode.data.pid)
obj.gridId = gridNode.data.id obj.gridId = gridNode.data.id
obj.gridName = gridNode.data.label obj.gridName = gridNode.data.label
obj.agencyId = agencyNode.data.id obj.agencyId = agencyNode.data.id
obj.agencyName = agencyNode.data.label obj.agencyName = agencyNode.data.label
if (obj.agencyId === this.staffAgencyId) {
this.showImportBtn = true
} else {
this.showImportBtn = false
}
} else { } else {
} }
@ -276,8 +302,8 @@ export default {
.div_table { .div_table {
margin-left: 15px; margin-left: 15px;
flex: 1; // flex: 1;
// width: calc(100vw - 550px); width: calc(100vw - 550px);
background-color: #ffffff; background-color: #ffffff;
border-radius: 5px; border-radius: 5px;
padding: 10px; padding: 10px;

62
src/views/modules/base/community/communityTable.vue

@ -42,7 +42,7 @@
icon="el-icon-plus" icon="el-icon-plus"
@click="handleAdd">新增小区</el-button> @click="handleAdd">新增小区</el-button>
<div class="btn_upload" <div class="btn_upload"
v-if="agencyObj.level==='community'||agencyObj.level==='grid'"> v-if="showImportBtn">
<el-button style="" <el-button style=""
type="blue" type="blue"
size="small" size="small"
@ -157,12 +157,14 @@
style="color:#1C6AFD;text-decoration: underline;" style="color:#1C6AFD;text-decoration: underline;"
size="small" size="small"
@click="handleDetail(scope.row)">查看</el-button> @click="handleDetail(scope.row)">查看</el-button>
<el-button type="text" <el-button v-if="scope.row.showBtn"
type="text"
style="color:#00A7A9;text-decoration: underline;" style="color:#00A7A9;text-decoration: underline;"
size="small" size="small"
@click="handleEdit(scope.row)">修改</el-button> @click="handleEdit(scope.row)">修改</el-button>
<el-button type="text" <el-button v-if="scope.row.showBtn"
type="text"
style="color:#D51010;text-decoration: underline;" style="color:#D51010;text-decoration: underline;"
size="small" size="small"
@click="handleDelete(scope.row)">删除</el-button> @click="handleDelete(scope.row)">删除</el-button>
@ -229,6 +231,7 @@ export default {
tableLoading: true, tableLoading: true,
selAllFlag: false, selAllFlag: false,
isIndeterminate: false,// isIndeterminate: false,//
showImportBtn: false,//
agencyObj: {},// agencyObj: {},//
ownerName: '', ownerName: '',
@ -236,6 +239,7 @@ export default {
tableData: [], tableData: [],
selection: [], selection: [],
//form //form
formShow: false, formShow: false,
formTitle: '新增小区', formTitle: '新增小区',
@ -254,7 +258,6 @@ export default {
}, },
computed: { computed: {
tableHeight () { tableHeight () {
return (this.clientHeight - 300) return (this.clientHeight - 300)
}, },
@ -269,9 +272,26 @@ export default {
this.loadTable() this.loadTable()
}, },
async loadTable (fromTree, treeObj) { async loadTable (fromTree, treeObj) {
console.log(111, this.staffAgencyId)
this.tableLoading = true this.tableLoading = true
if (fromTree) { if (fromTree) {
this.agencyObj = treeObj this.agencyObj = treeObj
if (this.agencyObj.level === 'community') {//
if (this.agencyObj.id === this.staffAgencyId) {//idid
this.showImportBtn = true
} else {
this.showImportBtn = false
}
} else if (this.agencyObj.level === 'grid') {//
if (this.agencyObj.pid === this.staffAgencyId) {//idid
this.showImportBtn = true
} else {
this.showImportBtn = false
}
} else {
this.showImportBtn = false
}
} }
const url = "/gov/org/neighborhood/neighborhoodlist" const url = "/gov/org/neighborhood/neighborhoodlist"
@ -289,6 +309,14 @@ export default {
if (code === 0) { if (code === 0) {
this.total = data.total this.total = data.total
data.list.forEach(item => {
if (item.agencyId === this.staffAgencyId) {
item.showBtn = true
} else {
item.showBtn = false
}
});
this.tableData = data.list this.tableData = data.list
} else { } else {
this.$message.error(msg) this.$message.error(msg)
@ -440,11 +468,11 @@ export default {
this.$emit('refreshTree') this.$emit('refreshTree')
this.loadTable() this.loadTable()
} else if (code > 8000) { } else if (code > 8000) {
// this.$message({ this.$message({
// showClose: true, showClose: true,
// message: msg, message: msg,
// duration: 0 duration: 0
// }) })
this.$emit('refreshTree') this.$emit('refreshTree')
this.loadTable() this.loadTable()
} else { } else {
@ -624,12 +652,12 @@ export default {
if (data.code === 0 && data.msg == 'success') { if (data.code === 0 && data.msg == 'success') {
// this.$message.success('') // this.$message.success('')
} else { } else {
this.$message({ // this.$message({
showClose: true, // showClose: true,
message: rspMsg, // message: rspMsg,
duration: 0, // duration: 0,
type: "error" // type: "error"
}) // })
// this.$message.error(rspMsg) // this.$message.error(rspMsg)
} }
this.$emit('refreshTree') this.$emit('refreshTree')
@ -702,6 +730,10 @@ export default {
} }
}, },
props: { props: {
staffAgencyId: {
type: String,
default: '',
},
} }
} }

63
src/views/modules/base/community/roomTable.vue

@ -41,6 +41,8 @@
icon="el-icon-plus" icon="el-icon-plus"
size="small" size="small"
@click="handleAdd">新增房屋</el-button> @click="handleAdd">新增房屋</el-button>
<div class="btn_upload"
v-if="showImportBtn">
<el-button style="float:left" <el-button style="float:left"
type="blue" type="blue"
size="small" size="small"
@ -62,6 +64,7 @@
type="red">导入房屋数据</el-button> type="red">导入房屋数据</el-button>
</el-upload> </el-upload>
</div> </div>
</div>
<div class="div_table"> <div class="div_table">
<el-table ref="ref_table" <el-table ref="ref_table"
@ -125,12 +128,14 @@
style="color:#1C6AFD;text-decoration: underline;" style="color:#1C6AFD;text-decoration: underline;"
size="small" size="small"
@click="handleDetail(scope.row)">查看</el-button> @click="handleDetail(scope.row)">查看</el-button>
<el-button type="text" <el-button v-if="scope.row.showBtn"
type="text"
style="color:#00A7A9;text-decoration: underline;" style="color:#00A7A9;text-decoration: underline;"
size="small" size="small"
@click="handleEdit(scope.row)">修改</el-button> @click="handleEdit(scope.row)">修改</el-button>
<el-button type="text" <el-button v-if="scope.row.showBtn"
type="text"
style="color:#D51010;text-decoration: underline;" style="color:#D51010;text-decoration: underline;"
size="small" size="small"
@click="handleDelete(scope.row)">删除</el-button> @click="handleDelete(scope.row)">删除</el-button>
@ -195,6 +200,7 @@ export default {
tableLoading: true, tableLoading: true,
selAllFlag: false, selAllFlag: false,
isIndeterminate: false,// isIndeterminate: false,//
// showImportBtn: false,//
agencyObj: {},// agencyObj: {},//
ownerName: '', ownerName: '',
@ -234,6 +240,21 @@ export default {
this.tableLoading = true this.tableLoading = true
if (fromTree) { if (fromTree) {
this.agencyObj = treeObj this.agencyObj = treeObj
// if (this.agencyObj.level === 'community') {//
// if (this.agencyObj.id === this.staffAgencyId) {//idid
// this.showImportBtn = true
// } else {
// this.showImportBtn = false
// }
// } else if (this.agencyObj.level === 'grid') {//
// if (this.agencyObj.pid === this.staffAgencyId) {//idid
// this.showImportBtn = true
// } else {
// this.showImportBtn = false
// }
// } else {
// this.showImportBtn = false
// }
} }
const url = "/gov/org/house/houselist" const url = "/gov/org/house/houselist"
@ -250,6 +271,14 @@ export default {
if (code === 0) { if (code === 0) {
this.total = data.total this.total = data.total
data.list.forEach(item => {
if (item.agencyId === this.staffAgencyId) {
item.showBtn = true
} else {
item.showBtn = false
}
});
this.tableData = data.list this.tableData = data.list
} else { } else {
this.$message.error(msg) this.$message.error(msg)
@ -397,10 +426,11 @@ export default {
this.$emit('refreshTree') this.$emit('refreshTree')
this.loadTable() this.loadTable()
} else if (code > 8000) { } else if (code > 8000) {
// this.$message({ this.$message({
// type: "success", showClose: true,
// message: msg message: msg,
// }); duration: 0
})
this.$emit('refreshTree') this.$emit('refreshTree')
this.loadTable() this.loadTable()
} else { } else {
@ -553,12 +583,12 @@ export default {
if (data.code === 0 && data.msg == 'success') { if (data.code === 0 && data.msg == 'success') {
// this.$message.success('') // this.$message.success('')
} else { } else {
this.$message({ // this.$message({
showClose: true, // showClose: true,
message: rspMsg, // message: rspMsg,
duration: 0, // duration: 0,
type: "error" // type: "error"
}) // })
// this.$message.error(rspMsg) // this.$message.error(rspMsg)
} }
this.$emit('refreshTree') this.$emit('refreshTree')
@ -615,7 +645,14 @@ export default {
} }
}, },
props: { props: {
staffAgencyId: {
type: String,
default: '',
},
showImportBtn: {
type: Boolean,
default: false,
},
} }
} }
</script> </script>

12
src/views/modules/importRecord/index.vue

@ -22,15 +22,19 @@
>导入中</span >导入中</span
> >
<span <span
v-else-if="scope.row.processStatus == 'finished'" v-else-if="scope.row.processStatus == 'finished_success'"
>已完成</span >已完成</span
> >
<a target="_blank" <a target="_blank"
:href="scope.row.resultDescFile" :href="scope.row.resultDescFile"
style="color: #00a7a9" style="color: #00a7a9;cursor:pointer;"
v-else-if="scope.row.processStatus == 'finished_fail'" v-else-if="scope.row.processStatus == 'finished_fail' && scope.row.resultDescFile"
>下载失败说明</a >下载失败说明</a
> >
<span
v-else-if="scope.row.processStatus == 'finished_fail' && !scope.row.resultDescFile"
>导入失败未知错误</span
>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -81,7 +85,7 @@ export default {
}, },
computed: { computed: {
maxTableHeight() { maxTableHeight() {
return this.clientHeight - 450; return this.clientHeight - 300;
}, },
...mapGetters(["clientHeight"]), ...mapGetters(["clientHeight"]),
}, },

16
src/views/modules/shequ/index.vue

@ -9,11 +9,17 @@
<div class="search"> <div class="search">
<div class="input"> <div class="input">
<select v-model="searchData.type"> <el-dropdown class="select"
<option value="jumin">居民</option> placement="bottom" v-model="searchData.type" @command="type => searchData.type = type">
<option value="fangwu">房屋</option> <span class="select-show">
<option value="xuqiu">需求</option> {{{jumin:'居民', fangwu: '房屋', xuqiu:'需求'}[searchData.type]}}<i class="el-icon-arrow-down el-icon--right"></i>
</select> </span>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item command="jumin">居民</el-dropdown-item>
<el-dropdown-item command="fangwu">房屋</el-dropdown-item>
<el-dropdown-item command="xuqiu">需求</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
<input <input
type="text" type="text"

286
src/views/modules/workSys/elegantCate.vue

@ -0,0 +1,286 @@
<template>
<div class="resi-container">
<el-card class="resi-card-table">
<div class="mod-sys__menu">
<div class="resi-row-btn">
<el-button class=""
type="success"
@click="addShow()">新增</el-button>
</div>
<el-table v-loading="dataListLoading"
:data="dataList"
:default-expand-all="false"
row-key="categoryId"
:cell-style="cellStyle"
border
style="width: 100%;" class="resi-table">
<el-table-column prop="categoryName"
label="分类名称"
header-align="center"
min-width="150"></el-table-column>
<el-table-column prop="stateShow"
label="状态"
header-align="center"
min-width="150"></el-table-column>
<!-- <el-table-column prop="sort"
:label="$t('menu.sort')"
header-align="center"
align="center"></el-table-column> -->
<el-table-column label="操作"
fixed="right"
header-align="center"
align="left"
width="350">
<template slot-scope="scope">
<el-button type="text"
size="small"
class="btn-color-look"
@click="disableCategory(scope.row)">{{ scope.row.btnShow}}</el-button>
<el-button type="text"
size="small"
class="btn-color-edit"
@click="editShow(scope.row)">修改</el-button>
<el-button type="text"
size="small"
class="btn-color-del"
@click="deleteCategory(scope.row)">删除</el-button>
</template>
</el-table-column>
</el-table>
</div>
</el-card>
<elegant-edit ref="ref_edit"
@editDiaOK="editDiaOK">
</elegant-edit>
</div>
</template>
<script>
import { requestPost } from '@/js/dai/request'
import elegantEdit from './elegantEdit.vue'
export default {
data () {
return {
customerId: '', // id
customerName: '', //
tableParams: {
customerId: ''
},
search: '',
dataList: [],
dataListLoading: false
}
},
computed: {
tables () {
const search = this.search
if (search) {
console.log('this.dataList', this.dataList)
return this.dataList.filter(dataNews => {
return Object.keys(dataNews).some(key => {
return String(dataNews[key]).toLowerCase().indexOf(search) > -1
})
})
}
console.log('this.dataList', this.dataList)
return this.dataList
}
},
components: {
elegantEdit
},
created() {
const { user } = this.$store.state
console.log('user----', user)
this.initData(user.customerId, user.customerName)
},
methods: {
cellStyle ({ row, column, rowIndex, columnIndex }) {
//
if (row.state === 'enable' && columnIndex === 1) {
return 'color: #EA1B29'
} else if (row.state === 'disable' && columnIndex === 1) {
return 'color: #0CB618'
} else {
return 'color: #1a1a1b'
}
},
initData (customerId, customerName) {
this.customerId = customerId
this.customerName = customerName
this.loadData()
},
//
async loadData () {
this.dataListLoading = true
// const url = 'https://nei.netease.com/api/apimock-v2/e3b1d0eb88e905f6c7ee559b2d6bb7ad/gov/issue/issueprojectcategorydict/customercategorylist'
const url = '/resi/partymember/stylecategorydict/list'
this.tableParams.customerId = this.customerId
const { data, code, msg } = await requestPost(url, this.tableParams)
this.dataListLoading = false
if (code === 0) {
this.dataList = data
this.dataList.forEach(element => {
element.state = element.beDisabled ? 'enable' : 'disable'
element.btnShow = element.beDisabled ? '启用' : '禁用'
element.stateShow = element.beDisabled ? '禁用' : '启用'
element.level = 'l1'
// if (element.children.length > 0) {
// element.children.forEach(child => {
// child.state = child.isDisable === 'enable' ? 'disable' : 'enable'
// child.btnShow = child.isDisable === 'enable' ? '' : ''
// child.stateShow = child.isDisable === 'enable' ? '' : ''
// child.level = 'l2'
// child.parentCategoryId = element.categoryId
// })
// }
})
} else {
// this.$message.error(msg )
}
},
// /
disableCategory (row) {
this.$confirm('确认' + row.btnShow + '当前分类?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
const url = '/resi/partymember/stylecategorydict/updatestatus'
// const url = 'https://nei.netease.com/api/apimock-v2/e3b1d0eb88e905f6c7ee559b2d6bb7ad/gov/issue/issueprojectcategorydict/isdisablecategory'
const param = {
customerId: this.customerId,
categoryId: row.categoryId,
beDisabled: row.state !== 'enable'
}
window.app.ajax.post(url, param,
(data, rspMsg) => {
this.$message.success('操作成功')
this.loadData()
},
(rspMsg, data) => {
this.$message.error(rspMsg)
})
}).catch(() => {
})
},
//
deleteCategory (row) {
this.$confirm('确认删除当前分类?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
const url = '/resi/partymember/stylecategorydict/delete'
// const url = 'https://nei.netease.com/api/apimock-v2/e3b1d0eb88e905f6c7ee559b2d6bb7ad/gov/issue/issueprojectcategorydict/delcategory'
const param = {
customerId: this.customerId,
categoryId: row.categoryId
}
window.app.ajax.post(url, param,
(data, rspMsg) => {
this.$message.success('操作成功')
this.loadData()
},
(rspMsg, data) => {
this.$message.error(rspMsg)
})
}).catch(() => {
})
},
// customerId,parentCategoryId,categoryId,type,level,num
addShow () {
const sort = this.dataList.length + 1
this.$refs['ref_edit'].initAdd(this.customerId, '', 'l1', sort)
},
// customerId,parentCategoryId,categoryId,type,levelnum
showAddLevel2 (row) {
const sort = row.children.length + 1
this.$refs['ref_edit'].initAdd(this.customerId, row.categoryId, 'l2', sort)
},
// customerId,parentCategoryId,dateform
editShow (row) {
this.$refs['ref_edit'].initEdit(this.customerId, row.categoryId, row)
},
//
diaCancel () {
this.$emit('cancleBack')
},
editDiaOK () {
this.loadData()
}
}
}
</script>
<style lang="scss" scoped>
.resi-container .resi-card-table {
::v-deep .el-table {
th {
color: #fff;
background-color: rgba(33, 149, 254, 1);
}
.cell {
span:nth-of-type(3) {
display: inline-block;
width: 90%;
word-break: break-all;
}
}
}
}
.resi-row-btn {
display: flex;
margin-bottom: 13px;
::v-deep .el-button {
// margin-left: 10px;
border: 0;
}
::v-deep .el-select {
margin-right: 10px;
}
.el-button--success {
background: rgba(34, 193, 195, 1);
}
}
.resi-table {
::v-deep .el-button--text {
text-decoration: underline;
}
::v-deep .btn-color-del {
margin-left: 10px;
color: rgba(213, 16, 16, 1);
}
::v-deep .btn-color-edit {
color: rgba(0, 167, 169, 1);
}
}
</style>

169
src/views/modules/workSys/elegantEdit.vue

@ -0,0 +1,169 @@
<template>
<el-dialog :visible.sync="visible"
:title="title"
:width="diaWidth+'%'"
:close-on-click-modal="false"
:before-close="handleClose"
:close-on-press-escape="false">
<el-form :inline="false"
:model="dataForm"
:rules="dataRule"
ref="dataForm"
:label-width="'120px'">
<div style="margin-top:20px">
<el-form-item label="分类名称"
prop="categoryName">
<el-tooltip class="item"
effect="dark"
content="请输入1-10个字"
placement="bottom-start">
<el-input class="item_width_1"
:maxlength="10"
:minlength="1"
v-model="dataForm.categoryName"
placeholder="分类名称"></el-input>
</el-tooltip>
</el-form-item>
<!-- <el-form-item label="排序"
prop="sort">
<el-input-number v-model="dataForm.sort"
:min="1"
label="描述文字"></el-input-number>
</el-form-item> -->
</div>
</el-form>
<template slot="footer">
<el-button @click="visible = false;resetData()">{{ $t('cancel') }}</el-button>
<el-button type="primary"
@click="saveForm()">{{ $t('confirm') }}</el-button>
</template>
</el-dialog>
</template>
<script>
import { mapGetters } from 'vuex'
import { requestPost } from '@/js/dai/request'
export default {
data () {
return {
visible: false,
title: '分类信息',
customerId: '',
parentCategoryId: '', // Id
categoryId: '', // Id
type: '', // (add: edit:)
dataForm: {
categoryName: '', //
sort: 0,
type: '', // (add: edit:)
level: ''
},
url: ''
}
},
created () {
// this.queryFunctionList()
},
computed: {
dataRule () {
return {
categoryName: [
{ required: true, message: '分类名称不能为空', trigger: 'blur' },
{ min: 2, max: 20, message: '分类名称长度在 2 到 20 个字符', trigger: 'blur' }
]
}
},
diaWidth () {
console.log(this.resolution)
return this.resolution === 'small' ? 70 : 50
},
...mapGetters(['clientHeight', 'resolution'])
},
methods: {
// customerId,parentCategoryId ,level,
initAdd (customerId, parentCategoryId, level, sort) {
this.visible = true
this.customerId = customerId
this.parentCategoryId = parentCategoryId
this.type = 'add'
this.dataForm.level = level
this.dataForm.sort = sort
this.url = '/resi/partymember/stylecategorydict/addorupdate'
},
// customerId,parentCategoryId,dateform,level
initEdit (customerId, parentCategoryId, dataForm) {
this.visible = true
this.customerId = customerId
this.parentCategoryId = parentCategoryId
this.type = 'edit'
this.dataForm = dataForm
this.url = '/resi/partymember/stylecategorydict/addorupdate'
},
async saveForm () {
await this.$refs['dataForm'].validate((valid, messageObj) => {
if (!valid) {
window.app.util.validateRule(messageObj)
return false
}
})
let params = {
customerId: this.customerId,
categoryId: this.dataForm.categoryId,
categoryName: this.dataForm.categoryName
}
const { data, code, msg } = await requestPost(this.url, params)
if (code === 0) {
this.$message({
type: 'success',
message: '保存成功'
})
this.resetData()
this.visible = false
this.$emit('editDiaOK')
} else {
this.$message.error(msg)
}
},
handleClose () {
this.visible = false
},
resetData () {
this.dataForm = {
categoryName: '', //
sort: 0,
type: ''// (add: edit:)
}
}
}
}
</script>
<style scoped>
.item_width_1 {
width: 400px;
}
.item_width_2 {
width: 700px;
}
.block {
display: block;
}
.btn_reset {
vertical-align: bottom;
margin-left: 10px;
}
</style>
Loading…
Cancel
Save