提交 16bc7bdd 编写于 作者: Skyeye云's avatar Skyeye云

ERP商品修改

上级 66d511b3
......@@ -66,8 +66,9 @@ layui.config({
// 加载考勤班次
/*showGrid({
id: "timeId",
url: flowableBasePath + "checkworktime006",
url: sysMainMation.checkworkBasePath + "queryEnableCheckWorkTimeList",
params: {},
method: 'GET',
pagination: false,
template: selTemplate,
ajaxSendLoadBefore: function(hdb, json){
......
......@@ -129,6 +129,7 @@ layui.config({
data: tableDataList,
even: true,
page: false,
limit: 100,
rowDrag: {
trigger: '.drag-row',
done: function(obj) {}
......
......@@ -49,6 +49,7 @@ layui.config({
data: tableDataList,
even: true,
page: false,
limit: 100,
rowDrag: {
trigger: '.drag-row',
done: function(obj) {}
......
......@@ -11,10 +11,9 @@ layui.config({
var $ = layui.$;
var selOption = getFileContent('tpl/template/select-option.tpl');
//获取列表中已有的仓库库存
// 获取列表中已有的仓库库存
var normsStock = [].concat(parent.normsStock);
// 初始化仓库
erpOrderUtil.getDepotList(function (json){
$("#storeHouseId").html(getDataUseHandlebars(selOption, json));
form.render();
......@@ -37,7 +36,9 @@ layui.config({
} else {
normsStock.push({
depotId: $("#storeHouseId").val(),
depotName: $("#storeHouseId").find("option:selected").text(),
depotMation: {
name: $("#storeHouseId").find("option:selected").text()
},
stock: $("#stock").val()
});
// 赋值给列表
......
......@@ -11,29 +11,27 @@ layui.config({
var $ = layui.$;
//获取列表中已有的仓库库存
var normsStock = [].concat(parent.normsStock);
var normsStockList = [].concat(parent.normsStock);
//要编辑的仓库id
var depotId = parent.chooseDepotId;
$.each(normsStock, function(i, item) {
if(item.depotId === depotId){
$("#stock").val(item.stock);
$("#depotName").html(item.depotName);
return false;
}
});
var normsStock = getInPoingArr(normsStockList, "depotId", depotId, null);
if (!isNull(normsStock)) {
$("#stock").val(normsStock.stock);
$("#name").html(normsStock.depotMation.name);
}
matchingLanguage();
form.render();
form.on('submit(formEditBean)', function (data) {
if (winui.verifyForm(data.elem)) {
$.each(normsStock, function(i, item) {
$.each(normsStockList, function(i, item) {
if(item.depotId === depotId){
item.stock = $("#stock").val();
return false;
}
});
//赋值给列表
parent.normsStock = [].concat(normsStock);
parent.normsStock = [].concat(normsStockList);
parent.layer.close(index);
parent.refreshCode = '0';
}
......
......@@ -23,8 +23,10 @@ layui.config({
elem: '#messageTable',
data: $.extend(true, [], normsStock),
cols: [[
{ field: 'depotName', title: '仓库', align: 'left', width: 200},
{ field: 'stock', title: '初始数量', align: 'left', width: 80},
{ field: 'name', title: '仓库', align: 'left', width: 200, templet: function (d) {
return d.depotMation.name;
}},
{ field: 'stock', title: '初始数量', align: 'left', width: 80 },
{ title: systemLanguage["com.skyeye.operation"][languageType], fixed: 'right', align: 'center', width: 140, toolbar: '#tableBar'}
]],
done: function(json) {
......
......@@ -11,7 +11,7 @@
<form class="layui-form" action="" id="showForm" autocomplete="off">
<div class="layui-form-item layui-col-xs12">
<label class="layui-form-label">所属仓库<i class="red">*</i></label>
<div class="layui-input-block ver-center" id="depotName">
<div class="layui-input-block ver-center" id="name">
</div>
</div>
<div class="layui-form-item layui-col-xs12">
......
......@@ -121,8 +121,9 @@ layui.config({
showGrid({
id: "checkTimeBox",
url: flowableBasePath + "checkworktime006",
url: sysMainMation.checkworkBasePath + "queryEnableCheckWorkTimeList",
params: {},
method: 'GET',
pagination: false,
template: $("#checkTimeStrTemplate").html(),
ajaxSendLoadBefore: function(hdb) {
......
......@@ -141,8 +141,9 @@ layui.config({
// 考勤时间段
showGrid({
id: "checkTimeBox",
url: flowableBasePath + "checkworktime006",
url: sysMainMation.checkworkBasePath + "queryEnableCheckWorkTimeList",
params: {},
method: 'GET',
pagination: false,
template: $("#checkTimeStrTemplate").html(),
ajaxSendLoadBefore: function(hdb) {
......
......@@ -106,6 +106,8 @@ var serviceMap = [
{"id": "sysMainMation.crmBasePath", "name": "CRM服务"},
{"id": "sysMainMation.ifsBasePath", "name": "IFS财务服务"},
{"id": "sysMainMation.erpBasePath", "name": "ERP+生产服务"},
{"id": "sysMainMation.checkworkBasePath", "name": "考勤服务"},
{"id": "sysMainMation.bossBasePath", "name": "招聘服务"},
]
function getRequestHeaders() {
......
......@@ -101,7 +101,7 @@ var erpOrderUtil = {
*/
deleteOrderMation: function (id, serviceClassName, callback) {
layer.confirm(systemLanguage["com.skyeye.deleteOperationMsg"][languageType], {icon: 3, title: systemLanguage["com.skyeye.deleteOperation"][languageType]}, function(index) {
AjaxPostUtil.request({url: flowableBasePath + "erpcommon005", params: {rowId: id, serviceClassName: serviceClassName}, method: "DELETE", type: 'json', callback: function(json) {
AjaxPostUtil.request({url: sysMainMation.erpBasePath + "erpcommon005", params: {rowId: id, serviceClassName: serviceClassName}, method: "DELETE", type: 'json', callback: function(json) {
winui.window.msg(systemLanguage["com.skyeye.deleteOperationSuccessMsg"][languageType], {icon: 1, time: 2000});
if (typeof (callback) == "function") {
callback();
......@@ -137,7 +137,7 @@ var erpOrderUtil = {
serviceClassName: serviceClassName,
approvalId: approvalId
};
AjaxPostUtil.request({url: flowableBasePath + "erpcommon006", params: params, method: "PUT", type: 'json', callback: function(json) {
AjaxPostUtil.request({url: sysMainMation.erpBasePath + "erpcommon006", params: params, method: "PUT", type: 'json', callback: function(json) {
winui.window.msg("提交成功。", {icon: 1, time: 2000});
if (typeof (callback) == "function") {
callback();
......@@ -157,7 +157,7 @@ var erpOrderUtil = {
processInstanceId: processInstanceId,
serviceClassName: serviceClassName
};
AjaxPostUtil.request({url: flowableBasePath + "erpcommon003", params: params, type: 'json', method: "PUT", callback: function(json) {
AjaxPostUtil.request({url: sysMainMation.erpBasePath + "erpcommon003", params: params, type: 'json', method: "PUT", callback: function(json) {
winui.window.msg("撤销成功。", {icon: 1, time: 2000});
if (typeof(callback) == "function") {
callback();
......@@ -196,7 +196,7 @@ var erpOrderUtil = {
* @param callback 回执函数
*/
getDepotList: function (callback) {
AjaxPostUtil.request({url: flowableBasePath + "storehouse008", params: {}, type: 'json', method: "GET", callback: function(json) {
AjaxPostUtil.request({url: sysMainMation.erpBasePath + "queryAllStoreHouseList", params: {}, type: 'json', method: "GET", callback: function(json) {
if (typeof(callback) == "function") {
callback(json);
}
......
......@@ -396,7 +396,9 @@ layui.define(['jquery', 'form', 'upload', 'layer', 'sortable'], function (export
callBack: function (refreshCode) {
var str = "";
$.each(normsStock, function(i, item) {
str += '<br><span class="layui-badge layui-bg-blue" style="height: 25px !important; line-height: 25px !important; margin: 5px 0px;">' + item.depotName + '' + item.stock + '】</span>';
if (!isNull(item.depotMation)) {
str += '<br><span class="layui-badge layui-bg-blue" style="height: 25px !important; line-height: 25px !important; margin: 5px 0px;">' + item.depotMation.name + '' + item.stock + '】</span>';
}
});
_this.attr("stock", JSON.stringify(normsStock));
_this.parent().html(_this.prop("outerHTML") + str);
......@@ -534,7 +536,7 @@ layui.define(['jquery', 'form', 'upload', 'layer', 'sortable'], function (export
</div>`;
$(`#${this.options.otherMationElemId}`).html(str);
var that = this;
AjaxPostUtil.request({url: flowableBasePath + "materialunit006", params: {}, type: 'json', method: "GET", callback: function(json) {
AjaxPostUtil.request({url: sysMainMation.erpBasePath + "materialunit006", params: {}, type: 'json', method: "GET", callback: function(json) {
$(`#unitGroupId`).html(getDataUseHandlebars(that.selTemplate, json));
that.unitGroupList = json.rows;
}, async: false});
......@@ -564,6 +566,7 @@ layui.define(['jquery', 'form', 'upload', 'layer', 'sortable'], function (export
var tableId = this.options.specTableElemId + '-id';
var that = this,
table = `<table class="layui-table" id="${tableId}"><thead><tr><th>规格名</th><th>规格值</th></tr></thead><colgroup><col width="140"></colgroup><tbody>`;
console.log(this.data.specData)
$.each(this.data.specData, function (index, item) {
table += `<tr data-num="${item.rowNum}" data-id="${item.rowNum}">`;
table += `<td data-num="${item.rowNum}">${item.title} <i class="layui-icon layui-icon-delete layui-anim layui-anim-scale ${that.data.specDataDelete ? '' : 'layui-hide'}" data-spec-num="${item.rowNum}"></i></td>`;
......@@ -750,7 +753,7 @@ layui.define(['jquery', 'form', 'upload', 'layer', 'sortable'], function (export
elem: '.fairy-sku-img',
url: reqBasePath + 'common003',
data: {type: 29},
exts: 'png|jpg|ico|jpeg|gif',
exts: imageType.join('|'),
accept: 'images',
acceptMime: 'image/*',
multiple: false,
......@@ -796,10 +799,12 @@ layui.define(['jquery', 'form', 'upload', 'layer', 'sortable'], function (export
tr += '</select></td>';
break;
case "btn":
value = isNull(value) ? [] : JSON.parse(value);
value = isNull(value) ? [] : ($.isArray(value) ? value : JSON.parse(value));
tr += "<td><button type='button' class='layui-btn layui-btn-primary layui-btn-xs stockMore' stock='" + JSON.stringify(value) + "' id='" + id + "'>库存信息</button>";
$.each(value, function(i, item) {
tr += '<br><span class="layui-badge layui-bg-blue" style="height: 25px !important; line-height: 25px !important; margin: 5px 0px;">' + item.depotName + '' + item.stock + '】</span>';
if (!isNull(item.depotMation)) {
tr += '<br><span class="layui-badge layui-bg-blue" style="height: 25px !important; line-height: 25px !important; margin: 5px 0px;">' + item.depotMation.name + '' + item.stock + '】</span>';
}
});
tr += '</td>';
break;
......@@ -854,7 +859,9 @@ layui.define(['jquery', 'form', 'upload', 'layer', 'sortable'], function (export
value = isNull(value) ? [] : JSON.parse(value);
div += "<button type='button' class='layui-btn layui-btn-primary layui-btn-xs stockMore' stock='" + JSON.stringify(value) + "' id='" + id + "'>库存信息</button>";
$.each(value, function(i, item) {
div += '<br><span class="layui-badge layui-bg-blue" style="height: 25px !important; line-height: 25px !important; margin: 5px 0px;">' + item.depotName + '' + item.stock + '】</span>';
if (!isNull(item.depotMation)) {
div += '<br><span class="layui-badge layui-bg-blue" style="height: 25px !important; line-height: 25px !important; margin: 5px 0px;">' + item.depotMation.name + '' + item.stock + '】</span>';
}
});
break;
case "input":
......@@ -876,7 +883,7 @@ layui.define(['jquery', 'form', 'upload', 'layer', 'sortable'], function (export
var prependThead = [], prependTbody = [];
// 加载计量单位作为其中的一个规格
AjaxPostUtil.request({url: flowableBasePath + "materialunit006", params: {}, type: 'json', method: "GET", callback: function(json) {
AjaxPostUtil.request({url: sysMainMation.erpBasePath + "materialunit006", params: {}, type: 'json', method: "GET", callback: function(json) {
var prependTbodyItem = [];
$.each(json.rows, function (i, item) {
if (item.id == that.data.otherMationData.unitGroupId) {
......@@ -999,7 +1006,9 @@ layui.define(['jquery', 'form', 'upload', 'layer', 'sortable'], function (export
case "btn":
value = isNull(value) ? [] : JSON.parse(value);
$.each(value, function(i, item) {
tr += '<span class="layui-badge layui-bg-blue" style="height: 25px !important; line-height: 25px !important; margin: 5px 0px;">' + item.depotName + '' + item.stock + '】</span><br>';
if (!isNull(item.depotMation)) {
tr += '<span class="layui-badge layui-bg-blue" style="height: 25px !important; line-height: 25px !important; margin: 5px 0px;">' + item.depotMation.name + '' + item.stock + '】</span><br>';
}
});
break;
case "input":
......@@ -1044,7 +1053,9 @@ layui.define(['jquery', 'form', 'upload', 'layer', 'sortable'], function (export
case "btn":
value = isNull(value) ? [] : JSON.parse(value);
$.each(value, function(i, item) {
div += '<span class="layui-badge layui-bg-blue" style="height: 25px !important; line-height: 25px !important; margin: 5px 0px;">' + item.depotName + '' + item.stock + '】</span><br>';
if (!isNull(item.depotMation)) {
div += '<span class="layui-badge layui-bg-blue" style="height: 25px !important; line-height: 25px !important; margin: 5px 0px;">' + item.depotMation.name + '' + item.stock + '】</span><br>';
}
});
break;
case "input":
......
......@@ -23,6 +23,10 @@
"materialFromType": {"name": "商品来源类型枚举类", "className": "skyeye-erp#com.skyeye.material.classenum.MaterialFromType"},
"materialType": {"name": "商品类型枚举类", "className": "skyeye-erp#com.skyeye.material.classenum.MaterialType"},
"materialUnit": {"name": "规格类型枚举类", "className": "skyeye-erp#com.skyeye.material.classenum.MaterialUnit"},
"materialNormsStockType": {"name": "商品规格库存类型枚举类", "className": "skyeye-erp#com.skyeye.material.classenum.MaterialNormsStockType"},
"materialInOrderType": {"name": "商品在单据中的类型", "className": "skyeye-erp#com.skyeye.material.classenum.MaterialInOrderType"},
"depotPutOutType": {"name": "出入库类型枚举类", "className": "skyeye-erp#com.skyeye.depot.classenum.DepotPutOutType"},
"skyeyeView": {"name": "视图枚举", "className": "skyeye-pro#com.skyeye.common.SkyeyeViewEnum"},
"widthScale": {"name": "宽度比例枚举", "className": "skyeye-pro#com.skyeye.attr.classenum.WidthScale"},
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册