parent
212ccd15ec
commit
14fd6be62b
8 changed files with 623 additions and 13 deletions
@ -0,0 +1,44 @@ |
||||
import request from '@/axios'; |
||||
|
||||
|
||||
|
||||
|
||||
// 获取配送记录列表
|
||||
export const getList = (current, size, params) => { |
||||
return request({ |
||||
url: '/blade-desk/order-bind/page', |
||||
method: 'get', |
||||
params: { |
||||
...params, |
||||
current, |
||||
size, |
||||
}, |
||||
}); |
||||
}; |
||||
|
||||
// 提交
|
||||
export const boxBinding = (data) => { |
||||
return request({ |
||||
url: '/blade-desk/order-bind/box-binding', |
||||
method: 'post', |
||||
data: data, |
||||
}); |
||||
}; |
||||
|
||||
// 获取订单信息
|
||||
export function getOrderInfo(params) { |
||||
return request({ |
||||
url: '/logistics/orderInfo', // 实际接口路径
|
||||
method: 'get', |
||||
params, |
||||
}); |
||||
} |
||||
|
||||
// 解绑 order-bind/box-unbind
|
||||
export const boxUnbind = (data) => { |
||||
return request({ |
||||
url: '/blade-desk/order-bind/box-unbind', |
||||
method: 'post', |
||||
data: data, |
||||
}); |
||||
}; |
||||
@ -0,0 +1,145 @@ |
||||
<template> |
||||
<el-dialog |
||||
title="解绑配送" |
||||
append-to-body |
||||
:modelValue="openShow" |
||||
width="30%" |
||||
@close="closeDialog" |
||||
> |
||||
<el-form :model="form" ref="form" :rules="rules" label-width="auto" @submit.prevent> |
||||
<el-form-item label="箱条码:" prop="boxBarcode"> |
||||
<el-input |
||||
v-model="form.boxBarcode" |
||||
@keyup.enter.prevent="changeCode" |
||||
placeholder="请扫描箱条码" |
||||
/> |
||||
</el-form-item> |
||||
<el-form-item label="订单号:" prop="orderNo"> |
||||
<el-input |
||||
v-model="form.orderNo" |
||||
@keyup.enter.prevent="changeOrderCode" |
||||
placeholder="请扫描箱条码" |
||||
/> |
||||
</el-form-item> |
||||
<el-form-item label="流程卡号:" prop="orderNo"> |
||||
<el-tag |
||||
:key="tag" |
||||
v-for="tag in orderIdList" |
||||
closable |
||||
:disable-transitions="false" |
||||
@close="handleClose(tag)" |
||||
> |
||||
{{ tag }} |
||||
</el-tag> |
||||
</el-form-item> |
||||
</el-form> |
||||
<!-- <el-table :data="orderIdList" style="width: 100%"> |
||||
<el-table-column prop="id" label="订单号"> </el-table-column> |
||||
<el-table-column prop="name" label="作业中心"> </el-table-column> |
||||
<el-table-column label="操作" width="80" align="center"> |
||||
<template #default="scope"> |
||||
<el-button type="danger" size="small" @click="deleteOrder(scope.$index)"> |
||||
删除 |
||||
</el-button> |
||||
</template> |
||||
</el-table-column> |
||||
</el-table> --> |
||||
|
||||
<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 { boxBinding, getOrderInfo } from '@/api/logisticsManagement/materialPacking'; |
||||
export default { |
||||
props: { |
||||
showDialog: { |
||||
type: Boolean, |
||||
default: false, |
||||
}, |
||||
}, |
||||
data() { |
||||
return { |
||||
submitLoading: false, |
||||
tableData: [], |
||||
openShow: false, |
||||
form: {}, |
||||
rules: { |
||||
boxBarcode: [{ required: true, message: '请扫描箱条码', trigger: 'blur' }], |
||||
}, |
||||
workCenterOptions: [], |
||||
orderIdList:[] |
||||
}; |
||||
}, |
||||
mounted() { |
||||
this.openShow = this.showDialog; |
||||
}, |
||||
methods: { |
||||
// 扫描箱条码 |
||||
changeCode() { |
||||
console.log('箱条码:', this.form.boxBarcode); |
||||
// 可在此处添加箱条码查询逻辑 |
||||
}, |
||||
// 扫描订单号 - 添加到流程卡号列表 |
||||
changeOrderCode() { |
||||
const orderNo = this.form.orderNo?.trim(); |
||||
if (!orderNo) { |
||||
this.$message.warning('请输入订单号'); |
||||
return; |
||||
} |
||||
|
||||
// 检查是否已存在 |
||||
const exists = this.orderIdList.includes(orderNo); |
||||
if (exists) { |
||||
this.$message.warning('该订单号已添加'); |
||||
this.form.orderNo = ''; |
||||
return; |
||||
} |
||||
|
||||
// 调用 API 获取订单信息(如果需要验证) |
||||
this.orderIdList.push(orderNo); |
||||
this.form.orderNo = ''; |
||||
}, |
||||
// 删除流程卡号标签 |
||||
handleClose(tag) { |
||||
this.orderIdList = this.orderIdList.filter(item => item !== tag); |
||||
}, |
||||
closeDialog() { |
||||
this.openShow = false; |
||||
this.form = { |
||||
boxBarcode: '', |
||||
orderNo: '', |
||||
}; |
||||
this.orderIdList = []; |
||||
this.$emit('closeDialog'); |
||||
}, |
||||
submit() { |
||||
this.$refs.form.validate(async valid => { |
||||
if (valid) { |
||||
|
||||
this.submitLoading = true; |
||||
let params = { |
||||
boxBarcode: this.form.boxBarcode, |
||||
orderIdList: this.orderIdList, |
||||
}; |
||||
|
||||
boxBinding(params) |
||||
.then(res => { |
||||
this.$message.success('操作成功'); |
||||
this.submitLoading = false; |
||||
this.closeDialog(); |
||||
}) |
||||
.catch(err => { |
||||
this.submitLoading = false; |
||||
}); |
||||
} |
||||
}); |
||||
}, |
||||
}, |
||||
}; |
||||
</script> |
||||
<style lang="scss" scoped></style> |
||||
@ -0,0 +1,121 @@ |
||||
<template> |
||||
<el-dialog |
||||
title="新增配送" |
||||
append-to-body |
||||
:modelValue="openShow" |
||||
width="30%" |
||||
@close="closeDialog" |
||||
> |
||||
<el-form :model="form" ref="form" :rules="rules" label-width="auto" @submit.prevent> |
||||
<el-form-item label="箱条码:" prop="boxBarcode"> |
||||
<el-input |
||||
v-model="form.boxBarcode" |
||||
@keyup.enter.prevent="changeCode" |
||||
placeholder="请扫描箱条码" |
||||
/> |
||||
</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 { boxBinding, getOrderInfo } from '@/api/logisticsManagement/materialPacking'; |
||||
export default { |
||||
props: { |
||||
showDialog: { |
||||
type: Boolean, |
||||
default: false, |
||||
}, |
||||
}, |
||||
data() { |
||||
return { |
||||
submitLoading: false, |
||||
tableData: [], |
||||
openShow: false, |
||||
form: {}, |
||||
rules: { |
||||
boxBarcode: [{ required: true, message: '请扫描箱条码', trigger: 'blur' }], |
||||
}, |
||||
workCenterOptions: [], |
||||
orderIdList:[] |
||||
}; |
||||
}, |
||||
mounted() { |
||||
this.openShow = this.showDialog; |
||||
}, |
||||
methods: { |
||||
// 扫描箱条码 |
||||
changeCode() { |
||||
console.log('箱条码:', this.form.boxBarcode); |
||||
// 可在此处添加箱条码查询逻辑 |
||||
}, |
||||
// 扫描订单号 - 添加到流程卡号列表 |
||||
changeOrderCode() { |
||||
const orderNo = this.form.orderNo?.trim(); |
||||
if (!orderNo) { |
||||
this.$message.warning('请输入订单号'); |
||||
return; |
||||
} |
||||
|
||||
// 检查是否已存在 |
||||
const exists = this.orderIdList.includes(orderNo); |
||||
if (exists) { |
||||
this.$message.warning('该订单号已添加'); |
||||
this.form.orderNo = ''; |
||||
return; |
||||
} |
||||
|
||||
// 调用 API 获取订单信息(如果需要验证) |
||||
this.orderIdList.push(orderNo); |
||||
this.form.orderNo = ''; |
||||
}, |
||||
// 删除流程卡号标签 |
||||
handleClose(tag) { |
||||
this.orderIdList = this.orderIdList.filter(item => item !== tag); |
||||
}, |
||||
closeDialog() { |
||||
this.openShow = false; |
||||
this.form = { |
||||
boxBarcode: '', |
||||
orderNo: '', |
||||
}; |
||||
this.orderIdList = []; |
||||
this.$emit('closeDialog'); |
||||
}, |
||||
submit() { |
||||
this.$refs.form.validate(async valid => { |
||||
if (valid) { |
||||
if (this.orderIdList.length === 0) { |
||||
this.$message.warning('请至少添加一个流程卡号'); |
||||
return; |
||||
} |
||||
|
||||
this.submitLoading = true; |
||||
let params = { |
||||
boxBarcode: this.form.boxBarcode, |
||||
orderList: this.orderIdList, |
||||
}; |
||||
|
||||
boxBinding(params) |
||||
.then(res => { |
||||
this.$message.success('操作成功'); |
||||
this.submitLoading = false; |
||||
this.closeDialog(); |
||||
}) |
||||
.catch(err => { |
||||
this.submitLoading = false; |
||||
}); |
||||
} |
||||
}); |
||||
}, |
||||
}, |
||||
}; |
||||
</script> |
||||
<style lang="scss" scoped></style> |
||||
@ -0,0 +1,300 @@ |
||||
<template> |
||||
<basic-container> |
||||
<avue-crud |
||||
:option="option" |
||||
:table-loading="loading" |
||||
:data="data" |
||||
v-model="form" |
||||
v-model:page="page" |
||||
ref="crud" |
||||
@row-del="rowDel" |
||||
@search-change="searchChange" |
||||
@search-reset="searchReset" |
||||
@selection-change="selectionChange" |
||||
@current-change="currentChange" |
||||
@size-change="sizeChange" |
||||
@refresh-change="refreshChange" |
||||
@on-load="onLoad" |
||||
> |
||||
<template #menu-left> |
||||
<el-button type="primary" @click="addFn">新增</el-button> |
||||
<el-button type="primary" @click="unbindFn">解绑</el-button> |
||||
</template> |
||||
<template #menu-right> </template> |
||||
</avue-crud> |
||||
<!-- 新增 --> |
||||
<addPackingDialog |
||||
v-if="showAddDialogd" |
||||
:showDialog="showAddDialogd" |
||||
@closeDialog="closeDialog" |
||||
></addPackingDialog> |
||||
<!-- 解绑 --> |
||||
<unbindDialog |
||||
v-if="showUnbindDialogd" |
||||
:showDialog="showUnbindDialogd" |
||||
:rowItem="rowItem" |
||||
@closeDialog="closeDialog" |
||||
></unbindDialog> |
||||
</basic-container> |
||||
</template> |
||||
|
||||
<script> |
||||
import addPackingDialog from './components/addPackingDialog.vue'; |
||||
import unbindDialog from './components/unbindDialog.vue'; |
||||
import { getList ,boxUnbind} from '@/api/logisticsManagement/materialPacking'; |
||||
export default { |
||||
components: { |
||||
addPackingDialog, |
||||
unbindDialog |
||||
}, |
||||
data() { |
||||
return { |
||||
showReceiveDialog: false, |
||||
showReturnDialog: false, |
||||
showAddDialogd: false, |
||||
showUnbindDialogd:false, |
||||
rowItem: {}, |
||||
form: {}, |
||||
selectionList: [], |
||||
query: {}, |
||||
loading: false, |
||||
page: { |
||||
pageSize: 10, |
||||
currentPage: 1, |
||||
total: 0, |
||||
}, |
||||
option: { |
||||
columnSort: true, |
||||
tip: false, |
||||
height: 'auto', |
||||
calcHeight: 32, |
||||
simplePage: false, |
||||
searchShow: true, |
||||
searchMenuSpan: 6, |
||||
searchIcon: true, |
||||
searchIndex: 3, |
||||
tree: false, |
||||
border: true, |
||||
index: true, |
||||
selection: false, |
||||
addBtn: false, |
||||
editBtn: false, |
||||
viewBtn: false, |
||||
delBtn: false, |
||||
editBtnText: '修改', |
||||
labelWidth: 120, |
||||
menuWidth: 80, |
||||
dialogWidth: 900, |
||||
dialogClickModal: false, |
||||
searchEnter: true, |
||||
excelBtn: false, |
||||
filterBtn: true, |
||||
searchShowBtn: false, |
||||
excelBtn: true, |
||||
showOverflowTooltip: true, |
||||
addBtnIcon: ' ', |
||||
viewBtnIcon: ' ', |
||||
delBtnIcon: ' ', |
||||
editBtnIcon: ' ', |
||||
gridBtn: false, |
||||
searchLabelPosition: 'left', |
||||
searchGutter: 24, |
||||
searchSpan: 6, |
||||
menuAlign: 'left', |
||||
gridBtn: false, |
||||
searchMenuPosition: 'right', |
||||
align: 'center', |
||||
menu: false, |
||||
column: [ |
||||
{ |
||||
label: '箱条码', |
||||
prop: 'boxBarcode', |
||||
search: true, |
||||
sortable: true, |
||||
span: 12, |
||||
}, |
||||
// { |
||||
// label: '作业中心', |
||||
// prop: 'wcName', |
||||
// search: false, |
||||
// sortable: true, |
||||
// span: 12, |
||||
// }, |
||||
// { |
||||
// label: '作业中心', |
||||
// prop: 'wcId', |
||||
// search: false, |
||||
// sortable: true, |
||||
// span: 12, |
||||
// hide: true, |
||||
// type: 'select', |
||||
// filterable: true, |
||||
// dicUrl: '/blade-desk/order/bs-list', |
||||
// props: { |
||||
// label: 'wcName', |
||||
// value: 'id', |
||||
// }, |
||||
// }, |
||||
{ |
||||
label: '状态', |
||||
prop: 'statusDesc', |
||||
search: false, |
||||
sortable: true, |
||||
span: 12, |
||||
type: 'select', |
||||
dicData: [ |
||||
{ label: '未绑定', value: 0 }, |
||||
{ label: '已绑定', value: 1 }, |
||||
{ label: '已解绑', value: 2 }, |
||||
|
||||
], |
||||
}, |
||||
{ |
||||
label: '创建时间', |
||||
prop: 'createTime', |
||||
search: false, |
||||
sortable: true, |
||||
span: 12, |
||||
}, |
||||
{ |
||||
label: '时间范围', |
||||
prop: 'crDate', |
||||
sortable: true, |
||||
filter: true, |
||||
// selectWidth: 150, |
||||
span: 8, |
||||
search: true, |
||||
width: 150, |
||||
searchSpan: 6, |
||||
hide: true, |
||||
type: 'date', |
||||
format: 'YYYY-MM-DD', |
||||
valueFormat: 'YYYY-MM-DD', |
||||
startPlaceholder: '开始日期', |
||||
endPlaceholder: '结束日期', |
||||
rangeSeparator: '-', |
||||
searchRange: true, |
||||
}, |
||||
], |
||||
}, |
||||
|
||||
data: [], |
||||
}; |
||||
}, |
||||
methods: { |
||||
addFn() { |
||||
this.showAddDialogd = true; |
||||
}, |
||||
unbindFn(){ |
||||
this.showUnbindDialogd = true; |
||||
}, |
||||
closeDialog() { |
||||
this.showAddDialogd = false; |
||||
this.showReturnDialog = false; |
||||
this.showReceiveDialog = false; |
||||
this.showUnbindDialogd=false; |
||||
this.onLoad(this.page, this.query); |
||||
}, |
||||
rowSave(row, done, loading) { |
||||
// addPersonAbility(row).then( |
||||
// () => { |
||||
// this.onLoad(this.page); |
||||
// this.$message({ |
||||
// type: 'success', |
||||
// message: '操作成功!', |
||||
// }); |
||||
// done(); |
||||
// }, |
||||
// error => { |
||||
// window.console.log(error); |
||||
// loading(); |
||||
// } |
||||
// ); |
||||
}, |
||||
rowUpdate(row, index, done, loading) { |
||||
// updatePersonAbility(row).then( |
||||
// () => { |
||||
// this.onLoad(this.page); |
||||
// this.$message({ |
||||
// type: 'success', |
||||
// message: '操作成功!', |
||||
// }); |
||||
// done(); |
||||
// }, |
||||
// error => { |
||||
// window.console.log(error); |
||||
// loading(); |
||||
// } |
||||
// ); |
||||
}, |
||||
rowDel(row) { |
||||
this.$confirm('确定将选择数据删除?', { |
||||
confirmButtonText: '确定', |
||||
cancelButtonText: '取消', |
||||
type: 'warning', |
||||
}) |
||||
.then(() => { |
||||
// return removePersonAbility(row.id); |
||||
}) |
||||
.then(() => { |
||||
this.onLoad(this.page); |
||||
this.$message({ |
||||
type: 'success', |
||||
message: '操作成功!', |
||||
}); |
||||
}); |
||||
}, |
||||
|
||||
searchReset() { |
||||
this.query = {}; |
||||
this.onLoad(this.page); |
||||
}, |
||||
searchChange(params, done) { |
||||
this.query = params; |
||||
this.page.currentPage = 1; |
||||
this.onLoad(this.page, params); |
||||
done(); |
||||
}, |
||||
selectionChange(list) { |
||||
this.selectionList = list; |
||||
}, |
||||
selectionClear() { |
||||
this.selectionList = []; |
||||
this.$refs.crud.toggleSelection(); |
||||
}, |
||||
|
||||
currentChange(currentPage) { |
||||
this.page.currentPage = currentPage; |
||||
}, |
||||
sizeChange(pageSize) { |
||||
this.page.pageSize = pageSize; |
||||
}, |
||||
refreshChange() { |
||||
this.onLoad(this.page, this.query); |
||||
}, |
||||
handleChange(file, fileList) { |
||||
// proxy.$Export.xlsx(file.raw).then((data) => { |
||||
// data.value = data.results; |
||||
// }); |
||||
this.$message({ |
||||
type: 'success', |
||||
message: '操作成功!', |
||||
}); |
||||
}, |
||||
|
||||
onLoad(page, params = {}) { |
||||
this.loading = true; |
||||
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; |
||||
this.loading = false; |
||||
this.page.total = res.data.data.total; |
||||
}); |
||||
}, |
||||
}, |
||||
mounted() {}, |
||||
}; |
||||
</script> |
||||
Loading…
Reference in new issue