Browse Source

融资产品修改页面

ch 4 năm trước cách đây
mục cha
commit
b4db58dfa4

+ 8 - 1
front-vue/src/api/service/financeProduct/financeProduct.js

@@ -1,6 +1,6 @@
 import request from '@/utils/request'
 
-// 查询项目类型信息列表
+// 查询融资产品信息列表
 export function listFinanceProduct(query) {
   return request({
     url: '/sc-service/financeProduct/list',
@@ -42,3 +42,10 @@ export function delFinanceProduct(zfpId) {
     method: 'delete'
   })
 }
+// 启用/停用融资产品
+export function changeState(zfpId) {
+  return request({
+    url: '/sc-service/financeProduct/change/'+zfpId,
+    method: 'put',
+  })
+}

+ 6 - 0
front-vue/src/router/index.js

@@ -159,6 +159,12 @@ export const constantRoutes = [
         name: 'addFinanceProduct',
         meta: { title: '新增融资产品',noCache: true }
       },
+      {
+        path: 'editFinanceProduct/:zfpId',
+        component: (resolve) => require(['@/views/service/financeProduct/editFinanceProduct'], resolve),
+        name: 'editFinanceProduct',
+        meta: { title: '修改融资产品',noCache: true }
+      },
     ]
   },
   {

+ 263 - 434
front-vue/src/views/service/financeProduct/addFinanceProduct.vue

@@ -1,149 +1,246 @@
 <template>
   <div class="app-container">
-    <el-form :inline="true" ref="form" :model="form" :rules="rules" label-width="auto"   >
+    <el-form :inline="true" ref="form" :model="form" :rules="rules" label-width="auto" style="margin-top: 20px;"  >
       <el-divider content-position="left">基本信息</el-divider>
         <!-- <el-form-item label="融资产品编号" prop="zfpNumber">
           <el-input v-model="form.zfpNumber" placeholder="请输入融资产品编号" />
         </el-form-item> -->
-        <el-form-item label="融资产品名称:" prop="zfpName">
+        <el-form-item label="融资产品名称:" prop="zfpName" style="margin-left: 5%">
           <el-input v-model="form.zfpName" placeholder="请输入融资产品名称" />
         </el-form-item>
-        <el-form-item label="资金方:" prop="zfpManagementId">
-          <!-- <el-input v-model="form.zfpManagementId" placeholder="请输入资方(sys_company.scy_id)" /> -->
+        <el-form-item label="资金方:" prop="zfpManagementId" style="margin-left: 5%">
            <el-select
-            v-model="form.zfpManagementId"
-            placeholder="请选择资金方"
-            clearable
-            size="small"
-            <el-option
-              v-for="(item,index) in pafModeOptions"
-              :key="index"
-              :label="item.scyName"
-              :value="item.scyId"/>
+              v-model="form.zfpManagementId"
+              placeholder="请选择资金方"
+              clearable
+              size="small">
+              <el-option
+                v-for="(item,index) in companyList"
+                :key="index"
+                :label="item.scyName"
+                :value="item.scyId"/>
           </el-select>
         </el-form-item>
-        <el-form-item label="是否可拆转融:">
+        <el-form-item label="是否可拆转融:" style="margin-left: 5%">
           <el-radio v-model="form.zfpSplit" label="0">否</el-radio>
           <el-radio v-model="form.zfpSplit" label="1">是</el-radio>
         </el-form-item>
-        <el-form-item label="产品类型:">
+        <el-form-item label="产品类型:" style="margin-left: 5%">
           <el-radio v-model="form.zfpType" label="0">正向</el-radio>
           <el-radio v-model="form.zfpType" label="1">反向</el-radio>
         </el-form-item>
          <el-divider content-position="left">平台参数</el-divider>
 
-        <el-form-item label="最小融资金额:" prop="zfpMinimumAmount">
+        <el-form-item label="最小融资金额:" prop="zfpMinimumAmount" style="margin-left: 5%">
           <el-input v-model="form.zfpMinimumAmount" placeholder="请输入最小融资金额" />
         </el-form-item>
-         <el-form-item label="最短融资账期:" prop="zfpShortestPeriod">
-          <el-input v-model="form.zfpShortestPeriod" placeholder="请输入最短融资账期" />
+         <el-form-item label="最短融资账期:" prop="zfpShortestPeriod" style="margin-left: 5%">
+          <el-input v-model="form.zfpShortestPeriod" placeholder="最短14天" @change="change"/>
         </el-form-item>
-        <el-form-item label="服务费是否可退:">
+        <el-form-item label="服务费是否可退:" style="margin-left: 5%">
           <el-radio v-model="form.zfpCharge" label="0">否</el-radio>
           <el-radio v-model="form.zfpCharge" label="1">是</el-radio>
         </el-form-item>
-        <el-form-item label="是否有追索权:">
+        <el-form-item label="是否有追索权:" style="margin-left: 5%">
           <el-radio v-model="form.zfpRecourse" label="0">否</el-radio>
           <el-radio v-model="form.zfpRecourse" label="1">是</el-radio>
         </el-form-item>
-        <el-form-item label="电子凭证类型:" prop="zfpVoucherType">
-          <!-- <el-select v-model="form.zfpVoucherType" placeholder="请选择电子凭证类型">
-            <el-option label="请选择字典生成" value="" />
-          </el-select> -->
+        <el-form-item label="电子凭证类型:" prop="zfpVoucherType" style="margin-left: 5%">
           <el-select
             v-model="form.zfpVoucherType"
             placeholder="请选择电子凭证类型"
             clearable
-            size="small"
+            size="small">
             <el-option
-              v-for="dict in pafModeOptions"
+              v-for="dict in voucherTypeOptions"
               :key="dict.dictValue"
               :label="dict.dictLabel"
               :value="dict.dictValue"/>
           </el-select>
         </el-form-item>
+        <el-divider content-position="left">资方参数</el-divider>
 
-        <el-form-item label="是否转让:">
-          <el-radio v-model="form.zfpTransfer" label="0">否</el-radio>
-          <el-radio v-model="form.zfpTransfer" label="1">是</el-radio>
-        </el-form-item>
-        
-        
-        <el-form-item label="是否需核心企业开户:">
+        <el-form-item label="是否需核心企业开户:" style="margin-left: 5%">
           <el-radio v-model="form.zfpCoreAccount" label="0">否</el-radio>
           <el-radio v-model="form.zfpCoreAccount" label="1">是</el-radio>
         </el-form-item>
-        <el-form-item label="是否需融资企业开户:">
+        <el-form-item label="是否需融资企业开户:" style="margin-left: 5%">
           <el-radio v-model="form.zfpSupplierAccount" label="0">否</el-radio>
           <el-radio v-model="form.zfpSupplierAccount" label="1">是</el-radio>
         </el-form-item>
-        
-        <el-form-item label="产品状态">
-          <el-radio-group v-model="form.zfpStatus">
-            <el-radio
-              v-for="dict in zfpStatusOptions"
+        <el-form-item label="记账簿托管方式:" prop="zfpBookkeeping" style="margin-left: 5%">
+          <el-select
+            v-model="form.zfpBookkeeping"
+            placeholder="请选择记账簿托管方式"
+            clearable
+            size="small">
+            <el-option
+              v-for="dict in bookkeepingOptions"
               :key="dict.dictValue"
-              :label="dict.dictValue"
-            >{{dict.dictLabel}}</el-radio>
-          </el-radio-group>
-        </el-form-item>
-        
-       
-        <el-form-item label="记账簿托管方式" prop="zfpBookkeeping">
-          <el-select v-model="form.zfpBookkeeping" placeholder="请选择记账簿托管方式">
-            <el-option label="请选择字典生成" value="" />
+              :label="dict.dictLabel"
+              :value="dict.dictValue"/>
           </el-select>
         </el-form-item>
-        <el-form-item label="是否支持部分融资(0:不支持,1:支持)">
-          <el-radio-group v-model="form.zfpPart">
-            <el-radio label="1">请选择字典生成</el-radio>
-          </el-radio-group>
-        </el-form-item>
-        <el-form-item label="融资到期方式" prop="zfpExpire">
-          <el-select v-model="form.zfpExpire" placeholder="请选择融资到期方式">
-            <el-option label="请选择字典生成" value="" />
-          </el-select>
+        <el-form-item label="是否支持部分融资:" style="margin-left: 5%">
+          <el-radio v-model="form.zfpPart" label="0">否</el-radio>
+          <el-radio v-model="form.zfpPart" label="1">是</el-radio>
         </el-form-item>
-        <el-form-item label="资方融资费率" prop="zfpRate">
+        <el-form-item label="资方融资费率:" prop="zfpRate" style="margin-left: 5%">
           <el-input v-model="form.zfpRate" placeholder="请输入资方融资费率" />
         </el-form-item>
-        <el-form-item label="资方是否支持返佣(0:不支持,1:支持)">
-          <el-radio-group v-model="form.zfpProfit">
-            <el-radio label="1">请选择字典生成</el-radio>
-          </el-radio-group>
+        <el-form-item label="融资到期方式:" prop="zfpExpire" style="margin-left: 5%">
+          <el-select
+            v-model="form.zfpExpire"
+            placeholder="请选择融资到期方式"
+            clearable
+            size="small">
+            <el-option
+              v-for="dict in expireOptions"
+              :key="dict.dictValue"
+              :label="dict.dictLabel"
+              :value="dict.dictValue"/>
+          </el-select>
         </el-form-item>
-        <el-form-item label="资方返佣方式" prop="zfpProfitType">
-          <el-select v-model="form.zfpProfitType" placeholder="请选择资方返佣方式">
-            <el-option label="请选择字典生成" value="" />
+        <el-form-item label="资方是否支持返佣:" style="margin-left: 5%">
+          <el-radio v-model="form.zfpProfit" label= "0">否</el-radio>
+          <el-radio v-model="form.zfpProfit" label= "1">是</el-radio>
+        </el-form-item>
+        <el-form-item label="资方返佣方式:" prop="zfpProfitType" style="margin-left: 5%" v-if="form.zfpProfit== '1'">
+          <el-select
+            v-model="form.zfpProfitType"
+            placeholder="请选择资方返佣方式"
+            clearable
+            size="small">
+            <el-option
+              v-for="dict in profitTypeOptions"
+              :key="dict.dictValue"
+              :label="dict.dictLabel"
+              :value="dict.dictValue"/>
           </el-select>
         </el-form-item>
-        <el-form-item label="资方返佣费率" prop="zfpProfitRate">
+        <el-form-item label="资方返佣费率" prop="zfpProfitRate" style="margin-left: 5%" v-if="form.zfpProfit== '1'">
           <el-input v-model="form.zfpProfitRate" placeholder="请输入资方返佣费率" />
         </el-form-item>
-        <el-form-item label="是否需平台审批(0:不需要,1:需要)">
-          <el-radio-group v-model="form.zfpPlatform">
-            <el-radio label="1">请选择字典生成</el-radio>
-          </el-radio-group>
+        <el-form-item label="是否需平台审批:" style="margin-left: 5%">
+          <el-radio v-model="form.zfpPlatform" label="0">否</el-radio>
+          <el-radio v-model="form.zfpPlatform" label="1">是</el-radio>
+        </el-form-item>
+        
+        <el-divider content-position="left">关联合同</el-divider>
+        <el-form-item prop="zfcId" style="margin-left: 100px" >
+        <el-button size="mini" type="primary" @click="openTicket">选择合同</el-button>
+        <el-button size="mini" @click="deleteTicekt">清空全部</el-button>
+        <el-table :data="contractList" style="width: 1100px">
+          <el-table-column label="合同模板编号"  align="center"  prop="pvfInvoiceTitle" show-overflow-tooltip />
+          <el-table-column label="合同模板名称"  align="center"  prop="zfcName"   />
+          <el-table-column label="签署方"  align="center"  prop="pvfDate"    />
+          <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="250">
+            <template slot-scope="scope">
+              <el-button
+                size="mini"
+                type="text"
+                icon="el-icon-delete"
+                @click="handleDelete(scope.$index, contractList)"
+              >删除</el-button>
+            </template>
+          </el-table-column>
+        </el-table>
+      </el-form-item>
+      </el-form>
+      <!-- 合同信息 -->
+    <el-dialog :title="invoiceTitle" :visible.sync="open" width="1120px" append-to-body>
+      <el-form :model="queryParamsInvoice"  ref="formQuery"  :inline="true"  label-width="68px"  style="margin-bottom: -21px">
+        <el-form-item label="发票标题" prop="pvfInvoiceTitle">
+          <el-input
+            v-model="queryParamsInvoice.pvfInvoiceTitle"
+            placeholder="请输入发票标题"
+            clearable
+            size="small"
+            maxlength="11"
+            @keyup.enter.native="handleQuerys"/>
+        </el-form-item>
+        <el-form-item label="开票日期" prop="dateTime">
+          <el-date-picker
+            size="small"
+            v-model="queryParamsInvoice.dateTime"
+            unlink-panels
+            style="width: 240px"
+            value-format="yyyy-MM-dd"
+            type="daterange"
+            range-separator="-"
+            start-placeholder="开始日期"
+            end-placeholder="结束日期">
+          </el-date-picker>
+        </el-form-item>
+        <el-form-item>
+          <el-button
+            type="cyan"
+            icon="el-icon-search"
+            size="mini"
+            @click="handleQuerys"
+            >搜索</el-button>
+          <el-button icon="el-icon-refresh" size="mini" @click="resetQuerys"
+            >重置</el-button>
         </el-form-item>
       </el-form>
+      <el-table :data="InvoiceList"
+        ref="tableInvoice"
+        class="single-select-table"
+        @selection-change="handleSelectionChange" 
+        :row-key="rowkey">
+        <el-table-column
+          type="selection"
+          :reserve-selection="true"
+          width="50"
+          align="center"/>
+        <el-table-column label="序号" type="index" width="50" align="center">
+          <template slot-scope="scope">
+            <span>{{ (queryParamsInvoice.pageNum - 1) * queryParamsInvoice.pageSize + scope.$index + 1}}</span>
+          </template>
+        </el-table-column>
+        <el-table-column label="发票标题"  align="center"  prop="pvfInvoiceTitle" show-overflow-tooltip width="100" />
+        <el-table-column label="发票金额"  align="center"  prop="pvfTaxPrice"  width="125" />
+        <el-table-column label="发票张数"  align="center"  prop="pvfInvoiceNum" show-overflow-tooltip width="100" />
+        <el-table-column label="开票日期"  align="center"  prop="pvfDate"  width="95"  />
+        <el-table-column label="客户名称"  align="center"  prop="cciName"  width="120"  show-overflow-tooltip />
+        <el-table-column label="合同名称"  align="center"  prop="cifName"  width="120"  show-overflow-tooltip />
+        <el-table-column label="项目名称"  align="center"  prop="pifName"  width="120"  show-overflow-tooltip />
+        <el-table-column label="发票类型"  align="center"  :formatter="pvfCategoryFormat"  prop="pvfCategory"  width="120" />
+        <el-table-column label="交付日期"  align="center"  prop="pvfDeliverTime"  width="95" />
+      </el-table>
+      <pagination
+        v-show="total > 0"
+        :total="total"
+        :page.sync="queryParamsInvoice.pageNum"
+        :limit.sync="queryParamsInvoice.pageSize"
+        @pagination="getInvoiceList" />
+      <!-- <el-button type="primary" @click="submitData()">关闭</el-button> -->
+      <span slot="footer" class="dialog-footer">
+        <el-button size="mini" @click="cancelTicket">取消</el-button>
+        <el-button size="mini" type="primary" @click="closeTicket">确认</el-button>
+        <!-- <el-button @click="cancelSelection">取 消</el-button>
+        <el-button type="primary" @click="changeInvoice">确 定</el-button> -->
+      </span>
+    </el-dialog>
     <!-- 保存 -->
     <div class="footer" style="margin-top: 260px; float: right">
       <el-button type="info" @click="cancel">取消</el-button>
-      <el-button type="success" @click="submitForm('00')"
-        >保存</el-button>
+      <el-button type="success" @click="submitForm"
+        >提交</el-button>
     </div>
   </div>
 </template>
 
 <script>
 import { addFinanceProduct } from "@/api/service/financeProduct/financeProduct";
+import { listCompany } from "@/api/common/company";
 export default {
   name: "addFinanceProduct",
   components: {},
   data() {
     return {
       //发票表格数据
-      ticketList: [],
+      contractList: [],
       //选中发票数据
       chooseTicket:[],
       // 日期范围
@@ -154,6 +251,7 @@ export default {
       ids: [],
       // 弹出层标题
       title: "",
+      invoiceTitle:"",
       openInvoice : false,
       // 总条数
       total: 0,
@@ -170,8 +268,8 @@ export default {
       fpId: "",
       ctnId : '',
       pafCollectionAmtFromat: "",
-      // 客户列表
-      customerList: [],
+      // 资方列表
+      companyList: [],
       //余额
       BalanceList: [],
       multipleSelection: [],
@@ -189,17 +287,13 @@ export default {
       //合同列表
       contractList: [],
       content: [],
-      //合同节点列表
-      contractNodeList:[],
-      //回款发票列表
-      receiptInvoiceList:[],
       //发票列表
       InvoiceList: [],
       //数据字典
-      pafTradeTypeOptions: [],
-      pafModeOptions: [],
-      pvfCategoryOptions: [],
-      pvfTYPEOptions: [],
+      voucherTypeOptions: [],
+      bookkeepingOptions: [],
+      expireOptions: [],
+      profitTypeOptions: [],
       // 表单参数
       form: {},
       queryParams: {
@@ -209,28 +303,6 @@ export default {
         pifId: null,
         pifContractId: null,
       },
-      queryParamsProject: {
-        pageNum: 1,
-        pageSize: 10,
-        pifName: null,
-        pifId: null,
-        pifCustomerName: null
-      },
-      queryParamsContract: {
-        pageNum: 1,
-        pageSize: 10,
-        cifId: null,
-        cifName: null,
-        cifMold: null,
-        cciName: null,
-        pifName: null,
-      },
-      queryParamsSubject: {
-        pageNum: 1,
-        pageSize: 10,
-        pctName: null,
-        pctId: null,
-      },
       queryParamsInvoice: {
         pageNum: 1,
         pageSize: 10,
@@ -241,94 +313,78 @@ export default {
         pvfTYPE: null,
         pvfInvoiceTitle : null
       },
-      queryParamsCustomer: {
-        pageNum: 1,
-        pageSize: 10,
-        cciName: null,
-        cciAbbreviation: null,
-      },
-      queryParamsAcc: {
-        pageNum: 1,
-        pageSize: 10,
-        ccaBankName: null,
-        pafAccountId: null,
-        ccaCustomerId : null,
-        cccType : null,
-      },
       options: [],
       value: [],
       loading: false,
       // 表单校验
       rules: {
-        pafSubject: [
-          {
-            required: true,
-            message: "所属科目不能为空",
-            trigger: ["blur", "change"],
-          },
-        ],
-        pafCustomerId: [
-          {
-            required: true,
-            message: "客户不能为空",
-            trigger: ["blur", "change"],
-          },
-        ],
-        pafAccountId: [
+        zfpName: [
           {
             required: true,
-            message: "付款账户不能为空",
+            message: "产品名称不能为空",
             trigger: ["blur", "change"],
           },
         ],
-        pafTradeType: [
+        zfpManagementId: [
           {
             required: true,
-            message: "付款类型不能为空",
+            message: "资金方不能为空",
             trigger: ["blur", "change"],
           },
         ],
-        pafMode: [
+        zfpMinimumAmount: [
           {
             required: true,
-            message: "付款方式不能为空",
+            pattern: /^[0-9][0-9]{0,9}$|^[1-9][0-9]{0,9}[.]\d{1,2}$/,
+            message: "请输入正确的付款金额",
             trigger: ["blur", "change"],
           },
         ],
-        pafCollectionAmt: [
+        zfpShortestPeriod: [
           {
             required: true,
-            message: "付款金额不能为空",
+            message: "最短融资账期不能为空",
             trigger: ["blur", "change"],
           },
-          {
-            pattern: /^[0-9][0-9]{0,7}$|^[1-9][0-9]{0,7}[.]\d{1,2}$/,
-            message: "请输入正确的付款金额",
-            trigger: "change",
-          },
         ],
-        pafDate:[
+        zfpVoucherType: [
           {
             required: true,
-            message: "付款日期不能为空",
+            message: "电子凭证类型不能为空",
             trigger: ["blur", "change"],
           },
         ],
       },
     };
   },
-  watch: {
-    'form.pafTradeType':'clearList'
-  },
   created() {
     this.reset();
-    this.getList();
+    this.getCompanyList();
+    //this.getList();
+    this.getDicts("zc_zfp_voucher_type").then((response) => {
+      this.voucherTypeOptions = response.data;
+    });
+    this.getDicts("zc_zfp_bookkeeping").then((response) => {
+      this.bookkeepingOptions = response.data;
+    });
+    this.getDicts("zc_zfp_expire").then((response) => {
+      this.expireOptions = response.data;
+    });
+    this.getDicts("zc_zfp_profit_type").then((response) => {
+      this.profitTypeOptions = response.data;
+    });
   },
   activated() {
     this.reset();
-    this.getList();
+    //this.getList();
   },
   methods: {
+    /** 查询资方 */
+    getCompanyList(){
+      listCompany().then(response =>{
+        this.companyList = response.data;
+      })
+    },
     getList(){
       const cifId = this.$route.params && this.$route.params.cifId;
       //合同信息
@@ -358,8 +414,14 @@ export default {
         }
       });
     },
-    /* -------------------------发票相关---------------------------- */
-        //发票列表
+    change(val){
+      if(val<=14){
+        this.$set(this.form, "zfpShortestPeriod", "14");
+      }
+      return ;
+    },
+    /* -------------------------合同相关---------------------------- */
+        //合同列表
     getInvoiceList() {
       listInvoice(this.queryParamsInvoice).then((response) => {
         this.InvoiceList = response.data.records;
@@ -367,14 +429,14 @@ export default {
         this.total = response.data.total;
       });
     },
-    //打开发票选择列表
+    //打开合同选择列表
     openTicket() {
       this.getInvoiceList();
       this.open = true;
-      this.title = "发票信息";
+      this.title = "合同信息";
     },
     selectChecked() {
-      this.ticketList.forEach((item) => {
+      this.contractList.forEach((item) => {
         this.InvoiceList.forEach((row) => {
           if (row.pvfId == item.pvId) {
             this.$nextTick(() => {
@@ -393,28 +455,15 @@ export default {
     handleSelectionChange(val) {
         this.chooseTicket = val
     },
-    //监听付款类型
-    clearList(){
-      if(!this.form.pafTradeType){
-        this.ticketList = [];
-        this.chooseTicket = [];
-        this.$refs.tableInvoice.clearSelection()
-      }else
-      if(this.form.pafTradeType == '00'){
-        this.ticketList = [];
-        this.chooseTicket = [];
-        this.$refs.tableInvoice.clearSelection()
-      }
-    },
     // 确认选择
     closeTicket() {
         if(this.chooseTicket){
           if(this.chooseTicket[0].pvfTYPE == '01'){
-          this.ticketList = this.chooseTicket
-          this.$set(this.form, "pvfDate", this.parseTime(new Date(this.ticketList[0].pvfDate)));
-          this.$set(this.form, "pvfInvoiceTitle", this.ticketList[0].pvfInvoiceTitle);
-          this.$set(this.form, "pvfTaxPrice", this.ticketList[0].pvfTaxPrice);
-          this.$set(this.form, "pvfInvoiceNum", this.ticketList[0].pvfInvoiceNum);
+          this.contractList = this.chooseTicket
+          this.$set(this.form, "pvfDate", this.parseTime(new Date(this.contractList[0].pvfDate)));
+          this.$set(this.form, "pvfInvoiceTitle", this.contractList[0].pvfInvoiceTitle);
+          this.$set(this.form, "pvfTaxPrice", this.contractList[0].pvfTaxPrice);
+          this.$set(this.form, "pvfInvoiceNum", this.contractList[0].pvfInvoiceNum);
           this.open = false
         }else{
           this.$message({
@@ -426,17 +475,17 @@ export default {
     },
     //取消选择发票按钮
     cancelTicket(){
-      if(this.ticketList.length > 0){
+      if(this.contractList.length > 0){
         this.open = false;
       }else{
-        this.ticketList = [];
+        this.contractList = [];
         this.$refs.tableInvoice.clearSelection()
         this.open = false;
       }
     },
     /** 清空选择发票信息 */
     deleteTicekt() {
-      this.ticketList = [];
+      this.contractList = [];
       this.$refs.tableInvoice.clearSelection()
     },
     /* 删除按钮 */
@@ -464,25 +513,13 @@ export default {
     pvfCategoryFormat(row, column) {
       return this.selectDictLabel(this.pvfCategoryOptions, row.pvfCategory);
     },
-    //票据方向
-    pvfTYPEFormat(row, column) {
-      return this.selectDictLabel(this.pvfTYPEOptions, row.pvfTYPE);
-    },
     /* ---------------------------------------------------------------------- */
     // 多选框选中数据
     handleCurrentChange(val) {
       // this.currentRow = val;
       // this.open = false;
     },
-    //账户列表
-    getAccList(query) {
-      console.log(query);
-      this.queryParamsAcc.ccaBankName = query;
-      this.queryParamsAcc.cccType = '00';
-      listAcc(this.queryParamsAcc).then((response) => {
-          this.AccList = response.data.records;
-      });
-    },
+   
     /* 清空 */
     clearBoth() {
       this.proId =  '';
@@ -493,149 +530,37 @@ export default {
       this.queryParamsAcc.ccaCustomerId = null;
       this.getAccList();
     },
-    //科目列表
-    getSubjectList(query){
-      this.queryParamsSubject.pctName = query;
-      subjectList(this.queryParamsSubject).then(response => {
-        console.log(response,"科目")
-        this.subjectList = response.data.records;
-      });
-    },
-    getContractNodeList(){
-
-    },
-    /* ----------------------------项目相关---------------------------------- */
-    //项目列表
-    getProjectList() {
-      selectProjectList(this.queryParamsProject).then((response) => {
-        this.projectList = response.rows;
-        this.totalProject = response.total;
-      });
-    },
-    // 项目信息弹窗
-    projectSelect(){
-      this.getProjectList();
-      this.title = "项目信息";
-      this.openProject = true;
-      this.$refs.tableProject.clearSelection();
-      this.proId = this.pjtId;
-      this.selectProjectChecked();
-    },
-    selectProjectChecked() {
-      console.log(this.proId,"56565656")
-      const pifId = this.proId;
-      this.projectList.forEach((row) => {
-        if (row.pifId == pifId) {
-          this.$nextTick(() => {
-            this.$refs.tableProject && this.$refs.tableProject.toggleRowSelection(row, true);
-          });
-        }
-      });
-    },
-    /* 多选框跨页 */
-    rowkeyProject(row) {
-      return row.pifId;
-    },
-    cancelSelectionProject() {
-      this.openProject = false;
-      this.projectList = [];
-    },
-    selectProject(selection, row) {
-      // 清除所有选中
-      this.$refs.tableProject.clearSelection();
-      if (selection.length === 0) return;
-      // 将当前点击项选中
-      this.$refs.tableProject.toggleRowSelection(row, true);
-      this.pjtent = row;
-    },
-    selectionChangeProject(val) {
-      console.log("selectionChange", val);
-      this.selectData = val;
-      this.pjtent = [];
-      if(val.length == 1){
-        this.pjtent = val[0];
-      }else if(val.length > 1) {
-        this.$refs.tableProject.toggleRowSelection(val[0], false);
-        this.$refs.tableProject.toggleRowSelection(val[1], true);
-        this.pjtent = val[1];
-      }
-    },
-    rowClickProject(row, column) {
-      this.pjtent = row;
-      const selectData = this.selectData;
-      this.$refs.tableProject.clearSelection();
-      if (selectData) {
-        if (selectData.length === 1) {
-          selectData.forEach((item) => {
-            if (item === row) {
-              this.$refs.tableProject.toggleRowSelection(row, false);
-            } else {
-              this.$refs.tableProject.toggleRowSelection(item, false);
-              this.$refs.tableProject.toggleRowSelection(row, true);
-            }
-          });
-        } else {
-          this.$refs.tableProject.toggleRowSelection(row, true);
-        }
-      } else {
-        this.$refs.tableProject.toggleRowSelection(row, true);
-      }
-    },
-    onSelectAllProject() {
-      this.$refs.tableProject.clearSelection();
-    },
-    // handleProject() {
-    //   this.queryParamsProject.pageNum = 1;
-    //   // this.getContractList();
-    // },
-    // resetProject() {
-    //   this.resetForm("formQueryProject");
-    //   this.queryParamsProject.pifCustomerName = null;
-    //   selectProjectList(this.queryParamsProject).then((response) => {
-    //     this.projectList = response.rows;
-    //     this.totalProject = response.total;
-    //   });
-    //   // this.handleProject();
-    // },
-    handleProject() {
-      selectProjectList(this.queryParamsProject).then((response) => {
-
-        this.projectList = response.rows;
-        this.totalProject = response.total;
-      });
-    },
-    resetProject() {
-      this.resetForm("formQueryProject");
-      this.queryParamsProject.pifCustomerName = null;
-      this.queryParamsProject.pageNum = 1;
-      this.handleProject();
-    },
-    changeProject(row, column, event) {
-      if (this.pjtent) {
-        row = this.pjtent;
-        if (row.pifId) {
-          //合同
-          this.$set(this.form, "pifName", row.pifName);
-          this.$set(this.form, "pafProjectId", row.pifId);
-          this.pjtent = row.pifId;
-          this.pjtId = row.pifId;
-        } else {
-          this.$set(this.form, "pifName", "");
-          this.$set(this.form, "pafProjectId", "");
-          this.proId = "";
-          this.pjtId = "";
-        }
-        this.openProject = false;
-      } else {
-        this.$message({
-          message: "请选择项目!",
-          type: "warning",
-        });
-        return;
-      }
-    },
     reset(){
-      this.form = {};
+      this.form = {
+        zfpId: null,
+        zfpNumber: null,
+        zfpName: null,
+        zfpManagementId: null,
+        zfpSplit: "0",
+        zfpType:"1",
+        zfpTransfer: "0",
+        zfpRecourse: "0",
+        zfpVoucherType: null,
+        zfpCoreAccount: "0",
+        zfpSupplierAccount: "0",
+        zfpCharge: "0",
+        zfpStatus: "0",
+        zfpMinimumAmount: null,
+        zfpShortestPeriod: null,
+        zfpBookkeeping: null,
+        zfpPart: "0",
+        zfpExpire: null,
+        zfpRate: null,
+        zfpProfit: "0",
+        zfpProfitType: null,
+        zfpProfitRate: null,
+        zfpPlatform: "0",
+        createBy: null,
+        createTime: null,
+        updateBy: null,
+        updateTime: null
+      };
+       this.resetForm("form");
     },
 /* ---------------------------------------------------------------------- */
     // 取消按钮
@@ -646,19 +571,10 @@ export default {
       this.open = false;
     },
     /** 保存按钮 */
-    submitForm(state) {
-      if(this.form.pafTradeType == '01' && !this.chooseTicket.length > 0){
-        this.$message({
-            message: '请选择发票',
-            type: 'warning'
-          });
-          return;
-      }
+    submitForm() {
+      
       this.$refs["form"].validate((valid) => {
-        if (state) {
-          this.form.pafState = state;
-        }
-        this.form.ticketList = this.ticketList;
+        this.form.contractList = this.contractList;
         console.log(this.form)
         if (valid) {
           const loading = this.$loading({
@@ -667,7 +583,7 @@ export default {
             spinner: "el-icon-loading",
             background: "rgba(0, 0, 0, 0.7)",
           });
-          addFlow(this.form)
+          addFinanceProduct(this.form)
             .then((response) => {
               loading.close();
               this.msgSuccess("新增成功");
@@ -684,93 +600,6 @@ export default {
     //   this.open = false;
     // },
     /* //  将数字金额转换为大写金额 */
-    smallToBig(money) {
-      //  将数字金额转换为大写金额
-      var cnNums = new Array(
-        "零",
-        "壹",
-        "贰",
-        "叁",
-        "肆",
-        "伍",
-        "陆",
-        "柒",
-        "捌",
-        "玖"
-      ); //汉字的数字
-      var cnIntRadice = new Array("", "拾", "佰", "仟"); //基本单位
-      var cnIntUnits = new Array("", "万", "亿", "兆"); //对应整数部分扩展单位
-      var cnDecUnits = new Array("角", "分", "毫", "厘"); //对应小数部分单位
-      var cnInteger = "整"; //整数金额时后面跟的字符
-      var cnIntLast = "元"; //整数完以后的单位
-      //最大处理的数字
-      var maxNum = 999999999999999.9999;
-      var integerNum; //金额整数部分
-      var decimalNum; //金额小数部分
-      //输出的中文金额字符串
-      var chineseStr = "";
-      var parts; //分离金额后用的数组,预定义
-      if (money == "" || money == null || money == undefined) {
-        return "零元零角零分";
-      }
-
-      money = parseFloat(money);
-      if (money >= maxNum) {
-        //超出最大处理数字
-        return "超出最大处理数字";
-      }
-      if (money == 0) {
-        chineseStr = cnNums[0] + cnIntLast + cnInteger;
-        return chineseStr;
-      }
-
-      //四舍五入保留两位小数,转换为字符串
-      money = Math.round(money * 100).toString();
-      integerNum = money.substr(0, money.length - 2);
-      decimalNum = money.substr(money.length - 2);
-
-      //获取整型部分转换
-      if (parseInt(integerNum, 10) > 0) {
-        var zeroCount = 0;
-        var IntLen = integerNum.length;
-        for (var i = 0; i < IntLen; i++) {
-          var n = integerNum.substr(i, 1);
-          var p = IntLen - i - 1;
-          var q = p / 4;
-          var m = p % 4;
-          if (n == "0") {
-            zeroCount++;
-          } else {
-            if (zeroCount > 0) {
-              chineseStr += cnNums[0];
-            }
-            //归零
-            zeroCount = 0;
-            chineseStr += cnNums[parseInt(n)] + cnIntRadice[m];
-          }
-          if (m == 0 && zeroCount < 4) {
-            chineseStr += cnIntUnits[q];
-          }
-        }
-        chineseStr += cnIntLast;
-      }
-      //小数部分
-      if (decimalNum != "") {
-        var decLen = decimalNum.length;
-        for (var i = 0; i < decLen; i++) {
-          var n = decimalNum.substr(i, 1);
-          if (n != "0") {
-            chineseStr += cnNums[Number(n)] + cnDecUnits[i];
-          }
-        }
-      }
-      if (chineseStr == "") {
-        chineseStr += cnNums[0] + cnIntLast + cnInteger;
-      } else if (decimalNum == "" || /^0*$/.test(decimalNum)) {
-        chineseStr += cnInteger;
-      }
-      return chineseStr;
-    },
   },
 };
 </script>

+ 614 - 0
front-vue/src/views/service/financeProduct/editFinanceProduct.vue

@@ -0,0 +1,614 @@
+<template>
+  <div class="app-container">
+    <el-form :inline="true" ref="form" :model="form" :rules="rules" label-width="auto" style="margin-top: 20px;"  >
+      <el-divider content-position="left">基本信息</el-divider>
+        <!-- <el-form-item label="融资产品编号" prop="zfpNumber">
+          <el-input v-model="form.zfpNumber" placeholder="请输入融资产品编号" />
+        </el-form-item> -->
+        <el-form-item label="融资产品名称:" prop="zfpName" style="margin-left: 5%">
+          <el-input v-model="form.zfpName" placeholder="请输入融资产品名称" />
+        </el-form-item>
+        <el-form-item label="资金方:" prop="zfpManagementId" style="margin-left: 5%">
+           <el-select
+              v-model="form.zfpManagementId"
+              placeholder="请选择资金方"
+              clearable
+              size="small">
+              <el-option
+                v-for="(item,index) in companyList"
+                :key="index"
+                :label="item.scyName"
+                :value="item.scyId"/>
+          </el-select>
+        </el-form-item>
+        <el-form-item label="是否可拆转融:" style="margin-left: 5%">
+          <el-radio v-model="form.zfpSplit" label="0">否</el-radio>
+          <el-radio v-model="form.zfpSplit" label="1">是</el-radio>
+        </el-form-item>
+        <el-form-item label="产品类型:" style="margin-left: 5%">
+          <el-radio v-model="form.zfpType" label="0">正向</el-radio>
+          <el-radio v-model="form.zfpType" label="1">反向</el-radio>
+        </el-form-item>
+         <el-divider content-position="left">平台参数</el-divider>
+
+        <el-form-item label="最小融资金额:" prop="zfpMinimumAmount" style="margin-left: 5%">
+          <el-input v-model="form.zfpMinimumAmount" placeholder="请输入最小融资金额" />
+        </el-form-item>
+         <el-form-item label="最短融资账期:" prop="zfpShortestPeriod" style="margin-left: 5%">
+          <el-input v-model="form.zfpShortestPeriod" placeholder="最短14天" @change="change"/>
+        </el-form-item>
+        <el-form-item label="服务费是否可退:" style="margin-left: 5%">
+          <el-radio v-model="form.zfpCharge" label="0">否</el-radio>
+          <el-radio v-model="form.zfpCharge" label="1">是</el-radio>
+        </el-form-item>
+        <el-form-item label="是否有追索权:" style="margin-left: 5%">
+          <el-radio v-model="form.zfpRecourse" label="0">否</el-radio>
+          <el-radio v-model="form.zfpRecourse" label="1">是</el-radio>
+        </el-form-item>
+        <el-form-item label="电子凭证类型:" prop="zfpVoucherType" style="margin-left: 5%">
+          <el-select
+            v-model="form.zfpVoucherType"
+            placeholder="请选择电子凭证类型"
+            clearable
+            size="small">
+            <el-option
+              v-for="dict in voucherTypeOptions"
+              :key="dict.dictValue"
+              :label="dict.dictLabel"
+              :value="dict.dictValue"/>
+          </el-select>
+        </el-form-item>
+        <el-divider content-position="left">资方参数</el-divider>
+
+        <el-form-item label="是否需核心企业开户:" style="margin-left: 5%">
+          <el-radio v-model="form.zfpCoreAccount" label="0">否</el-radio>
+          <el-radio v-model="form.zfpCoreAccount" label="1">是</el-radio>
+        </el-form-item>
+        <el-form-item label="是否需融资企业开户:" style="margin-left: 5%">
+          <el-radio v-model="form.zfpSupplierAccount" label="0">否</el-radio>
+          <el-radio v-model="form.zfpSupplierAccount" label="1">是</el-radio>
+        </el-form-item>
+        <el-form-item label="记账簿托管方式:" prop="zfpBookkeeping" style="margin-left: 5%">
+          <el-select
+            v-model="form.zfpBookkeeping"
+            placeholder="请选择记账簿托管方式"
+            clearable
+            size="small">
+            <el-option
+              v-for="dict in bookkeepingOptions"
+              :key="dict.dictValue"
+              :label="dict.dictLabel"
+              :value="dict.dictValue"/>
+          </el-select>
+        </el-form-item>
+        <el-form-item label="是否支持部分融资:" style="margin-left: 5%">
+          <el-radio v-model="form.zfpPart" label="0">否</el-radio>
+          <el-radio v-model="form.zfpPart" label="1">是</el-radio>
+        </el-form-item>
+        <el-form-item label="资方融资费率:" prop="zfpRate" style="margin-left: 5%">
+          <el-input v-model="form.zfpRate" placeholder="请输入资方融资费率" />
+        </el-form-item>
+        <el-form-item label="融资到期方式:" prop="zfpExpire" style="margin-left: 5%">
+          <el-select
+            v-model="form.zfpExpire"
+            placeholder="请选择融资到期方式"
+            clearable
+            size="small">
+            <el-option
+              v-for="dict in expireOptions"
+              :key="dict.dictValue"
+              :label="dict.dictLabel"
+              :value="dict.dictValue"/>
+          </el-select>
+        </el-form-item>
+        <el-form-item label="资方是否支持返佣:" style="margin-left: 5%">
+          <el-radio v-model="form.zfpProfit" label= "0" >否</el-radio>
+          <el-radio v-model="form.zfpProfit" label= "1" >是</el-radio>
+        </el-form-item>
+        <el-form-item label="资方返佣方式:" prop="zfpProfitType" style="margin-left: 5%" v-if="form.zfpProfit== '1' ">
+          <el-select
+            v-model="form.zfpProfitType"
+            placeholder="请选择资方返佣方式"
+            clearable
+            size="small">
+            <el-option
+              v-for="dict in profitTypeOptions"
+              :key="dict.dictValue"
+              :label="dict.dictLabel"
+              :value="dict.dictValue"/>
+          </el-select>
+        </el-form-item>
+        <el-form-item label="资方返佣费率" prop="zfpProfitRate" style="margin-left: 5%" v-if="form.zfpProfit== '1' ">
+          <el-input v-model="form.zfpProfitRate" placeholder="请输入资方返佣费率" />
+        </el-form-item>
+        <el-form-item label="是否需平台审批:" style="margin-left: 5%">
+          <el-radio v-model="form.zfpPlatform" label="0">否</el-radio>
+          <el-radio v-model="form.zfpPlatform" label="1">是</el-radio>
+        </el-form-item>
+        <el-divider content-position="left">关联合同</el-divider>
+        <el-form-item prop="zfcId" style="margin-left: 100px" >
+        <el-button size="mini" type="primary" @click="openTicket">选择合同</el-button>
+        <el-button size="mini" @click="deleteTicekt">清空全部</el-button>
+        <el-table :data="contractList" style="width: 1100px">
+          <el-table-column label="合同模板编号"  align="center"  prop="pvfInvoiceTitle" show-overflow-tooltip />
+          <el-table-column label="合同模板名称"  align="center"  prop="zfcName"   />
+          <el-table-column label="签署方"  align="center"  prop="pvfDate"    />
+          <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="250">
+            <template slot-scope="scope">
+              <el-button
+                size="mini"
+                type="text"
+                icon="el-icon-delete"
+                @click="handleDelete(scope.$index, contractList)"
+              >删除</el-button>
+            </template>
+          </el-table-column>
+        </el-table>
+      </el-form-item>
+      </el-form>
+      <!-- 合同信息 -->
+    <el-dialog :title="invoiceTitle" :visible.sync="open" width="1120px" append-to-body>
+      <el-form :model="queryParamsInvoice"  ref="formQuery"  :inline="true"  label-width="68px"  style="margin-bottom: -21px">
+        <el-form-item label="发票标题" prop="pvfInvoiceTitle">
+          <el-input
+            v-model="queryParamsInvoice.pvfInvoiceTitle"
+            placeholder="请输入发票标题"
+            clearable
+            size="small"
+            maxlength="11"
+            @keyup.enter.native="handleQuerys"/>
+        </el-form-item>
+        <el-form-item label="开票日期" prop="dateTime">
+          <el-date-picker
+            size="small"
+            v-model="queryParamsInvoice.dateTime"
+            unlink-panels
+            style="width: 240px"
+            value-format="yyyy-MM-dd"
+            type="daterange"
+            range-separator="-"
+            start-placeholder="开始日期"
+            end-placeholder="结束日期">
+          </el-date-picker>
+        </el-form-item>
+        <el-form-item>
+          <el-button
+            type="cyan"
+            icon="el-icon-search"
+            size="mini"
+            @click="handleQuerys"
+            >搜索</el-button>
+          <el-button icon="el-icon-refresh" size="mini" @click="resetQuerys"
+            >重置</el-button>
+        </el-form-item>
+      </el-form>
+      <el-table :data="InvoiceList"
+        ref="tableInvoice"
+        class="single-select-table"
+        @selection-change="handleSelectionChange" 
+        :row-key="rowkey">
+        <el-table-column
+          type="selection"
+          :reserve-selection="true"
+          width="50"
+          align="center"/>
+        <el-table-column label="序号" type="index" width="50" align="center">
+          <template slot-scope="scope">
+            <span>{{ (queryParamsInvoice.pageNum - 1) * queryParamsInvoice.pageSize + scope.$index + 1}}</span>
+          </template>
+        </el-table-column>
+        <el-table-column label="发票标题"  align="center"  prop="pvfInvoiceTitle" show-overflow-tooltip width="100" />
+        <el-table-column label="发票金额"  align="center"  prop="pvfTaxPrice"  width="125" />
+        <el-table-column label="发票张数"  align="center"  prop="pvfInvoiceNum" show-overflow-tooltip width="100" />
+        <el-table-column label="开票日期"  align="center"  prop="pvfDate"  width="95"  />
+        <el-table-column label="客户名称"  align="center"  prop="cciName"  width="120"  show-overflow-tooltip />
+        <el-table-column label="合同名称"  align="center"  prop="cifName"  width="120"  show-overflow-tooltip />
+        <el-table-column label="项目名称"  align="center"  prop="pifName"  width="120"  show-overflow-tooltip />
+        <el-table-column label="发票类型"  align="center"  :formatter="pvfCategoryFormat"  prop="pvfCategory"  width="120" />
+        <el-table-column label="交付日期"  align="center"  prop="pvfDeliverTime"  width="95" />
+      </el-table>
+      <pagination
+        v-show="total > 0"
+        :total="total"
+        :page.sync="queryParamsInvoice.pageNum"
+        :limit.sync="queryParamsInvoice.pageSize"
+        @pagination="getInvoiceList" />
+      <!-- <el-button type="primary" @click="submitData()">关闭</el-button> -->
+      <span slot="footer" class="dialog-footer">
+        <el-button size="mini" @click="cancelTicket">取消</el-button>
+        <el-button size="mini" type="primary" @click="closeTicket">确认</el-button>
+        <!-- <el-button @click="cancelSelection">取 消</el-button>
+        <el-button type="primary" @click="changeInvoice">确 定</el-button> -->
+      </span>
+    </el-dialog>
+    <!-- 保存 -->
+    <div class="footer" style="margin-top: 260px; float: right">
+      <el-button type="info" @click="cancel">取消</el-button>
+      <el-button type="success" @click="submitForm"
+        >提交</el-button>
+    </div>
+  </div>
+</template>
+
+<script>
+import { getFinanceProduct,updateFinanceProduct } from "@/api/service/financeProduct/financeProduct";
+import { listCompany } from "@/api/common/company";
+export default {
+  name: "editFinanceProduct",
+  components: {},
+  data() {
+    return {
+      //发票表格数据
+      contractList: [],
+      //选中发票数据
+      chooseTicket:[],
+      // 日期范围
+      dateRange: [],
+      pafCustomerId: "",
+      activeName: "1",
+      // 选中数组
+      ids: [],
+      // 弹出层标题
+      title: "",
+      invoiceTitle:"",
+      openInvoice : false,
+      // 总条数
+      total: 0,
+      totalCustomer: 0,
+      totalContract: 0,
+      totalProject: 0,
+      // 是否显示弹出层
+      open: false,
+      openCustomer: false,
+      openContract: false,
+      openProject: false,
+      customerName: "",
+      customerId: '',
+      fpId: "",
+      ctnId : '',
+      pafCollectionAmtFromat: "",
+      // 资方列表
+      companyList: [],
+      //余额
+      BalanceList: [],
+      multipleSelection: [],
+      //账户列表
+      AccList: [],
+      //项目列表
+      projectList: [],
+      pjtent: [],
+      proId: '',
+      pjtId: '',
+      //科目列表
+      subjectList:[],
+      current: [],
+      custent: [],
+      //合同列表
+      contractList: [],
+      content: [],
+      //发票列表
+      InvoiceList: [],
+      //数据字典
+      voucherTypeOptions: [],
+      bookkeepingOptions: [],
+      expireOptions: [],
+      profitTypeOptions: [],
+      // 表单参数
+      form: {},
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        pifName: null,
+        pifId: null,
+        pifContractId: null,
+      },
+      queryParamsInvoice: {
+        pageNum: 1,
+        pageSize: 10,
+        dateTime: [],
+        pvfProjectId: null,
+        pvfContractId: null,
+        pidCode: null,
+        pvfTYPE: null,
+        pvfInvoiceTitle : null
+      },
+      options: [],
+      value: [],
+      loading: false,
+      // 表单校验
+      rules: {
+        zfpName: [
+          {
+            required: true,
+            message: "产品名称不能为空",
+            trigger: ["blur", "change"],
+          },
+        ],
+        zfpManagementId: [
+          {
+            required: true,
+            message: "资金方不能为空",
+            trigger: ["blur", "change"],
+          },
+        ],
+        zfpMinimumAmount: [
+          {
+            required: true,
+            pattern: /^[0-9][0-9]{0,9}$|^[1-9][0-9]{0,9}[.]\d{1,2}$/,
+            message: "请输入正确的付款金额",
+            trigger: ["blur", "change"],
+          },
+        ],
+        zfpShortestPeriod: [
+          {
+            required: true,
+            message: "最短融资账期不能为空",
+            trigger: ["blur", "change"],
+          },
+        ],
+        zfpVoucherType: [
+          {
+            required: true,
+            message: "电子凭证类型不能为空",
+            trigger: ["blur", "change"],
+          },
+        ],
+      },
+    };
+  },
+  created() {
+    const zfpId = this.$route.params && this.$route.params.zfpId;
+    this.reset();
+    this.getCompanyList();
+    //this.getList();
+    this.getDicts("zc_zfp_voucher_type").then((response) => {
+      this.voucherTypeOptions = response.data;
+    });
+    this.getDicts("zc_zfp_bookkeeping").then((response) => {
+      this.bookkeepingOptions = response.data;
+    });
+    this.getDicts("zc_zfp_expire").then((response) => {
+      this.expireOptions = response.data;
+    });
+    this.getDicts("zc_zfp_profit_type").then((response) => {
+      this.profitTypeOptions = response.data;
+    });
+    getFinanceProduct(zfpId).then((response) =>{
+      this.form = response.data;
+    })
+  },
+  activated() {
+    this.reset();
+    //this.getList();
+  },
+  methods: {
+    /** 查询资方 */
+    getCompanyList(){
+      listCompany().then(response =>{
+        this.companyList = response.data;
+      })
+    },
+    getList(){
+      const cifId = this.$route.params && this.$route.params.cifId;
+      //合同信息
+      getOwnContract(cifId).then((response) => {
+        debugger
+            this.$set(this.form, "pafContractId", cifId);
+            this.$set(this.form, "cifName", response.data.data.cifName);
+        if(response){
+            //客户信息
+            this.$set(this.form, "pafCustomerId", response.data.data.cifCustomerId);
+            this.$set(this.form, "cciName", response.data.data.cciName);
+            listContractNode(cifId).then((res) => {
+              this.contractNodeList = res.data;
+            });
+            this.queryParamsProject.pifCustomerName = response.data.data.cciName;
+            this.queryParamsAcc.ccaCustomerId = response.data.data.cifCustomerId;
+            this.queryParamsAcc.cccType = '00';
+            listAcc(this.queryParamsAcc).then((r) => {
+                this.AccList = r.data.records;
+                if(r.data.records[0].ccaId){
+                this.$set(this.form, "pafAccountId", r.data.records[0].ccaId);
+                }else{
+                  this.queryParamsAcc.ccaCustomerId = '';
+                  this.getAccList();
+                }
+            });
+        }
+      });
+    },
+    change(val){
+      if(val<=14){
+        this.$set(this.form, "zfpShortestPeriod", "14");
+      }
+      return ;
+    },
+    /* -------------------------合同相关---------------------------- */
+        //合同列表
+    getInvoiceList() {
+      listInvoice(this.queryParamsInvoice).then((response) => {
+        this.InvoiceList = response.data.records;
+        this.selectChecked();
+        this.total = response.data.total;
+      });
+    },
+    //打开合同选择列表
+    openTicket() {
+      this.getInvoiceList();
+      this.open = true;
+      this.title = "合同信息";
+    },
+    selectChecked() {
+      this.contractList.forEach((item) => {
+        this.InvoiceList.forEach((row) => {
+          if (row.pvfId == item.pvId) {
+            this.$nextTick(() => {
+              this.$refs.tableInvoice &&
+                this.$refs.tableInvoice.toggleRowSelection(row, true);
+            });
+          }
+        });
+      });
+    },
+    /* 多选框跨页 */
+    rowkey(row) {
+      return row.pvfId;
+    },
+    // 多选框选中数据
+    handleSelectionChange(val) {
+        this.chooseTicket = val
+    },
+    // 确认选择
+    closeTicket() {
+        if(this.chooseTicket){
+          if(this.chooseTicket[0].pvfTYPE == '01'){
+          this.contractList = this.chooseTicket
+          this.$set(this.form, "pvfDate", this.parseTime(new Date(this.contractList[0].pvfDate)));
+          this.$set(this.form, "pvfInvoiceTitle", this.contractList[0].pvfInvoiceTitle);
+          this.$set(this.form, "pvfTaxPrice", this.contractList[0].pvfTaxPrice);
+          this.$set(this.form, "pvfInvoiceNum", this.contractList[0].pvfInvoiceNum);
+          this.open = false
+        }else{
+          this.$message({
+            message: '所选发票信息异常',
+            type: 'warning'
+          });
+        }
+        }
+    },
+    //取消选择发票按钮
+    cancelTicket(){
+      if(this.contractList.length > 0){
+        this.open = false;
+      }else{
+        this.contractList = [];
+        this.$refs.tableInvoice.clearSelection()
+        this.open = false;
+      }
+    },
+    /** 清空选择发票信息 */
+    deleteTicekt() {
+      this.contractList = [];
+      this.$refs.tableInvoice.clearSelection()
+    },
+    /* 删除按钮 */
+    handleDelete(index, rows) {
+      console.log(rows,"AAAAAAAAAAA")
+      rows.splice(index, 1);
+      this.$refs.tableInvoice.clearSelection()
+      this.selectChecked();
+    },
+    onSelectAll() {
+      this.$refs.tableInvoice.clearSelection();
+    },
+    handleQuerys() {
+      this.queryParamsInvoice.pageNum = 1;
+      this.getInvoiceList();
+    },
+    resetQuerys() {
+      this.resetForm("formQuery");
+      this.handleQuerys();
+    },
+    handleInput(str) {
+      this.pafCollectionAmtFromat = amtformat(str, 2, ".", ",");
+    },
+    //发票类型
+    pvfCategoryFormat(row, column) {
+      return this.selectDictLabel(this.pvfCategoryOptions, row.pvfCategory);
+    },
+    /* ---------------------------------------------------------------------- */
+    // 多选框选中数据
+    handleCurrentChange(val) {
+      // this.currentRow = val;
+      // this.open = false;
+    },
+   
+    /* 清空 */
+    clearBoth() {
+      this.proId =  '';
+      this.pjtId = '';
+      // this.getContractList();
+      this.getProjectList();
+      this.getSubjectList();
+      this.queryParamsAcc.ccaCustomerId = null;
+      this.getAccList();
+    },
+    reset(){
+      this.form = {
+        zfpId: null,
+        zfpNumber: null,
+        zfpName: null,
+        zfpManagementId: null,
+        zfpSplit: "0",
+        zfpType:"1",
+        zfpTransfer: "0",
+        zfpRecourse: "0",
+        zfpVoucherType: null,
+        zfpCoreAccount: "0",
+        zfpSupplierAccount: "0",
+        zfpCharge: "0",
+        zfpStatus: "0",
+        zfpMinimumAmount: null,
+        zfpShortestPeriod: null,
+        zfpBookkeeping: null,
+        zfpPart: "0",
+        zfpExpire: null,
+        zfpRate: null,
+        zfpProfit: "0",
+        zfpProfitType: null,
+        zfpProfitRate: null,
+        zfpPlatform: "0",
+        createBy: null,
+        createTime: null,
+        updateBy: null,
+        updateTime: null
+      };
+       this.resetForm("form");
+    },
+/* ---------------------------------------------------------------------- */
+    // 取消按钮
+    cancel() {
+      this.reset();
+      this.$store.dispatch("tagsView/delView", this.$route);
+      this.$router.go(-1);
+      this.open = false;
+    },
+    /** 保存按钮 */
+    submitForm() {
+      
+      this.$refs["form"].validate((valid) => {
+        this.form.contractList = this.contractList;
+        console.log(this.form)
+        if (valid) {
+          const loading = this.$loading({
+            lock: true,
+            text: "Loading",
+            spinner: "el-icon-loading",
+            background: "rgba(0, 0, 0, 0.7)",
+          });
+          updateFinanceProduct(this.form)
+            .then((response) => {
+              loading.close();
+              this.msgSuccess("修改成功");
+              this.$store.dispatch("tagsView/delView", this.$route);
+              this.$router.go(-1);
+            })
+            .catch((response) => {
+              loading.close();
+            });
+        }
+      });
+    },
+    // submitData() {
+    //   this.open = false;
+    // },
+    /* //  将数字金额转换为大写金额 */
+  },
+};
+</script>
+<style>
+.single-select-table thead .el-table-column--selection .cell {
+  display: none;
+}
+
+</style>

+ 84 - 29
front-vue/src/views/service/financeProduct/financeProduct.vue

@@ -73,15 +73,15 @@
           <span>{{(queryParams.pageNum - 1) * queryParams.pageSize + scope.$index + 1}}</span>
         </template>
       </el-table-column>      
-      <el-table-column label="产品编号" align="center" prop="zfpId" :show-overflow-tooltip="true"/>
+      <el-table-column label="产品编号" align="center" prop="zfpNumber" :show-overflow-tooltip="true"/>
       <el-table-column label="产品名称" align="center" prop="zfpName" :show-overflow-tooltip="true"/>
-      <el-table-column label="产品类型" align="center" prop="zfpType" :show-overflow-tooltip="true"/>
+      <el-table-column label="产品类型" align="center" prop="zfpType" :formatter="typeFormat" :show-overflow-tooltip="true"/>
       <el-table-column label="资金方" align="center" prop="scyName" :show-overflow-tooltip="true"/>
-      <el-table-column label="是否可拆转融" align="center" prop="zfpSplit" :show-overflow-tooltip="true"/>
-      <el-table-column label="是否有追索权" align="center" prop="zfpRecourse" :show-overflow-tooltip="true"/>
-      <el-table-column label="电子凭证类型" align="center" prop="zfpVoucherType" :show-overflow-tooltip="true"/>
-      <el-table-column label="服务费是否可退" align="center" prop="zfpCharge" :show-overflow-tooltip="true"/>
-      <el-table-column label="产品状态" align="center" prop="zfpStatus" :show-overflow-tooltip="true"/>
+      <el-table-column label="是否可拆转融" align="center" prop="zfpSplit" :formatter="splitFormat" :show-overflow-tooltip="true"/>
+      <el-table-column label="是否有追索权" align="center" prop="zfpRecourse" :formatter="recourseFormat" :show-overflow-tooltip="true"/>
+      <el-table-column label="电子凭证类型" align="center" prop="zfpVoucherType" :formatter="voucherTypeFormat" :show-overflow-tooltip="true"/>
+      <el-table-column label="服务费是否可退" align="center" prop="zfpCharge" :formatter="chargeFormat" :show-overflow-tooltip="true"/>
+      <el-table-column label="产品状态" align="center" prop="zfpStatus" :formatter="statusFormat" :show-overflow-tooltip="true"/>
       <el-table-column label="最小融资金额" align="center" prop="zfpMinimumAmount" :show-overflow-tooltip="true"/>
       <el-table-column label="最短账期" align="center" prop="zfpShortestPeriod" :show-overflow-tooltip="true"/>
       <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
@@ -91,8 +91,25 @@
             type="text"
             icon="el-icon-edit"
             @click="handleUpdate(scope.row)"
-            v-hasPermi="['project:type:edit']"
+            v-if="scope.row.zfpStatus == '00'"
+            v-hasPermi="['service:financeProduct:edit']"
           >修改</el-button>
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-edit"
+            @click="handleChange(scope.row)"
+            v-if="scope.row.zfpStatus == '01'"
+            v-hasPermi="['service:financeProduct:change']"
+          >停用</el-button>
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-edit"
+            @click="handleChange(scope.row)"
+            v-if="scope.row.zfpStatus == '00'"
+            v-hasPermi="['service:financeProduct:change']"
+          >启用</el-button>
         </template>
       </el-table-column>
     </el-table>
@@ -108,7 +125,8 @@
 </template>
 
 <script>
-import { listFinanceProduct, } from "@/api/service/financeProduct/financeProduct";
+import { listFinanceProduct,changeState } from "@/api/service/financeProduct/financeProduct";
+
 
 export default {
   name: "financeProduct",
@@ -146,20 +164,38 @@ export default {
       form: {},
       // 表单校验
       rules: {
-         pptName:[
-          { required: true, message: "项目类型不能为空", trigger: "blur" },
-        ]
+        //  pptName:[
+        //   { required: true, message: "项目类型不能为空", trigger: "blur" },
+        // ]
       }
     };
   },
   created() {
     this.getList();
+    this.getDicts("zc_zfp_split").then((response) => {
+      this.splitOptions = response.data;
+    });
+    this.getDicts("zc_zfp_recourse").then((response) => {
+      this.recourseOptions = response.data;
+    });
+    this.getDicts("zc_zfp_status").then((response) => {
+      this.statusOptions = response.data;
+    });
+    this.getDicts("zc_zfp_charge").then((response) => {
+      this.chargeOptions = response.data;
+    });
+    this.getDicts("zc_zfp_voucher_type").then((response) => {
+      this.voucherTypeOptions = response.data;
+    });
+    this.getDicts("zc_zfp_type").then((response) => {
+      this.typeOptions = response.data;
+    });
   },
   activated(){
     this.getList();
   },
   methods: {
-    /** 查询项目类型列表 */
+    /** 查询融资产品列表 */
     getList() {
       this.loading = true;
       listFinanceProduct(this.queryParams).then(response => {
@@ -168,6 +204,7 @@ export default {
         this.loading = false;
       });
     },
+    
     // 取消按钮
     cancel() {
       this.open = false;
@@ -176,15 +213,7 @@ export default {
     // 表单重置
     reset() {
       this.form = {
-        pptId: null,
-        pptCompanyId: null,
-        pptName: null,
-        pptRemark: null,
-        pptIsDel: null,
-        createBy: null,
-        createTime: null,
-        updateBy: null,
-        updateTime: null
+       
       };
       this.resetForm("form");
     },
@@ -212,13 +241,39 @@ export default {
     },
     /** 修改按钮操作 */
     handleUpdate(row) {
-      this.reset();
-      const pptId = row.pptId || this.ids
-      getProjectType(pptId).then(response => {
-        this.form = response.data;
-        this.open = true;
-        this.title = "修改项目类型";
-      });
+      const zfpId = row.zfpId
+      this.$router.push("/financeProduct/editFinanceProduct/"+ zfpId);
+    },
+    /** 启用按钮操作 */
+     handleChange(row) {
+       const zfpId = row.zfpId;
+       changeState(zfpId).then((response)=>{
+         this.getList();
+       })
+     },
+    //拆转融字典反显
+    splitFormat(row, column) {
+      return this.selectDictLabel(this.splitOptions, row.zfpSplit);
+    },
+    //是否有追索权字典反显
+    recourseFormat(row, column) {
+      return this.selectDictLabel(this.recourseOptions, row.zfpRecourse);
+    },
+    //产品状态字典反显
+    statusFormat(row, column) {
+      return this.selectDictLabel(this.statusOptions, row.zfpStatus);
+    },
+    //服务费是否可退字典反显
+    chargeFormat(row, column) {
+      return this.selectDictLabel(this.chargeOptions, row.zfpCharge);
+    },
+    //电子凭证类型字典反显
+    voucherTypeFormat(row, column) {
+      return this.selectDictLabel(this.voucherTypeOptions, row.zfpVoucherType);
+    },
+    //类型字典反显
+    typeFormat(row, column) {
+      return this.selectDictLabel(this.typeOptions, row.zfpType);
     },
     /** 提交按钮 */
     submitForm() {