fininvoicesDetails.vue 92 KB

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