|
|
|
@ -18,10 +18,18 @@ |
|
|
|
> |
|
|
|
> |
|
|
|
<template #menu-left> </template> |
|
|
|
<template #menu-left> </template> |
|
|
|
<template #menu-right> </template> |
|
|
|
<template #menu-right> </template> |
|
|
|
<template #menu="{ row }"> </template> |
|
|
|
<template #menu="scope"> |
|
|
|
|
|
|
|
<el-button v-if="scope.row.locationStatus == '0'" type="text" @click="handleEdit(scope.row)" |
|
|
|
|
|
|
|
>占用</el-button |
|
|
|
|
|
|
|
> |
|
|
|
|
|
|
|
<el-button v-if="scope.row.locationStatus == '1'" type="text" @click="handleEdit(scope.row)" |
|
|
|
|
|
|
|
>闲置</el-button |
|
|
|
|
|
|
|
> |
|
|
|
|
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
|
|
<template #locationStatus="scope"> |
|
|
|
<template #locationStatus="scope"> |
|
|
|
<el-tag v-if="scope.row.locationStatus == '0'" type="success">空闲</el-tag> |
|
|
|
|
|
|
|
|
|
|
|
<el-tag v-if="scope.row.locationStatus == '0'" type="success">闲置</el-tag> |
|
|
|
<el-tag v-if="scope.row.locationStatus == '1'" type="danger">占用</el-tag> |
|
|
|
<el-tag v-if="scope.row.locationStatus == '1'" type="danger">占用</el-tag> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
</avue-crud> |
|
|
|
</avue-crud> |
|
|
|
@ -29,7 +37,7 @@ |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
|
|
<script> |
|
|
|
<script> |
|
|
|
import { getLocationLis } from '@/api/logisticsManagement/siteBasic'; |
|
|
|
import { getLocationLis,locationUpdate } from '@/api/logisticsManagement/siteBasic'; |
|
|
|
export default { |
|
|
|
export default { |
|
|
|
components: {}, |
|
|
|
components: {}, |
|
|
|
data() { |
|
|
|
data() { |
|
|
|
@ -84,7 +92,7 @@ export default { |
|
|
|
gridBtn: false, |
|
|
|
gridBtn: false, |
|
|
|
searchMenuPosition: 'right', |
|
|
|
searchMenuPosition: 'right', |
|
|
|
align: 'center', |
|
|
|
align: 'center', |
|
|
|
menu: false, |
|
|
|
menu: true, |
|
|
|
column: [ |
|
|
|
column: [ |
|
|
|
{ |
|
|
|
{ |
|
|
|
label: '库位编码', |
|
|
|
label: '库位编码', |
|
|
|
@ -99,6 +107,12 @@ export default { |
|
|
|
search: true, |
|
|
|
search: true, |
|
|
|
sortable: true, |
|
|
|
sortable: true, |
|
|
|
span: 12, |
|
|
|
span: 12, |
|
|
|
|
|
|
|
type: 'date', |
|
|
|
|
|
|
|
format: 'YYYY-MM-DD', |
|
|
|
|
|
|
|
valueFormat: 'YYYY-MM-DD', |
|
|
|
|
|
|
|
searchRange: true, |
|
|
|
|
|
|
|
startPlaceholder: '开始时间', |
|
|
|
|
|
|
|
endPlaceholder: '结束时间', |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
{ |
|
|
|
label: '库位状态', |
|
|
|
label: '库位状态', |
|
|
|
@ -109,7 +123,7 @@ export default { |
|
|
|
type: 'select', |
|
|
|
type: 'select', |
|
|
|
dicData: [ |
|
|
|
dicData: [ |
|
|
|
{ label: '占用', value: '1' }, |
|
|
|
{ label: '占用', value: '1' }, |
|
|
|
{ label: '空闲', value: '0' }, |
|
|
|
{ label: '闲置', value: '0' }, |
|
|
|
], |
|
|
|
], |
|
|
|
}, |
|
|
|
}, |
|
|
|
], |
|
|
|
], |
|
|
|
@ -119,6 +133,36 @@ export default { |
|
|
|
}; |
|
|
|
}; |
|
|
|
}, |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
methods: { |
|
|
|
|
|
|
|
// 修改站点状态(闲置/占用切换) |
|
|
|
|
|
|
|
handleEdit(row) { |
|
|
|
|
|
|
|
// 确定新状态 |
|
|
|
|
|
|
|
const oldStatus = row.locationStatus=='0'?'闲置':'占用'; |
|
|
|
|
|
|
|
const newStatus = row.locationStatus == '0' ? '1' : '0'; |
|
|
|
|
|
|
|
const statusText = newStatus == '0' ? '闲置' : '占用'; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.$confirm(`确定将站点 "${oldStatus}" 设置为${statusText}状态?`, { |
|
|
|
|
|
|
|
confirmButtonText: '确定', |
|
|
|
|
|
|
|
cancelButtonText: '取消', |
|
|
|
|
|
|
|
type: 'warning', |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
.then(() => { |
|
|
|
|
|
|
|
row.locationStatus = Number(newStatus); |
|
|
|
|
|
|
|
console.log(row,'更新状态'); |
|
|
|
|
|
|
|
// // 调用更新接口 |
|
|
|
|
|
|
|
// locationUpdate(row) |
|
|
|
|
|
|
|
// .then(() => { |
|
|
|
|
|
|
|
// this.$message.success('状态修改成功'); |
|
|
|
|
|
|
|
// this.onLoad(this.page, this.query); |
|
|
|
|
|
|
|
// }) |
|
|
|
|
|
|
|
// .catch(err => { |
|
|
|
|
|
|
|
// this.$message.error('状态修改失败'); |
|
|
|
|
|
|
|
// console.error(err); |
|
|
|
|
|
|
|
// }); |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
.catch(() => { |
|
|
|
|
|
|
|
// 用户取消 |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
}, |
|
|
|
rowSave(row, done, loading) { |
|
|
|
rowSave(row, done, loading) { |
|
|
|
// addPersonAbility(row).then( |
|
|
|
// addPersonAbility(row).then( |
|
|
|
// () => { |
|
|
|
// () => { |
|
|
|
@ -208,6 +252,10 @@ export default { |
|
|
|
|
|
|
|
|
|
|
|
onLoad(page, params = {}) { |
|
|
|
onLoad(page, params = {}) { |
|
|
|
this.loading = true; |
|
|
|
this.loading = true; |
|
|
|
|
|
|
|
if (this.query.updateTime && this.query.updateTime.length > 0) { |
|
|
|
|
|
|
|
this.query.startTime = this.query.updateTime[0]+' 00:00:00'; |
|
|
|
|
|
|
|
this.query.endTime = this.query.updateTime[1]+' 00:00:00'; |
|
|
|
|
|
|
|
} |
|
|
|
getLocationLis(page.currentPage, page.pageSize, Object.assign(params, this.query)).then( |
|
|
|
getLocationLis(page.currentPage, page.pageSize, Object.assign(params, this.query)).then( |
|
|
|
res => { |
|
|
|
res => { |
|
|
|
this.data = res.data.data.records; |
|
|
|
this.data = res.data.data.records; |
|
|
|
|