| <template> | 
|     <view> | 
|         <uni-segmented-control :current="current" :values="items" @clickItem="onClickItem"> | 
|         </uni-segmented-control> | 
|         <view v-show="current === 0"> | 
|             <view style="padding: 5%;"> | 
|                 <uni-forms label-width="120"> | 
|                     <uni-forms-item label="托盘编码"> | 
|                         <uni-easyinput type="text" :focus="!istrue" @input="carNoInputChange" v-model="PalletCode" | 
|                             placeholder="请输入托盘编码" ref='midInput' /> | 
|                     </uni-forms-item> | 
|                     <uni-forms-item label="绑定货位"> | 
|                         <uni-easyinput type="text" :focus="!istrue" @input="carNoInputChange" v-model="Point" | 
|                             placeholder="请输入绑定货位点" ref='midInput' /> | 
|                     </uni-forms-item> | 
|                 </uni-forms> | 
|                 <button @click="Bind" type="primary" size="default" style="margin-top: 2%;">绑定</button> | 
|                 <u-toast ref="BindluToast" /> | 
|             </view> | 
|         </view> | 
|         <view v-show="current === 1"> | 
|             <view style="padding: 5%;"> | 
|                 <uni-forms label-width="120"> | 
|                     <uni-forms-item label="终点"> | 
|                         <uni-easyinput type="text" :focus="!istrue" @input="carNoInputChange" v-model="EndAddress" | 
|                             placeholder="请输入终点" ref='midInput' /> | 
|                     </uni-forms-item> | 
|                 </uni-forms> | 
|                 <button @click="CallMateriel" type="primary" size="default" style="margin-top: 2%;">叫料</button> | 
|                 <u-toast ref="CallMaterieluToast" /> | 
|             </view> | 
|         </view> | 
|         <view v-show="current === 2"> | 
|             <view style="padding: 5%;"> | 
|                 <uni-forms label-width="120"> | 
|                     <uni-forms-item label="起点"> | 
|                         <uni-easyinput type="text" :focus="!istrue" @input="carNoInputChange" v-model="StartAddress" | 
|                             placeholder="请输入起点" ref='midInput' /> | 
|                     </uni-forms-item> | 
|                 </uni-forms> | 
|                 <button @click="MaterielCarry" type="primary" size="default" style="margin-top: 2%;">搬运</button> | 
|                 <u-toast ref="MaterielCarryuToast" /> | 
|             </view> | 
|         </view> | 
|     </view> | 
|     </view> | 
| </template> | 
|   | 
| <script> | 
|     export default { | 
|         data() { | 
|             return { | 
|                 istrue: false, | 
|                 range: [], | 
|                 EndAddress: "", | 
|                 StartAddress: "", | 
|                 PalletCode:"", | 
|                 Point:"", | 
|                 items: ['货位绑定', '叫料', '搬运'], | 
|                 current: 0 | 
|             } | 
|         }, | 
|         // onLoad() { | 
|         //     this.getEndLocations(); | 
|         // }, | 
|         methods: { | 
|             onClickItem(e) { | 
|                 if (this.current != e.currentIndex) { | 
|                     this.current = e.currentIndex; | 
|                 } | 
|             }, | 
|             Bind() { | 
|                 if (this.PalletCode.length <= 0&&this.Point.length) { | 
|                     this.$refs.BindluToast.show({ | 
|                         title: "托盘编码跟绑定货位不能为空", | 
|                         type: "error" | 
|                     }) | 
|                     return; | 
|                 } | 
|                 var param = { | 
|                     MainData: { | 
|                         "PalletCode": this.PalletCode, | 
|                         "Point":this.Point | 
|                     }, | 
|                 } | 
|                 this.$u.post('/api/PDA/CallMateriel', param).then(res => { | 
|                     if (res.status) { | 
|                         this.$refs.uToast.show({ | 
|                             title: "呼叫Agv搬运成功", | 
|                             type: "success" | 
|                         }) | 
|                         this.EndAddress = ""; | 
|                         this.istrue = false; | 
|                     } else { | 
|                         this.$refs.BindluToast.show({ | 
|                             title: res.message, | 
|                             type: "error" | 
|                         }) | 
|                     } | 
|                 }) | 
|             }, | 
|             CallMateriel() { | 
|                 if (this.EndAddress.length <= 0) { | 
|                     this.$refs.CallMaterieluToast.show({ | 
|                         title: "请输入终点", | 
|                         type: "error" | 
|                     }) | 
|                     return; | 
|                 } | 
|                 var param = { | 
|                     MainData: { | 
|                         "endPoint": this.EndAddress | 
|                     }, | 
|                 } | 
|                 this.$u.post('/api/PDA/CallMateriel', param).then(res => { | 
|                     if (res.status) { | 
|                         this.$refs.uToast.show({ | 
|                             title: "呼叫Agv搬运成功", | 
|                             type: "success" | 
|                         }) | 
|                         this.EndAddress = ""; | 
|                         this.istrue = false; | 
|                     } else { | 
|                         this.$refs.CallMaterieluToast.show({ | 
|                             title: res.message, | 
|                             type: "error" | 
|                         }) | 
|                     } | 
|                 }) | 
|             }, | 
|             MaterielCarry() { | 
|                 if (this.StartAddress.length <= 0) { | 
|                     this.$refs.MaterielCarryuToast.show({ | 
|                         title: "请输入起点", | 
|                         type: "error" | 
|                     }) | 
|                     return; | 
|                 } | 
|                 var param = { | 
|                     MainData: { | 
|                         "startPoint": this.StartAddress | 
|                     }, | 
|                 } | 
|                 this.$u.post('/api/PDA/MaterielCarry', param).then(res => { | 
|                     if (res.status) { | 
|                         this.$refs.uToast.show({ | 
|                             title: "呼叫Agv搬运成功", | 
|                             type: "success" | 
|                         }) | 
|                         this.StartAddress = ""; | 
|                         this.istrue = false; | 
|                     } else { | 
|                         this.$refs.MaterielCarryuToast.show({ | 
|                             title: res.message, | 
|                             type: "error" | 
|                         }) | 
|                     } | 
|                 }) | 
|             }, | 
|         } | 
|     } | 
| </script> | 
|   | 
| <style lang="scss"> | 
|     @import '@/common/uni-ui.scss'; | 
|   | 
|     page { | 
|         display: flex; | 
|         flex-direction: column; | 
|         box-sizing: border-box; | 
|         background-color: #efeff4; | 
|         min-height: 100%; | 
|         height: auto; | 
|     } | 
|   | 
|     .tips { | 
|         color: #67c23a; | 
|         font-size: 14px; | 
|         line-height: 40px; | 
|         text-align: center; | 
|         background-color: #f0f9eb; | 
|         height: 0; | 
|         opacity: 0; | 
|         transform: translateY(-100%); | 
|         transition: all 0.3s; | 
|     } | 
|   | 
|     .tips-ani { | 
|         transform: translateY(0); | 
|         height: 40px; | 
|         opacity: 1; | 
|     } | 
|   | 
|     .content { | 
|         width: 100%; | 
|         display: flex; | 
|     } | 
|   | 
|     .list-picture { | 
|         width: 100%; | 
|         height: 145px; | 
|     } | 
|   | 
|     .thumb-image { | 
|         width: 100%; | 
|         height: 100%; | 
|     } | 
|   | 
|     .ellipsis { | 
|         display: flex; | 
|         overflow: hidden; | 
|     } | 
|   | 
|     .uni-ellipsis-1 { | 
|         overflow: hidden; | 
|         white-space: nowrap; | 
|         text-overflow: ellipsis; | 
|     } | 
|   | 
|     .uni-ellipsis-2 { | 
|         overflow: hidden; | 
|         text-overflow: ellipsis; | 
|         display: -webkit-box; | 
|         -webkit-line-clamp: 2; | 
|         -webkit-box-orient: vertical; | 
|     } | 
| </style> |