index.vue 54 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704
  1. <template>
  2. <!-- 仓储费计算列表 + 弹窗页面 -->
  3. <div class="app-container">
  4. <el-form
  5. :model="queryParams"
  6. ref="queryForm"
  7. :inline="true"
  8. v-show="showSearch"
  9. label-width="88px"
  10. >
  11. <el-form-item label="业务1编号" prop="fBillno">
  12. <el-input
  13. v-model="queryParams.fBillno"
  14. placeholder="请输入业务编号"
  15. clearable
  16. size="small"
  17. @keyup.enter.native="handleQuery"
  18. />
  19. </el-form-item>
  20. <el-form-item label="制单人" prop="createBy">
  21. <el-select
  22. v-model="queryParams.createBy"
  23. filterable
  24. remote
  25. clearable
  26. style="width: 80%"
  27. :remote-method="userRemoteMethod"
  28. placeholder="请选择制单人"
  29. >
  30. <el-option
  31. v-for="(dict, index) in userOptions"
  32. :key="index.userName"
  33. :label="dict.nickName"
  34. :value="dict.userName"
  35. ></el-option>
  36. </el-select>
  37. </el-form-item>
  38. <el-form-item label="出库日期" prop="timeInterval">
  39. <el-date-picker
  40. v-model="queryParams.timeInterval"
  41. type="daterange"
  42. value-format="yyyy-MM-dd"
  43. clearable
  44. range-separator="至"
  45. start-placeholder="开始日期"
  46. end-placeholder="结束日期"
  47. @keyup.enter.native="handleQuery"
  48. >
  49. </el-date-picker>
  50. </el-form-item>
  51. <el-form-item label="货权方" prop="fCorpid">
  52. <el-select
  53. v-model="queryParams.fCorpid"
  54. filterable
  55. remote
  56. clearable
  57. style="width: 80%"
  58. @keyup.enter.native="handleQuery"
  59. :remote-method="corpsRemoteMethod"
  60. placeholder="请选择货权方"
  61. >
  62. <el-option
  63. v-for="(dict, index) in fMblnoOptions"
  64. :key="index.fId"
  65. :label="dict.fName"
  66. :value="dict.fId"
  67. ></el-option>
  68. </el-select>
  69. </el-form-item>
  70. <el-form-item label="提单号" prop="fMblno">
  71. <el-input
  72. v-model="queryParams.fMblno"
  73. placeholder="请输入提单号"
  74. clearable
  75. size="small"
  76. @keyup.enter.native="handleQuery"
  77. />
  78. </el-form-item>
  79. <el-form-item label="唛头" prop="fMarks">
  80. <el-input
  81. v-model="queryParams.fMarks"
  82. placeholder="请输入唛头"
  83. clearable
  84. size="small"
  85. style="width: 80%"
  86. @keyup.enter.native="handleQuery"
  87. />
  88. </el-form-item>
  89. <el-form-item>
  90. <el-button
  91. type="cyan"
  92. icon="el-icon-search"
  93. size="mini"
  94. @click="handleQuery"
  95. >搜索
  96. </el-button>
  97. <el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
  98. >重置
  99. </el-button>
  100. </el-form-item>
  101. </el-form>
  102. <el-row :gutter="10" class="mb8">
  103. <el-col :span="1.5">
  104. <el-button
  105. type="primary"
  106. icon="el-icon-plus"
  107. size="mini"
  108. @click="handleAdd(false)"
  109. v-hasPermi="['warehouseBusiness:storageFeeCalculation:add']"
  110. >新增
  111. </el-button>
  112. </el-col>
  113. <el-col :span="1.5">
  114. <el-button
  115. type="success"
  116. icon="el-icon-edit"
  117. size="mini"
  118. :disabled="single"
  119. @click="handleUpdate"
  120. v-hasPermi="['warehouseBusiness:storageFeeCalculation:edit']"
  121. >修改
  122. </el-button>
  123. </el-col>
  124. <el-col :span="1.5">
  125. <el-button
  126. type="danger"
  127. icon="el-icon-delete"
  128. size="mini"
  129. :disabled="multiple"
  130. @click="handleDelete"
  131. v-hasPermi="['warehouseBusiness:storageFeeCalculation:remove']"
  132. >删除
  133. </el-button>
  134. </el-col>
  135. <el-col :span="1.5">
  136. <el-button
  137. type="warning"
  138. icon="el-icon-download"
  139. size="mini"
  140. @click="handleExport"
  141. v-hasPermi="['warehouseBusiness:storageFeeCalculation:export']"
  142. >导出
  143. </el-button>
  144. </el-col>
  145. <el-col :span="1.5">
  146. <el-button
  147. type="warning"
  148. icon="el-icon-download"
  149. size="mini"
  150. @click="handleExport"
  151. :disabled="multiple"
  152. v-hasPermi="['warehouseBusiness:storageFeeCalculation:export']"
  153. >导入
  154. </el-button>
  155. </el-col>
  156. <right-toolbar
  157. :showSearch.sync="showSearch"
  158. @queryTable="getList"
  159. ></right-toolbar>
  160. </el-row>
  161. <el-table
  162. v-loading="loading"
  163. :data="warehousebillsList"
  164. @selection-change="handleSelectionChange"
  165. >
  166. <el-table-column type="selection" width="55" align="center"/>
  167. <el-table-column type="index" label="行号" align="center"/>
  168. <el-table-column
  169. :show-overflow-tooltip="true"
  170. label="单据编号"
  171. align="center"
  172. prop="fBillno"
  173. />
  174. <el-table-column label="客户名称" align="center" prop="fCorpid" show-overflow-tooltip/>
  175. <el-table-column
  176. label="计费日期"
  177. align="center"
  178. prop="fBillingDeadline"
  179. width="180"
  180. >
  181. <template slot-scope="scope">
  182. <span>{{ parseTime(scope.row.fBillingDeadline, "{y}-{m}-{d}") }}</span>
  183. </template>
  184. </el-table-column>
  185. <el-table-column
  186. label="备注"
  187. align="center"
  188. prop="remark"
  189. />
  190. <el-table-column
  191. label="单据状态"
  192. align="center"
  193. prop="fBillstatus"
  194. >
  195. <template slot-scope="scope">
  196. <span v-if="scope.row.fBillstatus === 1">新建</span>
  197. <span v-if="scope.row.fBillstatus === 2">暂存</span>
  198. <span v-if="scope.row.fBillstatus === 3">审核驳回</span>
  199. <span v-if="scope.row.fBillstatus === 4">提交审核</span>
  200. <span v-if="scope.row.fBillstatus === 5">审核中</span>
  201. <span v-if="scope.row.fBillstatus === 6">审核通过</span>
  202. </template>
  203. </el-table-column>
  204. <el-table-column
  205. label="制单人"
  206. align="center"
  207. prop="createBy"
  208. />
  209. <el-table-column
  210. label="制单日期"
  211. align="center"
  212. prop="createTime"
  213. width="160"
  214. >
  215. <template slot-scope="scope">
  216. {{scope.row.createTime.slice(0, 10)}}
  217. </template>
  218. </el-table-column>
  219. <el-table-column
  220. label="操作"
  221. align="center"
  222. class-name="small-padding fixed-width"
  223. width="180"
  224. >
  225. <template slot-scope="scope">
  226. <el-button
  227. size="mini"
  228. type="text"
  229. icon="el-icon-edit"
  230. @click="handleUpdate_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], 'fBsdate', Date.parse(this.dataList[li].fBsdate))
  1116. this.$set(this.dataList[li], 'fChargedate', Date.parse(this.dataList[li].fChargedate))
  1117. this.$set(this.dataList[li], 'fBillingDeadline', Date.parse(this.dataList[li].fBillingDeadline))
  1118. this.$set(this.dataList[li], 'fStorageFeeDeadline', Date.parse(this.dataList[li].fStorageFeeDeadline))
  1119. }
  1120. }
  1121. if (response.data.warehouseFeesList) {
  1122. this.warehouseDrList = response.data.warehouseFeesList
  1123. for (let dr in this.warehouseDrList) {
  1124. this.$set(this.warehouseDrList[dr], "fFeeunitid", this.warehouseDrList[dr].fFeeunitid + '');
  1125. }
  1126. }
  1127. if (response.data.feesList) {
  1128. this.fWbuOptions = response.data.feesList
  1129. }
  1130. this.userOptions = response.data.sysUser;
  1131. this.open = true;
  1132. this.title = "编辑仓储费计算";
  1133. });
  1134. }
  1135. },
  1136. // 审批按钮
  1137. goApproval(){
  1138. this.addOrUpdateVisib = true
  1139. this.$nextTick(() => {
  1140. this.$refs.ApprovalComments.init(this.form.fId,this.actId)
  1141. })
  1142. },
  1143. homePage(){
  1144. this.open = false
  1145. let view = {
  1146. fullPath: "/business/agreement",
  1147. hash: "",
  1148. matched: Array(2),
  1149. meta: Object,
  1150. name: "Agreement",
  1151. params: Object,
  1152. path: "/business/agreement",
  1153. query: Object,
  1154. title: "仓储费"
  1155. }
  1156. this.$router.push({ path: '/index'})
  1157. this.$store.dispatch('tagsView/delView', view).then(({ visitedViews }) => {
  1158. if (this.isActive(view)) {
  1159. this.toLastView(visitedViews, view)
  1160. }
  1161. })
  1162. Global.$emit("removeCache", "closeSelectedTag", view);
  1163. },
  1164. // 查看审批流
  1165. addOrUpdateHandle(){
  1166. this.addOrUpdateVisible = true
  1167. this.addOrUpdateVisib = false
  1168. let id = '448'
  1169. let actId = '110'
  1170. this.$nextTick(() => {
  1171. this.$refs.addOrUpdate.init(this.form.fId,this.actId)
  1172. })
  1173. },
  1174. returnData(){
  1175. this.addOrUpdateVisib = false
  1176. this.open = false
  1177. this.homepaGe()
  1178. },
  1179. getDataList(){
  1180. this.addOrUpdateVisible = false
  1181. },
  1182. queryUser() {
  1183. queryUserVal().then((response) => {
  1184. if (response.user !== null) {
  1185. this.userVal = response.user;
  1186. this.$set(this.form, "fDeptid", this.userVal.deptId);
  1187. this.$set(this.form, "createBy", this.userVal.userName);
  1188. this.$set(this.form, "fIfdamage", "1");
  1189. this.$set(this.form, "fIfweigh", "1");
  1190. this.$set(this.form, "fTrademodeid", "1");
  1191. this.$set(this.form, "createTime", Date.parse(new Date()));
  1192. }
  1193. if (response.dept !== null) {
  1194. this.deptOptions = [];
  1195. this.deptOptions.push(response.dept);
  1196. }
  1197. });
  1198. },
  1199. /** 查询仓库主(出入库)列表 */
  1200. getList() {
  1201. this.loading = true;
  1202. listStorageFeeCalculation(this.queryParams).then((response) => {
  1203. this.warehousebillsList = response.rows;
  1204. this.$set(this.form, 'createTime', moment(Date.parse(this.warehousebillsList.createTime)).format("YYYY-MM-DD HH:mm:ss"))
  1205. this.total = response.total;
  1206. this.loading = false;
  1207. });
  1208. },
  1209. // 取消按钮
  1210. cancel() {
  1211. this.open = false;
  1212. this.reset();
  1213. this.getList();
  1214. },
  1215. // 计算仓储费
  1216. calculateCost() {
  1217. if (!this.form.fCorpid || !this.form.fBillingDeadline) {
  1218. this.$message({message: '请维护货权方以及,仓储费计算截止日期', type: 'warning'})
  1219. return false
  1220. }
  1221. if (this.dataList.length !== 0) {
  1222. this.$confirm(`仓储费已经存在,确定要删除重新计算吗?`, '提示', {
  1223. confirmButtonText: '确定',
  1224. cancelButtonText: '取消',
  1225. type: 'warning'
  1226. }).then(() => {
  1227. this.getStorageFee()
  1228. }).catch(() => {
  1229. return false
  1230. })
  1231. } else {
  1232. this.getStorageFee()
  1233. }
  1234. },
  1235. // 添加费用新行
  1236. // 收款信息
  1237. addCollection() {
  1238. this.warehouseDrList.push({
  1239. fCorpid: null,
  1240. fFeeid: null,
  1241. fFeeunitid: "2",
  1242. fQty: 0,
  1243. fUnitprice: 0,
  1244. fAmount: 0,
  1245. fCurrency: "RMB",
  1246. fExrate: "1",
  1247. fTaxrate: this.fTaxrate,
  1248. fCxrate: "1",
  1249. fRate: null,
  1250. remark: null,
  1251. });
  1252. },
  1253. getStorageFee () {
  1254. calculateStorageFees(this.form).then((response) => {
  1255. this.dataList = []
  1256. this.warehouseDrList = []
  1257. this.form.fId = response.data.warehouseBills.fId
  1258. this.form.fBillno = response.data.warehouseBills.fBillno
  1259. if (response.data.warehouseFeesList) {
  1260. this.warehouseDrList = response.data.warehouseFeesList
  1261. }
  1262. if (response.data.warehouseItemList) {
  1263. this.dataList = response.data.warehouseItemList
  1264. for (let li in this.dataList) {
  1265. this.$set(this.dataList[li], 'fBsdate', Date.parse(this.dataList[li].fBsdate))
  1266. this.$set(this.dataList[li], 'fChargedate', Date.parse(this.dataList[li].fChargedate))
  1267. this.$set(this.dataList[li], 'fBillingDeadline', Date.parse(this.dataList[li].fBillingDeadline))
  1268. this.$set(this.dataList[li], 'fOriginalbilldate', Date.parse(this.dataList[li].fOriginalbilldate))
  1269. }
  1270. }
  1271. if (response.data.feesList) {
  1272. this.fWbuOptions = response.data.feesList
  1273. }
  1274. });
  1275. },
  1276. /* 远程模糊查询商品 */
  1277. goodsRemoteMethod(name) {
  1278. if (name == null || name === "") {
  1279. return false;
  1280. }
  1281. let queryParams = { pageNum: 1, pageSize: 10, fName: name };
  1282. listGoods(queryParams).then((response) => {
  1283. this.goodsOptions = response.rows;
  1284. });
  1285. },
  1286. // 表单重置
  1287. reset() {
  1288. this.form = {
  1289. fId: null,
  1290. fBillno: null,
  1291. fCustomsdeclartion: null,
  1292. fOriginalbillno: null,
  1293. fDeptid: null,
  1294. fBsdeptid: null,
  1295. fContacts: null,
  1296. fTel: null,
  1297. fCorpid: null,
  1298. fTocorpid: null,
  1299. fStltypeid: null,
  1300. fBscorpno: null,
  1301. fWarehouseid: null,
  1302. fStorekeeper: null,
  1303. fBsdate: null,
  1304. fPlanqty: null,
  1305. fPlangrossweight: null,
  1306. fPlannetweight: null,
  1307. fPlanvolumn: null,
  1308. fQty: null,
  1309. fGrossweight: null,
  1310. fNetweight: null,
  1311. fVolumn: null,
  1312. fTrademodeid: null,
  1313. fSbu: null,
  1314. fFeetunit: null,
  1315. fMblno: null,
  1316. fVslvoy: null,
  1317. fEta: null,
  1318. fCustomno: null,
  1319. fIfweigh: null,
  1320. fIfpledge: null,
  1321. fIfdamage: null,
  1322. fBankcorpid: null,
  1323. fBilltype: null,
  1324. fBillstatus: null,
  1325. delFlag: null,
  1326. createBy: null,
  1327. createTime: null,
  1328. updateBy: null,
  1329. updateTime: null,
  1330. remark: null,
  1331. fCreateby: null,
  1332. fCreatetime: null,
  1333. fGoodsid: null,
  1334. fCntrtype: null,
  1335. fCntqty: null,
  1336. };
  1337. this.deptOptions = [];
  1338. this.userOptions = [];
  1339. this.fWbuOptions = [];
  1340. this.fMblnoOptions = [];
  1341. this.disappear = false
  1342. this.addOrUpdateVisib = false
  1343. this.addOrUpdateVisible = false
  1344. this.notChange = false
  1345. this.loading = false
  1346. this.browseStatus = false
  1347. this.resetForm("form");
  1348. },
  1349. /** 搜索按钮操作 */
  1350. handleQuery() {
  1351. this.queryParams.pageNum = 1;
  1352. this.getList();
  1353. },
  1354. /** 重置按钮操作 */
  1355. resetQuery() {
  1356. this.resetForm("queryForm");
  1357. this.handleQuery();
  1358. },
  1359. // 多选框选中数据
  1360. handleSelectionChange(selection) {
  1361. this.ids = selection;
  1362. // this.ids = selection.map((item) => item.fId);
  1363. this.single = selection.length !== 1;
  1364. this.multiple = !selection.length;
  1365. },
  1366. /** 新增按钮操作 */
  1367. handleAdd(status) {
  1368. this.reset();
  1369. this.browseStatus = status;
  1370. this.queryUser();
  1371. this.open = true;
  1372. this.dataList = [];
  1373. this.warehouseCrList = [];
  1374. this.warehouseDrList = [];
  1375. this.relevantAttachments = [];
  1376. this.title = "出库单";
  1377. },
  1378. handleUpdate_s(row, status) {
  1379. this.reset();
  1380. this.notChange = true
  1381. this.browseStatus = status;
  1382. let data = row || this.ids;
  1383. getStorageFeeCalculation(data.fId).then((response) => {
  1384. this.fMblnoOptions = []
  1385. if (response.data.corps) {
  1386. this.fMblnoOptions.push(response.data.corps)
  1387. }
  1388. if (response.data.warehouse) {
  1389. this.form = response.data.warehouse
  1390. this.Operator = this.form.createBy
  1391. this.$set(this.form, 'createTime', Date.parse(this.form.createTime))
  1392. this.$set(this.form, 'fBillingDeadline', Date.parse(this.form.fBillingDeadline))
  1393. }
  1394. if (response.data.warehouseItemsList) {
  1395. this.dataList = response.data.warehouseItemsList
  1396. for (let li in this.dataList) {
  1397. this.$set(this.dataList[li], 'fBillingway',this.dataList[li].fBillingway + '')
  1398. this.$set(this.dataList[li], 'fBsdate', Date.parse(this.dataList[li].fBsdate))
  1399. this.$set(this.dataList[li], 'fChargedate', Date.parse(this.dataList[li].fChargedate))
  1400. this.$set(this.dataList[li], 'fBillingDeadline', Date.parse(this.dataList[li].fBillingDeadline))
  1401. this.$set(this.dataList[li], 'fStorageFeeDeadline', Date.parse(this.dataList[li].fStorageFeeDeadline))
  1402. }
  1403. }
  1404. if (response.data.warehouseFeesList) {
  1405. this.warehouseDrList = response.data.warehouseFeesList
  1406. for (let dr in this.warehouseDrList) {
  1407. this.$set(this.warehouseDrList[dr], "fFeeunitid", this.warehouseDrList[dr].fFeeunitid + '');
  1408. }
  1409. }
  1410. if (response.data.feesList) {
  1411. this.fWbuOptions = response.data.feesList
  1412. }
  1413. this.userOptions = response.data.sysUser;
  1414. this.open = true;
  1415. this.title = "编辑仓储费计算";
  1416. });
  1417. },
  1418. /** 修改按钮操作 */
  1419. handleUpdate(row, status) {
  1420. this.reset();
  1421. this.disappear = false
  1422. this.notChange = true
  1423. this.browseStatus = status;
  1424. let data = row || this.ids;
  1425. getStorageFeeCalculation(data.fId).then((response) => {
  1426. this.fMblnoOptions = []
  1427. if (response.data.corps) {
  1428. this.fMblnoOptions.push(response.data.corps)
  1429. }
  1430. if (response.data.warehouse) {
  1431. this.form = response.data.warehouse
  1432. this.Operator = this.form.createBy
  1433. this.$set(this.form, 'createTime', Date.parse(this.form.createTime))
  1434. this.$set(this.form, 'fBillingDeadline', Date.parse(this.form.fBillingDeadline))
  1435. }
  1436. if (response.data.warehouseItemsList) {
  1437. this.dataList = response.data.warehouseItemsList
  1438. for (let li in this.dataList) {
  1439. this.$set(this.dataList[li], 'fBillingway',this.dataList[li].fBillingway + '')
  1440. this.$set(this.dataList[li], 'fBsdate', Date.parse(this.dataList[li].fBsdate))
  1441. this.$set(this.dataList[li], 'fChargedate', Date.parse(this.dataList[li].fChargedate))
  1442. this.$set(this.dataList[li], 'fBillingDeadline', Date.parse(this.dataList[li].fBillingDeadline))
  1443. this.$set(this.dataList[li], 'fStorageFeeDeadline', Date.parse(this.dataList[li].fStorageFeeDeadline))
  1444. }
  1445. }
  1446. if (response.data.warehouseFeesList) {
  1447. this.warehouseDrList = response.data.warehouseFeesList
  1448. for (let dr in this.warehouseDrList) {
  1449. this.$set(this.warehouseDrList[dr], "fFeeunitid", this.warehouseDrList[dr].fFeeunitid + '');
  1450. }
  1451. }
  1452. if (response.data.feesList) {
  1453. this.fWbuOptions = response.data.feesList
  1454. }
  1455. this.userOptions = response.data.sysUser;
  1456. this.open = true;
  1457. this.title = "编辑仓储费计算";
  1458. });
  1459. },
  1460. changeEstmateAmt(row) {
  1461. let fQty = 0
  1462. let fUnitprice = 0
  1463. if (row.fUnitprice && row.fUnitprice !== "") {
  1464. fUnitprice = row.fUnitprice
  1465. }
  1466. if (row.fQty && row.fQty !== "") {
  1467. fQty = row.fQty
  1468. }
  1469. this.$set(row, "fAmount", Number(fUnitprice) * Number(fQty)).toFixed(2);
  1470. },
  1471. changefBsdate(row) {
  1472. if (this.dataList.length > 0) {
  1473. for (var i = 0; i < this.dataList.length; i++) {
  1474. this.$set(this.dataList[i], "fBsdate", row);
  1475. }
  1476. }
  1477. },
  1478. // 合计
  1479. getSummaries(param) {
  1480. const {columns, data} = param;
  1481. const sums = [];
  1482. var values = [];
  1483. columns.forEach((column, index) => {
  1484. if (index === 0) {
  1485. sums[index] = "合计";
  1486. return;
  1487. }
  1488. if (column.property === "fBillingQty") {
  1489. values = data.map((item) => Number(item["fBillingQty"]));
  1490. }
  1491. if (column.property === "fAmt") {
  1492. values = data.map((item) => Number(item["fAmt"]));
  1493. }
  1494. // const values = data.map(item => Number(item[column.property]))
  1495. if (column.property === "fBillingQty" || column.property === "fAmt") {
  1496. sums[index] = values.reduce((prev, curr) => {
  1497. const value = Number(curr);
  1498. if (!isNaN(value)) {
  1499. return prev + curr;
  1500. } else {
  1501. return prev;
  1502. }
  1503. }, 0);
  1504. sums[index] = sums[index].toFixed(2)
  1505. } else {
  1506. sums[index] = '-'
  1507. }
  1508. });
  1509. return sums;
  1510. },
  1511. // 付款合计
  1512. warehouseDrSummaries(param) {
  1513. const {columns, data} = param;
  1514. const sums = [];
  1515. columns.forEach((column, index) => {
  1516. if (index === 0) {
  1517. sums[index] = "合计";
  1518. return;
  1519. }
  1520. const values = data.map((item) => Number(item[column.property]));
  1521. if (column.property === "fAmount") {
  1522. sums[index] = values.reduce((prev, curr) => {
  1523. const value = Number(curr);
  1524. if (!isNaN(value)) {
  1525. return prev + curr;
  1526. } else {
  1527. return prev;
  1528. }
  1529. }, 0); // sums[index]
  1530. sums[index] = sums[index].toFixed(2)
  1531. } else {
  1532. sums[index] = '-'
  1533. }
  1534. });
  1535. return sums;
  1536. },
  1537. /** 删除按钮操作 */
  1538. handleDelete(row) {
  1539. const fIds = row.fId || this.ids.fId;
  1540. this.$confirm(
  1541. '是否确认删除仓库主(出入库)编号为"' + fIds + '"的数据项?',
  1542. "警告",
  1543. {
  1544. confirmButtonText: "确定",
  1545. cancelButtonText: "取消",
  1546. type: "warning",
  1547. }
  1548. )
  1549. .then(function () {
  1550. return delStorageFeeCalculation(fIds);
  1551. })
  1552. .then(() => {
  1553. this.getList();
  1554. this.msgSuccess("删除成功");
  1555. });
  1556. },
  1557. /** 导出按钮操作 */
  1558. handleExport() {
  1559. const queryParams = this.queryParams;
  1560. this.$confirm("是否确认导出所有仓库主(出入库)数据项?", "警告", {
  1561. confirmButtonText: "确定",
  1562. cancelButtonText: "取消",
  1563. type: "warning",
  1564. })
  1565. .then(function () {
  1566. return exportWarehousebills(queryParams);
  1567. })
  1568. .then((response) => {
  1569. this.download(response.msg);
  1570. });
  1571. },
  1572. handleExportItems() {
  1573. const fIds = this.form.fId
  1574. if(fIds !== null){
  1575. this.$confirm("是否确认导出所有计费物资明细数据?", "警告", {
  1576. confirmButtonText: "确定",
  1577. cancelButtonText: "取消",
  1578. type: "warning",
  1579. })
  1580. .then(function () {
  1581. return exportWarehousebillsitems(fIds);
  1582. })
  1583. .then((response) => {
  1584. this.download(response.msg);
  1585. });
  1586. }else{
  1587. this.$message("请先保存")
  1588. }
  1589. },
  1590. deleteRow(index, rows) {
  1591. rows.splice(index, 1);
  1592. },
  1593. /* 远程模糊查询用户 */
  1594. corpsRemoteMethod(name) {
  1595. if (name == null || name === "") {
  1596. return false;
  1597. }
  1598. let queryParams = {pageNum: 1, pageSize: 10, fName: name};
  1599. listCorps(queryParams).then((response) => {
  1600. this.fMblnoOptions = response.rows;
  1601. });
  1602. },
  1603. // 远程模糊查询费用名称
  1604. fWRemoteMethod(name) {
  1605. if (name == null || name === "") {
  1606. return false;
  1607. }
  1608. let queryParams = {pageNum: 1, pageSize: 10, fName: name};
  1609. listFees(queryParams).then((response) => {
  1610. this.fWbuOptions = response.rows;
  1611. });
  1612. },
  1613. /* 远程模糊查询操作用户 */
  1614. userRemoteMethod(name) {
  1615. if (name == null || name === "") {
  1616. return false;
  1617. }
  1618. let queryParams = {pageNum: 1, pageSize: 10, userName: name};
  1619. listUser(queryParams).then((response) => {
  1620. this.userOptions = response.rows;
  1621. });
  1622. },
  1623. /** 提交按钮 */
  1624. submitForm(status) {
  1625. this.$refs["form"].validate((valid) => {
  1626. if (valid) {
  1627. if (status !== 2) {
  1628. if (this.dataList.length === 0) {
  1629. this.$message.error("请维护计费物资明细!");
  1630. return false;
  1631. }
  1632. }
  1633. if (!this.form.fCorpid) {
  1634. this.$message({message: '请维护货权方', type: 'warning'})
  1635. return false
  1636. }
  1637. if (!this.form.fBillingDeadline) {
  1638. this.$message({message: '请维护仓储费计算截止日期', type: 'warning'})
  1639. return false
  1640. }
  1641. if (this.form.fBillstatus !== 4) {
  1642. this.form.fBillstatus = status
  1643. }
  1644. let formData = new window.FormData();
  1645. formData.append("warehouseBills", JSON.stringify(this.form));
  1646. formData.append("warehouseItems", JSON.stringify(this.dataList));
  1647. formData.append("warehouseFees", JSON.stringify(this.warehouseDrList));
  1648. addStorageFeeCalculation(formData).then((response) => {
  1649. this.msgSuccess("操作成功");
  1650. if (status !== 2) {
  1651. this.open = false;
  1652. this.reset()
  1653. this.getList();
  1654. } else {
  1655. this.form = response.data
  1656. this.$set(this.form, 'createTime', Date.parse(this.form.createTime))
  1657. this.$set(this.form, 'fBillingDeadline', Date.parse(this.form.fBillingDeadline))
  1658. }
  1659. })
  1660. }
  1661. });
  1662. }
  1663. }
  1664. };
  1665. </script>
  1666. <style lang="scss">
  1667. .juzhong > th {
  1668. text-align: center;
  1669. }
  1670. .biaoge > tr > td {
  1671. height: 30px;
  1672. text-align: center;
  1673. border-right: 1px solid #dfe6ec !important;
  1674. order-bottom: 1px solid #dfe6ec !important;
  1675. border-bottom: 1px solid #dfe6ec !important;
  1676. }
  1677. .el-table thead th {
  1678. background: #1890ff;
  1679. color: #fff;
  1680. }
  1681. .upload-demo {
  1682. margin-left: 50px;
  1683. }
  1684. .el-form-item {
  1685. margin-bottom: 5px !important;
  1686. }
  1687. .el-form-item__label {
  1688. font-size: 12px !important;
  1689. }
  1690. </style>