<!--
|
* @Date: 2024-01-06 17:40:19
|
* @LastEditors: Sneed
|
* @LastEditTime: 2024-03-05 16:04:32
|
* @FilePath: /belleson-frontend/Users/mache/Documents/demo/mdc/src/container/ledger/index.vue
|
-->
|
<template>
|
<div class="maintenance">
|
<Nav name="台账"></Nav>
|
<List ref="list" url="/account/pageQuery">
|
<template slot="search">
|
<div class="item">
|
<span>统一编号</span>
|
<el-input class="item-value" v-model="queryInfo.uuid" clearable></el-input>
|
</div>
|
<div class="item">
|
<span>设备规格</span>
|
<el-input class="item-value" v-model="queryInfo.specification" clearable></el-input>
|
</div>
|
<div class="item">
|
<span>设备型号</span>
|
<el-input class="item-value" v-model="queryInfo.type" clearable></el-input>
|
</div>
|
<div class="item">
|
<span>加工类型</span>
|
<el-select class="item-value" v-model="queryInfo.category" placeholder="" clearable>
|
<el-option v-for="item in deviceType" :key="item.value" :label="item.label" :value="item.value">
|
</el-option>
|
</el-select>
|
</div>
|
<div class="item">
|
<span>账务属性</span>
|
<el-select class="item-value" v-model="queryInfo.accountingAttribute" placeholder="" clearable>
|
<el-option v-for="item in financePro" :key="item.value" :label="item.label"
|
:value="item.value">
|
</el-option>
|
</el-select>
|
</div>
|
<div class="item">
|
<span>使用部门</span>
|
<el-select class="item-value" v-model="queryInfo.department" clearable>
|
<el-option v-for="item in departmentlist" :key="item.value" :label="item.label" :value="item.value">
|
</el-option>
|
</el-select>
|
</div>
|
<div class="item">
|
<span>设备管理分类</span>
|
<el-select class="item-value" v-model="queryInfo.manageType" clearable>
|
<el-option value="A">A</el-option>
|
<el-option value="B">B</el-option>
|
<el-option value="C">C</el-option>
|
</el-select>
|
</div>
|
<div class="item">
|
<span>投产日期</span>
|
<el-date-picker format="yyyy-MM-dd" value-format="yyyy-MM-dd" v-model="queryInfo.date"
|
range-separator="至" clearable type="daterange" start-placeholder="开始日期" end-placeholder="结束日期" clearable>
|
</el-date-picker>
|
<!-- <el-date-picker class="item-value" format="yyyy-MM-dd" value-format="yyyy-MM-dd"
|
v-model="queryInfo.productionDate" type="date" clearable placeholder="选择日期" clearable></el-date-picker> -->
|
</div>
|
<div class="item">
|
<span>生产厂家</span>
|
<el-input class="item-value" v-model="queryInfo.manufacturer" clearable></el-input>
|
</div>
|
<div class="item">
|
<span>设备类型</span>
|
<el-select class="item-value" v-model="queryInfo.deviceTypeId" placeholder="" clearable>
|
<el-option v-for="item in deviceTypeIds" :key="item.id" :label="item.name"
|
:value="item.id">
|
</el-option>
|
</el-select>
|
</div>
|
<div class="item" style="flex: 1 1 auto;justify-content: flex-end;">
|
<el-button type="primary" style="width: 150px;" size="small" @click="query">查询</el-button>
|
<el-button type="ghost" style="width: 150px;" size="small" @click="reset">重置</el-button>
|
</div>
|
|
</template>
|
|
<template slot="table-tool">
|
<el-button type="primary" size="mini" @click="add">新增设备台账</el-button>
|
</template>
|
<template slot="columns">
|
<!-- <el-table-column type="selection" align="center" width="55">
|
</el-table-column> -->
|
<el-table-column label="统一编号" align="center" prop="uuid">
|
</el-table-column>
|
<el-table-column label="设备名称" align="center" prop="machineName">
|
</el-table-column>
|
<el-table-column label="设备规格" align="center" prop="specification">
|
</el-table-column>
|
<el-table-column label="设备型号" align="center" prop="category">
|
</el-table-column>
|
<!-- <el-table-column
|
label="设备管理分类"
|
align="center"
|
prop="managType">
|
</el-table-column>
|
<el-table-column
|
label="班次"
|
align="center"
|
prop="classes">
|
</el-table-column> -->
|
<el-table-column label="使用部门" align="center" prop="departmentName">
|
</el-table-column>
|
<el-table-column label="设备类型" align="center" prop="category">
|
</el-table-column>
|
<el-table-column label="设备状态" align="center" prop="state">
|
<template slot-scope="scope">
|
<span v-if="scope.row.state == 'STOP'">关机状态</span>
|
<span v-else-if="scope.row.state == 'RUN'">运行状态</span>
|
<span v-else-if="scope.row.state == 'IDLE'">空闲状态</span>
|
<span v-else-if="scope.row.state == 'ALARM'">报警状态</span>
|
</template>
|
</el-table-column>
|
<el-table-column label="账务属性" align="center" prop="accountingAttribute">
|
</el-table-column>
|
<el-table-column label="生产厂家" align="center" prop="manufacturer">
|
</el-table-column>
|
<el-table-column label="投产日期" align="center" prop="productionDate">
|
</el-table-column>
|
<el-table-column label="国别" align="center" prop="country">
|
</el-table-column>
|
<el-table-column width="110" align="center" label="设备原值(元)" prop="originalValue">
|
</el-table-column>
|
<el-table-column width="110" align="center" label="设备重量(kg)" prop="weight">
|
</el-table-column>
|
<el-table-column width="110" align="center" label="电气复杂系数" prop="elecCompFactor">
|
</el-table-column>
|
<el-table-column width="110" align="center" label="机械复杂系数" prop="mechCompFactor">
|
</el-table-column>
|
<el-table-column width="120" align="center" label="设备净现值(元)" prop="presentValue">
|
</el-table-column>
|
<el-table-column label="备注" align="center" prop="remark">
|
</el-table-column>
|
<el-table-column width="220" fixed="right" align="center" label="操作">
|
<template slot-scope="scope">
|
<a class="table-action table-edit" @click="addOrUpdateHandle(scope.row)">编辑</a>
|
<a class="table-action table-del" @click="del(scope.row)">删除</a>
|
<!-- <el-button type="text" size="small" @click="addOrUpdateHandle(scope.row)">编辑</el-button>
|
<el-button type="text" size="small" @click="del(scope.row)">删除</el-button> -->
|
</template>
|
</el-table-column>
|
</template>
|
</List>
|
<manage-add-update v-if="addOrUpdateVisible" :addVisible="addOrUpdateVisible" @close="close" @confirm="confirm"
|
:deviceType="deviceType" :departmentlist="departmentlist" :isselectlist="isselectlist"
|
:deviceStatus="deviceStatus" :financePro="financePro" :deviceTypeIds="deviceTypeIds" :row="row"></manage-add-update>
|
</div>
|
</template>
|
<script>
|
import ManageAddUpdate from './Manage-add-update'
|
import { getUseDpts, getRequest } from '@/api/Api'
|
import List from '../list/index.vue'
|
import Nav from '@/components/nav'
|
export default {
|
components: {
|
Nav,
|
List,
|
ManageAddUpdate
|
},
|
data() {
|
return {
|
// 加工类型
|
deviceType: [
|
{ value: '立加', label: '立加' },
|
{ value: '卧加', label: '卧加' },
|
{ value: '立卧转换', label: '立卧转换' },
|
{ value: '五轴', label: '五轴' },
|
{ value: '数控车', label: '数控车' },
|
{ value: '复合加工', label: '复合加工' },
|
{ value: '数控磨', label: '数控磨' },
|
{ value: '齿加工', label: '齿加工' },
|
{ value: '电工加', label: '电工加' }
|
],
|
isselectlist: [
|
{
|
label: '是',
|
value: '1'
|
},
|
{
|
label: '否',
|
value: '0'
|
}
|
],
|
// 设备状态
|
deviceStatus: [
|
{ value: 'STOP', label: '关机' },
|
{ value: 'RUN', label: '运行' },
|
{ value: 'IDLE', label: '空闲' },
|
{ value: 'ALARM', label: '报警' }
|
],
|
deviceTypeIds: [],
|
// 账务属性
|
financePro: [
|
{ value: '帐内', label: '帐内' },
|
{ value: '帐外', label: '帐外' }
|
],
|
departmentlist: [],
|
queryInfo: {
|
date: [],
|
uuid: '',
|
specification: '',
|
type: '',
|
category: '',
|
accountingAttribute: '',
|
department: '',
|
manageType: '',
|
// productionDate: '',
|
manufacturer: '',
|
deviceTypeId: '',
|
productionDateBegin: '',
|
productionDateEnd: '',
|
},
|
options: [{}],
|
row: {},
|
addOrUpdateVisible: false
|
}
|
},
|
mounted() {
|
this.query()
|
this.init()
|
},
|
methods: {
|
init() {
|
// 查询使用部门
|
getUseDpts().then(res => {
|
this.departmentlist = res.data.map(item => {
|
return {
|
value: item.id,
|
label: item.name
|
}
|
})
|
})
|
|
getRequest('deviceTypeList').then(res => {
|
this.deviceTypeIds = res.data || []
|
})
|
},
|
query() {
|
try {
|
this.queryInfo.productionDateBegin = this.queryInfo.date[0] || ''
|
this.queryInfo.productionDateEnd = this.queryInfo.date[1] || ''
|
} catch (error) {
|
console.log(error)
|
}
|
|
this.$refs.list.pageQuery(this.queryInfo)
|
},
|
reset() {
|
Object.keys(this.queryInfo).forEach(key => {
|
this.queryInfo[key] = ''
|
})
|
this.queryInfo.date = []
|
this.queryInfo.productionDateBegin = ''
|
this.queryInfo.productionDateEnd = ''
|
},
|
add() {
|
this.row = {}
|
this.addOrUpdateVisible = true
|
},
|
close() {
|
this.addOrUpdateVisible = false
|
},
|
confirm() {
|
this.query()
|
this.close()
|
},
|
addOrUpdateHandle(row) {
|
this.row = row
|
this.addOrUpdateVisible = true
|
},
|
del(row) {
|
this.$confirm('确定要永久删除此项?', '提示', {
|
confirmButtonText: '确定',
|
cancelButtonText: '取消',
|
type: 'warning'
|
}).then(() => {
|
getRequest('accountDel', { ids: [row.id] }).then(res => {
|
this.query()
|
this.$message({
|
type: 'success',
|
message: '删除成功!'
|
})
|
this.submitForm()
|
},() => {
|
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;
|
font-size: 14px;
|
}
|
|
.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>
|