10.10综合交易所原始源码-管理后台
1
admin
2026-01-27 779dcd060d1f4e15f65fc43022ac9f7b009fc9ef
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
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
<template>
  <el-dialog
    title="客服个人中心页面"
    :visible.sync="visible"
    width="600px"
    :append-to-body="true">
    <el-form :model="dataForm" ref="dataForm" label-width="100px">
      <el-form-item label="用户名">
        <span>{{ userName }}</span>
      </el-form-item>
      <el-form-item label="当前在线状态" prop="online">
        <el-input  v-model="dataForm.online" disabled></el-input>
      </el-form-item>
      <el-form-item label="最后上线时间" prop="last_online_time">
        <el-input  v-model="dataForm.last_online_time" disabled></el-input>
      </el-form-item>
      <el-form-item label="最后下线时间" prop="last_offline_time">
        <el-input  v-model="dataForm.last_offline_time" disabled></el-input>
      </el-form-item>
      <el-form-item label="再次访问自动回复">
        <el-input  v-model="dataForm.auto_answer"></el-input>
      </el-form-item>
 
    </el-form>
    <span slot="footer" class="dialog-footer">
      <el-button @click="visible = false">关闭</el-button>
      <el-button type="primary" @click="personalOpen()">{{dataForm.online_state==1 ? "下线" : "上线"}}</el-button>
      <el-button type="primary" @click="personalUpdateAutoAnswer1()">保存</el-button>
    </span>
 
    <!-- 确认弹窗-start -->
    <el-dialog
      title="验证资金密码"
      :visible.sync="dialogFormVisible"
      :append-to-body="true"
    >
      <el-form
        :model="dataForm2"
        ref="dataForm2"
        @keyup.enter.native="personalUpdateAutoAnswer()"
        label-width="80px"
      >
        <el-form-item
          label="登录人资金密码"
          :label-width="formLabelWidth"
          prop="loginSafeword"
        >
          <el-input
            v-model="dataForm2.loginSafeword"
            type="password"
            placeholder="登录人资金密码"
            autocomplete="off"
          ></el-input>
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button @click="dialogFormVisible = false">取 消</el-button>
        <el-button type="primary" @click="personalUpdateAutoAnswer()">确 定</el-button>
      </div>
    </el-dialog>
    <!-- 确认弹窗-end -->
 
  </el-dialog>
</template>
 
<script>
  import { clearLoginInfo } from '@/utils'
  import { Debounce } from '@/utils/debounce'
  import { encrypt } from '@/utils/crypto'
  export default {
    data () {
      var validateConfirmPassword = (rule, value, callback) => {
        if (this.dataForm.newPassword !== value) {
          callback(new Error('确认密码与新密码不一致'))
        } else {
          callback()
        }
      }
      return {
        visible: false,
        dataForm: {
          password: '',
          newPassword: '',
          confirmPassword: ''
        },
        dialogFormVisible:false,
        dataForm2:{},
        formLabelWidth: "120px",
      }
    },
    computed: {
      userName: {
        get () { return this.$store.state.user.name }
      },
      mainTabs: {
        get () { return this.$store.state.common.mainTabs },
        set (val) { this.$store.commit('common/updateMainTabs', val) }
      }
    },
    methods: {
      // 初始化
      init () {
 
        this.personalCustomer();
 
        this.visible = true
        this.$nextTick(() => {
          this.$refs['dataForm'].resetFields()
        })
      },
      // 表单提交
      dataFormSubmit: Debounce(function () {
        this.$refs['dataForm'].validate((valid) => {
          if (valid) {
            this.$http({
              url: this.$http.adornUrl('/changeLoginPassword'),
              method: 'post',
              data: this.$http.adornData({
                'oldPassword': encrypt(this.dataForm.password),
                'newPassword': encrypt(this.dataForm.newPassword)
              })
            }).then(({data}) => {
              if(data.code == 0){
                this.$message({
                message: '操作成功',
                type: 'success',
                duration: 1500,
                onClose: () => {
                  this.visible = false
                  this.$nextTick(() => {
                    // this.mainTabs = []
                     // clearLoginInfo()
                    // this.$router.replace({ name: 'login' })
                  })
                }
              })
              }else{
                this.$message({
                message:data.msg,
                type: 'error',
                duration: 1500,
                onClose: () => {
                  
                }
              })
              }
 
            })
          }
        })
      }),
      personalCustomer() {
        this.$http({
          url: this.$http.adornUrl("/normal/adminPersonalCustomerAction!personalCustomer.action"),
          method: "get",
          data: this.$http.adornData({}),
        }).then(({ data }) => {
          if(data.code == 0){
            let kefuInfo = {}
            this.dataForm = data.data;
            if(this.dataForm.online_state == 1){
              this.dataForm.online = "上线"
              kefuInfo.isOnline = true;
            }else{
              this.dataForm.online = "下线"
              kefuInfo.isOnline = false;
            }
            
            this.$bus.$emit("updateKefuInfo",kefuInfo);
          }else{
            this.$message(data.msg);
          }
 
        });
      },
      personalOpen(){
        // this.dialogFormVisible = true;
        if(this.dataForm.online_state == 1){
          this.personalOffline();
        }else{
          this.personalOnline();
        }
      },
      personalOnline() {
        this.$http({
          url: this.$http.adornUrl("/normal/adminPersonalCustomerAction!personalOnline.action"),
          method: "get",
          data: this.$http.adornData({}),
        }).then(({ data }) => {
          if(data.code == 0){
            this.personalCustomer();
          }else{
            this.$message(data.msg);
          }
 
        });
      },
      personalOffline() {
        this.open("下线后将不会收到消息,如有新消息,用户将分配给其他在线客服","是否下线",
          ()=>{
          //
          this.$http({
            url: this.$http.adornUrl("/normal/adminPersonalCustomerAction!personalOffline.action"),
            method: "get",
            data: this.$http.adornData({}),
          }).then(({ data }) => {
            if(data.code == 0){
              this.personalCustomer();
            }else{
              this.$message(data.msg);
            }
  
          });
          //
        },()=>{});
 
      },
      open(message,title,yes,cancel) {
        this.$confirm(message, title, {
          confirmButtonText: '确定',
          cancelButtonText: '取消',
          type: 'warning',
          center: true
        }).then(() => {
          if(yes){yes()}
          // this.$message({
          //   type: 'success',
          //   message: '删除成功!'
          // });
        }).catch(() => {
          if(cancel){cancel()}
          // this.$message({
          //   type: 'info',
          //   message: '已取消删除'
          // });
        });
      },
      personalUpdateAutoAnswer1(){
        this.dialogFormVisible = true;
      },
      personalUpdateAutoAnswer() {
        if(!this.dataForm2.loginSafeword){
          this.$message({
              message: "资金密码不能为空",
              type: 'error',
              duration: 1500,
              onClose: () => {
                // this.visible = false
                // this.$emit('refreshDataList')
              }
            })
          return
        }
        this.$http({
          url: this.$http.adornUrl("/normal/adminPersonalCustomerAction!personalUpdateAutoAnswer.action"),
          method: "get",
          params: this.$http.adornParams({
            auto_answer:this.dataForm.auto_answer,
            login_safeword:encrypt(this.dataForm2.loginSafeword)
          }),
        }).then(({ data }) => {
          if(data.code == 0){
            this.dialogFormVisible = false;
          }else{
            // this.$message(data.msg);
            this.$message({
              message: data.msg == "AES解密错误" ? "资金密码不正确" : data.msg,
              type: 'error',
              duration: 1500,
              onClose: () => {
                // this.visible = false
                // this.$emit('refreshDataList')
              }
            })
          }
 
        });
      },
    }
  }
</script>