finstlbillsDetails.vue 59 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106
  1. <template>
  2. <div class="borderless" v-loading="pageLoading">
  3. <div class="customer-head">
  4. <div class="customer-back">
  5. <el-button type="danger" style="border: none;background: none;color: red" icon="el-icon-arrow-left"
  6. @click="backToList">返回列表
  7. </el-button>
  8. </div>
  9. <div class="add-customer-btn">
  10. <el-button size="small" type="success" style="margin-right: 8px"
  11. :loading="saveLoading" >提取利润及放单
  12. </el-button>
  13. <el-button size="small" type="warning" plain style="margin-right: 8px" :disabled="!form.id" v-if="form.isChecked == 1"
  14. :loading="saveLoading" @click="finstlbillsRevokeReconciliationfun">撤销对账
  15. </el-button>
  16. <el-button size="small" type="success" plain style="margin-right: 8px" :disabled="!form.id" v-else
  17. :loading="saveLoading" @click="finstlbillsConfirmReconciliationfun">确认对账
  18. </el-button>
  19. <el-button size="small" type="primary" style="margin-right: 8px" v-if="editSave"
  20. :loading="saveLoading" @click="editHandle">编 辑
  21. </el-button>
  22. <el-button size="small" type="primary" style="margin-right: 8px" v-else
  23. :loading="saveLoading" @click="editCustomer">保 存
  24. </el-button>
  25. </div>
  26. </div>
  27. <div style="margin: 55px 5px 0px 5px;'">
  28. <el-card class="box-card">
  29. <el-form :model="form" ref="form" label-width="90px" class="demo-ruleForm">
  30. <el-row>
  31. <el-row>
  32. <el-col :span="5">
  33. <el-form-item label="对账单号" prop="checkNo">
  34. <el-input style="width: 100%;" v-model="form.billNo"
  35. size="small" autocomplete="off"
  36. :disabled="true"
  37. clearable placeholder="请输入对账单号" >
  38. </el-input>
  39. </el-form-item>
  40. </el-col>
  41. <el-col :span="5">
  42. <el-form-item label="对账日期" prop="billDate">
  43. <el-date-picker v-model="form.billDate" clearable
  44. style="width: 100%;"
  45. type="date" size="small"
  46. :disabled="editSave"
  47. value-format="yyyy-MM-dd HH:mm"
  48. placeholder="选择对账日期">
  49. </el-date-picker>
  50. </el-form-item>
  51. </el-col>
  52. <el-col :span="5">
  53. <el-form-item label="限定金额" prop="billDate">
  54. <el-input style="width: 100%;" v-model="form.limitedAmount"
  55. size="small" autocomplete="off"
  56. :disabled="editSave"
  57. clearable placeholder="请输入对账单号" >
  58. </el-input>
  59. </el-form-item>
  60. </el-col>
  61. <el-col :span="5">
  62. <el-form-item label="备注" prop="remarks" >
  63. <el-input style="width: 100%;" v-model="form.remarks"
  64. size="small" autocomplete="off"
  65. :disabled="editSave"
  66. clearable placeholder="请输入备注" >
  67. </el-input>
  68. </el-form-item>
  69. </el-col>
  70. <el-col :span="4">
  71. <el-form-item label="审核" prop="isApproved" label-width="50px">
  72. <search-query :datalist="allyesnoData"
  73. :selectValue="form.isApproved"
  74. :clearable="true"
  75. :disabled="editSave"
  76. :buttonIf="false"
  77. :forParameter="{ key:'dictKey', label:'dictValue', value:'dictKey'}"
  78. @corpChange="corpChange($event,'isApproved')"
  79. @corpFocus="allyesnoWorkDictsfun" >
  80. </search-query>
  81. </el-form-item>
  82. </el-col>
  83. <el-col :span="10">
  84. <el-form-item label="对账单位" prop="corpCnName">
  85. <el-col :span="10">
  86. <search-query :datalist="corpData"
  87. :selectValue="form.corpCnName"
  88. :clearable="true"
  89. :disabled="editSave"
  90. :filterable="true"
  91. :remote="true"
  92. :buttonIf="false"
  93. :forParameter="{ key:'id', label:'cnName', value:'cnName'}"
  94. @corpChange="corpChange($event,'corpCnName')"
  95. @remoteMethod="corpBcorpsListfun"
  96. @corpFocus="corpBcorpsListfun" >
  97. </search-query>
  98. </el-col>
  99. <el-col :span="10">
  100. <span style="padding-left: 20px"></span>
  101. <el-input style="width: 100%;" v-model="form.corpEnName"
  102. size="small" autocomplete="off"
  103. :disabled="editSave"
  104. clearable placeholder="请输入" >
  105. </el-input>
  106. </el-col>
  107. <el-col :span="4">
  108. <el-checkbox style="width: 100%;text-align: right" size="medium"
  109. :true-label="1" :false-label="0"
  110. :disabled="editSave"
  111. v-model="form.corpIsSigned">已签约
  112. </el-checkbox>
  113. </el-col>
  114. </el-form-item>
  115. </el-col>
  116. <el-col :span="5">
  117. <el-form-item label="协议签订人" prop="corpAccRemarks">
  118. <el-input style="width: 100%;" v-model="form.corpAccRemarks"
  119. size="small" autocomplete="off"
  120. :disabled="editSave"
  121. clearable placeholder="请输入协议签订人" >
  122. </el-input>
  123. </el-form-item>
  124. </el-col>
  125. <el-col :span="5">
  126. <el-form-item label="业务类型" prop="businessTypes" >
  127. <search-query :datalist="businessTypesData"
  128. :selectValue="form.businessTypes"
  129. :clearable="true"
  130. :disabled="editSave"
  131. :buttonIf="false"
  132. :multiple="true"
  133. @corpChange="corpChange($event,'businessTypes')">
  134. </search-query>
  135. </el-form-item>
  136. </el-col>
  137. <el-col :span="4">
  138. <el-form-item label="签收" prop="isSignfor" label-width="50px">
  139. <search-query :datalist="allyesnoData"
  140. :selectValue="form.isSignfor"
  141. :clearable="true"
  142. :disabled="editSave"
  143. :buttonIf="false"
  144. :forParameter="{ key:'dictKey', label:'dictValue', value:'dictKey'}"
  145. @corpChange="corpChange($event,'isSignfor')"
  146. @corpFocus="allyesnoWorkDictsfun" >
  147. </search-query>
  148. </el-form-item>
  149. </el-col>
  150. </el-row>
  151. <expand :showBtn="true" :showSpan="true">
  152. <el-row>
  153. <el-col :span="5">
  154. <el-form-item label="收 / 付" prop="dc">
  155. <search-query :datalist="dcData"
  156. :selectValue="form.dc"
  157. :clearable="true"
  158. :disabled="editSave"
  159. :buttonIf="false"
  160. @corpChange="corpChange($event,'dc')">
  161. </search-query>
  162. </el-form-item>
  163. </el-col>
  164. <el-col :span="5">
  165. <el-form-item label="币别" prop="curCode">
  166. <search-query :datalist="curCodeData"
  167. :selectValue="form.curCode"
  168. :clearable="true"
  169. :disabled="editSave"
  170. :buttonIf="false"
  171. :filterable="true"
  172. :remote="true"
  173. :forParameter="{ key:'id', label:'code', value:'code'}"
  174. @corpChange="corpChange($event,'curCode')"
  175. @remoteMethod="getRateListfun"
  176. @corpFocus="getRateListfun" >
  177. </search-query>
  178. </el-form-item>
  179. </el-col>
  180. <el-col :span="10">
  181. <el-form-item label="业务来源" prop="srcType">
  182. <el-col :span="10">
  183. <search-query :datalist="srcTypeData"
  184. :selectValue="form.srcType"
  185. :clearable="true"
  186. :disabled="editSave"
  187. :buttonIf="false"
  188. @corpChange="corpChange($event,'srcType')">
  189. </search-query>
  190. </el-col>
  191. <el-col :span="13" :offset="1">
  192. <search-query :datalist="srcData"
  193. :selectValue="form.srcCnName"
  194. :clearable="true"
  195. :disabled="editSave"
  196. :buttonIf="false"
  197. :filterable="true"
  198. :remote="true"
  199. :forParameter="srcforParameter"
  200. @corpChange="corpChange($event,'srcCnName')"
  201. @remoteMethod="salesuserGetListfun">
  202. </search-query>
  203. </el-col>
  204. </el-form-item>
  205. </el-col>
  206. <el-col :span="4">
  207. <el-form-item label="销账" prop="isCleared" label-width="50px">
  208. <search-query :datalist="allyesnoData"
  209. :selectValue="form.isCleared"
  210. :clearable="true"
  211. :disabled="editSave"
  212. :buttonIf="false"
  213. :forParameter="{ key:'dictKey', label:'dictValue', value:'dictKey'}"
  214. @corpChange="corpChange($event,'isCleared')"
  215. @corpFocus="allyesnoWorkDictsfun" >
  216. </search-query>
  217. </el-form-item>
  218. </el-col>
  219. <el-col :span="5">
  220. <el-form-item label="JOB NO" prop="businessNo">
  221. <el-input style="width: 100%;" v-model="form.businessNo"
  222. size="small" autocomplete="off"
  223. :disabled="editSave"
  224. clearable placeholder="请输入JOB NO" >
  225. </el-input>
  226. </el-form-item>
  227. </el-col>
  228. <el-col :span="5">
  229. <el-form-item label="ACCT NO" prop="accountNo">
  230. <el-input style="width: 100%;" v-model="form.accountNo"
  231. size="small" autocomplete="off"
  232. :disabled="editSave"
  233. clearable placeholder="请输入ACCT NO" >
  234. </el-input>
  235. </el-form-item>
  236. </el-col>
  237. <el-col :span="5">
  238. <el-form-item label="MBL NO" prop="mblno">
  239. <el-input style="width: 100%;" v-model="form.mblno"
  240. size="small" autocomplete="off"
  241. :disabled="editSave"
  242. clearable placeholder="请输入MBL NO" >
  243. </el-input>
  244. </el-form-item>
  245. </el-col>
  246. <el-col :span="5">
  247. <el-form-item label="HBL NO" prop="hblno">
  248. <el-input style="width: 100%;" v-model="form.hblno"
  249. size="small" autocomplete="off"
  250. :disabled="editSave"
  251. clearable placeholder="请输入HBL NO" >
  252. </el-input>
  253. </el-form-item>
  254. </el-col>
  255. <el-col :span="4">
  256. <el-form-item label="对账" prop="isChecked" label-width="50px">
  257. <search-query :datalist="allyesnoData"
  258. :selectValue="form.isChecked"
  259. :clearable="true"
  260. :disabled="editSave"
  261. :buttonIf="false"
  262. :forParameter="{ key:'dictKey', label:'dictValue', value:'dictKey'}"
  263. @corpChange="corpChange($event,'isChecked')"
  264. @corpFocus="allyesnoWorkDictsfun" >
  265. </search-query>
  266. </el-form-item>
  267. </el-col>
  268. <el-col :span="5">
  269. <el-form-item label="财务日期" prop="etd">
  270. <el-date-picker
  271. v-model="form.accountDate"
  272. type="datetimerange"
  273. range-separator="至"
  274. start-placeholder="开始日期"
  275. end-placeholder="结束日期"
  276. style="width: 100%;"
  277. size="small"
  278. :disabled="editSave"
  279. format="yyyy-MM-dd"
  280. value-format="yyyy-MM-dd"
  281. placeholder="选择财务日期">
  282. </el-date-picker>
  283. </el-form-item>
  284. </el-col>
  285. <el-col :span="5">
  286. <el-form-item label="审核期间" prop="etd">
  287. <el-date-picker
  288. v-model="form.approvedDate"
  289. type="datetimerange"
  290. range-separator="至"
  291. start-placeholder="开始日期"
  292. end-placeholder="结束日期"
  293. style="width: 100%;"
  294. size="small"
  295. :disabled="editSave"
  296. format="yyyy-MM-dd"
  297. value-format="yyyy-MM-dd"
  298. placeholder="选择对账日期">
  299. </el-date-picker>
  300. </el-form-item>
  301. </el-col>
  302. <el-col :span="5">
  303. <el-form-item label="查询金额" prop="queryAmount">
  304. <el-input style="width: 100%;" v-model="form.queryAmount"
  305. size="small" autocomplete="off"
  306. :disabled="editSave"
  307. clearable placeholder="请输入查询金额" >
  308. </el-input>
  309. </el-form-item>
  310. </el-col>
  311. <el-col :span="5">
  312. <el-form-item label="账期备注" prop="corpAccRemarks">
  313. <el-input style="width: 100%;" v-model="form.corpAccRemarks"
  314. size="small" autocomplete="off"
  315. :disabled="editSave"
  316. clearable placeholder="请输入账期备注" >
  317. </el-input>
  318. </el-form-item>
  319. </el-col>
  320. <el-col :span="4">
  321. <el-form-item label="发票" prop="isChecked" label-width="50px">
  322. <search-query :datalist="isInvoiceData"
  323. :selectValue="form.isInvoice"
  324. :clearable="true"
  325. :disabled="editSave"
  326. :buttonIf="false"
  327. :forParameter="{ key:'dictKey', label:'dictValue', value:'dictKey'}"
  328. @corpChange="corpChange($event,'isInvoice')"
  329. @corpFocus="invoiceWorkDictsfun" >
  330. </search-query>
  331. </el-form-item>
  332. </el-col>
  333. <el-col :span="5">
  334. <el-form-item label="船 名" prop="vesselCnName" >
  335. <el-input style="width: 100%;" v-model="form.vesselCnName"
  336. size="small" autocomplete="off"
  337. :disabled="editSave"
  338. clearable placeholder="请选择船名" ></el-input>
  339. </el-form-item>
  340. </el-col>
  341. <el-col :span="5">
  342. <el-form-item label="航 次" prop="voyageNo" >
  343. <el-input style="width: 100%;" v-model="form.voyageNo"
  344. size="small" autocomplete="off"
  345. :disabled="editSave"
  346. clearable placeholder="请选择航次" ></el-input>
  347. </el-form-item>
  348. </el-col>
  349. <el-col :span="5">
  350. <el-form-item label="三检单号" prop="threeInspectionsNo" >
  351. <el-input style="width: 100%;" v-model="form.threeInspectionsNo"
  352. size="small" autocomplete="off"
  353. :disabled="editSave"
  354. clearable placeholder="请输入三检单号" ></el-input>
  355. </el-form-item>
  356. </el-col>
  357. <el-col :span="5">
  358. <el-form-item label="预收帐款" prop="receivableAdvance" >
  359. <el-input style="width: 100%;" v-model="form.receivableAdvance"
  360. size="small" autocomplete="off"
  361. :disabled="editSave"
  362. clearable placeholder="请输入预收帐款" ></el-input>
  363. </el-form-item>
  364. </el-col>
  365. <el-col :span="4">
  366. <el-form-item label="发票号" prop="invoiceNo" label-width="50px">
  367. <el-input style="width: 100%;" v-model="form.invoiceNo"
  368. size="small" autocomplete="off"
  369. :disabled="editSave"
  370. clearable placeholder="请输入发票号" ></el-input>
  371. </el-form-item>
  372. </el-col>
  373. <el-col :span="5">
  374. <el-form-item label="操作员" prop="updateUserName" >
  375. <search-query :datalist="updateUserData"
  376. :selectValue="form.updateUserName"
  377. :clearable="true"
  378. :disabled="editSave"
  379. :buttonIf="false"
  380. :filterable="true"
  381. :remote="true"
  382. :forParameter="{ key:'id', label:'name', value:'name'}"
  383. @corpChange="corpChange($event,'updateUserName')"
  384. @remoteMethod="updateUserUserGetListfun"
  385. @corpFocus="updateUserUserGetListfun" >
  386. </search-query>
  387. </el-form-item>
  388. </el-col>
  389. <el-col :span="5">
  390. <el-form-item label="BKNO" prop="bookingNo" >
  391. <el-input style="width: 100%;" v-model="form.bookingNo"
  392. size="small" autocomplete="off"
  393. :disabled="editSave"
  394. clearable placeholder="请输入BKNO" ></el-input>
  395. </el-form-item>
  396. </el-col>
  397. </el-row>
  398. </expand>
  399. <el-row>
  400. <el-col span="24">
  401. <div style="text-align: right">
  402. <el-button size="small" type="" style="margin-right: 8px"
  403. :loading="saveLoading" @click="ResetFilter">重置条件
  404. </el-button>
  405. <el-button size="small" type="primary" style="margin-right: 8px"
  406. :loading="saveLoading" @click="finstlbillslistAccBillV1fun" >检 索
  407. </el-button>
  408. </div>
  409. </el-col>
  410. </el-row>
  411. </el-row>
  412. </el-form>
  413. </el-card>
  414. <el-card style="margin-top: 10px">
  415. <el-row>
  416. <el-col :span="4">
  417. <div class="bottomFlex" style="justify-content: space-around">
  418. <!--<div style="text-align: center">-->
  419. <!-- <div class="weightfont">¥</div>-->
  420. <!-- <div>RMB</div>-->
  421. <!--</div>-->
  422. <div>
  423. <div style="color: #81B337">
  424. <span>应收RMB:</span>
  425. <span class="weightnum">${{form.amountDr || 0}}元</span>
  426. </div>
  427. <div style="color: #6BBCD1">
  428. <span>应付RMB:</span>
  429. <span class="weightnum">${{form.amountCr || 0}}元</span>
  430. </div>
  431. </div>
  432. </div>
  433. </el-col>
  434. <el-col :span="4">
  435. <div class="bottomFlex" style="justify-content: space-around">
  436. <!--<div style="text-align: center">-->
  437. <!-- <div class="weightfont">$</div>-->
  438. <!-- <div>USD</div>-->
  439. <!--</div>-->
  440. <div>
  441. <div style="color: #81B337">
  442. <span>应收USD:</span>
  443. <span class="weightnum">${{form.amountDrUsd || 0}}元</span>
  444. </div>
  445. <div style="color: #6BBCD1">
  446. <span>应付USD:</span>
  447. <span class="weightnum">${{form.amountCrUsd || 0}}元</span>
  448. </div>
  449. </div>
  450. </div>
  451. </el-col>
  452. <el-col :span="4">
  453. <div class="bottomFlex" style="justify-content: space-around">
  454. <!--<div style="text-align: center">-->
  455. <!-- <div class="weightfont">¥</div>-->
  456. <!-- <div>税后RMB</div>-->
  457. <!--</div>-->
  458. <div>
  459. <div style="color: #81B337">
  460. <span>税后应收RMB:</span>
  461. <span class="weightnum">¥{{form.amountDrNet || 0}}元</span>
  462. </div>
  463. <div style="color: #6BBCD1">
  464. <span>税后应付RMB:</span>
  465. <span class="weightnum">¥{{form.amountCrNet || 0}}元</span>
  466. </div>
  467. </div>
  468. </div>
  469. </el-col>
  470. <el-col :span="4">
  471. <div class="bottomFlex" style="justify-content: space-around">
  472. <!--<div style="text-align: center">-->
  473. <!-- <div class="weightfont">$</div>-->
  474. <!-- <div>税后USD</div>-->
  475. <!--</div>-->
  476. <div>
  477. <div style="color: #81B337">
  478. <span>税后应收USD:</span>
  479. <span class="weightnum">${{form.amountDrUsdNet || 0}}元</span>
  480. </div>
  481. <div style="color: #6BBCD1">
  482. <span>税后应付USD:</span>
  483. <span class="weightnum">${{form.amountCrUsdNet || 0}}元</span>
  484. </div>
  485. </div>
  486. </div>
  487. </el-col>
  488. <el-col :span="8">
  489. <div style="text-align: right">
  490. <el-button size="small" type="primary" style="margin-right: 8px"
  491. :loading="saveLoading" >计算合计值
  492. </el-button>
  493. <el-button size="small" type="primary" style="margin-right: 8px" :disabled="!form.id"
  494. :loading="saveLoading" @click="ConfirmReceiptfun">批量签收
  495. </el-button>
  496. <el-button size="small" type="danger" style="margin-right: 8px" :disabled="!form.id"
  497. :loading="saveLoading" @click="RevokeReceiptfun">撤销签收
  498. </el-button>
  499. </div>
  500. </el-col>
  501. </el-row>
  502. </el-card>
  503. <el-card style="margin-top: 10px">
  504. <div style="margin-bottom: 10px">
  505. <el-button size="small" type="primary" style="margin-right: 8px" :disabled="editSave"
  506. :loading="saveLoading" @click="Confirminvoicefun">确认发票
  507. </el-button>
  508. <!--<el-button size="small" type="primary" style="margin-right: 8px"-->
  509. <!-- :loading="saveLoading" @click="editHandle">批量确认发票-->
  510. <!--</el-button>-->
  511. <el-button size="small" type="primary" style="margin-right: 8px" :disabled="editSave"
  512. :loading="saveLoading" @click="Notinvoicingfun">不开发票
  513. </el-button>
  514. <!--<el-button size="small" type="primary" style="margin-right: 8px"-->
  515. <!-- :loading="saveLoading" @click="editHandle">批量不开发票-->
  516. <!--</el-button>-->
  517. <el-button size="small" type="info" style="margin-right: 8px" :disabled="editSave"
  518. :loading="saveLoading" @click="SelectedRows">确认选定行
  519. </el-button>
  520. <!--<el-button size="small" type="primary" style="margin-right: 8px"-->
  521. <!-- :loading="saveLoading" @click="editHandle">选择操作行-->
  522. <!--</el-button>-->
  523. </div>
  524. <finstlbillsitems :tableData="tableData"
  525. :form="form"
  526. :handleSelectionData="handleSelectionData"
  527. :editSave="editSave"
  528. @handleSelectionChange="handleSelectionChange">
  529. </finstlbillsitems>
  530. </el-card>
  531. </div>
  532. </div>
  533. </template>
  534. <script>
  535. import SearchQuery from "@/components/iosbasic-data/searchquery.vue";
  536. import {getWorkDicts} from "@/api/system/dictbiz";
  537. import {getRateList} from "@/api/iosBasicData/rateManagement";
  538. import {getList as userGetList} from '@/api/system/user'
  539. import {getBvesselsList} from "@/api/iosBasicData/bvessels";
  540. import {getBcorpslistByType} from "@/api/iosBasicData/bcorps";
  541. import {getDeptLazyTree} from "@/api/system/dept";
  542. import {
  543. finstlbillsConfirmReconciliation,
  544. finstlbillsConfirmSignFor,
  545. finstlbillsDetail,
  546. finstlbillslistAccBillV1, finstlbillsRevokeReconciliation, finstlbillsRevokeSignFor,
  547. finstlbillsSubmit
  548. } from '@/api/iosBasicData/finstlbills'
  549. import expand from "@/components/basic-container/expand.vue";
  550. import finstlbillsitems from "@/views/iosBasicData/finstlbills/assembly/finstlbillsitems.vue";
  551. export default {
  552. components: {SearchQuery,expand,finstlbillsitems},
  553. props:{
  554. // 编辑还是保存
  555. editSave:{
  556. type:Boolean,
  557. default:true
  558. }
  559. },
  560. data(){
  561. return {
  562. tableData:[],
  563. pageLoading:false, // 全屏加载动画
  564. saveLoading:false, // 按钮动画
  565. // 绑定的数据
  566. form:{
  567. },
  568. handleSelectionData:[], // 表格选择的数据
  569. corpData:[], // 对账单位 数据
  570. allyesnoData:[], // 全部是否字典数据
  571. isInvoiceData:[],// 发票字典
  572. // 收 / 付
  573. dcData:[
  574. {
  575. label:'Debit',
  576. value: 'D'
  577. },{
  578. label:'Credit',
  579. value: 'C'
  580. }
  581. ],
  582. curCodeData:[],// 币别
  583. updateUserData:[], // 操作员
  584. srcTypeData:[
  585. {
  586. label:'公司',
  587. value:'OWN'
  588. },
  589. {
  590. label:'代理',
  591. value:'AGENT'
  592. },
  593. {
  594. label:'业务员',
  595. value:'SALES'
  596. }
  597. ], // 业务来源
  598. srcData:[], // 业务来源数据
  599. srcforParameter:{},
  600. // 业务类型
  601. businessTypesData:[
  602. {
  603. label:'海运出口',
  604. value:'SE'
  605. },{
  606. label:'海运进口',
  607. value:'SI'
  608. }
  609. ],
  610. }
  611. },
  612. watch:{
  613. // // 监听业务类型 如果不是分单 可以编辑分单号
  614. // form:{
  615. // // 执行方法
  616. // handler(oldValue,newValue) {
  617. // // 只要分单不能编辑
  618. // console.log(this.form,619)
  619. // if (!newValue || JSON.stringify(newValue) == '{}') {
  620. // return
  621. // }
  622. // delete this.form.id
  623. // this.tableData = []
  624. // this.form.finStlBillsItemsList = []
  625. // console.log(newValue)
  626. //
  627. //
  628. // },
  629. // deep: true, // 深度监听
  630. // immediate: true // 第一次改变就执行
  631. // },
  632. },
  633. created() {
  634. this.allyesnoWorkDictsfun() // 获取 字典数据
  635. this.invoiceWorkDictsfun() // 获取 发票的数据
  636. },
  637. methods:{
  638. finstlbillsRevokeReconciliation,
  639. // 下拉回调
  640. corpChange(value,name){
  641. // 对账单位
  642. if (name == 'corpCnName') {
  643. if (!value) {
  644. this.$set(this.form,'corpId','')
  645. this.$set(this.form,'corpCnName','')
  646. this.$set(this.form,'corpEnName','')
  647. this.$set(this.form,'corpArgreementNo','')
  648. }
  649. for(let item of this.corpData) {
  650. if (item.cnName == value) {
  651. this.$set(this.form,'corpId',item.id)
  652. this.$set(this.form,'corpCnName',item.cnName)
  653. this.$set(this.form,'corpEnName',item.enName)
  654. this.$set(this.form,'corpArgreementNo',item.enName)
  655. }
  656. }
  657. }
  658. // 业务来源
  659. else if (name == 'srcType') {
  660. if (!value) {
  661. this.$set(this.form,'srcType','')
  662. return;
  663. }
  664. this.$set(this.form,name,value)
  665. if (value == 'OWN') {
  666. this.srcforParameter = { key:'id', label:'title', value:'title'}
  667. this.ownDeptLazyTreefun()
  668. }else if (value == 'AGENT') {
  669. this.srcforParameter = { key:'id', label:'cnName', value:'cnName'}
  670. this.srcBcorpsListfun()
  671. }else if (value == 'SALES') {
  672. this.srcforParameter = { key:'id', label:'name', value:'name'}
  673. this.salesuserGetListfun()
  674. }else {}
  675. }
  676. // 业务来源选择
  677. else if (name == 'srcCnName') {
  678. if (!value) {
  679. this.$set(this.form,'srcId','')
  680. this.$set(this.form,'srcCnName','')
  681. this.$set(this.form,'srcEnName','')
  682. return
  683. }
  684. for (let item of this.srcData) {
  685. if (item[this.srcforParameter.value] == value) {
  686. if (this.form.srcType == 'OWN') {
  687. // 公司
  688. this.$set(this.form,'srcId',item.id)
  689. this.$set(this.form,'srcCnName',item.title)
  690. this.$set(this.form,'srcEnName',item.title)
  691. }
  692. else if (this.form.srcType == 'SALES') {
  693. // 业务员
  694. this.$set(this.form,'srcId',item.id)
  695. this.$set(this.form,'srcCnName',item.name)
  696. this.$set(this.form,'srcEnName',item.name)
  697. }else if (this.form.srcType == 'AGENT') {
  698. // 代理
  699. this.$set(this.form,'srcId',item.id)
  700. this.$set(this.form,'srcCnName',item.cnName)
  701. this.$set(this.form,'srcEnName',item.enName)
  702. }else {}
  703. }
  704. }
  705. }
  706. // 操作员
  707. else if (name == 'updateUserName') {
  708. for (let item of this.updateUserData) {
  709. if (item.name == value) {
  710. this.$set(this.form,'updateUser',item.id)
  711. this.$set(this.form,'updateUserName',item.name)
  712. }
  713. }
  714. }
  715. else {
  716. this.$set(this.form,name,value)
  717. }
  718. },
  719. // 编辑
  720. editHandle(){
  721. this.editSave = false
  722. },
  723. // 保存
  724. editCustomer(){
  725. // 对账单位
  726. if (!this.form.corpId) {
  727. this.$message.warning('请选择对账单位');
  728. return
  729. }
  730. // 业务类型
  731. if (!this.form.businessTypes) {
  732. this.$message.warning('请选择业务类型');
  733. return
  734. }
  735. if (!this.form.id) {
  736. // 是否选择从表数据
  737. if (this.handleSelectionData.length == 0) {
  738. this.$message.warning('请选择对账数据');
  739. return;
  740. }
  741. }
  742. for (let item of this.handleSelectionData) {
  743. if (!item.currentStlCurCode) {
  744. this.$message.warning('请选择本次结算币种');
  745. return;
  746. }
  747. // if (!item.currentStlAmount) {
  748. // this.$message.warning('请选择本次结算金额');
  749. // return;
  750. // }
  751. }
  752. this.saveLoading = true // 加载动画
  753. this.pageLoading = true
  754. this.form.billNoFormat = 'HYDZ'
  755. this.form.businessTypeCode = 'HYDZ'
  756. this.form.businessType = 'CHK' // 对账单
  757. this.form.businessTypes = this.form.businessTypes.join(',') // 业务类型
  758. if (!this.form.id) {
  759. this.form.finStlBillsItemsList = this.handleSelectionData.map((item,index)=>{
  760. item.lineNo = Number(index) + 1
  761. item.pType = item.businessType
  762. item.accBillId = item.id
  763. item.accBillNo = item.billNo
  764. item.accDate = item.billDate
  765. item.dc = item.accountDc // 收付
  766. if (item.currentStlCurCode == 'CNY') {
  767. item.currentStlAmount = item.currentStlAmountRMB
  768. }else {
  769. item.currentStlAmount = item.currentStlAmountUSD
  770. }
  771. delete item.businessType
  772. if (!this.form.id) {
  773. delete item.id
  774. }
  775. delete item.billNo
  776. delete item.billDate
  777. delete item.accountDc
  778. return item
  779. })
  780. }
  781. finstlbillsSubmit(this.form).then(res=>{
  782. this.saveLoading = false
  783. this.pageLoading = false
  784. this.$message.success('操作成功');
  785. this.finstlbillsDetailfun(res.data.data.id)
  786. }).catch(err=>{
  787. this.pageLoading = false
  788. })
  789. },
  790. // 详情接口
  791. finstlbillsDetailfun(id){
  792. this.pageLoading = true
  793. finstlbillsDetail(id).then(res=>{
  794. this.form = res.data.data
  795. this.form.businessTypes = this.form.businessTypes.split(',') // 业务类型转换成数组显示
  796. this.tableData = this.form.finStlBillsItemsList.map(item=>{
  797. if(item.curCode == 'CNY') {
  798. this.$set(item,'amountRMB',item.amount)
  799. this.$set(item,'currentInvoiceAmountRMB',item.currentInvoiceAmount)
  800. this.$set(item,'unsettledAmountRMB',item.unsettledAmount)
  801. this.$set(item,'stlTtlAmountRMB',item.stlTtlAmount)
  802. this.$set(item,'currentStlAmountRMB',item.currentStlAmount)
  803. }else {
  804. this.$set(item,'amountUSD',item.amount)
  805. this.$set(item,'currentInvoiceAmountUSD',item.currentInvoiceAmount)
  806. this.$set(item,'unsettledAmountUSD',item.unsettledAmount)
  807. this.$set(item,'stlTtlAmountUSD',item.stlTtlAmount)
  808. this.$set(item,'currentStlAmountUSD',item.currentStlAmount)
  809. }
  810. this.$set(item,'costDate',[])
  811. return item
  812. })
  813. this.form.isSignfor = this.form.isSignfor + ''
  814. this.form.isApproved = this.form.isApproved + ''
  815. this.form.isCleared = this.form.isCleared + ''
  816. this.form.isChecked = this.form.isChecked + ''
  817. this.form.isInvoice = this.form.isInvoice + ''
  818. this.pageLoading = false
  819. })
  820. },
  821. // 重置条件
  822. ResetFilter(){
  823. this.form = {}
  824. },
  825. // 检索接口
  826. finstlbillslistAccBillV1fun(){
  827. // 对账单位
  828. if (!this.form.corpId) {
  829. this.$message.warning('请选择对账单位');
  830. return
  831. }
  832. // 业务类型
  833. if (!this.form.businessTypes) {
  834. this.$message.warning('请选择业务类型');
  835. return
  836. }
  837. delete this.form.id
  838. // let obj = JSON.parse(JSON.stringify(this.form))
  839. let obj = {}
  840. obj.type = '1'
  841. obj.auditStatus = this.form.isApproved // 审核状态 0 新建费用 1 已请核 2 审核中 3 驳回 4 通过
  842. obj.corpCnName = this.form.corpId // 对账单位
  843. obj.isSignfor = this.form.isSignfor // 是否已签收(0 否 1是)
  844. obj.dc = this.form.dc // 收付 D=收 C=付
  845. obj.curCode = this.form.curCode // 币别
  846. obj.srcType = this.form.srcType // 业务来源
  847. obj.srcCnName = this.form.srcId // 业务员id
  848. obj.isCleared = this.form.isCleared // 是否销账(0 未销账 3 部分销账 9 销账)
  849. obj.accBillNo = this.form.accountNo // 账单编号 ACCT NO
  850. obj.billNo = this.form.businessNo // 单据编号 JOB NO
  851. obj.mblno = this.form.mblno // MB/L NO
  852. obj.hblno = this.form.hblno // HB/L NO
  853. obj.isChecked = this.form.isChecked // 是否对账(0 未对账 1 已对账)
  854. obj.queryAmount = this.form.queryAmount // 查询金额
  855. obj.businessType = this.form.businessTypes.join(',') // 业务类型
  856. obj.invoiceStatus = this.form.isInvoice // 发票状态 0 = 未开 9=已开 2 待开 3 不开
  857. obj.vesselCnName = this.form.vesselCnName // 中文船名
  858. obj.invoiceNo = this.form.invoiceNo // 发票号
  859. obj.bookingNo = this.form.bookingNo // 订舱号 BKNO
  860. obj.createUserName = this.form.updateUser // 操作员id
  861. obj.receivableAdvance = this.form.receivableAdvance // 预收帐款
  862. obj.threeInspectionsNo = this.form.threeInspectionsNo // 三检单号
  863. obj.voyageNo = this.form.voyageNo // 航次
  864. // 审核期间
  865. if (this.form.approvedDate) {
  866. obj.approveTimeList = this.form.approvedDate
  867. }
  868. // 财务期间
  869. if (this.form.accountDate) {
  870. obj.billDateList = this.form.accountDate
  871. }
  872. finstlbillslistAccBillV1(obj).then(res=>{
  873. this.tableData = res.data.data.map(item=>{
  874. this.$set(item,'currentStlCurCode',item.curCode)
  875. if(item.curCode == 'CNY') {
  876. this.$set(item,'amountRMB',item.amount)
  877. this.$set(item,'currentInvoiceAmountRMB',item.currentInvoiceAmount)
  878. this.$set(item,'unsettledAmountRMB',item.unsettledAmount)
  879. this.$set(item,'stlTtlAmountRMB',item.stlTtlAmount)
  880. this.$set(item,'currentStlAmountRMB',Number(item.amount) - Number(item.stlTtlAmount))
  881. }else {
  882. this.$set(item,'amountUSD',item.amount)
  883. this.$set(item,'currentInvoiceAmountUSD',item.currentInvoiceAmount)
  884. this.$set(item,'unsettledAmountUSD',item.unsettledAmount)
  885. this.$set(item,'stlTtlAmountUSD',item.stlTtlAmount)
  886. this.$set(item,'currentStlAmountUSD',(Number(item.amount) - Number(item.stlTtlAmount)).toFixed(2))
  887. }
  888. return item
  889. })
  890. })
  891. },
  892. // 确认发票
  893. Confirminvoicefun(){
  894. },
  895. // 不开发票
  896. Notinvoicingfun(){
  897. },
  898. // 对账确认
  899. finstlbillsConfirmReconciliationfun(){
  900. this.$confirm("确定进行对账操作?", {
  901. confirmButtonText: "确定",
  902. cancelButtonText: "取消",
  903. type: "warning"
  904. }).then(()=>{
  905. this.pageLoading = true
  906. this.form.businessTypes = this.form.businessTypes.join(',') // 业务类型
  907. finstlbillsConfirmReconciliation(this.form).then(res=>{
  908. this.pageLoading = false
  909. this.$message.success('操作成功');
  910. this.finstlbillsDetailfun(res.data.data.id)
  911. }).catch(err=>{
  912. this.pageLoading = false
  913. })
  914. })
  915. },
  916. // 对账撤销
  917. finstlbillsRevokeReconciliationfun(){
  918. this.$confirm("确定进行撤销对账操作?", {
  919. confirmButtonText: "确定",
  920. cancelButtonText: "取消",
  921. type: "warning"
  922. }).then(()=>{
  923. this.pageLoading = true
  924. this.form.businessTypes = this.form.businessTypes.join(',') // 业务类型
  925. finstlbillsRevokeReconciliation(this.form).then(res=>{
  926. this.pageLoading = false
  927. this.$message.success('操作成功');
  928. this.finstlbillsDetailfun(res.data.data.id)
  929. }).catch(err=>{
  930. this.pageLoading = false
  931. })
  932. })
  933. },
  934. // 确认签收
  935. ConfirmReceiptfun(){
  936. if (this.handleSelectionData.length === 0) {
  937. this.$message.warning("请选择至少一条数据");
  938. return;
  939. }
  940. for (let item of this.handleSelectionData) {
  941. if (item.isSignfor == 1) {
  942. this.$message.warning('请选择未签收的数据进行签收');
  943. return;
  944. }
  945. }
  946. this.$confirm("确定将选择数据签收?", {
  947. confirmButtonText: "确定",
  948. cancelButtonText: "取消",
  949. type: "warning"
  950. }).then(()=>{
  951. this.finstlbillsConfirmSignForfun()
  952. })
  953. },
  954. // 撤销签收
  955. RevokeReceiptfun(){
  956. if (this.handleSelectionData.length === 0) {
  957. this.$message.warning("请选择至少一条数据");
  958. return;
  959. }
  960. for (let item of this.handleSelectionData) {
  961. if (item.isSignfor == 0) {
  962. this.$message.warning('请选择已签收的数据进行撤销');
  963. return;
  964. }
  965. }
  966. this.$confirm("确定将选择数据撤销签收?", {
  967. confirmButtonText: "确定",
  968. cancelButtonText: "取消",
  969. type: "warning"
  970. }).then(()=>{
  971. this.finstlbillsRevokeSignForfun()
  972. })
  973. },
  974. // 确认选定行
  975. SelectedRows(){
  976. this.editCustomer()
  977. },
  978. // 下面表格多选
  979. handleSelectionChange(arr){
  980. this.handleSelectionData = arr
  981. },
  982. //返回列表
  983. backToList() {
  984. this.$emit('goBack')
  985. },
  986. // 请求的接口
  987. // 确认签收接口
  988. finstlbillsConfirmSignForfun(){
  989. this.form.billNoFormat = 'HYDZ'
  990. this.form.businessTypeCode = 'HYDZ'
  991. this.form.businessType = 'CHK' //对账单
  992. this.form.businessTypes = this.form.businessTypes.join(',') // 业务类型
  993. // 保留id
  994. this.form.finStlBillsItemsList = this.handleSelectionData
  995. this.pageLoading = true
  996. finstlbillsConfirmSignFor(this.form).then(res=>{
  997. this.pageLoading = false
  998. this.$message.success('操作成功');
  999. this.finstlbillsDetailfun(res.data.data.id)
  1000. }).catch(err=>{
  1001. this.pageLoading = false
  1002. })
  1003. },
  1004. // 撤销签收接口
  1005. finstlbillsRevokeSignForfun(){
  1006. this.form.billNoFormat = 'HYDZ'
  1007. this.form.businessTypeCode = 'HYDZ'
  1008. this.form.businessType = 'CHK' // 对账单
  1009. this.form.businessTypes = this.form.businessTypes.join(',') // 业务类型
  1010. this.form.finStlBillsItemsList = this.handleSelectionData
  1011. this.pageLoading = true
  1012. finstlbillsRevokeSignFor(this.form).then(res=>{
  1013. this.pageLoading = false
  1014. this.$message.success('操作成功');
  1015. this.finstlbillsDetailfun(res.data.data.id)
  1016. }).catch(err=>{
  1017. this.pageLoading = false
  1018. })
  1019. },
  1020. // 获取 全部是否 接口
  1021. allyesnoWorkDictsfun(){
  1022. getWorkDicts('all_yes_no').then(res=>{
  1023. this.allyesnoData = res.data.data;
  1024. })
  1025. },
  1026. // 销账字段数据
  1027. // 获取发票的字典数据
  1028. invoiceWorkDictsfun(){
  1029. getWorkDicts('invoice_los').then(res=>{
  1030. this.isInvoiceData = res.data.data;
  1031. })
  1032. },
  1033. // 获取币别数据
  1034. getRateListfun(cnName){
  1035. getRateList({current:1,size:10,cnName}).then(res=>{
  1036. this.curCodeData = res.data.data.records
  1037. })
  1038. },
  1039. // 获取操作员数据
  1040. updateUserUserGetListfun(account){
  1041. userGetList(1,10,{account}).then(res=>{
  1042. this.updateUserData = res.data.data.records
  1043. })
  1044. },
  1045. // 获取公司名称 用户管理左侧
  1046. ownDeptLazyTreefun(){
  1047. getDeptLazyTree(0).then(res=>{
  1048. this.srcData = res.data.data
  1049. })
  1050. },
  1051. // 获取业务来源代理数据
  1052. srcBcorpsListfun(cnName){
  1053. let corpType = '1712285382575398914,1712285645314990082,1712285842321448962,1712286433378574338'
  1054. getBcorpslistByType(1,10,{cnName,corpType}).then(res=>{
  1055. this.srcData = res.data.data.records
  1056. })
  1057. },
  1058. // 获取业务员数据
  1059. salesuserGetListfun(account = undefined,type = false,){
  1060. userGetList(1,10,{account}).then(res=>{
  1061. this.srcData = res.data.data.records
  1062. })
  1063. },
  1064. // 获取对账单位数据
  1065. corpBcorpsListfun(cnName){
  1066. getBcorpslistByType(1,10,{cnName}).then(res=>{
  1067. this.corpData = res.data.data.records
  1068. })
  1069. },
  1070. }
  1071. }
  1072. </script>
  1073. <style scoped>
  1074. ::v-deep.el-form-item {
  1075. margin-bottom: 0;
  1076. }
  1077. .bottomFlex {
  1078. display: flex;
  1079. align-items: center;
  1080. }
  1081. .weightfont {
  1082. font-size: 20px;
  1083. font-weight: bold;
  1084. }
  1085. .weightnum {
  1086. font-size: 15px;
  1087. font-weight: 500;
  1088. }
  1089. </style>