Browse Source

bug更新

XMLWAN 4 years ago
parent
commit
8c6e387aa4

+ 1 - 0
src/api/manage.js View File

@@ -70,6 +70,7 @@ export function getMachineDetailById(id, params) {
70 70
 }
71 71
 
72 72
 export function UpdateMachineInfo(data) {
73
+  console.log('data', data)
73 74
   return request({
74 75
     url: '/api/management/updatemachineinfo',
75 76
     method: 'Post',

+ 2 - 2
src/xt_pages/management/components/EditMachineForm.vue View File

@@ -224,7 +224,7 @@ export default {
224 224
       getAllEquimentName().then(response => {
225 225
         if (response.data.state === 1) {
226 226
           var equit = response.data.data.equit;
227
-          console.log("equit", equit);
227
+          //console.log("equit", equit);
228 228
           this.DeviceType = equit;
229 229
         }
230 230
       });
@@ -238,7 +238,7 @@ export default {
238 238
   },
239 239
   created() {
240 240
     this.getAllEquimentName();
241
-    console.log("planid是什么东西===========================", this.newPlanid);
241
+   // console.log("planid是什么东西===========================", this.newPlanid);
242 242
     this.getEditMachine(this.planid);
243 243
   },
244 244
   mounted() {

+ 30 - 29
src/xt_pages/management/components/ManageForm.vue View File

@@ -44,9 +44,9 @@
44 44
               <el-select style="width:135px" v-model="form.bed_number">
45 45
                 <el-option
46 46
                   v-for="item in this.bedNumber"
47
-                  :key="item.id"
48
-                  :label="item.number"
49
-                  :value="item.id"
47
+                  :key="item.bed_id"
48
+                  :label="item.bed_number"
49
+                  :value="item.bed_id"
50 50
                 ></el-option>
51 51
               </el-select>
52 52
             </el-form-item>
@@ -319,7 +319,7 @@
319 319
 </template>
320 320
 
321 321
 <script>
322
-import { getAllSubregion, SaveManageInfo,SaveManageInfoTwo } from '@/api/manage'
322
+import { getAllSubregion, SaveManageInfo, SaveManageInfoTwo } from '@/api/manage'
323 323
 const treatmentmodes = [
324 324
   'HD',
325 325
   'HDF',
@@ -425,7 +425,7 @@ export default {
425 425
       bedShowTwo: false,
426 426
       disa: true,
427 427
       buttonShow: true,
428
-      buttonShowTwo: false,
428
+      buttonShowTwo: false
429 429
     }
430 430
   },
431 431
   methods: {
@@ -449,10 +449,11 @@ export default {
449 449
           this.deviceType = zones
450 450
           var numbers = response.data.data.numbers
451 451
           var devicenumber = response.data.data.devicenumber
452
-          var device = [{ id: 0, number: '请选择' }]
452
+          // console.log('devicenumber$', devicenumber)
453
+          var device = [{ bed_id: 0, bed_number: '请选择' }]
453 454
           for (let index = 0; index < devicenumber.length; index++) {
454 455
             const item = devicenumber[index]
455
-            device.push({ id: item.id, number: item.number })
456
+            device.push({ bed_id: item.bed_id, bed_number: item.bed_number })
456 457
           }
457 458
           this.bedNumber = device
458 459
         }
@@ -551,7 +552,7 @@ export default {
551 552
         }
552 553
         arr1.push(obj.id)
553 554
       })
554
-      console.log('arrr1', arr1)
555
+      // console.log('arrr1', arr1)
555 556
       this.form.treat_type = arr1
556 557
 
557 558
       var device_type = this.form.device_type
@@ -594,20 +595,20 @@ export default {
594 595
               var addmacher = response.data.data.addmacher
595 596
               this.dialogVisible = false
596 597
               this.$message.success('保存成功')
597
-              this.form.bed_number = ""
598
-              this.form.serial_number = ""
599
-              this.form.device_name = ""
600
-              this.form.manufacture_factory = ""
601
-              this.form.service_manufacturer = ""
602
-              this.form.use_section = ""
603
-              this.form.section_number = ""
604
-              this.form.maintenance_engineer=""
605
-              this.form.telephone = ""
606
-              this.form.user_total = ""
607
-              this.form.remarks = ""
608
-              this.form.user_year = ""
609
-              this.form.work_time = ""
610
-              this.form.unit_type =""
598
+              this.form.bed_number = ''
599
+              this.form.serial_number = ''
600
+              this.form.device_name = ''
601
+              this.form.manufacture_factory = ''
602
+              this.form.service_manufacturer = ''
603
+              this.form.use_section = ''
604
+              this.form.section_number = ''
605
+              this.form.maintenance_engineer = ''
606
+              this.form.telephone = ''
607
+              this.form.user_total = ''
608
+              this.form.remarks = ''
609
+              this.form.user_year = ''
610
+              this.form.work_time = ''
611
+              this.form.unit_type = ''
611 612
               this.getAllSubregion()
612 613
               this.$emit('getAllMachineInfo')
613 614
               this.$forceUpdate()
@@ -618,7 +619,7 @@ export default {
618 619
         }
619 620
       })
620 621
     },
621
-    SaveManageInfoTwo(formName){
622
+    SaveManageInfoTwo(formName) {
622 623
       var device_type = this.form.device_type
623 624
       var device_types = parseInt(device_type)
624 625
       this.form.device_type = device_types
@@ -640,7 +641,7 @@ export default {
640 641
       var revers_mode = this.form.revers_mode
641 642
       var revers_modes = parseInt(revers_mode)
642 643
       this.form.revers_mode = revers_modes
643
-       
644
+
644 645
       if (this.form.Disinfection_mode === '') {
645 646
         this.form.Disinfection_mode = 0
646 647
       }
@@ -648,12 +649,12 @@ export default {
648 649
       var disinfecction_modess = parseInt(disinfecction_modes)
649 650
       this.form.Disinfection_mode = disinfecction_modess
650 651
 
651
-      this.$refs[formName].validate(valid=>{
652
-        if(valid){
653
-          SaveManageInfoTwo(this.form).then(response=>{
654
-            if(response.data.state === 1){
652
+      this.$refs[formName].validate(valid => {
653
+        if (valid) {
654
+          SaveManageInfoTwo(this.form).then(response => {
655
+            if (response.data.state === 1) {
655 656
               var add = response.data.data.addmacher
656
-              console.log("add",add)
657
+              console.log('add', add)
657 658
               this.dialogVisible = false
658 659
               this.$message.success('保存成功')
659 660
               this.getAllSubregion()

+ 2 - 2
src/xt_pages/management/components/MultipleForm.vue View File

@@ -351,7 +351,7 @@ export default {
351 351
             numbers.push({ id: item.id, number: item.number })
352 352
           }
353 353
           this.Numbers = numbers
354
-          console.log('numbers', number)
354
+         // console.log('numbers', number)
355 355
         }
356 356
       })
357 357
     },
@@ -407,7 +407,7 @@ export default {
407 407
               macher[index].rubbish_reason = ''
408 408
             }
409 409
           }
410
-          console.log('macher', macher)
410
+         // console.log('macher', macher)
411 411
           this.tableData = macher
412 412
         }
413 413
       })

+ 37 - 37
src/xt_pages/management/components/PlanForm.vue View File

@@ -137,7 +137,7 @@
137 137
 </template>
138 138
 
139 139
 <script>
140
-import { getAllEquimentName, savePlan, getAllEquitType } from '@/api/manage';
140
+import { getAllEquimentName, savePlan, getAllEquitType } from '@/api/manage'
141 141
 export default {
142 142
   name: 'PlanForm',
143 143
   props: {
@@ -212,74 +212,74 @@ export default {
212 212
       DeviceType: [],
213 213
       planid: 0,
214 214
       plandata: 0
215
-    };
215
+    }
216 216
   },
217 217
   methods: {
218 218
     open: function() {
219
-      this.dialogVisible = true;
219
+      this.dialogVisible = true
220 220
     },
221 221
     getAllEquimentName() {
222 222
       getAllEquimentName().then(response => {
223 223
         if (response.data.state === 1) {
224
-          var equit = response.data.data.equit;
225
-          console.log('equit', equit);
224
+          var equit = response.data.data.equit
225
+          // console.log('equit', equit);
226 226
           // this.DeviceType = equit;
227 227
         }
228
-      });
228
+      })
229 229
     },
230 230
     savePlan(formName) {
231
-      var equimentid = this.equimentid;
232
-      console.log('equimentid', equimentid);
233
-      var devicetype = this.form.device_type;
234
-      var devicetypes = parseInt(devicetype);
235
-      this.form.device_type = devicetypes;
231
+      var equimentid = this.equimentid
232
+      // console.log('equimentid', equimentid);
233
+      var devicetype = this.form.device_type
234
+      var devicetypes = parseInt(devicetype)
235
+      this.form.device_type = devicetypes
236 236
 
237
-      var ways = this.form.way;
238
-      var way = parseInt(ways);
239
-      this.form.way = way;
237
+      var ways = this.form.way
238
+      var way = parseInt(ways)
239
+      this.form.way = way
240 240
 
241
-      var machinedisinfectant = this.form.machine_disinfectant;
242
-      var machinedisinfectants = parseInt(machinedisinfectant);
243
-      this.form.machine_disinfectant = machinedisinfectants;
241
+      var machinedisinfectant = this.form.machine_disinfectant
242
+      var machinedisinfectants = parseInt(machinedisinfectant)
243
+      this.form.machine_disinfectant = machinedisinfectants
244 244
 
245
-      var disinfectantways = this.form.disinfectant_way;
246
-      var disinfectantway = parseInt(disinfectantways);
247
-      this.form.disinfectant_way = disinfectantway;
245
+      var disinfectantways = this.form.disinfectant_way
246
+      var disinfectantway = parseInt(disinfectantways)
247
+      this.form.disinfectant_way = disinfectantway
248 248
 
249
-      var disinfectants = this.form.disinfectant;
250
-      var disinfectant = parseInt(disinfectants);
251
-      this.form.disinfectant = disinfectant;
249
+      var disinfectants = this.form.disinfectant
250
+      var disinfectant = parseInt(disinfectants)
251
+      this.form.disinfectant = disinfectant
252 252
       savePlan(this.form, this.equimentid).then(response => {
253 253
         if (response.data.state === 1) {
254
-          var msg = response.data.data.msg;
255
-          console.log('msg', msg);
256
-          this.$message.success('保存成功');
257
-          this.dialogVisible = false;
258
-          this.$emit('getAllPlan');
259
-          this.$emit('getAllPlanDetail');
254
+          var msg = response.data.data.msg
255
+          // console.log('msg', msg);
256
+          this.$message.success('保存成功')
257
+          this.dialogVisible = false
258
+          this.$emit('getAllPlan')
259
+          this.$emit('getAllPlanDetail')
260 260
           // 如果保存成功通过状态值改变父组键表格的值
261
-          this.plandata = 1;
262
-          this.$emit('func', this.plandata);
261
+          this.plandata = 1
262
+          this.$emit('func', this.plandata)
263 263
         } else {
264
-          this.$message.error('该消毒计划已存在');
264
+          this.$message.error('该消毒计划已存在')
265 265
         }
266
-      });
266
+      })
267 267
     },
268 268
     getAllEquitType() {
269 269
       getAllEquitType().then(response => {
270 270
         if (response.data.state === 1) {
271 271
           var equitname = response.data.data.equitname
272
-          console.log('equitname=============', equitname)
272
+          // console.log('equitname=============', equitname)
273 273
           this.DeviceType = equitname
274 274
         }
275 275
       })
276 276
     }
277 277
   },
278 278
   created() {
279
-    this.getAllEquimentName();
280
-    this.getAllEquitType();
279
+    this.getAllEquimentName()
280
+    this.getAllEquitType()
281 281
   }
282
-};
282
+}
283 283
 </script>
284 284
 
285 285
 <style scoped></style>

+ 9 - 9
src/xt_pages/management/components/QualityForm.vue View File

@@ -788,7 +788,7 @@ export default {
788 788
       getAllQulityInfo().then(response => {
789 789
         if (response.data.state === 1) {
790 790
           var cultures = response.data.data.cultures
791
-          console.log('cultures', cultures)
791
+         // console.log('cultures', cultures)
792 792
 
793 793
           for (let index = 0; index < cultures.length; index++) {
794 794
             if (cultures[index].specimen === 0) {
@@ -829,7 +829,7 @@ export default {
829 829
           }
830 830
           this.tableData = cultures
831 831
           var dialyste = response.data.data.dialysate
832
-          console.log('dialyste', dialyste)
832
+          //console.log('dialyste', dialyste)
833 833
           for (let index = 0; index < dialyste.length; index++) {
834 834
             if (dialyste[index].specimenb === 0) {
835 835
               dialyste[index].specimenb = ''
@@ -869,7 +869,7 @@ export default {
869 869
           }
870 870
           this.table = dialyste
871 871
           var ions = response.data.data.ions
872
-          console.log('ions', ions)
872
+          //console.log('ions', ions)
873 873
           this.tableDatas = ions
874 874
         }
875 875
       })
@@ -977,9 +977,9 @@ export default {
977 977
         if (response.data.state === 1) {
978 978
           var culture = response.data.data.culture
979 979
 
980
-          console.log('禁用', culture)
980
+          //console.log('禁用', culture)
981 981
           var role = response.data.data.role
982
-          console.log('role', role)
982
+         // console.log('role', role)
983 983
           this.form.id = culture.id
984 984
           // eslint-disable-next-line no-undef
985 985
           this.form.date = this.getTime(culture.speling_date)
@@ -1097,7 +1097,7 @@ export default {
1097 1097
       EditDialyState(id).then(response => {
1098 1098
         if (response.data.state === 1) {
1099 1099
           var dialysate = response.data.data.dialysate
1100
-          console.log('dialysate', dialysate)
1100
+          //console.log('dialysate', dialysate)
1101 1101
           this.diaForm.id = dialysate.id
1102 1102
           // eslint-disable-next-line no-undef
1103 1103
           this.diaForm.sampling_date = this.getTime(dialysate.sampling_date)
@@ -1145,7 +1145,7 @@ export default {
1145 1145
           UpdateDialyState(this.diaForm).then(response => {
1146 1146
             if (response.data.state === 1) {
1147 1147
               var dialyste = response.data.data.dialysate
1148
-              console.log('dialyste', dialyste)
1148
+              //console.log('dialyste', dialyste)
1149 1149
               this.dialogVisibleTwo = false
1150 1150
               this.$message.success('修改成功')
1151 1151
               this.getAllQulityInfo()
@@ -1214,7 +1214,7 @@ export default {
1214 1214
       EditIon(id).then(response => {
1215 1215
         if (response.data.state === 1) {
1216 1216
           var ion = response.data.data.ion
1217
-          console.log('ion', ion)
1217
+         // console.log('ion', ion)
1218 1218
           // eslint-disable-next-line no-undef
1219 1219
           this.ionForm.dateb = this.getTime(ion.sampling_date)
1220 1220
           this.ionForm.samplerc = ion.samplerc
@@ -1243,7 +1243,7 @@ export default {
1243 1243
           UpdateIon(this.ionForm).then(response => {
1244 1244
             if (response.data.state === 1) {
1245 1245
               var ion = response.data.data.ion
1246
-              console.log('ion', ion)
1246
+             // console.log('ion', ion)
1247 1247
               this.dialogVisibleThree = false
1248 1248
               this.$message.success('修改成功')
1249 1249
               this.getAllQulityInfo()

+ 1 - 1
src/xt_pages/management/components/RemanderForm.vue View File

@@ -67,7 +67,7 @@ export default {
67 67
         // eslint-disable-next-line eqeqeq
68 68
         if (response.data.state == 1) {
69 69
           var remander = response.data.data.remander
70
-          console.log('remander=================小夏', remander)
70
+          //console.log('remander=================小夏', remander)
71 71
           this.randerform.run = remander.is_run
72 72
         }
73 73
       });

+ 5 - 5
src/xt_pages/management/components/RepairForm.vue View File

@@ -501,7 +501,7 @@ export default {
501 501
       getAllRepair(this.limit, this.page).then(response => {
502 502
         if (response.data.state === 1) {
503 503
           var repair = response.data.data.repair
504
-          console.log('repair是', repair)
504
+          // console.log('repair是', repair)
505 505
           // eslint-disable-next-line no-unused-vars
506 506
           var total = response.data.data.total
507 507
           this.total = total
@@ -551,10 +551,10 @@ export default {
551 551
       return uParseTime(time, '{y}-{m}-{d} {h}:{i}')
552 552
     },
553 553
     handleExceed(file) {
554
-      console.log(file)
554
+      // console.log(file)
555 555
     },
556 556
     handlePreview(file) {
557
-      console.log(file)
557
+      // console.log(file)
558 558
     },
559 559
     EditRepair(id) {
560 560
       this.dialogVisible = true
@@ -597,8 +597,8 @@ export default {
597 597
     beforeUploadFile(file) {
598 598
       const isLt2M = file.size / 1024 / 1024 <= 2048
599 599
       console.log('filename', file)
600
-      console.log('视频大小', file.size / 1024 / 1024)
601
-      console.log('isLt2M是什么', isLt2M)
600
+      // console.log('视频大小', file.size / 1024 / 1024)
601
+      // console.log('isLt2M是什么', isLt2M)
602 602
 
603 603
       if (!isLt2M) {
604 604
         this.$message.error('上传视频大小不能超过 2G!')

+ 8 - 8
src/xt_pages/management/components/UserForm.vue View File

@@ -1198,9 +1198,9 @@ export default {
1198 1198
       EditUser(id, patientid).then(response => {
1199 1199
         if (response.data.state === 1) {
1200 1200
           var device = response.data.data.device
1201
-          console.log('device', device)
1201
+         // console.log('device', device)
1202 1202
           var patients = response.data.data.patients
1203
-          console.log('patients', patients)
1203
+         // console.log('patients', patients)
1204 1204
           // eslint-disable-next-line no-sequences
1205 1205
           this.userform.id = device.id,
1206 1206
           this.userform.spling_date = uParseTime(
@@ -1621,7 +1621,7 @@ export default {
1621 1621
               information[index].clean = ''
1622 1622
             }
1623 1623
           }
1624
-          console.log('消毒时间', information)
1624
+          //console.log('消毒时间', information)
1625 1625
           this.tableData = information
1626 1626
           var total = response.data.data.total
1627 1627
           this.total = total
@@ -1666,7 +1666,7 @@ export default {
1666 1666
       getUserForm(id, this.limit, this.page).then(response => {
1667 1667
         if (response.data.state === 1) {
1668 1668
           var information = response.data.data.information
1669
-          console.log('information====================', information)
1669
+          //console.log('information====================', information)
1670 1670
           // eslint-disable-next-line no-unused-vars
1671 1671
           var addmacher = response.data.data.addmacher
1672 1672
           // console.log('addmacher', addmacher)
@@ -1909,9 +1909,9 @@ export default {
1909 1909
       getBedForm(id).then(response => {
1910 1910
         if (response.data.state === 1) {
1911 1911
           var addmacher = response.data.data.addmacher
1912
-          console.log('addmacher=============', addmacher)
1912
+         // console.log('addmacher=============', addmacher)
1913 1913
           var number = response.data.data.number
1914
-          console.log('number', number)
1914
+          //console.log('number', number)
1915 1915
           this.form.zone = addmacher.zone_id
1916 1916
           this.form.bed = addmacher.bed_id
1917 1917
 
@@ -1956,7 +1956,7 @@ export default {
1956 1956
         // eslint-disable-next-line eqeqeq
1957 1957
         if (response.data.state == 1) {
1958 1958
           var patient = response.data.data.patient
1959
-          console.log('patient', patient)
1959
+         // console.log('patient', patient)
1960 1960
           // eslint-disable-next-line no-undef
1961 1961
           if (patient.is_infectious === 0) {
1962 1962
             this.userform.contagion = ''
@@ -1977,7 +1977,7 @@ export default {
1977 1977
       changeBed(id).then(response => {
1978 1978
         if (response.data.state === 1) {
1979 1979
           var bed = response.data.data.bed
1980
-          console.log('bed', bed)
1980
+         // console.log('bed', bed)
1981 1981
           // eslint-disable-next-line no-sequences
1982 1982
           this.form.bed = '',
1983 1983
           this.bedNumberTwo = bed

+ 55 - 48
src/xt_pages/management/home.vue View File

@@ -59,9 +59,10 @@
59 59
                        prop="date"
60 60
                        label="设备名称"
61 61
                       width="90"
62
-                      align="center">
62
+                      align="center"
63
+                      >
63 64
                       <template slot-scope="scope">
64
-                          {{scope.row.device_name}}
65
+                         <div @click="handleIndex(scope.$index)">{{scope.row.device_name}}</div> 
65 66
                       </template>
66 67
                     </el-table-column>
67 68
                      <el-table-column
@@ -70,7 +71,7 @@
70 71
                       width="90"
71 72
                       align="center">
72 73
                       <template slot-scope="scope">
73
-                         {{scope.row.unit_type}}
74
+                        <div @click="handleIndex(scope.$index)">{{scope.row.unit_type}}</div> 
74 75
                       </template>
75 76
                      </el-table-column>
76 77
                       <el-table-column
@@ -79,7 +80,7 @@
79 80
                        align="center"
80 81
                        widwid="90">
81 82
                        <template slot-scope="scope">
82
-                          {{scope.row.bed_number}}
83
+                          <div @click="handleIndex(scope.$index)">{{scope.row.bed_number}}</div>
83 84
                        </template>
84 85
                      </el-table-column>
85 86
                      </el-table>
@@ -126,7 +127,7 @@
126 127
                               <el-col :span="7">
127 128
                                   <el-form-item label="机位号:">
128 129
                                        <el-select style="width:150px" v-model="form.bed_number" :disabled="disableThree">
129
-                                          <el-option v-for="item in this.Number" :key="item.id" :label="item.number" :value="item.id"></el-option>
130
+                                          <el-option v-for="item in this.Number" :key="item.bed_id" :label="item.bed_number" :value="item.bed_id"></el-option>
130 131
                                        </el-select>
131 132
                                   </el-form-item>
132 133
                               </el-col>
@@ -1811,21 +1812,15 @@
1811 1812
                                   <el-form-item label="上传图片:">
1812 1813
                                     <el-upload
1813 1814
                                       :data="uploadFileData"
1814
-                                      class="upload-demo"
1815 1815
                                       action="https://upload.qiniup.com"
1816 1816
                                       :on-success="handleSuccess"
1817 1817
                                       :before-upload="beforeUploadFile"
1818
-                                       multiple
1819
-                                      :on-preview="handlePreview"
1820
-                                       :limit="1"
1821
-                                       :on-exceed="handleExceed"
1822
-                                       :on-remove="handleRemove"
1823
-                                        :before-remove="beforeRemove"
1824
-                                        :file-list="fileList">
1818
+                                       :limit="1">
1825 1819
                                         <el-button size="small" type="primary">上传图片</el-button>
1826 1820
                                       </el-upload>
1827
-
1828
-                                      <img v-if="guaForm.images" :src="guaForm.images" class="avatar">
1821
+                                     <a class="el-upload-list__item-name">
1822
+                                        <i><a href="guaForm.images">{{filename}}</a></i>
1823
+                                     </a>
1829 1824
                                   </el-form-item>
1830 1825
                                </el-col>
1831 1826
                              </el-row>
@@ -2470,6 +2465,7 @@ export default {
2470 2465
           reason: '',
2471 2466
           code_information: ''
2472 2467
         },
2468
+        filename: '',
2473 2469
         qiniuDomain: 'https://images.shengws.com/',
2474 2470
         uploadFileData: { token: '', key: '' },
2475 2471
         tShow: false,
@@ -2499,7 +2495,8 @@ export default {
2499 2495
           { id: 0, name: '请选择' },
2500 2496
           { id: 1, name: '单级反渗' },
2501 2497
           { id: 2, name: '双级反渗' }
2502
-        ]
2498
+        ],
2499
+        tabIndex: ''
2503 2500
       }
2504 2501
     },
2505 2502
     methods: {
@@ -2514,19 +2511,19 @@ export default {
2514 2511
       },
2515 2512
 
2516 2513
       handleClick(tab, event) {
2517
-        console.log(tab, event)
2514
+        // console.log(tab, event)
2518 2515
       },
2519 2516
       handleExceed(file) {
2520
-        console.log(file)
2517
+      //  console.log(file)
2521 2518
       },
2522 2519
       handleRemove(file, fileList) {
2523 2520
 
2524 2521
       },
2525 2522
       beforeRemove(file, fileList) {
2526
-        console.log(file, fileList)
2523
+      //  console.log(file, fileList)
2527 2524
       },
2528 2525
       handlePreview(file) {
2529
-        console.log(file)
2526
+        // console.log(file)
2530 2527
       },
2531 2528
       changetreatmentmode(val) {
2532 2529
         const checkedCount = val.length
@@ -2556,6 +2553,7 @@ export default {
2556 2553
             zone.push({ id: item.id, name: item.name })
2557 2554
           }
2558 2555
           var devicenumber = response.data.data.devicenumber
2556
+          console.log('devicenumber', devicenumber)
2559 2557
           this.bedZone = zone
2560 2558
 
2561 2559
           var zoness = [{ id: 0, name: '请选择' }]
@@ -2567,15 +2565,15 @@ export default {
2567 2565
           var bed = [{ id: 0, number: '请选择' }]
2568 2566
           for (let i = 0; i < numbers.length; i++) {
2569 2567
             const item = numbers[i]
2570
-            console.log(item)
2568
+            // console.log(item)
2571 2569
             bed.push({ id: item.id, number: item.number })
2572 2570
           }
2573 2571
           this.bedNumberTwo = bed
2574 2572
           this.bedZoneTwo = zones
2575 2573
           this.bedZoneThree = zoness
2576 2574
           this.bedNumber = numbers
2577
-
2578
-          this.Number = devicenumber
2575
+  
2576
+          // this.Number = devicenumber
2579 2577
         })
2580 2578
       },
2581 2579
 
@@ -2601,6 +2599,9 @@ export default {
2601 2599
           }
2602 2600
         })
2603 2601
       },
2602
+      handleIndex(index) {
2603
+        this.tabIndex = index
2604
+      },
2604 2605
       handleCurrentChange(val) {
2605 2606
         console.log('val是什么', val)
2606 2607
         this.currentRow = val
@@ -2628,7 +2629,9 @@ export default {
2628 2629
         getMachineDetailById(id).then(response => {
2629 2630
           if (response.data.state === 1) {
2630 2631
             var addmacher = response.data.data.addmacher
2631
-            // console.log('addmacher======', addmacher)
2632
+            var number = response.data.data.number
2633
+           // console.log('number', number)
2634
+            this.Number = number
2632 2635
             if (addmacher.device_type === 1) {
2633 2636
               this.sShow = false
2634 2637
               this.qShow = false
@@ -2729,7 +2732,8 @@ export default {
2729 2732
             this.form.id = addmacher.id
2730 2733
             this.form.serial_number = addmacher.serial_number
2731 2734
             this.form.devicetype = addmacher.device_type
2732
-            this.form.bed_number = addmacher.bed_number
2735
+            this.form.bed_number = addmacher.bed_id
2736
+            console.log('999', this.Number)
2733 2737
             this.form.device_name = addmacher.device_name
2734 2738
             this.form.manufacture_factory = addmacher.manufacture_factory
2735 2739
             this.form.service_manufacturer = addmacher.service_manufacturer
@@ -2851,23 +2855,22 @@ export default {
2851 2855
         var machine_statuss = parseInt(machine_status)
2852 2856
         this.form.machine_status = machine_statuss
2853 2857
 
2854
-        if (this.form.bed_number === '') {
2855
-          this.form.bed_number = 0
2856
-        }
2858
+        // if (this.form.bed_number === '') {
2859
+        //   this.form.bed_number = 0
2860
+        // }
2857 2861
 
2858 2862
         var bed_numbers = this.form.bed_number
2859 2863
         var bed_numberss = parseInt(bed_numbers)
2860 2864
         this.form.bed_number = bed_numberss
2861
-
2862 2865
         this.$refs[formName].validate(valid => {
2863 2866
           UpdateMachineInfo(this.form).then(response => {
2867
+            console.log('form', this.form)
2864 2868
             if (response.data.state === 1) {
2865 2869
               var addmacher = response.data.data.addmacher
2866
-
2867 2870
               this.$message.success('修改成功')
2868
-              this.getAllSubregion()
2869 2871
               this.getAllMachine()
2870
-              this.$refs.singleTable.setCurrentRow(addmacher)
2872
+              this.getAllSubregion()
2873
+              // this.$refs.singleTable.setCurrentRow(addmacher)
2871 2874
               this.$forceUpdate()
2872 2875
             }
2873 2876
           })
@@ -3130,7 +3133,7 @@ export default {
3130 3133
         getAllPlanDetail(unit_type).then(response => {
3131 3134
           if (response.data.state === 1) {
3132 3135
             var plandetail = response.data.data.plandetail
3133
-            console.log('plandetail=====================', plandetail)
3136
+            // console.log('plandetail=====================', plandetail)
3134 3137
             for (let index = 0; index < plandetail.length; index++) {
3135 3138
               if (plandetail[index].time === 1) {
3136 3139
                 plandetail[index].time = '周一'
@@ -3629,8 +3632,8 @@ export default {
3629 3632
         if (this.userform.user_total === '0') {
3630 3633
           this.userform.user_total = 0
3631 3634
         }
3632
-        console.log('上机时间', this.userform.start_time)
3633
-        console.log('下机时间', this.userform.end_time)
3635
+        // console.log('上机时间', this.userform.start_time)
3636
+        // console.log('下机时间', this.userform.end_time)
3634 3637
         this.$refs[formName].validate((valid) => {
3635 3638
           if (valid) {
3636 3639
             SaveInformation(this.equimentid, this.userform).then(response => {
@@ -3940,13 +3943,8 @@ export default {
3940 3943
         }
3941 3944
       },
3942 3945
       beforeUploadFile(file) {
3946
+        this.filename = file.name
3943 3947
         const isLt2M = file.size / 1024 / 1024 <= 2048
3944
-        console.log('视频大小', file.size / 1024 / 1024)
3945
-        console.log('isLt2M是什么', isLt2M)
3946
-        if (!isLt2M) {
3947
-          this.$message.error('上传视频大小不能超过 2G!')
3948
-          return false
3949
-        }
3950 3948
         var date = new Date()
3951 3949
         var ext = getFileExtension(file.name)
3952 3950
         var key = date.getFullYear() + (date.getMonth() + 1) + date.getDate() + date.getHours() + date.getMinutes() + date.getSeconds() + '_o_' + file.uid + '.' + ext
@@ -3966,7 +3964,7 @@ export default {
3966 3964
       },
3967 3965
       handleSuccess(res, file, fileList) {
3968 3966
         this.guaForm.images = this.qiniuDomain + res.url
3969
-        console.log('图片上传成功', this.qiniuDomain + res.url)
3967
+        this.filename = file.name
3970 3968
       },
3971 3969
       // eslint-disable-next-line no-dupe-keys
3972 3970
       getTime(value, temp) {
@@ -4008,7 +4006,7 @@ export default {
4008 4006
             SaveRepair(this.equimentid, this.guaForm).then(response => {
4009 4007
               if (response.data.state === 1) {
4010 4008
                 var repair = response.data.data.repair
4011
-                console.log('reqair', repair)
4009
+                // console.log('reqair', repair)
4012 4010
                 this.$message.success('保存成功')
4013 4011
                 this.$refs.child.getAllRepair()
4014 4012
                 this.guaForm.start_time = ''
@@ -4059,7 +4057,7 @@ export default {
4059 4057
           // eslint-disable-next-line eqeqeq
4060 4058
           if (response.data.state == 1) {
4061 4059
             var patient = response.data.data.patient
4062
-            console.log('patient', patient)
4060
+            // console.log('patient', patient)
4063 4061
             // eslint-disable-next-line no-undef
4064 4062
             if (patient.is_infectious === 0) {
4065 4063
               this.userform.contagion = ''
@@ -4079,7 +4077,6 @@ export default {
4079 4077
         getAllEquitType().then(response => {
4080 4078
           if (response.data.state === 1) {
4081 4079
             var equitname = response.data.data.equitname
4082
-            console.log('区号================', equitname)
4083 4080
             this.DeviceType = equitname
4084 4081
           }
4085 4082
         })
@@ -4110,10 +4107,10 @@ export default {
4110 4107
         getTimeWarning(id).then(response => {
4111 4108
           if (response.data.state === 1) {
4112 4109
             var information = response.data.data.information
4113
-            console.log(this.getTimestamp(this.userform.date))
4114
-            console.log(information.stime)
4110
+            // console.log(this.getTimestamp(this.userform.date))
4111
+            // console.log(information.stime)
4115 4112
             var time = this.getTimestamp(this.userform.date) - information.stime
4116
-            console.log('时间', time)
4113
+            // console.log('时间', time)
4117 4114
             if (time >= 2678400) {
4118 4115
               this.warnShow = true
4119 4116
             }
@@ -4254,4 +4251,14 @@ export default {
4254 4251
     margin-left: 130px;
4255 4252
   }
4256 4253
 
4254
+ .el-upload-list__item-name {
4255
+    color: #606266;
4256
+    display: block;
4257
+    margin-right: 40px;
4258
+    overflow: hidden;
4259
+    padding-left: 4px;
4260
+    text-overflow: ellipsis;
4261
+    transition: color .3s;
4262
+    white-space: nowrap;
4263
+}
4257 4264
 </style>

+ 132 - 118
src/xt_pages/stock/otherSalesReturnOrder.vue View File

@@ -174,51 +174,51 @@
174 174
 </template>
175 175
 
176 176
 <script>
177
-import { uParseTime } from "@/utils/tools";
178
-import { fetchAllAdminUsers, fetchAllDoctorAndNurse } from "@/api/doctor";
177
+import { uParseTime } from '@/utils/tools'
178
+import { fetchAllAdminUsers, fetchAllDoctorAndNurse } from '@/api/doctor'
179 179
 import {
180 180
   deleteSalesReturn,
181 181
   GetAllConfig,
182 182
   getSalesReturnList,
183 183
   getWarehouseInfoList,
184 184
   getWarehouseList
185
-} from "@/api/stock";
186
-import BreadCrumb from "../components/bread-crumb";
185
+} from '@/api/stock'
186
+import BreadCrumb from '../components/bread-crumb'
187 187
 
188 188
 export default {
189
-  name: "salesReturnOrder",
189
+  name: 'salesReturnOrder',
190 190
   components: { BreadCrumb },
191 191
   created() {
192
-    var nowDate = new Date();
193
-    var nowYear = nowDate.getFullYear();
194
-    var nowMonth = nowDate.getMonth() + 1;
195
-    var nowDay = nowDate.getDate();
192
+    var nowDate = new Date()
193
+    var nowYear = nowDate.getFullYear()
194
+    var nowMonth = nowDate.getMonth() + 1
195
+    var nowDay = nowDate.getDate()
196 196
     this.end_time =
197 197
       nowYear +
198
-      "-" +
199
-      (nowMonth < 10 ? "0" + nowMonth : nowMonth) +
200
-      "-" +
201
-      (nowDay < 10 ? "0" + nowDay : nowDay);
202
-    nowDate.setMonth(nowDate.getMonth() - 1);
203
-    nowYear = nowDate.getFullYear();
204
-    nowMonth = nowDate.getMonth() + 1;
205
-    nowDay = nowDate.getDate();
198
+      '-' +
199
+      (nowMonth < 10 ? '0' + nowMonth : nowMonth) +
200
+      '-' +
201
+      (nowDay < 10 ? '0' + nowDay : nowDay)
202
+    nowDate.setMonth(nowDate.getMonth() - 1)
203
+    nowYear = nowDate.getFullYear()
204
+    nowMonth = nowDate.getMonth() + 1
205
+    nowDay = nowDate.getDate()
206 206
     this.start_time =
207 207
       nowYear +
208
-      "-" +
209
-      (nowMonth < 10 ? "0" + nowMonth : nowMonth) +
210
-      "-" +
211
-      (nowDay < 10 ? "0" + nowDay : nowDay);
212
-    this.GetSalesReturn();
213
-    this.GetConfigInfo();
214
-    this.fetchAllAdminUsers();
208
+      '-' +
209
+      (nowMonth < 10 ? '0' + nowMonth : nowMonth) +
210
+      '-' +
211
+      (nowDay < 10 ? '0' + nowDay : nowDay)
212
+    this.GetSalesReturn()
213
+    this.GetConfigInfo()
214
+    this.fetchAllAdminUsers()
215 215
   },
216 216
   data() {
217 217
     return {
218
-      searchKey: "",
218
+      searchKey: '',
219 219
       crumbs: [
220
-        { path: false, name: "库存管理" },
221
-        { path: false, name: "其他退货单" }
220
+        { path: false, name: '库存管理' },
221
+        { path: false, name: '其他退货单' }
222 222
       ],
223 223
       type: 2,
224 224
       page: 1,
@@ -229,16 +229,17 @@ export default {
229 229
       pageSelect: 0,
230 230
       adminUserOptions: [],
231 231
       multipleSelection: [],
232
-      signAndWeighBoxPatients: "sign-and-weigh-box-patients",
233
-      start_time: "",
232
+      signAndWeighBoxPatients: 'sign-and-weigh-box-patients',
233
+      start_time: '',
234 234
       saleReturnDate: [],
235
-      end_time: "",
235
+      end_time: '',
236 236
       goodType: [],
237 237
       goodInfo: [],
238 238
       manufacturer: [],
239 239
       selectedTableData: [],
240
-      dealer: []
241
-    };
240
+      dealer: [],
241
+      startTime: ''
242
+    }
242 243
   },
243 244
   methods: {
244 245
     search: function() {
@@ -249,25 +250,25 @@ export default {
249 250
         end_time: this.end_time,
250 251
         type: this.type,
251 252
         keywords: this.searchKey
252
-      };
253
-      this.saleReturnDate = [];
253
+      }
254
+      this.saleReturnDate = []
254 255
       getSalesReturnList(Params).then(response => {
255 256
         if (response.data.state == 0) {
256
-          this.$message.error(response.data.msg);
257
-          return false;
257
+          this.$message.error(response.data.msg)
258
+          return false
258 259
         } else {
259
-          this.total = response.data.data.total;
260
+          this.total = response.data.data.total
260 261
           for (let i = 0; i < response.data.data.list.length; i++) {
261
-            this.saleReturnDate.push(response.data.data.list[i]);
262
+            this.saleReturnDate.push(response.data.data.list[i])
262 263
           }
263 264
         }
264
-      });
265
+      })
265 266
     },
266 267
     AddNewOrder: function() {
267 268
       this.$router.push({
268
-        name: "salesReturnOrderAdd",
269
+        name: 'salesReturnOrderAdd',
269 270
         query: { type: this.type }
270
-      });
271
+      })
271 272
     },
272 273
     GetSalesReturn: function() {
273 274
       const Params = {
@@ -276,201 +277,214 @@ export default {
276 277
         start_time: this.start_time,
277 278
         end_time: this.end_time,
278 279
         type: this.type
279
-      };
280
-      this.saleReturnDate = [];
280
+      }
281
+      this.saleReturnDate = []
281 282
       getSalesReturnList(Params).then(response => {
282 283
         if (response.data.state == 0) {
283
-          this.$message.error(response.data.msg);
284
-          return false;
284
+          this.$message.error(response.data.msg)
285
+          return false
285 286
         } else {
286
-          this.total = response.data.data.total;
287
+          this.total = response.data.data.total
287 288
           for (let i = 0; i < response.data.data.list.length; i++) {
288
-            this.saleReturnDate.push(response.data.data.list[i]);
289
+            this.saleReturnDate.push(response.data.data.list[i])
289 290
           }
290 291
         }
291
-      });
292
+      })
292 293
     },
293 294
     getXuserName(id) {
294 295
       if (id <= 0) {
295
-        return "";
296
+        return ''
296 297
       }
297
-      var name = "";
298
+      var name = ''
298 299
       if (
299 300
         this.adminUserOptions == null ||
300
-        typeof this.adminUserOptions.length === "undefined"
301
+        typeof this.adminUserOptions.length === 'undefined'
301 302
       ) {
302
-        return name;
303
+        return name
303 304
       }
304
-      var leng = this.adminUserOptions.length;
305
+      var leng = this.adminUserOptions.length
305 306
       if (leng == 0) {
306
-        return name;
307
+        return name
307 308
       }
308 309
       for (let index = 0; index < leng; index++) {
309 310
         if (this.adminUserOptions[index].id == id) {
310
-          name = this.adminUserOptions[index].name;
311
-          break;
311
+          name = this.adminUserOptions[index].name
312
+          break
312 313
         }
313 314
       }
314
-      return name;
315
+      return name
315 316
     },
316 317
     fetchAllAdminUsers() {
317 318
       fetchAllAdminUsers().then(response => {
318
-        console.log(response);
319
+        console.log(response)
319 320
         if (response.data.state == 1) {
320
-          this.adminUserOptions = response.data.data.users;
321
-          var alen = this.adminUserOptions.length;
321
+          this.adminUserOptions = response.data.data.users
322
+          var alen = this.adminUserOptions.length
322 323
           for (let index = 0; index < alen; index++) {
323 324
             if (this.adminUserOptions[index].user_type == 2) {
324 325
               // this.doctorOptions.push(this.adminUserOptions[index]);
325 326
             }
326 327
           }
327 328
         }
328
-      });
329
+      })
329 330
     },
330 331
     handleSelectionChange: function(val) {
331
-      this.multipleSelection = val;
332
+      this.multipleSelection = val
332 333
     },
333 334
     handleSizeChange(val) {
334
-      this.limit = val;
335
-      this.GetSalesReturn();
335
+      this.limit = val
336
+      this.GetSalesReturn()
336 337
     },
337 338
     handleCurrentChange(val) {
338
-      this.page = val;
339
-      this.GetSalesReturn();
339
+      this.page = val
340
+      this.GetSalesReturn()
340 341
     },
341 342
     startTimeChange(val) {
342
-      this.GetSalesReturn();
343
+      this.startTime = this.getTimestamp(val)
344
+      this.GetSalesReturn()
343 345
     },
344 346
     endTimeChange(val) {
345
-      this.GetSalesReturn();
347
+      var time = this.getTimestamp(val) - this.startTime
348
+      console.log('开始时间', this.startTime)
349
+      console.log('结束', this.getTimestamp(val))
350
+      console.log('时间差', time)
351
+      if (time < 0) {
352
+        this.$message.error('结束时间不能小于开始时间')
353
+        this.end_time = ''
354
+      } else {
355
+        this.GetSalesReturn()
356
+      }
357
+    },
358
+    getTimestamp(time) { // 把时间日期转成时间戳
359
+      return (new Date(time)).getTime() / 1000
346 360
     },
347 361
     calculate: function(val) {
348
-      return Math.round(parseFloat(val) * 100) / 100;
362
+      return Math.round(parseFloat(val) * 100) / 100
349 363
     },
350 364
     GetConfigInfo: function() {
351 365
       GetAllConfig().then(response => {
352 366
         if (response.data.state == 0) {
353
-          this.$message.error(response.data.msg);
354
-          return false;
367
+          this.$message.error(response.data.msg)
368
+          return false
355 369
         } else {
356
-          this.manufacturer = response.data.data.manufacturer;
357
-          this.dealer = response.data.data.dealer;
370
+          this.manufacturer = response.data.data.manufacturer
371
+          this.dealer = response.data.data.dealer
358 372
         }
359
-      });
373
+      })
360 374
     },
361 375
     getManufactuerName: function(manufacturer_id) {
362 376
       for (let i = 0; i < this.manufacturer.length; i++) {
363 377
         if (this.manufacturer[i].id == manufacturer_id) {
364
-          return this.manufacturer[i].manufacturer_name;
378
+          return this.manufacturer[i].manufacturer_name
365 379
         }
366 380
       }
367 381
     },
368 382
     getDealerName: function(dealer_id) {
369 383
       for (let i = 0; i < this.dealer.length; i++) {
370 384
         if (this.dealer[i].id == dealer_id) {
371
-          return this.dealer[i].dealer_name;
385
+          return this.dealer[i].dealer_name
372 386
         }
373 387
       }
374 388
     },
375 389
     handleEdit: function(index, row) {
376 390
       this.$router.push({
377
-        name: "salesReturnDetail",
391
+        name: 'salesReturnDetail',
378 392
         query: { id: row.id, type: this.type }
379
-      });
393
+      })
380 394
     },
381 395
     handleDelete: function(index, row) {
382
-      const ids = [];
383
-      ids.push(row.id);
384
-      const idStr = ids.join(",");
396
+      const ids = []
397
+      ids.push(row.id)
398
+      const idStr = ids.join(',')
385 399
 
386 400
       const params = {
387 401
         ids: idStr
388
-      };
402
+      }
389 403
 
390
-      this.$confirm("确认删除退货单记录?", "删除退货单记录", {
391
-        confirmButtonText: "确定",
392
-        cancelButtonText: "取消",
393
-        type: "warning"
404
+      this.$confirm('确认删除退货单记录?', '删除退货单记录', {
405
+        confirmButtonText: '确定',
406
+        cancelButtonText: '取消',
407
+        type: 'warning'
394 408
       })
395 409
         .then(() => {
396 410
           deleteSalesReturn(params).then(response => {
397 411
             if (response.data.state == 0) {
398
-              this.$message.error(response.data.msg);
399
-              return false;
412
+              this.$message.error(response.data.msg)
413
+              return false
400 414
             } else {
401 415
               this.$notify({
402
-                title: "成功",
403
-                message: "删除成功",
404
-                type: "success",
416
+                title: '成功',
417
+                message: '删除成功',
418
+                type: 'success',
405 419
                 duration: 2000
406
-              });
420
+              })
407 421
               for (let i = 0; i < ids.length; i++) {
408 422
                 for (let y = 0; y < this.saleReturnDate.length; y++) {
409 423
                   if (ids[i] == this.saleReturnDate[y].id) {
410
-                    this.saleReturnDate.splice(y, 1);
424
+                    this.saleReturnDate.splice(y, 1)
411 425
                   }
412 426
                 }
413 427
               }
414 428
             }
415
-          });
429
+          })
416 430
         })
417
-        .catch(() => {});
431
+        .catch(() => {})
418 432
     },
419 433
     changeAllSelected: function(val) {
420 434
       if (val) {
421
-        this.$refs.multipleTable.toggleAllSelection();
435
+        this.$refs.multipleTable.toggleAllSelection()
422 436
       } else {
423
-        this.$refs.multipleTable.clearSelection();
437
+        this.$refs.multipleTable.clearSelection()
424 438
       }
425 439
     },
426 440
     select(selection) {
427
-      this.selectedTableData = selection;
441
+      this.selectedTableData = selection
428 442
     },
429 443
     batchDelete() {
430 444
       if (this.selectedTableData.length <= 0) {
431
-        this.$message.error("请选择要删除的记录");
432
-        return;
445
+        this.$message.error('请选择要删除的记录')
446
+        return
433 447
       }
434
-      const ids = [];
448
+      const ids = []
435 449
       for (let i = 0; i < this.selectedTableData.length; i++) {
436
-        ids.push(this.selectedTableData[i].id);
450
+        ids.push(this.selectedTableData[i].id)
437 451
       }
438
-      const idStr = ids.join(",");
452
+      const idStr = ids.join(',')
439 453
       const params = {
440 454
         ids: idStr
441
-      };
442
-      this.$confirm("确认删除退货单记录?", "删除退货单记录", {
443
-        confirmButtonText: "确定",
444
-        cancelButtonText: "取消",
445
-        type: "warning"
455
+      }
456
+      this.$confirm('确认删除退货单记录?', '删除退货单记录', {
457
+        confirmButtonText: '确定',
458
+        cancelButtonText: '取消',
459
+        type: 'warning'
446 460
       })
447 461
         .then(() => {
448 462
           deleteSalesReturn(params).then(response => {
449 463
             if (response.data.state == 0) {
450
-              this.$message.error(response.data.msg);
451
-              return false;
464
+              this.$message.error(response.data.msg)
465
+              return false
452 466
             } else {
453 467
               this.$notify({
454
-                title: "成功",
455
-                message: "删除成功",
456
-                type: "success",
468
+                title: '成功',
469
+                message: '删除成功',
470
+                type: 'success',
457 471
                 duration: 2000
458
-              });
472
+              })
459 473
 
460 474
               for (let i = 0; i < ids.length; i++) {
461 475
                 for (let y = 0; y < this.saleReturnDate.length; y++) {
462 476
                   if (ids[i] == this.saleReturnDate[y].id) {
463
-                    this.saleReturnDate.splice(y, 1);
477
+                    this.saleReturnDate.splice(y, 1)
464 478
                   }
465 479
                 }
466 480
               }
467 481
             }
468
-          });
482
+          })
469 483
         })
470
-        .catch(() => {});
484
+        .catch(() => {})
471 485
     }
472 486
   }
473
-};
487
+}
474 488
 </script>
475 489
 
476 490
 <style rel="stylesheet/css" lang="scss" scoped>

+ 167 - 157
src/xt_pages/stock/stockInOrder.vue View File

@@ -174,8 +174,8 @@
174 174
 </template>
175 175
 
176 176
 <script>
177
-import { uParseTime } from "@/utils/tools";
178
-import { fetchAllAdminUsers, fetchAllDoctorAndNurse } from "@/api/doctor";
177
+import { uParseTime } from '@/utils/tools'
178
+import { fetchAllAdminUsers, fetchAllDoctorAndNurse } from '@/api/doctor'
179 179
 import {
180 180
   deleteWarehouseInfo,
181 181
   GetAllConfig,
@@ -183,11 +183,11 @@ import {
183 183
   GetAllGoodType,
184 184
   getWarehouseInfoList,
185 185
   getWarehouseList
186
-} from "@/api/stock";
187
-import BreadCrumb from "../components/bread-crumb";
186
+} from '@/api/stock'
187
+import BreadCrumb from '../components/bread-crumb'
188 188
 
189 189
 export default {
190
-  name: "stockIn",
190
+  name: 'stockIn',
191 191
   components: { BreadCrumb },
192 192
   created() {
193 193
     // var nowDate = new Date();
@@ -220,38 +220,38 @@ export default {
220 220
     // const startTime = year + '-' + month + '-' + day
221 221
     // this.start_time = startTime
222 222
 
223
-    var nowDate = new Date();
224
-    var nowYear = nowDate.getFullYear();
225
-    var nowMonth = nowDate.getMonth() + 1;
226
-    var nowDay = nowDate.getDate();
223
+    var nowDate = new Date()
224
+    var nowYear = nowDate.getFullYear()
225
+    var nowMonth = nowDate.getMonth() + 1
226
+    var nowDay = nowDate.getDate()
227 227
     this.end_time =
228 228
       nowYear +
229
-      "-" +
230
-      (nowMonth < 10 ? "0" + nowMonth : nowMonth) +
231
-      "-" +
232
-      (nowDay < 10 ? "0" + nowDay : nowDay);
233
-    nowDate.setMonth(nowDate.getMonth() - 1);
234
-    nowYear = nowDate.getFullYear();
235
-    nowMonth = nowDate.getMonth() + 1;
236
-    nowDay = nowDate.getDate();
229
+      '-' +
230
+      (nowMonth < 10 ? '0' + nowMonth : nowMonth) +
231
+      '-' +
232
+      (nowDay < 10 ? '0' + nowDay : nowDay)
233
+    nowDate.setMonth(nowDate.getMonth() - 1)
234
+    nowYear = nowDate.getFullYear()
235
+    nowMonth = nowDate.getMonth() + 1
236
+    nowDay = nowDate.getDate()
237 237
     this.start_time =
238 238
       nowYear +
239
-      "-" +
240
-      (nowMonth < 10 ? "0" + nowMonth : nowMonth) +
241
-      "-" +
242
-      (nowDay < 10 ? "0" + nowDay : nowDay);
239
+      '-' +
240
+      (nowMonth < 10 ? '0' + nowMonth : nowMonth) +
241
+      '-' +
242
+      (nowDay < 10 ? '0' + nowDay : nowDay)
243 243
 
244
-    this.GetWarehouse();
245
-    this.GetConfigInfo();
246
-    this.fetchAllAdminUsers();
244
+    this.GetWarehouse()
245
+    this.GetConfigInfo()
246
+    this.fetchAllAdminUsers()
247 247
   },
248 248
   data() {
249 249
     return {
250 250
       crumbs: [
251
-        { path: false, name: "库存管理" },
252
-        { path: false, name: "入库单" }
251
+        { path: false, name: '库存管理' },
252
+        { path: false, name: '入库单' }
253 253
       ],
254
-      searchKey: "",
254
+      searchKey: '',
255 255
       type: 1,
256 256
       page: 1,
257 257
       limit: 10,
@@ -261,9 +261,9 @@ export default {
261 261
       pageSelect: 0,
262 262
       adminUserOptions: [],
263 263
       multipleSelection: [],
264
-      signAndWeighBoxPatients: "sign-and-weigh-box-patients",
265
-      start_time: "",
266
-      end_time: "",
264
+      signAndWeighBoxPatients: 'sign-and-weigh-box-patients',
265
+      start_time: '',
266
+      end_time: '',
267 267
       goodType: [],
268 268
       goodInfo: [],
269 269
       manufacturer: [],
@@ -272,14 +272,15 @@ export default {
272 272
       Warehouse: {
273 273
         loading: false,
274 274
         warehouseDate: [],
275
-        tableCurrentIndex: ""
275
+        tableCurrentIndex: ''
276 276
       },
277 277
 
278 278
       WarehouseInfo: {
279 279
         loading: false,
280 280
         warehouseInfoDate: []
281
-      }
282
-    };
281
+      },
282
+      startTime: ''
283
+    }
283 284
   },
284 285
   methods: {
285 286
     search: function() {
@@ -290,21 +291,21 @@ export default {
290 291
         end_time: this.end_time,
291 292
         type: this.type,
292 293
         keywords: this.searchKey
293
-      };
294
-      this.Warehouse.warehouseDate = [];
294
+      }
295
+      this.Warehouse.warehouseDate = []
295 296
       getWarehouseList(Params).then(response => {
296 297
         if (response.data.state == 0) {
297
-          this.Warehouse.loading = false;
298
-          this.$message.error(response.data.msg);
299
-          return false;
298
+          this.Warehouse.loading = false
299
+          this.$message.error(response.data.msg)
300
+          return false
300 301
         } else {
301
-          this.Warehouse.loading = false;
302
-          this.total = response.data.data.total;
302
+          this.Warehouse.loading = false
303
+          this.total = response.data.data.total
303 304
           for (let i = 0; i < response.data.data.list.length; i++) {
304
-            this.Warehouse.warehouseDate.push(response.data.data.list[i]);
305
+            this.Warehouse.warehouseDate.push(response.data.data.list[i])
305 306
           }
306 307
         }
307
-      });
308
+      })
308 309
     },
309 310
     GetWarehouse: function() {
310 311
       const Params = {
@@ -313,304 +314,313 @@ export default {
313 314
         start_time: this.start_time,
314 315
         end_time: this.end_time,
315 316
         type: this.type
316
-      };
317
-      this.Warehouse.warehouseDate = [];
317
+      }
318
+      this.Warehouse.warehouseDate = []
318 319
       getWarehouseList(Params).then(response => {
319 320
         if (response.data.state == 0) {
320
-          this.Warehouse.loading = false;
321
-          this.$message.error(response.data.msg);
322
-          return false;
321
+          this.Warehouse.loading = false
322
+          this.$message.error(response.data.msg)
323
+          return false
323 324
         } else {
324
-          this.Warehouse.loading = false;
325
-          this.total = response.data.data.total;
325
+          this.Warehouse.loading = false
326
+          this.total = response.data.data.total
326 327
           for (let i = 0; i < response.data.data.list.length; i++) {
327
-            this.Warehouse.warehouseDate.push(response.data.data.list[i]);
328
+            this.Warehouse.warehouseDate.push(response.data.data.list[i])
328 329
           }
329 330
         }
330
-      });
331
+      })
331 332
     },
332 333
     tableRowClassName({ row, rowIndex }) {
333 334
       // 把每一行的索引放进row
334
-      row.index = rowIndex;
335
+      row.index = rowIndex
335 336
     },
336 337
     onRowClick(row, event, column) {
337
-      this.WarehouseInfo.warehouseInfoDate = [];
338
-      this.Warehouse.tableCurrentIndex = row.index;
338
+      this.WarehouseInfo.warehouseInfoDate = []
339
+      this.Warehouse.tableCurrentIndex = row.index
339 340
       const params = {
340 341
         id: row.id
341
-      };
342
-      this.WarehouseInfo.loading = true;
342
+      }
343
+      this.WarehouseInfo.loading = true
343 344
       getWarehouseInfoList(params).then(response => {
344 345
         if (response.data.state == 0) {
345
-          this.WarehouseInfo.loading = false;
346
-          this.$message.error(response.data.msg);
347
-          return false;
346
+          this.WarehouseInfo.loading = false
347
+          this.$message.error(response.data.msg)
348
+          return false
348 349
         } else {
349
-          this.WarehouseInfo.loading = false;
350
+          this.WarehouseInfo.loading = false
350 351
           for (let i = 0; i < response.data.data.info.length; i++) {
351 352
             this.WarehouseInfo.warehouseInfoDate.push(
352 353
               response.data.data.info[i]
353
-            );
354
+            )
354 355
           }
355 356
         }
356
-      });
357
+      })
357 358
     },
358 359
     getXuserName(id) {
359 360
       if (id <= 0) {
360
-        return "";
361
+        return ''
361 362
       }
362
-      var name = "";
363
+      var name = ''
363 364
       if (
364 365
         this.adminUserOptions == null ||
365
-        typeof this.adminUserOptions.length === "undefined"
366
+        typeof this.adminUserOptions.length === 'undefined'
366 367
       ) {
367
-        return name;
368
+        return name
368 369
       }
369
-      var leng = this.adminUserOptions.length;
370
+      var leng = this.adminUserOptions.length
370 371
       if (leng == 0) {
371
-        return name;
372
+        return name
372 373
       }
373 374
       for (let index = 0; index < leng; index++) {
374 375
         if (this.adminUserOptions[index].id == id) {
375
-          name = this.adminUserOptions[index].name;
376
-          break;
376
+          name = this.adminUserOptions[index].name
377
+          break
377 378
         }
378 379
       }
379
-      return name;
380
+      return name
380 381
     },
381 382
     fetchAllDoctorAndNurse() {
382 383
       fetchAllDoctorAndNurse().then(response => {
383 384
         if (response.data.state == 1) {
384
-          this.doctorOptions = response.data.data.doctors;
385
+          this.doctorOptions = response.data.data.doctors
385 386
         }
386
-      });
387
+      })
387 388
     },
388 389
     fetchAllAdminUsers() {
389 390
       fetchAllAdminUsers().then(response => {
390
-        console.log(response);
391
+        console.log(response)
391 392
         if (response.data.state == 1) {
392
-          this.adminUserOptions = response.data.data.users;
393
-          var alen = this.adminUserOptions.length;
393
+          this.adminUserOptions = response.data.data.users
394
+          var alen = this.adminUserOptions.length
394 395
           for (let index = 0; index < alen; index++) {
395 396
             if (this.adminUserOptions[index].user_type == 2) {
396 397
               // this.doctorOptions.push(this.adminUserOptions[index]);
397 398
             }
398 399
           }
399 400
         }
400
-      });
401
+      })
401 402
     },
402 403
     getSpecificationName: function(id) {
403
-      let name = "";
404
+      let name = ''
404 405
       for (let i = 0; i < this.goodInfo.length; i++) {
405 406
         if (this.goodInfo[i].id == id) {
406
-          name = this.goodInfo[i].specification_name;
407
+          name = this.goodInfo[i].specification_name
407 408
         }
408 409
       }
409 410
 
410
-      return name;
411
+      return name
411 412
     },
412 413
     getTypeName: function(id) {
413
-      let name = "";
414
+      let name = ''
414 415
       for (let i = 0; i < this.goodType.length; i++) {
415 416
         if (this.goodType[i].id == id) {
416
-          name = this.goodType[i].type_name;
417
+          name = this.goodType[i].type_name
417 418
         }
418 419
       }
419
-      return name;
420
+      return name
420 421
     },
421 422
     GetAllGoodType: function() {
422 423
       GetAllGoodType().then(response => {
423 424
         if (response.data.state == 0) {
424
-          this.$message.error(response.data.msg);
425
-          return false;
425
+          this.$message.error(response.data.msg)
426
+          return false
426 427
         } else {
427 428
           for (let i = 0; i < response.data.data.goodType.length; i++) {
428
-            this.goodType.push(response.data.data.goodType[i]);
429
+            this.goodType.push(response.data.data.goodType[i])
429 430
           }
430 431
         }
431
-      });
432
+      })
432 433
     },
433 434
     GetAllGoodInfo: function() {
434 435
       GetAllGoodInfo().then(response => {
435 436
         if (response.data.state == 0) {
436
-          this.$message.error(response.data.msg);
437
-          return false;
437
+          this.$message.error(response.data.msg)
438
+          return false
438 439
         } else {
439 440
           for (let i = 0; i < response.data.data.goodInfo.length; i++) {
440
-            this.goodInfo.push(response.data.data.goodInfo[i]);
441
+            this.goodInfo.push(response.data.data.goodInfo[i])
441 442
           }
442 443
         }
443
-      });
444
+      })
444 445
     },
445 446
     clicks: function() {
446
-      console.log(this.WarehouseInfo.warehouseInfoDate);
447
+      console.log(this.WarehouseInfo.warehouseInfoDate)
447 448
     },
448 449
     handleWarehouse: function() {
449
-      this.$router.push({ path: "/stock/in/add", query: { type: this.type } });
450
+      this.$router.push({ path: '/stock/in/add', query: { type: this.type }})
450 451
     },
451 452
     handleReturnSales: function() {
452 453
       // this.$router.push({path:'/patients/create'}
453 454
       if (this.multipleSelection.length <= 0) {
454
-        this.$message.error("请选择退货商品");
455
-        return;
455
+        this.$message.error('请选择退货商品')
456
+        return
456 457
       }
457 458
 
458
-      const ids = [];
459
+      const ids = []
459 460
       for (let i = 0; i < this.multipleSelection.length; i++) {
460
-        ids.push(this.multipleSelection[i].id);
461
+        ids.push(this.multipleSelection[i].id)
461 462
       }
462
-      this.$router.push({ name: "salesReturn", query: { id: ids.join("&") } });
463
+      this.$router.push({ name: 'salesReturn', query: { id: ids.join('&') }})
463 464
     },
464 465
     handleReturnSalesRecord: function() {
465
-      this.$router.push({ name: "salesReutrnRecord" });
466
+      this.$router.push({ name: 'salesReutrnRecord' })
466 467
     },
467 468
     handleWarehouseRecord: function() {
468
-      this.$router.push({ name: "warehouseRecord" });
469
+      this.$router.push({ name: 'warehouseRecord' })
469 470
     },
470 471
     handleSelectionChange: function(val) {
471
-      this.multipleSelection = val;
472
+      this.multipleSelection = val
472 473
     },
473 474
     handleSizeChange(val) {
474
-      this.limit = val;
475
-      this.GetWarehouse();
475
+      this.limit = val
476
+      this.GetWarehouse()
476 477
     },
477 478
     handleCurrentChange(val) {
478
-      this.page = val;
479
-      this.GetWarehouse();
479
+      this.page = val
480
+      this.GetWarehouse()
480 481
     },
481 482
     startTimeChange(val) {
482
-      this.GetWarehouse();
483
+      this.startTime = this.getTimestamp(val)
483 484
     },
484 485
     endTimeChange(val) {
485
-      this.GetWarehouse();
486
+      var time = this.getTimestamp(val) - this.startTime
487
+      if (time < 0) {
488
+        this.$message.error('结束时间不能小于开始时间')
489
+        this.end_time = ''
490
+      } else {
491
+        this.GetWarehouse()
492
+      }
493
+    },
494
+    getTimestamp(time) { // 把时间日期转成时间戳
495
+      return (new Date(time)).getTime() / 1000
486 496
     },
487 497
     calculate: function(val) {
488
-      return Math.round(parseFloat(val) * 100) / 100;
498
+      return Math.round(parseFloat(val) * 100) / 100
489 499
     },
490 500
     GetConfigInfo: function() {
491 501
       GetAllConfig().then(response => {
492 502
         if (response.data.state == 0) {
493
-          this.$message.error(response.data.msg);
494
-          return false;
503
+          this.$message.error(response.data.msg)
504
+          return false
495 505
         } else {
496
-          this.manufacturer = response.data.data.manufacturer;
497
-          this.dealer = response.data.data.dealer;
506
+          this.manufacturer = response.data.data.manufacturer
507
+          this.dealer = response.data.data.dealer
498 508
         }
499
-      });
509
+      })
500 510
     },
501 511
     getManufactuerName: function(manufacturer_id) {
502 512
       for (let i = 0; i < this.manufacturer.length; i++) {
503 513
         if (this.manufacturer[i].id == manufacturer_id) {
504
-          return this.manufacturer[i].manufacturer_name;
514
+          return this.manufacturer[i].manufacturer_name
505 515
         }
506 516
       }
507 517
     },
508 518
     getDealerName: function(dealer_id) {
509 519
       for (let i = 0; i < this.dealer.length; i++) {
510 520
         if (this.dealer[i].id == dealer_id) {
511
-          return this.dealer[i].dealer_name;
521
+          return this.dealer[i].dealer_name
512 522
         }
513 523
       }
514 524
     },
515 525
     handleEdit: function(index, row) {
516 526
       this.$router.push({
517
-        name: "stockInDetail",
527
+        name: 'stockInDetail',
518 528
         query: { id: row.id, type: this.type }
519
-      });
529
+      })
520 530
     },
521 531
     handleDelete: function(index, row) {
522
-      const ids = [];
523
-      ids.push(row.id);
524
-      const idStr = ids.join(",");
532
+      const ids = []
533
+      ids.push(row.id)
534
+      const idStr = ids.join(',')
525 535
 
526 536
       const params = {
527 537
         ids: idStr
528
-      };
538
+      }
529 539
 
530
-      this.$confirm("确认删除入库单记录?", "删除入库单记录", {
531
-        confirmButtonText: "确定",
532
-        cancelButtonText: "取消",
533
-        type: "warning"
540
+      this.$confirm('确认删除入库单记录?', '删除入库单记录', {
541
+        confirmButtonText: '确定',
542
+        cancelButtonText: '取消',
543
+        type: 'warning'
534 544
       })
535 545
         .then(() => {
536 546
           deleteWarehouseInfo(params).then(response => {
537 547
             if (response.data.state == 0) {
538
-              this.$message.error(response.data.msg);
539
-              return false;
548
+              this.$message.error(response.data.msg)
549
+              return false
540 550
             } else {
541 551
               this.$notify({
542
-                title: "成功",
543
-                message: "删除成功",
544
-                type: "success",
552
+                title: '成功',
553
+                message: '删除成功',
554
+                type: 'success',
545 555
                 duration: 2000
546
-              });
556
+              })
547 557
               for (let i = 0; i < ids.length; i++) {
548 558
                 for (let y = 0; y < this.Warehouse.warehouseDate.length; y++) {
549 559
                   if (ids[i] == this.Warehouse.warehouseDate[y].id) {
550
-                    this.Warehouse.warehouseDate.splice(y, 1);
560
+                    this.Warehouse.warehouseDate.splice(y, 1)
551 561
                   }
552 562
                 }
553 563
               }
554 564
             }
555
-          });
565
+          })
556 566
         })
557
-        .catch(() => {});
567
+        .catch(() => {})
558 568
     },
559 569
     changeAllSelected: function(val) {
560 570
       if (val) {
561
-        this.$refs.multipleTable.toggleAllSelection();
571
+        this.$refs.multipleTable.toggleAllSelection()
562 572
       } else {
563
-        this.$refs.multipleTable.clearSelection();
573
+        this.$refs.multipleTable.clearSelection()
564 574
       }
565 575
     },
566 576
     select(selection) {
567
-      this.selectedTableData = selection;
577
+      this.selectedTableData = selection
568 578
     },
569 579
     batchDelete() {
570 580
       if (this.selectedTableData.length <= 0) {
571
-        this.$message.error("请选择要删除的记录");
572
-        return;
581
+        this.$message.error('请选择要删除的记录')
582
+        return
573 583
       }
574
-      const ids = [];
584
+      const ids = []
575 585
       for (let i = 0; i < this.selectedTableData.length; i++) {
576
-        ids.push(this.selectedTableData[i].id);
586
+        ids.push(this.selectedTableData[i].id)
577 587
       }
578
-      const idStr = ids.join(",");
588
+      const idStr = ids.join(',')
579 589
       const params = {
580 590
         ids: idStr
581
-      };
582
-      this.$confirm("确认删除入库单记录?", "删除入库单记录", {
583
-        confirmButtonText: "确定",
584
-        cancelButtonText: "取消",
585
-        type: "warning"
591
+      }
592
+      this.$confirm('确认删除入库单记录?', '删除入库单记录', {
593
+        confirmButtonText: '确定',
594
+        cancelButtonText: '取消',
595
+        type: 'warning'
586 596
       })
587 597
         .then(() => {
588 598
           deleteWarehouseInfo(params).then(response => {
589 599
             if (response.data.state == 0) {
590
-              this.$message.error(response.data.msg);
591
-              return false;
600
+              this.$message.error(response.data.msg)
601
+              return false
592 602
             } else {
593 603
               this.$notify({
594
-                title: "成功",
595
-                message: "删除成功",
596
-                type: "success",
604
+                title: '成功',
605
+                message: '删除成功',
606
+                type: 'success',
597 607
                 duration: 2000
598
-              });
608
+              })
599 609
 
600 610
               for (let i = 0; i < ids.length; i++) {
601 611
                 for (let y = 0; y < this.Warehouse.warehouseDate.length; y++) {
602 612
                   if (ids[i] == this.Warehouse.warehouseDate[y].id) {
603
-                    this.Warehouse.warehouseDate.splice(y, 1);
613
+                    this.Warehouse.warehouseDate.splice(y, 1)
604 614
                   }
605 615
                 }
606 616
               }
607 617
             }
608
-          });
618
+          })
609 619
         })
610
-        .catch(() => {});
620
+        .catch(() => {})
611 621
     }
612 622
   }
613
-};
623
+}
614 624
 </script>
615 625
 
616 626
 <style rel="stylesheet/css" lang="scss" scoped>

+ 18 - 4
src/xt_pages/user/patients.vue View File

@@ -13,7 +13,7 @@
13 13
 
14 14
     <div class="cell clearfix">
15 15
       <label class="title"><span class="name">日期查询</span> : </label>
16
-      <el-date-picker size="small" clearable v-model="listQuery.start_time"   prefix-icon="el-icon-date" @change="changeTime" :editable="false" style="width: 196px;" type="date" placeholder="选择日期时间" align="right"   format="yyyy-MM-dd" value-format="yyyy-MM-dd" > </el-date-picker>
16
+      <el-date-picker size="small" clearable v-model="listQuery.start_time"   prefix-icon="el-icon-date" @change="changeTimeOne" :editable="false" style="width: 196px;" type="date" placeholder="选择日期时间" align="right"   format="yyyy-MM-dd" value-format="yyyy-MM-dd" > </el-date-picker>
17 17
       <span class="cellLine"> - </span>
18 18
       <el-date-picker size="small" clearable v-model="listQuery.end_time"   prefix-icon="el-icon-date" @change="changeTime" :editable="false" style="width: 196px;" type="date" placeholder="选择日期时间" align="right"   format="yyyy-MM-dd" value-format="yyyy-MM-dd"> </el-date-picker>
19 19
     </div>
@@ -367,7 +367,8 @@ export default {
367 367
         gender: '',
368 368
         idcardno: '',
369 369
         phone: '',
370
-        healthcareno: ''
370
+        healthcareno: '',
371
+        startTime:'',
371 372
       }
372 373
     },
373 374
     created() {
@@ -381,6 +382,7 @@ export default {
381 382
         this.searchKey = keyword
382 383
       }
383 384
     },
385
+    
384 386
 
385 387
     methods: {
386 388
       EditLapseto() {
@@ -472,8 +474,20 @@ export default {
472 474
         this.listQuery.source = source
473 475
         this.getList()
474 476
       },
475
-      changeTime() {
476
-        this.getList()
477
+      changeTimeOne(val) {
478
+        this.startTime = this.getTimestamp(val)
479
+      },
480
+      changeTime(val) {
481
+        var time = this.getTimestamp(val) - this.startTime
482
+        if (time < 0) {
483
+          this.$message.error('结束时间不能小于开始时间')
484
+          this.listQuery.end_time = ''
485
+        } else {
486
+          this.getList()
487
+        }
488
+      },
489
+      getTimestamp(time) { // 把时间日期转成时间戳
490
+        return (new Date(time)).getTime() / 1000
477 491
       },
478 492
       search() {
479 493
         this.listQuery.keywords = this.searchKey

+ 4 - 0
src/xt_pages/workforce/components/tableData.vue View File

@@ -1570,4 +1570,8 @@
1570 1570
 .el-table td{
1571 1571
   border-color: #d0d3da;
1572 1572
 }
1573
+
1574
+.el-table__body tr.current-row>td {
1575
+    background-color: rgb(236, 245, 255);
1576
+}
1573 1577
 </style>

+ 131 - 93
src/xt_pages/workforce/components/template_schedule_selector_dialog.vue View File

@@ -1,105 +1,143 @@
1 1
 <template>
2
-    <el-dialog title="选择患者" width="40%" :visible.sync="visible" :before-close="_close">
3
-        <el-form :model="form" label-width="80px">
4
-            <el-form-item label="患者">
5
-                <el-select v-model="form.patient_id" placeholder="选择患者" filterable clearable>
6
-                    <el-option v-for="patient in patients" :key="patient.id" :value="patient.id" :label="patient.name">
7
-                    </el-option>
8
-                </el-select>
9
-            </el-form-item>
10
-            <el-form-item label="透析模式">
11
-                <el-select v-model="form.treat_mode" placeholder="选择透析模式" clearable>
12
-                    <el-option v-for="mode in treatment_modes" :key="mode.id" :value="mode.id" :label="mode.name">
13
-                    </el-option>
14
-                </el-select>
15
-            </el-form-item>
16
-        </el-form>
17
-        <div slot="footer" class="dialog-footer">
18
-            <el-button  @click="cancelScheduleAction">取消排班</el-button>
19
-            <el-button type="primary" @click="saveAction">保 存</el-button>
20
-        </div>
21
-    </el-dialog>
2
+  <el-dialog
3
+    title="选择患者"
4
+    width="40%"
5
+    :visible.sync="visible"
6
+    :before-close="_close"
7
+  >
8
+    <el-form :model="form" label-width="80px" :rules="rules">
9
+      <el-form-item label="患者" required prop="patient_id">
10
+        <el-select
11
+          v-model="form.patient_id"
12
+          placeholder="选择患者"
13
+          filterable
14
+          clearable
15
+        >
16
+          <el-option
17
+            v-for="patient in patients"
18
+            :key="patient.id"
19
+            :value="patient.id"
20
+            :label="patient.name"
21
+          >
22
+          </el-option>
23
+        </el-select>
24
+      </el-form-item>
25
+      <el-form-item label="透析模式" required prop="treat_mode">
26
+        <el-select
27
+          v-model="form.treat_mode"
28
+          placeholder="选择透析模式"
29
+          clearable
30
+        >
31
+          <el-option
32
+            v-for="mode in treatment_modes"
33
+            :key="mode.id"
34
+            :value="mode.id"
35
+            :label="mode.name"
36
+          >
37
+          </el-option>
38
+        </el-select>
39
+      </el-form-item>
40
+    </el-form>
41
+    <div slot="footer" class="dialog-footer">
42
+      <el-button @click="cancelScheduleAction">取消排班</el-button>
43
+      <el-button type="primary" @click="saveAction">保 存</el-button>
44
+    </div>
45
+  </el-dialog>
22 46
 </template>
23 47
 
24 48
 <script>
25 49
 export default {
26
-    name: "ScheduleSelectorDialog",
27
-    data() {
28
-        return {
29
-            visible: false,
30
-            form: {
31
-                patient_id: '',
32
-                treat_mode: '',
33
-                weekday: 1,
34
-                time_type: 1, 
35
-                device_number_id: 0,
36
-            },
37
-            treatment_modes: {},
38
-        }
39
-    },
40
-    props: {
41
-        patients: {
42
-            type: Array,
43
-            default: function() {
44
-                return []
45
-            }
46
-        },
50
+  name: "ScheduleSelectorDialog",
51
+  data() {
52
+    return {
53
+      visible: false,
54
+      form: {
55
+        patient_id: "",
56
+        treat_mode: "",
57
+        weekday: 1,
58
+        time_type: 1,
59
+        device_number_id: 0
60
+      },
61
+      treatment_modes: {},
62
+      rules: {
63
+        patient_id: [{ required: true, message: "请选择患者" }],
64
+        treat_mode: [{ required: true, message: "请选择透析模式" }]
65
+      }
66
+    };
67
+  },
68
+  props: {
69
+    patients: {
70
+      type: Array,
71
+      default: function() {
72
+        return [];
73
+      }
74
+    }
75
+  },
76
+  created() {
77
+    this.treatment_modes = this.$store.getters.treatment_mode;
78
+  },
79
+  methods: {
80
+    _close: function(done) {
81
+      this.clear();
82
+      done();
47 83
     },
48
-    created() {
49
-        this.treatment_modes = this.$store.getters.treatment_mode
84
+    clear: function() {
85
+      this.form.patient_id = "";
86
+      this.form.treat_mode = "";
87
+      this.form.weekday = 1;
88
+      this.form.time_type = 1;
89
+      this.form.device_number_id = 0;
50 90
     },
51
-    methods: {
52
-        _close: function(done) {
53
-            this.clear()
54
-            done()
55
-        },
56
-        clear: function() {
57
-            this.form.patient_id = ""
58
-            this.form.treat_mode = ""
59
-            this.form.weekday = 1
60
-            this.form.time_type = 1
61
-            this.form.device_number_id = 0
62
-        },
63
-        show(weekday, time_type, device_number_id) {
64
-            this.clear()
91
+    show(weekday, time_type, device_number_id) {
92
+      this.clear();
65 93
 
66
-            this.form.weekday = weekday
67
-            this.form.time_type = time_type
68
-            this.form.device_number_id = device_number_id
69
-            this.visible = true
70
-        },
71
-        showWith(patient_id, treat_mode, weekday, time_type, device_number_id) {
72
-            this.clear()
94
+      this.form.weekday = weekday;
95
+      this.form.time_type = time_type;
96
+      this.form.device_number_id = device_number_id;
97
+      this.visible = true;
98
+    },
99
+    showWith(patient_id, treat_mode, weekday, time_type, device_number_id) {
100
+      this.clear();
73 101
 
74
-            this.form.patient_id = patient_id
75
-            this.form.treat_mode = treat_mode
76
-            this.form.weekday = weekday
77
-            this.form.time_type = time_type
78
-            this.form.device_number_id = device_number_id
79
-            this.visible = true
80
-        },
81
-        hide() {
82
-            this.clear()
83
-            this.visible = false
84
-        },
85
-        saveAction: function() {
86
-            if (this.form.patient_id <= 0) {
87
-                this.$message.error("请选择患者", 1500)
88
-                return
89
-            }
90
-            if (this.form.treat_mode <= 0) {
91
-                this.$message.error("请选择透析模式", 1500)
92
-                return
93
-            }
94
-            this.$emit("did_selected", this.form.patient_id, this.form.treat_mode, this.form.weekday, this.form.time_type, this.form.device_number_id)
95
-        },
96
-        cancelScheduleAction: function() {
97
-            this.$emit("did_cancel", this.form.weekday, this.form.time_type, this.form.device_number_id)
98
-        }
102
+      this.form.patient_id = patient_id;
103
+      this.form.treat_mode = treat_mode;
104
+      this.form.weekday = weekday;
105
+      this.form.time_type = time_type;
106
+      this.form.device_number_id = device_number_id;
107
+      this.visible = true;
108
+    },
109
+    hide() {
110
+      this.clear();
111
+      this.visible = false;
112
+    },
113
+    saveAction: function() {
114
+      if (this.form.patient_id <= 0) {
115
+        this.$message.error("请选择患者", 1500);
116
+        return;
117
+      }
118
+      if (this.form.treat_mode <= 0) {
119
+        this.$message.error("请选择透析模式", 1500);
120
+        return;
121
+      }
122
+      this.$emit(
123
+        "did_selected",
124
+        this.form.patient_id,
125
+        this.form.treat_mode,
126
+        this.form.weekday,
127
+        this.form.time_type,
128
+        this.form.device_number_id
129
+      );
130
+    },
131
+    cancelScheduleAction: function() {
132
+      this.$emit(
133
+        "did_cancel",
134
+        this.form.weekday,
135
+        this.form.time_type,
136
+        this.form.device_number_id
137
+      );
99 138
     }
100
-}
139
+  }
140
+};
101 141
 </script>
102 142
 
103
-<style scoped>
104
-
105
-</style>
143
+<style scoped></style>