xiaohaizhao 1 year ago
parent
commit
731dd203a6
4 changed files with 157 additions and 4 deletions
  1. 143 0
      packageA/workOrder/index.vue
  2. 3 1
      pages.json
  3. 4 0
      pages/index/modules/workbench.vue
  4. 7 3
      static/iconfont/iconfont.css

+ 143 - 0
packageA/workOrder/index.vue

@@ -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>

+ 3 - 1
pages.json

@@ -28,7 +28,9 @@
 	}],
 	"subPackages": [{
 		"root": "packageA",
-		"pages": []
+		"pages": [{
+			"path": "workOrder/index"
+		}]
 	}, {
 		"root": "control",
 		"pages": []

+ 4 - 0
pages/index/modules/workbench.vue

@@ -48,6 +48,10 @@ export default {
                 }, {
                     label: "雨洪系统",
                     icon: "icon-xunjianzhongxin"
+                }, {
+                    label: "工单",
+                    icon: "icon-gongdan",
+                    path: "/packageA/workOrder/index"
                 }].filter(v => authList[v.label]),
                 apps = [];
             for (let i = list.length / 5; i > 0; i--) {

+ 7 - 3
static/iconfont/iconfont.css

@@ -1,8 +1,8 @@
 @font-face {
   font-family: "iconfont"; /* Project id 4091725 */
-  src: url('//at.alicdn.com/t/c/font_4091725_mpzbdyrjiwi.woff2?t=1695454066361') format('woff2'),
-       url('//at.alicdn.com/t/c/font_4091725_mpzbdyrjiwi.woff?t=1695454066361') format('woff'),
-       url('//at.alicdn.com/t/c/font_4091725_mpzbdyrjiwi.ttf?t=1695454066361') format('truetype');
+  src: url('//at.alicdn.com/t/c/font_4091725_m9utnhz7w8j.woff2?t=1695697091418') format('woff2'),
+       url('//at.alicdn.com/t/c/font_4091725_m9utnhz7w8j.woff?t=1695697091418') format('woff'),
+       url('//at.alicdn.com/t/c/font_4091725_m9utnhz7w8j.ttf?t=1695697091418') format('truetype');
 }
 
 .iconfont {
@@ -13,6 +13,10 @@
   -moz-osx-font-smoothing: grayscale;
 }
 
+.icon-gongdan:before {
+  content: "\e68d";
+}
+
 .icon-zhanghao:before {
   content: "\e6a1";
 }