2025-12-19 16:40:25 +08:00
|
|
|
<template>
|
|
|
|
|
<view>
|
|
|
|
|
<uni-forms ref="form" :modelValue="formData" :rules="rules">
|
|
|
|
|
<uni-forms-item label="发货点位:" :labelWidth='90' name="srcLocationCode">
|
|
|
|
|
<uni-easyinput type="text" v-model="formData.srcLocationCode" />
|
|
|
|
|
</uni-forms-item>
|
|
|
|
|
<uni-forms-item label="目的货位:" :labelWidth='90' name="destLocationCode">
|
2026-01-06 17:04:59 +08:00
|
|
|
<uni-easyinput suffixIcon="scan" @iconClick="scanDestLocationUuid" type="text" @@confirm="searchSrcLocation"
|
2025-12-19 16:40:25 +08:00
|
|
|
v-model="formData.destLocationCode" />
|
|
|
|
|
</uni-forms-item>
|
|
|
|
|
</uni-forms>
|
2026-01-04 11:51:05 +08:00
|
|
|
<u-button type="success" @click="handleCall">呼叫</u-button>
|
2025-12-19 16:40:25 +08:00
|
|
|
</view>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
import { addDeliveryTask, findPreparation } from "@/api/les/lesMaterialCall.js";
|
|
|
|
|
import LesDeliveryTaskType from "@/utils/enums/LesDeliveryTaskType";
|
|
|
|
|
export default {
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
|
formData: {
|
2025-12-22 09:48:01 +08:00
|
|
|
srcLocationCode: null,
|
|
|
|
|
destLocationCode: null,
|
2025-12-19 16:40:25 +08:00
|
|
|
taskType: LesDeliveryTaskType.PRODUCTION
|
|
|
|
|
},
|
|
|
|
|
/** 校验规则 */
|
|
|
|
|
rules: {
|
|
|
|
|
srcLocationCode: {
|
|
|
|
|
rules: [{
|
|
|
|
|
required: true,
|
|
|
|
|
errorMessage: '请输入发货点位',
|
|
|
|
|
}, ]
|
|
|
|
|
},
|
|
|
|
|
destLocationCode: {
|
|
|
|
|
rules: [{
|
|
|
|
|
required: true,
|
|
|
|
|
errorMessage: '请选择目的货位',
|
|
|
|
|
}, ]
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
searchSrcLocation() {
|
|
|
|
|
const _this = this;
|
2025-12-22 09:48:01 +08:00
|
|
|
if (!_this.formData.destLocationCode) {
|
|
|
|
|
_this.formData.srcLocationCode = null;
|
2025-12-19 16:40:25 +08:00
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
findPreparation(_this.formData.destLocationCode).then(res => {
|
|
|
|
|
if (res.code == 200) {
|
|
|
|
|
this.$set(this.formData, "srcLocationCode", res.data);
|
|
|
|
|
} else {
|
|
|
|
|
this.$modal.showToast("未找到对应发货点位")
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
scanDestLocationUuid() {
|
|
|
|
|
const _this = this;
|
|
|
|
|
uni.scanCode({
|
|
|
|
|
scanType: ['qrCode', 'barCode'],
|
|
|
|
|
success: function(res) {
|
|
|
|
|
_this.formData.destLocationCode = res.result;
|
|
|
|
|
_this.searchSrcLocation();
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
handleCall() {
|
|
|
|
|
const _this = this;
|
|
|
|
|
this.$refs.form.validate().then(res => {
|
|
|
|
|
if (_this.formData.srcLocationCode && _this.formData.destLocationCode) {
|
|
|
|
|
_this.$modal.loading('提交中')
|
|
|
|
|
addDeliveryTask(_this.formData).then(res => {
|
|
|
|
|
_this.$modal.closeLoading();
|
|
|
|
|
_this.$modal.msgSuccess("提交成功!");
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
_this.$tab.switchTab("/pages/work/index");
|
|
|
|
|
}, 500);
|
|
|
|
|
})
|
|
|
|
|
} else {
|
|
|
|
|
_this.$modal.msg("请将信息补充完整")
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
}
|
|
|
|
|
}
|
2026-01-04 11:51:05 +08:00
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<style>
|
|
|
|
|
::v-deep .uni-easyinput__content-input {
|
|
|
|
|
height: 80rpx !important;
|
|
|
|
|
line-height: 60rpx !important;
|
|
|
|
|
display: flex !important;
|
|
|
|
|
align-items: center !important;
|
|
|
|
|
min-height: 80rpx !important;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.u-button {
|
|
|
|
|
height: 10% !important;
|
|
|
|
|
position: absolute;
|
|
|
|
|
bottom: 0;
|
|
|
|
|
}
|
|
|
|
|
</style>
|