123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261 |
- <template>
- <PageWrapper contentBackground>
- <template #footer>
- <a-tabs v-model:activeKey="tableType" @change="changeTable">
- <a-tab-pane :key="0" :tab="t('routes.spares.tableType.26')" />
- <a-tab-pane :key="1" :tab="t('routes.spares.tableType.27')" />
- </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: '详情',
- ifShow:getCheckPerm('work_detail'),
- onClick: handleDetail.bind(null, record),
- },
- {
- label: '测试登记',
- ifShow: getCheckPerm('repair_test') && tableType == 0,
- onClick: handleRecover.bind(null, record),
- },
- ]"
- />
- </template>
- </BasicTable>
- <reviewModal @update="reload" @register="registerRecovery" />
- <!-- ifShow: getCheckPerm('device-out') && !Boolean(record.outType), -->
- </div>
- </PageWrapper>
- </template>
- <script lang="ts">
- import { defineComponent, onMounted, ref, onActivated } 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 reviewModal from './reviewModal.vue';
- import { useModal } from '/@/components/Modal';
- import { useRouter } from 'vue-router'
- import { repairTesterList } from '/@/api/spares';
- export default defineComponent({
- name:'维修测试',
- components: {
- BasicTable,
- TableAction,
- TableImg,
- reviewModal,
- 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: 'customerName',
- width: 80,
- // customRender: ({ record }) => {
- // return t(`routes.equity.operation.${record.operationType || 0}`);
- // },
- },
- {
- title: '产品类型',
- dataIndex: 'cameraType',
- width: 80,
- customRender: ({ record }) => {
- return t(`routes.scene.tableType.${record.cameraType || 0}`);
- },
- },
- {
- title: '产品SN码',
- dataIndex: 'cameraSnCode',
- width: 100,
- },
- {
- title: '售后工程师',
- dataIndex: 'saleName',
- width: 100,
- },
- {
- title: '接单日期',
- dataIndex: 'orderReceivingTime',
- width: 100,
- },
- {
- title: '故障分析',
- dataIndex: 'checkResult',
- width: 150,
- },
- {
- title: '维修工程师',
- dataIndex: 'repairManName',
- width: 100,
- },
- {
- title: '状态',
- dataIndex: 'status',
- width: 100,
- customRender: ({ record }) => {
- return t(`routes.spares.tableType.${record.status || 0}`);
- },
- },
- {
- title: '工单号',
- dataIndex: 'repairId',
- width: 150,
- },
- {
- 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: 'cameraType',
- component: 'Select',
- label: '产品类型',
- colProps: {
- xl: 7,
- xxl: 7,
- },
- componentProps: {
- options: [
- {
- label: t('routes.device.type.1'),
- value: 0,
- key: '0',
- },
- {
- label: t('routes.device.type.2'),
- value: 1,
- key: '1',
- },
- {
- label: t('routes.device.type.3'),
- value: 2,
- key: '2',
- },
- ],
- },
- },
- {
- field: 'cameraSnCode',
- component: 'Input',
- label: t('routes.device.snCode'),
- colProps: {
- xl: 7,
- xxl: 7,
- },
- },
- {
- field: 'repairId',
- component: 'Input',
- label: '工单号',
- colProps: {
- xl: 7,
- xxl: 7,
- },
- },
- ],
- };
- const [registerRecovery, { openModal }] = useModal();
- const [registerTable, { reload }] = useTable({
- api: repairTesterList,
- columns: columns,
- useSearchForm: true,
- searchInfo: { statusParam: 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, {
- tableType:tableType.value,
- ...record,
- });
- }
- function handleOrder() {
- openModal(true);
- }
-
- onActivated(()=>{
- reload();
- })
- 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>
|