1、零售出库添加会员卡号快捷方式

2、销售订单、销售出库添加客户快捷方式
3、仓库添加默认仓库
4、零售、销售、采购的商品明细仓库默认选中默认仓库
This commit is contained in:
double
2019-04-23 14:00:30 +08:00
parent a92bf8d39b
commit a95ecbda1b
12 changed files with 607 additions and 98 deletions

View File

@@ -182,7 +182,19 @@
{title: '搬运费', field: 'truckage', width: 60},
{title: '负责人', field: 'principalName', width: 60},
{title: '排序', field: 'sort', width: 60},
{
title: '是否默认', field: 'isdefault', width: 100, align: "center",
formatter: function (value, rec) {
if (rec.isdefault) {
return "<b style='color:green'>是</b>";
}
else {
return "否";
}
}
},
{title: '描述', field: 'remark', width: 120}
]],
toolbar: [
{
@@ -200,6 +212,14 @@
handler: function () {
batDeleteDepot();
}
},
{
id: 'setDepotIsDefault',
text: '设为默认',
iconCls: 'icon-ok',
handler: function () {
setDepotIsDefault();
}
}
],
onLoadError: function () {
@@ -286,7 +306,53 @@
}
});
}
//设为默认操作事件
function setDepotIsDefault() {
var allRow = $('#tableData').datagrid('getRows');
var row = $('#tableData').datagrid('getChecked');
if (row.length == 0) {
$.messager.alert('设置提示', '没有记录被选中!', 'info');
return;
}
if (row.length > 0) {
function setDefault(depotID, isDefault) {
$.ajax({
type: "post",
url: "/depot/updateDepotIsDefault",
dataType: "json",
async: false,
data: ({
depotID: depotID,
isDefault: isDefault
}),
success: function (res) {
if (res == "true" && isDefault) {
}
},
//此处添加错误处理
error: function () {
$.messager.alert('提示', '设为默认账户异常,请稍后再试!', 'error');
return;
}
});
}
if (row.length == 1) {
setDefault(row[0].id, true); //设置默认
for (var i = 0; i < allRow.length; i++) {
if (allRow[i].id != row[0].id) {
setDefault(allRow[i].id, false);
}
}
setTimeout(function () {
$("#searchBtn").click();
}, 1000);
}
return;
}
}
//批量删除仓库
function batDeleteDepot() {
var row = $('#tableData').datagrid('getChecked');
@@ -565,4 +631,4 @@
});
</script>
</body>
</html>
</html>