瀏覽代碼

提交代码

陈少旭 1 年之前
父節點
當前提交
a9640914e9
共有 1 個文件被更改,包括 187 次插入9 次删除
  1. 187 9
      src/xt_pages/user/inspection.vue

+ 187 - 9
src/xt_pages/user/inspection.vue 查看文件

40
         </el-col>
40
         </el-col>
41
         <el-col :span="17" v-loading="itemLoading">
41
         <el-col :span="17" v-loading="itemLoading">
42
           <div class="filter-container" style="float:right">
42
           <div class="filter-container" style="float:right">
43
+
44
+            <el-button
45
+              size="small"
46
+              class="filter-item"
47
+              type="primary"
48
+              @click="setRemindDialog()"
49
+              v-if="project && project.project_id != 14"
50
+              icon="el-icon-circle-plus-outline"
51
+              :disabled="project ? false : true"
52
+            >设置提醒弹窗
53
+            </el-button>
54
+
55
+            <el-button
56
+              size="small"
57
+              class="filter-item"
58
+              type="primary"
59
+              @click="setRemind()"
60
+              v-if="project && project.project_id != 14"
61
+              icon="el-icon-circle-plus-outline"
62
+              :disabled="project ? false : true"
63
+            >设置提醒周期
64
+            </el-button>
65
+
43
             <el-button
66
             <el-button
44
               size="small"
67
               size="small"
45
               class="filter-item"
68
               class="filter-item"
210
       </el-row>
233
       </el-row>
211
     </div>
234
     </div>
212
 
235
 
236
+    <el-dialog
237
+      :title="formTitle"
238
+      :visible.sync="dialogRemindFormVisible"
239
+      width="1000px"
240
+      id="user-inspection-form"
241
+    >
242
+      <el-form :model="form" ref="form" label-position="top">
243
+        <el-row>
244
+          <el-col :span="24">
245
+            <el-form-item label="周期提醒: ">
246
+              <el-radio-group v-model="temp_remind_cycle">
247
+                <el-radio :label="1">一月一次</el-radio>
248
+                <el-radio :label="2">两月一次</el-radio>
249
+                <el-radio :label="3">三月一次</el-radio>
250
+                <el-radio :label="4">半年一次</el-radio>
251
+                <el-radio :label="5">一年一次</el-radio>
252
+              </el-radio-group>
253
+            </el-form-item>
254
+          </el-col>
255
+
256
+<!--          <el-col :span="24">-->
257
+<!--            <p style="margin-top:20px;">是否弹窗提醒:-->
258
+<!--              <el-switch v-model="is_open"></el-switch>-->
259
+<!--            </p>-->
260
+<!--          </el-col>-->
261
+        </el-row>
262
+      </el-form>
263
+      <div slot="footer" class="dialog-footer">
264
+        <el-button @click="dialogRemindFormVisible = false">取 消</el-button>
265
+        <el-button
266
+          type="primary"
267
+          @click="submitNewRemind()"
268
+        >保 存
269
+        </el-button
270
+        >
271
+      </div>
272
+    </el-dialog>
273
+
274
+    <el-dialog
275
+      :visible.sync="dialogRemindDialogFormVisible"
276
+      width="1000px"
277
+      id="user-inspection-form"
278
+    >
279
+      <el-col :span="24">
280
+        <p style="margin-top:20px;">是否弹窗提醒:
281
+          <el-switch v-model="is_open"></el-switch>
282
+        </p>
283
+      </el-col>
284
+      <div slot="footer" class="dialog-footer">
285
+        <el-button @click="dialogRemindDialogFormVisible = false">取 消</el-button>
286
+        <el-button
287
+          type="primary"
288
+          @click="submitRemindDialog()"
289
+        >保 存
290
+        </el-button
291
+        >
292
+      </div>
293
+    </el-dialog>
294
+
295
+
296
+
213
     <el-dialog
297
     <el-dialog
214
       :title="formTitle"
298
       :title="formTitle"
215
       :visible.sync="dialogFormVisible"
299
       :visible.sync="dialogFormVisible"
410
   DeletePatientInspection,
494
   DeletePatientInspection,
411
   EditPatientInspection,
495
   EditPatientInspection,
412
   fetchInspectionReference,
496
   fetchInspectionReference,
413
-  fetchPatientInspections
497
+  fetchPatientInspections,
498
+  setRemind,
499
+  setRemindDialog
414
 } from '@/api/inspection'
500
 } from '@/api/inspection'
415
 import { getFileExtension, uParseTime } from '@/utils/tools'
501
 import { getFileExtension, uParseTime } from '@/utils/tools'
416
 
502
 
419
   components: { PatientSidebar, ElImageViewer},
505
   components: { PatientSidebar, ElImageViewer},
420
   data() {
506
   data() {
421
     return {
507
     return {
508
+      temp_remind_cycle:"",
509
+      is_open:false,
510
+      record_id:0,
422
       showViewer:false,
511
       showViewer:false,
423
       imgs:[],
512
       imgs:[],
424
       total: 0,
513
       total: 0,
436
       },
525
       },
437
       itemName: '请选择项目',
526
       itemName: '请选择项目',
438
       formTitle: '',
527
       formTitle: '',
528
+      dialogRemindFormVisible:false,
529
+      dialogRemindDialogFormVisible:false,
439
       dialogPicFormVisible: false,
530
       dialogPicFormVisible: false,
440
       dialogFormVisible: false,
531
       dialogFormVisible: false,
441
       patient_info: null,
532
       patient_info: null,
610
         })
701
         })
611
         .catch(() => {
702
         .catch(() => {
612
         })
703
         })
613
-    },
614
-    openEdit() {
704
+    },submitRemindDialog(){
705
+      var temp_is_open = 0
706
+      if(this.is_open){
707
+        temp_is_open = 1
708
+      }else{
709
+        temp_is_open = 0
710
+      }
711
+      setRemindDialog(this.record_id,temp_is_open).then(response => {
712
+        if (response.data.state == 0) {
713
+          this.$message.error(response.data.msg)
714
+          return false
715
+        } else {
716
+          this.record_id = response.data.data.config.id
717
+          if(response.data.data.config.is_open == 1){
718
+            this.is_open = true
719
+          }else{
720
+            this.is_open = false
721
+          }
722
+          this.$notify({
723
+            title: '成功',
724
+            message: '设置成功',
725
+            type: 'success',
726
+            duration: 2000
727
+          })
728
+          this.dialogRemindDialogFormVisible = false
729
+        }
730
+      })
731
+    },submitNewRemind(){
732
+      // console.log(this.is_open)
733
+      var params = {
734
+        patient: this.patientID,
735
+        project_id: this.project.project_id,
736
+        remind_cycle: this.temp_remind_cycle
737
+      }
738
+      setRemind(params).then(response => {
739
+        if (response.data.state == 0) {
740
+          this.$message.error(response.data.msg)
741
+          return false
742
+        } else {
743
+          this.$notify({
744
+            title: '成功',
745
+            message: '设置成功',
746
+            type: 'success',
747
+            duration: 2000
748
+          })
749
+          this.dialogRemindFormVisible = false
750
+        }
751
+      })
752
+    }, openEdit() {
615
 
753
 
616
       if (this.project == null) {
754
       if (this.project == null) {
617
         this.$message.error('请先选择项目')
755
         this.$message.error('请先选择项目')
641
         this.form.project_id = this.project.project_id
779
         this.form.project_id = this.project.project_id
642
         this.form.inspect_date = this.itemDate
780
         this.form.inspect_date = this.itemDate
643
         this.form.old_inspect_date = this.itemDate
781
         this.form.old_inspect_date = this.itemDate
644
-        this.form.remind_cycle = this.patient_info.remind_cycle
782
+        if(this.form.project_id == 14) {
783
+          this.form.remind_cycle = this.patient_info.remind_cycle
784
+        }else{
785
+          this.form.remind_cycle =""
786
+        }
645
         console.log(this.form.remind_cycle)
787
         console.log(this.form.remind_cycle)
646
 
788
 
647
         this.form.formItem = []
789
         this.form.formItem = []
664
 
806
 
665
       }
807
       }
666
 
808
 
667
-    },
668
-    openPic() {
809
+    },setRemindDialog(){
810
+      this.dialogRemindDialogFormVisible = true
811
+
812
+
813
+    },setRemind(){
814
+      this.dialogRemindFormVisible = true
815
+      // this.temp_remind_cycle = this.
816
+
817
+    },openPic() {
669
       if (this.project == null) {
818
       if (this.project == null) {
670
         this.$message.error('请先选择项目')
819
         this.$message.error('请先选择项目')
671
         return false
820
         return false
676
       this.form.project_id = this.project.project_id
825
       this.form.project_id = this.project.project_id
677
       this.form.imgs=[]
826
       this.form.imgs=[]
678
       this.form.delete_imgs=[]
827
       this.form.delete_imgs=[]
679
-      this.form.remind_cycle = this.patient_info.remind_cycle
828
+      if(this.form.project_id == 14) {
829
+        this.form.remind_cycle = this.patient_info.remind_cycle
830
+      }
680
       var today = new Date()
831
       var today = new Date()
681
       this.form.inspect_date = uParseTime(today, '{y}-{m}-{d} {h}:{i}')
832
       this.form.inspect_date = uParseTime(today, '{y}-{m}-{d} {h}:{i}')
682
       this.form.formItem = []
833
       this.form.formItem = []
713
       this.form.method = 'add'
864
       this.form.method = 'add'
714
       this.formTitle = '新增' + this.project.project_name
865
       this.formTitle = '新增' + this.project.project_name
715
       this.form.project_id = this.project.project_id
866
       this.form.project_id = this.project.project_id
716
-      this.form.remind_cycle = this.patient_info.remind_cycle
867
+      if(this.form.project_id == 14) {
868
+        this.form.remind_cycle = this.patient_info.remind_cycle
869
+      }
870
+      // this.form.remind_cycle = this.patient_info.remind_cycle
717
       var today = new Date()
871
       var today = new Date()
718
       this.form.inspect_date = uParseTime(today, '{y}-{m}-{d} {h}:{i}')
872
       this.form.inspect_date = uParseTime(today, '{y}-{m}-{d} {h}:{i}')
719
       this.form.formItem = []
873
       this.form.formItem = []
1049
             this.projects = reference
1203
             this.projects = reference
1050
             this.patient_info = patient_info
1204
             this.patient_info = patient_info
1051
             this.pageLoading = false
1205
             this.pageLoading = false
1052
-            this.form.remind_cycle = this.patient_info.remind_cycle
1206
+
1207
+            // this.form.remind_cycle = this.patient_info.remind_cycle
1053
           } else {
1208
           } else {
1054
             this.$message.error(response.data.msg)
1209
             this.$message.error(response.data.msg)
1055
             return false
1210
             return false
1099
             var inspections = response.data.data.inspections
1254
             var inspections = response.data.data.inspections
1100
             this.total = response.data.data.total
1255
             this.total = response.data.data.total
1101
             this.itemDate = response.data.data.date
1256
             this.itemDate = response.data.data.date
1257
+            let remind = response.data.data.remind
1258
+
1259
+            let config = response.data.data.config
1260
+            this.record_id = config.id
1261
+            if(config.id > 0){
1262
+
1263
+              if(config.is_open == 1){
1264
+                this.is_open = true
1265
+              }else{
1266
+                this.is_open = false
1267
+
1268
+              }
1269
+            }else{
1270
+              this.is_open = false
1271
+            }
1272
+
1273
+
1274
+            if(remind.id > 0 && remind.remind_cycle > 0){
1275
+              this.temp_remind_cycle = remind.remind_cycle
1276
+            }else{
1277
+              this.temp_remind_cycle = ""
1278
+            }
1279
+
1102
             this.inspections = response.data.data.inspections
1280
             this.inspections = response.data.data.inspections
1103
             if (inspections == null) {
1281
             if (inspections == null) {
1104
               this.inspections = []
1282
               this.inspections = []