zhuguifei
2025-04-28 442928123f63ee497d766f9a7a14f0a6ee067e25
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
<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="xmmb">
              <a-textarea
                v-model="model.xmmb"
                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 { putAction } from '@/api/manage'
 
export default {
  name: 'ProjectModal2',
  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: {
        xmmb: [{ required: true, message: '项目目标不能为空', trigger: 'blur' }],
      },
      url: {
        edit: '/pro/project/edit',
      },
    }
  },
  created() {},
  watch: {},
  methods: {
    edit(record) {
      this.form.resetFields()
      this.visible = true
      this.model = Object.assign({}, record)
    },
 
    handleCancel() {
      this.close()
    },
    handleOk() {
      let that = this
      this.$refs.form.validate((valid) => {
        if (valid) {
          that.confirmLoading = true
          //add
 
          putAction(this.url.edit, 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>