index.vue 57 KB

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