Selaa lähdekoodia

货代发票申请 2023-12-27

caojunjie 1 vuosi sitten
vanhempi
commit
ca5216a1e3

+ 16 - 91
src/views/iosBasicData/PaymentApplication/assembly/finstlbillsitems.vue

@@ -16,12 +16,6 @@
                 v-if="brfalse"
                 type="selection"
                 width="55">
-                <!--<template slot-scope="scope">-->
-                <!--    <el-checkbox v-model="scope.row.tableSelect"-->
-                <!--                 :true-label="1" :false-label="0"-->
-                <!--                 @change="toggleSelection([scope.row])">-->
-                <!--    </el-checkbox>-->
-                <!--</template>-->
             </el-table-column>
             <el-table-column
                 prop="lineNo"
@@ -40,16 +34,6 @@
                 prop="billNo"
                 label="原业务编号" width="120px">
             </el-table-column>
-            <!--<el-table-column-->
-            <!--    prop="tableSelect"-->
-            <!--    label="选择" width="50px" v-if="brfalse">-->
-            <!--    <template slot-scope="scope">-->
-            <!--        <el-checkbox v-model="scope.row.tableSelect"-->
-            <!--                     :true-label="1" :false-label="0"-->
-            <!--                     @change="toggleSelection([scope.row])">-->
-            <!--        </el-checkbox>-->
-            <!--    </template>-->
-            <!--</el-table-column>-->
             <el-table-column
                 prop="accBillNo"
                 label="账单编号" width="140px">
@@ -58,18 +42,14 @@
                 prop="corpCnName"
                 label="客户简称" width="130px">
                 <template slot-scope="{ row }">
-                    <avue-text-ellipsis :text="row.corpCnName" :height="50" :width="130">
-                        <small slot="more">...</small>
-                    </avue-text-ellipsis>
+                    <span class="textHide">{{row.corpCnName}}</span>
                 </template>
             </el-table-column>
             <el-table-column
                 prop="mblno"
                 label="MB/L NO" width="120px">
                 <template slot-scope="{ row }">
-                    <avue-text-ellipsis :text="row.mblno" :height="50" :width="120">
-                        <small slot="more">...</small>
-                    </avue-text-ellipsis>
+                    <span  class="textHide">{{row.mblno}}</span>
                 </template>
             </el-table-column>
             <el-table-column
@@ -83,23 +63,6 @@
                 prop="currentStlExrate"
                 label="汇率">
             </el-table-column>
-            <!--<el-table-column-->
-            <!--    label="本次结算币种"-->
-            <!--    prop="currentStlCurCode" width="130px">-->
-            <!--    <template slot-scope="{row}">-->
-            <!--        <search-query :datalist="curCodeData"-->
-            <!--                      :selectValue="row.currentStlCurCode"-->
-            <!--                      :filterable="true"-->
-            <!--                      :clearable="true"-->
-            <!--                      :remote="true"-->
-            <!--                      :buttonIf="false"-->
-            <!--                      :forParameter="{key:'id',label:'code',value:'code'}"-->
-            <!--                      @remoteMethod="getRateListfun"-->
-            <!--                      @corpChange="corpChange($event,row)"-->
-            <!--                      @corpFocus="getRateListfun">-->
-            <!--        </search-query>-->
-            <!--    </template>-->
-            <!--</el-table-column>-->
             <el-table-column
                 prop="currentStlAmountRMB"
                 label="本次RMB" width="100px">
@@ -126,34 +89,6 @@
                     <span v-else>{{scope.row.currentStlAmountUSD}}</span>
                 </template>
             </el-table-column>
-
-            <!--<el-table-column label="本次结算金额(净额)">-->
-            <!--    &lt;!&ndash;默认应结算 可以修改&ndash;&gt;-->
-            <!--    &lt;!&ndash;currentStlAmountNet&ndash;&gt;-->
-            <!--    <el-table-column-->
-            <!--        prop="currentStlAmountNetRMB"-->
-            <!--        label="RMB" width="100px">-->
-            <!--        <template slot-scope="scope">-->
-            <!--            <el-input style="width: 100%;" v-model="scope.row.currentStlAmountNetRMB" v-if="brfalse"-->
-            <!--                      size="mini" autocomplete="off"-->
-            <!--                      clearable placeholder="请输入USD" >-->
-            <!--            </el-input>-->
-            <!--            <span v-else>{{scope.row.currentStlAmountNetRMB}}</span>-->
-            <!--        </template>-->
-            <!--    </el-table-column>-->
-            <!--    <el-table-column-->
-            <!--        prop="currentStlAmountNetUSD"-->
-            <!--        label="USD" width="100px">-->
-            <!--        <template slot-scope="scope">-->
-            <!--            <el-input style="width: 100%;" v-model="scope.row.currentStlAmountNetUSD" v-if="brfalse"-->
-            <!--                      size="mini" autocomplete="off"-->
-            <!--                      clearable placeholder="请输入USD" >-->
-            <!--            </el-input>-->
-            <!--            <span v-else>{{scope.row.currentStlAmountNetUSD}}</span>-->
-            <!--        </template>-->
-            <!--    </el-table-column>-->
-            <!--</el-table-column>-->
-
             <el-table-column
                 prop="isSignfor"
                 label="签收">
@@ -208,17 +143,6 @@
                 prop="amountUSD"
                 label="应结算USD" width="90px">
             </el-table-column>
-            <!--<el-table-column label="应结算金额(净额)">-->
-            <!--    &lt;!&ndash;amountNet&ndash;&gt;-->
-            <!--    <el-table-column-->
-            <!--        prop="amountNetRMB"-->
-            <!--        label="RMB">-->
-            <!--    </el-table-column>-->
-            <!--    <el-table-column-->
-            <!--        prop="amountNetUSD"-->
-            <!--        label="USD">-->
-            <!--    </el-table-column>-->
-            <!--</el-table-column>-->
             <el-table-column
                 prop="stlTtlAmountRMB"
                 label="已结算RMB" width="100px">
@@ -227,17 +151,6 @@
                 prop="stlTtlAmountUSD"
                 label="已结算USD" width="100px">
             </el-table-column>
-            <!--<el-table-column label="已结算金额(净额)">-->
-            <!--    &lt;!&ndash;自己起的 stlTtlAmountNet&ndash;&gt;-->
-            <!--    <el-table-column-->
-            <!--        prop="stlTtlAmountNetRMB"-->
-            <!--        label="RMB">-->
-            <!--    </el-table-column>-->
-            <!--    <el-table-column-->
-            <!--        prop="stlTtlAmountNetUSD"-->
-            <!--        label="USD">-->
-            <!--    </el-table-column>-->
-            <!--</el-table-column>-->
             <!-- stlTtlAmount 乘 taxRate + surchargeRate-->
             <el-table-column
                 prop="eta"
@@ -260,7 +173,7 @@
             <el-table-column
                 fixed="right"
                 label="操作"
-                width="100">
+                width="100" v-if="brfalse">
                 <template slot-scope="scope">
                     <el-button type="text" size="small" @click="deletefun(scope.row,scope.index)">删除</el-button>
                 </template>
@@ -302,7 +215,6 @@
                 ifInvoiceData:[], // 是否数据
                 invoicelosDara:[],// 发票
                 curCodeData:[], // 币种
-
             }
         },
         created() {
@@ -346,6 +258,19 @@
             tableHeaderCellStyle({row,column,rowIndex, columnIndex}){
                 return "padding:4px 0px;fontSize:12px;color:#000;background:#ecf5ff"
             },
+            // 更改表格颜色
+            headerClassName(tab) {
+                //颜色间隔
+                let back = ""
+                if (tab.columnIndex >= 0 && tab.column.level === 1) {
+                    if (tab.columnIndex % 2 === 0) {
+                        back = "back-one"
+                    } else if (tab.columnIndex % 2 === 1) {
+                        back = "back-two"
+                    }
+                }
+                return back;
+            },
 
             // Element UI 表格点击选中行/取消选中 快捷多选 以及快捷连续多选,高亮选中行 ——-------------------------------------——
             // 多选选择的数据

+ 1 - 9
src/views/iosBasicData/PaymentApplication/finstlbillsDetails.vue

@@ -353,7 +353,7 @@
             editSave:{
                 type:Boolean,
                 default:true
-            }
+            },
         },
         data(){
             return {
@@ -626,13 +626,6 @@
                     this.$message.warning('请选择对账单位');
                     return
                 }
-                // 业务类型
-                // if (!this.form.businessTypes) {
-                //     this.$message.warning('请选择业务类型');
-                //     return
-                // }
-                delete this.form.id
-                // let obj = JSON.parse(JSON.stringify(this.form))
                 let obj = {}
                 obj.type = '2'
                 obj.corpCnName = this.form.corpId // 结算单位
@@ -654,7 +647,6 @@
                 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

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

@@ -342,7 +342,28 @@
           // 展开行
         expandChange(row,expendList){
             finstlbillsitemsList(1,20,{pid:row.id}).then(res=>{
-                row.finStlBillsItemsList = res.data.data.records
+                row.finStlBillsItemsList = res.data.data.records.map(item=>{
+                    if(item.currentStlCurCode = 'CNY') {
+                        // 发票
+                        this.$set(item,'currentInvoiceAmountRMB',item.currentInvoiceAmount)
+                        // 应结算金额
+                        this.$set(item,'amountRMB',item.amount)
+                        // 已结算金额
+                        this.$set(item,'stlTtlAmountRMB',item.stlTtlAmount)
+                        // 本次金额
+                        this.$set(item,'currentStlAmountRMB',item.currentStlAmount)
+                    }else {
+                        // 发票
+                        this.$set(item,'currentInvoiceAmountUSD',item.currentInvoiceAmount)
+                        // 应结算金额
+                        this.$set(item,'amountUSD',item.amount)
+                        // 已结算金额
+                        this.$set(item,'stlTtlAmountUSD',item.stlTtlAmount)
+                        // 本次金额
+                        this.$set(item,'currentStlAmountUSD',item.currentStlAmount)
+                    }
+                    return item
+                })
             })
         },
       // 新建账单

+ 167 - 0
src/views/iosBasicData/fininvoicesApplyfor/assembly/fininvoiceitemdetail.vue

@@ -0,0 +1,167 @@
+<template>
+  <div>
+      <el-table
+          ref="tableRef"
+          :cell-style="{padding:'0px',fontSize:'12px'}"
+          :header-cell-style="tableHeaderCellStyle"
+          :data="tableData"
+          border
+          style="width: 100%"
+          @selection-change="handleSelectionChange"
+          @row-click="rowClick"
+          :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="amountTax" label="税额" />
+      </el-table>
+  </div>
+</template>
+
+<script>
+  export default {
+      props:{
+          tableData:{
+              type:Array,
+              default:[]
+          },
+          handleSelectionData:{
+              type:Array,
+              default:[],
+          }
+      },
+    data() {
+      return {
+
+      };
+    },
+    methods: {
+        // 表头样式
+        tableHeaderCellStyle({row,column,rowIndex, columnIndex}){
+            return "padding:4px 0px;fontSize:12px;color:#000;background:#ecf5ff"
+        },
+        // 多选选择的数据
+        handleSelectionChange(arr){
+            this.$emit('handleSelectionChange',arr)
+        },
+        // 监听点击表格事件
+        rowClick(row, column, event) {
+            let refsElTable = this.$refs.tableRef; // 获取表格对象
+            if (this.CtrlDown) {
+                refsElTable.toggleRowSelection(row); // ctrl多选 如果点击两次同样会取消选中
+                return;
+            }
+            if ( this.shiftOrAltDown && this.handleSelectionData.length > 0) {
+                // 通过rowIndex判断已选择的行中最上面和最下面的是哪行,再对比按住shift/alt点击的当前行得到新的最上面和最下面的行,把这两行中间的行进行循环选中。
+                let topAndBottom = this.getTopAndBottom(  row, this.bottomSelectionRow, this.topSelectionRow );
+                refsElTable.clearSelection(); //先清空 不然会导致在这两行中间之外的行状态不变
+                for (let index = topAndBottom.top; index <= topAndBottom.bottom; index++) { //选中两行之间的所有行
+                    refsElTable.toggleRowSelection(this.tableData[index], true);
+                }
+            } else {
+                let findRow = this.handleSelectionData.find(c => c.rowIndex == row.rowIndex); //找出当前选中行
+                //如果只有一行且点击的也是这一行则取消选择 否则清空再选中当前点击行
+                if (findRow&& this.handleSelectionData.length === 1 ) {
+                    refsElTable.toggleRowSelection(row, false);
+                    return;
+                }
+                // refsElTable.clearSelection(); // 清空之前选择的数据(如果放开,选择之前会变成单选)
+                refsElTable.toggleRowSelection(row); // 调用选中行方法
+            }
+        },
+        // 行的 style 的回调方法
+        rowStyle({row,rowIndex}) {
+            // 直接在一个对象上定义一个新属性,或者修改一个对象的现有属性,并返回此对象
+            // object: 要添加或者修改属性的目标对象;prop: 要定义或修改属性的名称;descript: 是一个对象,里面是我们上述的对象属性的特性;
+            Object.defineProperty(row, 'rowIndex', { //给每一行添加不可枚举属性rowIndex来标识当前行
+                value: rowIndex, // 设置age的值,不设置的话默认为undefined
+                writable: true, // 表示属性的值true可以修改,false不可以被修改
+                enumerable: false, // 设置为false表示不能通过 for-in 循环返回
+                // configurable: false, // configurable 设置为 false,意味着这个属性不能从对象上删除
+            })
+        },
+        keyDown(event) {
+            let key = event.keyCode;
+            if (key == 17) this.CtrlDown = true;
+            if (key == 16 || key == 18) this.shiftOrAltDown = true;
+        },
+        keyUp(event) {
+            let key = event.keyCode;
+            if (key == 17) this.CtrlDown = false;
+            if (key == 16 || key == 18) this.shiftOrAltDown = false;
+        },
+        // 文章说明 https://www.jianshu.com/p/48f2c522d2a2
+        getTopAndBottom(row, bottom, top){
+            let n = row.rowIndex,
+                mx = bottom.rowIndex,
+                mi = top.rowIndex;
+            if (n > mx) {
+                return {
+                    top: mi,
+                    bottom: n
+                };
+            } else if (n < mx && n > mi) {
+                return {
+                    top: mi,
+                    bottom: n
+                };
+            } else if (n < mi) {
+                return {
+                    top: n,
+                    bottom: mx
+                };
+            } else if (n == mi || n == mx) {
+                return {
+                    top: mi,
+                    bottom: mx
+                };
+            }
+        },
+        // 给选中行加上current-row这个class类,所以要使用row-class-name这个属性(其实给每一行添加rowIndex也可以用这个属性),
+        // 判断方式也是通过判断rowIndex对比
+        rowClassName({ row,  rowIndex }) {
+            let rowName = "",
+                findRow = this.handleSelectionData.find(c => c.rowIndex === row.rowIndex);
+            if (findRow) {
+                rowName = "current-row "; // elementUI 默认高亮行的class类 不用再样式了^-^,也可通过css覆盖改变背景颜色
+            }
+            return rowName; //也可以再加上其他类名 如果有需求的话
+        },
+    },
+    mounted() {
+        // 按住ctrl实现多选 设置监听keydown事件,以及keyup事件,
+        addEventListener("keydown", this.keyDown, false);
+        addEventListener("keyup", this.keyUp, false);
+    },
+    beforeDestroy() { //解绑
+        removeEventListener("keydown", this.keyDown);
+        removeEventListener("keyup", this.keyUp);
+    },
+    computed: { //实时得到最上行和最下行
+        bottomSelectionRow() {
+            if (this.handleSelectionData.length == 0) return null;
+            return this.handleSelectionData.reduce((start, end) => {
+                return start.rowIndex > end.rowIndex ? start : end;
+            });
+        },
+        topSelectionRow() {
+            if (this.handleSelectionData.length == 0) return null;
+            return this.handleSelectionData.reduce((start, end) => {
+                return start.rowIndex < end.rowIndex ? start : end;
+            });
+        }
+    },
+  };
+</script>
+
+<style scoped>
+
+</style>

+ 51 - 63
src/views/iosBasicData/fininvoicesApplyfor/assembly/fininvoicesitems.vue

@@ -36,21 +36,27 @@
                 label="费用名称">
             </el-table-column>
             <el-table-column
-                prop="currentAmount"
-                label="本次发票金额USD" width="120px">
+                prop="currentAmountCNY"
+                label="本次CNY" width="100px">
                 <template slot-scope="{row}">
-                    <el-input style="width: 100%;" v-model="row.currentAmount"
-                              size="mini" autocomplete="off" @input=""
+                    <el-input style="width: 100%;" v-model="row.currentAmountCNY" v-if="!editSave"
+                              size="mini" autocomplete="off" :disabled="row.currentCurCode != 'CNY'"
                               clearable placeholder="请输入本次发票金额" >
                     </el-input>
+                    <span v-else>{{row.currentAmountCNY}}</span>
                 </template>
             </el-table-column>
             <el-table-column
-                prop="currentAmountLoc"
-                label="本次发票金额CNY" width="120px">
+                prop="currentAmountUSD"
+                label="本次USD" width="100px">
+                <template slot-scope="{row}">
+                    <el-input style="width: 100%;" v-model="row.currentAmountUSD" v-if="!editSave"
+                              size="mini" autocomplete="off" :disabled="row.currentCurCode != 'USD'"
+                              clearable placeholder="请输入本次发票金额" >
+                    </el-input>
+                    <span v-else>{{row.currentAmountUSD}}</span>
+                </template>
             </el-table-column>
-
-
             <el-table-column
                 prop="billNo"
                 label="JOB NO">
@@ -58,59 +64,13 @@
                     <span class="textHide">{{row.billNo}}</span>
                 </template>
             </el-table-column>
-            <!--<el-table-column-->
-            <!--    prop="amount"-->
-            <!--    label="账单金额">-->
-            <!--</el-table-column>-->
-            <!--<el-table-column-->
-            <!--    prop="currentCurCode"-->
-            <!--    label="本次发票币种" width="120px">-->
-            <!--    <template slot-scope="{row}">-->
-            <!--        <search-query :datalist="curCodeData"-->
-            <!--                      :selectValue="row.currentCurCode"-->
-            <!--                      :filterable="true"-->
-            <!--                      :clearable="true"-->
-            <!--                      :remote="true"-->
-            <!--                      :buttonIf="false"-->
-            <!--                      :forParameter="{key:'id',label:'code',value:'code'}"-->
-            <!--                      @remoteMethod="getRateListfun"-->
-            <!--                      @corpChange="corpChange($event,row)"-->
-            <!--                      @corpFocus="getRateListfun">-->
-            <!--        </search-query>-->
-            <!--    </template>-->
-            <!--</el-table-column>-->
-            <!--<el-table-column-->
-            <!--    prop="currentExrate"-->
-            <!--    label="本次发票汇率" width="100px">-->
-            <!--</el-table-column>-->
-            <!--<el-table-column-->
-            <!--    prop="currentTaxRate"-->
-            <!--    label="本次发票税率" width="100px">-->
-            <!--    <template slot-scope="{row}">-->
-            <!--        <el-input style="width: 100%;" v-model="row.currentTaxRate"-->
-            <!--                  size="mini" autocomplete="off"-->
-            <!--                  clearable placeholder="请输入本次发票税率" @input="currentInput" >-->
-            <!--        </el-input>-->
-            <!--    </template>-->
-            <!--</el-table-column>-->
-            <!--<el-table-column-->
-            <!--    prop="currentSurRate"-->
-            <!--    label="本次发票附加税率" width="120px">-->
-            <!--    <template slot-scope="{row}">-->
-            <!--        <el-input style="width: 100%;" v-model="row.currentSurRate"-->
-            <!--                  size="mini" autocomplete="off"-->
-            <!--                  clearable placeholder="请输入本次发票附加税率" @input="currentInput(row)" >-->
-            <!--        </el-input>-->
-            <!--    </template>-->
-            <!--</el-table-column>-->
-            <!--<el-table-column-->
-            <!--    prop="currentAmountTax"-->
-            <!--    label="税额">-->
-            <!--</el-table-column>-->
-            <!--<el-table-column-->
-            <!--    prop="currentAmountNet"-->
-            <!--    label="去税金额">-->
-            <!--</el-table-column>-->
+            <el-table-column
+                prop="bookingNo"
+                label="BOOKINGNO" width="120px">
+                <template slot-scope="{row}">
+                    <span class="textHide">{{row.bookingNo}}</span>
+                </template>
+            </el-table-column>
             <el-table-column
                 prop="corpCnName"
                 label="客户中文名称" width="140px">
@@ -118,7 +78,6 @@
                     <span class="textHide">{{row.corpCnName}}</span>
                 </template>
             </el-table-column>
-
             <el-table-column
                 prop="accBillNo"
                 label="账单编号">
@@ -126,6 +85,31 @@
                     <span class="textHide">{{row.accBillNo}}</span>
                 </template>
             </el-table-column>
+            <el-table-column
+                prop="amount"
+                label="账单金额">
+            </el-table-column>
+            <el-table-column
+                prop="currentCurCode"
+                label="本次发票币种" width="120px">
+                <!--<template slot-scope="{row}">-->
+                <!--    <search-query :datalist="curCodeData"-->
+                <!--                  :selectValue="row.currentCurCode"-->
+                <!--                  :filterable="true"-->
+                <!--                  :clearable="true"-->
+                <!--                  :remote="true"-->
+                <!--                  :buttonIf="false"-->
+                <!--                  :forParameter="{key:'id',label:'code',value:'code'}"-->
+                <!--                  @remoteMethod="getRateListfun"-->
+                <!--                  @corpChange="corpChange($event,row)"-->
+                <!--                  @corpFocus="getRateListfun">-->
+                <!--    </search-query>-->
+                <!--</template>-->
+            </el-table-column>
+            <el-table-column
+                prop="currentExrate"
+                label="本次发票汇率" width="100px">
+            </el-table-column>
 
             <el-table-column
                 prop="remarks"
@@ -157,7 +141,11 @@
             handleSelectionData:{
                 type:Array,
                 default:[],
-            }
+            },
+            editSave:{
+                type:Boolean,
+                default:false,
+            },
         },
         data(){
             return {

+ 181 - 47
src/views/iosBasicData/fininvoicesApplyfor/fininvoicesDetails.vue

@@ -22,7 +22,7 @@
             </div>
         </div>
         <div style="margin: 55px 5px 0px 5px;'">
-            <el-form :model="form" ref="form" label-width="90px" class="demo-ruleForm">
+            <el-form :model="form" ref="form" :rules="rules" label-width="90px" class="demo-ruleForm">
                 <trade-card title="基础信息" styleIocup="color:#4b9fe9">
                     <el-row>
                         <el-col :span="10">
@@ -43,7 +43,7 @@
                                                             style="width: 100%;"
                                                             type="date" size="small"
                                                             :disabled="true"
-                                                            value-format="yyyy-MM-dd HH:mm:ss"
+                                                            value-format="yyyy-MM-dd"
                                                             placeholder="选择开票日期">
                                             </el-date-picker>
                                         </el-form-item>
@@ -276,7 +276,7 @@
                                                             style="width: 100%;"
                                                             type="date" size="small"
                                                             :disabled="editSave"
-                                                            value-format="yyyy-MM-dd HH:mm:ss"
+                                                            value-format="yyyy-MM-dd"
                                                             placeholder="选择开票日期">
                                             </el-date-picker>
                                         </el-form-item>
@@ -488,25 +488,27 @@
                     </el-row>
                 </trade-card>
                 <el-card style="margin-top: 10px">
-                    <div style="margin-bottom: 10px;display: flex;justify-content: space-between">
-                        <el-button size="small" type="danger" >删 除</el-button>
-                        <!--<div>-->
-                        <!--    <el-button size="small" type="primary">新 建</el-button>-->
-                        <!--    <el-button size="small" type="danger">删 除</el-button>-->
-                        <!--</div>-->
-                        <!--<div>-->
-                        <!--    <el-button size="small" type="primary" plain>全部选择</el-button>-->
-                        <!--    <el-button size="small" type="primary" plain>确认费用</el-button>-->
-                        <!--</div>-->
-                    </div>
-                    <fininvoicesitems :tableData="tableData"
-                                      :handleSelectionData="handleSelectionData"
-                                      @handleSelectionChange="handleSelectionChange"
-                                      @deletefun="detailsdeletionfun">
-                    </fininvoicesitems>
+                    <el-tabs v-model="detailTabs" type="card">
+                        <el-tab-pane label="费用明细" name="first">
+                            <div style="margin-bottom: 10px;display: flex;">
+                                <el-button size="small" type="primary" @click="invoicingDialogfun" >生成开票</el-button>
+                                <el-button size="small" type="danger" @click="batchDeletefun" >批量删除</el-button>
+                            </div>
+                            <fininvoicesitems :tableData="tableData"
+                                              :handleSelectionData="handleSelectionData"
+                                              :editSave="editSave"
+                                              @handleSelectionChange="handleSelectionChange"
+                                              @deletefun="detailsdeletionfun">
+                            </fininvoicesitems>
+                        </el-tab-pane>
+                        <el-tab-pane label="开票明细" name="second">
+                            <fininvoiceitemdetail :tableData="InvoicingList"
+                                                  :handleSelectionData="[]">
+                            </fininvoiceitemdetail>
+                        </el-tab-pane>
+                    </el-tabs>
                 </el-card>
-
-                <el-card class="box-card">
+                <el-card class="box-card" style="margin-top: 10px">
                     <el-row>
                         <el-col :span="5">
                             <el-form-item label="业务编号" prop="billNo">
@@ -565,13 +567,29 @@
                 </el-card>
             </el-form>
         </div>
+
+        <!--开票弹窗-->
+        <el-dialog
+            title="打印"
+            :visible.sync="InvoicingDialog"
+            append-to-body
+            width="70%"
+            :close-on-click-modal="false"
+            :destroy-on-close="true"
+            :close-on-press-escape="false"
+            v-dialog-drag>
+            <span>开票弹窗</span>
+        </el-dialog>
+
+
     </div>
 </template>
 
 <script>
 import fininvoicesitems from "@/views/iosBasicData/fininvoicesApplyfor/assembly/fininvoicesitems.vue";
+import fininvoiceitemdetail from "@/views/iosBasicData/fininvoicesApplyfor/assembly/fininvoiceitemdetail.vue";
 import {getRateList} from "@/api/iosBasicData/rateManagement";
-import {finstlbillslistAccBillV1} from "@/api/iosBasicData/finstlbills";
+import {finstlbillsitemsRemove, finstlbillslistAccBillV1} from "@/api/iosBasicData/finstlbills";
 import {bcorpsbankList, corpsinvoiceheaderList, getBcorpsList} from "@/api/iosBasicData/bcorps";
 import {bportsList} from "@/api/iosBasicData/bports";
 import SearchQuery from "@/components/iosbasic-data/searchquery.vue";
@@ -584,14 +602,17 @@ import {
 import {getWorkDicts} from "@/api/system/dictbiz";
 
 export default {
-        components:{ SearchQuery, fininvoicesitems},
+        components:{ SearchQuery, fininvoicesitems,fininvoiceitemdetail},
         data() {
             return {
+                InvoicingDialog:false, // 开票弹窗的打开和关闭
+                detailTabs:'first',
                 appendType:'检索',
                 pageLoading:false, // 全屏加载
                 saveLoading:false, // 按钮加载
                 form:{},
-                tableData:[], // 从表数据
+                tableData:[], // 费用明细数据
+                InvoicingList:[], // 开票明细数据
                 handleSelectionData:[], // 选择的数据
                 corpData:[], // 结算单位数据
                 invCorpData:[], // 开票单位
@@ -612,6 +633,20 @@ export default {
                 polData:[], // 装货港
                 invCurCodeData:[], // 发票币种
                 invTypeData:[], // 发票类型
+                rules: {
+                    corpCnName: [
+                        {required: true, message: '请输入付费对象', trigger: 'blur'},
+                    ],
+                    invoiceDate: [
+                        {required: true, message: '请输入开票日期', trigger: 'blur'},
+                    ],
+                    exrate: [
+                        {required: true, message: '请输入导入汇率', trigger: 'blur'},
+                    ],
+                    taxType: [
+                        {required: true, message: '请输入所属税种', trigger: 'blur'},
+                    ],
+                },
             }
         },
         props:{
@@ -621,6 +656,38 @@ export default {
             }
         },
         methods:{
+            invoicingDialogfun(){
+                this.InvoicingDialog = true
+            },
+            // 批量删除
+            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) {
+                        fininvoicesitemsRemove(arrIds.join(',')).then(res=>{
+                            this.$message.success('操作成功')
+                        })
+                    }
+                })
+            },
             // 单个删除
             detailsdeletionfun(id){
                 this.$confirm("确定将选择数据删除?", {
@@ -651,7 +718,24 @@ export default {
                             this.$set(this.form,'corpId',item.id)
                             this.$set(this.form,'corpCnName',item.cnName)
                             this.$set(this.form,'corpEnName',item.enName)
-                            this.bcorpsbankListfun() // 查银行数据
+                            bcorpsbankList(1,10,{pid:this.form.corpId}).then(res=>{
+                                if (res.data.data.records.length != 0) {
+                                    this.$set(this.form,'bankReceiptAccountNo',res.data.data.records[0].accountNo)
+                                    this.$set(this.form,'bankReceiptBankName',res.data.data.records[0].accountBank)
+                                }
+                            })
+                            // 带出开票单位数据
+                            corpsinvoiceheaderList(1,20,{pid:this.form.corpId}).then(res=>{
+                                if (res.data.data.records.length != 0) {
+                                    this.$set(this.form,'invCorpId',res.data.data.records[0].id)
+                                    this.$set(this.form,'invCorpCnName',res.data.data.records[0].invoiceHeader)
+                                    this.$set(this.form,'invCorpTaxNo',res.data.data.records[0].uscc) // 税号
+                                    this.$set(this.form,'invCorpAccountBankUsd',res.data.data.records[0].accountBankUsd) // 美元银行
+                                    this.$set(this.form,'invCorpAccountNoUsd',res.data.data.records[0].accountNoUsd) // 美元账户
+                                    this.$set(this.form,'invCorpAccountBankCny',res.data.data.records[0].accountBankUsd) // 人民币银行
+                                    this.$set(this.form,'invCorpAccountNoCny',res.data.data.records[0].accountNoUsd) // 人民币账户
+                                }
+                            })
                         }
                     }
                 }
@@ -702,21 +786,34 @@ export default {
             },
             // 保存按钮事件
             editCustomer(){
-                // 开票单位
-                if (!this.form.corpId) {
-                    this.$message.warning('请选择开票单位');
-                    return
-                }
-                // 进项  销项
-                this.form.type = '销项'
-                this.form.billNoFormat = 'FPSQ'
-                this.form.businessTypeCode = 'FPSQ'
-                this.form.businessTypes = this.form.businessTypes?this.form.businessTypes.join(','):''
-                if (!this.form.id) {
-                    this.form.finInvoicesItemsList = this.handleSelectionData
-                }
-                this.saveLoading = true
-                this.fininvoicesSubmitfun(this.form)
+                this.$refs.form.validate((valid) => {
+                    if (!valid) return
+                    if (!this.form.id) {
+                        // 是否选择从表数据
+                        if (this.handleSelectionData.length == 0) {
+                            this.$message.warning('请选择结算数据');
+                            return;
+                        }
+                    }
+                    this.form.type = '销项'
+                    this.form.billNoFormat = 'FPSQ'
+                    this.form.businessTypeCode = 'FPSQ'
+                    this.form.businessTypes = this.form.businessTypes?this.form.businessTypes.join(','):''
+                    //开票日期
+                    if(this.form.invoiceDate) {
+                        this.form.invoiceDate = this.form.invoiceDate.slice(0,10) + ' 00:00:00'
+                    }
+                    this.form.finInvoicesItemsList = this.handleSelectionData.map(item=>{
+                        if (item.currentCurCode == 'CNY') {
+                            item.currentAmount = item.currentAmountCNY
+                        }else {
+                            item.currentAmount = item.currentAmountUSD
+                        }
+                        return item
+                    })
+                    this.saveLoading = true
+                    this.fininvoicesSubmitfun(this.form)
+                })
             },
             // 检索
             finstlbillslistAccBillV1fun(type){
@@ -724,11 +821,13 @@ export default {
                     this.$message.warning('请选择结算单位');
                     return
                 }
-                delete this.form.id
                 let obj = {}
+                //开票日期
+                if(this.form.invoiceDate) {
+                    obj.invoiceDate = this.form.invoiceDate.slice(0,10) + ' 00:00:00'
+                }
                 obj.type = '3'
                 obj.corpCnName = this.form.corpId // 结算单位
-                obj.invoiceDate = this.form.invoiceDate //开票日期
                 obj.billNo = this.form.bookingNo // 账单号
                 obj.businessBillNo = this.form.billNo // 业务编号
                 obj.mblno = this.form.mblno // 主单编号
@@ -738,16 +837,43 @@ export default {
                 obj.curCode = this.form.curCode // 币种
                 obj.businessType = this.form.businessTypes?this.form.businessTypes.join(','):'' // 业务类型
                 finstlbillslistAccBillV1(obj).then(res=>{
-                    this.tableData = res.data.data.map((item,index)=>{
+                    let arr = res.data.data.map((item,index)=>{
                         item.lineNo = Number(index) + 1 // 行号
                         item.accBillId = item.id
                         item.accBillNo = item.billNo
                         item.accDate = item.createTime
-                        // 本次发票金额
-                        item.currentAmount = (Number(item.amount) - Number(item.stlTtlAmount) - Number(item.appliedAmount)).toFixed(2)
+                        item.currentCurCode = item.curCode
+                        item.currentExrate = item.exrate
+                        if (item.currentCurCode == 'CNY') {
+                            // 本次发票金额
+                            item.currentAmountCNY = (Number(item.amount) - Number(item.stlTtlAmount) - Number(item.appliedAmount)).toFixed(2)
+                        }else {
+                            // 本次发票金额
+                            item.currentAmountUSD = (Number(item.amount) - Number(item.stlTtlAmount) - Number(item.appliedAmount)).toFixed(2)
+                        }
                         delete item.id
                         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) {
+                            fininvoicesitemsRemove(arrIds.join(',')).then(res=>{
+                                this.$message.success('操作成功')
+                            })
+                        }
+                        this.tableData = arr
+                    }
+
                 })
             },
             // 保存接口
@@ -764,7 +890,15 @@ export default {
                 fininvoicesDetail(id).then(res=>{
                     this.form = res.data.data
                     this.form.businessTypes = this.form.businessTypes?this.form.businessTypes.split(','):[] // 业务类型转换成数组显示
-                    this.tableData = this.form.finInvoicesItemsList
+                    this.tableData = this.form.finInvoicesItemsList.map(item=>{
+                        if (item.currentCurCode == 'CNY') {
+                            item.currentAmountCNY = item.currentAmount
+                        }else {
+                            item.currentAmountUSD = item.currentAmount
+                        }
+                        return item
+                    })
+                    this.InvoicingList = this.form.finInvoiceItemDetailList
                     this.pageLoading = false
                 })
             },
@@ -894,6 +1028,6 @@ export default {
 }
 .flexBoxRight {
     flex: 3;
-    padding-bottom: 40px;
+    //padding-bottom: 40px;
 }
 </style>