Procházet zdrojové kódy

工单列表使用在首页文件夹中的组件

xiaohaizhao před 2 roky
rodič
revize
cdb95ca1cd

+ 3 - 51
packageA/workOrder/index.vue

@@ -10,32 +10,15 @@
         </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>
+            <list :list1="list" />
         </My_listbox>
     </view>
 </template>
 
 <script>
-
+import { list } from "../../pages/index/modules/workorderList.vue"
 export default {
-    components: {},
+    components: { list },
     name: "workOrder",
     data() {
         return {
@@ -109,35 +92,4 @@ export default {
 </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>

+ 2 - 2
pages/index/modules/home.vue

@@ -28,7 +28,7 @@
 		<!-- 巡检计划 -->
 		<patrolScheme />
 
-		<workorder v-if="showWorkrder" />
+		<workorder v-if="showWorkrder" :isHome="true" />
 		<view style="height: calc(16.533vw + env(safe-area-inset-bottom) / 2);" />
 	</view>
 </template>
@@ -39,7 +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 workorder from "./workorderList"
 import {
 	getCity
 } from "../../../utils/tool";

+ 15 - 2
pages/index/modules/workorder.vue → pages/index/modules/workorderList.vue

@@ -1,6 +1,7 @@
 <template>
     <view class="container">
-        <navigator v-for="item in list" :key="item.sa_workorderid" class="item" url="#">
+        <navigator v-for="item in isHome ? list : list1" :key="item.sa_workorderid" class="item"
+            :url="'/packageA/workOrder/detail?id=' + item.sa_workorderid">
             <view class="billno">
                 {{ item.billno }}
             </view>
@@ -24,6 +25,15 @@
 <script>
 
 export default {
+    props: {
+        isHome: {
+            type: Boolean,
+            default: false
+        },
+        list1: {
+            type: Array,
+        }
+    },
     components: {},
     name: "workOrder",
     data() {
@@ -42,7 +52,10 @@ export default {
         }
     },
     mounted() {
-        this.getlist();
+        if (this.isHome) {
+            this.getlist(true);
+            this.$Http.updateWorkorderList = this.getlist.bind(this);
+        }
     },
     methods: {
         getlist(init = false) {