修改备件信息

This commit is contained in:
龙运模 2024-10-29 22:56:03 +08:00
parent 5c50d94dfa
commit 1be8d2fbcf
6 changed files with 443 additions and 407 deletions

View File

@ -544,5 +544,42 @@ export default {
}
}
},
spare:{
list: {
url: `${config.API_URL}/spare.parts.list`,
name: "备件列表",
get: async function (params) {
return await http.post(this.url, params);
},
},
add:{
url: `${config.API_URL}/spare.parts.add`,
name: "新增备件",
post: async function (params) {
return await http.post(this.url, params);
},
},
info:{
url: `${config.API_URL}/spare.parts.info`,
name: "备件明细",
post: async function (params) {
return await http.post(this.url, params);
},
},
delete:{
url: `${config.API_URL}/spare.parts.delete`,
name: "删除备件",
post: async function (params) {
return await http.post(this.url, params);
},
},
field:{
url: `${config.API_URL}/spare.parts.field.list`,
name: "备件检索",
post: async function (params) {
return await http.post(this.url, params);
},
},
}
};

View File

@ -67,250 +67,101 @@ const routes = [
}
}]
},
{
name: "order",
path: "/order",
meta: {
icon: "sc-icon-order",
title: "维保工单",
hidden: true
},
children: [{
name: "order",
path: "/order",
component: "order/workOrder",
meta: {
icon: "sc-icon-Console",
title: "维保工单",
}
},{
name: "plan",
path: "/plan",
component: "userCenter",
meta: {
icon: "sc-icon-UserInfo",
title: "维保计划",
}
},{
name: "dataConfirm",
path: "/data-confirm",
component: "userCenter",
meta: {
icon: "sc-icon-UserInfo",
title: "数据确认",
}
}]
},
{
name: "stock",
path: "/stock",
meta: {
icon: "sc-icon-Stock",
title: "库存管理",
hidden:true
},
children: [{
name: "stock",
path: "/stock",
component: "home",
meta: {
icon: "sc-icon-Console",
title: "库存列表",
}
},{
name: "statistics",
path: "/statistics",
component: "userCenter",
meta: {
icon: "sc-icon-UserInfo",
title: "库存统计",
}
},{
name: "accessForm",
path: "/access-form",
component: "userCenter",
meta: {
icon: "sc-icon-UserInfo",
title: "出入记录",
}
}]
},
{
name: "sell",
path: "/sell",
meta: {
icon: "sc-icon-Shipment",
title: "出货管理",
hidden:true
},
children: [{
name: "shipment",
path: "/shipment",
component: "home",
meta: {
icon: "sc-icon-Console",
title: "出货清单",
}
},{
name: "shipmentStatistics",
path: "/shipment-statistics",
component: "userCenter",
meta: {
icon: "sc-icon-UserInfo",
title: "出货统计",
}
},{
name: "shipmentConfirm",
path: "/shipment-confirm",
component: "userCenter",
meta: {
icon: "sc-icon-UserInfo",
title: "数据确认",
}
}]
},
{
name: "finance",
path: "/finance",
meta: {
icon: "sc-icon-Finance",
title: "财务管理",
hidden:true
},
children: [{
name: "finance",
path: "/finance",
component: "home",
meta: {
icon: "sc-icon-Console",
title: "费用成本",
}
},{
name: "financeSummary",
path: "/finance-summary",
component: "userCenter",
meta: {
icon: "sc-icon-UserInfo",
title: "成本汇总",
}
}]
},
{
name: "report",
path: "/report",
meta: {
icon: "sc-icon-ReportForms",
title: "报表统计",
hidden:true
},
children: [{
name: "report",
path: "/report",
component: "home",
meta: {
icon: "sc-icon-Console",
title: "维保报表",
}
},{
name: "outReport",
path: "/out-report",
component: "userCenter",
meta: {
icon: "sc-icon-UserInfo",
title: "出货报表",
}
}]
},
{
name: "setting",
path: "/setting",
meta: {
icon: "sc-icon-Setup",
title: "系统设置",
hidden: true
},
children: [{
name: "system",
path: "/setting/system",
component: "setting/system",
meta: {
icon: "sc-icon-System",
title: "系统设置",
}
},{
name: "userManage",
path: "/setting/user",
component: "setting/user",
meta: {
icon: "sc-icon-UserManage",
title: "用户管理",
}
},{
name: "role",
path: "/setting/role",
component: "setting/role",
meta: {
icon: "sc-icon-RoleManage",
title: "角色管理",
}
},{
name: "dept",
path: "/setting/dept",
component: "setting/dept",
meta: {
icon: "sc-icon-DeptManage",
title: "部门管理",
}
},{
name: "log",
path: "/setting/log",
component: "setting/log",
meta: {
icon: "sc-icon-Log",
title: "系统日志",
}
},{
name: "client",
path: "/setting/client",
component: "setting/client",
meta: {
icon: "sc-icon-Application",
title: "应用管理",
}
},{
name: "dic",
path: "/setting/dic",
component: "setting/dic",
meta: {
icon: "sc-icon-Dictionary",
title: "字典管理",
}
},{
name: "menu",
path: "/setting/menu",
component: "setting/menu",
meta: {
icon: "sc-icon-MenuManage",
title: "菜单管理",
}
},{
name: "table",
path: "/setting/table",
component: "setting/table",
meta: {
icon: "sc-icon-TableManage",
title: "表格管理",
}
},{
name: "task",
path: "/setting/task",
component: "setting/task",
meta: {
icon: "sc-icon-TaskManage",
title: "任务管理",
}
}]
},
// {
// name: "setting",
// path: "/setting",
// meta: {
// icon: "sc-icon-Setup",
// title: "系统设置",
// hidden: true
// },
// children: [{
// name: "system",
// path: "/setting/system",
// component: "setting/system",
// meta: {
// icon: "sc-icon-System",
// title: "系统设置",
// }
// },{
// name: "user",
// path: "/setting/user",
// component: "setting/user",
// meta: {
// icon: "sc-icon-UserManage",
// title: "用户管理",
// }
// },{
// name: "role",
// path: "/setting/role",
// component: "setting/role",
// meta: {
// icon: "sc-icon-RoleManage",
// title: "角色管理",
// }
// },{
// name: "dept",
// path: "/setting/dept",
// component: "setting/dept",
// meta: {
// icon: "sc-icon-DeptManage",
// title: "部门管理",
// }
// },{
// name: "log",
// path: "/setting/log",
// component: "setting/log",
// meta: {
// icon: "sc-icon-Log",
// title: "系统日志",
// }
// },{
// name: "client",
// path: "/setting/client",
// component: "setting/client",
// meta: {
// icon: "sc-icon-Application",
// title: "应用管理",
// }
// },{
// name: "dic",
// path: "/setting/dic",
// component: "setting/dic",
// meta: {
// icon: "sc-icon-Dictionary",
// title: "字典管理",
// }
// },{
// name: "menu",
// path: "/setting/menu",
// component: "setting/menu",
// meta: {
// icon: "sc-icon-MenuManage",
// title: "菜单管理",
// }
// },{
// name: "table",
// path: "/setting/table",
// component: "setting/table",
// meta: {
// icon: "sc-icon-TableManage",
// title: "表格管理",
// }
// },{
// name: "task",
// path: "/setting/task",
// component: "setting/task",
// meta: {
// icon: "sc-icon-TaskManage",
// title: "任务管理",
// }
// }]
// },
{
name: "other",
path: "/other",

View File

@ -0,0 +1,116 @@
<template>
<div></div>
</template>
<script>
export default {
name: "info",
data(){
return{
size:'small',
setMap:{
status:[]
},
dialog: {
save: false,
permission: false
},
list:{
apiObj: this.$API.system.spare.list,
column:[]
},
selection: [],
params: {
keyword: null
}
}
},
mounted() {
},
methods:{
//
add(){
this.dialog.save = true
this.$nextTick(() => {
this.$refs.saveDialog.open()
})
},
//
table_edit(row){
this.dialog.save = true
this.$nextTick(() => {
this.$refs.saveDialog.open('edit').setData(row)
})
},
//
table_show(row){
this.dialog.save = true
this.$nextTick(() => {
this.$refs.saveDialog.open('show').setData(row)
})
},
//
permission(){
this.dialog.permission = true
this.$nextTick(() => {
this.$refs.permissionDialog.open()
})
},
//
async table_del(row){
const reqData = {id: row.id};
const res = await this.$API.demo.post.post(reqData);
if(res.code == 200){
this.$refs.table.refresh()
this.$message.success("删除成功")
}
},
//
async batch_del(){
this.$confirm(`确定删除选中的 ${this.selection.length} 项吗?`, '提示', {
type: 'warning'
}).then(() => {
const loading = this.$loading();
this.$refs.table.refresh()
loading.close();
this.$message.success("操作成功")
}).catch(() => {
})
},
//
selectionChange(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(){
},
//
handleSaveSuccess(data, mode){
if(mode=='add'){
this.$refs.table.refresh()
}else if(mode=='edit'){
this.$refs.table.refresh()
}
}
}
}
</script>
<style scoped lang="scss">
</style>

View File

@ -0,0 +1,179 @@
<template>
<el-container class="mainBox mainHeaderNoBorderPadding">
<el-header>
<div class="left-panel">
<el-button type="primary" :size="size" icon="el-icon-plus" @click="add">新增备件</el-button>
<el-button type="primary" :size="size" plain>批量导入</el-button>
<el-button type="danger" :size="size" plain>删除</el-button>
</div>
<div class="right-panel">
</div>
</el-header>
<el-main class="nopadding">
<div class="searchMain searchMainNoTop">
<scSearch ref="scSearch" :searchList="searchList" @fetchSelectData="getSelectData"></scSearch>
<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" type="primary" icon="el-icon-search" @click="upSearch">查询</el-button>
<el-button :size="size" type="info" icon="el-icon-RefreshRight">重置</el-button>
</div>
</div>
<scTable ref="table" :apiObj="list.apiObj" row-key="id" @selection-change="selectionChange" stripe :size="size">
<sc-table-column label="序号" align="center" type="index"></sc-table-column>
<el-table-column label="操作" fixed="right" align="center" width="150">
<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_show(scope.row, 'see')" icon="sc-icon-See">查看详情</el-dropdown-item>
<el-dropdown-item @click="table_edit(scope.row, 'edit')" icon="sc-icon-Edit">编辑</el-dropdown-item>
<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: "library",
data(){
return{
size:'small',
setMap:{
status:[]
},
dialog: {
save: false,
permission: false
},
list:{
apiObj: this.$API.system.spare.list,
column:[]
},
selection: [],
searchList:[
{name:'创建日期',type:'date',code:'activation_date',show:true},
{name:'备件SN',type:'text',code:['mobile'],placeholder:"请输入备件SN",show:true},
{name:'收获城市',type:'text',code:['address'],placeholder:"请输入收获城市",isOpen:true,show:false},
{name:'收获日期',type:'date',code:'activation_date',show:true},
{name:'最终状态',type:'text',code:['owner'],placeholder:"请输入最终状态",isOpen:true,show:false},
{name:'单号',type:'text',code:['owner'],placeholder:"请输入单号",isOpen:true,show:false},
{name:'库房',type:'text',code:['owner'],placeholder:"请输入库房",isOpen:true,show:false},
{name:'FW',type:'text',code:['owner'],placeholder:"请输入FW",isOpen:true,show:false},
{name:'到货类型',type:'text',code:['owner'],placeholder:"请输入到货类型",isOpen:true,show:false},
{name:'关键字',type:'text',code:['remark','erp_pn'],keyword:true,show:true},
],
searchShow:false,
params: {
keyword: null
}
}
},
mounted() {
},
methods:{
searchShowClick(){
this.searchShow = !this.searchShow;
this.searchList.forEach(item=>{
if(item.isOpen){
item.show = this.searchShow
}
})
},
getSelectData(){
},
//
add(){
this.dialog.save = true
this.$nextTick(() => {
this.$refs.saveDialog.open()
})
},
//
table_edit(row){
this.dialog.save = true
this.$nextTick(() => {
this.$refs.saveDialog.open('edit').setData(row)
})
},
//
table_show(row){
this.dialog.save = true
this.$nextTick(() => {
this.$refs.saveDialog.open('show').setData(row)
})
},
//
permission(){
this.dialog.permission = true
this.$nextTick(() => {
this.$refs.permissionDialog.open()
})
},
//
async table_del(row){
const reqData = {id: row.id};
const res = await this.$API.demo.post.post(reqData);
if(res.code == 200){
this.$refs.table.refresh()
this.$message.success("删除成功")
}
},
//
async batch_del(){
this.$confirm(`确定删除选中的 ${this.selection.length} 项吗?`, '提示', {
type: 'warning'
}).then(() => {
const loading = this.$loading();
this.$refs.table.refresh()
loading.close();
this.$message.success("操作成功")
}).catch(() => {
})
},
//
selectionChange(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(){
this.$refs.table.refresh();
},
//
handleSaveSuccess(data, mode){
if(mode=='add'){
this.$refs.table.refresh()
}else if(mode=='edit'){
this.$refs.table.refresh()
}
}
}
}
</script>
<style scoped lang="scss">
.mainBox{padding: 0;}
</style>

View File

@ -1,182 +1,35 @@
<template>
<el-container class="mainBox mainHeaderNoBorderPadding">
<el-header>
<div class="left-panel">
<el-button type="primary" :size="size" icon="el-icon-plus" @click="add">新增备件</el-button>
<el-button type="primary" :size="size" plain>批量导入</el-button>
</div>
<div class="right-panel">
<el-main class="tabsMain">
<el-tabs tab-position="top" class="tabsPadding" v-model="tabsTrue" @tab-change="tabsChange">
<el-tab-pane label="备件库" name="library">
<library v-if="tabsTrue == 'library'"></library>
</el-tab-pane>
</div>
</el-header>
<el-main class="nopadding">
<div class="searchMain searchMainNoTop">
<div class="searchItem">
<label class="name">操作时间</label>
<el-date-picker class="input" type="daterange" :size="size" v-model="params.keyword" :popper-options="{ placement: 'bottom-start' }" value-format="yyyy-MM-dd" start-placeholder="开始日期" end-placeholder="结束日期" clearable></el-date-picker>
</div>
<div class="searchItem">
<label class="name">物料编码</label>
<el-input class="input" :size="size" v-model="params.keyword" placeholder="请输入物料编码" clearable></el-input>
</div>
<div class="searchItem">
<label class="name">物料名称</label>
<el-input class="input" :size="size" v-model="params.keyword" placeholder="请输入物料名称" clearable></el-input>
</div>
<div class="searchItem">
<label class="name">规格型号</label>
<el-input class="input" :size="size" v-model="params.keyword" placeholder="请输入规格型号" clearable></el-input>
</div>
<div class="searchItem searchBtn">
<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>
</div>
</div>
<scTable ref="table" :apiObj="list.apiObj" row-key="id" @selection-change="selectionChange" stripe :size="size">
<sc-table-column label="序号" align="center" type="index"></sc-table-column>
<el-table-column label="工单号" prop="order_sn" width="150"></el-table-column>
<el-table-column label="别名" prop="alias" width="200"></el-table-column>
<el-table-column label="排序" prop="sort" width="80"></el-table-column>
<el-table-column label="创建时间" prop="date" width="180"></el-table-column>
<el-table-column label="状态" prop="status" width="80">
<template #default="scope">
<el-switch v-model="scope.row.status" :size="size" @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="备注" prop="remark" min-width="150"></el-table-column>
<el-table-column label="操作" fixed="right" align="center" width="150">
<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_show(scope.row, 'see')" icon="sc-icon-See">查看详情</el-dropdown-item>
<el-dropdown-item @click="table_edit(scope.row, 'edit')" icon="sc-icon-Edit">编辑</el-dropdown-item>
<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-tab-pane label="备件信息" name="info">
<info v-if="tabsTrue == 'info'"></info>
</el-tab-pane>
</el-tabs>
</el-main>
</el-container>
<!-- <save-dialog v-if="dialog.save" ref="saveDialog" @success="handleSaveSuccess" @closed="dialog.save=false"></save-dialog>-->
<!-- <permission-dialog v-if="dialog.permission" ref="permissionDialog" @closed="dialog.permission=false"></permission-dialog>-->
</template>
<script>
// import saveDialog from './save'
// import permissionDialog from './permission'
import library from './components/library'
import info from './components/info'
export default {
name: 'parts',
components: {
// saveDialog,
// permissionDialog
library,
info
},
data() {
return {
size:'small',
setMap:{
status:[]
},
dialog: {
save: false,
permission: false
},
list:{
apiObj: {},
column:[]
},
selection: [],
params: {
keyword: null
}
tabsTrue:'library',
}
},
methods: {
//
add(){
this.dialog.save = true
this.$nextTick(() => {
this.$refs.saveDialog.open()
})
},
//
table_edit(row){
this.dialog.save = true
this.$nextTick(() => {
this.$refs.saveDialog.open('edit').setData(row)
})
},
//
table_show(row){
this.dialog.save = true
this.$nextTick(() => {
this.$refs.saveDialog.open('show').setData(row)
})
},
//
permission(){
this.dialog.permission = true
this.$nextTick(() => {
this.$refs.permissionDialog.open()
})
},
//
async table_del(row){
const reqData = {id: row.id};
const res = await this.$API.demo.post.post(reqData);
if(res.code == 200){
this.$refs.table.refresh()
this.$message.success("删除成功")
}
},
//
async batch_del(){
this.$confirm(`确定删除选中的 ${this.selection.length} 项吗?`, '提示', {
type: 'warning'
}).then(() => {
const loading = this.$loading();
this.$refs.table.refresh()
loading.close();
this.$message.success("操作成功")
}).catch(() => {
})
},
//
selectionChange(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(){
},
//
handleSaveSuccess(data, mode){
if(mode=='add'){
this.$refs.table.refresh()
}else if(mode=='edit'){
this.$refs.table.refresh()
}
}
}
}
</script>

View File

@ -136,7 +136,7 @@
import deptMagDialog from '/src/views/setting/deptMag/save'
export default {
name:"user",
name:"userMag",
components: {
saveDialog, rePwdDialog, disRoleDialog, reviewDialog, deptMagDialog
},