完善备件管理

This commit is contained in:
龙运模 2024-10-31 13:14:36 +08:00
parent ee057050d1
commit 64863f3594
4 changed files with 132 additions and 111 deletions

View File

@ -17,60 +17,56 @@ const routes = [
}, },
}, },
{ // {
name: "home", // name: "home",
path: "/home", // path: "/home",
meta: { // meta: {
icon: "sc-icon-Home", // icon: "sc-icon-Home",
title: "首页", // title: "首页",
hidden: true // hidden: true
}, // },
children: [{ // children: [{
name: "dashboard", // name: "dashboard",
path: "/dashboard", // path: "/dashboard",
component: "home/console", // component: "home/console",
meta: { // meta: {
icon: "sc-icon-Console", // icon: "sc-icon-Console",
title: "控制台", // title: "控制台",
} // }
},{ // },{
name: "userCenter", // name: "userCenter",
path: "/user-center", // path: "/user-center",
component: "userCenter", // component: "userCenter",
meta: { // meta: {
icon: "sc-icon-UserInfo", // icon: "sc-icon-UserInfo",
title: "个人信息", // title: "个人信息",
} // }
},{ // },{
name: "document", // name: "document",
path: "/document", // path: "/document",
component: "docsManager/index", // component: "docsManager/index",
meta: { // meta: {
icon: "sc-icon-UserInfo", // icon: "sc-icon-UserInfo",
title: "文档管理", // title: "文档管理",
} // }
},{ // },{
name: "earlyWarning", // name: "earlyWarning",
path: "/early-warning", // path: "/early-warning",
component: "earlyManager/index", // component: "earlyManager/index",
meta: { // meta: {
icon: "sc-icon-UserInfo", // icon: "sc-icon-UserInfo",
title: "预警管理", // title: "预警管理",
} // }
},{ // },{
name: "mail", // name: "mail",
path: "/mail", // path: "/mail",
component: "userCenter", // component: "userCenter",
meta: { // meta: {
icon: "sc-icon-UserInfo", // icon: "sc-icon-UserInfo",
title: "我的邮件", // title: "我的邮件",
} // }
}] // }]
}, // },
// { // {
// name: "setting", // name: "setting",

View File

@ -17,7 +17,7 @@
<div class="searchItem searchBtn"> <div class="searchItem searchBtn">
<el-button :size="size" :icon="searchShow?'el-icon-ArrowUpBold':'el-icon-ArrowDownBold'" @click="searchShowClick">{{searchShow?'收起':'更多'}}</el-button> <el-button :size="size" :icon="searchShow?'el-icon-ArrowUpBold':'el-icon-ArrowDownBold'" @click="searchShowClick">{{searchShow?'收起':'更多'}}</el-button>
<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">重置</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" row-key="id" @selection-change="selectionChange" stripe :size="size"> <scTable ref="table" :apiObj="list.apiObj" row-key="id" @selection-change="selectionChange" stripe :size="size">
@ -67,18 +67,16 @@ export default {
selection: [], selection: [],
searchList:[ searchList:[
{name:'创建日期',type:'date',code:'created_at',show:true}, {name:'创建日期',type:'date',code:'created_at',show:true},
{name:'ERP编号',type:'text',code:['sn'],placeholder:"请输入备件SN",show:true}, {name:'ERP编号',type:'select',code:['erp_pn'],data:[],placeholder:"请输入ERP编号",show:true},
{name:'供应商',type:'text',code:['receive_city'],placeholder:"请输入收获城市",isOpen:true,show:false}, {name:'供应商',type:'select',code:['vendor'],data:[],placeholder:"请输入供应商",isOpen:true,show:false},
{name:'名称',type:'date',code:'receive_date',show:true}, {name:'名称',type:'text',code:['name'],data:[],placeholder:"请输入名称",show:true},
{name:'制造商型号',type:'text',code:['final_status'],placeholder:"请输入最终状态",isOpen:true,show:false}, {name:'制造商型号',type:'select',code:['mpn'],data:[],placeholder:"请输入制造商型号",isOpen:true,show:false},
{name:'规格',type:'text',code:['order_number'],placeholder:"请输入单号",isOpen:true,show:false}, {name:'规格',type:'text',code:['specification'],placeholder:"请输入规格",isOpen:true,show:false},
{name:'创建人',type:'text',code:['warehouse'],placeholder:"请输入库房",isOpen:true,show:false}, {name:'创建人',type:'select',code:['creator_name'],data:[], placeholder:"请输入创建人",isOpen:true,show:false},
{name:'关键字',type:'text',code:['remark','erp_pn'],keyword:true,show:true}, {name:'关键字',type:'text',code:['remark','name'],keyword:true,show:true},
], ],
searchShow:false, searchShow:false,
params: { params: {}
keyword: null
}
} }
}, },
mounted() { mounted() {
@ -93,8 +91,31 @@ export default {
} }
}) })
}, },
getSelectData(){ async getSelectData(item){
let {data, params} = item;
this.params = params;
let searchParams = this.$TOOL.objCopy(params);
searchParams.field = ""
if (typeof data.code === 'string') {
searchParams.field = data.code;
} else {
searchParams.field = data.code[0];
}
if (data.type == 'select') {
const res = await this.$API.system.spareInfo.field.post(searchParams);
if (res.code == 200) {
if (res.data && res.data.length > 0) {
res.data.forEach(item => {
item.label = item[data.code];
})
}
this.searchList.forEach(item => {
if (item.code == data.code) {
item.data = res.data;
}
})
}
}
}, },
// //
@ -157,19 +178,14 @@ export default {
selectionChange(selection){ selectionChange(selection){
this.selection = selection; this.selection = selection;
}, },
//
changeSwitch(val, row){
row.status = row.status === '1'?'0':'1'
row.$switch_status = true;
setTimeout(()=>{
delete row.$switch_status;
row.status = val;
this.$message.success("操作成功")
}, 500)
},
// //
upSearch(){ upSearch(){
this.$refs.table.refresh(); this.$refs.table.upData(this.params);
},
reset(){
this.params = {};
this.$refs.scSearch.reload();
this.$refs.table.reload();
}, },
// //

View File

@ -17,10 +17,10 @@
<div class="searchItem searchBtn"> <div class="searchItem searchBtn">
<el-button :size="size" :icon="searchShow?'el-icon-ArrowUpBold':'el-icon-ArrowDownBold'" @click="searchShowClick">{{searchShow?'收起':'更多'}}</el-button> <el-button :size="size" :icon="searchShow?'el-icon-ArrowUpBold':'el-icon-ArrowDownBold'" @click="searchShowClick">{{searchShow?'收起':'更多'}}</el-button>
<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">重置</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" row-key="id" @selection-change="selectionChange" stripe :size="size"> <scTable ref="table" :apiObj="list.apiObj" :column="list.column" row-key="id" @selection-change="selectionChange" stripe :size="size">
<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>
<el-table-column label="操作" fixed="right" align="center" width="150"> <el-table-column label="操作" fixed="right" align="center" width="150">
@ -67,20 +67,18 @@ export default {
selection: [], selection: [],
searchList:[ searchList:[
{name:'创建日期',type:'date',code:'created_at',show:true}, {name:'创建日期',type:'date',code:'created_at',show:true},
{name:'备件SN',type:'text',code:['sn'],placeholder:"请输入备件SN",show:true}, {name:'备件SN',type:'select',code:['sn'],data:[],placeholder:"请输入备件SN",show:true},
{name:'收获城市',type:'text',code:['receive_city'],placeholder:"请输入收获城市",isOpen:true,show:false}, {name:'收获城市',type:'select',code:['receive_city'],data:[],placeholder:"请输入收获城市",isOpen:true,show:false},
{name:'收货日期',type:'date',code:'receive_date',show:true}, {name:'收货日期',type:'date',code:'receive_date',show:true},
{name:'最终状态',type:'text',code:['final_status'],placeholder:"请输入最终状态",isOpen:true,show:false}, {name:'最终状态',type:'select',code:['final_status'],data:[],placeholder:"请输入最终状态",isOpen:true,show:false},
{name:'单号',type:'text',code:['order_number'],placeholder:"请输入单号",isOpen:true,show:false}, {name:'单号',type:'select',code:['order_number'],data:[],placeholder:"请输入单号",isOpen:true,show:false},
{name:'库房',type:'text',code:['warehouse'],placeholder:"请输入库房",isOpen:true,show:false}, {name:'库房',type:'select',code:['warehouse'],data:[],placeholder:"请输入库房",isOpen:true,show:false},
{name:'FW',type:'text',code:['fw'],placeholder:"请输入FW",isOpen:true,show:false}, {name:'FW',type:'select',code:['fw'],data:[],placeholder:"请输入FW",isOpen:true,show:false},
{name:'到货类型',type:'text',code:['delivery_type'],placeholder:"请输入到货类型",isOpen:true,show:false}, {name:'到货类型',type:'select',code:['delivery_type'],data:[],placeholder:"请输入到货类型",isOpen:true,show:false},
{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,
params: { params: {}
keyword: null
}
} }
}, },
mounted() { mounted() {
@ -95,8 +93,31 @@ export default {
} }
}) })
}, },
getSelectData(){ async getSelectData(item) {
let {data, params} = item;
this.params = params;
let searchParams = this.$TOOL.objCopy(params);
searchParams.field = ""
if (typeof data.code === 'string') {
searchParams.field = data.code;
} else {
searchParams.field = data.code[0];
}
if (data.type == 'select') {
const res = await this.$API.system.spare.field.post(searchParams);
if (res.code == 200) {
if (res.data && res.data.length > 0) {
res.data.forEach(item => {
item.label = item[data.code];
})
}
this.searchList.forEach(item => {
if (item.code == data.code) {
item.data = res.data;
}
})
}
}
}, },
// //
@ -120,13 +141,6 @@ export default {
this.$refs.saveDialog.open('show').setData(row); this.$refs.saveDialog.open('show').setData(row);
}) })
}, },
//
permission(){
this.dialog.permission = true
this.$nextTick(() => {
this.$refs.permissionDialog.open();
})
},
// //
async table_del(row){ async table_del(row){
const reqData = {ids: [row.id]}; const reqData = {ids: [row.id]};
@ -159,19 +173,14 @@ export default {
selectionChange(selection){ selectionChange(selection){
this.selection = selection; this.selection = selection;
}, },
//
changeSwitch(val, row){
row.status = row.status === '1'?'0':'1'
row.$switch_status = true;
setTimeout(()=>{
delete row.$switch_status;
row.status = val;
this.$message.success("操作成功")
}, 500)
},
// //
upSearch(){ upSearch(){
this.$refs.table.refresh(); this.$refs.table.upData(this.params);
},
reset(){
this.params = {};
this.$refs.scSearch.reload();
this.$refs.table.reload();
}, },
// //

View File

@ -1,6 +1,6 @@
<template> <template>
<el-main class="tabsMain"> <el-main class="tabsMain">
<el-tabs tab-position="top" class="tabsPadding" v-model="tabsTrue" @tab-change="tabsChange"> <el-tabs tab-position="top" class="tabsPadding" v-model="tabsTrue">
<el-tab-pane label="备件库" name="library"> <el-tab-pane label="备件库" name="library">
<library v-if="tabsTrue == 'library'"></library> <library v-if="tabsTrue == 'library'"></library>
</el-tab-pane> </el-tab-pane>