index.vue 50 KB

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