finstlbillsDetails.vue 92 KB

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