tangning 1 年之前
父節點
當前提交
094f8327f8
共有 2 個文件被更改,包括 36 次插入20 次删除
  1. 1 0
      src/views/device/batchPutModal.vue
  2. 35 20
      src/views/productOperation/modal/detailModal.vue

+ 1 - 0
src/views/device/batchPutModal.vue

@@ -104,6 +104,7 @@
           const res = await companyUploadExcel(apiData);
           closeModal();
           resetFields();
+          emit('reload');
           createMessage.success( res || '导入成功');
         } catch (error) {
           console.log('not passing', error);

+ 35 - 20
src/views/productOperation/modal/detailModal.vue

@@ -109,7 +109,7 @@
                 {
                   field: 'lookAuth',
                   componentProps: {
-                    disabled: value.target.value != 2,
+                    // disabled: value.target.value == 0,
                   },
                 },
                 {
@@ -128,14 +128,18 @@
           label: '编辑到期日期',
           ifShow: false,
           required: true,
-          defaultValue: dayjs().add(1, 'month').format('YYYY-MM-DD HH:mm:ss'),
+          defaultValue: dayjs().add(1, 'month').format('YYYY-MM-DD HH:mm'),
           componentProps: {
             disabled: false,
-            'show-time': true,
-            valueFormat: 'YYYY-MM-DD HH:mm:ss',
-            format: 'YYYY-MM-DD HH:mm:ss',
+            showTime: {
+              valueFormat: 'HH:mm',
+              format: 'HH:mm',
+            },
+            valueFormat: 'YYYY-MM-DD HH:mm',
+            type: 'datetime',
+            format: 'YYYY-MM-DD HH:mm',
             disabledDate: (current) => {
-              return current && current < dayjs().endOf('day');
+              return current && current < dayjs();
             },
             onChange: (value) => {
               updateSchema({
@@ -173,14 +177,19 @@
           label: '查看到期日期',
           ifShow: false,
           required: true,
-          defaultValue: dayjs().add(1, 'month').format('YYYY-MM-DD HH:mm:ss'),
+          defaultValue: dayjs().add(1, 'month').format('YYYY-MM-DD HH:mm'),
           componentProps: {
             disabled: false,
-            'show-time': true,
-            valueFormat: 'YYYY-MM-DD HH:mm:ss',
-            format: 'YYYY-MM-DD HH:mm:ss',
+            type: 'datetime',
+            showTime: {
+              valueFormat: 'HH:mm',
+              format: 'HH:mm',
+            },
+            valueFormat: 'YYYY-MM-DD HH:mm',
+            format: 'YYYY-MM-DD HH:mm',
             disabledDate: (current) => {
-              return current && current < dayjs().endOf('day');
+              console.log('current', current);
+              return current && current < dayjs();
             },
           },
         },
@@ -204,7 +213,7 @@
         },
         {
           field: 'isEmpower',
-          component: 'RadioGroup',
+          component: 'CheckboxGroup',
           label: '授权他人权限',
           ifShow: false,
           colProps: {
@@ -235,7 +244,7 @@
         let setData = {
           ...checkAuthOther,
           ...data,
-          isEmpower: data.canEditLook ? 1 : 0,
+          isEmpower: [0], //[data.canAuthLook ? 0 : '', data.canEditLook ? 1 : ''],
         };
         isEdit.value = setData.editAuth == 0 ? true : false;
         if (data) {
@@ -253,10 +262,12 @@
               options: setOption(),
             },
           },
-          // {
-          //   field: 'isAuthor',
-          //   componentProps: { disabled: !setData.isAuthor },
-          // },
+          {
+            field: 'isAuthor',
+            componentProps: {
+              disabled: setData.isAuthor == 0,
+            },
+          },
           {
             field: 'editAuth',
             componentProps: { options: getOptionList('editAuth', setData.editAuth) },
@@ -325,10 +336,14 @@
         try {
           const params = await validate();
           console.log('params', params);
+          let canEditLook = params.isEmpower && params.isEmpower.some((item) => item == 1) ? 1 : 0;
           await addAuth({
             ...params,
-            canAuthLook: params.isEmpower == 0 ? 1 : 0,
-            canEditLook: params.isEmpower == 1 ? 1 : 0,
+            canEditLook,
+            canAuthLook:
+              canEditLook || (params.isEmpower && params.isEmpower.some((item) => item == 0))
+                ? 1
+                : 0,
           });
           closeModal();
           resetFields();
@@ -340,7 +355,7 @@
       };
       function setOption() {
         return [
-          { label: '查看权限', value: 0 },
+          { label: '查看权限', value: 0, disabled: true },
           { label: '编辑权限', value: 1, disabled: isEdit.value },
         ];
       }