index.vue 58 KB

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