1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
| <template>
| <a-modal
| :title="title"
| :width="1200"
| :visible="visible"
| :confirmLoading="confirmLoading"
| @ok="handleOk"
| @cancel="handleCancel"
| >
| <a-spin :spinning="confirmLoading">
| <a-form-model ref="form" :label-col="labelCol" :wrapper-col="wrapperCol" :model="model" :rules="validatorRules">
| <!-- 主表单区域 -->
| <a-row class="form-row" :gutter="6">
| <a-col :lg="24">
| <a-form-model-item label="变更" prop="bgsx">
| <a-textarea
| v-model="model.bgsx"
| placeholder="Controlled autosize"
| :auto-size="{ minRows: 6, maxRows: 10 }"
| />
| </a-form-model-item>
| </a-col>
| </a-row>
| </a-form-model>
| </a-spin>
|
| <!-- 选择用户 -->
| </a-modal>
| </template>
|
| <script>
| import { postAction, putAction } from '@/api/manage'
|
| export default {
| name: 'ProjectModal7',
| data() {
| return {
| title: '修改变更',
| visible: false,
| form: this.$form.createForm(this),
| userIds: 'admin',
| model: {},
| labelCol: {
| xs: { span: 24 },
| sm: { span: 5 },
| },
| wrapperCol: {
| xs: { span: 24 },
| sm: { span: 16 },
| },
| confirmLoading: false,
| validatorRules: {
| bgsx: [{ required: true, message: '变更事项不能为空', trigger: 'blur' }],
| },
| url: {
| add: '/pro/summary/add',
| },
| }
| },
| created() {},
| watch: {},
| methods: {
| edit(record) {
| this.form.resetFields()
| this.visible = true
| //数据类型为变更
| record.type = 2
| this.model = Object.assign({}, record)
| },
|
| handleCancel() {
| this.close()
| },
| handleOk() {
| let that = this
| this.$refs.form.validate((valid) => {
| if (valid) {
| that.confirmLoading = true
| //add
| //每次修改都新增一条记录,清除多余字段
| that.model.id = null
| that.model.createBy = null
| that.model.createTime = null
| that.model.updateBy = null
| that.model.updateTime = null
| postAction(this.url.add, that.model)
| .then((res) => {
| that.confirmLoading = false
| if (res.success) {
| that.close()
| that.$message.success(res.message)
| that.$emit('ok', res.result)
| that.close()
| } else {
| that.$message.warning(res.message)
| }
| })
| .finally(() => {
| that.confirmLoading = false
| })
| }
| })
| },
| close() {
| this.$emit('close')
| this.visible = false
| },
| handleAddUser() {},
| handleChangeUserCommon(v) {},
| },
| }
| </script>
|
| <style scoped>
| </style>
|
|