|  |  |  | 
|---|
|  |  |  | <view class="rework_qd_title"> | 
|---|
|  |  |  | <view class="rework_qd_title_left"> | 
|---|
|  |  |  | <view class="x"></view> | 
|---|
|  |  |  | <!-- ${list.length} --> | 
|---|
|  |  |  | <text>{{`出库物料清单`}}</text> | 
|---|
|  |  |  | </view> | 
|---|
|  |  |  | <!-- <view class="rework_qd_title_right" @click="openMs"> | 
|---|
|  |  |  | <image src="@/static/gongdan_ic_shoudong@2x.png" mode="widthFix" /> | 
|---|
|  |  |  | <text>增加出库</text> | 
|---|
|  |  |  | </view> --> | 
|---|
|  |  |  | </view> | 
|---|
|  |  |  | <van-swipe-cell v-for="(item, index) in list" :key="index"> | 
|---|
|  |  |  | <view class="rework_qd_item"> | 
|---|
|  |  |  | 
|---|
|  |  |  | <!-- 选择仓库 --> | 
|---|
|  |  |  | <Warehouse :show="warehouseShow" @close="close" @value="getValue" /> | 
|---|
|  |  |  | <!-- 选择物料 --> | 
|---|
|  |  |  | <SelectMultipleMaterial ref="SelectMultipleMaterial" /> | 
|---|
|  |  |  | <SelectMultipleMaterial | 
|---|
|  |  |  | ref="SelectMultipleMaterial" | 
|---|
|  |  |  | :selected="list.map(item => item.id) || []" | 
|---|
|  |  |  | :warehouseId="form.warehouseId.toString()" | 
|---|
|  |  |  | :warehouseQualityType="form.warehouseQualityType" | 
|---|
|  |  |  | @value="getValue1" /> | 
|---|
|  |  |  | <!-- 单据类型 --> | 
|---|
|  |  |  | <u-picker :show="typeShow" :columns="columns" @cancel="typeShow = false" @confirm="onConfirm1" keyName="name"></u-picker> | 
|---|
|  |  |  | </view> | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <script> | 
|---|
|  |  |  | import Warehouse from '../../components/Warehouse.vue' | 
|---|
|  |  |  | import SelectMultipleMaterial from '@/components/SelectMultipleMaterial.vue' | 
|---|
|  |  |  | import SelectMultipleMaterial from '../../components/multipleMaterial.vue' | 
|---|
|  |  |  | import { createForStandard } from '@/util/api/WorkOrderAPI' | 
|---|
|  |  |  | export default { | 
|---|
|  |  |  | components: { Warehouse, SelectMultipleMaterial }, | 
|---|
|  |  |  | data() { | 
|---|
|  |  |  | 
|---|
|  |  |  | form: { | 
|---|
|  |  |  | warehouseName: '', | 
|---|
|  |  |  | warehouseId: '', | 
|---|
|  |  |  | warehouseQualityType: '', | 
|---|
|  |  |  | type: '', | 
|---|
|  |  |  | typeName: '' | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | 
|---|
|  |  |  | }; | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | methods: { | 
|---|
|  |  |  | // 选择物料 | 
|---|
|  |  |  | getValue1(item) { | 
|---|
|  |  |  | item.forEach((row) => { | 
|---|
|  |  |  | row.total = JSON.parse(JSON.stringify(row.num)) | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | this.list = [...item, ...this.list] | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | changeNum(obj) { | 
|---|
|  |  |  | if (obj.num < 0) { | 
|---|
|  |  |  | obj.num = '' | 
|---|
|  |  |  | 
|---|
|  |  |  | // 选择仓库回调 | 
|---|
|  |  |  | getValue(item) { | 
|---|
|  |  |  | this.form.warehouseName = item.name | 
|---|
|  |  |  | this.form.warehouseId = item.id || 1 | 
|---|
|  |  |  | this.form.warehouseId = item.id | 
|---|
|  |  |  | this.form.warehouseQualityType = item.tmodel.label | 
|---|
|  |  |  | this.list = [] | 
|---|
|  |  |  | this.warehouseShow = false | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | 
|---|
|  |  |  | woutBoundDetailBeans: this.list | 
|---|
|  |  |  | }).then(res => { | 
|---|
|  |  |  | if (res.code === 200) { | 
|---|
|  |  |  | uni.showToast({ title: '出库成功', icon: 'none', duration: 2000 }); | 
|---|
|  |  |  | uni.showToast({ title: '出库成功', icon: 'success', duration: 2000 }); | 
|---|
|  |  |  | setTimeout(() => { | 
|---|
|  |  |  | uni.navigateBack({ delta: 1 }); | 
|---|
|  |  |  | }, 2000) | 
|---|