Просмотр исходного кода

feat(销售管理): 新增冲差单功能及相关组件

liujt 7 месяцев назад
Родитель
Сommit
34958d549a

+ 73 - 39
src/views/saleManage/saleOrder/adjustmentNote‌/components/addAdjustDialog.vue

@@ -2,14 +2,14 @@
   <ele-modal
     custom-class="ele-dialog-form long-dialog-form"
     :centered="true"
-    :visible.sync="addAdjustDialogFlag"
+    :visible="addAdjustDialogFlag"
     :title="title"
     :append-to-body="true"
     :close-on-click-modal="false"
     width="70%"
     :maxable="true"
     :resizable="true"
-    @close="cancel"
+    @close="handleClose"
   >
     <div style="margin-bottom: 20px;">
       <el-alert
@@ -131,12 +131,10 @@
         ref="inventoryTableDetailsRef"
       ></inventoryTableDetails>
       <headerTitle
-        title="退货物品明细"
+        title="冲差信息"
         style="margin-top: 30px"
-        v-show="!['40', '50'].includes(form.type) || form.returnSourceType != 1"
       ></headerTitle>
-      <!-- <inventoryTable
-        v-show="!['40', '50'].includes(form.type) || form.returnSourceType != 1"
+      <inventoryTable
         :returnType="form.returnType"
         :returnSourceType="form.returnSourceType"
         :entrustedCode="form.entrustedCode"
@@ -146,20 +144,38 @@
         :type="form.type"
         @handleSelectGoods="handleSelectGoods"
         :orderOption="orderOption"
-      ></inventoryTable> -->
-      <headerTitle
-        title="实物赔偿清单"
-        v-show="['20', '40'].includes(form.type) && form.returnSourceType == 1"
-        style="margin-top: 30px"
-      ></headerTitle>
-      <inventoryTable1
-        v-show="['20', '40'].includes(form.type) && form.returnSourceType == 1"
-        ref="inventoryTableref1"
-        :customerMark="customerMark"
-        cacheKeyUrl="eos-saleManage-returnGoods-redressProductList"
-        :isOrderNo="true"
-        :orderOption="orderOption"
-      ></inventoryTable1>
+      ></inventoryTable>
+      <div style="margin-top: 20px;">
+        <el-row :gutter="20">
+          <el-col :span="8">
+            <el-form-item label-width="100px" label="总差异金额:" prop="redressAmount">
+              <el-input
+                clearable
+                v-model="form.redressAmount"
+                placeholder="请输入"
+              />
+            </el-form-item>
+          </el-col>
+          <el-col :span="8">
+            <el-form-item label-width="100px" label="总金额:" prop="redressAmount">
+              <el-input
+                clearable
+                v-model="form.redressAmount"
+                placeholder="请输入"
+              />
+            </el-form-item>
+          </el-col>
+          <el-col :span="8">
+            <el-form-item label-width="100px" label="优惠后总金额:" prop="redressAmount">
+              <el-input
+                clearable
+                v-model="form.redressAmount"
+                placeholder="请输入"
+              />
+            </el-form-item>
+          </el-col>
+        </el-row>
+      </div>
     </el-form>
 
     <div slot="footer" class="footer">
@@ -174,12 +190,12 @@
       <el-button @click="cancel">返回</el-button>
     </div>
     <!--  销售发货单  -->
-    <sendListDialog
+    <!-- <sendListDialog
       ref="sendListDialogRef"
       @changeParent="changeOrder"
       :contactData="contactData"
       :saleOrderData="saleOrderData"
-    ></sendListDialog>
+    ></sendListDialog> -->
     <!--  受托发货单  -->
     <entrusted-receive-dialog
       :entrusted-receive-dialog-flag.sync="entrustedReceiveDialogFlag"
@@ -236,7 +252,7 @@
     getSendSaleOrderCordList,
     getSendSaleOrderrecordDetailSplit
   } from '@/api/saleManage/saleordersendrecord';
-  // import inventoryTable from './inventoryTable.vue';
+  import inventoryTable from './inventoryTable.vue';
   // import sendListDialog from './sendListMultipleDialog.vue';
   import { copyObj } from '@/utils/util';
   import entrustedReceiveDialog from '@/views/saleManage/saleOrder/invoice/components/entrustedReceiveDialog.vue';
@@ -248,9 +264,12 @@
   // import outboundDetailsDialog from './outboundDetailsDialog.vue';
   import outboundDetailsDialog1 from '@/views/saleManage/saleOrder/entrustedReceive/components/outboundDetailsDialog.vue';
   import inventoryTable1 from '@/BIZComponents/inventoryTable.vue';
-  import inventoryTableDetails from '@/views/saleManage/saleOrder/invoice/components/inventoryTableDetails.vue';
+  import inventoryTableDetails from '@/BIZComponents/inventoryTableDetails.vue';
   import { getSendSaleOrderConfirmDetail } from '@/api/saleManage/invoiceConfirm';
   import { contactDetail } from '@/api/saleManage/contact';
+  import {
+    getSaleOrderDetail
+  } from '@/api/saleManage/saleorder';
 
   export default {
     mixins: [dictMixins],
@@ -262,7 +281,7 @@
       fileUpload,
       deptSelect,
       // sendListDialog,
-      // inventoryTable,
+      inventoryTable,
       inventoryTable1,
       parentList,
       personSelect,
@@ -730,27 +749,37 @@
       },
 
       //打开新增编辑弹框
-      async open(type, row, sendId, isEntrustedReceive) {
+      async open(type, row) {
         this.title = type === 'add' ? '新增' : '修改';
         this.row = row;
         this.visible = true;
-        this.$store.commit('returnGoods/clearUserData');
-        if (type === 'add') {
-          this.$store.commit('returnGoods/setIsDefaultPayableAmount', false); // 设置标志变量为 false,应付金额将跟随订单金额同步
-        }
+
         if (row && row?.id) {
-          await this.getReturnSaleOrderrecordDetail(row?.id);
-        }
-        if (sendId && !isEntrustedReceive) {
-          await this.getSendSaleOrderDetail(sendId);
-        }
-        if (sendId && isEntrustedReceive) {
-          this.form.returnSourceType = 2;
-          await this.getInfo({ id: sendId });
+          await this.getSaleOrderDetail(row?.id);
         }
+
         this.isUpdate = type != 'add';
       },
 
+      //获取订单详情
+      async getSaleOrderDetail(id) {
+        this.businessId = id;
+        this.loading = true;
+        const data = await getSaleOrderDetail(id);
+        this.loading = false;
+        this.form = data;
+        // if (data.partaId) {
+        //   await this.changeParent({ id: data.partaId }, true);
+        // }
+        console.log('data~~~订单详情', data);
+        if (data) {
+          this.$nextTick(() => {
+            this.$refs.inventoryTableDetailsRef &&
+              this.$refs.inventoryTableDetailsRef.putTableValue(data.productList);
+          });
+        }
+      },
+
       salesmanChange(val, info) {
         this.otherForm.salesmanName = info.name;
       },
@@ -941,6 +970,10 @@
         this.cancel();
         this.$emit('done');
       },
+      // 处理对话框关闭事件
+      handleClose() {
+        this.cancel();
+      },
       cancel() {
         this.$nextTick(() => {
           this.activeName = 'base';
@@ -949,7 +982,8 @@
           this.$refs['formRef'] && this.$refs['formRef'].resetFields();
           this.$store.commit('order/clearUserData');
           this.form = copyObj(this.formDef);
-          this.visible = false;
+          // 通过$emit更新父组件中的addAdjustDialogFlag值,避免直接修改prop
+          this.$emit('update:addAdjustDialogFlag', false);
         });
       }
     }

+ 974 - 0
src/views/saleManage/saleOrder/adjustmentNote‌/components/detailAdjustDialog.vue

@@ -0,0 +1,974 @@
+<template>
+  <ele-modal
+    custom-class="ele-dialog-form long-dialog-form"
+    :centered="true"
+    :visible.sync="detailAdjustDialogFlag"
+    :title="title"
+    :append-to-body="true"
+    :close-on-click-modal="false"
+    width="70%"
+    :maxable="true"
+    :resizable="true"
+    @close="cancel"
+  >
+    <div style="margin-bottom: 20px;">
+      <el-alert
+        title="目前冲差功能仅适用于销售订单已审核,未执行发货的情况"
+        type="warning"
+        center
+        show-icon>
+      </el-alert>
+    </div>
+    <el-form
+      ref="form"
+      :model="form"
+      :rules="rules"
+      class="el-form-box"
+      label-width="160px"
+    >
+      <headerTitle title="基本信息"></headerTitle>
+      <el-row>
+        <el-col :span="12">
+          <el-form-item label="冲差单编码" prop="returnSourceType">
+            <el-input
+              clearable
+              v-model="form.orderNo"
+              @click.native="handleSaleOrderBtn"
+              disabled
+              placeholder="自动生成"
+            />
+          </el-form-item>
+        </el-col>
+        <el-col :span="12">
+          <el-form-item
+            label="冲差类型"
+            prop="type"
+            style="margin-bottom: 22px"
+          >
+            <DictSelection
+              dictName="冲差类型"
+              clearable
+              v-model="form.type"
+              @change="handleSetReturnSourceType"
+            >
+            </DictSelection>
+          </el-form-item>
+        </el-col>
+
+        <el-col :span="12">
+          <el-form-item
+            label="冲差原因"
+            prop="entrustedReceiveCode"
+          >
+            <DictSelection
+              dictName="冲差原因"
+              clearable
+              v-model="form.type"
+              @change="handleSetReturnSourceType"
+            >
+            </DictSelection>
+          </el-form-item>
+        </el-col>
+
+        <el-col :span="12">
+          <el-form-item label="冲差方式" prop="totalAmount">
+            <DictSelection
+              dictName="冲差方式"
+              clearable
+              v-model="form.type"
+              @change="handleSetReturnSourceType"
+            >
+            </DictSelection>
+          </el-form-item>
+        </el-col>
+
+        <el-col :span="12">
+          <el-form-item
+            label="调整类型"
+            prop="redressAmount"
+          >
+            <DictSelection
+              dictName="调整类型"
+              clearable
+              v-model="form.type"
+              @change="handleSetReturnSourceType"
+            >
+            </DictSelection>
+          </el-form-item>
+        </el-col>
+        <el-col :span="12">
+          <el-form-item label="冲差范围" prop="contactName">
+            <DictSelection
+              dictName="冲差范围"
+              clearable
+              v-model="form.type"
+              @change="handleSetReturnSourceType"
+            >
+            </DictSelection>
+          </el-form-item>
+        </el-col>
+      </el-row>
+      <el-row>
+        <el-col :span="24">
+          <el-form-item label="调整说明" prop="remark">
+            <el-input
+              clearable
+              v-model="form.remark"
+              type="textarea"
+              placeholder="请输入"
+            />
+          </el-form-item>
+        </el-col>
+
+        <el-col :span="12">
+          <el-form-item prop="returnFiles" label="附件">
+            <fileMain v-model="form.returnFiles"></fileMain>
+          </el-form-item>
+        </el-col>
+      </el-row>
+      <headerTitle title="物品清单" style="margin-top: 30px"></headerTitle>
+      <inventoryTableDetails
+        ref="inventoryTableDetailsRef"
+      ></inventoryTableDetails>
+      <headerTitle
+        title="冲差信息"
+        style="margin-top: 30px"
+      ></headerTitle>
+      <inventoryTable
+        :returnType="form.returnType"
+        :returnSourceType="form.returnSourceType"
+        :entrustedCode="form.entrustedCode"
+        ref="inventoryTableref"
+        :sendId="form.sendId"
+        :sendNo="form.sendNo"
+        :type="form.type"
+        @handleSelectGoods="handleSelectGoods"
+        :orderOption="orderOption"
+      ></inventoryTable>
+      <headerTitle
+        title="实物赔偿清单"
+        v-show="['20', '40'].includes(form.type) && form.returnSourceType == 1"
+        style="margin-top: 30px"
+      ></headerTitle>
+      <inventoryTable1
+        v-show="['20', '40'].includes(form.type) && form.returnSourceType == 1"
+        ref="inventoryTableref1"
+        :customerMark="customerMark"
+        cacheKeyUrl="eos-saleManage-returnGoods-redressProductList"
+        :isOrderNo="true"
+        :orderOption="orderOption"
+      ></inventoryTable1>
+    </el-form>
+
+    <div slot="footer" class="footer">
+      <el-button type="primary" @click="save" v-click-once>保存</el-button>
+      <el-button
+        type="primary"
+        v-if="isNeed_process_is_close"
+        @click="save('sub')"
+        v-click-once
+        >提交</el-button
+      >
+      <el-button @click="cancel">返回</el-button>
+    </div>
+    <!--  销售发货单  -->
+    <sendListDialog
+      ref="sendListDialogRef"
+      @changeParent="changeOrder"
+      :contactData="contactData"
+      :saleOrderData="saleOrderData"
+    ></sendListDialog>
+    <!--  受托发货单  -->
+    <entrusted-receive-dialog
+      :entrusted-receive-dialog-flag.sync="entrustedReceiveDialogFlag"
+      :contactData="contactData"
+      :saleOrderData="saleOrderData"
+      v-if="entrustedReceiveDialogFlag"
+      @changeParent="getInfo"
+      ref="entrustedReceiveDialogRef"
+    ></entrusted-receive-dialog>
+    <!--    销售订单-->
+    <!-- <orderListDialog
+      ref="orderListDialogRef"
+      @changeParent="changeSaleOrder"
+      :contactData="contactData"
+    ></orderListDialog> -->
+    <process-submit-dialog
+      :isNotNeedProcess="false"
+      :processSubmitDialogFlag.sync="processSubmitDialogFlag"
+      v-if="processSubmitDialogFlag"
+      ref="processSubmitDialogRef"
+      @reload="reload"
+    ></process-submit-dialog>
+    <!--出库详情-->
+    <!-- <outbound-details-dialog
+      v-if="outboundDetailsDialogFlag && form.returnType != 2"
+      ref="outboundDetailsDialogRef"
+      :outboundDetailsDialogFlag.sync="outboundDetailsDialogFlag"
+      @saveDate="saveDate"
+    ></outbound-details-dialog> -->
+    <!--入库详情-->
+    <!-- <outbound-details-dialog1
+      v-if="outboundDetailsDialogFlag1"
+      ref="outboundDetailsDialogRef1"
+      :outboundDetailsDialogFlag.sync="outboundDetailsDialogFlag1"
+      @saveDate="saveDate"
+    ></outbound-details-dialog1> -->
+  </ele-modal>
+</template>
+
+<script>
+  import { numberReg } from 'ele-admin';
+  import { acceptUnpackoptions } from '@/enum/dict';
+  import fileUpload from '@/components/upload/fileUpload';
+  import dictMixins from '@/mixins/dictMixins';
+  import deptSelect from '@/components/CommomSelect/dept-select.vue';
+  import personSelect from '@/components/CommomSelect/person-select.vue';
+  import parentList from '@/views/saleManage/contact/components/parentList.vue';
+  import {
+    addReturnInformation,
+    getReturnSaleOrderrecordDetail,
+    UpdateReturnInformation
+  } from '@/api/saleManage/returnGoods';
+  import {
+    getSendSaleOrderCordList,
+    getSendSaleOrderrecordDetailSplit
+  } from '@/api/saleManage/saleordersendrecord';
+  import inventoryTable from './inventoryTable.vue';
+  // import sendListDialog from './sendListMultipleDialog.vue';
+  import { copyObj } from '@/utils/util';
+  import entrustedReceiveDialog from '@/views/saleManage/saleOrder/invoice/components/entrustedReceiveDialog.vue';
+  import { getPSaleEntrustedReceiveDetailAPI } from '@/api/saleManage/entrustedReceive';
+  import { getWarehouseListByIds } from '@/api/purchasingManage/returnGoods';
+  import fileMain from '@/components/addDoc/index.vue';
+  import processSubmitDialog from '@/BIZComponents/processSubmitDialog/processSubmitDialog.vue';
+  import orderListDialog from '@/views/saleManage/saleOrder/invoice/components/orderListDialog.vue';
+  // import outboundDetailsDialog from './outboundDetailsDialog.vue';
+  import outboundDetailsDialog1 from '@/views/saleManage/saleOrder/entrustedReceive/components/outboundDetailsDialog.vue';
+  import inventoryTable1 from '@/BIZComponents/inventoryTable.vue';
+  import inventoryTableDetails from '@/views/saleManage/saleOrder/invoice/components/inventoryTableDetails.vue';
+  import { getSendSaleOrderConfirmDetail } from '@/api/saleManage/invoiceConfirm';
+  import { contactDetail } from '@/api/saleManage/contact';
+
+  export default {
+    mixins: [dictMixins],
+    components: {
+      orderListDialog,
+      processSubmitDialog,
+      fileMain,
+      entrustedReceiveDialog,
+      fileUpload,
+      deptSelect,
+      // sendListDialog,
+      inventoryTable,
+      inventoryTable1,
+      parentList,
+      personSelect,
+      // outboundDetailsDialog,
+      outboundDetailsDialog1,
+      inventoryTableDetails
+    },
+    //客户管理数据
+    props: {
+      detailAdjustDialogFlag: {
+        type: Boolean,
+        default: false
+      },
+      contactData: {
+        type: Object,
+        default: () => {
+          return {};
+        }
+      },
+      saleOrderData: {
+        type: Object,
+        default: () => {
+          return {};
+        }
+      }
+    },
+    data() {
+      let formDef = {
+        id: '',
+        payAmount: 0,
+        returnFiles: [],
+        repliedFiles: [],
+        remark: '',
+        sendId: '',
+        sendNo: '',
+        orderId: '',
+        orderIds: '',
+        orderNo: '',
+        totalAmount: '',
+        returnType: '',
+        pricingWay: '',
+        returnSourceType: 3,
+        isOrderAll: 0,
+        entrustedCode: '',
+        entrustedId: '',
+        entrustedReceiveId: '',
+        entrustedReceiveCode: ''
+      };
+
+      return {
+        orderOption: [],
+        fullscreen: false, //全屏
+        customerMark: '',
+        oldProductList: [],
+        detailData: {},
+        payWayOptions: [],
+        delDetailIds: [],
+        linkNameOptions: [],
+        acceptUnpackoptions,
+        visible: false,
+        processSubmitDialogFlag: false,
+        outboundDetailsDialogFlag1: false,
+        title: '',
+        row: {},
+        activeName: 'base',
+        formDef,
+        form: copyObj(formDef),
+        tableBankData: [],
+        tableLinkData: [],
+        // 组织机构树形结构数据
+        groupTreeData: [],
+        groupData: [],
+        rules: {
+          returnSourceType: [
+            { required: true, message: '请选择', trigger: 'change' }
+          ],
+          sendNo: [{ required: true, message: '请选择', trigger: 'change' }],
+          payAmount: [
+            {
+              required: true,
+              pattern: numberReg,
+              message: '请输入数字',
+              trigger: 'blur'
+            }
+          ]
+        },
+        // 提交状态
+        loading: false,
+        // 是否是修改
+        isUpdate: false,
+        entrustedReceiveDialogFlag: false,
+        businessId: '',
+        orderId: '',
+        outboundDetailsDialogFlag: false,
+        productList: []
+      };
+    },
+    created() {
+      this.requestDict('产地');
+    },
+    computed: {
+      totalAmount() {
+        let allcountAmount = 0;
+        let totalAmount =
+          (this.$refs.inventoryTableref &&
+            this.$refs.inventoryTableref.totalAmount) ||
+          0;
+        if (this.form.returnSourceType == 1) {
+          if (this.form.type === '10') {
+            allcountAmount = Number(totalAmount);
+          }
+          if (this.form.type === '20') {
+            allcountAmount =
+              Number(totalAmount) +
+              Number(
+                this.$refs.inventoryTableref1 &&
+                  this.$refs.inventoryTableref1.getPrice()[0]
+              );
+          }
+          if (this.form.type === '30') {
+            allcountAmount =
+              Number(totalAmount) + Number(this.form.redressAmount || 0);
+          }
+          if (this.form.type === '40') {
+            allcountAmount =
+              this.$refs.inventoryTableref1 &&
+              this.$refs.inventoryTableref1.getPrice()[0];
+          }
+          if (this.form.type === '50') {
+            allcountAmount = Number(this.form.redressAmount || 0);
+          }
+        } else {
+          allcountAmount = Number(totalAmount);
+        }
+
+        return parseFloat(allcountAmount).toFixed(2);
+      }
+    },
+
+    methods: {
+      //删除产品
+      remove(row) {
+        if (this.form.productList.length === 1)
+          return this.$message.error('必须要留一个产品');
+        let index = this.form.productList.findIndex((n) => n.key == row.key);
+        if (index !== -1) {
+          this.form.productList.splice(index, 1);
+        }
+      },
+      onchangeLink() {
+        this.form.type = '';
+        this.handleSetReturnSourceType();
+      },
+      async contactDetail(id) {
+        const { base } = await contactDetail(id);
+        this.customerMark = base.serialNo;
+        this.$refs.inventoryTableref1.setCustomerMark(base.serialNo);
+      },
+      //设置退货类型
+      handleSetReturnSourceType(val) {
+        this.form = Object.assign({}, this.form, {
+          orderId: '',
+          orderIds: '',
+          sendNo: '',
+          orderNo: '',
+          sendId: '',
+          contactName: '',
+          contactId: '',
+          pricingWay: '',
+          entrustedCode: '',
+          entrustedId: '',
+          entrustedReceiveId: '',
+          entrustedReceiveCode: ''
+        });
+        this.$nextTick(() => {
+          this.$refs.inventoryTableref &&
+            this.$refs.inventoryTableref.putTableValue([]);
+          this.$refs.inventoryTableDetailsRef &&
+            this.$refs.inventoryTableDetailsRef.putTableValue([]);
+        });
+      },
+      //选择受托收货单弹框
+      handleEntrustedReceive(e) {
+        if (e.target.nodeName == 'I') {
+          this.form = Object.assign({}, this.form, {
+            carNo: '',
+            carId: '',
+            linkName: '',
+            linkPhone: '',
+            orderNo: '',
+            orderId: '',
+            contactId: '',
+            contactName: '',
+            entrustedCode: '',
+            entrustedId: '',
+            sendNoteNo: '',
+            pricingWay: '',
+            entrustedReceiveId: '',
+            entrustedReceiveCode: ''
+          });
+          this.$refs.inventoryTableref &&
+            this.$refs.inventoryTableref.putTableValue([]);
+          return;
+        }
+        this.entrustedReceiveDialogFlag = true;
+        this.$nextTick(() => {
+          this.$refs.entrustedReceiveDialogRef.init();
+        });
+      },
+      //获取受托收货单数据回调
+      async getInfo(row, type) {
+        if (!row.id) {
+          return;
+        }
+        const data = await getPSaleEntrustedReceiveDetailAPI(row.id);
+        if (data) {
+          this.productList = data.productList;
+          if (type) {
+            this.$refs.inventoryTableDetailsRef &&
+              this.$refs.inventoryTableDetailsRef.putTableValue(
+                data.productList.map((item) => {
+                  item['extField'] = item.extField || [];
+                  return item;
+                })
+              );
+            return;
+          }
+
+          this.getOrderOption(data);
+          this.$nextTick(() => {
+            let { code, id, productList, contactId, contactName } = data;
+            if (productList && productList.length > 0) {
+              productList.forEach((v) => {
+                v.orderTotalCount = v.orderTotalCount || v.totalCount;
+              });
+            }
+            this.form = Object.assign({}, this.form, {
+              orderId: data.orderId,
+              orderIds: data.orderIds,
+              sendNo: '',
+              sendId: '',
+              contactName,
+              contactId,
+              entrustedCode: code,
+              entrustedId: id,
+              entrustedReceiveId: id,
+              entrustedReceiveCode: code
+            });
+            this.handleSelectGoods();
+
+            this.$refs.inventoryTableDetailsRef &&
+              this.$refs.inventoryTableDetailsRef.putTableValue(
+                data.productList.map((item) => {
+                  item['extField'] = item.extField || [];
+                  return item;
+                })
+              );
+          });
+        }
+      },
+      //选择发货单回调
+      changeOrder(obj = {}) {
+        this.getSendSaleOrderMultipleDetail(obj);
+      },
+      //多发货单详情
+      async getSendSaleOrderMultipleDetail(params) {
+        this.loading = true;
+        this.productList = [];
+        let data = {},
+          res = {};
+        this.$refs.inventoryTableref &&
+          this.$refs.inventoryTableref.putTableValue([]);
+        this.$refs.inventoryTableref1 &&
+          this.$refs.inventoryTableref1.putTableValue({
+            productList: []
+          });
+        if (params.activeName == 1) {
+          data = await getSendSaleOrderrecordDetailSplit(params.id);
+        } else {
+          res = await getSendSaleOrderConfirmDetail(params.id);
+          data = await getSendSaleOrderrecordDetailSplit(res.sendId);
+        }
+        this.loading = false;
+        if (data) {
+          this.getOrderOption(data);
+
+          this.$nextTick(() => {
+            this.setForm(data);
+            if (params.activeName == 2) {
+              this.productList = data.productList;
+              res.productList.forEach((item) => {
+                item['orderId'] = this.orderOption[0]?.orderId;
+                item['orderNo'] = this.orderOption[0]?.orderNo;
+              });
+
+              this.$refs.inventoryTableref &&
+                this.$refs.inventoryTableref.putTableValue(res.productList);
+              this.$refs.inventoryTableDetailsRef &&
+                this.$refs.inventoryTableDetailsRef.putTableValue(
+                  data.productList
+                );
+              return;
+            }
+            this.productList = data.productList;
+            if (
+              !['40', '50'].includes(this.form.type) ||
+              this.form.returnSourceType != 1
+            ) {
+              this.handleSelectGoods();
+            }
+
+            this.$refs.inventoryTableDetailsRef &&
+              this.$refs.inventoryTableDetailsRef.putTableValue(
+                data.productList
+              );
+          });
+        }
+      },
+      setForm(data) {
+        data.productList.forEach((item) => {
+          item.sendProductId = item.id;
+          item.id = '';
+        });
+        if (data.contactId) {
+          this.contactDetail(data.contactId);
+        }
+        this.form = Object.assign({}, this.form, {
+          orderIds: data.orderIds || data.orderId,
+          sendNo: data.docNo,
+          orderNo: data.orderNo,
+          sendId: data.id,
+          contactName: data.contactName,
+          contactId: data.contactId,
+          entrustedCode: data.entrustedCode,
+          entrustedId: data.entrustedCode,
+          entrustedReceiveId: '',
+          entrustedReceiveCode: ''
+        });
+      },
+      getOrderOption(data) {
+        if (data.orderIds) {
+          this.orderOption = data.orderIds.split(',').map((item, index) => {
+            return {
+              orderId: item,
+              orderNo: data.orderNo.split(',')[index]
+            };
+          });
+        } else {
+          this.orderOption = [
+            {
+              orderId: data.orderId,
+              orderNo: data.orderNo
+            }
+          ];
+        }
+      },
+      //选择退货明细
+      handleSelectGoods(list) {
+        if (this.form.returnSourceType != 2) {
+          this.outboundDetailsDialogFlag = true;
+        } else {
+          this.outboundDetailsDialogFlag1 = true;
+        }
+        this.$nextTick(() => {
+          if (this.form.returnSourceType != 2) {
+            this.$refs.outboundDetailsDialogRef.init(this.form, list);
+          } else {
+            this.$refs.outboundDetailsDialogRef1.init(this.form, list);
+          }
+        });
+      },
+      saveDate(data) {
+        data.forEach((item, index) => {
+          // item['totalCount'] = item.measureQuantity;
+          this.$set(data[index], 'totalCount', item.measureQuantity);
+          item['orderId'] = this.orderOption[0]?.orderId;
+          item['orderNo'] = this.orderOption[0]?.orderNo;
+
+          this.productList.forEach((val) => {
+            if (item.productCode == val.productCode) {
+              item['singlePrice'] = val.singlePrice;
+              item['clientCode'] = item.clientCode || val.customerMark;
+              item['notaxSinglePrice'] = val.notaxSinglePrice;
+              item['taxRate'] = val.taxRate;
+              item['goodsLevel'] = val.goodsLevel;
+              item['goodsId'] = val.goodsId;
+              item['goodsPriceId'] = val.goodsPriceId;
+              item['goodsPriceType'] = val.goodsPriceType;
+            }
+          });
+        });
+        this.$refs.inventoryTableref &&
+          this.$refs.inventoryTableref.putTableValue(data);
+      },
+      //发货单详情
+      async getSendSaleOrderDetail(id, type) {
+        this.loading = true;
+        const data = await getSendSaleOrderrecordDetailSplit(id);
+
+        this.getOrderOption(data);
+
+        this.productList = data.productList;
+        this.$nextTick(() => {
+          this.$refs.inventoryTableDetailsRef &&
+            this.$refs.inventoryTableDetailsRef.putTableValue(data.productList);
+        });
+
+        if (type) return;
+        // if (data.entrustedCode) {
+        //   this.form.returnSourceType = 2;
+        //   await this.getInfo({ id: data.entrustedId });
+
+        //   this.loading = false;
+        //   return;
+        // }
+        this.loading = false;
+        if (data) {
+          this.$nextTick(() => {
+            this.setForm(data);
+            this.handleSelectGoods();
+          });
+        }
+      },
+
+      //获取退货单详情
+      async getReturnSaleOrderrecordDetail(id) {
+        this.businessId = id;
+
+        this.loading = true;
+        const data = await getReturnSaleOrderrecordDetail(id);
+        this.loading = false;
+        if (data) {
+          this.form = data;
+          this.orderOption = data.returnOrderList;
+          this.form.entrustedCode = data?.entrustedReceiveCode;
+          this.form.entrustedId = data?.entrustedReceiveId;
+          this.$nextTick(() => {
+            this.$refs.inventoryTableref &&
+              this.$refs.inventoryTableref.putTableValue(data.productList);
+            this.$refs.inventoryTableref1 &&
+              this.$refs.inventoryTableref1.putTableValue({
+                productList: data.redressProductList
+              });
+            if (this.form.returnSourceType != 2) {
+              this.getSendSaleOrderDetail(data.sendId, 1);
+            } else {
+              this.getInfo({ id: data.entrustedReceiveId }, 1);
+            }
+          });
+        }
+      },
+
+      //选择订单弹框
+      handleOrderBtn() {
+        let item = {
+          id: this.form.sendId
+        };
+        this.$refs.sendListDialogRef.open(item);
+      },
+      handleSaleOrderBtn() {
+        let item = {
+          id: this.form.orderId
+        };
+        this.$refs.orderListDialogRef.open(item);
+      },
+
+      //打开新增编辑弹框
+      async open(type, row, sendId, isEntrustedReceive) {
+        this.title = type === 'add' ? '新增' : '修改';
+        this.row = row;
+        this.visible = true;
+        this.$store.commit('returnGoods/clearUserData');
+        if (type === 'add') {
+          this.$store.commit('returnGoods/setIsDefaultPayableAmount', false); // 设置标志变量为 false,应付金额将跟随订单金额同步
+        }
+        if (row && row?.id) {
+          await this.getReturnSaleOrderrecordDetail(row?.id);
+        }
+        if (sendId && !isEntrustedReceive) {
+          await this.getSendSaleOrderDetail(sendId);
+        }
+        if (sendId && isEntrustedReceive) {
+          this.form.returnSourceType = 2;
+          await this.getInfo({ id: sendId });
+        }
+        this.isUpdate = type != 'add';
+      },
+
+      salesmanChange(val, info) {
+        this.otherForm.salesmanName = info.name;
+      },
+      settlementModeChange(info) {
+        this.form.settlementModeName = info.dictValue;
+      },
+      ifChiefChange(value, idx) {
+        if (value === 1) {
+          this.tableLinkData.forEach((e) => (e.ifChief = 0));
+          this.tableLinkData[idx].ifChief = 1;
+        }
+      },
+
+      getValidate() {
+        let proAll = [
+          new Promise((resolve, reject) => {
+            this.$refs.form.validate((valid) => {
+              if (!valid) {
+                reject(false);
+              } else {
+                resolve(true);
+              }
+            });
+          })
+        ];
+        if (
+          !['40', '50'].includes(this.form.type) ||
+          this.form.returnSourceType != 1
+        ) {
+          proAll.push(
+            new Promise((resolve, reject) => {
+              this.$refs.inventoryTableref.validateForm((valid) => {
+                if (!valid) {
+                  reject(false);
+                } else {
+                  resolve(true);
+                }
+              });
+            })
+          );
+        }
+        return Promise.all(proAll);
+      },
+      async save(type) {
+        try {
+          await this.getValidate();
+          // 表单验证通过,执行保存操作
+          this.loading = true;
+
+          if (!this.isUpdate) {
+            delete this.form.id;
+          }
+          let data = this.$refs.inventoryTableref.getTableValue();
+          let redressProductList =
+            (this.$refs.inventoryTableref1 &&
+              this.$refs.inventoryTableref1.getTableValue()) ||
+            [];
+
+          if (
+            data.productList.length === 0 &&
+            (!['40', '50'].includes(this.form.type) ||
+              this.form.returnSourceType != 1)
+          ) {
+            return this.$message.error('至少选择一个退货产品');
+          }
+          let orderIds = [...data.productList, ...redressProductList].map(
+            (item) => item.orderId
+          );
+          let orderNos = [...data.productList, ...redressProductList].map(
+            (item) => item.orderNo
+          );
+
+          this.form.repliedFiles = this.form.repliedFiles || [];
+          this.form.replied = this.form.repliedFiles.length > 0 ? 1 : 0;
+          this.form.typeName = this.getDictValue('退货类型', this.form.type);
+          let commitData = Object.assign({}, this.form, {
+            totalAmount: this.totalAmount,
+            productList: data.productList,
+            payAmount: this.totalAmount,
+            redressProductList,
+            returnOrderList: this.orderOption
+          });
+          let productListData = [];
+          data.productList.forEach((item) => {
+            if (!item.totalCount) {
+              productListData.push(item.productName);
+            }
+          });
+          console.log(productListData);
+          if (productListData.length) {
+            return this.$message.error(
+              productListData.toString() + ' 退货数量不能为空!'
+            );
+          }
+          if (orderIds?.length) {
+            commitData.orderIds = Array.from(new Set(orderIds)).toString();
+          }
+          if (orderNos?.length) {
+            commitData.orderNo = Array.from(new Set(orderNos)).toString();
+          }
+          // return;
+          if (this.isUpdate) {
+            UpdateReturnInformation(commitData)
+              .then(async (res) => {
+                this.loading = false;
+
+                this.$message.success('修改成功');
+                if (type === 'sub') {
+                  let storemanIds = '';
+                  let ids = commitData.productList.map(
+                    (item) => item.warehouseId
+                  );
+                  let warehouseList = await getWarehouseListByIds(ids || []);
+                  storemanIds = warehouseList.map((item) => item.ownerId);
+                  await this.returnSubmit(res, storemanIds.toString());
+                  return;
+                }
+                this.cancel();
+                this.$emit('done');
+              })
+              .catch((e) => {
+                //this.loading = false;
+              });
+          } else {
+            addReturnInformation(commitData)
+              .then(async (res) => {
+                this.loading = false;
+                this.$message.success('新增成功');
+                if (type === 'sub') {
+                  let storemanIds = '';
+                  let ids = commitData.productList.map(
+                    (item) => item.warehouseId
+                  );
+                  let warehouseList = await getWarehouseListByIds(ids || []);
+                  storemanIds = warehouseList.map((item) => item.ownerId);
+                  this.returnSubmit(res, storemanIds.toString());
+                  this.$emit('done');
+                  return;
+                }
+                this.cancel();
+                this.$emit('done');
+              })
+              .catch((e) => {
+                //this.loading = false;
+              });
+          }
+        } catch (error) {
+          console.log(error);
+          // 表单验证未通过,不执行保存操作
+        }
+      },
+      async returnSubmit(res, storemanIds) {
+        const data = await getReturnSaleOrderrecordDetail(
+          this.businessId || res
+        );
+        this.processSubmitDialogFlag = true;
+
+        this.$nextTick(() => {
+          let params = {
+            businessId: this.businessId || res,
+            businessKey:
+              this.form.returnSourceType == 1
+                ? 'sale_return_approve1'
+                : this.form.returnSourceType == 2
+                ? 'sale_entrusted_receive_return_approve'
+                : 'sales_return_approve',
+            formCreateUserId: data.createUserId,
+            variables: {
+              returnSourceType: data.returnSourceType,
+              storemanIds: storemanIds.toString(),
+              businessCode: data.returnNo,
+              businessName: data.contactName,
+              businessType:
+                data.returnSourceType == 1
+                  ? '售后退货'
+                  : data.returnSourceType == 3
+                  ? '销售发货退货'
+                  : data.returnSourceType == 2
+                  ? '受托收货退货'
+                  : '销售订单退货'
+            }
+          };
+
+          this.$refs.processSubmitDialogRef.init(params);
+        });
+      },
+      reload() {
+        this.cancel();
+        this.$emit('done');
+      },
+      cancel() {
+        this.$nextTick(() => {
+          this.activeName = 'base';
+          // 关闭后,销毁所有的表单数据
+          this.$refs['otherForm'] && this.$refs['otherForm'].resetFields();
+          this.$refs['formRef'] && this.$refs['formRef'].resetFields();
+          this.$store.commit('order/clearUserData');
+          this.form = copyObj(this.formDef);
+          // 通过$emit更新父组件中的detailAdjustDialogFlag值,避免直接修改prop
+          this.$emit('update:detailAdjustDialogFlag', false);
+        });
+      }
+    }
+  };
+</script>
+<style scoped lang="scss">
+  .TotalAmount {
+    font-size: 16px;
+    padding-right: 30px;
+  }
+
+  .headbox {
+    display: flex;
+    justify-content: flex-start;
+    align-items: center;
+
+    .amount {
+      font-size: 14px;
+      font-weight: bold;
+      margin-right: 20px;
+    }
+  }
+</style>

+ 924 - 0
src/views/saleManage/saleOrder/adjustmentNote‌/components/inventoryTable.vue

@@ -0,0 +1,924 @@
+<template>
+  <el-form ref="form" :model="form" :rules="rules">
+    <ele-pro-table
+      ref="table"
+      :needPage="false"
+      :columns="columns"
+      :datasource="form.datasource"
+      @columns-change="handleColumnChange"
+      :cache-key="cacheKeyUrl"
+      class="time-form"
+      :maxHeight="250"
+    >
+      <!-- 表头工具栏 -->
+      <template v-slot:toolbar>
+        <div
+          class="headbox"
+          :style="{
+            justifyContent: type != '10' ? 'space-between' : 'flex-end'
+          }"
+        >
+          <el-button
+            size="small"
+            type="primary"
+            icon="el-icon-plus"
+            class="ele-btn-icon"
+            @click="handlAdd"
+            v-if="type != '10'"
+            >新增
+          </el-button>
+          <div class="pricebox">
+            <span class="amount">总金额{{ totalAmount }}元</span>
+          </div>
+        </div>
+      </template>
+
+      <template v-slot:orderNo="{ row, $index }">
+        <el-form-item :prop="'datasource.' + $index + '.orderNo'">
+          <el-select v-model="row.orderNo" style="width: 100%">
+            <el-option
+              :label="item.orderNo"
+              :value="item.orderNo"
+              @click.native="orderNoChange(row, item)"
+              v-for="(item, index) in orderOption"
+              :key="index"
+            ></el-option>
+          </el-select>
+        </el-form-item>
+      </template>
+
+      <!--   发货总重   -->
+      <template v-slot:sendTotalWeight="scope">
+        <el-form-item
+          style="margin-bottom: 20px"
+          :prop="'datasource.' + scope.$index + '.sendTotalWeight'"
+          :rules="[
+            {
+              required: pricingWay == 2 && [3, 1].includes(returnSourceType),
+              message: '请输入数字',
+              trigger: 'blur'
+            }
+          ]"
+        >
+          <el-input
+            v-model="scope.row.sendTotalWeight"
+            @blur="changeSendTotalWeight(scope.$index)"
+            :disabled="returnSourceType == 2"
+            style="width: 60%; margin-right: 10px"
+          >
+          </el-input>
+          <el-button
+            size="small"
+            type="primary"
+            v-if="[3, 1].includes(returnSourceType)"
+            @click.native="(e) => handleOutBound(e, scope.row, scope.$index)"
+            >选择
+          </el-button>
+        </el-form-item>
+      </template>
+
+      <!--        3. 按重量 发货总重必填
+
+                   按数量 发货总重不必填
+
+                   如果选择的订单是受托:
+                   按重量 收货总重必填且可以选择
+                   按数量 收货总重不必填且可以选择
+                   如果不是收货总重置灰
+
+                   -->
+      <!--        1. 按重量 发货总重必填
+             按数量 发货总重不必填
+              如果选择的订单是受托:
+             按重量 收货总重必填且可以选择
+             按数量 收货总重不必填且可以选择
+             如果不是收货总重置灰
+               -->
+
+      <!--        2. 按重量/按数量 发货总重置灰
+                   按重量 收货总必填     -->
+      <!--   收货总重   -->
+      <template v-slot:receiveTotalWeight="scope">
+        <el-form-item
+          style="margin-bottom: 20px"
+          :prop="'datasource.' + scope.$index + '.receiveTotalWeight'"
+          :rules="[
+            {
+              required:
+                (entrustedCode || returnSourceType == 2) && pricingWay == 2,
+              message: '请输入数字',
+              trigger: 'blur'
+            }
+          ]"
+        >
+          <el-input
+            v-model="scope.row.receiveTotalWeight"
+            :disabled="[3, 1].includes(returnSourceType) && !entrustedCode"
+            @blur="changeReceiveTotalWeight(scope.$index)"
+            style="width: 60%; margin-right: 10px"
+          >
+          </el-input>
+          <el-button
+            size="small"
+            type="primary"
+            v-if="entrustedCode || returnSourceType == 2"
+            @click.native="(e) => handleInnerBound(e, scope.row, scope.$index)"
+            >选择
+          </el-button>
+        </el-form-item>
+      </template>
+      <template v-slot:technicalDrawings="{ row, $index }">
+        <el-form-item
+          style="margin-bottom: 20px"
+          :prop="'datasource.' + $index + '.technicalDrawings'"
+        >
+          <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>
+        </el-form-item>
+      </template>
+      <template v-slot:returnReason="{ row, $index }">
+        <el-form-item
+          style="margin-bottom: 20px"
+          :prop="'datasource.' + $index + '.returnReason'"
+        >
+          <el-input
+            clearable
+            v-model="row.returnReason"
+            type="textarea"
+            placeholder="请输入"
+          />
+        </el-form-item>
+      </template>
+      <template v-slot:remark="{ row, $index }">
+        <el-form-item
+          style="margin-bottom: 20px"
+          :prop="'datasource.' + $index + '.remark'"
+        >
+          <el-input
+            clearable
+            v-model="row.remark"
+            type="textarea"
+            placeholder="请输入"
+          />
+        </el-form-item>
+      </template>
+
+      <template v-slot:totalCount="scope">
+        <el-form-item
+          style="margin-bottom: 20px"
+          :prop="'datasource.' + scope.$index + '.totalCount'"
+          :rules="[{ required: true, message: '请输入数字', trigger: 'blur' }]"
+        >
+          <el-input
+            v-model="scope.row.totalCount"
+            type="number"
+            @input="changeNum(scope.row, scope.$index)"
+          ></el-input>
+        </el-form-item>
+      </template>
+
+      <template v-slot:totalPrice="{ row, $index }">
+        <el-form-item
+          v-if="row.pricingWay == 2"
+          :prop="'datasource.' + $index + '.totalPrice'"
+        >
+          <el-input
+            type="number"
+            v-model="row.totalPrice"
+            placeholder="请输入"
+          />
+        </el-form-item>
+        <span v-else>{{ row.totalPrice }}</span>
+      </template>
+      <template v-slot:notaxSinglePrice="scope">
+        <el-form-item
+          style="margin-bottom: 20px"
+          :prop="'datasource.' + scope.$index + '.notaxSinglePrice'"
+        >
+          <el-input
+            v-model="scope.row.notaxSinglePrice"
+            placeholder="请输入"
+            type="number"
+          >
+            <template slot="append">元</template>
+          </el-input>
+        </el-form-item>
+      </template>
+      <template v-slot:headerTotalCount="{ column }">
+        <span class="is-required">{{ column.label }}</span>
+      </template>
+
+      <template v-slot:headerSendTotalWeight="{ column }">
+        <span
+          :class="{
+            'is-required': pricingWay == 2 && [3, 1].includes(returnSourceType)
+          }"
+          >{{ column.label }}</span
+        >
+      </template>
+      <template v-slot:headerReceiveTotalWeight="{ column }">
+        <span
+          :class="{
+            'is-required':
+              (entrustedCode || returnSourceType == 2) && pricingWay == 2
+          }"
+          >{{ column.label }}</span
+        >
+      </template>
+
+      <!-- 操作列 -->
+
+      <template v-slot:action="{ $index }">
+        <el-popconfirm
+          v-if="type != '10'"
+          class="ele-action"
+          title="确定要删除吗?"
+          @confirm="remove($index)"
+        >
+          <template v-slot:reference>
+            <el-link type="danger" :underline="false" icon="el-icon-delete">
+              删除
+            </el-link>
+          </template>
+        </el-popconfirm>
+      </template>
+    </ele-pro-table>
+
+    <product-list
+      ref="productListRef"
+      :orderId="sendId"
+      type="send"
+      @changeParent="changeParent"
+    ></product-list>
+    <!--出库详情-->
+    <outbound-details-dialog
+      v-if="outboundDetailsDialogFlag"
+      ref="outboundDetailsDialogRef"
+      :outboundDetailsDialogFlag.sync="outboundDetailsDialogFlag"
+      @saveDate="saveDate"
+    ></outbound-details-dialog>
+    <!--入库详情-->
+    <innertboundDetailsDialog
+      v-if="innerboundDetailsDialogFlag"
+      ref="innerboundDetailsDialogRef"
+      :innerboundDetailsDialogFlag.sync="innerboundDetailsDialogFlag"
+      @saveDate="saveInnerDate"
+    ></innertboundDetailsDialog>
+  </el-form>
+</template>
+<script>
+  import { numberReg } from 'ele-admin';
+  import dictMixins from '@/mixins/dictMixins';
+  import productList from '@/views/saleManage/saleOrder/invoice/components/product-list.vue';
+  import { getFile } from '@/api/system/file';
+  import outboundDetailsDialog from '@/views/purchasingManage/purchaseOrder/invoice/components/outboundDetailsDialog.vue';
+  import innertboundDetailsDialog from '@/views/purchasingManage/purchaseOrder/returnGoods/components/innerboundDetailsDialog.vue';
+  import tabMixins from '@/mixins/tableColumnsMixin';
+  import { levelList } from '@/enum/dict.js';
+
+  export default {
+    mixins: [dictMixins, tabMixins],
+    props: {
+      sendId: String,
+      pricingWay: {
+        default: 1,
+        type: [Number, String]
+      },
+      returnSourceType: [Number, String],
+      entrustedCode: [Number, String],
+      sendNo: [Number, String],
+      returnType: {
+        default: ''
+      },
+      type: {
+        default: ''
+      },
+      orderOption: {
+        default: () => {
+          return [];
+        }
+      }
+    },
+
+    components: {
+      innertboundDetailsDialog,
+      outboundDetailsDialog,
+      productList
+    },
+    data() {
+      const defaultForm = {
+        key: null,
+        endTime: '',
+        isFirst: 0,
+        name: '',
+        startTime: '',
+        workHour: '',
+        technicalDrawings: []
+      };
+      return {
+        cacheKeyUrl: 'eos-saleManage-returnorder-inventoryTable',
+        payAmount: '',
+        outboundDetailsDialogFlag: false,
+        innerboundDetailsDialogFlag: false,
+        numberReg,
+        defaultForm,
+        form: {
+          datasource: []
+        },
+        rules: {},
+        oldSendTotalWeightList: [],
+
+        columns: [
+          {
+            width: 45,
+            type: 'index',
+            columnKey: 'index',
+            align: 'center',
+            fixed: 'left'
+          },
+          {
+            minWidth: 200,
+            prop: 'orderNo',
+            slot: 'orderNo',
+            label: '订单编码',
+            showOverflowTooltip: true,
+            align: 'center'
+          },
+          {
+            minWidth: 160,
+            prop: 'productCode',
+            label: '编码',
+            showOverflowTooltip: true,
+            align: 'center'
+          },
+          {
+            minWidth: 120,
+            prop: 'productName',
+            label: '名称',
+            showOverflowTooltip: true,
+            align: 'center'
+          },
+
+          {
+            minWidth: 160,
+            prop: 'batchNo',
+            label: '批次号',
+            showOverflowTooltip: true,
+            slot: 'batchNo',
+            align: 'center'
+          },
+          {
+            minWidth: 160,
+            prop: 'barcodes',
+            label: '发货条码',
+            showOverflowTooltip: true,
+            slot: 'barcodes',
+            align: 'center'
+          },
+          {
+            minWidth: 120,
+            prop: 'materielDesignation',
+            label: '物料代号',
+            showOverflowTooltip: true,
+            align: 'center'
+          },
+          {
+            minWidth: 120,
+            prop: 'clientCode',
+            label: '客户代号',
+            showOverflowTooltip: true,
+            align: 'center'
+          },
+          {
+            minWidth: 120,
+            prop: 'engrave',
+            label: '刻码',
+            showOverflowTooltip: true,
+            align: 'center'
+          },
+          {
+            minWidth: 160,
+            prop: 'packageNo',
+            align: 'center',
+            label: '包装编码',
+            showOverflowTooltip: true
+          },
+          {
+            minWidth: 100,
+            prop: 'packingQuantity',
+            align: 'center',
+            label: '包装数量',
+            showOverflowTooltip: true
+          },
+          {
+            minWidth: 120,
+            prop: 'packingUnit',
+            align: 'center',
+            label: '包装单位',
+            showOverflowTooltip: true
+          },
+          {
+            minWidth: 150,
+            prop: 'totalCount',
+            slot: 'totalCount',
+            label: '退货数量',
+            showOverflowTooltip: true,
+            align: 'center'
+          },
+          {
+            minWidth: 150,
+            prop: 'measuringUnit',
+            label: '计量单位',
+            showOverflowTooltip: true,
+            align: 'center'
+          },
+          // {
+          //   width: 160,
+          //   prop: 'pricingWay',
+          //   label: '计价方式',
+          //   slot: 'pricingWay',
+          //   align: 'center',
+          //   formatter: (row, column) => {
+          //     return row.pricingWay == 1
+          //       ? '按数量计费'
+          //       : row.pricingWay == 2
+          //       ? '按重量计费'
+          //       : '';
+          //   }
+          // },
+          {
+            width: 160,
+            prop: 'goodsPriceType',
+            label: '价格类型',
+            formatter: (row, column) => {
+              return this.getDictValue('商品价格类型', row.goodsPriceType);
+            },
+            align: 'center'
+          },
+          {
+            width: 100,
+            prop: 'singlePrice',
+            label: '单价',
+            slot: 'singlePrice',
+            align: 'center'
+          },
+          {
+            width: 160,
+            prop: 'taxRate',
+            label: '税率',
+            formatter: (row, column) => {
+              return row.taxRate ? row.taxRate + '%' : '';
+            },
+            align: 'center'
+          },
+          {
+            width: 180,
+            prop: 'notaxSinglePrice',
+            label: '不含税单价',
+            // slot: 'notaxSinglePrice',
+            align: 'center'
+          },
+          {
+            width: 120,
+            prop: 'totalPrice',
+            slot: 'totalPrice',
+            label: '合计',
+            align: 'center'
+          },
+          // {
+          //   minWidth: 80,
+          //   prop: 'weight',
+          //   label: '重量',
+          //   showOverflowTooltip: true,
+          //   align: 'center'
+          // },
+          {
+            minWidth: 120,
+            prop: 'receiveTotalWeight',
+            label: '重量',
+            // slot: 'singleWeight',
+            showOverflowTooltip: true,
+            align: 'center'
+          },
+          {
+            minWidth: 100,
+            prop: 'weightUnit',
+            label: '重量单位',
+            showOverflowTooltip: true,
+            align: 'center'
+          },
+          {
+            prop: 'provenance',
+            label: '产地',
+            slot: 'provenance',
+            align: 'center',
+            minWidth: 200,
+            showOverflowTooltip: true,
+            formatter: (row, column) => {
+              return row.provenance && row.provenance.length
+                ? row.provenance
+                    .map((item) => this.getDictValue('产地', item))
+                    .join(',')
+                : '';
+            }
+          },
+
+          {
+            minWidth: 100,
+            prop: 'renturnType',
+            label: '状态',
+            showOverflowTooltip: true,
+            align: 'center'
+          },
+          {
+            minWidth: 120,
+            prop: 'goodsLevel',
+            label: '物品级别',
+            formatter: (_row, _column, cellValue) => {
+              return levelList.find((item) => item.value == _row.goodsLevel)
+                ?.label;
+            },
+            align: 'center'
+          },
+          {
+            minWidth: 200,
+            prop: 'returnReason',
+            label: '退货原因',
+            slot: 'returnReason',
+            align: 'center'
+          },
+
+          {
+            width: 220,
+            prop: 'remark',
+            label: '备注',
+            slot: 'remark',
+            align: 'center'
+          },
+          {
+            columnKey: 'action',
+            label: '操作',
+            width: 120,
+            align: 'center',
+            resizable: false,
+            slot: 'action',
+            fixed: 'right',
+            showOverflowTooltip: true
+          }
+        ]
+      };
+    },
+    created() {
+      this.requestDict('产地');
+      this.requestDict('商品价格类型');
+    },
+    computed: {
+      totalAmount() {
+        let num = 0;
+        this.form.datasource.forEach((item, index) => {
+          this.$set(
+            this.form.datasource[index],
+            'totalPrice',
+            item.singlePrice * item.totalCount || 0
+          );
+          num += this.form.datasource[index].totalPrice;
+        });
+        return parseFloat(num).toFixed(2);
+      }
+    },
+    mounted() {
+      console.log(this.entrustedCode);
+    },
+    methods: {
+      // downloadFile(file) {
+      //   getFile({ objectName: file.storePath }, file.name);
+      // },
+
+      //出库单详情
+      handleOutBound(e, rows, index) {
+        this.curIndex = index;
+        this.outboundDetailsDialogFlag = true;
+        this.$nextTick(() => {
+          let row = {
+            sendNo: this.entrustedCode || this.sendNo,
+            productCode: rows.productCode
+          };
+          this.$refs.outboundDetailsDialogRef.init(row);
+        });
+      },
+      //选择退货信息回调
+      saveDate(data = []) {
+        let totalWeight = data.reduce((num, row) => {
+          num += Number(row.weight);
+          return num;
+        }, 0);
+        this.$set(
+          this.form.datasource[this.curIndex],
+          'sendTotalWeight',
+          totalWeight
+        );
+        this.setIcreaseTotalWeight();
+      },
+
+      //入库单详情
+      handleInnerBound(e, rows, index) {
+        this.curIndex = index;
+        this.innerboundDetailsDialogFlag = true;
+        this.$nextTick(() => {
+          let row = {
+            sendNo: this.entrustedCode,
+            productCode: rows.productCode
+          };
+          this.$refs.innerboundDetailsDialogRef.init(row);
+        });
+      },
+      //选择入库单信息
+      saveInnerDate(data = []) {
+        let totalWeight = data.reduce((num, row) => {
+          num += Number(row.weight);
+          return num;
+        }, 0);
+        this.$set(
+          this.form.datasource[this.curIndex],
+          'receiveTotalWeight',
+          totalWeight
+        );
+        if (this.returnSourceType == 2)
+          this.$set(
+            this.form.datasource[this.curIndex],
+            'sendTotalWeight',
+            totalWeight
+          );
+        this.setIcreaseTotalWeight();
+      },
+      //修改发货总重
+      changeSendTotalWeight(index) {
+        this.curIndex = index;
+        this.setIcreaseTotalWeight();
+      },
+      //修改收货总重
+      changeReceiveTotalWeight(index) {
+        this.curIndex = index;
+        if (this.returnSourceType == 2)
+          this.form.datasource[this.curIndex].sendTotalWeight =
+            this.form.datasource[this.curIndex].receiveTotalWeight;
+        this.setIcreaseTotalWeight();
+      },
+      //设置增重总重
+      setIcreaseTotalWeight() {
+        let sendTotalWeight = Number(
+          this.form.datasource[this.curIndex].sendTotalWeight
+        );
+        let receiveTotalWeight = Number(
+          this.form.datasource[this.curIndex].receiveTotalWeight
+        );
+        // if (this.entrustedCode) {
+        if (this.pricingWay == 2) {
+          if (isNaN(receiveTotalWeight) || isNaN(sendTotalWeight)) {
+            return this.$set(
+              this.form.datasource[this.curIndex],
+              'increaseTotalWeight',
+              ''
+            );
+          } else {
+            this.$set(
+              this.form.datasource[this.curIndex],
+              'increaseTotalWeight',
+              (sendTotalWeight - receiveTotalWeight).toFixed(2)
+            );
+          }
+        } else {
+          this.$set(
+            this.form.datasource[this.curIndex],
+            'increaseTotalWeight',
+            (sendTotalWeight - receiveTotalWeight).toFixed(2)
+          );
+        }
+        // } else {
+        //   this.$set(this.form.datasource[this.curIndex], 'increaseTotalWeight', sendTotalWeight);
+        // }
+        // if (this.pricingWay == 2) {
+        //   this.getWeightPrice();
+        // }
+        this.$refs.table.reload();
+      },
+      changeNum(row, index) {
+        if (row.totalCount && row.singlePrice) {
+          this.$set(
+            this.form.datasource[index],
+            'totalPrice',
+            row.totalCount * row.singlePrice
+          );
+        }
+      },
+      //获取订单总金额
+      gettotalAmount() {
+        let productData = this.form.datasource;
+        if (productData.length) {
+          let sum = productData
+            .reduce((sum, item) => {
+              return sum + Number(item.totalPrice);
+            }, 0)
+            .toFixed(2);
+          this.payAmount = productData
+            .reduce((sum, item) => {
+              return sum + Number(item.discountTotalPrice);
+            }, 0)
+            .toFixed(2);
+          // this.$emit('update:payAmount', this.payAmount);
+          // this.$store.commit('returnGoods/setAllcountAmount', sum);
+        } else {
+          // this.$store.commit('returnGoods/setAllcountAmount', 0);
+        }
+      },
+      orderNoChange(row, item) {
+        row['orderId'] = item.orderId;
+      },
+      //选择产品回调
+      async changeParent(obj, idx) {
+        console.log(obj, '9999');
+        obj.sendTotalCount = obj.totalCount;
+        obj.sendProductId = obj.id;
+        obj.id = '';
+
+        // if (obj.warehouseId) {
+        //   obj['warehouseNum'] = await getWarehouseOutStock({
+        //     warehouseId: obj.warehouseId,
+        //     code: obj.productCode
+        //   });
+        // }
+        this.$set(this.form.datasource, this.form.datasource.length, obj);
+      },
+      // validateTotalCount(row) {
+      //   return (rule, value, callback) => {
+      //     if (isNaN(value) || Number(value) <= 0) {
+      //       this.$message.error('请输入大于0的数');
+      //       callback(new Error('请输入大于0的数字'));
+      //     } else if (Number(value) > row.sendTotalCount) {
+      //       this.$message.error('输入的数字不能大于最大发货值');
+      //       callback(new Error('输入的数字不能大于最大发货值'));
+      //     } else {
+      //       callback();
+      //     }
+      //   };
+      // },
+      getTotalCount(row) {
+        let num = 0;
+        this.form.datasource
+          .filter((item) => item.warehouseId == row.warehouseId)
+          .forEach((item) => {
+            num += Number(item.totalCount);
+          });
+
+        return num;
+      },
+      // 返回列表数据
+      getTableValue() {
+        let is = false;
+        this.form.datasource.forEach((item) => {
+          if (item.pricingWay == 2 && !item.totalPrice) {
+            is = true;
+          }
+        });
+        if (is) {
+          this.$message.error('合计金额不能为空');
+          return;
+        }
+        let comitDatasource = this.form.datasource;
+        if (comitDatasource.length === 0) return { productList: [] };
+        comitDatasource.forEach((v) => {
+          v.totalCount = Number(v.totalCount);
+          v.technicalDrawings = Array.isArray(v.technicalDrawings)
+            ? v.technicalDrawings
+            : [];
+        });
+        return { productList: comitDatasource, payAmount: this.totalAmount };
+      },
+      getPrice() {
+        return [this.allPrice];
+      },
+
+      //修改回显
+      putTableValue(data) {
+        if (data) {
+          data.forEach((v) => {
+            // v.returnReason = v.returnReason || '';
+            // v.returnType = '';
+            v.sendTotalCount = v.packingQuantity || 0;
+            v.sendProductId = v.sendProductId || v.categoryId || v.productId;
+          });
+          this.oldSendTotalWeightList = data.map((item) => {
+            return {
+              productCode: item.productCode,
+              oldSendTotalWeight: item.sendTotalWeight,
+              oldReceiveTotalWeight: item.receiveTotalWeight
+            };
+          });
+          this.form.datasource = data;
+          // this.form.datasource.forEach(async (v, index) => {
+          //   if (v.warehouseId) {
+          //     this.$set(
+          //       this.form.datasource[index],
+          //       'warehouseNum',
+          //       await getWarehouseOutStock({
+          //         warehouseId: v.warehouseId,
+          //         code: v.productCode
+          //       })
+          //     );
+          //   }
+          // });
+          this.gettotalAmount();
+        }
+      },
+
+      remove(index) {
+        this.form.datasource.splice(index, 1);
+        this.setSort();
+        this.gettotalAmount();
+      },
+      // 清空表格
+      restTable() {
+        this.form.datasource = [];
+      },
+      // 重新排序
+      setSort() {
+        this.form.datasource.forEach((n, index) => {
+          n.key = index + 1;
+        });
+      },
+      // 添加
+      handlAdd() {
+        if (!this.sendId && !this.entrustedCode)
+          return this.$message.error('请先选择来源单据');
+        this.$emit('handleSelectGoods', this.form.datasource);
+        // this.$refs.productListRef.open(this.form.datasource);
+      },
+
+      validateForm(callback) {
+        //开始表单校验
+        this.$refs.form.validate((valid) => {
+          callback(valid);
+        });
+      }
+    }
+  };
+</script>
+<style lang="scss" scoped>
+  .headbox {
+    display: flex;
+    justify-content: space-between;
+    align-items: center;
+
+    .amount {
+      font-size: 14px;
+      font-weight: bold;
+      padding-right: 30px;
+    }
+  }
+
+  .time-form .el-form-item {
+    margin-bottom: 0 !important;
+  }
+
+  ::v-deep .period {
+    display: flex;
+
+    .borderleftnone {
+      .el-input--medium .el-input__inner {
+        border-top-right-radius: 0;
+        border-bottom-right-radius: 0;
+      }
+    }
+
+    .borderrightnone {
+      .el-input--medium .el-input__inner {
+        border-top-left-radius: 0;
+        border-bottom-left-radius: 0;
+      }
+    }
+  }
+
+  ::v-deep .time-form tbody > tr:hover > td {
+    background-color: transparent !important;
+  }
+
+  ::v-deep .time-form .el-table tr {
+    background-color: #ffffff;
+  }
+
+  .pricebox {
+    display: flex;
+    justify-content: flex-start;
+    align-items: center;
+    font-weight: bold;
+  }
+</style>

+ 3 - 82
src/views/saleManage/saleOrder/adjustmentNote‌/components/searchTable.vue

@@ -16,99 +16,20 @@ export default {
           label: '关键字:',
           value: 'searchName',
           type: 'input',
-          placeholder: '对账单编码/客户名称'
+          placeholder: '冲差编码'
         },
         {
-          label: '对账单编码:',
+          label: '冲差原因:',
           value: 'statementNo',
           type: 'input',
           placeholder: '请输入'
         },
         {
-          label: '客户名称:',
+          label: '调整类型:',
           value: 'contactName',
           type: 'input',
           placeholder: '请输入'
         },
-        {
-          label: '对账方式:',
-          value: 'dateType',
-          width: 380,
-          type: 'select',
-          planList:reconciliationType,
-          placeholder: '请选择'
-        },
-        // {
-        //   label: '对账开始日期:',
-        //   value: 'startDate',
-        //   width: 360,
-        //   type: 'date',
-        //   labelWidth: 120,
-        //   dateType: 'datetimerange',
-        //   valueAr: ['createTimeStart', 'createTimeEnd']
-        // },
-        // {
-        //   label: '对账结束日期:',
-        //   value: 'endDate',
-        //   width: 360,
-        //   type: 'date',
-        //   labelWidth: 120,
-        //   dateType: 'datetimerange',
-        //   valueAr: ['createTimeStart', 'createTimeEnd']
-        // },
-        // {
-        //   label: '总金额:',
-        //   value: 'amountTotalPrice',
-        //   width: 380,
-        //   type: 'input',
-        //   placeholder: '请输入'
-        // },
-        // {
-        //   label: '应收金额:',
-        //   value: 'amountReceivablePrice',
-        //   width: 380,
-        //   type: 'input',
-        //   placeholder: '请输入'
-        // },
-        // {
-        //   label: '应付金额:',
-        //   value: 'amountPayablePrice',
-        //   width: 380,
-        //   type: 'input',
-        //   placeholder: '请输入'
-        // },
-        {
-          label: '状态:',
-          value: 'reviewStatus',
-          width: 380,
-          type: 'select',
-          planList: reviewStatusSelect,
-          placeholder: '请选择'
-        },
-        // {
-        //   label: '是否回执:',
-        //   value: 'replied',
-        //   width: 380,
-        //   type: 'select',
-        //   planList:receiptType,
-        //   placeholder: '请选择'
-        // },
-        // {
-        //   label: '创建人:',
-        //   value: 'createUserName',
-        //   width: 380,
-        //   type: 'input',
-        //   placeholder: '请输入'
-        // },
-        {
-          label: '创建时间:',
-          value: 'createTime',
-          type: 'date',
-          dateType: 'datetimerange',
-          placeholder: '',
-          width: 380,
-          valueAr: ['createTimeStart', 'createTimeEnd']
-        },
       ];
     }
   },

+ 44 - 37
src/views/saleManage/saleOrder/adjustmentNote‌/index.vue

@@ -105,25 +105,6 @@
                 </el-link>
               </template>
             </el-popconfirm>
-            <!--            <el-link-->
-            <!--              type="primary"-->
-            <!--              :underline="false"-->
-            <!--              icon="el-icon-download"-->
-            <!--              @click="handleExport(row)"-->
-            <!--              v-if="[2].includes(row.reviewStatus)">-->
-            <!--              导出-->
-            <!--            </el-link>-->
-            <el-link
-              size="small"
-              type="primary"
-              :underline="false"
-              icon="el-icon-plus"
-              class="ele-btn-icon"
-              v-if="[2].includes(row.reviewStatus)"
-              @click="handleAddInvoice(row)"
-            >
-              新增发票
-            </el-link>
           </template>
         </ele-pro-table>
       </div>
@@ -134,10 +115,17 @@
       v-if="addAdjustDialogFlag"
       :addAdjustDialogFlag.sync="addAdjustDialogFlag"
       ref="addAdjustDialogRef"
-      :contactData="contactData"
       :saleOrderData="saleOrderData"
       @done="reload"
     ></add-adjust-dialog>
+    <!-- 详情弹窗 -->
+    <detail-adjust-dialog
+      v-if="detailAdjustDialogFlag"
+      :detailAdjustDialogFlag.sync="detailAdjustDialogFlag"
+      ref="detailAdjustDialogRef"
+      :saleOrderData="saleOrderData"
+      @done="reload"
+    ></detail-adjust-dialog>
     <add-return-goods-dialog
       ref="addReturnGoodsRef"
       @done="reload"
@@ -180,17 +168,15 @@
 <script>
   import searchTable from './components/searchTable.vue';
   import addAdjustDialog from './components/addAdjustDialog.vue';
+  import detailAdjustDialog from './components/detailAdjustDialog.vue';
 
   import popModal from '@/components/pop-modal';
   import { reviewStatus } from '@/enum/dict';
   import orderDetailDialog from '@/views/saleManage/saleOrder/components/detailDialog.vue';
   import addReturnGoodsDialog from '@/views/saleManage/saleOrder/returnGoods/components/addReturnGoodsDialog';
-//   import detailDialog from './components/detailDialog.vue';
   import {
     getAccountstatementList,
-    submit,
     deletetAccountstatement,
-    submitAccountStatementApproveAPI,
     accountStatementExportAPI
   } from '@/api/saleManage/accountstatement';
   import dictMixins from '@/mixins/dictMixins';
@@ -210,7 +196,7 @@
       addReturnGoodsDialog,
       orderDetailDialog,
       addAdjustDialog,
-    //   detailDialog
+      detailAdjustDialog,
     },
     provide() {
       return {
@@ -235,6 +221,7 @@
     data() {
       return {
         addAdjustDialogFlag: false,
+        detailAdjustDialogFlag: false,
         detailDialogFlag: false,
         addInvoiceDialogFlag: false,
         accountInfoDialogFlag: false,
@@ -267,7 +254,7 @@
           },
           {
             prop: 'statementNo',
-            label: '对账单编码',
+            label: '冲差单编码',
             align: 'center',
             slot: 'statementNo',
             sortable: true,
@@ -276,13 +263,13 @@
           },
           {
             prop: 'contactName',
-            label: '客户名称',
+            label: '冲差类型',
             align: 'center',
             showOverflowTooltip: true,
             minWidth: 180
           },
           {
-          prop: 'dateType',
+          prop: '关联订单编码',
           label: '对账方式',
           align: 'center',
           showOverflowTooltip: true,
@@ -292,7 +279,7 @@
           }
         },
           {
-            prop: 'startDate',
+            prop: '冲差方式',
             label: '对账开始日期',
             align: 'center',
             slot: 'startDate',
@@ -301,14 +288,14 @@
           },
           {
             prop: 'endDate',
-            label: '对账结束日期',
+            label: '冲差范围',
             align: 'center',
             slot: 'endDate',
             showOverflowTooltip: true,
             minWidth: 200
           },
           {
-            prop: 'amountTotalPrice',
+            prop: '冲差原因',
             label: '总金额',
             align: 'center',
             showOverflowTooltip: true,
@@ -316,21 +303,21 @@
           },
           {
             prop: 'amountReceivablePrice',
-            label: '应收金额',
+            label: '调整类型',
             align: 'center',
             showOverflowTooltip: true,
             minWidth: 130
           },
           {
             prop: 'amountPayablePrice',
-            label: '应付金额',
+            label: '原总金额',
             align: 'center',
             showOverflowTooltip: true,
             minWidth: 130
           },
           {
             prop: 'reviewStatus',
-            label: '状态',
+            label: '原优惠后总金额',
             align: 'center',
             showOverflowTooltip: true,
             minWidth: 200,
@@ -340,7 +327,7 @@
           },
           {
             prop: 'replied',
-            label: '是否回执',
+            label: '总差异金额',
             align: 'center',
             slot: 'replied',
             showOverflowTooltip: true,
@@ -351,11 +338,25 @@
           },
           {
             prop: 'createUserName',
-            label: '创建人',
+            label: '新总金额',
             align: 'center',
             showOverflowTooltip: true,
             minWidth: 80
           },
+          {
+            prop: 'createTime',
+            label: '新优惠后总金额',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 170
+          },
+          {
+            prop: 'createTime',
+            label: '创建人',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 170
+          },
           {
             prop: 'createTime',
             label: '创建时间',
@@ -363,7 +364,13 @@
             showOverflowTooltip: true,
             minWidth: 170
           },
-
+          {
+            prop: 'createTime',
+            label: '状态',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 170
+          },
           {
             columnKey: 'action',
             label: '操作',
@@ -505,7 +512,7 @@
         if (type === 'statementNo') {
           this.detailDialogFlag = true;
           this.$nextTick(() => {
-            this.$refs.detailDialogRef.open('view', row, '1');
+            this.$refs.detailAdjustDialogRef.open('view', row, '1');
           });
         }
         if (type === 'orderNo') {

+ 10 - 1
src/views/saleManage/saleOrder/components/drawer.vue

@@ -133,6 +133,12 @@
           ref="saleOderAftersalesListRef"
           ></saleOderAftersalesList>
         </el-tab-pane>
+        <el-tab-pane label="冲差单" name="冲差单">
+          <adjustmentNote
+          :saleOrderData="row"
+          ref="adjustmentNoteRef"
+          ></adjustmentNote>
+        </el-tab-pane>
       </el-tabs>
     </div>
   </el-drawer>
@@ -154,6 +160,8 @@ import entrustedReceive from '@/views/saleManage/saleOrder/entrustedReceive/inde
 import invoice from '@/views/saleManage/saleOrder/invoice/index.vue';
 //退货单
 import returnGoods from '@/views/saleManage/saleOrder/returnGoods/index.vue';
+//冲差单
+import adjustmentNote from '@/views/saleManage/saleOrder/adjustmentNote‌/index.vue';
 //对账单
 import accountstatement from '@/views/saleManage/saleOrder/accountstatement/index.vue';
 //采购计划
@@ -192,7 +200,8 @@ export default {
     receivableManage,
     saleOrderReminderList,
     saleOderAftersalesList,
-    entrustedReceive
+    entrustedReceive,
+    adjustmentNote
   },
   data() {
     return {

+ 1 - 0
src/views/saleManage/saleOrder/index.vue

@@ -950,6 +950,7 @@ export default {
           this.$refs.addOrEditDialogRef.createInvoice1(row, 1, 3);
         });
       }
+      // 冲差
       if (command === 'adjustment') {
         console.log(row);
         this.addAdjustDialogFlag = true;