diff --git a/CoreCms.Net.Model/CoreCms.Net.Model.xml b/CoreCms.Net.Model/CoreCms.Net.Model.xml
index 8cd781de..73136b7d 100644
--- a/CoreCms.Net.Model/CoreCms.Net.Model.xml
+++ b/CoreCms.Net.Model/CoreCms.Net.Model.xml
@@ -9526,6 +9526,26 @@
属性集合
+
+
+ 发票类型
+
+
+
+
+ 抬头信息
+
+
+
+
+ 发票编码
+
+
+
+
+ 订单编号
+
+
用户登录验证实体
diff --git a/CoreCms.Net.Model/FromBody/FMInvoice.cs b/CoreCms.Net.Model/FromBody/FMInvoice.cs
new file mode 100644
index 00000000..edf926e2
--- /dev/null
+++ b/CoreCms.Net.Model/FromBody/FMInvoice.cs
@@ -0,0 +1,33 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace CoreCms.Net.Model.FromBody
+{
+ public class FMSubmitInvoiceApply
+ {
+ ///
+ /// 发票类型
+ ///
+ public int type { get; set; }
+
+ ///
+ /// 抬头信息
+ ///
+ public string name { get; set; }
+
+ ///
+ /// 发票编码
+ ///
+ public string code { get; set; } = string.Empty;
+
+ ///
+ /// 订单编号
+ ///
+ public string orderId { get; set; }
+
+
+ }
+}
diff --git a/CoreCms.Net.Uni-App/CoreShop/common/request/http.api.js b/CoreCms.Net.Uni-App/CoreShop/common/request/http.api.js
index d3cd5574..fcb6408a 100644
--- a/CoreCms.Net.Uni-App/CoreShop/common/request/http.api.js
+++ b/CoreCms.Net.Uni-App/CoreShop/common/request/http.api.js
@@ -422,6 +422,11 @@ const install = (Vue, vm) => {
//获取全局促销列表
let getPromotionList = (params, config = {}) => http.post('/Api/Promotion/GetPromotionList', params, { custom: { methodName: 'promotion.getPromotionList', needToken: false } });
+ //获取发票是否开具
+ let checkInvoice = (params, config = {}) => http.post('/Api/Order/CheckInvoice', params, { custom: { methodName: 'order.checkInvoice', needToken: true } });
+ //提交发票申请
+ let submitInvoiceApply = (params, config = {}) => http.post('/Api/Order/SubmitInvoiceApply', params, { custom: { methodName: 'order.submitInvoiceApply', needToken: true } });
+
@@ -625,7 +630,9 @@ const install = (Vue, vm) => {
uploadFilesFByBase64,
- getPromotionList
+ getPromotionList,
+ checkInvoice,
+ submitInvoiceApply
};
}
diff --git a/CoreCms.Net.Uni-App/CoreShop/pages.json b/CoreCms.Net.Uni-App/CoreShop/pages.json
index 9d83122d..e2ed7d56 100644
--- a/CoreCms.Net.Uni-App/CoreShop/pages.json
+++ b/CoreCms.Net.Uni-App/CoreShop/pages.json
@@ -62,13 +62,14 @@
"navigationBarTitleText": "直播间"
}
}
- ],
- "plugins": {
- "live-player-plugin": {
- "version": "1.3.5", // 注意该直播组件最新版本号
- "provider": "wx2b03c6e691cd7370" // 必须填该直播组件appid,不是小程序的appid
- }
- }
+ ]
+ //,
+ //"plugins": {
+ // "live-player-plugin": {
+ // "version": "1.3.5", // 注意该直播组件最新版本号
+ // "provider": "wx2b03c6e691cd7370" // 必须填该直播组件appid,不是小程序的appid
+ // }
+ //}
},
{
"root": "pages/article",
@@ -605,6 +606,13 @@
"navigationBarTitleText": "物流信息"
}
},
+ {
+ "path": "order/invoice/invoice",
+ "style": {
+ "navigationBarTextStyle": "black",
+ "navigationBarTitleText": "申请发票"
+ }
+ },
{
"path": "distribution/index/index",
"style": {
diff --git a/CoreCms.Net.Uni-App/CoreShop/pages/member/order/detail/detail.vue b/CoreCms.Net.Uni-App/CoreShop/pages/member/order/detail/detail.vue
index db4c9068..5c7786aa 100644
--- a/CoreCms.Net.Uni-App/CoreShop/pages/member/order/detail/detail.vue
+++ b/CoreCms.Net.Uni-App/CoreShop/pages/member/order/detail/detail.vue
@@ -474,6 +474,9 @@
查看售后
+
+ 申请发票
+
@@ -703,6 +706,12 @@
url: '/pages/member/order/invitationGroup/invitationGroup?orderId=' + this.orderInfo.orderId + '&closeTime=' + this.teamInfo.closeTime
})
},
+ //邀请拼单
+ goApplyForInvoice(orderId) {
+ uni.navigateTo({
+ url: '/pages/member/order/invoice/invoice?orderId=' + this.orderInfo.orderId
+ })
+ },
//拼团信息
getTeam(id) {
this.$u.api.getOrderPinTuanTeamInfo({
diff --git a/CoreCms.Net.Uni-App/CoreShop/pages/member/order/invoice/invoice.scss b/CoreCms.Net.Uni-App/CoreShop/pages/member/order/invoice/invoice.scss
new file mode 100644
index 00000000..43f74f1b
--- /dev/null
+++ b/CoreCms.Net.Uni-App/CoreShop/pages/member/order/invoice/invoice.scss
@@ -0,0 +1,9 @@
+.cu-form-group .title { min-width: calc(4em + 15px); }
+
+.coreshop-bottomBox .coreshop-btn { width: 100%; }
+.cheque { position: relative; }
+.cheque-content { position: absolute; left: 7.5px; z-index: 10; width: calc(100% - 15px);; background-color: #fff; box-shadow: 0 0 0.666667vw 0.4vw rgba(0, 0, 0, .13); border-radius: 5px; padding: 10px; }
+.tips-item { margin-bottom: 10px; }
+.tips-name { font-size: 16px; line-height: 17.5px; color: #333; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-bottom: 5px; }
+.sub-div { display: flex; width: 100%; justify-content: space-between; height: 15px; font-size: 12px; line-height: 15px; color: #999; }
+.num { display: inline-block; }
diff --git a/CoreCms.Net.Uni-App/CoreShop/pages/member/order/invoice/invoice.vue b/CoreCms.Net.Uni-App/CoreShop/pages/member/order/invoice/invoice.vue
new file mode 100644
index 00000000..12f0ef61
--- /dev/null
+++ b/CoreCms.Net.Uni-App/CoreShop/pages/member/order/invoice/invoice.vue
@@ -0,0 +1,228 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{item.name|| ''}}
+
+
+
+ {{item.code|| ''}}
+
+
+
+ {{item.frequency|| ''}}
+
+ 人使用过
+
+
+
+
+
+
+
+
+
+ 明细
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/CoreCms.Net.Web.WebApi/Controllers/OrderController.cs b/CoreCms.Net.Web.WebApi/Controllers/OrderController.cs
index 53f6827c..e2c278a9 100644
--- a/CoreCms.Net.Web.WebApi/Controllers/OrderController.cs
+++ b/CoreCms.Net.Web.WebApi/Controllers/OrderController.cs
@@ -45,16 +45,12 @@ namespace CoreCms.Net.Web.WebApi.Controllers
private readonly ICoreCmsAreaServices _areaServices;
private readonly ICoreCmsBillReshipServices _reshipServices;
private readonly ICoreCmsShipServices _shipServices;
- private readonly ICoreCmsBillDeliveryServices _billDeliveryServices;
private readonly ICoreCmsLogisticsServices _logisticsServices;
- private readonly ICoreCmsGoodsServices _goodsServices;
- private readonly ICoreCmsStoreServices _storeServices;
private readonly ICoreCmsOrderDistributionModelServices _orderDistributionModelServices;
- private readonly ICoreCmsBillPaymentsServices _billPaymentsServices;
private readonly IRedisOperationRepository _redisOperationRepository;
private readonly ICoreCmsUserServices _userServices;
private readonly ICoreCmsClerkServices _clerkServices;
-
+ private readonly ICoreCmsInvoiceServices _invoiceServices;
///
@@ -65,8 +61,7 @@ namespace CoreCms.Net.Web.WebApi.Controllers
, ICoreCmsBillAftersalesServices aftersalesServices
, ICoreCmsSettingServices settingServices
, ICoreCmsAreaServices areaServices
- , ICoreCmsBillReshipServices reshipServices, ICoreCmsShipServices shipServices
- , ICoreCmsBillDeliveryServices billDeliveryServices, ICoreCmsLogisticsServices logisticsServices, ICoreCmsGoodsServices goodsServices, ICoreCmsStoreServices storeServices, ICoreCmsOrderDistributionModelServices orderDistributionModelServices, IRedisOperationRepository redisOperationRepository, ICoreCmsBillPaymentsServices billPaymentsServices, ICoreCmsUserServices userServices, ICoreCmsClerkServices clerkServices)
+ , ICoreCmsBillReshipServices reshipServices, ICoreCmsShipServices shipServices, ICoreCmsLogisticsServices logisticsServices, ICoreCmsOrderDistributionModelServices orderDistributionModelServices, IRedisOperationRepository redisOperationRepository, ICoreCmsUserServices userServices, ICoreCmsClerkServices clerkServices, ICoreCmsInvoiceServices invoiceServices)
{
_user = user;
_orderServices = orderServices;
@@ -75,15 +70,12 @@ namespace CoreCms.Net.Web.WebApi.Controllers
_areaServices = areaServices;
_reshipServices = reshipServices;
_shipServices = shipServices;
- _billDeliveryServices = billDeliveryServices;
_logisticsServices = logisticsServices;
- _goodsServices = goodsServices;
- _storeServices = storeServices;
_orderDistributionModelServices = orderDistributionModelServices;
_redisOperationRepository = redisOperationRepository;
- _billPaymentsServices = billPaymentsServices;
_userServices = userServices;
_clerkServices = clerkServices;
+ _invoiceServices = invoiceServices;
}
@@ -681,6 +673,100 @@ namespace CoreCms.Net.Web.WebApi.Controllers
#endregion
+ #region 检查订单发票是否已经开具=======================================================
+
+ ///
+ /// 检查订单发票是否已经开具
+ ///
+ ///
+ [HttpPost]
+ [Authorize]
+ public async Task CheckInvoice([FromBody] FMStringId entity)
+ {
+ var jm = new WebApiCallBack();
+
+ if (string.IsNullOrEmpty(entity.id))
+ {
+ jm.msg = "请提交订单编码。";
+ return jm;
+ }
+
+ var isHave = await _invoiceServices.ExistsAsync(p => p.sourceId == entity.id && p.category == (int)GlobalEnumVars.OrderTaxCategory.Order);
+
+ jm.status = true;
+ jm.data = isHave;
+
+ return jm;
+ }
+
+ #endregion
+
+
+ #region 提交发票申请=======================================================
+
+ ///
+ /// 提交发票申请
+ ///
+ ///
+ [HttpPost]
+ [Authorize]
+ public async Task SubmitInvoiceApply([FromBody] FMSubmitInvoiceApply entity)
+ {
+ var jm = new WebApiCallBack();
+
+
+ if (entity.type == 3 && string.IsNullOrEmpty(entity.code))
+ {
+ jm.msg = "企业发票申请必须填写纳税人识别号";
+ return jm;
+ }
+
+ var isHave = await _invoiceServices.ExistsAsync(p => p.sourceId == entity.orderId && p.category == (int)GlobalEnumVars.OrderTaxCategory.Order);
+ if (isHave)
+ {
+ jm.msg = "此订单已经存在发票信息。";
+ return jm;
+ }
+
+ var order = await _orderServices.QueryByClauseAsync(p => p.orderId == entity.orderId);
+ if (order == null)
+ {
+ jm.msg = "订单查询失败。";
+ return jm;
+ }
+
+ if (order.userId != _user.ID)
+ {
+ jm.msg = "你无权申请发票。";
+ return jm;
+ }
+
+ //组装发票信息
+ var taxInfo = new CoreCmsInvoice
+ {
+ category = (int)GlobalEnumVars.OrderTaxCategory.Order,
+ sourceId = order.orderId,
+ userId = order.userId,
+ type = entity.type,
+ title = entity.name,
+ taxNumber = entity.code,
+ amount = order.orderAmount,
+ status = (int)GlobalEnumVars.OrderTaxStatus.No,
+ createTime = DateTime.Now
+ };
+
+ var bl = await _invoiceServices.InsertAsync(taxInfo) > 0;
+
+ jm.status = true;
+ jm.data = bl;
+
+ return jm;
+ }
+
+ #endregion
+
+
+
}
diff --git a/CoreCms.Net.Web.WebApi/CoreCms.Net.Web.WebApi.xml b/CoreCms.Net.Web.WebApi/CoreCms.Net.Web.WebApi.xml
index 392db070..c2da3646 100644
--- a/CoreCms.Net.Web.WebApi/CoreCms.Net.Web.WebApi.xml
+++ b/CoreCms.Net.Web.WebApi/CoreCms.Net.Web.WebApi.xml
@@ -571,7 +571,7 @@
订单调用接口数据
-
+
构造函数
@@ -678,6 +678,18 @@
+
+
+ 检查订单发票是否已经开具
+
+
+
+
+
+ 提交发票申请
+
+
+
页面接口