financeManager.vue 39 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275
  1. <template>
  2. <div class="m-container">
  3. <h2>
  4. <div class="squrt"></div>
  5. 财务管理
  6. </h2>
  7. <div class="m-core">
  8. <div
  9. class="newBand"
  10. v-permission="{ child: 'routeOrder/add', parent: '/financeManager' }"
  11. @click="
  12. () => {
  13. routeOrderStatus = true;
  14. (isAdd = true), (form.applyType = null);
  15. }
  16. "
  17. >
  18. 添加订单
  19. </div>
  20. <div
  21. class="newBand"
  22. @click="onOrderExport"
  23. v-permission="{
  24. child: 'export/routeOrderList',
  25. parent: '/financeManager',
  26. }"
  27. >
  28. 报表导出
  29. </div>
  30. <div
  31. class="newBand"
  32. v-permission="{ child: 'adapay/exportBill', parent: '/financeManager' }"
  33. @click="onAdaPayExport"
  34. >
  35. 汇付订单导出
  36. </div>
  37. <div
  38. class="newBand"
  39. @click="onDownload"
  40. v-permission="'import/downloadTemplate?financeManager'"
  41. >
  42. 下载模板
  43. </div>
  44. <el-upload
  45. v-permission="'import/routeOrder'"
  46. style="display: inline-block; margin: 0 10px"
  47. action="/api-web/import/routeOrder"
  48. :show-file-list="false"
  49. :before-upload="beforeUpload"
  50. accept=".xlsx,.xls"
  51. :headers="headers"
  52. :on-error="handleError"
  53. :on-success="handleSuccess"
  54. >
  55. <div class="newBand">导入</div>
  56. </el-upload>
  57. <!-- 搜索类型 -->
  58. <save-form
  59. :inline="true"
  60. class="searchForm"
  61. ref="searchForm"
  62. :model.sync="searchForm"
  63. >
  64. <el-form-item>
  65. <el-input
  66. placeholder="学生编号/姓名/手机号"
  67. clearable
  68. type="text"
  69. v-model.trim="searchForm.search"
  70. ></el-input>
  71. </el-form-item>
  72. <el-form-item>
  73. <el-input
  74. placeholder="交易流水号"
  75. type="text"
  76. v-model.trim="searchForm.transNo"
  77. ></el-input>
  78. </el-form-item>
  79. <el-form-item>
  80. <el-input
  81. placeholder="订单号"
  82. type="text"
  83. v-model.trim="searchForm.orderNo"
  84. ></el-input>
  85. </el-form-item>
  86. <el-form-item>
  87. <el-input
  88. placeholder="收款账户"
  89. type="text"
  90. v-model.trim="searchForm.merNos"
  91. ></el-input>
  92. </el-form-item>
  93. <el-form-item>
  94. <el-input
  95. placeholder="余额支付大于等于"
  96. type="number"
  97. @mousewheel.native.prevent
  98. v-model.trim="searchForm.balancePaymentAmount"
  99. ></el-input>
  100. </el-form-item>
  101. <el-form-item>
  102. <el-input
  103. placeholder="现金支付大于等于"
  104. type="number"
  105. @mousewheel.native.prevent
  106. v-model.trim="searchForm.actualAmount"
  107. ></el-input>
  108. </el-form-item>
  109. <el-form-item>
  110. <el-input
  111. placeholder="余额支付小于等于"
  112. type="number"
  113. @mousewheel.native.prevent
  114. v-model.trim="searchForm.lessBalancePaymentAmount"
  115. ></el-input>
  116. </el-form-item>
  117. <el-form-item>
  118. <el-input
  119. placeholder="现金支付小于等于"
  120. type="number"
  121. @mousewheel.native.prevent
  122. v-model.trim="searchForm.lessActualAmount"
  123. ></el-input>
  124. </el-form-item>
  125. <el-form-item prop="routingOrganId">
  126. <el-select
  127. class="multiple"
  128. v-model.trim="searchForm.routingOrganId"
  129. filterable
  130. clearable
  131. @clear="onClear('routingOrganId')"
  132. placeholder="请选择分部"
  133. >
  134. <el-option
  135. v-for="(item, index) in selects.branchs"
  136. :key="index"
  137. :label="item.name"
  138. :value="item.id"
  139. ></el-option>
  140. </el-select>
  141. </el-form-item>
  142. <el-form-item>
  143. <el-date-picker
  144. v-model.trim="searchForm.orderDate"
  145. style="width: 410px"
  146. type="daterange"
  147. value-format="yyyy-MM-dd"
  148. @change="searchOrderDate"
  149. :picker-options="{
  150. firstDayOfWeek: 1,
  151. }"
  152. range-separator="至"
  153. start-placeholder="订单开始日期"
  154. end-placeholder="订单结束日期"
  155. ></el-date-picker>
  156. </el-form-item>
  157. <el-form-item>
  158. <el-select
  159. v-model.trim="searchForm.paymentType"
  160. clearable
  161. filterable
  162. @clear="onClear('paymentType')"
  163. placeholder="交易类型"
  164. >
  165. <el-option
  166. v-for="(item, index) in orderStatus"
  167. :key="index"
  168. :label="item.label"
  169. :value="item.value"
  170. ></el-option>
  171. </el-select>
  172. </el-form-item>
  173. <el-form-item>
  174. <el-select
  175. v-model.trim="searchForm.paymentStatus"
  176. clearable
  177. filterable
  178. @clear="onClear('paymentStatus')"
  179. placeholder="交易状态"
  180. >
  181. <el-option
  182. v-for="(item, index) in dealStatus"
  183. :key="index"
  184. :label="item.label"
  185. :value="item.value"
  186. ></el-option>
  187. </el-select>
  188. </el-form-item>
  189. <el-form-item>
  190. <el-button @click="search" type="danger">搜索</el-button>
  191. <el-button @click="onReSet" type="primary">重置</el-button>
  192. </el-form-item>
  193. </save-form>
  194. <!-- 列表 -->
  195. <div style="font-size: 14px; color: #f85043; padding-bottom: 10px">
  196. 营收金额:{{ totalRevenueAmount | moneyFormat }}元
  197. <i style="width: 10px; display: inline-block"></i>
  198. 实收金额:{{ totalActualAmount | moneyFormat }}元
  199. <i style="width: 10px; display: inline-block"></i>
  200. 预收金额:{{ totalAdvanceAmount | moneyFormat }}元
  201. <i style="width: 10px; display: inline-block"></i>
  202. 预收余额:{{ totalUserBalance | moneyFormat }}元
  203. </div>
  204. <div class="tableWrap">
  205. <el-table
  206. :data="tableList"
  207. :header-cell-style="{ background: '#EDEEF0', color: '#444' }"
  208. >
  209. <el-table-column align="center" prop="transNo" label="所属分部">
  210. <template slot-scope="scope">
  211. <div>
  212. <copy-text>{{ scope.row.routeOrganName }}</copy-text>
  213. </div>
  214. </template>
  215. </el-table-column>
  216. <el-table-column align="center" prop="transNo" label="交易流水号">
  217. <template slot-scope="scope">
  218. <div>
  219. <copy-text>{{ scope.row.transNo }}</copy-text>
  220. </div>
  221. </template>
  222. </el-table-column>
  223. <el-table-column align="center" prop="orderNo" label="订单号">
  224. <template slot-scope="scope">
  225. <div>
  226. <copy-text>{{ scope.row.orderNo }}</copy-text>
  227. </div>
  228. </template>
  229. </el-table-column>
  230. <el-table-column
  231. align="center"
  232. width="150"
  233. prop="createTime"
  234. label="订单日期"
  235. >
  236. <template slot-scope="scope">{{
  237. scope.row.createTime | dateForMinFormat
  238. }}</template>
  239. </el-table-column>
  240. <el-table-column align="center" width="100px" label="交易类型">
  241. <template slot-scope="scope">{{
  242. scope.row.type | orderType
  243. }}</template>
  244. </el-table-column>
  245. <el-table-column align="center" prop="expectAmount" label="应付金额">
  246. <template slot-scope="scope">
  247. <div>
  248. {{ scope.row.expectAmount | moneyFormat }}
  249. </div>
  250. </template>
  251. </el-table-column>
  252. <el-table-column
  253. align="center"
  254. prop="balancePaymentAmount"
  255. label="余额支付"
  256. >
  257. <template slot-scope="scope">
  258. <div>
  259. {{ scope.row.balancePaymentAmount | moneyFormat }}
  260. </div>
  261. </template>
  262. </el-table-column>
  263. <el-table-column align="center" prop="actualAmount" label="现金支付">
  264. <template slot-scope="scope">
  265. <div>
  266. {{ scope.row.actualAmount | moneyFormat }}
  267. </div>
  268. </template>
  269. </el-table-column>
  270. <el-table-column align="center" prop="routeAmount" label="分润金额">
  271. <template slot-scope="scope">
  272. <div>
  273. {{ scope.row.routeAmount | moneyFormat }}
  274. </div>
  275. </template>
  276. </el-table-column>
  277. <el-table-column
  278. align="center"
  279. prop="routeBalanceAmount"
  280. label="分润余额"
  281. >
  282. <template slot-scope="scope">
  283. <div>
  284. {{ scope.row.routeBalanceAmount | moneyFormat }}
  285. </div>
  286. </template>
  287. </el-table-column>
  288. <el-table-column align="center" label="学员姓名" width="130px">
  289. <template slot-scope="scope">
  290. <div>
  291. <!-- v-if="scope.row.type !== 'OUTORDER'" -->
  292. <div>
  293. <p>
  294. <copy-text> {{ scope.row.user.username }}</copy-text>
  295. </p>
  296. <copy-text>{{ scope.row.user.phone }}</copy-text>
  297. </div>
  298. </div>
  299. </template>
  300. </el-table-column>
  301. <el-table-column
  302. align="center"
  303. prop="paymentChannel"
  304. label="交易方式"
  305. >
  306. <template slot-scope="scope">{{
  307. scope.row.paymentChannel | paymentChannelStatus
  308. }}</template>
  309. </el-table-column>
  310. <!-- <el-table-column align="center"
  311. label="收款账户">
  312. <template slot-scope="scope">{{ scope.row.merNo }}</template>
  313. </el-table-column> -->
  314. <el-table-column align="center" label="交易状态">
  315. <template slot-scope="scope">{{
  316. scope.row.status | dealStatus
  317. }}</template>
  318. </el-table-column>
  319. <el-table-column align="center" label="备注" width="220px">
  320. <template slot-scope="scope">
  321. <overflow-text width="200px" :text="scope.row.memo"/>
  322. </template>
  323. </el-table-column>
  324. <el-table-column
  325. align="center"
  326. fixed="right"
  327. width="150px"
  328. label="操作"
  329. >
  330. <template slot-scope="scope">
  331. <div v-if="scope.row.groupType == 'OUTORDER'">
  332. <el-button type="text" @click="lookOrderInfo(scope.row)"
  333. >查看</el-button
  334. >
  335. <!-- <el-button type="text" @click="removeOrderInfo(scope.row)"
  336. >删除</el-button
  337. > -->
  338. </div>
  339. </template>
  340. </el-table-column>
  341. </el-table>
  342. <pagination
  343. :total.sync="pageInfo.total"
  344. sync
  345. :page.sync="pageInfo.page"
  346. :limit.sync="pageInfo.limit"
  347. :page-sizes="pageInfo.page_size"
  348. @pagination="getList"
  349. />
  350. </div>
  351. <el-dialog
  352. :title="isAdd ? '添加订单' : '查看'"
  353. destroy-on-close
  354. :visible.sync="routeOrderStatus"
  355. @close="onFormClose('ruleForm')"
  356. width="600px"
  357. >
  358. <el-form :model="form" :rules="rules" ref="ruleForm">
  359. <div class="lookTitle">基本信息</div>
  360. <el-form-item
  361. label="所属分部"
  362. prop="routeOrganId"
  363. :rules="[
  364. { required: true, message: '请选择分部', trigger: 'change' },
  365. ]"
  366. :label-width="formLabelWidth"
  367. >
  368. <el-select
  369. v-model.trim="form.routeOrganId"
  370. :disabled="!isAdd"
  371. @change="changeOrgin"
  372. style="width: 100% !important"
  373. >
  374. <el-option
  375. v-for="(item, index) in selects.branchs"
  376. :key="index"
  377. :label="item.name"
  378. :value="item.id"
  379. ></el-option>
  380. </el-select>
  381. </el-form-item>
  382. <el-form-item
  383. label="所属学校"
  384. prop="schoolId"
  385. :label-width="formLabelWidth"
  386. >
  387. <el-select
  388. v-model="form.schoolId"
  389. :disabled="!isAdd"
  390. @change="checkSchool"
  391. style="width: 100% !important"
  392. >
  393. <el-option
  394. v-for="(item, index) in cooperationList"
  395. :key="index"
  396. :label="item.name"
  397. :value="item.id"
  398. ></el-option>
  399. </el-select>
  400. </el-form-item>
  401. <el-form-item
  402. label="缴费单号"
  403. prop="calenderId"
  404. :label-width="formLabelWidth"
  405. >
  406. <el-input
  407. v-model.trim="form.calenderId"
  408. :disabled="!isAdd"
  409. placeholder="请输入缴费单号"
  410. ></el-input>
  411. </el-form-item>
  412. <el-form-item
  413. label="学员编号"
  414. prop="userId"
  415. :label-width="formLabelWidth"
  416. >
  417. <el-input
  418. v-model.trim="form.userId"
  419. :disabled="!isAdd"
  420. placeholder="请输入学员编号"
  421. ></el-input>
  422. </el-form-item>
  423. <div class="lookTitle">交易信息</div>
  424. <el-form-item
  425. label="交易流水号"
  426. prop="transNo"
  427. :label-width="formLabelWidth"
  428. >
  429. <el-input
  430. placeholder="请输入交易流水号"
  431. type="text"
  432. :disabled="!isAdd"
  433. v-model.trim="form.transNo"
  434. ></el-input>
  435. </el-form-item>
  436. <el-form-item
  437. label="收款账户"
  438. prop="merNo"
  439. :label-width="formLabelWidth"
  440. >
  441. <el-input
  442. placeholder="请输入收款账户"
  443. type="text"
  444. :disabled="!isAdd"
  445. v-model.trim="form.merNo"
  446. ></el-input>
  447. </el-form-item>
  448. <el-form-item
  449. label="交易日期"
  450. prop="payTime"
  451. :label-width="formLabelWidth"
  452. >
  453. <el-date-picker
  454. style="width: 100%"
  455. :disabled="!isAdd"
  456. v-model="form.payTime"
  457. type="datetime"
  458. format="yyyy-MM-dd HH:mm:ss"
  459. value-format="yyyy-MM-dd HH:mm:ss"
  460. placeholder="选择交易日期"
  461. >
  462. </el-date-picker>
  463. </el-form-item>
  464. <el-form-item
  465. label="收入类型"
  466. v-if="isAdd"
  467. :label-width="formLabelWidth"
  468. prop="applyType"
  469. >
  470. <el-select
  471. class="multiple"
  472. style="width: 100% !important"
  473. v-model.trim="form.applyType"
  474. @change="changeApplyType"
  475. filterable
  476. clearable
  477. :disabled="!isAdd"
  478. placeholder="请选择收入类型"
  479. >
  480. <el-option
  481. v-for="(item, index) in orderServerList"
  482. :key="index"
  483. :label="item.label"
  484. :value="item.value"
  485. ></el-option>
  486. </el-select>
  487. </el-form-item>
  488. <div v-if="form.applyType == 'SELL'">
  489. <div
  490. v-for="(goodsList, index) in form.goodsList"
  491. :key="index"
  492. class="shopListWrap"
  493. >
  494. <el-form-item
  495. :label="'商品名称' + (index + 1)"
  496. :label-width="formLabelWidth"
  497. class="setWidth"
  498. :prop="'goodsList.' + index + '.id'"
  499. :rules="[
  500. { required: true, message: '请选择商品', trigger: 'change' },
  501. ]"
  502. >
  503. <el-select
  504. v-if="isAdd"
  505. v-model.trim="goodsList.id"
  506. filterable
  507. :disabled="!isAdd"
  508. @change="checkgoods"
  509. placeholder="请选择商品"
  510. >
  511. <el-option
  512. v-for="(item, index) in shopList"
  513. :key="index"
  514. :label="item.name"
  515. :value="item.id"
  516. ></el-option>
  517. </el-select>
  518. <p class="showShop" v-else>
  519. <Tooltip :content="goodsList.id | filterShopId" />
  520. </p>
  521. </el-form-item>
  522. <el-form-item
  523. class="setWidth"
  524. style="margin: 0 10px"
  525. :prop="'goodsList.' + index + '.number'"
  526. :rules="validAmount"
  527. >
  528. <!-- <el-input-number style="width: 160px;" v-model="goodsList.number" placeholder="商品数量"></el-input-number> -->
  529. <el-input
  530. type="age"
  531. style="width: 160px"
  532. :disabled="!isAdd"
  533. clearable
  534. placeholder="请输入商品数量"
  535. @mousewheel.native.prevent
  536. v-model.number="goodsList.number"
  537. ></el-input>
  538. </el-form-item>
  539. <el-button
  540. icon="el-icon-minus"
  541. :disabled="!isAdd"
  542. v-if="form.goodsList.length > 1"
  543. circle
  544. style="height: 40px"
  545. @click.prevent="removeGoodsList(goodsList)"
  546. ></el-button>
  547. <el-button
  548. icon="el-icon-plus"
  549. :disabled="!isAdd"
  550. @click.prevent="addGoodsList"
  551. circle
  552. style="margin-left: 5px; height: 40px"
  553. ></el-button>
  554. </div>
  555. </div>
  556. <el-form-item
  557. label="销售金额"
  558. v-if="form.applyType == 'SELL' || !isAdd"
  559. prop="saleAmount"
  560. :label-width="formLabelWidth"
  561. >
  562. <el-input
  563. v-model="form.saleAmount"
  564. @mousewheel.native.prevent
  565. type="number"
  566. :disabled="!isAdd"
  567. placeholder="请输入销售金额"
  568. />
  569. </el-form-item>
  570. <el-form-item
  571. label="服务金额"
  572. v-if="form.applyType == 'SERVICE' || !isAdd"
  573. prop="serviceAmount"
  574. :label-width="formLabelWidth"
  575. >
  576. <el-input
  577. type="number"
  578. @mousewheel.native.prevent
  579. :disabled="!isAdd"
  580. v-model="form.serviceAmount"
  581. placeholder="请输入收入金额"
  582. />
  583. </el-form-item>
  584. <div class="lookTitle">其它</div>
  585. <el-form-item label="备注" prop="memo" :label-width="formLabelWidth">
  586. <el-input
  587. placeholder="请输入备注"
  588. :disabled="!isAdd"
  589. v-model.trim="form.memo"
  590. type="textarea"
  591. :rows="3"
  592. ></el-input>
  593. </el-form-item>
  594. </el-form>
  595. <span slot="footer" class="dialog-footer">
  596. <el-button @click="routeOrderStatus = false">取 消</el-button>
  597. <el-button
  598. v-if="!isAdd"
  599. @click="routeOrderStatus = false"
  600. type="primary"
  601. >确 定</el-button
  602. >
  603. <el-button v-else @click="onOrderSubmit('ruleForm')" type="primary"
  604. >确 定</el-button
  605. >
  606. </span>
  607. </el-dialog>
  608. </div>
  609. </div>
  610. </template>
  611. <script>
  612. import pagination from "@/components/Pagination/index";
  613. import {
  614. routeOrderFinance,
  615. routeOrderAdd,
  616. getOrderInfo,
  617. orderDelete,
  618. } from "@/api/orderManager";
  619. import { goodsQuery } from "@/api/businessManager";
  620. import { getEmployeeOrgan, getAddress, getCooperation } from "@/api/buildTeam";
  621. // import store from '@/store'
  622. import { orderStatus, dealStatus } from "@/utils/searchArray";
  623. import cleanDeep from "clean-deep";
  624. import axios from "axios";
  625. import qs from "qs";
  626. import { getToken } from "@/utils/auth";
  627. import load from "@/utils/loading";
  628. import { orderServerList } from "@/utils/searchArray";
  629. import { Export } from "@/utils/downLoadFile";
  630. import Tooltip from "@/components/Tooltip/index";
  631. let validAmount = (rule, value, callback) => {
  632. if (!value) {
  633. callback(new Error("请输入商品数量"));
  634. } else if (value < 0) {
  635. callback(new Error("输入商品数量必须大于0"));
  636. } else if (value > 999) {
  637. callback(new Error("输入商品数量必须小于999"));
  638. } else {
  639. callback();
  640. }
  641. };
  642. let that;
  643. export default {
  644. components: { pagination, Tooltip },
  645. name: "incomeTwo",
  646. computed: {
  647. extraQuery() {
  648. const data = {};
  649. if (this.$route.path === "/orderList/financeManager") {
  650. data.noneTqType = "1";
  651. }
  652. return data;
  653. },
  654. },
  655. data() {
  656. return {
  657. orderStatus: orderStatus,
  658. dealStatus: dealStatus,
  659. searchForm: {
  660. search: null,
  661. orderStartDate: null,
  662. orderEndDate: null,
  663. paymentStatus: "SUCCESS",
  664. paymentType: null,
  665. routingOrganId: null,
  666. actualAmount: null,
  667. balancePaymentAmount: null,
  668. orderNo: null,
  669. transNo: null,
  670. merNos: null,
  671. lessBalancePaymentAmount: null,
  672. lessActualAmount: null,
  673. orderDate: [],
  674. },
  675. tableList: [],
  676. organList: [],
  677. shopList: [],
  678. cooperationList: [],
  679. orderServerList: orderServerList,
  680. pageInfo: {
  681. // 分页规则
  682. limit: 10, // 限制显示条数
  683. page: 1, // 当前页
  684. total: 0, // 总条数
  685. page_size: [10, 20, 40, 50], // 选择限制显示条数
  686. },
  687. totalUserBalance: 0,
  688. totalActualAmount: 0,
  689. totalAdvanceAmount: 0,
  690. totalRevenueAmount: 0,
  691. formLabelWidth: "100px",
  692. routeOrderStatus: false,
  693. isAdd: true,
  694. form: {
  695. routeOrganId: null,
  696. transNo: null,
  697. type: "OTHER",
  698. merNo: null,
  699. actualAmount: null,
  700. memo: null,
  701. payTime: null,
  702. serviceAmount: null,
  703. saleAmount: null,
  704. schoolId: null,
  705. goodsList: [
  706. {
  707. id: null,
  708. number: null,
  709. },
  710. ],
  711. applyType: null,
  712. userId: "",
  713. calenderId: "",
  714. },
  715. validAmount: [
  716. { required: true, validator: validAmount, trigger: "blur" },
  717. { type: "number", message: "商品数量必须为数字" },
  718. ],
  719. rules: {
  720. organId: [
  721. { required: true, message: "请选择所属分部", trigger: "change" },
  722. ],
  723. // schoolId: [
  724. // { required: true, message: "请选择学校", trigger: "change" }
  725. // ],
  726. actualAmount: [
  727. { required: true, message: "请输入金额", trigger: "blur" },
  728. ],
  729. transNo: [
  730. { required: true, message: "请输入交易流水号", trigger: "blur" },
  731. ],
  732. merNo: [{ required: true, message: "请输入收款账户", trigger: "blur" }],
  733. payTime: [
  734. { required: true, message: "选择交易日期", trigger: "change" },
  735. ],
  736. applyType: [
  737. { required: true, message: "请选择收入类型", trigger: "change" },
  738. ],
  739. },
  740. headers: {
  741. Authorization: getToken(),
  742. },
  743. };
  744. },
  745. created() {
  746. that = this;
  747. },
  748. mounted() {
  749. // getEmployeeOrgan().then((res) => {
  750. // if (res.code == 200) {
  751. // this.organList = res.data;
  752. // }
  753. // });
  754. this.$store.dispatch("setBranchs");
  755. goodsQuery({ status: 1, rows: 99999 }).then((res) => {
  756. if (res.code === 200) {
  757. this.shopList = res.data.rows;
  758. }
  759. });
  760. if (!(this.searchForm.orderDate?.length > 0)) {
  761. var now = new Date();
  762. var startDate = new Date(
  763. Date.UTC(now.getFullYear(), now.getMonth(), now.getDate())
  764. )
  765. .toISOString()
  766. .slice(0, 10);
  767. var endDate = new Date(
  768. Date.UTC(now.getFullYear(), now.getMonth(), now.getDate())
  769. )
  770. .toISOString()
  771. .slice(0, 10);
  772. this.searchForm.orderDate = [];
  773. this.searchForm.orderDate.push(startDate);
  774. this.searchForm.orderDate.push(endDate);
  775. }
  776. this.getList();
  777. },
  778. methods: {
  779. onClear(type) {
  780. if (type == "paymentType") {
  781. this.searchForm.paymentType = null;
  782. } else if (type == "paymentStatus") {
  783. this.searchForm.paymentStatus = null;
  784. } else if (type == "routingOrganId") {
  785. this.searchForm.routingOrganId = null;
  786. }
  787. },
  788. onOrderSubmit(formName) {
  789. // 添加订单
  790. this.$refs[formName].validate((valid) => {
  791. if (valid) {
  792. let form = this.form;
  793. if (!form.saleAmount && !form.serviceAmount) {
  794. this.$message.error("请输入销售收入或服务收入");
  795. return;
  796. }
  797. if (!form.saleAmount) {
  798. form.goodsList = null;
  799. }
  800. let goodsJson = {};
  801. for (let i in form.goodsList) {
  802. goodsJson[form.goodsList[i]["id"]] = form.goodsList[i]["number"];
  803. }
  804. form.goodsJson =
  805. form.applyType == "SERVICE" ? null : JSON.stringify(goodsJson);
  806. routeOrderAdd(form).then((res) => {
  807. if (res.code == 200) {
  808. this.$message.success("添加成功");
  809. this.routeOrderStatus = false;
  810. this.getList();
  811. } else {
  812. this.$message.error(res.msg);
  813. console.log("来了");
  814. }
  815. });
  816. } else {
  817. return;
  818. }
  819. });
  820. },
  821. onFormClose(formName) {
  822. // this.form = {
  823. // organId: null,
  824. // transNo: null,
  825. // type: "OTHER",
  826. // merNo: null,
  827. // actualAmount: null,
  828. // memo: null,
  829. // payTime: null,
  830. // goodsList: [{
  831. // id: null,
  832. // number: null
  833. // }]
  834. // }
  835. // 关闭弹窗重置验证
  836. this.$refs[formName].resetFields();
  837. },
  838. onOrderExport() {
  839. // 报表导出
  840. let url = "/api-web/export/routeOrderList";
  841. let searchForm = this.searchForm;
  842. let data = {
  843. orderType: 3,
  844. search: searchForm.search,
  845. orderNo: searchForm.orderNo,
  846. transNo: searchForm.transNo,
  847. merNos: searchForm.merNos,
  848. actualAmount: searchForm.actualAmount,
  849. balancePaymentAmount: searchForm.balancePaymentAmount,
  850. paymentStatus: searchForm.paymentStatus,
  851. paymentType: searchForm.paymentType,
  852. organId: searchForm.organId,
  853. lessBalancePaymentAmount: searchForm.lessBalancePaymentAmount,
  854. lessActualAmount: searchForm.lessActualAmount,
  855. ...this.extraQuery,
  856. };
  857. if (this.searchForm.orderDate && this.searchForm.orderDate.length > 0) {
  858. data.orderStartDate = this.searchForm.orderDate[0];
  859. data.orderEndDate = this.searchForm.orderDate[1];
  860. } else {
  861. data.orderStartDate = null;
  862. data.orderEndDate = null;
  863. }
  864. const options = {
  865. method: "POST",
  866. headers: {
  867. Authorization: getToken(),
  868. },
  869. data: qs.stringify(cleanDeep(data)),
  870. url,
  871. responseType: "blob",
  872. };
  873. this.$confirm("您确定导出报表", "提示", {
  874. confirmButtonText: "确定",
  875. cancelButtonText: "取消",
  876. type: "warning",
  877. })
  878. .then(() => {
  879. load.startLoading();
  880. axios(options).then((res) => {
  881. let blob = new Blob([res.data], {
  882. // type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8'
  883. type: "application/vnd.ms-excel;charset=utf-8",
  884. //word文档为application/msword,pdf文档为application/pdf,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8
  885. });
  886. let objectUrl = URL.createObjectURL(blob);
  887. let link = document.createElement("a");
  888. let nowTime = new Date();
  889. let ymd =
  890. nowTime.getFullYear() +
  891. "" +
  892. (nowTime.getMonth() + 1) +
  893. "" +
  894. nowTime.getDate() +
  895. "" +
  896. nowTime.getHours() +
  897. "" +
  898. nowTime.getMinutes();
  899. let fname = "报表导出" + new Date().getTime() + ".xls"; //下载文件的名字
  900. link.href = objectUrl;
  901. link.setAttribute("download", fname);
  902. document.body.appendChild(link);
  903. link.click();
  904. load.endLoading();
  905. });
  906. })
  907. .catch(() => {});
  908. },
  909. onAdaPayExport() {
  910. // 报表导出
  911. let url = "/api-web/adapay/exportBill";
  912. let data = {
  913. ...this.extraQuery,
  914. };
  915. if (this.searchForm.orderDate && this.searchForm.orderDate.length > 0) {
  916. data.startTime = this.searchForm.orderDate[0];
  917. data.endTime = this.searchForm.orderDate[1];
  918. } else {
  919. this.$message.error("请选择开始日期和结束日期");
  920. return;
  921. }
  922. const options = {
  923. method: "get",
  924. headers: {
  925. Authorization: getToken(),
  926. },
  927. params: data,
  928. url,
  929. responseType: "blob",
  930. };
  931. this.$confirm("您确定导出汇付订单", "提示", {
  932. confirmButtonText: "确定",
  933. cancelButtonText: "取消",
  934. type: "warning",
  935. })
  936. .then(() => {
  937. load.startLoading();
  938. axios(options).then((res) => {
  939. let blob = new Blob([res.data], {
  940. // type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8'
  941. type: "application/vnd.ms-excel;charset=utf-8",
  942. //word文档为application/msword,pdf文档为application/pdf,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8
  943. });
  944. let objectUrl = URL.createObjectURL(blob);
  945. let link = document.createElement("a");
  946. let fname = "汇付订单" + new Date().getTime() + ".xls"; //下载文件的名字
  947. link.href = objectUrl;
  948. link.setAttribute("download", fname);
  949. document.body.appendChild(link);
  950. link.click();
  951. load.endLoading();
  952. });
  953. })
  954. .catch(() => {});
  955. },
  956. search() {
  957. this.pageInfo.page = 1;
  958. this.$refs.searchForm.save(this.searchForm);
  959. this.$refs.searchForm.save(this.pageInfo, "page");
  960. this.getList();
  961. },
  962. getList() {
  963. // let params = JSON.parse(JSON.stringify(this.searchForm));
  964. let params = Object.assign(
  965. {
  966. ...this.extraQuery,
  967. },
  968. this.searchForm
  969. );
  970. // let params = {...this.searchForm}
  971. params.rows = this.pageInfo.limit;
  972. params.page = this.pageInfo.page;
  973. params.orderNo = params.orderNo ? params.orderNo : null;
  974. params.transNo = params.transNo ? params.transNo : null;
  975. params.merNos = params.merNos ? params.merNos : null;
  976. params.actualAmount = params.actualAmount ? params.actualAmount : null;
  977. params.balancePaymentAmount = params.balancePaymentAmount
  978. ? params.balancePaymentAmount
  979. : null;
  980. if (this.searchForm.orderDate && this.searchForm.orderDate.length > 0) {
  981. params.orderStartDate = this.searchForm.orderDate[0];
  982. params.orderEndDate = this.searchForm.orderDate[1];
  983. } else {
  984. params.orderStartDate = null;
  985. params.orderEndDate = null;
  986. }
  987. params.orderDate = null;
  988. routeOrderFinance(cleanDeep(params)).then((res) => {
  989. let result = res.data;
  990. if (res.code == 200) {
  991. this.tableList = result.rows;
  992. this.pageInfo.total = result.total;
  993. this.totalUserBalance = result.totalUserBalance
  994. ? result.totalUserBalance
  995. : 0;
  996. this.totalActualAmount = result.totalActualAmount
  997. ? result.totalActualAmount
  998. : 0;
  999. this.totalAdvanceAmount = result.totalAdvanceAmount
  1000. ? result.totalAdvanceAmount
  1001. : 0;
  1002. this.totalRevenueAmount = result.totalRevenueAmount
  1003. ? result.totalRevenueAmount
  1004. : 0;
  1005. }
  1006. });
  1007. },
  1008. searchOrderDate(value) {
  1009. if (value) {
  1010. this.searchForm.orderStartDate = value[0];
  1011. this.searchForm.orderEndDate = value[1];
  1012. } else {
  1013. this.searchForm.orderStartDate = null;
  1014. this.searchForm.orderEndDate = null;
  1015. }
  1016. },
  1017. onReSet() {
  1018. // 重置搜索
  1019. this.orderDate = null;
  1020. this.searchForm = {
  1021. search: null,
  1022. orderStartDate: null,
  1023. orderEndDate: null,
  1024. paymentStatus: null,
  1025. paymentType: null,
  1026. routingOrganId: null,
  1027. actualAmount: null,
  1028. balancePaymentAmount: null,
  1029. orderNo: null,
  1030. transNo: null,
  1031. merNos: null,
  1032. lessBalancePaymentAmount: null,
  1033. lessActualAmount: null,
  1034. orderDate: [],
  1035. };
  1036. this.getList();
  1037. },
  1038. removeGoodsList(item) {
  1039. const index = this.form.goodsList.indexOf(item);
  1040. if (index !== -1) {
  1041. this.form.goodsList.splice(index, 1);
  1042. }
  1043. },
  1044. addGoodsList() {
  1045. this.form.goodsList.push({
  1046. id: null,
  1047. number: null,
  1048. });
  1049. },
  1050. changeOrgin(val) {
  1051. this.$set(this.form, "schoolId", null);
  1052. if (val) {
  1053. getCooperation({ rows: 9999, organId: val }).then((res) => {
  1054. if (res.code === 200) {
  1055. this.cooperationList = res.data.rows;
  1056. }
  1057. });
  1058. }
  1059. },
  1060. checkSchool(val) {},
  1061. checkgoods(val) {
  1062. for (let i = 0; i <= this.form.goodsList.length - 1; i++) {
  1063. if (
  1064. i != this.form.goodsList.length - 1 &&
  1065. this.form.goodsList[i].id === val
  1066. ) {
  1067. this.form.goodsList[this.form.goodsList.length - 1].id = "";
  1068. }
  1069. }
  1070. },
  1071. lookOrderInfo(row) {
  1072. //orderNo
  1073. this.isAdd = false;
  1074. getOrderInfo({ orderId: row.id }).then((res) => {
  1075. if (res.code === 200) {
  1076. this.$nextTick((some) => {
  1077. let orderInfo = res.data.studentPaymentOrder;
  1078. this.changeOrgin(parseInt(orderInfo.organId));
  1079. (this.form = {
  1080. routeOrganId: orderInfo.organId,
  1081. transNo: orderInfo.transNo,
  1082. userId: orderInfo.userId ? orderInfo.userId : "",
  1083. type: "OTHER",
  1084. merNo: orderInfo.merNos,
  1085. actualAmount: orderInfo.actualAmount,
  1086. memo: orderInfo.memo,
  1087. payTime: orderInfo.payTime,
  1088. serviceAmount: res.data.serviceAmount,
  1089. saleAmount: res.data.goodsAmount,
  1090. schoolId: parseInt(orderInfo.musicGroupId) || " ",
  1091. applyType: "SELL",
  1092. calenderId: res.data.calenderId ? res.data.calenderId : "",
  1093. }),
  1094. this.$set(
  1095. this.form,
  1096. "goodsList",
  1097. res.data.sellOrders.map((item) => {
  1098. return { id: item.goodsId, number: item.num };
  1099. })
  1100. );
  1101. this.routeOrderStatus = true;
  1102. });
  1103. }
  1104. });
  1105. },
  1106. removeOrderInfo(row) {
  1107. this.$confirm("确定删除?", "提示", {
  1108. confirmButtonText: "确定",
  1109. cancelButtonText: "取消",
  1110. type: "warning",
  1111. })
  1112. .then(() => {
  1113. orderDelete({ orderId: row.id }).then((res) => {
  1114. if (res.code === 200) {
  1115. this.$message.success("删除成功");
  1116. this.getList();
  1117. // this.routeOrderStatus = false;
  1118. }
  1119. });
  1120. })
  1121. .catch();
  1122. // orderDelete
  1123. },
  1124. onDownload() {
  1125. // 下载模板
  1126. // // 报表导出
  1127. Export(this, {
  1128. url: "/api-web/import/downloadTemplate",
  1129. params: {
  1130. templateType: "ROUTE_ORDER",
  1131. },
  1132. fileName: "财务管理导入模板.xlsx",
  1133. });
  1134. },
  1135. beforeUpload(file) {
  1136. // console.log(file.type)
  1137. // const isJPG = file.type === '.xlsx' || file.type === '.xls';
  1138. // // const isLt2M = file.size / 1024 / 1024 < 2;
  1139. // if (!isJPG) {
  1140. // this.$message.error('上传头像图片只能是 JPG 格式!');
  1141. // }
  1142. // return isJPG;
  1143. // this.goodsLoading = true
  1144. load.startLoading();
  1145. },
  1146. handleSuccess(response, file, fileList) {
  1147. // 导入商品
  1148. // 报表导出
  1149. load.endLoading();
  1150. if (response.code == 200) {
  1151. this.$message.success("导入成功");
  1152. // this.getList()
  1153. } else if (response.code == 0) {
  1154. let str = this.fomatStr(response.msg);
  1155. this.$alert(str, "导入结果", {
  1156. confirmButtonText: "确定",
  1157. dangerouslyUseHTMLString: true,
  1158. callback: (action) => {
  1159. // this.getList()
  1160. },
  1161. });
  1162. } else {
  1163. this.$message.error(response.msg);
  1164. }
  1165. },
  1166. handleError(err, file, fileList) {
  1167. load.endLoading();
  1168. console.log(err, file, fileList);
  1169. },
  1170. fomatStr(str) {
  1171. let arr = str.split(";");
  1172. let newStr = "";
  1173. arr.forEach((item) => {
  1174. newStr += `<p>${item}</p>`;
  1175. });
  1176. return newStr;
  1177. },
  1178. changeApplyType(val) {
  1179. if (val == "SELL" && !this.form.goodsList) {
  1180. this.form.goodsList = [
  1181. {
  1182. id: null,
  1183. number: null,
  1184. },
  1185. ];
  1186. }
  1187. this.form.serviceAmount = null;
  1188. this.form.saleAmount = null;
  1189. },
  1190. },
  1191. watch: {
  1192. routeOrderStatus(val) {
  1193. if (!val) {
  1194. this.form = {
  1195. routeOrganId: null,
  1196. transNo: null,
  1197. type: "OTHER",
  1198. merNo: null,
  1199. actualAmount: null,
  1200. memo: null,
  1201. payTime: null,
  1202. serviceAmount: null,
  1203. saleAmount: null,
  1204. schoolId: null,
  1205. goodsList: [
  1206. {
  1207. id: null,
  1208. number: null,
  1209. },
  1210. ],
  1211. applyType: null,
  1212. userId: "",
  1213. };
  1214. }
  1215. },
  1216. },
  1217. filters: {
  1218. filterShopId(val) {
  1219. let str = "";
  1220. that.shopList.forEach((shop) => {
  1221. if (shop.id == val) {
  1222. str = shop.name;
  1223. }
  1224. });
  1225. return str;
  1226. },
  1227. },
  1228. };
  1229. </script>
  1230. <style lang="scss" scoped>
  1231. .newBand {
  1232. display: inline-block;
  1233. }
  1234. /deep/.el-input-number.is-controls-right .el-input__inner {
  1235. text-align: left;
  1236. }
  1237. .setWidth {
  1238. display: inline-block;
  1239. }
  1240. .lookTitle {
  1241. height: 40px;
  1242. line-height: 40px;
  1243. font-weight: bold;
  1244. background-color: rgb(237, 238, 240);
  1245. padding: 0 20px;
  1246. margin-bottom: 20px;
  1247. }
  1248. .showShop {
  1249. height: 40px;
  1250. line-height: 40px;
  1251. width: 150px;
  1252. background-color: #f5f7fa;
  1253. border-color: #e4e7ed;
  1254. color: #c0c4cc;
  1255. cursor: not-allowed;
  1256. color: #333;
  1257. opacity: 1;
  1258. border-radius: 4px;
  1259. border: 1px solid #dcdfe6;
  1260. padding: 0 15px;
  1261. margin-right: 10px;
  1262. }
  1263. .shopListWrap {
  1264. display: flex;
  1265. flex-direction: row;
  1266. justify-content: flex-start;
  1267. }
  1268. </style>