修改权限展示、增加库存导入导出

This commit is contained in:
龙运模 2024-12-10 21:05:13 +08:00
parent 10f4b726d4
commit 3ac387e502
9 changed files with 69 additions and 47 deletions

View File

@ -5,15 +5,15 @@ NODE_ENV = production
VUE_APP_TITLE = 象纬云科
# 测试环境
VUE_APP_API_BASEURL = 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_WSS_URL = wss://dev.api.linkwing.com/wss
# VUE_APP_API_BASEURL = 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_WSS_URL = wss://dev.api.linkwing.com/wss
# 线上环境
# 接口地址 # WS地址
# VUE_APP_API_BASEURL = 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_WSS_URL = wss://prod.api.linkwing.com/wss
VUE_APP_API_BASEURL = 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_WSS_URL = wss://prod.api.linkwing.com/wss

View File

@ -263,8 +263,29 @@ export default {
post: async function (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:{
list:{
url: `${config.API_URL}/out.stock.list`,

View File

@ -47,7 +47,7 @@ export default {
},
methods:{
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 = {
type:res.data.type,
type_desc:res.data.type_desc,
@ -89,9 +89,12 @@ export default {
case 34:
this.list[10] = item;
break;
default:
case 40:
this.list[11] = item;
break;
default:
this.list[12] = item;
break;
}
if(res.data && res.data.status == 1100){

View File

@ -108,7 +108,7 @@ export default {
},
methods:{
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.progressShow = true;
if(res.data.status == 0){

View File

@ -10,7 +10,7 @@
<template>
<div class="scTable" :style="{'height':_height}" ref="scTableMain" v-loading="loading">
<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>
<template v-for="(item, index) in userColumn" :key="index">
<!--item.showOverflowTooltip-->
@ -364,6 +364,10 @@
})
this.upData(filters)
},
//
headerDragend(newWidth,oldWidth,column,e){
console.log(newWidth,oldWidth,column,e,799)
},
//
remoteSummaryMethod(param){
const {columns} = param

View File

@ -69,8 +69,6 @@
.el-tabs.role_tabs{
--el-tabs-header-height:42px;
height: 100%;
display: flex;
flex-direction: column-reverse;
.el-tabs__active-bar{
bottom: 0;
}
@ -80,7 +78,7 @@
}
}
.el-tabs__content{
flex: 1;
height: calc(100% - 60px);
overflow: hidden;
padding-left: 10px;
padding-bottom: 10px;
@ -91,7 +89,6 @@
}
.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: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;}

View File

@ -1,5 +1,22 @@
<template>
<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">
<div class="searchMain">
<scSearch ref="scSearch" :searchList="searchList" @fetchSelectData="getSelectData"></scSearch>
@ -139,11 +156,11 @@ export default {
})
},
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 text = new Date().getTime();
const eLink = document.createElement('a');
eLink.download = "维保导入模版_"+text+'.xlsx';
eLink.download = "库存导入模版_"+text+'.xlsx';
eLink.style.display = 'none';
eLink.href = URL.createObjectURL(blob);
document.body.appendChild(eLink);
@ -152,7 +169,7 @@ export default {
document.body.removeChild(eLink);
},
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){
this.$message.success('上传成功,开始导入数据');
}
@ -190,26 +207,6 @@ export default {
}
}).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){
this.selection = selection;
@ -232,13 +229,13 @@ export default {
},
//
exportChangeShow(params){
if(params.type == 11){
if(params.type == 40){
this.exportShow = params.status==0?true:false
}
},
async exportData() {
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){
this.$message.success('开始导出');
}

View File

@ -34,7 +34,7 @@
<el-button :size="size" type="info" icon="el-icon-RefreshRight" @click="reset">重置</el-button>
</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>
<sc-table-column label="序号" align="center" type="index"></sc-table-column>
<template #business_status="scope">

View File

@ -58,8 +58,8 @@ export default {
watch:{
data(val){
if(val && val.length>0){
val.forEach(item=>{
item.show = true;
val.forEach((item,index)=>{
item.show = index===0?true:false;
if(item.children){
item.children.forEach(em=>{
if(em.meta.data_permission && em.meta.data_permission.length>0){
@ -248,9 +248,9 @@ export default {
display: flex;
align-items: center;
margin-right: 20px;
width: 120px;
min-width: 120px;
.name{
width: 100px;
//min-width: 100px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;