index.vue 56 KB

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