瀏覽代碼

提交代码

陈少旭 1 年之前
父節點
當前提交
1df81cb336
共有 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"
196
       </el-row>
219
       </el-row>
197
     </div>
220
     </div>
198
 
221
 
222
+    <el-dialog
223
+      :title="formTitle"
224
+      :visible.sync="dialogRemindFormVisible"
225
+      width="1000px"
226
+      id="user-inspection-form"
227
+    >
228
+      <el-form :model="form" ref="form" label-position="top">
229
+        <el-row>
230
+          <el-col :span="24">
231
+            <el-form-item label="周期提醒: ">
232
+              <el-radio-group v-model="temp_remind_cycle">
233
+                <el-radio :label="1">一月一次</el-radio>
234
+                <el-radio :label="2">两月一次</el-radio>
235
+                <el-radio :label="3">三月一次</el-radio>
236
+                <el-radio :label="4">半年一次</el-radio>
237
+                <el-radio :label="5">一年一次</el-radio>
238
+              </el-radio-group>
239
+            </el-form-item>
240
+          </el-col>
241
+
242
+          <el-col :span="24">
243
+            <p style="margin-top:20px;">是否弹窗提醒:
244
+              <el-switch v-model="is_open"></el-switch>
245
+            </p>
246
+          </el-col>
247
+        </el-row>
248
+      </el-form>
249
+      <div slot="footer" class="dialog-footer">
250
+        <el-button @click="dialogRemindFormVisible = false">取 消</el-button>
251
+        <el-button
252
+          type="primary"
253
+          @click="submitNewRemind()"
254
+        >保 存
255
+        </el-button
256
+        >
257
+      </div>
258
+    </el-dialog>
259
+
260
+    <el-dialog
261
+      :visible.sync="dialogRemindDialogFormVisible"
262
+      width="1000px"
263
+      id="user-inspection-form"
264
+    >
265
+      <el-col :span="24">
266
+        <p style="margin-top:20px;">是否弹窗提醒:
267
+          <el-switch v-model="is_open"></el-switch>
268
+        </p>
269
+      </el-col>
270
+      <div slot="footer" class="dialog-footer">
271
+        <el-button @click="dialogRemindDialogFormVisible = false">取 消</el-button>
272
+        <el-button
273
+          type="primary"
274
+          @click="submitRemindDialog()"
275
+        >保 存
276
+        </el-button
277
+        >
278
+      </div>
279
+    </el-dialog>
280
+
281
+
282
+
199
     <el-dialog
283
     <el-dialog
200
       :title="formTitle"
284
       :title="formTitle"
201
       :visible.sync="dialogFormVisible"
285
       :visible.sync="dialogFormVisible"
216
               </el-radio-group>
300
               </el-radio-group>
217
             </el-form-item>
301
             </el-form-item>
218
           </el-col>
302
           </el-col>
219
-
220
           <el-col :span="7">
303
           <el-col :span="7">
221
             <el-form-item
304
             <el-form-item
222
               label="检验日期"
305
               label="检验日期"
390
   DeletePatientInspection,
473
   DeletePatientInspection,
391
   EditPatientInspection,
474
   EditPatientInspection,
392
   fetchInspectionReference,
475
   fetchInspectionReference,
393
-  fetchPatientInspections
476
+  fetchPatientInspections,
477
+  setRemind,
478
+  setRemindDialog
394
 } from '@/api/inspection'
479
 } from '@/api/inspection'
395
 import { getFileExtension, uParseTime } from '@/utils/tools'
480
 import { getFileExtension, uParseTime } from '@/utils/tools'
396
 
481
 
399
   components: { PatientSidebar },
484
   components: { PatientSidebar },
400
   data() {
485
   data() {
401
     return {
486
     return {
487
+      temp_remind_cycle:"",
488
+      is_open:false,
489
+      record_id:0,
402
       total: 0,
490
       total: 0,
403
       qiniuDomain: 'https://images.shengws.com/',
491
       qiniuDomain: 'https://images.shengws.com/',
404
       isPic:false,
492
       isPic:false,
414
       },
502
       },
415
       itemName: '请选择项目',
503
       itemName: '请选择项目',
416
       formTitle: '',
504
       formTitle: '',
505
+      dialogRemindFormVisible:false,
506
+      dialogRemindDialogFormVisible:false,
417
       dialogPicFormVisible: false,
507
       dialogPicFormVisible: false,
418
       dialogFormVisible: false,
508
       dialogFormVisible: false,
419
       patient_info: null,
509
       patient_info: null,
579
         })
669
         })
580
         .catch(() => {
670
         .catch(() => {
581
         })
671
         })
582
-    },
583
-    openEdit() {
672
+    },submitRemindDialog(){
673
+      var temp_is_open = 0
674
+      if(this.is_open){
675
+        temp_is_open = 1
676
+      }else{
677
+        temp_is_open = 0
678
+      }
679
+      setRemindDialog(this.record_id,temp_is_open).then(response => {
680
+        if (response.data.state == 0) {
681
+          this.$message.error(response.data.msg)
682
+          return false
683
+        } else {
684
+          this.record_id = response.data.data.config.id
685
+          if(response.data.data.config.is_open == 1){
686
+            this.is_open = true
687
+          }else{
688
+            this.is_open = false
689
+          }
690
+          this.$notify({
691
+            title: '成功',
692
+            message: '设置成功',
693
+            type: 'success',
694
+            duration: 2000
695
+          })
696
+          this.dialogRemindDialogFormVisible = false
697
+        }
698
+      })
699
+    },submitNewRemind(){
700
+      // console.log(this.is_open)
701
+      var params = {
702
+        patient: this.patientID,
703
+        project_id: this.project.project_id,
704
+        remind_cycle: this.temp_remind_cycle
705
+      }
706
+      setRemind(params).then(response => {
707
+        if (response.data.state == 0) {
708
+          this.$message.error(response.data.msg)
709
+          return false
710
+        } else {
711
+          this.$notify({
712
+            title: '成功',
713
+            message: '设置成功',
714
+            type: 'success',
715
+            duration: 2000
716
+          })
717
+          this.dialogRemindFormVisible = false
718
+        }
719
+      })
720
+    }, openEdit() {
584
 
721
 
585
       if (this.project == null) {
722
       if (this.project == null) {
586
         this.$message.error('请先选择项目')
723
         this.$message.error('请先选择项目')
610
         this.form.project_id = this.project.project_id
747
         this.form.project_id = this.project.project_id
611
         this.form.inspect_date = this.itemDate
748
         this.form.inspect_date = this.itemDate
612
         this.form.old_inspect_date = this.itemDate
749
         this.form.old_inspect_date = this.itemDate
613
-        this.form.remind_cycle = this.patient_info.remind_cycle
750
+        if(this.form.project_id == 14) {
751
+          this.form.remind_cycle = this.patient_info.remind_cycle
752
+        }else{
753
+          this.form.remind_cycle =""
754
+        }
614
         console.log(this.form.remind_cycle)
755
         console.log(this.form.remind_cycle)
615
 
756
 
616
         this.form.formItem = []
757
         this.form.formItem = []
633
 
774
 
634
       }
775
       }
635
 
776
 
636
-    }, openPic() {
777
+    },setRemindDialog(){
778
+      this.dialogRemindDialogFormVisible = true
779
+
780
+
781
+    },setRemind(){
782
+      this.dialogRemindFormVisible = true
783
+      // this.temp_remind_cycle = this.
784
+
785
+    },openPic() {
637
       if (this.project == null) {
786
       if (this.project == null) {
638
         this.$message.error('请先选择项目')
787
         this.$message.error('请先选择项目')
639
         return false
788
         return false
644
       this.form.project_id = this.project.project_id
793
       this.form.project_id = this.project.project_id
645
       this.form.imgs=[]
794
       this.form.imgs=[]
646
       this.form.delete_imgs=[]
795
       this.form.delete_imgs=[]
647
-      this.form.remind_cycle = this.patient_info.remind_cycle
796
+      if(this.form.project_id == 14) {
797
+        this.form.remind_cycle = this.patient_info.remind_cycle
798
+      }
648
       var today = new Date()
799
       var today = new Date()
649
       this.form.inspect_date = uParseTime(today, '{y}-{m}-{d} {h}:{i}')
800
       this.form.inspect_date = uParseTime(today, '{y}-{m}-{d} {h}:{i}')
650
       this.form.formItem = []
801
       this.form.formItem = []
681
       this.form.method = 'add'
832
       this.form.method = 'add'
682
       this.formTitle = '新增' + this.project.project_name
833
       this.formTitle = '新增' + this.project.project_name
683
       this.form.project_id = this.project.project_id
834
       this.form.project_id = this.project.project_id
684
-      this.form.remind_cycle = this.patient_info.remind_cycle
835
+      if(this.form.project_id == 14) {
836
+        this.form.remind_cycle = this.patient_info.remind_cycle
837
+      }
838
+      // this.form.remind_cycle = this.patient_info.remind_cycle
685
       var today = new Date()
839
       var today = new Date()
686
       this.form.inspect_date = uParseTime(today, '{y}-{m}-{d} {h}:{i}')
840
       this.form.inspect_date = uParseTime(today, '{y}-{m}-{d} {h}:{i}')
687
       this.form.formItem = []
841
       this.form.formItem = []
1015
             this.projects = reference
1169
             this.projects = reference
1016
             this.patient_info = patient_info
1170
             this.patient_info = patient_info
1017
             this.pageLoading = false
1171
             this.pageLoading = false
1018
-            this.form.remind_cycle = this.patient_info.remind_cycle
1172
+
1173
+            // this.form.remind_cycle = this.patient_info.remind_cycle
1019
           } else {
1174
           } else {
1020
             this.$message.error(response.data.msg)
1175
             this.$message.error(response.data.msg)
1021
             return false
1176
             return false
1065
             var inspections = response.data.data.inspections
1220
             var inspections = response.data.data.inspections
1066
             this.total = response.data.data.total
1221
             this.total = response.data.data.total
1067
             this.itemDate = response.data.data.date
1222
             this.itemDate = response.data.data.date
1223
+            let remind = response.data.data.remind
1224
+
1225
+            let config = response.data.data.config
1226
+            this.record_id = config.id
1227
+            if(config.id > 0){
1228
+
1229
+              if(config.is_open == 1){
1230
+                this.is_open = true
1231
+              }else{
1232
+                this.is_open = false
1233
+
1234
+              }
1235
+            }else{
1236
+              this.is_open = false
1237
+            }
1238
+
1239
+
1240
+            if(remind.id > 0 && remind.remind_cycle > 0){
1241
+              this.temp_remind_cycle = remind.remind_cycle
1242
+            }else{
1243
+              this.temp_remind_cycle = ""
1244
+            }
1245
+
1068
             this.inspections = response.data.data.inspections
1246
             this.inspections = response.data.data.inspections
1069
             if (inspections == null) {
1247
             if (inspections == null) {
1070
               this.inspections = []
1248
               this.inspections = []