finstlbillsDetails.vue 101 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489
  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.id" size="small" type="success" @click="allClick('指示')">指示</el-button>
  11. <el-button size="small" :loading="saveLoading" :disabled="!form.id" @click="previewreportfun">预 览</el-button>
  12. <el-button size="small" v-if="roleName.indexOf('admin') != -1" :loading="saveLoading" :disabled="!form.id" @click="DesignreportDialog = true"
  13. >报表设计
  14. </el-button>
  15. <el-button type="success" size="small" :disabled="!form.id" plain @click="newbillFun">新建账单 </el-button>
  16. <el-button
  17. size="small"
  18. type="danger"
  19. plain
  20. :disabled="!form.id || editPower"
  21. v-if="form.status == 3"
  22. :loading="saveLoading"
  23. @click="finstlbillsRevokeReconciliationfun"
  24. >撤销完成
  25. </el-button>
  26. <el-button
  27. size="small"
  28. type="success"
  29. plain
  30. :disabled="!form.id || editPower"
  31. v-if="form.status == 2"
  32. :loading="saveLoading"
  33. @click="submit('确认完成')"
  34. >确认完成
  35. </el-button>
  36. <el-button size="small" type="primary" v-if="editSave" :disabled="submitType || editPower" :loading="saveLoading" @click="editHandle"
  37. >编 辑
  38. </el-button>
  39. <el-button size="small" type="primary" v-else :disabled="submitType" :loading="saveLoading" @click="editCustomer()">保 存 </el-button>
  40. </div>
  41. </div>
  42. <div style="margin: 55px 5px 0px 5px;'">
  43. <el-card class="box-card">
  44. <el-form :model="form" ref="form" label-width="90px" class="demo-ruleForm">
  45. <el-row>
  46. <el-row>
  47. <el-col :span="11">
  48. <el-form-item label="对账单位" prop="corpCnName">
  49. <el-col :span="10">
  50. <search-query
  51. :datalist="corpData"
  52. :selectValue="form.corpCnName"
  53. :clearable="true"
  54. :disabled="editSave || tableData.length || InvoicingList.length"
  55. :filterable="true"
  56. :remote="true"
  57. :buttonIf="false"
  58. placeholder="请选择对账单位"
  59. :forParameter="{ key: 'id', label: 'cnName', value: 'cnName' }"
  60. @corpChange="corpChange($event, 'corpCnName')"
  61. @remoteMethod="corpBcorpsListfun"
  62. @corpFocus="corpBcorpsListfun"
  63. >
  64. </search-query>
  65. </el-col>
  66. <el-col :span="9">
  67. <span style="padding-left: 20px"></span>
  68. <el-input
  69. style="width: 100%;"
  70. v-model="form.corpEnName"
  71. size="small"
  72. autocomplete="off"
  73. :disabled="editSave"
  74. clearable
  75. placeholder="对账单位"
  76. >
  77. </el-input>
  78. </el-col>
  79. <el-col :span="5">
  80. <el-checkbox
  81. style="width: 100%;text-align: right"
  82. size="medium"
  83. :true-label="1"
  84. :false-label="0"
  85. :disabled="editSave"
  86. v-model="form.corpIsSigned"
  87. >已签约
  88. </el-checkbox>
  89. </el-col>
  90. </el-form-item>
  91. </el-col>
  92. <el-col :span="5">
  93. <el-form-item label="船 名" prop="vesselCnName">
  94. <el-input
  95. style="width: 100%;"
  96. v-model="form.vesselCnName"
  97. size="small"
  98. autocomplete="off"
  99. :disabled="editSave"
  100. clearable
  101. placeholder="请输入船名"
  102. ></el-input>
  103. </el-form-item>
  104. </el-col>
  105. <el-col :span="5">
  106. <el-form-item label="航 次" prop="voyageNo">
  107. <el-input
  108. style="width: 100%;"
  109. v-model="form.voyageNo"
  110. size="small"
  111. autocomplete="off"
  112. :disabled="editSave"
  113. clearable
  114. placeholder="请输入航次"
  115. ></el-input>
  116. </el-form-item>
  117. </el-col>
  118. <el-col :span="3">
  119. <el-form-item label="审核" prop="isApproved" label-width="50px">
  120. <search-query
  121. :datalist="allyesnoData"
  122. :selectValue="form.isApproved"
  123. :clearable="true"
  124. :disabled="editSave"
  125. :buttonIf="false"
  126. :forParameter="{ key: 'dictKey', label: 'dictValue', value: 'dictKey' }"
  127. @corpChange="corpChange($event, 'isApproved')"
  128. @corpFocus="allyesnoWorkDictsfun"
  129. >
  130. </search-query>
  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="businessNo">
  151. <el-input
  152. style="width: 100%;"
  153. v-model="form.businessNo"
  154. size="small"
  155. autocomplete="off"
  156. :disabled="editSave"
  157. clearable
  158. placeholder="请输入业务编号"
  159. >
  160. </el-input>
  161. </el-form-item>
  162. </el-col>
  163. <el-col :span="4">
  164. <el-form-item label="账单编号" prop="accountNo">
  165. <el-input
  166. style="width: 100%;"
  167. v-model="form.accountNo"
  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="MBL NO" prop="mblno">
  179. <el-input
  180. style="width: 100%;"
  181. v-model="form.mblno"
  182. size="small"
  183. autocomplete="off"
  184. :disabled="editSave"
  185. clearable
  186. placeholder="请输入MBL NO"
  187. >
  188. </el-input>
  189. </el-form-item>
  190. </el-col>
  191. <el-col :span="4">
  192. <el-form-item label="HBL NO" prop="hblno">
  193. <el-input
  194. style="width: 100%;"
  195. v-model="form.hblno"
  196. size="small"
  197. autocomplete="off"
  198. :disabled="editSave"
  199. clearable
  200. placeholder="请输入HBL NO"
  201. >
  202. </el-input>
  203. </el-form-item>
  204. </el-col>
  205. <el-col :span="3">
  206. <el-form-item label="对账" prop="isChecked" label-width="50px">
  207. <search-query
  208. :datalist="isCheckedData"
  209. :selectValue="form.isChecked"
  210. :clearable="true"
  211. :disabled="editSave"
  212. :buttonIf="false"
  213. :forParameter="{ key: 'dictKey', label: 'dictValue', value: 'dictKey' }"
  214. @corpChange="corpChange($event, 'isChecked')"
  215. @corpFocus="allyesnoWorkDictsfun"
  216. >
  217. </search-query>
  218. </el-form-item>
  219. </el-col>
  220. <!--<el-col :span="4">-->
  221. <!-- <el-form-item label="对账" prop="isChecked" label-width="50px">-->
  222. <!-- <search-query :datalist="allyesnoData"-->
  223. <!-- :selectValue="form.isChecked"-->
  224. <!-- :clearable="true"-->
  225. <!-- :disabled="editSave"-->
  226. <!-- :buttonIf="false"-->
  227. <!-- :forParameter="{ key:'dictKey', label:'dictValue', value:'dictKey'}"-->
  228. <!-- @corpChange="corpChange($event,'isChecked')"-->
  229. <!-- @corpFocus="allyesnoWorkDictsfun" >-->
  230. <!-- </search-query>-->
  231. <!-- </el-form-item>-->
  232. <!--</el-col>-->
  233. <el-col :span="4">
  234. <el-form-item label="业务开始日期" prop="businessDateStart">
  235. <el-date-picker
  236. v-model="form.businessDateStart"
  237. clearable
  238. style="width: 100%;"
  239. type="date"
  240. size="small"
  241. :disabled="editSave"
  242. format="yyyy-MM-dd"
  243. value-format="yyyy-MM-dd"
  244. placeholder="请选择业务开始日期"
  245. >
  246. </el-date-picker>
  247. </el-form-item>
  248. </el-col>
  249. <el-col :span="4">
  250. <el-form-item label="业务结束日期" prop="businessDateEnd">
  251. <el-date-picker
  252. v-model="form.businessDateEnd"
  253. clearable
  254. style="width: 100%;"
  255. type="date"
  256. size="small"
  257. :disabled="editSave"
  258. format="yyyy-MM-dd"
  259. value-format="yyyy-MM-dd"
  260. placeholder="请选择业务结束日期"
  261. >
  262. </el-date-picker>
  263. </el-form-item>
  264. </el-col>
  265. <el-col :span="4">
  266. <el-form-item label="财务开始日期" prop="accountDateFrom">
  267. <el-date-picker
  268. v-model="form.accountDateFrom"
  269. clearable
  270. style="width: 100%;"
  271. type="date"
  272. size="small"
  273. :disabled="editSave"
  274. format="yyyy-MM-dd"
  275. value-format="yyyy-MM-dd"
  276. placeholder="请选择财务开始日期"
  277. >
  278. </el-date-picker>
  279. </el-form-item>
  280. </el-col>
  281. <el-col :span="4">
  282. <el-form-item label="财务结束日期" prop="accountDateTo">
  283. <el-date-picker
  284. v-model="form.accountDateTo"
  285. clearable
  286. style="width: 100%;"
  287. type="date"
  288. size="small"
  289. :disabled="editSave"
  290. format="yyyy-MM-dd"
  291. value-format="yyyy-MM-dd"
  292. placeholder="请选择财务结束日期"
  293. >
  294. </el-date-picker>
  295. </el-form-item>
  296. </el-col>
  297. <el-col :span="4">
  298. <el-form-item label="审核开始期间" prop="auditDateFrom">
  299. <el-date-picker
  300. v-model="form.auditDateFrom"
  301. clearable
  302. style="width: 100%;"
  303. type="date"
  304. size="small"
  305. :disabled="editSave"
  306. format="yyyy-MM-dd"
  307. value-format="yyyy-MM-dd"
  308. placeholder="请选择审核开始日期"
  309. >
  310. </el-date-picker>
  311. </el-form-item>
  312. </el-col>
  313. <el-col :span="4">
  314. <el-form-item label="审核结束期间" prop="auditDateTo">
  315. <el-date-picker
  316. v-model="form.auditDateTo"
  317. clearable
  318. style="width: 100%;"
  319. type="date"
  320. size="small"
  321. :disabled="editSave"
  322. format="yyyy-MM-dd"
  323. value-format="yyyy-MM-dd"
  324. placeholder="请选择审核结束日期"
  325. >
  326. </el-date-picker>
  327. </el-form-item>
  328. </el-col>
  329. </el-row>
  330. <expand :showBtn="true" :showSpan="true">
  331. <el-row>
  332. <el-col :span="5">
  333. <el-form-item label="操作员" prop="updateUserName">
  334. <search-query
  335. :datalist="updateUserData"
  336. :selectValue="form.updateUserName"
  337. :clearable="true"
  338. :disabled="editSave"
  339. :buttonIf="false"
  340. :filterable="true"
  341. :remote="true"
  342. :forParameter="{ key: 'id', label: 'name', value: 'name' }"
  343. @corpChange="corpChange($event, 'updateUserName')"
  344. @remoteMethod="updateUserUserGetListfun"
  345. @corpFocus="updateUserUserGetListfun"
  346. >
  347. </search-query>
  348. </el-form-item>
  349. </el-col>
  350. <el-col :span="5">
  351. <el-form-item label="BKNO" prop="bookingNo">
  352. <el-input
  353. style="width: 100%;"
  354. v-model="form.bookingNo"
  355. size="small"
  356. autocomplete="off"
  357. :disabled="editSave"
  358. clearable
  359. placeholder="请输入BKNO"
  360. ></el-input>
  361. </el-form-item>
  362. </el-col>
  363. <el-col :span="5">
  364. <el-form-item label="协议签订人" prop="corpAccRemarks">
  365. <el-input
  366. style="width: 100%;"
  367. v-model="form.corpAccRemarks"
  368. size="small"
  369. autocomplete="off"
  370. :disabled="editSave"
  371. clearable
  372. placeholder="请输入协议签订人"
  373. >
  374. </el-input>
  375. </el-form-item>
  376. </el-col>
  377. <el-col :span="5">
  378. <el-form-item label="业务类型" prop="businessTypes">
  379. <dic-select
  380. v-model="form.businessTypes"
  381. placeholder="业务类型"
  382. key="id"
  383. label="label"
  384. keyValue="value"
  385. :activateCreated="false"
  386. :mockData="businessTypesData"
  387. :filterable="true"
  388. :multiple="true"
  389. :collapseTags="true"
  390. :disabled="editSave"
  391. dataType="string"
  392. ></dic-select>
  393. </el-form-item>
  394. </el-col>
  395. <el-col :span="4">
  396. <el-form-item label="发票" prop="isInvoice" label-width="50px">
  397. <search-query
  398. :datalist="isInvoiceData"
  399. :selectValue="form.isInvoice"
  400. :clearable="true"
  401. :disabled="editSave"
  402. :buttonIf="false"
  403. :forParameter="{ key: 'dictKey', label: 'dictValue', value: 'dictKey' }"
  404. @corpChange="corpChange($event, 'isInvoice')"
  405. @corpFocus="invoiceWorkDictsfun"
  406. >
  407. </search-query>
  408. </el-form-item>
  409. </el-col>
  410. <el-col :span="5">
  411. <el-form-item label="收 / 付" prop="dc">
  412. <search-query
  413. :datalist="dcData"
  414. :selectValue="form.dc"
  415. :clearable="true"
  416. :disabled="editSave"
  417. :buttonIf="false"
  418. placeholder="请选择收/付"
  419. @corpChange="corpChange($event, 'dc')"
  420. >
  421. </search-query>
  422. </el-form-item>
  423. </el-col>
  424. <el-col :span="5">
  425. <el-form-item label="币别" prop="curCode">
  426. <search-query
  427. :datalist="curCodeData"
  428. :selectValue="form.curCode"
  429. :clearable="true"
  430. :disabled="editSave"
  431. :buttonIf="false"
  432. :filterable="true"
  433. :remote="true"
  434. placeholder="请选择币别"
  435. :forParameter="{ key: 'id', label: 'code', value: 'code' }"
  436. @corpChange="corpChange($event, 'curCode')"
  437. @remoteMethod="getRateListfun"
  438. @corpFocus="getRateListfun"
  439. >
  440. </search-query>
  441. </el-form-item>
  442. </el-col>
  443. <el-col :span="10">
  444. <el-form-item label="业务来源" prop="srcType">
  445. <el-col :span="10">
  446. <search-query
  447. :datalist="srcTypeData"
  448. :selectValue="form.srcType"
  449. :clearable="true"
  450. :disabled="editSave"
  451. :buttonIf="false"
  452. placeholder="请选择业务来源"
  453. @corpChange="corpChange($event, 'srcType')"
  454. >
  455. </search-query>
  456. </el-col>
  457. <el-col :span="13" :offset="1">
  458. <search-query
  459. :datalist="srcData"
  460. :selectValue="form.srcCnName"
  461. :clearable="true"
  462. :disabled="editSave"
  463. :buttonIf="false"
  464. :filterable="true"
  465. :remote="true"
  466. placeholder="请选择详情"
  467. :forParameter="srcforParameter"
  468. @corpChange="corpChange($event, 'srcCnName')"
  469. @remoteMethod="salesuserGetListfun"
  470. >
  471. </search-query>
  472. </el-col>
  473. </el-form-item>
  474. </el-col>
  475. <el-col :span="4">
  476. <el-form-item label="签收" prop="isSignfor" label-width="50px">
  477. <search-query
  478. :datalist="allyesnoData"
  479. :selectValue="form.isSignfor"
  480. :clearable="true"
  481. :disabled="editSave"
  482. :buttonIf="false"
  483. :forParameter="{ key: 'dictKey', label: 'dictValue', value: 'dictKey' }"
  484. @corpChange="corpChange($event, 'isSignfor')"
  485. @corpFocus="allyesnoWorkDictsfun"
  486. >
  487. </search-query>
  488. </el-form-item>
  489. </el-col>
  490. <el-col :span="5">
  491. <el-form-item label="对账单号" prop="checkNo">
  492. <el-input
  493. style="width: 100%;"
  494. v-model="form.billNo"
  495. size="small"
  496. autocomplete="off"
  497. :disabled="true"
  498. clearable
  499. placeholder="请输入对账单号"
  500. >
  501. </el-input>
  502. </el-form-item>
  503. </el-col>
  504. <el-col :span="5">
  505. <el-form-item label="对账日期" prop="billDate">
  506. <el-date-picker
  507. v-model="form.billDate"
  508. clearable
  509. style="width: 100%;"
  510. type="date"
  511. size="small"
  512. :disabled="editSave"
  513. value-format="yyyy-MM-dd HH:mm"
  514. placeholder="请选择对账日期"
  515. >
  516. </el-date-picker>
  517. </el-form-item>
  518. </el-col>
  519. <el-col :span="5">
  520. <el-form-item label="限定金额" prop="limitedAmount">
  521. <el-input
  522. style="width: 100%;"
  523. v-model="form.limitedAmount"
  524. size="small"
  525. autocomplete="off"
  526. :disabled="editSave"
  527. clearable
  528. placeholder="请输入限定金额"
  529. >
  530. </el-input>
  531. </el-form-item>
  532. </el-col>
  533. <el-col :span="5">
  534. <el-form-item label="备注" prop="remarks">
  535. <el-input
  536. style="width: 100%;"
  537. v-model="form.remarks"
  538. size="small"
  539. autocomplete="off"
  540. :disabled="editSave"
  541. clearable
  542. placeholder="请输入备注"
  543. >
  544. </el-input>
  545. </el-form-item>
  546. </el-col>
  547. <el-col :span="4">
  548. <el-form-item label="销账" prop="isCleared" label-width="50px">
  549. <search-query
  550. :datalist="isClearedData"
  551. :selectValue="form.isCleared"
  552. :clearable="true"
  553. :disabled="editSave"
  554. :buttonIf="false"
  555. :forParameter="{ key: 'dictKey', label: 'dictValue', value: 'dictKey' }"
  556. @corpChange="corpChange($event, 'isCleared')"
  557. @corpFocus="allyesnoWorkDictsfun"
  558. >
  559. </search-query>
  560. </el-form-item>
  561. </el-col>
  562. </el-row>
  563. </expand>
  564. <el-row>
  565. <el-col span="24">
  566. <div style="text-align: right">
  567. <el-button size="small" type="primary" :disabled="editSave" :loading="saveLoading" @click="retrievalfun">检 索</el-button>
  568. <el-button size="small" :disabled="queryData.length > 0" @click="ResetFilter">重置条件 </el-button>
  569. </div>
  570. </el-col>
  571. </el-row>
  572. </el-row>
  573. </el-form>
  574. </el-card>
  575. <!-- <el-card style="margin-top: 10px">
  576. </el-card> -->
  577. <el-card style="margin-top: 10px">
  578. <el-tabs v-model="activeName" @tab-click="handleClick">
  579. <el-tab-pane label="查询结果" name="1">
  580. <queryfinstlbillsitems
  581. :queryData="queryData"
  582. :form="form"
  583. :handleSelectionData="handleSelectionData"
  584. :brfalse="!editSave"
  585. @handleSelectionChange="addSelectionChange"
  586. >
  587. <template slot="menuLeft">
  588. <div style="display: flex;">
  589. <el-button size="small" type="success" style="margin-right: 8px" :disabled="editSave" :loading="saveLoading" @click="allCell"
  590. >确认选定行
  591. </el-button>
  592. <div class="bottomFlex" style="color: #81B337;margin-right: 20px;">
  593. <span>应收:</span>
  594. <span class="weightnum">¥{{ amountDSubSum || 0 }}</span>
  595. </div>
  596. <div class="bottomFlex" style="color: #81B337;margin-right: 20px;">
  597. <span></span>
  598. <span class="weightnum">${{ amountDSubUsdSum || 0 }}</span>
  599. </div>
  600. <div class="bottomFlex" style="color: #6BBCD1;margin-right: 20px;">
  601. <span>应付:</span>
  602. <span class="weightnum">¥{{ amountCSubSum || 0 }}</span>
  603. </div>
  604. <div class="bottomFlex" style="color: #6BBCD1;margin-right: 20px;">
  605. <span></span>
  606. <span class="weightnum">${{ amountCSubUsdSum || 0 }}</span>
  607. </div>
  608. </div>
  609. </template>
  610. </queryfinstlbillsitems>
  611. </el-tab-pane>
  612. <el-tab-pane label="选定数据" name="2">
  613. <finstlbillsitems
  614. :tableData="tableData"
  615. :form="form"
  616. :handleSelectionData="handleSelectionData"
  617. :brfalse="!editSave"
  618. @handleSelectionChange="handleSelectionChange"
  619. >
  620. <template slot="menuLeft">
  621. <div style="display: flex;">
  622. <el-button size="small" type="danger" style="margin-left: 10px" :disabled="editSave" :loading="saveLoading" @click="batchDeletefun"
  623. >一键删除
  624. </el-button>
  625. <el-button size="small" type="primary" style="margin-left: 10px" :disabled="editSave" :loading="saveLoading" @click="editHandle"
  626. >一键编辑
  627. </el-button>
  628. <!-- <el-button size="small" type="primary" style="margin-right: 8px" :loading="saveLoading" @click="Confirminvoicefun('2')"
  629. >不开发票
  630. </el-button>
  631. <el-button size="small" type="warning" style="margin-right: 8px" :loading="saveLoading" @click="Notinvoicingfun('2')"
  632. >取消不开发票
  633. </el-button>
  634. <el-button size="small" type="primary" style="margin-right: 8px" :loading="saveLoading" @click="Confirminvoicefun('1')"
  635. >确认开票
  636. </el-button>
  637. <el-button size="small" type="warning" style="margin-right: 8px" :loading="saveLoading" @click="Notinvoicingfun('1')"
  638. >撤销开票
  639. </el-button> -->
  640. <el-button
  641. size="small"
  642. type="primary"
  643. style="margin-right: 8px"
  644. :disabled="!form.id || editSave || handleSelectionData.length == 0"
  645. :loading="saveLoading"
  646. @click="ConfirmReceiptfun"
  647. >批量签收
  648. </el-button>
  649. <el-button
  650. size="small"
  651. type="danger"
  652. style="margin-right: 8px"
  653. :disabled="!form.id || editSave || handleSelectionData.length == 0"
  654. :loading="saveLoading"
  655. @click="RevokeReceiptfun"
  656. >撤销签收
  657. </el-button>
  658. <el-button
  659. size="small"
  660. type="primary"
  661. style="margin-right: 8px"
  662. :disabled="!form.id || editSave || handleSelectionData.length == 0"
  663. :loading="saveLoading"
  664. @click="batchConfirm"
  665. >批量对账
  666. </el-button>
  667. <el-button
  668. size="small"
  669. type="danger"
  670. style="margin-right: 8px"
  671. :disabled="!form.id || editSave || handleSelectionData.length == 0"
  672. :loading="saveLoading"
  673. @click="batchRevoke"
  674. >撤销对账
  675. </el-button>
  676. <div class="bottomFlex" style="color: #81B337;margin-right: 20px;">
  677. <span>应收:</span>
  678. <span class="weightnum">¥{{ amountDSubSum2 || 0 }}</span>
  679. </div>
  680. <div class="bottomFlex" style="color: #81B337;margin-right: 20px;">
  681. <span></span>
  682. <span class="weightnum">${{ amountDSubUsdSum2 || 0 }}</span>
  683. </div>
  684. <div class="bottomFlex" style="color: #6BBCD1;margin-right: 20px;">
  685. <span>应付:</span>
  686. <span class="weightnum">¥{{ amountCSubSum2 || 0 }}</span>
  687. </div>
  688. <div class="bottomFlex" style="color: #6BBCD1;margin-right: 20px;">
  689. <span></span>
  690. <span class="weightnum">${{ amountCSubUsdSum2 || 0 }}</span>
  691. </div>
  692. </div>
  693. </template>
  694. </finstlbillsitems>
  695. </el-tab-pane>
  696. <el-tab-pane label="开票明细" name="3">
  697. <div style="margin-bottom: 10px;display: flex;">
  698. <el-button style="margin-left: 10px" :disabled="!form.id" size="small" type="primary" @click="addRow">新增</el-button>
  699. <el-button
  700. style="margin-left: 10px"
  701. :disabled="!form.id || invoicingCheckboxData.length == 0"
  702. size="small"
  703. type="success"
  704. @click="invoicingfun"
  705. >生成发票单</el-button
  706. >
  707. <el-button
  708. style="margin-left: 10px"
  709. :disabled="!form.id || invoicingCheckboxData.length == 0"
  710. size="small"
  711. type="danger"
  712. @click="invoicingRevokefun"
  713. >撤销生成发票单</el-button
  714. >
  715. <el-button :disabled="!form.id || invoicingCheckboxData.length == 0" size="small" type="danger" @click="invoicingBatchDelete"
  716. >一键删除</el-button
  717. >
  718. </div>
  719. <fininvoiceitemdetail
  720. :form="form"
  721. :tableData="InvoicingList"
  722. :handleSelectionData="invoicingCheckboxData"
  723. @handleSelectionChange="invoicingCheckboxChange"
  724. @deletefun="invoiceDeletionfun"
  725. @savefun="invoiceSavefun"
  726. >
  727. </fininvoiceitemdetail>
  728. </el-tab-pane>
  729. </el-tabs>
  730. </el-card>
  731. </div>
  732. <el-card style="margin-top: 10px">
  733. <el-row>
  734. <el-col :span="3">
  735. <div class="bottomFlex" style="color: #6BBCD1">
  736. <span>应付:</span>
  737. <span class="weightnum">¥{{ form.amountCr || 0 }}</span>
  738. </div>
  739. </el-col>
  740. <el-col :span="3">
  741. <div class="bottomFlex" style="color: #6BBCD1">
  742. <span>应付:</span>
  743. <span class="weightnum">${{ form.amountCrUsd || 0 }}</span>
  744. </div>
  745. </el-col>
  746. <el-col :span="6">
  747. <div class="bottomFlex" style="color: #6BBCD1">
  748. <span>应付合计:</span>
  749. <span class="weightnum">¥{{ form.amountCrLoc || 0 }}</span>
  750. </div>
  751. </el-col>
  752. <el-col :span="3">
  753. <div class="bottomFlex" style="color: #81B337">
  754. <span>应收:</span>
  755. <span class="weightnum">¥{{ form.amountDr || 0 }}</span>
  756. </div>
  757. </el-col>
  758. <el-col :span="3">
  759. <div class="bottomFlex" style="color: #81B337">
  760. <span>应收:</span>
  761. <span class="weightnum">${{ form.amountDrUsd || 0 }}</span>
  762. </div>
  763. </el-col>
  764. <el-col :span="6">
  765. <div class="bottomFlex" style="color: #81B337">
  766. <span>应收合计:</span>
  767. <span class="weightnum">¥{{ form.amountDrLoc || 0 }}</span>
  768. </div>
  769. </el-col>
  770. </el-row>
  771. </el-card>
  772. <!--选择数据弹窗-->
  773. <el-dialog title="选择数据" class="el-dialogDeep" :visible.sync="retrievePopupsType" append-to-body width="70%" :close-on-click-modal="false">
  774. <div>
  775. <avue-crud :option="retrievePopupsOption" :data="retrievePopupsData" ref="retrievePopupsRef" id="out-table">
  776. <template slot="menu" slot-scope="{ row }">
  777. <el-button type="text" icon="" size="small" @click.stop="retrievePopupsSelect(row)">选择 </el-button>
  778. </template>
  779. </avue-crud>
  780. </div>
  781. </el-dialog>
  782. <!--设计报表弹窗-->
  783. <el-dialog
  784. append-to-body
  785. title="设计报表"
  786. class="el-dialogDeep"
  787. :visible.sync="DesignreportDialog"
  788. width="70%"
  789. :close-on-click-modal="false"
  790. :destroy-on-close="true"
  791. :close-on-press-escape="false"
  792. v-dialog-drag
  793. >
  794. <reports :id="form.id" :assemblyForm="form" businessValue="DZZX"></reports>
  795. </el-dialog>
  796. <!--预览-->
  797. <el-dialog
  798. title="打印"
  799. :visible.sync="selectPrintingDialog"
  800. append-to-body
  801. width="70%"
  802. :close-on-click-modal="false"
  803. :destroy-on-close="true"
  804. :close-on-press-escape="false"
  805. v-dialog-drag
  806. >
  807. <div>
  808. <reportformsList ref="reportformsList" @reportRadio="reportRadio"></reportformsList>
  809. </div>
  810. <span slot="footer" class="dialog-footer">
  811. <el-button size="small" @click="selectPrintingDialog = false">取 消</el-button>
  812. </span>
  813. </el-dialog>
  814. <!--报表组件-->
  815. <reportContainer ref="reportContainer"></reportContainer>
  816. <cashier-item ref="cashier" @update="updateCashier" :disabled="form.status == 3"></cashier-item>
  817. </div>
  818. </template>
  819. <script>
  820. import fininvoiceitemdetail from "@/views/iosBasicData/finstlbills/assembly/fininvoiceitemdetail.vue";
  821. import SearchQuery from "@/components/iosbasic-data/searchquery.vue";
  822. import { getWorkDicts } from "@/api/system/dictbiz";
  823. import { getRateList } from "@/api/iosBasicData/rateManagement";
  824. import { getList as userGetList } from "@/api/system/user";
  825. import { getBvesselsList } from "@/api/iosBasicData/bvessels";
  826. import { getBcorpslistByType } from "@/api/iosBasicData/bcorps";
  827. import { getDeptLazyTree } from "@/api/system/dept";
  828. import {
  829. finstlbillsConfirmReconciliation,
  830. finstlbillsConfirmSignFor,
  831. finstlbillsDetail,
  832. finstlbillslistAccBillV1,
  833. finstlbillsRevokeReconciliation,
  834. finstlbillsRevokeSignFor,
  835. finstlbillsSubmit,
  836. finstlbillsitemsRemove,
  837. finstlbillslistAccBillByCorp,
  838. finstlbillsConfirmInvoicing,
  839. finstlbillsRevokeInvoicing,
  840. batchConfirmReconciliation,
  841. batchRevokeReconciliation,
  842. generateInvoice,
  843. revokeInvoice
  844. } from "@/api/iosBasicData/finstlbills";
  845. import expand from "@/components/basic-container/expand.vue";
  846. import queryfinstlbillsitems from "@/views/iosBasicData/finstlbills/assembly/finstlbillsitems.vue";
  847. import finstlbillsitems from "@/views/iosBasicData/finstlbills/assembly/finstlbillsitems2.vue";
  848. import { dateFormat } from "@/util/date";
  849. import reports from "@/views/iosBasicData/SeafreightExportF/bills/assembly/reports.vue";
  850. import reportformsList from "@/views/iosBasicData/SeafreightExportF/bills/assembly/reportformsList.vue";
  851. import reportContainer from "@/views/iosBasicData/report-container/report-container.vue";
  852. import { getList as getreportsList, reportsGetReportData } from "@/api/iosBasicData/reports";
  853. import dicSelect from "@/components/dicSelect/main";
  854. import cashierItem from "./assembly/cashierItem.vue";
  855. import { getListAllDetail } from "@/api/iosBasicData/cashier.js";
  856. import { fininvoiceitemdetailRemove, fininvoiceitemdetailSubmit } from "@/api/iosBasicData/fininvoices";
  857. export default {
  858. components: {
  859. reportContainer,
  860. reportformsList,
  861. reports,
  862. SearchQuery,
  863. expand,
  864. finstlbillsitems,
  865. dicSelect,
  866. queryfinstlbillsitems,
  867. cashierItem,
  868. fininvoiceitemdetail
  869. },
  870. props: {
  871. // 编辑还是保存
  872. editSave: {
  873. type: Boolean,
  874. default: true
  875. },
  876. pageIds: {
  877. type: Array, // 指定 prop 的类型为 Array
  878. default: () => [] // 提供一个默认值,这里使用函数形式返回一个空数组
  879. }
  880. },
  881. data() {
  882. return {
  883. InvoicingList: [], // 开票明细数据
  884. invoicingCheckboxData: [],
  885. amountDSubSum: 0,
  886. amountDSubUsdSum: 0,
  887. amountCSubSum: 0,
  888. amountCSubUsdSum: 0,
  889. amountDSubSum2: 0,
  890. amountDSubUsdSum2: 0,
  891. amountCSubSum2: 0,
  892. amountCSubUsdSum2: 0,
  893. activeName: "1",
  894. retrievePopupsType: false, // 弹窗开启关闭
  895. retrievePopupsData: [], // 选择弹窗数据
  896. retrievePopupsOption: {
  897. border: true,
  898. calcHeight: 30,
  899. tip: false,
  900. height: "auto",
  901. index: true,
  902. addBtn: false,
  903. viewBtn: false,
  904. delBtn: false,
  905. editBtn: false,
  906. refreshBtn: false,
  907. columnBtn: false,
  908. menuWidth: "60",
  909. column: [
  910. {
  911. label: "客户中文名",
  912. prop: "cnName",
  913. overHidden: true
  914. },
  915. {
  916. label: "客户英文文名",
  917. prop: "cnName",
  918. overHidden: true
  919. }
  920. ]
  921. },
  922. DesignreportDialog: false, // 设计报表弹窗
  923. selectPrintingDialog: false, // 预览报表
  924. statusType: false, // 确认发票
  925. tableData: [],
  926. queryData: [],
  927. addData: [],
  928. pageLoading: false, // 全屏加载动画
  929. saveLoading: false, // 按钮动画
  930. // 绑定的数据
  931. form: {
  932. billDate: dateFormat(new Date(), "yyyy-MM-dd") + " 00:00", // 对账日期 默认 当天
  933. isApproved: "0",
  934. isSignfor: "2",
  935. isCleared: null, // 销账
  936. isChecked: "0",
  937. isInvoice: "0",
  938. accountDate: [],
  939. approvedDate: []
  940. },
  941. handleSelectionData: [], // 表格选择的数据
  942. corpData: [], // 对账单位 数据
  943. allyesnoData: [], // 全部是否字典数据
  944. isCheckedData: [], // 对账状态字典数据
  945. isClearedData: [], // 销项
  946. isInvoiceData: [], // 发票字典
  947. // 收 / 付
  948. dcData: [
  949. {
  950. label: "收",
  951. value: "D"
  952. },
  953. {
  954. label: "付",
  955. value: "C"
  956. }
  957. ],
  958. curCodeData: [], // 币别
  959. updateUserData: [], // 操作员
  960. srcTypeData: [
  961. {
  962. label: "公司",
  963. value: "OWN"
  964. },
  965. {
  966. label: "代理",
  967. value: "AGENT"
  968. },
  969. {
  970. label: "业务员",
  971. value: "SALES"
  972. }
  973. ], // 业务来源
  974. srcData: [], // 业务来源数据
  975. srcforParameter: {},
  976. // 业务类型
  977. businessTypesData: [
  978. {
  979. label: "海运出口",
  980. value: "SE"
  981. },
  982. {
  983. label: "海运进口",
  984. value: "SI"
  985. }
  986. ],
  987. submitType: false, // 是否提交
  988. roleName: [], // 当前的角色权限
  989. saberUserInfo: {}, // 当前登录人信息
  990. editPower: false // 当前是否可以编辑
  991. };
  992. },
  993. created() {
  994. this.roleName = localStorage.getItem("roleName").split(",");
  995. // 获取当前登录人个人信息
  996. this.saberUserInfo = JSON.parse(localStorage.getItem("saber-userInfo")).content;
  997. this.allyesnoWorkDictsfun(); // 获取 字典数据
  998. this.invoiceWorkDictsfun(); // 获取 发票的数据
  999. },
  1000. methods: {
  1001. addRow() {
  1002. this.InvoicingList.push({
  1003. pid: this.form.id,
  1004. number: 1,
  1005. price: 0,
  1006. amountRate: 0,
  1007. edit: true
  1008. });
  1009. },
  1010. lastPage() {
  1011. if (this.pageIds.length) {
  1012. const index = this.pageIds.indexOf(this.form.id);
  1013. if (index == 0) {
  1014. return this.$message.error("没有上一票了");
  1015. }
  1016. const lastIndex = index - 1;
  1017. // if (this.form.id) {
  1018. // this.unLock({
  1019. // moduleName: "SE",
  1020. // tableName: "SE_order",
  1021. // billId: this.form.id,
  1022. // billNo: this.form.mblno
  1023. // });
  1024. // }
  1025. this.finstlbillsDetailfun(this.pageIds[lastIndex]);
  1026. }
  1027. },
  1028. nextPage() {
  1029. if (this.pageIds.length) {
  1030. const index = this.pageIds.indexOf(this.form.id);
  1031. if (this.pageIds[this.pageIds.length - 1] == this.form.id) {
  1032. return this.$message.error("没有下一票了");
  1033. }
  1034. const nextIndex = index + 1;
  1035. // if (this.form.id) {
  1036. // this.unLock({
  1037. // moduleName: "SE",
  1038. // tableName: "SE_order",
  1039. // billId: this.form.id,
  1040. // billNo: this.form.mblno
  1041. // });
  1042. // }
  1043. this.finstlbillsDetailfun(this.pageIds[nextIndex]);
  1044. }
  1045. },
  1046. // 打印
  1047. reportRadio(val) {
  1048. // 获取报表数据
  1049. reportsGetReportData({
  1050. billId: this.form.id,
  1051. reportCode: val.classifyCode,
  1052. groupCode: val.groupCode,
  1053. type: "DZZX"
  1054. }).then(res => {
  1055. this.handleReportPreview(val.url, res.data.data.data);
  1056. });
  1057. },
  1058. // 报表预览
  1059. previewreportfun() {
  1060. getreportsList(1, 10, {
  1061. businessType: "DZZX"
  1062. // classifyCode:'结算中心',
  1063. // groupCode:'付费结算'
  1064. }).then(res => {
  1065. if (res.data.data.records.length == 1) {
  1066. this.reportRadio(res.data.data.records[0]);
  1067. } else {
  1068. this.saveLoading = true;
  1069. this.selectPrintingDialog = true;
  1070. this.saveLoading = false;
  1071. let page = {
  1072. pageSize: 10,
  1073. currentPage: 1,
  1074. total: 0
  1075. };
  1076. this.$nextTick(() => {
  1077. this.$refs.reportformsList.onLoad(page, {
  1078. businessType: "DZZX"
  1079. // classifyCode:'结算中心',
  1080. // groupCode:'付费结算'
  1081. });
  1082. });
  1083. }
  1084. });
  1085. },
  1086. finstlbillsRevokeReconciliation,
  1087. // 下拉回调
  1088. corpChange(value, name) {
  1089. // 对账单位
  1090. if (name == "corpCnName") {
  1091. if (!value) {
  1092. this.$set(this.form, "corpId", "");
  1093. this.$set(this.form, "corpCnName", "");
  1094. this.$set(this.form, "corpEnName", "");
  1095. this.$set(this.form, "corpArgreementNo", "");
  1096. }
  1097. for (let item of this.corpData) {
  1098. if (item.cnName == value) {
  1099. this.$set(this.form, "corpId", item.id);
  1100. this.$set(this.form, "corpCnName", item.cnName);
  1101. this.$set(this.form, "corpEnName", item.enName);
  1102. this.$set(this.form, "corpArgreementNo", item.enName);
  1103. }
  1104. }
  1105. }
  1106. // 业务来源
  1107. else if (name == "srcType") {
  1108. if (!value) {
  1109. this.$set(this.form, "srcType", "");
  1110. return;
  1111. }
  1112. this.$set(this.form, name, value);
  1113. if (value == "OWN") {
  1114. this.srcforParameter = { key: "id", label: "title", value: "title" };
  1115. this.ownDeptLazyTreefun();
  1116. } else if (value == "AGENT") {
  1117. this.srcforParameter = { key: "id", label: "cnName", value: "cnName" };
  1118. this.srcBcorpsListfun();
  1119. } else if (value == "SALES") {
  1120. this.srcforParameter = { key: "id", label: "name", value: "name" };
  1121. this.salesuserGetListfun();
  1122. } else {
  1123. }
  1124. }
  1125. // 业务来源选择
  1126. else if (name == "srcCnName") {
  1127. if (!value) {
  1128. this.$set(this.form, "srcId", "");
  1129. this.$set(this.form, "srcCnName", "");
  1130. this.$set(this.form, "srcEnName", "");
  1131. return;
  1132. }
  1133. for (let item of this.srcData) {
  1134. if (item[this.srcforParameter.value] == value) {
  1135. if (this.form.srcType == "OWN") {
  1136. // 公司
  1137. this.$set(this.form, "srcId", item.id);
  1138. this.$set(this.form, "srcCnName", item.title);
  1139. this.$set(this.form, "srcEnName", item.title);
  1140. } else if (this.form.srcType == "SALES") {
  1141. // 业务员
  1142. this.$set(this.form, "srcId", item.id);
  1143. this.$set(this.form, "srcCnName", item.name);
  1144. this.$set(this.form, "srcEnName", item.name);
  1145. } else if (this.form.srcType == "AGENT") {
  1146. // 代理
  1147. this.$set(this.form, "srcId", item.id);
  1148. this.$set(this.form, "srcCnName", item.cnName);
  1149. this.$set(this.form, "srcEnName", item.enName);
  1150. } else {
  1151. }
  1152. }
  1153. }
  1154. }
  1155. // 操作员
  1156. else if (name == "updateUserName") {
  1157. for (let item of this.updateUserData) {
  1158. if (item.name == value) {
  1159. this.$set(this.form, "updateUser", item.id);
  1160. this.$set(this.form, "updateUserName", item.name);
  1161. }
  1162. }
  1163. } else {
  1164. this.$set(this.form, name, value);
  1165. }
  1166. },
  1167. invoicingCheckboxChange(arr) {
  1168. this.invoicingCheckboxData = arr;
  1169. },
  1170. // 开票明细单个删除
  1171. invoiceDeletionfun(id, index) {
  1172. if (id) {
  1173. this.$confirm("确定将选择数据删除?", {
  1174. confirmButtonText: "确定",
  1175. cancelButtonText: "取消",
  1176. type: "warning"
  1177. }).then(() => {
  1178. if (id) {
  1179. fininvoiceitemdetailRemove(id).then(res => {
  1180. this.$message.success("操作成功");
  1181. this.InvoicingList.splice(index, 1);
  1182. });
  1183. }
  1184. });
  1185. } else {
  1186. this.InvoicingList.splice(index, 1);
  1187. }
  1188. },
  1189. // 开票明细编辑完成保存
  1190. invoiceSavefun(row, index) {
  1191. if (!row.invoiceCompanyId) {
  1192. return this.$message.error("开票单位不能为空");
  1193. }
  1194. if (!row.curCode) {
  1195. return this.$message.error("币别不能为空");
  1196. }
  1197. if (!Number(row.exrate)) {
  1198. return this.$message.error("汇率不能为空或0");
  1199. }
  1200. if (Number(row.price ? row.price : 0) <= 0) {
  1201. return this.$message.error("单价不能为非正数");
  1202. }
  1203. fininvoiceitemdetailSubmit(row).then(res => {
  1204. this.$message.success("操作成功");
  1205. for (let [key, value] of Object.entries(res.data.data)) {
  1206. this.$set(row, key, value);
  1207. }
  1208. this.$set(row, "edit", false);
  1209. });
  1210. },
  1211. // 开票一键删除
  1212. invoicingBatchDelete() {
  1213. if (this.invoicingCheckboxData.length == 0) {
  1214. return this.$message.warning("请选择要删除的数据");
  1215. }
  1216. for (let item of this.invoicingCheckboxData) {
  1217. if (item.invoiceStatus == 1) {
  1218. return this.$message.error("请选择未开开票明细");
  1219. }
  1220. }
  1221. this.$confirm("确定将选择数据删除?", {
  1222. confirmButtonText: "确定",
  1223. cancelButtonText: "取消",
  1224. type: "warning"
  1225. }).then(() => {
  1226. // 获取有id 的数据
  1227. const itemsWithId = this.invoicingCheckboxData.filter(item => item.hasOwnProperty("id"));
  1228. let arrIds = itemsWithId.map(item => item.id); // 获取id 数据
  1229. // 把选中的删除掉
  1230. this.invoicingCheckboxData.forEach(item => {
  1231. for (let index in this.InvoicingList) {
  1232. if (item.id == this.InvoicingList[index].id) {
  1233. this.InvoicingList.splice(Number(index), 1);
  1234. }
  1235. }
  1236. });
  1237. // 有id 的处理
  1238. if (itemsWithId.length != 0) {
  1239. fininvoiceitemdetailRemove(arrIds.join(",")).then(res => {
  1240. this.$message.success("操作成功");
  1241. });
  1242. }
  1243. });
  1244. },
  1245. // 确认开票信息
  1246. invoicingfun() {
  1247. if (this.invoicingCheckboxData.length == 0) {
  1248. this.$message.error("请选择数据");
  1249. return;
  1250. }
  1251. for (let item of this.invoicingCheckboxData) {
  1252. if (!item.id) {
  1253. return this.$message.error("请保存开票明细");
  1254. }
  1255. if (item.invoiceStatus == 1) {
  1256. return this.$message.error("请选择未开开票明细");
  1257. }
  1258. }
  1259. this.form.billNoFormat = "HYDZ";
  1260. this.form.businessTypeCode = "HYDZ";
  1261. this.form.businessType = "CHK"; // 对账单
  1262. this.form.accountDateFrom = this.form.accountDateFrom ? this.form.accountDateFrom.slice(0, 10) + " 00:00:00" : null; // 财务开始日期
  1263. this.form.accountDateTo = this.form.accountDateTo ? this.form.accountDateTo.slice(0, 10) + " 00:00:00" : null; // 财务开始日期
  1264. this.form.auditDateFrom = this.form.auditDateFrom ? this.form.auditDateFrom.slice(0, 10) + " 00:00:00" : null;
  1265. this.form.auditDateTo = this.form.auditDateTo ? this.form.auditDateTo.slice(0, 10) + " 00:00:00" : null;
  1266. this.form.businessDateEnd = this.form.businessDateEnd ? this.form.businessDateEnd.slice(0, 10) + " 00:00:00" : null;
  1267. this.form.businessDateStart = this.form.businessDateStart ? this.form.businessDateStart.slice(0, 10) + " 00:00:00" : null;
  1268. this.form.billDate = this.form.billDate ? this.form.billDate.slice(0, 10) + " 00:00:00" : null;
  1269. // 保留id
  1270. this.form.finStlBillsItemsList = this.tableData;
  1271. let obj = {
  1272. ...this.form,
  1273. finInvoiceItemDetailList: this.invoicingCheckboxData
  1274. };
  1275. this.$confirm("是否生成发票单?", "提示", {
  1276. confirmButtonText: "确定",
  1277. cancelButtonText: "取消",
  1278. type: "warning"
  1279. }).then(() => {
  1280. // 开票项目
  1281. generateInvoice(obj).then(res => {
  1282. this.$message.warning("操作成功");
  1283. this.finstlbillsDetailfun(this.form.id, "finstlbills");
  1284. });
  1285. });
  1286. },
  1287. // 撤销开票信息
  1288. invoicingRevokefun() {
  1289. if (this.invoicingCheckboxData.length == 0) {
  1290. this.$message.warning("请选择数据");
  1291. return;
  1292. }
  1293. if (this.invoicingCheckboxData.length == 0) {
  1294. this.$message.error("请选择数据");
  1295. return;
  1296. }
  1297. for (let item of this.invoicingCheckboxData) {
  1298. if (!item.id) {
  1299. return this.$message.error("请保存开票明细");
  1300. }
  1301. if (item.invoiceStatus == 0) {
  1302. return this.$message.error("请选择已开开票明细");
  1303. }
  1304. }
  1305. this.form.billNoFormat = "HYDZ";
  1306. this.form.businessTypeCode = "HYDZ";
  1307. this.form.businessType = "CHK"; // 对账单
  1308. this.form.accountDateFrom = this.form.accountDateFrom ? this.form.accountDateFrom.slice(0, 10) + " 00:00:00" : null; // 财务开始日期
  1309. this.form.accountDateTo = this.form.accountDateTo ? this.form.accountDateTo.slice(0, 10) + " 00:00:00" : null; // 财务开始日期
  1310. this.form.auditDateFrom = this.form.auditDateFrom ? this.form.auditDateFrom.slice(0, 10) + " 00:00:00" : null;
  1311. this.form.auditDateTo = this.form.auditDateTo ? this.form.auditDateTo.slice(0, 10) + " 00:00:00" : null;
  1312. this.form.businessDateEnd = this.form.businessDateEnd ? this.form.businessDateEnd.slice(0, 10) + " 00:00:00" : null;
  1313. this.form.businessDateStart = this.form.businessDateStart ? this.form.businessDateStart.slice(0, 10) + " 00:00:00" : null;
  1314. this.form.billDate = this.form.billDate ? this.form.billDate.slice(0, 10) + " 00:00:00" : null;
  1315. // 保留id
  1316. this.form.finStlBillsItemsList = this.tableData;
  1317. let obj = {
  1318. ...this.form,
  1319. finInvoiceItemDetailList: this.invoicingCheckboxData
  1320. };
  1321. this.$confirm("是否撤销生成发票单?", "提示", {
  1322. confirmButtonText: "确定",
  1323. cancelButtonText: "取消",
  1324. type: "warning"
  1325. }).then(() => {
  1326. // 撤销开票项目
  1327. revokeInvoice(this.form).then(res => {
  1328. this.$message.warning("操作成功");
  1329. this.finstlbillsDetailfun(this.form.id, "finstlbills");
  1330. });
  1331. });
  1332. },
  1333. // 编辑
  1334. editHandle() {
  1335. if (this.form.status != 3) {
  1336. this.editSave = false;
  1337. }
  1338. },
  1339. // 保存
  1340. editCustomer(type) {
  1341. // 对账单位
  1342. if (!this.form.corpId) {
  1343. this.$message.warning("请选择对账单位");
  1344. return;
  1345. }
  1346. if (!this.form.id) {
  1347. // 是否选择从表数据
  1348. if (this.addData.length == 0) {
  1349. this.$message.warning("请选择对账数据");
  1350. return;
  1351. }
  1352. }
  1353. // for (let item of this.handleSelectionData) {
  1354. // if (!item.currentStlCurCode) {
  1355. // this.$message.warning("请选择本次结算币种");
  1356. // return;
  1357. // }
  1358. // }
  1359. this.form.billNoFormat = "HYDZ";
  1360. this.form.businessTypeCode = "HYDZ";
  1361. this.form.businessType = "CHK"; // 对账单
  1362. this.form.accountDateFrom = this.form.accountDateFrom ? this.form.accountDateFrom.slice(0, 10) + " 00:00:00" : null; // 财务开始日期
  1363. this.form.accountDateTo = this.form.accountDateTo ? this.form.accountDateTo.slice(0, 10) + " 00:00:00" : null; // 财务开始日期
  1364. this.form.auditDateFrom = this.form.auditDateFrom ? this.form.auditDateFrom.slice(0, 10) + " 00:00:00" : null;
  1365. this.form.auditDateTo = this.form.auditDateTo ? this.form.auditDateTo.slice(0, 10) + " 00:00:00" : null;
  1366. this.form.businessDateEnd = this.form.businessDateEnd ? this.form.businessDateEnd.slice(0, 10) + " 00:00:00" : null;
  1367. this.form.businessDateStart = this.form.businessDateStart ? this.form.businessDateStart.slice(0, 10) + " 00:00:00" : null;
  1368. this.form.billDate = this.form.billDate ? this.form.billDate.slice(0, 10) + " 00:00:00" : null;
  1369. let addList = this.addData.map((item, index) => {
  1370. item.lineNo = Number(index) + 1;
  1371. item.pType = item.businessType;
  1372. item.accDate = item.billDate;
  1373. if (item.currentStlCurCode == "CNY") {
  1374. item.currentStlAmount = item.currentStlAmountRMB;
  1375. } else {
  1376. item.currentStlAmount = item.currentStlAmountUSD;
  1377. }
  1378. delete item.id;
  1379. delete item.accountDc;
  1380. return item;
  1381. });
  1382. this.form.finStlBillsItemsList = this.tableData.concat(addList);
  1383. this.form.finStlBillsItemsList = this.form.finStlBillsItemsList.map((item, index) => {
  1384. if (item.currentStlCurCode == "CNY") {
  1385. item.currentStlAmount = item.currentStlAmountRMB;
  1386. } else {
  1387. item.currentStlAmount = item.currentStlAmountUSD;
  1388. }
  1389. return item;
  1390. });
  1391. for (let row of this.InvoicingList) {
  1392. if (!row.invoiceCompanyId) {
  1393. return this.$message.error("开票单位不能为空");
  1394. }
  1395. if (!row.curCode) {
  1396. return this.$message.error("币别不能为空");
  1397. }
  1398. if (!Number(row.exrate)) {
  1399. return this.$message.error("汇率不能为空或0");
  1400. }
  1401. if (Number(row.price ? row.price : 0) <= 0) {
  1402. return this.$message.error("单价不能为非正数");
  1403. }
  1404. }
  1405. this.form.finInvoiceItemDetailList = this.InvoicingList;
  1406. this.saveLoading = true; // 加载动画
  1407. this.pageLoading = true;
  1408. // 判断是单独点击保存还是点击确认对账
  1409. if (type == "toAddEdit") {
  1410. finstlbillsSubmit(this.form)
  1411. .then(res => {
  1412. this.$message.success("操作成功");
  1413. this.$emit(type);
  1414. })
  1415. .finally(() => {
  1416. this.pageLoading = false;
  1417. this.saveLoading = false;
  1418. });
  1419. } else if (type == "确认完成") {
  1420. finstlbillsSubmit(this.form)
  1421. .then(res => {
  1422. this.form = res.data.data;
  1423. this.finstlbillsConfirmReconciliationfun();
  1424. })
  1425. .catch(() => {
  1426. this.pageLoading = false;
  1427. this.saveLoading = false;
  1428. });
  1429. } else {
  1430. finstlbillsSubmit(this.form)
  1431. .then(res => {
  1432. this.$message.success("操作成功");
  1433. this.finstlbillsDetailfun(res.data.data.id, type);
  1434. })
  1435. .finally(() => {
  1436. this.pageLoading = false;
  1437. this.saveLoading = false;
  1438. });
  1439. }
  1440. },
  1441. newbillFun() {
  1442. if (this.submitType) {
  1443. this.$emit("toAddEdit");
  1444. } else {
  1445. this.$confirm("是否需要保存?", "提示", {
  1446. confirmButtonText: "确定",
  1447. cancelButtonText: "取消",
  1448. type: "warning"
  1449. })
  1450. .then(() => {
  1451. this.editCustomer("toAddEdit");
  1452. })
  1453. .catch(() => {
  1454. this.$emit("toAddEdit");
  1455. });
  1456. }
  1457. },
  1458. allClick(name) {
  1459. if (name == "指示") {
  1460. this.$refs.cashier.openDialog(this.form, this.tableData, "auto");
  1461. }
  1462. },
  1463. updateCashier() {
  1464. this.finstlbillsDetailfun(this.form.id, "updateCashier");
  1465. },
  1466. submit(type) {
  1467. for (let item of this.tableData) {
  1468. if (item.isChecked != 1) {
  1469. return this.$message.error("明细数据未完成对账!");
  1470. }
  1471. }
  1472. // if (this.form.cashierStatus == 0) {
  1473. // return this.$message.error("请申请" + (this.form.dc == "D" ? "收费!" : "付费!"));
  1474. // }
  1475. getListAllDetail({ srcId: this.form.id }).then(res => {
  1476. // if (res.data.data.length == 0) {
  1477. // return this.$message.error("请在指示维护费用");
  1478. // }
  1479. // for (let item of res.data.data) {
  1480. // if (item.status == 0) {
  1481. // return this.$message.error("请在指示维护" + (this.form.dc == "D" ? "未收款数据!" : "未支付数据!"));
  1482. // }
  1483. // }
  1484. if (
  1485. Number(this.form.amountDr) != Number(this.form.actualAmountDr) ||
  1486. Number(this.form.amountCr) != Number(this.form.actualAmountCr) ||
  1487. Number(this.form.amountDrUsd) != Number(this.form.actualAmountDrUsd) ||
  1488. Number(this.form.amountCrUsd) != Number(this.form.actualAmountCrUsd)
  1489. ) {
  1490. this.$confirm("对账金额与实际金额不符是否完成?", {
  1491. confirmButtonText: "确定",
  1492. cancelButtonText: "取消",
  1493. type: "warning"
  1494. }).then(() => {
  1495. this.$confirm("确定进行确认完成操作?", {
  1496. confirmButtonText: "确定",
  1497. cancelButtonText: "取消",
  1498. type: "warning"
  1499. })
  1500. .then(() => {
  1501. this.editCustomer(type);
  1502. })
  1503. .catch(() => {
  1504. this.pageLoading = false;
  1505. this.saveLoading = false;
  1506. });
  1507. });
  1508. } else {
  1509. this.$confirm("确定进行确认完成操作?", {
  1510. confirmButtonText: "确定",
  1511. cancelButtonText: "取消",
  1512. type: "warning"
  1513. })
  1514. .then(() => {
  1515. this.editCustomer(type);
  1516. })
  1517. .catch(() => {
  1518. this.pageLoading = false;
  1519. this.saveLoading = false;
  1520. });
  1521. }
  1522. });
  1523. },
  1524. // 详情接口
  1525. finstlbillsDetailfun(id, type) {
  1526. if (type == "finstlbills") {
  1527. this.activeName = "3";
  1528. } else {
  1529. this.activeName = "2";
  1530. }
  1531. this.pageLoading = true;
  1532. finstlbillsDetail(id)
  1533. .then(res => {
  1534. this.form = res.data.data;
  1535. if (type == "query") {
  1536. this.finstlbillslistAccBillV1fun();
  1537. }
  1538. if (
  1539. this.roleName.indexOf("admin") == -1
  1540. ? this.roleName.indexOf("允许修改他人业务") == -1
  1541. ? this.saberUserInfo.user_id != this.form.createUser
  1542. : false
  1543. : false
  1544. ) {
  1545. this.editPower = true;
  1546. } else {
  1547. this.editPower = false;
  1548. }
  1549. // 判断是否已经提交过了
  1550. if (this.form.billStatus == 1) {
  1551. this.submitType = true;
  1552. } else {
  1553. this.submitType = false;
  1554. }
  1555. this.tableData = this.form.finStlBillsItemsList.map(item => {
  1556. if (item.curCode == "CNY") {
  1557. this.$set(item, "amountRMB", item.amount);
  1558. this.$set(item, "currentInvoiceAmountRMB", Number(item.currentInvoiceAmount ? item.currentInvoiceAmount : 0));
  1559. this.$set(item, "unsettledAmountRMB", Number(item.amount ? item.amount : 0));
  1560. this.$set(item, "currentStlAmountRMB", Number(item.currentStlAmount ? item.currentStlAmount : 0));
  1561. this.$set(item, "currentStlAmountUSD", Number(0));
  1562. } else {
  1563. this.$set(item, "amountUSD", item.amount);
  1564. this.$set(item, "currentInvoiceAmountUSD", item.currentInvoiceAmount);
  1565. this.$set(item, "unsettledAmountUSD", Number(item.amount ? item.amount : 0));
  1566. this.$set(item, "currentStlAmountUSD", Number(item.currentStlAmount ? item.currentStlAmount : 0));
  1567. this.$set(item, "currentStlAmountRMB", Number(0));
  1568. }
  1569. this.$set(item, "costDate", []);
  1570. return item;
  1571. });
  1572. this.InvoicingList = this.form.finInvoiceItemDetailList.map(item => {
  1573. item.edit = false;
  1574. return item;
  1575. });
  1576. this.form.isSignfor = this.form.isSignfor + "";
  1577. this.form.isApproved = this.form.isApproved + "";
  1578. this.form.isCleared = this.form.isCleared + "";
  1579. this.form.isChecked = this.form.isChecked + "";
  1580. this.form.billStatus = this.form.billStatus + "";
  1581. this.form.isInvoice = this.form.isInvoice + "";
  1582. if (type == "updateCashier") {
  1583. this.$refs.cashier.openDialog(this.form);
  1584. }
  1585. })
  1586. .finally(() => {
  1587. this.pageLoading = false;
  1588. });
  1589. },
  1590. // 重置条件
  1591. ResetFilter() {
  1592. this.form = {
  1593. billDate: dateFormat(new Date(), "yyyy-MM-dd") + " 00:00", // 对账日期 默认 当天
  1594. isApproved: "0",
  1595. isSignfor: "2",
  1596. isCleared: null, // 销账
  1597. isChecked: "0",
  1598. isInvoice: "0",
  1599. accountDate: [],
  1600. approvedDate: []
  1601. };
  1602. },
  1603. // 弹窗选择
  1604. retrievePopupsSelect(row) {
  1605. // this.form = row
  1606. this.$set(this.form, "corpId", row.id);
  1607. this.$set(this.form, "corpCnName", row.cnName);
  1608. this.$set(this.form, "corpEnName", row.enName);
  1609. this.$set(this.form, "corpArgreementNo", row.enName);
  1610. this.retrievePopupsType = false;
  1611. this.finstlbillslistAccBillV1fun("检索");
  1612. },
  1613. // 检索
  1614. retrievalfun() {
  1615. this.activeName = "1";
  1616. // 判断是否有对账单位
  1617. if (!this.form.corpId && (this.form.businessNo || this.form.accountNo || this.form.hblno || this.form.mblno)) {
  1618. console.log("新接口");
  1619. this.finstlbillslistAccBillByCorpfun();
  1620. } else {
  1621. if (!this.form.corpId) {
  1622. return this.$message.warning("请填写对账单位");
  1623. }
  1624. console.log("原来的接口");
  1625. this.finstlbillslistAccBillV1fun("检索");
  1626. }
  1627. },
  1628. // 检索出的弹窗
  1629. finstlbillslistAccBillByCorpfun() {
  1630. // delete this.form.id;
  1631. // let obj = JSON.parse(JSON.stringify(this.form))
  1632. let obj = {};
  1633. obj.type = "1";
  1634. obj.auditStatus = this.form.isApproved; // 审核状态 0 新建费用 1 已请核 2 审核中 3 驳回 4 通过
  1635. obj.corpCnName = this.form.corpId; // 对账单位
  1636. obj.isSignfor = this.form.isSignfor; // 是否已签收(0 否 1是)
  1637. obj.dc = this.form.dc; // 收付 D=收 C=付
  1638. obj.curCode = this.form.curCode; // 币别
  1639. obj.srcType = this.form.srcType; // 业务来源
  1640. obj.srcCnName = this.form.srcId; // 业务员id
  1641. obj.isCleared = this.form.isCleared; // 是否销账(0 未销账 3 部分销账 9 销账)
  1642. obj.accBillNo = this.form.accountNo; // 账单编号 ACCT NO
  1643. obj.billNo = this.form.businessNo; // 单据编号 JOB NO
  1644. obj.mblno = this.form.mblno; // MB/L NO
  1645. obj.hblno = this.form.hblno; // HB/L NO
  1646. obj.isChecked = this.form.isChecked; // 是否对账(0 未对账 1 已对账)
  1647. obj.queryAmount = this.form.queryAmount; // 查询金额
  1648. obj.businessType = this.form.businessTypes; // 业务类型
  1649. obj.invoiceStatus = this.form.isInvoice; // 发票状态 0 = 未开 9=已开 2 待开 3 不开
  1650. obj.vesselCnName = this.form.vesselCnName; // 中文船名
  1651. obj.invoiceNo = this.form.invoiceNo; // 发票号
  1652. obj.bookingNo = this.form.bookingNo; // 订舱号 BKNO
  1653. obj.createUserName = this.form.updateUser ? this.form.updateUser : null; // 操作员id
  1654. obj.receivableAdvance = this.form.receivableAdvance; // 预收帐款
  1655. obj.threeInspectionsNo = this.form.threeInspectionsNo; // 三检单号
  1656. obj.voyageNo = this.form.voyageNo; // 航次
  1657. obj.businessDateStart = this.form.businessDateStart; // 业务开始日期
  1658. obj.businessDateEnd = this.form.businessDateEnd; // 业务结束日期
  1659. obj.billDateStart = this.form.accountDateFrom; // 财务开始日期
  1660. obj.billDateEnd = this.form.accountDateTo; // 财务开始日期
  1661. obj.approveTimeStart = this.form.auditDateFrom; // 审核开始日期
  1662. obj.approveTimeEnd = this.form.auditDateTo; // 审核结束日期
  1663. obj.feeCnName = this.form.feeCnName;
  1664. finstlbillslistAccBillByCorp(obj).then(res => {
  1665. this.retrievePopupsType = true;
  1666. this.retrievePopupsData = res.data.data;
  1667. });
  1668. },
  1669. // 检索接口
  1670. finstlbillslistAccBillV1fun(type) {
  1671. // delete this.form.id;
  1672. // let obj = JSON.parse(JSON.stringify(this.form))
  1673. let obj = {};
  1674. obj.type = "1";
  1675. obj.auditStatus = this.form.isApproved; // 审核状态 0 新建费用 1 已请核 2 审核中 3 驳回 4 通过
  1676. obj.corpCnName = this.form.corpId; // 对账单位
  1677. obj.isSignfor = this.form.isSignfor; // 是否已签收(0 否 1是)
  1678. obj.dc = this.form.dc; // 收付 D=收 C=付
  1679. obj.curCode = this.form.curCode; // 币别
  1680. obj.srcType = this.form.srcType; // 业务来源
  1681. obj.srcCnName = this.form.srcId; // 业务员id
  1682. obj.isCleared = this.form.isCleared; // 是否销账(0 未销账 3 部分销账 9 销账)
  1683. obj.accBillNo = this.form.accountNo; // 账单编号 ACCT NO
  1684. obj.billNo = this.form.businessNo; // 单据编号 JOB NO
  1685. obj.mblno = this.form.mblno; // MB/L NO
  1686. obj.hblno = this.form.hblno; // HB/L NO
  1687. obj.isChecked = this.form.isChecked; // 是否对账(0 未对账 1 已对账)
  1688. obj.queryAmount = this.form.queryAmount; // 查询金额
  1689. obj.businessType = this.form.businessTypes; // 业务类型
  1690. obj.invoiceStatus = this.form.isInvoice; // 发票状态 0 = 未开 9=已开 2 待开 3 不开
  1691. obj.vesselCnName = this.form.vesselCnName; // 中文船名
  1692. obj.invoiceNo = this.form.invoiceNo; // 发票号
  1693. obj.bookingNo = this.form.bookingNo; // 订舱号 BKNO
  1694. obj.createUserName = this.form.updateUser ? this.form.updateUser : null; // 操作员id
  1695. obj.receivableAdvance = this.form.receivableAdvance; // 预收帐款
  1696. obj.threeInspectionsNo = this.form.threeInspectionsNo; // 三检单号
  1697. obj.voyageNo = this.form.voyageNo; // 航次
  1698. obj.businessDateStart = this.form.businessDateStart; // 业务开始日期
  1699. obj.businessDateEnd = this.form.businessDateEnd; // 业务结束日期
  1700. obj.billDateStart = this.form.accountDateFrom; // 财务开始日期
  1701. obj.billDateEnd = this.form.accountDateTo; // 财务开始日期
  1702. obj.approveTimeStart = this.form.auditDateFrom; // 审核开始日期
  1703. obj.approveTimeEnd = this.form.auditDateTo; // 审核结束日期
  1704. obj.feeCnName = this.form.feeCnName;
  1705. finstlbillslistAccBillV1(obj).then(res => {
  1706. res.data.data.forEach((item, index) => {
  1707. item.accBillId = item.id;
  1708. delete item.id;
  1709. item.lineNo = Number(index) + 1;
  1710. this.$set(item, "currentStlCurCode", item.curCode);
  1711. this.$set(item, "currentStlExrate", item.exrate);
  1712. item.accBillNo = item.billNo;
  1713. item.billNo = item.businessBillDivideNo ? item.businessBillDivideNo : item.businessBillNo;
  1714. item.dc = item.accountDc; // 收付
  1715. item.isSignfor = 0;
  1716. item.isChecked = 0;
  1717. if (item.curCode == "CNY") {
  1718. this.$set(item, "amountRMB", item.amount);
  1719. this.$set(item, "currentInvoiceAmountRMB", Number(item.currentInvoiceAmount ? item.currentInvoiceAmount : 0));
  1720. // this.$set(item, "unsettledAmountRMB", Number(item.unsettledAmount ? item.unsettledAmount : 0));
  1721. this.$set(item, "currentStlAmountRMB", Number(item.reconciliationCurrentAmount ? item.reconciliationCurrentAmount : 0));
  1722. this.$set(item, "currentStlAmountUSD", Number(0));
  1723. } else {
  1724. this.$set(item, "amountUSD", item.amount);
  1725. this.$set(item, "currentInvoiceAmountUSD", Number(item.currentInvoiceAmount ? item.currentInvoiceAmount : 0));
  1726. // this.$set(item, "unsettledAmountUSD", Number(item.unsettledAmount ? item.unsettledAmount : 0));
  1727. this.$set(item, "currentStlAmountUSD", Number(item.reconciliationCurrentAmount ? item.reconciliationCurrentAmount : 0));
  1728. this.$set(item, "currentStlAmountRMB", Number(0));
  1729. }
  1730. });
  1731. this.queryData = [];
  1732. for (let item of res.data.data) {
  1733. if (this.tableData.filter(row => row.accBillNo == item.accBillNo).length == 0) {
  1734. this.queryData.push(item);
  1735. }
  1736. }
  1737. if (this.queryData.length == 0 && type == "检索") {
  1738. this.$message.warning("当前检索暂无数据!");
  1739. }
  1740. });
  1741. },
  1742. // 确认发票
  1743. Confirminvoicefun(type) {
  1744. if (this.handleSelectionData.length === 0) {
  1745. this.$message.warning("请选择至少一条数据");
  1746. return;
  1747. }
  1748. for (let item of this.handleSelectionData) {
  1749. if (item.isInvoice == 3) {
  1750. this.$message.error("已不开发票,请重新选择");
  1751. return;
  1752. }
  1753. }
  1754. for (let item of this.handleSelectionData) {
  1755. if (item.isInvoice == 2) {
  1756. this.$message.error("已确认开票,请重新选择");
  1757. return;
  1758. }
  1759. }
  1760. this.$confirm("确定将选择数据确认开票?", {
  1761. confirmButtonText: "确定",
  1762. cancelButtonText: "取消",
  1763. type: "warning"
  1764. }).then(() => {
  1765. this.finstlbillsConfirmInvoicingfun(type);
  1766. });
  1767. },
  1768. // 不开发票
  1769. Notinvoicingfun(type) {
  1770. if (this.handleSelectionData.length === 0) {
  1771. this.$message.warning("请选择至少一条数据");
  1772. return;
  1773. }
  1774. if (type == 1) {
  1775. for (let item of this.handleSelectionData) {
  1776. if (item.isInvoice == 1) {
  1777. this.$message.error("未确认开票,请重新选择");
  1778. return;
  1779. }
  1780. if (item.isInvoice == 3) {
  1781. this.$message.error("已不开发票,请重新选择");
  1782. return;
  1783. }
  1784. }
  1785. }
  1786. if (type == 2) {
  1787. for (let item of this.handleSelectionData) {
  1788. if (item.isInvoice == 1) {
  1789. this.$message.error("未不开发票,请重新选择");
  1790. return;
  1791. }
  1792. if (item.isInvoice == 2) {
  1793. this.$message.error("已确认开票,请重新选择");
  1794. return;
  1795. }
  1796. }
  1797. }
  1798. this.$confirm("确定将选择数据撤销签收?", {
  1799. confirmButtonText: "确定",
  1800. cancelButtonText: "取消",
  1801. type: "warning"
  1802. }).then(() => {
  1803. this.finstlbillsRevokeInvoicingfun();
  1804. });
  1805. },
  1806. // 确认发票接口
  1807. finstlbillsConfirmInvoicingfun(type) {
  1808. this.form.billNoFormat = "HYDZ";
  1809. this.form.businessTypeCode = "HYDZ";
  1810. this.form.businessType = "CHK"; //对账单
  1811. this.form.accountDateFrom = this.form.accountDateFrom ? this.form.accountDateFrom.slice(0, 10) + " 00:00:00" : null; // 财务开始日期
  1812. this.form.accountDateTo = this.form.accountDateTo ? this.form.accountDateTo.slice(0, 10) + " 00:00:00" : null; // 财务开始日期
  1813. this.form.auditDateFrom = this.form.auditDateFrom ? this.form.auditDateFrom.slice(0, 10) + " 00:00:00" : null;
  1814. this.form.auditDateTo = this.form.auditDateTo ? this.form.auditDateTo.slice(0, 10) + " 00:00:00" : null;
  1815. this.form.businessDateEnd = this.form.businessDateEnd ? this.form.businessDateEnd.slice(0, 10) + " 00:00:00" : null;
  1816. this.form.businessDateStart = this.form.businessDateStart ? this.form.businessDateStart.slice(0, 10) + " 00:00:00" : null;
  1817. this.form.billDate = this.form.billDate ? this.form.billDate.slice(0, 10) + " 00:00:00" : null;
  1818. // 保留id
  1819. this.form.finStlBillsItemsList = this.handleSelectionData;
  1820. let obj = {
  1821. ...this.form,
  1822. type: type
  1823. };
  1824. this.pageLoading = true;
  1825. finstlbillsConfirmInvoicing(obj)
  1826. .then(res => {
  1827. this.$message.success("操作成功");
  1828. this.finstlbillsDetailfun(res.data.data.id);
  1829. })
  1830. .finally(() => {
  1831. this.pageLoading = false;
  1832. });
  1833. },
  1834. // 撤销发票接口
  1835. finstlbillsRevokeInvoicingfun() {
  1836. this.form.billNoFormat = "HYDZ";
  1837. this.form.businessTypeCode = "HYDZ";
  1838. this.form.businessType = "CHK"; // 对账单
  1839. this.form.accountDateFrom = this.form.accountDateFrom ? this.form.accountDateFrom.slice(0, 10) + " 00:00:00" : null; // 财务开始日期
  1840. this.form.accountDateTo = this.form.accountDateTo ? this.form.accountDateTo.slice(0, 10) + " 00:00:00" : null; // 财务开始日期
  1841. this.form.auditDateFrom = this.form.auditDateFrom ? this.form.auditDateFrom.slice(0, 10) + " 00:00:00" : null;
  1842. this.form.auditDateTo = this.form.auditDateTo ? this.form.auditDateTo.slice(0, 10) + " 00:00:00" : null;
  1843. this.form.businessDateEnd = this.form.businessDateEnd ? this.form.businessDateEnd.slice(0, 10) + " 00:00:00" : null;
  1844. this.form.businessDateStart = this.form.businessDateStart ? this.form.businessDateStart.slice(0, 10) + " 00:00:00" : null;
  1845. this.form.billDate = this.form.billDate ? this.form.billDate.slice(0, 10) + " 00:00:00" : null;
  1846. this.form.finStlBillsItemsList = this.handleSelectionData;
  1847. this.pageLoading = true;
  1848. finstlbillsRevokeInvoicing(this.form)
  1849. .then(res => {
  1850. this.$message.success("操作成功");
  1851. this.finstlbillsDetailfun(res.data.data.id);
  1852. })
  1853. .finally(() => {
  1854. this.pageLoading = false;
  1855. });
  1856. },
  1857. // 对账确认
  1858. finstlbillsConfirmReconciliationfun() {
  1859. this.pageLoading = true;
  1860. this.saveLoading = true;
  1861. this.form.accountDateFrom = this.form.accountDateFrom ? this.form.accountDateFrom.slice(0, 10) + " 00:00:00" : null; // 财务开始日期
  1862. this.form.accountDateTo = this.form.accountDateTo ? this.form.accountDateTo.slice(0, 10) + " 00:00:00" : null; // 财务开始日期
  1863. this.form.auditDateFrom = this.form.auditDateFrom ? this.form.auditDateFrom.slice(0, 10) + " 00:00:00" : null;
  1864. this.form.auditDateTo = this.form.auditDateTo ? this.form.auditDateTo.slice(0, 10) + " 00:00:00" : null;
  1865. this.form.businessDateEnd = this.form.businessDateEnd ? this.form.businessDateEnd.slice(0, 10) + " 00:00:00" : null;
  1866. this.form.businessDateStart = this.form.businessDateStart ? this.form.businessDateStart.slice(0, 10) + " 00:00:00" : null;
  1867. this.form.billDate = this.form.billDate ? this.form.billDate.slice(0, 10) + " 00:00:00" : null;
  1868. (this.form.url = "/iosBasicData/finstlbills/index"), (this.form.pageStatus = "this.$store.getters.paidapplication");
  1869. this.form.pageLabel = "对账中心(F)";
  1870. finstlbillsConfirmReconciliation(this.form)
  1871. .then(res => {
  1872. this.$message.success("操作成功");
  1873. this.editSave = true;
  1874. this.finstlbillsDetailfun(res.data.data.id);
  1875. })
  1876. .finally(() => {
  1877. this.pageLoading = false;
  1878. this.saveLoading = false;
  1879. });
  1880. },
  1881. // 对账撤销
  1882. finstlbillsRevokeReconciliationfun() {
  1883. this.$confirm("确定进行撤销对账操作?", {
  1884. confirmButtonText: "确定",
  1885. cancelButtonText: "取消",
  1886. type: "warning"
  1887. }).then(() => {
  1888. this.pageLoading = true;
  1889. this.form.accountDateFrom = this.form.accountDateFrom ? this.form.accountDateFrom.slice(0, 10) + " 00:00:00" : null; // 财务开始日期
  1890. this.form.accountDateTo = this.form.accountDateTo ? this.form.accountDateTo.slice(0, 10) + " 00:00:00" : null; // 财务开始日期
  1891. this.form.auditDateFrom = this.form.auditDateFrom ? this.form.auditDateFrom.slice(0, 10) + " 00:00:00" : null;
  1892. this.form.auditDateTo = this.form.auditDateTo ? this.form.auditDateTo.slice(0, 10) + " 00:00:00" : null;
  1893. this.form.businessDateEnd = this.form.businessDateEnd ? this.form.businessDateEnd.slice(0, 10) + " 00:00:00" : null;
  1894. this.form.businessDateStart = this.form.businessDateStart ? this.form.businessDateStart.slice(0, 10) + " 00:00:00" : null;
  1895. this.form.billDate = this.form.billDate ? this.form.billDate.slice(0, 10) + " 00:00:00" : null;
  1896. finstlbillsRevokeReconciliation(this.form)
  1897. .then(res => {
  1898. this.$message.success("操作成功");
  1899. this.finstlbillsDetailfun(res.data.data.id);
  1900. })
  1901. .finally(() => {
  1902. this.pageLoading = false;
  1903. });
  1904. });
  1905. },
  1906. // 确认签收
  1907. ConfirmReceiptfun() {
  1908. if (this.handleSelectionData.length === 0) {
  1909. this.$message.warning("请选择至少一条数据");
  1910. return;
  1911. }
  1912. for (let item of this.handleSelectionData) {
  1913. if (item.isSignfor == 1) {
  1914. this.$message.warning("请选择未签收的数据进行签收");
  1915. return;
  1916. }
  1917. }
  1918. this.$confirm("确定将选择数据签收?", {
  1919. confirmButtonText: "确定",
  1920. cancelButtonText: "取消",
  1921. type: "warning"
  1922. }).then(() => {
  1923. this.finstlbillsConfirmSignForfun();
  1924. });
  1925. },
  1926. // 撤销签收
  1927. RevokeReceiptfun() {
  1928. if (this.handleSelectionData.length === 0) {
  1929. this.$message.warning("请选择至少一条数据");
  1930. return;
  1931. }
  1932. for (let item of this.handleSelectionData) {
  1933. if (item.isSignfor == 0) {
  1934. this.$message.warning("请选择已签收的数据进行撤销");
  1935. return;
  1936. }
  1937. }
  1938. this.$confirm("确定将选择数据撤销签收?", {
  1939. confirmButtonText: "确定",
  1940. cancelButtonText: "取消",
  1941. type: "warning"
  1942. }).then(() => {
  1943. this.finstlbillsRevokeSignForfun();
  1944. });
  1945. },
  1946. batchConfirm() {
  1947. if (this.handleSelectionData.length === 0) {
  1948. this.$message.warning("请选择至少一条数据");
  1949. return;
  1950. }
  1951. for (let item of this.handleSelectionData) {
  1952. // if (item.isSignfor == 0) {
  1953. // return this.$message.error("请选择已签收的数据");
  1954. // }
  1955. if (item.isChecked == 1) {
  1956. return this.$message.error("请选择未对账的数据");
  1957. }
  1958. }
  1959. this.$confirm("是否对账?", {
  1960. confirmButtonText: "确定",
  1961. cancelButtonText: "取消",
  1962. type: "warning"
  1963. }).then(() => {
  1964. this.form.billNoFormat = "HYDZ";
  1965. this.form.businessTypeCode = "HYDZ";
  1966. this.form.businessType = "CHK"; //对账单
  1967. this.form.accountDateFrom = this.form.accountDateFrom ? this.form.accountDateFrom.slice(0, 10) + " 00:00:00" : null; // 财务开始日期
  1968. this.form.accountDateTo = this.form.accountDateTo ? this.form.accountDateTo.slice(0, 10) + " 00:00:00" : null; // 财务开始日期
  1969. this.form.auditDateFrom = this.form.auditDateFrom ? this.form.auditDateFrom.slice(0, 10) + " 00:00:00" : null;
  1970. this.form.auditDateTo = this.form.auditDateTo ? this.form.auditDateTo.slice(0, 10) + " 00:00:00" : null;
  1971. this.form.businessDateEnd = this.form.businessDateEnd ? this.form.businessDateEnd.slice(0, 10) + " 00:00:00" : null;
  1972. this.form.businessDateStart = this.form.businessDateStart ? this.form.businessDateStart.slice(0, 10) + " 00:00:00" : null;
  1973. this.form.billDate = this.form.billDate ? this.form.billDate.slice(0, 10) + " 00:00:00" : null;
  1974. // 保留id
  1975. this.form.finStlBillsItemsList = this.handleSelectionData;
  1976. this.pageLoading = true;
  1977. batchConfirmReconciliation(this.form)
  1978. .then(res => {
  1979. this.$message.success("操作成功");
  1980. this.finstlbillsDetailfun(this.form.id);
  1981. })
  1982. .finally(() => {
  1983. this.pageLoading = false;
  1984. });
  1985. });
  1986. },
  1987. batchRevoke() {
  1988. if (this.handleSelectionData.length === 0) {
  1989. this.$message.error("请选择至少一条数据");
  1990. return;
  1991. }
  1992. // for (let item of this.handleSelectionData) {
  1993. // if (item.isChecked == 0) {
  1994. // return this.$message.error("请选择已对账的数据");
  1995. // }
  1996. // }
  1997. this.$confirm("是否撤销对账?", {
  1998. confirmButtonText: "确定",
  1999. cancelButtonText: "取消",
  2000. type: "warning"
  2001. }).then(() => {
  2002. this.form.billNoFormat = "HYDZ";
  2003. this.form.businessTypeCode = "HYDZ";
  2004. this.form.businessType = "CHK"; // 对账单
  2005. this.form.accountDateFrom = this.form.accountDateFrom ? this.form.accountDateFrom.slice(0, 10) + " 00:00:00" : null; // 财务开始日期
  2006. this.form.accountDateTo = this.form.accountDateTo ? this.form.accountDateTo.slice(0, 10) + " 00:00:00" : null; // 财务开始日期
  2007. this.form.auditDateFrom = this.form.auditDateFrom ? this.form.auditDateFrom.slice(0, 10) + " 00:00:00" : null;
  2008. this.form.auditDateTo = this.form.auditDateTo ? this.form.auditDateTo.slice(0, 10) + " 00:00:00" : null;
  2009. this.form.businessDateEnd = this.form.businessDateEnd ? this.form.businessDateEnd.slice(0, 10) + " 00:00:00" : null;
  2010. this.form.businessDateStart = this.form.businessDateStart ? this.form.businessDateStart.slice(0, 10) + " 00:00:00" : null;
  2011. this.form.billDate = this.form.billDate ? this.form.billDate.slice(0, 10) + " 00:00:00" : null;
  2012. this.form.finStlBillsItemsList = this.handleSelectionData;
  2013. this.pageLoading = true;
  2014. batchRevokeReconciliation(this.form)
  2015. .then(res => {
  2016. this.$message.success("操作成功");
  2017. this.finstlbillsDetailfun(res.data.data.id);
  2018. })
  2019. .finally(() => {
  2020. this.pageLoading = false;
  2021. });
  2022. });
  2023. },
  2024. // 一键删除
  2025. batchDeletefun() {
  2026. if (this.handleSelectionData.length == 0) {
  2027. return this.$message.warning("请选择要删除的数据");
  2028. }
  2029. for (let item of this.handleSelectionData) {
  2030. if (item.isSignfor == 1) {
  2031. this.$message.error("已签收数据,不允许删除");
  2032. return;
  2033. }
  2034. }
  2035. for (let item of this.handleSelectionData) {
  2036. if (item.isChecked == 1) {
  2037. this.$message.error("已对账数据,不允许删除");
  2038. return;
  2039. }
  2040. }
  2041. for (let item of this.handleSelectionData) {
  2042. if (item.isInvoice == 3) {
  2043. this.$message.error("已不开发票,请重新选择");
  2044. return;
  2045. }
  2046. }
  2047. for (let item of this.handleSelectionData) {
  2048. if (item.isInvoice == 2) {
  2049. this.$message.error("已确认开票,请重新选择");
  2050. return;
  2051. }
  2052. }
  2053. this.$confirm("确定将选择数据删除?", {
  2054. confirmButtonText: "确定",
  2055. cancelButtonText: "取消",
  2056. type: "warning"
  2057. }).then(() => {
  2058. // 获取有id 的数据
  2059. const itemsWithId = this.handleSelectionData.filter(item => item.hasOwnProperty("id"));
  2060. let arrIds = itemsWithId.map(item => item.id); // 获取id 数据
  2061. // 把选中的删除掉
  2062. this.handleSelectionData.forEach(item => {
  2063. for (let index in this.tableData) {
  2064. if (item.accBillNo == this.tableData[index].accBillNo) {
  2065. this.tableData.splice(Number(index), 1);
  2066. }
  2067. }
  2068. });
  2069. // 有id 的处理
  2070. if (itemsWithId.length != 0) {
  2071. finstlbillsitemsRemove(arrIds.join(",")).then(res => {
  2072. this.$message.success("操作成功");
  2073. this.finstlbillsDetailfun(this.form.id);
  2074. });
  2075. }
  2076. });
  2077. },
  2078. // 确认选定行
  2079. allCell() {
  2080. if (this.addData.length == 0) {
  2081. return this.$message.error("请选择明细");
  2082. }
  2083. for (let item of this.addData) {
  2084. if (item.currentStlAmountRMB == 0 && item.currentStlAmountUSD == 0) {
  2085. return this.$message.error("账单编号:" + item.accBillNo + "的对账数据不允许选定");
  2086. }
  2087. }
  2088. this.editCustomer("query");
  2089. },
  2090. // 确认选定行
  2091. addSelectionChange(arr) {
  2092. this.amountDSubSum = 0;
  2093. this.amountDSubUsdSum = 0;
  2094. this.amountCSubSum = 0;
  2095. this.amountCSubUsdSum = 0;
  2096. if (arr.length) {
  2097. arr.forEach(e => {
  2098. console.log(e.accountDc);
  2099. if (e.dc == "D") {
  2100. this.amountDSubSum += Number(e.currentStlAmountRMB ? e.currentStlAmountRMB : 0);
  2101. this.amountDSubUsdSum += Number(e.currentStlAmountUSD ? e.currentStlAmountUSD : 0);
  2102. }
  2103. if (e.dc == "C") {
  2104. this.amountCSubSum += Number(e.currentStlAmountRMB ? e.currentStlAmountRMB : 0);
  2105. this.amountCSubUsdSum += Number(e.currentStlAmountUSD ? e.currentStlAmountUSD : 0);
  2106. }
  2107. });
  2108. }
  2109. this.addData = arr;
  2110. },
  2111. // 下面表格多选
  2112. handleSelectionChange(arr) {
  2113. this.amountDSubSum2 = 0;
  2114. this.amountDSubUsdSum2 = 0;
  2115. this.amountCSubSum2 = 0;
  2116. this.amountCSubUsdSum2 = 0;
  2117. if (arr.length) {
  2118. arr.forEach(e => {
  2119. if (e.dc == "D") {
  2120. this.amountDSubSum2 += Number(e.currentStlAmountRMB ? e.currentStlAmountRMB : 0);
  2121. this.amountDSubUsdSum2 += Number(e.currentStlAmountUSD ? e.currentStlAmountUSD : 0);
  2122. }
  2123. if (e.dc == "C") {
  2124. this.amountCSubSum2 += Number(e.currentStlAmountRMB ? e.currentStlAmountRMB : 0);
  2125. this.amountCSubUsdSum2 += Number(e.currentStlAmountUSD ? e.currentStlAmountUSD : 0);
  2126. }
  2127. });
  2128. }
  2129. this.handleSelectionData = arr;
  2130. },
  2131. //返回列表
  2132. backToList() {
  2133. this.$emit("goBack");
  2134. },
  2135. // 请求的接口
  2136. // 确认签收接口
  2137. finstlbillsConfirmSignForfun() {
  2138. this.form.billNoFormat = "HYDZ";
  2139. this.form.businessTypeCode = "HYDZ";
  2140. this.form.businessType = "CHK"; //对账单
  2141. this.form.accountDateFrom = this.form.accountDateFrom ? this.form.accountDateFrom.slice(0, 10) + " 00:00:00" : null; // 财务开始日期
  2142. this.form.accountDateTo = this.form.accountDateTo ? this.form.accountDateTo.slice(0, 10) + " 00:00:00" : null; // 财务开始日期
  2143. this.form.auditDateFrom = this.form.auditDateFrom ? this.form.auditDateFrom.slice(0, 10) + " 00:00:00" : null;
  2144. this.form.auditDateTo = this.form.auditDateTo ? this.form.auditDateTo.slice(0, 10) + " 00:00:00" : null;
  2145. this.form.businessDateEnd = this.form.businessDateEnd ? this.form.businessDateEnd.slice(0, 10) + " 00:00:00" : null;
  2146. this.form.businessDateStart = this.form.businessDateStart ? this.form.businessDateStart.slice(0, 10) + " 00:00:00" : null;
  2147. this.form.billDate = this.form.billDate ? this.form.billDate.slice(0, 10) + " 00:00:00" : null;
  2148. // 保留id
  2149. this.form.finStlBillsItemsList = this.handleSelectionData;
  2150. this.pageLoading = true;
  2151. finstlbillsConfirmSignFor(this.form)
  2152. .then(res => {
  2153. this.$message.success("操作成功");
  2154. this.finstlbillsDetailfun(res.data.data.id);
  2155. })
  2156. .finally(() => {
  2157. this.pageLoading = false;
  2158. });
  2159. },
  2160. // 撤销签收接口
  2161. finstlbillsRevokeSignForfun() {
  2162. this.form.billNoFormat = "HYDZ";
  2163. this.form.businessTypeCode = "HYDZ";
  2164. this.form.businessType = "CHK"; // 对账单
  2165. this.form.accountDateFrom = this.form.accountDateFrom ? this.form.accountDateFrom.slice(0, 10) + " 00:00:00" : null; // 财务开始日期
  2166. this.form.accountDateTo = this.form.accountDateTo ? this.form.accountDateTo.slice(0, 10) + " 00:00:00" : null; // 财务开始日期
  2167. this.form.auditDateFrom = this.form.auditDateFrom ? this.form.auditDateFrom.slice(0, 10) + " 00:00:00" : null;
  2168. this.form.auditDateTo = this.form.auditDateTo ? this.form.auditDateTo.slice(0, 10) + " 00:00:00" : null;
  2169. this.form.businessDateEnd = this.form.businessDateEnd ? this.form.businessDateEnd.slice(0, 10) + " 00:00:00" : null;
  2170. this.form.businessDateStart = this.form.businessDateStart ? this.form.businessDateStart.slice(0, 10) + " 00:00:00" : null;
  2171. this.form.billDate = this.form.billDate ? this.form.billDate.slice(0, 10) + " 00:00:00" : null;
  2172. this.form.finStlBillsItemsList = this.handleSelectionData;
  2173. this.pageLoading = true;
  2174. finstlbillsRevokeSignFor(this.form)
  2175. .then(res => {
  2176. this.$message.success("操作成功");
  2177. this.finstlbillsDetailfun(res.data.data.id);
  2178. })
  2179. .finally(() => {
  2180. this.pageLoading = false;
  2181. });
  2182. },
  2183. // 获取 全部是否 接口
  2184. allyesnoWorkDictsfun() {
  2185. // 全部/是/否
  2186. getWorkDicts("all_yes_no").then(res => {
  2187. this.allyesnoData = res.data.data;
  2188. });
  2189. // 对账字典
  2190. getWorkDicts("los_check_status").then(res => {
  2191. this.isCheckedData = res.data.data;
  2192. });
  2193. // 销账(F)
  2194. getWorkDicts("write_off_los").then(res => {
  2195. this.isClearedData = [{ dictValue: "全部", dictKey: null }, ...res.data.data];
  2196. });
  2197. },
  2198. // 获取发票的字典数据
  2199. invoiceWorkDictsfun() {
  2200. getWorkDicts("invoice_los").then(res => {
  2201. this.isInvoiceData = res.data.data;
  2202. });
  2203. },
  2204. // 获取币别数据
  2205. getRateListfun(cnName) {
  2206. getRateList({ current: 1, size: 10, cnName }).then(res => {
  2207. this.curCodeData = res.data.data.records;
  2208. });
  2209. },
  2210. // 获取操作员数据
  2211. updateUserUserGetListfun(account) {
  2212. userGetList(1, 10, { account }).then(res => {
  2213. this.updateUserData = res.data.data.records;
  2214. });
  2215. },
  2216. // 获取公司名称 用户管理左侧
  2217. ownDeptLazyTreefun() {
  2218. getDeptLazyTree(0).then(res => {
  2219. this.srcData = res.data.data;
  2220. });
  2221. },
  2222. // 获取业务来源代理数据
  2223. srcBcorpsListfun(cnName) {
  2224. let corpTypeName = "国内直接客户,国内同行及代理,国外直接客户,国外同行及代理";
  2225. getBcorpslistByType(1, 10, { cnName, corpTypeName }).then(res => {
  2226. this.srcData = res.data.data.records;
  2227. });
  2228. },
  2229. // 获取业务员数据
  2230. salesuserGetListfun(account = undefined, type = false) {
  2231. userGetList(1, 10, { account }).then(res => {
  2232. this.srcData = res.data.data.records;
  2233. });
  2234. },
  2235. // 获取对账单位数据
  2236. corpBcorpsListfun(cnName) {
  2237. getBcorpslistByType(1, 10, { cnName }).then(res => {
  2238. this.corpData = res.data.data.records;
  2239. });
  2240. },
  2241. // 预览报表
  2242. handleReportPreview(url, data) {
  2243. console.log(url, 1670);
  2244. console.log(data, 1671);
  2245. Stimulsoft.Base.StiLicense.key =
  2246. "6vJhGtLLLz2GNviWmUTrhSqnOItdDwjBylQzQcAOiHn0s4gy0Fr5YoUZ9V00Y0igCSFQzwEqYBh/N77k4f0fWXTHW5rqeBNLkaurJDenJ9o97TyqHs9HfvINK18Uwzsc/bG01Rq+x3H3Rf+g7AY92gvWmp7VA2Uxa30Q97f61siWz2dE5kdBVcCnSFzC6awE74JzDcJMj8OuxplqB1CYcpoPcOjKy1PiATlC3UsBaLEXsok1xxtRMQ283r282tkh8XQitsxtTczAJBxijuJNfziYhci2jResWXK51ygOOEbVAxmpflujkJ8oEVHkOA/CjX6bGx05pNZ6oSIu9H8deF94MyqIwcdeirCe60GbIQByQtLimfxbIZnO35X3fs/94av0ODfELqrQEpLrpU6FNeHttvlMc5UVrT4K+8lPbqR8Hq0PFWmFrbVIYSi7tAVFMMe2D1C59NWyLu3AkrD3No7YhLVh7LV0Tttr/8FrcZ8xirBPcMZCIGrRIesrHxOsZH2V8t/t0GXCnLLAWX+TNvdNXkB8cF2y9ZXf1enI064yE5dwMs2fQ0yOUG/xornE";
  2247. // Stimulsoft.Base.StiLicense.Key = '6vJhGtLLLz2GNviWmUTrhSqnOItdDwjBylQzQcAOiHkcgIvwL0jnpsDqRpWg5FI5kt2G7A0tYIcUygBh1sPs7plofUOqPB1a4HBIXJB621mau2oiAIj+ysU7gKUXfjn/D5BocmduNB+ZMiDGPxFrAp3PoD0nYNkkWh8r7gBZ1v/JZSXGE3bQDrCQCNSy6mgby+iFAMV8/PuZ1z77U+Xz3fkpbm6MYQXYp3cQooLGLUti7k1TFWrnawT0iEEDJ2iRcU9wLqn2g9UiWesEZtKwI/UmEI2T7nv5NbgV+CHguu6QU4WWzFpIgW+3LUnKCT/vCDY+ymzgycw9A9+HFSzARiPzgOaAuQYrFDpzhXV+ZeX31AxWlnzjDWqpfluygSNPtGul5gyNt2CEoJD1Yom0VN9fvRonYsMsimkFFx2AwyVpPcs+JfVBtpPbTcZscnzUdmiIvxv8Gcin6sNSibM6in/uUKFt3bVgW/XeMYa7MLGF53kvBSwi78poUDigA2n12SmghLR0AHxyEDIgZGOTbNI33GWu7ZsPBeUdGu55R8w='
  2248. Stimulsoft.Base.Localization.StiLocalization.addLocalizationFile("/reports/stimulsoft/Localization/zh-CHS.xml", true, "zh-CHS");
  2249. Stimulsoft.Base.Localization.StiLocalization.setLocalizationFile("/reports/stimulsoft/Localization/zh-CHS.xml");
  2250. // 工具栏
  2251. var options = new Stimulsoft.Viewer.StiViewerOptions();
  2252. options.height = "100%";
  2253. options.appearance.scrollbarsMode = true; // 滚动条模式
  2254. options.toolbar.showDesignButton = false; // 显示设计按钮
  2255. options.toolbar.showAboutButton = false; // 显示关于按钮
  2256. options.toolbar.showResourcesButton = false; // 显示资源按钮
  2257. options.toolbar.showFullScreenButton = false; // 显示全屏按钮
  2258. options.toolbar.showOpenButton = false; // 显示打开按钮
  2259. options.appearance.showTooltips = false; // 显示工具提示
  2260. options.appearance.showDialogsHelp = false; // 显示对话框帮助
  2261. options.exports.showExportToDocument = false; // 显示导出到文档
  2262. options.toolbar.showParametersButton = true; // 显示参数按钮
  2263. options.appearance.bookmarksPrint = true; // 书签打印
  2264. // options.toolbar.showPrintButton = false // 打印按钮是否显示 下面直接自定义控制打印弹窗是否开启
  2265. // printDestination 参数:用于指定报表打印的目标位置,可以是打印机、PDF 文件或者直接打印到浏览器等。
  2266. // Stimulsoft.Viewer.StiPrintDestination.Direct:表示直接打印到打印机,即将报表内容直接发送至打印机进行打印。
  2267. // 通过设置不同的 printDestination 参数,你可以控制报表打印的行为,例如是直接打印到打印机,还是生成 PDF 文件,或者直接在浏览器中预览打印内容等。
  2268. options.toolbar.printDestination = Stimulsoft.Viewer.StiPrintDestination.Direct;
  2269. // htmlRenderMode html渲染模式
  2270. options.appearance.htmlRenderMode = Stimulsoft.Report.Export.StiHtmlExportMode.Table;
  2271. // 是创建一个 Stimulsoft 报表查看器的实例的代码
  2272. let viewer = new Stimulsoft.Viewer.StiViewer(options, "StiViewer", false);
  2273. // 报表
  2274. console.log("创建一个报表实例");
  2275. console.log();
  2276. let report = new window.Stimulsoft.Report.StiReport();
  2277. // 加载文件
  2278. console.log("从url加载报表");
  2279. // report.loadFile("/reports/stimulsoft/demos/SimpleList.mrt");
  2280. report.load(url);
  2281. data.pageOne = "Page : 1 of 1";
  2282. // 处理超长数据
  2283. if (data.hshipperDetails) {
  2284. var consignerIndex2 = data.hshipperDetails.indexOf("\n");
  2285. for (let i = 0; i < 4; i++) {
  2286. consignerIndex2 = data.hshipperDetails.indexOf("\n", consignerIndex2 + 1);
  2287. }
  2288. if (consignerIndex2 != -1) {
  2289. var hshipperDetails = data.hshipperDetails.substring(consignerIndex2 + 2, data.hshipperDetails.length);
  2290. data.hshipperDetails = data.hshipperDetails.substring(0, consignerIndex2) + " *";
  2291. data.commodityDescr += "\n*" + hshipperDetails;
  2292. }
  2293. }
  2294. if (data.hconsigneeDetails) {
  2295. var consigneeIndex2 = data.hconsigneeDetails.indexOf("\n");
  2296. for (let i = 0; i < 3; i++) {
  2297. consigneeIndex2 = data.hconsigneeDetails.indexOf("\n", consigneeIndex2 + 1);
  2298. }
  2299. if (consigneeIndex2 != -1) {
  2300. var hconsigneeDetails = data.hconsigneeDetails.substring(consigneeIndex2 + 2, data.hconsigneeDetails.length);
  2301. data.hconsigneeDetails = data.hconsigneeDetails.substring(0, consigneeIndex2) + " **";
  2302. data.commodityDescr += "\n**" + hconsigneeDetails;
  2303. }
  2304. }
  2305. if (data.hnotifyDetails) {
  2306. var notifierIndex2 = data.hnotifyDetails.indexOf("\n");
  2307. for (let i = 0; i < 3; i++) {
  2308. notifierIndex2 = data.hnotifyDetails.indexOf("\n", notifierIndex2 + 1);
  2309. }
  2310. if (notifierIndex2 != -1) {
  2311. var hnotifyDetails = data.hnotifyDetails.substring(notifierIndex2 + 2, data.hnotifyDetails.length);
  2312. data.hnotifyDetails = data.hnotifyDetails.substring(0, notifierIndex2) + " ***";
  2313. data.commodityDescr += "\n***" + hnotifyDetails;
  2314. }
  2315. }
  2316. // 处理箱号
  2317. if (this.isPrintTheBoxNumber) {
  2318. data.commodityDescr += "\n.\n.\n";
  2319. }
  2320. // PLACE & DATE OF ISSUE
  2321. data.placeAndDateOfIssue = "";
  2322. if (data.issueAt) {
  2323. data.placeAndDateOfIssue += data.issueAt;
  2324. }
  2325. if (data.issueDate) {
  2326. let date = new Date(data.issueDate.replace(/-/g, "/"));
  2327. let yyyy = date.getFullYear();
  2328. let mmmm = date.toDateString().split(" ")[1];
  2329. let dd = date.getDate();
  2330. data.placeAndDateOfIssue += ", " + dd + "-" + mmmm + "-" + yyyy;
  2331. }
  2332. // Total number of containers or packages received by the Carriers
  2333. if (data.preContainersList) {
  2334. let boxMap = new Map();
  2335. for (let boxQuantity of data.preContainersList) {
  2336. if (boxMap.get(boxQuantity.cntrTypeCode)) {
  2337. let v = boxMap.get(boxQuantity.cntrTypeCode);
  2338. boxMap.set(boxQuantity.cntrTypeCode, v + boxQuantity.quantity);
  2339. } else {
  2340. boxMap.set(boxQuantity.cntrTypeCode, boxQuantity.quantity);
  2341. }
  2342. }
  2343. let boxs = "";
  2344. boxMap.forEach(function(value, key, map) {
  2345. boxs += value + "x" + key + ", ";
  2346. });
  2347. boxs = boxs.substring(0, boxs.length - 2);
  2348. data.boxQuantity = boxs + " CONTAINER(S) ONLY";
  2349. }
  2350. // Number of original B/Ls
  2351. if (data.numberOfObl) {
  2352. data.numberOfObl += " (" + data.numberOfOblDigit + ")";
  2353. }
  2354. if (data.commodityDescr) {
  2355. var descriptionIndex2 = data.commodityDescr.indexOf("\n");
  2356. for (let i = 0; i < 19; i++) {
  2357. descriptionIndex2 = data.commodityDescr.indexOf("\n", descriptionIndex2 + 1);
  2358. }
  2359. if (descriptionIndex2 != -1) {
  2360. data.pageOne = "Page : 1 of 2";
  2361. data.pageTwo = "Page : 2 of 2";
  2362. var extraLongText = data.commodityDescr.substring(descriptionIndex2 + 2, data.commodityDescr.length);
  2363. data.commodityDescr = data.commodityDescr.substring(0, descriptionIndex2);
  2364. data.extraLongTips = "** TO BE CONTINUED ON ATTACHED LIST **";
  2365. data.extraLongText = extraLongText;
  2366. }
  2367. }
  2368. // console.log(data.hshipperDetails, 'hshipperDetails2')
  2369. // 创建一个 Stimulsoft 数据集(DataSet)的实例的代码
  2370. var dataSet = new Stimulsoft.System.Data.DataSet("reportData");
  2371. dataSet.readJson(data); // 用于将 JSON 格式的数据加载到数据集中。data 是包含报表数据的 JSON 对象。
  2372. // 这是一个方法调用,用于在报表中注册数据源。参数 'reportData' 是数据源的名称,
  2373. // 第二个 'reportData' 是数据源的别名,dataSet 则是之前创建的数据集实例
  2374. report.regData("reportData", "reportData", dataSet);
  2375. // 从模版和数据加载报表
  2376. // loadReport(report, '', {})
  2377. // 这是将报表对象指定给报表查看器的属性。viewer 是报表查看器的实例,而 report 是之前创建的报表对象。
  2378. viewer.report = report;
  2379. this.$refs.reportContainer.showContainer(
  2380. () => {
  2381. setTimeout(() => {
  2382. viewer.renderHtml("reportContainer");
  2383. this.createViewerButtons(viewer);
  2384. }, 50);
  2385. },
  2386. () => {}
  2387. );
  2388. console.log("加载成功完成!");
  2389. },
  2390. createViewerButtons(viewer) {
  2391. viewer.jsObject.collections.images["myClose.png"] =
  2392. "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABmJLR0QA/wD/AP+gvaeTAAAA0ElEQVQ4ja3TO05CQRQG4A8iOwAbtYWETndAaecK7NwCKmETtJZsSBNLobEz8ZFIJQ0UnOGSm3DnYviTybzO/895DQXGWGCVGQuMEqkRcwcfuMOLalziCaf4TIe9UG9nyMJmFRzNGoRK1BU4xxx9G7cfwostciGk+x8MqgySwDXe4tU53hVV+MNtTmAoX84JGv9NYgrHyR6DV8wUSW7hItZLm36ZVoVQxsFJLOMsPOrH/h7dQwR2cdxOTEn8DtUbPGc4V2H7Vb4Yqfedf/GYSGt8VUmxgyfuBAAAAABJRU5ErkJggg==";
  2393. const closeBtn = viewer.jsObject.SmallButton("closeBtn", "关闭", "myClose.png");
  2394. // 增加打印弹窗配置
  2395. const printBtn = viewer.jsObject.SmallButton("printBtn", "打印报表", "myClose.png");
  2396. // console.log(viewer.jsObject.print(),'1013')
  2397. // 获取 关闭按钮的dom元素位置
  2398. const toolbarTable = viewer.jsObject.controls.toolbar.firstChild.firstChild;
  2399. const buttonsTable = toolbarTable.rows[0].lastChild.lastChild;
  2400. const userButtonCell = buttonsTable.rows[0].insertCell(0);
  2401. // 获取打印按钮的位置
  2402. const buttonsTablePrint = toolbarTable.rows[0].childNodes[0].lastChild; // 打印按钮
  2403. const userButtonPrint = buttonsTablePrint.rows[0].childNodes[0]; // 打印按钮dom位置
  2404. userButtonPrint.addEventListener("click", event => {
  2405. console.log("打印点击");
  2406. // event.preventDefault()
  2407. });
  2408. userButtonPrint.addEventListener("mouseover", event => {
  2409. console.log("移入打印按钮");
  2410. console.log(event, 1035);
  2411. });
  2412. userButtonCell.className = "stiJsViewerClearAllStyles";
  2413. userButtonCell.appendChild(closeBtn); // 添加关闭节点
  2414. // userButtonPrint.prepend(printBtn) // 在 printBtn 节点里最前面增加一个子级节点
  2415. let that = this;
  2416. // 关闭按钮的监听点击
  2417. closeBtn.action = function() {
  2418. console.log(that.$refs.ReportContainer, "1022");
  2419. if (that.$refs.reportContainer) that.$refs.reportContainer.hideContainer();
  2420. };
  2421. // // // 打印按钮监听
  2422. // printBtn.action = (e)=>{
  2423. // console.log('打印')
  2424. // window.print()
  2425. // }
  2426. }
  2427. }
  2428. };
  2429. </script>
  2430. <style scoped>
  2431. ::v-deep.el-form-item {
  2432. margin-bottom: 0;
  2433. }
  2434. .bottomFlex {
  2435. display: flex;
  2436. align-items: center;
  2437. }
  2438. .weightfont {
  2439. font-size: 20px;
  2440. font-weight: bold;
  2441. }
  2442. .weightnum {
  2443. font-size: 15px;
  2444. font-weight: 500;
  2445. }
  2446. </style>