Ver Fonte

设备档案卡新增授权人员tab

tianxinyu há 6 dias atrás
pai
commit
ab5d7f9f40

+ 13 - 0
src/api/platform/device/device.js

@@ -138,3 +138,16 @@ export function queryEquipmentPvRecord(data) {
     data: data
   })
 }
+
+/**
+ * 授权人员列表,设备使用授权, 人员岗位授权
+ * @param {*} data
+ * @returns
+ */
+export function queryPersonRecord (data) {
+    return request({
+        url: BUSINESS_BASE_URL() + '/equipment/authorization/query',
+        method: 'post',
+        data: data
+    })
+}

+ 129 - 0
src/views/component/device/authorizedPersonRecord.vue

@@ -0,0 +1,129 @@
+<!-- 授权人员 -->
+<template>
+  <div v-loading="loading" class="table">
+      <el-table :data="listData">
+          <el-table-column
+              prop=""
+              label="序号"
+              width="50"
+              type="index"
+              :index="showIndex"
+          />
+          <el-table-column prop="bianZhiShiJian" label="授权日期">
+              <template slot-scope="{row}">
+                  {{ formatDate(row.bianZhiShiJian) }}
+              </template>
+          </el-table-column>
+          <el-table-column prop="bianZhiBuMen" label="专业组">
+              <template slot-scope="{row}">
+                  <ibps-user-selector
+                      :value="row.bianZhiBuMen"
+                      type="position"
+                      readonly-text="text"
+                      :disabled="true"
+                      :multiple="true"
+                      size="mini"
+                  />
+              </template>
+          </el-table-column>
+          <el-table-column prop="renYuanMing" label="姓名" />
+      </el-table>
+      <el-pagination
+          style="margin-top: 5px; padding-bottom: 10px"
+          :current-page="requestPage.pageNo"
+          :page-sizes="[10, 20,30, 50]"
+          :page-size="requestPage.limit"
+          layout="prev,pager,next,jumper,sizes,->,total"
+          :total="total"
+          @size-change="handleSizeChange"
+          @current-change="handleCurrentChange"
+      />
+  </div>
+</template>
+
+<script>
+import ibpsUserSelector from '@/business/platform/org/selector'
+import { queryPersonRecord } from '@/api/platform/device/device'
+export default {
+  components: {
+      ibpsUserSelector
+  },
+  props: {
+      params: {
+          type: Object,
+          default: () => {}
+      }
+  },
+  data () {
+      return {
+          pkValue: '',
+          DialogVisible: false,
+          iframeVisible: false,
+          srcUrl: '',
+          loading: false,
+          listData: [],
+          total: 0,
+          requestPage: {
+              limit: 10,
+              pageNo: 1
+          }
+      }
+  },
+  mounted () {
+      this.getData()
+  },
+  methods: {
+      async getData () {
+          this.loading = true
+          const { data: { dataResult, pageResult }} = await queryPersonRecord({
+              requestPage: this.requestPage,
+              parameters: [
+                  { key: 'Q^she_bei_ming_chen^S', value: this.params.id }
+              ]
+          })
+          this.listData = dataResult
+          this.total = pageResult.totalCount
+          this.loading = false
+      },
+      // 当前页码改变
+      handleCurrentChange (val) {
+          this.requestPage.pageNo = val
+          this.getData()
+      },
+      // 页码选择器改变
+      handleSizeChange (val) {
+          this.requestPage.limit = val
+          this.requestPage.pageNo = 1
+          this.getData()
+      },
+      // 分页连续序号
+      showIndex (index) {
+          return index + 1 + (this.requestPage.pageNo - 1) * this.requestPage.limit
+      },
+      formatDate (date) {
+          if (!date) return ''
+
+          const d = new Date(date)
+
+          // 检查日期是否有效
+          if (isNaN(d.getTime())) return date
+
+          const year = d.getFullYear()
+          const month = String(d.getMonth() + 1).padStart(2, '0')
+          const day = String(d.getDate()).padStart(2, '0')
+
+          return `${year}-${month}-${day}`
+      }
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+.table{
+  .button{
+      margin-bottom: 5px;
+      display: flex;
+      justify-content: flex-end;
+  }
+}
+</style>

+ 22 - 1
src/views/component/device/deviceDialog.vue

@@ -1273,6 +1273,10 @@ export default {
     IbpsImage: () => ({
       component: import('@/business/platform/file/image'),
       delay: 200
+    }),
+    AuthorizedPersonRecord: () => ({
+      component: import('./authorizedPersonRecord.vue'),
+      delay: 200
     })
   },
   props: {
@@ -1385,7 +1389,13 @@ export default {
           name: 'eight',
           component: 'ConfirmationRecord',
           isKeepAlive: true
-        }
+        },
+        // {   //福永,主分支
+        //   label: '授权人员', 
+        //   name: 'nine', 
+        //   component: 'AuthorizedPersonRecord', 
+        //   isKeepAlive: true 
+        // }
         // 同步与深圳三院分支,后端暂未同步对应接口,不开放
         // { label: '性能验证记录', name: 'nine', component: 'PvRecord', isKeepAlive: true }
       ],
@@ -1889,6 +1899,17 @@ export default {
       this.isEdit = !!(this.params && this.params.id)
       this.isSheKou = this.deptList[0].positionId === '1166372468122714112' // 判断是否是蛇口医院
 
+      if(deviceres?.authorization){
+        this.tabItems.push(
+          {
+            label: '授权人员', 
+            name: 'nine', 
+            component: 'AuthorizedPersonRecord', 
+            isKeepAlive: true 
+          }
+        )
+      }
+
       // 根据全局配置动态生成tab
       const newTab = []
       for (const key in this.tabList) {