financeManager-taoqi.vue 48 KB

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