ysy пре 1 година
родитељ
комит
dc889f125b
2 измењених фајлова са 115 додато и 10 уклоњено
  1. 114 9
      src/views/material/BOMmanage/detailsPop.vue
  2. 1 1
      src/views/material/BOMmanage/index.vue

+ 114 - 9
src/views/material/BOMmanage/detailsPop.vue

@@ -40,12 +40,6 @@
               删除
             </el-button>
 
-            <el-button type="warning" size="mini"> 提交发布 </el-button>
-
-            <el-button type="warning" size="mini" @click="handleSave">
-              保存
-            </el-button>
-
             <el-button
               v-if="currentNodeData.bomType == 1"
               type="primary"
@@ -84,9 +78,34 @@
               v-if="currentNodeData.bomType == 1"
               >转换ABOM</el-button
             >
+
+            <el-button
+              type="warning"
+              size="mini"
+              @click="handSubmit"
+              v-if="
+                currentNodeData.approvalStatus == 0 ||
+                currentNodeData.approvalStatus == 3
+              "
+            >
+              提交发布
+            </el-button>
+
+            <el-button type="warning" size="mini" @click="handleSave">
+              保存
+            </el-button>
           </div>
         </div>
         <div>
+          <el-button type="text"  @click="handleDetails()" v-if="currentNodeData.approvalStatus == 1" :underline="false">
+            {{ approvalStatusOpt[+currentNodeData.approvalStatus] }}
+          </el-button>
+
+          <el-button type="text" style="color: #F56C6C;" v-if="currentNodeData.approvalStatus == 3" :underline="false">
+            {{ approvalStatusOpt[+currentNodeData.approvalStatus] }}
+          </el-button>
+
+
           <el-button
             icon="el-icon-full-screen"
             type="text"
@@ -210,6 +229,25 @@
       ref="importDialogRef"
       @success="getTreeData"
     />
+
+    <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>
 
@@ -220,7 +258,10 @@
     getBomGetById,
     convert,
     convertABom,
-    deleteBomTreeList
+    deleteBomTreeList,
+    bomSubmit,
+    jsBomSubmit,
+    deviceBomSubmit
   } from '@/api/material/BOM.js';
 
   import baseInfo from './components/baseInfo.vue';
@@ -228,6 +269,7 @@
   import attribute from './components/attribute.vue';
   import detailedList from './components/detailedList.vue';
   import importDialog from './qualityTesting/import-dialog.vue';
+  import LCdetail from './components/LCdetail.vue';
 
   export default {
     components: {
@@ -235,7 +277,8 @@
       baseInfoSave,
       attribute,
       detailedList,
-      importDialog
+      importDialog,
+      LCdetail
     },
     data() {
       return {
@@ -268,9 +311,25 @@
         baseInfoShow: false,
         isNotData: true,
 
-        moudleName: 'mainUser'
+        moudleName: 'mainUser',
+        isSubmit: false,
+        radioSubmit: 1,
+
+        approvalStatusOpt: {
+          0: '未提交',
+          1: '审核中',
+          2: '审核通过',
+          3: '审核不通过'
+        }
       };
     },
+
+    computed: {
+      clientEnvironmentId() {
+        return this.$store.state.user.info.clientEnvironmentId;
+      }
+    },
+
     methods: {
       open(row) {
         this.searchObj = row;
@@ -422,6 +481,52 @@
       handleSave() {
         this.$message.success('保存成功');
         this.handleClose();
+      },
+
+      handSubmit() {
+        if (this.clientEnvironmentId == 4) {
+          this.isSubmit = true;
+        } else {
+          this.$alert('确定要发布吗?', '提示', {
+            confirmButtonText: '确定',
+            cancelButtonText: '取消',
+            type: 'warning'
+          })
+            .then(() => {
+              bomSubmit({ businessId: this.currentNodeData.id }).then((res) => {
+                this.$message.success('发布成功');
+                this.getTreeData();
+              });
+            })
+            .catch(() => {});
+        }
+      },
+
+      handJsSubmit() {
+        let URL = this.radioSubmit == 1 ? jsBomSubmit : deviceBomSubmit;
+        this.$alert('确定要发布吗?', '提示', {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning'
+        })
+          .then(() => {
+            URL({ businessId:this.currentNodeData.id }).then((res) => {
+              this.isSubmit = false;
+              this.$message.success('发布成功');
+              this.getTreeData();
+            });
+          })
+          .catch(() => {});
+      },
+
+
+      
+      handleDetails() {
+        if (!this.currentNodeData.processInstanceId) {
+          this.$message.info('未提交没有审核流程');
+        } else {
+          this.$refs.detailRef.open(this.currentNodeData.processInstanceId);
+        }
       }
     }
   };

+ 1 - 1
src/views/material/BOMmanage/index.vue

@@ -243,7 +243,7 @@
       },
 
       handSubmit(row) {
-        if (this.clientEnvironmentId == 3) {
+        if (this.clientEnvironmentId == 4) {
           this.JsRId = row.id;
           this.isSubmit = true;
         } else {