物流管理接口联调

dev-scheduling
zhangdi 1 month ago
parent e9fe530f08
commit b115d7c258
  1. 19
      src/api/logisticsManagement/logisticsDistribution.js
  2. 124
      src/views/logisticsManagement/components/returnDialog.vue
  3. 95
      src/views/logisticsManagement/logisticsDistribution.vue

@ -35,4 +35,21 @@ export const boxBinding = (data) => {
});
};
// 退回
// 退回
export const returnWarehouse = (data) => {
return request({
url: '/blade-desk/order/return-warehouse',
method: 'post',
data: data,
});
};
// 获取退回站点列表
export const returnWarehouseList = (params) => {
return request({
url: '/blade-desk/order/return-warehouse-list',
method: 'get',
params: params,
});
};

@ -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>
<el-form-item label="站点码" prop="stationCode">
<el-input
v-model="form.stationCode"
style=""
@keyup.enter.native="changeCode"
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,
returnWarehouse,
} 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,
};
returnWarehouse(params)
.then(res => {
this.$message.success('操作成功');
this.submitLoading = false;
this.closeDialog();
})
.catch(err => {
this.submitLoading = false;
});
}
});
},
},
};
</script>
<style lang="scss" scoped>
</style>

@ -18,11 +18,14 @@
>
<template #menu-left>
<el-button type="primary" @click="addFn">新增</el-button>
<el-button type="primary" @click="returnFn">退回</el-button>
</template>
<template #menu-right> </template>
<template #menu="{ row }">
<el-button type="text" @click="returnFn" v-if="row.status=='1'||row.status=='2'">退回</el-button>
</template>
<!-- <template #menu="{ row }">
<el-button type="text" v-if="row.status == '1' || row.status == '2'" @click="returnFn(row)"
>退回</el-button
>
</template> -->
</avue-crud>
<!-- 新增 -->
<addLogisticsDialog
@ -30,19 +33,26 @@
:showDialog="showAddDialogd"
@closeDialog="closeDialog"
></addLogisticsDialog>
<!-- 退回 -->
<returnDialog v-if="showReturnDialog" :showDialog="showReturnDialog" :rowItem="rowItem" @closeDialog="closeDialog"></returnDialog>
</basic-container>
</template>
<script>
import addLogisticsDialog from './components/addLogisticsDialog.vue';
import returnDialog from './components/returnDialog.vue';
import { getList } from '@/api/logisticsManagement/logisticsDistribution';
export default {
components: {
addLogisticsDialog,
returnDialog,
},
data() {
return {
showReturnDialog: false,
showAddDialogd: false,
rowItem: {},
form: {},
selectionList: [],
query: {},
@ -102,16 +112,16 @@ export default {
sortable: true,
span: 12,
},
{
label: '站点名称',
prop: 'stationId',
search: true,
sortable: true,
span: 12,
},
// {
// label: '',
// prop: 'stationId',
// search: true,
// sortable: true,
// span: 12,
// },
{
label: '作业中心',
prop: 'wcId',
prop: 'wcName',
search: false,
sortable: true,
span: 12,
@ -119,13 +129,13 @@ export default {
{
label: '作业中心',
prop: 'wcId',
search: true,
search: false,
sortable: true,
span: 12,
hide:true,
type:'select',
filterable:true,
dicUrl:'/blade-desk/order/bs-list',
hide: true,
type: 'select',
filterable: true,
dicUrl: '/blade-desk/order/bs-list',
props: {
label: 'wcName',
value: 'id',
@ -133,23 +143,23 @@ export default {
},
{
label: '状态',
prop: 'taskStatus',
search: true,
prop: 'statusDesc',
search: false,
sortable: true,
span: 12,
type: 'select',
dicData: [
{ label: '起点位置', value: 0 },
{ label: '输送线起点', value: 1 },
{ label: '退回(超重)', value: 2 },
{ label: '输送线末尾', value: 3 },
{ label: '站点', value: 4 },
{ label: '库位', value: 5 },
{ label: '等待', value: 6 },
{ label: '站点接收', value: 7 },
{ label: '回库', value: 8 },
{ label: '结束', value: 9 },
],
// type: 'select',
// dicData: [
// { label: '', value: 0 },
// { label: '线', value: 1 },
// { label: '退()', value: 2 },
// { label: '线', value: 3 },
// { label: '', value: 4 },
// { label: '', value: 5 },
// { label: '', value: 6 },
// { label: '', value: 7 },
// { label: '', value: 8 },
// { label: '', value: 9 },
// ],
},
{
label: '创建时间',
@ -163,13 +173,12 @@ export default {
prop: 'crDate',
sortable: true,
filter: true,
selectWidth: 150,
searchLabelWidth: 90,
span: 12,
// selectWidth: 150,
span: 8,
search: true,
width: 150,
searchSpan: 8,
hide:true,
searchSpan: 6,
hide: true,
type: 'date',
format: 'YYYY-MM-DD',
valueFormat: 'YYYY-MM-DD',
@ -178,8 +187,6 @@ export default {
rangeSeparator: '-',
searchRange: true,
},
],
},
@ -187,12 +194,16 @@ export default {
};
},
methods: {
returnFn() {},
returnFn() {
this.showReturnDialog = true;
// this.rowItem = row;
},
addFn() {
this.showAddDialogd = true;
},
closeDialog() {
this.showAddDialogd = false;
this.showReturnDialog = false;
this.onLoad(this.page, this.query);
},
rowSave(row, done, loading) {
@ -284,9 +295,9 @@ export default {
onLoad(page, params = {}) {
this.loading = true;
if(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";
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';
}
getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
this.data = res.data.data.records;

Loading…
Cancel
Save