瀏覽代碼

日程修改

安生 4 年之前
父節點
當前提交
c6e6878293
共有 3 個文件被更改,包括 119 次插入14 次删除
  1. 20 1
      src/api/officework/index.js
  2. 0 1
      src/components/ChatLog/ChatLog.vue
  3. 99 12
      src/views/system/officework/schedule/schedule.vue

+ 20 - 1
src/api/officework/index.js

@@ -8,7 +8,14 @@ export function addRemindEvents(query) {
     params: query
   })
 }
-
+//修改
+export function updatarichen(query) {
+  return request({
+    url: '/remindEvents/edit',
+    method: 'post',
+    data: query
+  })
+}
 //查询
 export function selectList(query) {
   return request({
@@ -26,3 +33,15 @@ export function delSchenule(defId) {
     data: defId
   })
 }
+
+//查询
+export function findList(defId) {
+  return request({
+    url: '/remindEvents/Getid/'+defId,
+    method: 'get',
+    // responseType: 'blob',
+    data: defId
+  })
+}
+
+

+ 0 - 1
src/components/ChatLog/ChatLog.vue

@@ -78,7 +78,6 @@
         // let history = deepCopy(this.history)
         const self = this
         getChatlog(self.mine.id).then(function (response) {
-          debugger
           let history =response.data
           history.records.forEach(item => {
             item.mine = item.sender == self.mine.id.toString()

+ 99 - 12
src/views/system/officework/schedule/schedule.vue

@@ -1,13 +1,15 @@
 <template>
-  <div class="app-container">
-    <FullCalendar defaultView="dayGridMonth" :options="calendarOptions" locale="zh-cn" firstDay="1" weekNumberCalculation="ISO"
+  <div class="app-container" v-if="isReloadData">
+    <FullCalendar v-loading="loading" defaultView="dayGridMonth" :options="calendarOptions" locale="zh-cn" firstDay="1" weekNumberCalculation="ISO"
                   showNonCurrentDates="false"
                   :eventTimeFormat="evnetTime"
                   :header="header"
+                  :lang="lang"
                   :buttonText="buttonText"
                   @dateClick="handleDateClick"
                   @eventClick="handleEventClick"
     />
+<!--    添加日程-->
     <el-dialog  :visible.sync="schedule"  title="添加日程" append-to-body width="40%" @click="close">
       <el-row :gutter="12">
         <el-form ref="elForm" :model="formData" :rules="rules" size="medium" label-width="100px">
@@ -52,14 +54,61 @@
         <el-button type="primary"   @click="submit()">确定</el-button>
       </div>
     </el-dialog>
+<!--    编辑日程-->
+    <el-dialog  :visible.sync="schedule1"  title="编辑日程" append-to-body width="40%" >
+      <el-row :gutter="12">
+        <el-form ref="elForm" :model="formData" :rules="rules" size="medium" label-width="100px">
+          <el-col :span="24">
+            <el-form-item label="开始时间" prop="field101">
+              <el-date-picker
+                v-model="formData.start"
+                type="datetime"
+                :style="{width: '100%'}"
+                placeholder="选择日期时间">
+              </el-date-picker>
+            </el-form-item>
+          </el-col>
+
+          <el-col :span="24">
+            <el-form-item label="结束时间" prop="field101">
+              <el-date-picker
+                v-model="formData.finish"
+                type="datetime"
+                :style="{width: '100%'}"
+                placeholder="选择日期时间">
+              </el-date-picker>
+            </el-form-item>
+          </el-col>
+
+          <el-col :span="24">
+            <el-form-item label="提前提醒" prop="field108">
+              <el-input v-model="formData.hour" placeholder="小时提醒我" clearable :style="{width: '100%'}">
+              </el-input>
+            </el-form-item>
+          </el-col>
+          <el-col :span="24">
+            <el-form-item label="日程内容" prop="field109">
+              <el-input v-model="formData.incident" type="textarea" placeholder="记录你将要做的一件事"
+                        :autosize="{minRows: 4, maxRows: 4}" :style="{width: '100%'}"></el-input>
+            </el-form-item>
+          </el-col>
+        </el-form>
+      </el-row>
+      <div slot="footer">
+        <el-button @click="schedule1 = false">取消</el-button>
+        <el-button type="primary"   @click="updatarc()">修改</el-button>
+        <el-button type="danger" @click="deletrichen()">删除</el-button>
+      </div>
+    </el-dialog>
   </div>
   </template>
 <script>
-  import { addRemindEvents,selectList,delSchenule} from "@/api/officework/index";
+  import { addRemindEvents,selectList,delSchenule,findList,updatarichen} from "@/api/officework/index";
   import FullCalendar from '@fullcalendar/vue'
   import dayGridPlugin from '@fullcalendar/daygrid'
   import interactionPlugin from '@fullcalendar/interaction'
   import '@fullcalendar/core/main.css';
+  import '@fullcalendar/core/locales/zh-cn.js'
   import { formatDate } from '@fullcalendar/vue';
 
   let str = formatDate(new Date(), {
@@ -78,13 +127,17 @@
     },
         data(){
             return {
+              isReloadData: true,
+              loading:true,
               dialogVisible:false,
               qqq:'',
               kaishi:'',
               jieshu:'',
               eveid:'',
               schedule: false,
+              schedule1:false,
               formData: {
+                id:"",
                 start: null,
                 field105: null,
                 finish: null,
@@ -154,10 +207,30 @@
       this.toList();
     },
      methods:{
+       //修改日程
+       updatarc(){
+
+         updatarichen(this.formData).then(response => {
+           if (response.code === 200) {
+             this.msgSuccess("修改成功");
+             this.schedule=false;
+             this.toList();
+           }
+         });
+         this.resetForm();
+
+
+       },
+       reload() {
+         this.isReloadData = false;
+         this.$nextTick(() => {
+           this.isReloadData = true;
+         });
+       },
       toList (){
+        this.loading = true;
         selectList(this.formData).then(response => {
           console.log(response.rows)
-
           for(var i = 0; i < response.rows.length;i++){
             this.calendarOptions.events.push({ // add new event data
               title: response.rows[i].incident,
@@ -167,6 +240,7 @@
               // allDay: arg.allDay
             });
           }
+          this.loading = false;
 
           // this.toList();
           console.log( this.calendarOptions.events)
@@ -200,7 +274,18 @@
             // alert('日程安排为:' + info.event.title);
             // console.log(info.event)
             this.eveid = info.event._def.extendedProps.defId
-            this.deletrichen();
+
+            this.schedule1 = true;
+            // this.updatarc();
+            let defId = this.eveid;
+            var formdata = new FormData;
+            formdata.append('id', defId)
+            findList(defId).then(response =>{
+              console.log(response.rows[0])
+              this.formData= response.rows[0];
+
+            });
+            // this.deletrichen();
             //alert('Coordinates: ' + info.jsEvent.pageX + ',' + info.jsEvent.pageY);
             //alert('View: ' + info.view.type);
 
@@ -220,21 +305,23 @@
           },
           //删除日程
           deletrichen(){
-        let defId = this.eveid;
+            let defId = this.eveid;
+            var formdata = new FormData
+            formdata.append('id', defId)
             this.$confirm('是否确认删除日程?', "警告", {
-              confirmButtonText: "确定",
-              cancelButtonText: "取消",
-              type: "warning"
+              confirmButtonText: '确定',
+              cancelButtonText: '取消',
+              type: 'warning'
             }).then(function() {
-              var formdata = new FormData
-              formdata.append('id', defId)
               return delSchenule(formdata);
             }).then(() => {
-              this.toList();
+              this.reload();
               this.msgSuccess("删除成功");
+              this.schedule1 = false;
             }).catch(function() {});
 
 
+
           },
           resetForm() {
             this.formData=[];