fix: 增加邮政绑定号 限制绑定对象绑定数

This commit is contained in:
zhangds 2024-03-22 17:01:59 +08:00
parent 76338d91de
commit a949aeafb2
6 changed files with 69 additions and 4 deletions

View File

@ -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 }

View File

@ -1549,6 +1549,7 @@ export default class accList extends React.Component {
<Input
placeholder="请输入数量"
value={rowData.restrict}
maxLength={5}
onChange={(e) => {
this.onBindNum(e, rowData, rowIndex)
}}

View File

@ -1421,8 +1421,8 @@ export default class acclist extends React.Component {
return (
<Input
placeholder="请输入数量"
type="number"
width={120}
maxLength={5}
disabled={rowData.recharge_type == 2 || this.props.isSettlement === 1}
value={this.props.isSettlement === 1 ? 1 : rowData.restrict}
onChange={(e) => {

View File

@ -1286,6 +1286,7 @@ const UseKeyAddEdit = () => {
disabled={
rowData.disabled || rowData.recharge_type == 2 || state.isSettlement === 1
}
maxLength={5}
onChange={(e) => {
onBindNum(e, rowData, rowIndex)
}}

View File

@ -764,6 +764,7 @@ export default class accList extends React.Component {
<Input
placeholder="请输入数量"
value={rowData.restrict}
maxLength={5}
onChange={(e) => {
this.onBindNum(e, rowData, rowIndex)
}}

View File

@ -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: (
<Input
placeholder="请输邮储商户编号"
maxLength={200}
onChange={(e) => self7.setState({ mer_no: e.target.value })}
defaultValue={self7.state.mer_no}
></Input>
),
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 {
日志
</MenuItem>
<MenuItem key="3">作废</MenuItem>
<MenuItem key="7">绑定邮储商户编号</MenuItem>
</Menu>
</DropdownContent>
</Dropdown>
@ -887,6 +937,8 @@ export default class acclist extends React.Component {
</span>
)
}
default:
return ""
}
}