index.vue 46 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360
  1. <template>
  2. <div class="app-container">
  3. <el-form :model="tableFilter" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
  4. <el-form-item label="系统编号" prop="fCtrlcorpid">
  5. <el-input
  6. v-model="tableFilter.fBillno"
  7. placeholder="请输入系统编号"
  8. clearable
  9. size="small"
  10. style="width:200px"
  11. @keyup.enter.native="handleQuery"
  12. />
  13. </el-form-item>
  14. <el-form-item label="货权方" prop="fCtrlcorpid">
  15. <el-input
  16. v-model="tableFilter.fCtrlcorpid"
  17. placeholder="请输入货权方"
  18. clearable
  19. size="small"
  20. style="width:200px"
  21. @keyup.enter.native="handleQuery"
  22. />
  23. </el-form-item>
  24. <el-form-item label="结算单位" prop="fCorpid">
  25. <el-select
  26. v-model="tableFilter.fCorpid"
  27. filterable
  28. remote
  29. clearable
  30. size="small"
  31. style="width: 200px"
  32. @keyup.enter.native="handleQuery"
  33. :remote-method="corpsRemoteMethod"
  34. placeholder="请输入结算单位"
  35. >
  36. <el-option
  37. v-for="(dict, index) in fMblnoOptions"
  38. :key="index.fId"
  39. :label="dict.fName"
  40. :value="dict.fId"
  41. ></el-option>
  42. </el-select>
  43. </el-form-item>
  44. <el-form-item label="对账日期" prop="fAccbilldate">
  45. <el-date-picker
  46. type="daterange"
  47. size="small"
  48. style="width: 240px"
  49. v-model="tableFilter.fAccbilldate"
  50. start-placeholder="开始日期"
  51. end-placeholder="结束日期"
  52. value-format="yyyy-MM-dd"
  53. :default-time="['00:00:00', '23:59:59']"
  54. >
  55. </el-date-picker>
  56. </el-form-item>
  57. <el-form-item>
  58. <el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
  59. <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
  60. </el-form-item>
  61. </el-form>
  62. <el-row :gutter="10" class="mb8">
  63. <el-col :span="1.5">
  64. <el-button
  65. type="primary"
  66. icon="el-icon-plus"
  67. size="mini"
  68. @click="handleAdd"
  69. v-hasPermi="['finance:payment:add']"
  70. >新增
  71. </el-button>
  72. </el-col>
  73. <el-col :span="1.5">
  74. <el-button
  75. type="success"
  76. icon="el-icon-edit"
  77. size="mini"
  78. :disabled="single"
  79. @click="handleUpdate"
  80. v-hasPermi="['finance:payment:edit']"
  81. >修改
  82. </el-button>
  83. </el-col>
  84. <!-- <el-col :span="1.5">-->
  85. <!-- <el-button-->
  86. <!-- type="danger"-->
  87. <!-- icon="el-icon-delete"-->
  88. <!-- size="mini"-->
  89. <!-- :disabled="multiple"-->
  90. <!-- @click="handleDelete"-->
  91. <!-- v-hasPermi="['finance:charge:remove']"-->
  92. <!-- >删除-->
  93. <!-- </el-button>-->
  94. <!-- </el-col>-->
  95. <el-col :span="1.5">
  96. <el-button
  97. type="warning"
  98. icon="el-icon-download"
  99. size="mini"
  100. @click="handleExport"
  101. v-hasPermi="['finance:payment:export']"
  102. >导出
  103. </el-button>
  104. </el-col>
  105. <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
  106. </el-row>
  107. <el-table v-loading="loading" :data="chargeList" @selection-change="handleSelectionChange">
  108. <el-table-column type="selection" width="55" align="center"/>
  109. <el-table-column label="序号" type="index" width="55" align="center"/>
  110. <el-table-column label="系统编号" :show-overflow-tooltip="true" align="center" prop="fBillno" width="120"/>
  111. <el-table-column label="货权方" :show-overflow-tooltip="true" align="center" prop="fCtrlcorpid" width="120"/>
  112. <!-- <el-table-column label="账单日期" align="center" prop="fAccbilldate" width="180">-->
  113. <!-- <template slot-scope="scope">-->
  114. <!-- <span>{{ parseTime(scope.row.fAccbilldate, '{y}-{m}-{d}') }}</span>-->
  115. <!-- </template>-->
  116. <!-- </el-table-column>-->
  117. <!-- <el-table-column label="制单部门" align="center" prop="fId"/>-->
  118. <!-- <el-table-column label="结算单位" align="center" prop="fCorpid"/>-->
  119. <el-table-column label="对账日期" align="center" prop="fAccbilldate" width="120"/>
  120. <el-table-column label="提单号" align="center" prop="tMblno" width="120"/>
  121. <el-table-column label="应收合计" align="center" prop="fAmtdr" width="120"/>
  122. <el-table-column label="应付合计" align="center" prop="fAmtcr" width="120"/>
  123. <el-table-column label="备注" align="center" prop="fRemarks" width="120"/>
  124. <el-table-column label="状态" align="center" prop="fBillstatus" width="120">
  125. <template slot-scope="scope">
  126. <span v-if="scope.row.fBillstatus == '1'">保存</span>
  127. <span v-else-if="scope.row.fBillstatus == '2'">暂存</span>
  128. <span v-else-if="scope.row.fBillstatus == '3'">审批驳回</span>
  129. <span v-else-if="scope.row.fBillstatus == '4'">提交审核</span>
  130. <span v-else-if="scope.row.fBillstatus == '5'">审核中</span>
  131. <span v-else-if="scope.row.fBillstatus == '6'">审核完成</span>
  132. </template>
  133. </el-table-column>
  134. <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
  135. <template slot-scope="scope">
  136. <el-button
  137. size="mini"
  138. type="text"
  139. icon="el-icon-view"
  140. @click="check(scope.row,0)"
  141. v-hasPermi="['finance:payment:edit']"
  142. >查看</el-button
  143. >
  144. <el-button
  145. size="mini"
  146. type="text"
  147. icon="el-icon-view"
  148. @click="check(scope.row,1)"
  149. v-hasPermi="['finance:payment:edit']"
  150. v-if="scope.row.fBillstatus == 4 || scope.row.fBillstatus == 5"
  151. >审批进度</el-button
  152. >
  153. <el-button
  154. size="mini"
  155. type="text"
  156. icon="el-icon-edit"
  157. @click="handleUpdate(scope.row)"
  158. v-hasPermi="['finance:payment:edit']"
  159. v-if="scope.row.fBillstatus <= 3"
  160. >修改
  161. </el-button>
  162. <el-button
  163. size="mini"
  164. type="text"
  165. icon="el-icon-delete"
  166. @click="handleDelete(scope.row)"
  167. v-hasPermi="['finance:payment:remove']"
  168. v-if="scope.row.fBillstatus <= 3"
  169. >删除
  170. </el-button>
  171. <!-- <el-button-->
  172. <!-- size="mini"-->
  173. <!-- type="text"-->
  174. <!-- icon="el-icon-delete"-->
  175. <!-- v-if="scope.row.fBillstatus === 6"-->
  176. <!-- >查看-->
  177. <!-- </el-button>-->
  178. <!-- <el-button-->
  179. <!-- size="mini"-->
  180. <!-- type="text"-->
  181. <!-- icon="el-icon-delete"-->
  182. <!-- v-if="scope.row.fBillstatus > 3 && scope.row.fBillstatus < 6"-->
  183. <!-- >查看审批流-->
  184. <!-- </el-button>-->
  185. </template>
  186. </el-table-column>
  187. <!-- <el-table-column label="单据类型" align="center" prop="fBilltype"/>-->
  188. <!-- <el-table-column label="制单部门" align="center" prop="fDeptid"/>-->
  189. </el-table>
  190. <pagination
  191. v-show="total>0"
  192. :total="total"
  193. :page.sync="queryParams.pageNum"
  194. :limit.sync="queryParams.pageSize"
  195. @pagination="getList"
  196. />
  197. <!-- 添加或修改财务数据主对话框 -->
  198. <el-dialog :close-on-click-modal="false" :title="title" :show-close="Xbutton" :visible.sync="open" width="70%" append-to-body>
  199. <el-form :model="queryParams" :rules="ruless" ref="ruless" :inline="true" v-show="showSearch"
  200. label-width="68px"
  201. >
  202. <el-form-item label="货权方" prop="fCtrlcorpid">
  203. <el-input
  204. v-model="queryParams.fCtrlcorpid"
  205. placeholder="请输入货权方"
  206. clearable
  207. size="small"
  208. :disabled="notChange"
  209. style="width:200px"
  210. @keyup.enter.native="handleQuery"
  211. />
  212. </el-form-item>
  213. <el-form-item label="结算单位" label-width="78px" prop="fCorpid">
  214. <el-select
  215. v-model="queryParams.fCorpid"
  216. filterable
  217. remote
  218. clearable
  219. size="small"
  220. style="width: 200px"
  221. @keyup.enter.native="handleQuery"
  222. :remote-method="corpsRemoteMethod"
  223. :disabled="notChange"
  224. placeholder="请输入结算单位"
  225. >
  226. <el-option
  227. v-for="(dict, index) in fMblnoOptions"
  228. :key="index.fId"
  229. :label="dict.fName"
  230. :value="dict.fId"
  231. ></el-option>
  232. </el-select>
  233. </el-form-item>
  234. <el-form-item label="结算日期" label-width="78px" prop="fAccbilldate">
  235. <el-date-picker clearable size="small" style="width: 200px"
  236. v-model="queryParams.fAccbilldate"
  237. type="date"
  238. value-format="yyyy-MM-dd"
  239. placeholder="选择账单日期"
  240. :disabled="notChange"
  241. >
  242. </el-date-picker>
  243. </el-form-item>
  244. <el-form-item label="系统编号" prop="fBillno">
  245. <el-input
  246. v-model="queryParams.fBillno"
  247. placeholder="请输入系统编号"
  248. clearable
  249. disabled
  250. style="width: 200px"
  251. size="small"
  252. @keyup.enter.native="handleQuery"
  253. />
  254. </el-form-item>
  255. <el-form-item label="备注" prop="fRemarks">
  256. <el-input
  257. v-model="queryParams.fRemarks"
  258. placeholder="请输入备注"
  259. clearable
  260. size="small"
  261. style="width:200px"
  262. :disabled="notChange"
  263. @keyup.enter.native="handleQuery"
  264. />
  265. </el-form-item>
  266. </el-form>
  267. <div style="width: 100%;">
  268. <el-button type="warning" size="small" @click="charGe" :disabled="notChange" v-if="queryParams.fBillstatus < '4'">付费</el-button>
  269. <el-button type="primary" size="small" @click="confirmCharge" :disabled="notChange" v-if="queryParams.fBillstatus < '4'">确认付费</el-button>
  270. <el-button type="success" size="small" @click="revokeCharge" v-if="queryParams.fBillstatus === '6'">撤销付费</el-button>
  271. <!-- <el-button type="info" size="small" @click="printing">打印</el-button>-->
  272. <!-- <el-button type="danger" size="small" :disabled="notChange" v-show="Lander == Operator">撤销审批</el-button>-->
  273. <el-button type="danger" size="small" :disabled="tablefilter" @click="approvalRevocation" v-show="queryParams.fBillstatus === '4'">撤销审批</el-button>
  274. </div>
  275. <el-table v-loading="loading" :data="increase_s" @selection-change="handleSelectionChange_s">
  276. <!-- <el-table-column type="selection" width="55" align="center"/> -->
  277. <el-table-column label="序号" type="index" align="center"/>
  278. <el-table-column label="提单号" align="center" prop="fMblno"/>
  279. <el-table-column label="存货单号" align="center" prop="fBscorpno"/>
  280. <el-table-column label="品名" align="center" prop="fProductName"/>
  281. <el-table-column label="业务日期" align="center" prop="fBsdate">
  282. <template slot-scope="scope">
  283. <span>{{ scope.row.fBsdate.slice(0, 10) }}</span>
  284. </template>
  285. </el-table-column>
  286. <el-table-column label="费用名称" align="center" prop="fFeeName"/>
  287. <el-table-column label="收/付" align="center" prop="fSrcdc">
  288. <template slot-scope="scope">
  289. <span v-if="scope.row.fSrcdc =='D'">收</span>
  290. <span v-else-if="scope.row.fSrcdc =='C'">付</span>
  291. </template>
  292. </el-table-column>
  293. <el-table-column label="业务类型" align="center" prop="fBilltype">
  294. <template slot-scope="scope">
  295. <span v-if="scope.row.fBilltype =='SJRK'">入库</span>
  296. <span v-else-if="scope.row.fBilltype == 'SJCK'">出库</span>
  297. <span v-else>{{ scope.row.fBilltype }}</span>
  298. </template>
  299. </el-table-column>
  300. <el-table-column label="金额" align="center" prop="fAmtdr"/>
  301. <el-table-column label="本次金额" align="center" prop="fAmt"/>
  302. <el-table-column label="备注" align="center" prop="fRemarks"/>
  303. <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
  304. <template slot-scope="scope">
  305. <el-button
  306. size="mini"
  307. type="text"
  308. icon="el-icon-delete"
  309. @click.native.prevent="deleteRow(scope.$index, increase_s)"
  310. :disabled="notChange"
  311. >删除
  312. </el-button>
  313. </template>
  314. </el-table-column>
  315. </el-table>
  316. <div slot="footer" class="dialog-footer">
  317. <add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
  318. <approval-comments v-if="addOrUpdateVisib" ref="ApprovalComments" @refreshDataList="returnData"></approval-comments>
  319. <el-button v-if="approve === true" @click="immediateApproval">审批</el-button>
  320. <el-button type="primary" v-if="notChange" @click="addOrUpdateHandle">查看审批流</el-button>
  321. <el-button type="primary" @click="submitForm" :disabled="notChange">保 存</el-button>
  322. <el-button v-if="cancelButton === true" @click="cancel">取 消</el-button>
  323. <el-button v-if="cancelButton === false" @click="homePage">取 消</el-button>
  324. </div>
  325. <el-dialog :close-on-click-modal="false" width="70%" :visible.sync="innerVisible" title="导入数据" append-to-body>
  326. <el-form ref="form" :model="queryParameter" :rules="rules" label-width="80px"
  327. style="display: flex;flex-wrap: wrap;"
  328. >
  329. <el-form-item label="货权方" prop="fCtrlcorpid">
  330. <!-- <el-input v-model="queryParameter.fCorpid" placeholder="请输入货权方" style="width: 200px;"/>-->
  331. <el-select
  332. v-model="queryParams.fCorpid"
  333. filterable
  334. remote
  335. clearable
  336. size="small"
  337. style="width: 200px"
  338. @keyup.enter.native="handleQuery"
  339. :remote-method="corpsRemoteMethod"
  340. placeholder="请选择货权方"
  341. >
  342. <el-option
  343. v-for="(dict, index) in fMblnoOptions"
  344. :key="index.fId"
  345. :label="dict.fName"
  346. :value="dict.fId"
  347. ></el-option>
  348. </el-select>
  349. </el-form-item>
  350. <el-form-item label="结算单位" prop="fToCorpid">
  351. <el-select
  352. v-model="queryParameter.fToCorpid"
  353. filterable
  354. remote
  355. clearable
  356. size="small"
  357. style="width: 200px"
  358. @keyup.enter.native="handleQuery"
  359. :remote-method="corpsRemoteMethod"
  360. placeholder="请输入结算单位"
  361. >
  362. <el-option
  363. v-for="(dict, index) in fMblnoOptions"
  364. :key="index.fId"
  365. :label="dict.fName"
  366. :value="dict.fId"
  367. ></el-option>
  368. </el-select>
  369. </el-form-item>
  370. <el-form-item label="提单号" prop="tMblno">
  371. <el-input v-model="queryParameter.fMblno" placeholder="请输入提单号" style="width: 200px;" size="small"/>
  372. </el-form-item>
  373. <el-form-item label="对账单号" prop="fStatementNo">
  374. <el-input v-model="queryParameter.fStatementNo" placeholder="请输入提单号" size="small" style="width: 200px;"/>
  375. </el-form-item>
  376. <el-form-item label="费用名称" prop="fFeeid">
  377. <template>
  378. <el-select
  379. v-model="queryParameter.fFeeid"
  380. filterable
  381. remote
  382. size="small"
  383. style="width:200px"
  384. :remote-method="fWRemoteMethod"
  385. placeholder="费用名称"
  386. multiple
  387. >
  388. <el-option v-for="item in fWbuOptions" :key="item.fId" :label="item.fName" :value="item.fId">
  389. </el-option>
  390. </el-select>
  391. </template>
  392. </el-form-item>
  393. <el-form-item label="审核日期" prop="timeExamine">
  394. <el-date-picker
  395. size="small"
  396. style="width: 240px"
  397. v-model="queryParameter.timeExamine"
  398. type="daterange"
  399. start-placeholder="开始日期"
  400. end-placeholder="结束日期"
  401. value-format="yyyy-MM-dd"
  402. :default-time="['00:00:00', '23:59:59']"
  403. >
  404. </el-date-picker>
  405. </el-form-item>
  406. <el-form-item label="出入库日期" label-width="85px" prop="fAccbilldate">
  407. <el-date-picker
  408. size="small"
  409. style="width: 240px"
  410. v-model="queryParameter.timeInterval"
  411. type="daterange"
  412. start-placeholder="开始日期"
  413. end-placeholder="结束日期"
  414. value-format="yyyy-MM-dd"
  415. :default-time="['00:00:00', '23:59:59']"
  416. >
  417. </el-date-picker>
  418. </el-form-item>
  419. <el-form-item>
  420. <el-button type="cyan" icon="el-icon-search" size="mini" @click="importSearch">搜索</el-button>
  421. <el-button icon="el-icon-refresh" size="mini" @click="resetQuery_s">重置</el-button>
  422. </el-form-item>
  423. </el-form>
  424. <el-table v-loading="loading" :data="chargeList_s" ref="chargeList" show-summary :summary-method="getSum"
  425. @selection-change="handleSelectionChange_s"
  426. >
  427. <el-table-column type="selection" width="55" align="center"/>
  428. <el-table-column label="序号" type="index" width="55" align="center"/>
  429. <el-table-column label="货权方" align="center" prop="fName"/>
  430. <el-table-column label="提单号" align="center" prop="fMblno"/>
  431. <el-table-column label="品名" align="center" prop="fProductName"/>
  432. <el-table-column label="业务日期" align="center" prop="fBsdate"/>
  433. <el-table-column label="业务类型" align="center" prop="fBilltype">
  434. <template slot-scope="scope">
  435. <span v-if="scope.row.fBilltype =='SJRK'">入库</span>
  436. <span v-else-if="scope.row.fBilltype == 'SJCK'">出库</span>
  437. <span v-else>{{ scope.row.fBilltype }}</span>
  438. </template>
  439. </el-table-column>
  440. <el-table-column label="审核日期" align="center" prop="fReviewDate"/>
  441. <el-table-column label="费用名称" align="center" prop="fFeeName"/>
  442. <el-table-column label="金额" align="center" prop="fAmtdr"/>
  443. <el-table-column label="本次金额" align="center" prop="fAmt" width="100">
  444. <template slot-scope="scope">
  445. <el-input
  446. v-model="scope.row.fAmt"
  447. placeholder="请输入本次金额"
  448. clearable
  449. size="small"
  450. oninput='this.value=this.value.replace(/[^\-?\d.]/g,"").replace(/^(\-)*(\d+)\.(\d\d).*$/, "$1$2.$3")'
  451. @change="imgChangeI(scope.row)"
  452. />
  453. </template>
  454. </el-table-column>
  455. <el-table-column label="备注" align="center" prop="fRemarks">
  456. <template slot-scope="scope">
  457. <el-input
  458. v-model="scope.row.fRemarks"
  459. placeholder="请输入备注"
  460. clearable
  461. size="small"
  462. width="100"
  463. />
  464. </template>
  465. </el-table-column>
  466. </el-table>
  467. <div slot="footer" class="dialog-footer">
  468. <el-button type="primary" @click="confirmImport">确 定</el-button>
  469. <el-button @click="innerVisible = false">取 消</el-button>
  470. </div>
  471. </el-dialog>
  472. </el-dialog>
  473. <!-- 打印页面-->
  474. <el-dialog
  475. :visible.sync="printStatus"
  476. width="80%"
  477. :before-close="closePrinting"
  478. >
  479. <el-table id="print_area2" v-loading="loading" ref="table" :data="printObject" @selection-change="handleSelectionChange_s">
  480. <!-- <el-table-column type="selection" width="55" align="center"/> -->
  481. <el-table-column label="序号" type="index" width="70" align="center"/>
  482. <el-table-column label="提单号" align="center" prop="fMblno" width="120"/>
  483. <el-table-column label="存货单号" align="center" prop="fBscorpno" width="120"/>
  484. <el-table-column label="品名" align="center" prop="fProductName" width="120"/>
  485. <el-table-column label="业务日期" align="center" prop="fBsdate" width="120">
  486. <template slot-scope="scope">
  487. <span>{{ scope.row.fBsdate.slice(0, 10)}}</span>
  488. </template>
  489. </el-table-column>
  490. <el-table-column label="费用名称" align="center" prop="fFeeName" width="120"/>
  491. <el-table-column label="收/付" align="center" prop="fSrcdc" width="120">
  492. <template slot-scope="scope">
  493. <span v-if="scope.row.fSrcdc =='D'">收</span>
  494. <span v-else-if="scope.row.fSrcdc =='C'">付</span>
  495. </template>
  496. </el-table-column>
  497. <el-table-column label="业务类型" align="center" prop="fBilltype" width="120">
  498. <template slot-scope="scope">
  499. <span v-if="scope.row.fBilltype =='SJRK'">入库</span>
  500. <span v-else-if="scope.row.fBilltype == 'SJCK'">出库</span>
  501. <span v-else>{{ scope.row.fBilltype }}</span>
  502. </template>
  503. </el-table-column>
  504. <el-table-column label="金额" align="center" prop="fAmtdr" width="120"/>
  505. <el-table-column label="本次金额" align="center" prop="fAmt" width="120"/>
  506. </el-table>
  507. <span slot="footer" class="dialog-footer">
  508. <el-button type="primary" style="marginTop:10px" @click="printSomething">打印</el-button>
  509. <el-button @click="printStatus = false">取 消</el-button>
  510. </span>
  511. </el-dialog>
  512. </div>
  513. </template>
  514. <script>
  515. import {
  516. collectFee,
  517. listCharge,
  518. getCharge,
  519. delCharge,
  520. addCharge,
  521. exportCharge,
  522. search,
  523. listCorps,
  524. delCharge_s,
  525. backCharge,
  526. revocation
  527. } from '@/api/finance/payment'
  528. import { listFees } from '@/api/basicdata/fees'
  529. import print from 'print-js'
  530. import AddOrUpdate from '@/views/viewApproval'
  531. import ApprovalComments from '@/views/startApproval'
  532. import { queryUserVal } from '@/api/warehouseBusiness/agreement'
  533. import Global from '@/layout/components/global'
  534. export default {
  535. name: 'Charge',
  536. data() {
  537. return {
  538. Lander:'',
  539. Operator:'',
  540. approve:false,
  541. addOrUpdateVisible: false,
  542. contrastId:220,
  543. tablefilter:false,
  544. hide:false,
  545. openPrint:false,
  546. notChange:false,
  547. browseStatus: true,
  548. nothing: [],
  549. //打印表
  550. printObject: [],
  551. printStatus: false,
  552. //导入状态
  553. state_s: true,
  554. fWbuOptions: [],
  555. options: '',
  556. // 遮罩层
  557. loading: true,
  558. //打开内部弹窗
  559. innerVisible: false,
  560. chargeList_s: [],
  561. selection: '',
  562. increase_s: [],
  563. cancelButton:true,
  564. // 选中数组
  565. ids: [],
  566. // 非单个禁用
  567. single: true,
  568. // 非多个禁用
  569. multiple: true,
  570. // 显示搜索条件
  571. showSearch: true,
  572. // 总条数
  573. total: 0,
  574. totAL:0,
  575. Ttime:0,
  576. //提单号暂存
  577. fMblno: '',
  578. // 财务数据主表格数据
  579. chargeList: [],
  580. // 弹出层标题
  581. title: '',
  582. // 是否显示弹出层
  583. open: false,
  584. fMblnoOptions: '',
  585. //导入查询参数
  586. queryParameter: {
  587. fCorpid: '',
  588. fToCorpid: '',
  589. fMblno: '',
  590. fStatementNo: '',
  591. fFeeid: '',
  592. timeExamine: '',
  593. timeInterval: ''
  594. },
  595. empty: [],
  596. //导入从表传主表
  597. pass: {
  598. fAmtdr: 0, //应收合计
  599. fAmtcr: 0, //应付合计
  600. fMblno: '', //提单号
  601. fName: '' //货权方
  602. },
  603. Xbutton:true,
  604. // 查询参数
  605. queryParams: {
  606. fId: null,
  607. pageNum: 1,
  608. pageSize: 10,
  609. fBillno: null,
  610. fCtrlcorpid: null,
  611. fCorpid: null,
  612. tMblno: null,
  613. fAmtdr: null,
  614. fAmtcr: null,
  615. fBilltype: null,
  616. fBillstatus: null,
  617. fRemarks: null,
  618. fAccbilldate: null,
  619. fDeptid: null
  620. },
  621. addOrUpdateVisib: false,
  622. // 主表查询参数
  623. tableFilter: {
  624. pageNum: 1,
  625. pageSize: 10,
  626. fBillno: null,
  627. fCtrlcorpid: null,
  628. fCorpid: null,
  629. tMblno: null,
  630. fAmtdr: null,
  631. fAmtcr: null,
  632. fBilltype: null,
  633. fBillstatus: null,
  634. fRemarks: null,
  635. fAccbilldate: null,
  636. fDeptid: null
  637. },
  638. approval:[],
  639. // 表单参数
  640. form: {},
  641. // 表单校验
  642. ruless: {
  643. fCtrlcorpid: [
  644. { required: true, message: ' ', trigger: 'blur' }
  645. ],
  646. fCorpid: [
  647. { required: true, message: ' ', trigger: 'blur' }
  648. ],
  649. fAccbilldate: [
  650. { required: true, message: ' ', trigger: 'blur' }
  651. ]
  652. },
  653. // 表单校验
  654. rules: {
  655. fBilltype: [
  656. { required: true, message: ' ', trigger: 'change' }
  657. ],
  658. fBillstatus: [
  659. { required: true, message: ' ', trigger: 'blur' }
  660. ],
  661. fDeptid: [
  662. { required: true, message: ' ', trigger: 'blur' }
  663. ],
  664. fToCorpid: [
  665. { required: true, message: ' ', trigger: 'blur' }
  666. ],
  667. timeExamine: [
  668. { required: true, message: ' ', trigger: 'blur' }
  669. ]
  670. }
  671. }
  672. },
  673. components: {
  674. AddOrUpdate,
  675. ApprovalComments
  676. },
  677. created() {
  678. this.getList()
  679. this.register()
  680. },
  681. activated(){
  682. this.adoPt()
  683. },
  684. methods: {
  685. approvalRevocation(){
  686. let data = {
  687. id:this.queryParams.fId,
  688. actId:this.contrastId,
  689. billId:this.queryParams.fId
  690. }
  691. revocation(data).then(data =>{
  692. if (data.code === 200){
  693. this.$message.success('撤销成功');
  694. this.open = false
  695. this.getList()
  696. }
  697. })
  698. },
  699. returnData(){
  700. this.addOrUpdateVisib = false
  701. this.open = false
  702. this.homepaGe()
  703. },
  704. getDataList(){
  705. this.addOrUpdateVisible = false
  706. },
  707. homepaGe(){
  708. let view = {
  709. fullPath: "/finance/charge",
  710. hash: "",
  711. matched: Array(2),
  712. meta: Object,
  713. name: "Charge",
  714. params: Object,
  715. path: "/finance/charge",
  716. query: Object,
  717. title: "付费"
  718. }
  719. this.$router.push({ path: '/index'})
  720. this.$store.dispatch('tagsView/delView', view).then(({ visitedViews }) => {
  721. if (this.isActive(view)) {
  722. this.toLastView(visitedViews, view)
  723. }
  724. })
  725. Global.$emit("removeCache", "closeSelectedTag", view);
  726. },
  727. adoPt(){
  728. this.approval = this.$route.query.data
  729. if (this.approval){
  730. this.Xbutton = false
  731. this.approval = JSON.parse(this.approval)
  732. this.hide = false
  733. this.notChange = true
  734. this.approve = true
  735. this.cancelButton = false
  736. this.reset()
  737. this.pass = {
  738. fAmtdr: 0, //应收合计
  739. fAmtcr: 0, //应付合计
  740. fMblno: '', //提单号
  741. fName: '', //货权方
  742. fFeesName: '', //结算单位
  743. fCorpid: '' //结算单位ID
  744. }
  745. getCharge(this.approval.billId).then(response => {
  746. this.Operator = response.data.tFee.createBy
  747. this.increase_s = response.data.feeDoList
  748. this.fWbuOptions = response.data.feesList
  749. this.queryParams = response.data.tFee
  750. this.fWbuOptions = response.data.feesList
  751. this.fMblnoOptions = response.data.corps
  752. this.open = true
  753. this.title = '修改付费列表'
  754. })
  755. }
  756. },
  757. homePage(){
  758. this.open = false
  759. let view = {
  760. fullPath: "/finance/charge",
  761. hash: "",
  762. matched: Array(2),
  763. meta: Object,
  764. name: "Charge",
  765. params: Object,
  766. path: "/finance/charge",
  767. query: Object,
  768. title: "付费"
  769. }
  770. this.$router.push({ path: '/index'})
  771. this.$store.dispatch('tagsView/delView', view).then(({ visitedViews }) => {
  772. if (this.isActive(view)) {
  773. this.toLastView(visitedViews, view)
  774. }
  775. })
  776. Global.$emit("removeCache", "closeSelectedTag", view);
  777. },
  778. register(){
  779. queryUserVal().then((response)=>{
  780. this.Lander = response.user.userName
  781. })
  782. },
  783. immediateApproval(){
  784. this.addOrUpdateVisib = true
  785. this.$nextTick(() => {
  786. this.$refs.ApprovalComments.init(this.approval.billId,this.approval.actId)
  787. })
  788. },
  789. // 查看审批流
  790. addOrUpdateHandle(){
  791. this.addOrUpdateVisible = true
  792. this.addOrUpdateVisib = false
  793. let id = '448'
  794. let actId = '110'
  795. this.$nextTick(() => {
  796. this.$refs.addOrUpdate.init(this.queryParams.fId,this.contrastId)
  797. })
  798. },
  799. // 撤销付费
  800. revokeCharge(){
  801. this.queryParams.fBillstatus = '1'
  802. let formDate = new window.FormData()
  803. formDate.append('tFee', JSON.stringify(this.queryParams))
  804. formDate.append('tFeeDo', JSON.stringify(this.increase_s))
  805. backCharge(formDate).then(response => {
  806. this.open = false
  807. this.msgSuccess('操作成功')
  808. this.getList()
  809. })
  810. },
  811. // 查看按钮
  812. check(row,res){
  813. this.notChange = true
  814. getCharge(row.fId).then(response => {
  815. this.Operator = response.data.tFee.createBy
  816. this.increase_s = response.data.feeDoList
  817. this.fWbuOptions = response.data.feesList
  818. this.queryParams = response.data.tFee
  819. this.fWbuOptions = response.data.feesList
  820. this.fMblnoOptions = response.data.corps
  821. this.open = true
  822. this.title = '付费列表'
  823. this.tablefilter = true
  824. if (res == 1){
  825. this.notChange = true
  826. if (this.Operator == this.Lander){
  827. this.tablefilter = false
  828. this.reset()
  829. this.pass = {
  830. fAmtdr: 0, //应收合计
  831. fAmtcr: 0, //应付合计
  832. fMblno: '', //提单号
  833. fName: '', //货权方
  834. fFeesName: '', //结算单位
  835. fCorpid: '' //结算单位ID
  836. }
  837. const fId = row.fId || this.ids
  838. getCharge(fId).then(response => {
  839. this.increase_s = response.data.feeDoList
  840. this.fWbuOptions = response.data.feesList
  841. this.queryParams = response.data.tFee
  842. this.fWbuOptions = response.data.feesList
  843. this.fMblnoOptions = response.data.corps
  844. this.open = true
  845. })
  846. }else {
  847. this.notChange = true
  848. // this.$message.error('未知异常,请联系管理员')
  849. }
  850. }else {
  851. this.notChange = true
  852. this.reset()
  853. this.pass = {
  854. fAmtdr: 0, //应收合计
  855. fAmtcr: 0, //应付合计
  856. fMblno: '', //提单号
  857. fName: '', //货权方
  858. fFeesName: '', //结算单位
  859. fCorpid: '' //结算单位ID
  860. }
  861. const fId = row.fId || this.ids
  862. getCharge(fId).then(response => {
  863. this.increase_s = response.data.feeDoList
  864. this.fWbuOptions = response.data.feesList
  865. this.queryParams = response.data.tFee
  866. this.fWbuOptions = response.data.feesList
  867. this.fMblnoOptions = response.data.corps
  868. this.open = true
  869. })
  870. }
  871. })
  872. },
  873. //打印功能
  874. printing() {
  875. if (this.increase_s.length !== 0) {
  876. this.printStatus = true
  877. this.printObject = this.increase_s
  878. } else {
  879. this.$message.error('无数据,请检查是否有数据')
  880. }
  881. },
  882. //确认打印
  883. printSomething() {
  884. // 此处的style即为打印时的样式
  885. const style ='table tr td,th { border-collapse: collapse;padding:0px;border:.5px #000 solid;text-align:center;}'
  886. print({
  887. printable: 'print_area2',
  888. type: 'html',
  889. header:"付费表",
  890. style: style, // 亦可使用引入的外部css;
  891. scanStyles: false
  892. })
  893. },
  894. //关闭打印弹窗
  895. closePrinting() {
  896. this.$confirm('确认关闭?')
  897. .then(_ => {
  898. this.printStatus = false
  899. })
  900. .catch(_ => {
  901. })
  902. },
  903. // 确认付费
  904. confirmCharge() {
  905. this.$refs['ruless'].validate(valid => {
  906. if (valid) {
  907. if(this.increase_s.length){
  908. this.queryParams.fBillstatus = '4'
  909. let formDate = new window.FormData()
  910. formDate.append('tFee', JSON.stringify(this.queryParams))
  911. formDate.append('tFeeDo', JSON.stringify(this.increase_s))
  912. collectFee(formDate).then(response => {
  913. this.open = false
  914. this.msgSuccess('操作成功')
  915. this.getList()
  916. })
  917. }else {
  918. this.$message.error('表单为空不允许操作');
  919. }
  920. }
  921. })
  922. },
  923. charGe() {
  924. this.queryParameter = {
  925. fToCorpid: this.queryParams.fCorpid,
  926. }
  927. this.chargeList_s = []
  928. // this.queryParameter.fToCorpid = this.queryParams.fCorpid
  929. this.innerVisible = true
  930. },
  931. getSum(param){
  932. const {columns,data} = param;
  933. const sums = [];
  934. columns.forEach((column, index) => {
  935. sums[0] = '合计'
  936. sums[10] = this.totAL.toFixed(2)
  937. sums[9] = this.Ttime.toFixed(2)
  938. });
  939. return sums;
  940. },
  941. // 导入多选框
  942. handleSelectionChange_s(selection) {
  943. this.totAL = 0
  944. this.Ttime = 0
  945. this.selection = selection
  946. if(this.selection.length == 0){
  947. for (let item in this.chargeList_s){
  948. this.totAL += Number(this.chargeList_s[item].fAmt)
  949. this.Ttime += Number(this.chargeList_s[item].fAmtdr)
  950. }
  951. }else {
  952. for (let index in selection){
  953. this.totAL += Number(selection[index].fAmt)
  954. this.Ttime += Number(selection[index].fAmtdr)
  955. }
  956. }
  957. // this.getSummaries()
  958. },
  959. // 多选框选中数据
  960. handleSelectionChange(selection) {
  961. this.totAL = 0
  962. this.ids = selection.map(item => item.fId)
  963. this.single = selection.length !== 1
  964. this.multiple = !selection.length
  965. },
  966. imgChangeI(row) {
  967. if (row.fAmt && Number(row.fAmt) > Number(row.fAmtdr)) {
  968. this.$set(row, 'fAmt', row.fAmtdr)
  969. this.state_s = true
  970. }
  971. if (this.selection.length !== 0){
  972. this.totAL = 0
  973. this.Ttime = 0
  974. for (let item in this.selection){
  975. this.totAL += Number(this.selection[item].fAmt)
  976. this.Ttime += Number(this.selection[item].fAmtdr)
  977. }
  978. }else {
  979. this.totAL = 0
  980. this.Ttime = 0
  981. for (let item in this.chargeList_s){
  982. this.totAL += Number(this.chargeList_s[item].fAmt)
  983. this.Ttime += Number(this.chargeList_s[item].fAmtdr)
  984. }
  985. }
  986. },
  987. //确认导入
  988. confirmImport() {
  989. this.hide = true
  990. for (let item in this.selection) {
  991. this.pass.fAmtcr += Number(this.selection[item].fAmt.toFixed(2))
  992. this.pass.fAmtdr += Number(this.selection[item].fAmtdr.toFixed(2))
  993. }
  994. if (this.state_s == true) {
  995. if (this.selection.length == '0') {
  996. this.$message.error('未选择导入行')
  997. } else {
  998. for (let item in this.selection) {
  999. this.empty.push(this.selection[item].fMblno)
  1000. this.nothing.push(this.selection[item].fName)
  1001. }
  1002. //去重提单号
  1003. this.empty = new Set(this.empty)
  1004. this.empty = Array.from(this.empty)
  1005. //去重货权方
  1006. this.nothing = new Set(this.nothing)
  1007. this.nothing = Array.from(this.nothing)
  1008. if (this.empty.length <= 1) {
  1009. this.pass.fMblno = this.empty[0]
  1010. } else {
  1011. this.pass.fMblno = this.empty[0] + '...'
  1012. }
  1013. if (this.nothing.length <= 1) {
  1014. this.pass.fName = this.nothing[0]
  1015. } else {
  1016. this.pass.fName = this.nothing[0] + '...'
  1017. }
  1018. this.increase_s = this.increase_s.concat(this.selection)
  1019. this.queryParams.tMblno = this.pass.fMblno //提单号
  1020. this.queryParams.fCtrlcorpid = this.pass.fName
  1021. this.queryParams.fCorpid = this.queryParameter.fToCorpid
  1022. this.queryParams.fAmtcr = this.pass.fAmtcr
  1023. this.queryParams.fAmtdr = this.pass.fAmtdr
  1024. this.innerVisible = false
  1025. this.chargeList_s = []
  1026. this.queryParameter = {
  1027. fCorpid: '',
  1028. fToCorpid: '',
  1029. fMblno: '',
  1030. fStatementNo: '',
  1031. fFeeid: '',
  1032. timeExamine: '',
  1033. timeInterval: ''
  1034. }
  1035. }
  1036. } else if (this.state_s == false) {
  1037. this.$message.error('本次金额不能大于原定金额')
  1038. }
  1039. },
  1040. /** 查询财务数据主列表 */
  1041. getList() {
  1042. this.loading = true
  1043. this.getDicts('approval_process').then((response) => {
  1044. this.options = response.data
  1045. })
  1046. listCharge(this.tableFilter).then(response => {
  1047. this.chargeList = response.rows
  1048. this.total = response.total
  1049. this.loading = false
  1050. })
  1051. },
  1052. // 取消按钮
  1053. cancel() {
  1054. this.open = false
  1055. this.approve = false
  1056. this.reset()
  1057. },
  1058. // 表单重置
  1059. reset() {
  1060. this.form = {
  1061. fId: null,
  1062. fBillno: null,
  1063. fCtrlcorpid: null,
  1064. fCorpid: null,
  1065. tMblno: null,
  1066. fAmtdr: null,
  1067. fAmtcr: null,
  1068. fBilltype: null,
  1069. fBillstatus: '0',
  1070. fRemarks: null,
  1071. fAccbilldate: null,
  1072. delFlag: null,
  1073. createBy: null,
  1074. fDeptid: null,
  1075. createTime: null,
  1076. updateBy: null,
  1077. updateTime: null
  1078. }
  1079. this.resetForm('form')
  1080. },
  1081. /** 搜索按钮操作 */
  1082. handleQuery() {
  1083. this.queryParams.pageNum = 1
  1084. this.getList()
  1085. },
  1086. /** 导入搜索 */
  1087. importSearch() {
  1088. // .join(',')
  1089. this.chargeList_s = []
  1090. if(this.queryParameter.fStatementNo){
  1091. this.rules = {}
  1092. search(this.queryParameter).then(response => {
  1093. this.chargeList_s = response.rows
  1094. this.$message.success('查询成功1');
  1095. for (let item in this.chargeList_s){
  1096. this.totAL += Number(this.chargeList_s[item].fAmt)
  1097. this.Ttime += Number(this.chargeList_s[item].fAmtdr)
  1098. }
  1099. })
  1100. }else {
  1101. this.rules = {
  1102. fToCorpid: [
  1103. { required: true, message: ' ', trigger: 'blur' }
  1104. ],
  1105. timeExamine: [
  1106. { required: true, message: ' ', trigger: 'blur' }
  1107. ]
  1108. }
  1109. if (this.rules){
  1110. this.$refs['form'].validate(valid => {
  1111. if (valid) {
  1112. search(this.queryParameter).then(response => {
  1113. this.chargeList_s = response.rows
  1114. this.$message.success('查询成功2');
  1115. this.totAL = 0
  1116. this.Ttime = 0
  1117. for (let item in this.chargeList_s){
  1118. this.totAL += Number(this.chargeList_s[item].fAmt)
  1119. this.Ttime += Number(this.chargeList_s[item].fAmtdr)
  1120. }
  1121. })
  1122. }
  1123. })
  1124. }else {
  1125. this.$message.error('操作频繁');
  1126. }
  1127. }
  1128. },
  1129. /** 远程模糊查询用户 */
  1130. corpsRemoteMethod(name) {
  1131. if (name == null || name === '') {
  1132. return false
  1133. }
  1134. let queryParams = { pageNum: 1, pageSize: 10, fName: name, type: 1 }
  1135. listCorps(queryParams).then((response) => {
  1136. this.fMblnoOptions = response.rows
  1137. this.KHblnoOptions = response.rows
  1138. })
  1139. },
  1140. /** 重置按钮操作 */
  1141. resetQuery() {
  1142. this.tableFilter = {
  1143. pageNum: 1,
  1144. pageSize: 10,
  1145. fBillno: null,
  1146. fCtrlcorpid: null,
  1147. fCorpid: null,
  1148. tMblno: null,
  1149. fAmtdr: null,
  1150. fAmtcr: null,
  1151. fBilltype: null,
  1152. fBillstatus: null,
  1153. fRemarks: null,
  1154. fAccbilldate: null,
  1155. fDeptid: null
  1156. }
  1157. this.handleQuery()
  1158. },
  1159. //导入重置按钮
  1160. resetQuery_s() {
  1161. this.queryParameter = {
  1162. fCorpid: '',
  1163. fToCorpid: '',
  1164. fMblno: '',
  1165. fStatementNo: '',
  1166. fFeeid: '',
  1167. timeExamine: '',
  1168. timeInterval: ''
  1169. }
  1170. },
  1171. // 远程模糊查询费用名称
  1172. fWRemoteMethod(name) {
  1173. this.fWbuOptions = []
  1174. if (name == null || name === '') {
  1175. return false
  1176. }
  1177. let queryParams = { pageNum: 1, pageSize: 10, fName: name }
  1178. listFees(queryParams).then((response) => {
  1179. this.fWbuOptions = response.rows
  1180. })
  1181. },
  1182. /** 新增按钮操作 */
  1183. handleAdd() {
  1184. this.notChange = false
  1185. this.hide = true
  1186. this.reset()
  1187. this.pass = {
  1188. fAmtdr: 0, //应收合计
  1189. fAmtcr: 0, //应付合计
  1190. fMblno: '', //提单号
  1191. fName: '', //货权方
  1192. fFeesName: '', //结算单位
  1193. fCorpid: '' //结算单位ID
  1194. },
  1195. // this.queryParams = []
  1196. this.increase_s = []
  1197. this.queryParams = {
  1198. pageNum: 1,
  1199. pageSize: 10,
  1200. fBillno: null,
  1201. fCtrlcorpid: null,
  1202. fCorpid: null,
  1203. tMblno: null,
  1204. fAmtdr: null,
  1205. fAmtcr: null,
  1206. fBilltype: null,
  1207. fBillstatus: null,
  1208. fRemarks: null,
  1209. fAccbilldate: null,
  1210. fDeptid: null
  1211. }
  1212. this.resetForm('queryParams')
  1213. this.open = true
  1214. this.title = '添加财务数据主'
  1215. },
  1216. /** 修改按钮操作 */
  1217. handleUpdate(row) {
  1218. this.approve = false
  1219. this.hide = false
  1220. this.notChange = false
  1221. this.reset()
  1222. this.pass = {
  1223. fAmtdr: 0, //应收合计
  1224. fAmtcr: 0, //应付合计
  1225. fMblno: '', //提单号
  1226. fName: '', //货权方
  1227. fFeesName: '', //结算单位
  1228. fCorpid: '' //结算单位ID
  1229. }
  1230. const fId = row.fId || this.ids
  1231. getCharge(fId).then(response => {
  1232. this.Operator = response.data.tFee.createBy
  1233. this.increase_s = response.data.feeDoList
  1234. this.fWbuOptions = response.data.feesList
  1235. this.queryParams = response.data.tFee
  1236. this.fWbuOptions = response.data.feesList
  1237. this.fMblnoOptions = response.data.corps
  1238. this.open = true
  1239. this.title = '修改付费列表'
  1240. })
  1241. },
  1242. /** 提交按钮 */
  1243. submitForm() {
  1244. this.$refs['ruless'].validate(valid => {
  1245. if (valid) {
  1246. if (this.queryParams.fId == null) {
  1247. // this.chargeList.fBillstatus = '1'
  1248. this.queryParams.fBillstatus = '1'
  1249. let formData = new window.FormData()
  1250. formData.append('tFee', JSON.stringify(this.queryParams))
  1251. formData.append('tFeeDo', JSON.stringify(this.increase_s))
  1252. addCharge(formData).then(response => {
  1253. this.msgSuccess('新增成功')
  1254. // this.increase_s = []
  1255. // this.open = false
  1256. this.getList()
  1257. })
  1258. } else {
  1259. this.pass.fAmtcr = 0
  1260. this.pass.fAmtdr = 0
  1261. for (let item in this.increase_s) {
  1262. this.pass.fAmtcr += Number(this.increase_s[item].fAmt)
  1263. this.pass.fAmtdr += Number(this.increase_s[item].fAmtdr)
  1264. }
  1265. this.queryParams.fAmtcr = Number(this.pass.fAmtcr.toFixed(2))
  1266. this.queryParams.fAmtdr = Number(this.pass.fAmtdr.toFixed(2))
  1267. this.pass.fAmtcr.toFixed(2)
  1268. this.queryParams.fBillstatus = '1'
  1269. let formData = new window.FormData()
  1270. formData.append('tFee', JSON.stringify(this.queryParams))
  1271. formData.append('tFeeDo', JSON.stringify(this.increase_s))
  1272. addCharge(formData).then(response => {
  1273. this.msgSuccess('修改成功')
  1274. // this.increase_s = []
  1275. // this.open = false
  1276. this.getList()
  1277. })
  1278. }
  1279. }
  1280. })
  1281. },
  1282. /** 删除按钮操作 */
  1283. handleDelete(row) {
  1284. const fIds = row.fId || this.ids
  1285. let tips = ''
  1286. delCharge_s(fIds).then(data => {
  1287. switch (data.msg) {
  1288. case '0': {
  1289. this.$message.error('当前数据已被其他操作员操作请刷新页面')
  1290. break
  1291. }
  1292. case '1': {
  1293. tips = '当前主表有数据从表无数据是否删除'
  1294. this.delete_S(fIds, tips)
  1295. break
  1296. }
  1297. case '2': {
  1298. tips = '当前主表有数据从表有数据是否删除'
  1299. this.delete_S(fIds, tips)
  1300. break
  1301. }
  1302. default:{
  1303. return this.$message.error('未知错误,无状态')
  1304. }
  1305. }
  1306. })
  1307. },
  1308. delete_S(fIds, tips) {
  1309. this.$confirm(tips, '警告', {
  1310. confirmButtonText: '确定',
  1311. cancelButtonText: '取消',
  1312. type: 'warning'
  1313. }).then(function() {
  1314. return delCharge(fIds)
  1315. }).then(() => {
  1316. this.getList()
  1317. this.msgSuccess('删除成功')
  1318. })
  1319. },
  1320. /** 导出按钮操作 */
  1321. handleExport() {
  1322. const queryParams = this.queryParams
  1323. this.$confirm('是否确认导出所有财务数据主数据项?', '警告', {
  1324. confirmButtonText: '确定',
  1325. cancelButtonText: '取消',
  1326. type: 'warning'
  1327. }).then(function() {
  1328. return exportCharge(queryParams)
  1329. }).then(response => {
  1330. this.download(response.msg)
  1331. })
  1332. },
  1333. //清空一行
  1334. deleteRow(index, rows) {
  1335. this.queryParams.fAmtcr = 0
  1336. this.queryParams.fAmtdr = 0
  1337. rows.splice(index, 1)
  1338. for (let item in this.increase_s) {
  1339. this.queryParams.fAmtcr += this.increase_s[item].fAmt
  1340. this.queryParams.fAmtdr += this.increase_s[item].fAmtdr
  1341. }
  1342. }
  1343. }
  1344. }
  1345. </script>