Browse Source

Merge branch 'release' into dev2.9.2

lianbingjie 5 years ago
parent
commit
43a86d9b63

+ 1 - 1
common/src/qfw/util/mysql/mysql.go

@@ -323,7 +323,7 @@ func (m *Mysql) UpdateByTx(tx *sql.Tx, tableName string, query, update map[strin
 	}
 	q := fmt.Sprintf("update %s set %s where %s", tableName, strings.Join(q_fs, ","), strings.Join(u_fs, " and "))
 	log.Println(q, values)
-	return m.UpdateOrDeleteBySqlByTx(tx, q, values...) > 0
+	return m.UpdateOrDeleteBySqlByTx(tx, q, values...) >= 0
 }
 
 //删除

+ 1 - 1
core/src/config.json

@@ -85,5 +85,5 @@
 	},
 	"pushSubscribeRpc":"127.0.0.1:1122",
 	"jyRpc":"127.0.0.1:8084",
-	"invoice_interface_address": "http://192.168.3.14:7080/Invoice/Add"
+	"invoice_interface_address": "http://192.168.3.14:7080/Invoice/RedSubmit"
 }

BIN
core/src/core2020


+ 1 - 2
core/src/qfw/manage/dataExport.go

@@ -48,7 +48,6 @@ func (d *DataExport) DataDetail(order_code string) error {
 	downloadUrl := util.ObjToString((*res)["download_url"])
 	//订单状态 用于判断是否取消 -2 为取消
 	order_status := util.IntAll((*res)["order_status"])
-	apply_refund_name := util.ObjToString((*res)["apply_refund_name"])
 
 	//申请发票
 	applybill_status := util.IntAll((*res)["applybill_status"])
@@ -98,7 +97,7 @@ func (d *DataExport) DataDetail(order_code string) error {
 
 	if pay_time != "" {
 		(*res)["order_status"] = "已支付"
-		if apply_refund_name != "" {
+		if order_status == -2 {
 			(*res)["order_status"] = "已取消"
 			(*res)["cancel"] = "已取消"
 		}

+ 4 - 1
core/src/qfw/manage/dataExportOrder.go

@@ -47,7 +47,7 @@ func (d *DataExportOrder) Pageing() {
 	if service_status != "" {
 		qMap["service_status"] = service_status
 	}
-	res := cutil.Mysql.Find("dataexport_order", qMap, "order_code,pay_time,data_spec,order_money,order_status,service_status,download_url,applybill_status,pay_money,pay_way,user_mail,applybill_company,applybill_type", "create_time desc", (currentPage-1)*perPage, perPage)
+	res := cutil.Mysql.Find("dataexport_order", qMap, "order_code,pay_time,data_spec,order_money,order_status,service_status,download_url,applybill_status,pay_money,pay_way,user_mail,applybill_company,applybill_type,apply_refund_time", "create_time desc", (currentPage-1)*perPage, perPage)
 
 	count := cutil.Mysql.Count("dataexport_order", qMap)
 	for k, v := range *res {
@@ -85,6 +85,9 @@ func (d *DataExportOrder) Pageing() {
 		} else {
 			//删除用户 -1 根据支付金额判断
 			v["order_status"] = "已支付"
+			if v["apply_refund_time"] != nil {
+				v["order_status"] = "已取消"
+			}
 		}
 		if v["download_url"] != nil {
 			v["download_url"] = coreconfig.SysConfig.JyWebdomain + v["download_url"].(string)

+ 10 - 3
core/src/qfw/manage/entnicheOrder.go

@@ -48,7 +48,7 @@ func (e *EntnicheOrder) EntnicheOrderPageing() {
 	}
 
 	qMap["product_type"] = "企业商机管理"
-	res := cutil.Mysql.Find("dataexport_order", qMap, "order_code,pay_time,product_type,order_money,order_status,applybill_status,pay_money,pay_way,user_mail,applybill_company,applybill_type,user_id,vip_type,original_price", "create_time desc", (currentPage-1)*perPage, perPage)
+	res := cutil.Mysql.Find("dataexport_order", qMap, "order_code,pay_time,product_type,order_money,order_status,applybill_status,pay_money,pay_way,user_mail,applybill_company,applybill_type,user_id,vip_type,original_price,apply_refund_time", "create_time desc", (currentPage-1)*perPage, perPage)
 
 	count := cutil.Mysql.Count("dataexport_order", qMap)
 	for k, v := range *res {
@@ -80,6 +80,9 @@ func (e *EntnicheOrder) EntnicheOrderPageing() {
 		} else {
 			//删除用户 -1 根据支付金额判断
 			v["order_status"] = "已支付"
+			if v["apply_refund_time"] != nil {
+				v["order_status"] = "已取消"
+			}
 		}
 		if v["vip_type"] == 1 {
 			v["product_type"] = "企业商机管理(续费)"
@@ -108,10 +111,9 @@ func (v *EntnicheOrder) EntnicheOrderDetail(order_code string) error {
 		payway := util.ObjToString((*res)["pay_way"])
 		//
 		pay_money := util.Float64All((*res)["pay_money"])
-		apply_refund_name := util.ObjToString((*res)["apply_refund_name"])
 		if pay_money != 0 && pay_time != "" {
 			(*res)["order_status"] = "已支付"
-			if apply_refund_name != "" {
+			if order_status == -2 {
 				(*res)["order_status"] = "已取消"
 			}
 		} else {
@@ -149,6 +151,11 @@ func (v *EntnicheOrder) EntnicheOrderDetail(order_code string) error {
 		} else if applybill_status == 0 {
 			(*res)["applybill_status"] = "未申请"
 		}
+		//2020-4-22电子发票:徐志恒
+		data := cutil.Mysql.Find("invoice", qMap, "", "create_time", 0, 0)
+		if *data != nil && len(*data) != 0 {
+			(*res)["invoice"] = *data
+		}
 		//0个人 1单位
 		applybill_type := util.IntAll((*res)["applybill_type"])
 		if applybill_type == 1 {

+ 12 - 12
core/src/qfw/manage/refund.go

@@ -39,17 +39,17 @@ func (d *Refund) RefundInfo(orderCode string) {
 	})
 	if ok {
 		data := cutil.Mysql.Find("invoice", qMap, "", "create_time", 0, 0)
-		if *data != nil || len(*data) != 0 {
+		if *data != nil && len(*data) != 0 {
 			if len(*data) > 1 {
-				// if (*status)[1]["url"] != nil {
 				invoice_serialnum := util.ObjToString((*data)[1]["invoice_serialnum"])
-				RefundInvoice(invoice_serialnum)
-				// }
+				if invoice_serialnum != "" {
+					go RefundInvoice(invoice_serialnum, orderCode)
+				}
 			} else {
-				// if (*status)[0]["url"] != nil {
 				invoice_serialnum := util.ObjToString((*data)[0]["invoice_serialnum"])
-				RefundInvoice(invoice_serialnum)
-				// }
+				if invoice_serialnum != "" {
+					go RefundInvoice(invoice_serialnum, orderCode)
+				}
 			}
 		}
 		d.ServeJson(map[string]interface{}{
@@ -59,7 +59,7 @@ func (d *Refund) RefundInfo(orderCode string) {
 }
 
 //退票 发票流水号
-func RefundInvoice(invoice_serialnum string) {
+func RefundInvoice(invoice_serialnum, orderCode string) {
 	var refund_flag = -1
 	if invoice_serialnum != "" {
 		query := make(map[string]interface{})
@@ -69,6 +69,7 @@ func RefundInvoice(invoice_serialnum string) {
 			req_ := make(map[string]interface{})
 			req_["fpdm"] = (*res)["invoice_code"]
 			req_["fphm"] = (*res)["invoice_number"]
+			req_["orderCode"] = orderCode
 			b, _ := json.Marshal(req_)
 			buffer := bytes.NewBuffer(b)
 			request, err := http.NewRequest("POST", coreconfig.SysConfig.Invoice_interface_address, buffer)
@@ -77,14 +78,13 @@ func RefundInvoice(invoice_serialnum string) {
 				response, _ := client.Do(request)
 				res, _ := ioutil.ReadAll(response.Body)
 				defer response.Body.Close()
-				result := map[string]interface{}{}
-				err := json.Unmarshal(res, &result)
+				result := util.ObjToMap(string(res))
 				if err != nil {
 					log.Println("json序列化错误")
 				} else {
-					if result["code"].(string) == "0" {
+					if util.IntAll((*result)["code"]) == 0 {
 						refund_flag = 0
-					} else if result["code"].(string) == "1" {
+					} else if util.IntAll((*result)["code"]) == 1 {
 						refund_flag = 1
 					} else {
 						refund_flag = 2

+ 10 - 3
core/src/qfw/manage/vipOrder.go

@@ -92,7 +92,7 @@ func (v *VipOrder) VipPageing() {
 		qMap["service_status"] = service_status
 	}
 	qMap["product_type"] = "VIP订阅"
-	res := cutil.Mysql.Find("dataexport_order", qMap, "order_code,pay_time,product_type,order_money,order_status,service_status,applybill_status,pay_money,pay_way,user_mail,applybill_company,applybill_type,user_id,vip_type,original_price", "create_time desc", (currentPage-1)*perPage, perPage)
+	res := cutil.Mysql.Find("dataexport_order", qMap, "order_code,pay_time,product_type,order_money,order_status,service_status,applybill_status,pay_money,pay_way,user_mail,applybill_company,applybill_type,user_id,vip_type,original_price,apply_refund_time", "create_time desc", (currentPage-1)*perPage, perPage)
 
 	count := cutil.Mysql.Count("dataexport_order", qMap)
 	for k, v := range *res {
@@ -124,6 +124,9 @@ func (v *VipOrder) VipPageing() {
 		} else {
 			//删除用户 -1 根据支付金额判断
 			v["order_status"] = "已支付"
+			if v["apply_refund_time"] != nil {
+				v["order_status"] = "已取消"
+			}
 		}
 		//		if v["user_id"] != nil {
 		//			user_data := mongodb.FindOne("user", bson.M{"_id": bson.ObjectIdHex(util.ObjToString(v["user_id"]))})
@@ -166,10 +169,9 @@ func (v *VipOrder) VipOrderDetail(order_code string) error {
 		order_status := util.IntAll((*res)["order_status"])
 		payway := util.ObjToString((*res)["pay_way"])
 		original_price := util.Int64All((*res)["original_price"])
-		apply_refund_name := util.ObjToString((*res)["apply_refund_name"])
 		if pay_time != "" && original_price != 0 {
 			(*res)["order_status"] = "已支付"
-			if apply_refund_name != "" {
+			if order_status == -2 {
 				(*res)["order_status"] = "已取消"
 			}
 		} else {
@@ -210,6 +212,11 @@ func (v *VipOrder) VipOrderDetail(order_code string) error {
 		} else if applybill_status == 0 {
 			(*res)["applybill_status"] = "未申请"
 		}
+		//2020-4-22电子发票:徐志恒
+		data := cutil.Mysql.Find("invoice", qMap, "", "create_time", 0, 0)
+		if *data != nil && len(*data) != 0 {
+			(*res)["invoice"] = *data
+		}
 		//0个人 1单位
 		applybill_type := util.IntAll((*res)["applybill_type"])
 		if applybill_type == 1 {

+ 1 - 1
core/src/timetask.json

@@ -1 +1 @@
-{"comment":{"c_rate":720,"commentrate":900},"market":{"demand":{"attr":["i_hits","i_bids","i_status"],"timepoint":"2020-03-28 15:56:01"},"service":{"attr":["i_hits","i_sales","i_comments","i_score","i_appcounts"],"timepoint":"2020-03-28 15:56:06"}},"marketisstart":true,"marketrate":300}
+{"comment":{"c_rate":720,"commentrate":900},"market":{"demand":{"attr":["i_hits","i_bids","i_status"],"timepoint":"2020-04-26 15:50:21"},"service":{"attr":["i_hits","i_sales","i_comments","i_score","i_appcounts"],"timepoint":"2020-04-26 15:50:21"}},"marketisstart":true,"marketrate":300}

+ 2 - 2
core/src/web/staticres/dataexport/dataExport.css

@@ -52,7 +52,7 @@
 	position: absolute;
 	width: 110px;
 	height: 38px;
-	left: 1611px;
+	left: 82%;
 	top: 142px;
 	background: #C2C2C2;
 	border-radius: 4px;
@@ -62,7 +62,7 @@
 	position: absolute;
 	width: 56px;
 	height: 24px;
-	left: 1745px;
+	left: 91%;
 	top: 149px;
 	font-family: Microsoft YaHei;
 	font-style: normal;

+ 93 - 40
core/src/web/templates/manage/dataExport.html

@@ -231,14 +231,10 @@
 							<li class="row-list nofloat">支付方式:{{.T.res.pay_way}}</li>
 							<li class="row-list nofloat">下单时间:{{.T.res.create_time}}</li>
 							<li class="row-list nofloat">支付时间:{{.T.res.pay_time}}</li>
-                {{if .T.transaction_id}}
-							  <li class="row-list nofloat">支付单号:{{.T.transaction_id}}</li>
-                {{end}}
 							{{else}}
 							<li class="row-list nofloat">支付方式:-</li>
 							<li class="row-list nofloat">下单时间:{{.T.res.create_time}}</li>
 							<li class="row-list nofloat">支付时间:-</li>
-							<li class="row-list nofloat">{{.T.res.pay_way}}支付单号:-</li>
 							{{end}}
 							{{end}}
 						</ul>
@@ -310,7 +306,7 @@
 						<div class="apply apply_reason">申请原因:</div>
 					</div>
 					<div class="apply_infos">
-						<div class="applys apply_names" id="apply_name">{{session "loginName"}}</div>
+						<div class="applys apply_names" id="apply_name"></div>
 						<div class="applys apply_times" id="apply_refund_time"></div>
 						<textarea class="applys apply_reasons" placeholder="请输入申请原因" id="applyReason"></textarea>
 					</div>
@@ -381,6 +377,12 @@
 			$(".right").children().hide();
 			$(".right-three").show();
 		})
+		var loginName = {{session "nickName"}}
+		if(loginName !== null && loginName !== ""&& loginName !== undefined){
+				  $("#apply_name").text(loginName);
+		}else{
+				  $("#apply_name").text("企明星管理员");
+		}
 		
 		$("#apply_refund_time").text(formatDate(new Date().getTime(), true))
 		var invoice = {{.T.res.invoice}};
@@ -388,13 +390,13 @@
 		var orderStatus = {{.T.res.order_status}};
 		var applyHtml = "";
 		var lineHtml = "";
-		console.log({{.T.res}})
 		var applyName = {{.T.res.apply_refund_name}}
 		var applyTime = {{.T.res.apply_refund_time}}
 		var applyReason = {{.T.res.apply_refund_reason}}
 		var applybill_type = {{.T.res.applybill_type}};
 		var applybill_company = {{.T.res.applybill_company}};
 		var applybill_taxnum = {{.T.res.applybill_taxnum}};
+		var orderCode = {{.T.res.order_code}};
 		if(invoice !== null){
 				  var applyType = invoice[0].invoice_type;
 				  var taxpayer_identnum = invoice[0].taxpayer_identnum
@@ -411,7 +413,14 @@
 				  }else{
 				  	if(applyStatus === "已申请"){
 				  		lineHtml += `<li class="row-list nofloat">开具时间:${formatDate(invoice[0].billing_time *1000)}</li>
-				  					<li class="row-list nofloat">发票:<a target="_blank" href="${invoice[0].url}">查看详情</a></li>`
+				  					<li class="row-list nofloat">发票:<a target="_blank" href="${invoice[0].url}">查看详情</a></li>
+									`
+						var redObj = JSON.parse(invoice[0].red)
+						if(redObj !== null && redObj !== "" && redObj !== undefined){
+							lineHtml += `<li class="row-list nofloat">红票开具时间:${formatDate(redObj.billing_time *1000)}</li>
+											<li class="row-list nofloat">红票:<a target="_blank" href="${redObj.url}">查看详情</a></li>`
+						}
+						
 				  		if(applyType === "个人"){
 				  			
 				  			applyHtml  += `
@@ -443,37 +452,79 @@
 				  if(invoice.length == 2){
 				  	var applyHtmls = "";
 				  	if(invoice[1].invoice_type === "个人"){
-				  		applyHtmls  += `
-				  		<div class="bd clearfix">
-				  			<ul class="row first">
-				  				<li class="row-list nofloat">申请时间:${formatDate(invoice[1].create_time *1000)}</li>
-				  				<li class="row-list nofloat">申请状态:发票开具</li>
-				  				<li class="row-list nofloat">发票类型:普通发票(电子发票)</li>
-				  				<li class="row-list nofloat">发票抬头:个人</li>
-				  			</ul>
-				  			<div class="line" style="margin-left: 20px;float: left;width: 1px;height: 155px;background: #ddd;margin-top: 20px;"></div>
-				  			<ul class="row second"  style="margin-top:20px  !important;">
-				  				<li class="row-list nofloat">开具时间:${formatDate(invoice[1].billing_time *1000)}</li>
-				  				<li class="row-list nofloat">发票:<a target="_blank" href="${invoice[1].url}">查看详情</a></li>
-				  			</ul>
-				  		</div>`
+						var redObj = JSON.parse(invoice[1].red)
+						if(redObj !== null && redObj !== "" && redObj !== undefined){
+							applyHtmls  += `
+							<div class="bd clearfix">
+								<ul class="row first">
+									<li class="row-list nofloat">换开时间:${formatDate(invoice[1].create_time *1000)}</li>
+									<li class="row-list nofloat">申请状态:发票开具</li>
+									<li class="row-list nofloat">发票类型:普通发票(电子发票)</li>
+									<li class="row-list nofloat">发票抬头:个人</li>
+								</ul>
+								<div class="line" style="margin-left: 20px;float: left;width: 1px;height: 155px;background: #ddd;margin-top: 20px;"></div>
+								<ul class="row second"  style="margin-top:20px  !important;">
+									<li class="row-list nofloat">开具时间:${formatDate(invoice[1].billing_time *1000)}</li>
+									<li class="row-list nofloat">发票:<a target="_blank" href="${invoice[1].url}">查看详情</a></li>
+									<li class="row-list nofloat">红票开具时间:${formatDate(redObj.billing_time *1000)}</li>
+									<li class="row-list nofloat">红票:<a target="_blank" href="${redObj.url}">查看详情</a></li>
+								</ul>
+							</div>`
+						}else{
+							applyHtmls  += `
+							<div class="bd clearfix">
+								<ul class="row first">
+									<li class="row-list nofloat">换开时间:${formatDate(invoice[1].create_time *1000)}</li>
+									<li class="row-list nofloat">申请状态:发票开具</li>
+									<li class="row-list nofloat">发票类型:普通发票(电子发票)</li>
+									<li class="row-list nofloat">发票抬头:个人</li>
+								</ul>
+								<div class="line" style="margin-left: 20px;float: left;width: 1px;height: 155px;background: #ddd;margin-top: 20px;"></div>
+								<ul class="row second"  style="margin-top:20px  !important;">
+									<li class="row-list nofloat">开具时间:${formatDate(invoice[1].billing_time *1000)}</li>
+									<li class="row-list nofloat">发票:<a target="_blank" href="${invoice[1].url}">查看详情</a></li>
+								</ul>
+							</div>`
+						}
 				  	}else{
-				  		applyHtmls  += `
-				  		<div class="bd clearfix">
-				  			<ul class="row first">
-				  				<li class="row-list nofloat">申请时间:${formatDate(invoice[1].create_time *1000)}</li>
-				  				<li class="row-list nofloat">申请状态:发票开具</li>
-				  				<li class="row-list nofloat">发票类型:普通发票(电子发票)</li>
-				  				<li class="row-list nofloat">发票抬头:单位</li>
-				  				<li class="row-list nofloat">单位名称:${invoice[1].company_name}</li>
-				  				<li class="row-list nofloat">纳税人识别号:${invoice[1].taxpayer_identnum}</li>
-				  			</ul>
-				  			<div class="line" style="margin-left: 20px;float: left;width: 1px;height: 155px;background: #ddd;margin-top: 20px;"></div>
-				  			<ul class="row second"  style="margin-top:20px  !important;">
-				  				<li class="row-list nofloat">开具时间:${formatDate(invoice[1].billing_time *1000)}</li>
-				  				<li class="row-list nofloat">发票:<a target="_blank" href="${invoice[1].url}">查看详情</a></li>
-				  			</ul>
-				  		</div>`
+						var redObj = JSON.parse(invoice[1].red)
+						if(redObj !== null && redObj !== "" && redObj !== undefined){
+							applyHtmls  += `
+							<div class="bd clearfix">
+								<ul class="row first">
+									<li class="row-list nofloat">换开时间:${formatDate(invoice[1].create_time *1000)}</li>
+									<li class="row-list nofloat">申请状态:发票开具</li>
+									<li class="row-list nofloat">发票类型:普通发票(电子发票)</li>
+									<li class="row-list nofloat">发票抬头:单位</li>
+									<li class="row-list nofloat">单位名称:${invoice[1].company_name}</li>
+									<li class="row-list nofloat">纳税人识别号:${invoice[1].taxpayer_identnum}</li>
+								</ul>
+								<div class="line" style="margin-left: 20px;float: left;width: 1px;height: 155px;background: #ddd;margin-top: 20px;"></div>
+								<ul class="row second"  style="margin-top:20px  !important;">
+									<li class="row-list nofloat">开具时间:${formatDate(invoice[1].billing_time *1000)}</li>
+									<li class="row-list nofloat">发票:<a target="_blank" href="${invoice[1].url}">查看详情</a></li>
+									<li class="row-list nofloat">红票开具时间:${formatDate(redObj.billing_time *1000)}</li>
+									<li class="row-list nofloat">红票:<a target="_blank" href="${redObj.url}">查看详情</a></li>
+								</ul>
+							</div>`
+						}else{
+							applyHtmls  += `
+							<div class="bd clearfix">
+								<ul class="row first">
+									<li class="row-list nofloat">换开时间:${formatDate(invoice[1].create_time *1000)}</li>
+									<li class="row-list nofloat">申请状态:发票开具</li>
+									<li class="row-list nofloat">发票类型:普通发票(电子发票)</li>
+									<li class="row-list nofloat">发票抬头:单位</li>
+									<li class="row-list nofloat">单位名称:${invoice[1].company_name}</li>
+									<li class="row-list nofloat">纳税人识别号:${invoice[1].taxpayer_identnum}</li>
+								</ul>
+								<div class="line" style="margin-left: 20px;float: left;width: 1px;height: 155px;background: #ddd;margin-top: 20px;"></div>
+								<ul class="row second"  style="margin-top:20px  !important;">
+									<li class="row-list nofloat">开具时间:${formatDate(invoice[1].billing_time *1000)}</li>
+									<li class="row-list nofloat">发票:<a target="_blank" href="${invoice[1].url}">查看详情</a></li>
+								</ul>
+							</div>`
+						}
 				  	}
 				  	$(".invoice").append(applyHtmls);
 				  }
@@ -515,7 +566,6 @@
 			if(applyName !== null && applyName !== "" && applyName !== undefined){
 				$("#apply_names").text(applyName);
 				$("#apply_refund_times").text(formatDate(applyTime*1000, true));
-				console.log(applyReason)
 				$("#applyReasons").text(applyReason);
 				$(".refund_success").show();
 				$(".refund_info").show();
@@ -538,8 +588,7 @@
 				"applyTime": applyTime,
 				"applyReason": applyReason
 			}
-			console.log(param);
-			var url = "/manage/refund/"+ {{.T.res.order_code}};
+			var url = "/manage/refund/"+ orderCode;
 			$.post(url,param,function(r){
 				if(r.success){
 					location.reload();
@@ -551,6 +600,10 @@
 			$(".isrefund").hide();
 		})
 		
+		$(".select_qx").on("click", function(){
+			location.reload();
+		})
+		
 		function formatDate(date,hms) {
 			if(date ===null || date==="" || date === 0){
 				return "-"

+ 91 - 35
core/src/web/templates/manage/entniche_order/entorderdetail.html

@@ -180,7 +180,7 @@
 						<div class="apply apply_reason">申请原因:</div>
 					</div>
 					<div class="apply_infos">
-						<div class="applys apply_names" id="apply_name">{{session "loginName"}}</div>
+						<div class="applys apply_names" id="apply_name"></div>
 						<div class="applys apply_times" id="apply_refund_time"></div>
 						<textarea class="applys apply_reasons" placeholder="请输入申请原因" id="applyReason"></textarea>
 					</div>
@@ -253,6 +253,12 @@
 	  	$(".right").children().hide();
 	  	$(".right-three").show();
 	  })
+	  var loginName = {{session "nickName"}}
+	  if(loginName !== null && loginName !== ""&& loginName !== undefined){
+		  $("#apply_name").text(loginName);
+	  }else{
+		  $("#apply_name").text("企明星管理员");
+	  }
 	  
 	  $("#apply_refund_time").text(formatDate(new Date().getTime(), true))
 	  var invoice = {{.T.res.invoice}};
@@ -260,13 +266,13 @@
 	  var orderStatus = {{.T.res.order_status}};
 	  var applyHtml = "";
 	  var lineHtml = "";
-	  console.log({{.T.res}})
 	  var applyName = {{.T.res.apply_refund_name}}
 	  var applyTime = {{.T.res.apply_refund_time}}
 	  var applyReason = {{.T.res.apply_refund_reason}}
 	  var applybill_type = {{.T.res.applybill_type}};
 	  var applybill_company = {{.T.res.applybill_company}};
 	  var applybill_taxnum = {{.T.res.applybill_taxnum}};
+	  var orderCode = {{.T.res.order_code}};
 	  if(invoice !== null){
 	  		  var applyType = invoice[0].invoice_type;
 	  		  var taxpayer_identnum = invoice[0].taxpayer_identnum
@@ -284,7 +290,12 @@
 	  		  	if(applyStatus === "已申请"){
 	  		  		lineHtml += `<li class="row-list nofloat">开具时间:${formatDate(invoice[0].billing_time *1000)}</li>
 	  		  					<li class="row-list nofloat">发票:<a target="_blank" href="${invoice[0].url}">查看详情</a></li>`
-	  		  		if(applyType === "个人"){
+	  		  		var redObj = JSON.parse(invoice[0].red)
+	  		  		if(redObj !== null && redObj !== "" && redObj !== undefined){
+	  		  			lineHtml += `<li class="row-list nofloat">红票开具时间:${formatDate(redObj.billing_time *1000)}</li>
+	  		  							<li class="row-list nofloat">红票:<a target="_blank" href="${redObj.url}">查看详情</a></li>`
+	  		  		}
+					if(applyType === "个人"){
 	  		  			
 	  		  			applyHtml  += `
 	  		  			<li class="row-list nofloat">申请时间:${create_times}</li>
@@ -315,37 +326,79 @@
 	  		  if(invoice.length == 2){
 	  		  	var applyHtmls = "";
 	  		  	if(invoice[1].invoice_type === "个人"){
-	  		  		applyHtmls  += `
-	  		  		<div class="bd clearfix">
-	  		  			<ul class="row first">
-	  		  				<li class="row-list nofloat">申请时间:${formatDate(invoice[1].create_time *1000)}</li>
-	  		  				<li class="row-list nofloat">申请状态:发票开具</li>
-	  		  				<li class="row-list nofloat">发票类型:普通发票(电子发票)</li>
-	  		  				<li class="row-list nofloat">发票抬头:个人</li>
-	  		  			</ul>
-	  		  			<div class="line" style="margin-left: 20px;float: left;width: 1px;height: 155px;background: #ddd;margin-top: 20px;"></div>
-	  		  			<ul class="row second"  style="margin-top:20px  !important;">
-	  		  				<li class="row-list nofloat">开具时间:${formatDate(invoice[1].billing_time *1000)}</li>
-	  		  				<li class="row-list nofloat">发票:<a target="_blank" href="${invoice[1].url}">查看详情</a></li>
-	  		  			</ul>
-	  		  		</div>`
+	  		  		var redObj = JSON.parse(invoice[1].red)
+	  		  		if(redObj !== null && redObj !== "" && redObj !== undefined){
+	  		  			applyHtmls  += `
+	  		  			<div class="bd clearfix">
+	  		  				<ul class="row first">
+	  		  					<li class="row-list nofloat">换开时间:${formatDate(invoice[1].create_time *1000)}</li>
+	  		  					<li class="row-list nofloat">申请状态:发票开具</li>
+	  		  					<li class="row-list nofloat">发票类型:普通发票(电子发票)</li>
+	  		  					<li class="row-list nofloat">发票抬头:个人</li>
+	  		  				</ul>
+	  		  				<div class="line" style="margin-left: 20px;float: left;width: 1px;height: 155px;background: #ddd;margin-top: 20px;"></div>
+	  		  				<ul class="row second"  style="margin-top:20px  !important;">
+	  		  					<li class="row-list nofloat">开具时间:${formatDate(invoice[1].billing_time *1000)}</li>
+	  		  					<li class="row-list nofloat">发票:<a target="_blank" href="${invoice[1].url}">查看详情</a></li>
+	  		  					<li class="row-list nofloat">红票开具时间:${formatDate(redObj.billing_time *1000)}</li>
+	  		  					<li class="row-list nofloat">红票:<a target="_blank" href="${redObj.url}">查看详情</a></li>
+	  		  				</ul>
+	  		  			</div>`
+	  		  		}else{
+	  		  			applyHtmls  += `
+	  		  			<div class="bd clearfix">
+	  		  				<ul class="row first">
+	  		  					<li class="row-list nofloat">换开时间:${formatDate(invoice[1].create_time *1000)}</li>
+	  		  					<li class="row-list nofloat">申请状态:发票开具</li>
+	  		  					<li class="row-list nofloat">发票类型:普通发票(电子发票)</li>
+	  		  					<li class="row-list nofloat">发票抬头:个人</li>
+	  		  				</ul>
+	  		  				<div class="line" style="margin-left: 20px;float: left;width: 1px;height: 155px;background: #ddd;margin-top: 20px;"></div>
+	  		  				<ul class="row second"  style="margin-top:20px  !important;">
+	  		  					<li class="row-list nofloat">开具时间:${formatDate(invoice[1].billing_time *1000)}</li>
+	  		  					<li class="row-list nofloat">发票:<a target="_blank" href="${invoice[1].url}">查看详情</a></li>
+	  		  				</ul>
+	  		  			</div>`
+	  		  		}
 	  		  	}else{
-	  		  		applyHtmls  += `
-	  		  		<div class="bd clearfix">
-	  		  			<ul class="row first">
-	  		  				<li class="row-list nofloat">申请时间:${formatDate(invoice[1].create_time *1000)}</li>
-	  		  				<li class="row-list nofloat">申请状态:发票开具</li>
-	  		  				<li class="row-list nofloat">发票类型:普通发票(电子发票)</li>
-	  		  				<li class="row-list nofloat">发票抬头:单位</li>
-	  		  				<li class="row-list nofloat">单位名称:${invoice[1].company_name}</li>
-	  		  				<li class="row-list nofloat">纳税人识别号:${invoice[1].taxpayer_identnum}</li>
-	  		  			</ul>
-	  		  			<div class="line" style="margin-left: 20px;float: left;width: 1px;height: 155px;background: #ddd;margin-top: 20px;"></div>
-	  		  			<ul class="row second"  style="margin-top:20px  !important;">
-	  		  				<li class="row-list nofloat">开具时间:${formatDate(invoice[1].billing_time *1000)}</li>
-	  		  				<li class="row-list nofloat">发票:<a target="_blank" href="${invoice[1].url}">查看详情</a></li>
-	  		  			</ul>
-	  		  		</div>`
+	  		  		var redObj = JSON.parse(invoice[1].red)
+	  		  		if(redObj !== null && redObj !== "" && redObj !== undefined){
+	  		  			applyHtmls  += `
+	  		  			<div class="bd clearfix">
+	  		  				<ul class="row first">
+	  		  					<li class="row-list nofloat">换开时间:${formatDate(invoice[1].create_time *1000)}</li>
+	  		  					<li class="row-list nofloat">申请状态:发票开具</li>
+	  		  					<li class="row-list nofloat">发票类型:普通发票(电子发票)</li>
+	  		  					<li class="row-list nofloat">发票抬头:单位</li>
+	  		  					<li class="row-list nofloat">单位名称:${invoice[1].company_name}</li>
+	  		  					<li class="row-list nofloat">纳税人识别号:${invoice[1].taxpayer_identnum}</li>
+	  		  				</ul>
+	  		  				<div class="line" style="margin-left: 20px;float: left;width: 1px;height: 155px;background: #ddd;margin-top: 20px;"></div>
+	  		  				<ul class="row second"  style="margin-top:20px  !important;">
+	  		  					<li class="row-list nofloat">开具时间:${formatDate(invoice[1].billing_time *1000)}</li>
+	  		  					<li class="row-list nofloat">发票:<a target="_blank" href="${invoice[1].url}">查看详情</a></li>
+	  		  					<li class="row-list nofloat">红票开具时间:${formatDate(redObj.billing_time *1000)}</li>
+	  		  					<li class="row-list nofloat">红票:<a target="_blank" href="${redObj.url}">查看详情</a></li>
+	  		  				</ul>
+	  		  			</div>`
+	  		  		}else{
+	  		  			applyHtmls  += `
+	  		  			<div class="bd clearfix">
+	  		  				<ul class="row first">
+	  		  					<li class="row-list nofloat">换开时间:${formatDate(invoice[1].create_time *1000)}</li>
+	  		  					<li class="row-list nofloat">申请状态:发票开具</li>
+	  		  					<li class="row-list nofloat">发票类型:普通发票(电子发票)</li>
+	  		  					<li class="row-list nofloat">发票抬头:单位</li>
+	  		  					<li class="row-list nofloat">单位名称:${invoice[1].company_name}</li>
+	  		  					<li class="row-list nofloat">纳税人识别号:${invoice[1].taxpayer_identnum}</li>
+	  		  				</ul>
+	  		  				<div class="line" style="margin-left: 20px;float: left;width: 1px;height: 155px;background: #ddd;margin-top: 20px;"></div>
+	  		  				<ul class="row second"  style="margin-top:20px  !important;">
+	  		  					<li class="row-list nofloat">开具时间:${formatDate(invoice[1].billing_time *1000)}</li>
+	  		  					<li class="row-list nofloat">发票:<a target="_blank" href="${invoice[1].url}">查看详情</a></li>
+	  		  				</ul>
+	  		  			</div>`
+	  		  		}
 	  		  	}
 	  		  	$(".invoice").append(applyHtmls);
 	  		  }
@@ -410,8 +463,7 @@
 	  		"applyTime": applyTime,
 	  		"applyReason": applyReason
 	  	}
-	  	console.log(param);
-	  	var url = "/manage/refund/"+ {{.T.res.order_code}};
+	  	var url = "/manage/refund/"+ orderCode;
 	  	$.post(url,param,function(r){
 	  		if(r.success){
 	  			location.reload();
@@ -423,6 +475,10 @@
 	  	$(".isrefund").hide();
 	  })
 	  
+	  $(".select_qx").on("click", function(){
+	  	location.reload();
+	  })
+	  
 	  function formatDate(date,hms) {
 	  	if(date ===null || date==="" || date === 0){
 	  		return "-"

+ 92 - 35
core/src/web/templates/manage/vipOrderDetail.html

@@ -250,7 +250,7 @@
 						<div class="apply apply_reason">申请原因:</div>
 					</div>
 					<div class="apply_infos">
-						<div class="applys apply_names" id="apply_name">{{session "loginName"}}</div>
+						<div class="applys apply_names" id="apply_name"></div>
 						<div class="applys apply_times" id="apply_refund_time"></div>
 						<textarea class="applys apply_reasons" placeholder="请输入申请原因" id="applyReason"></textarea>
 					</div>
@@ -323,6 +323,12 @@
 	  	$(".right").children().hide();
 	  	$(".right-three").show();
 	  })
+	  var loginName = {{session "nickName"}}
+	  if(loginName !== null && loginName !== ""&& loginName !== undefined){
+	  		  $("#apply_name").text(loginName);
+	  }else{
+	  		  $("#apply_name").text("企明星管理员");
+	  }
 	  
 	  $("#apply_refund_time").text(formatDate(new Date().getTime(), true))
 	  var invoice = {{.T.res.invoice}};
@@ -330,13 +336,14 @@
 	  var orderStatus = {{.T.res.order_status}};
 	  var applyHtml = "";
 	  var lineHtml = "";
-	  console.log({{.T.res}})
 	  var applyName = {{.T.res.apply_refund_name}}
 	  var applyTime = {{.T.res.apply_refund_time}}
 	  var applyReason = {{.T.res.apply_refund_reason}}
 	  var applybill_type = {{.T.res.applybill_type}};
 	  var applybill_company = {{.T.res.applybill_company}};
 	  var applybill_taxnum = {{.T.res.applybill_taxnum}};
+	  var orderCode = {{.T.res.order_code}};
+	  console.log(invoice)
 	  if(invoice !== null){
 	  		  var applyType = invoice[0].invoice_type;
 	  		  var taxpayer_identnum = invoice[0].taxpayer_identnum
@@ -354,7 +361,12 @@
 	  		  	if(applyStatus === "已申请"){
 	  		  		lineHtml += `<li class="row-list nofloat">开具时间:${formatDate(invoice[0].billing_time *1000)}</li>
 	  		  					<li class="row-list nofloat">发票:<a target="_blank" href="${invoice[0].url}">查看详情</a></li>`
-	  		  		if(applyType === "个人"){
+	  		  		var redObj = JSON.parse(invoice[0].red)
+	  		  		if(redObj !== null && redObj !== "" && redObj !== undefined){
+	  		  			lineHtml += `<li class="row-list nofloat">红票开具时间:${formatDate(redObj.billing_time *1000)}</li>
+	  		  							<li class="row-list nofloat">红票:<a target="_blank" href="${redObj.url}">查看详情</a></li>`
+	  		  		}
+					if(applyType === "个人"){
 	  		  			
 	  		  			applyHtml  += `
 	  		  			<li class="row-list nofloat">申请时间:${create_times}</li>
@@ -385,37 +397,79 @@
 	  		  if(invoice.length == 2){
 	  		  	var applyHtmls = "";
 	  		  	if(invoice[1].invoice_type === "个人"){
-	  		  		applyHtmls  += `
-	  		  		<div class="bd clearfix">
-	  		  			<ul class="row first">
-	  		  				<li class="row-list nofloat">申请时间:${formatDate(invoice[1].create_time *1000)}</li>
-	  		  				<li class="row-list nofloat">申请状态:发票开具</li>
-	  		  				<li class="row-list nofloat">发票类型:普通发票(电子发票)</li>
-	  		  				<li class="row-list nofloat">发票抬头:个人</li>
-	  		  			</ul>
-	  		  			<div class="line" style="margin-left: 20px;float: left;width: 1px;height: 155px;background: #ddd;margin-top: 20px;"></div>
-	  		  			<ul class="row second"  style="margin-top:20px  !important;">
-	  		  				<li class="row-list nofloat">开具时间:${formatDate(invoice[1].billing_time *1000)}</li>
-	  		  				<li class="row-list nofloat">发票:<a target="_blank" href="${invoice[1].url}">查看详情</a></li>
-	  		  			</ul>
-	  		  		</div>`
+	  		  		var redObj = JSON.parse(invoice[1].red)
+	  		  		if(redObj !== null && redObj !== "" && redObj !== undefined){
+	  		  			applyHtmls  += `
+	  		  			<div class="bd clearfix">
+	  		  				<ul class="row first">
+	  		  					<li class="row-list nofloat">换开时间:${formatDate(invoice[1].create_time *1000)}</li>
+	  		  					<li class="row-list nofloat">申请状态:发票开具</li>
+	  		  					<li class="row-list nofloat">发票类型:普通发票(电子发票)</li>
+	  		  					<li class="row-list nofloat">发票抬头:个人</li>
+	  		  				</ul>
+	  		  				<div class="line" style="margin-left: 20px;float: left;width: 1px;height: 155px;background: #ddd;margin-top: 20px;"></div>
+	  		  				<ul class="row second"  style="margin-top:20px  !important;">
+	  		  					<li class="row-list nofloat">开具时间:${formatDate(invoice[1].billing_time *1000)}</li>
+	  		  					<li class="row-list nofloat">发票:<a target="_blank" href="${invoice[1].url}">查看详情</a></li>
+	  		  					<li class="row-list nofloat">红票开具时间:${formatDate(redObj.billing_time *1000)}</li>
+	  		  					<li class="row-list nofloat">红票:<a target="_blank" href="${redObj.url}">查看详情</a></li>
+	  		  				</ul>
+	  		  			</div>`
+	  		  		}else{
+	  		  			applyHtmls  += `
+	  		  			<div class="bd clearfix">
+	  		  				<ul class="row first">
+	  		  					<li class="row-list nofloat">换开时间:${formatDate(invoice[1].create_time *1000)}</li>
+	  		  					<li class="row-list nofloat">申请状态:发票开具</li>
+	  		  					<li class="row-list nofloat">发票类型:普通发票(电子发票)</li>
+	  		  					<li class="row-list nofloat">发票抬头:个人</li>
+	  		  				</ul>
+	  		  				<div class="line" style="margin-left: 20px;float: left;width: 1px;height: 155px;background: #ddd;margin-top: 20px;"></div>
+	  		  				<ul class="row second"  style="margin-top:20px  !important;">
+	  		  					<li class="row-list nofloat">开具时间:${formatDate(invoice[1].billing_time *1000)}</li>
+	  		  					<li class="row-list nofloat">发票:<a target="_blank" href="${invoice[1].url}">查看详情</a></li>
+	  		  				</ul>
+	  		  			</div>`
+	  		  		}
 	  		  	}else{
-	  		  		applyHtmls  += `
-	  		  		<div class="bd clearfix">
-	  		  			<ul class="row first">
-	  		  				<li class="row-list nofloat">申请时间:${formatDate(invoice[1].create_time *1000)}</li>
-	  		  				<li class="row-list nofloat">申请状态:发票开具</li>
-	  		  				<li class="row-list nofloat">发票类型:普通发票(电子发票)</li>
-	  		  				<li class="row-list nofloat">发票抬头:单位</li>
-	  		  				<li class="row-list nofloat">单位名称:${invoice[1].company_name}</li>
-	  		  				<li class="row-list nofloat">纳税人识别号:${invoice[1].taxpayer_identnum}</li>
-	  		  			</ul>
-	  		  			<div class="line" style="margin-left: 20px;float: left;width: 1px;height: 155px;background: #ddd;margin-top: 20px;"></div>
-	  		  			<ul class="row second"  style="margin-top:20px  !important;">
-	  		  				<li class="row-list nofloat">开具时间:${formatDate(invoice[1].billing_time *1000)}</li>
-	  		  				<li class="row-list nofloat">发票:<a target="_blank" href="${invoice[1].url}">查看详情</a></li>
-	  		  			</ul>
-	  		  		</div>`
+	  		  		var redObj = JSON.parse(invoice[1].red)
+	  		  		if(redObj !== null && redObj !== "" && redObj !== undefined){
+	  		  			applyHtmls  += `
+	  		  			<div class="bd clearfix">
+	  		  				<ul class="row first">
+	  		  					<li class="row-list nofloat">换开时间:${formatDate(invoice[1].create_time *1000)}</li>
+	  		  					<li class="row-list nofloat">申请状态:发票开具</li>
+	  		  					<li class="row-list nofloat">发票类型:普通发票(电子发票)</li>
+	  		  					<li class="row-list nofloat">发票抬头:单位</li>
+	  		  					<li class="row-list nofloat">单位名称:${invoice[1].company_name}</li>
+	  		  					<li class="row-list nofloat">纳税人识别号:${invoice[1].taxpayer_identnum}</li>
+	  		  				</ul>
+	  		  				<div class="line" style="margin-left: 20px;float: left;width: 1px;height: 155px;background: #ddd;margin-top: 20px;"></div>
+	  		  				<ul class="row second"  style="margin-top:20px  !important;">
+	  		  					<li class="row-list nofloat">开具时间:${formatDate(invoice[1].billing_time *1000)}</li>
+	  		  					<li class="row-list nofloat">发票:<a target="_blank" href="${invoice[1].url}">查看详情</a></li>
+	  		  					<li class="row-list nofloat">红票开具时间:${formatDate(redObj.billing_time *1000)}</li>
+	  		  					<li class="row-list nofloat">红票:<a target="_blank" href="${redObj.url}">查看详情</a></li>
+	  		  				</ul>
+	  		  			</div>`
+	  		  		}else{
+	  		  			applyHtmls  += `
+	  		  			<div class="bd clearfix">
+	  		  				<ul class="row first">
+	  		  					<li class="row-list nofloat">换开时间:${formatDate(invoice[1].create_time *1000)}</li>
+	  		  					<li class="row-list nofloat">申请状态:发票开具</li>
+	  		  					<li class="row-list nofloat">发票类型:普通发票(电子发票)</li>
+	  		  					<li class="row-list nofloat">发票抬头:单位</li>
+	  		  					<li class="row-list nofloat">单位名称:${invoice[1].company_name}</li>
+	  		  					<li class="row-list nofloat">纳税人识别号:${invoice[1].taxpayer_identnum}</li>
+	  		  				</ul>
+	  		  				<div class="line" style="margin-left: 20px;float: left;width: 1px;height: 155px;background: #ddd;margin-top: 20px;"></div>
+	  		  				<ul class="row second"  style="margin-top:20px  !important;">
+	  		  					<li class="row-list nofloat">开具时间:${formatDate(invoice[1].billing_time *1000)}</li>
+	  		  					<li class="row-list nofloat">发票:<a target="_blank" href="${invoice[1].url}">查看详情</a></li>
+	  		  				</ul>
+	  		  			</div>`
+	  		  		}
 	  		  	}
 	  		  	$(".invoice").append(applyHtmls);
 	  		  }
@@ -480,8 +534,7 @@
 	  		"applyTime": applyTime,
 	  		"applyReason": applyReason
 	  	}
-	  	console.log(param);
-	  	var url = "/manage/refund/"+ {{.T.res.order_code}};
+	  	var url = "/manage/refund/"+ orderCode;
 	  	$.post(url,param,function(r){
 	  		if(r.success){
 	  			location.reload();
@@ -493,6 +546,10 @@
 	  	$(".isrefund").hide();
 	  })
 	  
+	  $(".select_qx").on("click", function(){
+	  	location.reload();
+	  })
+	  
 	  function formatDate(date,hms) {
 	  	if(date ===null || date==="" || date === 0){
 	  		return "-"