|
|
@@ -35,45 +35,17 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
<th:block th:include="include :: footer" />
|
|
|
- <!-- 驳回请求区域 -->
|
|
|
- <script id="addInventoryDiv" type="text/template">
|
|
|
- <div class="col-xs-offset-1">
|
|
|
- <form id="formAddInventory">
|
|
|
- <div class="select-list col-sm-12" style="margin-top: 10px; display: inline-block;">
|
|
|
- <div style="float: left; width: 100px; line-height: 30px">
|
|
|
- <label>库存数量:</label>
|
|
|
- </div>
|
|
|
- <div style="float: left; width: 200px;">
|
|
|
- <input type="text" class="form-control" id="quantity" readonly/>
|
|
|
- </div>
|
|
|
- <div style="float: left; width: 100px; line-height: 30px; margin-left: 20px;">
|
|
|
- <label>可售数量:</label>
|
|
|
- </div>
|
|
|
- <div style="float: left; width: 200px">
|
|
|
- <input type="text" class="form-control" id="availQty" readonly/>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- <div class="col-sm-12 select-list" style="margin-top: 10px; display: inline-block;">
|
|
|
- <div style="float: left; width: 100px; line-height: 30px">
|
|
|
- <label>增加库存数量:</label>
|
|
|
- </div>
|
|
|
- <div style="float: left; width: 200px">
|
|
|
- <input type="text" class="form-control" id="addInvQty" name="quantity"/>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </form>
|
|
|
- </div>
|
|
|
- </script>
|
|
|
<script th:inline="javascript">
|
|
|
- var editFlag = [[${@permission.hasPermi('business:prodInventory:edit')}]];
|
|
|
+ var detailFlag = [[${@permission.hasPermi('business:prodInventory:detail')}]];
|
|
|
var prefix = ctx + "business/prodInventory";
|
|
|
|
|
|
$(function() {
|
|
|
var options = {
|
|
|
- url: prefix + "/list",
|
|
|
- createUrl: prefix + "/add",
|
|
|
- removeUrl: prefix + "/remove",
|
|
|
+ url: prefix + "/inventory/list",
|
|
|
+ detailUrl: prefix + "/inventory/detail/{id}",
|
|
|
modalName: "商品库存",
|
|
|
+ pageSize: 25,
|
|
|
+ pageList: [10, 25, 50],
|
|
|
columns: [
|
|
|
{
|
|
|
field: 'prodName',
|
|
|
@@ -96,61 +68,13 @@
|
|
|
align: 'center',
|
|
|
formatter: function(value, row, index) {
|
|
|
var actions = [];
|
|
|
- actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="addInventory(' + row.prodInventoryId + ',' + row.prodId + ',' + row.prodAttrId + ',' + row.quantity + ',' + row.availQty + ')"><i class="fa fa-edit"></i>配置库存</a>');
|
|
|
+ actions.push('<a class="btn btn-success btn-xs ' + detailFlag + '" href="javascript:void(0)" onclick="$.operate.detail(' + row.prodInventoryId + ')"><i class="fa fa-edit"></i>库存流水</a>');
|
|
|
return actions.join('');
|
|
|
}
|
|
|
}]
|
|
|
};
|
|
|
$.table.init(options);
|
|
|
});
|
|
|
-
|
|
|
- function addInventory(prodInventoryId, prodId, prodAttrId, quantity, availQty) {
|
|
|
- var content = $('#addInventoryDiv').html();
|
|
|
- layer.open({
|
|
|
- type: 1,
|
|
|
- fix: false,
|
|
|
- maxmin: false,
|
|
|
- shade: 0.3,
|
|
|
- area: ['800px', '480px'],
|
|
|
- title: '添加标签',
|
|
|
- // 弹层外区域关闭
|
|
|
- shadeClose: true,
|
|
|
- success: function(layero, index) {
|
|
|
- layero.find('#quantity').val(quantity);
|
|
|
- layero.find('#availQty').val(availQty);
|
|
|
- },
|
|
|
- content: content,
|
|
|
- btn: ['<i class="fa fa-check"></i> 确定', '<i class="fa fa-remove"></i> 关闭'],
|
|
|
- btn1: function() {
|
|
|
- var addInvQty = $("#addInvQty").val();
|
|
|
- var url = prefix + "/add";
|
|
|
- var data = {
|
|
|
- "prodInventoryId": prodInventoryId,
|
|
|
- "mercId": $("#mercId").val(),
|
|
|
- "prodId": prodId,
|
|
|
- "prodAttrId": prodAttrId,
|
|
|
- "addInvQty": addInvQty,
|
|
|
- };
|
|
|
- $.post(url, data, function(result) {
|
|
|
- if (result.code === web_status.SUCCESS) {
|
|
|
- $.modal.closeAll();
|
|
|
- $.modal.enable();
|
|
|
- $.modal.alertSuccess("添加成功。");
|
|
|
- refreshTab();
|
|
|
- } else if (result.code === web_status.WARNING) {
|
|
|
- $.modal.closeAll();
|
|
|
- $.modal.enable();
|
|
|
- $.modal.alertWarning(result.msg)
|
|
|
- } else {
|
|
|
- $.modal.closeAll();
|
|
|
- $.modal.enable();
|
|
|
- $.modal.alertError(result.msg);
|
|
|
- }
|
|
|
- });
|
|
|
- layer.closeAll();
|
|
|
- }
|
|
|
- });
|
|
|
- }
|
|
|
</script>
|
|
|
</body>
|
|
|
</html>
|