<!--
|
* @Date: 2024-01-06 17:40:19
|
* @LastEditors: Sneed
|
* @LastEditTime: 2024-01-29 23:03:05
|
* @FilePath: /belleson-frontend/Users/mache/Documents/demo/mdc/src/container/manufacturer/index.vue
|
-->
|
<template>
|
<div class="maintenance">
|
<Nav name="生产厂家管理"></Nav>
|
<List ref="list" :url="url">
|
<template slot="search">
|
<div class="item">
|
<span>名称</span>
|
<el-input class="item-value" v-model="queryInfo.name" clearable></el-input>
|
|
</div>
|
<div class="item" style="flex: 1 1 auto;justify-content: flex-end;">
|
<el-button type="primary" size="small" style="width: 150px;" @click="query">查询</el-button>
|
<el-button type="ghost" size="small" style="width: 150px;" @click="reset">重置</el-button>
|
</div>
|
</template>
|
|
<template slot="table-tool">
|
<el-button type="primary" size="mini" style="width: 150px;" @click="add">新增</el-button>
|
</template>
|
|
<template slot="columns">
|
<el-table-column
|
type="index"
|
label="序号"
|
width="180">
|
</el-table-column>
|
<el-table-column
|
prop="name"
|
label="名称"
|
>
|
</el-table-column>
|
<el-table-column width="220" align="center" label="操作" prop="editor">
|
<template slot-scope="scope">
|
<a class="table-action table-edit" @click="editDeviceType(scope.row)">编辑</a>
|
<a class="table-action table-del" @click="deleteHandle(scope.row)">删除</a>
|
<!-- <el-button size="mini" type="text" @click="editDeviceType(scope.row)">编辑</el-button>
|
<el-button size="mini" type="text" @click="deleteHandle(scope.row)">删除</el-button> -->
|
</template>
|
</el-table-column>
|
</template>
|
|
</List>
|
<manage-add-update v-if="addOrUpdateVisible" :addVisible="addOrUpdateVisible" @close="close" @confirm="confirm"
|
:row="row"></manage-add-update>
|
</div>
|
</template>
|
<script>
|
import List from '../list/index.vue'
|
import ManageAddUpdate from './Manage-add-update'
|
import { getUrl,manufacturerDelete } from '@/api/Api'
|
import Nav from '@/components/nav'
|
export default {
|
components: {
|
List,
|
ManageAddUpdate,
|
Nav
|
},
|
data () {
|
return {
|
url: '',
|
queryInfo: {
|
name: ''
|
},
|
row: {},
|
addOrUpdateVisible: false
|
}
|
},
|
created () {
|
this.url = getUrl('manufacturerQuery')
|
//this.init()
|
},
|
methods: {
|
reset () {
|
Object.keys(this.queryInfo).forEach(key => {
|
this.queryInfo[key] = ''
|
})
|
},
|
query () {
|
this.$refs.list.pageQuery(this.queryInfo)
|
},
|
add() {
|
this.row = {id:''}
|
this.addOrUpdateVisible = true
|
|
},
|
editDeviceType(row){
|
this.row = row;
|
this.addOrUpdateVisible = true;
|
},
|
close() {
|
this.addOrUpdateVisible = false
|
},
|
confirm() {
|
this.query()
|
this.close()
|
},
|
addOrUpdateHandle(row) {
|
this.row = row
|
this.addOrUpdateVisible = true
|
},
|
deleteHandle(row) {
|
let ids = []
|
|
ids.push(row.id)
|
|
//ids = ids.join(',')
|
this.$confirm('确定要永久删除此项?', '提示', {
|
confirmButtonText: '确定',
|
cancelButtonText: '取消',
|
type: 'warning'
|
}).then(() => {
|
manufacturerDelete(ids).then(res => {
|
// if(res.result == ""){}
|
this.$message({
|
type: 'success',
|
message: '删除成功!'
|
})
|
this.query ();
|
//this.submitForm()
|
})
|
}).catch(() => {
|
this.$message({
|
type: 'info',
|
message: '已取消删除'
|
})
|
})
|
}
|
|
},
|
}
|
</script>
|
<style lang="scss">
|
.maintenance {
|
.item-value {
|
.el-input__inner {
|
background: transparent;
|
border-radius: 2px;
|
border: 1px solid #435F9E;
|
}
|
}
|
}
|
</style>
|
<style lang="scss" scoped>
|
.maintenance {
|
width: 100%;
|
height: 100%;
|
overflow: hidden;
|
color: #FFF;
|
display: flex;
|
flex-direction: column;
|
|
.nav {
|
padding: 10px 30px;
|
}
|
|
.item {
|
margin-top: 20px;
|
margin-left: 50px;
|
display: flex;
|
align-items: center;
|
|
span {
|
width: 120px;
|
font-size: 16px;
|
font-family: PingFangSC, PingFang SC;
|
color: #C6DCE0;
|
text-align: right;
|
padding-right: 20px;
|
}
|
|
.item-value {
|
width: 200px;
|
border: 1px solid #435F9E;
|
}
|
|
.btn {
|
line-height: 1.5;
|
width: 100px;
|
text-align: center;
|
font-size: 16px;
|
cursor: pointer;
|
}
|
|
.reset {
|
background: #AAB6BA;
|
color: #FFF;
|
}
|
|
.query {
|
background: #5DD1FC;
|
color: #FFF;
|
}
|
}
|
}
|
</style>
|