From 978a3733aedaaa505867b64edfbe1f6caedbc798 Mon Sep 17 00:00:00 2001
From: LSH
Date: 星期六, 04 十一月 2023 09:56:23 +0800
Subject: [PATCH] #
---
src/main/webapp/static/js/companyTarget/companyTarget.js | 171 +--------------------------------------------------------
1 files changed, 3 insertions(+), 168 deletions(-)
diff --git a/src/main/webapp/static/js/companyTarget/companyTarget.js b/src/main/webapp/static/js/companyTarget/companyTarget.js
index a4bdb5a..967feba 100644
--- a/src/main/webapp/static/js/companyTarget/companyTarget.js
+++ b/src/main/webapp/static/js/companyTarget/companyTarget.js
@@ -26,7 +26,9 @@
{type: 'checkbox'}
// ,{field: 'id', align: 'center',title: '#ID'}
, {field: 'year', align: 'center', title: '骞村害'}
- , {field: 'target', align: 'center', title: '鐩爣'}
+ , {field: 'target', align: 'center', title: '鐩爣',templet: '#targetTmp'}
+ , {field: 'complete', align: 'center', title: '瀹為檯',templet: '#completeTmp'}
+ , {field: 'complete$', align: 'center', title: '瀹屾垚鐘跺喌'}
, {fixed: 'right', title: '鎿嶄綔', align: 'center', toolbar: '#operate', width: 400}
]],
@@ -135,22 +137,6 @@
case "del":
del([data.id]);
break;
- case "generate":
- //鐢熸垚鍚堝悓
- generate(data)
- break
- case "sales":
- //鍚堝悓鏄庣粏
- sales(data);
- break
- case "upload":
- //涓婁紶鍚堝悓
- upload(data)
- break
- case "download":
- //涓嬭浇鍚堝悓
- download(data)
- break
}
});
@@ -188,157 +174,6 @@
});
$(layero).children('.layui-layer-content').css('overflow', 'visible');
layui.form.render('select');
- }
- });
- }
-
- /* 鐢熸垚鍚堝悓 */
- function generate(mData) {
- admin.open({
- type: 1,
- area: '600px',
- title: '鐢熸垚鍚堝悓',
- content: $('#generateDialog').html(),
- success: function (layero, dIndex) {
- layDateRender(mData);
- form.val('detail', mData);
- form.on('submit(generateSubmit)', function (data) {
- var loadIndex = layer.load(2);
- $.ajax({
- url: baseUrl + "/companyTarget/generate/auth",
- headers: {'token': localStorage.getItem('token')},
- data: data.field,
- method: 'GET',
- xhrFields: {
- responseType: "blob" // 璁剧疆鍝嶅簲绫诲瀷涓轰簩杩涘埗鏁版嵁
- },
- success: function (res) {
- // 鍒涘缓涓�涓复鏃剁殑涓嬭浇閾炬帴
- const url = window.URL.createObjectURL(res);
- // 鍒涘缓涓�涓殣钘忕殑 <a> 鍏冪礌骞惰缃笅杞介摼鎺�
- const a = document.createElement("a");
- a.style.display = "none";
- a.href = url;
- a.download = data.field.name + ".docx"; // 鎸囧畾涓嬭浇鐨勬枃浠跺悕
- document.body.appendChild(a);
-
- // 瑙﹀彂鐐瑰嚮浜嬩欢浠ュ紑濮嬩笅杞�
- a.click();
-
- // 娓呯悊涓存椂璧勬簮
- setTimeout(function () {
- window.URL.revokeObjectURL(url);
- document.body.removeChild(a);
- }, 100);
-
- layer.close(loadIndex);
- layer.close(dIndex);
- }
- })
- return false;
- });
- $(layero).children('.layui-layer-content').css('overflow', 'visible');
- layui.form.render('select');
- }
- });
- }
-
- /* 鍚堝悓鏄庣粏 */
- function sales(mData) {
- layer.open({
- type: 2,
- title: '鍚堝悓鏄庣粏',
- maxmin: true,
- area: [top.detailWidth, top.detailHeight],
- shadeClose: false,
- content: '../companyTargetSales/companyTargetSales.html?companyTargetId=' + mData.id,
- success: function (layero, index) {
- }
- });
- }
-
- //涓婁紶鍚堝悓
- function upload(data) {
- if (data.filepath == '' || data.filepath == null) {
- layer.confirm('鏄惁涓婁紶鍚堝悓?', function () {
- $("#uploadQuote").click()
- });
- } else {
- layer.confirm('宸蹭笂浼犲悎鍚岋紝鏄惁缁х画瑕嗙洊涓婁紶?', function () {
- $("#uploadQuote").click()
- });
- }
-
- $("#uploadQuote").on("change", (evt) => {
- var files = evt.target.files;
- if (files == null || files.length == 0) {
- alert("No files wait for import");
- return;
- }
-
- let name = files[0].name;
- let suffixArr = name.split("."), suffix = suffixArr[suffixArr.length - 1];
- // if(suffix!="xlsx"){
- // alert("Currently only supports the import of xlsx files");
- // return;
- // }
-
- let formData = new FormData($("#uploadFile")[0]);
- formData.append("id", data.id);
- $.ajax({
- url: baseUrl + "/companyTarget/upload/auth",
- headers: {'token': localStorage.getItem('token')},
- data: formData,
- method: 'POST',
- cache: false,
- processData: false,
- contentType: false,
- success: function (res) {
- if (res.code == 200) {
- layer.msg('涓婁紶鎴愬姛', {time: 1000}, () => {
- parent.location.reload()
- })
- } else {
- layer.msg(res.msg, {time: 1000}, () => {
- parent.location.reload()
- })
- }
- }
- })
- })
- }
-
- //涓嬭浇鍚堝悓
- function download(data) {
- $.ajax({
- url: baseUrl + "/companyTarget/download/auth",
- headers: {'token': localStorage.getItem('token')},
- data: data,
- method: 'GET',
- xhrFields: {
- responseType: "blob" // 璁剧疆鍝嶅簲绫诲瀷涓轰簩杩涘埗鏁版嵁
- },
- success: function (res) {
- // 鍒涘缓涓�涓复鏃剁殑涓嬭浇閾炬帴
- const url = window.URL.createObjectURL(res);
- // 鍒涘缓涓�涓殣钘忕殑 <a> 鍏冪礌骞惰缃笅杞介摼鎺�
- const a = document.createElement("a");
- a.style.display = "none";
- a.href = url;
-
- let list = data.filepath.split(".")
- let suffix = "." + list[list.length - 1]//鑾峰彇鍚庣紑鍚�
- a.download = data.name + suffix; // 鎸囧畾涓嬭浇鐨勬枃浠跺悕
- document.body.appendChild(a);
-
- // 瑙﹀彂鐐瑰嚮浜嬩欢浠ュ紑濮嬩笅杞�
- a.click();
-
- // 娓呯悊涓存椂璧勬簮
- setTimeout(function () {
- window.URL.revokeObjectURL(url);
- document.body.removeChild(a);
- }, 100);
}
});
}
--
Gitblit v1.9.1