提交 3411c62a 编写于 作者: doc_wei's avatar doc_wei

领料单托管到表单布局

上级 7f211c4f
var rowId = "";
layui.config({
base: basePath,
version: skyeyeVersion
}).extend({
window: 'js/winui.window'
}).define(['window', 'table', 'jquery', 'winui', 'form', 'soulTable'], function (exports) {
}).define(['window', 'table', 'jquery', 'winui', 'form'], function (exports) {
winui.renderColor();
var $ = layui.$,
form = layui.form,
table = layui.table,
soulTable = layui.soulTable;
table = layui.table;
table.render({
id: 'messageTable',
elem: '#messageTable',
method: 'post',
url: flowableBasePath + 'erpdepartstock001',
url: sysMainMation.erpBasePath + 'erpdepartstock001',
where: getTableParams(),
even: true,
page: true,
limits: getLimits(),
limit: getLimit(),
overflow: {
type: 'tips',
hoverTime: 300, // 悬停时间,单位ms, 悬停 hoverTime 后才会显示,默认为 0
minWidth: 150, // 最小宽度
maxWidth: 500 // 最大宽度
},
cols: [[
{ title: systemLanguage["com.skyeye.serialNumber"][languageType], type: 'numbers' },
{ field: 'materialName', title: '商品名称', align: 'left', width: 150, templet: function (d) {
return '<a lay-event="details" class="notice-title-click">' + d.materialName + '</a>';
}},
{ field: 'materialModel', title: '型号', align: 'left', width: 150 },
{ field: 'categoryName', title: '所属类型', align: 'center', width: 100 },
{ field: 'typeName', title: '商品来源', align: 'left', width: 100 },
{ field: 'norms', title: '库存', align: 'center', width: 100, templet: function (d) {
var str = "";
$.each(d.norms, function(i, item) {
str += '<span class="layui-badge layui-bg-blue">' + item.departmentTock + '</span>' + item.name + '<br>';
});
return str;
}},
{ field: 'enabled', title: '状态', align: 'center', width: 60, templet: function (d) {
if (d.enabled == '0') {
return "<span class='state-down'>禁用</span>";
} else if (d.enabled == '1') {
return "<span class='state-up'>启用</span>";
}
}},
{ field: 'createTime', title: systemLanguage["com.skyeye.createTime"][languageType], align: 'center', width: 150 }
{ field: 'materialMation', title: '产品', align: 'left', width: 120, templet: function (d) {return isNull(d.materialMation) ? '' : d.materialMation.name}},
{ field: 'normsMation', title: '规格', align: 'left', width: 200, templet: function (d) {return isNull(d.normsMation) ? '' : d.normsMation.name}},
{ field: 'departmentMation', title: '处理部门', align: 'left', width: 200, templet: function (d) {return isNull(d.departmentMation) ? '' : d.departmentMation.name}},
{ field: 'stock', title: '部门库存', align: 'center', width: 80 }
]],
done: function(json) {
matchingLanguage();
soulTable.render(this);
initTableSearchUtil.initAdvancedSearch(this, json.searchFilter, form, "请输入商品名称,型号", function () {
initTableSearchUtil.initAdvancedSearch(this, json.searchFilter, form, "暂不支持搜索", function () {
table.reloadData("messageTable", {page: {curr: 1}, where: getTableParams()});
});
}
});
table.on('tool(messageTable)', function (obj) {
var data = obj.data;
var layEvent = obj.event;
if (layEvent === 'details') { // 详情
details(data);
}
});
// 详情
function details(data) {
rowId = data.id;
_openNewWindows({
url: "../../tpl/material/materialDetails.html",
title: systemLanguage["com.skyeye.detailsPageTitle"][languageType],
pageId: "materialDetails",
area: ['90vw', '90vh'],
callBack: function (refreshCode) {
}});
}
form.render();
$("body").on("click", "#reloadTable", function() {
loadTable();
......
......@@ -41,7 +41,7 @@ layui.config({
{ title: systemLanguage["com.skyeye.operation"][languageType], rowspan: '2', fixed: 'right', align: 'center', width: 200, toolbar: '#tableBar'}
], [
{ field: 'materialMation', title: '名称', align: 'left', width: 120, templet: function (d) {return isNull(d.materialMation) ? '' : d.materialMation.name}},
{ field: 'normsMation', title: '规格', align: 'left', width: 80, templet: function (d) {return isNull(d.normsMation) ? '' : d.normsMation.name}},
{ field: 'normsMation', title: '规格', align: 'left', width: 200, templet: function (d) {return isNull(d.normsMation) ? '' : d.normsMation.name}},
{ field: 'needNum', title: '加工数量', align: 'center', width: 80 },
{ field: 'departmentMation', title: '加工部门', align: 'left', width: 100, templet: function (d) {return isNull(d.departmentMation) ? '' : d.departmentMation.name}},
{ field: 'startTime', title: '开始时间', align: 'center', width: 150 },
......
......@@ -43,7 +43,7 @@ layui.config({
{ title: systemLanguage["com.skyeye.operation"][languageType], rowspan: '2', fixed: 'right', align: 'center', width: 200, toolbar: '#tableBar'}
], [
{ field: 'materialMation', title: '名称', align: 'left', width: 120, templet: function (d) {return isNull(d.materialMation) ? '' : d.materialMation.name}},
{ field: 'normsMation', title: '规格', align: 'left', width: 80, templet: function (d) {return isNull(d.normsMation) ? '' : d.normsMation.name}},
{ field: 'normsMation', title: '规格', align: 'left', width: 200, templet: function (d) {return isNull(d.normsMation) ? '' : d.normsMation.name}},
{ field: 'needNum', title: '加工数量', align: 'center', width: 80 },
{ field: 'departmentMation', title: '加工部门', align: 'left', width: 100, templet: function (d) {return isNull(d.departmentMation) ? '' : d.departmentMation.name}},
{ field: 'startTime', title: '开始时间', align: 'center', width: 150 },
......
......@@ -43,7 +43,7 @@ layui.config({
], [
{ field: 'materialMation', title: '名称', align: 'left', width: 120, templet: function (d) {return isNull(d.materialMation) ? '' : d.materialMation.name}},
{ field: 'normsMation', title: '规格', align: 'left', width: 80, templet: function (d) {return isNull(d.normsMation) ? '' : d.normsMation.name}},
{ field: 'normsMation', title: '规格', align: 'left', width: 200, templet: function (d) {return isNull(d.normsMation) ? '' : d.normsMation.name}},
{ field: 'needNum', title: '加工数量', align: 'center', width: 80 },
{ field: 'departmentMation', title: '加工部门', align: 'left', width: 100, templet: function (d) {return isNull(d.departmentMation) ? '' : d.departmentMation.name}},
{ field: 'startTime', title: '开始时间', align: 'center', width: 150 },
......
var rowId = "";
layui.config({
base: basePath,
version: skyeyeVersion
}).extend({
window: 'js/winui.window'
}).define(['window', 'table', 'jquery', 'winui', 'textool'], function (exports) {
winui.renderColor();
layui.use(['form'], function (form) {
var index = parent.layer.getFrameIndex(window.name);
var $ = layui.$,
textool = layui.textool;
textool.init({eleId: 'opinion', maxlength: 200});
rowId = parent.rowId;
var type = parent.type;
var url = erpOrderUtil.getErpDetailUrl({subType: type});
$("#showBean").attr("src", url);
//为了iframe高度自适应
var loadNum = 0;
var interval = setInterval(iFrameHeight, 300);
function iFrameHeight() {
var ifm = document.getElementById("showBean");
var subWeb = document.frames ? document.frames["showBean"].document : ifm.contentDocument;
if(ifm != null && subWeb != null) {
ifm.height = subWeb.body.scrollHeight;
loadNum++;
if(loadNum > 10){
clearInterval(interval);//停止
}
}
}
matchingLanguage();
form.render();
form.on('submit(formAddBean)', function (data) {
if (winui.verifyForm(data.elem)) {
var msg = '确认提交吗?';
layer.confirm(msg, { icon: 3, title: '提交审批' }, function (i) {
layer.close(i);
var jStr = {
content: $("#opinion").val(),
status: $("input[name='flag']:checked").val(),
rowId: parent.rowId
};
AjaxPostUtil.request({url: flowableBasePath + "erppick016", params: jStr, type: 'json', callback: function (json) {
parent.layer.close(index);
parent.refreshCode = '0';
}});
});
}
return false;
});
// 取消
$("body").on("click", "#cancle", function() {
parent.layer.close(index);
});
});
});
\ No newline at end of file
//加工单信息
var machinMation = {};
//根据那一列的值进行变化,默认根据数量
var showTdByEdit = 'rkNum';
//表格的序号
var rowNum = 1;
// 领料单
layui.config({
base: basePath,
version: skyeyeVersion
}).extend({
window: 'js/winui.window'
}).define(['window', 'jquery', 'winui', 'laydate', 'textool'], function (exports) {
winui.renderColor();
layui.use(['form'], function (form) {
var index = parent.layer.getFrameIndex(window.name);
var $ = layui.$,
form = layui.form,
laydate = layui.laydate,
textool = layui.textool;
var usetableTemplate = $("#usetableTemplate").html();
var selOption = getFileContent('tpl/template/select-option.tpl');
//已经选择的商品集合key:表格的行trId,value:商品信息
var allChooseProduct = {};
erpOrderUtil.getDepotList(function (json){
// 加载仓库数据
$("#depotId").html(getDataUseHandlebars(selOption, json));
form.render();
});
textool.init({eleId: 'remark', maxlength: 200});
// 单据时间
laydate.render({elem: '#operTime', type: 'datetime', value: getFormatDate(), trigger: 'click'});
//商品规格加载变化事件
form.on('select(selectUnitProperty)', function(data) {
var thisRowValue = data.value;
var thisRowNum = data.elem.id.replace("unitId", "");//获取当前行
//当前当前行选中的商品信息
if (!isNull(thisRowValue) && thisRowValue != '请选择') {
var product = allChooseProduct["tr" + thisRowNum.toString()];
$.each(product.unitList, function(j, bean) {
if(thisRowValue == bean.id){//获取规格
//获取当前行数量
var rkNum = parseInt($("#rkNum" + thisRowNum).val());
$("#unitPrice" + thisRowNum).val(bean.estimatePurchasePrice.toFixed(2));//单价
$("#amountOfMoney" + thisRowNum).val((rkNum * parseFloat(bean.estimatePurchasePrice)).toFixed(2));//金额
return false;
}
});
} else {
$("#unitPrice" + thisRowNum).val("0.00");//重置单价为空
$("#amountOfMoney" + thisRowNum).val("0.00");//重置金额为空
}
//加载库存
loadTockByDepotAndMUnit(thisRowNum, $("#depotId").val());
//计算价格
calculatedTotalPrice();
});
matchingLanguage();
form.render();
form.on('submit(formAddBean)', function (data) {
if (winui.verifyForm(data.elem)) {
//物料清单
var rowTr = $("#useTable tr");
if(rowTr.length == 0) {
winui.window.msg('请选择物料清单.', {icon: 2, time: 2000});
return false;
}
var tableData = new Array();
var noError = false; //循环遍历表格数据时,是否有其他错误信息
$.each(rowTr, function(i, item) {
//获取行编号
var rowNum = $(item).attr("trcusid").replace("tr", "");
//表格数量对象
var rkNum = $("#rkNum" + rowNum);
if(parseInt(rkNum.val()) == 0) {
rkNum.addClass("layui-form-danger");
rkNum.focus();
winui.window.msg('数量不能为0', {icon: 2, time: 2000});
noError = true;
return false;
}
//商品对象
var material = allChooseProduct["tr" + rowNum.toString()];
if(inTableDataArrayByAssetarId(material.materialId, $("#unitId" + rowNum).val(), tableData)) {
winui.window.msg('一张单中不允许出现相同单位的商品信息.', {icon: 2, time: 2000});
noError = true;
return false;
}
var row = {
materialId: material.materialId,
mUnitId: $("#unitId" + rowNum).val(),
rkNum: rkNum.val(),
unitPrice: $("#unitPrice" + rowNum).val()
};
tableData.push(row);
});
if(noError) {
return false;
}
var params = {
machinId: isNull(machinMation.id) ? '' : machinMation.id,
productionId: isNull(machinMation.productionId) ? '' : machinMation.productionId,
operTime: $("#operTime").val(),
remark: $("#remark").val(),
materialStr: JSON.stringify(tableData),
depotId: $("#depotId").val()
};
AjaxPostUtil.request({url: flowableBasePath + "erppick004", params: params, type: 'json', callback: function (json) {
parent.layer.close(index);
parent.refreshCode = '0';
}});
}
return false;
});
//新增行
$("body").on("click", "#addRow", function() {
addRow();
});
//删除行
$("body").on("click", "#deleteRow", function() {
deleteRow();
//计算价格
calculatedTotalPrice();
});
//新增行
function addRow() {
var par = {
id: "row" + rowNum.toString(), //checkbox的id
trId: "tr" + rowNum.toString(), //行的id
materialId: "materialId" + rowNum.toString(), //商品id
unitId: "unitId" + rowNum.toString(), //规格id
currentTock: "currentTock" + rowNum.toString(), //库存id
productionNum: "productionNum" + rowNum.toString(), //所需总数量id
machinNum: "machinNum" + rowNum.toString(), //待分配数量id
rkNum: "rkNum" + rowNum.toString(), //数量id
unitPrice: "unitPrice" + rowNum.toString(), //单价id
amountOfMoney: "amountOfMoney" + rowNum.toString() //金额id
};
$("#useTable").append(getDataUseHandlebars(usetableTemplate, par));
form.render();
rowNum++;
//设置根据某列变化的颜色
$("." + showTdByEdit).parent().css({'background-color': '#e6e6e6'});
}
//删除行
function deleteRow() {
var checkRow = $("#useTable input[type='checkbox'][name='tableCheckRow']:checked");
if(checkRow.length > 0) {
$.each(checkRow, function(i, item) {
//删除allChooseProduct已选择的商品信息
var trId = $(item).parent().parent().attr("trcusid");
allChooseProduct[trId] = undefined;
//移除界面上的信息
$(item).parent().parent().remove();
});
} else {
winui.window.msg('请选择要删除的行', {icon: 2, time: 2000});
}
}
//商品选择
$("body").on("click", ".chooseProductBtn", function (e) {
var trId = $(this).parent().parent().attr("trcusid");
erpOrderUtil.openMaterialChooseChoosePage(function (chooseProductMation) {
//获取表格行号
var thisRowNum = trId.replace("tr", "");
//商品赋值
allChooseProduct[trId] = chooseProductMation;
//表格商品名称赋值
$("#materialId" + thisRowNum.toString()).val(allChooseProduct[trId].materialName + "(" + allChooseProduct[trId].materialModel + ")");
//表格单位赋值
$("#unitId" + thisRowNum.toString()).html(getDataUseHandlebars(selOption, {rows: allChooseProduct[trId].unitList}));
form.render('select');
//计算价格
calculatedTotalPrice();
});
});
// 加工单选择
$("body").on("click", "#machinOrderSel", function (e) {
_openNewWindows({
url: "../../tpl/erpMachin/erpMachinStateIsPassNoComplateChoose.html",
title: "选择加工单",
pageId: "erpMachinStateIsPassNoComplateChoose",
area: ['90vw', '90vh'],
callBack: function (refreshCode) {
$("#machinOrder").val(machinMation.orderNum);
//移除之前填写的所有行
var checkRow = $("#useTable input[type='checkbox'][name='tableCheckRow']");
$.each(checkRow, function(i, item) {
//删除allChooseProduct已选择的商品信息
var trId = $(item).parent().parent().attr("trcusid");
allChooseProduct[trId] = undefined;
//移除界面上的信息
$(item).parent().parent().remove();
});
$.each(machinMation.norms, function(i, item) {
addRow();
//将规格所属的商品信息加入到对象中存储
allChooseProduct["tr" + (rowNum - 1)] = item;
//单位回显
$("#unitId" + (rowNum - 1)).html(getDataUseHandlebars(selOption, {rows: item.unitList}));
$("#unitId" + (rowNum - 1)).val(item.normsId);
//商品回显
$("#materialId" + (rowNum - 1)).val(item.materialName + "(" + item.materialModel + ")");
$("#currentTock" + (rowNum - 1)).html(item.currentTock);//库存回显
//所需领料总数量
$("#productionNum" + (rowNum - 1)).html(item.needNumber);
//待领料数量
$("#machinNum" + (rowNum - 1)).html(item.machinNum);
//建议数量
$("#rkNum" + (rowNum - 1)).val(item.machinNum);
$("#unitPrice" + (rowNum - 1)).val(item.unitPrice.toFixed(2));
});
//渲染
form.render();
//计算价格
calculatedTotalPrice();
}});
});
// 取消
$("body").on("click", "#cancle", function() {
parent.layer.close(index);
});
});
});
\ No newline at end of file
layui.config({
base: basePath,
version: skyeyeVersion
}).extend({
window: 'js/winui.window'
}).define(['window', 'jquery', 'winui', 'jqprint'], function (exports) {
winui.renderColor();
layui.use(['form'], function (form) {
var index = parent.layer.getFrameIndex(window.name);
var $ = layui.$,
form = layui.form;
showGrid({
id: "showForm",
url: flowableBasePath + "erppick007",
params: {id: parent.rowId},
pagination: false,
method: 'GET',
template: $("#useTemplate").html(),
ajaxSendLoadBefore: function(hdb) {
hdb.registerHelper('compare1', function(v1, v2, options) {
return (parseFloat(v1) * parseFloat(v2)).toFixed(2);
});
},
ajaxSendAfter: function (json) {
matchingLanguage();
form.render();
}
});
//打印
$("body").on("click", "#jprint", function (e) {
$("#showForm").jqprint({
title: sysMainMation.mationTitle,
debug: false, //如果是true则可以显示iframe查看效果(iframe默认高和宽都很小,可以再源码中调大),默认是false
importCSS: true, //true表示引进原来的页面的css,默认是true。(如果是true,先会找$("link[media=print]"),若没有会去找$("link")中的css文件)
printContainer: true, //表示如果原来选择的对象必须被纳入打印(注意:设置为false可能会打破你的CSS规则)。
operaSupport: true//表示如果插件也必须支持歌opera浏览器,在这种情况下,它提供了建立一个临时的打印选项卡。默认是true
});
});
// 图片预览
$("body").on("click", ".barCode", function (e) {
systemCommonUtil.showPicImg(fileBasePath + $(this).attr("src"));
});
});
});
\ No newline at end of file
//加工单信息
var machinMation = {};
//根据那一列的值进行变化,默认根据数量
var showTdByEdit = 'rkNum';
//表格的序号
var rowNum = 1;
// 领料单
layui.config({
base: basePath,
version: skyeyeVersion
}).extend({
window: 'js/winui.window'
}).define(['window', 'jquery', 'winui', 'laydate', 'textool'], function (exports) {
winui.renderColor();
layui.use(['form'], function (form) {
var index = parent.layer.getFrameIndex(window.name);
var $ = layui.$,
form = layui.form,
laydate = layui.laydate,
textool = layui.textool;
var usetableTemplate = $("#usetableTemplate").html();
var selOption = getFileContent('tpl/template/select-option.tpl');
//已经选择的商品集合key:表格的行trId,value:商品信息
var allChooseProduct = {};
textool.init({eleId: 'remark', maxlength: 200});
// 单据时间
laydate.render({elem: '#operTime', type: 'datetime', value: getFormatDate(), trigger: 'click'});
erpOrderUtil.getDepotList(function (json){
// 加载仓库数据
$("#depotId").html(getDataUseHandlebars(selOption, json));
loadData();
});
function loadData(){
AjaxPostUtil.request({url: flowableBasePath + "erppick007", params: {id: parent.rowId}, type: 'json', method: 'GET', callback: function (json) {
var data = json.bean;
if (!isNull(data.machinId)){
$("#machinOrder").val(data.machinNum);
machinMation = {
id: data.machinId,
productionId: data.productionId
};
}
$("#depotId").val(data.depotId);
$("#operTime").val(data.operTime);
$("#remark").val(data.remark);
$.each(data.items, function(i, item) {
addRow();
//将规格所属的商品信息加入到对象中存储
allChooseProduct["tr" + (rowNum - 1)] = item;
//单位回显
$("#unitId" + (rowNum - 1)).html(getDataUseHandlebars(selOption, {rows: item.unitList}));
$("#unitId" + (rowNum - 1)).val(item.normsId);
//商品回显
$("#materialId" + (rowNum - 1)).val(item.materialName + "(" + item.materialModel + ")");
$("#currentTock" + (rowNum - 1)).html(item.currentTock);//库存回显
$.each(data.machinToMation, function(j, bean){
if(bean.normsId == item.normsId){
//所需领料总数量
$("#productionNum" + (rowNum - 1)).html(bean.needNumber);
//待领料数量
$("#machinNum" + (rowNum - 1)).html(bean.machinNum);
return false;
}
});
//建议数量
$("#rkNum" + (rowNum - 1)).val(item.needNumber);
$("#unitPrice" + (rowNum - 1)).val(item.unitPrice.toFixed(2));
});
matchingLanguage();
form.render();
//计算价格
calculatedTotalPrice();
}});
}
//商品规格加载变化事件
form.on('select(selectUnitProperty)', function(data) {
var thisRowValue = data.value;
var thisRowNum = data.elem.id.replace("unitId", "");//获取当前行
//当前当前行选中的商品信息
if (!isNull(thisRowValue) && thisRowValue != '请选择') {
var product = allChooseProduct["tr" + thisRowNum.toString()];
$.each(product.unitList, function(j, bean) {
if(thisRowValue == bean.id){//获取规格
//获取当前行数量
var rkNum = parseInt($("#rkNum" + thisRowNum).val());
$("#unitPrice" + thisRowNum).val(bean.estimatePurchasePrice.toFixed(2));//单价
$("#amountOfMoney" + thisRowNum).val((rkNum * parseFloat(bean.estimatePurchasePrice)).toFixed(2));//金额
return false;
}
});
} else {
$("#unitPrice" + thisRowNum).val("0.00");//重置单价为空
$("#amountOfMoney" + thisRowNum).val("0.00");//重置金额为空
}
//加载库存
loadTockByDepotAndMUnit(thisRowNum, $("#depotId").val());
//计算价格
calculatedTotalPrice();
});
form.render();
form.on('submit(formAddBean)', function (data) {
if (winui.verifyForm(data.elem)) {
//物料清单
var rowTr = $("#useTable tr");
if(rowTr.length == 0) {
winui.window.msg('请选择物料清单.', {icon: 2, time: 2000});
return false;
}
var tableData = new Array();
var noError = false; //循环遍历表格数据时,是否有其他错误信息
$.each(rowTr, function(i, item) {
//获取行编号
var rowNum = $(item).attr("trcusid").replace("tr", "");
//表格数量对象
var rkNum = $("#rkNum" + rowNum);
if(parseInt(rkNum.val()) == 0) {
rkNum.addClass("layui-form-danger");
rkNum.focus();
winui.window.msg('数量不能为0', {icon: 2, time: 2000});
noError = true;
return false;
}
//商品对象
var material = allChooseProduct["tr" + rowNum.toString()];
if(inTableDataArrayByAssetarId(material.materialId, $("#unitId" + rowNum).val(), tableData)) {
winui.window.msg('一张单中不允许出现相同单位的商品信息.', {icon: 2, time: 2000});
noError = true;
return false;
}
var row = {
materialId: material.materialId,
mUnitId: $("#unitId" + rowNum).val(),
rkNum: rkNum.val(),
unitPrice: $("#unitPrice" + rowNum).val()
};
tableData.push(row);
});
if(noError) {
return false;
}
var params = {
machinId: isNull(machinMation.id) ? '' : machinMation.id,
productionId: isNull(machinMation.productionId) ? '' : machinMation.productionId,
operTime: $("#operTime").val(),
remark: $("#remark").val(),
materialStr: JSON.stringify(tableData),
depotId: $("#depotId").val(),
rowId: parent.rowId
};
AjaxPostUtil.request({url: flowableBasePath + "erppick006", params: params, type: 'json', callback: function (json) {
parent.layer.close(index);
parent.refreshCode = '0';
}});
}
return false;
});
//新增行
$("body").on("click", "#addRow", function() {
addRow();
});
//删除行
$("body").on("click", "#deleteRow", function() {
deleteRow();
//计算价格
calculatedTotalPrice();
});
//新增行
function addRow() {
var par = {
id: "row" + rowNum.toString(), //checkbox的id
trId: "tr" + rowNum.toString(), //行的id
materialId: "materialId" + rowNum.toString(), //商品id
unitId: "unitId" + rowNum.toString(), //规格id
currentTock: "currentTock" + rowNum.toString(), //库存id
productionNum: "productionNum" + rowNum.toString(), //所需总数量id
machinNum: "machinNum" + rowNum.toString(), //待分配数量id
rkNum: "rkNum" + rowNum.toString(), //数量id
unitPrice: "unitPrice" + rowNum.toString(), //单价id
amountOfMoney: "amountOfMoney" + rowNum.toString() //金额id
};
$("#useTable").append(getDataUseHandlebars(usetableTemplate, par));
form.render();
rowNum++;
//设置根据某列变化的颜色
$("." + showTdByEdit).parent().css({'background-color': '#e6e6e6'});
}
//删除行
function deleteRow() {
var checkRow = $("#useTable input[type='checkbox'][name='tableCheckRow']:checked");
if(checkRow.length > 0) {
$.each(checkRow, function(i, item) {
//删除allChooseProduct已选择的商品信息
var trId = $(item).parent().parent().attr("trcusid");
allChooseProduct[trId] = undefined;
//移除界面上的信息
$(item).parent().parent().remove();
});
} else {
winui.window.msg('请选择要删除的行', {icon: 2, time: 2000});
}
}
//商品选择
$("body").on("click", ".chooseProductBtn", function (e) {
var trId = $(this).parent().parent().attr("trcusid");
erpOrderUtil.openMaterialChooseChoosePage(function (chooseProductMation) {
// 获取表格行号
var thisRowNum = trId.replace("tr", "");
//商品赋值
allChooseProduct[trId] = chooseProductMation;
//表格商品名称赋值
$("#materialId" + thisRowNum.toString()).val(allChooseProduct[trId].materialName + "(" + allChooseProduct[trId].materialModel + ")");
//表格单位赋值
$("#unitId" + thisRowNum.toString()).html(getDataUseHandlebars(selOption, {rows: allChooseProduct[trId].unitList}));
form.render('select');
//计算价格
calculatedTotalPrice();
});
});
// 加工单选择
$("body").on("click", "#machinOrderSel", function (e) {
_openNewWindows({
url: "../../tpl/erpMachin/erpMachinStateIsPassNoComplateChoose.html",
title: "选择加工单",
pageId: "erpMachinStateIsPassNoComplateChoose",
area: ['90vw', '90vh'],
callBack: function (refreshCode) {
$("#machinOrder").val(machinMation.orderNum);
//移除之前填写的所有行
var checkRow = $("#useTable input[type='checkbox'][name='tableCheckRow']");
$.each(checkRow, function(i, item) {
//删除allChooseProduct已选择的商品信息
var trId = $(item).parent().parent().attr("trcusid");
allChooseProduct[trId] = undefined;
//移除界面上的信息
$(item).parent().parent().remove();
});
$.each(machinMation.norms, function(i, item) {
addRow();
//将规格所属的商品信息加入到对象中存储
allChooseProduct["tr" + (rowNum - 1)] = item;
//单位回显
$("#unitId" + (rowNum - 1)).html(getDataUseHandlebars(selOption, {rows: item.unitList}));
$("#unitId" + (rowNum - 1)).val(item.normsId);
//商品回显
$("#materialId" + (rowNum - 1)).val(item.materialName + "(" + item.materialModel + ")");
$("#currentTock" + (rowNum - 1)).html(item.currentTock);//库存回显
//所需领料总数量
$("#productionNum" + (rowNum - 1)).html(item.needNumber);
//待领料数量
$("#machinNum" + (rowNum - 1)).html(item.machinNum);
//建议数量
$("#rkNum" + (rowNum - 1)).val(item.machinNum);
$("#unitPrice" + (rowNum - 1)).val(item.unitPrice.toFixed(2));
});
//渲染
form.render();
//计算价格
calculatedTotalPrice();
}});
});
// 取消
$("body").on("click", "#cancle", function() {
parent.layer.close(index);
});
});
});
\ No newline at end of file
......@@ -7,11 +7,10 @@ layui.config({
version: skyeyeVersion
}).extend({
window: 'js/winui.window'
}).define(['window', 'table', 'jquery', 'winui', 'form', 'soulTable'], function (exports) {
}).define(['window', 'table', 'jquery', 'winui', 'form'], function (exports) {
winui.renderColor();
var $ = layui.$,
form = layui.form,
soulTable = layui.soulTable,
table = layui.table;
authBtn('1593864516103');//新增
......@@ -20,46 +19,34 @@ layui.config({
id: 'messageTable',
elem: '#messageTable',
method: 'post',
url: flowableBasePath + 'erppick001',
url: sysMainMation.erpBasePath + 'erppick001',
where: getTableParams(),
even: true,
page: true,
limits: getLimits(),
limit: getLimit(),
overflow: {
type: 'tips',
hoverTime: 300, // 悬停时间,单位ms, 悬停 hoverTime 后才会显示,默认为 0
minWidth: 150, // 最小宽度
maxWidth: 500 // 最大宽度
},
cols: [[
{ title: systemLanguage["com.skyeye.serialNumber"][languageType], type: 'numbers' },
{ field: 'defaultNumber', title: '单据编号', align: 'center', width: 200, templet: function (d) {
return '<a lay-event="details" class="notice-title-click">' + d.defaultNumber + '</a>';
}},
{ field: 'machinNum', title: '加工单', align: 'center', width: 200 },
{ field: 'status', title: '状态', align: 'left', width: 80, templet: function (d) {
if (d.status == '0') {
return "<span class='state-down'>未审核</span>";
} else if (d.status == '1') {
return "<span class='state-up'>审核中</span>";
} else if (d.status == '2') {
return "<span class='state-new'>审核通过</span>";
} else if (d.status == '3') {
return "<span class='state-down'>拒绝通过</span>";
} else {
return "参数错误";
}
}},
{ field: 'oddNumber', title: '单据编号', align: 'center', width: 180, templet: function (d) {
return '<a lay-event="details" class="notice-title-click">' + d.oddNumber + '</a>';
}},
{ field: 'machinMation', rowspan: '2', title: '加工单', align: 'center', width: 200, templet: function (d) {return isNull(d.machinMation) ? '' : d.machinMation.oddNumber}},
{ field: 'processInstanceId', title: '流程ID', width: 100, templet: function (d) {
return '<a lay-event="processDetails" class="notice-title-click">' + d.processInstanceId + '</a>';
}},
{ field: 'state', title: '状态', width: 90, templet: function (d) {
return skyeyeClassEnumUtil.getEnumDataNameByCodeAndKey("flowableStateEnum", 'id', d.state, 'name');
}},
{ field: 'totalPrice', title: '物料合计', align: 'left', width: 100 },
{ field: 'operTime', title: '单据日期', align: 'center', width: 150 },
{ field: 'createName', title: '录入人', align: 'left', width: 120 },
{ field: 'createTime', title: '录入日期', align: 'center', width: 140 },
{ field: 'createName', title: systemLanguage["com.skyeye.createName"][languageType], width: 120 },
{ field: 'createTime', title: systemLanguage["com.skyeye.createTime"][languageType], align: 'center', width: 150 },
{ field: 'lastUpdateName', title: systemLanguage["com.skyeye.lastUpdateName"][languageType], align: 'left', width: 120 },
{ field: 'lastUpdateTime', title: systemLanguage["com.skyeye.lastUpdateTime"][languageType], align: 'center', width: 150 },
{ title: systemLanguage["com.skyeye.operation"][languageType], fixed: 'right', align: 'center', width: 200, toolbar: '#tableBar' }
]],
done: function(json) {
matchingLanguage();
soulTable.render(this);
initTableSearchUtil.initAdvancedSearch(this, json.searchFilter, form, "请输入单据编号", function () {
table.reloadData("messageTable", {page: {curr: 1}, where: getTableParams()});
});
......@@ -70,23 +57,37 @@ layui.config({
var data = obj.data;
var layEvent = obj.event;
if (layEvent === 'delete') { //删除
deletemember(data);
del(data);
} else if (layEvent === 'details') { //详情
details(data);
} else if (layEvent === 'edit') { //编辑
edit(data);
} else if (layEvent === 'subExamine') { //提交审核
subExamine(data);
} else if (layEvent === 'examine') { //审核
examine(data);
} else if (layEvent === 'subApproval') { //提交审核
subApproval(data);
} else if (layEvent === 'processDetails') { // 工作流流程详情查看
activitiUtil.activitiDetails(data);
} else if (layEvent === 'revoke') { //撤销
revoke(data);
}
});
// 添加
$("body").on("click", "#addBean", function() {
_openNewWindows({
url: systemCommonUtil.getUrl('FP2023100500001', null),
title: systemLanguage["com.skyeye.addPageTitle"][languageType],
pageId: "erpRequisitionAdd",
area: ['90vw', '90vh'],
callBack: function (refreshCode) {
winui.window.msg(systemLanguage["com.skyeye.successfulOperation"][languageType], {icon: 1, time: 2000});
loadTable();
}});
});
// 编辑
function edit(data) {
rowId = data.id;
_openNewWindows({
url: "../../tpl/erpPick/erpRequisitionEdit.html",
url: systemCommonUtil.getUrl('FP2023100500002&id=' + data.id, null),
title: systemLanguage["com.skyeye.editPageTitle"][languageType],
pageId: "erpRequisitionEdit",
area: ['90vw', '90vh'],
......@@ -96,66 +97,54 @@ layui.config({
}});
}
// 详情
function details(data) {
_openNewWindows({
url: systemCommonUtil.getUrl('FP2023100500003&id=' + data.id, null),
title: systemLanguage["com.skyeye.detailsPageTitle"][languageType],
pageId: "erpRequisitionDetails",
area: ['90vw', '90vh'],
callBack: function (refreshCode) {
}});
}
// 删除
function deletemember(data) {
function del(data) {
layer.confirm(systemLanguage["com.skyeye.deleteOperationMsg"][languageType], {icon: 3, title: systemLanguage["com.skyeye.deleteOperation"][languageType]}, function (index) {
AjaxPostUtil.request({url: flowableBasePath + "erppick008", params: {rowId: data.id}, type: 'json', callback: function (json) {
AjaxPostUtil.request({url: sysMainMation.erpBasePath + "erppick008", params: {id: data.id}, type: 'json', method: 'DELETE', callback: function (json) {
winui.window.msg(systemLanguage["com.skyeye.deleteOperationSuccessMsg"][languageType], {icon: 1, time: 2000});
loadTable();
}});
});
}
// 详情
function details(data) {
rowId = data.id;
_openNewWindows({
url: "../../tpl/erpPick/erpRequisitionDetails.html",
title: systemLanguage["com.skyeye.detailsPageTitle"][languageType],
pageId: "erpRequisitionDetails",
area: ['90vw', '90vh'],
callBack: function (refreshCode) {
}});
}
// 提交审批
function subExamine(data) {
function subApproval(data) {
layer.confirm('确认要提交审核吗?', { icon: 3, title: '提交审核操作' }, function (index) {
AjaxPostUtil.request({url: flowableBasePath + "erppick015", params: {rowId: data.id}, type: 'json', callback: function (json) {
winui.window.msg("提交成功。", {icon: 1, time: 2000});
activitiUtil.startProcess(data.serviceClassName, null, function (approvalId) {
var params = {
id: data.id,
approvalId: approvalId
};
AjaxPostUtil.request({url: sysMainMation.erpBasePath + "submitRequisitionMaterial", params: params, type: 'json', method: 'POST', callback: function (json) {
winui.window.msg("提交成功", {icon: 1, time: 2000});
loadTable();
}});
});
});
}
// 撤销
function revoke(data) {
layer.confirm('确认撤销该申请吗?', { icon: 3, title: '撤销操作' }, function (index) {
layer.close(index);
AjaxPostUtil.request({url: sysMainMation.erpBasePath + "revokeRequisitionMaterial", params: {processInstanceId: data.processInstanceId}, type: 'json', method: "PUT", callback: function (json) {
winui.window.msg("提交成功", {icon: 1, time: 2000});
loadTable();
}});
});
}
// 审核
function examine(data) {
rowId = data.id;
type = data.type,
_openNewWindows({
url: "../../tpl/erpPick/erpPickApprovalExamine.html",
title: "审核",
pageId: "erpPickApprovalExamine",
area: ['90vw', '90vh'],
callBack: function (refreshCode) {
winui.window.msg(systemLanguage["com.skyeye.successfulOperation"][languageType], {icon: 1, time: 2000});
loadTable();
}});
}
// 添加
$("body").on("click", "#addBean", function() {
_openNewWindows({
url: "../../tpl/erpPick/erpRequisitionAdd.html",
title: systemLanguage["com.skyeye.addPageTitle"][languageType],
pageId: "erpRequisitionAdd",
area: ['90vw', '90vh'],
callBack: function (refreshCode) {
winui.window.msg(systemLanguage["com.skyeye.successfulOperation"][languageType], {icon: 1, time: 2000});
loadTable();
}});
});
form.render();
$("body").on("click", "#reloadTable", function() {
loadTable();
......
......@@ -5,15 +5,6 @@
<title></title>
<link href="../../assets/lib/layui/css/layui.css" rel="stylesheet" />
<link href="../../assets/lib/winui/css/winui.css" rel="stylesheet" />
<style>
.layui-table-cell {
height: auto;
text-overflow: inherit;
overflow: visible;
white-space: normal;
word-wrap: break-word;
}
</style>
</head>
<body>
<div class="winui-toolbar">
......
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title></title>
<link href="../../assets/lib/layui/css/layui.css" rel="stylesheet" />
<link href="../../assets/lib/winui/css/winui.css" rel="stylesheet" />
</head>
<body>
<div style="padding:20px; margin:0 auto;">
<form class="layui-form" action="" id="showForm">
<div class="layui-form-item layui-col-xs12">
<span class="hr-title">单据信息</span><hr>
</div>
<div class="layui-form-item layui-col-xs12">
<iframe id="showBean" style="width: 100%; border: 0px;" scrolling="no"></iframe>
</div>
<div class="layui-form-item layui-col-xs12">
<span class="hr-title">审批</span><hr>
</div>
<div class="layui-form-item">
<label class="layui-form-label">审批结果<i class="red">*</i></label>
<div class="layui-input-block winui-radio">
<input type="radio" name="flag" value="1" title="同意" checked="checked"/>
<input type="radio" name="flag" value="0" title="拒绝" />
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">审批意见</label>
<div class="layui-input-block">
<textarea id="opinion" placeholder="请输入审批意见" maxlength="200" class="layui-textarea" style="height: 100px;"></textarea>
</div>
</div>
<div class="layui-input-block">
<button class="winui-btn" id="cancle"><language showName="com.skyeye.cancel"></language></button>
<button class="winui-btn" lay-submit lay-filter="formAddBean">提交</button>
</div>
</form>
</div>
<script src="../../assets/lib/layui/layui.js"></script>
<script src="../../assets/lib/layui/custom.js"></script>
<script type="text/javascript">
layui.config({base: '../../js/erpPick/'}).use('erpPickApprovalExamine');
</script>
</body>
</html>
\ No newline at end of file
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title></title>
<link href="../../assets/lib/layui/css/layui.css" rel="stylesheet" />
<link href="../../assets/lib/winui/css/winui.css" rel="stylesheet" />
</head>
<body>
<div style="margin:0 auto;padding:20px;">
<form class="layui-form" action="" id="showForm" autocomplete="off">
<div class="layui-form-item layui-col-xs12">
<span class="hr-title">领料单信息</span><hr>
</div>
<div class="layui-form-item layui-col-xs6">
<label class="layui-form-label">单据时间<i class="red">*</i></label>
<div class="layui-input-block">
<input type="text" id="operTime" name="operTime" win-verify="required" placeholder="请选择单据时间" class="layui-input"/>
</div>
</div>
<div class="layui-form-item layui-col-xs6">
<label class="layui-form-label">出库仓库<i class="red">*</i></label>
<div class="layui-input-block">
<select id="depotId" name="depotId" lay-search="" win-verify="required">
</select>
</div>
</div>
<div class="layui-form-item layui-col-xs6">
<label class="layui-form-label">加工单</label>
<div class="layui-input-block">
<input type="text" id="machinOrder" name="machinOrder" placeholder="请选择加工单" class="layui-input" readonly="readonly"/>
<i class="fa fa-plus-circle input-icon" id="machinOrderSel"></i>
</div>
</div>
<div class="layui-form-item layui-col-xs12">
<label class="layui-form-label">备注说明</label>
<div class="layui-input-block">
<textarea id="remark" name="remark" placeholder="请输入备注说明" maxlength="200" class="layui-textarea" style="height: 100px;"></textarea>
</div>
</div>
<div class="layui-form-item layui-col-xs12">
<span class="hr-title">物料</span><hr>
</div>
<div class="layui-form-item layui-col-xs12">
<label class="layui-form-label">列表项<i class="red">*</i></label>
<div class="layui-input-block">
<div class="winui-toolbar">
<div class="winui-tool" style="text-align: left;">
<button id="addRow" class="winui-toolbtn" type="button"><i class="fa fa-plus" aria-hidden="true"></i>新增行</button>
<button id="deleteRow" class="winui-toolbtn" type="button"><i class="fa fa-trash-o" aria-hidden="true"></i>删除行</button>
</div>
</div>
<table class="layui-table">
<thead>
<tr>
<th style="width: 30px;"></th>
<th style="width: 150px;">商品(型号)</th>
<th style="width: 50px;">单位</th>
<th style="width: 60px;">库存</th>
<th style="width: 100px;">所需领料总数量</th>
<th style="width: 80px; align:center;">待领料数量</th>
<th style="width: 80px;">数量</th>
<th style="width: 80px;">单价</th>
<th style="width: 80px;">金额</th>
</tr>
</thead>
<tbody id="useTable" class="insurance-table">
</tbody>
</table>
</div>
</div>
<div class="layui-form-item layui-col-xs12">
<div class="layui-input-block">
<button class="winui-btn" id="cancle"><language showName="com.skyeye.cancel"></language></button>
<button class="winui-btn" lay-submit lay-filter="formAddBean"><language showName="com.skyeye.save"></language></button>
</div>
</div>
</form>
</div>
<!-- usetableTemplate -->
<script type="text/x-handlebars-template" id="usetableTemplate">
<tr trcusid="{{trId}}">
<td><input type="checkbox" rowId="{{id}}" lay-filter="checkboxProperty" name="tableCheckRow"/></td>
<td>
<input type="text" id="{{materialId}}" name="{{materialId}}" placeholder="请选择商品" class="layui-input" readonly="readonly"/>
<i class="fa fa-plus-circle input-icon chooseProductBtn" style="top: 12px;"></i>
</td>
<td><select id="{{unitId}}" lay-filter="selectUnitProperty" lay-search win-verify="required"></select></td>
<td id="{{currentTock}}"></td>
<td id="{{productionNum}}" style="text-align:center;">-</td>
<td id="{{machinNum}}" style="text-align:center;">-</td>
<td><input type="text" class="layui-input change-input rkNum" value="1" id="{{rkNum}}" win-verify="required|number"/></td>
<td><input type="text" class="layui-input change-input unitPrice" id="{{unitPrice}}" win-verify="required|money"/></td>
<td><input type="text" class="layui-input change-input amountOfMoney" id="{{amountOfMoney}}" win-verify="required|money"/></td>
</tr>
</script>
<script src="../../assets/lib/layui/layui.js"></script>
<script src="../../assets/lib/layui/custom.js"></script>
<script src="../../js/erpcommon/calculatePrice.js"></script>
<script src="../../js/erpcommon/loadStock.js"></script>
<script type="text/javascript">
layui.config({base: '../../js/erpPick/'}).use('erpRequisitionAdd');
</script>
</body>
</html>
\ No newline at end of file
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title></title>
<link href="../../assets/lib/layui/css/layui.css" rel="stylesheet" />
<link href="../../assets/lib/winui/css/winui.css" rel="stylesheet" />
</head>
<body>
<div style="margin:0 auto;padding:20px;">
<form class="layui-form" action="" id="showForm" autocomplete="off">
</form>
<div class="layui-form-item layui-col-xs12">
<div class="layui-input-block ver-center">
<button class="winui-btn" type="button" id="jprint">打印</button>
</div>
</div>
</div>
<!-- useTemplate -->
<script type="text/x-handlebars-template" id="useTemplate">
{{#bean}}
<div class="layui-form-item layui-col-xs12">
<span class="hr-title">领料单信息</span><hr>
</div>
<div class="layui-form-item layui-col-xs12">
<label class="layui-form-label">单据编号</label>
<div class="layui-input-block ver-center">
{{defaultNumber}}
</div>
</div>
<div class="layui-form-item layui-col-xs6">
<label class="layui-form-label">出库仓库</label>
<div class="layui-input-block ver-center">
{{depotMation.name}}
</div>
</div>
<div class="layui-form-item layui-col-xs6">
<label class="layui-form-label">单据时间</label>
<div class="layui-input-block ver-center">
{{operTime}}
</div>
</div>
<div class="layui-form-item layui-col-xs6">
<label class="layui-form-label">加工单</label>
<div class="layui-input-block ver-center">
{{machinNum}}
</div>
</div>
<div class="layui-form-item layui-col-xs12">
<label class="layui-form-label">备注说明</label>
<div class="layui-input-block ver-center">
{{remark}}
</div>
</div>
<div class="layui-form-item layui-col-xs12">
<span class="hr-title">物料</span><hr>
</div>
<div class="layui-form-item layui-col-xs12">
<label class="layui-form-label">列表项</label>
<div class="layui-input-block">
<table class="layui-table">
<thead>
<tr>
<th style="width: 150px;">商品(型号)</th>
<th style="width: 50px;">单位</th>
<th style="width: 80px;">数量</th>
<th style="width: 80px;">单价</th>
<th style="width: 80px;">金额</th>
</tr>
</thead>
<tbody id="useTable" class="insurance-table">
{{#each items}}
<tr>
<td>{{materialName}}({{materialModel}})</td>
<td>{{unitName}}</td>
<td>{{needNumber}}</td>
<td>{{unitPrice}}</td>
<td>{{#compare1 needNumber unitPrice}}{{/compare1}}</td>
</tr>
{{/each}}
</tbody>
</table>
</div>
</div>
<div class="layui-form-item layui-col-xs12">
<span class="hr-title">录入人信息</span><hr>
</div>
<div class="layui-form-item layui-col-xs6">
<label class="layui-form-label">录入人</label>
<div class="layui-input-block ver-center">
{{createName}}
</div>
</div>
<div class="layui-form-item layui-col-xs6">
<label class="layui-form-label">录入时间</label>
<div class="layui-input-block ver-center">
{{createTime}}
</div>
</div>
<div class="layui-form-item layui-col-xs12">
<span class="hr-title">审核信息</span><hr>
</div>
<div class="layui-form-item layui-col-xs12">
<label class="layui-form-label">审核意见</label>
<div class="layui-input-block ver-center">
{{examineContent}}
</div>
</div>
{{/bean}}
</script>
<script src="../../assets/lib/layui/layui.js"></script>
<script src="../../assets/lib/layui/custom.js"></script>
<script type="text/javascript">
layui.config({base: '../../js/erpPick/'}).use('erpRequisitionDetails');
</script>
</body>
</html>
\ No newline at end of file
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title></title>
<link href="../../assets/lib/layui/css/layui.css" rel="stylesheet" />
<link href="../../assets/lib/winui/css/winui.css" rel="stylesheet" />
</head>
<body>
<div style="margin:0 auto;padding:20px;">
<form class="layui-form" action="" id="showForm" autocomplete="off">
<div class="layui-form-item layui-col-xs12">
<span class="hr-title">领料单信息</span><hr>
</div>
<div class="layui-form-item layui-col-xs6">
<label class="layui-form-label">单据时间<i class="red">*</i></label>
<div class="layui-input-block">
<input type="text" id="operTime" name="operTime" win-verify="required" placeholder="请选择单据时间" class="layui-input"/>
</div>
</div>
<div class="layui-form-item layui-col-xs6">
<label class="layui-form-label">出库仓库<i class="red">*</i></label>
<div class="layui-input-block">
<select id="depotId" name="depotId" lay-search="" win-verify="required">
</select>
</div>
</div>
<div class="layui-form-item layui-col-xs6">
<label class="layui-form-label">加工单</label>
<div class="layui-input-block">
<input type="text" id="machinOrder" name="machinOrder" placeholder="请选择加工单" class="layui-input" readonly="readonly"/>
<i class="fa fa-plus-circle input-icon" id="machinOrderSel"></i>
</div>
</div>
<div class="layui-form-item layui-col-xs12">
<label class="layui-form-label">备注说明</label>
<div class="layui-input-block">
<textarea id="remark" name="remark" placeholder="请输入备注说明" maxlength="200" class="layui-textarea" style="height: 100px;"></textarea>
</div>
</div>
<div class="layui-form-item layui-col-xs12">
<span class="hr-title">物料</span><hr>
</div>
<div class="layui-form-item layui-col-xs12">
<label class="layui-form-label">列表项<i class="red">*</i></label>
<div class="layui-input-block">
<div class="winui-toolbar">
<div class="winui-tool" style="text-align: left;">
<button id="addRow" class="winui-toolbtn" type="button"><i class="fa fa-plus" aria-hidden="true"></i>新增行</button>
<button id="deleteRow" class="winui-toolbtn" type="button"><i class="fa fa-trash-o" aria-hidden="true"></i>删除行</button>
</div>
</div>
<table class="layui-table">
<thead>
<tr>
<th style="width: 30px;"></th>
<th style="width: 150px;">商品(型号)</th>
<th style="width: 50px;">单位</th>
<th style="width: 60px;">库存</th>
<th style="width: 100px;">所需领料总数量</th>
<th style="width: 80px; align:center;">待领料数量</th>
<th style="width: 80px;">数量</th>
<th style="width: 80px;">单价</th>
<th style="width: 80px;">金额</th>
</tr>
</thead>
<tbody id="useTable" class="insurance-table">
</tbody>
</table>
</div>
</div>
<div class="layui-form-item layui-col-xs12">
<div class="layui-input-block">
<button class="winui-btn" id="cancle"><language showName="com.skyeye.cancel"></language></button>
<button class="winui-btn" lay-submit lay-filter="formAddBean"><language showName="com.skyeye.save"></language></button>
</div>
</div>
</form>
</div>
<!-- usetableTemplate -->
<script type="text/x-handlebars-template" id="usetableTemplate">
<tr trcusid="{{trId}}">
<td><input type="checkbox" rowId="{{id}}" lay-filter="checkboxProperty" name="tableCheckRow"/></td>
<td>
<input type="text" id="{{materialId}}" name="{{materialId}}" placeholder="请选择商品" class="layui-input" readonly="readonly"/>
<i class="fa fa-plus-circle input-icon chooseProductBtn" style="top: 12px;"></i>
</td>
<td><select id="{{unitId}}" lay-filter="selectUnitProperty" lay-search win-verify="required"></select></td>
<td id="{{currentTock}}"></td>
<td id="{{productionNum}}" style="text-align:center;">-</td>
<td id="{{machinNum}}" style="text-align:center;">-</td>
<td><input type="text" class="layui-input change-input rkNum" value="1" id="{{rkNum}}" win-verify="required|number"/></td>
<td><input type="text" class="layui-input change-input unitPrice" id="{{unitPrice}}" win-verify="required|money"/></td>
<td><input type="text" class="layui-input change-input amountOfMoney" id="{{amountOfMoney}}" win-verify="required|money"/></td>
</tr>
</script>
<script src="../../assets/lib/layui/layui.js"></script>
<script src="../../assets/lib/layui/custom.js"></script>
<script src="../../js/erpcommon/calculatePrice.js"></script>
<script src="../../js/erpcommon/loadStock.js"></script>
<script type="text/javascript">
layui.config({base: '../../js/erpPick/'}).use('erpRequisitionEdit');
</script>
</body>
</html>
\ No newline at end of file
......@@ -18,19 +18,20 @@
<table id="messageTable" lay-filter="messageTable"></table>
<script type="text/html" id="tableBar">
{{# if(d.status == 0 || d.status == 3){ }}
{{# if(auth('1593872644294')){ }}
<a class="layui-btn layui-btn-xs" lay-event="edit"><language showName="com.skyeye.editBtn"></language></a>
{{# if(d.editRow == 1) { }}
{{# if(auth('1593919775596')) { }}
<a class="layui-btn layui-btn-xs" lay-event="subApproval">提交审批</a>
{{# } }}
{{# if(auth('1593874598005')){ }}
<a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="delete"><language showName="com.skyeye.deleteBtn"></language></a>
{{# if(auth('1593864516103')) { }}
<a class="layui-btn layui-btn-xs layui-btn-normal" lay-event="edit"><language showName="com.skyeye.editBtn"></language></a>
{{# } }}
{{# if(auth('1593919775596')){ }}
<a class="layui-btn layui-btn-xs" lay-event="subExamine">提交审核</a>
{{# if(auth('1593874598005')) { }}
<a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="delete"><language showName="com.skyeye.deleteBtn"></language></a>
{{# } }}
{{# } else if(d.status == 1) { }}
{{# if(auth('1593928178129')){ }}
<a class="layui-btn layui-btn-xs" lay-event="examine">审核</a>
{{# } }}
{{# if(d.editRow == 2) { }}
{{# if(auth('1593919775585')) { }}
<a class="layui-btn layui-btn-xs layui-btn-danger" lay-event="revoke">撤销</a>
{{# } }}
{{# } }}
</script>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册