1
lzhe
2024-05-27 6c3ae44336f7f25e5b33330e353fc283ab04c1f4
src/views/console/product-process/process-route/workmanship.vue
@@ -46,7 +46,7 @@
   <el-drawer v-model="drawer" title="添加工序" direction="rtl" :before-close="handleClose" size="60%" modal-class="viewData">
      <!-- 新增路线 -->
      <div class="addworkmanship">
         <add-workmanship></add-workmanship>
         <add-workmanship ref="addworkmanship" @success="handleSuccess" :isClear="isClear" :craftId="craftId"></add-workmanship>
      </div>
   </el-drawer>
</template>
@@ -60,6 +60,7 @@
      props: ["isCustomization","craftId"],
      data() {
         return {
            isClear: false,
            drawer: false,
            tableData: [],
            selection: [],
@@ -78,6 +79,11 @@
         }
      },
      methods: {
         handleSuccess(value) {
            this.drawer = false;
            this.isClear = false;
            this.getcraftlList();
         },
         getcraftlList() {
            this.$HTTP.get(`/api/blade-cps/production-craft-version/detail/${this.craftId}`).then(res=> {
               if(res.code == 200) {
@@ -88,8 +94,9 @@
               }
            })
         },
         handleClose() {
         handleClose(done) {
            this.isClear = true;
            done();
         },
         determineVersion() {
            var that = this;
@@ -111,18 +118,6 @@
            // 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;
@@ -141,6 +136,33 @@
                  this.$refs.saveDialog.open();
               })
            }
         },
         table_edit(row,index) {
            this.drawer = true;
            this.$nextTick(()=> {
               this.$refs.addworkmanship.setData(row);
            })
         },
         table_del(row,index) {
            var that = this;
            this.$confirm(`确认要删除此工序吗?`, '', {
               type: 'warning'
            }).then(() => {
               var obj = {
                  mainProcess: [],
                  normalProcess: that.tableData,
                  removeIds: [row.id],
                  versionId: that.craftId
               }
               this.$HTTP.post(`/api/blade-cps/production-craft-process/child-process-update`,obj).then(res=> {
                  if(res.code == 200) {
                     that.$message.success("操作成功");
                     that.getcraftlList();
                  }
               })
            }).catch(() => {
            })
         }
      }
   }