Commit 058f4fe7 by Joey

feat(@gms/gms-plugin-billexpand): 支持驳回的单据重新保存

parent c4254cf2
import { getUUID } from "../query-actions/util/lib";
export default {
execute: function (bill, param) {
if (bill) {
const masterData = bill.getMasterData()
// 驳回状态
// 此时保存创建一张新单据
if (masterData.getValue('billState') == 91) {
;[
'billCode',
'billState',
'flowFinishTime',
'flowProcessId',
'flowState',
'flowSubmitTime',
'orgCode',
'createTime',
'modifyTime',
].forEach((key) => {
if (masterData.getValue(key))
masterData.setValue(key, '')
bill.billdata.masterFiled[key] = ''
})
masterData.setValue('orgId', '00000000-0000-0000-000000000000')
masterData.setValue('recver', 0)
masterData.setValue('id', getUUID())
}
bill.runFormulaCheckData(param, function (msg) {
if (msg.length == 0) {
let postData = {
actions: "bill.Basic.save"
}
bill.setControlsSate(param["_control_name_"], 'enable', false)
bill.executeServerAction(postData, function (code, data) {
bill.setControlsSate(param["_control_name_"], 'enable', true)
if (code === 200) {
const id = data.content.billData.id
GMS.vbus.$emit('change-form-state', { state: 'readOnly', billId: id})
GMS.vbus.$emit('change-form-state', { state: 'readOnly', billId: id })
GMS.vbus.$Message.success("保存成功");
} else if (code === 201) {
GMS.vbus.$Message.error(data.message);
......
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