Explorar el Código

首页添加工单列表显示

xiaohaizhao hace 1 año
padre
commit
964901f1ff
Se han modificado 3 ficheros con 127 adiciones y 4 borrados
  1. 5 1
      pages/index/modules/home.vue
  2. 115 0
      pages/index/modules/workorder.vue
  3. 7 3
      static/iconfont/iconfont.css

+ 5 - 1
pages/index/modules/home.vue

@@ -27,6 +27,8 @@
 		<spectaculars />
 		<!-- 巡检计划 -->
 		<patrolScheme />
+
+		<workorder />
 		<view style="height: calc(16.533vw + env(safe-area-inset-bottom) / 2);" />
 	</view>
 </template>
@@ -37,6 +39,7 @@ import notice from "./notice.vue";
 import spectaculars from "./spectaculars.vue";
 import patrolScheme from "./patrolScheme.vue";
 import { getWeek, getYMD } from "../../../utils/getTime";
+import workorder from "./workorder"
 import {
 	getCity
 } from "../../../utils/tool";
@@ -48,7 +51,8 @@ export default {
 		workbench,
 		notice,
 		spectaculars,
-		patrolScheme
+		patrolScheme,
+		workorder
 	},
 	data() {
 		return {

+ 115 - 0
pages/index/modules/workorder.vue

@@ -0,0 +1,115 @@
+<template>
+    <view class="container">
+        <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>
+    </view>
+</template>
+
+<script>
+
+export default {
+    components: {},
+    name: "workOrder",
+    data() {
+        return {
+            "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;
+                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;
+            })
+        }
+    }
+}
+</script>
+
+<style lang="scss" scoped>
+.item {
+    position: relative;
+    width: 355px;
+    background: #fff;
+    padding: 10px;
+    border-radius: 4px;
+    margin: 10px auto 0;
+    overflow: hidden;
+    box-sizing: border-box;
+
+    .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>

+ 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_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');
+  src: url('//at.alicdn.com/t/c/font_4091725_n0q4ed0yw5i.woff2?t=1695714213625') format('woff2'),
+       url('//at.alicdn.com/t/c/font_4091725_n0q4ed0yw5i.woff?t=1695714213625') format('woff'),
+       url('//at.alicdn.com/t/c/font_4091725_n0q4ed0yw5i.ttf?t=1695714213625') format('truetype');
 }
 
 .iconfont {
@@ -13,6 +13,10 @@
   -moz-osx-font-smoothing: grayscale;
 }
 
+.icon-a-wodemendianxinxidizhi:before {
+  content: "\e64b";
+}
+
 .icon-gongdan:before {
   content: "\e68d";
 }