Эх сурвалжийг харах

Merge branch 'feature/v4.9.21' into dev/v4.9.21_rjj

renjiaojiao 1 жил өмнө
parent
commit
3d1e9d7bf3

+ 10 - 9
src/jfw/front/dataExport.go

@@ -351,13 +351,14 @@ func IsAllowInvoice(res map[string]interface{}) bool {
 	filter := util.ObjToString(res["filter"].(string))
 	filter_map := map[string]interface{}{}
 	_ = json.Unmarshal([]byte(filter), &filter_map)
-	if util.IntAll(res["order_status"]) == 1 && util.InterfaceToStr(filter_map["badge"]) != "exchange" &&
-		//用户下单|| 代用户下单|| qmx下单 已全额回款 发票企业为剑鱼
-		(util.IntAll(res["is_backstage_order"]) == 0 || util.InterfaceToStr(res["order_channel"]) == "xdqd04" ||
-			(util.IntAll(res["return_status"]) == 1 && public.Mysql.Count("invoice", map[string]interface{}{
-				"order_code": res["order_code"],
-			}) == 0 && util.InterfaceToStr(res["signing_subject"]) == "h01")) {
-		return true
+	if util.IntAll(res["order_status"]) == 1 && util.InterfaceToStr(filter_map["badge"]) != "exchange" {
+		//用户下单|| 代用户下单
+		if util.IntAll(res["is_backstage_order"]) == 0 || util.InterfaceToStr(res["order_channel"]) == "xdqd04" {
+			return len(ShowList(util.InterfaceToStr(res["order_code"]))) == 0
+		} else { //qmx下单 已全额回款 发票企业为剑鱼
+			return util.IntAll(res["return_status"]) == 1 && util.InterfaceToStr(res["signing_subject"]) == "h01" &&
+				len(ShowList(util.InterfaceToStr(res["order_code"]))) == 0
+		}
 	}
 	return false
 }
@@ -429,8 +430,8 @@ func (d *DataExport) ToOrderDetail(orderCode string) error {
 		create_time_str := util.ObjToString(orderDetail["create_time"])
 		create_time, _ := time.ParseInLocation(Date_Full_Layout, create_time_str, time.Local)
 		if create_time.Unix() > 1704038400 {
-			//剩余可开票金额
-			isCanInvoic = IsAllowInvoice(orderDetail) && InvoicePrice(orderDetail) > 0
+			//可开票
+			isCanInvoic = IsAllowInvoice(orderDetail)
 		}
 		orderDetail["is_can_invoice"] = isCanInvoic
 		//是否存在可查看发票

+ 1 - 1
src/jfw/modules/app/src/web/templates/big-member/page_orderdetail_aiForecastPack.html

@@ -336,7 +336,7 @@
                 $(".invoice").css("display", "none");//隐藏开发票
             }
             if(r.data.is_backstage_order===1){
-                $(".invoice").css("display", "none");//隐藏开发票
+                // $(".invoice").css("display", "none");//隐藏开发票
             }
         })
     })

+ 1 - 1
src/jfw/modules/app/src/web/templates/big-member/page_orderdetail_subAccount.html

@@ -341,7 +341,7 @@
                 $(".invoice").css("display", "none");//隐藏开发票
             }
             if(r.data.is_backstage_order===1){
-                $(".invoice").css("display", "none");//隐藏开发票
+                // $(".invoice").css("display", "none");//隐藏开发票
             }
         })
     })

+ 12 - 7
src/jfw/modules/subscribepay/src/service/invoice.go

@@ -483,6 +483,7 @@ func (this *Invoice) ShowinvoiceList() {
 					"order_code":       order_code,
 				})+1 >= config.InvoiceConfig.SubmitNum
 			}
+			data["only_Identifying"] = encrypt.SE.EncodeString(qutil.InterfaceToStr(data["only_Identifying"]))
 			data["isReopen"] = isReopen
 			invoiceData = append(invoiceData, data)
 		}
@@ -528,6 +529,7 @@ func (this *Invoice) NewInvoiceShow() {
 		invoice := util.Mysql.FindOne("invoice", map[string]interface{}{"id": encrypt.SE.Decode4Hex(code)}, "id,only_Identifying,order_code,invoice_money,remark,invoice_type,invoice_content,invoice_variety,company_name,phone,mail,taxpayer_identnum,invoice_money,invoice_order_money,company_address,bank_name,recipient,delivery_address,bank_account,company_phone", "")
 		if invoice != nil {
 			(*invoice)["id"] = code
+			(*invoice)["only_Identifying"] = encrypt.SE.EncodeString(qutil.InterfaceToStr((*invoice)["only_Identifying"]))
 		}
 		data["invoice"] = invoice
 	}
@@ -1390,13 +1392,14 @@ func IsAllowInvoice(res map[string]interface{}) bool {
 	filter := qutil.ObjToString(res["filter"].(string))
 	filter_map := map[string]interface{}{}
 	_ = json.Unmarshal([]byte(filter), &filter_map)
-	if qutil.IntAll(res["order_status"]) == 1 && qutil.InterfaceToStr(filter_map["badge"]) != "exchange" &&
-		//用户下单|| 代用户下单|| qmx下单 已全额回款 发票企业为剑鱼
-		(qutil.IntAll(res["is_backstage_order"]) == 0 || qutil.InterfaceToStr(res["order_channel"]) == "xdqd04" ||
-			(qutil.IntAll(res["return_status"]) == 1 && util.Mysql.Count("invoice", map[string]interface{}{
-				"order_code": res["order_code"],
-			}) == 0 && qutil.InterfaceToStr(res["signing_subject"]) == "h01")) {
-		return true
+	if qutil.IntAll(res["order_status"]) == 1 && qutil.InterfaceToStr(filter_map["badge"]) != "exchange" {
+		//用户下单|| 代用户下单
+		if qutil.IntAll(res["is_backstage_order"]) == 0 || qutil.InterfaceToStr(res["order_channel"]) == "xdqd04" {
+			return len(ShowList(qutil.InterfaceToStr(res["order_code"]))) == 0
+		} else { //qmx下单 已全额回款 发票企业为剑鱼
+			return qutil.IntAll(res["return_status"]) == 1 && qutil.InterfaceToStr(res["signing_subject"]) == "h01" &&
+				len(ShowList(qutil.InterfaceToStr(res["order_code"]))) == 0
+		}
 	}
 	return false
 }
@@ -1421,6 +1424,8 @@ func (this *Invoice) Available() {
 					status = 1
 				}
 			}
+		} else {
+			status = 1
 		}
 	}
 	this.ServeJson(map[string]interface{}{

+ 3 - 3
src/jfw/modules/subscribepay/src/service/orderListDetails.go

@@ -667,7 +667,7 @@ func (o *OrderListDetails) Datas(sql string, pageNum, pagesize_max int) (haveNex
 			var isCanInvoic bool
 			if create_time.Unix() > config.InvoiceConfig.Order_createtime {
 				//剩余可开票金额
-				isCanInvoic = IsAllowInvoice(result[i]) && InvoicePrice(result[i]) > 0
+				isCanInvoic = IsAllowInvoice(result[i])
 			}
 			result[i]["is_can_invoice"] = isCanInvoic
 			//是否存在可查看发票
@@ -877,8 +877,8 @@ func CommonDetail(bigm int, fields, userId, order_code string, session *httpsess
 				//是否满足可开票
 				var isCanInvoic bool
 				if t.Unix() > config.InvoiceConfig.Order_createtime {
-					//剩余可开票金额
-					isCanInvoic = IsAllowInvoice(data) && InvoicePrice(data) > 0
+					//可开票
+					isCanInvoic = IsAllowInvoice(data)
 				}
 				data["is_can_invoice"] = isCanInvoic
 				//是否存在可查看发票

+ 9 - 9
src/web/staticres/common-module/order-list/js/order-list.js

@@ -1019,15 +1019,15 @@ var vm = new Vue({
       }
 
       // 大会员公对公转账发票提示
-      if (productType === '大会员' && order.pay_way === 'transferAccounts' && type !== 'look') {
-        return this.showDialog({
-          title: '',
-          message: '请联系客服开票<br>客服热线:400-108-6670',
-          className: 'j-confirm-dialog text-center',
-          showCancelButton: false,
-          confirmButtonText: '我知道了'
-        })
-      }
+      // if (productType === '大会员' && order.pay_way === 'transferAccounts' && type !== 'look') {
+      //   return this.showDialog({
+      //     title: '',
+      //     message: '请联系客服开票<br>客服热线:400-108-6670',
+      //     className: 'j-confirm-dialog text-center',
+      //     showCancelButton: false,
+      //     confirmButtonText: '我知道了'
+      //   })
+      // }
 
 
       // 已开发票情况(查看发票)

+ 8 - 12
src/web/templates/pc/aiPack_orderDetail.html

@@ -222,18 +222,14 @@
                             $(".pay_num").text(r.data.prepay_id);
                             $(".pay_num_p").css("display", "");
                         }
-                        if (source===""){
-                            if (r.data.is_backstage_order!==1){
-                                //发票
-                                if (r.data.is_can_invoice) {
-                                    $(".openinvoice").css("display", "");
-                                }
-                                if (r.data.invoice_show) {
-                                    $(".lookinvoice").css("display", "").on("click", function () {
-                                        checkinvoice(r.data.applybill_status, orderCode)
-                                    })
-                                }
-                            }
+                        //发票
+                        if (r.data.is_can_invoice) {
+                            $(".openinvoice").css("display", "");
+                        }
+                        if (r.data.invoice_show) {
+                            $(".lookinvoice").css("display", "").on("click", function () {
+                                checkinvoice(r.data.applybill_status, orderCode)
+                            })
                         }
                     }
                     if (r.data.order_status === -2) {

+ 18 - 4
src/web/templates/pc/check_invoice.html

@@ -53,7 +53,7 @@
             <a href="javascript:;" class="active">查看发票</a>
         </div>
         <div class="w invoice_status" v-if="invoiceData.length > 1">
-          <div class="white_shadow left_shadow" @click="clickArrow('left')" v-if="invoiceData.length > 6 && leftBtn">
+          <div class="white_shadow left_shadow" @click="clickArrow('left')" v-if="leftBtn">
             <div class="el-iconfont">
               <i class="el-icon-arrow-left"></i>
             </div>
@@ -67,7 +67,7 @@
               </div>
             </div>
           </div>
-          <div class="white_shadow right_shadow" @click="clickArrow('right')" v-if="invoiceData.length > 6 && rightBtn">
+          <div class="white_shadow right_shadow" @click="clickArrow('right')" v-if="showRightBtn && rightBtn">
             <div class="el-iconfont">
               <i class="el-icon-arrow-right"></i>
             </div>
@@ -444,7 +444,8 @@
             loading: true,
             leftBtn: false,
             rightBtn: true,
-            invoice_text: ''
+            invoice_text: '',
+            showRightBtn: false
           }
         },
         created() {
@@ -452,6 +453,20 @@
         },
         mounted() {
           $('#check_invoice').show()
+          this.$nextTick(() => {
+            const checkInvoiceDisplay = () => {
+              let canhandleNum = 0
+              const itemAllWidth = $('.invoice_status_item').map(function() {
+                return $(this).outerWidth() + 12;
+              }).get();
+              this.showRightBtn = itemAllWidth.reduce((sum, width) => sum + width, 0) - 1200 > 0;
+              if (itemAllWidth.length === 0 && canhandleNum < 10) {
+                canhandleNum++
+                setTimeout(checkInvoiceDisplay, 50)
+              }
+            }
+            checkInvoiceDisplay()
+          })
         },
         methods: {
           // 联系客服
@@ -520,7 +535,6 @@
           clickArrow(data) {
             var invoiceStatusList = $('.invoice_status_list');
             var invoiceStatusListWidth = invoiceStatusList.width();
-            var invoiceStatusItem = $('.invoice_status_item')
             var itemAllWidth = $('.invoice_status_item').map(function() {
               return $(this).outerWidth() + 12; // 获取包括内边距的宽度 + margin值
             }).get();

+ 3 - 1
src/web/templates/pc/invoice.html

@@ -252,7 +252,7 @@
                   { required: true, message: '请输入邮箱地址', trigger: 'blur' }
                 ],
                 company_name: [
-                  { required: true, message: '请输入单位名称', trigger: 'blur' },
+                  { required: true, message: '请输入公司名称', trigger: 'blur' },
                   { validator: this.validateCompany, trigger: 'blur' }
                 ],
                 taxpayer_identnum: [
@@ -503,6 +503,8 @@
                     params.sid = this.urlParams.invoiceid
                   } else if(this.urlParams.type === 'again') {
                     // 开票失败,再次开票
+                    params.again = 1
+                    params.oldOnlyIdentifying = this.urlParams.only_Identifying
                     params.only_Identifying = this.urlParams.only_Identifying
                   }
                   this.onConfirm(url, params)

+ 7 - 10
src/web/templates/pc/medaratus_orderDetail.html

@@ -293,16 +293,13 @@
                                 $(".pay_num").text(r.data.transaction_id);
                             }
                             //发票
-                            // 后台渠道为xdqd04(销售代下单)可以开发票,其他后台创建订单不可以开发票
-                            if (r.data.order.is_backstage_order!==1 || r.data.order.order_channel === 'xdqd04'){
-                                if (r.data.is_can_invoice) {
-                                    $(".openinvoice").css("display", "");
-                                } 
-                                if (r.data.invoice_show) {
-                                    $(".lookinvoice").css("display", "").on("click", function () {
-                                        checkinvoice(r.data.applybill_status, orderCode)//查看发票
-                                    })
-                                }
+                            if (r.data.is_can_invoice) {
+                                $(".openinvoice").css("display", "");
+                            } 
+                            if (r.data.invoice_show) {
+                                $(".lookinvoice").css("display", "").on("click", function () {
+                                    checkinvoice(r.data.applybill_status, orderCode)//查看发票
+                                })
                             }
                         }
                     }

+ 12 - 20
src/web/templates/pc/member_orderDetail.html

@@ -340,10 +340,6 @@
                                 $(".pay_way_p").css("display", "");
 
                                 $(".price").text("¥ " + formatMoney(r.data.pay_money / 100) + "元");
-                                $(".openinvoice").css({
-                                    'background': '#EDEFF2',
-                                    'color': '#5F5E64'
-                                })
                             }
                         }
 
@@ -352,22 +348,18 @@
                           $(".pay_num").text(r.data.prepay_id);
                            $(".pay_num_p").show();
                         }
-                        if (source===""){
-                            if(r.data.is_backstage_order!==1){ //发票
-                                if (r.data.is_can_invoice) {
-                                    $(".openinvoice").css("display", "").on("click", function () {
-                                        // return false // 待可开发票时删除
-                                        window.open("/front/order/invoice/" + orderCode, '_self');
-                                    });
-                                }
-                                if (r.data.invoice_show) {
-                                    $(".lookinvoice").css("display", "").on("click", function () {
-                                        checkinvoice(r.data.applybill_status, orderCode)//查看发票
-                                    })
-                                }
-                            }
-
-                        }else{
+                        if (r.data.is_can_invoice) {
+                            $(".openinvoice").css("display", "").on("click", function () {
+                                // return false // 待可开发票时删除
+                                window.open("/front/order/invoice/" + orderCode, '_self');
+                            });
+                        }
+                        if (r.data.invoice_show) {
+                            $(".lookinvoice").css("display", "").on("click", function () {
+                                checkinvoice(r.data.applybill_status, orderCode)//查看发票
+                            })
+                        }
+                        if(source){
                           // 自定义大会员展示服务列表
                           var buchongbaoHtml = '';
                           var serversName = filterObj.serversName;

+ 0 - 2
src/web/templates/pc/myOrder.html

@@ -1383,8 +1383,6 @@
                 location.href = href
               }
               return
-            } else if (item.product_type === '大会员' && item.pay_way === 'transferAccounts') {
-              this.goShowTipForInvoice('请联系客服开票<br>客服热线:400-108-6670')
             } else {
               window.open("/front/order/invoice/" + item.order_code);
             }

+ 7 - 12
src/web/templates/pc/subAccount_orderDetail.html

@@ -214,18 +214,13 @@
 
                         if (r.data.prepay_id) $(".pay_num").text(r.data.prepay_id);
 
-                        if (source===""){
-                          //发票
-                            if (r.data.is_backstage_order!==1){
-                                if (r.data.is_can_invoice) {
-                                    $(".openinvoice").css("display", "");
-                                }
-                                if (r.data.invoice_show) {
-                                    $(".lookinvoice").css("display", "").on("click", function () {
-                                        checkinvoice(r.data.applybill_status, orderCode)//查看发票
-                                    })
-                                }
-                            }
+                        if (r.data.is_can_invoice) {
+                            $(".openinvoice").css("display", "");
+                        }
+                        if (r.data.invoice_show) {
+                            $(".lookinvoice").css("display", "").on("click", function () {
+                                checkinvoice(r.data.applybill_status, orderCode)//查看发票
+                            })
                         }
                     }
                     if (r.data.order_status === -2) {

+ 7 - 10
src/web/templates/pc/vip_orderDetail.html

@@ -300,16 +300,13 @@
                                 $(".pay_num").text(r.data.transaction_id);
                             }
                             //发票
-                            // 后台渠道为xdqd04(销售代下单)可以开发票,其他后台创建订单不可以开发票
-                            if (r.data.order.is_backstage_order!==1 || r.data.order.order_channel === 'xdqd04'){
-                                if (r.data.order.is_can_invoice) {
-                                    $(".openinvoice").css("display", "");
-                                }
-                                if (r.data.invoice_show) {
-                                    $(".lookinvoice").css("display", "").on("click", function () {
-                                        checkinvoice(r.data.applybill_status, orderCode)//查看发票
-                                    })
-                                }
+                            if (r.data.order.is_can_invoice) {
+                                $(".openinvoice").css("display", "");
+                            }
+                            if (r.data.invoice_show) {
+                                $(".lookinvoice").css("display", "").on("click", function () {
+                                    checkinvoice(r.data.applybill_status, orderCode)//查看发票
+                                })
                             }
                         }
                     }

+ 1 - 1
src/web/templates/weixin/member/aiForecastPackdetail.html

@@ -337,7 +337,7 @@
                     $(".invoice").css("display", "none");//隐藏开发票
                 }
                 if(r.data.is_backstage_order===1){
-                    $(".invoice").css("display", "none");//隐藏开发票
+                    // $(".invoice").css("display", "none");//隐藏开发票
                 }
             }
         })

+ 1 - 1
src/web/templates/weixin/member/subAccountDetail.html

@@ -345,7 +345,7 @@
                 $(".invoice").css("display", "none");//隐藏开发票
             }
             if(r.data.is_backstage_order===1){
-                $(".invoice").css("display", "none");//隐藏开发票
+                // $(".invoice").css("display", "none");//隐藏开发票
             }
         })
     })