|
@@ -0,0 +1,1059 @@
|
|
|
+<template>
|
|
|
+ <div
|
|
|
+ style="height:100%;"
|
|
|
+ class="flexStar"
|
|
|
+ >
|
|
|
+ <div
|
|
|
+ class="boxswai"
|
|
|
+ style="width:26%;padding-left:0px;"
|
|
|
+ >
|
|
|
+ <div class="boxnei" style="display: flex;flex-direction: column;">
|
|
|
+ <div style="overflow: auto;flex:1">
|
|
|
+ <el-tree
|
|
|
+ style="display: inline-block;min-width: 100%;"
|
|
|
+ ref="trees"
|
|
|
+ :loading="loading"
|
|
|
+ :load="treeLoad"
|
|
|
+ lazy
|
|
|
+ :data="data"
|
|
|
+ :props="defaultProps"
|
|
|
+ @node-click="nodeClick"
|
|
|
+ node-key="id"
|
|
|
+ :expand-on-click-node="false"
|
|
|
+ v-show="!allTreeShow"
|
|
|
+ >
|
|
|
+ <span
|
|
|
+ class="custom-tree-node"
|
|
|
+ slot-scope="{ data ,node }"
|
|
|
+ @mouseover.stop="mouseOver(data)"
|
|
|
+ @mouseleave.stop="mouseLeave(data)"
|
|
|
+ style="box-sizing: border-box;padding-right:70px!important;;"
|
|
|
+ >
|
|
|
+ <div style="width:100%;">
|
|
|
+ <span style="text-overflow: ellipsis;"> {{ data.name }} </span>
|
|
|
+ <!-- <span> {{ node}} </span> -->
|
|
|
+ <!-- 添加 -->
|
|
|
+
|
|
|
+ </div>
|
|
|
+ </span>
|
|
|
+ </el-tree>
|
|
|
+
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div
|
|
|
+ class="boxswai"
|
|
|
+ style="width:74%;padding-left:0px;padding-right:0px;"
|
|
|
+ >
|
|
|
+ <div class="boxnei">
|
|
|
+ <div
|
|
|
+ class="marleft10"
|
|
|
+ style="height:100%;
|
|
|
+ display: flex;flex-direction: column;"
|
|
|
+ >
|
|
|
+ <!-- 上传、删除、下载操作栏 -->
|
|
|
+ <div
|
|
|
+ class="rightHeader"
|
|
|
+ v-show="from.checkd"
|
|
|
+ >
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <el-empty
|
|
|
+ style="height:80%;"
|
|
|
+ v-show="false"
|
|
|
+ description="该目录为根目录没有EXCEL文件"
|
|
|
+ ></el-empty>
|
|
|
+ <div
|
|
|
+ class="martop20"
|
|
|
+ v-if="true"
|
|
|
+ style="flex:1;"
|
|
|
+ >
|
|
|
+ <avue-crud ref="crud"
|
|
|
+ :option="elemntOption"
|
|
|
+ :page.sync="page"
|
|
|
+ :table-loading="elementloading"
|
|
|
+ @on-load="getList"
|
|
|
+ @row-update="rowUpdate"
|
|
|
+
|
|
|
+ @refresh-change="refreshChange"
|
|
|
+ @selection-change="selectionChange"
|
|
|
+ v-model="elemtform"
|
|
|
+ :data="elemtData">
|
|
|
+
|
|
|
+ <template slot="menuRight">
|
|
|
+ <el-button
|
|
|
+ type="danger"
|
|
|
+ size="small"
|
|
|
+ icon="el-icon-delete"
|
|
|
+ plain
|
|
|
+
|
|
|
+ @click="handleDelete"
|
|
|
+ >删除元素表
|
|
|
+ </el-button>
|
|
|
+
|
|
|
+ <el-button
|
|
|
+ size="small"
|
|
|
+ type="primary"
|
|
|
+ plain
|
|
|
+
|
|
|
+ @click="editele"
|
|
|
+ >编辑表单
|
|
|
+ </el-button>
|
|
|
+ </template>
|
|
|
+ <template slot-scope="{type,size,row}" slot="menu">
|
|
|
+ <el-button :size="size" :type="type" @click="distribution(row)">分配节点</el-button>
|
|
|
+ <el-button :size="size" :type="type" @click="handleEditFormula(row)">公式配置</el-button>
|
|
|
+ <el-button :size="size" :type="type" @click="editElement(row)">编辑元素</el-button>
|
|
|
+ </template>
|
|
|
+ </avue-crud>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <!-- 编辑元素表单信息 -->
|
|
|
+ <el-dialog
|
|
|
+ title="编辑元素表单信息"
|
|
|
+ :visible.sync="editElementFormTag"
|
|
|
+ width="60%"
|
|
|
+ :modal-append-to-body="false"
|
|
|
+ >
|
|
|
+ <div>
|
|
|
+ <el-table
|
|
|
+ :data="formDatass"
|
|
|
+ border
|
|
|
+ style="width: 100%"
|
|
|
+ >
|
|
|
+ <el-table-column
|
|
|
+ prop="tableName"
|
|
|
+ label="表名"
|
|
|
+ >
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-input
|
|
|
+ v-model="scope.row.tableName"
|
|
|
+ placeholder="请输入表名称"
|
|
|
+ ></el-input>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="tableType"
|
|
|
+ label="表类型"
|
|
|
+ >
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-select
|
|
|
+ v-model="scope.row.tableType"
|
|
|
+ placeholder="请选择"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="(item,key) in tableTypelist"
|
|
|
+ :key="key"
|
|
|
+ :label="item.dictValue"
|
|
|
+ :value="item.dictKey"
|
|
|
+ >
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="tableOwner"
|
|
|
+ label="所属方"
|
|
|
+ >
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-select
|
|
|
+ v-model="scope.row.tableOwner"
|
|
|
+ placeholder="请选择"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="(item,key) in ownerTypeList"
|
|
|
+ :key="key"
|
|
|
+ :label="item.dictValue"
|
|
|
+ :value="item.dictKey"
|
|
|
+ >
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="fillRate"
|
|
|
+ label="填报率"
|
|
|
+ >
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-input
|
|
|
+ v-model="scope.row.fillRate"
|
|
|
+ placeholder="请输入填报率"
|
|
|
+ ></el-input>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ </div>
|
|
|
+ <span
|
|
|
+ slot="footer"
|
|
|
+ class="dialog-footer"
|
|
|
+ >
|
|
|
+ <el-button @click="editElementFormTag = false">取 消</el-button>
|
|
|
+ <el-button
|
|
|
+ type="primary"
|
|
|
+ @click="editeditElementFormMF()"
|
|
|
+ >确 定</el-button>
|
|
|
+ </span>
|
|
|
+ </el-dialog>
|
|
|
+ <!-- 公式配置 -->
|
|
|
+ <el-dialog
|
|
|
+ title="元素公式"
|
|
|
+ :visible.sync="editEleFormulaVisible"
|
|
|
+ width="800px"
|
|
|
+ append-to-body
|
|
|
+ :close-on-click-modal="false"
|
|
|
+ >
|
|
|
+ <div class="flex mg-b-10">
|
|
|
+ <el-input
|
|
|
+ v-model="formulaInput"
|
|
|
+ placeholder="请输入名称"
|
|
|
+ size="samll" clearable @clear="searchFormulaName"
|
|
|
+ ></el-input>
|
|
|
+ <el-button type="info" class="mg-l-10" @click="searchFormulaName">搜索</el-button>
|
|
|
+ </div>
|
|
|
+ <el-table
|
|
|
+ :data="editEleListFilter"
|
|
|
+ border
|
|
|
+ style="width: 100%"
|
|
|
+ height="400px"
|
|
|
+ >
|
|
|
+ <el-table-column
|
|
|
+ align="center"
|
|
|
+ prop="eName"
|
|
|
+ label="元素名称"
|
|
|
+ >
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ align="center"
|
|
|
+ label="操作"
|
|
|
+ width="200"
|
|
|
+ >
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-link
|
|
|
+ :type="scope.row.isSaveFormula == 1?'warning':'primary'"
|
|
|
+ @click="toFormulaEdit(scope.row)"
|
|
|
+ >公式配置</el-link>
|
|
|
+ <el-link
|
|
|
+ class="mg-l-10"
|
|
|
+ type="danger"
|
|
|
+ @click="delEleRowHandle(scope.$index,editEleListFilter)"
|
|
|
+ >删除</el-link>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ </el-dialog>
|
|
|
+ <!-- 公式 -->
|
|
|
+ <el-dialog
|
|
|
+ title="元素公式"
|
|
|
+ :visible.sync="formulaCompVisible"
|
|
|
+ fullscreen
|
|
|
+ append-to-body
|
|
|
+ class="full-dialog"
|
|
|
+ >
|
|
|
+ <FormulaEdit
|
|
|
+ :wbsid="id"
|
|
|
+ :nodeid="curTreeData.id"
|
|
|
+ :eleid="formulaCurRow.id"
|
|
|
+ :projectid="projectid"
|
|
|
+ @hideDialog="formulaCompVisible = false"
|
|
|
+ v-if="formulaCompVisible"
|
|
|
+ ></FormulaEdit>
|
|
|
+ </el-dialog>
|
|
|
+ <!-- 关联公共WBS模板 -->
|
|
|
+ <PublicWbs ref="PublicWbs" :from="from"/>
|
|
|
+ <!-- 编辑元素 -->
|
|
|
+ <el-dialog
|
|
|
+ :title="(curEleTable.tableName?curEleTable.tableName:'')+' 元素编辑'"
|
|
|
+ :visible.sync="editEleVisible"
|
|
|
+ width="80%"
|
|
|
+ append-to-body
|
|
|
+ :close-on-click-modal="false"
|
|
|
+ >
|
|
|
+ <p class="font-c-warning">编辑元素信息(请谨慎操作)</p>
|
|
|
+ <el-table
|
|
|
+ :data="editEleList"
|
|
|
+ border
|
|
|
+ style="width: 100%"
|
|
|
+ height="400px"
|
|
|
+ >
|
|
|
+ <el-table-column
|
|
|
+ align="center"
|
|
|
+ type="index"
|
|
|
+ width="50"
|
|
|
+ ></el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ align="center"
|
|
|
+ prop="eName"
|
|
|
+ label="元素名称"
|
|
|
+ >
|
|
|
+ <template slot="header">
|
|
|
+ <i class="required"></i>
|
|
|
+ <span>元素名称</span>
|
|
|
+ </template>
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-input
|
|
|
+ v-model="scope.row.eName"
|
|
|
+ size="small"
|
|
|
+ placeholder="请输入内容"
|
|
|
+ ></el-input>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ align="center"
|
|
|
+ prop="eType"
|
|
|
+ label="数据类型"
|
|
|
+ width="120"
|
|
|
+ >
|
|
|
+ <template slot="header">
|
|
|
+ <i class="required"></i>
|
|
|
+ <span>数据类型</span>
|
|
|
+ </template>
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-select
|
|
|
+ v-model="scope.row.eType"
|
|
|
+ @change="setDefaultLength(scope.row)"
|
|
|
+ size="small"
|
|
|
+ placeholder="请选择"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="item in dataTypeList"
|
|
|
+ :key="item.id"
|
|
|
+ :label="item.dictValue"
|
|
|
+ :value="item.dictKey"
|
|
|
+ ></el-option>
|
|
|
+ </el-select>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ align="center"
|
|
|
+ prop="eLength"
|
|
|
+ label="长度"
|
|
|
+ width="120"
|
|
|
+ >
|
|
|
+ <template slot="header">
|
|
|
+ <i class="required"></i>
|
|
|
+ <span>长度</span>
|
|
|
+ </template>
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-input
|
|
|
+ v-model="scope.row.eLength"
|
|
|
+ size="small"
|
|
|
+ placeholder="请输入内容"
|
|
|
+ ></el-input>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ align="center"
|
|
|
+ prop="eAllowDeviation"
|
|
|
+ label="允许偏差值"
|
|
|
+ >
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <div class="flex">
|
|
|
+ <el-select
|
|
|
+ v-model="scope.row.allow"
|
|
|
+ size="small"
|
|
|
+ placeholder="请选择"
|
|
|
+ style="width:120px"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ :key="1"
|
|
|
+ label="-"
|
|
|
+ value="-"
|
|
|
+ ></el-option>
|
|
|
+ <el-option
|
|
|
+ :key="2"
|
|
|
+ label=">"
|
|
|
+ value=">"
|
|
|
+ ></el-option>
|
|
|
+ <el-option
|
|
|
+ :key="3"
|
|
|
+ label="<"
|
|
|
+ value="<"
|
|
|
+ ></el-option>
|
|
|
+ <el-option
|
|
|
+ :key="4"
|
|
|
+ label="≥"
|
|
|
+ value="≥"
|
|
|
+ ></el-option>
|
|
|
+ <el-option
|
|
|
+ :key="5"
|
|
|
+ label="≤"
|
|
|
+ value="≤"
|
|
|
+ ></el-option>
|
|
|
+ <el-option
|
|
|
+ :key="6"
|
|
|
+ label="±"
|
|
|
+ value="±"
|
|
|
+ ></el-option>
|
|
|
+ <el-option
|
|
|
+ :key="7"
|
|
|
+ label="【】"
|
|
|
+ value="【】"
|
|
|
+ ></el-option>
|
|
|
+ </el-select>
|
|
|
+ <el-input
|
|
|
+ v-model="scope.row.deviation"
|
|
|
+ size="small"
|
|
|
+ placeholder="请输入内容"
|
|
|
+ ></el-input>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ align="center"
|
|
|
+ prop="eInspectionMethod"
|
|
|
+ label="检查方法和频率"
|
|
|
+ >
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-input
|
|
|
+ v-model="scope.row.eInspectionMethod"
|
|
|
+ size="small"
|
|
|
+ placeholder="请输入内容"
|
|
|
+ ></el-input>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ align="center"
|
|
|
+ label="操作"
|
|
|
+ width="120"
|
|
|
+ >
|
|
|
+ <template slot="header">
|
|
|
+ <el-button
|
|
|
+ @click="addEleRow(editEleList)"
|
|
|
+ type="text"
|
|
|
+ icon="el-icon-circle-plus-outline"
|
|
|
+ class="text-icon"
|
|
|
+ ></el-button>
|
|
|
+ </template>
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-button
|
|
|
+ v-if="scope.row.id"
|
|
|
+ icon="el-icon-remove-outline"
|
|
|
+ type="text"
|
|
|
+ @click="delEleRowHandle(scope.$index,editEleList)"
|
|
|
+ class="text-icon text-icon-danger"
|
|
|
+ ></el-button>
|
|
|
+ <div
|
|
|
+ class="flex"
|
|
|
+ v-else
|
|
|
+ >
|
|
|
+ <el-button
|
|
|
+ @click="saveNewEle(scope.row)"
|
|
|
+ type="mini"
|
|
|
+ >保存</el-button>
|
|
|
+ <el-button
|
|
|
+ icon="el-icon-remove-outline"
|
|
|
+ type="text"
|
|
|
+ @click="delEleRowHandle(scope.$index,editEleList)"
|
|
|
+ class="text-icon text-icon-danger"
|
|
|
+ ></el-button>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ <span
|
|
|
+ slot="footer"
|
|
|
+ class="dialog-footer"
|
|
|
+ >
|
|
|
+ <el-button @click="editEleVisible = false">取 消</el-button>
|
|
|
+ <el-button
|
|
|
+ type="primary"
|
|
|
+ @click="saveEles"
|
|
|
+ >确 定</el-button>
|
|
|
+ </span>
|
|
|
+ </el-dialog>
|
|
|
+ </div>
|
|
|
+
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+import { detailExcel, excelType, tabLazytree, wbstree, getWbsTypeList,} from '@/api/exctab/excelmodel';
|
|
|
+import {updateBatchNodeTableInfo,selectByNodeTable,selectFormElements} from "@/api/manager/wbstree";
|
|
|
+import FormulaEdit from "@/views/formula/edit.vue";
|
|
|
+import PublicWbs from './PublicWbs.vue'
|
|
|
+import { searchNodeTables, } from "@/api/exctab/excelmodel";
|
|
|
+
|
|
|
+export default {
|
|
|
+ components:{
|
|
|
+ FormulaEdit,
|
|
|
+ PublicWbs
|
|
|
+ },
|
|
|
+ data () {
|
|
|
+ return {
|
|
|
+ editElementFormTag:false,//编辑元素
|
|
|
+ formDatass: [],
|
|
|
+ selectionList:[],
|
|
|
+ page: {
|
|
|
+ pageSize: 10,
|
|
|
+ currentPage: 1,
|
|
|
+ total: 2
|
|
|
+ },
|
|
|
+ formelemtfoelemtformrm: {},
|
|
|
+ elementloading: false,
|
|
|
+ elemtData:[
|
|
|
+ {
|
|
|
+ tableName:'张三',
|
|
|
+ sex:'男',
|
|
|
+ id:1
|
|
|
+ }, {
|
|
|
+ tableName:'李四',
|
|
|
+ sex:'女',
|
|
|
+ id:2
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ elemntOption: {
|
|
|
+ height: 'auto',
|
|
|
+ calcHeight: 30,
|
|
|
+ tip: false,
|
|
|
+ searchShow: false,
|
|
|
+ searchMenuSpan: 6,
|
|
|
+ border: true,
|
|
|
+ index: true,
|
|
|
+ viewBtn: false,
|
|
|
+ selection: true,
|
|
|
+ editBtn:false,
|
|
|
+ delBtn:false,
|
|
|
+ addBtn:false,
|
|
|
+ dialogClickModal: false,
|
|
|
+ column: [
|
|
|
+ {
|
|
|
+ label: '表单名称',
|
|
|
+ prop: 'tableName',
|
|
|
+
|
|
|
+ editDisplay: false,
|
|
|
+ addDisplay: false,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "元素表类型",
|
|
|
+ prop: "formatTableType",
|
|
|
+ // search: true,
|
|
|
+ rules: [{
|
|
|
+ required: true,
|
|
|
+ message: "请输入名称",
|
|
|
+ trigger: "blur"
|
|
|
+ }]
|
|
|
+ },
|
|
|
+
|
|
|
+ {
|
|
|
+ label: "元素总量",
|
|
|
+ prop: "elementTotal",
|
|
|
+
|
|
|
+ editDisplay: false,
|
|
|
+ addDisplay: false,
|
|
|
+ rules: [{
|
|
|
+ message: "请输入表数量",
|
|
|
+ trigger: "blur",
|
|
|
+ }]
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "所书方",
|
|
|
+ prop: "formatOwner",
|
|
|
+
|
|
|
+ editDisplay: false,
|
|
|
+ addDisplay: false,
|
|
|
+ rules: [{
|
|
|
+ message: "请输入表数量",
|
|
|
+ trigger: "blur",
|
|
|
+ }]
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "填报率",
|
|
|
+ prop: "fillRate",
|
|
|
+
|
|
|
+ editDisplay: false,
|
|
|
+ addDisplay: false,
|
|
|
+ rules: [{
|
|
|
+ message: "请输入表数量",
|
|
|
+ trigger: "blur",
|
|
|
+ }]
|
|
|
+ },
|
|
|
+
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ curEleTable:{},
|
|
|
+ eleReg: /(-|>|<|≥|≤|±|【】)?([^≥≤±【】]*)/,
|
|
|
+ editEleList:[],
|
|
|
+ editEleListAll:[],
|
|
|
+ editEleFormulaVisible:false,
|
|
|
+ editEleListFilter:[],
|
|
|
+ excelId:'',
|
|
|
+ treeNode: {},
|
|
|
+ //#region 鼠标
|
|
|
+ leftTRee: '',//左侧树ID
|
|
|
+ threessW: 400,
|
|
|
+ //#endregion
|
|
|
+ heightss: '',//
|
|
|
+ loading: false,//懒加载
|
|
|
+ data: [],//清表模板
|
|
|
+ filterText:"",//搜索关键字
|
|
|
+ allTreeShow:false,//是否显示整棵树
|
|
|
+ treeloading:false,
|
|
|
+ defaultProps: {
|
|
|
+ children: "children",
|
|
|
+ isLeaf: function (data) {
|
|
|
+ return !data.hasChildren || (data.isExistForm == 1);
|
|
|
+ },
|
|
|
+ },
|
|
|
+ wbsdata: [],//wbs模板
|
|
|
+ //#region 右侧数据
|
|
|
+ from:{
|
|
|
+ checkd:false
|
|
|
+ },
|
|
|
+ rules: {
|
|
|
+ nodeName: [
|
|
|
+ { required: true, message: '请输入清表名称', trigger: 'blur' },
|
|
|
+ ],
|
|
|
+ tabType: [
|
|
|
+ { required: true, message: '请选择清表类型', trigger: 'blur' },
|
|
|
+ ],
|
|
|
+ },
|
|
|
+ wbsform: {
|
|
|
+ id: '',
|
|
|
+ wbsType: '',
|
|
|
+ wbsName: '',
|
|
|
+ },//wbs树选中的值
|
|
|
+ tableData: [],//右侧表数据
|
|
|
+ wbsmiddle: false,//选择wbs模板那块是否有
|
|
|
+ tableList: [],//进行处理的wbs关联表
|
|
|
+ exceltypeData: [],//清表类型枚举
|
|
|
+ wbsmodel: [],//wbs模板名称枚举
|
|
|
+ //#endregion
|
|
|
+
|
|
|
+ saveExcelLoad:false,
|
|
|
+ filterText1: "",
|
|
|
+ addTableData:[],
|
|
|
+ //编辑元素
|
|
|
+ editEleVisible:false,
|
|
|
+ formulaInput:"",//公式配置
|
|
|
+ formulaCompVisible: false, //公式弹框
|
|
|
+ formulaCurRow: {}, //当前元素
|
|
|
+ id:'',
|
|
|
+ curTreeData:{},
|
|
|
+ projectid:""
|
|
|
+
|
|
|
+ }
|
|
|
+ },
|
|
|
+ computed:{
|
|
|
+ ids () {
|
|
|
+ let ids = [];
|
|
|
+ this.selectionList.forEach(ele => {
|
|
|
+ ids.push(ele.id);
|
|
|
+ });
|
|
|
+ return ids.join(",");
|
|
|
+ }
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ currentChange (currentPage) {
|
|
|
+ this.page.currentPage = currentPage;
|
|
|
+ },
|
|
|
+ sizeChange (pageSize) {
|
|
|
+ this.page.pageSize = pageSize;
|
|
|
+ },
|
|
|
+ selectionChange (list) {
|
|
|
+ this.selectionList = list;
|
|
|
+ },
|
|
|
+ selectionClear () {
|
|
|
+ this.selectionList = [];
|
|
|
+ this.$refs.crud.toggleSelection();
|
|
|
+ },
|
|
|
+ getList () {
|
|
|
+ // this.elementloading = true;
|
|
|
+ const data = Object.assign({
|
|
|
+ pageNum: this.page.currentPage,
|
|
|
+ pageSize: this.page.pageSize,
|
|
|
+ }, this.params)
|
|
|
+ this.data = [];
|
|
|
+ // getList(data).then(res => {
|
|
|
+ // const data = res.data.data
|
|
|
+ // this.loading = false;
|
|
|
+ // this.page.total = data.total;
|
|
|
+ // const result = data.list;
|
|
|
+ // this.data = result;
|
|
|
+ // })
|
|
|
+ },
|
|
|
+
|
|
|
+
|
|
|
+ refreshChange () {
|
|
|
+ this.getList();
|
|
|
+ this.$message.success('刷新成功')
|
|
|
+ },
|
|
|
+ onLoad (page, params = {}) {
|
|
|
+ this.loading = true;
|
|
|
+ // getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
|
|
|
+ // const data = res.data.data;
|
|
|
+ // this.page.total = data.total;
|
|
|
+ // this.data = data.records;
|
|
|
+ // this.loading = false;
|
|
|
+ // this.selectionClear();
|
|
|
+ // });
|
|
|
+ },
|
|
|
+ handleDelete () {
|
|
|
+ if (this.selectionList.length === 0) {
|
|
|
+ this.$message.warning("请选择至少一条数据");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ this.$confirm("确定将选择数据删除?", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning"
|
|
|
+ })
|
|
|
+ .then(() => {
|
|
|
+ // return remove(this.ids);
|
|
|
+ console.log(this.ids,'this.ids删除');
|
|
|
+ })
|
|
|
+ .then(() => {
|
|
|
+ this.onLoad(this.page);
|
|
|
+ this.$message({
|
|
|
+ type: "success",
|
|
|
+ message: "操作成功!"
|
|
|
+ });
|
|
|
+ this.$refs.crud.toggleSelection();
|
|
|
+ });
|
|
|
+ },
|
|
|
+ //编辑元素表单信息
|
|
|
+
|
|
|
+ editElement (row) {
|
|
|
+ console.log(row,'row');
|
|
|
+ this.curEleTable = row;
|
|
|
+ selectFormElements(this.curEleTable.initTableId).then((res) => {
|
|
|
+ res.data.data.forEach((element) => {
|
|
|
+ this.eleReg.exec(element.eAllowDeviation);
|
|
|
+ //console.log(RegExp.$1)
|
|
|
+ //console.log(RegExp.$2)
|
|
|
+ element.allow = RegExp.$1 ? RegExp.$1 : '';
|
|
|
+ element.deviation = RegExp.$2 ? RegExp.$2 : '';
|
|
|
+ })
|
|
|
+ this.editEleList = res.data.data;
|
|
|
+ })
|
|
|
+ this.editEleVisible = true;
|
|
|
+ },
|
|
|
+ //分配节点
|
|
|
+ distribution(row){
|
|
|
+ console.log('分配节点');
|
|
|
+ this.$refs.PublicWbs.show();
|
|
|
+ this.from.id=row.id
|
|
|
+
|
|
|
+ // this.AssociatedPublicTap = true;
|
|
|
+ },
|
|
|
+ handleEditFormula (index, row) {
|
|
|
+ // this.curEleTable = row;
|
|
|
+ // selectFormElements(this.curEleTable.initTableId).then((res) => {
|
|
|
+
|
|
|
+ // this.editEleListFilter = res.data.data;
|
|
|
+ // this.editEleListAll = [].concat(this.editEleListFilter);
|
|
|
+ // })
|
|
|
+ this.editEleFormulaVisible = true;
|
|
|
+ },
|
|
|
+ //搜索 筛选
|
|
|
+ searchFormulaName(){
|
|
|
+ this.editEleListFilter = this.editEleListAll.filter((ele)=>{
|
|
|
+ return ele.eName.indexOf(this.formulaInput) > -1;
|
|
|
+ })
|
|
|
+ },
|
|
|
+ //跳转到公式配置页面
|
|
|
+ toFormulaEdit(row) {
|
|
|
+ // this.$router.push({
|
|
|
+ // path: '/formula/edit',
|
|
|
+ // query: {
|
|
|
+ // wbsid: this.id,
|
|
|
+ // eleid: row.id,
|
|
|
+ // nodeid:this.curTreeData.id,
|
|
|
+ // projectid:this.projectid
|
|
|
+ // }
|
|
|
+ // });
|
|
|
+
|
|
|
+ this.formulaCurRow = row;
|
|
|
+ this.formulaCompVisible = true;
|
|
|
+ },
|
|
|
+ editele(){
|
|
|
+ console.log('编辑元素表单信息');
|
|
|
+ // this.editElementFormTag=true
|
|
|
+ console.log('编辑元素表单信息');
|
|
|
+ if (this.selectionList.length === 0) {
|
|
|
+ this.$message.warning("请选择至少一条数据");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (this.elemtData.length) {
|
|
|
+ let da = []
|
|
|
+ this.formDatass = [...this.selectionList]
|
|
|
+ this.formDatass.forEach(val => {
|
|
|
+ da.push({
|
|
|
+ tableType: val.tableType - 0,
|
|
|
+ tableOwner: val.tableOwner - 0,
|
|
|
+ id: val.id,
|
|
|
+ tableName: val.tableName,
|
|
|
+ fillRate: val.fillRate,
|
|
|
+ })
|
|
|
+ })
|
|
|
+ this.formDatass = da
|
|
|
+ this.editElementFormTag = true
|
|
|
+ }
|
|
|
+ },
|
|
|
+ editeditElementFormMF () {//保存按钮
|
|
|
+ let da = []
|
|
|
+ let tag = true
|
|
|
+ this.formDatass.forEach(val => {
|
|
|
+ if (!val.tableName || !val.tableType || !val.tableOwner) {
|
|
|
+ tag = false
|
|
|
+ return
|
|
|
+ } else {
|
|
|
+ da.push({
|
|
|
+ id: val.id,
|
|
|
+ nodeName: val.tableName,
|
|
|
+ tableType: val.tableType,
|
|
|
+ tableOwner: val.tableOwner,
|
|
|
+ fillRate: val.fillRate,
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+ })
|
|
|
+ if (tag) {
|
|
|
+ this.updateBatchNodeTableInfo(da)
|
|
|
+ } else {
|
|
|
+ this.$message({
|
|
|
+ type: 'success',
|
|
|
+ message: '请填写完整元素表单的所有信息!',
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
+ async updateBatchNodeTableInfo (da) {//共有编辑元素
|
|
|
+ const { data: res } = await updateBatchNodeTableInfo(da)
|
|
|
+ //console.log(res);
|
|
|
+ if (res.code == 200) {
|
|
|
+ this.editElementFormTag = false
|
|
|
+ this.updateNodeTable()
|
|
|
+ }
|
|
|
+ },
|
|
|
+ updateNodeTable () {
|
|
|
+ selectByNodeTable(this.curTreeData.id).then((res) => {
|
|
|
+ if (res.data.data.length) {
|
|
|
+ this.elemtData = res.data.data;
|
|
|
+ } else {
|
|
|
+ this.elemtData = [];
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
+
|
|
|
+ //#region 接口
|
|
|
+ async tabLazytree (parentId, modeId) {//清表树
|
|
|
+ const { data: res } = await tabLazytree({ parentId, modeId })
|
|
|
+ console.log(res);
|
|
|
+ if (res.code === 200) {
|
|
|
+ return res.data
|
|
|
+ }
|
|
|
+ },
|
|
|
+ async detailExcel (id) {//获取列表信息
|
|
|
+
|
|
|
+ const { data: res } = await detailExcel({ id })
|
|
|
+ console.log(res);
|
|
|
+ if (res.code === 200) {
|
|
|
+ this.from.id = res.data.id
|
|
|
+ this.from.extension = res.data.extension //文件名称
|
|
|
+ this.from.fileUrl = res.data.fileUrl //文件路径
|
|
|
+ let routeUrl = res.data.fileUrl
|
|
|
+ let pSrc = routeUrl + '?r=' + new Date()
|
|
|
+ this.excelSrc = 'http://view.officeapps.live.com/op/view.aspx?src=' + encodeURIComponent(pSrc);
|
|
|
+ // //导入模板名称
|
|
|
+ // this.from.import={}
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
+ async excelType () {//清表类型
|
|
|
+ const { data: res } = await excelType({ code: 'sys_excltab_type' })
|
|
|
+ console.log(res);
|
|
|
+ if (res.code === 200) {
|
|
|
+ res.data.forEach(element => {
|
|
|
+ element.dictKey = Number(element.dictKey)
|
|
|
+ });
|
|
|
+ this.exceltypeData = res.data
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // async wbstree () {//wbs树懒加载
|
|
|
+ // this.loading = true;
|
|
|
+ // const { data: res } = await wbstree({ parentId: 0, wbsId: this.excelForm.wbsId, wbsType: this.excelForm.wbsType })
|
|
|
+ // console.log(res);
|
|
|
+ // this.loading = false
|
|
|
+ // if (res.code === 200) {
|
|
|
+ // res.data.forEach((val) => {
|
|
|
+ // if (!val.hasChildren) {
|
|
|
+ // val.leaf = true
|
|
|
+ // }
|
|
|
+ // })
|
|
|
+ // this.wbsdata = res.data
|
|
|
+ // }
|
|
|
+ // },
|
|
|
+
|
|
|
+
|
|
|
+ //#region 外层左侧事件
|
|
|
+ mouseLeave (data) {
|
|
|
+ if (data.moreShow) {
|
|
|
+ this.$set(data, 'moreShow', false)
|
|
|
+ }
|
|
|
+ },
|
|
|
+ mouseOver (data) {
|
|
|
+ if (!data.moreShow) {
|
|
|
+ this.$set(data, 'moreShow', true)
|
|
|
+ }
|
|
|
+ },
|
|
|
+ async treeLoad (node, resolve) {
|
|
|
+ let id = node.data.id
|
|
|
+ if (node.level == 0) {
|
|
|
+ id = 0
|
|
|
+ }
|
|
|
+ let das = await this.tabLazytree(id, this.$route.params.id)
|
|
|
+ return resolve(das)
|
|
|
+ },
|
|
|
+ nodeClick (data) {//外层树结构
|
|
|
+ console.log(data,'treedata');
|
|
|
+ this.from.import=""
|
|
|
+ if (data.hasChildren == false) {
|
|
|
+ this.from.checkd = true
|
|
|
+ } else if (data.fileType == 3) {
|
|
|
+ this.from.checkd = true
|
|
|
+ } else {
|
|
|
+ this.from.checkd = false
|
|
|
+ }
|
|
|
+ if (this.from.checkd) {
|
|
|
+ this.detailExcel(data.id)
|
|
|
+ } else {
|
|
|
+ this.from = {
|
|
|
+ checkd: false,//判断是否可以进行上传、重新上传excel
|
|
|
+ id: '',//清表树ID
|
|
|
+ extension: '', //文件名称
|
|
|
+ fileUrl: '',//文件路径
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ //查看节点下已关联的元素表信息
|
|
|
+ searchNodeTables(id) {
|
|
|
+ searchNodeTables(id, this.from.id).then((res) => {
|
|
|
+ if (res.data.data.length > 0) {
|
|
|
+ res.data.data.forEach((val) => {
|
|
|
+ if (val.isLinkTable == 2) {
|
|
|
+ val.checknd = true;
|
|
|
+ } else {
|
|
|
+ val.checknd = false;
|
|
|
+ }
|
|
|
+ val.loading = false;
|
|
|
+ });
|
|
|
+ this.addTableData = res.data.data;
|
|
|
+ } else {
|
|
|
+ this.addTableData = [];
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+
|
|
|
+ },
|
|
|
+ created () {
|
|
|
+ this.excelType()//清表类型
|
|
|
+ },
|
|
|
+ mounted () {
|
|
|
+ // this.heightss = this.$refs.rulesss.clientHeight
|
|
|
+ }
|
|
|
+}
|
|
|
+</script>
|
|
|
+
|
|
|
+<style scoped lang="scss">
|
|
|
+.marleft10 {
|
|
|
+ margin-left: 10px;
|
|
|
+}
|
|
|
+/deep/.el-tree-node__expand-icon {
|
|
|
+ font-size: 16px;
|
|
|
+}
|
|
|
+.colorblue {
|
|
|
+ color: rgb(0, 82, 217);
|
|
|
+}
|
|
|
+
|
|
|
+.treecontent /deep/.el-scrollbar {
|
|
|
+ height: 100%;
|
|
|
+}
|
|
|
+
|
|
|
+.el-scrollbar {
|
|
|
+ height: 100%;
|
|
|
+}
|
|
|
+
|
|
|
+.rightHeader {
|
|
|
+ display: flex;
|
|
|
+ justify-content: flex-start;
|
|
|
+ align-items: top;
|
|
|
+ font-size: 14px;
|
|
|
+ background-color: #fff;
|
|
|
+
|
|
|
+ .excelname {
|
|
|
+ box-sizing: border-box;
|
|
|
+ min-width: 200px;
|
|
|
+ height: 28px;
|
|
|
+ border: 1px solid rgb(220, 220, 220);
|
|
|
+ padding: 0 10px;
|
|
|
+ border-radius: 3px;
|
|
|
+ display: flex;
|
|
|
+ justify-content: space-between;
|
|
|
+ align-items: center;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+.dialogModel {
|
|
|
+ .dialogBox {
|
|
|
+ .middle {
|
|
|
+ display: flex;
|
|
|
+
|
|
|
+ .left {
|
|
|
+ border: 1px solid rgb(220, 220, 220);
|
|
|
+ border-radius: 3px;
|
|
|
+ height: 500px;
|
|
|
+ width: 49%;
|
|
|
+
|
|
|
+ .select {
|
|
|
+ box-sizing: border-box;
|
|
|
+ display: flex;
|
|
|
+ justify-content: center;
|
|
|
+ padding: 5px 0;
|
|
|
+ border-bottom: 1px solid #e0e0e0;
|
|
|
+ }
|
|
|
+ .leftscroll {
|
|
|
+ height: 450px;
|
|
|
+ overflow-y: scroll;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .right {
|
|
|
+ height: auto;
|
|
|
+ height: 60px;
|
|
|
+ max-height: 500px;
|
|
|
+ margin-left: 2%;
|
|
|
+ // height: 500px;
|
|
|
+ border-radius: 3px;
|
|
|
+ td {
|
|
|
+ box-sizing: border-box;
|
|
|
+ padding: 5px 10px;
|
|
|
+ height: 30px;
|
|
|
+ line-height: 30px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .btbox {
|
|
|
+ margin-top: 20px;
|
|
|
+ display: flex;
|
|
|
+ justify-content: center;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+.rightBox {
|
|
|
+ flex: 1;
|
|
|
+}
|
|
|
+
|
|
|
+.boxswai{
|
|
|
+ height: 100%;
|
|
|
+ box-sizing: border-box;
|
|
|
+ padding-bottom: 10px;
|
|
|
+}
|
|
|
+</style>
|