huang_an 2 лет назад
Родитель
Сommit
619ac2c489

+ 14 - 3
components/Assign.vue

@@ -10,7 +10,8 @@
 				<view class="select-wrapper">
 					<view class="col deptInp">
 						<text class="label">部门:</text>
-						<input type="text" disabled :value="formData.executorDeptName" @tap="openPicker" placeholder="请选择" />
+						<!-- <input type="text" disabled :value="formData.executorDeptName" placeholder="请选择" /> -->
+						<text class="input_text" @click="openPicker">{{ formData.executorDeptName ? formData.executorDeptName : '请选择' }}</text>
 					</view>
 
 					<view class="col userInp">
@@ -264,14 +265,24 @@
 					text-align: right;
 				}
 
+				.input_text {
+					flex: 1;
+					height: 66rpx;
+					line-height: 66rpx;
+					padding: 0rpx 16rpx;
+					box-sizing: border-box;
+					font-size: 28rpx;
+					border: 1px solid #eceeec;
+					border-radius: 8rpx;
+				}
+
 				input {
 					flex: 1;
 					border: 1rpx solid #e5e5e5;
 					height: 66rpx;
 					border-radius: 8rpx;
 					font-size: 28rpx;
-					padding: 8rpx 16rpx;
-					box-sizing: border-box;
+					padding: 0rpx 16rpx;
 					color: #6a6a6a;
 				}
 

+ 3 - 3
pages/index/index.vue

@@ -251,7 +251,7 @@
 						name: '保养工单',
 						type: 'maintenance',
 						workOrderType: 2,
-						url: `/pages/home/myTicket/myTicket?index=0&&orderType=1`,
+						url: `/pages/maintenance/order/order`,
 						icon: 'icon-gongdanguanli',
 						badge: 0
 					},
@@ -259,7 +259,7 @@
 						name: '巡点检工单',
 						type: 'patrol',
 						workOrderType: 1,
-						url: `/pages/home/myTicket/myTicket?index=1&&orderType=1`,
+						url: `/pages/tour_tally/order/order`,
 						icon: 'icon-gongdanguanli',
 						badge: 0
 					},
@@ -275,7 +275,7 @@
 						name: '维修工单',
 						type: 'repaire',
 						workOrderType: 3,
-						url: `/pages/home/myTicket/myTicket?index=2&&orderType=1`,
+						url: `/pages/maintenanceWorkorder/order/order`,
 						icon: 'icon-gongdanguanli',
 						badge: 0
 					},

+ 108 - 0
pages/maintenance/order/OrderTask copy.vue

@@ -0,0 +1,108 @@
+<template>
+  <view class="marginTop">
+    <view
+      v-for="(item, index) in list"
+      class="kd-row"
+      :key="item.id"
+      @click="goDetail(item)"
+      v-show="list.length !== 0"
+    >
+      <!-- 进度组件 -->
+      <view class="kd-col">
+        <text class="title">{{ item.workOrderCode }}</text>
+        <text>{{ item.planName }}</text>
+      </view>
+      <view class="kd-col">
+        <text>规则名称:{{ item.ruleName }}</text>
+        <text>{{ item.equiTypeName }}</text>
+      </view>
+      <view class="kd-col">
+        <text
+          class="status"
+          :class="statusList[item.status && item.status.code]"
+          >{{ item.status && item.status.descp }}</text
+        >
+        <text class="text-danger">截止时间 {{ item.planFinishTime }}</text>
+      </view>
+    </view>
+    <view v-show="list.length === 0" class="no_data">
+      <u-empty mode="data" textSize="22"></u-empty>
+    </view>
+  </view>
+</template>
+
+<script>
+import CellTip from '@/components/CellTip.vue'
+export default {
+  components: {
+    CellTip
+  },
+  props: {
+    list: {
+      type: Array,
+      default: () => []
+    }
+  },
+  data () {
+    return {
+      statusList: {
+        0: 'text-primary',
+        1: '',
+        2: 'text-primary'
+      }
+    }
+  },
+  methods: {
+    goDetail ({ workOrderCode, id }) {
+      uni.navigateTo({
+        url: `../detail/detail?workOrderCode=${workOrderCode}&id=${id}`
+      })
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+.marginTop {
+  border-top: 20rpx solid $page-bg;
+
+  .kd-row {
+    font-size: 28rpx;
+    padding: 14rpx 12rpx 6rpx;
+    border-bottom: 1rpx solid $page-bg;
+    .kd-col {
+      display: flex;
+      justify-content: space-between;
+      align-items: center;
+      padding: 2rpx;
+      color: #aaaaaa;
+
+      .status {
+        // background-color: $page-bg;
+        border: 1rpx solid $page-bg;
+        display: inline-block;
+        padding: 4rpx 10rpx;
+        border-radius: 18rpx;
+      }
+    }
+    .title {
+      font-weight: bold;
+      color: #333333;
+    }
+  }
+
+  .center {
+    text-align: center;
+    margin-bottom: 10rpx;
+    color: #999;
+  }
+  .no_data {
+    position: fixed;
+    top: 50%;
+    left: 50%;
+    transform: translate(-50%, -50%);
+    color: #999;
+    font-size: 28rpx;
+  }
+}
+</style>

+ 124 - 97
pages/maintenance/order/OrderTask.vue

@@ -1,108 +1,135 @@
 <template>
-  <view class="marginTop">
-    <view
-      v-for="(item, index) in list"
-      class="kd-row"
-      :key="item.id"
-      @click="goDetail(item)"
-      v-show="list.length !== 0"
-    >
-      <!-- 进度组件 -->
-      <view class="kd-col">
-        <text class="title">{{ item.workOrderCode }}</text>
-        <text>{{ item.planName }}</text>
-      </view>
-      <view class="kd-col">
-        <text>规则名称:{{ item.ruleName }}</text>
-        <text>{{ item.equiTypeName }}</text>
-      </view>
-      <view class="kd-col">
-        <text
-          class="status"
-          :class="statusList[item.status && item.status.code]"
-          >{{ item.status && item.status.descp }}</text
-        >
-        <text class="text-danger">截止时间 {{ item.planFinishTime }}</text>
-      </view>
-    </view>
-    <view v-show="list.length === 0" class="no_data">
-      <u-empty mode="data" textSize="22"></u-empty>
-    </view>
-  </view>
+	<view class="marginTop">
+		<view class="list-wrap" v-for="(item, index) in list" :key="index" v-show="list.length !== 0" @click="goDetail(item)">
+			<view class="item">
+				<view class="s1">
+					<text class="title">{{ item.code }}</text>
+				</view>
+				<!-- <view class="s2">
+					{{ item.createTime }}
+				</view> -->
+			</view>
+			<view class="item">
+				<view class="s1">设备名称:{{ item.deviceName }}</view>
+			</view>
+			<view class="item">
+				<view class="s1">规则名称:{{ item.ruleName }}</view>
+			</view>
+			<view class="item">
+				<view class="s1">截止时间:{{ item.planFinishTime }}</view>
+			</view>
+			<view class="item">
+				<view class="s1">
+					<view class="state">
+						{{ dict.status[item.orderStatus] }}
+					</view>
+				</view>
+			</view>
+		</view>
+		<view v-show="list.length === 0" class="no_data">
+			<u-empty mode="data"></u-empty>
+		</view>
+	</view>
 </template>
 
 <script>
-import CellTip from '@/components/CellTip.vue'
-export default {
-  components: {
-    CellTip
-  },
-  props: {
-    list: {
-      type: Array,
-      default: () => []
-    }
-  },
-  data () {
-    return {
-      statusList: {
-        0: 'text-primary',
-        1: '',
-        2: 'text-primary'
-      }
-    }
-  },
-  methods: {
-    goDetail ({ workOrderCode, id }) {
-      uni.navigateTo({
-        url: `../detail/detail?workOrderCode=${workOrderCode}&id=${id}`
-      })
-    }
-  }
-}
+	export default {
+		props: {
+			type: {
+				type: [String, Number]
+			},
+			list: {
+				type: Array,
+				default: () => []
+			}
+		},
+		data() {
+			return {
+				dict: {
+					status: {
+						0: '待接收',
+						2: '执行中',
+						3: '已完成'
+					},
+					//紧急程度
+					urgent: {
+						1: '普通',
+						2: '紧急',
+						3: '重要'
+					}
+				}
+			}
+		},
+		methods: {
+			goDetail(item) {
+				uni.navigateTo({
+					url: `/pages/maintenance/detail/detail?id=${item.id}&planId=${item.planId}&code=${item.code}&&orderType=1`
+				})
+			},
+			isClass() {
+				switch (String(this.type)) {
+					case '0':
+						return 'd1'
+						break
+					case '1':
+						return 'd2'
+						break
+					case '3':
+						return 'd3'
+						break
+					default:
+						break
+				}
+			}
+		}
+	}
 </script>
 
 <style lang="scss" scoped>
-.marginTop {
-  border-top: 20rpx solid $page-bg;
+	.marginTop {
+		border-top: 20rpx solid $page-bg;
+	}
 
-  .kd-row {
-    font-size: 28rpx;
-    padding: 14rpx 12rpx 6rpx;
-    border-bottom: 1rpx solid $page-bg;
-    .kd-col {
-      display: flex;
-      justify-content: space-between;
-      align-items: center;
-      padding: 2rpx;
-      color: #aaaaaa;
+	.center {
+		text-align: center;
+		margin-bottom: 10rpx;
+		color: #999;
+	}
 
-      .status {
-        // background-color: $page-bg;
-        border: 1rpx solid $page-bg;
-        display: inline-block;
-        padding: 4rpx 10rpx;
-        border-radius: 18rpx;
-      }
-    }
-    .title {
-      font-weight: bold;
-      color: #333333;
-    }
-  }
+	.no_data {
+		position: fixed;
+		top: 50%;
+		left: 50%;
+		transform: translate(-50%, -50%);
+		color: #999;
+		font-size: 28rpx;
+	}
 
-  .center {
-    text-align: center;
-    margin-bottom: 10rpx;
-    color: #999;
-  }
-  .no_data {
-    position: fixed;
-    top: 50%;
-    left: 50%;
-    transform: translate(-50%, -50%);
-    color: #999;
-    font-size: 28rpx;
-  }
-}
+	.list-wrap {
+		padding: 10rpx;
+		.item {
+			display: flex;
+			justify-content: space-between;
+			padding: 10rpx;
+			color: rgb(170, 170, 170);
+			font-size: 28rpx;
+			word-break: break-all;
+			.title {
+				color: #333333;
+				font-size: 28rpx;
+			}
+			.state {
+				font-size: 12px;
+				color: #7f7f7f;
+				background: #f1f1f1;
+				display: inline;
+				padding: 2px 5px;
+				border-radius: 10px;
+			}
+		}
+
+		& + .list-wrap {
+			border-top: 1px solid rgba(242, 242, 242, 1);
+		}
+	}
 </style>

+ 182 - 0
pages/maintenance/order/order copy.vue

@@ -0,0 +1,182 @@
+<template>
+  <view>
+    <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="index == 0" class="title-red">{{ item.number }}</text>
+          <text v-else class="title-num">({{ item.number }})</text>
+        </view>
+      </view>
+      <view class="tab-title__placeholder"></view>
+    </template>
+
+    <OrderTask
+      v-for="(item, index) in tabList"
+      :key="index"
+      v-show="index === pickTabIndex"
+      :list="pageList"
+    ></OrderTask>
+  </view>
+</template>
+
+<script>
+import OrderTask from './OrderTask.vue'
+import { post, get, postJ } from '@/utils/api.js'
+let [page, size, isEnd] = [1, 10, true]
+export default {
+  components: {
+    OrderTask
+  },
+  data () {
+    return {
+      tabList: [
+        {
+          value: 0,
+          label: '待接收',
+          list: [],
+          number: 0
+        },
+        {
+          value: 1,
+          label: '执行中',
+          list: [],
+          number: 0
+        },
+        {
+          value: 3,
+          label: '已完成',
+          list: [],
+          number: 0
+        }
+      ],
+      pageList: [],
+      pickTabIndex: 0
+    }
+  },
+  onLoad () {
+    // this.getList()
+  },
+  onShow () {
+    this.getFirstList()
+    this.getStatus()
+  },
+  onReachBottom: function () {
+    if (isEnd) {
+      return
+    }
+
+    // 显示加载图标
+    uni.showLoading({
+      title: '数据加载中'
+    })
+    this.getMoreLists()
+  },
+  methods: {
+    getStatus () {
+      postJ(this.apiUrl + `/workOrder/getWorkOrderTotal`, {
+        workOrderType: 2
+      }).then(res => {
+        let data = res.data
+        this.tabList[0].number = data.waitExecutionNum
+        this.tabList[1].number = data.executoryNum
+        this.tabList[2].number = data.finishNum
+      })
+    },
+    getFirstList: function () {
+      page = 1
+      isEnd = true
+      this.getList()
+    },
+    getMoreLists: function () {
+      //获取更多数据
+      page++
+      this.getList()
+    },
+    //获取列表数据
+    getList () {
+      let data = {
+        page,
+        size
+      }
+      const pickTabIndex = this.pickTabIndex
+      let status = this.tabList[pickTabIndex].value
+      post(
+        this.apiUrl +
+          `/workOrder/getWorkOrderListApp?page=${page}&size=${size}`,
+        { status, workOrderType: 2 },
+        true
+      ).then(res => {
+        let data = res.data.records
+        if (page === 1) {
+          this.pageList = res.data.records
+        } else {
+          this.pageList.push(...data)
+        }
+        isEnd = this.pageList.length >= res.data.total
+        // page < pageTotal ? (isEnd = false) : (isEnd = true);
+      })
+    },
+    //切换选项卡
+    changeChartsTab (index) {
+      this.pickTabIndex = index
+      this.getFirstList()
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+.tab-title {
+  position: fixed;
+  z-index: 9;
+  width: 100%;
+  padding: 0 30rpx;
+  display: flex;
+  justify-content: space-between;
+  height: $tab-height;
+  line-height: $tab-height;
+  background-color: #ffffff;
+  border-bottom: 1px solid #f2f2f2;
+  box-sizing: border-box;
+  .tab-item {
+    width: 30%;
+    text-align: center;
+    font-size: 32rpx;
+    color: $uni-text-color-grey;
+  }
+
+  .tab-item.active {
+    color: $j-primary-border-green;
+    border-bottom: 1px solid $j-primary-border-green;
+  }
+  .title-num {
+    font-size: 26rpx;
+  }
+  .title-red {
+    display: inline-block;
+    font-size: 22rpx;
+    padding: 0 10rpx;
+    border-radius: 50rpx;
+    color: #ffffff;
+    background: red;
+    line-height: 38rpx;
+    position: absolute;
+    top: 10rpx;
+    min-width: 18rpx;
+  }
+}
+</style>

+ 195 - 172
pages/maintenance/order/order.vue

@@ -1,182 +1,205 @@
 <template>
-  <view>
-    <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="index == 0" class="title-red">{{ item.number }}</text>
-          <text v-else class="title-num">({{ item.number }})</text>
-        </view>
-      </view>
-      <view class="tab-title__placeholder"></view>
-    </template>
+	<view>
+		<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>
 
-    <OrderTask
-      v-for="(item, index) in tabList"
-      :key="index"
-      v-show="index === pickTabIndex"
-      :list="pageList"
-    ></OrderTask>
-  </view>
+		<OrderTask v-for="(item, index) in tabList" :key="index" v-show="index === pickTabIndex" :list="item.list" :type="tabList.value"></OrderTask>
+	</view>
 </template>
 
 <script>
-import OrderTask from './OrderTask.vue'
-import { post, get, postJ } from '@/utils/api.js'
-let [page, size, isEnd] = [1, 10, true]
-export default {
-  components: {
-    OrderTask
-  },
-  data () {
-    return {
-      tabList: [
-        {
-          value: 0,
-          label: '待接收',
-          list: [],
-          number: 0
-        },
-        {
-          value: 1,
-          label: '执行中',
-          list: [],
-          number: 0
-        },
-        {
-          value: 3,
-          label: '已完成',
-          list: [],
-          number: 0
-        }
-      ],
-      pageList: [],
-      pickTabIndex: 0
-    }
-  },
-  onLoad () {
-    // this.getList()
-  },
-  onShow () {
-    this.getFirstList()
-    this.getStatus()
-  },
-  onReachBottom: function () {
-    if (isEnd) {
-      return
-    }
-
-    // 显示加载图标
-    uni.showLoading({
-      title: '数据加载中'
-    })
-    this.getMoreLists()
-  },
-  methods: {
-    getStatus () {
-      postJ(this.apiUrl + `/workOrder/getWorkOrderTotal`, {
-        workOrderType: 2
-      }).then(res => {
-        let data = res.data
-        this.tabList[0].number = data.waitExecutionNum
-        this.tabList[1].number = data.executoryNum
-        this.tabList[2].number = data.finishNum
-      })
-    },
-    getFirstList: function () {
-      page = 1
-      isEnd = true
-      this.getList()
-    },
-    getMoreLists: function () {
-      //获取更多数据
-      page++
-      this.getList()
-    },
-    //获取列表数据
-    getList () {
-      let data = {
-        page,
-        size
-      }
-      const pickTabIndex = this.pickTabIndex
-      let status = this.tabList[pickTabIndex].value
-      post(
-        this.apiUrl +
-          `/workOrder/getWorkOrderListApp?page=${page}&size=${size}`,
-        { status, workOrderType: 2 },
-        true
-      ).then(res => {
-        let data = res.data.records
-        if (page === 1) {
-          this.pageList = res.data.records
-        } else {
-          this.pageList.push(...data)
-        }
-        isEnd = this.pageList.length >= res.data.total
-        // page < pageTotal ? (isEnd = false) : (isEnd = true);
-      })
-    },
-    //切换选项卡
-    changeChartsTab (index) {
-      this.pickTabIndex = index
-      this.getFirstList()
-    }
-  }
-}
+	import { getWorkOrderList } from '@/api/myTicket'
+	import OrderTask from './OrderTask.vue'
+	import { post, postJ } from '@/utils/api.js'
+	let [page, size, isEnd] = [1, 10, true]
+	export default {
+		components: {
+			OrderTask
+		},
+		data() {
+			return {
+				tabList: [
+					{
+						value: 0,
+						label: '待接收',
+						list: [],
+						number: 0
+					},
+					{
+						value: 2,
+						label: '执行中',
+						list: [],
+						number: 0
+					},
+					{
+						value: 3,
+						label: '已完成',
+						list: [],
+						number: 0
+					}
+				],
+				pickTabIndex: 0,
+				qrContent: null,
+				barType: 0
+			}
+		},
+		onShow() {
+			this.getFirstList()
+			this.getStatus()
+		},
+		onReachBottom: function () {
+			if (isEnd) {
+				return
+			}
+			// 显示加载图标
+			uni.showLoading({
+				title: '数据加载中'
+			})
+			this.getMoreLists()
+		},
+		methods: {
+			getStatus() {
+				getWorkOrderList({ orderStatus: [0], type: 2, pageNum: 1, size: 1 }).then(res => {
+					this.tabList[0].number = res.count
+				})
+				getWorkOrderList({ orderStatus: [2], type: 2, pageNum: 1, size: 1 }).then(res => {
+					this.tabList[1].number = res.count
+				})
+				getWorkOrderList({ orderStatus: [3], type: 2, pageNum: 1, size: 1 }).then(res => {
+					this.tabList[2].number = res.count
+				})
+				getWorkOrderList({ orderStatus: [4], type: 2, pageNum: 1, size: 1 }).then(res => {
+					this.tabList[3].number = res.count
+				})
+			},
+			getCount() {
+				statistics().then(data => {
+					console.log('onsole.log(data)-----------')
+					console.log(data)
+					this.tabList = this.tabList.map(item => {
+						switch (item.value) {
+							case '0':
+								return { ...item, badge: { value: data.maintenanceNum } }
+							case '2':
+								return { ...item, badge: { value: data.patrolInspection } }
+							case '3':
+								return { ...item, badge: { value: data.quantityNum } }
+							case '4':
+								return { ...item, badge: { value: data.repairsNum } }
+						}
+					})
+				})
+			},
+			getFirstList: function () {
+				page = 1
+				isEnd = true
+				this.getList()
+			},
+			getMoreLists: function () {
+				//获取更多数据
+				page++
+				this.getList()
+			},
+			getList() {
+				uni.showLoading({
+					title: '数据加载中'
+				})
+				let params = {
+					orderStatus: [this.tabList[this.pickTabIndex].value],
+					type: 2,
+					pageNum: page,
+					size
+				}
+				getWorkOrderList(params)
+					.then(res => {
+						this.tabList[this.pickTabIndex].list = res.list
+						isEnd = this.tabList[this.pickTabIndex].list >= res.count
+						uni.hideLoading()
+					})
+					.catch(() => {
+						uni.hideLoading()
+					})
+			},
+			changeChartsTab(index) {
+				this.pickTabIndex = index
+				this.getFirstList()
+			}
+		}
+	}
 </script>
 
 <style lang="scss" scoped>
-.tab-title {
-  position: fixed;
-  z-index: 9;
-  width: 100%;
-  padding: 0 30rpx;
-  display: flex;
-  justify-content: space-between;
-  height: $tab-height;
-  line-height: $tab-height;
-  background-color: #ffffff;
-  border-bottom: 1px solid #f2f2f2;
-  box-sizing: border-box;
-  .tab-item {
-    width: 30%;
-    text-align: center;
-    font-size: 32rpx;
-    color: $uni-text-color-grey;
-  }
+	.tab-title {
+		position: fixed;
+		z-index: 99;
+		width: 100%;
+		padding: 10rpx;
+		// display: flex;
+		// justify-content: space-between;
+		height: $tab-height;
+		line-height: $tab-height;
+		background-color: #ffffff;
+		border-bottom: 1px solid #f2f2f2;
+		// box-sizing: border-box;
+		white-space: nowrap;
+		overflow: auto hidden;
+		display: flex;
+
+		&::-webkit-scrollbar {
+			/*滚动条整体样式*/
+			width: 10px;
+			/*高宽分别对应横竖滚动条的尺寸*/
+			height: 1px;
+		}
+
+		&::-webkit-scrollbar-thumb {
+			/*滚动条里面小方块*/
+			border-radius: 10px;
+			-webkit-box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
+			background: #535353;
+		}
+
+		&::-webkit-scrollbar-track {
+			/*滚动条里面轨道*/
+			-webkit-box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
+			border-radius: 10px;
+			background: #ededed;
+		}
+
+		.tab-item {
+			flex: 1;
+			text-align: center;
+			display: inline-block;
+			font-size: 32rpx;
+			color: $uni-text-color-grey;
+		}
 
-  .tab-item.active {
-    color: $j-primary-border-green;
-    border-bottom: 1px solid $j-primary-border-green;
-  }
-  .title-num {
-    font-size: 26rpx;
-  }
-  .title-red {
-    display: inline-block;
-    font-size: 22rpx;
-    padding: 0 10rpx;
-    border-radius: 50rpx;
-    color: #ffffff;
-    background: red;
-    line-height: 38rpx;
-    position: absolute;
-    top: 10rpx;
-    min-width: 18rpx;
-  }
-}
+		.tab-item.active {
+			color: $j-primary-border-green;
+			border-bottom: 1px solid $j-primary-border-green;
+		}
+		.title-num {
+			font-size: 26rpx;
+		}
+		.title-red {
+			display: inline-block;
+			font-size: 22rpx;
+			padding: 0 10rpx;
+			border-radius: 50rpx;
+			color: #ffffff;
+			background: red;
+			line-height: 38rpx;
+			position: absolute;
+			top: 10rpx;
+			min-width: 18rpx;
+		}
+	}
 </style>

+ 174 - 0
pages/maintenanceWorkorder/order/OrderTask copy.vue

@@ -0,0 +1,174 @@
+<template>
+  <view class="marginTop">
+    <view
+      class="list-wrap"
+      v-for="(item, index) in list"
+      :key="index"
+      v-show="list.length !== 0"
+      @click="goDetail(item)"
+    >
+      <view class="item">
+        <view class="s1">
+          <text class="title">{{ item.workOrderCode }}</text>
+        </view>
+        <view class="s2">
+          {{ item.createTime }}
+        </view>
+      </view>
+      <view class="item">
+        <view class="s1"> 设备名称:{{ item.equiName }} </view>
+      </view>
+      <view class="item">
+        <view class="s1"> 设备编码:{{ item.equiCode }} </view>
+      </view>
+      <view class="item">
+        <view class="s1"> 故障描述:{{ item.content }} </view>
+      </view>
+      <view class="item">
+        <view class="s1">
+          <view class="state">
+            {{ dict.status[item.status.code] }}
+          </view>
+        </view>
+      </view>
+      <!-- 			<view class="item">
+				<view class="md">
+					{{item.workOrderCode}}
+				</view>
+				<view class="">
+					{{item.createTime}}
+				</view>
+			</view>
+			<view class="item">
+				<view class="s1">
+					设备名称: {{item.equiName}}
+				</view>
+				<view class="s2">
+					设备编码: {{item.equiCode}}
+				</view>
+			</view>
+			<view class="item">
+				故障描述 : {{item.content}}
+			</view>
+			<view class="item">
+				计划完成时间: {{item.planFinishTime}}
+			</view>
+			<view class="item">
+				<view class="icon" :class="isClass">
+					{{dict.status[item.status.code]}}
+				</view>
+			</view> -->
+    </view>
+    <view v-show="list.length === 0" class="no_data">
+      <u-empty mode="data"></u-empty>
+    </view>
+  </view>
+</template>
+
+<script>
+export default {
+  props: {
+    type: {
+      type: [String, Number]
+    },
+    list: {
+      type: Array,
+      default: () => []
+    }
+  },
+  data () {
+    return {
+      dict: {
+        status: {
+          0: '待接收',
+          1: '执行中',
+          2: '待审核',
+          3: '完成',
+          4: '已撤回',
+          5: '待验收',
+          6: '已驳回',
+          7: '未修复',
+          8: '已派单'
+        },
+        //紧急程度
+        urgent: {
+          1: '普通',
+          2: '紧急',
+          3: '重要'
+        }
+      }
+    }
+  },
+  methods: {
+    goDetail (item) {
+      uni.navigateTo({
+        url: `/pages/maintain_service/detail/detail?id=${item.id}&workOrderCode=${item.workOrderCode}`
+      })
+    },
+    isClass () {
+      switch (String(this.type)) {
+        case '0':
+          return 'd1'
+          break
+        case '1':
+          return 'd2'
+          break
+        case '3':
+          return 'd3'
+          break
+        default:
+          break
+      }
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+.marginTop {
+  border-top: 20rpx solid $page-bg;
+}
+
+.center {
+  text-align: center;
+  margin-bottom: 10rpx;
+  color: #999;
+}
+
+.no_data {
+  position: fixed;
+  top: 50%;
+  left: 50%;
+  transform: translate(-50%, -50%);
+  color: #999;
+  font-size: 28rpx;
+}
+
+.list-wrap {
+  padding: 10rpx;
+  .item {
+    display: flex;
+    justify-content: space-between;
+    padding: 10rpx;
+    color: rgb(170, 170, 170);
+    font-size: 28rpx;
+    word-break: break-all;
+    .title {
+      color: #333333;
+      font-size: 28rpx;
+    }
+    .state {
+      font-size: 12px;
+      color: #7f7f7f;
+      background: #f1f1f1;
+      display: inline;
+      padding: 2px 5px;
+      border-radius: 10px;
+    }
+  }
+
+  & + .list-wrap {
+    border-top: 1px solid rgba(242, 242, 242, 1);
+  }
+}
+</style>

+ 125 - 136
pages/maintenanceWorkorder/order/OrderTask.vue

@@ -1,37 +1,31 @@
 <template>
-  <view class="marginTop">
-    <view
-      class="list-wrap"
-      v-for="(item, index) in list"
-      :key="index"
-      v-show="list.length !== 0"
-      @click="goDetail(item)"
-    >
-      <view class="item">
-        <view class="s1">
-          <text class="title">{{ item.workOrderCode }}</text>
-        </view>
-        <view class="s2">
-          {{ item.createTime }}
-        </view>
-      </view>
-      <view class="item">
-        <view class="s1"> 设备名称:{{ item.equiName }} </view>
-      </view>
-      <view class="item">
-        <view class="s1"> 设备编码:{{ item.equiCode }} </view>
-      </view>
-      <view class="item">
-        <view class="s1"> 故障描述:{{ item.content }} </view>
-      </view>
-      <view class="item">
-        <view class="s1">
-          <view class="state">
-            {{ dict.status[item.status.code] }}
-          </view>
-        </view>
-      </view>
-      <!-- 			<view class="item">
+	<view class="marginTop">
+		<view class="list-wrap" v-for="(item, index) in list" :key="index" v-show="list.length !== 0" @click="goDetail(item)">
+			<view class="item">
+				<view class="s1">
+					<text class="title">{{ item.code }}</text>
+				</view>
+				<view class="s2">
+					{{ item.createTime }}
+				</view>
+			</view>
+			<view class="item">
+				<view class="s1">设备名称:{{ item.name }}</view>
+			</view>
+			<view class="item">
+				<view class="s1">设备编码:{{ item.planCode }}</view>
+			</view>
+			<view class="item">
+				<view class="s1">故障描述:{{ item.remark }}</view>
+			</view>
+			<view class="item">
+				<view class="s1">
+					<view class="state">
+						{{ dict.status[item.orderStatus] }}
+					</view>
+				</view>
+			</view>
+			<!-- 			<view class="item">
 				<view class="md">
 					{{item.workOrderCode}}
 				</view>
@@ -58,117 +52,112 @@
 					{{dict.status[item.status.code]}}
 				</view>
 			</view> -->
-    </view>
-    <view v-show="list.length === 0" class="no_data">
-      <u-empty mode="data"></u-empty>
-    </view>
-  </view>
+		</view>
+		<view v-show="list.length === 0" class="no_data">
+			<u-empty mode="data"></u-empty>
+		</view>
+	</view>
 </template>
 
 <script>
-export default {
-  props: {
-    type: {
-      type: [String, Number]
-    },
-    list: {
-      type: Array,
-      default: () => []
-    }
-  },
-  data () {
-    return {
-      dict: {
-        status: {
-          0: '待接收',
-          1: '执行中',
-          2: '待审核',
-          3: '完成',
-          4: '已撤回',
-          5: '待验收',
-          6: '已驳回',
-          7: '未修复',
-          8: '已派单'
-        },
-        //紧急程度
-        urgent: {
-          1: '普通',
-          2: '紧急',
-          3: '重要'
-        }
-      }
-    }
-  },
-  methods: {
-    goDetail (item) {
-      uni.navigateTo({
-        url: `/pages/maintain_service/detail/detail?id=${item.id}&workOrderCode=${item.workOrderCode}`
-      })
-    },
-    isClass () {
-      switch (String(this.type)) {
-        case '0':
-          return 'd1'
-          break
-        case '1':
-          return 'd2'
-          break
-        case '3':
-          return 'd3'
-          break
-        default:
-          break
-      }
-    }
-  }
-}
+	export default {
+		props: {
+			type: {
+				type: [String, Number]
+			},
+			list: {
+				type: Array,
+				default: () => []
+			}
+		},
+		data() {
+			return {
+				dict: {
+					status: {
+						0: '待接收',
+						2: '执行中',
+						3: '待验收',
+						4: '已验收'
+					},
+					//紧急程度
+					urgent: {
+						1: '普通',
+						2: '紧急',
+						3: '重要'
+					}
+				}
+			}
+		},
+		methods: {
+			goDetail(item) {
+				uni.navigateTo({
+					url: `/pages/maintenanceWorkorder/detail/detail?id=${item.id}&planId=${item.planId}&code=${item.code}&&orderType=1`
+				})
+			},
+			isClass() {
+				switch (String(this.type)) {
+					case '0':
+						return 'd1'
+						break
+					case '1':
+						return 'd2'
+						break
+					case '3':
+						return 'd3'
+						break
+					default:
+						break
+				}
+			}
+		}
+	}
 </script>
 
 <style lang="scss" scoped>
-.marginTop {
-  border-top: 20rpx solid $page-bg;
-}
+	.marginTop {
+		border-top: 20rpx solid $page-bg;
+	}
 
-.center {
-  text-align: center;
-  margin-bottom: 10rpx;
-  color: #999;
-}
+	.center {
+		text-align: center;
+		margin-bottom: 10rpx;
+		color: #999;
+	}
 
-.no_data {
-  position: fixed;
-  top: 50%;
-  left: 50%;
-  transform: translate(-50%, -50%);
-  color: #999;
-  font-size: 28rpx;
-}
+	.no_data {
+		position: fixed;
+		top: 50%;
+		left: 50%;
+		transform: translate(-50%, -50%);
+		color: #999;
+		font-size: 28rpx;
+	}
 
-.list-wrap {
-  padding: 10rpx;
-  .item {
-    display: flex;
-    justify-content: space-between;
-    padding: 10rpx;
-    color: rgb(170, 170, 170);
-    font-size: 28rpx;
-    word-break: break-all;
-    .title {
-      color: #333333;
-      font-size: 28rpx;
-    }
-    .state {
-      font-size: 12px;
-      color: #7f7f7f;
-      background: #f1f1f1;
-      display: inline;
-      padding: 2px 5px;
-      border-radius: 10px;
-    }
-  }
+	.list-wrap {
+		padding: 10rpx;
+		.item {
+			display: flex;
+			justify-content: space-between;
+			padding: 10rpx;
+			color: rgb(170, 170, 170);
+			font-size: 28rpx;
+			word-break: break-all;
+			.title {
+				color: #333333;
+				font-size: 28rpx;
+			}
+			.state {
+				font-size: 12px;
+				color: #7f7f7f;
+				background: #f1f1f1;
+				display: inline;
+				padding: 2px 5px;
+				border-radius: 10px;
+			}
+		}
 
-  & + .list-wrap {
-    border-top: 1px solid rgba(242, 242, 242, 1);
-  }
-}
+		& + .list-wrap {
+			border-top: 1px solid rgba(242, 242, 242, 1);
+		}
+	}
 </style>

+ 276 - 0
pages/maintenanceWorkorder/order/order copy.vue

@@ -0,0 +1,276 @@
+<template>
+  <view>
+    <uni-nav-bar
+      fixed="true"
+      statusBar="true"
+      left-icon="back"
+      title="维修工单"
+      @clickLeft="back"
+      right-icon="scan"
+      @clickRight="HandlScanCode"
+    ></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="index == 0" class="title-red">{{ item.number }}</text>
+          <text v-else class="title-num">({{ item.number }})</text>
+        </view>
+      </view>
+      <view class="tab-title__placeholder"></view>
+    </template>
+
+    <OrderTask
+      v-for="(item, index) in tabList"
+      :key="index"
+      v-show="index === pickTabIndex"
+      :list="item.list"
+      :type="tabList.value"
+    >
+    </OrderTask>
+  </view>
+</template>
+
+<script>
+import OrderTask from './OrderTask.vue'
+import { post, postJ } from '@/utils/api.js'
+let [page, size, isEnd] = [1, 10, true]
+export default {
+  components: {
+    OrderTask
+  },
+  data () {
+    return {
+      tabList: [
+        {
+          value: 0,
+          label: '待执行',
+          list: [],
+          number: 0
+        },
+        {
+          value: 1,
+          label: '执行中',
+          list: [],
+          number: 0
+        },
+        {
+          value: 2,
+          label: '已报工',
+          list: [],
+          number: 0
+        }
+      ],
+      pickTabIndex: 0,
+      qrContent: null,
+      barType: 0
+    }
+  },
+  onShow () {
+    this.getFirstList()
+    this.getStatus()
+    let _this = this
+    uni.$off('scancode') // 每次进来先 移除全局自定义事件监听器
+    uni.$on('scancode', function (data) {
+      _this.qrContent = data.code.trim()
+      let index = _this.qrContent.indexOf('@_@')
+      if (index == -1) {
+        _this.barType = 0
+      } else {
+        _this.barType = _this.qrContent.substring(index + 3, index + 4)
+      }
+      _this.getData()
+    })
+  },
+  onReachBottom: function () {
+    if (isEnd) {
+      return
+    }
+    // 显示加载图标
+    uni.showLoading({
+      title: '数据加载中'
+    })
+    this.getMoreLists()
+  },
+  methods: {
+    getStatus () {
+      postJ(this.apiUrl + `/workOrder/getWorkOrderTotal`, {
+        workOrderType: 3
+      }).then(res => {
+        let data = res.data
+        this.tabList[0].number = data.waitExecutionNum
+        this.tabList[1].number = data.executoryNum
+        this.tabList[2].number = data.finishNum
+      })
+    },
+    // 扫码
+    HandlScanCode () {
+      uni.navigateTo({
+        url: '/pages/ScanCode/ScanCode'
+      })
+    },
+    // 根据条码请求设备数据
+    getData () {
+      let par = {
+        barType: this.barType,
+        qrContent: this.qrContent
+      }
+      postJ(this.apiUrl + '/scan/getAssetInfo', par).then(res => {
+        let data = res.data
+        this.matchEquipment(data)
+      })
+    },
+    matchEquipment (data) {
+      let par = {
+        EquiCode: data.assetCode
+      }
+      console.log('par', par)
+      post(this.apiUrl + '/workOrder/getWorkOrderByEquiCode', par).then(res => {
+        let data = res.data
+        if (!data) {
+          uni.showModal({
+            title: '提示',
+            content: '该设备无维修工单记录!',
+            confirmText: '好的', //这块是确定按钮的文字
+            showCancel: false,
+            success: function (res) {
+              if (res.confirm) {
+                // 执行确认后的操作
+              } else {
+                // 执行取消后的操作
+              }
+            }
+          })
+        } else {
+          uni.navigateTo({
+            url: `/pages/maintain_service/detail/detail?workOrderCode=${data}`
+          })
+        }
+      })
+    },
+    getFirstList: function () {
+      page = 1
+      isEnd = true
+      uni.showLoading({
+        title: '数据加载中'
+      })
+      this.getList()
+    },
+    getMoreLists: function () {
+      //获取更多数据
+      page++
+      this.getList()
+    },
+    getList () {
+      uni.showLoading({
+        title: '加载中'
+      })
+      let data = {
+        page,
+        size
+      }
+      let searchStatus = this.tabList[this.pickTabIndex].value
+      let par = this.URLSearchParams(data)
+      //2 - 99 [已完成]
+      postJ(this.apiUrl + '/repair/info/getWorkOrderList?' + par, {
+        searchStatus,
+        workOrderType: 3,
+        page,
+        size
+      })
+        .then(res => {
+          let data = res.data.records
+          let pageTotal = res.data.pages
+          if (page === 1) {
+            this.tabList[this.pickTabIndex].list = res.data.records
+          } else {
+            data.forEach(element => {
+              this.tabList[this.pickTabIndex].list.push(element)
+            })
+          }
+          page < pageTotal ? (isEnd = false) : (isEnd = true)
+        })
+        .then(() => {
+          uni.hideLoading()
+        })
+    },
+    changeChartsTab (index) {
+      this.pickTabIndex = index
+      this.getFirstList()
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+.tab-title {
+  position: fixed;
+  z-index: 99;
+  width: 100%;
+  padding: 0 30rpx 10rpx;
+  // display: flex;
+  // justify-content: space-between;
+  height: $tab-height;
+  line-height: $tab-height;
+  background-color: #ffffff;
+  border-bottom: 1px solid #f2f2f2;
+  // box-sizing: border-box;
+  white-space: nowrap;
+  overflow: auto hidden;
+
+  &::-webkit-scrollbar {
+    /*滚动条整体样式*/
+    width: 10px;
+    /*高宽分别对应横竖滚动条的尺寸*/
+    height: 1px;
+  }
+
+  &::-webkit-scrollbar-thumb {
+    /*滚动条里面小方块*/
+    border-radius: 10px;
+    -webkit-box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
+    background: #535353;
+  }
+
+  &::-webkit-scrollbar-track {
+    /*滚动条里面轨道*/
+    -webkit-box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
+    border-radius: 10px;
+    background: #ededed;
+  }
+
+  .tab-item {
+    width: 30%;
+    text-align: center;
+    display: inline-block;
+    font-size: 32rpx;
+    color: $uni-text-color-grey;
+  }
+
+  .tab-item.active {
+    color: $j-primary-border-green;
+    border-bottom: 1px solid $j-primary-border-green;
+  }
+  .title-num {
+    font-size: 26rpx;
+  }
+  .title-red {
+    display: inline-block;
+    font-size: 22rpx;
+    padding: 0 10rpx;
+    border-radius: 50rpx;
+    color: #ffffff;
+    background: red;
+    line-height: 38rpx;
+    position: absolute;
+    top: 10rpx;
+    min-width: 18rpx;
+  }
+}
+</style>

+ 197 - 262
pages/maintenanceWorkorder/order/order.vue

@@ -1,276 +1,211 @@
 <template>
-  <view>
-    <uni-nav-bar
-      fixed="true"
-      statusBar="true"
-      left-icon="back"
-      title="维修工单"
-      @clickLeft="back"
-      right-icon="scan"
-      @clickRight="HandlScanCode"
-    ></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="index == 0" class="title-red">{{ item.number }}</text>
-          <text v-else class="title-num">({{ item.number }})</text>
-        </view>
-      </view>
-      <view class="tab-title__placeholder"></view>
-    </template>
+	<view>
+		<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>
 
-    <OrderTask
-      v-for="(item, index) in tabList"
-      :key="index"
-      v-show="index === pickTabIndex"
-      :list="item.list"
-      :type="tabList.value"
-    >
-    </OrderTask>
-  </view>
+		<OrderTask v-for="(item, index) in tabList" :key="index" v-show="index === pickTabIndex" :list="item.list" :type="tabList.value"></OrderTask>
+	</view>
 </template>
 
 <script>
-import OrderTask from './OrderTask.vue'
-import { post, postJ } from '@/utils/api.js'
-let [page, size, isEnd] = [1, 10, true]
-export default {
-  components: {
-    OrderTask
-  },
-  data () {
-    return {
-      tabList: [
-        {
-          value: 0,
-          label: '待执行',
-          list: [],
-          number: 0
-        },
-        {
-          value: 1,
-          label: '执行中',
-          list: [],
-          number: 0
-        },
-        {
-          value: 2,
-          label: '已报工',
-          list: [],
-          number: 0
-        }
-      ],
-      pickTabIndex: 0,
-      qrContent: null,
-      barType: 0
-    }
-  },
-  onShow () {
-    this.getFirstList()
-    this.getStatus()
-    let _this = this
-    uni.$off('scancode') // 每次进来先 移除全局自定义事件监听器
-    uni.$on('scancode', function (data) {
-      _this.qrContent = data.code.trim()
-      let index = _this.qrContent.indexOf('@_@')
-      if (index == -1) {
-        _this.barType = 0
-      } else {
-        _this.barType = _this.qrContent.substring(index + 3, index + 4)
-      }
-      _this.getData()
-    })
-  },
-  onReachBottom: function () {
-    if (isEnd) {
-      return
-    }
-    // 显示加载图标
-    uni.showLoading({
-      title: '数据加载中'
-    })
-    this.getMoreLists()
-  },
-  methods: {
-    getStatus () {
-      postJ(this.apiUrl + `/workOrder/getWorkOrderTotal`, {
-        workOrderType: 3
-      }).then(res => {
-        let data = res.data
-        this.tabList[0].number = data.waitExecutionNum
-        this.tabList[1].number = data.executoryNum
-        this.tabList[2].number = data.finishNum
-      })
-    },
-    // 扫码
-    HandlScanCode () {
-      uni.navigateTo({
-        url: '/pages/ScanCode/ScanCode'
-      })
-    },
-    // 根据条码请求设备数据
-    getData () {
-      let par = {
-        barType: this.barType,
-        qrContent: this.qrContent
-      }
-      postJ(this.apiUrl + '/scan/getAssetInfo', par).then(res => {
-        let data = res.data
-        this.matchEquipment(data)
-      })
-    },
-    matchEquipment (data) {
-      let par = {
-        EquiCode: data.assetCode
-      }
-      console.log('par', par)
-      post(this.apiUrl + '/workOrder/getWorkOrderByEquiCode', par).then(res => {
-        let data = res.data
-        if (!data) {
-          uni.showModal({
-            title: '提示',
-            content: '该设备无维修工单记录!',
-            confirmText: '好的', //这块是确定按钮的文字
-            showCancel: false,
-            success: function (res) {
-              if (res.confirm) {
-                // 执行确认后的操作
-              } else {
-                // 执行取消后的操作
-              }
-            }
-          })
-        } else {
-          uni.navigateTo({
-            url: `/pages/maintain_service/detail/detail?workOrderCode=${data}`
-          })
-        }
-      })
-    },
-    getFirstList: function () {
-      page = 1
-      isEnd = true
-      uni.showLoading({
-        title: '数据加载中'
-      })
-      this.getList()
-    },
-    getMoreLists: function () {
-      //获取更多数据
-      page++
-      this.getList()
-    },
-    getList () {
-      uni.showLoading({
-        title: '加载中'
-      })
-      let data = {
-        page,
-        size
-      }
-      let searchStatus = this.tabList[this.pickTabIndex].value
-      let par = this.URLSearchParams(data)
-      //2 - 99 [已完成]
-      postJ(this.apiUrl + '/repair/info/getWorkOrderList?' + par, {
-        searchStatus,
-        workOrderType: 3,
-        page,
-        size
-      })
-        .then(res => {
-          let data = res.data.records
-          let pageTotal = res.data.pages
-          if (page === 1) {
-            this.tabList[this.pickTabIndex].list = res.data.records
-          } else {
-            data.forEach(element => {
-              this.tabList[this.pickTabIndex].list.push(element)
-            })
-          }
-          page < pageTotal ? (isEnd = false) : (isEnd = true)
-        })
-        .then(() => {
-          uni.hideLoading()
-        })
-    },
-    changeChartsTab (index) {
-      this.pickTabIndex = index
-      this.getFirstList()
-    }
-  }
-}
+	import { getWorkOrderList } from '@/api/myTicket'
+	import OrderTask from './OrderTask.vue'
+	import { post, postJ } from '@/utils/api.js'
+	let [page, size, isEnd] = [1, 10, true]
+	export default {
+		components: {
+			OrderTask
+		},
+		data() {
+			return {
+				tabList: [
+					{
+						value: 0,
+						label: '待接收',
+						list: [],
+						number: 0
+					},
+					{
+						value: 2,
+						label: '执行中',
+						list: [],
+						number: 0
+					},
+					{
+						value: 3,
+						label: '待验收',
+						list: [],
+						number: 0
+					},
+					{
+						value: 4,
+						label: '已验收',
+						list: [],
+						number: 0
+					}
+				],
+				pickTabIndex: 0,
+				qrContent: null,
+				barType: 0
+			}
+		},
+		onShow() {
+			this.getFirstList()
+			this.getStatus()
+		},
+		onReachBottom: function () {
+			if (isEnd) {
+				return
+			}
+			// 显示加载图标
+			uni.showLoading({
+				title: '数据加载中'
+			})
+			this.getMoreLists()
+		},
+		methods: {
+			getStatus() {
+				getWorkOrderList({ orderStatus: [0], type: 3, pageNum: 1, size: 1 }).then(res => {
+					this.tabList[0].number = res.count
+				})
+				getWorkOrderList({ orderStatus: [2], type: 3, pageNum: 1, size: 1 }).then(res => {
+					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
+				})
+			},
+			getCount() {
+				statistics().then(data => {
+					console.log('onsole.log(data)-----------')
+					console.log(data)
+					this.tabList = this.tabList.map(item => {
+						switch (item.value) {
+							case '0':
+								return { ...item, badge: { value: data.maintenanceNum } }
+							case '2':
+								return { ...item, badge: { value: data.patrolInspection } }
+							case '3':
+								return { ...item, badge: { value: data.quantityNum } }
+							case '4':
+								return { ...item, badge: { value: data.repairsNum } }
+						}
+					})
+				})
+			},
+			getFirstList: function () {
+				page = 1
+				isEnd = true
+				this.getList()
+			},
+			getMoreLists: function () {
+				//获取更多数据
+				page++
+				this.getList()
+			},
+			getList() {
+				uni.showLoading({
+					title: '数据加载中'
+				})
+				let params = {
+					orderStatus: [this.tabList[this.pickTabIndex].value],
+					type: 3,
+					pageNum: page,
+					size
+				}
+				getWorkOrderList(params)
+					.then(res => {
+						this.tabList[this.pickTabIndex].list = res.list
+						isEnd = this.tabList[this.pickTabIndex].list >= res.count
+						uni.hideLoading()
+					})
+					.catch(() => {
+						uni.hideLoading()
+					})
+			},
+			changeChartsTab(index) {
+				this.pickTabIndex = index
+				this.getFirstList()
+			}
+		}
+	}
 </script>
 
 <style lang="scss" scoped>
-.tab-title {
-  position: fixed;
-  z-index: 99;
-  width: 100%;
-  padding: 0 30rpx 10rpx;
-  // display: flex;
-  // justify-content: space-between;
-  height: $tab-height;
-  line-height: $tab-height;
-  background-color: #ffffff;
-  border-bottom: 1px solid #f2f2f2;
-  // box-sizing: border-box;
-  white-space: nowrap;
-  overflow: auto hidden;
+	.tab-title {
+		position: fixed;
+		z-index: 99;
+		width: 100%;
+		padding: 10rpx;
+		// display: flex;
+		// justify-content: space-between;
+		height: $tab-height;
+		line-height: $tab-height;
+		background-color: #ffffff;
+		border-bottom: 1px solid #f2f2f2;
+		// box-sizing: border-box;
+		white-space: nowrap;
+		overflow: auto hidden;
+		display: flex;
 
-  &::-webkit-scrollbar {
-    /*滚动条整体样式*/
-    width: 10px;
-    /*高宽分别对应横竖滚动条的尺寸*/
-    height: 1px;
-  }
+		&::-webkit-scrollbar {
+			/*滚动条整体样式*/
+			width: 10px;
+			/*高宽分别对应横竖滚动条的尺寸*/
+			height: 1px;
+		}
 
-  &::-webkit-scrollbar-thumb {
-    /*滚动条里面小方块*/
-    border-radius: 10px;
-    -webkit-box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
-    background: #535353;
-  }
+		&::-webkit-scrollbar-thumb {
+			/*滚动条里面小方块*/
+			border-radius: 10px;
+			-webkit-box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
+			background: #535353;
+		}
 
-  &::-webkit-scrollbar-track {
-    /*滚动条里面轨道*/
-    -webkit-box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
-    border-radius: 10px;
-    background: #ededed;
-  }
+		&::-webkit-scrollbar-track {
+			/*滚动条里面轨道*/
+			-webkit-box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
+			border-radius: 10px;
+			background: #ededed;
+		}
 
-  .tab-item {
-    width: 30%;
-    text-align: center;
-    display: inline-block;
-    font-size: 32rpx;
-    color: $uni-text-color-grey;
-  }
+		.tab-item {
+			flex: 1;
+			text-align: center;
+			display: inline-block;
+			font-size: 32rpx;
+			color: $uni-text-color-grey;
+		}
 
-  .tab-item.active {
-    color: $j-primary-border-green;
-    border-bottom: 1px solid $j-primary-border-green;
-  }
-  .title-num {
-    font-size: 26rpx;
-  }
-  .title-red {
-    display: inline-block;
-    font-size: 22rpx;
-    padding: 0 10rpx;
-    border-radius: 50rpx;
-    color: #ffffff;
-    background: red;
-    line-height: 38rpx;
-    position: absolute;
-    top: 10rpx;
-    min-width: 18rpx;
-  }
-}
+		.tab-item.active {
+			color: $j-primary-border-green;
+			border-bottom: 1px solid $j-primary-border-green;
+		}
+		.title-num {
+			font-size: 26rpx;
+		}
+		.title-red {
+			display: inline-block;
+			font-size: 22rpx;
+			padding: 0 10rpx;
+			border-radius: 50rpx;
+			color: #ffffff;
+			background: red;
+			line-height: 38rpx;
+			position: absolute;
+			top: 10rpx;
+			min-width: 18rpx;
+		}
+	}
 </style>

+ 42 - 3
pages/repair/repair/selectEquipment.vue

@@ -1,11 +1,16 @@
 <template>
 	<view class="content-box">
-		<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">
+			<!-- <template slot="right">
+				<u-button type="success" size="small" class="u-reset-button" @click="openTreePicker" text="选择分类"></u-button>
+			</template> -->
+		</uni-nav-bar>
 
 		<view class="top-wrapper">
 			<view class="searchBox rx-bc">
 				<input v-model="keyWord" placeholder="请输入固资编码或名称" class="searchInput" />
 				<view class="rx-sc">
+					<u-button type="success" size="small" class="u-reset-button margin_10" @click="openTreePicker" text="选择分类"></u-button>
 					<u-button @click="doSearch" type="success" size="small" class="u-reset-button" text="搜索"></u-button>
 				</view>
 			</view>
@@ -72,10 +77,22 @@
 				</u-button> -->
 			</view>
 		</view>
+		<ba-tree-picker
+			ref="treePicker"
+			key="verify"
+			:selectedData="selectedData"
+			:multiple="false"
+			@select-change="confirm"
+			title="选择分类"
+			:localdata="classificationList"
+			valueKey="id"
+			textKey="name"
+			childrenKey="children" />
 	</view>
 </template>
 
 <script>
+	import { treeByPid } from '@/api/pda/workOrder.js'
 	import { getPageList } from '@/api/repair'
 	import Equipment from '../../home/pages/equipment/equipment.vue'
 	export default {
@@ -86,13 +103,32 @@
 				checkListLen: 0,
 				list: [],
 				keyWord: '',
-				equipmentValue: ''
+				equipmentValue: '',
+				rootCategoryLevelId: 4,
+				categoryLevelId: 4,
+				selectedData: ['4']
 			}
 		},
 		onLoad() {
 			this.getPageListById()
+			this.getTreeList()
 		},
 		methods: {
+			getTreeList() {
+				treeByPid({ ids: [4, 14] }).then(res => {
+					this.classificationList = res
+					this.confirm([res[0].id], res[0].name, res[0].rootCategoryLevelId)
+				})
+			},
+			confirm(id, name, rootCategoryLevelId) {
+				this.rootCategoryLevelId = rootCategoryLevelId
+				this.categoryLevelId = id
+				this.list = []
+				this.getPageListById()
+			},
+			openTreePicker() {
+				this.$refs.treePicker._show()
+			},
 			doSearch() {
 				this.equipmentValue = ''
 				this.pageNum = 1
@@ -114,7 +150,7 @@
 					title: '加载中'
 				})
 				this.isEnd = false
-				getPageList({ pageNum: this.pageNum, size: 10, categoryLevelId: 4, rootCategoryLevelId: 4, argument: this.keyWord }).then(data => {
+				getPageList({ pageNum: this.pageNum, size: 10, categoryLevelId: this.categoryLevelId, rootCategoryLevelId: this.rootCategoryLevelId, argument: this.keyWord }).then(data => {
 					this.list = this.list.concat(data.list)
 					this.total = data.count
 					if (this.list.length >= this.total) {
@@ -154,6 +190,9 @@
 			padding-left: 10rpx;
 			border-radius: 5rpx;
 		}
+		.margin_10 {
+			margin: 0 20rpx;
+		}
 	}
 
 	.list_box {

+ 107 - 0
pages/tour_tally/order/OrderTask copy.vue

@@ -0,0 +1,107 @@
+<template>
+  <view class="marginTop">
+    <view
+      v-for="(item, index) in list"
+      class="kd-row"
+      :key="item.id"
+      @click="goDetail(item)"
+      v-show="list.length !== 0"
+    >
+      <!-- 进度组件 -->
+      <view class="kd-col">
+        <text class="title">{{ item.workOrderCode }}</text>
+        <text>{{ item.planName }}</text>
+      </view>
+      <view class="kd-col">
+        <text>规则名称:{{ item.ruleName }}</text>
+        <text>{{ item.equiTypeName }}</text>
+      </view>
+      <view class="kd-col">
+        <text
+          class="status"
+          :class="statusList[item.status && item.status.code]"
+          >{{ item.status && item.status.descp }}</text
+        >
+        <text class="text-danger">截止时间 {{ item.planFinishTime }}</text>
+      </view>
+    </view>
+    <view v-show="list.length === 0" class="no_data">
+      <u-empty mode="data" textSize="22"></u-empty>
+    </view>
+  </view>
+</template>
+
+<script>
+import CellTip from '@/components/CellTip.vue'
+export default {
+  components: {
+    CellTip
+  },
+  props: {
+    list: {
+      type: Array,
+      default: () => []
+    }
+  },
+  data () {
+    return {
+      statusList: {
+        0: 'text-primary',
+        1: '',
+        2: 'text-primary'
+      }
+    }
+  },
+  methods: {
+    goDetail ({ workOrderCode, id }) {
+      uni.navigateTo({
+        url: `../detail/detail?workOrderCode=${workOrderCode}&id=${id}`
+      })
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+.marginTop {
+  border-top: 20rpx solid $page-bg;
+
+  .kd-row {
+    font-size: 28rpx;
+    padding: 14rpx 12rpx 6rpx;
+    border-bottom: 1rpx solid $page-bg;
+    .kd-col {
+      display: flex;
+      justify-content: space-between;
+      align-items: center;
+      padding: 2rpx;
+      color: #aaaaaa;
+
+      .status {
+        background-color: $page-bg;
+        display: inline-block;
+        padding: 4rpx 10rpx;
+        border-radius: 18rpx;
+      }
+    }
+    .title {
+      font-weight: bold;
+      color: #333333;
+    }
+  }
+
+  .center {
+    text-align: center;
+    margin-bottom: 10rpx;
+    color: #999;
+  }
+  .no_data {
+    position: fixed;
+    top: 50%;
+    left: 50%;
+    transform: translate(-50%, -50%);
+    color: #999;
+    font-size: 28rpx;
+  }
+}
+</style>

+ 124 - 96
pages/tour_tally/order/OrderTask.vue

@@ -1,107 +1,135 @@
 <template>
-  <view class="marginTop">
-    <view
-      v-for="(item, index) in list"
-      class="kd-row"
-      :key="item.id"
-      @click="goDetail(item)"
-      v-show="list.length !== 0"
-    >
-      <!-- 进度组件 -->
-      <view class="kd-col">
-        <text class="title">{{ item.workOrderCode }}</text>
-        <text>{{ item.planName }}</text>
-      </view>
-      <view class="kd-col">
-        <text>规则名称:{{ item.ruleName }}</text>
-        <text>{{ item.equiTypeName }}</text>
-      </view>
-      <view class="kd-col">
-        <text
-          class="status"
-          :class="statusList[item.status && item.status.code]"
-          >{{ item.status && item.status.descp }}</text
-        >
-        <text class="text-danger">截止时间 {{ item.planFinishTime }}</text>
-      </view>
-    </view>
-    <view v-show="list.length === 0" class="no_data">
-      <u-empty mode="data" textSize="22"></u-empty>
-    </view>
-  </view>
+	<view class="marginTop">
+		<view class="list-wrap" v-for="(item, index) in list" :key="index" v-show="list.length !== 0" @click="goDetail(item)">
+			<view class="item">
+				<view class="s1">
+					<text class="title">{{ item.code }}</text>
+				</view>
+				<!-- <view class="s2">
+					{{ item.createTime }}
+				</view> -->
+			</view>
+			<view class="item">
+				<view class="s1">设备名称:{{ item.deviceName }}</view>
+			</view>
+			<view class="item">
+				<view class="s1">规则名称:{{ item.ruleName }}</view>
+			</view>
+			<view class="item">
+				<view class="s1">截止时间:{{ item.planFinishTime }}</view>
+			</view>
+			<view class="item">
+				<view class="s1">
+					<view class="state">
+						{{ dict.status[item.orderStatus] }}
+					</view>
+				</view>
+			</view>
+		</view>
+		<view v-show="list.length === 0" class="no_data">
+			<u-empty mode="data"></u-empty>
+		</view>
+	</view>
 </template>
 
 <script>
-import CellTip from '@/components/CellTip.vue'
-export default {
-  components: {
-    CellTip
-  },
-  props: {
-    list: {
-      type: Array,
-      default: () => []
-    }
-  },
-  data () {
-    return {
-      statusList: {
-        0: 'text-primary',
-        1: '',
-        2: 'text-primary'
-      }
-    }
-  },
-  methods: {
-    goDetail ({ workOrderCode, id }) {
-      uni.navigateTo({
-        url: `../detail/detail?workOrderCode=${workOrderCode}&id=${id}`
-      })
-    }
-  }
-}
+	export default {
+		props: {
+			type: {
+				type: [String, Number]
+			},
+			list: {
+				type: Array,
+				default: () => []
+			}
+		},
+		data() {
+			return {
+				dict: {
+					status: {
+						0: '待接收',
+						2: '执行中',
+						3: '已完成'
+					},
+					//紧急程度
+					urgent: {
+						1: '普通',
+						2: '紧急',
+						3: '重要'
+					}
+				}
+			}
+		},
+		methods: {
+			goDetail(item) {
+				uni.navigateTo({
+					url: `/pages/tour_tally/detail/detail?id=${item.id}&planId=${item.planId}&code=${item.code}&&orderType=1`
+				})
+			},
+			isClass() {
+				switch (String(this.type)) {
+					case '0':
+						return 'd1'
+						break
+					case '1':
+						return 'd2'
+						break
+					case '3':
+						return 'd3'
+						break
+					default:
+						break
+				}
+			}
+		}
+	}
 </script>
 
 <style lang="scss" scoped>
-.marginTop {
-  border-top: 20rpx solid $page-bg;
+	.marginTop {
+		border-top: 20rpx solid $page-bg;
+	}
 
-  .kd-row {
-    font-size: 28rpx;
-    padding: 14rpx 12rpx 6rpx;
-    border-bottom: 1rpx solid $page-bg;
-    .kd-col {
-      display: flex;
-      justify-content: space-between;
-      align-items: center;
-      padding: 2rpx;
-      color: #aaaaaa;
+	.center {
+		text-align: center;
+		margin-bottom: 10rpx;
+		color: #999;
+	}
 
-      .status {
-        background-color: $page-bg;
-        display: inline-block;
-        padding: 4rpx 10rpx;
-        border-radius: 18rpx;
-      }
-    }
-    .title {
-      font-weight: bold;
-      color: #333333;
-    }
-  }
+	.no_data {
+		position: fixed;
+		top: 50%;
+		left: 50%;
+		transform: translate(-50%, -50%);
+		color: #999;
+		font-size: 28rpx;
+	}
 
-  .center {
-    text-align: center;
-    margin-bottom: 10rpx;
-    color: #999;
-  }
-  .no_data {
-    position: fixed;
-    top: 50%;
-    left: 50%;
-    transform: translate(-50%, -50%);
-    color: #999;
-    font-size: 28rpx;
-  }
-}
+	.list-wrap {
+		padding: 10rpx;
+		.item {
+			display: flex;
+			justify-content: space-between;
+			padding: 10rpx;
+			color: rgb(170, 170, 170);
+			font-size: 28rpx;
+			word-break: break-all;
+			.title {
+				color: #333333;
+				font-size: 28rpx;
+			}
+			.state {
+				font-size: 12px;
+				color: #7f7f7f;
+				background: #f1f1f1;
+				display: inline;
+				padding: 2px 5px;
+				border-radius: 10px;
+			}
+		}
+
+		& + .list-wrap {
+			border-top: 1px solid rgba(242, 242, 242, 1);
+		}
+	}
 </style>

+ 186 - 0
pages/tour_tally/order/order copy.vue

@@ -0,0 +1,186 @@
+<template>
+  <view>
+    <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="index == 0" class="title-red">{{ item.number }}</text>
+          <text v-else class="title-num">({{ item.number }})</text>
+        </view>
+      </view>
+      <view class="tab-title__placeholder"></view>
+    </template>
+
+    <OrderTask
+      v-for="(item, index) in tabList"
+      :key="index"
+      v-show="index === pickTabIndex"
+      :list="pageList"
+    ></OrderTask>
+  </view>
+</template>
+
+<script>
+import OrderTask from './OrderTask.vue'
+import OrderSpare from './OrderSpare.vue'
+import { post, get, postJ } from '@/utils/api.js'
+let [page, size, isEnd] = [1, 10, false]
+export default {
+  components: {
+    OrderTask,
+    OrderSpare
+  },
+  data () {
+    return {
+      tabList: [
+        {
+          value: 0,
+          label: '待接收',
+          list: [],
+          number: 0
+        },
+        {
+          value: 1,
+          label: '执行中',
+          list: [],
+          number: 0
+        },
+        {
+          value: 3,
+          label: '已完成',
+          list: [],
+          number: 0
+        }
+      ],
+      pageList: [],
+      pickTabIndex: 0
+    }
+  },
+  onLoad () {
+    // this.getList()
+  },
+  onShow () {
+    this.getFirstList()
+    this.getStatus()
+  },
+  onReachBottom: function () {
+    if (isEnd) {
+      return
+    }
+
+    // 显示加载图标
+    uni.showLoading({
+      title: '数据加载中'
+    })
+    this.getMoreLists()
+  },
+  methods: {
+    getStatus () {
+      postJ(this.apiUrl + `/workOrder/getWorkOrderTotal`, {
+        workOrderType: 1
+      }).then(res => {
+        let data = res.data
+        this.tabList[0].number = data.waitExecutionNum
+        this.tabList[1].number = data.executoryNum
+        this.tabList[2].number = data.finishNum
+      })
+    },
+
+    getFirstList: function () {
+      page = 1
+      isEnd = true
+      this.getList()
+    },
+    getMoreLists: function () {
+      //获取更多数据
+      page++
+      this.getList()
+    },
+    //获取列表数据
+    getList () {
+      const pickTabIndex = this.pickTabIndex
+      let status = this.tabList[pickTabIndex].value
+      // http://localhost:9527/api/feature/patrol/sheetwork/list
+      // post(this.apiUrl + "/patrol/order/getMeList?status=" + status, data).then(res => {
+      post(
+        this.apiUrl +
+          `/workOrder/getWorkOrderListApp?page=${page}&size=${size}`,
+        { status, workOrderType: 1 },
+        true
+      ).then(res => {
+        let data = res.data.records
+        if (page === 1) {
+          this.pageList = res.data.records
+        } else {
+          this.pageList.push(...data)
+        }
+        isEnd = this.pageList.length >= res.data.total
+        // page < pageTotal ? (isEnd = false) : (isEnd = true);
+      })
+    },
+    //切换选项卡
+    changeChartsTab (index) {
+      this.pickTabIndex = index
+      uni.pageScrollTo({
+        scrollTo: 0
+      })
+      this.getFirstList()
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+.tab-title {
+  position: fixed;
+  z-index: 9;
+  width: 100%;
+  padding: 0 30rpx;
+  display: flex;
+  justify-content: space-between;
+  height: $tab-height;
+  line-height: $tab-height;
+  background-color: #ffffff;
+  border-bottom: 1px solid #f2f2f2;
+  box-sizing: border-box;
+  .tab-item {
+    width: 30%;
+    text-align: center;
+    font-size: 32rpx;
+    color: $uni-text-color-grey;
+  }
+
+  .tab-item.active {
+    color: $j-primary-border-green;
+    border-bottom: 1px solid $j-primary-border-green;
+  }
+  .title-num {
+    font-size: 26rpx;
+  }
+  .title-red {
+    display: inline-block;
+    font-size: 22rpx;
+    padding: 0 10rpx;
+    border-radius: 50rpx;
+    color: #ffffff;
+    background: red;
+    line-height: 38rpx;
+    position: absolute;
+    top: 10rpx;
+    min-width: 18rpx;
+  }
+}
+</style>

+ 195 - 176
pages/tour_tally/order/order.vue

@@ -1,186 +1,205 @@
 <template>
-  <view>
-    <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="index == 0" class="title-red">{{ item.number }}</text>
-          <text v-else class="title-num">({{ item.number }})</text>
-        </view>
-      </view>
-      <view class="tab-title__placeholder"></view>
-    </template>
+	<view>
+		<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>
 
-    <OrderTask
-      v-for="(item, index) in tabList"
-      :key="index"
-      v-show="index === pickTabIndex"
-      :list="pageList"
-    ></OrderTask>
-  </view>
+		<OrderTask v-for="(item, index) in tabList" :key="index" v-show="index === pickTabIndex" :list="item.list" :type="tabList.value"></OrderTask>
+	</view>
 </template>
 
 <script>
-import OrderTask from './OrderTask.vue'
-import OrderSpare from './OrderSpare.vue'
-import { post, get, postJ } from '@/utils/api.js'
-let [page, size, isEnd] = [1, 10, false]
-export default {
-  components: {
-    OrderTask,
-    OrderSpare
-  },
-  data () {
-    return {
-      tabList: [
-        {
-          value: 0,
-          label: '待接收',
-          list: [],
-          number: 0
-        },
-        {
-          value: 1,
-          label: '执行中',
-          list: [],
-          number: 0
-        },
-        {
-          value: 3,
-          label: '已完成',
-          list: [],
-          number: 0
-        }
-      ],
-      pageList: [],
-      pickTabIndex: 0
-    }
-  },
-  onLoad () {
-    // this.getList()
-  },
-  onShow () {
-    this.getFirstList()
-    this.getStatus()
-  },
-  onReachBottom: function () {
-    if (isEnd) {
-      return
-    }
-
-    // 显示加载图标
-    uni.showLoading({
-      title: '数据加载中'
-    })
-    this.getMoreLists()
-  },
-  methods: {
-    getStatus () {
-      postJ(this.apiUrl + `/workOrder/getWorkOrderTotal`, {
-        workOrderType: 1
-      }).then(res => {
-        let data = res.data
-        this.tabList[0].number = data.waitExecutionNum
-        this.tabList[1].number = data.executoryNum
-        this.tabList[2].number = data.finishNum
-      })
-    },
-
-    getFirstList: function () {
-      page = 1
-      isEnd = true
-      this.getList()
-    },
-    getMoreLists: function () {
-      //获取更多数据
-      page++
-      this.getList()
-    },
-    //获取列表数据
-    getList () {
-      const pickTabIndex = this.pickTabIndex
-      let status = this.tabList[pickTabIndex].value
-      // http://localhost:9527/api/feature/patrol/sheetwork/list
-      // post(this.apiUrl + "/patrol/order/getMeList?status=" + status, data).then(res => {
-      post(
-        this.apiUrl +
-          `/workOrder/getWorkOrderListApp?page=${page}&size=${size}`,
-        { status, workOrderType: 1 },
-        true
-      ).then(res => {
-        let data = res.data.records
-        if (page === 1) {
-          this.pageList = res.data.records
-        } else {
-          this.pageList.push(...data)
-        }
-        isEnd = this.pageList.length >= res.data.total
-        // page < pageTotal ? (isEnd = false) : (isEnd = true);
-      })
-    },
-    //切换选项卡
-    changeChartsTab (index) {
-      this.pickTabIndex = index
-      uni.pageScrollTo({
-        scrollTo: 0
-      })
-      this.getFirstList()
-    }
-  }
-}
+	import { getWorkOrderList } from '@/api/myTicket'
+	import OrderTask from './OrderTask.vue'
+	import { post, postJ } from '@/utils/api.js'
+	let [page, size, isEnd] = [1, 10, true]
+	export default {
+		components: {
+			OrderTask
+		},
+		data() {
+			return {
+				tabList: [
+					{
+						value: 0,
+						label: '待接收',
+						list: [],
+						number: 0
+					},
+					{
+						value: 2,
+						label: '执行中',
+						list: [],
+						number: 0
+					},
+					{
+						value: 3,
+						label: '已完成',
+						list: [],
+						number: 0
+					}
+				],
+				pickTabIndex: 0,
+				qrContent: null,
+				barType: 0
+			}
+		},
+		onShow() {
+			this.getFirstList()
+			this.getStatus()
+		},
+		onReachBottom: function () {
+			if (isEnd) {
+				return
+			}
+			// 显示加载图标
+			uni.showLoading({
+				title: '数据加载中'
+			})
+			this.getMoreLists()
+		},
+		methods: {
+			getStatus() {
+				getWorkOrderList({ orderStatus: [0], type: 1, pageNum: 1, size: 1 }).then(res => {
+					this.tabList[0].number = res.count
+				})
+				getWorkOrderList({ orderStatus: [2], type: 1, pageNum: 1, size: 1 }).then(res => {
+					this.tabList[1].number = res.count
+				})
+				getWorkOrderList({ orderStatus: [3], type: 1, pageNum: 1, size: 1 }).then(res => {
+					this.tabList[2].number = res.count
+				})
+				getWorkOrderList({ orderStatus: [4], type: 1, pageNum: 1, size: 1 }).then(res => {
+					this.tabList[3].number = res.count
+				})
+			},
+			getCount() {
+				statistics().then(data => {
+					console.log('onsole.log(data)-----------')
+					console.log(data)
+					this.tabList = this.tabList.map(item => {
+						switch (item.value) {
+							case '0':
+								return { ...item, badge: { value: data.maintenanceNum } }
+							case '2':
+								return { ...item, badge: { value: data.patrolInspection } }
+							case '3':
+								return { ...item, badge: { value: data.quantityNum } }
+							case '4':
+								return { ...item, badge: { value: data.repairsNum } }
+						}
+					})
+				})
+			},
+			getFirstList: function () {
+				page = 1
+				isEnd = true
+				this.getList()
+			},
+			getMoreLists: function () {
+				//获取更多数据
+				page++
+				this.getList()
+			},
+			getList() {
+				uni.showLoading({
+					title: '数据加载中'
+				})
+				let params = {
+					orderStatus: [this.tabList[this.pickTabIndex].value],
+					type: 1,
+					pageNum: page,
+					size
+				}
+				getWorkOrderList(params)
+					.then(res => {
+						this.tabList[this.pickTabIndex].list = res.list
+						isEnd = this.tabList[this.pickTabIndex].list >= res.count
+						uni.hideLoading()
+					})
+					.catch(() => {
+						uni.hideLoading()
+					})
+			},
+			changeChartsTab(index) {
+				this.pickTabIndex = index
+				this.getFirstList()
+			}
+		}
+	}
 </script>
 
 <style lang="scss" scoped>
-.tab-title {
-  position: fixed;
-  z-index: 9;
-  width: 100%;
-  padding: 0 30rpx;
-  display: flex;
-  justify-content: space-between;
-  height: $tab-height;
-  line-height: $tab-height;
-  background-color: #ffffff;
-  border-bottom: 1px solid #f2f2f2;
-  box-sizing: border-box;
-  .tab-item {
-    width: 30%;
-    text-align: center;
-    font-size: 32rpx;
-    color: $uni-text-color-grey;
-  }
+	.tab-title {
+		position: fixed;
+		z-index: 99;
+		width: 100%;
+		padding: 10rpx;
+		// display: flex;
+		// justify-content: space-between;
+		height: $tab-height;
+		line-height: $tab-height;
+		background-color: #ffffff;
+		border-bottom: 1px solid #f2f2f2;
+		// box-sizing: border-box;
+		white-space: nowrap;
+		overflow: auto hidden;
+		display: flex;
+
+		&::-webkit-scrollbar {
+			/*滚动条整体样式*/
+			width: 10px;
+			/*高宽分别对应横竖滚动条的尺寸*/
+			height: 1px;
+		}
+
+		&::-webkit-scrollbar-thumb {
+			/*滚动条里面小方块*/
+			border-radius: 10px;
+			-webkit-box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
+			background: #535353;
+		}
+
+		&::-webkit-scrollbar-track {
+			/*滚动条里面轨道*/
+			-webkit-box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
+			border-radius: 10px;
+			background: #ededed;
+		}
+
+		.tab-item {
+			flex: 1;
+			text-align: center;
+			display: inline-block;
+			font-size: 32rpx;
+			color: $uni-text-color-grey;
+		}
 
-  .tab-item.active {
-    color: $j-primary-border-green;
-    border-bottom: 1px solid $j-primary-border-green;
-  }
-  .title-num {
-    font-size: 26rpx;
-  }
-  .title-red {
-    display: inline-block;
-    font-size: 22rpx;
-    padding: 0 10rpx;
-    border-radius: 50rpx;
-    color: #ffffff;
-    background: red;
-    line-height: 38rpx;
-    position: absolute;
-    top: 10rpx;
-    min-width: 18rpx;
-  }
-}
+		.tab-item.active {
+			color: $j-primary-border-green;
+			border-bottom: 1px solid $j-primary-border-green;
+		}
+		.title-num {
+			font-size: 26rpx;
+		}
+		.title-red {
+			display: inline-block;
+			font-size: 22rpx;
+			padding: 0 10rpx;
+			border-radius: 50rpx;
+			color: #ffffff;
+			background: red;
+			line-height: 38rpx;
+			position: absolute;
+			top: 10rpx;
+			min-width: 18rpx;
+		}
+	}
 </style>