tangning hace 2 años
padre
commit
9d663f5b05

+ 1 - 1
src/api/staff/list.ts

@@ -134,7 +134,7 @@ defHttp.post<Result>({
   url: Api.staffSave,
   params:{
       ...params,
-      password: encodeStr(window.btoa(params.password))
+      // password: encodeStr(window.btoa(params.password))
   },
   headers: {
     // @ts-ignore

+ 1 - 1
src/layouts/page/index.vue

@@ -49,7 +49,7 @@
       const { getBasicTransition, getEnableTransition } = useTransitionSetting();
 
       const openCache = computed(() => unref(getOpenKeepAlive) && unref(getShowMultipleTab));
-
+      console.log('openCache',openCache)
       const getCaches = computed((): string[] => {
         if (!unref(getOpenKeepAlive)) {
           return [];

+ 1 - 0
src/layouts/page/transition.ts

@@ -18,6 +18,7 @@ export function getTransitionName({
   def: string;
   cacheTabs: string[];
 }): string | undefined {
+  console.log('openCache',route,openCache,cacheTabs,enableTransition,def)
   if (!enableTransition) {
     return undefined;
   }

+ 1 - 0
src/locales/lang/zh-CN/routes/system.ts

@@ -39,6 +39,7 @@ const account = {
   menuUrl: '外链地址',
   menuParentName: '上级菜单',
   component: '组件路径',
+  ignoreKeepAlive: '是否缓存',
   icon: '图标',
   perms: '权限标识',
   passwordOld: '当前密码',

+ 2 - 1
src/store/modules/multipleTab.ts

@@ -64,10 +64,11 @@ export const useMultipleTabStore = defineStore({
      */
     async updateCacheTab() {
       const cacheMap: Set<string> = new Set();
-
+      console.log('tabList',this.tabList)
       for (const tab of this.tabList) {
         const item = getRawRoute(tab);
         // Ignore the cache
+        console.log('tabList',item)
         const needCache = !item.meta?.ignoreKeepAlive;
         if (!needCache) {
           continue;

+ 0 - 246
src/views/spares/index.vue

@@ -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>

+ 0 - 1
src/views/spares/list.vue

@@ -50,7 +50,6 @@
       // const userStore = useUserStore();
       // const { getCheckRole } = userStore;
       const [registerTable, { reload }] = useTable({
-        title: t('routes.system.roleTitle'),
         api: partList,
         columns,
         formConfig: {

+ 11 - 8
src/views/spares/role.data.ts

@@ -15,15 +15,18 @@ import { useI18n } from '/@/hooks/web/useI18n';
   const { getCheckPerm } = permissionStore;
 
 export const columns: BasicColumn[] = [
-  // {
-  //   title: 'ID',
-  //   dataIndex: 'id',
-  //   width: 80,
-  // },
+  {
+    title: '设备类型',
+    dataIndex: 'cameraType',
+    width: 100,
+    customRender:({ record }) => {
+      return t(`routes.scene.tableType.${record.cameraType}`)
+    }
+  },
   {
     title: '备件编号',
     dataIndex: 'partId',
-    width: 200,
+    width: 100,
   },
   {
     title: '名称',
@@ -79,7 +82,7 @@ export const columns: BasicColumn[] = [
 
 export const searchFormSchema: FormSchema[] = [
   {
-    field: 'type',
+    field: 'cameraType',
     label: '设备类型',
     component: 'Select',
     componentProps: {
@@ -101,7 +104,7 @@ export const searchFormSchema: FormSchema[] = [
       xxl: 6,
     },
   },{
-    field: 'roleName',
+    field: 'partName',
     label: '备件名称',
     component: 'Input',
     componentProps: {

+ 12 - 1
src/views/spares/spareInModal.vue

@@ -4,6 +4,7 @@
     @register="register"
     title="备件入库"
     @cancel="resetFields"
+    :min-height="230"
     :confirmLoading="loading"
     @ok="handleSubmit"
   >
@@ -79,11 +80,14 @@
             component: 'ApiSelect',
             required:true,
             componentProps: {
+              filterOption: onFilterOption,
+              showSearch:true,
               api:partAllList,
               numberToString: true,
               labelField: 'partName',
               valueField: 'partId',
               immediate: false,
+              listHeight:120,
               disabled:true,
             },
             colProps: {
@@ -91,11 +95,12 @@
             },
           },{
             field: 'partStock',
-            component: 'Input',
+            component: 'InputNumber',
             label: '入库数量',
             required:true,
             componentProps:{
               maxLength: 50,
+              min:0,
             },
             colProps: {
               span: 18,
@@ -135,6 +140,12 @@
           console.log('not passing', error);
         }
       };
+      function onFilterOption(inputText: string, option: Option) {
+        if(option.label){
+          return option.label.toUpperCase().indexOf(inputText.toUpperCase()) >= 0;
+        }
+        return option.value.toUpperCase().indexOf(inputText.toUpperCase()) >= 0;
+      }
       return {
         register,
         registerForm,

+ 98 - 98
src/views/staff/adddetailsModal.vue

@@ -4,8 +4,7 @@
     @cancel="resetFields"
     @register="register"
     :title="title"
-    :min-height="350"
-    :height="500"
+    :min-height="230"
     @ok="handleOk"
   >
     <BasicForm @register="registerForm" />
@@ -35,57 +34,37 @@
       const preventAutoFill = ref(true);
       const { companyId } = userinfo.value;
       const schemas: FormSchema[] = [
-        {
-          field: 'nickName',
-          component: 'Input',
-          label: '姓名',
-          colProps: {
-            span: 20,
-          },
-          componentProps: {
-            maxLength: 15,
-          },
-          rules: [
-            {
-              required: true,
-              // @ts-ignore
-              validator: async (rule, value) => {
-                var reg_tel = /^[a-zA-Z\u4e00-\u9fa5]+$/;
-                // var reg = /\S+@\S+\.\S+/;
-                if (!value) {
-                  return Promise.reject('请输入姓名');
-                }
-                if (!reg_tel.test(value)) {
-                  /* eslint-disable-next-line */
-                  return Promise.reject('请输入正确的姓名');
-                }
-                return Promise.resolve();
-              },
-              trigger: 'change',
-            },
-          ],
-        },
-        {
-          field: 'roleId',
-          component: 'ApiSelect',
-          label: '角色',
-          required: true,
-          itemProps: {
-            validateTrigger: 'blur',
-          },
-          colProps: {
-            span: 20,
-          },
-          defaultValue: '',
-          componentProps: {
-            api: getRoleListByParam,
-            labelField: 'roleName',
-            valueField: 'id',
-            params: {
-              type: 1,
-            },
-          },
-        },
+        // {
+        //   field: 'nickName',
+        //   component: 'Input',
+        //   label: '姓名',
+        //   colProps: {
+        //     span: 20,
+        //   },
+        //   componentProps: {
+        //     maxLength: 15,
+        //   },
+        //   rules: [
+        //     {
+        //       required: true,
+        //       // @ts-ignore
+        //       validator: async (rule, value) => {
+        //         var reg_tel = /^[a-zA-Z\u4e00-\u9fa5]+$/;
+        //         // var reg = /\S+@\S+\.\S+/;
+        //         if (!value) {
+        //           return Promise.reject('请输入姓名');
+        //         }
+        //         if (!reg_tel.test(value)) {
+        //           /* eslint-disable-next-line */
+        //           return Promise.reject('请输入正确的姓名');
+        //         }
+        //         return Promise.resolve();
+        //       },
+        //       trigger: 'change',
+        //     },
+        //   ],
+        // },
+        
         {
           field: 'userName',
           component: 'Select',
@@ -142,42 +121,63 @@
               trigger: 'change',
             },
           ],
-        },
-        {
-          field: 'password',
-          component: 'StrengthMeter',
-          label: '密码',
+        },{
+          field: 'roleId',
+          component: 'ApiSelect',
+          label: '角色',
           required: true,
+          itemProps: {
+            validateTrigger: 'blur',
+          },
           colProps: {
             span: 20,
           },
-          rules: [
-            {
-              required: true,
-              // @ts-ignore
-              validator: async (rule, value) => {
-                console.log('value',value)
-                const regPos = /^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)[a-zA-Z\d]{8,}$/; // 非中文
-                if (!value) {
-                  return Promise.reject('请输入8-16位数字、字母大小写组合');
-                }
-                if (!regPos.test(value)) {
-                  /* eslint-disable-next-line */
-                  return Promise.reject('请输入8-16位数字、字母大小写组合');
-                }
-                return Promise.resolve();
-              },
-              trigger: 'change',
+          defaultValue: '',
+          componentProps: {
+            listHeight:120,
+            api: getRoleListByParam,
+            labelField: 'roleName',
+            valueField: 'id',
+            params: {
+              type: 1,
             },
-          ],
-          componentProps:{
-            placeholder:"请输入8-16位数字、字母大小写组合",
-            maxLength: 16,
-            readonly:preventAutoFill.value,
-            minLength: 8,
-            autoComplete:'off',
-          }
+          },
         },
+        // {
+        //   field: 'password',
+        //   component: 'StrengthMeter',
+        //   label: '密码',
+        //   required: true,
+        //   colProps: {
+        //     span: 20,
+        //   },
+        //   rules: [
+        //     {
+        //       required: true,
+        //       // @ts-ignore
+        //       validator: async (rule, value) => {
+        //         console.log('value',value)
+        //         const regPos = /^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)[a-zA-Z\d]{8,}$/; // 非中文
+        //         if (!value) {
+        //           return Promise.reject('请输入8-16位数字、字母大小写组合');
+        //         }
+        //         if (!regPos.test(value)) {
+        //           /* eslint-disable-next-line */
+        //           return Promise.reject('请输入8-16位数字、字母大小写组合');
+        //         }
+        //         return Promise.resolve();
+        //       },
+        //       trigger: 'change',
+        //     },
+        //   ],
+        //   componentProps:{
+        //     placeholder:"请输入8-16位数字、字母大小写组合",
+        //     maxLength: 16,
+        //     readonly:preventAutoFill.value,
+        //     minLength: 8,
+        //     autoComplete:'off',
+        //   }
+        // },
         {
           field: 'id',
           component: 'Input',
@@ -202,21 +202,21 @@
       function onDataReceive(data) {
         console.log('onDataReceive',data)
         // 方式1;
-        setTimeout(()=>{
-          preventAutoFill.value = false
-          updateSchema([{
-            field: 'userName',
-            componentProps:{
-              readonly:false,
-            }
-          },{
-            field: 'password',
-            componentProps:{
-              readonly:false,
-            }
-          }])
-          // updateSchema(schemas);
-        },500)
+        // setTimeout(()=>{
+        //   preventAutoFill.value = false
+        //   updateSchema([{
+        //     field: 'userName',
+        //     componentProps:{
+        //       readonly:false,
+        //     }
+        //   },{
+        //     field: 'password',
+        //     componentProps:{
+        //       readonly:false,
+        //     }
+        //   }])
+        //   // updateSchema(schemas);
+        // },500)
       }
       function companyIdChange(companyId) {
         // resetFields(['permList'])

+ 2 - 16
src/views/staff/list.vue

@@ -23,24 +23,10 @@
         <TableAction
           :actions="[
             {
-              label: '编辑',
-              ifShow:getCheckPerm('sysuser-update'),
-              onClick: handleEdit.bind(null, record),
-            },
-            {
-              color: 'warning',
-              label: t('routes.staff.setpaswd'),
-              ifShow:getCheckPerm('sysuser-repassword'),
-              onClick: handleOpenModal.bind(null, record),
-            },
-            {
               label: '删除',
               color: 'error',
               ifShow:getCheckPerm('sysuser-delete'),
-              popConfirm: {
-                title: '是否确认删除',
-                confirm: handleDelete.bind(null, record),
-              },
+              onClick:handDelconfirm.bind(null, record),
             },
           ]"
         />
@@ -184,7 +170,7 @@
           // ifShow: !getCheckRole('tourist'),
           slots: { customRender: 'action' },
           fixed: 'right',
-          width: 140,
+          width: 50,
         },
       ];
 

+ 13 - 0
src/views/system/menu/menu.data.ts

@@ -282,4 +282,17 @@ export const formSchema: FormSchema[] = [
     },
     ifShow: ({ values }) => !isButton(values.type),
   },
+  {
+    field: 'ignoreKeepAlive',
+    label: t('routes.system.ignoreKeepAlive'),
+    component: 'RadioButtonGroup',
+    defaultValue: false,
+    componentProps: {
+      options: [
+        { label: t('routes.system.isExt.0'), value: false },
+        { label: t('routes.system.isExt.1'), value: true },
+      ],
+    },
+    ifShow: ({ values }) => isMenu(values.type),
+  },
 ];

+ 3 - 3
src/views/work/aftermarket.vue

@@ -57,12 +57,12 @@ export default defineComponent({
       {
         title: '订单号',
         dataIndex: 'orderSn',
-        width: 150,
+        width: 180,
       },
       {
         title: 'OpenId',
         dataIndex: 'wxPayOpenId',
-        width: 100,
+        width: 230,
       },
       {
         title: '维修单号',
@@ -90,7 +90,7 @@ export default defineComponent({
       {
         title: '交易号',
         dataIndex: 'tradeNo',
-        width: 100,
+        width: 250,
       },
       {
         title: '订单状态',

+ 1 - 1
src/views/work/followedList.vue

@@ -122,7 +122,7 @@ export default defineComponent({
       },
       {
         title: '客户名称',
-        dataIndex: 'operationType',
+        dataIndex: 'customerName',
         width: 80,
       },
       {

+ 1 - 1
src/views/work/maintenance.vue

@@ -96,7 +96,7 @@ export default defineComponent({
       },
       {
         title: '客户名称',
-        dataIndex: 'addrId',
+        dataIndex: 'customerName',
         width: 80,
       },
       {

+ 4 - 4
src/views/work/query.vue

@@ -82,11 +82,11 @@ export default defineComponent({
       },
       {
         title: '客户名称',
-        dataIndex: 'operationType',
+        dataIndex: 'customerName',
         width: 80,
-        customRender: ({ record }) => {
-          return t(`routes.equity.operation.${record.operationType || 0}`);
-        },
+        // customRender: ({ record }) => {
+        //   return t(`routes.equity.operation.${record.operationType || 0}`);
+        // },
       },
       {
         title: '产品类型',

+ 3 - 2
src/views/work/recoveryModal.vue

@@ -40,7 +40,8 @@ export default defineComponent({
         label: '公司名称',
         componentProps: {
           maxLength: 50,
-        },        colProps: {
+        },        
+        colProps: {
           span: 18,
         },  
       },
@@ -282,7 +283,7 @@ export default defineComponent({
           span: 18,
         },   
         componentProps: {
-          maxLength: 100,
+          valueFormat: 'YYYY-MM-DD',
         },  
       },{
           field: 'testerId',

+ 4 - 4
src/views/work/repairsparesList.vue

@@ -83,11 +83,11 @@ export default defineComponent({
       },
       {
         title: '客户名称',
-        dataIndex: 'operationType',
+        dataIndex: 'customerName',
         width: 80,
-        customRender: ({ record }) => {
-          return t(`routes.equity.operation.${record.operationType || 0}`);
-        },
+        // customRender: ({ record }) => {
+        //   return t(`routes.equity.operation.${record.operationType || 0}`);
+        // },
       },
       {
         title: '产品类型',

+ 1 - 1
src/views/work/takingOrdersModel.vue

@@ -105,7 +105,7 @@ export default defineComponent({
           span: 18,
         },   
         componentProps: {
-          // maxLength: 100,
+          valueFormat: 'YYYY-MM-DD',
         },  
       },{
           field: 'repairManId',

+ 4 - 4
src/views/work/testList.vue

@@ -80,11 +80,11 @@ export default defineComponent({
       },
       {
         title: '客户名称',
-        dataIndex: 'operationType',
+        dataIndex: 'customerName',
         width: 80,
-        customRender: ({ record }) => {
-          return t(`routes.equity.operation.${record.operationType || 0}`);
-        },
+        // customRender: ({ record }) => {
+        //   return t(`routes.equity.operation.${record.operationType || 0}`);
+        // },
       },
       {
         title: '产品类型',