|
|
@ -6,6 +6,8 @@ |
|
|
|
<body class="white-bg"> |
|
|
|
<div class="wrapper wrapper-content animated fadeInRight ibox-content"> |
|
|
|
<form class="form-horizontal m" id="form-afterNoConfirmSupplier-edit" th:object="${qualityRefundsExchanges}"> |
|
|
|
<input name="refundsExchangesId" th:field="*{refundsExchangesId}" type="hidden"> |
|
|
|
<input name="inStorageCode" th:field="*{inStorageCode}" type="hidden"> |
|
|
|
<div class="form-group"> |
|
|
|
<label class="col-sm-3 control-label">退换货单号:</label> |
|
|
|
<div class="col-sm-8"> |
|
|
@ -13,17 +15,17 @@ |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="form-group"> |
|
|
|
<label class="col-sm-3 control-label">关联单号:</label> |
|
|
|
<label class="col-sm-3 control-label">入库类型:</label> |
|
|
|
<div class="col-sm-8"> |
|
|
|
<input name="relatedOrderCode" th:field="*{relatedOrderCode}" class="form-control" type="text" disabled> |
|
|
|
<select name="warehouseStorageType" class="form-control m-b" th:with="type=${@dict.getType('warehouse_storage_type')}" disabled> |
|
|
|
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{warehouseStorageType}"></option> |
|
|
|
</select> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="form-group"> |
|
|
|
<label class="col-sm-3 control-label">品质单入库类型:</label> |
|
|
|
<label class="col-sm-3 control-label">品质备注:</label> |
|
|
|
<div class="col-sm-8"> |
|
|
|
<select name="warehouseStorageType" class="form-control m-b" th:with="type=${@dict.getType('warehouse_storage_type')}" disabled> |
|
|
|
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{warehouseStorageType}"></option> |
|
|
|
</select> |
|
|
|
<input name="qualityRemark" th:field="*{qualityRemark}" class="form-control" type="text" disabled> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</form> |
|
|
@ -42,7 +44,10 @@ |
|
|
|
var refundsExchangesCode = [[${qualityRefundsExchanges.refundsExchangesCode}]] |
|
|
|
|
|
|
|
var qualityRefundsExchanges = [[${qualityRefundsExchanges}]]; |
|
|
|
var processMethodDatas = [[${@dict.getType('processMethod')}]]; |
|
|
|
var materialTypeDatas = [[${@category.getChildByCode('materialType')}]]; |
|
|
|
|
|
|
|
var supplier = []; |
|
|
|
var $table = $("#bootstrap-table"); |
|
|
|
|
|
|
|
var prefix = ctx + "quality/refundsExchanges"; |
|
|
@ -50,18 +55,12 @@ |
|
|
|
focusCleanup: true |
|
|
|
}); |
|
|
|
|
|
|
|
// function submitHandler() { |
|
|
|
// if ($.validate.form()) { |
|
|
|
// $.operate.save(prefix + "/returnBeforeStorageDetail", $('#form-qualityRefundsExchanges-edit').serialize()); |
|
|
|
// } |
|
|
|
// } |
|
|
|
|
|
|
|
|
|
|
|
// 新增提交 |
|
|
|
function submitHandler() { |
|
|
|
// 获取表单数据 |
|
|
|
// const afterNoConfirmSupplierData = $("#form-afterNoConfirmSupplier-edit").serializeArray(); |
|
|
|
// 获取表单数据 |
|
|
|
|
|
|
|
$("input[name='refundsExchangesCode']").removeAttr("disabled"); |
|
|
|
$("input[name='qualityRemark']").removeAttr("disabled"); |
|
|
|
|
|
|
|
const afterNoConfirmSupplierData = $("#form-afterNoConfirmSupplier-edit").serializeArray().reduce((obj, item) => { |
|
|
|
obj[item.name] = item.value; |
|
|
|
return obj; |
|
|
@ -121,65 +120,77 @@ |
|
|
|
checkbox: true |
|
|
|
}, |
|
|
|
{ |
|
|
|
title: '供应商ID', |
|
|
|
field: 'supplierCode', |
|
|
|
title: '退换货详情Id', |
|
|
|
field: 'refundsExchangesDetailId', |
|
|
|
visible: false |
|
|
|
}, |
|
|
|
{ |
|
|
|
title: '退换货详情Id', |
|
|
|
field: 'refundsExchangesDetailId', |
|
|
|
title: '退换货单号', |
|
|
|
field: 'refundsExchangesCode', |
|
|
|
visible: false |
|
|
|
}, |
|
|
|
{ |
|
|
|
title: '料号', |
|
|
|
field: 'materialNo' |
|
|
|
}, { |
|
|
|
}, |
|
|
|
{ |
|
|
|
title: '图片', |
|
|
|
field: 'materialPhotourl', |
|
|
|
formatter: function(value, row, index) { |
|
|
|
return $.table.imageView(value); |
|
|
|
} |
|
|
|
}, |
|
|
|
{ |
|
|
|
title: '物料名称', |
|
|
|
field: 'materialName' |
|
|
|
}, |
|
|
|
{ |
|
|
|
title: '物料类型', |
|
|
|
field: 'materialType', |
|
|
|
}, |
|
|
|
{ |
|
|
|
title: '物料图片地址', |
|
|
|
field: 'materialPhotourl', |
|
|
|
formatter: function(value, row, index) { |
|
|
|
return $.table.selectCategoryLabel(materialTypeDatas, value); |
|
|
|
} |
|
|
|
}, |
|
|
|
{ |
|
|
|
title: '物料描述', |
|
|
|
field: 'materialDescribe', |
|
|
|
}, |
|
|
|
{ |
|
|
|
title: '物料品牌', |
|
|
|
title: '品牌', |
|
|
|
field: 'materialBrand', |
|
|
|
}, |
|
|
|
{ |
|
|
|
title: '物料单位', |
|
|
|
title: '单位', |
|
|
|
field: 'materialUnit', |
|
|
|
}, |
|
|
|
{ |
|
|
|
title: '物料加工方式', |
|
|
|
title: '加工方式', |
|
|
|
field: 'materialProcessMethod', |
|
|
|
formatter: function(value, row, index) { |
|
|
|
return $.table.selectDictLabel(processMethodDatas, value); |
|
|
|
} |
|
|
|
}, |
|
|
|
{ |
|
|
|
title: '订单数', |
|
|
|
field: 'makeTotal', |
|
|
|
visible: false |
|
|
|
}, |
|
|
|
{ |
|
|
|
title: '品质已合格数', |
|
|
|
field: 'qualityHasqualifiedNum', |
|
|
|
visible: false |
|
|
|
}, |
|
|
|
{ |
|
|
|
title: '本次到货数', |
|
|
|
field: 'thisArrivedNum', |
|
|
|
visible: false |
|
|
|
}, |
|
|
|
{ |
|
|
|
title: '品质报告', |
|
|
|
align: 'center', |
|
|
|
formatter: function(value, row, index) { |
|
|
|
// 这里直接使用row对象获取supplierCode,假设它是存在的 |
|
|
|
var actions = []; |
|
|
|
actions.push('<a class="btn btn-success btn-xs" href="javascript:void(0)" onclick="qualityReport(\'' + row.materialNo + '\', \'' + row.supplierCode + '\')"><i class="fa fa-plus"></i>报告</a> '); |
|
|
|
actions.push('<a class="btn btn-success btn-xs" href="javascript:void(0)" onclick="qualityReport(\'' + row.materialNo + '\', \'' + row.refundsExchangesCode + '\')">报告</a> '); |
|
|
|
return actions.join(''); |
|
|
|
} |
|
|
|
}, |
|
|
@ -244,6 +255,7 @@ |
|
|
|
codes.forEach(function (code) { |
|
|
|
selectElement.append('<option value="' + code.supplierCode + '">' + code.supplierCode + '</option>'); |
|
|
|
}); |
|
|
|
supplier = codes; |
|
|
|
// 设置默认值(如果存在) |
|
|
|
var rowData = $table.bootstrapTable('getData')[index]; |
|
|
|
if (rowData && rowData.supplierCode) { |
|
|
@ -259,6 +271,14 @@ |
|
|
|
var tableData = $table.bootstrapTable('getData'); |
|
|
|
var newRow = tableData[rowIndex]; |
|
|
|
newRow.supplierCode = newSupplierCode; |
|
|
|
supplier.forEach(function (index){ |
|
|
|
if(index.supplierCode === newSupplierCode){ |
|
|
|
newRow.supplierName = index.supplierName; |
|
|
|
newRow.customerContact = index.customerContact; |
|
|
|
newRow.contactNumber = index.contactNumber; |
|
|
|
newRow.supplierAddress = index.customerAddress; |
|
|
|
} |
|
|
|
}); |
|
|
|
// getSupplierNameType(newRow.supplierCode,newRow,rowIndex); |
|
|
|
$table.bootstrapTable('updateRow', {index: rowIndex, row: newRow}); |
|
|
|
|
|
|
@ -293,9 +313,26 @@ |
|
|
|
var tableData = $table.bootstrapTable('getData'); |
|
|
|
var newRow = tableData[rowIndex]; // 获取当前行数据 |
|
|
|
newRow.supplierName = newSupplierName; |
|
|
|
supplier.forEach(function (index){ |
|
|
|
if(index.supplierName === newSupplierName){ |
|
|
|
newRow.customerContact = index.customerContact; |
|
|
|
newRow.contactNumber = index.contactNumber; |
|
|
|
newRow.supplierAddress = index.customerAddress; |
|
|
|
} |
|
|
|
}); |
|
|
|
// 更新行数据 |
|
|
|
$table.bootstrapTable('updateRow', {index: rowIndex, row: newRow}); |
|
|
|
} |
|
|
|
|
|
|
|
function qualityReport(materialNo, refundsExchangesCode) { |
|
|
|
var queryParams = new URLSearchParams(); |
|
|
|
queryParams.append('materialNo', materialNo); |
|
|
|
queryParams.append('refundsExchangesCode', encodeURIComponent(refundsExchangesCode)); |
|
|
|
console.log("materialNo:"+materialNo); |
|
|
|
console.log("refundsExchangesCode:"+refundsExchangesCode); |
|
|
|
var url = ctx + 'quality/refundsExchanges/afterQualityReportDetail?' + queryParams.toString(); |
|
|
|
$.modal.open("品质报告详情", url); |
|
|
|
} |
|
|
|
</script> |
|
|
|
</body> |
|
|
|
</html> |