设备上下架开发
This commit is contained in:
parent
4c10944e92
commit
f9fa2c5c71
|
|
@ -52,6 +52,15 @@ export function removeDevice(data) {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//上下架(批量)
|
||||||
|
export function updateUpDown(data) {
|
||||||
|
return request({
|
||||||
|
url: '/material-mall/dev/updateUpDown',
|
||||||
|
method: 'post',
|
||||||
|
data: data,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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 {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue