|
@@ -1,49 +1,67 @@
|
|
|
<template>
|
|
<template>
|
|
|
<view>
|
|
<view>
|
|
|
<uni-nav-bar fixed="true" statusBar="true" left-icon="back" title="维修工单" @clickLeft="back"></uni-nav-bar>
|
|
<uni-nav-bar fixed="true" statusBar="true" left-icon="back" title="维修工单" @clickLeft="back"></uni-nav-bar>
|
|
|
- <!-- <template>
|
|
|
|
|
- <view class="tab-title">
|
|
|
|
|
- <view v-for="(item, index) in tabList" :key="index" class="tab-item" :class="index === pickTabIndex ? 'active' : ''" @click="changeChartsTab(index)">
|
|
|
|
|
- {{ item.label }}
|
|
|
|
|
- <text v-if="item.number > 0" class="title-red">{{ item.number }}</text>
|
|
|
|
|
- </view>
|
|
|
|
|
- </view>
|
|
|
|
|
- <view class="tab-title__placeholder"></view>
|
|
|
|
|
- </template> -->
|
|
|
|
|
- <view class="top-wrapper">
|
|
|
|
|
- <view class="tab_box rx-sc">
|
|
|
|
|
- <view class="tab_item" v-for="(item,index) in tabList" :key="index"
|
|
|
|
|
- :class="{active: pickTabIndex == index}">
|
|
|
|
|
- <view @click="changeChartsTab(index)" class="badge-c">
|
|
|
|
|
- {{item.label}}
|
|
|
|
|
- <u-badge max="99" :value="item.number" absolute ></u-badge>
|
|
|
|
|
- <!-- <text v-if="item.number > 0" class="title-red">{{ item.number }}</text> -->
|
|
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ <view class="search-box">
|
|
|
|
|
+ <uni-section>
|
|
|
|
|
+ <uni-easyinput @clear="clearSearch" prefixIcon="search" style="width: 460rpx" v-model="searchForm.code"
|
|
|
|
|
+ placeholder="工单编号">
|
|
|
|
|
+ </uni-easyinput>
|
|
|
|
|
+ </uni-section>
|
|
|
|
|
+ <button class="search_btn" @click="doSearch">搜索</button>
|
|
|
|
|
+ <!-- <image class="menu_icon" @click="showSearch" src="~@/static/pda/menu.svg"></image> -->
|
|
|
|
|
+ </view>
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ <view v-show="showTab">
|
|
|
|
|
+ <view class="top-wrapper">
|
|
|
|
|
+ <view class="tab_box rx-sc">
|
|
|
|
|
+ <view class="tab_item" v-for="(item,index) in tabList" :key="index"
|
|
|
|
|
+ :class="{active: pickTabIndex == index}">
|
|
|
|
|
+ <view @click="changeChartsTab(index)" class="badge-c">
|
|
|
|
|
+ {{item.label}}
|
|
|
|
|
+ <u-badge max="99" :value="item.number" absolute></u-badge>
|
|
|
|
|
+ <!-- <text v-if="item.number > 0" class="title-red">{{ item.number }}</text> -->
|
|
|
|
|
+ </view>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
|
|
+
|
|
|
<OrderTask v-for="(item, index) in tabList" :key="index" v-show="index === pickTabIndex" :list="item.list"
|
|
<OrderTask v-for="(item, index) in tabList" :key="index" v-show="index === pickTabIndex" :list="item.list"
|
|
|
:type="tabList.value" :ParentIndex="pickTabIndex"></OrderTask>
|
|
:type="tabList.value" :ParentIndex="pickTabIndex"></OrderTask>
|
|
|
|
|
+ <u-toast ref="uToast"></u-toast>
|
|
|
|
|
+
|
|
|
|
|
+ <MySearch :show.sync="searchShow" :formItems="formItems" @search="confirmSearch" ref="mySearchRef"></MySearch>
|
|
|
</view>
|
|
</view>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
<script>
|
|
|
|
|
+ import {
|
|
|
|
|
+ isObjectEmpty
|
|
|
|
|
+ } from '@/utils/utils.js'
|
|
|
import {
|
|
import {
|
|
|
getWorkOrderList,
|
|
getWorkOrderList,
|
|
|
- getAssistList
|
|
|
|
|
|
|
+ getAssistList,
|
|
|
|
|
+ getRuleList
|
|
|
} from '@/api/myTicket'
|
|
} from '@/api/myTicket'
|
|
|
import OrderTask from './OrderTask.vue'
|
|
import OrderTask from './OrderTask.vue'
|
|
|
import {
|
|
import {
|
|
|
post,
|
|
post,
|
|
|
postJ
|
|
postJ
|
|
|
} from '@/utils/api.js'
|
|
} from '@/utils/api.js'
|
|
|
- let [page, size, isEnd] = [1, 10, false]
|
|
|
|
|
|
|
+
|
|
|
export default {
|
|
export default {
|
|
|
components: {
|
|
components: {
|
|
|
OrderTask
|
|
OrderTask
|
|
|
},
|
|
},
|
|
|
data() {
|
|
data() {
|
|
|
return {
|
|
return {
|
|
|
|
|
+ showTab: true,
|
|
|
|
|
+ page: 1,
|
|
|
|
|
+ size: 10,
|
|
|
|
|
+ isEnd: false,
|
|
|
tabList: [{
|
|
tabList: [{
|
|
|
value: 0,
|
|
value: 0,
|
|
|
label: '待接收',
|
|
label: '待接收',
|
|
@@ -77,23 +95,48 @@
|
|
|
],
|
|
],
|
|
|
pickTabIndex: 0,
|
|
pickTabIndex: 0,
|
|
|
qrContent: null,
|
|
qrContent: null,
|
|
|
- barType: 0
|
|
|
|
|
|
|
+ barType: 0,
|
|
|
|
|
+ searchShow: false,
|
|
|
|
|
+ searchForm: {
|
|
|
|
|
+ code: ''
|
|
|
|
|
+ },
|
|
|
|
|
+ formItems: [{
|
|
|
|
|
+ label: '规则名称:',
|
|
|
|
|
+ prop: 'ruleId',
|
|
|
|
|
+ component: 'MySelect',
|
|
|
|
|
+ props: {
|
|
|
|
|
+ localdata: [],
|
|
|
|
|
+ dataKey: 'name',
|
|
|
|
|
+ dataValue: 'id'
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ label: '时间:',
|
|
|
|
|
+ prop: 'startEndTime',
|
|
|
|
|
+ component: 'MyDateRange',
|
|
|
|
|
+ props: {
|
|
|
|
|
+ type: 'daterange',
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ ]
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
|
|
+ onLoad() {
|
|
|
|
|
+ this.getRuleList()
|
|
|
|
|
+ },
|
|
|
onShow() {
|
|
onShow() {
|
|
|
this.changeChartsTab(this.pickTabIndex)
|
|
this.changeChartsTab(this.pickTabIndex)
|
|
|
- // this.getFirstList()
|
|
|
|
|
this.getStatus()
|
|
this.getStatus()
|
|
|
},
|
|
},
|
|
|
- onReachBottom: function() {
|
|
|
|
|
- if (isEnd) {
|
|
|
|
|
|
|
+ onReachBottom() {
|
|
|
|
|
+ if (this.pickTabIndex === 4) {
|
|
|
|
|
+ this.getAList()
|
|
|
return
|
|
return
|
|
|
}
|
|
}
|
|
|
- // 显示加载图标
|
|
|
|
|
- uni.showLoading({
|
|
|
|
|
- title: '数据加载中'
|
|
|
|
|
- })
|
|
|
|
|
- this.getMoreLists()
|
|
|
|
|
|
|
+
|
|
|
|
|
+ this.getList()
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
getStatus() {
|
|
getStatus() {
|
|
@@ -115,23 +158,7 @@
|
|
|
}).then(res => {
|
|
}).then(res => {
|
|
|
this.tabList[1].number = res.count
|
|
this.tabList[1].number = res.count
|
|
|
})
|
|
})
|
|
|
- // getWorkOrderList({
|
|
|
|
|
- // orderStatus: [3],
|
|
|
|
|
- // type: 3,
|
|
|
|
|
- // pageNum: 1,
|
|
|
|
|
- // size: 1
|
|
|
|
|
- // }).then(res => {
|
|
|
|
|
- // // this.tabList[2].number = res.count
|
|
|
|
|
- // })
|
|
|
|
|
- // getWorkOrderList({
|
|
|
|
|
- // orderStatus: [4],
|
|
|
|
|
- // type: 3,
|
|
|
|
|
- // pageNum: 1,
|
|
|
|
|
- // size: 1
|
|
|
|
|
- // }).then(res => {
|
|
|
|
|
- // // this.tabList[3].number = res.count
|
|
|
|
|
- // })
|
|
|
|
|
- // /eam/PdaWorkOrder/assistList
|
|
|
|
|
|
|
+
|
|
|
},
|
|
},
|
|
|
getCount() {
|
|
getCount() {
|
|
|
statistics().then(data => {
|
|
statistics().then(data => {
|
|
@@ -168,37 +195,43 @@
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
getFirstList: function() {
|
|
getFirstList: function() {
|
|
|
- page = 1
|
|
|
|
|
- isEnd = false
|
|
|
|
|
- this.getList()
|
|
|
|
|
- },
|
|
|
|
|
- getMoreLists: function() {
|
|
|
|
|
- //获取更多数据
|
|
|
|
|
- // page++
|
|
|
|
|
|
|
+ this.page = 1
|
|
|
|
|
+ this.isEnd = false
|
|
|
this.getList()
|
|
this.getList()
|
|
|
},
|
|
},
|
|
|
|
|
+
|
|
|
getList() {
|
|
getList() {
|
|
|
|
|
+ if (this.isEnd) {
|
|
|
|
|
+ this.$refs.uToast.show({
|
|
|
|
|
+ message: "暂无更多数据",
|
|
|
|
|
+ duration: 1000
|
|
|
|
|
+ })
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
uni.showLoading({
|
|
uni.showLoading({
|
|
|
- title: '数据加载中'
|
|
|
|
|
|
|
+ title: '加载中'
|
|
|
})
|
|
})
|
|
|
|
|
+
|
|
|
let params = {
|
|
let params = {
|
|
|
orderStatus: [this.tabList[this.pickTabIndex].value],
|
|
orderStatus: [this.tabList[this.pickTabIndex].value],
|
|
|
type: 3,
|
|
type: 3,
|
|
|
- pageNum: page,
|
|
|
|
|
- size
|
|
|
|
|
|
|
+ pageNum: this.page,
|
|
|
|
|
+ size: this.size,
|
|
|
|
|
+ ...this.searchForm
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if (!this.showTab) {
|
|
|
|
|
+ delete params.orderStatus
|
|
|
}
|
|
}
|
|
|
getWorkOrderList(params)
|
|
getWorkOrderList(params)
|
|
|
.then(res => {
|
|
.then(res => {
|
|
|
- // this.tabList[this.pickTabIndex].list = res.list
|
|
|
|
|
- // this.tabList[this.pickTabIndex].list.push(res.list);
|
|
|
|
|
- // isEnd = this.tabList[this.pickTabIndex].list >= res.count
|
|
|
|
|
- if (page === 1) {
|
|
|
|
|
|
|
+ if (this.page === 1) {
|
|
|
this.tabList[this.pickTabIndex].list = res.list
|
|
this.tabList[this.pickTabIndex].list = res.list
|
|
|
} else {
|
|
} else {
|
|
|
this.tabList[this.pickTabIndex].list.push(...res.list)
|
|
this.tabList[this.pickTabIndex].list.push(...res.list)
|
|
|
}
|
|
}
|
|
|
- page += 1
|
|
|
|
|
- isEnd = this.tabList[this.pickTabIndex].list.length >= res.count;
|
|
|
|
|
|
|
+ this.page += 1
|
|
|
|
|
+ this.isEnd = this.tabList[this.pickTabIndex].list.length >= res.count;
|
|
|
uni.hideLoading()
|
|
uni.hideLoading()
|
|
|
})
|
|
})
|
|
|
.catch(() => {
|
|
.catch(() => {
|
|
@@ -207,8 +240,8 @@
|
|
|
},
|
|
},
|
|
|
changeChartsTab(index) {
|
|
changeChartsTab(index) {
|
|
|
this.pickTabIndex = index;
|
|
this.pickTabIndex = index;
|
|
|
- page = 1;
|
|
|
|
|
- isEnd = false;
|
|
|
|
|
|
|
+ this.page = 1;
|
|
|
|
|
+ this.isEnd = false;
|
|
|
if (index == 4) {
|
|
if (index == 4) {
|
|
|
this.getAList();
|
|
this.getAList();
|
|
|
} else {
|
|
} else {
|
|
@@ -216,29 +249,71 @@
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
async getAList() {
|
|
async getAList() {
|
|
|
|
|
+ if (this.isEnd) {
|
|
|
|
|
+ this.$refs.uToast.show({
|
|
|
|
|
+ message: "暂无更多数据",
|
|
|
|
|
+ duration: 1000
|
|
|
|
|
+ })
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
uni.showLoading({
|
|
uni.showLoading({
|
|
|
- title: '数据加载中'
|
|
|
|
|
|
|
+ title: '加载中'
|
|
|
})
|
|
})
|
|
|
getAssistList({
|
|
getAssistList({
|
|
|
type: 3,
|
|
type: 3,
|
|
|
- pageNum: page,
|
|
|
|
|
- size
|
|
|
|
|
|
|
+ pageNum: this.page,
|
|
|
|
|
+ size: this.size,
|
|
|
|
|
+ ...this.searchForm
|
|
|
}).then(res => {
|
|
}).then(res => {
|
|
|
// this.tabList[this.pickTabIndex].list = res.list
|
|
// this.tabList[this.pickTabIndex].list = res.list
|
|
|
// isEnd = this.tabList[this.pickTabIndex].list >= res.count
|
|
// isEnd = this.tabList[this.pickTabIndex].list >= res.count
|
|
|
- if (page === 1) {
|
|
|
|
|
|
|
+ if (this.page === 1) {
|
|
|
this.tabList[this.pickTabIndex].list = res.list
|
|
this.tabList[this.pickTabIndex].list = res.list
|
|
|
} else {
|
|
} else {
|
|
|
this.tabList[this.pickTabIndex].list.push(...res.list)
|
|
this.tabList[this.pickTabIndex].list.push(...res.list)
|
|
|
}
|
|
}
|
|
|
- page += 1
|
|
|
|
|
- isEnd = this.tabList[this.pickTabIndex].list.length >= res.count;
|
|
|
|
|
|
|
+ this.page += 1
|
|
|
|
|
+ this.isEnd = this.tabList[this.pickTabIndex].list.length >= res.count;
|
|
|
uni.hideLoading()
|
|
uni.hideLoading()
|
|
|
})
|
|
})
|
|
|
.catch(() => {
|
|
.catch(() => {
|
|
|
uni.hideLoading()
|
|
uni.hideLoading()
|
|
|
})
|
|
})
|
|
|
- }
|
|
|
|
|
|
|
+ },
|
|
|
|
|
+ async getRuleList() {
|
|
|
|
|
+ let params = {
|
|
|
|
|
+ status: 1,
|
|
|
|
|
+ type: 1,
|
|
|
|
|
+ pageNum: 1,
|
|
|
|
|
+ size: -1
|
|
|
|
|
+ }
|
|
|
|
|
+ const res = await getRuleList(params)
|
|
|
|
|
+ this.formItems.find(item => item.prop === 'ruleId').props.localdata = res
|
|
|
|
|
+ },
|
|
|
|
|
+ clearSearch() {
|
|
|
|
|
+ this.searchForm.code = ''
|
|
|
|
|
+ this.doSearch()
|
|
|
|
|
+ },
|
|
|
|
|
+ doSearch() {
|
|
|
|
|
+ this.isEnd = false;
|
|
|
|
|
+ this.page = 1;
|
|
|
|
|
+ this.showTab = isObjectEmpty(this.searchForm)
|
|
|
|
|
+ this.getList();
|
|
|
|
|
+ },
|
|
|
|
|
+ showSearch() {
|
|
|
|
|
+ this.searchShow = true
|
|
|
|
|
+ },
|
|
|
|
|
+ confirmSearch(e) {
|
|
|
|
|
+ console.log(e);
|
|
|
|
|
+ let data = JSON.parse(JSON.stringify(e))
|
|
|
|
|
+ this.searchForm = {
|
|
|
|
|
+ ...this.searchForm,
|
|
|
|
|
+ ...data
|
|
|
|
|
+ }
|
|
|
|
|
+ console.log(this.searchForm);
|
|
|
|
|
+ this.doSearch()
|
|
|
|
|
+ },
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
</script>
|
|
</script>
|
|
@@ -273,17 +348,55 @@
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
.badge-c {
|
|
.badge-c {
|
|
|
position: relative;
|
|
position: relative;
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
/deep/.u-badge {
|
|
/deep/.u-badge {
|
|
|
top: 0;
|
|
top: 0;
|
|
|
right: 0;
|
|
right: 0;
|
|
|
transform: translate(90%, 20%);
|
|
transform: translate(90%, 20%);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ .search-box {
|
|
|
|
|
+ background-color: #fff;
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ width: 750rpx;
|
|
|
|
|
+ height: 88rpx;
|
|
|
|
|
+ padding: 16rpx 32rpx;
|
|
|
|
|
+ align-items: center;
|
|
|
|
|
+ gap: 16rpx;
|
|
|
|
|
+ justify-content: space-between;
|
|
|
|
|
+
|
|
|
|
|
+ /deep/.uni-section {
|
|
|
|
|
+ margin-top: 0px;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /deep/.uni-section-header {
|
|
|
|
|
+ padding: 0px;
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .search_btn {
|
|
|
|
|
+ width: 120rpx;
|
|
|
|
|
+ height: 70rpx;
|
|
|
|
|
+ line-height: 70rpx;
|
|
|
|
|
+ padding: 0 24rpx;
|
|
|
|
|
+ background: $theme-color;
|
|
|
|
|
+ font-size: 32rpx;
|
|
|
|
|
+ color: #fff;
|
|
|
|
|
+ margin: 0;
|
|
|
|
|
+ margin-left: 26rpx;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .menu_icon {
|
|
|
|
|
+ width: 44rpx;
|
|
|
|
|
+ height: 44rpx;
|
|
|
|
|
+ margin-left: 14rpx;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
// .tab-title {
|
|
// .tab-title {
|
|
|
// position: fixed;
|
|
// position: fixed;
|
|
|
// z-index: 99;
|
|
// z-index: 99;
|