优化
This commit is contained in:
@@ -24,6 +24,7 @@
|
||||
</AiTopFixed>
|
||||
|
||||
<div class="cardList">
|
||||
<div v-if="list.length">
|
||||
<div class="card" v-for="(item,index) in list" :key="index" @click="toDetail(item.id)">
|
||||
<p class="user">
|
||||
<span class="name">{{ item.name }}</span>
|
||||
@@ -35,9 +36,9 @@
|
||||
{{ item.countyName + item.townName + item.villageName }}{{ item.currentAddress || '' }}
|
||||
</div>
|
||||
</div>
|
||||
<AiEmpty v-if="!list.length" description="暂无数据"></AiEmpty>
|
||||
</div>
|
||||
|
||||
<AiEmpty v-else description="暂无数据"></AiEmpty>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
@@ -67,7 +68,6 @@ export default {
|
||||
|
||||
methods: {
|
||||
areaSelect(e) {
|
||||
console.log(e);
|
||||
this.areaId = e
|
||||
this.current = 1
|
||||
this.list = []
|
||||
@@ -82,9 +82,10 @@ export default {
|
||||
}
|
||||
})
|
||||
this.typeList.unshift({ label: '全部类型', value: ''})
|
||||
})
|
||||
this.areaId = this.user.areaId
|
||||
this.getList()
|
||||
})
|
||||
|
||||
},
|
||||
typeSelect(v) {
|
||||
this.current = 1
|
||||
|
||||
@@ -72,9 +72,6 @@ export default {
|
||||
if (!this.operationDesc) {
|
||||
return this.$u.toast('请选择帮扶类型')
|
||||
}
|
||||
// if (!this.detail) {
|
||||
// return this.$u.toast('请输入帮扶内容')
|
||||
// }
|
||||
} else {
|
||||
if (!this.detail) {
|
||||
return this.$u.toast('请输入走访内容')
|
||||
|
||||
@@ -4,9 +4,9 @@
|
||||
<u-tabs :list="tabList" :is-scroll="false" :current="currentTabs" height="96" bar-width="150" @change="change"></u-tabs>
|
||||
</AiTopFixed>
|
||||
|
||||
<div class="tab-content" v-show="currentTabs === 0">
|
||||
<div class="tab-content__item">
|
||||
<div class="log-item" v-for="(item, index) in helpList" :key="index">
|
||||
<div class="tab-content">
|
||||
<div class="tab-content__item" v-if="list.length">
|
||||
<div class="log-item" v-for="(item, index) in list" :key="index">
|
||||
<div class="log-item__wrapper">
|
||||
<div class="log-item__user">
|
||||
<div class="left">
|
||||
@@ -17,10 +17,12 @@
|
||||
</div>
|
||||
<div class="right">
|
||||
<span>{{ item.createTime }}</span>
|
||||
<u-icon name="list" color="#999" size="28" @click="edit(item.id, '1')" style="margin-left:16px;" v-if="item.createUserId == user.id"></u-icon>
|
||||
<u-icon name="list" color="#999" size="28" @click="edit(item.id, '1')" style="margin-left:16px;" v-if="item.createUserId == user.id && currentTabs==0"></u-icon>
|
||||
<u-icon name="list" color="#999" size="28" @click="edit(item.id, '0')" style="margin-left:16px;" v-if="item.createUserId == user.id && item.operationDesc == '走访排查' && currentTabs==1"></u-icon>
|
||||
</div>
|
||||
</div>
|
||||
<p style="color: #999999;">帮扶措施:{{ $dict.getLabel('fpAssistanceMeasures',item.operationDesc) }}</p>
|
||||
<p style="color: #999999;" v-if="currentTabs==0">帮扶措施:{{ $dict.getLabel('fpAssistanceMeasures',item.operationDesc) }}</p>
|
||||
<p style="color: #999999;" v-if="currentTabs==1">操作类型:{{ item.operationDesc }}</p>
|
||||
<p>{{ item.detail }}</p>
|
||||
<div class="imgs" v-if="item.files && item.files.length">
|
||||
<image :src="img.url" @click="prevImg(item.files, img.url)" v-for="(img, index) in item.files"
|
||||
@@ -28,34 +30,8 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<AiEmpty v-if="!helpList.length" style="padding-bottom: 20px;"></AiEmpty>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="tab-content__item" v-show="currentTabs == 1">
|
||||
<div class="log-item" v-for="(item, index) in logList" :key="index">
|
||||
<div class="log-item__wrapper">
|
||||
<div class="log-item__user">
|
||||
<div class="left">
|
||||
<div class="user">
|
||||
<span>{{ item.createUserName.substr(item.createUserName.length - 2) }}</span>
|
||||
</div>
|
||||
<h2>{{ item.createUserName }}</h2>
|
||||
</div>
|
||||
<div class="right">
|
||||
<span>{{ item.createTime }}</span>
|
||||
<u-icon name="list" color="#999" size="28" @click="edit(item.id, '0')" style="margin-left:16px;" v-if="item.createUserId == user.id && item.operationDesc == '走访排查'"></u-icon>
|
||||
</div>
|
||||
</div>
|
||||
<p style="color: #999999;">操作类型:{{ item.operationDesc }}</p>
|
||||
<p>{{ item.detail }}</p>
|
||||
<div class="imgs" v-if="item.files && item.files.length">
|
||||
<image :src="img.url" @click="prevImg(item.files, img.url)" v-for="(img, index) in item.files"
|
||||
:key="index"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<AiEmpty v-if="!logList.length" style="padding-bottom: 20px;"></AiEmpty>
|
||||
<AiEmpty v-else style="padding-top: 50px;" description="暂无数据"></AiEmpty>
|
||||
</div>
|
||||
|
||||
<AiFixedBtn v-if="currentTabs === 0">
|
||||
@@ -83,9 +59,9 @@ export default {
|
||||
}
|
||||
],
|
||||
currentTabs: 0,
|
||||
helpList: [],
|
||||
logList: [],
|
||||
list: [],
|
||||
id: '',
|
||||
current: 1,
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
@@ -97,24 +73,22 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
change(index) {
|
||||
this.list = []
|
||||
this.current = 1
|
||||
this.currentTabs = index
|
||||
if(index == 0) {
|
||||
this.getHelpList()
|
||||
} else if(index == 1) {
|
||||
this.getLogList()
|
||||
}
|
||||
this.getList()
|
||||
},
|
||||
getHelpList() {
|
||||
this.$http.post(`/app/apppreventionreturntopovertylog/list?pid=${this.id}&size=1000¤t=1&type=1`).then(res => {
|
||||
if (res.code === 0) {
|
||||
this.helpList = res.data.records || []
|
||||
getList() {
|
||||
this.$http.post(`/app/apppreventionreturntopovertylog/list`,null,{
|
||||
params: {
|
||||
pid: this.id,
|
||||
size: 1000,
|
||||
current: this.current,
|
||||
type: this.currentTabs==0? '1':'0'
|
||||
}
|
||||
})
|
||||
},
|
||||
getLogList() {
|
||||
this.$http.post(`/app/apppreventionreturntopovertylog/list?pid=${this.id}&size=1000¤t=1&type=0`).then(res => {
|
||||
if (res.code === 0) {
|
||||
this.logList = res.data.records || []
|
||||
}).then(res => {
|
||||
if (res?.data) {
|
||||
this.list = this.current==1? res.data.records : [...this.list, ...res.data.records]
|
||||
}
|
||||
})
|
||||
},
|
||||
@@ -137,27 +111,23 @@ export default {
|
||||
itemList: ['编辑', '删除'],
|
||||
success: res => {
|
||||
if (res.tapIndex === 0) {
|
||||
if (type === 0) {
|
||||
if (type == 0) {
|
||||
uni.navigateTo({
|
||||
url: `./addLog?pid=${this.id}&id=${id}&type=0`
|
||||
})
|
||||
} else {
|
||||
} else if (type == 1) {
|
||||
uni.navigateTo({
|
||||
url: `./addLog?pid=${this.id}&id=${id}&type=1`
|
||||
})
|
||||
}
|
||||
|
||||
} else if (res.tapIndex === 1) {
|
||||
} else if (res.tapIndex == 1) {
|
||||
this.$confirm('确定删除该数据?').then(() => {
|
||||
uni.showLoading()
|
||||
this.$http.post(`/app/apppreventionreturntopovertylog/delete?ids=${id}`).then(res => {
|
||||
if (res.code === 0) {
|
||||
this.$u.toast('删除成功')
|
||||
if(type == 1) {
|
||||
this.getHelpList()
|
||||
} else if(type == 0) {
|
||||
this.getLogList()
|
||||
}
|
||||
this.getList()
|
||||
}
|
||||
uni.hideLoading()
|
||||
})
|
||||
@@ -167,24 +137,17 @@ export default {
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
},
|
||||
onShow() {
|
||||
document.title = '帮扶情况'
|
||||
if(this.id) {
|
||||
if(this.currentTabs==0) {
|
||||
this.getHelpList()
|
||||
} else if (this.currentTabs ==1) {
|
||||
this.getLogList()
|
||||
}
|
||||
|
||||
this.getList()
|
||||
}
|
||||
this.getList()
|
||||
},
|
||||
onReachBottom() {
|
||||
this.current ++
|
||||
this.getList()
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user