<template>
|
<view class="example">
|
<!-- <u-tabs :list="list" :is-Scroll="false" :current="current2" @change="change"></u-tabs> -->
|
<uni-segmented-control :current="current2" :values="list" @clickItem="change" styleType="button"
|
activeColor="#4cd964"></uni-segmented-control>
|
<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-width="120" label="一楼/二楼" name="sexs" required>
|
<uni-data-checkbox v-model="baseFormData.sex" :localdata="sexs" @change="checkbox" />
|
</uni-forms-item>
|
<uni-forms-item label="缓存架条码" label-width="120" required name="HCJInput">
|
<uni-data-picker placeholder="请选择极卷库缓存架条码" popup-title="请选择极卷库缓存架条码" :localdata="HCJInputTree"
|
v-model="baseFormData.HCJInput" @change="onchange">
|
</uni-data-picker>
|
</uni-forms-item>
|
<uni-forms-item label-width="120" label="正极/负极" name="sexs" required>
|
<uni-data-checkbox v-model="baseFormData.sexQ" :localdata="sexss" @change="checkboxs" />
|
</uni-forms-item>
|
<uni-forms-item label-width="120" label="物流线" name="sexs" required>
|
<uni-data-checkbox v-model="baseFormData.sex2" :localdata="sexs2" @change="checkbox" />
|
</uni-forms-item>
|
<uni-forms-item label="1F冲叠条码" label-width="120" required name="classes">
|
<uni-data-picker placeholder="请选择1F冲叠缓存架条码" popup-title="请选择1F冲叠缓存架条码" :localdata="dataTree"
|
v-model="baseFormData.classes">
|
</uni-data-picker>
|
</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 v-show="current2===1">
|
<uni-section title="选择分切后有货空桶回收车,选择冲叠无货空桶回收车" type="line" padding style="height: calc(100vh - 100px);">
|
<uni-forms ref="form" :modelValue="baseFormData" :rules="formRules">
|
<uni-forms-item label-width="120" label="正极/负极" name="sexs" required>
|
<uni-data-checkbox v-model="baseFormData.sexQ" :localdata="sexss" @change="checkbox" />
|
</uni-forms-item>
|
<uni-forms-item label="空桶回收车" label-width="120" required name="HCJInput">
|
<uni-data-picker placeholder="请选择分切空桶回收车" popup-title="请选择分切空桶回收车" :localdata="HCJInputTree"
|
v-model="baseFormData.HCJInput" @change="onchange">
|
</uni-data-picker>
|
</uni-forms-item>
|
<uni-forms-item label-width="120" label="一楼/二楼" name="sexs" required>
|
<uni-data-checkbox v-model="baseFormData.sex" :localdata="sexs" @change="checkboxs" />
|
</uni-forms-item>
|
<uni-forms-item label="1F/2F空桶回收车" label-width="120" required name="classes">
|
<uni-data-picker placeholder="请选择1F/2F空桶回收车" popup-title="请选择1F/2F空桶回收车" :localdata="dataTree"
|
v-model="baseFormData.classes">
|
</uni-data-picker>
|
</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 v-show="current2===2">
|
<uni-section title="选择拆包间有货铝塑膜柜,选择1F/2F无货铝塑膜柜" 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-data-picker placeholder="请选择拆包间铝塑膜柜" popup-title="请选择拆包间铝塑膜柜" :localdata="HCJInputTree"
|
v-model="baseFormData.HCJInput" @change="onchange">
|
</uni-data-picker>
|
</uni-forms-item>
|
<uni-forms-item label-width="120" label="一楼/二楼" name="sexs" required>
|
<uni-data-checkbox v-model="baseFormData.sex" :localdata="sexs" @change="checkboxs" />
|
</uni-forms-item>
|
<uni-forms-item label="1F/2F铝塑膜柜" label-width="120" required name="classes">
|
<uni-data-picker placeholder="请选择1F/2F铝塑膜柜" popup-title="请选择1F/2F铝塑膜柜" :localdata="dataTree"
|
v-model="baseFormData.classes">
|
</uni-data-picker>
|
</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 v-show="current2===3">
|
<uni-section title="选择1F/2F有货铝塑膜柜,选择拆包间无货铝塑膜柜" type="line" padding style="height: calc(100vh - 100px);">
|
<uni-forms ref="form" :modelValue="baseFormData" :rules="formRules">
|
<uni-forms-item label-width="120" label="一楼/二楼" name="sexs" required>
|
<uni-data-checkbox v-model="baseFormData.sex" :localdata="sexs" @change="checkbox" />
|
</uni-forms-item>
|
<uni-forms-item label="1F/2F铝塑膜柜" label-width="120" required name="HCJInput">
|
<uni-data-picker placeholder="请选择1F/2F铝塑膜柜" popup-title="请选择1F/2F铝塑膜柜" :localdata="HCJInputTree"
|
v-model="baseFormData.HCJInput" @change="onchange">
|
</uni-data-picker>
|
</uni-forms-item>
|
<uni-forms-item label="拆包间铝塑膜柜" label-width="120" required name="classes">
|
<uni-data-picker placeholder="请选择拆包间铝塑膜柜" popup-title="请选择拆包间铝塑膜柜" :localdata="dataTree"
|
v-model="baseFormData.classes">
|
</uni-data-picker>
|
</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: '',
|
sex: '1F',
|
sexQ: 'ZJ'
|
},
|
list: ['冲叠空桶回收', '分切空桶回收', 'CBJ铝塑膜柜', '中段铝塑膜柜'],
|
dataTree: [],
|
HCJInputTree: [],
|
sexs: [{
|
text: '一楼',
|
value: '1F'
|
}, {
|
text: '二楼',
|
value: '2F'
|
}],
|
sexss: [{
|
text: '正极',
|
value: 'ZJ'
|
}, {
|
text: '负极',
|
value: 'FJ'
|
}],
|
formRules: {
|
classes: {
|
rules: [{
|
required: true,
|
errorMessage: '设备编号不能为空'
|
}]
|
},
|
HCJInput: {
|
rules: [{
|
required: true,
|
errorMessage: '缓存架不能为空'
|
}]
|
},
|
},
|
current2: 0,
|
flag: false
|
}
|
},
|
onLoad() {
|
this.onload(0)
|
},
|
methods: {
|
change(index) {
|
if (this.current2 != index.currentIndex) {
|
this.current2 = index.currentIndex;
|
if (this.current2 === 2) {
|
this.flag = true
|
this.onload(this.current2)
|
} else {
|
this.flag = false
|
this.onload(this.current2)
|
}
|
}
|
},
|
checkbox(e) {
|
this.onload(this.current2)
|
},
|
checkboxs(e) {
|
this.input(this.baseFormData.HCJInput)
|
},
|
onchange(e) {
|
const value = e.detail.value
|
this.input(value[0].value)
|
},
|
input(e) {
|
if (e.length === 9 && e.includes('KJT')) {
|
let upcode = '';
|
if (this.baseFormData.sexQ == 'ZJ')
|
upcode = 'ZJFQ-KJT001'
|
else
|
upcode = 'FJFQ-KJT001'
|
let formDataParam = {
|
UpperCode: upcode,
|
Type: "KJT",
|
LocationState: "LocationState_Empty"
|
}
|
this.$u.post('/biz/location/GetDynamicAsync', formDataParam).then(res => {
|
if (res.data != null) {
|
this.dataTree = res.data;
|
}
|
})
|
} else if (e.length === 11 && e.includes('FQ-KJT')) {
|
let upcode = '';
|
if (this.baseFormData.sex == '1F')
|
upcode = '1F-KJT001'
|
else
|
upcode = '2F-KJT001'
|
let formDataParam = {
|
UpperCode: upcode,
|
Type: "KJT",
|
LocationState: "LocationState_Empty"
|
}
|
this.$u.post('/biz/location/GetDynamicAsync', formDataParam).then(res => {
|
if (res.data != null) {
|
this.dataTree = res.data;
|
}
|
})
|
} else if (e.length === 9 && e.includes('CBJLSM')) {
|
let upcode = '';
|
if (this.baseFormData.sex == '1F')
|
upcode = '1F-LSM001'
|
else
|
upcode = '2F-LSM001'
|
let formDataParam = {
|
UpperCode: upcode,
|
Type: "LSM",
|
LocationState: "LocationState_Empty"
|
}
|
this.$u.post('/biz/location/GetDynamicAsync', formDataParam).then(res => {
|
if (res.data != null) {
|
this.dataTree = res.data;
|
}
|
})
|
} else if (e.length === 9 && e.includes('F-LSM')) {
|
let formDataParam = {
|
UpperCode: "CBJLSM001",
|
Type: "LSM",
|
LocationState: "LocationState_Empty"
|
}
|
this.$u.post('/biz/location/GetDynamicAsync', formDataParam).then(res => {
|
if (res.data != null) {
|
this.dataTree = res.data;
|
}
|
})
|
}
|
},
|
submit() {
|
this.$refs.form.validate().then((res) => {
|
this.$t.message.loading()
|
if (this.flag) {
|
if (this.baseFormData.HCJInput.includes('1F-CDHCJ')) {
|
let s = this.baseFormData.HCJInput.replace("SL", "XL");
|
this.baseFormData.HCJInput = s
|
}
|
} else {
|
if (this.baseFormData.HCJInput.includes('1F-CDHCJ')) {
|
let s = this.baseFormData.HCJInput.replace("XL", "SL");
|
this.baseFormData.HCJInput = this.baseFormData.classes
|
this.baseFormData.classes = s
|
}
|
}
|
let AgvCode = "中段AGV"
|
let formDataParam = {}
|
formDataParam = {
|
AgvCode: AgvCode,
|
AgvFromAddress: this.baseFormData.HCJInput,
|
AgvToAddress: this.baseFormData.classes,
|
AgvBarcode: '',
|
AgvGrade: "1",
|
AgvTaskQty: '1',
|
AgvTaskState: "Create",
|
AgvTaskType: 'TaskType_Outbound',
|
AgvWorkType: '1'
|
}
|
this.$u.post('/biz/agvtask/CreatePDATask', formDataParam).then(res => {
|
this.$t.message.closeLoading()
|
if (res.code === 200) {
|
this.$t.message.toast(res.data)
|
setTimeout(() => {
|
this.baseFormData.HCJInput = ''
|
this.baseFormData.classes = ''
|
}, 100);
|
} else
|
this.$t.message.toast(res.msg)
|
|
}).catch((err) => {
|
this.$t.message.toast(res.msg)
|
})
|
})
|
},
|
onload(index) {
|
if (index === 0) {
|
let upcode = '';
|
if (this.baseFormData.sex == '1F')
|
upcode = '1F-KJT001'
|
else
|
upcode = '2F-KJT001'
|
let formDataParam = {
|
UpperCode: upcode,
|
Type: "KJT",
|
LocationState: "LocationState_Stored"
|
}
|
this.$u.post('/biz/location/GetDynamicAsync', formDataParam).then(res => {
|
if (res.data != null) {
|
this.HCJInputTree = res.data;
|
} else {
|
this.$t.message.toast("暂无有货缓存架")
|
}
|
})
|
} else if (index === 1) {
|
let upcode = '';
|
if (this.baseFormData.sexQ == 'ZJ')
|
upcode = 'ZJFQ-KJT001'
|
else
|
upcode = 'FJFQ-KJT001'
|
let formDataParam = {
|
UpperCode: upcode,
|
Type: "KJT",
|
LocationState: "LocationState_Stored"
|
}
|
this.$u.post('/biz/location/GetDynamicAsync', formDataParam).then(res => {
|
if (res.data != null) {
|
this.HCJInputTree = res.data;
|
} else {
|
this.$t.message.toast("暂无有货缓存架")
|
}
|
})
|
} else if (index === 2) {
|
let upcode = 'CBJLSM001';
|
let formDataParam = {
|
UpperCode: upcode,
|
Type: "LSM",
|
LocationState: "LocationState_Stored"
|
}
|
this.$u.post('/biz/location/GetDynamicAsync', formDataParam).then(res => {
|
if (res.data != null) {
|
this.HCJInputTree = res.data;
|
} else {
|
this.$t.message.toast("暂无有货缓存架")
|
}
|
})
|
} else if (index === 3) {
|
let upcode = '';
|
if (this.baseFormData.sex == '1F')
|
upcode = '1F-LSM001'
|
else
|
upcode = '2F-LSM001'
|
let formDataParam = {
|
UpperCode: upcode,
|
Type: "LSM",
|
LocationState: "LocationState_Stored"
|
}
|
this.$u.post('/biz/location/GetDynamicAsync', formDataParam).then(res => {
|
if (res.data != null) {
|
this.HCJInputTree = res.data;
|
} else {
|
this.$t.message.toast("暂无有货缓存架")
|
}
|
})
|
}
|
}
|
}
|
}
|
</script>
|
|
<style>
|
.example {
|
padding: 15px;
|
background-color: #fff;
|
}
|
</style>
|