|
@@ -1,285 +1,290 @@
|
|
|
-<template>
|
|
|
- <div class="hui-flex">
|
|
|
- <div class="hui-flex-box yui-tree-box">
|
|
|
- <div class="hui-left-tree">
|
|
|
- <div class="hui-left-tree-title">
|
|
|
- <svg-icon name="zhuangshi" width="16" height="20"></svg-icon>
|
|
|
- <span class="hui-left-tree-sub">资产列表</span>
|
|
|
- </div>
|
|
|
- <div class="hui-left-tree-content">
|
|
|
- <el-collapse>
|
|
|
- <el-collapse-item v-for="item in treeData" :key="item.id">
|
|
|
- <template slot="title">
|
|
|
- <i class="iconfont huifont-shuzhuangcaidantubiao"></i>
|
|
|
- <span class="el-collapse-name">{{item.name}}</span>
|
|
|
- </template>
|
|
|
- <div>
|
|
|
- <el-tree :data="item.children" :props="defaultProps">
|
|
|
- <div class="custom-tree-node" slot-scope="{ node, data }">
|
|
|
- <div class="label">{{node.label}}</div>
|
|
|
- <div :class="nowData.id === data.id ? 'active':''"
|
|
|
- @click.stop="filterDevice(data)">
|
|
|
- <i
|
|
|
- :class="'iconfont ' + (data.deviceId ? 'huifont-shebeiguanli' : 'huifont-xiangmuguanli')">
|
|
|
- </i>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </el-tree>
|
|
|
- </div>
|
|
|
- </el-collapse-item>
|
|
|
- </el-collapse>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- <div class="hui-tree-content">
|
|
|
- <div class="hui-flex hui-content box-background">
|
|
|
- <div class="hui-content-title">
|
|
|
- <div class="hui-title-item active">资产登记</div>
|
|
|
- </div>
|
|
|
- <div class="hui-flex-box hui-flex hui-table">
|
|
|
- <div class="hui-content-insert">
|
|
|
- <el-button v-permission="'/work/property/register/add'" type="primary" size="medium"
|
|
|
- @click="insert">
|
|
|
- 新增登记
|
|
|
- </el-button>
|
|
|
- </div>
|
|
|
- <div class="hui-flex-box">
|
|
|
- <el-table :data="tableData" row-key="id" border 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="资产类型">
|
|
|
- <template slot-scope="scope">
|
|
|
- <span>{{scope.row.type === 0?'普通设备':'物联网设备'}}</span>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="资产编码" prop="assetNumber"></el-table-column>
|
|
|
- <el-table-column label="单位建筑" prop="projectItemName"></el-table-column>
|
|
|
- <el-table-column label="具体位置" prop="projectItemTargetName"></el-table-column>
|
|
|
- <el-table-column label="型号" prop="deviceModel"></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>
|
|
|
- <div v-if="scope.row.state == -1 || scope.row.state == 1" class="hui-state">
|
|
|
- <span class="hui-state-bage hui-state-primary"></span>
|
|
|
- <span class="hui-state-label">待审核</span>
|
|
|
- </div>
|
|
|
- <div v-if="scope.row.state == 2" class="hui-state">
|
|
|
- <span class="hui-state-bage hui-state-info"></span>
|
|
|
- <span class="hui-state-label">审核中</span>
|
|
|
- </div>
|
|
|
- <div v-if="scope.row.state == 3" class="hui-state">
|
|
|
- <span class="hui-state-bage hui-state-success"></span>
|
|
|
- <span class="hui-state-label">通过</span>
|
|
|
- </div>
|
|
|
- <div v-if="scope.row.state == 4" class="hui-state">
|
|
|
- <span class="hui-state-bage hui-state-error"></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/register/detail'"
|
|
|
- @click="lookFlow(scope.row)">
|
|
|
- 详情
|
|
|
- </span>
|
|
|
- <span class="table-operation"
|
|
|
- v-permission="'/work/property/register/update'"
|
|
|
- v-if="!scope.row.projectFlowId" @click="updateFlow(scope.row)">
|
|
|
- 编辑
|
|
|
- </span>
|
|
|
- <span class="table-operation"
|
|
|
- v-permission="'/work/property/register/delete'"
|
|
|
- v-if="!scope.row.projectFlowId" @click="deleteFlow(scope.row)">
|
|
|
- 删除
|
|
|
- </span>
|
|
|
- </div>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <template slot="empty">
|
|
|
- <empty description="暂无数据"></empty>
|
|
|
- </template>
|
|
|
- </el-table>
|
|
|
- </div>
|
|
|
- <div class="hui-content-pagination">
|
|
|
- <el-pagination :pager-count="9" layout="prev, pager, next" :total="totalCount"
|
|
|
- @current-change="currentChange">
|
|
|
- </el-pagination>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- <el-dialog :close-on-click-modal="false" :title="isUpdate?'编辑':'新增'" :visible.sync="visible" width="1200px"
|
|
|
- :append-to-body="true">
|
|
|
- <flow-form v-if="visible" :isUpdate="isUpdate" @callback="callback" :detailId="detailId"
|
|
|
- :flowType="flowType">
|
|
|
- </flow-form>
|
|
|
- </el-dialog>
|
|
|
- <el-drawer title="流程详情" :visible.sync="drawer" :size="400" :append-to-body="true">
|
|
|
- <flow-detail v-if="drawer" @callback="callback" :detailId="detailId"></flow-detail>
|
|
|
- </el-drawer>
|
|
|
- </div>
|
|
|
-</template>
|
|
|
-
|
|
|
-<script>
|
|
|
- import {
|
|
|
- initDevicePartList,
|
|
|
- getDevicePartList,
|
|
|
- getFlowList,
|
|
|
- deleteFlow
|
|
|
- } from '@/httpApi/property'
|
|
|
- import flowForm from '@/components/flow/flowForm'
|
|
|
+<template>
|
|
|
+ <div class="hui-flex">
|
|
|
+ <div class="hui-flex-box yui-tree-box">
|
|
|
+ <div class="hui-left-tree">
|
|
|
+ <div class="hui-left-tree-title">
|
|
|
+ <svg-icon name="zhuangshi" width="16" height="20"></svg-icon>
|
|
|
+ <span class="hui-left-tree-sub">资产列表</span>
|
|
|
+ </div>
|
|
|
+ <div class="hui-left-tree-content">
|
|
|
+ <el-collapse>
|
|
|
+ <el-collapse-item v-for="item in treeData" :key="item.id">
|
|
|
+ <template slot="title">
|
|
|
+ <i class="iconfont huifont-shuzhuangcaidantubiao"></i>
|
|
|
+ <span class="el-collapse-name">{{item.name}}</span>
|
|
|
+ </template>
|
|
|
+ <div>
|
|
|
+ <el-tree :data="item.children" :props="defaultProps">
|
|
|
+ <div class="custom-tree-node" slot-scope="{ node, data }">
|
|
|
+ <div class="label">{{node.label}}</div>
|
|
|
+ <div :class="nowData.id === data.id ? 'active':''"
|
|
|
+ @click.stop="filterDevice(data)">
|
|
|
+ <i
|
|
|
+ :class="'iconfont ' + (data.deviceId ? 'huifont-shebeiguanli' : 'huifont-xiangmuguanli')">
|
|
|
+ </i>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </el-tree>
|
|
|
+ </div>
|
|
|
+ </el-collapse-item>
|
|
|
+ </el-collapse>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="hui-tree-content">
|
|
|
+ <div class="hui-flex hui-content box-background">
|
|
|
+ <div class="hui-content-title">
|
|
|
+ <div class="hui-title-item active">资产登记</div>
|
|
|
+ </div>
|
|
|
+ <div class="hui-flex-box hui-flex hui-table">
|
|
|
+ <div class="hui-content-insert">
|
|
|
+ <el-button v-permission="'/work/property/register/add'" type="primary" size="medium"
|
|
|
+ @click="insert">
|
|
|
+ 新增登记
|
|
|
+ </el-button>
|
|
|
+ <el-button type="info" size="medium" @click="downloadFile">标准模板下载</el-button>
|
|
|
+ </div>
|
|
|
+ <div class="hui-flex-box">
|
|
|
+ <el-table :data="tableData" row-key="id" border 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="资产类型">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span>{{scope.row.type === 0?'普通设备':'物联网设备'}}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="资产编码" prop="assetNumber"></el-table-column>
|
|
|
+ <el-table-column label="单位建筑" prop="projectItemName"></el-table-column>
|
|
|
+ <el-table-column label="具体位置" prop="projectItemTargetName"></el-table-column>
|
|
|
+ <el-table-column label="型号" prop="deviceModel"></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>
|
|
|
+ <div v-if="scope.row.state == -1 || scope.row.state == 1" class="hui-state">
|
|
|
+ <span class="hui-state-bage hui-state-primary"></span>
|
|
|
+ <span class="hui-state-label">待审核</span>
|
|
|
+ </div>
|
|
|
+ <div v-if="scope.row.state == 2" class="hui-state">
|
|
|
+ <span class="hui-state-bage hui-state-info"></span>
|
|
|
+ <span class="hui-state-label">审核中</span>
|
|
|
+ </div>
|
|
|
+ <div v-if="scope.row.state == 3" class="hui-state">
|
|
|
+ <span class="hui-state-bage hui-state-success"></span>
|
|
|
+ <span class="hui-state-label">通过</span>
|
|
|
+ </div>
|
|
|
+ <div v-if="scope.row.state == 4" class="hui-state">
|
|
|
+ <span class="hui-state-bage hui-state-error"></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/register/detail'"
|
|
|
+ @click="lookFlow(scope.row)">
|
|
|
+ 详情
|
|
|
+ </span>
|
|
|
+ <span class="table-operation"
|
|
|
+ v-permission="'/work/property/register/update'"
|
|
|
+ v-if="!scope.row.projectFlowId" @click="updateFlow(scope.row)">
|
|
|
+ 编辑
|
|
|
+ </span>
|
|
|
+ <span class="table-operation"
|
|
|
+ v-permission="'/work/property/register/delete'"
|
|
|
+ v-if="!scope.row.projectFlowId" @click="deleteFlow(scope.row)">
|
|
|
+ 删除
|
|
|
+ </span>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <template slot="empty">
|
|
|
+ <empty description="暂无数据"></empty>
|
|
|
+ </template>
|
|
|
+ </el-table>
|
|
|
+ </div>
|
|
|
+ <div class="hui-content-pagination">
|
|
|
+ <el-pagination :pager-count="9" layout="prev, pager, next" :total="totalCount"
|
|
|
+ @current-change="currentChange">
|
|
|
+ </el-pagination>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <el-dialog :close-on-click-modal="false" :title="isUpdate?'编辑':'新增'" :visible.sync="visible" width="1200px"
|
|
|
+ :append-to-body="true">
|
|
|
+ <flow-form v-if="visible" :isUpdate="isUpdate" @callback="callback" :detailId="detailId"
|
|
|
+ :flowType="flowType">
|
|
|
+ </flow-form>
|
|
|
+ </el-dialog>
|
|
|
+ <el-drawer title="流程详情" :visible.sync="drawer" :size="400" :append-to-body="true">
|
|
|
+ <flow-detail v-if="drawer" @callback="callback" :detailId="detailId"></flow-detail>
|
|
|
+ </el-drawer>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+ import {
|
|
|
+ initDevicePartList,
|
|
|
+ getDevicePartList,
|
|
|
+ getFlowList,
|
|
|
+ deleteFlow
|
|
|
+ } from '@/httpApi/property'
|
|
|
+ import flowForm from '@/components/flow/flowForm'
|
|
|
import flowDetail from '@/components/flow/flowDetail'
|
|
|
- export default {
|
|
|
- data() {
|
|
|
- return {
|
|
|
- flowType: 1,
|
|
|
- tableData: [],
|
|
|
- currPage: 1,
|
|
|
- pageSize: 10,
|
|
|
- totalCount: 0,
|
|
|
- treeData: [],
|
|
|
- defaultProps: {
|
|
|
- children: 'children',
|
|
|
- label: 'name'
|
|
|
- },
|
|
|
- visible: false,
|
|
|
- isUpdate: false,
|
|
|
- detailId: '',
|
|
|
- drawer: false,
|
|
|
- nowData: {},
|
|
|
- filterOption: {}
|
|
|
- }
|
|
|
- },
|
|
|
- mounted() {
|
|
|
- this.initDeviceList();
|
|
|
- this.init();
|
|
|
- },
|
|
|
- methods: {
|
|
|
- init() {
|
|
|
- if (!this.auth('/work/property/register/list')) return;
|
|
|
- let filterOption = {
|
|
|
- projectId: this.$store.getters.project.id,
|
|
|
- flowType: this.flowType
|
|
|
- };
|
|
|
- filterOption = Object.assign(filterOption, this.filterOption);
|
|
|
- getFlowList(this.currPage, this.pageSize, filterOption).then(res => {
|
|
|
- if (res.state) {
|
|
|
- this.tableData = res.data.dataList.map(node => {
|
|
|
- node = Object.assign(node, JSON.parse(node.flowData));
|
|
|
- return node;
|
|
|
- });;
|
|
|
- this.totalCount = res.data.totalCount;
|
|
|
- }
|
|
|
- })
|
|
|
- },
|
|
|
- initDeviceList() {
|
|
|
- getDevicePartList(this.$store.getters.organization.id, this.$store.getters.project.id).then(res => {
|
|
|
- if (res.state) {
|
|
|
- if (res.data.length === 0) {
|
|
|
- initDevicePartList(this.$store.getters.organization.id, this.$store.getters.project.id)
|
|
|
- .then(res => {
|
|
|
- if (res.state) this.initDeviceList();
|
|
|
- })
|
|
|
- } else {
|
|
|
- this.treeData = res.data;
|
|
|
- this.returnChildren(this.treeData);
|
|
|
- }
|
|
|
- }
|
|
|
- })
|
|
|
- },
|
|
|
- returnChildren(data) {
|
|
|
- data.forEach(item => {
|
|
|
- if (item.children && item.children.length > 0) this.returnChildren(item.children);
|
|
|
- });
|
|
|
- },
|
|
|
- filterDevice(data) {
|
|
|
- this.filterOption = {};
|
|
|
- if (this.nowData.id === data.id) {
|
|
|
- this.nowData = {};
|
|
|
- } else {
|
|
|
- this.nowData = data;
|
|
|
- if (this.nowData.deviceId) {
|
|
|
- this.filterOption['deviceId'] = this.nowData.deviceId;
|
|
|
- } else {
|
|
|
- this.filterOption['deviceLevelIds'] = this.getStorageIds([data]);
|
|
|
- }
|
|
|
- }
|
|
|
- this.currPage = 1;
|
|
|
- this.init();
|
|
|
- },
|
|
|
- getStorageIds(array) {
|
|
|
- //获取档案库id
|
|
|
- let ids = [];
|
|
|
-
|
|
|
- function getIds(array, ids) {
|
|
|
- array.forEach(item => {
|
|
|
- if (item.id) {
|
|
|
- ids.push(item.id);
|
|
|
- }
|
|
|
- if (item.children) {
|
|
|
- ids = getIds(item.children, ids);
|
|
|
- }
|
|
|
- })
|
|
|
- return ids;
|
|
|
- }
|
|
|
- if (Array.isArray(array)) {
|
|
|
- if (array.length == 0) {
|
|
|
- return [];
|
|
|
- }
|
|
|
- } else {
|
|
|
- return [];
|
|
|
- }
|
|
|
- ids = getIds(array, ids);
|
|
|
- return ids;
|
|
|
- },
|
|
|
- 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();
|
|
|
- }
|
|
|
- },
|
|
|
- components: {
|
|
|
- flowForm,
|
|
|
- flowDetail
|
|
|
- },
|
|
|
- }
|
|
|
-</script>
|
|
|
-
|
|
|
+ import config from '@/config'
|
|
|
+ export default {
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ flowType: 1,
|
|
|
+ tableData: [],
|
|
|
+ currPage: 1,
|
|
|
+ pageSize: 10,
|
|
|
+ totalCount: 0,
|
|
|
+ treeData: [],
|
|
|
+ defaultProps: {
|
|
|
+ children: 'children',
|
|
|
+ label: 'name'
|
|
|
+ },
|
|
|
+ visible: false,
|
|
|
+ isUpdate: false,
|
|
|
+ detailId: '',
|
|
|
+ drawer: false,
|
|
|
+ nowData: {},
|
|
|
+ filterOption: {}
|
|
|
+ }
|
|
|
+ },
|
|
|
+ mounted() {
|
|
|
+ this.initDeviceList();
|
|
|
+ this.init();
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ init() {
|
|
|
+ if (!this.auth('/work/property/register/list')) return;
|
|
|
+ let filterOption = {
|
|
|
+ projectId: this.$store.getters.project.id,
|
|
|
+ flowType: this.flowType
|
|
|
+ };
|
|
|
+ filterOption = Object.assign(filterOption, this.filterOption);
|
|
|
+ getFlowList(this.currPage, this.pageSize, filterOption).then(res => {
|
|
|
+ if (res.state) {
|
|
|
+ this.tableData = res.data.dataList.map(node => {
|
|
|
+ node = Object.assign(node, JSON.parse(node.flowData));
|
|
|
+ return node;
|
|
|
+ });;
|
|
|
+ this.totalCount = res.data.totalCount;
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ initDeviceList() {
|
|
|
+ getDevicePartList(this.$store.getters.organization.id, this.$store.getters.project.id).then(res => {
|
|
|
+ if (res.state) {
|
|
|
+ if (res.data.length === 0) {
|
|
|
+ initDevicePartList(this.$store.getters.organization.id, this.$store.getters.project.id)
|
|
|
+ .then(res => {
|
|
|
+ if (res.state) this.initDeviceList();
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ this.treeData = res.data;
|
|
|
+ this.returnChildren(this.treeData);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ returnChildren(data) {
|
|
|
+ data.forEach(item => {
|
|
|
+ if (item.children && item.children.length > 0) this.returnChildren(item.children);
|
|
|
+ });
|
|
|
+ },
|
|
|
+ filterDevice(data) {
|
|
|
+ this.filterOption = {};
|
|
|
+ if (this.nowData.id === data.id) {
|
|
|
+ this.nowData = {};
|
|
|
+ } else {
|
|
|
+ this.nowData = data;
|
|
|
+ if (this.nowData.deviceId) {
|
|
|
+ this.filterOption['deviceId'] = this.nowData.deviceId;
|
|
|
+ } else {
|
|
|
+ this.filterOption['deviceLevelIds'] = this.getStorageIds([data]);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.currPage = 1;
|
|
|
+ this.init();
|
|
|
+ },
|
|
|
+ downloadFile() {
|
|
|
+ window.location.href = config.baseURL + '/api/operateDevice/exportTemplate';
|
|
|
+ },
|
|
|
+ getStorageIds(array) {
|
|
|
+ //获取档案库id
|
|
|
+ let ids = [];
|
|
|
+
|
|
|
+ function getIds(array, ids) {
|
|
|
+ array.forEach(item => {
|
|
|
+ if (item.id) {
|
|
|
+ ids.push(item.id);
|
|
|
+ }
|
|
|
+ if (item.children) {
|
|
|
+ ids = getIds(item.children, ids);
|
|
|
+ }
|
|
|
+ })
|
|
|
+ return ids;
|
|
|
+ }
|
|
|
+ if (Array.isArray(array)) {
|
|
|
+ if (array.length == 0) {
|
|
|
+ return [];
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ return [];
|
|
|
+ }
|
|
|
+ ids = getIds(array, ids);
|
|
|
+ return ids;
|
|
|
+ },
|
|
|
+ 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();
|
|
|
+ }
|
|
|
+ },
|
|
|
+ components: {
|
|
|
+ flowForm,
|
|
|
+ flowDetail
|
|
|
+ },
|
|
|
+ }
|
|
|
+</script>
|
|
|
+
|
|
|
<style lang="scss"></style>
|