index.vue 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675
  1. <template>
  2. <basic-container>
  3. <avue-crud :option="option" :table-loading="loading" :data="data" :page.sync="page" :search.sync="query"
  4. v-model="form" ref="crud" id="out-table" :header-cell-class-name="headerClassName"
  5. @selection-change="selectionChange" @search-change="searchChange" @search-reset="searchReset"
  6. @current-change="currentChange" @size-change="sizeChange" @refresh-change="refreshChange"
  7. @resetColumn="resetColumnTwo('crud', 'option', 'optionBack', 332)"
  8. @saveColumn="saveColumnTwo('crud', 'option', 'optionBack', 332)" @on-load="onLoad">
  9. <template slot="menuLeft">
  10. <el-button type="success" size="small" plain @click="exportfun">导出</el-button>
  11. <el-button type="primary" size="small" plain>打印报表</el-button>
  12. <el-button type="info" size="small" plain @click="designReportStart">设计报表</el-button>
  13. </template>
  14. <template slot="header">
  15. <el-table :data="commodityData" border size="small" @header-click="cellClick" style="width: 100%">
  16. <el-table-column v-for="(item, index) in commodityLabel" :key="index" :prop="item.prop"
  17. show-overflow-tooltip :label="item.label" />
  18. </el-table>
  19. </template>
  20. <template slot-scope="{disabled,size}" slot="dcSearch">
  21. <el-radio v-model="query.dc" label="D" @input="dcInput">应收</el-radio>
  22. <el-radio v-model="query.dc" label="C" @input="dcInput">应付</el-radio>
  23. </template>
  24. <template slot-scope="{disabled,size}" slot="typeSearch">
  25. <search-query :datalist="typeData" :selectValue="query.type" :buttonIf="false"
  26. @corpChange="corpChange($event, 'type')">
  27. </search-query>
  28. </template>
  29. <template slot-scope="{disabled,size}" slot="businessTypeSearch">
  30. <search-query :datalist="businessTypeData" :selectValue="query.businessType" :clearable="true"
  31. :buttonIf="false" :forParameter="{ key: 'dictKey', label: 'dictValue', value: 'dictKey' }"
  32. @corpFocus="businessTypeFocus" @corpChange="corpChange($event, 'businessType')">
  33. </search-query>
  34. </template>
  35. <template slot-scope="{disabled,size}" slot="clientIdSearch">
  36. <search-query :datalist="clientIdData" :selectValue="query.clientName" :filterable="true" :remote="true"
  37. :clearable="true" :disabled="query.type != 2" :buttonIf="false"
  38. :forParameter="{ key: 'id', label: 'cnName', value: 'cnName' }" @remoteMethod="clientIdListfun"
  39. @corpFocus="clientIdListfun" @corpChange="corpChange($event, 'clientName')">
  40. </search-query>
  41. </template>
  42. <template slot-scope="{disabled,size}" slot="corpIdSearch">
  43. <search-query :datalist="corpIdData" :selectValue="query.corpName" :disabled="query.type != 1"
  44. :filterable="true" :remote="true" :clearable="true" :buttonIf="false"
  45. :forParameter="{ key: 'id', label: 'cnName', value: 'cnName' }" @remoteMethod="getBcorpsListfun"
  46. @corpFocus="getBcorpsListfun" @corpChange="corpChange($event, 'corpName')">
  47. </search-query>
  48. </template>
  49. <template slot-scope="{disabled,size}" slot="srcTypeSearch">
  50. <search-query :datalist="srcTypeData" :selectValue="query.srcType" :disabled="query.type != 3"
  51. :clearable="true" :buttonIf="false"
  52. :forParameter="{ key: 'dictKey', label: 'dictValue', value: 'dictKey' }"
  53. @corpFocus="srcTypeWorkDictsfun" @corpChange="corpChange($event, 'srcType')">
  54. </search-query>
  55. </template>
  56. <template slot-scope="{disabled,size}" slot="srcIdSearch">
  57. <search-query :datalist="srcIdData" :selectValue="query.srcName" :disabled="query.type != 3"
  58. :filterable="true" :remote="true" :clearable="true" :buttonIf="false"
  59. :forParameter="srcforParameter" @remoteMethod="srcCorpFocus" @corpFocus="srcCorpFocus"
  60. @corpChange="corpChange($event, 'srcName')">
  61. </search-query>
  62. </template>
  63. <template slot-scope="{disabled,size}" slot="isBusinessDateSearch">
  64. <el-checkbox v-model="query.isBusinessDate" :true-label="1" :false-label="0"
  65. @change="dateChange('isBusinessDate')">按业务日期</el-checkbox>
  66. <el-checkbox v-model="query.isToExamineDate" :true-label="1" :false-label="0"
  67. @change="dateChange('isToExamineDate')">按审核日期</el-checkbox>
  68. </template>
  69. </avue-crud>
  70. <!--设计报表弹窗-->
  71. <el-dialog append-to-body title="设计报表" class="el-dialogDeep" :visible.sync="DesignreportDialog" width="70%"
  72. :close-on-click-modal="false" :destroy-on-close="true" :close-on-press-escape="false" v-dialog-drag>
  73. <reports :id="form.id" :assemblyForm="form" businessValue="JCFX" classifyCode="SFHZ"></reports>
  74. </el-dialog>
  75. </basic-container>
  76. </template>
  77. <script>
  78. import SearchQuery from "@/components/iosbasic-data/searchquery.vue";
  79. import { startDate, endDate } from "@/util/date";
  80. import { financeStatisticsFeeSummary, financeStatisticsFeeSummarySum } from "@/api/iosBasicData/paymentSummary"
  81. import { getBcorpsList, getBcorpslistByType } from "@/api/iosBasicData/bcorps";
  82. import { getWorkDicts } from "@/api/system/dictbiz";
  83. import { getDeptLazyTree } from "@/api/system/dept";
  84. import { getList as userGetList } from '@/api/system/user'
  85. import { getToken } from "@/util/auth";
  86. import reports from "@/views/iosBasicData/SeafreightExportF/bills/assembly/reports.vue";
  87. export default {
  88. components: { reports, SearchQuery },
  89. data() {
  90. return {
  91. DesignreportDialog: false, // 设计报表弹窗
  92. printingDialog: false, // 打印弹窗
  93. form: {},
  94. loading: true,
  95. page: {
  96. pageSize: 10,
  97. currentPage: 1,
  98. total: 0
  99. },
  100. query: {
  101. dc: 'D',
  102. isBusinessDate: 1,
  103. isToExamineDate: 0,
  104. type: '1',
  105. etdStart: startDate(),
  106. etdEnd: endDate(),
  107. },
  108. option: {},
  109. optionBack: {
  110. height: 'auto',
  111. calcHeight: 30,
  112. tip: false,
  113. searchShow: true,
  114. searchMenuSpan: 12,
  115. border: true,
  116. index: false,
  117. selection: true,
  118. dialogClickModal: false,
  119. menu: false,
  120. addBtn: false,
  121. viewBtn: false,
  122. delBtn: false,
  123. editBtn: false,
  124. searchIcon: true,
  125. searchIndex: 3,
  126. emptyBtnText: '清空所有条件',
  127. column: [
  128. {
  129. label: "所属公司",
  130. prop: "branchId",
  131. width: "120",
  132. overHidden: true,
  133. // hide: true,
  134. // showColumn: false,
  135. type: "select",
  136. filterable: true,
  137. dicUrl: "/api/blade-system/dept/lazy-list",
  138. props: {
  139. label: "deptName",
  140. value: "id",
  141. },
  142. search: false,
  143. },
  144. // {
  145. // label: "所属公司",
  146. // prop: "branchId",
  147. // width: "120",
  148. // overHidden: true,
  149. // },
  150. {
  151. label: "结算单位",
  152. prop: "corpName",
  153. overHidden: true,
  154. },
  155. {
  156. label: "查询方式",
  157. prop: "type",
  158. hide: true,
  159. search: true,
  160. type: 'select',
  161. searchslot: true,
  162. },
  163. {
  164. label: "业务类型",
  165. prop: "businessType",
  166. hide: true,
  167. search: true,
  168. searchslot: true,
  169. },
  170. {
  171. label: "统计开始",
  172. prop: "etdStart",
  173. search: true,
  174. overHidden: true,
  175. hide: true,
  176. type: "date",
  177. format: "yyyy-MM-dd",
  178. valueFormat: "yyyy-MM-dd",
  179. },
  180. {
  181. label: "统计结束",
  182. prop: "etdEnd",
  183. search: true,
  184. overHidden: true,
  185. hide: true,
  186. type: "date",
  187. format: "yyyy-MM-dd",
  188. valueFormat: "yyyy-MM-dd",
  189. },
  190. {
  191. label: "应收美金",
  192. prop: "amountUsd",
  193. overHidden: true,
  194. },
  195. {
  196. label: "应收人民币",
  197. prop: "amount",
  198. overHidden: true,
  199. },
  200. {
  201. label: "已收款美金",
  202. prop: "amountUsdAlready",
  203. overHidden: true,
  204. },
  205. {
  206. label: "已收款人民币",
  207. prop: "amountAlready",
  208. overHidden: true,
  209. },
  210. {
  211. label: "未收款美金",
  212. prop: "amountUsdNot",
  213. overHidden: true,
  214. },
  215. {
  216. label: "未收款人民币",
  217. prop: "amountNot",
  218. overHidden: true,
  219. },
  220. {
  221. label: "委托人",
  222. prop: "clientId",
  223. hide: true,
  224. search: true,
  225. searchslot: true,
  226. },
  227. {
  228. label: "结算单位",
  229. prop: "corpId",
  230. hide: true,
  231. search: true,
  232. searchslot: true,
  233. },
  234. {
  235. label: "业务来源",
  236. prop: "srcType",
  237. hide: true,
  238. search: true,
  239. searchslot: true,
  240. },
  241. {
  242. label: "业务员",
  243. prop: "srcId",
  244. hide: true,
  245. search: true,
  246. searchslot: true,
  247. },
  248. {
  249. label: "",
  250. prop: "dc",
  251. hide: true,
  252. search: true,
  253. searchslot: true,
  254. searchLabelWidth: '0'
  255. },
  256. {
  257. label: "",
  258. prop: "isBusinessDate",
  259. hide: true,
  260. search: true,
  261. searchslot: true,
  262. searchLabelWidth: '0'
  263. },
  264. {
  265. label: "",
  266. prop: "isToExamineDate",
  267. hide: true,
  268. searchLabelWidth: '0',
  269. },
  270. ]
  271. },
  272. data: [],
  273. // 查询方式
  274. typeData: [
  275. {
  276. label: '结算单位',
  277. value: '1'
  278. }, {
  279. label: '委托人',
  280. value: '2'
  281. }, {
  282. label: '业务来源',
  283. value: '3'
  284. }
  285. ],
  286. // 业务类型
  287. businessTypeData: [],
  288. clientIdData: [], // 委托人
  289. corpIdData: [], // 结算单位
  290. srcTypeData: [], // 业务来源
  291. srcIdData: [], // 业务员
  292. srcforParameter: { key: 'id', label: 'cnName', value: 'cnName' },
  293. selectionList: [], // 多选数据
  294. commodityData: [], // 合计数据
  295. // 合计的配置项
  296. commodityLabel: [
  297. {
  298. id: 1,
  299. label: '应收美元',
  300. prop: 'amountUsd'
  301. },
  302. {
  303. id: 2,
  304. label: '应收人民币',
  305. prop: 'amount'
  306. },
  307. {
  308. id: 3,
  309. label: "已收款美金",
  310. prop: "amountUsdAlready",
  311. },
  312. {
  313. id: 4,
  314. label: "已收款人民币",
  315. prop: "amountAlready",
  316. },
  317. {
  318. id: 5,
  319. label: "未收款美金",
  320. prop: "amountUsdNot",
  321. },
  322. {
  323. id: 6,
  324. label: "未收款人民币",
  325. prop: "amountNot",
  326. },
  327. ],
  328. saberUserInfo: {}
  329. }
  330. },
  331. async created() {
  332. this.saberUserInfo = JSON.parse(
  333. localStorage.getItem("saber-userInfo")
  334. ).content;
  335. this.option = await this.getColumnData(this.getColumnName(332), this.optionBack);
  336. this.query = {
  337. dc: 'D',
  338. isBusinessDate: 1,
  339. isToExamineDate: 0,
  340. type: '1',
  341. etdStart: startDate(),
  342. etdEnd: endDate(),
  343. }
  344. if (this.saberUserInfo.role_name.indexOf('admin') != -1 || this.saberUserInfo.role_name.indexOf('总部') != -1) {
  345. this.option.searchMenuSpan = 6
  346. this.option.column.forEach(item => {
  347. if (item.prop == 'branchId') {
  348. item.search = true
  349. }
  350. })
  351. }
  352. },
  353. methods: {
  354. // 设计报表
  355. designReportStart() {
  356. this.DesignreportDialog = true
  357. // this.selectionList
  358. if (this.selectionList.length == 0) {
  359. return this.$message.warning('请选择一条数据')
  360. } else {
  361. }
  362. },
  363. // 导出
  364. exportfun() {
  365. const routeData = this.$router.resolve({
  366. path: '/api/blade-los/financeStatistics/feeSummaryExport',//跳转目标窗口的地址
  367. query: {
  368. ...this.query
  369. }
  370. })
  371. window.open(routeData.href.slice(1, routeData.href.length) + '&' + `${this.website.tokenHeader}=${getToken()}`);
  372. },
  373. // 下拉监听
  374. corpChange(value, name) {
  375. if (name == 'type') {
  376. if (value == 1) {
  377. this.$set(this.query, 'clientId', null)
  378. this.$set(this.query, 'clientName', null)
  379. this.$set(this.query, 'srcType', null)
  380. this.$set(this.query, 'srcId', null)
  381. this.$set(this.query, 'srcName', null)
  382. this.findObject(this.option.column, "corpName").label = '结算单位'
  383. } else if (value == 2) {
  384. this.$set(this.query, 'corpId', null)
  385. this.$set(this.query, 'corpName', null)
  386. this.$set(this.query, 'srcType', null)
  387. this.$set(this.query, 'srcId', null)
  388. this.$set(this.query, 'srcName', null)
  389. this.findObject(this.option.column, "corpName").label = '委托人'
  390. } else if (value == 3) {
  391. this.$set(this.query, 'corpId', null)
  392. this.$set(this.query, 'corpName', null)
  393. this.$set(this.query, 'clientId', null)
  394. this.$set(this.query, 'clientName', null)
  395. this.findObject(this.option.column, "corpName").label = '业务来源'
  396. }
  397. this.$set(this.query, name, value)
  398. } else if (name == 'corpName') {
  399. for (let item of this.corpIdData) {
  400. if (item.cnName == value) {
  401. this.$set(this.query, 'corpId', item.id)
  402. this.$set(this.query, 'corpName', item.cnName)
  403. }
  404. }
  405. } else if (name == 'clientName') {
  406. for (let item of this.clientIdData) {
  407. if (item.cnName == value) {
  408. this.$set(this.query, 'clientId', item.id)
  409. this.$set(this.query, 'clientName', item.cnName)
  410. }
  411. }
  412. } else if (name == 'srcType') {
  413. if (value == 'OWN') {
  414. // 公司
  415. this.srcforParameter = { key: 'id', label: 'title', value: 'title' }
  416. this.findObject(this.option.column, "srcId").label = '公司'
  417. this.ownDeptLazyTreefun()
  418. } else if (value == 'AGENT') {
  419. // 代理
  420. this.srcforParameter = { key: 'id', label: 'cnName', value: 'cnName' }
  421. this.findObject(this.option.column, "srcId").label = '代理'
  422. this.agentBcorpsListfun()
  423. } else if (value == 'SALES') {
  424. // 业务员
  425. this.srcforParameter = { key: 'id', label: 'name', value: 'name' }
  426. this.findObject(this.option.column, "srcId").label = '业务员'
  427. this.salesUserGetListfun()
  428. } else { }
  429. this.$set(this.query, name, value)
  430. } else if (name == 'srcName') {
  431. for (let item of this.srcIdData) {
  432. if (item[this.srcforParameter.value] == value) {
  433. if (this.query.srcType == 'SALES') {
  434. // 业务员
  435. this.$set(this.query, 'srcId', item.id)
  436. this.$set(this.query, 'srcName', item.name)
  437. } else if (this.form.srcType == 'AGENT') {
  438. // 代理
  439. this.$set(this.query, 'srcId', item.id)
  440. this.$set(this.query, 'srcName', item.cnName)
  441. } else {
  442. this.$set(this.query, 'srcId', item.id)
  443. this.$set(this.query, 'srcName', item.title)
  444. }
  445. }
  446. }
  447. }
  448. this.$set(this.query, name, value)
  449. },
  450. // 业务员下拉
  451. srcCorpFocus(value, name) {
  452. if (this.query.srcType == 'SALES') {
  453. // 业务员
  454. this.srcforParameter = { key: 'id', label: 'name', value: 'name' }
  455. this.salesUserGetListfun(value)
  456. } else if (this.form.srcType == 'AGENT') {
  457. // 代理
  458. this.srcforParameter = { key: 'id', label: 'cnName', value: 'cnName' }
  459. this.agentBcorpsListfun(value)
  460. } else if (this.form.srcType == 'OWN') {
  461. // 公司
  462. this.srcforParameter = { key: 'id', label: 'title', value: 'title' }
  463. this.ownDeptLazyTreefun()
  464. } else { }
  465. },
  466. // 多选切换
  467. dateChange(name) {
  468. if (name == 'isBusinessDate') {
  469. this.$set(this.query, 'isToExamineDate', 0)
  470. this.$set(this.query, 'isBusinessDate', 1)
  471. }
  472. if (name == 'isToExamineDate') {
  473. this.$set(this.query, 'isBusinessDate', 0)
  474. this.$set(this.query, 'isToExamineDate', 1)
  475. }
  476. this.page.currentPage = 1;
  477. this.onLoad(this.page, this.query);
  478. },
  479. // 收付单选
  480. dcInput() {
  481. let dcName = ''
  482. if (this.query.dc == 'D') {
  483. dcName = '收'
  484. } else {
  485. dcName = '付'
  486. }
  487. this.findObject(this.option.column, "amountUsd").label = `应${dcName}美金`
  488. this.findObject(this.option.column, "amount").label = `应${dcName}人民币`
  489. this.findObject(this.option.column, "amountUsdAlready").label = `已${dcName}款美金`
  490. this.findObject(this.option.column, "amountAlready").label = `已${dcName}款人民币`
  491. this.findObject(this.option.column, "amountUsdNot").label = `未${dcName}款美金`
  492. this.findObject(this.option.column, "amountNot").label = `未${dcName}款人民币`
  493. this.findObject(this.commodityLabel, "amountUsd").label = `应${dcName}美金`
  494. this.findObject(this.commodityLabel, "amount").label = `应${dcName}人民币`
  495. this.findObject(this.commodityLabel, "amountUsdAlready").label = `已${dcName}款美金`
  496. this.findObject(this.commodityLabel, "amountAlready").label = `已${dcName}款人民币`
  497. this.findObject(this.commodityLabel, "amountUsdNot").label = `未${dcName}款美金`
  498. this.findObject(this.commodityLabel, "amountNot").label = `未${dcName}款人民币`
  499. this.page.currentPage = 1;
  500. this.onLoad(this.page, this.query);
  501. },
  502. // 接口获取数据
  503. // 结算单位
  504. getBcorpsListfun(cnName) {
  505. getBcorpsList(1, 10, { cnName, status: 0 }).then(res => {
  506. this.corpIdData = res.data.data.records
  507. })
  508. },
  509. // 业务类型
  510. businessTypeFocus() {
  511. getWorkDicts('profit_business_type_los').then(res => {
  512. this.businessTypeData = res.data.data
  513. })
  514. },
  515. // 委托人
  516. clientIdListfun(cnName) {
  517. getBcorpsList(1, 10, { cnName, status: 0 }).then(res => {
  518. this.clientIdData = res.data.data.records
  519. })
  520. },
  521. // 获取业务来源数据
  522. srcTypeWorkDictsfun() {
  523. getWorkDicts('src_type_los').then(res => {
  524. this.srcTypeData = res.data.data
  525. })
  526. },
  527. // 获取公司名称 用户管理左侧
  528. ownDeptLazyTreefun() {
  529. getDeptLazyTree(0).then(res => {
  530. this.srcIdData = res.data.data
  531. })
  532. },
  533. // 获取业务来源代理数据
  534. agentBcorpsListfun(cnName) {
  535. let corpTypeName = '国内直接客户,国内同行及代理,国外直接客户,国外同行及代理'
  536. getBcorpslistByType(1, 10, { cnName, status: 0, corpTypeName }).then(res => {
  537. this.srcIdData = res.data.data.records
  538. })
  539. },
  540. // 获取业务来源业务员数据
  541. salesUserGetListfun(account) {
  542. userGetList(1, 10, { account }).then(res => {
  543. this.srcIdData = res.data.data.records
  544. })
  545. },
  546. // 清空搜索回调方法
  547. searchReset() {
  548. this.query = {
  549. dc: 'D',
  550. isBusinessDate: 1,
  551. isToExamineDate: 0,
  552. type: '1',
  553. etdStart: null,
  554. etdEnd: null,
  555. };
  556. this.onLoad(this.page);
  557. },
  558. // 搜索
  559. searchChange(params, done) {
  560. this.page.currentPage = 1;
  561. this.onLoad(this.page, this.query);
  562. done();
  563. },
  564. currentChange(currentPage) {
  565. this.page.currentPage = currentPage;
  566. },
  567. sizeChange(pageSize) {
  568. this.page.pageSize = pageSize;
  569. },
  570. refreshChange() {
  571. this.onLoad(this.page, this.query);
  572. },
  573. // 多选弹窗
  574. selectionChange(list) {
  575. this.selectionList = list;
  576. },
  577. onLoad(page, params = {}) {
  578. this.loading = true;
  579. financeStatisticsFeeSummary(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
  580. const data = res.data.data;
  581. this.page.total = data.total;
  582. this.data = data.records;
  583. this.loading = false;
  584. financeStatisticsFeeSummarySum(Object.assign(params, this.query)).then(re => {
  585. this.commodityData = [re.data.data]
  586. this.$nextTick(() => {
  587. this.$refs.crud.doLayout();
  588. this.$refs.crud.dicInit();
  589. });
  590. })
  591. this.selectionClear();
  592. });
  593. },
  594. selectionClear() {
  595. this.$refs.crud.toggleSelection();
  596. },
  597. //自定义列保存
  598. async saveColumnTwo(ref, option, optionBack, code) {
  599. /**
  600. * 已定义全局方法,直接使用,saveColumnData保存列数据方法,参数传值(表格名称,当前表格的option数据)
  601. * 已定义全局方法,直接使用,getColumnName方法用来获取枚举值,参数根据自己定义的code值获取中文名
  602. * 一定要执行异步操作,要等接口成功返回,才能执行下一行代码
  603. */
  604. const inSave = await this.saveColumnData(this.getColumnName(code), this[option]);
  605. if (inSave) {
  606. this.$message.success("保存成功");
  607. //关闭窗口
  608. this.$refs[ref].$refs.dialogColumn.columnBox = false;
  609. }
  610. },
  611. //自定义列重置
  612. async resetColumnTwo(ref, option, optionBack, code) {
  613. this[option] = this[optionBack];
  614. const inSave = await this.delColumnData(this.getColumnName(code), this[optionBack]);
  615. if (this.saberUserInfo.role_name.indexOf('admin') != -1 || this.saberUserInfo.role_name.indexOf('总部') != -1) {
  616. this.option.searchMenuSpan = 6
  617. this.option.column.forEach(item => {
  618. if (item.prop == 'branchId') {
  619. item.search = true
  620. }
  621. })
  622. }
  623. if (inSave) {
  624. this.$message.success("重置成功");
  625. this.$refs[ref].$refs.dialogColumn.columnBox = false;
  626. this.query = {
  627. dc: 'D',
  628. isBusinessDate: 1,
  629. isToExamineDate: 0,
  630. type: '1',
  631. etdStart: startDate(),
  632. etdEnd: endDate(),
  633. }
  634. }
  635. },
  636. // 更改表格颜色
  637. headerClassName(tab) {
  638. //颜色间隔
  639. let back = ""
  640. if (tab.columnIndex >= 0 && tab.column.level === 1) {
  641. if (tab.columnIndex % 2 === 0) {
  642. back = "back-one"
  643. } else if (tab.columnIndex % 2 === 1) {
  644. back = "back-two"
  645. }
  646. }
  647. return back;
  648. },
  649. }
  650. }
  651. </script>
  652. <style scoped>
  653. ::v-deep#out-table .back-one {
  654. background: #ecf5ff !important;
  655. text-align: center;
  656. }
  657. ::v-deep#out-table .back-two {
  658. background: #ecf5ff !important;
  659. text-align: center;
  660. }
  661. ::v-deep .el-col-md-8 {
  662. width: 24.33333%;
  663. }
  664. </style>