Browse Source

日程管理完善

yuansh 2 years ago
parent
commit
b9c469d206
2 changed files with 33 additions and 14 deletions
  1. 30 12
      src/views/oa/my-plan/add/savePlan.vue
  2. 3 2
      src/views/system/modules/SelectUserModal.vue

+ 30 - 12
src/views/oa/my-plan/add/savePlan.vue

@@ -211,17 +211,31 @@ export default {
         getFormInfo (e) {
             console.log('点击日程ID>>', this.formData.planTime)
             this.$nextTick(() => {
-                this.addForm.setFieldsValue({
-                    title: this.formData.title,
-                    planTime: moment(this.formData.planTime, 'HH:mm:ss'),
-                    type: this.formData.type,
-                    degreeOfUrgency: this.formData.degreeOfUrgency,
-                    backgroundColor: this.formData.backgroundColor,
-                    continue: [
-                        moment(this.formData.startTime, 'YYYY/MM/DD HH:mm'),
-                        moment(this.formData.endTime, 'YYYY/MM/DD HH:mm')
-                    ]
-                })
+                if(this.formData.planTime !='' && this.formData.planTime != null){
+                  this.addForm.setFieldsValue({
+                      title: this.formData.title,
+                      planTime: moment(this.formData.planTime, 'YYYY/MM/DD HH:mm:ss'),
+                      type: this.formData.type,
+                      degreeOfUrgency: this.formData.degreeOfUrgency,
+                      backgroundColor: this.formData.backgroundColor,
+                      continue: [
+                          moment(this.formData.startTime, 'YYYY/MM/DD HH:mm'),
+                          moment(this.formData.endTime, 'YYYY/MM/DD HH:mm')
+                      ]
+                  })
+                }else{
+                  this.addForm.setFieldsValue({
+                      title: this.formData.title,
+                      type: this.formData.type,
+                      degreeOfUrgency: this.formData.degreeOfUrgency,
+                      backgroundColor: this.formData.backgroundColor,
+                      continue: [
+                          moment(this.formData.startTime, 'YYYY/MM/DD HH:mm'),
+                          moment(this.formData.endTime, 'YYYY/MM/DD HH:mm')
+                      ]
+                  })
+                }
+                
                 this.$refs.JEditor.myValue = this.formData.memo
                 console.log('走到这')
             })
@@ -237,7 +251,9 @@ export default {
                     scheduleObject.degreeOfUrgency = values.degreeOfUrgency
                     scheduleObject.startTime = values.continue[0].format('YYYY-MM-DD HH:mm:ss')
                     scheduleObject.endTime = values.continue[1].format('YYYY-MM-DD HH:mm:ss')
-                    scheduleObject.planTime = values.planTime.format('YYYY-MM-DD HH:mm:ss')
+                    if(values.planTime != null && values.planTime !=''){
+                      scheduleObject.planTime = values.planTime.format('YYYY-MM-DD HH:mm:ss')
+                    }
                     scheduleObject.backgroundColor = values.backgroundColor
                     scheduleObject.memo = this.$refs.JEditor.myValue
                     // 编辑--------------------------------------------
@@ -249,12 +265,14 @@ export default {
                                 this.$message.success('修改成功')
                                 this.savePlanModalVisible = false
                                 this.addForm.resetFields() // 清空表单
+                                this.formData.id=''
                                 this.$refs.JEditor.myValue = '' // 清空富文本
                                 this.fatherMethod() // 调用父组件的查询方法
                             } else {
                                 this.$message.success('修改成功')
                                 this.savePlanModalVisible = false
                                 this.addForm.resetFields() // 清空表单
+                                this.formData.id=''
                                 this.$refs.JEditor.myValue = '' // 清空富文本
                                 this.calTableMethod() // 调用父组件的查询方法
                             }

+ 3 - 2
src/views/system/modules/SelectUserModal.vue

@@ -22,7 +22,7 @@
             </a-col> -->
             <a-col :span="10">
               <a-form-item label="用户名称">
-                <a-input placeholder="请输入用户名称" v-model="queryParam.realname"></a-input>
+                <j-input placeholder="请输入用户名称" v-model="queryParam.realname"></j-input>
               </a-form-item>
             </a-col>
            <a-col :span="10">
@@ -66,12 +66,13 @@
 </template>
 
 <script>
+  import JInput from '@/components/jeecg/JInput'
   import {filterObj} from '@/utils/util'
   import {getAction} from '@/api/manage'
   import JSearchSelectTag from '@/components/dict/JSearchSelectTag'
   export default {
     name: "SelectUserModal",
-    components: {JSearchSelectTag},
+    components: { JInput,JSearchSelectTag},
     data() {
       return {
         title: "添加已有用户",