| <template> | 
|     <u-modal :show="show" title="入库确认" :closeOnClickOverlay="true" :showCancelButton="true" @cancel="handlerCancel" | 
|         @confirm="handlerConfirm" @close="handlerCancel"> | 
|         <u-form labelPosition="left" labelWidth="100rpx" :model="form" :rules="rules" ref="uForm"> | 
|             <u-form-item required label="密码" prop="pwd"> | 
|                 <u-input v-model="form.pwd" type="password" placeholder="请输入密码" style="width: 450rpx;"></u-input> | 
|             </u-form-item> | 
|         </u-form> | 
|   | 
|         <!-- <view class="status_flex"> | 
|             <u-input v-model="pwd" type="password" placeholder="请输入密码" style="width: 450rpx;"></u-input> | 
|         </view> --> | 
|     </u-modal> | 
| </template> | 
|   | 
| <script> | 
|     import { | 
|         $alert | 
|     } from '@/static/js/utils/index.js' | 
|     import { | 
|         outBoundWorkPiece | 
|     } from '@/api/outBound/index.js' | 
|     export default { | 
|         emits: ['update'], | 
|         data() { | 
|             return { | 
|                 show: false, | 
|                 workPieceData:[], | 
|                 form: { | 
|                     pwd: '' | 
|                 }, | 
|                 rules: { | 
|                     pwd: { | 
|                         type: 'string', | 
|                         required: true, | 
|                         message: '请输入密码', | 
|                         trigger: ['blur', 'change'] | 
|                     } | 
|                 } | 
|             } | 
|         }, | 
|         onReady() { | 
|             this.$refs.uForm.setRules(this.rules) | 
|         }, | 
|         methods: { | 
|             showModal(workPieceData){ | 
|                 this.show=true | 
|                 this.workPieceData=workPieceData     | 
|             }, | 
|             handlerCancel() { | 
|                 this.form =  { | 
|                     pwd: '', | 
|                 } | 
|                 this.show = false | 
|             }, | 
|             // 选中的状态传递给父组件 | 
|             handlerConfirm() { | 
|                 console.log(111); | 
|                 this.$refs.uForm.validate().then(res => { | 
|                     const params = { | 
|                         password: this.form.pwd, | 
|                         workPieceInfoLst:this.workPieceData | 
|                     } | 
|                     console.log(params,'params'); | 
|                     outBoundWorkPiece(params).then(res => { | 
|                         uni.showToast({ | 
|                             title: '出库成功' | 
|                         }) | 
|                         this.$emit('reflesh') | 
|                         this.handlerCancel() | 
|                     }) | 
|                 }).catch(errors => { | 
|                     console.log(errors,'22'); | 
|                 }) | 
|             } | 
|   | 
|         } | 
|     } | 
| </script> | 
|   | 
| <style lang="scss" scoped> | 
|     .status_flex { | 
|         width: 100%; | 
|         display: flex; | 
|         flex-direction: column; | 
|         justify-content: center; | 
|         align-items: center; | 
|   | 
|         .flex_item { | 
|             width: 450rpx; | 
|             height: 70rpx; | 
|             text-align: center; | 
|             line-height: 70rpx; | 
|             border: 1px solid $color-common; | 
|             color: $color-common; | 
|             font-size: 32rpx; | 
|             font-weight: 550; | 
|             background: #fff; | 
|             margin-bottom: 30rpx; | 
|         } | 
|   | 
|         .active_item { | 
|             background: $color-common; | 
|             color: #fff; | 
|         } | 
|     } | 
|      | 
|     ::v-deep .u-transition { | 
|       z-index: 99 !important; | 
|     } | 
| </style> |