linwenxin il y a 9 mois
Parent
commit
8eefa86e5e

+ 17 - 0
src/App.vue

@@ -134,6 +134,7 @@ export default {
     background: #fff !important;
   }
 }
+
 .custom-tree-node {
   .el-input__inner {
     border: none !important;
@@ -141,10 +142,26 @@ export default {
     width: auto !important;
   }
 }
+
 .el-card__header {
   .el-tabs__header {
     margin-bottom: 0;
     overflow: hidden;
   }
 }
+.custom-popper11{
+  width: 370px !important;
+}
+.custom-popper11 .el-picker-panel {
+  max-width: 100vw!important;
+  max-height: 100vh!important;
+  overflow: auto!important;
+  position: fixed!important;
+  z-index: 9999!important;
+}
+
+.el-picker-panel__body-wrapper {
+  max-height: 80vh!important; /* 适当减小高度以避免溢出 */
+  overflow-y: auto!important;
+}
 </style>

+ 76 - 3
src/views/workOrder/workOrderPool/detailModule/workOrderInfo/buttons/processFeedback.vue

@@ -60,6 +60,7 @@ export default {
         imgSrc: [],
         content: '',
         appointmentTime: '',
+        appointmentEndTime: '',
         type: this.resultCode,
         typeText: this.resultCode
       },
@@ -89,27 +90,98 @@ export default {
             }
           }
         },
+        // {
+        //   name: 'el-date-picker',
+        //   md: 12,
+        //   isShow: !!~['预约', '改约'].indexOf(this.formData.type),
+        //   attributes: {
+        //     style: { width: '100%' },
+        //     placeholder: '请选择',
+        //     'value-format': 'yyyy-MM-dd HH:mm:ss',
+        //     'picker-options': {
+        //       disabledDate: time => {
+        //         return time.getTime() < Date.now() - 86400000
+        //       }
+        //     }
+        //   },
+        //   formItemAttributes: {
+        //     label: '预约日期',
+        //     prop: 'appointmentTime',
+        //     rules: [...required]
+        //   }
+        // },
+
+
+
+
+        
+
         {
+          isShow: !!~['预约', '改约'].indexOf(this.formData.type),
           name: 'el-date-picker',
           md: 12,
-          isShow: !!~['预约', '改约'].indexOf(this.formData.type),
           attributes: {
+            "picker-options": "pickerOptions11",
+            "popper-class": "custom-popper11",
+            'append-to-body': true,
             style: { width: '100%' },
+            type: "datetime",
             placeholder: '请选择',
-            'value-format': 'yyyy-MM-dd HH:mm:ss',
+            'value-format': 'yyyy-MM-dd HH:mm',
             'picker-options': {
               disabledDate: time => {
                 return time.getTime() < Date.now() - 86400000
               }
             }
           },
+          events: {
+            change: () => {
+              this.formData.appointmentEndTime = ""
+            }
+          },
           formItemAttributes: {
-            label: '预约日期',
+            label: '预约开始时间',
             prop: 'appointmentTime',
             rules: [...required]
           }
         },
         {
+          isShow: !!~['预约', '改约'].indexOf(this.formData.type),
+          name: 'el-date-picker',
+          md: 12,
+          attributes: {
+            "picker-options": "pickerOptions11",
+            "popper-class": "custom-popper11",
+            'append-to-body': true,
+            style: { width: '100%' },
+            type: "datetime",
+            placeholder: '请选择',
+            'value-format': 'yyyy-MM-dd HH:mm',
+            'picker-options': {
+              disabledDate: time => {
+                var data = this.formData?.appointmentTime?.split(" ")?.[0]
+                return time.getTime() < new Date(data ? `${data} 00:00:00` : "").getTime() || time.getTime() > new Date(data ? `${data} 00:00:00` : "").getTime()
+              },
+            }
+          },
+          events: {
+            change: (value) => {
+              if (value && new Date(value).getTime() < new Date(this.formData?.appointmentTime)) {
+                this.formData.appointmentTime = value
+              }
+            }
+          },
+          formItemAttributes: {
+            label: '预约上门结束时间',
+            prop: 'appointmentEndTime',
+            rules: [...required]
+          }
+        },
+
+
+
+
+        {
           md: 24,
           name: 'el-input',
           attributes: { placeholder: '请输入', type: 'textarea' },
@@ -145,6 +217,7 @@ export default {
         imgSrc: [],
         content: '',
         appointmentTime: '',
+        appointmentEndTime: '',
         type: this.resultCode,
         typeText: this.resultCode
       }

+ 1 - 1
src/views/workOrder/workOrderPool/detailModule/workOrderInfo/index.vue

@@ -25,7 +25,7 @@
         <!-- 基本信息 -->
         <zj-form-module title="基本信息" :form-data="orderInfo" :form-items="basicInfo" />
         <!-- 服务信息 -->
-        <zj-form-module title="服务信息" label-width="110px" :form-data="orderInfo" :form-items="serviceInfo" />
+        <zj-form-module title="服务信息" label-width="130px" :form-data="orderInfo" :form-items="serviceInfo" />
         <!-- 产品信息 -->
         <zj-form-module
           title="产品信息"

+ 44 - 2
src/views/workOrder/workOrderPool/detailModule/workOrderInfo/mixins/serviceInfo.js

@@ -128,23 +128,65 @@ export default {
           name: 'el-date-picker',
           md: 6,
           attributes: {
+            "picker-options": "pickerOptions11",
+            "popper-class": "custom-popper11",
+            'append-to-body': true,
             disabled: !this.formOptions.appointmentTime.isEdit,
             style: { width: '100%' },
+            type: "datetime",
             placeholder: '请选择',
-            'value-format': 'yyyy-MM-dd HH:mm:ss',
+            'value-format': 'yyyy-MM-dd HH:mm',
             'picker-options': {
               disabledDate: time => {
                 return time.getTime() < Date.now() - 86400000
               }
             }
           },
+          events: {
+            change: () => {
+              this.orderInfo.appointmentEndTime = ""
+            }
+          },
           formItemAttributes: {
-            label: '预约上门日期',
+            label: '预约上门开始时间',
             prop: 'appointmentTime',
             rules: this.formOptions.appointmentTime.isRules
           }
         },
         {
+          isShow: this.formOptions.appointmentTime.isShow,
+          name: 'el-date-picker',
+          md: 6,
+          attributes: {
+            "picker-options": "pickerOptions11",
+            "popper-class": "custom-popper11",
+            'append-to-body': true,
+            disabled: !this.formOptions.appointmentTime.isEdit,
+            style: { width: '100%' },
+            type: "datetime",
+            placeholder: '请选择',
+            'value-format': 'yyyy-MM-dd HH:mm',
+            'picker-options': {
+              disabledDate: time => {
+                var data = this.orderInfo?.appointmentTime?.split(" ")?.[0]
+                return time.getTime() < new Date(data ? `${data} 00:00:00` : "").getTime() || time.getTime() > new Date(data ? `${data} 00:00:00` : "").getTime()
+              },
+            }
+          },
+          events: {
+            change: (value) => {
+              if (value && new Date(value).getTime() < new Date(this.orderInfo?.appointmentTime)) {
+                this.orderInfo.appointmentTime = value
+              }
+            }
+          },
+          formItemAttributes: {
+            label: '预约上门结束时间',
+            prop: 'appointmentEndTime',
+            rules: this.formOptions.appointmentTime.isRules
+          }
+        },
+        {
           isShow: this.formOptions.saleType.isShow,
           name: 'el-select',
           md: 6,

+ 3 - 2
src/views/workOrder/workOrderPool/detailModule/workOrderInfo/mixins/workOrderLogic.js

@@ -36,6 +36,7 @@ var initdata_ = {
   orderChannelId: '',
   // 预约上门日期
   appointmentTime: '',
+  appointmentEndTime:'',
   // 销售单位
   saleCompany: '',
   source: '',
@@ -101,7 +102,7 @@ export default {
       },
       deep: true,
       immediate: true
-    }
+    },
   },
   computed: {
     // 用户信息
@@ -330,7 +331,7 @@ export default {
             ...res.data,
             orderWorkers_cp: [...(res.data.orderWorkers || []).map(item => ({ ...item }))],
             orderProducts: res1.data || [],
-            workerId_fz: ''
+            workerId_fz: '',
           }
           cb && cb(this.orderInfo)
         })