|
|
@@ -11,7 +11,7 @@
|
|
|
show-search
|
|
|
class="commonStyle"
|
|
|
:options="batchNos.map((item) => ({ value: item.label }))"
|
|
|
- @change="searchPrintInfo"
|
|
|
+ @change="batchNoChange"
|
|
|
/>
|
|
|
<label>保管人员:</label>
|
|
|
<a-select
|
|
|
@@ -19,20 +19,20 @@
|
|
|
show-search
|
|
|
class="commonStyle"
|
|
|
:options="depositoryUsers.map((item) => ({ value: item.label }))"
|
|
|
- @change="searchPrintInfo"
|
|
|
+ @change="searchDatas"
|
|
|
/>
|
|
|
<label>打印状态:</label>
|
|
|
<a-select
|
|
|
- v-model:value="status"
|
|
|
+ v-model:value="queryParams.labelPrintType"
|
|
|
show-search
|
|
|
class="commonStyle"
|
|
|
:options="
|
|
|
statusOptions.map((item) => ({
|
|
|
- value: `${item.value}-${item.label}`,
|
|
|
+ value: item.value,
|
|
|
label: item.label,
|
|
|
}))
|
|
|
"
|
|
|
- @change="searchPrintInfo"
|
|
|
+ @change="searchDatas"
|
|
|
/>
|
|
|
</div>
|
|
|
<div style="margin: 8px 0 0 9px">
|
|
|
@@ -42,7 +42,7 @@
|
|
|
show-search
|
|
|
class="commonStyle"
|
|
|
:options="clientNames.map((item) => ({ value: item.label }))"
|
|
|
- @change="searchPrintInfo"
|
|
|
+ @change="searchDatas"
|
|
|
/>
|
|
|
<label>所属部门:</label>
|
|
|
<a-select
|
|
|
@@ -50,7 +50,7 @@
|
|
|
show-search
|
|
|
class="commonStyle"
|
|
|
:options="organizationNames.map((item) => ({ value: item.label }))"
|
|
|
- @change="searchPrintInfo"
|
|
|
+ @change="searchDatas"
|
|
|
/>
|
|
|
<label>成本中心:</label>
|
|
|
<a-select
|
|
|
@@ -58,9 +58,9 @@
|
|
|
show-search
|
|
|
class="commonStyle"
|
|
|
:options="costCenterNames.map((item) => ({ value: item.label }))"
|
|
|
- @change="searchPrintInfo"
|
|
|
+ @change="searchDatas"
|
|
|
/>
|
|
|
- <a-button type="primary" @click="searchPrintInfo">查询</a-button>
|
|
|
+ <a-button type="primary" @click="searchDatas">查询</a-button>
|
|
|
</div>
|
|
|
<div style="margin-top: 8px">
|
|
|
<span style="color: red"> * </span>
|
|
|
@@ -100,7 +100,7 @@
|
|
|
</div>
|
|
|
<a-divider />
|
|
|
<CommonTable
|
|
|
- ref="tables"
|
|
|
+ ref="table"
|
|
|
:total="total"
|
|
|
:columns="columns"
|
|
|
:is-loading="isLoading"
|
|
|
@@ -137,11 +137,7 @@
|
|
|
:disabled="true"
|
|
|
/>
|
|
|
<label>上次的批号:</label>
|
|
|
- <a-input
|
|
|
- id="displayName"
|
|
|
- v-model:value="lastPackageBatchNo"
|
|
|
- :disabled="true"
|
|
|
- />
|
|
|
+ <a-input v-model:value="lastPackageBatchNo" :disabled="true" />
|
|
|
<label>包装名称:</label>
|
|
|
<a-input
|
|
|
id="displayName"
|
|
|
@@ -149,11 +145,7 @@
|
|
|
:disabled="true"
|
|
|
/>
|
|
|
<label>上次的名称:</label>
|
|
|
- <a-input
|
|
|
- id="displayName"
|
|
|
- v-model:value="lastPackageName"
|
|
|
- :disabled="true"
|
|
|
- />
|
|
|
+ <a-input v-model:value="lastPackageName" :disabled="true" />
|
|
|
<div class="operationBtn">
|
|
|
<a-button type="dashed" style="width: 240px" @click="lastTime">
|
|
|
同上一次
|
|
|
@@ -176,7 +168,7 @@
|
|
|
<a-image :src="imageUrls[0]" />
|
|
|
<template #footer />
|
|
|
</a-modal>
|
|
|
- <Loading v-if="globalLoading" />
|
|
|
+ <Loading v-if="globalLoading" :text="propText" />
|
|
|
</div>
|
|
|
</div>
|
|
|
<div ref="hua" style="float: left; z-index: -999" />
|
|
|
@@ -201,7 +193,7 @@ import {
|
|
|
} from './config';
|
|
|
|
|
|
const className = ref('com.leanwo.prodog.print.model.LabelPrintLine');
|
|
|
-const tables = ref(null);
|
|
|
+const table = ref(null);
|
|
|
const imageUrls = reactive([]);
|
|
|
const printing = ref(true);
|
|
|
const total = ref(0);
|
|
|
@@ -214,11 +206,11 @@ const imageVisible = ref(false);
|
|
|
const visible = ref(false);
|
|
|
const globalLoading = ref(false);
|
|
|
const all = ref(false);
|
|
|
+const propText = ref('');
|
|
|
const bodyStyle = {
|
|
|
display: 'flex',
|
|
|
justifyContent: 'center',
|
|
|
};
|
|
|
-const status = ref('');
|
|
|
const batchNos = ref([]);
|
|
|
const clientNames = ref([]);
|
|
|
const depositoryUsers = ref([]);
|
|
|
@@ -227,7 +219,7 @@ const organizationNames = ref([]);
|
|
|
const statusOptions = ref([
|
|
|
{
|
|
|
value: '',
|
|
|
- label: ' ',
|
|
|
+ label: '',
|
|
|
},
|
|
|
{
|
|
|
value: 'To_Be_Printed',
|
|
|
@@ -274,15 +266,27 @@ const getPageParams = (start, length) => {
|
|
|
pager.length = length;
|
|
|
searchPrintInfo();
|
|
|
};
|
|
|
+// 批次号切换
|
|
|
+const batchNoChange = () => {
|
|
|
+ queryParams.clientName = '';
|
|
|
+ queryParams.depositoryUser = '';
|
|
|
+ queryParams.costCenterName = '';
|
|
|
+ queryParams.organizationName = '';
|
|
|
+ queryParams.labelPrintType = '';
|
|
|
+ commonSqlApi('20230613_192444', depositoryUsers); // 查询保管人
|
|
|
+ commonSqlApi('20230613_193808', clientNames); // 查询公司
|
|
|
+ commonSqlApi('20230613_194108', organizationNames); // 查询部门
|
|
|
+ commonSqlApi('20230613_194557', costCenterNames); // 查询成本中心
|
|
|
+ table.value.clear(); // 清空选择
|
|
|
+ table.value.backFirstPage(); // 回到第一页
|
|
|
+};
|
|
|
+// 查询回到第一页
|
|
|
+const searchDatas = () => {
|
|
|
+ table.value.backFirstPage();
|
|
|
+};
|
|
|
// 查询信息
|
|
|
const searchPrintInfo = () => {
|
|
|
isLoading.value = true;
|
|
|
- if (status.value !== undefined) {
|
|
|
- queryParams.labelPrintType = status.value.slice(
|
|
|
- 0,
|
|
|
- status.value.indexOf('-'),
|
|
|
- );
|
|
|
- }
|
|
|
clientId.value = JSON.parse(localStorage.getItem('#LoginInfo')).loginClientId;
|
|
|
let params = { ...queryParams, ...pager, clientId: clientId.value };
|
|
|
if (queryParams.batchNo !== '') {
|
|
|
@@ -388,12 +392,14 @@ const printCard = async data => {
|
|
|
|
|
|
let tempStr = JSON.stringify(templateData.value);
|
|
|
const rows = JSON.parse(JSON.stringify(data));
|
|
|
+ let amount = 0;
|
|
|
for (let key in rows) {
|
|
|
+ amount = amount + 1;
|
|
|
let base64 = await getBase64(rows[key], tempStr, rows[key].assetNo);
|
|
|
let file = base64toFile(base64, rows[key].id);
|
|
|
formData.append('file', file);
|
|
|
+ propText.value = `打印中,已打印${amount}张`;
|
|
|
}
|
|
|
-
|
|
|
multipleImageUpload(formData).then(
|
|
|
successData => {
|
|
|
if (successData.success === true) {
|
|
|
@@ -449,24 +455,9 @@ const downloadImageZip = () => {
|
|
|
|
|
|
// 打印后清除所有选择
|
|
|
const clearSelect = () => {
|
|
|
- tables.value.clear();
|
|
|
+ table.value.clear();
|
|
|
};
|
|
|
|
|
|
-// 监听当批次切换后清空选择
|
|
|
-watch(
|
|
|
- () => queryParams.batchNo,
|
|
|
- (newVal, oldVal) => {
|
|
|
- if (newVal !== oldVal) {
|
|
|
- tables.value.clear();
|
|
|
- }
|
|
|
- if (newVal !== '') {
|
|
|
- commonSqlApi('20230613_192444', depositoryUsers); // 查询保管人
|
|
|
- commonSqlApi('20230613_193808', clientNames); // 查询公司
|
|
|
- commonSqlApi('20230613_194108', organizationNames); // 查询部门
|
|
|
- commonSqlApi('20230613_194557', costCenterNames); // 查询成本中心
|
|
|
- }
|
|
|
- },
|
|
|
-);
|
|
|
onMounted(() => {
|
|
|
init();
|
|
|
getBase64 = CreateJPEG(hua.value);
|
|
|
@@ -485,6 +476,8 @@ const commonSqlApi = (url, data) => {
|
|
|
return (item = { label: item });
|
|
|
});
|
|
|
data.value.unshift({ label: '' });
|
|
|
+ } else {
|
|
|
+ data.value = [];
|
|
|
}
|
|
|
} else {
|
|
|
Notify.error('查询信息异常', successData.errorMessage, true);
|
|
|
@@ -508,9 +501,10 @@ const init = () => {
|
|
|
successData => {
|
|
|
if (successData.errorCode == 0) {
|
|
|
if (successData.lines !== null) {
|
|
|
- batchNos.value = successData.lines.map(item => {
|
|
|
+ let datas = successData.lines.map(item => {
|
|
|
return (item = { label: item });
|
|
|
});
|
|
|
+ batchNos.value = datas.reverse();
|
|
|
}
|
|
|
} else {
|
|
|
Notify.error('查询导入批次异常', successData.errorMessage, true);
|