index.vue 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330
  1. <template>
  2. <div>
  3. <basic-container class="page-crad">
  4. <avue-crud ref="crud" :option="option" :data="dataList" :page.sync="page" :search.sync="search"
  5. :cell-style="cellStyle" @search-change="searchChange" @current-change="currentChange"
  6. @size-change="sizeChange"
  7. @row-save="handleRowSave"
  8. @row-update="handleRowUpdate"
  9. @refresh-change="refreshChange" @on-load="onLoad" :table-loading="loading" @saveColumn="saveColumn"
  10. @resetColumn="resetColumn" @search-criteria-switch="searchCriteriaSwitch">
  11. <template slot="menuLeft">
  12. <el-button icon="el-icon-plus" size="small" type="primary" v-if="dataList.length === 0" @click.stop="$refs.crud.rowAdd">新 增
  13. </el-button>
  14. <!-- <el-button type="info" size="small" @click="outExport">导出-->
  15. <!-- </el-button>-->
  16. </template>
  17. </avue-crud>
  18. </basic-container>
  19. </div>
  20. </template>
  21. <script>
  22. import {getToken} from "@/util/auth";
  23. import {getList,submit} from "@/api/paymentManagement/parameterConfiguration"
  24. export default {
  25. name: "index",
  26. data() {
  27. return {
  28. UConfiguration: {
  29. multipleChoices: false,
  30. multiple: false,
  31. disabled: false,
  32. searchShow: true,
  33. collapseTags: false,
  34. placeholder: '请点击右边按钮选择',
  35. dicData: []
  36. },
  37. form: {},
  38. search: {},
  39. dataList: [],
  40. loading: false,
  41. detailData: {},
  42. page: {
  43. pageSize: 20,
  44. currentPage: 1,
  45. total: 0,
  46. pageSizes: [20, 30, 40, 50, 100, 200, 300, 400, 500]
  47. },
  48. option: {},
  49. optionBack: {
  50. align: 'center',
  51. searchShow: true,
  52. searchMenuPosition: "right",
  53. searchSpan: 8,
  54. searchMenuSpan: 8,
  55. border: true,
  56. index: true,
  57. addBtn: false,
  58. viewBtn: false,
  59. editBtn: true,
  60. delBtn: false,
  61. searchIcon: true,
  62. menu: true,
  63. menuWidth: 80,
  64. dialogWidth: "90%",
  65. summaryText: "合计",
  66. showSummary: true,
  67. span: 8,
  68. sumColumnList: [{
  69. name: "amount",
  70. type: "sum",
  71. decimals: 2
  72. }],
  73. column: [{
  74. label: "集团/代理商商户号",
  75. prop: "orgid",
  76. width: 140,
  77. labelWidth: 140,
  78. overHidden: true
  79. }, {
  80. label: "商户号",
  81. prop: "cusId",
  82. width: 80,
  83. overHidden: true
  84. }, {
  85. label: "平台分配的APPID",
  86. prop: "appId",
  87. width: 140,
  88. labelWidth: 140,
  89. overHidden: true
  90. }, {
  91. label: "商户号",
  92. prop: "mchId",
  93. width: 80,
  94. overHidden: true
  95. }, {
  96. label: "通联支付appid",
  97. prop: "sybAppId",
  98. labelWidth: 120,
  99. width: 120,
  100. overHidden: true
  101. }, {
  102. label: "交易类型",
  103. prop: "payType",
  104. width: 100,
  105. overHidden: true
  106. }, {
  107. label: "支付签名key",
  108. prop: "paySignKey",
  109. width: 100,
  110. overHidden: true
  111. }, {
  112. label: "有效时间",
  113. prop: "validtime",
  114. width: 100,
  115. overHidden: true
  116. }, {
  117. label: "支付回调地址",
  118. prop: "notifyUrl",
  119. width: 100,
  120. overHidden: true
  121. }, {
  122. label: "微信子appid",
  123. prop: "subAppid",
  124. width: 100,
  125. labelWidth: 110,
  126. overHidden: true,
  127. rules: [
  128. {
  129. required: true,
  130. message: " ",
  131. trigger: "blur"
  132. }
  133. ]
  134. }, {
  135. label: "小程序appSecret",
  136. prop: "appSecret",
  137. width: 120,
  138. labelWidth: 120,
  139. overHidden: true
  140. }, {
  141. label: "渠道门店编号",
  142. prop: "chnlstoreId",
  143. width: 120,
  144. labelWidth: 120,
  145. overHidden: true
  146. }, {
  147. label: "门店号",
  148. prop: "subbranch",
  149. width: 80,
  150. overHidden: true
  151. }, {
  152. label: "支付完成跳转",
  153. prop: "frontUrl",
  154. width: 100,
  155. overHidden: true
  156. }, {
  157. label: "终端ip",
  158. prop: "cusIp",
  159. width: 90,
  160. overHidden: true
  161. }, {
  162. label: "MD5交易密钥",
  163. prop: "sybMdAppkey",
  164. width: 100,
  165. labelWidth: 110,
  166. overHidden: true
  167. }, {
  168. label: "RSA公钥",
  169. prop: "sybRsacusprikey",
  170. width: 100,
  171. overHidden: true
  172. }, {
  173. label: "RSA2公钥",
  174. prop: "sybRsatlpubkey",
  175. width: 100,
  176. overHidden: true
  177. }, {
  178. label: "商户sm2私钥",
  179. prop: "sybSmpprivatekey",
  180. width: 100,
  181. overHidden: true
  182. }, {
  183. label: "通联平台sm2公钥",
  184. prop: "sybSmtlpubkey",
  185. width: 150,
  186. labelWidth: 120,
  187. overHidden: true
  188. }, {
  189. label: "备注",
  190. prop: "remarks",
  191. width: 200,
  192. span: 24,
  193. type: 'textarea',
  194. overHidden: true,
  195. minRows: 3
  196. }]
  197. }
  198. };
  199. },
  200. async created() {
  201. this.option = await this.getColumnData(this.getColumnName(260), this.optionBack);
  202. },
  203. methods: {
  204. handleRowSave(row, done, loading) {
  205. //新增
  206. done(row)
  207. this.addModify(row)
  208. },
  209. handleRowUpdate(row, index, done, loading) {
  210. //编辑
  211. done(row)
  212. this.addModify(row)
  213. },
  214. addModify(row){
  215. submit(row).then(res=>{
  216. if (row.id){
  217. this.$message.success("修改成功")
  218. }else {
  219. this.$message.success("新增成功")
  220. }
  221. this.onLoad(this.page);
  222. })
  223. },
  224. cellStyle() {
  225. return "padding:0;height:40px;";
  226. },
  227. searchCriteriaSwitch(type) {
  228. if (type) {
  229. this.option.height = this.option.height - 46;
  230. } else {
  231. this.option.height = this.option.height + 46;
  232. }
  233. this.$refs.crud.getTableHeight();
  234. },
  235. //点击搜索按钮触发
  236. searchChange(params, done) {
  237. this.page.currentPage = 1;
  238. this.onLoad(this.page, params);
  239. done();
  240. },
  241. refreshChange() {
  242. this.onLoad(this.page, this.search);
  243. },
  244. currentChange(val) {
  245. this.page.currentPage = val;
  246. },
  247. sizeChange(val) {
  248. this.page.currentPage = 1;
  249. this.page.pageSize = val;
  250. },
  251. onLoad(page, params = {}) {
  252. let data = this.deepClone(Object.assign({}, params, this.search));
  253. this.loading = true;
  254. getList(
  255. page.currentPage,
  256. page.pageSize,
  257. Object.assign(data)
  258. ).then(res => {
  259. this.dataList = res.data.data.records ? res.data.data.records : [];
  260. this.page.total = res.data.data.total;
  261. if (this.page.total) {
  262. this.option.height = window.innerHeight - 210;
  263. }
  264. }).finally(() => {
  265. this.loading = false;
  266. });
  267. },
  268. //列保存触发
  269. async saveColumn() {
  270. const inSave = await this.saveColumnData(this.getColumnName(260), this.option);
  271. if (inSave) {
  272. this.$message.success("保存成功");
  273. //关闭窗口
  274. this.$refs.crud.$refs.dialogColumn.columnBox = false;
  275. }
  276. },
  277. async resetColumn() {
  278. this.option = this.optionBack;
  279. const inSave = await this.delColumnData(this.getColumnName(260), this.optionBack);
  280. if (inSave) {
  281. this.$message.success("重置成功");
  282. this.$refs.crud.$refs.dialogColumn.columnBox = false;
  283. }
  284. },
  285. editOpen(row) {
  286. },
  287. outExport() {
  288. let config = {params: {...this.search}}
  289. if (config.params) {
  290. for (const propName of Object.keys(config.params)) {
  291. const value = config.params[propName];
  292. if (value !== null && typeof (value) !== "undefined") {
  293. if (value instanceof Array) {
  294. for (const key of Object.keys(value)) {
  295. let params = propName + '[' + key + ']';
  296. config.params[params] = value[key]
  297. }
  298. delete config.params[propName]
  299. }
  300. }
  301. }
  302. }
  303. const routeData = this.$router.resolve({
  304. path: '/api/blade-box-tube/annualItem/annualBudgetProfitExcel', //跳转目标窗口的地址
  305. query: {
  306. ...config.params //括号内是要传递给新窗口的参数
  307. }
  308. })
  309. window.open(routeData.href.slice(1, routeData.href.length) + '&' + `${this.website.tokenHeader}=${getToken()}`);
  310. }
  311. }
  312. }
  313. ;
  314. </script>
  315. <style scoped>
  316. .page-crad ::v-deep .basic-container__card {
  317. height: 94.2vh;
  318. }
  319. ::v-deep .el-table__expanded-cell[class*="cell"] {
  320. padding: 0px;
  321. }
  322. .itemTable ::v-deep .el-table {
  323. width: 100%;
  324. }
  325. </style>