index.vue 50 KB

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