Просмотр исходного кода

设备发货管理对发货员角色屏蔽部分查询控件

刘洋 6 месяцев назад
Родитель
Сommit
a0a5aa35c9
1 измененных файлов с 183 добавлено и 158 удалено
  1. 183 158
      src/views/resource-guard/device-guard/device-send/index.vue

+ 183 - 158
src/views/resource-guard/device-guard/device-send/index.vue

@@ -220,178 +220,203 @@ import EditDeviceInfoDialog from './edit-device-info-dialog.vue';
 import { dictToOptionList } from '@/utils/tool';
 import { downloadImportTemplate } from '@/api/common';
 import DeviceTableDialog from '@/views/sop/sop-manage/device-out-in/add-device-dialog.vue';
+import { useUserStore } from '@/store';
+
+const userStore = useUserStore();
 const { perm } = usePermission();
 const tableKey = ref(Date.now() + '');
 const curRow = ref(null);
 const showEditDeviceDialog = ref(false);
 
-const fields = ref([
-  {
-    prop: 'serviceId',
-    label: '服务单元',
-    type: 'select',
-    labelWidth: 84,
-    colSpan: 6,
-    cell: 'service',
-  },
-  {
-    prop: 'usageType',
-    label: '用途类型',
-    type: 'select',
-    labelWidth: 84,
-    colSpan: 6,
-    options: dictToOptionList(DEVICE_USAGE_TYPE),
-    attrs: {
-      clearable: true,
-    },
-  },
-  {
-    prop: 'crmNo',
-    label: '项目单号',
-    labelWidth: 84,
-    colSpan: 6,
-    attrs: {
-      clearable: true,
-    },
-  },
-  {
-    prop: 'status',
-    label: '发货状态',
-    type: 'select',
-    labelWidth: 84,
-    colSpan: 6,
-    options: dictToOptionList(DEVICE_SEND_STATUS),
-    attrs: {
-      clearable: true,
-    },
-  },
-  {
-    prop: 'deliverUserId',
-    label: '发货人',
-    type: 'select',
-    labelWidth: 84,
-    colSpan: 6,
-    cell: 'user',
-  },
-  {
-    prop: 'deliverTime',
-    label: '发货时间',
-    labelWidth: 84,
-    type: 'daterange',
-    colSpan: 12,
-    attrs: {
-      clearable: true,
-      valueType: 'time-stamp',
-    },
-  },
-  {
-    prop: 'deviceNo',
-    label: '设备编号',
-    labelWidth: 84,
-    colSpan: 6,
-    attrs: {
-      clearable: true,
-    },
-  },
-  {
-    prop: 'supplierId',
-    label: '供应商',
-    labelWidth: 84,
-    type: 'select',
-    colSpan: 6,
-    cell: 'supplier',
-  },
-  {
-    prop: 'receiveTime',
-    label: '验收时间',
-    labelWidth: 84,
-    type: 'daterange',
-    colSpan: 12,
-    attrs: {
-      clearable: true,
-      valueType: 'time-stamp',
-    },
-  },
-  {
-    prop: 'serialNo',
-    label: '设备序列号',
-    labelWidth: 84,
-    colSpan: 6,
-    attrs: {
-      clearable: true,
+const isFHY = computed(() => {
+  //是发货员
+  return userStore?.user?.roleList?.toString() === 'DEVICE_DELIVERY';
+});
+const fields = computed(() => {
+  return [
+    {
+      prop: 'serviceId',
+      label: '服务单元',
+      type: 'select',
+      labelWidth: 84,
+      colSpan: 6,
+      cell: 'service',
     },
-  },
-  {
-    prop: 'consignee',
-    label: '收件人',
-    labelWidth: 84,
-    colSpan: 6,
-    attrs: {
-      clearable: true,
+    isFHY.value
+      ? null
+      : {
+          prop: 'usageType',
+          label: '用途类型',
+          type: 'select',
+          labelWidth: 84,
+          colSpan: 6,
+          options: dictToOptionList(DEVICE_USAGE_TYPE),
+          attrs: {
+            clearable: true,
+          },
+        },
+    isFHY.value
+      ? null
+      : {
+          prop: 'crmNo',
+          label: '项目单号',
+          labelWidth: 84,
+          colSpan: 6,
+          attrs: {
+            clearable: true,
+          },
+        },
+    {
+      prop: 'status',
+      label: '发货状态',
+      type: 'select',
+      labelWidth: 84,
+      colSpan: 6,
+      options: dictToOptionList(DEVICE_SEND_STATUS),
+      attrs: {
+        clearable: true,
+      },
     },
-  },
-  {
-    prop: 'mailingAddress',
-    label: '收件地址',
-    labelWidth: 84,
-    colSpan: 6,
-    attrs: {
-      clearable: true,
+    isFHY.value
+      ? null
+      : {
+          prop: 'deliverUserId',
+          label: '发货人',
+          type: 'select',
+          labelWidth: 84,
+          colSpan: 6,
+          cell: 'user',
+        },
+    {
+      prop: 'deliverTime',
+      label: '发货时间',
+      labelWidth: 84,
+      type: 'daterange',
+      colSpan: 12,
+      attrs: {
+        clearable: true,
+        valueType: 'time-stamp',
+      },
     },
-  },
-  {
-    prop: 'deliveryType',
-    label: '出入库状态',
-    type: 'select',
-    options: dictToOptionList(INOUT_TYPE),
-    labelWidth: 84,
-    colSpan: 6,
-    attrs: {
-      clearable: true,
+    {
+      prop: 'deviceNo',
+      label: '设备编号',
+      labelWidth: 84,
+      colSpan: 6,
+      attrs: {
+        clearable: true,
+      },
     },
-  },
-  {
-    prop: 'brand',
-    label: '品牌',
-    labelWidth: 84,
-    colSpan: 6,
-    attrs: {
-      clearable: true,
+    isFHY.value
+      ? null
+      : {
+          prop: 'supplierId',
+          label: '供应商',
+          labelWidth: 84,
+          type: 'select',
+          colSpan: 6,
+          cell: 'supplier',
+        },
+    {
+      prop: 'receiveTime',
+      label: '验收时间',
+      labelWidth: 84,
+      type: 'daterange',
+      colSpan: 12,
+      attrs: {
+        clearable: true,
+        valueType: 'time-stamp',
+      },
     },
-  },
-  {
-    prop: 'model',
-    label: '型号',
-    labelWidth: 84,
-    colSpan: 6,
-    attrs: {
-      clearable: true,
+    {
+      prop: 'serialNo',
+      label: '设备序列号',
+      labelWidth: 84,
+      colSpan: 6,
+      attrs: {
+        clearable: true,
+      },
     },
-  },
-  {
-    prop: 'expressNo',
-    label: '快递单号',
-    labelWidth: 84,
-    colSpan: 6,
-    attrs: {
-      clearable: true,
+    isFHY.value
+      ? null
+      : {
+          prop: 'consignee',
+          label: '收件人',
+          labelWidth: 84,
+          colSpan: 6,
+          attrs: {
+            clearable: true,
+          },
+        },
+    isFHY.value
+      ? null
+      : {
+          prop: 'mailingAddress',
+          label: '收件地址',
+          labelWidth: 84,
+          colSpan: 6,
+          attrs: {
+            clearable: true,
+          },
+        },
+    {
+      prop: 'deliveryType',
+      label: '出入库状态',
+      type: 'select',
+      options: dictToOptionList(INOUT_TYPE),
+      labelWidth: 84,
+      colSpan: 6,
+      attrs: {
+        clearable: true,
+      },
     },
-  },
-  {
-    type: 'buttons',
-    colSpan: 2,
-    labelWidth: 0,
-    children: [
-      {
-        type: 'button',
-        text: '搜索',
-        onClick: () => {
-          search();
+    isFHY.value
+      ? null
+      : {
+          prop: 'brand',
+          label: '品牌',
+          labelWidth: 84,
+          colSpan: 6,
+          attrs: {
+            clearable: true,
+          },
+        },
+    isFHY.value
+      ? null
+      : {
+          prop: 'model',
+          label: '型号',
+          labelWidth: 84,
+          colSpan: 6,
+          attrs: {
+            clearable: true,
+          },
         },
+    {
+      prop: 'expressNo',
+      label: '快递单号',
+      labelWidth: 84,
+      colSpan: 6,
+      attrs: {
+        clearable: true,
       },
-    ],
-  },
-]);
+    },
+    {
+      type: 'buttons',
+      colSpan: 2,
+      labelWidth: 0,
+      children: [
+        {
+          type: 'button',
+          text: '搜索',
+          onClick: () => {
+            search();
+          },
+        },
+      ],
+    },
+  ];
+});
 
 const params = reactive({
   serviceId: '',