fininvoicesDetails.vue 72 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338
  1. <template>
  2. <div class="borderless" v-loading="pageLoading">
  3. <div class="customer-head">
  4. <div class="customer-back">
  5. <el-button type="danger" style="border: none;background: none;color: red" icon="el-icon-arrow-left"
  6. @click="backToList">返回列表
  7. </el-button>
  8. </div>
  9. <div class="add-customer-btn">
  10. <el-button size="small" type="warning" plain style="margin-right: 8px" :disabled="!form.id" v-if="form.status == 3"
  11. :loading="saveLoading" @click="fininvoicesRevokeFinInvoicesfun">撤销开票
  12. </el-button>
  13. <el-button size="small" type="success" plain style="margin-right: 8px" :disabled="!form.id" v-else
  14. :loading="saveLoading" @click="fininvoicesConfirmFinInvoicesfun">确认开票
  15. </el-button>
  16. <el-button size="small" type="primary" :disabled="statusType" style="margin-right: 8px" v-if="editSave"
  17. :loading="saveLoading" @click="editHandle">编 辑
  18. </el-button>
  19. <el-button size="small" type="primary" :disabled="statusType" style="margin-right: 8px" v-else
  20. :loading="saveLoading" @click="editCustomer">保 存
  21. </el-button>
  22. </div>
  23. </div>
  24. <div style="margin: 55px 5px 0px 5px;'">
  25. <el-form :model="form" ref="form" :rules="rules" label-width="90px" class="demo-ruleForm">
  26. <trade-card title="基础信息" styleIocup="color:#4b9fe9">
  27. <el-row>
  28. <el-col :span="10">
  29. <div class="flexBoxLeft">
  30. <el-row>
  31. <el-col :span="12">
  32. <el-form-item label="发票号码" prop="invoiceNo">
  33. <el-input style="width: 100%;" v-model="form.invoiceNo"
  34. size="small" autocomplete="off"
  35. :disabled="true"
  36. clearable placeholder="请输入发票号码" >
  37. </el-input>
  38. </el-form-item>
  39. </el-col>
  40. <el-col :span="12">
  41. <el-form-item label="开票日期" prop="invoiceDate">
  42. <el-date-picker v-model="form.invoiceDate" clearable
  43. style="width: 100%;"
  44. type="date" size="small"
  45. :disabled="editSave"
  46. value-format="yyyy-MM-dd"
  47. placeholder="选择开票日期">
  48. </el-date-picker>
  49. </el-form-item>
  50. </el-col>
  51. <el-col :span="24">
  52. <el-form-item label="开票单位" prop="invCorpCnName">
  53. <search-query :datalist="invCorpData"
  54. :selectValue="form.invCorpCnName"
  55. :clearable="true"
  56. :disabled="editSave || !form.corpId"
  57. :buttonIf="false"
  58. :remote="true"
  59. :filterable="true"
  60. placeholder="请选择开票单位"
  61. :forParameter="{ key:'id', label:'invoiceHeader', value:'id'}"
  62. @corpChange="corpChange($event,'invCorpCnName')"
  63. @remoteMethod="invcorpsinvoiceheaderListfun"
  64. @corpFocus="invcorpsinvoiceheaderListfun" >
  65. </search-query>
  66. </el-form-item>
  67. </el-col>
  68. <el-col :span="12">
  69. <el-form-item label="税号" prop="invCorpTaxNo">
  70. <el-input style="width: 100%;" v-model="form.invCorpTaxNo"
  71. size="small" autocomplete="off"
  72. :disabled="true"
  73. clearable placeholder="请输入税号" >
  74. </el-input>
  75. </el-form-item>
  76. </el-col>
  77. <el-col :span="12">
  78. <el-form-item label="发票币种" prop="invCurCode">
  79. <search-query :datalist="invCurCodeData"
  80. :selectValue="form.invCurCode"
  81. :filterable="true"
  82. :clearable="true"
  83. :disabled="editSave"
  84. :buttonIf="false"
  85. placeholder="请选择发票币种"
  86. :forParameter="{key:'id',label:'code',value:'code'}"
  87. @corpChange="corpChange($event,'invCurCode')"
  88. @corpFocus="invCurCodeRateListfun">
  89. </search-query>
  90. </el-form-item>
  91. </el-col>
  92. <el-col :span="12">
  93. <el-form-item label="美元银行" prop="invCorpAccountBankUsd">
  94. <el-input style="width: 100%;" v-model="form.invCorpAccountBankUsd"
  95. size="small" autocomplete="off"
  96. :disabled="true"
  97. clearable placeholder="请输入美元银行" >
  98. </el-input>
  99. </el-form-item>
  100. </el-col>
  101. <el-col :span="12">
  102. <el-form-item label="美元账户" prop="invCorpAccountNoUsd">
  103. <el-input style="width: 100%;" v-model="form.invCorpAccountNoUsd"
  104. size="small" autocomplete="off"
  105. :disabled="true"
  106. clearable placeholder="请输入美元账户" >
  107. </el-input>
  108. </el-form-item>
  109. </el-col>
  110. <el-col :span="12">
  111. <el-form-item label="人民币银行" prop="invCorpAccountBankCny">
  112. <el-input style="width: 100%;" v-model="form.invCorpAccountBankCny"
  113. size="small" autocomplete="off"
  114. :disabled="true"
  115. clearable placeholder="请输入美元银行" >
  116. </el-input>
  117. </el-form-item>
  118. </el-col>
  119. <el-col :span="12">
  120. <el-form-item label="人民币账户" prop="invCorpAccountNoCny">
  121. <el-input style="width: 100%;" v-model="form.invCorpAccountNoCny"
  122. size="small" autocomplete="off"
  123. :disabled="true"
  124. clearable placeholder="请输入人民币账户" >
  125. </el-input>
  126. </el-form-item>
  127. </el-col>
  128. <el-col :span="12">
  129. <el-form-item label="船名/航次" prop="vesselVoyno">
  130. <el-input style="width: 100%;" v-model="form.vesselVoyno"
  131. size="small" autocomplete="off"
  132. :disabled="editSave"
  133. clearable placeholder="请输入船名/航次" >
  134. </el-input>
  135. </el-form-item>
  136. </el-col>
  137. <el-col :span="12">
  138. <el-form-item label="开航日期" prop="etd">
  139. <el-date-picker v-model="form.etd" clearable
  140. style="width: 100%;"
  141. type="date" size="small"
  142. :disabled="editSave"
  143. value-format="yyyy-MM-dd HH:mm:ss"
  144. placeholder="请输入开航日期">
  145. </el-date-picker>
  146. </el-form-item>
  147. </el-col>
  148. <el-col :span="12">
  149. <el-form-item label="装货港" prop="pol">
  150. <search-query :datalist="polData"
  151. :selectValue="form.pol"
  152. :filterable="true"
  153. :clearable="true"
  154. :remote="true"
  155. :disabled="editSave"
  156. :buttonIf="false"
  157. placeholder="请输入装货港"
  158. :forParameter="{key:'id',label:'enName',value:'enName'}"
  159. @corpChange="corpChange($event,'pol')"
  160. @remoteMethod="polBportsListfun"
  161. @corpFocus="polBportsListfun" >
  162. </search-query>
  163. </el-form-item>
  164. </el-col>
  165. <el-col :span="12">
  166. <el-form-item label="卸货港" prop="pod">
  167. <search-query :datalist="podData"
  168. :selectValue="form.pod"
  169. :filterable="true"
  170. :clearable="true"
  171. :remote="true"
  172. :disabled="editSave"
  173. :buttonIf="false"
  174. placeholder="请输入卸货港"
  175. :forParameter="{key:'id',label:'enName',value:'enName'}"
  176. @corpChange="corpChange($event,'pod')"
  177. @remoteMethod="podBportsListfun"
  178. @corpFocus="podBportsListfun" >
  179. </search-query>
  180. </el-form-item>
  181. </el-col>
  182. <el-col :span="12">
  183. <el-form-item label="目的地" prop="destination">
  184. <search-query :datalist="destinationData"
  185. :selectValue="form.destination"
  186. :filterable="true"
  187. :clearable="true"
  188. :remote="true"
  189. :disabled="editSave"
  190. :buttonIf="false"
  191. placeholder="请输入目的地"
  192. :forParameter="{key:'id',label:'enName',value:'enName'}"
  193. @corpChange="corpChange($event,'destination')"
  194. @remoteMethod="destinationBportsListfun"
  195. @corpFocus="destinationBportsListfun" >
  196. </search-query>
  197. </el-form-item>
  198. </el-col>
  199. <el-col :span="12">
  200. <el-form-item label="箱型箱量" prop="containers">
  201. <el-input style="width: 100%;" v-model="form.containers"
  202. size="small" autocomplete="off"
  203. :disabled="editSave"
  204. clearable placeholder="请输入箱型箱量" >
  205. </el-input>
  206. </el-form-item>
  207. </el-col>
  208. <el-col :span="8">
  209. <el-form-item label="开票CNY:" prop="amountCny">
  210. <span>¥{{form.amountCny}}</span>
  211. </el-form-item>
  212. </el-col>
  213. <el-col :span="8">
  214. <el-form-item label="开票USD:" prop="amountUsd">
  215. <span>${{form.amountUsd}}</span>
  216. </el-form-item>
  217. </el-col>
  218. <el-col :span="8">
  219. <el-form-item label="开票合计:" prop="amountLoc">
  220. <span>¥{{form.amountLoc}}</span>
  221. </el-form-item>
  222. </el-col>
  223. </el-row>
  224. </div>
  225. </el-col>
  226. <el-col :span="14">
  227. <div class="flexBoxRight">
  228. <!--<el-row>-->
  229. <!-- <el-col :span="4">-->
  230. <!-- <el-switch-->
  231. <!-- v-model="form.stlMode"-->
  232. <!-- active-value="1"-->
  233. <!-- inactive-value="0"-->
  234. <!-- active-color="#66dd7a"-->
  235. <!-- inactive-color="#4ea6ea"-->
  236. <!-- active-text="票结"-->
  237. <!-- inactive-text="月结">-->
  238. <!-- </el-switch>-->
  239. <!-- </el-col>-->
  240. <!-- <el-col :span="6">-->
  241. <!-- <el-checkbox style="margin-left: 10%" size="medium" :true-label="1" :false-label="0"-->
  242. <!-- :disabled="editSave"-->
  243. <!-- v-model="form.isDk">整票(不列费用明细)-->
  244. <!-- </el-checkbox>-->
  245. <!-- </el-col>-->
  246. <!-- <el-col :span="5">-->
  247. <!-- <el-checkbox style="margin-left: 10%" size="medium" :true-label="1" :false-label="0"-->
  248. <!-- :disabled="editSave"-->
  249. <!-- v-model="form.isRp">只提取开票费用-->
  250. <!-- </el-checkbox>-->
  251. <!-- </el-col>-->
  252. <!-- <el-col :span="3">-->
  253. <!-- <el-checkbox style="margin-left: 10%" size="medium" :true-label="1" :false-label="0"-->
  254. <!-- :disabled="editSave"-->
  255. <!-- v-model="form.isExportMblno">主单号-->
  256. <!-- </el-checkbox>-->
  257. <!-- </el-col>-->
  258. <!-- <el-col :span="3">-->
  259. <!-- <el-checkbox style="margin-left: 10%" size="medium" :true-label="1" :false-label="0"-->
  260. <!-- :disabled="editSave"-->
  261. <!-- v-model="form.isExportVslvoy">船名航次-->
  262. <!-- </el-checkbox>-->
  263. <!-- </el-col>-->
  264. <!-- <el-col :span="3">-->
  265. <!-- <el-checkbox style="margin-left: 10%" size="medium" :true-label="1" :false-label="0"-->
  266. <!-- :disabled="editSave"-->
  267. <!-- v-model="form.isExportHblno">分单号-->
  268. <!-- </el-checkbox>-->
  269. <!-- </el-col>-->
  270. <!--</el-row>-->
  271. <el-row>
  272. <el-col :span="16">
  273. <el-form-item label="结算单位" prop="corpCnName">
  274. <search-query :datalist="corpData"
  275. :selectValue="form.corpCnName"
  276. :clearable="true"
  277. :disabled="editSave"
  278. :buttonIf="false"
  279. :remote="true"
  280. :filterable="true"
  281. placeholder="请输入结算单位"
  282. :forParameter="{ key:'id', label:'cnName', value:'cnName'}"
  283. @corpChange="corpChange($event,'corpCnName')"
  284. @remoteMethod="corpBcorpsListfun"
  285. @corpFocus="corpBcorpsListfun" >
  286. </search-query>
  287. </el-form-item>
  288. </el-col>
  289. <el-col :span="8">
  290. <el-form-item label="税控发票号" prop="taxInvoiceNo">
  291. <el-input style="width: 100%;" v-model="form.taxInvoiceNo"
  292. size="small" autocomplete="off"
  293. :disabled="editSave"
  294. clearable placeholder="请输入税控发票号" >
  295. </el-input>
  296. </el-form-item>
  297. </el-col>
  298. <el-col :span="8">
  299. <el-form-item label="业务开始日期" prop="accountDateFrom">
  300. <el-date-picker v-model="form.accountDateFrom" clearable
  301. style="width: 100%;"
  302. type="date" size="small"
  303. :disabled="editSave"
  304. value-format="yyyy-MM-dd"
  305. placeholder="选择业务日期">
  306. </el-date-picker>
  307. </el-form-item>
  308. </el-col>
  309. <el-col :span="8">
  310. <el-form-item label="业务结束日期" prop="accountDateTo">
  311. <el-date-picker v-model="form.accountDateTo" clearable
  312. style="width: 100%;"
  313. type="date" size="small"
  314. :disabled="editSave"
  315. value-format="yyyy-MM-dd"
  316. placeholder="选择业务日期">
  317. </el-date-picker>
  318. </el-form-item>
  319. </el-col>
  320. <el-col :span="8">
  321. <el-form-item label="发票汇率" prop="exrate">
  322. <el-input style="width: 100%;" v-model="form.exrate"
  323. size="small" autocomplete="off"
  324. :disabled="editSave"
  325. clearable placeholder="请输入发票汇率" >
  326. </el-input>
  327. </el-form-item>
  328. </el-col>
  329. <el-col :span="16">
  330. <el-form-item label="业务编号" prop="businessNo">
  331. <el-input style="width: 100%;" v-model="form.businessNo"
  332. size="small" autocomplete="off"
  333. :disabled="editSave"
  334. clearable placeholder="请输入业务编号" >
  335. </el-input>
  336. </el-form-item>
  337. </el-col>
  338. <el-col :span="8">
  339. <el-form-item label="发票类型" prop="invType">
  340. <search-query :datalist="invTypeData"
  341. :selectValue="form.invType"
  342. :clearable="true"
  343. :disabled="editSave"
  344. :buttonIf="false"
  345. placeholder="请输入发票类型"
  346. :forParameter="{ key:'dictKey', label:'dictValue', value:'dictKey'}"
  347. @corpChange="corpChange($event,'isInvoice')"
  348. @corpFocus="invTypeWorkDictsfun" >
  349. </search-query>
  350. </el-form-item>
  351. </el-col>
  352. <el-col :span="16">
  353. <el-form-item label="主单编号" prop="mblno">
  354. <el-input style="width: 100%;" v-model="form.mblno"
  355. size="small" autocomplete="off"
  356. :disabled="editSave"
  357. clearable placeholder="请输入主单编号" >
  358. </el-input>
  359. </el-form-item>
  360. </el-col>
  361. <el-col :span="8">
  362. <el-form-item label="对账单号" prop="checkNo">
  363. <el-input style="width: 100%;" v-model="form.checkNo"
  364. size="small" autocomplete="off"
  365. :disabled="editSave"
  366. clearable placeholder="请输入对账单号" >
  367. </el-input>
  368. </el-form-item>
  369. </el-col>
  370. <el-col :span="16">
  371. <el-form-item label="分单编号" prop="hblno">
  372. <el-input style="width: 100%;" v-model="form.hblno"
  373. size="small" autocomplete="off"
  374. :disabled="editSave"
  375. clearable placeholder="请输入分单编号" >
  376. </el-input>
  377. </el-form-item>
  378. </el-col>
  379. <el-col :span="8">
  380. <el-form-item label="申请单号" prop="applyNo">
  381. <el-input style="width: 100%;" v-model="form.applyNo"
  382. size="small" autocomplete="off"
  383. :disabled="editSave"
  384. clearable placeholder="请输入申请单号" >
  385. </el-input>
  386. </el-form-item>
  387. </el-col>
  388. <el-col :span="8">
  389. <el-form-item label="BOOK NO" prop="bookingNo">
  390. <el-input style="width: 100%;" v-model="form.bookingNo"
  391. size="small" autocomplete="off"
  392. :disabled="editSave"
  393. clearable placeholder="请输入BOOK NO" >
  394. </el-input>
  395. </el-form-item>
  396. </el-col>
  397. <el-col :span="8">
  398. <el-form-item label="业务类型" prop="businessTypes">
  399. <search-query :datalist="businessTypesData"
  400. :selectValue="form.businessTypes"
  401. :clearable="true"
  402. :disabled="editSave"
  403. :buttonIf="false"
  404. :multiple="true"
  405. :collapseTags="true"
  406. placeholder="请输入业务类型"
  407. @corpChange="corpChange($event,'businessTypes')">
  408. </search-query>
  409. </el-form-item>
  410. </el-col>
  411. <el-col :span="8">
  412. <el-form-item label="税率(%)" prop="taxRate">
  413. <el-input style="width: 100%;" v-model="form.taxRate"
  414. size="small" autocomplete="off"
  415. :disabled="editSave"
  416. clearable placeholder="请输入税率" >
  417. </el-input>
  418. </el-form-item>
  419. </el-col>
  420. <el-col :span="8">
  421. <el-form-item label="选择币种" prop="curCode">
  422. <search-query :datalist="curData"
  423. :selectValue="form.curCode"
  424. :filterable="true"
  425. :clearable="true"
  426. :disabled="editSave"
  427. :remote="true"
  428. :buttonIf="false"
  429. placeholder="请输入选择币种"
  430. :forParameter="{key:'id',label:'code',value:'code'}"
  431. @remoteMethod="getRateListfun"
  432. @corpChange="corpChange($event,'curCode')"
  433. @corpFocus="getRateListfun">
  434. </search-query>
  435. </el-form-item>
  436. </el-col>
  437. <el-col :span="16">
  438. <el-form-item label="邮箱" prop="yx">
  439. <el-input style="width: 100%;" v-model="form.yx"
  440. size="small" autocomplete="off"
  441. :disabled="editSave"
  442. clearable placeholder="请输入邮箱" >
  443. </el-input>
  444. </el-form-item>
  445. </el-col>
  446. <el-col :span="24">
  447. <el-checkbox style="margin-left: 10%" size="medium" :true-label="1" :false-label="0"
  448. :disabled="editSave"
  449. v-model="form.isExchangeToCny">转换成人民币
  450. </el-checkbox>
  451. <el-checkbox v-model="appendType" :disabled="editSave" false-label="检索" true-label="追加">追加</el-checkbox>
  452. <el-button type="primary"
  453. size="small" :disabled="editSave"
  454. plain @click="finstlbillslistAccBillV1fun(appendType)">提取费用
  455. </el-button>
  456. </el-col>
  457. <el-col :span="24">
  458. <el-form-item label="全电发票:" prop="elecRemarks">
  459. <el-input style="width: 100%;" v-model="form.elecRemarks"
  460. size="small" autocomplete="off" type="textarea"
  461. clearable placeholder="请输入全电发票备注" >
  462. </el-input>
  463. </el-form-item>
  464. </el-col>
  465. </el-row>
  466. </div>
  467. </el-col>
  468. </el-row>
  469. </trade-card>
  470. <el-card style="margin-top: 10px">
  471. <el-tabs v-model="detailTabs" type="card">
  472. <el-tab-pane label="费用明细" name="first">
  473. <div style="margin-bottom: 10px;display: flex;">
  474. <search-query :datalist="serverData"
  475. :selectValue="form.serverName"
  476. :clearable="true"
  477. :buttonIf="false"
  478. :filterable="true"
  479. :forParameter="{key:'dictKey',label:'dictValue',value:'dictValue'}"
  480. placeholder="请选择开票项目"
  481. @corpChange="corpChange($event,'serverName')"
  482. @corpFocus="serverWorkDictsfun" >
  483. </search-query>
  484. <el-button style="margin-left: 10px" :disabled="editSave" size="small" type="primary" @click="invoicingfun" >生成开票明细</el-button>
  485. <el-button style="margin-left: 10px" :disabled="editSave" size="small" type="warning" @click="invoicingRevokefun" >撤销开票明细</el-button>
  486. <el-button size="small" :disabled="editSave" type="danger" @click="batchDeletefun" >批量删除</el-button>
  487. <el-input style="width: 10%;margin-left: 10px;" v-model="invoiceAmountCNY"
  488. size="small" autocomplete="off" type="numbers"
  489. clearable placeholder="开票金额" >
  490. <span style="line-height: 32px;" slot="suffix" >CNY</span>
  491. </el-input>
  492. <el-input style="width: 10%;margin-left: 5px;" v-model="invoiceAmountUSD"
  493. size="small" autocomplete="off" type="numbers"
  494. clearable placeholder="开票金额" >
  495. <span style="line-height: 32px;" slot="suffix" >USD</span>
  496. </el-input>
  497. <el-button style="margin-left: 10px" :disabled="statusType" size="small" type="primary" @click="invoiceMatchingfun()" >匹配金额</el-button>
  498. </div>
  499. <fininvoicesitems ref="fininvoicesitems" :tableData="tableData"
  500. :handleSelectionData="handleSelectionData"
  501. :editSave="editSave"
  502. @handleSelectionChange="handleSelectionChange"
  503. @deletefun="detailsdeletionfun">
  504. </fininvoicesitems>
  505. </el-tab-pane>
  506. <el-tab-pane label="开票明细" name="second">
  507. <div style="margin-bottom: 10px;display: flex;">
  508. <el-button size="small" :disabled="editSave" type="danger" @click="invoicingBatchDelete" >批量删除</el-button>
  509. </div>
  510. <fininvoiceitemdetail :tableData="InvoicingList"
  511. :handleSelectionData="invoicingCheckboxData"
  512. @handleSelectionChange="invoicingCheckboxChange"
  513. @deletefun="invoiceDeletionfun" @savefun="invoiceSavefun">
  514. </fininvoiceitemdetail>
  515. </el-tab-pane>
  516. </el-tabs>
  517. </el-card>
  518. <el-card class="box-card" style="margin-top: 10px">
  519. <el-row>
  520. <el-col :span="5">
  521. <el-form-item label="业务编号" prop="billNo">
  522. <el-input style="width: 100%;" v-model="form.billNo"
  523. size="small" autocomplete="off"
  524. :disabled="true"
  525. clearable placeholder="请输入业务编号" >
  526. </el-input>
  527. </el-form-item>
  528. </el-col>
  529. <el-col :span="5">
  530. <el-form-item label="单据日期" prop="billDate">
  531. <el-date-picker v-model="form.billDate" clearable
  532. style="width: 100%;"
  533. type="date" size="small"
  534. :disabled="true"
  535. value-format="yyyy-MM-dd HH:mm"
  536. placeholder="选择单据日期">
  537. </el-date-picker>
  538. </el-form-item>
  539. </el-col>
  540. <el-col :span="5">
  541. <el-form-item label="制单人" prop="createUserName">
  542. <el-input style="width: 100%;" v-model="form.createUserName"
  543. size="small" autocomplete="off"
  544. :disabled="true"
  545. clearable placeholder="请输入制单人" >
  546. </el-input>
  547. </el-form-item>
  548. </el-col>
  549. </el-row>
  550. </el-card>
  551. </el-form>
  552. </div>
  553. </div>
  554. </template>
  555. <script>
  556. import fininvoicesitems from "@/views/iosBasicData/fininvoicesApplyfor/assembly/fininvoicesitems.vue";
  557. import fininvoiceitemdetail from "@/views/iosBasicData/fininvoicesApplyfor/assembly/fininvoiceitemdetail.vue";
  558. import {getRateList} from "@/api/iosBasicData/rateManagement";
  559. import {finstlbillsGetByDetail, finstlbillsitemsRemove, finstlbillslistAccBillV1} from "@/api/iosBasicData/finstlbills";
  560. import {bcorpsbankList, corpsinvoiceheaderList, getBcorpsList} from "@/api/iosBasicData/bcorps";
  561. import {bportsList} from "@/api/iosBasicData/bports";
  562. import SearchQuery from "@/components/iosbasic-data/searchquery.vue";
  563. import {
  564. finInvoicesApprove,
  565. fininvoicesDetail,
  566. revokeFinInvoicesApprove,
  567. fininvoicesSubmit,
  568. fininvoicesitemsRemove,
  569. generateFinInvoicesDetail,
  570. fininvoiceitemdetailRemove,
  571. revokeFinInvoicesDetail,
  572. fininvoiceitemdetailSubmit,
  573. fininvoicesGenerateFinInvoices,
  574. fininvoicesConfirmFinInvoices, fininvoicesRevokeFinInvoices
  575. } from "@/api/iosBasicData/fininvoices";
  576. import {getWorkDicts} from "@/api/system/dictbiz";
  577. import {getCurrentDate} from "@/util/date";
  578. export default {
  579. components:{ SearchQuery, fininvoicesitems,fininvoiceitemdetail},
  580. data() {
  581. return {
  582. invoiceAmountCNY:0, // 费用明细开票金额输入框CNY
  583. invoiceAmountUSD:0, // 费用明细开票金额输入框USD
  584. statusType:false, // 是否确认开票
  585. serverData:[], // 开票项目数据
  586. detailTabs:'first',
  587. appendType:'检索',
  588. pageLoading:false, // 全屏加载
  589. saveLoading:false, // 按钮加载
  590. form:{
  591. invCurCode:'CNY',
  592. isRp:1,
  593. invType:'全电发票',
  594. taxRate:0,
  595. invoiceDate:getCurrentDate(),
  596. },
  597. tableData:[], // 费用明细数据
  598. InvoicingList:[], // 开票明细数据
  599. handleSelectionData:[], // 费用明细选择的数据
  600. invoicingCheckboxData:[], // 开票明细选择的数据
  601. corpData:[], // 结算单位数据
  602. invCorpData:[], // 开票单位
  603. bankReceiptData:[], // 结算单位银行账号数据
  604. // 业务类型
  605. businessTypesData:[
  606. {
  607. label:'海运出口',
  608. value:'SE'
  609. },{
  610. label:'海运进口',
  611. value:'SI'
  612. }
  613. ],
  614. curData:[], // 币别
  615. destinationData:[], // 目的港
  616. podData:[], // 卸货港
  617. polData:[], // 装货港
  618. invCurCodeData:[], // 发票币种
  619. invTypeData:[], // 发票类型
  620. rules: {
  621. corpCnName: [
  622. {required: true, message: '请输入付费对象', trigger: 'blur'},
  623. ],
  624. invoiceDate: [
  625. {required: true, message: '请输入开票日期', trigger: 'blur'},
  626. ],
  627. exrate: [
  628. {required: true, message: '请输入导入汇率', trigger: 'blur'},
  629. ],
  630. taxRate:[
  631. {required: true, message: '请输入所属税率', trigger: 'blur'},
  632. ],
  633. invCurCode: [
  634. {required: true, message: '请输入所属发票币别', trigger: 'blur'},
  635. ],
  636. },
  637. }
  638. },
  639. props:{
  640. editSave:{
  641. type:Boolean,
  642. default:false
  643. }
  644. },
  645. watch:{
  646. // 监听 状态
  647. "form.status":{
  648. // 执行方法
  649. handler(oldValue,newValue) {
  650. if (oldValue == 3) {
  651. this.statusType = true
  652. }else {
  653. this.statusType = false
  654. }
  655. },
  656. deep: true, // 深度监听
  657. immediate: true // 第一次改变就执行
  658. },
  659. },
  660. created() {
  661. if (!this.form.id) {
  662. getRateList({current:1,size:30}).then(res=>{
  663. for (let item of res.data.data.records) {
  664. if (item.code == "USD") {
  665. this.$set(this.form,'exrate',item.exrate)
  666. }
  667. }
  668. })
  669. }
  670. },
  671. methods:{
  672. // 开票明细编辑完成保存
  673. invoiceSavefun(row){
  674. row.amountRate = this.form.taxRate
  675. // 销售额/(1+税率)×税率
  676. row.amountTax = (row.amount / (1 + (Number(row.amountRate) / 100)) * (Number(row.amountRate) / 100)).toFixed(2)
  677. fininvoiceitemdetailSubmit(row).then(res=>{
  678. this.$message.success('操作成功')
  679. this.fininvoicesDetailfun(this.form.id)
  680. })
  681. },
  682. // 确认开票信息
  683. invoicingfun(){
  684. if (this.handleSelectionData.length == 0) {
  685. this.$message.warning('请选择数据')
  686. return;
  687. }
  688. if (!this.form.serverName) {
  689. this.$message.warning('请选择开票项目')
  690. return
  691. }
  692. let obj = this.form
  693. obj.finInvoicesItemsList = []
  694. obj.businessTypes = this.form.businessTypes?this.form.businessTypes.join(','):''
  695. //开票日期
  696. if(this.form.invoiceDate) {
  697. obj.invoiceDate = this.form.invoiceDate.slice(0,10) + ' 00:00:00'
  698. }
  699. // 业务日期
  700. if (this.form.accountDateFrom) {
  701. obj.accountDateFrom = this.form.accountDateFrom.slice(0,10) + ' 00:00:00'
  702. }
  703. if (this.form.accountDateTo) {
  704. obj.accountDateTo = this.form.accountDateTo.slice(0,10) + ' 00:00:00'
  705. }
  706. for (let item of this.handleSelectionData) {
  707. // 拿未开票的数据
  708. if(item.status == 0) {
  709. if (item.currentCurCode == 'CNY') {
  710. item.currentAmount = item.currentAmountCNY
  711. }else {
  712. item.currentAmount = item.currentAmountUSD
  713. }
  714. obj.finInvoicesItemsList.push(item)
  715. }
  716. }
  717. if (obj.finInvoicesItemsList.length == 0) {
  718. this.$message.warning('请选择未生成发票的数据')
  719. return
  720. }
  721. // 开票项目
  722. generateFinInvoicesDetail(obj).then(res=>{
  723. this.$message.warning('操作成功')
  724. this.fininvoicesDetailfun(this.form.id)
  725. })
  726. this.detailTabs = 'second'
  727. },
  728. // 撤销开票信息
  729. invoicingRevokefun(){
  730. if (this.handleSelectionData.length == 0) {
  731. this.$message.warning('请选择数据')
  732. return;
  733. }
  734. let obj = this.form
  735. obj.finInvoicesItemsList = []
  736. obj.businessTypes = this.form.businessTypes?this.form.businessTypes.join(','):''
  737. //开票日期
  738. if(this.form.invoiceDate) {
  739. obj.invoiceDate = this.form.invoiceDate.slice(0,10) + ' 00:00:00'
  740. }
  741. // 业务日期
  742. if (this.form.accountDateFrom) {
  743. obj.accountDateFrom = this.form.accountDateFrom.slice(0,10) + ' 00:00:00'
  744. }
  745. if (this.form.accountDateTo) {
  746. obj.accountDateTo = this.form.accountDateTo.slice(0,10) + ' 00:00:00'
  747. }
  748. for (let item of this.handleSelectionData) {
  749. // 拿未开票的数据
  750. if(item.status == 1) {
  751. if (item.currentCurCode == 'CNY') {
  752. item.currentAmount = item.currentAmountCNY
  753. }else {
  754. item.currentAmount = item.currentAmountUSD
  755. }
  756. obj.finInvoicesItemsList.push(item)
  757. }
  758. }
  759. if (obj.finInvoicesItemsList.length == 0) {
  760. this.$message.warning('请选择已生成发票的数据')
  761. return
  762. }
  763. // 撤销开票项目
  764. revokeFinInvoicesDetail(obj).then(res=>{
  765. this.$message.warning('操作成功')
  766. this.fininvoicesDetailfun(this.form.id)
  767. })
  768. },
  769. // 费用明细开票匹配
  770. invoiceMatchingfun(){
  771. if (this.invoiceAmountCNY != 0 || this.invoiceAmountUSD != 0) {
  772. let dataCNY = JSON.parse(JSON.stringify(this.invoiceAmountCNY))
  773. let dataUSD = JSON.parse(JSON.stringify(this.invoiceAmountUSD))
  774. for (let item of this.tableData) {
  775. this.$refs.fininvoicesitems.$refs.tableRef.toggleRowSelection(item,false)
  776. if (this.invoiceAmountCNY != 0) {
  777. if (dataCNY < 0) {
  778. dataCNY = 0
  779. }
  780. if (dataCNY > 1500) {
  781. if (item.currentCurCode == 'CNY') {
  782. this.$set(item,'currentAmountCNY',1500)
  783. this.$refs.fininvoicesitems.$refs.tableRef.toggleRowSelection(item,true)
  784. dataCNY -= 1500
  785. }
  786. }else {
  787. if (item.currentCurCode == 'CNY') {
  788. if (dataCNY != 0) {
  789. this.$refs.fininvoicesitems.$refs.tableRef.toggleRowSelection(item,true)
  790. }
  791. this.$set(item,'currentAmountCNY',dataCNY)
  792. dataCNY -= 1500
  793. }
  794. }
  795. }
  796. if (this.invoiceAmountUSD != 0) {
  797. if (dataUSD < 0) {
  798. dataUSD = 0
  799. }
  800. if (dataUSD > 1500) {
  801. if (item.currentCurCode == 'USD') {
  802. this.$set(item,'currentAmountUSD',1500)
  803. this.$refs.fininvoicesitems.$refs.tableRef.toggleRowSelection(item,true)
  804. dataUSD -= 1500
  805. }
  806. }else {
  807. if (item.currentCurCode == 'USD') {
  808. this.$set(item,'currentAmountUSD',dataUSD)
  809. if (dataUSD != 0) {
  810. this.$refs.fininvoicesitems.$refs.tableRef.toggleRowSelection(item,true)
  811. }
  812. dataUSD -= 1500
  813. }
  814. }
  815. }
  816. }
  817. }
  818. },
  819. // 费用明细批量删除
  820. batchDeletefun(){
  821. if (this.handleSelectionData.length == 0) {
  822. return this.$message.warning('请选择要删除的数据')
  823. }
  824. this.$confirm("确定将选择数据删除?", {
  825. confirmButtonText: "确定",
  826. cancelButtonText: "取消",
  827. type: "warning"
  828. }).then(()=>{
  829. // 获取有id 的数据
  830. const itemsWithId = this.handleSelectionData.filter(item => item.hasOwnProperty('id'));
  831. let arrIds = itemsWithId.map(item=>item.id) // 获取id 数据
  832. // 把选中的删除掉
  833. this.handleSelectionData.forEach((item)=>{
  834. for (let index in this.tableData) {
  835. if (item.accBillNo == this.tableData[index].accBillNo) {
  836. this.tableData.splice(Number(index),1)
  837. }
  838. }
  839. })
  840. // 有id 的处理
  841. if(itemsWithId.length != 0) {
  842. fininvoicesitemsRemove(arrIds.join(',')).then(res=>{
  843. this.$message.success('操作成功')
  844. })
  845. }
  846. })
  847. },
  848. // 费用明细单个删除
  849. detailsdeletionfun(id,index){
  850. this.$confirm("确定将选择数据删除?", {
  851. confirmButtonText: "确定",
  852. cancelButtonText: "取消",
  853. type: "warning"
  854. }).then(()=>{
  855. if (id) {
  856. fininvoicesitemsRemove(id).then(res=>{
  857. this.$message.success('操作成功')
  858. })
  859. }
  860. this.tableData.splice(index,1)
  861. })
  862. },
  863. // 开票批量删除
  864. invoicingBatchDelete(){
  865. if (this.invoicingCheckboxData.length == 0) {
  866. return this.$message.warning('请选择要删除的数据')
  867. }
  868. this.$confirm("确定将选择数据删除?", {
  869. confirmButtonText: "确定",
  870. cancelButtonText: "取消",
  871. type: "warning"
  872. }).then(()=>{
  873. // 获取有id 的数据
  874. const itemsWithId = this.invoicingCheckboxData.filter(item => item.hasOwnProperty('id'));
  875. let arrIds = itemsWithId.map(item=>item.id) // 获取id 数据
  876. // 把选中的删除掉
  877. this.invoicingCheckboxData.forEach((item)=>{
  878. for (let index in this.InvoicingList) {
  879. if (item.id == this.InvoicingList[index].id) {
  880. this.InvoicingList.splice(Number(index),1)
  881. }
  882. }
  883. })
  884. // 有id 的处理
  885. if(itemsWithId.length != 0) {
  886. fininvoiceitemdetailRemove(arrIds.join(',')).then(res=>{
  887. this.$message.success('操作成功')
  888. })
  889. }
  890. })
  891. },
  892. // 开票明细单个删除
  893. invoiceDeletionfun(id,index){
  894. this.$confirm("确定将选择数据删除?", {
  895. confirmButtonText: "确定",
  896. cancelButtonText: "取消",
  897. type: "warning"
  898. }).then(()=>{
  899. if (id) {
  900. fininvoiceitemdetailRemove(id).then(res=>{
  901. this.$message.success('操作成功')
  902. })
  903. }
  904. this.InvoicingList.splice(index,1)
  905. })
  906. },
  907. // 下拉框的回调
  908. corpChange(value,name){
  909. // 结算单位
  910. if (name == 'corpCnName') {
  911. if (!value) {
  912. this.$set(this.form,'corpId','')
  913. this.$set(this.form,'corpCnName','')
  914. this.$set(this.form,'corpEnName','')
  915. return
  916. }
  917. for(let item of this.corpData) {
  918. if (item.cnName == value) {
  919. this.$set(this.form,'corpId',item.id)
  920. this.$set(this.form,'corpCnName',item.cnName)
  921. this.$set(this.form,'corpEnName',item.enName)
  922. bcorpsbankList(1,10,{pid:this.form.corpId}).then(res=>{
  923. if (res.data.data.records.length != 0) {
  924. this.$set(this.form,'bankReceiptAccountNo',res.data.data.records[0].accountNo)
  925. this.$set(this.form,'bankReceiptBankName',res.data.data.records[0].accountBank)
  926. }
  927. })
  928. // 带出开票单位数据
  929. corpsinvoiceheaderList(1,20,{pid:this.form.corpId}).then(res=>{
  930. if (res.data.data.records.length != 0) {
  931. this.$set(this.form,'invCorpId',res.data.data.records[0].id)
  932. this.$set(this.form,'invCorpCnName',res.data.data.records[0].invoiceHeader)
  933. this.$set(this.form,'invCorpTaxNo',res.data.data.records[0].uscc) // 税号
  934. this.$set(this.form,'invCorpAccountBankUsd',res.data.data.records[0].accountBankUsd) // 美元银行
  935. this.$set(this.form,'invCorpAccountNoUsd',res.data.data.records[0].accountNoUsd) // 美元账户
  936. this.$set(this.form,'invCorpAccountBankCny',res.data.data.records[0].accountBankUsd) // 人民币银行
  937. this.$set(this.form,'invCorpAccountNoCny',res.data.data.records[0].accountNoUsd) // 人民币账户
  938. }
  939. })
  940. }
  941. }
  942. }
  943. // 开票单位
  944. else if (name == 'invCorpCnName') {
  945. this.$set(this.form,'invCorpAccountBankUsd','')
  946. this.$set(this.form,'invCorpAccountNoUsd','')
  947. this.$set(this.form,'invCorpAccountBankCny','')
  948. this.$set(this.form,'invCorpAccountNoCny','')
  949. if (!value) {
  950. this.$set(this.form,'invCorpId','')
  951. this.$set(this.form,'invCorpCnName','')
  952. return
  953. }
  954. for(let item of this.invCorpData) {
  955. if (item.id == value) {
  956. this.$set(this.form,'invCorpId',item.id)
  957. this.$set(this.form,'invCorpCnName',item.invoiceHeader)
  958. this.$set(this.form,'invCorpTaxNo',item.uscc) // 税号
  959. this.$set(this.form,'invCorpAccountBankUsd',item.accountBankUsd) // 美元银行
  960. this.$set(this.form,'invCorpAccountNoUsd',item.accountNoUsd) // 美元账户
  961. this.$set(this.form,'invCorpAccountBankCny',item.accountBankUsd) // 人民币银行
  962. this.$set(this.form,'invCorpAccountNoCny',item.accountNoUsd) // 人民币账户
  963. }
  964. }
  965. }
  966. // 结算单位银行账户
  967. else if(name == 'bankReceiptAccountNo') {
  968. for(let item of this.bankReceiptData) {
  969. if (item.accountNo == value) {
  970. this.$set(this.form,'bankReceiptAccountNo',item.accountNo)
  971. this.$set(this.form,'bankReceiptBankName',item.accountBank)
  972. }
  973. }
  974. }
  975. else {
  976. this.$set(this.form,name,value)
  977. }
  978. },
  979. // 费用明细表格多选
  980. handleSelectionChange(arr){
  981. this.handleSelectionData = arr
  982. },
  983. // 开票明细表格多选
  984. invoicingCheckboxChange(arr){
  985. this.invoicingCheckboxData = arr
  986. },
  987. // 编辑事件
  988. editHandle(){
  989. this.editSave = false
  990. },
  991. // 保存按钮事件
  992. editCustomer(){
  993. this.$refs.form.validate((valid) => {
  994. if (!valid) return
  995. if (!this.form.id) {
  996. // 是否选择从表数据
  997. if (this.handleSelectionData.length == 0) {
  998. this.$message.warning('请选择结算数据');
  999. return;
  1000. }
  1001. }
  1002. this.form.type = '销项'
  1003. this.form.billNoFormat = 'XXFP'
  1004. this.form.businessTypeCode = 'XXFP'
  1005. this.form.businessTypes = this.form.businessTypes?this.form.businessTypes.join(','):''
  1006. //开票日期
  1007. if(this.form.invoiceDate) {
  1008. this.form.invoiceDate = this.form.invoiceDate.slice(0,10) + ' 00:00:00'
  1009. }
  1010. // 业务日期
  1011. if (this.form.accountDateFrom) {
  1012. this.form.accountDateFrom = this.form.accountDateFrom.slice(0,10) + ' 00:00:00'
  1013. }
  1014. if (this.form.accountDateTo) {
  1015. this.form.accountDateTo = this.form.accountDateTo.slice(0,10) + ' 00:00:00'
  1016. }
  1017. this.form.finInvoicesItemsList = this.handleSelectionData.map(item=>{
  1018. if (item.currentCurCode == 'CNY') {
  1019. item.currentAmount = item.currentAmountCNY
  1020. }else {
  1021. item.currentAmount = item.currentAmountUSD
  1022. }
  1023. return item
  1024. })
  1025. this.form.finInvoiceItemDetailList = this.InvoicingList
  1026. this.saveLoading = true
  1027. this.fininvoicesSubmitfun(this.form)
  1028. })
  1029. },
  1030. // 检索
  1031. finstlbillslistAccBillV1fun(type){
  1032. if (!this.form.corpId) {
  1033. this.$message.warning('请选择结算单位');
  1034. return
  1035. }
  1036. let obj = {}
  1037. //开票日期
  1038. if(this.form.invoiceDate) {
  1039. obj.invoiceDate = this.form.invoiceDate.slice(0,10) + ' 00:00:00'
  1040. }
  1041. // 业务日期
  1042. if (this.form.accountDateFrom) {
  1043. obj.accountDateFrom = this.form.accountDateFrom.slice(0,10) + ' 00:00:00'
  1044. }
  1045. if (this.form.accountDateTo) {
  1046. obj.accountDateTo = this.form.accountDateTo.slice(0,10) + ' 00:00:00'
  1047. }
  1048. obj.type = '3'
  1049. obj.billNo = this.form.bookingNo // 账单号
  1050. obj.businessBillNo = this.form.billNo // 业务编号
  1051. obj.mblno = this.form.mblno // 主单编号
  1052. obj.hblno = this.form.hblno // 分单编号
  1053. obj.bookingNo = this.form.bookingNo // 订舱号(BOOK NO)
  1054. obj.curCode = this.form.curCode // 币种
  1055. obj.businessType = this.form.businessTypes?this.form.businessTypes.join(','):'' // 业务类型
  1056. // 判断是否有对账单号
  1057. if (this.form.checkNo) {
  1058. obj.corpId = this.form.corpId // 结算单位
  1059. obj.checkNo = this.form.checkNo // CHK NO 对账单号
  1060. finstlbillsGetByDetail(obj).then(res=>{
  1061. let arr = res.data.data.finStlBillsItemsList.map((item)=>{
  1062. item.lineNo = Number(index) + 1 // 行号
  1063. item.currentCurCode = item.curCode
  1064. item.currentExrate = item.exrate
  1065. if (item.currentCurCode == 'CNY') {
  1066. // 本次发票金额
  1067. item.currentAmountCNY = item.appliedInvoiceCurrentStlAmount
  1068. }else {
  1069. // 本次发票金额
  1070. item.currentAmountUSD = item.appliedInvoiceCurrentStlAmount
  1071. }
  1072. delete item.id
  1073. return item
  1074. })
  1075. if (type == '追加') {
  1076. let a = [...this.tableData,...arr,]
  1077. this.tableData = a.filter((obj, index) => {
  1078. return a.findIndex((elem) => {
  1079. return elem.accBillNo === obj.accBillNo
  1080. }) === index;
  1081. });
  1082. }else {
  1083. // 获取有id 的数据
  1084. const itemsWithId = this.tableData.filter(item => item.hasOwnProperty('id'));
  1085. let arrIds = itemsWithId.map(item=>item.id) // 获取id 数据
  1086. // 有id 的处理
  1087. if(itemsWithId.length != 0) {
  1088. finstlbillsitemsRemove(arrIds.join(',')).then(res=>{
  1089. this.$message.success('操作成功')
  1090. })
  1091. }
  1092. this.tableData = arr
  1093. }
  1094. })
  1095. }else {
  1096. obj.corpCnName = this.form.corpId // 结算单位
  1097. obj.checkBillNo = this.form.checkNo // 对账单号
  1098. finstlbillslistAccBillV1(obj).then(res=>{
  1099. let arr = res.data.data.map((item,index)=>{
  1100. item.lineNo = Number(index) + 1 // 行号
  1101. item.accBillId = item.id
  1102. item.accBillNo = item.billNo
  1103. item.accDate = item.createTime
  1104. item.currentCurCode = item.curCode
  1105. item.currentExrate = item.exrate
  1106. if (item.currentCurCode == 'CNY') {
  1107. // 本次发票金额
  1108. item.currentAmountCNY = item.appliedInvoiceCurrentStlAmount
  1109. }else {
  1110. // 本次发票金额
  1111. item.currentAmountUSD = item.appliedInvoiceCurrentStlAmount
  1112. }
  1113. delete item.id
  1114. return item
  1115. })
  1116. if (type == '追加') {
  1117. let a = [...this.tableData,...arr,]
  1118. this.tableData = a.filter((obj, index) => {
  1119. return a.findIndex((elem) => {
  1120. return elem.accBillNo === obj.accBillNo
  1121. }) === index;
  1122. });
  1123. }else {
  1124. // 获取有id 的数据
  1125. const itemsWithId = this.tableData.filter(item => item.hasOwnProperty('id'));
  1126. let arrIds = itemsWithId.map(item=>item.id) // 获取id 数据
  1127. // 有id 的处理
  1128. if(itemsWithId.length != 0) {
  1129. fininvoicesitemsRemove(arrIds.join(',')).then(res=>{
  1130. this.$message.success('操作成功')
  1131. })
  1132. }
  1133. this.tableData = arr
  1134. }
  1135. })
  1136. }
  1137. },
  1138. // 保存接口
  1139. fininvoicesSubmitfun(obj){
  1140. fininvoicesSubmit(obj).then(res=>{
  1141. this.saveLoading = false
  1142. this.$message.success('操作成功');
  1143. this.fininvoicesDetailfun(res.data.data.id)
  1144. })
  1145. },
  1146. // 详情接口
  1147. fininvoicesDetailfun(id){
  1148. this.pageLoading = true
  1149. fininvoicesDetail(id).then(res=>{
  1150. this.form = res.data.data
  1151. this.form.businessTypes = this.form.businessTypes?this.form.businessTypes.split(','):[] // 业务类型转换成数组显示
  1152. this.tableData = this.form.finInvoicesItemsList.map(item=>{
  1153. if (item.currentCurCode == 'CNY') {
  1154. item.currentAmountCNY = item.currentAmount
  1155. }else {
  1156. item.currentAmountUSD = item.currentAmount
  1157. }
  1158. return item
  1159. })
  1160. this.InvoicingList = this.form.finInvoiceItemDetailList.map(item=>{
  1161. item.edit = false
  1162. return item
  1163. })
  1164. this.pageLoading = false
  1165. })
  1166. },
  1167. // 开票获取数据
  1168. fininvoicesGenerateFinInvoicesfun(billId){
  1169. this.pageLoading = true
  1170. fininvoicesGenerateFinInvoices({billId}).then(res=>{
  1171. this.form = res.data.data
  1172. this.form.businessTypes = this.form.businessTypes?this.form.businessTypes.split(','):[] // 业务类型转换成数组显示
  1173. // 判断是否是数组
  1174. if (Array.isArray(this.form.finInvoicesItemsList)) {
  1175. this.tableData = this.form.finInvoicesItemsList.map(item=>{
  1176. if (item.currentCurCode == 'CNY') {
  1177. item.currentAmountCNY = item.currentAmount
  1178. }else {
  1179. item.currentAmountUSD = item.currentAmount
  1180. }
  1181. return item
  1182. })
  1183. }
  1184. // 判断是否是数组
  1185. if (Array.isArray(this.form.finInvoiceItemDetailList)) {
  1186. this.InvoicingList = this.form.finInvoiceItemDetailList.map(item=>{
  1187. item.edit = false
  1188. return item
  1189. })
  1190. }
  1191. this.pageLoading = false
  1192. })
  1193. },
  1194. // 确认申请
  1195. fininvoicesConfirmFinInvoicesfun(){
  1196. this.$confirm("确定进行确认开票操作?", {
  1197. confirmButtonText: "确定",
  1198. cancelButtonText: "取消",
  1199. type: "warning"
  1200. }).then(res=>{
  1201. this.pageLoading = true
  1202. this.form.businessTypes = this.form.businessTypes?this.form.businessTypes.join(','):''
  1203. fininvoicesConfirmFinInvoices(this.form).then(res=>{
  1204. this.pageLoading = false
  1205. this.$message.success('操作成功');
  1206. this.fininvoicesDetailfun(res.data.data.id)
  1207. }).catch(err=>{
  1208. this.pageLoading = false
  1209. })
  1210. })
  1211. },
  1212. // 撤销申请
  1213. fininvoicesRevokeFinInvoicesfun(){
  1214. this.$confirm("确定进行撤销确认发票操作?", {
  1215. confirmButtonText: "确定",
  1216. cancelButtonText: "取消",
  1217. type: "warning"
  1218. }).then(res=>{
  1219. this.pageLoading = true
  1220. this.form.businessTypes = this.form.businessTypes?this.form.businessTypes.join(','):''
  1221. fininvoicesRevokeFinInvoices(this.form).then(res=>{
  1222. this.pageLoading = false
  1223. this.$message.success('操作成功');
  1224. this.fininvoicesDetailfun(res.data.data.id)
  1225. }).catch(err=>{
  1226. this.pageLoading = false
  1227. })
  1228. })
  1229. },
  1230. //返回列表
  1231. backToList() {
  1232. this.$emit('goBack')
  1233. },
  1234. // 获取客户名称数据 往来单位数据
  1235. corpBcorpsListfun(cnName){
  1236. getBcorpsList(1,10,{cnName}).then(res=>{
  1237. this.corpData = res.data.data.records
  1238. })
  1239. },
  1240. // 根据往来单位选择调用获取银行数据
  1241. bcorpsbankListfun(accountNo){
  1242. bcorpsbankList(1,10,{
  1243. // curNo:this.cntyCode,
  1244. pid:this.form.corpId,
  1245. accountNo:accountNo
  1246. }).then(res=>{
  1247. this.bankReceiptData = res.data.data.records
  1248. })
  1249. },
  1250. // 根据往来单位选择调用获取发票抬头数据 开票单位数据
  1251. invcorpsinvoiceheaderListfun(cnName){
  1252. corpsinvoiceheaderList(1,20,{pid:this.form.corpId,cnName}).then(res=>{
  1253. this.invCorpData = res.data.data.records
  1254. })
  1255. },
  1256. // 获取币别数据
  1257. getRateListfun(cnName){
  1258. getRateList({current:1,size:10,cnName}).then(res=>{
  1259. this.curData = res.data.data.records
  1260. })
  1261. },
  1262. // 获取发票币别数据
  1263. invCurCodeRateListfun(cnName){
  1264. getRateList({current:1,size:20,cnName}).then(res=>{
  1265. this.invCurCodeData = res.data.data.records
  1266. })
  1267. },
  1268. // 目的地
  1269. destinationBportsListfun(enName){
  1270. bportsList(1,10,{enName}).then(res=>{
  1271. this.destinationData = res.data.data.records
  1272. })
  1273. },
  1274. // 卸货港
  1275. podBportsListfun(enName){
  1276. bportsList(1,10,{enName}).then(res=>{
  1277. this.podData = res.data.data.records
  1278. })
  1279. },
  1280. // 装货港
  1281. polBportsListfun(enName){
  1282. bportsList(1,10,{enName}).then(res=>{
  1283. this.polData = res.data.data.records
  1284. })
  1285. },
  1286. // 发票类型字典数据
  1287. invTypeWorkDictsfun(){
  1288. getWorkDicts('inv_type_los').then(res=>{
  1289. this.invTypeData = res.data.data;
  1290. })
  1291. },
  1292. serverWorkDictsfun(){
  1293. getWorkDicts('Invoice_information_los').then(res=>{
  1294. this.serverData = res.data.data;
  1295. })
  1296. },
  1297. },
  1298. }
  1299. </script>
  1300. <style scoped>
  1301. ::v-deep.el-form-item {
  1302. margin-bottom: 0;
  1303. }
  1304. .cardBox {
  1305. background: #fff;
  1306. width: 100%;
  1307. height: 100%;
  1308. padding: 20px;
  1309. box-sizing: border-box;
  1310. border-radius: 4px;
  1311. box-shadow: 0 2px 12px 0 rgba(0,0,0,.1);
  1312. }
  1313. .flexBox {
  1314. display: flex;
  1315. }
  1316. .flexBoxLeft {
  1317. flex: 2;
  1318. margin-right: 10px;
  1319. //padding-bottom: 40px;
  1320. }
  1321. .flexBoxRight {
  1322. flex: 3;
  1323. //padding-bottom: 40px;
  1324. }
  1325. </style>