|
|
@ -69,9 +69,9 @@ |
|
|
<a class="layui-btn layui-btn-xs data-count-edit" lay-event="applicationOut">出库申请</a> |
|
|
<a class="layui-btn layui-btn-xs data-count-edit" lay-event="applicationOut">出库申请</a> |
|
|
</script> |
|
|
</script> |
|
|
|
|
|
|
|
|
|
|
|
<!-- 用于计量单位的展示--> |
|
|
<script id="selectManager" type="text/html"> |
|
|
<script id="changeUnit" type="text/html"> |
|
|
|
|
|
<button class="layui-btn layui-btn-primary layui-btn-xs" lay-event="changeUnit" click_num="0" id="btn_{{d.id}}" value="{{d.unit}}">{{d.unit}}</button> |
|
|
</script> |
|
|
</script> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
@ -79,6 +79,7 @@ |
|
|
<script> |
|
|
<script> |
|
|
var data; |
|
|
var data; |
|
|
function changePlaceCode(){} |
|
|
function changePlaceCode(){} |
|
|
|
|
|
function changeUnit(){} |
|
|
layui.use(['form', 'table', 'upload'], function () { |
|
|
layui.use(['form', 'table', 'upload'], function () { |
|
|
var $ = layui.jquery, |
|
|
var $ = layui.jquery, |
|
|
form = layui.form, |
|
|
form = layui.form, |
|
|
@ -139,7 +140,8 @@ |
|
|
{field: 'version', width: 200, title: '规格型号'}, |
|
|
{field: 'version', width: 200, title: '规格型号'}, |
|
|
{field: 'code', width: 200, title: '存货编码'}, |
|
|
{field: 'code', width: 200, title: '存货编码'}, |
|
|
{field: 'typeName', width: 200, title: '物料类型'}, |
|
|
{field: 'typeName', width: 200, title: '物料类型'}, |
|
|
{field: 'showQuantity', width: 200, title: '数量'}, |
|
|
{title: '计量单位', width: 200, templet: '#changeUnit', align: "center"}, |
|
|
|
|
|
{field: 'quantity', width: 200, title: '数量'}, |
|
|
{field: 'depositoryName', width: 200, title: '仓库名称'}, |
|
|
{field: 'depositoryName', width: 200, title: '仓库名称'}, |
|
|
{field: 'depositoryCode', width: 200, title: '仓库编码'}, |
|
|
{field: 'depositoryCode', width: 200, title: '仓库编码'}, |
|
|
{title: '所处库位', width: 200, templet: '#selectManager', align: "center"}, |
|
|
{title: '所处库位', width: 200, templet: '#selectManager', align: "center"}, |
|
|
@ -159,6 +161,7 @@ |
|
|
let jElement = j['warningCount']; |
|
|
let jElement = j['warningCount']; |
|
|
let placeCode = j['placeCode'].split(" "); |
|
|
let placeCode = j['placeCode'].split(" "); |
|
|
let depositoryId = j['depositoryId']; |
|
|
let depositoryId = j['depositoryId']; |
|
|
|
|
|
let unit = j['unit']; |
|
|
let mid = j['id']; |
|
|
let mid = j['id']; |
|
|
if (jElement !== null && jElement !== undefined) { |
|
|
if (jElement !== null && jElement !== undefined) { |
|
|
let flag = (Number(jElement) !== 0); |
|
|
let flag = (Number(jElement) !== 0); |
|
|
@ -169,14 +172,18 @@ |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
// 所处库位 |
|
|
// 所处库位 |
|
|
var placeCodeItem = $("[lay-id='currentTableId'] tr:eq(" + (i+1) + ")").children()[8]; |
|
|
var placeCodeItem = $("[lay-id='currentTableId'] tr:eq(" + (i+1) + ")").children()[9]; |
|
|
|
|
|
//计量单位 |
|
|
|
|
|
// 用于库位的添加 |
|
|
var aItem = placeCodeItem.childNodes[0]; |
|
|
var aItem = placeCodeItem.childNodes[0]; |
|
|
|
|
|
// 用于计量单位的添加 |
|
|
for (let k = 0; k < placeCode.length; k++) { |
|
|
for (let k = 0; k < placeCode.length; k++) { |
|
|
if(placeCode[k] !== ""){ |
|
|
if(placeCode[k] !== ""){ |
|
|
$(aItem).append('<button id='+mid+' class="layui-btn layui-btn-primary layui-btn-xs" onclick="changePlaceCode(this)" value='+depositoryId+'>'+placeCode[k]+'</button>') |
|
|
$(aItem).append('<button id='+mid+' class="layui-btn layui-btn-primary layui-btn-xs" onclick="changePlaceCode(this)" value='+depositoryId+'>'+placeCode[k]+'</button>') |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
@ -344,6 +351,28 @@ |
|
|
}); |
|
|
}); |
|
|
return false; |
|
|
return false; |
|
|
} |
|
|
} |
|
|
|
|
|
else if (obj.event === 'changeUnit') { |
|
|
|
|
|
let splitInfoList = data.splitInfoList; |
|
|
|
|
|
let btn = $("#btn_"+data.id); |
|
|
|
|
|
let clickNum = Number(btn.attr("click_num")); |
|
|
|
|
|
if(splitInfoList.length > 0){ |
|
|
|
|
|
if(clickNum < splitInfoList.length){ |
|
|
|
|
|
let newUnit = splitInfoList[clickNum].newUnit; |
|
|
|
|
|
btn.text(newUnit); |
|
|
|
|
|
clickNum += 1; |
|
|
|
|
|
btn.attr("click_num",clickNum); |
|
|
|
|
|
let showQuantity = data.showQuantity[newUnit]; |
|
|
|
|
|
obj.update({quantity:showQuantity}); |
|
|
|
|
|
}else{ |
|
|
|
|
|
btn.text(data.unit); |
|
|
|
|
|
btn.attr("click_num",0); |
|
|
|
|
|
let showQuantity = data.showQuantity[data.unit]; |
|
|
|
|
|
obj.update({quantity:showQuantity}); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
changePlaceCode = function (obj) { |
|
|
changePlaceCode = function (obj) { |
|
|
|