Переглянути джерело

feat: 新增管理后台功能

zhangyuhan 3 місяців тому
батько
коміт
b14b849c50

+ 9 - 0
src/router.js

@@ -127,6 +127,15 @@ const routes = [
                 name: 'order-admin-list',
                 component: () => import('./views/create-order/admin-order-list.vue'),
             },
+            {
+                path: '/order/detail/:id',
+                name: 'order-detail',
+                meta: {
+                    title: '订单详情',
+                    isAdmin: true
+                },
+                component: () => import('./views/create-order/order-detail.vue'),
+            },
         ]
     },
     {

+ 1 - 1
src/views/create-order/admin-order-list.vue

@@ -1127,7 +1127,7 @@ export default {
     rowClick(row) {
       const sources = JSON.parse(row.filter || '{}').source ? JSON.parse(row.filter || '{}').source : ''
       const news = this.$router.resolve({
-        path: '/manage_admin/order/detail/' + row.order_code,
+        path: '/order/detail/' + row.order_code,
         query: {id: row.id, proType: row.product_type, type: sources,otherType:row.orderProducttype}
       })
       window.open(news.href, '_blank')

+ 29 - 11
src/views/create-order/components/order-detail-submodule/ChangeRecord.vue

@@ -30,25 +30,43 @@ export default {
   },
   data() {
     return {
-      changeRecordList: [],
       columns: [
-        { prop:'changeMoney', label: '操作人' },
-        { prop:'changeProduct', label: '操作时间' },
-        { prop:'changeReason', label: '红冲类型' },
-        { prop:'changeRemark', label: '签约主体' },
-        { prop:'changeTime', label: '合同金额变动' },
-        { prop:'operator', label: '佣金变动' },
-        { prop:'refundMoney', label: '修正原因' }
+        { prop:'createPerson', label: '操作人' },
+        { prop:'createTime', label: '操作时间' },
+        { prop:'redType', label: '红冲类型' },
+        { prop:'signingSubject', label: '签约主体' },
+        {
+          prop:'payMoney',
+          label: '合同金额变动',
+          render: (row) => {
+            return row.payMoney ? this.localed(row.payMoney / 100) : this.localed(0)
+          }
+        },
+        {
+          prop:'commission',
+          label: '佣金变动',
+          render: (row) => {
+            return row.commission ? this.localed(row.commission / 100) : this.localed(0)
+          }
+        },
+        { prop:'correctionReason', label: '修正原因' }
       ]
     }
   },
-  mounted() {
-    this.changeRecordList = this.orderDetail?.redPunchData?.moneyCorrectionData || [];
+  computed: {
+    changeRecordList () {
+      return this.orderDetail?.redPunchData?.moneyCorrectionData || [];
+    }
   },
+  methods: {
+    localed(val) {
+      return val.toLocaleString('zh', {style: 'currency', currency: 'CNY'})
+    }
+  }
 }
 </script>
 <style lang="scss" scoped>
   .change-record {
-    
+
   }
 </style>

+ 234 - 24
src/views/create-order/components/order-detail-submodule/OrderActions.vue

@@ -2,17 +2,44 @@
   <div class="order-actions-container">
     <div class="order-actions-list">
       <div
-        v-for="(item, index) in actionList" 
-        :key="index" 
+        v-for="(item, index) in actionList"
+        :key="index"
       >
-        <div 
-          :class="{ 'order-action-item-active': item.active }" 
+        <div
+          :class="{ 'order-action-item-active': item.active }"
           class="order-action-item"
           v-if="item.show"
         >
           <div class="order-action-text" @click="item.action">{{ item.text }}</div>
         </div>
       </div>
+      <!--  管理后台功能   -->
+      <div class="order-action-item" v-if="isAdminPage">
+        <div class="order-action-text" @click="doAction('协议归档')">协议归档</div>
+      </div>
+      <div class="order-action-item" v-if="isAdminPage && newActionList.length > 0">
+        <div class="order-action-text" v-if="newActionList.length === 1" @click="doAction(newActionList[0])">newActionList[0]</div>
+        <el-dropdown size="medium" trigger="click" @command="doAction" v-else>
+          <span class="el-dropdown-link">
+          新增<i class="el-icon-arrow-down el-icon--right"></i>
+          </span>
+          <el-dropdown-menu slot="dropdown">
+            <el-dropdown-item v-for="(item, index) in newActionList" :key="index" @click="doAction(item)" :command="item">{{item}}</el-dropdown-item>
+          </el-dropdown-menu>
+        </el-dropdown>
+      </div>
+      <div class="order-action-item" v-if="isAdminPage">
+        <div class="order-action-text" @click="doAction('线下开发票')">线下开发票</div>
+      </div>
+      <div class="order-action-item" v-if="isAdminPage">
+        <div class="order-action-text" @click="doAction('导入发票')">导入发票</div>
+      </div>
+      <div class="order-action-item" v-if="isAdminPage">
+        <div class="order-action-text" @click="doAction('录入线下发票链接/物流信息')">录入线下发票链接/物流信息</div>
+      </div>
+      <div class="order-action-item" v-if="isAdminPage && checkActionPower['权限开通']">
+        <div class="order-action-text" @click="doAction('权限开通')">权限开通</div>
+      </div>
     </div>
     <el-dialog
         class="edit-dialog"
@@ -57,9 +84,15 @@
         <span>该订单不支持下载电子协议</span>
       </div>
     </Dialog>
+
     <!-- 客户扫码自助开票 -->
-    <new-set-order-info :show-content="2" :show-dialog="showDialog" :order-info="orderDetail?.orderData" title="客户自助扫码开票"
-        @close="closeComDialog">
+    <new-set-order-info
+        :title="setDialogStatus.setTitle"
+        :show-content="setDialogStatus.showContent"
+        :show-dialog="setDialogStatus.showDialog"
+        :order-info="orderDetail?.orderData"
+        @close="closeComDialog"
+    >
     </new-set-order-info>
     <!-- 开票二维码 -->
     <new-set-order-info ref="invoiceRef" :show-content="4" :show-dialog="showInvoiceDialog" :order-info="orderDetail"
@@ -70,6 +103,23 @@
         </div>
     </new-set-order-info>
     <new-detail-model v-if="showDetailModel" ref="detailModelRef" :orderDetail="orderDetailInfo"></new-detail-model>
+
+    <!-- 线下开发票、新增回款信息、审核、退款弹框 -->
+    <!--    <d-model ref="backRef" :data="orders" :orderDetail="orDetails" :contractData="contractData"-->
+    <!--             :returnRes="returnRes" :returnInfo="returnInfo" :isStatus="book.source" :payMoney="orDetails.pay_money"-->
+    <!--             :filterData="book"></d-model>-->
+    <d-model
+        ref="backRef"
+        :data="orderDetail"
+        @refresh="doRefresh"
+    ></d-model>
+    <!-- 导入发票弹框 -->
+    <i-invoice ref="importModel"></i-invoice>
+    <!-- 批量回款弹框 -->
+    <b-collect ref="batchModel" :selectData="[orDetails]" :bookLevel="orDetails?.filterData?.level" @onChange="doRefresh('回款信息')"></b-collect>
+    <!-- 盖章记录弹窗-->
+    <sealDialog ref="sealDialogRef" :new-api="true" @refresh="doRefresh('盖章记录')" />
+
   </div>
 </template>
 
@@ -81,18 +131,27 @@ import {
   ajaxGetContractPdf,
   ajaxOrderCancellation
 } from '@/api/modules/'
+import dModel from "@/views/order/components/new-detailModel";
+import bCollect from "@/views/order/components/new-batchOrder";
+import iInvoice from '@/views/order/components/uploadInvoice.vue'
+import SealDialog from "@/views/order/components/sealDialog.vue";
+import CreateOrder from '../create.vue'
 import newSetOrderInfo from '../newSetOrderInfo.vue'
 import newDetailModel from '../nweDetailModel.vue'
 
 export default {
   name: 'OrderActions',
   components: {
+    SealDialog,
     Dialog,
     EditOrder,
     newSetOrderInfo,
-    newDetailModel
+    newDetailModel,
+    bCollect,
+    dModel,
+    iInvoice,
   },
-  props: { 
+  props: {
     orderDetail: {
       type: Object,
       default() {
@@ -110,8 +169,12 @@ export default {
       showDialog: false,
       showInvoiceDialog: false,
       orderDetailInfo: {},
-      selectInvoice: {}
-
+      selectInvoice: {},
+      setDialogStatus: {
+        showDialog: false,
+        setTitle: '客户自助扫码开票',
+        showContent: 1
+      },
     }
   },
   created () {
@@ -130,6 +193,34 @@ export default {
     }
   },
   computed: {
+      isAdminPage () {
+        return this.$route.meta?.isAdmin
+      },
+      orDetails () {
+        return this.orderDetail?.orderData
+      },
+      newActionList () {
+        const actions = {
+          '回款': true,
+          '退款': true,
+          '业绩变更': true,
+          '红冲': true,
+          '盖章': true,
+        }
+        const result = []
+        for (const action in actions) {
+          if (actions[action]) {
+            result.push(action)
+          }
+        }
+        return result
+      },
+
+      checkActionPower () {
+        return {
+          '权限开通': this.checkActionPowerUse('权限开通')
+        }
+      },
     showDetailModel() {
       return Object.keys(this.orderDetailInfo).length > 0
     },
@@ -155,7 +246,7 @@ export default {
           text: '下载电子协议',
           active: false,
           action: () => {
-            this.downloadProtocol() 
+            this.downloadProtocol()
           },
           show: true
         },
@@ -163,7 +254,7 @@ export default {
           text: '微信/支付宝付款码',
           active: false,
           action: () => {
-            this.wxAliPay() 
+            this.wxAliPay()
           },
           show: this.isShowPayBtn()
         },
@@ -179,8 +270,8 @@ export default {
         //   text: '协议归档',
         //   active: false,
         //   action: () => {
-        //     this.archiveProtocol() 
-        //   } 
+        //     this.archiveProtocol()
+        //   }
         // }
       ]
     }
@@ -240,7 +331,7 @@ export default {
         this.$message.success('作废订单成功')
         this.$emit('refresh')
       } else {
-        this.$message.error(msg) 
+        this.$message.error(msg)
       }
     },
     cancelOrderCancel() {
@@ -254,14 +345,14 @@ export default {
       if (code === 0) {
         console.log('downloadProtocol', data)
       } else {
-        this.downloadProtocolVisible = true 
+        this.downloadProtocolVisible = true
       }
     },
     downloadProtocolConfirm() {
-      this.downloadProtocolVisible = false 
+      this.downloadProtocolVisible = false
     },
     downloadProtocolCancel() {
-      this.downloadProtocolVisible = false 
+      this.downloadProtocolVisible = false
     },
     // 下载电子协议相关逻辑结束
     // 微信/支付宝付款码相关逻辑开始
@@ -290,16 +381,134 @@ export default {
      */
     // 关闭弹框
     closeComDialog() {
-      this.showDialog = false
       this.showInvoiceDialog = false
+      this.setDialogStatus.showDialog = false
     },
     scanCodeInvoice() {
       console.log('scanCodeInvoice')
-      this.showDialog = true;
+      console.log('scanCodeInvoice')
+      this.scanCodeVote(1)
+    },
+    scanCodeVote(data) {
+      if (data === 1) {
+        this.setDialogStatus.setTitle = '客户自助扫码开票'
+      } else if (data === 3) {
+        this.setDialogStatus.setTitle = '录入线下发票链接/物流信息'
+      }
+      this.setDialogStatus.showContent = data
+      this.setDialogStatus.showDialog = true
     },
     // archiveProtocol() {
-    //   console.log('archiveProtocol') 
-    // }
+    //   console.log('archiveProtocol')
+    // },
+    doRefresh (type = '') {
+      this.$emit('refresh', type)
+    },
+    doAction (type) {
+      console.log('tttt', type)
+      switch (type) {
+        case '回款': {
+          this.$refs.batchModel.asdShow = true
+          break
+        }
+        case '退款': {
+          this.$refs.backRef.tShow = true
+          break
+        }
+        case '业绩变更': {
+          this.$refs.backRef.performanceShow = true
+          break
+        }
+        case '红冲': {
+          this.$refs.backRef.correctionShow = true
+          if (this.orDetails.product_type === '大会员') {
+            this.$refs.backRef.bigCorrection = true
+          }
+          break
+        }
+        case '盖章': {
+          this.$refs.sealDialogRef.show({
+            res: this.orderDetail.orderData,
+            saleDataRes: this.orderDetail.saleDataRes
+          })
+          break
+        }
+        case '协议归档': {
+          this.$refs.backRef.pShow = true
+          break
+        }
+        case '线下开发票': {
+          this.$refs.backRef.iShow = true
+          break
+        }
+        case '导入发票': {
+          this.$refs.importModel.importShow = true
+          break
+        }
+        case '录入线下发票链接/物流信息': {
+          this.scanCodeVote(3)
+          break
+        }
+        case '权限开通': {
+          this.$refs.backRef.permissionActivationShow = true
+          break
+        }
+      }
+    },
+    checkActionPowerUse (type) {
+      const result = {
+        canUse: true
+      }
+      console.log('checkActionPower', type)
+      switch (type) {
+        case '回款': {
+          this.$refs.batchModel.asdShow = true
+          break
+        }
+        case '退款': {
+          this.$refs.backRef.tShow = true
+          break
+        }
+        case '业绩变更': {
+          this.$refs.backRef.performanceShow = true
+          break
+        }
+        case '红冲': {
+          this.$refs.backRef.correctionShow = true
+          if (this.orDetails.product_type === '大会员') {
+            this.$refs.backRef.bigCorrection = true
+          }
+          break
+        }
+        case '盖章': {
+          this.$refs.sealDialogRef.show({
+            res: this.orderDetail.orderData,
+            saleDataRes: this.orderDetail.saleDataRes
+          })
+          break
+        }
+        case '协议归档': {
+          this.$refs.backRef.pShow = true
+          break
+        }
+        case '线下开发票': {
+          this.$refs.backRef.iShow = true
+          break
+        }
+        case '导入发票': {
+          this.$refs.importModel.importShow = true
+          break
+        }
+        case '录入线下发票链接/物流信息': {
+          this.scanCodeVote(3)
+          break
+        }
+        case '权限开通': {
+          result.canUse = this.orderDetail?.return_status == '1'
+        }
+      }
+      return result.canUse
+    }
   }
 }
 </script>
@@ -316,6 +525,7 @@ export default {
     justify-content: center;
     padding: 4px 15px;
     margin-right: 12px;
+    margin-bottom: 12px;
     min-width: 90px;
     font-size: 14px;
     border: 1px solid #E0E0E0;
@@ -332,7 +542,7 @@ export default {
   .cancel-order-content {
     text-align: center;
     font-size: 14px;
-    color: #686868; 
+    color: #686868;
   }
  }
  .button-group {
@@ -351,6 +561,6 @@ export default {
     }
   }
 }
- 
+
 }
 </style>

+ 30 - 13
src/views/create-order/components/order-detail-submodule/PaymentInfo.vue

@@ -84,7 +84,15 @@ export default {
         {
           label: '支付方式',
           prop: 'return_type',
-          width: '112'
+          width: '112',
+          render (row) {
+            const payCashStatus = [
+              { v: '1', n: '微信' },
+              { v: '2', n: '支付宝' },
+              { v: '3', n: '对公转账' }
+            ]
+            return payCashStatus.find(v => v.v == row.return_type).n || '-'
+          }
         },
         // {
         //   label: '手续费',
@@ -98,8 +106,11 @@ export default {
         },
         {
           label: '支付单号/银行流水号',
-          prop: 'bank_flow',
-          width: '210'
+          prop: 'return_code',
+          width: '210',
+          render (row) {
+            return row.bank_flow || row.return_code
+          }
         },
         {
           label: '支付户名',
@@ -109,7 +120,10 @@ export default {
         {
           label: '流水金额',
           prop: 'flow_money',
-          width: '112'
+          width: '112',
+          render: (row) => {
+            return row.flow_money ? this.returnAmount(row.flow_money) : this.returnAmount(0)
+          }
         },
         {
           label: '操作时间',
@@ -122,7 +136,7 @@ export default {
           width: '90'
         }
       ],
-      paymentDetailList: [
+      paymentDetailList_: [
         {
           return_time: '2023-12-31 13:21:32',
           // paymoney: '¥2,000.00',
@@ -162,7 +176,7 @@ export default {
           prop: 'action'
         }
       ],
-      orderTransfer: [
+      orderTransfer_: [
         {
           create_time: '2023-12-31 13:21:32',
           voucher: '点击查看',
@@ -172,7 +186,6 @@ export default {
           action: '审核',
         }
       ],
-      returnRes: {}
     }
   },
   computed: {
@@ -187,13 +200,17 @@ export default {
       } else {
           return '未回款'
       }
+    },
+    returnRes () {
+      return this.orderDetail?.returnRes || {};
+    },
+    paymentDetailList () {
+      return this.returnRes?.returnInfo || [];
+    },
+    orderTransfer () {
+      return this.returnRes?.orderTransfer || [];
     }
   },
-  mounted() {
-    this.returnRes = this.orderDetail?.returnRes || {};
-    this.paymentDetailList = this.returnRes?.returnInfo || [];
-    this.orderTransfer = this.returnRes?.orderTransfer || [];
-  },
   methods: {
     returnAmount(val) {
       if (!val) return 0;
@@ -203,7 +220,7 @@ export default {
     },
     setReturnType(val) {
       if (val === 1) {
-          return '微信支付' 
+          return '微信支付'
       } else if(val === 2) {
           return '支付宝支付'
       } else if(val === 3) {

+ 11 - 9
src/views/create-order/components/order-detail-submodule/PerformanceBelongs.vue

@@ -43,7 +43,7 @@ export default {
       default: () => {
         return {};
       },
-    }, 
+    },
   },
   data() {
     return {
@@ -65,7 +65,6 @@ export default {
           prop: 'order_channel_new'
         }
       ],
-      newPerformmaceBelongsList: [],
       performanceChangeColumns: [
         {
           label: '操作人',
@@ -93,14 +92,14 @@ export default {
         },
         {
           label: '销售渠道',
-          prop: 'distribution_channel'
+          prop: 'order_channel_new'
         },
         {
           label: '变更原因',
-          prop: 'change_reason' 
+          prop: 'change_reason'
         }
       ],
-      performanceChangeList: [
+      performanceChangeList_: [
         {
           operator: '姓名',
           createtime: '2021-05-28 15:30:00',
@@ -114,10 +113,13 @@ export default {
       ]
     }
   },
-  mounted() {
-    console.log(this.orderDetail)
-    this.newPerformmaceBelongsList = this.orderDetail?.saleDataRes?.saleFinal?.list || []
-    this.performanceChangeList = this.orderDetail?.saleDataRes?.saleRecord || []
+  computed: {
+    newPerformmaceBelongsList () {
+      return this.orderDetail?.saleDataRes?.saleFinal?.list || []
+    },
+    performanceChangeList () {
+      return this.orderDetail?.saleDataRes?.saleRecord || []
+    }
   },
   methods: {
     formatNumber(num, x = 2) {

+ 19 - 10
src/views/create-order/components/order-detail-submodule/RefundInfo.vue

@@ -43,14 +43,18 @@ export default {
   },
   data() {
     return {
-      refundDetailList: [],
-      refundRes: {},
       columns: [
-        { prop: 'refundMoney', label: '退款金额' },
+        {
+          prop: 'refund_money',
+          label: '退款金额',
+          render: (row) => {
+            return row.refund_money ? this.localed(row.refund_money / 100) : this.localed(0)
+          }
+        },
         { prop:'refundProduct', label: '退款产品' },
-        { prop: 'refundReason', label: '退款原因' }, 
-        { prop: 'refundRemark', label: '退款备注' },
-        { prop: 'refundTime', label: '操作时间' },
+        { prop: 'refund_reason_type', label: '退款原因' },
+        { prop: 'refund_reason', label: '退款备注' },
+        { prop: 'refund_time', label: '操作时间' },
         { prop:'operator', label: '操作人' }
       ]
     }
@@ -67,16 +71,21 @@ export default {
       } else {
           return '未退款'
       }
+    },
+    refundRes () {
+      return this.orderDetail?.refundRes || {}
+    },
+    refundDetailList () {
+      return this.refundRes?.refundInfo || []
     }
   },
-  mounted() {
-    this.refundRes = this.orderDetail?.refundRes || {}
-    this.refundDetailList = this.orderDetail?.refundRes?.refundInfo || [] 
-  },
   methods: {
     setPriceValue(val) {
       if (!val) return 0;
       return (val / 100).toFixed(2);
+    },
+    localed(val) {
+      return val.toLocaleString('zh', {style: 'currency', currency: 'CNY'})
     }
   }
 }

+ 8 - 7
src/views/create-order/components/order-detail-submodule/StampRecord.vue

@@ -30,23 +30,24 @@ export default {
   },
   data() {
     return {
-      stampRecordList: [],
       columns: [
         { prop:'changeMoney', label: '操作人' },
-        { prop:'changeProduct', label: '操作时间' },
+        { prop:'create_time', label: '操作时间' },
         { prop:'changeReason', label: '申请人' },
-        { prop:'changeRemark', label: '盖章时间' },
+        { prop:'stamp_time', label: '盖章时间' },
         { prop:'changeTime', label: '操作' }
       ]
     }
   },
-  mounted() {
-    this.stampRecordList = this.orderDetail?.sealArr|| [];
-  },
+  computed: {
+    stampRecordList () {
+      return this.orderDetail?.sealArr|| []
+    }
+  }
 }
 </script>
 <style lang="scss" scoped>
   .stamp-record {
-    
+
   }
 </style>

+ 8 - 3
src/views/create-order/order-detail.vue

@@ -11,7 +11,7 @@
           </el-tab-pane>
         </el-tabs>
         <div class="order-action-container">
-          <OrderActions @refresh="refresh" :order-detail="orderDetail" />
+          <OrderActions :order-detail="orderDetail" @refresh="doRefresh" />
         </div>
         <div class="order-desc-container">
           <OrderDescInfo :orderInfo="orderDetail?.orderData" />
@@ -148,8 +148,13 @@ export default {
         this.$message.error('获取订单详情失败')
       }
     },
-    refresh() {
-      this.getOrderDetail() 
+    doRefresh (type) {
+      this.getOrderDetail()
+      this.doSelectTabName(type)
+    },
+    doSelectTabName (name = '订单详情') {
+      const tabKey = this.tabList.find(v => v.label === name).name
+      this.activeTabName = tabKey
     }
   }
 }

+ 649 - 0
src/views/order/components/new-batchOrder.vue

@@ -0,0 +1,649 @@
+<template>
+  <div class="two-child">
+    <!-- 新增回款信息 -->
+    <Modal title="新增回款信息" v-model="asdShow" class-name="order-model other-model batch-model" :mask-closable="false"
+      @on-visible-change="visibleChange">
+      <Form ref="returnCash" :model="returnCash" :rules="ruleValidate" :show-message="true" :label-width="120">
+        <h3>关联回款流水</h3>
+        <FormItem label="支付方式" prop="payType">
+          <Select v-model="returnCash.payType" @on-change="payTypeChange" placeholder="请选择支付方式">
+            <Option v-for="item in payCashStatus" :value="item.v" :key="item.v">{{ item.n }}</Option>
+          </Select>
+        </FormItem>
+        <FormItem v-if="returnCash.payType == '3'" label="银行流水号" prop="serialNumber">
+          <Input style="width:400px" v-model="returnCash.serialNumber"
+            :placeholder="returnCash.flowType ? '请输入银行流水号' : '请选择银行流水号'" @click.native="serialChange"
+            :readonly="!returnCash.flowType"></Input>
+          <Checkbox style="margin-left:20px" v-model="returnCash.flowType" @on-change="flowTypeChange">
+            <span>手动录入</span>
+          </Checkbox>
+        </FormItem>
+        <div v-if="(returnCash.serialNumber && !hShow || returnCash.flowType) || returnCash.payType != '3'">
+          <div v-if="returnCash.payType == '3'">
+            <FormItem label="支付户名" prop="payAccountName">
+              <Input v-model="returnCash.payAccountName" :readonly="!returnCash.flowType"></Input>
+            </FormItem>
+            <FormItem label="回款银行" prop="returnBank">
+              <Input v-model="returnCash.returnBank" :readonly="true"></Input>
+            </FormItem>
+          </div>
+          <div v-else>
+            <FormItem label="支付单号" prop="returnCode">
+              <Input v-model="returnCash.returnCode"></Input>
+            </FormItem>
+          </div>
+          <FormItem label="回款时间" prop="returnTime">
+            <DatePicker type="datetime" v-model="returnCash.returnTime" format="yyyy-MM-dd HH:mm:ss"
+              :readonly="!returnCash.flowType && returnCash.payType == '3'"></DatePicker>
+          </FormItem>
+          <FormItem label="流水金额(元)" prop="serialCash">
+            <Input v-model="returnCash.serialCash" @on-keyup="returnCash.serialCash = conHandler(returnCash.serialCash)"
+              :readonly="!returnCash.flowType && returnCash.payType == '3'"></Input>
+          </FormItem>
+          <FormItem label="支付凭证">
+            <b-upload ref="uploadRef1" @fileData="fileData" :placeholdered="'请上传凭证'" :accepted="'.jpg,.png,.jpeg'"
+              :formated="['jpg', 'png', 'jpeg']" :multipled="false"></b-upload>
+          </FormItem>
+          <h3>关联订单回款明细</h3>
+          <Table ellipsis size="small" class="batch-tab-b" :loading="loading2" :columns="columns2" :data="selectData"
+            show-summary :summary-method="handleSummary" v-if="!hShow" border></Table>
+          <FormItem label="回款说明" style="margin-top:20px">
+            <Input type="textarea" v-model="returnCash.remark" placeholder="无回款说明" :autosize="{ minRows: 2, maxRows: 5 }"
+              :readonly="!returnCash.flowType && returnCash.payType == '3'"></Input>
+          </FormItem>
+        </div>
+      </Form>
+      <div slot="footer">
+        <Button type="primary" size="large" @click="batchConfirm" :disabled="isDisable">确定</Button>
+        <Button size="large" @click="visibleChange(false)">取消</Button>
+      </div>
+    </Modal>
+    <!-- 回款流水弹框 -->
+    <Modal title="回款流水" v-model="hShow" class-name="order-model other-model" :mask-closable="false">
+      <Input v-model="searVal" search enter-button="搜索" class="inpt-sear" @on-search="onSearch"
+        placeholder="请输入户名查询回款流水" />
+      <Table ellipsis :loading="loading1" :columns="columns" :data="selectList" :border="false"></Table>
+      <Page :current="page" :page-size="pageSize" :total="total" @on-change="changePage" v-show="total > 10" />
+      <div slot="footer">
+        <Button type="primary" size="large" @click="onConfirm" :disabled="isDisable">确定</Button>
+        <Button size="large" @click="hShow = false">取消</Button>
+      </div>
+    </Modal>
+  </div>
+</template>
+
+<script>
+import bUpload from '@/components/uploadFile.vue'
+import { dateFormatter } from '@/assets/js/date.js'
+import {formatAutoOrderType} from "@/utils/order/format";
+export default {
+  props: {
+    selectData: {},
+    status: Boolean,
+    bookLevel: String
+  },
+  components: {
+    bUpload
+  },
+  methods: {
+    conHandler(val) {
+      return val.match(/\d+(\.\d{0,2})?/) ? val.match(/\d+(\.\d{0,2})?/)[0] : ''
+    },
+    payTypeChange(val) {
+      if (val !== '3') {
+        this.returnCash.flowType = true
+        this.returnCash.serialNumber = ''
+        this.returnCash.returnTime = ''
+        this.returnCash.serialCash = ''
+        this.returnCash.returnVoucherUrl = ''
+        this.returnCash.remark = ''
+      } else {
+        this.returnCash.flowType = false
+      }
+    },
+    flowTypeChange(val) {
+      if (val) {
+        // this.$refs.returnCash.resetFields()
+        this.returnCash = {
+          flowType: true,
+          payType: '3',
+          serialNumber: '',
+          returnTime: '',
+          returnBank: '广发银行北京顺义支行',
+          serialCash: '',
+          returnVoucherUrl: '',
+          remark: ''
+        }
+        this.surplusData()
+      }
+    },
+    fixedNum(val) {
+      return val ? Number(parseFloat(val * 100).toFixed(0)) : 0
+    },
+    inited() {
+      Object.keys(this.returnCash).forEach(key => {
+        if (key == 'payType') {
+          return
+        } if (key == 'flowType') {
+          this.returnCash[key] = false
+        } else {
+          this.returnCash[key] = ''
+        }
+      })
+    },
+    init() {
+      const arr1 = [], arr2 = [], arr3 = []
+      this.selectData.forEach(v => {
+        if (v.company_name || v.id) {
+          arr1.push(v.company_name)
+          arr2.push(v.id)
+          arr3.push({
+            orderId: v.id
+          })
+        }
+      })
+      this.selectName = arr1[0]
+      this.selectId = arr2
+      this.selectOrderId = arr3
+    },
+    localed(val) {
+      return val.toLocaleString('zh', { style: 'currency', currency: 'CNY' })
+    },
+    surplusData() {
+      console.log('============')
+      this.init()
+      this.$request('/order/surplusPrice').data(
+        {
+          orderArr: this.selectOrderId
+        }
+      ).success((res) => {
+        if (res.data) {
+          this.allPrice = res.data.price
+          this.orderAtr = res.data.orderArr
+          console.log(parseInt(this.huiIds.TRSBAL * 100), res.data.price)
+          if (parseInt(this.huiIds.TRSBAL * 100) > res.data.price) {
+            this.$notify.warning({
+              title: '警告提示',
+              message: "订单回款失败,回款金额不符合!",
+              duration: 5000
+            })
+            return
+          } else {
+            console.log(this.huiIds)
+            if (!this.returnCash.flowType) {
+              this.returnCash.serialNumber = this.huiIds.BNKFLW
+              this.returnCash.returnTime = String(this.huiIds.BNKTIM)
+              this.returnCash.returnBank = this.huiIds.BNKNAM
+              this.returnCash.serialCash = this.huiIds.TRSBAL || 0
+              this.returnCash.payAccountName = this.huiIds.OTHNAM
+              this.returnCash.remark = this.huiIds.NUSAGE
+              setTimeout(() => {
+                this.hShow = false
+              }, 500)
+            }
+          }
+          console.log(parseInt(this.returnCash.serialCash * 100), res.data.price)
+          let arrs = this.selectData.length
+          this.selectData.forEach((v, i) => {
+            res.data.orderArr.forEach(s => {
+              if (String(s.orderId) === String(v.id)) {
+                v.no_return_monery = s.money / 100
+                if (parseInt(this.returnCash.serialCash * 100) == res.data.price) {
+                  v._readonly = true
+                  if (this.selectData.length > 1 || this.selectData.length === 1) {
+                    v.monery = ''
+                    v.monery += (s.money / 100).toString()
+                    console.log(v.monery)
+                  } else {
+                    v.monery += ''
+                  }
+                } else if (parseInt(this.returnCash.serialCash * 100) < res.data.price) {
+                  v.monery = ''
+                  console.log(this.returnCash.flowType)
+                  if (this.selectData.length > 1 && arrs == i + 1) {
+                    v._readonly = true
+                  } else {
+                    console.log(parseInt(this.returnCash.serialCash * 100), res.data.price)
+                    v._readonly = false
+                    this.$set(v, i, false)
+                  }
+                }
+              }
+
+            })
+
+          })
+        }
+      }).post()
+    },
+    handleSummary({ columns }) {
+      const sums = {}
+      columns.forEach((column, index) => {
+        const key = column.key
+        if (index === 0) {
+          sums[key] = {
+            key,
+            value: '总价'
+          }
+          return
+        }
+        console.log(this.selectData)
+        const values = this.selectData.map(item => Number(item[key]))
+        if (!values.every(value => isNaN(value))) {
+          const v = values.reduce((prev, curr) => {
+            const value = Number(curr)
+            if (!isNaN(value)) {
+              return prev + curr
+            } else {
+              return prev
+            }
+          }, 0)
+          sums[key] = {
+            key,
+            value: v
+          }
+        } else {
+          sums[key] = {
+            key,
+            value: ''
+          }
+        }
+      })
+      this.selectData.forEach((v, i) => {
+        this.orderAtr.forEach(s => {
+          if (String(s.orderId) === String(v.id)) {
+            if (this.returnCash.flowType && (parseInt(this.returnCash.serialCash * 100) == this.allPrice)) {
+              v.monery = ''
+              v.monery += (s.money / 100).toString()
+              v._readonly = true
+              this.$set(v, i, true)
+              console.log(v.monery)
+            } else if (this.returnCash.flowType && (parseInt(this.returnCash.serialCash * 100) < this.allPrice)) {
+              if (v._readonly) {
+                v.monery = ''
+                v._readonly = false
+                this.$set(v, i, false)
+              }
+            }
+          }
+        })
+      })
+      if (parseInt(this.returnCash.serialCash * 100) < this.allPrice) {
+        setTimeout(() => {
+          let lastVal = document.getElementById('re-moey' + (this.selectData.length - 1))
+          lastVal.value = this.returnCash.serialCash - sums.monery.value.toFixed(2)
+          lastVal.setAttribute('readonly', true)
+        }, 0)
+        this.lastVal = sums.monery.value
+      }
+      return sums
+    },
+    getData(val) {
+      this.init()
+      this.loading1 = true
+      let obj = {
+        offset: (this.page - 1) * this.pageSize,
+        pageSize: this.pageSize,
+        corporateName: val ? val : this.selectName
+      }
+      this.$request('/order/collectionFlow').data(obj).success((res) => {
+        if (res.data.list) {
+          this.selectList = res.data.list
+          this.total = res.data.total
+          this.loading1 = false
+          this.hShow = true
+          this.flage = false
+        }
+      }).post()
+    },
+    changePage(page) {
+      this.page = page
+      this.pageSize = 10
+      this.getData(this.searVal)
+    },
+    onSearch(val) {
+      this.page = 1
+      this.getData(val)
+    },
+    serialChange() {
+      if (this.returnCash.flowType) {
+        return
+      }
+      if (this.flage) {
+        this.searVal = this.selectData[0].payment_user
+        this.getData(this.searVal)
+      } else {
+        this.hShow = true
+      }
+    },
+    fileData(val) {
+      this.returnCash.returnVoucherUrl = val
+    },
+    onConfirm() {
+      if (this.huiIds.length == 0) {
+        this.$notify.warning({
+          title: '警告提示',
+          message: "至少选择一项!",
+          duration: 5000
+        })
+        return
+      }
+      this.surplusData()
+    },
+    batchConfirm() {
+      console.log(this.returnCash)
+      const arr1 = [], arr2 = []
+      let arr3 = []
+      this.selectData.forEach(v => {
+        arr1.push(this.fixedNum(v.monery))
+        arr2.push({
+          orderId: v.id,
+          money: this.fixedNum(v.monery),
+        })
+      })
+      arr3 = arr1.splice(0, arr1.length - 1)
+
+      if (this.returnCash.serialCash * 100 < this.allPrice) {
+        arr2[arr2.length - 1].money = this.fixedNum(this.returnCash.serialCash - this.lastVal)
+      }
+      let obj = {}
+      if (this.returnCash.payType == '3') {// 对公转账
+        obj = {
+          transactionId: this.huiIds.id ? String(this.huiIds.id) : 0,
+          orderArr: arr2,
+          returnVoucherUrl: this.returnCash.returnVoucherUrl,
+          returnType: Number(this.returnCash.payType),
+          flowType: this.returnCash.flowType ? 1 : 0,
+          returnRemarks: this.returnCash.remark,
+          returnMoney: this.fixedNum(this.returnCash.serialCash),
+          payAccountName: this.returnCash.payAccountName,
+          BNKTIM: dateFormatter(this.returnCash.returnTime),
+          BNKFLW: this.returnCash.serialNumber,
+          BNKNAM: this.returnCash.returnBank,
+          returnCode: this.returnCash.returnCode
+        }
+      } else {// 微信、支付宝
+        obj = {
+          transactionId: this.huiIds.id ? String(this.huiIds.id) : 0,
+          orderArr: arr2,
+          returnVoucherUrl: this.returnCash.returnVoucherUrl,
+          returnType: Number(this.returnCash.payType),
+          flowType: 1,
+          BNKTIM: dateFormatter(this.returnCash.returnTime),
+          returnRemarks: this.returnCash.remark,
+          returnMoney: this.fixedNum(this.returnCash.serialCash),
+          returnCode: this.returnCash.returnCode
+        }
+      }
+      console.log(obj)
+      this.$refs.returnCash.validate((valid) => {
+        console.log(valid)
+        if (valid) {
+          if (arr3.indexOf(0) > -1) {
+            this.$notify.warning({
+              title: '警告提示',
+              message: "请输入关联订单回款金额!"
+            })
+            return
+          }
+          if (this.returnCash.serialCash < this.lastVal) {
+            this.$notify.warning({
+              title: '警告提示',
+              message: "回款金额不能为负数!"
+            })
+            return
+          }
+          this.isDisable = true
+          this.$jyRequest('/jyOrderManager/order/editBatchReturn').data(obj).success((res) => {
+            this.hShow = false
+            this.asdShow = false
+            this.isDisable = false
+            this.huiIds = []
+            this.$notify.success({
+              title: '回款结果',
+              message: res.data?.msg || "订单回款成功!",
+              duration: 5000
+            })
+            this.$emit('onChange')
+          }).error(() => {
+            this.isDisable = false
+          }).post()
+        }
+      })
+    },
+    visibleChange(val) {
+      this.$refs.returnCash.resetFields()
+      this.returnCash = {
+        flowType: false,
+        payType: '3',
+        serialNumber: '',
+        returnTime: '',
+        returnBank: '广发银行北京顺义支行',
+        serialCash: '',
+        returnVoucherUrl: '',
+        remark: ''
+      }
+      if (val) {
+        this.flage = true
+        this.surplusData()
+        return
+      } else {
+        this.hShow = false
+        this.asdShow = false
+        this.huiIds = []
+        this.page = 1
+        this.pageSize = 10
+        setTimeout(() => {
+          this.selectList = []
+          this.inited()
+        }, 300)
+      }
+    }
+  },
+  data() {
+    const validateSequence = (rule, value, callback) => {
+      if (this.returnCash.flowType && value == '') {
+        callback(new Error('请输入银行流水号'))
+      } else {
+        callback()
+      }
+    }
+    const valTime = (rule, value, callback) => {
+      if (value == '') {
+        callback(new Error('请选择回款时间'))
+      } else {
+        callback()
+      }
+    }
+    const validCash = (rule, value, callback) => {
+      if (value == '') {
+        callback(new Error('请输入流水金额'))
+      } if (parseInt(this.returnCash.serialCash * 100) > this.allPrice) {
+        // callback(new Error('流水金额不能大于未回款金额'))
+        callback(new Error('流水金额需 <= ' + this.allPrice / 100))
+      } else {
+        callback()
+      }
+    }
+    return {
+      hShow: false,
+      asdShow: false,
+      loading1: false,
+      loading2: false,
+      isDisable: false,
+      page: 1,
+      flage: true,
+      searVal: '',
+      pageSize: 10,
+      total: 0,
+      selectId: [],
+      selectOrderId: [],
+      selectName: [],
+      selectList: [],
+      huiIds: [],
+      orderAtr: [],
+      allPrice: 0,
+      returnCash: {
+        flowType: false,
+        payType: '3',
+        serialNumber: '',
+        returnTime: '',
+        returnBank: '广发银行北京顺义支行',
+        serialCash: '',
+        returnVoucherUrl: '',
+        remark: ''
+      },
+      lastVal: 0,
+      sums: 0,
+      ruleValidate: {
+        payType: [{ required: true, message: '请选择支付方式', trigger: 'change' }],
+        serialNumber: [{ required: true, validator: validateSequence, trigger: 'blur' }],
+        payAccountName: [{ required: true, message: '请输入支付户名', trigger: 'blur' }],
+        returnBank: [{ required: true, message: '请输入回款银行', trigger: 'blur' }],
+        returnCode: [{ required: true, message: '请输入支付单号', trigger: 'blur' }],
+        returnTime: [{ required: true, type: 'datetime', validator: valTime, trigger: 'blur' }],
+        serialCash: [{ required: true, validator: validCash, trigger: 'blur' }]
+      },
+      payCashStatus: [
+        { v: '1', n: '微信' },
+        { v: '2', n: '支付宝' },
+        { v: '3', n: '对公转账' }
+      ],
+      columns: [
+        {
+          title: '#',
+          type: 'checkBox',
+          width: 40,
+          align: 'center',
+          render: (h, params) => {
+            return h('div', [
+              h('Checkbox', {
+                props: {
+                  value: params.row.checkBox
+                },
+                on: {
+                  'on-change': (e) => {
+                    this.selectList.forEach((items) => {
+                      this.$set(items, 'checkBox', false)
+                    })
+                    this.selectList[params.index].checkBox = e
+                    this.huiIds = params.row
+                  }
+                }
+              })
+            ])
+          }
+        },
+        {
+          title: '金额(元)',
+          key: 'TRSBAL',
+          align: 'center'
+        },
+        {
+          title: '户名',
+          key: 'OTHNAM',
+          align: 'center'
+        },
+        {
+          title: '到账时间',
+          key: 'BNKTIM',
+          align: 'center'
+        },
+        {
+          title: '银行流水号',
+          key: 'BNKFLW',
+          align: 'center',
+          render: (h, { row }) => {
+            return h('span', row.BNKFLW ? row.BNKFLW : '-')
+          }
+        }
+      ],
+      columns2: [
+        {
+          title: '序号',
+          type: 'index',
+          width: 80,
+          align: 'center',
+        },
+        {
+          title: '关联订单编号',
+          key: 'order_code',
+          align: 'center'
+        },
+        {
+          title: '产品类型',
+          key: 'product_type',
+          width: '170',
+          align: 'center',
+          render: (h, { row }) => {
+            return h('span', formatAutoOrderType(row))
+          }
+        },
+        {
+          title: '未回款金额(元)',
+          key: 'no_return_monery',
+          align: 'center'
+        },
+        {
+          title: '回款金额(元)',
+          key: 'monery',
+          align: 'center',
+          width: '210',
+          render: (h, { row, index }) => {
+            return h('Input', {
+              props: {
+                elementId: 're-moey' + index,
+                placeholder: '请输入关联订单回款金额',
+                value: row.monery,
+                readonly: row._readonly
+              },
+              on: {
+                'on-change': (e) => {
+                  this.selectData.forEach((v, i) => {
+                    if (row.id == v.id) {
+                      v.monery = e.target.value
+                      this.$set(v, i, e.target.value)
+                    }
+                  })
+                  console.log(this.selectData)
+                }
+              }
+            })
+          }
+        }
+      ]
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+.ivu-page {
+  text-align: right;
+  margin-top: 20px;
+}
+
+h3 {
+  margin-bottom: 20px;
+  color: rgb(54, 163, 247);
+  font-weight: 700;
+}
+
+::v-deep #re-moey {
+  text-align: center;
+}
+
+.inpt-sear {
+  width: 500px;
+  margin: 0 auto;
+  margin-bottom: 14px;
+}
+
+::v-deep .ivu-table-summary {
+  display: none;
+}
+
+::v-deep .ivu-table-overflowX {
+  overflow: hidden;
+}
+</style>

+ 1102 - 0
src/views/order/components/new-detailModel.vue

@@ -0,0 +1,1102 @@
+<template>
+  <div class="detail-model">
+    <!-- 线下开发票 -->
+    <Modal title="线下开发票" v-model="iShow" class-name="order-model piao-model" :mask-closable="false"
+      @on-visible-change="visibleChange">
+      <!-- <Select placeholder="请选择发票类型" v-model="invoice.type" style="width:100%;margin: 20px 0">
+          <Option v-for="item in invoType" :value="item.n" :key="item.v">{{ item.n }}</Option>
+      </Select> -->
+      <p style="text-align:center;margin:16px 0;font-size:15px">确定线下开发票吗?如若确定,则会关闭用户线上开票入口。</p>
+      <div slot="footer">
+        <Button type="primary" size="large" @click="invoSave" :disabled="isDisable">确定</Button>
+        <Button size="large" @click="iShow = false">取消</Button>
+      </div>
+    </Modal>
+    <!-- 新增回款信息 -->
+    <Modal title="新增回款信息" v-model="backShow" class-name="order-model back-model" :mask-closable="false"
+      @on-visible-change="visibleChange1">
+      <Form ref="backed" :model="backed" :rules="backRuleValidate" :label-width="110">
+        <FormItem label="回款状态" prop="return_status">
+          <Select v-model="backed.return_status" placeholder="请选择回款状态">
+            <Option v-for="item in backSats" :value="item.v" :key="item.v">{{ item.n }}</Option>
+          </Select>
+        </FormItem>
+        <FormItem label="回款交易详情" class="back-list">
+          <Form ref="returned" :model="returned" :rules="backDetailValidate">
+            <Row :gutter="10" class="back-row">
+              <Col span="8">
+              <FormItem prop="returnTime" v-if="visibleChange1">
+                <date-sigle ref="sigleRef" :dateType="'date'" :placeholderd="'请选择回款时间'" @startDate="startDate"
+                  :overTime="0"></date-sigle>
+              </FormItem>
+              </Col>
+              <Col span="8">
+              <FormItem prop="returnMoney">
+                <Input v-model="returned.returnMoney" type="text" placeholder="请输入回款金额" :maxlength="9"
+                  @on-keyup="returned.returnMoney = inptReg(returned.returnMoney)"></Input>
+              </FormItem>
+              </Col>
+              <Col span="8">
+              <FormItem prop="">
+                <Input v-model="returned.returnRemark" type="text" placeholder="请输入回款说明(选填)"></Input>
+              </FormItem>
+              </Col>
+            </Row>
+            <Row :gutter="10" class="back-row">
+              <Col span="8">
+              <FormItem prop="returnType">
+                <Select v-model="returned.returnType" placeholder="请选择支付方式">
+                  <Option v-for="item in backPayType" :value="item.v" :key="item.v">{{ item.n }}</Option>
+                </Select>
+              </FormItem>
+              </Col>
+              <Col span="8">
+              <FormItem prop="">
+                <Input v-model="returned.returnCode" type="text" placeholder="请输入支付单号"></Input>
+              </FormItem>
+              </Col>
+              <Col span="8">
+              <FormItem prop="returnInvoiceStatus">
+                <Select v-model="returned.returnInvoiceStatus" placeholder="请选择发票状态">
+                  <Option v-for="item in backInvoStas" :value="item.v" :key="item.v">{{ item.n }}</Option>
+                </Select>
+              </FormItem>
+              </Col>
+            </Row>
+            <FormItem prop="">
+              <b-upload ref="uploadRef1" @fileData="fileData" :placeholdered="'请上传凭证'" :accepted="'.jpg,.png,.jpeg'"
+                :formated="['jpg', 'png', 'jpeg']" :multipled="false"
+                :validateVar="returned.returnVoucherUrl"></b-upload>
+            </FormItem>
+          </Form>
+        </FormItem>
+      </Form>
+      <div slot="footer">
+        <Button type="primary" size="large" @click="backSave" :disabled="isDisable">提交</Button>
+        <Button size="large" @click="backCancel">取消</Button>
+      </div>
+    </Modal>
+    <!-- 上传归档协议 -->
+    <Modal title="上传归档协议" v-model="pShow" class-name="order-model contract-model" :mask-closable="false"
+      @on-visible-change="visibleChange">
+      <b-upload ref="uploadRef2" @fileData="contractFile" :placeholdered="'请上传归档协议'"
+        :accepted="'.doc,.pdf,.docx,.rar,.zip,.jpg,.png,.jpeg'"
+        :formated="['doc', 'pdf', 'docx', 'rar', 'zip', 'jpg', 'png', 'jpeg']" :multipled="false"></b-upload>
+      <div slot="footer">
+        <Button type="primary" size="large" @click="pingSub" :disabled="isDisable">提交</Button>
+        <Button size="large" @click="pingCancel">取消</Button>
+      </div>
+    </Modal>
+    <!-- 审核 -->
+    <Modal title="审核" v-model="sShow" class-name="shen-model" :mask-closable="false" @on-visible-change="visibleChange">
+      <p>请确认此订单审核结果!</p>
+      <Input type="tel" placeholder="请输入应付金额(元)" v-model="funds.sum" :maxlength="9"
+        @on-keyup="funds.sum = inptReg(funds.sum)"></Input>
+      <div slot="footer">
+        <Button type="primary" size="large" @click="subConfirm">通过</Button>
+        <Button type="error" size="large" @click="defeated">失败</Button>
+        <Button size="large" @click="sShow = false">取消</Button>
+      </div>
+    </Modal>
+    <!-- 退款登记 -->
+    <Modal title="退款登记" v-model="tShow" class-name="order-model tui-model" :mask-closable="false"
+      @on-visible-change="visibleChange">
+      <Form ref="models" :model="models" :rules="refundRuleValidate" :label-width="110">
+        <FormItem label="退款金额" prop="refundMoney">
+          <Input v-model="models.refundMoney" type="text" :maxlength="9" placeholder="请输入退款金额"
+            @on-keyup="models.refundMoney = inptReg(models.refundMoney)"></Input>
+        </FormItem>
+        <FormItem label="退款原因" prop="refundType">
+          <Select placeholder="请选择退款原因" clearable v-model="models.refundType">
+            <Option v-for="item in refundType" :value="item.v" :key="item.v">{{ item.n }}</Option>
+          </Select>
+        </FormItem>
+        <FormItem label="备注">
+          <Input v-model="models.refundReason" type="textarea" size="large" :autosize="{ minRows: 2, maxRows: 5 }"
+            placeholder="请输入备注" :maxlength="255"></Input>
+        </FormItem>
+      </Form>
+      <div slot="footer">
+        <Button type="primary" size="large" @click="subSave('models')" :disabled="isDisable">提交</Button>
+        <Button size="large" @click="tShow = false">取消</Button>
+      </div>
+    </Modal>
+    <!-- 修正记录 -->
+    <Modal title="红冲" v-model="correctionShow" class-name="order-model tui-model" :mask-closable="false"
+      @on-visible-change="visibleChange">
+      <!-- <label class="correctionLabel">请输入该订单最终准确的信息:</label> -->
+      <Form ref="correctionModels" :model="models" :label-width="110">
+        <FormItem label="红冲类型">
+          <RadioGroup v-model="models.redType" @on-change="checkAllGroupChange">
+            <Radio label="签约主体红冲"></Radio>
+            <Radio label="金额红冲"></Radio>
+          </RadioGroup>
+        </FormItem>
+        <p class="correctionLabel">请输入该订单最终准确的信息:</p>
+        <FormItem label="签约主体" v-if="redCorrection == 3 || redCorrection == 1">
+          <Input v-model="signingSubject" type="text" :maxlength="50" disabled placeholder="请输入签约主体"></Input>
+        </FormItem>
+        <!-- bigPayMoney -->
+        <FormItem label="合同金额" v-if="(redCorrection == 3 || redCorrection == 2) && bigCorrection">
+          <Input v-model="models.payMoney" type="text" :maxlength="9" placeholder="合同金额"></Input>
+        </FormItem>
+        <!-- <FormItem label="子账号应付金额" v-if="(redCorrection == 3 || redCorrection == 2) && bigCorrection">
+            <Input v-model="models.subMoney" type="text" :maxlength="9" :disabled="!(filterData.subPayMoney && filterData.subPayMoney>0)" placeholder="请输入子账号应付金额"></Input>
+        </FormItem>
+        <FormItem label="补充包应付金额" v-if="(redCorrection == 3 || redCorrection == 2) && bigCorrection">
+            <Input v-model="models.supplyMoney" type="text" :maxlength="9" :disabled="!(filterData.supplyPayMoney && filterData.supplyPayMoney>0)" placeholder="请输入补充包应付金额"></Input>
+        </FormItem> -->
+        <!-- <FormItem label="订单金额" v-if="(redCorrection == 3 || redCorrection == 2) && !bigCorrection">
+            <Input v-model="models.orderMoney" type="text" :maxlength="9" placeholder="请输入订单金额"></Input>
+        </FormItem> -->
+        <FormItem label="合同金额" v-if="(redCorrection == 3 || redCorrection == 2) && !bigCorrection">
+          <Input v-model="models.payMoney" type="text" :maxlength="9" placeholder="请输入合同金额"></Input>
+        </FormItem>
+        <FormItem label="佣金" v-if="redCorrection == 3 || redCorrection == 2">
+          <Input v-model="models.commission" type="text" :maxlength="9" placeholder="请输入佣金"></Input>
+        </FormItem>
+        <!-- <FormItem label="手续费" v-if="redCorrection == 3 || redCorrection == 2">
+          <Input v-model="models.proceduresMoney" type="text" :maxlength="9" placeholder="请输入手续费"></Input>
+        </FormItem> -->
+        <FormItem label="修正原因">
+          <Select placeholder="请选择修正原因" clearable v-model="models.correctionType">
+            <Option v-for="item in correctionType" :value="item.v" :key="item.v">{{ item.n }}</Option>
+          </Select>
+        </FormItem>
+        <FormItem label="">
+          <Input v-model="models.correctionReason" v-if="models.correctionType === '其他'" type="textarea" size="large"
+            :autosize="{ minRows: 2, maxRows: 5 }" placeholder="请输入修正原因"></Input>
+        </FormItem>
+      </Form>
+      <div slot="footer">
+        <Button type="primary" size="large" @click="correctionSave()" :disabled="redCorrection == 4" :loading="btnloading">提交</Button>
+        <Button size="large" @click="correctionShow = false">取消</Button>
+      </div>
+    </Modal>
+    <!-- 权限开通 -->
+    <Modal title="权限开通" v-model="permissionActivationShow" class-name="order-model permissionActivation-model"
+      :mask-closable="false" @on-visible-change="permissionActivationVisible">
+      <Form ref="permissionActivation" :model="permissionActivation" :label-width="120">
+        <FormItem label="开通权益手机号" style="width: 460px;" required>
+          <Input class="ipt-inpt" v-model="permissionActivation.phone" type="text" @on-keyup="keyHandler"
+            :maxlength="11" placeholder="请输入手机号"></Input>
+        </FormItem>
+        <FormItem label="开始日期" style="width: 460px;" required>
+          <date-sigle ref="sigleRef1" :dateType="'date'" :placeholderd="'请选择开始日期'" @startDate="startDate_"
+            :overTime="0"></date-sigle>
+        </FormItem>
+      </Form>
+      <div slot="footer">
+        <Button type="primary" size="large" @click="pa_Save" :disabled="pa_dis">确定</Button>
+        <Button size="large" @click="permissionActivationShow = false">取消</Button>
+      </div>
+    </Modal>
+    <!-- 权限开通 -->
+    <Modal title="业绩变更" v-model="performanceShow" class-name="order-model performance-model" :mask-closable="false"
+      @on-visible-change="performanceVisible">
+      <Form ref="performance" :model="performanceFrom" :label-width="120">
+        <FormItem label="请输入变更后业绩归属情况" class="formTitle" :label-width="230"></FormItem>
+        <PerformanceBelongsModule ref="modulePerformanceBelong" setDefaultUser />
+        <FormItem label="销售人员">
+          <sale-select ref="saleRef" :saleType="'1'" @salePerson="salePerson" transfer></sale-select>
+        </FormItem>
+        <FormItem class="table-order1" v-show="saleTableData.length > 0">
+          <Table border :columns="saleTable" :data="saleTableData">
+            <template slot-scope="{ row }" slot="name">
+              <strong>{{ row.name }}</strong>
+            </template>
+            <template slot-scope="{ row }" slot="saler_dept">
+              <strong>{{ row.saler_dept }}</strong>
+            </template>
+            <template slot-scope="{ row, index }" slot="money">
+              <Input style="padding: 0 10px;" v-model="saleTableData[index].money" type="number" placeholder="请输入"></Input>
+            </template>
+            <template slot-scope="{ row }" slot="channel">
+              <span style="display:none;">{{ row.channel }}</span>
+              <!-- <Input v-model="saleTableData[index].channel" type="number" placeholder="请输入"></Input> -->
+<!--              <Cascader :data="channelListGetters" v-model="row.channel" @on-change="(value,selectedData)=>{ onChangeCascader(value,selectedData,row)}" transfer />-->
+              <!-- <v-cascader ref="casRef" :data-id="row.channel" :initVal="row.channel" placeholderType="销售渠道" type="1" quType="1" transfer></v-cascader> -->
+              <el-cascader
+                  v-model="row.distribution_channel"
+                  :options="saleChannelOptions"
+                  :props="cascaderProps"
+                  @change="onChangeCascader(row, $event)"
+                  size="medium"
+                  placeholder="请选择销售渠道"
+                  clearable>
+              </el-cascader>
+            </template>
+          </Table>
+        </FormItem>
+        <FormItem label="变更原因">
+          <RadioGroup v-model="performanceFrom.changeReason">
+            <Radio :label="item" v-for="item in reasonList" :key="item">{{item}}</Radio>
+          </RadioGroup>
+        </FormItem>
+      </Form>
+      <div slot="footer">
+        <Button type="primary" size="large" :disabled="performanceDis" @click="performanceSave">确定</Button>
+        <Button size="large" @click="performanceShow = false">取消</Button>
+      </div>
+    </Modal>
+    <!-- 微信/支付宝付款码 -->
+    <Modal title="微信/支付宝付款码" v-model="paymentCodeShow" class-name="order-model payment-code-model" :mask-closable="false"
+      @on-visible-change="onPaymentVisibleChange">
+      <Form ref="performance" :model="paymentForm" :label-width="180">
+        <FormItem label="付款金额(元):">
+          <Input v-model="paymentForm.money" type="number" placeholder="请输入付款金额" @on-change="onChangePayMoney"></Input>
+        </FormItem>
+        <FormItem label="付款方式:">
+          <RadioGroup v-model="paymentForm.mode" @on-change="onChangePayWay">
+            <Radio label="1">微信</Radio>
+            <Radio label="2">支付宝</Radio>
+          </RadioGroup>
+        </FormItem>
+        <div class="screenshot-container" ref="screenshotRef" v-loading="paymentLoading" element-loading-background="rgba(255,255, 255)">
+          <img class="screenshot-logo" src="@/assets/images/logo_main.png" alt="logo">
+          <div class="screenshot-content">
+            <div class="screenshot-info">
+              <p v-if="paymentForm.account">{{paymentForm.account}}</p>
+              <p v-if="paymentForm.product">产品类型:{{paymentForm.product}}</p>
+            </div>
+            <div class="screenshot-money">金额 <i class="num">¥{{formatPrice(paymentForm.money, -1, true)}}</i></div>
+            <div class="screenshot-code">
+              <img :src="paymentForm.imgCode">
+            </div>
+            <p class="screenshot-tip">使用手机{{paymentForm.mode === '1' ? '微信' : '支付宝'}}扫描二维码支付</p>
+            <p class="screenshot-date">此二维码有效期截至到:{{ dateFormatter(paymentForm.expire * 1000, 'yyyy年MM月dd日') || '--'}}</p>
+          </div>
+        </div>
+      </Form>
+      <div slot="footer" style="display:flex;flex-direction: column;align-items: center;">
+        <Button style="width:100%;" type="primary" size="large" :disabled="saveCodeDisabled" @click="onSavePaymentCode">保存二维码</Button>
+        <p class="guide-tip">将二维码发送给客户,引导客户扫码支付</p>
+      </div>
+    </Modal>
+  </div>
+</template>
+
+<script>
+import html2canvas from 'html2canvas'
+import { mapGetters } from 'vuex'
+import dateSigle from '@/components/dateSigle.vue'
+import bUpload from '@/components/uploadFile.vue'
+import saleSelect from './salesSelect.vue'
+import { dateFormatter } from '@/assets/js/date'
+import { copyImage } from '@/utils/copy'
+// import { Loading } from 'element-ui';
+import vCascader from '@/components/cascader'
+import { getChannelCode, formatPrice, debounce } from '@/utils/globalFun'
+import QRCode from 'qrcode'
+import PerformanceBelongsModule from "@/views/create-order/components/performanceBelongsModule.vue";
+export default {
+  props: {
+    data: {}
+  },
+  components: {
+    PerformanceBelongsModule,
+    dateSigle,
+    bUpload,
+    saleSelect,
+    vCascader
+  },
+  methods: {
+    dateFormatter, formatPrice,
+    inited() {
+      this.invoice.type = ''
+      this.funds.sum = ''
+      this.redCorrection = 4
+      this.models.redType = ""
+      this.models.refundReason = ''
+      this.models.refundType = ''
+      this.models.correctionReason = ''
+      this.models.correctionType = ''
+      this.contract.contractFileUrl = ''
+      this.returned.returnVoucherUrl = ''
+      this.returned.returnRemark = ''
+      this.returned.returnCode = ''
+      this.$refs.sigleRef.initd()
+      this.$refs['backed'].resetFields()
+      this.$refs['returned'].resetFields()
+      this.$refs['models'].resetFields()
+      this.$refs.uploadRef1.uploadShow = false
+      this.$refs.uploadRef1.payHtml = ''
+      this.$refs.uploadRef2.uploadShow = false
+      this.$refs.uploadRef2.payHtml = ''
+    },
+    inptReg(val) {
+      return val.match(/\d+(\.\d{0,2})?/) ? val.match(/\d+(\.\d{0,2})?/)[0] : ''
+    },
+    keyHandler() {
+      this.permissionActivation.phone = this.permissionActivation.phone.replace(/[^\d]/g, '')
+    },
+    timeReg(val) {
+      return new Date(dateFormatter(val, 'yyyy-MM-dd') + ' 00:00:00').getTime() / 1000
+    },
+    startDate_(val) {
+      if (val) {
+        this.permissionActivation.startTime = this.timeReg(val)
+      } else {
+        this.permissionActivation.startTime = ''
+      }
+    },
+    permissionActivationVisible(val) {
+      if (val) {
+        this.permissionActivation.phone = this.orderDetail.user_phone || ''
+        this.permissionActivation.orderCode = this.orderDetail.order_code
+      } else {
+        this.permissionActivation.phone = ''
+        this.permissionActivation.startTime = ''
+        this.permissionActivation.orderCode = ''
+        this.$refs.sigleRef1.dataVals = ''
+      }
+    },
+    pa_Save() {
+      if (this.permissionActivation.phone == '') {
+        this.$notify.warning({ title: '请输入手机号' })
+        return
+      }
+      if (this.permissionActivation.phone && !/^1[3456789]\d{9}$/.test(this.permissionActivation.phone)) {
+        this.$notify.warning({ title: '手机号格式不正确' })
+        return
+      }
+      if (this.permissionActivation.startTime == '') {
+        this.$notify.warning({ title: '请选择开始日期' })
+        return
+      }
+      this.pa_dis = true
+      let obj = this.permissionActivation
+      this.$jyRequest('/jyOrderManager/order/serviceOpen').data(obj).success(() => {
+        this.permissionActivationShow = false
+        this.$notify.success({ title: '提交成功' })
+        this.pa_dis = false
+        this.$emit('refresh')
+      }).error(() => {
+        this.pa_dis = false
+      }).post()
+    },
+    performanceVisible(val) {
+      if (val) {
+        const { saleDataRes } = JSON.parse(JSON.stringify(this.data))
+        let list =[]
+        if (saleDataRes.saleFinal) {
+          list = saleDataRes.saleFinal.list || []
+          let sarr = list.map(ele => {
+            return ele.id + ''
+          })
+          this.$nextTick(()=>{
+            this.$refs.saleRef.salePerson = sarr
+            setTimeout(() => {
+            if (saleDataRes.saleFinal  && saleDataRes.saleFinal.list.length > 0) {
+            let salelist = JSON.parse(JSON.stringify(saleDataRes.saleFinal.list))
+            salelist.forEach(ele => {
+              ele.channel = getChannelCode(this.channelListGetters, ele.distribution_channel)
+              ele.money = ele.money / 100
+            })
+            this.saleTableData = salelist
+            let ajaxinitSalelist = JSON.parse(JSON.stringify(saleDataRes.saleFinal.list))
+             ajaxinitSalelist.forEach(ele => {
+             ele.money = ele.money / 100
+            //  ele.channel = ele.distribution_channel
+            })
+            this.ajaxinitSalelist = ajaxinitSalelist
+          }
+          }, 500)
+          })
+           this.reasonList = saleDataRes.reason
+        }
+      }else{
+        this.performanceFrom.changeReason = ''
+        this.saleTableData = []
+        this.$refs.saleRef.salePerson = []
+      }
+    },
+      performanceSave() {
+        let salesMoneylist = this.saleTableData.map(ele => {
+          const channel = ele.channel[1]? ele.channel[1] : ''
+          return { id: Number(ele.id), money: this.fixedNum(ele.money), channel: channel }
+        })
+        this.performanceDis = true
+        this.$jyRequest('/jyOrderManager/order/saleRecord/update').data({
+          orderCode: this.orderDetail.order_code,
+          doType: "update",
+          record: salesMoneylist,
+          reason: this.performanceFrom.changeReason
+       }).success((res) => {
+            this.performanceDis = false
+            if (res.data == 'success') {
+              this.$notify.success({ title: '提交成功' })
+              this.performanceShow = false
+            }
+            this.$emit('refresh', '业绩归属信息')
+          }).error(() => {
+            this.performanceDis = false
+          }).post()
+
+      },
+      onChangeCascader(row, val) {
+        let list = this.saleTableData
+        // console.log(JSON.stringify(row));
+        list.forEach(v => {
+          if (v.id === row.id) {
+            v.distribution_channel = val[1]
+            v.channel = val
+          }
+        })
+      },
+      salePerson(val){
+        let saleNameArr = []
+        let initlist = JSON.parse(JSON.stringify(this.ajaxinitSalelist))
+        const channelMap = this.channelMapGetters
+        val.forEach((v,i) => {
+          let vjson = JSON.parse(v)
+          saleNameArr.push({ name: vjson.username,id: vjson.id,saler_dept: vjson.deptName,money: '',channel: getChannelCode(this.channelListGetters, channelMap[vjson.deptId])})
+          initlist.forEach((ele) =>{
+            if(ele.id == vjson.id){
+              saleNameArr[i].money = ele.money
+              saleNameArr[i].channel = ele.channel ? ele.channel : getChannelCode(this.channelListGetters, channelMap[vjson.deptId])
+            }
+          })
+        })
+        this.saleTableData = saleNameArr
+      },
+      visibleChange1(val) {
+        if (val == false) {
+          setTimeout(() => {
+            this.inited()
+          }, 500)
+        } else {
+          this.isDisable = false
+        }
+      },
+      visibleChange(val) {
+        if (val == false) {
+          setTimeout(() => {
+            this.inited()
+          }, 500)
+        } else {
+          this.isDisable = false
+        }
+      },
+      invoSave() {// 线下开发票
+        // if (this.invoice.type == '') {
+        //   this.$Message.warning('请选择发票类型')
+        //   return
+        // }
+        this.isDisable = true
+        this.$request('/order/openInvoice').data({
+          orderCode: this.orderDetail.order_code,
+          // invoiceType: this.invoice.type,
+          // userId: this.orderDetail.user_id
+        }).showSuccessTip().success(() => {
+          this.iShow = false
+          this.inited()
+          setTimeout(() => {
+            this.isDisable = false
+          }, 1000)
+          this.$emit('refresh', '发票信息')
+        }).error(() => {
+          this.isDisable = false
+        }).post()
+      },
+      fileData(val) {
+        this.returned.returnVoucherUrl = val
+      },
+      contractFile(val) {
+        this.contract.contractFileUrl = val
+      },
+      startDate(val) {
+        this.returned.returnTime = val
+      },
+      fixedNum(val) {
+        return val ? Number(parseFloat(val * 100).toFixed(0)) : 0
+      },
+      backSave() {// 新增回款信息提交
+        let obj = {
+          id: parseInt(this.orderDetail.id),
+          orderCode: this.orderDetail.order_code,
+          return_status: parseInt(this.backed.return_status ? this.backed.return_status : 0),
+          returnTime: this.returned.returnTime,
+          returnMoney: this.fixedNum(this.returned.returnMoney),
+          returnRemark: this.returned.returnRemark,
+          returnType: parseInt(this.returned.returnType ? this.returned.returnType : 0),
+          returnCode: this.returned.returnCode,
+          returnInvoiceStatus: parseInt(this.returned.returnInvoiceStatus ? this.returned.returnInvoiceStatus : 0),
+          returnVoucherUrl: this.returned.returnVoucherUrl
+        }
+        this.$refs.backed.validate((valid) => {
+          if (valid) {
+            this.$refs.returned.validate((valid) => {
+              if (valid) {
+                this.isDisable = true
+                this.$request('/order/editReturnInfo').data(
+                  obj
+                ).showSuccessTip().success(() => {
+                  this.backShow = false
+                  this.inited()
+                  setTimeout(() => {
+                    this.isDisable = false
+                  }, 1000)
+                  this.$emit('refresh', '回款信息')
+                }).error(() => {
+                  this.isDisable = false
+                }).post()
+              }
+            })
+          } else {
+            this.$refs.returned.validate((valid) => {
+              if (valid) { }
+            })
+          }
+        })
+
+      },
+      backCancel() {
+        this.backShow = false
+      },
+      pingSub() {// 上传归档协议
+        if (!this.contract.contractFileUrl) {
+          this.$notify.warning({ title: '请上传归档协议'})
+          return
+        }
+        this.isDisable = true
+        this.$request('/order/uploadContractFile').data({
+          contractId: $.isEmptyObject(this.contractData) == false ? this.contractData.id : '',
+          orderCode: this.orderDetail.order_code,
+          contractFileUrl: this.contract.contractFileUrl
+        }).showSuccessTip().success(() => {
+          this.pShow = false
+          this.inited()
+          setTimeout(() => {
+            this.isDisable = false
+          }, 1000)
+          this.$emit('refresh', '协议信息')
+        }).error(() => {
+          this.isDisable = false
+        }).post()
+      },
+      pingCancel() {
+        this.pShow = false
+        setTimeout(() => {
+          this.inited()
+        }, 500)
+      },
+      audFunc(num) {
+        this.isDisable = true
+        this.$request('/order/orderList/transferAccounts').data({
+          pay_money: this.fixedNum(this.funds.sum),
+          order_code: this.orderDetail.order_code,
+          courseStatus: num
+        }).showSuccessTip().success(() => {
+          this.sShow = false
+          this.inited()
+          setTimeout(() => {
+            this.isDisable = false
+          }, 1000)
+          this.$emit('refresh')
+        }).error(() => {
+          this.isDisable = false
+        }).post()
+      },
+      subConfirm() {// 订单审核通过
+        if (this.funds.sum == '') {
+          this.$notify.warning({ title: '应付金额为必填项'})
+          return
+        }
+        this.audFunc(4)
+      },
+      defeated() {// 订单审核失败
+        this.audFunc(3)
+      },
+      qmxed() {
+        if (this.isStatus == 'qmx') {
+          return this.returnInfo.money == this.fixedNum(this.models.refundMoney) ? 1 : 2
+        } else {
+          return this.fixedNum(this.models.refundMoney) > this.payMoney || this.fixedNum(this.models.refundMoney) == this.payMoney ? 1 : 2
+        }
+      },
+      subSave(name) {// 退款
+        let sums = 0
+        if (this.isStatus == 'qmx') {
+          this.returnRes.forEach(v => {
+            sums = sums + v.return_money
+          })
+          if (this.fixedNum(this.models.refundMoney) / 100 > sums / 100) {
+            this.$notify.warning({title: '退款金额不能大于已回款金额!'})
+            return
+          }
+        }
+        let obj = {
+          orderCode: this.orderDetail.order_code,
+          refundMoney: this.fixedNum(this.models.refundMoney),
+          refundReason: this.models.refundReason,
+          refundType: this.models.refundType,
+          isOffline: this.isStatus == 'qmx' ? 1 : 0,
+          refundStatus: this.qmxed()
+        }
+        this.$refs[name].validate((valid) => {
+          if (valid) {
+            this.isDisable = true
+            this.$jyRequest('/jyOrderManager/order/refund').data(
+              obj
+            ).showSuccessTip().success(() => {
+              this.tShow = false
+              this.models.refundReason = ''
+              this.models.refundType = ''
+              setTimeout(() => {
+                this.isDisable = false
+              }, 1000)
+              this.$emit('refresh', '退款信息')
+            }).error(() => {
+              this.isDisable = false
+            }).post()
+          }
+        })
+      },
+      correctionSave() {
+        if (this.models.correctionType === '') {
+          this.$notify.warning({title: '修正原因为必填项'})
+          return
+        }
+        let obj = {
+          orderCode: this.orderDetail.order_code,
+          // orderMoney: this.fixedNum(this.models.orderMoney),
+          // payMoney: this.orderDetail.product_type === '大会员' ? this.fixedNum(this.models.bigPayMoney) : this.fixedNum(this.models.payMoney),
+          payMoney: this.fixedNum(this.models.payMoney),
+          bigSubMoney: this.fixedNum(this.models.subMoney),
+          supplyMoney: this.fixedNum(this.models.supplyMoney),
+          commission: this.fixedNum(this.models.commission),
+          proceduresMoney: this.fixedNum(this.models.proceduresMoney),
+          correctionReason: this.models.correctionType !== '其他' ? this.models.correctionType : this.models.correctionReason,
+          redType: this.models.redType,
+          signingSubject: this.signingSubject,
+        }
+        this.btnloading = true
+        this.$jyRequest('/jyOrderManager/order/orderRedPunch').data(
+          obj
+        ).showSuccessTip().success(() => {
+          this.correctionShow = false
+          this.btnloading = false
+          this.inited()
+          this.$emit('refresh', '红冲记录')
+        }).error(() => { }).post()
+      },
+      checkAllGroupChange(data) {
+        console.log(data)
+        if (data === '签约主体红冲') {
+          this.redCorrection = 1
+        } else if (data === '金额红冲') {
+          this.redCorrection = 2
+        }
+        // 以下为多选时判断
+        // if (data.length === 1 && data[0] === '签约主体红冲') {
+        //   this.redCorrection = 1
+        // } else if (data.length === 1 && data[0] === '金额红冲') {
+        //   this.redCorrection = 2
+        // } else if (data.length === 0) {
+        //   this.redCorrection = 4
+        // } else {
+        //   this.redCorrection = 3
+        // }
+      },
+      onPaymentVisibleChange(val){
+        console.log(val)
+        if(val) {
+          this.getPayOrderInfo('query')
+        }
+      },
+      getPayOrderInfo(doType, money, payWay) {
+        this.paymentLoading = true
+        this.$request('/order/getReturnOnline').data(
+          {
+            orderCode: this.orderDetail.order_code,
+            doType,
+            money: money ? Math.round(Number(money) * 10000) / 100 : undefined,
+            payWay: payWay ? Number(payWay) : undefined
+          }
+        ).success((res) => {
+          if (res.data) {
+            if(doType === 'query') {
+              this.paymentForm.money = res.data.money / 100
+              this.paymentForm.product = res.data.product
+              this.paymentForm.account = res.data.account
+              this.paymentForm.noPayment = res.data.money / 100
+              this.getPayOrderInfo('getPay', this.paymentForm.money, this.paymentForm.mode)
+            } else if (doType === 'getPay') {
+              this.paymentLoading = false
+              // this.paymentForm.imgCode = res.data.product
+              this.paymentForm.expire = res.data.expire
+              QRCode.toDataURL(res.data.product,{
+                color: {
+                  dark:"#000000",
+                  light:"#FFFFFF"
+                }
+              }).then((url) => {
+                // 获取到url后即可在页面使用--二维码图片
+                this.paymentForm.imgCode = url
+              }).catch((e) => {
+                console.log('e', e)
+                this.$toast('二维码转换失败')
+              })
+            }
+          }
+        }).error(() => { }).post()
+      },
+      onChangePayWay(val){
+        this.paymentForm.mode = val
+        this.paymentLoading = true
+        this.getPayOrderInfo('getPay', this.paymentForm.money, this.paymentForm.mode)
+      },
+      onChangePayMoney: debounce(function () {
+        // this.paymentForm.money = formatInputMoney(this.paymentForm.money)
+        const noPayment = this.paymentForm.noPayment
+        const currentMoney = Number(this.paymentForm.money)
+        console.log(noPayment, currentMoney, 'change money');
+        // 正则表达式:只允许数字,小数点,且小数点后最多两位
+        const regex = /^\d+(\.\d{1,2})?$/;
+        // 如果输入的值不匹配正则表达式,则将其设置为上一个匹配的值
+        if (!regex.test(this.paymentForm.money)) {
+          // this.paymentForm.money = this.paymentForm.money.replace(/[^0-9.-]+/g, '');
+          return this.$toast('只能输入正数数字,小数点,且小数点后最多两位')
+        }
+        if (currentMoney > noPayment || !currentMoney) {
+          this.paymentLoading = true
+          setTimeout(() => {
+            this.paymentForm.money = noPayment
+            this.getPayOrderInfo('getPay', this.paymentForm.money, this.paymentForm.mode)
+          }, 500)
+          return this.$toast(`0<付款金额≤${noPayment}`)
+        }
+        this.getPayOrderInfo('getPay', this.paymentForm.money, this.paymentForm.mode)
+      }, 500),
+      // dom转图片
+      async convertToImage() {
+        try {
+          const canvas = await html2canvas(this.$refs.screenshotRef);
+          this.imageUrl = canvas.toDataURL('image/png');
+        } catch (error) {
+          console.error('转换出错:', error);
+        }
+      },
+      async onSavePaymentCode() {
+        if (this.paymentLoading) return
+        await this.convertToImage()
+        await copyImage(this.imageUrl)
+        this.$toast('付款码复制成功')
+        this.paymentCodeShow = false
+      }
+    },
+    data() {
+      return {
+        paymentCodeShow: false,
+        btnloading: false,
+        pa_dis: false,
+        performanceDis: false,
+        permissionActivationShow: false,
+        performanceShow: false,
+        iShow: false,
+        backShow: false,
+        pShow: false,
+        sShow: false,
+        tShow: false,
+        correctionShow: false,
+        bigCorrection: false,
+        redCorrection: 4,
+        isDisable: false,
+        invoice: {
+          type: ''
+        },
+        invoType: [
+          { v: '1', n: '普通发票(纸质发票)' },
+          { v: '2', n: '普通发票(电子发票)' },
+          { v: '3', n: '专用发票(纸质发票)' }
+        ],
+        contract: {
+          contractFileUrl: ''
+        },
+        funds: {
+          sum: '',
+          shCode: ''
+        },
+        permissionActivation: {
+          phone: '',
+          startTime: '',
+          orderCode: ''
+        },
+        saleTable: [
+          {
+            title: '销售人员',
+            slot: 'name',
+            width: 150
+          },
+          {
+            title: '业绩归属部门',
+            slot: 'saler_dept',
+            width: 200
+          },
+          {
+            title: '销售业绩(元)',
+            slot: 'money',
+            width: 200
+          },
+          {
+            title: '销售渠道',
+            slot: 'channel',
+            width: 200
+          }
+        ],
+        ajaxinitSalelist: [],
+        reasonList: [],
+        saleTableData: [],
+        performanceFrom: {
+          changeReason: "",
+          saleMoney: ""
+        },
+        models: {
+          refundMoney: '',
+          refundReason: '',
+          refundType: '',
+          correctionType: '',
+          correctionReason: '',
+          bigPayMoney: '',
+          subMoney: '',
+          supplyMoney: '',
+          orderMoney: '',
+          payMoney: '',
+          commission: '',
+          proceduresMoney: '',
+          redType: ""
+        },
+        backed: {
+          return_status: ''
+        },
+        returned: {
+          returnTime: '',
+          returnRemark: '',
+          returnCode: '',
+          returnInvoiceStatus: '',
+          returnMoney: '',
+          returnType: '',
+          returnVoucherUrl: ''
+        },
+        backSats: [
+          // {v: '0', n: '未回款'},
+          { v: '1', n: '全额回款' },
+          { v: '2', n: '部分回款' }
+        ],
+        backPayType: [
+          { v: '1', n: '微信' },
+          { v: '2', n: '支付宝' },
+          { v: '3', n: '对公转账' }
+        ],
+        backInvoStas: [
+          { v: '0', n: '未申请' },
+          { v: '1', n: '已申请' },
+          { v: '2', n: '已开具' }
+        ],
+        refundType: [
+          { v: '个人垫付退款', n: '个人垫付退款' },
+          { v: '产品购买错误', n: '产品购买错误' },
+          { v: '客户不满意', n: '客户不满意' },
+          { v: '活动免单', n: '活动免单' },
+          { v: '测试', n: '测试' },
+          { v: '其他', n: '其他' }
+        ],
+        correctionType: [
+          { v: '录入错误', n: '录入错误' },
+          { v: '客户不再支付', n: '客户不再支付' },
+          { v: '其他', n: '其他' }
+        ],
+        backRuleValidate: {
+          return_status: [
+            { required: true, message: '请选择回款状态', trigger: 'change' }
+          ]
+        },
+        backDetailValidate: {
+          returnTime: [
+            { required: true, message: '请选择回款时间', trigger: 'change' }
+          ],
+          returnMoney: [
+            { required: true, message: '请输入回款金额', trigger: 'change' }
+          ],
+          returnType: [
+            { required: true, message: '请选择支付方式', trigger: 'change' }
+          ],
+          returnCode: [
+            { required: true, message: '请输入支付单号', trigger: 'change' }
+          ],
+          returnInvoiceStatus: [
+            { required: true, message: '请选择发票状态', trigger: 'change' }
+          ],
+          returnVoucherUrl: [
+            { required: true, message: '请上传凭证', trigger: 'change' }
+          ]
+        },
+        refundRuleValidate: {
+          refundMoney: [
+            { required: true, message: '退款金额不能为空', trigger: 'change' }
+          ],
+          refundType: [
+            { required: true, message: '退款原因不能为空', trigger: 'change' }
+          ]
+        },
+        paymentForm: {
+          mode: '1',
+          account: '',
+          product: '',
+          imgCode: '',
+          aliSrc:'',
+          expire: 0,
+          noPayment: 0
+        },
+        paymentLoading: true,
+        displayMap: {},
+        imageUrl: null, // 转换后的图片URL,
+        cascaderProps: {
+          label: 'item_name',
+          value: 'item_code',
+          multiple: false,
+        },
+      }
+    },
+    computed: {
+      ...mapGetters(['channelListGetters', 'channelMapGetters']),
+      ...mapGetters('order', [
+        'saleChannelOptions',
+      ]),
+      signingSubject() {
+        return this.orderDetail.signing_subject === 'h01' ? '北京拓普丰联信息科技股份有限公司' : '北京剑鱼信息技术有限公司'
+      },
+      saveCodeDisabled() {
+        return !(!this.paymentLoading && this.paymentForm.money && this.paymentForm.imgCode)
+      },
+      orderDetail () {
+        return this.data.orderData
+      },
+      contractData () {
+        return this.data.contractData
+      },
+      returnRes () {
+        return this.data.returnRes
+      },
+      returnInfo () {
+        return this.data.returnInfo
+      },
+      filterData () {
+        return this.data.filterData
+      },
+      isStatus () {
+        return this.filterData?.source || ''
+      },
+      payMoney () {
+        return this.orderDetail.pay_money
+      }
+    }
+  }
+</script>
+<style lang="scss">
+.correctionLabel {
+  font-size: 16px;
+  font-weight: bold;
+  color: red;
+  margin-bottom: 10px;
+}
+.payment-code-model{
+  top: 50px;
+  .ivu-modal-body{
+    line-height: normal!important;
+    padding: 16px;
+    max-height: 620px!important;
+  }
+  .ivu-form-item{
+    margin-bottom: 8px;
+  }
+  .ivu-modal-footer{
+    border-top: 0;
+    padding: 0!important;
+  }
+  .ali-iframe{
+    width: 280px;
+    height: 280px;
+    padding: 14px 0 0 14px;
+    border: 0;
+  }
+}
+.guide-tip{
+  padding: 12px;
+}
+.table-order1{
+  .ivu-form-item-content tr td:nth-child(3) .ivu-input {
+    height: 36px!important;
+    border-radius: 6px!important;
+  }
+}
+.screenshot-container{
+  width: 100%;
+  max-width: 380px;
+  padding: 24px 28px;
+  margin: 0 auto;
+  height: auto;
+  background: linear-gradient(180deg, #2ABED1 0%, #87DFEA 100%);
+  //transform: scale(0.9);
+  .screenshot-logo{
+    display: block;
+    width: 130px;
+    height: 34px;
+    margin: 0 auto 16px;
+  }
+  .screenshot-content{
+    padding: 20px 0;
+    background: #fff;
+    border-radius: 20px;
+  }
+  .screenshot-info{
+    margin: 0 18px;
+    padding: 8px 16px;
+    background: #F5F6F7;
+    border-radius: 12px;
+    text-align: center;
+    color: #171826;
+    font-size: 16px;
+    p{
+      line-height: 24px;
+    }
+  }
+  .screenshot-money{
+    display: flex;
+    align-items: center;
+    justify-content: center;
+    padding-top: 16px;
+    font-size: 15px;
+    color: #171826;
+    .num{
+      margin-left: 8px;
+      font-size: 24px;
+      color: #FB483D;
+    }
+  }
+  .screenshot-code{
+    width: 200px;
+    height: 200px;
+    margin: 0 auto;
+    img{
+      width: 100%;
+      height: 100%;
+      object-fit: cover;
+    }
+  }
+  .screenshot-tip{
+    font-size: 16px;
+    line-height: 24px;
+    color: #171826;
+    text-align: center;
+  }
+  .screenshot-date{
+    margin-top: 2px;
+    font-size: 14px;
+    line-height: 20px;
+    color: #5F5E64;
+    text-align: center;
+  }
+}
+</style>

+ 22 - 1
src/views/order/components/sealDialog.vue

@@ -26,6 +26,10 @@ export default {
     saleSelect
   },
   props: {
+    newApi: {
+      type: Boolean,
+      default: false
+    },
     saleType: String,
     setDefaultPerson: String,
     dis: {
@@ -72,7 +76,7 @@ export default {
       }
       this.form.orderCode = res.order_code
       const userId = this.$store.getters.getAdminUser?.id || ''
-      this.form.salesman_id = userId
+      this.form.salesman_id = String(userId)
       //回显销售人员到申请人
       this.$nextTick(() => {
         this.$refs.applySaleRef.salePerson = ''
@@ -115,7 +119,24 @@ export default {
     dateChange(val) {
       this.form.stamp_time = val
     },
+    confirmHandleNewApi () {
+      this.loading = true
+      this.$jyRequest('/jyOrderManager/order/seal').data(this.form)
+          .success((res) => {
+            if (res.data.code === 0) {
+              this.$notify.success({ title: '提交成功' })
+              this.$emit('refresh')
+              this.visible = false
+            }
+            this.loading = false
+          }).error(() => {
+        this.loading = false
+      }).post()
+    },
     confirmHandle() {
+      if (this.newApi) {
+        return this.confirmHandleNewApi()
+      }
       this.loading = true
       this.$request('/order/orderSeal').data(this.form)
         .success((res) => {