From aeb4de759206486cc215aaa30bc2330321866217 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E7=8E=8B=E6=99=93=E8=BF=AA?= <2596750866@qq.com>
Date: Tue, 3 Sep 2024 14:03:08 +0800
Subject: [PATCH] =?UTF-8?q?[fix]=20=E4=BB=93=E5=BA=93=E7=AE=A1=E7=90=86=20?=
=?UTF-8?q?=E5=BA=93=E5=AD=98=E6=8A=A5=E6=8D=9F=20=E4=BF=AE=E6=94=B9?=
=?UTF-8?q?=E5=BA=93=E5=AD=98=E6=8A=A5=E6=8D=9F=E8=A1=A8=E6=A0=BC=E5=88=97?=
=?UTF-8?q?=E6=98=BE=E7=A4=BA=E9=A1=BA=E5=BA=8F=EF=BC=9B=20=E4=BF=AE?=
=?UTF-8?q?=E6=94=B9=E6=96=B0=E5=A2=9E=E5=BA=93=E5=AD=98=E6=8A=A5=E6=8D=9F?=
=?UTF-8?q?=E9=A1=B5=E9=9D=A2=EF=BC=8C=E4=BF=AE=E6=94=B9=E8=A1=A8=E5=8D=95?=
=?UTF-8?q?=E7=BB=93=E6=9E=84=EF=BC=9B=20=E4=BF=AE=E6=94=B9=E7=89=A9?=
=?UTF-8?q?=E6=96=99=E8=A1=A8=E6=A0=BC=E5=88=97=E9=A1=BA=E5=BA=8F=EF=BC=8C?=
=?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=88=97=E7=BC=96=E8=BE=91=E5=8A=9F=E8=83=BD?=
=?UTF-8?q?=E3=80=81=E5=AD=97=E5=85=B8=E6=B3=A8=E8=A7=A3=EF=BC=9B=20?=
=?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=88=A0=E9=99=A4=E6=8C=89=E9=92=AE=E7=BB=91?=
=?UTF-8?q?=E5=AE=9A=E6=96=B9=E6=B3=95=EF=BC=9B=20=E4=BF=AE=E6=94=B9?=
=?UTF-8?q?=E7=94=9F=E6=88=90=E8=AE=A2=E5=8D=95=E5=85=B3=E8=81=94=E5=8D=95?=
=?UTF-8?q?=E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=96=99=E6=B7=BB?=
=?UTF-8?q?=E5=8A=A0=E9=87=8D=E5=A4=8D=E6=80=A7=E5=88=A4=E6=96=AD=EF=BC=9B?=
=?UTF-8?q?=20=E6=96=B0=E5=A2=9E=E9=83=A8=E9=97=A8=E5=90=8D=E7=A7=B0?=
=?UTF-8?q?=E5=90=8E=E5=8F=B0=E5=8A=A8=E6=80=81=E8=8E=B7=E5=8F=96=E8=B5=8B?=
=?UTF-8?q?=E5=80=BC=E6=96=B9=E6=B3=95=EF=BC=9B=20=E4=BF=AE=E6=94=B9?=
=?UTF-8?q?=E9=A1=B5=E9=9D=A2=E6=8F=90=E4=BA=A4=E5=87=BD=E6=95=B0=EF=BC=8C?=
=?UTF-8?q?=E6=8B=BC=E6=8E=A5=E8=A1=A8=E5=8D=95=E5=92=8C=E5=AD=90=E8=A1=A8?=
=?UTF-8?q?=E6=95=B0=E6=8D=AE=E6=8F=90=E4=BA=A4=E5=90=8E=E5=8F=B0=EF=BC=9B?=
=?UTF-8?q?=20=E4=BF=AE=E6=94=B9=E5=BA=93=E5=AD=98=E6=8A=A5=E6=8D=9F?=
=?UTF-8?q?=E8=AF=A6=E6=83=85=E9=A1=B5=E9=9D=A2=E8=A1=A8=E5=8D=95=E7=BB=93?=
=?UTF-8?q?=E6=9E=84=E3=80=81=E7=89=A9=E6=96=99=E8=A1=A8=E6=98=BE=E7=A4=BA?=
=?UTF-8?q?=E7=BB=93=E6=9E=84=EF=BC=9B?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../warehouse/inventoryReportDamage/add.html | 317 ++++++++++++------
.../inventoryReportDamage/detail.html | 153 +++------
.../inventoryReportDamage.html | 6 +-
3 files changed, 272 insertions(+), 204 deletions(-)
diff --git a/ruoyi-admin/src/main/resources/templates/warehouse/inventoryReportDamage/add.html b/ruoyi-admin/src/main/resources/templates/warehouse/inventoryReportDamage/add.html
index 8584f3e1..e63f781e 100644
--- a/ruoyi-admin/src/main/resources/templates/warehouse/inventoryReportDamage/add.html
+++ b/ruoyi-admin/src/main/resources/templates/warehouse/inventoryReportDamage/add.html
@@ -21,7 +21,7 @@
@@ -133,60 +115,101 @@
var warehouseDeptDatas = [[${@dict.getType('warehouseDept')}]];
function submitHandler() {
if ($.validate.form()) {
- $.operate.save(prefix + "/add", $('#form-inventoryReportDamage-add').serialize());
- }
- }
- var options = {
- id : 'bootstrap-table-reportDamage-child',
- modalName: "仓库库存报损物料信息",
- columns: [
- {checkbox: true},
- {title: '库存报损id', field: 'reportDamageChildId', visible: false},
- {title: '报损单号', field: 'reportDamageCode',},
- {title: '料号', field: 'materialNo',},
- {title: '图片', field: 'materialPhotourl',},
- {title: '物料名称', field: 'materialName',},
- {title: '物料类型', field: 'materialType',},
- {title: '描述', field: 'materialDescribe',},
- {title: '品牌', field: 'materialBrand',},
- {title: '实际报废数量', field: 'actualScrapQuantity',},
- {title: '报废类型', field: 'scrapType',},
- {title: '报废明细', field: 'scrapDetail',},
- {title: '品质判定', field: 'qualityAssessment',},
- {title: '预估价值(RMB)', field: 'estimatedValueRmb',},
- {title: '责任单位', field: 'responsibleUnit',},
- {title: '备注', field: 'remark',},
- {title: '关联生产单号', field: 'makeNo',},
- {title: '仓库ID', field: 'warehouseCode',},
- {title: '仓库名称', field: 'warehouseName',},
- {title: '仓库存放地址', field: 'warehouseStoreAddress',},
- {title: '申请部门ID', field: 'applyDeptId',},
- {title: '申请部门', field: 'applyDept',},
- {title: '操作', align: 'center',
- formatter: function(value, row, index) {
- var actions = [];
- actions.push('
删除 ');
- return actions.join('');
+ var warehouseInventoryReportDamage = {
+ warehouseInventoryReportDamageChildList: []
+ };
+ $("select[name='applyDept']").removeAttr("disabled");
+ warehouseInventoryReportDamage.applyDept = $("select[name='applyDept']").val();
+ warehouseInventoryReportDamage.applyTime = $("input[name='applyTime']").val();
+ var whetherMakeNo = $("input[name='whetherMakeNo']:checked").val();
+ warehouseInventoryReportDamage.whetherMakeNo = whetherMakeNo;
+ if(whetherMakeNo === "1"){
+ var makeNo = $("input[name='makeNo']").val();
+ warehouseInventoryReportDamage.makeNo = makeNo;
+ }
+ warehouseInventoryReportDamage.warehouseName = $("select[name='warehouseName']").val();
+ warehouseInventoryReportDamage.warehouseCode = $("input[name='warehouseCode']").val();
+ warehouseInventoryReportDamage.warehouseStoreAddress = $("input[name='warehouseStoreAddress']").val();
+ warehouseInventoryReportDamage.remark = $("area[name='remark']").val();
+
+ var rows = $('#bootstrap-table-reportDamage-child').bootstrapTable('getData');
+ // 检查表格数据是否为空
+ if (rows.length === 0) {
+ $.modal.alertWarning("请至少添加一条物料信息再保存!");
+ return;
+ } else {
+ warehouseInventoryReportDamage.materialTotal = rows.length;
+ for (var i = 0; i < rows.length; i++) {
+ var DamageChild = {
+ materialNo: rows[i].materialNo,
+ materialName: rows[i].materialName,
+ materialType: rows[i].materialType,
+ materialDescribe: rows[i].materialDescribe,
+ materialBrand: rows[i].materialBrand,
+ materialUnit: rows[i].materialUnit,
+ materialPhotourl: rows[i].materialPhotourl,
+ actualScrapQuantity: rows[i].actualScrapQuantity,
+ scrapType: rows[i].scrapType,
+ scrapDetail: rows[i].scrapDetail,
+ qualityAssessment: rows[i].qualityAssessment,
+ estimatedValueRmb: rows[i].estimatedValueRmb,
+ responsibleUnit: rows[i].responsibleUnit,
+ remark: rows[i].remark,
+ };
+ // console.log(DamageChild);
+ warehouseInventoryReportDamage.warehouseInventoryReportDamageChildList.push(DamageChild);
}
}
- ]
- };
- $.table.init(options);
+ console.log(warehouseInventoryReportDamage);
+ $.operate.saveJson(prefix+"/add",JSON.stringify(warehouseInventoryReportDamage));
+ }
+ }
function insertRow() {
- var url = ctx + 'warehouse/inventoryCheck/materialSelect';
- var options = {
- title: '选择物料',
- url: url,
- callBack: doSubmit
- };
- $.modal.openOptions(options);
+ var ifMakeNo = $("input[name='whetherMakeNo']:checked").val();
+ if(ifMakeNo === "1"){
+ var makeNo = $("input[name='makeNo']").val();
+ if(!makeNo){
+ $.modal.alertWarning("请输入生产单号!")
+ }else{
+ var url = prefix + '/materialInMakeOrderSelect/' + makeNo;
+ var options = {
+ title: '选择物料',
+ url: url,
+ callBack: doSubmit
+ };
+ $.modal.openOptions(options);
+ }
+ }else{
+ var url = ctx + 'warehouse/inventoryCheck/materialSelect';
+ var options = {
+ title: '选择物料',
+ url: url,
+ callBack: doSubmit
+ };
+ $.modal.openOptions(options);
+ }
}
function doSubmit(index, layero,uniqueId){
- console.log(uniqueId);
+ // console.log(uniqueId);
var iframeWin = window[layero.find('iframe')[0]['name']];
var rowData = iframeWin.$('#bootstrap-materialSelect-table').bootstrapTable('getSelections')[0];
- console.log("rowData: "+rowData);
+ var rows = $("#bootstrap-table-reportDamage-child").bootstrapTable('getData');
+ if(rows.length > 0){
+ for(var i=0;i
上传 ');
+ return actions.join('');
+ }
+ },
+ {title: '操作', align: 'center',
+ formatter: function(value, row, index) {
+ var actions = [];
+ actions.push('删除 ');
+ return actions.join('');
+ }
+ }
+ ]
+ };
+ $.table.init(options);
loadWarehouseCodes();
changeWhetherMakeNo();
- });
- //单选改变是否关联生产单号显示关联生产单号输入框
- $("input[name='whetherMakeNo']").change(function () {
- changeWhetherMakeNo();
+ getDeptName();
+ //单选改变是否关联生产单号显示关联生产单号输入框
+ $("input[name='whetherMakeNo']").change(function () {
+ changeWhetherMakeNo();
+ });
+ $('#stockNameSelct').on('select2:select', function(e) {
+ var data = e.params.data;
+ $("input[name='warehouseCode']").val(data.stockNo);
+ $("input[name='warehouseStoreAddress']").val(data.stockAddress);
+ });
});
+
//根据是否关联生产单号显示关联生产单号输入框
function changeWhetherMakeNo() {
- $("#makeNoInput").display = function () {
- var whetherMakeNo = $("input[name='whetherMakeNo']:checked").val();
- if (whetherMakeNo == 1) {
- $("#makeNoInput").show();
- } else {
- $("#makeNoInput").hide();
- }
- };
+ var whetherMakeNo = $("input[name='whetherMakeNo']:checked").val();
+ // console.log(whetherMakeNo);
+ if (whetherMakeNo === "1") {
+ $("#makeNoInput").show();
+ } else {
+ $("#makeNoInput").hide();
+ }
}
$("input[name='applyTime']").datetimepicker({
format: "yyyy-mm-dd",
@@ -261,7 +367,7 @@
params.page = params.page || 1;
var options = [];
for (var i = 0; i < data.length; i++) {
- var option = {id: data[i].stockName, text: data[i].stockName,};
+ var option = {id: data[i].stockName, text: data[i].stockName,stockNo: data[i].stockNO,stockAddress: data[i].stockAddr};
options.push(option);
}
var moreDataAvaliable = (params.page * 30) < data.total_count;
@@ -276,11 +382,18 @@
}
});
}
- $('#stockNameSelct').on('select2:select', function(e) {
- var data = e.params.data;
- $("input[name='warehouseCode']").val(data.stockNO);
- $("input[name='warehouseStoreAddress']").val(data.stockAddress);
- });
+
+ function getDeptName(){
+ $.ajax({
+ url: prefix + "/getUserDeptName",
+ type: "get",
+ dataType: "json",
+ success: function (result) {
+ console.log(result.data);
+ $("select[name='applyDept']").append($('').val(result.data).html(result.data));
+ }
+ });
+ }