修复bug并新增兑换码绑定数字段同时与后端联调

This commit is contained in:
Wind-58 2022-09-05 12:26:58 +08:00
parent 8cb1e3670c
commit 0eaf45c6f9
2 changed files with 29 additions and 8 deletions

View File

@ -609,7 +609,7 @@ export default class exchangeAdd extends React.Component {
quantity: this.state.codeInfo.issued,
range: range.join(),
title: this.state.codeInfo.code_name,
restrict: "50",
restrict: this.state.codeInfo.restrict,
product: {
legal: selection.filter((item2) => {
if (item2.type == 1) {
@ -1112,7 +1112,7 @@ export default class exchangeAdd extends React.Component {
clearable
value={this.state.codeInfo.planSelect}
options={this.state.planSelectData}
placeholder={"请选择"}
placeholder='请选择'
labelWidth={"0px"}
height={"36px"}
width={"520px"}
@ -1121,6 +1121,7 @@ export default class exchangeAdd extends React.Component {
/>
</FormItem>
) : null}
{!this.state.isState ? (
<FormItem
labelname='归属key'
@ -1135,7 +1136,7 @@ export default class exchangeAdd extends React.Component {
clearable
value={this.state.codeInfo.keyBatchSelect}
options={this.state.keyBatchSelectData}
placeholder={"请选择"}
placeholder='请选择'
labelWidth={"0px"}
height={"36px"}
width={"520px"}
@ -1153,7 +1154,7 @@ export default class exchangeAdd extends React.Component {
onChange={(e) => this.handleChange(e, "code_name")}
onClearItem={() => this.handleChange("", "code_name")}
value={this.state.codeInfo.code_name}
placeholder={"请输入兑换码名称"}
placeholder='请输入兑换码名称'
labelWidth={"0px"}
maxLength={12}
height={"36px"}
@ -1162,6 +1163,24 @@ export default class exchangeAdd extends React.Component {
/>
</FormItem>
{this.state.isState !== 2 ? (
<FormItem labelname='绑定数' prop='restrict' id='restrict'>
<Ipt
onChange={(e) => this.handleChange(e, "restrict")}
onClearItem={() => this.handleChange("", "restrict")}
value={this.state.codeInfo.restrict}
placeholder='请输入绑定数量'
labelWidth={"0px"}
maxLength={6}
countShow={false}
unit='条'
height={"36px"}
width={"520px"}
alignment={"left"}
/>
</FormItem>
) : null}
{this.state.isState === 2 ? (
<>
<FormItem labelname='发放总量' prop='issued' id='issued'>
@ -1177,7 +1196,7 @@ export default class exchangeAdd extends React.Component {
onChange={(e) => this.handleChange(e, "issued")}
onClearItem={() => this.handleChange("", "issued")}
value={this.state.codeInfo.issued}
placeholder={"请输入发放总量"}
placeholder='请输入发放总量'
labelWidth={"0px"}
maxLength={6}
countShow={false}

View File

@ -3,7 +3,8 @@ export const codeInfo = {
code_name: [{ type: "required", message: "请输入兑换码名称" }],
planSelect: [{ type: "required", message: "请选择归属计划" }],
keyBatchSelect: [{ type: "required", message: "请选择归属Key" }],
issued: [{ type: "required", message: "请输入发放总量" }]
issued: [{ type: "required", message: "请输入发放总量" }],
restrict: [{ type: "required", message: "请输入绑定数量" }]
}
//基本规则
@ -133,8 +134,9 @@ export const init = () => {
date_time: "",
range: "",
stock: "",
planSelect: [] /* 归属计划 */,
keyBatchSelect: [] /* 归属key */
planSelect: "" /* 归属计划 */,
keyBatchSelect: "" /* 归属key */,
restrict: "" /* 绑定数 */
},
isload: false,
tempdata: [],