调查走访完成改造

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,5 +1,6 @@
<template>
<div class="AppInterview">
<template v-if="!showDetail">
<ai-top-fixed>
<div flex>
<ai-date placeholder="日期选择" mode="range" @change="handleDateSearch"/>
@@ -32,6 +33,8 @@
<ai-fixed-btn>
<div class="addBtn iconfont iconfont-iconfangda" @tap="gotoAdd()"/>
</ai-fixed-btn>
</template>
<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

View File

@@ -1,6 +1,7 @@
<template>
<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 v-if="label" v-html="label"/>
<div v-else v-html="placeholder"/>
@@ -31,16 +32,17 @@ export default {
value: {default: ""},
placeholder: {default: "请选择"},
mode: {default: "single"},//date 单个日期|range 日期范围
maxDate:String
},
methods: {
handleSelect(v) {
this.show = false
if (this.mode == 'date') {
this.selected = v.result
this.$emit('change', v.result)
this.selected = v?.[0]
} else if (this.mode == 'range') {
this.selected = [v.startDate, v.endDate]
this.$emit('change', v)
this.selected = [v?.[0], v?.slice(-1)?.[0]]
}
this.$emit('change', this.selected)
}
}
}

View File

@@ -12,11 +12,9 @@
</template>
<script>
import UInput from "../uview/components/u-input/u-input";
export default {
name: "AiTextarea",
components: {UInput},
model: {
prop: "value",
event: "change"