### 0.3.3 专业版:

【新增】后台新增支付单查询功能,实现支付单微信反馈支付数据,防止出现极端情况下,导致的支付数据回调失败而影响订单业务。#I4ZRMR
【新增】后台新增发票上传功能,前端小程序新增发票下载功能。#I4ZYT3
【新增】商家中心订单查询,增加发票下载查看功能。
【新增】代码生成器Controller模板的导出excel请求增加decimal类型的处理。
【优化】调整前端帮助文档默认传值问题,未指定具体分类情况下,默认取第一个栏目数据。
【修复】修复页面设计上传图片后不进行预览的问题。
This commit is contained in:
JianWeie
2022-03-29 17:07:26 +08:00
parent ad1ce9044e
commit c341aeb8c8
22 changed files with 15459 additions and 114 deletions

View File

@@ -398,6 +398,12 @@ namespace CoreCms.Net.Web.Admin.Controllers
//{{field.ColumnDescription}} {{field.DataType}}
var {{field.DbColumnName}} = Request.Form["{{field.DbColumnName}}"].FirstOrDefault().ObjectToInt(0);
if ({{field.DbColumnName}} > 0)
{
where = where.And(p => p.{{field.DbColumnName}} == {{field.DbColumnName}});
}{% elsif field.DataType == 'decimal' %}
//{{field.ColumnDescription}} {{field.DataType}}
var {{field.DbColumnName}} = Request.Form["{{field.DbColumnName}}"].FirstOrDefault().ObjectToDecimal(0);
if ({{field.DbColumnName}} > 0)
{
where = where.And(p => p.{{field.DbColumnName}} == {{field.DbColumnName}});
}{% elsif field.DataType == 'datetime' %}

View File

@@ -4,10 +4,12 @@
* Web: https://www.corecms.net
* Author: 大灰灰
* Email: jianweie@163.com
* CreateTime: 2021-06-08 22:14:58
* CreateTime: 2022/3/29 13:39:43
* Description: 暂无
***********************************************************************/
***********************************************************************/
using SqlSugar;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
namespace CoreCms.Net.Model.Entities
@@ -15,11 +17,10 @@ namespace CoreCms.Net.Model.Entities
/// <summary>
/// 发票表
/// </summary>
[SugarTable("CoreCmsInvoice",TableDescription = "发票表")]
public partial class CoreCmsInvoice
{
/// <summary>
/// 发票表
/// 构造函数
/// </summary>
public CoreCmsInvoice()
{
@@ -29,86 +30,159 @@ namespace CoreCms.Net.Model.Entities
/// 序列
/// </summary>
[Display(Name = "序列")]
[SugarColumn(ColumnDescription = "序列", IsPrimaryKey = true, IsIdentity = true)]
[SugarColumn(IsPrimaryKey = true, IsIdentity = true)]
[Required(ErrorMessage = "请输入{0}")]
public System.Int32 id { get; set; }
/// <summary>
/// 开票类型
/// </summary>
[Display(Name = "开票类型")]
[SugarColumn(ColumnDescription = "开票类型")]
[Required(ErrorMessage = "请输入{0}")]
public System.Int32 category { get; set; }
/// <summary>
/// 资源ID
/// </summary>
[Display(Name = "资源ID")]
[SugarColumn(ColumnDescription = "资源ID", IsNullable = true)]
[StringLength(32, ErrorMessage = "【{0}】不能超过{1}字符长度")]
[StringLength(maximumLength:32,ErrorMessage = "{0}不能超过{1}字")]
public System.String sourceId { get; set; }
/// <summary>
/// 所属用户ID
/// </summary>
[Display(Name = "所属用户ID")]
[SugarColumn(ColumnDescription = "所属用户ID")]
[Required(ErrorMessage = "请输入{0}")]
public System.Int32 userId { get; set; }
/// <summary>
/// 发票类型
/// </summary>
[Display(Name = "发票类型")]
[SugarColumn(ColumnDescription = "发票类型")]
[Required(ErrorMessage = "请输入{0}")]
public System.Int32 type { get; set; }
/// <summary>
/// 发票抬头
/// </summary>
[Display(Name = "发票抬头")]
[SugarColumn(ColumnDescription = "发票抬头")]
[Required(ErrorMessage = "请输入{0}")]
[StringLength(255, ErrorMessage = "{0}不能超过{1}字符长度")]
[StringLength(maximumLength:255,ErrorMessage = "{0}不能超过{1}字")]
public System.String title { get; set; }
/// <summary>
/// 发票税号
/// </summary>
[Display(Name = "发票税号")]
[SugarColumn(ColumnDescription = "发票税号")]
[Required(ErrorMessage = "请输入{0}")]
[StringLength(32, ErrorMessage = "{0}不能超过{1}字符长度")]
[StringLength(maximumLength:32,ErrorMessage = "{0}不能超过{1}字")]
public System.String taxNumber { get; set; }
/// <summary>
/// 发票金额
/// </summary>
[Display(Name = "发票金额")]
[SugarColumn(ColumnDescription = "发票金额")]
[Required(ErrorMessage = "请输入{0}")]
public System.Decimal amount { get; set; }
/// <summary>
/// 开票状态
/// </summary>
[Display(Name = "开票状态")]
[SugarColumn(ColumnDescription = "开票状态")]
[Required(ErrorMessage = "请输入{0}")]
public System.Int32 status { get; set; }
/// <summary>
/// 开票备注
/// </summary>
[Display(Name = "开票备注")]
[SugarColumn(ColumnDescription = "开票备注", IsNullable = true)]
[StringLength(2000, ErrorMessage = "【{0}】不能超过{1}字符长度")]
[StringLength(maximumLength:2000,ErrorMessage = "{0}不能超过{1}字")]
public System.String remarks { get; set; }
/// <summary>
/// 创建时间
/// </summary>
[Display(Name = "创建时间")]
[SugarColumn(ColumnDescription = "创建时间")]
[Required(ErrorMessage = "请输入{0}")]
public System.DateTime createTime { get; set; }
/// <summary>
/// 更新时间
/// </summary>
[Display(Name = "更新时间")]
[SugarColumn(ColumnDescription = "更新时间", IsNullable = true)]
public System.DateTime? updateTime { get; set; }
/// <summary>
/// 发票下载地址
/// </summary>
[Display(Name = "发票下载地址")]
[StringLength(maximumLength:500,ErrorMessage = "{0}不能超过{1}字")]
public System.String fileUrl { get; set; }
}
}

View File

@@ -65,6 +65,7 @@ namespace CoreCms.Net.Repository
remarks = p.remarks,
createTime = p.createTime,
updateTime = p.updateTime,
fileUrl = p.fileUrl,
userNickName = sc.nickName
})
.MergeTable()
@@ -88,6 +89,7 @@ namespace CoreCms.Net.Repository
remarks = p.remarks,
createTime = p.createTime,
updateTime = p.updateTime,
fileUrl = p.fileUrl,
userNickName = sc.nickName
})
.MergeTable()

View File

@@ -57,10 +57,7 @@
onLoad(options) {
if (options.cid) {
this.cid = Number(options.cid);
} else {
this.cid = 1;
}
this.articleList();
if (options.current) {
this.current = options.current;

View File

@@ -201,7 +201,14 @@
<text>{{orderInfo.invoice.taxNumber|| '无'}}</text>
</view>
</view>
<view class="coreshop-text-black title-view" v-if="orderInfo.invoice.fileUrl">
<view class="title">下载发票</view>
<view class="coreshop-text-right coreshop-flex coreshop-justify-end">
<view class="coreshop-width-fit-content">
<u-tag text="保存到本地" type="success" size="mini" mode="dark" @click="saveInvoice()" />
</view>
</view>
</view>
</view>
</view>
@@ -502,6 +509,64 @@
ladingWrite(id) {
this.$u.route('/pages/member/merchant/takeDelivery/index?id=' + id);
},
// 保存发票到本地
saveInvoice() {
let _this = this;
// #ifdef MP || MP-ALIPAY || APP-PLUS || APP-PLUS-NVUE
_this.download(_this.orderInfo.invoice.fileUrl)
// #endif
},
download(fileUrl) {
let _this = this
// #ifdef APP-PLUS || APP-PLUS-NVUE
uni.downloadFile({
url: fileUrl,
success(res) {
uni.saveImageToPhotosAlbum({
filePath: res.tempFilePath,
success() {
_this.$refs.uToast.show({ message: '操作成功', type: 'success' })
},
fail() {
_this.$u.toast('发票保存失败')
}
});
},
fail() {
_this.$u.toast('下载失败')
}
})
// #endif
// #ifdef MP
uni.authorize({
scope: 'scope.writePhotosAlbum',
success() {
// 先下载到本地
uni.downloadFile({
url: fileUrl,
success(res) {
uni.saveImageToPhotosAlbum({
filePath: res.tempFilePath,
success() {
_this.$refs.uToast.show({ message: '保存成功', type: 'success' })
},
fail() {
_this.$u.toast('发票保存失败')
}
});
},
fail() {
_this.$u.toast('下载失败')
}
})
},
fail() {
//console.log('授权失败')
}
})
// #endif
}
}
}
</script>

View File

@@ -230,7 +230,14 @@
<text>{{orderInfo.invoice.taxNumber|| '无'}}</text>
</view>
</view>
<view class="coreshop-text-black title-view">
<view class="title">下载发票</view>
<view class="coreshop-text-right coreshop-flex coreshop-justify-end">
<view class="coreshop-width-fit-content">
<u-tag text="保存到本地" type="success" size="mini" mode="dark" @click="saveInvoice()" />
</view>
</view>
</view>
</view>
</view>
@@ -688,6 +695,64 @@
url: '/pages/member/invoice/index?id=' + this.orderInfo.invoice.id
});
}
},
// 保存发票到本地
saveInvoice() {
let _this = this;
// #ifdef MP || MP-ALIPAY || APP-PLUS || APP-PLUS-NVUE
_this.download(_this.orderInfo.invoice.fileUrl)
// #endif
},
download(fileUrl) {
let _this = this
// #ifdef APP-PLUS || APP-PLUS-NVUE
uni.downloadFile({
url: fileUrl,
success(res) {
uni.saveImageToPhotosAlbum({
filePath: res.tempFilePath,
success() {
_this.$refs.uToast.show({ message: '操作成功', type: 'success' })
},
fail() {
_this.$u.toast('图片保存失败')
}
});
},
fail() {
_this.$u.toast('下载失败')
}
})
// #endif
// #ifdef MP
uni.authorize({
scope: 'scope.writePhotosAlbum',
success() {
// 先下载到本地
uni.downloadFile({
url: fileUrl,
success(res) {
uni.saveImageToPhotosAlbum({
filePath: res.tempFilePath,
success() {
_this.$refs.uToast.show({ message: '保存成功', type: 'success' })
},
fail() {
_this.$u.toast('图片保存失败')
}
});
},
fail() {
_this.$u.toast('下载失败')
}
})
},
fail() {
//console.log('授权失败')
}
})
// #endif
}
}
}

View File

@@ -24,9 +24,13 @@ using CoreCms.Net.Model.FromBody;
using CoreCms.Net.Model.ViewModels.UI;
using CoreCms.Net.Utility.Extensions;
using CoreCms.Net.Utility.Helper;
using Essensoft.Paylink.WeChatPay;
using Essensoft.Paylink.WeChatPay.V2;
using Essensoft.Paylink.WeChatPay.V2.Request;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Options;
using NPOI.HSSF.UserModel;
using SqlSugar;
@@ -44,17 +48,24 @@ namespace CoreCms.Net.Web.Admin.Controllers
{
private readonly ICoreCmsBillPaymentsServices _coreCmsBillPaymentsServices;
private readonly IWebHostEnvironment _webHostEnvironment;
private readonly IWeChatPayClient _client;
private readonly IOptions<WeChatPayOptions> _optionsAccessor;
/// <summary>
/// 构造函数
/// </summary>
/// <param name="webHostEnvironment"></param>
/// <param name="coreCmsBillPaymentsServices"></param>
/// <param name="client"></param>
/// <param name="optionsAccessor"></param>
public CoreCmsBillPaymentsController(IWebHostEnvironment webHostEnvironment
, ICoreCmsBillPaymentsServices coreCmsBillPaymentsServices)
, ICoreCmsBillPaymentsServices coreCmsBillPaymentsServices, IWeChatPayClient client, IOptions<WeChatPayOptions> optionsAccessor)
{
_webHostEnvironment = webHostEnvironment;
_coreCmsBillPaymentsServices = coreCmsBillPaymentsServices;
_client = client;
_optionsAccessor = optionsAccessor;
}
#region ============================================================
@@ -475,5 +486,71 @@ namespace CoreCms.Net.Web.Admin.Controllers
}
#endregion
#region
// POST: Api/CoreCmsBillPayments/DoRefresh/10
/// <summary>
/// 更新微信支付数据
/// </summary>
/// <param name="entity"></param>
/// <returns></returns>
[HttpPost]
[Description("更新微信支付数据")]
public async Task<AdminUiCallBack> DoRefresh([FromBody] FMStringId entity)
{
var jm = new AdminUiCallBack();
var model = await _coreCmsBillPaymentsServices.QueryByClauseAsync(p => p.paymentId == entity.id);
if (model == null)
{
jm.msg = "不存在此信息";
return jm;
}
if (model.paymentCode != GlobalEnumVars.PaymentsTypes.wechatpay.ToString())
{
jm.msg = "此更新暂时仅支持微信支付查询";
return jm;
}
if (model.status == (int)GlobalEnumVars.BillPaymentsStatus.Payed)
{
jm.msg = "订单已经支付成功,无需更新";
return jm;
}
var request = new WeChatPayOrderQueryRequest
{
//微信订单号
//TransactionId = model.TransactionId,
//商户订单号
OutTradeNo = model.paymentId
};
var response = await _client.ExecuteAsync(request, _optionsAccessor.Value);
if (response is { ReturnCode: WeChatPayCode.Success, ResultCode: WeChatPayCode.Success, TradeState: WeChatPayCode.Success })
{
var money = Math.Round((decimal)response.TotalFee / 100, 2);
await _coreCmsBillPaymentsServices.ToUpdate(response.OutTradeNo,
(int)GlobalEnumVars.BillPaymentsStatus.Payed,
GlobalEnumVars.PaymentsTypes.wechatpay.ToString(), money, response.ResultCode,
response.TransactionId);
jm.code = 0;
jm.msg = "刷新成功";
jm.data = response;
}
else
{
jm.code = 1;
jm.msg = response.TradeStateDesc;
}
return jm;
}
#endregion
}
}

View File

@@ -75,49 +75,22 @@ namespace CoreCms.Net.Web.Admin.Controllers
var where = PredicateBuilder.True<CoreCmsInvoice>();
//获取排序字段
var orderField = Request.Form["orderField"].FirstOrDefault();
Expression<Func<CoreCmsInvoice, object>> orderEx;
switch (orderField)
Expression<Func<CoreCmsInvoice, object>> orderEx = orderField switch
{
case "id":
orderEx = p => p.id;
break;
case "category":
orderEx = p => p.category;
break;
case "sourceId":
orderEx = p => p.sourceId;
break;
case "userId":
orderEx = p => p.userId;
break;
case "type":
orderEx = p => p.type;
break;
case "title":
orderEx = p => p.title;
break;
case "taxNumber":
orderEx = p => p.taxNumber;
break;
case "amount":
orderEx = p => p.amount;
break;
case "status":
orderEx = p => p.status;
break;
case "remarks":
orderEx = p => p.remarks;
break;
case "createTime":
orderEx = p => p.createTime;
break;
case "updateTime":
orderEx = p => p.updateTime;
break;
default:
orderEx = p => p.id;
break;
}
"id" => p => p.id,
"category" => p => p.category,
"sourceId" => p => p.sourceId,
"userId" => p => p.userId,
"type" => p => p.type,
"title" => p => p.title,
"taxNumber" => p => p.taxNumber,
"amount" => p => p.amount,
"status" => p => p.status,
"remarks" => p => p.remarks,
"createTime" => p => p.createTime,
"updateTime" => p => p.updateTime,
_ => p => p.id
};
//设置排序方式
var orderDirection = Request.Form["orderDirection"].FirstOrDefault();
@@ -144,6 +117,9 @@ namespace CoreCms.Net.Web.Admin.Controllers
//发票类型 int
var type = Request.Form["type"].FirstOrDefault().ObjectToInt(0);
if (type > 0) where = where.And(p => p.type == type);
//开票状态 int
var status = Request.Form["status"].FirstOrDefault().ObjectToInt(0);
if (status > 0) where = where.And(p => p.status == status);
//发票抬头 nvarchar
var title = Request.Form["title"].FirstOrDefault();
if (!string.IsNullOrEmpty(title)) where = where.And(p => p.title.Contains(title));
@@ -299,6 +275,7 @@ namespace CoreCms.Net.Web.Admin.Controllers
oldModel.status = entity.status;
oldModel.remarks = entity.remarks;
oldModel.updateTime = DateTime.Now;
oldModel.fileUrl = entity.fileUrl;
//事物处理过程结束
var bl = await _coreCmsInvoiceServices.UpdateAsync(oldModel);

View File

@@ -186,6 +186,7 @@ var allWidget = {
"icon": "icon-shangpin",
"value": {
"title": '商品组名称',
"lookTitle": "true",
"lookMore": "true",
"type": "auto", //auto自动获取 choose 手动选择
"classifyId": '', //所选分类id
@@ -542,6 +543,18 @@ Vue.component('upload-img', {
}
}
})
Vue.component('upload-video', {
template: "#upload-video",
data: function () {
return {}
},
props: ['index', "item"],
methods: {
upload: function () {
this.$emit('upload-video');
}
}
})
Vue.component('upload-topslide-bg-img', {
template: "#upload-topslide-bg-img",
data: function () {
@@ -1054,6 +1067,30 @@ Vue.component('layout-config', {
});
});
},
upVideo: function (index, item) {
var _that = this;
layui.use(['form', 'table'], function () {
layui.admin.popup({
title: '上传视频',
area: ['800px', '300px'],
id: 'LAY-app-CoreCmsCommon-GetNoticeIds',
success: function (layero, indexChild) {
layui.view(this.id).render('common/getUpLoadVideo', null).done(function () {
layui.form.on('submit(LAY-app-getUpLoad-submit)',
function (data) {
console.log(data);
_that.$set(_that.selectWg.value.list[index], 'url', data.field.url)
layer.close(indexChild);
});
});
}
, btn: ['确定', '取消']
, yes: function (index, layero) {
layero.contents().find("#LAY-app-getUpLoad-submit").click();
}
});
});
},
upTopSlideBgImage: function (index, item) {
var _that = this;
layui.use(['admin', 'coreHelper', 'cropperImg'],

View File

@@ -51,11 +51,11 @@
, url: layui.setter.apiUrl + 'Api/Tools/UploadFiles'
, before: function (obj) {
obj.preview(function (index, file, result) {
$('#viewImgBox').attr('src', result);
$('#viewImgBoximageUrl').attr('src', result);
});
}
, done: function (res) {
if (res.code > 0) { return layer.msg('上传失败'); }
if (res.code > 0) { return layer.msg(res.msg); }
layer.msg('上传成功');
$("#imagesUrl").val(res.data.fileUrl);
}

View File

@@ -0,0 +1,76 @@
<script type="text/html" template lay-done="layui.data.done(d);">
<div class="layui-form coreshop-form layui-form-pane">
<blockquote class="layui-elem-quote">
请选择小于10M的视频进行裁剪上传
</blockquote>
<div class="layui-form-item">
<div class="layui-inline">
<label class="layui-form-label">地址</label>
<div class="layui-input-inline layui-inline-8">
<input name="url" id="url" type="text" class="layui-input" lay-verify="required|url" lay-reqText="可手动输入地址或点击上传" />
</div>
<div class="layui-input-inline">
<button type="button" class="layui-btn" id="upBtn" lay-active="doCropperImg">上传附件</button>
<div id="viewTextBox"></div>
</div>
</div>
</div>
<div class="layui-form-item core-hidden">
<div class="layui-input-block">
<div class="layui-footer">
<input type="button" class="layui-btn" lay-submit lay-filter="LAY-app-getUpLoad-submit" id="LAY-app-getUpLoad-submit" value="确认添加">
</div>
</div>
</div>
</div>
</script>
<script>
var debug = layui.setter.debug;
layui.data.done = function (d) {
//开启调试情况下获取接口赋值数据
if (debug) { console.log(d); }
layui.use(['index', 'table', 'laydate', 'upload', 'coreHelper'],
function () {
var $ = layui.$
, admin = layui.admin
, table = layui.table
, form = layui.form
, laydate = layui.laydate
, setter = layui.setter
, coreHelper = layui.coreHelper
, upload = layui.upload
, view = layui.view;
//普通图片上传
var uploadInst = upload.render({
elem: '#upBtn',
accept: 'video'
, url: layui.setter.apiUrl + 'Api/Tools/UploadFiles'
, before: function (obj) {
obj.preview(function (index, file, result) {
// $('#viewImgBox').attr('src', result);
});
}
, done: function (res) {
if (res.code > 0) { return layer.msg(res.msg); }
layer.msg('上传成功');
$("#url").val(res.data.fileUrl);
}
, error: function () {
var viewTextBox = $('#viewTextBox');
viewTextBox.html('<span style="color: #FF5722;">上传失败</span> <a class="layui-btn layui-btn-xs demo-reload">重试</a>');
viewTextBox.find('.demo-reload').on('click', function () {
uploadInst.upload();
});
}
});
//重载form
form.render();
});
};
</script>

View File

@@ -69,6 +69,9 @@
</script>
<script type="text/html" id="LAY-app-CoreCmsBillPayments-tableBox-bar">
<a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="detail">查看</a>
{{# if(d.paymentCode == 'wechatpay' && d.status !=2){ }}
<a class="layui-btn layui-btn-xs" lay-event="doRefresh">刷新</a>
{{# } }}
</script>
<script>
@@ -149,7 +152,7 @@
}
},
{
field: 'paymentCode', title: '支付状态', sort: false, width: 105,
field: 'paymentCode', title: '支付方式', sort: false, width: 105,
templet: function (data) {
for (var i = 0; i < d.data.paymentCode.length; i++) {
if (data.paymentCode == d.data.paymentCode[i].title) {
@@ -163,7 +166,7 @@
{ field: 'payedMsg', title: '支付备注', sort: false },
{ field: 'createTime', title: '创建时间', width: 130, sort: false },
{ field: 'updateTime', title: '更新时间', width: 130, sort: false },
{ width: 82, align: 'center', title: '操作', fixed: 'right', toolbar: '#LAY-app-CoreCmsBillPayments-tableBox-bar' }
{ width: 120, align: 'center', title: '操作', fixed: 'right', toolbar: '#LAY-app-CoreCmsBillPayments-tableBox-bar' }
]
]
});
@@ -194,13 +197,16 @@
function (obj) {
if (obj.event === 'detail') {
doDetails(obj);
} else if (obj.event === 'doRefresh') {
doRefresh(obj);
}
});
//执行预览操作
function doDetails(obj) {
coreHelper.Post("Api/CoreCmsBillPayments/GetDetails", { id: obj.data.paymentId }, function (e) {
if (e.code === 0) {
admin.popup({ shadeClose: false,
admin.popup({
shadeClose: false,
title: '查看详情',
area: ['600px', '550px'],
id: 'LAY-popup-CoreCmsBillPayments-details',
@@ -215,6 +221,12 @@
}
});
}
//执行刷新操作
function doRefresh(obj) {
coreHelper.Post("Api/CoreCmsBillPayments/doRefresh", { id: obj.data.paymentId }, function (e) {
layer.msg(e.msg);
});
}
//执行查询条件导出excel
function doQueryExportexcel() {

View File

@@ -6,7 +6,7 @@
<label for="category" class="layui-form-label">开票类型</label>
<div class="layui-input-inline layui-inline-3">
<select name="category" id="category" lay-search lay-verType="tips" disabled="disabled">
<select name="category" id="category" lay-search disabled="disabled">
{{# layui.each(d.params.data.orderTaxCategory, function(index, item){ }}
<option value="{{item.value}}" {{item.value===d.params.data.model.category?'selected="selected"':''}}>{{item.description}}</option>
{{# }); }}
@@ -14,14 +14,14 @@
</div>
<label for="sourceId" class="layui-form-label">资源ID</label>
<div class="layui-input-inline layui-inline-3">
<input name="sourceId" id="sourceId" lay-verType="tips" lay-verify="required|verifytitle" class="layui-input" value="{{d.params.data.model.sourceId || '' }}" disabled="disabled" />
<input name="sourceId" id="sourceId" lay-verify="required|verifytitle" class="layui-input" value="{{d.params.data.model.sourceId || '' }}" disabled="disabled" />
</div>
</div>
<div class="layui-form-item">
<label for="status" class="layui-form-label">开票状态</label>
<div class="layui-input-inline layui-inline-3">
<select name="status" id="status" lay-search lay-verType="tips" lay-verify="required|verifylogiCode">
<select name="status" id="status" lay-search lay-verify="required|verifylogiCode">
<option value="">请选择</option>
{{# layui.each(d.params.data.orderTaxStatus, function(index, item){ }}
<option value="{{item.value}}" {{item.value===d.params.data.model.status?'selected="selected"':''}}>{{item.description}}</option>
@@ -30,7 +30,7 @@
</div>
<label for="type" class="layui-form-label">发票类型</label>
<div class="layui-input-inline layui-inline-3">
<select name="type" id="type" lay-search lay-verType="tips" lay-verify="required">
<select name="type" id="type" lay-search lay-verify="required">
<option value="">请选择</option>
<option value="2" {{d.params.data.model.type===2?'selected="selected"':''}}>个人发票</option>
<option value="3" {{d.params.data.model.type===3?'selected="selected"':''}}>公司发票</option>
@@ -41,21 +41,32 @@
<div class="layui-form-item">
<label for="title" class="layui-form-label">发票抬头</label>
<div class="layui-input-inline layui-inline-8">
<input name="title" id="title" lay-verType="tips" lay-verify="required|verifytitle" class="layui-input" placeholder="请输入发票抬头" lay-reqText="请输入发票抬头" value="{{d.params.data.model.title || '' }}" />
<input name="title" id="title" lay-verify="required|verifytitle" class="layui-input" placeholder="请输入发票抬头" lay-reqText="请输入发票抬头" value="{{d.params.data.model.title || '' }}" />
</div>
</div>
<div class="layui-form-item" lay-size="sm">
<label for="taxNumber" class="layui-form-label">发票税号</label>
<div class="layui-input-inline layui-inline-3">
<input name="taxNumber" id="taxNumber" lay-verType="tips" class="layui-input" placeholder="请输入发票税号" lay-reqText="请输入发票税号" value="{{d.params.data.model.taxNumber || '' }}" />
<input name="taxNumber" id="taxNumber" class="layui-input" placeholder="请输入发票税号" lay-reqText="请输入发票税号" value="{{d.params.data.model.taxNumber || '' }}" />
</div>
<label for="amount" class="layui-form-label">发票金额</label>
<div class="layui-input-inline layui-inline-3">
<input name="amount" id="amount" lay-verType="tips" lay-verify="required" class="layui-input" placeholder="请输入发票金额" lay-reqText="请输入发票金额" value="{{d.params.data.model.amount || '' }}" />
<input name="amount" id="amount" lay-verify="required" class="layui-input" placeholder="请输入发票金额" lay-reqText="请输入发票金额" value="{{d.params.data.model.amount || '' }}" />
</div>
</div>
<div class="layui-form-item">
<label for="fileUrl" class="layui-form-label">发票下载地址</label>
<div class="layui-input-inline layui-inline-5">
<input name="fileUrl" id="fileUrl" class="layui-input" placeholder="请输入发票下载地址" lay-reqText="请输入发票下载地址" value="{{d.params.data.model.fileUrl || '' }}" />
</div>
<div class="layui-input-inline">
<button type="button" class="layui-btn" id="upBtn">上传发票</button>
</div>
</div>
<div class="layui-form-item layui-form-text">
<label for="remarks" class="layui-form-label">开票备注</label>
<div class="layui-input-block">
@@ -86,6 +97,25 @@
, upload = layui.upload
, coreHelper = layui.coreHelper;
//普通图片上传
var uploadInst = upload.render({
elem: '#upBtn'
, accept: 'file'
, url: layui.setter.apiUrl + 'Api/Tools/UploadFiles'
, done: function (res) {
if (res.code > 0) { return layer.msg(res.msg); }
layer.msg('上传成功');
$("#fileUrl").val(res.data.fileUrl);
}
, error: function () {
var viewTextBox = $('#viewTextBox');
viewTextBox.html('<span style="color: #FF5722;">上传失败</span> <a class="layui-btn layui-btn-xs demo-reload">重试</a>');
viewTextBox.find('.demo-reload').on('click', function () {
uploadInst.upload();
});
}
});
form.verify({
verifysourceId: [/^[\S]{0,32}$/, '资源ID最大只允许输入32位字符且不能出现空格'],

View File

@@ -184,6 +184,7 @@
}
},
{ field: 'fileUrl', title: '发票下载地址', sort: false},
{ field: 'remarks', title: '开票备注', sort: false, width: 105 },
{ field: 'createTime', title: '创建时间', width: 130, sort: false },
{ field: 'updateTime', title: '更新时间', width: 130, sort: false },
@@ -229,7 +230,7 @@
admin.popup({
shadeClose: false,
title: '编辑数据',
area: ['600px', '500px'],
area: ['600px', '90%'],
id: 'LAY-popup-CoreCmsInvoice-edit',
success: function (layero, index) {
view(this.id).render('financial/invoice/edit', { data: e.data }).done(function () {

View File

@@ -841,7 +841,8 @@
</div>
<div class="content-item">
<span class="item-label">视频地址:</span>
<el-input size="mini" placeholder="请输入视频地址" v-model="item.url"></el-input>
<!--<el-input size="mini" placeholder="请输入视频地址" v-model="item.url"></el-input>-->
<upload-video @upload-video="upVideo(index,item)" :index="index" :item="item"></upload-video>
</div>
</div>
</li>
@@ -1103,6 +1104,14 @@
</div>
</div>
</template>
<template id="upload-video">
<div style="margin-bottom: 10px; width: 70%;">
<el-input size="mini" placeholder="请输入视频地址" v-model="item.url"></el-input>
<button type="button" class="layui-btn layui-btn-sm" @click="upload" style="margin-top: 10px;">上传视频</button>
</div>
</template>
<template id="upload-img">
<div>
<button type="button" class="layui-btn layui-btn-sm" @click="upload">上传图片</button>

View File

@@ -8,12 +8,16 @@
* Description: 暂无
***********************************************************************/
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using CoreCms.Net.Auth.HttpContextUser;
using CoreCms.Net.IServices;
using CoreCms.Net.Model.Entities;
using CoreCms.Net.Model.Entities.Expression;
using CoreCms.Net.Model.FromBody;
using CoreCms.Net.Model.ViewModels.UI;
using Essensoft.Paylink.Alipay.Domain;
using Microsoft.AspNetCore.Mvc;
using SqlSugar;
@@ -77,25 +81,37 @@ namespace CoreCms.Net.Web.WebApi.Controllers
{
var jm = new WebApiCallBack();
var list = await _articleServices.QueryPageAsync(p => p.isDel == false && p.typeId == entity.id, p => p.createTime, OrderByType.Desc,
entity.page, entity.limit);
var articleType = await _articleTypeServices.QueryAsync();
var typeName = string.Empty;
if (articleType.Any())
{
var type = articleType.Find(p => p.id == entity.id);
typeName = type != null ? type.name : "";
var where = PredicateBuilder.True<Model.Entities.CoreCmsArticle>();
if (entity.id > 0)
{
where = where.And(p => p.isDel == false && p.typeId == entity.id);
}
jm.status = true;
else
{
var typeId = articleType.FirstOrDefault()!.id;
where = where.And(p => p.isDel == false && p.typeId == typeId);
}
var list = await _articleServices.QueryPageAsync(where, p => p.createTime, OrderByType.Desc, entity.page, entity.limit);
jm.data = new
{
list,
articleType,
type_name = typeName,
count = list.TotalCount
};
}
else
{
jm.data = new
{
list = new List<CoreCmsArticle>(),
articleType,
count = 0
};
}
jm.status = true;
return jm;
}

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1 @@
ALTER TABLE CoreCmsInvoice ADD COLUMN fileUrl VARCHAR(500) DEFAULT NULL COMMENT '发票下载地址' AFTER updateTime;

View File

@@ -1,3 +1,6 @@
2022-03-29
【新增】表【CoreCmsInvoice】 新增 【fileUrl】发票下载地址字段
2022-03-25
【新增】表【WeChatTransactionComponentBrandAudit】【WeChatTransactionComponentBrandAuditLog】实现自定义交易组件上传品牌信息及品牌审核回调

View File

@@ -0,0 +1,2 @@
ALTER TABLE [dbo].[CoreCmsInvoice] ADD [fileUrl] NVARCHAR (500) NULL;
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'<EFBFBD><EFBFBD>Ʊ<EFBFBD><EFBFBD><EFBFBD>ص<EFBFBD>ַ', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'CoreCmsInvoice', @level2type = N'COLUMN', @level2name = N'fileUrl';

View File

@@ -1,3 +1,6 @@
2022-03-29
【新增】表【CoreCmsInvoice】 新增 【fileUrl】发票下载地址字段
2022-03-21
【新增】表【WeChatTransactionComponentBrandAudit】【WeChatTransactionComponentBrandAuditLog】实现自定义交易组件上传品牌信息及品牌审核回调