This commit is contained in:
liuye
2022-03-15 09:18:40 +08:00
9 changed files with 116 additions and 37 deletions

View File

@@ -199,9 +199,7 @@ export default {
} }
.spacial { .spacial {
margin-top: 10px; margin-top: 10px;
overflow:hidden; white-space: wrap;
text-overflow:ellipsis;
white-space:nowrap;
span { span {
margin-right: 10px; margin-right: 10px;
color: #ff4466; color: #ff4466;

View File

@@ -134,9 +134,8 @@
</div> </div>
</div> </div>
<!-- 特殊人群 --> <!-- 特殊人群 -->
<div v-if="tabIndex != 0 && data.resident.tsrqInfos && data.resident.tsrqInfos.length"> <div v-if="tabIndex != 0 && tabList && tabList.length">
<!-- --> <div class="spacial" v-for="(item,index) in tabList" :key="index" v-if="tabIndex == index">
<div v-for="(item,index) in data.resident.tsrqInfos" :key="index" class="spacial">
<div class="specialList" v-for="(t,indexs) in item.tableInfos" :key="indexs" v-if="item.tableInfos && item.tableInfos.length"> <div class="specialList" v-for="(t,indexs) in item.tableInfos" :key="indexs" v-if="item.tableInfos && item.tableInfos.length">
<div class="spacial-row"> <div class="spacial-row">
<div>{{ t.fieldName }}</div> <div>{{ t.fieldName }}</div>

View File

@@ -1,7 +1,7 @@
<template> <template>
<div class="add"> <div class="add">
<div class="pad-l32"> <div class="pad-l32">
<div class="item"> <div class="item" v-if="!isEdit">
<span class="label"><span class="tips">*</span>类型</span> <span class="label"><span class="tips">*</span>类型</span>
<div class="value" @click="showType=true"> <div class="value" @click="showType=true">
<span :class="appId ? '' : 'color-999'">{{ appName }}</span> <span :class="appId ? '' : 'color-999'">{{ appName }}</span>
@@ -160,7 +160,7 @@
<div class="item" v-else-if="item.type == 'gird'"> <div class="item" v-else-if="item.type == 'gird'">
<span class="label"><span class="tips">{{ item.mustFill == 1 ? '*' : '' }}</span>{{ item.fieldName }}</span> <span class="label"><span class="tips">{{ item.mustFill == 1 ? '*' : '' }}</span>{{ item.fieldName }}</span>
<div class="value" flex> <div class="value" flex>
<AiPagePicker type="gird" @select="v=>handleSelectGird(v,item)"> <AiPagePicker type="gird" @select="v=>handleSelectGird(v,item)" isMyGird>
<u-icon :label="formData[item.fieldDbName + '_name'] || item.fieldTips || '选择网格' " <u-icon :label="formData[item.fieldDbName + '_name'] || item.fieldTips || '选择网格' "
name="arrow-right" label-pos="left" color="#ccc"/> name="arrow-right" label-pos="left" color="#ccc"/>
</AiPagePicker> </AiPagePicker>
@@ -203,12 +203,28 @@ export default {
id: '' id: ''
} }
}, },
computed: {...mapState(['user'])}, computed: {
...mapState(['user']),
isEdit() {
return !!this.$route.query.id
}
},
created() { created() {
this.getType() this.getType()
}, },
onShow() { onShow() {
document.title = '新增人员' this.appId = this.$route.query.appId
if (this.isEdit) {
document.title = "编辑人员"
this.getDetail()
} else {
document.title = '新增人员'
if (this.appId) {
this.typeConfirm([this.$route.query])
}
}
}, },
methods: { methods: {
...mapActions(['selectEnterpriseContact']), ...mapActions(['selectEnterpriseContact']),
@@ -222,7 +238,9 @@ export default {
}) })
}, },
getType() { getType() {
this.$http.post(`/app/appapplicationinfo/queryApplicationListByType?type=0`).then((res) => { this.$http.post(`/app/appapplicationinfo/queryApplicationListByType`, null, {
params: {type: 0, status: 1}
}).then((res) => {
if (res?.data) { if (res?.data) {
this.typeList = res.data this.typeList = res.data
} }
@@ -405,7 +423,7 @@ export default {
} }
if (items.type == 'upload' && this.formData[items.fieldDbName]?.length) { //附件 只传id if (items.type == 'upload' && this.formData[items.fieldDbName]?.length) { //附件 只传id
let files = [] let files = []
this.formData[items.fieldDbName].map((item) => { [this.formData[items.fieldDbName]].flat().map((item) => {
files.push(item.url) files.push(item.url)
}) })
this.formData[items.fieldDbName] = files?.toString() this.formData[items.fieldDbName] = files?.toString()
@@ -442,7 +460,11 @@ export default {
this.$u.toast('提交成功') this.$u.toast('提交成功')
uni.$emit('specialPeopleList') uni.$emit('specialPeopleList')
setTimeout(() => { setTimeout(() => {
uni.navigateBack({}) uni.navigateBack({
success: () => {
uni.$emit("selectType")
}
})
}, 600) }, 600)
} }
}) })
@@ -462,6 +484,16 @@ export default {
this.formData[item.fieldDbName] = [info.id, info.girdName].join("_") this.formData[item.fieldDbName] = [info.id, info.girdName].join("_")
this.formData[item.fieldDbName + "_name"] = info.girdName this.formData[item.fieldDbName + "_name"] = info.girdName
this.$forceUpdate() this.$forceUpdate()
},
getDetail() {
let {id, appId} = this.$route.query
id && this.$http.post("/app/appapplicationinfo/queryDetailById", null, {
params: {id, appId}
}).then(res => {
if (res?.data) {
this.formData = res.data
}
})
} }
} }
} }

View File

@@ -28,8 +28,8 @@
<div class="title">特殊人群</div> <div class="title">特殊人群</div>
<div class="num-content"> <div class="num-content">
<div class="num-item" v-for="(item, index) in statisticsList" :key="index"> <div class="num-item" v-for="(item, index) in statisticsList" :key="index">
<h3>{{ item.value }}</h3> <h3 v-text="item.value"/>
<p>{{ item.label }}</p> <p v-text="item.label"/>
</div> </div>
<AiEmpty v-if="!statisticsList.length"/> <AiEmpty v-if="!statisticsList.length"/>
</div> </div>
@@ -52,12 +52,17 @@
<img src="../img/down-icon.png" alt="" :class="item.check ? 'img-active' : ''"/> <img src="../img/down-icon.png" alt="" :class="item.check ? 'img-active' : ''"/>
</div> </div>
<div class="user-list" v-if="item.check"> <div class="user-list" v-if="item.check">
<div class="user-item" v-for="(e, indexs) in item.value" :key="indexs" v-if="item.value && item.value.length"> <div class="user-item" v-for="(e, indexs) in item.value" :key="indexs" @click="showDetail(e)">
<div class="user-img"> <div class="user-img">
<img src="../img/user-img.png" alt=""/> <img src="../img/user-img.png" alt=""/>
</div> </div>
<div class="user-info"> <div class="user-info">
<p class="name">{{ e.name }}</p> <p class="name">{{ e.name }}
<span class="btn-icon" v-if="gridType != 0 && user.wxUserId == e.createUserId">
<img src="../img/edit-icon.png" alt="" @click.stop="toEdit(e,item.dictValue)">
<img src="../img/del-icon.png" alt="" @click.stop="del(e,item.dictValue)">
</span>
</p>
<div class="phone"> <div class="phone">
<span>{{ idNumberInit(e.idNumber) }}</span> <span>{{ idNumberInit(e.idNumber) }}</span>
<span>{{ e.phone }}</span> <span>{{ e.phone }}</span>
@@ -89,6 +94,7 @@ export default {
statisticsListMon: [], statisticsListMon: [],
userList: [], userList: [],
name: '', name: '',
gridType: 0
} }
}, },
computed: {...mapState(['user'])}, computed: {...mapState(['user'])},
@@ -109,9 +115,9 @@ export default {
}, },
onShow() { onShow() {
document.title = '特殊人群管理' document.title = '特殊人群管理'
console.log(this.$dict.getDict('appSpecialTypeFive')) this.$dict.getDict('appSpecialTypeFive')
this.isGirdUser()
}, },
methods: { methods: {
areaSelect(e) { areaSelect(e) {
this.areaId = e this.areaId = e
@@ -152,7 +158,7 @@ export default {
}, },
getUserList() { getUserList() {
this.userList = [] this.userList = []
this.$http.post(`/app/appapplicationinfo/queryPeople?areaId=${this.areaId}&type=0&name=${this.name}`).then((res) => { this.$http.post(`/app/appapplicationinfo/queryPeople?areaId=${this.areaId}&type=0&status=1&name=${this.name}`).then((res) => {
if (res.code == 0) { if (res.code == 0) {
for (let i in res.data) { for (let i in res.data) {
var obj = { var obj = {
@@ -189,6 +195,34 @@ export default {
this.userList[index].check = true this.userList[index].check = true
} }
}, },
toEdit(row) {
uni.navigateTo({
url: `./add?id=${row.id}&appId=${row.appId}`
})
},
del(row) {
this.$confirm('确定删除该数据?').then(() => {
uni.showLoading()
this.$http.post("/app/appapplicationinfo/delete", null, {params: {ids: row.id}}).then((res) => {
if (res?.code == 0) {
this.$u.toast('删除成功!')
this.getUserList()
}
uni.hideLoading()
})
}).catch(() => {
})
},
isGirdUser() {
this.$http.post('/app/appgirdmemberinfo/checkLogOnUser').then((res) => {
if (res?.data) {
this.gridType = res.data.checkType
}
})
},
showDetail(e){
uni.navigateTo({url:`/mods/AppPeopleList/DetailCard?id=${e.id}`})
}
}, },
} }
</script> </script>
@@ -398,6 +432,17 @@ export default {
color: #333; color: #333;
line-height: 44px; line-height: 44px;
margin-bottom: 8px; margin-bottom: 8px;
.btn-icon {
float: right;
img {
width: 48px;
height: 48px;
margin-left: 20px;
vertical-align: baseline;
}
}
} }
.phone { .phone {

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

@@ -82,8 +82,6 @@ export default {
onLoad() { onLoad() {
this.getTypeList() this.getTypeList()
}, },
onShow() {
},
methods: { methods: {
userClick(row, index) { userClick(row, index) {
if (this.userList[index].isChecked) { if (this.userList[index].isChecked) {
@@ -174,7 +172,10 @@ export default {
this.getUsers() this.getUsers()
}, },
gotoSpecialPersion() { gotoSpecialPersion() {
uni.navigateTo({url: '/apps/AppSpecialPeople/add'}) uni.$once("selectType", () => {
this.getUsers()
})
uni.navigateTo({url: `/apps/AppSpecialPeople/add?appId=${this.appId}&appName=${this.applicationName}`})
} }
}, },
} }

View File

@@ -3,6 +3,9 @@
<ai-search-popup mode="bottom" ref="areaSelector" length="85%"> <ai-search-popup mode="bottom" ref="areaSelector" length="85%">
<div slot="btn" @tap="handleInit"> <div slot="btn" @tap="handleInit">
<slot v-if="$slots.default"/> <slot v-if="$slots.default"/>
<div v-else-if="isForm">
<u-icon name="arrow-right" :label="areaName||'请选择'" label-pos="left" color="#ddd"/>
</div>
<div v-else class="areaSelector"> <div v-else class="areaSelector">
<image :src="locationIcon" class="location"/> <image :src="locationIcon" class="location"/>
<div v-text="areaName"/> <div v-text="areaName"/>
@@ -57,7 +60,10 @@ export default {
name: {default: ''}, name: {default: ''},
value: String, value: String,
all: Boolean, all: Boolean,
icon: {default: "location.svg"} icon: {default: "location.svg"},
isForm: Boolean,
valueLevel: {default: 5},
fullName: {default: ''}
}, },
computed: { computed: {
...mapState(['user']), ...mapState(['user']),
@@ -102,9 +108,9 @@ export default {
v && (this.getFullArea()) v && (this.getFullArea())
}, },
value (v) { value(v) {
if (this.list.length && v) { if (this.list.length && v) {
this.areaName = this.list.find((e) => e.id == this.value).name this.areaName = this.list.find((e) => e.id == this.value).name
} }
}, },
@@ -118,7 +124,7 @@ export default {
} }
} }
}, },
mounted () { mounted() {
this.handleInit() this.handleInit()
}, },
methods: { methods: {
@@ -126,7 +132,7 @@ export default {
this.handleInit() this.handleInit()
this.$refs.areaSelector.showPopup() this.$refs.areaSelector.showPopup()
}, },
scrollHeight () { scrollHeight() {
this.height = document.querySelector('.areaSelector') && `calc(100% - ${document.querySelector('.areaSelector').offsetHeight}px)` this.height = document.querySelector('.areaSelector') && `calc(100% - ${document.querySelector('.areaSelector').offsetHeight}px)`
}, },
getFullArea() { getFullArea() {
@@ -156,10 +162,10 @@ export default {
}).then((res) => { }).then((res) => {
if (res.data.length) { if (res.data.length) {
this.list = res.data this.list = res.data
let self = this.fullArea.find((e) => e.id == this.areaId) let self = this.fullArea.find((e) => e.id == this.areaId)
if (this.value && !this.areaName && this.value !== this.areaId) { if (this.value && !this.areaName && this.value !== this.areaId) {
this.areaName = this.list.find((e) => e.id == this.value).name this.areaName = this.list.find((e) => e.id == this.value).name
} }
if (!this.areaName && this.value === this.areaId) { if (!this.areaName && this.value === this.areaId) {
this.areaName = self.name this.areaName = self.name
@@ -204,7 +210,7 @@ export default {
}, },
getChild(op) { getChild(op) {
if (op.id != this.index) { if (op.id != this.index) {
if (op.type < 5 && (/0{3}$/g.test(this.index) || !this.index)) { if (op.type <= this.valueLevel && op.type < 5 && (/0{3}$/g.test(this.index) || !this.index)) {
this.fullArea.push(op) this.fullArea.push(op)
this.getChildAreas(op.id) this.getChildAreas(op.id)
} }
@@ -213,7 +219,7 @@ export default {
} }
this.$nextTick(() => { this.$nextTick(() => {
this.scrollHeight() this.scrollHeight()
}) })
}, },

View File

@@ -73,7 +73,6 @@ export default {
} }
}, },
onLoad(params) { onLoad(params) {
console.log(params)
if (params.girdLevel) { if (params.girdLevel) {
this.girdLevel = params.girdLevel this.girdLevel = params.girdLevel
} }
@@ -85,7 +84,7 @@ export default {
this.isDisabledOneGird = params.isDisabledOneGird this.isDisabledOneGird = params.isDisabledOneGird
} }
this.isGirdUser() this.isGirdUser()
}, },
methods: { methods: {
isGirdUser() { isGirdUser() {
@@ -98,7 +97,6 @@ export default {
} else { } else {
this.getTree() this.getTree()
} }
} else { } else {
this.$u.toast('当前人员不是网格员或网格管理员') this.$u.toast('当前人员不是网格员或网格管理员')
} }
@@ -108,7 +106,7 @@ export default {
getMyGird() { getMyGird() {
this.selectList = [] this.selectList = []
this.$http.post('/app/appgirdmemberinfo/queryMyGirdListByLevel2AndUser').then((res) => { this.$http.post('/app/appgirdmemberinfo/queryMyGirdListByLevel2AndUser').then((res) => {
if (res.code == 0) { if (res?.data) {
this.allData = res.data this.allData = res.data
this.treeInit() this.treeInit()
} }