Ver Fonte

生成工艺指令

liqianyi há 2 anos atrás
pai
commit
7a53f3249f
2 ficheiros alterados com 20 adições e 1 exclusões
  1. 8 0
      src/api/crafts.js
  2. 12 1
      src/views/modules/tech/crafts-management.vue

+ 8 - 0
src/api/crafts.js

@@ -54,3 +54,11 @@ export function revoke (data) {
     data
   })
 }
+
+// 生成工艺指令
+export function generateInstruction (techId) {
+  return request({
+    url: request.adornUrl(`/biz-service/technology/generateInstruction/${techId}`),
+    method: 'POST'
+  })
+}

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

@@ -144,6 +144,7 @@
             <el-button v-if="isAuth('pro:technology:update') && scope.row.techState === '-1' && scope.row.state === '3'" type="text" size="small" @click="changeStateHandle(scope.row.techId, 0)">启用</el-button>
             <el-button v-if="isAuth('pro:technology:update') && scope.row.techState === '0'" type="text" size="small" @click="changeStateHandle(scope.row.techId, -1)">停用</el-button>
             <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')" type="text" size="small" @click="generate(scope.row.techId)">生成</el-button>
           </template>
         </el-table-column>
       </el-table>
@@ -164,7 +165,7 @@
 </template>
 
 <script>
-  import { getTechnology, update, revoke } from '@/api/crafts'
+  import { getTechnology, update, revoke, generateInstruction } from '@/api/crafts'
   import ctaftsAddOrDetail from './ctafts-add-or-detail'
   import Detail from './crafts-detail'
   export default {
@@ -296,6 +297,16 @@
       // 关闭编辑dialog事件
       closeEditDialogEvent () {
         this.addOrUpdateVisible = false
+      },
+      // 生成工艺指令
+      generate (techId) {
+        generateInstruction(techId).then(({data}) => {
+          if (data && data.code === '200') {
+            this.$message.success('成功生成工艺指令!')
+          } else {
+            this.$message.error('生成工艺指令失败!')
+          }
+        })
       }
     }
   }