index.vue 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848
  1. <template>
  2. <div>
  3. <basic-container v-show="show" class="page-crad">
  4. <el-row>
  5. <el-col :span="4">
  6. <avue-tree
  7. ref="tree"
  8. :option="treeOption"
  9. :data="treeData"
  10. @node-click="nodeClick"
  11. style="height: 73vh"
  12. @save="corpTypeVisible = true"
  13. >
  14. <template slot="addBtn">
  15. <el-tooltip class="item" effect="dark" content="新建分类" placement="top">
  16. <i
  17. class="el-icon-setting"
  18. style="font-size: 18px; line-height: 30px; width: 20px; padding: 0 10px"
  19. @click="corpTypeVisible = true"
  20. ></i>
  21. </el-tooltip>
  22. </template>
  23. </avue-tree>
  24. </el-col>
  25. <el-col :span="20">
  26. <avue-crud
  27. ref="crud"
  28. :option="option"
  29. :data="dataList"
  30. :page.sync="page"
  31. :search.sync="search"
  32. @search-change="searchChange"
  33. @search-reset="searchReset"
  34. @current-change="currentChange"
  35. @size-change="sizeChange"
  36. @refresh-change="refreshChange"
  37. @on-load="onLoad"
  38. :table-loading="loading"
  39. :cell-style="cellStyle"
  40. @search-criteria-switch="searchCriteriaSwitch"
  41. >
  42. <template slot="menuLeft">
  43. <el-button type="primary" size="mini" icon="el-icon-plus" @click.stop="newAdd()">新建客户 </el-button>
  44. <!-- <el-button type="primary" size="mini" icon="el-icon-bottom" @click="excelBox = true">导入 </el-button>
  45. <el-button type="primary" size="mini" icon="el-icon-top" @click="outExport">导出 </el-button>
  46. <el-button type="primary" size="mini" icon="el-icon-download" @click="brandBox = true">
  47. Excel更新品牌
  48. </el-button> -->
  49. </template>
  50. <template slot="enableOrNot" slot-scope="{ row, index, disabled }">
  51. <div v-if="row.enableOrNot === 1">启用</div>
  52. <div v-else style="color: red">禁用</div>
  53. </template>
  54. <template slot-scope="{ row, index }" slot="cname">
  55. <span style="color: #409eff; cursor: pointer" @click.stop="editOpen(row, 2)">{{ row.cname }}</span>
  56. </template>
  57. <template slot="dateSearch">
  58. <el-date-picker
  59. v-model="search.date"
  60. type="daterange"
  61. start-placeholder="开始日期"
  62. end-placeholder="结束日期"
  63. format="yyyy-MM-dd"
  64. value-format="yyyy-MM-dd HH:mm:ss"
  65. :default-time="['00:00:00', '23:59:59']"
  66. :picker-options="pickerOptions"
  67. >
  68. </el-date-picker>
  69. </template>
  70. <template slot-scope="{ type, size, row, index }" slot="menu">
  71. <!-- <el-button
  72. v-if="row.checkStatus == '提交' || row.checkStatus == '驳回'"
  73. :size="size"
  74. :type="type"
  75. @click.stop="passThrough(row, '通过')"
  76. >通过
  77. </el-button>
  78. <el-button
  79. v-if="row.checkStatus == '提交' || row.checkStatus == '通过'"
  80. :size="size"
  81. :type="type"
  82. @click.stop="passThrough(row, '驳回')"
  83. >驳回
  84. </el-button> -->
  85. <el-button :size="size" :type="type" :disabled="row.enableOrNot == 1" @click.stop="rowDel(row)"
  86. >删除
  87. </el-button>
  88. </template>
  89. </avue-crud>
  90. </el-col>
  91. </el-row>
  92. </basic-container>
  93. <details-page v-if="!show" @goBack="goBack()" :detailData="detailData" />
  94. <el-dialog
  95. title="设置门店分类"
  96. v-dialogDrag
  97. :visible.sync="corpTypeVisible"
  98. class="avue-dialog"
  99. width="80%"
  100. append-to-body
  101. @closed="corpTypeClosed"
  102. >
  103. <span>
  104. <corp-type></corp-type>
  105. </span>
  106. <div class="avue-dialog__footer">
  107. <el-button @click="corpTypeVisible = false" size="mini">取 消</el-button>
  108. <el-button @click="addCorpType" type="primary" size="mini">确 定</el-button>
  109. </div>
  110. </el-dialog>
  111. <el-dialog
  112. title="导入客户"
  113. append-to-body
  114. :visible.sync="excelBox"
  115. width="555px"
  116. :close-on-click-modal="false"
  117. v-dialog-drag
  118. >
  119. <avue-form
  120. :option="excelOption"
  121. v-model="excelForm"
  122. table-loading="excelLoading"
  123. :upload-before="uploadBefore"
  124. :upload-after="uploadAfter"
  125. >
  126. <template slot="excelTemplate">
  127. <el-button type="primary" @click="derivation">
  128. 点击下载<i class="el-icon-download el-icon--right"></i>
  129. </el-button>
  130. </template>
  131. </avue-form>
  132. <p style="text-align: center; color: #dc0505">温馨提示 第一次导入时请先下载模板</p>
  133. </el-dialog>
  134. <!--更新品牌按钮-->
  135. <el-dialog
  136. title="更新品牌"
  137. append-to-body
  138. :visible.sync="brandBox"
  139. width="555px"
  140. :close-on-click-modal="false"
  141. v-dialog-drag
  142. >
  143. <avue-form
  144. :option="brandExcel"
  145. v-model="brandExcelForm"
  146. table-loading="excelLoading"
  147. :upload-before="uploadBefore"
  148. :upload-after="brandAfter"
  149. >
  150. <template slot="brandTemplate">
  151. <el-button type="primary" @click="brandDerive">
  152. 点击下载<i class="el-icon-download el-icon--right"></i>
  153. </el-button>
  154. </template>
  155. </avue-form>
  156. <p style="text-align: center; color: #dc0505">温馨提示 第一次导入时请先下载模板</p>
  157. </el-dialog>
  158. </div>
  159. </template>
  160. <script>
  161. // @ts-nocheck
  162. import detailsPage from "./detailsPage.vue";
  163. import { getList, getCorpType, remove, customerList, submit } from "@/api/store/customerInformation";
  164. import corpType from "./components/index.vue";
  165. import { getToken } from "@/util/auth";
  166. export default {
  167. name: "index",
  168. data() {
  169. return {
  170. corpTypeVisible: false,
  171. excelForm: {},
  172. brandExcelForm: {},
  173. WarehouseNameList: [],
  174. excelOption: {
  175. submitBtn: false,
  176. emptyBtn: false,
  177. column: [
  178. {
  179. label: "模板下载",
  180. prop: "excelTemplate",
  181. formslot: true,
  182. span: 24,
  183. },
  184. {
  185. label: "导入客户",
  186. prop: "excelFile",
  187. type: "upload",
  188. drag: true,
  189. loadText: "客户上传中,请稍等",
  190. accept: ".xls,.xlsx",
  191. span: 24,
  192. propsHttp: {
  193. res: "data",
  194. },
  195. tip: "请上传 .xls,.xlsx 标准格式文件",
  196. action: "/api/gubersail-admin/corpsDesc/corpsImport",
  197. },
  198. ],
  199. },
  200. brandExcel: {
  201. submitBtn: false,
  202. emptyBtn: false,
  203. column: [
  204. {
  205. label: "模版下载",
  206. prop: "brandTemplate",
  207. formslot: true,
  208. span: 24,
  209. },
  210. {
  211. label: "导入品牌",
  212. prop: "brandFile",
  213. type: "upload",
  214. drag: true,
  215. loadText: "品牌上传中,请稍等",
  216. accept: ".xls,.xlsx",
  217. span: 24,
  218. propsHttp: {
  219. res: "data",
  220. },
  221. tip: "请上传 .xls,.xlsx 标准格式文件",
  222. action: "/api/gubersail-admin/corpsDesc/importBrand",
  223. },
  224. ],
  225. },
  226. src: "",
  227. show: true,
  228. excelBox: false,
  229. brandBox: false,
  230. loading: false,
  231. search: {},
  232. detailData: {},
  233. dataList: [],
  234. selectionList: [],
  235. page: {
  236. pageSize: 20,
  237. currentPage: 1,
  238. total: 0,
  239. pageSizes: [10, 20, 30, 40, 50, 100, 200, 300, 400, 500],
  240. },
  241. form: {
  242. debitAmount: 0,
  243. deliveringAmount: 0,
  244. advancePayment: 0,
  245. balanceAmount: 0,
  246. settlmentAmount: 0,
  247. },
  248. formSerach: {},
  249. pickerOptions: {
  250. shortcuts: [
  251. {
  252. text: "当天",
  253. onClick(picker) {
  254. const date = new Date();
  255. const start = new Date(date.getFullYear(), date.getMonth(), date.getDate(), 0, 0, 0);
  256. const end = new Date(date.getFullYear(), date.getMonth(), date.getDate(), 23, 59, 59);
  257. picker.$emit("pick", [start, end]);
  258. },
  259. },
  260. {
  261. text: "昨天",
  262. onClick(picker) {
  263. const date = new Date();
  264. const start = new Date(date.getFullYear(), date.getMonth(), date.getDate() - 1, 0, 0, 0);
  265. const end = new Date(date.getFullYear(), date.getMonth(), date.getDate() - 1, 23, 59, 59);
  266. picker.$emit("pick", [start, end]);
  267. },
  268. },
  269. {
  270. text: "当月",
  271. onClick(picker) {
  272. const date = new Date();
  273. const start = new Date(date.getFullYear(), date.getMonth(), 1, 0, 0, 0);
  274. const end = new Date(date.getFullYear(), date.getMonth() + 1, 0, 23, 59, 59);
  275. picker.$emit("pick", [start, end]);
  276. },
  277. },
  278. {
  279. text: "当季",
  280. onClick(picker) {
  281. const date = new Date();
  282. const start = new Date(date.getFullYear(), parseInt(date.getMonth() / 3) * 3, 1, 0, 0, 0);
  283. const end = new Date(date.getFullYear(), parseInt(date.getMonth() / 3) * 3 + 3, 0, 23, 59, 59);
  284. picker.$emit("pick", [start, end]);
  285. },
  286. },
  287. {
  288. text: "当年",
  289. onClick(picker) {
  290. const date = new Date();
  291. const start = new Date(date.getFullYear(), date.getMonth(), 1, 0, 0, 0);
  292. const end = new Date(date.getFullYear() + 1, 0, 0, 23, 59, 59);
  293. picker.$emit("pick", [start, end]);
  294. },
  295. },
  296. {
  297. text: "最近一周",
  298. onClick(picker) {
  299. const date = new Date();
  300. const start = new Date(date.getFullYear(), date.getMonth(), date.getDate() - 7, 0, 0, 0);
  301. const end = new Date(date.getFullYear(), date.getMonth(), date.getDate(), 23, 59, 59);
  302. picker.$emit("pick", [start, end]);
  303. },
  304. },
  305. {
  306. text: "最近二周",
  307. onClick(picker) {
  308. const date = new Date();
  309. const start = new Date(date.getFullYear(), date.getMonth(), date.getDate() - 7 * 2, 0, 0, 0);
  310. const end = new Date(date.getFullYear(), date.getMonth(), date.getDate(), 23, 59, 59);
  311. picker.$emit("pick", [start, end]);
  312. },
  313. },
  314. {
  315. text: "最近三周",
  316. onClick(picker) {
  317. const date = new Date();
  318. const start = new Date(date.getFullYear(), date.getMonth(), date.getDate() - 7 * 3, 0, 0, 0);
  319. const end = new Date(date.getFullYear(), date.getMonth(), date.getDate(), 23, 59, 59);
  320. picker.$emit("pick", [start, end]);
  321. },
  322. },
  323. ],
  324. },
  325. treeOption: {
  326. addBtn: false,
  327. menu: false,
  328. size: "small",
  329. props: {
  330. labelText: "标题",
  331. label: "title",
  332. value: "value",
  333. },
  334. },
  335. treeData: [],
  336. form4: {},
  337. option4: {
  338. menuBtn: false,
  339. labelWidth: 80,
  340. column: [
  341. {
  342. label: "分类名称",
  343. prop: "cname",
  344. rules: [
  345. {
  346. required: true,
  347. message: "",
  348. trigger: "blur",
  349. },
  350. ],
  351. span: 24,
  352. },
  353. {
  354. label: "上级类型",
  355. prop: "parentId",
  356. dicUrl: "/api/gubersail-admin/corpstype/page?corpType=KH",
  357. type: "tree",
  358. props: {
  359. label: "cname",
  360. value: "id",
  361. res: "data.records",
  362. },
  363. span: 24,
  364. },
  365. ],
  366. },
  367. hostUrl: "",
  368. option: {
  369. searchShow: true,
  370. searchMenuSpan: 16,
  371. align: "center",
  372. height: "auto",
  373. searchSpan: 8,
  374. tip: false,
  375. border: true,
  376. index: true,
  377. indexFixed: false,
  378. selectionFixed: false,
  379. expandFixed: false,
  380. addBtn: false,
  381. viewBtn: false,
  382. editBtn: false,
  383. delBtn: false,
  384. menuWidth: 150,
  385. searchIcon: true,
  386. searchIndex: 2,
  387. columnBtn: false,
  388. column: [
  389. {
  390. label: "店铺名称",
  391. prop: "cname",
  392. overHidden: true,
  393. width: 140,
  394. search: true,
  395. },
  396. {
  397. label: "电话",
  398. prop: "tel",
  399. overHidden: true,
  400. search: true,
  401. },
  402. {
  403. label: "商城价格",
  404. prop: "priceSystem",
  405. overHidden: true,
  406. },
  407. {
  408. label: "店面分类",
  409. prop: "corpsTypeName",
  410. overHidden: true,
  411. },
  412. {
  413. label: "业务员",
  414. prop: "salesmanName",
  415. overHidden: true,
  416. type: "select",
  417. props: {
  418. label: "name",
  419. value: "name",
  420. },
  421. dicUrl: "/api/blade-user/salerList",
  422. filterable: true,
  423. search: true,
  424. },
  425. {
  426. label: "是否启用",
  427. prop: "enableOrNot",
  428. overHidden: true,
  429. search: true,
  430. showColumn: false,
  431. type: "select",
  432. dicData: [
  433. {
  434. label: "启用",
  435. value: 1,
  436. },
  437. {
  438. label: "禁用",
  439. value: 0,
  440. },
  441. ],
  442. },
  443. {
  444. label: "审核状态",
  445. prop: "checkStatus",
  446. overHidden: true,
  447. // hide: true,
  448. search: true,
  449. // showColumn: false,
  450. type: "select",
  451. dicData: [
  452. {
  453. label: "录入",
  454. value: "录入",
  455. },
  456. {
  457. label: "提交",
  458. value: "提交",
  459. },
  460. {
  461. label: "审核通过",
  462. value: "审核通过",
  463. },
  464. {
  465. label: "审核驳回",
  466. value: "审核驳回",
  467. },
  468. ],
  469. },
  470. {
  471. label: "品牌",
  472. prop: "brandName",
  473. overHidden: true,
  474. type: "select",
  475. dicUrl: "/api/gubersail-admin/brandDesc/list?type=PP&current=1&size=20&cname={{key}}",
  476. props: {
  477. label: "cname",
  478. value: "cname",
  479. res: "data.records",
  480. },
  481. filterable: true,
  482. remote: true,
  483. search: true,
  484. },
  485. {
  486. label: "创建人",
  487. prop: "createUser",
  488. overHidden: true,
  489. type: "select",
  490. props: {
  491. label: "name",
  492. value: "id",
  493. },
  494. dicUrl: "/api/blade-user/userListAll",
  495. width: 100,
  496. },
  497. {
  498. label: "创建时间",
  499. prop: "createTime",
  500. overHidden: true,
  501. search: true,
  502. searchProp: "createTimeList",
  503. type: "date",
  504. unlinkPanels: true,
  505. searchRange: true,
  506. format: "yyyy-MM-dd",
  507. valueFormat: "yyyy-MM-dd HH:mm:ss",
  508. width: 100,
  509. searchDefaultTime: ["00:00:00", "23:59:59"],
  510. },
  511. {
  512. label: "合同金额",
  513. prop: "debitAmount",
  514. overHidden: true,
  515. hide: true,
  516. showColumn: false,
  517. },
  518. {
  519. label: "已送货",
  520. prop: "deliveringAmount",
  521. overHidden: true,
  522. hide: true,
  523. showColumn: false,
  524. },
  525. {
  526. label: "预收款",
  527. prop: "advancePayment",
  528. overHidden: true,
  529. hide: true,
  530. showColumn: false,
  531. },
  532. {
  533. label: "未收款",
  534. prop: "balanceAmount",
  535. overHidden: true,
  536. hide: true,
  537. showColumn: false,
  538. },
  539. {
  540. label: "已收款",
  541. prop: "settlmentAmount",
  542. overHidden: true,
  543. hide: true,
  544. showColumn: false,
  545. },
  546. {
  547. label: "状态",
  548. prop: "status",
  549. type: "select",
  550. props: {
  551. label: "dictValue",
  552. value: "dictKey",
  553. },
  554. dicUrl: "/api/blade-system/dict-biz/dictionary?code=client_status",
  555. hide: true,
  556. showColumn: false,
  557. overHidden: true,
  558. },
  559. {
  560. label: "日期",
  561. prop: "date",
  562. hide: true,
  563. showColumn: false,
  564. overHidden: true,
  565. },
  566. ],
  567. },
  568. roleName: null,
  569. };
  570. },
  571. components: {
  572. detailsPage,
  573. corpType,
  574. },
  575. activated() {
  576. setTimeout(() => {
  577. this.$nextTick(() => {
  578. this.$refs.crud.doLayout();
  579. this.$refs.crud.refreshTable();
  580. });
  581. }, 100);
  582. },
  583. async created() {
  584. this.roleName = localStorage.getItem("roleName");
  585. this.getAllWorkDicts();
  586. },
  587. mounted() {
  588. // 页面尺寸改变,重新渲染avue表格,避免表格错位
  589. window.addEventListener("resize", () => {
  590. if (Math.abs(this.screenWidth - document.body.clientWidth) > 20) {
  591. this.$nextTick(() => {
  592. this.$refs.crud.refreshTable();
  593. });
  594. }
  595. this.screenWidth = document.body.clientWidth;
  596. });
  597. },
  598. methods: {
  599. // 导入客户
  600. derivation() {
  601. window.open(`/api/gubersail-admin/corpsDesc/corpsExport?${this.website.tokenHeader}=${getToken()}`);
  602. },
  603. // 导入品牌
  604. brandDerive() {
  605. window.open(`/api/gubersail-admin/corpsDesc/corpsExportBrand?${this.website.tokenHeader}=${getToken()}`);
  606. },
  607. //导出
  608. outExport() {
  609. let config = { params: { ...this.search } };
  610. if (config.params) {
  611. for (const [propName, value] of Object.entries(config.params)) {
  612. if (value instanceof Array) {
  613. value.forEach((item, index) => {
  614. config.params[`${propName}[${index}]`] = item;
  615. });
  616. delete config.params[propName];
  617. }
  618. }
  619. }
  620. const routeData = this.$router.resolve({
  621. path: "/api/gubersail-admin/corpsDesc/pjCorpsExport", //跳转目标窗口的地址
  622. query: {
  623. ...config.params, //括号内是要传递给新窗口的参数
  624. identification: this.url,
  625. },
  626. });
  627. window.open(routeData.href.slice(1, routeData.href.length) + "&" + `${this.website.tokenHeader}=${getToken()}`);
  628. },
  629. uploadBefore(file, done, loading) {
  630. done();
  631. loading = true;
  632. },
  633. // 客户导入后回显
  634. uploadAfter(res, done, loading, column) {
  635. this.excelBox = false;
  636. let myError = res.toString(); //转字符串
  637. myError = myError.replace("Error: ", ""); // 去掉前面的" Error: "
  638. this.$message.success(myError);
  639. this.refreshChange();
  640. loading = false;
  641. done();
  642. },
  643. // 品牌更新后回显
  644. brandAfter(res, done, loading, column) {
  645. this.brandBox = false;
  646. console.log(res, "res");
  647. let myError = res.toString(); //转字符串
  648. myError = myError.replace("Error: ", ""); // 去掉前面的" Error: "
  649. this.$message.success(myError);
  650. this.refreshChange();
  651. loading = false;
  652. done();
  653. },
  654. filterNode(value, data) {
  655. console.log(value, data);
  656. if (!value) return true;
  657. return data.label.indexOf(value) !== -1;
  658. },
  659. nodeClick(data) {
  660. this.search.corpsTypeId = data.value;
  661. this.page.currentPage = 1;
  662. this.onLoad(this.page, this.search);
  663. },
  664. getAllWorkDicts() {
  665. getCorpType({ corpType: "KH" }).then((res) => {
  666. this.treeData = res.data.data;
  667. });
  668. customerList({ corpType: "KH" }).then((res) => {
  669. this.findObject(this.option4.column, "parentId").dicData = res.data.data.records;
  670. });
  671. // this.$refs.crud.init();
  672. },
  673. searchCriteriaSwitch(type) {
  674. this.$refs.crud.getTableHeight();
  675. },
  676. cellStyle() {
  677. return "padding:0;height:40px;";
  678. },
  679. //点击搜索按钮触发
  680. searchChange(params, done) {
  681. this.page.currentPage = 1;
  682. this.onLoad(this.page, params);
  683. done();
  684. },
  685. searchReset() {
  686. this.$refs.tree.setCurrentKey(null);
  687. this.search = this.$options.data().search;
  688. this.onLoad(this.page);
  689. },
  690. refreshChange() {
  691. this.onLoad(this.page, this.search);
  692. },
  693. newAdd() {
  694. this.show = false;
  695. },
  696. onLoad(page, params = {}) {
  697. console.log("page", page);
  698. // this.$refs.crud.refreshTable()
  699. console.log("params", params);
  700. console.log("this.search", this.search);
  701. let data = this.deepClone(Object.assign(params, this.search));
  702. if (data.date && data.date.length > 0) {
  703. data.startTime = data.date[0];
  704. data.endTime = data.date[1];
  705. }
  706. delete data.date;
  707. data.corpType = "KH";
  708. this.loading = true;
  709. getList({
  710. current: page.currentPage,
  711. size: page.pageSize,
  712. // ...page.pageSize,
  713. ...data,
  714. })
  715. .then((res) => {
  716. this.dataList = res.data.data.records ? res.data.data.records : [];
  717. this.page.total = res.data.data.total;
  718. })
  719. .finally(() => {
  720. // pageStatistics(data).then(res => {
  721. // this.form = res.data.data
  722. // })
  723. this.loading = false;
  724. });
  725. },
  726. addCorpType() {
  727. this.getAllWorkDicts();
  728. this.corpTypeVisible = false;
  729. },
  730. corpTypeClosed() {
  731. // this.reload = Math.random();
  732. // this.form4 = this.$options.data().form4
  733. },
  734. editOpen(row, status) {
  735. this.showInfo = true;
  736. this.detailData = {
  737. id: row.id,
  738. status: status,
  739. };
  740. this.show = false;
  741. },
  742. currentChange(val) {
  743. this.page.currentPage = val;
  744. },
  745. sizeChange(val) {
  746. this.page.currentPage = 1;
  747. this.page.pageSize = val;
  748. },
  749. // 通过驳回方法
  750. passThrough(row, type) {
  751. this.$confirm(`确定${type}数据?`, {
  752. confirmButtonText: "确定",
  753. cancelButtonText: "取消",
  754. type: "warning",
  755. }).then(() => {
  756. row.checkStatus = type;
  757. submit(row).then((res) => {
  758. this.$message({
  759. type: "success",
  760. message: `${type}成功!`,
  761. });
  762. this.onLoad(this.page, this.search);
  763. });
  764. });
  765. },
  766. rowDel(row, index, done) {
  767. this.$confirm("确定删除数据?", {
  768. confirmButtonText: "确定",
  769. cancelButtonText: "取消",
  770. type: "warning",
  771. }).then(() => {
  772. remove({ id: row.id, corpType: "KH" }).then((res) => {
  773. if (res.data.code == 200) {
  774. this.$message({
  775. type: "success",
  776. message: "删除成功!",
  777. });
  778. this.onLoad(this.page, this.search);
  779. }
  780. });
  781. });
  782. },
  783. //返回列表
  784. goBack() {
  785. this.detailData = this.$options.data().detailData;
  786. this.show = true;
  787. this.showInfo = true;
  788. this.onLoad(this.page, this.search);
  789. this.$nextTick(() => {
  790. this.$refs.crud.doLayout();
  791. this.$refs.crud.refreshTable();
  792. });
  793. },
  794. },
  795. };
  796. </script>
  797. <style lang="scss" scoped>
  798. // .page-crad ::v-deep .basic-container__card {
  799. // height: 94.2vh;
  800. // }
  801. ::v-deep .el-form-item__error {
  802. display: none !important;
  803. }
  804. ::v-deep .el-input-group__append {
  805. padding: 0 0px !important;
  806. }
  807. .el-dialog ::v-deep .el-form-item__error {
  808. display: none !important;
  809. }
  810. .stat-td {
  811. text-align: center;
  812. position: relative;
  813. }
  814. .stat-img {
  815. width: 95%;
  816. height: 100px;
  817. }
  818. .stat-tip {
  819. position: absolute;
  820. left: 15px;
  821. top: 5px;
  822. .money {
  823. color: #fff;
  824. font-size: 28px;
  825. text-align: left;
  826. font-weight: 600;
  827. }
  828. .title {
  829. color: #fff;
  830. font-size: 14px;
  831. text-align: left;
  832. margin-top: 5px;
  833. margin-bottom: 0px;
  834. }
  835. }
  836. </style>