|
@@ -21,6 +21,7 @@
|
|
|
<BasicTable @register="registerTable" v-show="tableType == null">
|
|
<BasicTable @register="registerTable" v-show="tableType == null">
|
|
|
<template #toolbar>
|
|
<template #toolbar>
|
|
|
<a-button type="primary" @click="handleExport"> 导出</a-button>
|
|
<a-button type="primary" @click="handleExport"> 导出</a-button>
|
|
|
|
|
+ <a-button type="primary" @click="handleExportImg"> 批量导出签收图片</a-button>
|
|
|
</template>
|
|
</template>
|
|
|
<template #action="{ record }">
|
|
<template #action="{ record }">
|
|
|
<TableAction
|
|
<TableAction
|
|
@@ -75,6 +76,7 @@
|
|
|
import recoveryModal from './recoveryModal.vue';
|
|
import recoveryModal from './recoveryModal.vue';
|
|
|
import { useModal } from '/@/components/Modal';
|
|
import { useModal } from '/@/components/Modal';
|
|
|
import { useMessage } from '/@/hooks/web/useMessage';
|
|
import { useMessage } from '/@/hooks/web/useMessage';
|
|
|
|
|
+ import { downloadImage } from '/@/utils/file/download';
|
|
|
import { useRouter } from 'vue-router';
|
|
import { useRouter } from 'vue-router';
|
|
|
import { queryList, faultAllList, getByRoleType } from '/@/api/spares';
|
|
import { queryList, faultAllList, getByRoleType } from '/@/api/spares';
|
|
|
import { DownExport } from '/@/api/equity';
|
|
import { DownExport } from '/@/api/equity';
|
|
@@ -93,7 +95,7 @@
|
|
|
const { t } = useI18n();
|
|
const { t } = useI18n();
|
|
|
const permissionStore = usePermissionStore();
|
|
const permissionStore = usePermissionStore();
|
|
|
const router = useRouter();
|
|
const router = useRouter();
|
|
|
- const { createConfirm } = useMessage();
|
|
|
|
|
|
|
+ const { createConfirm, createMessage } = useMessage();
|
|
|
const { getCheckPerm } = permissionStore;
|
|
const { getCheckPerm } = permissionStore;
|
|
|
const tableType = ref<Recordable>(null); //0看看 、1看见、2深时
|
|
const tableType = ref<Recordable>(null); //0看看 、1看见、2深时
|
|
|
onMounted(() => {
|
|
onMounted(() => {
|
|
@@ -519,11 +521,15 @@
|
|
|
schemas: getSchemas(false),
|
|
schemas: getSchemas(false),
|
|
|
};
|
|
};
|
|
|
const [registerRecovery, { openModal }] = useModal();
|
|
const [registerRecovery, { openModal }] = useModal();
|
|
|
- const [registerTable, { reload: reload0 }] = useTable({
|
|
|
|
|
|
|
+ const [registerTable, { reload: reload0, getSelectRows }] = useTable({
|
|
|
api: queryList,
|
|
api: queryList,
|
|
|
columns: columns,
|
|
columns: columns,
|
|
|
useSearchForm: true,
|
|
useSearchForm: true,
|
|
|
- // searchInfo: { status: tableType },
|
|
|
|
|
|
|
+ rowSelection: {
|
|
|
|
|
+ type: 'checkbox',
|
|
|
|
|
+ getCheckboxProps: getrowSelection,
|
|
|
|
|
+ },
|
|
|
|
|
+ searchInfo: { status: tableType },
|
|
|
formConfig: searchForm,
|
|
formConfig: searchForm,
|
|
|
showTableSetting: true,
|
|
showTableSetting: true,
|
|
|
showIndexColumn: false,
|
|
showIndexColumn: false,
|
|
@@ -554,6 +560,12 @@
|
|
|
onActivated(() => {
|
|
onActivated(() => {
|
|
|
reload();
|
|
reload();
|
|
|
});
|
|
});
|
|
|
|
|
+ function getrowSelection(record) {
|
|
|
|
|
+ return {
|
|
|
|
|
+ disabled: record.status != 110, // Column configuration not to be checked
|
|
|
|
|
+ name: record.name,
|
|
|
|
|
+ };
|
|
|
|
|
+ }
|
|
|
const reload = () => {
|
|
const reload = () => {
|
|
|
reload1();
|
|
reload1();
|
|
|
reload0();
|
|
reload0();
|
|
@@ -567,6 +579,25 @@
|
|
|
...record,
|
|
...record,
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
|
|
+ function handleExportImg() {
|
|
|
|
|
+ let list = getSelectRows();
|
|
|
|
|
+ if (list.length == 0) {
|
|
|
|
|
+ createMessage.error('请选择一条数据');
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ list.map((item) => {
|
|
|
|
|
+ if (item.sendTrackingImgArray) {
|
|
|
|
|
+ item.sendTrackingImgArray.map((ele, index) => {
|
|
|
|
|
+ downloadImage(
|
|
|
|
|
+ ele,
|
|
|
|
|
+ `${item.repairId} ${item.customerName || ''}_${item.sendTrackingNum || ''}${
|
|
|
|
|
+ index + 1
|
|
|
|
|
+ }.jpg`,
|
|
|
|
|
+ );
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
function changeTable(val: string) {
|
|
function changeTable(val: string) {
|
|
|
tableType.value = val;
|
|
tableType.value = val;
|
|
|
if (tableType.value == null) {
|
|
if (tableType.value == null) {
|
|
@@ -598,6 +629,7 @@
|
|
|
handleRecover,
|
|
handleRecover,
|
|
|
registerRecovery,
|
|
registerRecovery,
|
|
|
handleExport,
|
|
handleExport,
|
|
|
|
|
+ handleExportImg,
|
|
|
};
|
|
};
|
|
|
},
|
|
},
|
|
|
});
|
|
});
|