index.vue 46 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352
  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="getSummaries"
  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. //提单号暂存
  564. fMblno: '',
  565. // 财务数据主表格数据
  566. chargeList: [],
  567. // 弹出层标题
  568. title: '',
  569. // 是否显示弹出层
  570. open: false,
  571. fMblnoOptions: '',
  572. //导入查询参数
  573. queryParameter: {
  574. fCorpid: '',
  575. fToCorpid: '',
  576. fMblno: '',
  577. fStatementNo: '',
  578. fFeeid: '',
  579. timeExamine: '',
  580. timeInterval: ''
  581. },
  582. empty: [],
  583. //导入从表传主表
  584. pass: {
  585. fAmtdr: '', //应收合计
  586. fAmtcr: '', //应付合计
  587. fMblno: '', //提单号
  588. fName: '' //货权方
  589. },
  590. Xbutton:true,
  591. // 查询参数
  592. queryParams: {
  593. fId: null,
  594. pageNum: 1,
  595. pageSize: 10,
  596. fBillno: null,
  597. fCtrlcorpid: null,
  598. fCorpid: null,
  599. tMblno: null,
  600. fAmtdr: null,
  601. fAmtcr: null,
  602. fBilltype: null,
  603. fBillstatus: null,
  604. fRemarks: null,
  605. fAccbilldate: null,
  606. fDeptid: null
  607. },
  608. addOrUpdateVisib: false,
  609. // 主表查询参数
  610. tableFilter: {
  611. pageNum: 1,
  612. pageSize: 10,
  613. fBillno: null,
  614. fCtrlcorpid: null,
  615. fCorpid: null,
  616. tMblno: null,
  617. fAmtdr: null,
  618. fAmtcr: null,
  619. fBilltype: null,
  620. fBillstatus: null,
  621. fRemarks: null,
  622. fAccbilldate: null,
  623. fDeptid: null
  624. },
  625. approval:[],
  626. // 表单参数
  627. form: {},
  628. // 表单校验
  629. ruless: {
  630. fCtrlcorpid: [
  631. { required: true, message: ' ', trigger: 'blur' }
  632. ],
  633. fCorpid: [
  634. { required: true, message: ' ', trigger: 'blur' }
  635. ],
  636. fAccbilldate: [
  637. { required: true, message: ' ', trigger: 'blur' }
  638. ]
  639. },
  640. // 表单校验
  641. rules: {
  642. fBilltype: [
  643. { required: true, message: ' ', trigger: 'change' }
  644. ],
  645. fBillstatus: [
  646. { required: true, message: ' ', trigger: 'blur' }
  647. ],
  648. fDeptid: [
  649. { required: true, message: ' ', trigger: 'blur' }
  650. ],
  651. fToCorpid: [
  652. { required: true, message: ' ', trigger: 'blur' }
  653. ],
  654. timeExamine: [
  655. { required: true, message: ' ', trigger: 'blur' }
  656. ]
  657. }
  658. }
  659. },
  660. components: {
  661. AddOrUpdate,
  662. ApprovalComments
  663. },
  664. created() {
  665. this.getList()
  666. this.register()
  667. },
  668. activated(){
  669. this.adoPt()
  670. },
  671. methods: {
  672. approvalRevocation(){
  673. let data = {
  674. id:this.queryParams.fId,
  675. actId:this.contrastId,
  676. billId:this.queryParams.fId
  677. }
  678. console.log(this.queryParams)
  679. revocation(data).then(data =>{
  680. console.log(data)
  681. if (data.code === 200){
  682. this.$message.success('撤销成功');
  683. this.open = false
  684. }
  685. })
  686. },
  687. returnData(){
  688. this.addOrUpdateVisib = false
  689. this.open = false
  690. this.homepaGe()
  691. },
  692. getDataList(){
  693. this.addOrUpdateVisible = false
  694. },
  695. homepaGe(){
  696. let view = {
  697. fullPath: "/finance/charge",
  698. hash: "",
  699. matched: Array(2),
  700. meta: Object,
  701. name: "Charge",
  702. params: Object,
  703. path: "/finance/charge",
  704. query: Object,
  705. title: "收费"
  706. }
  707. this.$router.push({ path: '/index'})
  708. this.$store.dispatch('tagsView/delView', view).then(({ visitedViews }) => {
  709. if (this.isActive(view)) {
  710. this.toLastView(visitedViews, view)
  711. }
  712. })
  713. Global.$emit("removeCache", "closeSelectedTag", view);
  714. },
  715. adoPt(){
  716. this.approval = this.$route.query.data
  717. if (this.approval){
  718. this.Xbutton = false
  719. this.approval = JSON.parse(this.approval)
  720. this.hide = false
  721. this.notChange = true
  722. this.approve = true
  723. this.cancelButton = false
  724. this.reset()
  725. this.pass = {
  726. fAmtdr: '', //应收合计
  727. fAmtcr: '', //应付合计
  728. fMblno: '', //提单号
  729. fName: '', //货权方
  730. fFeesName: '', //结算单位
  731. fCorpid: '' //结算单位ID
  732. }
  733. getCharge(this.approval.billId).then(response => {
  734. console.log(response)
  735. this.Operator = response.data.tFee.createBy
  736. this.increase_s = response.data.feeDoList
  737. this.fWbuOptions = response.data.feesList
  738. this.queryParams = response.data.tFee
  739. this.fWbuOptions = response.data.feesList
  740. this.fMblnoOptions = response.data.corps
  741. this.open = true
  742. this.title = '修改收费列表'
  743. })
  744. }
  745. },
  746. homePage(){
  747. this.open = false
  748. let view = {
  749. fullPath: "/finance/charge",
  750. hash: "",
  751. matched: Array(2),
  752. meta: Object,
  753. name: "Charge",
  754. params: Object,
  755. path: "/finance/charge",
  756. query: Object,
  757. title: "收费"
  758. }
  759. this.$router.push({ path: '/index'})
  760. this.$store.dispatch('tagsView/delView', view).then(({ visitedViews }) => {
  761. if (this.isActive(view)) {
  762. this.toLastView(visitedViews, view)
  763. }
  764. })
  765. Global.$emit("removeCache", "closeSelectedTag", view);
  766. },
  767. register(){
  768. queryUserVal().then((response)=>{
  769. this.Lander = response.user.userName
  770. })
  771. },
  772. immediateApproval(){
  773. this.addOrUpdateVisib = true
  774. console.log(this.approval)
  775. this.$nextTick(() => {
  776. this.$refs.ApprovalComments.init(this.approval.billId,this.approval.actId)
  777. })
  778. },
  779. // 查看审批流
  780. addOrUpdateHandle(){
  781. this.addOrUpdateVisible = true
  782. this.addOrUpdateVisib = false
  783. let id = '448'
  784. let actId = '110'
  785. console.log(this.queryParams.fId)
  786. this.$nextTick(() => {
  787. this.$refs.addOrUpdate.init(this.queryParams.fId,this.contrastId)
  788. })
  789. },
  790. // 撤销收费
  791. revokeCharge(){
  792. this.queryParams.fBillstatus = '1'
  793. let formDate = new window.FormData()
  794. formDate.append('tFee', JSON.stringify(this.queryParams))
  795. formDate.append('tFeeDo', JSON.stringify(this.increase_s))
  796. backCharge(formDate).then(response => {
  797. this.open = false
  798. this.msgSuccess('操作成功')
  799. this.getList()
  800. })
  801. },
  802. // 查看按钮
  803. check(row,res){
  804. console.log(row.fId)
  805. this.notChange = true
  806. getCharge(row.fId).then(response => {
  807. console.log(response)
  808. this.Operator = response.data.tFee.createBy
  809. this.increase_s = response.data.feeDoList
  810. this.fWbuOptions = response.data.feesList
  811. this.queryParams = response.data.tFee
  812. this.fWbuOptions = response.data.feesList
  813. this.fMblnoOptions = response.data.corps
  814. this.open = true
  815. this.title = '收费列表'
  816. console.log(this.Lander)
  817. console.log(this.Operator)
  818. this.tablefilter = true
  819. if (res == 1){
  820. this.notChange = true
  821. if (this.Operator == this.Lander){
  822. this.tablefilter = false
  823. this.reset()
  824. this.pass = {
  825. fAmtdr: '', //应收合计
  826. fAmtcr: '', //应付合计
  827. fMblno: '', //提单号
  828. fName: '', //货权方
  829. fFeesName: '', //结算单位
  830. fCorpid: '' //结算单位ID
  831. }
  832. const fId = row.fId || this.ids
  833. console.log(fId)
  834. getCharge(fId).then(response => {
  835. console.log(response)
  836. this.increase_s = response.data.feeDoList
  837. this.fWbuOptions = response.data.feesList
  838. this.queryParams = response.data.tFee
  839. this.fWbuOptions = response.data.feesList
  840. this.fMblnoOptions = response.data.corps
  841. this.open = true
  842. })
  843. }else {
  844. this.notChange = true
  845. // this.$message.error('未知异常,请联系管理员')
  846. }
  847. }else {
  848. this.notChange = true
  849. this.reset()
  850. this.pass = {
  851. fAmtdr: '', //应收合计
  852. fAmtcr: '', //应付合计
  853. fMblno: '', //提单号
  854. fName: '', //货权方
  855. fFeesName: '', //结算单位
  856. fCorpid: '' //结算单位ID
  857. }
  858. const fId = row.fId || this.ids
  859. console.log(fId)
  860. getCharge(fId).then(response => {
  861. console.log(response)
  862. this.increase_s = response.data.feeDoList
  863. this.fWbuOptions = response.data.feesList
  864. this.queryParams = response.data.tFee
  865. this.fWbuOptions = response.data.feesList
  866. this.fMblnoOptions = response.data.corps
  867. this.open = true
  868. })
  869. }
  870. })
  871. },
  872. //打印功能
  873. printing() {
  874. if (this.increase_s.length !== 0) {
  875. this.printStatus = true
  876. this.printObject = this.increase_s
  877. } else {
  878. this.$message.error('无数据,请检查是否有数据')
  879. }
  880. },
  881. //确认打印
  882. printSomething() {
  883. console.log('22222')
  884. // 此处的style即为打印时的样式
  885. const style ='table tr td,th { border-collapse: collapse;padding:15px;border:.5px #000 solid;text-align:center;}'
  886. print({
  887. printable: 'print_area2',
  888. type: 'html',
  889. style: style, // 亦可使用引入的外部css;
  890. scanStyles: false
  891. })
  892. },
  893. //关闭打印弹窗
  894. closePrinting() {
  895. this.$confirm('确认关闭?')
  896. .then(_ => {
  897. this.printStatus = false
  898. })
  899. .catch(_ => {
  900. })
  901. },
  902. // 确认收费
  903. confirmCharge() {
  904. console.log(this.increase_s)
  905. this.$refs['ruless'].validate(valid => {
  906. if (valid) {
  907. if(this.increase_s.length){
  908. this.queryParams.fBillstatus = '4'
  909. let formDate = new window.FormData()
  910. formDate.append('tFee', JSON.stringify(this.queryParams))
  911. formDate.append('tFeeDo', JSON.stringify(this.increase_s))
  912. collectFee(formDate).then(response => {
  913. console.log(response)
  914. this.open = false
  915. this.msgSuccess('操作成功')
  916. this.getList()
  917. })
  918. }else {
  919. this.$message.error('表单为空不允许操作');
  920. }
  921. }
  922. })
  923. },
  924. charGe() {
  925. this.queryParameter = {
  926. fToCorpid: this.queryParams.fCorpid,
  927. }
  928. // this.queryParameter.fToCorpid = this.queryParams.fCorpid
  929. this.innerVisible = true
  930. },
  931. getSummaries(param) {
  932. const { columns, data } = param
  933. const sums = []
  934. columns.forEach((column, index) => {
  935. const values = data.map(item => Number(item[column.property]))
  936. if (!values.every(value => isNaN(value))) {
  937. sums[index] = values.reduce((prev, curr) => {
  938. const value = Number(curr)
  939. if (!isNaN(value)) {
  940. return prev + curr
  941. } else {
  942. return prev
  943. }
  944. }, 0)
  945. sums[0] = '合计'
  946. sums[3] = ''
  947. }
  948. })
  949. return sums
  950. },
  951. imgChangeI(row) {
  952. if (row.fAmt && Number(row.fAmt) > Number(row.fAmtdr)) {
  953. this.$set(row, 'fAmt', row.fAmtdr)
  954. this.state_s = true
  955. }
  956. console.log('数据:' + JSON.stringify(this.selection))
  957. // this.$refs.chargeList.clearSelection()
  958. },
  959. //确认导入
  960. confirmImport() {
  961. this.hide = true
  962. console.log(this.state_s)
  963. for (let item in this.selection) {
  964. this.pass.fAmtcr = Number(this.pass.fAmtcr)
  965. this.pass.fAmtdr = Number(this.pass.fAmtdr)
  966. this.pass.fAmtcr += Number(this.selection[item].fAmt)
  967. this.pass.fAmtdr += Number(this.selection[item].fAmtdr)
  968. console.log(this.pass.fAmtcr)
  969. console.log(this.pass.fAmtdr)
  970. }
  971. if (this.state_s == true) {
  972. if (this.selection.length == '0') {
  973. console.log('未选择')//写入提示
  974. this.$message.error('未选择导入行')
  975. } else {
  976. console.log(this.selection[0].fMblno)
  977. for (let item in this.selection) {
  978. this.empty.push(this.selection[item].fMblno)
  979. this.nothing.push(this.selection[item].fName)
  980. }
  981. //去重提单号
  982. this.empty = new Set(this.empty)
  983. this.empty = Array.from(this.empty)
  984. //去重货权方
  985. this.nothing = new Set(this.nothing)
  986. this.nothing = Array.from(this.nothing)
  987. if (this.empty.length <= 1) {
  988. this.pass.fMblno = this.empty[0]
  989. console.log(this.pass.fMblno)
  990. } else {
  991. this.pass.fMblno = this.empty[0] + '...'
  992. console.log(this.pass.fMblno)
  993. }
  994. if (this.nothing.length <= 1) {
  995. this.pass.fName = this.nothing[0]
  996. } else {
  997. this.pass.fName = this.nothing[0] + '...'
  998. }
  999. this.increase_s = this.increase_s.concat(this.selection)
  1000. this.queryParams.tMblno = this.pass.fMblno //提单号
  1001. this.queryParams.fCtrlcorpid = this.pass.fName
  1002. this.queryParams.fCorpid = this.queryParameter.fToCorpid
  1003. this.queryParams.fAmtcr = this.pass.fAmtcr
  1004. this.queryParams.fAmtdr = this.pass.fAmtdr
  1005. console.log(this.queryParams)
  1006. this.innerVisible = false
  1007. this.chargeList_s = []
  1008. this.queryParameter = {
  1009. fCorpid: '',
  1010. fToCorpid: '',
  1011. fMblno: '',
  1012. fStatementNo: '',
  1013. fFeeid: '',
  1014. timeExamine: '',
  1015. timeInterval: ''
  1016. }
  1017. }
  1018. } else if (this.state_s == false) {
  1019. this.$message.error('本次金额不能大于原定金额')
  1020. }
  1021. },
  1022. /** 查询财务数据主列表 */
  1023. getList() {
  1024. this.loading = true
  1025. this.getDicts('approval_process').then((response) => {
  1026. this.options = response.data
  1027. })
  1028. listCharge(this.tableFilter).then(response => {
  1029. console.log(response)
  1030. this.chargeList = response.rows
  1031. this.total = response.total
  1032. this.loading = false
  1033. })
  1034. },
  1035. // 取消按钮
  1036. cancel() {
  1037. this.open = false
  1038. this.approve = false
  1039. this.reset()
  1040. },
  1041. // 表单重置
  1042. reset() {
  1043. this.form = {
  1044. fId: null,
  1045. fBillno: null,
  1046. fCtrlcorpid: null,
  1047. fCorpid: null,
  1048. tMblno: null,
  1049. fAmtdr: null,
  1050. fAmtcr: null,
  1051. fBilltype: null,
  1052. fBillstatus: '0',
  1053. fRemarks: null,
  1054. fAccbilldate: null,
  1055. delFlag: null,
  1056. createBy: null,
  1057. fDeptid: null,
  1058. createTime: null,
  1059. updateBy: null,
  1060. updateTime: null
  1061. }
  1062. this.resetForm('form')
  1063. },
  1064. /** 搜索按钮操作 */
  1065. handleQuery() {
  1066. this.queryParams.pageNum = 1
  1067. this.getList()
  1068. console.log(this.tableFilter)
  1069. },
  1070. /** 导入搜索 */
  1071. importSearch() {
  1072. console.log(this.queryParameter)
  1073. // console.log(this.queryParameter[0].fFeeid.join(','))
  1074. // .join(',')
  1075. this.chargeList_s = []
  1076. if(this.queryParameter.fStatementNo){
  1077. this.rules = {}
  1078. search(this.queryParameter).then(response => {
  1079. this.chargeList_s = response.rows
  1080. this.$message.success('查询成功');
  1081. })
  1082. }else {
  1083. this.rules = {
  1084. fToCorpid: [
  1085. { required: true, message: ' ', trigger: 'blur' }
  1086. ],
  1087. timeExamine: [
  1088. { required: true, message: ' ', trigger: 'blur' }
  1089. ]
  1090. }
  1091. if (this.rules){
  1092. this.$refs['form'].validate(valid => {
  1093. if (valid) {
  1094. search(this.queryParameter).then(response => {
  1095. this.chargeList_s = response.rows
  1096. this.$message.success('查询成功');
  1097. })
  1098. }
  1099. })
  1100. }else {
  1101. this.$message.error('操作频繁');
  1102. }
  1103. }
  1104. },
  1105. /** 远程模糊查询用户 */
  1106. corpsRemoteMethod(name) {
  1107. if (name == null || name === '') {
  1108. return false
  1109. }
  1110. let queryParams = { pageNum: 1, pageSize: 10, fName: name, type: 1 }
  1111. listCorps(queryParams).then((response) => {
  1112. this.fMblnoOptions = response.rows
  1113. this.KHblnoOptions = response.rows
  1114. })
  1115. },
  1116. /** 重置按钮操作 */
  1117. resetQuery() {
  1118. this.tableFilter = {
  1119. pageNum: 1,
  1120. pageSize: 10,
  1121. fBillno: null,
  1122. fCtrlcorpid: null,
  1123. fCorpid: null,
  1124. tMblno: null,
  1125. fAmtdr: null,
  1126. fAmtcr: null,
  1127. fBilltype: null,
  1128. fBillstatus: null,
  1129. fRemarks: null,
  1130. fAccbilldate: null,
  1131. fDeptid: null
  1132. }
  1133. this.handleQuery()
  1134. },
  1135. //导入重置按钮
  1136. resetQuery_s() {
  1137. this.queryParameter = {
  1138. fCorpid: '',
  1139. fToCorpid: '',
  1140. fMblno: '',
  1141. fStatementNo: '',
  1142. fFeeid: '',
  1143. timeExamine: '',
  1144. timeInterval: ''
  1145. }
  1146. },
  1147. // 远程模糊查询费用名称
  1148. fWRemoteMethod(name) {
  1149. this.fWbuOptions = []
  1150. if (name == null || name === '') {
  1151. return false
  1152. }
  1153. let queryParams = { pageNum: 1, pageSize: 10, fName: name }
  1154. listFees(queryParams).then((response) => {
  1155. console.log(this.fWbuOptions)
  1156. this.fWbuOptions = response.rows
  1157. })
  1158. },
  1159. // 多选框选中数据
  1160. handleSelectionChange(selection) {
  1161. this.ids = selection.map(item => item.fId)
  1162. this.single = selection.length !== 1
  1163. this.multiple = !selection.length
  1164. },
  1165. // 导入多选框
  1166. handleSelectionChange_s(selection) {
  1167. console.log(selection)
  1168. this.selection = selection
  1169. },
  1170. /** 新增按钮操作 */
  1171. handleAdd() {
  1172. this.notChange = false
  1173. this.hide = true
  1174. this.reset()
  1175. this.pass = {
  1176. fAmtdr: '', //应收合计
  1177. fAmtcr: '', //应付合计
  1178. fMblno: '', //提单号
  1179. fName: '', //货权方
  1180. fFeesName: '', //结算单位
  1181. fCorpid: '' //结算单位ID
  1182. },
  1183. // this.queryParams = []
  1184. this.increase_s = []
  1185. this.queryParams = {
  1186. pageNum: 1,
  1187. pageSize: 10,
  1188. fBillno: null,
  1189. fCtrlcorpid: null,
  1190. fCorpid: null,
  1191. tMblno: null,
  1192. fAmtdr: null,
  1193. fAmtcr: null,
  1194. fBilltype: null,
  1195. fBillstatus: null,
  1196. fRemarks: null,
  1197. fAccbilldate: null,
  1198. fDeptid: null
  1199. }
  1200. this.resetForm('queryParams')
  1201. this.open = true
  1202. this.title = '添加财务数据主'
  1203. },
  1204. /** 修改按钮操作 */
  1205. handleUpdate(row) {
  1206. console.log(row)
  1207. this.approve = false
  1208. this.hide = false
  1209. this.notChange = false
  1210. this.reset()
  1211. this.pass = {
  1212. fAmtdr: '', //应收合计
  1213. fAmtcr: '', //应付合计
  1214. fMblno: '', //提单号
  1215. fName: '', //货权方
  1216. fFeesName: '', //结算单位
  1217. fCorpid: '' //结算单位ID
  1218. }
  1219. const fId = row.fId || this.ids
  1220. console.log(fId)
  1221. getCharge(fId).then(response => {
  1222. console.log(response)
  1223. this.Operator = response.data.tFee.createBy
  1224. this.increase_s = response.data.feeDoList
  1225. this.fWbuOptions = response.data.feesList
  1226. this.queryParams = response.data.tFee
  1227. this.fWbuOptions = response.data.feesList
  1228. this.fMblnoOptions = response.data.corps
  1229. this.open = true
  1230. this.title = '修改收费列表'
  1231. })
  1232. },
  1233. /** 提交按钮 */
  1234. submitForm() {
  1235. console.log(this.queryParameter)
  1236. this.$refs['ruless'].validate(valid => {
  1237. console.log(valid)
  1238. if (valid) {
  1239. if (this.queryParams.fId == null) {
  1240. console.log(this.queryParams)
  1241. // this.chargeList.fBillstatus = '1'
  1242. this.queryParams.fBillstatus = '1'
  1243. let formData = new window.FormData()
  1244. formData.append('tFee', JSON.stringify(this.queryParams))
  1245. formData.append('tFeeDo', JSON.stringify(this.increase_s))
  1246. addCharge(formData).then(response => {
  1247. this.msgSuccess('新增成功')
  1248. // this.increase_s = []
  1249. // this.open = false
  1250. this.getList()
  1251. })
  1252. } else {
  1253. console.log(this.queryParams)
  1254. this.queryParams.fBillstatus = '1'
  1255. let formData = new window.FormData()
  1256. formData.append('tFee', JSON.stringify(this.queryParams))
  1257. formData.append('tFeeDo', JSON.stringify(this.increase_s))
  1258. addCharge(formData).then(response => {
  1259. this.msgSuccess('修改成功')
  1260. // this.increase_s = []
  1261. // this.open = false
  1262. this.getList()
  1263. })
  1264. }
  1265. }
  1266. })
  1267. },
  1268. /** 删除按钮操作 */
  1269. handleDelete(row) {
  1270. const fIds = row.fId || this.ids
  1271. console.log(fIds)
  1272. let tips = ''
  1273. delCharge_s(fIds).then(data => {
  1274. console.log(data)
  1275. switch (data.msg) {
  1276. case '0': {
  1277. this.$message.error('当前数据已被其他操作员操作请刷新页面')
  1278. break
  1279. }
  1280. case '1': {
  1281. tips = '当前主表有数据从表无数据是否删除'
  1282. this.delete_S(fIds, tips)
  1283. break
  1284. }
  1285. case '2': {
  1286. tips = '当前主表有数据从表有数据是否删除'
  1287. this.delete_S(fIds, tips)
  1288. break
  1289. }
  1290. default:{
  1291. return this.$message.error('未知错误,无状态')
  1292. }
  1293. }
  1294. })
  1295. },
  1296. delete_S(fIds, tips) {
  1297. this.$confirm(tips, '警告', {
  1298. confirmButtonText: '确定',
  1299. cancelButtonText: '取消',
  1300. type: 'warning'
  1301. }).then(function() {
  1302. return delCharge(fIds)
  1303. }).then(() => {
  1304. this.getList()
  1305. this.msgSuccess('删除成功')
  1306. })
  1307. },
  1308. /** 导出按钮操作 */
  1309. handleExport() {
  1310. const queryParams = this.queryParams
  1311. this.$confirm('是否确认导出所有财务数据主数据项?', '警告', {
  1312. confirmButtonText: '确定',
  1313. cancelButtonText: '取消',
  1314. type: 'warning'
  1315. }).then(function() {
  1316. return exportCharge(queryParams)
  1317. }).then(response => {
  1318. this.download(response.msg)
  1319. })
  1320. },
  1321. //清空一行
  1322. deleteRow(index, rows) {
  1323. this.queryParams.fAmtcr = 0
  1324. this.queryParams.fAmtdr = 0
  1325. rows.splice(index, 1)
  1326. for (let item in this.increase_s) {
  1327. console.log(this.increase_s[item])
  1328. this.queryParams.fAmtcr += this.increase_s[item].fAmt
  1329. this.queryParams.fAmtdr += this.increase_s[item].fAmtdr
  1330. }
  1331. console.log(this.queryParams.fAmtdr)
  1332. console.log(this.queryParams.fAmtcr)
  1333. }
  1334. }
  1335. }
  1336. </script>