From 5304b967a80ebb38aabdecf0f80056e2e53f9112 Mon Sep 17 00:00:00 2001 From: cwchen <1048842385@qq.com> Date: Tue, 24 Dec 2024 17:59:19 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=87=E4=BB=B6=E4=B8=8A=E4=BC=A0=E9=99=90?= =?UTF-8?q?=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../child/accessory_out_bound_detail.js | 24 +++++++++------- js/accessory/child/accessory_return_form.js | 24 +++++++++------- js/accessory/child/accessory_scrap_form.js | 24 +++++++++------- .../child/accessory_store_edit_form.js | 24 +++++++++------- js/accessory/child/accessory_store_form.js | 24 +++++++++------- js/accessory/child/inventory_count_form.js | 24 +++++++++------- js/demandPlan/child/send_goods_form.js | 28 +++++++++++-------- 7 files changed, 100 insertions(+), 72 deletions(-) diff --git a/js/accessory/child/accessory_out_bound_detail.js b/js/accessory/child/accessory_out_bound_detail.js index 103fcc1..9bea36c 100644 --- a/js/accessory/child/accessory_out_bound_detail.js +++ b/js/accessory/child/accessory_out_bound_detail.js @@ -34,17 +34,21 @@ function setParams(params) { return layer.msg('最多上传5个附件证明', { icon: 7 }); } uploadObj.config.elem.next()[0].value = ''; + let num = 0; obj.preview(function (index, file, result) { - $('#uploader-list').append( - '
' + - '

x

' + - handleFileType(index, file, result) + - '
' - ); - let map = new Map();//将选择的图片索引和图片写成对象存入集合 - map.index = index; - map.file = file; - fileList.push(map); + num ++; + if(num <= (5-length)){ + $('#uploader-list').append( + '
' + + '

x

' + + handleFileType(index, file, result) + + '
' + ); + let map = new Map();//将选择的图片索引和图片写成对象存入集合 + map.index = index; + map.file = file; + fileList.push(map); + } }); } }); diff --git a/js/accessory/child/accessory_return_form.js b/js/accessory/child/accessory_return_form.js index 47fbd01..0117e26 100644 --- a/js/accessory/child/accessory_return_form.js +++ b/js/accessory/child/accessory_return_form.js @@ -47,17 +47,21 @@ function setParams(obj) { return layer.msg('最多上传5个附件证明', { icon: 7 }); } uploadObj.config.elem.next()[0].value = ''; + let num = 0; obj.preview(function (index, file, result) { - $('#uploader-list').append( - '
' + - '

x

' + - handleFileType(index, file, result) + - '
' - ); - let map = new Map();//将选择的图片索引和图片写成对象存入集合 - map.index = index; - map.file = file; - fileList.push(map); + num ++; + if(num <= (5-length)){ + $('#uploader-list').append( + '
' + + '

x

' + + handleFileType(index, file, result) + + '
' + ); + let map = new Map();//将选择的图片索引和图片写成对象存入集合 + map.index = index; + map.file = file; + fileList.push(map); + } }); } }); diff --git a/js/accessory/child/accessory_scrap_form.js b/js/accessory/child/accessory_scrap_form.js index 722b59f..e3689aa 100644 --- a/js/accessory/child/accessory_scrap_form.js +++ b/js/accessory/child/accessory_scrap_form.js @@ -36,17 +36,21 @@ function setParams(obj) { return layer.msg('最多上传5个附件证明', { icon: 7 }); } uploadObj.config.elem.next()[0].value = ''; + let num = 0; obj.preview(function (index, file, result) { - $('#uploader-list').append( - '
' + - '

x

' + - handleFileType(index, file, result) + - '
' - ); - let map = new Map();//将选择的图片索引和图片写成对象存入集合 - map.index = index; - map.file = file; - fileList.push(map); + num ++; + if(num <= (5-length)){ + $('#uploader-list').append( + '
' + + '

x

' + + handleFileType(index, file, result) + + '
' + ); + let map = new Map();//将选择的图片索引和图片写成对象存入集合 + map.index = index; + map.file = file; + fileList.push(map); + } }); } }); diff --git a/js/accessory/child/accessory_store_edit_form.js b/js/accessory/child/accessory_store_edit_form.js index 840031b..70a1ac8 100644 --- a/js/accessory/child/accessory_store_edit_form.js +++ b/js/accessory/child/accessory_store_edit_form.js @@ -37,17 +37,21 @@ function setParams(obj) { return layer.msg('最多上传5个附件证明', { icon: 7 }); } uploadObj.config.elem.next()[0].value = ''; + let num = 0; obj.preview(function (index, file, result) { - $('#uploader-list').append( - '
' + - '

x

' + - handleFileType(index, file, result) + - '
' - ); - let map = new Map();//将选择的图片索引和图片写成对象存入集合 - map.index = index; - map.file = file; - fileList.push(map); + num ++; + if(num <= (5-length)){ + $('#uploader-list').append( + '
' + + '

x

' + + handleFileType(index, file, result) + + '
' + ); + let map = new Map();//将选择的图片索引和图片写成对象存入集合 + map.index = index; + map.file = file; + fileList.push(map); + } }); } }); diff --git a/js/accessory/child/accessory_store_form.js b/js/accessory/child/accessory_store_form.js index f1fbbab..bfbc52e 100644 --- a/js/accessory/child/accessory_store_form.js +++ b/js/accessory/child/accessory_store_form.js @@ -37,17 +37,21 @@ function setParams(obj) { return layer.msg('最多上传5个附件证明', { icon: 7 }); } uploadObj.config.elem.next()[0].value = ''; + let num = 0; obj.preview(function (index, file, result) { - $('#uploader-list').append( - '
' + - '

x

' + - handleFileType(index, file, result) + - '
' - ); - let map = new Map();//将选择的图片索引和图片写成对象存入集合 - map.index = index; - map.file = file; - fileList.push(map); + num ++; + if(num <= (5-length)){ + $('#uploader-list').append( + '
' + + '

x

' + + handleFileType(index, file, result) + + '
' + ); + let map = new Map();//将选择的图片索引和图片写成对象存入集合 + map.index = index; + map.file = file; + fileList.push(map); + } }); } }); diff --git a/js/accessory/child/inventory_count_form.js b/js/accessory/child/inventory_count_form.js index 84500a8..3472060 100644 --- a/js/accessory/child/inventory_count_form.js +++ b/js/accessory/child/inventory_count_form.js @@ -38,17 +38,21 @@ function setParams(obj) { return layer.msg('最多上传5个附件证明', { icon: 7 }); } uploadObj.config.elem.next()[0].value = ''; + let num = 0; obj.preview(function (index, file, result) { - $('#uploader-list').append( - '
' + - '

x

' + - handleFileType(index, file, result) + - '
' - ); - let map = new Map();//将选择的图片索引和图片写成对象存入集合 - map.index = index; - map.file = file; - fileList.push(map); + num ++; + if(num <= (5-length)){ + $('#uploader-list').append( + '
' + + '

x

' + + handleFileType(index, file, result) + + '
' + ); + let map = new Map();//将选择的图片索引和图片写成对象存入集合 + map.index = index; + map.file = file; + fileList.push(map); + } }); } }); diff --git a/js/demandPlan/child/send_goods_form.js b/js/demandPlan/child/send_goods_form.js index 89450f1..ec80a4b 100644 --- a/js/demandPlan/child/send_goods_form.js +++ b/js/demandPlan/child/send_goods_form.js @@ -39,17 +39,21 @@ function setParams(obj) { return layer.msg('最多上传5个发货附件', { icon: 7 }); } uploadObj.config.elem.next()[0].value = ''; + let num = 0; obj.preview(function (index, file, result) { - $('#uploader-list').append( - '
' + - '

x

' + - handleFileType(index, file, result) + - '
' - ); - let map = new Map();//将选择的图片索引和图片写成对象存入集合 - map.index = index; - map.file = file; - fileList.push(map); + num++; + if (num <= (5 - length)) { + $('#uploader-list').append( + '
' + + '

x

' + + handleFileType(index, file, result) + + '
' + ); + let map = new Map();//将选择的图片索引和图片写成对象存入集合 + map.index = index; + map.file = file; + fileList.push(map); + } }); } }); @@ -146,9 +150,9 @@ function initTable() { limitName: 'pageSize' }, parseData: function (res) { // res 即为原始返回的数据 - if(res.code === 401){ + if (res.code === 401) { closeWindowOpen(); - } + } if (jjDetailArr && res.list) { $.each(res.list, function (index, item) { $.each(jjDetailArr, function (index2, item2) {