调查走访完成改造

This commit is contained in:
aixianling
2021-11-18 17:53:42 +08:00
parent dbcab7c66e
commit e91ea0a423
4 changed files with 55 additions and 48 deletions

View File

@@ -1,37 +1,40 @@
<template>
<div class="AppInterview">
<ai-top-fixed>
<div flex>
<ai-date placeholder="日期选择" mode="range" @change="handleDateSearch"/>
<u-search placeholder="请输入标题" :show-action="false" v-model="search.title" @search="current=1,getList()"/>
<template v-if="!showDetail">
<ai-top-fixed>
<div flex>
<ai-date placeholder="日期选择" mode="range" @change="handleDateSearch"/>
<u-search placeholder="请输入标题" :show-action="false" v-model="search.title" @search="current=1,getList()"/>
</div>
</ai-top-fixed>
<template v-if="list.length>0">
<ai-card v-for="(e,index) in list" :key="index" @click.native="goDetail(e.id,1)">
<template #custom>
<div flex>
<b class="fill">{{ e.title }}</b>
</div>
<div flex v-if="!!e.fileList" class="wrap">
<ai-image v-for="(op,i) in e.fileList.slice(0,3)" :src="op.accessUrl" preview :key="i"/>
</div>
<div class="bottom">{{ e.createTime }}</div>
</template>
<template #menu>
<div class="menu" @tap.stop="goDetail(e.id)">编辑</div>
<div class="menu" @tap.stop="handleDelete(e.id)">删除</div>
</template>
</ai-card>
<u-loadmore :status="loadmore" color="#999" font-size="24"
margin-top="32" margin-bottom="80"/>
</template>
<div class="no-message" v-else>
<image src="https://cdn.cunwuyun.cn/wxAdmin/img/message.png"/>
<p>您还未添加过入户调查走访<br>点击<b>新增按钮</b>试试吧~</p>
</div>
</ai-top-fixed>
<template v-if="list.length>0">
<ai-card v-for="(e,index) in list" :key="index" @click.native="goDetail(e.id,1)">
<template #custom>
<div flex>
<b class="fill">{{ e.title }}</b>
</div>
<div flex v-if="!!e.fileList" class="wrap">
<ai-image v-for="(op,i) in e.fileList.slice(0,3)" :src="op.accessUrl" preview :key="i"/>
</div>
<div class="bottom">{{ e.createTime }}</div>
</template>
<template #menu>
<div class="menu" @tap.stop="goDetail(e.id)">编辑</div>
<div class="menu" @tap.stop="handleDelete(e.id)">删除</div>
</template>
</ai-card>
<u-loadmore :status="loadmore" color="#999" font-size="24"
margin-top="32" margin-bottom="80"/>
<ai-fixed-btn>
<div class="addBtn iconfont iconfont-iconfangda" @tap="gotoAdd()"/>
</ai-fixed-btn>
</template>
<div class="no-message" v-else>
<image src="https://cdn.cunwuyun.cn/wxAdmin/img/message.png"/>
<p>您还未添加过入户调查走访<br>点击<b>新增按钮</b>试试吧~</p>
</div>
<ai-fixed-btn>
<div class="addBtn iconfont iconfont-iconfangda" @tap="gotoAdd()"/>
</ai-fixed-btn>
<interview-detail v-else/>
</div>
</template>
@@ -42,11 +45,15 @@ import AiCard from "../../components/AiCard";
import AiImage from "../../components/AiImage";
import AiDate from "../../components/AiDate";
import AiFixedBtn from "../../components/AiFixedBtn";
import InterviewDetail from "./interviewDetail";
export default {
name: "AppInterview",
appName: "调查走访",
components: {AiFixedBtn, AiDate, AiImage, AiCard, AiTopFixed, AiSelect},
inject: {
root: {}
},
components: {InterviewDetail, AiFixedBtn, AiDate, AiImage, AiCard, AiTopFixed, AiSelect},
data() {
return {
search: {title: ""},
@@ -58,6 +65,9 @@ export default {
computed: {
loadmore() {
return this.pages <= this.current ? 'loading ' : 'nomore'
},
showDetail() {
return this.$route.hash == "#add"
}
},
onShow() {
@@ -84,12 +94,12 @@ export default {
})
},
goDetail(id, readonly) {
let url = `./detail?id=${id}`
readonly && (url += "&detail=1")
uni.navigateTo({url})
let query = {id}
readonly && (query.detail = 1)
this.root.goto({hash: "#add", query})
},
gotoAdd() {
uni.navigateTo({url: `./detail`})
this.root.goto({hash: "#add"})
},
handleDelete(ids) {
this.$confirm("是否要删除该调查走访").then(() => {
@@ -104,8 +114,8 @@ export default {
})
},
handleDateSearch(v) {
this.search.startTime = v.startDate
this.search.endTime = v.endDate || v.startDate
this.search.startTime = v?.[0]
this.search.endTime = v?.[0] || v?.[1]
this.current = 1
this.getList()
}

View File

@@ -33,17 +33,14 @@
</template>
<script>
import UButton from "../../uview/components/u-button/u-button";
import AiUploader from "../../components/AiUploader";
import UInput from "../../uview/components/u-input/u-input";
import AiImage from "../../components/AiImage";
import AiTextarea from "../../components/AiTextarea";
import UFormItem from "../../uview/components/u-form-item/u-form-item";
import AiBack from "../../components/AiBack";
export default {
name: 'interviewDetail',
components: {AiBack, UFormItem, AiTextarea, AiImage, UInput, AiUploader, UButton},
components: {AiBack, AiTextarea, AiImage, AiUploader},
computed: {
isEdit() {
let flag = this.$route.query?.detail != 1