index.vue 56 KB

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