| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372 |
- <template>
- <view class="content" style="height: 100vh;" @touchstart="start" @touchend="end">
- <view class="subsection">
- <view class="division">
- <u-search placeholder="请输入任务处理人" v-model="name" :showAction="false" @input="search"></u-search>
- </view>
- <view class="subsection_ul">
- <view :class="current==index?'subsection_li subsection_li_act':'subsection_li'" title="" note=""
- v-for="(item,index) in list" :key="index" @click="sectionChange(index)">
- {{item}}
- </view>
- </view>
- </view>
- <u-loading-page loading-text="加载中..." :loading="loading" font-size="16"></u-loading-page>
- <view class="taskbox">
- <view class="hisbox_hint" v-if="tasklist.length==0">
- 暂无数据
- </view>
- <view class="taskbox_item" v-for="item,index in tasklist" :key="index" @click="totask(item.task_id)">
- <view class="taskbox_item_t">
- <view class="taskbox_item_t_l">
- {{item.task_type}}
- </view>
- <view class="taskbox_item_t_r">
- {{item.start_time}}
- </view>
- </view>
- <view class="taskbox_item_c">
- {{item.tesk_msg}}
- </view>
- <view class="taskbox_item_l">
- <view class="taskbox_item_l_l">
- <view class="taskbox_item_l_l_l">
- 处理人:{{item.operator_user}}
- </view>
- <view class="taskbox_item_l_l_r" v-if="item.task_status=='未开始'">
- {{item.diff_day}}天后开始
- </view>
- <view class="taskbox_item_l_l_r" v-if="item.task_status=='处理中'">
- 剩余{{item.diff_day}}天
- </view>
- <view class="taskbox_item_l_l_ri" v-if="item.task_status=='未处理'">
- 逾期{{item.diff_day}}天
- </view>
- </view>
- <view class="taskbox_item_l_r"
- :style="{color:colors(item.task_status),borderColor:colors(item.task_status)}">
- {{item.task_status}}
- </view>
- </view>
- </view>
- </view>
- <uni-calendar :insert="false" ref="calendar" :range="true" @confirm="confirm" />
- </view>
- </template>
- <script>
- import {
- Debounce
- } from "../../util/anitthro.js"
- export default {
- data() {
- return {
- list: ['待处理', '未完成', '已完成'],
- current: 0,
- tasklist: [],
- status: "待处理",
- loading: false,
- page: 1,
- start_time: "",
- end_time: "",
- keyword: "",
- name: "",
- startData:{
- clientX:0,
- clientY:0
- }
- }
- },
- onShow() {
- this.page = 1
- this.tasklist = []
- this.gettaskdata()
- },
- onLoad() {},
- onReachBottom() {
- this.page++
- this.gettaskdata()
- },
- onPullDownRefresh() {
- this.tasklist = []
- this.page = 1
- this.start_time = ""
- this.end_time = ""
- this.gettaskdata()
- setTimeout(() => {
- uni.stopPullDownRefresh()
- }, 1000)
- },
- onNavigationBarButtonTap(e) {
- if (this.current == 2) {
- this.opencale()
- }
- },
- watch: {
- videoData(news, old) {
- console.log('触发了2222222222222222222222')
- console.log(news)
- uni.switchTab({
- url: '../response/index'
- })
- // if (news) {
- // }
- },
- },
- computed: {
- // 视频消息
- videoData() {
- return this.$store.state.video
- },
- },
- methods: {
- sectionChange(e) {
- this.current = e
- this.status = this.list[e]
- this.tasklist = []
- this.name = ""
- this.page = 1
- let pages = getCurrentPages();
- var page = pages[pages.length - 1];
- var currentWebview = page.$getAppWebview();
- if (e == 2) {
- currentWebview.setTitleNViewButtonStyle(0, {
- text: "搜索",
- });
- } else {
- currentWebview.setTitleNViewButtonStyle(0, {
- text: " ",
- });
- }
- this.gettaskdata()
- },
- colors(type) {
- if (type == '未开始' || type == '未处理') {
- return '#ffaa00';
- } else if (type == '已完成') {
- return '#02C644';
- } else if (type == '逾期完成') {
- return '#ff0000';
- } else if (type == '处理中') {
- return '#409EFF';
- }
- },
- async gettaskdata() {
- this.loading = true
- const res = await this.$myRequest({
- url: '/api/api_gateway?method=app.task.task_list',
- data: {
- page: this.page, // 否 页码, 默认1
- page_item: "10", //
- status: this.status,
- start_time: this
- .start_time, // 非必填 开始时间
- end_time: this.end_time,
- operator_user_name: this.name
- }
- })
- // this.tasklist = res.page_list
- for (var i = 0; i < res.page_list.length; i++) {
- this.tasklist.push(res.page_list[i])
- }
- // console.log(res)
- this.loading = false
- },
- totask(id) {
- uni.navigateTo({
- url: "./harmfultask?id=" + id + "¤t=" + this.current
- })
- },
- opencale() {
- this.$refs.calendar.open();
- },
- confirm(e) {
- this.start_time = e.range.before
- this.end_time = e.range.after
- this.tasklist = []
- this.page = 1
- this.gettaskdata()
- },
- search() {
- Debounce(() => {
- this.tasklist = []
- this.page = 1
- this.gettaskdata()
- }, 1000)()
- },
- start(e) {
- // console.log("滑动222")
- this.startData.clientX = e.changedTouches[0].clientX;
- this.startData.clientY = e.changedTouches[0].clientY;
- },
- end(e) {
- console.log("滑动")
- const subX = e.changedTouches[0].clientX - this.startData.clientX;
- const subY = e.changedTouches[0].clientY - this.startData.clientY;
- if (subY > 50 || subY < -50) {
- console.log('上下滑')
- } else {
- if (subX > 50) {
- console.log('右滑')
- if(this.current!=0){
- this.current--
- this.sectionChange(this.current)
- }
- } else if (subX < -50) {
- console.log('左滑')
- if(this.current!=2){
- this.current++
- this.sectionChange(this.current)
- }
- } else {
- console.log('无效')
- }
- }
- }
- }
- }
- </script>
- <style lang="less" scoped>
- .subsection {
- width: 100%;
- position: fixed;
- top: 0rpx;
- height: 70rpx;
- z-index: 9;
- padding-top: 10px;
- background-color: #fff;
- .division {
- width: 90%;
- display: flex;
- margin: 0 auto;
- background-color: #fff;
- padding: 20rpx 0;
- .screen {
- // position: fixed;
- // top: -20rpx;
- // right: 20rpx;
- // z-index: 9999999999;
- }
- }
- .subsection_ul {
- height: 70rpx;
- display: flex;
- justify-content: space-around;
- border-bottom: 1px solid #F6F6F6;
- background-color: #fff;
- .subsection_li {
- height: 70rpx;
- text-align: center;
- line-height: 70rpx;
- }
- .subsection_li_act {
- color: #409EFF;
- border-bottom: 3px solid #409EFF;
- }
- }
- }
- /deep/.u-subsection {
- background-color: #f7f7f7 !important;
- // margin: 20rpx 0;
- .u-subsection__bar {
- background-color: #fff;
- }
- }
- .taskbox {
- // margin-top: 88rpx;
- width: 90%;
- margin: 180rpx auto 0;
- .hisbox_hint {
- width: 100%;
- text-align: center;
- font-size: 28rpx;
- height: 100rpx;
- line-height: 100rpx;
- color: #999999;
- }
- .taskbox_item {
- width: 100%;
- font-size: 28rpx;
- border-bottom: 1px solid #F6F6F6;
- padding: 40rpx 0;
- .taskbox_item_t,
- .taskbox_item_l {
- width: 100%;
- display: flex;
- justify-content: space-between;
- margin-bottom: 20rpx;
- }
- .taskbox_item_c {
- margin-bottom: 20rpx;
- text-overflow: -o-ellipsis-lastline;
- overflow: hidden;
- text-overflow: ellipsis;
- display: -webkit-box;
- -webkit-line-clamp: 2;
- line-clamp: 2;
- -webkit-box-orient: vertical;
- }
- .taskbox_item_t_l {
- font-weight: 700;
- }
- .taskbox_item_t_r {
- color: #999999;
- }
- .taskbox_item_l_l {
- display: flex;
- }
- .taskbox_item_l_l_l {
- padding: 8rpx;
- font-size: 24rpx;
- background-color: rgba(64, 158, 255, 0.15);
- font-weight: 700;
- color: #409EFF;
- margin-right: 10rpx;
- border-radius: 10rpx;
- }
- .taskbox_item_l_l_r {
- padding: 8rpx;
- font-size: 24rpx;
- background-color: rgba(2, 198, 68, 0.15);
- font-weight: 700;
- color: #02C644;
- border-radius: 10rpx;
- }
- .taskbox_item_l_l_ri {
- padding: 8rpx;
- font-size: 24rpx;
- background-color: rgba(255, 0, 0, 0.1);
- font-weight: 700;
- color: #f00;
- border-radius: 10rpx;
- }
- .taskbox_item_l_r {
- padding: 8rpx;
- font-size: 24rpx;
- border: 1px solid;
- border-radius: 10rpx;
- }
- }
- }
- </style>
|