增加故障率配置
This commit is contained in:
parent
cd8650217c
commit
a2ed86263c
@ -235,6 +235,29 @@ export default {
|
||||
},
|
||||
}
|
||||
},
|
||||
spare:{
|
||||
list:{
|
||||
url: `${config.API_URL}/spare.parts.failure.rate.list`,
|
||||
name: "备件故障率列表",
|
||||
get: async function (data) {
|
||||
return await http.post(this.url, data);
|
||||
},
|
||||
},
|
||||
add:{
|
||||
url: `${config.API_URL}/spare.parts.failure.rate.add`,
|
||||
name: "备件故障率新增",
|
||||
post: async function (data) {
|
||||
return await http.post(this.url, data);
|
||||
},
|
||||
},
|
||||
delete:{
|
||||
url: `${config.API_URL}/spare.parts.failure.rate.delete`,
|
||||
name: "备件故障率删除",
|
||||
post: async function (data) {
|
||||
return await http.post(this.url, data);
|
||||
},
|
||||
},
|
||||
},
|
||||
bom:{
|
||||
list:{
|
||||
url: `${config.API_URL}/bom.list`,
|
||||
|
||||
13
src/assets/icons/SpareParts.vue
Normal file
13
src/assets/icons/SpareParts.vue
Normal file
@ -0,0 +1,13 @@
|
||||
<template>
|
||||
<svg t="1730727538738" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5938" width="200" height="200"><path d="M802.816 975.075556H189.383111a148.48 148.48 0 0 1-148.366222-148.48V331.946667a148.48 148.48 0 0 1 148.366222-148.423111h613.432889a148.48 148.48 0 0 1 148.423111 148.423111v494.648889a148.48 148.48 0 0 1-148.423111 148.48zM189.383111 242.915556c-49.038222 0-89.031111 39.936-89.031111 89.031111v494.648889c0 49.095111 39.992889 89.088 89.031111 89.088h613.432889c49.095111 0 89.031111-39.992889 89.031111-89.088V331.946667c0-49.095111-39.936-89.031111-89.031111-89.031111H189.383111z" p-id="5939"></path><path d="M723.626667 242.915556a29.639111 29.639111 0 0 1-29.639111-29.696V119.808c0-24.917333-22.186667-45.112889-49.493334-45.112889H327.907556c-27.306667 0-49.493333 20.195556-49.493334 45.112889v74.808889a29.639111 29.639111 0 1 1-59.335111 0V119.808c0-57.571556 48.924444-104.448 108.828445-104.448h316.586666c59.960889 0 108.828444 46.876444 108.828445 104.448v93.411556a29.639111 29.639111 0 0 1-29.639111 29.696zM496.071111 648.533333a39.708444 39.708444 0 0 1-39.537778-39.594666V400.611556c0-21.788444 17.806222-39.594667 39.594667-39.594667 21.731556 0 39.537778 17.806222 39.537778 39.594667v208.327111a39.708444 39.708444 0 0 1-39.537778 39.594666z m0 147.000889a49.493333 49.493333 0 0 1-49.436444-49.493333v-2.332445a49.493333 49.493333 0 0 1 98.986666 0v2.389334a49.493333 49.493333 0 0 1-49.493333 49.493333z" p-id="5940"></path></svg>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: "SpareParts"
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
@ -47,6 +47,7 @@ export { default as SmallBell } from './SmallBell.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 SpareParts } from './SpareParts.vue'
|
||||
|
||||
export { default as File7z } from './file/7z.vue'
|
||||
export { default as FileBmp } from './file/Bmp.vue'
|
||||
|
||||
@ -31,12 +31,7 @@ export default {
|
||||
type:{type: String, default: ""}
|
||||
},
|
||||
watch:{
|
||||
// show:{
|
||||
// handler(){
|
||||
// },
|
||||
// immediate:true,
|
||||
// deep:true
|
||||
// }
|
||||
|
||||
},
|
||||
data(){
|
||||
return{
|
||||
@ -92,12 +87,18 @@ export default {
|
||||
this.list[9] = item;
|
||||
break;
|
||||
}
|
||||
|
||||
if(res.data && res.data.status == 1100){
|
||||
this.$message.warning(res.data.msg);
|
||||
}
|
||||
|
||||
this.$emit('updateShow', item);
|
||||
|
||||
if(res.data.status==1){
|
||||
this.down(res.data);
|
||||
}
|
||||
}
|
||||
|
||||
},
|
||||
down(item){
|
||||
const link = document.createElement('a');
|
||||
|
||||
@ -115,13 +115,14 @@
|
||||
.el-main.nopadding .scTable .scTable-total .totalView .total-item .text{margin-right: 4px;}
|
||||
|
||||
/** 列表上面的检索 */
|
||||
.el-main.nopadding .searchMain{display: flex;flex-wrap: wrap;align-items: self-end;padding-bottom: 10px;margin: 15px 0 0 0; border-bottom: 1px solid var(--el-border-color-light);}
|
||||
.el-main.nopadding .searchMain{position: relative;display: flex;flex-wrap: wrap;align-items: self-end;padding-bottom: 10px;margin: 15px 0 0 0; border-bottom: 1px solid var(--el-border-color-light);}
|
||||
.el-main.nopadding .searchMainNoTop{margin-top: 0;}
|
||||
.el-main.nopadding .searchMain .searchItem{display: flex;flex-direction: column;align-items: flex-start;margin-right: 20px;margin-bottom: 10px;}
|
||||
.el-main.nopadding .searchMain .searchItem .name{white-space: nowrap;overflow: hidden;text-overflow: ellipsis;color: #303133;padding-bottom: 5px;text-align: right;}
|
||||
.el-main.nopadding .searchMain .searchItem .input{width: 230px;height: 28px;}
|
||||
.el-main.nopadding .searchMain .searchItem .el-select--small .el-select__wrapper{height: 100%;}
|
||||
.el-main.nopadding .searchMain .searchItem.searchBtn{display: flex;flex-direction: row;}
|
||||
.el-main.nopadding .searchMain .exportBtn{position: absolute;bottom: 20px;right: 0;}
|
||||
|
||||
.el-drawer__body {overflow: auto;padding:0;}
|
||||
.el-popconfirm__main {margin: 14px 0;}
|
||||
|
||||
@ -21,6 +21,8 @@
|
||||
<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" @click="reset">重置</el-button>
|
||||
</div>
|
||||
<div class="exportBtn">
|
||||
<scExport :size="size" @exportData="exportData" @updateShow="exportChangeShow" :show="exportShow" type="20">
|
||||
<el-button :size="size" v-auth="'costSummaryDownload'" icon="sc-icon-Download" @click="exportData">下载</el-button>
|
||||
</scExport>
|
||||
|
||||
90
src/views/setting/advanced/components/addSpare.vue
Normal file
90
src/views/setting/advanced/components/addSpare.vue
Normal file
@ -0,0 +1,90 @@
|
||||
<template>
|
||||
<el-dialog :title="titleMap[mode]" v-model="visible" :width="500" destroy-on-close @closed="$emit('closed')">
|
||||
<el-form :model="form" :rules="rules" :disabled="mode=='show'" ref="dialogForm" label-width="100px">
|
||||
<el-form-item label="备件类别" prop="category_name">
|
||||
<el-input v-model="form.category_name" placeholder="请输入备件类别" clearable></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="故障率" prop="rate">
|
||||
<el-input v-model="form.rate" placeholder="请输入故障率" clearable></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<el-button @click="visible=false" >取 消</el-button>
|
||||
<el-button v-if="mode!='show'" type="primary" :loading="isSave" @click="submit()">保 存</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: "addSpare",
|
||||
emits: ['success', 'closed'],
|
||||
data() {
|
||||
return {
|
||||
mode: "add",
|
||||
titleMap: {
|
||||
add: '新增',
|
||||
edit: '编辑',
|
||||
show: '查看'
|
||||
},
|
||||
setMap:{
|
||||
regionList:[]
|
||||
},
|
||||
visible: false,
|
||||
isSave: false,
|
||||
//表单数据
|
||||
form: {
|
||||
id:"",
|
||||
category_name: "",
|
||||
rate:"",
|
||||
},
|
||||
//验证规则
|
||||
rules: {
|
||||
category_name: [
|
||||
{required: true, message: '请输入备件类别'}
|
||||
],
|
||||
rate: [
|
||||
{required: true, message: '请输入故障率'}
|
||||
],
|
||||
},
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
|
||||
},
|
||||
methods: {
|
||||
//显示
|
||||
open(mode='add'){
|
||||
this.mode = mode;
|
||||
this.visible = true;
|
||||
return this
|
||||
},
|
||||
|
||||
//表单提交方法
|
||||
submit(){
|
||||
this.$refs.dialogForm.validate(async (valid) => {
|
||||
if (valid) {
|
||||
this.isSave = true;
|
||||
const res = await this.$API.setup.spare.add.post(this.form);
|
||||
this.isSave = false;
|
||||
if(res.code == 200){
|
||||
this.$emit('success', this.form, this.mode);
|
||||
this.visible = false;
|
||||
this.$message.success("操作成功")
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
setData(data){
|
||||
// Object.assign(this.form, data);
|
||||
this.form.id = data.id;
|
||||
this.form.category_name = data.spare_parts_category;
|
||||
this.form.rate = data.failure_rate;
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
@ -50,6 +50,7 @@ export default {
|
||||
material: defineAsyncComponent(() => import('./setup/material')),
|
||||
company: defineAsyncComponent(() => import('./setup/company')),
|
||||
region: defineAsyncComponent(() => import('./setup/region')),
|
||||
spareParts: defineAsyncComponent(() => import('./setup/spareParts')),
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
@ -92,13 +93,19 @@ export default {
|
||||
icon: "sc-icon-Customer",
|
||||
title: "客户资料维护",
|
||||
component: "company",
|
||||
actions:'crontabAdd'
|
||||
actions:'addCustomer'
|
||||
},
|
||||
{
|
||||
icon: "sc-icon-Region",
|
||||
title: "区域地址配置",
|
||||
component: "region",
|
||||
actions:'crontabAdd'
|
||||
actions:'regionalAddressAdd'
|
||||
},
|
||||
{
|
||||
icon: "sc-icon-SpareParts",
|
||||
title: "备件故障率配置",
|
||||
component: "spareParts",
|
||||
actions:'sparePartsFailureRateAdd'
|
||||
},
|
||||
]
|
||||
},
|
||||
|
||||
@ -62,8 +62,8 @@ export default {
|
||||
this.$refs.table.refresh();
|
||||
}
|
||||
},
|
||||
table_del(row){
|
||||
console.log(row)
|
||||
table_del(){
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
130
src/views/setting/advanced/setup/spareParts.vue
Normal file
130
src/views/setting/advanced/setup/spareParts.vue
Normal file
@ -0,0 +1,130 @@
|
||||
<template>
|
||||
<el-container class="mainBox mainBoxHeaderNoBorder">
|
||||
<el-main class="nopadding">
|
||||
<el-header>
|
||||
<div class="left-panel">
|
||||
<el-button type="primary" :size="size" icon="el-icon-plus" @click="add">新增</el-button>
|
||||
<el-button plain type="danger" :disabled="selection.length==0?true:false" :size="size" icon="el-icon-Delete" @click="all_delete"></el-button>
|
||||
</div>
|
||||
<div class="right-panel">
|
||||
|
||||
</div>
|
||||
</el-header>
|
||||
<scTable ref="table" :apiObj="list.apiObj" :column="list.column" stripe :size="size" :hideDo="true" :hidePagination="true" @selection-change="selectionChange">
|
||||
<sc-table-column label="序号" align="center" type="index"></sc-table-column>
|
||||
<el-table-column width="200" label="备件类别" prop="spare_parts_category"></el-table-column>
|
||||
<el-table-column width="200" label="故障率" prop="failure_rate"></el-table-column>
|
||||
<el-table-column width="200" label="配置人" prop="creator_name"></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_see(scope.row, 'show')" 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')" divided icon="sc-icon-Delete">删除配置</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</template>
|
||||
</el-dropdown>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</scTable>
|
||||
</el-main>
|
||||
</el-container>
|
||||
|
||||
<add-spare v-if="dialog.save" ref="saveDialog" @success="handleSuccess" @closed="dialog.save=false"></add-spare>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import addSpare from "../components/addSpare";
|
||||
export default {
|
||||
name: "spareParts",
|
||||
components:{
|
||||
addSpare
|
||||
},
|
||||
data(){
|
||||
return{
|
||||
size:'small',
|
||||
setMap:{
|
||||
|
||||
},
|
||||
list:{
|
||||
apiObj: this.$API.setup.spare.list,
|
||||
column:[]
|
||||
},
|
||||
selection:[],
|
||||
params: {},
|
||||
|
||||
dialog:{
|
||||
show:false,
|
||||
},
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
|
||||
},
|
||||
methods:{
|
||||
add(){
|
||||
this.dialog.save = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.saveDialog.open()
|
||||
})
|
||||
},
|
||||
handleSuccess(){
|
||||
this.$refs.table.refresh()
|
||||
},
|
||||
//表格选择后回调事件
|
||||
selectionChange(selection){
|
||||
this.selection = selection;
|
||||
},
|
||||
// 查看
|
||||
table_see(row){
|
||||
this.dialog.save = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.saveDialog.open('show').setData(row)
|
||||
})
|
||||
},
|
||||
table_edit(row){
|
||||
this.dialog.save = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.saveDialog.open('edit').setData(row)
|
||||
})
|
||||
},
|
||||
async table_del(row){
|
||||
this.$confirm(`确定删除 ${row.room_code} 吗?`, '提示', {
|
||||
type: 'warning'
|
||||
}).then(async () => {
|
||||
const reqData = {ids: [row.id]};
|
||||
const res = await this.$API.setup.spare.delete.post(reqData);
|
||||
if(res.code == 200){
|
||||
this.$refs.table.refresh();
|
||||
this.$message.success("删除成功");
|
||||
}
|
||||
}).catch(()=>{})
|
||||
},
|
||||
async all_delete(){
|
||||
this.$confirm(`确定删除所选 ${this.selection.length} 项吗?`, '提示', {
|
||||
type: 'warning'
|
||||
}).then(async () => {
|
||||
const reqData = {ids: this.selection.map(em=>em.id)};
|
||||
const res = await this.$API.setup.spare.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>
|
||||
@ -3,10 +3,11 @@
|
||||
<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" icon="el-icon-search" @click="upSearch">查询</el-button>
|
||||
<el-button :size="size" type="info" icon="el-icon-RefreshRight" @click="reset">重置</el-button>
|
||||
</div>
|
||||
<div class="exportBtn">
|
||||
<scExport :size="size" @exportData="exportData" @updateShow="exportChangeShow" :show="exportShow" type="8">
|
||||
<el-button v-auth="'sysLogExport'" :size="size" icon="sc-icon-Download" :disabled="exportShow" @click="exportData">下载</el-button>
|
||||
</scExport>
|
||||
|
||||
@ -7,6 +7,8 @@
|
||||
<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" @click="reset">重置</el-button>
|
||||
</div>
|
||||
<div class="exportBtn">
|
||||
<scExport :size="size" @exportData="exportData" @updateShow="exportChangeShow" :show="exportShow" type="32">
|
||||
<el-button v-auth="'sysLogCommandExport'" :size="size" :disabled="exportShow" icon="sc-icon-Download" @click="exportData">下载</el-button>
|
||||
</scExport>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user