From 09d2f351f02ba1356cd67586f803d3b78bcd43a0 Mon Sep 17 00:00:00 2001
From: yangyin <1850366751@qq.com>
Date: 星期四, 13 六月 2024 09:28:04 +0800
Subject: [PATCH] feat: 新增工单任务

---
 workDesktop/index/index.js |  112 +++++++++++++++++++++++++++++++++++++++++++++----------
 1 files changed, 91 insertions(+), 21 deletions(-)

diff --git a/workDesktop/index/index.js b/workDesktop/index/index.js
index 504bac2..d189034 100644
--- a/workDesktop/index/index.js
+++ b/workDesktop/index/index.js
@@ -1,5 +1,6 @@
 var Constant = require('../../utils/constant.js');
 var app = getApp();
+import Request from "../../utils/api"
 Page({
   data: {
     userInfo: null,
@@ -10,20 +11,40 @@
       // [
       //   {id:1,text:"浠婃棩宸℃", icon:"icon-xunjiandian", iconcolor:"#16b5cb",badgeNum: 0, cb:"onTodayInspection", type:'navigate'},
       //   {id:2,text:"宸℃璁板綍",icon: "icon-lishi2", iconcolor:"#16b5cb", badgeNum:0,cb: "onHistoryInspection", type:'navigate'},
-        
-      // ],
-      [
-        {id:3,text:"鏂板缓鎶ヤ慨", icon:"icon-zengjia", iconcolor:"#16b5cb", badgeNum:0, cb:"onAddRepairRequest", type:'navigate'},
-        {id:4,text:"鎴戠殑鎶ヤ慨", icon:"icon-wangshangbaoming", iconcolor:"#16b5cb", badgeNum:0, cb:"onMyReport", type:'navigate'},
-      ],
-      [
-        {id:5,text:"鎴戠殑缁翠慨", icon:"icon-baoxiu", iconcolor:"#16b5cb", badgeNum:0, cb:"onMyRepairTask", type:'navigate'}
-      ]
-    ]
-  },
 
- 
-  //
+      // ],
+      [{
+          id: 3,
+          text: "鏂板缓鎶ヤ慨",
+          icon: "icon-zengjia",
+          iconcolor: "#16b5cb",
+          badgeNum: 0,
+          cb: "onAddRepairRequest",
+          type: 'navigate'
+        },
+        {
+          id: 4,
+          text: "鎴戠殑鎶ヤ慨",
+          icon: "icon-wangshangbaoming",
+          iconcolor: "#16b5cb",
+          badgeNum: 0,
+          cb: "onMyReport",
+          type: 'navigate'
+        },
+      ],
+      [{
+        id: 5,
+        text: "鎴戠殑缁翠慨",
+        icon: "icon-baoxiu",
+        iconcolor: "#16b5cb",
+        badgeNum: 0,
+        cb: "onMyRepairTask",
+        type: 'navigate'
+      }]
+    ],
+    timer: null,
+    modalName: false
+  },
   onLoad: function (options) {
     //鍒ゆ柇app涓殑CropID鏄惁鍜屽叏灞�鐨凜ropID鐩稿悓锛屼笉鍚屽垯璺宠浆鍒扮櫥闄嗙晫闈�
     var userInfo = app.globalData.userInfo;
@@ -33,11 +54,11 @@
         url: '/login/login/index',
       })
       return;
-    }  
- 
+    }
+    this.getAssignDialog()
     this.setData({
       userInfo: app.globalData.userInfo,
-    });   
+    });
   },
   //
   refreshUserInfo: function () {
@@ -46,7 +67,7 @@
       userInfo: userInfo
     });
   },
-  //閫氱煡
+  //浠诲姟閫氱煡
   onNotice() {
     var userInfo = this.data.userInfo;
     // 
@@ -61,6 +82,55 @@
       url: '/other/notice/index',
     })
   },
+  //宸ュ崟娲惧崟閫氱煡寮圭獥
+  getAssignDialog: function () {
+    Request({
+      url: Constant.BASE_SERVER_URL + "Repair/Task/Form/GetMyAssignedPageList@V1.0",
+      data: {
+        PageIndex: 1,
+        PageSize: 1
+      },
+      success: res => {
+        let result = res.data
+        if (result.Data.Total == 0 && result.Data.List == null) {
+          this.setData({
+            modalName: false
+          })
+          return
+        }
+        if (result.Data.Total > 0) {
+          this.setData({
+            modalName: true
+          })
+        }
+      }
+    })
+  },
+  //璺宠浆鍒版垜鐨勭淮淇�
+  workSure(){
+    wx.navigateTo({
+      url: '/repair/myTask/index'
+    });
+    this.setData({
+      modalName: false
+    })
+  },
+  //宸ュ崟浠诲姟鍙栨秷寮圭獥
+  hideModal() {
+    this.setData({
+      modalName: false
+    })
+  },
+  //娑堟伅閫氱煡寮圭獥
+  getMonitorDialog() {
+    this.data.timer = setInterval(
+      function () {
+        wx.showModal({
+          title: '鏆傛棤鎶ヨ鏁版嵁',
+
+        });
+      }, 500)
+  },
   // 浠婃棩宸℃
   onTodayInspection() {
     var userInfo = this.data.userInfo;
@@ -71,7 +141,7 @@
       });
       return;
     }
-    var inspection_url = '/inspection/todayProductList/index'; 
+    var inspection_url = '/inspection/todayProductList/index';
     wx.getSystemInfo({
       success: function (res) {
         // console.log(res, res.locationEnabled)
@@ -100,7 +170,7 @@
     })
   },
   //杩涘叆娉垫埧鑰冩牳
-  onTodayAssess(){
+  onTodayAssess() {
     wx.navigateTo({
       url: '../../inspection/todayAssess/index',
     })
@@ -116,7 +186,7 @@
       return;
     }
 
-    var repair_url = '/repair/addReport/index'; 
+    var repair_url = '/repair/addReport/index';
     wx.getSystemInfo({
       success: function (res) {
         //  console.log(res, res.locationEnabled)
@@ -166,7 +236,7 @@
     wx.navigateTo({
       url: '/repair/myReport/index',
     });
-  
+
   },
 
   onShareAppMessage: function () {

--
Gitblit v1.9.3