Files
income_payments_client/src/views/mailManagement/ContractMail.vue
T

264 lines
8.9 KiB
Vue

<template>
<div>
<page-header-title :img-for-icon="IconImg"></page-header-title>
<a-card :bordered="false">
<!-- 查询区域 -->
<div class="table-page-search-wrapper">
<a-form layout="inline" @keyup.enter.native="searchQuery">
<a-row :gutter="24">
<a-col :xxl="4" :xl="8" :lg="8" :md="8" :sm="24">
<a-form-item label="合同编号">
<a-input placeholder="请输入合同编号" v-model="queryParam.contractNum" :maxLength='50'></a-input>
</a-form-item>
</a-col>
<a-col :xxl="4" :xl="8" :lg="8" :md="8" :sm="24">
<a-form-item label="合同名称">
<a-input placeholder="请输入合同名称" v-model="queryParam.contractName" :maxLength='50'></a-input>
</a-form-item>
</a-col>
<a-col :xxl="4" :xl="8" :lg="8" :md="8" :sm="24">
<a-form-item label="签订单位">
<a-input placeholder="请输入签订单位" v-model="queryParam.signedCompanyTemporaryName" :maxLength='50'></a-input>
</a-form-item>
</a-col>
<a-col :xxl="4" :xl="8" :lg="8" :md="8" :sm="24">
<a-form-item label="负责人">
<select-principal v-model="queryParam.principalId" placeholder="请选择负责人"></select-principal>
</a-form-item>
</a-col>
<a-col :xxl="6" :xl="8" :lg="8" :md="8" :sm="24">
<span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
<a-button type="primary" @click="searchQuery" icon="search" v-has="'contractMail:search'">查询</a-button>
<a-button @click="searchReset" icon="reload" class="reset-button" style="margin-left: 8px">重置</a-button>
</span>
</a-col>
</a-row>
</a-form>
</div>
<!-- 查询区域-END -->
<!-- 操作按钮区域 -->
<div class="table-operator">
<a-button type="primary" icon="download" @click="handleExportXls" v-has="'contractMail:export'">导出</a-button>
</div>
<!-- table区域-begin -->
<div>
<a-table
ref="table"
size="middle"
bordered
rowKey="id"
:scroll="{x:1600}"
:columns="columns"
:dataSource="dataSource"
:pagination="ipagination"
:loading="loading"
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
class="j-table-force-nowrap"
@change="handleTableChange">
<template slot="htmlSlot" slot-scope="text, record">
<div class="primary-color" v-html="text"></div>
</template>
<template slot="text" slot-scope="text">
<j-ellipsis :value="text" :length="25"></j-ellipsis>
</template>
<span slot="print" slot-scope="text, record" class="action-span-cell">
<a-button type="primary" :disabled="record.sendMethod === '1' ? false : true" @click="goPrint(record)">打印</a-button>
</span>
<span slot="action" slot-scope="text, record" class="action-span-cell">
<a @click="handleAdd(record.id)" v-if="record.postStatus === '0'" v-has="'contractMail:mail'">邮寄</a>
<a @click="handleEdit(record)" v-if="record.postStatus === '1'" v-has="'contractMail:edit'">修改</a>
<a @click="goLogistics(record)" v-if="record.postStatus === '1'"
v-has="'contractMail:checkLogistics'">查看物流</a>
</span>
</a-table>
</div>
</a-card>
<mail-contract-modal ref="modalForm" @ok="modalFormOk"></mail-contract-modal>
</div>
</template>
<script>
import { mixinDevice } from '@/utils/mixin'
import { JeroListMixin } from '@/mixins/JeroListMixin'
import { RangeDateMixin } from '@/mixins/RangeDateMixin'
import PageHeaderTitle from '@comp/layouts/PageHeaderTitle'
import IconImg from '@/assets/imgs/icon/xin.png'
import MailContractModal from './modules/MailContractModal'
import { downloadFile } from '@/api/manage'
import SelectPrincipal from '@/components/company/SelectPrincipal'
import { checkCompanyAduit } from '../../api/incomePaymentsApi'
export default {
name: 'ContractMail',
mixins: [JeroListMixin, mixinDevice, RangeDateMixin],
components: {
PageHeaderTitle, MailContractModal, SelectPrincipal
},
data() {
return {
IconImg,
dateKeyObj: {
beginKey: 'startTime',
endKey: 'endTime'
},
filters: {
column: '',
order: ''
},
columns: [
{
title: '序号',
dataIndex: '',
key: 'rowIndex',
width: 60,
align: 'center',
customRender: function (t, r, index) {
return parseInt(index) + 1
}
},
{
title: '合同编号',
align: 'center',
width: 300,
dataIndex: 'contractNum',
scopedSlots: { customRender: 'text' }
},
{
title: '合同名称',
align: 'center',
width: 300,
dataIndex: 'contractName',
scopedSlots: { customRender: 'text' }
},
{
title: '签订单位',
align: 'center',
width: 300,
dataIndex: 'signedCompanyTemporaryName',
scopedSlots: { customRender: 'text' }
},
{
title: '负责人',
align: 'center',
width: 300,
dataIndex: 'principalName',
scopedSlots: { customRender: 'text' }
},
{
title: '合同总金额',
align: 'center',
width: 200,
dataIndex: 'contractAmount',
customRender: (text, record) => (
<j-ellipsis value={ record.contractAmount ? record.contractAmount + '元' : '0.00元' } length={ 15 }></j-ellipsis>
)
},
{
title: '邮寄联系人',
align: 'center',
width: 300,
dataIndex: 'liaisonMan',
scopedSlots: { customRender: 'text' }
},
{
title: '联系人电话',
align: 'center',
width: 200,
dataIndex: 'mobile',
scopedSlots: { customRender: 'text' }
},
{
title: '状态',
align: 'center',
width: 200,
dataIndex: 'postStatus_dictText',
scopedSlots: { customRender: 'text' }
},
{
title: '打印',
align: 'center',
width: 100,
dataIndex: '',
scopedSlots: { customRender: 'print' }
},
{
title: '操作',
align: 'center',
fixed: 'right',
width: 160,
scopedSlots: { customRender: 'action' }
}
],
url: {
list: '/payMailContract/payMailContract/list',
exportXlsUrl: '/payMailContract/payMailContract/exportXls'
}
}
},
methods: {
// 查看物流
goLogistics(record) {
const com = Number(record.sendMethod) === 1 && 'ems' || 'shunfeng'
window.open(`https://www.kuaidi100.com/chaxun?com=${ com }&nu=${ record.postNo }`)
},
/**
* 打印,新标签打开页面,打印页面
* @param record
*/
goPrint(record) {
let routerUrl = this.$router.resolve({
path: '/mailManagement/PrintPage',
query: {
record: JSON.stringify(record),
type: 'contract'
}
})
window.open(routerUrl.href, '_blank')
},
handleAdd (id) {
let param = {
id: id
}
checkCompanyAduit(param).then(res => {
if (res.success) {
// 企业审核未成功不可进行邮寄操作
if (res.result.indexOf('审核未成功') === -1) {
this.$refs.modalForm.add(id)
this.$refs.modalForm.title = '邮寄'
this.$refs.modalForm.disableSubmit = false
} else {
this.$message.warn(res.result)
}
} else {
this.$message.warn(res.message)
}
})
},
handleEdit: function (record) {
this.$refs.modalForm.edit(record)
console.log(record)
this.$refs.modalForm.title = '修改'
this.$refs.modalForm.disableSubmit = false
},
handleExportXls() {
let date = new Date()
let fileName = date.getFullYear() + '年' + (date.getMonth() + 1) + '月' + date.getDate() + '日' + date.getHours() + '时' + date.getMinutes() + '分' + date.getSeconds() + '秒票据邮寄信息'
let param = this.getQueryParams()
if (this.selectedRowKeys && this.selectedRowKeys.length > 0) {
param['ids'] = this.selectedRowKeys.join(',')
}
console.log('导出参数', param)
downloadFile(this.url.exportXlsUrl, fileName + '.xlsx', param)
}
}
}
</script>
<style scoped lang="less">
@import '~@assets/less/common.less';
</style>