huang_an há 1 ano atrás
pai
commit
090b789029

BIN
dist.rar


+ 29 - 23
src/views/bpm/handleTask/components/purchaseOrder/invoice/detailDialog.vue

@@ -64,17 +64,17 @@
               style="margin-bottom: 16px"
             >
               <fileMain v-model="form.receiveFiles" type="view"></fileMain>
-<!--              <div v-if="detailData.sendFiles && detailData.sendFiles?.length">-->
-<!--                <el-link-->
-<!--                  v-for="link in detailData.sendFiles"-->
-<!--                  :key="link.id"-->
-<!--                  type="primary"-->
-<!--                  :underline="false"-->
-<!--                  @click="downloadFile(link)"-->
-<!--                >-->
-<!--                  {{ link.name }}</el-link-->
-<!--                >-->
-<!--              </div>-->
+              <!--              <div v-if="detailData.sendFiles && detailData.sendFiles?.length">-->
+              <!--                <el-link-->
+              <!--                  v-for="link in detailData.sendFiles"-->
+              <!--                  :key="link.id"-->
+              <!--                  type="primary"-->
+              <!--                  :underline="false"-->
+              <!--                  @click="downloadFile(link)"-->
+              <!--                >-->
+              <!--                  {{ link.name }}</el-link-->
+              <!--                >-->
+              <!--              </div>-->
             </el-form-item>
           </el-col>
 
@@ -142,17 +142,17 @@
       </template> -->
         <template v-slot:technicalDrawings="{ row }">
           <fileMain v-model="row.receiveFiles" type="view"></fileMain>
-<!--          <div v-if="row.technicalDrawings && row.technicalDrawings?.length">-->
-<!--            <el-link-->
-<!--              v-for="link in row.technicalDrawings"-->
-<!--              :key="link.id"-->
-<!--              type="primary"-->
-<!--              :underline="false"-->
-<!--              @click="downloadFile(link)"-->
-<!--            >-->
-<!--              {{ link.name }}</el-link-->
-<!--            >-->
-<!--          </div>-->
+          <!--          <div v-if="row.technicalDrawings && row.technicalDrawings?.length">-->
+          <!--            <el-link-->
+          <!--              v-for="link in row.technicalDrawings"-->
+          <!--              :key="link.id"-->
+          <!--              type="primary"-->
+          <!--              :underline="false"-->
+          <!--              @click="downloadFile(link)"-->
+          <!--            >-->
+          <!--              {{ link.name }}</el-link-->
+          <!--            >-->
+          <!--          </div>-->
         </template>
       </ele-pro-table>
     </div>
@@ -189,6 +189,7 @@
         :sourceBizNo="form.receiveNo"
         :saleProductList="form.productList"
         :bizType="2"
+        :detailProductList="detailData.productList"
       ></add>
     </keep-alive>
     <detailDialog
@@ -221,7 +222,7 @@
   import add from '@/views/bpm/stockManagement/storage.vue';
   // import { getOutInBySourceBizNoOrError } from '@/api/classifyManage';
   import storageApi from '@/api/warehouseManagement';
-  import fileMain from "@/components/addDoc/index.vue";
+  import fileMain from '@/components/addDoc/index.vue';
 
   export default {
     props: {
@@ -537,6 +538,7 @@
 
     methods: {
       changeActive(item) {
+        console.log(item, '切换!!!!!!!!!!!!!!!!!!!!');
         this.activeComp = item.key;
         this.$emit('activeCompChange', item.key);
         // if (
@@ -592,6 +594,10 @@
         if (data) {
           this.form = data;
           this.detailData = data;
+          console.log(
+            this.detailData,
+            'this.detailDatathis.detailDatathis.detailDatathis.detailData'
+          );
         }
       }
     }

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

@@ -130,7 +130,7 @@
     getReceiveSaleOrderrecordDetail,
     cancel
   } from '@/api/bpm/components/purchasingManage/purchaseorderreceive';
-  import {approveTaskWithVariables, rejectTask} from '@/api/bpm/task';
+  import { approveTaskWithVariables, rejectTask } from '@/api/bpm/task';
   import { getWarehouseListByIds } from '@/api/bpm/components/saleManage/saleorder';
   import {
     getOutInBySourceBizNo,

+ 11 - 2
src/views/bpm/handleTask/components/selectedCollectionOutbound/boxTabPage.vue

@@ -51,7 +51,9 @@
       return {
         form: {},
         activeName: 'tab1',
-        cKey: 1
+        cKey: 1,
+        extractedList: [],
+        wwType: ''
       };
     },
     computed: {
@@ -83,7 +85,9 @@
               bizType: 11,
               sourceBizNo: this.form.code,
               detailList: this.form.detailList,
-              type: '自选领用出库'
+              type: '自选领用出库',
+              wwType: this.wwType,
+              extractedList: this.extractedList
             };
         }
       }
@@ -120,6 +124,11 @@
             item.code = data.code;
             return item;
           });
+          this.wwType = data.type;
+          this.extractedList = data.detailList.map((item) => ({
+            taskId: item.taskId,
+            workOrderId: item.workOrderId
+          }));
           let categoryLevelTopIds = data.detailList.map(
             (item) => item.rootCategoryLevelId
           );

+ 457 - 457
src/views/bpm/handleTask/index.vue

@@ -12,7 +12,7 @@
       <el-card class="box-card" v-loading="processInstanceLoading">
         <div slot="header" class="clearfix">
           <span class="el-icon-document"
-          >申请信息【{{ processInstance.name }}】 申请人:【{{
+            >申请信息【{{ processInstance.name }}】 申请人:【{{
               processInstance.startUser?.nickname
             }}】</span
           >
@@ -33,7 +33,7 @@
       <div style="display: flex">
         <!-- 审批信息 -->
         <el-card
-          style="min-width: 500px;"
+          style="min-width: 500px"
           class="box-card"
           v-loading="processInstanceLoading"
           v-for="(item, index) in runningTasks"
@@ -57,9 +57,7 @@
               ref="subForm"
             ></async-sub-form-component>
           </div>
-          <div>
-
-          </div>
+          <div> </div>
           <!-- <el-col :span="16" :offset="6">
             <el-form
               :ref="'form' + index"
@@ -120,11 +118,15 @@
           </el-col> -->
         </el-card>
         <!-- 审批记录 -->
-        <el-card class="box-card" style="flex: 1;min-width: 540px;margin-top: 0;margin-left: 10px"  v-loading="processInstanceLoading">
+        <el-card
+          class="box-card"
+          style="flex: 1; min-width: 540px; margin-top: 0; margin-left: 10px"
+          v-loading="processInstanceLoading"
+        >
           <div slot="header" class="clearfix">
             <span class="el-icon-picture-outline">审批记录</span>
           </div>
-          <div style="overflow-y:auto;height: 120px ">
+          <div style="overflow-y: auto; height: 120px">
             <el-timeline>
               <el-timeline-item
                 v-for="(item, index) in tasks"
@@ -132,38 +134,45 @@
                 :icon="getTimelineItemIcon(item)"
                 :type="getTimelineItemType(item)"
               >
-                <p style="font-weight: 500;margin-top: 5px">任务:{{ item.name }}</p>
+                <p style="font-weight: 500; margin-top: 5px"
+                  >任务:{{ item.name }}</p
+                >
                 <label
                   v-if="item.assigneeUser"
-                  style="font-weight: normal; margin-right: 30px">
-                  {{index==0?' 审批人':'发起人' }}:{{ item.assigneeUser.nickname }}
+                  style="font-weight: normal; margin-right: 30px"
+                >
+                  {{ index == 0 ? ' 审批人' : '发起人' }}:{{
+                    item.assigneeUser.nickname
+                  }}
                   <el-tag type="info" size="mini">{{
-                      item.assigneeUser.deptName
-                    }}</el-tag>
+                    item.assigneeUser.deptName
+                  }}</el-tag>
                 </label>
                 <label
                   v-if="item.endTime"
                   style="margin-left: 10px; font-weight: normal"
-                >审批时间:</label>
+                  >审批时间:</label
+                >
                 <label
                   v-if="item.endTime"
-                  style="color: #8a909c; font-weight: normal">
-                  {{ item.endTime }}</label>
+                  style="color: #8a909c; font-weight: normal"
+                >
+                  {{ item.endTime }}</label
+                >
                 <div>
+                  <label v-if="item.reason" style="font-weight: normal"
+                    >审批意见:</label
+                  >
                   <label
                     v-if="item.reason"
-                    style="font-weight: normal"
-                  >审批意见:</label>
-                  <label
-                    v-if="item.reason"
-                    style="color: #8a909c; font-weight: normal">
-                    {{ item.reason }}</label>
+                    style="color: #8a909c; font-weight: normal"
+                  >
+                    {{ item.reason }}</label
+                  >
                 </div>
-
               </el-timeline-item>
             </el-timeline>
           </div>
-
         </el-card>
       </div>
 
@@ -198,7 +207,7 @@
         </el-form>
         <div slot="footer" class="dialog-footer">
           <el-button type="primary" @click="submitUpdateAssigneeForm"
-          >确 定
+            >确 定
           </el-button>
           <el-button @click="cancelUpdateAssigneeForm">取 消</el-button>
         </div>
@@ -241,7 +250,7 @@
         </el-form>
         <div slot="footer" class="dialog-footer">
           <el-button type="primary" @click="submitUpdateDelegateForm"
-          >确 定
+            >确 定
           </el-button>
           <el-button @click="cancelUpdateDelegateForm">取 消</el-button>
         </div>
@@ -288,7 +297,7 @@
             :disabled="formLoading"
             type="primary"
             @click="submitReturn"
-          >确 定</el-button
+            >确 定</el-button
           >
         </span>
       </el-dialog>
@@ -297,474 +306,465 @@
 </template>
 
 <script>
-// import { getProcessDefinitionBpmnXML } from '@/api/bpm/definition';
-import store from '@/store';
-//   import {decodeFields} from "@/utils/formGenerator";
-//   import Parser from '@/components/parser/Parser'
-import {getProcessInstance} from '@/api/bpm/processInstance';
-import {listAllUserBind} from '@/api/system/organization';
-import Vue from 'vue';
-
-import {
-  delegateTask,
-  getReturnList,
-  getTaskListByProcessInstanceId,
-  returnTask,
-  updateTaskAssignee
-} from '@/api/bpm/task';
-import {getProcessDefinitionBpmnXML} from "@/api/bpm/definition";
-import {getActivityList} from "@/api/bpm/activity";
-// import { getDate } from '@/utils/dateUtils';
-
-// 流程实例的详情页,可用于审批
-export default {
-  name: 'ProcessInstanceDetail',
-  components: {
-    //   Parser
-  },
-  data() {
-    return {
-      // 遮罩层
-      processInstanceLoading: true,
-      dialogVisible: false,
-      // 流程实例
-      listData: {
-        id: undefined, // 流程实例的编号
-        pcHandleRouter: '',
-        pcViewRouter: '',
-        businessId: '', // 业务id
-        taskDefinitionKey: '',
-        taskId: '' //任务编码
-      },
-
-      processInstance: {},
-      formLoading: false,
-      // 流程表单详情
-      detailForm: {
-        fields: []
-      },
-      //回退列表数据
-      returnList: [],
-      formData: {
-        id: '',
-        targetDefinitionKey: undefined,
-        reason: ''
-      },
-      formRules: {
-        targetDefinitionKey: [
-          {required: true, message: '必须选择回退节点', trigger: 'change'}
-        ],
-        reason: [
-          {required: true, message: '回退理由不能为空', trigger: 'blur'}
-        ]
-      },
-      returnOpen: false,
-      activityList: [],
-
-      tasks: [],
+  // import { getProcessDefinitionBpmnXML } from '@/api/bpm/definition';
+  import store from '@/store';
+  //   import {decodeFields} from "@/utils/formGenerator";
+  //   import Parser from '@/components/parser/Parser'
+  import { getProcessInstance } from '@/api/bpm/processInstance';
+  import { listAllUserBind } from '@/api/system/organization';
+  import Vue from 'vue';
+
+  import {
+    delegateTask,
+    getReturnList,
+    getTaskListByProcessInstanceId,
+    returnTask,
+    updateTaskAssignee
+  } from '@/api/bpm/task';
+  import { getProcessDefinitionBpmnXML } from '@/api/bpm/definition';
+  import { getActivityList } from '@/api/bpm/activity';
+  // import { getDate } from '@/utils/dateUtils';
+
+  // 流程实例的详情页,可用于审批
+  export default {
+    name: 'ProcessInstanceDetail',
+    components: {
+      //   Parser
+    },
+    data() {
+      return {
+        // 遮罩层
+        processInstanceLoading: true,
+        dialogVisible: false,
+        // 流程实例
+        listData: {
+          id: undefined, // 流程实例的编号
+          pcHandleRouter: '',
+          pcViewRouter: '',
+          businessId: '', // 业务id
+          taskDefinitionKey: '',
+          taskId: '' //任务编码
+        },
 
-      // 审批表单
-      runningTasks: [],
-      auditForms: [],
-      auditRule: {
-        reason: [
-          {required: true, message: '审批建议不能为空', trigger: 'blur'}
-        ]
-      },
-      // 转派审批人
-      userOptions: [],
-      updateAssignee: {
-        open: false,
-        form: {
-          assigneeUserId: undefined
+        processInstance: {},
+        formLoading: false,
+        // 流程表单详情
+        detailForm: {
+          fields: []
         },
-        rules: {
-          assigneeUserId: [
-            {required: true, message: '新审批人不能为空', trigger: 'change'}
-          ]
-        }
-      },
-      updateDelegate: {
-        open: false,
-        form: {
-          delegateUserId: undefined,
+        //回退列表数据
+        returnList: [],
+        formData: {
+          id: '',
+          targetDefinitionKey: undefined,
           reason: ''
         },
-        rules: {
-          delegateUserId: [
-            {required: true, message: '新审批人不能为空', trigger: 'change'}
+        formRules: {
+          targetDefinitionKey: [
+            { required: true, message: '必须选择回退节点', trigger: 'change' }
           ],
           reason: [
-            {required: true, message: '委派理由不能为空', trigger: 'blur'}
+            { required: true, message: '回退理由不能为空', trigger: 'blur' }
           ]
-        }
-      }
-    };
-  },
-  created() {
-    //   this.id = this.$route.query.id;
-    //   if (!this.id) {
-    //     this.$message.error('未传递 id 参数,无法查看流程信息');
-    //     return;
-    //   }
-    //   this.getDetail();
+        },
+        returnOpen: false,
+        activityList: [],
 
-    // 获得用户列表
-    this.userOptions = [];
-    listAllUserBind().then((data) => {
-      this.userOptions.push(...data);
-    });
-  },
-  methods: {
-    submit(data) {
-      this.$refs.bziRef.save(data);
-    },
-    open(data) {
-      this.listData = data;
-      console.log('实例流程~~~~~~', data);
-      this.dialogVisible = true;
-      this.getDetail();
-      this.getTasksRecordDetail();
-    },
+        tasks: [],
 
-    activeCompChange(activeComp) {
-      this.$refs.subForm[0].activeCompChange(activeComp);
-    },
-    /** 获得流程实例 */
-    getDetail() {
-      // 获得流程实例相关
-      this.processInstanceLoading = true;
-      getProcessInstance(this.listData.id).then((response) => {
-        if (!response) {
-          this.$message.error('查询不到流程信息!');
-          return;
+        // 审批表单
+        runningTasks: [],
+        auditForms: [],
+        auditRule: {
+          reason: [
+            { required: true, message: '审批建议不能为空', trigger: 'blur' }
+          ]
+        },
+        // 转派审批人
+        userOptions: [],
+        updateAssignee: {
+          open: false,
+          form: {
+            assigneeUserId: undefined
+          },
+          rules: {
+            assigneeUserId: [
+              { required: true, message: '新审批人不能为空', trigger: 'change' }
+            ]
+          }
+        },
+        updateDelegate: {
+          open: false,
+          form: {
+            delegateUserId: undefined,
+            reason: ''
+          },
+          rules: {
+            delegateUserId: [
+              { required: true, message: '新审批人不能为空', trigger: 'change' }
+            ],
+            reason: [
+              { required: true, message: '委派理由不能为空', trigger: 'blur' }
+            ]
+          }
         }
-        // 设置流程信息
-        console.log('==', response);
-        console.log('==', this.listData);
-        this.processInstance = response;
-        // //将业务表单,注册为动态组件
-        // let formCustomCreatePath = JSON.parse(
-        //   this.processInstance.processDefinition.formCustomCreatePath
-        // );
-        // const bizpath = formCustomCreatePath.pcView;
-        // const subpath = formCustomCreatePath.pcHandle;
-        Vue.component('async-biz-form-component', (resolve) => {
-          require([`@/views${this.listData.pcViewRouter}`], resolve);
-        });
-        Vue.component('async-sub-form-component', (resolve) => {
-          require([`@/views${this.listData.pcHandleRouter}`], resolve);
-        });
-        //   // 设置表单信息
-        //   if (this.processInstance.processDefinition.formType === 10) {
-        //     this.detailForm = {
-        //       ...JSON.parse(this.processInstance.processDefinition.formConf),
-        //       disabled: true, // 表单禁用
-        //       formBtns: false, // 按钮隐藏
-        //       fields: decodeFields(this.processInstance.processDefinition.formFields)
-        //     }
-        //     // 设置表单的值
-        //     this.detailForm.fields.forEach(item => {
-        //       const val = this.processInstance.formVariables[item.__vModel__]
-        //       if (val) {
-        //         item.__config__.defaultValue = val
-        //       }
-        //     });
-        //   }
+      };
+    },
+    created() {
+      //   this.id = this.$route.query.id;
+      //   if (!this.id) {
+      //     this.$message.error('未传递 id 参数,无法查看流程信息');
+      //     return;
+      //   }
+      //   this.getDetail();
 
-        // 取消加载中
-        this.processInstanceLoading = false;
+      // 获得用户列表
+      this.userOptions = [];
+      listAllUserBind().then((data) => {
+        this.userOptions.push(...data);
       });
+    },
+    methods: {
+      submit(data) {
+        this.$refs.bziRef.save(data);
+      },
+      open(data) {
+        this.listData = data;
+        console.log('实例流程~~~~~~', data);
+        this.dialogVisible = true;
+        this.getDetail();
+        // this.getTasksRecordDetail();
+      },
 
-      this.runningTasks = [];
-      this.auditForms = [];
-      getTaskListByProcessInstanceId(this.listData.id).then((response) => {
-        console.log(response, 'response');
-        // 审批记录
-        this.tasks = [];
-        // 移除已取消的审批
-        response.forEach((task) => {
-          if (task.result !== 4) {
-            this.tasks.push(task);
-          }
-        });
-        // 排序,将未完成的排在前面,已完成的排在后面;
-        this.tasks.sort((a, b) => {
-          // 有已完成的情况,按照完成时间倒序
-          if (a.endTime && b.endTime) {
-            return b.endTime - a.endTime;
-          } else if (a.endTime) {
-            return 1;
-          } else if (b.endTime) {
-            return -1;
-            // 都是未完成,按照创建时间倒序
-          } else {
-            return b.createTime - a.createTime;
+      activeCompChange(activeComp) {
+        this.$refs.subForm[0].activeCompChange(activeComp);
+      },
+      /** 获得流程实例 */
+      getDetail() {
+        // 获得流程实例相关
+        this.processInstanceLoading = true;
+        getProcessInstance(this.listData.id).then((response) => {
+          if (!response) {
+            this.$message.error('查询不到流程信息!');
+            return;
           }
+          // 设置流程信息
+          console.log('==', response);
+          console.log('==', this.listData);
+          this.processInstance = response;
+          // //将业务表单,注册为动态组件
+          // let formCustomCreatePath = JSON.parse(
+          //   this.processInstance.processDefinition.formCustomCreatePath
+          // );
+          // const bizpath = formCustomCreatePath.pcView;
+          // const subpath = formCustomCreatePath.pcHandle;
+          Vue.component('async-biz-form-component', (resolve) => {
+            require([`@/views${this.listData.pcViewRouter}`], resolve);
+          });
+          Vue.component('async-sub-form-component', (resolve) => {
+            require([`@/views${this.listData.pcHandleRouter}`], resolve);
+          });
+          //   // 设置表单信息
+          //   if (this.processInstance.processDefinition.formType === 10) {
+          //     this.detailForm = {
+          //       ...JSON.parse(this.processInstance.processDefinition.formConf),
+          //       disabled: true, // 表单禁用
+          //       formBtns: false, // 按钮隐藏
+          //       fields: decodeFields(this.processInstance.processDefinition.formFields)
+          //     }
+          //     // 设置表单的值
+          //     this.detailForm.fields.forEach(item => {
+          //       const val = this.processInstance.formVariables[item.__vModel__]
+          //       if (val) {
+          //         item.__config__.defaultValue = val
+          //       }
+          //     });
+          //   }
+
+          // 取消加载中
+          this.processInstanceLoading = false;
         });
 
-        // 需要审核的记录
-        const userId = store.getters.user.info.userId;
-        if (this.tasks.some(item => item.result == 7)) {
-          let taskItem = this.tasks.find((item) => item.result == 7)
-          const stack = [];
-          let task = []
-          stack.push(taskItem.children);
-          while (stack.length > 0) {
-            const node = stack.pop();
-            console.log(node,'-----');
-            node.forEach(n => {
-              if (n.children?.length === 0) {
-                task.push(n)
-              } else {
-                task = []
-                stack.push(n.children);
-              }
-            })
-          }
-
-          task.forEach((task) => {
-            if (task.result !== 1 && task.result !== 6) {
-              // 只有待处理才需要
-              return;
-            }
-
-            if (!task.assigneeUser || task.assigneeUser.id !== userId) {
-              // 自己不是处理人
-              return;
+        this.runningTasks = [];
+        this.auditForms = [];
+        getTaskListByProcessInstanceId(this.listData.id).then((response) => {
+          console.log(response, 'response');
+          // 审批记录
+          this.tasks = [];
+          // 移除已取消的审批
+          response.forEach((task) => {
+            if (task.result !== 4) {
+              this.tasks.push(task);
             }
-            if (task.taskDefinitionKey !== this.listData.taskDefinitionKey) {
-              // 不是当前流程的
-              return;
+          });
+          // 排序,将未完成的排在前面,已完成的排在后面;
+          this.tasks.sort((a, b) => {
+            // 有已完成的情况,按照完成时间倒序
+            if (a.endTime && b.endTime) {
+              return b.endTime - a.endTime;
+            } else if (a.endTime) {
+              return 1;
+            } else if (b.endTime) {
+              return -1;
+              // 都是未完成,按照创建时间倒序
+            } else {
+              return b.createTime - a.createTime;
             }
-            this.runningTasks.push({...task});
-            this.auditForms.push({
-              reason: ''
-            });
-
           });
 
-
-        } else {
-          this.tasks.forEach((task) => {
-
-
-            if (task.result !== 1 && task.result !== 6) {
-              // 只有待处理才需要
-              return;
+          // 需要审核的记录
+          const userId = store.getters.user.info.userId;
+          if (this.tasks.some((item) => item.result == 7)) {
+            let taskItem = this.tasks.find((item) => item.result == 7);
+            const stack = [];
+            let task = [];
+            stack.push(taskItem.children);
+            while (stack.length > 0) {
+              const node = stack.pop();
+              console.log(node, '-----');
+              node.forEach((n) => {
+                if (n.children?.length === 0) {
+                  task.push(n);
+                } else {
+                  task = [];
+                  stack.push(n.children);
+                }
+              });
             }
 
-            if (!task.assigneeUser || task.assigneeUser.id !== userId) {
-              // 自己不是处理人
-              return;
-            }
-            if (task.taskDefinitionKey !== this.listData.taskDefinitionKey) {
-              // 不是当前流程的
-              return;
-            }
-            this.runningTasks.push({...task});
-            this.auditForms.push({
-              reason: ''
+            task.forEach((task) => {
+              if (task.result !== 1 && task.result !== 6) {
+                // 只有待处理才需要
+                return;
+              }
+
+              if (!task.assigneeUser || task.assigneeUser.id !== userId) {
+                // 自己不是处理人
+                return;
+              }
+              if (task.taskDefinitionKey !== this.listData.taskDefinitionKey) {
+                // 不是当前流程的
+                return;
+              }
+              this.runningTasks.push({ ...task });
+              this.auditForms.push({
+                reason: ''
+              });
             });
+          } else {
+            this.tasks.forEach((task) => {
+              if (task.result !== 1 && task.result !== 6) {
+                // 只有待处理才需要
+                return;
+              }
 
-          });
+              if (!task.assigneeUser || task.assigneeUser.id !== userId) {
+                // 自己不是处理人
+                return;
+              }
+              if (task.taskDefinitionKey !== this.listData.taskDefinitionKey) {
+                // 不是当前流程的
+                return;
+              }
+              this.runningTasks.push({ ...task });
+              this.auditForms.push({
+                reason: ''
+              });
+            });
+          }
+        });
+      },
+      getTimelineItemIcon(item) {
+        if (item.result === 1) {
+          return 'el-icon-time';
         }
-
-
-      });
-    },
-    getTimelineItemIcon(item) {
-      if (item.result === 1) {
-        return 'el-icon-time';
-      }
-      if (item.result === 2) {
-        return 'el-icon-check';
-      }
-      if (item.result === 3) {
-        return 'el-icon-close';
-      }
-      if (item.result === 4) {
-        return 'el-icon-remove-outline';
-      }
-      if (item.result === 5) {
-        return 'el-icon-back';
-      }
-      return '';
-    },
-    getTimelineItemType(item) {
-      if (item.result === 1) {
-        return 'primary';
-      }
-      if (item.result === 2) {
-        return 'success';
-      }
-      if (item.result === 3) {
-        return 'danger';
-      }
-      if (item.result === 4) {
-        return 'info';
-      }
-      if (item.result === 5) {
-        return 'warning';
-      }
-      if (item.result === 6) {
-        return 'default';
-      }
-      return '';
-    },
-    /** 处理审批通过和不通过的操作 */
-    handleAudit(data) {
-      let text = data.status === 1 ? '通过' : '不通过';
-      this.$message.success(`审批${data.title || text}成功!`);
-      this.handleClose(); // 获得最新详情
-
-      // const index = this.runningTasks.indexOf(task);
-      // this.$refs['form' + index][0].validate((valid) => {
-      //   if (!valid) {
-      //     return;
-      //   }
-      //   const data = {
-      //     id: task.id,
-      //     reason: this.auditForms[index].reason
-      //   };
-      //   if (pass) {
-      //     approveTask(data).then((response) => {
-      //       this.$message.success('审批通过成功!');
-      //       this.handleClose(); // 获得最新详情
-      //     });
-      //   } else {
-      //     rejectTask(data).then((response) => {
-      //       this.$message.success('审批不通过成功!');
-      //       this.handleClose(); // 获得最新详情
-      //     });
-      //   }
-      // });
-    },
-    /** 处理转办审批人 */
-    handleUpdateAssignee(task) {
-
-      // 设置表单
-      this.resetUpdateAssigneeForm();
-      this.updateAssignee.form.id = task.id;
-      // 设置为打开
-      this.updateAssignee.open = true;
-    },
-    /** 提交转办审批人 */
-    submitUpdateAssigneeForm() {
-      this.$refs['updateAssigneeForm'].validate((valid) => {
-        if (!valid) {
-          return;
+        if (item.result === 2) {
+          return 'el-icon-check';
         }
-        if (this.$refs.subForm[0].formUpdate) {
-          this.$refs.subForm[0].formUpdate();
+        if (item.result === 3) {
+          return 'el-icon-close';
         }
-        updateTaskAssignee(this.updateAssignee.form).then((response) => {
-          this.$message.success('转办任务成功!');
-
-          this.updateAssignee.open = false;
-          this.handleClose(); // 获得最新详情
-        });
-      });
-    },
-    /** 取消转办审批人 */
-    cancelUpdateAssigneeForm() {
-      this.updateAssignee.open = false;
-      this.resetUpdateAssigneeForm();
-    },
-    /** 重置转办审批人 */
-    resetUpdateAssigneeForm() {
-      this.updateAssignee.form = {
-        id: undefined,
-        assigneeUserId: undefined
-      };
-      this.resetForm('updateAssigneeForm');
-    },
-    /** 处理审批委派的操作 */
-    handleDelegate(task) {
-      //this.$modal.msgError("暂不支持【委派】功能,可以使用【转派】替代!");
-      this.resetUpdateDelegateForm();
-      this.updateDelegate.form.id = task.id;
-      // 设置为打开
-      this.updateDelegate.open = true;
-    },
-    /** 提交委派审批人 */
-    submitUpdateDelegateForm() {
-      this.$refs['updateDelegateForm'].validate((valid) => {
-        if (!valid) {
-          return;
+        if (item.result === 4) {
+          return 'el-icon-remove-outline';
         }
-        delegateTask(this.updateDelegate.form).then((response) => {
-          this.$message.success('委派任务成功!');
-          this.updateDelegate.open = false;
-          this.handleClose(); // 获得最新详情
-        });
-      });
-    },
-    /** 取消委派审批人 */
-    cancelUpdateDelegateForm() {
-      this.updateDelegate.open = false;
-      this.resetUpdateDelegateForm();
-    },
-    /** 重置委派审批人 */
-    resetUpdateDelegateForm() {
-      this.updateDelegate.form = {
-        id: undefined,
-        delegateUserId: undefined
-      };
-      this.resetForm('updateDelegateForm');
-    },
-    /** 处理审批退回的操作 */
-    /** 返回退回节点列表 */
-    handleBackList(task) {
-      // 可参考 http://blog.wya1.com/article/636697030/details/7296
-      getReturnList(task.id).then((response) => {
-        this.returnList = response.data.data;
-        if (this.returnList.length == 0) {
-          this.$message.error('当前没有可回退的节点!');
-
-          return;
+        if (item.result === 5) {
+          return 'el-icon-back';
         }
-        this.formData.id = task.id;
-        this.returnOpen = true;
-      });
-    },
-    /** 提交退回任务 */
-    submitReturn() {
-      if (!this.formData.targetDefinitionKey) {
-        this.$message.error('请选择退回节点!');
-      }
-      this.$refs['formRef'].validate((valid) => {
-        if (!valid) {
-          return;
+        return '';
+      },
+      getTimelineItemType(item) {
+        if (item.result === 1) {
+          return 'primary';
+        }
+        if (item.result === 2) {
+          return 'success';
+        }
+        if (item.result === 3) {
+          return 'danger';
+        }
+        if (item.result === 4) {
+          return 'info';
         }
-        returnTask(this.formData).then((res) => {
-          if (res.data) {
-            this.$message.success('回退成功!');
+        if (item.result === 5) {
+          return 'warning';
+        }
+        if (item.result === 6) {
+          return 'default';
+        }
+        return '';
+      },
+      /** 处理审批通过和不通过的操作 */
+      handleAudit(data) {
+        let text = data.status === 1 ? '通过' : '不通过';
+        this.$message.success(`审批${data.title || text}成功!`);
+        this.handleClose(); // 获得最新详情
+
+        // const index = this.runningTasks.indexOf(task);
+        // this.$refs['form' + index][0].validate((valid) => {
+        //   if (!valid) {
+        //     return;
+        //   }
+        //   const data = {
+        //     id: task.id,
+        //     reason: this.auditForms[index].reason
+        //   };
+        //   if (pass) {
+        //     approveTask(data).then((response) => {
+        //       this.$message.success('审批通过成功!');
+        //       this.handleClose(); // 获得最新详情
+        //     });
+        //   } else {
+        //     rejectTask(data).then((response) => {
+        //       this.$message.success('审批不通过成功!');
+        //       this.handleClose(); // 获得最新详情
+        //     });
+        //   }
+        // });
+      },
+      /** 处理转办审批人 */
+      handleUpdateAssignee(task) {
+        // 设置表单
+        this.resetUpdateAssigneeForm();
+        this.updateAssignee.form.id = task.id;
+        // 设置为打开
+        this.updateAssignee.open = true;
+      },
+      /** 提交转办审批人 */
+      submitUpdateAssigneeForm() {
+        this.$refs['updateAssigneeForm'].validate((valid) => {
+          if (!valid) {
+            return;
+          }
+          if (this.$refs.subForm[0].formUpdate) {
+            this.$refs.subForm[0].formUpdate();
+          }
+          updateTaskAssignee(this.updateAssignee.form).then((response) => {
+            this.$message.success('转办任务成功!');
 
-            this.returnOpen = false;
+            this.updateAssignee.open = false;
             this.handleClose(); // 获得最新详情
+          });
+        });
+      },
+      /** 取消转办审批人 */
+      cancelUpdateAssigneeForm() {
+        this.updateAssignee.open = false;
+        this.resetUpdateAssigneeForm();
+      },
+      /** 重置转办审批人 */
+      resetUpdateAssigneeForm() {
+        this.updateAssignee.form = {
+          id: undefined,
+          assigneeUserId: undefined
+        };
+        this.resetForm('updateAssigneeForm');
+      },
+      /** 处理审批委派的操作 */
+      handleDelegate(task) {
+        //this.$modal.msgError("暂不支持【委派】功能,可以使用【转派】替代!");
+        this.resetUpdateDelegateForm();
+        this.updateDelegate.form.id = task.id;
+        // 设置为打开
+        this.updateDelegate.open = true;
+      },
+      /** 提交委派审批人 */
+      submitUpdateDelegateForm() {
+        this.$refs['updateDelegateForm'].validate((valid) => {
+          if (!valid) {
+            return;
           }
+          delegateTask(this.updateDelegate.form).then((response) => {
+            this.$message.success('委派任务成功!');
+            this.updateDelegate.open = false;
+            this.handleClose(); // 获得最新详情
+          });
         });
-      });
-    },
-    handleClose() {
-      this.$emit('reload');
-      this.dialogVisible = false;
-    },
-    getTableValue(fn) {
-      fn(this.$refs.bziRef.getTableValue());
+      },
+      /** 取消委派审批人 */
+      cancelUpdateDelegateForm() {
+        this.updateDelegate.open = false;
+        this.resetUpdateDelegateForm();
+      },
+      /** 重置委派审批人 */
+      resetUpdateDelegateForm() {
+        this.updateDelegate.form = {
+          id: undefined,
+          delegateUserId: undefined
+        };
+        this.resetForm('updateDelegateForm');
+      },
+      /** 处理审批退回的操作 */
+      /** 返回退回节点列表 */
+      handleBackList(task) {
+        // 可参考 http://blog.wya1.com/article/636697030/details/7296
+        getReturnList(task.id).then((response) => {
+          this.returnList = response.data.data;
+          if (this.returnList.length == 0) {
+            this.$message.error('当前没有可回退的节点!');
+
+            return;
+          }
+          this.formData.id = task.id;
+          this.returnOpen = true;
+        });
+      },
+      /** 提交退回任务 */
+      submitReturn() {
+        if (!this.formData.targetDefinitionKey) {
+          this.$message.error('请选择退回节点!');
+        }
+        this.$refs['formRef'].validate((valid) => {
+          if (!valid) {
+            return;
+          }
+          returnTask(this.formData).then((res) => {
+            if (res.data) {
+              this.$message.success('回退成功!');
+
+              this.returnOpen = false;
+              this.handleClose(); // 获得最新详情
+            }
+          });
+        });
+      },
+      handleClose() {
+        this.$emit('reload');
+        this.dialogVisible = false;
+      },
+      getTableValue(fn) {
+        fn(this.$refs.bziRef.getTableValue());
+      }
     }
-  }
-};
+  };
 </script>
 
 <style lang="scss">
-.my-process-designer {
-  height: calc(100vh - 200px);
-}
+  .my-process-designer {
+    height: calc(100vh - 200px);
+  }
 
-.box-card {
-  width: 100%;
-  margin-bottom: 20px;
-}
+  .box-card {
+    width: 100%;
+    margin-bottom: 20px;
+  }
 </style>

+ 71 - 41
src/views/bpm/outgoingManagement/outbound.vue

@@ -222,10 +222,21 @@
                 :show-overflow-tooltip="true"
               >
               </el-table-column>
+              <!-- <el-table-column
+                label="最小包装单元"
+                align="center"
+                width="120"
+                prop="minPackingQuantity"
+              >
+                <template slot-scope="{ row, $index }">
+                  {{ row.minPackingQuantity }} {{ row.measureUnit }} /{{
+                    row.packingUnit
+                  }}
+                </template>
+              </el-table-column>
 
               <el-table-column
                 label="包装数量"
-                v-if="clientEnvironmentId == 3"
                 prop="packingQuantity"
                 align="center"
               >
@@ -234,26 +245,29 @@
                 </template>
               </el-table-column>
               <el-table-column
-                v-else
-                label="包装数量"
-                prop="packingQuantity"
-                width="80"
-              ></el-table-column>
+                label="计量数量"
+                prop="measureQuantity"
+                width="100"
+                align="center"
+              >
+              </el-table-column>
               <el-table-column
-                v-if="clientEnvironmentId == 3"
-                label="最小包装单元"
+                label="计量单位"
+                prop="measureUnit"
                 align="center"
-                width="120"
-                prop="minPackingQuantity"
               >
                 <template slot-scope="{ row, $index }">
-                  {{ row.minPackingQuantity }} {{ row.measureUnit }} /{{
-                    row.packingUnit
-                  }}
+                  <template>
+                    {{ row.measureUnit }}
+                  </template>
                 </template>
-              </el-table-column>
+              </el-table-column> -->
+              <el-table-column
+                label="包装数量"
+                prop="packingQuantity"
+                width="80"
+              ></el-table-column>
               <el-table-column
-                v-else
                 label="包装单位"
                 prop="packingUnit"
               ></el-table-column>
@@ -519,11 +533,7 @@
   import elTableInfiniteScroll from 'el-table-infinite-scroll';
   import warehouseDefinition from '@/api/warehouseManagement/warehouseDefinition';
   import { getTreeByGroup } from '@/api/classifyManage';
-  import {
-    outputSceneState,
-    qualityStatus,
-    qualityResults
-  } from '@/utils/dict/index';
+  import { outputSceneState } from '@/utils/dict/index';
 
   import selectTree from '@/components/selectTree';
   import AssetsDialog from './components/AssetsDialog.vue';
@@ -541,7 +551,9 @@
       sourceBizNo: { type: String, default: '' },
       type: { type: String, default: '正常出库' },
       detailList: { type: Array, default: () => [] },
-      saleProductList: { type: Array, default: () => [] }
+      saleProductList: { type: Array, default: () => [] },
+      extractedList: { type: Array, default: () => [] },
+      wwType: { type: Number, default: null }
     },
     directives: {
       'el-table-infinite-scroll': elTableInfiniteScroll
@@ -550,8 +562,14 @@
       return {
         newColumns: [], // 动态表头
         goodsLists: [], // 商品列表
-        qualityStatus, // 质检状态 0未检 1已检
-        qualityResults, // 质检结果 0无 1合格 2不合格
+        qualityStatus: {
+          0: '未质检',
+          1: '已质检'
+        }, // 质检状态 0未检 1已检
+        qualityResults: {
+          1: '合格',
+          2: '不合格'
+        }, // 质检结果 1合格 2不合格
         productList: [], // 产品列表
         showPackingList: [], // 展示的包装列表
         packingList: [], // 包装列表
@@ -889,16 +907,22 @@
             this.formData.extInfo.verifyDeptCode = this.form.executorDeptId;
             this.formData.extInfo.verifyDeptName = this.form.executorDeptName;
           });
-          storageApi
-            .getHierarchyFifo({
-              type: '1',
-              builders: this.detailList.map((item) => {
-                return {
-                  categoryId: item.instanceId || item.categoryId,
-                  num: item.demandQuantity
-                };
-              })
+          let pData = {
+            type: '1',
+            builders: this.detailList.map((item) => {
+              return {
+                categoryId: item.instanceId || item.categoryId,
+                num: item.demandQuantity
+              };
             })
+          };
+          let pData2 = {
+            type: this.wwType,
+            taskIds: this.extractedList.map((item) => item.taskId),
+            workOrderIds: this.extractedList.map((item) => item.workOrderId)
+          };
+          storageApi
+            .getHierarchyFifo(this.wwType == 3 ? pData2 : pData)
             .then((data) => {
               this.detailData(data, this.dimension);
             })
@@ -916,16 +940,22 @@
             this.formData.extInfo.verifyDeptCode = this.form.deptId;
             this.formData.extInfo.verifyDeptName = this.form.deptName;
           });
-          storageApi
-            .getHierarchyFifo({
-              type: '1',
-              builders: this.saleProductList.map((item) => {
-                return {
-                  categoryId: item.productId,
-                  num: item.totalCount
-                };
-              })
+          let pData = {
+            type: '1',
+            builders: this.saleProductList.map((item) => {
+              return {
+                categoryId: item.productId,
+                num: item.totalCount
+              };
             })
+          };
+          let pData2 = {
+            type: this.wwType,
+            taskIds: this.extractedList.map((item) => item.taskId),
+            workOrderIds: this.extractedList.map((item) => item.workOrderId)
+          };
+          storageApi
+            .getHierarchyFifo(this.wwType == 3 ? pData2 : pData)
             .then((data) => {
               this.detailData(data, this.dimension);
             })

+ 140 - 61
src/views/bpm/outgoingManagement/outbound2.vue

@@ -11,7 +11,7 @@
         <el-row :gutter="20">
           <el-col :span="6">
             <el-form-item label="出库场景" prop="bizType">
-              <el-select
+              <!-- <el-select
                 filterable
                 placeholder="请选择"
                 v-model="formData.bizType"
@@ -25,20 +25,31 @@
                   :value="item.code"
                   :label="item.label"
                 ></el-option>
+              </el-select> -->
+              <el-select
+                filterable
+                disabled
+                placeholder="请选择"
+                v-model="formData.bizType"
+                clearable
+                @change="handleBizSceneChange"
+              >
+                <el-option
+                  v-for="item in outputSceneState"
+                  :key="item.code"
+                  :value="item.code"
+                  :label="item.label"
+                ></el-option>
               </el-select> </el-form-item
           ></el-col>
           <el-col :span="6">
             <el-form-item label="单据来源" prop="documentSource">
               <el-input
                 placeholder="请选择"
-                v-model="formData.extInfo.documentSource"
+                disabled
+                v-model="formData.sourceBizNo"
                 @click.native="openDocumentSourceDialog"
               >
-                <el-button
-                  @click="clearDocumentSource"
-                  slot="append"
-                  icon="el-icon-circle-close"
-                ></el-button>
               </el-input>
             </el-form-item>
           </el-col>
@@ -47,7 +58,7 @@
               <el-select
                 style="width: 100%"
                 multiple
-                :disabled="!!(productList && productList.length)"
+                disabled
                 v-model="formData.extInfo.assetType"
                 placeholder="请选择"
               >
@@ -59,6 +70,21 @@
                 >
                 </el-option>
               </el-select>
+              <!-- <el-select
+                style="width: 100%"
+                multiple
+                :disabled="!!(productList && productList.length)"
+                v-model="formData.extInfo.assetType"
+                placeholder="请选择"
+              >
+                <el-option
+                  v-for="item in goodsLists"
+                  :key="item.id"
+                  :label="item.name"
+                  :value="item.id"
+                >
+                </el-option>
+              </el-select> -->
             </el-form-item>
           </el-col>
           <el-col :span="6">
@@ -196,46 +222,50 @@
                 :show-overflow-tooltip="true"
               >
               </el-table-column>
+
               <el-table-column
-                label="最小包装单元"
+                label="包装数量"
+                v-if="clientEnvironmentId == 3"
+                prop="packingQuantity"
                 align="center"
-                width="120"
-                prop="minPackingQuantity"
               >
                 <template slot-scope="{ row, $index }">
-                  {{ row.minPackingQuantity }} {{ row.measureUnit }} /{{
-                    row.packingUnit
-                  }}
+                  {{ row.packingQuantity }} {{ row.packingUnit }}
                 </template>
               </el-table-column>
-
               <el-table-column
+                v-else
                 label="包装数量"
                 prop="packingQuantity"
+                width="80"
+              ></el-table-column>
+              <el-table-column
+                v-if="clientEnvironmentId == 3"
+                label="最小包装单元"
                 align="center"
+                width="120"
+                prop="minPackingQuantity"
               >
                 <template slot-scope="{ row, $index }">
-                  {{ row.packingQuantity }} {{ row.packingUnit }}
+                  {{ row.minPackingQuantity }} {{ row.measureUnit }} /{{
+                    row.packingUnit
+                  }}
                 </template>
               </el-table-column>
+              <el-table-column
+                v-else
+                label="包装单位"
+                prop="packingUnit"
+              ></el-table-column>
               <el-table-column
                 label="计量数量"
                 prop="measureQuantity"
-                width="100"
-                align="center"
-              >
-              </el-table-column>
+                :show-overflow-tooltip="true"
+              ></el-table-column>
               <el-table-column
                 label="计量单位"
                 prop="measureUnit"
-                align="center"
-              >
-                <template slot-scope="{ row, $index }">
-                  <template>
-                    {{ row.measureUnit }}
-                  </template>
-                </template>
-              </el-table-column>
+              ></el-table-column>
               <el-table-column
                 label="重量"
                 prop="weight"
@@ -489,7 +519,11 @@
   import elTableInfiniteScroll from 'el-table-infinite-scroll';
   import warehouseDefinition from '@/api/warehouseManagement/warehouseDefinition';
   import { getTreeByGroup } from '@/api/classifyManage';
-  import { outputSceneState } from '@/utils/dict/index';
+  import {
+    outputSceneState,
+    qualityStatus,
+    qualityResults
+  } from '@/utils/dict/index';
 
   import selectTree from '@/components/selectTree';
   import AssetsDialog from './components/AssetsDialog.vue';
@@ -505,7 +539,11 @@
       form: { type: Object, default: {} },
       bizType: { type: Number, default: 1 },
       sourceBizNo: { type: String, default: '' },
-      type: { type: String, default: '正常出库' }
+      type: { type: String, default: '正常出库' },
+      detailList: { type: Array, default: () => [] },
+      saleProductList: { type: Array, default: () => [] },
+      extractedList: { type: Array, default: () => [] },
+      wwType: { type: Number, default: null }
     },
     directives: {
       'el-table-infinite-scroll': elTableInfiniteScroll
@@ -514,14 +552,8 @@
       return {
         newColumns: [], // 动态表头
         goodsLists: [], // 商品列表
-        qualityStatus: {
-          0: '未质检',
-          1: '已质检'
-        }, // 质检状态 0未检 1已检
-        qualityResults: {
-          1: '合格',
-          2: '不合格'
-        }, // 质检结果 1合格 2不合格
+        qualityStatus, // 质检状态 0未检 1已检
+        qualityResults, // 质检结果 0无 1合格 2不合格
         productList: [], // 产品列表
         showPackingList: [], // 展示的包装列表
         packingList: [], // 包装列表
@@ -584,7 +616,7 @@
       this.getFieldModel();
       this.getListItems();
       this.initDeptData().then(() => {
-        this.initUserInfo();
+        this.initFormData();
       });
     },
     methods: {
@@ -823,33 +855,35 @@
         });
       },
       // 初始化用户信息
-      async initUserInfo() {
-        const res = await warehouseDefinition.tree();
-        // let info = JSON.parse(localStorage.getItem('info'));
-        console.log('用户信息', this.user);
-        console.log(this.form);
-        let obj = res.find(
-          (item) =>
-            item.id ===
-            this.user.info.deptIds[this.user.info.deptIds.length - 1]
-        );
-        console.log('obj', obj);
-        if (!obj) return;
-        this.formData.extInfo.deptCode = obj.id;
-        this.formData.extInfo.deptName = obj.name;
-        this.formData.extInfo.createUserName = this.user.info.name;
-        this.formData.createUserId = this.user.info.userId;
+      async initFormData() {
+        // const res = await warehouseDefinition.tree();
+        // let obj = res.find(
+        //   (item) =>
+        //     item.id ===
+        //     this.user.info.deptIds[this.user.info.deptIds.length - 1]
+        // );
+        // if (!obj) return;
+        // this.formData.extInfo.deptCode = obj.id;
+        // this.formData.extInfo.deptName = obj.name;
+        // this.formData.extInfo.createUserName = this.user.info.name;
+        // this.formData.createUserId = this.user.info.userId;
+
         // 物品类型
-        this.formData.extInfo.assetType =
-          this.form.categoryLevelTopId.split(',');
+        this.formData.extInfo.assetType = Array.from(
+          new Set(this.form.categoryLevelTopId.split(','))
+        );
         // 出库类型
         this.formData.bizType = this.bizType;
         // 添加单据来源
         this.formData.sourceBizNo = this.sourceBizNo;
         // 将出库状态改成出库状态 2出库 1入库
         this.formData.type = 2;
-        if (this.type == '自选领用出库') {
-          // 获取领料列表
+        // 入库登记人
+        this.formData.extInfo.createUserName = this.$store.state.user.info.name;
+        this.formData.createUserId = this.$store.state.user.info.userId;
+        // 生产相关逻辑
+        if (this.detailList?.length > 0) {
+          // 获取领料人列表
           this.getStaffList({ id: this.form.executorDeptId }).then(() => {
             // 获取领料人和领料部门
             this.formData.fromId = this.form.executorId;
@@ -857,8 +891,32 @@
             this.formData.extInfo.verifyDeptCode = this.form.executorDeptId;
             this.formData.extInfo.verifyDeptName = this.form.executorDeptName;
           });
+          let pData = {
+            type: '1',
+            builders: this.detailList.map((item) => {
+              return {
+                categoryId: item.instanceId || item.categoryId,
+                num: item.demandQuantity
+              };
+            })
+          };
+          let pData2 = {
+            type: this.wwType,
+            taskIds: this.extractedList.map((item) => item.taskId),
+            workOrderIds: this.extractedList.map((item) => item.workOrderId)
+          };
+          storageApi
+            .getHierarchyFifo(this.wwType == 3 ? pData2 : pData)
+            .then((data) => {
+              this.detailData(data, this.dimension);
+            })
+            .catch((err) => {
+              console.log(err);
+            });
         }
-        if (this.type == '销售发货出库') {
+        // 销售相关逻辑
+        if (this.saleProductList?.length > 0) {
+          // 获取领料人列表
           this.getStaffList({ id: this.form.deptId }).then(() => {
             // 获取领料人和领料部门
             this.formData.fromId = this.form.makerId;
@@ -866,8 +924,29 @@
             this.formData.extInfo.verifyDeptCode = this.form.deptId;
             this.formData.extInfo.verifyDeptName = this.form.deptName;
           });
+          let pData = {
+            type: '1',
+            builders: this.saleProductList.map((item) => {
+              return {
+                categoryId: item.productId,
+                num: item.totalCount
+              };
+            })
+          };
+          let pData2 = {
+            type: this.wwType,
+            taskIds: this.extractedList.map((item) => item.taskId),
+            workOrderIds: this.extractedList.map((item) => item.workOrderId)
+          };
+          storageApi
+            .getHierarchyFifo(this.wwType == 3 ? pData2 : pData)
+            .then((data) => {
+              this.detailData(data, this.dimension);
+            })
+            .catch((err) => {
+              console.log(err);
+            });
         }
-        console.log('this.formData', this.formData);
       },
       // 初始化部门数据
       initDeptData() {

+ 33 - 19
src/views/bpm/outgoingManagement/outbound3.vue

@@ -551,7 +551,9 @@
       sourceBizNo: { type: String, default: '' },
       type: { type: String, default: '正常出库' },
       detailList: { type: Array, default: () => [] },
-      saleProductList: { type: Array, default: () => [] }
+      saleProductList: { type: Array, default: () => [] },
+      extractedList: { type: Array, default: () => [] },
+      wwType: { type: Number, default: null }
     },
     directives: {
       'el-table-infinite-scroll': elTableInfiniteScroll
@@ -905,16 +907,22 @@
             this.formData.extInfo.verifyDeptCode = this.form.executorDeptId;
             this.formData.extInfo.verifyDeptName = this.form.executorDeptName;
           });
-          storageApi
-            .getHierarchyFifo({
-              type: '1',
-              builders: this.detailList.map((item) => {
-                return {
-                  categoryId: item.instanceId || item.categoryId,
-                  num: item.demandQuantity
-                };
-              })
+          let pData = {
+            type: '1',
+            builders: this.detailList.map((item) => {
+              return {
+                categoryId: item.instanceId || item.categoryId,
+                num: item.demandQuantity
+              };
             })
+          };
+          let pData2 = {
+            type: this.wwType,
+            taskIds: this.extractedList.map((item) => item.taskId),
+            workOrderIds: this.extractedList.map((item) => item.workOrderId)
+          };
+          storageApi
+            .getHierarchyFifo(this.wwType == 3 ? pData2 : pData)
             .then((data) => {
               this.detailData(data, this.dimension);
             })
@@ -932,16 +940,22 @@
             this.formData.extInfo.verifyDeptCode = this.form.deptId;
             this.formData.extInfo.verifyDeptName = this.form.deptName;
           });
-          storageApi
-            .getHierarchyFifo({
-              type: '1',
-              builders: this.saleProductList.map((item) => {
-                return {
-                  categoryId: item.productId,
-                  num: item.totalCount
-                };
-              })
+          let pData = {
+            type: '1',
+            builders: this.saleProductList.map((item) => {
+              return {
+                categoryId: item.productId,
+                num: item.totalCount
+              };
             })
+          };
+          let pData2 = {
+            type: this.wwType,
+            taskIds: this.extractedList.map((item) => item.taskId),
+            workOrderIds: this.extractedList.map((item) => item.workOrderId)
+          };
+          storageApi
+            .getHierarchyFifo(this.wwType == 3 ? pData2 : pData)
             .then((data) => {
               this.detailData(data, this.dimension);
             })

Diff do ficheiro suprimidas por serem muito extensas
+ 394 - 316
src/views/bpm/stockManagement/storage.vue


+ 7 - 2
src/views/bpm/stockManagement/storage_2.vue

@@ -946,7 +946,8 @@
       bizType: { type: Number, default: 1 },
       sourceBizNo: { type: String, default: '' },
       detailList: { type: Array, default: () => [] },
-      saleProductList: { type: Array, default: () => [] }
+      saleProductList: { type: Array, default: () => [] },
+      detailProductList: { type: Array, default: () => [] }
     },
     data() {
       return {
@@ -1004,11 +1005,15 @@
       packingList: {
         handler(newVal) {
           console.log('包装列表', newVal);
-          console.log('当前包装列表加载页数', this.pickingPageNum);
+
           this.showPackingList = newVal.slice(
             0,
             this.pageSize * (this.pickingPageNum > 0 ? this.pickingPageNum : 1)
           );
+          this.showPackingList.forEach((obj) => {
+            obj.workOrderId = this.detailProductList[0].workOrderId;
+            obj.taskId = this.detailProductList[0].taskId;
+          });
         },
         deep: true
       },

+ 6 - 1
src/views/bpm/stockManagement/storage_3.vue

@@ -933,7 +933,8 @@
       bizType: { type: Number, default: 1 },
       sourceBizNo: { type: String, default: '' },
       detailList: { type: Array, default: () => [] },
-      saleProductList: { type: Array, default: () => [] }
+      saleProductList: { type: Array, default: () => [] },
+      detailProductList: { type: Array, default: () => [] }
     },
     data() {
       return {
@@ -997,6 +998,10 @@
             0,
             this.pageSize * (this.pickingPageNum > 0 ? this.pickingPageNum : 1)
           );
+          this.showPackingList.forEach((obj) => {
+            obj.workOrderId = this.detailProductList[0].workOrderId;
+            obj.taskId = this.detailProductList[0].taskId;
+          });
           this.pickingPageNum = Math.ceil(
             this.showPackingList.length / this.pageSize
           );

+ 7 - 3
src/views/bpm/todo/index.vue

@@ -38,8 +38,7 @@
                 </el-select>
               </el-form-item>
             </el-col> -->
-            <el-col
-              v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
+            <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
               <el-form-item label="创建时间:" prop="createTime">
                 <el-date-picker
                   v-model="params.createTime"
@@ -53,7 +52,10 @@
                 />
               </el-form-item>
             </el-col>
-            <el-col  style="display: flex;justify-content: flex-end" v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
+            <el-col
+              style="display: flex; justify-content: flex-end"
+              v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }"
+            >
               <div class="ele-form-actions">
                 <el-button
                   type="primary"
@@ -272,6 +274,7 @@
       handleAudit(type, row) {
         if (type == 'audit') {
           if (Object.keys(row.formJson).length) {
+            console.log('处理1');
             this.formParserDialogFlag = true;
             this.$nextTick(() => {
               this.$refs.formParserDialogRef.open({
@@ -284,6 +287,7 @@
               });
             });
           } else {
+            console.log('处理2');
             this.$refs.handleTaskRef.open({
               id: row.processInstance.id,
               businessId: row.businessId,

Alguns ficheiros não foram mostrados porque muitos ficheiros mudaram neste diff