ysy 1 year ago
parent
commit
7f0c3eed15

+ 13 - 0
api/pda/workOrder.js

@@ -700,6 +700,19 @@ export async function listOutsource(param) {
 		Vue.prototype.apiUrl + `/mes/applyoutsource/listOutsource`, param
 	);
 
+	if (data.code == 0) {
+		return data.data;
+	}
+	return Promise.reject(data.message);
+}
+
+// 根据工单工序查委外信息
+
+export async function checkOutsourceMaterial(param) {
+	const data = await get(
+		Vue.prototype.apiUrl + `/mes/applyoutsource/checkOutsourceMaterial`, param
+	);
+
 	if (data.code == 0) {
 		return data.data;
 	}

+ 48 - 69
pages/pda/components/bottomOperate.vue

@@ -52,9 +52,9 @@
 					<view class="title">【{{taskObj.currentTaskName}}】是否委外</view>
 
 
-					<u-form labelPosition="left" :model="outsourceForm" labelWidth="180" labelAlign="left" class=""> 
+					<u-form labelPosition="left" :model="outsourceForm" labelWidth="180" labelAlign="left" class="">
 
-						<u-form-item label="委外名称:" borderBottom prop="num">
+						<u-form-item label="委外名称:" borderBottom prop="name">
 							<input class="uni-input" v-model="outsourceForm.name" placeholder="请输入委外名称"></input>
 						</u-form-item>
 
@@ -65,38 +65,30 @@
 						</u-form-item>
 
 
-						<u-form-item label="委外数量:" borderBottom prop="num">
-							<!-- :disabled="outsourceForm.type == 2 ? false : true" -->
-							<input class="uni-input content_num" 
-								v-model="outsourceForm.formedNumLast" type='number'></input>
-						</u-form-item>
-
-						<u-form-item label="委外物料:" borderBottom prop="" v-if="outsourceForm.type == 2">
-							<zxz-uni-data-select :localdata="materialList" v-model="outsourceForm.material"
-								dataValue='id' dataKey="name" filterable format='{name}'></zxz-uni-data-select>
+						<u-form-item label="委外到:" borderBottom prop="taskIds">
+							<zxz-uni-data-select :localdata="newStepsList" v-model="outsourceForm.taskIds"
+								dataValue='taskId' format='{taskTypeName}' dataKey="taskId" filterable
+								:clear='true'></zxz-uni-data-select>
 						</u-form-item>
 
 
-
-						<u-form-item label="发货仓库:" borderBottom prop="" v-if="outsourceForm.type == 2">
+						<u-form-item label="仓库直发:" borderBottom prop="isStraight">
+							<u-checkbox-group v-model="outsourceForm.isStraight" size="14px">
+								<u-checkbox labelSize="14px" iconSize="10px" activeColor="#157A2C" name="true" label="是"></u-checkbox>
+							</u-checkbox-group>
+						</u-form-item>
+               
+						<u-form-item label="发货仓库:" borderBottom prop="" v-if="outsourceForm.isStraight && outsourceForm.isStraight.length == 1">
 							<zxz-uni-data-select :localdata="warehouseList" v-model="outsourceForm.warehouseId"
 								dataValue='id' dataKey="name" filterable format='{name}'></zxz-uni-data-select>
 						</u-form-item>
 
 
-
-						<u-form-item label="工艺路线:" borderBottom prop="" v-if="outsourceForm.type != 2">
+						<u-form-item label="工艺路线:" borderBottom prop="produceRoutingId" v-if=" outsourceForm.isStraight && outsourceForm.isStraight.length == 0">
 							<zxz-uni-data-select :localdata="produceList" v-model="outsourceForm.produceRoutingId"
 								dataValue='id' dataKey="name" filterable format='{name}'></zxz-uni-data-select>
 						</u-form-item>
 
-						<u-form-item label="委外到:" borderBottom prop="">
-							<zxz-uni-data-select :localdata="newStepsList" v-model="outsourceForm.taskIds" 
-								dataValue='taskId' format='{taskTypeName}' dataKey="taskId" filterable
-								:clear='true'></zxz-uni-data-select>
-						</u-form-item>
-
-
 
 
 						<u-form-item label="计划交期:" borderBottom prop="requireDeliveryTime">
@@ -124,17 +116,19 @@
 
 
 					<u-button type="success" size="small" class="u-reset-button" @click="outsourceOk(0)">
-						提交
+                       确定
 					</u-button>
 
 
-					<u-button type="success" size="small" class="u-reset-button" @click="outsourceOk(1)">
+			<!-- 		<u-button type="success" size="small" class="u-reset-button" @click="outsourceOk(1)">
 						提交并发布
-					</u-button>
+					</u-button> -->
 
 				</view>
 			</template>
 		</SearchPopup>
+		
+		<outsourceList  ref="outsourceListRef"></outsourceList>
 
 	</view>
 </template>
@@ -152,12 +146,16 @@
 	} from '@/api/pda/workOrder.js'
 
 	import SearchPopup from './searchPopup.vue'
+	
+	import outsourceList from './outsourceList.vue'
+		
 
 
 
 	export default {
 		components: {
-			SearchPopup
+			SearchPopup,
+			outsourceList
 		},
 
 		props: {
@@ -335,32 +333,18 @@
 				warehouseList: [],
 
 				typeList: [{
-						id: 1,
-						name: '采购委外'
+						id: 4,
+						name: '带料委外'
 					},
 					{
-						id: 2,
-						name: '直接发货委外'
-					},
-					{
-						id: 3,
-						name: '无采购委外'
+						id: 5,
+						name: '无料委外'
 					},
 
 				],
 
-				materialList: [{
-						id: 1,
-						name: '产品'
-					},
-					{
-						id: 2,
-						name: '半成品'
-					},
-				],
-
 				newStepsList: [],
-	
+
 
 				clientEnvironmentId: uni.getStorageSync("userInfo") && uni.getStorageSync("userInfo")
 					.clientEnvironmentId, // *1 主环境-601环境   2 soll-索尔环境    3 tg-碳谷环境
@@ -399,6 +383,7 @@
 
 					this.outsourceForm = {
 						...res,
+				    isStraight: []
 
 					}
 					this.outsourceForm.name = this.taskObj.currentTaskName + '委外'
@@ -542,24 +527,9 @@
 				}
 
 
-				if (this.outsourceForm.type == 2 && !this.outsourceForm.material) {
-					uni.showToast({
-						title: '请选择委外物料',
-						icon: 'none'
-					})
-					return false
-				}
-
 
 
-				if ( this.outsourceForm.type != 2 && !this.outsourceForm.produceRoutingId) {
-					uni.showToast({
-						title: '请选择工艺路线',
-						icon: 'none'
-					})
-					return false
-				}
-				// this.outsourceForm.requireDeliveryTime = '2025-03-18'
+				this.outsourceForm.requireDeliveryTime = '2025-03-18'
 				if (!this.outsourceForm.requireDeliveryTime) {
 					uni.showToast({
 						title: '请选择委外完成时间',
@@ -567,20 +537,29 @@
 					})
 					return false
 				}
-
-
-
+				
 				let param = {
 					...this.outsourceForm,
 					taskId: this.newTaskObj.currentTaskId,
 					workOrderId: this.newTaskObj.workOrderId,
 					isRelease: isRelease
 				}
-
-				applyoutsourceSave(param).then(res => {
-					console.log(res)
-					this.outCancel()
-				})
+				
+				this.$refs.outsourceListRef.open(param)
+        
+
+				
+				// let param = {
+				// 	...this.outsourceForm,
+				// 	taskId: this.newTaskObj.currentTaskId,
+				// 	workOrderId: this.newTaskObj.workOrderId,
+				// 	isRelease: isRelease
+				// }
+
+				// applyoutsourceSave(param).then(res => {
+				// 	console.log(res)
+				// 	this.outCancel()
+				// })
 			},
 
 

+ 400 - 0
pages/pda/components/outsourceList.vue

@@ -0,0 +1,400 @@
+<template>
+	<view>
+		<u-popup :show="show" :mode='mode' :closeOnClickOverlay='false'>
+
+
+			<view class="card_box">
+
+				<view class="item_box rx-bc">
+					<view class="item_one  perce50 rx-sc">
+						<view class="lable">委外名称:</view>
+						<view>{{ outObj.name }}</view>
+					</view>
+
+					<view class="item_one  perce50 rx-sc">
+						<view class="lable">委外类型:</view>
+						<view>{{ outObj.type == 4 ? '带料委外' : '无料委外' }}</view>
+					</view>
+
+				</view>
+
+			</view>
+
+			<u-tabs :list="tabList" @click="handTab" lineWidth="30" lineColor="#157A2C" :activeStyle="{
+				           color: '#157A2C',
+				        }" :inactiveStyle="{
+							  color: '#303133',
+				           
+				        }" itemStyle="padding-left: 15px; padding-right: 15px; height: 34px;">
+			</u-tabs>
+			<view class="box_list">
+
+
+
+				<u-list @scrolltolower="scrolltolower" class="z_list">
+
+					<view v-if="actTab == '物品清单'">
+						<checkbox-group v-for="(item, index) in pickOutInList" :key="index">
+							<label class="listBox rx-bs">
+
+								<view class="listBox-sel">
+									<checkbox
+										v-if=' (item.rootCategoryLevelId != 11 || (item.rootCategoryLevelId == 11 && item.status != 1))'
+										:value="item.code" color="#fff" :disabled="item.disabled"
+										:checked="item.checked" />
+								</view>
+
+								<view class="listBox-con">
+									<view class="listBox-top rx-bc">
+										<view> {{ item.name }}</view>
+										<view class="code">
+											{{ item.rootCategoryLevelId == 4 ?  item.codeNumber :  item.code}}
+										</view>
+									</view>
+
+									<view class="listBox-bottom rx">
+										<view v-for="(itm, index) in tableH(item.rootCategoryLevelId)" :key="index"
+											class="items" v-if="!itm.formatter">
+											<text>{{ itm.label }}</text>{{ item[itm.prop] }}
+										</view>
+
+
+
+
+										<view class="items"
+											v-if='(item.rootCategoryLevelId == 1 && item.isConsumable == 1) &&  item.rootCategoryLevelId != 11 && item.rootCategoryLevelId != 4 '>
+											<text>可用库存</text>{{ item.availableCountBase }} {{item.unit}}
+										</view>
+
+
+										<view class="items"
+											v-if='([1,9,23].includes(Number(item.rootCategoryLevelId)) && item.isConsumable == 0) '>
+											<text>刻码</text>{{item.extInfo.engrave }}
+										</view>
+
+
+										<view class="items"
+											v-if='([1,9,23].includes(Number(item.rootCategoryLevelId)) && item.isConsumable == 0) '>
+											<text>物料代号</text>{{item.extInfo.materielCode }}
+										</view>
+
+
+										<view class="items"
+											v-if='([1,23].includes(Number(item.rootCategoryLevelId)) && item.isConsumable == 0) '>
+											<text>客户代号</text>{{item.extInfo.clientCode }}
+										</view>
+
+
+
+
+
+
+
+
+
+
+
+
+
+									</view>
+
+								</view>
+
+
+							</label>
+
+						</checkbox-group>
+
+					</view>
+
+					<view v-if="actTab  == '带料清单'">
+
+						<view class="title_box rx-bc">
+							<view></view>
+							<view class="right_box rx-ec">
+								<u-button type="success" size="small" class="u-reset-button" @click="addPicking(2)"
+									text="添加物料"></u-button>
+							</view>
+						</view>
+
+					</view>
+
+					<view v-if="actTab  == '产出清单'">
+
+
+						<view v-for="(item, index) in pickOutInVOList" :key="index">
+							<view class="listBox rx-bs">
+
+								<view class="listBox-bottom rx">
+
+									<view class="items">
+										<text>名称</text>{{ item.name }}
+									</view>
+
+									<view class="items">
+										<text>编码</text>{{ item.code }}
+									</view>
+
+
+
+									<view v-for="(itm, index) in tableH(item.rootCategoryLevelId)" :key="index"
+										class="items" v-if="!itm.formatter">
+										<text>{{ itm.label }}</text>{{ item[itm.prop] }}
+									</view>
+
+
+								</view>
+
+							</view>
+						</view>
+
+					</view>
+
+
+				</u-list>
+
+				<view class="operate_box  rx-bc">
+					<u-button size="small" class="u-reset-button" @click="close">
+						取消
+					</u-button>
+					<u-button type="success" size="small" class="u-reset-button" @click="handOK">
+						确定
+					</u-button>
+
+				</view>
+
+
+
+			</view>
+
+		</u-popup>
+	</view>
+
+
+</template>
+
+<script>
+	import {
+		checkOutsourceMaterial
+	} from '@/api/pda/workOrder.js'
+	import {
+		tableHeader
+	} from '../common.js'
+	import {
+		EventBus
+	} from '@/utils/eventBus.js'
+	export default {
+		data() {
+			return {
+				mode: 'center',
+				show: false,
+				topHight: 20 || 20,
+
+				outObj: {},
+
+				tabList: [{
+						name: '主体清单'
+					},
+					{
+						name: '带料清单'
+					},
+					{
+						name: '产出清单'
+					}
+				],
+
+				actTab: '主体清单',
+
+				bomMaterialList: [],
+				pickOutInList: [],
+				materialList: [],
+				pickOutInVOList: []
+			}
+		},
+
+		created() {
+			EventBus.$on('outEvent', this.handleEvent);
+		},
+		methods: {
+			open(obj) {
+				console.log(obj, 999)
+				this.outObj = obj
+
+				this.outsourceMaterialFn()
+				this.show = true
+			},
+
+			outsourceMaterialFn() {
+				let param = {
+					taskId: this.outObj.taskId,
+					taskIds: this.outObj.taskIds,
+					workOrderId: this.outObj.workOrderId
+
+				}
+				checkOutsourceMaterial(param).then(res => {
+
+					this.pickOutInList = res.pickOutInList
+					this.bomMaterialList = res.bomMaterialList
+					this.pickOutInVOList = res.pickOutInVOList
+					this.$forceUpdate()
+				})
+			},
+
+			handTab(item) {
+				this.actTab = item.name
+			},
+
+			close() {
+				this.show = false
+			},
+
+			handleEvent(data) {
+				console.log('Received event with data:', data);
+
+			},
+
+			tableH(type) {
+				return tableHeader(type)
+			},
+
+
+			scrolltolower() {},
+
+			addPicking(id) {
+				const storageKey = Date.now() + "";
+
+				let arr = []
+				uni.setStorageSync(storageKey, arr);
+				uni.navigateTo({
+					url: `/pages/pda/workOrder/search/index?id=${id}&storageKey=${storageKey}&isType=zdy&taskId=${this.outObj.taskId}&classIds=[1,9]`
+				})
+			},
+
+			handOK() {
+
+			},
+		}
+	}
+</script>
+
+<style lang="scss" scoped>
+	.z_list {
+		max-height: 860rpx;
+		padding: 10rpx;
+		box-sizing: border-box;
+	}
+
+	.box_list {
+		min-height: 100rpx;
+		width: 96vw;
+
+		/deep/ .baseForm {
+			padding: 0 20rpx;
+		}
+	}
+
+	.operate_box {
+		padding: 10rpx 32rpx;
+
+		/deep/ .u-button {
+			width: 40%;
+		}
+	}
+
+	/deep/ .u-tabs__wrapper__nav {
+		background: #f5f5f5 !important;
+	}
+
+
+
+	.listBox {
+		margin-top: 8rpx;
+		padding: 8rpx 24rpx;
+		background: #fff;
+
+
+		/deep/ .uni-checkbox-input-checked {
+			background-color: $theme-color !important;
+			border-color: $theme-color !important;
+		}
+
+		.listBox-con {
+			width: 650rpx;
+			font-weight: 400;
+		}
+
+		.listBox-top {
+			margin-top: 6rpx;
+			color: #090A0A;
+			font-size: 28rpx;
+			font-style: normal;
+			font-weight: 800;
+		}
+
+		.listBox-bottom {
+			color: #090A0A;
+			font-size: 24rpx;
+			font-style: normal;
+			flex-wrap: wrap;
+
+			.items {
+
+				width: calc(50% - 1px);
+				border-left: 1rpx solid #E3E5E5;
+				border-right: 1rpx solid #E3E5E5;
+				border-bottom: 1rpx solid #E3E5E5;
+				box-sizing: border-box;
+				word-break: break-all;
+
+				text {
+					display: inline-block;
+					background: #F7F9FA;
+					padding: 8rpx 10rpx;
+					color: #157A2C;
+
+				}
+
+				&:nth-child(1),
+				&:nth-child(2) {
+					border-top: 1rpx solid #E3E5E5;
+					margin-top: 8rpx;
+				}
+
+			}
+
+		}
+	}
+
+
+
+	.card_box {
+		width: 750rpx;
+		padding: 16rpx 32rpx;
+		box-sizing: border-box;
+		border-bottom: 2rpx solid #E1E1E1;
+
+
+		.item_box {
+			margin-top: 10rpx;
+
+
+
+			.item_one {
+				width: 100%;
+				font-size: 26rpx;
+				font-style: normal;
+				font-weight: 400;
+				line-height: 38rpx;
+				word-wrap: break-word;
+			}
+
+			.gylx {
+				color: $theme-color;
+			}
+
+			.perce50 {
+				width: 50%;
+			}
+		}
+	}
+</style>

+ 6 - 6
pages/pda/jobBooking/components/turnoverBom.vue

@@ -57,7 +57,6 @@
 							<view class="item ww20  " :class="{'content_num' : pattern == 'job' }" v-if='!isDetails'>
 								<input class="uni-input" v-if='it.isFull == 0' @input="quantInt(index, idx, it)"
 									v-model="it.quantity" type="digit"
-									
 									:disabled="(!Object.prototype.hasOwnProperty.call(it, 'isOccupy') && it.isOccupy) || pattern != 'job'"></input>
 								<text v-else>{{it.quantity}}</text>
 							</view>
@@ -108,7 +107,7 @@
 				deep: true,
 				handler(newVal) {
 
-			
+
 					this.newList = newVal
 
 
@@ -144,7 +143,8 @@
 				this.totalCount = 0
 				this.newList.forEach(f => {
 					f.extInfo.positionList.forEach(o => {
-						if (o.workOrderCode == this.wordItem.code && (!Object.prototype.hasOwnProperty.call(o, 'isOccupy') || (o.isOccupy == 0 && o.quantity > 0))) {
+						if (o.workOrderCode == this.wordItem.code && (!Object.prototype.hasOwnProperty
+								.call(o, 'isOccupy') || (o.isOccupy == 0 && o.quantity > 0))) {
 							this.totalCount = Number(this.totalCount) + Number(o.quantity)
 						}
 					})
@@ -154,11 +154,11 @@
 					icon: 'none',
 					title: `已经放${this.totalCount}`
 				})
-				
+
 				this.$emit('formedNumFn', this.totalCount)
-				
 
-			  
+
+
 
 
 

+ 15 - 3
pages/pda/workOrder/search/index.vue

@@ -232,6 +232,8 @@
 
 
 	import SearchPopup from '../../components/searchPopup.vue'
+	
+	import { EventBus } from '@/utils/eventBus.js'
 
 
 	let [isEnd] = [false]
@@ -302,6 +304,7 @@
 		},
 
 		onLoad(option) {
+			console.log(88,option)
 			this.pid = option.id
 			this.isType = option.isType
 			if (option.taskId == 'undefined') {
@@ -340,10 +343,12 @@
 
 				} else if (this.isType == 'zdy') {
 					let _arr = (this.storageKey && uni.getStorageSync(this.storageKey)) || []
-
-					if (Object.prototype.hasOwnProperty.call(_arr[0], 'turnover')) {
+					
+				
+ 
+					if (_arr.length != 0 && Object.prototype.hasOwnProperty.call(_arr[0], 'turnover')) {
 						this.memoList = this.memoList.concat(_arr[0].turnover)
-					} else if (Object.prototype.hasOwnProperty.call(_arr[0], 'equipmentList')) {
+					} else if (_arr.length != 0 && Object.prototype.hasOwnProperty.call(_arr[0], 'equipmentList')) {
 						this.memoList = this.memoList.concat(_arr[0].equipmentList)
 					}
 
@@ -595,6 +600,10 @@
 				if (type == 1) {
 					if (this.isType == 'pick' || this.isType == 'feed' || this.isType == 'job' || this.isType == 'zdy') {
 						uni.$emit('setSelectList', this.memoList, this.pid)
+						
+						
+						EventBus.$emit('outEvent', { message: 'Hello from AnotherComponent!' });
+						
 						uni.navigateBack()
 					}
 
@@ -619,6 +628,9 @@
 										title: '半成品领料成功,请先去审核',
 										icon: 'none'
 									})
+									
+								
+									  
 									uni.navigateBack()
 								})
 							}

+ 2 - 0
utils/eventBus.js

@@ -0,0 +1,2 @@
+import Vue from 'vue';
+export const EventBus = new Vue();