index.vue 31 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930
  1. <template>
  2. <div class="app-container">
  3. <el-form :model="queryParams_s" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
  4. <el-form-item label="系统编号" prop="fCtrlcorpid">
  5. <el-input
  6. v-model="queryParams_s.fBillno"
  7. placeholder="请输入系统编号"
  8. clearable
  9. size="small"
  10. @keyup.enter.native="handleQuery"
  11. />
  12. </el-form-item>
  13. <el-form-item label="货权方" prop="fCtrlcorpid">
  14. <el-input
  15. v-model="queryParams_s.fCtrlcorpid"
  16. placeholder="请输入货权方"
  17. clearable
  18. size="small"
  19. @keyup.enter.native="handleQuery"
  20. />
  21. </el-form-item>
  22. <el-form-item label="对账日期" prop="fAccbilldate">
  23. <el-date-picker clearable size="small" style="width: 200px"
  24. v-model="queryParams_s.fAccbilldate"
  25. type="date"
  26. value-format="yyyy-MM-dd"
  27. placeholder="选择账单日期"
  28. >
  29. </el-date-picker>
  30. </el-form-item>
  31. <el-form-item label="结算单位" prop="fCorpid">
  32. <el-select
  33. v-model="queryParams_s.fCorpid"
  34. filterable
  35. remote
  36. clearable
  37. style="width: 200px"
  38. @keyup.enter.native="handleQuery"
  39. :remote-method="corpsRemoteMethod"
  40. placeholder="请输入结算单位"
  41. >
  42. <el-option
  43. v-for="(dict, index) in fMblnoOptions"
  44. :key="index.fId"
  45. :label="dict.fName"
  46. :value="dict.fId"
  47. ></el-option>
  48. </el-select>
  49. </el-form-item>
  50. <el-form-item label="状态" prop="fBillstatus">
  51. <el-select v-model="queryParams_s.fBillstatus" placeholder="请选择">
  52. <el-option
  53. v-for="item in options"
  54. :key="item.value"
  55. :label="item.dictLabel"
  56. :value="item.dictValue">
  57. </el-option>
  58. </el-select>
  59. </el-form-item>
  60. <el-form-item>
  61. <el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
  62. <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
  63. </el-form-item>
  64. </el-form>
  65. <el-row :gutter="10" class="mb8">
  66. <el-col :span="1.5">
  67. <el-button
  68. type="primary"
  69. icon="el-icon-plus"
  70. size="mini"
  71. @click="handleAdd"
  72. v-hasPermi="['finance:charge:add']"
  73. >新增
  74. </el-button>
  75. </el-col>
  76. <el-col :span="1.5">
  77. <el-button
  78. type="success"
  79. icon="el-icon-edit"
  80. size="mini"
  81. :disabled="single"
  82. @click="handleUpdate"
  83. v-hasPermi="['finance:charge:edit']"
  84. >修改
  85. </el-button>
  86. </el-col>
  87. <el-col :span="1.5">
  88. <el-button
  89. type="danger"
  90. icon="el-icon-delete"
  91. size="mini"
  92. :disabled="multiple"
  93. @click="handleDelete"
  94. v-hasPermi="['finance:charge:remove']"
  95. >删除
  96. </el-button>
  97. </el-col>
  98. <el-col :span="1.5">
  99. <el-button
  100. type="warning"
  101. icon="el-icon-download"
  102. size="mini"
  103. @click="handleExport"
  104. v-hasPermi="['finance:charge:export']"
  105. >导出
  106. </el-button>
  107. </el-col>
  108. <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
  109. </el-row>
  110. <el-table v-loading="loading" :data="chargeList" @selection-change="handleSelectionChange">
  111. <el-table-column type="selection" width="55" align="center"/>
  112. <el-table-column label="序号" type="index" width="55" align="center"/>
  113. <el-table-column label="系统编号" align="center" prop="fBillno"/>
  114. <el-table-column label="货权方" align="center" prop="fCtrlcorpid"/>
  115. <!-- <el-table-column label="账单日期" align="center" prop="fAccbilldate" width="180">-->
  116. <!-- <template slot-scope="scope">-->
  117. <!-- <span>{{ parseTime(scope.row.fAccbilldate, '{y}-{m}-{d}') }}</span>-->
  118. <!-- </template>-->
  119. <!-- </el-table-column>-->
  120. <!-- <el-table-column label="制单部门" align="center" prop="fId"/>-->
  121. <!-- <el-table-column label="结算单位" align="center" prop="fCorpid"/>-->
  122. <el-table-column label="对账日期" align="center" prop="fAccbilldate"/>
  123. <el-table-column label="提单号" align="center" prop="tMblno"/>
  124. <el-table-column label="应收合计" align="center" prop="fAmtdr"/>
  125. <el-table-column label="应付合计" align="center" prop="fAmtcr"/>
  126. <el-table-column label="备注" align="center" prop="fRemarks"/>
  127. <el-table-column label="状态" align="center" prop="fBillstatus">
  128. <template slot-scope="scope">
  129. <span v-if="scope.row.fBillstatus == '1'">新建</span>
  130. <span v-else-if="scope.row.fBillstatus == '2'">暂存</span>
  131. <span v-else-if="scope.row.fBillstatus == '3'">审批驳回</span>
  132. <span v-else-if="scope.row.fBillstatus == '4'">提交审核</span>
  133. <span v-else-if="scope.row.fBillstatus == '5'">审核中</span>
  134. <span v-else-if="scope.row.fBillstatus == '6'">审核完成</span>
  135. </template>
  136. </el-table-column>
  137. <!-- <el-table-column label="单据类型" align="center" prop="fBilltype"/>-->
  138. <!-- <el-table-column label="制单部门" align="center" prop="fDeptid"/>-->
  139. <el-table-column label="操作" width="100" align="center" class-name="small-padding fixed-width">
  140. <template slot-scope="scope">
  141. <el-button
  142. size="mini"
  143. type="text"
  144. icon="el-icon-edit"
  145. @click="handleUpdate(scope.row)"
  146. v-hasPermi="['finance:charge:edit']"
  147. >修改
  148. </el-button>
  149. <el-button
  150. size="mini"
  151. type="text"
  152. icon="el-icon-delete"
  153. @click="handleDelete(scope.row)"
  154. v-hasPermi="['finance:charge:remove']"
  155. >删除
  156. </el-button>
  157. </template>
  158. </el-table-column>
  159. </el-table>
  160. <pagination
  161. v-show="total>0"
  162. :total="total"
  163. :page.sync="queryParams.pageNum"
  164. :limit.sync="queryParams.pageSize"
  165. @pagination="getList"
  166. />
  167. <!-- 添加或修改财务数据主对话框 -->
  168. <el-dialog :close-on-click-modal="false" :title="title" :visible.sync="open" width="70%" append-to-body>
  169. <el-form :model="queryParams" :rules="ruless" ref="ruless" :inline="true" v-show="showSearch"
  170. label-width="68px"
  171. >
  172. <el-form-item label="货权方" prop="fCtrlcorpid">
  173. <el-input
  174. v-model="queryParams.fCtrlcorpid"
  175. placeholder="请输入货权方"
  176. clearable
  177. size="small"
  178. @keyup.enter.native="handleQuery"
  179. />
  180. </el-form-item>
  181. <el-form-item label="结算单位" label-width="78px" prop="fCorpid">
  182. <el-select
  183. v-model="queryParams.fCorpid"
  184. filterable
  185. remote
  186. clearable
  187. style="width: 200px"
  188. @keyup.enter.native="handleQuery"
  189. :remote-method="corpsRemoteMethod"
  190. placeholder="请输入结算单位"
  191. >
  192. <el-option
  193. v-for="(dict, index) in fMblnoOptions"
  194. :key="index.fId"
  195. :label="dict.fName"
  196. :value="dict.fId"
  197. ></el-option>
  198. </el-select>
  199. </el-form-item>
  200. <el-form-item label="结算日期" label-width="78px" prop="fAccbilldate">
  201. <el-date-picker clearable size="small" style="width: 200px"
  202. v-model="queryParams.fAccbilldate"
  203. type="date"
  204. value-format="yyyy-MM-dd"
  205. placeholder="选择账单日期"
  206. >
  207. </el-date-picker>
  208. </el-form-item>
  209. <el-form-item label="系统编号" prop="fBillno">
  210. <el-input
  211. v-model="queryParams.fBillno"
  212. placeholder="请输入系统编号"
  213. clearable
  214. disabled
  215. size="small"
  216. @keyup.enter.native="handleQuery"
  217. />
  218. </el-form-item>
  219. <el-form-item label="备注" prop="fRemarks">
  220. <el-input
  221. v-model="queryParams.fRemarks"
  222. placeholder="请输入备注"
  223. clearable
  224. size="small"
  225. @keyup.enter.native="handleQuery"
  226. />
  227. </el-form-item>
  228. </el-form>
  229. <div style="width: 100%;">
  230. <el-button type="warning" size="small" @click="charGe">收费</el-button>
  231. <el-button type="primary" size="small" @click="confirmCharge">确认收费</el-button>
  232. <el-button type="success" size="small">导出</el-button>
  233. <el-button type="info" size="small">打印</el-button>
  234. <el-button type="danger" size="small">删除</el-button>
  235. </div>
  236. <el-table v-loading="loading" :data="increase_s" @selection-change="handleSelectionChange_s">
  237. <!-- <el-table-column type="selection" width="55" align="center"/> -->
  238. <el-table-column label="序号" type="index" width="55" align="center"/>
  239. <el-table-column label="提单号" align="center" prop="fMblno"/>
  240. <el-table-column label="存货单号" align="center" prop="fBscorpno"/>
  241. <el-table-column label="品名" align="center" prop="fProductName"/>
  242. <el-table-column label="业务日期" align="center" prop="fBsdate">
  243. <template slot-scope="scope">
  244. <span>{{scope.row.fBsdate.slice(0,10)}}</span>
  245. </template>
  246. </el-table-column>
  247. <el-table-column label="费用名称" align="center" prop="fFeeName"/>
  248. <el-table-column label="收/付" align="center" prop="fSrcdc">
  249. <template slot-scope="scope">
  250. <span v-if="scope.row.fSrcdc =='D'">收</span>
  251. <span v-else-if="scope.row.fSrcdc =='C'">付</span>
  252. </template>
  253. </el-table-column>
  254. <el-table-column label="业务类型" align="center" prop="fBilltype">
  255. <template slot-scope="scope">
  256. <span v-if="scope.row.fBilltype =='SJRK'">入库</span>
  257. <span v-else-if="scope.row.fBilltype == 'SJCK'">出库</span>
  258. <span v-else>{{scope.row.fBilltype}}</span>
  259. </template>
  260. </el-table-column>
  261. <el-table-column label="金额" align="center" prop="fAmtdr"/>
  262. <el-table-column label="本次金额" align="center" prop="fAmt"/>
  263. <el-table-column label="备注" align="center" prop="fRemarks"/>
  264. <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
  265. <template slot-scope="scope">
  266. <el-button
  267. size="mini"
  268. type="text"
  269. icon="el-icon-delete"
  270. @click.native.prevent="deleteRow(scope.$index, increase_s)"
  271. >删除
  272. </el-button>
  273. </template>
  274. </el-table-column>
  275. </el-table>
  276. <div slot="footer" class="dialog-footer">
  277. <el-button type="primary" @click="submitForm">保 存</el-button>
  278. <el-button @click="cancel">取 消</el-button>
  279. </div>
  280. <el-dialog :close-on-click-modal="false" width="70%" :visible.sync="innerVisible" title="导入数据" append-to-body>
  281. <el-form ref="form" :model="queryParameter" :rules="rules" label-width="80px"
  282. style="display: flex;flex-wrap: wrap;"
  283. >
  284. <el-form-item label="货权方" prop="fCtrlcorpid">
  285. <!-- <el-input v-model="queryParameter.fCorpid" placeholder="请输入货权方" style="width: 200px;"/>-->
  286. <el-select
  287. v-model="queryParams.fCorpid"
  288. filterable
  289. remote
  290. clearable
  291. style="width: 200px"
  292. @keyup.enter.native="handleQuery"
  293. :remote-method="corpsRemoteMethod"
  294. placeholder="请选择货权方"
  295. >
  296. <el-option
  297. v-for="(dict, index) in fMblnoOptions"
  298. :key="index.fId"
  299. :label="dict.fName"
  300. :value="dict.fId"
  301. ></el-option>
  302. </el-select>
  303. </el-form-item>
  304. <el-form-item label="结算单位" prop="fToCorpid">
  305. <el-select
  306. v-model="queryParameter.fToCorpid"
  307. filterable
  308. remote
  309. clearable
  310. style="width: 200px"
  311. @keyup.enter.native="handleQuery"
  312. :remote-method="corpsRemoteMethod"
  313. placeholder="请输入结算单位"
  314. >
  315. <el-option
  316. v-for="(dict, index) in fMblnoOptions"
  317. :key="index.fId"
  318. :label="dict.fName"
  319. :value="dict.fId"
  320. ></el-option>
  321. </el-select>
  322. </el-form-item>
  323. <el-form-item label="提单号" prop="tMblno">
  324. <el-input v-model="queryParameter.fMblno" placeholder="请输入提单号" style="width: 200px;"/>
  325. </el-form-item>
  326. <el-form-item label="对账单号" prop="fStatementNo">
  327. <el-input v-model="queryParameter.fStatementNo" placeholder="请输入提单号" style="width: 200px;"/>
  328. </el-form-item>
  329. <el-form-item label="费用名称" prop="fFeeid">
  330. <template>
  331. <el-select
  332. v-model="queryParameter.fFeeid"
  333. filterable
  334. remote
  335. :remote-method="fWRemoteMethod"
  336. placeholder="费用名称"
  337. multiple
  338. >
  339. <el-option v-for="item in fWbuOptions" :key="item.fId" :label="item.fName" :value="item.fId">
  340. </el-option>
  341. </el-select>
  342. </template>
  343. </el-form-item>
  344. <el-form-item label="审核日期" prop="timeExamine">
  345. <el-date-picker
  346. size="small"
  347. style="width: 200px"
  348. v-model="queryParameter.timeExamine"
  349. type="daterange"
  350. start-placeholder="开始日期"
  351. end-placeholder="结束日期"
  352. value-format="yyyy-MM-dd"
  353. :default-time="['00:00:00', '23:59:59']"
  354. >
  355. </el-date-picker>
  356. </el-form-item>
  357. <el-form-item label="出入库日期" label-width="85px" prop="fAccbilldate">
  358. <el-date-picker
  359. size="small"
  360. style="width: 200px"
  361. v-model="queryParameter.timeInterval"
  362. type="daterange"
  363. start-placeholder="开始日期"
  364. end-placeholder="结束日期"
  365. value-format="yyyy-MM-dd"
  366. :default-time="['00:00:00', '23:59:59']"
  367. >
  368. </el-date-picker>
  369. </el-form-item>
  370. <el-form-item>
  371. <el-button type="cyan" icon="el-icon-search" size="mini" @click="importSearch">搜索</el-button>
  372. <el-button icon="el-icon-refresh" size="mini" @click="resetQuery_s">重置</el-button>
  373. </el-form-item>
  374. </el-form>
  375. <el-table v-loading="loading" :data="chargeList_s" ref="chargeList" show-summary :summary-method="getSummaries" @selection-change="handleSelectionChange_s">
  376. <el-table-column type="selection" width="55" align="center"/>
  377. <el-table-column label="序号" type="index" width="55" align="center"/>
  378. <el-table-column label="货权方" align="center" prop="fName"/>
  379. <el-table-column label="提单号" align="center" prop="fMblno"/>
  380. <el-table-column label="品名" align="center" prop="fProductName"/>
  381. <el-table-column label="业务日期" align="center" prop="fBsdate"/>
  382. <el-table-column label="业务类型" align="center" prop="fBilltype">
  383. <template slot-scope="scope">
  384. <span v-if="scope.row.fBilltype =='SJRK'">入库</span>
  385. <span v-else-if="scope.row.fBilltype == 'SJCK'">出库</span>
  386. <span v-else>{{scope.row.fBilltype}}</span>
  387. </template>
  388. </el-table-column>
  389. <el-table-column label="审核日期" align="center" prop="fReviewDate"/>
  390. <el-table-column label="费用名称" align="center" prop="fFeeName"/>
  391. <el-table-column label="金额" align="center" prop="fAmtdr"/>
  392. <el-table-column label="本次金额" align="center" prop="fAmt">
  393. <template slot-scope="scope">
  394. <el-input
  395. v-model="scope.row.fAmt"
  396. placeholder="请输入本次金额"
  397. clearable
  398. size="small"
  399. oninput='this.value=this.value.replace(/[^\-?\d.]/g,"").replace(/^(\-)*(\d+)\.(\d\d).*$/, "$1$2.$3")'
  400. @change="imgChangeI(scope.row)"
  401. />
  402. </template>
  403. </el-table-column>
  404. <el-table-column label="备注" align="center" prop="fRemarks">
  405. <template slot-scope="scope">
  406. <el-input
  407. v-model="scope.row.fRemarks"
  408. placeholder="请输入备注"
  409. clearable
  410. size="small"
  411. />
  412. </template>
  413. </el-table-column>
  414. </el-table>
  415. <div slot="footer" class="dialog-footer">
  416. <el-button type="primary" @click="confirmImport">确 定</el-button>
  417. <el-button @click="innerVisible = false">取 消</el-button>
  418. </div>
  419. </el-dialog>
  420. </el-dialog>
  421. </div>
  422. </template>
  423. <script>
  424. import {
  425. collectFee,
  426. listCharge,
  427. getCharge,
  428. delCharge,
  429. addCharge,
  430. updateCharge,
  431. exportCharge,
  432. search,
  433. listCorps
  434. } from '@/api/finance/charge'
  435. import { listFees } from '@/api/basicdata/fees'
  436. import log from '@/views/monitor/job/log'
  437. export default {
  438. name: 'Charge',
  439. components: {},
  440. data() {
  441. return {
  442. browseStatus: true,
  443. nothing:[],
  444. //导入状态
  445. state_s: true ,
  446. fWbuOptions: [],
  447. options:'',
  448. // 遮罩层
  449. loading: true,
  450. //打开内部弹窗
  451. innerVisible: false,
  452. chargeList_s: [],
  453. selection: '',
  454. increase_s: [],
  455. // 选中数组
  456. ids: [],
  457. // 非单个禁用
  458. single: true,
  459. // 非多个禁用
  460. multiple: true,
  461. // 显示搜索条件
  462. showSearch: true,
  463. // 总条数
  464. total: 0,
  465. //提单号暂存
  466. fMblno:'',
  467. // 财务数据主表格数据
  468. chargeList: [],
  469. // 弹出层标题
  470. title: '',
  471. // 是否显示弹出层
  472. open: false,
  473. fMblnoOptions: '',
  474. //导入查询参数
  475. queryParameter: {
  476. fCorpid: '',
  477. fToCorpid: '',
  478. fMblno: '',
  479. fStatementNo: '',
  480. fFeeid: '',
  481. timeExamine: '',
  482. timeInterval: ''
  483. },
  484. empty:[],
  485. //导入从表传主表
  486. pass:{
  487. fAmtdr:'', //应收合计
  488. fAmtcr:'', //应付合计
  489. fMblno:'', //提单号
  490. fName:'' //货权方
  491. },
  492. // 查询参数
  493. queryParams: {
  494. fId: null,
  495. pageNum: 1,
  496. pageSize: 10,
  497. fBillno: null,
  498. fCtrlcorpid: null,
  499. fCorpid: null,
  500. tMblno: null,
  501. fAmtdr: null,
  502. fAmtcr: null,
  503. fBilltype: null,
  504. fBillstatus: null,
  505. fRemarks: null,
  506. fAccbilldate: null,
  507. fDeptid: null
  508. },
  509. // 主表查询参数
  510. queryParams_s: {
  511. pageNum: 1,
  512. pageSize: 10,
  513. fBillno: null,
  514. fCtrlcorpid: null,
  515. fCorpid: null,
  516. tMblno: null,
  517. fAmtdr: null,
  518. fAmtcr: null,
  519. fBilltype: null,
  520. fBillstatus: null,
  521. fRemarks: null,
  522. fAccbilldate: null,
  523. fDeptid: null
  524. },
  525. // 表单参数
  526. form: {},
  527. // 表单校验
  528. ruless: {
  529. fCtrlcorpid: [
  530. { required: true, message: '货权方不能为空', trigger: 'blur' }
  531. ],
  532. fCorpid: [
  533. { required: true, message: '结算单位不能为空', trigger: 'blur' }
  534. ],
  535. fAccbilldate: [
  536. { required: true, message: '对账日期不能为空', trigger: 'blur' }
  537. ]
  538. },
  539. // 表单校验
  540. rules: {
  541. fBilltype: [
  542. { required: true, message: '单据类型', trigger: 'change' }
  543. ],
  544. fBillstatus: [
  545. { required: true, message: '状态不能为空', trigger: 'blur' }
  546. ],
  547. fDeptid: [
  548. { required: true, message: '制单部门不能为空', trigger: 'blur' }
  549. ],
  550. fToCorpid: [
  551. { required: true, message: '结算单位不能为空', trigger: 'blur' }
  552. ],
  553. timeExamine: [
  554. { required: true, message: '审核日期不能为空', trigger: 'blur' }
  555. ]
  556. }
  557. }
  558. },
  559. created() {
  560. this.getList()
  561. },
  562. methods: {
  563. // 确认收费
  564. confirmCharge() {
  565. this.queryParams.fBillstatus = '4'
  566. let formDate = new window.FormData()
  567. formDate.append('tFee',JSON.stringify(this.queryParams))
  568. formDate.append("tFeeDo", JSON.stringify(this.increase_s))
  569. collectFee(formDate).then(response=>{
  570. console.log(response)
  571. this.msgSuccess("操作成功")
  572. })
  573. this.open = false
  574. },
  575. charGe(){
  576. this.queryParameter.fToCorpid = this.queryParams.fCorpid
  577. this.innerVisible = true
  578. },
  579. getSummaries(param) {
  580. const { columns, data } = param;
  581. const sums = [];
  582. columns.forEach((column, index) => {
  583. const values = data.map(item => Number(item[column.property]));
  584. if (!values.every(value => isNaN(value))) {
  585. sums[index] = values.reduce((prev, curr) => {
  586. const value = Number(curr);
  587. if (!isNaN(value)) {
  588. return prev + curr;
  589. } else {
  590. return prev;
  591. }
  592. }, 0);
  593. sums[0] = '合计';
  594. sums[3] = '';
  595. }
  596. });
  597. return sums;
  598. },
  599. imgChangeI(row){
  600. if (row.fAmt && Number(row.fAmt) > Number(row.fAmtdr)){
  601. this.$set(row, 'fAmt', row.fAmtdr)
  602. this.state_s = true
  603. }
  604. console.log('数据:' + JSON.stringify(this.selection))
  605. // this.$refs.chargeList.clearSelection()
  606. },
  607. //确认导入
  608. confirmImport() {
  609. console.log(this.state_s)
  610. for (let item in this.selection) {
  611. this.pass.fAmtcr = Number(this.pass.fAmtcr)
  612. this.pass.fAmtdr = Number(this.pass.fAmtdr)
  613. this.pass.fAmtcr += Number(this.selection[item].fAmt)
  614. this.pass.fAmtdr += Number(this.selection[item].fAmtdr)
  615. console.log(this.pass.fAmtcr)
  616. console.log(this.pass.fAmtdr)
  617. }
  618. if (this.state_s == true) {
  619. if (this.selection.length == '0') {
  620. console.log('未选择')//写入提示
  621. this.$message.error('未选择导入行')
  622. } else {
  623. console.log(this.selection[0].fMblno)
  624. for (let item in this.selection) {
  625. this.empty.push(this.selection[item].fMblno)
  626. this.nothing.push(this.selection[item].fName)
  627. }
  628. //去重提单号
  629. this.empty = new Set(this.empty)
  630. this.empty = Array.from(this.empty)
  631. //去重货权方
  632. this.nothing = new Set(this.nothing)
  633. this.nothing = Array.from(this.nothing)
  634. if(this.empty.length <= 1){
  635. this.pass.fMblno = this.empty[0]
  636. console.log(this.pass.fMblno)
  637. }else {
  638. this.pass.fMblno = this.empty[0] + "..."
  639. console.log(this.pass.fMblno)
  640. }
  641. if (this.nothing.length <= 1){
  642. this.pass.fName = this.nothing[0]
  643. }else {
  644. this.pass.fName = this.nothing[0] + "..."
  645. }
  646. this.increase_s = this.selection
  647. this.queryParams.tMblno = this.pass.fMblno //提单号
  648. this.queryParams.fCtrlcorpid = this.pass.fName
  649. this.queryParams.fCorpid = this.queryParameter.fToCorpid
  650. this.queryParams.fAmtcr = this.pass.fAmtcr
  651. this.queryParams.fAmtdr = this.pass.fAmtdr
  652. console.log(this.queryParams)
  653. this.innerVisible = false
  654. this.chargeList_s = []
  655. this.queryParameter = {
  656. fCorpid: '',
  657. fToCorpid: '',
  658. fMblno: '',
  659. fStatementNo: '',
  660. fFeeid: '',
  661. timeExamine: '',
  662. timeInterval: ''
  663. }
  664. }
  665. } else if (this.state_s == false) {
  666. this.$message.error('本次金额不能大于原定金额')
  667. }
  668. },
  669. /** 查询财务数据主列表 */
  670. getList() {
  671. this.loading = true
  672. this.getDicts("approval_process").then((response) => {
  673. console.log(response.data)
  674. this.options = response.data
  675. });
  676. listCharge(this.queryParams_s).then(response => {
  677. console.log(response)
  678. this.chargeList = response.rows
  679. this.total = response.total
  680. this.loading = false
  681. })
  682. },
  683. // 取消按钮
  684. cancel() {
  685. this.open = false
  686. this.reset()
  687. },
  688. // 表单重置
  689. reset() {
  690. this.form = {
  691. fId: null,
  692. fBillno: null,
  693. fCtrlcorpid: null,
  694. fCorpid: null,
  695. tMblno: null,
  696. fAmtdr: null,
  697. fAmtcr: null,
  698. fBilltype: null,
  699. fBillstatus: '0',
  700. fRemarks: null,
  701. fAccbilldate: null,
  702. delFlag: null,
  703. createBy: null,
  704. fDeptid: null,
  705. createTime: null,
  706. updateBy: null,
  707. updateTime: null
  708. }
  709. this.resetForm('form')
  710. },
  711. /** 搜索按钮操作 */
  712. handleQuery() {
  713. this.queryParams.pageNum = 1
  714. this.getList()
  715. },
  716. /** 导入搜索 */
  717. importSearch() {
  718. console.log(this.queryParameter)
  719. // console.log(this.queryParameter[0].fFeeid.join(','))
  720. // .join(',')
  721. this.chargeList_s = []
  722. this.$refs['form'].validate(valid => {
  723. if (valid) {
  724. search(this.queryParameter).then(response => {
  725. this.chargeList_s = response.rows
  726. })
  727. }
  728. })
  729. },
  730. /** 远程模糊查询用户 */
  731. corpsRemoteMethod(name) {
  732. if (name == null || name === '') {
  733. return false
  734. }
  735. let queryParams = { pageNum: 1, pageSize: 10, fName: name, type: 1 }
  736. listCorps(queryParams).then((response) => {
  737. this.fMblnoOptions = response.rows
  738. this.KHblnoOptions = response.rows
  739. })
  740. },
  741. /** 重置按钮操作 */
  742. resetQuery() {
  743. this.resetForm('queryParams_s')
  744. this.handleQuery()
  745. },
  746. //导入重置按钮
  747. resetQuery_s() {
  748. this.queryParameter = {
  749. fCorpid: '',
  750. fToCorpid: '',
  751. fMblno: '',
  752. fStatementNo: '',
  753. fFeeid: '',
  754. timeExamine: '',
  755. timeInterval: ''
  756. }
  757. },
  758. // 远程模糊查询费用名称
  759. fWRemoteMethod(name) {
  760. this.fWbuOptions = []
  761. if (name == null || name === '') {
  762. return false
  763. }
  764. let queryParams = { pageNum: 1, pageSize: 10, fName: name }
  765. listFees(queryParams).then((response) => {
  766. console.log(this.fWbuOptions)
  767. this.fWbuOptions = response.rows
  768. })
  769. },
  770. // 多选框选中数据
  771. handleSelectionChange(selection) {
  772. this.ids = selection.map(item => item.fId)
  773. this.single = selection.length !== 1
  774. this.multiple = !selection.length
  775. },
  776. // 导入多选框
  777. handleSelectionChange_s(selection) {
  778. console.log(selection)
  779. this.selection = selection
  780. },
  781. /** 新增按钮操作 */
  782. handleAdd() {
  783. this.reset()
  784. this.pass={
  785. fAmtdr:'', //应收合计
  786. fAmtcr:'', //应付合计
  787. fMblno:'', //提单号
  788. fName:'', //货权方
  789. fFeesName:'', //结算单位
  790. fCorpid:'' //结算单位ID
  791. },
  792. // this.queryParams = []
  793. this.increase_s = []
  794. this.queryParams = {
  795. pageNum: 1,
  796. pageSize: 10,
  797. fBillno: null,
  798. fCtrlcorpid: null,
  799. fCorpid: null,
  800. tMblno: null,
  801. fAmtdr: null,
  802. fAmtcr: null,
  803. fBilltype: null,
  804. fBillstatus: null,
  805. fRemarks: null,
  806. fAccbilldate: null,
  807. fDeptid: null
  808. },
  809. this.resetForm('queryParams')
  810. this.open = true
  811. this.title = '添加财务数据主'
  812. },
  813. /** 修改按钮操作 */
  814. handleUpdate(row) {
  815. console.log(row)
  816. this.reset()
  817. this.pass={
  818. fAmtdr:'', //应收合计
  819. fAmtcr:'', //应付合计
  820. fMblno:'', //提单号
  821. fName:'', //货权方
  822. fFeesName:'', //结算单位
  823. fCorpid:'' //结算单位ID
  824. }
  825. const fId = row.fId || this.ids
  826. console.log(fId)
  827. getCharge(fId).then(response => {
  828. console.log(response)
  829. this.increase_s = response.data.feeDoList
  830. this.fWbuOptions = response.data.feesList
  831. this.queryParams = response.data.tFee
  832. this.fWbuOptions = response.data.feesList
  833. this.fMblnoOptions = response.data.corps
  834. this.open = true
  835. this.title = '修改收费列表'
  836. })
  837. },
  838. /** 提交按钮 */
  839. submitForm() {
  840. console.log(this.queryParameter)
  841. this.$refs['ruless'].validate(valid => {
  842. console.log(valid)
  843. if (valid) {
  844. if(this.queryParams.fId == null){
  845. console.log(this.queryParams)
  846. // this.chargeList.fBillstatus = '1'
  847. this.queryParams.fBillstatus = '1'
  848. let formData = new window.FormData()
  849. formData.append('tFee', JSON.stringify(this.queryParams))
  850. formData.append('tFeeDo', JSON.stringify(this.increase_s))
  851. addCharge(formData).then(response => {
  852. this.msgSuccess('新增成功')
  853. this.increase_s = []
  854. this.open = false
  855. this.getList()
  856. })
  857. }else {
  858. console.log(this.queryParams)
  859. // this.chargeList.fBillstatus = '1'
  860. this.queryParams.fBillstatus = '1'
  861. let formData = new window.FormData()
  862. formData.append('tFee', JSON.stringify(this.queryParams))
  863. formData.append('tFeeDo', JSON.stringify(this.increase_s))
  864. addCharge(formData).then(response => {
  865. this.msgSuccess('修改成功')
  866. this.increase_s = []
  867. this.open = false
  868. this.getList()
  869. })
  870. }
  871. }
  872. })
  873. },
  874. /** 删除按钮操作 */
  875. handleDelete(row) {
  876. const fIds = row.fId || this.ids
  877. this.$confirm('是否确认删除财务数据主编号为"' + fIds + '"的数据项?', '警告', {
  878. confirmButtonText: '确定',
  879. cancelButtonText: '取消',
  880. type: 'warning'
  881. }).then(function() {
  882. return delCharge(fIds)
  883. }).then(() => {
  884. this.getList()
  885. this.msgSuccess('删除成功')
  886. })
  887. },
  888. /** 导出按钮操作 */
  889. handleExport() {
  890. const queryParams = this.queryParams
  891. this.$confirm('是否确认导出所有财务数据主数据项?', '警告', {
  892. confirmButtonText: '确定',
  893. cancelButtonText: '取消',
  894. type: 'warning'
  895. }).then(function() {
  896. return exportCharge(queryParams)
  897. }).then(response => {
  898. this.download(response.msg)
  899. })
  900. },
  901. //清空一行
  902. deleteRow(index, rows) {
  903. this.queryParams.fAmtcr = 0
  904. this.queryParams.fAmtdr = 0
  905. rows.splice(index, 1);
  906. for(let item in this.increase_s) {
  907. console.log(this.increase_s[item])
  908. this.queryParams.fAmtcr += this.increase_s[item].fAmt
  909. this.queryParams.fAmtdr += this.increase_s[item].fAmtdr
  910. }
  911. console.log(this.queryParams.fAmtdr)
  912. console.log(this.queryParams.fAmtcr)
  913. },
  914. }
  915. }
  916. </script>