zjf
2023-02-24 2126cd24b8a0174ac0597340917c0a4595f72254
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
<template>
  <el-dialog
    v-loading="loading"
    :visible="visible"
    :append-to-body="true"
    title="客户成交状态"
    width="400px"
    @close="handleCancel">
    <div class="handle-box">
      <flexbox
        class="handle-item"
        align="stretch">
        <div
          class="handle-item-name"
          style="margin-top: 8px;">成交状态:</div>
        <el-select
          v-model="status"
          class="handle-item-content"
          placeholder="请选择">
          <el-option
            v-for="item in options"
            :key="item.value"
            :label="item.label"
            :value="item.value"/>
        </el-select>
      </flexbox>
    </div>
    <span
      slot="footer"
      class="dialog-footer">
      <el-button @click.native="handleCancel">取消</el-button>
      <el-button
        type="primary"
        @click.native="handleConfirm">保存</el-button>
    </span>
  </el-dialog>
</template>
 
<script>
// import { crmCustomerDealStatusAPI } from '@/api/customermanagement/customerManage'
 
export default {
  /** 客户管理  成交状态 操作 */
  name: 'DealStatusHandle',
  components: {},
  mixins: [],
  props: {
    visible: {
      type: Boolean,
      required: true,
      default: false
    },
    crmType: {
      type: String,
      default: ''
    },
    // 勾选数据
    selectionList: {
      type: Array,
      default: () => {
        return []
      }
    }
  },
  data () {
    return {
      loading: true,
      status: 1,
      options: [
        {
          label: '已成交',
          value: 1
        },
        {
          label: '未成交',
          value: 0
        }
      ]
    }
  },
  computed: {},
  watch: {},
  mounted () {},
  methods: {
    /**
     * 取消选择
     */
    handleCancel () {
      this.status = 1
      this.$emit('update:visible', false)
    },
 
    /**
     * 点击确定
     */
    handleConfirm () {
      var self = this
      var actionIds = this.selectionList.map(function (item, index, array) {
        return item[self.crmType + 'Id']
      }).join(',')
      var params = {
        dealStatus: this.status
      }
      params.ids = actionIds
      this.loading = true
      // crmCustomerDealStatusAPI(params)
      //   .then(res => {
      //     this.$message({
      //       type: 'success',
      //       message: '操作成功'
      //     })
      //     this.loading = false
      //     this.$emit('handle', {
      //       type: 'deal_status'
      //     })
      //     this.handleCancel()
      //   })
      //   .catch(() => {
      //     this.loading = false
      //   })
    }
  }
}
</script>
 
<style lang="less" scoped>
.handle-box {
  color: #333;
  font-size: 12px;
}
.handle-item {
  padding-bottom: 15px;
  .handle-item-name {
    flex-shrink: 0;
    width: 90px;
  }
  .handle-item-content {
    flex: 1;
  }
}
.handle-bar {
  position: relative;
  margin-top: 10px;
  height: 30px;
  button {
    float: right;
    margin-right: 10px;
  }
}
</style>