From 102c7d7dc9f5af873f19c86a0d17d5d6addcbc32 Mon Sep 17 00:00:00 2001
From: zhuzhuanzhuan
Date: 星期二, 19 九月 2023 17:39:28 +0800
Subject: [PATCH] 项目优化

---
 src/views/mdc/base/modules/deviceCalendar/DeviceCalendarModel.vue |  126 ++++++++++++++---------------------------
 1 files changed, 44 insertions(+), 82 deletions(-)

diff --git a/src/views/mdc/base/modules/deviceCalendar/DeviceCalendarModel.vue b/src/views/mdc/base/modules/deviceCalendar/DeviceCalendarModel.vue
index b92f440..f48a441 100644
--- a/src/views/mdc/base/modules/deviceCalendar/DeviceCalendarModel.vue
+++ b/src/views/mdc/base/modules/deviceCalendar/DeviceCalendarModel.vue
@@ -15,7 +15,7 @@
           <a-row :gutter="24">
             <a-col :span="24">
               <a-form-item label="鐝埗" :labelCol="labelColLong" :wrapperCol="wrapperColLong">
-                <a-select v-decorator="['monShiftId', validatorRules.monShiftId]" placeholder="璇烽�夋嫨鐝埗"
+                <a-select v-decorator="['shiftId', validatorRules.shiftId]" placeholder="璇烽�夋嫨鐝埗"
                           :allowClear='allowClear'   @change="initShiftSubList">
                   <a-select-option v-for="(em,index) in shiftList" :key="index" :value="em.value">
                     {{ em.label }}
@@ -115,11 +115,18 @@
         },
         confirmLoading: false,        form: this.$form.createForm(this),
         validatorRules: {
-          // shiftId:{
-          //   rules: [{
-          //     required: true, message: '璇烽�夋嫨鐝埗!',
-          //   }],
-          // },
+          equipmentId:{
+            rules:[
+              {
+                required:true,message:'璇烽�夋嫨璁惧缁�!'
+              }
+            ]
+          },
+          shiftId:{
+            rules: [{
+              required: true, message: '璇烽�夋嫨鐝埗!',
+            }],
+          }
         },
         url: {
           add: '/mdc/mdcDeviceCalendar/add',
@@ -300,27 +307,34 @@
           if (!err) {
             that.confirmLoading = true
             let formData = Object.assign(this.model, values)
-
             formData.dateList = this.sendDte
-            postAction(this.url.settingCalendar, formData).then((res) => {
-              if (res.success) {
-                // that.$message.success(res.message)
-                that.$notification.warning({
-                  message:'娑堟伅',
-                  description:res.message
-                });
-                that.$emit('ok', res.result)
-              } else {
-                // that.$message.warning(res.message)
-                that.$notification.warning({
-                  message:'娑堟伅',
-                  description:res.message
-                });
-              }
-            }).finally(() => {
+            if(formData.dateList&&formData.dateList.length>0){
+              postAction(this.url.settingCalendar, formData).then((res) => {
+                if (res.success) {
+                  // that.$message.success(res.message)
+                  that.$notification.success({
+                    message:'娑堟伅',
+                    description:res.message
+                  });
+                  that.$emit('ok', res.result)
+                } else {
+                  // that.$message.warning(res.message)
+                  that.$notification.warning({
+                    message:'娑堟伅',
+                    description:res.message
+                  });
+                }
+              }).finally(() => {
+                that.confirmLoading = false
+                that.close()
+              })
+            }else{
               that.confirmLoading = false
-              that.close()
-            })
+              that.$notification.warning({
+                message:'娑堟伅',
+                description:'璇烽�夋嫨鐢熸晥鏃堕棿!'
+              });
+            }
           }
         })
       },
@@ -418,9 +432,11 @@
     color: #000000;
   }
   /deep/ .mainBox .wh_content_all .wh_content_item .wh_isMark {
-    color: #1890ff;
-    border:1px solid  #1890ff;
-    border-radius: 50%;
+    /*color: #1890ff;*/
+    /*border:1px solid  #1890ff;*/
+    /*border-radius: 50%;*/
+    color: #ffffff;
+    background-color: blue;
   }
   /deep/ .mainBox .wh_content_all .wh_content_item .wh_isToday {
     /*background: #33ad53;*/
@@ -431,60 +447,6 @@
 
 </style>
 
-<!--<style lang="scss">-->
-
-  <!--.mark1 {-->
-    <!--color: white !important;-->
-    <!--background: #1890ff !important;-->
-    <!--border-radius: 50%;-->
-  <!--}-->
-
-  <!--.mainBox {-->
-    <!--.wh_content_all { /*涓讳綋*/-->
-      <!--background-color: #ffffff;-->
-      <!--border: 1px silver solid;-->
-      <!--border-radius: 5px;-->
-      <!--.wh_jiantou1{/*宸︾澶�*/-->
-        <!--border-top: 2px solid #000000;-->
-        <!--border-left: 2px solid #000000;-->
-      <!--}-->
-      <!--.wh_jiantou2{/*鍙崇澶�*/-->
-        <!--border-top: 2px solid #000000;-->
-        <!--border-right: 2px solid #000000;-->
-      <!--}-->
-      <!--.wh_top_changge li { /*褰撳墠骞存湀鏍囬*/-->
-        <!--color: black;-->
-      <!--}-->
-      <!--.wh_content_item {-->
-        <!--margin-top: 5px;-->
-        <!--.wh_top_tag{/*鏄熸湡鏍囬*/-->
-          <!--color: #000000;-->
-        <!--}-->
-        <!--.wh_item_date {/*褰撳墠鏈�*/-->
-          <!--color: #000000;-->
-        <!--}-->
-        <!--.wh_item_date:hover { //鎮诞-->
-          <!--color: #1890ff;-->
-          <!--background: #ffffff;-->
-          <!--border-radius: 50%;-->
-        <!--}-->
-        <!--.wh_other_dayhide { /*涓婃湀鍜屼笅鏈堟椂闂�*/-->
-          <!--color: #bfbfbf;-->
-        <!--}-->
-        <!--.wh_chose_day { //閫変腑-->
-          <!--background: #ffffff;-->
-          <!--color: #000000;-->
-        <!--}-->
-        <!--.wh_isToday { /*褰撳墠澶�*/-->
-          <!--/*background: #33ad53;*/-->
-          <!--background: #ff4d4d;-->
-          <!--color: #ffffff;-->
-        <!--}-->
-      <!--}-->
-
-    <!--}-->
-  <!--}-->
-<!--</style>-->
 
 
 

--
Gitblit v1.9.3