|
@@ -7,14 +7,13 @@
|
|
|
<div class="tree-container">
|
|
|
<el-scrollbar>
|
|
|
<el-tree
|
|
|
-
|
|
|
lazy
|
|
|
:load="loadNode"
|
|
|
@node-click="handleNodeClick"
|
|
|
:props="defaultProps"
|
|
|
:expand-on-click-node="false"
|
|
|
- :default-expanded-keys="defaultExpandedKeys"
|
|
|
- :current-node-key="curreenttid"
|
|
|
+ :default-expanded-keys="defaultExpandedKeys"
|
|
|
+ :current-node-key="curreenttid"
|
|
|
highlight-current
|
|
|
node-key="id"
|
|
|
ref="tree"
|
|
@@ -59,8 +58,8 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
<div v-if="ruleItemOptions.length>0">
|
|
|
- <div class="rule-box" >
|
|
|
- <div class="rule-box-item" v-for="(item,index) in ruleItemOptions" :key="index" @click="ruleDetailClick" >
|
|
|
+ <div class="rule-box" v-loading="ruleLoading">
|
|
|
+ <div class="rule-box-item" v-for="(item,index) in ruleItemOptions" :key="index" @click="ruleDetailClick(item)" >
|
|
|
<div class="rule-box-item-icon">
|
|
|
<i class="el-icon-folder" style=" cursor: pointer; font-size: 48px;color:orange"></i>
|
|
|
</div>
|
|
@@ -91,8 +90,10 @@
|
|
|
|
|
|
<el-card class="box-card h-100">
|
|
|
<div slot="header" class="clearfix">
|
|
|
- <i class="el-icon-arrow-left" style="margin-right: 5px; cursor: pointer;" @click="goBack"></i>
|
|
|
- <span @click="goBack">返回上一级</span>
|
|
|
+ <el-link type="primary" @click="goBack">
|
|
|
+ <i class="el-icon-arrow-left" style="margin-right: 5px;"></i>
|
|
|
+ <span >返回上一级</span>
|
|
|
+ </el-link>
|
|
|
<div style="float: right;">
|
|
|
<el-button
|
|
|
|
|
@@ -116,8 +117,8 @@
|
|
|
|
|
|
</div>
|
|
|
</div>
|
|
|
- <div class="rule-box" v-loading="ruleLoading">
|
|
|
- <div class="rule-box-item" v-for="item in ruleItemOptions" :key="item.id" @click="ruleDetailClick1">
|
|
|
+ <div class="rule-box" v-loading="ruleItemOptionsDetailLoading" v-if="ruleItemOptionsDetail.length>0">
|
|
|
+ <div class="rule-box-item" v-for="item in ruleItemOptionsDetail" :key="item.id" @click="ruleDetailClick1(item)">
|
|
|
<div class="rule-box-item-icon">
|
|
|
<i class="el-icon-tickets" style=" cursor: pointer; font-size: 48px;color:#2550A2"></i>
|
|
|
</div>
|
|
@@ -125,12 +126,13 @@
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
+ <el-empty description="暂无数据" v-else class="empty-container"></el-empty>
|
|
|
<el-pagination
|
|
|
style="margin-top: 30px;text-align: center;"
|
|
|
- @size-change="handleSizeChange"
|
|
|
- @current-change="handleCurrentChange"
|
|
|
- :current-page="currentPage"
|
|
|
- :page-size="pageSize"
|
|
|
+ @size-change="handleSizeChange1"
|
|
|
+ @current-change="handleCurrentChange1"
|
|
|
+ :current-page="currentPage1"
|
|
|
+ :page-size="pageSize1"
|
|
|
:total="total"
|
|
|
layout="prev, pager, next"
|
|
|
class="pagination"
|
|
@@ -144,22 +146,25 @@
|
|
|
|
|
|
<el-card class="box-card h-100" v-if="isShowYpList">
|
|
|
<div slot="header" class="clearfix">
|
|
|
- <i class="el-icon-arrow-left" style="margin-right: 5px; cursor: pointer;" @click="goBack1"></i>
|
|
|
- <span>返回上一级</span>
|
|
|
+
|
|
|
+ <el-link type="primary" @click="goBack1">
|
|
|
+ <i class="el-icon-arrow-left" style="margin-right: 5px;"></i>
|
|
|
+ <span >返回上一级</span>
|
|
|
+ </el-link>
|
|
|
</div>
|
|
|
<div class="box-card-title">
|
|
|
- GB 175-2023
|
|
|
+ {{ ruleDataDetail.name }}
|
|
|
</div>
|
|
|
<div class="box-card-content1">
|
|
|
<div class="box-card-content1-left">
|
|
|
<div class="box-card-content1-left-item">
|
|
|
- 下达日期:2023-12-12
|
|
|
+ 下达日期:{{ ruleDataDetail.issueDate }}
|
|
|
</div>
|
|
|
<div class="box-card-content1-left-item">
|
|
|
- 实施日期:2023-12-12
|
|
|
+ 实施日期:{{ ruleDataDetail.actualizeDate }}
|
|
|
</div>
|
|
|
<div>
|
|
|
- <i class="el-icon-document"></i>文件名称.pdf
|
|
|
+ <i class="el-icon-document"></i>{{ ruleDataDetail.standardFileUrl }}
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="box-card-content1-right">
|
|
@@ -345,31 +350,40 @@
|
|
|
|
|
|
<!-- 新增规范文件 -->
|
|
|
<el-dialog title="新增" :visible.sync="addFileDialogVisible" append-to-body width="30%">
|
|
|
- <el-form :model="fileForm" label-position="left" label-width="80px">
|
|
|
- <el-form-item label="规范名称" >
|
|
|
+ <el-form :model="fileForm" label-position="left" label-width="80px" :rules="fileRuleForm" ref="fileFormRef">
|
|
|
+ <el-form-item label="规范名称" prop="name" >
|
|
|
<el-input v-model="fileForm.name" ></el-input>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="下达日期" >
|
|
|
<el-date-picker
|
|
|
style="width: 100%;"
|
|
|
- v-model="fileForm.date1"
|
|
|
+ format="yyyy 年 MM 月 dd 日"
|
|
|
+ value-format="yyyy 年 MM 月 dd 日"
|
|
|
+ v-model="fileForm.issueDate"
|
|
|
type="date"
|
|
|
placeholder="选择日期">
|
|
|
</el-date-picker>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="实施日期" >
|
|
|
<el-date-picker
|
|
|
+ format="yyyy 年 MM 月 dd 日"
|
|
|
+ value-format="yyyy 年 MM 月 dd 日"
|
|
|
style="width: 100%;"
|
|
|
- v-model="fileForm.date2"
|
|
|
+ v-model="fileForm.actualizeDate"
|
|
|
type="date"
|
|
|
placeholder="选择日期">
|
|
|
</el-date-picker>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="规范文件" >
|
|
|
<el-upload
|
|
|
+ :auto-upload="false"
|
|
|
+ multiple
|
|
|
class="upload-demo"
|
|
|
- action="https://jsonplaceholder.typicode.com/posts/"
|
|
|
- :file-list="fileList">
|
|
|
+ action="#"
|
|
|
+ :file-list="fileForm.standardFileUrl"
|
|
|
+ :on-change="uploadImportData"
|
|
|
+
|
|
|
+ >
|
|
|
<el-button size="small" type="primary">点击上传</el-button>
|
|
|
<div slot="tip" class="el-upload__tip">允许文件格式.pdf</div>
|
|
|
</el-upload>
|
|
@@ -377,8 +391,8 @@
|
|
|
|
|
|
</el-form>
|
|
|
<div slot="footer" class="dialog-footer">
|
|
|
- <el-button @click="dialogFormVisible = false">取 消</el-button>
|
|
|
- <el-button type="primary" @click="dialogFormVisible = false">确 定</el-button>
|
|
|
+ <el-button @click="addFileDialogVisible = false">取 消</el-button>
|
|
|
+ <el-button type="primary" @click="addFileRoleForm" :loading="addFileRuleLoad">确 定</el-button>
|
|
|
</div>
|
|
|
</el-dialog>
|
|
|
|
|
@@ -395,7 +409,7 @@ import {getLazytree} from "@/api/manager/wbsprivate";
|
|
|
import ConditionsSet from './ConditionsSet.vue'
|
|
|
import LinkEle from "./LinkEle.vue";
|
|
|
import PreviewResult from './PreviewResult.vue'
|
|
|
-import {getPage,getById,add,deleteItem} from "@/api/ruleManage/fileRule.js";
|
|
|
+import {getPage,edit,add,deleteItem,getById } from "@/api/ruleManage/fileRule.js";
|
|
|
import { getStore, setStore } from "@/util/store";
|
|
|
export default {
|
|
|
components: {
|
|
@@ -432,10 +446,16 @@ import { getStore, setStore } from "@/util/store";
|
|
|
addSaveFileLoad:false,
|
|
|
titleInput:'',
|
|
|
isShowList:true,
|
|
|
+ ruleItemOptionsDetail:[],
|
|
|
+ ruleItemOptionsDetailLoading: false,
|
|
|
currentPage: 1,
|
|
|
pageSize: 40, // 8列 * 5行 = 40
|
|
|
+ currentPage1: 1,
|
|
|
+ ruleItem: {},
|
|
|
+ pageSize1: 40, // 8列 * 5行 = 40
|
|
|
isShowYpList:true,
|
|
|
isShowDetail:false,
|
|
|
+ ruleDataDetail: {},
|
|
|
ypDetail: {
|
|
|
name: '',
|
|
|
basic: [{ name: '' }, { name: '' }, { name: '' }, { name: '' }]
|
|
@@ -450,8 +470,13 @@ import { getStore, setStore } from "@/util/store";
|
|
|
manageData: [],
|
|
|
manageLoad: false,
|
|
|
addFileDialogVisible:false,
|
|
|
+ addFileRuleLoad:false,
|
|
|
fileForm:{},
|
|
|
- fileList:[],
|
|
|
+ fileRuleForm:{
|
|
|
+ name: [
|
|
|
+ { required: true, message: '请输入规范名称', trigger: 'blur' }
|
|
|
+ ],
|
|
|
+ },
|
|
|
ypList:[
|
|
|
{id:1,name:'样品名称',
|
|
|
basic:
|
|
@@ -487,13 +512,7 @@ import { getStore, setStore } from "@/util/store";
|
|
|
|
|
|
};
|
|
|
},
|
|
|
- computed: {
|
|
|
- currentPageData() {
|
|
|
- const start = (this.currentPage - 1) * this.pageSize
|
|
|
- const end = start + this.pageSize
|
|
|
- return this.ruleItemOptions.slice(start, end)
|
|
|
- }
|
|
|
- },
|
|
|
+
|
|
|
created(){
|
|
|
console.log(this.$route.query,'this.$route.query;');
|
|
|
const { id, tenant_id,projectid} = this.$route.query;
|
|
@@ -545,9 +564,10 @@ import { getStore, setStore } from "@/util/store";
|
|
|
content: data.id,
|
|
|
type: true, //sessionStorage
|
|
|
});
|
|
|
+ this.isShowList = true;
|
|
|
+ this.isShowDetail=false
|
|
|
},
|
|
|
getExpandedKeys(node) {
|
|
|
- //console.log(node)
|
|
|
let expandedKeys = [];
|
|
|
while (node.parent) {
|
|
|
expandedKeys.push(node.data.id);
|
|
@@ -556,9 +576,9 @@ import { getStore, setStore } from "@/util/store";
|
|
|
setStore({
|
|
|
name: this.expandName,
|
|
|
content: expandedKeys,
|
|
|
- type: true, //sessionStorage
|
|
|
+ type: true,
|
|
|
});
|
|
|
- //console.log(expandedKeys)
|
|
|
+
|
|
|
},
|
|
|
loadNode(node, resolve) {
|
|
|
let pid = 0;
|
|
@@ -619,25 +639,117 @@ import { getStore, setStore } from "@/util/store";
|
|
|
});
|
|
|
|
|
|
},
|
|
|
- ruleDetailClick(){
|
|
|
+ ruleDetailClick(item){
|
|
|
this.isShowList = false;
|
|
|
+ this.getRuleDetail(item);
|
|
|
+ this.ruleItem=item
|
|
|
},
|
|
|
- ruleDetailClick1(){
|
|
|
-
|
|
|
+ //点击规范文件夹详情
|
|
|
+ getRuleDetail(item) {
|
|
|
+ this.ruleItemOptionsDetailLoading = true;
|
|
|
+ getPage({
|
|
|
+ current: this.currentPage1,
|
|
|
+ size: this.pageSize1,
|
|
|
+ type: 2,
|
|
|
+ parentId: item.id,
|
|
|
+ privateId: this.treeId,
|
|
|
+ }).then((res) => {
|
|
|
+ console.log(res,'res');
|
|
|
+
|
|
|
+ this.ruleItemOptionsDetailLoading = false;
|
|
|
+ if (res.data.code === 200) {
|
|
|
+ this.ruleItemOptionsDetail = res.data.data.records;
|
|
|
+
|
|
|
+ } else {
|
|
|
+ this.$message.error(res.msg);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+
|
|
|
+
|
|
|
+ ruleDetailClick1(item){
|
|
|
+ this.getRuleDataDetail(item);
|
|
|
this.isShowDetail = true;
|
|
|
},
|
|
|
+ //获取规范数据详情
|
|
|
+ getRuleDataDetail(item){
|
|
|
+ getById({
|
|
|
+ id: item.id,
|
|
|
+
|
|
|
+ }).then((res) => {
|
|
|
+ if (res.data.code === 200) {
|
|
|
+ this.ruleDataDetail = res.data.data;
|
|
|
+ } else {
|
|
|
+ this.$message.error(res.data.msg);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
addFile(){
|
|
|
console.log(this.treeId,'this.treeId');
|
|
|
|
|
|
//新增规范文件
|
|
|
this.addFileDialogVisible = true;
|
|
|
},
|
|
|
- handleCurrentChange(val) {
|
|
|
+
|
|
|
+ uploadImportData(file){
|
|
|
+ let formData = new FormData()
|
|
|
+ formData.append('file', file.raw);
|
|
|
+ let pictureList =[]
|
|
|
+ pictureList.push(file.name)
|
|
|
+ this.fileForm.standardFileUrl=pictureList.map(item=>{
|
|
|
+ return {
|
|
|
+ name: item,
|
|
|
+ url: item,
|
|
|
+ raw:file.raw
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ async addFileRoleForm(){
|
|
|
+ const isValid = await this.$refs.fileFormRef.validate()
|
|
|
+ if (!isValid) {
|
|
|
+ this.$message.error('请填写完整的规范信息');
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ console.log(this.fileForm,'fileForm');
|
|
|
+ add({
|
|
|
+ ...this.fileForm,
|
|
|
+ type: 2,
|
|
|
+ privateId: this.treeId,
|
|
|
+ parentId: this.ruleItem.id,
|
|
|
+ }).then((res) => {
|
|
|
+ if(res.data.code==200){
|
|
|
+ this.$message.success(res.data.msg)
|
|
|
+
|
|
|
+ this.addFileDialogVisible=false
|
|
|
+ this.getRuleDetail(this.ruleItem);
|
|
|
+ }else{
|
|
|
+ this.$message.error(res.data.msg)
|
|
|
+ }
|
|
|
+ }).finally(() => {
|
|
|
+ this.saveBatchLoading = false;
|
|
|
+ });
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ },
|
|
|
+ handleCurrentChange(val) {
|
|
|
this.currentPage = val
|
|
|
+ this.getRuleItemOptions(); // 刷新数据
|
|
|
},
|
|
|
handleSizeChange(val) {
|
|
|
this.pageSize = val
|
|
|
this.currentPage = 1
|
|
|
+ this.getRuleItemOptions(); // 刷新数据
|
|
|
+ },
|
|
|
+ handleCurrentChange1(val) {
|
|
|
+ this.currentPage = val
|
|
|
+ this.getRuleDetail(item);
|
|
|
+ },
|
|
|
+ handleSizeChange1(val) {
|
|
|
+ this.pageSize1 = val
|
|
|
+ this.currentPage1= 1
|
|
|
+ this.getRuleDetail(this.ruleItem); // 刷新数据
|
|
|
},
|
|
|
addYp(){
|
|
|
this.isShowYpList = false;
|
|
@@ -660,7 +772,12 @@ import { getStore, setStore } from "@/util/store";
|
|
|
// 管理文件夹
|
|
|
manageFolder(){
|
|
|
this.manageVisible = true;
|
|
|
- this.manageData=JSON.parse(JSON.stringify(this.ruleItemOptions));
|
|
|
+ if(!this.isShowList){
|
|
|
+ this.manageData=JSON.parse(JSON.stringify(this.ruleItemOptionsDetail));
|
|
|
+ }else{
|
|
|
+ this.manageData=JSON.parse(JSON.stringify(this.ruleItemOptions));
|
|
|
+ }
|
|
|
+
|
|
|
},
|
|
|
delManange(index,row){
|
|
|
this.$confirm('删除后,数据将无法恢复,是否确认删除!', '提示', {
|
|
@@ -683,7 +800,28 @@ import { getStore, setStore } from "@/util/store";
|
|
|
})
|
|
|
},
|
|
|
manageSave(){
|
|
|
-
|
|
|
+ this.manageLoad = true;
|
|
|
+
|
|
|
+ const data = this.manageData.map(item => ({ id: item.id, name: item.name,type:this.isShowList?1:2 }));
|
|
|
+ edit({ data }).then((res) => {
|
|
|
+ if (res.data.code === 200) {
|
|
|
+ this.$message.success(res.data.msg);
|
|
|
+ this.manageVisible = false;
|
|
|
+
|
|
|
+ // this.getRuleItemOptions();
|
|
|
+ if(!this.isShowList){
|
|
|
+ this.getRuleDetail(this.ruleItem);
|
|
|
+ this.manageData = JSON.parse(JSON.stringify(this.ruleItemOptionsDetail));
|
|
|
+ }else{
|
|
|
+ this.getRuleItemOptions();
|
|
|
+ this.manageData = JSON.parse(JSON.stringify(this.ruleItemOptions));
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ this.$message.error(res.data.msg);
|
|
|
+ }
|
|
|
+ }).finally(() => {
|
|
|
+ this.manageLoad = false;
|
|
|
+ });
|
|
|
},
|
|
|
handleEdit(item, index) {
|
|
|
// 处理编辑逻辑
|