index.vue 58 KB

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