ysy 1 tahun lalu
induk
melakukan
aa9b90b535

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

@@ -42,7 +42,7 @@
 <script>
   import { approveTaskWithVariables } from '@/api/bpm/task';
   import { jsBomNotPass, batchUpdate } from '@/api/bpm/components/bomApprover';
-import { update } from 'lodash';
+
 
   // 流程实例的详情页,可用于审批
   export default {

+ 147 - 5
src/views/bpm/handleTask/components/bomApproverJSdevice/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,10 @@
       return {
         visible: false,
         title: '',
+        gysList: [],
+
+        materielDesignationPL: null,
+        supplierIdPL: null,
 
         columns: [
           {
@@ -78,6 +169,21 @@
             prop: 'versions',
             label: '版本'
           },
+
+          {
+            prop: 'materielDesignation',
+            slot: 'materielDesignation',
+            minWidth: 180,
+            label: '物料代号'
+          },
+
+          {
+            prop: 'supplierName',
+            slot: 'supplierName',
+            minWidth: 180,
+            label: '供应商'
+          },
+
           {
             prop: 'status ',
             label: '状态',
@@ -103,22 +209,58 @@
         }
       };
     },
-    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 || []);
+      },
+
+      getTableValue() {
+        return this.$refs.table.getData() || [];
+      },
+
+
     }
   };
 </script>

+ 110 - 93
src/views/bpm/handleTask/components/bomApproverJSdevice/submit.vue

@@ -1,121 +1,138 @@
 <template>
-    <!--流程标识: bom_release_device  器械bom   -->
+  <!--流程标识: bom_release_device   器械bom-->
   <el-col :span="16" :offset="6">
     <el-form label-width="100px" ref="formRef" :model="form">
-
-      <el-form-item label="审批建议" prop="reason" style="margin-bottom: 20px" :rules="{
-        required: true,
-        message: '请选择',
-        trigger: 'change'
-      }">
-        <el-input type="textarea" v-model="form.reason" placeholder="请输入审批建议" />
+      <el-form-item
+        label="审批建议"
+        prop="reason"
+        style="margin-bottom: 20px"
+        :rules="{
+          required: true,
+          message: '请选择',
+          trigger: 'change'
+        }"
+      >
+        <el-input
+          type="textarea"
+          v-model="form.reason"
+          placeholder="请输入审批建议"
+        />
       </el-form-item>
     </el-form>
     <div style="margin-left: 10%; margin-bottom: 20px; font-size: 14px">
-      <el-button icon="el-icon-edit-outline" type="success" size="mini" @click="handleAudit(1)">通过
+      <el-button
+        icon="el-icon-edit-outline"
+        type="success"
+        size="mini"
+        @click="handleAudit(1)"
+        >通过
       </el-button>
 
-      <el-button icon="el-icon-circle-close" type="danger" size="mini" @click="handleAudit(0)">驳回
+      <el-button
+        icon="el-icon-circle-close"
+        type="danger"
+        size="mini"
+        @click="handleAudit(0)"
+        >驳回
       </el-button>
-
-
-
     </div>
-
   </el-col>
 </template>
 
 <script>
+  import { approveTaskWithVariables } from '@/api/bpm/task';
+  import { deviceNotPass, batchUpdate } from '@/api/bpm/components/bomApprover';
 
-import { approveTaskWithVariables } from '@/api/bpm/task';
-import { notPass } from '@/api/bpm/components/bomApprover';
-
-// 流程实例的详情页,可用于审批
-export default {
-  name: '',
-  components: {
-
-  },
-  props: {
-    businessId: {
-      default: ''
-    },
-    taskId: {
-      default: ''
-    },
-    id: {
-      default: ''
-    },
 
-    taskDefinitionKey: {
-      default: ''
-    }
-  },
-  data() {
-    return {
-      form: {
-        reason: ''
+  // 流程实例的详情页,可用于审批
+  export default {
+    name: '',
+    components: {},
+    props: {
+      businessId: {
+        default: ''
+      },
+      taskId: {
+        default: ''
+      },
+      id: {
+        default: ''
       },
 
-    };
-  },
-  created() {
-
-  },
-  methods: {
-
-
-    async handleAudit(status) {
-
-      this._approveTaskWithVariables(status);
+      taskDefinitionKey: {
+        default: ''
+      }
     },
-    async _approveTaskWithVariables(status) {
+    data() {
+      return {
+        form: {
+          reason: ''
+        }
+      };
+    },
+    created() {},
+    methods: {
+      async handleAudit(status) {
 
-      if (status == 1) {
 
-        approveTaskWithVariables({
-          businessId: this.businessId,
-          id: this.taskId,
-          reason: this.form.reason,
-          variables: { pass: true }
+        this._approveTaskWithVariables(status);
+      },
+      async _approveTaskWithVariables(status) {
+        if (status == 1) {
+          approveTaskWithVariables({
+            businessId: this.businessId,
+            id: this.taskId,
+            reason: this.form.reason,
+            variables: { pass: true }
+          }).then((res) => {
+            if (res.data.code != '-1') {
+    
+              this.updateDate()
+
+              this.$emit('handleAudit', {
+                status,
+                title: ''
+              });
+            }
+          });
+        } else if (status == 0) {
+          deviceNotPass({
+            businessId: this.businessId,
+            id: this.taskId,
+            reason: this.form.reason
+          }).then((res) => {
+            if (res.data.code != '-1') {
+              this.$emit('handleAudit', {
+                status,
+                title: '驳回'
+              });
+            }
+          });
+        }
+      },
 
-        }).then((res) => {
-          if (res.data.code != '-1') {
-            this.$emit('handleAudit', {
-              status,
-              title: ''
-            });
-          }
-        });
-      } else if (status == 0) {
-        notPass({
-          businessId: this.businessId,
-          id: this.taskId,
-          reason: this.form.reason,
-        }).then((res) => {
-          if (res.data.code != '-1') {
-            this.$emit('handleAudit', {
-              status,
-              title: '驳回'
-            });
-          }
+      async  updateDate() {
+        let LL = await this.getTableValue();
+        let _LL = LL.map((m) => {
+          return {
+            id: m.id,
+            supplierId: m.supplierId
+          };
         });
-      }
-
-    },
+        if (_LL.length > 0) {
+          batchUpdate(_LL).then(() => {});
+        }
+      },
 
-    getTableValue() {
-      return new Promise((resolve, reject) => {
-        this.$emit('getTableValue', async (data) => {
-          resolve(await data);
+      getTableValue() {
+        return new Promise((resolve, reject) => {
+          this.$emit('getTableValue', async (data) => {
+            resolve(await data);
+          });
         });
-      });
-    },
-
-
-
-  }
-};
+      }
+    }
+  };
 </script>
 
 <style lang="scss"></style>