| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- $(".importFile").click(function () {
- $("#upFile").trigger("click");
- });
- $("#upFile").change(function () {
- upload();
- });
- function upload() {
- if (document.getElementById("upFile").files.length > 0) {
- var formData = new FormData();
- formData.append("upFile", document.getElementById("upFile").files[0]);
- formData.append("specialid", selectThemeId);
- formData.append("token", $.cookie("token"));
- $.ajax({
- url: huayi.config.callcenter_url + "SamplePool/ImportExcel",
- type: "POST",
- data: formData,
- contentType: false,
- processData: false,
- success: function (result) {
- $("#upFile").change(function () {
- upload();
- });
- var r = $.parseJSON(result);
- if (r.state.toLowerCase() == "success") {
- layer.msg("导入成功");
- initOrderTable(selectThemeId)
- }
- },
- });
- } else {
- layer.confirm("请上传文件!", {
- btn: ["确定"],
- });
- }
- }
- $(".exportTemplate").click(function () {
- var a = document.createElement("a");
- a.style.display = "none";
- a.download = "样本池模版.xlsx";
- a.href = "../static/xls/样本池模版.xlsx";
- document.body.appendChild(a);
- a.click();
- document.body.removeChild(a);
- });
|