From ae11615808e7c5fdc541780a687da068cd98386f Mon Sep 17 00:00:00 2001
From: zhaowei <zhaowei>
Date: 星期四, 12 六月 2025 09:53:07 +0800
Subject: [PATCH] 1、调整终端首页功能页面logo图片改为字体图标优化资源获取速度 2、新增终端合格率和程序呼叫页面 3、终端点检页面不再为独立页面,调整为与二保三保页面相同的跳转我的待办页面逻辑 4、终端所有页面完成前后端联调

---
 src/views/dnc/base/modules/TerminalIndex/EquipmentStartWork.vue |  198 +++++++++++++++++++++++++++++++++----------------
 1 files changed, 134 insertions(+), 64 deletions(-)

diff --git a/src/views/dnc/base/modules/TerminalIndex/EquipmentStartWork.vue b/src/views/dnc/base/modules/TerminalIndex/EquipmentStartWork.vue
index 9ca8f85..18b4f97 100644
--- a/src/views/dnc/base/modules/TerminalIndex/EquipmentStartWork.vue
+++ b/src/views/dnc/base/modules/TerminalIndex/EquipmentStartWork.vue
@@ -4,124 +4,194 @@
 
     <a-tabs default-active-key="1">
       <a-tab-pane tab="鎵撳崱涓婁笅鐝�" key="1" dataset="first">
-        <a-space>
-          <div>璁惧鍚嶇О锛�</div>
-          <a-select style="width: 250px">
+        <a-form-model ref="form" :model="model" :rules="validateRules" :labelCol="labelCol" :wrapperCol="wrapperCol">
+          <a-row>
+            <a-col :span="24">
+              <a-form-model-item label="璁惧鍚嶇О" prop="equipmentIdList">
+                <a-select v-model="model.equipmentIdList" mode="multiple" placeholder="璇烽�夋嫨璁惧" :maxTagCount="3"
+                          allow-clear>
+                  <a-select-option v-for="item in equipmentList" :key="item.equipmentId">
+                    {{item.equipmentId+`[${item.equipmentName}]`}}
+                  </a-select-option>
+                </a-select>
+              </a-form-model-item>
+            </a-col>
+          </a-row>
 
-          </a-select>
-        </a-space>
+          <div style="text-align: center;margin-top: 150px">
+            <a-space>
+              <a-button size="large" type="primary" @click="handleClockInAndOut('In',1)" :loading="clockInLoading1"
+                        :disabled="clockOutLoading1||clockInLoading2||clockOutLoading2">鏃╃彮涓婄彮
+              </a-button>
+              <a-button size="large" type="primary" @click="handleClockInAndOut('Out',1)" :loading="clockOutLoading1"
+                        :disabled="clockInLoading1||clockInLoading2||clockOutLoading2">
+                鏃╃彮涓嬬彮
+              </a-button>
+              <a-button size="large" type="primary" @click="handleClockInAndOut('In',2)" :loading="clockInLoading2"
+                        :disabled="clockOutLoading1||clockInLoading1||clockOutLoading2">鏅氱彮涓婄彮
+              </a-button>
+              <a-button size="large" type="primary" @click="handleClockInAndOut('Out',2)" :loading="clockOutLoading2"
+                        :disabled="clockOutLoading1||clockInLoading2||clockInLoading1">
+                鏅氱彮涓嬬彮
+              </a-button>
+            </a-space>
+          </div>
+        </a-form-model>
 
 
-        <div class="button">涓婄彮</div>
       </a-tab-pane>
 
       <a-tab-pane tab="褰撳墠璁惧鐘舵��" key="2">
-        <a-table :dataSource="dataSource" :columns="columns" rowKey="id" bordered :pagination="false"/>
+        <a-table :dataSource="dataSource" :columns="columns" rowKey="id" bordered :pagination="false"
+                 :loading="loading"/>
       </a-tab-pane>
     </a-tabs>
   </div>
 </template>
 
 <script>
+  import { JeecgListMixin } from '@/mixins/JeecgListMixin'
+  import { getAction, postAction } from '@/api/manage'
+  import moment from 'moment'
+
   export default {
     name: 'EquipmentStartWork',
+    mixins: [JeecgListMixin],
     data() {
       return {
+        model: {},
+        labelCol: {
+          xs: { span: 24 },
+          sm: { span: 8 }
+        },
+        wrapperCol: {
+          xs: { span: 24 },
+          sm: { span: 8 }
+        },
+        equipmentList: [],
         columns: [
           {
             title: '鐢ㄦ埛缂栧彿',
             align: 'center',
-            dataIndex: 'userId'
+            dataIndex: 'punchUser',
+            width: 250
           },
           {
             title: '鐢ㄦ埛鍚嶇О',
             align: 'center',
-            dataIndex: 'username'
+            dataIndex: 'punchUserRealName'
           },
           {
             title: '璁惧缂栧彿',
             align: 'center',
-            dataIndex: 'equipmentId'
+            dataIndex: 'equipmentId',
+            width: 200
+          },
+          {
+            title: '鐝',
+            align: 'center',
+            dataIndex: 'shiftScheduleName',
+            width: 150
           },
           {
             title: '涓婄彮鎵撳崱鏃堕棿',
             align: 'center',
-            dataIndex: 'startWorkTime'
+            dataIndex: 'checkInTime'
           },
           {
             title: '涓嬬彮鎵撳崱鏃堕棿',
             align: 'center',
-            dataIndex: 'finishWorkTime'
+            dataIndex: 'checkOutTime'
           }
         ],
-        dataSource: [
-          {
-            id: 1,
-            equipmentId: '3140132',
-            userId: '140016',
-            username: '鏉庨獮',
-            startWorkTime: '2023/11/13 9:29',
-            finishWorkTime: ''
-          },
-          {
-            id: 2,
-            equipmentId: '3140130',
-            userId: '140016',
-            username: '鏉庨獮',
-            startWorkTime: '2023/11/13 9:29',
-            finishWorkTime: ''
-          }
-        ],
+        validateRules: {
+          equipmentIdList: [
+            { required: true, message: '璇烽�夋嫨璁惧!', trigger: 'change' }
+          ]
+        },
+        clockInLoading1: false,
+        clockOutLoading1: false,
+        clockInLoading2: false,
+        clockOutLoading2: false,
         url: {
-          list: ''
+          equipmentList: '/mdc/mdcEquipment/getEquipmentList',
+          clockIn: '/mdcEquipmentPunch/workUp',
+          clockOut: '/mdcEquipmentPunch/workDown',
+          list: '/mdcEquipmentPunch/list'
         }
       }
     },
     created() {
+      this.getEquipmentListByApi()
+    },
+    methods: {
+      // 鑾峰彇璁惧鍒楄〃
+      getEquipmentListByApi() {
+        const that = this
+        getAction(this.url.equipmentList)
+          .then(res => {
+            if (res.success) that.equipmentList = res.result
+          })
+      },
 
+      /**
+       * 鎵撳崱涓婁笅鐝簨浠�
+       * @param clockInOrOut In涓轰笂鐝� Out涓轰笅鐝�
+       * @param shiftSchedule 1涓烘棭鐝� 2涓烘櫄鐝�
+       */
+      handleClockInAndOut(clockInOrOut, shiftSchedule) {
+        const that = this
+        this.$refs.form.validate(valid => {
+          if (valid) {
+            that['clock' + clockInOrOut + 'Loading' + shiftSchedule] = true
+            that.queryParam = {}
+            that.queryParam['shiftSchedule'] = shiftSchedule
+            that.queryParam['check' + clockInOrOut + 'Time'] = moment('2025-06-11 08:30:00').format('YYYY-MM-DD HH:mm:ss')
+            that.queryParam.equipmentId = that.model.equipmentIdList.join()
+            console.log('queryParam', that.queryParam)
+
+            postAction(that.url['clock' + clockInOrOut], that.queryParam)
+              .then(res => {
+                console.log('res', res)
+                if (res.success) {
+                  that.$notification.success({
+                    message: '娑堟伅',
+                    description: res.message
+                  })
+                  that.loadData()
+                } else {
+                  that.$notification.warning({
+                    message: '娑堟伅',
+                    description: res.message
+                  })
+                }
+              })
+              .finally(() => {
+                that['clock' + clockInOrOut + 'Loading' + shiftSchedule] = false
+              })
+          } else {
+            return false
+          }
+        })
+      }
     }
   }
 </script>
 
 <style scoped lang="less">
-  .full-screen-container {
-    padding: 24px;
+  /deep/ .ant-tabs {
+    flex: 1;
     display: flex;
     flex-direction: column;
 
-    /deep/ .ant-tabs {
+    .ant-tabs-content {
+      width: 100%;
       flex: 1;
-      display: flex;
-      flex-direction: column;
 
-      .ant-tabs-content {
-        width: 100%;
-        flex: 1;
-
-        .ant-tabs-tabpane[dataset='first'] {
-          display: flex;
-          flex-direction: column;
-          justify-content: center;
-          align-items: center;
-
-          .button {
-            font-weight: bold;
-            padding: 40px 80px;
-            border: 1px solid rgba(0, 0, 0, .2);
-            border-radius: 10px;
-            margin-top: 200px;
-            cursor: pointer;
-            box-shadow: 6px 6px 16px rgba(0, 0, 0, 0.2),
-              -6px -6px 16px rgba(255, 255, 255, 0.8),
-            inset 0 0 0 transparent;
-
-            &:hover {
-              box-shadow: 0 0 0 transparent,
-              inset 6px 6px 12px rgba(0, 0, 0, 0.2),
-                inset -6px -6px 12px rgba(255, 255, 255, 0.8);
-            }
-          }
-        }
+      .ant-tabs-tabpane[dataset='first'] {
+        display: flex;
+        flex-direction: column;
+        justify-content: center;
       }
     }
   }

--
Gitblit v1.9.3