前端react项目,代码如下,点击点击“通过”或者“驳回”按钮后,控制台报错如下,并且页面变成个大空白页?
这是审核弹出页面,点击“通过”或者“驳回”
import React, { Component } from "react";import { ListBox } from "../../../components";
import { fetchData } from "../../../components/AjaxConsumer";
import ListModelDetail from "./SearchModel";
import ListModelDetailBF from "./SearchModelBF";
import moment from "moment";
import { FormattedMessage, defineMessages, injectIntl } from "react-intl";
import {
Form,
Input,
Row,
Col,
Select,
Button,
message,
Modal,
Radio,
DatePicker,
} from "antd";
const RadioGroup = Radio.Group;
const FormItem = Form.Item;
const confirm = Modal.confirm;
const { Option } = Select;
const messages = defineMessages({
TS: {
id: "wms.SGCKD.add.TS",
defaultMessage: "提示",
},
WHBFK: {
id: "wms.SGCKD.add.WHBFK",
defaultMessage: "请先维护报废库!",
},
QTJWLHSL: {
id: "wms.SGCKD.add.QTJWLHSL",
defaultMessage: "请添加物料和数量!",
},
CZCG: {
id: "wms.SGCKD.add.CZCG",
defaultMessage: "操作成功",
},
QXZHTH: {
id: "wms.SGCKD.add.QXZHTH",
defaultMessage: "请选择合同号!",
},
WLH: {
id: "wms.SGCKD.add.WLH",
defaultMessage: "物料号",
},
QTX: {
id: "wms.SGCKD.add.QTX",
defaultMessage: "请填写",
},
WLMS: {
id: "wms.SGCKD.add.WLMS",
defaultMessage: "物料描述",
},
WLLX: {
id: "wms.SGCKD.add.WLLX",
defaultMessage: "类型",
},
WX: {
id: "wms.SGCKD.add.WX",
defaultMessage: "外销",
},
NX: {
id: "wms.SGCKD.add.NX",
defaultMessage: "内销",
},
YJ: {
id: "wms.SGCKD.add.YJ",
defaultMessage: "样机",
},
TP: {
id: "wms.SGCKD.add.TP",
defaultMessage: "托盘",
},
TM: {
id: "wms.SGCKD.add.TM",
defaultMessage: "条码",
},
XH: {
id: "wms.SGCKD.list.XH",
defaultMessage: "物料号",
},
XHMS: {
id: "wms.SGCKD.list.XHMS",
defaultMessage: "物料描述",
},
YKW: {
id: "wms.SGCKD.add.YKW",
defaultMessage: "源库位",
},
MBKW: {
id: "wms.SGCKD.add.MBKW",
defaultMessage: "目标库位",
},
JHSL: {
id: "wms.SGCKD.add.JHSL",
defaultMessage: "计划数量",
},
JHCKSL: {
id: "wms.SGCKD.add.JHCKSL",
defaultMessage: "计划出库日期",
},
BZ: {
id: "wms.SGCKD.add.BZ",
defaultMessage: "备注",
},
QSR: {
id: "wms.SGCKD.add.QSR",
defaultMessage: "请输入",
},
BNWK: {
id: "wms.SGCKD.add.BNWK",
defaultMessage: "不能为空",
},
HZ: {
id: "wms.SGCKD.add.HZ",
defaultMessage: "货主",
},
QXZQY: {
id: "wms.SGCKD.add.QXZQY",
defaultMessage: "请选择区域",
},
SRNRYSYSSGZF: {
id: "wms.SGCKD.add.SRNRYSYSSGZF",
defaultMessage: "输入内容应少于40个字符!",
},
QXZ: {
id: "wms.SGCKD.add.QXZ",
defaultMessage: "请选择",
},
HWSX: {
id: "wms.SGCKD.add.HWSX",
defaultMessage: "货物属性",
},
LP: {
id: "wms.SGCKD.add.LP",
defaultMessage: "良品",
},
BLP: {
id: "wms.SGCKD.add.BLP",
defaultMessage: "不良品",
},
CKLX: {
id: "wms.SGCKD.add.CKLX",
defaultMessage: "出库类型",
},
YK: {
id: "wms.SGCKD.add.YK",
defaultMessage: "移库",
},
BF: {
id: "wms.SGCKD.add.BF",
defaultMessage: "报废",
},
LYBY: {
id: "wms.SGCKD.add.LYBY",
defaultMessage: "领用借用",
},
CKWL: {
id: "wms.SGCKD.add.CKWL",
defaultMessage: "出库物料",
},
RWLX: {
id: "wms.SGCKD.add.RWLX",
defaultMessage: "任务类型",
},
TJZ: {
id: "wms.SGCKD.add.TJZ",
defaultMessage: "提交中...",
},
QD: {
id: "wms.SGCKD.add.QD",
defaultMessage: "确定",
},
QX: {
id: "wms.SGCKD.add.QX",
defaultMessage: "取消",
},
title: {
id: "wms.SGCKD.add.title",
defaultMessage: "手工出库任务新增",
},
title: {
id: "wms.SGCKD.details.title",
defaultMessage: "手工出库单详情",
},
CBZX: {
id: "wms.SGCKD.add.CBZX",
defaultMessage: "成本中心",
},
WD: {
id: "wms.RawAllocationOutboundOrder.add.WD",
defaultMessage: "文档号",
},
TG: {
id: "wms.button.TG",
defaultMessage: "通过",
},
BH: {
id: "wms.button.BH",
defaultMessage: "驳回",
},
});
// 主要表单组件
class SelfForm extends Component {
constructor(props) {
super(props);
this.state = {
locationData: [], //正常库
locationData0: [], //报废库
locationDataAll: [], //所有库位
loading: false,
url: this.props.url,
whCodeList: [],
wdCodeList: [],
wlFromCodeList: [],
regionCodeList: [],
fromRegionCodeList: [],
getData: this.props.xf ? this.props.getData : {},
contractUrl: "/wmsbase/base/data/contract/get",
modelTypeUrl: "/wmsbase/base/dic/get/model_type_p",
disabled: false,
selectValue: "YK",
formData: {
warehouseCode: "",
regionCode: "",
regionDesc: "",
remark: "",
productCode: "",
userDefined1: "",
productDescZh: "",
originWl: "",
// aimWl:"",
custCode: "",
type: "",
whCode: "",
wdCode: "",
wlFromCode: "",
proOutPlanTime: null,
},
};
console.log(this.props,'asdkasndk')
this.uuid = this.props.getData ? this.props.getData.keys.length : 0;
this.dbOutCode = this.props.dbOutCode;
this.tableColumn={
storageKey: "manualDeliveryOrderColumnConfig",
storageKeyPa: "manualDeliveryOrderPagesize",
data:[
{
showName: <FormattedMessage {...messages.XH} />,
columnName: "productCode",
},
{
showName: <FormattedMessage {...messages.XHMS} />,
columnName: "productDescZh",
},
{
showName: <FormattedMessage {...messages.YKW} />,
columnName: "originWl",
},
{
showName: <FormattedMessage {...messages.JHSL} />,
columnName: "qty",
}
]
}
}
componentWillMount() {
// console.log('我丢雷老母啊',this.state.selectValue)
// this.setState({
// selectValue:'YK'
// })
let options = {
url: "/wmsbase/base/data/location/queryByFactoryCodeAndWorkAreaCode",
type: "post",
condition: {
// workArea:1006
warehouseType: 1,
},
};
console.log("请求的地址", options.url);
fetchData(this, options, (listData) => {
console.log("库位数据", listData.data);
var records1 = [];
var records0 = [];
var recordsAll = [];
for (var i = 0, l = listData.data.length; i < l; i++) {
if (listData.data[i].locationScrapType == "1") {
records1.push(listData.data[i]);
} else {
records0.push(listData.data[i]);
}
recordsAll.push(listData.data[i]);
}
this.setState({
locationData: records1,
locationData0: records0,
locationDataAll: recordsAll,
});
});
}
componentDidMount() {
let orderNo = this.props.rowObj.order3;
const options = {
url: "/wmsrest/product/byhand/listNew",
type: "post",
condition: {order3:orderNo},
};
console.log("====mmmmm********mm====");
fetchData(this, options,(res)=>{
let list = res.data.records[0];
list.keys=[];
res.data.records.forEach((val,key)=>{
list.keys.push(key+1)
})
this.props.form.setFieldsValue(list)
this.props.form.setFieldsValue({
keys: list.keys,
})
if (this.state.getData && this.state.getData != {}) {
let length = res.data.records? res.data.records.length: 0;
const data = res.data.records;
console.log(data);
for (let i = 0; i < length; i++) {
if (i == 0) {
this.state.formData = data[0]
this.state.formData.warehouseCode = data[0].whCode;
this.state.formData.regionCode = data[0].whCode;
this.state.formData.userDefined1 = data[0].userDefined1;
}
}
}
})
}
handleAudit = (type,e) => {
e.preventDefault();
let dbOutCode = this.dbOutCode;
this.props.form.validateFieldsAndScroll((err, fieldsValue) => {
if (!err) {
this.setState({ loading: true });
let orderNo = this.props.rowObj.order3;
let url = "/wmsrest/product/byhand/audit";
const options = {
//服务器的url
url: url,
type: "post",
condition: JSON.stringify({order3:orderNo,orderStatus:type}),
contentType: "application/json; charset=utf-8",
};
fetchData(
this,
options,
(res) => {
//回调函数
if (res.code == 1) {
console.log("操作成功!");
this.props.refreshHandle();
this.props.onCancel();
this.setState({
loading: false,
visible: false,
disabled: false,
// selectValue: "YK",
});
message.success(this.props.intl.formatMessage(messages.CZCG));
this.props.form.resetFields();
this.uuid = 0;
this.props.form.setFieldsValue({
keys: [],
});
} else {
this.setState({
loading: false,
disabled: false,
});
message.warning(res.data);
}
},
(res) => {
this.setState({ loading: false });
message.warning(res.data);
}
);
}
});
};
onCancel = () => {
this.setState({
selectValue: "YK",
});
this.props.form.resetFields();
// console.log("'uid",this.uuid)
this.uuid = 0;
this.props.form.setFieldsValue({
keys: [],
});
this.props.onCancel();
this.setState({
disabled: false,
});
};
// 成品型号选择弹出模态框的统一回调函数
getListModelDetailData = (resultData) => {
console.log("getListModelDetailData");
let k = resultData.k;
let productCode = `names1_${k}`;
let productDescZh = `names2_${k}`;
let custCode = `names3_${k}`;
let originWl = `names5_${k}`;
this.props.form.setFieldsValue({
[productCode]: resultData.productCode,
[productDescZh]: resultData.productDescZh,
[custCode]: resultData.custCode,
[originWl]: resultData.wlCode + "," + resultData.sendSpot,
});
};
// selectChange = (value) => {
// console.log(`selected ${value}`);
// this.setState({
// selectValue: value,
// });
// };
render() {
const { getFieldDecorator, getFieldValue } = this.props.form;
const data = this.state.getData.data;
const colNumber = 12; //一行2个
const itemLayout = {
labelCol: {
xs: { span: 24 },
sm: { span: 10 },
},
wrapperCol: {
xs: { span: 24 },
sm: { span: 14 },
},
};
const formItemLayoutWithOutLabel = {
wrapperCol: {
xs: { span: 24, offset: 0 },
sm: { span: 20, offset: 4 },
},
};
let tempArr = [];
for (let i = 0; i < this.uuid; i++) {
tempArr.push(i);
}
getFieldDecorator("keys", { initialValue: tempArr });
const keys = getFieldValue("keys");
let userDefined3value = getFieldValue("userDefined3");
function onChange(value) {
console.log(`selected ${value}`);
}
function onBlur() {
console.log("blur");
}
function onFocus() {
console.log("focus");
}
function onSearch(val) {
console.log("search:", val);
}
const formItemLayout = {
labelCol: {
xs: { span: 24 },
sm: { span: 6 },
},
wrapperCol: {
xs: { span: 24 },
sm: { span: 14 },
},
};
return (
<Form
//onSubmit={this.handleSubmit}
style={{
backgroundColor: "#fff",
paddingTop: "20px",
paddingBottom: "20px",
}}
>
<div style={{ width: "1400px", height: "auto", margin: "0 auto" }}>
<Row>
<Col span={colNumber}>
<FormItem
{...formItemLayout}
label={<FormattedMessage {...messages.JHCKSL} />}
>
{getFieldDecorator("orderDate", {})(
// <DatePicker
// format="YYYY-MM-DD HH:mm:ss"
// style={{ width: "100%" }}
// />
<Input disabled />
)}
</FormItem>
</Col>
<Col span={colNumber}>
<FormItem
{...formItemLayout}
label={<FormattedMessage {...messages.RWLX} />}
>
{getFieldDecorator("orderType", {})(
<Select name="type" disabled >
<Option value="YK">
<FormattedMessage {...messages.YK} />
</Option>
<Option value="BF">
<FormattedMessage {...messages.BF} />
</Option>
<Option value="LY">
<FormattedMessage {...messages.LYBY} />
</Option>
</Select>
)}
</FormItem>
</Col>
{this.state.selectValue == "YK" ? null : (
<Col span={colNumber}>
<FormItem
{...formItemLayout}
label={<FormattedMessage {...messages.CBZX} />}
>
{getFieldDecorator("costCenter", { })(
<Input disabled />
)}
</FormItem>
</Col>
)}
<Col span={colNumber}>
<FormItem
{...formItemLayout}
label={<FormattedMessage {...messages.BZ} />}
>
{getFieldDecorator("add10", { })(
<Input disabled />
)}
</FormItem>
</Col>
<Col span={colNumber}>
<FormItem
{...formItemLayout}
label={<FormattedMessage {...messages.WD} />}
>
{getFieldDecorator("cpRef5", { })(
<Input disabled />
)}
</FormItem>
</Col>
</Row>
<ListBox
ref="proScrapOutList"
title='Mat Details'
isHideLeft={this.props.isHideLeft}
tableColumnData={this.tableColumn}
searchComponentData={[]}
url="/wmsrest/product/byhand/listNew"
// rowHandles={this.rowHandles}
rowOperation={[]}
headerOperation={[]}
conditonData={{ orderSourceSys: "RAW",order3:this.props.rowObj.order3 }}
isRowSingle="true"
unLoading={false}
columnHidden={false}
// selectComponentData={[]}
subtractHeight="200"
subtractWidth="200"
/>
{/* <div className={styles.formBox}>{formItems}</div> */}
<div
style={{
padding: "3px 0",
margin: "0px auto",
display: "flex",
justifyContent: "center",
}}
>
<Button
type="primary"
onClick={this.handleAudit.bind(this,localStorage.getItem('roles').indexOf("WMS_RAW_LEADER")!=-1?"13":"12")}
size="large"
loading={this.state.loading}
>
<FormattedMessage {...messages.TG} />
</Button>
<Button
type="default"
onClick={this.handleAudit.bind(this,"14")}
size="large"
loading={this.state.loading}
style={{ marginLeft: "30px" }}
>
<FormattedMessage {...messages.BH} />
</Button>
<Button
type="default"
size="large"
onClick={this.onCancel}
style={{ marginLeft: "30px" }}
>
<FormattedMessage {...messages.QX} />
</Button>
<ListModelDetail
getTableData={this.getListModelDetailData}
ref="listModelDetail"
/>
<ListModelDetailBF
getTableData={this.getListModelDetailData}
ref="listModelDetailBF"
/>
</div>
</div>
</Form>
);
}
}
let MyForm = injectIntl(Form.create()(SelfForm), {
forwardRef: true,
});
export default class EditPage extends Component {
constructor(props) {
super(props);
this.state = {
loading: false,
visible: false,
url: "",
rowObj:{}
};
}
handleOk = () => {
// let result = this.state.resData;
this.setState({
visible: false,
});
this.refreshHandle();
};
handleCancel = () => {
this.setState({
visible: false,
});
};
refreshHandle = () => {
console.log("刷新List列表");
this.props.refreshHandle();
};
// 成品报废出库任务新增(外部调用)
// editHandle = () => {
// this.setState({
// visible: true,
// resData: "",
// url: "/wmsrest/product/byhand/batchInsert",
// formTitle: <FormattedMessage {...messages.title} />,
// });
// };
// 编辑信息
editHandle = (rowObj) => {
//根据对象的Id 属性获取对象信息
console.log(rowObj)
// let orderNo = rowObj.order3;
// const options = {
// url: "/wmsrest/product/byhand/listNew",
// type: "post",
// condition: {order3:orderNo},
// };
// this.setState({visible:true})
// console.log("====mmmmmmm====");
// fetchData(this, options,(res)=>{
// let list = res.data.records[0];
// list.keys=[];
// res.data.records.forEach((val,key)=>{
// list.keys.push(key+1)
// })
this.setState({
rowObj:rowObj,
visible:true
})
// this.props.form.setFieldsValue(list)
};
render() {
return (
<Modal
style={{ top: "20px" }}
visible={this.state.visible}
title={
this.state.formTitle ? (
this.state.formTitle
) : (
<FormattedMessage {...messages.title} />
)
}
onOk={this.handleOk}
onCancel={this.handleCancel}
width={"1400px"}
footer=""
maskClosable={false}
closable={false}
>
{this.state.visible?
<MyForm
ref="myForm"
dbOutCode={this.state.dbOutCode}
url={this.state.url}
getData={this.state.resData}
onCancel={this.handleCancel}
refreshHandle={this.refreshHandle}
rowObj={this.state.rowObj}
/>:''}
</Modal>
);
}
}
这是父级页面
// 成品报废出库查询 -- wzhgimport React, { Component } from "react";
import { ListBox } from "../../../components";
import { Modal, message } from "antd";
import { fetchData } from "../../../components/AjaxConsumer";
import AddPage from "./addPage";
// import AddPageSfp from "./addPageSfp"
import UpdatePage from "./UpdatePage";
import ListDetail from "./ListDetail";
import AuditPage from "./AuditPage";
import $ from "jquery";
const confirm = Modal.confirm;
import { FormattedMessage, defineMessages, injectIntl } from "react-intl";
const messages = defineMessages({
SDCKD: {
id: "wms.SGCKD.list.SDCKD",
defaultMessage: "手工出库单",
},
DH: {
id: "wms.SGCKD.list.DH",
defaultMessage: "单号",
},
XH: {
id: "wms.SGCKD.list.XH",
defaultMessage: "物料号",
},
XHMS: {
id: "wms.SGCKD.list.XHMS",
defaultMessage: "物料描述",
},
JHSL: {
id: "wms.SGCKD.list.JHSL",
defaultMessage: "计划数量",
},
HZ: {
id: "wms.SGCKD.list.HZ",
defaultMessage: "货主",
},
JHRQ: {
id: "wms.SGCKD.list.JHRQ",
defaultMessage: "计划日期",
},
CQZT: {
id: "wms.SGCKD.list.CQZT",
defaultMessage: "出库状态",
},
BZ: {
id: "wms.SGCKD.list.BZ",
defaultMessage: "备注",
},
QB: {
id: "wms.SGCKD.list.QB",
defaultMessage: "全部",
},
WGZ: {
id: "wms.SGCKD.list.WGZ",
defaultMessage: "未过账",
},
GZSB: {
id: "wms.SGCKD.list.GZSB",
defaultMessage: "过账失败",
},
YGZ: {
id: "wms.SGCKD.list.YGZ",
defaultMessage: "已过帐",
},
BHWC: {
id: "wms.SGCKD.list.BHWC",
defaultMessage: "备货完成",
},
CJ: {
id: "wms.SGCKD.list.CJ",
defaultMessage: "创建",
},
SH: {
id: "wms.button.SH",
defaultMessage: "审核",
},
XG: {
id: "wms.SGCKD.list.XG",
defaultMessage: "修改",
},
SC: {
id: "wms.SGCKD.list.SC",
defaultMessage: "删除",
},
XQ: {
id: "wms.SGCKD.list.XQ",
defaultMessage: "详情",
},
DC: {
id: "wms.SGCKD.list.DC",
defaultMessage: "导出",
},
error: {
id: "wms.SGCKD.list.error",
defaultMessage: "错误提示",
},
QXZYTSJ: {
id: "wms.SGCKD.list.QXZYTSJ",
defaultMessage: "请选择一条数据",
},
ZNXZYTSJ: {
id: "wms.SGCKD.list.ZNXZYTSJ",
defaultMessage: "只能选择一条数据",
},
ZNXZBFSJ: {
id: "wms.SGCKD.list.ZNXZBFSJ",
defaultMessage: "只能选择订单类型为报废数据",
},
ZNXZSHSJ: {
id: "wms.SGCKD.list.ZNXZSHSJ",
defaultMessage: "只能选择订单状态为待审核、审核中的数据",
},
NQDSCM: {
id: "wms.SGCKD.list.NQDSCM",
defaultMessage: "您确定要删除吗?",
},
CZCG: {
id: "wms.LLD.list.CZCG",
defaultMessage: "操作成功",
},
DDZT: {
id: "wms.RawDnOrderList.list.DDZT",
defaultMessage: "订单状态",
},
WKS: {
id: "wms.cppdrwcx.list.WKS",
defaultMessage: "未开始",
},
YWC: {
id: "wms.cppdrwcx.list.YWC",
defaultMessage: "已完成",
},
DSH: {
id: "wms.pro.order.out.status.DSH",
defaultMessage: "待审核",
},
SHZ: {
id: "wms.pro.order.out.status.SHZ",
defaultMessage: "审核中",
},
SHTG: {
id: "wms.pro.order.out.status.SHTG",
defaultMessage: "审核通过",
},
SHBTG: {
id: "wms.pro.order.out.status.SHBTG",
defaultMessage: "审核不通过",
},
DDLX: {
id: "wms.rawPoDetail.list.DDLX",
defaultMessage: "订单类型",
},
YK: {
id: "wms.SGCKD.add.YK",
defaultMessage: "移库",
},
BF: {
id: "wms.SGCKD.add.BF",
defaultMessage: "报废",
},
LYBY: {
id: "wms.SGCKD.add.LYBY",
defaultMessage: "领用借用",
},
DC: {
id: "wms.YCL.SCDDCKMXLB.DC",
defaultMessage: "导出",
},
});
class manualDeliveryOrder extends React.Component {
constructor(props) {
super(props);
//行操作列表-已弃用
this.rowOperation = [];
//header 操作列表111
this.headerOperation = [
// {
// handleName: "addSfp",
// showName: "创建半成品手工出库单",
// iconClass: "plus",
// // permission: "probyhand-create"
// },
{
handleName: "add",
showName: <FormattedMessage {...messages.CJ} />,
iconClass: "plus",
// permission: "probyhand-create"
},
// {
// handleName: "edit",
// showName: <FormattedMessage {...messages.XG} />,
// iconClass: "edit",
// permission: "probyhand-edit",
// },
{
handleName: "audit",
showName: <FormattedMessage {...messages.SH} />,
iconClass: "audit",
//false则显示按钮
permission:!((localStorage.getItem('gongc')==='9A61'||localStorage.getItem('gongc')==='9A62')&&
(localStorage.getItem('roles').indexOf("WMS_RAW_LEADER")!=-1||localStorage.getItem('roles').indexOf("WMS_RAW_QC")!=-1))
// permission: "probyhand-create"
},
{
handleName: "delete",
showName: <FormattedMessage {...messages.SC} />,
iconClass: "delete",
// permission: "probyhand-delete"
},
{
handleName: "export",
showName: <FormattedMessage {...messages.DC} />,
iconClass: "file-excel",
},
// {
// handleName: "info",
// showName: <FormattedMessage {...messages.XQ} />,
// iconClass: "info",
// },
// {
// handleName: "export",
// showName: <FormattedMessage {...messages.DC} />,
// iconClass: "file-excel",
// },
];
//table列表展示列配置
//showName、columnName 必有属性, columnWidth 可选,默认100, columnHidden: true 列隐藏
// foreverHidden永久隐藏
this.tableColumn = {
storageKey: "manualDeliveryOrderColumnConfig",
storageKeyPa: "manualDeliveryOrderPagesize",
data: [
{
showName: "rowId",
columnName: "rowId",
columnHidden: true,
foreverHidden: true,
},
{
showName: <FormattedMessage {...messages.DH} />,
columnName: "order3",
columnWidth: 150,
},
{
showName: <FormattedMessage {...messages.XH} />,
columnName: "productCode",
columnWidth: 150,
},
{
showName: <FormattedMessage {...messages.XHMS} />,
columnName: "productDescZh",
columnWidth: 150,
},
{
showName: <FormattedMessage {...messages.DDLX} />,
columnName: "orderType",
columnWidth: 150,
showOption: [
{
optionKey: "YK",
optionShow: <FormattedMessage {...messages.YK} />,
},
{
optionKey: "BF",
optionShow: <FormattedMessage {...messages.BF} />,
},
{
optionKey: "LY",
optionShow: <FormattedMessage {...messages.LYBY} />,
},
],
},
{
showName: <FormattedMessage {...messages.JHSL} />,
columnName: "qty",
columnWidth: 150,
},
// {
// showName: <FormattedMessage {...messages.HZ} />,
// columnName: "regionCode",
// columnWidth: 150,
// },
{
showName: <FormattedMessage {...messages.JHRQ} />,
columnName: "orderDate",
columnWidth: 150,
showTime: 1,
},
{
showName: <FormattedMessage {...messages.DDZT} />,
columnName: "orderStatus",
columnWidth: 150,
showOption: [
{
optionKey: "0",
optionShow: <FormattedMessage {...messages.WKS} />,
},
{
optionKey: "1",
optionShow: <FormattedMessage {...messages.YWC} />,
},
{
optionKey: "11",
optionShow: <FormattedMessage {...messages.DSH} />,
},
{
optionKey: "12",
optionShow: <FormattedMessage {...messages.SHZ} />,
},
{
optionKey: "13",
optionShow: <FormattedMessage {...messages.SHTG} />,
},
{
optionKey: "14",
optionShow: <FormattedMessage {...messages.SHBTG} />,
},
],
},
{
showName: <FormattedMessage {...messages.CQZT} />,
columnName: "dJStatus",
columnWidth: 150,
showOption: [
{
optionKey: "10",
optionShow: <FormattedMessage {...messages.WGZ} />,
},
{
optionKey: "20",
optionShow: <FormattedMessage {...messages.GZSB} />,
},
{
optionKey: "30",
optionShow: <FormattedMessage {...messages.YGZ} />,
},
// {
// optionKey: "99",
// optionShow: <FormattedMessage {...messages.BHWC} />,
// },
],
},
{
showName: <FormattedMessage {...messages.BZ} />,
columnName: "add10",
columnWidth: 150,
},
],
};
//搜索属性配置,如果字段不配置,默认是input搜索
// 搜索类型:
// 1、输入框 type='input', 默认
// 2、时间 type='date'
// 3、数字 type='number'
// 4、下拉框 type='select'
this.searchComponentData = [
{
showName: <FormattedMessage {...messages.JHRQ} />,
name: "orderDate",
type: "date",
maxName: "orderDateMax",
minName: "orderDateMin",
exactName: "orderDateExact",
},
{
showName: <FormattedMessage {...messages.JHSL} />,
name: "qty",
type: "number",
maxName: "qtyMax", //最大值
minName: "qtyMin", //最小值
},
{
showName: <FormattedMessage {...messages.DDZT} />,
name: "orderStatus",
type: "select",
optionList: [
{
optionKey: "0",
optionShow: <FormattedMessage {...messages.WKS} />,
},
{
optionKey: "1",
optionShow: <FormattedMessage {...messages.YWC} />,
},
{
optionKey: "11",
optionShow: <FormattedMessage {...messages.DSH} />,
},
{
optionKey: "12",
optionShow: <FormattedMessage {...messages.SHZ} />,
},
{
optionKey: "13",
optionShow: <FormattedMessage {...messages.SHTG} />,
},
{
optionKey: "14",
optionShow: <FormattedMessage {...messages.SHBTG} />,
},
],
},
{
showName: <FormattedMessage {...messages.DDLX} />,
name: "orderType",
type: "select",
optionList: [
{
optionKey: "YK",
optionShow: <FormattedMessage {...messages.YK} />,
},
{
optionKey: "BF",
optionShow: <FormattedMessage {...messages.BF} />,
},
{
optionKey: "LY",
optionShow: <FormattedMessage {...messages.LYBY} />,
},
],
},
{
showName: <FormattedMessage {...messages.CQZT} />,
name: "dJStatus",
type: "select",
optionList: [
{
optionKey: "10",
optionShow: <FormattedMessage {...messages.WGZ} />,
},
{
optionKey: "20",
optionShow: <FormattedMessage {...messages.GZSB} />,
},
{
optionKey: "30",
optionShow: <FormattedMessage {...messages.YGZ} />,
},
// {
// optionKey: "99",
// optionShow:<FormattedMessage {...messages.BHWC} />,
// },
],
},
];
}
// 行操作
rowHandles = (strHandles, rowObj) => {
if (strHandles === "add") {
this.addHandle(rowObj);
// } else if (strHandles == "doubleClick") {
// this.infoHandle(rowObj);
// } else if (strHandles == "info") {
// this.infoHandle(rowObj);
} else if (strHandles == "edit") {
this.editHandle(rowObj);
} else if (strHandles == "audit") {
this.auditHandle(rowObj);
} else if (strHandles === "delete") {
this.deleteHandle(rowObj);
} else if (strHandles == "export") {
this.exportXlsHandle(rowObj);
}
// else if(strHandles == "addSfp"){
// this.addSfpHandle(rowObj);
// }
};
//导出
exportXlsHandle = (conditonData) => {
let param = "?";
for (let key in conditonData) {
// 这里要进行值的非null判断
if (conditonData[key] && conditonData[key] != "") {
param = param + key + "=" + conditonData[key] + "&";
}
}
console.log(param);
window.location.href =
"/wmsrest/product/byhand/listNew/exp" + param;
};
// exportXlsHandle = (conditonData) => {
// console.log("-------导出条件--------", conditonData);
// let param = "?";
// for (let key in conditonData) {
// if (conditonData[key] != "") {
// console.log(key, conditonData[key]);
// param = param + key + "=" + conditonData[key] + "&";
// }
// }
// window.location.href = "/wmsrest/product/byhand/list/exp" + param;
// };
infoHandle = (rowObj) => {
if (rowObj.length == 0) {
Modal.error({
title: this.props.intl.formatMessage(messages.error),
content: this.props.intl.formatMessage(messages.QXZYTSJ),
});
} else if (rowObj.length > 1) {
Modal.error({
title: this.props.intl.formatMessage(messages.error),
content: this.props.intl.formatMessage(messages.ZNXZYTSJ),
});
} else {
this.refs.listDetail.editHandle(rowObj[0].data);
}
};
// 审核
auditHandle = (rowObj) => {
if (rowObj.length == 0) {
Modal.error({
title: this.props.intl.formatMessage(messages.error),
content: this.props.intl.formatMessage(messages.QXZYTSJ),
});
} else if (rowObj.length > 1) {
Modal.error({
title: this.props.intl.formatMessage(messages.error),
content: this.props.intl.formatMessage(messages.ZNXZYTSJ),
});
} else {
let orderType=rowObj[0].data.orderType; //单据类型
let orderStatus=rowObj[0].data.orderStatus;//单据状态
if("BF" != orderType){
Modal.error({
title: this.props.intl.formatMessage(messages.error),
content: this.props.intl.formatMessage(messages.ZNXZBFSJ),
});
}else if("11" != orderStatus && "12" != orderStatus){
Modal.error({
title: this.props.intl.formatMessage(messages.error),
content: this.props.intl.formatMessage(messages.ZNXZSHSJ),
});
}else{
this.refs.auditPage.editHandle(rowObj[0].data);
}
}
};
editHandle = (rowObj) => {
if (rowObj.length == 0) {
Modal.error({
title: this.props.intl.formatMessage(messages.error),
content: this.props.intl.formatMessage(messages.QXZYTSJ),
});
} else if (rowObj.length > 1) {
Modal.error({
title: this.props.intl.formatMessage(messages.error),
content: this.props.intl.formatMessage(messages.ZNXZYTSJ),
});
} else {
this.refs.updatePage.editHandle(rowObj);
}
};
deleteHandle = (rowObj) => {
if (rowObj.length == 0) {
Modal.error({
title: this.props.intl.formatMessage(messages.error),
content: this.props.intl.formatMessage(messages.QXZYTSJ),
});
} else if (rowObj.length > 1) {
Modal.error({
title: this.props.intl.formatMessage(messages.error),
content: this.props.intl.formatMessage(messages.ZNXZYTSJ),
});
} else {
this.delete(rowObj);
}
};
delete = (rowObj) => {
let rowId = rowObj[0].data.rowId;
let _this = this;
confirm({
title: _this.props.intl.formatMessage(messages.NQDSCM),
onOk() {
return new Promise((resolve, reject) => {
const res = _this.DeleteOnOk(rowId, resolve, reject);
return res;
}).catch(() => console.log("出错!"));
},
onCancel() {
console.log("取消了删除操作");
},
});
};
DeleteOnOk(rowId, resolve, reject) {
const _this = this;
const options = {
url: "/wmsrest/product/byhand/delMoveScrap",
condition: { rowId: rowId },
};
fetchData(
_this,
options,
(res) => {
resolve();
if (res.code == "1") {
_this.refreshHandle();
message.success(_this.props.intl.formatMessage(messages.CZCG));
}
},
(res) => {
reject();
message.error(_this.props.intl.formatMessage(messages.CZSB));
}
);
}
//按照库位新增
addHandle = () => {
this.refs.addPage.addHandle();
};
// //创建半成品出库单
// addSfpHandle = () => {
// this.refs.addPageSfp.addSfpHandle();
// };
componentWillMount() {
const dicType = "model_type_p";
const options = {
url: "/wmsbase/base/dic/get/" + dicType,
type: "get",
condition: {},
};
if(localStorage.getItem("roles")==null){
localStorage.setItem("roles","" );
}
}
//下拉框 初始化
dicInitCallBackHandle = (resData) => {
//alert('resData' + JSON.stringify(resData, null, 4));
let optionList = [];
let tmp = {};
tmp.optionKey = "";
tmp.optionShow = "";
optionList.push(tmp);
resData.data.map((e, index) => {
let tmp = {};
tmp.optionKey = e.dicCode;
tmp.optionShow = e.dicName;
optionList.push(tmp);
});
//alert('optionList' + JSON.stringify(optionList, null, 4));
this.tableColumn.data[5].showOption = optionList;
this.searchComponentData[0].optionList = optionList;
};
//刷新列表
refreshHandle = () => {
this.refs.proScrapOutList.refreshHandle();
};
render() {
//当左侧隐藏时,列表宽度加上左侧的宽度,
//1、当前this.props.isHideLeft 是从页面组件containers/Main/main.js传过来
//2、this.props.isHideLeft 最顶级赋值是在页面 containers/Main/main.js
let isHideLeft = this.props.isHideLeft;
return (
<div>
<ListBox
ref="proScrapOutList"
title={<FormattedMessage {...messages.SDCKD} />}
isHideLeft={isHideLeft}
tableColumnData={this.tableColumn}
searchComponentData={this.searchComponentData}
url="/wmsrest/product/byhand/listNew"
rowHandles={this.rowHandles}
rowOperation={this.rowOperation}
headerOperation={this.headerOperation}
conditonData={{ orderSourceSys: "RAW" }}
isRowSingle="true"
unLoading={false}
subtractHeight="20"
subtractWidth="-30"
/>
{/* <AddPageSfp ref="addPageSfp" refreshHandle={this.refreshHandle} /> */}
<AddPage ref="addPage" refreshHandle={this.refreshHandle} />
<UpdatePage ref="updatePage" refreshHandle={this.refreshHandle} />
<ListDetail ref="listDetail" refreshHandle={this.refreshHandle} />
<AuditPage ref="auditPage" refreshHandle={this.refreshHandle} />
</div>
);
}
}
export default injectIntl(manualDeliveryOrder, {
forwardRef: true,
});
这是控制台报错截图
回答:
传值的问题,一般出现 cannot read properties of null/undefined
都是业务代码写的有问题。
一般开启sourcemap
了的话都会在控制台输出错误在在一个js文件的第几行。
如果没有开,你进debug
模式一点一点捋下去也是可以的。
回答:
点击通过是调用this.handleAudit.bind(this,localStorage.getItem('roles').indexOf("WMS_RAW_LEADER")!=-1?"13":"12")
这个吧?localStorage里roles
这个内容存在吗?
以上是 前端react项目,代码如下,点击点击“通过”或者“驳回”按钮后,控制台报错如下,并且页面变成个大空白页? 的全部内容, 来源链接: utcz.com/p/933295.html