finstlbillsDetails.vue 68 KB

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