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

Merge branch 'featStrategies' into dev

parents b4865765 eb6fcc97
...@@ -216,6 +216,15 @@ ...@@ -216,6 +216,15 @@
margin: 16px 16px 0; margin: 16px 16px 0;
} }
// 覆写 card padding
.ant-card-head {
padding: 0 16px;
}
.ant-card-body {
padding: 16px;
}
} }
.ant-descriptions-item-label { .ant-descriptions-item-label {
......
...@@ -416,8 +416,15 @@ const PriceAttributeForm: React.FC<Iprops> = (props) => { ...@@ -416,8 +416,15 @@ const PriceAttributeForm: React.FC<Iprops> = (props) => {
id: attributeObjArr[_index].customerAttributeId, id: attributeObjArr[_index].customerAttributeId,
name: attributeObjArr[_index].attributeName name: attributeObjArr[_index].attributeName
} }
console.log(attributeValObjArr, item, index, _item, _index, _tableDataSource, '调试属性')
_tempObject.customerAttributeValue = { _tempObject.customerAttributeValue = {
id: attributeValObjArr.map(__item => __item.find(_ => _.value===_item)).filter(__ => __)[0].id, // @fixed bug: 属性名称相同的情况下 只找第一个元素 会出现id异常
// id: attributeValObjArr.map(__item => __item.find(_ => _.value===_item)).filter(__ => __)[0].id,
id: attributeValObjArr.map((__item, __index) => {
if(_index === __index) {
return __item.find(_ => _.value===_item)
}
}).filter(__ => __)[0].id,
value: item[_index] value: item[_index]
} }
_tempArr.push(_tempObject) _tempArr.push(_tempObject)
......
...@@ -101,10 +101,10 @@ export const tableListSchema: ISchema = { ...@@ -101,10 +101,10 @@ export const tableListSchema: ISchema = {
placeholder: '请输入订单摘要', placeholder: '请输入订单摘要',
} }
}, },
"supplyMembersName": { "memberName": {
type: 'string', type: 'string',
"x-component-props": { "x-component-props": {
placeholder: '请输入供应会员名称' placeholder: '请输入采购会员名称'
} }
}, },
"type": { "type": {
......
...@@ -33,6 +33,7 @@ const OrderElectronModal:React.FC<OrderElectronModalProps> = (props) => { ...@@ -33,6 +33,7 @@ const OrderElectronModal:React.FC<OrderElectronModalProps> = (props) => {
if(type === 'saleOrder') { if(type === 'saleOrder') {
params.contractName = data.electronicContractName params.contractName = data.electronicContractName
params.contractUrl = data.electronicContractUrl params.contractUrl = data.electronicContractUrl
params.memberId = data.createMemberId
} else { } else {
params.signatureLogId = data.signatureLogId params.signatureLogId = data.signatureLogId
// params.id = parseInt(data.id) // params.id = parseInt(data.id)
......
...@@ -40,7 +40,13 @@ const TheInvoiceList = (props: ISchemaFieldComponentProps) => { ...@@ -40,7 +40,13 @@ const TheInvoiceList = (props: ISchemaFieldComponentProps) => {
// @bug todo 编辑情况下 默认显示有问题 固定第一个 // @bug todo 编辑情况下 默认显示有问题 固定第一个
// console.log(value, mode, dataSource, 'EDIT') // console.log(value, mode, dataSource, 'EDIT')
if(typeof value === 'object') { if(typeof value === 'object') {
let target = (mode === 'add' || mode === 'delete') ? dataSource[0] : value // let target = (mode === 'add' || mode === 'delete') ? dataSource[0] : value
let target = value;
if(mode === 'add' || mode === 'delete') {
target = dataSource[0]
} else if(mode === 'edit') {
target = dataSource.find(v => v.id === value.id)
}
setFieldState({ setFieldState({
dataSource, dataSource,
showMore, showMore,
...@@ -90,16 +96,17 @@ const TheInvoiceList = (props: ISchemaFieldComponentProps) => { ...@@ -90,16 +96,17 @@ const TheInvoiceList = (props: ISchemaFieldComponentProps) => {
form.setFieldValue("needTheInvoice", 0) form.setFieldValue("needTheInvoice", 0)
} }
// 订单新增 重载全部置为第一个 // 订单新增 重载全部置为第一个
let _data = data.sort((a, b) => b.id - a.id)
if(pageStatus === PageStatus.ADD) { if(pageStatus === PageStatus.ADD) {
setFieldState({ setFieldState({
dataSource: data, dataSource: _data,
showMore, showMore,
useValue: data[0], useValue: _data[0],
}) })
mutators.change(data[0]) mutators.change(_data[0])
} else if(pageStatus === PageStatus.EDIT) { } else if(pageStatus === PageStatus.EDIT) {
setFieldState({ setFieldState({
dataSource: data, dataSource: _data,
showMore, showMore,
useValue, useValue,
}) })
......
...@@ -287,23 +287,27 @@ export const useOrderUpdateChangeOther = (ctx: ISchemaFormActions | ISchemaFormA ...@@ -287,23 +287,27 @@ export const useOrderUpdateChangeOther = (ctx: ISchemaFormActions | ISchemaFormA
FormEffectHooks.onFieldValueChange$('theInvoiceId').subscribe(state => { FormEffectHooks.onFieldValueChange$('theInvoiceId').subscribe(state => {
const { value, path } = state const { value, path } = state
// console.log(state, '发票之前')
if(pageStatus === PageStatus.EDIT){ if(pageStatus === PageStatus.EDIT){
if(state?.dataSource?.length && state.loading) { if(state?.dataSource?.length && state.loading && state.props["x-component-props"].times > 2) {
ctx.submit((values) => { ctx.submit((values) => {
// console.log(values, value, path, '发票id') // console.log(values, value, path, state, '发票id')
if(values){ if(values){
PublicApi.postOrderProcurementOrderUpdate({ PublicApi.postOrderProcurementOrderUpdate({
...values, ...values,
deliveryTime: moment(values.deliveryTime).valueOf(), deliveryTime: moment(values.deliveryTime).valueOf(),
theInvoiceId: value.id, theInvoiceId: value.id,
// needTheInvoice: Number(values.needTheInvoice), needTheInvoice: Number(values.needTheInvoice),
deliveryAddresId: values.deliveryAddresId, deliveryAddresId: values.deliveryAddresId,
id, id,
}, { ctlType: "none" }) }, { ctlType: "none" })
} }
}) })
} else { } else {
ctx.setFieldState(path, _state => _state.loading = true) ctx.setFieldState(path, _state => {
_state.loading = true
_state.props["x-component-props"].times++
})
} }
} }
}) })
...@@ -311,7 +315,7 @@ export const useOrderUpdateChangeOther = (ctx: ISchemaFormActions | ISchemaFormA ...@@ -311,7 +315,7 @@ export const useOrderUpdateChangeOther = (ctx: ISchemaFormActions | ISchemaFormA
FormEffectHooks.onFieldValueChange$('deliveryAddresId').subscribe(state => { FormEffectHooks.onFieldValueChange$('deliveryAddresId').subscribe(state => {
const { value, path } = state const { value, path } = state
if(pageStatus === PageStatus.EDIT){ if(pageStatus === PageStatus.EDIT){
if(state?.dataSource?.length && state.loading) { if(state?.dataSource?.length && state.loading && state.props["x-component-props"].times > 2) {
ctx.submit((values) => { ctx.submit((values) => {
// console.log(values, value, path, '发货地址id') // console.log(values, value, path, '发货地址id')
if(values){ if(values){
...@@ -319,39 +323,19 @@ export const useOrderUpdateChangeOther = (ctx: ISchemaFormActions | ISchemaFormA ...@@ -319,39 +323,19 @@ export const useOrderUpdateChangeOther = (ctx: ISchemaFormActions | ISchemaFormA
...values, ...values,
deliveryTime: moment(values.deliveryTime).valueOf(), deliveryTime: moment(values.deliveryTime).valueOf(),
theInvoiceId: values.theInvoiceId, theInvoiceId: values.theInvoiceId,
// needTheInvoice: Number(values.needTheInvoice), needTheInvoice: Number(values.needTheInvoice),
deliveryAddresId: value?.id ? value.id : value, deliveryAddresId: value?.id ? value.id : value,
id, id,
}, { ctlType: "none" }) }, { ctlType: "none" })
} }
}) })
} else { } else {
ctx.setFieldState(path, _state => _state.loading = true) ctx.setFieldState(path, _state => {
_state.loading = true
_state.props["x-component-props"].times++
})
} }
} }
}) })
// FormEffectHooks.onFieldValueChange$('needTheInvoice').subscribe(state => {
// const { value, path } = state
// if(pageStatus === PageStatus.EDIT){
// if(state?.dataSource?.length && state.loading) {
// ctx.submit((values) => {
// console.log(values, value, path, '是否需要发票')
// if(values){
// // PublicApi.postOrderProcurementOrderUpdate({
// // ...values,
// // deliveryTime: moment(values.deliveryTime).valueOf(),
// // theInvoiceId: value.id,
// // needTheInvoice: Number(values.needTheInvoice),
// // deliveryAddresId: path.indexOf("deliveryAddresId") !== -1 ? ( value?.id ? value.id : value ) : values.deliveryAddresId,
// // id,
// // }, { ctlType: "none" })
// }
// })
// } else {
// ctx.setFieldState(path, _state => _state.loading = true)
// }
// }
// })
} }
...@@ -311,7 +311,8 @@ const submitInfo: ISchema = { ...@@ -311,7 +311,8 @@ const submitInfo: ISchema = {
} }
}, },
"x-component-props": { "x-component-props": {
dataSource: [] dataSource: [],
times: 0,
}, },
"x-rules": [ "x-rules": [
{ {
...@@ -366,6 +367,9 @@ const ortherInfo: ISchema = { ...@@ -366,6 +367,9 @@ const ortherInfo: ISchema = {
type: 'number', type: 'number',
title: ' ', title: ' ',
"x-component": "theInvoiceList", "x-component": "theInvoiceList",
"x-component-props": {
times: 0,
}
}, },
pageRequire: { pageRequire: {
type: 'string', type: 'string',
......
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