|
@@ -1,6 +1,7 @@
|
|
|
/**
|
|
|
* 搜索·主页
|
|
|
- * 2024/5/19
|
|
|
+ * 2024/7/31
|
|
|
+ * version: 1.0.1
|
|
|
*/
|
|
|
|
|
|
!(() => {
|
|
@@ -375,7 +376,7 @@
|
|
|
|
|
|
// 按钮
|
|
|
dom += '<div class="checkGallery-item-block checkGallery-button">';
|
|
|
- dom += '<div class="checkGallery-content"><button class="sui-button button-warning" onclick="App.CreateOrder(\'' + data.ItemId + '\')"><i class="fa fa-list-alt"></i>生成订单</button></div></div>';
|
|
|
+ dom += '<div class="checkGallery-content"><button class="sui-button button-warning" onclick="$.page.replenishCreateOrder(\'' + data.ItemId + '\')"><i class="fa fa-list-alt"></i>生成订单</button></div></div>';
|
|
|
|
|
|
// 备注
|
|
|
if (!String.IsNullOrWhiteSpace(data.Description)) {
|
|
@@ -449,20 +450,20 @@
|
|
|
if (String.IsNullOrWhiteSpace(inventoryId)) {
|
|
|
return;
|
|
|
}
|
|
|
- if (App.IsBusy) {
|
|
|
+ if (isAddToCart) {
|
|
|
return Sys.ShowBusy();
|
|
|
}
|
|
|
if (String.IsNullOrWhiteSpace(Sys.Config.CreateReplenishOrderUrl)) {
|
|
|
return Sys.Warning('CreateReplenishOrderUrl 未配置。');
|
|
|
}
|
|
|
Sys.Loading('正在处理');
|
|
|
- App.IsBusy = true;
|
|
|
+ isAddToCart = true;
|
|
|
SUI.Ajax({
|
|
|
url: Sys.Config.CreateReplenishOrderUrl,
|
|
|
type: 'post',
|
|
|
data: Object.ToDonetParameter({ InventoryId: inventoryId }),
|
|
|
success: function (result) {
|
|
|
- App.IsBusy = false;
|
|
|
+ isAddToCart = false;
|
|
|
// Sys.Loading('./Close');
|
|
|
// var dom = '<p style="font-size: 18px;"><i class="fa fa-check-circle" style="font-size: 24px; color: #b9e563; padding-right: 6px;"></i>生成补件订单成功!</p><p style="margin-top:20px; text-align: center"><a class="sui-button button-primary" href="';
|
|
|
// dom += Sys.Config.ReplenishOrderDetailsUrl + '?replenishOrderId=';
|
|
@@ -473,7 +474,7 @@
|
|
|
window.location.href = Sys.Config.ReplenishOrderDetailsUrl + '?replenishOrderId=' + result.ReplenishOrderId;
|
|
|
},
|
|
|
error: function (result) {
|
|
|
- App.IsBusy = false;
|
|
|
+ isAddToCart = false;
|
|
|
Sys.Loading('./Close');
|
|
|
Sys.Danger(result.Message);
|
|
|
}
|
|
@@ -489,6 +490,25 @@
|
|
|
return this.onCreateProdoctItems(data);
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 获取清仓区·产品组件标签dom
|
|
|
+ * @param {object} data 数据
|
|
|
+ */
|
|
|
+ this.getClearanLabelDom = function (data) {
|
|
|
+ var dom = '<div style="position: absolute;; top:0; right:0">';
|
|
|
+ if (data.IsHot) {
|
|
|
+ dom += '<div class="label label-certificate-warning">热销</div>';
|
|
|
+ }
|
|
|
+ if (data.IsNew) {
|
|
|
+ dom += '<div class="label label-certificate-danger">新品</div>';
|
|
|
+ }
|
|
|
+ if (data.IsRecommend) {
|
|
|
+ dom += '<div class="label label-certificate-roya">推荐</div>';
|
|
|
+ }
|
|
|
+ dom += '</div>';
|
|
|
+ return dom;
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 获取清仓区·产品内容dom
|
|
|
* @param {object} data 数据
|
|
@@ -501,13 +521,14 @@
|
|
|
data.ItemName = String.IsNullOrWhiteSpace(data.ItemName) ? '' : data.ItemName;
|
|
|
data.ItemNumber = String.IsNullOrWhiteSpace(data.ItemNumber) ? '' : data.ItemNumber;
|
|
|
data.ItemId = parseInt(data.ItemId);
|
|
|
- isNaN(data.ItemId) ? data.ItemId = 0 : true;
|
|
|
+ isNaN(data.ItemId) ? data.ItemId = -1 : true;
|
|
|
data.CombtItemId = parseInt(data.CombtItemId);
|
|
|
isNaN(data.CombtItemId) ? data.CombtItemId = 0 : true;
|
|
|
data.Href = String.IsNullOrWhiteSpace(data.Href) ? '' : data.Href;
|
|
|
data.Spec = String.IsNullOrWhiteSpace(data.Spec) ? '' : data.Spec;
|
|
|
data.Description = String.IsNullOrWhiteSpace(data.Description) ? '' : data.Description;
|
|
|
typeof data.IsCustomizable === 'boolean' ? true : data.SalesPrice = false;
|
|
|
+ data.InventoryAcc = Number.IsNullOrEmpty(data.InventoryAcc) ? '-' : data.InventoryAcc;
|
|
|
data.DeliveryCycle = parseInt(data.DeliveryCycle);
|
|
|
data.DeliveryCycle = isNaN(data.DeliveryCycle) ? '' : data.DeliveryCycle;
|
|
|
data.DeliveryCycleStr = String.IsNullOrWhiteSpace(data.DeliveryCycleStr) ? '' : data.DeliveryCycleStr;
|
|
@@ -516,9 +537,10 @@
|
|
|
dom += '<div class="checkGallery-item-block checkGallery-title">';
|
|
|
|
|
|
// 品名
|
|
|
- dom += '<div class="checkGallery-content">';
|
|
|
+ dom += '<div class="checkGallery-content checkGallery-content-title">';
|
|
|
if (this.Options.ATarget === '_child') {
|
|
|
- dom += '<a href="javascript:;">';
|
|
|
+ dom += '<a href="javascript:void(0)"';
|
|
|
+ dom += ' onclick="CheckGallery.CreateChild(\'' + data.Href + '\')">';
|
|
|
dom += data.ItemName + '</a>';
|
|
|
}
|
|
|
else {
|
|
@@ -532,12 +554,6 @@
|
|
|
dom += '<div class="checkGallery-content data-itemId" value="' + data.ItemId + '">';
|
|
|
dom += '料号:' + data.ItemNumber + '</div>';
|
|
|
|
|
|
- // 内容块结束
|
|
|
- dom += '</div>';
|
|
|
-
|
|
|
- // 价格
|
|
|
- dom += '<div class="checkGallery-item-block checkGallery-property">';
|
|
|
-
|
|
|
// 规格
|
|
|
dom += '<div class="checkGallery-content data-combtItemId" value="' + data.CombtItemId;
|
|
|
dom += '">规格:' + data.Spec + '</div>';
|
|
@@ -546,23 +562,52 @@
|
|
|
dom += '<div class="checkGallery-content">生产属性:';
|
|
|
dom += (data.ProductionPropertyText || '') + '</div>';
|
|
|
|
|
|
+ // 内容块结束
|
|
|
dom += '</div>';
|
|
|
|
|
|
- // 按钮
|
|
|
+ // 价格
|
|
|
+ dom += '<div class="checkGallery-item-block checkGallery-property">';
|
|
|
+ dom += '<div class="checkGallery-content">价格:¥ ';
|
|
|
+ dom += '<span class="data-price" value="' + data.SalesPrice + '">';
|
|
|
+ dom += String.AmountFormat(data.SalesPrice, 2) + '</div>';
|
|
|
+
|
|
|
+ // 折扣
|
|
|
+ var coef = parseInt(data.DiscountCoef);
|
|
|
+ if (!isNaN(coef)) {
|
|
|
+ dom += '<div class="checkGallery-content">折扣:';
|
|
|
+ dom += coef + '%</div>';
|
|
|
+ };
|
|
|
+
|
|
|
+ // 运费
|
|
|
+ dom += '<div class="checkGallery-content">运费:¥ ';
|
|
|
+ dom += '<span class="data-freight" value="' + data.Freight + '">';
|
|
|
+ dom += String.AmountFormat(data.Freight, 2) + '</span></div>';
|
|
|
+
|
|
|
+ // 小计
|
|
|
+ dom += '<div class="checkGallery-content">小计:¥ <span class="data-total">';
|
|
|
+ dom += String.AmountFormat(data.SalesPrice, 2) + '</span></div></div>';
|
|
|
+
|
|
|
+ // 数量
|
|
|
dom += '<div class="checkGallery-item-block checkGallery-button">';
|
|
|
- dom += '<div class="checkGallery-content"><button class="sui-button button-warning" onclick="App.CreateOrder(\'' + data.ItemId + '\')"><i class="fa fa-list-alt"></i>生成订单</button></div></div>';
|
|
|
+ dom += '<div class="checkGallery-content">发货周期:' + data.DeliveryCycleStr + '</div>';
|
|
|
+ dom += '<div class="checkGallery-content">数量:';
|
|
|
+ dom += '<button class="sui-button" onclick="CheckGallery.PlusQuantity(-1, this)">-</button>';
|
|
|
+ dom += '<input class="sui-input data-quantity" style="width:36px;text-align:center;" value="1" readonly>';
|
|
|
+ dom += '<button class="sui-button" onclick="CheckGallery.PlusQuantity(1, this)">+</button></div>';
|
|
|
+ dom += '<div class="checkGallery-content">库存:' + data.InventoryAcc + '</div>';
|
|
|
+ dom += '<div class="checkGallery-content"><button class="sui-button button-danger" onclick="CheckGallery.AddToCart(this)"><i class="fas fa-shopping-cart"></i>加入购物车</button></div></div>';
|
|
|
|
|
|
// 备注
|
|
|
if (!String.IsNullOrWhiteSpace(data.Description)) {
|
|
|
- dom += '<div class="checkGallery-item-block checkGallery-item-all">';
|
|
|
+ dom += '<div class="checkGallery-item-block data-isSpecial" value="true">';
|
|
|
dom += '<span class="checkGallery-content" style="display:inline-block; color: #8b0000;">备注:' + data.Description + '</span>';
|
|
|
dom += '</div>';
|
|
|
};
|
|
|
|
|
|
// 特殊规格
|
|
|
if (data.IsCustomizable) {
|
|
|
- dom += '<div class="checkGallery-item-block checkGallery-item-all data-isSpecial" value="' + (data.IsCustomizable ? 'true' : 'false') + '">';
|
|
|
- dom += '<div class="checkGallery-content"><span style="display:inline-block;">特殊规格:</span>';
|
|
|
+ dom += '<div class="checkGallery-item-block data-isSpecial" value="true" style="width:100%">';
|
|
|
+ dom += '<div class="checkGallery-content"><span style="display:inline-block; width:15%">特殊规格:</span>';
|
|
|
dom += '<input class="sui-input data-specialSpec" style="width:85%;">';
|
|
|
dom += '</div></div>';
|
|
|
};
|