Commit b2869910 authored by GuanHua's avatar GuanHua
parents 5c0beb7c 8b4c208f
......@@ -2,7 +2,7 @@
* @Author: LeeJiancong
* @Date: 2020-07-22 09:54:50
* @LastEditors: LeeJiancong
* @LastEditTime: 2020-10-09 10:54:23
* @LastEditTime: 2020-10-12 18:13:49
*/
/**
* 正则表达式集合
......@@ -13,7 +13,7 @@ export const PATTERN_MAPS = {
password: /^(?=.*[a-z])(?=.*[A-Z])[a-zA-Z\d]{8,20}$/,
email: /^[\w-]+(\.[\w-]+)*@[\w-]+(\.[\w-]+)+$/,
phone: /^1[3|4|5|6|7|8|9][0-9]{9}$/,
tel: /^(0\d{2,3}-\d{7,8})(-\d{1,4})?$/,//座机
tel: /^(0\d{2,3}-\d{7,8})(-\d{1,4})?$/,//座机
smsCode: /^\d{6}$/,
money:/^\d*(?:\.\d{0,2})?$/,
weight:/^\d*(?:\.\d{0,3})?$/,
......
......@@ -2,7 +2,7 @@
* @Author: LeeJiancong
* @Date: 2020-07-15 10:31:55
* @LastEditors: LeeJiancong
* @LastEditTime: 2020-09-17 17:22:21
* @LastEditTime: 2020-10-16 14:51:25
*/
import React, { Component, useState, useEffect } from 'react';
import ReactDOM from 'react-dom'
......@@ -108,7 +108,7 @@ const diaLogForm: React.FC<ListProps> = (props) => {
PublicApi.getManageAreaByPcodeAll({ pcode: '100000' }).then(res => {
let list = []
res.data.forEach((item: any, index: number) => {
list.push({ label: item.name, value: Number(item.code) })
list.push({ label: item.name, value: item.code })
})
setProvinceList(list)
})
......@@ -141,16 +141,28 @@ const diaLogForm: React.FC<ListProps> = (props) => {
const FormSumbit = (values: any) => {
let id = history.location.query.id
let value = { ...values }
if(value.designateList.length === 1 && JSON.stringify(value.designateList[0]) === '{}'){
delete value.designateList
}
if (id == 0) {
PublicApi.postLogisticsFreightTemplateAdd(value).then(res => { })
PublicApi.postLogisticsFreightTemplateAdd(value).then(res => {
if(res.code === 1000){
setTimeout(() => {
history.goBack()
}, 1000)
}
})
} else {
value.id = Number(id)
PublicApi.postLogisticsFreightTemplateUpdate(value).then(res => { })
PublicApi.postLogisticsFreightTemplateUpdate(value).then(res => {
if(res.code === 1000){
setTimeout(() => {
history.goBack()
}, 1000)
}
})
}
setTimeout(() => {
history.goBack()
}, 1000)
}
const onSearch = () => {
......
EyePreview/*
/*
* @Author: LeeJiancong
* @Date: 2020-07-14 15:07:34
* @LastEditors: LeeJiancong
* @LastEditTime: 2020-08-19 11:03:37
* @LastEditTime: 2020-10-16 14:29:56
*/
import React, { Component, ReactNode, useRef, useState } from 'react'
import { history } from 'umi'
......
......@@ -3,7 +3,7 @@
* @Date: 2020-07-28 11:25:30
* @LastEditors: LeeJiancong
* @Copyright: 1549414730@qq.com
* @LastEditTime: 2020-09-29 11:47:41
* @LastEditTime: 2020-10-14 16:23:57
*/
import React, { Component, useEffect, useRef, useState, ReactNode } from 'react'
......@@ -49,6 +49,7 @@ import {
import ReturnEle from '@/components/ReturnEle'
import style from '../components/index.less'
import { history } from 'umi'
import moment from 'moment'
import { values, action } from 'mobx'
import Search from '@/components/NiceForm/components/Search'
const actions = createFormActions()
......@@ -180,8 +181,7 @@ const Deatail: React.FC<{}> = () => {
align: 'center',
dataIndex: 'createTime',
key: 'createTime',
render: (text, redcord) =>
<>{text}</>
render: (text: any) => <>{moment(text).format('YYYY-MM-DD HH:mm:ss')}</>
}
]
......@@ -201,32 +201,33 @@ const Deatail: React.FC<{}> = () => {
{
title: '对应订单号',
align: 'center',
dataIndex: 'id2',
key: 'id2',
dataIndex: 'invoicesNo',
key: 'invoicesNo',
},
{
title: '单据摘要',
align: 'center',
dataIndex: 'orderThe',
key: 'orderThe'
dataIndex: 'invoicesAbstract',
key: 'invoicesAbstract'
},
{
title: '对应仓库',
align: 'center',
dataIndex: '',
key: '',
dataIndex: 'inventory',
key: 'inventory',
},
{
title: '单据类型',
align: 'center',
dataIndex: '',
key: '',
dataIndex: 'invoicesType',
key: 'invoicesType',
},
{
title: '单据时间',
align: 'center',
dataIndex: 'createTime',
key: 'createTime',
dataIndex: 'transactionTime',
key: 'transactionTime',
render: (text: any) => <>{moment(text).format('YYYY-MM-DD HH:mm:ss')}</>
}
]
......@@ -273,7 +274,7 @@ const Deatail: React.FC<{}> = () => {
useEffect(() => {
let _title = pageStatus === PageStatus.PREVIEW ? '查看' : id ? '编辑' : '新建'
setHeaderTitle(`${_title}物流单`)
PublicApi.getLogisticsSelectListCompany().then(res => {
PublicApi.getLogisticsSelectListCompany({cooperateType: 1}).then(res => {
let list = []
res.data.forEach(item => {
list.push({ value: item.id, label: item.name })
......
......@@ -3,7 +3,7 @@
* @Date: 2020-08-24 11:39:11
* @LastEditors: LeeJiancong
* @Copyright: 1549414730@qq.com
* @LastEditTime: 2020-09-28 14:35:22
* @LastEditTime: 2020-10-15 15:11:34
*/
/**
* @description: 组件描述: 一级 二级 待提交报价单
......
......@@ -6,7 +6,7 @@
* @LastEditTime: 2020-09-11 16:51:28
*/
import React, { Component, useState, useEffect, Fragment } from 'react';
import { Modal, Button, Form, Radio, AutoComplete, Tabs, Input, Select, Checkbox } from 'antd'
import { Modal, Button, Form, Radio, AutoComplete, Tabs, Input, Select, Checkbox, message } from 'antd'
import { PublicApi } from '@/services/api'
const { TabPane } = Tabs
const { Option } = Select
......@@ -43,11 +43,13 @@ const comfirmDialog: React.FC<Params> = (props) => {
const [placeOfOriginList, setplaceOfOriginList] = useState([])//产地
const handleCancel = () => {
}
const handletOk = () => {
form.validateFields().then(v => {
console.log(v)
const handletOk = async () => {
try {
const v = await form.validateFields();
props.onOK(v)
})
} catch(err) {
message.error('有必填项没填写请检查!')
}
// if(props.type){
// value.type = props.type
// }
......@@ -176,14 +178,20 @@ const comfirmDialog: React.FC<Params> = (props) => {
<Form.Item
label='规格型号'
name='model'
required
rules={[{
required: true,
message: '此项为必填项'
}]}
>
<Input placeholder='' />
</Form.Item>
<Form.Item
label='商品品牌'
name='brand'
required
rules={[{
required: true,
message: '此项为必填项'
}]}
>
<Input placeholder='' />
</Form.Item>
......@@ -198,8 +206,7 @@ const comfirmDialog: React.FC<Params> = (props) => {
}
{
props.sourceData.length > 0 && props.sourceData.map((attributeItem: any) => {
console.log(attributeItem, 10086)
return(
return (
<TabPane tab={attributeItem.name} key={attributeItem.id}>
{
renderTabPanchildren(attributeItem)
......@@ -212,7 +219,10 @@ const comfirmDialog: React.FC<Params> = (props) => {
<Form.Item
label='单位'
name='purchaseNuit'
required
rules={[{
required: true,
message: '此项为必填项'
}]}
>
<Input placeholder='' />
</Form.Item>
......@@ -220,7 +230,10 @@ const comfirmDialog: React.FC<Params> = (props) => {
<Form.Item
label='采购数量'
name='purchaseQuantity'
required
rules={[{
required: true,
message: '此项为必填项'
}]}
>
<Input placeholder='' />
</Form.Item>
......
......@@ -351,7 +351,7 @@ const Detail: React.FC<{}> = () => {
PublicApi.getProductPlatformGetCategoryById({ id: seletCategoryId }).then(res => {
if (res.code === 1000) {
let data = res.data
console.log(data, 10086)
console.log(data, 10086)
settabData([data])//转成数组
let da = []
// data.forEach((item: any) => {
......@@ -531,12 +531,7 @@ const Detail: React.FC<{}> = () => {
const handleOptionBtn = (type: any) => {
switch (type) {
case 1:
if(Object.keys(tabData).length > 0) {
setdialogVisible(true)
}else{
message.error('请选择商品品类!')
}
setdialogVisible(true)
break;
case 2:
setVisibleChannelMember(true)
......@@ -609,7 +604,7 @@ const Detail: React.FC<{}> = () => {
*/
if (id) {
PublicApi.getOrderRequisitionFormDetails({ id }).then(res => {
PublicApi.getOrderRequisitionFormDetails({ id: id }).then(res => {
if (res.code === 1000) {
let data = res.data
let areaCodeList = []
......@@ -627,8 +622,8 @@ const Detail: React.FC<{}> = () => {
//品类
if (data.productCategory) {
console.log(10086, '============')
setcustomerCategoryId([data.productCategory.id])
initCreatePro(data.productCategory.id, false)//生产弹窗
setcustomerCategoryId([data.productCategory.key])
initCreatePro(data.productCategory.key, false)//生产弹窗
}
......@@ -639,7 +634,7 @@ const Detail: React.FC<{}> = () => {
tabForm.resetFields()
//需求单对接列表
PublicApi.getOrderRequisitionFormDemandDockingList({ id }).then(res => {
PublicApi.getOrderRequisitionFormDemandDockingList({ id:id }).then(res => {
if (res.code === 1000) {
let { data } = res.data
if (_plattype == 2) {//系统匹配
......@@ -929,23 +924,26 @@ const Detail: React.FC<{}> = () => {
*/
const handleSubmit = (values: any) => {
let item = {}
// Object.keys(values).forEach((key) => {
// item[key] = values[key]
// })
let list = []
//先循环所有 再循环有值的
otherList.forEach((vitem: any) => {
if (otherList.length > 0) {
otherList.forEach((vitem: any) => {
Object.keys(values).forEach((key) => {
if (vitem.title == key) {
item[key] = values[vitem.title]
} else {
item[key] = values[key]
}
})
})
} else {
Object.keys(values).forEach((key) => {
if (vitem.title == key) {
item[key] = values[vitem.title]
console.log(values, '详情页面1')
} else {
item[key] = values[key]
console.log(values, '详情页面2')
}
item[key] = values[key]
})
})
}
list.push(item)
setproductSource([...productSource, ...list])//新增就要合并
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment