Jelajahi Sumber

新增委外发货流程-发起人申请-仓管

Z 2 tahun lalu
induk
melakukan
e6ecb85a91

+ 11 - 0
src/api/bpm/components/purchasingManage/outSourceSend.js

@@ -68,3 +68,14 @@ export async function submit(data) {
   return Promise.reject(new Error(res.data.message));
 }
 
+
+/**
+ * 流程作废
+ */
+export async function cancel(data) {
+  const res = await request.put(`/bpm/finFeeApply/notPass`, data);
+  if (res.data.code == 0) {
+    return Promise.resolve(res.data);
+  }
+  return Promise.reject(new Error(res.data.message));
+}

+ 201 - 190
src/views/bpm/handleTask/components/purchaseOrder/invoice/orderListDialog.vue

@@ -24,7 +24,7 @@
         <!-- 表头工具栏 -->
         <template v-slot:action="{ row }">
           <el-radio class="radio" v-model="radio" :label="row.id"
-            ><i></i
+          ><i></i
           ></el-radio>
         </template>
       </ele-pro-table>
@@ -38,209 +38,220 @@
 </template>
 
 <script>
-  import searchTable from '@/views/bpm/handleTask/components/purchaseOrder/searchTable.vue';
-  import { getTableList } from '@/api/bpm/components/purchasingManage/purchaseOrder';
-  export default {
-    components: {
-      searchTable
+import searchTable from '@/views/bpm/handleTask/components/purchaseOrder/searchTable.vue';
+import {getTableList} from '@/api/bpm/components/purchasingManage/purchaseOrder';
+
+export default {
+  components: {
+    searchTable
+  },
+  props: {
+    searchParams: {
+      type: Object,
+      default: () => {}
+    }
+  },
+  data() {
+    return {
+      visible: false,
+      currentIndex: null,
+      columns: [
+        {
+          columnKey: 'index',
+          label: '序号',
+          type: 'index',
+          width: 55,
+          align: 'center',
+          showOverflowTooltip: true,
+          fixed: 'left'
+        },
+        {
+          width: 60,
+          type: 'action',
+          slot: 'action',
+          label: '选择',
+
+          columnKey: 'action',
+          align: 'center'
+        },
+        {
+          prop: 'orderNo',
+          label: '订单编码',
+          align: 'center',
+          slot: 'orderNo',
+          showOverflowTooltip: true,
+          minWidth: 200
+        },
+        {
+          prop: 'contractName',
+          label: '合同名称',
+          align: 'center',
+          slot: 'contractName',
+          showOverflowTooltip: true,
+          minWidth: 200
+        },
+        // {
+        //   prop: 'deliveryDate',
+        //   label: '交货日期',
+        //   align: 'center',
+        //   showOverflowTooltip: true,
+        //   minWidth: 200
+        // },
+        {
+          prop: 'purchaseTypeName',
+          label: '采购订单类型',
+          align: 'center',
+          showOverflowTooltip: true,
+          minWidth: 140
+        },
+        {
+          prop: 'partaName',
+          label: '采购方名称',
+          align: 'center',
+          showOverflowTooltip: true,
+          minWidth: 180
+        },
+        {
+          prop: 'partaLinkName',
+          label: '采购方联系人',
+          align: 'center',
+          showOverflowTooltip: true,
+          minWidth: 130
+        },
+
+        {
+          prop: 'partaTel',
+          label: '采购方联系电话',
+          align: 'center',
+          showOverflowTooltip: true,
+          minWidth: 130
+        },
+        {
+          prop: 'partbName',
+          label: '供应商名称',
+          align: 'center',
+          showOverflowTooltip: true,
+          minWidth: 130
+        },
+        {
+          prop: 'partbLinkName',
+          label: '供应商联系人',
+          align: 'center',
+          showOverflowTooltip: true,
+          minWidth: 130
+        },
+        {
+          prop: 'partbTel',
+          label: '供应商联系电话',
+          align: 'center',
+          showOverflowTooltip: true,
+          minWidth: 130
+        },
+        {
+          prop: 'payAmount',
+          label: '应付金额(元)',
+          align: 'center',
+          showOverflowTooltip: true,
+          minWidth: 170
+        },
+        {
+          prop: 'createTime',
+          label: '创建时间',
+          align: 'center',
+          showOverflowTooltip: true,
+          minWidth: 170
+        }
+      ],
+
+      radio: null
+    };
+  },
+
+  methods: {
+    open(item, currentIndex) {
+      this.currentIndex = currentIndex;
+      if (item && item.id) {
+        this.radio = item.id;
+      }
+
+      this.visible = true;
     },
 
-    data() {
-      return {
-        visible: false,
-        currentIndex: null,
-        columns: [
-          {
-            columnKey: 'index',
-            label: '序号',
-            type: 'index',
-            width: 55,
-            align: 'center',
-            showOverflowTooltip: true,
-            fixed: 'left'
-          },
-          {
-            width: 60,
-            type: 'action',
-            slot: 'action',
-            label: '选择',
-
-            columnKey: 'action',
-            align: 'center'
-          },
-          {
-            prop: 'orderNo',
-            label: '订单编码',
-            align: 'center',
-            slot: 'orderNo',
-            showOverflowTooltip: true,
-            minWidth: 200
-          },
-          {
-            prop: 'contractName',
-            label: '合同名称',
-            align: 'center',
-            slot: 'contractName',
-            showOverflowTooltip: true,
-            minWidth: 200
-          },
-          // {
-          //   prop: 'deliveryDate',
-          //   label: '交货日期',
-          //   align: 'center',
-          //   showOverflowTooltip: true,
-          //   minWidth: 200
-          // },
-          {
-            prop: 'purchaseTypeName',
-            label: '采购订单类型',
-            align: 'center',
-            showOverflowTooltip: true,
-            minWidth: 140
-          },
-          {
-            prop: 'partaName',
-            label: '采购方名称',
-            align: 'center',
-            showOverflowTooltip: true,
-            minWidth: 180
-          },
-          {
-            prop: 'partaLinkName',
-            label: '采购方联系人',
-            align: 'center',
-            showOverflowTooltip: true,
-            minWidth: 130
-          },
-
-          {
-            prop: 'partaTel',
-            label: '采购方联系电话',
-            align: 'center',
-            showOverflowTooltip: true,
-            minWidth: 130
-          },
-          {
-            prop: 'partbName',
-            label: '供应商名称',
-            align: 'center',
-            showOverflowTooltip: true,
-            minWidth: 130
-          },
-          {
-            prop: 'partbLinkName',
-            label: '供应商联系人',
-            align: 'center',
-            showOverflowTooltip: true,
-            minWidth: 130
-          },
-          {
-            prop: 'partbTel',
-            label: '供应商联系电话',
-            align: 'center',
-            showOverflowTooltip: true,
-            minWidth: 130
-          },
-          {
-            prop: 'payAmount',
-            label: '应付金额(元)',
-            align: 'center',
-            showOverflowTooltip: true,
-            minWidth: 170
-          },
-          {
-            prop: 'createTime',
-            label: '创建时间',
-            align: 'center',
-            showOverflowTooltip: true,
-            minWidth: 170
-          }
-        ],
-
-        radio: null
-      };
+    /* 表格数据源 */
+    datasource({page, limit, where, order}) {
+      return getTableList({
+        pageNum: page,
+        size: limit,
+        ...where,
+        orderStatus: 2,
+        ...this.searchParams
+      });
     },
 
-    methods: {
-      open(item, currentIndex) {
-        this.currentIndex = currentIndex;
-        if (item && item.id) {
-          this.radio = item.id;
-        }
+    /* 刷新表格 */
+    reload(where) {
+      where = {
+        ...where,
+        ...this.searchParams
+      }
+      this.$refs.table.reload({pageNum: 1, where: where});
+    },
 
-        this.visible = true;
-      },
-
-      /* 表格数据源 */
-      datasource({ page, limit, where, order }) {
-        return getTableList({
-          pageNum: page,
-          size: limit,
-          ...where,
-          orderStatus:2
-        });
-      },
-
-      /* 刷新表格 */
-      reload(where) {
-        this.$refs.table.reload({ pageNum: 1, where: where });
-      },
-
-      handleNodeClick(data, node) {
-        this.reload({ categoryId: data.id });
-      },
-
-      // 单击获取id
-      cellClick(row) {
-        this.current = row;
-        console.log(row);
-        this.radio = row.id;
-      },
-      handleClose() {
-        this.visible = false;
-        this.current = null;
-        this.radio = '';
-      },
-
-      selected() {
-        if (!this.current) {
-          return this.$message.warning('请至少选择一条数据');
-        }
-        this.$emit('changeParent', this.current, this.currentIndex);
-        this.handleClose();
+    handleNodeClick(data, node) {
+      this.reload({categoryId: data.id});
+    },
+
+    // 单击获取id
+    cellClick(row) {
+      this.current = row;
+      console.log(row);
+      this.radio = row.id;
+    },
+    handleClose() {
+      this.visible = false;
+      this.current = null;
+      this.radio = '';
+    },
+
+    selected() {
+      if (!this.current) {
+        return this.$message.warning('请至少选择一条数据');
       }
+      this.$emit('changeParent', this.current, this.currentIndex);
+      this.handleClose();
     }
-  };
+  }
+};
 </script>
 
 <style lang="scss" scoped>
-  .tree_col {
-    border: 1px solid #eee;
-    padding: 10px 0;
-    box-sizing: border-box;
-    height: 500px;
-    overflow: auto;
-  }
+.tree_col {
+  border: 1px solid #eee;
+  padding: 10px 0;
+  box-sizing: border-box;
+  height: 500px;
+  overflow: auto;
+}
 
-  .table_col {
-    padding-left: 10px;
+.table_col {
+  padding-left: 10px;
 
-    ::v-deep .el-table th.el-table__cell {
-      background: #f2f2f2;
-    }
+  ::v-deep .el-table th.el-table__cell {
+    background: #f2f2f2;
   }
+}
 
-  .pagination {
-    text-align: right;
-    padding: 10px 0;
-  }
+.pagination {
+  text-align: right;
+  padding: 10px 0;
+}
 
-  .btns {
-    text-align: center;
-    padding: 10px 0;
-  }
+.btns {
+  text-align: center;
+  padding: 10px 0;
+}
 
-  .topsearch {
-    margin-bottom: 15px;
-  }
+.topsearch {
+  margin-bottom: 15px;
+}
 </style>

+ 27 - 127
src/views/bpm/handleTask/components/purchaseOrder/outSourceSend/addOrEditDialog.vue

@@ -1,13 +1,5 @@
 <template>
-  <ele-modal
-    custom-class="ele-dialog-form long-dialog-form"
-    :centered="true"
-    :visible.sync="addOrEditDialogFlag"
-    :title="title"
-    :close-on-click-modal="false"
-    width="80%"
-    @close="cancel"
-  >
+  <div>
     <el-form ref="form" :model="form" :rules="rules" label-width="120px">
       <headerTitle title="发货信息"></headerTitle>
 
@@ -120,27 +112,19 @@
       ref="inventoryTableref"
       :orderId="form.orderId"
     ></inventoryTable>
-
-    <div slot="footer" class="footer">
-      <el-button type="primary" @click="save">保存</el-button>
-      <el-button type="primary" @click="save('sub')">提交</el-button>
-
-      <el-button @click="cancel">返回</el-button>
-    </div>
     <!--  采购订单  -->
     <orderListDialog
       :searchParams="orderSearchParams"
       ref="orderListDialogRef"
       @changeParent="changeOrder"
     ></orderListDialog>
-  </ele-modal>
+  </div>
 </template>
 
 <script>
 
 import fileUpload from '@/components/upload/fileUpload';
 import dictMixins from '@/mixins/dictMixins';
-// import parentList from '@/views/saleManage/contact/components/parentList.vue';
 import {
   savePurchaseOutSourceSendAPI,
   updatePurchaseOutSourceSendAPI,
@@ -149,20 +133,21 @@ import {
 } from '@/api/bpm/components/purchasingManage/outSourceSend';
 // import {getcontactlink} from '@/api/saleManage/businessFollow';
 import inventoryTable from './inventoryTable.vue';
-// import orderListDialog from '../../invoice/components/orderListDialog.vue';
+import orderListDialog from '../invoice/orderListDialog.vue';
 import {copyObj} from '@/utils/util';
 import {getpurchaseorderDetail} from "@/api/bpm/components/purchasingManage/purchaseOrder";
 
 export default {
-  props: {
-    addOrEditDialogFlag: Boolean
-  },
   mixins: [dictMixins],
   components: {
     fileUpload,
     inventoryTable,
-    orderListDialog,
-    parentList
+    orderListDialog
+  },
+  props: {
+    businessId: {
+      default: ''
+    }
   },
   data() {
     return {
@@ -173,7 +158,6 @@ export default {
       payWayOptions: [],
       delDetailIds: [],
       linkNameOptions: [],
-
       title: '',
       row: {},
       form: {
@@ -213,26 +197,12 @@ export default {
 
       // 提交状态
       loading: false,
-      // 是否是修改
-      isUpdate: false,
-      businessId: ''
     };
   },
-
+  async created() {
+    await this.getSendSaleOrderDetail(this.businessId);
+  },
   methods: {
-    //打开新增编辑弹框
-    async open(type, row, orderId) {
-      this.title = type === 'add' ? '新增委外发货单' : '修改';
-      this.row = row;
-      if (orderId) {
-        await this.getPurchaseOrderDetail(orderId);
-      }
-      if (row && row?.id) {
-        await this.getSendSaleOrderDetail(row?.id);
-      }
-
-      this.isUpdate = type !== 'add';
-    },
     //选择订单弹框
     handleOrderBtn(e) {
       if (e.target.nodeName == 'I') {
@@ -316,32 +286,6 @@ export default {
       }
     },
 
-    //更新联系人数据
-    async getLinkInfo(contactId) {
-      const data = await getcontactlink({contactId});
-      if (data && data?.length) {
-        this.linkNameOptions = data;
-      }
-    },
-    selectFocus() {
-      if (this.linkNameOptions.length === 0) {
-        return this.$message.error('请先选择名称');
-      }
-    },
-
-    handHead() {
-      let item = {
-        id: this.form.partbLinkId
-      };
-      this.$refs.headRef.open(item);
-    },
-
-
-    salesmanChange(val, info) {
-      this.otherForm.salesmanName = info.name;
-    },
-
-
     getValidate() {
       return Promise.all([
         new Promise((resolve, reject) => {
@@ -364,67 +308,23 @@ export default {
         })
       ]);
     },
-    async save(type) {
-      try {
-        await this.getValidate();
-        // 表单验证通过,执行保存操作
-        this.loading = true;
-        if (!this.isUpdate) {
-          delete this.form.id;
-        }
-        this.form.files = this.form.files || [];
-        // this.form.replied = this.form.repliedFiles.length > 0 ? 1 : 0;
-        let commitData = Object.assign({}, this.form, {
-          productList: this.$refs.inventoryTableref.getTableValue()
-        });
+    async getTableValue() {
+      return new Promise(async (resolve, reject) => {
+        try {
+          await this.getValidate();
+          this.form.files = this.form.files || [];
+          let commitData = Object.assign({}, this.form, {
+            productList: this.$refs.inventoryTableref.getTableValue()
+          });
+          await updatePurchaseOutSourceSendAPI(commitData)
+          resolve(true)
 
-        if (this.isUpdate) {
-          updatePurchaseOutSourceSendAPI(commitData)
-            .then((res) => {
-              this.loading = false;
-              this.$message.success('修改成功');
-              if (type === 'sub') {
-                this.sendSubmit(res);
-                return;
-              }
-              this.cancel();
-              this.$emit('done');
-            })
-            .catch((e) => {
-              //this.loading = false;
-            });
-        } else {
-          savePurchaseOutSourceSendAPI(commitData)
-            .then((res) => {
-              this.loading = false;
-              this.$message.success('新增成功');
-              if (type === 'sub') {
-                this.sendSubmit(res);
-                return;
-              }
-              this.cancel();
-              this.$emit('done');
-            })
-            .catch((e) => {
-              //this.loading = false;
-            });
+        } catch (error) {
+          reject(false)
+          // 表单验证未通过,不执行保存操作
         }
-      } catch (error) {
-        console.log(error);
-        // 表单验证未通过,不执行保存操作
-      }
-    },
-    sendSubmit(res) {
-      submit({
-        businessId: this.businessId || res
-        // productionSupervisorId
-      }).then((res) => {
-        this.cancel();
-        this.$emit('done');
-      });
-    },
-    cancel() {
-      this.$emit('update:addOrEditDialogFlag', false)
+      })
+
     }
   }
 };

+ 89 - 0
src/views/bpm/handleTask/components/purchaseOrder/outSourceSend/boxTabPage.vue

@@ -0,0 +1,89 @@
+<template>
+  <div>
+    <el-tabs v-model="activeName" type="card" @tab-click="handleClick">
+      <el-tab-pane
+        v-for="item in tabOption"
+        :label="item.label"
+        :name="item.name"
+      >
+      </el-tab-pane>
+    </el-tabs>
+    <component
+      v-if="activeName && isValidComponent(activeName)"
+      :is="activeName"
+      :key="cKey"
+      ref="componentRef"
+      :taskDefinitionKey="taskDefinitionKey"
+      :activeComp="activeComp"
+      :businessId="businessId"
+      :infoData="{}"
+      :permissionType="permissionType"
+    />
+  </div>
+</template>
+
+<script>
+
+export default {
+  name: 'boxTabPage',
+  components: {
+    tab1: () => import('./detailDialog.vue'),
+  },
+  props: {
+    taskDefinitionKey: {
+      type: String,
+      default: ''
+    },
+    activeComp: {
+      type: String,
+      default: ''
+    },
+    permissionType: {
+      type: String,
+      default: 'view'
+    },
+    businessId: {
+      type: String,
+      default: ''
+    }
+  },
+  data() {
+    return {
+      form: {},
+      activeName: 'tab1',
+      cKey: 1
+    };
+  },
+  computed: {
+    tabOption() {
+      let list = [
+        {
+          label: '发货单详情',
+          name: 'tab1',
+          isShow:true
+        },
+        {
+          label: '入库',
+          name: 'tab2',
+          isShow:true
+        }
+      ];
+      return list.filter((item) => item.isShow);
+    }
+  },
+  async created() {
+
+  },
+  methods: {
+    isValidComponent(componentName) {
+      const validComponents = ['tab1'];
+      return validComponents.includes(componentName);
+    },
+    handleClick(val) {
+      this.activeName = val.name;
+    },
+
+  }
+};
+</script>
+<style scoped lang="scss"></style>

+ 6 - 7
src/views/bpm/handleTask/components/purchaseOrder/outSourceSend/submit.vue

@@ -70,7 +70,7 @@
 </template>
 
 <script>
-import {cancel} from "@/api/bpm/components/financialManage/fee-manage/fee-application";
+import {cancel} from "@/api/bpm/components/purchasingManage/outSourceSend";
 import {approveTaskWithVariables} from '@/api/bpm/task';
 import {getWarehouseListByIds} from "@/api/bpm/components/saleManage/saleorder";
 
@@ -119,22 +119,20 @@ export default {
     },
 
     async handleAudit(status) {
-      let storemanIds= ''
+      let storemanIds = ''
       let permissionType = this.tabOptions.find(item => item.key == this.taskDefinitionKey)?.permissionType
       if (permissionType === 'update') {
-        const id = await this.getTableValue();
-        if (typeof id !== 'string') return
+        await this.getTableValue();
       }
       if (this.taskDefinitionKey === 'deptLeaderApprove') {
         let arr = await this.getTableValue();
-        console.log(arr);
         let ids = arr.productList.map((item) => item.warehouseId);
         let data = await getWarehouseListByIds(ids || []);
         storemanIds = [...new Set(data.map(item => item.ownerId))].join(',')
       }
       await this._approveTaskWithVariables(status, storemanIds);
     },
-    async _approveTaskWithVariables(status,storemanIds) {
+    async _approveTaskWithVariables(status, storemanIds) {
       let variables = {
         pass: !!status,
         storemanIds
@@ -178,7 +176,8 @@ export default {
           }).catch(() => {
             this.$message.error("流程作废失败");
           });
-        }).catch(() => {});
+        }).catch(() => {
+        });
       }
     },