1
lzhe
2024-05-24 c9ce5e7f9a9ef52c66baf4f8a6e8d9e48b7cb251
src/views/console/product-process/process-route.vue
@@ -23,7 +23,7 @@
      <div class="process-main-tabs">
         <div class="process-main-header">
            <div class="main-header-label">工艺路线<span>{{productName}}</span></div>
            <div style="padding: 20px;border-bottom: 1px solid #dee;">
            <div style="padding: 20px 20px 8px;border-bottom: 1px solid #dee;">
               <div class="main-info">
                  <div class="info-top-title">工艺路线版本</div>
                  <div class="main-info-tooltip">
@@ -32,13 +32,13 @@
                  </div>
               </div>
               <div>
                  <div class="btn-box vistion-button" v-for="item in detail.dtos">
                  <div :class="{'btn-box':true, 'vistion-button': true, 'isBorder': item.isBorder}" v-for="(item,index) in detail.dtos" @click="changeDots(item,index)">
                     <span class="vistion-button-round"></span>
                     <el-tooltip trigger="click" class="detail-item" effect="dark" :content="vHtml" placement="bottom" raw-content>
                        <span class="vistion-button-name" @click="showDetail(item)">{{item.name}}</span>
                      </el-tooltip>
                     <el-icon class="vistion-button-icon"><DocumentCopy /></el-icon>
                     <el-icon class="vistion-button-icon"><Delete /></el-icon>
                     <el-icon class="vistion-button-icon" @click="delIcon(item)"><Delete /></el-icon>
                  </div>
                  <div class="btn-box most-vision" @click="changeV">{{changVTitle}}</div>
                  <el-button @click="addVision">+ 添加新版本</el-button>
@@ -47,35 +47,7 @@
         </div>
         <div class="correlation-product-line">关联产线<span>千文科技</span></div>
         <div class="process-main-content">
            <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">定版</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-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 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> -->
                     </template>
                  </el-table-column>
               </el-table>
            </div>
            <div class="main-content-right">
               <div class="main-info-title">工序信息</div>
               <ul>
                  <li>工序编号<span>-</span></li>
                  <li>工序名称<span>-</span></li>
                  <li>工序顺序<span>-</span></li>
               </ul>
            </div>
            <workmanship :isCustomization = "true"></workmanship>
         </div>
      </div>
   </div>
@@ -84,6 +56,7 @@
<script>
   import saveDialog from './addRoute'
   import workmanship from './process-route/workmanship'  //工艺路线
   import * as ElementPlusIconsVue from '@element-plus/icons-vue'
   let icons = []
   for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
@@ -91,15 +64,16 @@
   }
   export default {
      name: 'route',
      components: {...ElementPlusIconsVue,saveDialog},
      components: {...ElementPlusIconsVue,saveDialog,workmanship},
      data() {
         return {
            craftId: "",
            id: "",
            changVTitle: "更多版本...",
            isMore: true,
            productName: "",
            vHtml: '',
            detail: {dtos: [{name: ""}]},
            detail: {dtos: [{name: "",isBorder: false}]},
            testList: [],
            routeForm: {
               test: ""
@@ -115,14 +89,36 @@
               save: false
            },
            info: {},
            tableData: [],
            selection: []
            delIconId: ""
         }
      },
      mounted(){
         this.getLeftTree();
      },
      methods: {
         delIcon(item) {
            this.delIconId = item.id;
            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(() => {
            })
         },
         changeDots(item,index) {
            this.detail.dtos.forEach(item=> {
               item.isBorder = false;
            })
            this.detail.dtos[index].isBorder = true;
            this.craftId = item.craftId;
         },
         addVision() {
            this.$router.push({path: `/console/product-process/process-route/add-craft-version`,query: {id:this.id}})
         },
@@ -153,7 +149,6 @@
            })
         },
         table_edit(row){
            this.dialog.save = true
            this.$HTTP.get(`/api/blade-cps/craft-routing/not-band-craft?craftId=${row.id}`).then(res=> {
               if(res.code == 200) {
                  this.dialog.save = true;
@@ -165,9 +160,6 @@
         },
         addRouteSuccess() {
            this.getLeftTree();
         },
         HandleSelectionChange(selection) {
            this.selection = selection;
         },
         routeSubmit() {
            this.$refs.dialogForm.validate(async (valid) => {
@@ -195,9 +187,16 @@
            this.leftData[index].active = true;
            this.info = this.leftData[index];
         },
         getDetail(id) {
            this.$HTTP.get(`/api/blade-cps/craft-routing/detail?id=${id}`).then(res=> {
         getDetail() {
            this.$HTTP.get(`/api/blade-cps/craft-routing/detail?id=${this.id}`).then(res=> {
               if(res.code == 200) {
                  if(res.data.dtos) {
                     res.data.dtos.forEach(item=> {
                        item.isBorder = false;
                     })
                     res.data.dtos[0].isBorder = true;
                     this.craftId = res.data.dtos[0].craftId;
                  }
                  this.detail = res.data;
               }
            })
@@ -215,7 +214,7 @@
                     this.productName = res.data[0].name;
                     this.id = res.data[0].id;
                  }
                  this.getDetail(res.data[0].id);
                  this.getDetail();
               }
            })
         }
@@ -307,11 +306,6 @@
.main-header-label span {
   margin-left: 12px;
}
.main-info-title {
   font-size: 14px;
    padding-left: 8px;
    border-left: 2px solid #7ab3ee;
}
.info-top-title {
   padding-left: 8px;
    border-left: 4px solid #86bffa;
@@ -335,38 +329,6 @@
    margin-right: 4px;
    display: inline-block;
}
.main-info-conent {
   display: flex;
    margin: 8px 0px 12px;
}
.main-info-conent > span {
   margin-right: 12px;
   font-size: 14px;
}
.main-info-conent > span span {
   margin-left:12px;
}
.process-main-content {
   display: flex;
}
.main-content-left {
   width: 70%;
}
.main-content-right {
   flex: 1;
}
.main-content-right ul {
   padding: 12px 30px;
}
.main-content-right ul li {
   width: 50%;
   float: left;
   list-style: none;
   margin-bottom:12px;
}
.main-content-right ul li span {
   margin-left:12px;
}
.addRoute {
   color: #409eff;
   padding: 12px 6px;
@@ -375,17 +337,20 @@
}
.btn-box {
   display: inline-block;
   margin-right: 20px;
}
.most-vision {
   border-bottom: 1px solid #86bffa;
   font-size: 14px;
   font-weight: 700;
   cursor: pointer;
   margin-right: 12px;
   margin-left: 6px;
}
.vistion-button {
   border: 1px solid #86bffa;
    padding: 8px 12px;
   margin-right: 6px;
   margin-bottom: 12px;
}
.vistion-button-name {
   vertical-align: middle;
@@ -415,6 +380,9 @@
.correlation-product-line span {
   margin-left: 20px;
}
.isBorder {
   border: 1px solid #0176f0;
}
</style>
<style>
   .detailUl {