ysy před 1 rokem
rodič
revize
eb0c118a98

+ 38 - 0
src/api/bpm/components/bomApprover/index.js

@@ -1,5 +1,18 @@
 import request from '@/utils/request';
 
+
+// 供应商列表
+export async function contactList(params) {
+  const res = await request.get(`/eom/contact/page`, { params });
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+
+
+
 // 获取产品BOM列表
 export async function getBomPageCategoryId(params) {
   const res = await request.get(`/main/bomCategory/pageByCategoryId`, { params });
@@ -20,3 +33,28 @@ export async function notPass(data) {
   return Promise.reject(new Error(res.data.message));
 }
 
+
+
+
+
+// 嘉实医药不通过任务,关闭流程
+
+export async function jsBomNotPass(data) {
+  const res = await request.put(`/bpm/jsbom/notPass`, data);
+  if (res.data.code == 0) {
+    return res.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+// 嘉实设备不通过任务,关闭流程
+
+export async function deviceNotPass(data) {
+  const res = await request.put(`/bpm/jsbom/deviceNotPass`, data);
+  if (res.data.code == 0) {
+    return res.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+

+ 142 - 4
src/views/bpm/handleTask/components/bomApproverJSYY/detailDialog.vue

@@ -6,17 +6,100 @@
     <ele-pro-table
       ref="table"
       :columns="columns"
+      :need-page="false"
+      height="calc(80vh - 350px)"
       :datasource="datasource"
       class="dict-table"
       tool-class="ele-toolbar-actions"
     >
+      <template v-slot:toolbar>
+        <div v-if="taskDefinitionKey == 'Activity_0uypakw'">
+          <el-input
+            size="mini"
+            v-model="materielDesignationPL"
+            placeholder="请输入物料代号"
+            style="width: 220px"
+          ></el-input>
+          <el-button
+            size="mini"
+            type="primary"
+            style="margin-left: 20px"
+            @click="handMaterPL"
+            >批量</el-button
+          >
+        </div>
+
+        <div
+          v-if="
+            taskDefinitionKey == 'Activity_021lrxj' ||
+            taskDefinitionKey == 'Activity_1q7btlc'
+          "
+        >
+          <el-select
+            v-model="supplierIdPL"
+            size="mini"
+            clearable
+            style="width: 100%"
+            filterable
+            placeholder="请选择供应商"
+          >
+            <el-option
+              v-for="item in gysList"
+              :key="item.id"
+              :value="item.id"
+              :label="item.name"
+            ></el-option>
+          </el-select>
+          <el-button
+            size="mini"
+            type="primary"
+            style="margin-left: 20px"
+            @click="handMaterPL2"
+            >批量</el-button
+          >
+        </div>
+      </template>
+
+      <template v-slot:supplierName="{ row }">
+        <el-select
+          v-model="row.supplierId"
+          size="mini"
+          clearable
+          style="width: 100%"
+          filterable
+          placeholder="请选择供应商"
+          :disabled="
+            taskDefinitionKey != 'Activity_021lrxj' ||
+            taskDefinitionKey != 'Activity_1q7btlc'
+          "
+        >
+          <el-option
+            v-for="item in gysList"
+            :key="item.id"
+            :value="item.id"
+            :label="item.name"
+          ></el-option>
+        </el-select>
+      </template>
+
+      <template v-slot:materielDesignation="{ row }">
+        <el-input
+          size="mini"
+          v-model="row.materielDesignation"
+          placeholder="请输入物料代号"
+          :disabled="taskDefinitionKey != 'Activity_0uypakw'"
+        ></el-input>
+      </template>
     </ele-pro-table>
   </div>
 </template>
 
 <script>
   import BOMSearch from './BOM-search.vue';
-  import { getBomPageCategoryId } from '@/api/bpm/components/bomApprover';
+  import {
+    getBomPageCategoryId,
+    contactList
+  } from '@/api/bpm/components/bomApprover';
 
   export default {
     components: {
@@ -25,6 +108,10 @@
     props: {
       businessId: {
         default: ''
+      },
+
+      taskDefinitionKey: {
+        default: ''
       }
     },
     mixins: [],
@@ -33,6 +120,11 @@
       return {
         visible: false,
         title: '',
+        gysList: [],
+
+        materielDesignationPL: null,
+        supplierIdPL: null,
+
 
         columns: [
           {
@@ -78,6 +170,21 @@
             prop: 'versions',
             label: '版本'
           },
+
+          {
+            prop: 'materielDesignation',
+            slot: 'materielDesignation',
+            minWidth: 180,
+            label: '物料代号'
+          },
+
+          {
+            prop: 'supplierName',
+            slot: 'supplierName',
+            minWidth: 180,
+            label: '供应商'
+          },
+
           {
             prop: 'status ',
             label: '状态',
@@ -103,21 +210,52 @@
         }
       };
     },
-    created() {},
+    created() {
+      this.getContactList();
+    },
     methods: {
       /* 表格数据源 */
       datasource({ where, page, limit }) {
         return getBomPageCategoryId({
           ...where,
           pageNum: page,
-          size: limit,
-          id: this.businessId,
+          size: -1,
+          id: this.businessId
         });
       },
 
       /* 刷新表格 */
       reload(where) {
         this.$refs.table.reload({ where });
+      },
+
+      getContactList() {
+        let param = {
+          pageNum: 1,
+          type: 2,
+          size: -1,
+          status: 1
+        };
+        contactList(param).then((res) => {
+          this.gysList = res.list;
+        });
+      },
+
+      handMaterPL() {
+        let _arr = this.$refs.table.getData() || [];
+        _arr.forEach((f) => {
+          this.$set(f, 'materielDesignation', this.materielDesignationPL);
+        });
+        this.$refs.table.setData(_arr || []);
+      },
+
+      
+      handMaterPL2() {
+        let _arr = this.$refs.table.getData() || [];
+        _arr.forEach((f) => {
+          this.$set(f, 'supplierId', this.supplierIdPL);
+        });
+        this.$refs.table.setData(_arr || []);
       }
     }
   };

+ 3 - 4
src/views/bpm/handleTask/components/bomApproverJSYY/submit.vue

@@ -1,6 +1,5 @@
 <template>
-    <!--流程标识: bom_release   医药bom审批
-   -->
+    <!--流程标识: bom_release   医药bom审批-->
   <el-col :span="16" :offset="6">
     <el-form label-width="100px" ref="formRef" :model="form">
 
@@ -29,7 +28,7 @@
 <script>
 
 import { approveTaskWithVariables } from '@/api/bpm/task';
-import { notPass } from '@/api/bpm/components/bomApprover';
+import { jsBomNotPass } from '@/api/bpm/components/bomApprover';
 
 // 流程实例的详情页,可用于审批
 export default {
@@ -89,7 +88,7 @@ export default {
           }
         });
       } else if (status == 0) {
-        notPass({
+        jsBomNotPass({
           businessId: this.businessId,
           id: this.taskId,
           reason: this.form.reason,