Ver código fonte

init

newStyle
wangxiaohua 3 anos atrás
pai
commit
af6d496c41
10 arquivos alterados com 1417 adições e 615 exclusões
  1. +9
    -17
      src/api/admin/log.js
  2. +74
    -0
      src/api/modules/api.js
  3. +12
    -22
      src/const/crud/admin/log.js
  4. +177
    -15
      src/page/check/chose.vue
  5. +5
    -5
      src/page/check/index.vue
  6. +0
    -16
      src/views/admin/log/index.vue
  7. +92
    -0
      src/views/admin/log/log.vue
  8. +1
    -1
      src/views/admin/user/index.vue
  9. +317
    -305
      src/views/building/area.vue
  10. +730
    -234
      src/views/building/index.vue

+ 9
- 17
src/api/admin/log.js Ver arquivo

@@ -1,25 +1,17 @@
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the pig4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/


import request from '@/router/axios'

export function fetchList(query) {
return request({
url: '/admin/log/page',
url: '/admin/log/loginLogPage',
method: 'get',
params: query
})
}
export function fetchList1(query) {
return request({
url: '/admin/log/operateLogPage',
method: 'get',
params: query
})


+ 74
- 0
src/api/modules/api.js Ver arquivo

@@ -275,6 +275,14 @@ export function areamanagerList(query) {
params:query
})
}
// 获取当前登录人的区域
export function findArea(query) {
return request({
url: 'autoSR/cushouseuserrelationmid/findArea ',
method:'get',
params:query
})
}
// 通过地区串获取省市
export function getParentAndKidList(query) {
return request({
@@ -310,3 +318,69 @@ export function rolePage(query) {
params:query
})
}


// 楼盘管理,获取公司列表
export function getCompanyList(query) {
return request({
url: '/autoSR/zkorg/findMyOrg',
method:'get',
params:query
})
}
// 获取楼盘管理列表
export function zkhousePage(query) {
return request({
url: '/autoSR/zkhouse/page',
method:'get',
params:query
})
}

// 获取省市
export function getAreaList(query) {
return request({
url: '/autoSR/zksysarea/list',
method:'get',
params:query
})
}
// 获取当前人的区域的楼盘
export function findHouseByArea(query) {
return request({
url: 'autoSR/cushouseuserrelationmid/findHouseByArea',
method:'get',
params:query
})
}
// 获取运营人员
export function getAllOperationsStaff(query) {
return request({
url: '/admin/user/getAllOperationsStaff',
method:'get',
params:query
})
}
// 添加楼盘
export function addZkhouse(data) {
return request({
url: '/autoSR/zkhouse',
method:'post',
data
})
}
export function editZkhouse(data) {
return request({
url: '/autoSR/zkhouse',
method:'put',
data
})
}
// 更换账号
export function updateManagerPhone(data) {
return request({
url: '/autoSR/zkhouse/updateManagerPhone',
method:'post',
data
})
}

+ 12
- 22
src/const/crud/admin/log.js Ver arquivo

@@ -1,19 +1,3 @@
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the pig4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
export const tableOption = {
border: true,
index: true,
@@ -21,11 +5,13 @@ export const tableOption = {
stripe: true,
menuAlign: 'center',
menuWidth: 150,

align: 'center',
refreshBtn: true,
showClomnuBtn: false,
searchSize: 'mini',
searchMenuSpan: 6,
delBtn:false,
addBtn: false,
editBtn: false,
viewBtn: true,
@@ -51,18 +37,22 @@ export const tableOption = {
}, {
label: '客户端',
prop: 'serviceId'
}, {
width: 80,
label: '请求时间',
prop: 'time'
}, {
},
// {
// width: 80,
// label: '请求时间',
// prop: 'time'
// },
{
width: 150,
label: '创建时间',
label: '登录时间',
prop: 'createTime',
type: 'datetime',
rangeSeparator:"-",
format: 'yyyy-MM-dd HH:mm',
valueFormat: 'yyyy-MM-dd HH:mm:ss',
search: true,
searchRange: true
}]
}


+ 177
- 15
src/page/check/chose.vue Ver arquivo

@@ -27,7 +27,12 @@
>
</div>
<div class="con">
<div v-for="item in list" :key="item.id" class="tab" @click="chose(item)">
<div
v-for="item in list"
:key="item.id"
class="tab"
@click="chose(item)"
>
<div class="text-1">{{ item.agentName }}</div>
<div class="text-2">
服务状态:
@@ -69,7 +74,7 @@
</el-row>
</div> -->
<div class="content" v-if="flag == 2">
<div class="search">
<div class="search">
<el-input
placeholder="请输入内容"
style="width: 200px; margin-left: 40px; margin-right: 30px"
@@ -86,7 +91,13 @@
>
</div>
<div class="con">
<div v-for="item in list" :key="item.id" class="tab" style="height:78px;" @click="chose(item)">
<div
v-for="item in list"
:key="item.id"
class="tab"
style="height: 78px"
@click="chose(item)"
>
<div class="text-1">{{ item.name }}</div>
<!-- <div class="text-2">
服务状态:
@@ -96,11 +107,73 @@
>{{ item.residueTime > 0 ? "服务中" : "已过期" }}</span
>
</div> -->
<div class="text-3">区域位置:{{ item.address||'暂无' }}</div>
<div class="text-3">区域位置:{{ item.address || "暂无" }}</div>
</div>
</div>
</div>
<div class="content" v-if="flag == 3">
<div class="search">
<span style="line-height: 32px; margin-right: 20px">区域:</span>
<el-cascader
:props="props"
v-if="info.selectHouseType == 1"
@change="locationsChange"
placeholder="省/市"
size="small"
separator="/"
v-model="provice"
clearable
></el-cascader>
<el-select
v-model="area"
v-if="info.selectHouseType == 2"
placeholder="请选择"
class="div-inp"
>
<el-option
v-for="item in options"
:key="item.value"
:label="item.label"
:value="item.value"
>
</el-option>
</el-select>
<el-input
v-if="info.selectHouseType == 1"
placeholder="请输入楼盘名称"
style="width: 200px; margin-left: 40px; margin-right: 30px"
v-model="propertyName"
clearable
>
</el-input>
<el-button
style="height: 32px; line-height: 13px"
type="primary"
size="medium"
@click="zkhousePage"
>搜索</el-button
>
</div>
<div class="con">
<div
v-for="item in list"
:key="item.id"
class="tab"
@click="chose(item)"
>
<div class="text-1">{{ item.propertyName }}</div>
<div class="text-2">
服务状态:
<span
style="font-size: 12px"
:style="item.residueTime > 0 ? 'color:green;' : 'color:red;'"
>{{ item.residueTime > 0 ? "服务中" : "已过期" }}</span
>
</div>
<div class="text-3">{{ item.address }}</div>
</div>
</div>
</div>
<div class="content" v-if="flag == 3">这是楼盘</div>
<el-pagination
style="margin: 20px auto"
class="page"
@@ -115,21 +188,61 @@
</template>

<script>
import { getAreaList } from "@/api/modules/api";
import { getStore, setStore } from "@/util/store";
export default {
data() {
return {
props: {
lazy: true,
async lazyLoad(node, resolve) {
const { level } = node;
if (level == 0) {
// console.log(23);
const { data } = await getAreaList({ parentId: 0 }); //获取省接口
var nodes = data.map((item) => {
return {
value: item.id,
label: item.name,
leaf: false,
};
});
resolve(nodes);
} else if (level == 1) {
const { data } = await getAreaList({ parentId: node.data.value }); //获取市接口
var nodes = data.map((item) => {
return {
value: item.id,
label: item.name,
leaf: true,
};
});
resolve(nodes);
}
},
},
flag: 1,
provice: [],
area:'',
provinceId: "", //省id
cityId: "", //市id
currentPage: 1,
propertyName: "",
agentName: "", //代理商名称
companyName:'',
total:20,
companyName: "",
total: 20,
list: [],
options: [],
info: {},
};
},
mounted() {
// console.log(this.$route.query)
// 给定一个标志做判断显隐
this.flag = this.$route.query.flag;
// 获取用户信息
this.info = getStore({ name: "userInfo" });

// 获取数据
if (this.flag == 1) {
// 获取代理商
@@ -137,9 +250,12 @@ export default {
this.getAgentList();
} else if (this.flag == 2) {
// 获取公司
this.getCompanyList()
this.getCompanyList();
} else {
// 获取楼盘
this.zkhousePage();
// 获取区域列表
this.findArea()
}
},
computed: {},
@@ -155,25 +271,65 @@ export default {
.then((res) => {
console.log(res);
this.list = res.data.records;
this.total=res.data.total
this.total = res.data.total;
});
},
getCompanyList() {
getCompanyList() {
this.$api.api
.zkorg({
current: this.currentPage,
size: 10,
name: this.companyName,
orgType:localStorage.getItem('orgType')
orgType: localStorage.getItem("orgType"),
})
.then((res) => {
console.log(res);
this.list = res.data.records;
this.total=res.data.total
this.total = res.data.total;
});
},
findArea(){
this.$api.api.findArea()
.then(res=>{
console.log(res)
this.options=res.data.records
})
},
zkhousePage() {
let obj = {
current: this.currentPage,
size: this.size,
propertyName: this.propertyName,
};
if(this.info.selectHouseType == 1){
this.$api.api.zkhousePage(obj).then((res) => {
// console.log(res)
this.list = res.data.records;
this.total = res.data.total;
});
}
if(this.info.selectHouseType == 2){
this.$api.api.findHouseByArea({
id:this.area
}).then((res) => {
// console.log(res)
this.list = res.data.records;
this.total = res.data.total;
});
}

},
chose(item) {
console.log(item)
console.log(item);
if (this.flag == 1) {
localStorage.setItem("agentId", item.id);
}
if (this.flag == 2) {
localStorage.setItem("orgCode", item.orgCode);
}
if (this.flag == 3) {
localStorage.setItem("orgCode", item.orgCode);
}
this.$router.push({ path: "/wel" });
},
goback() {
@@ -190,17 +346,23 @@ export default {
this.getAgentList();
} else if (this.flag == 2) {
// 获取公司
this.getCompanyList()
this.getCompanyList();
} else {
// 获取楼盘
}
},
locationsChange(e) {
console.log(e);
if (!e) return;
this.provinceId = e[0];
this.cityId = e[1];
},
},
};
</script>

<style lang="scss" scoped >
.box-center{
.box-center {
min-width: 1500px;
}
.head {


+ 5
- 5
src/page/check/index.vue Ver arquivo

@@ -58,11 +58,11 @@ export default {
this.$api.api.getTab().then((res) => {
// console.log(res)
// 循环数组,给定各种标志
this.tabFlag1 = true;
this.tabFlag2 = true;
this.tabFlag3 = true;
this.tabFlag4 = true;
return
this.tabFlag1 = false;
this.tabFlag2 = false;
this.tabFlag3 = false;
this.tabFlag4 = false;
// return
res.data.map((item) => {
if (item.orgType == 0) {
this.tabFlag1 = true;


+ 0
- 16
src/views/admin/log/index.vue Ver arquivo

@@ -1,19 +1,3 @@
<!--
- Copyright (c) 2018-2025, lengleng All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
- Neither the name of the pig4cloud.com developer nor the names of its
- contributors may be used to endorse or promote products derived from
- this software without specific prior written permission.
- Author: lengleng (wangiegie@gmail.com)
-->

<template>
<div class="log">


+ 92
- 0
src/views/admin/log/log.vue Ver arquivo

@@ -0,0 +1,92 @@

<template>
<div class="log">
<basic-container>
<avue-crud
ref="crud"
:page.sync="page"
:data="tableData"
:table-loading="tableLoading"
:option="tableOption"
:permission="permissionList"
@on-load="getList"
@search-change="searchChange"
@refresh-change="refreshChange"
@size-change="sizeChange"
@current-change="currentChange"
@row-del="handleDel"/>
</basic-container>
</div>
</template>

<script>
import {delObj, fetchList1} from '@/api/admin/log'
import {tableOption} from '@/const/crud/admin/log'
import {mapGetters} from 'vuex'

export default {
name: 'Log',
data() {
return {
tableData: [],
searchForm: {},
page: {
total: 0, // 总页数
currentPage: 1, // 当前页数
pageSize: 20 // 每页显示多少条
},
tableLoading: false,
tableOption: tableOption
}
},
computed: {
...mapGetters(['permissions']),
permissionList() {
return {
delBtn: this.vaildData(this.permissions.sys_log_del, false)
}
}
},
methods: {
getList(page, params) {
this.tableLoading = true
fetchList1(Object.assign({
descs: 'create_time',
current: page.currentPage,
size: page.pageSize
}, params, this.searchForm)).then(response => {
this.tableData = response.data.records
this.page.total = response.data.total
this.tableLoading = false
})
},
handleDel: function (row) {
this.$confirm('是否确认删除ID为"' + row.id + '"的日志?', '警告', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(function () {
return delObj(row.id)
}).then(() => {
this.getList(this.page)
this.$message.success('删除成功')
})
},
searchChange(form, done) {
this.searchForm = form
this.page.currentPage = 1
this.getList(this.page, form)
done()
},
sizeChange(pageSize) {
this.page.pageSize = pageSize
},
currentChange(current) {
this.page.currentPage = current
},
refreshChange() {
this.getList(this.page)
}
}
}
</script>

+ 1
- 1
src/views/admin/user/index.vue Ver arquivo

@@ -1105,7 +1105,7 @@
})
.then(res=>{
// console.log(res)
this.managerList=res.data
this.managerList=res.data.records
})
},
// 获取楼盘列表


+ 317
- 305
src/views/building/area.vue Ver arquivo

@@ -1,291 +1,303 @@
<template>
<div class="box-center">
<div class="center-er">
<div class="app-titel">
<div class="app-titel-name">区域管理
<div style="margin-left: 20px" v-if="roleFlag!=1">
<el-select v-model="orgCode" filterable @change="getTableList" placeholder="请选择公司">
<el-option
v-for="item in optionsOrg"
:key="item.id"
:label="item.name"
:value="item.orgCode">
</el-option>
</el-select>
</div>
</div>
<el-button class="app-titel-btn" type="primary" @click="addClick">新增</el-button>
</div>
<div class="app-box">

<el-table
:data="tableData"
border
style="width: 100%"
:header-cell-style="{textAlign: 'center'}"
:cell-style="{ textAlign: 'center' }"
>
<el-table-column
prop="areaName"
label="区域名称"
width="180">
</el-table-column>
<el-table-column
prop="provinceName"
label="负责区域">
</el-table-column>
<el-table-column
label="操作"
width="250">
<template slot-scope="scope">
<el-button type="text" @click="edit(scope.row)">编辑</el-button>
<el-button type="text" @click="del(scope.row)">删除</el-button>
</template>
</el-table-column>
</el-table>
</div>
<div class="block">
<div class="blockbox">
<el-pagination
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="currentPage"
:page-sizes="[10, 12, 16, 20]"
:page-size="10"
layout="total, sizes, prev, pager, next, jumper"
:total="page.total">
</el-pagination>
</div>
</div>
<el-dialog title="新增区域" :visible.sync="dialogVisible" @close="formClose">
<el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="100px">
<el-form-item label="区域名称" prop="areaName">
<el-input v-model="ruleForm.areaName"></el-input>
</el-form-item>
<el-form-item label="负责省份" prop="provinceItem">
<el-select v-model="ruleForm.provinceItem" placeholder="请选择负责省份" multiple style="width: 100%">
<el-option
v-for="item in options"
:key="item.id"
:label="item.name"
:value="item.code">
</el-option>
</el-select>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="dialogVisible = false">取 消</el-button>
<el-button type="primary" @click="add">{{editFlag?'编 辑':'确 定'}}</el-button>
</div>
</el-dialog>
<div class="app-titel">
<div class="app-titel-name">
区域管理
<div style="margin-left: 20px" v-if="orgType == 0">
<el-select
v-model="orgCode"
filterable
@change="getTableList"
placeholder="请选择公司"
>
<el-option
v-for="item in optionsOrg"
:key="item.id"
:label="item.name"
:value="item.orgCode"
>
</el-option>
</el-select>
</div>
</div>
<el-button class="app-titel-btn" type="primary" @click="addClick"
>新增</el-button
>
</div>
<div class="app-box">
<el-table
:data="tableData"
border
style="width: 100%"
:header-cell-style="{ textAlign: 'center' }"
:cell-style="{ textAlign: 'center' }"
>
<el-table-column prop="areaName" label="区域名称" width="180">
</el-table-column>
<el-table-column prop="provinceName" label="负责区域">
</el-table-column>
<el-table-column label="操作" width="250">
<template slot-scope="scope">
<el-button type="text" @click="edit(scope.row)">编辑</el-button>
<el-button type="text" @click="del(scope.row)">删除</el-button>
</template>
</el-table-column>
</el-table>
</div>
<div class="block">
<div class="blockbox">
<el-pagination
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="currentPage"
:page-sizes="[10, 12, 16, 20]"
:page-size="10"
layout="total, sizes, prev, pager, next, jumper"
:total="page.total"
>
</el-pagination>
</div>
</div>
<el-dialog
title="新增区域"
:visible.sync="dialogVisible"
@close="formClose"
>
<el-form
:model="ruleForm"
:rules="rules"
ref="ruleForm"
label-width="100px"
>
<el-form-item label="区域名称" prop="areaName">
<el-input v-model="ruleForm.areaName"></el-input>
</el-form-item>
<el-form-item label="负责省份" prop="provinceItem">
<el-select
v-model="ruleForm.provinceItem"
placeholder="请选择负责省份"
multiple
style="width: 100%"
>
<el-option
v-for="item in options"
:key="item.id"
:label="item.name"
:value="item.code"
>
</el-option>
</el-select>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="dialogVisible = false">取 消</el-button>
<el-button type="primary" @click="add">{{
editFlag ? "编 辑" : "确 定"
}}</el-button>
</div>
</el-dialog>
</div>
</div>
</template>

<script>
export default {
name: "area",
data() {
return {
tableData: [],
page:{
pageNum:1,
pageSize:10,
total:100
},
currentPage:1,
dialogVisible:false,
editFlag:false,
//公司列表
optionsOrg:[],
ruleForm:{
areaName:'',
provinceItem:[],
},
orgCode:'',
rules:{
areaName: [
{ required: true, message: '请输入区域名称', trigger: 'blur' },
],
provinceItem: [
{ required: true, message: '请选择负责省份', trigger: 'change' }
],
},
options:[],
roleFlag:''
tableData: [],
page: {
pageNum: 1,
pageSize: 10,
total: 100,
},
currentPage: 1,
dialogVisible: false,
editFlag: false,
//公司列表
optionsOrg: [],
ruleForm: {
areaName: "",
provinceItem: [],
},
orgCode: "",
orgType:localStorage.getItem("orgType"),
rules: {
areaName: [
{ required: true, message: "请输入区域名称", trigger: "blur" },
],
provinceItem: [
{ required: true, message: "请选择负责省份", trigger: "change" },
],
},
options: [],
roleFlag: "",
};
},

mounted() {
// 获取公司列表
this.getCompanyList();
},
methods: {
addClick(){
this.dialogVisible=true
this.editFlag=false
this.getArea()
},
edit(row){
// console.log(row,'编辑')
this.getArea(row.provinceItem)
this.editFlag=true
this.ruleForm=row
this.ruleForm.provinceItem=this.ruleForm.provinceItem.split(',')
// this.ruleForm.provinceItem.map(item=>item/1)
console.log(this.ruleForm)
this.dialogVisible = true
},
del(row){
console.log(row,'删除')
this.$confirm(`是否删除区域?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
distinguishCancelAndClose: true,
type: 'warning'
}).then(()=>{
axios({
url:`${jypath}/properties/areaDelete`,
method: 'post',
data:{
id:row.id
},
}).then(res=>{
if(res.data.res==1){
this.$message.success('删除成功')
this.getTableList()
}else{
this.$message.warning(res.data.resMsg)
}
})
}
)
},
add(){
this.$refs.ruleForm.validate((valid)=>{
if(valid){
// console.log(this.ruleForm)
if(this.editFlag){
axios({
url:`${jypath}/properties/areaUpdate`,
method: 'post',
data:{
areaName:this.ruleForm.areaName,
provinceItem:this.ruleForm.provinceItem.join(','),
id:this.ruleForm.id,
orgCode:this.orgCode
},
}).then(res=>{
if(res.data.res==1){
this.$message.success('编辑成功')
this.dialogVisible = false
}
})
}else{
axios({
url:`${jypath}/properties/areaAdd`,
method: 'post',
data:{
areaName:this.ruleForm.areaName,
provinceItem:this.ruleForm.provinceItem.join(','),
orgCode:this.orgCode
},
}).then(res=>{
if(res.data.res==1){
this.$message.success('添加成功')
this.dialogVisible = false
}
})
}
}
})

},
formClose(){
this.$refs.ruleForm.resetFields()
this.getTableList()
this.ruleForm={
areaName:'',
provinceItem:[]
}
},
//获取table数据、
getTableList(){
axios({
url:`${jypath}/properties/queryByPage`,
method: 'get',
params:{
pageNum:this.page.pageNum,
pageSize:this.page.pageSize,
orgCode:this.orgCode
},
}).then(res=>{
if(res.data.res==1){
// console.log(res.data.obj.results)
this.tableData=res.data.obj.results
if(res.data.obj.totalRecord!=0&&this.tableData.length==0){
this.page.pageNum--
this.getTableList()
}
this.page.total = res.data.obj.totalRecord;
}
})
},
//获取公司数据、
getCompanyList(){
axios({
url:`${jypath}/backstage/org/role/findAll`,
method: 'get',
}).then(res=>{
if(res.data.res==1){
// console.log(res.data.obj.results)
this.optionsOrg=res.data.obj
if(this.roleFlag!=1){
this.orgCode=this.optionsOrg[0].orgCode
}
this.getTableList()

}
})
},
//获取用户数据
getDet(){
axios({
url:`${jypath}/backstage/account/getUserIdentity`,
method: 'get',
}).then(res=>{
if(res.data.res==1){
console.log(res.data.obj)
this.roleFlag=res.data.obj
}
})
},
//获取省份
getArea(id){
axios({
url:`${jypath}/properties/list`,
method: 'get',
params: {
parentId:0,
parentIds:id,
orgCode:this.orgCode
}
}).then(res=>{
if(res.data.res==1){
// console.log(res.data.obj)
this.options=res.data.obj
}
})
},
handleSizeChange(val) {
console.log("每页条" + val);
this.page.pageSize = val;
this.getTableList()

},
handleCurrentChange(val) {
console.log("当前页" + val);
this.page.pageNum = val;
this.getTableList()
}

addClick() {
this.dialogVisible = true;
this.editFlag = false;
this.getArea();
},
edit(row) {
// console.log(row,'编辑')
this.getArea(row.provinceItem);
this.editFlag = true;
this.ruleForm = row;
this.ruleForm.provinceItem = this.ruleForm.provinceItem.split(",");
// this.ruleForm.provinceItem.map(item=>item/1)
console.log(this.ruleForm);
this.dialogVisible = true;
},
del(row) {
console.log(row, "删除");
this.$confirm(`是否删除区域?`, "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
distinguishCancelAndClose: true,
type: "warning",
}).then(() => {
axios({
url: `/autoSR/areamanager/${row.id}`,
method: "delete",
// params: {
// id: row.id,
// },
}).then((res) => {
if (res.code == 0) {
this.$message.success("删除成功");
this.getTableList();
} else {
this.$message.warning(res.resMsg);
}
});
});
},
add() {
this.$refs.ruleForm.validate((valid) => {
if (valid) {
// console.log(this.ruleForm)
if (this.editFlag) {
axios({
url: `/autoSR/areamanager`,
method: "put",
data: {
areaName: this.ruleForm.areaName,
provinceItem: this.ruleForm.provinceItem.join(","),
id: this.ruleForm.id,
orgCode: this.orgCode,
},
}).then((res) => {
if (res.code == 0) {
this.$message.success("编辑成功");
this.dialogVisible = false;
}
});
} else {
axios({
url: `/autoSR/areamanager`,
method: "post",
data: {
areaName: this.ruleForm.areaName,
provinceItem: this.ruleForm.provinceItem.join(","),
orgCode: this.orgCode,
},
}).then((res) => {
if (res.code == 0) {
this.$message.success("添加成功");
this.dialogVisible = false;
}
});
}
}
});
},
formClose() {
this.$refs.ruleForm.resetFields();
this.getTableList();
this.ruleForm = {
areaName: "",
provinceItem: [],
};
},
//获取table数据、
getTableList() {
axios({
url: `/autoSR/areamanager/list`,
method: "get",
params: {
current: this.page.pageNum,
size: this.page.pageSize,
orgCode: this.orgCode,
},
}).then((res) => {
if (res.code == 0) {
console.log(res)
this.tableData = res.data.records;
if (res.data.total != 0 && this.tableData.length == 0) {
this.page.pageNum--;
this.getTableList();
}
this.page.total = res.data.total;
}
});
},
//获取公司数据、
getCompanyList() {
axios({
url: `/autoSR/zkorg/findMyOrg`,
method: "get",
params: {
orgType: 0,
},
}).then((res) => {
if (res.code == 0) {
// console.log(res)
this.optionsOrg = res.data;
if (this.orgType == 0) {
this.orgCode = this.optionsOrg[0].orgCode;
console.log(this.orgCode,'123')
}
if(this.orgType==2){
this.orgCode=localStorage.getItem('orgCode')
}
this.getTableList();
}
});
},
//获取省份
getArea(id) {
axios({
url: `autoSR/areamanager/findMyProvince`,
method: "get",
params: {
parentId: 0,
parentIds: id,
orgCode: this.orgCode,
},
}).then((res) => {
if (res.code == 0) {
// console.log(res.obj)
this.options = res.data;
}
});
},
handleSizeChange(val) {
console.log("每页条" + val);
this.page.pageSize = val;
this.getTableList();
},
handleCurrentChange(val) {
console.log("当前页" + val);
this.page.pageNum = val;
this.getTableList();
},
},
};
</script>

@@ -295,44 +307,44 @@ export default {
padding: 15px;
min-width: 1200px;
padding-bottom: 100px;
.center-er{
.center-er {
width: 100%;
height: 80vh;
background: #ffffff;
border-radius: 4px;

.app-titel {
width: 100%;
background: #FFFFFF;
border-radius: 8px;
display: flex;
justify-content: space-between;
padding: 0 10px;
padding-top: 15px;
}
.app-titel-name{
text-align: center;
line-height: 40px;
display: flex;
}
.app-titel-btn{
height: 30px;
margin-top: 5px;
line-height: 6px;
}
.app-box{
margin-top: 20px;
}
.block {
width: 100%;
margin-top: 26px;
/*display: flex;*/
text-align: center;
}
.app-titel {
width: 100%;
background: #ffffff;
border-radius: 8px;
display: flex;
justify-content: space-between;
padding: 0 10px;
padding-top: 15px;
}
.app-titel-name {
text-align: center;
line-height: 40px;
display: flex;
}
.app-titel-btn {
height: 30px;
margin-top: 5px;
line-height: 6px;
}
.app-box {
margin-top: 20px;
}
.block {
width: 100%;
margin-top: 26px;
/*display: flex;*/
text-align: center;
}

.blockbox {
margin-left: auto;
}
.blockbox {
margin-left: auto;
}
}
}
</style>


+ 730
- 234
src/views/building/index.vue
Diferenças do arquivo suprimidas por serem muito extensas
Ver arquivo


Carregando…
Cancelar
Salvar