|
@@ -4,24 +4,25 @@ $(function () {
|
|
|
datatype: "json",
|
|
|
colModel: [
|
|
|
{label: 'id', name: 'id', index: 'id', key: true, hidden: true},
|
|
|
- {label: '门店id', name: 'storeId', index: 'store_id', width: 80},
|
|
|
- {label: '仓库编号', name: 'warehouseSn', index: 'warehouse_sn', width: 80},
|
|
|
- {label: 'sku', name: 'sku', index: 'sku', width: 80},
|
|
|
- {label: '类型', name: 'type', index: 'type', width: 80, formatter:function (value) {
|
|
|
+ {label: '门店id', name: 'storeId', index: 'store_id', width: 40, align: 'center'},
|
|
|
+ {label: 'sku', name: 'sku', index: 'sku', width: 60, align: 'center'},
|
|
|
+ {label: '类型', name: 'type', index: 'type', width: 40, align: 'center', formatter:function (value) {
|
|
|
if (value === '0') {
|
|
|
return '出库';
|
|
|
} else {
|
|
|
return '入库';
|
|
|
}
|
|
|
}},
|
|
|
- {label: '数量', name: 'number', index: 'number', width: 80},
|
|
|
- {label: '备注', name: 'remark', index: 'remark', width: 80},
|
|
|
- {label: '创建时间', name: 'createTime', index: 'create_time', width: 80, formatter:function (value) {
|
|
|
+ {label: '数量', name: 'number', index: 'number', width: 30, align: 'center'},
|
|
|
+ {label: '备注', name: 'remark', index: 'remark', width: 120, align: 'center'},
|
|
|
+ {label: '创建时间', name: 'createTime', index: 'create_time', width: 140, align: 'center', formatter:function (value) {
|
|
|
return new Date(value);
|
|
|
}},
|
|
|
- {label: '修改时间', name: 'modifyTime', index: 'modify_time', width: 80, formatter:function (value) {
|
|
|
+ {label: '修改时间', name: 'modifyTime', index: 'modify_time', width: 140, align: 'center', formatter:function (value) {
|
|
|
return new Date(value);
|
|
|
- }}],
|
|
|
+ }},
|
|
|
+ {label: '订单编号', name: 'orderSn', index: 'order_sn', width: 60, align: 'center'}
|
|
|
+ ],
|
|
|
viewrecords: true,
|
|
|
height: 550,
|
|
|
rowNum: 10,
|
|
@@ -44,7 +45,13 @@ $(function () {
|
|
|
},
|
|
|
gridComplete: function () {
|
|
|
$("#jqGrid").closest(".ui-jqgrid-bdiv").css({"overflow-x": "hidden"});
|
|
|
- }
|
|
|
+ },
|
|
|
+ changeThirdMerchantBiz: function (opt) {
|
|
|
+ var value = opt.value;
|
|
|
+ $.get("../store/getStoresByThirdMerch?thirdPartyMerchCode=" + value, function (r) {
|
|
|
+ vm.storeList = r.list;
|
|
|
+ });
|
|
|
+ }
|
|
|
});
|
|
|
});
|
|
|
|
|
@@ -62,7 +69,12 @@ let vm = new Vue({
|
|
|
q: {
|
|
|
name: ''
|
|
|
},
|
|
|
- uploadData:[]
|
|
|
+ merchList: {},//商户
|
|
|
+ thirdMerchantBizList: {},//第三方商户
|
|
|
+ storeList: {},//门店
|
|
|
+ uploadData:[],
|
|
|
+ stores: [],
|
|
|
+ macros: []
|
|
|
},
|
|
|
methods: {
|
|
|
query: function () {
|
|
@@ -72,6 +84,7 @@ let vm = new Vue({
|
|
|
vm.showList = false;
|
|
|
vm.title = "新增";
|
|
|
vm.stockChangeRecord = {};
|
|
|
+ vm.getMerchList();
|
|
|
},
|
|
|
update: function (event) {
|
|
|
let id = getSelectedRow();
|
|
@@ -80,16 +93,20 @@ let vm = new Vue({
|
|
|
}
|
|
|
vm.showList = false;
|
|
|
vm.title = "修改";
|
|
|
+ vm.getMerchList();
|
|
|
|
|
|
- vm.getInfo(id)
|
|
|
+ vm.getInfo(id);
|
|
|
},
|
|
|
saveOrUpdate: function (event) {
|
|
|
let url = vm.stockChangeRecord.id == null ? "../stockchangerecord/save" : "../stockchangerecord/update";
|
|
|
- $.ajax({
|
|
|
+ let s = JSON.stringify(vm.stockChangeRecord);
|
|
|
+ console.log("请求参数===> " + s);
|
|
|
+
|
|
|
+ $.ajax({
|
|
|
type: "POST",
|
|
|
url: url,
|
|
|
contentType: "application/json",
|
|
|
- data: JSON.stringify(vm.stockChangeRecord),
|
|
|
+ data: s,
|
|
|
success: function (r) {
|
|
|
if (r.code === 0) {
|
|
|
alert('操作成功', function (index) {
|
|
@@ -140,7 +157,11 @@ let vm = new Vue({
|
|
|
vm.showList = true;
|
|
|
let page = $("#jqGrid").jqGrid('getGridParam', 'page');
|
|
|
$("#jqGrid").jqGrid('setGridParam', {
|
|
|
- postData: {'name': vm.q.name},
|
|
|
+ postData: {
|
|
|
+ 'storeId': vm.q.storeId,
|
|
|
+ 'type': vm.q.type,
|
|
|
+ 'sku': vm.q.sku
|
|
|
+ },
|
|
|
page: page
|
|
|
}).trigger("reloadGrid");
|
|
|
vm.handleReset('formValidate');
|
|
@@ -182,6 +203,36 @@ let vm = new Vue({
|
|
|
});
|
|
|
return promise; //通过返回一个promis对象解决
|
|
|
|
|
|
- }
|
|
|
+ },
|
|
|
+ getMerchList: function() {
|
|
|
+ $.get("../merch/queryAll", function (r) {
|
|
|
+ vm.merchList = r.list;
|
|
|
+ });
|
|
|
+ },
|
|
|
+ changeMerch: function(opt) {
|
|
|
+ var value = opt.value;
|
|
|
+ vm.getThirdMerchantBizList(value);
|
|
|
+ },
|
|
|
+ getThirdMerchantBizList: function(merchSn) {
|
|
|
+ $.get("../thirdmerchantbiz/queryAll?merchSn=" + merchSn, function (r) {
|
|
|
+ vm.thirdMerchantBizList = r.list;
|
|
|
+ });
|
|
|
+ },
|
|
|
+ changeThirdMerchantBiz: function (opt) {
|
|
|
+ var value = opt.value;
|
|
|
+ $.get("../store/getStoresByThirdMerch?thirdPartyMerchCode=" + value, function (r) {
|
|
|
+ vm.storeList = r.list;
|
|
|
+ });
|
|
|
+ },
|
|
|
+ },
|
|
|
+ mounted() {
|
|
|
+ $.get("../store/queryAll", function (r) {
|
|
|
+ vm.stores = r.list;
|
|
|
+ });
|
|
|
+
|
|
|
+ $.get("../sys/macro/queryMacrosByValue?value=stockChangeType", function (r) {
|
|
|
+ vm.macros = r.list;
|
|
|
+ });
|
|
|
+
|
|
|
}
|
|
|
});
|