ysy %!s(int64=2) %!d(string=hai) anos
pai
achega
338c68fad0

+ 44 - 0
api/pda/workOrder.js

@@ -1,6 +1,8 @@
 import {
 	postJ,
 	post,
+	putJ,
+	put,
 	get
 } from "@/utils/request";
 import Vue from "vue";
@@ -527,6 +529,48 @@ export async function applyoutsourceSave(params) {
 }
 
 
+// 工单暂停
+export async function updateStatusPause(params) {
+	const data = await putJ(
+		Vue.prototype.apiUrl + `/mes/workorder/updateStatusPause`, params, true,
+	);
+	if (data.code == 0) {
+		return data.data;
+	}
+	return Promise.reject(data.message);
+}
+
+
+
+// 工单暂停(取消暂停)
+export async function updateStatusPauseRecover(params) {
+	const data = await putJ(
+		Vue.prototype.apiUrl + `/mes/workorder/updateStatusPauseRecover`, params, true,
+	);
+	if (data.code == 0) {
+		return data.data;
+	}
+	return Promise.reject(data.message);
+}
+
+
+
+
+
+// 工单终止
+export async function updateStatusTerminate(params) {
+	const data = await putJ(
+		Vue.prototype.apiUrl + `/mes/workorder/updateStatusTerminate`, params, true,
+	);
+	if (data.code == 0) {
+		return data.data;
+	}
+	return Promise.reject(data.message);
+}
+
+
+
+
 //报工-跳过工序
 export async function skipTask(params) {
 	const data = await postJ(

+ 80 - 21
pages/pda/components/bottomOperate.vue

@@ -26,8 +26,8 @@
 
 
 		<view class="btn_box">
-			<view class="btn">暂停</view>
-			<view class="btn">终止</view>
+			<view class="btn" @click="handPause()">{{ GDStatus == 9 ?  '取消暂停' : '暂停' }}</view>
+			<view class="btn" @click="handTerminate()">终止</view>
 			<view class="btn">转派</view>
 			<view class="btn" @click="handOutsource()">委外</view>
 		</view>
@@ -52,17 +52,17 @@
 							<zxz-uni-data-select :localdata="typeList" v-model="outsourceForm.type" 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">
-							<zxz-uni-data-select :localdata="materialList" v-model="outsourceForm.material" dataValue='id'
-								dataKey="name" filterable format='{name}'></zxz-uni-data-select>
+							<zxz-uni-data-select :localdata="materialList" v-model="outsourceForm.material"
+								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">
-							<zxz-uni-data-select :localdata="warehouseList" v-model="outsourceForm.warehouseId" dataValue='id'
-								dataKey="name" filterable format='{name}'></zxz-uni-data-select>
+							<zxz-uni-data-select :localdata="warehouseList" v-model="outsourceForm.warehouseId"
+								dataValue='id' dataKey="name" filterable format='{name}'></zxz-uni-data-select>
 						</u-form-item>
 
 
@@ -122,7 +122,10 @@
 		checkOutsource,
 		applyoutsourceSave,
 		producerouting,
-		getWarehouseList
+		getWarehouseList,
+		updateStatusPause,
+		updateStatusPauseRecover,
+		updateStatusTerminate
 	} from '@/api/pda/workOrder.js'
 
 	import SearchPopup from './searchPopup.vue'
@@ -136,6 +139,7 @@
 
 		props: {
 			state: String | Number,
+			gdStatus: String | Number,
 			taskObj: Object,
 
 			controlReportMethod: String | Number,
@@ -160,6 +164,17 @@
 				}
 			},
 
+			gdStatus: {
+				immediate: true,
+				deep: true,
+				handler(newVal) {
+					this.GDStatus = newVal
+				}
+			},
+
+
+
+
 			controlReportMethod: {
 				immediate: true,
 				deep: true,
@@ -184,6 +199,7 @@
 
 				btnsList: [],
 				btnState: 1,
+				GDStatus: null,
 				btnControlReportMethod: null,
 				btnList: {
 					1: [{
@@ -259,7 +275,7 @@
 				outsourceShow: false,
 
 				outsourceForm: {
-				
+
 				},
 
 				produceList: [],
@@ -279,16 +295,15 @@
 					},
 
 				],
-				
-				materialList: [
+
+				materialList: [{
+						id: 1,
+						name: '产品'
+					},
 					{
-							id: 1,
-							name: '产品'
-						},
-						{
-							id: 2,
-							name: '半成品'
-						},
+						id: 2,
+						name: '半成品'
+					},
 				]
 
 
@@ -352,7 +367,6 @@
 					}
 					this.outsourceForm.name = this.taskObj.currentTaskName + '委外'
 
-					console.log(this.outsourceForm)
 
 
 
@@ -370,6 +384,51 @@
 
 			},
 
+
+			handPause() {
+				if (this.GDStatus == 9) {
+					uni.showModal({
+						title: '提示',
+						content: '确定该工单取消暂停?',
+						success: async res => {
+							if (res.confirm) {
+								updateStatusPauseRecover([this.newTaskObj.workOrderId]).then(res => {
+									this.$emit('refresh')
+								})
+							}
+						}
+					})
+
+				} else {
+					uni.showModal({
+						title: '提示',
+						content: '确定该工单暂停?',
+						success: async res => {
+							if (res.confirm) {
+								updateStatusPause([this.newTaskObj.workOrderId]).then(res => {
+									this.$emit('refresh')
+								})
+							}
+						}
+					})
+				}
+
+			},
+			
+			handTerminate() {
+				
+				uni.showModal({
+					title: '提示',
+					content: '确定该工单终止?',
+					success: async res => {
+						if (res.confirm) {
+							updateStatusTerminate([this.newTaskObj.workOrderId]).then(res => {
+								this.$emit('refresh')
+							})
+						}
+					}
+				})
+			},
 			outCancel() {
 				this.outsourceShow = false
 			},
@@ -419,7 +478,7 @@
 				}
 
 
-			if (this.outsourceForm.type == 2 && !this.outsourceForm.material) {
+				if (this.outsourceForm.type == 2 && !this.outsourceForm.material) {
 					uni.showToast({
 						title: '请选择委外物料',
 						icon: 'none'

+ 1 - 1
pages/pda/feeding/components/instanceBom.vue

@@ -96,7 +96,7 @@
 							<view class="lable rx-cc ww80">炉次号</view>
 							<view class="content content_num ">
 								<input class="uni-input" style="width: 120rpx;"
-									v-model="mate.extInfo.heatNumber"></input>
+									v-model="mate.extInfo.heatNumber" />
 							</view>
 						</view>
 					</view>

+ 29 - 6
pages/pda/workOrder/extrusionMolding/index.vue

@@ -148,9 +148,9 @@
 
 		<view class="bottom-wrapper">
 
-			<bottomOperate @operate='operate'
+			<bottomOperate @operate='operate' @refresh='refresh'
 				:taskObj="{'currentTaskName': currentTaskName || info.taskName, 'currentTaskId': currentTaskId || info.taskId, 'workOrderId' : id }"
-				:state='currentType' :controlReportMethod='controlReportMethod'></bottomOperate>
+				:state='currentType' :gdStatus='info.status' :controlReportMethod='controlReportMethod'></bottomOperate>
 		</view>
 
 	</view>
@@ -192,7 +192,7 @@
 				currentTaskName: null,
 				currentType: 1,
 				controlReportMethod: null,
-				
+
 				clientEnvironmentId: uni.getStorageSync("userInfo") && uni.getStorageSync("userInfo")
 					.clientEnvironmentId, // *1 主环境-601环境   2 soll-索尔环境    3 tg-碳谷环境
 
@@ -247,10 +247,13 @@
 
 				})
 			},
+			
+			refresh() {
+				console.log(1)
+				 this.getInfo()
+			},
 
 			getInfo() {
-
-
 				workorderInfo(this.id).then(res => {
 					console.log(res)
 					this.info = res
@@ -304,6 +307,26 @@
 					return false
 				}
 
+				if (this.info.status == 9) {
+					uni.showToast({
+						title: "工单在暂停中",
+						icon: "none",
+					})
+
+					return false
+				}
+				
+				if (this.info.status == 10) {
+					uni.showToast({
+						title: "工单已终止",
+						icon: "none",
+					})
+				
+					return false
+				}
+				
+
+
 
 				let url
 				let taskId = this.currentTaskId || this.taskId
@@ -316,7 +339,7 @@
 						url
 					})
 				} else if (type == 'feeding') {
-					if (this.feedAllow ||  this.clientEnvironmentId == 3) {
+					if (this.feedAllow || this.clientEnvironmentId == 3) {
 						url = '/pages/pda/feeding/details'
 						let _arr = JSON.stringify([this.info.id])
 						url += `?arr=${encodeURIComponent(_arr)}&taskId=${taskId }&taskName=${taskName}`