|
@@ -0,0 +1,143 @@
|
|
|
+<template>
|
|
|
+ <view class="container">
|
|
|
+ <cu-custom id="custom"
|
|
|
+ bgImage="https://yostest175549.obs.cn-east-2.myhuaweicloud.com:443/202306151686796745663B52544232.png"
|
|
|
+ :isBack="true">
|
|
|
+ <block slot="backText">返回</block>
|
|
|
+ <block slot="content">
|
|
|
+ 工单
|
|
|
+ </block>
|
|
|
+ </cu-custom>
|
|
|
+ <My_search ref="My_search" @onFilter="onFilter" @startSearch="startSearch" dateRange />
|
|
|
+ <My_listbox ref="List" @getlist="getlist" :empty='empty'>
|
|
|
+ <navigator v-for="item in list" :key="item.sa_workorderid" class="item" url="#">
|
|
|
+ <view class="billno">
|
|
|
+ {{ item.billno }}
|
|
|
+ </view>
|
|
|
+ <view class="row">
|
|
|
+ 来源:{{ item.source || ' --' }}
|
|
|
+ </view>
|
|
|
+ <view class="row">
|
|
|
+ 设备:{{ item.devicename || ' --' }}
|
|
|
+ </view>
|
|
|
+ <view class="row">
|
|
|
+ 任务时间:{{ item.begdate && item.enddate ? item.begdate + ' 至 ' + item.enddate : ' --' }}
|
|
|
+ </view>
|
|
|
+ <view class="row">
|
|
|
+ 参与人:{{ item.users.length ? item.users : ' --' }}
|
|
|
+ </view>
|
|
|
+ <view class="status">{{ item.status }}</view>
|
|
|
+ </navigator>
|
|
|
+ </My_listbox>
|
|
|
+ </view>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+
|
|
|
+export default {
|
|
|
+ components: {},
|
|
|
+ name: "workOrder",
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ empty: true,
|
|
|
+ "content": {
|
|
|
+ "pageNumber": 1,
|
|
|
+ "pageSize": 20,
|
|
|
+ "pageTotal": 1,
|
|
|
+ "where": {
|
|
|
+ "condition": "",
|
|
|
+ "begindate": "",
|
|
|
+ "enddate": ""
|
|
|
+ }
|
|
|
+ },
|
|
|
+ list: []
|
|
|
+ }
|
|
|
+ },
|
|
|
+ mounted() {
|
|
|
+ this.getlist();
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ getlist(init = false) {
|
|
|
+ let content = this.content;
|
|
|
+ if (init) content.pageNumber = 1;
|
|
|
+ if (content.pageNumber > content.pageTotal) return;
|
|
|
+ this.$Http.basic({
|
|
|
+ "id": "20230922102702",
|
|
|
+ content
|
|
|
+ }).then(res => {
|
|
|
+ console.log("获取工单列表", res)
|
|
|
+ if (this.cutoff(res.msg)) return;
|
|
|
+ this.$refs.List.RefreshToComplete();
|
|
|
+ this.$refs.List.setHeight();
|
|
|
+ this.$refs.My_search.onFinish()
|
|
|
+ this.empty = !res.data.length;
|
|
|
+ content.pageNumber = res.pageNumber + 1;
|
|
|
+ content.pageTotal = res.pageTotal;
|
|
|
+
|
|
|
+ let list = res.data.map(v => {
|
|
|
+ switch (v.sourcetable) {
|
|
|
+ case "w_eventid":
|
|
|
+ v.source = "巡检:" + (v.planno || ' --')
|
|
|
+ break;
|
|
|
+ case "w_event_log":
|
|
|
+ v.source = "告警:" + (v.eventname || ' --')
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ v.source = "现场"
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ v.users = v.teamRows.map(u => u.name)
|
|
|
+ return v
|
|
|
+ })
|
|
|
+ this.list = res.pageNumber == 1 ? list : this.list.concat(list)
|
|
|
+ this.content = content;
|
|
|
+ })
|
|
|
+ },
|
|
|
+ startSearch(e) {
|
|
|
+ this.content.where.condition = e;
|
|
|
+ this.getlist(true)
|
|
|
+ },
|
|
|
+ onFilter(e) {
|
|
|
+ let where = this.content.where,
|
|
|
+ condition = where.condition;
|
|
|
+ where = e;
|
|
|
+ where.condition = condition;
|
|
|
+ this.content.where = where;
|
|
|
+ this.getlist(true)
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+</script>
|
|
|
+
|
|
|
+<style lang="scss" scoped>
|
|
|
+.item {
|
|
|
+ position: relative;
|
|
|
+ width: 355px;
|
|
|
+ background: #fff;
|
|
|
+ padding: 10px;
|
|
|
+ border-radius: 4px;
|
|
|
+ margin: 10px auto 0;
|
|
|
+ overflow: hidden;
|
|
|
+
|
|
|
+ .billno {
|
|
|
+ color: #004684;
|
|
|
+ font-weight: bold;
|
|
|
+ }
|
|
|
+
|
|
|
+ .row {
|
|
|
+ margin-top: 4px;
|
|
|
+ font-size: 14px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .status {
|
|
|
+ position: absolute;
|
|
|
+ top: 0;
|
|
|
+ right: 0;
|
|
|
+ padding: 4px 8px;
|
|
|
+ background: #FFEFEF;
|
|
|
+ color: #F65050;
|
|
|
+ font-size: 12px;
|
|
|
+ border-radius: 0 0 0 4px;
|
|
|
+ }
|
|
|
+}
|
|
|
+</style>
|