Browse Source

货代销项发票和结算中心 2023-12-28

caojunjie 1 year ago
parent
commit
9288f6cab6

+ 52 - 3
src/api/iosBasicData/fininvoices.js

@@ -41,7 +41,7 @@ export const fininvoicesSubmit = (row) => {
     data: row
   })
 }
-// 确认 业务-发票
+// 销项发票-提交 确认 业务-发票
 export const fininvoicesConfirmFinInvoices = (row) => {
   return request({
     url: '/api/blade-los/fininvoices/confirmFinInvoices',
@@ -49,7 +49,7 @@ export const fininvoicesConfirmFinInvoices = (row) => {
     data: row
   })
 }
-// 业务-发票 撤销
+// 销项发票-撤销 业务-发票 撤销
 export const fininvoicesRevokeFinInvoices = (row) => {
   return request({
     url: '/api/blade-los/fininvoices/revokeFinInvoices',
@@ -91,4 +91,53 @@ export const fininvoicesitemsRemove = (ids) => {
     }
   })
 }
-
+// 业务-发票申请-生成开票
+export const generateFinInvoicesDetail = (data) => {
+  return request({
+    url: '/api/blade-los/fininvoices/generateFinInvoicesDetail',
+    method: 'post',
+    data: data
+  })
+}
+// 业务-发票申请-撤销开票
+export const revokeFinInvoicesDetail = (data) => {
+  return request({
+    url: '/api/blade-los/fininvoices/revokeFinInvoicesDetail',
+    method: 'post',
+    data: data
+  })
+}
+// 业务-发票申请-开票删除
+export const fininvoiceitemdetailRemove = (ids) => {
+  return request({
+    url: '/api/blade-los/fininvoiceitemdetail/remove',
+    method: 'post',
+    params: {
+      ids,
+    }
+  })
+}
+// 业务-发票申请-开票保存
+export const fininvoiceitemdetailSubmit = (row) => {
+  return request({
+    url: '/api/blade-los/fininvoiceitemdetail/submit',
+    method: 'post',
+    data: row
+  })
+}
+// 业务-销项发票-任务列表-开票
+export const fininvoicesGenerateFinInvoices = (row) => {
+  return request({
+    url: '/api/blade-los/fininvoices/generateFinInvoices',
+    method: 'get',
+    params: row
+  })
+}
+// 业务-结算中心-结算
+export const generateFinStlBills = (row) => {
+  return request({
+    url: '/api/blade-los/finstlbills/generateFinStlBills',
+    method: 'get',
+    params: row
+  })
+}

+ 6 - 1
src/components/iosbasic-data/searchquery.vue

@@ -3,7 +3,7 @@
         <div style="display:flex">
             <!--<slot v-if="slot" name="slot"></slot>-->
             <div style="width: 100%;">
-                <el-select style="width: 100%" v-model="selectValue" size="small" :placeholder="placeholder"
+                <el-select style="width: 100%" v-model="selectValue" :size="size" :placeholder="placeholder"
                            :filterable="filterable" :clearable="clearable"
                            :remote="remote" :remote-method="remoteMethod"
                            :multiple="multiple" :collapse-tags="collapseTags"
@@ -147,6 +147,11 @@
                 type:Boolean,
                 default:false
             },
+            // 尺寸大小
+            size:{
+                type:String,
+                default:'small'
+            },
         },
         watch:{
             // // 监听

+ 5 - 1
src/enums/column-name.js

@@ -1458,7 +1458,11 @@ const columnName = [{
   },
   {
     code: 319,
-    name: '货运代理-账单管理-销项发票'
+    name: '货运代理-账单管理-销项发票-任务列表'
+  },
+  {
+    code: 319.1,
+    name: '货运代理-账单管理-销项发票-业务单据'
   },
   {
     code: 320,

File diff suppressed because it is too large
+ 868 - 573
src/views/iosBasicData/CollectionSettlement/finstlbillsDetails.vue


+ 162 - 8
src/views/iosBasicData/ComputationCenter/index.vue

@@ -1,13 +1,16 @@
 <template>
     <div>
-        <basic-container>
+        <basic-container v-if="isShow">
             <div style="margin-top: 10px">
-                <el-tabs type="card" v-model="query.billStatus" @tab-click="handleClick">
-                    <el-tab-pane label="任务列表" name="0">
-                        <span slot="label">任务列表</span>
+                <el-tabs type="card" v-model="tabsValue" @tab-click="handleClick">
+                    <el-tab-pane label="待付" name="C">
+                        <span slot="label">待付</span>
                     </el-tab-pane>
-                    <el-tab-pane label="业务单据" name="1">
-                        <span slot="label" style="color: #d86363">业务单据</span>
+                    <el-tab-pane label="待收" name="D">
+                        <span slot="label">待收</span>
+                    </el-tab-pane>
+                    <el-tab-pane label="业务单据" name="业务单据">
+                        <span slot="label" style="color: #4c9e44">单据列表</span>
                     </el-tab-pane>
                     <el-tab-pane label="已完成" name="已完成"></el-tab-pane>
                 </el-tabs>
@@ -34,15 +37,34 @@
                        @on-load="onLoad"
                        @resetColumn="resetColumnTwo('crud', 'option', 'optionBack', 324)"
                        @saveColumn="saveColumnTwo('crud', 'option', 'optionBack', 324)" >
+                <template slot="menuLeft" slot-scope="{row}">
+
+                </template>
+                <template slot="menu" slot-scope="{row}">
+                    <el-button v-if="tabsValue == 'C' || tabsValue == 'D'" type="text" size="small" @click="settlementfun(row)" >结算</el-button>
+                    <el-button type="text" size="small" @click="editfun(row)" >编辑</el-button>
+                    <el-button v-if="tabsValue == '业务单据'" type="text" size="small" >删除</el-button>
+                </template>
             </avue-crud>
         </basic-container>
+
+        <settlementDetails ref="settlementDetailsRef" v-if="!isShow" :editSave="editSave" @goBack="goBack"></settlementDetails>
     </div>
 </template>
 
 <script>
+import {fininvoicesList, generateFinStlBills} from "@/api/iosBasicData/fininvoices";
+    import {finstlbillsList} from "@/api/iosBasicData/finstlbills";
+import finstlbillsDetails from "@/views/iosBasicData/CollectionSettlement/finstlbillsDetails.vue";
+import settlementDetails from "@/views/iosBasicData/ComputationCenter/settlementDetails.vue";
+
     export default {
+        components: {settlementDetails},
         data() {
             return {
+                isShow:true,
+                editSave:false, // 详情是否禁用
+                tabsValue:'C', // tabs切换
                 // 动画
                 loading:false,
                 // 分页
@@ -67,7 +89,7 @@
                     selection: true,
                     dialogClickModal: false,
                     searchIcon: true,
-                    searchIndex: 3,
+                    searchIndex: 2,
                     stripe:true,
                     addBtn:false,
                     viewBtn:false,
@@ -83,10 +105,58 @@
                         },
                         {
                             label: "业务类型",
+                            prop: "businessTypes",
+                            search:true,
+                            overHidden:true,
+                        },
+                        {
+                            label: "单据编号",
+                            prop: "businessNo",
+                            search:true,
+                            overHidden:true,
+                        },
+                        {
+                            label: "往来单位",
+                            prop: "corpCnName",
+                            search:true,
+                            overHidden:true,
+                        },
+                        {
+                            label: "申请人",
+                            prop: "billNo",
+                            search:true,
+                            overHidden:true,
+                        },
+                        {
+                            label: "申请日期",
+                            prop: "billNo",
+                            search:true,
+                            overHidden:true,
+                        },
+                        {
+                            label: "审核日期",
+                            prop: "billNo",
+                            search:true,
+                            overHidden:true,
+                        },
+                        {
+                            label: "CNY",
+                            prop: "billNo",
+                            search:true,
+                            overHidden:true,
+                        },
+                        {
+                            label: "USD",
                             prop: "billNo",
                             search:true,
                             overHidden:true,
-                        }
+                        },
+                        {
+                            label: "备注",
+                            prop: "billNo",
+                            search:true,
+                            overHidden:true,
+                        },
                     ]
                 },
             }
@@ -95,9 +165,43 @@
             this.option = await this.getColumnData(this.getColumnName(324), this.optionBack);
         },
         methods:{
+            // 结算
+            settlementfun(row){
+                this.isShow = false
+                // this.editSave = true
+                this.$nextTick(()=>{
+                    this.$refs.settlementDetailsRef.generateFinStlBillsfun(row.id,this.tabsValue)
+                })
+            },
+            // 编辑
+            editfun(row){
+                this.isShow = false
+                this.editSave = true
+                this.$nextTick(()=>{
+                    this.$refs.settlementDetailsRef.finstlbillsDetailfun(row.id)
+                })
+            },
+            // 详情的返回列表
+            goBack() {
+                // 初始化数据
+                // this.detailData = this.$options.data().detailData;
+                if (JSON.stringify(this.$route.query) != "{}") {
+                    this.$router.$avueRouter.closeTag();
+                    this.$router.push({
+                        path: "/iosBasicData/ComputationCenter/index"
+                    });
+                }
+                this.isShow = true;
+                this.onLoad(this.page, this.search);
+            },
+            // tabs 切换
+            handleClick(){
+                this.onLoad(this.page)
+            },
              // 刷新回调
             refreshChange(){
                 console.log('刷新回调')
+                this.onLoad(this.page)
             },
             // 分页回调
             currentChange(currentPage){
@@ -140,6 +244,56 @@
             // 列表获取数据
             onLoad(page, params = {}) {
                 this.loading = true;
+                if (this.tabsValue == 'C') {
+                    // 调用 付费申请数据
+                    finstlbillsList(page.currentPage, page.pageSize,{
+                        ...Object.assign(params, this.query),
+                        businessType:'FFSQ',
+                        status:3,
+                        billStatus:0,
+                    }).then(res=>{
+                        console.log(res,212)
+                        const data = res.data.data;
+                        this.page.total = data.total;
+                        this.data = data.records;
+                    })
+                }else if (this.tabsValue == 'D') {
+                    // 调用 销项发票业务数据
+                    fininvoicesList(page.currentPage, page.pageSize,{
+                        ...Object.assign(params, this.query),
+                        type:'销项',
+                        status:3,
+                    }).then(res=>{
+                        console.log(res,219)
+                        const data = res.data.data;
+                        this.page.total = data.total;
+                        this.data = data.records;
+                    })
+                }else if (this.tabsValue == '业务单据') {
+                    // 应收应付 业务数据
+                    finstlbillsList(page.currentPage, page.pageSize, {
+                        ...Object.assign(params, this.query),
+                        businessType:'STL',
+                        status:0,
+                    },).then(res=>{
+                        console.log(res,234)
+                        const data = res.data.data;
+                        this.page.total = data.total;
+                        this.data = data.records;
+                    })
+                }else {
+                    // 应收应付 业务数据 已完成
+                    finstlbillsList(page.currentPage, page.pageSize, {
+                        ...Object.assign(params, this.query),
+                        businessType:'STL',
+                        status:3,
+                    },).then(res=>{
+                        console.log(res,283)
+                        const data = res.data.data;
+                        this.page.total = data.total;
+                        this.data = data.records;
+                    })
+                }
                 this.loading = false;
             },
             //自定义列保存

+ 1072 - 0
src/views/iosBasicData/ComputationCenter/settlementDetails.vue

@@ -0,0 +1,1072 @@
+<template>
+    <div class="borderless" v-loading="pageLoading">
+        <div class="customer-head">
+            <div class="customer-back">
+                <el-button type="danger" style="border: none;background: none;color: red" icon="el-icon-arrow-left"
+                           @click="backToList">返回列表
+                </el-button>
+            </div>
+            <div class="add-customer-btn">
+                <el-button size="small" style="margin-right: 8px"
+                           :loading="saveLoading" :disabled="!form.id" @click="previewreportfun" >预 览
+                </el-button>
+                <el-button size="small" style="margin-right: 8px"
+                           :loading="saveLoading" :disabled="!form.id" @click="DesignreportDialog = true" >报表设计
+                </el-button>
+                <el-button  size="small" type="warning" plain  style="margin-right: 8px" :disabled="!form.id" v-if="form.isCleared == 1"
+                            :loading="saveLoading" @click="finstlbillsRevokeSettlementfun">撤销结算
+                </el-button>
+                <el-button  size="small" type="success" plain  style="margin-right: 8px" :disabled="!form.id" v-else
+                            :loading="saveLoading" @click="finstlbillsConfirmSettlementfun">确认结算
+                </el-button>
+                <el-button  size="small" type="primary" style="margin-right: 8px" :disabled="form.isCleared == 1" v-if="editSave"
+                            :loading="saveLoading" @click="editHandle">编 辑
+                </el-button>
+                <el-button  size="small" type="primary" style="margin-right: 8px" :disabled="form.isCleared == 1" v-else
+                            :loading="saveLoading" @click="editCustomer">保 存
+                </el-button>
+            </div>
+        </div>
+
+        <div style="margin: 55px 5px 0px 5px;'">
+            <el-card class="box-card">
+                <el-form :model="form" ref="form" label-width="90px" :rules="rules" class="demo-ruleForm">
+                    <el-row>
+                        <el-row>
+                            <el-col :span="5">
+                                <el-form-item label="付费对象" prop="corpCnName">
+                                    <search-query :datalist="corpData"
+                                                  :selectValue="form.corpCnName"
+                                                  :clearable="true"
+                                                  :disabled="editSave || tableData.length != 0"
+                                                  :filterable="true"
+                                                  :remote="true"
+                                                  :buttonIf="false"
+                                                  :forParameter="{ key:'id', label:'cnName', value:'cnName'}"
+                                                  @corpChange="corpChange($event,'corpCnName')"
+                                                  @remoteMethod="corpBcorpsListfun"
+                                                  @corpFocus="corpBcorpsListfun" >
+                                    </search-query>
+                                </el-form-item>
+                            </el-col>
+                            <el-col :span="10">
+                                <el-form-item label="开户帐号" prop="bankId">
+                                    <search-query :datalist="bankData"
+                                                  :selectValue="form.bankId"
+                                                  :clearable="true"
+                                                  :disabled="editSave || !form.corpId"
+                                                  :filterable="true"
+                                                  :buttonIf="false"
+                                                  :forParameter="{ key:'id', label:'accountBankNo', value:'id'}"
+                                                  @corpChange="corpChange($event,'bankId')"
+                                                  @corpFocus="bcorpsbankListfun" >
+                                    </search-query>
+                                </el-form-item>
+                            </el-col>
+                            <el-col :span="9">
+                                <el-form-item label="付费事由" prop="remarks">
+                                    <el-input style="width: 100%;" v-model="form.remarks"
+                                              size="small" autocomplete="off"
+                                              :disabled="editSave"
+                                              clearable placeholder="请输入付费事由" >
+                                    </el-input>
+                                </el-form-item>
+                            </el-col>
+                            <el-col :span="5">
+                                <el-form-item label="预计收回" prop="estimatedTime">
+                                    <el-date-picker
+                                        v-model="form.estimatedTime"
+                                        type="date"
+                                        style="width: 100%;"
+                                        size="small"
+                                        :disabled="editSave"
+                                        value-format="yyyy-MM-dd"
+                                        placeholder="选择预计收回">
+                                    </el-date-picker>
+                                </el-form-item>
+                            </el-col>
+                            <el-col :span="5">
+                                <el-form-item label="收款情况" prop="collectionSituation">
+                                    <el-input style="width: 100%;" v-model="form.collectionSituation"
+                                              size="small" autocomplete="off"
+                                              :disabled="editSave"
+                                              clearable placeholder="请输入CHK NO" >
+                                    </el-input>
+                                </el-form-item>
+                            </el-col>
+                            <el-col :span="5">
+                                <el-form-item label="业务日期" prop="etd">
+                                    <el-date-picker
+                                        v-model="form.accountDate"
+                                        type="datetimerange"
+                                        range-separator="至"
+                                        start-placeholder="开始日期"
+                                        end-placeholder="结束日期"
+                                        style="width: 100%;"
+                                        size="small"
+                                        :disabled="editSave"
+                                        format="yyyy-MM-dd"
+                                        value-format="yyyy-MM-dd"
+                                        placeholder="选择业务日期">
+                                    </el-date-picker>
+                                </el-form-item>
+                            </el-col>
+                            <el-col :span="5">
+                                <el-form-item label="收/付" prop="queryAmount">
+                                    <search-query :datalist="dcData"
+                                                  :selectValue="form.dc"
+                                                  :filterable="true"
+                                                  :clearable="true"
+                                                  :remote="true"
+                                                  :buttonIf="false"
+                                                  :disabled="editSave"
+                                                  placeholder="请选择方向"
+                                                  @corpChange="corpChange($event,'dc')">
+                                    </search-query>
+                                </el-form-item>
+                            </el-col>
+                            <el-col :span="4">
+                                <el-form-item label="币别" prop="curCode">
+                                    <search-query :datalist="curCodeData"
+                                                  :selectValue="form.curCode"
+                                                  :clearable="true"
+                                                  :disabled="editSave"
+                                                  :buttonIf="false"
+                                                  :filterable="true"
+                                                  :remote="true"
+                                                  :forParameter="{ key:'id', label:'code', value:'code'}"
+                                                  @corpChange="corpChange($event,'curCode')"
+                                                  @remoteMethod="getRateListfun"
+                                                  @corpFocus="getRateListfun" >
+                                    </search-query>
+                                </el-form-item>
+                            </el-col>
+                            <el-col :span="5">
+                                <el-form-item label="JOB NO" prop="businessNo">
+                                    <el-input style="width: 100%;" v-model="form.businessNo"
+                                              size="small" autocomplete="off"
+                                              :disabled="editSave"
+                                              clearable placeholder="请输入JOB NO" >
+                                    </el-input>
+                                </el-form-item>
+                            </el-col>
+                            <el-col :span="5">
+                                <el-form-item label="ACCT NO" prop="accountNo">
+                                    <el-input style="width: 100%;" v-model="form.accountNo"
+                                              size="small" autocomplete="off"
+                                              :disabled="editSave"
+                                              clearable placeholder="请输入ACCT NO" >
+                                    </el-input>
+                                </el-form-item>
+                            </el-col>
+                            <el-col :span="5">
+                                <el-form-item label="MBL NO" prop="mblno">
+                                    <el-input style="width: 100%;" v-model="form.mblno"
+                                              size="small" autocomplete="off"
+                                              :disabled="editSave"
+                                              clearable placeholder="请输入MBL NO" >
+                                    </el-input>
+                                </el-form-item>
+                            </el-col>
+                            <el-col :span="5">
+                                <el-form-item label="HBL NO" prop="hblno">
+                                    <el-input style="width: 100%;" v-model="form.hblno"
+                                              size="small" autocomplete="off"
+                                              :disabled="editSave"
+                                              clearable placeholder="请输入HBL NO" >
+                                    </el-input>
+                                </el-form-item>
+                            </el-col>
+                            <el-col :span="4">
+                                <el-form-item label="对账单号" prop="checkNo">
+                                    <el-input style="width: 100%;" v-model="form.checkNo"
+                                              size="small" autocomplete="off"
+                                              :disabled="editSave"
+                                              clearable placeholder="请输入CHK NO" >
+                                    </el-input>
+                                </el-form-item>
+                            </el-col>
+                        </el-row>
+
+                        <expand :showBtn="true" :showSpan="true">
+                            <el-row>
+                                <el-col :span="5">
+                                    <el-form-item label="业务类型" prop="businessTypes" >
+                                        <search-query :datalist="businessTypesData"
+                                                      :selectValue="form.businessTypes"
+                                                      :clearable="true"
+                                                      :disabled="editSave"
+                                                      :buttonIf="false"
+                                                      :multiple="true"
+                                                      @corpChange="corpChange($event,'businessTypes')">
+                                        </search-query>
+                                    </el-form-item>
+                                </el-col>
+                                <el-col :span="5">
+                                    <el-form-item label="船 名" prop="vesselCnName" >
+                                        <el-input style="width: 100%;" v-model="form.vesselCnName"
+                                                  size="small" autocomplete="off"
+                                                  :disabled="editSave"
+                                                  clearable placeholder="请选择船名" ></el-input>
+                                    </el-form-item>
+                                </el-col>
+                                <el-col :span="5">
+                                    <el-form-item label="航 次" prop="voyageNo" >
+                                        <el-input style="width: 100%;" v-model="form.voyageNo"
+                                                  size="small" autocomplete="off"
+                                                  :disabled="editSave"
+                                                  clearable placeholder="请选择航次" ></el-input>
+                                    </el-form-item>
+                                </el-col>
+                            </el-row>
+                        </expand>
+
+                        <el-row>
+                            <el-col span="24">
+                                <div style="text-align: right">
+                                    <el-button  size="small" type="" style="margin-right: 8px" :disabled="settlementdistar"
+                                                :loading="saveLoading" @click="ResetFilter">重置条件
+                                    </el-button>
+                                    <el-checkbox v-model="appendType" :disabled="settlementdistar" false-label="检索" true-label="追加">追加</el-checkbox>
+                                    <el-button  size="small" type="primary"  style="margin-right: 8px" :disabled="settlementdistar"
+                                                :loading="saveLoading" @click="finstlbillslistAccBillV1fun(appendType)" >检 索
+                                    </el-button>
+                                </div>
+                            </el-col>
+                        </el-row>
+                    </el-row>
+                </el-form>
+            </el-card>
+
+
+            <el-card style="margin-top: 10px">
+                <div style="margin-bottom: 10px">
+                    <el-button  size="small" type="info" style="margin-right: 8px" :disabled="editSave"
+                                :loading="saveLoading" @click="SelectedRows">确认选定行
+                    </el-button>
+                    <el-button  size="small" type="danger" style="margin-right: 8px" :disabled="editSave"
+                                :loading="saveLoading" @click="batchDeletefun" >批量删除
+                    </el-button>
+                </div>
+                <finstlbillsitems :tableData="tableData"
+                                  :editSave="editSave"
+                                  :settlementdistar="settlementdistar"
+                                  :handleSelectionData="handleSelectionData"
+                                  @handleSelectionChange="handleSelectionChange"
+                                  @deletefun="finstlbillsitemsRemovefun">
+                </finstlbillsitems>
+            </el-card>
+        </div>
+        <el-card style="margin-top: 10px">
+            <el-row>
+                <el-col :span="3">
+                    <div class="bottomFlex" style="color: #6BBCD1">
+                        <span>应付:</span>
+                        <span class="weightnum">¥{{form.amountCr || 0}}</span>
+                    </div>
+                </el-col>
+                <el-col :span="3">
+                    <div class="bottomFlex" style="color: #6BBCD1">
+                        <span>应付:</span>
+                        <span class="weightnum">${{form.amountCrUsd || 0}}</span>
+                    </div>
+                </el-col>
+                <el-col :span="3">
+                    <div class="bottomFlex" style="color: #6BBCD1">
+                        <span>应付合计:</span>
+                        <span class="weightnum">¥{{form.amountCrLoc || 0}}</span>
+                    </div>
+                </el-col>
+                <el-col :span="3">
+                    <div class="bottomFlex" style="color: #81B337">
+                        <span>应收:</span>
+                        <span class="weightnum">¥{{form.amountDr || 0}}</span>
+                    </div>
+                </el-col>
+                <el-col :span="3">
+                    <div class="bottomFlex" style="color: #81B337">
+                        <span>应收:</span>
+                        <span class="weightnum">${{form.amountDrUsd || 0}}</span>
+                    </div>
+                </el-col>
+                <el-col :span="3">
+                    <div class="bottomFlex" style="color: #81B337">
+                        <span>应收合计:</span>
+                        <span class="weightnum">¥{{form.amountDrLoc || 0}}</span>
+                    </div>
+                </el-col>
+            </el-row>
+        </el-card>
+
+
+        <!--设计报表弹窗-->
+        <el-dialog append-to-body title="设计报表" class="el-dialogDeep" :visible.sync="DesignreportDialog" width="70%"
+                   :close-on-click-modal="false" :destroy-on-close="true" :close-on-press-escape="false" v-dialog-drag>
+            <reports :id="form.id" :disabled="editSave" businessValue="FFSQ"></reports>
+        </el-dialog>
+
+        <!--预览-->
+        <el-dialog
+            title="打印"
+            :visible.sync="selectPrintingDialog"
+            append-to-body
+            width="70%"
+            :close-on-click-modal="false"
+            :destroy-on-close="true"
+            :close-on-press-escape="false"
+            v-dialog-drag>
+            <div>
+                <reportformsList ref="reportformsList" @reportRadio="reportRadio"></reportformsList>
+            </div>
+            <span slot="footer" class="dialog-footer">
+                <el-button size="small" @click="selectPrintingDialog = false;">取 消</el-button>
+            </span>
+        </el-dialog>
+
+
+        <!--报表组件-->
+        <reportContainer ref="reportContainer"></reportContainer>
+    </div>
+</template>
+
+<script>
+import SearchQuery from "@/components/iosbasic-data/searchquery.vue";
+import {getRateList} from "@/api/iosBasicData/rateManagement";
+import {bcorpsbankList, getBcorpslistByType} from "@/api/iosBasicData/bcorps";
+import {
+    finstlbillsDetail, finstlbillsitemsRemove,
+    finstlbillslistAccBillV1,
+    finstlbillsSubmit, finstlbillsConfirmSettlement,finstlbillsRevokeSettlement
+
+} from '@/api/iosBasicData/finstlbills'
+import expand from "@/components/basic-container/expand.vue";
+import finstlbillsitems from "@/views/iosBasicData/PaymentApplication/assembly/finstlbillsitems.vue";
+import reports from "@/views/iosBasicData/SeafreightExportF/bills/assembly/reports.vue";
+import reportformsList from "@/views/iosBasicData/SeafreightExportF/bills/assembly/reportformsList.vue";
+import {reportsGetReportData} from "@/api/iosBasicData/reports";
+import reportContainer from "@/views/iosBasicData/report-container/report-container.vue";
+import { generateFinStlBills} from "@/api/iosBasicData/fininvoices";
+
+export default {
+    components: {reportContainer, reportformsList, reports, SearchQuery,expand,finstlbillsitems},
+    props:{
+        // 编辑还是保存
+        editSave:{
+            type:Boolean,
+            default:true
+        },
+    },
+    data(){
+        return {
+            settlementdistar:false, // 结算挑进来的
+            DesignreportDialog:false, // 设计报表弹窗
+            selectPrintingDialog:false, // 预览报表
+            // 收/付数据
+            dcData: [{
+                label: '全部',
+                value: null
+            },{
+                label: '收',
+                value: 'D'
+            }, {
+                label: '付',
+                value: 'C'
+            }],
+            appendType:'检索', // 是否追加
+            tableData:[],
+            pageLoading:false, // 全屏加载动画
+            saveLoading:false, // 按钮动画
+            // 绑定的数据
+            form:{
+                dc:'C'
+            },
+            handleSelectionData:[], // 表格选择的数据
+            corpData:[], // 结算单位 数据
+            bankData:[], // 查询银行数据
+            curCodeData:[],// 币别
+            srcforParameter:{},
+            // 业务类型
+            businessTypesData:[
+                {
+                    label:'海运出口',
+                    value:'SE'
+                },{
+                    label:'海运进口',
+                    value:'SI'
+                }
+            ],
+            rules: {
+                corpCnName: [
+                    {required: true, message: '请输入付费对象', trigger: 'blur'},
+                ],
+                bankId: [
+                    {required: true, message: '请输入开户银行', trigger: 'blur'},
+                ],
+                remarks: [
+                    {required: true, message: '请输入付费事由', trigger: 'blur'},
+                ],
+                estimatedTime: [
+                    {required: true, message: '请输入预计收回', trigger: 'blur'},
+                ],
+                collectionSituation: [
+                    {required: true, message: '请输入收款情况', trigger: 'blur'},
+                ],
+            },
+        }
+    },
+    created() {
+    },
+    methods:{
+        // 打印
+        reportRadio(val){
+            console.log(val,505)
+            // 获取报表数据
+            reportsGetReportData({
+                billId:this.form.id,
+                reportCode:val.classifyCode,
+                groupCode:val.groupCode,
+            }).then(res=>{
+                this.handleReportPreview(val.url,res.data.data.data)
+            })
+        },
+        // 报表预览
+        previewreportfun(){
+            this.saveLoading = true
+            this.selectPrintingDialog = true
+            this.saveLoading = false
+            let page = {
+                pageSize: 10,
+                currentPage: 1,
+                total: 0
+            }
+            this.$nextTick(()=>{
+                this.$refs.reportformsList.onLoad(page,{
+                    businessType:'FFSQ',
+                    classifyCode:'付费申请',
+                    groupCode:'付费申请'
+                })
+            })
+        },
+        // 批量删除
+        batchDeletefun(){
+            if (this.handleSelectionData.length == 0) {
+                return this.$message.warning('请选择要删除的数据')
+            }
+            this.$confirm("确定将选择数据删除?", {
+                confirmButtonText: "确定",
+                cancelButtonText: "取消",
+                type: "warning"
+            }).then(()=>{
+                // 获取有id 的数据
+                const itemsWithId = this.handleSelectionData.filter(item => item.hasOwnProperty('id'));
+                let arrIds = itemsWithId.map(item=>item.id) // 获取id 数据
+                // 把选中的删除掉
+                this.handleSelectionData.forEach((item)=>{
+                    for (let index in this.tableData) {
+                        if (item.accBillNo == this.tableData[index].accBillNo) {
+                            this.tableData.splice(index,1)
+                        }
+                    }
+                })
+                // 有id 的处理
+                if(itemsWithId.length != 0) {
+                    finstlbillsitemsRemove(arrIds.join(',')).then(res=>{
+                        this.$message.success('操作成功')
+                    })
+                }
+            })
+        },
+        // 删除
+        finstlbillsitemsRemovefun(id,index){
+            this.$confirm("确定将选择数据删除?", {
+                confirmButtonText: "确定",
+                cancelButtonText: "取消",
+                type: "warning"
+            }).then(()=>{
+                if (id) {
+                    finstlbillsitemsRemove(id).then(res=>{
+                        this.$message.success('操作成功')
+                    })
+                }
+                this.tableData.splice(index,1)
+            })
+        },
+        // 下拉回调
+        corpChange(value,name){
+            // 结算单位
+            if (name == 'corpCnName') {
+                if (!value) {
+                    this.$set(this.form,'corpId','')
+                    this.$set(this.form,'corpCnName','')
+                    this.$set(this.form,'corpEnName','')
+                    this.$set(this.form,'corpArgreementNo','')
+                }
+                for(let item of this.corpData) {
+                    if (item.cnName == value) {
+                        this.$set(this.form,'corpId',item.id)
+                        this.$set(this.form,'corpCnName',item.cnName)
+                        this.$set(this.form,'corpEnName',item.enName)
+                        this.$set(this.form,'corpArgreementNo',item.enName)
+                    }
+                }
+            }
+            else if (name == 'bankId') {
+                if (!value) {
+                    this.$set(this.form,'bankId','')
+                    this.$set(this.form,'bankAccountName','')
+                    this.$set(this.form,'bankAccountBank','')
+                    this.$set(this.form,'bankAccountNo','')
+                }
+                for(let item of this.bankData) {
+                    if (item.id == value) {
+                        this.$set(this.form,'bankId',item.id)
+                        this.$set(this.form,'bankAccountName',item.accountName)
+                        this.$set(this.form,'bankAccountBank',item.accountBank)
+                        this.$set(this.form,'bankAccountNo',item.accountNo)
+                    }
+                }
+            }
+            else {
+                this.$set(this.form,name,value)
+            }
+        },
+        // 编辑
+        editHandle(){
+            this.editSave = false
+        },
+        // 保存
+        editCustomer(){
+            this.$refs.form.validate((valid) => {
+                if (!valid) return
+                if (!this.form.id) {
+                    // 是否选择从表数据
+                    if (this.handleSelectionData.length == 0) {
+                        this.$message.warning('请选择结算数据');
+                        return;
+                    }
+                }
+                for (let item of this.handleSelectionData) {
+                    if (!item.currentStlCurCode) {
+                        this.$message.warning('请选择本次结算币种');
+                        return;
+                    }
+                }
+                this.saveLoading = true // 打开按钮动画
+                if(this.form.estimatedTime) {
+                    this.form.estimatedTime = this.form.estimatedTime + ' 00:00:00'
+                }
+                this.saveLoading = true // 加载动画
+                this.form.billNoFormat = 'STL'
+                this.form.businessTypeCode = 'STL'
+                this.form.businessType = 'STL' // 结算单
+                this.form.businessTypes = this.form.businessTypes?this.form.businessTypes.join(','):'' // 业务类型
+                this.form.finStlBillsItemsList = this.handleSelectionData.map((item,index)=>{
+                    if (item.currentStlCurCode == 'CNY') {
+                        item.currentStlAmount = item.currentStlAmountRMB
+                    }else {
+                        item.currentStlAmount = item.currentStlAmountUSD
+                    }
+                    if (!this.form.id) {
+                        delete item.businessType
+                        delete item.billDate
+                        delete item.accountDc
+                    }
+                    return item
+                })
+                finstlbillsSubmit(this.form).then(res=>{
+                    this.saveLoading = false
+                    this.$message.success('操作成功');
+                    this.saveLoading = false // 关闭按钮动画
+                    this.finstlbillsDetailfun(res.data.data.id)
+                })
+            })
+        },
+        // 详情接口
+        finstlbillsDetailfun(id){
+            this.pageLoading = true
+            finstlbillsDetail(id).then(res=>{
+                this.form = res.data.data
+                this.form.businessTypes = this.form.businessTypes.split(',') // 业务类型转换成数组显示
+                this.tableData = this.form.finStlBillsItemsList.map(item=>{
+                    item.stlTtlAmountNet = Number(item.stlTtlAmount) - (Number(item.stlTtlAmount) * (Number(item.taxRate) + Number(item.surchargeRate)))
+                    item.currentStlAmountNet = Number(item.unsettledAmount) - (Number(item.unsettledAmount) * (Number(item.taxRate) + Number(item.surchargeRate)))
+                    if(item.curCode == 'CNY') {
+                        this.$set(item,'currentInvoiceAmountRMB',item.currentInvoiceAmount)
+                        this.$set(item,'amountRMB',item.amount)
+                        this.$set(item,'amountNetRMB',item.amountNet)
+                        this.$set(item,'stlTtlAmountRMB',item.stlTtlAmount)
+                        this.$set(item,'stlTtlAmountNetRMB',item.stlTtlAmountNet)
+
+                        this.$set(item,'currentStlAmountNetRMB',item.currentStlAmountNet)
+                        this.$set(item,'currentStlAmountRMB',item.currentStlAmount)
+                    }else {
+                        this.$set(item,'currentInvoiceAmountUSD',item.currentInvoiceAmount)
+                        this.$set(item,'amountUSD',item.amount)
+                        this.$set(item,'amountNetUSD',item.amountNet)
+                        this.$set(item,'stlTtlAmountNetUSD',item.stlTtlAmountNet)
+                        this.$set(item,'stlTtlAmountUSD',item.stlTtlAmount)
+
+                        this.$set(item,'currentStlAmountNetUSD',item.currentStlAmountNet)
+                        this.$set(item,'currentStlAmountUSD',item.currentStlAmount)
+                    }
+
+                    if (item.srcIdInvoices) {
+                        this.settlementdistar = true
+                    }
+
+                    return item
+                })
+                this.pageLoading = false
+                this.bcorpsbankListfun() // 查银行数据
+            }).catch(err=>{
+                this.pageLoading = false
+            })
+        },
+        // 结算按钮
+        generateFinStlBillsfun(id,dc){
+            this.pageLoading = true
+            generateFinStlBills({
+                billId:id,
+                dc:dc
+            }).then(res=>{
+                this.form = res.data.data
+                this.form.businessTypes = this.form.businessTypes.split(',') // 业务类型转换成数组显示
+                this.tableData = this.form.finStlBillsItemsList.map(item=>{
+                    item.stlTtlAmountNet = Number(item.stlTtlAmount) - (Number(item.stlTtlAmount) * (Number(item.taxRate) + Number(item.surchargeRate)))
+                    item.currentStlAmountNet = Number(item.unsettledAmount) - (Number(item.unsettledAmount) * (Number(item.taxRate) + Number(item.surchargeRate)))
+                    if(item.curCode == 'CNY') {
+                        this.$set(item,'currentInvoiceAmountRMB',item.currentInvoiceAmount)
+                        this.$set(item,'amountRMB',item.amount)
+                        this.$set(item,'amountNetRMB',item.amountNet)
+                        this.$set(item,'stlTtlAmountRMB',item.stlTtlAmount)
+                        this.$set(item,'stlTtlAmountNetRMB',item.stlTtlAmountNet)
+
+                        this.$set(item,'currentStlAmountNetRMB',item.currentStlAmountNet)
+                        this.$set(item,'currentStlAmountRMB',item.currentStlAmount)
+                    }else {
+                        this.$set(item,'currentInvoiceAmountUSD',item.currentInvoiceAmount)
+                        this.$set(item,'amountUSD',item.amount)
+                        this.$set(item,'amountNetUSD',item.amountNet)
+                        this.$set(item,'stlTtlAmountNetUSD',item.stlTtlAmountNet)
+                        this.$set(item,'stlTtlAmountUSD',item.stlTtlAmount)
+
+                        this.$set(item,'currentStlAmountNetUSD',item.currentStlAmountNet)
+                        this.$set(item,'currentStlAmountUSD',item.currentStlAmount)
+                    }
+                    if (item.srcIdInvoices) {
+                        this.settlementdistar = true
+                    }
+                    return item
+                })
+                this.pageLoading = false
+                this.bcorpsbankListfun() // 查银行数据
+            }).catch(err=>{
+                this.pageLoading = false
+            })
+        },
+        // 重置条件
+        ResetFilter(){
+            this.form = {}
+        },
+        // 检索接口
+        finstlbillslistAccBillV1fun(type){
+            // 对账单位
+            if (!this.form.corpId) {
+                this.$message.warning('请选择对账单位');
+                return
+            }
+            let obj = {}
+            obj.type = '2'
+            obj.corpCnName = this.form.corpId // 结算单位
+            obj.curCode = this.form.curCode // 币别
+            obj.dc = this.form.dc // 收付 D=收 C=付
+            obj.accBillNo = this.form.accountNo // 账单编号  ACCT NO
+            obj.billNo = this.form.businessNo // 单据编号  JOB NO
+            obj.checkBillNo = this.form.checkNo // CHK NO
+            obj.mblno = this.form.mblno // MB/L NO
+            obj.hblno = this.form.hblno // HB/L NO
+            obj.queryAmount = this.form.queryAmount // 查询金额
+            obj.businessType = this.form.businessTypes?this.form.businessTypes.join(','):'' // 业务类型
+            obj.vesselCnName = this.form.vesselCnName // 中文船名
+            obj.receivableAdvance = this.form.receivableAdvance // 预收帐款
+            obj.voyageNo = this.form.voyageNo // 航次
+            obj.signforDateList = this.form.signforDateList // 签收日期
+            obj.auditStatus = '0'
+            // 财务期间
+            if (this.form.accountDate) {
+                obj.billDateList = this.form.accountDate
+            }
+            finstlbillslistAccBillV1(obj).then(res=>{
+                let arr = res.data.data.map((item,index)=>{
+                    item.accBillId = item.id
+                    delete item.id
+                    // 账单编号
+                    item.accBillNo = item.billNo
+                    item.currentStlCurCode = item.curCode // 币别
+                    item.lineNo = Number(index) + 1
+                    item.pType = item.businessType
+                    item.billNo = item.businessBillDivideNo?item.businessBillDivideNo:item.businessBillNo
+                    item.accDate = item.billDate
+                    item.dc = item.accountDc // 收付
+                    if(item.curCode == 'CNY') {
+                        // 发票
+                        this.$set(item,'currentInvoiceAmountRMB',item.currentInvoiceAmount)
+                        // 应结算金额
+                        this.$set(item,'amountRMB',item.amount)
+                        // 已结算金额
+                        this.$set(item,'stlTtlAmountRMB',item.stlTtlAmount)
+                        // 本次金额
+                        this.$set(item,'currentStlAmountRMB',(Number(item.amount) - Number(item.stlTtlAmount) - Number(item.appliedAmount)).toFixed(2))
+                    }else {
+                        // 发票
+                        this.$set(item,'currentInvoiceAmountUSD',item.currentInvoiceAmount)
+                        // 应结算金额
+                        this.$set(item,'amountUSD',item.amount)
+                        // 已结算金额
+                        this.$set(item,'stlTtlAmountUSD',item.stlTtlAmount)
+                        // 本次金额
+                        this.$set(item,'currentStlAmountUSD',(Number(item.amount) - Number(item.stlTtlAmount) - Number(item.appliedAmount)).toFixed(2))
+                    }
+                    return item
+                })
+
+                if (type == '追加') {
+                    let a = [...this.tableData,...arr,]
+                    this.tableData = a.filter((obj, index) => {
+                        return a.findIndex((elem) => {
+                            return elem.accBillNo === obj.accBillNo
+                        }) === index;
+                    });
+                }else {
+                    // 获取有id 的数据
+                    const itemsWithId = this.tableData.filter(item => item.hasOwnProperty('id'));
+                    let arrIds = itemsWithId.map(item=>item.id) // 获取id 数据
+                    // 有id 的处理
+                    if(itemsWithId.length != 0) {
+                        finstlbillsitemsRemove(arrIds.join(',')).then(res=>{
+                            this.$message.success('操作成功')
+                        })
+                    }
+                    this.tableData = arr
+                }
+
+            })
+        },
+        // 结算确认
+        finstlbillsConfirmSettlementfun(){
+            this.$confirm("确定进行对账操作?", {
+                confirmButtonText: "确定",
+                cancelButtonText: "取消",
+                type: "warning"
+            }).then(()=>{
+                this.pageLoading = true
+                this.form.businessTypes = this.form.businessTypes.join(',') // 业务类型
+                finstlbillsConfirmSettlement(this.form).then(res=>{
+                    this.pageLoading = false
+                    this.$message.success('操作成功');
+                    this.finstlbillsDetailfun(res.data.data.id)
+                }).catch(err=>{
+                    this.pageLoading = false
+                })
+            })
+        },
+        // 结算撤销
+        finstlbillsRevokeSettlementfun(){
+            this.$confirm("确定进行撤销对账操作?", {
+                confirmButtonText: "确定",
+                cancelButtonText: "取消",
+                type: "warning"
+            }).then(()=>{
+                this.pageLoading = true
+                this.form.businessTypes = this.form.businessTypes.join(',') // 业务类型
+                finstlbillsRevokeSettlement(this.form).then(res=>{
+                    this.pageLoading = false
+                    this.$message.success('操作成功');
+                    this.finstlbillsDetailfun(res.data.data.id)
+                })
+            }).catch(err=>{
+                this.pageLoading = false
+            })
+        },
+        // 确认选定行
+        SelectedRows(){
+            this.editCustomer()
+        },
+        // 下面表格多选
+        handleSelectionChange(arr){
+            this.handleSelectionData = arr
+        },
+        //返回列表
+        backToList() {
+            this.$emit('goBack')
+        },
+        // 请求的接口
+        // 获取币别数据
+        getRateListfun(cnName){
+            getRateList({current:1,size:10,cnName}).then(res=>{
+                this.curCodeData = res.data.data.records
+            })
+        },
+        // 获取结算单位数据
+        corpBcorpsListfun(cnName){
+            getBcorpslistByType(1,10,{cnName}).then(res=>{
+                this.corpData = res.data.data.records
+            })
+        },
+        // 获取银行数据
+        bcorpsbankListfun(){
+            bcorpsbankList(1,50,{pid:this.form.corpId}).then(res=>{
+                this.bankData = res.data.data.records.map(item=>{
+                    item.accountBankNo = item.accountBank + ' - ' + item.accountNo
+                    return item
+                })
+            })
+        },
+        // 预览报表
+        handleReportPreview(url,data){
+            console.log(url,1670)
+            console.log(data,1671)
+            Stimulsoft.Base.StiLicense.key = '6vJhGtLLLz2GNviWmUTrhSqnOItdDwjBylQzQcAOiHn0s4gy0Fr5YoUZ9V00Y0igCSFQzwEqYBh/N77k4f0fWXTHW5rqeBNLkaurJDenJ9o97TyqHs9HfvINK18Uwzsc/bG01Rq+x3H3Rf+g7AY92gvWmp7VA2Uxa30Q97f61siWz2dE5kdBVcCnSFzC6awE74JzDcJMj8OuxplqB1CYcpoPcOjKy1PiATlC3UsBaLEXsok1xxtRMQ283r282tkh8XQitsxtTczAJBxijuJNfziYhci2jResWXK51ygOOEbVAxmpflujkJ8oEVHkOA/CjX6bGx05pNZ6oSIu9H8deF94MyqIwcdeirCe60GbIQByQtLimfxbIZnO35X3fs/94av0ODfELqrQEpLrpU6FNeHttvlMc5UVrT4K+8lPbqR8Hq0PFWmFrbVIYSi7tAVFMMe2D1C59NWyLu3AkrD3No7YhLVh7LV0Tttr/8FrcZ8xirBPcMZCIGrRIesrHxOsZH2V8t/t0GXCnLLAWX+TNvdNXkB8cF2y9ZXf1enI064yE5dwMs2fQ0yOUG/xornE'
+            // Stimulsoft.Base.StiLicense.Key = '6vJhGtLLLz2GNviWmUTrhSqnOItdDwjBylQzQcAOiHkcgIvwL0jnpsDqRpWg5FI5kt2G7A0tYIcUygBh1sPs7plofUOqPB1a4HBIXJB621mau2oiAIj+ysU7gKUXfjn/D5BocmduNB+ZMiDGPxFrAp3PoD0nYNkkWh8r7gBZ1v/JZSXGE3bQDrCQCNSy6mgby+iFAMV8/PuZ1z77U+Xz3fkpbm6MYQXYp3cQooLGLUti7k1TFWrnawT0iEEDJ2iRcU9wLqn2g9UiWesEZtKwI/UmEI2T7nv5NbgV+CHguu6QU4WWzFpIgW+3LUnKCT/vCDY+ymzgycw9A9+HFSzARiPzgOaAuQYrFDpzhXV+ZeX31AxWlnzjDWqpfluygSNPtGul5gyNt2CEoJD1Yom0VN9fvRonYsMsimkFFx2AwyVpPcs+JfVBtpPbTcZscnzUdmiIvxv8Gcin6sNSibM6in/uUKFt3bVgW/XeMYa7MLGF53kvBSwi78poUDigA2n12SmghLR0AHxyEDIgZGOTbNI33GWu7ZsPBeUdGu55R8w='
+            Stimulsoft.Base.Localization.StiLocalization.addLocalizationFile( '/reports/stimulsoft/Localization/zh-CHS.xml', true, 'zh-CHS')
+            Stimulsoft.Base.Localization.StiLocalization.setLocalizationFile('/reports/stimulsoft/Localization/zh-CHS.xml' )
+            // 工具栏
+            var options = new Stimulsoft.Viewer.StiViewerOptions()
+            options.height = '100%'
+            options.appearance.scrollbarsMode = true // 滚动条模式
+            options.toolbar.showDesignButton = false // 显示设计按钮
+            options.toolbar.showAboutButton = false // 显示关于按钮
+            options.toolbar.showResourcesButton = false // 显示资源按钮
+            options.toolbar.showFullScreenButton = false // 显示全屏按钮
+            options.toolbar.showOpenButton = false // 显示打开按钮
+            options.appearance.showTooltips = false // 显示工具提示
+            options.appearance.showDialogsHelp = false // 显示对话框帮助
+            options.exports.showExportToDocument = false // 显示导出到文档
+            options.toolbar.showParametersButton = true // 显示参数按钮
+            options.appearance.bookmarksPrint = true // 书签打印
+            // options.toolbar.showPrintButton = false // 打印按钮是否显示   下面直接自定义控制打印弹窗是否开启
+
+            // printDestination 参数:用于指定报表打印的目标位置,可以是打印机、PDF 文件或者直接打印到浏览器等。
+            // Stimulsoft.Viewer.StiPrintDestination.Direct:表示直接打印到打印机,即将报表内容直接发送至打印机进行打印。
+            // 通过设置不同的 printDestination 参数,你可以控制报表打印的行为,例如是直接打印到打印机,还是生成 PDF 文件,或者直接在浏览器中预览打印内容等。
+            options.toolbar.printDestination = Stimulsoft.Viewer.StiPrintDestination.Direct
+            // htmlRenderMode html渲染模式
+            options.appearance.htmlRenderMode = Stimulsoft.Report.Export.StiHtmlExportMode.Table
+            // 是创建一个 Stimulsoft 报表查看器的实例的代码
+            let viewer = new Stimulsoft.Viewer.StiViewer(options, 'StiViewer', false)
+
+            // 报表
+            console.log("创建一个报表实例");
+            console.log()
+            let report = new window.Stimulsoft.Report.StiReport();
+
+            // 加载文件
+            console.log("从url加载报表");
+            // report.loadFile("/reports/stimulsoft/demos/SimpleList.mrt");
+            report.load(url)
+
+            data.pageOne = 'Page : 1 of 1'
+            // 处理超长数据
+            if (data.hshipperDetails) {
+                var consignerIndex2 = data.hshipperDetails.indexOf( '\n' )
+                for (let i = 0; i < 4; i++) {
+                    consignerIndex2 = data.hshipperDetails.indexOf( '\n', consignerIndex2 + 1 );
+                }
+                if (consignerIndex2 != -1) {
+                    var hshipperDetails = data.hshipperDetails.substring(consignerIndex2 + 2, data.hshipperDetails.length)
+                    data.hshipperDetails = data.hshipperDetails.substring(0, consignerIndex2) + ' *'
+                    data.commodityDescr += '\n*' + hshipperDetails
+                }
+            }
+
+            if (data.hconsigneeDetails) {
+                var consigneeIndex2 = data.hconsigneeDetails.indexOf( '\n' )
+                for (let i = 0; i < 3; i++) {
+                    consigneeIndex2 = data.hconsigneeDetails.indexOf( '\n', consigneeIndex2 + 1 );
+                }
+                if (consigneeIndex2 != -1) {
+                    var hconsigneeDetails = data.hconsigneeDetails.substring(consigneeIndex2 + 2, data.hconsigneeDetails.length)
+                    data.hconsigneeDetails = data.hconsigneeDetails.substring(0, consigneeIndex2) + ' **'
+                    data.commodityDescr += '\n**' + hconsigneeDetails
+                }
+            }
+
+            if (data.hnotifyDetails) {
+                var notifierIndex2 = data.hnotifyDetails.indexOf( '\n' )
+                for (let i = 0; i < 3; i++) {
+                    notifierIndex2 = data.hnotifyDetails.indexOf( '\n', notifierIndex2 + 1 );
+                }
+                if (notifierIndex2 != -1) {
+                    var hnotifyDetails = data.hnotifyDetails.substring(notifierIndex2 + 2, data.hnotifyDetails.length)
+                    data.hnotifyDetails = data.hnotifyDetails.substring(0, notifierIndex2) + ' ***'
+                    data.commodityDescr += '\n***' + hnotifyDetails
+                }
+            }
+
+            // 处理箱号
+            if (this.isPrintTheBoxNumber) {
+                data.commodityDescr += '\n.\n.\n'
+            }
+
+            // PLACE & DATE OF ISSUE
+            data.placeAndDateOfIssue = ''
+            if (data.issueAt) {
+                data.placeAndDateOfIssue += data.issueAt
+            }
+            if (data.issueDate) {
+                let date = new Date(data.issueDate.replace(/-/g,'/'));
+                let yyyy = date.getFullYear();
+                let mmmm = date.toDateString().split(" ")[1]
+                let dd = date.getDate()
+                data.placeAndDateOfIssue += ', ' + dd + '-' + mmmm + '-' + yyyy
+            }
+
+            // Total number of containers or packages received by the Carriers
+            if (data.preContainersList) {
+                let boxMap = new Map();
+                for (let boxQuantity of data.preContainersList) {
+                    if (boxMap.get(boxQuantity.cntrTypeCode)) {
+                        let v = boxMap.get(boxQuantity.cntrTypeCode)
+                        boxMap.set(boxQuantity.cntrTypeCode, v + boxQuantity.quantity)
+                    } else {
+                        boxMap.set(boxQuantity.cntrTypeCode, boxQuantity.quantity)
+                    }
+                }
+                let boxs = ''
+                boxMap.forEach(function (value, key, map) {
+                    boxs += value + 'x' + key + ', '
+                })
+                boxs = boxs.substring(0, boxs.length - 2)
+
+                data.boxQuantity = boxs + ' CONTAINER(S) ONLY'
+            }
+
+            // Number of original B/Ls
+            if (data.numberOfObl) {
+                data.numberOfObl += ' (' + data.numberOfOblDigit + ')'
+            }
+
+            if (data.commodityDescr) {
+                var descriptionIndex2 = data.commodityDescr.indexOf( '\n' )
+                for (let i = 0; i < 19; i++) {
+                    descriptionIndex2 = data.commodityDescr.indexOf( '\n', descriptionIndex2 + 1 );
+                }
+                if (descriptionIndex2 != -1) {
+                    data.pageOne = 'Page : 1 of 2'
+                    data.pageTwo = 'Page : 2 of 2'
+                    var extraLongText = data.commodityDescr.substring(descriptionIndex2 + 2, data.commodityDescr.length)
+                    data.commodityDescr = data.commodityDescr.substring(0, descriptionIndex2)
+                    data.extraLongTips = '** TO BE CONTINUED ON ATTACHED LIST **'
+                    data.extraLongText = extraLongText
+                }
+            }
+
+            // console.log(data.hshipperDetails, 'hshipperDetails2')
+
+            // 创建一个 Stimulsoft 数据集(DataSet)的实例的代码
+            var dataSet = new Stimulsoft.System.Data.DataSet(
+                'reportData'
+            )
+
+            dataSet.readJson(data) // 用于将 JSON 格式的数据加载到数据集中。data 是包含报表数据的 JSON 对象。
+            // 这是一个方法调用,用于在报表中注册数据源。参数 'reportData' 是数据源的名称,
+            // 第二个 'reportData' 是数据源的别名,dataSet 则是之前创建的数据集实例
+            report.regData('reportData', 'reportData', dataSet)
+            // 从模版和数据加载报表
+            // loadReport(report, '', {})
+
+            // 这是将报表对象指定给报表查看器的属性。viewer 是报表查看器的实例,而 report 是之前创建的报表对象。
+            viewer.report = report;
+
+            this.$refs.reportContainer.showContainer(
+                ()=> {
+                    setTimeout(() => {
+                        viewer.renderHtml('reportContainer')
+                        this.createViewerButtons(viewer)
+                    }, 50)
+                },
+                ()=>{
+                },
+            )
+            console.log("加载成功完成!");
+        },
+        createViewerButtons (viewer){
+            viewer.jsObject.collections.images['myClose.png'] =
+                'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABmJLR0QA/wD/AP+gvaeTAAAA0ElEQVQ4ja3TO05CQRQG4A8iOwAbtYWETndAaecK7NwCKmETtJZsSBNLobEz8ZFIJQ0UnOGSm3DnYviTybzO/895DQXGWGCVGQuMEqkRcwcfuMOLalziCaf4TIe9UG9nyMJmFRzNGoRK1BU4xxx9G7cfwostciGk+x8MqgySwDXe4tU53hVV+MNtTmAoX84JGv9NYgrHyR6DV8wUSW7hItZLm36ZVoVQxsFJLOMsPOrH/h7dQwR2cdxOTEn8DtUbPGc4V2H7Vb4Yqfedf/GYSGt8VUmxgyfuBAAAAABJRU5ErkJggg=='
+            const closeBtn = viewer.jsObject.SmallButton(
+                'closeBtn',
+                '关闭',
+                'myClose.png'
+            )
+            // 增加打印弹窗配置
+            const printBtn = viewer.jsObject.SmallButton(
+                'printBtn',
+                '打印报表',
+                'myClose.png'
+            )
+            // console.log(viewer.jsObject.print(),'1013')
+            // 获取 关闭按钮的dom元素位置
+            const toolbarTable = viewer.jsObject.controls.toolbar.firstChild.firstChild
+            const buttonsTable = toolbarTable.rows[0].lastChild.lastChild
+            const userButtonCell = buttonsTable.rows[0].insertCell(0)
+            // 获取打印按钮的位置
+            const buttonsTablePrint = toolbarTable.rows[0].childNodes[0].lastChild // 打印按钮
+            const userButtonPrint = buttonsTablePrint.rows[0].childNodes[0] // 打印按钮dom位置
+
+
+            userButtonPrint.addEventListener("click", (event)=>{
+                console.log("打印点击");
+                // event.preventDefault()
+            });
+            userButtonPrint.addEventListener("mouseover", (event) => {
+                console.log("移入打印按钮");
+                console.log(event,1035)
+
+            });
+
+            userButtonCell.className = 'stiJsViewerClearAllStyles'
+            userButtonCell.appendChild(closeBtn) // 添加关闭节点
+
+            // userButtonPrint.prepend(printBtn) // 在 printBtn 节点里最前面增加一个子级节点
+
+
+            let that=this
+            // 关闭按钮的监听点击
+            closeBtn.action = function() {
+                console.log(that.$refs.ReportContainer,'1022')
+                if (that.$refs.reportContainer)
+                    that.$refs.reportContainer.hideContainer()
+            }
+
+            // // // 打印按钮监听
+            // printBtn.action = (e)=>{
+            //     console.log('打印')
+            //     window.print()
+            // }
+
+        },
+
+    }
+}
+</script>
+
+<style scoped>
+::v-deep.el-form-item {
+    margin-bottom: 0;
+}
+.bottomFlex {
+    display: flex;
+    align-items: center;
+}
+.weightfont {
+    font-size: 20px;
+    font-weight: bold;
+}
+.weightnum {
+    font-size: 18px;
+    font-weight: 500;
+}
+/deep/.el-dialog .el-dialog__body {
+    padding: 0px 20px;
+}
+</style>

+ 8 - 4
src/views/iosBasicData/PaymentApplication/assembly/finstlbillsitems.vue

@@ -68,8 +68,8 @@
                 label="本次RMB" width="100px">
                 <template slot-scope="scope">
                     <el-input style="width: 100%;" v-model="scope.row.currentStlAmountRMB"
-                              :disabled="scope.row.curCode != 'CNY'"
-                              v-if="brfalse && !editSave"
+                              :disabled="scope.row.curCode != 'CNY' || settlementdistar"
+                              v-if="(brfalse && !editSave)"
                               size="mini" autocomplete="off"
                               clearable placeholder="请输入USD" >
                     </el-input>
@@ -81,8 +81,8 @@
                 label="本次USD" width="100px">
                 <template slot-scope="scope">
                     <el-input style="width: 100%;" v-model="scope.row.currentStlAmountUSD"
-                              :disabled="scope.row.curCode != 'USD'"
-                              v-if="brfalse && !editSave"
+                              :disabled="scope.row.curCode != 'USD' || settlementdistar"
+                              v-if="(brfalse && !editSave)"
                               size="mini" autocomplete="off"
                               clearable placeholder="请输入USD" >
                     </el-input>
@@ -208,6 +208,10 @@
             editSave:{
                 type:Boolean,
                 default:false
+            },
+            settlementdistar:{
+                type:Boolean,
+                default:false
             }
         },
         data(){

+ 0 - 1
src/views/iosBasicData/PaymentApplication/index.vue

@@ -377,7 +377,6 @@
             this.isShow = false
             this.editSave = true
             this.$nextTick(()=>{
-
                 this.$refs.finstlbillsDetails.finstlbillsDetailfun(row.id)
             })
         },

+ 125 - 10
src/views/iosBasicData/fininvoicesApplyfor/assembly/fininvoiceitemdetail.vue

@@ -12,22 +12,104 @@
           :row-style="rowStyle"
           :row-class-name="rowClassName" >
           <el-table-column fixed="left" type="selection" width="55" />
-          <el-table-column prop="lineNo" label="行号" width="50px" />
-          <el-table-column prop="serverId" label="项目名称Id" />
-          <el-table-column prop="serverName" label="项目名称" />
-          <el-table-column prop="typeno" label="规格型号" />
-          <el-table-column prop="unit" label="单位" />
-          <el-table-column prop="number" label="数量" />
-          <el-table-column prop="price" label="单价(含税)" />
-          <el-table-column prop="amount" label="金额(含税)" />
-          <el-table-column prop="amountRate" label="税率" />
+          <el-table-column prop="index" label="行号" width="50px" >
+              <template slot-scope="scope">
+                  <span>{{Number(scope.$index) + 1}}</span>
+              </template>
+          </el-table-column>
+          <el-table-column prop="serverName" label="项目名称" width="140px" >
+              <template slot-scope="{ row }">
+                  <search-query v-if="row.edit"
+                                :datalist="serverData"
+                                :selectValue="row.serverName"
+                                :clearable="true"
+                                :buttonIf="false"
+                                :filterable="true"
+                                size="mini"
+                                :forParameter="{key:'dictKey',label:'dictValue',value:'dictValue'}"
+                                placeholder="请选择项目名称"
+                                @corpChange="corpChange($event,'serverName')"
+                                @corpFocus="serverWorkDictsfun" >
+                  </search-query>
+                  <span v-else>{{row.serverName}}</span>
+              </template>
+          </el-table-column>
+          <el-table-column prop="typeno" label="规格型号" >
+              <template slot-scope="{ row }">
+                  <el-input v-if="row.edit" style="width: 100%;" v-model="row.typeno"
+                            size="mini" autocomplete="off"
+                            clearable placeholder="请输入规格型号" >
+                  </el-input>
+                  <span v-else>{{row.typeno}}</span>
+              </template>
+          </el-table-column>
+          <el-table-column prop="unit" label="单位" width="100px" >
+              <template slot-scope="{ row }">
+                  <search-query v-if="row.edit"
+                                :datalist="unitData"
+                                :selectValue="row.unit"
+                                :clearable="true"
+                                :buttonIf="false"
+                                :filterable="true"
+                                size="mini"
+                                :forParameter="{key:'dictKey',label:'dictValue',value:'dictValue'}"
+                                placeholder="请选择单位"
+                                @corpChange="corpChange($event,'unit',row)"
+                                @corpFocus="unitWorkDictsfun" >
+                  </search-query>
+                  <span v-else>{{row.unit}}</span>
+              </template>
+          </el-table-column>
+          <el-table-column prop="number" label="数量" width="100px" >
+              <template slot-scope="{ row }">
+                  <el-input v-if="row.edit" style="width: 100%;" v-model="row.number"
+                            size="mini" autocomplete="off"
+                            clearable placeholder="请输入数量" >
+                  </el-input>
+                  <span v-else>{{row.number}}</span>
+              </template>
+          </el-table-column>
+          <el-table-column prop="price" label="单价(含税)" >
+              <template slot-scope="{ row }">
+                  <el-input v-if="row.edit" style="width: 100%;" v-model="row.price"
+                            size="mini" autocomplete="off"
+                            clearable placeholder="请输入单价" >
+                  </el-input>
+                  <span v-else>{{row.price}}</span>
+              </template>
+          </el-table-column>
+          <el-table-column prop="amount" label="金额(含税)" >
+              <template slot-scope="{ row }">
+                  <el-input v-if="row.edit" style="width: 100%;" v-model="row.amount"
+                            size="mini" autocomplete="off"
+                            clearable placeholder="请输入金额" @input="amountInput(row)" >
+                  </el-input>
+                  <span v-else>{{row.amount}}</span>
+              </template>
+          </el-table-column>
+          <el-table-column prop="amountRate" label="税率(%)" />
           <el-table-column prop="amountTax" label="税额" />
+          <el-table-column
+              fixed="right"
+              label="操作"
+              width="100">
+              <template slot-scope="scope">
+                  <el-button v-if="scope.row.edit" type="text" size="small" @click="savefun(scope.row,scope.index)">保存</el-button>
+                  <el-button v-else type="text" size="small" @click="editfun(scope.row,scope.index)" >编辑</el-button>
+                  <el-button type="text" size="small" @click="deletefun(scope.row,scope.index)" >删除</el-button>
+              </template>
+          </el-table-column>
       </el-table>
   </div>
 </template>
 
 <script>
+  import SearchQuery from "@/components/iosbasic-data/searchquery.vue";
+  import {getWorkDicts} from "@/api/system/dictbiz";
+  import {fininvoiceitemdetailSubmit} from "@/api/iosBasicData/fininvoices";
+
   export default {
+      components: {SearchQuery},
       props:{
           tableData:{
               type:Array,
@@ -40,10 +122,43 @@
       },
     data() {
       return {
-
+          serverData:[], // 项目名称字典数据
+          unitData:[], // 单位字典数据
       };
     },
     methods: {
+        // 修改金额的回调
+        amountInput(row){
+            // amountTax
+        },
+        // 下拉回调
+        corpChange(value,name,row){
+            this.$set(row,name,value)
+        },
+        // 保存
+        savefun(row){
+            this.$emit('savefun',row)
+        },
+        // 编辑
+        editfun(row){
+            this.$set(row,'edit',true)
+        },
+        // 删除
+        deletefun(row,index){
+            this.$emit('deletefun',row.id,index)
+        },
+        // 项目名称字典数据
+        serverWorkDictsfun(){
+            getWorkDicts('Invoice_information_los').then(res=>{
+                this.serverData = res.data.data;
+            })
+        },
+        // 获取单位字典数据
+        unitWorkDictsfun(){
+            getWorkDicts('Invoice_Items_unit_los').then(res=>{
+                this.unitData = res.data.data;
+            })
+        },
         // 表头样式
         tableHeaderCellStyle({row,column,rowIndex, columnIndex}){
             return "padding:4px 0px;fontSize:12px;color:#000;background:#ecf5ff"

+ 7 - 1
src/views/iosBasicData/fininvoicesApplyfor/assembly/fininvoicesitems.vue

@@ -21,6 +21,13 @@
                 label="行号" width="50px">
             </el-table-column>
             <el-table-column
+                prop="status"
+                label="开票" width="50px">
+                <template slot-scope="{ row }">
+                    <span>{{row.status?'是':'否'}}</span>
+                </template>
+            </el-table-column>
+            <el-table-column
                 prop="mblno"
                 label="MB/L NO">
                 <template slot-scope="{row}">
@@ -110,7 +117,6 @@
                 prop="currentExrate"
                 label="本次发票汇率" width="100px">
             </el-table-column>
-
             <el-table-column
                 prop="remarks"
                 label="备注">

+ 169 - 29
src/views/iosBasicData/fininvoicesApplyfor/fininvoicesDetails.vue

@@ -386,11 +386,11 @@
                                         </el-form-item>
                                     </el-col>
                                     <el-col :span="8">
-                                        <el-form-item label="无字段账单号" prop="bookingNo">
-                                            <el-input style="width: 100%;" v-model="form.bookingNo"
+                                        <el-form-item label="申请单号" prop="applyNo">
+                                            <el-input style="width: 100%;" v-model="form.applyNo"
                                                       size="small" autocomplete="off"
                                                       :disabled="editSave"
-                                                      clearable placeholder="请输入单号" >
+                                                      clearable placeholder="请输入申请单号" >
                                             </el-input>
                                         </el-form-item>
                                     </el-col>
@@ -436,7 +436,7 @@
                                         </el-form-item>
                                     </el-col>
                                     <el-col :span="8">
-                                        <el-form-item label="税率" prop="taxRate">
+                                        <el-form-item label="税率(%)" prop="taxRate">
                                             <el-input style="width: 100%;" v-model="form.taxRate"
                                                       size="small" autocomplete="off"
                                                       :disabled="editSave"
@@ -491,17 +491,18 @@
                     <el-tabs v-model="detailTabs" type="card">
                         <el-tab-pane label="费用明细" name="first">
                             <div style="margin-bottom: 10px;display: flex;">
-                                <search-query :datalist="invoicingData"
-                                              :selectValue="invoicingValue"
+                                <search-query :datalist="serverData"
+                                              :selectValue="form.serverName"
                                               :clearable="true"
                                               :buttonIf="false"
                                               :filterable="true"
                                               :forParameter="{key:'dictKey',label:'dictValue',value:'dictValue'}"
-                                              placeholder="请输入开票项目"
-                                              @corpChange="corpChange($event,'invoicingValue')"
-                                              @corpFocus="invoicingWorkDictsfun" >
+                                              placeholder="请选择开票项目"
+                                              @corpChange="corpChange($event,'serverName')"
+                                              @corpFocus="serverWorkDictsfun" >
                                 </search-query>
                                 <el-button style="margin-left: 10px" size="small" type="primary" @click="invoicingfun" >开票</el-button>
+                                <el-button style="margin-left: 10px" size="small" type="warning" @click="invoicingRevokefun" >撤销开票</el-button>
                                 <el-button size="small" type="danger" @click="batchDeletefun" >批量删除</el-button>
                             </div>
                             <fininvoicesitems :tableData="tableData"
@@ -512,8 +513,13 @@
                             </fininvoicesitems>
                         </el-tab-pane>
                         <el-tab-pane label="开票明细" name="second">
+                            <div style="margin-bottom: 10px;display: flex;">
+                                <el-button size="small" type="danger" @click="invoicingBatchDelete" >批量删除</el-button>
+                            </div>
                             <fininvoiceitemdetail :tableData="InvoicingList"
-                                                  :handleSelectionData="[]">
+                                                  :handleSelectionData="invoicingCheckboxData"
+                                                  @handleSelectionChange="invoicingCheckboxChange"
+                                                  @deletefun="invoiceDeletionfun" @savefun="invoiceSavefun">
                             </fininvoiceitemdetail>
                         </el-tab-pane>
                     </el-tabs>
@@ -595,7 +601,10 @@ import {
     finInvoicesApprove,
     fininvoicesDetail,
     revokeFinInvoicesApprove,
-    fininvoicesSubmit, fininvoicesitemsRemove
+    fininvoicesSubmit,
+    fininvoicesitemsRemove,
+    generateFinInvoicesDetail,
+    fininvoiceitemdetailRemove, revokeFinInvoicesDetail,fininvoiceitemdetailSubmit
 } from "@/api/iosBasicData/fininvoices";
 import {getWorkDicts} from "@/api/system/dictbiz";
 
@@ -603,8 +612,7 @@ export default {
         components:{ SearchQuery, fininvoicesitems,fininvoiceitemdetail},
         data() {
             return {
-                invoicingData:[], // 开票项目数据
-                invoicingValue:'', // 开票项目
+                serverData:[], // 开票项目数据
                 detailTabs:'first',
                 appendType:'检索',
                 pageLoading:false, // 全屏加载
@@ -612,7 +620,8 @@ export default {
                 form:{},
                 tableData:[], // 费用明细数据
                 InvoicingList:[], // 开票明细数据
-                handleSelectionData:[], // 选择的数据
+                handleSelectionData:[], // 费用明细选择的数据
+                invoicingCheckboxData:[], // 开票明细选择的数据
                 corpData:[], // 结算单位数据
                 invCorpData:[], // 开票单位
                 bankReceiptData:[], // 结算单位银行账号数据
@@ -645,6 +654,9 @@ export default {
                     taxType: [
                         {required: true, message: '请输入所属税种', trigger: 'blur'},
                     ],
+                    taxRate: [
+                        {required: true, message: '请输入所属税率', trigger: 'blur'},
+                    ],
                 },
             }
         },
@@ -655,11 +667,90 @@ export default {
             }
         },
         methods:{
-            // 开票信息
+            // 开票明细编辑完成保存
+            invoiceSavefun(row){
+                row.amountRate = this.form.taxRate
+                // 销售额/(1+税率)×税率
+                row.amountTax = (row.amount / (1 + (Number(row.amountRate) / 100)) * (Number(row.amountRate) / 100)).toFixed(2)
+                fininvoiceitemdetailSubmit(row).then(res=>{
+                    this.$message.success('操作成功')
+                    this.fininvoicesDetailfun(this.form.id)
+                })
+            },
+            // 确认开票信息
             invoicingfun(){
+                if (this.handleSelectionData.length == 0) {
+                    this.$message.warning('请选择数据')
+                    return;
+                }
+                if (!this.form.serverName) {
+                    this.$message.warning('请选择开票项目')
+                    return
+                }
+                let obj = this.form
+                obj.finInvoicesItemsList = []
+                obj.businessTypes = this.form.businessTypes?this.form.businessTypes.join(','):''
+                //开票日期
+                if(this.form.invoiceDate) {
+                    obj.invoiceDate = this.form.invoiceDate.slice(0,10) + ' 00:00:00'
+                }
+                for (let item of this.handleSelectionData) {
+                    // 拿未开票的数据
+                    if(item.status == 0) {
+                        if (item.currentCurCode == 'CNY') {
+                            item.currentAmount = item.currentAmountCNY
+                        }else {
+                            item.currentAmount = item.currentAmountUSD
+                        }
+                        obj.finInvoicesItemsList.push(item)
+                    }
+                }
+                if (obj.finInvoicesItemsList.length == 0) {
+                    this.$message.warning('请选择未生成发票的数据')
+                    return
+                }
+                // 开票项目
+                generateFinInvoicesDetail(obj).then(res=>{
+                    this.$message.warning('操作成功')
+                    this.fininvoicesDetailfun(this.form.id)
+                })
                 this.detailTabs = 'second'
             },
-            // 批量删除
+            // 撤销开票信息
+            invoicingRevokefun(){
+                if (this.handleSelectionData.length == 0) {
+                    this.$message.warning('请选择数据')
+                    return;
+                }
+                let obj = this.form
+                obj.finInvoicesItemsList = []
+                obj.businessTypes = this.form.businessTypes?this.form.businessTypes.join(','):''
+                //开票日期
+                if(this.form.invoiceDate) {
+                    obj.invoiceDate = this.form.invoiceDate.slice(0,10) + ' 00:00:00'
+                }
+                for (let item of this.handleSelectionData) {
+                    // 拿未开票的数据
+                    if(item.status == 1) {
+                        if (item.currentCurCode == 'CNY') {
+                            item.currentAmount = item.currentAmountCNY
+                        }else {
+                            item.currentAmount = item.currentAmountUSD
+                        }
+                        obj.finInvoicesItemsList.push(item)
+                    }
+                }
+                if (obj.finInvoicesItemsList.length == 0) {
+                    this.$message.warning('请选择已生成发票的数据')
+                    return
+                }
+                // 撤销开票项目
+                revokeFinInvoicesDetail(obj).then(res=>{
+                    this.$message.warning('操作成功')
+                    this.fininvoicesDetailfun(this.form.id)
+                })
+            },
+            // 费用明细批量删除
             batchDeletefun(){
                 if (this.handleSelectionData.length == 0) {
                     return this.$message.warning('请选择要删除的数据')
@@ -676,7 +767,7 @@ export default {
                     this.handleSelectionData.forEach((item)=>{
                         for (let index in this.tableData) {
                             if (item.accBillNo == this.tableData[index].accBillNo) {
-                                this.tableData.splice(index,1)
+                                this.tableData.splice(Number(index),1)
                             }
                         }
                     })
@@ -688,8 +779,8 @@ export default {
                     }
                 })
             },
-            // 单个删除
-            detailsdeletionfun(id){
+            // 费用明细单个删除
+            detailsdeletionfun(id,index){
                 this.$confirm("确定将选择数据删除?", {
                     confirmButtonText: "确定",
                     cancelButtonText: "取消",
@@ -703,6 +794,50 @@ export default {
                     this.tableData.splice(index,1)
                 })
             },
+            // 开票批量删除
+            invoicingBatchDelete(){
+                if (this.invoicingCheckboxData.length == 0) {
+                    return this.$message.warning('请选择要删除的数据')
+                }
+                this.$confirm("确定将选择数据删除?", {
+                    confirmButtonText: "确定",
+                    cancelButtonText: "取消",
+                    type: "warning"
+                }).then(()=>{
+                    // 获取有id 的数据
+                    const itemsWithId = this.invoicingCheckboxData.filter(item => item.hasOwnProperty('id'));
+                    let arrIds = itemsWithId.map(item=>item.id) // 获取id 数据
+                    // 把选中的删除掉
+                    this.invoicingCheckboxData.forEach((item)=>{
+                        for (let index in this.InvoicingList) {
+                            if (item.id == this.InvoicingList[index].id) {
+                                this.InvoicingList.splice(Number(index),1)
+                            }
+                        }
+                    })
+                    // 有id 的处理
+                    if(itemsWithId.length != 0) {
+                        fininvoiceitemdetailRemove(arrIds.join(',')).then(res=>{
+                            this.$message.success('操作成功')
+                        })
+                    }
+                })
+            },
+            // 开票明细单个删除
+            invoiceDeletionfun(id,index){
+                this.$confirm("确定将选择数据删除?", {
+                    confirmButtonText: "确定",
+                    cancelButtonText: "取消",
+                    type: "warning"
+                }).then(()=>{
+                    if (id) {
+                        fininvoiceitemdetailRemove(id).then(res=>{
+                            this.$message.success('操作成功')
+                        })
+                    }
+                    this.InvoicingList.splice(index,1)
+                })
+            },
             // 下拉框的回调
             corpChange(value,name){
                 // 结算单位
@@ -771,18 +906,19 @@ export default {
                         }
                     }
                 }
-                else if (name == 'invoicingValue') {
-                    this.invoicingValue = value
-                }
                 else {
                     this.$set(this.form,name,value)
                 }
 
             },
-            // 下面表格多选
+            // 费用明细表格多选
             handleSelectionChange(arr){
                 this.handleSelectionData = arr
             },
+            // 开票明细表格多选
+            invoicingCheckboxChange(arr){
+                this.invoicingCheckboxData = arr
+            },
             // 编辑事件
             editHandle(){
                 this.editSave = false
@@ -798,7 +934,7 @@ export default {
                             return;
                         }
                     }
-                    this.form.type = '销项'
+                    this.form.type = '申请'
                     this.form.billNoFormat = 'FPSQ'
                     this.form.businessTypeCode = 'FPSQ'
                     this.form.businessTypes = this.form.businessTypes?this.form.businessTypes.join(','):''
@@ -814,6 +950,7 @@ export default {
                         }
                         return item
                     })
+                    this.form.finInvoiceItemDetailList = this.InvoicingList
                     this.saveLoading = true
                     this.fininvoicesSubmitfun(this.form)
                 })
@@ -849,10 +986,10 @@ export default {
                         item.currentExrate = item.exrate
                         if (item.currentCurCode == 'CNY') {
                             // 本次发票金额
-                            item.currentAmountCNY = (Number(item.amount) - Number(item.stlTtlAmount) - Number(item.appliedAmount)).toFixed(2)
+                            item.currentAmountCNY = (Number(item.amount) - Number(item.appliedInvoiceAmount)).toFixed(2)
                         }else {
                             // 本次发票金额
-                            item.currentAmountUSD = (Number(item.amount) - Number(item.stlTtlAmount) - Number(item.appliedAmount)).toFixed(2)
+                            item.currentAmountUSD = (Number(item.amount) - Number(item.appliedInvoiceAmount)).toFixed(2)
                         }
                         delete item.id
                         return item
@@ -901,7 +1038,10 @@ export default {
                         }
                         return item
                     })
-                    this.InvoicingList = this.form.finInvoiceItemDetailList
+                    this.InvoicingList = this.form.finInvoiceItemDetailList.map(item=>{
+                        item.edit = false
+                        return item
+                    })
                     this.pageLoading = false
                 })
             },
@@ -1003,9 +1143,9 @@ export default {
                     this.invTypeData = res.data.data;
                 })
             },
-            invoicingWorkDictsfun(){
+            serverWorkDictsfun(){
                 getWorkDicts('Invoice_information_los').then(res=>{
-                    this.invoicingData = res.data.data;
+                    this.serverData = res.data.data;
                 })
             },
 

+ 116 - 83
src/views/iosBasicData/fininvoicesApplyfor/index.vue

@@ -28,7 +28,7 @@
                              size="small"
                              icon="el-icon-plus"
                              plain
-                             @click="newbillFun">新建发票
+                             @click="newbillFun">新建申请
                   </el-button>
                   <el-button type="danger"
                              size="small"
@@ -47,31 +47,6 @@
                              @click="rowDel(row)">删除
                   </el-button>
               </template>
-              <template slot-scope="scope" slot="billNo">
-                  <avue-text-ellipsis :text="scope.row.billNo" :height="30" use-tooltip placement="top">
-                      <small slot="more">...</small>
-                  </avue-text-ellipsis>
-              </template>
-              <template slot-scope="scope" slot="corpCnName">
-                  <avue-text-ellipsis :text="scope.row.corpCnName" :height="30" use-tooltip placement="top">
-                      <small slot="more">...</small>
-                  </avue-text-ellipsis>
-              </template>
-              <template slot-scope="scope" slot="corpEnName">
-                  <avue-text-ellipsis :text="scope.row.corpEnName" :height="30" use-tooltip placement="top">
-                      <small slot="more">...</small>
-                  </avue-text-ellipsis>
-              </template>
-              <template slot-scope="scope" slot="invCorpCnName">
-                  <avue-text-ellipsis :text="scope.row.invCorpCnName" :height="30" use-tooltip placement="top">
-                      <small slot="more">...</small>
-                  </avue-text-ellipsis>
-              </template>
-              <template slot-scope="scope" slot="invCorpEnName">
-                  <avue-text-ellipsis :text="scope.row.invCorpEnName" :height="30" use-tooltip placement="top">
-                      <small slot="more">...</small>
-                  </avue-text-ellipsis>
-              </template>
               <template slot-scope="scope" slot="stlMode">
                   <span>{{scope.row.stlMode?'月结':'票结'}}</span>
               </template>
@@ -128,7 +103,26 @@ import fininvoicesDetails from "@/views/iosBasicData/fininvoicesApplyfor/fininvo
                 required: true,
                 message: "请输入单据编号",
                 trigger: "blur"
-              }]
+              }],
+              overHidden:true,
+            },
+            {
+                label: "客户中文名称",
+                prop: "corpCnName",
+                width:"120",
+                overHidden:true,
+            },
+            {
+                label: "开票单位中文名称",
+                prop: "invCorpCnName",
+                width:"160",
+                overHidden:true,
+            },
+            {
+                label: "合计本位币(CNY)",
+                prop: "amountLoc",
+                width: "120",
+                overHidden:true,
             },
             {
               label: "单据日期",
@@ -137,7 +131,8 @@ import fininvoicesDetails from "@/views/iosBasicData/fininvoicesApplyfor/fininvo
                 required: true,
                 message: "请输入单据日期",
                 trigger: "blur"
-              }]
+              }],
+                overHidden:true,
             },
             {
               label: "发票号码",
@@ -146,7 +141,8 @@ import fininvoicesDetails from "@/views/iosBasicData/fininvoicesApplyfor/fininvo
                 required: true,
                 message: "请输入发票号码",
                 trigger: "blur"
-              }]
+              }],
+                overHidden:true,
             },
             {
               label: "开票日期",
@@ -155,26 +151,31 @@ import fininvoicesDetails from "@/views/iosBasicData/fininvoicesApplyfor/fininvo
                 required: true,
                 message: "请输入开票日期",
                 trigger: "blur"
-              }]
+              }],
+                overHidden:true,
             },
             {
               label: "原发票号码",
               prop: "origInvoiceNo",
-                width:"120"
+                width:"120",
+                overHidden:true,
             },
             {
               label: "税务发票号码",
               prop: "taxInvoiceNo",
-                width:"150"
+                width:"150",
+                overHidden:true,
             },
             {
               label: "全电发票",
               prop: "invType",
+                overHidden:true,
             },
             {
               label: "普通发票/专用发票",
               prop: "taxType",
-                width:"160"
+                width:"160",
+                overHidden:true,
             },
             {
               label: "税率 %",
@@ -183,11 +184,13 @@ import fininvoicesDetails from "@/views/iosBasicData/fininvoicesApplyfor/fininvo
                 required: true,
                 message: "请输入税率 %",
                 trigger: "blur"
-              }]
+              }],
+                overHidden:true,
             },
             {
               label: "结算方式",
               prop: "stlMode",
+                overHidden:true,
             },
             {
               label: "发票币种",
@@ -196,91 +199,92 @@ import fininvoicesDetails from "@/views/iosBasicData/fininvoicesApplyfor/fininvo
                 required: true,
                 message: "请输入发票币种",
                 trigger: "blur"
-              }]
-            },
-            {
-              label: "客户中文名称",
-              prop: "corpCnName",
-                width:"120"
+              }],
+                overHidden:true,
             },
             {
               label: "客户英文名称",
               prop: "corpEnName",
-                width:"120"
-            },
-            {
-              label: "客户开票单位名称",
-              prop: "corpInvoiceHeader",
-                width:"150"
-            },
-            {
-              label: "开票单位中文名称",
-              prop: "invCorpCnName",
-                width:"160"
+                width:"120",
+                overHidden:true,
             },
             {
               label: "开票单位英文名称",
               prop: "invCorpEnName",
-                width:"150"
+                width:"150",
+                overHidden:true,
             },
             {
               label: "开票单位税号",
               prop: "invCorpTaxNo",
-                width:"140"
+                width:"140",
+                overHidden:true,
             },
             {
               label: "开票单位CNY开户银行",
               prop: "invCorpAccountBankCny",
-                width:"160"
+                width:"160",
+                overHidden:true,
             },
             {
               label: "开票单位CNY银行账号",
               prop: "invCorpAccountNoCny",
-                width:"160"
+                width:"160",
+                overHidden:true,
             },
             {
               label: "开票单位USD开户银行",
               prop: "invCorpAccountBankUsd",
-                width:"160"
+                width:"160",
+                overHidden:true,
             },
             {
               label: "开票单位USD银行账号",
               prop: "invCorpAccountNoUsd",
-                width:"160"
+                width:"160",
+                overHidden:true,
             },
             {
               label: "船名/航次",
               prop: "vesselVoyno",
-                width:"100"
+                width:"100",
+                overHidden:true,
             },
             {
               label: "开船日",
               prop: "etd",
+                overHidden:true,
             },
             {
               label: "装货港",
               prop: "pol",
+                overHidden:true,
             },
             {
               label: "卸货港",
               prop: "pod",
+                overHidden:true,
             },
             {
               label: "目的地",
               prop: "destination",
+                overHidden:true,
             },
             {
               label: "箱型/箱量",
               prop: "containers",
-                width:"100"
+                width:"100",
+                overHidden:true,
             },
             {
               label: "币种",
               prop: "curCode",
+                overHidden:true,
             },
             {
               label: "原汇率",
               prop: "exrate",
+                overHidden:true,
             },
             {
               label: "是否转换为人民币",
@@ -292,63 +296,77 @@ import fininvoicesDetails from "@/views/iosBasicData/fininvoicesApplyfor/fininvo
                 },{
                     label:'是',
                     value:1
-                },]
+                }],
+                overHidden:true,
             },
             {
               label: "业务类型",
               prop: "businessTypes",
+                overHidden:true,
             },
             {
               label: "业务单据编号",
               prop: "businessNo",
                 width:"120",
+                overHidden:true,
             },
             {
               label: "对账单编号",
               prop: "checkNo",
                 width:"120",
+                overHidden:true,
             },
             {
               label: "MBL NO",
               prop: "mblno",
+                overHidden:true,
             },
             {
               label: "HBL NO",
               prop: "hblno",
+                overHidden:true,
             },
             {
               label: "订舱",
               prop: "bookingNo",
+                overHidden:true,
             },
             {
               label: "中文船名",
               prop: "vesselCnName",
+                overHidden:true,
             },
             {
               label: "英文船名",
               prop: "vesselEnName",
+                overHidden:true,
             },
             {
               label: "航次",
               prop: "voyageNo",
+                overHidden:true,
             },
             {
               label: "财务开始日期",
               prop: "accountDateFrom",
                 width:"100",
+                overHidden:true,
             },
             {
               label: "财务结束日期",
               prop: "accountDateTo",
                 width:"100",
+                overHidden:true,
             },
             {
               label: "申请人",
               prop: "applicantName",
+                overHidden:true,
             },
             {
               label: "审核人",
               prop: "approverName",
+                overHidden:true,
             },
             {
               label: "是否代理发票",
@@ -360,7 +378,8 @@ import fininvoicesDetails from "@/views/iosBasicData/fininvoicesApplyfor/fininvo
                 },{
                     label:'是',
                     value:1
-                },]
+                }],
+                overHidden:true,
             },
             {
               label: "是否DK",
@@ -371,7 +390,8 @@ import fininvoicesDetails from "@/views/iosBasicData/fininvoicesApplyfor/fininvo
                 },{
                     label:'是',
                     value:1
-                },]
+                }],
+                overHidden:true,
             },
             {
               label: "是否RP",
@@ -382,20 +402,24 @@ import fininvoicesDetails from "@/views/iosBasicData/fininvoicesApplyfor/fininvo
                 },{
                     label:'是',
                     value:1
-                },]
+                }],
+                overHidden:true,
             },
             {
               label: "RP名称",
               prop: "rpName",
+                overHidden:true,
             },
             {
               label: "导出日期",
               prop: "exportDate",
-              width: "100"
+              width: "100",
+                overHidden:true,
             },
             {
               label: "导出人",
               prop: "exportName",
+                overHidden:true,
             },
             {
               label: "是否导出船名航次",
@@ -407,7 +431,8 @@ import fininvoicesDetails from "@/views/iosBasicData/fininvoicesApplyfor/fininvo
                 },{
                     label:'是',
                     value:1
-                },]
+                }],
+                overHidden:true,
             },
             {
               label: "是否导出主单号",
@@ -419,7 +444,8 @@ import fininvoicesDetails from "@/views/iosBasicData/fininvoicesApplyfor/fininvo
                 },{
                     label:'是',
                     value:1
-                },]
+                }],
+                overHidden:true,
             },
             {
               label: "是否导出分单号",
@@ -431,62 +457,68 @@ import fininvoicesDetails from "@/views/iosBasicData/fininvoicesApplyfor/fininvo
                 },{
                     label:'是',
                     value:1
-                },]
+                }],
+                overHidden:true,
             },
             {
               label: "发票本位币(CNY)",
               prop: "amountCny",
                 width: "140",
+                overHidden:true,
             },
             {
               label: "发票USD",
               prop: "amountUsd",
-              width: "100"
+              width: "100",
+                overHidden:true,
             },
             {
               label: "税额(CNY)",
               prop: "amountTax",
-                width: "100"
-            },
-            {
-              label: "合计本位币(CNY)",
-              prop: "amountLoc",
-                width: "120"
+                width: "100",
+                overHidden:true,
             },
             {
               label: "全电发票备注",
               prop: "elecRemarks",
-                width: "120"
+                width: "120",
+                overHidden:true,
             },
             {
               label: "银行进账单出票人名称",
               prop: "bankReceiptCorpName",
-                width: "160"
+                width: "160",
+                overHidden:true,
             },
             {
               label: "银行进账单出票银行",
               prop: "bankReceiptBankName",
-                width: "160"
+                width: "160",
+                overHidden:true,
             },
             {
               label: "银行进账单出票银行账号",
               prop: "bankReceiptAccountNo",
-                width: "160"
+                width: "160",
+                overHidden:true,
             },
             {
               label: "银行进账单票据种类",
               prop: "bankReceiptBillType",
-                width: "160"
+                width: "160",
+                overHidden:true,
             },
             {
               label: "银行进账单票据张数",
               prop: "bankReceiptBillCount",
-                width: "160"
+                width: "160",
+                overHidden:true,
             },
             {
               label: "银行进账单是否已进账(收款)",
               prop: "bankReceiptIsIncome",
-                width: "180"
+                width: "180",
+                overHidden:true,
             },
             {
               label: "备注",
@@ -495,7 +527,8 @@ import fininvoicesDetails from "@/views/iosBasicData/fininvoicesApplyfor/fininvo
                 required: true,
                 message: "请输入备注",
                 trigger: "blur"
-              }]
+              }],
+                overHidden:true,
             },
           ]
         },
@@ -657,7 +690,7 @@ import fininvoicesDetails from "@/views/iosBasicData/fininvoicesApplyfor/fininvo
       onLoad(page, params = {}) {
         this.loading = true;
         fininvoicesList(page.currentPage, page.pageSize,
-            {...Object.assign(params, this.query),type:"销项",billNoFormat:'FPSQ',businessTypeCode:'FPSQ'}).then(res => {
+            {...Object.assign(params, this.query),type:"申请",billNoFormat:'FPSQ',businessTypeCode:'FPSQ'}).then(res => {
           const data = res.data.data;
           this.page.total = data.total;
           this.data = data.records;

File diff suppressed because it is too large
+ 1059 - 827
src/views/iosBasicData/fininvoicesOutput/fininvoicesDetails.vue


File diff suppressed because it is too large
+ 576 - 416
src/views/iosBasicData/fininvoicesOutput/index.vue


Some files were not shown because too many files changed in this diff