zhanbo.xu

feat: 完善功能

1 -import request from '@/utils/request' 1 +import request from "@/utils/request";
2 2
3 //清单总分单查询 3 //清单总分单查询
4 /** 4 /**
...@@ -14,21 +14,53 @@ import request from '@/utils/request' ...@@ -14,21 +14,53 @@ import request from '@/utils/request'
14 * @param pageSize * 14 * @param pageSize *
15 */ 15 */
16 export function getAllexportList(data) { 16 export function getAllexportList(data) {
17 - return request({ 17 + return request({
18 - url: '/bus-customer/exportList/search', 18 + url: "/bus-customer/exportList/search",
19 - method: 'post', 19 + method: "post",
20 - data: data, 20 + data: data,
21 - }) 21 + });
22 } 22 }
23 23
24 -
25 //清单回执 24 //清单回执
26 /** 25 /**
27 * @param copNo * 运单id 26 * @param copNo * 运单id
28 */ 27 */
29 export function getListReceiptData(data) { 28 export function getListReceiptData(data) {
30 - return request({
31 - url: '/bus-customer/exportList/receipt/' + data.copNo,
32 - method: 'get',
33 - })
34 -}
...\ No newline at end of file ...\ No newline at end of file
29 + return request({
30 + url: "/bus-customer/exportList/receipt/" + data.copNo,
31 + method: "get",
32 + });
33 +}
34 +
35 +// POST
36 +// /exportList/customizeExcelFormat
37 +// 自定义清单表格导出格式
38 +export function getCustomizeExcelFormat(data) {
39 + return request({
40 + url: "/bus-customer/exportList/customizeExcelFormat",
41 + method: "post",
42 + data: data,
43 + });
44 +}
45 +
46 +// POST
47 +// /exportList/listExport
48 +// 清单导出
49 +export function getListExport(data) {
50 + return request({
51 + url: "/bus-customer/exportList/listExport",
52 + method: "post",
53 + data: data,
54 + });
55 +}
56 +
57 +// GET
58 +// /exportList/getCustomizeExcelFormat
59 +// 获取自定义清单导出格式
60 +export function getCustomizeExcel(data) {
61 + return request({
62 + url: "/bus-customer/exportList/getCustomizeExcelFormat",
63 + method: "get",
64 + data: data,
65 + });
66 +}
......
1 +<svg width="16" height="12" viewBox="0 0 16 12" fill="none" xmlns="http://www.w3.org/2000/svg">
2 +<path d="M0 1H16" stroke="#FF6600" stroke-miterlimit="10"/>
3 +<path d="M2 6H14" stroke="#FF6600" stroke-miterlimit="10"/>
4 +<path d="M4 11H12" stroke="#FF6600" stroke-miterlimit="10"/>
5 +</svg>
1 -import axios from 'axios' 1 +import axios from "axios";
2 -import store from '@/store' 2 +import store from "@/store";
3 -import { getToken } from '@/utils/auth' 3 +import { getToken } from "@/utils/auth";
4 -import { getDownLoadFileStatus } from '@/utils/iClearExp.js' 4 +import { getDownLoadFileStatus } from "@/utils/iClearExp.js";
5 -import { alertWarningMsg } from '@/utils/index.js' 5 +import { alertWarningMsg } from "@/utils/index.js";
6 -import { getdownloadExlFileType } from '@/api/custom-api.js'
7 6
8 const mimeMap = { 7 const mimeMap = {
9 - xlsx: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', 8 + xlsx: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
10 - xlsm: 'application/vnd.ms-excel.sheet.macroEnabled.12', 9 + xlsm: "application/vnd.ms-excel.sheet.macroEnabled.12",
11 - xls: 'application/vnd.ms-excel', 10 + xls: "application/vnd.ms-excel",
12 - zip: 'application/zip', 11 + zip: "application/zip",
13 - pdf: 'application/pdf', 12 + pdf: "application/pdf",
14 - png: 'image/png', 13 + png: "image/png",
15 - jpg: 'image/jpeg', 14 + jpg: "image/jpeg",
16 - docx: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document' 15 + docx: "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
17 -} 16 +};
18 17
19 const apiUrl = { 18 const apiUrl = {
20 //exl 19 //exl
21 - declareDataModel: '/bus-customer/declareData/downloadTemplate', 20 + declareDataModel: "/bus-customer/declareData/downloadTemplate",
22 -} 21 + // 清单查询下载
22 + listExport: "/bus-customer/exportList/listExport",
23 +};
23 24
24 -const baseUrl = process.env.VUE_APP_BASE_API 25 +const baseUrl = process.env.VUE_APP_BASE_API;
25 26
26 export function downLoadZip(urlStatus, str, filename, type, method, data) { 27 export function downLoadZip(urlStatus, str, filename, type, method, data) {
27 return new Promise((resolve, reject) => { 28 return new Promise((resolve, reject) => {
28 - var url = '' 29 + var url = "";
29 - if (urlStatus == 'api') { 30 + if (urlStatus == "api") {
30 - url = baseUrl + apiUrl[str] 31 + url = baseUrl + apiUrl[str];
31 - } else if (urlStatus == 'res') { 32 + } else if (urlStatus == "res") {
32 - url = str 33 + url = str;
33 } 34 }
34 console.log(url); 35 console.log(url);
35 36
36 - if (method == 'get' && data) { 37 + if (method == "get" && data) {
37 - url = url + '?'; 38 + url = url + "?";
38 for (const propName of Object.keys(data)) { 39 for (const propName of Object.keys(data)) {
39 const value = data[propName]; 40 const value = data[propName];
40 var part = encodeURIComponent(propName) + "="; 41 var part = encodeURIComponent(propName) + "=";
41 - if (value !== null && typeof (value) !== "undefined") { 42 + if (value !== null && typeof value !== "undefined") {
42 - if (typeof value === 'object') { 43 + if (typeof value === "object") {
43 for (const key of Object.keys(value)) { 44 for (const key of Object.keys(value)) {
44 - let params = propName + '[' + key + ']'; 45 + let params = propName + "[" + key + "]";
45 var subPart = encodeURIComponent(params) + "="; 46 var subPart = encodeURIComponent(params) + "=";
46 url += subPart + encodeURIComponent(value[key]) + "&"; 47 url += subPart + encodeURIComponent(value[key]) + "&";
47 } 48 }
...@@ -50,35 +51,39 @@ export function downLoadZip(urlStatus, str, filename, type, method, data) { ...@@ -50,35 +51,39 @@ export function downLoadZip(urlStatus, str, filename, type, method, data) {
50 } 51 }
51 } 52 }
52 } 53 }
53 - url = url.slice(0, -1) 54 + url = url.slice(0, -1);
54 } 55 }
55 56
56 axios({ 57 axios({
57 method: method, 58 method: method,
58 url: url, 59 url: url,
59 data: data, 60 data: data,
60 - responseType: 'blob', 61 + responseType: "blob",
61 headers: { 62 headers: {
62 - 'Authorization': 'Bearer ' + getToken(), 63 + Authorization: "Bearer " + getToken(),
63 - "Ver": process.env.VUE_APP_APIVERSION, 64 + Ver: process.env.VUE_APP_APIVERSION,
64 - } 65 + },
65 - }).then(res => {
66 - if (filename == null) {
67 - if (res.headers['content-disposition']) {
68 - var patt = new RegExp('filename=([^;]+\\.[^\\.;]+);*')
69 - var contentDisposition = decodeURI(res.headers['content-disposition'])
70 - var result = patt.exec(contentDisposition)
71 - filename = result[0].split('=')[1]
72 - } else {
73 - filename = 'error'
74 - }
75 - }
76 - resolveBlob(res, mimeMap[type], filename)
77 - resolve()
78 - }).catch(() => {
79 - reject()
80 }) 66 })
81 - }) 67 + .then((res) => {
68 + if (filename == null) {
69 + if (res.headers["content-disposition"]) {
70 + var patt = new RegExp("filename=([^;]+\\.[^\\.;]+);*");
71 + var contentDisposition = decodeURI(
72 + res.headers["content-disposition"]
73 + );
74 + var result = patt.exec(contentDisposition);
75 + filename = result[0].split("=")[1];
76 + } else {
77 + filename = "error";
78 + }
79 + }
80 + resolveBlob(res, mimeMap[type], filename);
81 + resolve();
82 + })
83 + .catch(() => {
84 + reject();
85 + });
86 + });
82 } 87 }
83 /** 88 /**
84 * 解析blob响应内容并下载 89 * 解析blob响应内容并下载
...@@ -86,14 +91,14 @@ export function downLoadZip(urlStatus, str, filename, type, method, data) { ...@@ -86,14 +91,14 @@ export function downLoadZip(urlStatus, str, filename, type, method, data) {
86 * @param {String} mimeType MIME类型 91 * @param {String} mimeType MIME类型
87 */ 92 */
88 export function resolveBlob(res, mimeType, filename) { 93 export function resolveBlob(res, mimeType, filename) {
89 - const aLink = document.createElement('a') 94 + const aLink = document.createElement("a");
90 - var blob = new Blob([res.data], { type: mimeType }) 95 + var blob = new Blob([res.data], { type: mimeType });
91 if (blob.size < 500) { 96 if (blob.size < 500) {
92 - var reader = new FileReader() 97 + var reader = new FileReader();
93 - reader.readAsText(blob, 'utf-8') 98 + reader.readAsText(blob, "utf-8");
94 reader.onloadend = () => { 99 reader.onloadend = () => {
95 // 获取文本内容并将其转换为JSON格式 100 // 获取文本内容并将其转换为JSON格式
96 - if (reader.result && reader.result != null && reader.result != '') { 101 + if (reader.result && reader.result != null && reader.result != "") {
97 // try { 102 // try {
98 // JSON.parse(reader.result) 103 // JSON.parse(reader.result)
99 // } catch (error) { 104 // } catch (error) {
...@@ -101,41 +106,51 @@ export function resolveBlob(res, mimeType, filename) { ...@@ -101,41 +106,51 @@ export function resolveBlob(res, mimeType, filename) {
101 // } 106 // }
102 if (JSON.parse(reader.result)) { 107 if (JSON.parse(reader.result)) {
103 var jsonData = JSON.parse(reader.result); 108 var jsonData = JSON.parse(reader.result);
104 - alertWarningMsg(jsonData.message) 109 + alertWarningMsg(jsonData.message);
105 } else { 110 } else {
106 - alertWarningMsg('文件无法下载,请重新生成后再试!') 111 + alertWarningMsg("文件无法下载,请重新生成后再试!");
107 } 112 }
108 } else { 113 } else {
109 - alertWarningMsg('文件无法下载,请重新生成后再试!') 114 + alertWarningMsg("文件无法下载,请重新生成后再试!");
110 } 115 }
111 - } 116 + };
112 } else { 117 } else {
113 // //从response的headers中获取filename, 后端response.setHeader("Content-disposition", "attachment; filename=xxxx.docx") 设置的文件名; 118 // //从response的headers中获取filename, 后端response.setHeader("Content-disposition", "attachment; filename=xxxx.docx") 设置的文件名;
114 // var patt = new RegExp('filename=([^;]+\\.[^\\.;]+);*') 119 // var patt = new RegExp('filename=([^;]+\\.[^\\.;]+);*')
115 // var contentDisposition = decodeURI(res.headers['content-disposition']) 120 // var contentDisposition = decodeURI(res.headers['content-disposition'])
116 // var result = patt.exec(contentDisposition) 121 // var result = patt.exec(contentDisposition)
117 - var fileName = filename 122 + var fileName = filename;
118 - fileName = fileName.replace(/\"/g, '') 123 + fileName = fileName.replace(/\"/g, "");
119 - aLink.href = URL.createObjectURL(blob) 124 + aLink.href = URL.createObjectURL(blob);
120 - aLink.setAttribute('download', fileName) // 设置下载文件名称 125 + aLink.setAttribute("download", fileName); // 设置下载文件名称
121 - document.body.appendChild(aLink) 126 + document.body.appendChild(aLink);
122 - aLink.click() 127 + aLink.click();
123 document.body.removeChild(aLink); 128 document.body.removeChild(aLink);
124 } 129 }
125 } 130 }
126 131
127 export function downLoadFile(url, filename, type) { 132 export function downLoadFile(url, filename, type) {
128 - const aLink = document.createElement('a') 133 + const aLink = document.createElement("a");
129 - const fileName = filename 134 + const fileName = filename;
130 - aLink.href = URL.createObjectURL(url) 135 + aLink.href = URL.createObjectURL(url);
131 - aLink.setAttribute('download', fileName) // 设置下载文件名称 136 + aLink.setAttribute("download", fileName); // 设置下载文件名称
132 - document.body.appendChild(aLink) 137 + document.body.appendChild(aLink);
133 - aLink.click() 138 + aLink.click();
134 document.body.removeChild(aLink); 139 document.body.removeChild(aLink);
135 } 140 }
136 141
137 -export function formDataDownload(str, filename, type, method, data, exportSign) { 142 +export function formDataDownload(
138 - store.dispatch('SetLoadingType', { type: true, text: '正在导出中,请稍候!' }) 143 + str,
144 + filename,
145 + type,
146 + method,
147 + data,
148 + exportSign
149 +) {
150 + store.dispatch("SetLoadingType", {
151 + type: true,
152 + text: "正在导出中,请稍候!",
153 + });
139 return new Promise((resolve, reject) => { 154 return new Promise((resolve, reject) => {
140 let iframe = document.createElement("iframe"); 155 let iframe = document.createElement("iframe");
141 iframe.style.display = "none"; 156 iframe.style.display = "none";
...@@ -156,7 +171,7 @@ export function formDataDownload(str, filename, type, method, data, exportSign) ...@@ -156,7 +171,7 @@ export function formDataDownload(str, filename, type, method, data, exportSign)
156 belongBizTypeInput.name = "downloadSreachData"; 171 belongBizTypeInput.name = "downloadSreachData";
157 belongBizTypeInput.value = JSON.stringify(data); 172 belongBizTypeInput.value = JSON.stringify(data);
158 173
159 - var verInput = document.createElement('input') 174 + var verInput = document.createElement("input");
160 verInput.type = "hidden"; 175 verInput.type = "hidden";
161 verInput.name = "Param_Ver"; 176 verInput.name = "Param_Ver";
162 verInput.value = process.env.VUE_APP_APIVERSION; 177 verInput.value = process.env.VUE_APP_APIVERSION;
...@@ -169,11 +184,13 @@ export function formDataDownload(str, filename, type, method, data, exportSign) ...@@ -169,11 +184,13 @@ export function formDataDownload(str, filename, type, method, data, exportSign)
169 document.getElementsByTagName("body")[0].removeChild(form); 184 document.getElementsByTagName("body")[0].removeChild(form);
170 // 查询导出结果 185 // 查询导出结果
171 // getType = setInterval(() => { 186 // getType = setInterval(() => {
172 - getDownLoadFileStatus(exportSign).then(() => { 187 + getDownLoadFileStatus(exportSign)
173 - resolve() 188 + .then(() => {
174 - }).catch(() => { 189 + resolve();
175 - reject() 190 + })
176 - }) 191 + .catch(() => {
192 + reject();
193 + });
177 // getdownloadExlFileType(exportSign).then((res) => { 194 // getdownloadExlFileType(exportSign).then((res) => {
178 // if (res.code == '200') { 195 // if (res.code == '200') {
179 // if (res.data.extra == 'true') { 196 // if (res.data.extra == 'true') {
...@@ -193,7 +210,7 @@ export function formDataDownload(str, filename, type, method, data, exportSign) ...@@ -193,7 +210,7 @@ export function formDataDownload(str, filename, type, method, data, exportSign)
193 // reject() 210 // reject()
194 // }) 211 // })
195 // }, 1000); 212 // }, 1000);
196 - }) 213 + });
197 } 214 }
198 215
199 //form.submit()导出xls/xlsx 216 //form.submit()导出xls/xlsx
...@@ -205,23 +222,23 @@ export function formSubmitDownload(url, method, data, exportSign = null) { ...@@ -205,23 +222,23 @@ export function formSubmitDownload(url, method, data, exportSign = null) {
205 document.getElementsByTagName("body")[0].appendChild(iframe); 222 document.getElementsByTagName("body")[0].appendChild(iframe);
206 var form = document.createElement("form"); 223 var form = document.createElement("form");
207 form.target = "formTarget"; 224 form.target = "formTarget";
208 - form.action = baseUrl + apiUrl[url] 225 + form.action = baseUrl + apiUrl[url];
209 - form.method = method 226 + form.method = method;
210 if (data) { 227 if (data) {
211 - let domObj = {} 228 + let domObj = {};
212 data.forEach((item, i) => { 229 data.forEach((item, i) => {
213 domObj[`input${i}`] = document.createElement("input"); 230 domObj[`input${i}`] = document.createElement("input");
214 domObj[`input${i}`].type = "hidden"; 231 domObj[`input${i}`].type = "hidden";
215 domObj[`input${i}`].name = item.key; 232 domObj[`input${i}`].name = item.key;
216 domObj[`input${i}`].value = item.value; 233 domObj[`input${i}`].value = item.value;
217 form.appendChild(domObj[`input${i}`]); 234 form.appendChild(domObj[`input${i}`]);
218 - }) 235 + });
219 var tokenInput = document.createElement("input"); 236 var tokenInput = document.createElement("input");
220 tokenInput.type = "hidden"; 237 tokenInput.type = "hidden";
221 tokenInput.name = "Param_Authorization"; 238 tokenInput.name = "Param_Authorization";
222 tokenInput.value = getToken(); 239 tokenInput.value = getToken();
223 form.appendChild(tokenInput); 240 form.appendChild(tokenInput);
224 - var verInput = document.createElement('input') 241 + var verInput = document.createElement("input");
225 verInput.type = "hidden"; 242 verInput.type = "hidden";
226 verInput.name = "Param_Ver"; 243 verInput.name = "Param_Ver";
227 verInput.value = process.env.VUE_APP_APIVERSION; 244 verInput.value = process.env.VUE_APP_APIVERSION;
...@@ -231,13 +248,15 @@ export function formSubmitDownload(url, method, data, exportSign = null) { ...@@ -231,13 +248,15 @@ export function formSubmitDownload(url, method, data, exportSign = null) {
231 form.submit(); 248 form.submit();
232 document.getElementsByTagName("body")[0].removeChild(form); 249 document.getElementsByTagName("body")[0].removeChild(form);
233 if (exportSign != null) { 250 if (exportSign != null) {
234 - getDownLoadFileStatus(exportSign).then(() => { 251 + getDownLoadFileStatus(exportSign)
235 - resolve() 252 + .then(() => {
236 - }).catch(() => { 253 + resolve();
237 - reject() 254 + })
238 - }) 255 + .catch(() => {
256 + reject();
257 + });
239 } else { 258 } else {
240 - resolve() 259 + resolve();
241 } 260 }
242 - }) 261 + });
243 } 262 }
......
1 +<template>
2 + <el-dialog
3 + class="entryDialog classCUploadDialog"
4 + title="自定义内容"
5 + :visible.sync="customVisible"
6 + v-loading="dialogLoading"
7 + :show-close="false"
8 + width="700px"
9 + :close-on-click-modal="false"
10 + >
11 + <div
12 + style="
13 + display: flex;
14 + flex-direction: column;
15 + justify-content: center;
16 + align-items: center;
17 + gap: 30px;
18 + "
19 + >
20 + <div class="radio-group">
21 + <el-radio-group v-model="radio" @change="radioChange">
22 + <el-radio :label="3">物流运单编号维度</el-radio>
23 + <el-radio :label="6">商品维度</el-radio>
24 + </el-radio-group>
25 + </div>
26 + <template v-if="radio === 3">
27 + <el-transfer
28 + v-model="transferValue"
29 + :data="logisticsWaybillDimension"
30 + filterable
31 + target-order="push"
32 + :props="{ label: 'itemChineseName', key: 'itemValue' }"
33 + :titles="['未选内容', '已选内容']"
34 + ></el-transfer>
35 + </template>
36 + <template v-if="radio === 6">
37 + <el-transfer
38 + v-model="transferValue1"
39 + :data="commodityDetailDimension"
40 + filterable
41 + target-order="push"
42 + :props="{ label: 'itemChineseName', key: 'itemValue' }"
43 + :titles="['未选内容', '已选内容']"
44 + ></el-transfer>
45 + </template>
46 + </div>
47 + <div class="dialogOption entrySave revokeOperation">
48 + <el-button
49 + class="entrySaveButton entrySaveButton-background revokeSubmitBtn"
50 + type="primary"
51 + @click="formSubmit"
52 + >
53 + 确定
54 + </el-button>
55 + <el-button class="entrySaveButton" @click="cancelModify">关闭</el-button>
56 + </div>
57 + </el-dialog>
58 +</template>
59 +
60 +<script>
61 +import { getDictData } from "@/api/system/dict-api.js";
62 +import {
63 + getCustomizeExcelFormat,
64 + getCustomizeExcel,
65 +} from "@/api/exportList-api.js";
66 +
67 +export default {
68 + props: {
69 + showDialog: {
70 + type: Boolean,
71 + default: false,
72 + },
73 + selectedDatas: {
74 + type: Array,
75 + default: () => [],
76 + },
77 + },
78 + data() {
79 + const generateData = (_) => {
80 + const data = [];
81 + for (let i = 1; i <= 15; i++) {
82 + data.push({
83 + key: i,
84 + label: `备选项 ${i}`,
85 + disabled: i % 4 === 0,
86 + });
87 + }
88 + return data;
89 + };
90 + return {
91 + customVisible: false,
92 + dialogLoading: false,
93 + transferValue: [],
94 + transferValue1: [],
95 + data: generateData(),
96 + radio: 3,
97 + commodityDetailDimension: [],
98 + logisticsWaybillDimension: [],
99 + historyInfo: {},
100 + };
101 + },
102 + watch: {
103 + showDialog(val) {
104 + if (val) {
105 + this.customVisible = val;
106 + this.getList();
107 + }
108 + },
109 + },
110 + created() {},
111 + methods: {
112 + async getList() {
113 + // COMMODITY_DETAIL_DIMENSION 商品明细维度字典code
114 + // LOGISTICS_WAYBILL_DIMENSION 物流运单编号维度字典code
115 + await getDictData({
116 + doctCode: "COMMODITY_DETAIL_DIMENSION",
117 + }).then((res) => {
118 + if (res.code === "200") {
119 + this.commodityDetailDimension = res.data;
120 + }
121 + });
122 + await getDictData({
123 + doctCode: "LOGISTICS_WAYBILL_DIMENSION",
124 + }).then((res) => {
125 + if (res.code === "200") {
126 + this.logisticsWaybillDimension = res.data;
127 + }
128 + });
129 + await getCustomizeExcel({}).then((res) => {
130 + if (res.code === "200") {
131 + this.transferValue = res.data.defaultLogisticsWaybill;
132 + this.transferValue1 = res.data.defaultCommodityDetail;
133 + this.historyInfo = res.data;
134 + this.$nextTick(() => {
135 + this.commodityDetailDimension = this.commodityDetailDimension.map(
136 + (item) => {
137 + return {
138 + ...item,
139 + disabled: res.data.defaultCommodityDetail.includes(
140 + item.itemValue
141 + ),
142 + };
143 + }
144 + );
145 + this.logisticsWaybillDimension = this.logisticsWaybillDimension.map(
146 + (item) => {
147 + return {
148 + ...item,
149 + disabled: res.data.defaultLogisticsWaybill.includes(
150 + item.itemValue
151 + ),
152 + };
153 + }
154 + );
155 + });
156 + }
157 + });
158 + },
159 + radioChange(e) {
160 + console.log(e);
161 + if (e === 3) {
162 + this.transferValue = this.historyInfo.defaultLogisticsWaybill;
163 + } else if (e === 6) {
164 + this.transferValue1 = this.historyInfo.defaultCommodityDetail;
165 + }
166 + },
167 +
168 + formSubmit() {
169 + let params = {
170 + // 商品明细维度字段
171 + commodityDetailDimension: {},
172 + // 物流运单编号维度
173 + logisticsWaybillDimension: {},
174 + };
175 +
176 + // 物流运单编号维度 3
177 + params.logisticsWaybillDimension = this.transferValue.reduce(
178 + (acc, item) => {
179 + const dimension = this.logisticsWaybillDimension?.find(
180 + (dim) => dim?.itemValue === item
181 + );
182 + if (dimension?.itemChineseName) {
183 + acc[dimension.itemChineseName] = item;
184 + }
185 + return acc;
186 + },
187 + {}
188 + );
189 + params.commodityDetailDimension = this.transferValue1.reduce(
190 + (acc, item) => {
191 + const dimension = this.commodityDetailDimension?.find(
192 + (dim) => dim?.itemValue === item
193 + );
194 + if (dimension?.itemChineseName) {
195 + acc[dimension.itemChineseName] = item;
196 + }
197 + return acc;
198 + },
199 + {}
200 + );
201 +
202 + console.log("datas==", params);
203 + getCustomizeExcelFormat(params)
204 + .then((res) => {
205 + if (res.code === "200") {
206 + this.msgSuccess("修改成功");
207 + this.cancelModify(1);
208 + } else {
209 + this.alertWarningMsg(res.message);
210 + this.cancelModify(0);
211 + }
212 + })
213 + .catch((err) => {
214 + console.log(err);
215 + this.alertWarningMsg(err.message);
216 + this.cancelModify(0);
217 + });
218 + },
219 +
220 + cancelModify(val) {
221 + this.customVisible = false;
222 + this.dialogLoading = false;
223 + this.$emit("cancelModify", val);
224 + },
225 + },
226 +};
227 +</script>
228 +
229 +<style lang="scss" scoped>
230 +@import "@/assets/styles/variables.scss";
231 +::v-deep {
232 + .el-transfer-panel .el-checkbox__inner {
233 + height: 17px;
234 + width: 13px;
235 + }
236 + .el-button--primary,
237 + .el-button--primary:hover,
238 + .el-button--primary:focus {
239 + color: #ff6200;
240 + }
241 +}
242 +
243 +.revokeOperation {
244 + margin-bottom: 25px;
245 + .revokeSubmitBtn {
246 + margin-right: 30px;
247 + }
248 +}
249 +</style>
...@@ -11,16 +11,6 @@ ...@@ -11,16 +11,6 @@
11 <!-- 物流运单编号 --> 11 <!-- 物流运单编号 -->
12 <el-col :span="5"> 12 <el-col :span="5">
13 <Formitem label="物流运单编号" prop="logisticsNo"> 13 <Formitem label="物流运单编号" prop="logisticsNo">
14 - <!-- <el-input
15 - type="text"
16 - class="inputShadow"
17 - id="inputInner--logisticsNo"
18 - resize="none"
19 - v-model="sreachFormData.logisticsNo"
20 - clearable
21 - placeholder=""
22 - ></el-input> -->
23 -
24 <FormTextareaInput 14 <FormTextareaInput
25 :formData="sreachFormData" 15 :formData="sreachFormData"
26 dataKey="logisticsNo" 16 dataKey="logisticsNo"
...@@ -40,11 +30,6 @@ ...@@ -40,11 +30,6 @@
40 clearable 30 clearable
41 placeholder="" 31 placeholder=""
42 ></el-input> 32 ></el-input>
43 - <!-- <FormTextareaInput
44 - :formData="sreachFormData"
45 - dataKey="billNo"
46 - @formChange="formChange"
47 - /> -->
48 </Formitem> 33 </Formitem>
49 </el-col> 34 </el-col>
50 <!-- 订单编号 --> 35 <!-- 订单编号 -->
...@@ -181,23 +166,24 @@ ...@@ -181,23 +166,24 @@
181 </el-form> 166 </el-form>
182 <div class="optionButton"> 167 <div class="optionButton">
183 <div> 168 <div>
184 - <!-- <el-button class="entrySaveButton" size="small" @click="downloadData"> 169 + <el-button
185 - <svg-icon 170 + size="small"
186 - class="el-icon-user-solid" 171 + type="primary"
187 - icon-class="customCodeConfig" 172 + class="dropdown-style-button"
188 - ></svg-icon> 173 + @click="customDialogShow = true"
189 - 汇总申请单 174 + >
190 - </el-button> --> 175 + <svg-icon class="el-icon-user-solid" icon-class="zidingyi"></svg-icon>
191 - </div> 176 + 自定义内容
192 - <div> 177 + </el-button>
193 - <!-- <el-button 178 +
179 + <el-button
194 class="entrySaveButton" 180 class="entrySaveButton"
195 size="small" 181 size="small"
196 icon="el-icon-download" 182 icon="el-icon-download"
197 @click="downloadData" 183 @click="downloadData"
198 > 184 >
199 导出 185 导出
200 - </el-button> --> 186 + </el-button>
201 </div> 187 </div>
202 </div> 188 </div>
203 <Table 189 <Table
...@@ -235,30 +221,36 @@ ...@@ -235,30 +221,36 @@
235 @popoverClose="popoverClose" 221 @popoverClose="popoverClose"
236 > 222 >
237 <div slot="title"> 223 <div slot="title">
238 - <span style="font-weight: 700; color: #515a6e">提单运号:</span 224 + <span style="font-weight: 700; color: #515a6e">提单运号:</span>
239 - >{{ scope.row.billNo }} 225 + {{ scope.row.billNo }}
240 </div> 226 </div>
241 <div slot="buttonLabel"> 227 <div slot="buttonLabel">
242 {{ scope.row.returnStatus }} 228 {{ scope.row.returnStatus }}
243 </div> 229 </div>
244 </TablePopover> 230 </TablePopover>
245 </template> 231 </template>
246 - <template v-slot:logisticsNo="scope"> 232 + <template v-slot:billNo="scope">
247 - <el-button type="text" @click="view(scope.row)">{{ 233 + <el-button type="text" @click="view(scope.row)">
248 - scope.row.logisticsNo 234 + {{ scope.row.billNo }}
249 - }}</el-button> 235 + </el-button>
250 </template> 236 </template>
251 </Table> 237 </Table>
238 + <CustomDialog :showDialog="customDialogShow" @cancelModify="cancelModify" />
252 </div> 239 </div>
253 </template> 240 </template>
254 241
255 <script> 242 <script>
256 import { getAllexportList, getListReceiptData } from "@/api/exportList-api.js"; 243 import { getAllexportList, getListReceiptData } from "@/api/exportList-api.js";
244 +import CustomDialog from "./custom-dialog.vue";
257 245
258 export default { 246 export default {
259 name: "ExportBillQuery", 247 name: "ExportBillQuery",
248 + components: {
249 + CustomDialog,
250 + },
260 data() { 251 data() {
261 return { 252 return {
253 + customDialogShow: false,
262 sreachFormData: { 254 sreachFormData: {
263 billNo: "", 255 billNo: "",
264 ebpcode: "", 256 ebpcode: "",
...@@ -284,15 +276,15 @@ export default { ...@@ -284,15 +276,15 @@ export default {
284 slot: true, 276 slot: true,
285 }, 277 },
286 { 278 {
287 - name: "物流运单编号", 279 + name: "提运单号",
288 - value: "logisticsNo", 280 + value: "billNo",
289 width: "", 281 width: "",
290 align: "left", 282 align: "left",
291 slot: true, 283 slot: true,
292 }, 284 },
293 { 285 {
294 - name: "提运单号", 286 + name: "物流运单编号",
295 - value: "billNo", 287 + value: "logisticsNo",
296 width: "", 288 width: "",
297 align: "left", 289 align: "left",
298 }, 290 },
...@@ -388,6 +380,9 @@ export default { ...@@ -388,6 +380,9 @@ export default {
388 }, 380 },
389 }, 381 },
390 methods: { 382 methods: {
383 + cancelModify() {
384 + this.customDialogShow = false;
385 + },
391 //查询 386 //查询
392 search(val) { 387 search(val) {
393 this.loadings.searchLoading = true; 388 this.loadings.searchLoading = true;
...@@ -439,7 +434,35 @@ export default { ...@@ -439,7 +434,35 @@ export default {
439 }; 434 };
440 }, 435 },
441 //导出 436 //导出
442 - downloadData() {}, 437 + downloadData() {
438 + let obj = { ...this.sreachFormData };
439 + obj.pageIndex = this.page.pageIndex;
440 + obj.pageSize = this.page.pageSize;
441 + obj.createTimeStart = "";
442 + obj.createTimeEnd = "";
443 + if (obj.createTime.length > 0) {
444 + obj.createTimeStart = obj.createTime[0];
445 + obj.createTimeEnd = obj.createTime[1];
446 + }
447 + delete obj.createTime;
448 + if (obj.logisticsNo != null && obj.logisticsNo != "") {
449 + obj.logisticsNo = obj.logisticsNo.split("\n");
450 + } else {
451 + obj.logisticsNo = [];
452 + }
453 +
454 + // getListExport(obj).then((res) => {
455 + // // 2. 清单查询
456 + // console.log(res);
457 + // });
458 + this.fileDownload
459 + .downLoadZip("api", "listExport", "清单查询.xlsx", "xlsx", "post", {
460 + ...obj,
461 + })
462 + .finally(() => {
463 + this.cancelDownload();
464 + });
465 + },
443 //查询详情 466 //查询详情
444 view(val) { 467 view(val) {
445 this.$router.push({ 468 this.$router.push({
...@@ -543,7 +566,8 @@ export default { ...@@ -543,7 +566,8 @@ export default {
543 padding: 10px; 566 padding: 10px;
544 text-align: right; 567 text-align: right;
545 display: flex; 568 display: flex;
546 - justify-content: space-between; 569 + justify-content: flex-end;
570 + gap: 10px;
547 571
548 .el-button { 572 .el-button {
549 color: $fedexButton; 573 color: $fedexButton;
...@@ -562,6 +586,18 @@ export default { ...@@ -562,6 +586,18 @@ export default {
562 background-color: $fedexButton !important; 586 background-color: $fedexButton !important;
563 } 587 }
564 } 588 }
589 + /* 使按钮样式与 el-dropdown 一致 */
590 + .el-button.dropdown-style-button {
591 + background-color: #ffffff !important;
592 + border: 2px solid $fedexBottonColor !important; /* 设置边框颜色 */
593 + color: $fedexBottonColor !important;
594 + font-size: 12px !important;
595 + }
596 + .el-button.dropdown-style-button:hover,
597 + .el-button.dropdown-style-button:focus {
598 + color: #ffffff !important;
599 + background-color: $fedexBottonColor !important;
600 + }
565 } 601 }
566 602
567 .texttareaTip { 603 .texttareaTip {
......
...@@ -48,7 +48,11 @@ ...@@ -48,7 +48,11 @@
48 placeholder="" 48 placeholder=""
49 > 49 >
50 <el-option 50 <el-option
51 - v-for="(item, index) in $store.getters.dict.RECEIPT_STATUS.filter(fItem => fItem.itemChineseName !== '已提交')" 51 + v-for="(
52 + item, index
53 + ) in $store.getters.dict.RECEIPT_STATUS.filter(
54 + (fItem) => fItem.itemChineseName !== '已提交'
55 + )"
52 :key="index" 56 :key="index"
53 :label="item.itemChineseName" 57 :label="item.itemChineseName"
54 :value="item.itemValue" 58 :value="item.itemValue"
...@@ -146,10 +150,10 @@ ...@@ -146,10 +150,10 @@
146 </div> 150 </div>
147 </TablePopover> 151 </TablePopover>
148 </template> 152 </template>
149 - <template v-slot:logisticsNo="scope"> 153 + <template v-slot:billNo="scope">
150 <el-button type="text" @click="view(scope.row)">{{ 154 <el-button type="text" @click="view(scope.row)">{{
151 - scope.row.logisticsNo 155 + scope.row.billNo
152 - }}</el-button> 156 + }}</el-button>
153 </template> 157 </template>
154 </Table> 158 </Table>
155 </div> 159 </div>
...@@ -187,15 +191,15 @@ export default { ...@@ -187,15 +191,15 @@ export default {
187 slot: true, 191 slot: true,
188 }, 192 },
189 { 193 {
190 - name: "物流运单编号", 194 + name: "提运单号",
191 - value: "logisticsNo", 195 + value: "billNo",
192 width: "", 196 width: "",
193 align: "left", 197 align: "left",
194 - slot: true 198 + slot: true,
195 }, 199 },
196 { 200 {
197 - name: "提运单号", 201 + name: "物流运单编号",
198 - value: "billNo", 202 + value: "logisticsNo",
199 width: "", 203 width: "",
200 align: "left", 204 align: "left",
201 }, 205 },
...@@ -359,7 +363,7 @@ export default { ...@@ -359,7 +363,7 @@ export default {
359 }) 363 })
360 .finally(() => { 364 .finally(() => {
361 this.$nextTick(() => { 365 this.$nextTick(() => {
362 - this.$store.dispatch('setLoadingState', false) 366 + this.$store.dispatch("setLoadingState", false);
363 this.$refs.returnStatusPopover.tableLoading = false; 367 this.$refs.returnStatusPopover.tableLoading = false;
364 }); 368 });
365 }); 369 });
......
...@@ -535,6 +535,12 @@ export default { ...@@ -535,6 +535,12 @@ export default {
535 align: "left", 535 align: "left",
536 }, 536 },
537 { 537 {
538 + name: "航班号",
539 + value: "flightNumber",
540 + width: "",
541 + align: "left",
542 + },
543 + {
538 name: "物流运单编号", 544 name: "物流运单编号",
539 value: "logisticsWaybillNumber", 545 value: "logisticsWaybillNumber",
540 width: "", 546 width: "",
...@@ -976,7 +982,7 @@ export default { ...@@ -976,7 +982,7 @@ export default {
976 declareIds: this.selected.map((item) => item.declareId), 982 declareIds: this.selected.map((item) => item.declareId),
977 type: dropdownCode, 983 type: dropdownCode,
978 }; 984 };
979 - if (dropdownName === "一键申报" || dropdownName === "清单总分单申报") { 985 + if (dropdownName === "清单总分单申报") {
980 this.dataPreviewVisible = true; 986 this.dataPreviewVisible = true;
981 this.dataPreviewTitle = `预览-${dropdownName}`; 987 this.dataPreviewTitle = `预览-${dropdownName}`;
982 this.currentLoadingKey = loadingKey; 988 this.currentLoadingKey = loadingKey;
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
5 :visible.sync="batchModifyVisible" 5 :visible.sync="batchModifyVisible"
6 v-loading="dialogLoading" 6 v-loading="dialogLoading"
7 :show-close="false" 7 :show-close="false"
8 - width="550px" 8 + width="700px"
9 :close-on-click-modal="false" 9 :close-on-click-modal="false"
10 > 10 >
11 <div> 11 <div>
...@@ -17,56 +17,68 @@ ...@@ -17,56 +17,68 @@
17 label-position="left" 17 label-position="left"
18 size="small" 18 size="small"
19 > 19 >
20 - <Formitem label="提运单号" prop="billNo" type="edit"> 20 + <el-row :gutter="5">
21 - <el-input 21 + <el-col :span="16">
22 - type="text" 22 + <Formitem label="提运单号" prop="billNo" type="edit">
23 - id="inputInner-edit-billNo" 23 + <el-input
24 - class="inputShadow" 24 + type="text"
25 - resize="none" 25 + id="inputInner-edit-billNo"
26 - v-model="weightForm.billNo" 26 + class="inputShadow"
27 - clearable 27 + resize="none"
28 - placeholder="请输入提运单号" 28 + v-model="weightForm.billNo"
29 - @change="inputChange" 29 + clearable
30 - ></el-input> 30 + placeholder="请输入提运单号"
31 - </Formitem> 31 + @change="inputChange"
32 - <Formitem label="件数" prop="count" type="edit"> 32 + ></el-input>
33 - <el-input 33 + </Formitem>
34 - type="text" 34 + </el-col>
35 - id="inputInner-edit-count" 35 + <el-col :span="8">
36 - class="inputShadow" 36 + <Formitem label="件数" prop="count" type="edit">
37 - resize="none" 37 + <el-input
38 - v-model="weightForm.count" 38 + type="text"
39 - clearable 39 + id="inputInner-edit-count"
40 - disabled 40 + class="inputShadow"
41 - placeholder="请输入件数" 41 + resize="none"
42 - ></el-input> 42 + v-model="weightForm.count"
43 - </Formitem> 43 + clearable
44 - <Formitem label="原毛重" prop="totalWeight" type="edit"> 44 + disabled
45 - <el-input 45 + placeholder="请输入件数"
46 - type="text" 46 + ></el-input>
47 - id="inputInner-edit-totalWeight" 47 + </Formitem>
48 - class="inputShadow" 48 + </el-col>
49 - resize="none" 49 + </el-row>
50 - v-model="weightForm.totalWeight" 50 + <el-row :gutter="5">
51 - clearable 51 + <el-col :span="12">
52 - disabled 52 + <Formitem label="原毛重" prop="totalWeight" type="edit">
53 - placeholder="请输入原毛重" 53 + <el-input
54 - ></el-input> 54 + type="text"
55 - </Formitem> 55 + id="inputInner-edit-totalWeight"
56 - <Formitem label="修改后毛重" prop="weight" type="edit"> 56 + class="inputShadow"
57 - <el-input 57 + resize="none"
58 - type="text" 58 + v-model="weightForm.totalWeight"
59 - id="inputInner-edit-weight" 59 + clearable
60 - class="inputShadow" 60 + disabled
61 - resize="none" 61 + placeholder="请输入原毛重"
62 - v-model="weightForm.weight" 62 + ></el-input>
63 - clearable 63 + </Formitem>
64 - placeholder="请输入修改后毛重" 64 + </el-col>
65 - @change="weightChange" 65 + <el-col :span="12">
66 - ></el-input> 66 + <Formitem label="修改后毛重" prop="weight" type="edit">
67 - </Formitem> 67 + <el-input
68 - <Formitem label="" prop="content" type="edit"> 68 + type="text"
69 - <!-- <el-input 69 + id="inputInner-edit-weight"
70 + class="inputShadow"
71 + resize="none"
72 + v-model="weightForm.weight"
73 + clearable
74 + placeholder="请输入修改后毛重"
75 + @change="weightChange"
76 + ></el-input>
77 + </Formitem>
78 + </el-col>
79 + <el-col :span="24">
80 + <Formitem label="" prop="content" type="edit">
81 + <!-- <el-input
70 type="textarea" 82 type="textarea"
71 id="inputInner-edit-content" 83 id="inputInner-edit-content"
72 class="inputShadow" 84 class="inputShadow"
...@@ -76,13 +88,15 @@ ...@@ -76,13 +88,15 @@
76 clearable 88 clearable
77 placeholder="请输入修改内容" 89 placeholder="请输入修改内容"
78 ></el-input> --> 90 ></el-input> -->
79 - <div class="form-item-tips"> 91 + <div class="form-item-tips">
80 - <h2>修改内容</h2> 92 + <h2>修改内容</h2>
81 - <div> 93 + <div>
82 - {{ weightForm.content }} 94 + {{ weightForm.content }}
83 - </div> 95 + </div>
84 - </div> 96 + </div>
85 - </Formitem> 97 + </Formitem>
98 + </el-col>
99 + </el-row>
86 </el-form> 100 </el-form>
87 </div> 101 </div>
88 <div class="dialogOption entrySave revokeOperation"> 102 <div class="dialogOption entrySave revokeOperation">
......