From a949aeafb29ec7d354b8c2eb1aea20ab8a17235e Mon Sep 17 00:00:00 2001 From: zhangds Date: Fri, 22 Mar 2024 17:01:59 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=A2=9E=E5=8A=A0=E9=82=AE=E6=94=BF?= =?UTF-8?q?=E7=BB=91=E5=AE=9A=E5=8F=B7=20=E9=99=90=E5=88=B6=E7=BB=91?= =?UTF-8?q?=E5=AE=9A=E5=AF=B9=E8=B1=A1=E7=BB=91=E5=AE=9A=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/assets/api.js | 10 +++++ src/pages/exchangecode/add/add.js | 1 + src/pages/plan/add/step2.js | 2 +- src/pages/plan/key/UseKeyAddEdit.jsx | 1 + src/pages/plan/key/edit.js | 1 + src/pages/plan/list/list.js | 58 ++++++++++++++++++++++++++-- 6 files changed, 69 insertions(+), 4 deletions(-) diff --git a/src/assets/api.js b/src/assets/api.js index 466e395c..11d3d23b 100644 --- a/src/assets/api.js +++ b/src/assets/api.js @@ -1050,4 +1050,14 @@ export const getApiMode = () => { return req("get", baseurl + "/reseller/merchant/getApiMode") } +// 获取邮储商户号 +export const getYCMerNo = (params) => { + return req("get", baseurl + "/plan/getPostbankMerNo", params) +} + +// 绑定邮储商户号 +export const bindYCMerNo = (data) => { + return req("post", baseurl + "/plan/bindPostbankMerNo", data) +} + export { req } diff --git a/src/pages/exchangecode/add/add.js b/src/pages/exchangecode/add/add.js index bd68c53c..d43c4bab 100644 --- a/src/pages/exchangecode/add/add.js +++ b/src/pages/exchangecode/add/add.js @@ -1549,6 +1549,7 @@ export default class accList extends React.Component { { this.onBindNum(e, rowData, rowIndex) }} diff --git a/src/pages/plan/add/step2.js b/src/pages/plan/add/step2.js index 4f35e606..f2144cc7 100644 --- a/src/pages/plan/add/step2.js +++ b/src/pages/plan/add/step2.js @@ -1421,8 +1421,8 @@ export default class acclist extends React.Component { return ( { diff --git a/src/pages/plan/key/UseKeyAddEdit.jsx b/src/pages/plan/key/UseKeyAddEdit.jsx index 67327ac5..e63058d1 100644 --- a/src/pages/plan/key/UseKeyAddEdit.jsx +++ b/src/pages/plan/key/UseKeyAddEdit.jsx @@ -1286,6 +1286,7 @@ const UseKeyAddEdit = () => { disabled={ rowData.disabled || rowData.recharge_type == 2 || state.isSettlement === 1 } + maxLength={5} onChange={(e) => { onBindNum(e, rowData, rowIndex) }} diff --git a/src/pages/plan/key/edit.js b/src/pages/plan/key/edit.js index 8551338c..8fe67f68 100644 --- a/src/pages/plan/key/edit.js +++ b/src/pages/plan/key/edit.js @@ -764,6 +764,7 @@ export default class accList extends React.Component { { this.onBindNum(e, rowData, rowIndex) }} diff --git a/src/pages/plan/list/list.js b/src/pages/plan/list/list.js index e0bb64a7..9aed08d0 100644 --- a/src/pages/plan/list/list.js +++ b/src/pages/plan/list/list.js @@ -8,7 +8,9 @@ import { planCancel, planIsSend, planSend, - startOrStopPlan + startOrStopPlan, + getYCMerNo, + bindYCMerNo } from "@/assets/api.js" import "@/assets/comm.css" import menu from "@/assets/enum.js" @@ -236,7 +238,8 @@ export default class acclist extends React.Component { usage_total: 0, silent_total: 0, isSend: true, - isCancel: false + isCancel: false, + mer_no: "" } } clickFn() { @@ -480,7 +483,7 @@ export default class acclist extends React.Component { window.open("#/home/key-list") } - menuItemClick(key, row) { + async menuItemClick(key, row) { this.setState({ plan_id: row.id }) if (row.status == 6) { Notify.clear() @@ -577,6 +580,52 @@ export default class acclist extends React.Component { if (key == 6) { this.callBack(row) } + + if (key == 7) { + let res = await getYCMerNo({ plan_id: row.id }) + if (res.code === 200) { + let self7 = this + self7.setState({ mer_no: res.data.mer_no }) + Sweetalert.confirm({ + type: "info", + closeBtn: true, + title: "邮储商户编号", + content: ( + self7.setState({ mer_no: e.target.value })} + defaultValue={self7.state.mer_no} + > + ), + onConfirm: (e) => { + if (self7.state.mer_no === "") { + Notify.error("请输入邮储商户编号") + return false + } + bindYCMerNo({ plan_id: row.id, mer_no: self7.state.mer_no }).then((yzres) => { + console.log("yzres =>", yzres) + if (yzres.code === 200) { + Notify.success("绑定成功") + self7.setState({ page: 1, limit: 10 }) + let data = { + page: 1, + limit: 10 + } + self7.getPlanList(data) + e() + } else { + Notify.error(yzres.message) + return false + } + }) + }, + onCancel: this.onCancel, + className: "questModal", + parentComponent: this + }) + } + } } //清空 @@ -854,6 +903,7 @@ export default class acclist extends React.Component { 日志 作废 + 绑定邮储商户编号 @@ -887,6 +937,8 @@ export default class acclist extends React.Component { ) } + default: + return "" } }