123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107 |
- <template>
- <el-dialog
- :visible.sync="dialogVisible"
- :before-close="handleCancel"
- class="assign-dialog"
- title="重置客户消息接收状态"
- width="450px"
- >
- <div class="form-wrap" v-loading="loading">
- 重置后该客服下所有客户状态均变更为【可接收消息】<br/><br/>
- 后续根据群发结果重新判断客户可接收消息状态。
- </div>
- <div slot="footer" class="dialog-footer">
- <el-button size="mini" @click="handleCancel">取 消</el-button>
- <el-button size="mini" type="primary" @click="handleConfirm">确 定</el-button>
- </div>
- </el-dialog>
- </template>
- <script>
- export default {
- name: "resetReceiveDialog",
- props: {
- // 控制弹框是否显示
- dialogVisible: {
- type: Boolean,
- default: () => false
- },
- // 成员信息
- userInfo: {
- type: Object,
- default: () => ({
- user_id: '',
- name: '',
- })
- },
- },
- data() {
- return {
- loading: false,
- form: {
- corpid: '',
- userid: '',
- }
- }
- },
- watch: {
- dialogVisible(isShow) {
- if (isShow) {
- // 获取表单数据
- this.handleGetFormData()
- }
- },
- },
- methods: {
- // 获取弹框表单数据
- handleGetFormData() {
- const { user_id = '' } = this.userInfo
- this.form.user_id = user_id
- console.log(this.form.userid)
- },
- // 清空弹框表单数据
- handleClearFormData() {
- this.form.user_id = ''
- },
- async handleConfirm() {
- try {
- const url = `${this.URL.BASEURL}${this.URL.member_resetCustomerReceiveStatus}`
- const params = {
- ...this.form,
- corpid: this.$localSelfStore.getLocal('defaultCorp') && this.$localSelfStore.getLocal('defaultCorp') != 'undefined' ? JSON.parse(this.$localSelfStore.getLocal('defaultCorp')).corpid : '',
- }
- this.loading = true
- const { data: res = {} } = await this.$axios.get(url, { params })
- if (res && res.errno == 0) {
- this.$message.success('操作成功')
- this.handleClearFormData()
- this.$emit('confirm')
- } else if (res.errno != 4002) {
- this.$message.warning(res.err || '操作失败')
- this.handleCancel()
- }
- } catch (error) {
- console.log('error => ', error)
- } finally {
- this.loading = false
- }
- },
- handleCancel() {
- this.handleClearFormData()
- this.$emit('cancel')
- },
- },
- };
- </script>
- <style lang="scss" scoped>
- .assign-dialog {
- .form-wrap {
- padding: 0 10px;
- }
- .dialog-footer {
- text-align: right;
- }
- }
- </style>
|