index.vue 50 KB

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