ezhizao_zx 8 miesięcy temu
rodzic
commit
b7a4ede6f4
2 zmienionych plików z 46 dodań i 34 usunięć
  1. 9 0
      api/business/sortDaywork.js
  2. 37 34
      pages/sortBatchReporting/index.vue

+ 9 - 0
api/business/sortDaywork.js

@@ -44,4 +44,13 @@ export function update(data) {
 		data: data
 
 	})
+}
+
+
+export function showDayworkSave(data) {
+	return req.request({
+		url: '/business/sortDaywork/showDayworkSave',
+		method: 'POST',
+		data: data
+	})
 }

+ 37 - 34
pages/sortBatchReporting/index.vue

@@ -157,7 +157,7 @@
 	import {
 		getDayWorkList,
 		showDaywork,
-		showDayworkSave,
+		// showDayworkSave,
 		turnoverDelete
 	} from '@/api/business/dayWork.js'
 	import {
@@ -166,7 +166,9 @@
 	import {
 		carrierFinishedCheck
 	} from '@/api/business/carrier.js'
-	import{isTakeStock} from '@/api/business/taksStackLot.js'
+	import {
+		isTakeStock
+	} from '@/api/business/taksStackLot.js'
 	import {
 		store
 	} from '@/store/index.js'
@@ -174,7 +176,8 @@
 		toHHmmss
 	} from '@/utils/common.js'
 	import {
-		getSortingDayworkItem
+		getSortingDayworkItem,
+		showDayworkSave
 	} from '@/api/business/sortDaywork.js'
 
 	const turnoverApplicationDialog = ref(null)
@@ -311,28 +314,28 @@
 	}
 
 	function handleShowTurnoverApplication(data) {
-		isTakeStock().then(response =>{
-			if(response.data) {
+		isTakeStock().then(response => {
+			if (response.data) {
 				uni.showToast({
 					icon: 'none',
 					title: '正在盘点,不能申请周转',
 					duration: 2000
 				})
-			}else{
-		let _data = data ?? {}
-		carrierFinishedCheck(data).then(res => {
-			if (res.code === 200) {
-				// 调用子组件中的方法
-				turnoverApplicationDialog.value.open(_data)
 			} else {
-				uni.showToast({
-					icon: 'none',
-					title: res.msg
+				let _data = data ?? {}
+				carrierFinishedCheck(data).then(res => {
+					if (res.code === 200) {
+						// 调用子组件中的方法
+						turnoverApplicationDialog.value.open(_data)
+					} else {
+						uni.showToast({
+							icon: 'none',
+							title: res.msg
+						})
+					}
 				})
 			}
 		})
-		}
-		})
 		// .catch(err => {
 		// 	uri.showToast({
 		// 		icon: "fail",
@@ -641,7 +644,7 @@
 		} else {
 			// 测试时用
 			showDaywork({
-				carrierId: '1770342949090017283',
+				carrierCode: '000075',
 				status: 7
 			}).then(response => {
 				if (response.code == 200) {
@@ -746,32 +749,32 @@
 	}
 
 	function handleCancelTurnover(data) {
-		isTakeStock().then(response =>{
-			if(response.data) {
+		isTakeStock().then(response => {
+			if (response.data) {
 				uni.showToast({
 					icon: 'none',
 					title: '正在盘点,不能取消周转',
 					duration: 2000
 				})
-			}else{
-		turnoverDelete(data).then(res => {
-			if (res.code == 200) {
-				uni.showToast({
-					icon: "success",
-					title: "取消成功",
-					duration: 2000
-				})
-				init(store.planDetails.id);
 			} else {
-				uni.showToast({
-					icon: "none",
-					title: "取消失败",
-					duration: 2000
+				turnoverDelete(data).then(res => {
+					if (res.code == 200) {
+						uni.showToast({
+							icon: "success",
+							title: "取消成功",
+							duration: 2000
+						})
+						init(store.planDetails.id);
+					} else {
+						uni.showToast({
+							icon: "none",
+							title: "取消失败",
+							duration: 2000
+						})
+					}
 				})
 			}
 		})
-		}
-		})
 	}
 </script>