设备上下架开发

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
type="success" plain
size="mini" @click="equipmentAdd"
>装备新建</el-button>
>装备新建
</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="warning" plain
icon="el-icon-download"
size="mini"
@click="handleUpdateUpDown(null,2)"
>批量上架</el-button>
</el-col>
<el-col :span="1.5">
@ -88,10 +90,13 @@
type="warning" plain
icon="el-icon-download"
size="mini"
>批量下架</el-button>
@click="handleUpdateUpDown(null,3)"
>批量下架
</el-button>
</el-col>
</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 label="序号" align="center" width="80" type="index">
<template slot-scope="scope">
@ -122,7 +127,16 @@
</el-button>
<el-button
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 size="mini" type="danger" @click="delDev(scope.row)">
删除
@ -142,7 +156,8 @@
</template>
<script>
import { getDevList,removeDevice } from "@/api/lessor/equipment";
import {getDevList, removeDevice,updateUpDown} from "@/api/lessor/equipment";
export default {
name: "",
dicts: ['ma_machine_status'],
@ -162,6 +177,7 @@
total: 0,
//
tableList: [],
maIds: [],
//
title: "",
//
@ -233,6 +249,25 @@
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) {
console.log(row)
@ -268,15 +303,18 @@
align-items: center;
justify-content: center;
}
.deviceCode {
margin-top: 10px;
padding-bottom: 20px;
font-size: 18px;
}
::v-deep.el-table .fixed-width .el-button--mini {
width: 60px !important;
margin-bottom: 10px;
}
//css
::v-deep.disabled {
.el-upload--picture-card {