<template>
|
<view class="example">
|
<u-tabs :list="list" :is-Scroll="false" :current="current2"></u-tabs>
|
<view v-show="current2===0">
|
<uni-section title="上料任务添加" type="line" padding style="height: calc(100vh - 100px);">
|
<uni-forms ref="form" :modelValue="baseFormData" :rules="formRules">
|
<uni-forms-item label="缓存架条码" label-width="120" required name="HCJInput">
|
<uni-easyinput v-model="baseFormData.HCJInput" placeholder="请扫描缓存架条码" @input="input" />
|
</uni-forms-item>
|
<uni-forms-item label-width="120" label="物流线" name="sexs" required>
|
<uni-data-checkbox v-model="baseFormData.sex2" :localdata="sexs2" />
|
</uni-forms-item>
|
|
<uni-forms-item label="极卷库条码" label-width="120" required name="classes">
|
<uni-data-select placeholder="请选择极卷库缓存架条码" :localdata="dataTree"
|
v-model="baseFormData.classes">
|
</uni-data-select>
|
</uni-forms-item>
|
</uni-forms>
|
<u-button type="success" size="default" shape="circle" :ripple="true" ripple-bg-color="#909399"
|
@click="submit()">
|
添加任务
|
</u-button>
|
</uni-section>
|
</view>
|
</view>
|
</template>
|
|
<script>
|
export default {
|
data() {
|
return {
|
baseFormData: {
|
HCJInput: '',
|
classes: '',
|
sex2: '1'
|
},
|
list: [{
|
name: '分切后上二楼极卷库任务添加'
|
}],
|
sexs2: [{
|
text: '一线',
|
value: '1'
|
}, {
|
text: '二线',
|
value: '2'
|
}],
|
dataTree: [],
|
formRules: {
|
classes: {
|
rules: [{
|
required: true,
|
errorMessage: '设备编号不能为空'
|
}]
|
},
|
HCJInput: {
|
rules: [{
|
required: true,
|
errorMessage: '缓存架不能为空'
|
}]
|
}
|
},
|
current2: 0,
|
}
|
},
|
methods: {
|
input(e) {
|
if (e.length === 13 && e.includes('XL-FQHCJ')) {
|
let formDataParam = {
|
UpperCode: e,
|
Type: "JJHCJ",
|
LocationState:"LocationState_Empty",
|
RunLine:this.baseFormData.sex2
|
}
|
this.$u.post('/api/PDA/GetDynamicAsync', formDataParam).then(res => {
|
|
if (res != undefined) {
|
this.dataTree = res;
|
}
|
else {
|
this.dataTree=[];
|
this.$t.message.toast("暂无有货缓存架")
|
}
|
})
|
}
|
},
|
submit() {
|
this.$refs.form.validate().then((res) => {
|
this.$t.message.loading()
|
let bz = this.baseFormData.HCJInput.split('-')[0];
|
let AgvCode = bz == "ZJSL" ? "正极1号AGV" : "负极1号AGV"
|
let formDataParam = {}
|
formDataParam = {
|
AgvCode: "中段1号AGV",
|
AgvFromAddress: this.baseFormData.HCJInput,
|
AgvToAddress: this.baseFormData.classes,
|
AgvBarcode: '',
|
AgvGrade: "1",
|
AgvTaskQty: '1',
|
AgvTaskState: "Create",
|
AgvTaskType: 'TaskType_Outbound',
|
AgvWorkType: '1',
|
AgvLine:this.baseFormData.sex2
|
}
|
this.$u.post('/api/PDA/CreatePDATask', formDataParam).then(res => {
|
this.$t.message.closeLoading()
|
if (res.status) {
|
this.$t.message.toast(res.message)
|
setTimeout(() => {
|
this.baseFormData.HCJInput = ''
|
this.baseFormData.classes = ''
|
this.baseFormData.sex2='1'
|
this.dataTree=[];
|
}, 100);
|
} else
|
this.$t.message.toast(res.message)
|
|
}).catch((err) => {
|
this.$t.message.toast(res.message)
|
})
|
})
|
}
|
}
|
}
|
</script>
|
|
<style>
|
.example {
|
padding: 15px;
|
background-color: #fff;
|
}
|
</style>
|