index.vue 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810
  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. clearablef
  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="序1号" 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. size="small"
  215. @keyup.enter.native="handleQuery"
  216. />
  217. </el-form-item>
  218. <el-form-item label="备注" prop="fRemarks">
  219. <el-input
  220. v-model="queryParams.fRemarks"
  221. placeholder="请输入备注"
  222. clearable
  223. size="small"
  224. @keyup.enter.native="handleQuery"
  225. />
  226. </el-form-item>
  227. </el-form>
  228. <div style="width: 100%;">
  229. <el-button type="warning" size="small" @click="innerVisible = true">收费</el-button>
  230. <el-button type="primary" size="small">确认收费</el-button>
  231. <el-button type="success" size="small">导出</el-button>
  232. <el-button type="info" size="small">打印</el-button>
  233. <el-button type="danger" size="small">删除</el-button>
  234. </div>
  235. <el-table v-loading="loading" :data="increase_s" @selection-change="handleSelectionChange_s">
  236. <el-table-column type="selection" width="55" align="center"/>
  237. <el-table-column label="序号" type="index" width="55" align="center"/>
  238. <el-table-column label="提单号" align="center" prop="fMblno"/>
  239. <el-table-column label="存货单号" align="center" prop="fBscorpno"/>
  240. <el-table-column label="品名" align="center" prop="fProductName"/>
  241. <el-table-column label="业务日期" align="center" prop="fBsdate">
  242. <template slot-scope="scope">
  243. <span>{{scope.row.fBsdate.slice(0,10)}}</span>
  244. </template>
  245. </el-table-column>
  246. <el-table-column label="费用名称" align="center" prop="fFeeName"/>
  247. <el-table-column label="收/付" align="center" prop="fDc">
  248. <template slot-scope="scope">
  249. <span v-if="scope.row.fDc =='D'">收</span>
  250. <span v-else="scope.row.fDc =='C'">付</span>
  251. </template>
  252. </el-table-column>
  253. <el-table-column label="业务类型" align="center" prop="fBilltype">
  254. <template slot-scope="scope">
  255. <span v-if="scope.row.fBilltype =='SJRK'">入库</span>
  256. <span v-else-if="scope.row.fBilltype == 'SJCK'">出库</span>
  257. <span v-else>{{scope.row.fBilltype}}</span>
  258. </template>
  259. </el-table-column>
  260. <el-table-column label="本次金额" align="center" prop="fAmt"/>
  261. <el-table-column label="备注" align="center" prop="fRemarks"/>
  262. <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
  263. <template slot-scope="scope">
  264. <el-button
  265. size="mini"
  266. type="text"
  267. icon="el-icon-delete"
  268. @click.native.prevent="deleteRow(scope.$index, increase_s)"
  269. >删除
  270. </el-button>
  271. </template>
  272. </el-table-column>
  273. </el-table>
  274. <div slot="footer" class="dialog-footer">
  275. <el-button type="primary" @click="submitForm">确 定</el-button>
  276. <el-button @click="cancel">取 消</el-button>
  277. </div>
  278. <el-dialog :close-on-click-modal="false" width="70%" :visible.sync="innerVisible" title="导入数据" append-to-body>
  279. <el-form ref="form" :model="queryParameter" :rules="rules" label-width="80px"
  280. style="display: flex;flex-wrap: wrap;"
  281. >
  282. <el-form-item label="货权方" prop="fCtrlcorpid">
  283. <!-- <el-input v-model="queryParameter.fCorpid" placeholder="请输入货权方" style="width: 200px;"/>-->
  284. <el-select
  285. v-model="queryParams.fCorpid"
  286. filterable
  287. remote
  288. clearable
  289. style="width: 200px"
  290. @keyup.enter.native="handleQuery"
  291. :remote-method="corpsRemoteMethod"
  292. placeholder="请选择货权方"
  293. >
  294. <el-option
  295. v-for="(dict, index) in fMblnoOptions"
  296. :key="index.fId"
  297. :label="dict.fName"
  298. :value="dict.fId"
  299. ></el-option>
  300. </el-select>
  301. </el-form-item>
  302. <el-form-item label="结算单位" prop="fToCorpid">
  303. <el-select
  304. v-model="queryParameter.fToCorpid"
  305. filterable
  306. remote
  307. clearable
  308. style="width: 200px"
  309. @keyup.enter.native="handleQuery"
  310. :remote-method="corpsRemoteMethod"
  311. placeholder="请输入结算单位"
  312. >
  313. <el-option
  314. v-for="(dict, index) in fMblnoOptions"
  315. :key="index.fId"
  316. :label="dict.fName"
  317. :value="dict.fId"
  318. ></el-option>
  319. </el-select>
  320. </el-form-item>
  321. <el-form-item label="提单号" prop="tMblno">
  322. <el-input v-model="queryParameter.fMblno" placeholder="请输入提单号" style="width: 200px;"/>
  323. </el-form-item>
  324. <el-form-item label="对账单号" prop="fStatementNo">
  325. <el-input v-model="queryParameter.fStatementNo" placeholder="请输入提单号" style="width: 200px;"/>
  326. </el-form-item>
  327. <el-form-item label="费用名称" prop="fFeeid">
  328. <template>
  329. <el-select
  330. v-model="queryParameter.fFeeid"
  331. filterable
  332. remote
  333. :remote-method="fWRemoteMethod"
  334. placeholder="费用名称"
  335. multiple
  336. >
  337. <el-option v-for="item in fWbuOptions" :key="item.fId" :label="item.fName" :value="item.fId">
  338. </el-option>
  339. </el-select>
  340. </template>
  341. </el-form-item>
  342. <el-form-item label="审核日期" prop="timeExamine">
  343. <el-date-picker
  344. size="small"
  345. style="width: 200px"
  346. v-model="queryParameter.timeExamine"
  347. type="daterange"
  348. start-placeholder="开始日期"
  349. end-placeholder="结束日期"
  350. value-format="yyyy-MM-dd"
  351. :default-time="['00:00:00', '23:59:59']"
  352. >
  353. </el-date-picker>
  354. </el-form-item>
  355. <el-form-item label="出入库日期" label-width="85px" prop="fAccbilldate">
  356. <el-date-picker
  357. size="small"
  358. style="width: 200px"
  359. v-model="queryParameter.timeInterval"
  360. type="daterange"
  361. start-placeholder="开始日期"
  362. end-placeholder="结束日期"
  363. value-format="yyyy-MM-dd"
  364. :default-time="['00:00:00', '23:59:59']"
  365. >
  366. </el-date-picker>
  367. </el-form-item>
  368. <el-form-item>
  369. <el-button type="cyan" icon="el-icon-search" size="mini" @click="importSearch">搜索</el-button>
  370. <el-button icon="el-icon-refresh" size="mini" @click="resetQuery_s">重1置</el-button>
  371. </el-form-item>
  372. </el-form>
  373. <el-table v-loading="loading" :data="chargeList_s" @selection-change="handleSelectionChange_s">
  374. <el-table-column type="selection" width="55" align="center"/>
  375. <el-table-column label="序号" type="index" width="55" align="center"/>
  376. <el-table-column label="货权方" align="center" prop="fName"/>
  377. <el-table-column label="提单号" align="center" prop="fMblno"/>
  378. <el-table-column label="品名" align="center" prop="fProductName"/>
  379. <el-table-column label="业务日期" align="center" prop="fBsdate"/>
  380. <el-table-column label="业务类型" align="center" prop="fBilltype">
  381. <template slot-scope="scope">
  382. <span v-if="scope.row.fBilltype =='SJRK'">入库</span>
  383. <span v-else-if="scope.row.fBilltype == 'SJCK'">出库</span>
  384. <span v-else>{{scope.row.fBilltype}}</span>
  385. </template>
  386. </el-table-column>
  387. <el-table-column label="审核日期" align="center" prop="fReviewDate"/>
  388. <el-table-column label="费用名称" align="center" prop="fFeeName"/>
  389. <el-table-column label="金额" align="center" prop="fAmtdr"/>
  390. <el-table-column label="本次金额" align="center" prop="fAmt">
  391. <template slot-scope="scope">
  392. <el-input
  393. v-model="scope.row.fAmt"
  394. placeholder="请输入本次金额"
  395. clearable
  396. size="small"
  397. oninput="value=value.replace(/[^\d]/g,'')"
  398. @input="imgChange1(scope.row.fAmtdr,scope.row.fAmt)"
  399. />
  400. </template>
  401. </el-table-column>
  402. <el-table-column label="备1注" align="center" prop="fRemarks">
  403. <template slot-scope="scope">
  404. <el-input
  405. v-model="scope.row.fRemarks"
  406. placeholder="请输入备注"
  407. clearable
  408. size="small"
  409. />
  410. </template>
  411. </el-table-column>
  412. </el-table>
  413. <div slot="footer" class="dialog-footer">
  414. <el-button type="primary" @click="confirmImport">确 定</el-button>
  415. <el-button @click="innerVisible = false">取 消</el-button>
  416. </div>
  417. </el-dialog>
  418. </el-dialog>
  419. </div>
  420. </template>
  421. <script>
  422. import {
  423. listCharge,
  424. getCharge,
  425. delCharge,
  426. addCharge,
  427. updateCharge,
  428. exportCharge,
  429. search,
  430. listCorps
  431. } from '@/api/finance/charge'
  432. import { listFees } from '@/api/basicdata/fees'
  433. import log from '@/views/monitor/job/log'
  434. export default {
  435. name: 'Charge',
  436. components: {},
  437. data() {
  438. return {
  439. browseStatus: true,
  440. //导入状态
  441. state_s: true ,
  442. fWbuOptions: [],
  443. options:'',
  444. // 遮罩层
  445. loading: true,
  446. //打开内部弹窗
  447. innerVisible: false,
  448. chargeList_s: [],
  449. selection: '',
  450. increase_s: [],
  451. // 选中数组
  452. ids: [],
  453. // 非单个禁用
  454. single: true,
  455. // 非多个禁用
  456. multiple: true,
  457. // 显示搜索条件
  458. showSearch: true,
  459. // 总条数
  460. total: 0,
  461. //提单号暂存
  462. fMblno:'',
  463. // 财务数据主表格数据
  464. chargeList: [],
  465. // 弹出层标题
  466. title: '',
  467. // 是否显示弹出层
  468. open: false,
  469. fMblnoOptions: '',
  470. //导入查询参数
  471. queryParameter: {
  472. fCorpid: '',
  473. fToCorpid: '',
  474. fMblno: '',
  475. fStatementNo: '',
  476. fFeeid: '',
  477. timeExamine: '',
  478. timeInterval: ''
  479. },
  480. // 查询参数
  481. queryParams: {
  482. pageNum: 1,
  483. pageSize: 10,
  484. fBillno: null,
  485. fCtrlcorpid: null,
  486. fCorpid: null,
  487. tMblno: null,
  488. fAmtdr: null,
  489. fAmtcr: null,
  490. fBilltype: null,
  491. fBillstatus: null,
  492. fRemarks: null,
  493. fAccbilldate: null,
  494. fDeptid: null
  495. },
  496. // 主表查询参数
  497. queryParams_s: {
  498. pageNum: 1,
  499. pageSize: 10,
  500. fBillno: null,
  501. fCtrlcorpid: null,
  502. fCorpid: null,
  503. tMblno: null,
  504. fAmtdr: null,
  505. fAmtcr: null,
  506. fBilltype: null,
  507. fBillstatus: null,
  508. fRemarks: null,
  509. fAccbilldate: null,
  510. fDeptid: null
  511. },
  512. // 表单参数
  513. form: {},
  514. // 表单校验
  515. ruless: {
  516. fCtrlcorpid: [
  517. { required: true, message: '货权方不能为空', trigger: 'blur' }
  518. ],
  519. fCorpid: [
  520. { required: true, message: '结算单位不能为空', trigger: 'blur' }
  521. ],
  522. fAccbilldate: [
  523. { required: true, message: '对账日期不能为空', trigger: 'blur' }
  524. ]
  525. },
  526. // 表单校验
  527. rules: {
  528. fBilltype: [
  529. { required: true, message: '单据类型', trigger: 'change' }
  530. ],
  531. fBillstatus: [
  532. { required: true, message: '状态不能为空', trigger: 'blur' }
  533. ],
  534. fDeptid: [
  535. { required: true, message: '制单部门不能为空', trigger: 'blur' }
  536. ],
  537. fToCorpid: [
  538. { required: true, message: '结算单位不能为空', trigger: 'blur' }
  539. ],
  540. timeExamine: [
  541. { required: true, message: '审核日期不能为空', trigger: 'blur' }
  542. ]
  543. }
  544. }
  545. },
  546. created() {
  547. this.getList()
  548. },
  549. methods: {
  550. imgChange1(fAmtdr,fAmt){
  551. if (fAmt <= fAmtdr){
  552. console.log("小了!")
  553. this.state_s = true
  554. }else if(fAmt > fAmtdr){
  555. console.log("大了!")
  556. this.$message.error('本次金额不能大于原定金额');
  557. this.state_s = false
  558. }
  559. },
  560. //确认导入
  561. confirmImport() {
  562. console.log(this.state_s)
  563. if(this.state_s == true){
  564. if (this.selection.length == '0') {
  565. console.log('未选择')//写入提示
  566. }else {
  567. console.log(this.selection[0].fMblno)
  568. for (let item in this.selection){
  569. console.log(this.selection[item])
  570. console.log(this.selection[item].fMblno)
  571. if(item > 1){
  572. this.fMblno = this.selection[item].fMblno + "..."
  573. }else if(item == 0){
  574. this.fMblno = this.selection[item].fMblno
  575. }
  576. }
  577. this.increase_s = this.selection
  578. this.innerVisible = false
  579. this.chargeList_s = []
  580. this.queryParameter = {
  581. fCorpid: '',
  582. fToCorpid: '',
  583. fMblno: '',
  584. fStatementNo: '',
  585. fFeeid: '',
  586. timeExamine: '',
  587. timeInterval: ''
  588. }
  589. }
  590. this.queryParams.tMblno = this.fMblno
  591. }else if(this.state_s == false){
  592. this.$message.error('本次金额不能大于原定金额');
  593. }
  594. },
  595. /** 查询财务数据主列表 */
  596. getList() {
  597. this.loading = true
  598. this.getDicts("approval_process").then((response) => {
  599. console.log(response.data)
  600. this.options = response.data
  601. });
  602. listCharge(this.queryParams_s).then(response => {
  603. console.log(response)
  604. this.chargeList = response.rows
  605. this.total = response.total
  606. this.loading = false
  607. })
  608. },
  609. // 取消按钮
  610. cancel() {
  611. this.open = false
  612. this.reset()
  613. },
  614. // 表单重置
  615. reset() {
  616. this.form = {
  617. fId: null,
  618. fBillno: null,
  619. fCtrlcorpid: null,
  620. fCorpid: null,
  621. tMblno: null,
  622. fAmtdr: null,
  623. fAmtcr: null,
  624. fBilltype: null,
  625. fBillstatus: '0',
  626. fRemarks: null,
  627. fAccbilldate: null,
  628. delFlag: null,
  629. createBy: null,
  630. fDeptid: null,
  631. createTime: null,
  632. updateBy: null,
  633. updateTime: null
  634. }
  635. this.resetForm('form')
  636. },
  637. /** 搜索按钮操作 */
  638. handleQuery() {
  639. this.queryParams.pageNum = 1
  640. this.getList()
  641. },
  642. /** 导入搜索 */
  643. importSearch() {
  644. console.log(this.queryParameter)
  645. // console.log(this.queryParameter[0].fFeeid.join(','))
  646. // .join(',')
  647. this.chargeList_s = []
  648. this.$refs['form'].validate(valid => {
  649. if (valid) {
  650. search(this.queryParameter).then(response => {
  651. this.chargeList_s = response.rows
  652. })
  653. }
  654. })
  655. },
  656. /** 远程模糊查询用户 */
  657. corpsRemoteMethod(name) {
  658. if (name == null || name === '') {
  659. return false
  660. }
  661. let queryParams = { pageNum: 1, pageSize: 10, fName: name, type: 1 }
  662. listCorps(queryParams).then((response) => {
  663. this.fMblnoOptions = response.rows
  664. this.KHblnoOptions = response.rows
  665. })
  666. },
  667. /** 重置按钮操作 */
  668. resetQuery() {
  669. this.resetForm('queryParams_s')
  670. this.handleQuery()
  671. },
  672. //导入重置按钮
  673. resetQuery_s() {
  674. this.queryParameter = {
  675. fCorpid: '',
  676. fToCorpid: '',
  677. fMblno: '',
  678. fStatementNo: '',
  679. fFeeid: '',
  680. timeExamine: '',
  681. timeInterval: ''
  682. }
  683. },
  684. // 远程模糊查询费用名称
  685. fWRemoteMethod(name) {
  686. this.fWbuOptions = []
  687. if (name == null || name === '') {
  688. return false
  689. }
  690. let queryParams = { pageNum: 1, pageSize: 10, fName: name }
  691. listFees(queryParams).then((response) => {
  692. console.log(this.fWbuOptions)
  693. this.fWbuOptions = response.rows
  694. })
  695. },
  696. // 多选框选中数据
  697. handleSelectionChange(selection) {
  698. this.ids = selection.map(item => item.fId)
  699. this.single = selection.length !== 1
  700. this.multiple = !selection.length
  701. },
  702. // 导入多选框
  703. handleSelectionChange_s(selection) {
  704. this.selection = selection
  705. },
  706. /** 新增按钮操作 */
  707. handleAdd() {
  708. this.reset()
  709. // this.queryParams = []
  710. this.increase_s = []
  711. this.queryParams = {
  712. pageNum: 1,
  713. pageSize: 10,
  714. fBillno: null,
  715. fCtrlcorpid: null,
  716. fCorpid: null,
  717. tMblno: null,
  718. fAmtdr: null,
  719. fAmtcr: null,
  720. fBilltype: null,
  721. fBillstatus: null,
  722. fRemarks: null,
  723. fAccbilldate: null,
  724. fDeptid: null
  725. },
  726. this.resetForm('queryParams')
  727. this.open = true
  728. this.title = '添加财务数据主'
  729. },
  730. /** 修改按钮操作 */
  731. handleUpdate(row) {
  732. console.log(row)
  733. this.reset()
  734. const fId = row.fId || this.ids
  735. console.log(fId)
  736. getCharge(fId).then(response => {
  737. console.log(response)
  738. this.increase_s = response.data.feeDoList
  739. this.fWbuOptions = response.data.feesList
  740. this.queryParams = response.data.tFee
  741. this.fWbuOptions = response.data.feesList
  742. this.fMblnoOptions = response.data.corps
  743. this.open = true
  744. this.title = '修改财务数据主'
  745. })
  746. },
  747. /** 提交按钮 */
  748. submitForm() {
  749. console.log(this.queryParameter)
  750. this.$refs['ruless'].validate(valid => {
  751. console.log(valid)
  752. if (valid) {
  753. console.log(this.queryParams)
  754. this.chargeList.fBillstatus = '1'
  755. let formData = new window.FormData()
  756. formData.append('tFee', JSON.stringify(this.queryParams))
  757. formData.append('tFeeDo', JSON.stringify(this.increase_s))
  758. addCharge(formData).then(response => {
  759. this.msgSuccess('新增成功')
  760. this.increase_s = []
  761. this.open = false
  762. this.getList()
  763. })
  764. }
  765. })
  766. },
  767. /** 删除按钮操作 */
  768. handleDelete(row) {
  769. const fIds = row.fId || this.ids
  770. this.$confirm('是否确认删除财务数据主编号为"' + fIds + '"的数据项?', '警告', {
  771. confirmButtonText: '确定',
  772. cancelButtonText: '取消',
  773. type: 'warning'
  774. }).then(function() {
  775. return delCharge(fIds)
  776. }).then(() => {
  777. this.getList()
  778. this.msgSuccess('删除成功')
  779. })
  780. },
  781. /** 导出按钮操作 */
  782. handleExport() {
  783. const queryParams = this.queryParams
  784. this.$confirm('是否确认导出所有财务数据主数据项?', '警告', {
  785. confirmButtonText: '确定',
  786. cancelButtonText: '取消',
  787. type: 'warning'
  788. }).then(function() {
  789. return exportCharge(queryParams)
  790. }).then(response => {
  791. this.download(response.msg)
  792. })
  793. },
  794. //清空一行
  795. deleteRow(index, rows) {
  796. rows.splice(index, 1);
  797. },
  798. }
  799. }
  800. </script>