index.vue 46 KB

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