提交 3db12c4c 编写于 作者: Skyeye云's avatar Skyeye云

加工单模块整改

上级 1611858a
......@@ -50,7 +50,7 @@ layui.config({
//商品规格加载变化事件
form.on('select(selectUnitProperty)', function(data) {
var thisRowValue = data.value;
var thisRowNum = data.elem.id.replace("unitId", "");//获取当前行
var thisRowNum = data.elem.id.replace("mUnitId", "");//获取当前行
//当前当前行选中的商品信息
if (!isNull(thisRowValue) && thisRowValue != '请选择') {
var product = allChooseProduct["tr" + thisRowNum.toString()];
......@@ -104,14 +104,14 @@ layui.config({
}
// 商品对象
var product = allChooseProduct["tr" + rowNum.toString()];
if(inTableDataArrayByAssetarId(product.productId, $("#unitId" + rowNum).val(), tableData)) {
if(inTableDataArrayByAssetarId(product.productId, $("#mUnitId" + rowNum).val(), tableData)) {
winui.window.msg('一张单中不允许出现相同单位的商品信息.', {icon: 2, time: 2000});
noError = true;
return false;
}
var row = {
materialId: product.productId,
mUnitId: $("#unitId" + rowNum).val(),
mUnitId: $("#mUnitId" + rowNum).val(),
rkNum: rkNum.val(),
unitPrice: $("#unitPrice" + rowNum).val()
};
......@@ -209,7 +209,7 @@ layui.config({
id: "row" + rowNum.toString(), //checkbox的id
trId: "tr" + rowNum.toString(), //行的id
materialId: "materialId" + rowNum.toString(), //商品id
unitId: "unitId" + rowNum.toString(), //规格id
mUnitId: "mUnitId" + rowNum.toString(), //规格id
currentTock: "currentTock" + rowNum.toString(), //库存id
productionNum: "productionNum" + rowNum.toString(), //所需总数量id
machinNum: "machinNum" + rowNum.toString(), //待分配数量id
......@@ -251,7 +251,7 @@ layui.config({
//表格商品名称赋值
$("#materialId" + thisRowNum.toString()).val(allChooseProduct[trId].productName + "(" + allChooseProduct[trId].productModel + ")");
//表格单位赋值
$("#unitId" + thisRowNum.toString()).html(getDataUseHandlebars(selOption, {rows: allChooseProduct[trId].unitList}));
$("#mUnitId" + thisRowNum.toString()).html(getDataUseHandlebars(selOption, {rows: allChooseProduct[trId].unitList}));
form.render('select');
//计算价格
calculatedTotalPrice();
......@@ -306,8 +306,8 @@ layui.config({
//将规格所属的商品信息加入到对象中存储
allChooseProduct["tr" + (rowNum - 1)] = item.product;
//单位回显
$("#unitId" + (rowNum - 1)).html(getDataUseHandlebars(selOption, {rows: item.product.unitList}));
$("#unitId" + (rowNum - 1)).val(item.normsId);
$("#mUnitId" + (rowNum - 1)).html(getDataUseHandlebars(selOption, {rows: item.product.unitList}));
$("#mUnitId" + (rowNum - 1)).val(item.normsId);
//商品回显
$("#materialId" + (rowNum - 1)).val(item.product.productName + "(" + item.product.productModel + ")");
$("#currentTock" + (rowNum - 1)).html(item.currentTock);//库存回显
......
......@@ -48,9 +48,9 @@ layui.config({
loadData();
function loadData(){
AjaxPostUtil.request({url:flowableBasePath + "erpmachin003", params: {rowId: parent.rowId}, type: 'json', method: 'POST', callback: function (json) {
AjaxPostUtil.request({url:flowableBasePath + "erpmachin003", params: {id: parent.rowId}, type: 'json', method: 'GET', callback: function (json) {
var data = json.bean;
if (!isNull(data.productionId)){
if (!isNull(data.productionId)) {
$("#productionOrder").val(data.productionNumber);
$("#procedureChoose").hide();
productionMation = {
......@@ -61,7 +61,7 @@ layui.config({
machinPro = {
productId: data.materialId,
productName: data.materialName,
productModel: data.productModel,
productModel: data.materialModel,
unitList: data.unitList
};
$("#productName").val(machinPro.productName);
......@@ -84,15 +84,15 @@ layui.config({
$("#endTime").val(data.endTime);
$("#remark").val(data.remark);
$.each(data.materiel, function(i, item) {
$.each(data.material, function(i, item) {
addRow();
//将规格所属的商品信息加入到对象中存储
allChooseProduct["tr" + (rowNum - 1)] = item;
//单位回显
$("#unitId" + (rowNum - 1)).html(getDataUseHandlebars(selOption, {rows: item.unitList}));
$("#unitId" + (rowNum - 1)).val(item.normsId);
$("#mUnitId" + (rowNum - 1)).html(getDataUseHandlebars(selOption, {rows: item.unitList}));
$("#mUnitId" + (rowNum - 1)).val(item.normsId);
//商品回显
$("#materialId" + (rowNum - 1)).val(item.productName + "(" + item.productModel + ")");
$("#materialId" + (rowNum - 1)).val(item.materialName + "(" + item.materialModel + ")");
$("#currentTock" + (rowNum - 1)).html(item.currentTock);//库存回显
$.each(data.referToMation, function(j, bean){
if(bean.normsId == item.normsId){
......@@ -118,7 +118,7 @@ layui.config({
//商品规格加载变化事件
form.on('select(selectUnitProperty)', function(data) {
var thisRowValue = data.value;
var thisRowNum = data.elem.id.replace("unitId", "");//获取当前行
var thisRowNum = data.elem.id.replace("mUnitId", "");//获取当前行
//当前当前行选中的商品信息
if (!isNull(thisRowValue) && thisRowValue != '请选择') {
var product = allChooseProduct["tr" + thisRowNum.toString()];
......@@ -171,14 +171,14 @@ layui.config({
}
//商品对象
var product = allChooseProduct["tr" + rowNum.toString()];
if(inTableDataArrayByAssetarId(product.productId, $("#unitId" + rowNum).val(), tableData)) {
if(inTableDataArrayByAssetarId(product.productId, $("#mUnitId" + rowNum).val(), tableData)) {
winui.window.msg('一张单中不允许出现相同单位的商品信息.', {icon: 2, time: 2000});
noError = true;
return false;
}
var row = {
materialId: product.productId,
mUnitId: $("#unitId" + rowNum).val(),
mUnitId: $("#mUnitId" + rowNum).val(),
rkNum: rkNum.val(),
unitPrice: $("#unitPrice" + rowNum).val()
};
......@@ -277,7 +277,7 @@ layui.config({
id: "row" + rowNum.toString(), //checkbox的id
trId: "tr" + rowNum.toString(), //行的id
materialId: "materialId" + rowNum.toString(), //商品id
unitId: "unitId" + rowNum.toString(), //规格id
mUnitId: "mUnitId" + rowNum.toString(), //规格id
currentTock: "currentTock" + rowNum.toString(), //库存id
productionNum: "productionNum" + rowNum.toString(), //所需总数量id
machinNum: "machinNum" + rowNum.toString(), //待分配数量id
......@@ -319,7 +319,7 @@ layui.config({
//表格商品名称赋值
$("#materialId" + thisRowNum.toString()).val(allChooseProduct[trId].productName + "(" + allChooseProduct[trId].productModel + ")");
//表格单位赋值
$("#unitId" + thisRowNum.toString()).html(getDataUseHandlebars(selOption, {rows: allChooseProduct[trId].unitList}));
$("#mUnitId" + thisRowNum.toString()).html(getDataUseHandlebars(selOption, {rows: allChooseProduct[trId].unitList}));
form.render('select');
//计算价格
calculatedTotalPrice();
......@@ -374,8 +374,8 @@ layui.config({
//将规格所属的商品信息加入到对象中存储
allChooseProduct["tr" + (rowNum - 1)] = item.product;
//单位回显
$("#unitId" + (rowNum - 1)).html(getDataUseHandlebars(selOption, {rows: item.product.unitList}));
$("#unitId" + (rowNum - 1)).val(item.normsId);
$("#mUnitId" + (rowNum - 1)).html(getDataUseHandlebars(selOption, {rows: item.product.unitList}));
$("#mUnitId" + (rowNum - 1)).val(item.normsId);
//商品回显
$("#materialId" + (rowNum - 1)).val(item.product.productName + "(" + item.product.productModel + ")");
$("#currentTock" + (rowNum - 1)).html(item.currentTock);//库存回显
......
......@@ -5,10 +5,8 @@ layui.config({
}).extend({
window: 'js/winui.window'
}).define(['window', 'table', 'jquery', 'winui', 'form', 'tableCheckBoxUtil'], function (exports) {
winui.renderColor();
var index = parent.layer.getFrameIndex(window.name);
var $ = layui.$,
form = layui.form,
table = layui.table,
......
......@@ -149,7 +149,7 @@
<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><select id="{{mUnitId}}" 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>
......
......@@ -64,7 +64,7 @@
<div class="layui-form-item layui-col-xs6">
<label class="layui-form-label">商品型号</label>
<div class="layui-input-block ver-center">
{{productModel}}
{{materialModel}}
</div>
</div>
<div class="layui-form-item layui-col-xs6">
......
......@@ -149,7 +149,7 @@
<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><select id="{{mUnitId}}" 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>
......
......@@ -46,7 +46,7 @@
<div class="layui-form-item layui-col-xs6">
<label class="layui-form-label">商品型号</label>
<div class="layui-input-block ver-center">
{{productModel}}
{{materialModel}}
</div>
</div>
<div class="layui-form-item layui-col-xs6">
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册