ysy 1 год назад
Родитель
Сommit
5f4c182491

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

@@ -209,6 +209,16 @@ export async function startAndStop(data) {
   return Promise.reject(new Error(res.data.message));
 }
 
+// 发布
+
+export async function bomSubmit(data) {
+  const res = await request.post(`/bpm/bom/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);

+ 11 - 0
src/views/material/BOMmanage/components/detailedList.vue

@@ -68,6 +68,17 @@
               label: '产品名称',
               showOverflowTooltip: true
             },
+            {
+              prop: 'dosage',
+              label: '用量',
+              showOverflowTooltip: true
+            },
+
+            {
+              prop: 'measuringUnit',
+              label: '计量单位',
+              showOverflowTooltip: true
+            },
             {
               prop: 'versions',
               label: '版本'

+ 38 - 4
src/views/material/BOMmanage/index.vue

@@ -22,18 +22,24 @@
           <!-- 表头工具栏 -->
           <template v-slot:action="{ row }">
             <el-link
-              style="margin-right: 20px"
               type="primary"
               @click="handelDetail(row)"
               >详情</el-link
             >
-            <el-switch
+            <!-- <el-switch
               :active-value="'1'"
               :inactive-value="'0'"
               @change="openBom(row, $event)"
               v-model="row.status"
             >
-            </el-switch>
+            </el-switch> -->
+            <el-link
+            v-if="row.status == 0"
+              type="primary"
+              @click="handSubmit(row)"
+              >发布</el-link
+            >
+
           </template>
         </ele-pro-table>
       </el-tabs>
@@ -43,7 +49,7 @@
 
 <script>
   import BOMSearch from './components/BOM-search.vue';
-  import { getBomPageList, startAndStop } from '@/api/material/BOM';
+  import { getBomPageList, startAndStop, bomSubmit } from '@/api/material/BOM';
 
   export default {
     name: 'SystemDictionary',
@@ -91,6 +97,13 @@
               return this.statusOpt[+row.status];
             }
           },
+          {
+            prop: 'approvalStatus',
+            label: '审核状态',
+            formatter: (row) => {
+              return this.approvalStatusOpt[+row.approvalStatus];
+            }
+          },
           {
             prop: 'createName',
             label: '创建人',
@@ -112,6 +125,13 @@
           0: '已停用',
           1: '已发布'
         },
+
+        approvalStatusOpt: {
+          0: '未提交',
+          1: '审核中',
+          2: '审核通过',
+          3: '审核不通过'
+        },
         loading: false,
         loadingInstance: null,
         where: {},
@@ -165,6 +185,20 @@
         });
         setTimeout(() => {}, 2000);
       },
+
+      handSubmit(row) {
+        this.$alert('确定要发布吗?', '提示', {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning'
+        }).then(() => {
+          bomSubmit({ businessId: row.id }).then((res) => {
+            this.$message.success('发布成功');
+            this.reload();
+          });
+        }).catch(() => {});
+       },
+
       /* 表格数据源 */
       datasource({ where, page, limit }) {
         return getBomPageList({