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