From 41580b1fbb6c7116b0058118baeed1bbc9cdbfb5 Mon Sep 17 00:00:00 2001
From: Mr.Shi <1878285526@qq.com>
Date: 星期三, 16 八月 2023 18:30:38 +0800
Subject: [PATCH] h5一键报工
---
h5_standard/src/views/needToBeDealtWith/addWarehousing.vue | 66 ++++++++++++++++++++++++++++-----
1 files changed, 56 insertions(+), 10 deletions(-)
diff --git a/h5_standard/src/views/needToBeDealtWith/addWarehousing.vue b/h5_standard/src/views/needToBeDealtWith/addWarehousing.vue
index 55b20d0..ef5e6ea 100644
--- a/h5_standard/src/views/needToBeDealtWith/addWarehousing.vue
+++ b/h5_standard/src/views/needToBeDealtWith/addWarehousing.vue
@@ -29,7 +29,7 @@
</div>
<van-swipe-cell v-for="(item, index) in list" :key="index">
<div class="rework_qd_list">
- <div class="rework_qd_item" @click="openL(index)">
+ <div class="rework_qd_item" @click="openL(index)" v-if="location">
<span><b>*</b>鍏ュ簱璐т綅</span>
<div class="rework_qd_item_right">
<span :class="item.locationName ? 'black' : ''">{{item.locationName ? item.locationName : '璇烽�夋嫨'}}</span>
@@ -43,13 +43,13 @@
<van-icon name="arrow" size="20" color="#999999" />
</div>
</div>
- <!-- <div class="rework_qd_item" v-if="form.type != 25">
+ <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" />
</div>
- </div> -->
+ </div>
<div class="rework_qd_item" @click="openQ(index)">
<span><b>*</b>璐ㄩ噺灞炴��</span>
<div class="rework_qd_item_right">
@@ -87,8 +87,10 @@
<Quality :show="qualityShow" @close="close2" @value="getValue2" />
<!-- 閫夋嫨璐т綅 -->
<Location :show="locationShow" :list="locationList" @close="close3" @value="getValue3" />
+ <!-- 宸ュ簭 -->
+ <ProductionProcess :show="productionShow" :list="productionList" @close="close4" @value="getValue4" />
<!-- 鍗曟嵁绫诲瀷 -->
- <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"
@@ -103,11 +105,13 @@
import { onMounted, ref, reactive } from 'vue'
import { useRouter } from 'vue-router'
import { Toast } from 'vant'
- import { createForStandard, getListByWarehouseId, wOutBoundForStockUp } from '@/apis/WorkOrderAPI'
+ import { getListByWarehouseId, wOutBoundForStockUp } from '@/apis/WorkOrderAPI'
+ import { getListByMaterialId } from '@/apis/ExWarehouse'
import Warehouse from '@/components/common/Warehouse.vue'
import Material from '@/components/newCom/Material.vue'
import Quality from '@/components/newCom/quality.vue'
import Location from '@/components/newCom/location.vue'
+ import ProductionProcess from '@/components/newCom/productionProcess.vue'
const router = useRouter()
// 琛ㄥ崟鏁版嵁
@@ -119,6 +123,8 @@
})
let locationList: any = ref([])
+ let location: any = ref(true)
+ let productionList: any = ref([])
let i = ref(0)
@@ -150,6 +156,7 @@
let qualityShow = ref<boolean>(false)
let locationShow = ref<boolean>(false)
let typeShow = ref<boolean>(false)
+ let productionShow = ref<boolean>(false)
// 鎵撳紑閫夋嫨鐗╂枡
const openMaterial = (index: number) => {
@@ -160,6 +167,11 @@
const openQ = (index: number) => {
i.value = index
qualityShow.value = true
+ }
+ // 鎵撳紑宸ュ簭
+ const openGX = (index: number) => {
+ i.value = index
+ productionShow.value = true
}
// 鎵撳紑閫夋嫨璐т綅
const openL = (index: number) => {
@@ -188,6 +200,12 @@
const onConfirm1 = (value: any) => {
form.typeName = value.name
form.type = value.id
+ if (value.id == 25) {
+ list.value.forEach(item => {
+ item.procedureId = ''
+ item.procedureName = ''
+ })
+ }
typeShow.value = false
};
const onCancel = () => {
@@ -265,6 +283,10 @@
const close3 = (): void => {
locationShow.value = false
}
+ // 鍏抽棴璐т綅閫夋嫨寮规
+ const close4 = (): void => {
+ productionShow.value = false
+ }
// 閫夋嫨浠撳簱鍥炶皟
const getValue = (item: any): void => {
form.warehouseName = item.name
@@ -273,21 +295,39 @@
.then(res => {
if (res.code === 200) {
locationList.value = res.data
- list.value.forEach(item => {
- item.locationId = ''
- item.locationName = ''
- })
+ if (res.data.length === 1) {
+ location.value = false
+ list.value.forEach(item => {
+ item.locationId = res.data[0].id
+ item.locationName = res.data[0].unionName
+ })
+ } else {
+ location.value = true
+ list.value.forEach(item => {
+ item.locationId = ''
+ item.locationName = ''
+ })
+ }
}
})
warehouseShow.value = false
}
// 閫夋嫨鐗╂枡
const getValue1 = (item: any): void => {
- console.log(item)
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].unitName = item.umodelName
+ // 鑾峰彇鐗╂枡涓嬪伐搴�
+ getListByMaterialId({
+ materialId: item.id
+ }).then(res => {
+ if (res.code === 200) {
+ productionList.value = res.data
+ list.value[i.value].procedureId = ''
+ list.value[i.value].procedureName = ''
+ }
+ })
materialsShow.value = false
}
// 閫夋嫨璐ㄩ噺灞炴��
@@ -302,6 +342,12 @@
list.value[i.value].locationName = item.unionName
locationShow.value = false
}
+ // 閫夋嫨宸ュ簭
+ const getValue4 = (item: any): void => {
+ list.value[i.value].procedureId = item.id
+ list.value[i.value].procedureName = item.name
+ productionShow.value = false
+ }
onMounted(() => {
// 鑾峰彇宸ヨ淇℃伅
// getLKInfo(route.query.id as string)
--
Gitblit v1.9.3