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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
<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="16">
          <a-col :lg="24">
            <a-form-model-item label="概述" prop="gs">
              <a-textarea v-model="model.gs" :auto-size="{ minRows: 3, maxRows: 10 }" placeholder="请输入概述内容" />
            </a-form-model-item>
          </a-col>
           <a-col :lg="24">
            <a-form-model-item label="预测" prop="yc">
              <a-textarea v-model="model.yc" :auto-size="{ minRows: 3, maxRows: 10 }" placeholder="请输入预测内容" />
            </a-form-model-item>
          </a-col>
 
          <a-col :lg="24">
            <a-form-model-item label="进度是否正常">
              <a-textarea v-model="model.jdsfzc" :auto-size="{ minRows: 3, maxRows: 10 }" placeholder="请输入进度是否正常" />
            </a-form-model-item>
          </a-col>
 
          <a-col :lg="24">
            <a-form-model-item label="是否需要组织支持">
              <a-textarea v-model="model.sfxyzc" :auto-size="{ minRows: 3, maxRows: 10 }" placeholder="请输入是否需要组织支持" />
            </a-form-model-item>
          </a-col>
 
          <a-col :lg="24">
            <a-form-model-item label="是否影响销售和订单">
              <a-textarea v-model="model.sfyxdd" :auto-size="{ minRows: 3, maxRows: 10 }" placeholder="请输入是否影响销售和订单" />
            </a-form-model-item>
          </a-col>
 
          <a-col :lg="24">
            <a-form-model-item label="风险预测和估计">
              <a-textarea v-model="model.fxyc" :auto-size="{ minRows: 3, maxRows: 10 }" placeholder="请输入风险预测和估计" />
            </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: 'ProjectModal4',
  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: {
        gs: [{ required: true, message: '概述不能为空', trigger: 'blur' }],
        yc: [{ required: true, message: '预测不能为空', trigger: 'blur' }],
      },
      url: {
        add: '/pro/summary/add',
      },
    }
  },
  created() {},
  watch: {
    /*  model(newName, oldName) {
      if(newName.projectManager_dictText){
        let that = this;
        setTimeout(() => {
           that.userIds  = newName.projectManager_dictText;
 
        }, 1000)
 
      }
 
    }*/
  },
  methods: {
    edit(record) {
      this.form.resetFields()
      this.visible = true
      //数据类型为预测
      record.type = 3
      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>