Browse Source

Merge branch '20230223_pc_vue_new_branch' of http://git.shengws.com/csx/Vue_New into 20230223_pc_vue_new_branch

28169 1 year ago
parent
commit
d2a06896f4

+ 87 - 3
src/vendor/Export2Excel.js View File

@@ -182,6 +182,7 @@ export function export_json_to_excel({
182 182
       if (val == null) {
183 183
         return {
184 184
           'wch': 10
185
+          // 'wch': 1
185 186
         };
186 187
       }
187 188
       /*再判断是否为中文*/
@@ -199,9 +200,12 @@ export function export_json_to_excel({
199 200
     let result = colWidth[0];
200 201
     for (let i = 1; i < colWidth.length; i++) {
201 202
       for (let j = 0; j < colWidth[i].length; j++) {
202
-        if (result[j]['wch'] < colWidth[i][j]['wch']) {
203
-          result[j]['wch'] = colWidth[i][j]['wch'];
204
-        }
203
+        // console.log('7777',result[j]['wch'] ,colWidth[i][j]['wch']);
204
+        // if(colWidth[i][j]['wch']!=''){
205
+          if (result[j]['wch'] < colWidth[i][j]['wch']) {
206
+            result[j]['wch'] = colWidth[i][j]['wch'];
207
+          }
208
+        // }
205 209
       }
206 210
     }
207 211
     ws['!cols'] = result;
@@ -387,3 +391,83 @@ export function export_json_to_excel2({
387 391
     type: "application/octet-stream"
388 392
   }), `${filename}.${bookType}`);
389 393
 }
394
+
395
+export function export_json_to_excel3({
396
+  multiHeader = [],
397
+  header,
398
+  data,
399
+  filename,
400
+  merges = [],
401
+  autoWidth = true,
402
+  bookType = 'xlsx'
403
+} = {}) {
404
+  /* original data */
405
+  filename = filename || 'excel-list'
406
+  data = [...data]
407
+  data.unshift(header);
408
+  console.log('wwwww',data);
409
+  for (let i = multiHeader.length - 1; i > -1; i--) {
410
+    data.unshift(multiHeader[i])
411
+  }
412
+  console.log('qqqqq',data);
413
+  var ws_name = "SheetJS";
414
+  var wb = new Workbook(),
415
+    ws = sheet_from_array_of_arrays(data);
416
+
417
+  if (merges.length > 0) {
418
+    if (!ws['!merges']) ws['!merges'] = [];
419
+    merges.forEach(item => {
420
+      console.log(XLSX.utils.decode_range(item))
421
+      ws['!merges'].push(XLSX.utils.decode_range(item))
422
+    })
423
+  }
424
+
425
+  if (autoWidth) {
426
+    /*设置worksheet每列的最大宽度*/
427
+    const colWidth = data.map(row => row.map(val => {
428
+      /*先判断是否为null/undefined*/
429
+      if (val == null) {
430
+        return {
431
+          'wch': 10
432
+          // 'wch': 1
433
+        };
434
+      }
435
+      /*再判断是否为中文*/
436
+      else if (val.toString().charCodeAt(0) > 255) {
437
+        return {
438
+          'wch': val.toString().length * 2
439
+        };
440
+      } else {
441
+        return {
442
+          'wch': val.toString().length
443
+        };
444
+      }
445
+    }))
446
+    /*以第一行为初始值*/
447
+    let result = colWidth[0];
448
+    for (let i = 1; i < colWidth.length; i++) {
449
+      for (let j = 0; j < colWidth[i].length; j++) {
450
+        // console.log('7777',result[j]['wch'] ,colWidth[i][j]['wch']);
451
+        if(colWidth[i][j]['wch']!=''){
452
+          if (result[j]['wch'] < colWidth[i][j]['wch']) {
453
+            result[j]['wch'] = colWidth[i][j]['wch'];
454
+          }
455
+        }
456
+      }
457
+    }
458
+    ws['!cols'] = result;
459
+  }
460
+
461
+  /* add worksheet to workbook */
462
+  wb.SheetNames.push(ws_name);
463
+  wb.Sheets[ws_name] = ws;
464
+
465
+  var wbout = XLSX.write(wb, {
466
+    bookType: bookType,
467
+    bookSST: false,
468
+    type: 'binary'
469
+  });
470
+  saveAs(new Blob([s2ab(wbout)], {
471
+    type: "application/octet-stream"
472
+  }), `${filename}.${bookType}`);
473
+}

+ 40 - 11
src/xt_pages/outpatientCharges/outpatientChargesManagement.vue View File

@@ -112,11 +112,9 @@
112 112
             <!--                       type="primary">记账-->
113 113
             <!--            </el-button>-->
114 114
 
115
-
116
-
117 115
             <el-button v-loading="loadingone" size="small"
118 116
                        @click="open(40)"
119
-                       v-if="org_id == 10191 || org_id == 10318 || org_id == 10567"
117
+                       v-if="org_id == 10191 || org_id == 10318 || org_id == 10567  || org_id == 10375"
120 118
                        type="primary">登陆
121 119
             </el-button>
122 120
 
@@ -3428,15 +3426,46 @@ export default {
3428 3426
         }
3429 3427
 
3430 3428
       } else if (index == 9) {
3431
-        this.statementVisible = true
3432
-        let obj = {
3433
-          order_id: this.order.id,
3434
-          settle_type: this.order.settle_type,
3435
-          start_time: this.order.settle_start_time,
3436
-          end_time: this.order.settle_end_time,
3437
-          balance_accounts_type: this.hisPatientInfo.balance_accounts_type
3429
+        if (this.org_id == 10375){
3430
+          var that = this
3431
+          axios
3432
+            .get('http://127.0.0.1:9532/api/settle/query', {
3433
+              params: {
3434
+                order_id: that.order.id,
3435
+                admin_user_id: that.$store.getters.xt_user.user.id
3436
+              }
3437
+            })
3438
+            .then(function(response) {
3439
+              if (response.data.state == 0) {
3440
+                this.$message.error(response.data.msg)
3441
+                return false
3442
+              } else {
3443
+                if (response.data.data.failed_code == -10) {
3444
+                  // that.$message.error(response.data.data.msg)
3445
+                  that.$confirm(response.data.data.msg, '医保错误信息', {
3446
+                    confirmButtonText: '确 定',
3447
+                    type: 'warning'
3448
+                  }).then(() => {
3449
+
3450
+                  }).catch(() => {
3451
+                  })
3452
+                }
3453
+              }
3454
+            })
3455
+            .catch(function(error) {
3456
+            })
3457
+        }else{
3458
+          this.statementVisible = true
3459
+          let obj = {
3460
+            order_id: this.order.id,
3461
+            settle_type: this.order.settle_type,
3462
+            start_time: this.order.settle_start_time,
3463
+            end_time: this.order.settle_end_time,
3464
+            balance_accounts_type: this.hisPatientInfo.balance_accounts_type
3465
+          }
3466
+          this.orderObj = obj
3467
+
3438 3468
         }
3439
-        this.orderObj = obj
3440 3469
         // this.$refs.print.getInfo(this.order.id)
3441 3470
       }else if (index == 100) {
3442 3471
         this.newStatementVisibleTwo = true

File diff suppressed because it is too large
+ 1592 - 35
src/xt_pages/workforce/appointment.vue