物流管理接口联调

dev-scheduling
zhangdi 1 month ago
parent b115d7c258
commit 94c3ade0ef
  1. 9
      src/api/logisticsManagement/logisticsDistribution.js
  2. 124
      src/views/logisticsManagement/components/receiveDialog.vue
  3. 24
      src/views/logisticsManagement/logisticsDistribution.vue

@ -53,3 +53,12 @@ export const returnWarehouseList = (params) => {
params: params,
});
};
// 接收
export const receiveWarehouse = (data) => {
return request({
url: '/blade-desk/order/receive',
method: 'get',
params: data,
});
};

@ -0,0 +1,124 @@
<template>
<el-dialog title="退回" append-to-body :modelValue="openShow" width="30%" @close="closeDialog">
<el-form :model="form" ref="form" :rules="rules" label-width="auto">
<!-- <el-form-item label="箱条码" prop="boxBarcode">
<el-input
v-model="form.boxBarcode"
style=""
@keyup.enter.native="changeCode"
placeholder="请扫描箱条码"
/>
</el-form-item>@keyup.enter.native="changeCode" -->
<el-form-item label="站点码" prop="stationCode">
<el-input
v-model="form.stationCode"
style=""
placeholder="请扫描箱条码"
/>
</el-form-item>
<!-- <el-form-item label="终点站" prop="endLocationId">
<el-select
v-model="form.endLocationId"
placeholder="请选择"
filterable
@change="endLocationChange"
>
<el-option
v-for="item in workCenterOptions"
:key="item.id"
:label="item.wcName"
:value="item.id"
/>
</el-select>
</el-form-item> -->
</el-form>
<template #footer>
<span class="dialog-footer">
<el-button @click="closeDialog"> </el-button>
<el-button type="primary" @click="submit" :loading="submitLoading"> </el-button>
</span>
</template>
</el-dialog>
</template>
<script>
import {
returnWarehouseList,
receiveWarehouse,
} from '@/api/logisticsManagement/logisticsDistribution';
export default {
props: {
showDialog: {
type: Boolean,
default: false,
},
rowItem: {
type: Object,
default: () => {},
},
},
data() {
return {
submitLoading: false,
openShow: false,
form: {},
rules: {
// boxBarcode: [{ required: true, message: '', trigger: 'blur' }],
stationCode: [{ required: true, message: '请扫描站点码', trigger: 'blur' }],
// endLocationId: [{ required: true, message: '', trigger: 'blur' }],
},
workCenterOptions: [],
};
},
mounted() {
this.openShow = this.showDialog;
// this.returnWarehouseList();
},
methods: {
//
endLocationChange() {
const selected = this.workCenterOptions.find(item => item.id === this.form.endLocationId);
this.form.endName = selected ? selected.wcName : '';
},
// 退
returnWarehouseList() {
returnWarehouseList().then(res => {
this.workCenterOptions = res.data.data;
});
},
changeCode() {
console.log(9999, this.form);
},
closeDialog() {
this.openShow = false;
this.$emit('closeDialog');
},
submit() {
this.$refs.form.validate(async valid => {
if (valid) {
this.submitLoading = true;
let params = {
// boxBarcode: this.form.boxBarcode,
stationCode: this.form.stationCode,
// endLocationId: this.form.endLocationId,
};
receiveWarehouse(params)
.then(res => {
this.$message.success('操作成功');
this.submitLoading = false;
this.closeDialog();
})
.catch(err => {
this.submitLoading = false;
});
}
});
},
},
};
</script>
<style lang="scss" scoped>
</style>

@ -18,12 +18,13 @@
>
<template #menu-left>
<el-button type="primary" @click="addFn">新增</el-button>
<el-button type="primary" @click="receiveFn">接收</el-button>
<el-button type="primary" @click="returnFn">退回</el-button>
</template>
<template #menu-right> </template>
<!-- <template #menu="{ row }">
<el-button type="text" v-if="row.status == '1' || row.status == '2'" @click="returnFn(row)"
>退回</el-button
<el-button type="text" v-if="row.status == '1' || row.status == '2'" @click="receiveFn(row)"
>接收</el-button
>
</template> -->
</avue-crud>
@ -34,22 +35,31 @@
@closeDialog="closeDialog"
></addLogisticsDialog>
<!-- 退回 -->
<returnDialog v-if="showReturnDialog" :showDialog="showReturnDialog" :rowItem="rowItem" @closeDialog="closeDialog"></returnDialog>
<returnDialog
v-if="showReturnDialog"
:showDialog="showReturnDialog"
:rowItem="rowItem"
@closeDialog="closeDialog"
></returnDialog>
<!-- 接收 -->
<receiveDialog v-if="showReceiveDialog" :showDialog="showReceiveDialog" @closeDialog="closeDialog"></receiveDialog>
</basic-container>
</template>
<script>
import addLogisticsDialog from './components/addLogisticsDialog.vue';
import returnDialog from './components/returnDialog.vue';
import receiveDialog from './components/receiveDialog.vue'
import { getList } from '@/api/logisticsManagement/logisticsDistribution';
export default {
components: {
addLogisticsDialog,
returnDialog,
receiveDialog
},
data() {
return {
showReceiveDialog: false,
showReturnDialog: false,
showAddDialogd: false,
rowItem: {},
@ -194,6 +204,9 @@ export default {
};
},
methods: {
receiveFn(){
this.showReceiveDialog = true;
},
returnFn() {
this.showReturnDialog = true;
// this.rowItem = row;
@ -204,6 +217,7 @@ export default {
closeDialog() {
this.showAddDialogd = false;
this.showReturnDialog = false;
this.showReceiveDialog = false;
this.onLoad(this.page, this.query);
},
rowSave(row, done, loading) {
@ -295,7 +309,7 @@ export default {
onLoad(page, params = {}) {
this.loading = true;
if (this.query.crDate&&this.query.crDate.length > 0) {
if (this.query.crDate && this.query.crDate.length > 0) {
this.query.startTime = this.query.crDate[0] + ' 00:00:00';
this.query.endTime = this.query.crDate[1] + ' 00:00:00';
}

Loading…
Cancel
Save