/**
|
* 详情对话框
|
*/
|
var ProductRouteChildInfoInfoDlg = {
|
data: {
|
id: "",
|
opCode: "",
|
opName: "",
|
stepNo: "",
|
opType: "",
|
spareField1: "",
|
spareField2: "",
|
spareField3: "",
|
remark: "",
|
routeCode: ""
|
}
|
};
|
|
layui.use(['form', 'admin', 'ax','laydate','upload','formSelects'], function () {
|
var $ = layui.jquery;
|
var $ax = layui.ax;
|
var form = layui.form;
|
var admin = layui.admin;
|
|
//获取详情信息,填充表单
|
var ajax = new $ax(Feng.ctxPath + "/productRouteChildInfo/detail?id=" + Feng.getUrlParam("id"));
|
var result1 = ajax.start();
|
form.val('productRouteChildInfoForm', result1.data);
|
|
getDictType();
|
getOpList();
|
|
function getOpList(){
|
$.ajax({
|
type: "POST",
|
contentType: "application/json;charset=UTF-8",
|
url: Feng.ctxPath + '/opInfo/list?status=ENABLE',
|
success: function (result) {
|
$.each(result.data, function (index, value) {
|
$('#opCode').append(new Option(value.opCode));// 下拉菜单里添加元素
|
});
|
console.log(result)
|
$('#opCode').val(result1.data.opCode);
|
layui.form.render("select");//重新渲染 固定写法
|
},
|
});
|
}
|
function getDictType(){
|
$.ajax({
|
type: "POST",
|
contentType: "application/json;charset=UTF-8",
|
url: Feng.ctxPath + '/dict/list?dictTypeId=1694972441967951874',
|
success: function (result) {
|
$.each(result.data, function (index, value) {
|
$('#opType').append(new Option(value.name,value.code));// 下拉菜单里添加元素
|
});
|
$('#opType').val(result1.data.opType)
|
layui.form.render("select");//重新渲染 固定写法
|
},
|
});
|
}
|
|
//表单提交事件
|
form.on('submit(btnSubmit)', function (data) {
|
var ajax = new $ax(Feng.ctxPath + "/productRouteChildInfo/editItem", function (data) {
|
Feng.success("更新成功!");
|
//传给上个页面,刷新table用
|
admin.putTempData('formOk', true);
|
//关掉对话框
|
admin.closeThisDialog();
|
// window.location.href = Feng.ctxPath + '/productRouteChildInfo'
|
}, function (data) {
|
Feng.error("更新失败!" + data.responseJSON.message)
|
});
|
ajax.set(data.field);
|
ajax.start();
|
|
return false;
|
});
|
|
$('#cancel').click(function(){
|
admin.closeThisDialog();
|
// window.location.href = Feng.ctxPath + '/productRouteChildInfo'
|
});
|
});
|