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

加工单托管到表单布局

上级 7152f04b
//工序选择必备参数
var procedureCheckType = 2;//工序选择类型:1.单选procedureMation;2.多选procedureMationList
var procedureMationList = new Array();
//生产计划单信息
var productionMation = {};
//根据那一列的值进行变化,默认根据数量
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');
//加工的商品信息
var machinPro = {};
//已经选择的商品集合key:表格的行trId,value:商品信息
var allChooseProduct = {};
textool.init({eleId: 'remark', maxlength: 200});
// 计划开始时间
laydate.render({elem: '#starTime', type: 'datetime', value: getFormatDate(), trigger: 'click'});
//计划结束时间
laydate.render({elem: '#endTime', type: 'datetime', value: getFormatDate(), trigger: 'click'});
// 获取当前登录用户所属企业的所有部门信息
systemCommonUtil.queryDepartmentListByCurrentUserBelong(function(data) {
$("#departmentId").html(getDataUseHandlebars(selOption, data));
form.render('select');
});
//商品规格加载变化事件
form.on('select(selectUnitProperty)', function(data) {
var thisRowValue = data.value;
var thisRowNum = data.elem.id.replace("mUnitId", "");//获取当前行
//当前当前行选中的商品信息
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, "");
//计算价格
calculatedTotalPrice();
});
matchingLanguage();
form.render();
form.on('submit(formAddBean)', function (data) {
if (winui.verifyForm(data.elem)) {
if(procedureMationList.length == 0){
winui.window.msg('请选择工序', {icon: 2, time: 2000});
return false;
}
//物料清单
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, $("#mUnitId" + rowNum).val(), tableData)) {
winui.window.msg('一张单中不允许出现相同单位的商品信息.', {icon: 2, time: 2000});
noError = true;
return false;
}
var row = {
materialId: material.materialId,
mUnitId: $("#mUnitId" + rowNum).val(),
rkNum: rkNum.val(),
unitPrice: $("#unitPrice" + rowNum).val()
};
tableData.push(row);
});
if(noError) {
return false;
}
var params = {
orderId: isNull(productionMation.id) ? '' : productionMation.id,
materialId: machinPro.materialId,
normsId: $("#unitList").val(),
departmentId: $("#departmentId").val(),
number: $("#number").val(),
starTime: $("#starTime").val(),
endTime: $("#endTime").val(),
remark: $("#remark").val(),
materielStr: JSON.stringify(tableData),
procedureJsonStr: JSON.stringify(procedureMationList)
};
AjaxPostUtil.request({url: flowableBasePath + "erpmachin002", params: params, type: 'json', callback: function (json) {
parent.layer.close(index);
parent.refreshCode = '0';
}});
}
return false;
});
//工序选择
$("body").on("click", "#procedureChoose", function() {
_openNewWindows({
url: "../../tpl/erpWorkProcedure/erpWorkProcedureChoose.html",
title: "工序选择",
pageId: "erpWorkProcedureChoose",
area: ['90vw', '90vh'],
callBack: function (refreshCode) {
var str = "";
$.each(procedureMationList, function(i, item) {
str += '<tr><td>' + item.number + '</td><td>' + item.procedureName + '</td><td>' + item.unitPrice + '</td><td>' + item.departmentName + '</td></tr>';
});
$("#procedureBody").html(str);
}});
});
// 加工成品选择
$("body").on("click", "#productNameSel", function (e) {
erpOrderUtil.openMaterialChooseChoosePage(function (chooseProductMation) {
machinPro = chooseProductMation;
//工序重置
$("#procedureChoose").show();
procedureMationList = [];
$("#procedureBody").html("");
//重置成品信息
$("#productName").val(machinPro.materialName);
$("#productModel").val(machinPro.materialModel);
$("#unitList").html(getDataUseHandlebars(selOption, {rows: machinPro.unitList}));
$("#number").val(1);
//重置单据信息
productionMation = {};
$("#productionOrder").val("");
//部门
$("#departmentId").val("");
//移除之前填写的所有行
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();
});
form.render();
});
});
//新增行
$("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
mUnitId: "mUnitId" + rowNum.toString(), //规格id
allStock: "allStock" + 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 + ")");
//表格单位赋值
$("#mUnitId" + thisRowNum.toString()).html(getDataUseHandlebars(selOption, {rows: allChooseProduct[trId].unitList}));
form.render('select');
//计算价格
calculatedTotalPrice();
});
});
//计划加工单选择
$("body").on("click", "#productionOrderSel", function (e) {
_openNewWindows({
url: "../../tpl/erpProduction/erpProductionNoComplateList.html",
title: "选择生产计划单",
pageId: "erpProductionNoSuccessChooseProcedure",
area: ['90vw', '90vh'],
callBack: function (refreshCode) {
$("#productionOrder").val(productionMation.defaultNumber);
// 加工商品信息
machinPro = {
materialId: productionMation.materialId,
materialName: productionMation.materialName,
materialModel: productionMation.materialModel,
unitList: productionMation.unitList
};
$("#productName").val(machinPro.materialName);
$("#productModel").val(machinPro.materialModel);
$("#unitList").html(getDataUseHandlebars(selOption, {rows: machinPro.unitList}));
$("#unitList").val(productionMation.normsId);
$("#number").val(productionMation.number);
//工序
$("#procedureChoose").hide();
procedureMationList = [].concat(productionMation.procedureList);
var str = "";
$.each(procedureMationList, function(i, item) {
str += '<tr><td>' + item.number + '</td><td>' + item.procedureName + '</td><td>' + item.unitPrice + '</td><td>' + item.departmentName + '</td></tr>';
});
$("#procedureBody").html(str);
//部门
$("#departmentId").val(procedureMationList[0].departmentId);
//移除之前填写的所有行
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(productionMation.norms, function(i, item) {
addRow();
//将规格所属的商品信息加入到对象中存储
allChooseProduct["tr" + (rowNum - 1)] = item.product;
//单位回显
$("#mUnitId" + (rowNum - 1)).html(getDataUseHandlebars(selOption, {rows: item.product.unitList}));
$("#mUnitId" + (rowNum - 1)).val(item.normsId);
//商品回显
$("#materialId" + (rowNum - 1)).val(item.product.materialName + "(" + item.product.materialModel + ")");
$("#allStock" + (rowNum - 1)).html(item.allStock);//库存回显
//所需总数量
$("#productionNum" + (rowNum - 1)).html(item.productionNum);
//待分配数量
$("#machinNum" + (rowNum - 1)).html(item.machinNum);
//建议数量
$("#rkNum" + (rowNum - 1)).val(item.machinNum);
$("#unitPrice" + (rowNum - 1)).val(item.unitPrice.toFixed(2));
$("#amountOfMoney" + (rowNum - 1)).val(item.allPrice.toFixed(2));
});
//渲染
form.render();
//计算价格
calculatedTotalPrice();
}});
});
// 取消
$("body").on("click", "#cancle", function() {
parent.layer.close(index);
});
});
});
\ No newline at end of file
// 加工单绑定工序的验收id
var childId = "";
// 提交类型,1.工序验收;2.生成验收单
var subType = 1;
// 需要加工的数量
var needNum = 0;
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 + "erpmachin006",
params: {id: parent.rowId},
pagination: false,
method: 'GET',
template: $("#useTemplate").html(),
ajaxSendLoadBefore: function(hdb, json){
needNum = json.bean.needNum;
hdb.registerHelper('compare1', function(v1, v2, options) {
return (parseFloat(v1) * parseFloat(v2)).toFixed(2);
});
var loadOperatorBtn = false;
$.each(json.bean.procedure, function(i, item) {
item.unitPrice = parseFloat(item.unitPrice).toFixed(2);
if(item.state == 1){
item.stateName = "<span class='state-down'>待验收</span>";
if(!loadOperatorBtn){
loadOperatorBtn = true;
if(i == (json.bean.procedure.length - 1)){
item.operator = '<button type="button" class="layui-btn layui-btn-xs layui-btn-normal acceptance" rowId="' + item.id + '" subType="2">生成验收单</button>';
} else {
item.operator = '<button type="button" class="layui-btn layui-btn-xs layui-btn-normal acceptance" rowId="' + item.id + '" subType="1">工序验收</button>';
}
} else {
if(i == (json.bean.procedure.length - 1)){
item.operator = '<button type="button" class="layui-btn layui-btn-xs layui-btn-normal layui-btn-disabled">生成验收单</button>';
} else {
item.operator = '<button type="button" class="layui-btn layui-btn-xs layui-btn-normal layui-btn-disabled">工序验收</button>';
}
}
} else if (item.state == 2){
item.stateName = "<span class='state-up'>已验收</span>"
}
});
$.each(json.bean.material, function(i, item) {
item.unitPrice = parseFloat(item.unitPrice).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($(this).attr("src"));
});
// 验收
$("body").on("click", ".acceptance", function (e) {
childId = $(this).attr("rowId");
subType = $(this).attr("subType");
_openNewWindows({
url: "../../tpl/erpMachin/erpMachinAcceptance.html",
title: "工序验收",
pageId: "erpMachinAcceptance",
area: ['60vw', '60vh'],
callBack: function (refreshCode) {
winui.window.msg(systemLanguage["com.skyeye.successfulOperation"][languageType], {icon: 1, time: 2000});
initData();
}});
});
});
});
\ No newline at end of file
//工序选择必备参数
var procedureCheckType = 2;//工序选择类型:1.单选procedureMation;2.多选procedureMationList
var procedureMationList = new Array();
//生产计划单信息
var productionMation = {};
//根据那一列的值进行变化,默认根据数量
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');
//加工的商品信息
var machinPro = {};
//已经选择的商品集合key:表格的行trId,value:商品信息
var allChooseProduct = {};
textool.init({eleId: 'remark', maxlength: 200});
// 计划开始时间
laydate.render({elem: '#starTime', type: 'datetime', value: getFormatDate(), trigger: 'click'});
// 计划结束时间
laydate.render({elem: '#endTime', type: 'datetime', value: getFormatDate(), trigger: 'click'});
// 获取当前登录用户所属企业的所有部门信息
systemCommonUtil.queryDepartmentListByCurrentUserBelong(function(data) {
$("#departmentId").html(getDataUseHandlebars(selOption, data));
form.render('select');
});
loadData();
function loadData(){
AjaxPostUtil.request({url: flowableBasePath + "erpmachin003", params: {id: parent.rowId}, type: 'json', method: 'GET', callback: function (json) {
var data = json.bean;
if (!isNull(data.productionId)) {
$("#productionOrder").val(data.productionNumber);
$("#procedureChoose").hide();
productionMation = {
id: data.productionId
};
}
//加工商品信息
machinPro = {
materialId: data.materialId,
materialName: data.normMation.materialName,
materialModel: data.normMation.materialModel,
unitList: data.normMation.unitList
};
$("#productName").val(machinPro.materialName);
$("#productModel").val(machinPro.materialModel);
$("#unitList").html(getDataUseHandlebars(selOption, {rows: machinPro.unitList}));
$("#unitList").val(data.normsId);
$("#number").val(data.needNum);
//工序
procedureMationList = [].concat(data.procedure);
var str = "";
$.each(procedureMationList, function(i, item) {
str += '<tr><td>' + item.number + '</td><td>' + item.procedureName + '</td><td>' + item.unitPrice + '</td><td>' + item.departmentName + '</td></tr>';
});
$("#procedureBody").html(str);
//部门
$("#departmentId").val(data.departmentId);
$("#starTime").val(data.startTime);
$("#endTime").val(data.endTime);
$("#remark").val(data.remark);
$.each(data.material, function(i, item) {
addRow();
//将规格所属的商品信息加入到对象中存储
allChooseProduct["tr" + (rowNum - 1)] = item;
//单位回显
$("#mUnitId" + (rowNum - 1)).html(getDataUseHandlebars(selOption, {rows: item.unitList}));
$("#mUnitId" + (rowNum - 1)).val(item.normsId);
//商品回显
$("#materialId" + (rowNum - 1)).val(item.materialName + "(" + item.materialModel + ")");
$("#allStock" + (rowNum - 1)).html(item.allStock);//库存回显
$.each(data.referToMation, function(j, bean){
if(bean.normsId == item.normsId){
//所需总数量
$("#productionNum" + (rowNum - 1)).html(bean.productionNum);
//待分配数量
$("#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("mUnitId", "");//获取当前行
//当前当前行选中的商品信息
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, "");
//计算价格
calculatedTotalPrice();
});
form.render();
form.on('submit(formEditBean)', function (data) {
if (winui.verifyForm(data.elem)) {
if(procedureMationList.length == 0){
winui.window.msg('请选择工序', {icon: 2, time: 2000});
return false;
}
//物料清单
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, $("#mUnitId" + rowNum).val(), tableData)) {
winui.window.msg('一张单中不允许出现相同单位的商品信息.', {icon: 2, time: 2000});
noError = true;
return false;
}
var row = {
materialId: material.materialId,
mUnitId: $("#mUnitId" + rowNum).val(),
rkNum: rkNum.val(),
unitPrice: $("#unitPrice" + rowNum).val()
};
tableData.push(row);
});
if(noError) {
return false;
}
var params = {
orderId: isNull(productionMation.id) ? '' : productionMation.id,
materialId: machinPro.materialId,
normsId: $("#unitList").val(),
departmentId: $("#departmentId").val(),
number: $("#number").val(),
starTime: $("#starTime").val(),
endTime: $("#endTime").val(),
remark: $("#remark").val(),
materielStr: JSON.stringify(tableData),
procedureJsonStr: JSON.stringify(procedureMationList),
rowId: parent.rowId
};
AjaxPostUtil.request({url: flowableBasePath + "erpmachin004", params: params, type: 'json', callback: function (json) {
parent.layer.close(index);
parent.refreshCode = '0';
}});
}
return false;
});
//工序选择
$("body").on("click", "#procedureChoose", function() {
_openNewWindows({
url: "../../tpl/erpWorkProcedure/erpWorkProcedureChoose.html",
title: "工序选择",
pageId: "erpWorkProcedureChoose",
area: ['90vw', '90vh'],
callBack: function (refreshCode) {
var str = "";
$.each(procedureMationList, function(i, item) {
str += '<tr><td>' + item.number + '</td><td>' + item.procedureName + '</td><td>' + item.unitPrice + '</td><td>' + item.departmentName + '</td></tr>';
});
$("#procedureBody").html(str);
}});
});
//加工成品选择
$("body").on("click", "#productNameSel", function (e) {
erpOrderUtil.openMaterialChooseChoosePage(function (chooseProductMation) {
machinPro = chooseProductMation;
//工序重置
$("#procedureChoose").show();
procedureMationList = [];
$("#procedureBody").html("");
//重置成品信息
$("#productName").val(machinPro.materialName);
$("#productModel").val(machinPro.materialModel);
$("#unitList").html(getDataUseHandlebars(selOption, {rows: machinPro.unitList}));
$("#number").val(1);
//重置单据信息
productionMation = {};
$("#productionOrder").val("");
//部门
$("#departmentId").val("");
//移除之前填写的所有行
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();
});
form.render();
});
});
//新增行
$("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
mUnitId: "mUnitId" + rowNum.toString(), //规格id
allStock: "allStock" + 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 + ")");
//表格单位赋值
$("#mUnitId" + thisRowNum.toString()).html(getDataUseHandlebars(selOption, {rows: allChooseProduct[trId].unitList}));
form.render('select');
//计算价格
calculatedTotalPrice();
});
});
//计划加工单选择
$("body").on("click", "#productionOrderSel", function (e) {
_openNewWindows({
url: "../../tpl/erpProduction/erpProductionNoSuccessChooseProcedure.html",
title: "选择生产计划单",
pageId: "erpProductionNoSuccessChooseProcedure",
area: ['90vw', '90vh'],
callBack: function (refreshCode) {
$("#productionOrder").val(productionMation.defaultNumber);
//加工商品信息
machinPro = {
materialId: productionMation.materialId,
materialName: productionMation.materialName,
materialModel: productionMation.materialModel,
unitList: productionMation.unitList
};
$("#productName").val(machinPro.materialName);
$("#productModel").val(machinPro.materialModel);
$("#unitList").html(getDataUseHandlebars(selOption, {rows: machinPro.unitList}));
$("#unitList").val(productionMation.normsId);
$("#number").val(productionMation.number);
//工序
$("#procedureChoose").hide();
procedureMationList = [].concat(productionMation.procedureList);
var str = "";
$.each(procedureMationList, function(i, item) {
str += '<tr><td>' + item.number + '</td><td>' + item.procedureName + '</td><td>' + item.unitPrice + '</td><td>' + item.departmentName + '</td></tr>';
});
$("#procedureBody").html(str);
//部门
$("#departmentId").val(procedureMationList[0].departmentId);
//移除之前填写的所有行
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(productionMation.norms, function(i, item) {
addRow();
//将规格所属的商品信息加入到对象中存储
allChooseProduct["tr" + (rowNum - 1)] = item.product;
//单位回显
$("#mUnitId" + (rowNum - 1)).html(getDataUseHandlebars(selOption, {rows: item.product.unitList}));
$("#mUnitId" + (rowNum - 1)).val(item.normsId);
//商品回显
$("#materialId" + (rowNum - 1)).val(item.product.materialName + "(" + item.product.materialModel + ")");
$("#allStock" + (rowNum - 1)).html(item.allStock);//库存回显
//所需总数量
$("#productionNum" + (rowNum - 1)).html(item.productionNum);
//待分配数量
$("#machinNum" + (rowNum - 1)).html(item.machinNum);
//建议数量
$("#rkNum" + (rowNum - 1)).val(item.machinNum);
$("#unitPrice" + (rowNum - 1)).val(item.unitPrice.toFixed(2));
$("#amountOfMoney" + (rowNum - 1)).val(item.allPrice.toFixed(2));
});
//渲染
form.render();
//计算价格
calculatedTotalPrice();
}});
});
// 取消
$("body").on("click", "#cancle", function() {
parent.layer.close(index);
});
});
});
\ No newline at end of file
......@@ -60,7 +60,7 @@ layui.config({
table.on('tool(messageTable)', function (obj) {
var data = obj.data;
var layEvent = obj.event;
if (layEvent === 'del') { // 删除
if (layEvent === 'delete') { // 删除
del(data);
} else if (layEvent === 'details') { // 详情
details(data);
......@@ -115,7 +115,7 @@ layui.config({
// 删除
function del(data) {
layer.confirm(systemLanguage["com.skyeye.deleteOperationMsg"][languageType], {icon: 3, title: systemLanguage["com.skyeye.deleteOperation"][languageType]}, function (index) {
AjaxPostUtil.request({url: sysMainMation.erpBasePath + "erpmachin005", params: {id: data.id}, type: 'json', method: 'DELETE', callback: function (json) {
AjaxPostUtil.request({url: sysMainMation.erpBasePath + "deleteMachinById", params: {id: data.id}, type: 'json', method: 'DELETE', callback: function (json) {
winui.window.msg(systemLanguage["com.skyeye.deleteOperationSuccessMsg"][languageType], {icon: 1, time: 2000});
loadTable();
}});
......@@ -143,7 +143,7 @@ layui.config({
function revoke(data) {
layer.confirm('确认撤销该申请吗?', { icon: 3, title: '撤销操作' }, function (index) {
layer.close(index);
AjaxPostUtil.request({url: sysMainMation.erpBasePath + "revokeProduction", params: {processInstanceId: data.processInstanceId}, type: 'json', method: "PUT", callback: function (json) {
AjaxPostUtil.request({url: sysMainMation.erpBasePath + "revokeMachin", params: {processInstanceId: data.processInstanceId}, type: 'json', method: "PUT", callback: function (json) {
winui.window.msg("提交成功", {icon: 1, time: 2000});
loadTable();
}});
......
......@@ -59,7 +59,7 @@ layui.config({
table.on('tool(messageTable)', function (obj) {
var data = obj.data;
var layEvent = obj.event;
if (layEvent === 'del') { //删除
if (layEvent === 'delete') { //删除
del(data, obj);
} else if (layEvent === 'edit') { //编辑
edit(data);
......
......@@ -10,7 +10,7 @@ layui.config({
var $ = layui.$,
form = layui.form,
table = layui.table;
// 组件使用
var chooseMation = {};
table.render({
......@@ -82,7 +82,7 @@ layui.config({
time: 500,
title: ["选择计划单", "选择工序"]
});
// 下一步
$("body").on("click", "#nextTab", function() {
if (isNull(chooseMation.id)) {
......@@ -90,7 +90,8 @@ layui.config({
return false;
}
AjaxPostUtil.request({url: sysMainMation.erpBasePath + "queryProductionById", params: {id: chooseMation.id}, type: 'json', method: 'GET', callback: function(json) {
var procedureList = json.bean.productionProcedureList;
chooseMation = json.bean;
var procedureList = [].concat(json.bean.productionProcedureList);
if (!isNull(procedureList)) {
// 加载工序信息
$.each(procedureList, function(i, item) {
......@@ -126,7 +127,7 @@ layui.config({
return false;
}
chooseMation.chooseProcedure = chooseProcedure;
chooseMation.chooseProcedure = getInPoingArr(chooseMation.productionProcedureList, "procedureId", chooseProcedure, "procedureMation");
parent.productionMation = chooseMation;
parent.refreshCode = '0';
parent.layer.close(index);
......
<!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="productName" name="productName" win-verify="required" placeholder="请选择商品" class="layui-input" readonly="readonly"/>
<i class="fa fa-plus-circle input-icon" id="productNameSel"></i>
</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="productionOrder" name="productionOrder" placeholder="请选择生产计划单" class="layui-input" readonly="readonly"/>
<i class="fa fa-plus-circle input-icon" id="productionOrderSel"></i>
</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="productModel" name="productModel" placeholder="请选择商品" class="layui-input" readonly="readonly"/>
</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="unitList" name="unitList" lay-filter="unitList" win-verify="required">
</select>
</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">
<input type="text" id="number" name="number" win-verify="required|number" placeholder="请选择加工数量" class="layui-input" value="1"/>
</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="departmentId" name="departmentId" lay-filter="departmentId" win-verify="required" >
</select>
<div class="layui-form-mid layui-word-aux">该列表为当前用户所在企业的部门列表</div>
</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">
<input type="text" id="starTime" name="starTime" 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">
<input type="text" id="endTime" name="endTime" win-verify="required" placeholder="请选择计划结束时间" class="layui-input"/>
</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-tip alert-info">
直接选择加工商品,系统不会自动加载加工工序信息;通过选择生产计划单操作,系统会自动加载加工工序信息。
</div>
<button type="button" class="layui-btn layui-btn-primary layui-btn-xs" id="procedureChoose">工序选择</button>
<table class="layui-table">
<thead>
<tr>
<th>工序编号</th>
<th>工序名称</th>
<th>加工单价</th>
<th>加工部门</th>
</tr>
</thead>
<tbody id="procedureBody">
</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-xs12">
<label class="layui-form-label">列表项<i class="red">*</i></label>
<div class="layui-input-block">
<div class="winui-tip alert-info">
直接选择加工商品,系统不会自动加载工序物料信息;通过选择生产计划单操作,系统会自动加载工序物料信息。
</div>
<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: 80px;">所需总数量</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="{{mUnitId}}" lay-filter="selectUnitProperty" lay-search win-verify="required"></select></td>
<td id="{{allStock}}"></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/erpMachin/'}).use('erpMachinAdd');
</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="height: 100%">
<div class="layui-tab">
<ul class="layui-tab-title">
<li class="layui-this" id="orderMationLi">订单信息</li>
</ul>
<div class="layui-tab-content">
<div class="layui-tab-item layui-show">
<form class="layui-form" action="" id="showForm">
</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>
</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-xs6">
<label class="layui-form-label">加工单单号</label>
<div class="layui-input-block ver-center">
{{orderNum}}
</div>
</div>
<div class="layui-form-item layui-col-xs6">
<label class="layui-form-label">条形码</label>
<div class="layui-input-block ver-center">
<img class="barCode" src="{{barCode}}" style="width: 150px;"/>
</div>
</div>
<div class="layui-form-item layui-col-xs6">
<label class="layui-form-label">加工商品</label>
<div class="layui-input-block ver-center">
{{normMation.materialName}}
</div>
</div>
<div class="layui-form-item layui-col-xs6">
<label class="layui-form-label">生产计划单</label>
<div class="layui-input-block ver-center">
{{productionNumber}}
</div>
</div>
<div class="layui-form-item layui-col-xs6">
<label class="layui-form-label">商品型号</label>
<div class="layui-input-block ver-center">
{{normMation.materialModel}}
</div>
</div>
<div class="layui-form-item layui-col-xs6">
<label class="layui-form-label">计量单位</label>
<div class="layui-input-block ver-center">
{{normMation.unitName}}
</div>
</div>
<div class="layui-form-item layui-col-xs6">
<label class="layui-form-label">加工数量</label>
<div class="layui-input-block ver-center">
{{needNum}}
</div>
</div>
<div class="layui-form-item layui-col-xs6">
<label class="layui-form-label">部门</label>
<div class="layui-input-block ver-center">
{{departmentName}}
</div>
</div>
<div class="layui-form-item layui-col-xs6">
<label class="layui-form-label">计划开始时间</label>
<div class="layui-input-block ver-center">
{{startTime}}
</div>
</div>
<div class="layui-form-item layui-col-xs6">
<label class="layui-form-label">计划结束时间</label>
<div class="layui-input-block ver-center">
{{endTime}}
</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-xs6">
<label class="layui-form-label">工序资料</label>
<div class="layui-input-block">
<table class="layui-table" style="table-layout:fixed">
<thead>
<tr>
<th style="width: 60px;">工序编号</th>
<th style="width: 80px;">工序名称</th>
<th style="width: 60px;">加工单价</th>
<th style="width: 80px;">加工部门</th>
<th style="width: 60px;">验收数</th>
<th style="width: 60px;">合格数</th>
<th style="width: 60px;">不合格数</th>
<th style="width: 100px; text-align: center;">条形码</th>
<th style="width: 60px; text-align: center;">状态</th>
<th style="width: 80px; text-align: center;">操作</th>
</tr>
</thead>
<tbody id="procedureBody">
{{#each procedure}}
<tr>
<td>{{number}}</td>
<td>{{procedureName}}</td>
<td>{{unitPrice}}</td>
<td>{{departmentName}}</td>
<td>{{needNum}}</td>
<td>{{acceptNum}}</td>
<td>{{belowNum}}</td>
<td><img class="barCode" src="{{barCode}}" style="width: 150px;"/></td>
<td>{{{stateName}}}</td>
<td>{{{operator}}}</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-xs12">
<label class="layui-form-label">列表项</label>
<div class="layui-input-block">
<table class="layui-table" style="table-layout:fixed">
<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">
{{#each material}}
<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/erpMachin/'}).use('erpMachinDetails');
</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="productName" name="productName" win-verify="required" placeholder="请选择商品" class="layui-input" readonly="readonly"/>
<i class="fa fa-plus-circle input-icon" id="productNameSel"></i>
</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="productionOrder" name="productionOrder" placeholder="请选择生产计划单" class="layui-input" readonly="readonly"/>
<i class="fa fa-plus-circle input-icon" id="productionOrderSel"></i>
</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="productModel" name="productModel" placeholder="请选择商品" class="layui-input" readonly="readonly"/>
</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="unitList" name="unitList" lay-filter="unitList" win-verify="required">
</select>
</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">
<input type="text" id="number" name="number" win-verify="required|number" placeholder="请选择加工数量" class="layui-input" value="1"/>
</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="departmentId" name="departmentId" lay-filter="departmentId" win-verify="required" >
</select>
<div class="layui-form-mid layui-word-aux">该列表为当前用户所在企业的部门列表</div>
</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">
<input type="text" id="starTime" name="starTime" 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">
<input type="text" id="endTime" name="endTime" win-verify="required" placeholder="请选择计划结束时间" class="layui-input"/>
</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-tip alert-info">
直接选择加工商品,系统不会自动加载加工工序信息;通过选择生产计划单操作,系统会自动加载加工工序信息。
</div>
<button type="button" class="layui-btn layui-btn-primary layui-btn-xs" id="procedureChoose">工序选择</button>
<table class="layui-table">
<thead>
<tr>
<th>工序编号</th>
<th>工序名称</th>
<th>加工单价</th>
<th>加工部门</th>
</tr>
</thead>
<tbody id="procedureBody">
</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-xs12">
<label class="layui-form-label">列表项<i class="red">*</i></label>
<div class="layui-input-block">
<div class="winui-tip alert-info">
直接选择加工商品,系统不会自动加载工序物料信息;通过选择生产计划单操作,系统会自动加载工序物料信息。
</div>
<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: 80px;">所需总数量</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="formEditBean"><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="{{mUnitId}}" lay-filter="selectUnitProperty" lay-search win-verify="required"></select></td>
<td id="{{allStock}}"></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/erpMachin/'}).use('erpMachinEdit');
</script>
</body>
</html>
\ No newline at end of file
......@@ -29,7 +29,7 @@
{{# } }}
{{# } }}
{{# if(d.editRow == 2) { }}
{{# if(auth('')) { }}
{{# if(auth('1696385978429')) { }}
<a class="layui-btn layui-btn-xs layui-btn-danger" lay-event="revoke">撤销</a>
{{# } }}
{{# } }}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册