Browse Source

Merge branch 'master' of http://git.qmth.com.cn/sop/web

刘洋 1 year ago
parent
commit
4be50e3864

+ 1 - 1
src/api/resource-guard.js

@@ -85,6 +85,6 @@ export const personAllocateFreeCoordinatorApi = (serviceUnitId) =>
 // registration-query
 export const registrationQueryListApi = (data) =>
   request({
-    url: '/api/system/registration-query/list',
+    url: '/api/admin/device/in/out/source_page',
     params: data,
   });

+ 4 - 0
src/config/constants.js

@@ -124,6 +124,10 @@ export const INOUT_TYPE = {
   IN: '入库',
   OUT: '出库',
 };
+export const DEVICE_USAGE_TYPE = {
+  PROJECT: '项目',
+  OTHER: '其他',
+};
 
 // SOP
 export const FLOW_STATUS = {

+ 2 - 11
src/layout/index.vue

@@ -89,22 +89,13 @@ const clickHandler = (data) => {
   }
 };
 
-watch(
-  () => userStore.curPageModule,
-  (val) => {
-    if (val !== 'MyWorkbenches') return;
-    workStore.updateWorkCounts();
-  },
-  {
-    immediate: true,
-  }
-);
 watch(
   () => route.name,
   () => {
     if (userStore.curPageModule !== 'MyWorkbenches') return;
     workStore.updateWorkCounts();
-  }
+  },
+  { immediate: true }
 );
 </script>
 

+ 1 - 1
src/style/global.less

@@ -256,7 +256,7 @@ body {
     border-radius: 4px;
     background-color: #fff;
     padding: 16px;
-    margin-bottom: 10px;
+    margin-bottom: 16px;
     .m-head {
       border-bottom: 1px solid @light-border-color;
       line-height: 24px;

+ 4 - 0
src/utils/filter.js

@@ -21,6 +21,7 @@ import {
   DATA_TASK_TYPE,
   MESSAGE_TYPE,
   WAIT_HANDLE_TYPE,
+  DEVICE_USAGE_TYPE,
 } from '@/config/constants';
 import { dateFormat } from './tool';
 
@@ -111,6 +112,9 @@ export function authenticationRoleFilter(val) {
 export function inoutTypeFilter(val) {
   return INOUT_TYPE[val] || DEFAULT_FIELD;
 }
+export function deviceUsageTypeFilter(val) {
+  return DEVICE_USAGE_TYPE[val] || DEFAULT_FIELD;
+}
 // sop
 export function flowStatusFilter(val) {
   return FLOW_STATUS[val] || DEFAULT_FIELD;

+ 99 - 35
src/views/resource-guard/device-guard/registration-query/index.vue

@@ -10,6 +10,12 @@
           type="DEVICE"
         ></select-supplier>
       </template>
+      <template #user="{ item, params }">
+        <select-filter-user
+          v-model="params[item.prop]"
+          clearable
+        ></select-filter-user>
+      </template>
     </SearchForm>
     <div class="flex-1 page-wrap">
       <t-table
@@ -28,7 +34,16 @@
           current: pagination.pageNumber,
         }"
       >
-        <template #create-time="{ col, row }">
+        <template #usage="{ col, row }">
+          {{ deviceUsageTypeFilter(row[col.colKey]) }}
+        </template>
+        <template #status="{ col, row }">
+          {{ runningStatusFilter(row[col.colKey]) }}
+        </template>
+        <template #inout="{ col, row }">
+          {{ inoutTypeFilter(row[col.colKey]) }}
+        </template>
+        <template #inout-time="{ col, row }">
           {{ timestampFilter(row[col.colKey]) }}
         </template>
       </t-table>
@@ -43,8 +58,13 @@ import { omit } from 'lodash';
 import { registrationQueryListApi } from '@/api/resource-guard';
 import useFetchTable from '@/hooks/useFetchTable';
 import { dictToOptionList } from '@/utils/tool';
-import { INOUT_TYPE } from '@/config/constants';
-import { timestampFilter } from '@/utils/filter';
+import { DEVICE_USAGE_TYPE, RUNNING_STATUS } from '@/config/constants';
+import {
+  deviceUsageTypeFilter,
+  inoutTypeFilter,
+  runningStatusFilter,
+  timestampFilter,
+} from '@/utils/filter';
 
 const fields = ref([
   {
@@ -56,31 +76,29 @@ const fields = ref([
     cell: 'service',
   },
   {
-    prop: 'inout',
-    label: '出库/入库',
+    prop: 'usageType',
+    label: '用途类型',
     type: 'select',
     labelWidth: 100,
     colSpan: 5,
-    options: dictToOptionList(INOUT_TYPE),
+    options: dictToOptionList(DEVICE_USAGE_TYPE),
     attrs: {
       clearable: true,
     },
   },
   {
-    prop: 'deviceNo',
-    label: '设备编号',
+    prop: 'userId',
+    label: '登记人',
     labelWidth: 100,
     colSpan: 5,
-    attrs: {
-      clearable: true,
-    },
+    cell: 'user',
   },
   {
-    prop: 'createTime',
-    label: '出/入库时间',
-    type: 'daterange',
+    prop: 'deviceStatus',
+    label: '运行状态',
     labelWidth: 100,
-    colSpan: 7,
+    colSpan: 5,
+    options: dictToOptionList(RUNNING_STATUS),
     attrs: {
       clearable: true,
     },
@@ -99,15 +117,26 @@ const fields = ref([
     ],
   },
   {
-    prop: 'supplierId',
-    label: '供应商',
-    type: 'select',
+    prop: 'inOutTime',
+    label: '出/入库时间',
+    type: 'daterange',
+    labelWidth: 100,
+    colSpan: 10,
+    attrs: {
+      clearable: true,
+    },
+  },
+  {
+    prop: 'deviceNo',
+    label: '设备编号',
     labelWidth: 100,
     colSpan: 5,
-    cell: 'supplier',
+    attrs: {
+      clearable: true,
+    },
   },
   {
-    prop: 'custom',
+    prop: 'customName',
     label: '客户名称',
     labelWidth: 100,
     colSpan: 5,
@@ -115,37 +144,72 @@ const fields = ref([
       clearable: true,
     },
   },
+  {
+    prop: 'location',
+    label: '当前地',
+    labelWidth: 100,
+    colSpan: 5,
+    attrs: {
+      clearable: true,
+    },
+  },
+  {
+    prop: 'address',
+    label: '发往地',
+    labelWidth: 100,
+    colSpan: 5,
+    attrs: {
+      clearable: true,
+    },
+  },
+  {
+    prop: 'serialNo',
+    label: '登记流水号',
+    labelWidth: 100,
+    colSpan: 5,
+    attrs: {
+      clearable: true,
+    },
+  },
 ]);
 const params = reactive({
   serviceUnitId: '',
-  inout: '',
+  usageType: '',
+  userId: '',
+  deviceStatus: '',
   deviceNo: '',
-  createTime: [],
+  inOutTime: [],
   supplierId: '',
-  custom: '',
+  customName: '',
+  location: '',
+  address: '',
+  serialNo: '',
 });
 
 const computedParams = computed(() => {
-  let data = omit(params, ['createTime']);
-  data.startTime = params.createTime[0];
-  data.endTime = params.createTime[1];
+  let data = omit(params, ['inOutTime']);
+  data.inOutTimeStart = params.inOutTime[0];
+  data.inOutTimeEnd = params.inOutTime[1];
   return data;
 });
 
 const columns = [
-  { colKey: 'serviceUnitName', title: '服务单元名称' },
+  { colKey: 'serialNo', title: '登记流水号', width: 200 },
+  { colKey: 'serviceUnitName', title: '服务单元名称', width: 160 },
+  { colKey: 'usageType', title: '用途类型', width: 100, cell: 'usage' },
+  { colKey: 'deviceNo', title: '设备编号', width: 120 },
+  { colKey: 'deviceStatus', title: '运行状态', width: 100, cell: 'status' },
   {
-    colKey: 'createTime',
+    colKey: 'inOutTime',
     title: '出/入库时间',
-    cell: 'create-time',
+    cell: 'inout-time',
     width: 180,
   },
-  { colKey: 'creator', title: '登记人' },
-  { colKey: 'custom', title: '客户名称' },
-  { colKey: 'inout', title: '出库/入库', width: 100 },
-  { colKey: 'deviceNo', title: '设备编号' },
-  { colKey: 'supplier', title: '供应商' },
-  { colKey: 'toArea', title: '发往地' },
+  { colKey: 'userName', title: '登记人' },
+  { colKey: 'customName', title: '客户名称' },
+  { colKey: 'inOutType', title: '出库/入库', width: 100, cell: 'inout' },
+  { colKey: 'location', title: '当前地' },
+  { colKey: 'address', title: '发往地' },
 ];
 const { pagination, tableData, search, onChange } = useFetchTable(
   registrationQueryListApi,

+ 1 - 1
src/views/user/auth-manage/role-manage/add-role.vue

@@ -188,7 +188,7 @@ const getHasRoleIds = (data, arr = []) => {
 };
 const addHandler = () => {
   let checkIds = getHasRoleIds(treeFlatArr.value);
-  console.log('checkIds', checkIds, checkIds.length);
+  // console.log('checkIds', checkIds, checkIds.length);
   addRole({
     name: formData.name,
     privilegeIds: checkIds,