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 ++++++++++++++++++++++++----
 src/main.js                                 |    2 
 src/components/view/b1-inspection-order.vue |   31 +++++++++------
 src/assets/api/controller.js                |    2 +
 4 files changed, 70 insertions(+), 22 deletions(-)

diff --git a/src/assets/api/controller.js b/src/assets/api/controller.js
index 2f3da4f..7d1ec86 100644
--- a/src/assets/api/controller.js
+++ b/src/assets/api/controller.js
@@ -118,6 +118,8 @@
 	addInsOrder: "/insOrder/addInsOrder", //娣诲姞妫�楠屼笅鍗曟暟鎹�
 	selectOrderManDay: "/insOrder/selectOrderManDay", //鏌ヨ璁㈠崟鎬诲叡棰勮鏃堕棿
 	upInsOrder: "/insOrder/upInsOrder", //妫�楠屼笅鍙�
+  getInsOrder: "/insOrder/getInsOrder", //鏌ヨ妫�楠屼笅鍗曞唴瀹硅鎯�
+  upInsOrderOfState: "/insOrder/upInsOrderOfState", //瀹℃牳妫�楠屽崟鏈鸿繘琛岀姸鎬佷慨鏀�
 }
 
 const sampleOrder = {
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>
diff --git a/src/components/view/b1-inspection-order.vue b/src/components/view/b1-inspection-order.vue
index 4e3f189..4ad89cb 100644
--- a/src/components/view/b1-inspection-order.vue
+++ b/src/components/view/b1-inspection-order.vue
@@ -16,13 +16,13 @@
 		align-items: center;
 		height: 50px;
 	}
-	
+
 	.search_label {
 		width: 120px;
 		font-size: 14px;
 		text-align: right;
 	}
-	
+
 	.search_input {
 		width: calc(100% - 120px);
 	}
@@ -179,8 +179,8 @@
 				</div>
 			</el-dialog>
 		</div>
-		<div style="width: 100%;height: 100%;" v-if="active == 1">
-			<Add />
+		<div style="width: 100%;height: 100%;" v-if="active >0">
+			<Add :active="active" :currentId="currentId" />
 		</div>
 	</div>
 </template>
@@ -347,7 +347,8 @@
 					},
 				],
 				tabIndex: 0,
-				active: 0
+				active: 0,//1锛氫笅鍗曪紝2锛氭煡鐪嬶紝3锛氬鏍�
+        currentId:null
 			}
 		},
 		mounted() {
@@ -411,12 +412,14 @@
 			},
 			// 璇︽儏
 			selectAllByOne(row) {
-				console.log(row);
-				//鎵撳紑寮规
-				this.dialogVisible = true;
-				//row = 鐐瑰嚮瀵瑰簲琛屽��
-				//澶嶅埗缁檉ormData
-				this.formData = this.HaveJson(row);
+        this.active = 2;
+				// console.log(row);
+				// //鎵撳紑寮规
+				// this.dialogVisible = true;
+				// //row = 鐐瑰嚮瀵瑰簲琛屽��
+				// //澶嶅埗缁檉ormData
+				// this.formData = this.HaveJson(row);
+        this.currentId = row.id
 			},
 			// 鏁版嵁鏌ョ湅
 			handleDataLook(row) {
@@ -427,7 +430,9 @@
 			},
 			// 瀹℃牳
 			handleVerify(row) {
-				this.verifyDialogVisible = true;
+				// this.verifyDialogVisible = true;
+        this.active = 3;
+        this.currentId = row.id
 			},
 			// 鎾ら攢
 			handlEquash(row) {
@@ -501,4 +506,4 @@
 			}
 		}
 	}
-</script>
\ No newline at end of file
+</script>
diff --git a/src/main.js b/src/main.js
index e4a8aa2..e3d3603 100644
--- a/src/main.js
+++ b/src/main.js
@@ -13,7 +13,7 @@
 
 //鏈湴
 Vue.prototype.LOCATIONVUE = "http://127.0.0.1:80";
-const javaApi = 'http://127.0.0.1:8001';
+const javaApi = 'http://192.168.0.24:8001';
 //鑳滀簯鏈嶅姟鍣�
 // Vue.prototype.LOCATIONVUE = "http://syxt.shxiao2.cn";
 // const javaApi = 'http://122.114.52.69:8001';

--
Gitblit v1.9.3