修改权限展示、增加库存导入导出
This commit is contained in:
parent
10f4b726d4
commit
3ac387e502
@ -5,15 +5,15 @@ NODE_ENV = production
|
|||||||
VUE_APP_TITLE = 象纬云科
|
VUE_APP_TITLE = 象纬云科
|
||||||
|
|
||||||
# 测试环境
|
# 测试环境
|
||||||
VUE_APP_API_BASEURL = https://dev.api.linkwing.com/api/v1
|
# VUE_APP_API_BASEURL = https://dev.api.linkwing.com/api/v1
|
||||||
VUE_APP_API_DEV = https://dev.api.linkwing.com/api/v1
|
# VUE_APP_API_DEV = https://dev.api.linkwing.com/api/v1
|
||||||
VUE_APP_WS_URL = wss://dev.api.linkwing.com/wss
|
# VUE_APP_WS_URL = wss://dev.api.linkwing.com/wss
|
||||||
VUE_APP_WSS_URL = wss://dev.api.linkwing.com/wss
|
# VUE_APP_WSS_URL = wss://dev.api.linkwing.com/wss
|
||||||
|
|
||||||
# 线上环境
|
# 线上环境
|
||||||
# 接口地址 # WS地址
|
# 接口地址 # WS地址
|
||||||
# VUE_APP_API_BASEURL = https://prod.api.linkwing.com/api/v1
|
VUE_APP_API_BASEURL = https://prod.api.linkwing.com/api/v1
|
||||||
# VUE_APP_API_DEV = https://prod.api.linkwing.com/api/v1
|
VUE_APP_API_DEV = https://prod.api.linkwing.com/api/v1
|
||||||
# VUE_APP_WS_URL = wss://prod.api.linkwing.com/wss
|
VUE_APP_WS_URL = wss://prod.api.linkwing.com/wss
|
||||||
# VUE_APP_WSS_URL = wss://prod.api.linkwing.com/wss
|
VUE_APP_WSS_URL = wss://prod.api.linkwing.com/wss
|
||||||
|
|
||||||
|
|||||||
@ -263,8 +263,29 @@ export default {
|
|||||||
post: async function (params) {
|
post: async function (params) {
|
||||||
return await http.post(this.url,params);
|
return await http.post(this.url,params);
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
import:{
|
||||||
|
url: `${config.API_URL}/inventory.import`,
|
||||||
|
name: "库存导入",
|
||||||
|
post: async function (params) {
|
||||||
|
return await http.post(this.url,params,{'Content-Type': 'multipart/form-data'});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
template:{
|
||||||
|
url: `${config.API_URL}/stock.import.template`,
|
||||||
|
name: "库存导入模版",
|
||||||
|
post: async function (params) {
|
||||||
|
return await http.get(this.url,params,{responseType: 'arraybuffer'});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
export:{
|
||||||
|
url: `${config.API_URL}/inventory.export`,
|
||||||
|
name: "库存导出",
|
||||||
|
post: async function (params) {
|
||||||
|
return await http.post(this.url,params);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
out:{
|
out:{
|
||||||
list:{
|
list:{
|
||||||
url: `${config.API_URL}/out.stock.list`,
|
url: `${config.API_URL}/out.stock.list`,
|
||||||
|
|||||||
@ -47,7 +47,7 @@ export default {
|
|||||||
},
|
},
|
||||||
methods:{
|
methods:{
|
||||||
getWsResult(res){
|
getWsResult(res){
|
||||||
if(res.data && (res.data.type == 6 || res.data.type == 7 || res.data.type == 8 || res.data.type == 11 || res.data.type == 19 || res.data.type == 20 || res.data.type == 29 || res.data.type == 30 || res.data.type == 32 || res.data.type == 33 || res.data.type == 34 || res.data.type == 43)){
|
if(res.data && (res.data.type == 6 || res.data.type == 7 || res.data.type == 8 || res.data.type == 11 || res.data.type == 19 || res.data.type == 20 || res.data.type == 29 || res.data.type == 30 || res.data.type == 32 || res.data.type == 33 || res.data.type == 34 || res.data.type == 40 || res.data.type == 43)){
|
||||||
let item = {
|
let item = {
|
||||||
type:res.data.type,
|
type:res.data.type,
|
||||||
type_desc:res.data.type_desc,
|
type_desc:res.data.type_desc,
|
||||||
@ -89,9 +89,12 @@ export default {
|
|||||||
case 34:
|
case 34:
|
||||||
this.list[10] = item;
|
this.list[10] = item;
|
||||||
break;
|
break;
|
||||||
default:
|
case 40:
|
||||||
this.list[11] = item;
|
this.list[11] = item;
|
||||||
break;
|
break;
|
||||||
|
default:
|
||||||
|
this.list[12] = item;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(res.data && res.data.status == 1100){
|
if(res.data && res.data.status == 1100){
|
||||||
|
|||||||
@ -108,7 +108,7 @@ export default {
|
|||||||
},
|
},
|
||||||
methods:{
|
methods:{
|
||||||
getWsResult(res){
|
getWsResult(res){
|
||||||
if(res.data && (res.data.type == 4 || res.data.type == 5 || res.data.type == 10 || res.data.type == 17 || res.data.type == 18 || res.data.type == 28 || res.data.type == 31 || res.data.type == 42)){
|
if(res.data && (res.data.type == 4 || res.data.type == 5 || res.data.type == 10 || res.data.type == 17 || res.data.type == 18 || res.data.type == 27 || res.data.type == 28 || res.data.type == 31 || res.data.type == 42)){
|
||||||
this.importInfo = res.data;
|
this.importInfo = res.data;
|
||||||
this.progressShow = true;
|
this.progressShow = true;
|
||||||
if(res.data.status == 0){
|
if(res.data.status == 0){
|
||||||
|
|||||||
@ -10,7 +10,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="scTable" :style="{'height':_height}" ref="scTableMain" v-loading="loading">
|
<div class="scTable" :style="{'height':_height}" ref="scTableMain" v-loading="loading">
|
||||||
<div class="scTable-table" :class="hidePagination && hideDo?'bottomNoBorder':''" :style="{'height':_table_height}">
|
<div class="scTable-table" :class="hidePagination && hideDo?'bottomNoBorder':''" :style="{'height':_table_height}">
|
||||||
<el-table v-bind="$attrs" :header-cell-style="{'background': '#F5F7FA','color':'#606266'}" :data="tableData" :row-key="rowKey" :key="toggleIndex" ref="scTable" :height="height=='auto'?null:'100%'" :size="config.size" :border="config.config.border" :stripe="config.config.stripe" :summary-method="remoteSummary?remoteSummaryMethod:summaryMethod" @sort-change="sortChange" @filter-change="filterChange">
|
<el-table v-bind="$attrs" :header-cell-style="{'background': '#F5F7FA','color':'#606266'}" :data="tableData" :row-key="rowKey" :key="toggleIndex" ref="scTable" :height="height=='auto'?null:'100%'" :size="config.size" :border="config.config.border" :stripe="config.config.stripe" :summary-method="remoteSummary?remoteSummaryMethod:summaryMethod" @sort-change="sortChange" @filter-change="filterChange" @header-dragend="headerDragend">
|
||||||
<slot></slot>
|
<slot></slot>
|
||||||
<template v-for="(item, index) in userColumn" :key="index">
|
<template v-for="(item, index) in userColumn" :key="index">
|
||||||
<!--item.showOverflowTooltip-->
|
<!--item.showOverflowTooltip-->
|
||||||
@ -364,6 +364,10 @@
|
|||||||
})
|
})
|
||||||
this.upData(filters)
|
this.upData(filters)
|
||||||
},
|
},
|
||||||
|
// 表头列改变事件
|
||||||
|
headerDragend(newWidth,oldWidth,column,e){
|
||||||
|
console.log(newWidth,oldWidth,column,e,799)
|
||||||
|
},
|
||||||
//远程合计行处理
|
//远程合计行处理
|
||||||
remoteSummaryMethod(param){
|
remoteSummaryMethod(param){
|
||||||
const {columns} = param
|
const {columns} = param
|
||||||
|
|||||||
@ -69,8 +69,6 @@
|
|||||||
.el-tabs.role_tabs{
|
.el-tabs.role_tabs{
|
||||||
--el-tabs-header-height:42px;
|
--el-tabs-header-height:42px;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
display: flex;
|
|
||||||
flex-direction: column-reverse;
|
|
||||||
.el-tabs__active-bar{
|
.el-tabs__active-bar{
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
}
|
}
|
||||||
@ -80,7 +78,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
.el-tabs__content{
|
.el-tabs__content{
|
||||||
flex: 1;
|
height: calc(100% - 60px);
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
padding-left: 10px;
|
padding-left: 10px;
|
||||||
padding-bottom: 10px;
|
padding-bottom: 10px;
|
||||||
@ -91,7 +89,6 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.el-menu {border: none!important;}
|
.el-menu {border: none!important;}
|
||||||
.el-menu ::v-deep .nav-top-menu{margin-right: 0 !important;}
|
|
||||||
.el-menu .el-menu-item.is-active{background: var(--el-menu-hover-bg-color);position: relative;}
|
.el-menu .el-menu-item.is-active{background: var(--el-menu-hover-bg-color);position: relative;}
|
||||||
.el-menu .el-menu-item.is-active:after{content: "";position: absolute;top: 0;right: 0;height: 100%;width: 4px;background: var(--el-color-primary);}
|
.el-menu .el-menu-item.is-active:after{content: "";position: absolute;top: 0;right: 0;height: 100%;width: 4px;background: var(--el-color-primary);}
|
||||||
.el-menu .el-menu-item a {color: inherit;text-decoration: none;display: block;width:100%;height:100%;position: absolute;top:0;left:0;}
|
.el-menu .el-menu-item a {color: inherit;text-decoration: none;display: block;width:100%;height:100%;position: absolute;top:0;left:0;}
|
||||||
|
|||||||
@ -1,5 +1,22 @@
|
|||||||
<template>
|
<template>
|
||||||
<el-container class="mainBox mainBoxHeaderNoBorder">
|
<el-container class="mainBox mainBoxHeaderNoBorder">
|
||||||
|
<el-header>
|
||||||
|
<div class="left-panel">
|
||||||
|
<scImport ref="scImport" :size="size" title="批量导入库存" @parentParams="importUpload" @importSuccess="importSuccess">
|
||||||
|
<template #header>
|
||||||
|
<el-button v-auth="'importInventory'" type="primary" :size="size" plain @click="importFile" style="margin-right: 12px;">批量导入</el-button>
|
||||||
|
</template>
|
||||||
|
<template #download>
|
||||||
|
<div v-auth="'importInventory'" @click="importTemplate">下载导入模版</div>
|
||||||
|
</template>
|
||||||
|
</scImport>
|
||||||
|
</div>
|
||||||
|
<div class="right-panel">
|
||||||
|
<scExport :size="size" @exportData="exportData" @updateShow="exportChangeShow" :show="exportShow" type="40">
|
||||||
|
<el-button :size="size" v-auth="'inventoryExport'" icon="sc-icon-Download" :disabled="exportShow" @click="exportData">下载</el-button>
|
||||||
|
</scExport>
|
||||||
|
</div>
|
||||||
|
</el-header>
|
||||||
<el-main class="nopadding">
|
<el-main class="nopadding">
|
||||||
<div class="searchMain">
|
<div class="searchMain">
|
||||||
<scSearch ref="scSearch" :searchList="searchList" @fetchSelectData="getSelectData"></scSearch>
|
<scSearch ref="scSearch" :searchList="searchList" @fetchSelectData="getSelectData"></scSearch>
|
||||||
@ -139,11 +156,11 @@ export default {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
async importTemplate() {
|
async importTemplate() {
|
||||||
const res = await this.$API.orders.order.maintenance.template.post();
|
const res = await this.$API.orders.order.sock.template.post();
|
||||||
const blob = new Blob([res]);
|
const blob = new Blob([res]);
|
||||||
const text = new Date().getTime();
|
const text = new Date().getTime();
|
||||||
const eLink = document.createElement('a');
|
const eLink = document.createElement('a');
|
||||||
eLink.download = "维保导入模版_"+text+'.xlsx';
|
eLink.download = "库存导入模版_"+text+'.xlsx';
|
||||||
eLink.style.display = 'none';
|
eLink.style.display = 'none';
|
||||||
eLink.href = URL.createObjectURL(blob);
|
eLink.href = URL.createObjectURL(blob);
|
||||||
document.body.appendChild(eLink);
|
document.body.appendChild(eLink);
|
||||||
@ -152,7 +169,7 @@ export default {
|
|||||||
document.body.removeChild(eLink);
|
document.body.removeChild(eLink);
|
||||||
},
|
},
|
||||||
async importUpload(params) {
|
async importUpload(params) {
|
||||||
const res = await this.$API.orders.order.maintenance.import.post(params);
|
const res = await this.$API.orders.order.sock.import.post(params);
|
||||||
if(res.code == 200){
|
if(res.code == 200){
|
||||||
this.$message.success('上传成功,开始导入数据');
|
this.$message.success('上传成功,开始导入数据');
|
||||||
}
|
}
|
||||||
@ -190,26 +207,6 @@ export default {
|
|||||||
}
|
}
|
||||||
}).catch(()=>{})
|
}).catch(()=>{})
|
||||||
},
|
},
|
||||||
// 功能授权
|
|
||||||
table_empower(row){
|
|
||||||
this.$router.push({
|
|
||||||
path: '/setting/company/add-permission',
|
|
||||||
query: {
|
|
||||||
id: row.id,
|
|
||||||
name:row.name
|
|
||||||
}
|
|
||||||
})
|
|
||||||
},
|
|
||||||
// 公司用户列表
|
|
||||||
table_user_ist(row){
|
|
||||||
this.$router.push({
|
|
||||||
path: '/setting/user/company-user-list',
|
|
||||||
query: {
|
|
||||||
id: row.id,
|
|
||||||
name:row.name
|
|
||||||
}
|
|
||||||
})
|
|
||||||
},
|
|
||||||
//表格选择后回调事件
|
//表格选择后回调事件
|
||||||
selectionChange(selection){
|
selectionChange(selection){
|
||||||
this.selection = selection;
|
this.selection = selection;
|
||||||
@ -232,13 +229,13 @@ export default {
|
|||||||
},
|
},
|
||||||
// 下载导出
|
// 下载导出
|
||||||
exportChangeShow(params){
|
exportChangeShow(params){
|
||||||
if(params.type == 11){
|
if(params.type == 40){
|
||||||
this.exportShow = params.status==0?true:false
|
this.exportShow = params.status==0?true:false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
async exportData() {
|
async exportData() {
|
||||||
if(this.exportShow) return
|
if(this.exportShow) return
|
||||||
const res = await this.$API.orders.order.maintenance.export.post(this.params);
|
const res = await this.$API.orders.order.sock.export.post(this.params);
|
||||||
if(res.code == 200){
|
if(res.code == 200){
|
||||||
this.$message.success('开始导出');
|
this.$message.success('开始导出');
|
||||||
}
|
}
|
||||||
|
|||||||
@ -34,7 +34,7 @@
|
|||||||
<el-button :size="size" type="info" icon="el-icon-RefreshRight" @click="reset">重置</el-button>
|
<el-button :size="size" type="info" icon="el-icon-RefreshRight" @click="reset">重置</el-button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<scTable ref="table" :apiObj="list.apiObj" :column="list.column" row-key="id" stripe :size="size" highlightCurrentRow :hideTotal="false" @selection-change="selectionChange">
|
<scTable ref="table" :apiObj="list.apiObj" :column="list.column" row-key="id" stripe :size="size" border highlightCurrentRow :hideTotal="false" @selection-change="selectionChange">
|
||||||
<el-table-column type="selection" align="center" width="40"></el-table-column>
|
<el-table-column type="selection" align="center" width="40"></el-table-column>
|
||||||
<sc-table-column label="序号" align="center" type="index"></sc-table-column>
|
<sc-table-column label="序号" align="center" type="index"></sc-table-column>
|
||||||
<template #business_status="scope">
|
<template #business_status="scope">
|
||||||
|
|||||||
@ -58,8 +58,8 @@ export default {
|
|||||||
watch:{
|
watch:{
|
||||||
data(val){
|
data(val){
|
||||||
if(val && val.length>0){
|
if(val && val.length>0){
|
||||||
val.forEach(item=>{
|
val.forEach((item,index)=>{
|
||||||
item.show = true;
|
item.show = index===0?true:false;
|
||||||
if(item.children){
|
if(item.children){
|
||||||
item.children.forEach(em=>{
|
item.children.forEach(em=>{
|
||||||
if(em.meta.data_permission && em.meta.data_permission.length>0){
|
if(em.meta.data_permission && em.meta.data_permission.length>0){
|
||||||
@ -248,9 +248,9 @@ export default {
|
|||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
margin-right: 20px;
|
margin-right: 20px;
|
||||||
width: 120px;
|
min-width: 120px;
|
||||||
.name{
|
.name{
|
||||||
width: 100px;
|
//min-width: 100px;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user