whx 6 miesięcy temu
rodzic
commit
b1773eb185

+ 2 - 1
virgo.wzfrontend/console/src/components/work/crm/customer/customerUpload.vue

@@ -41,9 +41,10 @@
 			},
 			errorUpload() {
 				this.$loading.close();
-				this.$message.error('上传失败');
+				this.$message.error('导入失败');
 			},
 			successFile(data) {
+				if (!data.code == '20000') return this.errorUpload();
 				this.$emit('changeFile', data.data)
 				this.$loading.close();
 			},

+ 0 - 1
virgo.wzfrontend/console/src/components/work/crm/customer/detail.vue

@@ -18,7 +18,6 @@
 				<div class="hui-detail-label">联系电话</div>
 				<div class="hui-detail-value">{{detail.phone}}</div>
 			</div>
-
 			<div class="hui-detail-item">
 				<div class="hui-detail-label">微信号</div>
 				<div class="hui-detail-value">{{detail.weChatAccount}}</div>

+ 27 - 3
virgo.wzfrontend/console/src/components/work/crm/customer/edit.vue

@@ -115,24 +115,48 @@
 						trigger: 'blur'
 					}],
 				},
+				isCache: true
 			}
 		},
 		created() {
-			this.customerForm['organizationId'] = this.$store.getters.user.organization.id;
 			if (this.isUpdate) {
+				this.isCache = false;
 				getCustomerDetailById(this.detailId).then(res => {
 					if (res.state) {
 						this.customerForm = res.data;
 					}
 				})
+			} else {
+				console.log(this.$store.getters.customerData);
+				if (this.$store.getters.customerData && JSON.stringify(this.$store.getters.customerData) != '{}') {
+					if (this.$store.getters.customerData.organizationId != this.$store.getters.user.organization.id) {
+						return this.$store.dispatch('projectBase/changeCustomerData', {});
+					}
+					this.initForm(this.$store.getters.customerData);
+				}
+				this.customerForm['organizationId'] = this.$store.getters.user.organization.id;
 			}
 		},
+		beforeDestroy() {
+			this.cacheData();
+		},
 		methods: {
+			initForm(data) {
+				this.customerForm = data;
+			},
+			cacheData() {
+				if (!this.isCache) return;
+				this.$store.dispatch('projectBase/changeCustomerData', this.setData());
+			},
+			setData() {
+				let postData = JSON.parse(JSON.stringify(this.customerForm));
+				postData['firsTimeRoom'] = this.$refs.selectHouse.selectNodeId;
+				return postData;
+			},
 			submit() {
 				this.$refs.customerForm.validate((valid) => {
 					if (valid) {
-						let postData = JSON.parse(JSON.stringify(this.customerForm));
-						postData['firsTimeRoom'] = this.$refs.selectHouse.selectNodeId;
+						let postData = this.setData();
 						if (this.isUpdate) {
 							updateCustomer(postData).then(this.successFunc);
 						} else {

+ 1 - 1
virgo.wzfrontend/console/src/components/work/space/house/edit.vue

@@ -165,7 +165,7 @@
 					this.ccList = [{
 						id: this.houseForm.chargePersonId,
 						name: this.houseForm.chargePersonName,
-						portrait: ''
+						portrait: this.houseForm.chargePersonPortrait
 					}]
 				}
 			},

+ 12 - 0
virgo.wzfrontend/console/src/httpApi/space.js

@@ -409,4 +409,16 @@ export function insertReservation(data) {
 		method: 'post',
 		data: data
 	})
+}
+/* 
+ * 获取看房预约列表
+ * 
+ * 
+ */
+export function getReservationList(data) {
+	return request({
+		url: '/api/roomOperation/reservation/list',
+		method: 'post',
+		data: data
+	})
 }

+ 7 - 0
virgo.wzfrontend/console/src/router/modules/space.js

@@ -19,5 +19,12 @@ const space = [{
 	meta: {
 		title: '房源列表'
 	}
+}, {
+	path: 'space/reservation',
+	component: () => import('@/views/work/space/reservation'),
+	name: '预约列表',
+	meta: {
+		title: '预约列表'
+	}
 }]
 export default space;

+ 2 - 1
virgo.wzfrontend/console/src/store/getters.js

@@ -8,7 +8,8 @@ const getters = {
 	document: state => state.app.document, //模板context渲染
 	identity: state => state.app.identity, //身份
 	houseData: state => state.projectBase.houseData, //房源缓存
-	projectData: state => state.projectBase.projectData, //房源缓存
+	projectData: state => state.projectBase.projectData, //项目缓存
+	customerData: state => state.projectBase.customerData, //客户缓存
 	city: state => state.app.city, //当前位置
 	event: state => state.app.event, //事件
 }

+ 10 - 1
virgo.wzfrontend/console/src/store/modules/projectBase.js

@@ -5,7 +5,8 @@
 const state = {
 	project: {},
 	houseData: {},
-	projectData: {}
+	projectData: {},
+	customerData: {}
 }
 
 const mutations = {
@@ -17,6 +18,9 @@ const mutations = {
 	},
 	CHANGE_PROJECT_DATA: (state, projectData) => {
 		state.projectData = projectData;
+	},
+	CHANGE_CUSTOMER_DATA: (state, customerData) => {
+		state.customerData = customerData;
 	}
 }
 
@@ -35,6 +39,11 @@ const actions = {
 		commit,
 	}, projectData) {
 		commit('CHANGE_PROJECT_DATA', projectData);
+	},
+	changeCustomerData({
+		commit,
+	}, customerData) {
+		commit('CHANGE_CUSTOMER_DATA', customerData);
 	}
 }
 

+ 71 - 0
virgo.wzfrontend/console/src/views/work/space/reservation.vue

@@ -0,0 +1,71 @@
+<template>
+	<div class="hui-flex hui-content">
+		<div class="hui-content-title">
+			<div class="hui-title-item active">预约列表</div>
+		</div>
+		<div class="hui-flex-box hui-table">
+			<el-table :data="tableData" row-key="id" border height="100%">
+				<el-table-column label="序号" width="50">
+					<template slot-scope="scope">
+						<div style="text-align: center;">{{scope.$index + 1}}</div>
+					</template>
+				</el-table-column>
+				<el-table-column label="预约人" prop="userName"></el-table-column>
+				<el-table-column label="预约时间" prop="date"></el-table-column>
+				<el-table-column label="预约房源" width="150">
+					<template slot-scope="scope">
+						<div class="hui-table-operation">
+							<span class="table-operation" @click="look(scope.row)">详情</span>
+						</div>
+					</template>
+				</el-table-column>
+				<template slot="empty">
+					<empty description="暂无数据"></empty>
+				</template>
+			</el-table>
+		</div>
+		<el-drawer title="房源详情" :visible.sync="drawer" :size="400" :append-to-body="true">
+			<detail v-if="drawer" :detailId="detailId"></detail>
+		</el-drawer>
+	</div>
+</template>
+
+<script>
+	import {
+		getReservationList
+	} from '@/httpApi/space'
+	import detail from '@/components/work/space/house/detail'
+	export default {
+		data() {
+			return {
+				tableData: [],
+				detailId: '',
+				drawer: false
+			}
+		},
+		created() {
+			this.init();
+		},
+		methods: {
+			init() {
+				getReservationList({
+					userId: 20,
+					projectId: this.$store.getters.project.id
+				}).then(res => {
+					if (res.state) {
+						this.tableData = res.data;
+					}
+				})
+			},
+			look(val) {
+				this.detailId = val.projectItemTargetRoomId;
+				this.drawer = true;
+			}
+		},
+		components: {
+			detail
+		},
+	}
+</script>
+
+<style lang="scss"></style>