fininvoicesDetails.vue 92 KB

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