持续集成分支

This commit is contained in:
aixianling
2024-10-31 14:34:57 +08:00
parent 6a833be062
commit 8c56cf808b
2165 changed files with 4116 additions and 8716 deletions

View File

@@ -0,0 +1,157 @@
<template>
<div class="AppHelpEffect">
<AiTopFixed>
<u-tabs :list="tabs" :is-scroll="false" :current="currentTab" height="96" bar-width="150" @change="v=>{currentTab=v,current=1,con=null}"/>
<div class="search">
<u-search :placeholder="`请搜索姓名${currentTab==1?'':'、身份证号'}`" @clear="con='',getList()" clearable v-model="con" :show-action="false"
@search="search"/>
</div>
<div class="select">
<AiAreaPicker class="fill" v-model="areaId" :area-id="user.areaId" :name.sync="areaName" @select="areaSelect" selectRoot>
<div flex class="center">
<u-icon name="map-fill" size="32" color="#999" class="mar-r8"/>
<AiMore icon="arrow-down" v-model="areaName" placeholder="所在地区"/>
</div>
</AiAreaPicker>
<AiSelect v-if="currentTab=='0'" class="fill center" flex v-model="houseType" :list="typeList" @data="typeSelect">
<AiMore class="fill" icon="arrow-down" v-model="$dict.getLabel('fpHouseType', houseType)" placeholder="户类型"/>
</AiSelect>
</div>
</AiTopFixed>
<div class="cardList">
<component ref="List" :is="currentPage.list" v-bind="{current,search:{areaId,houseType,con}}"/>
</div>
</div>
</template>
<script>
import {mapState} from 'vuex'
import HelpedResidentList from "./helpedResidentList";
import NormalFarmerList from "./normalFarmerList";
export default {
name: "AppHelpEffect",
components: {NormalFarmerList, HelpedResidentList},
appName: '帮扶成效',
data() {
return {
con: "",
current: 1,
typeList: [],
areaId: '',
areaName: '',
houseType: '',
currentTab: '0'
}
},
computed: {
...mapState(['user']),
tabs: () => [
{name: "监测对象", list: HelpedResidentList},
{name: "一般农户", list: NormalFarmerList}
],
currentPage: v => v.tabs[v.currentTab] || {}
},
methods: {
areaSelect(e) {
this.areaId = e
this.refreshList()
},
typeSelect(v) {
this.houseType = v?.[0].value
this.refreshList()
},
search(value) {
this.name = value
this.refreshList()
},
refreshList() {
this.current = 1
this.$nextTick(() => this.$refs.List.getList(true))
}
},
onLoad() {
this.areaId = this.user.areaId
this.$dict.load('fpHouseType').then(() => {
this.typeList = this.$dict.getDict('fpHouseType').map((item) => {
return {
label: item.dictName,
value: item.dictValue
}
})
this.typeList.unshift({label: '全部类型', value: ''})
})
},
onShow() {
document.title = '帮扶成效'
this.refreshList()
},
onReachBottom() {
this.current++
}
}
</script>
<style lang="scss" scoped>
.AppHelpEffect {
.search {
height: 100px;
line-height: 100px;
}
.center {
justify-content: center;
text-align: center;
}
.select {
width: 100%;
display: flex;
height: 86px;
line-height: 86px;
text-align: center;
}
::v-deep .cardList {
padding: 32px;
box-sizing: border-box;
.card {
padding: 32px;
box-sizing: border-box;
margin-bottom: 32px;
background: #FFF;
box-shadow: 0px 0px 8px 0px rgba(0, 0, 0, 0.0200);
border-radius: 16px;
.user {
display: flex;
justify-content: space-between;
.name {
font-size: 36px;
font-weight: 600;
}
}
.idCard,
.tel,
.address {
margin-top: 8px;
color: #999999;
img {
margin-right: 16px;
width: 28px;
height: 28px;
}
}
.tel,
.address {
color: #333;
}
}
}
}
</style>

View File

@@ -0,0 +1,207 @@
<template>
<div class="addLog">
<AiGroup v-if="isBangFu">
<AiItem label="帮扶类型" required>
<AiSelect dict="fpAssistanceMeasures" v-model="form.operationDesc"/>
</AiItem>
</AiGroup>
<AiGroup v-else-if="isNormalFarmer">
<AiItem label="走访对象" required>
<input v-model="form.name"/>
</AiItem>
<AiItem label="现住址" required>
<AiAreaPicker v-model="form.areaId" :name.sync="form.areaName">
<AiMore v-model="form.areaName"/>
</AiAreaPicker>
</AiItem>
<AiItem label="走访日期" required>
<AiDate v-model="form.visitDate"/>
</AiItem>
</AiGroup>
<!--走访日志-->
<AiGroup v-else>
<AiItem label="走访日期" required>
<AiDate v-model="form.visitDate"/>
</AiItem>
</AiGroup>
<AiGroup>
<AiItem :label="isBangFu ? '帮扶内容' : '走访内容'" required topLabel>
<textarea maxlength="500" v-model="form.detail" :placeholder="isBangFu ? '请输入帮扶内容' : '请输入走访内容'"></textarea>
<div class="hint">{{ form.detail.length || 0 }}/500</div>
</AiItem>
</AiGroup>
<AiGroup>
<AiItem label="图片" topLabel>
<span slot="sub" class="color-999" v-text="`最多9张`"/>
<AiUploader :def.sync="form.files" multiple placeholder="上传图片" :limit="9"
action="/admin/file/add2"></AiUploader>
</AiItem>
</AiGroup>
<div class="btn" @click="$u.debounce(submit)">提交</div>
</div>
</template>
<script>
export default {
data() {
return {
pid: '',
id: '',
type: '',
form: {detail: "", files: []}
}
},
computed: {
isBangFu: v => v.type == 1,
isNormalFarmer: v => v.type == 2
},
onLoad(query) {
this.$dict.load('fpAssistanceMeasures')
this.pid = query.pid
this.type = query.type
this.visitDate = this.$dateFormat(this.$dayjs())
if (query.id) {
this.id = query.id
this.getInfo()
}
},
onShow() {
this.pageTitle()
},
methods: {
pageTitle() {
const action = this.id ? '编辑' : '添加', app = this.type == 1 ? '帮扶措施' : this.type == 2 ? '一般农户走访日志' : '走访日志'
document.title = action + app
},
getInfo() {
this.$http.post(`/app/apppreventionreturntopovertylog/queryDetailById?id=${this.id}`).then(res => {
if (res?.data) {
this.form = res.data
}
})
},
submit() {
if (this.type == 1) {
if (!this.form.operationDesc) {
return this.$u.toast('请选择帮扶类型')
}
} else if (this.type == 2) {
if (!this.form.areaId) {
return this.$u.toast('请选择现住址')
}
if (!this.form.name) {
return this.$u.toast('请输入走访对象')
}
} else {
if (!this.form.detail) {
return this.$u.toast('请输入走访内容')
}
}
const {form, type, pid} = this
this.$http.post('/app/apppreventionreturntopovertylog/addOrUpdate', {...form, type, pid}).then(res => {
if (res.code == 0) {
this.$u.toast('提交成功')
uni.$emit('reload')
setTimeout(() => {
uni.navigateBack({
delta: 1
})
}, 300)
}
})
}
}
}
</script>
<style lang="scss" scoped>
.addLog {
padding-bottom: 120px;
.help {
padding: 32px;
box-sizing: border-box;
display: flex;
justify-content: space-between;
background: #fff;
margin-bottom: 16px;
}
.form-item {
padding: 32px;
background: #fff;
margin-bottom: 16px;
.form-item__title {
display: flex;
align-items: center;
margin-bottom: 34px;
em {
margin-right: 4px;
font-style: normal;
color: #FF4466;
}
h2 {
color: #333333;
font-weight: normal;
font-size: 32px;
}
i {
color: #999999;
font-size: 28px;
font-style: normal;
}
}
textarea {
width: 100%;
}
}
.form-type {
display: flex;
align-items: center;
justify-content: space-between;
height: 112px;
padding: 0 32px;
h2 {
font-weight: normal;
color: #333333;
font-size: 32px;
}
span {
color: #999999;
font-size: 28px;
}
}
.btn {
position: fixed;
left: 0;
bottom: 0;
z-index: 11;
width: 100%;
height: 112px;
line-height: 112px;
margin: 0;
text-align: center;
color: #FFFFFF;
font-size: 32px;
background: #3192F4;
}
.hint {
text-align: right;
color: #999;
}
::v-deep uni-textarea {
width: 100%;
}
}
</style>

View File

@@ -0,0 +1,259 @@
<template>
<div class="helpDetail">
<AiTopFixed>
<u-tabs :list="tabList" :is-scroll="false" :current="currentTabs" height="96" bar-width="150" @change="change"></u-tabs>
</AiTopFixed>
<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">
<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, '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;" 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"
:key="index"/>
</div>
</div>
</div>
</div>
<AiEmpty v-else style="padding-top: 50px;" description="暂无数据"></AiEmpty>
</div>
<AiFixedBtn v-if="currentTabs === 0">
<div class="addBtn iconfont iconfont-iconfangda" @tap="toAddLog('1')" v-if="$permissions('app_apppreventionreturntopovertylog_edit')"></div>
</AiFixedBtn>
<!-- 走访日志0 帮扶措施1 -->
<AiFixedBtn v-if="currentTabs === 1">
<div class="addBtn iconfont iconfont-iconfangda" @tap="toAddLog('0')"></div>
</AiFixedBtn>
</div>
</template>
<script>
import {mapState} from 'vuex'
export default {
name: 'helpDetail',
data() {
return {
tabList: [
{
name: '帮扶措施',
},
{
name: '走访日志',
}
],
currentTabs: 0,
list: [],
id: '',
current: 1,
}
},
computed: {
...mapState(['user'])
},
onLoad(o) {
this.id = o.id
this.$dict.load('fpAssistanceMeasures')
},
methods: {
change(index) {
this.list = []
this.current = 1
this.currentTabs = index
this.getList()
},
getList() {
this.$http.post(`/app/apppreventionreturntopovertylog/list`,null,{
params: {
pid: this.id,
size: 1000,
current: this.current,
type: this.currentTabs==0? '1':'0'
}
}).then(res => {
if (res?.data) {
this.list = this.current==1? res.data.records : [...this.list, ...res.data.records]
}
})
},
toAddLog(type) {
uni.navigateTo({
url: `./addLog?pid=${this.id}&type=${type}`
})
},
prevImg(urls, img) {
const imgs = urls.map(v => v.url)
uni.previewImage({
urls: imgs,
current: img
})
},
edit(id,type) {
uni.showActionSheet({
itemList: ['编辑', '删除'],
success: res => {
if (res.tapIndex === 0) {
if (type == 0) {
uni.navigateTo({
url: `./addLog?pid=${this.id}&id=${id}&type=0`
})
} else if (type == 1) {
uni.navigateTo({
url: `./addLog?pid=${this.id}&id=${id}&type=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('删除成功')
this.getList()
}
uni.hideLoading()
})
}).catch(() => {
})
}
}
})
},
},
onShow() {
document.title = '帮扶情况'
if(this.id) {
this.getList()
}
this.getList()
},
onReachBottom() {
this.current ++
this.getList()
}
}
</script>
<style lang="scss" scoped>
.helpDetail {
::v-deep .AiTopFixed .content{
padding: 0;
}
.log-item {
padding: 0 0 0 32px;
background: #fff;
&:first-child {
margin-top: 16px;
}
&:last-child {
.log-item__wrapper {
border: none !important;
}
}
.log-item__wrapper {
padding: 32px 32px 32px 0;
border-bottom: 1px solid #E4E5E6;
.log-item__user {
display: flex;
align-items: center;
justify-content: space-between;
& > div {
display: flex;
align-items: center;
}
.left {
.user, image {
width: 80px;
height: 80px;
line-height: 80px;
margin-right: 16px;
text-align: center;
border-radius: 50%;
background: #2266FF;
span {
color: #fff;
font-size: 28px;
}
}
h2 {
color: #333;
font-size: 32px;
}
}
.right {
image {
width: 32px;
height: 32px;
}
span {
margin-right: 6px;
color: #999999;
font-size: 28px;
}
}
}
p {
margin: 4px 0 16px 96px;
color: #343D65;
font-size: 28px;
}
.imgs {
margin-left: 96px;
image {
width: 136px;
height: 136px;
margin-right: 8px;
margin-bottom: 8px;
}
}
}
}
.addBtn {
width: 96px;
height: 96px;
flex-shrink: 0;
background: $uni-color-primary;
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2);
font-size: 48px;
color: #fff;
border-radius: 50%;
justify-content: center;
align-items: center;
display: flex;
}
}
</style>

View File

@@ -0,0 +1,65 @@
<template>
<section class="helpedResidentList">
<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>
<span :style="{color: item.houseType==1? '#FF6300': '#00D25D'}">{{ $dict.getLabel('fpHouseType', item.houseType) }}</span>
</p>
<div class="idCard">{{ item.idNumber.replace(/(.{6}).*(.{4})/, '$1********$2') }}</div>
<div class="tel"><img src="./images/dh@2x.png" alt="">{{ item.phone }}</div>
<div class="address"><img src="./images/dz@2x.png" alt="">
{{ item.countyName + item.townName + item.villageName }}{{ item.currentAddress || '' }}
</div>
</div>
</div>
<AiEmpty v-else description="暂无数据"/>
</section>
</template>
<script>
export default {
name: "helpedResidentList",
props: {
current: {default: 1},
search: {default: () => ({})}
},
data() {
return {
list: [],
total: 0
}
},
methods: {
getList(must) {
if (must || this.total == 0 || this.list.length < this.total) {
const {current, search} = this.$props
this.$http.post('/app/apppreventionreturntopoverty/list', null, {
params: {...search, current, isHousehold: 1},
}).then((res) => {
if (res?.data) {
this.list = [current == 1 ? [] : this.list, res.data.records].flat().filter(Boolean)
this.total = res.data.total
}
})
}
},
toDetail(id) {
uni.navigateTo({url: `./helpDetail?id=${id}`})
},
},
watch: {
current: {
handler() {
this.$u.throttle(this.getList)
},
immediate: true
}
}
}
</script>
<style lang="scss" scoped>
.helpedResidentList {
}
</style>

Binary file not shown.

After

Width:  |  Height:  |  Size: 816 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 884 B

View File

@@ -0,0 +1,208 @@
<template>
<section class="normalFarmerList">
<div 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">
<h2>{{ item.name }}</h2>
</div>
<div class="right">
<span class="mar-r8">{{ item.visitDate }}</span>
<u-icon name="list" color="#999" size="28" @click="edit(item.id, 2)" v-if="item.createUserId == user.id"/>
</div>
</div>
<p v-text="item.detail"/>
<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>
</div>
<AiEmpty v-else description="暂无数据"/>
<AiFixedBtn>
<div class="addBtn iconfont iconfont-iconfangda" @tap="toAddLog()"></div>
</AiFixedBtn>
</section>
</template>
<script>
import {mapState} from 'vuex'
export default {
name: "normalFarmerList",
props: {
current: {default: 1},
search: {default: () => ({})}
},
data() {
return {
list: [],
total: 0
}
},
computed: {
...mapState(['user'])
},
methods: {
getList(must) {
if (must || this.total == 0 || this.list.length < this.total) {
const {current, search: {con: name}, search} = this.$props
this.$http.post('/app/apppreventionreturntopovertylog/list', null, {
params: {...search, current, type: 2, name},
}).then((res) => {
if (res?.data) {
this.list = [current == 1 ? [] : this.list, res.data.records].flat().filter(Boolean)
this.total = res.data.total
}
})
}
},
toDetail(id) {
uni.navigateTo({url: `./helpDetail?id=${id}`})
},
toAddLog(pid) {
uni.navigateTo({
url: `./addLog?pid=${pid || ''}&type=2`
})
},
prevImg(urls, img) {
const imgs = urls.map(v => v.url)
uni.previewImage({
urls: imgs,
current: img
})
},
edit(id, type) {
uni.showActionSheet({
itemList: ['编辑', '删除'],
success: res => {
if (res?.tapIndex === 0) {
uni.navigateTo({
url: `./addLog?pid=${this.id}&id=${id}&type=${type}`
})
} else if (res?.tapIndex == 1) {
this.$confirm('确定删除该数据?').then(() => {
uni.showLoading()
this.$http.post(`/app/apppreventionreturntopovertylog/delete?ids=${id}`).then(ret => {
if (ret?.code == 0) {
this.$u.toast('删除成功')
this.getList(true)
}
}).finally(() => uni.hideLoading())
}).catch(() => 0)
}
}
})
},
},
watch: {
current: {
handler() {
this.getList()
},
immediate: true
}
}
}
</script>
<style lang="scss" scoped>
.normalFarmerList {
.log-item {
padding: 0 0 0 32px;
background: #fff;
&:first-child {
margin-top: 16px;
}
&:last-child {
.log-item__wrapper {
border: none !important;
}
}
.log-item__wrapper {
padding: 32px 32px 32px 0;
border-bottom: 1px solid #E4E5E6;
.log-item__user {
display: flex;
align-items: center;
justify-content: space-between;
& > div {
display: flex;
align-items: center;
}
.left {
.user, image {
width: 80px;
height: 80px;
line-height: 80px;
margin-right: 16px;
text-align: center;
border-radius: 50%;
background: #2266FF;
span {
color: #fff;
font-size: 28px;
}
}
h2 {
color: #333;
font-size: 32px;
}
}
.right {
image {
width: 32px;
height: 32px;
}
span {
margin-right: 6px;
color: #999999;
font-size: 28px;
}
}
}
p {
margin: 4px 0 16px 0;
color: #343D65;
font-size: 28px;
}
.imgs {
image {
width: 136px;
height: 136px;
margin-right: 8px;
margin-bottom: 8px;
}
}
}
}
.addBtn {
width: 96px;
height: 96px;
flex-shrink: 0;
background: $uni-color-primary;
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2);
font-size: 48px;
color: #fff;
border-radius: 50%;
justify-content: center;
align-items: center;
display: flex;
}
}
</style>