Browse Source

删除:bom、工艺

chrislee 1 year ago
parent
commit
97e6b323ce

+ 32 - 1
src/views/modules/tech/crafts-management.vue

@@ -138,7 +138,7 @@
           header-align="center"
           fixed="right"
           align="center"
-          width="180"
+          width="250"
           label="操作">
           <template slot-scope="scope">
             <el-button v-if="isAuth('pro:technology:revoke') && scope.row.state === '1'" type="text" size="small" @click="revokeHandle(scope.row.techId)">撤销</el-button>
@@ -149,6 +149,7 @@
             <el-button v-if="isAuth('pro:technology:info')" type="text" size="small" @click="detailHandle(scope.row.techId, scope.row.productName)">查看</el-button>
             <el-button v-if="isAuth('pro:technology:generateInstruction') && Number(scope.row.isGenerate) === 0" type="text" size="small" @click="generate(scope.row.techId)">生成</el-button>
             <el-button v-if="isAuth('pro:technology:save') && scope.row.state === '0'" type="text" size="small" @click="addOrUpdateHandle(scope.row.techId, false, true)">重新提交</el-button>
+            <el-button v-if="isAuth('pro:technology:delete')" style="color: red" type="text" size="small" @click="deleteHandle(scope.row.techId)">删除</el-button>
           </template>
         </el-table-column>
       </el-table>
@@ -311,6 +312,36 @@
             this.$message.error('生成工艺指令失败!')
           }
         })
+      },
+      // 删除
+      deleteHandle (id) {
+        if (!id) return
+        let ids = []
+        ids.push(id)
+        this.$confirm(`确定删除?`, '提示', {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning'
+        }).then(() => {
+          this.$http({
+            url: this.$http.adornUrl(`/biz-service/technology/delete`),
+            method: 'DELETE',
+            data: ids
+          }).then(({data}) => {
+            if (data && data.code === '200') {
+              this.$message({
+                message: '操作成功',
+                type: 'success',
+                duration: 1500,
+                onClose: () => {
+                  this.getDataList()
+                }
+              })
+            } else {
+              this.$message.error(data.msg)
+            }
+          })
+        }).catch(() => {})
       }
     }
   }

+ 2 - 1
src/views/modules/tech/product-management.vue

@@ -282,7 +282,7 @@
           fixed="right"
           header-align="center"
           align="center"
-          width="240"
+          width="280"
           label="操作">
           <template slot-scope="scope">
             <el-button v-if="isAuth('pro:product:info')" type="text" size="small" @click="detailHandle(scope.row.productId)">查看</el-button>
@@ -292,6 +292,7 @@
             <el-button v-if="isAuth('pro:product:write') && Number(scope.row.writeState) === 1" type="text" size="small" @click="writeHandle(scope.row.productId)">读写</el-button>
             <el-button v-if="isAuth('pro:product:pause') && Number(scope.row.state) === 1" type="text" size="small" @click="pauseHandle(scope.row.productId)">暂停生产</el-button>
             <el-button v-if="isAuth('pro:product:regain') && Number(scope.row.state) === 2" type="text" size="small" @click="regainHandle(scope.row.productId)">恢复生产</el-button>
+            <el-button v-if="isAuth('pro:product:delete')" style="color: red" type="text" size="small" @click="deleteHandle(scope.row.productId)">删除</el-button>
           </template>
         </el-table-column>
       </el-table>