finstlbillsDetails.vue 60 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121
  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. :handleSelectionData="handleSelectionData"
  526. @handleSelectionChange="handleSelectionChange">
  527. </finstlbillsitems>
  528. </el-card>
  529. </div>
  530. </div>
  531. </template>
  532. <script>
  533. import SearchQuery from "@/components/iosbasic-data/searchquery.vue";
  534. import {getWorkDicts} from "@/api/system/dictbiz";
  535. import {getRateList} from "@/api/iosBasicData/rateManagement";
  536. import {getList as userGetList} from '@/api/system/user'
  537. import {getBvesselsList} from "@/api/iosBasicData/bvessels";
  538. import {getBcorpslistByType} from "@/api/iosBasicData/bcorps";
  539. import {getDeptLazyTree} from "@/api/system/dept";
  540. import {
  541. finstlbillsConfirmReconciliation,
  542. finstlbillsConfirmSignFor,
  543. finstlbillsDetail,
  544. finstlbillslistAccBillV1, finstlbillsRevokeReconciliation, finstlbillsRevokeSignFor,
  545. finstlbillsSubmit
  546. } from '@/api/iosBasicData/finstlbills'
  547. import expand from "@/components/basic-container/expand.vue";
  548. import finstlbillsitems from "@/views/iosBasicData/finstlbills/assembly/finstlbillsitems.vue";
  549. export default {
  550. components: {SearchQuery,expand,finstlbillsitems},
  551. props:{
  552. // 编辑还是保存
  553. editSave:{
  554. type:Boolean,
  555. default:true
  556. }
  557. },
  558. data(){
  559. return {
  560. tableData:[],
  561. pageLoading:false, // 全屏加载动画
  562. saveLoading:false, // 按钮动画
  563. // 绑定的数据
  564. form:{
  565. },
  566. handleSelectionData:[], // 表格选择的数据
  567. corpData:[], // 对账单位 数据
  568. allyesnoData:[], // 全部是否字典数据
  569. isInvoiceData:[],// 发票字典
  570. // 收 / 付
  571. dcData:[
  572. {
  573. label:'Debit',
  574. value: 'D'
  575. },{
  576. label:'Credit',
  577. value: 'C'
  578. }
  579. ],
  580. curCodeData:[],// 币别
  581. updateUserData:[], // 操作员
  582. srcTypeData:[
  583. {
  584. label:'公司',
  585. value:'OWN'
  586. },
  587. {
  588. label:'代理',
  589. value:'AGENT'
  590. },
  591. {
  592. label:'业务员',
  593. value:'SALES'
  594. }
  595. ], // 业务来源
  596. srcData:[], // 业务来源数据
  597. srcforParameter:{},
  598. // 业务类型
  599. businessTypesData:[
  600. {
  601. label:'海运出口',
  602. value:'SE'
  603. },{
  604. label:'海运进口',
  605. value:'SI'
  606. }
  607. ],
  608. }
  609. },
  610. watch:{
  611. // // 监听业务类型 如果不是分单 可以编辑分单号
  612. // form:{
  613. // // 执行方法
  614. // handler(oldValue,newValue) {
  615. // // 只要分单不能编辑
  616. // console.log(this.form,619)
  617. // if (!newValue || JSON.stringify(newValue) == '{}') {
  618. // return
  619. // }
  620. // delete this.form.id
  621. // this.tableData = []
  622. // this.form.finStlBillsItemsList = []
  623. // console.log(newValue)
  624. //
  625. //
  626. // },
  627. // deep: true, // 深度监听
  628. // immediate: true // 第一次改变就执行
  629. // },
  630. },
  631. created() {
  632. this.allyesnoWorkDictsfun() // 获取 字典数据
  633. this.invoiceWorkDictsfun() // 获取 发票的数据
  634. },
  635. methods:{
  636. finstlbillsRevokeReconciliation,
  637. // 下拉回调
  638. corpChange(value,name){
  639. // 对账单位
  640. if (name == 'corpCnName') {
  641. if (!value) {
  642. this.$set(this.form,'corpId','')
  643. this.$set(this.form,'corpCnName','')
  644. this.$set(this.form,'corpEnName','')
  645. this.$set(this.form,'corpArgreementNo','')
  646. }
  647. for(let item of this.corpData) {
  648. if (item.cnName == value) {
  649. this.$set(this.form,'corpId',item.id)
  650. this.$set(this.form,'corpCnName',item.cnName)
  651. this.$set(this.form,'corpEnName',item.enName)
  652. this.$set(this.form,'corpArgreementNo',item.enName)
  653. }
  654. }
  655. }
  656. // 业务来源
  657. else if (name == 'srcType') {
  658. if (!value) {
  659. this.$set(this.form,'srcType','')
  660. return;
  661. }
  662. this.$set(this.form,name,value)
  663. if (value == 'OWN') {
  664. this.srcforParameter = { key:'id', label:'title', value:'title'}
  665. this.ownDeptLazyTreefun()
  666. }else if (value == 'AGENT') {
  667. this.srcforParameter = { key:'id', label:'cnName', value:'cnName'}
  668. this.srcBcorpsListfun()
  669. }else if (value == 'SALES') {
  670. this.srcforParameter = { key:'id', label:'name', value:'name'}
  671. this.salesuserGetListfun()
  672. }else {}
  673. }
  674. // 业务来源选择
  675. else if (name == 'srcCnName') {
  676. if (!value) {
  677. this.$set(this.form,'srcId','')
  678. this.$set(this.form,'srcCnName','')
  679. this.$set(this.form,'srcEnName','')
  680. return
  681. }
  682. for (let item of this.srcData) {
  683. if (item[this.srcforParameter.value] == value) {
  684. if (this.form.srcType == 'OWN') {
  685. // 公司
  686. this.$set(this.form,'srcId',item.id)
  687. this.$set(this.form,'srcCnName',item.title)
  688. this.$set(this.form,'srcEnName',item.title)
  689. }
  690. else if (this.form.srcType == 'SALES') {
  691. // 业务员
  692. this.$set(this.form,'srcId',item.id)
  693. this.$set(this.form,'srcCnName',item.name)
  694. this.$set(this.form,'srcEnName',item.name)
  695. }else if (this.form.srcType == 'AGENT') {
  696. // 代理
  697. this.$set(this.form,'srcId',item.id)
  698. this.$set(this.form,'srcCnName',item.cnName)
  699. this.$set(this.form,'srcEnName',item.enName)
  700. }else {}
  701. }
  702. }
  703. }
  704. // 操作员
  705. else if (name == 'updateUserName') {
  706. for (let item of this.updateUserData) {
  707. if (item.name == value) {
  708. this.$set(this.form,'updateUser',item.id)
  709. this.$set(this.form,'updateUserName',item.name)
  710. }
  711. }
  712. }
  713. else {
  714. this.$set(this.form,name,value)
  715. }
  716. },
  717. // 编辑
  718. editHandle(){
  719. this.editSave = false
  720. },
  721. // 保存
  722. editCustomer(){
  723. // 对账单位
  724. if (!this.form.corpId) {
  725. this.$message.warning('请选择对账单位');
  726. return
  727. }
  728. // 业务类型
  729. if (!this.form.businessTypes) {
  730. this.$message.warning('请选择业务类型');
  731. return
  732. }
  733. if (!this.form.id) {
  734. // 是否选择从表数据
  735. if (this.handleSelectionData.length == 0) {
  736. this.$message.warning('请选择对账数据');
  737. return;
  738. }
  739. }
  740. for (let item of this.handleSelectionData) {
  741. if (!item.currentStlCurCode) {
  742. this.$message.warning('请选择本次结算币种');
  743. return;
  744. }
  745. // if (!item.currentStlAmount) {
  746. // this.$message.warning('请选择本次结算金额');
  747. // return;
  748. // }
  749. }
  750. this.saveLoading = true // 加载动画
  751. this.pageLoading = true
  752. this.form.billNoFormat = 'HYDZ'
  753. this.form.businessTypeCode = 'HYDZ'
  754. this.form.businessType = 'CHK' // 对账单
  755. this.form.businessTypes = this.form.businessTypes.join(',') // 业务类型
  756. this.form.finStlBillsItemsList = this.handleSelectionData.map((item,index)=>{
  757. item.lineNo = index
  758. item.pType = item.businessType
  759. item.accBillId = item.id
  760. item.accBillNo = item.billNo
  761. item.accDate = item.billDate
  762. item.dc = item.accountDc // 收付
  763. if (item.currentStlCurCode == 'CNY') {
  764. item.currentStlAmount = item.currentStlAmountRMB
  765. }else {
  766. item.currentStlAmount = item.currentStlAmountUSD
  767. }
  768. delete item.businessType
  769. if (!this.form.id) {
  770. delete item.id
  771. }
  772. delete item.billNo
  773. delete item.billDate
  774. delete item.accountDc
  775. return item
  776. })
  777. finstlbillsSubmit(this.form).then(res=>{
  778. this.saveLoading = false
  779. this.pageLoading = false
  780. this.$message.success('操作成功');
  781. this.finstlbillsDetailfun(res.data.data.id)
  782. }).catch(err=>{
  783. this.pageLoading = false
  784. })
  785. },
  786. // 详情接口
  787. finstlbillsDetailfun(id){
  788. this.pageLoading = true
  789. finstlbillsDetail(id).then(res=>{
  790. this.form = res.data.data
  791. this.form.businessTypes = this.form.businessTypes.split(',') // 业务类型转换成数组显示
  792. this.tableData = this.form.finStlBillsItemsList.map(item=>{
  793. if(item.curCode == 'CNY') {
  794. this.$set(item,'amountRMB',item.amount)
  795. this.$set(item,'currentInvoiceAmountRMB',item.currentInvoiceAmount)
  796. this.$set(item,'unsettledAmountRMB',item.unsettledAmount)
  797. this.$set(item,'stlTtlAmountRMB',item.stlTtlAmount)
  798. this.$set(item,'currentStlAmountRMB',item.currentStlAmount)
  799. }else {
  800. this.$set(item,'amountUSD',item.amount)
  801. this.$set(item,'currentInvoiceAmountUSD',item.currentInvoiceAmount)
  802. this.$set(item,'unsettledAmountUSD',item.unsettledAmount)
  803. this.$set(item,'stlTtlAmountUSD',item.stlTtlAmount)
  804. this.$set(item,'currentStlAmountUSD',item.currentStlAmount)
  805. }
  806. return item
  807. })
  808. this.form.isSignfor = this.form.isSignfor + ''
  809. this.form.isApproved = this.form.isApproved + ''
  810. this.form.isCleared = this.form.isCleared + ''
  811. this.form.isChecked = this.form.isChecked + ''
  812. this.form.isInvoice = this.form.isInvoice + ''
  813. this.pageLoading = false
  814. })
  815. },
  816. // 重置条件
  817. ResetFilter(){
  818. this.form = {}
  819. },
  820. // 检索接口
  821. finstlbillslistAccBillV1fun(){
  822. // 对账单位
  823. if (!this.form.corpId) {
  824. this.$message.warning('请选择对账单位');
  825. return
  826. }
  827. // 业务类型
  828. if (!this.form.businessTypes) {
  829. this.$message.warning('请选择业务类型');
  830. return
  831. }
  832. delete this.form.id
  833. // let obj = JSON.parse(JSON.stringify(this.form))
  834. let obj = {}
  835. obj.type = '1'
  836. obj.auditStatus = this.form.isApproved // 审核状态 0 新建费用 1 已请核 2 审核中 3 驳回 4 通过
  837. obj.corpCnName = this.form.corpId // 对账单位
  838. obj.isSignfor = this.form.isSignfor // 是否已签收(0 否 1是)
  839. obj.dc = this.form.dc // 收付 D=收 C=付
  840. obj.curCode = this.form.curCode // 币别
  841. obj.srcType = this.form.srcType // 业务来源
  842. obj.srcCnName = this.form.srcId // 业务员id
  843. obj.isCleared = this.form.isCleared // 是否销账(0 未销账 3 部分销账 9 销账)
  844. obj.accBillNo = this.form.accountNo // 账单编号 ACCT NO
  845. obj.billNo = this.form.businessNo // 单据编号 JOB NO
  846. obj.mblno = this.form.mblno // MB/L NO
  847. obj.hblno = this.form.hblno // HB/L NO
  848. obj.isChecked = this.form.isChecked // 是否对账(0 未对账 1 已对账)
  849. obj.queryAmount = this.form.queryAmount // 查询金额
  850. obj.businessType = this.form.businessTypes.join(',') // 业务类型
  851. obj.invoiceStatus = this.form.isInvoice // 发票状态 0 = 未开 9=已开 2 待开 3 不开
  852. obj.vesselCnName = this.form.vesselCnName // 中文船名
  853. obj.invoiceNo = this.form.invoiceNo // 发票号
  854. obj.bookingNo = this.form.bookingNo // 订舱号 BKNO
  855. obj.createUserName = this.form.updateUser // 操作员id
  856. obj.receivableAdvance = this.form.receivableAdvance // 预收帐款
  857. obj.threeInspectionsNo = this.form.threeInspectionsNo // 三检单号
  858. obj.voyageNo = this.form.voyageNo // 航次
  859. // 审核期间
  860. if (this.form.approvedDate) {
  861. obj.approveTimeList = this.form.approvedDate
  862. }
  863. // 财务期间
  864. if (this.form.accountDate) {
  865. obj.billDateList = this.form.accountDate
  866. }
  867. finstlbillslistAccBillV1(obj).then(res=>{
  868. this.tableData = res.data.data.map(item=>{
  869. if(item.curCode == 'CNY') {
  870. this.$set(item,'amountRMB',item.amount)
  871. this.$set(item,'currentInvoiceAmountRMB',item.currentInvoiceAmount)
  872. this.$set(item,'unsettledAmountRMB',item.unsettledAmount)
  873. this.$set(item,'stlTtlAmountRMB',item.stlTtlAmount)
  874. this.$set(item,'currentStlAmountRMB',Number(item.amount) - Number(item.stlTtlAmount))
  875. }else {
  876. this.$set(item,'amountUSD',item.amount)
  877. this.$set(item,'currentInvoiceAmountUSD',item.currentInvoiceAmount)
  878. this.$set(item,'unsettledAmountUSD',item.unsettledAmount)
  879. this.$set(item,'stlTtlAmountUSD',item.stlTtlAmount)
  880. this.$set(item,'currentStlAmountUSD',(Number(item.amount) - Number(item.stlTtlAmount)).toFixed(2))
  881. // this.$set(item,'amountUSD',(Number(item.amount) / Number(item.exrate)).toFixed(2))
  882. // this.$set(item,'currentInvoiceAmountUSD',(Number(item.currentInvoiceAmount) / Number(item.exrate)).toFixed(2))
  883. // this.$set(item,'unsettledAmountUSD',(Number(item.unsettledAmount) / Number(item.exrate)).toFixed(2))
  884. // this.$set(item,'stlTtlAmountUSD',(Number(item.stlTtlAmount) / Number(item.exrate)).toFixed(2))
  885. // this.$set(item,'currentStlAmountUSD',((Number(item.amount) - Number(item.stlTtlAmount)) / Number(item.exrate)).toFixed(2))
  886. }
  887. return item
  888. })
  889. })
  890. },
  891. // 确认发票
  892. Confirminvoicefun(){
  893. },
  894. // 不开发票
  895. Notinvoicingfun(){
  896. },
  897. // 对账确认
  898. finstlbillsConfirmReconciliationfun(){
  899. this.$confirm("确定进行对账操作?", {
  900. confirmButtonText: "确定",
  901. cancelButtonText: "取消",
  902. type: "warning"
  903. }).then(()=>{
  904. this.pageLoading = true
  905. finstlbillsConfirmReconciliation(this.form).then(res=>{
  906. this.pageLoading = false
  907. this.$message.success('操作成功');
  908. this.finstlbillsDetailfun(res.data.data.id)
  909. }).catch(err=>{
  910. this.pageLoading = false
  911. })
  912. })
  913. },
  914. // 对账撤销
  915. finstlbillsRevokeReconciliationfun(){
  916. this.$confirm("确定进行撤销对账操作?", {
  917. confirmButtonText: "确定",
  918. cancelButtonText: "取消",
  919. type: "warning"
  920. }).then(()=>{
  921. this.pageLoading = true
  922. finstlbillsRevokeReconciliation(this.form).then(res=>{
  923. this.pageLoading = false
  924. this.$message.success('操作成功');
  925. this.finstlbillsDetailfun(res.data.data.id)
  926. }).catch(err=>{
  927. this.pageLoading = false
  928. })
  929. })
  930. },
  931. // 确认签收
  932. ConfirmReceiptfun(){
  933. if (this.handleSelectionData.length === 0) {
  934. this.$message.warning("请选择至少一条数据");
  935. return;
  936. }
  937. for (let item of this.handleSelectionData) {
  938. if (item.isSignfor == 1) {
  939. this.$message.warning('请选择未签收的数据进行签收');
  940. return;
  941. }
  942. }
  943. this.$confirm("确定将选择数据签收?", {
  944. confirmButtonText: "确定",
  945. cancelButtonText: "取消",
  946. type: "warning"
  947. }).then(()=>{
  948. this.finstlbillsConfirmSignForfun()
  949. })
  950. },
  951. // 撤销签收
  952. RevokeReceiptfun(){
  953. if (this.handleSelectionData.length === 0) {
  954. this.$message.warning("请选择至少一条数据");
  955. return;
  956. }
  957. for (let item of this.handleSelectionData) {
  958. if (item.isSignfor == 0) {
  959. this.$message.warning('请选择已签收的数据进行撤销');
  960. return;
  961. }
  962. }
  963. this.$confirm("确定将选择数据撤销签收?", {
  964. confirmButtonText: "确定",
  965. cancelButtonText: "取消",
  966. type: "warning"
  967. }).then(()=>{
  968. this.finstlbillsRevokeSignForfun()
  969. })
  970. },
  971. // 确认选定行
  972. SelectedRows(){
  973. this.editCustomer()
  974. },
  975. // 下面表格多选
  976. handleSelectionChange(arr){
  977. this.handleSelectionData = arr
  978. },
  979. //返回列表
  980. backToList() {
  981. this.$emit('goBack')
  982. },
  983. // 请求的接口
  984. // 确认签收接口
  985. finstlbillsConfirmSignForfun(){
  986. this.form.billNoFormat = 'HYDZ'
  987. this.form.businessTypeCode = 'HYDZ'
  988. this.form.businessType = 'CHK' //对账单
  989. // 保留id
  990. this.form.finStlBillsItemsList = this.handleSelectionData.map((item,index)=>{
  991. item.lineNo = index
  992. item.pType = item.businessType
  993. item.accBillId = item.id
  994. item.accBillNo = item.billNo
  995. item.accDate = item.billDate
  996. delete item.businessType
  997. delete item.billNo
  998. delete item.billDate
  999. return item
  1000. })
  1001. this.pageLoading = true
  1002. finstlbillsConfirmSignFor(this.form).then(res=>{
  1003. this.pageLoading = false
  1004. this.$message.success('操作成功');
  1005. this.finstlbillsDetailfun(res.data.data.id)
  1006. }).catch(err=>{
  1007. this.pageLoading = false
  1008. })
  1009. },
  1010. // 撤销签收接口
  1011. finstlbillsRevokeSignForfun(){
  1012. this.form.billNoFormat = 'HYDZ'
  1013. this.form.businessTypeCode = 'HYDZ'
  1014. this.form.businessType = 'CHK' // 对账单
  1015. this.form.finStlBillsItemsList = this.handleSelectionData.map((item,index)=>{
  1016. item.lineNo = index
  1017. item.pType = item.businessType
  1018. item.accBillId = item.id
  1019. item.accBillNo = item.billNo
  1020. item.accDate = item.billDate
  1021. delete item.businessType
  1022. delete item.billNo
  1023. delete item.billDate
  1024. return item
  1025. })
  1026. this.pageLoading = true
  1027. finstlbillsRevokeSignFor(this.form).then(res=>{
  1028. this.pageLoading = false
  1029. this.$message.success('操作成功');
  1030. this.finstlbillsDetailfun(res.data.data.id)
  1031. }).catch(err=>{
  1032. this.pageLoading = false
  1033. })
  1034. },
  1035. // 获取 全部是否 接口
  1036. allyesnoWorkDictsfun(){
  1037. getWorkDicts('all_yes_no').then(res=>{
  1038. this.allyesnoData = res.data.data;
  1039. })
  1040. },
  1041. // 销账字段数据
  1042. // 获取发票的字典数据
  1043. invoiceWorkDictsfun(){
  1044. getWorkDicts('invoice_los').then(res=>{
  1045. this.isInvoiceData = res.data.data;
  1046. })
  1047. },
  1048. // 获取币别数据
  1049. getRateListfun(cnName){
  1050. getRateList({current:1,size:10,cnName}).then(res=>{
  1051. this.curCodeData = res.data.data.records
  1052. })
  1053. },
  1054. // 获取操作员数据
  1055. updateUserUserGetListfun(account){
  1056. userGetList(1,10,{account}).then(res=>{
  1057. this.updateUserData = res.data.data.records
  1058. })
  1059. },
  1060. // 获取公司名称 用户管理左侧
  1061. ownDeptLazyTreefun(){
  1062. getDeptLazyTree(0).then(res=>{
  1063. this.srcData = res.data.data
  1064. })
  1065. },
  1066. // 获取业务来源代理数据
  1067. srcBcorpsListfun(cnName){
  1068. let corpType = '1712285382575398914,1712285645314990082,1712285842321448962,1712286433378574338'
  1069. getBcorpslistByType(1,10,{cnName,corpType}).then(res=>{
  1070. this.srcData = res.data.data.records
  1071. })
  1072. },
  1073. // 获取业务员数据
  1074. salesuserGetListfun(account = undefined,type = false,){
  1075. userGetList(1,10,{account}).then(res=>{
  1076. this.srcData = res.data.data.records
  1077. })
  1078. },
  1079. // 获取对账单位数据
  1080. corpBcorpsListfun(cnName){
  1081. getBcorpslistByType(1,10,{cnName}).then(res=>{
  1082. this.corpData = res.data.data.records
  1083. })
  1084. },
  1085. }
  1086. }
  1087. </script>
  1088. <style scoped>
  1089. ::v-deep.el-form-item {
  1090. margin-bottom: 0;
  1091. }
  1092. .bottomFlex {
  1093. display: flex;
  1094. align-items: center;
  1095. }
  1096. .weightfont {
  1097. font-size: 20px;
  1098. font-weight: bold;
  1099. }
  1100. .weightnum {
  1101. font-size: 15px;
  1102. font-weight: 500;
  1103. }
  1104. </style>