index.vue 43 KB

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