123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530 |
- <template>
- <div class="borderless" v-loading="pageLoading">
- <div class="customer-head">
- <div class="customer-back">
- <el-button type="danger" style="border: none;background: none;color: red" icon="el-icon-arrow-left"
- @click="backToList">返回列表
- </el-button>
- </div>
- <div class="add-customer-btn">
- <el-button type="success" size="small" :disabled="!form.id" plain @click="newbillFun">新建发票
- </el-button>
- <el-button size="small" type="warning" plain style="margin-right: 8px" :disabled="!form.id || editPower"
- v-if="form.status == 3" :loading="saveLoading" @click="fininvoicesRevokeFinInvoicesfun">撤销开票
- </el-button>
- <el-button size="small" type="success" plain style="margin-right: 8px" :disabled="!form.id || editPower"
- v-else :loading="saveLoading" @click="submit('开票')">确认开票
- </el-button>
- <el-button size="small" type="primary" :disabled="statusType || editPower" style="margin-right: 8px"
- v-if="editSave" :loading="saveLoading" @click="editHandle">编 辑
- </el-button>
- <el-button size="small" type="primary" :disabled="statusType" style="margin-right: 8px" v-else
- :loading="saveLoading" @click="editCustomer()">保 存
- </el-button>
- </div>
- </div>
- <div style="margin: 55px 5px 0px 5px;'">
- <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">
- <div class="flexBoxLeft">
- <el-row>
- <el-col :span="12">
- <el-form-item label="发票号码" prop="invoiceNo">
- <el-input style="width: 100%;" v-model="form.invoiceNo" size="small"
- autocomplete="off" :disabled="true" clearable placeholder="发票号码">
- </el-input>
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item label="开票日期" prop="invoiceDate">
- <el-date-picker v-model="form.invoiceDate" clearable style="width: 100%;"
- type="date" size="small" :disabled="editSave" value-format="yyyy-MM-dd"
- placeholder="请选择开票日期">
- </el-date-picker>
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item label="开票单位" prop="invCorpCnName">
- <search-query :datalist="invCorpData" :selectValue="form.invCorpCnName"
- :clearable="true" :disabled="editSave || !form.corpId" :buttonIf="false"
- :remote="true" :filterable="true" placeholder="请选择开票单位"
- :forParameter="{ key: 'id', label: 'invoiceHeader', value: 'id' }"
- @corpChange="corpChange($event, 'invCorpCnName')"
- @remoteMethod="invcorpsinvoiceheaderListfun"
- @corpFocus="invcorpsinvoiceheaderListfun">
- </search-query>
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item label="收/付" prop="dc">
- <el-select v-model="form.dc" placeholder="请选择" :disabled="editSave"
- size="small">
- <el-option v-for="item in options" :key="item.value" :label="item.label"
- :value="item.value">
- </el-option>
- </el-select>
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item label="税号" prop="invCorpTaxNo">
- <el-input style="width: 100%;" v-model="form.invCorpTaxNo" size="small"
- autocomplete="off" :disabled="true" clearable placeholder="请输入税号">
- </el-input>
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item label="发票币种" prop="invCurCode">
- <search-query :datalist="invCurCodeData" :selectValue="form.invCurCode"
- :filterable="true" :clearable="true" :disabled="editSave"
- :buttonIf="false" placeholder="请选择发票币种"
- :forParameter="{ key: 'id', label: 'code', value: 'code' }"
- @corpChange="corpChange($event, 'invCurCode')"
- @corpFocus="invCurCodeRateListfun">
- </search-query>
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item label="美元银行" prop="invCorpAccountBankUsd">
- <el-input style="width: 100%;" v-model="form.invCorpAccountBankUsd"
- size="small" autocomplete="off" :disabled="true" clearable
- placeholder="请输入美元银行">
- </el-input>
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item label="美元账户" prop="invCorpAccountNoUsd">
- <el-input style="width: 100%;" v-model="form.invCorpAccountNoUsd"
- size="small" autocomplete="off" :disabled="true" clearable
- placeholder="请输入美元账户">
- </el-input>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row v-show="showForm">
- <el-col :span="12">
- <el-form-item label="人民币银行" prop="invCorpAccountBankCny">
- <el-input style="width: 100%;" v-model="form.invCorpAccountBankCny"
- size="small" autocomplete="off" :disabled="true" clearable
- placeholder="请输入美元银行">
- </el-input>
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item label="人民币账户" prop="invCorpAccountNoCny">
- <el-input style="width: 100%;" v-model="form.invCorpAccountNoCny"
- size="small" autocomplete="off" :disabled="true" clearable
- placeholder="请输入人民币账户">
- </el-input>
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item label="船名/航次" prop="vesselVoyno">
- <el-input style="width: 100%;" v-model="form.vesselVoyno" size="small"
- autocomplete="off" :disabled="editSave" clearable
- placeholder="请输入船名/航次">
- </el-input>
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item label="开航日期" prop="etd">
- <el-date-picker v-model="form.etd" clearable style="width: 100%;"
- type="date" size="small" :disabled="editSave"
- value-format="yyyy-MM-dd HH:mm:ss" placeholder="请输入开航日期">
- </el-date-picker>
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item label="装货港" prop="pol">
- <search-query :datalist="polData" :selectValue="form.pol" :filterable="true"
- :clearable="true" :remote="true" :disabled="editSave" :buttonIf="false"
- placeholder="请选择装货港"
- :forParameter="{ key: 'id', label: 'enName', value: 'enName' }"
- @corpChange="corpChange($event, 'pol')" @remoteMethod="polBportsListfun"
- @corpFocus="polBportsListfun">
- </search-query>
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item label="卸货港" prop="pod">
- <search-query :datalist="podData" :selectValue="form.pod" :filterable="true"
- :clearable="true" :remote="true" :disabled="editSave" :buttonIf="false"
- placeholder="请选择卸货港"
- :forParameter="{ key: 'id', label: 'enName', value: 'enName' }"
- @corpChange="corpChange($event, 'pod')" @remoteMethod="podBportsListfun"
- @corpFocus="podBportsListfun">
- </search-query>
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item label="目的地" prop="destination">
- <search-query :datalist="destinationData" :selectValue="form.destination"
- :filterable="true" :clearable="true" :remote="true" :disabled="editSave"
- :buttonIf="false" placeholder="请选择目的地"
- :forParameter="{ key: 'id', label: 'enName', value: 'enName' }"
- @corpChange="corpChange($event, 'destination')"
- @remoteMethod="destinationBportsListfun"
- @corpFocus="destinationBportsListfun">
- </search-query>
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item label="箱型箱量" prop="containers">
- <el-input style="width: 100%;" v-model="form.containers" size="small"
- autocomplete="off" :disabled="editSave" clearable placeholder="请输入箱型箱量">
- </el-input>
- </el-form-item>
- </el-col>
- </el-row>
- </div>
- </el-col>
- <el-col :span="14">
- <div class="flexBoxRight">
- <!--<el-row>-->
- <!-- <el-col :span="4">-->
- <!-- <el-switch-->
- <!-- v-model="form.stlMode"-->
- <!-- active-value="1"-->
- <!-- inactive-value="0"-->
- <!-- active-color="#66dd7a"-->
- <!-- inactive-color="#4ea6ea"-->
- <!-- active-text="票结"-->
- <!-- inactive-text="月结">-->
- <!-- </el-switch>-->
- <!-- </el-col>-->
- <!-- <el-col :span="6">-->
- <!-- <el-checkbox style="margin-left: 10%" size="medium" :true-label="1" :false-label="0"-->
- <!-- :disabled="editSave"-->
- <!-- v-model="form.isDk">整票(不列费用明细)-->
- <!-- </el-checkbox>-->
- <!-- </el-col>-->
- <!-- <el-col :span="5">-->
- <!-- <el-checkbox style="margin-left: 10%" size="medium" :true-label="1" :false-label="0"-->
- <!-- :disabled="editSave"-->
- <!-- v-model="form.isRp">只提取开票费用-->
- <!-- </el-checkbox>-->
- <!-- </el-col>-->
- <!-- <el-col :span="3">-->
- <!-- <el-checkbox style="margin-left: 10%" size="medium" :true-label="1" :false-label="0"-->
- <!-- :disabled="editSave"-->
- <!-- v-model="form.isExportMblno">主单号-->
- <!-- </el-checkbox>-->
- <!-- </el-col>-->
- <!-- <el-col :span="3">-->
- <!-- <el-checkbox style="margin-left: 10%" size="medium" :true-label="1" :false-label="0"-->
- <!-- :disabled="editSave"-->
- <!-- v-model="form.isExportVslvoy">船名航次-->
- <!-- </el-checkbox>-->
- <!-- </el-col>-->
- <!-- <el-col :span="3">-->
- <!-- <el-checkbox style="margin-left: 10%" size="medium" :true-label="1" :false-label="0"-->
- <!-- :disabled="editSave"-->
- <!-- v-model="form.isExportHblno">分单号-->
- <!-- </el-checkbox>-->
- <!-- </el-col>-->
- <!--</el-row>-->
- <el-row>
- <el-col :span="8">
- <el-form-item label="结算单位" prop="corpCnName">
- <search-query :datalist="corpData" :selectValue="form.corpCnName"
- :clearable="true" :disabled="editSave" :buttonIf="false" :remote="true"
- :filterable="true" placeholder="请输入结算单位"
- :forParameter="{ key: 'id', label: 'cnName', value: 'cnName' }"
- @corpChange="corpChange($event, 'corpCnName')"
- @remoteMethod="corpBcorpsListfun" @corpFocus="corpBcorpsListfun">
- </search-query>
- </el-form-item>
- </el-col>
- <el-col :span="16">
- <el-form-item label="全电发票" prop="elecRemarks">
- <el-input style="width: 100%;" v-model="form.elecRemarks" size="small"
- :autosize="{ minRows: 1, maxRows: 2 }" autocomplete="off" type="textarea"
- clearable placeholder="请输入全电发票备注">
- </el-input>
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item label="业务开始日期" prop="businessDateStart">
- <el-date-picker v-model="form.businessDateStart" clearable
- style="width: 100%;" type="date" size="small" :disabled="editSave"
- value-format="yyyy-MM-dd" placeholder="选择业务日期">
- </el-date-picker>
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item label="业务结束日期" prop="businessDateEnd">
- <el-date-picker v-model="form.businessDateEnd" clearable
- style="width: 100%;" type="date" size="small" :disabled="editSave"
- value-format="yyyy-MM-dd" placeholder="选择业务日期">
- </el-date-picker>
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item label="发票汇率" prop="exrate">
- <el-input style="width: 100%;" v-model="form.exrate" size="small"
- autocomplete="off" :disabled="editSave" clearable placeholder="请输入发票汇率">
- </el-input>
- </el-form-item>
- </el-col>
- <el-col :span="16">
- <el-form-item label="业务编号" prop="businessNo">
- <el-input style="width: 100%;" v-model="form.businessNo" size="small"
- autocomplete="off" :disabled="editSave" clearable placeholder="请输入业务编号">
- </el-input>
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item label="发票类型" prop="invType">
- <search-query :datalist="invTypeData" :selectValue="form.invType"
- :clearable="true" :disabled="editSave" :buttonIf="false"
- placeholder="请输入发票类型"
- :forParameter="{ key: 'dictKey', label: 'dictValue', value: 'dictKey' }"
- @corpChange="corpChange($event, 'invType')"
- @corpFocus="invTypeWorkDictsfun">
- </search-query>
- </el-form-item>
- </el-col>
- <el-col :span="16">
- <el-form-item label="主单编号" prop="mblno">
- <el-input style="width: 100%;" v-model="form.mblno" size="small"
- autocomplete="off" :disabled="editSave" clearable placeholder="请输入主单编号">
- </el-input>
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item label="对账单号" prop="checkNo">
- <el-input style="width: 100%;" v-model="form.checkNo" size="small"
- autocomplete="off" :disabled="editSave" clearable placeholder="请输入对账单号">
- </el-input>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row v-show="showForm">
- <el-col :span="16">
- <el-form-item label="分单编号" prop="hblno">
- <el-input style="width: 100%;" v-model="form.hblno" size="small"
- autocomplete="off" :disabled="editSave" clearable placeholder="请输入分单编号">
- </el-input>
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item label="申请单号" prop="applyNo">
- <el-input style="width: 100%;" v-model="form.applyNo" size="small"
- autocomplete="off" :disabled="editSave" clearable placeholder="请输入申请单号">
- </el-input>
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item label="BOOK NO" prop="bookingNo">
- <el-input style="width: 100%;" v-model="form.bookingNo" size="small"
- autocomplete="off" :disabled="editSave" clearable
- placeholder="请输入BOOK NO">
- </el-input>
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item label="业务类型" prop="businessTypes">
- <search-query :datalist="businessTypesData"
- :selectValue="form.businessTypes" :clearable="true" :disabled="editSave"
- :buttonIf="false" :multiple="true" :collapseTags="true"
- placeholder="请输入业务类型" @corpChange="corpChange($event, 'businessTypes')">
- </search-query>
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item label="税率(%)" prop="taxRate">
- <el-input style="width: 100%;" v-model="form.taxRate" size="small"
- autocomplete="off" :disabled="editSave" clearable placeholder="请输入税率">
- </el-input>
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item label="选择币种" prop="curCode">
- <search-query :datalist="curData" :selectValue="form.curCode"
- :filterable="true" :clearable="true" :disabled="editSave" :remote="true"
- :buttonIf="false" placeholder="请输入选择币种"
- :forParameter="{ key: 'id', label: 'code', value: 'code' }"
- @remoteMethod="getRateListfun"
- @corpChange="corpChange($event, 'curCode')" @corpFocus="getRateListfun">
- </search-query>
- </el-form-item>
- </el-col>
- <el-col :span="16">
- <el-form-item label="邮箱" prop="yx">
- <el-input style="width: 100%;" v-model="form.yx" size="small"
- autocomplete="off" :disabled="editSave" clearable placeholder="请输入邮箱">
- </el-input>
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item label="费用名称" prop="feeCnName">
- <dic-select v-model="form.feeCnName" placeholder="费用名称" key="id"
- label="cnName" url="/blade-los/bfees/listAll" :filterable="true"
- :multiple="true" :collapseTags="true" :disabled="editSave"></dic-select>
- </el-form-item>
- </el-col>
- <el-col :span="16">
- <el-form-item label="税控发票号" prop="taxInvoiceNo">
- <el-input style="width: 100%;" v-model="form.taxInvoiceNo" size="small"
- autocomplete="off" :disabled="editSave" clearable
- placeholder="请输入税控发票号">
- </el-input>
- </el-form-item>
- </el-col>
- </el-row>
- </div>
- </el-col>
- </el-row>
- <div style="display: flex;justify-content:space-between;align-items: center;">
- <div style="width: 40%;display: flex;justify-content:space-between;">
- <span>开票CNY:¥{{ form.amountCny ? form.amountCny : '0.00' }}</span>
- <span>开票USD:${{ form.amountUsd ? form.amountUsd : '0.00' }}</span>
- <span>开票合计:¥{{ form.amountLoc ? form.amountLoc : '0.00' }}</span>
- </div>
- <div style="width: 60%;display: flex;justify-content:flex-end;align-items: center;">
- <el-checkbox style="margin-left: 10%" size="medium" :true-label="1" :false-label="0"
- :disabled="editSave" v-model="form.isExchangeToCny">转换成人民币
- </el-checkbox>
- <el-checkbox v-model="appendType" :disabled="editSave" false-label="检索"
- true-label="追加">追加</el-checkbox>
- <el-button type="primary" size="small"
- :disabled="editSave || (tableData.length > 0 && appendType == '检索')" plain
- @click="finstlbillslistAccBillV1fun(appendType)">提取费用
- </el-button>
- <el-button size="small" :disabled="tableData.length > 0" @click="ResetFilter">重置条件
- </el-button>
- <el-button icon="el-icon-arrow-down" type="text" size="small" v-if="!showForm"
- @click="showForm = true">开展</el-button>
- <el-button icon="el-icon-arrow-up" type="text" size="small" v-if="showForm"
- @click="showForm = false">收缩</el-button>
- </div>
- </div>
- </trade-card>
- <el-card style="margin-top: 10px">
- <el-tabs v-model="detailTabs" type="card" @tab-click="handleClick">
- <el-tab-pane label="费用明细" name="first">
- <fininvoicesitems ref="fininvoicesitems" :tableData="tableData"
- :handleSelectionData="handleSelectionData" :editSave="editSave" :form="form"
- @handleSelectionChange="handleSelectionChange" @deletefun="detailsdeletionfun">
- <template slot="menuLeft">
- <div style="display: flex;">
- <search-query :datalist="serverData" :selectValue="form.serverName"
- :clearable="true" :buttonIf="false" :filterable="true"
- :forParameter="{ key: 'dictKey', label: 'dictValue', value: 'dictValue' }"
- placeholder="请选择开票项目" @corpChange="corpChange($event, 'serverName')"
- @corpFocus="serverWorkDictsfun">
- </search-query>
- <el-button style="margin-left: 10px" :disabled="editSave" size="small"
- type="primary" @click="invoicingfun">生成开票明细</el-button>
- <el-button style="margin-left: 10px" :disabled="editSave" size="small"
- type="warning" @click="invoicingRevokefun">撤销开票明细</el-button>
- <el-button size="small" :disabled="editSave" type="danger"
- @click="batchDeletefun">一键删除</el-button>
- <el-input style="width: 10%;margin-left: 10px;" v-model="invoiceAmountCNY"
- size="small" autocomplete="off" type="numbers" clearable placeholder="开票金额">
- <span style="line-height: 32px;" slot="suffix">CNY</span>
- </el-input>
- <el-input style="width: 10%;margin-left: 5px;" v-model="invoiceAmountUSD"
- size="small" autocomplete="off" type="numbers" clearable placeholder="开票金额">
- <span style="line-height: 32px;" slot="suffix">USD</span>
- </el-input>
- <el-button style="margin-left: 10px" :disabled="statusType" size="small"
- type="primary" @click="invoiceMatchingfun()">匹配金额</el-button>
- <span style="font-size: 18px;font-weight: 600;margin-left: 50px;">
- <span style="color: #67C23A;margin-right: 10px;">
- CNY:¥{{ amountSubSum }}元
- </span>
- <span style="color: #E6A23C;">
- USD:${{ amountSubUsdSum }}元
- </span>
- </span>
- </div>
- </template>
- </fininvoicesitems>
- </el-tab-pane>
- <el-tab-pane label="开票明细" name="second">
- <div style="margin-bottom: 10px;display: flex;">
- <el-button size="small" :disabled="editSave" type="danger"
- @click="invoicingBatchDelete">一键删除</el-button>
- <span style="font-size: 18px;font-weight: 600;margin-left: 100px;">
- <span style="color: #67C23A;">
- CNY:¥{{ amountSubSum }}元
- </span>
- </span>
- </div>
- <fininvoiceitemdetail :tableData="InvoicingList"
- :handleSelectionData="invoicingCheckboxData"
- @handleSelectionChange="invoicingCheckboxChange" @deletefun="invoiceDeletionfun"
- @savefun="invoiceSavefun">
- </fininvoiceitemdetail>
- </el-tab-pane>
- </el-tabs>
- </el-card>
- <el-card class="box-card" style="margin-top: 10px">
- <el-row>
- <el-col :span="5">
- <el-form-item label="业务编号" prop="billNo">
- <el-input style="width: 100%;" v-model="form.billNo" size="small" autocomplete="off"
- :disabled="true" clearable placeholder="请输入业务编号">
- </el-input>
- </el-form-item>
- </el-col>
- <el-col :span="5">
- <el-form-item label="单据日期" prop="billDate">
- <el-date-picker v-model="form.billDate" clearable style="width: 100%;" type="date"
- size="small" :disabled="true" value-format="yyyy-MM-dd HH:mm" placeholder="选择单据日期">
- </el-date-picker>
- </el-form-item>
- </el-col>
- <el-col :span="5">
- <el-form-item label="制单人" prop="createUserName">
- <el-input style="width: 100%;" v-model="form.createUserName" size="small"
- autocomplete="off" :disabled="true" clearable placeholder="请输入制单人">
- </el-input>
- </el-form-item>
- </el-col>
- </el-row>
- </el-card>
- </el-form>
- </div>
- <el-dialog title="选择数据" :visible.sync="retrievePopupsType" append-to-body width="70%"
- :close-on-click-modal="false">
- <div>
- <avue-crud :option="retrievePopupsOption" :data="retrievePopupsData" ref="retrievePopupsRef"
- id="out-table">
- <template slot="menu" slot-scope="{ row }">
- <el-button type="text" size="small" @click.stop="retrievePopupsSelect(row)">选择
- </el-button>
- </template>
- </avue-crud>
- </div>
- </el-dialog>
- </div>
- </template>
- <script>
- import { bcurexrateList } from "@/api/iosBasicData/rateManagement";
- 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 { finstlbillsGetByDetail, 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";
- import {
- fininvoicesDetail,
- fininvoicesSubmit,
- fininvoicesitemsRemove,
- generateFinInvoicesDetail,
- fininvoiceitemdetailRemove,
- revokeFinInvoicesDetail,
- fininvoiceitemdetailSubmit,
- fininvoicesGenerateFinInvoices,
- fininvoicesConfirmFinInvoices, fininvoicesRevokeFinInvoices
- } from "@/api/iosBasicData/fininvoices";
- import { getWorkDicts } from "@/api/system/dictbiz";
- import { getCurrentDate } from "@/util/date";
- import dicSelect from "@/components/dicSelect/main";
- import { finstlbillslistAccBillByCorp } from '@/api/iosBasicData/finstlbills';
- import { getMonthDate, getYearDate } from "@/util/date";
- export default {
- components: { SearchQuery, fininvoicesitems, fininvoiceitemdetail, dicSelect },
- data() {
- return {
- amountSubSum: 0,
- amountSubUsdSum: 0,
- options: [
- {
- value: null,
- label: '全部'
- }, {
- value: 'D',
- label: '收'
- }, {
- value: 'C',
- label: '付'
- }
- ],
- showForm: false,
- retrievePopupsType: false, // 弹窗开启关闭
- retrievePopupsData: [], // 选择弹窗数据
- retrievePopupsOption: {
- border: true,
- calcHeight: 30,
- tip: false,
- height: '500px',
- index: true,
- addBtn: false,
- viewBtn: false,
- delBtn: false,
- editBtn: false,
- refreshBtn: false,
- columnBtn: false,
- menuWidth: '60',
- header: false,
- column: [
- {
- label: "客户中文名",
- prop: "cnName",
- overHidden: true,
- },
- {
- label: "客户英文文名",
- prop: "cnName",
- overHidden: true,
- },
- ]
- },
- invoiceAmountCNY: 0, // 费用明细开票金额输入框CNY
- invoiceAmountUSD: 0, // 费用明细开票金额输入框USD
- statusType: false, // 是否确认开票
- serverData: [], // 开票项目数据
- detailTabs: 'first',
- appendType: '检索',
- pageLoading: false, // 全屏加载
- saveLoading: false, // 按钮加载
- form: {
- dc: 'D',
- invCurCode: 'CNY',
- isRp: 1,
- invType: '全电发票',
- taxRate: 0,
- isExchangeToCny: 0,
- invoiceDate: getCurrentDate(),
- },
- tableData: [], // 费用明细数据
- InvoicingList: [], // 开票明细数据
- handleSelectionData: [], // 费用明细选择的数据
- invoicingCheckboxData: [], // 开票明细选择的数据
- corpData: [], // 结算单位数据
- invCorpData: [], // 开票单位
- bankReceiptData: [], // 结算单位银行账号数据
- // 业务类型
- businessTypesData: [
- {
- label: '海运出口',
- value: 'SE'
- }, {
- label: '海运进口',
- value: 'SI'
- }
- ],
- curData: [], // 币别
- destinationData: [], // 目的港
- podData: [], // 卸货港
- polData: [], // 装货港
- invCurCodeData: [], // 发票币种
- invTypeData: [], // 发票类型
- rules: {
- corpCnName: [
- { required: true, message: '请输入付费对象', trigger: 'blur' },
- ],
- invoiceDate: [
- { required: true, message: '请输入开票日期', trigger: 'blur' },
- ],
- exrate: [
- { required: true, message: '请输入导入汇率', trigger: 'blur' },
- ],
- taxRate: [
- { required: true, message: '请输入所属税率', trigger: 'blur' },
- ],
- invCurCode: [
- { required: true, message: '请输入所属发票币别', trigger: 'blur' },
- ],
- },
- roleName: [], // 当前的角色权限
- saberUserInfo: {}, // 当前登录人信息
- editPower: false, // 当前是否可以编辑
- }
- },
- props: {
- editSave: {
- type: Boolean,
- default: false
- }
- },
- watch: {
- // 监听 状态
- "form.status": {
- // 执行方法
- handler(oldValue, newValue) {
- if (oldValue == 3) {
- this.statusType = true
- } else {
- this.statusType = false
- }
- },
- deep: true, // 深度监听
- immediate: true // 第一次改变就执行
- },
- },
- created() {
- this.roleName = localStorage.getItem('roleName').split(',')
- // 获取当前登录人个人信息
- this.saberUserInfo = JSON.parse(localStorage.getItem('saber-userInfo')).content
- if (!this.form.id) {
- bcurexrateList({ current: 1, size: 35, type: '月汇率', code: 'USD', exrateYear: getYearDate() }).then(res => {
- for (let item of res.data.data.records) {
- if (item.exrateMonth == getMonthDate()) {
- this.$set(this.form, 'exrate', item.exrateReceipts)
- }
- }
- })
- // getRateList({ current: 1, size: 30 }).then(res => {
- // for (let item of res.data.data.records) {
- // if (item.code == "USD") {
- // this.$set(this.form, 'exrate', item.exrate)
- // }
- // }
- // })
- }
- },
- methods: {
- handleClick() {
- this.amountSubSum = 0
- this.amountSubUsdSum = 0
- },
- ResetFilter() {
- this.form = {
- invCurCode: 'CNY',
- isRp: 1,
- invType: '全电发票',
- taxRate: 0,
- isExchangeToCny: 0,
- invoiceDate: getCurrentDate(),
- }
- getRateList({ current: 1, size: 30 }).then(res => {
- for (let item of res.data.data.records) {
- if (item.code == "USD") {
- this.$set(this.form, 'exrate', item.exrate)
- }
- }
- })
- },
- // 开票明细编辑完成保存
- invoiceSavefun(row) {
- row.amountRate = this.form.taxRate
- // 销售额/(1+税率)×税率
- row.amountTax = (row.amount / (1 + (Number(row.amountRate) / 100)) * (Number(row.amountRate) / 100)).toFixed(2)
- fininvoiceitemdetailSubmit(row).then(res => {
- this.$message.success('操作成功')
- this.fininvoicesDetailfun(this.form.id)
- })
- },
- // 确认开票信息
- invoicingfun() {
- if (this.handleSelectionData.length == 0) {
- this.$message.warning('请选择数据')
- return;
- }
- if (!this.form.serverName) {
- this.$message.warning('请选择开票项目')
- return
- }
- let obj = this.form
- obj.finInvoicesItemsList = []
- obj.businessTypes = this.form.businessTypes ? this.form.businessTypes.join(',') : ''
- obj.feeCnName = this.form.feeCnName ? this.form.feeCnName.join(',') : ''
- //开票日期
- if (this.form.invoiceDate) {
- obj.invoiceDate = this.form.invoiceDate.slice(0, 10) + ' 00:00:00'
- }
- // 业务日期
- if (this.form.businessDateStart) {
- obj.businessDateStart = this.form.businessDateStart.slice(0, 10) + ' 00:00:00'
- }
- if (this.form.businessDateEnd) {
- obj.businessDateEnd = this.form.businessDateEnd.slice(0, 10) + ' 00:00:00'
- }
- for (let item of this.handleSelectionData) {
- // 拿未开票的数据
- if (item.status == 0) {
- if (item.currentCurCode == 'CNY') {
- item.currentAmount = item.currentAmountCNY
- } else {
- item.currentAmount = item.currentAmountUSD
- }
- obj.finInvoicesItemsList.push(item)
- }
- }
- if (obj.finInvoicesItemsList.length == 0) {
- this.$message.warning('请选择未生成发票的数据')
- return
- }
- // 开票项目
- generateFinInvoicesDetail(obj).then(res => {
- this.$message.warning('操作成功')
- this.fininvoicesDetailfun(this.form.id)
- })
- this.detailTabs = 'second'
- },
- // 撤销开票信息
- invoicingRevokefun() {
- if (this.handleSelectionData.length == 0) {
- this.$message.warning('请选择数据')
- return;
- }
- let obj = this.form
- obj.finInvoicesItemsList = []
- obj.businessTypes = this.form.businessTypes ? this.form.businessTypes.join(',') : ''
- obj.feeCnName = this.form.feeCnName ? this.form.feeCnName.join(',') : ''
- //开票日期
- if (this.form.invoiceDate) {
- obj.invoiceDate = this.form.invoiceDate.slice(0, 10) + ' 00:00:00'
- }
- // 业务日期
- if (this.form.businessDateStart) {
- obj.businessDateStart = this.form.businessDateStart.slice(0, 10) + ' 00:00:00'
- }
- if (this.form.businessDateEnd) {
- obj.businessDateEnd = this.form.businessDateEnd.slice(0, 10) + ' 00:00:00'
- }
- for (let item of this.handleSelectionData) {
- // 拿未开票的数据
- if (item.status == 1) {
- if (item.currentCurCode == 'CNY') {
- item.currentAmount = item.currentAmountCNY
- } else {
- item.currentAmount = item.currentAmountUSD
- }
- obj.finInvoicesItemsList.push(item)
- }
- }
- if (obj.finInvoicesItemsList.length == 0) {
- this.$message.warning('请选择已生成发票的数据')
- return
- }
- // 撤销开票项目
- revokeFinInvoicesDetail(obj).then(res => {
- this.$message.warning('操作成功')
- this.fininvoicesDetailfun(this.form.id)
- })
- },
- // 费用明细开票匹配
- invoiceMatchingfun() {
- if (this.invoiceAmountCNY != 0 || this.invoiceAmountUSD != 0) {
- let dataCNY = JSON.parse(JSON.stringify(this.invoiceAmountCNY))
- let dataUSD = JSON.parse(JSON.stringify(this.invoiceAmountUSD))
- for (let item of this.tableData) {
- this.$refs.fininvoicesitems.$refs.tableRef.toggleRowSelection(item, false)
- if (this.invoiceAmountCNY != 0) {
- if (dataCNY < 0) {
- dataCNY = 0
- }
- if (dataCNY > 1500) {
- if (item.currentCurCode == 'CNY') {
- this.$set(item, 'currentAmountCNY', 1500)
- this.$refs.fininvoicesitems.$refs.tableRef.toggleRowSelection(item, true)
- dataCNY -= 1500
- }
- } else {
- if (item.currentCurCode == 'CNY') {
- if (dataCNY != 0) {
- this.$refs.fininvoicesitems.$refs.tableRef.toggleRowSelection(item, true)
- }
- this.$set(item, 'currentAmountCNY', dataCNY)
- dataCNY -= 1500
- }
- }
- }
- if (this.invoiceAmountUSD != 0) {
- if (dataUSD < 0) {
- dataUSD = 0
- }
- if (dataUSD > 1500) {
- if (item.currentCurCode == 'USD') {
- this.$set(item, 'currentAmountUSD', 1500)
- this.$refs.fininvoicesitems.$refs.tableRef.toggleRowSelection(item, true)
- dataUSD -= 1500
- }
- } else {
- if (item.currentCurCode == 'USD') {
- this.$set(item, 'currentAmountUSD', dataUSD)
- if (dataUSD != 0) {
- this.$refs.fininvoicesitems.$refs.tableRef.toggleRowSelection(item, true)
- }
- dataUSD -= 1500
- }
- }
- }
- }
- }
- },
- // 费用明细批量删除
- 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(Number(index), 1)
- }
- }
- })
- // 有id 的处理
- if (itemsWithId.length != 0) {
- fininvoicesitemsRemove(arrIds.join(',')).then(res => {
- this.$message.success('操作成功')
- })
- }
- })
- },
- // 费用明细单个删除
- detailsdeletionfun(id, index) {
- this.$confirm("确定将选择数据删除?", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning"
- }).then(() => {
- if (id) {
- fininvoicesitemsRemove(id).then(res => {
- this.$message.success('操作成功')
- })
- }
- this.tableData.splice(index, 1)
- })
- },
- // 开票批量删除
- invoicingBatchDelete() {
- if (this.invoicingCheckboxData.length == 0) {
- return this.$message.warning('请选择要删除的数据')
- }
- this.$confirm("确定将选择数据删除?", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning"
- }).then(() => {
- // 获取有id 的数据
- const itemsWithId = this.invoicingCheckboxData.filter(item => item.hasOwnProperty('id'));
- let arrIds = itemsWithId.map(item => item.id) // 获取id 数据
- // 把选中的删除掉
- this.invoicingCheckboxData.forEach((item) => {
- for (let index in this.InvoicingList) {
- if (item.id == this.InvoicingList[index].id) {
- this.InvoicingList.splice(Number(index), 1)
- }
- }
- })
- // 有id 的处理
- if (itemsWithId.length != 0) {
- fininvoiceitemdetailRemove(arrIds.join(',')).then(res => {
- this.$message.success('操作成功')
- })
- }
- })
- },
- // 开票明细单个删除
- invoiceDeletionfun(id, index) {
- this.$confirm("确定将选择数据删除?", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning"
- }).then(() => {
- if (id) {
- fininvoiceitemdetailRemove(id).then(res => {
- this.$message.success('操作成功')
- })
- }
- this.InvoicingList.splice(index, 1)
- })
- },
- // 下拉框的回调
- corpChange(value, name) {
- // 结算单位
- if (name == 'corpCnName') {
- if (!value) {
- this.$set(this.form, 'corpId', '')
- this.$set(this.form, 'corpCnName', '')
- this.$set(this.form, 'corpEnName', '')
- return
- }
- for (let item of this.corpData) {
- if (item.cnName == value) {
- this.$set(this.form, 'corpId', item.id)
- this.$set(this.form, 'corpCnName', item.cnName)
- this.$set(this.form, 'corpEnName', item.enName)
- 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) // 人民币账户
- }
- })
- }
- }
- }
- // 开票单位
- else if (name == 'invCorpCnName') {
- this.$set(this.form, 'invCorpAccountBankUsd', '')
- this.$set(this.form, 'invCorpAccountNoUsd', '')
- this.$set(this.form, 'invCorpAccountBankCny', '')
- this.$set(this.form, 'invCorpAccountNoCny', '')
- if (!value) {
- this.$set(this.form, 'invCorpId', '')
- this.$set(this.form, 'invCorpCnName', '')
- return
- }
- for (let item of this.invCorpData) {
- if (item.id == value) {
- this.$set(this.form, 'invCorpId', item.id)
- this.$set(this.form, 'invCorpCnName', item.invoiceHeader)
- this.$set(this.form, 'invCorpTaxNo', item.uscc) // 税号
- this.$set(this.form, 'invCorpAccountBankUsd', item.accountBankUsd) // 美元银行
- this.$set(this.form, 'invCorpAccountNoUsd', item.accountNoUsd) // 美元账户
- this.$set(this.form, 'invCorpAccountBankCny', item.accountBankUsd) // 人民币银行
- this.$set(this.form, 'invCorpAccountNoCny', item.accountNoUsd) // 人民币账户
- }
- }
- }
- // 结算单位银行账户
- else if (name == 'bankReceiptAccountNo') {
- for (let item of this.bankReceiptData) {
- if (item.accountNo == value) {
- this.$set(this.form, 'bankReceiptAccountNo', item.accountNo)
- this.$set(this.form, 'bankReceiptBankName', item.accountBank)
- }
- }
- }
- else {
- this.$set(this.form, name, value)
- }
- },
- // 费用明细表格多选
- handleSelectionChange(list) {
- this.amountSubSum = 0
- this.amountSubUsdSum = 0
- if (list.length) {
- list.forEach(e => {
- this.amountSubSum += Number(e.currentAmountCNY ? e.currentAmountCNY : 0)
- this.amountSubUsdSum += Number(e.currentAmountUSD ? e.currentAmountUSD : 0)
- })
- }
- this.handleSelectionData = list
- },
- // 开票明细表格多选
- invoicingCheckboxChange(list) {
- this.amountSubSum = 0
- this.amountSubUsdSum = 0
- if (list.length) {
- list.forEach(e => {
- this.amountSubSum += Number(e.amount ? e.amount : 0)
- })
- }
- this.invoicingCheckboxData = list
- },
- // 编辑事件
- editHandle() {
- this.editSave = false
- },
- newbillFun() {
- if (this.statusType) {
- this.$emit('toAddEdit')
- } else {
- this.$confirm('是否需要保存?', '提示', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: 'warning'
- }).then(() => {
- this.editCustomer('toAddEdit')
- }).catch(() => {
- this.$emit('toAddEdit')
- });
- }
- },
- submit(type) {
- this.$confirm("确定进行确认开票操作?", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning"
- }).then(() => {
- this.editCustomer(type)
- }).catch(() => {
- this.saveLoading = false
- });
- },
- // 保存按钮事件
- editCustomer(type) {
- 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 = 'XXFP'
- this.form.businessTypeCode = 'XXFP'
- this.form.businessTypes = this.form.businessTypes ? this.form.businessTypes.join(',') : ''
- this.form.feeCnName = this.form.feeCnName ? this.form.feeCnName.join(',') : ''
- //开票日期
- if (this.form.invoiceDate) {
- this.form.invoiceDate = this.form.invoiceDate.slice(0, 10) + ' 00:00:00'
- }
- // 业务日期
- if (this.form.businessDateStart) {
- this.form.businessDateStart = this.form.businessDateStart.slice(0, 10) + ' 00:00:00'
- }
- if (this.form.businessDateEnd) {
- this.form.businessDateEnd = this.form.businessDateEnd.slice(0, 10) + ' 00:00:00'
- }
- if (this.form.id) {
- this.form.finInvoicesItemsList = this.form.finInvoicesItemsList.map(item => {
- if (item.currentCurCode == 'CNY') {
- item.currentAmount = item.currentAmountCNY
- } else {
- item.currentAmount = item.currentAmountUSD
- }
- return item
- })
- } else {
- this.form.finInvoicesItemsList = this.handleSelectionData.map(item => {
- if (item.currentCurCode == 'CNY') {
- item.currentAmount = item.currentAmountCNY
- } else {
- item.currentAmount = item.currentAmountUSD
- }
- return item
- })
- }
- this.form.finInvoiceItemDetailList = this.InvoicingList
- this.saveLoading = true
- if (type == '开票') {
- fininvoicesSubmit(this.form).then(res => {
- res.data.data.businessTypes = res.data.data.businessTypes ? res.data.data.businessTypes.split(',') : []
- res.data.data.feeCnName = res.data.data.feeCnName ? res.data.data.feeCnName.split(',') : []
- this.form = res.data.data
- this.fininvoicesConfirmFinInvoicesfun()
- }).finally(() => {
- this.saveLoading = false
- });
- } else if (type == 'toAddEdit') {
- fininvoicesSubmit(this.form).then(res => {
- this.$message.success('操作成功');
- this.saveLoading = false // 关闭按钮动画
- this.$emit(type)
- }).catch(() => {
- this.saveLoading = false
- })
- } else {
- this.fininvoicesSubmitfun(this.form)
- }
- })
- },
- retrievePopupsSelect(row) {
- this.$set(this.form, 'corpId', row.id)
- this.$set(this.form, 'corpCnName', row.cnName)
- this.$set(this.form, 'corpEnName', row.enName)
- bcorpsbankList(1, 10, { pid: row.id }).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: row.id }).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) // 人民币账户
- }
- })
- this.retrievePopupsType = false
- this.finstlbillslistAccBillV1fun(this.appendType)
- },
- finstlbillslistAccBillByCorpfun() {
- let obj = {}
- if (this.form.businessDateStart) {
- obj.businessDateStart = this.form.businessDateStart.slice(0, 10) + ' 00:00:00'
- }
- if (this.form.businessDateEnd) {
- obj.businessDateEnd = this.form.businessDateEnd.slice(0, 10) + ' 00:00:00'
- }
- obj.type = '3'
- obj.billNo = this.form.businessNo // 业务编号
- obj.businessBillNo = this.form.billNo // 业务编号
- obj.mblno = this.form.mblno // 主单编号
- obj.hblno = this.form.hblno // 分单编号
- obj.bookingNo = this.form.bookingNo // 订舱号(BOOK NO)
- obj.curCode = this.form.curCode // 币种
- obj.businessType = this.form.businessTypes ? this.form.businessTypes.join(',') : '' // 业务类型
- obj.feeCnName = this.form.feeCnName ? this.form.feeCnName.join(',') : ''
- finstlbillslistAccBillByCorp(obj).then(res => {
- this.retrievePopupsType = true
- this.retrievePopupsData = res.data.data
- })
- },
- // 检索
- finstlbillslistAccBillV1fun(type) {
- if (this.form.businessNo || this.form.mblno || this.form.checkNo) {
- if (!this.form.corpId) {
- this.finstlbillslistAccBillByCorpfun()
- return
- }
- } else {
- if (!this.form.corpId) {
- this.$message.warning('请选择结算单位');
- return
- }
- }
- let obj = {}
- //开票日期
- if (this.form.invoiceDate) {
- obj.invoiceDate = this.form.invoiceDate.slice(0, 10) + ' 00:00:00'
- }
- // 业务日期
- if (this.form.businessDateStart) {
- obj.businessDateStart = this.form.businessDateStart.slice(0, 10) + ' 00:00:00'
- }
- if (this.form.businessDateEnd) {
- obj.businessDateEnd = this.form.businessDateEnd.slice(0, 10) + ' 00:00:00'
- }
- obj.type = '3'
- obj.billNo = this.form.bookingNo // 账单号
- obj.businessBillNo = this.form.businessNo // 业务编号
- obj.mblno = this.form.mblno // 主单编号
- obj.hblno = this.form.hblno // 分单编号
- obj.bookingNo = this.form.bookingNo // 订舱号(BOOK NO)
- obj.curCode = this.form.curCode // 币种
- obj.businessType = this.form.businessTypes ? this.form.businessTypes.join(',') : '' // 业务类型
- obj.feeCnName = this.form.feeCnName ? this.form.feeCnName.join(',') : ''
- obj.dc = this.form.dc
- // 判断是否有对账单号
- if (this.form.checkNo) {
- obj.corpId = this.form.corpId // 结算单位
- obj.checkNo = this.form.checkNo // CHK NO 对账单号
- // obj.dc='D'
- finstlbillsGetByDetail(obj).then(res => {
- let arr = res.data.data.finStlBillsItemsList.map((item, index) => {
- item.lineNo = Number(index) + 1 // 行号
- item.currentCurCode = item.curCode
- item.currentExrate = item.exrate
- if (item.currentCurCode == 'CNY') {
- // 本次发票金额
- item.currentAmountCNY = Number(item.appliedInvoiceCurrentAmount ? item.appliedInvoiceCurrentAmount : 0)
- item.currentAmountUSD = Number(0)
- } else {
- // 本次发票金额
- item.currentAmountUSD = Number(item.appliedInvoiceCurrentAmount ? item.appliedInvoiceCurrentAmount : 0)
- item.currentAmountCNY = Number(0)
- }
- 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) {
- finstlbillsitemsRemove(arrIds.join(',')).then(res => {
- this.$message.success('操作成功')
- })
- }
- if (arr.length == 0) {
- this.$message.warning('当前检索暂无数据!')
- }
- this.tableData = arr
- }
- })
- } else {
- obj.billNo = this.form.businessNo // 业务编号
- obj.corpCnName = this.form.corpId // 结算单位
- obj.checkBillNo = this.form.checkNo // 对账单号
- // obj.dc='D'
- finstlbillslistAccBillV1(obj).then(res => {
- let arr = res.data.data.map((item, index) => {
- console.log(item)
- item.lineNo = Number(index) + 1 // 行号
- item.accBillId = item.id
- item.accBillNo = item.billNo
- item.billNo = item.businessBillNo
- item.accDate = item.createTime
- item.currentCurCode = item.curCode
- item.currentExrate = item.exrate
- item.dc = item.accountDc
- if (item.currentCurCode == 'CNY') {
- // 本次发票金额
- item.currentAmountCNY = Number(item.appliedInvoiceCurrentAmount ? item.appliedInvoiceCurrentAmount : 0)
- item.currentAmountUSD = Number(0)
- } else {
- // 本次发票金额
- item.currentAmountUSD = Number(item.appliedInvoiceCurrentAmount ? item.appliedInvoiceCurrentAmount : 0)
- item.currentAmountCNY = Number(0)
- }
- 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('操作成功')
- })
- }
- if (arr.length == 0) {
- this.$message.warning('当前检索暂无数据!')
- }
- this.tableData = arr
- }
- })
- }
- },
- // 保存接口
- fininvoicesSubmitfun(obj) {
- fininvoicesSubmit(obj).then(res => {
- this.$message.success('操作成功');
- this.fininvoicesDetailfun(res.data.data.id)
- })
- },
- // 详情接口
- fininvoicesDetailfun(id) {
- this.pageLoading = true
- fininvoicesDetail(id).then(res => {
- this.form = res.data.data
- if (this.roleName.indexOf('admin') == -1 ? this.roleName.indexOf('允许修改他人业务') == -1 ? this.saberUserInfo.user_id != this.form.createUser : false : false) {
- this.editPower = true
- } else {
- this.editPower = false
- }
- this.form.businessTypes = this.form.businessTypes ? this.form.businessTypes.split(',') : [] // 业务类型转换成数组显示
- this.form.feeCnName = this.form.feeCnName ? this.form.feeCnName.split(',') : []
- this.tableData = this.form.finInvoicesItemsList.map(item => {
- if (item.currentCurCode == 'CNY') {
- this.$set(item, 'currentAmountCNY', Number(item.currentAmount ? item.currentAmount : 0))
- this.$set(item, 'currentAmountUSD', Number(0))
- } else {
- this.$set(item, 'currentAmountUSD', Number(item.currentAmount ? item.currentAmount : 0))
- this.$set(item, 'currentAmountCNY', Number(0))
- }
- return item
- })
- this.InvoicingList = this.form.finInvoiceItemDetailList.map(item => {
- item.edit = false
- return item
- })
- }).finally(() => {
- setTimeout(() => {
- this.saveLoading = false
- }, 1000);
- this.pageLoading = false
- })
- },
- // 开票获取数据
- fininvoicesGenerateFinInvoicesfun(billId) {
- this.pageLoading = true
- fininvoicesGenerateFinInvoices({ billId }).then(res => {
- this.form = res.data.data
- this.form.businessTypes = this.form.businessTypes ? this.form.businessTypes.split(',') : [] // 业务类型转换成数组显示
- this.form.feeCnName = this.form.feeCnName ? this.form.feeCnName.split(',') : []
- // 判断是否是数组
- if (Array.isArray(this.form.finInvoicesItemsList)) {
- this.tableData = this.form.finInvoicesItemsList.map(item => {
- if (item.currentCurCode == 'CNY') {
- item.currentAmountCNY = Number(item.currentAmount ? item.currentAmount : 0)
- item.currentAmountUSD = Number(0)
- } else {
- item.currentAmountUSD = Number(item.currentAmount ? item.currentAmount : 0)
- item.currentAmountCNY = Number(0)
- }
- return item
- })
- }
- // 判断是否是数组
- if (Array.isArray(this.form.finInvoiceItemDetailList)) {
- this.InvoicingList = this.form.finInvoiceItemDetailList.map(item => {
- item.edit = false
- return item
- })
- }
- }).finally(() => {
- this.pageLoading = false
- })
- },
- // 确认申请
- fininvoicesConfirmFinInvoicesfun() {
- this.pageLoading = true
- this.form.businessTypes = this.form.businessTypes ? this.form.businessTypes.join(',') : ''
- this.form.feeCnName = this.form.feeCnName ? this.form.feeCnName.join(',') : ''
- fininvoicesConfirmFinInvoices(this.form).then(res => {
- this.$message.success('操作成功');
- this.fininvoicesDetailfun(res.data.data.id)
- }).finally(() => {
- this.pageLoading = false
- })
- },
- // 撤销申请
- fininvoicesRevokeFinInvoicesfun() {
- this.$confirm("确定进行撤销确认发票操作?", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning"
- }).then(res => {
- this.pageLoading = true
- this.form.businessTypes = this.form.businessTypes ? this.form.businessTypes.join(',') : ''
- this.form.feeCnName = this.form.feeCnName ? this.form.feeCnName.join(',') : ''
- fininvoicesRevokeFinInvoices(this.form).then(res => {
- this.$message.success('操作成功');
- this.fininvoicesDetailfun(res.data.data.id)
- }).finally(() => {
- this.pageLoading = false
- })
- })
- },
- //返回列表
- backToList() {
- this.$emit('goBack')
- },
- // 获取客户名称数据 往来单位数据
- corpBcorpsListfun(cnName) {
- getBcorpsList(1, 10, { cnName }).then(res => {
- this.corpData = res.data.data.records
- })
- },
- // 根据往来单位选择调用获取银行数据
- bcorpsbankListfun(accountNo) {
- bcorpsbankList(1, 10, {
- // curNo:this.cntyCode,
- pid: this.form.corpId,
- accountNo: accountNo
- }).then(res => {
- this.bankReceiptData = res.data.data.records
- })
- },
- // 根据往来单位选择调用获取发票抬头数据 开票单位数据
- invcorpsinvoiceheaderListfun(cnName) {
- corpsinvoiceheaderList(1, 20, { pid: this.form.corpId, cnName }).then(res => {
- this.invCorpData = res.data.data.records
- })
- },
- // 获取币别数据
- getRateListfun(cnName) {
- getRateList({ current: 1, size: 10, cnName }).then(res => {
- this.curData = res.data.data.records
- })
- },
- // 获取发票币别数据
- invCurCodeRateListfun(cnName) {
- getRateList({ current: 1, size: 20, cnName }).then(res => {
- this.invCurCodeData = res.data.data.records
- })
- },
- // 目的地
- destinationBportsListfun(enName) {
- bportsList(1, 10, { enName }).then(res => {
- this.destinationData = res.data.data.records
- })
- },
- // 卸货港
- podBportsListfun(enName) {
- bportsList(1, 10, { enName }).then(res => {
- this.podData = res.data.data.records
- })
- },
- // 装货港
- polBportsListfun(enName) {
- bportsList(1, 10, { enName }).then(res => {
- this.polData = res.data.data.records
- })
- },
- // 发票类型字典数据
- invTypeWorkDictsfun() {
- getWorkDicts('inv_type_los').then(res => {
- this.invTypeData = res.data.data;
- })
- },
- serverWorkDictsfun() {
- getWorkDicts('Invoice_information_los').then(res => {
- this.serverData = res.data.data;
- })
- },
- },
- }
- </script>
- <style scoped>
- ::v-deep.el-form-item {
- margin-bottom: 0;
- }
- .cardBox {
- background: #fff;
- width: 100%;
- height: 100%;
- padding: 20px;
- box-sizing: border-box;
- border-radius: 4px;
- box-shadow: 0 2px 12px 0 rgba(0, 0, 0, .1);
- }
- .flexBox {
- display: flex;
- }
- .flexBoxLeft {
- flex: 2;
- margin-right: 10px;
- //padding-bottom: 40px;
- }
- .flexBoxRight {
- flex: 3;
- //padding-bottom: 40px;
- }
- </style>
|