bug
jiangping
2023-12-06 1f4e7d0f73a73e7350cf5a1df279d5f30904c5d5
h5_standard/src/views/needToBeDealtWith/addWarehousing.vue
@@ -43,13 +43,15 @@
                            <van-icon name="arrow" size="20" color="#999999" />
                        </div>
                    </div>
                    <div class="rework_qd_item" v-if="form.type != 25" @click="openGX(index)">
                        <span>生产工序</span>
                        <div class="rework_qd_item_right">
                            <span :class="item.procedureName ? 'black' : ''">{{item.procedureName ? item.procedureName : '请选择'}}</span>
                            <van-icon name="arrow" size="20" color="#999999" />
                    <template v-if="form.type !== 25">
                        <div class="rework_qd_item" v-if="item.hasBom !== 0" @click="openGX(index)">
                            <span>生产工序</span>
                            <div class="rework_qd_item_right">
                                <span :class="item.procedureName ? 'black' : ''">{{item.procedureName ? item.procedureName : '请选择'}}</span>
                                <van-icon name="arrow" size="20" color="#999999" />
                            </div>
                        </div>
                    </div>
                    </template>
                    <div class="rework_qd_item" @click="openQ(index)">
                        <span><b>*</b>质量属性</span>
                        <div class="rework_qd_item_right">
@@ -139,10 +141,12 @@
        {
            batch: '',
            locationId: '',
            locationIdLabel: '',
            locationName: '',
            materialId: '',
            materialName: '',
            num: '',
            hasBom: '',
            procedureId: '',
            procedureName: '',
            qualityType: '',
@@ -165,11 +169,15 @@
    }
    // 打开选择物料
    const openQ = (index: number) => {
        if (list.value[index].locationIdLabel == 'APPLIANCE_ONTEST' || list.value[index].locationIdLabel == 'APPLIANCE_OFFTEST' || list.value[index].locationIdLabel == 'APPLIANCE_USELESS') {
            return
        }
        i.value = index
        qualityShow.value = true
    }
    // 打开工序
    const openGX = (index: number) => {
        if (!list.value[index].materialId) return Toast('请先选择入库物料')
        i.value = index
        productionShow.value = true
    }
@@ -180,18 +188,20 @@
        locationShow.value = true
    }
    const addItem = () => {
        // if (!form.warehouseId) return Toast('请选择入库仓库')
        if (!form.warehouseId) return Toast('请选择入库仓库')
        list.value.push({
            batch: '',
            locationId: '',
            locationName: '',
            locationId: list.value[list.value.length - 1].locationId,
            locationName: list.value[list.value.length - 1].locationName,
            locationIdLabel: list.value[list.value.length - 1].locationIdLabel,
            materialId: '',
            materialName: '',
            num: '',
            hasBom: '',
            procedureId: '',
            procedureName: '',
            qualityType: '',
            qualityTypeName: '',
            qualityType: list.value[list.value.length - 1].qualityType,
            qualityTypeName: list.value[list.value.length - 1].qualityTypeName,
            unitId: '',
            unitName: ''
        })
@@ -230,7 +240,7 @@
            if (!list.value[i].locationId) return Toast(`第${i+1}项入库货位不能为空`)
            if (!list.value[i].materialId) return Toast(`第${i+1}项入库物料不能为空`)
            if (!list.value[i].qualityType) return Toast(`第${i+1}项质量属性不能为空`)
            if (!list.value[i].num || list.value[i].num == '' || list.value[i].num == 0) {
            if (list.value[i].num <= 0) {
                return Toast(`第${i + 1}项入库数量必须大于0`)
            }
        }
@@ -262,7 +272,8 @@
    // 删除
    const dele = (index: any) => {
        if (list.value.length === 1) {
            Toast('至少保留一条工装信息')
        //    Toast('至少保留一条工装信息')
            Toast('至少保留一条物流清单信息')
            return
        }
        list.value.splice(index, 1)
@@ -301,12 +312,27 @@
                            item.locationId = res.data[0].id
                            item.locationName = res.data[0].unionName
                        })
                        list.value[i.value].locationIdLabel = res.data[0].label
                        if (res.data[0].label === 'APPLIANCE_ONTEST') {
                            list.value[i.value].qualityType = '0'
                            list.value[i.value].qualityTypeName = '合格'
                        } else if (res.data[0].label === 'APPLIANCE_OFFTEST') {
                            list.value[i.value].qualityType = '1'
                            list.value[i.value].qualityTypeName = '不良'
                        } else if (res.data[0].label === 'APPLIANCE_USELESS') {
                            list.value[i.value].qualityType = '2'
                            list.value[i.value].qualityTypeName = '报废'
                        }
                    } else {
                        location.value = true
                        list.value.forEach(item => {
                            item.locationId = ''
                            item.locationName = ''
                            item.locationId = res.data[0].id
                            item.locationName = res.data[0].unionName
                        })
                        // list.value.forEach(item => {
                        //     item.locationId = ''
                        //     item.locationName = ''
                        // })
                    }
                }
            })
@@ -317,6 +343,7 @@
        list.value[i.value].materialName = item.mmodelUnionName
        list.value[i.value].materialId = item.id
        list.value[i.value].unitId = item.unitId
        list.value[i.value].hasBom = item.hasBom
        list.value[i.value].unitName = item.umodelName
        // 获取物料下工序
        getListByMaterialId({
@@ -340,6 +367,19 @@
    const getValue3 = (item: any): void => {
        list.value[i.value].locationId = item.id
        list.value[i.value].locationName = item.unionName
        list.value[i.value].qualityType = ''
        list.value[i.value].qualityTypeName = ''
        list.value[i.value].locationIdLabel = item.label
        if (item.label === 'APPLIANCE_ONTEST') {
            list.value[i.value].qualityType = '0'
            list.value[i.value].qualityTypeName = '合格'
        } else if (item.label === 'APPLIANCE_OFFTEST') {
            list.value[i.value].qualityType = '1'
            list.value[i.value].qualityTypeName = '不良'
        } else if (item.label === 'APPLIANCE_USELESS') {
            list.value[i.value].qualityType = '2'
            list.value[i.value].qualityTypeName = '报废'
        }
        locationShow.value = false
    }
    // 选择工序