fininvoicesDetails.vue 93 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756
  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" style="margin-right: 8px" :loading="saveLoading" :disabled="!form.id"
  11. @click="previewreportfun">预 览
  12. </el-button>
  13. <el-button size="small" style="margin-right: 8px" v-if="roleName.indexOf('admin') != -1"
  14. :loading="saveLoading" :disabled="!form.id" @click="DesignreportDialog = true">报表设计
  15. </el-button>
  16. <el-button type="success" size="small" :disabled="!form.id" plain @click="newbillFun">新建发票申请
  17. </el-button>
  18. <el-button size="small" type="warning" plain style="margin-right: 8px" :disabled="!form.id || editPower"
  19. v-if="form.status == 3" :loading="saveLoading" @click="revokeFinInvoicesApprovefun">撤销
  20. </el-button>
  21. <el-button size="small" type="success" plain style="margin-right: 8px" :disabled="!form.id || editPower"
  22. v-else :loading="saveLoading" @click="submit('提交')">提交
  23. </el-button>
  24. <el-button size="small" type="primary" :disabled="statusType || editPower" style="margin-right: 8px"
  25. v-if="editSave" :loading="saveLoading" @click="editHandle">编 辑
  26. </el-button>
  27. <el-button size="small" type="primary" :disabled="statusType" style="margin-right: 8px" v-else
  28. :loading="saveLoading" @click="editCustomer()">保 存
  29. </el-button>
  30. <!-- <el-dropdown style="line-height: 0">
  31. <el-button type="warning" :loading="saveLoading" :disabled="!form.id" size="small">
  32. 审 批<i class="el-icon-arrow-down el-icon--right"></i>
  33. </el-button>
  34. <el-dropdown-menu slot="dropdown">
  35. <el-dropdown-item @click.native="checkScheduleDialog = true, checkId = form.id">审核进度
  36. </el-dropdown-item>
  37. </el-dropdown-menu>
  38. </el-dropdown> -->
  39. </div>
  40. </div>
  41. <div style="margin: 55px 5px 0px 5px;'">
  42. <el-form :model="form" ref="form" :rules="rules" label-width="90px" class="demo-ruleForm">
  43. <trade-card title="基础信息" styleIocup="color:#4b9fe9">
  44. <el-row>
  45. <el-col :span="10">
  46. <div class="flexBoxLeft">
  47. <el-row>
  48. <el-col :span="12">
  49. <el-form-item label="发票号码" prop="invoiceNo">
  50. <el-input style="width: 100%;" v-model="form.invoiceNo" size="small"
  51. autocomplete="off" :disabled="true" clearable placeholder="发票号码">
  52. </el-input>
  53. </el-form-item>
  54. </el-col>
  55. <el-col :span="12">
  56. <el-form-item label="开票日期" prop="invoiceDate">
  57. <el-date-picker v-model="form.invoiceDate" clearable style="width: 100%;"
  58. type="date" size="small" :disabled="editSave" value-format="yyyy-MM-dd"
  59. placeholder="请选择开票日期">
  60. </el-date-picker>
  61. </el-form-item>
  62. </el-col>
  63. <el-col :span="12">
  64. <el-form-item label="开票单位" prop="invCorpCnName">
  65. <search-query :datalist="invCorpData" :selectValue="form.invCorpCnName"
  66. :clearable="true" :disabled="editSave || !form.corpId" :buttonIf="false"
  67. :remote="true" :filterable="true" placeholder="请选择开票单位"
  68. :forParameter="{ key: 'id', label: 'invoiceHeader', value: 'id' }"
  69. @corpChange="corpChange($event, 'invCorpCnName')"
  70. @remoteMethod="invcorpsinvoiceheaderListfun"
  71. @corpFocus="invcorpsinvoiceheaderListfun">
  72. </search-query>
  73. </el-form-item>
  74. </el-col>
  75. <el-col :span="12">
  76. <el-form-item label="收/付" prop="dc">
  77. <el-select v-model="form.dc" placeholder="请选择" :disabled="editSave"
  78. size="small">
  79. <el-option v-for="item in options" :key="item.value" :label="item.label"
  80. :value="item.value">
  81. </el-option>
  82. </el-select>
  83. </el-form-item>
  84. </el-col>
  85. <el-col :span="12">
  86. <el-form-item label="税号" prop="invCorpTaxNo">
  87. <el-input style="width: 100%;" v-model="form.invCorpTaxNo" size="small"
  88. autocomplete="off" :disabled="true" clearable placeholder="请输入税号">
  89. </el-input>
  90. </el-form-item>
  91. </el-col>
  92. <el-col :span="12">
  93. <el-form-item label="发票币种" prop="invCurCode">
  94. <search-query :datalist="invCurCodeData" :selectValue="form.invCurCode"
  95. :filterable="true" :clearable="true" :disabled="editSave"
  96. :buttonIf="false" placeholder="请选择发票币种"
  97. :forParameter="{ key: 'id', label: 'code', value: 'code' }"
  98. @corpChange="corpChange($event, 'invCurCode')"
  99. @corpFocus="invCurCodeRateListfun">
  100. </search-query>
  101. </el-form-item>
  102. </el-col>
  103. <el-col :span="12">
  104. <el-form-item label="美元银行" prop="invCorpAccountBankUsd">
  105. <el-input style="width: 100%;" v-model="form.invCorpAccountBankUsd"
  106. size="small" autocomplete="off" :disabled="true" clearable
  107. placeholder="请输入美元银行">
  108. </el-input>
  109. </el-form-item>
  110. </el-col>
  111. <el-col :span="12">
  112. <el-form-item label="美元账户" prop="invCorpAccountNoUsd">
  113. <el-input style="width: 100%;" v-model="form.invCorpAccountNoUsd"
  114. size="small" autocomplete="off" :disabled="true" clearable
  115. placeholder="请输入美元账户">
  116. </el-input>
  117. </el-form-item>
  118. </el-col>
  119. </el-row>
  120. <el-row v-show="showForm">
  121. <el-col :span="12">
  122. <el-form-item label="人民币银行" prop="invCorpAccountBankCny">
  123. <el-input style="width: 100%;" v-model="form.invCorpAccountBankCny"
  124. size="small" autocomplete="off" :disabled="true" clearable
  125. placeholder="请输入美元银行">
  126. </el-input>
  127. </el-form-item>
  128. </el-col>
  129. <el-col :span="12">
  130. <el-form-item label="人民币账户" prop="invCorpAccountNoCny">
  131. <el-input style="width: 100%;" v-model="form.invCorpAccountNoCny"
  132. size="small" autocomplete="off" :disabled="true" clearable
  133. placeholder="请输入人民币账户">
  134. </el-input>
  135. </el-form-item>
  136. </el-col>
  137. <el-col :span="12">
  138. <el-form-item label="船名/航次" prop="vesselVoyno">
  139. <el-input style="width: 100%;" v-model="form.vesselVoyno" size="small"
  140. autocomplete="off" :disabled="editSave" clearable
  141. placeholder="请输入船名/航次">
  142. </el-input>
  143. </el-form-item>
  144. </el-col>
  145. <el-col :span="12">
  146. <el-form-item label="开航日期" prop="etd">
  147. <el-date-picker v-model="form.etd" clearable style="width: 100%;"
  148. type="date" size="small" :disabled="editSave"
  149. value-format="yyyy-MM-dd HH:mm:ss" placeholder="请输入开航日期">
  150. </el-date-picker>
  151. </el-form-item>
  152. </el-col>
  153. <el-col :span="12">
  154. <el-form-item label="装货港" prop="pol">
  155. <search-query :datalist="polData" :selectValue="form.pol" :filterable="true"
  156. :clearable="true" :remote="true" :disabled="editSave" :buttonIf="false"
  157. placeholder="请选择装货港"
  158. :forParameter="{ key: 'id', label: 'enName', value: 'enName' }"
  159. @corpChange="corpChange($event, 'pol')" @remoteMethod="polBportsListfun"
  160. @corpFocus="polBportsListfun">
  161. </search-query>
  162. </el-form-item>
  163. </el-col>
  164. <el-col :span="12">
  165. <el-form-item label="卸货港" prop="pod">
  166. <search-query :datalist="podData" :selectValue="form.pod" :filterable="true"
  167. :clearable="true" :remote="true" :disabled="editSave" :buttonIf="false"
  168. placeholder="请选择卸货港"
  169. :forParameter="{ key: 'id', label: 'enName', value: 'enName' }"
  170. @corpChange="corpChange($event, 'pod')" @remoteMethod="podBportsListfun"
  171. @corpFocus="podBportsListfun">
  172. </search-query>
  173. </el-form-item>
  174. </el-col>
  175. <el-col :span="12">
  176. <el-form-item label="目的地" prop="destination">
  177. <search-query :datalist="destinationData" :selectValue="form.destination"
  178. :filterable="true" :clearable="true" :remote="true" :disabled="editSave"
  179. :buttonIf="false" placeholder="请选择目的地"
  180. :forParameter="{ key: 'id', label: 'enName', value: 'enName' }"
  181. @corpChange="corpChange($event, 'destination')"
  182. @remoteMethod="destinationBportsListfun"
  183. @corpFocus="destinationBportsListfun">
  184. </search-query>
  185. </el-form-item>
  186. </el-col>
  187. <el-col :span="12">
  188. <el-form-item label="箱型箱量" prop="containers">
  189. <el-input style="width: 100%;" v-model="form.containers" size="small"
  190. autocomplete="off" :disabled="editSave" clearable placeholder="请输入箱型箱量">
  191. </el-input>
  192. </el-form-item>
  193. </el-col>
  194. </el-row>
  195. </div>
  196. </el-col>
  197. <el-col :span="14">
  198. <div class="flexBoxRight">
  199. <!--<el-row>-->
  200. <!-- <el-col :span="6">-->
  201. <!-- <el-checkbox style="margin-left: 10%" size="medium" :true-label="1" :false-label="0"-->
  202. <!-- :disabled="editSave"-->
  203. <!-- v-model="form.isDk">整票(不列费用明细)-->
  204. <!-- </el-checkbox>-->
  205. <!-- </el-col>-->
  206. <!-- <el-col :span="5">-->
  207. <!-- <el-checkbox style="margin-left: 10%" size="medium" :true-label="1" :false-label="0"-->
  208. <!-- :disabled="editSave"-->
  209. <!-- v-model="form.isRp">只提取开票费用-->
  210. <!-- </el-checkbox>-->
  211. <!-- </el-col>-->
  212. <!-- <el-col :span="3">-->
  213. <!-- <el-checkbox style="margin-left: 10%" size="medium" :true-label="1" :false-label="0"-->
  214. <!-- :disabled="editSave"-->
  215. <!-- v-model="form.isExportMblno">主单号-->
  216. <!-- </el-checkbox>-->
  217. <!-- </el-col>-->
  218. <!-- <el-col :span="3">-->
  219. <!-- <el-checkbox style="margin-left: 10%" size="medium" :true-label="1" :false-label="0"-->
  220. <!-- :disabled="editSave"-->
  221. <!-- v-model="form.isExportVslvoy">船名航次-->
  222. <!-- </el-checkbox>-->
  223. <!-- </el-col>-->
  224. <!-- <el-col :span="3">-->
  225. <!-- <el-checkbox style="margin-left: 10%" size="medium" :true-label="1" :false-label="0"-->
  226. <!-- :disabled="editSave"-->
  227. <!-- v-model="form.isExportHblno">分单号-->
  228. <!-- </el-checkbox>-->
  229. <!-- </el-col>-->
  230. <!--</el-row>-->
  231. <el-row>
  232. <el-col :span="8">
  233. <el-form-item label="结算单位" prop="corpCnName">
  234. <search-query :datalist="corpData" :selectValue="form.corpCnName"
  235. :clearable="true" :disabled="editSave" :buttonIf="false" :remote="true"
  236. :filterable="true" placeholder="请输入结算单位"
  237. :forParameter="{ key: 'id', label: 'cnName', value: 'cnName' }"
  238. @corpChange="corpChange($event, 'corpCnName')"
  239. @remoteMethod="corpBcorpsListfun" @corpFocus="corpBcorpsListfun">
  240. </search-query>
  241. </el-form-item>
  242. </el-col>
  243. <el-col :span="8">
  244. <el-form-item label="费用名称" prop="feeCnName">
  245. <dic-select v-model="form.feeCnName" placeholder="费用名称" key="id"
  246. label="cnName" url="/blade-los/bfees/listAll" :filterable="true"
  247. :multiple="true" :collapseTags="true" :disabled="editSave"></dic-select>
  248. </el-form-item>
  249. </el-col>
  250. <el-col :span="8">
  251. <el-form-item label="税控发票号" prop="taxInvoiceNo">
  252. <el-input style="width: 100%;" v-model="form.taxInvoiceNo" size="small"
  253. autocomplete="off" :disabled="editSave" clearable
  254. placeholder="请输入税控发票号">
  255. </el-input>
  256. </el-form-item>
  257. </el-col>
  258. <el-col :span="9">
  259. <el-form-item label="业务日期" prop="accountDateFrom">
  260. <el-date-picker v-model="form.accountDateFrom" clearable
  261. style="width: 100%;" type="date" size="small" :disabled="editSave"
  262. value-format="yyyy-MM-dd" placeholder="选择业务日期">
  263. </el-date-picker>
  264. </el-form-item>
  265. </el-col>
  266. <el-col :span="7">
  267. <el-form-item label="-" prop="accountDateTo" label-width="30px">
  268. <el-date-picker v-model="form.accountDateTo" clearable style="width: 100%;"
  269. type="date" size="small" :disabled="editSave" value-format="yyyy-MM-dd"
  270. placeholder="选择业务日期">
  271. </el-date-picker>
  272. </el-form-item>
  273. </el-col>
  274. <el-col :span="8">
  275. <el-form-item label="发票汇率" prop="exrate">
  276. <el-input style="width: 100%;" v-model="form.exrate" size="small"
  277. autocomplete="off" :disabled="editSave" clearable placeholder="请输入发票汇率">
  278. </el-input>
  279. </el-form-item>
  280. </el-col>
  281. <el-col :span="16">
  282. <el-form-item label="业务编号" prop="businessNo">
  283. <el-input style="width: 100%;" v-model="form.businessNo" size="small"
  284. autocomplete="off" :disabled="editSave" clearable placeholder="请输入业务编号">
  285. </el-input>
  286. </el-form-item>
  287. </el-col>
  288. <el-col :span="8">
  289. <el-form-item label="发票类型" prop="invType">
  290. <search-query :datalist="invTypeData" :selectValue="form.invType"
  291. :clearable="true" :disabled="editSave" :buttonIf="false"
  292. placeholder="请输入发票类型"
  293. :forParameter="{ key: 'dictKey', label: 'dictValue', value: 'dictKey' }"
  294. @corpChange="corpChange($event, 'invType')"
  295. @corpFocus="invTypeWorkDictsfun">
  296. </search-query>
  297. </el-form-item>
  298. </el-col>
  299. <el-col :span="16">
  300. <el-form-item label="主单编号" prop="mblno">
  301. <el-input style="width: 100%;" v-model="form.mblno" size="small"
  302. autocomplete="off" :disabled="editSave" clearable placeholder="请输入主单编号">
  303. </el-input>
  304. </el-form-item>
  305. </el-col>
  306. <el-col :span="8">
  307. <el-form-item label="对账单号" prop="checkNo">
  308. <el-input style="width: 100%;" v-model="form.checkNo" size="small"
  309. autocomplete="off" :disabled="editSave" clearable placeholder="请输入对账单号">
  310. </el-input>
  311. </el-form-item>
  312. </el-col>
  313. </el-row>
  314. <el-row v-show="showForm">
  315. <el-col :span="16">
  316. <el-form-item label="分单编号" prop="hblno">
  317. <el-input style="width: 100%;" v-model="form.hblno" size="small"
  318. autocomplete="off" :disabled="editSave" clearable placeholder="请输入分单编号">
  319. </el-input>
  320. </el-form-item>
  321. </el-col>
  322. <el-col :span="8">
  323. <el-form-item label="BOOK NO" prop="bookingNo">
  324. <el-input style="width: 100%;" v-model="form.bookingNo" size="small"
  325. autocomplete="off" :disabled="editSave" clearable
  326. placeholder="请输入BOOK NO">
  327. </el-input>
  328. </el-form-item>
  329. </el-col>
  330. <el-col :span="8">
  331. <el-form-item label="业务类型" prop="businessTypes">
  332. <search-query :datalist="businessTypesData"
  333. :selectValue="form.businessTypes" :clearable="true" :disabled="editSave"
  334. :buttonIf="false" :multiple="true" :collapseTags="true"
  335. placeholder="请输入业务类型" @corpChange="corpChange($event, 'businessTypes')">
  336. </search-query>
  337. </el-form-item>
  338. </el-col>
  339. <el-col :span="8">
  340. <el-form-item label="税率(%)" prop="taxRate">
  341. <el-input style="width: 100%;" v-model="form.taxRate" size="small"
  342. autocomplete="off" :disabled="editSave" clearable placeholder="请输入税率">
  343. </el-input>
  344. </el-form-item>
  345. </el-col>
  346. <el-col :span="8">
  347. <el-form-item label="选择币种" prop="curCode">
  348. <search-query :datalist="curData" :selectValue="form.curCode"
  349. :filterable="true" :clearable="true" :disabled="editSave" :remote="true"
  350. :buttonIf="false" placeholder="请输入选择币种"
  351. :forParameter="{ key: 'id', label: 'code', value: 'code' }"
  352. @remoteMethod="getRateListfun"
  353. @corpChange="corpChange($event, 'curCode')" @corpFocus="getRateListfun">
  354. </search-query>
  355. </el-form-item>
  356. </el-col>
  357. <el-col :span="12">
  358. <el-form-item label="邮箱" prop="yx">
  359. <el-input style="width: 100%;" v-model="form.yx" size="small"
  360. autocomplete="off" :disabled="editSave" clearable placeholder="请输入邮箱">
  361. </el-input>
  362. </el-form-item>
  363. </el-col>
  364. <el-col :span="24">
  365. <el-form-item label="全电发票:" prop="elecRemarks">
  366. <el-input style="width: 100%;" v-model="form.elecRemarks" size="small"
  367. autocomplete="off" type="textarea" clearable placeholder="请输入全电发票备注">
  368. </el-input>
  369. </el-form-item>
  370. </el-col>
  371. </el-row>
  372. </div>
  373. </el-col>
  374. </el-row>
  375. <div style="display: flex;justify-content:space-between;align-items: center;">
  376. <div style="width: 40%;display: flex;justify-content:space-between;">
  377. <span>开票CNY:¥{{ form.amountCny ? form.amountCny : '0.00' }}</span>
  378. <span>开票USD:${{ form.amountUsd ? form.amountUsd : '0.00' }}</span>
  379. <span>开票合计:¥{{ form.amountLoc ? form.amountLoc : '0.00' }}</span>
  380. </div>
  381. <div style="width: 60%;display: flex;justify-content:flex-end;align-items: center;">
  382. <el-checkbox style="margin-left: 10%" size="medium" :true-label="1" :false-label="0"
  383. :disabled="editSave" v-model="form.isExchangeToCny">转换成人民币
  384. </el-checkbox>
  385. <el-checkbox v-model="appendType" :disabled="statusType" false-label="检索"
  386. true-label="追加">追加</el-checkbox>
  387. <el-button type="primary" size="small"
  388. :disabled="statusType || (tableData.length > 0 && appendType == '检索')" plain
  389. @click="finstlbillslistAccBillV1fun(appendType)">提取费用
  390. </el-button>
  391. <el-button size="small" :disabled="tableData.length > 0" @click="ResetFilter">重置条件
  392. </el-button>
  393. <el-button icon="el-icon-arrow-down" type="text" size="small" v-if="!showForm"
  394. @click="showForm = true">开展</el-button>
  395. <el-button icon="el-icon-arrow-up" type="text" size="small" v-if="showForm"
  396. @click="showForm = false">收缩</el-button>
  397. </div>
  398. </div>
  399. </trade-card>
  400. <el-card style="margin-top: 10px">
  401. <el-tabs v-model="detailTabs" type="card">
  402. <el-tab-pane label="费用明细" name="first">
  403. <div style="margin-bottom: 10px;display: flex;">
  404. <search-query :datalist="serverData" :selectValue="form.serverName" :clearable="true"
  405. :buttonIf="false" :filterable="true"
  406. :forParameter="{ key: 'dictKey', label: 'dictValue', value: 'dictValue' }"
  407. placeholder="请选择开票项目" @corpChange="corpChange($event, 'serverName')"
  408. @corpFocus="serverWorkDictsfun">
  409. </search-query>
  410. <el-button style="margin-left: 10px" :disabled="!form.id || statusType" size="small"
  411. type="primary" @click="invoicingfun">生成开票明细</el-button>
  412. <el-button style="margin-left: 10px" :disabled="!form.id || statusType" size="small"
  413. type="warning" @click="invoicingRevokefun">撤销开票明细</el-button>
  414. <el-button size="small" :disabled="statusType" type="danger"
  415. @click="batchDeletefun">一键删除</el-button>
  416. <el-input style="width: 10%;margin-left: 10px;" v-model="invoiceAmountCNY" size="small"
  417. autocomplete="off" type="numbers" clearable placeholder="开票金额">
  418. <span style="line-height: 32px;" slot="suffix">CNY</span>
  419. </el-input>
  420. <el-input style="width: 10%;margin-left: 5px;" v-model="invoiceAmountUSD" size="small"
  421. autocomplete="off" type="numbers" clearable placeholder="开票金额">
  422. <span style="line-height: 32px;" slot="suffix">USD</span>
  423. </el-input>
  424. <el-button style="margin-left: 10px" :disabled="statusType" size="small" type="primary"
  425. @click="invoiceMatchingfun()">匹配金额</el-button>
  426. </div>
  427. <fininvoicesitems ref="fininvoicesitems" :tableData="tableData"
  428. :handleSelectionData="handleSelectionData" :editSave="editSave" :form="form"
  429. @handleSelectionChange="handleSelectionChange" @deletefun="detailsdeletionfun">
  430. </fininvoicesitems>
  431. </el-tab-pane>
  432. <el-tab-pane label="开票明细" name="second">
  433. <div style="margin-bottom: 10px;display: flex;">
  434. <el-button :disabled="statusType" size="small" type="danger"
  435. @click="invoicingBatchDelete">一键删除</el-button>
  436. </div>
  437. <fininvoiceitemdetail :tableData="InvoicingList"
  438. :handleSelectionData="invoicingCheckboxData"
  439. @handleSelectionChange="invoicingCheckboxChange" @deletefun="invoiceDeletionfun"
  440. @savefun="invoiceSavefun">
  441. </fininvoiceitemdetail>
  442. </el-tab-pane>
  443. </el-tabs>
  444. </el-card>
  445. <el-card class="box-card" style="margin-top: 10px">
  446. <el-row>
  447. <el-col :span="5">
  448. <el-form-item label="业务编号" prop="billNo">
  449. <el-input style="width: 100%;" v-model="form.billNo" size="small" autocomplete="off"
  450. :disabled="true" clearable placeholder="请输入业务编号">
  451. </el-input>
  452. </el-form-item>
  453. </el-col>
  454. <el-col :span="5">
  455. <el-form-item label="单据日期" prop="billDate">
  456. <el-date-picker v-model="form.billDate" clearable style="width: 100%;" type="date"
  457. size="small" :disabled="true" value-format="yyyy-MM-dd HH:mm" placeholder="选择单据日期">
  458. </el-date-picker>
  459. </el-form-item>
  460. </el-col>
  461. <el-col :span="5">
  462. <el-form-item label="制单人" prop="createUserName">
  463. <el-input style="width: 100%;" v-model="form.createUserName" size="small"
  464. autocomplete="off" :disabled="true" clearable placeholder="请输入制单人">
  465. </el-input>
  466. </el-form-item>
  467. </el-col>
  468. </el-row>
  469. </el-card>
  470. </el-form>
  471. </div>
  472. <!--设计报表弹窗-->
  473. <el-dialog append-to-body title="设计报表" class="el-dialogDeep" :visible.sync="DesignreportDialog" width="70%"
  474. :close-on-click-modal="false" :destroy-on-close="true" :close-on-press-escape="false" v-dialog-drag>
  475. <reports :id="form.id" :assemblyForm="form" businessValue="FPSQ"></reports>
  476. </el-dialog>
  477. <!--预览-->
  478. <el-dialog title="打印" :visible.sync="selectPrintingDialog" append-to-body width="70%"
  479. :close-on-click-modal="false" :destroy-on-close="true" :close-on-press-escape="false" v-dialog-drag>
  480. <div>
  481. <reportformsList ref="reportformsList" @reportRadio="reportRadio"></reportformsList>
  482. </div>
  483. <span slot="footer" class="dialog-footer">
  484. <el-button size="small" @click="selectPrintingDialog = false;">取 消</el-button>
  485. </span>
  486. </el-dialog>
  487. <el-dialog title="选择数据" :visible.sync="retrievePopupsType" append-to-body width="70%"
  488. :close-on-click-modal="false">
  489. <div>
  490. <avue-crud :option="retrievePopupsOption" :data="retrievePopupsData" ref="retrievePopupsRef"
  491. id="out-table">
  492. <template slot="menu" slot-scope="{ row }">
  493. <el-button type="text" size="small" @click.stop="retrievePopupsSelect(row)">选择
  494. </el-button>
  495. </template>
  496. </avue-crud>
  497. </div>
  498. </el-dialog>
  499. <!--审核弹窗-->
  500. <el-dialog append-to-body title="审批进度" class="el-dialogDeep" :visible.sync="checkScheduleDialog" width="40%"
  501. :close-on-click-modal="false" :destroy-on-close="true" :close-on-press-escape="false" v-dialog-drag>
  502. <check-schedule :checkId="checkId" :batchNo="batchNo" @choceScheduleFun="choceScheduleFun"></check-schedule>
  503. </el-dialog>
  504. <!--报表组件-->
  505. <reportContainer ref="reportContainer"></reportContainer>
  506. </div>
  507. </template>
  508. <script>
  509. import fininvoicesitems from "@/views/iosBasicData/fininvoicesApplyfor/assembly/fininvoicesitems.vue";
  510. import fininvoiceitemdetail from "@/views/iosBasicData/fininvoicesApplyfor/assembly/fininvoiceitemdetail.vue";
  511. import { getRateList } from "@/api/iosBasicData/rateManagement";
  512. import { finstlbillsGetByDetail, finstlbillsitemsRemove, finstlbillslistAccBillV1 } from "@/api/iosBasicData/finstlbills";
  513. import { bcorpsbankList, corpsinvoiceheaderList, getBcorpsList } from "@/api/iosBasicData/bcorps";
  514. import { bportsList } from "@/api/iosBasicData/bports";
  515. import SearchQuery from "@/components/iosbasic-data/searchquery.vue";
  516. import {
  517. finInvoicesApprove,
  518. fininvoicesDetail,
  519. revokeFinInvoicesApprove,
  520. fininvoicesSubmit,
  521. fininvoicesitemsRemove,
  522. generateFinInvoicesDetail,
  523. fininvoiceitemdetailRemove, revokeFinInvoicesDetail, fininvoiceitemdetailSubmit
  524. } from "@/api/iosBasicData/fininvoices";
  525. import { getWorkDicts } from "@/api/system/dictbiz";
  526. import { getCurrentDate } from "@/util/date";
  527. import reports from "@/views/iosBasicData/SeafreightExportF/bills/assembly/reports.vue";
  528. import reportformsList from "@/views/iosBasicData/SeafreightExportF/bills/assembly/reportformsList.vue";
  529. import { getList as getreportsList, reportsGetReportData } from "@/api/iosBasicData/reports";
  530. import reportContainer from "@/views/iosBasicData/report-container/report-container.vue";
  531. import checkSchedule from "@/components/checkH/checkSchedule.vue";
  532. import dicSelect from "@/components/dicSelect/main";
  533. import { finstlbillslistAccBillByCorp } from '@/api/iosBasicData/finstlbills'
  534. export default {
  535. components: { checkSchedule, reportContainer, reportformsList, reports, SearchQuery, fininvoicesitems, fininvoiceitemdetail, dicSelect },
  536. data() {
  537. return {
  538. options: [
  539. {
  540. value: null,
  541. label: '全部'
  542. }, {
  543. value: 'D',
  544. label: '收'
  545. }, {
  546. value: 'C',
  547. label: '付'
  548. }
  549. ],
  550. showForm: false,
  551. retrievePopupsType: false, // 弹窗开启关闭
  552. retrievePopupsData: [], // 选择弹窗数据
  553. retrievePopupsOption: {
  554. border: true,
  555. calcHeight: 30,
  556. tip: false,
  557. height: '500px',
  558. index: true,
  559. addBtn: false,
  560. viewBtn: false,
  561. delBtn: false,
  562. editBtn: false,
  563. refreshBtn: false,
  564. columnBtn: false,
  565. menuWidth: '60',
  566. header: false,
  567. column: [
  568. {
  569. label: "客户中文名",
  570. prop: "cnName",
  571. overHidden: true,
  572. },
  573. {
  574. label: "客户英文文名",
  575. prop: "cnName",
  576. overHidden: true,
  577. },
  578. ]
  579. },
  580. checkId: '', // 审核需要的id
  581. batchNo: '',
  582. checkScheduleDialog: false,
  583. DesignreportDialog: false, // 设计报表弹窗
  584. selectPrintingDialog: false, // 预览报表
  585. invoiceAmountCNY: 0, // 费用明细开票金额输入框CNY
  586. invoiceAmountUSD: 0, // 费用明细开票金额输入框USD
  587. statusType: false, // 是否已经提交
  588. serverData: [], // 开票项目数据
  589. detailTabs: 'first',
  590. appendType: '检索',
  591. pageLoading: false, // 全屏加载
  592. saveLoading: false, // 按钮加载
  593. form: {
  594. dc: null,
  595. invCurCode: 'CNY',
  596. isRp: 1,
  597. invType: '全电发票',
  598. taxRate: 0,
  599. invoiceDate: getCurrentDate(),
  600. isExchangeToCny: 0,
  601. billDate: getCurrentDate(),
  602. },
  603. tableData: [], // 费用明细数据
  604. InvoicingList: [], // 开票明细数据
  605. handleSelectionData: [], // 费用明细选择的数据
  606. invoicingCheckboxData: [], // 开票明细选择的数据
  607. corpData: [], // 结算单位数据
  608. invCorpData: [], // 开票单位
  609. bankReceiptData: [], // 结算单位银行账号数据
  610. // 业务类型
  611. businessTypesData: [
  612. {
  613. label: '海运出口',
  614. value: 'SE'
  615. }, {
  616. label: '海运进口',
  617. value: 'SI'
  618. }
  619. ],
  620. curData: [], // 币别
  621. destinationData: [], // 目的港
  622. podData: [], // 卸货港
  623. polData: [], // 装货港
  624. invCurCodeData: [], // 发票币种
  625. invTypeData: [], // 发票类型
  626. rules: {
  627. corpCnName: [
  628. { required: true, message: '请输入付费对象', trigger: 'blur' },
  629. ],
  630. invoiceDate: [
  631. { required: true, message: '请输入开票日期', trigger: 'blur' },
  632. ],
  633. exrate: [
  634. { required: true, message: '请输入导入汇率', trigger: 'blur' },
  635. ],
  636. taxRate: [
  637. { required: true, message: '请输入所属税率', trigger: 'blur' },
  638. ],
  639. invCurCode: [
  640. { required: true, message: '请输入所属发票币别', trigger: 'blur' },
  641. ],
  642. },
  643. roleName: [], // 当前的角色权限
  644. saberUserInfo: {}, // 当前登录人信息
  645. editPower: false, // 当前是否可以编辑
  646. }
  647. },
  648. props: {
  649. editSave: {
  650. type: Boolean,
  651. default: false
  652. }
  653. },
  654. watch: {
  655. // 监听 状态
  656. "form.status": {
  657. // 执行方法
  658. handler(oldValue, newValue) {
  659. if (oldValue == 3) {
  660. this.statusType = true
  661. } else {
  662. this.statusType = false
  663. }
  664. },
  665. deep: true, // 深度监听
  666. immediate: true // 第一次改变就执行
  667. },
  668. },
  669. created() {
  670. this.roleName = localStorage.getItem('roleName').split(',')
  671. // 获取当前登录人个人信息
  672. this.saberUserInfo = JSON.parse(localStorage.getItem('saber-userInfo')).content
  673. if (!this.form.id) {
  674. getRateList({ current: 1, size: 30 }).then(res => {
  675. for (let item of res.data.data.records) {
  676. if (item.code == "USD") {
  677. this.$set(this.form, 'exrate', item.exrate)
  678. }
  679. }
  680. })
  681. }
  682. if (this.$route.query.mblno) {
  683. // console.log(111111)
  684. this.form.mblno = this.$route.query.mblno
  685. this.form.corpCnName = this.$route.query.corpCnName
  686. this.form.corpId = this.$route.query.corpId
  687. }
  688. },
  689. methods: {
  690. ResetFilter() {
  691. this.form = {
  692. invCurCode: 'CNY',
  693. isRp: 1,
  694. invType: '全电发票',
  695. taxRate: 0,
  696. invoiceDate: getCurrentDate(),
  697. isExchangeToCny: 0,
  698. billDate: getCurrentDate(),
  699. }
  700. getRateList({ current: 1, size: 30 }).then(res => {
  701. for (let item of res.data.data.records) {
  702. if (item.code == "USD") {
  703. this.$set(this.form, 'exrate', item.exrate)
  704. }
  705. }
  706. })
  707. },
  708. //请核关闭
  709. choceScheduleFun() {
  710. this.checkScheduleDialog = false
  711. },
  712. // 打印
  713. reportRadio(val) {
  714. // 获取报表数据
  715. reportsGetReportData({
  716. billId: this.form.id,
  717. reportCode: val.classifyCode,
  718. groupCode: val.groupCode,
  719. type: 'FPSQ'
  720. }).then(res => {
  721. this.handleReportPreview(val.url, res.data.data.data)
  722. })
  723. },
  724. // 报表预览
  725. previewreportfun() {
  726. getreportsList(1, 10, {
  727. businessType: 'FPSQ',
  728. // classifyCode:'结算中心',
  729. // groupCode:'付费结算'
  730. }).then(res => {
  731. if (res.data.data.records.length == 1) {
  732. this.reportRadio(res.data.data.records[0])
  733. } else {
  734. this.saveLoading = true
  735. this.selectPrintingDialog = true
  736. this.saveLoading = false
  737. let page = {
  738. pageSize: 10,
  739. currentPage: 1,
  740. total: 0
  741. }
  742. this.$nextTick(() => {
  743. this.$refs.reportformsList.onLoad(page, {
  744. businessType: 'FPSQ',
  745. // classifyCode:'结算中心',
  746. // groupCode:'付费结算'
  747. })
  748. })
  749. }
  750. })
  751. },
  752. // 开票明细编辑完成保存
  753. invoiceSavefun(row) {
  754. row.amountRate = this.form.taxRate
  755. // 销售额/(1+税率)×税率
  756. row.amountTax = (row.amount / (1 + (Number(row.amountRate) / 100)) * (Number(row.amountRate) / 100)).toFixed(2)
  757. fininvoiceitemdetailSubmit(row).then(res => {
  758. this.$message.success('操作成功')
  759. this.fininvoicesDetailfun(this.form.id)
  760. })
  761. },
  762. // 确认开票信息
  763. invoicingfun() {
  764. if (this.handleSelectionData.length == 0) {
  765. this.$message.warning('请选择数据')
  766. return;
  767. }
  768. if (!this.form.serverName) {
  769. this.$message.warning('请选择开票项目')
  770. return
  771. }
  772. let obj = this.form
  773. obj.finInvoicesItemsList = []
  774. obj.businessTypes = this.form.businessTypes ? this.form.businessTypes.join(',') : ''
  775. obj.feeCnName = this.form.feeCnName ? this.form.feeCnName.join(',') : ''
  776. //开票日期
  777. if (this.form.invoiceDate) {
  778. obj.invoiceDate = this.form.invoiceDate.slice(0, 10) + ' 00:00:00'
  779. }
  780. // 业务日期
  781. if (this.form.accountDateFrom) {
  782. this.form.accountDateFrom = this.form.accountDateFrom.slice(0, 10) + ' 00:00:00'
  783. }
  784. if (this.form.accountDateTo) {
  785. this.form.accountDateTo = this.form.accountDateTo.slice(0, 10) + ' 00:00:00'
  786. }
  787. for (let item of this.handleSelectionData) {
  788. // 拿未开票的数据
  789. if (item.status == 0) {
  790. if (item.currentCurCode == 'CNY') {
  791. item.currentAmount = item.currentAmountCNY
  792. } else {
  793. item.currentAmount = item.currentAmountUSD
  794. }
  795. obj.finInvoicesItemsList.push(item)
  796. }
  797. }
  798. if (obj.finInvoicesItemsList.length == 0) {
  799. this.$message.warning('请选择未生成发票的数据')
  800. return
  801. }
  802. // 开票项目
  803. generateFinInvoicesDetail(obj).then(res => {
  804. this.$message.warning('操作成功')
  805. this.fininvoicesDetailfun(this.form.id)
  806. })
  807. this.detailTabs = 'second'
  808. },
  809. // 撤销开票信息
  810. invoicingRevokefun() {
  811. if (this.handleSelectionData.length == 0) {
  812. this.$message.warning('请选择数据')
  813. return;
  814. }
  815. let obj = this.form
  816. obj.finInvoicesItemsList = []
  817. obj.businessTypes = this.form.businessTypes ? this.form.businessTypes.join(',') : ''
  818. obj.feeCnName = this.form.feeCnName ? this.form.feeCnName.join(',') : ''
  819. //开票日期
  820. if (this.form.invoiceDate) {
  821. obj.invoiceDate = this.form.invoiceDate.slice(0, 10) + ' 00:00:00'
  822. }
  823. // 业务日期
  824. if (this.form.accountDateFrom) {
  825. obj.accountDateFrom = this.form.accountDateFrom.slice(0, 10) + ' 00:00:00'
  826. }
  827. if (this.form.accountDateTo) {
  828. obj.accountDateTo = this.form.accountDateTo.slice(0, 10) + ' 00:00:00'
  829. }
  830. for (let item of this.handleSelectionData) {
  831. // 拿未开票的数据
  832. if (item.status == 1) {
  833. if (item.currentCurCode == 'CNY') {
  834. item.currentAmount = item.currentAmountCNY
  835. } else {
  836. item.currentAmount = item.currentAmountUSD
  837. }
  838. obj.finInvoicesItemsList.push(item)
  839. }
  840. }
  841. if (obj.finInvoicesItemsList.length == 0) {
  842. this.$message.warning('请选择已生成发票的数据')
  843. return
  844. }
  845. // 撤销开票项目
  846. revokeFinInvoicesDetail(obj).then(res => {
  847. this.$message.warning('操作成功')
  848. this.fininvoicesDetailfun(this.form.id)
  849. })
  850. },
  851. // 费用明细一键删除
  852. batchDeletefun() {
  853. if (this.handleSelectionData.length == 0) {
  854. return this.$message.warning('请选择要删除的数据')
  855. }
  856. this.$confirm("确定将选择数据删除?", {
  857. confirmButtonText: "确定",
  858. cancelButtonText: "取消",
  859. type: "warning"
  860. }).then(() => {
  861. // 获取有id 的数据
  862. const itemsWithId = this.handleSelectionData.filter(item => item.hasOwnProperty('id'));
  863. let arrIds = itemsWithId.map(item => item.id) // 获取id 数据
  864. // 把选中的删除掉
  865. this.handleSelectionData.forEach((item) => {
  866. for (let index in this.tableData) {
  867. if (item.accBillNo == this.tableData[index].accBillNo) {
  868. this.tableData.splice(Number(index), 1)
  869. }
  870. }
  871. })
  872. // 有id 的处理
  873. if (itemsWithId.length != 0) {
  874. fininvoicesitemsRemove(arrIds.join(',')).then(res => {
  875. this.$message.success('操作成功')
  876. })
  877. }
  878. })
  879. },
  880. // 费用明细开票匹配
  881. invoiceMatchingfun() {
  882. if (this.invoiceAmountCNY != 0 || this.invoiceAmountUSD != 0) {
  883. let dataCNY = JSON.parse(JSON.stringify(this.invoiceAmountCNY))
  884. let dataUSD = JSON.parse(JSON.stringify(this.invoiceAmountUSD))
  885. for (let item of this.tableData) {
  886. this.$refs.fininvoicesitems.$refs.tableRef.toggleRowSelection(item, false)
  887. if (this.invoiceAmountCNY != 0) {
  888. if (dataCNY < 0) {
  889. dataCNY = 0
  890. }
  891. if (dataCNY > 1500) {
  892. if (item.currentCurCode == 'CNY') {
  893. this.$set(item, 'currentAmountCNY', 1500)
  894. this.$refs.fininvoicesitems.$refs.tableRef.toggleRowSelection(item, true)
  895. dataCNY -= 1500
  896. }
  897. } else {
  898. if (item.currentCurCode == 'CNY') {
  899. if (dataCNY != 0) {
  900. this.$refs.fininvoicesitems.$refs.tableRef.toggleRowSelection(item, true)
  901. }
  902. this.$set(item, 'currentAmountCNY', dataCNY)
  903. dataCNY -= 1500
  904. }
  905. }
  906. }
  907. if (this.invoiceAmountUSD != 0) {
  908. if (dataUSD < 0) {
  909. dataUSD = 0
  910. }
  911. if (dataUSD > 1500) {
  912. if (item.currentCurCode == 'USD') {
  913. this.$set(item, 'currentAmountUSD', 1500)
  914. this.$refs.fininvoicesitems.$refs.tableRef.toggleRowSelection(item, true)
  915. dataUSD -= 1500
  916. }
  917. } else {
  918. if (item.currentCurCode == 'USD') {
  919. this.$set(item, 'currentAmountUSD', dataUSD)
  920. if (dataUSD != 0) {
  921. this.$refs.fininvoicesitems.$refs.tableRef.toggleRowSelection(item, true)
  922. }
  923. dataUSD -= 1500
  924. }
  925. }
  926. }
  927. }
  928. }
  929. },
  930. // 费用明细单个删除
  931. detailsdeletionfun(id, index) {
  932. this.$confirm("确定将选择数据删除?", {
  933. confirmButtonText: "确定",
  934. cancelButtonText: "取消",
  935. type: "warning"
  936. }).then(() => {
  937. if (id) {
  938. fininvoicesitemsRemove(id).then(res => {
  939. this.$message.success('操作成功')
  940. })
  941. }
  942. console.log(index, 794)
  943. this.tableData.splice(index, 1)
  944. })
  945. },
  946. // 开票一键删除
  947. invoicingBatchDelete() {
  948. if (this.invoicingCheckboxData.length == 0) {
  949. return this.$message.warning('请选择要删除的数据')
  950. }
  951. this.$confirm("确定将选择数据删除?", {
  952. confirmButtonText: "确定",
  953. cancelButtonText: "取消",
  954. type: "warning"
  955. }).then(() => {
  956. // 获取有id 的数据
  957. const itemsWithId = this.invoicingCheckboxData.filter(item => item.hasOwnProperty('id'));
  958. let arrIds = itemsWithId.map(item => item.id) // 获取id 数据
  959. // 把选中的删除掉
  960. this.invoicingCheckboxData.forEach((item) => {
  961. for (let index in this.InvoicingList) {
  962. if (item.id == this.InvoicingList[index].id) {
  963. this.InvoicingList.splice(Number(index), 1)
  964. }
  965. }
  966. })
  967. // 有id 的处理
  968. if (itemsWithId.length != 0) {
  969. fininvoiceitemdetailRemove(arrIds.join(',')).then(res => {
  970. this.$message.success('操作成功')
  971. })
  972. }
  973. })
  974. },
  975. // 开票明细单个删除
  976. invoiceDeletionfun(id, index) {
  977. this.$confirm("确定将选择数据删除?", {
  978. confirmButtonText: "确定",
  979. cancelButtonText: "取消",
  980. type: "warning"
  981. }).then(() => {
  982. if (id) {
  983. fininvoiceitemdetailRemove(id).then(res => {
  984. this.$message.success('操作成功')
  985. })
  986. }
  987. this.InvoicingList.splice(index, 1)
  988. })
  989. },
  990. // 下拉框的回调
  991. corpChange(value, name) {
  992. // 结算单位
  993. if (name == 'corpCnName') {
  994. if (!value) {
  995. this.$set(this.form, 'corpId', '')
  996. this.$set(this.form, 'corpCnName', '')
  997. this.$set(this.form, 'corpEnName', '')
  998. return
  999. }
  1000. for (let item of this.corpData) {
  1001. if (item.cnName == value) {
  1002. this.$set(this.form, 'corpId', item.id)
  1003. this.$set(this.form, 'corpCnName', item.cnName)
  1004. this.$set(this.form, 'corpEnName', item.enName)
  1005. bcorpsbankList(1, 10, { pid: this.form.corpId }).then(res => {
  1006. if (res.data.data.records.length != 0) {
  1007. this.$set(this.form, 'bankReceiptAccountNo', res.data.data.records[0].accountNo)
  1008. this.$set(this.form, 'bankReceiptBankName', res.data.data.records[0].accountBank)
  1009. }
  1010. })
  1011. // 带出开票单位数据
  1012. corpsinvoiceheaderList(1, 20, { pid: this.form.corpId }).then(res => {
  1013. if (res.data.data.records.length != 0) {
  1014. this.$set(this.form, 'invCorpId', res.data.data.records[0].id)
  1015. this.$set(this.form, 'invCorpCnName', res.data.data.records[0].invoiceHeader)
  1016. this.$set(this.form, 'invCorpTaxNo', res.data.data.records[0].uscc) // 税号
  1017. this.$set(this.form, 'invCorpAccountBankUsd', res.data.data.records[0].accountBankUsd) // 美元银行
  1018. this.$set(this.form, 'invCorpAccountNoUsd', res.data.data.records[0].accountNoUsd) // 美元账户
  1019. this.$set(this.form, 'invCorpAccountBankCny', res.data.data.records[0].accountBankUsd) // 人民币银行
  1020. this.$set(this.form, 'invCorpAccountNoCny', res.data.data.records[0].accountNoUsd) // 人民币账户
  1021. }
  1022. })
  1023. }
  1024. }
  1025. }
  1026. // 开票单位
  1027. else if (name == 'invCorpCnName') {
  1028. this.$set(this.form, 'invCorpAccountBankUsd', '')
  1029. this.$set(this.form, 'invCorpAccountNoUsd', '')
  1030. this.$set(this.form, 'invCorpAccountBankCny', '')
  1031. this.$set(this.form, 'invCorpAccountNoCny', '')
  1032. if (!value) {
  1033. this.$set(this.form, 'invCorpId', '')
  1034. this.$set(this.form, 'invCorpCnName', '')
  1035. return
  1036. }
  1037. for (let item of this.invCorpData) {
  1038. if (item.id == value) {
  1039. this.$set(this.form, 'invCorpId', item.id)
  1040. this.$set(this.form, 'invCorpCnName', item.invoiceHeader)
  1041. this.$set(this.form, 'invCorpTaxNo', item.uscc) // 税号
  1042. this.$set(this.form, 'invCorpAccountBankUsd', item.accountBankUsd) // 美元银行
  1043. this.$set(this.form, 'invCorpAccountNoUsd', item.accountNoUsd) // 美元账户
  1044. this.$set(this.form, 'invCorpAccountBankCny', item.accountBankUsd) // 人民币银行
  1045. this.$set(this.form, 'invCorpAccountNoCny', item.accountNoUsd) // 人民币账户
  1046. }
  1047. }
  1048. }
  1049. // 结算单位银行账户
  1050. else if (name == 'bankReceiptAccountNo') {
  1051. for (let item of this.bankReceiptData) {
  1052. if (item.accountNo == value) {
  1053. // this.$set(this.form, 'bankReceiptCorpName', item.accountName)
  1054. this.$set(this.form, 'bankReceiptAccountNo', item.accountNo)
  1055. this.$set(this.form, 'bankReceiptBankName', item.accountBank)
  1056. }
  1057. }
  1058. }
  1059. else {
  1060. this.$set(this.form, name, value)
  1061. }
  1062. },
  1063. // 费用明细表格多选
  1064. handleSelectionChange(arr) {
  1065. this.handleSelectionData = arr
  1066. },
  1067. // 开票明细表格多选
  1068. invoicingCheckboxChange(arr) {
  1069. this.invoicingCheckboxData = arr
  1070. },
  1071. // 编辑事件
  1072. editHandle() {
  1073. this.editSave = false
  1074. },
  1075. submit(type) {
  1076. this.$confirm("确定进行发票申请操作?", {
  1077. confirmButtonText: "确定",
  1078. cancelButtonText: "取消",
  1079. type: "warning"
  1080. }).then(() => {
  1081. this.editCustomer(type)
  1082. }).finally(() => {
  1083. this.saveLoading = false
  1084. });
  1085. },
  1086. newbillFun() {
  1087. if (this.statusType) {
  1088. this.$emit('toAddEdit')
  1089. } else {
  1090. this.$confirm('是否需要保存?', '提示', {
  1091. confirmButtonText: '确定',
  1092. cancelButtonText: '取消',
  1093. type: 'warning'
  1094. }).then(() => {
  1095. this.editCustomer('toAddEdit')
  1096. }).catch(() => {
  1097. this.$emit('toAddEdit')
  1098. });
  1099. }
  1100. },
  1101. // 保存按钮事件
  1102. editCustomer(type) {
  1103. this.$refs.form.validate((valid) => {
  1104. if (!valid) return
  1105. if (!this.form.id) {
  1106. // 是否选择从表数据
  1107. if (this.handleSelectionData.length == 0) {
  1108. this.$message.warning('请选择结算数据');
  1109. return;
  1110. }
  1111. }
  1112. this.form.type = '申请'
  1113. this.form.billNoFormat = 'FPSQ'
  1114. this.form.businessTypeCode = 'FPSQ'
  1115. this.form.businessTypes = this.form.businessTypes ? this.form.businessTypes.join(',') : ''
  1116. this.form.feeCnName = this.form.feeCnName ? this.form.feeCnName.join(',') : ''
  1117. //开票日期
  1118. if (this.form.invoiceDate) {
  1119. this.form.invoiceDate = this.form.invoiceDate.slice(0, 10) + ' 00:00:00'
  1120. }
  1121. // 业务日期
  1122. if (this.form.accountDateFrom) {
  1123. this.form.accountDateFrom = this.form.accountDateFrom.slice(0, 10) + ' 00:00:00'
  1124. }
  1125. if (this.form.accountDateTo) {
  1126. this.form.accountDateTo = this.form.accountDateTo.slice(0, 10) + ' 00:00:00'
  1127. }
  1128. if (this.form.id) {
  1129. if (this.handleSelectionData.length) {
  1130. this.form.finInvoicesItemsList = this.handleSelectionData.map(item => {
  1131. if (item.currentCurCode == 'CNY') {
  1132. item.currentAmount = item.currentAmountCNY
  1133. } else {
  1134. item.currentAmount = item.currentAmountUSD
  1135. }
  1136. return item
  1137. })
  1138. }
  1139. this.form.finInvoicesItemsList = this.form.finInvoicesItemsList.map(item => {
  1140. if (item.currentCurCode == 'CNY') {
  1141. item.currentAmount = item.currentAmountCNY
  1142. } else {
  1143. item.currentAmount = item.currentAmountUSD
  1144. }
  1145. return item
  1146. })
  1147. } else {
  1148. this.form.finInvoicesItemsList = this.handleSelectionData.map(item => {
  1149. if (item.currentCurCode == 'CNY') {
  1150. item.currentAmount = item.currentAmountCNY
  1151. } else {
  1152. item.currentAmount = item.currentAmountUSD
  1153. }
  1154. return item
  1155. })
  1156. }
  1157. this.form.finInvoiceItemDetailList = this.InvoicingList
  1158. this.saveLoading = true
  1159. if (type == '提交') {
  1160. fininvoicesSubmit(this.form).then(res => {
  1161. res.data.data.businessTypes = res.data.data.businessTypes ? res.data.data.businessTypes.split(',') : []
  1162. res.data.data.feeCnName = res.data.data.feeCnName ? res.data.data.feeCnName.split(',') : []
  1163. this.form = res.data.data
  1164. this.finInvoicesApprovefun()
  1165. })
  1166. } else if (type == 'toAddEdit') {
  1167. fininvoicesSubmit(this.form).then(res => {
  1168. this.$message.success('操作成功');
  1169. this.$emit(type)
  1170. }).finally(() => {
  1171. this.pageLoading = false
  1172. this.saveLoading = false
  1173. })
  1174. } else {
  1175. this.fininvoicesSubmitfun(this.form)
  1176. }
  1177. })
  1178. },
  1179. retrievePopupsSelect(row) {
  1180. this.$set(this.form, 'corpId', row.id)
  1181. this.$set(this.form, 'corpCnName', row.cnName)
  1182. this.$set(this.form, 'corpEnName', row.enName)
  1183. bcorpsbankList(1, 10, { pid: row.id }).then(res => {
  1184. if (res.data.data.records.length != 0) {
  1185. this.$set(this.form, 'bankReceiptAccountNo', res.data.data.records[0].accountNo)
  1186. this.$set(this.form, 'bankReceiptBankName', res.data.data.records[0].accountBank)
  1187. }
  1188. })
  1189. // 带出开票单位数据
  1190. corpsinvoiceheaderList(1, 20, { pid: row.id }).then(res => {
  1191. if (res.data.data.records.length != 0) {
  1192. this.$set(this.form, 'invCorpId', res.data.data.records[0].id)
  1193. this.$set(this.form, 'invCorpCnName', res.data.data.records[0].invoiceHeader)
  1194. this.$set(this.form, 'invCorpTaxNo', res.data.data.records[0].uscc) // 税号
  1195. this.$set(this.form, 'invCorpAccountBankUsd', res.data.data.records[0].accountBankUsd) // 美元银行
  1196. this.$set(this.form, 'invCorpAccountNoUsd', res.data.data.records[0].accountNoUsd) // 美元账户
  1197. this.$set(this.form, 'invCorpAccountBankCny', res.data.data.records[0].accountBankUsd) // 人民币银行
  1198. this.$set(this.form, 'invCorpAccountNoCny', res.data.data.records[0].accountNoUsd) // 人民币账户
  1199. }
  1200. })
  1201. this.retrievePopupsType = false
  1202. this.finstlbillslistAccBillV1fun(this.appendType)
  1203. },
  1204. finstlbillslistAccBillByCorpfun() {
  1205. let obj = {}
  1206. if (this.form.accountDateFrom) {
  1207. obj.accountDateFrom = this.form.accountDateFrom.slice(0, 10) + ' 00:00:00'
  1208. }
  1209. if (this.form.accountDateTo) {
  1210. obj.accountDateTo = this.form.accountDateTo.slice(0, 10) + ' 00:00:00'
  1211. }
  1212. obj.type = '3'
  1213. obj.billNo = this.form.businessNo // 业务编号
  1214. obj.businessBillNo = this.form.billNo // 业务编号
  1215. obj.mblno = this.form.mblno // 主单编号
  1216. obj.hblno = this.form.hblno // 分单编号
  1217. obj.bookingNo = this.form.bookingNo // 订舱号(BOOK NO)
  1218. obj.curCode = this.form.curCode // 币种
  1219. obj.businessType = this.form.businessTypes ? this.form.businessTypes.join(',') : '' // 业务类型
  1220. obj.feeCnName = this.form.feeCnName ? this.form.feeCnName.join(',') : ''
  1221. finstlbillslistAccBillByCorp(obj).then(res => {
  1222. this.retrievePopupsType = true
  1223. this.retrievePopupsData = res.data.data
  1224. })
  1225. },
  1226. // 检索
  1227. finstlbillslistAccBillV1fun(type) {
  1228. if (this.form.businessNo || this.form.mblno || this.form.checkNo) {
  1229. if (!this.form.corpId) {
  1230. this.finstlbillslistAccBillByCorpfun()
  1231. return
  1232. }
  1233. } else {
  1234. if (!this.form.corpId) {
  1235. this.$message.warning('请选择结算单位');
  1236. return
  1237. }
  1238. }
  1239. let obj = {}
  1240. // //开票日期
  1241. // if(this.form.invoiceDate) {
  1242. // obj.invoiceDate = this.form.invoiceDate.slice(0,10) + ' 00:00:00'
  1243. // }
  1244. // 业务日期
  1245. if (this.form.accountDateFrom) {
  1246. obj.accountDateFrom = this.form.accountDateFrom.slice(0, 10) + ' 00:00:00'
  1247. }
  1248. if (this.form.accountDateTo) {
  1249. obj.accountDateTo = this.form.accountDateTo.slice(0, 10) + ' 00:00:00'
  1250. }
  1251. obj.type = '3'
  1252. obj.billNo = this.form.businessNo // 业务编号
  1253. obj.businessBillNo = this.form.billNo // 业务编号
  1254. obj.mblno = this.form.mblno // 主单编号
  1255. obj.hblno = this.form.hblno // 分单编号
  1256. obj.bookingNo = this.form.bookingNo // 订舱号(BOOK NO)
  1257. obj.curCode = this.form.curCode // 币种
  1258. obj.businessType = this.form.businessTypes ? this.form.businessTypes.join(',') : '' // 业务类型
  1259. obj.feeCnName = this.form.feeCnName ? this.form.feeCnName.join(',') : ''
  1260. // 判断是否有对账单号
  1261. if (this.form.checkNo) {
  1262. obj.corpId = this.form.corpId // 结算单位
  1263. obj.checkNo = this.form.checkNo // CHK NO 对账单号
  1264. finstlbillsGetByDetail(obj).then(res => {
  1265. let arr = res.data.data.finStlBillsItemsList.map((item, index) => {
  1266. item.lineNo = Number(index) + 1 // 行号
  1267. item.currentCurCode = item.curCode
  1268. item.currentExrate = item.exrate
  1269. if (item.currentCurCode == 'CNY') {
  1270. // 本次发票金额
  1271. this.$set(item, 'currentAmountCNY', item.appliedInvoiceCurrentAmount)
  1272. } else {
  1273. // 本次发票金额
  1274. this.$set(item, 'currentAmountUSD', item.appliedInvoiceCurrentAmount)
  1275. }
  1276. delete item.id
  1277. return item
  1278. })
  1279. if (type == '追加') {
  1280. let a = [...this.tableData, ...arr,]
  1281. this.tableData = a.filter((obj, index) => {
  1282. return a.findIndex((elem) => {
  1283. return elem.accBillNo === obj.accBillNo
  1284. }) === index;
  1285. });
  1286. } else {
  1287. // 获取有id 的数据
  1288. const itemsWithId = this.tableData.filter(item => item.hasOwnProperty('id'));
  1289. let arrIds = itemsWithId.map(item => item.id) // 获取id 数据
  1290. // 有id 的处理
  1291. if (itemsWithId.length != 0) {
  1292. fininvoicesitemsRemove(arrIds.join(',')).then(res => {
  1293. this.$message.success('操作成功')
  1294. })
  1295. }
  1296. if (arr.length == 0) {
  1297. this.$message.warning('当前检索暂无数据!')
  1298. }
  1299. this.tableData = arr
  1300. }
  1301. })
  1302. } else {
  1303. obj.corpCnName = this.form.corpId // 结算单位
  1304. obj.checkBillNo = this.form.checkNo // 对账单号
  1305. finstlbillslistAccBillV1(obj).then(res => {
  1306. let arr = res.data.data.map((item, index) => {
  1307. item.lineNo = Number(index) + 1 // 行号
  1308. item.accBillId = item.id
  1309. item.accBillNo = item.billNo // JOB NO
  1310. item.billNo = item.businessBillNo
  1311. item.billNo = item.businessBillNo // 账单编号
  1312. item.accDate = item.createTime
  1313. item.currentCurCode = item.curCode
  1314. item.currentExrate = item.exrate
  1315. item.dc = item.accountDc
  1316. if (item.currentCurCode == 'CNY') {
  1317. // 本次发票金额
  1318. this.$set(item, 'currentAmountCNY', item.appliedInvoiceCurrentAmount)
  1319. } else {
  1320. // 本次发票金额
  1321. this.$set(item, 'currentAmountUSD', item.appliedInvoiceCurrentAmount)
  1322. }
  1323. delete item.id
  1324. return item
  1325. })
  1326. if (type == '追加') {
  1327. let a = [...this.tableData, ...arr,]
  1328. this.tableData = a.filter((obj, index) => {
  1329. return a.findIndex((elem) => {
  1330. return elem.accBillNo === obj.accBillNo
  1331. }) === index;
  1332. });
  1333. } else {
  1334. // 获取有id 的数据
  1335. const itemsWithId = this.tableData.filter(item => item.hasOwnProperty('id'));
  1336. let arrIds = itemsWithId.map(item => item.id) // 获取id 数据
  1337. // 有id 的处理
  1338. if (itemsWithId.length != 0) {
  1339. fininvoicesitemsRemove(arrIds.join(',')).then(res => {
  1340. this.$message.success('操作成功')
  1341. })
  1342. }
  1343. if (arr.length == 0) {
  1344. this.$message.warning('当前检索暂无数据!')
  1345. }
  1346. this.tableData = arr
  1347. }
  1348. })
  1349. }
  1350. },
  1351. // 保存接口
  1352. fininvoicesSubmitfun(obj) {
  1353. fininvoicesSubmit(obj).then(res => {
  1354. this.saveLoading = false
  1355. this.$message.success('操作成功');
  1356. this.fininvoicesDetailfun(res.data.data.id)
  1357. }).catch(() => {
  1358. this.saveLoading = false
  1359. });
  1360. },
  1361. // 详情接口
  1362. fininvoicesDetailfun(id) {
  1363. this.pageLoading = true
  1364. fininvoicesDetail(id).then(res => {
  1365. this.form = res.data.data
  1366. if (this.roleName.indexOf('admin') == -1 ? this.roleName.indexOf('允许修改他人业务') == -1 ? this.saberUserInfo.user_id != this.form.createUser : false : false) {
  1367. this.editPower = true
  1368. } else {
  1369. this.editPower = false
  1370. }
  1371. this.form.businessTypes = this.form.businessTypes ? this.form.businessTypes.split(',') : [] // 业务类型转换成数组显示
  1372. this.form.feeCnName = this.form.feeCnName ? this.form.feeCnName.split(',') : []
  1373. this.tableData = this.form.finInvoicesItemsList.map(item => {
  1374. if (item.currentCurCode == 'CNY') {
  1375. this.$set(item, 'currentAmountCNY', item.currentAmount)
  1376. } else {
  1377. this.$set(item, 'currentAmountUSD', item.currentAmount)
  1378. }
  1379. return item
  1380. })
  1381. this.InvoicingList = this.form.finInvoiceItemDetailList.map(item => {
  1382. item.edit = false
  1383. return item
  1384. })
  1385. }).finally(() => {
  1386. this.pageLoading = false
  1387. })
  1388. },
  1389. // 确认申请
  1390. finInvoicesApprovefun() {
  1391. this.pageLoading = true
  1392. this.form.businessTypes = this.form.businessTypes ? this.form.businessTypes.join(',') : ''
  1393. this.form.feeCnName = this.form.feeCnName ? this.form.feeCnName.join(',') : ''
  1394. finInvoicesApprove(this.form).then(res => {
  1395. this.$message.success('操作成功');
  1396. this.fininvoicesDetailfun(res.data.data.id)
  1397. this.editSave = true // 提交之后编辑按钮显示出来
  1398. }).finally(() => {
  1399. this.pageLoading = false
  1400. })
  1401. },
  1402. // 撤销申请
  1403. revokeFinInvoicesApprovefun() {
  1404. this.$confirm("确定进行撤销发票申请操作?", {
  1405. confirmButtonText: "确定",
  1406. cancelButtonText: "取消",
  1407. type: "warning"
  1408. }).then(res => {
  1409. this.pageLoading = true
  1410. this.form.businessTypes = this.form.businessTypes ? this.form.businessTypes.join(',') : ''
  1411. this.form.feeCnName = this.form.feeCnName ? this.form.feeCnName.join(',') : ''
  1412. revokeFinInvoicesApprove(this.form).then(res => {
  1413. this.$message.success('操作成功');
  1414. this.fininvoicesDetailfun(res.data.data.id)
  1415. }).finally(() => {
  1416. this.pageLoading = false
  1417. })
  1418. })
  1419. },
  1420. //返回列表
  1421. backToList() {
  1422. this.$emit('goBack')
  1423. },
  1424. // 获取客户名称数据 往来单位数据
  1425. corpBcorpsListfun(cnName) {
  1426. getBcorpsList(1, 10, { cnName }).then(res => {
  1427. this.corpData = res.data.data.records
  1428. })
  1429. },
  1430. // 根据往来单位选择调用获取银行数据
  1431. bcorpsbankListfun(accountNo) {
  1432. bcorpsbankList(1, 10, {
  1433. // curNo:this.cntyCode,
  1434. pid: this.form.corpId,
  1435. accountNo: accountNo
  1436. }).then(res => {
  1437. this.bankReceiptData = res.data.data.records
  1438. })
  1439. },
  1440. // 根据往来单位选择调用获取发票抬头数据 开票单位数据
  1441. invcorpsinvoiceheaderListfun(cnName) {
  1442. corpsinvoiceheaderList(1, 20, { pid: this.form.corpId, cnName }).then(res => {
  1443. this.invCorpData = res.data.data.records
  1444. })
  1445. },
  1446. // 获取币别数据
  1447. getRateListfun(cnName) {
  1448. getRateList({ current: 1, size: 10, cnName }).then(res => {
  1449. this.curData = res.data.data.records
  1450. })
  1451. },
  1452. // 获取发票币别数据
  1453. invCurCodeRateListfun(cnName) {
  1454. getRateList({ current: 1, size: 20, cnName }).then(res => {
  1455. this.invCurCodeData = res.data.data.records
  1456. })
  1457. },
  1458. // 目的地
  1459. destinationBportsListfun(enName) {
  1460. bportsList(1, 10, { enName }).then(res => {
  1461. this.destinationData = res.data.data.records
  1462. })
  1463. },
  1464. // 卸货港
  1465. podBportsListfun(enName) {
  1466. bportsList(1, 10, { enName }).then(res => {
  1467. this.podData = res.data.data.records
  1468. })
  1469. },
  1470. // 装货港
  1471. polBportsListfun(enName) {
  1472. bportsList(1, 10, { enName }).then(res => {
  1473. this.polData = res.data.data.records
  1474. })
  1475. },
  1476. // 发票类型字典数据
  1477. invTypeWorkDictsfun() {
  1478. getWorkDicts('inv_type_los').then(res => {
  1479. this.invTypeData = res.data.data;
  1480. })
  1481. },
  1482. serverWorkDictsfun() {
  1483. getWorkDicts('Invoice_information_los').then(res => {
  1484. this.serverData = res.data.data;
  1485. })
  1486. },
  1487. // 预览报表
  1488. handleReportPreview(url, data) {
  1489. console.log(url, 1670)
  1490. console.log(data, 1671)
  1491. Stimulsoft.Base.StiLicense.key = '6vJhGtLLLz2GNviWmUTrhSqnOItdDwjBylQzQcAOiHn0s4gy0Fr5YoUZ9V00Y0igCSFQzwEqYBh/N77k4f0fWXTHW5rqeBNLkaurJDenJ9o97TyqHs9HfvINK18Uwzsc/bG01Rq+x3H3Rf+g7AY92gvWmp7VA2Uxa30Q97f61siWz2dE5kdBVcCnSFzC6awE74JzDcJMj8OuxplqB1CYcpoPcOjKy1PiATlC3UsBaLEXsok1xxtRMQ283r282tkh8XQitsxtTczAJBxijuJNfziYhci2jResWXK51ygOOEbVAxmpflujkJ8oEVHkOA/CjX6bGx05pNZ6oSIu9H8deF94MyqIwcdeirCe60GbIQByQtLimfxbIZnO35X3fs/94av0ODfELqrQEpLrpU6FNeHttvlMc5UVrT4K+8lPbqR8Hq0PFWmFrbVIYSi7tAVFMMe2D1C59NWyLu3AkrD3No7YhLVh7LV0Tttr/8FrcZ8xirBPcMZCIGrRIesrHxOsZH2V8t/t0GXCnLLAWX+TNvdNXkB8cF2y9ZXf1enI064yE5dwMs2fQ0yOUG/xornE'
  1492. // Stimulsoft.Base.StiLicense.Key = '6vJhGtLLLz2GNviWmUTrhSqnOItdDwjBylQzQcAOiHkcgIvwL0jnpsDqRpWg5FI5kt2G7A0tYIcUygBh1sPs7plofUOqPB1a4HBIXJB621mau2oiAIj+ysU7gKUXfjn/D5BocmduNB+ZMiDGPxFrAp3PoD0nYNkkWh8r7gBZ1v/JZSXGE3bQDrCQCNSy6mgby+iFAMV8/PuZ1z77U+Xz3fkpbm6MYQXYp3cQooLGLUti7k1TFWrnawT0iEEDJ2iRcU9wLqn2g9UiWesEZtKwI/UmEI2T7nv5NbgV+CHguu6QU4WWzFpIgW+3LUnKCT/vCDY+ymzgycw9A9+HFSzARiPzgOaAuQYrFDpzhXV+ZeX31AxWlnzjDWqpfluygSNPtGul5gyNt2CEoJD1Yom0VN9fvRonYsMsimkFFx2AwyVpPcs+JfVBtpPbTcZscnzUdmiIvxv8Gcin6sNSibM6in/uUKFt3bVgW/XeMYa7MLGF53kvBSwi78poUDigA2n12SmghLR0AHxyEDIgZGOTbNI33GWu7ZsPBeUdGu55R8w='
  1493. Stimulsoft.Base.Localization.StiLocalization.addLocalizationFile('/reports/stimulsoft/Localization/zh-CHS.xml', true, 'zh-CHS')
  1494. Stimulsoft.Base.Localization.StiLocalization.setLocalizationFile('/reports/stimulsoft/Localization/zh-CHS.xml')
  1495. // 工具栏
  1496. var options = new Stimulsoft.Viewer.StiViewerOptions()
  1497. options.height = '100%'
  1498. options.appearance.scrollbarsMode = true // 滚动条模式
  1499. options.toolbar.showDesignButton = false // 显示设计按钮
  1500. options.toolbar.showAboutButton = false // 显示关于按钮
  1501. options.toolbar.showResourcesButton = false // 显示资源按钮
  1502. options.toolbar.showFullScreenButton = false // 显示全屏按钮
  1503. options.toolbar.showOpenButton = false // 显示打开按钮
  1504. options.appearance.showTooltips = false // 显示工具提示
  1505. options.appearance.showDialogsHelp = false // 显示对话框帮助
  1506. options.exports.showExportToDocument = false // 显示导出到文档
  1507. options.toolbar.showParametersButton = true // 显示参数按钮
  1508. options.appearance.bookmarksPrint = true // 书签打印
  1509. // options.toolbar.showPrintButton = false // 打印按钮是否显示 下面直接自定义控制打印弹窗是否开启
  1510. // printDestination 参数:用于指定报表打印的目标位置,可以是打印机、PDF 文件或者直接打印到浏览器等。
  1511. // Stimulsoft.Viewer.StiPrintDestination.Direct:表示直接打印到打印机,即将报表内容直接发送至打印机进行打印。
  1512. // 通过设置不同的 printDestination 参数,你可以控制报表打印的行为,例如是直接打印到打印机,还是生成 PDF 文件,或者直接在浏览器中预览打印内容等。
  1513. options.toolbar.printDestination = Stimulsoft.Viewer.StiPrintDestination.Direct
  1514. // htmlRenderMode html渲染模式
  1515. options.appearance.htmlRenderMode = Stimulsoft.Report.Export.StiHtmlExportMode.Table
  1516. // 是创建一个 Stimulsoft 报表查看器的实例的代码
  1517. let viewer = new Stimulsoft.Viewer.StiViewer(options, 'StiViewer', false)
  1518. // 报表
  1519. console.log("创建一个报表实例");
  1520. console.log()
  1521. let report = new window.Stimulsoft.Report.StiReport();
  1522. // 加载文件
  1523. console.log("从url加载报表");
  1524. // report.loadFile("/reports/stimulsoft/demos/SimpleList.mrt");
  1525. report.load(url)
  1526. data.pageOne = 'Page : 1 of 1'
  1527. // 处理超长数据
  1528. if (data.hshipperDetails) {
  1529. var consignerIndex2 = data.hshipperDetails.indexOf('\n')
  1530. for (let i = 0; i < 4; i++) {
  1531. consignerIndex2 = data.hshipperDetails.indexOf('\n', consignerIndex2 + 1);
  1532. }
  1533. if (consignerIndex2 != -1) {
  1534. var hshipperDetails = data.hshipperDetails.substring(consignerIndex2 + 2, data.hshipperDetails.length)
  1535. data.hshipperDetails = data.hshipperDetails.substring(0, consignerIndex2) + ' *'
  1536. data.commodityDescr += '\n*' + hshipperDetails
  1537. }
  1538. }
  1539. if (data.hconsigneeDetails) {
  1540. var consigneeIndex2 = data.hconsigneeDetails.indexOf('\n')
  1541. for (let i = 0; i < 3; i++) {
  1542. consigneeIndex2 = data.hconsigneeDetails.indexOf('\n', consigneeIndex2 + 1);
  1543. }
  1544. if (consigneeIndex2 != -1) {
  1545. var hconsigneeDetails = data.hconsigneeDetails.substring(consigneeIndex2 + 2, data.hconsigneeDetails.length)
  1546. data.hconsigneeDetails = data.hconsigneeDetails.substring(0, consigneeIndex2) + ' **'
  1547. data.commodityDescr += '\n**' + hconsigneeDetails
  1548. }
  1549. }
  1550. if (data.hnotifyDetails) {
  1551. var notifierIndex2 = data.hnotifyDetails.indexOf('\n')
  1552. for (let i = 0; i < 3; i++) {
  1553. notifierIndex2 = data.hnotifyDetails.indexOf('\n', notifierIndex2 + 1);
  1554. }
  1555. if (notifierIndex2 != -1) {
  1556. var hnotifyDetails = data.hnotifyDetails.substring(notifierIndex2 + 2, data.hnotifyDetails.length)
  1557. data.hnotifyDetails = data.hnotifyDetails.substring(0, notifierIndex2) + ' ***'
  1558. data.commodityDescr += '\n***' + hnotifyDetails
  1559. }
  1560. }
  1561. // 处理箱号
  1562. if (this.isPrintTheBoxNumber) {
  1563. data.commodityDescr += '\n.\n.\n'
  1564. }
  1565. // PLACE & DATE OF ISSUE
  1566. data.placeAndDateOfIssue = ''
  1567. if (data.issueAt) {
  1568. data.placeAndDateOfIssue += data.issueAt
  1569. }
  1570. if (data.issueDate) {
  1571. let date = new Date(data.issueDate.replace(/-/g, '/'));
  1572. let yyyy = date.getFullYear();
  1573. let mmmm = date.toDateString().split(" ")[1]
  1574. let dd = date.getDate()
  1575. data.placeAndDateOfIssue += ', ' + dd + '-' + mmmm + '-' + yyyy
  1576. }
  1577. // Total number of containers or packages received by the Carriers
  1578. if (data.preContainersList) {
  1579. let boxMap = new Map();
  1580. for (let boxQuantity of data.preContainersList) {
  1581. if (boxMap.get(boxQuantity.cntrTypeCode)) {
  1582. let v = boxMap.get(boxQuantity.cntrTypeCode)
  1583. boxMap.set(boxQuantity.cntrTypeCode, v + boxQuantity.quantity)
  1584. } else {
  1585. boxMap.set(boxQuantity.cntrTypeCode, boxQuantity.quantity)
  1586. }
  1587. }
  1588. let boxs = ''
  1589. boxMap.forEach(function (value, key, map) {
  1590. boxs += value + 'x' + key + ', '
  1591. })
  1592. boxs = boxs.substring(0, boxs.length - 2)
  1593. data.boxQuantity = boxs + ' CONTAINER(S) ONLY'
  1594. }
  1595. // Number of original B/Ls
  1596. if (data.numberOfObl) {
  1597. data.numberOfObl += ' (' + data.numberOfOblDigit + ')'
  1598. }
  1599. if (data.commodityDescr) {
  1600. var descriptionIndex2 = data.commodityDescr.indexOf('\n')
  1601. for (let i = 0; i < 19; i++) {
  1602. descriptionIndex2 = data.commodityDescr.indexOf('\n', descriptionIndex2 + 1);
  1603. }
  1604. if (descriptionIndex2 != -1) {
  1605. data.pageOne = 'Page : 1 of 2'
  1606. data.pageTwo = 'Page : 2 of 2'
  1607. var extraLongText = data.commodityDescr.substring(descriptionIndex2 + 2, data.commodityDescr.length)
  1608. data.commodityDescr = data.commodityDescr.substring(0, descriptionIndex2)
  1609. data.extraLongTips = '** TO BE CONTINUED ON ATTACHED LIST **'
  1610. data.extraLongText = extraLongText
  1611. }
  1612. }
  1613. // console.log(data.hshipperDetails, 'hshipperDetails2')
  1614. // 创建一个 Stimulsoft 数据集(DataSet)的实例的代码
  1615. var dataSet = new Stimulsoft.System.Data.DataSet(
  1616. 'reportData'
  1617. )
  1618. dataSet.readJson(data) // 用于将 JSON 格式的数据加载到数据集中。data 是包含报表数据的 JSON 对象。
  1619. // 这是一个方法调用,用于在报表中注册数据源。参数 'reportData' 是数据源的名称,
  1620. // 第二个 'reportData' 是数据源的别名,dataSet 则是之前创建的数据集实例
  1621. report.regData('reportData', 'reportData', dataSet)
  1622. // 从模版和数据加载报表
  1623. // loadReport(report, '', {})
  1624. // 这是将报表对象指定给报表查看器的属性。viewer 是报表查看器的实例,而 report 是之前创建的报表对象。
  1625. viewer.report = report;
  1626. this.$refs.reportContainer.showContainer(
  1627. () => {
  1628. setTimeout(() => {
  1629. viewer.renderHtml('reportContainer')
  1630. this.createViewerButtons(viewer)
  1631. }, 50)
  1632. },
  1633. () => {
  1634. },
  1635. )
  1636. console.log("加载成功完成!");
  1637. },
  1638. createViewerButtons(viewer) {
  1639. viewer.jsObject.collections.images['myClose.png'] =
  1640. 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABmJLR0QA/wD/AP+gvaeTAAAA0ElEQVQ4ja3TO05CQRQG4A8iOwAbtYWETndAaecK7NwCKmETtJZsSBNLobEz8ZFIJQ0UnOGSm3DnYviTybzO/895DQXGWGCVGQuMEqkRcwcfuMOLalziCaf4TIe9UG9nyMJmFRzNGoRK1BU4xxx9G7cfwostciGk+x8MqgySwDXe4tU53hVV+MNtTmAoX84JGv9NYgrHyR6DV8wUSW7hItZLm36ZVoVQxsFJLOMsPOrH/h7dQwR2cdxOTEn8DtUbPGc4V2H7Vb4Yqfedf/GYSGt8VUmxgyfuBAAAAABJRU5ErkJggg=='
  1641. const closeBtn = viewer.jsObject.SmallButton(
  1642. 'closeBtn',
  1643. '关闭',
  1644. 'myClose.png'
  1645. )
  1646. // 增加打印弹窗配置
  1647. const printBtn = viewer.jsObject.SmallButton(
  1648. 'printBtn',
  1649. '打印报表',
  1650. 'myClose.png'
  1651. )
  1652. // console.log(viewer.jsObject.print(),'1013')
  1653. // 获取 关闭按钮的dom元素位置
  1654. const toolbarTable = viewer.jsObject.controls.toolbar.firstChild.firstChild
  1655. const buttonsTable = toolbarTable.rows[0].lastChild.lastChild
  1656. const userButtonCell = buttonsTable.rows[0].insertCell(0)
  1657. // 获取打印按钮的位置
  1658. const buttonsTablePrint = toolbarTable.rows[0].childNodes[0].lastChild // 打印按钮
  1659. const userButtonPrint = buttonsTablePrint.rows[0].childNodes[0] // 打印按钮dom位置
  1660. userButtonPrint.addEventListener("click", (event) => {
  1661. console.log("打印点击");
  1662. // event.preventDefault()
  1663. });
  1664. userButtonPrint.addEventListener("mouseover", (event) => {
  1665. console.log("移入打印按钮");
  1666. console.log(event, 1035)
  1667. });
  1668. userButtonCell.className = 'stiJsViewerClearAllStyles'
  1669. userButtonCell.appendChild(closeBtn) // 添加关闭节点
  1670. // userButtonPrint.prepend(printBtn) // 在 printBtn 节点里最前面增加一个子级节点
  1671. let that = this
  1672. // 关闭按钮的监听点击
  1673. closeBtn.action = function () {
  1674. console.log(that.$refs.ReportContainer, '1022')
  1675. if (that.$refs.reportContainer)
  1676. that.$refs.reportContainer.hideContainer()
  1677. }
  1678. // // // 打印按钮监听
  1679. // printBtn.action = (e)=>{
  1680. // console.log('打印')
  1681. // window.print()
  1682. // }
  1683. },
  1684. },
  1685. }
  1686. </script>
  1687. <style scoped>
  1688. ::v-deep.el-form-item {
  1689. margin-bottom: 0;
  1690. }
  1691. .cardBox {
  1692. background: #fff;
  1693. width: 100%;
  1694. height: 100%;
  1695. padding: 20px;
  1696. box-sizing: border-box;
  1697. border-radius: 4px;
  1698. box-shadow: 0 2px 12px 0 rgba(0, 0, 0, .1);
  1699. }
  1700. .flexBox {
  1701. display: flex;
  1702. }
  1703. .flexBoxLeft {
  1704. flex: 2;
  1705. margin-right: 10px;
  1706. //padding-bottom: 40px;
  1707. }
  1708. .flexBoxRight {
  1709. flex: 3;
  1710. //padding-bottom: 40px;
  1711. }
  1712. </style>