8
0
ZaiZai 1 год назад
Родитель
Сommit
ea9dc88aa2

+ 62 - 6
src/api/modules/certificate/list.js

@@ -4,7 +4,7 @@ export default {
     //分页
     async page(form) {
         return HcApi({
-            url: '/api/blade-system/data-scope/list',
+            url: '/api/blade-manager/signPfxFile/page',
             method: 'get',
             params: form,
         }, false)
@@ -12,17 +12,25 @@ export default {
     //详情
     async detail(id) {
         return HcApi({
-            url: '/api/blade-system/data-scope/detail',
+            url: '/api/blade-manager/signPfxFile/getById',
             method: 'get',
             params: {
                 id,
             },
         }, false)
     },
-    //新增和编辑
-    async submit(form) {
+    //新增
+    async add(form) {
         return HcApi({
-            url: '/api/blade-system/data-scope/submit',
+            url: '/api/blade-manager/signPfxFile/save',
+            method: 'post',
+            data: form,
+        }, false)
+    },
+    //编辑
+    async update(form) {
+        return HcApi({
+            url: '/api/blade-manager/signPfxFile/update',
             method: 'post',
             data: form,
         }, false)
@@ -30,11 +38,59 @@ export default {
     //删除
     async del(ids) {
         return HcApi({
-            url: '/api/blade-system/data-scope/remove',
+            url: '/api/blade-manager/signPfxFile/remove',
             method: 'post',
             params: {
                 ids,
             },
         }, false)
     },
+    //注册
+    async goRegister(data) {
+        return HcApi({
+            url: '/api/blade-manager/signPfxFile/goRegister',
+            method: 'post',
+            data: data,
+        }, false)
+    },
+    //获取当前系统下所有用户
+    async findUserByName(form) {
+        return HcApi({
+            url: '/api/blade-manager/signPfxFile/findUserByName',
+            method: 'get',
+            params: form,
+        }, false)
+    },
+    //获取角色方
+    async queryRole(form) {
+        return HcApi({
+            url: '/api/blade-manager/signPfxFile/queryRole',
+            method: 'get',
+            params: form,
+        }, false)
+    },
+    //获取项目和合同段
+    async queryProjectAndContract(form) {
+        return HcApi({
+            url: '/api/blade-manager/signPfxFile/queryProjectAndContract',
+            method: 'get',
+            params: form,
+        }, false)
+    },
+    //上传图片
+    async addFileInfo(form) {
+        return HcApi({
+            url: '/api/blade-resource/client/addFileInfo',
+            method: 'post',
+            data: form,
+        }, false)
+    },
+    //获取项目和合同段
+    async findPfxType(form) {
+        return HcApi({
+            url: '/api/blade-business/task/query-task-type-status',
+            method: 'get',
+            params: form,
+        }, false)
+    },
 }

+ 1 - 1
src/views/certificate/admin.vue

@@ -17,7 +17,7 @@
         </template>
         <!-- 查看 -->
         <hc-new-drawer v-model="isRowDrawer" is-close to-id="hc-main-box">
-            <HcAdminSee v-if="isRowDrawer" :pid="tableRowItem.projectId" :cid="tableRowItem.contractId" />
+            <HcAdminSee v-if="isRowDrawer" :cid="tableRowItem.contractId" />
         </hc-new-drawer>
     </hc-new-card>
 </template>

+ 129 - 4
src/views/certificate/list.vue

@@ -1,11 +1,136 @@
 <template>
-    <div>证书列表</div>
+    <hc-new-card>
+        <template #header>
+            <div class="w-100">
+                <el-select v-model="searchForm.projectId" filterable block placeholder="选择项目" @change="searchClick">
+                    <el-option v-for="item in projectData" :key="item.id" :label="item.projectName" :value="item.id" />
+                </el-select>
+            </div>
+        </template>
+        <template #extra>
+            <el-button hc-btn type="primary" @click="addClick">新增</el-button>
+        </template>
+        <hc-table :column="tableColumn" :datas="tableData" :loading="tableLoading" :index-style="{ width: 60 }" is-new>
+            <template #certificateType="{ row }">{{ row.certificateType === 1 ? '个人证书' : '企业证书' }}</template>
+            <template #isRegister="{ row }">
+                <el-link v-if="row.isRegister === 0" type="primary" @click="registerRowClick(row)">注册</el-link>
+                <span v-else>已注册</span>
+            </template>
+            <template #action="{ row }">
+                <el-link type="warning" @click="editRowClick(row)">修改</el-link>
+                <el-link type="danger" @click="delRowClick(row)">删除</el-link>
+            </template>
+        </hc-table>
+        <template #action>
+            <hc-pages :pages="searchForm" @change="pageChange" />
+        </template>
+    </hc-new-card>
 </template>
 
 <script setup>
+import { nextTick, onActivated, ref } from 'vue'
+import { getArrValue } from 'js-fast-way'
+import { delMessage } from '~uti/tools'
+import adminApi from '~api/certificate/admin'
+import mainApi from '~api/certificate/list'
 
-</script>
+//激活
+onActivated(() => {
+    getProjectData()
+})
+
+//项目列表
+const projectData = ref([])
+const getProjectData = async () => {
+    const { data } = await adminApi.queryProjectList()
+    const res = getArrValue(data)
+    if (res.length > 0) {
+        searchForm.value.projectId = res[0].id
+    } else {
+        searchForm.value.projectId = ''
+    }
+    projectData.value = res
+    searchClick()
+}
+
+//搜索条件
+const searchForm = ref({ projectId: '', current: 1, size: 20, total: 0 })
+
+//搜索
+const searchClick = () => {
+    searchForm.value.current = 1
+    getTableData()
+}
+
+//分页
+const pageChange = ({ current, size }) => {
+    searchForm.value.current = current
+    searchForm.value.size = size
+    getTableData()
+}
+
+//表格数据
+const tableColumn = ref([
+    { key: 'certificateUserName', name: '证书所有者' },
+    { key: 'certificateId', name: '证书ID/企业统一社会信用代码' },
+    { key: 'certificateType', name: '证书类型' },
+    { key: 'isRegister', name: '注册' },
+    { key: 'action', name: '操作', width: 100, align: 'center' },
+])
+const tableData = ref([])
 
-<style scoped lang="scss">
+//获取表格数据
+const tableLoading = ref(false)
+const getTableData = async () => {
+    tableData.value = []
+    tableLoading.value = true
+    const { error, code, data } = await mainApi.page({
+        ...searchForm.value,
+        total: null,
+    })
+    tableLoading.value = false
+    if (!error && code === 200) {
+        tableData.value = getArrValue(data['records'])
+        searchForm.value.total = data['total']
+    } else {
+        tableData.value = []
+        searchForm.value.total = 0
+    }
+}
 
-</style>
+//新增
+const addClick = () => {
+
+}
+
+//修改
+const editRowClick = (row) => {
+
+}
+
+//注册
+const registerRowClick = async (row) => {
+    const { error, code, msg } = await mainApi.goRegister({
+        key: row.id,
+    })
+    if (!error && code === 200) {
+        window.$message.success('操作成功')
+        getTableData()
+    } else {
+        window.$message.error(msg ?? '操作失败')
+    }
+}
+
+//删除
+const delRowClick = (row) => {
+    delMessage(async () => {
+        const { code, msg } = await mainApi.del(row.id)
+        if (code === 200) {
+            window.$message.success('删除成功')
+            getTableData()
+        } else {
+            window.$message.error(msg ?? '删除失败')
+        }
+    })
+}
+</script>

+ 0 - 5
src/views/certificate/modules/admin/see.vue

@@ -53,10 +53,6 @@ import mainApi from '~api/certificate/admin'
 import { delMessage } from '~uti/tools.js'
 
 const props = defineProps({
-    pid: {
-        type: [String, Number],
-        default: '',
-    },
     cid: {
         type: [String, Number],
         default: '',
@@ -64,7 +60,6 @@ const props = defineProps({
 })
 
 //监听内容
-const projectId = ref(props.pid)
 const contractId = ref(props.cid)
 const currentId = ref(props.cid)
 

+ 34 - 0
src/views/certificate/modules/list/form.vue

@@ -0,0 +1,34 @@
+<template>
+    <hc-new-card>
+        11111
+    </hc-new-card>
+</template>
+
+<script setup>
+import { onMounted, ref } from 'vue'
+import { getArrValue, isNullES } from 'js-fast-way'
+import adminApi from '~api/certificate/admin'
+import mainApi from '~api/certificate/list'
+
+const props = defineProps({
+    cid: {
+        type: [String, Number],
+        default: '',
+    },
+})
+
+//监听内容
+const contractId = ref(props.cid)
+const currentId = ref(props.cid)
+
+//渲染完成
+onMounted(() => {
+    getDataApi()
+})
+
+//获取数据
+const getDataApi = () => {
+    if (isNullES(contractId.value)) return
+    console.log('contractId', contractId.value)
+}
+</script>