增加区域配置

This commit is contained in:
龙运模 2024-11-01 20:52:40 +08:00
parent 64863f3594
commit 94f254f49d
13 changed files with 412 additions and 18 deletions

View File

@ -198,6 +198,43 @@ export default {
}, },
} }
}, },
regional:{
list:{
url: `${config.API_URL}/regional.address.list`,
name: "区域信息列表",
get: async function (data) {
return await http.post(this.url, data);
},
},
add:{
url: `${config.API_URL}/regional.address.add`,
name: "区域新增",
post: async function (data) {
return await http.post(this.url, data);
},
},
delete:{
url: `${config.API_URL}/regional.address.delete`,
name: "区域删除",
post: async function (data) {
return await http.post(this.url, data);
},
},
sourceList:{
url: `${config.API_URL}/data.source.list`,
name: "区域信息数据来源常量列表",
post: async function (data) {
return await http.post(this.url, data);
},
},
regionalList:{
url: `${config.API_URL}/regional.info.list`,
name: "区域信息常量列表",
post: async function (data) {
return await http.post(this.url, data);
},
}
},
bom:{ bom:{
list:{ list:{
url: `${config.API_URL}/bom.list`, url: `${config.API_URL}/bom.list`,

View File

@ -500,14 +500,28 @@ export default {
return await http.post(this.url, params); return await http.post(this.url, params);
}, },
}, },
field:{
url: `${config.API_URL}/sys.log.operation.field.list`,
name: "操作日志选择列表",
post: async function (params) {
return await http.post(this.url, params);
},
},
export:{ export:{
url: `${config.API_URL}/sys.log.export`, url: `${config.API_URL}/sys.log.export`,
name: "操作日志导出", name: "操作日志导出",
post: async function (params) { post: async function (params) {
return await http.post(this.url,params); return await http.post(this.url,params);
} }
},
commandExport:{
url: `${config.API_URL}/sys.log.command.export`,
name: "操作日志命令导出",
post: async function (params) {
return await http.post(this.url,params);
} }
}, },
},
table: { table: {
list: { list: {
url: `${config.API_URL}/system/table/list`, url: `${config.API_URL}/system/table/list`,
@ -585,6 +599,27 @@ export default {
return await http.post(this.url, params); return await http.post(this.url, params);
}, },
}, },
export:{
url: `${config.API_URL}/spare.parts.export`,
name: "备件导出",
post: async function (params) {
return await http.post(this.url, params);
}
},
template:{
url: `${config.API_URL}/spare.parts.import.template`,
name: "备件导入模版",
post: async function (params) {
return await http.get(this.url,params,{responseType: 'arraybuffer'});
}
},
import:{
url: `${config.API_URL}/spare.parts.import`,
name: "备件导入",
post: async function (params) {
return await http.post(this.url,params,{'Content-Type': 'multipart/form-data'});
}
},
}, },
spareInfo:{ spareInfo:{
list: { list: {
@ -622,5 +657,26 @@ export default {
return await http.post(this.url, params); return await http.post(this.url, params);
}, },
}, },
export:{
url: `${config.API_URL}/spare.parts.info.export`,
name: "备件信息导出",
post: async function (params) {
return await http.post(this.url, params);
}
},
template:{
url: `${config.API_URL}/spare.parts.info.import.template`,
name: "备件信息导入模版",
post: async function (params) {
return await http.get(this.url,params,{responseType: 'arraybuffer'});
}
},
import:{
url: `${config.API_URL}/spare.parts.info.import`,
name: "备件信息导入",
post: async function (params) {
return await http.post(this.url,params,{'Content-Type': 'multipart/form-data'});
}
},
} }
}; };

View File

@ -0,0 +1,13 @@
<template>
<svg t="1730427990132" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="6286" width="200" height="200"><path d="M284.387556 261.688889c-25.656889 0-45.511111 13.084444-45.511112 34.702222 0 19.456 18.204444 33.564444 45.511112 33.564445h364.088888c9.159111 0 45.738667-5.233778 45.738667-34.929778 0-24.234667-31.118222-33.393778-45.738667-33.393778h-364.088888z m0 204.743111c-17.123556 0-45.511111 10.524444-45.511112 34.133333 0 20.081778 24.576 34.133333 45.511112 34.133334h136.533333c25.941333 0 45.226667-14.336 45.226667-34.417778 0-15.758222-14.791111-33.848889-45.226667-33.848889H284.444444z m113.777777 432.298667H216.177778c-62.008889 0-91.022222-42.780444-91.022222-91.022223V216.177778c0-60.472889 43.235556-91.022222 91.022222-91.022222h500.622222c47.786667 0 90.965333 42.780444 90.965333 91.022222V398.222222c0 22.926222 15.36 44.999111 34.702223 44.999111 18.773333 0 33.564444-22.186667 33.564444-45.056V193.422222C875.975111 124.757333 811.121778 56.888889 742.968889 56.888889H193.422222C125.269333 56.888889 56.888889 124.700444 56.888889 193.422222v643.982222c0 68.721778 68.437333 129.592889 136.533333 129.592889H398.222222c5.006222 0.967111 23.153778-2.616889 22.983111-35.555555-0.113778-27.704889-23.04-32.711111-23.04-32.711111z m391.168-125.155556a166.684444 166.684444 0 0 0 41.358223-179.825778C807.082667 530.773333 748.202667 489.244444 682.666667 489.244444c-65.592889 0-124.472889 41.528889-148.081778 104.504889a167.139556 167.139556 0 0 0 27.989333 165.774223 16.896 16.896 0 0 1-2.844444 24.576A224.597333 224.597333 0 0 0 466.488889 957.553778a9.045333 9.045333 0 0 0 8.817778 9.443555h53.077333a9.102222 9.102222 0 0 0 8.817778-8.760889c4.551111-79.189333 68.266667-140.970667 145.351111-141.084444 77.596444 0 141.141333 62.691556 145.464889 141.198222a8.931556 8.931556 0 0 0 8.817778 8.533334h53.077333a8.874667 8.874667 0 0 0 8.248889-5.859556 8.988444 8.988444 0 0 0 0.568889-3.584 223.459556 223.459556 0 0 0-109.397334-183.864889zM682.666667 561.834667c50.062222 0 90.396444 42.951111 88.120889 95.004444-2.104889 46.535111-38.741333 84.252444-83.968 86.471111-50.631111 2.389333-92.387556-39.139556-92.387556-90.680889 0-50.176 39.480889-90.794667 88.177778-90.794666z" p-id="6287"></path></svg>
</template>
<script>
export default {
name: "Customer"
}
</script>
<style scoped>
</style>

View File

@ -0,0 +1,13 @@
<template>
<svg t="1730428009573" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="6428" width="200" height="200"><path d="M440.263111 512a71.68 71.68 0 1 0 143.473778 0 71.68 71.68 0 0 0-143.473778 0z" p-id="6429"></path><path d="M512 967.111111c-250.936889 0-455.111111-204.174222-455.111111-455.111111s204.174222-455.111111 455.111111-455.111111a453.12 453.12 0 0 1 355.384889 170.837333l-44.771556 35.84A396.117333 396.117333 0 0 0 512 114.232889 398.222222 398.222222 0 0 0 114.232889 512 398.222222 398.222222 0 0 0 512 909.767111 398.222222 398.222222 0 0 0 909.653333 512H967.111111c0 250.936889-204.231111 455.111111-455.111111 455.111111z" p-id="6430"></path><path d="M512 815.672889a305.834667 305.834667 0 0 1-305.493333-305.493333c0-168.448 137.045333-305.493333 305.493333-305.493334 93.240889 0 180.224 41.813333 238.535111 114.688l-44.771555 35.84A247.182222 247.182222 0 0 0 512 262.087111a248.433778 248.433778 0 0 0-248.149333 248.092445A248.433778 248.433778 0 0 0 512 758.328889a248.376889 248.376889 0 0 0 248.035556-248.149333h57.457777c0 168.391111-137.102222 305.493333-305.493333 305.493333z" p-id="6431"></path></svg>
</template>
<script>
export default {
name: "region"
}
</script>
<style scoped>
</style>

View File

@ -45,6 +45,8 @@ export { default as MsgSetup } from './MsgSetup.vue'
export { default as MsgReview } from './MsgReview.vue' export { default as MsgReview } from './MsgReview.vue'
export { default as SmallBell } from './SmallBell.vue' export { default as SmallBell } from './SmallBell.vue'
export { default as Right } from './Right.vue' export { default as Right } from './Right.vue'
export { default as Customer } from './Customer.vue'
export { default as Region } from './Region.vue'
export { default as File7z } from './file/7z.vue' export { default as File7z } from './file/7z.vue'
export { default as FileBmp } from './file/Bmp.vue' export { default as FileBmp } from './file/Bmp.vue'

View File

@ -41,7 +41,7 @@ export default {
}, },
data(){ data(){
return{ return{
list:[{},{},{},{},{},{}], list:[{},{},{},{},{},{},{},{}],
} }
}, },
setup(){ setup(){
@ -56,7 +56,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)){ 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)){
let item = { let item = {
type:res.data.type, type:res.data.type,
type_desc:res.data.type_desc, type_desc:res.data.type_desc,
@ -82,6 +82,12 @@ export default {
if(res.data.type == 20){ if(res.data.type == 20){
this.list[5] = item; this.list[5] = item;
} }
if(res.data.type == 29){
this.list[6] = item;
}
if(res.data.type == 30){
this.list[7] = item;
}
this.$emit('updateShow', item); this.$emit('updateShow', item);
if(res.data.status==1){ if(res.data.status==1){

View File

@ -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)){ 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)){
this.importInfo = res.data; this.importInfo = res.data;
this.progressShow = true; this.progressShow = true;
if(res.data.status == 0){ if(res.data.status == 0){

View File

@ -49,6 +49,7 @@ export default {
cost: defineAsyncComponent(() => import('./setup/cost')), cost: defineAsyncComponent(() => import('./setup/cost')),
material: defineAsyncComponent(() => import('./setup/material')), material: defineAsyncComponent(() => import('./setup/material')),
company: defineAsyncComponent(() => import('./setup/company')), company: defineAsyncComponent(() => import('./setup/company')),
region: defineAsyncComponent(() => import('./setup/region')),
}, },
data() { data() {
return { return {
@ -88,11 +89,17 @@ export default {
actions:'crontabAdd' actions:'crontabAdd'
}, },
{ {
icon: "sc-icon-RegularTime", icon: "sc-icon-Customer",
title: "客户资料维护", title: "客户资料维护",
component: "company", component: "company",
actions:'crontabAdd' actions:'crontabAdd'
}, },
{
icon: "sc-icon-Region",
title: "区域地址配置",
component: "region",
actions:'crontabAdd'
},
] ]
}, },
{ {

View File

@ -0,0 +1,132 @@
<template>
<el-container class="mainBox">
<el-main class="nopadding">
<div class="searchMain">
<scSearch ref="scSearch" :searchList="searchList" @fetchSelectData="getSelectData"></scSearch>
<div class="searchItem searchBtn">
<el-button :size="size" type="primary" @click="save">保存配置</el-button>
</div>
</div>
<scTable ref="table" :apiObj="list.apiObj" :column="list.column" stripe :size="size" highlightCurrentRow :hideDo="true" >
<sc-table-column label="序号" align="center" type="index"></sc-table-column>
<!-- <el-table-column width="380" label="客户名称" prop="customer_name">-->
<!-- <template #default="scope">-->
<!-- <div v-if="scope.row.$edit_show">-->
<!-- <el-input type="text" :size="size" v-model="scope.row.customer_name" @change="customerInput(scope.row)" @mouseout="customerOut(scope.row)"></el-input>-->
<!-- </div>-->
<!-- <span class="customerView" @click="customerEdit(scope.row)" v-else>{{scope.row.customer_name}} <el-icon class="iconBtn"><sc-icon-edit/></el-icon></span>-->
<!-- </template>-->
<!-- </el-table-column>-->
<!-- <el-table-column width="100" label="状态" prop="active_status">-->
<!-- <template #default="scope">-->
<!-- <el-switch :size="size" v-model="scope.row.active_status" @change="changeSwitch($event, scope.row)" :loading="scope.row.$switch_status" :active-value="true" :inactive-value="false"></el-switch>-->
<!-- </template>-->
<!-- </el-table-column>-->
<el-table-column label="操作" fixed="right" align="center" width="160">
<template #default="scope">
<el-dropdown>
<el-button class="noBorderBtn" icon="el-icon-more" :size="size"></el-button>
<template #dropdown>
<el-dropdown-menu>
<el-dropdown-item @click="table_del(scope.row, 'delete')" icon="sc-icon-Delete">删除配置</el-dropdown-item>
</el-dropdown-menu>
</template>
</el-dropdown>
</template>
</el-table-column>
</scTable>
</el-main>
</el-container>
</template>
<script>
export default {
name: "region",
data(){
return{
size:'small',
list:{
apiObj: this.$API.setup.regional.list,
column:[]
},
params: {},
searchList:[
{customer_name:'客户名称',type:'text',code:'customer_name', placeholder:"请输入客户名称",show:true},
],
}
},
mounted() {
},
methods:{
getSelectData(item){
let {params} = item;
this.params = params;
},
//
changeSwitch(val, row) {
row.$switch_yx = true;
setTimeout(async () => {
let params = {
id: row.id,
active_status: row.active_status,
};
const res = await this.$API.setup.customer.status.post(params);
if(res.code !=200){
row.active_status = !row.active_status;
}
delete row.$switch_status;
delete row.$switch_yx;
}, 500);
},
//
customerEdit(row){
row.$edit_show = !row.$edit_show;
},
customerOut(row){
setTimeout(()=>{
row.$edit_show = false;
},1000)
},
async customerInput(row) {
let params = {
id:row.id,
customer_name:row.customer_name
}
const res = await this.$API.setup.customer.add.post(params);
if(res.code == 200){
this.$refs.table.refresh();
}
},
async save() {
const res = await this.$API.setup.customer.add.post(this.params);
if(res.code == 200){
this.$refs.table.refresh();
}
},
async table_del(row){
this.$confirm(`确定删除 ${row.customer_name} 吗?`, '提示', {
type: 'warning'
}).then(async () => {
const reqData = {id: row.id};
const res = await this.$API.setup.customer.delete.post(reqData);
if(res.code == 200){
this.$refs.table.refresh();
this.$message.success("删除成功")
}
}).catch(()=>{})
},
}
}
</script>
<style scoped lang="scss">
.customerView{
display: flex;
align-items: center;
.iconBtn{
margin-left: 6px;
}
}
</style>

View File

@ -7,6 +7,9 @@
<div class="searchItem searchBtn"> <div class="searchItem searchBtn">
<el-button :size="size" type="primary" icon="el-icon-search" @click="upSearch">查询</el-button> <el-button :size="size" type="primary" icon="el-icon-search" @click="upSearch">查询</el-button>
<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>
<scExport :size="size" @exportData="exportData" @updateShow="exportChangeShow" :show="exportShow" type="8">
<el-button v-auth="'sysLogCommandExport'" :size="size" icon="sc-icon-Download" @click="exportData">下载</el-button>
</scExport>
</div> </div>
</div> </div>
<scTable ref="table" :apiObj="list.apiObj" :column="list.column" stripe :size="size" highlightCurrentRow @row-click="rowClick"> <scTable ref="table" :apiObj="list.apiObj" :column="list.column" stripe :size="size" highlightCurrentRow @row-click="rowClick">
@ -32,7 +35,6 @@ export default {
setMap:{ setMap:{
name:[] name:[]
}, },
infoDrawer: false, infoDrawer: false,
date: [], date: [],
list:{ list:{
@ -52,6 +54,19 @@ export default {
let {params} = item; let {params} = item;
this.params = params; this.params = params;
}, },
//
exportChangeShow(params){
if(params.type == 8){
this.exportShow = params.status==0?true:false
}
},
async exportData() {
if(this.exportShow) return
const res = await this.$API.system.log.commandExport.post(this.params);
if(res.code == 200){
this.$message.success('开始导出');
}
},
upSearch(){ upSearch(){
this.$refs.table.upData(this.params); this.$refs.table.upData(this.params);
}, },

View File

@ -2,12 +2,21 @@
<el-container class="mainBox mainHeaderNoBorderPadding"> <el-container class="mainBox mainHeaderNoBorderPadding">
<el-header> <el-header>
<div class="left-panel"> <div class="left-panel">
<el-button type="primary" :size="size" icon="el-icon-plus" @click="add">新增备件信息</el-button> <el-button type="primary" v-auth="'sparePartsInfoAdd'" :size="size" icon="el-icon-plus" @click="add">新增备件信息</el-button>
<el-button type="primary" :size="size" plain>批量导入</el-button> <el-button type="danger" v-auth="'sparePartsInfoDelete'" :size="size" plain @click="batch_del" :disabled="selection.length==0?true:false">删除</el-button>
<el-button type="danger" :size="size" plain @click="batch_del" :disabled="selection.length==0?true:false">删除</el-button> <scImport ref="scImport" :size="size" title="批量导入" @parentParams="importUpload" @importSuccess="importSuccess">
<template #header>
<el-button v-auth="'sparePartsInfoImport'" type="primary" :size="size" plain @click="importFile">批量导入</el-button>
</template>
<template #download>
<div v-auth="'sparePartsInfoImportTemplate'" @click="importTemplate">下载导入模版</div>
</template>
</scImport>
</div> </div>
<div class="right-panel"> <div class="right-panel">
<scExport :size="size" @exportData="exportData" @updateShow="exportChangeShow" :show="exportShow" type="30">
<el-button :size="size" v-auth="'sparePartsInfoExport'" icon="sc-icon-Download" @click="exportData">下载</el-button>
</scExport>
</div> </div>
</el-header> </el-header>
<el-main class="nopadding"> <el-main class="nopadding">
@ -30,8 +39,12 @@
<template #dropdown> <template #dropdown>
<el-dropdown-menu> <el-dropdown-menu>
<el-dropdown-item @click="table_show(scope.row, 'see')" icon="sc-icon-See">查看详情</el-dropdown-item> <el-dropdown-item @click="table_show(scope.row, 'see')" icon="sc-icon-See">查看详情</el-dropdown-item>
<span v-auth="'sparePartsInfoAdd'">
<el-dropdown-item @click="table_edit(scope.row, 'edit')" icon="sc-icon-Edit">编辑</el-dropdown-item> <el-dropdown-item @click="table_edit(scope.row, 'edit')" icon="sc-icon-Edit">编辑</el-dropdown-item>
</span>
<span v-auth="'sparePartsInfoDelete'">
<el-dropdown-item divided @click="table_del(scope.row, 'delete')" icon="sc-icon-Delete">删除</el-dropdown-item> <el-dropdown-item divided @click="table_del(scope.row, 'delete')" icon="sc-icon-Delete">删除</el-dropdown-item>
</span>
</el-dropdown-menu> </el-dropdown-menu>
</template> </template>
</el-dropdown> </el-dropdown>
@ -76,6 +89,7 @@ export default {
{name:'关键字',type:'text',code:['remark','name'],keyword:true,show:true}, {name:'关键字',type:'text',code:['remark','name'],keyword:true,show:true},
], ],
searchShow:false, searchShow:false,
exportShow:false,
params: {} params: {}
} }
}, },
@ -125,6 +139,34 @@ export default {
this.$refs.saveDialog.open('add'); this.$refs.saveDialog.open('add');
}) })
}, },
//
importFile(){
this.$nextTick(()=>{
this.$refs.scImport.importFile();
})
},
async importTemplate() {
const res = await this.$API.system.spareInfo.template.post();
const blob = new Blob([res]);
const text = new Date().getTime();
const eLink = document.createElement('a');
eLink.download = "备件信息导入模版_"+text+'.xlsx';
eLink.style.display = 'none';
eLink.href = URL.createObjectURL(blob);
document.body.appendChild(eLink);
eLink.click();
URL.revokeObjectURL(eLink.href);
document.body.removeChild(eLink);
},
async importUpload(params) {
const res = await this.$API.system.spareInfo.import.post(params);
if(res.code == 200){
this.$message.success('上传成功,开始导入数据');
}
},
importSuccess(){
this.$refs.table.refresh()
},
// //
table_edit(row){ table_edit(row){
this.dialog.save = true this.dialog.save = true
@ -178,6 +220,19 @@ export default {
selectionChange(selection){ selectionChange(selection){
this.selection = selection; this.selection = selection;
}, },
//
exportChangeShow(params){
if(params.type == 30){
this.exportShow = params.status==0?true:false
}
},
async exportData() {
if(this.exportShow) return
const res = await this.$API.system.spareInfo.export.post(this.params);
if(res.code == 200){
this.$message.success('开始导出');
}
},
// //
upSearch(){ upSearch(){
this.$refs.table.upData(this.params); this.$refs.table.upData(this.params);

View File

@ -2,12 +2,21 @@
<el-container class="mainBox mainHeaderNoBorderPadding"> <el-container class="mainBox mainHeaderNoBorderPadding">
<el-header> <el-header>
<div class="left-panel"> <div class="left-panel">
<el-button type="primary" :size="size" icon="el-icon-plus" @click="add">新增备件</el-button> <el-button type="primary" v-auth="'sparePartsAdd'" :size="size" icon="el-icon-plus" @click="add">新增备件</el-button>
<el-button type="primary" :size="size" plain>批量导入</el-button> <el-button type="danger" v-auth="'sparePartsDelete'" :size="size" plain @click="batch_del" :disabled="selection.length==0?true:false">删除</el-button>
<el-button type="danger" :size="size" plain @click="batch_del" :disabled="selection.length==0?true:false">删除</el-button> <scImport ref="scImport" :size="size" title="批量导入" @parentParams="importUpload" @importSuccess="importSuccess">
<template #header>
<el-button v-auth="'sparePartsImport'" type="primary" :size="size" plain @click="importFile">批量导入</el-button>
</template>
<template #download>
<div v-auth="'sparePartsImportTemplate'" @click="importTemplate">下载导入模版</div>
</template>
</scImport>
</div> </div>
<div class="right-panel"> <div class="right-panel">
<scExport :size="size" @exportData="exportData" @updateShow="exportChangeShow" :show="exportShow" type="29">
<el-button :size="size" v-auth="'sparePartsExport'" icon="sc-icon-Download" @click="exportData">下载</el-button>
</scExport>
</div> </div>
</el-header> </el-header>
<el-main class="nopadding"> <el-main class="nopadding">
@ -30,8 +39,12 @@
<template #dropdown> <template #dropdown>
<el-dropdown-menu> <el-dropdown-menu>
<el-dropdown-item @click="table_show(scope.row, 'see')" icon="sc-icon-See">查看详情</el-dropdown-item> <el-dropdown-item @click="table_show(scope.row, 'see')" icon="sc-icon-See">查看详情</el-dropdown-item>
<span v-auth="'sparePartsAdd'">
<el-dropdown-item @click="table_edit(scope.row, 'edit')" icon="sc-icon-Edit">编辑备件</el-dropdown-item> <el-dropdown-item @click="table_edit(scope.row, 'edit')" icon="sc-icon-Edit">编辑备件</el-dropdown-item>
</span>
<span v-auth="'sparePartsDelete'">
<el-dropdown-item divided @click="table_del(scope.row, 'delete')" icon="sc-icon-Delete">删除备件</el-dropdown-item> <el-dropdown-item divided @click="table_del(scope.row, 'delete')" icon="sc-icon-Delete">删除备件</el-dropdown-item>
</span>
</el-dropdown-menu> </el-dropdown-menu>
</template> </template>
</el-dropdown> </el-dropdown>
@ -78,6 +91,7 @@ export default {
{name:'关键字',type:'text',code:['remark','erp_pn'],keyword:true,show:true}, {name:'关键字',type:'text',code:['remark','erp_pn'],keyword:true,show:true},
], ],
searchShow:false, searchShow:false,
exportShow:false,
params: {} params: {}
} }
}, },
@ -127,6 +141,35 @@ export default {
this.$refs.saveDialog.open('add'); this.$refs.saveDialog.open('add');
}) })
}, },
//
importFile(){
this.$nextTick(()=>{
this.$refs.scImport.importFile();
})
},
async importTemplate() {
const res = await this.$API.system.spare.template.post();
const blob = new Blob([res]);
const text = new Date().getTime();
const eLink = document.createElement('a');
eLink.download = "备件导入模版_"+text+'.xlsx';
eLink.style.display = 'none';
eLink.href = URL.createObjectURL(blob);
document.body.appendChild(eLink);
eLink.click();
URL.revokeObjectURL(eLink.href);
document.body.removeChild(eLink);
},
async importUpload(params) {
const res = await this.$API.system.spare.import.post(params);
if(res.code == 200){
this.$message.success('上传成功,开始导入数据');
}
},
importSuccess(){
this.$refs.table.refresh()
},
// //
table_edit(row){ table_edit(row){
this.dialog.save = true this.dialog.save = true
@ -173,6 +216,20 @@ export default {
selectionChange(selection){ selectionChange(selection){
this.selection = selection; this.selection = selection;
}, },
//
exportChangeShow(params){
if(params.type == 29){
this.exportShow = params.status==0?true:false
}
},
async exportData() {
if(this.exportShow) return
const res = await this.$API.system.spare.export.post(this.params);
if(res.code == 200){
this.$message.success('开始导出');
}
},
// //
upSearch(){ upSearch(){
this.$refs.table.upData(this.params); this.$refs.table.upData(this.params);

View File

@ -457,6 +457,7 @@
.userTree{ .userTree{
position: relative; position: relative;
width: 100%; width: 100%;
font-size: var(--el-font-size-small);
.btnBox{ .btnBox{
position: absolute;right: 10px;top: 2px; position: absolute;right: 10px;top: 2px;
.btn{margin: 0 3px;} .btn{margin: 0 3px;}