index.vue 43 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400
  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:warehousebills: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:warehousebills: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:warehousebills: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:warehousebills: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:warehousebills: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="fCorpid"
  173. />
  174. <el-table-column label="提单号" align="center" prop="fMblno"/>
  175. <el-table-column
  176. label="唛头"
  177. align="center"
  178. prop="fMarks"
  179. />
  180. <el-table-column
  181. label="出库日期"
  182. align="center"
  183. prop="createTime"
  184. width="180"
  185. >
  186. <template slot-scope="scope">
  187. <span>{{ parseTime(scope.row.fBsdate, "{y}-{m}-{d}") }}</span>
  188. </template>
  189. </el-table-column>
  190. <el-table-column label="仓库" align="center" prop="fWarehouseid"/>
  191. <el-table-column label="出库件数" align="center" prop="fQty"/>
  192. <!-- <el-table-column label="入库毛重" align="center" prop="fGrossweight"/>-->
  193. <!-- <el-table-column label="货转客户名称" align="center" prop="fTocorpid" /> -->
  194. <el-table-column label="出库毛重" align="center" prop="fGrossweight"/>
  195. <el-table-column label="净重" align="center" prop="fNetweight"/>
  196. <el-table-column
  197. width="100"
  198. label="入库状态"
  199. align="center"
  200. prop="fItemsStatus">
  201. <template slot-scope="scope">
  202. <span v-if="scope.row.fItemsStatus === '1'">未入账</span>
  203. <span v-if="scope.row.fItemsStatus === '2'">部分入账</span>
  204. <span v-if="scope.row.fItemsStatus === '6'">全部入账</span>
  205. </template>
  206. </el-table-column>
  207. <el-table-column
  208. width="100"
  209. label="费用状态"
  210. align="center"
  211. prop="fBillstatus">
  212. <template slot-scope="scope">
  213. <span v-if="scope.row.fBillstatus === '1'">录入</span>
  214. <span v-if="scope.row.fBillstatus === '2'">录入</span>
  215. <span v-if="scope.row.fBillstatus === '3'">驳回</span>
  216. <span v-if="scope.row.fBillstatus === '4'">请核</span>
  217. <span v-if="scope.row.fBillstatus === '5'">审核中</span>
  218. <span v-if="scope.row.fBillstatus === '6'">全部入账</span>
  219. </template>
  220. </el-table-column>
  221. <el-table-column
  222. label="操作"
  223. align="center"
  224. class-name="small-padding fixed-width"
  225. width="180"
  226. >
  227. <template slot-scope="scope">
  228. <el-button
  229. size="mini"
  230. type="text"
  231. icon="el-icon-edit"
  232. v-if="scope.row.fBillstatus === '6'"
  233. @click="handleUpdate(scope.row, true)"
  234. v-hasPermi="['warehouseBusiness:warehousebills:edit']"
  235. >查看
  236. </el-button>
  237. <el-button
  238. size="mini"
  239. type="text"
  240. icon="el-icon-edit"
  241. @click="handleUpdate(scope.row, false)"
  242. v-hasPermi="['warehouseBusiness:warehousebills:edit']"
  243. >修改
  244. </el-button>
  245. <el-button
  246. size="mini"
  247. type="text"
  248. icon="el-icon-delete"
  249. @click="handleDelete(scope.row)"
  250. v-hasPermi="['warehouseBusiness:warehousebills:remove']"
  251. >删除
  252. </el-button>
  253. </template>
  254. </el-table-column>
  255. </el-table>
  256. <pagination
  257. v-show="total > 0"
  258. :total="total"
  259. :page.sync="queryParams.pageNum"
  260. :limit.sync="queryParams.pageSize"
  261. @pagination="getList"
  262. />
  263. <!-- 新增或修改仓储费计算对话框 -->
  264. <el-dialog
  265. :visible.sync="open"
  266. :close-on-click-modal="false"
  267. width="80%"
  268. append-to-body
  269. >
  270. <el-form ref="form" :model="form" :rules="rules" label-width="120px">
  271. <el-row>
  272. <el-col :span="5">
  273. <el-form-item label="客户名称" prop="fCorpid">
  274. <el-select
  275. v-model="form.fCorpid"
  276. filterable
  277. remote
  278. :disabled="browseStatus"
  279. style="width: 80%"
  280. :remote-method="corpsRemoteMethod"
  281. placeholder="请输入模糊查找"
  282. >
  283. <el-option
  284. v-for="(dict, index) in fMblnoOptions"
  285. :key="index.fId"
  286. :label="dict.fName"
  287. :value="dict.fId"
  288. ></el-option>
  289. </el-select>
  290. </el-form-item>
  291. </el-col>
  292. <el-col :span="5">
  293. <el-form-item label="货品名称" prop="fGoodsid">
  294. <el-select
  295. v-model="form.fGoodsid"
  296. filterable
  297. :disabled="browseStatus"
  298. remote
  299. :remote-method="goodsRemoteMethod"
  300. placeholder="请选择品名"
  301. >
  302. <el-option
  303. v-for="(dict, index) in goodsOptions"
  304. :key="index.fId"
  305. :label="dict.fName"
  306. :value="dict.fId"
  307. ></el-option>
  308. </el-select>
  309. </el-form-item>
  310. </el-col>
  311. <el-col :span="5">
  312. <el-form-item label="提单号" prop="fMblno">
  313. <el-input
  314. v-model="form.fMblno"
  315. style="width: 80%"
  316. :disabled="browseStatus"
  317. placeholder="手工输入"
  318. />
  319. </el-form-item>
  320. </el-col>
  321. <el-col :span="5">
  322. <el-form-item disabled label="仓储费截止日期" prop="fBillingDeadline">
  323. <el-date-picker
  324. v-model="form.fBillingDeadline"
  325. size="large"
  326. type="date"
  327. :disabled="browseStatus"
  328. value-format="timestamp"
  329. placeholder="仓储费计算截止日期"
  330. >
  331. </el-date-picker>
  332. </el-form-item>
  333. </el-col>
  334. </el-row>
  335. <el-row>
  336. <el-col :span="5">
  337. <el-form-item label="制单人" prop="createBy">
  338. <el-input
  339. disabled
  340. v-model="form.createBy"
  341. style="width: 80%"
  342. placeholder="制单人"
  343. />
  344. </el-form-item>
  345. </el-col>
  346. <el-col :span="5">
  347. <el-form-item disabled label="制单日期" prop="fbilldate">
  348. <el-date-picker
  349. v-model="form.createTime"
  350. size="large"
  351. type="date"
  352. disabled
  353. value-format="timestamp"
  354. placeholder="制单日期"
  355. >
  356. </el-date-picker>
  357. </el-form-item>
  358. </el-col>
  359. </el-row>
  360. </el-form>
  361. <div style="font-size:18px">
  362. 计费物资明细
  363. <el-button @click="calculateCost">计算仓储费</el-button>
  364. </div>
  365. <div class="dialogTableTitle flex a-center jlr"
  366. style="display:flex;justify-content:space-between;align-items:center;margin: 10px 0;">
  367. <el-table
  368. :data="dataList"
  369. ref="tableList"
  370. tooltip-effect="dark"
  371. border
  372. stripe
  373. :summary-method="getSummaries"
  374. show-summary
  375. >
  376. <el-table-column label="序号" type="index" width="80">
  377. </el-table-column>
  378. <el-table-column
  379. prop="fBilltype"
  380. header-align="center"
  381. align="center"
  382. width="140px"
  383. label="业务来源"
  384. >
  385. <template slot-scope="scope">
  386. <el-select
  387. v-model="scope.row.fBilltype"
  388. filterable
  389. disabled
  390. remote
  391. placeholder="业务来源"
  392. >
  393. <el-option
  394. v-for="(dict, index) in billtypeOptions"
  395. :key="index.fId"
  396. :label="dict.fName"
  397. :value="dict.fId"
  398. ></el-option>
  399. </el-select>
  400. </template>
  401. </el-table-column>
  402. <el-table-column
  403. prop="fBillno"
  404. header-align="center"
  405. align="center"
  406. width="140px"
  407. label="业务单号"
  408. >
  409. </el-table-column>
  410. <el-table-column
  411. prop="fGoodsid"
  412. header-align="center"
  413. align="center"
  414. width="140px"
  415. label="货物名称"
  416. >
  417. <template slot-scope="scope">
  418. <el-select
  419. v-model="scope.row.fGoodsid"
  420. filterable
  421. disabled
  422. remote
  423. placeholder="请选择品名"
  424. >
  425. <el-option
  426. v-for="(dict, index) in goodsOptions"
  427. :key="index.fId"
  428. :label="dict.fName"
  429. :value="dict.fId"
  430. ></el-option>
  431. </el-select>
  432. </template>
  433. </el-table-column>
  434. <el-table-column
  435. prop="fBsdate"
  436. header-align="center"
  437. align="center"
  438. width="140px"
  439. label="业务日期"
  440. >
  441. <template slot-scope="scope">
  442. <el-date-picker
  443. v-model="scope.row.fBsdate"
  444. size="large"
  445. type="date"
  446. disabled
  447. value-format="timestamp"
  448. placeholder="业务日期"
  449. >
  450. </el-date-picker>
  451. </template>
  452. </el-table-column>
  453. <el-table-column
  454. prop="fBillingway"
  455. header-align="center"
  456. align="center"
  457. width="180px"
  458. label="计费单位"
  459. >
  460. <template slot-scope="scope">
  461. <el-select
  462. v-model="scope.row.fBillingway"
  463. placeholder="请选择计费单位"
  464. disabled
  465. clearable
  466. >
  467. <el-option
  468. v-for="dict in fFeetunitOptions"
  469. :key="dict.dictValue"
  470. :label="dict.dictLabel"
  471. :value="dict.dictValue"
  472. />
  473. </el-select>
  474. </template>
  475. </el-table-column>
  476. <el-table-column
  477. prop="fBillingQty"
  478. header-align="center"
  479. align="center"
  480. width="140px"
  481. label="计费数量"
  482. >
  483. </el-table-column>
  484. <el-table-column
  485. prop="fChargedate"
  486. header-align="center"
  487. align="center"
  488. width="140px"
  489. label="计费起始日期"
  490. >
  491. <template slot-scope="scope">
  492. <el-date-picker
  493. v-model="scope.row.fChargedate"
  494. size="large"
  495. type="date"
  496. disabled
  497. value-format="timestamp"
  498. placeholder="计费起始日期"
  499. >
  500. </el-date-picker>
  501. </template>
  502. </el-table-column>
  503. <el-table-column
  504. prop="fBillingDeadline"
  505. header-align="center"
  506. align="center"
  507. width="140px"
  508. label="计费截止日期"
  509. >
  510. <template slot-scope="scope">
  511. <el-date-picker
  512. v-model="scope.row.fBillingDeadline"
  513. size="large"
  514. type="date"
  515. disabled
  516. value-format="timestamp"
  517. placeholder="计费截止日期"
  518. >
  519. </el-date-picker>
  520. </template>
  521. </el-table-column>
  522. <el-table-column
  523. prop="fBillingDays"
  524. header-align="center"
  525. align="center"
  526. width="140px"
  527. label="计费天数"
  528. >
  529. </el-table-column>
  530. <el-table-column
  531. prop="fAmt"
  532. header-align="center"
  533. align="center"
  534. width="140px"
  535. label="计费金额"
  536. >
  537. </el-table-column>
  538. <el-table-column
  539. prop="remark"
  540. header-align="center"
  541. width="150px"
  542. align="center"
  543. label="备注"
  544. >
  545. <template slot-scope="scope">
  546. <el-input
  547. v-model="scope.row.remark"
  548. placeholder="备注"
  549. :disabled="browseStatus"
  550. show-word-limit
  551. />
  552. </template>
  553. </el-table-column>
  554. </el-table>
  555. </div>
  556. <div style="font-size:18px">应收款明细</div>
  557. <div class="dialogTableTitle flex a-center jlr"
  558. style="display:flex;justify-content:space-between;align-items:center;margin: 10px 0;">
  559. <el-table
  560. :data="warehouseDrList"
  561. ref="table"
  562. tooltip-effect="dark"
  563. border
  564. stripe
  565. show-summary
  566. :summary-method="warehouseDrSummaries"
  567. >
  568. <el-table-column label="序号" type="index" width="80">
  569. </el-table-column>
  570. <el-table-column
  571. prop="fCorpid"
  572. header-align="center"
  573. align="center"
  574. width="180px"
  575. label="客户名称"
  576. >
  577. <template slot-scope="scope">
  578. <el-select
  579. v-model="scope.row.fCorpid"
  580. filterable
  581. remote
  582. :disabled="browseStatus"
  583. :remote-method="corpsRemoteMethod"
  584. placeholder="客户名称"
  585. >
  586. <el-option
  587. v-for="(dict, index) in fMblnoOptions"
  588. :key="index.fId"
  589. :label="dict.fName"
  590. :value="dict.fId"
  591. ></el-option>
  592. </el-select>
  593. </template>
  594. </el-table-column>
  595. <el-table-column
  596. prop="fFeeid"
  597. header-align="center"
  598. align="center"
  599. width="180px"
  600. label="费用名称"
  601. >
  602. <template slot-scope="scope">
  603. <el-select
  604. v-model="scope.row.fFeeid"
  605. filterable
  606. remote
  607. :disabled="browseStatus"
  608. :remote-method="fWRemoteMethod"
  609. placeholder="费用名称"
  610. >
  611. <el-option
  612. v-for="dict in fWbuOptions"
  613. :key="dict.fId"
  614. :label="dict.fName"
  615. :value="dict.fId"
  616. ></el-option>
  617. </el-select>
  618. </template>
  619. </el-table-column>
  620. <el-table-column
  621. prop="fFeeunitid"
  622. header-align="center"
  623. align="center"
  624. width="180px"
  625. label="计价单位"
  626. >
  627. <template slot-scope="scope">
  628. <el-select
  629. v-model="scope.row.fFeeunitid"
  630. placeholder="请选择计价单位"
  631. :disabled="browseStatus"
  632. clearable
  633. >
  634. <el-option
  635. v-for="dict in fFeetunitOptions"
  636. :key="dict.dictValue"
  637. :label="dict.dictLabel"
  638. :value="dict.dictValue"
  639. />
  640. </el-select>
  641. </template>
  642. </el-table-column>
  643. <el-table-column
  644. prop="fQty"
  645. header-align="center"
  646. align="center"
  647. width="150px"
  648. label="数量"
  649. >
  650. <template slot-scope="scope">
  651. <el-input
  652. oninput='this.value=this.value.replace(/[^\-?\d.]/g,"").replace(/^(\-)*(\d+)\.(\d\d\d\d).*$/, "$1$2.$3")'
  653. v-model="scope.row.fQty"
  654. @change="changeEstmateAmt(scope.row)"
  655. :disabled="browseStatus"
  656. placeholder="数量"
  657. show-word-limit
  658. />
  659. </template>
  660. </el-table-column>
  661. <el-table-column
  662. prop="funitprice"
  663. header-align="center"
  664. align="center"
  665. width="150px"
  666. label="单价"
  667. >
  668. <template slot-scope="scope">
  669. <el-input
  670. oninput='this.value=this.value.replace(/[^\-?\d.]/g,"").replace(/^(\-)*(\d+)\.(\d\d).*$/, "$1$2.$3")'
  671. v-model="scope.row.fUnitprice"
  672. @change="changeContractAmt(scope.row)"
  673. :disabled="browseStatus"
  674. placeholder="单价"
  675. show-word-limit
  676. />
  677. </template>
  678. </el-table-column>
  679. <el-table-column
  680. prop="fAmount"
  681. header-align="center"
  682. align="center"
  683. width="150px"
  684. label="金额"
  685. >
  686. <template slot-scope="scope">
  687. <el-input
  688. disabled
  689. oninput='this.value=this.value.replace(/[^\-?\d.]/g,"").replace(/^(\-)*(\d+)\.(\d\d).*$/, "$1$2.$3")'
  690. v-model="scope.row.fAmount"
  691. placeholder="金额"
  692. show-word-limit
  693. />
  694. </template>
  695. </el-table-column>
  696. <el-table-column
  697. prop="fCurrency"
  698. header-align="center"
  699. align="center"
  700. width="150px"
  701. label="币别"
  702. >
  703. <template slot-scope="scope">
  704. <el-input
  705. v-model="scope.row.fCurrency"
  706. :disabled="browseStatus"
  707. placeholder="币别"
  708. show-word-limit
  709. />
  710. </template>
  711. </el-table-column>
  712. <el-table-column
  713. prop="fExrate"
  714. header-align="center"
  715. align="center"
  716. width="150px"
  717. label="汇率"
  718. >
  719. <template slot-scope="scope">
  720. <el-input
  721. v-model="scope.row.fExrate"
  722. :disabled="browseStatus"
  723. placeholder="汇率"
  724. show-word-limit
  725. />
  726. </template>
  727. </el-table-column>
  728. <el-table-column
  729. prop="fTaxrate"
  730. header-align="center"
  731. align="center"
  732. width="150px"
  733. label="税率"
  734. >
  735. <template slot-scope="scope">
  736. <el-input
  737. v-model="scope.row.fTaxrate"
  738. :disabled="browseStatus"
  739. placeholder="税率"
  740. show-word-limit
  741. />
  742. </template>
  743. </el-table-column>
  744. <el-table-column
  745. prop="remarks"
  746. header-align="center"
  747. align="center"
  748. width="150px"
  749. label="备注"
  750. >
  751. <template slot-scope="scope">
  752. <el-input
  753. v-model="scope.row.remarks"
  754. :disabled="browseStatus"
  755. placeholder="备注"
  756. show-word-limit
  757. />
  758. </template>
  759. </el-table-column>
  760. <el-table-column
  761. header-align="center"
  762. align="center"
  763. width="200px"
  764. label="操作"
  765. >
  766. <template slot-scope="scope">
  767. <el-button size="small">审核费用</el-button>
  768. <el-button
  769. @click.native.prevent="deleteRow(scope.$index, warehouseDrList)"
  770. size="small"
  771. >移除
  772. </el-button
  773. >
  774. </template>
  775. </el-table-column>
  776. </el-table>
  777. </div>
  778. <div slot="footer" class="dialog-footer">
  779. <el-button type="success" prop="取 消" @click="cancel"
  780. >取 消
  781. </el-button>
  782. <el-button type="warning" prop="保 存" @click="submitForm(2)"
  783. >保 存
  784. </el-button>
  785. <el-button
  786. :disabled="browseStatus"
  787. style="background-color: #008000; color: #fff"
  788. @click="submitForm(6)"
  789. >请 核</el-button
  790. >
  791. </div>
  792. </el-dialog>
  793. </div>
  794. </template>
  795. <script>
  796. import {
  797. calculateStorageFees,
  798. getStorageFeeCalculation,
  799. delStorageFeeCalculation,
  800. addStorageFeeCalculation,
  801. listStorageFeeCalculation,
  802. updateStorageFeeCalculation,
  803. exportStorageFeeCalculation,
  804. } from "@/api/warehouseBusiness/storageFeeCalculation";
  805. import { listUser, queryUserVal } from "@/api/system/user";
  806. import { listGoods } from "@/api/basicdata/goods";
  807. import { listFees } from "@/api/basicdata/fees";
  808. import { listCorps } from "@/api/basicdata/corps";
  809. export default {
  810. name: "StorageFeeCalculation",
  811. components: {},
  812. data() {
  813. return {
  814. // 遮罩层
  815. loading: true,
  816. // 选中数组
  817. ids: [],
  818. userVal: {
  819. userName: null,
  820. nickName: null,
  821. deptId: null,
  822. },
  823. queryForm: {},
  824. // 库存总账表
  825. whgenlegList: [],
  826. dataList: [],
  827. warehouseDrList: [],
  828. browseStatus: false,
  829. // 非单个禁用
  830. single: true,
  831. // 非多个禁用
  832. multiple: true,
  833. // 显示搜索条件
  834. showSearch: true,
  835. // 总条数
  836. total: 0,
  837. // 仓库主(出入库)表格数据
  838. warehousebillsList: [],
  839. // 弹出层标题
  840. title: "",
  841. // 是否显示弹出层
  842. open: false,
  843. // 货品名
  844. goodsOptions: [],
  845. // 业务来源
  846. billtypeOptions: [{
  847. fId: 'SJRK',
  848. fName: '入库'
  849. }, {
  850. fId: 'SJCK',
  851. fName: '出库'
  852. }, {
  853. fId: 'CKZZ',
  854. fName: '库存总账'
  855. }],
  856. // 货权方(客户数据)
  857. fMblnoOptions: [],
  858. // 操作员
  859. userOptions: [],
  860. // 制单部门
  861. deptOptions: [],
  862. // 计费单位(数据字典),下拉选择毛重或净重字典
  863. fFeetunitOptions: [{
  864. dictLabel: '件数',
  865. dictValue: 1
  866. }, {
  867. dictLabel: '毛重',
  868. dictValue: 2
  869. }, {
  870. dictLabel: '净重',
  871. dictValue: 3
  872. }, {
  873. dictLabel: '尺码',
  874. dictValue: 4
  875. }, {
  876. dictLabel: '固定',
  877. dictValue: 5
  878. }],
  879. // 费用名称
  880. fWbuOptions: [],
  881. // 查询参数
  882. queryParams: {
  883. pageNum: 1,
  884. pageSize: 10,
  885. fBillno: null,
  886. createBy: null,
  887. createTime: null,
  888. fCustomsdeclartion: null,
  889. fOriginalbillno: null,
  890. fDeptid: null,
  891. fBsdeptid: null,
  892. fContacts: null,
  893. fTel: null,
  894. fCorpid: null,
  895. fTocorpid: null,
  896. fStltypeid: null,
  897. fBscorpno: null,
  898. fWarehouseid: null,
  899. fStorekeeper: null,
  900. fBsdate: null,
  901. fPlanqty: null,
  902. fPlangrossweight: null,
  903. fPlannetweight: null,
  904. fPlanvolumn: null,
  905. fQty: null,
  906. fGrossweight: null,
  907. fNetweight: null,
  908. fVolumn: null,
  909. fTrademodeid: null,
  910. fSbu: null,
  911. fFeetunit: null,
  912. fMblno: null,
  913. fVslvoy: null,
  914. fEta: null,
  915. fCustomno: null,
  916. fIfweigh: null,
  917. fIfpledge: null,
  918. fIfdamage: null,
  919. fBankcorpid: null,
  920. fBilltype: null,
  921. fBillstatus: null,
  922. fCreateby: null,
  923. fCreatetime: null,
  924. fGoodsid: null,
  925. fCntrtype: null,
  926. fCntqty: null,
  927. },
  928. // 表单参数
  929. form: {},
  930. // 表单校验
  931. rules: {
  932. fCorpid: [{required: true, message: " ", trigger: "blur",}],
  933. fBillingDeadline: [{required: true, message: " ", trigger: "blur",}]
  934. }
  935. };
  936. },
  937. created() {
  938. this.getList();
  939. },
  940. methods: {
  941. queryUser() {
  942. queryUserVal().then((response) => {
  943. if (response.user !== null) {
  944. this.userVal = response.user;
  945. this.$set(this.form, "fDeptid", this.userVal.deptId);
  946. this.$set(this.form, "createBy", this.userVal.userName);
  947. this.$set(this.form, "fIfdamage", "1");
  948. this.$set(this.form, "fIfweigh", "1");
  949. this.$set(this.form, "fTrademodeid", "1");
  950. this.$set(this.form, "createTime", Date.parse(new Date()));
  951. }
  952. if (response.dept !== null) {
  953. this.deptOptions = [];
  954. this.deptOptions.push(response.dept);
  955. }
  956. });
  957. },
  958. /** 查询仓库主(出入库)列表 */
  959. getList() {
  960. this.loading = true;
  961. listStorageFeeCalculation(this.queryParams).then((response) => {
  962. this.warehousebillsList = response.rows;
  963. this.total = response.total;
  964. this.loading = false;
  965. });
  966. },
  967. // 取消按钮
  968. cancel() {
  969. this.open = false;
  970. this.reset();
  971. },
  972. // 计算仓储费
  973. calculateCost() {
  974. if (!this.form.fCorpid || !this.form.fBillingDeadline) {
  975. this.$message({message: '请维护货权方以及,仓储费计算截止日期', type: 'warning'})
  976. return false
  977. }
  978. if (this.dataList.length !== 0) {
  979. this.$confirm(`仓储费已经存在,确定要删除重新计算吗?`, '提示', {
  980. confirmButtonText: '确定',
  981. cancelButtonText: '取消',
  982. type: 'warning'
  983. }).then(() => {
  984. this.getStorageFee()
  985. }).catch(() => {
  986. return false
  987. })
  988. } else {
  989. this.getStorageFee()
  990. }
  991. },
  992. getStorageFee () {
  993. calculateStorageFees(this.form).then((response) => {
  994. this.dataList = []
  995. this.warehouseDrList = []
  996. this.form.fId = response.data.warehouseBills.fId
  997. if (response.data.warehouseFeesList) {
  998. this.warehouseDrList = response.data.warehouseFeesList
  999. }
  1000. if (response.data.warehouseItemList) {
  1001. this.dataList = response.data.warehouseItemList
  1002. for (let li in this.dataList) {
  1003. this.$set(this.dataList[li], 'fBsdate', Date.parse(this.dataList[li].fBsdate))
  1004. this.$set(this.dataList[li], 'fChargedate', Date.parse(this.dataList[li].fChargedate))
  1005. this.$set(this.dataList[li], 'fBillingDeadline', Date.parse(this.dataList[li].fBillingDeadline))
  1006. this.$set(this.dataList[li], 'fOriginalbilldate', Date.parse(this.dataList[li].fOriginalbilldate))
  1007. }
  1008. }
  1009. if (response.data.feesList) {
  1010. this.fWbuOptions = response.data.feesList
  1011. }
  1012. });
  1013. },
  1014. /* 远程模糊查询商品 */
  1015. goodsRemoteMethod(name) {
  1016. if (name == null || name === "") {
  1017. return false;
  1018. }
  1019. let queryParams = { pageNum: 1, pageSize: 10, fName: name };
  1020. listGoods(queryParams).then((response) => {
  1021. this.goodsOptions = response.rows;
  1022. });
  1023. },
  1024. // 表单重置
  1025. reset() {
  1026. this.form = {
  1027. fId: null,
  1028. fBillno: null,
  1029. fCustomsdeclartion: null,
  1030. fOriginalbillno: null,
  1031. fDeptid: null,
  1032. fBsdeptid: null,
  1033. fContacts: null,
  1034. fTel: null,
  1035. fCorpid: null,
  1036. fTocorpid: null,
  1037. fStltypeid: null,
  1038. fBscorpno: null,
  1039. fWarehouseid: null,
  1040. fStorekeeper: null,
  1041. fBsdate: null,
  1042. fPlanqty: null,
  1043. fPlangrossweight: null,
  1044. fPlannetweight: null,
  1045. fPlanvolumn: null,
  1046. fQty: null,
  1047. fGrossweight: null,
  1048. fNetweight: null,
  1049. fVolumn: null,
  1050. fTrademodeid: null,
  1051. fSbu: null,
  1052. fFeetunit: null,
  1053. fMblno: null,
  1054. fVslvoy: null,
  1055. fEta: null,
  1056. fCustomno: null,
  1057. fIfweigh: null,
  1058. fIfpledge: null,
  1059. fIfdamage: null,
  1060. fBankcorpid: null,
  1061. fBilltype: null,
  1062. fBillstatus: null,
  1063. delFlag: null,
  1064. createBy: null,
  1065. createTime: null,
  1066. updateBy: null,
  1067. updateTime: null,
  1068. remark: null,
  1069. fCreateby: null,
  1070. fCreatetime: null,
  1071. fGoodsid: null,
  1072. fCntrtype: null,
  1073. fCntqty: null,
  1074. };
  1075. this.deptOptions = [];
  1076. this.userOptions = [];
  1077. this.fWbuOptions = [];
  1078. this.fMblnoOptions = [];
  1079. this.resetForm("form");
  1080. },
  1081. /** 搜索按钮操作 */
  1082. handleQuery() {
  1083. this.queryParams.pageNum = 1;
  1084. this.getList();
  1085. },
  1086. /** 重置按钮操作 */
  1087. resetQuery() {
  1088. this.resetForm("queryForm");
  1089. this.handleQuery();
  1090. },
  1091. // 多选框选中数据
  1092. handleSelectionChange(selection) {
  1093. this.ids = selection;
  1094. // this.ids = selection.map((item) => item.fId);
  1095. this.single = selection.length !== 1;
  1096. this.multiple = !selection.length;
  1097. },
  1098. /** 新增按钮操作 */
  1099. handleAdd(status) {
  1100. this.browseStatus = status;
  1101. this.reset();
  1102. this.queryUser();
  1103. this.open = true;
  1104. this.dataList = [];
  1105. this.warehouseCrList = [];
  1106. this.warehouseDrList = [];
  1107. this.relevantAttachments = [];
  1108. this.title = "出库单";
  1109. },
  1110. /** 修改按钮操作 */
  1111. handleUpdate(row, status) {
  1112. this.browseStatus = status;
  1113. this.reset();
  1114. let data = row || this.ids;
  1115. getStorageFeeCalculation(data.fId).then((response) => {
  1116. this.fMblnoOptions = []
  1117. if (response.data.corps) {
  1118. this.fMblnoOptions.push(response.data.corps)
  1119. }
  1120. if (response.data.warehouse) {
  1121. this.form = response.data.warehouse
  1122. this.$set(this.form, 'createTime', Date.parse(this.form.createTime))
  1123. this.$set(this.form, 'fBillingDeadline', Date.parse(this.form.fBillingDeadline))
  1124. }
  1125. if (response.data.warehouseItemsList) {
  1126. this.dataList = response.data.warehouseItemsList
  1127. for (let li in this.dataList) {
  1128. this.$set(this.dataList[li], 'fBsdate', Date.parse(this.dataList[li].fBsdate))
  1129. this.$set(this.dataList[li], 'fChargedate', Date.parse(this.dataList[li].fChargedate))
  1130. this.$set(this.dataList[li], 'fStorageFeeDeadline', Date.parse(this.dataList[li].fStorageFeeDeadline))
  1131. }
  1132. }
  1133. if (response.data.warehouseFeesList) {
  1134. this.warehouseDrList = response.data.warehouseFeesList
  1135. }
  1136. if (response.data.goodsList) {
  1137. this.goodsOptions = response.data.goodsList
  1138. }
  1139. if (response.data.feesList) {
  1140. this.fWbuOptions = response.data.feesList
  1141. }
  1142. this.userOptions = response.data.sysUser;
  1143. this.open = true;
  1144. this.title = "编辑仓储费计算";
  1145. });
  1146. },
  1147. // 数量计算
  1148. changeContractAmt(row) {
  1149. if (row.fUnitprice !== "") {
  1150. if (row.fQty !== "") {
  1151. this.$set(row, 'fAmount', Number(row.fUnitprice) * Number(row.fQty)).toFixed(2);
  1152. } else {
  1153. this.$set(row, 'fAmount', row.fUnitprice);
  1154. }
  1155. }
  1156. },
  1157. changeEstmateAmt(row) {
  1158. if (row.fUnitprice !== "") {
  1159. if (row.fQty !== "") {
  1160. this.$set(row, "fAmount", Number(row.fUnitprice) * Number(row.fQty)).toFixed(2);
  1161. } else {
  1162. this.$set(row, "fAmount", row.fUnitprice);
  1163. }
  1164. }
  1165. },
  1166. changefBsdate(row) {
  1167. if (this.dataList.length > 0) {
  1168. for (var i = 0; i < this.dataList.length; i++) {
  1169. this.$set(this.dataList[i], "fBsdate", row);
  1170. }
  1171. }
  1172. },
  1173. // 合计
  1174. getSummaries(param) {
  1175. console.log(param);
  1176. const {columns, data} = param;
  1177. const sums = [];
  1178. var values = [];
  1179. columns.forEach((column, index) => {
  1180. if (index === 0) {
  1181. sums[index] = "合计";
  1182. return;
  1183. }
  1184. if (column.property === "fgrossweight") {
  1185. values = data.map((item) => Number(item["fGrossweight"]));
  1186. }
  1187. if (column.property === "fnetweight") {
  1188. values = data.map((item) => Number(item["fNetweight"]));
  1189. }
  1190. if (column.property === "fqty") {
  1191. values = data.map((item) => Number(item["fQty"]));
  1192. }
  1193. if (column.property === "fCntqty") {
  1194. values = data.map((item) => Number(item["fCntqty"]));
  1195. } // const values = data.map(item => Number(item[column.property]))
  1196. if (
  1197. column.property === "fgrossweight" ||
  1198. column.property === "fnetweight" ||
  1199. column.property === "fqty" ||
  1200. column.property === "fCntqty"
  1201. ) {
  1202. sums[index] = values.reduce((prev, curr) => {
  1203. const value = Number(curr);
  1204. if (!isNaN(value)) {
  1205. if (column.property === "fgrossweight") {
  1206. this.form.fGrossweight = prev + curr;
  1207. this.fGrossweight = prev + curr;
  1208. }
  1209. if (column.property === "fnetweight") {
  1210. this.form.fNetweight = prev + curr;
  1211. this.fNetweight = prev + curr;
  1212. }
  1213. if (column.property === "fqty") {
  1214. this.form.fQty = prev + curr;
  1215. this.fQty = prev + curr;
  1216. }
  1217. if (column.property === "fCntqty") {
  1218. this.fCntqty = prev + curr;
  1219. }
  1220. return prev + curr;
  1221. } else {
  1222. return prev;
  1223. }
  1224. }, 0); // sums[index]
  1225. }
  1226. });
  1227. this.sums = sums;
  1228. return sums;
  1229. },
  1230. // 付款合计
  1231. warehouseDrSummaries(param) {
  1232. const {columns, data} = param;
  1233. const sums = [];
  1234. columns.forEach((column, index) => {
  1235. if (index === 0) {
  1236. sums[index] = "合计";
  1237. return;
  1238. }
  1239. const values = data.map((item) => Number(item[column.property]));
  1240. if (
  1241. column.property === "fUnitprice" ||
  1242. column.property === "fAmount" ||
  1243. column.property === "fQty" ||
  1244. column.property === "fQty"
  1245. ) {
  1246. sums[index] = values.reduce((prev, curr) => {
  1247. const value = Number(curr);
  1248. if (!isNaN(value)) {
  1249. return prev + curr;
  1250. } else {
  1251. return prev;
  1252. }
  1253. }, 0); // sums[index]
  1254. }
  1255. });
  1256. return sums;
  1257. },
  1258. /** 删除按钮操作 */
  1259. handleDelete(row) {
  1260. const fIds = row.fId || this.ids.fId;
  1261. this.$confirm(
  1262. '是否确认删除仓库主(出入库)编号为"' + fIds + '"的数据项?',
  1263. "警告",
  1264. {
  1265. confirmButtonText: "确定",
  1266. cancelButtonText: "取消",
  1267. type: "warning",
  1268. }
  1269. )
  1270. .then(function () {
  1271. return delWarehousebills(fIds);
  1272. })
  1273. .then(() => {
  1274. this.getList();
  1275. this.msgSuccess("删除成功");
  1276. });
  1277. },
  1278. /** 导出按钮操作 */
  1279. handleExport() {
  1280. const queryParams = this.queryParams;
  1281. this.$confirm("是否确认导出所有仓库主(出入库)数据项?", "警告", {
  1282. confirmButtonText: "确定",
  1283. cancelButtonText: "取消",
  1284. type: "warning",
  1285. })
  1286. .then(function () {
  1287. return exportWarehousebills(queryParams);
  1288. })
  1289. .then((response) => {
  1290. this.download(response.msg);
  1291. });
  1292. },
  1293. deleteRow(index, rows) {
  1294. rows.splice(index, 1);
  1295. },
  1296. /* 远程模糊查询用户 */
  1297. corpsRemoteMethod(name) {
  1298. if (name == null || name === "") {
  1299. return false;
  1300. }
  1301. let queryParams = {pageNum: 1, pageSize: 10, fName: name};
  1302. listCorps(queryParams).then((response) => {
  1303. this.fMblnoOptions = response.rows;
  1304. });
  1305. },
  1306. // 远程模糊查询费用名称
  1307. fWRemoteMethod(name) {
  1308. if (name == null || name === "") {
  1309. return false;
  1310. }
  1311. let queryParams = {pageNum: 1, pageSize: 10, fName: name};
  1312. listFees(queryParams).then((response) => {
  1313. this.fWbuOptions = response.rows;
  1314. });
  1315. },
  1316. /* 远程模糊查询操作用户 */
  1317. userRemoteMethod(name) {
  1318. if (name == null || name === "") {
  1319. return false;
  1320. }
  1321. let queryParams = {pageNum: 1, pageSize: 10, userName: name};
  1322. listUser(queryParams).then((response) => {
  1323. this.userOptions = response.rows;
  1324. });
  1325. },
  1326. /** 提交按钮 */
  1327. submitForm(status) {
  1328. this.$refs["form"].validate((valid) => {
  1329. if (valid) {
  1330. if (status !== 2) {
  1331. if (this.dataList.length === 0) {
  1332. this.$message.error("请维护计费物资明细!");
  1333. return false;
  1334. }
  1335. if (this.warehouseDrList.length === 0) {
  1336. this.$message.error("请维护应收款明细!");
  1337. return false;
  1338. }
  1339. }
  1340. if (!this.form.fCorpid) {
  1341. this.$message({message: '请维护货权方', type: 'warning'})
  1342. return false
  1343. }
  1344. if (!this.form.fBillingDeadline) {
  1345. this.$message({message: '请维护仓储费计算截止日期', type: 'warning'})
  1346. return false
  1347. }
  1348. if (!this.form.fBillstatus) {
  1349. this.form.fBillstatus = status
  1350. }
  1351. let formData = new window.FormData();
  1352. formData.append("warehouseBills", JSON.stringify(this.form));
  1353. formData.append("warehouseItems", JSON.stringify(this.dataList));
  1354. formData.append("warehouseFees", JSON.stringify(this.warehouseDrList));
  1355. addStorageFeeCalculation(formData).then((response) => {
  1356. this.msgSuccess("操作成功");
  1357. if (status !== 2) {
  1358. this.open = false;
  1359. this.getList();
  1360. }
  1361. })
  1362. }
  1363. });
  1364. }
  1365. }
  1366. };
  1367. </script>
  1368. <style lang="scss">
  1369. .juzhong > th {
  1370. text-align: center;
  1371. }
  1372. .biaoge > tr > td {
  1373. height: 30px;
  1374. text-align: center;
  1375. border-right: 1px solid #dfe6ec !important;
  1376. order-bottom: 1px solid #dfe6ec !important;
  1377. border-bottom: 1px solid #dfe6ec !important;
  1378. }
  1379. .el-table thead th {
  1380. background: #1890ff;
  1381. color: #fff;
  1382. }
  1383. .upload-demo {
  1384. margin-left: 50px;
  1385. }
  1386. .el-form-item {
  1387. margin-bottom: 5px !important;
  1388. }
  1389. .el-form-item__label {
  1390. font-size: 12px !important;
  1391. }
  1392. </style>