Browse Source

修改:采购报价修改物料为多选

dev
zhangsiqi 3 months ago
parent
commit
c089d07208
  1. 91
      ruoyi-admin/src/main/resources/templates/purchase/purchaseQuote/add.html
  2. 26
      ruoyi-admin/src/main/resources/templates/purchase/purchaseQuote/edit.html

91
ruoyi-admin/src/main/resources/templates/purchase/purchaseQuote/add.html

@ -160,8 +160,31 @@
}, },
{title: '最新报价',field: 'materialSole',align: 'center',}, {title: '最新报价',field: 'materialSole',align: 'center',},
{title: '物料的数量', field: 'materialNum',align: 'center',editable: true,visible: false}, {title: '物料的数量', field: 'materialNum',align: 'center',editable: true,visible: false},
{title: '物料的不含税单价(RMB)',field: 'materialNoRmb',align: 'center',editable: true}, {title: '物料的不含税单价(RMB)',field: 'materialNoRmb',align: 'center',
{title: '物料的含税单价(RMB)',field: 'materialRmb',align: 'center',editable: true}, editable:{
type: 'text',
validate: function(v) {
if (!v) return '输入不能为空';
if (isNaN(v)) return '输入错误';
if (v < 0) return '单价可以为0';
//正则金额保留两位小数
if (!/^\d+(\.\d{1,2})?$/.test(v)) return '金额保留两位小数';
}
}
},
{title: '物料的含税单价(RMB)',field: 'materialRmb',align: 'center',
editable:{
type: 'text',
validate: function(v) {
if (!v) return '输入不能为空';
if (isNaN(v)) return '输入错误';
if (v < 0) return '单价可以为0';
//正则金额保留两位小数
if (!/^\d+(\.\d{1,2})?$/.test(v)) return '金额保留两位小数';
}
}
},
{title: '录入人',field: 'createBy',align: 'center',visible: false}, {title: '录入人',field: 'createBy',align: 'center',visible: false},
{title: '录入时间',field: 'createTime',align: 'center',visible: false }, {title: '录入时间',field: 'createTime',align: 'center',visible: false },
{title: '更新人',field: 'updateBy',align: 'center',visible: false}, {title: '更新人',field: 'updateBy',align: 'center',visible: false},
@ -213,37 +236,43 @@
}); });
function doSubmit(index, layero,uniqueId){ function doSubmit(index, layero,uniqueId){
var iframeWin = window[layero.find('iframe')[0]['name']]; var iframeWin = window[layero.find('iframe')[0]['name']];
var rowData = iframeWin.$('#bootstrap-select-table').bootstrapTable('getSelections')[0]; var rowData = iframeWin.$('#bootstrap-select-table').bootstrapTable('getSelections');
var rows = $("#bootstrap-sub-table-1").bootstrapTable('getData').length; var rows = $("#bootstrap-sub-table-1").bootstrapTable('getData').length;
for(var i=0;i<rows;i++){ for(var j=0;i<rows;j++){
var data = $("#bootstrap-sub-table-1").bootstrapTable('getData')[i]; var data = $("#bootstrap-sub-table-1").bootstrapTable('getData');
if(data.materialNo==rowData.materialNo){ for (var i = 0;i<data.length;i++){
$.modal.alertError("不能选择已添加过的相同料号"); if(data[i].materialNo==rowData[j].materialNo){
return; //如果是物料料号的相同,则从rowData清除相同的料号物料
rowData.splice(j,1);
$.modal.alertError("不能选择已添加过的相同料号" + rowData[j].materialNo);
return;
}
} }
} }
console.log("rowData: "+rowData); console.log("rowData: "+rowData);
$("#bootstrap-sub-table-purchaseQuoteChild").bootstrapTable('insertRow', { for(var i=0;i<rowData.length;i++){
index:1, $("#bootstrap-sub-table-purchaseQuoteChild").bootstrapTable('insertRow', {
row: { index: i,
materialId:rowData.id, row: {
materialCode: rowData.materialNo, materialId:rowData[i].id,
materialName: rowData.materialName, materialCode: rowData[i].materialNo,
materialType: rowData.materialType, materialName: rowData[i].materialName,
describe: rowData.describe, materialType: rowData[i].materialType,
brand: rowData.brand, describe: rowData[i].describe,
unit: rowData.unit, brand: rowData[i].brand,
processMethod: rowData.processMethod, unit: rowData[i].unit,
materialSole: '', processMethod: rowData[i].processMethod,
photoUrl: rowData.photoUrl, materialSole: '',
materialNum: 1, photoUrl: rowData[i].photoUrl,
materialRmb: "", materialNum: 1,
materialNoRmb: "", materialRmb: "",
materialNoRmbSum: "", materialNoRmb: "",
materialRmbSum: "", materialNoRmbSum: "",
remark: "" materialRmbSum: "",
} remark: ""
}) }
})
}
layer.close(index); layer.close(index);
} }
function insertRow() { function insertRow() {
@ -344,7 +373,7 @@
}); });
/* 删除指定表格行 */ /* 删除指定表格行 */
function removeRow(materialCode){ function removeRow(materialCode){
$("#bootstrap-sub-table-requisitionChild").bootstrapTable('remove', { $("#bootstrap-sub-table-purchaseQuoteChild").bootstrapTable('remove', {
field: 'materialCode', field: 'materialCode',
values: materialCode values: materialCode
}) })

26
ruoyi-admin/src/main/resources/templates/purchase/purchaseQuote/edit.html

@ -212,8 +212,30 @@
}, },
{title:'最新报价',field: 'materialSole',align: 'center',}, {title:'最新报价',field: 'materialSole',align: 'center',},
{title: '物料的数量', field: 'materialNum',align: 'center',editable: true,visible: false}, {title: '物料的数量', field: 'materialNum',align: 'center',editable: true,visible: false},
{title: '物料的不含税单价(RMB)',field: 'materialNoRmb',align: 'center',editable: true,}, {title: '物料的不含税单价(RMB)',field: 'materialNoRmb',align: 'center',
{title: '物料的含税单价(RMB)',field: 'materialRmb',align: 'center',editable: true,}, editable: {
type: 'text',
validate: function (v) {
if (!v) return '输入不能为空';
if (isNaN(v)) return '输入错误';
if (v < 0) return '单价可以为0';
//正则金额保留两位小数
if (!/^\d+(\.\d{1,2})?$/.test(v)) return '金额保留两位小数';
}
}
},
{title: '物料的含税单价(RMB)',field: 'materialRmb',align: 'center',
editable:{
type: 'text',
validate: function(v) {
if (!v) return '输入不能为空';
if (isNaN(v)) return '输入错误';
if (v < 0) return '单价可以为0';
//正则金额保留两位小数
if (!/^\d+(\.\d{1,2})?$/.test(v)) return '金额保留两位小数';
}
}
},
{title: '录入人',field: 'createBy',align: 'center',visible: false}, {title: '录入人',field: 'createBy',align: 'center',visible: false},
{title: '录入时间',field: 'createTime',align: 'center',visible: false }, {title: '录入时间',field: 'createTime',align: 'center',visible: false },
{title: '更新人',field: 'updateBy',align: 'center',visible: false}, {title: '更新人',field: 'updateBy',align: 'center',visible: false},

Loading…
Cancel
Save