index.vue 37 KB

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