|
@@ -1,246 +0,0 @@
|
|
|
-<template>
|
|
|
- <PageWrapper contentBackground>
|
|
|
- <template #footer>
|
|
|
- <a-tabs v-model:activeKey="tableType" @change="changeTable">
|
|
|
- <a-tab-pane :key="0" :tab="t('routes.spares.tableType.0')" />
|
|
|
- <a-tab-pane :key="1" :tab="t('routes.spares.tableType.21')" />
|
|
|
- <a-tab-pane :key="2" :tab="t('routes.spares.tableType.23')" />
|
|
|
- </a-tabs></template
|
|
|
- >
|
|
|
- <div class="desc-wrap-BasicTable">
|
|
|
- <BasicTable @register="registerTable">
|
|
|
- <template #toolbar>
|
|
|
- <a-button type="primary" @click="handleOrder" v-if="getCheckPerm('invoice-export')"> 录单</a-button>
|
|
|
- </template>
|
|
|
- <template #action="{ record }">
|
|
|
- <TableAction
|
|
|
- stopButtonPropagation
|
|
|
- :actions="[
|
|
|
- {
|
|
|
- label: '详情',
|
|
|
- color: 'error',
|
|
|
- onClick: handleDetail.bind(null, record),
|
|
|
- },
|
|
|
- {
|
|
|
- label: '备件回收',
|
|
|
- onClick: handleRecover.bind(null, record),
|
|
|
- },
|
|
|
- ]"
|
|
|
- />
|
|
|
- </template>
|
|
|
- </BasicTable>
|
|
|
- <recoveryModal @update="reload" @register="registerRecovery" />
|
|
|
- <!-- ifShow: getCheckPerm('device-out') && !Boolean(record.outType), -->
|
|
|
- </div>
|
|
|
-</PageWrapper>
|
|
|
-</template>
|
|
|
-<script lang="ts">
|
|
|
-import { defineComponent, onMounted, ref } from 'vue';
|
|
|
-import { PageWrapper } from '/@/components/Page';
|
|
|
-import {
|
|
|
- BasicTable,
|
|
|
- useTable,
|
|
|
- TableAction,
|
|
|
- BasicColumn,
|
|
|
- TableImg,
|
|
|
- FormProps,
|
|
|
-} from '/@/components/Table';
|
|
|
-import { Tabs } from 'ant-design-vue';
|
|
|
-import { operateSceneList } from '/@/api/operate';
|
|
|
-import { useI18n } from '/@/hooks/web/useI18n';
|
|
|
-import { usePermissionStore } from '/@/store/modules/permission';
|
|
|
-import recoveryModal from './recoveryModal.vue';
|
|
|
-import { useModal } from '/@/components/Modal';
|
|
|
-import { useRouter } from 'vue-router'
|
|
|
-import { saleOrderList } from '/@/api/spares';
|
|
|
-export default defineComponent({
|
|
|
- components: {
|
|
|
- BasicTable,
|
|
|
- TableAction,
|
|
|
- TableImg,
|
|
|
- recoveryModal,
|
|
|
- PageWrapper,
|
|
|
- [Tabs.name]: Tabs,
|
|
|
- [Tabs.TabPane.name]: Tabs.TabPane,
|
|
|
- },
|
|
|
- setup() {
|
|
|
- const { t } = useI18n();
|
|
|
- const permissionStore = usePermissionStore();
|
|
|
- const router = useRouter()
|
|
|
- const { getCheckPerm } = permissionStore;
|
|
|
- const tableType = ref<Recordable>(0); //0看看 、1看见、2深时
|
|
|
- onMounted(() => {
|
|
|
- // console.log(router.currentRoute.value.params.id);
|
|
|
- });
|
|
|
- const columns: BasicColumn[] = [
|
|
|
- {
|
|
|
- title: '报修日期',
|
|
|
- dataIndex: 'createTime',
|
|
|
- width: 180,
|
|
|
- },
|
|
|
- {
|
|
|
- title: '客户名称',
|
|
|
- dataIndex: 'operationType',
|
|
|
- width: 80,
|
|
|
- customRender: ({ record }) => {
|
|
|
- return t(`routes.equity.operation.${record.operationType || 0}`);
|
|
|
- },
|
|
|
- },
|
|
|
- {
|
|
|
- title: '产品类型',
|
|
|
- dataIndex: 'cameraType',
|
|
|
- width: 80,
|
|
|
- customRender: ({ record }) => {
|
|
|
- return t(`routes.equity.operation.${record.cameraType || 0}`);
|
|
|
- },
|
|
|
- },
|
|
|
- {
|
|
|
- title: '产品SN码',
|
|
|
- dataIndex: 'cameraSnCode',
|
|
|
- width: 100,
|
|
|
- },
|
|
|
- {
|
|
|
- title: '故障描述',
|
|
|
- dataIndex: 'faultMsg',
|
|
|
- width: 100,
|
|
|
- },
|
|
|
- {
|
|
|
- title: '送修方式',
|
|
|
- dataIndex: 'sendType',
|
|
|
- width: 100,
|
|
|
- customRender: ({ record }) => {
|
|
|
- return record.sendType == 0 ? '前台送修' : '快递寄送';
|
|
|
- },
|
|
|
- },
|
|
|
- {
|
|
|
- title: '快递单号',
|
|
|
- dataIndex: 'sendTrackingNum',
|
|
|
- width: 100,
|
|
|
- },
|
|
|
- {
|
|
|
- title: '状态',
|
|
|
- dataIndex: 'status',
|
|
|
- width: 100,
|
|
|
- },
|
|
|
- {
|
|
|
- title: '工单号',
|
|
|
- dataIndex: 'repairId',
|
|
|
- width: 100,
|
|
|
- },
|
|
|
- {
|
|
|
- title: t('common.operating'),
|
|
|
- dataIndex: 'action',
|
|
|
- slots: { customRender: 'action' },
|
|
|
- ifShow: true,
|
|
|
- fixed: 'right',
|
|
|
- flag: 'ACTION',
|
|
|
- width: 120,
|
|
|
- },
|
|
|
- ];
|
|
|
- const searchForm: Partial<FormProps> = {
|
|
|
- labelWidth: 120,
|
|
|
- autoAdvancedLine: 1,
|
|
|
- actionColOptions: {
|
|
|
- span: 24,
|
|
|
- },
|
|
|
- schemas: [
|
|
|
- {
|
|
|
- field: 'customerName',
|
|
|
- component: 'Input',
|
|
|
- label: '客户名称',
|
|
|
- colProps: {
|
|
|
- xl: 7,
|
|
|
- xxl: 7,
|
|
|
- },
|
|
|
- },
|
|
|
- {
|
|
|
- field: 'cameraSnCode',
|
|
|
- component: 'Input',
|
|
|
- label: t('routes.device.snCode'),
|
|
|
- colProps: {
|
|
|
- xl: 7,
|
|
|
- xxl: 7,
|
|
|
- },
|
|
|
- },
|
|
|
- {
|
|
|
- field: 'trackingNum',
|
|
|
- component: 'Input',
|
|
|
- label: '快递单号',
|
|
|
- colProps: {
|
|
|
- xl: 7,
|
|
|
- xxl: 7,
|
|
|
- },
|
|
|
- },
|
|
|
- {
|
|
|
- field: 'timeList',
|
|
|
- label: '报修日期',
|
|
|
- component: 'RangePicker',
|
|
|
- componentProps: {
|
|
|
- maxLength: 100,
|
|
|
- format: 'YYYY-MM-DD',
|
|
|
- valueFormat: 'YYYY-MM-DD',
|
|
|
- showTime: true,
|
|
|
- },
|
|
|
- colProps: {
|
|
|
- xl: 7,
|
|
|
- xxl: 7,
|
|
|
- },
|
|
|
- },
|
|
|
- ],
|
|
|
- };
|
|
|
- const [registerRecovery, { openModal }] = useModal();
|
|
|
- const [registerTable, { reload }] = useTable({
|
|
|
- api: saleOrderList,
|
|
|
- columns: columns,
|
|
|
- useSearchForm: true,
|
|
|
- searchInfo: { type: tableType },
|
|
|
- formConfig: searchForm,
|
|
|
- showTableSetting: true,
|
|
|
- showIndexColumn: false,
|
|
|
- fetchSetting: {
|
|
|
- pageField: 'pageNum',
|
|
|
- sizeField: 'pageSize',
|
|
|
- listField: 'list',
|
|
|
- totalField: 'total',
|
|
|
- },
|
|
|
- canResize: false,
|
|
|
- });
|
|
|
- async function handleDetail(record: Recordable) {
|
|
|
- console.log('record', record);
|
|
|
- router.push({path:`detail/${record.repairId||'20230215174919387'}`})
|
|
|
- }
|
|
|
- async function handleRecover(record: Recordable) {
|
|
|
- openModal(true, {
|
|
|
- ...record,
|
|
|
- });
|
|
|
- }
|
|
|
- function handleOrder() {
|
|
|
- openModal(true);
|
|
|
- }
|
|
|
- function changeTable(val: string) {
|
|
|
- tableType.value = val;
|
|
|
- reload();
|
|
|
- }
|
|
|
- return {
|
|
|
- registerTable,
|
|
|
- reload,
|
|
|
- t,
|
|
|
- tableType,
|
|
|
- changeTable,
|
|
|
- handleOrder,
|
|
|
- getCheckPerm,
|
|
|
- handleDetail,
|
|
|
- handleRecover,
|
|
|
- registerRecovery,
|
|
|
- };
|
|
|
- },
|
|
|
-});
|
|
|
-</script>
|
|
|
-<style lang="less" scoped>
|
|
|
-.desc-wrap-BasicTable {
|
|
|
- background-color: #f0f2f5;
|
|
|
- .vben-basic-table-form-container {
|
|
|
- padding: 0;
|
|
|
- }
|
|
|
-}
|
|
|
-</style>
|