From c9ce5e7f9a9ef52c66baf4f8a6e8d9e48b7cb251 Mon Sep 17 00:00:00 2001
From: lzhe <181968431@qq.com>
Date: 星期五, 24 五月 2024 23:59:27 +0800
Subject: [PATCH] 1

---
 src/views/console/product-process/process-route/workmanship.vue |   85 ++++++++++++++++++++++++++++++++++--------
 1 files changed, 68 insertions(+), 17 deletions(-)

diff --git a/src/views/console/product-process/process-route/workmanship.vue b/src/views/console/product-process/process-route/workmanship.vue
index f3b847a..227212b 100644
--- a/src/views/console/product-process/process-route/workmanship.vue
+++ b/src/views/console/product-process/process-route/workmanship.vue
@@ -11,45 +11,51 @@
 		<div class="main-content-left">
 			<div class="info-top-title">宸ヨ壓璺嚎</div>
 			<div style="margin-bottom: 12px;">
-				<el-button type="primary">鏂板</el-button>
-				<el-button type="primary" v-if="isCustomization">瀹氱増</el-button>
+				<el-button type="primary" @click="table_open">鏂板</el-button>
+				<el-button type="primary" v-if="isCustomization" @click="determineVersion">瀹氱増</el-button>
 				<el-button disabled>骞跺簭</el-button>
 			</div>
-			<el-table ref="multipleTableRef0" :data="tableData" border style="width: 100%" class="multipleTableRef" @selection-change="HandleSelectionChange">
+			<el-table ref="multipleTableRef0" :data="tableData" border style="width: 100%" class="multipleTableRef" @selection-change="HandleSelectionChange" @row-click="rowClick">
 				<el-table-column type="selection" width="55" />
-				<el-table-column prop="name" label="宸ュ簭椤哄簭"></el-table-column>
+				<el-table-column prop="index" label="宸ュ簭椤哄簭"></el-table-column>
 				<el-table-column prop="code" label="宸ュ簭缂栧彿"></el-table-column>
-				<el-table-column prop="typeName" label="宸ュ簭鍚嶇О"></el-table-column>
+				<el-table-column prop="name" label="宸ュ簭鍚嶇О"></el-table-column>
 				<el-table-column fixed="right" label="鎿嶄綔" width="200px">
 					<template #default="scope">
-						<!-- <el-button text type="primary" size="small" @click="table_edit(scope.row, scope.$index)">缂栬緫</el-button>
-						<el-button text type="primary" size="small" @click="table_edit(scope.row, scope.$index)">鍒锋柊</el-button>
-						<el-button text type="primary" size="small" @click="table_edit(scope.row, scope.$index)">鍒犻櫎</el-button> -->
+						<el-button text type="primary" size="small" @click="table_edit(scope.row, scope.$index)">鍒犻櫎</el-button>
 					</template>
 				</el-table-column>
 			</el-table>
 		</div>
 		<div class="main-content-right">
 			<div class="main-info-title">宸ュ簭淇℃伅</div>
-			<div class="addWorking" @click="table_open">娣诲姞宸ュ簭</div>
-			<!-- <ul>
+			<div class="addWorking" @click="table_open" v-if="!isCustomization">娣诲姞宸ュ簭</div>
+			<ul v-if="isCustomization">
 				<li>宸ュ簭缂栧彿<span></span></li>
 				<li>宸ュ簭鍚嶇О<span></span></li>
 				<li>宸ュ簭椤哄簭<span></span></li>
-			</ul> -->
+			</ul>
 		</div>
 	</div>
 	<save-dialog v-if="dialog.save" ref="saveDialog" @success="addRouteSuccess" @closed="dialog.save=false"></save-dialog>
+	<el-drawer v-model="drawer" title="娣诲姞宸ュ簭" direction="rtl" :before-close="handleClose" size="60%" modal-class="viewData">
+		<!-- 鏂板璺嚎 -->
+		<div class="addworkmanship">
+			<add-workmanship></add-workmanship>
+		</div>
+	</el-drawer>
 </template>
 
 <script>
+	import addWorkmanship from './addWorkmanship'
 	import saveDialog from './addWorking'
 	export default {
 		name: 'workmanship',
-		components: {saveDialog},
+		components: {saveDialog,addWorkmanship},
 		props: ["isCustomization"],
 		data() {
 			return {
+				drawer: false,
 				tableData: [],
 				selection: [],
 				dialog: {
@@ -61,14 +67,56 @@
 			
 		},
 		methods: {
+			handleClose() {
+
+			},
+			determineVersion() {
+				var that = this;
+				this.$confirm(`宸ヨ壓璺嚎瀹氱増鍚庯紝涓嶆敮鎸佺紪杈戙�佸垹闄ゃ�佹坊鍔犲伐搴忥紝璇风‘璁ゆ槸鍚﹀畾鐗�?`, '', {
+					type: 'warning'
+				}).then(() => {
+					// this.$HTTP.delete("/api/blade-cps/production-craft-version/remove/"+that.delIconId).then(res=> {
+					// 	if(res.code == 200) {
+					// 		that.$message.success("鎿嶄綔鎴愬姛");
+					// 		that.getDetail();
+					// 	}
+					// })
+				}).catch(() => {
+
+				})
+			},
+			rowClick(row, column, event) {
+				// this.id = row.id;
+				// this.getWorkDetail();
+				// this.getPage1();
+			},
+			table_edit(row,index) {
+				this.$confirm(`纭瑕佸垹闄ゆ宸ュ簭鍚�?`, '', {
+					type: 'warning'
+				}).then(() => {
+					this.tableData.splice(index,1);
+				}).catch(() => {
+
+				})
+			},
+			addRouteSuccess(selection) {
+				selection.forEach((item,i)=> {
+					item.index = i+1;
+				})
+				this.tableData = selection;
+			},
 			HandleSelectionChange(selection) {
 				this.selection = selection;
 			},
 			table_open() {
-				this.dialog.save = true
-				this.$nextTick(() => {
-					this.$refs.saveDialog.open();
-				})
+				if(this.isCustomization) {  //棣栭〉鐨勬柊寤�
+					this.drawer = true;
+				}else {  //鐗堟湰姝ラ涓殑鏂板缓
+					this.dialog.save = true
+					this.$nextTick(() => {
+						this.$refs.saveDialog.open();
+					})
+				}
 			}
 		}
 	}
@@ -89,7 +137,7 @@
     color: #333;
 }
 .main-content-left {
-	width: 70%;
+	width: 60%;
 }
 .main-content-right {
 	flex: 1;
@@ -120,4 +168,7 @@
 	font-size: 14px;
 	cursor: pointer;
 }
+.addworkmanship {
+	padding: 0 20px;
+}
 </style>

--
Gitblit v1.9.3