|
@@ -90,7 +90,9 @@
|
|
|
>
|
|
>
|
|
|
打印
|
|
打印
|
|
|
</a-button>
|
|
</a-button>
|
|
|
- <a-button type="dashed" @click="downloadImage"> 下载全部 </a-button>
|
|
|
|
|
|
|
+ <a-button type="dashed" @click="downloadImageZip">
|
|
|
|
|
+ 下载全部
|
|
|
|
|
+ </a-button>
|
|
|
</div>
|
|
</div>
|
|
|
<a-divider />
|
|
<a-divider />
|
|
|
<CommonTable
|
|
<CommonTable
|
|
@@ -199,15 +201,16 @@ import Common from '../common/Common';
|
|
|
import { message } from 'ant-design-vue';
|
|
import { message } from 'ant-design-vue';
|
|
|
import { ref, reactive, onMounted, watch } from 'vue';
|
|
import { ref, reactive, onMounted, watch } from 'vue';
|
|
|
import CreateJPEG from '../common/X6';
|
|
import CreateJPEG from '../common/X6';
|
|
|
-import { base64toFile, downloadImages } from '../common/X6';
|
|
|
|
|
|
|
+import { base64toFile } from '../common/X6';
|
|
|
import { SqlApi, Notify } from 'pc-component-v3';
|
|
import { SqlApi, Notify } from 'pc-component-v3';
|
|
|
import { getImageSrc } from '../common/image-src';
|
|
import { getImageSrc } from '../common/image-src';
|
|
|
-import Download from '../resource/file/DownloadService';
|
|
|
|
|
|
|
+import DownloadService from '../resource/file/DownloadService';
|
|
|
import {
|
|
import {
|
|
|
columns,
|
|
columns,
|
|
|
dateConvert,
|
|
dateConvert,
|
|
|
multipleImageUpload,
|
|
multipleImageUpload,
|
|
|
getTemplate,
|
|
getTemplate,
|
|
|
|
|
+ downloadZip,
|
|
|
} from './config';
|
|
} from './config';
|
|
|
|
|
|
|
|
const className = ref('com.leanwo.prodog.print.model.LabelPrintLine');
|
|
const className = ref('com.leanwo.prodog.print.model.LabelPrintLine');
|
|
@@ -325,7 +328,6 @@ const searchPrintInfo = () => {
|
|
|
// 获取所选项的数据
|
|
// 获取所选项的数据
|
|
|
const selectColumn = rows => {
|
|
const selectColumn = rows => {
|
|
|
select.selectedRows = rows;
|
|
select.selectedRows = rows;
|
|
|
- console.log('onSelectChange', select.selectedRows);
|
|
|
|
|
};
|
|
};
|
|
|
// 展开打印框
|
|
// 展开打印框
|
|
|
const showPrintInfo = () => {
|
|
const showPrintInfo = () => {
|
|
@@ -400,7 +402,7 @@ const printCard = async () => {
|
|
|
let tempStr = JSON.stringify(templateData.value);
|
|
let tempStr = JSON.stringify(templateData.value);
|
|
|
const rows = JSON.parse(JSON.stringify(select.selectedRows));
|
|
const rows = JSON.parse(JSON.stringify(select.selectedRows));
|
|
|
for (let key in rows) {
|
|
for (let key in rows) {
|
|
|
- let base64 = await getBase64(rows[key], tempStr,rows[key].assetNo);
|
|
|
|
|
|
|
+ let base64 = await getBase64(rows[key], tempStr, rows[key].assetNo);
|
|
|
let file = base64toFile(base64, rows[key].id);
|
|
let file = base64toFile(base64, rows[key].id);
|
|
|
formData.append('file', file);
|
|
formData.append('file', file);
|
|
|
}
|
|
}
|
|
@@ -426,48 +428,18 @@ const printCard = async () => {
|
|
|
);
|
|
);
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
-const downloadImage = () => {
|
|
|
|
|
- globalLoading.value = true;
|
|
|
|
|
- if (status.value !== undefined) {
|
|
|
|
|
- queryParams.labelPrintType = status.value.slice(
|
|
|
|
|
- 0,
|
|
|
|
|
- status.value.indexOf('-'),
|
|
|
|
|
- );
|
|
|
|
|
- }
|
|
|
|
|
- pager.start = 0;
|
|
|
|
|
- pager.length = 10000;
|
|
|
|
|
- let params = { ...queryParams, ...pager };
|
|
|
|
|
- if (queryParams.batchNo !== '') {
|
|
|
|
|
- SqlApi.execute('20230613_140456', params).then(
|
|
|
|
|
- successData => {
|
|
|
|
|
- const { lines, errorMessage, errorCode } = successData;
|
|
|
|
|
- if (errorCode == 0) {
|
|
|
|
|
- total.value = successData.total;
|
|
|
|
|
- console.log(lines,'-----------------');
|
|
|
|
|
- lines.forEach(item => {
|
|
|
|
|
- let url = getImageSrc(className.value, item.imageUrl);
|
|
|
|
|
- downloadImages(url, item.id);
|
|
|
|
|
- });
|
|
|
|
|
- globalLoading.value = false;
|
|
|
|
|
- } else {
|
|
|
|
|
- Notify.error('查询异常', errorMessage, true);
|
|
|
|
|
- }
|
|
|
|
|
- globalLoading.value = false;
|
|
|
|
|
- },
|
|
|
|
|
- errorData => {
|
|
|
|
|
- Common.processException(errorData);
|
|
|
|
|
- globalLoading.value = false;
|
|
|
|
|
- },
|
|
|
|
|
- );
|
|
|
|
|
|
|
+const downloadImageZip = () => {
|
|
|
|
|
+ if (queryParams.batchNo === '') {
|
|
|
|
|
+ message.warning('请选择导入批次');
|
|
|
} else {
|
|
} else {
|
|
|
- message.error('请选择导入批次');
|
|
|
|
|
- status.value = '';
|
|
|
|
|
- dataSource.value = [];
|
|
|
|
|
- queryParams.clientName = '';
|
|
|
|
|
- queryParams.costCenterName = '';
|
|
|
|
|
- queryParams.depositoryUser = '';
|
|
|
|
|
- queryParams.organizationName = '';
|
|
|
|
|
- globalLoading.value = false;
|
|
|
|
|
|
|
+ globalLoading.value = true;
|
|
|
|
|
+ let params = { batchNo: queryParams.batchNo };
|
|
|
|
|
+ downloadZip(params).then(successData => {
|
|
|
|
|
+ const downloadUrl = `/api/LabelPrintResource/batchImageDownload?batchNo=${queryParams.batchNo}`;
|
|
|
|
|
+ window.open(downloadUrl);
|
|
|
|
|
+ message.success('下载成功');
|
|
|
|
|
+ globalLoading.value = false;
|
|
|
|
|
+ });
|
|
|
}
|
|
}
|
|
|
};
|
|
};
|
|
|
|
|
|