소스 검색

feat: 采购订单详情增加关联的冲差单列表

liujt 1 주 전
부모
커밋
8f40e09b84

+ 8 - 2
src/views/purchasingManage/purchaseOrder/components/detailDialog.vue

@@ -497,6 +497,9 @@
     <div v-if="activeComp == 'accountstatement'">
       <accountstatementList :orderId="detailId"></accountstatementList>
     </div>
+    <div v-if="activeComp == 'adjustNote'">
+      <adjustNoteList :orderId="detailId"></adjustNoteList>
+    </div>
     <div slot="footer" class="footer">
       <el-button @click="cancel">返回</el-button>
     </div>
@@ -527,6 +530,7 @@
   import tabMixins from '@/mixins/tableColumnsMixin';
   import { shippingModePurchaseOp, transactionMethodsOp, quoteTypeOp } from '@/enum/dict.js';
   import PaymentCollectionPlan from '@/BIZComponents/paymentCollectionPlan/Index.vue'
+  import adjustNoteList from '@/views/purchasingManage/purchaseOrder/orderAssociation/adjustNoteList.vue'
 
   export default {
     mixins: [dictMixins, tabMixins],
@@ -537,7 +541,8 @@
       returnGoodsList,
       accountstatementList,
       bpmDetail,
-      PaymentCollectionPlan
+      PaymentCollectionPlan,
+      adjustNoteList
     },
     props: {
       modal: {
@@ -572,7 +577,8 @@
           { key: 'outSourceSend', name: '发货列表' },
           { key: 'invoice', name: '收货列表' },
           { key: 'returnorder', name: '退货列表' },
-          { key: 'accountstatement', name: '对账列表' }
+          { key: 'accountstatement', name: '对账列表' },
+          { key: 'adjustNote', name: '冲差列表' }
         ],
         visible: false,
         detailId: '',

+ 306 - 0
src/views/purchasingManage/purchaseOrder/orderAssociation/adjustNoteList.vue

@@ -0,0 +1,306 @@
+<template>
+  <div class="ele-body">
+    <el-card shadow="never" v-loading="loading">
+      <div class="ele-border-lighter form-content" v-loading="loading">
+        <!-- 数据表格 -->
+        <ele-pro-table
+          ref="table"
+          :columns="columns"
+          :datasource="datasource"
+          height="calc(100vh - 385px)"
+          full-height="calc(100vh - 116px)"
+          tool-class="ele-toolbar-form"
+          :selection.sync="selection"
+          cache-key="eomContactPageTable"
+        >
+          <!-- 查看详情列 -->
+          <template v-slot:orderNo="{ row }">
+            <el-link
+              type="primary"
+              :underline="false"
+              @click="openorderDetail(row, 'orderNo')"
+            >
+              {{ row.orderNo }}
+            </el-link>
+          </template>
+          <!-- 冲差类型列 -->
+          <template v-slot:type="{ row }">
+            {{ row.type ? getDict('冲差类型', row.type) : '' }}
+          </template>
+          <!-- 冲差方式列 -->
+          <template v-slot:method="{ row }">
+            {{ row.method ? getDict('冲差方式', row.method) : '' }}
+          </template>
+          <!-- 冲差范围列 -->
+          <template v-slot:rangeType="{ row }">
+            {{ row.rangeType ? getDict('冲差范围', row.rangeType) : '' }}
+          </template>
+          <!-- 冲差原因列 -->
+          <template v-slot:reason="{ row }">
+            {{ getDict('冲差原因', row.reason) }}
+          </template>
+          <!-- 调整类型列 -->
+          <template v-slot:adjustType="{ row }">
+            {{ row.adjustType ? getDict('调整类型', row.adjustType) : '' }}
+          </template>
+        </ele-pro-table>
+      </div>
+    </el-card>
+
+    <!-- 详情弹窗 -->
+    <detail-adjust-dialog
+      v-if="detailAdjustDialogFlag"
+      :detailAdjustDialogFlag.sync="detailAdjustDialogFlag"
+      ref="detailAdjustDialogRef"
+      :sourceType="2"
+    ></detail-adjust-dialog>
+  </div>
+</template>
+
+<script>
+  import detailAdjustDialog from '@/views/saleManage/saleOrder/adjustmentNote‌/components/detailAdjustDialog.vue';
+  import { reviewStatus } from '@/enum/dict';
+  import dictMixins from '@/mixins/dictMixins';
+  import { getTableList } from '@/api/saleManage/adjustmentNote‌';
+  import {mapGetters} from "vuex";
+
+  export default {
+    mixins: [dictMixins],
+    props: {
+      orderId: String
+    },
+    components: {
+      detailAdjustDialog
+    },
+    computed: {
+      ...mapGetters(['dict','getDictValue']),
+      getDict() {
+        return (dictName, val) => {
+          // console.log(dictName, val)
+          // console.log(this.getDictValue(dictName, val))
+          return this.getDictValue(dictName, val)
+        }
+      },
+    },
+    data() {
+      return {
+        detailAdjustDialogFlag: false,
+        selection: [], //单选中集合
+        delVisible: false, //批量删除弹框状态
+        loading: false, // 加载状态
+        columns: [
+          {
+            width: 45,
+            type: 'selection',
+            columnKey: 'selection',
+            align: 'center'
+          },
+          {
+            columnKey: 'index',
+            label: '序号',
+            type: 'index',
+            width: 55,
+            align: 'center',
+            showOverflowTooltip: true,
+            fixed: 'left'
+          },
+          {
+            prop: 'orderNo',
+            label: '冲差单编码',
+            align: 'center',
+            slot: 'orderNo',
+            sortable: true,
+            showOverflowTooltip: true,
+            minWidth: 200
+          },
+          {
+            prop: 'type',
+            label: '冲差类型',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 180,
+            slot: 'type'
+          },
+          {
+            prop: 'sourceNo',
+            label: '关联订单编码',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 150,
+          },
+          {
+            prop: 'method',
+            label: '冲差方式',
+            align: 'center',
+            slot: 'startDate',
+            showOverflowTooltip: true,
+            minWidth: 200,
+            slot: 'method'
+          },
+          {
+            prop: 'rangeType',
+            label: '冲差范围',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 200,
+            slot: 'rangeType'
+          },
+          {
+            prop: 'reason',
+            label: '冲差原因',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 130,
+            slot: 'reason'
+          },
+          {
+            prop: 'adjustType',
+            label: '调整类型',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 130,
+            slot: 'adjustType'
+          },
+          {
+            prop: 'amount',
+            label: '原总金额',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 130
+          },
+          {
+            prop: 'discountAmount',
+            label: '原优惠后总金额',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 200,
+          },
+          {
+            prop: 'differenceAmount',
+            label: '总差异金额',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 200,
+          },
+          {
+            prop: 'adjustAmount',
+            label: '新总金额',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 80
+          },
+          {
+            prop: 'adjustDiscountAmount',
+            label: '新优惠后总金额',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 170
+          },
+          {
+            prop: 'createUserName',
+            label: '创建人',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 170
+          },
+          {
+            prop: 'createTime',
+            label: '创建时间',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 170
+          },
+          {
+            prop: 'status',
+            label: '状态',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 170,
+            formatter: (_row, _column, cellValue) => {
+              return reviewStatus[_row.status];
+            }
+          },
+        ],
+      };
+    },
+    created() {
+      this.requestDict('冲差原因');
+      this.requestDict('调整类型');
+      this.requestDict('冲差范围');
+      this.requestDict('冲差方式');
+      this.requestDict('冲差类型');
+    },
+    methods: {
+      /* 表格数据源 */
+      datasource({ page, limit, where, order }) {
+        return getTableList({
+          pageNum: page,
+          pageSize: limit,
+          sourceId: this.orderId,
+          ...where
+        });
+      },
+
+      /* 刷新表格 */
+      reload(where) {
+        this.$refs.table.reload({ page: 1, where });
+      },
+
+      //查看详情
+      openorderDetail(row, type) {
+        // if (type === 'statementNo') {
+          this.detailAdjustDialogFlag = true;
+          this.$nextTick(() => {
+            this.$refs.detailAdjustDialogRef.open('view', row);
+          });
+        // }
+        // if (type === 'orderNo') {
+        //   this.$refs.orderDetailDialogRef.open({ id: row.orderId });
+        // }
+      }
+    }
+  };
+</script>
+
+<style lang="scss" scoped>
+  .ele-body {
+    padding-top: 0;
+    padding-bottom: 0;
+  }
+  :deep .el-card__body {
+    padding: 0;
+  }
+  :deep(.el-link--inner) {
+    margin-left: 0px !important;
+  }
+
+  .sys-organization-list {
+    height: calc(100vh - 264px);
+    box-sizing: border-box;
+    border-width: 1px;
+    border-style: solid;
+    overflow: auto;
+  }
+  .sys-organization-list :deep(.el-tree-node__content) {
+    height: 40px;
+    & > .el-tree-node__expand-icon {
+      margin-left: 10px;
+    }
+  }
+
+  .switch_left ul .active {
+    border-top: 4px solid var(--color-primary);
+    color: var(--color-primary-5);
+  }
+  .switch {
+    padding-bottom: 20px;
+  }
+
+  .el-dropdown-link {
+    cursor: pointer;
+    color: var(--color-primary-5);
+  }
+  .el-icon-arrow-down {
+    font-size: 12px;
+  }
+</style>