66923ad7 by 任超

style:图片上传

1 parent 5c68b3ad
...@@ -154,15 +154,35 @@ function handleUpdate(e, index, sizeNum) { ...@@ -154,15 +154,35 @@ function handleUpdate(e, index, sizeNum) {
154 let name = e.files[0].name; 154 let name = e.files[0].name;
155 let fileul = $("#fileULName" + index); 155 let fileul = $("#fileULName" + index);
156 if (fileul.find("li").length >= slsqxx.slclList[index].fs) { 156 if (fileul.find("li").length >= slsqxx.slclList[index].fs) {
157 layer.msg('已经完成上传最大限度', { icon: 5 });
158 return false 157 return false
159 } else { 158 } else {
160 _uploadSlcl(e.files[0], slsqxx.slclList[index].bsmCl, $("#fileULName" + index), sizeNum); 159 _uploadSlcl(e.files[0], slsqxx.slclList[index].bsmCl, $("#fileULName" + index), sizeNum);
161 fileul.append('<li class="fileName">' + '<span title="' + name + '">' + name + '</span>' + '<img class="operation" src="../../staticImages/chacha.png">' + '</li>'); 160 fileul.append('<li class="fileName">' + '<span title="' + name + '">' + name + '</span>' + '<img class="operation" src="../../staticImages/chacha.png">' + '</li>');
162 } 161 }
163 } 162 }
163 $(document).on("click", ".pictureUpload", function (e) {
164 layer.msg('已经完成上传最大限度', { icon: 5 });
165 })
166
164 $(document).on("click", ".fileListName .fileName .operation", function (e) { 167 $(document).on("click", ".fileListName .fileName .operation", function (e) {
165 $(this).parent().remove(); 168 var that = this
169 $.ajax({
170 type: "post", //提交方式
171 url: portal.api_url + "/portal/FillInformation/deleteSlcl",//路径
172 dataType: "json",
173 data: {
174 'bsmSlclmx':$(that).attr('bsmSlclmx')
175 },
176 //数据,这里使用的是Json格式进行传输
177 success: function (result) {//返回数据根据结果进行相应的处理
178 if (result.code == 200) {
179 $(that).parent().remove();
180 layer.msg('删除成功!');
181 }else {
182 layer.msg('删除失败!');
183 }
184 }
185 });
166 }) 186 })
167 // // 图片上传 187 // // 图片上传
168 function _uploadSlcl(flieList, bsmCl, fileul, sizeNum) { 188 function _uploadSlcl(flieList, bsmCl, fileul, sizeNum) {
...@@ -180,10 +200,13 @@ function _uploadSlcl(flieList, bsmCl, fileul, sizeNum) { ...@@ -180,10 +200,13 @@ function _uploadSlcl(flieList, bsmCl, fileul, sizeNum) {
180 //数据,这里使用的是Json格式进行传输 200 //数据,这里使用的是Json格式进行传输
181 success: function (result) {//返回数据根据结果进行相应的处理 201 success: function (result) {//返回数据根据结果进行相应的处理
182 if (result.code == 200) { 202 if (result.code == 200) {
203 fileul.parent().find('.fileListName .fileName').eq(fileul.find("li").length-1).find('.operation').attr('bsmSlclmx',result.data[0].bsmSlclmx)
183 if (fileul.find('.fileName').length === sizeNum) { 204 if (fileul.find('.fileName').length === sizeNum) {
184 fileul.parent().find('.pictureUpload').show() 205 fileul.parent().find('.pictureUpload').show()
185 layer.msg('上传成功,并且以上传最大限度!'); 206 layer.msg('上传成功,并且以上传最大限度!');
186 fileul.parent().find('.file_name').css("z-index","15"); 207 fileul.parent().find('.file_name').css("z-index","15");
208 fileul.parent().find('.updatetext').hide()
209 fileul.parent().find('.update').attr('src', '../../staticImages/Yes.png')
187 }else { 210 }else {
188 layer.msg('上传成功!'); 211 layer.msg('上传成功!');
189 } 212 }
......
...@@ -113,20 +113,6 @@ ...@@ -113,20 +113,6 @@
113 <!-----------------资料上传------------------ --> 113 <!-----------------资料上传------------------ -->
114 <div class="data_upload" id="clxx"> 114 <div class="data_upload" id="clxx">
115 <h3>资料上传</h3> 115 <h3>资料上传</h3>
116 <!-- <div class="img_update">
117 <div class="fileBox">
118 <div class="fileSpan vm">
119 <input type="file" multiple id="fileInput" numList="2" onchange="handleUpdate(this,'fileInput')"/>
120 <input type="file" multiple id="fileInput" numList="2" onchange="handleUpdate(this,'fileInput')"/>
121 <div class="file_name">
122 <img class="update" src="../../staticImages/update.png">
123 <p class="updatetext">点击文件上传</p>
124 </div>
125 <div class="fileListName"></div>
126 </div>
127 <div class="certificate">登记申请书(2份)</div>
128 </div>
129 </div> -->
130 </div> 116 </div>
131 <div class="next_button submitButton"> 117 <div class="next_button submitButton">
132 <button type="button" class="layui-btn layui-btn-normal" onclick="skipClick()"> 118 <button type="button" class="layui-btn layui-btn-normal" onclick="skipClick()">
......