From 3878c57a2bd710295931303ea85439a596838dfd Mon Sep 17 00:00:00 2001
From: Mr.Shi <1878285526@qq.com>
Date: 星期二, 05 九月 2023 16:01:31 +0800
Subject: [PATCH] 小程序

---
 minipro_standard/pages_adjust/pages/outboundDetails/outboundDetails.vue |   97 ++++++++++++++++++++++++++++++++++++++++++------
 1 files changed, 84 insertions(+), 13 deletions(-)

diff --git a/minipro_standard/pages_adjust/pages/outboundDetails/outboundDetails.vue b/minipro_standard/pages_adjust/pages/outboundDetails/outboundDetails.vue
index 100f272..8689680 100644
--- a/minipro_standard/pages_adjust/pages/outboundDetails/outboundDetails.vue
+++ b/minipro_standard/pages_adjust/pages/outboundDetails/outboundDetails.vue
@@ -16,7 +16,7 @@
 				<view style="margin-top: 0 " class="content_list_item_content_item">
 					<view class="content_list_item_content_item_label">鍗曟嵁绫诲瀷锛�</view>
 					<view class="content_list_item_content_item_nr" v-if="data.billType">
-						{{ orderTyepToStr(data.billType) }}
+						{{ seeText(data.billType) }}
 					</view>
 				</view>
 				<view class="content_list_item_content_item">
@@ -114,24 +114,88 @@
 </template>
 
 <script>
-	import { orderTyepToStr } from '@/util/constData.js'
-	
+	import {
+		orderTyepToStr
+	} from '@/util/constData.js'
+	import {
+		getBoundDetail,
+		cancelBound
+	} from '@/util/api/materialStorage'
+
 	export default {
 		data() {
 			return {
-				data: {},
-				types: [
-					{ name: '鍏ㄩ儴', id: '', isActive: true },
-					{ name: '閲囪喘璁㈠崟', id: '0', isActive: false },
-					{ name: '鐢熶骇宸ュ崟', id: '1', isActive: false },
-					{ name: '閿�鍞鍗�', id: '2', isActive: false },
-					{ name: '杞簱鍗�', id: '3', isActive: false },
-					{ name: '鐩樼偣鍗�', id: '4', isActive: false },
+				id: null,
+				data: {
+					code: "",
+					createName: "",
+					planDate: "",
+					dealDate: "",
+					status: 0,
+					originType: 0,
+					originCode: "",
+					updateName: "",
+					updateMobile: "",
+					updateTime: "",
+					warehouseName: "",
+					warehouseCode: "",
+					outPlandate: "",
+					inPlandate: "",
+					woutboundDetailsWait: [],
+					woutboundDetailsOut: []
+				},
+				types: [{
+						name: '鍏ㄩ儴',
+						id: '',
+						isActive: true
+					},
+					{
+						name: '閲囪喘璁㈠崟',
+						id: '0',
+						isActive: false
+					},
+					{
+						name: '鐢熶骇宸ュ崟',
+						id: '1',
+						isActive: false
+					},
+					{
+						name: '閿�鍞鍗�',
+						id: '2',
+						isActive: false
+					},
+					{
+						name: '杞簱鍗�',
+						id: '3',
+						isActive: false
+					},
+					{
+						name: '鐩樼偣鍗�',
+						id: '4',
+						isActive: false
+					},
 				],
 				materailArray: []
 			};
 		},
+		onLoad(option) {
+			this.id = option.id
+			getBoundDetail({
+				id: option.id
+			})
+			.then(res => {
+				this.data = res.data
+				if (this.data.status === 1) {
+					this.materailArray.push(...this.data.woutboundDetailsOut)
+				} else {
+					this.materailArray.push(...this.data.woutboundDetailsWait)
+				}
+			})
+		},
 		methods: {
+			seeText(id) {
+				return orderTyepToStr(id)
+			},
 			tyepToStr(type) {
 				//  <!-- 1銆佽溅闂撮鏂欙紱2銆佽溅闂村鏂欙紱3銆佸叾浠栵紱4銆佸畬宸ュ叆搴� -->
 				for (const item of this.types) {
@@ -142,10 +206,17 @@
 				return '-'
 			},
 			submit() {
-				
+
 			},
 			cancel() {
-				
+				cancelBound({ id: this.id })
+					.then(res => {
+						uni.showToast({ title: '鍙栨秷鎴愬姛', icon: 'success', duration: 2000 });
+						uni.navigateBack({ delta: 1 });
+					})
+					.catch(err => {
+						uni.showToast({ title: err.message, icon: 'error', duration: 2000 });
+					})
 			}
 		}
 	}

--
Gitblit v1.9.3