|
@@ -65,10 +65,10 @@
|
|
|
<!-- 操作按钮区域 -->
|
|
|
<div class="table-operator">
|
|
|
<a-button @click="handleMultiAdd" type="primary" icon="plus">新增</a-button>
|
|
|
- <a-button type="primary" icon="download" @click="handleExportXls('车辆费用报销明细')">导出</a-button>
|
|
|
+ <!-- <a-button type="primary" icon="download" @click="handleExportXls('车辆费用报销明细')">导出</a-button>
|
|
|
<a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
|
|
|
<a-button type="primary" icon="import">导入</a-button>
|
|
|
- </a-upload>
|
|
|
+ </a-upload> -->
|
|
|
<a-dropdown v-if="selectedRowKeys.length > 0">
|
|
|
<a-menu slot="overlay">
|
|
|
<a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>
|
|
@@ -88,7 +88,7 @@
|
|
|
ref="table"
|
|
|
size="middle"
|
|
|
bordered
|
|
|
- rowKey="id"
|
|
|
+ rowKey="cdCarfareId"
|
|
|
:columns="columns"
|
|
|
:dataSource="dataSource"
|
|
|
:pagination="ipagination"
|
|
@@ -147,6 +147,7 @@
|
|
|
import CarfareDetailModal from './modules/CarfareDetailModal'
|
|
|
import CarfareModal from './modules/CarfareModal'
|
|
|
import JDate from '@/components/jeecg/JDate'
|
|
|
+ import { getAction } from '@api/manage'
|
|
|
|
|
|
export default {
|
|
|
name: "CarfareDetailList",
|
|
@@ -167,24 +168,53 @@
|
|
|
key:'rowIndex',
|
|
|
width:60,
|
|
|
align:"center",
|
|
|
- customRender:function (t,r,index) {
|
|
|
- return parseInt(index)+1;
|
|
|
+ customRender: (value, row, index) => {
|
|
|
+ const obj = {
|
|
|
+ children: parseInt(index)+1,
|
|
|
+ attrs: {},
|
|
|
+ };
|
|
|
+ obj.attrs.rowSpan = this.myArray[index];
|
|
|
+ return obj
|
|
|
}
|
|
|
},
|
|
|
{
|
|
|
- title:'报销日期',
|
|
|
+ title:'登记人',
|
|
|
align:"center",
|
|
|
- dataIndex: 'reimbursementDate'
|
|
|
+ dataIndex: 'registrant',
|
|
|
+ customRender: (value, row, index) => {
|
|
|
+ const obj = {
|
|
|
+ children: value,
|
|
|
+ attrs: {},
|
|
|
+ };
|
|
|
+ obj.attrs.rowSpan = this.myArray[index];
|
|
|
+ return obj
|
|
|
+ }
|
|
|
},
|
|
|
{
|
|
|
- title:'支付凭证编号',
|
|
|
+ title:'登记部门',
|
|
|
align:"center",
|
|
|
- dataIndex: 'paymentNo'
|
|
|
+ dataIndex: 'registrantDept',
|
|
|
+ customRender: (value, row, index) => {
|
|
|
+ const obj = {
|
|
|
+ children: value,
|
|
|
+ attrs: {},
|
|
|
+ };
|
|
|
+ obj.attrs.rowSpan = this.myArray[index];
|
|
|
+ return obj
|
|
|
+ }
|
|
|
},
|
|
|
{
|
|
|
- title:'车牌号',
|
|
|
+ title:'财务经办人',
|
|
|
align:"center",
|
|
|
- dataIndex: 'carNo'
|
|
|
+ dataIndex: 'financeOperator',
|
|
|
+ customRender: (value, row, index) => {
|
|
|
+ const obj = {
|
|
|
+ children: value,
|
|
|
+ attrs: {},
|
|
|
+ };
|
|
|
+ obj.attrs.rowSpan = this.myArray[index];
|
|
|
+ return obj
|
|
|
+ }
|
|
|
},
|
|
|
{
|
|
|
title:'报销人',
|
|
@@ -197,9 +227,9 @@
|
|
|
dataIndex: 'dept'
|
|
|
},
|
|
|
{
|
|
|
- title:'报销内容',
|
|
|
+ title:'报销日期',
|
|
|
align:"center",
|
|
|
- dataIndex: 'content'
|
|
|
+ dataIndex: 'reimbursementDate'
|
|
|
},
|
|
|
{
|
|
|
title:'金额',
|
|
@@ -207,56 +237,45 @@
|
|
|
dataIndex: 'amount'
|
|
|
},
|
|
|
{
|
|
|
- title:'附件',
|
|
|
- align:"center",
|
|
|
- dataIndex: 'attachment',
|
|
|
- scopedSlots: {customRender: 'fileSlot'}
|
|
|
- },
|
|
|
- {
|
|
|
- title:'备注',
|
|
|
- align:"center",
|
|
|
- dataIndex: 'remark'
|
|
|
- },
|
|
|
- {
|
|
|
- title:'登记人',
|
|
|
- align:"center",
|
|
|
- dataIndex: 'registrant'
|
|
|
- },
|
|
|
- {
|
|
|
- title:'登记部门',
|
|
|
- align:"center",
|
|
|
- dataIndex: 'registrantDept'
|
|
|
- },
|
|
|
- {
|
|
|
- title:'财务经办人',
|
|
|
- align:"center",
|
|
|
- dataIndex: 'financeOperator'
|
|
|
- },
|
|
|
- {
|
|
|
- title:'财务经办部门',
|
|
|
+ title:'支付凭证编号',
|
|
|
align:"center",
|
|
|
- dataIndex: 'financeDept'
|
|
|
+ dataIndex: 'paymentNo'
|
|
|
},
|
|
|
{
|
|
|
- title:'财务负责人',
|
|
|
+ title:'车牌号',
|
|
|
align:"center",
|
|
|
- dataIndex: 'financeHead'
|
|
|
+ dataIndex: 'carNo'
|
|
|
},
|
|
|
{
|
|
|
title: '操作',
|
|
|
dataIndex: 'action',
|
|
|
align:"center",
|
|
|
- scopedSlots: { customRender: 'action' }
|
|
|
+ customRender: (value, row, index) => {
|
|
|
+ const obj = {
|
|
|
+ children:
|
|
|
+ (
|
|
|
+ <span>
|
|
|
+ <a id="btn" onClick={() => this.handleEdit(row.cdCarfareId)}>编辑 </a>
|
|
|
+ <a-divider type="vertical" />
|
|
|
+ <a-popconfirm title="确定删除吗?" onConfirm={() => this.handleDelete(row.cdCarfareId)} placement="topRight">
|
|
|
+ <a>删除</a>
|
|
|
+ </a-popconfirm>
|
|
|
+ </span> ),
|
|
|
+ attrs: {},
|
|
|
+ };
|
|
|
+ obj.attrs.rowSpan = this.myArray[index];
|
|
|
+ return obj
|
|
|
+ }
|
|
|
}
|
|
|
],
|
|
|
url: {
|
|
|
list: "/oa/carfareDetail/list",
|
|
|
- delete: "/oa/carfareDetail/delete",
|
|
|
- deleteBatch: "/oa/carfareDetail/deleteBatch",
|
|
|
- exportXlsUrl: "/oa/carfareDetail/exportXls",
|
|
|
- importExcelUrl: "oa/carfareDetail/importExcel",
|
|
|
+ delete: "/oa/carfare/delete",
|
|
|
+ deleteBatch: "/oa/carfare/deleteBatch",
|
|
|
+ queryById: "/oa/carfare/queryById",
|
|
|
},
|
|
|
dictOptions:{},
|
|
|
+ myArray:[],
|
|
|
}
|
|
|
},
|
|
|
computed: {
|
|
@@ -271,6 +290,75 @@
|
|
|
this.$refs.multiAddModalForm.add();
|
|
|
this.$refs.multiAddModalForm.title = "新增";
|
|
|
this.$refs.multiAddModalForm.disableSubmit = false;
|
|
|
+ this.$refs.multiAddModalForm.initFinanceManager();
|
|
|
+ },
|
|
|
+ loadData(arg) {
|
|
|
+ if(!this.url.list){
|
|
|
+ this.$message.error("请设置url.list属性!")
|
|
|
+ return
|
|
|
+ }
|
|
|
+ //加载数据 若传入参数1则加载第一页的内容
|
|
|
+ if (arg === 1) {
|
|
|
+ this.ipagination.current = 1;
|
|
|
+ }
|
|
|
+ var params = this.getQueryParams();//查询条件
|
|
|
+ this.loading = true;
|
|
|
+ getAction(this.url.list, params).then((res) => {
|
|
|
+ if (res.success) {
|
|
|
+ this.dataSource = res.result.records;
|
|
|
+ this.setRowSpan(this.dataSource)
|
|
|
+ this.ipagination.total = res.result.total;
|
|
|
+ }
|
|
|
+ if(res.code===510){
|
|
|
+ this.$message.warning(res.message)
|
|
|
+ }
|
|
|
+ this.loading = false;
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 设置每一行的rowSpan
|
|
|
+ setRowSpan(data){
|
|
|
+ //保存上一个name
|
|
|
+ var x = "";
|
|
|
+ //相同name出现的次数
|
|
|
+ var count = 0;
|
|
|
+ //该name第一次出现的位置
|
|
|
+ var startindex=0;
|
|
|
+ for(var i = 0;i<data.length;i++){
|
|
|
+ console.log(data[i].cdCarfareId);
|
|
|
+ //这里是合并name列,根据各自情况大家可以自己完善
|
|
|
+ var val = data[(i)].cdCarfareId;
|
|
|
+ if(i==0){
|
|
|
+ x=val;
|
|
|
+ count=1;
|
|
|
+ this.myArray[0]=1
|
|
|
+ }else{
|
|
|
+ if(val==x){
|
|
|
+ count++;
|
|
|
+ this.myArray[startindex]=count;
|
|
|
+ this.myArray[i]=0
|
|
|
+ }else{
|
|
|
+ count = 1;
|
|
|
+ x=val;
|
|
|
+ startindex=i;
|
|
|
+ this.myArray[i]=1
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ console.log(this.myArray);
|
|
|
+ },
|
|
|
+ handleEdit: function (id) {
|
|
|
+ getAction(this.url.queryById, {id:id}).then((res) => {
|
|
|
+ if (res.success) {
|
|
|
+ let record = res.result;
|
|
|
+ this.$refs.multiAddModalForm.edit(record);
|
|
|
+ this.$refs.multiAddModalForm.title = "编辑";
|
|
|
+ this.$refs.multiAddModalForm.disableSubmit = false;
|
|
|
+ }
|
|
|
+ if(res.code===510){
|
|
|
+ this.$message.warning(res.message)
|
|
|
+ }
|
|
|
+ this.loading = false;
|
|
|
+ })
|
|
|
},
|
|
|
}
|
|
|
}
|