|  |  |  | 
|---|
|  |  |  | <span>{{ item.materialName }} | {{ item.materialCode }}</span> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | <div class="rework_qd_item_cate"> | 
|---|
|  |  |  | <span class="green" v-if="item.qualityType === '0'">合格 | </span> | 
|---|
|  |  |  | <span class="yellow" v-if="item.qualityType === '1'">不良 | </span> | 
|---|
|  |  |  | <span class="red" v-if="item.qualityType === '2'">报废 | </span> | 
|---|
|  |  |  | <span>{{ item.procedureName }} | </span> | 
|---|
|  |  |  | <span>{{ item.batch }}</span> | 
|---|
|  |  |  | <span class="green" v-if="item.qualityType === '0'">合格</span> | 
|---|
|  |  |  | <span class="yellow" v-if="item.qualityType === '1'">不良</span> | 
|---|
|  |  |  | <span class="red" v-if="item.qualityType === '2'">报废</span> | 
|---|
|  |  |  | <span> | {{ item.procedureName || '-' }} | </span> | 
|---|
|  |  |  | <span>{{ item.batch || '-' }}</span> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | <div class="rework_qd_item_hw"> | 
|---|
|  |  |  | <span>出库货位:{{ item.locationName }}</span> | 
|---|
|  |  |  | <div class="rework_qd_item_hw_right"> | 
|---|
|  |  |  | <span>数量:</span> | 
|---|
|  |  |  | <input type="number" v-model="item.num" placeholder="0" /> | 
|---|
|  |  |  | <input type="number" v-model="item.num" @input="changeNum(item)" placeholder="0" /> | 
|---|
|  |  |  | <span>{{ item.unitName }}</span> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | 
|---|
|  |  |  | <Warehouse :show="warehouseShow" @close="close" @value="getValue" /> | 
|---|
|  |  |  | <Materials ref="Material" :show="materialsShow" :id="form.warehouseId.toString()" @close="close1" @value="getValue1" /> | 
|---|
|  |  |  | <!-- 单据类型 --> | 
|---|
|  |  |  | <van-popup v-model:show="typeShow" position="bottom" :style="{ height: '50%' }"> | 
|---|
|  |  |  | <van-popup v-model:show="typeShow" round position="bottom" :style="{ height: '50%' }"> | 
|---|
|  |  |  | <van-picker | 
|---|
|  |  |  | :columns="columns" | 
|---|
|  |  |  | @confirm="onConfirm1" | 
|---|
|  |  |  | 
|---|
|  |  |  | import { useRouter } from 'vue-router' | 
|---|
|  |  |  | import { Toast } from 'vant' | 
|---|
|  |  |  | import { createForStandard } from '@/apis/WorkOrderAPI' | 
|---|
|  |  |  | import Warehouse from '@/components/common/Warehouse.vue' | 
|---|
|  |  |  | import Materials from '@/components/common/Materials.vue' | 
|---|
|  |  |  | import Warehouse from '@/components/newCom/Warehouse.vue' | 
|---|
|  |  |  | import Materials from '@/components/newCom/MaterialsB.vue' | 
|---|
|  |  |  | const Material = ref(null) | 
|---|
|  |  |  | const router = useRouter() | 
|---|
|  |  |  | // 表单数据 | 
|---|
|  |  |  | 
|---|
|  |  |  | const onCancel = () => { | 
|---|
|  |  |  | typeShow.value = false | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | const changeNum = (obj: any) => { | 
|---|
|  |  |  | if (obj.num < 0) { | 
|---|
|  |  |  | obj.num = '' | 
|---|
|  |  |  | return Toast('出库物料数量必须大于0') | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if (obj.num > obj.total) { | 
|---|
|  |  |  | obj.num = '' | 
|---|
|  |  |  | return Toast('出库物料数量不能大于库存数') | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | // 获取当天年月日 | 
|---|
|  |  |  | const getDay = () => { | 
|---|
|  |  |  | var date = new Date(); | 
|---|
|  |  |  | 
|---|
|  |  |  | // 提交 | 
|---|
|  |  |  | const onConfirm = () => { | 
|---|
|  |  |  | if (!form.type) return Toast('请选择单据类型') | 
|---|
|  |  |  | if (!form.warehouseId) return Toast('请选择出库仓库') | 
|---|
|  |  |  | if (list.value.length === 0) return Toast('至少选择一条出库物料') | 
|---|
|  |  |  | for (let i = 0; i < list.value.length; i++) { | 
|---|
|  |  |  | if (!list.value[i].num || list.value[i].num == '' || list.value[i].num == 0) { | 
|---|
|  |  |  | if (!list.value[i].num || list.value[i].num == '' || list.value[i].num <= 0) { | 
|---|
|  |  |  | return Toast(`第${i + 1}个出库物料数量必须大于0`) | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if (list.value[i].num > list.value[i].total) { | 
|---|
|  |  |  | 
|---|
|  |  |  | const getValue = (item: any): void => { | 
|---|
|  |  |  | form.warehouseName = item.name | 
|---|
|  |  |  | form.warehouseId = item.id | 
|---|
|  |  |  | list.value = [] | 
|---|
|  |  |  | warehouseShow.value = false | 
|---|
|  |  |  | } | 
|---|
|  |  |  | const getValue1 = (item: any): void => { | 
|---|
|  |  |  | 
|---|
|  |  |  | color: #666666; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | input { | 
|---|
|  |  |  | width: 140px; | 
|---|
|  |  |  | width: 180px; | 
|---|
|  |  |  | height: 60px; | 
|---|
|  |  |  | font-size: 28px; | 
|---|
|  |  |  | font-family: PingFangSC-Regular, PingFang SC; | 
|---|
|  |  |  | 
|---|
|  |  |  | color: #333333; | 
|---|
|  |  |  | background: #FFFFFF; | 
|---|
|  |  |  | border-radius: 8px; | 
|---|
|  |  |  | border: 1px solid #CCCCCC; | 
|---|
|  |  |  | border: 1PX solid #CCCCCC; | 
|---|
|  |  |  | margin: 0 20px; | 
|---|
|  |  |  | padding: 0 30px; | 
|---|
|  |  |  | box-sizing: border-box; | 
|---|