Browse Source

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

28169 6 months ago
parent
commit
4457b7f5d0
1 changed files with 56 additions and 14 deletions
  1. 56 14
      src/xt_pages/eleFaPiao/settleDetail.vue

+ 56 - 14
src/xt_pages/eleFaPiao/settleDetail.vue View File

151
                         @click="blue(scope.row)">
151
                         @click="blue(scope.row)">
152
               开票
152
               开票
153
             </el-button>
153
             </el-button>
154
-            <el-button v-if="scope.row.result.id == 0 && scope.row.result.fapiao_status == 1" disabled="true" size="mini" type="primary"
154
+            <el-button v-if="scope.row.result.id > 0 && scope.row.result.fapiao_status == 1" disabled="true" size="mini" type="primary"
155
                        @click="blue(scope.row)">
155
                        @click="blue(scope.row)">
156
               开票审核中
156
               开票审核中
157
             </el-button>
157
             </el-button>
163
                        @click="yulan(scope.row)">
163
                        @click="yulan(scope.row)">
164
               下载
164
               下载
165
             </el-button>
165
             </el-button>
166
+            <el-button size="mini" type="primary" v-if="scope.row.result.id > 0 && scope.row.result.is_red_washed == 0 && scope.row.result.fapiao_status == 2 && scope.row.fapiao_number == ''"
167
+                       @click="chaxun(scope.row)">
168
+              查询并同步发票号码
169
+            </el-button>
166
           </template>
170
           </template>
167
         </el-table-column>
171
         </el-table-column>
168
       </el-table>
172
       </el-table>
374
   },
378
   },
375
 
379
 
376
   methods: {
380
   methods: {
381
+    chaxun(row){
382
+      let params = {
383
+        "id": row.result.id,
384
+        "admin_user_id":this.$store.getters.xt_user.user.id,
385
+      }
386
+      var that = this;
387
+      axios.get('http://127.0.0.1:9532/api/fapiao/query',{params:params}).then(function(response) {
388
+        if (response.data.state == 0) {
389
+          that.$message.error(response.data.data.msg);
390
+          return false
391
+        } else {
392
+          if(response.data.data.failed_code == -10){
393
+            that.settlementVisible = false
394
+            that.$confirm(response.data.data.msg, '错误信息', {
395
+              confirmButtonText: '确 定',
396
+              type: 'warning'
397
+            }).then(() => {
398
+
399
+            }).catch(() => {
400
+            })
401
+          }else{
402
+            this.getHisOrderList()
403
+            that.$confirm(response.data.data.msg, '信息', {
404
+              confirmButtonText: '确 定',
405
+              type: 'warning'
406
+            }).then(() => {
407
+
408
+            }).catch(() => {
409
+            })
410
+          }
411
+        }
412
+      }).catch(function(error) {
413
+      })
414
+    },
377
     loginSJ(){
415
     loginSJ(){
378
       // let params = {
416
       // let params = {
379
       //   "code":this.formLabelAlign.verify,
417
       //   "code":this.formLabelAlign.verify,
567
             })
605
             })
568
           }else{
606
           }else{
569
             if(response.data.data.cus_status == 1){
607
             if(response.data.data.cus_status == 1){
570
-              that.$nextTick(() =>{
571
-                that.$refs.qrCodeUrl.innerHTML = ''; // Clear the container
572
-                var qrcode = new QRCode(that.$refs.qrCodeUrl, {
573
-                  text: response.data.data.qr_code, // 需要转换为二维码的内容
574
-                  width: 120,
575
-                  height: 120,
576
-                  colorDark: '#000000',
577
-                  colorLight: '#ffffff',
578
-                  correctLevel: QRCode.CorrectLevel.H
579
-                })
580
-              })
581
-              that.qr_dialogVisible =true
608
+              Vue.nextTick(() => {
609
+                // 确保二维码数据存在
610
+                if (response.data.data.qr_code) {
611
+                  // 生成新的二维码
612
+                  var qrcode = new QRCode(that.$refs.qrCodeUrl, {
613
+                    text: response.data.data.qr_code,
614
+                    width: 120,
615
+                    height: 120,
616
+                    colorDark: '#000000',
617
+                    colorLight: '#ffffff',
618
+                    correctLevel: QRCode.CorrectLevel.H
619
+                  });
620
+                  that.qr_dialogVisible = true;
621
+                } else {
622
+                  that.$message.error('二维码数据为空。');
623
+                }
624
+              });
582
             }else if(response.data.data.cus_status == -1){
625
             }else if(response.data.data.cus_status == -1){
583
               // this.$message.error(response.data.msg)/*  */
626
               // this.$message.error(response.data.msg)/*  */
584
               that
627
               that
644
         "order_ids": this.cur_ids,
687
         "order_ids": this.cur_ids,
645
         "admin_user_id":this.$store.getters.xt_user.user.id,
688
         "admin_user_id":this.$store.getters.xt_user.user.id,
646
       }
689
       }
647
-
648
       var that = this;
690
       var that = this;
649
       axios.get('http://127.0.0.1:9532/api/fapiao/blue',{params:params}).then(function(response) {
691
       axios.get('http://127.0.0.1:9532/api/fapiao/blue',{params:params}).then(function(response) {
650
         if (response.data.state == 0) {
692
         if (response.data.state == 0) {