Răsfoiți Sursa

Merge branch 'fsms_2.3'

hbchen 2 ani în urmă
părinte
comite
b12eeb5cdb

+ 1 - 0
package.json

@@ -12,6 +12,7 @@
   "dependencies": {
     "@element-plus/icons-vue": "^2.0.9",
     "axios": "^0.26.0",
+    "echarts": "^5.4.0",
     "element-plus": "^2.2.14",
     "html2canvas": "1.4.0",
     "js-base64": "^3.7.2",

+ 9 - 0
src/api/dashboard.js

@@ -0,0 +1,9 @@
+import request from "../utils/request"
+//----------------首页
+ // 获取首页 图表数据
+export function getStatistic() {
+  return request({
+      url:'/home/statistic',
+      method:'get'
+  })
+}

+ 78 - 0
src/api/financialMana.js

@@ -204,3 +204,81 @@ export function importDataApi(data) {
      data
  })
 }
+// -----------------到款预登记
+// 获取到款预登记列表
+ /**
+  * 
+  * @param {
+ * page_size - 每页数据量 - 必填
+ * current - 页码 - 必填
+ * Keyword - 关键词-客户姓名/销售姓名 - 非必填
+ * StartDate - 约定开始时间:格式2022-11-22 - 非必填
+ * EndDate - 约定结束时间:格式2022-11-22 - 非必填
+ * SortType - 枚举值:asc 正序 desc 倒序 - 非必填
+ * } data 
+ * @returns 
+ */
+export function getPrePlacementList(data) {
+ return request({
+     url:'/contract/pre_pay/list',
+     method:'get',
+     params:data
+ })
+}
+
+// 新增到款预登记
+ /**
+  * @param data.company_name 客户名称 
+  * @param data.seller_id 销售ID 
+  * @param data.seller_name 销售姓名 
+  * @param data.amount 到款金额 
+  * @param data.currency_unit 货币代码 
+  * @param data.start_date 约定开始日期 
+  * @param data.end_date 约定结束日期 
+  * @param data.remark 备注 
+ * @returns 
+ */
+export function prePlacementAdd(data) {
+ return request({
+     url:'/contract/pre_pay/add',
+     method:'post',
+     data
+ })
+}
+
+// 编辑到款预登记
+ /**
+  * @param data.pre_pay_id 到款预登记Id 
+  * @param data.company_name 客户名称 
+  * @param data.seller_id 销售ID 
+  * @param data.seller_name 销售姓名 
+  * @param data.amount 到款金额 
+  * @param data.currency_unit 货币代码 
+  * @param data.start_date 约定开始日期 
+  * @param data.end_date 约定结束日期 
+  * @param data.remark 备注 
+ * @returns 
+ */
+ export function prePlacementEdit(data) {
+  return request({
+      url:'/contract/pre_pay/edit',
+      method:'post',
+      data
+  })
+ }
+
+ // 删除到款预登记
+ /**
+  * 
+  * @param {
+ * pre_pay_id - 到款预登记ID - 必填
+ * } data 
+ * @returns 
+ */
+export function prePlacementDelete(data) {
+ return request({
+     url:'/contract/pre_pay/del',
+     method:'post',
+     data
+ })
+}

+ 3 - 0
src/assets/svg-icons/common/arrow_right.svg

@@ -0,0 +1,3 @@
+<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path d="M6.46042 12.4592L5.54119 11.54L9.08157 7.99962L5.54119 4.45924L6.46042 3.54L10.92 7.99962L6.46042 12.4592Z" fill="currentColor"/>
+</svg>

+ 4 - 0
src/assets/svg-icons/menu/dashboard.svg

@@ -0,0 +1,4 @@
+<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path d="M6.00004 11.0001V12.0001H10V11.0001H6.00004Z" fill="currentColor"/>
+<path d="M7.64648 1.64652C7.84175 1.45126 8.15833 1.45126 8.35359 1.64652L14.8536 8.14652L14.1465 8.85363L13 7.70718V13.5001C13 14.0524 12.5523 14.5001 12 14.5001H4.00004C3.44775 14.5001 3.00004 14.0524 3.00004 13.5001V7.70718L1.85359 8.85363L1.14648 8.14652L7.64648 1.64652ZM8.00004 2.70718L4.00004 6.70718V13.5001H12V6.70718L8.00004 2.70718Z" fill="currentColor"/>
+</svg>

+ 3 - 2
src/layout/headerBar/breadcrumb.vue

@@ -34,8 +34,9 @@
 
 <template>
   <el-breadcrumb class="header-breadcrumb">
-    <el-breadcrumb-item v-for="(item,index) in route.matched" :key="item.path">
-      <span v-if="index!=(route.matched.length-1)" class="canClick" @click.stop="routeClick(item)">
+    <!-- 判断route.meta.first_level_menu 为了面包屑中在一级路由时只显示一个标题 -->
+    <el-breadcrumb-item v-for="(item,index) in route.meta.first_level_menu?route.matched.slice(0,1):route.matched" :key="item.path">
+      <span v-if="index!=(route.matched.length-1) && !route.meta.first_level_menu" class="canClick" @click.stop="routeClick(item)">
         {{ item.meta.title }}
       </span>
       <span v-else style="font-size:16px;">{{ item.meta.title }}</span>

+ 13 - 0
src/permission.js

@@ -32,6 +32,7 @@ router.beforeEach(async (to,from,next)=>{
         return 
       }
     }
+    console.log(to);
     if(store.getters.permissionButtons.length == 0){
       // 获取权限按钮
       await store.dispatch('router/getPermissionButtons') 
@@ -43,6 +44,18 @@ router.beforeEach(async (to,from,next)=>{
     }else{
       console.log('拦截');
       await store.dispatch('router/setRoutes')
+      // 特殊的重定向
+      if(to.path == '/redirctPage'){
+        if(router.getRoutes().findIndex(item => item.path=='/dashboard/index')!=-1){
+          // 有首页的路由权限
+          next({path:'/dashboard/index',replace:true})
+        }else{
+          // 没有首页路由的权限
+          next({path:'/financial/list',replace:true})
+        }
+        return 
+      }
+
       next({...to,replace:true})
     }
   }else{

+ 7 - 1
src/store/modules/router.js

@@ -8,6 +8,8 @@ const hiddenArray=[false,true]
 const routeAllPathToCompMap = import.meta.glob(`@/views/**/*.vue`)
 // console.log(routeAllPathToCompMap);
 
+let count=0
+
 const routeHandle=(route,path='index')=>{
   path = path.startsWith('/')?path.substring(1):path
   if(route.component){
@@ -26,6 +28,7 @@ const routeHandle=(route,path='index')=>{
   }else{
     if(route.children && route.children.length>0){
       route.children = route.children.map(item=>{
+        count++
         return routeHandle(item,item.path)
       })
       return route.children
@@ -57,6 +60,7 @@ export default {
           routesData.map(item=>{
             let afterHandlePath = item.path.startsWith('/')?item.path:'/'+item.path
             if(item.hidden_layout==0){
+              count=0
               let afterHandle = routeHandle(Object.assign({},item))
               // console.log(afterHandle);
               // 判断 afterHandle 是不是数组
@@ -73,7 +77,9 @@ export default {
                 meta:{
                   title:item.name,
                   icon_path:item.icon_path,
-                  type:!flag?'menu':'content'
+                  type:!flag?'menu':'content',
+                  // 是否是一级路由
+                  first_level_menu:count===0?true:false
                 },
                 children:!flag?[afterHandle]:afterHandle
               })

+ 2 - 1
src/views/Login.vue

@@ -52,7 +52,8 @@
 						localStorage.setItem('account',Base64.encode(login.ruleForm.account))
 						localStorage.setItem('checkPass',Base64.encode(login.ruleForm.checkPass))
 					}
-					router.replace('/')
+					// 特殊需求 /redirctPage 根据权限跳转,有首页跳首页,没有跳财务列表
+					router.replace('/redirctPage')
 				})
 			}
 		})

+ 180 - 0
src/views/dashboard/index.vue

@@ -0,0 +1,180 @@
+<script setup>
+
+  import {getStatistic} from '@/api/dashboard'
+  import * as echarts from 'echarts/core';
+  // 引入柱状图图表,图表后缀都为 Chart
+  import { BarChart } from 'echarts/charts';
+  // 引入提示框,标题,直角坐标系,数据集,内置数据转换器组件,组件后缀都为 Component
+  import {
+    TitleComponent,
+    TooltipComponent,
+    GridComponent,
+    DatasetComponent,
+    LegendComponent
+  } from 'echarts/components';
+  // 标签自动布局、全局过渡动画等特性
+  import { LabelLayout, UniversalTransition } from 'echarts/features';
+  // 引入 Canvas 渲染器,注意引入 CanvasRenderer 或者 SVGRenderer 是必须的一步
+  import { CanvasRenderer } from 'echarts/renderers';
+
+  import {useRouter} from 'vue-router'
+
+  // 注册必须的组件
+  echarts.use([
+    TitleComponent,
+    TooltipComponent,
+    GridComponent,
+    DatasetComponent,
+    LegendComponent,
+    BarChart,
+    LabelLayout,
+    UniversalTransition,
+    CanvasRenderer
+  ]);
+  
+  const router = useRouter()
+
+  const barChartRef = ref(null)
+  let barChart = null
+
+  const paymentNavigator=()=>{
+    // 去往商品到款统计页面
+    router.push('/financialStatistics/commodityPayment')
+  }
+
+  const resizeChart=()=>{
+    barChart.resize();
+  }
+
+  const getChartData=()=>{
+    getStatistic().then(res=>{
+      nextTick(()=>{
+        chartDraw(res.data.ContractMoney || [],res.data.ArrivalMoney || [],res.data.Date || [])
+      })
+    })
+  }
+
+  const chartDraw=(invoiceData,placementData,dateData)=>{
+    // console.log(barChartRef.value);
+    barChart = echarts.init(barChartRef.value)
+    barChart.setOption({
+      title: {
+        text:'开票到款统计图',
+        textStyle:{
+          fontSize:20,
+          fontWeight:500
+        },
+        left:'center'
+      },
+      legend:{
+        icon:'circle',
+        left:'center',
+        top:40,
+        textStyle:{
+          fontSize:14
+        },
+        itemGap:34,
+        itemWidth:12
+      },
+      tooltip:{
+        textStyle:{
+          align:'left'
+        }
+      },
+      grid:{
+        top:120
+      },
+      color: ['#FF903E', '#FBE947'],
+      xAxis:{
+        type: 'category',
+        data:dateData,
+        axisLabel: {
+          color: '#999', //更改坐标轴文字颜色
+          fontSize: 14, //更改坐标轴文字大小
+        },
+      },
+      yAxis: {
+        name:'万元',
+        type: 'value',
+        nameGap:20,
+        splitNumber:10,
+        nameTextStyle:{
+          align:'right',
+          color:'#999'
+        },
+        axisLabel:{
+          color:'#999',
+          formatter:(value)=>{
+            return value/10000
+          }
+        }
+      },
+      series:[{
+        data: invoiceData,
+        type: 'bar',
+        name:'开票金额'
+      },
+      {
+        data: placementData,
+        type: 'bar',
+        name:'到款金额'
+      }]
+    })
+    window.addEventListener('resize', resizeChart);
+  }
+
+  onUnmounted(()=>{
+    barChart?.dispose()
+    window.removeEventListener('resize', resizeChart);
+  })
+
+  onMounted(()=>{
+    getChartData()
+  })
+
+
+</script>
+
+<template>
+    <div id="dashboard-index-container">
+      <div class="data-detail" >
+        <span @click="paymentNavigator" v-permission="'dashboard/index/dataDetail'">
+          查看数据详情
+          <el-icon size="16px" color="var(--themeColor)" >
+            <svg-Icon name="svgIcon-common-arrow_right"></svg-Icon>
+          </el-icon>
+        </span>
+      </div>
+      <div ref="barChartRef" class="bar-chart"></div>
+    </div>
+</template>
+  
+<style lang="scss" scoped>
+  #dashboard-index-container{
+    background-color: white;
+    height: calc(100vh - 120px);
+    padding: 30px;
+    box-sizing: border-box;
+    text-align: right;
+    .data-detail{
+      display: flex;
+      // align-items: center;
+      justify-content: flex-end;
+      margin-bottom: 30px;
+      span{
+        display: inline-flex;
+        align-items: center;
+        color: $themeColor;
+        font-size: 14px;
+        cursor: pointer;
+        line-height: 22px;
+        i{
+          margin-left: 4px;
+        }
+      }
+    }
+    .bar-chart{
+      height: calc(100% - 52px) 
+    }
+  }
+</style>

+ 43 - 22
src/views/financialManagement/contractProgress.vue

@@ -24,7 +24,7 @@
   const contractStatusArray=[{id:1,label:"已审批"},{id:2,label:"单章寄出"},{id:3,label:"已签回"}]
   const contractTypeArray=[{id:1,label:"新签合同"},{id:2,label:"续约合同"},{id:3,label:"代付合同"},{id:4,label:"补充协议"}]
   const operationType=[{op_type:1,label:"合规登记"},{op_type:2,label:"开票登记"},{op_type:3,label:"到款登记"},
-  {op_type:4,label:"修改合同状态"},{op_type:5,label:"删除合同登记"},{op_type:6,label:"合规编辑"}]
+  {op_type:4,label:"修改合同状态"},{op_type:5,label:"删除合同登记"},{op_type:6,label:"合规编辑",op_type:7,label:"预到款登记"}]
 
   // 合同信息
   const contractInfo=reactive({
@@ -42,6 +42,8 @@
     // 合规登记表单
     form:{
       product_id:1,
+      pre_pay_id:0, //到款预登记Id
+      supplement:0, // 是否是补录合同
       contract_register_id:'',
       crm_contract_id:0,
       contract_source:0,
@@ -195,6 +197,15 @@
   // 是否是新公司的复选框勾选判断
   let is_new_company=ref(false)
 
+  // ------------------ 到款预登记
+  const supplementary_item=reactive({
+    id:0,
+    placement_amount:"",
+    placement_origin_amount:"",
+    create_time:""
+  })
+
+
 // -----------------------------监听
   // 已开票金额
   watch(()=> contractInfo.moneyData.haveInvoiceMoney ,(newValue)=>{
@@ -452,7 +463,7 @@
     }
   }
   // 表格删除行
-  const deleteRow=(type,index)=>{
+  const deleteRow=(type,row,index)=>{
     let tempArr=[]
     let word='开票'
     let haveSalesman=false
@@ -461,6 +472,12 @@
       if(tempArr[index].seller_id) haveSalesman=true
       word='开票'
     }else{
+      console.log(row);
+      if(row.is_pre_pay==1){
+        // 预到款登记
+        ElMessage.error('该笔到款是预到款,不允许删除!')
+        return 
+      }
       tempArr=placementForm.placementData
       word='到款'
     }
@@ -585,7 +602,7 @@
             let messageHint=ElMessage.success('合规登记编辑成功')
             setTimeout(()=>{
               messageHint.close()
-              router.back()
+              router.replace('/financial/list')
             },1000)
           })
         }else{
@@ -594,7 +611,7 @@
             let messageHint=ElMessage.success('合规登记成功')
             setTimeout(()=>{
               messageHint.close()
-              router.back()
+              router.replace('/financial/list')
             },1000)
           })
         }
@@ -717,9 +734,13 @@
   })
 
 // ----------------------created
+  // 合规登记Id
   contractInfo.form.contract_register_id = parseInt(route.query.complianceId) || ''
+  // 到款预登记Id
+  supplementary_item.id = parseInt(route.query.supplementaryId) || ''
   // complianceId没有,认为是合规登记
   contractInfo.operationtype=contractInfo.form.contract_register_id?(route.query.type || 'compliance'):'compliance'
+  
 
   // 是否是开票登记或者单款登记
   const isIOrP =contractInfo.operationtype=='invoice' || contractInfo.operationtype=='placement'
@@ -854,6 +875,7 @@
             invoice_id:item.contract_invoice_id,
             origin_amount:item.origin_amount,
             amount:item.amount,
+            is_pre_pay:item.is_pre_pay,
             invoice_date:item.invoice_time,
             remark:item.remark
           })
@@ -864,6 +886,7 @@
             origin_amount:'',
             amount:'',
             invoice_date:'',
+            is_pre_pay:0,
             remark:'',
             amountDomType:'text',
             remarkDomType:'text'
@@ -871,6 +894,20 @@
         }
       }
     })
+  }else if(supplementary_item.id){
+    // 拿到预登记详情信息
+    // console.log(supplementary_item.id);
+    contractInfo.form.pre_pay_id=supplementary_item.id
+    contractInfo.form.supplement =1
+    contractInfo.form.company_name = route.query.company_name
+    contractInfo.form.currency_unit = route.query.amount_unit
+    contractInfo.form.contract_amount = route.query.placement_amount
+    contractInfo.form.new_company = parseInt(route.query.new_company)
+    contractInfo.form.start_date = route.query.start_date
+    contractInfo.form.end_date = route.query.end_date
+    contractInfo.form.seller_id = parseInt(route.query.seller_id)
+    contractInfo.form.seller_name = route.query.seller_name
+    contractInfo.contractValidityDate = [contractInfo.form.start_date,contractInfo.form.end_date]
   }
 </script>
 
@@ -1026,10 +1063,6 @@
                 </div>
               </div>
             </div>
-            <!-- <div class="contract-operation" v-if="contractInfo.operationtype=='compliance'" >
-              <el-button class="operation-button" style="margin-right: 30px;" @click="registrationCancel">取消</el-button>
-              <el-button type="primary" @click="submit" class="operation-button">保存</el-button>
-            </div> -->
           </div>
           <!-- 开票登记 -->
           <div class="info-box" v-show="contractInfo.operationtype!='compliance' && contractInfo.form.has_payment!=1" 
@@ -1137,7 +1170,7 @@
                           <template #default="{row,$index}" >
                             <span class="table-operation-button" @click="addRow('invoice',row,$index)" style="margin-right: 10px;">添加</span>
                             <span class="table-operation-button" style="color: var(--dangerColor);" 
-                            @click="deleteRow('invoice',$index)">删除</span>
+                            @click="deleteRow('invoice',row,$index)">删除</span>
                           </template>
                         </el-table-column>
                       </el-table>
@@ -1236,7 +1269,7 @@
                         <el-table-column label="操作" width="140" align="center" v-if="contractInfo.operationtype=='placement'">
                           <template #default="{row,$index}">
                             <span class="table-operation-button" @click="addRow('placement',row,$index)" style="margin-right: 10px;">添加</span>
-                            <span class="table-operation-button" @click="deleteRow('placement',$index)"
+                            <span class="table-operation-button" @click="deleteRow('placement',row,$index)"
                             style="color: var(--dangerColor);">删除</span>
                           </template>
                         </el-table-column>
@@ -1244,10 +1277,6 @@
                     </el-form>
                   </div>
                 </div>
-            <!-- <div class="contract-operation" v-if="contractInfo.operationtype=='placement' || contractInfo.operationtype=='invoice'">
-              <el-button class="operation-button" style="margin-right: 30px;" @click="registrationCancel">取消</el-button>
-              <el-button type="primary" @click="submit" class="operation-button">保存</el-button>
-            </div> -->
               </div>
             </div>
           </div>
@@ -1514,14 +1543,6 @@
         }
       }
     } 
-    // .contract-operation{
-    //   text-align: center;
-    //   padding: 100px 30px 30px;
-    //   .operation-button{
-    //     height: 40px;
-    //     width: 130px;
-    //   }
-    // }
   }
 </style>
 <style lang="scss">

+ 21 - 9
src/views/financialManagement/financialList.vue

@@ -191,10 +191,13 @@ const statusArray=[{id:1,label:"进行中"},{id:2,label:"已完成"}]
     }).catch(()=>{})
   }
   //  ---------------------created
-  getServiceListFun()
-  financialList()
-  // 获取sessionStorage里面储存的表格选中列项
-  financial.tabelColumnShowArr=sessionStorage.getItem('financialListColumn')?sessionStorage.getItem('financialListColumn').split(','):[]
+  // 由于三级路由还是在当前页面,所以判断路径,避免重复请求
+  if(route.path=='/financial/list'){
+    getServiceListFun()
+    financialList()
+    // 获取sessionStorage里面储存的表格选中列项
+    financial.tabelColumnShowArr=sessionStorage.getItem('financialListColumn')?sessionStorage.getItem('financialListColumn').split(','):[]
+  }
 </script>
 
 <template>
@@ -225,11 +228,15 @@ const statusArray=[{id:1,label:"进行中"},{id:2,label:"已完成"}]
           </div>
           <!-- 顶部按钮区域 -->
           <div class="financial-top-option-zone">
-              <el-button type="primary" size="large" style="width: 130px;margin-right: 30px;" v-permission="'financial:list:complianceAdd'"
-              @click="registration('compliance')">合规登记</el-button>
+              <div>
+                <el-button type="primary" size="large" v-permission="'financial:list:complianceAdd'"
+                @click="registration('compliance')" class="element-common-button" style="color: white;">合规登记</el-button>
+                <!-- <el-button type="primary" size="large" style="margin-left: 0;color: white;"
+                @click="router.push('/financial/placementPre')" class="element-common-button">到款预登记</el-button> -->
+              </div>
               <div class="financial-top-option-zone-right">
                 <a href="https://hzstatic.hzinsights.com/static/fms/excel/财务列表-导入模板.xlsx" download>
-                  <el-button class="element-common-button" size="large" style="margin-right: 30px;" 
+                  <el-button class="element-common-button" size="large"
                   v-permission="'financial:list:complianceImport'">下载导入模版</el-button>
                 </a>
                 <el-upload
@@ -240,9 +247,9 @@ const statusArray=[{id:1,label:"进行中"},{id:2,label:"已完成"}]
                   v-permission="'financial:list:complianceImport'"
                 >
                   <el-button size="large" :loading="financial.importLoading"
-                  style="margin-right:30px;" class="element-common-button" >导入</el-button>
+                  class="element-common-button" >导入</el-button>
                 </el-upload>
-                <el-button @click="exportData" size="large" class="element-common-button" >导出</el-button>
+                <el-button @click="exportData" size="large" class="element-common-button" style="margin-right: 0;" >导出</el-button>
               </div>              
           </div>
           <div class="financial-table-zone">
@@ -421,6 +428,11 @@ const statusArray=[{id:1,label:"进行中"},{id:2,label:"已完成"}]
       .financial-top-option-zone-right{
         display: flex;
       }
+      .element-common-button{
+        width: 118px;
+        margin-right: 30px;
+        font-size: 14px;
+      }
     }
     .financial-table-zone{
       margin-top: 20px;

+ 417 - 0
src/views/financialManagement/placementPre.vue

@@ -0,0 +1,417 @@
+<script setup>
+import { Search } from '@element-plus/icons-vue'
+import {useRouter} from 'vue-router'
+import {getSellerList} from '@/api/crm'
+import {getCurrencyList} from '@/api/common'
+import {getPrePlacementList,prePlacementAdd,prePlacementEdit,prePlacementDelete} from '@/api/financialMana'
+
+
+const router = useRouter()
+
+  const placemenetPre=reactive({
+    searchParams:{
+      keyword:'',
+      start_date:'',
+      end_date:'',
+      sort_type:'',
+      page_size:10,
+      current:1,
+    },
+    // 创建时间数组
+    createtime:[],
+    tableData:[],
+    total:0,
+  })
+  // 销售列表
+  const sellerList = ref([])
+  // 货币列表
+  const currencyList=ref([])
+
+  // -----------------弹窗
+  const editPreForm=ref(null)
+
+  const dialog=reactive({
+    // 更改合同状态
+    editPreShow:false,
+    title:'',
+    editPreForm:{
+      company_name:'',
+      new_company:0,
+      seller_id:'',
+      seller_name:'',
+      amount:'',
+      currency_unit:'CNY',
+      start_date:'',
+      end_date:'',
+      remark:''
+    },
+    rules:{
+      company_name:{required:true,message:'客户名称不能为空',trigger:'blur'},
+      seller_id:{required:true,message:'销售不能为空',trigger:'change'},
+      amount:[{required:true,message:'到款金额不能为空',trigger:'blur'},
+      {
+        validator:(rule,value,callback)=>{
+          if(!parseFloat(value)){
+            callback(new Error('到款金额格式错误'))
+          }else{
+            callback()
+          }
+        },
+        trigger:'blur'
+      }],
+      start_date:{required:true,message:'约定有效期不能为空',trigger:'change'}
+    },
+    validityDate:[]
+  })
+  // 是否是新公司的复选框勾选判断
+  const is_new_company=ref(false)
+
+  // 监听
+  watch(()=>placemenetPre.createtime,(newVal)=>{
+    console.log(newVal);
+    if(!newVal){
+      placemenetPre.searchParams.start_date=''
+      placemenetPre.searchParams.end_date=''
+    }else{
+      placemenetPre.searchParams.start_date = newVal[0]
+      placemenetPre.searchParams.end_date = newVal[1]
+    }
+    searchPlacementPre()
+  })
+
+  watch(()=>dialog.editPreForm.new_company,(newVal)=>{
+    if(newVal==1){
+      is_new_company.value=true
+    }else{
+      is_new_company.value=false
+    }
+  })
+
+  watch(()=>dialog.validityDate,(newVal)=>{
+    console.log(newVal);
+    if(!newVal){
+      dialog.editPreForm.start_date=''
+      dialog.editPreForm.end_date=''
+    }else{
+      dialog.editPreForm.start_date = newVal[0]
+      dialog.editPreForm.end_date = newVal[1]
+    }
+  })
+
+//  --------------------------method
+
+  //获取销售列表
+  const getSellerListFun=()=>{
+    getSellerList().then(res=>{
+      sellerList.value=res.data || []
+    })
+  }
+  // 销售选中
+  const selectSeller=(value)=>{
+    dialog.editPreForm.seller_name=sellerList.value.find(item => item.admin_id==value).real_name
+  }
+
+  // 获取货币列表
+  const getCurrencyListFun=()=>{
+    getCurrencyList().then(res=>{
+      currencyList.value=res.data || []
+    })
+  }
+
+  // 预到款登记列表
+  const placementPreList=()=>{
+    getPrePlacementList(placemenetPre.searchParams).then(res=>{
+      placemenetPre.tableData=res.data.list || []
+      placemenetPre.total=res.data.page?.total || 0
+      console.log(res);
+    })
+  }
+  // 切换每页的数量
+  const changePageSize=(pageSize)=>{
+    placemenetPre.searchParams.page_size = pageSize
+    placementPreList()
+  }
+  const changePageNo = (pageNo)=>{
+    placemenetPre.searchParams.current = pageNo
+    placementPreList()
+  }
+  const searchPlacementPre=()=>{
+    placemenetPre.searchParams.current = 1
+    placementPreList()
+  }
+
+  const sortChange=({order})=>{
+    console.log(order);
+    placemenetPre.searchParams.sort_type = order=='ascending'?1:order=='descending'?2:''
+    searchPlacementPre()
+  }
+
+  // 补录合同
+  const supplementaryContract=(row)=>{  
+    // console.log(id);
+    router.push({path:'/financial/list/contractProgress',query:{
+      supplementaryId:row.pre_pay_id,
+      company_name:row.company_name,
+      seller_id:row.seller_id,
+      seller_name:row.seller_name,
+      amount_unit:row.currency_unit,
+      placement_amount:row.origin_amount,
+      new_company:row.new_company,
+      start_date:row.start_date,
+      end_date:row.end_date
+    }})
+  }
+
+  //新增预到款
+  const addPre=()=>{
+    dialog.title='新增到款预登记'
+    dialog.editPreShow=true
+  }
+  //编辑预到款
+  const editPre=(row)=>{
+    dialog.editPreForm.pre_pay_id = row.pre_pay_id
+    dialog.editPreForm.company_name=row.company_name
+    dialog.editPreForm.new_company=row.new_company
+    dialog.editPreForm.seller_id=row.seller_id
+    dialog.editPreForm.seller_name=row.seller_name
+    dialog.editPreForm.amount=row.origin_amount
+    dialog.editPreForm.currency_unit=row.currency_unit
+    dialog.editPreForm.remark=row.remark
+    dialog.validityDate=[row.start_date,row.end_date]
+    dialog.title='编辑到款预登记'
+    dialog.editPreShow=true
+  }
+
+  //弹窗关闭动画 回调
+  const dialogClosed=()=>{
+    dialog.editPreForm.pre_pay_id = ''
+    dialog.editPreForm.company_name=''
+    dialog.editPreForm.new_company=0
+    dialog.editPreForm.seller_id=''
+    dialog.editPreForm.seller_name=''
+    dialog.editPreForm.amount=''
+    dialog.editPreForm.currency_unit='CNY'
+    dialog.editPreForm.remark=''
+    dialog.validityDate=[]
+    setTimeout(()=>{
+      editPreForm.value.clearValidate()
+    },0)
+  }
+
+  // 提交
+  const submitForm=()=>{
+    editPreForm.value.validate((valid)=>{
+      if(valid){
+        console.log(dialog.editPreForm);
+        dialog.editPreForm.amount = parseFloat(dialog.editPreForm.amount)
+        let prePlacementProp=prePlacementAdd
+        if(dialog.editPreForm.pre_pay_id){
+          // 编辑
+          prePlacementProp=prePlacementEdit
+        }
+        prePlacementProp(dialog.editPreForm).then(res=>{
+          dialog.editPreShow=false
+          ElMessage.success(`${dialog.title}成功`)
+          placementPreList()
+        })
+      }
+    })
+  }
+  // 删除
+  const delteRecord=(row)=>{
+    let hintText = '已补录合同,删除后不可恢复,是否确认删除该条到款预登记信息?'
+    if(row.contract_register_id== 0){
+      hintText='未补录合同,删除后不可恢复,是否确认删除该条到款预登记信息?'
+    }
+    ElMessageBox.confirm(hintText,'操作提示',    
+    {
+      confirmButtonText: '确定',
+      cancelButtonText: '取消',
+      type: 'warning',
+    }).then(res=>{
+      prePlacementDelete({pre_pay_id:row.pre_pay_id}).then(res=>{
+        ElMessage.success('删除成功')
+        placementPreList()
+      })
+    }).catch(()=>{})
+  }
+
+  //  ---------------------created
+  getSellerListFun()
+  getCurrencyListFun()
+  placementPreList()
+</script>
+
+<template>
+  <div class="placemenetPre-list-container" id="placemenetPre-list-container" > 
+    <!-- 顶部区域 -->
+    <div class="placemenetPre-top-zone">
+      <div class="placemenetPre-top-search-zone">
+        <el-input v-model="placemenetPre.searchParams.keyword" placeholder="客户姓名/销售" :prefix-icon="Search"
+        style="width: 340px;margin-right: 30px;" @input="searchPlacementPre" clearable />
+        <el-date-picker v-model="placemenetPre.createtime" start-placeholder="开始日期"
+        end-placeholder="结束日期" style="max-width: 240px;"
+        value-format="YYYY-MM-DD" type="daterange"></el-date-picker>
+      </div>
+      <!-- 按钮区域 -->
+      <div class="placemenetPre-top-option-zone" v-permission="'financial:placementPre:add'">
+        <el-button type="primary" size="large" style="color: white;"
+        @click="addPre" class="element-common-button">新增</el-button>         
+      </div>
+    </div>
+    <div class="placemenetPre-table-zone">
+      <!-- 表格 -->
+      <el-table :data="placemenetPre.tableData" border max-height="695px" @sort-change="sortChange"
+      size="default" style="position: sticky;"> 
+        <el-table-column label="客户名称" prop="company_name"
+        show-overflow-tooltip min-width="120"></el-table-column>
+        <el-table-column label="是否新客户" prop="new_company" width="100">
+          <template #default="{row}">
+            {{ row.new_company==1?'是':'否' }}
+          </template>
+        </el-table-column>
+        <el-table-column label="销售" width="90" prop="seller_name">
+          <!-- <template #default="{row}">
+            
+          </template> -->
+        </el-table-column>
+        <el-table-column label="到款金额" prop="origin_amount" width="120"></el-table-column>
+        <el-table-column label="金额单位" prop="unit_name" width="90">
+        </el-table-column>
+        <el-table-column label="约定有效期" width="210" prop="start_date">
+          <template #default="{row}">
+            {{(row.start_date+' 至 '+row.end_date)}}
+          </template>
+        </el-table-column>
+        <el-table-column label="备注" prop="remark" show-overflow-tooltip></el-table-column>
+        <el-table-column label="创建时间" prop="create_time" width="165" sortable="custom"></el-table-column>
+        <el-table-column label="创建人" width="90" prop="admin_name"></el-table-column>
+        <el-table-column label="操作" fixed="right" 
+        v-permission="['financial:placementPre:supplementary','financial:placementPre:edit','financial:placementPre:delete']">
+          <template #default="{row}">
+            <div class="table-options">
+              <span class="table-option-buttons" v-permission="'financial:placementPre:supplementary'"
+              @click="supplementaryContract(row)">
+                补录合同
+              </span>
+              <span class="table-option-buttons" v-permission="'financial:placementPre:edit'"
+              @click="editPre(row)">
+                编辑
+              </span>
+              <span class="table-option-buttons" v-permission="'financial:placementPre:delete'"
+              @click="delteRecord(row)" style="color:var(--dangerColor);">
+                删除
+              </span>
+            </div>
+          </template>
+        </el-table-column>
+        <template #empty>
+          <div class="table-no-data">
+            <img src="@/assets/img/icon/empty-data.png" />
+            <span>暂无数据</span>
+          </div>
+        </template>
+      </el-table>
+      <!-- 分页 -->
+      <m-page :pageSize="placemenetPre.searchParams.page_size" :page_no="placemenetPre.searchParams.current" 
+      style="display: flex;justify-content: flex-end;margin-top: 20px;" 
+      :total="placemenetPre.total" @handleCurrentChange="changePageNo" @handleSizeChange="changePageSize"/>
+    </div>
+    <!-- 新增/编辑弹窗 -->
+    <el-dialog v-model="dialog.editPreShow" :title="dialog.title" width="556px" @closed="dialogClosed"
+     :close-on-click-modal="false">
+      <!-- <template style="display: flex;justify-content: center;"> -->
+        <el-form :model="dialog.editPreForm" ref="editPreForm" label-width="130px"
+        :rules="dialog.rules" style="margin-top: 10px;">
+          <el-form-item label="客户名称" prop="company_name">
+            <el-input v-model="dialog.editPreForm.company_name"
+            placeholder="请输入客户名称" style="width:260px" />
+            <el-checkbox v-model="is_new_company" label="新客户" style="margin-left: 20px;min-width: 100px;"
+            size="large" @change="(value) => dialog.editPreForm.new_company = value?1:0" />
+          </el-form-item>
+          <el-form-item label="销售" prop="seller_id">
+            <el-select v-model="dialog.editPreForm.seller_id" placeholder="请选择销售" style="width: 346px;"
+            filterable @change="selectSeller">
+              <el-option :label="item.real_name" :value="item.admin_id" v-for="item in sellerList" :key="item.admin_id"></el-option>
+            </el-select>
+          </el-form-item>
+          <el-form-item label="到款金额" id="contractInfo-contractAmount"
+          prop="amount">
+            <el-input v-model.trim="dialog.editPreForm.amount"
+            placeholder="请输入到款金额" style="width: 206px;" />
+            <el-select v-model="dialog.editPreForm.currency_unit" placeholder="请选择货币类型" 
+            style="margin-left: 20px;width: 120px;">
+              <el-option v-for="item in currencyList" :key="item.code" :label="item.name" :value="item.code">
+              </el-option>
+            </el-select>
+          </el-form-item>
+          <el-form-item label="约定有效期" prop="start_date">
+            <el-date-picker type="daterange" 
+            v-model="dialog.validityDate" style="max-width: 346px;"
+            start-placeholder="开始日期" end-placeholder="结束日期" value-format="YYYY-MM-DD"
+            :clearable="false">
+            </el-date-picker>
+          </el-form-item>
+          <el-form-item label="备注" prop="remark">
+            <el-input
+              v-model="dialog.editPreForm.remark"
+              style="width: 346px;"
+              :rows="3"
+              placeholder="请输入内容"
+              type="textarea"
+            />
+          </el-form-item>
+        </el-form>
+      <!-- </template> -->
+      <template #footer>
+        <div>
+          <el-button @click="dialog.editPreShow=false">取消</el-button>
+          <el-button type="primary" @click="submitForm" style="margin-left: 30px;">确定</el-button>
+        </div>
+      </template> 
+    </el-dialog>
+  </div>
+</template>
+  
+<style lang="scss" scoped>
+  .placemenetPre-list-container{
+    min-height: 100%;
+    .placemenetPre-top-zone{
+      display: flex;
+      flex-wrap: wrap;
+      align-items: flex-start;
+      justify-content: space-between;
+      margin-bottom: 20px;
+      .placemenetPre-top-search-zone{
+        display: flex;
+        align-items: center;
+        margin-bottom: 8px;
+      }
+      .placemenetPre-top-option-zone{
+        // margin-bottom: 8px;
+        .element-common-button{
+          width: 118px;
+          margin-left: 30px;
+          font-size: 14px;
+        }
+      }
+    }
+    .placemenetPre-table-zone{
+      margin-top: 20px;
+    }
+  }
+</style>
+<style lang="scss">
+  #placemenetPre-list-container{
+    .el-dialog__footer{
+      padding-top: 0!important;
+      padding: 0 0 36px 0;
+    }
+    .el-date-editor{
+      .el-input__wrapper{
+        width: 286px;
+      }
+    }
+  }
+
+</style>