From a022fa78a6f1ec591187c0c3e032036c15761779 Mon Sep 17 00:00:00 2001
From: zhuzhuanzhuan
Date: 星期五, 26 一月 2024 10:11:36 +0800
Subject: [PATCH] 加班管理页面维度由班次班制调整为日期与设备,删除班制班次有关字段

---
 src/views/mdc/base/modules/OvertimeManagement/OvertimeManagementModalEdit.vue |   26 +++++++-
 src/views/mdc/base/modules/OvertimeManagement/OvertimeManagementModal.vue     |  116 +++++++++++++++++++++++++-------------
 src/views/mdc/base/modules/OvertimeManagement/OvertimeManagementList.vue      |   30 +++++-----
 3 files changed, 113 insertions(+), 59 deletions(-)

diff --git a/src/views/mdc/base/modules/OvertimeManagement/OvertimeManagementList.vue b/src/views/mdc/base/modules/OvertimeManagement/OvertimeManagementList.vue
index 339b8e3..f04727f 100644
--- a/src/views/mdc/base/modules/OvertimeManagement/OvertimeManagementList.vue
+++ b/src/views/mdc/base/modules/OvertimeManagement/OvertimeManagementList.vue
@@ -166,25 +166,25 @@
           {
             title: '鏃ユ湡',
             align: 'center',
-            dataIndex: 'effectiveDate',
+            dataIndex: 'theDate',
             width:150
             // scopedSlots:{customRender:'startTime'},
             // customRender:(text,row,index) => {
             //   return moment(text).format("YYYY-MM-DD HH:mm:ss")
             // }
           },
-          {
-            title: '鐝寮�濮嬫椂闂�',
-            align: 'center',
-            dataIndex: 'startDate',
-            width:150
-          },
-          {
-            title: '鐝缁撴潫鏃堕棿',
-            align: 'center',
-            dataIndex: 'endDate',
-            width:150
-          },
+          // {
+          //   title: '鐝寮�濮嬫椂闂�',
+          //   align: 'center',
+          //   dataIndex: 'startDate',
+          //   width:150
+          // },
+          // {
+          //   title: '鐝缁撴潫鏃堕棿',
+          //   align: 'center',
+          //   dataIndex: 'endDate',
+          //   width:150
+          // },
           {
             title: '鍔犵彮寮�濮嬫椂闂�',
             align: 'center',
@@ -202,13 +202,13 @@
             align: 'center',
             dataIndex: 'duration',
             scopedSlots: {customRender: 'duration'},
-            width:150
+            width:200
           },
           {
             title: '澶囨敞',
             align: 'center',
             dataIndex: 'remark',
-            width:150
+            width:210
           },
           {
             title: '鎿嶄綔',
diff --git a/src/views/mdc/base/modules/OvertimeManagement/OvertimeManagementModal.vue b/src/views/mdc/base/modules/OvertimeManagement/OvertimeManagementModal.vue
index 0ed4b81..5e65299 100644
--- a/src/views/mdc/base/modules/OvertimeManagement/OvertimeManagementModal.vue
+++ b/src/views/mdc/base/modules/OvertimeManagement/OvertimeManagementModal.vue
@@ -4,10 +4,22 @@
     <a-spin :spinning="confirmLoading">
       <a-form :form="form">
         <a-row :gutter="24">
-          <a-col :span="24">
-            <a-form-item label="鐝閫夋嫨" :labelCol="labelColLong" :wrapperCol="wrapperColLong">
-              <a-input-search :readOnly="true" v-decorator="['calendarId', validatorRules.calendarId]"
-                              @search="deviceSearch" enter-button/>
+          <!--<a-col :span="24">-->
+            <!--<a-form-item label="鐝閫夋嫨" :labelCol="labelColLong" :wrapperCol="wrapperColLong">-->
+              <!--<a-input-search :readOnly="true" v-decorator="['calendarId', validatorRules.calendarId]"-->
+                              <!--@search="deviceSearch" enter-button/>-->
+            <!--</a-form-item>-->
+          <!--</a-col>-->
+          <a-col :span="12">
+            <a-form-item label="璁惧缁�" :labelCol="labelCol" :wrapperCol="wrapperCol">
+              <a-input-search :readOnly="true" v-decorator="['equipmentId', validatorRules.equipmentId]"
+                              @search="deviceSearch" enter-button placeholder="璇烽�夋嫨璁惧"/>
+            </a-form-item>
+          </a-col>
+          <a-col :span="12">
+            <a-form-item label="鏃ユ湡" :labelCol="labelCol" :wrapperCol="wrapperCol">
+              <a-date-picker :disabled="disableSubmit" :readOnly="disableSubmit"
+                             v-decorator="['theDate',validatorRules.theDate]" format="YYYYMMDD" valueFormat="YYYYMMDD" style="width: 100%" placeholder="璇烽�夋嫨鍔犵彮鏃ユ湡"/>
             </a-form-item>
           </a-col>
         </a-row>
@@ -15,27 +27,27 @@
           <a-col :span="12">
             <a-form-item label="鍔犵彮寮�濮嬫椂闂�" :labelCol="labelCol" :wrapperCol="wrapperCol">
               <a-time-picker :disabled="disableSubmit" :readOnly="disableSubmit" allow-clear
-                             v-decorator="['startTime',validatorRules.startTime]"  valueFormat="HH:mm:ss"/>
+                             v-decorator="['startTime',validatorRules.startTime]"  valueFormat="HH:mm:ss" style="width: 100%"/>
             </a-form-item>
           </a-col>
           <a-col :span="12">
             <a-form-item label="鍔犵彮缁撴潫鏃堕棿" :labelCol="labelCol" :wrapperCol="wrapperCol">
               <a-time-picker :disabled="disableSubmit" :readOnly="disableSubmit"
-                             v-decorator="['endTime',validatorRules.endTime]" valueFormat="HH:mm:ss"/>
+                             v-decorator="['endTime',validatorRules.endTime]" valueFormat="HH:mm:ss" style="width: 100%"/>
             </a-form-item>
           </a-col>
         </a-row>
         <a-row :gutter="24">
           <a-col :span="24">
           <a-form-item label="澶囨敞" :labelCol="labelColLong" :wrapperCol="wrapperColLong">
-            <a-textarea :maxLength="20"  v-decorator="['remark', validatorRules.remark]" placeholder="璇疯緭鍏ュ娉�"  ></a-textarea>
+            <a-textarea :maxLength="20"  v-decorator="['remark', validatorRules.remark]" placeholder="璇疯緭鍏ュ娉�"></a-textarea>
           </a-form-item>
           </a-col>
         </a-row>
       </a-form>
     </a-spin>
-    <torqueconfiguration-modal-list ref="deviceRepairListModel" @sendSelectionRows="getDeviceRows"></torqueconfiguration-modal-list>
-
+    <!--<torqueconfiguration-modal-list ref="deviceRepairListModel" @sendSelectionRows="getDeviceRows"></torqueconfiguration-modal-list>-->
+    <select-device-modal ref="selectDeviceModal" @selectFinished="selectOK" :title="'閫夋嫨璁惧'"/>
   </a-modal>
 </template>
 
@@ -52,10 +64,11 @@
   import {
     duplicateCheck
   } from '@/api/api'
+  import SelectDeviceModal from '../../../../system/modules/SelectDeviceModal'
 
   export default {
     name: 'TorqueconfigurationModal',
-    components: {TorqueconfigurationModalList},
+    components: { SelectDeviceModal, TorqueconfigurationModalList},
     props: {},
     data() {
       return {
@@ -103,7 +116,7 @@
         confirmLoading: false,
         form: this.$form.createForm(this),
         validatorRules: {
-          equipmentIds:{
+          equipmentId:{
             rules:[
               {
                 required:true,
@@ -111,11 +124,19 @@
               },
             ],
           },
-          calendarId:{
+          // calendarId:{
+          //   rules:[
+          //     {
+          //       required:true,
+          //       message: "璇烽�夋嫨鐝"
+          //     },
+          //   ],
+          // },
+          theDate:{
             rules:[
               {
                 required:true,
-                message: "璇烽�夋嫨鐝"
+                message: "璇烽�夋嫨鍔犵彮鏃ユ湡"
               },
             ],
           },
@@ -169,32 +190,33 @@
       onChangeEnd(dates, dateStrings){
         this.endTime = dateStrings[0];
       },
-      getDeviceRows(val) {
-        var calendarId;
-        for(var i = 0;i<val.length;i++){
-          if (i == 0) {
-            calendarId =  val[i].id;
-          } else {
-            calendarId = calendarId + "," + val[i].id;
-          }
-        }
-        // console.log("========",equipmentIds);
-        this.form.setFieldsValue({
-          calendarId: calendarId,
-        })
-        //   this.form.setFieldsValue({
-        // equipmentId: val.equipmentId,
-        // equipmentName: val.equipmentName,
-        // equipmentModel: val.equipmentModel,
-        // equipmentIp: val.equipmentIp,
-        // dataPort: val.dataPort,
-        // driveType: val.driveType
-        // })
-      },
+      // getDeviceRows(val) {
+      //   var calendarId;
+      //   for(var i = 0;i<val.length;i++){
+      //     if (i == 0) {
+      //       calendarId =  val[i].id;
+      //     } else {
+      //       calendarId = calendarId + "," + val[i].id;
+      //     }
+      //   }
+      //   // console.log("========",equipmentIds);
+      //   this.form.setFieldsValue({
+      //     calendarId: calendarId,
+      //   })
+      //   //   this.form.setFieldsValue({
+      //   // equipmentId: val.equipmentId,
+      //   // equipmentName: val.equipmentName,
+      //   // equipmentModel: val.equipmentModel,
+      //   // equipmentIp: val.equipmentIp,
+      //   // dataPort: val.dataPort,
+      //   // driveType: val.driveType
+      //   // })
+      // },
       deviceSearch() {
-        this.$refs.deviceRepairListModel.openPage()
-        this.$refs.deviceRepairListModel.title = '閫夋嫨璁惧'
-        this.$refs.deviceRepairListModel.disableSubmit = false
+        this.$refs.selectDeviceModal.visible = true
+        this.$refs.selectDeviceModal.selectedRowKeys = []
+        this.$refs.selectDeviceModal.selectedRows = []
+        this.$refs.selectDeviceModal.checkedKeys = this.form.getFieldValue('equipmentId') ? this.form.getFieldValue('equipmentId').split(',') : []
       },
       //绾ц仈妗唎nChange浜嬩欢
       // onChange(value) {
@@ -227,7 +249,7 @@
         this.model = Object.assign({}, record)
         this.visible = true
         this.$nextTick(() => {
-          this.form.setFieldsValue(pick(this.model, 'equipmentIds', 'equipmentName', 'mdcRepairType', 'startTime', 'endTime',
+          this.form.setFieldsValue(pick(this.model, 'equipmentId', 'equipmentName', 'mdcRepairType', 'startTime', 'endTime',
           ))
         })
       },
@@ -322,6 +344,22 @@
       },
       checkboxChange(e) {
         this.checked = e.target.checked
+      },
+
+      /**
+       * 閫夋嫨宸叉湁璁惧鍚庣偣鍑荤‘瀹氭椂瑙﹀彂
+       * @param data 宸查�夋嫨鐨勮澶�
+       */
+      selectOK(data) {
+        // let params = {}
+        // params.equipmentIdList = []
+        // for (var a = 0; a < data.length; a++) {
+        //   params.equipmentIdList.push(data[a])
+        // }
+        console.log('data=', data)
+        this.form.setFieldsValue({
+          equipmentId: data.join(',')
+        })
       }
     }
   }
diff --git a/src/views/mdc/base/modules/OvertimeManagement/OvertimeManagementModalEdit.vue b/src/views/mdc/base/modules/OvertimeManagement/OvertimeManagementModalEdit.vue
index 41abd9e..694e689 100644
--- a/src/views/mdc/base/modules/OvertimeManagement/OvertimeManagementModalEdit.vue
+++ b/src/views/mdc/base/modules/OvertimeManagement/OvertimeManagementModalEdit.vue
@@ -9,12 +9,11 @@
               <a-input :disabled="disableSubmit" :readOnly="readOnly" allow-clear placeholder="璇疯緭鍏ヨ澶囩紪鍙�"
                        v-decorator="['equipmentId',validatorRules.equipmentId]"/>
             </a-form-item>
-
           </a-col>
           <a-col :span="12">
             <a-form-item label="鍔犵彮寮�濮嬫椂闂�" :labelCol="labelCol" :wrapperCol="wrapperCol">
               <a-time-picker :disabled="disableSubmit" :readOnly="disableSubmit"  @change="changeStartTime"
-                             v-decorator="['startTime',validatorRules.startTime]"/>
+                             v-decorator="['startTime',validatorRules.startTime]" style="width: 100%"/>
             </a-form-item>
           </a-col>
         </a-row>
@@ -29,13 +28,21 @@
           <a-col :span="12">
             <a-form-item label="鍔犵彮缁撴潫鏃堕棿" :labelCol="labelCol" :wrapperCol="wrapperCol">
               <a-time-picker :disabled="disableSubmit" :readOnly="disableSubmit" @change="changeEndTime"
-                             v-decorator="['endTime',validatorRules.endTime]"/>
+                             v-decorator="['endTime',validatorRules.endTime]" style="width: 100%"/>
+            </a-form-item>
+          </a-col>
+        </a-row>
+        <a-row>
+          <a-col :span="12">
+            <a-form-item label="鏃ユ湡" :labelCol="labelCol" :wrapperCol="wrapperCol">
+              <a-date-picker :disabled="disableSubmit" :readOnly="disableSubmit"
+                             v-decorator="['theDate',validatorRules.theDate]" format="YYYYMMDD" valueFormat="YYYYMMDD" style="width: 100%" placeholder="璇烽�夋嫨鍔犵彮鏃ユ湡"/>
             </a-form-item>
           </a-col>
         </a-row>
         <a-row :gutter="24">
           <a-form-item label="澶囨敞" :labelCol="labelColLong" :wrapperCol="wrapperColLong">
-            <a-textarea :maxLength="20" :disabled="disableSubmit"  v-decorator="['remark', validatorRules.remark]" placeholder="璇疯緭鍏ュ娉�"  ></a-textarea>
+            <a-textarea :maxLength="20" :disabled="disableSubmit"  v-decorator="['remark', validatorRules.remark]" placeholder="璇疯緭鍏ュ娉�"></a-textarea>
           </a-form-item>
         </a-row>
       </a-form>
@@ -62,6 +69,7 @@
 
   export default {
     name: 'TorqueconfigurationModalEdit',
+    components: {  },
     // components: {DeviceRepairListModel,JDate,DeviceRepairEditListModel},
     props: {},
     data() {
@@ -141,6 +149,14 @@
               },
             ],
           },
+          theDate:{
+            rules:[
+              {
+                required:true,
+                message: "璇烽�夋嫨鍔犵彮鏃ユ湡"
+              },
+            ],
+          }
           // mdcRepairType:{
           //   rules:[
           //     {
@@ -264,7 +280,7 @@
         // this.editStart  = (this.model.startTime).replace(/:/g,'');
         this.visible = true
         this.$nextTick(() => {
-          this.form.setFieldsValue(pick(this.model,'equipmentId', 'equipmentName','startTime', 'endTime','remark'
+          this.form.setFieldsValue(pick(this.model,'equipmentId', 'equipmentName','startTime', 'endTime','theDate','remark'
           ))
           this.form.setFieldsValue({
             startTime: moment(this.model.startTime, 'HH:mm:ss'),

--
Gitblit v1.9.3