Kaynağa Gözat

feat: 新增冲差功能

liujt 9 ay önce
ebeveyn
işleme
5fd4771ebf

+ 6 - 1
src/enum/dict.js

@@ -66,7 +66,12 @@ export default {
   规则状态: 'rule_status',
   物品机型: 'product_model_key',
   物品颜色: 'product_color_key',
-  送货方式: 'delivery_method'
+  送货方式: 'delivery_method',
+  冲差类型: 'adjust_type',
+  冲差方式: 'adjust_method',
+  冲差原因: 'adjust_reason',
+  冲差范围: 'adjust_range',
+  调整类型: 'adjust_price_type'
 };
 
 export const numberList = [

+ 975 - 0
src/views/saleManage/saleOrder/adjustmentNote‌/components/addAdjustDialog.vue

@@ -0,0 +1,975 @@
+<template>
+  <ele-modal
+    custom-class="ele-dialog-form long-dialog-form"
+    :centered="true"
+    :visible.sync="addAdjustDialogFlag"
+    :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"
+        v-show="!['40', '50'].includes(form.type) || form.returnSourceType != 1"
+      ></headerTitle>
+      <!-- <inventoryTable
+        v-show="!['40', '50'].includes(form.type) || form.returnSourceType != 1"
+        :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: {
+      addAdjustDialogFlag: {
+        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);
+          this.visible = 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>

+ 124 - 0
src/views/saleManage/saleOrder/adjustmentNote‌/components/searchTable.vue

@@ -0,0 +1,124 @@
+<!-- 搜索表单 -->
+<template>
+  <seekPage :seekList="seekList" :formLength="3" @search="search"></seekPage>
+</template>
+<script>
+import { reconciliationType, reviewStatusSelect, receiptType } from '@/enum/dict';
+export default {
+  data() {
+    return {};
+  },
+  computed: {
+    // 表格列配置
+    seekList() {
+      return [
+        {
+          label: '关键字:',
+          value: 'searchName',
+          type: 'input',
+          placeholder: '对账单编码/客户名称'
+        },
+        {
+          label: '对账单编码:',
+          value: 'statementNo',
+          type: 'input',
+          placeholder: '请输入'
+        },
+        {
+          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']
+        },
+      ];
+    }
+  },
+  methods: {
+    /* 搜索 */
+    search(e) {
+      this.$emit('search', {
+        ...e
+      });
+    }
+  }
+};
+</script>

+ 566 - 0
src/views/saleManage/saleOrder/adjustmentNote‌/index.vue

@@ -0,0 +1,566 @@
+<template>
+  <div class="ele-body">
+    <el-card shadow="never" v-loading="loading">
+      <div class="ele-border-lighter form-content" v-loading="loading">
+        <search-table @search="reload"></search-table>
+
+        <!-- 数据表格 -->
+        <ele-pro-table
+          ref="table"
+          :columns="columns"
+          :datasource="datasource"
+          height="calc(100vh - 355px)"
+          style="margin-bottom: 10px"
+          full-height="calc(100vh - 116px)"
+          tool-class="ele-toolbar-form"
+          :selection.sync="selection"
+          :page-size="20"
+          @columns-change="handleColumnChange"
+          :cache-key="cacheKeyUrl"
+        >
+          <!-- 表头工具栏 -->
+          <template v-slot:toolbar>
+            <el-button
+              size="small"
+              type="primary"
+              icon="el-icon-plus"
+              class="ele-btn-icon"
+              @click="handleAddOrEditAccount('add', '')"
+            >
+              新建
+            </el-button>
+
+            <el-button
+              size="small"
+              type="danger"
+              el-icon-delete
+              class="ele-btn-icon"
+              @click="allDelBtn"
+              :disabled="selection?.length === 0"
+            >
+              批量删除
+            </el-button>
+          </template>
+
+          <!-- 查看详情列 -->
+
+          <template v-slot:statementNo="{ row }">
+            <el-link
+              type="primary"
+              :underline="false"
+              @click="openorderDetail(row, 'statementNo')"
+            >
+              {{ row.statementNo }}
+            </el-link>
+          </template>
+          <template v-slot:orderNo="{ row }">
+            <el-link
+              type="primary"
+              :underline="false"
+              @click="openorderDetail(row, 'orderNo')"
+            >
+              {{ row.orderNo }}
+            </el-link>
+          </template>
+          <!-- 操作列 -->
+          <template v-slot:action="{ row }">
+            <el-link
+              type="primary"
+              :underline="false"
+              icon="el-icon-edit"
+              @click="handleAddOrEditAccount('update', row)"
+              v-if="
+                (isNeed_process_is_close &&
+                  [0, 3].includes(row.reviewStatus)) ||
+                !isNeed_process_is_close
+              "
+            >
+              修改
+            </el-link>
+            <el-link
+              type="primary"
+              :underline="false"
+              icon="el-icon-plus"
+              @click="accountstatementSubmit(row)"
+              v-if="
+                isNeed_process_is_close && [0, 3].includes(row.reviewStatus)
+              "
+            >
+              提交
+            </el-link>
+
+            <el-popconfirm
+              class="ele-action"
+              title="确定要删除此信息吗?"
+              @confirm="remove([row.id])"
+              v-if="
+                (isNeed_process_is_close &&
+                  [0, 3].includes(row.reviewStatus)) ||
+                !isNeed_process_is_close
+              "
+            >
+              <template v-slot:reference>
+                <el-link type="danger" :underline="false" icon="el-icon-delete">
+                  删除
+                </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>
+    </el-card>
+
+    <order-detail-dialog ref="orderDetailDialogRef"></order-detail-dialog>
+    <add-adjust-dialog
+      v-if="addAdjustDialogFlag"
+      :addAdjustDialogFlag.sync="addAdjustDialogFlag"
+      ref="addAdjustDialogRef"
+      :contactData="contactData"
+      :saleOrderData="saleOrderData"
+      @done="reload"
+    ></add-adjust-dialog>
+    <add-return-goods-dialog
+      ref="addReturnGoodsRef"
+      @done="reload"
+    ></add-return-goods-dialog>
+    <!-- 多选删除弹窗 -->
+    <pop-modal
+      :visible.sync="delVisible"
+      content="是否确定删除?"
+      @done="commitBtn"
+    />
+    <!--对账单详情    -->
+    <!-- <detail-dialog
+      :detailDialogFlag.sync="detailDialogFlag"
+      v-if="detailDialogFlag"
+      ref="detailDialogRef"
+    ></detail-dialog> -->
+    <!-- 创建发票选择采购对账单信息 对账明细   -->
+    <accountInfoDialog
+      ref="accountInfoDialogRef"
+      v-if="accountInfoDialogFlag"
+      :account-info-dialog-flag.sync="accountInfoDialogFlag"
+      @getAccountInfo="getAccountInfo"
+    ></accountInfoDialog>
+    <!--    新增发票-->
+    <add-invoice-dialog
+      :add-or-edit-dialog-flag.sync="addInvoiceDialogFlag"
+      ref="addInvoiceDialogRef"
+      v-if="addInvoiceDialogFlag"
+      @reload="reload"
+    ></add-invoice-dialog>
+    <process-submit-dialog
+      :processSubmitDialogFlag.sync="processSubmitDialogFlag"
+      v-if="processSubmitDialogFlag"
+      ref="processSubmitDialogRef"
+      @reload="reload"
+    ></process-submit-dialog>
+  </div>
+</template>
+
+<script>
+  import searchTable from './components/searchTable.vue';
+  import addAdjustDialog from './components/addAdjustDialog.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';
+  import AccountInfoDialog from '@/views/financialManage/invoiceManage/components/accountInfoDialog.vue';
+  import addInvoiceDialog from '@/views/financialManage/invoiceManage/components/addOrEditDialog.vue';
+  import processSubmitDialog from '@/BIZComponents/processSubmitDialog/processSubmitDialog.vue';
+  import tabMixins from '@/mixins/tableColumnsMixin';
+
+  export default {
+    mixins: [dictMixins,tabMixins],
+    components: {
+      processSubmitDialog,
+      addInvoiceDialog,
+      AccountInfoDialog,
+      searchTable,
+      popModal,
+      addReturnGoodsDialog,
+      orderDetailDialog,
+      addAdjustDialog,
+    //   detailDialog
+    },
+    provide() {
+      return {
+        invoiceType: () => ''
+      };
+    },
+    //客户管理数据
+    props: {
+      contactData: {
+        type: Object,
+        default: () => {
+          return {};
+        }
+      },
+      saleOrderData: {
+        type: Object,
+        default: () => {
+          return {};
+        }
+      }
+    },
+    data() {
+      return {
+        addAdjustDialogFlag: false,
+        detailDialogFlag: false,
+        addInvoiceDialogFlag: false,
+        accountInfoDialogFlag: false,
+        processSubmitDialogFlag: false,
+        currentRow: {},
+        activeComp: 'saleorder',
+        tabOptions: [
+          { key: 'saleorder', name: '销售订单' },
+          { key: 'invoice', name: '发货单' },
+          { key: 'returnorder', name: '退货单' }
+        ],
+        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: 'statementNo',
+            label: '对账单编码',
+            align: 'center',
+            slot: 'statementNo',
+            sortable: true,
+            showOverflowTooltip: true,
+            minWidth: 200
+          },
+          {
+            prop: 'contactName',
+            label: '客户名称',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 180
+          },
+          {
+          prop: 'dateType',
+          label: '对账方式',
+          align: 'center',
+          showOverflowTooltip: true,
+          minWidth: 150,
+          formatter: (_row, _column, cellValue) => {
+            return cellValue==1?'按年度':cellValue==2?'按季度':cellValue==3?'按月度':'按时间段'
+          }
+        },
+          {
+            prop: 'startDate',
+            label: '对账开始日期',
+            align: 'center',
+            slot: 'startDate',
+            showOverflowTooltip: true,
+            minWidth: 200
+          },
+          {
+            prop: 'endDate',
+            label: '对账结束日期',
+            align: 'center',
+            slot: 'endDate',
+            showOverflowTooltip: true,
+            minWidth: 200
+          },
+          {
+            prop: 'amountTotalPrice',
+            label: '总金额',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 130
+          },
+          {
+            prop: 'amountReceivablePrice',
+            label: '应收金额',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 130
+          },
+          {
+            prop: 'amountPayablePrice',
+            label: '应付金额',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 130
+          },
+          {
+            prop: 'reviewStatus',
+            label: '状态',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 200,
+            formatter: (_row, _column, cellValue) => {
+              return reviewStatus[_row.reviewStatus];
+            }
+          },
+          {
+            prop: 'replied',
+            label: '是否回执',
+            align: 'center',
+            slot: 'replied',
+            showOverflowTooltip: true,
+            minWidth: 200,
+            formatter: (_row, _column, cellValue) => {
+              return _row.replied ? '是' : '否';
+            }
+          },
+          {
+            prop: 'createUserName',
+            label: '创建人',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 80
+          },
+          {
+            prop: 'createTime',
+            label: '创建时间',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 170
+          },
+
+          {
+            columnKey: 'action',
+            label: '操作',
+            width: 230,
+            align: 'center',
+            resizable: false,
+            slot: 'action',
+            showOverflowTooltip: true,
+            fixed: 'right'
+          }
+        ],
+        cacheKeyUrl:'eos-b5bbaa6e-saleManage-accountstatement',
+      };
+    },
+    computed: {},
+
+    methods: {
+      /* 表格数据源 */
+      datasource({ page, limit, where, order }) {
+        if (this.contactData.id) {
+          where['contactId'] = this.contactData.id;
+        }
+        if (this.saleOrderData.id) {
+          where['orderCode'] = this.saleOrderData.orderNo;
+        }
+
+        return getAccountstatementList({
+          pageNum: page,
+          size: limit,
+          type: 1,
+          ...where
+        });
+      },
+
+      /* 刷新表格 */
+      reload(where) {
+        this.$refs.table.reload({ page: 1, where });
+        this.$emit('getToDoReminder')
+
+      },
+
+      //新增编辑
+      handleAddOrEditAccount(type, row) {
+        this.addAdjustDialogFlag = true;
+        this.$nextTick(() => {
+          this.$refs.addAdjustDialogRef.open(type, row, '1');
+        });
+      },
+      //导出
+      async handleExport(row) {
+        let data = await accountStatementExportAPI(row.id);
+        saveAs(data.data, '应收对账单');
+      },
+      /*新增发票*/
+      handleAddInvoice(row) {
+        this.currentRow = row;
+        this.accountInfoDialogFlag = true;
+        this.$nextTick(() => {
+          this.$refs.accountInfoDialogRef.createInvoice(
+            row,
+            'add',
+            'saleOrder'
+          );
+        });
+      },
+      /*新增发票选择对账单信息回调*/
+      getAccountInfo(row) {
+        this.currentRow.children = row;
+        setTimeout(() => {
+          this.addInvoiceDialogFlag = true;
+          this.$nextTick(() => {
+            this.$refs.addInvoiceDialogRef.createInvoice(
+              {},
+              1,
+              this.currentRow
+            );
+          });
+        }, 400);
+      },
+      //批量删除
+      allDelBtn() {
+        if (this.selection.length === 0) return;
+        let flag = this.selection.some((item) =>
+          [1, 2].includes(item.reviewStatus)
+        );
+        if (flag)
+          return this.$message.warning(
+            '抱歉已审核、审核中的数据不能删除,请检查'
+          );
+        this.delVisible = true;
+      },
+
+      //删除接口
+      remove(delData) {
+        deletetAccountstatement(delData).then((res) => {
+          this.$message.success('删除成功!');
+          this.reload();
+        });
+      },
+
+      //删除弹框确定
+      commitBtn() {
+        const dataId = this.selection.map((v) => v.id);
+        this.remove(dataId);
+      },
+      accountstatementSubmit(res) {
+        this.processSubmitDialogFlag = true;
+        this.$nextTick(() => {
+          let params = {
+            businessId: res.id,
+            businessKey: 'sales_account_statement_approve',
+            formCreateUserId: res.createUserId,
+            variables: {
+              type: '1',
+              businessCode: res.statementNo,
+              businessName: res.contactName,
+              businessType: '对账单'
+            }
+            // callBackMethodType : '1',
+            // callBackMethod : 'proTargetPlanApproveApiImpl.updatePlanApprovalStatus',
+            // pcHandle : '/bpm/handleTask/components/project-manage/plan-manage/submit.vue',
+            // pcView : '/bpm/handleTask/components/project-manage/plan-manage/detailDialog.vue',
+            // miniHandle : '',
+            // miniView : '',
+          };
+          this.$refs.processSubmitDialogRef.init(params);
+        });
+
+        // submitAccountStatementApproveAPI({
+        //   businessId: res.id,
+        //   type: '1'
+        // }).then((res) => {
+        //   this.$message.success('提交成功!');
+        //   this.reload();
+        // });
+      },
+      //查看详情
+      openorderDetail(row, type) {
+        if (type === 'statementNo') {
+          this.detailDialogFlag = true;
+          this.$nextTick(() => {
+            this.$refs.detailDialogRef.open('view', row, '1');
+          });
+        }
+        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>

+ 43 - 4
src/views/saleManage/saleOrder/index.vue

@@ -192,6 +192,17 @@
                     </el-link>
                   </template>
                 </el-popconfirm>
+
+                <el-link
+                  type="primary"
+                  :underline="false"
+                  icon="el-icon-plus"
+                  @click="handleCommand('adjustment', row)"
+                  v-if="[2].includes(row.orderStatus)"
+                >
+                  冲差
+                </el-link>
+                <!-- $hasPermission('eom:saleorder:adjustment') &&  -->
                 <el-link
                   type="primary"
                   :underline="false"
@@ -209,7 +220,7 @@
                       isTotalCount == 0)
                   "
                 >
-                  创建发货单
+                  发货单
                 </el-link>
                 <el-link
                   type="primary"
@@ -286,6 +297,11 @@
             @getToDoReminder="getToDoReminder"
           ></palletManagement>
         </div>
+        <div v-if="activeComp == 'adjustmentNote'">
+          <adjustmentNote
+            @getToDoReminder="getToDoReminder"
+          ></adjustmentNote>
+        </div>
       </div>
     </el-card>
 
@@ -356,6 +372,12 @@
       :groupName="groupName"
       ref="printTemplateSaleOrderRef"
     ></printTemplateSaleOrder>
+    <add-adjust-dialog
+      v-if="addAdjustDialogFlag"
+      :addAdjustDialogFlag.sync="addAdjustDialogFlag"
+      ref="addAdjustDialogRef"
+      @done="reload"
+    ></add-adjust-dialog>
   </div>
 </template>
 
@@ -379,7 +401,8 @@ import returnGoods from './returnGoods/index.vue';
 import palletManagement from './palletManagement/index.vue';
 import addInvoiceManage from '@/views/financialManage/invoiceManage/components/addOrEditDialog.vue';
 import addEntrustedReceive from '@/views/saleManage/saleOrder/entrustedReceive/components/addOrEditDialog';
-
+import adjustmentNote from './adjustmentNote‌/index.vue';
+import addAdjustDialog from '@/views/saleManage/saleOrder/adjustmentNote‌/components/addAdjustDialog.vue';
 import {
   deleteInformation,
   getSaleOrderDetail,
@@ -405,6 +428,7 @@ import quotationDetail from '@/views/saleManage/quotation/components/detailDialo
 import printTemplateSaleOrder from './components/printTemplateSaleOrder.vue';
 import { enterprisePage } from '@/api/contractManage/contractBook';
 import { listOrganizations } from '@/api/system/organization';
+
 export default {
   mixins: [dictMixins, tabMixins],
   components: {
@@ -433,7 +457,9 @@ export default {
     opportunityDetail,
     quotationDetail,
     addEntrustedReceive,
-    printTemplateSaleOrder
+    printTemplateSaleOrder,
+    adjustmentNote,
+    addAdjustDialog
   },
   //客户管理数据
   props: {
@@ -477,7 +503,12 @@ export default {
           key: 'accountstatement',
           name: '对账单',
           reminder: 'statementAccountNum'
-        }
+        },
+        {
+          key: 'adjustmentNote',
+          name: '冲差单',
+          reminder: 'adjustmentNoteNum'
+        },
       ],
       selection: [], //单选中集合
       delVisible: false, //批量删除弹框状态
@@ -485,6 +516,7 @@ export default {
       processSubmitDialogFlag: false, // 加载状态
       addOrEditDialogFlag1: false,
       addEntrustedReceiveFlag: false,
+      addAdjustDialogFlag: false, //冲差状态
       params: {},
       tableList: [],
       current: null,
@@ -918,6 +950,13 @@ export default {
           this.$refs.addOrEditDialogRef.createInvoice1(row, 1, 3);
         });
       }
+      if (command === 'adjustment') {
+        console.log(row);
+        this.addAdjustDialogFlag = true;
+        this.$nextTick(() => {
+          this.$refs.addAdjustDialogRef.open('add', row);
+        });
+      }
     },
 
     invoiceAll() {