| | |
| | | /// <returns></returns> |
| | | public Task<List<CoreCmsProducts>> QueryDetaiListAsync(Expression<Func<CoreCmsProducts, bool>> predicate, |
| | | Expression<Func<CoreCmsProducts, object>> orderByExpression, OrderByType orderByType, bool blUseNoLock = false); |
| | | |
| | | /// <summary> |
| | | /// 获取编辑相关字段 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | public Task<CoreCmsProducts> QueryEditByID(int id); |
| | | |
| | | } |
| | | } |
| | |
| | | { |
| | | var jm = new AdminUiCallBack(); |
| | | |
| | | |
| | | var oldModel = await DbClient.Queryable<CoreCmsProducts>().In(entity.id).SingleAsync(); |
| | | if (oldModel == null) |
| | | { |
| | |
| | | return jm; |
| | | } |
| | | //事物处理过程开始 |
| | | oldModel.id = entity.id; |
| | | oldModel.goodsId = entity.goodsId; |
| | | oldModel.barcode = entity.barcode; |
| | | oldModel.sn = entity.sn; |
| | | |
| | | |
| | | |
| | | |
| | | oldModel.price = entity.price; |
| | | oldModel.costprice = entity.costprice; |
| | | oldModel.mktprice = entity.mktprice; |
| | | oldModel.marketable = entity.marketable; |
| | | oldModel.pointsDeduction = entity.pointsDeduction; |
| | | oldModel.points = entity.points; |
| | | //oldModel.marketable = entity.marketable; |
| | | //oldModel.pointsDeduction = entity.pointsDeduction; |
| | | //oldModel.points = entity.points; |
| | | oldModel.weight = entity.weight; |
| | | oldModel.stock = entity.stock; |
| | | oldModel.freezeStock = entity.freezeStock; |
| | | oldModel.spesDesc = entity.spesDesc; |
| | | oldModel.isDefalut = entity.isDefalut; |
| | | oldModel.images = entity.images; |
| | | oldModel.isDel = entity.isDel; |
| | | //oldModel.stock = entity.stock; |
| | | //oldModel.freezeStock = entity.freezeStock; |
| | | |
| | | |
| | | |
| | | |
| | | oldModel.distributionPrice = entity.distributionPrice; |
| | | oldModel.cutMoney = entity.cutMoney; |
| | | oldModel.distributionCutMoney = entity.distributionCutMoney; |
| | |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | |
| | | |
| | | #region 重写根据条件查询分页数据 |
| | | /// <summary> |
| | |
| | | using CoreCms.Net.Model.ViewModels.Basics; |
| | | using CoreCms.Net.Model.ViewModels.UI; |
| | | using SqlSugar; |
| | | using static CoreCms.Net.Configuration.GlobalEnumVars; |
| | | |
| | | |
| | | namespace CoreCms.Net.Services |
| | |
| | | { |
| | | return await _dal.QueryDetaiListAsync(predicate, orderByExpression, orderByType, blUseNoLock); |
| | | } |
| | | |
| | | public async Task<CoreCmsProducts> QueryEditByID(int id) |
| | | { |
| | | return await _unitOfWork.GetDbClient().Queryable<CoreCmsGoods, CoreCmsProducts>((good, product) => new JoinQueryInfos( |
| | | JoinType.Inner, good.id == product.goodsId |
| | | ) |
| | | ).Where((good, product) =>product.id==id) |
| | | .Select((good, product) => new CoreCmsProducts |
| | | { |
| | | id = product.id, |
| | | goodsId = product.goodsId, |
| | | barcode = product.barcode, |
| | | sn = product.sn, |
| | | price = product.price, |
| | | costprice = product.costprice, |
| | | mktprice = product.mktprice, |
| | | marketable = product.marketable, |
| | | weight = product.weight, |
| | | stock = product.stock, |
| | | freezeStock = product.freezeStock, |
| | | pointsDeduction = product.pointsDeduction, |
| | | points = product.points, |
| | | spesDesc = product.spesDesc, |
| | | isDefalut = product.isDefalut, |
| | | images = product.images, |
| | | isDel = good.isDel, |
| | | name = good.name, |
| | | bn = good.bn, |
| | | isMarketable = good.isMarketable, |
| | | unit = good.unit, |
| | | distributionPrice = product.distributionPrice, |
| | | cutMoney = product.cutMoney, |
| | | distributionCutMoney = product.distributionCutMoney, |
| | | }).With(SqlWith.NoLock) |
| | | .FirstAsync(); |
| | | |
| | | } |
| | | #endregion |
| | | |
| | | |
| | |
| | | { |
| | | var jm = new AdminUiCallBack(); |
| | | |
| | | var model = await _CoreCmsProductsServices.QueryByIdAsync(entity.id, false); |
| | | var model = await _CoreCmsProductsServices.QueryEditByID(entity.id); |
| | | if (model == null) |
| | | { |
| | | jm.msg = "不存在此信息"; |
| | |
| | | }); |
| | | }); |
| | | //监听行双击事件 |
| | | table.on('rowDouble(LAY-app-CoreCmsbaifenProducts-tableBox)', function (obj) { |
| | | //查看详情 |
| | | doDetails(obj); |
| | | }); |
| | | // table.on('rowDouble(LAY-app-CoreCmsbaifenProducts-tableBox)', function (obj) { |
| | | // //查看详情 |
| | | // doDetails(obj); |
| | | // }); |
| | | //头工具栏事件 |
| | | table.on('pagebar(LAY-app-CoreCmsbaifenProducts-tableBox)', function (obj) { |
| | | var checkStatus = table.checkStatus(obj.config.id); |