<template>
  <c-page title="复核夹查询">
    <el-form :model="model" :rules="rules" ref="modelForm" label-width="100px" size="mini">

        <el-col :span="12">
        <el-form-item label="经办">
            <el-input  v-model="model.trncorco.iniusr" maxlength="8"  placeholder=""></el-input>
        </el-form-item>
       </el-col>             

        <el-col :span="12">
        <el-form-item label="业务编号">
            <el-input  v-model="model.trncorco.ownref" maxlength="16"  placeholder=""></el-input>
        </el-form-item>
       </el-col>             

        <el-col :span="12">
        <el-form-item label="交易码">
            <el-input  v-model="model.atp.cod" maxlength="6"></el-input>
        </el-form-item>
       </el-col>             
 
	
        <el-col :span="12">
        <el-form-item label="交易名">
            <el-input  v-model="model.atptxt" maxlength="37"></el-input>
        </el-form-item>
       </el-col>             
 
	
        <el-col :span="6">
        <el-form-item label="查询区间">
            <el-date-picker type="date"  v-model="model.trncorco.inidatfro" style="width:100%"></el-date-picker>
        </el-form-item>
       </el-col>
	
        <el-col :span="6">
        <el-form-item label="至">
            <el-date-picker type="date"  v-model="model.trncorco.inidattil" style="width:100%"></el-date-picker>
        </el-form-item>
       </el-col>
 
        <el-col :span="12">
        <el-form-item label="复核状态">
            <el-select v-model="model.trncorco.relflg" style="width:100%">
                <el-option
                  v-for="item in codes.relflg"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value">
                </el-option>
              </el-select>
        </el-form-item>
       </el-col>

        <el-col :span="24" style="text-align:right;">
            <el-button size="small" type="primary" icon="el-icon-search" @click="onSearow">
                查询
            </el-button>
        </el-col>
        
        <el-col :span="24">
            <el-pagination
                 layout="prev, pager, next"
                 :total="pager.recpan_trnlst.total">
              </el-pagination>
            <el-table
                :data="model.recpan.trnlst"
                style="width: 100%;"
                max-height="400"
                size="mini"
                >
                <el-table-column
                  prop="ininam"
                  label="交易名称"
                  sortable
                  width="100">
                </el-table-column>
                <!-- <el-table-column
                  prop="inr"
                  label="索引"
                  v-if="show"
                  sortable
                  width="100"> 
                </el-table-column>-->
                <el-table-column
                  prop="ownref"
                  label="业务编号"
                  sortable
                  width="100">
                </el-table-column>
                <el-table-column
                  prop="iniusr"
                  label="经办柜员"
                  sortable
                  width="100">
                </el-table-column>
                <el-table-column
                  prop="reloricur"
                  label="币种"
                  sortable
                  width="100">
                </el-table-column>
                <el-table-column
                  prop="reloriamt"
                  label="金额"
                  sortable
                  width="100">
                </el-table-column>
                <el-table-column
                  prop="inidattim"
                  label="创建时间"
                  sortable
                  width="100">
                  <template slot-scope="scope">
                      {{dateFormat(scope.row.inidattim,'yyyy-MM-dd hh:mm:ss' )}}
                  </template>
                </el-table-column>
                <el-table-column
                  prop="relreq"
                  label="授权类型"
                  sortable
                  width="100">
                </el-table-column>
                <el-table-column
                  prop="relres"
                  label="授权进度"
                  sortable
                  width="100">
                </el-table-column>
                <el-table-column
                  prop="relflg"
                  label="状态"
                  sortable
                  width="100">
                  <template slot-scope="scope">
                    <span>{{ findCodeLabel(codes.oratyp,scope.row.relflg) }}</span>
                  </template>
                </el-table-column>
                <el-table-column label="操作" width="180">
                    <template slot-scope="scope">
                        <!-- <el-button size="small" type="primary"
                                @click="handleDelete(scope.$index, scope.row)">明细</el-button> -->
                        <router-link :to="{path: 'trndtl',query:{'inr':scope.row.inr}}">明细</router-link>
                        
                    </template>
                </el-table-column>
              </el-table>
       </el-col>

    </el-form>
  </c-page>
</template>
<script>
import Api from "~/service/Api"
import CodeTable from "~/config/CodeTable"
import Utils from "~/utils"

export default {
    data(){
        return {
                  codes:{
                        dsp:CodeTable.dsp,
                        busflg:CodeTable.busflg,
                        actiontype:CodeTable.actiontype,
                        cur:CodeTable.cur,
                        ptytyp:CodeTable.ptytyp,
                        staflg:CodeTable.staflg,
                        paytyp:CodeTable.paytyp,
                        payattr:CodeTable.payattr,
                        balancemode:CodeTable.balancemode,
                        bopcustype:CodeTable.bopcustype,
                        payeeattr:CodeTable.payeeattr,
                        boppaytype:CodeTable.boppaytype,
                        debcdtflg:CodeTable.debcdtflg,
                        acttyp:CodeTable.acttyp,
                        payflg:CodeTable.payflg,
                        sptsta:CodeTable.sptsta,
                        buscod:CodeTable.buscod,
                        datsrc:CodeTable.datsrc,
                        sndselflg:CodeTable.sndselflg,
                        flg:CodeTable.flg,
                        sta:CodeTable.sta,
                        relflg:CodeTable.relflg,
                        payacttyp:CodeTable.payacttyp,
                        curtxt:CodeTable.curtxt,
                        dbfmethod:CodeTable.dbfmethod,
                        bustyp:CodeTable.bustyp,
                        todo:CodeTable.todo,
                        swftyp:CodeTable.swftyp,
                        payeraccttype:CodeTable.payeraccttype,
                        oratyp:CodeTable.oratyp,
                        chato:CodeTable.chato,
                        opertype:CodeTable.opertype,
                        bopyesno:CodeTable.bopyesno,
                        custyp:CodeTable.custyp,
                        selten:CodeTable.selten,
                        dsp2:CodeTable.dsp2,
                        liqtyp:CodeTable.liqtyp,
                   },
                  model:{
						trncorco:{
							inidatfro:"",			//  查询区间		.trncorco.inidatfro
							inidattil:"",			//  Date of entry of Transaction until		.trncorco.inidattil
							ownref:"",			//  业务编号		.trncorco.ownref
							relflg:"",			//  复核状态		.trncorco.relflg
							iniusr:"",			//  Userid entering the Transaction		.trncorco.iniusr
						},
						atp:{
							cod:"",			//  Transaction  ID		.atp.cod
						},
						atptxt:"",			//  交易名		.atptxt
						recpan:{
							trnlst:[],			//  		.recpan.trnlst
							cretrs:{
								usr:"",			//  提交柜员		.recpan.cretrs.usr
								dattim:"",			//  提交时间		.recpan.cretrs.dattim
							},
							smhlst:[],			//  		.recpan.smhlst
							trslst:[],			//  		.recpan.trslst
							wfelst:[],			//  		.recpan.wfelst
							docinf:"",			//  报文信息		.recpan.docinf
						},
						trn:{
							ownref:"",			//  业务参考号		.trn.ownref
							inr:"",			//  索引		.trn.inr
							objnam:"",			//  交易描述		.trn.objnam
							reloricur:"",			//  业务币种金额		.trn.reloricur
							reloriamt:"",			//  换算金额		.trn.reloriamt
							relflg:"",			//  交易状态		.trn.relflg
							usr:"",			//  经办柜员		.trn.usr
							usg:"",			//  用户组		.trn.usg
							cortrninr:"",			//  前手流水号		.trn.cortrninr
							exedat:"",			//  执行日期		.trn.exedat
							inftxt:"",			//  意见		.trn.inftxt
							inifrm:"",			//  交易编码		.trn.inifrm
						},
				},
                  pager:{
                       "recpan_trnlst":{total:0,curIdx:0},
                       "recpan_smhlst":{total:0,curIdx:0},
                       "recpan_trslst":{total:0,curIdx:0},
                       "recpan_wfelst":{total:0,curIdx:0},
                    },
                  rules:{
                       "trncorco.iniusr":[{type: "string", required: false, len: 8, message: "输入不合法"}],
                       "trncorco.ownref":[{type: "string", required: false, len: 16, message: "输入不合法"}],
                       "atp.cod":[{type: "string", required: false, len: 6, message: "输入不合法"}],
                       "atptxt":[{type: "string", required: false, len: 37, message: "输入不合法"}],
                       "trncorco.inidatfro":[{type: "date", required: false, message: "输入正确的日期"}],
                       "trncorco.inidattil":[{type: "date", required: false, message: "输入正确的日期"}],
                       "trn.ownref":[{type: "string", required: false, len: 16, message: "输入不合法"}],
                       "trn.inr":[{type: "string", required: false, len: 8, message: "输入不合法"}],
                       "trn.objnam":[{type: "string", required: false, len: 40, message: "输入不合法"}],
                       "trn.inifrm":[{type: "string", required: false, len: 6, message: "输入不合法"}],
                       "trn.reloriamt":[{type: "number", required: false, message: "输入不合法"}],
                       "trn.usr":[{type: "string", required: false, len: 8, message: "输入不合法"}],
                       "trn.usg":[{type: "string", required: false, len: 6, message: "输入不合法"}],
                       "trn.cortrninr":[{type: "string", required: false, len: 8, message: "输入不合法"}],
                       "trn.exedat":[{type: "date", required: false, message: "输入正确的日期"}],
                       "recpan.cretrs.usr":[{type: "string", required: false, len: 8, message: "输入不合法"}],
                       "recpan.cretrs.dattim":[{type: "string", required: false, len: 8, message: "输入不合法"}],
                       "trn.inftxt":[{type: "string", required: true, len: 65, message: "输入超长"}],
                       "recpan.docinf":[{type: "string", required: true, len: 200, message: "输入超长"}],
                    }
        }
    },
    methods:{
            onSearow(){
                this.$refs.modelForm.validate(async valid => {
                    if(!valid)
                        return;
                    let rtnmsg = await Api.post("trnrel/searow",{data:Utils.flatObject(this.model)})
                    if(rtnmsg.code == SUCCESS)
                    {
                        //TODO 处理数据逻辑
                        this.model.recpan.trnlst=rtnmsg.data.recpan_trnlst
                    }
                    else
                    {
                       this.$notify.error({title: '错误',message: '服务请求失败！'});
                    }
                    //this.$notify.info('提交成功！');
                })
            },
            onDsp(){
                this.$refs.modelForm.validate(async valid => {
                    if(!valid)
                        return;
                    let rtnmsg = await Api.post("trnrel/dsp",{data:this.model})
                    if(rtnmsg.code == SUCCESS)
                    {
                        //TODO 处理数据逻辑
                                              
                    }
                    else
                    {
                       this.$notify.error({title: '错误',message: '服务请求失败！'});
                    }
                })
            },
            onRelrow(){
                this.$refs.modelForm.validate(async valid => {
                    if(!valid)
                        return;
                    let rtnmsg = await Api.post("trnrel/relrow",{data:this.model})
                    if(rtnmsg.code == SUCCESS)
                    {
                        //TODO 处理数据逻辑

                    }
                    else
                    {
                       this.$notify.error({title: '错误',message: '服务请求失败！'});
                    }
                })
            },
            onReprow(){
                this.$refs.modelForm.validate(async valid => {
                    if(!valid)
                        return;
                    let rtnmsg = await Api.post("trnrel/reprow",{data:this.model})
                    if(rtnmsg.code == SUCCESS)
                    {
                        //TODO 处理数据逻辑

                    }
                    else
                    {
                       this.$notify.error({title: '错误',message: '服务请求失败！'});
                    }
                })
            },
            onExi(){
                this.$refs.modelForm.validate(async valid => {
                    if(!valid)
                        return;
                    let rtnmsg = await Api.post("trnrel/exi",{data:this.model})
                    if(rtnmsg.code == SUCCESS)
                    {
                        //TODO 处理数据逻辑

                    }
                    else
                    {
                       this.$notify.error({title: '错误',message: '服务请求失败！'});
                    }
                })
            },
            onRecpanDet(){
                this.$refs.modelForm.validate(async valid => {
                    if(!valid)
                        return;
                    let rtnmsg = await Api.post("trnrel/recpan_det",{data:this.model})
                    if(rtnmsg.code == SUCCESS)
                    {
                        //TODO 处理数据逻辑

                    }
                    else
                    {
                       this.$notify.error({title: '错误',message: '服务请求失败！'});
                    }
                })
            },
            onRecpanButshw(){
                this.$refs.modelForm.validate(async valid => {
                    if(!valid)
                        return;
                    let rtnmsg = await Api.post("trnrel/recpan_butshw",{data:this.model})
                    if(rtnmsg.code == SUCCESS)
                    {
                        //TODO 处理数据逻辑

                    }
                    else
                    {
                       this.$notify.error({title: '错误',message: '服务请求失败！'});
                    }
                })
            },
            onRecpanInc(){
                this.$refs.modelForm.validate(async valid => {
                    if(!valid)
                        return;
                    let rtnmsg = await Api.post("trnrel/recpan_inc",{data:this.model})
                    if(rtnmsg.code == SUCCESS)
                    {
                        //TODO 处理数据逻辑

                    }
                    else
                    {
                       this.$notify.error({title: '错误',message: '服务请求失败！'});
                    }
                })
            },
            onRecpanIncall(){
                this.$refs.modelForm.validate(async valid => {
                    if(!valid)
                        return;
                    let rtnmsg = await Api.post("trnrel/recpan_incall",{data:this.model})
                    if(rtnmsg.code == SUCCESS)
                    {
                        //TODO 处理数据逻辑

                    }
                    else
                    {
                       this.$notify.error({title: '错误',message: '服务请求失败！'});
                    }
                })
            },
            onRecpanButord(){
                this.$refs.modelForm.validate(async valid => {
                    if(!valid)
                        return;
                    let rtnmsg = await Api.post("trnrel/recpan_butord",{data:this.model})
                    if(rtnmsg.code == SUCCESS)
                    {
                        //TODO 处理数据逻辑

                    }
                    else
                    {
                       this.$notify.error({title: '错误',message: '服务请求失败！'});
                    }
                })
            },
            onRecpanButspt(){
                this.$refs.modelForm.validate(async valid => {
                    if(!valid)
                        return;
                    let rtnmsg = await Api.post("trnrel/recpan_butspt",{data:this.model})
                    if(rtnmsg.code == SUCCESS)
                    {
                        //TODO 处理数据逻辑

                    }
                    else
                    {
                       this.$notify.error({title: '错误',message: '服务请求失败！'});
                    }
                })
            },
    },
    mounted:async function(){
        console.log("进入trnrel交易");
        // this.onSearow()
    }
}
</script>
<style>

</style>
