diff --git a/.env.development b/.env.development
index b23cea2c..de4725c1 100644
--- a/.env.development
+++ b/.env.development
@@ -1,6 +1,6 @@
NODE_ENV=development
-# VUE_APP_API_SERVER = https://epmet-test.elinkservice.cn/api
-VUE_APP_API_SERVER = http://192.168.1.140/api
+VUE_APP_API_SERVER = http://epmet-dev.elinkservice.cn:41080/api
+# VUE_APP_API_SERVER = http://192.168.1.140/api
#家中开发连级的后端服务
# VUE_APP_API_SERVER = https://epmet-dev.elinkservice.cn:41080/api
diff --git a/src/assets/scss/pages/caiji.scss b/src/assets/scss/pages/caiji.scss
index 517eff61..8526f6e8 100644
--- a/src/assets/scss/pages/caiji.scss
+++ b/src/assets/scss/pages/caiji.scss
@@ -15,7 +15,7 @@
.content {
border-radius: 5px;
- background-border: 5px;
+
background-color: rgba(255, 255, 255, 0.787);
.member_title {
diff --git a/src/views/pages/caiji.vue b/src/views/pages/caiji.vue
index c87e77ea..9c8fc74e 100644
--- a/src/views/pages/caiji.vue
+++ b/src/views/pages/caiji.vue
@@ -9,7 +9,7 @@
- {{shequName}}
+ {{shequName}}
@@ -18,7 +18,7 @@
{{selCommunity.label}}
+ v-if="selVillage">{{selVillage.label}}
请选择
@@ -28,7 +28,7 @@
{{selBuilding.label}}
+ v-if="selBuild">{{selBuild.label}}
请选择
@@ -49,7 +49,7 @@
:disableClear="true"
label="单元号"
placeholder="请输入"
- v-model="formData.unitContent">
+ v-model="unitContent">
{{selRoom.label}}
+ v-if="selHome">{{selHome.label}}
请选择
-
+ v-model="homeContent">
@@ -76,7 +76,7 @@
:disableClear="true"
label="详细地址"
placeholder="请输入"
- v-model="address">
+ v-model="formData.address">
@@ -86,7 +86,7 @@
{{selRoomType.label}}
+ v-if="selHomeType">{{selHomeType.label}}
请选择
@@ -162,6 +162,7 @@
提交
@@ -195,10 +196,13 @@ let loading // 加载动画
export default {
data () {
return {
+ btnDisabled: false,
popupVisible: false,
- shequName: '其他小区',
- shequId: '6e511da6816e53af4cda952365a26eb9',//德兴路 1202807601961984002
- showAddressField: false,//是否显示其他
+
+ //二维码带来数据
+ shequId: '',//社区id 6e511da6816e53af4cda952365a26eb9 德兴路 1202807601961984002
+ shequName: '',//社区名称
+ customerId: '',//客户id 45687aa479955f9d06204d415238f7cc
communityList: [],
buildingList: [],
@@ -208,23 +212,20 @@ export default {
pickerData: [],
selObj: {},
- selCommunity: null,
- selBuilding: null,
+ selVillage: null,
+ selBuild: null,
selUnit: null,
- selRoom: null,
- selRoomType: null,
-
+ selHome: null,
+ selHomeType: null,
+ unitContent: '',
+ homeContent: '',////选择其他时,输入的值
formData: {
origin: '',//兴德路社区:internal;其他社区:external
villageId: '',//小区id;外部不显示此组件;如果是内部必填。用户选择其他,可以自己输入,前端把输入的内容放在这个字段即可
- villageContent: '',
buildId: '',//楼栋id;外部不显示此组件;如果是内部必填,用户选择其他,可以自己输入,前端把输入的内容放在这个字段即可
- buildContent: '',
unitId: '',//单元id;外部不显示磁组件。如果是内部必填。用户可以选择其他,自己输入,前端把输入的内容放在这个字段即可
- unitContent: '',//选择其他时,输入的值
homeId: '',//房屋id;外部不展示此组件。如果是内部必填。用户选择其他,可以自己输入,前端把输入的内容放在这个字段即可
- homeContent: '',////选择其他时,输入的值
address: '',//外部:用户自己输入;内部:把小区名楼栋名单元名房屋名拼接起来。例如:绿地望海领域10号楼一单元101
houseType: '',//1自由0租住
houseHolderName: '',//户主姓名
@@ -248,15 +249,13 @@ export default {
}
],
-
-
roomTypeList: [
{
value: '1',
label: '自有'
},
{
- value: '2',
+ value: '0',
label: '租住'
},
],
@@ -274,7 +273,7 @@ export default {
},
{
label: '未接种',
- value: '3'
+ value: '0'
},
],
@@ -293,17 +292,35 @@ export default {
},
created () { },
mounted () {
- if (this.shequId === '6e511da6816e53af4cda952365a26eb9') {
+ console.log(this.$route)
+
+ this.shequId = this.$route.params.id
+ this.customerId = this.$route.query.customerId
+ this.shequName = this.$route.query.name
+
+ let envShow = process.env.VUE_APP_NODE_ENV
+
+ let internalShequId = ''
+ if (envShow === 'dev' || envShow === 'prod:sit') { // 开发环境
+ internalShequId = '6e511da6816e53af4cda952365a26eb9'
+ } else if (envShow === 'prod:uat') { // 体验
+ internalShequId = '6e511da6816e53af4cda952365a26eb9'
+ } else if (envShow === 'prod') { // 生产
+ internalShequId = '1202807601961984002'
+ }
+
+ this.formData.customerId = this.customerId
+ if (this.shequId === internalShequId) {
this.formData.origin = 'internal'
} else {
this.formData.origin = 'external'
}
- this.loadCommunity()
+ this.loadVillage()
this.detNumList = []
- for (let i = 0; i < 11; i++) {
+ for (let i = 1; i < 11; i++) {
let obj = {
value: i + '',
- label: i + '',
+ label: i + '次',
}
this.detNumList.push(obj)
}
@@ -339,7 +356,7 @@ export default {
},
//根据社区id获取小区列表
- async loadCommunity () {
+ async loadVillage () {
const url = "/gov/org/icneighborhood/open/list"
let params = {
@@ -362,15 +379,18 @@ export default {
this.popupSlots = []
this.popupSlots.push(obj)
} else {
- this.$message.error(msg)
+ Toast({
+ message: msg,
+ duration: 3000
+ });
}
},
//获取楼宇列表
- async loadBuilding () {
+ async loadBuild () {
const url = "/gov/org/icbuilding/buildingoption"
let params = {
- neighborHoodId: this.selCommunity.value
+ neighborHoodId: this.selVillage.value
}
const { data, code, msg } = await requestPost(url, params)
@@ -388,7 +408,10 @@ export default {
this.popupSlots = []
this.popupSlots.push(obj)
} else {
- this.$message.error(msg)
+ Toast({
+ message: msg,
+ duration: 3000
+ });
}
},
//获取单元列表
@@ -396,7 +419,7 @@ export default {
const url = '/gov/org/icbuildingunit/unitoption'
let params = {
- buildingId: this.selBuilding.value
+ buildingId: this.selBuild.value
}
const { data, code, msg } = await requestPost(url, params)
@@ -418,15 +441,18 @@ export default {
this.popupSlots = []
this.popupSlots.push(obj)
} else {
- this.$message.error(msg)
+ Toast({
+ message: msg,
+ duration: 3000
+ });
}
},
//获取房间列表
- async loadRoom () {
+ async loadHome () {
const url = "/gov/org/ichouse/houseoption"
let params = {
- buildingId: this.selBuilding.value,
+ buildingId: this.selBuild.value,
unitId: this.selUnit.value
}
@@ -449,7 +475,10 @@ export default {
this.popupSlots = []
this.popupSlots.push(obj)
} else {
- this.$message.error(msg)
+ Toast({
+ message: msg,
+ duration: 3000
+ });
}
},
@@ -460,10 +489,10 @@ export default {
}
if (selType === 'building') {
- if (!this.selCommunity) {
+ if (!this.selVillage) {
Toast({
message: '请先选择小区',
- duration: 5000
+ duration: 3000
});
return false
} else {
@@ -473,10 +502,10 @@ export default {
}
if (selType === 'unit') {
- if (!this.selBuilding) {
+ if (!this.selBuild) {
Toast({
message: '请先选择楼宇',
- duration: 5000
+ duration: 3000
});
return false
} else {
@@ -488,7 +517,7 @@ export default {
if (!this.selUnit) {
Toast({
message: '请先选择单元',
- duration: 5000
+ duration: 3000
});
return false
} else {
@@ -509,47 +538,179 @@ export default {
this.pickerData = this.detConditionList
}
-
let obj = {
values: this.pickerData
}
this.popupSlots = []
this.popupSlots.push(obj)
- this.popupVisible = !this.popupBuildingVisibl
+ this.popupVisible = !this.popupVisible
},
- handleSubmit () {
+ async handleSubmit () {
+
+ let message = this.validataFormData()
+ if (message) {
+ Toast({
+ message: message,
+ duration: 3000
+ });
+ return false
+ }
+
+
if (this.formData.origin === 'internal') {
- this.formData.address = this.
-}
+
+ this.formData.villageId = this.selVillage.value
+ this.formData.buildId = this.selBuild.value
+ if (this.selUnit.value === 'else') {
+ this.formData.unitId = this.unitContent
+ this.formData.homeId = this.homeContent//没有选择房屋,不存在这个对象,直接赋值
+ } else {
+ this.formData.unitId = this.selUnit.value
+ this.unitContent = this.selUnit.label
+
+ if (this.selHome.value === 'else') {
+ this.formData.homeId = this.homeContent
+ } else {
+ this.formData.homeId = this.selHome.value
+ this.homeContent = this.selHome.label
+ }
+ }
+ this.formData.address = this.selVillage.label + this.selBuild.label + this.unitContent + this.homeContent
+ }
+
+ this.formData.houseType = this.selHomeType.value
+
+ this.memberList.forEach(element => {
+ element.customerId = this.customerId
+ if (element.selDetNum && element.selDetNum.value) {
+ element.heSuanCount = element.selDetNum.value
+ }
+ if (element.selDetCondition && element.selDetCondition.value) {
+ element.ymjz = element.selDetCondition.value
+ }
+
+ });
this.formData.memberList = this.memberList
+ console.log(this.formData)
+ this.btnDisabled = true
+ const url = "/epmetuser/icresicollect/save"
+
+ const { data, code, msg } = await requestPost(url, this.formData)
+
+ if (code === 0) {
+ Toast({
+ message: '提交成功',
+ duration: 3000
+ });
+ this.btnDisabled = false
+ } else {
+ Toast({
+ message: msg,
+ duration: 3000
+ });
+ this.btnDisabled = false
+ }
+ },
+
+ //必填验证
+ validataFormData () {
+
+ let message = ''
+ if (this.formData.origin === 'internal') {//内部
+
+ if (!this.selVillage) {
+ message = '请选择小区'
+ return message
+ }
+ if (!this.selBuild) {
+ message = '请选择楼栋'
+ return message
+ }
+
+ if (!this.selUnit) {//没有选择单元
+ message = '请选择单元'
+ return message
+
+ } else {//选择了单元
+ if (this.selUnit.value === 'else') {//单元选择了其他
+ if (!this.unitContent) {
+ message = '请填写单元号'
+ return message
+ }
+
+ if (!this.homeContent) {//房屋必须填写内容
+ message = '请填写房屋'
+ return message
+ }
+
+ } else {//单元没有选择其他
+ if (!this.selHome) {
+ message = '请选择房屋'
+ return message
+
+ } else if (this.selHome.value === 'else' && !this.homeContent) {
+ message = '请填写房屋'
+ return message
+ }
+ }
+
+ }
+
+
+ } else {
+ if (!this.formData.address) {
+ message = '请填写地址'
+ return message
+ }
+ }
+
+ if (!this.selHomeType) {
+ message = '请选择房屋类型'
+ return message
+ }
+ if (!this.formData.houseHolderName) {
+ message = '请填写户主姓名'
+ return message
+ }
+ let member = this.memberList[0]
+
+ for (let i = 0; i < this.memberList.length; i++) {
+ let item = this.memberList[i]
+ if (!item.name || !item.mobile || !item.idNum || !item.selDetNum.value || !item.selDetCondition.value) {
+ message = '请完整填写用户' + (i + 1) + '信息'
+ return message
+ }
+ }
+
+
},
popupOk () {
if (this.selType === 'community') {
- this.selCommunity = this.selObj
- this.formData.villageContent = this.selObj.label
- this.formData.villageId = this.selObj.value
+ this.selVillage = this.selObj
- this.selBuilding = null
+
+
+ this.selBuild = null
this.selUnit = null
- this.selRoom = null
+ this.selHome = null
this.formData.unitContent = ''
this.formData.homeContent = ''
- this.loadBuilding()
+ this.loadBuild()
}
if (this.selType === 'building') {
- this.selBuilding = this.selObj
+ this.selBuild = this.selObj
this.formData.buildContent = this.selObj.label
this.formData.buildId = this.selObj.value
this.selUnit = null
- this.selRoom = null
+ this.selHome = null
this.formData.unitContent = ''
this.formData.homeContent = ''
this.loadUnit()
@@ -558,32 +719,22 @@ export default {
if (this.selType === 'unit') {
this.selUnit = this.selObj
+ this.selHome = null
+ this.unitContent = ''
+ this.homeContent = ''
-
- this.selRoom = null
- this.formData.unitContent = ''
- this.formData.homeContent = ''
- if (this.selUnit && this.selUnit.value === 'else') {
- this.showAddressField = true
- } else {
- this.showAddressField = false
- }
- this.loadRoom()
+ this.loadHome()
}
if (this.selType === 'room') {
- this.selRoom = this.selObj
+ this.selHome = this.selObj
+
+ this.homeContent = ''
- this.formData.homeContent = ''
- if (this.selRoom && this.selRoom.value === 'else') {
- this.showAddressField = true
- } else {
- this.showAddressField = false
- }
}
if (this.selType === 'roomType') {
- this.selRoomType = this.selObj
+ this.selHomeType = this.selObj
}
if (this.selType === 'detNum') {
@@ -591,8 +742,7 @@ export default {
let change = this.memberList[this.selMemberIndex]
change.selDetNum = this.selObj
this.$set(this.memberList, this.selMemberIndex, change)
- // this.selMemberIndex = index
- // this.pickerData = this.detNumList
+
}
if (this.selType === 'detCondition') {
let change = this.memberList[this.selMemberIndex]