Ver código fonte

+ 设备详情

chen.cheng 8 meses atrás
pai
commit
2232c6a65e

+ 1 - 0
.gitignore

@@ -7,3 +7,4 @@
 
 *.iml
 .DS_Store
+stats.html

+ 12 - 2
src/api/workorder.js

@@ -1,8 +1,18 @@
-import {uploadFilePromise} from "@/util/request";
+import {post, uploadFilePromise} from "@/util/request";
+import {Page} from "@/common/consts/CommonConst";
 
 export const uploadOrderFile = async (file) => {
     return await uploadFilePromise("/file/cloud/upload", file, {
         path: "aiot",
         fileType: "工单"
     })
-}
+}
+
+
+export const getMyOrderWork = async ({page = Page.page, size = Page.size, ...params}) => {
+    return await post('/orderWork/myPage', {
+        page,
+        size,
+        ...params
+    });
+}

+ 53 - 36
src/common/consts/WorkOrderConst.js

@@ -1,38 +1,55 @@
 export const WorkOrderStat = {
-    ALL:{
-        label: '全部',
-        code: "all",
-        value: null,
-        color: 'primary'
-    },
-    END: {
-        label: '已完成',
-        code: "end",
-        value: 3,
-        color: 'success'
-    },
-    SCRAP: {
-        label: '已废弃',
-        code: "scrap",
-        value: 4,
-        color: 'danger'
-    },
-    IN_HANDLE: {
-        label: '处理中',
-        code: "inhandle",
-        value: 2,
-        color: 'info'
-    },
-    UN_HANDLE: {
-        label: '未处理',
-        code: "unhandle",
-        value: 1,
-        color: 'warning'
-    },
-    UN_CONFIRMED: {
-        label: '未确认',
-        code: "unconfirmed",
-        value: 0,
-        color: 'default'
-    }
+  ALL: {
+    label: '全部',
+    code: "all",
+    value: null,
+    color: 'primary'
+  },
+  END: {
+    label: '已完成',
+    code: "end",
+    value: 3,
+    color: 'success'
+  },
+  SCRAP: {
+    label: '已废弃',
+    code: "scrap",
+    value: 4,
+    color: 'danger'
+  },
+  IN_HANDLE: {
+    label: '处理中',
+    code: "inhandle",
+    value: 2,
+    color: 'info'
+  },
+  UN_HANDLE: {
+    label: '未处理',
+    code: "unhandle",
+    value: 1,
+    color: 'warning'
+  },
+  UN_CONFIRMED: {
+    label: '未确认',
+    code: "unconfirmed",
+    value: 0,
+    color: 'default'
+  }
+}
+export const WorkOrderLevel = {
+  NORMAL: {
+    label: '一般',
+    code: "normal",
+    value: 3,
+  },
+  IMPORTANT: {
+    label: '重要',
+    code: "important",
+    value: 2,
+  },
+  URGENT: {
+    label: '紧急',
+    code: "urgent",
+    value: 1,
+  }
 }

+ 1 - 1
src/pages.json

@@ -66,7 +66,7 @@
         {
           "path": "workorder/list",
           "style": {
-            "navigationBarTitleText": "设备工单"
+            "navigationBarTitleText": "工单管理"
           }
         },
         {

+ 1 - 1
src/pages/workbench/appctl.vue

@@ -53,7 +53,7 @@ const ctlItems = ref([
     target: "/pages/workbenchsub/device/detail"
   }, {
     name: order,
-    title: '设备工单',
+    title: '工单管理',
     color: '#6a6bcd',
     target: "/pages/workbenchsub/workorder/list"
   }, {

+ 21 - 31
src/pages/workbench/usrsubmit.vue

@@ -6,7 +6,8 @@
       <up-text
           color="#007aff"
           size="24rpx"
-          style="margin-left: auto;flex: inherit;width: auto;" text="查看更多">
+          style="margin-left: auto;flex: inherit;width: auto;" text="查看更多"
+          @click="()=>navigateTo({url:'/pages/workbenchsub/workorder/list'})">
       </up-text>
       <up-icon size="20rpx" name="arrow-right-double" color="#007aff"></up-icon>
     </template>
@@ -27,24 +28,25 @@
                       color="#555555"
                       size="25rpx"
                       :bold="true"
-                      style="font-weight:700;flex: inherit;width: auto;" text="故障提报">
+                      style="font-weight:700;flex: inherit;width: auto;" :text="item.typeName">
                   </up-text>
                   <up-text
                       color="#f59a23"
                       size="30rpx"
                       :bold="true"
-                      style="font-weight:700;flex: inherit;width: auto;" text="待派工">
+                      style="font-weight:700;flex: inherit;width: auto;"
+                      :text="item.statusName">
                   </up-text>
                 </view>
                 <view class="item-desc">
                   <view class="info-item">
-                    工单名称:设备运转异常,安灯报警
+                    工单名称:{{ formatTxt(item.name) }}
                   </view>
                   <view class="info-item">
-                    提报时间:2023-12-19 16:34:56
+                    提报时间:{{ item.createTime }}
                   </view>
                   <view class="info-item">
-                    工单登记:紧急
+                    工单等级:{{ valueToConst(WorkOrderLevel, item.level).label }}
                   </view>
                 </view>
               </view>
@@ -61,36 +63,23 @@
 
 import Panel from "@/components/pannel/index.vue";
 import tag from "@/static/aiot/icon/tag.svg";
-import {reactive} from 'vue';
+import {ref} from 'vue';
 import {onLoad} from '@dcloudio/uni-app';
+import {getMyOrderWork} from "@/api/workorder.js";
+import {formatTxt, navigateTo} from "@/util/index.js";
+import {valueToConst} from "@/common/consts/CommonConst.js";
+import {WorkOrderLevel} from "@/common/consts/WorkOrderConst.js";
 
-const indexList = reactive([]);
-const urls = [
-  'https://uview-plus.jiangruyi.com/album/1.jpg',
-  'https://uview-plus.jiangruyi.com/album/2.jpg',
-  'https://uview-plus.jiangruyi.com/album/3.jpg',
-  'https://uview-plus.jiangruyi.com/album/4.jpg',
-  'https://uview-plus.jiangruyi.com/album/5.jpg',
-  'https://uview-plus.jiangruyi.com/album/6.jpg',
-  'https://uview-plus.jiangruyi.com/album/7.jpg',
-  'https://uview-plus.jiangruyi.com/album/8.jpg',
-  'https://uview-plus.jiangruyi.com/album/9.jpg',
-  'https://uview-plus.jiangruyi.com/album/10.jpg',
-];
+const indexList = ref([]);
 onLoad(() => {
   loadmore();
 });
 
-const scrolltolower = () => {
-  loadmore();
-};
-
 const loadmore = () => {
-  for (let i = 0; i < 10; i++) {
-    indexList.push({
-      url: urls[uni.$u.random(0, urls.length - 1)],
-    });
-  }
+  getMyOrderWork({}).then((res) => {
+    const {records} = res;
+    indexList.value = records;
+  });
 };
 </script>
 
@@ -145,9 +134,10 @@ export default {
       display: flex;
       flex-direction: column;
       justify-content: flex-start;
-      .info-item{
+
+      .info-item {
         margin-top: 10rpx;
-        color:  #333333;
+        color: #333333;
         font-size: 24rpx;
       }
     }

Diferenças do arquivo suprimidas por serem muito extensas
+ 0 - 0
stats.html


Alguns arquivos não foram mostrados porque muitos arquivos mudaram nesse diff