parent
e9fe530f08
commit
b115d7c258
3 changed files with 195 additions and 43 deletions
@ -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> |
||||||
Loading…
Reference in new issue