MrShi
2025-09-10 ffe22320da42b1a3f4a0aaf81cb31578ef205d38
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
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
<template>
  <GlobalWindow
    :title="title"
    :visible.sync="visible"
    :confirm-working="isWorking"
    :withFooter="false"
  >
    <div class="com" v-if="info">
      <div class="com_image">
        <img :src="info.fullLog" />
      </div>
      <div class="com_info">
        <div class="com_info_title">{{info.name}}</div>
        <div class="list_item_cate">
          <div class="list_item_cate_row" v-for="(item, index) in info.lablesList" :key="index">{{item}}</div>
        </div>
        <div class="com_info_text1">服务商:{{info.serverName}}</div>
        <div class="com_info_text">{{info.introduction}}</div>
        <div class="com_info_btn" @click="openT" v-if="[1, 2].includes(userInfo.type)">联系我们</div>
        <div class="com_info_x"></div>
        <div class="com_info_content" v-html="info.details"></div>
      </div>
      <el-dialog
        title="联系我们"
        :destroy-on-close="true"
        :visible.sync="show"
        :close-on-click-modal="false"
        :modal-append-to-body="false"
        width="500px">
        <el-form :model="formData" label-position="right" :rules="rules" ref="ruleForm">
          <el-form-item label="联系人" prop="name">
            <el-input v-model="formData.name"></el-input>
          </el-form-item>
          <el-form-item label="联系电话" prop="phone">
            <el-input type="number" v-model="formData.phone" maxlength="11"></el-input>
          </el-form-item>
          <el-form-item label="简要描述" prop="description">
            <el-input v-model="formData.description"></el-input>
          </el-form-item>
        </el-form>
        <span slot="footer" class="dialog-footer">
          <el-button @click="show = false">取 消</el-button>
          <el-button type="primary" @click="submit">确 定</el-button>
        </span>
      </el-dialog>
    </div>
  </GlobalWindow>
</template>
 
<script>
import BaseOpera from '@/components/base/BaseOpera'
import GlobalWindow from '@/components/common/GlobalWindow'
import { getById } from '@/api/business/applicationInfo'
import { create } from '@/api/business/demandRecord'
import { mapState } from 'vuex'
export default {
  name: 'OperaDemandRecordWindow',
  extends: BaseOpera,
  components: { GlobalWindow },
  computed: {
    ...mapState(['userInfo'])
  },
  data () {
    return {
      form: {},
      formData: {
        name: '',
        phone: '',
        description: ''
      },
      rules: {
        name: [
          { required: true, message: '请输入', trigger: 'blur' }
        ],
        phone: [
          { required: true, message: '请输入', trigger: 'blur' }
        ]
      },
      show: false,
      info: null
    }
  },
  methods: {
    async open (title, id) {
      this.title = title
      this.info = await getById(id)
      this.info.lablesList = this.info.lables.split(',') || []
      this.visible = true
    },
    openT() {
      this.formData.name = ''
      this.formData.phone = ''
      this.formData.description = ''
      this.show = true
    },
    submit() {
      this.$refs.ruleForm.validate((valid) => {
        if (valid) {
          create({
            applicationId: this.info.id,
            linkName: this.formData.name,
            linkPhone: this.formData.phone,
            details: this.formData.description
          }).then(res => {
            this.$message.success('提交成功!')
            this.show = false
          })
        } else {
          return false;
        }
      });
    }
  }
}
</script>
 
<style lang="scss" scoped>
  .com {
    width: 100%;
    display: flex;
    .com_image {
      width: 140px;
      height: 140px;
      flex-shrink: 0;
      background: #F4F7FC;
      margin-right: 30px;
      display: flex;
      align-items: center;
      justify-content: center;
      overflow: hidden;
      img {
        width: 100%;
      }
    }
    .com_info {
      flex: 1;
      display: flex;
      flex-direction: column;
      .com_info_title {
        font-weight: 600;
        font-size: 26px;
        color: #222222;
      }
      .com_info_text1 {
        font-weight: 400;
        font-size: 13px;
        color: #666666;
        margin-top: 15px;
      }
      .com_info_text {
        font-weight: 400;
        font-size: 16px;
        color: #666666;
        margin-top: 15px;
      }
      .com_info_btn {
        width: 96px;
        height: 36px;
        line-height: 36px;
        text-align: center;
        font-weight: 400;
        font-size: 14px;
        color: #FFFFFF;
        background: #216EEE;
        border-radius: 2px;
        cursor: pointer;
        margin-top: 15px;
      }
      .com_info_x {
        width: 100%;
        height: 1px;
        margin: 20px 0;
        background-color: #DFE2E8;
      }
      .com_info_content {
        width: 100%;
      }
      .list_item_cate {
        width: 100%;
        display: flex;
        align-items: center;
        margin-top: 12px;
        .list_item_cate_row {
          padding: 5px 8px;
          box-sizing: border-box;
          background: rgba(33,110,238,0.1);
          border-radius: 2px;
          font-weight: 400;
          font-size: 12px;
          color: #216EEE;
          margin-right: 10px;
          &:last-child {
            margin-right: 0 !important;
          }
        }
      }
    }
  }
</style>