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
<template>
  <!--
          作者:yj
      -->
  <el-dialog title="详情" :visible.sync="dialogVisible" @close="cancelFunc" :close-on-click-modal="false" :close-on-press-escape="false" width="60%">
    <el-form class="repair-form" :model="formData">
      <el-form-item label="供应用户:" :label-width="formLabelWidth">
        <div class="d-s-c" style="margin-bottom: 10px;">
           <span><img v-img-url="formData.supplyuser.avatarUrl" width="40" height="40" /></span>
           <span>{{formData.supplyuser.nickName}}</span>
        </div>
      </el-form-item>
      <el-form-item label="需求用户:" :label-width="formLabelWidth">
        <div class="d-s-c">
           <span><img v-img-url="formData.demanduser.avatarUrl" width="40" height="40" /></span>
           <span>{{formData.demanduser.nickName}}</span>
        </div>
      </el-form-item>
      <el-form-item label="标题:" :label-width="formLabelWidth">
        <span class="mr10">{{formData.project_name}}</span> <span class="ml20">支付金额:¥{{formData.pay_price}}</span> <span class="ml20">佣金:¥{{formData.money}}</span>
      </el-form-item>
 
      <!-- <el-form-item label="图片" :label-width="formLabelWidth">
        <div>
          <div v-for="(item, index) in formData.image" :key="index"><a target="_blank" :href="item.file_path"><img style="max-width: 50px; height: 50px;" v-img-url="item.file_path" /></a></div>
        </div>
      </el-form-item>
      <el-form-item label="备注" :label-width="formLabelWidth" prop="message">
        <el-input v-model="formData.message" autocomplete="off"></el-input>
      </el-form-item>-->
 
      <el-form-item label="服务星级" :label-width="formLabelWidth" v-if="formData.server_score">
        {{formData.server_score}}星
      </el-form-item>
      <el-form-item label="评分" :label-width="formLabelWidth" v-if="formData.score">
        <div v-if="formData.score == 10">好评</div>
        <div v-if="formData.score == 20">中评</div>
        <div v-if="formData.score == 30">差评</div>
      </el-form-item>
      <el-form-item label="评语" :label-width="formLabelWidth" v-if="formData.evaluate_content">
        {{formData.evaluate_content}}
      </el-form-item>
 
    </el-form>
    <div slot="footer" class="dialog-footer">
      <el-button type="warning" @click="onCancel(20)" v-if="formData.pay_status == 10 && formData.order_status == 10">取消订单</el-button>
      <el-button @click="cancelFunc">返 回</el-button>
      <el-button type="primary" @click="onCash" v-if="formData.order_status == 10 && formData.pay_status == 10">确定已付款</el-button>
      <el-button type="primary" @click="onFinish" v-if="formData.order_status == 10 && formData.pay_status == 20">确定已完成</el-button>
      <!-- <el-button type="warning" @click="onCancel(20)" v-if="formData.order_status == 21">确定取消订单</el-button>
      <el-button type="danger" @click="onCancel(10)" v-if="formData.order_status == 21">撤销申请</el-button> -->
    </div>
  </el-dialog>
</template>
 
<script>
import PlusApi from '@/api/plus/release.js';
import UserApi from '@/api/user.js';
export default {
  data() {
    return {
      /*左边长度*/
      formLabelWidth: '100px',
      /*是否显示*/
      dialogVisible: false,
      /*表单数据模型*/
      formData: {},
    };
  },
  props: {
    open_edit: Boolean,
    userModel: Object,
  },
  watch: {
    open_edit: function(n, o) {
      if (n != o) {
        this.dialogVisible = this.open_edit;
        if (n) {
          this.formData = this.userModel;
        }
      }
    }
  },
  created() {
    /*获取列表*/
   // this.getData();
  },
  methods: {
    /*获取数据*/
    // getData() {
    //   let self = this;
    //   PlusApi.toOrderEdit()
    //     .then(data => {
    //       self.loading = false;
    //       self.user = data.data.user;
    //     })
    //     .catch(error => {
    //       self.loading = false;
    //     });
    // },
 
    /*关闭弹窗*/
    cancelFunc(e) {
      let type='cancel';
      if(e){
        type='success';
      }
      this.$emit('close', {
        type:type
      });
    },
    /*线下支付*/
    onCash(row) {
      let self = this;
      let id = this.formData.id;
      self
        .$confirm('确认后不可恢复,确认已收到款了吗?', '提示', {
          type: 'warning'
        })
        .then(() => {
          PlusApi.onCash({
            id: id
          }).then(data => {
            self.$message({
              message: '操作成功',
              type: 'success'
            });
            self.cancelFunc(true);
          });
        });
    },
    onFinish(row) {
      let self = this;
      let id = this.formData.id;
      self
        .$confirm('确认后马上发放佣金,确认已完成了吗?', '提示', {
          type: 'warning'
        })
        .then(() => {
          PlusApi.onFinish({
            id: id
          }).then(data => {
            self.$message({
              message: '操作成功',
              type: 'success'
            });
            self.cancelFunc(true);
          });
        });
    },
    onCancel(order_status) {
      let self = this;
      let id = this.formData.id;
      self
        .$confirm('此操作不可恢复,确定吗?', '提示', {
          type: 'warning'
        })
        .then(() => {
          PlusApi.onCancel({
            id: id,
            order_status: order_status
          }).then(data => {
            self.$message({
              message: '操作成功',
              type: 'success'
            });
            self.cancelFunc(true);
          });
        });
    },
  }
};
</script>
 
<style scoped>
  .repair-img image{
    height: 100px;
  }
  .repair-form .el-form-item {
     margin-bottom: 0px;
  }
</style>