设备上下架开发

This commit is contained in:
liang.chao 2024-11-23 17:44:59 +08:00
parent 4c10944e92
commit f9fa2c5c71
2 changed files with 327 additions and 280 deletions

View File

@ -52,6 +52,15 @@ export function removeDevice(data) {
}) })
} }
//上下架(批量)
export function updateUpDown(data) {
return request({
url: '/material-mall/dev/updateUpDown',
method: 'post',
data: data,
})
}

View File

@ -74,13 +74,15 @@
<el-button <el-button
type="success" plain type="success" plain
size="mini" @click="equipmentAdd" size="mini" @click="equipmentAdd"
>装备新建</el-button> >装备新建
</el-button>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
<el-button <el-button
type="warning" plain type="warning" plain
icon="el-icon-download" icon="el-icon-download"
size="mini" size="mini"
@click="handleUpdateUpDown(null,2)"
>批量上架</el-button> >批量上架</el-button>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
@ -88,10 +90,13 @@
type="warning" plain type="warning" plain
icon="el-icon-download" icon="el-icon-download"
size="mini" size="mini"
>批量下架</el-button> @click="handleUpdateUpDown(null,3)"
>批量下架
</el-button>
</el-col> </el-col>
</el-row> </el-row>
<el-table v-loading="loading" :data="tableList" ref="multipleTable" row-key="maId" @selection-change="handleSelectionChange" border> <el-table v-loading="loading" :data="tableList" ref="multipleTable" row-key="maId"
@selection-change="handleSelectionChange" border>
<el-table-column type="selection" width="55" align="center" :reserve-selection="true"/> <el-table-column type="selection" width="55" align="center" :reserve-selection="true"/>
<el-table-column label="序号" align="center" width="80" type="index"> <el-table-column label="序号" align="center" width="80" type="index">
<template slot-scope="scope"> <template slot-scope="scope">
@ -122,7 +127,16 @@
</el-button> </el-button>
<el-button <el-button
size="mini" type="warning"> size="mini" type="warning">
<span
v-if="scope.row.maStatus == 2"
@click="handleUpdateUpDown(scope.row,3)">
下架 下架
</span>
<span
v-if="scope.row.maStatus == 3"
@click="handleUpdateUpDown(scope.row,2)">
上架
</span>
</el-button> </el-button>
<el-button size="mini" type="danger" @click="delDev(scope.row)"> <el-button size="mini" type="danger" @click="delDev(scope.row)">
删除 删除
@ -142,7 +156,8 @@
</template> </template>
<script> <script>
import { getDevList,removeDevice } from "@/api/lessor/equipment"; import {getDevList, removeDevice,updateUpDown} from "@/api/lessor/equipment";
export default { export default {
name: "", name: "",
dicts: ['ma_machine_status'], dicts: ['ma_machine_status'],
@ -162,6 +177,7 @@
total: 0, total: 0,
// //
tableList: [], tableList: [],
maIds: [],
// //
title: "", title: "",
// //
@ -233,6 +249,25 @@
query, query,
}) })
}, },
//
handleUpdateUpDown(row,maStatus) {
this.$modal.confirm('是否确认?').then(() => {
let maIds = []
if (!row){
maIds = this.ids
} else {
maIds.push(row.maId)
}
if (maIds.length == 0){
this.$modal.msgError('请选择要操作的数据')
return
}
return updateUpDown({maIds,maStatus})
}).then(() => {
this.handleQuery()
}).catch(() => {
})
},
// //
handleView(row) { handleView(row) {
console.log(row) console.log(row)
@ -268,15 +303,18 @@
align-items: center; align-items: center;
justify-content: center; justify-content: center;
} }
.deviceCode { .deviceCode {
margin-top: 10px; margin-top: 10px;
padding-bottom: 20px; padding-bottom: 20px;
font-size: 18px; font-size: 18px;
} }
::v-deep.el-table .fixed-width .el-button--mini { ::v-deep.el-table .fixed-width .el-button--mini {
width: 60px !important; width: 60px !important;
margin-bottom: 10px; margin-bottom: 10px;
} }
//css //css
::v-deep.disabled { ::v-deep.disabled {
.el-upload--picture-card { .el-upload--picture-card {