<template>
|
<div>
|
<el-row @contextmenu.prevent.native="">
|
<el-table
|
id="otherTableData"
|
size='mini'
|
:data="otherTableData"
|
class="show_table"
|
highlight-current-row
|
@row-contextmenu="otherRightClick"
|
@current-change="handleCurrentChange"
|
border
|
height="220"
|
style="width: 100%">
|
<el-table-column
|
type="index" align="center" label="序号"
|
width="50">
|
</el-table-column>
|
<el-table-column
|
prop="docName"
|
label="文件名称" class-name="left"
|
sortable
|
>
|
</el-table-column>
|
<el-table-column
|
prop="docCode"
|
label="设备编号" class-name="left"
|
sortable
|
>
|
</el-table-column>
|
<el-table-column
|
prop="pullStatus"
|
label="出库状态" align="center"
|
sortable
|
>
|
<template slot-scope="scope">
|
{{pullStatusMap[scope.row.pullStatus]}}
|
</template>
|
</el-table-column>
|
<el-table-column
|
prop="docStatus" align="center"
|
label="状态"
|
sortable
|
>
|
<template slot-scope="scope">
|
{{productStatusMap[scope.row.docStatus]}}
|
</template>
|
</el-table-column>
|
<el-table-column
|
prop="publishVersion" align="center"
|
label="系统指定版本"
|
sortable
|
>
|
</el-table-column>
|
<el-table-column
|
prop="createTime"
|
label="上传时间"
|
sortable
|
align="center"
|
>
|
</el-table-column>
|
</el-table>
|
<el-pagination
|
@size-change="handleSizeChange"
|
@current-change="handlePageChange"
|
:current-page="pageData.page"
|
:page-sizes="pageData.pageSizeArr"
|
:page-size="pageData.size"
|
layout="total, sizes, prev, pager, next, jumper"
|
:total="pageData.total">
|
</el-pagination>
|
<div class="otherRightMenu">
|
<OContextMenu
|
@showDocEditDialog="showDocEditDialog"
|
@docDelete="docDelete"
|
@docDownload="docDownload"
|
@showBatchDeleteDialog="showBatchDeleteDialog"
|
@docPublish="docPublish"
|
@docRepublish="docRepublish"
|
@docPull="docPull"
|
@docCancelPull="docCancelPull"
|
@docPush="docPush"
|
@docPigeonhole="docPigeonhole"
|
@showUploadDialog="showUploadDialog"
|
ref="OContextMenu"
|
></OContextMenu>
|
</div>
|
</el-row>
|
<!--文档入库窗口-->
|
<el-dialog :visible.sync="otherDocPushVisible" :close-on-click-modal="false" title="文件上传" :before-close="closeDialog" width="480px">
|
<el-upload
|
class="upload-demo"
|
ref="upload"
|
action="string"
|
show-file-list
|
:on-change="handleUploadChange"
|
:before-remove="beforeRemove"
|
:on-exceed="handleExceed"
|
:http-request="handleRequest"
|
:limit="1"
|
:file-list="otherDocList"
|
:auto-upload="false">
|
<el-button slot="trigger" size="small" type="primary">选取文件</el-button>
|
<el-button style="margin-left: 10px;" size="small" type="success" @click="submitOtherUpload">上传到服务器</el-button>
|
</el-upload>
|
</el-dialog>
|
<!--批量删除文档-->
|
<el-dialog :visible.sync="docBatchDeleteVisible" :close-on-click-modal="false" title="批量删除" @close="closeDocDeleteDialog" width="1000px">
|
<el-form :model="delOtherParams" :inline="true" class="demo-form-inline">
|
<el-form-item label="文件名称">
|
<el-input type="text" v-model="delOtherParams.docName" show-word-limit placeholder="请输入文件名称" clearable></el-input>
|
</el-form-item>
|
<el-form-item label="上传时间">
|
<el-date-picker v-model="delOtherParams.startTime" placeholder="请选择开始时间" value-format="yyyy-MM-dd HH:mm:ss" type="datetime">
|
</el-date-picker>
|
<el-date-picker v-model="delOtherParams.endTime" placeholder="请选择结束时间" value-format="yyyy-MM-dd HH:mm:ss" type="datetime">
|
</el-date-picker>
|
</el-form-item>
|
<el-form-item>
|
<el-button type="primary" @click="LogSearch" size="small" icon="el-icon-search">查询</el-button>
|
</el-form-item>
|
</el-form>
|
<template>
|
<el-table
|
:data="delOtherDocList"
|
class="show_table"
|
ref="table"
|
highlight-current-row
|
border
|
height="410"
|
size='mini'
|
@selection-change="docSelectionChange"
|
>
|
<el-table-column
|
type="selection"
|
width="55">
|
</el-table-column>
|
<el-table-column
|
type="index"
|
label="序号"
|
align="center"
|
>
|
</el-table-column>
|
<el-table-column
|
prop="docName"
|
label="文件名称"
|
sortable
|
align="center"
|
class-name="left"
|
>
|
</el-table-column>
|
<el-table-column
|
prop="docCode"
|
label="设备编号"
|
sortable
|
class-name="left"
|
>
|
</el-table-column>
|
<el-table-column
|
prop="pullStatus"
|
label="出库状态"
|
sortable
|
align="center"
|
>
|
<template slot-scope="scope">
|
{{pullStatusMap[scope.row.pullStatus]}}
|
</template>
|
</el-table-column>
|
<el-table-column
|
prop="docStatus"
|
label="状 态"
|
align="center"
|
sortable
|
>
|
<template slot-scope="scope">
|
{{productStatusMap[scope.row.docStatus]}}
|
</template>
|
</el-table-column>
|
<el-table-column
|
prop="publishVersion"
|
label="系统指定版本"
|
sortable
|
align="center"
|
>
|
</el-table-column>
|
<el-table-column
|
prop="createTime"
|
label="上传时间"
|
sortable
|
align="center"
|
>
|
</el-table-column>
|
</el-table>
|
<el-pagination
|
@size-change="handleDelSizeChange"
|
@current-change="handlerDelPageChange"
|
:current-page="pageOtherData.page"
|
:page-sizes="pageOtherData.pageSizeArr"
|
:page-size="pageOtherData.size"
|
layout="total, sizes, prev, pager, next, jumper"
|
:total="pageOtherData.total">
|
</el-pagination>
|
<div slot="footer" class="dialog-footer">
|
<el-button @click.native="docBatchDelete" :loading="buttonLoading" type="primary" class="btn-custom">
|
<span>删 除</span>
|
</el-button>
|
<el-button @click="closeDocDeleteDialog" class="btn-custom">
|
<span>取 消</span>
|
</el-button>
|
</div>
|
</template>
|
</el-dialog>
|
</div>
|
</template>
|
|
<script>
|
import OContextMenu from '@/module/productManager/components/otherDocContextMenu.vue'
|
import Bus from './bus.js'
|
import * as productApi from '../api/product'
|
export default {
|
name: "other_file_table_info",
|
props:['nodeList'],
|
components:{
|
OContextMenu,
|
Bus
|
},
|
computed:{
|
pullStatusMap: function() {
|
let localeMap = JSON.parse(localStorage.getItem('pullStatusMap'));
|
if(!localeMap) {
|
return {};
|
}else {
|
return localeMap;
|
}
|
},
|
productStatusMap:function() {
|
let localeMap = JSON.parse(localStorage.getItem('productStatusMap'));
|
if(!localeMap) {
|
return {};
|
}else {
|
return localeMap;
|
}
|
},
|
},
|
data(){
|
return {
|
otherDocPushVisible:false,
|
docBatchDeleteVisible:false,
|
buttonLoading:false,
|
otherDocList:[],
|
otherTableData: [],
|
delOtherDocList:[],
|
pageData : {
|
page:1,
|
size : 10,
|
total:0,
|
pageSizeArr:[10, 20, 40]
|
},
|
pageOtherData : {
|
page:1,
|
size : 10,
|
total:0,
|
pageSizeArr:[10, 20, 40]
|
},
|
otherParams:{
|
attributionType :'',//绑定类型
|
attributionId :'', //绑定类型对应的id
|
docClassCode:'OTHER', //文档类型为其他文档
|
docName:'',
|
startTime:"",
|
endTime:""
|
},
|
delOtherParams:{
|
attributionType :'',//绑定类型
|
attributionId :'', //绑定类型对应的id
|
docClassCode:'OTHER', //文档类型为其他文档
|
docName:'',
|
startTime:"",
|
endTime:""
|
},
|
docName:'',
|
startTime:"",
|
endTime:"",
|
deleteParam:{
|
id:''
|
},
|
rightClickRow:null,
|
nodeData:{
|
index:7,
|
list:[]
|
},
|
contextQueryParams:{
|
flag:2, //查询按钮的范围 1 菜单 2 对象
|
param:'document', //查询参数,按类型而不同 1 菜单路径 2 对象权限码
|
objectId:null, //flag 为2时需要传递该参数 该参数与param对应数据id
|
relativeObjectId:null, //param 为process,document,file 时需要传该参数 该参数为关联树节点的id
|
relativeParam:null, //param 为process,document,file 时需要传该参数 该参数为关联树节点的对象权限码
|
},
|
docUploadParams:{
|
attributionId:'',
|
attributionType:1,
|
docClassCode:'OTHER',
|
},
|
docSelectionAll:[],
|
docSelection:[],
|
idKey:'docId' // 标识列表数据中每一行的唯一键的名称
|
}
|
},
|
methods: {
|
docSelectionChange(val) {
|
this.docSelection = val;
|
},
|
handleSizeChange(val) {
|
// 改变每页显示条数的时候调用一次
|
this.changePageCoreRecordData();
|
this.pageData.size = val;
|
this.queryOtherDoc();
|
},
|
handlePageChange(val){
|
// 改变页的时候调用一次
|
this.changePageCoreRecordData();
|
this.pageData.page = val;
|
this.queryOtherDoc();
|
},
|
handleDelSizeChange(val) {
|
// 改变每页显示条数的时候调用一次
|
this.changePageCoreRecordData();
|
this.pageOtherData.size = val;
|
this.queryDocDel();
|
},
|
handlerDelPageChange(val) {
|
// 改变页的时候调用一次
|
this.changePageCoreRecordData();
|
this.pageOtherData.page = val;
|
this.queryDocDel();
|
},
|
queryDocDel(){
|
if (this.nodeList.list != '') {
|
let paramList = this.nodeList.list;
|
this.otherParams.attributionType = this.nodeList.index;
|
if (this.nodeList.index == 1) {
|
this.otherParams.attributionId = JSON.parse(JSON.stringify(paramList)).productId;
|
} else if (this.nodeList.index == 2) {
|
this.otherParams.attributionId = JSON.parse(JSON.stringify(paramList)).componentId;
|
} else if (this.nodeList.index == 3) {
|
this.otherParams.attributionId = JSON.parse(JSON.stringify(paramList)).partsId;
|
} else if (this.nodeList.index == 4) {
|
//this.otherParams.attributionId = JSON.parse(JSON.stringify(paramList)).productId;
|
} else if (this.nodeList.index == 5) {
|
this.otherParams.attributionId = JSON.parse(JSON.stringify(paramList)).processId;
|
}
|
productApi.query_doc_list(this.pageOtherData.page, this.pageOtherData.size, this.delOtherParams).then((res) => {
|
if (res.success) {
|
this.pageOtherData.total = res.page.total;
|
this.delOtherDocList = res.page.records;
|
setTimeout(()=>{
|
this.setSelectRow();
|
}, 50)
|
}
|
})
|
}
|
},
|
handleCurrentChange(val) {
|
this.nodeData.list = val;
|
this.$emit('indexChange', this.nodeData); // 调用父组件传递过来的方法,同时把数据传递出去
|
//this.$emit('indexChange', '6'); // 调用父组件传递过来的方法,同时把数据传递出去
|
},
|
LogSearch() {
|
this.LogQuery();
|
},
|
LogQuery() {
|
this.listLoading = true;
|
this.otherParams=this.otherParams;
|
this.otherParams.startTime=this.startTime;
|
this.otherParams.endTime=this.endTime;
|
if ((this.otherParams.docName!= null && this.otherParams.docName !== '')||
|
(this.otherParams.startTime != null && this.otherParams.startTime !== '')||
|
(this.otherParams.endTime!= null && this.otherParams.endTime !== '')){
|
//重置分页参数
|
this.pageOtherData.page = 1;
|
this.pageOtherData.size = 10;
|
}
|
productApi.query_doc_list(this.pageOtherData.page, this.pageOtherData.size, this.otherParams).then((res) => {
|
if (res.success) {
|
this.pageOtherData.total = res.page.total;
|
this.delOtherDocList = res.page.records;
|
setTimeout(()=>{
|
this.setSelectRow();
|
}, 50)
|
}
|
})
|
},
|
showDocEditDialog(){
|
this.$emit('showDocEditDialog', this.rightClickRow);
|
},
|
showUploadDialog(){
|
this.docUploadParams.attributionType = this.nodeList.index;
|
if (this.nodeList.index == 1) {
|
this.docUploadParams.attributionId = this.nodeList.list.productId;
|
} else if (this.nodeList.index == 2) {
|
this.docUploadParams.attributionId = this.nodeList.list.componentId;
|
} else if (this.nodeList.index == 3) {
|
this.docUploadParams.attributionId = this.nodeList.list.partsId;
|
}
|
this.$emit('showUploadDialog', this.docUploadParams);
|
},
|
showBatchDeleteDialog(){
|
this.docBatchDeleteVisible = true;//打开批量删除文档弹窗
|
this.delOtherParams=this.otherParams;
|
this.delOtherParams.startTime=this.startTime;
|
this.delOtherParams.endTime=this.endTime;
|
productApi.query_doc_list(this.pageOtherData.page, this.pageOtherData.size, this.delOtherParams).then((res) => {
|
if (res.success) {
|
this.pageOtherData.total = res.page.total;
|
this.delOtherDocList = res.page.records;
|
setTimeout(()=>{
|
this.setSelectRow();
|
}, 50)
|
}
|
})
|
},
|
queryOtherDoc(){
|
if (this.nodeList.list != '') {
|
let paramList = this.nodeList.list;
|
this.otherParams.attributionType = this.nodeList.index;
|
if (this.nodeList.index == 1) {
|
this.otherParams.attributionId = JSON.parse(JSON.stringify(paramList)).productId;
|
} else if (this.nodeList.index == 2) {
|
this.otherParams.attributionId = JSON.parse(JSON.stringify(paramList)).componentId;
|
} else if (this.nodeList.index == 3) {
|
this.otherParams.attributionId = JSON.parse(JSON.stringify(paramList)).partsId;
|
} else if (this.nodeList.index == 4) {
|
//this.otherParams.attributionId = JSON.parse(JSON.stringify(paramList)).productId;
|
} else if (this.nodeList.index == 5) {
|
this.otherParams.attributionId = JSON.parse(JSON.stringify(paramList)).processId;
|
}
|
this.otherParams.docName = '';
|
productApi.query_doc_list(this.pageData.page, this.pageData.size, this.otherParams).then((res) => {
|
if (res.success) {
|
this.pageData.total = res.page.total;
|
this.otherTableData = res.page.records;
|
setTimeout(()=>{
|
this.setSelectRow();
|
}, 50)
|
}
|
})
|
}
|
},
|
otherRightClick(row, column, event) { // 鼠标右击触发事件
|
if (event != undefined) {
|
this.rightClickRow = row;
|
if (this.nodeList.index == 1) {
|
this.contextQueryParams.objectId = this.nodeList.list.productId;
|
this.contextQueryParams.relativeParam ='product';
|
this.contextQueryParams.relativeObjectId = this.nodeList.list.productId;
|
}else if (this.nodeList.index == 2) {
|
this.contextQueryParams.objectId = this.nodeList.list.componentId;
|
this.contextQueryParams.relativeParam ='component';
|
this.contextQueryParams.relativeObjectId = this.nodeList.list.componentId;
|
}else if (this.nodeList.index == 3) {
|
this.contextQueryParams.objectId = this.nodeList.list.partsId;
|
this.contextQueryParams.relativeParam ='parts';
|
this.contextQueryParams.relativeObjectId = this.nodeList.list.partsId;
|
}
|
this.$refs.OContextMenu.otherContextClick(row, column, event,this.contextQueryParams);
|
}
|
},
|
docDelete(){
|
this.$confirm('删除后不可取消,确认删除吗?', '提示', {}).then(() => {
|
this.deleteParam.id = this.rightClickRow.docId;
|
productApi.doc_delete(this.deleteParam).then((res) => {
|
if (res.success) {
|
Bus.$emit('setIndex',this.nodeList); // 调用组件传递过来的方法,同时把数据传递出去
|
let totalPage = Math.ceil((this.pageData.total-1)/this.pageData.size);
|
totalPage = (totalPage < 1 ? 1 : totalPage);
|
this.pageData.page = this.pageData.page > totalPage ? totalPage : this.pageData.page;
|
this.queryOtherDoc();
|
this.$message({
|
message: res.message,
|
type: 'success'
|
});
|
} else if (res.message) {
|
this.$message({
|
message: res.message,
|
type: 'error'
|
});
|
}
|
});
|
});
|
},
|
//批量删除
|
docBatchDelete(){
|
// 得到选中的所有数据
|
this.getAllSelectionData();
|
this.$confirm('删除后不可取消,确认删除吗?', '提示', {}).then(() => {
|
let docList = this.docSelectionAll;
|
let _this = this;
|
docList.forEach((v, k) => {
|
(function (value) {
|
setTimeout(()=> {
|
let mgs = value.docName;
|
_this.deleteParam.id = value.docId;
|
productApi.doc_delete(_this.deleteParam).then((res) => {
|
if(res.success){
|
_this.buttonLoading = false;
|
_this.$notify({
|
title: '成功',
|
message:'删除 '+ mgs + res.message,
|
type: 'success'
|
});
|
let totalPage = Math.ceil(( _this.pageOtherData.total-1)/ _this.pageOtherData.size);
|
totalPage = (totalPage < 1 ? 1 : totalPage);
|
_this.pageOtherData.page = _this.pageOtherData.page > totalPage ? totalPage : _this.pageOtherData.page;
|
_this.docSelectionAll=[];
|
_this.queryDocDel();
|
}else{
|
_this.buttonLoading = false;
|
_this.$notify({
|
title: '警告',
|
message:'删除 '+ mgs + res.message,
|
type: 'warning',
|
duration: 0
|
});
|
}
|
});
|
},(k+1)*200)
|
})(docList[k]);
|
});
|
});
|
},
|
/*NC文档,其他文档 下载*/
|
docDownload(){
|
productApi.doc_download(this.rightClickRow.docId).then((res) =>{
|
if(res.success){
|
}else{
|
this.$message({
|
message: res.message,
|
type: 'error'
|
});
|
}
|
}).catch((err)=>{ //上传失败 调用onError方法 //处理自己的逻辑
|
this.$message({
|
message: '下载失败',
|
type: 'error'
|
});
|
});
|
},
|
// 得到选中的所有数据
|
getAllSelectionData () {
|
// 再执行一次记忆勾选数据匹配,目的是为了在当前页操作勾选后直接获取选中数据
|
this.changePageCoreRecordData();
|
},
|
// 设置选中的方法
|
setSelectRow() {
|
if (!this.docSelectionAll || this.docSelectionAll.length <= 0) {
|
return;
|
}
|
// 标识当前行的唯一键的名称
|
let idKey = this.idKey;
|
let selectAllIds = [];
|
let that = this;
|
this.docSelectionAll.forEach(row=>{
|
selectAllIds.push(row[idKey]);
|
});
|
this.$refs.table.clearSelection();
|
for(var i = 0; i < this.otherTableData.length; i++) {
|
if (selectAllIds.indexOf(this.otherTableData[i][idKey]) >= 0) {
|
// 设置选中,记住table组件需要使用ref="table"
|
this.$refs.table.toggleRowSelection(this.otherTableData[i], true);
|
}
|
}
|
} ,
|
// 记忆选择核心方法
|
changePageCoreRecordData () {
|
// 标识当前行的唯一键的名称
|
let idKey = this.idKey;
|
let that = this;
|
// 如果总记忆中还没有选择的数据,那么就直接取当前页选中的数据,不需要后面一系列计算
|
if (this.docSelectionAll.length <= 0) {
|
this.docSelectionAll = this.docSelection;
|
return;
|
}
|
// 总选择里面的key集合
|
let selectAllIds = [];
|
this.docSelectionAll.forEach(row=>{
|
selectAllIds.push(row[idKey]);
|
})
|
let selectIds = []
|
// 获取当前页选中的id
|
this.docSelection.forEach(row=>{
|
selectIds.push(row[idKey]);
|
// 如果总选择里面不包含当前页选中的数据,那么就加入到总选择集合里
|
if (selectAllIds.indexOf(row[idKey]) < 0) {
|
that.docSelectionAll.push(row);
|
}
|
})
|
let noSelectIds = [];
|
// 得到当前页没有选中的id
|
this.otherTableData.forEach(row=>{
|
if (selectIds.indexOf(row[idKey]) < 0) {
|
noSelectIds.push(row[idKey]);
|
}
|
})
|
noSelectIds.forEach(id=>{
|
if (selectAllIds.indexOf(id) >= 0) {
|
for(let i = 0; i< that.docSelectionAll.length; i ++) {
|
if (that.docSelectionAll[i][idKey] == id) {
|
// 如果总选择中有未被选中的,那么就删除这条
|
that.docSelectionAll.splice(i, 1);
|
break;
|
}
|
}
|
}
|
})
|
},
|
/*NC文档,其他文档 发布*/
|
docPublish(){
|
this.$confirm('确认发布吗?', '提示', {}).then(() =>{
|
productApi.doc_publish(this.rightClickRow.docId).then((res) =>{
|
if(res.success){
|
Bus.$emit('queryOtherFileList');
|
this.queryOtherDoc();
|
this.$message({
|
message: res.message,
|
type: 'success'
|
});
|
}else{
|
this.$message({
|
message: res.message,
|
type: 'error'
|
});
|
}
|
})
|
})
|
},
|
/*NC文档,其他文档 重发布*/
|
docRepublish(){
|
this.$confirm('确认重新发布吗?', '提示', {}).then(() =>{
|
productApi.doc_republish(this.rightClickRow.docId).then((res) =>{
|
if(res.success){
|
Bus.$emit('queryOtherFileList');
|
this.$message({
|
message: res.message,
|
type: 'success'
|
});
|
this.queryOtherDoc();
|
}else{
|
this.$message({
|
message: res.message,
|
type: 'error'
|
});
|
}
|
})
|
})
|
},
|
/*NC文档,其他文档 出库*/
|
docPull(){
|
this.$confirm('确认出库吗?', '提示', {}).then(() =>{
|
productApi.doc_pull(this.rightClickRow.docId).then((res) =>{
|
if(res.success){
|
Bus.$emit('queryOtherFileList');
|
this.$message({
|
message: res.message,
|
type: 'success'
|
});
|
}else{
|
this.$message({
|
message: res.message,
|
type: 'error'
|
});
|
}
|
});
|
this.queryOtherDoc();
|
})
|
},
|
/*NC文档,其他文档 取消出库*/
|
docCancelPull(){
|
this.$confirm('确认取消出库吗?', '提示', {}).then(() =>{
|
productApi.doc_cancel_pull(this.rightClickRow.docId).then((res) =>{
|
if(res.success){
|
this.queryOtherDoc();
|
this.$message({
|
message: res.message,
|
type: 'success'
|
});
|
}else{
|
this.$message({
|
message: res.message,
|
type: 'error'
|
});
|
}
|
})
|
})
|
},
|
/*NC文档,其他文档 入库*/
|
docPush(){
|
this.otherDocList = [];
|
this.otherDocPushVisible = true;
|
},
|
/*NC文档,其他文档 归档*/
|
docPigeonhole(){
|
this.$confirm('归档后不可取消,确认归档吗?', '提示', {}).then(() =>{
|
productApi.doc_pigeonhole(this.rightClickRow.docId).then((res) =>{
|
if(res.success){
|
this.queryOtherDoc();
|
this.$message({
|
message: res.message,
|
type: 'success'
|
});
|
}else{
|
this.$message({
|
message: res.message,
|
type: 'error'
|
});
|
}
|
})
|
})
|
},
|
//上传
|
handleUploadChange(file, fileList){
|
this.fileLen = fileList.length;
|
},
|
handleExceed(files, fileList) {
|
this.$message.warning(`当前限制选择 1 个文件,本次选择了 ${files.length} 个文件,共选择了 ${files.length + fileList.length} 个文件`);
|
},
|
beforeRemove(file, fileList) {
|
return this.$confirm(`确定移除 ${ file.name }?`);
|
},
|
submitOtherUpload(){
|
this.$confirm('确认提交吗?', '提示', {}).then(() =>{
|
this.$refs.upload.submit();
|
})
|
},
|
handleRequest(uploader){
|
let formData = new FormData();
|
formData.append("file", uploader.file);
|
productApi.doc_push(this.rightClickRow.docId,formData,uploader).then((res)=>{
|
if (res.success) {
|
//上传成功 调用onSuccess方法,否则没有完成图标 //处理自己的逻辑
|
uploader.onSuccess();
|
Bus.$emit('queryOtherFileList')
|
}else{
|
this.$message({
|
message: res.message,
|
type: 'error'
|
});
|
}
|
}).catch((err)=>{ //上传失败 调用onError方法 //处理自己的逻辑
|
|
})
|
},
|
closeDialog(){
|
this.otherDocPushVisible = false;
|
this.queryOtherDoc();
|
},
|
closeDocDeleteDialog(){
|
this.docBatchDeleteVisible = false;
|
this.docSelection = [];
|
this.docSelectionAll =[];
|
this.pageData = {
|
page:1,
|
size : 10,
|
total:0,
|
pageSizeArr:[10, 20, 40]
|
};
|
this.pageOtherData= {
|
page:1,
|
size : 10,
|
total:0,
|
pageSizeArr:[10, 20, 40]
|
};
|
this.queryOtherDoc();
|
},
|
},
|
//监听
|
watch:{
|
nodeList:{
|
deep: true, // 深度监听
|
handler(newValue, oldValue) {
|
this.pageData = {
|
page:1,
|
size : 10,
|
total:0,
|
pageSizeArr:[10, 20, 40]
|
};
|
this.queryOtherDoc()
|
}
|
}
|
},
|
//初始化 模板渲染前调用
|
created(){
|
Bus.$off('queryOtherDoc');
|
Bus.$on("queryOtherDoc",()=>{
|
this.queryOtherDoc()
|
});
|
|
},
|
mounted() {
|
//默认查询页面
|
this.queryOtherDoc();
|
//初始化查询条件
|
}
|
}
|
</script>
|
|
<style scoped lang="scss">
|
.el-row{
|
border: 1px solid #EBEEF5;
|
}
|
.menu_item {
|
line-height: 20px;
|
text-align: left;
|
margin-top: 10px;
|
}
|
|
.menu {
|
height: 100px;
|
width: 80px;
|
position: absolute;
|
/* border-radius: 10px;*/
|
border: 1px solid #999999;
|
background-color: #f4f4f4;
|
}
|
|
li:hover {
|
background-color: #1790ff;
|
color: white;
|
}
|
li{
|
list-style-type:none;
|
font-size:15px
|
}
|
.contextmenu {
|
margin: 0;
|
background: #fff;
|
z-index: 99999;
|
position: absolute;
|
list-style-type: none;
|
padding: 5px 0;
|
border-radius: 4px;
|
font-size: 12px;
|
font-weight: 400;
|
color: #333;
|
box-shadow: 2px 2px 3px 0 rgba(0, 0, 0, 0.3);
|
li {
|
margin: 0;
|
padding: 7px 16px;
|
cursor: pointer;
|
}
|
}
|
.otherRightMenu{
|
position: absolute;
|
top: 0;
|
height: 100%;
|
}
|
</style>
|