|
@@ -77,7 +77,6 @@ class CurrencyDetail extends Component {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
componentDidMount () {
|
|
componentDidMount () {
|
|
|
- document.title = '新增单据'
|
|
|
|
|
this.props.onRef && this.props.onRef(this)
|
|
this.props.onRef && this.props.onRef(this)
|
|
|
const { userState, match, master, caller, id } = this.props
|
|
const { userState, match, master, caller, id } = this.props
|
|
|
mMaster = match ? match.params.master :
|
|
mMaster = match ? match.params.master :
|
|
@@ -454,8 +453,6 @@ class CurrencyDetail extends Component {
|
|
|
nodeId: nodeId,
|
|
nodeId: nodeId,
|
|
|
master: mMaster,
|
|
master: mMaster,
|
|
|
_noc: 1,
|
|
_noc: 1,
|
|
|
- }, {
|
|
|
|
|
- // 'Cookie': 'JSESSIONID=' + mSessionId
|
|
|
|
|
}).then(response => {
|
|
}).then(response => {
|
|
|
Toast.hide()
|
|
Toast.hide()
|
|
|
message.success('指定审批人成功')
|
|
message.success('指定审批人成功')
|
|
@@ -535,16 +532,13 @@ class CurrencyDetail extends Component {
|
|
|
titleBillModel.type = TYPE_TITLE
|
|
titleBillModel.type = TYPE_TITLE
|
|
|
if (billGroup.isForm == true) {
|
|
if (billGroup.isForm == true) {
|
|
|
titleBillModel.caption = billGroup.group
|
|
titleBillModel.caption = billGroup.group
|
|
|
- titleBillModel.allowBlank = 'F'
|
|
|
|
|
-
|
|
|
|
|
|
|
+ titleBillModel.allowBlank = false
|
|
|
} else {
|
|
} else {
|
|
|
if (gridStartIndex === -1) {
|
|
if (gridStartIndex === -1) {
|
|
|
gridStartIndex = g
|
|
gridStartIndex = g
|
|
|
}
|
|
}
|
|
|
titleBillModel.caption = `明细${g - gridStartIndex + 1}`
|
|
titleBillModel.caption = `明细${g - gridStartIndex + 1}`
|
|
|
- titleBillModel.allowBlank = billGroup.isDeleteAble == true
|
|
|
|
|
- ? 'T'
|
|
|
|
|
- : 'F'
|
|
|
|
|
|
|
+ titleBillModel.allowBlank = billGroup.isDeleteAble
|
|
|
}
|
|
}
|
|
|
if (!isObjEmpty(titleBillModel.caption)) {
|
|
if (!isObjEmpty(titleBillModel.caption)) {
|
|
|
formItems.push(
|
|
formItems.push(
|
|
@@ -840,32 +834,29 @@ class CurrencyDetail extends Component {
|
|
|
return
|
|
return
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- console.log('form', JSON.stringify(formStore))
|
|
|
|
|
- console.log('grid', JSON.stringify(gridStoreList))
|
|
|
|
|
Toast.loading('单据提交中', 0)
|
|
Toast.loading('单据提交中', 0)
|
|
|
- fetchPostForm(_baseURL + (mId <= 0
|
|
|
|
|
- ? '/uapproval/common/commonSaveAndSubmit.action'
|
|
|
|
|
- : '/uapproval/common/commonUpdate.action'), {
|
|
|
|
|
|
|
+ fetchPostObj(API.SERVICES_COMMONSAVEANDSUBMITORDER, {
|
|
|
caller: mCaller,
|
|
caller: mCaller,
|
|
|
keyid: mId,
|
|
keyid: mId,
|
|
|
- id: mId,
|
|
|
|
|
formStore: JSON.stringify(formStore),
|
|
formStore: JSON.stringify(formStore),
|
|
|
gridStore: JSON.stringify(gridStoreList),
|
|
gridStore: JSON.stringify(gridStoreList),
|
|
|
}).then(response => {
|
|
}).then(response => {
|
|
|
Toast.hide()
|
|
Toast.hide()
|
|
|
- if (response && response.success == true) {
|
|
|
|
|
|
|
+ if (response && response.data && response.success == true) {
|
|
|
this.setState({
|
|
this.setState({
|
|
|
promptAble: false,
|
|
promptAble: false,
|
|
|
})
|
|
})
|
|
|
- let nodeid = response.nodeId
|
|
|
|
|
|
|
+ const data = response.data
|
|
|
|
|
+
|
|
|
|
|
+ let nodeid = data.nodeId
|
|
|
if (nodeid == -1) {
|
|
if (nodeid == -1) {
|
|
|
message.success('单据提交成功')
|
|
message.success('单据提交成功')
|
|
|
- this.props.history.goBack()
|
|
|
|
|
|
|
+ this.toApprovalDetail(nodeid)
|
|
|
} else {
|
|
} else {
|
|
|
if (mId <= 0) {
|
|
if (mId <= 0) {
|
|
|
- mId = response[mKeyField] || response.keyvalue
|
|
|
|
|
- let formcode = response.formcode
|
|
|
|
|
- let isSave = response.isSave
|
|
|
|
|
|
|
+ mId = data[mKeyField] || data.keyvalue
|
|
|
|
|
+ let formcode = data.formcode
|
|
|
|
|
+ let isSave = data.isSave
|
|
|
if (isSave == true || isSave == 'true') {
|
|
if (isSave == true || isSave == 'true') {
|
|
|
this.toApprovalDetail(nodeid)
|
|
this.toApprovalDetail(nodeid)
|
|
|
} else {
|
|
} else {
|
|
@@ -896,14 +887,9 @@ class CurrencyDetail extends Component {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- toApprovalDetail (nodeid) {
|
|
|
|
|
- if (!isObjEmpty(nodeid)) {
|
|
|
|
|
- this.props.history.replace('/approval/%7B%22' +
|
|
|
|
|
- 'master%22%3A%22' + mMaster
|
|
|
|
|
- + '%22%2C%22nodeId%22%3A' + nodeid
|
|
|
|
|
- + '%2C%22type%22%3A' + 2
|
|
|
|
|
- + '%2C%22baseUrl%22%3A%22' + encodeURIComponent(_baseURL)
|
|
|
|
|
- + '%22%7D')
|
|
|
|
|
|
|
+ toApprovalDetail () {
|
|
|
|
|
+ if (!isObjEmpty(mId)) {
|
|
|
|
|
+ this.props.submitSuccess && this.props.submitSuccess(mId)
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -972,9 +958,7 @@ class CurrencyDetail extends Component {
|
|
|
continue
|
|
continue
|
|
|
}
|
|
}
|
|
|
if (isObjEmpty(this.getValue(billModel)) &&
|
|
if (isObjEmpty(this.getValue(billModel)) &&
|
|
|
- billModel.isdefault &&
|
|
|
|
|
- (billModel.allowBlank === 'necessaryField'
|
|
|
|
|
- || billModel.allowBlank === 'F')) {
|
|
|
|
|
|
|
+ billModel.isdefault && !billModel.allowBlank) {
|
|
|
message.error(`${billModel.caption}为必填项`)
|
|
message.error(`${billModel.caption}为必填项`)
|
|
|
return null
|
|
return null
|
|
|
}
|
|
}
|
|
@@ -998,9 +982,7 @@ class CurrencyDetail extends Component {
|
|
|
for (let j = 0; j < gridFields.length; j++) {
|
|
for (let j = 0; j < gridFields.length; j++) {
|
|
|
let billModel = gridFields[j]
|
|
let billModel = gridFields[j]
|
|
|
if (isObjEmpty(this.getValue(billModel))
|
|
if (isObjEmpty(this.getValue(billModel))
|
|
|
- && billModel.isdefault
|
|
|
|
|
- && (billModel.allowBlank === 'necessaryField'
|
|
|
|
|
- || billModel.allowBlank === 'F')) {
|
|
|
|
|
|
|
+ && billModel.isdefault && !billModel.allowBlank) {
|
|
|
message.error(`${billModel.caption}为必填项`)
|
|
message.error(`${billModel.caption}为必填项`)
|
|
|
return null
|
|
return null
|
|
|
}
|
|
}
|
|
@@ -1377,9 +1359,7 @@ class CurrencyDetail extends Component {
|
|
|
gridStartIndex = i
|
|
gridStartIndex = i
|
|
|
}
|
|
}
|
|
|
titleBillModel.caption = `明细${i - gridStartIndex + 1}`
|
|
titleBillModel.caption = `明细${i - gridStartIndex + 1}`
|
|
|
- titleBillModel.allowBlank = groupModel.isDeleteAble == true
|
|
|
|
|
- ? 'T'
|
|
|
|
|
- : 'F'
|
|
|
|
|
|
|
+ titleBillModel.allowBlank = groupModel.isDeleteAble
|
|
|
mShowBillModels.push(titleBillModel)
|
|
mShowBillModels.push(titleBillModel)
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|