增加库位状态修改

dev-scheduling
zhangdi 6 days ago
parent fc58bc46df
commit 2edb4837a2
  1. 9
      src/api/logisticsManagement/siteBasic.js
  2. 58
      src/views/logisticsManagement/storagelocationBasic.vue

@ -36,3 +36,12 @@ export const stationUpdate = (data) => {
data: data, data: data,
}); });
}; };
// 更新库位状态信息 /location/update
export const locationUpdate = (data) => {
return request({
url: '/blade-desk/location/update',
method: 'post',
data: data,
});
};

@ -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;

Loading…
Cancel
Save