提交 44ea03c9 编写于 作者: doc_wei's avatar doc_wei

售后工单修改

上级 6a3dc480
......@@ -6,19 +6,17 @@ layui.config({
window: 'js/winui.window'
}).define(['window', 'table', 'jquery', 'winui', 'form'], function (exports) {
winui.renderColor();
var $ = layui.$,
form = layui.form,
table = layui.table;
//获取我申领的未使用的配件
table.render({
id: 'messageTable',
elem: '#messageTable',
method: 'post',
url: reqBasePath + 'sealseservice031',
where: {materialName: $("#materialName").val(), materialModel: $("#materialModel").val(), materialGroupName: $("#materialGroupName").val()},
where: {materialName: $("#materialName").val(), materialModel: $("#materialModel").val()},
even: true,
page: true,
limits: [8, 16, 24, 32, 40, 48, 56],
......@@ -29,8 +27,7 @@ layui.config({
{ field: 'unitName', title: '计量单位', align: 'left', width: 80 },
{ field: 'materialModel', title: '配件规格', align: 'left', width: 150 },
{ field: 'unitPrice', title: '单价', align: 'left', width: 100 },
{ field: 'operNumber', title: '剩余数量', align: 'left', width: 100 },
{ field: 'groupName', title: '所属ERP组', align: 'left', width: 100 }
{ field: 'operNumber', title: '剩余数量', align: 'left', width: 100 }
]],
done: function(){
matchingLanguage();
......@@ -60,11 +57,11 @@ layui.config({
});
function loadTable(){
table.reload("messageTable", {where: {materialName: $("#materialName").val(), materialModel: $("#materialModel").val(), materialGroupName: $("#materialGroupName").val()}});
table.reload("messageTable", {where: {materialName: $("#materialName").val(), materialModel: $("#materialModel").val()}});
}
function refreshTable(){
table.reload("messageTable", {page: {curr: 1}, where: {materialName: $("#materialName").val(), materialModel: $("#materialModel").val(), materialGroupName: $("#materialGroupName").val()}});
table.reload("messageTable", {page: {curr: 1}, where: {materialName: $("#materialName").val(), materialModel: $("#materialModel").val()}});
}
exports('mypartslist', {});
......
......@@ -18,7 +18,7 @@ layui.config({
elem: '#messageTable',
method: 'post',
url: reqBasePath + 'sealseservice032',
where: {materialName: $("#materialName").val(), materialModel: $("#materialModel").val(), materialGroupName: $("#materialGroupName").val()},
where: {materialName: $("#materialName").val(), materialModel: $("#materialModel").val()},
even: true,
page: true,
limits: [8, 16, 24, 32, 40, 48, 56],
......@@ -29,8 +29,7 @@ layui.config({
{ field: 'unitName', title: '计量单位', align: 'left', width: 80 },
{ field: 'materialModel', title: '配件规格', align: 'left', width: 150 },
{ field: 'unitPrice', title: '单价', align: 'left', width: 100 },
{ field: 'operNumber', title: '已用数量', align: 'left', width: 100 },
{ field: 'groupName', title: '所属ERP组', align: 'left', width: 100 }
{ field: 'operNumber', title: '已用数量', align: 'left', width: 100 }
]],
done: function(){
matchingLanguage();
......@@ -60,11 +59,11 @@ layui.config({
});
function loadTable(){
table.reload("messageTable", {where: {materialName: $("#materialName").val(), materialModel: $("#materialModel").val(), materialGroupName: $("#materialGroupName").val()}});
table.reload("messageTable", {where: {materialName: $("#materialName").val(), materialModel: $("#materialModel").val()}});
}
function refreshTable(){
table.reload("messageTable", {page: {curr: 1}, where: {materialName: $("#materialName").val(), materialModel: $("#materialModel").val(), materialGroupName: $("#materialGroupName").val()}});
table.reload("messageTable", {page: {curr: 1}, where: {materialName: $("#materialName").val(), materialModel: $("#materialModel").val()}});
}
exports('myusepartslist', {});
......
......@@ -8,14 +8,12 @@ layui.config({
window: 'js/winui.window'
}).define(['window', 'table', 'jquery', 'winui', 'form'], function (exports) {
winui.renderColor();
var $ = layui.$,
form = layui.form,
table = layui.table;
authBtn('1582381689724');
table.render({
id: 'messageTable',
elem: '#messageTable',
......
......@@ -7,12 +7,10 @@ layui.config({
}).define(['window', 'table', 'jquery', 'winui', "form"], function (exports) {
winui.renderColor();
var index = parent.layer.getFrameIndex(window.name);
var $ = layui.$,
form = layui.form,
table = layui.table;
table.render({
id: 'messageTable',
elem: '#messageTable',
......
......@@ -74,8 +74,6 @@ layui.config({
$("#faultKeyPartsId").val(faultKeyParts.productName);
}
matchingLanguage();
form.render();
// 加载配件使用明细
if(json.bean.partsList.length > 0){
initDataToShow(json);
......@@ -122,158 +120,94 @@ layui.config({
// 附件回显
skyeyeEnclosure.initTypeISData({'enclosureUpload': json.bean.enclosureInfo});
matchingLanguage();
form.render();
// 暂存
form.on('submit(temSub)', function (data) {
if (winui.verifyForm(data.elem)) {
// 获取已选配件数据
var rowTr = $("#useTable tr");
var tableData = new Array();
var noError = false; // 循环遍历表格数据时,是否有其他错误信息
$.each(rowTr, function(i, item) {
// 获取行编号
var rowNum = $(item).attr("trcusid").replace("tr", "");
// 表格数量对象
var rkNum = $("#rkNum" + rowNum);
if(parseInt(rkNum.val()) == 0) {
rkNum.addClass("layui-form-danger");
rkNum.focus();
winui.window.msg('数量不能为0', {icon: 2, time: 2000});
noError = true;
return false;
}
if(parseInt(rkNum.val()) > parseInt($("#currentTock" + rowNum).html())){
rkNum.addClass("layui-form-danger");
rkNum.focus();
winui.window.msg('超过库存数量.', {icon: 2, time: 2000});
noError = true;
return false;
}
// 商品对象
var product = allChooseProduct["tr" + rowNum.toString()];
if(inTableDataArrayByAssetarId(product.productId, $("#unitId" + rowNum).val(), tableData)) {
winui.window.msg('一张单中不允许出现相同单位的配件信息.', {icon: 2, time: 2000});
noError = true;
return false;
}
var row = {
materialId: product.productId,
mUnitId: $("#unitId" + rowNum).val(),
rkNum: rkNum.val(),
remark: $("#remark" + rowNum).val()
};
tableData.push(row);
});
if(noError) {
return false;
}
var picUrl = $("#comPic").find("input[type='hidden'][name='upload']").attr("oldurl");
var params = {
serviceId: parent.rowId,
faultTypeId: $("#faultTypeId").val(),
comTime: $("#comTime").val(),
comWorkTime: $("#comWorkTime").val(),
comExecution: $("#comExecution").val(),
comPic: isNull(picUrl) ? "" : picUrl, //完工拍照,可为空
enclosureInfo: skyeyeEnclosure.getEnclosureIdsByBoxId('enclosureUpload'), //完工附件,可为空
comRemark: $("#comRemark").val(),
coverCost: $("#coverCost").val(),
otherCost: $("#otherCost").val(),
comStarTime: $("#comStarTime").val(),
faultKeyPartsId: isNull(faultKeyParts.productId) ? "" : faultKeyParts.productId,
actualFailure: $("#actualFailure").val(),
solution: $("#solution").val(),
useStr: JSON.stringify(tableData),
subType: '1' //暂存
};
AjaxPostUtil.request({url: reqBasePath + "sealseservice035", params: params, type: 'json', callback: function(json){
if (json.returnCode == 0){
parent.layer.close(index);
parent.refreshCode = '0';
} else {
winui.window.msg(json.returnMessage, {icon: 2, time: 2000});
}
}});
}
saveData(data, "1");
return false;
});
//完工
// 完工
form.on('submit(finishedSub)', function (data) {
if (winui.verifyForm(data.elem)) {
// 获取已选配件数据
var rowTr = $("#useTable tr");
var tableData = new Array();
var noError = false; // 循环遍历表格数据时,是否有其他错误信息
$.each(rowTr, function(i, item) {
// 获取行编号
var rowNum = $(item).attr("trcusid").replace("tr", "");
// 表格数量对象
var rkNum = $("#rkNum" + rowNum);
if(parseInt(rkNum.val()) == 0) {
rkNum.addClass("layui-form-danger");
rkNum.focus();
winui.window.msg('数量不能为0', {icon: 2, time: 2000});
noError = true;
return false;
}
if(parseInt(rkNum.val()) > parseInt($("#currentTock" + rowNum).html())){
rkNum.addClass("layui-form-danger");
rkNum.focus();
winui.window.msg('超过库存数量.', {icon: 2, time: 2000});
noError = true;
return false;
}
// 商品对象
var product = allChooseProduct["tr" + rowNum.toString()];
if(inTableDataArrayByAssetarId(product.productId, $("#unitId" + rowNum).val(), tableData)) {
winui.window.msg('一张单中不允许出现相同单位的配件信息.', {icon: 2, time: 2000});
noError = true;
return false;
}
var row = {
materialId: product.productId,
mUnitId: $("#unitId" + rowNum).val(),
rkNum: rkNum.val(),
remark: $("#remark" + rowNum).val()
};
tableData.push(row);
});
if(noError) {
return false;
}
var picUrl = $("#comPic").find("input[type='hidden'][name='upload']").attr("oldurl");
var params = {
serviceId: parent.rowId,
faultTypeId: $("#faultTypeId").val(),
comTime: $("#comTime").val(),
comWorkTime: $("#comWorkTime").val(),
comExecution: $("#comExecution").val(),
comPic: isNull(picUrl) ? "" : picUrl, //完工拍照,可为空
enclosureInfo: skyeyeEnclosure.getEnclosureIdsByBoxId('enclosureUpload'), //完工附件,可为空
comRemark: $("#comRemark").val(),
coverCost: $("#coverCost").val(),
otherCost: $("#otherCost").val(),
comStarTime: $("#comStarTime").val(),
faultKeyPartsId: isNull(faultKeyParts.productId) ? "" : faultKeyParts.productId,
actualFailure: $("#actualFailure").val(),
solution: $("#solution").val(),
useStr: JSON.stringify(tableData),
subType: '2' //完工
};
AjaxPostUtil.request({url: reqBasePath + "sealseservice035", params: params, type: 'json', callback: function(json){
if (json.returnCode == 0){
parent.layer.close(index);
parent.refreshCode = '0';
} else {
winui.window.msg(json.returnMessage, {icon: 2, time: 2000});
}
}});
}
saveData(data, "2");
return false;
});
}
});
function saveData(data, subType){
if (winui.verifyForm(data.elem)) {
// 获取已选配件数据
var rowTr = $("#useTable tr");
var tableData = new Array();
var noError = false; // 循环遍历表格数据时,是否有其他错误信息
$.each(rowTr, function(i, item) {
// 获取行编号
var rowNum = $(item).attr("trcusid").replace("tr", "");
// 表格数量对象
var rkNum = $("#rkNum" + rowNum);
if(parseInt(rkNum.val()) == 0) {
rkNum.addClass("layui-form-danger");
rkNum.focus();
winui.window.msg('数量不能为0', {icon: 2, time: 2000});
noError = true;
return false;
}
if(parseInt(rkNum.val()) > parseInt($("#currentTock" + rowNum).html())){
rkNum.addClass("layui-form-danger");
rkNum.focus();
winui.window.msg('超过库存数量.', {icon: 2, time: 2000});
noError = true;
return false;
}
// 商品对象
var product = allChooseProduct["tr" + rowNum.toString()];
if(inTableDataArrayByAssetarId(product.productId, $("#unitId" + rowNum).val(), tableData)) {
winui.window.msg('一张单中不允许出现相同单位的配件信息.', {icon: 2, time: 2000});
noError = true;
return false;
}
var row = {
materialId: product.productId,
mUnitId: $("#unitId" + rowNum).val(),
rkNum: rkNum.val(),
remark: $("#remark" + rowNum).val()
};
tableData.push(row);
});
if(noError) {
return false;
}
var picUrl = $("#comPic").find("input[type='hidden'][name='upload']").attr("oldurl");
var params = {
serviceId: parent.rowId,
faultTypeId: $("#faultTypeId").val(),
comTime: $("#comTime").val(),
comWorkTime: $("#comWorkTime").val(),
comExecution: $("#comExecution").val(),
comPic: isNull(picUrl) ? "" : picUrl, //完工拍照,可为空
enclosureInfo: skyeyeEnclosure.getEnclosureIdsByBoxId('enclosureUpload'), //完工附件,可为空
comRemark: $("#comRemark").val(),
coverCost: $("#coverCost").val(),
otherCost: $("#otherCost").val(),
comStarTime: $("#comStarTime").val(),
faultKeyPartsId: isNull(faultKeyParts.productId) ? "" : faultKeyParts.productId,
actualFailure: $("#actualFailure").val(),
solution: $("#solution").val(),
useStr: JSON.stringify(tableData),
subType: subType
};
AjaxPostUtil.request({url: reqBasePath + "sealseservice035", params: params, type: 'json', callback: function(json){
if (json.returnCode == 0){
parent.layer.close(index);
parent.refreshCode = '0';
} else {
winui.window.msg(json.returnMessage, {icon: 2, time: 2000});
}
}});
}
}
//判断选中的备件是否也在数组中
function inTableDataArrayByAssetarId(materialId, unitId, array) {
......@@ -324,11 +258,11 @@ layui.config({
//当两个都不为空时
if(!isNull(chooseUnitId)){
//获取库存
AjaxPostUtil.request({url: reqBasePath + "sealseservice034", params: {mUnitId: chooseUnitId, servierId: parent.rowId}, type: 'json', callback: function(json) {
AjaxPostUtil.request({url: reqBasePath + "sealseservice034", params: {mUnitId: chooseUnitId}, type: 'json', callback: function(json) {
if(json.returnCode == 0) {
var currentTock = 0;
if(!isNull(json.bean)){
currentTock = json.bean.currentTock;
currentTock = json.bean.stockNum;
}
$("#currentTock" + rowNum).html(currentTock);
} else {
......
......@@ -19,10 +19,6 @@
<div class="layui-input-inline">
<input type="text" id="materialModel" name="materialModel" placeholder="请输入配件规格" class="layui-input" />
</div>
<label class="layui-form-label">所属ERP组</label>
<div class="layui-input-inline">
<input type="text" id="materialGroupName" name="materialGroupName" placeholder="请输入所属ERP组" class="layui-input" />
</div>
<button type="reset" class="layui-btn layui-btn-primary list-form-search"><language showName="com.skyeye.reset"></language></button>
<button class="layui-btn list-form-search" lay-submit lay-filter="formSearch"><language showName="com.skyeye.search2"></language></button>
</div>
......
......@@ -19,10 +19,6 @@
<div class="layui-input-inline">
<input type="text" id="materialModel" name="materialModel" placeholder="请输入配件规格" class="layui-input" />
</div>
<label class="layui-form-label">所属ERP组</label>
<div class="layui-input-inline">
<input type="text" id="materialGroupName" name="materialGroupName" placeholder="请输入所属ERP组" class="layui-input" />
</div>
<button type="reset" class="layui-btn layui-btn-primary list-form-search"><language showName="com.skyeye.reset"></language></button>
<button class="layui-btn list-form-search" lay-submit lay-filter="formSearch"><language showName="com.skyeye.search2"></language></button>
</div>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册