Commit c6068cff authored by 前端-钟卫鹏's avatar 前端-钟卫鹏

Merge branch 'zwpFix' into dev

parents 51797ce3 9700423b
......@@ -1034,12 +1034,12 @@ export const PurchaseOrderInsideWorkStateTexts = {
"-1": '取消订单',
0: '订单完成',
1: '待新增采购订单',
2: '一级待审核订单',
3: '二级待审核订单',
2: '待审核订单(一级)',
3: '待审核订单(二级)',
4: '待提交订单',
5: '待确认电子合同',
6: '提交一级审核订单不通过',
7: '提交二级审核订单不通过',
6: '提交审核订单不通过(一级)',
7: '提交审核订单不通过(二级)',
8: '待支付订单',
10: '支付成功',
11: '支付失败',
......@@ -1054,13 +1054,13 @@ export const PurchaseOrderInsideWorkStateTexts = {
export const SaleOrderInsideWorkStateTexts = {
0: '订单完成',
1: '待审核订单',
2: '一级待审核订单',
3: '二级待审核订单',
2: '待审核订单(一级)',
3: '待审核订单(二级)',
4: '待确认订单',
5: '待接受订单',
6: '不接受订单',
7: '提交一级审核订单不通过',
8: '提交二级审核订单不通过',
7: '提交审核订单不通过(一级)',
8: '提交审核订单不通过(二级)',
9: '不接受订单',
10: '待确认支付结果',
......@@ -1109,12 +1109,12 @@ export const PurchaseOrderTransformInsideWorkStateTexts = {
0: '订单完成',
1: '待提交审核',
2: '提交审核通过',
3: '审核通过',
4: '审核通过',
3: '审核通过(一级)',
4: '审核通过(二级)',
5: '审核通过',
6: '已确认电子合同',
7: '审核不通过',
8: '审核不通过',
7: '审核不通过(一级)',
8: '审核不通过(二级)',
9: '支付成功',
10: '支付失败',
......@@ -1130,8 +1130,8 @@ export const SaleOrderTransformInsideWorkStateTexts = {
"-1": '取消订单',
0: '完成订单',
1: '审核通过',
2: '审核通过',
3: '审核通过',
2: '审核通过(一级)',
3: '审核通过(二级)',
4: '接受订单',
5: '确认到账',
6: '已审核销售发货单',
......@@ -1140,8 +1140,8 @@ export const SaleOrderTransformInsideWorkStateTexts = {
9: '已确认回单',
10: '已归档',
11: '审核不通过',
12: '审核不通过',
11: '审核不通过(一级)',
12: '审核不通过(二级)',
13: '不接受订单',
14: '确认未到账',
15: '审核不通过',
......
......@@ -99,7 +99,7 @@ const CategoryAttributes: React.FC<{}> = () => {
const handleSelectOk = () => {
setRoleVisible(false)
setLinkLoading (true)
PublicApi.postProductCustomerSaveCustomerCategoryAttribute({ customerCategoryId: selectKey, customerAttributeIds: goodsRowCtl.selectedRowKeys }).then(res=>{
PublicApi.postProductCustomerSaveCustomerCategoryAttribute({ customerCategoryId: selectKey, customerAttributeIds: selectedTableRowKeys }).then(res=>{
setLinkLoading (false)
if(res.code === 1000)
setTimeout(() => ref.current.reload(), 500)
......@@ -107,9 +107,9 @@ const CategoryAttributes: React.FC<{}> = () => {
}
const handleSelectCancel = () => {
setRoleVisible(false)
// setSelectedTableRowKeys([])
setSelectedTableRowKeys([])
setLinkLoading (false)
goodsRowCtl.setSelectedRowKeys([])
// goodsRowCtl.setSelectedRowKeys([])
}
const columns: ColumnType<any>[] = [
......@@ -253,7 +253,8 @@ const CategoryAttributes: React.FC<{}> = () => {
linkTableRowData.forEach((item, index) => {
linkArray.push(item.id)
})
goodsRowCtl.setSelectedRowKeys([])
// goodsRowCtl.setSelectedRowKeys([])
setSelectedTableRowKeys([])
}
......
......@@ -70,7 +70,7 @@ const AddProducts: React.FC<{}> = (props) => {
brand: data.brand,
customerCategory: data.customerCategory,
slogan: data.slogan,
sellingPoint: data.sellingPoint,
sellingPoint: data.sellingPoint || [],
commodityAreaList: data.commodityAreaList,
isUpdateAttribute: data.isUpdateAttribute,
unitId: data.unitId,
......
import React, { useState, useEffect, useRef, useContext } from 'react'
import { history } from 'umi';
import { Button, Form, Select, Tabs, Input, Tooltip, Cascader, Tag, Spin } from 'antd'
import {
QuestionCircleOutlined,
PlusOutlined,
MinusOutlined,
} from '@ant-design/icons'
import { PublicApi } from '@/services/api';
import { inject, observer } from 'mobx-react'
// import { IProductModule } from '@/module/productModule'
// import { IStore } from '@/store';
import { store } from '@/store'
import { validatorByte } from '@/utils/regExp';
import { GetProductCustomerGetCustomerCategoryTreeResponse } from '@/services/ProductApi';
import { GetManageAreaAllResponse } from '@/services/PassApi';
const { Option } = Select
const layout = {
labelCol: {
span: 2,
},
wrapperCol: {
span: 12,
},
}
const layoutFormList = {
labelCol: {
span: 2,
},
wrapperCol: {
span: 14,
push: 2
},
}
interface Iprops {
onChangeAttributeList: (attributeLists:any)=> void;
onRef: (refs: any) => void;
}
interface AreaParams {
provinceCode: any;
provinceName: any;
cityCode: any;
cityName: any;
}
const BasicInfoForm: React.FC<Iprops> = (props) => {
const { onChangeAttributeList, onRef } = props
const basicFormRef = useRef()
const [basicForm] = Form.useForm()
const [brandData, setBrandData] = useState<any>([])
const [brandValue, setBrandValue] = useState(undefined)
const [customerCategoryTree, setCustomerCategoryTree] = useState<GetProductCustomerGetCustomerCategoryTreeResponse>()
const [proviceOptions, setProviceOptions] = useState<GetManageAreaAllResponse>()
const [showCategory, setShowCategory] = useState(null)
const [isUpdateAttribute, setIsUpdateAttribute] = useState<boolean>(true)
const { ProductStore } = store
const {
setAreaOption,
productInfoByEdit,
getBasicFormParamsByEdit,
setAttributeLists,
setProductName,
setSelectCategoryId,
setSelectBrandId,
} = ProductStore
useEffect(() => {
onRef(basicFormRef)
// 获取品类树
PublicApi.getProductCustomerGetCustomerCategoryTree().then(res => {
if (res.code === 1000){
// 过滤children空数组
let { data } = res
data.map(item => {
if(!item.children.length)
delete item.children
})
setCustomerCategoryTree(data)
}
})
//获取省市区
PublicApi.getManageAreaAll().then(res => {
if (res.code === 1000) {
let arr = [...res.data] //裁去最后一级别
for (let index in arr) {
for (let _index in arr[index].areaResponses) {
let o: any = arr[index].areaResponses
o[_index].areaResponses = null
}
}
setProviceOptions(arr)
setAreaOption(arr)
}
})
}, [])
useEffect(()=>{
const { id } = history.location.query
if(id && getBasicFormParamsByEdit?.name){
handleBrandSearch(getBasicFormParamsByEdit.brandName)
onCustomerCategoryChange(getBasicFormParamsByEdit.customerCategoryId)
basicForm.setFieldsValue(getBasicFormParamsByEdit)
setSelectBrandId(getBasicFormParamsByEdit.brandId)
setIsUpdateAttribute(productInfoByEdit.isUpdateAttribute)
}
}, [getBasicFormParamsByEdit])
const handleBrandSearch = (value?: any) => {
PublicApi.getProductSelectGetSelectBrand({ name: value||'' }).then(res => {
if (res.code === 1000)
setBrandData(res.data)
})
}
const handleBrandChange = (value: any) => {
setBrandValue(value)
setSelectBrandId(value)
}
const tagRender = (props) => {
const { label, value, closable, onClose } = props;
if (value?.length < 8)
return (
<Tag closable={closable} onClose={onClose} style={{ marginRight: 4, border: '1px solid #f0f0f0' }}>
{label}
</Tag>
)
}
const onCustomerCategoryChange = (value: any) => {
let seletCategoryId = value[value.length - 1]
// console.log(seletCategoryId, value, 'seleellele')
if (seletCategoryId) {
PublicApi.getProductCustomerGetCustomerCategoryById({ id: seletCategoryId }).then(res => {
const { data } = res
onChangeAttributeList(data?.customerAttributeList)
setShowCategory(data?.type)
setAttributeLists(data?.customerAttributeList)
setSelectCategoryId(seletCategoryId)
})
}
else
setShowCategory(null)
}
const onCommodityAreaChange = (value: any, selected: any) => {
let areaParams: AreaParams = {
provinceCode: null,
provinceName: null,
cityCode: null,
cityName: null,
}
if (selected.length === 2) {
areaParams.provinceName = selected[0].name
areaParams.provinceCode = selected[0].code
areaParams.cityName = selected[1].name
areaParams.cityCode = selected[1].code
}
// console.log(value, selected, areaParams, 'area')
}
const onChangeName = (value: any) => {
setProductName(value)
}
const renderCategoryType = () => {
// 1-实物商品、2-虚拟商品、3-服务商品、4-积分兑换商品
if(showCategory === 1)
return '实物商品'
else if(showCategory === 2)
return '虚拟商品'
else if(showCategory === 3)
return '服务商品'
else if(showCategory === 4)
return '积分兑换商品'
}
const checkSellingPoint = (rule, value, callback) => {
try {
if(Array.isArray(value)){
if(value.length > 3) {
throw new Error('商品卖点不能超过三个');
} else {
value.map(item => {
if(item.length > 8){
throw new Error('标签长度不超过八个字符');
}
})
callback()
}
}else{
callback()
}
} catch (err) {
callback(err)
}
}
return (<>
<Form
{...layout}
form={basicForm}
name="basic-form"
labelAlign="left"
// onFinish={onFinish}
colon={false}
ref={basicFormRef}
// initialValues={productInfoByEdit?.id ? getBasicFormParamsByEdit : {}}
autoComplete="off"
>
<Form.Item
name="customerCategoryId"
label="商品品类"
rules={[
{
required: true,
message: '请选择商品品类'
},
]}
>
<Cascader
allowClear={false}
// disabled={!isUpdateAttribute}
disabled={history.location.query?.id}
options={customerCategoryTree}
fieldNames={{ label: 'title', value: 'id', children: 'children' }}
onChange={onCustomerCategoryChange}
placeholder="请选择品类"
// notFoundContent={<Spin size="small" />}
/>
</Form.Item>
<Form.Item
name="brandId"
label="商品品牌"
// rules={[
// {
// required: true,
// message: '请选择商品品牌'
// }
// ]}
>
<Select
disabled={!isUpdateAttribute}
showSearch={true}
showArrow={true}
placeholder="请输入或选择商品品牌"
allowClear
value={brandValue}
defaultActiveFirstOption={false}
filterOption={false}
onSearch={handleBrandSearch}
onChange={handleBrandChange}
onFocus={()=>handleBrandSearch(null)}
style={{ width: '100%' }}
>
{brandData.map(d => <Option value={d.id} key={d.id}>{d.name}</Option>)}
</Select>
</Form.Item>
<Form.Item
name="name"
label={
<span>
商品名称&nbsp;
<Tooltip title="商品名称规范:品牌名(中文|英文)+产品名称(款式|系列)+附加产品特点+货号,最多输入45字">
<QuestionCircleOutlined />
</Tooltip>
</span>
}
rules={[
{
required: true,
message: '商品名称'
},
{
validator: (r, v, c) => validatorByte(r, v, c, 90)
}
]}
>
<Input placeholder="商品名称" onBlur={e =>onChangeName(e.target.value)}/>
</Form.Item>
<Form.Item
name="slogan"
label={
<span>
商品标语&nbsp;
<Tooltip title="商品的宣传用语,最多输入45字">
<QuestionCircleOutlined />
</Tooltip>
</span>
}
rules={[
// {
// required: true,
// message: '请填入商品标语'
// },
{
validator: (r, v, c) => validatorByte(r, v, c, 90)
}
]}
>
<Input placeholder="请输入商品标语" />
</Form.Item>
<Form.Item
name="sellingPoint"
label={
<span>
商品卖点&nbsp;
<Tooltip title="商品的卖点,展示在商品名称与商品标语之后,最多每个卖点输入8字">
<QuestionCircleOutlined />
</Tooltip>
</span>
}
rules={[
{
validator: checkSellingPoint
},
]}
>
<Select
mode="tags"
placeholder="请输入并选择商品卖点"
maxTagCount={3}
maxTagTextLength={8}
tagRender={tagRender}
/>
</Form.Item>
<Form.List name="commodityAreaList">
{(fields: any[], { add, remove }: any) => {
if (!fields.length) {
add()
}
return (
<div>
{fields.map((field, index) => (
<Form.Item
{...(index === 0 ? layout : layoutFormList)}
label={
field.key === 0 && <span>
归属地市&nbsp;
<Tooltip title="设置了归属地市后,此商品可根据地市进行筛选,未设置时默认为所有地市">
<QuestionCircleOutlined />
</Tooltip>
</span>
}
// rules={[
// {
// required: true,
// message: '请选择地区'
// }
// ]}
key={field.key}
>
<Form.Item
{...field}
// rules={[
// {
// required: true,
// message: "请选择地区",
// },
// ]}
noStyle
>
<Cascader
options={proviceOptions}
changeOnSelect
onChange={onCommodityAreaChange}
placeholder="请选择地区"
fieldNames={{ label: 'name', value: 'code', children: 'areaResponses' }}
style={index === 0 ? { width: '90%' } : { width: '80%' }}
notFoundContent={<Spin size="small" />}
/>
</Form.Item>
<Button size='small' onClick={() => add()} icon={<PlusOutlined />} style={{ margin: '0 12px' }} />
{field.key > 0 && (<Button size='small' onClick={() => remove(field.name)} icon={<MinusOutlined />} />)}
</Form.Item>
))}
</div>
)
}}
</Form.List>
<Form.Item
label='品类类型'
>
{showCategory && <><span className="commonStatusValid"></span>{renderCategoryType()}</>}
</Form.Item>
</Form>
</>)
}
export default observer(BasicInfoForm)
\ No newline at end of file
import React, { useState, useEffect, useRef, useContext } from 'react'
import { history } from 'umi';
import { Button, Form, Select, Tabs, Input, Tooltip, Cascader, Tag, Spin } from 'antd'
import {
QuestionCircleOutlined,
PlusOutlined,
MinusOutlined,
} from '@ant-design/icons'
import { PublicApi } from '@/services/api';
import { inject, observer } from 'mobx-react'
// import { IProductModule } from '@/module/productModule'
// import { IStore } from '@/store';
import { store } from '@/store'
import { validatorByte } from '@/utils/regExp';
import { GetProductCustomerGetCustomerCategoryTreeResponse } from '@/services/ProductApi';
import { GetManageAreaAllResponse } from '@/services/PassApi';
const { Option } = Select
const layout = {
labelCol: {
span: 2,
},
wrapperCol: {
span: 12,
},
}
const layoutFormList = {
labelCol: {
span: 2,
},
wrapperCol: {
span: 14,
push: 2
},
}
interface Iprops {
onChangeAttributeList: (attributeLists:any)=> void;
onRef: (refs: any) => void;
}
interface AreaParams {
provinceCode: any;
provinceName: any;
cityCode: any;
cityName: any;
}
const BasicInfoForm: React.FC<Iprops> = (props) => {
const { onChangeAttributeList, onRef } = props
const basicFormRef = useRef()
const [basicForm] = Form.useForm()
const [brandData, setBrandData] = useState<any>([])
const [brandValue, setBrandValue] = useState(undefined)
const [customerCategoryTree, setCustomerCategoryTree] = useState<GetProductCustomerGetCustomerCategoryTreeResponse>()
const [proviceOptions, setProviceOptions] = useState<GetManageAreaAllResponse>()
const [showCategory, setShowCategory] = useState(null)
const [isUpdateAttribute, setIsUpdateAttribute] = useState<boolean>(true)
const { ProductStore } = store
const {
setAreaOption,
productInfoByEdit,
getBasicFormParamsByEdit,
setAttributeLists,
setProductName,
setSelectCategoryId,
setSelectBrandId,
} = ProductStore
useEffect(() => {
onRef(basicFormRef)
// 获取品类树
PublicApi.getProductCustomerGetCustomerCategoryTree().then(res => {
if (res.code === 1000){
// 过滤children空数组
let { data } = res
data.map(item => {
if(!item.children.length)
delete item.children
})
setCustomerCategoryTree(data)
}
})
//获取省市区
PublicApi.getManageAreaAll().then(res => {
if (res.code === 1000) {
let arr = [...res.data] //裁去最后一级别
for (let index in arr) {
for (let _index in arr[index].areaResponses) {
let o: any = arr[index].areaResponses
o[_index].areaResponses = null
}
}
setProviceOptions(arr)
setAreaOption(arr)
}
})
}, [])
useEffect(()=>{
const { id } = history.location.query
if(id && getBasicFormParamsByEdit?.name){
handleBrandSearch(getBasicFormParamsByEdit.brandName)
onCustomerCategoryChange(getBasicFormParamsByEdit.customerCategoryId)
basicForm.setFieldsValue(getBasicFormParamsByEdit)
setSelectBrandId(getBasicFormParamsByEdit.brandId)
setIsUpdateAttribute(productInfoByEdit.isUpdateAttribute)
}
}, [getBasicFormParamsByEdit])
const handleBrandSearch = (value?: any) => {
PublicApi.getProductSelectGetSelectBrand({ name: value||'' }).then(res => {
if (res.code === 1000)
setBrandData(res.data)
})
}
const handleBrandChange = (value: any) => {
setBrandValue(value)
setSelectBrandId(value)
}
const tagRender = (props) => {
const { label, value, closable, onClose } = props;
if (value?.length < 8)
return (
<Tag closable={closable} onClose={onClose} style={{ marginRight: 4, border: '1px solid #f0f0f0' }}>
{label}
</Tag>
)
}
const onCustomerCategoryChange = (value: any) => {
let seletCategoryId = value[value.length - 1]
if (seletCategoryId) {
PublicApi.getProductCustomerGetCustomerCategoryById({ id: seletCategoryId }).then(res => {
const { data } = res
onChangeAttributeList(data?.customerAttributeList)
setShowCategory(data?.type)
setAttributeLists(data?.customerAttributeList)
setSelectCategoryId(seletCategoryId)
})
}
else
setShowCategory(null)
}
const onCommodityAreaChange = (value: any, selected: any) => {
let areaParams: AreaParams = {
provinceCode: null,
provinceName: null,
cityCode: null,
cityName: null,
}
if (selected.length === 2) {
areaParams.provinceName = selected[0].name
areaParams.provinceCode = selected[0].code
areaParams.cityName = selected[1].name
areaParams.cityCode = selected[1].code
}
// console.log(value, selected, areaParams, 'area')
}
const onChangeName = (value: any) => {
setProductName(value)
}
const renderCategoryType = () => {
// 1-实物商品、2-虚拟商品、3-服务商品、4-积分兑换商品
if(showCategory === 1)
return '实物商品'
else if(showCategory === 2)
return '虚拟商品'
else if(showCategory === 3)
return '服务商品'
else if(showCategory === 4)
return '积分兑换商品'
}
const checkSellingPoint = (rule, value, callback) => {
try {
if(Array.isArray(value)){
if(value.length > 3) {
throw new Error('商品卖点不能超过三个');
} else {
value.map(item => {
if(item.length > 8){
throw new Error('标签长度不超过八个字符');
}
})
callback()
}
}else{
callback()
}
} catch (err) {
callback(err)
}
}
return (<>
<Form
{...layout}
form={basicForm}
name="basic-form"
labelAlign="left"
// onFinish={onFinish}
colon={false}
ref={basicFormRef}
// initialValues={productInfoByEdit?.id ? getBasicFormParamsByEdit : {}}
autoComplete="off"
>
<Form.Item
name="customerCategoryId"
label="商品品类"
rules={[
{
required: true,
message: '请选择商品品类'
},
]}
>
<Cascader
allowClear={false}
// disabled={!isUpdateAttribute}
disabled={history.location.query?.id}
options={customerCategoryTree}
fieldNames={{ label: 'title', value: 'id', children: 'children' }}
onChange={onCustomerCategoryChange}
placeholder="请选择品类"
// notFoundContent={<Spin size="small" />}
/>
</Form.Item>
<Form.Item
name="brandId"
label="商品品牌"
// rules={[
// {
// required: true,
// message: '请选择商品品牌'
// }
// ]}
>
<Select
disabled={!isUpdateAttribute}
showSearch={true}
showArrow={true}
placeholder="请输入或选择商品品牌"
allowClear
value={brandValue}
defaultActiveFirstOption={false}
filterOption={false}
onSearch={handleBrandSearch}
onChange={handleBrandChange}
onFocus={()=>handleBrandSearch(null)}
style={{ width: '100%' }}
>
{brandData.map(d => <Option value={d.id} key={d.id}>{d.name}</Option>)}
</Select>
</Form.Item>
<Form.Item
name="name"
label={
<span>
商品名称&nbsp;
<Tooltip title="商品名称规范:品牌名(中文|英文)+产品名称(款式|系列)+附加产品特点+货号,最多输入45字">
<QuestionCircleOutlined />
</Tooltip>
</span>
}
rules={[
{
required: true,
message: '商品名称'
},
{
validator: (r, v, c) => validatorByte(r, v, c, 90)
}
]}
>
<Input placeholder="商品名称" onBlur={e =>onChangeName(e.target.value)}/>
</Form.Item>
<Form.Item
name="slogan"
label={
<span>
商品标语&nbsp;
<Tooltip title="商品的宣传用语,最多输入45字">
<QuestionCircleOutlined />
</Tooltip>
</span>
}
rules={[
// {
// required: true,
// message: '请填入商品标语'
// },
{
validator: (r, v, c) => validatorByte(r, v, c, 90)
}
]}
>
<Input placeholder="请输入商品标语" />
</Form.Item>
<Form.Item
name="sellingPoint"
label={
<span>
商品卖点&nbsp;
<Tooltip title="商品的卖点,展示在商品名称与商品标语之后,最多每个卖点输入8字">
<QuestionCircleOutlined />
</Tooltip>
</span>
}
rules={[
{
validator: checkSellingPoint
},
]}
>
<Select
mode="tags"
placeholder="请输入并选择商品卖点"
maxTagCount={3}
maxTagTextLength={8}
tagRender={tagRender}
/>
</Form.Item>
<Form.List name="commodityAreaList">
{(fields: any[], { add, remove }: any) => {
if (!fields.length) {
add()
}
return (
<div>
{fields.map((field, index) => (
<Form.Item
{...(index === 0 ? layout : layoutFormList)}
label={
field.key === 0 && <span>
归属地市&nbsp;
<Tooltip title="设置了归属地市后,此商品可根据地市进行筛选,未设置时默认为所有地市">
<QuestionCircleOutlined />
</Tooltip>
</span>
}
// rules={[
// {
// required: true,
// message: '请选择地区'
// }
// ]}
key={field.key}
>
<Form.Item
{...field}
// rules={[
// {
// required: true,
// message: "请选择地区",
// },
// ]}
noStyle
>
<Cascader
options={proviceOptions}
changeOnSelect
onChange={onCommodityAreaChange}
placeholder="请选择地区"
fieldNames={{ label: 'name', value: 'code', children: 'areaResponses' }}
style={index === 0 ? { width: '90%' } : { width: '80%' }}
notFoundContent={<Spin size="small" />}
/>
</Form.Item>
<Button size='small' onClick={() => add()} icon={<PlusOutlined />} style={{ margin: '0 12px' }} />
{field.key > 0 && (<Button size='small' onClick={() => remove(field.name)} icon={<MinusOutlined />} />)}
</Form.Item>
))}
</div>
)
}}
</Form.List>
<Form.Item
label='品类类型'
>
{showCategory && <><span className="commonStatusValid"></span>{renderCategoryType()}</>}
</Form.Item>
</Form>
</>)
}
export default observer(BasicInfoForm)
......@@ -109,14 +109,14 @@ const OrderMergeInfo: React.FC<OrderMergeInfoProps> = (props) => {
</Row>
<Modal title="发票信息" visible={isModalVisible} onOk={()=>setIsModalVisible(false)} onCancel={()=>setIsModalVisible(false)}>
<Row gutter={[0 ,10]} style={{fontSize: 14}}>
<Col span={4}>开具类型:</Col><Col span={20}>{theInvoiceInfo?.type === 1 ? "企业" : "个人"}</Col>
<Col span={4}>发票种类:</Col><Col span={20}>{theInvoiceInfo?.kind === 1 ? "增值税普通发票" : "增值税专用发票"}</Col>
<Col span={4}>发票抬头:</Col><Col span={20}>{theInvoiceInfo?.invoiceTitle}</Col>
<Col span={4}>纳税号:</Col><Col span={20}>{theInvoiceInfo?.taxNo}</Col>
<Col span={4}>开户行:</Col><Col span={20}>{theInvoiceInfo?.bankOfDeposit}</Col>
<Col span={4}>账号:</Col><Col span={20}>{theInvoiceInfo?.account}</Col>
<Col span={4}>地址:</Col><Col span={20}>{theInvoiceInfo?.addres}</Col>
<Col span={4}>电话:</Col><Col span={20}>{theInvoiceInfo?.tel}</Col>
<Col span={4} style={{fontSize: 12, color: "#909399"}}>开具类型:</Col><Col span={20}>{theInvoiceInfo?.type === 1 ? "企业" : "个人"}</Col>
<Col span={4} style={{fontSize: 12, color: "#909399"}}>发票种类:</Col><Col span={20}>{theInvoiceInfo?.kind === 1 ? "增值税普通发票" : "增值税专用发票"}</Col>
<Col span={4} style={{fontSize: 12, color: "#909399"}}>发票抬头:</Col><Col span={20}>{theInvoiceInfo?.invoiceTitle}</Col>
<Col span={4} style={{fontSize: 12, color: "#909399"}}>纳税号:</Col><Col span={20}>{theInvoiceInfo?.taxNo}</Col>
<Col span={4} style={{fontSize: 12, color: "#909399"}}>开户行:</Col><Col span={20}>{theInvoiceInfo?.bankOfDeposit}</Col>
<Col span={4} style={{fontSize: 12, color: "#909399"}}>账号:</Col><Col span={20}>{theInvoiceInfo?.account}</Col>
<Col span={4} style={{fontSize: 12, color: "#909399"}}>地址:</Col><Col span={20}>{theInvoiceInfo?.addres}</Col>
<Col span={4} style={{fontSize: 12, color: "#909399"}}>电话:</Col><Col span={20}>{theInvoiceInfo?.tel}</Col>
</Row>
</Modal>
</>
......
......@@ -171,7 +171,7 @@ const OrderPayModal: React.FC<OrderPayModalProps> = (props) => {
const handleConfirm = () => {
if (current === 0) {
if (checked.id) {
if (checked?.id) {
if (checked.id === 5) { // 线下支付
setCurrent(1)
setPayStep(1)
......@@ -321,6 +321,12 @@ const OrderPayModal: React.FC<OrderPayModalProps> = (props) => {
}
} else {
setCode('')
// 支付密码未设置
if(res.code === 33334) {
setTimeout(() => {
history.push('/memberCenter/systemSetting/accountSetting/paycode')
}, 1000)
}
}
}
......
......@@ -264,30 +264,13 @@ export const useElectronicContract = (ctx: ISchemaFormActions | ISchemaFormAsync
fetchOrderApi.getOrderWorkFlow(params).then(data => {
// 简单流程并使用电子合同 强行启用电子合同
if(data["processEnum"] === 24 && data["isElectronicContract"]) {
ctx.setFieldState("usingElectronicContracts", state => {
state.visible = true
})
ctx.setFieldValue("usingElectronicContracts", 1)
ctx.setFieldValue("electronicContractId", data['electronicContractId'])
ctx.setFieldValue("processEnum", data["processEnum"])
} else {
ctx.setFieldState("usingElectronicContracts", state => {
state.visible = false
})
}
if(data['electronicContractId']) {
fetchOrderApi.createContract({
contractTemplateId: data['electronicContractId'],
signMemberId: params['memberId'],
signRoleId: params['memberRoleId'],
quotationNo: ctx.getFieldValue("quotationNo"),
orderProductRequests: ctx.getFieldValue('orderProductRequests'),
orderModel: ctx.getFieldValue('orderModel'),
deliveryAddresId: ctx.getFieldValue('deliveryAddresId'),
}).then(_data => {
ctx.setFieldState("usingElectronicContracts", state => {
state.props["x-component-props"].contract = { contractTemplateId: data['electronicContractId'], ..._data, }
})
ctx.setFieldValue("electronicContractName", _data?.contractName)
})
ctx.setFieldValue("usingElectronicContracts", 0)
ctx.setFieldValue("electronicContractId", null)
ctx.setFieldValue("processEnum", data["processEnum"])
}
})
}
......
......@@ -32,6 +32,7 @@ import { ReadyAddOrderDetailContext } from '../context'
import AuditProcess from '@/components/AuditProcess'
import styles from './index.less'
import SimpleElectronModal from './components/simpleElectronModal'
import { fetchOrderApi } from './apis'
export interface PurchaseOrderDetailProps {}
......@@ -186,11 +187,42 @@ const PurchaseOrderDetail:React.FC<PurchaseOrderDetailProps> = (props) => {
}, [])
const handleSubmit = async (value) => {
let processEnum = addSchemaAction.getFieldValue('processEnum')
let usingElectronicContracts = addSchemaAction.getFieldValue('usingElectronicContracts')
let signatureLogId = addSchemaAction.getFieldValue("signatureLogId")
let _orderProductRequests = JSON.parse(JSON.stringify(value.orderProductRequests))
let processEnum = value['processEnum']
let usingElectronicContracts = value['usingElectronicContracts']
let signatureLogId = value["signatureLogId"]
let electronicContractId = value['electronicContractId']
if(processEnum === 24 && usingElectronicContracts && !signatureLogId) {
contractRef.current.setVisible(true)
setBtnLoading(true)
// 生成并签署合同
if(electronicContractId) {
fetchOrderApi.createContract({
contractTemplateId: electronicContractId,
signMemberId:value['supplyMembersId'],
signRoleId: value['supplyMembersRoleId'],
quotationNo: value["quotationNo"],
orderProductRequests: _orderProductRequests.map(v => {
v.price = 1
v.isMemberPrice = Number(v.isMemberPrice)
v.memberPrice = v.memberPrice
v.imgUrl = v.mainPic ? v.mainPic : v.imgUrl
v.minOrder = v.minOrder
v.channelProductId = v?.commodityUnitPriceAndPicId
return v
}),
orderModel: value['orderModel'],
deliveryAddresId: value['deliveryAddresId']["id"],
}).then(_data => {
setBtnLoading(false)
if(_data?.contractName) {
addSchemaAction.setFieldState("usingElectronicContracts", state => {
state.props["x-component-props"].contract = { contractTemplateId: electronicContractId, ..._data, }
})
addSchemaAction.setFieldValue("electronicContractName", _data?.contractName)
contractRef.current.setVisible(true)
}
})
}
return ;
}
......@@ -203,7 +235,6 @@ const PurchaseOrderDetail:React.FC<PurchaseOrderDetailProps> = (props) => {
switch (page_type) {
case '0': {
// 新增订单/编辑订单
let _orderProductRequests = JSON.parse(JSON.stringify(value.orderProductRequests))
const params = {
...value,
deliveryTime: moment(value.deliveryTime).valueOf(),
......@@ -215,6 +246,7 @@ const PurchaseOrderDetail:React.FC<PurchaseOrderDetailProps> = (props) => {
v.memberPrice = v.memberPrice
v.imgUrl = v.mainPic ? v.mainPic : v.imgUrl
v.minOrder = v.minOrder
v.channelProductId = v?.commodityUnitPriceAndPicId
// v.productId = v.id
// v.productName = v.name
// v.category = v.customerCategoryName
......
......@@ -343,18 +343,18 @@ const ortherInfo: ISchema = {
wrapperCol: 10
},
properties: {
usingElectronicContracts: {
type: "number",
title: "{{help('电子合同','勾选则表示同意签署电子合同,电子合同和纸质合同一样具备同等法律效力')}}",
"x-component-props": {
// disabled: true,
contract: {},
},
"x-component": "selectContract",
// default: true,
required: true,
visible: false,
},
// usingElectronicContracts: {
// type: "number",
// title: "{{help('电子合同','勾选则表示同意签署电子合同,电子合同和纸质合同一样具备同等法律效力')}}",
// "x-component-props": {
// // disabled: true,
// contract: {},
// },
// "x-component": "selectContract",
// // default: true,
// required: true,
// visible: false,
// },
needTheInvoice: {
type: 'number',
"x-component": 'CheckboxSingle',
......@@ -435,6 +435,19 @@ const ortherInfo: ISchema = {
title: '合同Name',
visible: false
},
usingElectronicContracts: {
type: "number",
title: '使用电子合同',
"x-component-props": {
contract: {},
},
visible: false
},
electronicContractId: {
type: "number",
title: '电子合同ID',
visible: false
}
}
}
}
......
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