万材erp项目
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

365 lines
12 KiB

<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
<th:block th:include="include :: header('修改物料清单')"/>
<th:block th:include="include :: datetimepicker-css"/>
<th:block th:include="include :: bootstrap-editable-css"/>
<style>
</style>
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<div class="row">
<div class="col-sm-12" th:object="${bom}">
<form class="form-horizontal m" id="bomForm">
<div class="form-group">
<label class="col-sm-3 control-label">版本:</label>
<div class="col-sm-8">
<input name="versionNo" th:field="*{versionNo}" class="form-control" type="text" readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">成品代码:</label>
<div class="col-sm-8">
<input name="cpCode" th:field="*{cpCode}" class="form-control" type="text" readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">机种代码:</label>
<div class="col-sm-8">
<input name="cpMachineNo" th:field="*{cpMachineNo}" class="form-control" type="text">
</div>
</div>
</form>
</div>
<div class="col-sm-12 select-table table-striped">
<table id="bootstrap-table"></table>
</div>
</div>
</div>
<th:block th:include="include :: footer"/>
<th:block th:include="include :: datetimepicker-js"/>
<script th:inline="javascript">
var prefix = ctx + "ck/bom";
var editFlag = [[${@permission.hasPermi('ck:bom:edit')}]];
var removeFlag = [[${@permission.hasPermi('ck:bom:remove')}]];
$(function () {
var options = {
url: prefix + "/cpyllist",
createUrl: prefix + "/add",
updateUrl: prefix + "/edit/{versionNo}/{cpCode}",
removeUrl: prefix + "/remove",
exportUrl: prefix + "/export",
modalName: "物料清单",
pageSize: '10',
contentType: "application/x-www-form-urlencoded; charset=UTF-8",
sidePagination: 'server',//设置为服务器端分页
queryParamsType: "",
queryParams: function (params) {
var curParams = {
// 传递参数查询参数
pageSize: params.limit,
pageNum: params.offset / params.limit + 1,
searchValue: params.search,
orderByColumn: params.sort,
isAsc: params.order,
versionNo: $("input[name='versionNo']").val(),
cpCode: $("input[name='cpCode']").val(),
};
var currentId = $.common.isEmpty(table.options.formId) ? $('form').attr('id') : table.options.formId;
return $.extend(curParams, $.common.formToJSON(currentId));
},
columns: [
{
checkbox: true
},
{
field: 'versionNo',
title: '版本号',
visible: false
},
{
field: 'cpCode',
title: '成品代码',
visible: false
},
{
field: 'cpName',
title: '成品名称',
visible: false
},
{
field: 'cpType',
title: '规格型号',
visible: false
},
{
field: 'cpMachineNo',
title: '机种代码'
},
{
field: 'cpDw',
title: '单位',
visible: false
},
{
field: 'wlCode',
title: '原料编号'
},
{
field: 'itemname',
title: '名称'
},
{
field: 'itemstandard',
title: '规格型号'
},
{
field: 'stockDw',
title: '单位'
},
{
field: 'useNum',
title: '原辅料使用量'
},
{
field: 'lostpre',
title: '损耗'
},
{
field: 'zpGuige',
title: '厂商l料号',
visible: false
},
{
field: 'zpUseNum',
title: '成品数量',
visible: false
},
{
field: 'mQty',
title: '',
visible: false
},
{
field: 'memolist',
title: '',
visible: false
},
{
field: 'nowversion',
title: '',
visible: false
},
{
field: 'begindate',
title: '',
visible: false
},
{
field: 'endtime',
title: '',
visible: false
},
{
field: 'wldm',
title: '客户料号',
},
{
field: 'customno',
title: '',
visible: false
},
{
field: 'sendflag',
title: '',
visible: false
},
{
field: 'yDWDH',
title: '',
visible: false
},
{
field: 'zLDWDH',
title: '',
visible: false
},
{
field: 'ylWeight',
title: '',
visible: false
},
{
field: 'zongzhongWeight',
title: '',
visible: false
},
{
field: 'pno',
title: '',
visible: false
},
{
field: 'addtime',
title: '',
visible: false
},
{
field: 'fuWidth',
title: '',
visible: false
},
{
field: 'yflItemclass',
title: '',
visible: false
},
{
field: 'mouldNo',
title: '',
visible: false
},
{
field: 'standNowversion',
title: '',
visible: false
},
{
field: 'comfirmFlag',
title: '',
visible: false
},
{
field: 'comfirmMan',
title: '',
visible: false
},
{
field: 'comfirmDate',
title: '',
visible: false
},
{
field: 'writeMan',
title: '',
visible: false
},
{
field: 'GongCha',
title: '',
visible: false
},
{
field: 'factoryMouldNo',
title: '',
visible: false
},
{
field: 'mainMaterial',
title: '',
visible: false
},
{
field: 'limitFlag',
title: '',
visible: false
},
{
field: 'gongchaMore',
title: '',
visible: false
},
{
field: 'gongchaSmall',
title: '',
visible: false
},
{
field: 'changtime',
title: '',
visible: false
},
{
field: 'cpNum',
title: '',
visible: false
},
{
field: 'worklineclass',
title: '',
visible: false
},
{
title: '操作',
align: 'center',
formatter: function (value, row, index) {
var actions = [];
// actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="edit(\'' + row.versionNo + '\',\'' + row.cpCode + '\')"><i class="fa fa-edit"></i>编辑</a> ');
actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="remove(\'' + row.wlCode + '\')"><i class="fa fa-remove"></i>删除</a>');
return actions.join('');
}
}]
};
$.table.init(options);
});
//移除bomtable2的对应行数据
function remove(wlCode) {
$("#bootstrap-table").bootstrapTable("remove", {
field: 'wlCode',
values: wlCode
});
}
function submitHandler() {
submit();
}
//提交
function submit() {
let bootstrapTable = $("#bootstrap-table").bootstrapTable("getData", true);
let formData = new FormData($("#bomForm")[0]);
formData.append("bomList", JSON.stringify(bootstrapTable));
let data1 = {};
formData.forEach((value, key) => data1[key] = value);
//alert(JSON.stringify(data1));
$.ajax({
url: prefix + "/edit",
type: "post",
resultType: "json",
data: {"jsonStr": JSON.stringify(data1)},
success: function (resp) {
if (resp.code === 0) {
alert("修改成功!");
// window.location.href = prefix;
var index = parent.layer.getFrameIndex(window.name);
var parent2 = window.parent;
parent2.$.table.refresh();
parent.layer.close(index);//关闭当前页
} else {
$.modal.msgError("修改失败!");
}
},
error: function () {
$.modal.msgError("出错了!");
}
});
}
</script>
</body>
</html>