index.vue 49 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571
  1. <template>
  2. <!-- 仓储费计算列表 + 弹窗页面 -->
  3. <div class="app-container">
  4. <el-form
  5. :model="queryParams"
  6. ref="queryForm"
  7. :inline="true"
  8. v-show="showSearch"
  9. label-width="88px"
  10. >
  11. <el-form-item label="业务编号" prop="fBillno">
  12. <el-input
  13. v-model="queryParams.fBillno"
  14. placeholder="请输入业务编号"
  15. clearable
  16. size="small"
  17. @keyup.enter.native="handleQuery"
  18. />
  19. </el-form-item>
  20. <el-form-item label="制单人" prop="createBy">
  21. <el-select
  22. v-model="queryParams.createBy"
  23. filterable
  24. remote
  25. clearable
  26. style="width: 80%"
  27. :remote-method="userRemoteMethod"
  28. placeholder="请选择制单人"
  29. >
  30. <el-option
  31. v-for="(dict, index) in userOptions"
  32. :key="index.userName"
  33. :label="dict.nickName"
  34. :value="dict.userName"
  35. ></el-option>
  36. </el-select>
  37. </el-form-item>
  38. <el-form-item label="出库日期" prop="timeInterval">
  39. <el-date-picker
  40. v-model="queryParams.timeInterval"
  41. type="daterange"
  42. value-format="yyyy-MM-dd"
  43. clearable
  44. range-separator="至"
  45. start-placeholder="开始日期"
  46. end-placeholder="结束日期"
  47. @keyup.enter.native="handleQuery"
  48. >
  49. </el-date-picker>
  50. </el-form-item>
  51. <el-form-item label="货权方" prop="fCorpid">
  52. <el-select
  53. v-model="queryParams.fCorpid"
  54. filterable
  55. remote
  56. clearable
  57. style="width: 80%"
  58. @keyup.enter.native="handleQuery"
  59. :remote-method="corpsRemoteMethod"
  60. placeholder="请选择货权方"
  61. >
  62. <el-option
  63. v-for="(dict, index) in fMblnoOptions"
  64. :key="index.fId"
  65. :label="dict.fName"
  66. :value="dict.fId"
  67. ></el-option>
  68. </el-select>
  69. </el-form-item>
  70. <el-form-item label="提单号" prop="fMblno">
  71. <el-input
  72. v-model="queryParams.fMblno"
  73. placeholder="请输入提单号"
  74. clearable
  75. size="small"
  76. @keyup.enter.native="handleQuery"
  77. />
  78. </el-form-item>
  79. <el-form-item label="唛头" prop="fMarks">
  80. <el-input
  81. v-model="queryParams.fMarks"
  82. placeholder="请输入唛头"
  83. clearable
  84. size="small"
  85. style="width: 80%"
  86. @keyup.enter.native="handleQuery"
  87. />
  88. </el-form-item>
  89. <el-form-item>
  90. <el-button
  91. type="cyan"
  92. icon="el-icon-search"
  93. size="mini"
  94. @click="handleQuery"
  95. >搜索
  96. </el-button>
  97. <el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
  98. >重置
  99. </el-button>
  100. </el-form-item>
  101. </el-form>
  102. <el-row :gutter="10" class="mb8">
  103. <el-col :span="1.5">
  104. <el-button
  105. type="primary"
  106. icon="el-icon-plus"
  107. size="mini"
  108. @click="handleAdd(false)"
  109. v-hasPermi="['warehouseBusiness:storageFeeCalculation:add']"
  110. >新增
  111. </el-button>
  112. </el-col>
  113. <el-col :span="1.5">
  114. <el-button
  115. type="success"
  116. icon="el-icon-edit"
  117. size="mini"
  118. :disabled="single"
  119. @click="handleUpdate"
  120. v-hasPermi="['warehouseBusiness:storageFeeCalculation:edit']"
  121. >修改
  122. </el-button>
  123. </el-col>
  124. <el-col :span="1.5">
  125. <el-button
  126. type="danger"
  127. icon="el-icon-delete"
  128. size="mini"
  129. :disabled="multiple"
  130. @click="handleDelete"
  131. v-hasPermi="['warehouseBusiness:storageFeeCalculation:remove']"
  132. >删除
  133. </el-button>
  134. </el-col>
  135. <el-col :span="1.5">
  136. <el-button
  137. type="warning"
  138. icon="el-icon-download"
  139. size="mini"
  140. @click="handleExport"
  141. v-hasPermi="['warehouseBusiness:storageFeeCalculation:export']"
  142. >导出
  143. </el-button>
  144. </el-col>
  145. <el-col :span="1.5">
  146. <el-button
  147. type="warning"
  148. icon="el-icon-download"
  149. size="mini"
  150. @click="handleExport"
  151. :disabled="multiple"
  152. v-hasPermi="['warehouseBusiness:storageFeeCalculation:export']"
  153. >导入
  154. </el-button>
  155. </el-col>
  156. <right-toolbar
  157. :showSearch.sync="showSearch"
  158. @queryTable="getList"
  159. ></right-toolbar>
  160. </el-row>
  161. <el-table
  162. v-loading="loading"
  163. :data="warehousebillsList"
  164. @selection-change="handleSelectionChange"
  165. >
  166. <el-table-column type="selection" width="55" align="center"/>
  167. <el-table-column type="index" label="行号" align="center"/>
  168. <el-table-column
  169. :show-overflow-tooltip="true"
  170. label="单据编号"
  171. align="center"
  172. prop="fBillno"
  173. />
  174. <el-table-column label="客户名称" align="center" prop="fCorpid" show-overflow-tooltip/>
  175. <el-table-column
  176. label="计费日期"
  177. align="center"
  178. prop="fBillingDeadline"
  179. width="180"
  180. >
  181. <template slot-scope="scope">
  182. <span>{{ parseTime(scope.row.fBillingDeadline, "{y}-{m}-{d}") }}</span>
  183. </template>
  184. </el-table-column>
  185. <el-table-column
  186. label="备注"
  187. align="center"
  188. prop="remark"
  189. />
  190. <el-table-column
  191. label="单据状态"
  192. align="center"
  193. prop="fBillstatus"
  194. >
  195. <template slot-scope="scope">
  196. <span v-if="scope.row.fBillstatus === 1">新建</span>
  197. <span v-if="scope.row.fBillstatus === 2">暂存</span>
  198. <span v-if="scope.row.fBillstatus === 3">审核驳回</span>
  199. <span v-if="scope.row.fBillstatus === 4">提交审核</span>
  200. <span v-if="scope.row.fBillstatus === 5">审核中</span>
  201. <span v-if="scope.row.fBillstatus === 6">审核通过</span>
  202. </template>
  203. </el-table-column>
  204. <el-table-column
  205. label="制单人"
  206. align="center"
  207. prop="createBy"
  208. />
  209. <el-table-column
  210. label="制单日期"
  211. align="center"
  212. prop="createTime"
  213. width="160"
  214. >
  215. <template slot-scope="scope">
  216. {{scope.row.createTime.slice(0, 10)}}
  217. </template>
  218. </el-table-column>
  219. <el-table-column
  220. label="操作"
  221. align="center"
  222. class-name="small-padding fixed-width"
  223. width="180"
  224. >
  225. <template slot-scope="scope">
  226. <el-button
  227. size="mini"
  228. type="text"
  229. icon="el-icon-edit"
  230. @click="handleUpdate(scope.row, true)"
  231. v-hasPermi="['warehouseBusiness:storageFeeCalculation:edit']"
  232. >查看
  233. </el-button>
  234. <el-button
  235. size="mini"
  236. type="text"
  237. icon="el-icon-view"
  238. @click="check(scope.row,1)"
  239. v-hasPermi="['warehouseBusiness:storageFeeCalculation:edit']"
  240. v-if="scope.row.fBillstatus == 4 || scope.row.fBillstatus == 5"
  241. >审批进度</el-button
  242. >
  243. <el-button
  244. size="mini"
  245. type="text"
  246. icon="el-icon-edit"
  247. v-if="scope.row.fBillstatus <= 3"
  248. @click="handleUpdate(scope.row, false)"
  249. v-hasPermi="['warehouseBusiness:storageFeeCalculation:edit']"
  250. >修改
  251. </el-button>
  252. <el-button
  253. size="mini"
  254. type="text"
  255. icon="el-icon-delete"
  256. v-if="scope.row.fBillstatus <= 3"
  257. @click="handleDelete(scope.row)"
  258. v-hasPermi="['warehouseBusiness:storageFeeCalculation:remove']"
  259. >删除
  260. </el-button>
  261. </template>
  262. </el-table-column>
  263. </el-table>
  264. <pagination
  265. v-show="total > 0"
  266. :total="total"
  267. :page.sync="queryParams.pageNum"
  268. :limit.sync="queryParams.pageSize"
  269. @pagination="getList"
  270. />
  271. <!-- 新增或修改仓储费计算对话框 -->
  272. <el-dialog
  273. :visible.sync="open"
  274. :close-on-click-modal="false"
  275. width="80%"
  276. append-to-body
  277. :show-close="Xbutton"
  278. >
  279. <el-form ref="form" :model="form" :rules="rules" label-width="120px">
  280. <el-row>
  281. <el-col :span="5">
  282. <el-form-item label="客户名称" prop="fCorpid">
  283. <el-select
  284. v-model="form.fCorpid"
  285. filterable
  286. remote
  287. :disabled="browseStatus"
  288. style="width: 80%"
  289. :remote-method="corpsRemoteMethod"
  290. placeholder="请输入模糊查找"
  291. >
  292. <el-option
  293. v-for="(dict, index) in fMblnoOptions"
  294. :key="index.fId"
  295. :label="dict.fName"
  296. :value="dict.fId"
  297. ></el-option>
  298. </el-select>
  299. </el-form-item>
  300. </el-col>
  301. <el-col :span="5">
  302. <el-form-item label="货品名称" prop="fGoodsid">
  303. <el-select
  304. v-model="form.fGoodsid"
  305. filterable
  306. :disabled="browseStatus"
  307. remote
  308. :remote-method="goodsRemoteMethod"
  309. placeholder="请选择品名"
  310. >
  311. <el-option
  312. v-for="(dict, index) in goodsOptions"
  313. :key="index.fId"
  314. :label="dict.fName"
  315. :value="dict.fId"
  316. ></el-option>
  317. </el-select>
  318. </el-form-item>
  319. </el-col>
  320. <el-col :span="5">
  321. <el-form-item label="提单号" prop="fMblno">
  322. <el-input
  323. v-model="form.fMblno"
  324. style="width: 80%"
  325. :disabled="browseStatus"
  326. placeholder="手工输入"
  327. />
  328. </el-form-item>
  329. </el-col>
  330. <el-col :span="5">
  331. <el-form-item disabled label="仓储费截止日期" prop="fBillingDeadline">
  332. <el-date-picker
  333. v-model="form.fBillingDeadline"
  334. size="large"
  335. type="date"
  336. :disabled="browseStatus"
  337. value-format="timestamp"
  338. placeholder="仓储费计算截止日期"
  339. >
  340. </el-date-picker>
  341. </el-form-item>
  342. </el-col>
  343. </el-row>
  344. <el-row>
  345. <el-col :span="5">
  346. <el-form-item label="业务编号" prop="fBillno">
  347. <el-input
  348. disabled
  349. v-model="form.fBillno"
  350. style="width: 80%"
  351. placeholder="业务编号"
  352. />
  353. </el-form-item>
  354. </el-col>
  355. <el-col :span="5">
  356. <el-form-item label="制单人" prop="createBy">
  357. <el-input
  358. disabled
  359. v-model="form.createBy"
  360. style="width: 80%"
  361. placeholder="制单人"
  362. />
  363. </el-form-item>
  364. </el-col>
  365. <el-col :span="5">
  366. <el-form-item disabled label="制单日期" prop="fbilldate">
  367. <el-date-picker
  368. v-model="form.createTime"
  369. size="large"
  370. type="date"
  371. disabled
  372. style="width:200px"
  373. value-format="timestamp"
  374. placeholder="制单日期"
  375. >
  376. </el-date-picker>
  377. </el-form-item>
  378. </el-col>
  379. <el-col :span="5">
  380. <el-form-item disabled label="备注" prop="remark">
  381. <el-input
  382. :disabled="browseStatus"
  383. v-model="form.remark"
  384. placeholder="制单人"
  385. />
  386. </el-form-item>
  387. </el-col>
  388. </el-row>
  389. </el-form>
  390. <div style="font-size:18px">
  391. 计费物资明细
  392. <el-button :disabled="browseStatus" @click="calculateCost">计算仓储费</el-button>
  393. <el-button type="primary" :disabled="browseStatus" @click="submitForm(2)">保 存</el-button>
  394. </div>
  395. <div class="dialogTableTitle flex a-center jlr"
  396. style="display:flex;justify-content:space-between;align-items:center;margin: 10px 0;">
  397. <el-table
  398. :data="dataList"
  399. ref="tableList"
  400. tooltip-effect="dark"
  401. border
  402. stripe
  403. :summary-method="getSummaries"
  404. show-summary
  405. >
  406. <el-table-column label="序号" type="index" width="80">
  407. </el-table-column>
  408. <el-table-column
  409. prop="fBilltype"
  410. header-align="center"
  411. align="center"
  412. width="140px"
  413. label="业务来源"
  414. >
  415. <template slot-scope="scope">
  416. <span v-if="scope.row.fBilltype === 'SJRK'">入库</span>
  417. <span v-if="scope.row.fBilltype === 'SJCK'">出库</span>
  418. <span v-if="scope.row.fBilltype === 'KCZZ'">库存总账</span>
  419. </template>
  420. </el-table-column>
  421. <el-table-column
  422. prop="fBillno"
  423. header-align="center"
  424. align="center"
  425. width="140px"
  426. label="业务单号"
  427. >
  428. </el-table-column>
  429. <el-table-column
  430. prop="fGoodsid"
  431. header-align="center"
  432. align="center"
  433. width="140px"
  434. label="货物名称"
  435. >
  436. <template slot-scope="scope">
  437. <el-select
  438. v-model="scope.row.fGoodsid"
  439. filterable
  440. disabled
  441. remote
  442. placeholder="请选择品名"
  443. >
  444. <el-option
  445. v-for="(dict, index) in goodsOptions"
  446. :key="index.fId"
  447. :label="dict.fName"
  448. :value="dict.fId"
  449. ></el-option>
  450. </el-select>
  451. </template>
  452. </el-table-column>
  453. <el-table-column
  454. prop="fMarks"
  455. header-align="center"
  456. align="center"
  457. width="140px"
  458. label="唛头"
  459. />
  460. <el-table-column
  461. prop="fBsdate"
  462. header-align="center"
  463. align="center"
  464. width="140px"
  465. label="业务日期"
  466. >
  467. <template slot-scope="scope">
  468. <el-date-picker
  469. v-model="scope.row.fBsdate"
  470. size="large"
  471. type="date"
  472. disabled
  473. value-format="timestamp"
  474. placeholder="业务日期"
  475. >
  476. </el-date-picker>
  477. </template>
  478. </el-table-column>
  479. <el-table-column
  480. prop="fBillingway"
  481. header-align="center"
  482. align="center"
  483. width="180px"
  484. label="计费单位"
  485. >
  486. <template slot-scope="scope">
  487. <el-select
  488. v-model="scope.row.fBillingway"
  489. placeholder="请选择计费单位"
  490. disabled
  491. clearable
  492. >
  493. <el-option
  494. v-for="dict in fFeetunitOptions"
  495. :key="dict.dictValue"
  496. :label="dict.dictLabel"
  497. :value="dict.dictValue"
  498. />
  499. </el-select>
  500. </template>
  501. </el-table-column>
  502. <el-table-column
  503. prop="fBillingQty"
  504. header-align="center"
  505. align="center"
  506. width="140px"
  507. label="计费数量"
  508. >
  509. </el-table-column>
  510. <el-table-column
  511. prop="fChargedate"
  512. header-align="center"
  513. align="center"
  514. width="140px"
  515. label="计费起始日期"
  516. >
  517. <template slot-scope="scope">
  518. <el-date-picker
  519. v-model="scope.row.fChargedate"
  520. size="large"
  521. type="date"
  522. disabled
  523. value-format="timestamp"
  524. placeholder="计费起始日期"
  525. >
  526. </el-date-picker>
  527. </template>
  528. </el-table-column>
  529. <el-table-column
  530. prop="fBillingDeadline"
  531. header-align="center"
  532. align="center"
  533. width="140px"
  534. label="计费截止日期"
  535. >
  536. <template slot-scope="scope">
  537. <el-date-picker
  538. v-model="scope.row.fBillingDeadline"
  539. size="large"
  540. type="date"
  541. disabled
  542. value-format="timestamp"
  543. placeholder="计费截止日期"
  544. >
  545. </el-date-picker>
  546. </template>
  547. </el-table-column>
  548. <el-table-column
  549. prop="fBillingDays"
  550. header-align="center"
  551. align="center"
  552. width="140px"
  553. label="计费天数"
  554. >
  555. </el-table-column>
  556. <el-table-column
  557. prop="fInventoryDays"
  558. header-align="center"
  559. align="center"
  560. width="140px"
  561. label="库存天数"
  562. >
  563. </el-table-column>
  564. <el-table-column
  565. prop="fAmt"
  566. header-align="center"
  567. align="center"
  568. width="140px"
  569. label="计费金额"
  570. >
  571. </el-table-column>
  572. <el-table-column
  573. prop="remark"
  574. header-align="center"
  575. width="150px"
  576. align="center"
  577. label="备注"
  578. >
  579. <template slot-scope="scope">
  580. <el-input
  581. v-model="scope.row.remark"
  582. placeholder="备注"
  583. :disabled="browseStatus"
  584. show-word-limit
  585. />
  586. </template>
  587. </el-table-column>
  588. </el-table>
  589. </div>
  590. <div>
  591. <el-button :disabled="browseStatus" @click.prevent="addCollection()"
  592. >新行
  593. </el-button>
  594. <el-button type="primary" :disabled="browseStatus" @click="submitForm(2)">保 存</el-button>
  595. </div>
  596. <div style="font-size:18px">应收款明细</div>
  597. <div class="dialogTableTitle flex a-center jlr"
  598. style="display:flex;justify-content:space-between;align-items:center;margin: 10px 0;">
  599. <el-table
  600. :data="warehouseDrList"
  601. ref="table"
  602. tooltip-effect="dark"
  603. border
  604. stripe
  605. show-summary
  606. :summary-method="warehouseDrSummaries"
  607. >
  608. <el-table-column label="序号" type="index" width="80">
  609. </el-table-column>
  610. <el-table-column
  611. prop="fCorpid"
  612. header-align="center"
  613. align="center"
  614. width="180px"
  615. label="客户名称"
  616. >
  617. <template slot-scope="scope">
  618. <el-select
  619. v-model="scope.row.fCorpid"
  620. filterable
  621. remote
  622. :disabled="browseStatus"
  623. :remote-method="corpsRemoteMethod"
  624. placeholder="客户名称"
  625. >
  626. <el-option
  627. v-for="(dict, index) in fMblnoOptions"
  628. :key="index.fId"
  629. :label="dict.fName"
  630. :value="dict.fId"
  631. ></el-option>
  632. </el-select>
  633. </template>
  634. </el-table-column>
  635. <el-table-column
  636. prop="fFeeid"
  637. header-align="center"
  638. align="center"
  639. width="180px"
  640. label="费用名称"
  641. >
  642. <template slot-scope="scope">
  643. <el-select
  644. v-model="scope.row.fFeeid"
  645. filterable
  646. remote
  647. :disabled="browseStatus"
  648. :remote-method="fWRemoteMethod"
  649. placeholder="费用名称"
  650. >
  651. <el-option
  652. v-for="dict in fWbuOptions"
  653. :key="dict.fId"
  654. :label="dict.fName"
  655. :value="dict.fId"
  656. ></el-option>
  657. </el-select>
  658. </template>
  659. </el-table-column>
  660. <el-table-column
  661. prop="fFeeunitid"
  662. header-align="center"
  663. align="center"
  664. width="180px"
  665. label="计价单位"
  666. >
  667. <template slot-scope="scope">
  668. <el-select
  669. v-model="scope.row.fFeeunitid"
  670. placeholder="请选择计价单位"
  671. :disabled="browseStatus"
  672. clearable
  673. >
  674. <el-option
  675. v-for="dict in fFeetunitOptions"
  676. :key="dict.dictValue"
  677. :label="dict.dictLabel"
  678. :value="dict.dictValue"
  679. />
  680. </el-select>
  681. </template>
  682. </el-table-column>
  683. <el-table-column
  684. prop="fQty"
  685. header-align="center"
  686. align="center"
  687. width="150px"
  688. label="数量"
  689. >
  690. <template slot-scope="scope">
  691. <el-input
  692. oninput='this.value=this.value.replace(/[^\-?\d.]/g,"").replace(/^(\-)*(\d+)\.(\d\d\d\d).*$/, "$1$2.$3")'
  693. v-model="scope.row.fQty"
  694. @change="changeEstmateAmt(scope.row)"
  695. :disabled="browseStatus"
  696. placeholder="数量"
  697. show-word-limit
  698. />
  699. </template>
  700. </el-table-column>
  701. <el-table-column
  702. prop="fUnitprice"
  703. header-align="center"
  704. align="center"
  705. width="150px"
  706. label="单价"
  707. >
  708. <template slot-scope="scope">
  709. <el-input
  710. oninput='this.value=this.value.replace(/[^\-?\d.]/g,"").replace(/^(\-)*(\d+)\.(\d\d).*$/, "$1$2.$3")'
  711. v-model="scope.row.fUnitprice"
  712. @change="changeEstmateAmt(scope.row)"
  713. :disabled="browseStatus"
  714. placeholder="单价"
  715. show-word-limit
  716. />
  717. </template>
  718. </el-table-column>
  719. <el-table-column
  720. prop="fAmount"
  721. header-align="center"
  722. align="center"
  723. width="150px"
  724. label="金额"
  725. >
  726. <template slot-scope="scope">
  727. <el-input
  728. disabled
  729. oninput='this.value=this.value.replace(/[^\-?\d.]/g,"").replace(/^(\-)*(\d+)\.(\d\d).*$/, "$1$2.$3")'
  730. v-model="scope.row.fAmount"
  731. placeholder="金额"
  732. show-word-limit
  733. />
  734. </template>
  735. </el-table-column>
  736. <el-table-column
  737. prop="fCurrency"
  738. header-align="center"
  739. align="center"
  740. width="150px"
  741. label="币别"
  742. >
  743. <template slot-scope="scope">
  744. <el-input
  745. v-model="scope.row.fCurrency"
  746. :disabled="browseStatus"
  747. placeholder="币别"
  748. show-word-limit
  749. />
  750. </template>
  751. </el-table-column>
  752. <el-table-column
  753. prop="fExrate"
  754. header-align="center"
  755. align="center"
  756. width="150px"
  757. label="汇率"
  758. >
  759. <template slot-scope="scope">
  760. <el-input
  761. v-model="scope.row.fExrate"
  762. :disabled="browseStatus"
  763. placeholder="汇率"
  764. show-word-limit
  765. />
  766. </template>
  767. </el-table-column>
  768. <el-table-column
  769. prop="fTaxrate"
  770. header-align="center"
  771. align="center"
  772. width="150px"
  773. label="税率"
  774. >
  775. <template slot-scope="scope">
  776. <el-input
  777. v-model="scope.row.fTaxrate"
  778. :disabled="browseStatus"
  779. placeholder="税率"
  780. show-word-limit
  781. />
  782. </template>
  783. </el-table-column>
  784. <el-table-column
  785. prop="remark"
  786. header-align="center"
  787. align="center"
  788. width="150px"
  789. label="备注"
  790. >
  791. <template slot-scope="scope">
  792. <el-input
  793. v-model="scope.row.remark"
  794. :disabled="browseStatus"
  795. placeholder="备注"
  796. show-word-limit
  797. />
  798. </template>
  799. </el-table-column>
  800. <el-table-column
  801. header-align="center"
  802. align="center"
  803. width="200px"
  804. label="操作"
  805. >
  806. <template slot-scope="scope">
  807. <el-button
  808. @click.native.prevent="deleteRow(scope.$index, warehouseDrList)"
  809. size="small"
  810. >移除
  811. </el-button
  812. >
  813. </template>
  814. </el-table-column>
  815. </el-table>
  816. </div>
  817. <div slot="footer" class="dialog-footer">
  818. <el-button type="success" size="small" v-if="form.fBillstatus === '6'">撤销请核</el-button>
  819. <el-button v-if="approve === true" @click="goApproval">审批</el-button>
  820. <el-button type="primary" v-if="notChange" @click="addOrUpdateHandle">查看审批流</el-button>
  821. <el-button v-if="cancelButton === true" @click="cancel">取 消</el-button>
  822. <el-button v-if="cancelButton === false" @click="homePage">取 消</el-button>
  823. <el-button type="danger" size="small" :disabled="disappear" v-if="queryParams.fBillstatus === '4'" @click="backApproval">撤销审批</el-button>
  824. <el-button type="primary" :disabled="browseStatus" @click="submitForm(2)">保 存</el-button>
  825. <el-button
  826. :disabled="browseStatus"
  827. style="background-color: #008000; color: #fff"
  828. @click="submitForm(6)"
  829. >请 核</el-button>
  830. </div>
  831. </el-dialog>
  832. <add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
  833. <approval-comments v-if="addOrUpdateVisib" ref="ApprovalComments" @refreshDataList="returnData"></approval-comments>
  834. </div>
  835. </template>
  836. <script>
  837. import {
  838. calculateStorageFees,
  839. getStorageFeeCalculation,
  840. delStorageFeeCalculation,
  841. addStorageFeeCalculation,
  842. listStorageFeeCalculation,
  843. updateStorageFeeCalculation,
  844. exportStorageFeeCalculation,
  845. } from "@/api/warehouseBusiness/storageFeeCalculation";
  846. import { listUser, queryUserVal } from "@/api/system/user";
  847. import { listGoods } from "@/api/basicdata/goods";
  848. import { listFees } from "@/api/basicdata/fees";
  849. import { listCorps } from "@/api/basicdata/corps";
  850. import moment from 'moment'
  851. import AddOrUpdate from '@/views/viewApproval'
  852. import ApprovalComments from '@/views/startApproval'
  853. import Global from '@/layout/components/global'
  854. import { getCharge } from '@/api/finance/charge'
  855. import { RevocationApproval } from '@/api/finance/contrast'
  856. export default {
  857. name: "StorageFeeCalculation",
  858. components: {
  859. AddOrUpdate,
  860. ApprovalComments
  861. },
  862. data() {
  863. return {
  864. actId: 150,
  865. disappear:false,
  866. cancelButton:true,
  867. Xbutton:true,
  868. approve:false,
  869. addOrUpdateVisib: false,
  870. addOrUpdateVisible:false,
  871. notChange:false,
  872. // 遮罩层
  873. loading: true,
  874. // 选中数组
  875. ids: [],
  876. userVal: {
  877. userName: null,
  878. nickName: null,
  879. deptId: null,
  880. },
  881. queryForm: {},
  882. // 库存总账表
  883. whgenlegList: [],
  884. dataList: [],
  885. warehouseDrList: [],
  886. browseStatus: false,
  887. // 非单个禁用
  888. single: true,
  889. // 非多个禁用
  890. multiple: true,
  891. // 显示搜索条件
  892. showSearch: true,
  893. // 总条数
  894. total: 0,
  895. // 仓库主(出入库)表格数据
  896. warehousebillsList: [],
  897. // 弹出层标题
  898. title: "",
  899. // 是否显示弹出层
  900. open: false,
  901. // 货品名
  902. goodsOptions: [],
  903. // 货权方(客户数据)
  904. fMblnoOptions: [],
  905. // 操作员
  906. userOptions: [],
  907. // 制单部门
  908. deptOptions: [],
  909. // 计费单位(数据字典),下拉选择毛重或净重字典
  910. fFeetunitOptions: [{
  911. dictLabel: '件数',
  912. dictValue: 1
  913. }, {
  914. dictLabel: '毛重',
  915. dictValue: 2
  916. }, {
  917. dictLabel: '净重',
  918. dictValue: 3
  919. }, {
  920. dictLabel: '尺码',
  921. dictValue: 4
  922. }, {
  923. dictLabel: '固定',
  924. dictValue: 5
  925. }],
  926. fTaxrate: 0,
  927. // 费用名称
  928. fWbuOptions: [],
  929. // 查询参数
  930. queryParams: {
  931. pageNum: 1,
  932. pageSize: 10,
  933. fBillno: null,
  934. createBy: null,
  935. createTime: null,
  936. fCustomsdeclartion: null,
  937. fOriginalbillno: null,
  938. fDeptid: null,
  939. fBsdeptid: null,
  940. fContacts: null,
  941. fTel: null,
  942. fCorpid: null,
  943. fTocorpid: null,
  944. fStltypeid: null,
  945. fBscorpno: null,
  946. fWarehouseid: null,
  947. fStorekeeper: null,
  948. fBsdate: null,
  949. fPlanqty: null,
  950. fPlangrossweight: null,
  951. fPlannetweight: null,
  952. fPlanvolumn: null,
  953. fQty: null,
  954. fGrossweight: null,
  955. fNetweight: null,
  956. fVolumn: null,
  957. fTrademodeid: null,
  958. fSbu: null,
  959. fFeetunit: null,
  960. fMblno: null,
  961. fVslvoy: null,
  962. fEta: null,
  963. fCustomno: null,
  964. fIfweigh: null,
  965. fIfpledge: null,
  966. fIfdamage: null,
  967. fBankcorpid: null,
  968. fBilltype: null,
  969. fBillstatus: null,
  970. fCreateby: null,
  971. fCreatetime: null,
  972. fGoodsid: null,
  973. fCntrtype: null,
  974. fCntqty: null,
  975. },
  976. // 表单参数
  977. form: {},
  978. // 表单校验
  979. rules: {
  980. fCorpid: [{required: true, message: " ", trigger: "blur",}],
  981. fBillingDeadline: [{required: true, message: " ", trigger: "blur",}]
  982. }
  983. };
  984. },
  985. created() {
  986. this.getList();
  987. this.getDicts("tax_rate").then((response) => {
  988. this.fTaxrate = response.data[0].dictValue
  989. });
  990. },
  991. activated(){
  992. this.Jump()
  993. },
  994. methods: {
  995. // 撤销审批
  996. backApproval(){
  997. let data = {
  998. id:this.form.fId,
  999. actId:150,
  1000. billId:this.form.fId
  1001. }
  1002. RevocationApproval(data).then(response => {
  1003. this.msgSuccess("撤销审批成功")
  1004. this.disappear = true
  1005. this.open = false
  1006. this.getList()
  1007. })
  1008. },
  1009. homepaGe(){
  1010. let view = {
  1011. fullPath: "/business/agreement",
  1012. hash: "",
  1013. matched: Array(2),
  1014. meta: Object,
  1015. name: "Agreement",
  1016. params: Object,
  1017. path: "/business/agreement",
  1018. query: Object,
  1019. title: "仓储费"
  1020. }
  1021. this.$router.push({ path: '/index'})
  1022. this.$store.dispatch('tagsView/delView', view).then(({ visitedViews }) => {
  1023. if (this.isActive(view)) {
  1024. this.toLastView(visitedViews, view)
  1025. }
  1026. })
  1027. Global.$emit("removeCache", "closeSelectedTag", view);
  1028. },
  1029. Jump(){
  1030. this.approval = this.$route.query.data
  1031. if (this.approval){
  1032. this.Xbutton = false
  1033. this.approval = JSON.parse(this.approval)
  1034. // this.hide = false
  1035. this.notChange = true
  1036. this.approve = true
  1037. this.cancelButton = false
  1038. this.reset()
  1039. getStorageFeeCalculation(this.approval.billId).then(response => {
  1040. this.fMblnoOptions = []
  1041. if (response.data.corps) {
  1042. this.fMblnoOptions.push(response.data.corps)
  1043. }
  1044. if (response.data.warehouse) {
  1045. this.form = response.data.warehouse
  1046. this.$set(this.form, 'createTime', Date.parse(this.form.createTime))
  1047. this.$set(this.form, 'fBillingDeadline', Date.parse(this.form.fBillingDeadline))
  1048. }
  1049. if (response.data.warehouseItemsList) {
  1050. this.dataList = response.data.warehouseItemsList
  1051. for (let li in this.dataList) {
  1052. this.$set(this.dataList[li], 'fBsdate', Date.parse(this.dataList[li].fBsdate))
  1053. this.$set(this.dataList[li], 'fChargedate', Date.parse(this.dataList[li].fChargedate))
  1054. this.$set(this.dataList[li], 'fBillingDeadline', Date.parse(this.dataList[li].fBillingDeadline))
  1055. this.$set(this.dataList[li], 'fStorageFeeDeadline', Date.parse(this.dataList[li].fStorageFeeDeadline))
  1056. }
  1057. console.log(this.dataList)
  1058. }
  1059. if (response.data.warehouseFeesList) {
  1060. this.warehouseDrList = response.data.warehouseFeesList
  1061. }
  1062. if (response.data.goodsList) {
  1063. this.goodsOptions = response.data.goodsList
  1064. }
  1065. if (response.data.feesList) {
  1066. this.fWbuOptions = response.data.feesList
  1067. }
  1068. this.userOptions = response.data.sysUser;
  1069. this.open = true;
  1070. this.title = "编辑仓储费计算";
  1071. });
  1072. }
  1073. },
  1074. // 审批按钮
  1075. goApproval(){
  1076. this.addOrUpdateVisib = true
  1077. this.$nextTick(() => {
  1078. this.$refs.ApprovalComments.init(this.form.fId,this.actId)
  1079. })
  1080. },
  1081. homePage(){
  1082. this.open = false
  1083. let view = {
  1084. fullPath: "/business/agreement",
  1085. hash: "",
  1086. matched: Array(2),
  1087. meta: Object,
  1088. name: "Agreement",
  1089. params: Object,
  1090. path: "/business/agreement",
  1091. query: Object,
  1092. title: "仓储费"
  1093. }
  1094. this.$router.push({ path: '/index'})
  1095. this.$store.dispatch('tagsView/delView', view).then(({ visitedViews }) => {
  1096. if (this.isActive(view)) {
  1097. this.toLastView(visitedViews, view)
  1098. }
  1099. })
  1100. Global.$emit("removeCache", "closeSelectedTag", view);
  1101. },
  1102. // 查看审批流
  1103. addOrUpdateHandle(){
  1104. this.addOrUpdateVisible = true
  1105. this.addOrUpdateVisib = false
  1106. let id = '448'
  1107. let actId = '110'
  1108. console.log(this.form.fId)
  1109. this.$nextTick(() => {
  1110. this.$refs.addOrUpdate.init(this.form.fId,this.actId)
  1111. })
  1112. },
  1113. returnData(){
  1114. this.addOrUpdateVisib = false
  1115. this.open = false
  1116. this.homepaGe()
  1117. },
  1118. getDataList(){
  1119. this.addOrUpdateVisible = false
  1120. },
  1121. queryUser() {
  1122. queryUserVal().then((response) => {
  1123. if (response.user !== null) {
  1124. this.userVal = response.user;
  1125. this.$set(this.form, "fDeptid", this.userVal.deptId);
  1126. this.$set(this.form, "createBy", this.userVal.userName);
  1127. this.$set(this.form, "fIfdamage", "1");
  1128. this.$set(this.form, "fIfweigh", "1");
  1129. this.$set(this.form, "fTrademodeid", "1");
  1130. this.$set(this.form, "createTime", Date.parse(new Date()));
  1131. }
  1132. if (response.dept !== null) {
  1133. this.deptOptions = [];
  1134. this.deptOptions.push(response.dept);
  1135. }
  1136. });
  1137. },
  1138. /** 查询仓库主(出入库)列表 */
  1139. getList() {
  1140. this.loading = true;
  1141. listStorageFeeCalculation(this.queryParams).then((response) => {
  1142. this.warehousebillsList = response.rows;
  1143. this.$set(this.form, 'createTime', moment(Date.parse(this.warehousebillsList.createTime)).format("YYYY-MM-DD HH:mm:ss"))
  1144. this.total = response.total;
  1145. this.loading = false;
  1146. });
  1147. },
  1148. // 取消按钮
  1149. cancel() {
  1150. this.open = false;
  1151. this.reset();
  1152. this.getList();
  1153. },
  1154. // 计算仓储费
  1155. calculateCost() {
  1156. if (!this.form.fCorpid || !this.form.fBillingDeadline) {
  1157. this.$message({message: '请维护货权方以及,仓储费计算截止日期', type: 'warning'})
  1158. return false
  1159. }
  1160. if (this.dataList.length !== 0) {
  1161. this.$confirm(`仓储费已经存在,确定要删除重新计算吗?`, '提示', {
  1162. confirmButtonText: '确定',
  1163. cancelButtonText: '取消',
  1164. type: 'warning'
  1165. }).then(() => {
  1166. this.getStorageFee()
  1167. }).catch(() => {
  1168. return false
  1169. })
  1170. } else {
  1171. this.getStorageFee()
  1172. }
  1173. },
  1174. // 添加费用新行
  1175. // 收款信息
  1176. addCollection() {
  1177. this.warehouseDrList.push({
  1178. fCorpid: null,
  1179. fFeeid: null,
  1180. fFeeunitid: 2,
  1181. fQty: 0,
  1182. fUnitprice: 0,
  1183. fAmount: 0,
  1184. fCurrency: "RMB",
  1185. fExrate: "1",
  1186. fTaxrate: this.fTaxrate,
  1187. fCxrate: "1",
  1188. fRate: null,
  1189. remark: null,
  1190. });
  1191. },
  1192. getStorageFee () {
  1193. calculateStorageFees(this.form).then((response) => {
  1194. this.dataList = []
  1195. this.warehouseDrList = []
  1196. this.form.fId = response.data.warehouseBills.fId
  1197. this.form.fBillno = response.data.warehouseBills.fBillno
  1198. if (response.data.warehouseFeesList) {
  1199. this.warehouseDrList = response.data.warehouseFeesList
  1200. }
  1201. if (response.data.warehouseItemList) {
  1202. this.dataList = response.data.warehouseItemList
  1203. for (let li in this.dataList) {
  1204. this.$set(this.dataList[li], 'fBsdate', Date.parse(this.dataList[li].fBsdate))
  1205. this.$set(this.dataList[li], 'fChargedate', Date.parse(this.dataList[li].fChargedate))
  1206. this.$set(this.dataList[li], 'fBillingDeadline', Date.parse(this.dataList[li].fBillingDeadline))
  1207. this.$set(this.dataList[li], 'fOriginalbilldate', Date.parse(this.dataList[li].fOriginalbilldate))
  1208. }
  1209. }
  1210. if (response.data.feesList) {
  1211. this.fWbuOptions = response.data.feesList
  1212. }
  1213. });
  1214. },
  1215. /* 远程模糊查询商品 */
  1216. goodsRemoteMethod(name) {
  1217. if (name == null || name === "") {
  1218. return false;
  1219. }
  1220. let queryParams = { pageNum: 1, pageSize: 10, fName: name };
  1221. listGoods(queryParams).then((response) => {
  1222. this.goodsOptions = response.rows;
  1223. });
  1224. },
  1225. // 表单重置
  1226. reset() {
  1227. this.form = {
  1228. fId: null,
  1229. fBillno: null,
  1230. fCustomsdeclartion: null,
  1231. fOriginalbillno: null,
  1232. fDeptid: null,
  1233. fBsdeptid: null,
  1234. fContacts: null,
  1235. fTel: null,
  1236. fCorpid: null,
  1237. fTocorpid: null,
  1238. fStltypeid: null,
  1239. fBscorpno: null,
  1240. fWarehouseid: null,
  1241. fStorekeeper: null,
  1242. fBsdate: null,
  1243. fPlanqty: null,
  1244. fPlangrossweight: null,
  1245. fPlannetweight: null,
  1246. fPlanvolumn: null,
  1247. fQty: null,
  1248. fGrossweight: null,
  1249. fNetweight: null,
  1250. fVolumn: null,
  1251. fTrademodeid: null,
  1252. fSbu: null,
  1253. fFeetunit: null,
  1254. fMblno: null,
  1255. fVslvoy: null,
  1256. fEta: null,
  1257. fCustomno: null,
  1258. fIfweigh: null,
  1259. fIfpledge: null,
  1260. fIfdamage: null,
  1261. fBankcorpid: null,
  1262. fBilltype: null,
  1263. fBillstatus: null,
  1264. delFlag: null,
  1265. createBy: null,
  1266. createTime: null,
  1267. updateBy: null,
  1268. updateTime: null,
  1269. remark: null,
  1270. fCreateby: null,
  1271. fCreatetime: null,
  1272. fGoodsid: null,
  1273. fCntrtype: null,
  1274. fCntqty: null,
  1275. };
  1276. this.deptOptions = [];
  1277. this.userOptions = [];
  1278. this.fWbuOptions = [];
  1279. this.fMblnoOptions = [];
  1280. this.resetForm("form");
  1281. },
  1282. /** 搜索按钮操作 */
  1283. handleQuery() {
  1284. this.queryParams.pageNum = 1;
  1285. this.getList();
  1286. },
  1287. /** 重置按钮操作 */
  1288. resetQuery() {
  1289. this.resetForm("queryForm");
  1290. this.handleQuery();
  1291. },
  1292. // 多选框选中数据
  1293. handleSelectionChange(selection) {
  1294. this.ids = selection;
  1295. // this.ids = selection.map((item) => item.fId);
  1296. this.single = selection.length !== 1;
  1297. this.multiple = !selection.length;
  1298. },
  1299. /** 新增按钮操作 */
  1300. handleAdd(status) {
  1301. this.browseStatus = status;
  1302. this.reset();
  1303. this.queryUser();
  1304. this.open = true;
  1305. this.dataList = [];
  1306. this.warehouseCrList = [];
  1307. this.warehouseDrList = [];
  1308. this.relevantAttachments = [];
  1309. this.title = "出库单";
  1310. },
  1311. /** 修改按钮操作 */
  1312. handleUpdate(row, status) {
  1313. this.notChange = true
  1314. this.browseStatus = status;
  1315. this.reset();
  1316. let data = row || this.ids;
  1317. getStorageFeeCalculation(data.fId).then((response) => {
  1318. this.fMblnoOptions = []
  1319. if (response.data.corps) {
  1320. this.fMblnoOptions.push(response.data.corps)
  1321. }
  1322. if (response.data.warehouse) {
  1323. this.form = response.data.warehouse
  1324. this.$set(this.form, 'createTime', Date.parse(this.form.createTime))
  1325. this.$set(this.form, 'fBillingDeadline', Date.parse(this.form.fBillingDeadline))
  1326. }
  1327. if (response.data.warehouseItemsList) {
  1328. this.dataList = response.data.warehouseItemsList
  1329. for (let li in this.dataList) {
  1330. this.$set(this.dataList[li], 'fBsdate', Date.parse(this.dataList[li].fBsdate))
  1331. this.$set(this.dataList[li], 'fChargedate', Date.parse(this.dataList[li].fChargedate))
  1332. this.$set(this.dataList[li], 'fBillingDeadline', Date.parse(this.dataList[li].fBillingDeadline))
  1333. this.$set(this.dataList[li], 'fStorageFeeDeadline', Date.parse(this.dataList[li].fStorageFeeDeadline))
  1334. }
  1335. console.log(this.dataList)
  1336. }
  1337. if (response.data.warehouseFeesList) {
  1338. this.warehouseDrList = response.data.warehouseFeesList
  1339. }
  1340. if (response.data.goodsList) {
  1341. this.goodsOptions = response.data.goodsList
  1342. }
  1343. if (response.data.feesList) {
  1344. this.fWbuOptions = response.data.feesList
  1345. }
  1346. this.userOptions = response.data.sysUser;
  1347. this.open = true;
  1348. this.title = "编辑仓储费计算";
  1349. });
  1350. },
  1351. changeEstmateAmt(row) {
  1352. let fQty = 0
  1353. let fUnitprice = 0
  1354. if (row.fUnitprice && row.fUnitprice !== "") {
  1355. fUnitprice = row.fUnitprice
  1356. }
  1357. if (row.fQty && row.fQty !== "") {
  1358. fQty = row.fQty
  1359. }
  1360. this.$set(row, "fAmount", Number(fUnitprice) * Number(fQty)).toFixed(2);
  1361. },
  1362. changefBsdate(row) {
  1363. if (this.dataList.length > 0) {
  1364. for (var i = 0; i < this.dataList.length; i++) {
  1365. this.$set(this.dataList[i], "fBsdate", row);
  1366. }
  1367. }
  1368. },
  1369. // 合计
  1370. getSummaries(param) {
  1371. const {columns, data} = param;
  1372. const sums = [];
  1373. var values = [];
  1374. columns.forEach((column, index) => {
  1375. if (index === 0) {
  1376. sums[index] = "合计";
  1377. return;
  1378. }
  1379. if (column.property === "fBillingQty") {
  1380. values = data.map((item) => Number(item["fBillingQty"]));
  1381. }
  1382. if (column.property === "fAmt") {
  1383. values = data.map((item) => Number(item["fAmt"]));
  1384. }
  1385. // const values = data.map(item => Number(item[column.property]))
  1386. if (column.property === "fBillingQty" || column.property === "fAmt") {
  1387. sums[index] = values.reduce((prev, curr) => {
  1388. const value = Number(curr);
  1389. if (!isNaN(value)) {
  1390. return prev + curr;
  1391. } else {
  1392. return prev;
  1393. }
  1394. }, 0);
  1395. sums[index] = sums[index].toFixed(2)
  1396. } else {
  1397. sums[index] = '-'
  1398. }
  1399. });
  1400. return sums;
  1401. },
  1402. // 付款合计
  1403. warehouseDrSummaries(param) {
  1404. const {columns, data} = param;
  1405. const sums = [];
  1406. columns.forEach((column, index) => {
  1407. if (index === 0) {
  1408. sums[index] = "合计";
  1409. return;
  1410. }
  1411. const values = data.map((item) => Number(item[column.property]));
  1412. if (column.property === "fAmount") {
  1413. sums[index] = values.reduce((prev, curr) => {
  1414. const value = Number(curr);
  1415. if (!isNaN(value)) {
  1416. return prev + curr;
  1417. } else {
  1418. return prev;
  1419. }
  1420. }, 0); // sums[index]
  1421. sums[index] = sums[index].toFixed(2)
  1422. } else {
  1423. sums[index] = '-'
  1424. }
  1425. });
  1426. return sums;
  1427. },
  1428. /** 删除按钮操作 */
  1429. handleDelete(row) {
  1430. const fIds = row.fId || this.ids.fId;
  1431. this.$confirm(
  1432. '是否确认删除仓库主(出入库)编号为"' + fIds + '"的数据项?',
  1433. "警告",
  1434. {
  1435. confirmButtonText: "确定",
  1436. cancelButtonText: "取消",
  1437. type: "warning",
  1438. }
  1439. )
  1440. .then(function () {
  1441. return delStorageFeeCalculation(fIds);
  1442. })
  1443. .then(() => {
  1444. this.getList();
  1445. this.msgSuccess("删除成功");
  1446. });
  1447. },
  1448. /** 导出按钮操作 */
  1449. handleExport() {
  1450. const queryParams = this.queryParams;
  1451. this.$confirm("是否确认导出所有仓库主(出入库)数据项?", "警告", {
  1452. confirmButtonText: "确定",
  1453. cancelButtonText: "取消",
  1454. type: "warning",
  1455. })
  1456. .then(function () {
  1457. return exportWarehousebills(queryParams);
  1458. })
  1459. .then((response) => {
  1460. this.download(response.msg);
  1461. });
  1462. },
  1463. deleteRow(index, rows) {
  1464. rows.splice(index, 1);
  1465. },
  1466. /* 远程模糊查询用户 */
  1467. corpsRemoteMethod(name) {
  1468. if (name == null || name === "") {
  1469. return false;
  1470. }
  1471. let queryParams = {pageNum: 1, pageSize: 10, fName: name};
  1472. listCorps(queryParams).then((response) => {
  1473. this.fMblnoOptions = response.rows;
  1474. });
  1475. },
  1476. // 远程模糊查询费用名称
  1477. fWRemoteMethod(name) {
  1478. if (name == null || name === "") {
  1479. return false;
  1480. }
  1481. let queryParams = {pageNum: 1, pageSize: 10, fName: name};
  1482. listFees(queryParams).then((response) => {
  1483. this.fWbuOptions = response.rows;
  1484. });
  1485. },
  1486. /* 远程模糊查询操作用户 */
  1487. userRemoteMethod(name) {
  1488. if (name == null || name === "") {
  1489. return false;
  1490. }
  1491. let queryParams = {pageNum: 1, pageSize: 10, userName: name};
  1492. listUser(queryParams).then((response) => {
  1493. this.userOptions = response.rows;
  1494. });
  1495. },
  1496. /** 提交按钮 */
  1497. submitForm(status) {
  1498. this.$refs["form"].validate((valid) => {
  1499. if (valid) {
  1500. if (status !== 2) {
  1501. if (this.dataList.length === 0) {
  1502. this.$message.error("请维护计费物资明细!");
  1503. return false;
  1504. }
  1505. if (this.warehouseDrList.length === 0) {
  1506. this.$message.error("请维护应收款明细!");
  1507. return false;
  1508. }
  1509. }
  1510. if (!this.form.fCorpid) {
  1511. this.$message({message: '请维护货权方', type: 'warning'})
  1512. return false
  1513. }
  1514. if (!this.form.fBillingDeadline) {
  1515. this.$message({message: '请维护仓储费计算截止日期', type: 'warning'})
  1516. return false
  1517. }
  1518. if (this.form.fBillstatus !== 6) {
  1519. this.form.fBillstatus = status
  1520. }
  1521. let formData = new window.FormData();
  1522. formData.append("warehouseBills", JSON.stringify(this.form));
  1523. formData.append("warehouseItems", JSON.stringify(this.dataList));
  1524. formData.append("warehouseFees", JSON.stringify(this.warehouseDrList));
  1525. addStorageFeeCalculation(formData).then((response) => {
  1526. this.msgSuccess("操作成功");
  1527. if (status !== 2) {
  1528. this.open = false;
  1529. this.getList();
  1530. }
  1531. })
  1532. }
  1533. });
  1534. }
  1535. }
  1536. };
  1537. </script>
  1538. <style lang="scss">
  1539. .juzhong > th {
  1540. text-align: center;
  1541. }
  1542. .biaoge > tr > td {
  1543. height: 30px;
  1544. text-align: center;
  1545. border-right: 1px solid #dfe6ec !important;
  1546. order-bottom: 1px solid #dfe6ec !important;
  1547. border-bottom: 1px solid #dfe6ec !important;
  1548. }
  1549. .el-table thead th {
  1550. background: #1890ff;
  1551. color: #fff;
  1552. }
  1553. .upload-demo {
  1554. margin-left: 50px;
  1555. }
  1556. .el-form-item {
  1557. margin-bottom: 5px !important;
  1558. }
  1559. .el-form-item__label {
  1560. font-size: 12px !important;
  1561. }
  1562. </style>