| | |
| | | </view> |
| | | <van-swipe-cell v-for="(item, index) in list" :key="index"> |
| | | <view class="rework_qd_list"> |
| | | <view class="rework_qd_item"> |
| | | <view class="rework_qd_item" @click="locationShow = true"> |
| | | <text><b>*</b>入库货位</text> |
| | | <view class="rework_qd_item_right"> |
| | | <text :class="item.locationName ? 'black' : ''">{{item.locationName ? item.locationName : '请选择'}}</text> |
| | | <u-icon name="arrow-right"></u-icon> |
| | | </view> |
| | | </view> |
| | | <view class="rework_qd_item"> |
| | | <view class="rework_qd_item" @click="materialsShow = true"> |
| | | <text><b>*</b>入库物料</text> |
| | | <view class="rework_qd_item_right"> |
| | | <text :class="item.materialName ? 'black' : ''">{{item.materialName ? item.materialName : '请选择'}}</text> |
| | |
| | | </view> |
| | | </view> |
| | | <template v-if="form.type !== 25"> |
| | | <view class="rework_qd_item"> |
| | | <view class="rework_qd_item" @click="productionShow = true"> |
| | | <text>生产工序</text> |
| | | <view class="rework_qd_item_right"> |
| | | <text :class="item.procedureName ? 'black' : ''">{{item.procedureName ? item.procedureName : '请选择'}}</text> |
| | |
| | | </view> |
| | | </view> |
| | | </template> |
| | | <view class="rework_qd_item"> |
| | | <view class="rework_qd_item" @click="qualityShow = true"> |
| | | <text><b>*</b>质量属性</text> |
| | | <view class="rework_qd_item_right"> |
| | | <text :class="item.qualityTypeName ? 'black' : ''">{{item.qualityTypeName ? item.qualityTypeName : '请选择'}}</text> |
| | |
| | | <view class="rework_qd_item"> |
| | | <text>批次号</text> |
| | | <view class="rework_qd_item_right"> |
| | | <u--input placeholder="请输入" style="width: 230rpx;" border="surround" v-model="item.batch"></u--input> |
| | | <u--input placeholder="请输入" inputAlign="right" :customStyle="{width: '230rpx'}" border="surround" v-model="item.batch"></u--input> |
| | | </view> |
| | | </view> |
| | | <view class="rework_qd_item"> |
| | | <text><b>*</b>入库数量<template v-if="item.unitName">({{ item.unitName }})</template></text> |
| | | <view class="rework_qd_item_right"> |
| | | <u--input placeholder="0" border="surround" v-model="item.num"></u--input> |
| | | <u--input placeholder="0" inputAlign="right" :customStyle="{width: '230rpx'}" border="surround" v-model="item.num"></u--input> |
| | | </view> |
| | | </view> |
| | | </view> |
| | |
| | | </van-swipe-cell> |
| | | </view> |
| | | <view class="rework_zw"></view> |
| | | <!-- 底部操作按钮 --> |
| | | <view class="rework_footer"> |
| | | <button class="rework_footer_submit">提交</button> |
| | | </view> |
| | | <u-toast ref="uToast"></u-toast> |
| | | <!-- 仓库 --> |
| | | <Warehouse :show="warehouseShow" @close="close" @value="getValue" /> |
| | | <!-- 物料 --> |
| | | <Material :show="materialsShow" @close="close1" @value="getValue1" /> |
| | | <!-- 货位 --> |
| | | <location :show="locationShow" @close="close1" @value="getValue1" /> |
| | | <location :show="locationShow" :list="locationList" @close="close3" @value="getValue3" /> |
| | | <!-- 工序 --> |
| | | <ProductionProcess :show="productionShow" :list="productionList" @close="close4" @value="getValue4" /> |
| | | <!-- 单据类型 --> |
| | | <u-picker :show="typeShow" keyName="name" :columns="typeList" @confirm="confirm" @cancel="typeClose"></u-picker> |
| | | <!-- 质量属性 --> |
| | | <u-picker :show="qualityShow" :columns="columns" @cancel="qualityShow = false" keyName="name" @confirm="onConfirm1"></u-picker> |
| | | </view> |
| | | </template> |
| | | |
| | | <script> |
| | | import Warehouse from '../../components/Warehouse.vue' |
| | | import location from '../../components/location.vue' |
| | | import Material from '../../components/Material.vue' |
| | | import ProductionProcess from '../../components/ProductionProcess.vue' |
| | | export default { |
| | | components: { Warehouse, location }, |
| | | components: { Warehouse, location, Material, ProductionProcess }, |
| | | data() { |
| | | return { |
| | | i: 0, |
| | | form: { |
| | | warehouseName: '', |
| | | warehouseId: '', |
| | | type: '', |
| | | typeName: '' |
| | | }, |
| | | locationList: [], |
| | | productionList: [], |
| | | columns: [ |
| | | [ |
| | | { name: '合格', id: '0' }, |
| | | { name: '不良', id: '1' }, |
| | | { name: '报废', id: '2' } |
| | | ] |
| | | ], |
| | | list: [ |
| | | { |
| | | batch: '', |
| | |
| | | typeList: [[{name: '采购入库', id: 25}, {name: '库存调整', id: 28}]], |
| | | warehouseShow: false, |
| | | typeShow: false, |
| | | locationShow: false |
| | | locationShow: false, |
| | | materialsShow: false, |
| | | productionShow: false, |
| | | qualityShow: false |
| | | }; |
| | | }, |
| | | methods: { |
| | | // 质量属性确认 |
| | | onConfirm1(value) { |
| | | this.form.typeName = value.name |
| | | this.form.type = value.id |
| | | if (value.id == 25) { |
| | | this.list.forEach(item => { |
| | | item.procedureId = '' |
| | | item.procedureName = '' |
| | | }) |
| | | } |
| | | this.typeShow = false |
| | | }, |
| | | // 选择物料 |
| | | getValue1(item) { |
| | | this.list[this.i].materialName = item.mmodelUnionName |
| | | this.list[this.i].materialId = item.id |
| | | this.list[this.i].unitId = item.unitId |
| | | this.list[this.i].hasBom = item.hasBom |
| | | this.list[this.i].unitName = item.umodelName |
| | | // 获取物料下工序 |
| | | getListByMaterialId({ |
| | | materialId: item.id |
| | | }).then(res => { |
| | | if (res.code === 200) { |
| | | productionList.value = res.data |
| | | this.list[this.i].procedureId = '' |
| | | this.list[this.i].procedureName = '' |
| | | } |
| | | }) |
| | | materialsShow.value = false |
| | | }, |
| | | // 关闭仓库选择弹框 |
| | | close1() { |
| | | this.materialsShow = false |
| | | }, |
| | | // 选择货位 |
| | | getValue3(item) { |
| | | this.list[this.i].locationId = item.id |
| | | this.list[this.i].locationName = item.unionName |
| | | this.list[this.i].qualityType = '' |
| | | this.list[this.i].qualityTypeName = '' |
| | | this.list[this.i].locationIdLabel = item.label |
| | | if (item.label === 'APPLIANCE_ONTEST') { |
| | | this.list[this.i].qualityType = '0' |
| | | this.list[this.i].qualityTypeName = '合格' |
| | | } else if (item.label === 'APPLIANCE_OFFTEST') { |
| | | this.list[this.i].qualityType = '1' |
| | | this.list[this.i].qualityTypeName = '不良' |
| | | } else if (item.label === 'APPLIANCE_USELESS') { |
| | | this.list[this.i].qualityType = '2' |
| | | this.list[this.i].qualityTypeName = '报废' |
| | | } |
| | | this.locationShow = false |
| | | }, |
| | | // 关闭货位选择弹框 |
| | | close3() { |
| | | this.locationShow = false |
| | | }, |
| | | // 确认单据类型 |
| | | confirm(val) { |
| | | this.form.type = val.value[0].id |