index.vue 34 KB

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