调查走访完成改造
This commit is contained in:
@@ -1,37 +1,40 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="AppInterview">
|
<div class="AppInterview">
|
||||||
<ai-top-fixed>
|
<template v-if="!showDetail">
|
||||||
<div flex>
|
<ai-top-fixed>
|
||||||
<ai-date placeholder="日期选择" mode="range" @change="handleDateSearch"/>
|
<div flex>
|
||||||
<u-search placeholder="请输入标题" :show-action="false" v-model="search.title" @search="current=1,getList()"/>
|
<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>
|
</div>
|
||||||
</ai-top-fixed>
|
<ai-fixed-btn>
|
||||||
<template v-if="list.length>0">
|
<div class="addBtn iconfont iconfont-iconfangda" @tap="gotoAdd()"/>
|
||||||
<ai-card v-for="(e,index) in list" :key="index" @click.native="goDetail(e.id,1)">
|
</ai-fixed-btn>
|
||||||
<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>
|
</template>
|
||||||
<div class="no-message" v-else>
|
<interview-detail 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>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -42,11 +45,15 @@ import AiCard from "../../components/AiCard";
|
|||||||
import AiImage from "../../components/AiImage";
|
import AiImage from "../../components/AiImage";
|
||||||
import AiDate from "../../components/AiDate";
|
import AiDate from "../../components/AiDate";
|
||||||
import AiFixedBtn from "../../components/AiFixedBtn";
|
import AiFixedBtn from "../../components/AiFixedBtn";
|
||||||
|
import InterviewDetail from "./interviewDetail";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "AppInterview",
|
name: "AppInterview",
|
||||||
appName: "调查走访",
|
appName: "调查走访",
|
||||||
components: {AiFixedBtn, AiDate, AiImage, AiCard, AiTopFixed, AiSelect},
|
inject: {
|
||||||
|
root: {}
|
||||||
|
},
|
||||||
|
components: {InterviewDetail, AiFixedBtn, AiDate, AiImage, AiCard, AiTopFixed, AiSelect},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
search: {title: ""},
|
search: {title: ""},
|
||||||
@@ -58,6 +65,9 @@ export default {
|
|||||||
computed: {
|
computed: {
|
||||||
loadmore() {
|
loadmore() {
|
||||||
return this.pages <= this.current ? 'loading ' : 'nomore'
|
return this.pages <= this.current ? 'loading ' : 'nomore'
|
||||||
|
},
|
||||||
|
showDetail() {
|
||||||
|
return this.$route.hash == "#add"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onShow() {
|
onShow() {
|
||||||
@@ -84,12 +94,12 @@ export default {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
goDetail(id, readonly) {
|
goDetail(id, readonly) {
|
||||||
let url = `./detail?id=${id}`
|
let query = {id}
|
||||||
readonly && (url += "&detail=1")
|
readonly && (query.detail = 1)
|
||||||
uni.navigateTo({url})
|
this.root.goto({hash: "#add", query})
|
||||||
},
|
},
|
||||||
gotoAdd() {
|
gotoAdd() {
|
||||||
uni.navigateTo({url: `./detail`})
|
this.root.goto({hash: "#add"})
|
||||||
},
|
},
|
||||||
handleDelete(ids) {
|
handleDelete(ids) {
|
||||||
this.$confirm("是否要删除该调查走访").then(() => {
|
this.$confirm("是否要删除该调查走访").then(() => {
|
||||||
@@ -104,8 +114,8 @@ export default {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
handleDateSearch(v) {
|
handleDateSearch(v) {
|
||||||
this.search.startTime = v.startDate
|
this.search.startTime = v?.[0]
|
||||||
this.search.endTime = v.endDate || v.startDate
|
this.search.endTime = v?.[0] || v?.[1]
|
||||||
this.current = 1
|
this.current = 1
|
||||||
this.getList()
|
this.getList()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,17 +33,14 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import UButton from "../../uview/components/u-button/u-button";
|
|
||||||
import AiUploader from "../../components/AiUploader";
|
import AiUploader from "../../components/AiUploader";
|
||||||
import UInput from "../../uview/components/u-input/u-input";
|
|
||||||
import AiImage from "../../components/AiImage";
|
import AiImage from "../../components/AiImage";
|
||||||
import AiTextarea from "../../components/AiTextarea";
|
import AiTextarea from "../../components/AiTextarea";
|
||||||
import UFormItem from "../../uview/components/u-form-item/u-form-item";
|
|
||||||
import AiBack from "../../components/AiBack";
|
import AiBack from "../../components/AiBack";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'interviewDetail',
|
name: 'interviewDetail',
|
||||||
components: {AiBack, UFormItem, AiTextarea, AiImage, UInput, AiUploader, UButton},
|
components: {AiBack, AiTextarea, AiImage, AiUploader},
|
||||||
computed: {
|
computed: {
|
||||||
isEdit() {
|
isEdit() {
|
||||||
let flag = this.$route.query?.detail != 1
|
let flag = this.$route.query?.detail != 1
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<section class="AiDate">
|
<section class="AiDate">
|
||||||
<u-calendar v-model="show" @change="handleSelect" :mode="mode"/>
|
<u-calendar :show="show" :maxDate="maxDate"
|
||||||
|
@confirm="handleSelect" :mode="mode" @close="show=false"/>
|
||||||
<div flex @click="show=true">
|
<div flex @click="show=true">
|
||||||
<div v-if="label" v-html="label"/>
|
<div v-if="label" v-html="label"/>
|
||||||
<div v-else v-html="placeholder"/>
|
<div v-else v-html="placeholder"/>
|
||||||
@@ -31,16 +32,17 @@ export default {
|
|||||||
value: {default: ""},
|
value: {default: ""},
|
||||||
placeholder: {default: "请选择"},
|
placeholder: {default: "请选择"},
|
||||||
mode: {default: "single"},//date 单个日期|range 日期范围
|
mode: {default: "single"},//date 单个日期|range 日期范围
|
||||||
|
maxDate:String
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
handleSelect(v) {
|
handleSelect(v) {
|
||||||
|
this.show = false
|
||||||
if (this.mode == 'date') {
|
if (this.mode == 'date') {
|
||||||
this.selected = v.result
|
this.selected = v?.[0]
|
||||||
this.$emit('change', v.result)
|
|
||||||
} else if (this.mode == 'range') {
|
} else if (this.mode == 'range') {
|
||||||
this.selected = [v.startDate, v.endDate]
|
this.selected = [v?.[0], v?.slice(-1)?.[0]]
|
||||||
this.$emit('change', v)
|
|
||||||
}
|
}
|
||||||
|
this.$emit('change', this.selected)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,11 +12,9 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import UInput from "../uview/components/u-input/u-input";
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "AiTextarea",
|
name: "AiTextarea",
|
||||||
components: {UInput},
|
|
||||||
model: {
|
model: {
|
||||||
prop: "value",
|
prop: "value",
|
||||||
event: "change"
|
event: "change"
|
||||||
|
|||||||
Reference in New Issue
Block a user