From 464c4f614e1d3f80209cf7f99bacdce41fc8cef4 Mon Sep 17 00:00:00 2001
From: licp <lichunping@guanfang.com.cn>
Date: 星期一, 18 三月 2024 10:36:12 +0800
Subject: [PATCH] 完成检验下单-查看详情,审批功能

---
 src/components/do/b1-ins-order/add.vue |   57 +++++++++++++++++++++++++++++++++++++++++++++++++--------
 1 files changed, 49 insertions(+), 8 deletions(-)

diff --git a/src/components/do/b1-ins-order/add.vue b/src/components/do/b1-ins-order/add.vue
index cbcbb42..b1b4b22 100644
--- a/src/components/do/b1-ins-order/add.vue
+++ b/src/components/do/b1-ins-order/add.vue
@@ -70,7 +70,7 @@
 	.ins_order_add .el-table__row .cell {
 		font-size: 12px;
 	}
-	
+
 	.ins_order_add .el-table .warning-row .cell{
 		color: #bababa;
 	}
@@ -82,13 +82,15 @@
 			<el-row class="title">
 				<el-col :span="6" style="padding-left: 20px;">濮旀墭鍗曚俊鎭�</el-col>
 				<el-col :span="18" style="text-align: right;">
-					<el-select v-model="template" size="medium" placeholder="涓嬪崟妯℃澘" style="margin-right: 10px;">
+					<el-select v-model="template" size="medium" placeholder="涓嬪崟妯℃澘" style="margin-right: 10px;" v-show="active<2">
 						<el-option v-for="(a, ai) in templates" :key="ai" :value="a.value" :label="a.label"></el-option>
 					</el-select>
-					<el-button size="medium" @click="">
+					<el-button size="medium" @click="" v-show="active<2">
 						<span style="color: #3A7BFA;">淇濆瓨妯℃澘</span>
 					</el-button>
-					<el-button size="medium" type="primary" @click="save" :loading="saveLoad">鎻愪氦</el-button>
+					<el-button size="medium" type="primary" @click="save" :loading="saveLoad" v-show="active<2">鎻愪氦</el-button>
+          <el-button size="medium" @click="upInsOrderOfState(2)" :loading="saveLoad" v-show="active==3">瀹℃牳涓嶉�氳繃</el-button>
+          <el-button size="medium" type="primary" @click="upInsOrderOfState(1)" :loading="saveLoad" v-show="active==3">瀹℃牳閫氳繃</el-button>
 					<el-button size="medium" @click="$parent.playOrder(0)">
 						<span style="color: #3A7BFA;">杩斿洖</span>
 					</el-button>
@@ -159,9 +161,9 @@
 		</div>
 		<div>
 			<div style="text-align: right;line-height: 45px;">
-				<el-button type="primary" size="small" @click="addSampleDia = true">娣诲姞鏍峰搧</el-button>
+				<el-button type="primary" size="small" @click="addSampleDia = true" v-show="active<2">娣诲姞鏍峰搧</el-button>
 				<el-button size="small" @click="delSample">
-					<span style="color: #3A7BFA;">鍒犻櫎鏍峰搧</span>
+					<span style="color: #3A7BFA;" v-show="active<2">鍒犻櫎鏍峰搧</span>
 				</el-button>
 			</div>
 			<el-table class="el-table" ref="sampleTable" :data="sampleList" height="250px" tooltip-effect="dark" border
@@ -209,7 +211,7 @@
 				<el-table-column label="鎿嶄綔" width="65" align="center">
 					<template slot-scope="scope">
 						{{scope.index}}
-						<el-button type="text" size="small" @click="sampleList.splice(scope.$index, 1)">鍒犻櫎</el-button>
+						<el-button type="text" size="small" @click="sampleList.splice(scope.$index, 1)" :disabled="active!=1">鍒犻櫎</el-button>
 					</template>
 				</el-table-column>
 			</el-table>
@@ -347,6 +349,16 @@
 		components: {
 			ValueTable
 		},
+    props:{
+      active: {
+				type: Number,
+				default: () => 0
+			},
+      currentId:{
+        type: Number,
+				default: () => 0
+      }
+    },
 		data() {
 			return {
 				template: null,
@@ -421,6 +433,19 @@
 			this.selectEnumByCategoryForType()
 			this.getUserNow()
 			this.selectStandardTreeList()
+      if(this.active==1){
+        // 涓嬪崟娴佺▼
+      }else {
+        // 鏌ョ湅/瀹℃牳娴佺▼
+        // 璇锋眰鎺ュ彛锛屽洖鏄炬暟鎹�
+        this.$axios.post(this.$api.insOrder.getInsOrder, {
+					orderId: this.currentId
+				}).then(res => {
+          this.addObj = {...res.data.insOrder};
+          this.addObj.type = String(this.addObj.type)
+          this.sampleList = res.data.sampleProduct
+				})
+      }
 		},
 		methods: {
 			selectEnumByCategoryForType() {
@@ -461,6 +486,22 @@
 					this.$parent.playOrder(0)
 				})
 			},
+      upInsOrderOfState(state){
+        this.saveLoad = true
+				this.$axios.post(this.$api.insOrder.upInsOrderOfState,{
+					state,
+          id:this.currentId
+				},{
+					headers: {
+						'Content-Type': 'application/json'
+					}
+				}).then(res=>{
+					this.saveLoad = false
+					if(res.code==201)return
+					this.$message.success('鎻愪氦鎴愬姛')
+					this.$parent.playOrder(0)
+				})
+      },
 			getUserNow() {
 				this.$axios.get(this.$api.user.getUserNow).then(res => {
 					let selects = res.data
@@ -621,4 +662,4 @@
 			}
 		}
 	}
-</script>
\ No newline at end of file
+</script>

--
Gitblit v1.9.3