tangning 6 ماه پیش
والد
کامیت
e606c25899

+ 10 - 0
src/api/authorizeModeling/index.ts

@@ -17,6 +17,7 @@ enum Api {
   authorizeCamerasnUpdateLog = '/service/manage/authorizeCamera/snUpdateLog/',
   authorizeOpenApilist = '/service/manage/authorizeOpenApi/list',
   authorizeOpenApiadd = '/service/manage/authorizeOpenApi/add',
+  authorizeRtkAdd = '/service/manage/authorizeRtk/addAuth',
   authorizeOpenApiupdate = '/service/manage/authorizeOpenApi/updateStatus',
   authorizeOpenApidelete = '/service/manage/authorizeOpenApi/delete',
 }
@@ -205,3 +206,12 @@ export const authorizeOpenApidelete = (params) =>
       ignoreCancelToken: true,
     },
   });
+export const authorizeRtkAdd = (params) =>
+  defHttp.post({
+    url: Api.authorizeRtkAdd,
+    params: params,
+    headers: {
+      // @ts-ignore
+      ignoreCancelToken: true,
+    },
+  });

+ 27 - 0
src/api/order/index.ts

@@ -17,6 +17,8 @@ enum Api {
   incrementExport = '/service/manage/order/increment/export',
   downList = '/service/manage/order/down/list',
   downExport = '/service/manage/order/down/export',
+  authorizeRtkExport = '/service/manage/authorizeRtk/export',
+  authorizeCameraExport = '/service/manage/authorizeCamera/export',
   pageInvoice = '/service/manage/invoice/pageInvoice',
   exportInvoice = '/service/manage/invoice/export',
   invoiceRegister = '/service/manage/invoice/invoiceRegister',
@@ -113,6 +115,31 @@ export const DownExport = (params: PageParams) =>
     responseType: 'blob',
   });
 
+export const authorizeRtkExport = (params: PageParams) =>
+  defHttp.downloadFile<FileStream>({
+    url: Api.authorizeRtkExport,
+    params: params,
+    fileName: '差分账号订单.xlsx',
+    // data: params,
+    headers: {
+      // @ts-ignore
+      ignoreCancelToken: true,
+    },
+    responseType: 'blob',
+  });
+export const authorizeCameraExport = (params: PageParams) =>
+  defHttp.downloadFile<FileStream>({
+    url: Api.authorizeCameraExport,
+    params: params,
+    fileName: '本地版相机授权订单.xlsx',
+    // data: params,
+    headers: {
+      // @ts-ignore
+      ignoreCancelToken: true,
+    },
+    responseType: 'blob',
+  });
+
 export const DownList = (params: PageParams) =>
   defHttp.post<Result>({
     url: Api.downList,

+ 1 - 1
src/views/empower/data.ts

@@ -134,7 +134,7 @@ export const newAddschemas: FormSchema[] = [
       autoLink: false,
     },
     componentProps: {
-      // showTime: true, //{ defaultValue: moment('23:59:59', 'HH:mm:ss') }
+      // showTime: { defaultValue: moment('23:59:59', 'HH:mm:ss') },
       valueFormat: 'YYYY-MM-DD',
       // defaultValue: dayjs().add(7, 'day').format('YYYY-MM-DD') + ' 23:59:59',
       format: 'YYYY-MM-DD',

+ 5 - 2
src/views/empower/differenceList.vue

@@ -24,7 +24,7 @@
   import { defineComponent, h, ref } from 'vue';
   import { BasicTable, useTable, FormProps, TableAction } from '/@/components/Table';
   import { PageWrapper } from '/@/components/Page';
-  import { authorizeCameraList, rtkDevicedel, rtkAccountdel } from '/@/api/rtk';
+  import { rtkDeviceList, rtkDevicedel, rtkAccountdel } from '/@/api/rtk';
   import { useModal } from '/@/components/Modal';
   import { useI18n } from '/@/hooks/web/useI18n';
   import { copyTextToClipboard } from '/@/hooks/web/useCopyToClipboard';
@@ -85,13 +85,16 @@
         ],
       };
       const [registerTable, { reload }] = useTable({
-        api: authorizeCameraList,
+        api: rtkDeviceList,
         title: 'RTK设备列表',
         columns: rtkdeviceColumns,
         useSearchForm: true,
         showIndexColumn: false,
         formConfig: searchForm,
         showTableSetting: true,
+        searchInfo: {
+          accountType: 2,
+        },
         fetchSetting: {
           pageField: 'pageNum',
           sizeField: 'pageSize',

+ 62 - 34
src/views/empower/modal/difference/AddModal.vue

@@ -26,8 +26,9 @@
   import { uploadApi } from '/@/api/product/index';
   import { copyTextToClipboard } from '/@/hooks/web/useCopyToClipboard';
   import { ResultEnum } from '/@/enums/httpEnum';
-  import { authorizeInstalladdOrUpdate, checkMachineCode } from '/@/api/authorizeModeling';
+  import { authorizeRtkAdd, checkMachineCode } from '/@/api/authorizeModeling';
   import dayjs from 'dayjs';
+  import moment from 'moment';
   import { otherInfoStore } from '/@/store/modules/other';
   import { incrementUseTypeList } from '/@/api/account';
 
@@ -51,35 +52,39 @@
       const { createMessage, createConfirm, createSuccessModal } = useMessage();
       const schemas: FormSchema[] = [
         {
-          field: 'id',
+          field: 'rtkSnCode',
           component: 'Input',
           show: false,
           label: 'id',
         },
         {
-          field: 'machineCode1',
+          field: 'validDay',
           component: 'Select',
           required: true,
-          defaultValue: 1,
+          defaultValue: '1年',
           label: '*差分账号期限',
           componentProps: {
             rows: 4,
             options: [
               {
                 label: '1年',
-                value: 1,
+                value: '1年',
               },
             ]
           },
           colProps: { span: 20 },
         },
         {
-          field: 'machineCode',
-          component: 'DatePicker',
+          field: 'validTime',
+          component: 'RangePicker',
           required: true,
+            defaultValue: [ dayjs().format('YYYY-MM-DD'), dayjs().add(12, 'month').format('YYYY-MM-DD')],
+          // defaultValue: ['2025-03-12', '2025-04-24'],
           label: '差分账号期限',
           componentProps: {
             rows: 4,
+            valueFormat: 'YYYY-MM-DD',
+            format: 'YYYY-MM-DD',
           },
           colProps: { span: 20 },
         },
@@ -103,36 +108,59 @@
       const [register, { closeModal }] = useModalInner((data) => {
         data && onDataReceive(data);
       });
+      const useTypeChange = (value) => {
+        updateSchema([
+          { field: 'projectNum', ifShow: value == '4' },
+          { field: 'companyName', ifShow: value != '3' },
+          { field: 'businessDept', ifShow: value != '3' },
+          { field: 'businessName', ifShow: value != '3' },
+          { field: 'customerName', ifShow: value != '3' },
+          { field: 'customerType', ifShow: value != '3' },
+          { field: 'endCustomer', ifShow: value != '3' },
+          { field: 'customerPayTime', required: value == '4' },
+        ]);
+      };
       async function onDataReceive(data) {
         resetFields();
         fileFlow.id = data.id;
         fileFlow.key = data.authorizeKey;
-        // setFieldsValue(data);
+        console.log('data', [dayjs('2015-06-06', 'YYYY-MM-DD'), dayjs('2015-06-06', 'YYYY-MM-DD')])
+        updateSchema([
+          {
+            field: 'useType',
+            componentProps: {
+              onChange: useTypeChange,
+            },
+          },
+        ])
+        // setFieldsValue({
+        //   ...data,
+        //   // validTime: [moment().add(-6, 'day'), moment()]
+        // });
       }
       async function handleConfirm() {
-        const { id, machineCode } = await validate();
-        let res = await checkMachineCode({ machineCode: machineCode.replace(/\s*/g, '') });
-        console.log('res', res, !id);
-        if (!id && res && res.id) {
-          createConfirm({
-            iconType: 'warning',
-            title: () => h('span', '温馨提示'),
-            content: () => h('span', `当前设备已存在授权记录。`),
-            okText: '继续',
-            onOk: async () => {
-              handleSubmit();
-            },
-          });
-        } else {
-          createConfirm({
-            iconType: 'warning',
-            title: () => h('span', '温馨提示'),
-            content: () => h('span', `确定要${id ? '编辑' : '新增'}授权吗?`),
-            onOk: async () => {
-              handleSubmit();
-            },
-          });
-        }
+        // const { id, machineCode } = await validate();
+        // console.log('res', res, !id);
+        // if (!id && res && res.id) {
+        //   createConfirm({
+        //     iconType: 'warning',
+        //     title: () => h('span', '温馨提示'),
+        //     content: () => h('span', `当前设备已存在授权记录。`),
+        //     okText: '继续',
+        //     onOk: async () => {
+        //       handleSubmit();
+        //     },
+        //   });
+        // } else {
+        createConfirm({
+          iconType: 'warning',
+          title: () => h('span', '温馨提示'),
+          content: () => h('span', `确定要新增授权吗?`),
+          onOk: async () => {
+            handleSubmit();
+          },
+        });
+        // }
       }
       const handleSubmit = async () => {
         try {
@@ -140,11 +168,11 @@
           console.log('validate', params);
           const apiData = {
             ...params,
-            snCodes: params.snCodes && params.snCodes.replace(/\s*/g, ''),
-            machineCode: params.machineCode.replace(/\s*/g, ''),
+            validStartTime: params.validTime[0],
+            validEndTime: params.validTime[1],
             userId: params.id,
           };
-          let res = await authorizeInstalladdOrUpdate(apiData);
+          let res = await authorizeRtkAdd(apiData);
           closeModal();
           resetFields();
           createSuccessModal({

+ 23 - 18
src/views/empower/modal/difference/logListModal.vue

@@ -3,11 +3,11 @@
     v-bind="$attrs"
     @register="register"
     title="授权记录"
-    :width="800"
+    :width="900"
     @ok="closeModal"
     @visible-change="handleVisibleChange"
   >
-    <div>板卡SN号:4235323412003A272B</div> 
+    <div style="margin-left: 20px">板卡SN号:{{rtkSnCode}}</div> 
     <BasicTable @register="registerSubtable">
       <template #copy="{ text }">
         <a @click="handleCopy(text)">
@@ -27,7 +27,7 @@
   import { useI18n } from '/@/hooks/web/useI18n';
   import { GetCameraDetailApi, UnbindCameraApi } from '/@/api/account';
   import { otherInfoStore } from '/@/store/modules/other';
-  import { DetailsApi, IncrementDelayApi } from '/@/api/account';
+  import { authorizeRtkList } from '/@/api/order';
   import { usePermissionStore } from '/@/store/modules/permission';
   import { useModal } from '/@/components/Modal';
   import { copyTextToClipboard } from '/@/hooks/web/useCopyToClipboard';
@@ -48,7 +48,7 @@
       const { getCheckPerm } = permissionStore;
       console.log('overviewInfo', overviewInfo);
       // const overviewInfo = getOverviewInfo() || {}
-      const id = ref('');
+      const rtkSnCode = ref('');
       const fileFlow = reactive({
         file: null,
         id: '',
@@ -56,20 +56,23 @@
       });
       const columns: BasicColumn[] = [
         {
-          title: '原SN码',
-          dataIndex: 'oldSnCode',
+          title: '差分账号期限',
+          dataIndex: 'validDay',
           width: 120,
         },
         {
-          title: '新SN码',
-          dataIndex: 'newSnCode',
+          title: '差分账号生效日期',
+          dataIndex: 'validEndTime',
           width: 150,
         },
         {
-          title: '更换Key',
-          dataIndex: 'updateAuthorizeKey',
-          ellipsis: true,
-          slots: { customRender: 'copy' },
+          title: '差分账号到期日期',
+          dataIndex: 'validStartTime',
+          width: 150,
+        },
+        {
+          title: '操作人',
+          dataIndex: 'sysUserName',
           width: 150,
         },
         {
@@ -79,19 +82,20 @@
         },
       ];
       const [registerSubtable, { reload }] = useTable({
-        api: () => {
-          return authorizeCamerasnUpdateLog(id.value);
-        },
+        api: authorizeRtkList,
         columns: columns,
         immediate: false,
         rowKey: 'id',
         fetchSetting: {
           pageField: 'pageNum',
           sizeField: 'pageSize',
-          listField: 'data',
+          listField: 'list',
           totalField: 'total',
         },
-        pagination: false,
+        searchInfo: {
+          rtkSnCode: rtkSnCode.value,
+        },
+        showIndexColumn: false,
         canResize: true,
         bordered: true,
       });
@@ -104,7 +108,7 @@
       function onDataReceive(data) {
         console.log('onDataReceive', data);
         fileFlow.id = data.id;
-        id.value = data.id;
+        rtkSnCode.value = data.rtkSnCode;
         reload();
       }
       async function handleDelete(record: Recordable) {
@@ -131,6 +135,7 @@
         v && props.userData && nextTick(() => onDataReceive(props.userData));
       }
       return {
+        rtkSnCode,
         register,
         registerList,
         fileFlow,

+ 1 - 0
src/views/order/data.ts

@@ -403,6 +403,7 @@ export const localCameraColumns: BasicColumn[] = [
   {
     title: '客户机器码',
     dataIndex: 'machineCode',
+    ellipsis: true,
     slots: { customRender: 'copy' },
     width: 120,
   },

+ 2 - 2
src/views/order/differenceList.vue

@@ -45,7 +45,7 @@
   import { Descriptions } from 'ant-design-vue';
   import { useI18n } from '/@/hooks/web/useI18n';
   import { useMessage } from '/@/hooks/web/useMessage';
-  import { authorizeRtkList, DownExport } from '/@/api/order';
+  import { authorizeRtkList, authorizeRtkExport } from '/@/api/order';
   import { downloadByData } from '/@/utils/file/download';
   import { usePermissionStore } from '/@/store/modules/permission';
   import { dowmColumns, equitySearchForm } from './data';
@@ -108,7 +108,7 @@
           title: () => h('span', '温馨提示'),
           content: () => h('span', isSearch.value ? '确认导出搜索结果?' : '确认导出全部?'),
           onOk: async () => {
-            DownExport();
+            authorizeRtkExport();
           },
         });
       }

+ 2 - 2
src/views/order/localCameraList.vue

@@ -50,7 +50,7 @@
   import { Descriptions } from 'ant-design-vue';
   import { useI18n } from '/@/hooks/web/useI18n';
   import { useMessage } from '/@/hooks/web/useMessage';
-  import { authorizeCameraList, DownExport } from '/@/api/order';
+  import { authorizeCameraList, authorizeCameraExport } from '/@/api/order';
   import { downloadByData } from '/@/utils/file/download';
   import { usePermissionStore } from '/@/store/modules/permission';
   import { localCameraColumns, equitySearchForm } from './data';
@@ -118,7 +118,7 @@
           title: () => h('span', '温馨提示'),
           content: () => h('span', isSearch.value ? '确认导出搜索结果?' : '确认导出全部?'),
           onOk: async () => {
-            DownExport();
+            authorizeCameraExport();
           },
         });
       }

+ 8 - 8
src/views/product/rtk/AddModal.vue

@@ -167,17 +167,12 @@
           componentProps: {
             options: [
               {
-                label: '千寻板卡千寻账号',
-                value: 0,
-                key: 0,
-              },
-              {
-                label: '千寻板卡移动账号',
+                label: '千寻板卡',
                 value: 1,
                 key: 1,
               },
               {
-                label: '北云板卡移动账号',
+                label: '北云板卡',
                 value: 2,
                 key: 2,
               },
@@ -275,11 +270,16 @@
           componentProps: {
             options: [
               {
-                label: '账号池',
+                label: '账号池(不限期)',
                 value: 0,
                 key: 0,
               },
               {
+                label: '账号池(限期)',
+                value: 2,
+                key: 2,
+              },
+              {
                 label: '专用账号',
                 value: 1,
                 key: 1,