From 7dbecd38861e98284ce0b5e4b297144444e9fb11 Mon Sep 17 00:00:00 2001
From: gaoshp <291585735@qq.com>
Date: 星期日, 26 五月 2024 22:11:57 +0800
Subject: [PATCH] update
---
src/views/console/product-process/process-route/workmanship.vue | 115 +++++++++++++++++++++++++++++++++++++++++++++++----------
1 files changed, 95 insertions(+), 20 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..80a526c 100644
--- a/src/views/console/product-process/process-route/workmanship.vue
+++ b/src/views/console/product-process/process-route/workmanship.vue
@@ -11,45 +11,56 @@
<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="code" label="宸ュ簭缂栧彿"></el-table-column>
- <el-table-column prop="typeName" label="宸ュ簭鍚嶇О"></el-table-column>
+ <el-table-column prop="index" label="宸ュ簭椤哄簭">
+ <template #default="scope">
+ <span>{{scope.row.index}}</span>
+ </template>
+ </el-table-column>
+ <el-table-column prop="processCode" label="宸ュ簭缂栧彿"></el-table-column>
+ <el-table-column prop="processName" 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>
+ <el-button text type="primary" size="small" @click="table_del(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},
- props: ["isCustomization"],
+ components: {saveDialog,addWorkmanship},
+ props: ["isCustomization","craftId"],
data() {
return {
+ drawer: false,
tableData: [],
selection: [],
dialog: {
@@ -58,17 +69,78 @@
}
},
mounted(){
-
+ },
+ watch: {
+ craftId(val) {
+ if(val) {
+ this.getcraftlList();
+ }
+ }
},
methods: {
+ getcraftlList() {
+ this.$HTTP.get(`/api/blade-cps/production-craft-version/detail/${this.craftId}`).then(res=> {
+ if(res.code == 200) {
+ res.data.processList.forEach((item,index)=> {
+ item.index = index + 1;
+ });
+ this.tableData = res.data.processList;
+ }
+ })
+ },
+ 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) {
+
+ },
+ table_del(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 +161,7 @@
color: #333;
}
.main-content-left {
- width: 70%;
+ width: 60%;
}
.main-content-right {
flex: 1;
@@ -120,4 +192,7 @@
font-size: 14px;
cursor: pointer;
}
+.addworkmanship {
+ padding: 0 40px;
+}
</style>
--
Gitblit v1.9.3