Commit f35727ee authored by liudong1993's avatar liudong1993

1 机票批量制单

parent dbee8aa0
<style scoped>
/deep/.el-table th.el-table__cell {
background-color: #E6E6E6;
}
.UploadMsg-box{
display: flex;
flex-wrap: wrap;
}
.UploadMsg-list{
width: 110px;
/* height: 80px; */
position: relative;
border-radius: 3px;
/* overflow: hidden; */
margin: 0 6px 13px 6px;
}
.UploadMsg-text{
width: 100%;
height: 20px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
cursor: pointer;
}
.UploadMsg-icon{
color: #409eff;
position: absolute;
right: 0;
top: -10px;
z-index: 2;
cursor: pointer;
font-size: 20px;
}
.UploadMsgGrow{
width: 100%;
}
/deep/.UploadMsg-box .el-upload-dragger{
width: 110px;
height: 80px;
padding: 0 5px;
}
/deep/.UploadMsg-box .el-upload-dragger .el-icon-upload{
margin: 0;
}
/deep/.UploadMsg-box .el-upload__tip{
margin-top: 0;
margin-bottom: 7px;
}
/deep/.UploadMsg-box .el-upload-dragger .el-icon-upload{
line-height: 35px;
}
</style>
<template>
<div class="page_RecPayQuery">
<div class="query-box">
<el-form class="_info_box clearfix" label-width="110px">
<el-row style="padding:15px 20px 0 0;">
<el-col :span="8">
<el-form-item label="机票编号">
<el-input v-model="msg.BillIdStr" placeholder="机票编号请使用英文逗号分隔"></el-input>
</el-form-item>
</el-col>
<el-col :span="3">
<el-form-item label="预设付款对象">
<el-select
v-model="msg.ClientID" class="w150"
filterable
remote
reserve-keyword
placeholder="请输入关键字搜索"
:remote-method="GetClientAccountListByKeyWord"
>
<el-option v-for='item in ClientAccountList'
:label='`${item.AccountAlias}(${item.AccountHolder}/${item.CardNum})`'
:value='item.ID'
:key='item.ID'>
<div>
<span>{{`${item.AccountAlias}(${item.AccountHolder}/${item.CardNum})`}}</span>
<span style="margin-left: 15px;">
<el-tag size="mini" v-if="item.Status==1">{{$t('pub.fressSel')}}</el-tag>
</span>
</div>
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="3">
<el-form-item label="预设OP">
<el-select class="w150" filterable clearable v-model="msg.PlatformAccountId" :placeholder="$t('pub.pleaseSel')">
<el-option v-for="item in EmployeeList" :label="item.EmName" :value="item.EmployeeId" :key="item.EmployeeId">
</el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
</el-form>
<ul class="clearfix">
<li class="hight_query">
<button class="hollowFixedBtn" @click="getdatalist()">{{$t('pub.searchBtn')}}</button>
<input type="button" class="normalBtn" :value="$t('objFill.v101.FinancialModule.pilianscfj')" @click="openFileUpload()" />
<input type="button" class="normalBtn" value="提交制单" @click="CreateFinance()" />
</li>
</ul>
</div>
<div class="_fnDm_content" v-loading='loading'>
<el-table ref="multipleTable" :data="DataList" tooltip-effect="dark" style="width: 100%" row-key="FinanceId">
<el-table-column prop="" label="机票编号" width="100px">
<template slot-scope="scope">{{ scope.row.AirLossId }}</template>
</el-table-column>
<el-table-column prop="" label="航班号" width="100px">
<template slot-scope="scope">{{ scope.row.Flight_number }}</template>
</el-table-column>
<el-table-column prop="" label="机位数" width="100px">
<template slot-scope="scope">{{ scope.row.TicketNum }}</template>
</el-table-column>
<el-table-column prop="" label="关联团号" width="200px">
<template slot-scope="scope"><p v-for="item in scope.row.TCList">{{item}}</p></template>
</el-table-column>
<el-table-column prop="" label="已有单据" width="200px">
<template slot-scope="scope">{{ scope.row.Finance }}</template>
</el-table-column>
<el-table-column prop="" label="一定金额">
<template slot-scope="scope"><el-input v-model="scope.row.Money"></el-input></template>
</el-table-column>
<el-table-column prop="" label="备注">
<template slot-scope="scope"><el-input v-model="scope.row.Remark"></el-input></template>
</el-table-column>
<el-table-column prop="" label="指定OP">
<template slot-scope="scope">
<el-select class="w150" filterable clearable v-model="scope.row.OPPeriodsId" :placeholder="$t('pub.pleaseSel')">
<el-option label="使用预设OP" value="0" key="0"></el-option>
<el-option v-for="item in EmployeeList" :label="item.EmName" :value="item.EmployeeId" :key="item.EmployeeId">
</el-option>
</el-select>
</template>
</el-table-column>
<el-table-column prop="" label="附件">
<template slot-scope="scope">
<template v-if="scope.row.ReFinanceIds!=''">
<el-image style="width: 50px; height: 50px" :src="scope.row.ReFinanceIds" :preview-src-list="[scope.row.ReFinanceIds]"></el-image>
</template>
<template v-else>
-
</template>
</template>
</el-table-column>
</el-table>
</div>
<el-dialog :title="saveUploadMsg.length>0?$t('objFill.v101.FinancialModule.pilscfjyc')+saveUploadMsg.length:$t('objFill.v101.FinancialModule.pilianscfj')"
:visible.sync="isUploadAttachment" width="780px"
:close-on-click-modal="false"
:show-close="false" @close="cancel">
<div class="UploadMsg-box">
<div :class="[saveUploadMsg.length>0?'':'UploadMsgGrow']" style="text-align: center;">
<el-upload
class="upload-demo"
drag
accept="image/jpeg,image/jpg, image/png, image/bmp"
action=""
:http-request="uploadFileBtn"
multiple
:show-file-list="false">
<i class="el-icon-upload" style="font-size: 30px;"></i>
<div class="el-upload__text">{{$t('objFill.v101.FinancialModule.wenjtdcch')}}<em>{{$t('tips.dianjishanhcuan')}}</em></div>
<div class="el-upload__tip" slot="tip">{{$t('objFill.v101.FinancialModule.zhinscwj')}}</div>
</el-upload>
</div>
<template v-for="(item,index) in saveUploadMsg">
<div class="UploadMsg-list">
<el-image
style="width: 100%; height: 80px;border-radius: 5px;"
:src="item.DMCOPCredentials"
fit="cover"
:initial-index="index"
:preview-src-list="saveUploadMsg.map(x=>{return x.DMCOPCredentials})"></el-image>
<div class="UploadMsg-text">
<el-tooltip class="item" effect="dark" :content="item.TCID" placement="top">
<p>{{item.TCID}}</p>
</el-tooltip>
</div>
<i class="UploadMsg-icon el-icon-circle-close" @click="handleRemove(index)"></i>
</div>
</template>
</div>
<div slot="footer" class="dialog-footer">
<el-button class="hollowFixedBtn" @click="cancel" :disabled="loading">{{$t('pub.cancelBtn')}}</el-button>
<el-button class="normalBtn" type="primary" @click="saveAttachments" :loading="loading">{{$t('pub.sureBtn')}}</el-button>
</div>
</el-dialog>
<el-dialog title="制单进度" :visible.sync="showProgress" width="300px" :close-on-click-modal="false">
<div style="width:100%; text-align:center; margin-bottom:20px">
<p>共计 {{DataList.length}} 条,当前第 {{progressNum}} 条。</p>
<p>批量制单中请不要进行其他操作。</p>
</div>
</el-dialog>
</div>
</template>
<script>
export default {
data() {
return {
msg: {
BillIdStr:'',
ClientID:'',
PlatformAccountId:''
},
DataList: [],
loading: false,
ClientAccountList:[],
EmployeeList:[],
saveUploadMsg: [],
loading: false,
isUploadAttachment: false,
imgLength: 0,
showProgress:false,
progressNum:1
}
},
created() {
},
mounted() {
this.getEmployeeList();
},
methods: {
getdatalist() {
this.loading = true;
this.apipost(
"Financial_post_GetAirDepositMoneyFinanceList", this.msg,
res => {
this.loading = false;
if (res.data.resultCode == 1) {
this.DataList = res.data.data;
}
},
err => {
this.loading = false;
}
);
},
GetClientAccountListByKeyWord(query) {
if (query !== '') {
// 获取对象类型
let msg = {
Type: this.msg.ClientType,
ObjID: 0,
CardNum: "",
IsAll:true,
KeyWord:query,
};
this.apipost(
"financeinfo_post_GetClientAccountList",
msg,
res => {
if (res.data.resultCode == 1) {
let data = res.data.data;
this.ClientAccountList = data;
}
},
err => {}
);
}
},
//根据当前员工所在部门获取该部门及子部门员工信息
getEmployeeList() {
this.apipost(
"admin_get_GetEmpByDepPostNameList", {},
(res) => {
if (res.data.resultCode == 1) {
this.EmployeeList = res.data.data;
}
},
(err) => {}
);
},
openFileUpload(){
if(!(this.DataList && this.DataList.length>0)){return this.$message.error('请先输入机票编号后查询机票');}
this.isUploadAttachment=true
},
saveAttachments() {
if(this.saveUploadMsg.length==0) return this.$message.error('请上传附件');
this.saveUploadMsg.forEach(x=>{
const item = this.DataList.find(item => item.AirLossId == x.TCID);
if (item) {
item.ReFinanceIds = x.DMCOPCredentials;
}
});
this.cancel();
},
cancel() {
this.imgLength = 0
this.saveUploadMsg = []
this.isUploadAttachment = false
this.$emit('cancel')
},
uploadFileBtn(file) { //上传
// if(file.file.size > 1024 * 1024 * 10) {
// this.$message.warning(this.$t('tips.wjdxbncgsz'))
// return
// }
// 1 文档 2 数据 3 图片
if(file) this.imgLength++
let typeArr=[
{stringArr:'GIF|JPG|JPEG|PNG|BMP',type:3},
{stringArr:'DOCX|DOC|XLSX|XLS|PPT|PPTX|PDF',type:1},
]
let ft=file.file.name.substring(file.file.name.lastIndexOf('.')+1,file.file.name.length).toUpperCase();
let fileTypeNumber = 2;
let typeOk = false;
typeArr.forEach(x=>{
if(x.stringArr.indexOf(ft)!='-1')
{
fileTypeNumber=x.type;
typeOk = true;
}
})
if (!typeOk) return this.$message.error(this.$t('objFill.v101.FinancialModule.qingsct'));
let newArr = [];
newArr.push(file.file)
let path = "/Upload/RegimentAttachment/"
if(this.imgLength==1) this.$message.info(this.$t('tips.shangchuanzhong'))
this.UploadSelfFileT(path, newArr, x => {
let fileSize = file.file.size<1024? file.file.size:(file.file.size / 1024).toFixed(0);
let SourceFileName = x.data.SourceFileName.split('.')
this.saveUploadMsg.push({
DMCOPCredentials: this.domainManager().ViittoFileUrl + x.data.FilePath,
TCID: SourceFileName[0]
})
if(this.imgLength>0) this.imgLength--
if(!this.imgLength) this.$message.success(this.$t('tips.scchenggong'))
});
},
handleRemove(index) {
this.saveUploadMsg.splice(index,1)
},
CreateFinance(){
if(!(this.DataList && this.DataList.length>0)){return this.$message.error('请先查询机票');}
if(this.msg.ClientID<=0){return this.$message.error('请选择付款对象');}
if(this.msg.PlatformAccountId<=0){return this.$message.error('请选择预设OP');}
this.DataList.forEach(x=>{
if(x.Money<=0){ return this.$message.error(x.AirLossId +' 机票请输入金额');}
if(x.ReFinanceIds==''){ return this.$message.error(x.AirLossId +' 机票请上传附件');}
});
this.progressNum=1;
this.showProgress=true;
this.submitBtnClick();
},
submitBtnClick() {
if (this.progressNum && this.progressNum <= this.DataList.length) {
let x = this.DataList[this.progressNum - 1];
let OPId = x.OPPeriodsId>0?x.OPPeriodsId:this.msg.PlatformAccountId;
this.apipost("Financial_post_SetAirDepositMoneyFinance", {AirLossId:x.AirLossId,Money:x.Money,ClientID:this.msg.ClientID,OPPeriodsId:OPId,ReFinanceIds:x.ReFinanceIds,Remark:x.Remark}, res => {
if (res.data.resultCode == 1) {
this.progressNum += 1;
this.submitBtnClick();
} else {
this.$confirm(x.AirLossId +' 机票制单失败', this.$t('tips.tips'), {
confirmButtonText: this.$t('pub.sureBtn'),
cancelButtonText: this.$t('pub.cancelBtn'),
type: "warning"
})
.then(() => {
})
.catch(() => {});
}
});
} else {
this.showProgress=false;
this.DataList=[];
this.$message.success("制单成功!");
}
},
}
}
</script>
...@@ -4337,6 +4337,14 @@ export default { ...@@ -4337,6 +4337,14 @@ export default {
title: '压房明细' title: '压房明细'
}, },
}, },
{ //财务 机票定金批量制单
path: '/TicketBatchFInance',
name: 'TicketBatchFInance',
component: resolve => require(['@/components/FinancialModule/HandFee/TicketBatchFInance'], resolve),
meta: {
title: '机票定金制单'
},
},
{ //财务 财务单据 成本月结查询 { //财务 财务单据 成本月结查询
path: '/MonthlyCostStatementInquire', path: '/MonthlyCostStatementInquire',
name: 'MonthlyCostStatementInquire', name: 'MonthlyCostStatementInquire',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment