描述:企业

This commit is contained in:
SelfRidicule 2024-04-03 12:00:44 +08:00
parent b17efcc393
commit e5a78d0ff7
2 changed files with 244 additions and 69 deletions

View File

@ -125,6 +125,16 @@ export function getRoomListByFloorId (parameter) {
})
}
export function getRoomListByBuildIdsRq (parameter) {
return axios({
url: api.roomContent + '/getRoomListByBuildIds',
method: 'post',
data: parameter,
headers: {
'Content-Type': 'application/json;charset=UTF-8'
}
})
}
export function selectRoomItemByRoom (parameter) {
return axios({

View File

@ -40,19 +40,50 @@
</a-col>
<a-col :span='12'>
<a-form-item :labelCol='labelColHalf' :wrapperCol='wrapperColHalf' label='楼层'>
<a-select v-decorator="['buildId',{rules: [{ required: true, message: '请选择所属楼层' }]}]"
placeholder='所属楼层' @change='getRoomList'>
<a-select-option v-for='item in floorList' :key='item.id' :value='item.id'>
<a-form-item :labelCol='labelColHalf' :wrapperCol='wrapperColHalf' label='所属地区'>
<a-select v-decorator="['tenantId', {rules: [{ required: true, message: '请选择所属地区' }]}]"
@change='selectTenant'
:disabled='tenantEnable'>
<a-select-option v-for='item in tenantList' :key='item.id'>{{ item.name }}</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :span='12'>
<a-form-item :labelCol='labelColHalf' :wrapperCol='wrapperColHalf' label='所属园区'>
<a-select v-decorator="['parkId', {rules: [{ required: true, message: '请选择所属园区' }]}]"
@change='selectPark'
:disabled='parkEnable'>
<a-select-option v-for='item in parkList' :key='item.id'>{{ item.name }}</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :span='12'>
<a-form-item :labelCol='labelColHalf' :wrapperCol='wrapperColHalf' label='所属楼宇'>
<a-select v-decorator="['buildingId', {rules: [{ required: true, message: '请选择所属楼宇' }]}]"
@change='selectBuilding'>
<a-select-option v-for='item in buildingList' :key='item.id'>{{ item.buildingName }}</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :span='12'>
<a-form-item :labelCol='labelColHalf' :wrapperCol='wrapperColHalf' label='所属楼层'>
<a-select v-decorator="['buildingDetailIds',{rules: [{ required: true, message: '请选择所属楼层' }]}]"
placeholder='所属楼层'
mode='multiple'
@change='selectBuildingDetail'>
<a-select-option v-for='item in buildingDetailList' :key='item.id' :value='item.id'>
{{ item.floorName }}
</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :span='12'>
<a-form-item :labelCol='labelColHalf' :wrapperCol='wrapperColHalf' label='房间'>
<a-select v-decorator="['roomId',{rules: [{ required: true, message: '选择所属房间' }]}]"
placeholder='所属房间'>
<a-form-item :labelCol='labelColHalf' :wrapperCol='wrapperColHalf' label='所属房间'>
<a-select v-decorator="['roomIds',{rules: [{ required: true, message: '选择所属房间' }]}]"
placeholder='所属房间'
mode='multiple'>
<a-select-option v-for='item in roomList' :key='item.id' :value='item.id'>
{{ item.name }}
</a-select-option>
@ -116,7 +147,8 @@
</a-col>
<a-col :span='12'>
<a-form-item :labelCol='labelColHalf' :wrapperCol='wrapperColHalf' label='联系电话'>
<a-input placeholder='联系电话' v-decorator="['phone',{rules: [{ required: true, message: '请输入联系电话' }]}]" />
<a-input placeholder='联系电话'
v-decorator="['phone',{rules: [{ required: true, message: '请输入联系电话' }]}]" />
</a-form-item>
</a-col>
<a-col :span='12'>
@ -200,7 +232,7 @@
</a-col>
<a-col :span='8'>
<a-form-item :labelCol='labelColOneThird' :wrapperCol='wrapperColOneThird' label='是否黑名单'>
<a-switch :checked='customerForm.isBlacklist' @change='onChangeBlacklist'
<a-switch :checked='mdl.isBlacklist' @change='onChangeBlacklist'
v-decorator="['isBlacklist']" />
</a-form-item>
</a-col>
@ -376,6 +408,8 @@
<script>
import { getTenantList } from '@/api/tenant'
let downloadLoadingInstance
import moment from 'moment'
import storage from 'store'
@ -395,7 +429,8 @@ import {
} from '@/api/admin/customer'
import {
getFloorList,
getRoomListByFloorId
getRoomListByFloorId,
getRoomListByBuildIdsRq
} from '@/api/admin/meeting/roomContent'
import { getCustomerContractList } from '@/api/admin/customerContract'
import CustomerContactsModal from './modules/CustomerContactsModal.vue'
@ -403,6 +438,10 @@ import CustomerAttachmentList from './modules/CustomerAttachmentList.vue'
import pick from 'lodash.pick'
import { message } from 'ant-design-vue'
import { download } from '@/utils/request'
import { getParkList } from '@/api/admin/park'
import { getBuildingList } from '@/api/admin/building'
import { getBuildingDetailList } from '@/api/admin/buildingDetail'
import { getInfo } from '@/api/login'
export default {
name: 'BaseForm',
@ -494,7 +533,7 @@ export default {
dataIndex: 'floorName',
scopedSlots: { customRender: 'floorName' }
},
}
],
deviceData: [],
labelColHalf: {
@ -526,7 +565,6 @@ export default {
selectedDeviceRowKeys: [],
selectedRowKeys: [],
customerForm: {},
uploadUrl: process.env.VUE_APP_API_BASE_URL + '/api/dfs/upload',
headers: {
Authorization: 'Bearer ' + storage.get(ACCESS_TOKEN)
@ -539,11 +577,17 @@ export default {
userId: '',
// form
form: this.$form.createForm(this),
floorList: [],
roomList: [],
file: '',
visible: false,
visible1: false,
tenantList: [], //
parkList: [], //
buildingList: [], //
buildingDetailList: [], //
roomList: [], //
tenantEnable: false,
parkEnable: false,
mdl: {}
}
},
filters: {
@ -567,11 +611,128 @@ export default {
this.defaultActiveKey = '2'
}
this.handleInit()
//
this.getFloorDataList()
this.selectUserDeviceList()
//
this.getTenantData()
},
methods: {
//
getUserDetail() {
getInfo().then(res => {
console.log('getUserDetail', res)
this.userDetail = res
// 5
if (this.userDetail.roleIds && this.userDetail.roleIds.length > 0 && this.userDetail.roleIds[0] == 5) {
//
//
const { customerId } = this.$route.query
if (!customerId) {
// ->
this.selectTenant(this.userDetail.tenantId)
// ->
this.selectPark(this.userDetail.parkId)
}
//
//
this.tenantEnable = true
this.parkEnable = true
//
this.mdl.parkId = this.userDetail.parkId
this.mdl.tenantId = this.userDetail.tenantId
this.form.setFieldsValue({
parkId: this.mdl.parkId,
tenantId: this.mdl.tenantId
})
}
})
},
//
getTenantData() {
getTenantList().then(res => {
this.tenantList = res.rows
})
},
// ->
selectTenant(id) {
console.log('selectTenant', id)
//
this.mdl.parkId = null //
this.mdl.buildingId = null //
this.mdl.buildingDetailIds = [] //
this.mdl.roomIds = [] //
this.form.setFieldsValue({
parkId: null, //
buildingId: null, //
buildingDetailIds: [], //
roomIds: [] //
})
//
getParkList({
tenantId: id
}).then(res => {
this.parkList = res.rows
})
},
// ->
selectPark(id) {
//
this.mdl.buildingId = null //
this.mdl.buildingDetailIds = [] //
this.mdl.roomIds = [] //
this.form.setFieldsValue({
buildingId: null, //
buildingDetailIds: [], //
roomIds: [] //
})
//
getBuildingList({
parkId: id
}).then(res => {
this.buildingList = res.rows
})
},
// ->
selectBuilding(id) {
//
this.mdl.buildingDetailIds = [] //
this.mdl.roomIds = [] //
this.form.setFieldsValue({
buildingDetailIds: [], //
roomIds: [] //
})
//
getBuildingDetailList({
buildingId: id
}).then(res => {
this.buildingDetailList = res.rows
})
},
// ->
selectBuildingDetail(buildingDetailId) {
console.log('buildingDetailId', buildingDetailId)
//
this.getRoomListByFloorIdMethod(buildingDetailId)
},
//
getRoomListByFloorIdMethod(buildingDetailIds, ids) {
//
this.mdl.roomIds = [] //
this.form.setFieldsValue({
roomIds: [] //
})
//
getRoomListByBuildIdsRq({
'ids': ids,
'buildingDetailIds': buildingDetailIds,
'type': 0
}).then((res) => {
this.roomList = res.data
})
},
//
handleDeviceTable(record) {
this.visible1 = true
@ -611,14 +772,6 @@ export default {
this.deviceData = res.data
})
},
//
getFloorDataList() {
getFloorList().then((res) => {
this.floorList = res.data
})
},
exportTemplate() {
exportTemplate().then(res => {
console.log(res)
@ -686,16 +839,6 @@ export default {
console.log(res)
})
},
//
getRoomList(value) {
let param = {
'buildingDetailId': value,
'type': 0
}
getRoomListByFloorId(param).then((res) => {
this.roomList = res.data
})
},
handleDetail(id) {
this.$router.push({
name: 'customerContractDetailModal',
@ -706,7 +849,7 @@ export default {
this.$router.push({ name: 'customerContractEdit', query: { customerId: this.id, url: 'customerEdit' } })
},
onChangeBlacklist(checked) {
this.customerForm.isBlacklist = checked
this.mdl.isBlacklist = checked
},
getQiXinBasicInfo() {
var keyword = this.form.getFieldValue('creditNo')
@ -726,26 +869,48 @@ export default {
const { customerId } = this.$route.query
if (customerId) {
getCustomer(customerId).then(res => {
this.customerForm = res
//
if (this.customerForm.roomId) {
this.roomList.push({
id: this.customerForm.roomId,
name: this.customerForm.roomName
})
}
this.mdl = Object.assign(this.mdl, res)
let copyMdl = JSON.parse(JSON.stringify(this.mdl))
//
if (this.customerForm.headImg) {
this.imageUrl = process.env.VUE_APP_API_BASE_URL + this.customerForm.headImg
if (this.mdl.headImg) {
this.imageUrl = process.env.VUE_APP_API_BASE_URL + this.mdl.headImg
}
//
this.customerForm.bannerImages.forEach((item, i) => {
this.mdl.bannerImages.forEach((item, i) => {
item.url = process.env.VUE_APP_API_BASE_URL + item.url
})
this.fileList = this.customerForm.bannerImages
this.form.setFieldsValue(pick(this.customerForm, 'id', 'name', 'shortName', 'type', 'customerStatus', 'sector', 'country', 'process', 'contacts', 'phone', 'email', 'creditNo', 'mailAddress',
'postalCode', 'channelType', 'channelName', 'isBlacklist', 'regNo', 'status', 'orgNo', 'operName', 'econKind', 'startDate', 'registCapi', 'endDate'
, 'address', 'scope', 'delFlag', 'belongOrg', 'remark', 'headImg', 'bannerImages', 'roomId', 'buildId'))
this.fileList = this.mdl.bannerImages
// ->
if (copyMdl.tenantId) {
this.mdl = JSON.parse(JSON.stringify(copyMdl))
this.selectTenant(copyMdl.tenantId)
}
// ->
if (copyMdl.parkId) {
this.mdl = JSON.parse(JSON.stringify(copyMdl))
this.selectPark(copyMdl.parkId)
}
// ->
if (copyMdl.buildingId) {
this.mdl = JSON.parse(JSON.stringify(copyMdl))
this.selectBuilding(copyMdl.buildingId)
}
// ->
if (copyMdl.buildingDetailIds) {
this.mdl = JSON.parse(JSON.stringify(copyMdl))
this.getRoomListByFloorIdMethod(copyMdl.buildingDetailIds, copyMdl.roomIds)
}
//
this.mdl = JSON.parse(JSON.stringify(copyMdl))
//
this.form.setFieldsValue(pick(this.mdl, 'id', 'name', 'shortName', 'type', 'customerStatus',
'sector', 'country', 'process', 'contacts', 'phone', 'email', 'creditNo', 'mailAddress',
'postalCode', 'channelType', 'channelName', 'isBlacklist', 'regNo', 'status', 'orgNo',
'operName', 'econKind', 'startDate', 'registCapi', 'endDate',
'address', 'scope', 'delFlag', 'belongOrg', 'remark', 'headImg', 'bannerImages',
'roomId', 'buildId', 'roomIds', 'buildingDetailIds', 'tenantId', 'parkId',
'buildingId'))
//
})
}
this.getContastsList()