Commit 80d3b42a authored by 13841799530's avatar 13841799530

解润东

20220513
搜索日期功能
parent d8bea1b2
Pipeline #8328 passed with stage
in 5 minutes and 2 seconds
<template> <template>
<div> <div>
<LHeader :text="text"></LHeader> <LHeader :text="text"></LHeader>
<!-- <van-sticky offset-top="1.5rem"> <van-search
<van-search v-model="searchValue" show-action placeholder="请输入搜索内容" @search="onSearch"> v-model="value"
<template #action> show-action
<div @click="onSearch">搜索</div> placeholder="请输入搜索内容"
</template> @search="onSearch"
</van-search> :right-icon="require('@/assets/workbench/news.png')"
</van-sticky> --> >
<template #action>
<div @click="onSearch" >搜索</div>
</template>
<template #right-icon>
<van-icon name="calendar-o" @click="show=true"/>
</template>
</van-search>
<van-calendar v-model="show" type="range" :default-date="null" @confirm="onConfirm" />
<!-- 内容列表 --> <!-- 内容列表 -->
<!-- 接口对接4 START --> <!-- 接口对接4 START -->
<div class="con-list" @touchmove="showIndex = null"> <div class="con-list" @touchmove="showIndex = null">
...@@ -90,8 +98,11 @@ export default { ...@@ -90,8 +98,11 @@ export default {
}, },
data() { data() {
return { return {
date: '',
id:'',//巡查周期id id:'',//巡查周期id
text: "巡查记录", text: "巡查记录",
value:'',//搜索值
show:false,//是否显示日历
searchValue: "", searchValue: "",
showIndex:false, showIndex:false,
messageList: [], messageList: [],
...@@ -159,6 +170,14 @@ export default { ...@@ -159,6 +170,14 @@ export default {
this.loading(); this.loading();
}, },
methods: { methods: {
formatDate(date) {
return `${date.getMonth() + 1}/${date.getDate()}`;
},
onConfirm(date) {
const [start, end] = date;
this.show = false;
this.date = `${this.formatDate(start)} - ${this.formatDate(end)}`;
},
loading(){ loading(){
var obj={ var obj={
cycle:this.id cycle:this.id
...@@ -174,7 +193,6 @@ export default { ...@@ -174,7 +193,6 @@ export default {
onSearch(val) { onSearch(val) {
this.getList(this.searchValue); this.getList(this.searchValue);
}, },
touchstart(item) { touchstart(item) {
item.show = true item.show = true
this.$forceUpdate() this.$forceUpdate()
......
...@@ -2,16 +2,7 @@ ...@@ -2,16 +2,7 @@
<div> <div>
<LHeader :text="text"></LHeader> <LHeader :text="text"></LHeader>
<!-- 内容列表 --> <!-- 内容列表 -->
<van-search
v-model="value"
show-action
placeholder="请输入搜索内容"
@search="onSearch"
>
<template #action>
<div @click="onSearch" >搜索</div>
</template>
</van-search>
<div class="title">2022年4月26日</div> <div class="title">2022年4月26日</div>
<p class="title-text">巡查发起人:{{assignName}}</p> <p class="title-text">巡查发起人:{{assignName}}</p>
<p class="title-text">系统提示:请依据当日任务完成当日巡查工作。</p> <p class="title-text">系统提示:请依据当日任务完成当日巡查工作。</p>
...@@ -102,9 +93,7 @@ export default { ...@@ -102,9 +93,7 @@ export default {
this.loading() this.loading()
}, },
methods: { methods: {
onSearch(){
},
loading(){ loading(){
getFun("patrol/cycle/list").then((res) => { getFun("patrol/cycle/list").then((res) => {
this.assignName=res.data.assignName this.assignName=res.data.assignName
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment