1234567891011121314151617181920212223242526272829 |
- import { message } from 'ant-design-vue'
- import XmSingleDataService from './xm-single-data-service'
- export default function({ button, eventScript, context: { args, dataList, fieldInfos } }) {
- return new Promise((resolve) => {
- const wid = fieldInfos?.find((item) => item.name === 'id').value
- const projectId = fieldInfos?.find((item) => item.name === 'PROJECT_ID').value
- if (wid) {
- // 调用接口
- const param = []
- param.push(wid)
- XmSingleDataService.againFlow(param, projectId)
- .then((res) => {
- if (res.status === 200) {
- message.success('重新起草成功')
- resolve()
- // 刷新
- setTimeout(() => {
- dataList.refresh()
- }, 1000)
- }
- })
- .catch((e) => {
- message.error('重新起草失败,请联系管理员')
- resolve()
- })
- }
- })
- }
|