ysy 1 an în urmă
părinte
comite
0a530b2a3e
2 a modificat fișierele cu 90 adăugiri și 39 ștergeri
  1. 11 0
      src/api/material/BOM.js
  2. 79 39
      src/views/material/BOMmanage/index.vue

+ 11 - 0
src/api/material/BOM.js

@@ -231,6 +231,17 @@ export async function bomSubmit(data) {
   return Promise.reject(new Error(res.data.message));
 }
 
+// 嘉实医药提交
+export async function jsBomSubmit(data) {
+  const res = await request.post(`/bpm/jsbom/submit`, data);
+  if (res.data.code == 0) {
+    return res.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+
+
 // 新增工序
 export async function workingProcedureSave(data) {
   const res = await request.post(`/main/categoryparam/save`, data);

+ 79 - 39
src/views/material/BOMmanage/index.vue

@@ -31,49 +31,63 @@
 
           <template v-slot:isTemp="{ row }">
             <el-tag size="mini" v-if="row.isTemp == 1">主数据</el-tag>
-
           </template>
-          
-
-          
 
           <!-- 表头工具栏 -->
           <template v-slot:action="{ row }">
             <el-link type="primary" @click="handelDetail(row)">详情</el-link>
-            <!-- <el-switch
-              :active-value="'1'"
-              :inactive-value="'0'"
-              @change="openBom(row, $event)"
-              v-model="row.status"
-            >
-            </el-switch> -->
+
             <el-link
-              v-if="row.status == 0"
+              v-if="row.approvalStatusOpt == 0  || row.approvalStatusOpt == 3"
               type="primary"
               @click="handSubmit(row)"
               >发布</el-link
             >
 
-             
-            <el-link type="danger" :underline="false"  v-if="activeName == 1 && row.status == 0" @click="handDel(row)">
-                删除
-              </el-link>
-
+            <el-link
+              type="danger"
+              :underline="false"
+              v-if="activeName == 1 && row.status == 0"
+              @click="handDel(row)"
+            >
+              删除
+            </el-link>
           </template>
         </ele-pro-table>
       </el-tabs>
     </el-card>
 
+    <el-dialog
+      title="发布"
+      :visible.sync="isSubmit"
+      v-if="isSubmit"
+      width="30%"
+      center
+    >
+      <div>
+        <el-radio v-model="radioSubmit" :label="1">药品</el-radio>
+        <el-radio v-model="radioSubmit" :label="2">器械</el-radio>
+      </div>
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="isSubmit = false">取 消</el-button>
+        <el-button type="primary" @click="handJsSubmit()">确 定</el-button>
+      </span>
+    </el-dialog>
 
     <LCdetail ref="detailRef"></LCdetail>
-
   </div>
 </template>
 
 <script>
   import BOMSearch from './components/BOM-search.vue';
-  import { getBomPageList, startAndStop, bomSubmit, deleteBomTreeList } from '@/api/material/BOM';
-  import LCdetail from './components/LCdetail.vue'
+  import {
+    getBomPageList,
+    startAndStop,
+    bomSubmit,
+    jsBomSubmit,
+    deleteBomTreeList
+  } from '@/api/material/BOM';
+  import LCdetail from './components/LCdetail.vue';
   export default {
     name: 'SystemDictionary',
     components: { BOMSearch, LCdetail },
@@ -130,8 +144,7 @@
             width: 100,
             prop: 'isTemp',
             slot: 'isTemp',
-            label: '主数据',
-        
+            label: '主数据'
           },
 
           {
@@ -166,9 +179,20 @@
         loadingInstance: null,
         where: {},
 
-        activeName: '1'
+        activeName: '1',
+
+        isSubmit: false,
+        JsRId: null,
+        radioSubmit: 1
       };
     },
+
+    computed: {
+      clientEnvironmentId() {
+        return this.$store.state.user.info.clientEnvironmentId;
+      }
+    },
+
     mounted() {
       this.initData();
     },
@@ -217,15 +241,37 @@
       },
 
       handSubmit(row) {
+        if (this.clientEnvironmentId == 3) {
+          this.JsRId = row.id;
+          this.isSubmit = true;
+        } else {
+          this.$alert('确定要发布吗?', '提示', {
+            confirmButtonText: '确定',
+            cancelButtonText: '取消',
+            type: 'warning'
+          })
+            .then(() => {
+              bomSubmit({ businessId: row.id }).then((res) => {
+                this.$message.success('发布成功');
+                this.reload();
+              });
+            })
+            .catch(() => {});
+        }
+      },
+
+      handJsSubmit() {
+        let URL = this.radioSubmit == 1 ? jsBomSubmit : bomSubmit;
         this.$alert('确定要发布吗?', '提示', {
           confirmButtonText: '确定',
           cancelButtonText: '取消',
           type: 'warning'
         })
           .then(() => {
-            bomSubmit({ businessId: row.id }).then((res) => {
+            URL({ businessId: this.JsRId }).then((res) => {
               this.$message.success('发布成功');
               this.reload();
+              this.isSubmit = false;
             });
           })
           .catch(() => {});
@@ -260,9 +306,6 @@
         this.$refs.table.reload({ where });
       },
 
-
-
-
       handleClick(tab) {
         this.activeName = tab.name;
         this.reload();
@@ -275,10 +318,9 @@
           type: 'warning'
         })
           .then(() => {
-            deleteBomTreeList([row.id])
-              .then(() => {
-                this.reload();
-              })
+            deleteBomTreeList([row.id]).then(() => {
+              this.reload();
+            });
           })
           .catch(() => {
             this.$message({
@@ -288,15 +330,13 @@
           });
       },
 
-      
-    handleDetails(row) {
-      if (!row.processInstanceId) {
-        this.$message.info('未提交没有审核流程')
-      } else {
-        this.$refs.detailRef.open(row.processInstanceId);
+      handleDetails(row) {
+        if (!row.processInstanceId) {
+          this.$message.info('未提交没有审核流程');
+        } else {
+          this.$refs.detailRef.open(row.processInstanceId);
+        }
       }
-
-    }
     }
   };
 </script>