index.vue 40 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431
  1. <template>
  2. <div id="businessLevel">
  3. <search-box-new
  4. ref="searchBox"
  5. :formData="formData"
  6. :formList="formList"
  7. @search="search"
  8. @init="init"
  9. >
  10. <template slot="slotSearch">
  11. <el-input
  12. placeholder="输入订单编号/业务员/业务号/所属客户"
  13. v-model="formData['keyword']"
  14. clearable
  15. style="width: 360px"
  16. >
  17. </el-input>
  18. </template>
  19. </search-box-new>
  20. <div id="tableList">
  21. <div class="headerNavTool">
  22. <div class="leftIndexText">
  23. {{ navText.title }}
  24. <strong>{{ navText.index }}</strong>
  25. {{ navText.ch }}
  26. <span style="color: #999; font-size: 14px; margin-left: 10px"
  27. ><i class="el-icon-warning-outline"></i>
  28. 点击数据,左右键盘可滑动数据表。</span
  29. >
  30. </div>
  31. <div class="rightBtnBox">
  32. <slot name="customize"></slot>
  33. <el-button
  34. type="primary"
  35. :loading="billPrintLoading"
  36. @click="handleBillPrint"
  37. >账单打印</el-button
  38. >
  39. <el-button type="primary" @click="openRecordUpdateDialog"
  40. >记录更新</el-button
  41. >
  42. <el-popover
  43. popper-class="slotPopper"
  44. placement="bottom-end"
  45. trigger="click"
  46. >
  47. <div class="popoverDis">
  48. <div class="checkboxHeader">
  49. <el-checkbox
  50. :indeterminate="isIndeterminate"
  51. v-model="checkAll"
  52. @change="handleCheckAllChange"
  53. >列展示</el-checkbox
  54. >
  55. <div class="initbtns" @click="initVue">重置</div>
  56. </div>
  57. <div
  58. style="height: 1px; width: 100%; background-color: #eaeefb"
  59. ></div>
  60. <el-checkbox-group
  61. class="checkboxGroup"
  62. v-model="checkedCities"
  63. @change="handleCheckedCitiesChange"
  64. >
  65. <div
  66. class="checkboxchild"
  67. v-for="(item, index) in cities"
  68. :key="index"
  69. >
  70. <el-checkbox
  71. :label="item"
  72. @change="checkboxChange(item, $event)"
  73. >{{ item }}</el-checkbox
  74. >
  75. <div class="icon-right">
  76. <i class="el-icon-upload2" @click="upMove(item, index)"></i>
  77. <i
  78. class="el-icon-download"
  79. @click="downMove(item, index)"
  80. ></i>
  81. </div>
  82. </div>
  83. </el-checkbox-group>
  84. </div>
  85. <el-button
  86. v-if="navText.custom !== false"
  87. style="margin-left: 10px"
  88. slot="reference"
  89. >自定义列</el-button
  90. >
  91. </el-popover>
  92. </div>
  93. </div>
  94. <el-table
  95. ref="tableRef"
  96. :row-key="(row) => row.orderSn"
  97. :data="tableData"
  98. show-summary
  99. :summary-method="getSummaries"
  100. style="width: 100%"
  101. :cell-style="timeStyle"
  102. v-loading="loading"
  103. :header-cell-style="{
  104. 'background-color': '#eee',
  105. color: '#333',
  106. fontSize: '14px',
  107. }"
  108. :tree-props="{ children: 'children', hasChildren: 'hasChildren' }"
  109. @expand-change="openContentShow"
  110. >
  111. <el-table-column type="expand">
  112. <template slot="header">
  113. <div
  114. class="headShow"
  115. :class="[headShow ? 'el-icon-minus' : 'el-icon-plus']"
  116. @click="openHeadShow"
  117. ></div>
  118. </template>
  119. <template slot-scope="scope">
  120. <div style="display: flex">
  121. <div style="width: 50px; background: #eeeeee"></div>
  122. <!-- 子列表 -->
  123. <el-table
  124. v-loading="scope.row.subLoading"
  125. :data="scope.row.subTableList"
  126. :header-cell-style="{
  127. 'background-color': '#eee',
  128. color: '#333',
  129. fontSize: '14px',
  130. }"
  131. >
  132. <af-table-column
  133. v-for="(subItem, subIndex) in subTableSet"
  134. :width="subItem.width"
  135. :label="subItem.label"
  136. :align="subItem.dontCenter ? 'left' : 'center'"
  137. header-align="center"
  138. :prop="subItem.prop"
  139. :key="subIndex"
  140. >
  141. <template slot-scope="subScope">
  142. <div v-if="subItem.edit">
  143. <div v-if="subScope.row.isEdit[subIndex]">
  144. <el-date-picker
  145. v-model="subScope.row[subItem.prop]"
  146. type="date"
  147. placeholder="请选择日期"
  148. value-format="timestamp"
  149. style="width: 99%"
  150. >
  151. </el-date-picker>
  152. </div>
  153. <div v-else style="padding: 8px">
  154. {{
  155. subScope.row[subItem.prop]
  156. ? $methodsTools.onlyForma(
  157. subScope.row[subItem.prop] / 1000,
  158. false
  159. )
  160. : "-"
  161. }}
  162. </div>
  163. <div style="margin-top: 2px">
  164. <div v-if="subScope.row.isEdit[subIndex]">
  165. <sapn
  166. class="inputBtn"
  167. @click="
  168. editNumber(
  169. subIndex,
  170. subScope.row,
  171. 'confirm',
  172. scope.row
  173. )
  174. "
  175. >确定</sapn
  176. >
  177. <sapn
  178. class="inputBtn"
  179. @click="
  180. editNumber(subIndex, subScope.row, 'cancel')
  181. "
  182. >取消</sapn
  183. >
  184. </div>
  185. <sapn
  186. v-else
  187. class="inputBtn editInputBtn"
  188. @click="editNumber(subIndex, subScope.row, 'edit')"
  189. >
  190. 修改
  191. </sapn>
  192. </div>
  193. </div>
  194. <div v-else-if="subItem.label === '性别'">
  195. {{
  196. subScope.row[subItem.prop] == 1
  197. ? "男"
  198. : subScope.row[subItem.prop] == 2
  199. ? "女"
  200. : "未知"
  201. }}
  202. </div>
  203. <div v-else-if="subItem.label === '状态'">
  204. <div>
  205. {{
  206. subScope.row[subItem.prop] == 2 ? "已退款" : "正常"
  207. }}
  208. </div>
  209. <!-- 状态为已退款显示 -->
  210. <div
  211. style="white-space: nowrap"
  212. v-if="
  213. subScope.row.refundStatus == 2 &&
  214. subScope.row.refundTime
  215. "
  216. >
  217. ({{
  218. $methodsTools.onlyForma(subScope.row.refundTime)
  219. }})
  220. </div>
  221. </div>
  222. <div v-else-if="subItem.label === '成交单价'">
  223. ¥{{ subScope.row[subItem.prop] }}
  224. </div>
  225. <div v-else>
  226. <div>
  227. {{
  228. subScope.row[subItem.prop] == undefined ||
  229. subScope.row[subItem.prop] == null
  230. ? "-"
  231. : subScope.row[subItem.prop]
  232. }}
  233. </div>
  234. <span
  235. v-if="subItem.label === '题库记录'"
  236. class="inputBtn editInputBtn"
  237. @click="openQuestionBankDialog(subScope.row)"
  238. >
  239. 更新
  240. </span>
  241. </div>
  242. </template>
  243. </af-table-column>
  244. <el-table-column style="width: 100%"> </el-table-column>
  245. </el-table>
  246. </div>
  247. <div style="margin: 0 0 15px 0">
  248. <pagination
  249. :total="scope.row.subTotal"
  250. :pageSize="scope.row.subPageSize"
  251. :currentPage="scope.row.subPageNum"
  252. @handleSizeChange="subHandleSizeChange($event, scope.row)"
  253. @handleCurrentChange="subHandleCurrentChange($event, scope.row)"
  254. />
  255. </div>
  256. </template>
  257. </el-table-column>
  258. <!-- 主列表 -->
  259. <el-table-column
  260. type="index"
  261. label="序号"
  262. width="70"
  263. align="center"
  264. header-align="center"
  265. >
  266. </el-table-column>
  267. <af-table-column
  268. v-for="(item, columnIndex) in compTableSet(tableSet)"
  269. :label="item.label"
  270. :align="item.dontCenter ? 'left' : 'center'"
  271. :prop="item.prop"
  272. :key="columnIndex"
  273. :width="item.inputType ? '160' : ''"
  274. style="white-space: nowrap"
  275. >
  276. <template slot-scope="scope">
  277. <div v-if="item.edit">
  278. <div v-if="scope.row.isEdit[columnIndex]">
  279. <!-- 月份编辑 -->
  280. <el-input
  281. v-if="
  282. item.inputType === 'number' && item.label.includes('月')
  283. "
  284. :type="item.inputType"
  285. placeholder="请输入"
  286. v-model="scope.row.proceedsJson[item.prop]"
  287. style="width: 99%"
  288. >
  289. <div slot="prefix" style="margin-top: 6px">¥</div>
  290. </el-input>
  291. <!-- 日期编辑 -->
  292. <el-date-picker
  293. v-else-if="item.inputType === 'date'"
  294. v-model="scope.row[item.prop]"
  295. :type="item.inputType"
  296. placeholder="请选择日期"
  297. value-format="timestamp"
  298. style="width: 99%"
  299. >
  300. </el-date-picker>
  301. <!-- 其他编辑 -->
  302. <el-input
  303. v-else
  304. :type="item.inputType"
  305. placeholder="请输入"
  306. v-model="scope.row[item.prop]"
  307. style="width: 99%"
  308. >
  309. <div
  310. v-if="item.label == '成本支付'"
  311. slot="prefix"
  312. style="margin-top: 6px"
  313. >
  314. </div>
  315. </el-input>
  316. </div>
  317. <div v-else style="padding: 8px">
  318. {{ getEditValueName(item, scope) }}
  319. </div>
  320. <div style="margin-top: 2px; white-space: nowrap">
  321. <div v-if="scope.row.isEdit[columnIndex]">
  322. <sapn
  323. class="inputBtn"
  324. @click="editNumber(columnIndex, scope.row, 'confirm', null)"
  325. >确定</sapn
  326. >
  327. <sapn
  328. class="inputBtn"
  329. @click="editNumber(columnIndex, scope.row, 'cancel')"
  330. >取消</sapn
  331. >
  332. </div>
  333. <sapn
  334. v-else
  335. class="inputBtn editInputBtn"
  336. @click="editNumber(columnIndex, scope.row, 'edit')"
  337. >
  338. 修改
  339. </sapn>
  340. </div>
  341. </div>
  342. <div v-else-if="item.label === '收款记录'">
  343. <sapn
  344. class="inputBtn"
  345. @click="openEarnRecordDialog(scope.row, 'check')"
  346. >
  347. 查看
  348. </sapn>
  349. <div>
  350. <sapn
  351. class="inputBtn editInputBtn"
  352. @click="openEarnRecordDialog(scope.row, 'edit')"
  353. >
  354. 修改
  355. </sapn>
  356. </div>
  357. </div>
  358. <div v-else>
  359. <template v-if="item.list">
  360. <div v-for="(content, i) in item.list" :key="i">
  361. <div>
  362. {{ content.name }} :
  363. {{
  364. item.label == "订单时间"
  365. ? $methodsTools.onlyForma(scope.row[content.key])
  366. : scope.row[content.key]
  367. }}
  368. </div>
  369. </div>
  370. </template>
  371. <div v-else>
  372. {{ getEditValueName(item, scope) }}
  373. </div>
  374. </div>
  375. </template>
  376. </af-table-column>
  377. </el-table>
  378. </div>
  379. <pagination
  380. :total="total"
  381. :pageSize="formData.pageSize"
  382. :currentPage="formData.pageNum"
  383. @handleSizeChange="handleSizeChange"
  384. @handleCurrentChange="handleCurrentChange"
  385. />
  386. <!-- 收款记录弹窗 -->
  387. <earnRecordDialog ref="earnRecordDialog" @refresh="search()" />
  388. <!-- 题库记录弹窗 -->
  389. <questionBankDialog ref="questionBankDialog" />
  390. <!-- 记录更新弹窗 -->
  391. <recordUpdateDialog ref="recordUpdateDialog" />
  392. </div>
  393. </template>
  394. <script>
  395. import searchBoxNew from "@/components/searchBoxNew";
  396. import pagination from "@/components/pagination";
  397. import earnRecordDialog from "./earnRecordDialog.vue";
  398. import questionBankDialog from "./questionBankDialog.vue";
  399. import recordUpdateDialog from "./recordUpdateDialog.vue";
  400. import * as baseUrls from "@/utils/request.js";
  401. import { exportFn } from "@/utils/index.js";
  402. export default {
  403. components: {
  404. searchBoxNew,
  405. pagination,
  406. earnRecordDialog,
  407. questionBankDialog,
  408. recordUpdateDialog,
  409. },
  410. data() {
  411. return {
  412. disabledBtn: false,
  413. headShow: false, // 展开全部行
  414. loading: false, //当前表单加载是否加载动画
  415. billPrintLoading: false, // 账单打印加载动画
  416. navText: {
  417. title: "2024年祥粤订单销售、收款、回证登记明细表",
  418. index: 0,
  419. ch: "条",
  420. custom: true,
  421. },
  422. //搜索
  423. formList: [
  424. {
  425. prop: "orderOrg",
  426. placeholder: "订单来源",
  427. scope: "select",
  428. noClear: false,
  429. options: [
  430. {
  431. label: "旧云学堂",
  432. value: "旧云学堂",
  433. },
  434. {
  435. label: "业务系统",
  436. value: "业务系统",
  437. },
  438. {
  439. label: "C端云学堂线下",
  440. value: "C端云学堂线下",
  441. },
  442. {
  443. label: "C端云学堂线上",
  444. value: "C端云学堂线上",
  445. },
  446. ],
  447. },
  448. {
  449. prop: "educationTypeId",
  450. placeholder: "教育类型",
  451. scope: "educationType",
  452. },
  453. {
  454. prop: "businessId",
  455. placeholder: "业务层次",
  456. scope: "businessLevel",
  457. edu: "educationTypeId",
  458. },
  459. {
  460. prop: "creditStatus",
  461. placeholder: "账款状态",
  462. scope: "select",
  463. noClear: false,
  464. options: [
  465. {
  466. label: "已结清",
  467. value: 1,
  468. },
  469. {
  470. label: "未结清",
  471. value: 0,
  472. },
  473. ],
  474. },
  475. {
  476. prop1: "startTime",
  477. prop2: "endTime",
  478. placeholder1: "申请时间开始",
  479. placeholder2: "申请时间结束",
  480. scope: "moreDataPicker",
  481. },
  482. {
  483. prop1: "checkStartTime",
  484. prop2: "checkEndTime",
  485. placeholder1: "通过时间开始",
  486. placeholder2: "通过时间结束",
  487. scope: "moreDataPicker",
  488. },
  489. {
  490. prop: "userName",
  491. placeholder: "输入学员姓名",
  492. },
  493. {
  494. prop: "userCard",
  495. placeholder: "输入身份证号",
  496. },
  497. {
  498. scope: "slot",
  499. slotName: "slotSearch",
  500. },
  501. ],
  502. formData: {
  503. pageSize: 10,
  504. pageNum: 1,
  505. },
  506. // 表单
  507. tableSet: [
  508. {
  509. label: "来源/编号",
  510. prop: "orderOrgAndorderSn",
  511. hidden: true,
  512. dontCenter: "left",
  513. list: [
  514. {
  515. name: "订单来源",
  516. key: "orderOrg",
  517. },
  518. {
  519. name: "订单编号",
  520. key: "orderSn",
  521. },
  522. ],
  523. },
  524. {
  525. label: "订单时间",
  526. prop: "orderTimeAndcheckTime",
  527. hidden: true,
  528. dontCenter: "left",
  529. list: [
  530. {
  531. name: "申请时间",
  532. key: "orderTime",
  533. },
  534. {
  535. name: "通过时间",
  536. key: "checkTime",
  537. },
  538. ],
  539. },
  540. {
  541. label: "业务信息",
  542. prop: "createUsernameAndcreateNo",
  543. hidden: true,
  544. dontCenter: "left",
  545. list: [
  546. {
  547. name: "业务员",
  548. key: "createUsername",
  549. },
  550. {
  551. name: "业务号",
  552. key: "createNo",
  553. },
  554. ],
  555. },
  556. {
  557. label: "订单所属",
  558. prop: "tenantNameAndpurchaseOrg",
  559. hidden: true,
  560. dontCenter: "left",
  561. list: [
  562. {
  563. name: "所属机构",
  564. key: "tenantName",
  565. },
  566. {
  567. name: "所属客户",
  568. key: "purchaseOrg",
  569. },
  570. ],
  571. },
  572. {
  573. label: "业务类型",
  574. prop: "businessAndType",
  575. hidden: true,
  576. dontCenter: "left",
  577. list: [
  578. {
  579. name: "业务简称",
  580. key: "businessAbbreviation",
  581. },
  582. {
  583. name: "教育类型",
  584. key: "eduName",
  585. },
  586. {
  587. name: "业务层次",
  588. key: "businessName",
  589. },
  590. ],
  591. },
  592. // {
  593. // label: "成交单价",
  594. // prop: "educationName",
  595. // hidden: true,
  596. // },
  597. {
  598. label: "成交数量",
  599. prop: "concludeNum",
  600. hidden: true,
  601. },
  602. {
  603. label: "成交总价",
  604. prop: "priceTotal",
  605. hidden: true,
  606. },
  607. {
  608. label: "1月",
  609. prop: "one",
  610. hidden: true,
  611. edit: true,
  612. inputType: "number",
  613. },
  614. {
  615. label: "2月",
  616. prop: "two",
  617. hidden: true,
  618. edit: true,
  619. inputType: "number",
  620. },
  621. {
  622. label: "3月",
  623. prop: "three",
  624. hidden: true,
  625. edit: true,
  626. inputType: "number",
  627. },
  628. {
  629. label: "4月",
  630. prop: "four",
  631. hidden: true,
  632. edit: true,
  633. inputType: "number",
  634. },
  635. {
  636. label: "5月",
  637. prop: "five",
  638. hidden: true,
  639. edit: true,
  640. inputType: "number",
  641. },
  642. {
  643. label: "6月",
  644. prop: "six",
  645. hidden: true,
  646. edit: true,
  647. inputType: "number",
  648. },
  649. {
  650. label: "7月",
  651. prop: "seven",
  652. hidden: true,
  653. edit: true,
  654. inputType: "number",
  655. },
  656. {
  657. label: "8月",
  658. prop: "eight",
  659. hidden: true,
  660. edit: true,
  661. inputType: "number",
  662. },
  663. {
  664. label: "9月",
  665. prop: "nine",
  666. hidden: true,
  667. edit: true,
  668. inputType: "number",
  669. },
  670. {
  671. label: "10月",
  672. prop: "ten",
  673. hidden: true,
  674. edit: true,
  675. inputType: "number",
  676. },
  677. {
  678. label: "11月",
  679. prop: "eleven",
  680. hidden: true,
  681. edit: true,
  682. inputType: "number",
  683. },
  684. {
  685. label: "12月",
  686. prop: "twelve",
  687. hidden: true,
  688. edit: true,
  689. inputType: "number",
  690. },
  691. {
  692. label: "12月以后",
  693. prop: "other",
  694. hidden: true,
  695. edit: true,
  696. inputType: "number",
  697. },
  698. {
  699. label: "已退金额",
  700. prop: "refunded",
  701. hidden: true,
  702. },
  703. {
  704. label: "实际账款",
  705. prop: "practical",
  706. hidden: true,
  707. },
  708. {
  709. label: "已收金额",
  710. prop: "received",
  711. hidden: true,
  712. },
  713. {
  714. label: "未收金额",
  715. prop: "uncollected",
  716. hidden: true,
  717. },
  718. {
  719. label: "收款记录",
  720. prop: "proceedsRecord",
  721. hidden: true,
  722. },
  723. {
  724. label: "发票申请日期",
  725. prop: "invoiceApplyTime",
  726. hidden: true,
  727. },
  728. {
  729. label: "发票类型",
  730. prop: "invoiceType",
  731. hidden: true,
  732. },
  733. {
  734. label: "积分",
  735. prop: "integral",
  736. hidden: true,
  737. edit: true,
  738. inputType: "number",
  739. },
  740. {
  741. label: "日期",
  742. prop: "proceedsDate",
  743. hidden: true,
  744. edit: true,
  745. inputType: "date",
  746. },
  747. {
  748. label: "收入核对日期",
  749. prop: "proceedsCheckDate",
  750. hidden: true,
  751. edit: true,
  752. inputType: "date",
  753. },
  754. {
  755. label: "变化",
  756. prop: "proceedsChange",
  757. hidden: true,
  758. edit: true,
  759. inputType: "text",
  760. },
  761. {
  762. label: "成本支付",
  763. prop: "cost",
  764. hidden: true,
  765. edit: true,
  766. inputType: "number",
  767. },
  768. ],
  769. // 子列表
  770. subTableSet: [
  771. {
  772. label: "姓名",
  773. prop: "userName",
  774. width: "100",
  775. },
  776. {
  777. label: "性别",
  778. prop: "sex",
  779. width: "100",
  780. },
  781. {
  782. label: "身份证号",
  783. prop: "userCard",
  784. width: "230",
  785. },
  786. {
  787. label: "商品名称",
  788. prop: "goodsName",
  789. width: "360",
  790. },
  791. {
  792. label: "年份",
  793. prop: "goodsYear",
  794. width: "100",
  795. },
  796. {
  797. label: "专业",
  798. prop: "majorName",
  799. width: "200",
  800. },
  801. {
  802. label: "成交单价",
  803. prop: "goodsPrice",
  804. width: "200",
  805. },
  806. {
  807. label: "完单日期",
  808. prop: "finishTime",
  809. edit: true,
  810. inputType: "date",
  811. width: "160",
  812. },
  813. {
  814. label: "回证/公示日期",
  815. prop: "publicityTime",
  816. edit: true,
  817. inputType: "date",
  818. width: "160",
  819. },
  820. {
  821. label: "领证日期",
  822. prop: "acquireTime",
  823. edit: true,
  824. inputType: "date",
  825. width: "160",
  826. },
  827. {
  828. label: "补考次数",
  829. prop: "applyNum",
  830. width: "100",
  831. },
  832. {
  833. label: "题库记录",
  834. prop: "questionRecord",
  835. width: "100",
  836. },
  837. {
  838. label: "状态",
  839. prop: "refundStatus",
  840. width: "200",
  841. },
  842. ],
  843. checkedCities: [], //自定义列 选中数组
  844. cities: [], //自定义列 总数组
  845. isIndeterminate: false, // 用于全选操作
  846. tableData: [], //表单数据
  847. total: 0, //一共多少条
  848. };
  849. },
  850. computed: {
  851. // 用于自定义列
  852. compTableSet: function () {
  853. return function (options) {
  854. var arrays = options.filter((item) => {
  855. return item.hidden;
  856. });
  857. return arrays;
  858. };
  859. },
  860. //可编辑区域的 显示的value值
  861. getEditValueName: function () {
  862. return function (item, scope) {
  863. let value = scope.row[item.prop];
  864. if (item.inputType === "date") {
  865. return this.$methodsTools.onlyForma(value / 1000, false) || "-";
  866. }
  867. if (
  868. (scope.row.proceedsJson &&
  869. scope.row.proceedsJson[item.prop] != undefined) ||
  870. scope.row.proceedsJson[item.prop] != null
  871. ) {
  872. return "¥" + scope.row.proceedsJson[item.prop] || "-";
  873. }
  874. if (["成交数量", "变化", "积分", "发票类型"].includes(item.label)) {
  875. return value == undefined || value == null ? "-" : value;
  876. }
  877. if (item.label == "发票申请日期" && value) {
  878. return this.$methodsTools.onlyForma(value, false) || "-";
  879. }
  880. return value == undefined || value == null ? "-" : "¥" + value;
  881. };
  882. },
  883. },
  884. created() {},
  885. mounted() {
  886. this.inittableSet = JSON.stringify(this.tableSet);
  887. this.initTR();
  888. this.search();
  889. },
  890. activated() {
  891. this.search();
  892. },
  893. methods: {
  894. editNumber(columnIndex, row, type, saveRow) {
  895. console.log(row);
  896. switch (type) {
  897. case "edit":
  898. this.$set(row.isEdit, columnIndex, true);
  899. break;
  900. case "cancel":
  901. this.$set(row.isEdit, columnIndex, false);
  902. break;
  903. case "confirm":
  904. this.$set(row.isEdit, columnIndex, false);
  905. this.handleListEdit(columnIndex, row, saveRow);
  906. break;
  907. default:
  908. break;
  909. }
  910. },
  911. //列表修改操作
  912. handleListEdit(columnIndex, row, saveRow) {
  913. const data = JSON.parse(JSON.stringify(row));
  914. let propName;
  915. //saveRow有值为子列表修改
  916. if (saveRow) {
  917. propName = this.subTableSet[columnIndex].prop;
  918. } else {
  919. propName = this.tableSet[columnIndex].prop;
  920. // 月份提交(为空时默认为0)
  921. Object.keys(data.proceedsJson).forEach((key) => {
  922. if (
  923. data.proceedsJson[key] == "" ||
  924. data.proceedsJson[key] == null ||
  925. data.proceedsJson[key] == undefined
  926. ) {
  927. data.proceedsJson[key] = 0;
  928. }
  929. });
  930. }
  931. data[propName] = row[propName];
  932. // 日期时间进行提交时需要(/1000)操作
  933. [
  934. "proceedsDate",
  935. "proceedsCheckDate",
  936. "finishTime",
  937. "publicityTime",
  938. "acquireTime",
  939. ].forEach((timeKey) => {
  940. data[timeKey] = this.$methodsTools.time10to13(row[timeKey], 1);
  941. });
  942. delete data.isEdit;
  943. delete data.subTableList;
  944. console.log(data, "------data-----");
  945. const _request = saveRow ? "editSubOrderDetail" : "editOrderDetail";
  946. this.$api[_request](data)
  947. .then((res) => {
  948. if (saveRow) {
  949. this.getSubTableList(saveRow);
  950. } else {
  951. this.search();
  952. }
  953. this.$message.success("操作成功");
  954. })
  955. .catch(() => {
  956. this.$message.error("操作失败");
  957. });
  958. },
  959. // 打开收款记录弹窗
  960. openEarnRecordDialog(row, type) {
  961. this.$refs.earnRecordDialog.openBoxs(row, type);
  962. },
  963. // 打开题库记录弹窗
  964. openQuestionBankDialog(row) {
  965. this.$refs.questionBankDialog.openBoxs(row);
  966. },
  967. // 打开更新记录弹窗
  968. openRecordUpdateDialog() {
  969. this.$refs.recordUpdateDialog.openBoxs();
  970. },
  971. // 账单打印
  972. handleBillPrint() {
  973. const data = JSON.parse(JSON.stringify(this.formData));
  974. ["startTime", "endTime", "checkStartTime", "checkEndTime"].forEach(
  975. (key) => {
  976. data[key] = data[key] ? data[key] / 1000 : "";
  977. }
  978. );
  979. delete data.pageNum;
  980. delete data.pageSize;
  981. this.billPrintLoading = true;
  982. this.$api
  983. .billPrint(data)
  984. .then((res) => {
  985. exportFn(res.msg, "账单明细");
  986. // this.$download.name(res.msg);
  987. this.$message.success("操作成功");
  988. })
  989. .finally(() => {
  990. this.billPrintLoading = false;
  991. });
  992. },
  993. // 头部全部展开/收起
  994. openHeadShow() {
  995. this.headShow = !this.headShow;
  996. this.tableData.forEach((item) => {
  997. this.$refs.tableRef.toggleRowExpansion(item, this.headShow);
  998. });
  999. },
  1000. // 点击展开
  1001. openContentShow(row, expandedRows) {
  1002. console.log(row.orderSn, "---点击展开row.id----");
  1003. console.log(expandedRows, "---expandedRows----");
  1004. const matchingItem = expandedRows.find(
  1005. (item) => item.orderSn === row.orderSn
  1006. );
  1007. if (matchingItem) {
  1008. this.getSubTableList(matchingItem);
  1009. }
  1010. },
  1011. // 获取子表格数据
  1012. getSubTableList(row) {
  1013. this.$set(row, "subLoading", true);
  1014. var data = {
  1015. pageSize: row.subPageSize,
  1016. pageNum: row.subPageNum,
  1017. orderSn: row.orderSn,
  1018. orderBase: row.orderBase,
  1019. orderFrom: row.orderFrom,
  1020. };
  1021. this.$api
  1022. .subOrderDetailList(data)
  1023. .then((res) => {
  1024. row.subTableList = res.rows;
  1025. row.subTableList.forEach((i) => {
  1026. i.finishTime = this.$methodsTools.time10to13(i.finishTime, 2);
  1027. i.publicityTime = this.$methodsTools.time10to13(i.publicityTime, 2);
  1028. i.acquireTime = this.$methodsTools.time10to13(i.acquireTime, 2);
  1029. this.$set(i, "isEdit", Array(this.subTableSet.length).fill(false));
  1030. });
  1031. row.subTotal = res.total;
  1032. })
  1033. .finally(() => {
  1034. this.$set(row, "subLoading", false);
  1035. });
  1036. },
  1037. search(v) {
  1038. this.loading = true;
  1039. if (v === 2) {
  1040. this.formData = {
  1041. pageSize: 10,
  1042. pageNum: 1,
  1043. };
  1044. }
  1045. var data = JSON.parse(JSON.stringify(this.formData));
  1046. this.$api
  1047. .orderDetailList(data)
  1048. .then((res) => {
  1049. this.tableData = res.rows;
  1050. this.tableData.forEach((item) => {
  1051. // 子列表分页参数
  1052. item.subTotal = 0;
  1053. item.subPageNum = 1;
  1054. item.subPageSize = 10;
  1055. item.proceedsDate = this.$methodsTools.time10to13(
  1056. item.proceedsDate,
  1057. 2
  1058. );
  1059. item.proceedsCheckDate = this.$methodsTools.time10to13(
  1060. item.proceedsCheckDate,
  1061. 2
  1062. );
  1063. this.$set(item, "isEdit", Array(this.tableSet.length).fill(false));
  1064. this.$set(item, "subTableList", []);
  1065. this.$set(item, "proceedsJson", item.proceedsJsonMap || {});
  1066. this.$nextTick(() => {
  1067. this.$refs.tableRef.toggleRowExpansion(item, false);
  1068. });
  1069. });
  1070. this.total = res.total;
  1071. this.navText.index = res.total;
  1072. })
  1073. .finally(() => {
  1074. this.loading = false;
  1075. });
  1076. },
  1077. init() {
  1078. this.search(2);
  1079. this.headShow = false;
  1080. },
  1081. // 合计
  1082. getSummaries(param) {
  1083. const { columns, data } = param;
  1084. const sums = [];
  1085. columns.forEach((column, index) => {
  1086. if (index === 1) {
  1087. sums[index] = "合计";
  1088. return;
  1089. }
  1090. // 以下不进行合计
  1091. const noSummariesList = [
  1092. "发票申请日期",
  1093. "日期",
  1094. "收入核对日期",
  1095. "变化",
  1096. "收款记录",
  1097. "发票类型",
  1098. ];
  1099. const values = data
  1100. .filter((item) => !noSummariesList.includes(column.label)) //过滤不进行合计的列
  1101. .map((item) => {
  1102. if (
  1103. !isNaN(Number(item[column.property])) ||
  1104. (column.label &&
  1105. column.label.includes("月") &&
  1106. item.proceedsJson[column.property])
  1107. ) {
  1108. return Number(
  1109. column.label.includes("月")
  1110. ? item.proceedsJson[column.property]
  1111. : item[column.property]
  1112. );
  1113. }
  1114. return NaN; // 如果不是数字,返回NaN以便在reduce中排除
  1115. });
  1116. // console.log(values, "---values-----");
  1117. if (!values.every((value) => isNaN(value))) {
  1118. sums[index] = values.reduce((prev, curr) => {
  1119. const value = Number(curr);
  1120. if (!isNaN(value)) {
  1121. return prev + curr;
  1122. } else {
  1123. return prev;
  1124. }
  1125. }, 0);
  1126. sums[index] =
  1127. column.property === "integral" || column.property === "concludeNum"
  1128. ? sums[index].toFixed(0)
  1129. : "¥" + sums[index].toFixed(2);
  1130. } else {
  1131. sums[index] = " ";
  1132. }
  1133. });
  1134. return sums;
  1135. },
  1136. //初始化
  1137. initTR() {
  1138. this.cities = [];
  1139. this.checkedCities = [];
  1140. this.checkAll = true;
  1141. this.isIndeterminate = false;
  1142. this.tableSet.forEach((item, index) => {
  1143. this.cities.push(item.label);
  1144. if (item.hidden) {
  1145. this.checkedCities.push(item.label);
  1146. }
  1147. });
  1148. this.tableSet = [];
  1149. this.$nextTick(() => {
  1150. this.tableSet = JSON.parse(this.inittableSet);
  1151. });
  1152. if (this.checkedCities.length === 0) {
  1153. this.isIndeterminate = false;
  1154. } else if (this.checkedCities.length === this.cities.length) {
  1155. this.isIndeterminate = false;
  1156. this.checkAll = true;
  1157. } else {
  1158. this.isIndeterminate = true;
  1159. this.checkAll = false;
  1160. }
  1161. },
  1162. //自定义列全选按钮触发
  1163. handleCheckAllChange(val) {
  1164. this.checkedCities = val ? this.cities : [];
  1165. this.isIndeterminate = false;
  1166. if (val) {
  1167. this.tableSet = [];
  1168. this.$nextTick(() => {
  1169. this.tableSet = JSON.parse(this.inittableSet);
  1170. });
  1171. } else {
  1172. this.tableSet.forEach((item, index) => {
  1173. item.hidden = false;
  1174. });
  1175. }
  1176. },
  1177. // 勾选自定义列子选项
  1178. handleCheckedCitiesChange(value) {
  1179. var copyTable = JSON.parse(JSON.stringify(this.tableSet));
  1180. let checkedCount = value.length;
  1181. this.checkAll = checkedCount === this.cities.length;
  1182. this.isIndeterminate =
  1183. checkedCount > 0 && checkedCount < this.cities.length;
  1184. this.tableSet = [];
  1185. this.$nextTick(() => {
  1186. this.tableSet = copyTable;
  1187. });
  1188. },
  1189. checkboxChange(v, e) {
  1190. var copyTable = JSON.parse(JSON.stringify(this.tableSet));
  1191. copyTable.forEach((item) => {
  1192. if (item.label === v) {
  1193. item.hidden = e;
  1194. }
  1195. });
  1196. this.tableSet = [];
  1197. this.$nextTick(() => {
  1198. this.tableSet = copyTable;
  1199. });
  1200. },
  1201. //自定义列重置
  1202. initVue() {
  1203. // this.$emit("initTableset");
  1204. this.tableSet = JSON.parse(this.inittableSet);
  1205. this.initTR();
  1206. },
  1207. // 下移
  1208. downMove(option, index) {
  1209. if (index !== this.tableSet.length - 1) {
  1210. this.tableSet[index] = this.tableSet.splice(
  1211. index + 1,
  1212. 1,
  1213. this.tableSet[index]
  1214. )[0];
  1215. this.cities[index] = this.cities.splice(
  1216. index + 1,
  1217. 1,
  1218. this.cities[index]
  1219. )[0];
  1220. } else {
  1221. this.tableSet.unshift(this.tableSet.splice(index, 1)[0]);
  1222. this.cities.unshift(this.cities.splice(index, 1)[0]);
  1223. }
  1224. var copyTable = JSON.parse(JSON.stringify(this.tableSet));
  1225. this.tableSet = [];
  1226. this.$nextTick(() => {
  1227. this.tableSet = copyTable;
  1228. });
  1229. },
  1230. // 上移
  1231. upMove(option, index) {
  1232. if (index != 0) {
  1233. this.tableSet[index] = this.tableSet.splice(
  1234. index - 1,
  1235. 1,
  1236. this.tableSet[index]
  1237. )[0];
  1238. this.cities[index] = this.cities.splice(
  1239. index - 1,
  1240. 1,
  1241. this.cities[index]
  1242. )[0];
  1243. } else {
  1244. this.tableSet.push(this.tableSet.shift());
  1245. this.cities.push(this.cities.shift());
  1246. }
  1247. var copyTable = JSON.parse(JSON.stringify(this.tableSet));
  1248. this.tableSet = [];
  1249. this.$nextTick(() => {
  1250. this.tableSet = copyTable;
  1251. });
  1252. },
  1253. close() {
  1254. this.dialogVisible = false;
  1255. },
  1256. handleSizeChange(v) {
  1257. this.formData.pageSize = v;
  1258. this.formData.pageNum = 1;
  1259. this.search();
  1260. },
  1261. handleCurrentChange(v) {
  1262. this.formData.pageNum = v;
  1263. this.search();
  1264. },
  1265. subHandleSizeChange(e, row) {
  1266. row.subPageSize = e;
  1267. row.subPageNum = 1;
  1268. this.getSubTableList(row);
  1269. },
  1270. subHandleCurrentChange(e, row) {
  1271. row.subPageNum = e;
  1272. this.getSubTableList(row);
  1273. },
  1274. },
  1275. };
  1276. </script>
  1277. <style lang="less" scoped>
  1278. .slotPopper {
  1279. padding: 0px !important;
  1280. }
  1281. #tableList {
  1282. padding: 16px 16px 16px;
  1283. border-radius: 8px;
  1284. box-shadow: 0 0 9px 1px rgba(28, 41, 90, 0.1);
  1285. background: #ffffff;
  1286. .headerNavTool {
  1287. height: 72px;
  1288. display: flex;
  1289. justify-content: space-between;
  1290. align-items: center;
  1291. margin-top: -16px;
  1292. .rightBtnBox {
  1293. display: flex;
  1294. align-items: center;
  1295. }
  1296. }
  1297. // 去除input增减箭头
  1298. /deep/ input::-webkit-inner-spin-button {
  1299. -webkit-appearance: none !important;
  1300. }
  1301. /deep/ input.el-input__inner {
  1302. text-align: center;
  1303. }
  1304. /deep/ .el-table {
  1305. display: flex;
  1306. flex-direction: column;
  1307. }
  1308. // order默认值为0,只需将表体order置为1即可移到最后,这样合计行就上移到表体上方
  1309. /deep/ .el-table__body-wrapper {
  1310. order: 1;
  1311. }
  1312. .inputBtn {
  1313. margin: 5px 0;
  1314. border: 1px solid #1890ff;
  1315. // background: #f1eff8;
  1316. color: #1890ff;
  1317. border-radius: 10px;
  1318. padding: 0 5px;
  1319. cursor: pointer;
  1320. margin: 5px 5px 0;
  1321. font-size: 12px !important;
  1322. white-space: nowrap;
  1323. &:hover {
  1324. background: #1890ff;
  1325. color: white;
  1326. border: 1px solid #1890ff;
  1327. }
  1328. }
  1329. .editInputBtn {
  1330. background: white;
  1331. border: 1px solid #aaaaaa;
  1332. color: #aaaaaa;
  1333. }
  1334. /deep/ .el-table__expand-icon {
  1335. -webkit-transform: rotate(0deg);
  1336. transform: rotate(0deg);
  1337. }
  1338. /deep/ .el-table__expand-icon .el-icon-arrow-right:before {
  1339. content: "\e6d9";
  1340. border: 1px solid #8b8a8a;
  1341. border-radius: 15px;
  1342. }
  1343. /deep/.el-table__expand-icon--expanded .el-icon-arrow-right:before {
  1344. content: "\e6d8";
  1345. }
  1346. .headShow {
  1347. border: 1px solid #8b8a8a;
  1348. border-radius: 15px;
  1349. cursor: pointer;
  1350. color: #8b8a8a;
  1351. }
  1352. }
  1353. /deep/ td.el-table__cell.el-table__expanded-cell {
  1354. padding: 0;
  1355. }
  1356. /deep/.el-button {
  1357. border-radius: 8px;
  1358. }
  1359. .popoverDis {
  1360. display: flex;
  1361. flex-direction: column;
  1362. align-items: flex-start;
  1363. font-size: 14px;
  1364. padding: 10px 0;
  1365. overflow-y: auto;
  1366. height: 450px;
  1367. width: 180px;
  1368. .checkboxHeader {
  1369. height: 40px;
  1370. display: flex;
  1371. align-items: center;
  1372. justify-content: space-between;
  1373. padding-left: 13px;
  1374. padding-right: 15px;
  1375. width: 100%;
  1376. .initbtns {
  1377. color: #47a6ff;
  1378. cursor: pointer;
  1379. }
  1380. }
  1381. .checkboxGroup {
  1382. display: flex;
  1383. flex-direction: column;
  1384. width: 100%;
  1385. .checkboxchild {
  1386. width: 100%;
  1387. justify-content: space-between;
  1388. height: 40px;
  1389. display: flex;
  1390. align-items: center;
  1391. padding: 0px 15px 0px 13px;
  1392. transition: all 0.4s;
  1393. &:hover {
  1394. background-color: #ecf5ff;
  1395. }
  1396. &:hover .icon-right {
  1397. display: flex;
  1398. }
  1399. .icon-right {
  1400. display: flex;
  1401. align-items: center;
  1402. width: 30px;
  1403. height: 30px;
  1404. color: #666;
  1405. font-size: 14px;
  1406. display: none;
  1407. i {
  1408. cursor: pointer;
  1409. margin: 0px 3px;
  1410. &:hover {
  1411. color: #47a6ff;
  1412. }
  1413. }
  1414. }
  1415. }
  1416. }
  1417. }
  1418. </style>