index.vue 47 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389
  1. <template>
  2. <div class="app-container">
  3. <el-form :model="tableFilter" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
  4. <el-form-item label="系统编号" prop="fCtrlcorpid">
  5. <el-input
  6. v-model="tableFilter.fBillno"
  7. placeholder="请输入系统编号"
  8. clearable
  9. size="small"
  10. style="width:200px"
  11. @keyup.enter.native="handleQuery"
  12. />
  13. </el-form-item>
  14. <el-form-item label="货权方" prop="fCtrlcorpid">
  15. <el-input
  16. v-model="tableFilter.fCtrlcorpid"
  17. placeholder="请输入货权方"
  18. clearable
  19. size="small"
  20. style="width:200px"
  21. @keyup.enter.native="handleQuery"
  22. />
  23. </el-form-item>
  24. <el-form-item label="结算单位" prop="fCorpid">
  25. <el-select
  26. v-model="tableFilter.fCorpid"
  27. filterable
  28. remote
  29. clearable
  30. size="small"
  31. style="width: 200px"
  32. @keyup.enter.native="handleQuery"
  33. :remote-method="corpsRemoteMethod"
  34. placeholder="请输入结算单位"
  35. >
  36. <el-option
  37. v-for="(dict, index) in fMblnoOptions"
  38. :key="index.fId"
  39. :label="dict.fName"
  40. :value="dict.fId"
  41. ></el-option>
  42. </el-select>
  43. </el-form-item>
  44. <el-form-item label="对账日期" prop="fAccbilldate">
  45. <el-date-picker
  46. type="daterange"
  47. size="small"
  48. style="width: 240px"
  49. v-model="tableFilter.fAccbilldate"
  50. start-placeholder="开始日期"
  51. end-placeholder="结束日期"
  52. value-format="yyyy-MM-dd"
  53. :default-time="['00:00:00', '23:59:59']"
  54. >
  55. </el-date-picker>
  56. </el-form-item>
  57. <el-form-item>
  58. <el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
  59. <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
  60. </el-form-item>
  61. </el-form>
  62. <el-row :gutter="10" class="mb8">
  63. <el-col :span="1.5">
  64. <el-button
  65. type="primary"
  66. icon="el-icon-plus"
  67. size="mini"
  68. @click="handleAdd"
  69. v-hasPermi="['finance:payment:add']"
  70. >新增
  71. </el-button>
  72. </el-col>
  73. <el-col :span="1.5">
  74. <el-button
  75. type="success"
  76. icon="el-icon-edit"
  77. size="mini"
  78. :disabled="single"
  79. @click="handleUpdate"
  80. v-hasPermi="['finance:payment:edit']"
  81. >修改
  82. </el-button>
  83. </el-col>
  84. <!-- <el-col :span="1.5">-->
  85. <!-- <el-button-->
  86. <!-- type="danger"-->
  87. <!-- icon="el-icon-delete"-->
  88. <!-- size="mini"-->
  89. <!-- :disabled="multiple"-->
  90. <!-- @click="handleDelete"-->
  91. <!-- v-hasPermi="['finance:charge:remove']"-->
  92. <!-- >删除-->
  93. <!-- </el-button>-->
  94. <!-- </el-col>-->
  95. <el-col :span="1.5">
  96. <el-button
  97. type="warning"
  98. icon="el-icon-download"
  99. size="mini"
  100. @click="handleExport"
  101. v-hasPermi="['finance:payment:export']"
  102. >导出
  103. </el-button>
  104. </el-col>
  105. <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
  106. </el-row>
  107. <el-table v-loading="loading" :data="chargeList" @selection-change="handleSelectionChange" show-summary :summary-method="listTotal">
  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="" width="120"/>
  124. <el-table-column label="备注" align="center" prop="fRemarks" width="120"/>
  125. <el-table-column label="状态" align="center" prop="fBillstatus" width="120">
  126. <template slot-scope="scope">
  127. <span v-if="scope.row.fBillstatus == '1'">保存</span>
  128. <span v-else-if="scope.row.fBillstatus == '2'">暂存</span>
  129. <span v-else-if="scope.row.fBillstatus == '3'">审批驳回</span>
  130. <span v-else-if="scope.row.fBillstatus == '4'">提交审核</span>
  131. <span v-else-if="scope.row.fBillstatus == '5'">审核中</span>
  132. <span v-else-if="scope.row.fBillstatus == '6'">审核完成</span>
  133. </template>
  134. </el-table-column>
  135. <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
  136. <template slot-scope="scope">
  137. <el-button
  138. size="mini"
  139. type="text"
  140. icon="el-icon-view"
  141. @click="check(scope.row,0)"
  142. v-hasPermi="['finance:payment:edit']"
  143. >查看</el-button
  144. >
  145. <el-button
  146. size="mini"
  147. type="text"
  148. icon="el-icon-view"
  149. @click="check(scope.row,1)"
  150. v-hasPermi="['finance:payment:edit']"
  151. v-if="scope.row.fBillstatus == 4 || scope.row.fBillstatus == 5"
  152. >审批进度</el-button
  153. >
  154. <el-button
  155. size="mini"
  156. type="text"
  157. icon="el-icon-edit"
  158. @click="handleUpdate(scope.row)"
  159. v-hasPermi="['finance:payment:edit']"
  160. v-if="scope.row.fBillstatus <= 3"
  161. >修改
  162. </el-button>
  163. <el-button
  164. size="mini"
  165. type="text"
  166. icon="el-icon-delete"
  167. @click="handleDelete(scope.row)"
  168. v-hasPermi="['finance:payment:remove']"
  169. v-if="scope.row.fBillstatus <= 3"
  170. >删除
  171. </el-button>
  172. <!-- <el-button-->
  173. <!-- size="mini"-->
  174. <!-- type="text"-->
  175. <!-- icon="el-icon-delete"-->
  176. <!-- v-if="scope.row.fBillstatus === 6"-->
  177. <!-- >查看-->
  178. <!-- </el-button>-->
  179. <!-- <el-button-->
  180. <!-- size="mini"-->
  181. <!-- type="text"-->
  182. <!-- icon="el-icon-delete"-->
  183. <!-- v-if="scope.row.fBillstatus > 3 && scope.row.fBillstatus < 6"-->
  184. <!-- >查看审批流-->
  185. <!-- </el-button>-->
  186. </template>
  187. </el-table-column>
  188. <!-- <el-table-column label="单据类型" align="center" prop="fBilltype"/>-->
  189. <!-- <el-table-column label="制单部门" align="center" prop="fDeptid"/>-->
  190. </el-table>
  191. <pagination
  192. v-show="total>0"
  193. :total="total"
  194. :page.sync="queryParams.pageNum"
  195. :limit.sync="queryParams.pageSize"
  196. @pagination="getList"
  197. />
  198. <!-- 添加或修改财务数据主对话框 -->
  199. <el-dialog :close-on-click-modal="false" :title="title" :show-close="Xbutton" :visible.sync="open" width="70%" append-to-body>
  200. <el-form :model="queryParams" :rules="ruless" ref="ruless" :inline="true" v-show="showSearch"
  201. label-width="68px"
  202. >
  203. <el-form-item label="货权方" prop="fCtrlcorpid">
  204. <el-input
  205. v-model="queryParams.fCtrlcorpid"
  206. placeholder="请输入货权方"
  207. clearable
  208. size="small"
  209. :disabled="notChange"
  210. style="width:200px"
  211. @keyup.enter.native="handleQuery"
  212. />
  213. </el-form-item>
  214. <el-form-item label="结算单位" label-width="78px" prop="fCorpid">
  215. <el-select
  216. v-model="queryParams.fCorpid"
  217. filterable
  218. remote
  219. clearable
  220. size="small"
  221. style="width: 200px"
  222. @keyup.enter.native="handleQuery"
  223. :remote-method="corpsRemoteMethod"
  224. :disabled="notChange"
  225. placeholder="请输入结算单位"
  226. >
  227. <el-option
  228. v-for="(dict, index) in fMblnoOptions"
  229. :key="index.fId"
  230. :label="dict.fName"
  231. :value="dict.fId"
  232. ></el-option>
  233. </el-select>
  234. </el-form-item>
  235. <el-form-item label="结算日期" label-width="78px" prop="fAccbilldate">
  236. <el-date-picker clearable size="small" style="width: 200px"
  237. v-model="queryParams.fAccbilldate"
  238. type="date"
  239. value-format="yyyy-MM-dd"
  240. placeholder="选择账单日期"
  241. :disabled="notChange"
  242. >
  243. </el-date-picker>
  244. </el-form-item>
  245. <el-form-item label="系统编号" prop="fBillno">
  246. <el-input
  247. v-model="queryParams.fBillno"
  248. placeholder="请输入系统编号"
  249. clearable
  250. disabled
  251. style="width: 200px"
  252. size="small"
  253. @keyup.enter.native="handleQuery"
  254. />
  255. </el-form-item>
  256. <el-form-item label="备注" prop="fRemarks">
  257. <el-input
  258. v-model="queryParams.fRemarks"
  259. placeholder="请输入备注"
  260. clearable
  261. size="small"
  262. style="width:200px"
  263. :disabled="notChange"
  264. @keyup.enter.native="handleQuery"
  265. />
  266. </el-form-item>
  267. </el-form>
  268. <div style="width: 100%;">
  269. <el-button type="warning" size="small" @click="charGe" :disabled="notChange" v-if="queryParams.fBillstatus < '4'">付费</el-button>
  270. <el-button type="primary" size="small" @click="confirmCharge" :disabled="notChange" v-if="queryParams.fBillstatus < '4'">确认付费</el-button>
  271. <el-button type="success" size="small" @click="revokeCharge" v-if="queryParams.fBillstatus === '6'">撤销付费</el-button>
  272. <!-- <el-button type="info" size="small" @click="printing">打印</el-button>-->
  273. <!-- <el-button type="danger" size="small" :disabled="notChange" v-show="Lander == Operator">撤销审批</el-button>-->
  274. <el-button type="danger" size="small" :disabled="tablefilter" @click="approvalRevocation" v-show="queryParams.fBillstatus === '4'">撤销审批</el-button>
  275. </div>
  276. <el-table v-loading="loading" :data="increase_s" @selection-change="handleSelectionChange_s">
  277. <!-- <el-table-column type="selection" width="55" align="center"/> -->
  278. <el-table-column label="序号" type="index" align="center"/>
  279. <el-table-column label="提单号" align="center" prop="fMblno"/>
  280. <el-table-column label="存货单号" align="center" prop="fBscorpno"/>
  281. <el-table-column label="品名" align="center" prop="fProductName"/>
  282. <el-table-column label="业务日期" align="center" prop="fBsdate">
  283. <template slot-scope="scope">
  284. <span>{{ scope.row.fBsdate.slice(0, 10) }}</span>
  285. </template>
  286. </el-table-column>
  287. <el-table-column label="费用名称" align="center" prop="fFeeName"/>
  288. <el-table-column label="收/付" align="center" prop="fSrcdc">
  289. <template slot-scope="scope">
  290. <span v-if="scope.row.fSrcdc =='D'">收</span>
  291. <span v-else-if="scope.row.fSrcdc =='C'">付</span>
  292. </template>
  293. </el-table-column>
  294. <el-table-column label="业务类型" align="center" prop="fBilltype">
  295. <template slot-scope="scope">
  296. <span v-if="scope.row.fBilltype =='SJRK'">入库</span>
  297. <span v-else-if="scope.row.fBilltype == 'SJCK'">出库</span>
  298. <span v-else>{{ scope.row.fBilltype }}</span>
  299. </template>
  300. </el-table-column>
  301. <el-table-column label="金额" align="center" prop="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/payment'
  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:230,
  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. //付费页面合计
  687. listTotal(param){
  688. const { columns, data } = param
  689. const sums = []
  690. columns.forEach((column, index) => {
  691. if (index === 0) {
  692. sums[index] = '合计'
  693. } else if (index === 6 || index === 7 || index === 8) {
  694. const values = data.map(item => Number(item[column.property]))
  695. if (!values.every(value => isNaN(value))) {
  696. sums[index] = values.reduce((prev, curr) => {
  697. const value = Number(curr)
  698. if (!isNaN(value)) {
  699. return prev + curr
  700. } else {
  701. return prev
  702. }
  703. }, 0)
  704. }
  705. }
  706. })
  707. return sums
  708. },
  709. approvalRevocation(){
  710. let data = {
  711. id:this.queryParams.fId,
  712. actId:this.contrastId,
  713. billId:this.queryParams.fId
  714. }
  715. revocation(data).then(data =>{
  716. if (data.code === 200){
  717. this.$message.success('撤销成功');
  718. this.open = false
  719. this.getList()
  720. }
  721. })
  722. },
  723. returnData(){
  724. this.addOrUpdateVisib = false
  725. this.open = false
  726. this.homepaGe()
  727. },
  728. getDataList(){
  729. this.addOrUpdateVisible = false
  730. },
  731. homepaGe(){
  732. let view = {
  733. fullPath: "/finance/charge",
  734. hash: "",
  735. matched: Array(2),
  736. meta: Object,
  737. name: "Charge",
  738. params: Object,
  739. path: "/finance/charge",
  740. query: Object,
  741. title: "付费"
  742. }
  743. this.$router.push({ path: '/index'})
  744. this.$store.dispatch('tagsView/delView', view).then(({ visitedViews }) => {
  745. if (this.isActive(view)) {
  746. this.toLastView(visitedViews, view)
  747. }
  748. })
  749. Global.$emit("removeCache", "closeSelectedTag", view);
  750. },
  751. adoPt(){
  752. this.approval = this.$route.query.data
  753. if (this.approval){
  754. this.Xbutton = false
  755. this.approval = JSON.parse(this.approval)
  756. this.hide = false
  757. this.tablefilter = true
  758. this.notChange = true
  759. this.approve = true
  760. this.cancelButton = false
  761. this.reset()
  762. this.pass = {
  763. fAmtdr: 0, //应收合计
  764. fAmtcr: 0, //应付合计
  765. fMblno: '', //提单号
  766. fName: '', //货权方
  767. fFeesName: '', //结算单位
  768. fCorpid: '' //结算单位ID
  769. }
  770. getCharge(this.approval.billId).then(response => {
  771. this.Operator = response.data.tFee.createBy
  772. this.increase_s = response.data.feeDoList
  773. this.fWbuOptions = response.data.feesList
  774. this.queryParams = response.data.tFee
  775. this.fWbuOptions = response.data.feesList
  776. this.fMblnoOptions = response.data.corps
  777. this.open = true
  778. this.title = '修改付费列表'
  779. })
  780. }
  781. },
  782. homePage(){
  783. this.open = false
  784. let view = {
  785. fullPath: "/finance/charge",
  786. hash: "",
  787. matched: Array(2),
  788. meta: Object,
  789. name: "Charge",
  790. params: Object,
  791. path: "/finance/charge",
  792. query: Object,
  793. title: "付费"
  794. }
  795. this.$router.push({ path: '/index'})
  796. this.$store.dispatch('tagsView/delView', view).then(({ visitedViews }) => {
  797. if (this.isActive(view)) {
  798. this.toLastView(visitedViews, view)
  799. }
  800. })
  801. Global.$emit("removeCache", "closeSelectedTag", view);
  802. },
  803. register(){
  804. queryUserVal().then((response)=>{
  805. this.Lander = response.user.userName
  806. })
  807. },
  808. immediateApproval(){
  809. this.addOrUpdateVisib = true
  810. this.$nextTick(() => {
  811. this.$refs.ApprovalComments.init(this.approval.billId,this.approval.actId)
  812. })
  813. },
  814. // 查看审批流
  815. addOrUpdateHandle(){
  816. this.addOrUpdateVisible = true
  817. this.addOrUpdateVisib = false
  818. let id = '448'
  819. let actId = '110'
  820. this.$nextTick(() => {
  821. this.$refs.addOrUpdate.init(this.queryParams.fId,this.contrastId)
  822. })
  823. },
  824. // 撤销付费
  825. revokeCharge(){
  826. this.queryParams.fBillstatus = '1'
  827. let formDate = new window.FormData()
  828. formDate.append('tFee', JSON.stringify(this.queryParams))
  829. formDate.append('tFeeDo', JSON.stringify(this.increase_s))
  830. backCharge(formDate).then(response => {
  831. this.open = false
  832. this.msgSuccess('操作成功')
  833. this.getList()
  834. })
  835. },
  836. // 查看按钮
  837. check(row,res){
  838. this.notChange = true
  839. getCharge(row.fId).then(response => {
  840. this.Operator = response.data.tFee.createBy
  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. this.title = '付费列表'
  848. this.tablefilter = true
  849. if (res == 1){
  850. this.notChange = true
  851. if (this.Operator == this.Lander){
  852. this.tablefilter = false
  853. this.reset()
  854. this.pass = {
  855. fAmtdr: 0, //应收合计
  856. fAmtcr: 0, //应付合计
  857. fMblno: '', //提单号
  858. fName: '', //货权方
  859. fFeesName: '', //结算单位
  860. fCorpid: '' //结算单位ID
  861. }
  862. const fId = row.fId || this.ids
  863. getCharge(fId).then(response => {
  864. this.increase_s = response.data.feeDoList
  865. this.fWbuOptions = response.data.feesList
  866. this.queryParams = response.data.tFee
  867. this.fWbuOptions = response.data.feesList
  868. this.fMblnoOptions = response.data.corps
  869. this.open = true
  870. })
  871. }else {
  872. this.notChange = true
  873. // this.$message.error('未知异常,请联系管理员')
  874. }
  875. }else {
  876. this.notChange = true
  877. this.reset()
  878. this.pass = {
  879. fAmtdr: 0, //应收合计
  880. fAmtcr: 0, //应付合计
  881. fMblno: '', //提单号
  882. fName: '', //货权方
  883. fFeesName: '', //结算单位
  884. fCorpid: '' //结算单位ID
  885. }
  886. const fId = row.fId || this.ids
  887. getCharge(fId).then(response => {
  888. this.increase_s = response.data.feeDoList
  889. this.fWbuOptions = response.data.feesList
  890. this.queryParams = response.data.tFee
  891. this.fWbuOptions = response.data.feesList
  892. this.fMblnoOptions = response.data.corps
  893. this.open = true
  894. })
  895. }
  896. })
  897. },
  898. //打印功能
  899. printing() {
  900. if (this.increase_s.length !== 0) {
  901. this.printStatus = true
  902. this.printObject = this.increase_s
  903. } else {
  904. this.$message.error('无数据,请检查是否有数据')
  905. }
  906. },
  907. //确认打印
  908. printSomething() {
  909. // 此处的style即为打印时的样式
  910. const style ='table tr td,th { border-collapse: collapse;padding:0px;border:.5px #000 solid;text-align:center;}'
  911. print({
  912. printable: 'print_area2',
  913. type: 'html',
  914. header:"付费表",
  915. style: style, // 亦可使用引入的外部css;
  916. scanStyles: false
  917. })
  918. },
  919. //关闭打印弹窗
  920. closePrinting() {
  921. this.$confirm('确认关闭?')
  922. .then(_ => {
  923. this.printStatus = false
  924. })
  925. .catch(_ => {
  926. })
  927. },
  928. // 确认付费
  929. confirmCharge() {
  930. this.$refs['ruless'].validate(valid => {
  931. if (valid) {
  932. if(this.increase_s.length){
  933. // this.queryParams.fBillstatus = '4'
  934. let formDate = new window.FormData()
  935. formDate.append('tFee', JSON.stringify(this.queryParams))
  936. formDate.append('tFeeDo', JSON.stringify(this.increase_s))
  937. collectFee(formDate).then(response => {
  938. this.msgSuccess('操作成功')
  939. this.open = false
  940. this.getList()
  941. })
  942. }else {
  943. this.$message.error('表单为空不允许操作');
  944. }
  945. }
  946. })
  947. },
  948. charGe() {
  949. this.queryParameter = {
  950. fToCorpid: this.queryParams.fCorpid,
  951. }
  952. this.chargeList_s = []
  953. // this.queryParameter.fToCorpid = this.queryParams.fCorpid
  954. this.innerVisible = true
  955. },
  956. getSum(param){
  957. const {columns,data} = param;
  958. const sums = [];
  959. columns.forEach((column, index) => {
  960. sums[0] = '合计'
  961. sums[10] = this.totAL.toFixed(2)
  962. sums[9] = this.Ttime.toFixed(2)
  963. });
  964. return sums;
  965. },
  966. // 导入多选框
  967. handleSelectionChange_s(selection) {
  968. this.totAL = 0
  969. this.Ttime = 0
  970. this.selection = selection
  971. if(this.selection.length == 0){
  972. for (let item in this.chargeList_s){
  973. this.totAL += Number(this.chargeList_s[item].fAmt)
  974. this.Ttime += Number(this.chargeList_s[item].fAmtdr)
  975. }
  976. }else {
  977. for (let index in selection){
  978. this.totAL += Number(selection[index].fAmt)
  979. this.Ttime += Number(selection[index].fAmtdr)
  980. }
  981. }
  982. // this.getSummaries()
  983. },
  984. // 多选框选中数据
  985. handleSelectionChange(selection) {
  986. this.totAL = 0
  987. this.ids = selection.map(item => item.fId)
  988. this.single = selection.length !== 1
  989. this.multiple = !selection.length
  990. },
  991. imgChangeI(row) {
  992. if (row.fAmt && Number(row.fAmt) > Number(row.fAmtdr)) {
  993. this.$set(row, 'fAmt', row.fAmtdr)
  994. this.state_s = true
  995. }
  996. if (this.selection.length !== 0){
  997. this.totAL = 0
  998. this.Ttime = 0
  999. for (let item in this.selection){
  1000. this.totAL += Number(this.selection[item].fAmt)
  1001. this.Ttime += Number(this.selection[item].fAmtdr)
  1002. }
  1003. }else {
  1004. this.totAL = 0
  1005. this.Ttime = 0
  1006. for (let item in this.chargeList_s){
  1007. this.totAL += Number(this.chargeList_s[item].fAmt)
  1008. this.Ttime += Number(this.chargeList_s[item].fAmtdr)
  1009. }
  1010. }
  1011. },
  1012. //确认导入
  1013. confirmImport() {
  1014. this.hide = true
  1015. for (let item in this.selection) {
  1016. this.pass.fAmtcr += Number(this.selection[item].fAmt.toFixed(2))
  1017. this.pass.fAmtdr += Number(this.selection[item].fAmtdr.toFixed(2))
  1018. }
  1019. if (this.state_s == true) {
  1020. if (this.selection.length == '0') {
  1021. this.$message.error('未选择导入行')
  1022. } else {
  1023. for (let item in this.selection) {
  1024. this.empty.push(this.selection[item].fMblno)
  1025. this.nothing.push(this.selection[item].fName)
  1026. }
  1027. //去重提单号
  1028. this.empty = new Set(this.empty)
  1029. this.empty = Array.from(this.empty)
  1030. //去重货权方
  1031. this.nothing = new Set(this.nothing)
  1032. this.nothing = Array.from(this.nothing)
  1033. if (this.empty.length <= 1) {
  1034. this.pass.fMblno = this.empty[0]
  1035. } else {
  1036. this.pass.fMblno = this.empty[0] + '...'
  1037. }
  1038. if (this.nothing.length <= 1) {
  1039. this.pass.fName = this.nothing[0]
  1040. } else {
  1041. this.pass.fName = this.nothing[0] + '...'
  1042. }
  1043. this.increase_s = this.increase_s.concat(this.selection)
  1044. this.queryParams.tMblno = this.pass.fMblno //提单号
  1045. this.queryParams.fCtrlcorpid = this.pass.fName
  1046. this.queryParams.fCorpid = this.queryParameter.fToCorpid
  1047. this.queryParams.fAmtcr = this.pass.fAmtcr
  1048. this.queryParams.fAmtdr = this.pass.fAmtdr
  1049. this.innerVisible = false
  1050. this.chargeList_s = []
  1051. this.queryParameter = {
  1052. fCorpid: '',
  1053. fToCorpid: '',
  1054. fMblno: '',
  1055. fStatementNo: '',
  1056. fFeeid: '',
  1057. timeExamine: '',
  1058. timeInterval: ''
  1059. }
  1060. }
  1061. } else if (this.state_s == false) {
  1062. this.$message.error('本次金额不能大于原定金额')
  1063. }
  1064. },
  1065. /** 查询财务数据主列表 */
  1066. getList() {
  1067. this.loading = true
  1068. this.getDicts('approval_process').then((response) => {
  1069. this.options = response.data
  1070. })
  1071. listCharge(this.tableFilter).then(response => {
  1072. this.chargeList = response.rows
  1073. this.total = response.total
  1074. this.loading = false
  1075. })
  1076. },
  1077. // 取消按钮
  1078. cancel() {
  1079. this.open = false
  1080. this.approve = false
  1081. this.reset()
  1082. },
  1083. // 表单重置
  1084. reset() {
  1085. this.form = {
  1086. fId: null,
  1087. fBillno: null,
  1088. fCtrlcorpid: null,
  1089. fCorpid: null,
  1090. tMblno: null,
  1091. fAmtdr: null,
  1092. fAmtcr: null,
  1093. fBilltype: null,
  1094. fBillstatus: '0',
  1095. fRemarks: null,
  1096. fAccbilldate: null,
  1097. delFlag: null,
  1098. createBy: null,
  1099. fDeptid: null,
  1100. createTime: null,
  1101. updateBy: null,
  1102. updateTime: null
  1103. }
  1104. this.resetForm('form')
  1105. },
  1106. /** 搜索按钮操作 */
  1107. handleQuery() {
  1108. this.queryParams.pageNum = 1
  1109. this.getList()
  1110. },
  1111. /** 导入搜索 */
  1112. importSearch() {
  1113. // .join(',')
  1114. this.chargeList_s = []
  1115. if(this.queryParameter.fStatementNo){
  1116. this.rules = {}
  1117. search(this.queryParameter).then(response => {
  1118. this.chargeList_s = response.rows
  1119. this.$message.success('查询成功');
  1120. for (let item in this.chargeList_s){
  1121. this.totAL += Number(this.chargeList_s[item].fAmt)
  1122. this.Ttime += Number(this.chargeList_s[item].fAmtdr)
  1123. }
  1124. })
  1125. }else {
  1126. this.rules = {
  1127. fToCorpid: [
  1128. { required: true, message: ' ', trigger: 'blur' }
  1129. ],
  1130. timeExamine: [
  1131. { required: true, message: ' ', trigger: 'blur' }
  1132. ]
  1133. }
  1134. if (this.rules){
  1135. this.$refs['form'].validate(valid => {
  1136. if (valid) {
  1137. search(this.queryParameter).then(response => {
  1138. this.chargeList_s = response.rows
  1139. if(this.chargeList_s.length !== 0){
  1140. this.$message.success('查询成功');
  1141. this.totAL = 0
  1142. this.Ttime = 0
  1143. for (let item in this.chargeList_s){
  1144. this.totAL += Number(this.chargeList_s[item].fAmt)
  1145. this.Ttime += Number(this.chargeList_s[item].fAmtdr)
  1146. }
  1147. }else{
  1148. this.$message.error("暂无数据")
  1149. }
  1150. })
  1151. }
  1152. })
  1153. }else {
  1154. this.$message.error('操作频繁');
  1155. }
  1156. }
  1157. },
  1158. /** 远程模糊查询用户 */
  1159. corpsRemoteMethod(name) {
  1160. if (name == null || name === '') {
  1161. return false
  1162. }
  1163. let queryParams = { pageNum: 1, pageSize: 10, fName: name, type: 1 }
  1164. listCorps(queryParams).then((response) => {
  1165. this.fMblnoOptions = response.rows
  1166. this.KHblnoOptions = response.rows
  1167. })
  1168. },
  1169. /** 重置按钮操作 */
  1170. resetQuery() {
  1171. this.tableFilter = {
  1172. pageNum: 1,
  1173. pageSize: 10,
  1174. fBillno: null,
  1175. fCtrlcorpid: null,
  1176. fCorpid: null,
  1177. tMblno: null,
  1178. fAmtdr: null,
  1179. fAmtcr: null,
  1180. fBilltype: null,
  1181. fBillstatus: null,
  1182. fRemarks: null,
  1183. fAccbilldate: null,
  1184. fDeptid: null
  1185. }
  1186. this.handleQuery()
  1187. },
  1188. //导入重置按钮
  1189. resetQuery_s() {
  1190. this.queryParameter = {
  1191. fCorpid: '',
  1192. fToCorpid: '',
  1193. fMblno: '',
  1194. fStatementNo: '',
  1195. fFeeid: '',
  1196. timeExamine: '',
  1197. timeInterval: ''
  1198. }
  1199. },
  1200. // 远程模糊查询费用名称
  1201. fWRemoteMethod(name) {
  1202. this.fWbuOptions = []
  1203. if (name == null || name === '') {
  1204. return false
  1205. }
  1206. let queryParams = { pageNum: 1, pageSize: 10, fName: name }
  1207. listFees(queryParams).then((response) => {
  1208. this.fWbuOptions = response.rows
  1209. })
  1210. },
  1211. /** 新增按钮操作 */
  1212. handleAdd() {
  1213. this.notChange = false
  1214. this.hide = true
  1215. this.reset()
  1216. this.pass = {
  1217. fAmtdr: 0, //应收合计
  1218. fAmtcr: 0, //应付合计
  1219. fMblno: '', //提单号
  1220. fName: '', //货权方
  1221. fFeesName: '', //结算单位
  1222. fCorpid: '' //结算单位ID
  1223. },
  1224. // this.queryParams = []
  1225. this.increase_s = []
  1226. this.queryParams = {
  1227. pageNum: 1,
  1228. pageSize: 10,
  1229. fBillno: null,
  1230. fCtrlcorpid: null,
  1231. fCorpid: null,
  1232. tMblno: null,
  1233. fAmtdr: null,
  1234. fAmtcr: null,
  1235. fBilltype: null,
  1236. fBillstatus: null,
  1237. fRemarks: null,
  1238. fAccbilldate: null,
  1239. fDeptid: null
  1240. }
  1241. this.resetForm('queryParams')
  1242. this.open = true
  1243. this.title = '添加财务数据主'
  1244. },
  1245. /** 修改按钮操作 */
  1246. handleUpdate(row) {
  1247. this.approve = false
  1248. this.hide = false
  1249. this.notChange = false
  1250. this.reset()
  1251. this.pass = {
  1252. fAmtdr: 0, //应收合计
  1253. fAmtcr: 0, //应付合计
  1254. fMblno: '', //提单号
  1255. fName: '', //货权方
  1256. fFeesName: '', //结算单位
  1257. fCorpid: '' //结算单位ID
  1258. }
  1259. const fId = row.fId || this.ids
  1260. getCharge(fId).then(response => {
  1261. this.Operator = response.data.tFee.createBy
  1262. this.increase_s = response.data.feeDoList
  1263. this.fWbuOptions = response.data.feesList
  1264. this.queryParams = response.data.tFee
  1265. this.fWbuOptions = response.data.feesList
  1266. this.fMblnoOptions = response.data.corps
  1267. this.open = true
  1268. this.title = '修改付费列表'
  1269. })
  1270. },
  1271. /** 提交按钮 */
  1272. submitForm() {
  1273. this.$refs['ruless'].validate(valid => {
  1274. if (valid) {
  1275. if (this.queryParams.fId == null) {
  1276. // this.chargeList.fBillstatus = '1'
  1277. this.queryParams.fBillstatus = '1'
  1278. let formData = new window.FormData()
  1279. formData.append('tFee', JSON.stringify(this.queryParams))
  1280. formData.append('tFeeDo', JSON.stringify(this.increase_s))
  1281. addCharge(formData).then(response => {
  1282. this.msgSuccess('新增成功')
  1283. // this.increase_s = []
  1284. // this.open = false
  1285. this.getList()
  1286. })
  1287. } else {
  1288. this.pass.fAmtcr = 0
  1289. this.pass.fAmtdr = 0
  1290. for (let item in this.increase_s) {
  1291. this.pass.fAmtcr += Number(this.increase_s[item].fAmt)
  1292. this.pass.fAmtdr += Number(this.increase_s[item].fAmtdr)
  1293. }
  1294. this.queryParams.fAmtcr = Number(this.pass.fAmtcr.toFixed(2))
  1295. this.queryParams.fAmtdr = Number(this.pass.fAmtdr.toFixed(2))
  1296. this.pass.fAmtcr.toFixed(2)
  1297. this.queryParams.fBillstatus = '1'
  1298. let formData = new window.FormData()
  1299. formData.append('tFee', JSON.stringify(this.queryParams))
  1300. formData.append('tFeeDo', JSON.stringify(this.increase_s))
  1301. addCharge(formData).then(response => {
  1302. this.msgSuccess('修改成功')
  1303. // this.increase_s = []
  1304. // this.open = false
  1305. this.getList()
  1306. })
  1307. }
  1308. }
  1309. })
  1310. },
  1311. /** 删除按钮操作 */
  1312. handleDelete(row) {
  1313. const fIds = row.fId || this.ids
  1314. let tips = ''
  1315. delCharge_s(fIds).then(data => {
  1316. switch (data.msg) {
  1317. case '0': {
  1318. this.$message.error('当前数据已被其他操作员操作请刷新页面')
  1319. break
  1320. }
  1321. case '1': {
  1322. tips = '当前主表有数据从表无数据是否删除'
  1323. this.delete_S(fIds, tips)
  1324. break
  1325. }
  1326. case '2': {
  1327. tips = '当前主表有数据从表有数据是否删除'
  1328. this.delete_S(fIds, tips)
  1329. break
  1330. }
  1331. default:{
  1332. return this.$message.error('未知错误,无状态')
  1333. }
  1334. }
  1335. })
  1336. },
  1337. delete_S(fIds, tips) {
  1338. this.$confirm(tips, '警告', {
  1339. confirmButtonText: '确定',
  1340. cancelButtonText: '取消',
  1341. type: 'warning'
  1342. }).then(function() {
  1343. return delCharge(fIds)
  1344. }).then(() => {
  1345. this.getList()
  1346. this.msgSuccess('删除成功')
  1347. })
  1348. },
  1349. /** 导出按钮操作 */
  1350. handleExport() {
  1351. const queryParams = this.queryParams
  1352. this.$confirm('是否确认导出所有财务数据主数据项?', '警告', {
  1353. confirmButtonText: '确定',
  1354. cancelButtonText: '取消',
  1355. type: 'warning'
  1356. }).then(function() {
  1357. return exportCharge(queryParams)
  1358. }).then(response => {
  1359. this.download(response.msg)
  1360. })
  1361. },
  1362. //清空一行
  1363. deleteRow(index, rows) {
  1364. this.queryParams.fAmtcr = 0
  1365. this.queryParams.fAmtdr = 0
  1366. rows.splice(index, 1)
  1367. for (let item in this.increase_s) {
  1368. this.queryParams.fAmtcr += this.increase_s[item].fAmt
  1369. this.queryParams.fAmtdr += this.increase_s[item].fAmtdr
  1370. }
  1371. }
  1372. }
  1373. }
  1374. </script>