|
@@ -6,15 +6,15 @@
|
|
<swiper class="data-list" :current="swiperCurrent" @transition="transition" @change="swiperChange" @animationfinish="animationfinish">
|
|
<swiper class="data-list" :current="swiperCurrent" @transition="transition" @change="swiperChange" @animationfinish="animationfinish">
|
|
<swiper-item class="swiper-item" v-for="(tabs, index) in tabList" :key="index">
|
|
<swiper-item class="swiper-item" v-for="(tabs, index) in tabList" :key="index">
|
|
<scroll-view scroll-y class="scroll-con" @scrolltolower="onreachBottom">
|
|
<scroll-view scroll-y class="scroll-con" @scrolltolower="onreachBottom">
|
|
- <view class="record-con">
|
|
|
|
|
|
+ <view class="record-con" :style="{'paddingTop': searchForm.beginDate ? '74upx' : ''}">
|
|
<!-- 筛选日期,近7天 -->
|
|
<!-- 筛选日期,近7天 -->
|
|
- <view v-show="searchForm.creatTime.length != 0" class="alert-tips">
|
|
|
|
- <text>{{searchForm.creatTime[0]}} ~ {{searchForm.creatTime[1]}}</text>
|
|
|
|
|
|
+ <view v-show="searchForm.beginDate" class="alert-tips">
|
|
|
|
+ <text>{{searchForm.beginDate}} ~ {{searchForm.endDate}}</text>
|
|
</view>
|
|
</view>
|
|
- <view class="record-item" v-if="index==current" v-for="(item,sindex) in list" :key="item.id">
|
|
|
|
|
|
+ <view class="record-item" v-if="index==current" v-for="(item,sindex) in list" :key="item.id" @click="getDetails(item)">
|
|
<view class="item-head">
|
|
<view class="item-head">
|
|
- <text class="item-c-tit">{{item.name}}</text>
|
|
|
|
- <u-tag class="item-c-type" :text="item.status" type="primary" />
|
|
|
|
|
|
+ <text class="item-c-tit">{{item.storeName}}</text>
|
|
|
|
+ <u-tag class="item-c-type" :text="item.status | taskStatus" type="primary" />
|
|
</view>
|
|
</view>
|
|
<view class="item-main">
|
|
<view class="item-main">
|
|
<text class="item-tit">创建时间:</text>
|
|
<text class="item-tit">创建时间:</text>
|
|
@@ -22,11 +22,12 @@
|
|
</view>
|
|
</view>
|
|
<view class="item-main">
|
|
<view class="item-main">
|
|
<text class="item-tit">完成时间:</text>
|
|
<text class="item-tit">完成时间:</text>
|
|
- <text class="item-val">{{item.endTime}}</text>
|
|
|
|
|
|
+ <text class="item-val">{{item.endTime ? item.endTime : '--'}}</text>
|
|
</view>
|
|
</view>
|
|
<view class="item-main">
|
|
<view class="item-main">
|
|
<text class="item-tit">巡店耗时:</text>
|
|
<text class="item-tit">巡店耗时:</text>
|
|
- <text class="item-val">{{item.spendTime}}秒</text>
|
|
|
|
|
|
+ <text class="item-val" v-if="item.spendTime">{{ item.spendTime | formatTime }}</text>
|
|
|
|
+ <text class="item-val" v-else>--</text>
|
|
</view>
|
|
</view>
|
|
<u-grid class="item-grid" :col="4" hover-class="none">
|
|
<u-grid class="item-grid" :col="4" hover-class="none">
|
|
<u-grid-item>
|
|
<u-grid-item>
|
|
@@ -55,56 +56,25 @@
|
|
</swiper>
|
|
</swiper>
|
|
</view>
|
|
</view>
|
|
<!-- 筛选弹框 -->
|
|
<!-- 筛选弹框 -->
|
|
- <u-popup v-model="openScreen" mode="right" length="80%" class="screenModel-wrap">
|
|
|
|
- <!-- 条件项 -->
|
|
|
|
- <view class="condition-con">
|
|
|
|
- <view class="screen-module">
|
|
|
|
- <text class="screen-tit">创建时间:</text>
|
|
|
|
- <view class="screen-time-val">
|
|
|
|
- <text @click="onShowDatePicker('range')">{{ range.length == 0 ? '请选择' : range[0] + '~' + range[1] }}</text>
|
|
|
|
- <u-icon v-show="range.length != 0" name="close-circle-fill" color="#c8c0cc" size="32" class="close-circle" @click="range=[]"></u-icon>
|
|
|
|
- </view>
|
|
|
|
- </view>
|
|
|
|
- <view class="screen-module">
|
|
|
|
- <text class="screen-tit">门店:</text>
|
|
|
|
- <view class="screen-inp-val">
|
|
|
|
- <u-input class="screen-inp" v-model="storeName" :height="52" placeholder="请输入" type="text" :border="true" />
|
|
|
|
- </view>
|
|
|
|
- </view>
|
|
|
|
- </view>
|
|
|
|
- <!-- 按钮 -->
|
|
|
|
- <view class="btns">
|
|
|
|
- <u-button type="warning" shape="circle" size="mini" class="btn reset-btn" @click="resetF">重置</u-button>
|
|
|
|
- <u-button type="error" shape="circle" size="mini" class="btn ok-btn" @click="submitF">确定</u-button>
|
|
|
|
- </view>
|
|
|
|
- </u-popup>
|
|
|
|
- <!-- 选择创建时间 -->
|
|
|
|
- <w-picker
|
|
|
|
- :visible.sync="showPicker"
|
|
|
|
- mode="range"
|
|
|
|
- startYear="2017"
|
|
|
|
- endYear="2030"
|
|
|
|
- :value="searchForm.creatTime"
|
|
|
|
- :current="false"
|
|
|
|
- @confirm="onSelected($event,'range')"
|
|
|
|
- @cancel="onSelected"
|
|
|
|
- ref="range"></w-picker>
|
|
|
|
|
|
+ <search-modal :visible="openScreen" :defaultParams="searchForm" @openPicke="openPicker" @refresh="refresh" @close="openScreen=false"></search-modal>
|
|
</view>
|
|
</view>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
|
|
+ import moment from "moment"
|
|
|
|
+ import searchModal from './searchModal.vue'
|
|
import wPicker from "@/components/w-picker/w-picker.vue"
|
|
import wPicker from "@/components/w-picker/w-picker.vue"
|
|
import { queryMyTask } from '@/api/task.js'
|
|
import { queryMyTask } from '@/api/task.js'
|
|
export default {
|
|
export default {
|
|
- components: { wPicker },
|
|
|
|
|
|
+ components: { wPicker, searchModal },
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
tabList: [ // tab切换 类型
|
|
tabList: [ // tab切换 类型
|
|
{ dispName: '全部', code:'' },
|
|
{ dispName: '全部', code:'' },
|
|
- { dispName: '待处理', code:'0' },
|
|
|
|
- { dispName: '进行中', code:'1' },
|
|
|
|
- { dispName: '已完成', code:'2' },
|
|
|
|
- { dispName: '已过期', code:'3' }
|
|
|
|
|
|
+ { dispName: '待处理', code:'PENDING' },
|
|
|
|
+ { dispName: '进行中', code:'RUNNING' },
|
|
|
|
+ { dispName: '已完成', code:'FINISHED' },
|
|
|
|
+ { dispName: '已过期', code:'EXPIRED' }
|
|
],
|
|
],
|
|
current: 0, // tabs组件的current值,表示当前活动的tab选项
|
|
current: 0, // tabs组件的current值,表示当前活动的tab选项
|
|
swiperCurrent: 0, // swiper组件的current值,表示当前那个swiper-item是活动的
|
|
swiperCurrent: 0, // swiper组件的current值,表示当前那个swiper-item是活动的
|
|
@@ -115,22 +85,50 @@
|
|
noDataText: '暂无数据', // 列表数据为空时提示文字
|
|
noDataText: '暂无数据', // 列表数据为空时提示文字
|
|
list: [], // 数据列表
|
|
list: [], // 数据列表
|
|
openScreen: false, // 是否打开筛选
|
|
openScreen: false, // 是否打开筛选
|
|
- dateMode: 'range', // date单个日期 range日期范围
|
|
|
|
searchForm: { // 查询条件
|
|
searchForm: { // 查询条件
|
|
- creatTime: [], // 创建时间默认筛选近7天
|
|
|
|
- store: ''
|
|
|
|
|
|
+ beginDate: '', // 创建时间默认筛选近7天
|
|
|
|
+ endDate: '', // 创建时间默认筛选近7天
|
|
|
|
+ sourceType: [], // 检查方式
|
|
|
|
+ storeName: '' // 门店名称
|
|
},
|
|
},
|
|
- showPicker: false, // 是否选择创建时间
|
|
|
|
- range: [], // 筛选创建时间的默认值
|
|
|
|
- storeName: '', // 筛选的门店名称
|
|
|
|
typeId: '', // 记录状态
|
|
typeId: '', // 记录状态
|
|
action:'swiperChange', // 操作类型,上划分页,或左右滑动
|
|
action:'swiperChange', // 操作类型,上划分页,或左右滑动
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
+ filters: {
|
|
|
|
+ // 任务类型
|
|
|
|
+ taskStatus(val){
|
|
|
|
+ let str = ''
|
|
|
|
+ if(val == 'PENDING'){
|
|
|
|
+ str = '待处理'
|
|
|
|
+ }else if(val == 'RUNNING'){
|
|
|
|
+ str = '进行中'
|
|
|
|
+ }else if(val == 'FINISHED'){
|
|
|
|
+ str = '已完成'
|
|
|
|
+ }else if(val == 'EXPIRED'){
|
|
|
|
+ str = '已过期'
|
|
|
|
+ }
|
|
|
|
+ return str
|
|
|
|
+ },
|
|
|
|
+ // 巡店耗时 秒转时分
|
|
|
|
+ formatTime(s){
|
|
|
|
+ let time = ''
|
|
|
|
+ if(moment.duration(s*1000).hours()){
|
|
|
|
+ time += moment.duration(s*1000).hours() + '时'
|
|
|
|
+ }
|
|
|
|
+ if(moment.duration(s*1000).minutes()){
|
|
|
|
+ time += moment.duration(s*1000).minutes() + '分'
|
|
|
|
+ }
|
|
|
|
+ if(moment.duration(s*1000).seconds()){
|
|
|
|
+ time += moment.duration(s*1000).seconds() + '秒'
|
|
|
|
+ }
|
|
|
|
+ return time
|
|
|
|
+ }
|
|
|
|
+ },
|
|
onLoad() {
|
|
onLoad() {
|
|
|
|
+ this.searchForm.beginDate = this.get7day(-6)
|
|
|
|
+ this.searchForm.endDate = this.get7day(0)
|
|
this.resetPage()
|
|
this.resetPage()
|
|
- this.range = [ this.get7day(-6), this.get7day(0) ]
|
|
|
|
- this.searchForm.creatTime = [ this.get7day(-6), this.get7day(0) ]
|
|
|
|
uni.$on("updatePointTaskList",()=>{
|
|
uni.$on("updatePointTaskList",()=>{
|
|
this.resetPage()
|
|
this.resetPage()
|
|
})
|
|
})
|
|
@@ -139,6 +137,12 @@
|
|
uni.$off("updatePointTaskList")
|
|
uni.$off("updatePointTaskList")
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
|
|
+ // 获取查询参数 刷新列表
|
|
|
|
+ refresh(params){
|
|
|
|
+ // console.log(params,'1111111111')
|
|
|
|
+ this.searchForm = params
|
|
|
|
+ this.pageInit(1)
|
|
|
|
+ },
|
|
// 查询列表
|
|
// 查询列表
|
|
pageInit(pageNo){
|
|
pageInit(pageNo){
|
|
if (pageNo) {
|
|
if (pageNo) {
|
|
@@ -147,10 +151,11 @@
|
|
let params = {
|
|
let params = {
|
|
pageNo: this.pageNo,
|
|
pageNo: this.pageNo,
|
|
pageSize: this.pageSize,
|
|
pageSize: this.pageSize,
|
|
- beginDate: this.searchForm.creatTime[0],
|
|
|
|
- endDate: this.searchForm.creatTime[1],
|
|
|
|
- storeName: this.searchForm.store,
|
|
|
|
- status: this.typeId==''?'':this.typeId // 任务状态
|
|
|
|
|
|
+ beginDate: this.searchForm.beginDate ? this.searchForm.beginDate : '',
|
|
|
|
+ endDate: this.searchForm.endDate ? this.searchForm.endDate : '',
|
|
|
|
+ storeName: this.searchForm.storeName ? this.searchForm.storeName : '',
|
|
|
|
+ typeList: this.searchForm.sourceType ? this.searchForm.sourceType : [],
|
|
|
|
+ status: this.typeId == '' ? '' : this.typeId // 任务状态
|
|
}
|
|
}
|
|
this.status = 'loading'
|
|
this.status = 'loading'
|
|
queryMyTask(params).then(res => {
|
|
queryMyTask(params).then(res => {
|
|
@@ -170,6 +175,12 @@
|
|
|
|
|
|
})
|
|
})
|
|
},
|
|
},
|
|
|
|
+ // 查看详情
|
|
|
|
+ getDetails(item){
|
|
|
|
+ uni.navigateTo({
|
|
|
|
+ url: '/pages/shopTourDetails/shopTourDetails?taskId=' + item.id
|
|
|
|
+ })
|
|
|
|
+ },
|
|
// tabs通知swiper切换
|
|
// tabs通知swiper切换
|
|
tabsChange(index) {
|
|
tabsChange(index) {
|
|
this.swiperCurrent = index
|
|
this.swiperCurrent = index
|
|
@@ -208,6 +219,10 @@
|
|
this.status = 'nomore'
|
|
this.status = 'nomore'
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
+ // 打开筛选条件
|
|
|
|
+ onNavigationBarButtonTap(e) {
|
|
|
|
+ this.openScreen = true
|
|
|
|
+ },
|
|
// 初始化数据
|
|
// 初始化数据
|
|
resetPage(){
|
|
resetPage(){
|
|
this.status = 'loading'
|
|
this.status = 'loading'
|
|
@@ -221,18 +236,6 @@
|
|
this.pageInit(1)
|
|
this.pageInit(1)
|
|
}
|
|
}
|
|
},
|
|
},
|
|
- // 选择日期范围
|
|
|
|
- onSelected(e){
|
|
|
|
- this.showPicker = false
|
|
|
|
- if(e) {
|
|
|
|
- this.range = e.value
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
- // 显示日期选择
|
|
|
|
- onShowDatePicker(type){
|
|
|
|
- this.showPicker = true
|
|
|
|
- this.searchForm.creatTime = this.range
|
|
|
|
- },
|
|
|
|
// 获取近几天的数据
|
|
// 获取近几天的数据
|
|
get7day(day){
|
|
get7day(day){
|
|
let today = new Date()
|
|
let today = new Date()
|
|
@@ -253,28 +256,11 @@
|
|
}
|
|
}
|
|
return m
|
|
return m
|
|
},
|
|
},
|
|
- // 打开筛选条件
|
|
|
|
- onNavigationBarButtonTap(e) {
|
|
|
|
- this.resetF()
|
|
|
|
- this.openScreen = true
|
|
|
|
- },
|
|
|
|
- // 重置筛选条件
|
|
|
|
- resetF(){
|
|
|
|
- this.range = this.searchForm.creatTime
|
|
|
|
- this.storeName = this.searchForm.store
|
|
|
|
- },
|
|
|
|
- // 确定筛选
|
|
|
|
- submitF(){
|
|
|
|
- this.searchForm.creatTime = this.range
|
|
|
|
- this.searchForm.store = this.storeName
|
|
|
|
- this.openScreen = false
|
|
|
|
- this.pageInit()
|
|
|
|
- },
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
</script>
|
|
|
|
|
|
-<style lang="scss" scoped>
|
|
|
|
|
|
+<style lang="scss">
|
|
page {
|
|
page {
|
|
background-color: #f8f8f8;
|
|
background-color: #f8f8f8;
|
|
height: calc(100vh - 44px);
|
|
height: calc(100vh - 44px);
|
|
@@ -295,7 +281,6 @@ page {
|
|
overflow: auto;
|
|
overflow: auto;
|
|
// 列表
|
|
// 列表
|
|
.record-con{
|
|
.record-con{
|
|
- padding-top: 74upx;
|
|
|
|
position: relative;
|
|
position: relative;
|
|
.alert-tips{
|
|
.alert-tips{
|
|
position: fixed;
|
|
position: fixed;
|