finstlbillsDetails.vue 60 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123
  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. if (!this.form.id) {
  757. this.form.finStlBillsItemsList = this.handleSelectionData.map((item,index)=>{
  758. item.lineNo = index
  759. item.pType = item.businessType
  760. item.accBillId = item.id
  761. item.accBillNo = item.billNo
  762. item.accDate = item.billDate
  763. item.dc = item.accountDc // 收付
  764. if (item.currentStlCurCode == 'CNY') {
  765. item.currentStlAmount = item.currentStlAmountRMB
  766. }else {
  767. item.currentStlAmount = item.currentStlAmountUSD
  768. }
  769. delete item.businessType
  770. if (!this.form.id) {
  771. delete item.id
  772. }
  773. delete item.billNo
  774. delete item.billDate
  775. delete item.accountDc
  776. return item
  777. })
  778. }
  779. finstlbillsSubmit(this.form).then(res=>{
  780. this.saveLoading = false
  781. this.pageLoading = false
  782. this.$message.success('操作成功');
  783. this.finstlbillsDetailfun(res.data.data.id)
  784. }).catch(err=>{
  785. this.pageLoading = false
  786. })
  787. },
  788. // 详情接口
  789. finstlbillsDetailfun(id){
  790. this.pageLoading = true
  791. finstlbillsDetail(id).then(res=>{
  792. this.form = res.data.data
  793. this.form.businessTypes = this.form.businessTypes.split(',') // 业务类型转换成数组显示
  794. this.tableData = this.form.finStlBillsItemsList.map(item=>{
  795. if(item.curCode == 'CNY') {
  796. this.$set(item,'amountRMB',item.amount)
  797. this.$set(item,'currentInvoiceAmountRMB',item.currentInvoiceAmount)
  798. this.$set(item,'unsettledAmountRMB',item.unsettledAmount)
  799. this.$set(item,'stlTtlAmountRMB',item.stlTtlAmount)
  800. this.$set(item,'currentStlAmountRMB',item.currentStlAmount)
  801. }else {
  802. this.$set(item,'amountUSD',item.amount)
  803. this.$set(item,'currentInvoiceAmountUSD',item.currentInvoiceAmount)
  804. this.$set(item,'unsettledAmountUSD',item.unsettledAmount)
  805. this.$set(item,'stlTtlAmountUSD',item.stlTtlAmount)
  806. this.$set(item,'currentStlAmountUSD',item.currentStlAmount)
  807. }
  808. return item
  809. })
  810. this.form.isSignfor = this.form.isSignfor + ''
  811. this.form.isApproved = this.form.isApproved + ''
  812. this.form.isCleared = this.form.isCleared + ''
  813. this.form.isChecked = this.form.isChecked + ''
  814. this.form.isInvoice = this.form.isInvoice + ''
  815. this.pageLoading = false
  816. })
  817. },
  818. // 重置条件
  819. ResetFilter(){
  820. this.form = {}
  821. },
  822. // 检索接口
  823. finstlbillslistAccBillV1fun(){
  824. // 对账单位
  825. if (!this.form.corpId) {
  826. this.$message.warning('请选择对账单位');
  827. return
  828. }
  829. // 业务类型
  830. if (!this.form.businessTypes) {
  831. this.$message.warning('请选择业务类型');
  832. return
  833. }
  834. delete this.form.id
  835. // let obj = JSON.parse(JSON.stringify(this.form))
  836. let obj = {}
  837. obj.type = '1'
  838. obj.auditStatus = this.form.isApproved // 审核状态 0 新建费用 1 已请核 2 审核中 3 驳回 4 通过
  839. obj.corpCnName = this.form.corpId // 对账单位
  840. obj.isSignfor = this.form.isSignfor // 是否已签收(0 否 1是)
  841. obj.dc = this.form.dc // 收付 D=收 C=付
  842. obj.curCode = this.form.curCode // 币别
  843. obj.srcType = this.form.srcType // 业务来源
  844. obj.srcCnName = this.form.srcId // 业务员id
  845. obj.isCleared = this.form.isCleared // 是否销账(0 未销账 3 部分销账 9 销账)
  846. obj.accBillNo = this.form.accountNo // 账单编号 ACCT NO
  847. obj.billNo = this.form.businessNo // 单据编号 JOB NO
  848. obj.mblno = this.form.mblno // MB/L NO
  849. obj.hblno = this.form.hblno // HB/L NO
  850. obj.isChecked = this.form.isChecked // 是否对账(0 未对账 1 已对账)
  851. obj.queryAmount = this.form.queryAmount // 查询金额
  852. obj.businessType = this.form.businessTypes.join(',') // 业务类型
  853. obj.invoiceStatus = this.form.isInvoice // 发票状态 0 = 未开 9=已开 2 待开 3 不开
  854. obj.vesselCnName = this.form.vesselCnName // 中文船名
  855. obj.invoiceNo = this.form.invoiceNo // 发票号
  856. obj.bookingNo = this.form.bookingNo // 订舱号 BKNO
  857. obj.createUserName = this.form.updateUser // 操作员id
  858. obj.receivableAdvance = this.form.receivableAdvance // 预收帐款
  859. obj.threeInspectionsNo = this.form.threeInspectionsNo // 三检单号
  860. obj.voyageNo = this.form.voyageNo // 航次
  861. // 审核期间
  862. if (this.form.approvedDate) {
  863. obj.approveTimeList = this.form.approvedDate
  864. }
  865. // 财务期间
  866. if (this.form.accountDate) {
  867. obj.billDateList = this.form.accountDate
  868. }
  869. finstlbillslistAccBillV1(obj).then(res=>{
  870. this.tableData = res.data.data.map(item=>{
  871. if(item.curCode == 'CNY') {
  872. this.$set(item,'amountRMB',item.amount)
  873. this.$set(item,'currentInvoiceAmountRMB',item.currentInvoiceAmount)
  874. this.$set(item,'unsettledAmountRMB',item.unsettledAmount)
  875. this.$set(item,'stlTtlAmountRMB',item.stlTtlAmount)
  876. this.$set(item,'currentStlAmountRMB',Number(item.amount) - Number(item.stlTtlAmount))
  877. }else {
  878. this.$set(item,'amountUSD',item.amount)
  879. this.$set(item,'currentInvoiceAmountUSD',item.currentInvoiceAmount)
  880. this.$set(item,'unsettledAmountUSD',item.unsettledAmount)
  881. this.$set(item,'stlTtlAmountUSD',item.stlTtlAmount)
  882. this.$set(item,'currentStlAmountUSD',(Number(item.amount) - Number(item.stlTtlAmount)).toFixed(2))
  883. // this.$set(item,'amountUSD',(Number(item.amount) / Number(item.exrate)).toFixed(2))
  884. // this.$set(item,'currentInvoiceAmountUSD',(Number(item.currentInvoiceAmount) / Number(item.exrate)).toFixed(2))
  885. // this.$set(item,'unsettledAmountUSD',(Number(item.unsettledAmount) / Number(item.exrate)).toFixed(2))
  886. // this.$set(item,'stlTtlAmountUSD',(Number(item.stlTtlAmount) / Number(item.exrate)).toFixed(2))
  887. // this.$set(item,'currentStlAmountUSD',((Number(item.amount) - Number(item.stlTtlAmount)) / Number(item.exrate)).toFixed(2))
  888. }
  889. return item
  890. })
  891. })
  892. },
  893. // 确认发票
  894. Confirminvoicefun(){
  895. },
  896. // 不开发票
  897. Notinvoicingfun(){
  898. },
  899. // 对账确认
  900. finstlbillsConfirmReconciliationfun(){
  901. this.$confirm("确定进行对账操作?", {
  902. confirmButtonText: "确定",
  903. cancelButtonText: "取消",
  904. type: "warning"
  905. }).then(()=>{
  906. this.pageLoading = true
  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. finstlbillsRevokeReconciliation(this.form).then(res=>{
  925. this.pageLoading = false
  926. this.$message.success('操作成功');
  927. this.finstlbillsDetailfun(res.data.data.id)
  928. }).catch(err=>{
  929. this.pageLoading = false
  930. })
  931. })
  932. },
  933. // 确认签收
  934. ConfirmReceiptfun(){
  935. if (this.handleSelectionData.length === 0) {
  936. this.$message.warning("请选择至少一条数据");
  937. return;
  938. }
  939. for (let item of this.handleSelectionData) {
  940. if (item.isSignfor == 1) {
  941. this.$message.warning('请选择未签收的数据进行签收');
  942. return;
  943. }
  944. }
  945. this.$confirm("确定将选择数据签收?", {
  946. confirmButtonText: "确定",
  947. cancelButtonText: "取消",
  948. type: "warning"
  949. }).then(()=>{
  950. this.finstlbillsConfirmSignForfun()
  951. })
  952. },
  953. // 撤销签收
  954. RevokeReceiptfun(){
  955. if (this.handleSelectionData.length === 0) {
  956. this.$message.warning("请选择至少一条数据");
  957. return;
  958. }
  959. for (let item of this.handleSelectionData) {
  960. if (item.isSignfor == 0) {
  961. this.$message.warning('请选择已签收的数据进行撤销');
  962. return;
  963. }
  964. }
  965. this.$confirm("确定将选择数据撤销签收?", {
  966. confirmButtonText: "确定",
  967. cancelButtonText: "取消",
  968. type: "warning"
  969. }).then(()=>{
  970. this.finstlbillsRevokeSignForfun()
  971. })
  972. },
  973. // 确认选定行
  974. SelectedRows(){
  975. this.editCustomer()
  976. },
  977. // 下面表格多选
  978. handleSelectionChange(arr){
  979. this.handleSelectionData = arr
  980. },
  981. //返回列表
  982. backToList() {
  983. this.$emit('goBack')
  984. },
  985. // 请求的接口
  986. // 确认签收接口
  987. finstlbillsConfirmSignForfun(){
  988. this.form.billNoFormat = 'HYDZ'
  989. this.form.businessTypeCode = 'HYDZ'
  990. this.form.businessType = 'CHK' //对账单
  991. // 保留id
  992. this.form.finStlBillsItemsList = this.handleSelectionData.map((item,index)=>{
  993. item.lineNo = index
  994. item.pType = item.businessType
  995. item.accBillId = item.id
  996. item.accBillNo = item.billNo
  997. item.accDate = item.billDate
  998. delete item.businessType
  999. delete item.billNo
  1000. delete item.billDate
  1001. return item
  1002. })
  1003. this.pageLoading = true
  1004. finstlbillsConfirmSignFor(this.form).then(res=>{
  1005. this.pageLoading = false
  1006. this.$message.success('操作成功');
  1007. this.finstlbillsDetailfun(res.data.data.id)
  1008. }).catch(err=>{
  1009. this.pageLoading = false
  1010. })
  1011. },
  1012. // 撤销签收接口
  1013. finstlbillsRevokeSignForfun(){
  1014. this.form.billNoFormat = 'HYDZ'
  1015. this.form.businessTypeCode = 'HYDZ'
  1016. this.form.businessType = 'CHK' // 对账单
  1017. this.form.finStlBillsItemsList = this.handleSelectionData.map((item,index)=>{
  1018. item.lineNo = index
  1019. item.pType = item.businessType
  1020. item.accBillId = item.id
  1021. item.accBillNo = item.billNo
  1022. item.accDate = item.billDate
  1023. delete item.businessType
  1024. delete item.billNo
  1025. delete item.billDate
  1026. return item
  1027. })
  1028. this.pageLoading = true
  1029. finstlbillsRevokeSignFor(this.form).then(res=>{
  1030. this.pageLoading = false
  1031. this.$message.success('操作成功');
  1032. this.finstlbillsDetailfun(res.data.data.id)
  1033. }).catch(err=>{
  1034. this.pageLoading = false
  1035. })
  1036. },
  1037. // 获取 全部是否 接口
  1038. allyesnoWorkDictsfun(){
  1039. getWorkDicts('all_yes_no').then(res=>{
  1040. this.allyesnoData = res.data.data;
  1041. })
  1042. },
  1043. // 销账字段数据
  1044. // 获取发票的字典数据
  1045. invoiceWorkDictsfun(){
  1046. getWorkDicts('invoice_los').then(res=>{
  1047. this.isInvoiceData = res.data.data;
  1048. })
  1049. },
  1050. // 获取币别数据
  1051. getRateListfun(cnName){
  1052. getRateList({current:1,size:10,cnName}).then(res=>{
  1053. this.curCodeData = res.data.data.records
  1054. })
  1055. },
  1056. // 获取操作员数据
  1057. updateUserUserGetListfun(account){
  1058. userGetList(1,10,{account}).then(res=>{
  1059. this.updateUserData = res.data.data.records
  1060. })
  1061. },
  1062. // 获取公司名称 用户管理左侧
  1063. ownDeptLazyTreefun(){
  1064. getDeptLazyTree(0).then(res=>{
  1065. this.srcData = res.data.data
  1066. })
  1067. },
  1068. // 获取业务来源代理数据
  1069. srcBcorpsListfun(cnName){
  1070. let corpType = '1712285382575398914,1712285645314990082,1712285842321448962,1712286433378574338'
  1071. getBcorpslistByType(1,10,{cnName,corpType}).then(res=>{
  1072. this.srcData = res.data.data.records
  1073. })
  1074. },
  1075. // 获取业务员数据
  1076. salesuserGetListfun(account = undefined,type = false,){
  1077. userGetList(1,10,{account}).then(res=>{
  1078. this.srcData = res.data.data.records
  1079. })
  1080. },
  1081. // 获取对账单位数据
  1082. corpBcorpsListfun(cnName){
  1083. getBcorpslistByType(1,10,{cnName}).then(res=>{
  1084. this.corpData = res.data.data.records
  1085. })
  1086. },
  1087. }
  1088. }
  1089. </script>
  1090. <style scoped>
  1091. ::v-deep.el-form-item {
  1092. margin-bottom: 0;
  1093. }
  1094. .bottomFlex {
  1095. display: flex;
  1096. align-items: center;
  1097. }
  1098. .weightfont {
  1099. font-size: 20px;
  1100. font-weight: bold;
  1101. }
  1102. .weightnum {
  1103. font-size: 15px;
  1104. font-weight: 500;
  1105. }
  1106. </style>