|
@@ -0,0 +1,159 @@
|
|
|
+<template>
|
|
|
+ <div class="hui-flex hui-content border-box">
|
|
|
+ <div class="hui-content-title">
|
|
|
+ <div class="hui-title-item active">{{titleName}}</div>
|
|
|
+ </div>
|
|
|
+ <div class="hui-flex-box hui-flex hui-table">
|
|
|
+ <div class="hui-content-insert">
|
|
|
+ <el-button type="primary" size="small" @click="insert">
|
|
|
+ 新增服务
|
|
|
+ </el-button>
|
|
|
+ </div>
|
|
|
+ <div class="hui-flex-box">
|
|
|
+ <el-table :data="tableData" row-key="id" height="100%">
|
|
|
+ <el-table-column label="序号" width="50">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <div style="text-align: center;">{{scope.$index + 1}}</div>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="服务名称" prop="name"></el-table-column>
|
|
|
+ <el-table-column label="变更类型" prop="type"></el-table-column>
|
|
|
+ <el-table-column label="资产编码" prop="assetNumber"></el-table-column>
|
|
|
+ <el-table-column label="创建者" prop="createdByUserName"></el-table-column>
|
|
|
+ <el-table-column label="状态">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <div v-if="!scope.row.state" class="hui-state">
|
|
|
+ <span class="hui-state-bage hui-state-primary"></span>
|
|
|
+ <span class="hui-state-label">待生成</span>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="操作" width="150">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <div class="hui-table-operation">
|
|
|
+ <span class="table-operation" v-permission="'/work/property/change/detail'"
|
|
|
+ @click="lookFlow(scope.row)">
|
|
|
+ 详情
|
|
|
+ </span>
|
|
|
+ <span class="table-operation" v-permission="'/work/property/change/update'"
|
|
|
+ v-if="!scope.row.projectFlowId" @click="updateFlow(scope.row)">
|
|
|
+ 编辑
|
|
|
+ </span>
|
|
|
+ <span class="table-operation" v-permission="'/work/property/change/delete'"
|
|
|
+ v-if="!scope.row.projectFlowId" @click="deleteFlow(scope.row)">
|
|
|
+ 删除
|
|
|
+ </span>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <template slot="empty">
|
|
|
+ <el-empty description="暂无数据"></el-empty>
|
|
|
+ </template>
|
|
|
+ </el-table>
|
|
|
+ </div>
|
|
|
+ <div class="hui-content-pagination">
|
|
|
+ <el-pagination :pager-count="9" layout="prev, pager, next" :page-size="pageSize" :total="totalCount"
|
|
|
+ @current-change="currentChange" background>
|
|
|
+ </el-pagination>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <el-dialog :close-on-click-modal="false" :title="isUpdate?'编辑':'新增'" :visible.sync="visible" width="900px"
|
|
|
+ :append-to-body="true">
|
|
|
+ <edit v-if="visible" :isUpdate="isUpdate" @callback="callback" :detailId="detailId">
|
|
|
+ </edit>
|
|
|
+ </el-dialog>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+ const edit = () => import('@/components/work/serve/content/edit');
|
|
|
+ import {
|
|
|
+ getServeDepartmentBySign
|
|
|
+ } from '@/api/system'
|
|
|
+ export default {
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ titleName: '',
|
|
|
+ tableData: [],
|
|
|
+ currPage: 1,
|
|
|
+ pageSize: 10,
|
|
|
+ totalCount: 0,
|
|
|
+ isUpdate: false,
|
|
|
+ visible: false,
|
|
|
+ detailId: '',
|
|
|
+ level: {}
|
|
|
+ }
|
|
|
+ },
|
|
|
+ mounted() {
|
|
|
+ let title = this.getTitleNameByPath() || {
|
|
|
+ title: '服务商品'
|
|
|
+ };
|
|
|
+ this.titleName = title.title;
|
|
|
+ getServeDepartmentBySign(this.$route.params.type).then(res => {
|
|
|
+ if (res.state && res.data) {
|
|
|
+ this.level = res.data;
|
|
|
+ this.init();
|
|
|
+ }
|
|
|
+ })
|
|
|
+
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ init() {
|
|
|
+
|
|
|
+ },
|
|
|
+ currentChange(currPage) {
|
|
|
+ this.currPage = currPage;
|
|
|
+ this.init();
|
|
|
+ },
|
|
|
+ insert() {
|
|
|
+ this.visible = true;
|
|
|
+ this.isUpdate = false;
|
|
|
+ },
|
|
|
+ lookFlow(val) {
|
|
|
+ this.detailId = val.id;
|
|
|
+ this.drawer = true;
|
|
|
+ },
|
|
|
+ updateFlow(val) {
|
|
|
+ this.detailId = val.id;
|
|
|
+ this.isUpdate = true;
|
|
|
+ this.visible = true;
|
|
|
+ },
|
|
|
+ deleteFlow(val) {
|
|
|
+ this.$confirm('确定要删除该流程?', () => {
|
|
|
+ deleteFlow(val.id).then(res => {
|
|
|
+ if (res.state) {
|
|
|
+ this.$message.success('操作成功');
|
|
|
+ this.init();
|
|
|
+ }
|
|
|
+ })
|
|
|
+ });
|
|
|
+ },
|
|
|
+ callback(type) {
|
|
|
+ this.visible = false;
|
|
|
+ if (type === 'init') this.init();
|
|
|
+ },
|
|
|
+ getTitleNameByPath() {
|
|
|
+ function findNodeById(nodes, index) {
|
|
|
+ for (const node of nodes) {
|
|
|
+ if (node.index === index) {
|
|
|
+ return node; // 找到匹配的节点,直接返回
|
|
|
+ }
|
|
|
+ // 检查子节点是否存在且为数组
|
|
|
+ if (Array.isArray(node.children)) {
|
|
|
+ const found = findNodeById(node.children, index); // 递归查找子节点
|
|
|
+ if (found) return found;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return null; // 遍历结束未找到,返回 null
|
|
|
+ }
|
|
|
+ return findNodeById(this.$store.getters.menuData, this.$route.path);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ components: {
|
|
|
+ edit
|
|
|
+ }
|
|
|
+ }
|
|
|
+</script>
|
|
|
+
|
|
|
+<style>
|
|
|
+</style>
|