index.vue 47 KB

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