@ -19,13 +19,13 @@
<!-- </div> -->
<!-- </div> -->
< div class = "form-group" >
< label class = "col-sm-3 control-label is-required" > 申请部门:< / label >
< label class = "col-sm-4 control-label is-required" > 申请部门:< / label >
< div class = "col-sm-8" >
< select id = "applyDept" name = "applyDept" class = "form-control" type = "text" required disabled > < / select >
< / div >
< / div >
< div class = "form-group" >
< label class = "col-sm-3 control-label is-required" > 申请时间:< / label >
< label class = "col-sm-4 control-label is-required" > 申请时间:< / label >
< div class = "col-sm-8" >
< div class = "input-group date" >
< input name = "applyTime" class = "form-control" placeholder = "yyyy-MM-dd" type = "text" required >
@ -34,7 +34,7 @@
< / div >
< / div >
< div class = "form-group" >
< label class = "col-sm-3 control-label is-required" > 是否关联生产单号:< / label >
< label class = "col-sm-4 control-label is-required" > 是否关联生产单号:< / label >
< div class = "col-sm-8" >
<!-- <div class="radio - box" th:each="dict : ${@dict.getType('yes_or_no')}"> -->
<!-- <input type="radio" th:id="${'whetherMakeNo_' + dict.dictCode}" name="whetherMakeNo" th:value="${dict.dictValue}" th:checked="${dict.default}"> -->
@ -49,13 +49,15 @@
< / div >
< / div >
< div class = "form-group" id = "makeNoInput" >
< label class = "col-sm-3 control-label is-required" > 关联生产单号:< / label >
< label class = "col-sm-4 control-label is-required" > 关联生产单号:< / label >
< div class = "col-sm-8" >
< input name = "makeNo" class = "form-control" type = "text" required >
<!-- <input name="makeNo" class="form - control" type="text" required> -->
< select name = "makeNo" id = "selectMakeNo" class = "form-control select2-multiple" type = "text" required >
< / select >
< / div >
< / div >
< div class = "form-group" >
< label class = "col-sm-3 control-label is-required" > 仓库名称:< / label >
< label class = "col-sm-4 control-label is-required" > 仓库名称:< / label >
< div class = "col-sm-8" >
< select id = "stockNameSelct" name = "warehouseName" class = "form-control" type = "text" required >
@ -63,20 +65,20 @@
< / div >
< / div >
< div class = "form-group is-required" >
< label class = "col-sm-3 control-label is-required" > 仓库ID:< / label >
< label class = "col-sm-4 control-label is-required" > 仓库ID:< / label >
< div class = "col-sm-8" >
< input name = "warehouseCode" class = "form-control" required >
< / div >
< / div >
< div class = "form-group" >
< label class = "col-sm-3 control-label is-required" > 仓库存放地址:< / label >
< label class = "col-sm-4 control-label is-required" > 仓库存放地址:< / label >
< div class = "col-sm-8" >
< input name = "warehouseStoreAddress" class = "form-control" type = "text" required >
< / div >
< / div >
< div class = "form-group" >
< label class = "col-sm-3 control-label" > 备注:< / label >
< label class = "col-sm-4 control-label" > 备注:< / label >
< div class = "col-sm-8" >
< textarea name = "remark" class = "form-control" > < / textarea >
< / div >
@ -124,7 +126,7 @@
var whetherMakeNo = $("input[name='whetherMakeNo']:checked").val();
warehouseInventoryReportDamage.whetherMakeNo = whetherMakeNo;
if(whetherMakeNo === "1"){
var makeNo = $("inpu t[name='makeNo']").val();
var makeNo = $("selec t[name='makeNo']").val();
warehouseInventoryReportDamage.makeNo = makeNo;
}
warehouseInventoryReportDamage.warehouseName = $("select[name='warehouseName']").val();
@ -168,7 +170,8 @@
function insertRow() {
var ifMakeNo = $("input[name='whetherMakeNo']:checked").val();
if(ifMakeNo === "1"){
var makeNo = $("input[name='makeNo']").val();
var makeNo = $("select[name='makeNo']").val();
console.log(makeNo);
if(!makeNo){
$.modal.alertWarning("请输入生产单号!")
}else{
@ -181,7 +184,7 @@
$.modal.openOptions(options);
}
}else{
var url = ctx + 'warehouse/inventoryCheck/materialSelect' ;
var url = ctx + "erp/material/select" ;
var options = {
title: '选择物料',
url: url,
@ -191,35 +194,36 @@
}
}
function doSubmit(index, layero,uniqueId){
// console.log(uniqueId);
var iframeWin = window[layero.find('iframe')[0]['name']];
var rowData = iframeWin.$('#bootstrap-materialSelect-table').bootstrapTable('getSelections')[0];
var rows = $("#bootstrap-table-reportDamage-child").bootstrapTable('getData');
if(rows.length > 0){
for(var i=0;i< rows.length ; i + + ) {
var data = rows[i];
if(data.materialNo == rowData.materialNo){
var rowData = iframeWin.$('#bootstrap-select-table').bootstrapTable('getSelections');
//判断是否重复
var data = $("#bootstrap-table-reportDamage-child").bootstrapTable('getData');
var rows = data.length;
if(rows > 0){
for(var i=0;i< rows ; i + + ) {
for(var j=0;j< rowData.length ; j + + ) {
if(data[i].materialNo===rowData[j].materialNo){
$.modal.alertError("不能选择已添加过的相同物料");
return;
rowData.split(j,1);
break;
}
}
};
insertTable(rowData);
}else{
insertTable(rowData);
}
for(i=0;i< rowData.length ; i + + ) {
insertTable(rowData[i] );
}
layer.close(index);
}
function insertTable(rowData){
$("#bootstrap-table-reportDamage-child").bootstrapTable('insertRow', {
index:1,
row: {
var newRow = {
materialNo:rowData.materialNo,
materialName: rowData.materialName,
materialType: rowData.materialType,
materialBrand: rowData.materialB rand,
materialBrand: rowData.b rand,
materialPhotourl: rowData.materialPhotourl,
materialDescribe: rowData.materialD escribe,
materialUnit: rowData.materialU nit,
materialDescribe: rowData.d escribe,
materialUnit: rowData.u nit,
actualScrapQuantity: "",
scrapType: "",
scrapDetail: "",
@ -228,7 +232,7 @@
responsibleUnit: "",
remark : ""
}
})
$("#bootstrap-table-reportDamage-child").bootstrapTable('append',newRow);
}
// 逻辑删除前端的一行数据
@ -240,6 +244,11 @@
var options = {
id : 'bootstrap-table-reportDamage-child',
modalName: "仓库库存报损物料信息",
showColumns: false,
showSearch: false,
showRefresh:false,
showToggle:false,
width: 1000,
columns: [
{title: '库存报损id', field: 'reportDamageChildId', visible: false},
{title: '报损单号', field: 'reportDamageCode',visible: false},
@ -314,6 +323,7 @@
};
$.table.init(options);
loadWarehouseCodes();
loadMakeNo();
changeWhetherMakeNo();
getDeptName();
//单选改变是否关联生产单号显示关联生产单号输入框
@ -383,6 +393,31 @@
});
}
function loadMakeNo() {
var options = [];
options.push({id: '',text: '',value: ''})
$.ajax({
url: ctx + 'system/makeorder/getAllMakeNos',
type: "GET",
dataType: "json",
success: function (result) {
if (result != null) {
result.forEach(function (re){
var option = {};
option.id = re.makeNo;
option.text = re.makeNo;
option.value = re.makeNo;
options.push(option);
});
$("#selectMakeNo").select2({
data: options,
});
} else {
$.modal.msgError("生产订单编号获取失败!");
}
}
});
}
function getDeptName(){
$.ajax({
url: prefix + "/getUserDeptName",