Blame view

src/views/myevaluate/index.vue 7.09 KB
613d2a9c   Andy   add icon
1
  <template>
d3de4a93   Andy   add 我的评价 前端页面 弹窗
2
3
4
5
6
7
    <div>
      <div class="serch-wrap">
        <el-row :gutter="20">
          <el-form ref="form" :model="form" label-width="60px" label-position="left">
            <el-col :xs="8" :sm="6" :md="7" :lg="7" :xl="1">
              <el-form-item label="问题类型">
52ef4112   王富生   提交登陆
8
9
10
                <el-select v-model="form.feedbackId" placeholder="请选择问题类型">
                  <el-option v-for="item in problemTpyeSelectData" :label="item.name" :value="item.code"/>
  
d3de4a93   Andy   add 我的评价 前端页面 弹窗
11
12
13
                </el-select>
              </el-form-item>
            </el-col>
52ef4112   王富生   提交登陆
14
15
            <el-col :xs="16" :sm="6" :md="3" :lg="3" :xl="1" :offset="12">
              <el-button type="primary" @click="queryBtn">查询</el-button>
d3de4a93   Andy   add 我的评价 前端页面 弹窗
16
17
18
19
            </el-col>
          </el-form>
        </el-row>
      </div>
613d2a9c   Andy   add icon
20
  
d3de4a93   Andy   add 我的评价 前端页面 弹窗
21
22
23
      <el-card shadow="always" class="card-second-top">
        <div slot="header" class="clearfix" style="line-height: 32px;">
          <span>详细记录</span>
52ef4112   王富生   提交登陆
24
          <el-button type="primary" size="small"  style="float: right" @click="dialogOpen">评价</el-button>
d3de4a93   Andy   add 我的评价 前端页面 弹窗
25
26
27
28
29
30
        </div>
        <el-table
          :data="orderData"
          style="width: 100%;"
          :show-overflow-tooltip="true">
          <el-table-column
52ef4112   王富生   提交登陆
31
            prop="feedbackCode"
d3de4a93   Andy   add 我的评价 前端页面 弹窗
32
            label="问题类型"
52ef4112   王富生   提交登陆
33
            :formatter="formatProblemType"
d3de4a93   Andy   add 我的评价 前端页面 弹窗
34
35
36
            :show-overflow-tooltip="true">
          </el-table-column>
          <el-table-column
52ef4112   王富生   提交登陆
37
            prop="suggestDesc"
d3de4a93   Andy   add 我的评价 前端页面 弹窗
38
39
40
41
            label="问题内容"
            :show-overflow-tooltip="true">
          </el-table-column>
          <el-table-column
52ef4112   王富生   提交登陆
42
            prop="createDate"
d3de4a93   Andy   add 我的评价 前端页面 弹窗
43
            label="提交时间"
52ef4112   王富生   提交登陆
44
            :formatter="formatCreateDate"
d3de4a93   Andy   add 我的评价 前端页面 弹窗
45
46
47
            :show-overflow-tooltip="true">
          </el-table-column>
          <el-table-column
52ef4112   王富生   提交登陆
48
49
50
            prop="userPhone"
            :formatter="formatserPhone"
            label="用户手机号">
d3de4a93   Andy   add 我的评价 前端页面 弹窗
51
52
53
          </el-table-column>
        </el-table>
        <el-pagination
52ef4112   王富生   提交登陆
54
55
          :page-size="pageSize"
          :pager-count="currentPage"
d3de4a93   Andy   add 我的评价 前端页面 弹窗
56
          layout="prev, pager, next"
52ef4112   王富生   提交登陆
57
          @current-change="handleCurrentChange"
d3de4a93   Andy   add 我的评价 前端页面 弹窗
58
59
60
          :total="total">
        </el-pagination>
      </el-card>
613d2a9c   Andy   add icon
61
  
d3de4a93   Andy   add 我的评价 前端页面 弹窗
62
      <el-dialog title="提交问题" :visible.sync="dialogFormVisible">
52ef4112   王富生   提交登陆
63
        <el-form :model="problemform" :rules="rules" ref="problemform">
d3de4a93   Andy   add 我的评价 前端页面 弹窗
64
          <el-form-item label="">
4743da39   Andy   add 我的评价 前端页面 弹窗
65
            <el-radio-group v-model="problemform.resource" size="">
52ef4112   王富生   提交登陆
66
              <el-radio border v-for="item in problemTpyeSelectData"  :label="item.code">{{item.name}}</el-radio>
d3de4a93   Andy   add 我的评价 前端页面 弹窗
67
68
            </el-radio-group>
          </el-form-item>
52ef4112   王富生   提交登陆
69
70
          <el-form-item label="问题内容" style="margin-top: 16px"  prop="desc">
            <el-input type="textarea" v-model="problemform.desc" style="width:400px"></el-input>
d3de4a93   Andy   add 我的评价 前端页面 弹窗
71
72
73
74
          </el-form-item>
        </el-form>
        <div slot="footer" class="dialog-footer">
          <el-button @click="dialogFormVisible = false">取 消</el-button>
52ef4112   王富生   提交登陆
75
          <el-button type="primary" @click="executeDialog('problemform')">提交</el-button>
d3de4a93   Andy   add 我的评价 前端页面 弹窗
76
77
        </div>
      </el-dialog>
613d2a9c   Andy   add icon
78
79
80
81
    </div>
  </template>
  
  <script>
52ef4112   王富生   提交登陆
82
83
    import {queryFeedbackAndSuggestForPage,getFeedbackType,saveFeedbackAndSuggest} from '@/api/mysuggest.js';
    import {timeFormatter} from '@/utils/utils.js'
613d2a9c   Andy   add icon
84
    export default {
613d2a9c   Andy   add icon
85
86
      data() {
        return {
d3de4a93   Andy   add 我的评价 前端页面 弹窗
87
          form: {
52ef4112   王富生   提交登陆
88
            feedbackId:''
d3de4a93   Andy   add 我的评价 前端页面 弹窗
89
          },
52ef4112   王富生   提交登陆
90
          problemTpyeSelectData:[],
d3de4a93   Andy   add 我的评价 前端页面 弹窗
91
          problemform: {
52ef4112   王富生   提交登陆
92
93
            resource: '1',
            desc:''
d3de4a93   Andy   add 我的评价 前端页面 弹窗
94
95
          },
          dialogFormVisible: false,
52ef4112   王富生   提交登陆
96
          total: 10,
d3de4a93   Andy   add 我的评价 前端页面 弹窗
97
          currentPage: 1,
dcf87b64   Andy   table bug修复
98
          pageSize: 5,
52ef4112   王富生   提交登陆
99
100
101
102
103
104
105
          orderData: [],
          rules:{
            desc:[
              {required: true, message: '请输入问题内容', trigger: 'blur'},
              {min: 1, max: 10, message: '长度在 3  128 个字符', trigger: 'blur'}
            ]
           }
613d2a9c   Andy   add icon
106
107
        }
      },
613d2a9c   Andy   add icon
108
      methods: {
52ef4112   王富生   提交登陆
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
        queryBtn() {
          let that =this;
          let userInfo = this.$store.state.user.userInfo;
           let req ={
             baseRequest:{
               pageNum:that.currentPage,
               pageSize:that.pageSize
             },
             feedbackCode:this.form.feedbackId,
             custId:userInfo.custId,
             sysCode:'1000'
           };
          queryFeedbackAndSuggestForPage(req).then(response =>{
              if(response.code='8888'){
                that.orderData=response.data.rows;
                that.total=response.data.total;
              }
          });
        },
        /**格式化问题类型.*/
        formatProblemType:function(row, column, cellValue, index){
             let value="";
             if(cellValue == null || cellValue == '' ){
               return value;
             }else{
               this.problemTpyeSelectData.forEach(item =>{
                 if(cellValue ==item.code){
                   value =item.name;
                 }
               });
             }
             return value;
        },
        /**格式化时间*/
        formatCreateDate:function (row, column, cellValue, index) {
          return timeFormatter(cellValue,7)
d3de4a93   Andy   add 我的评价 前端页面 弹窗
145
        },
52ef4112   王富生   提交登陆
146
147
148
149
150
151
152
        /**问题类型查询*/
        getFeedbackType:function(){
          getFeedbackType().then(response =>{
              if(response.code='8888'){
                this.problemTpyeSelectData = response.data;
              }
          });
d3de4a93   Andy   add 我的评价 前端页面 弹窗
153
        },
52ef4112   王富生   提交登陆
154
155
156
157
158
159
160
        /**格式化手机号*/
        formatserPhone:function (row, column, cellValue, index) {
           if(cellValue == null || cellValue == undefined || cellValue == ''){
               return "-"
           }else{
             return cellValue.substr(0, 3)+"****"+cellValue.substr(7, 4)
           }
d3de4a93   Andy   add 我的评价 前端页面 弹窗
161
        },
52ef4112   王富生   提交登陆
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
        /**页面改变.*/
        handleCurrentChange:function (value) {
            this.currentPage=value;
            this.queryBtn();
        },
  
        dialogOpen:function(){
          let problemform= {
            resource: '1',
              desc:''
          };
          this.dialogFormVisible=true;
        },
        /**提交.*/
        executeDialog:function(formName){
          let that =this;
          let userInfo = this.$store.state.user.userInfo;
          let feedbackCode=that.problemform.resource;
          let suggestDesc =that.problemform.desc;
  
          this.$refs[formName].validate((valid) => {
            if (valid) {
              let req ={
                custId:userInfo.custId,
                userPhone:userInfo.userPhone,
                feedbackCode:feedbackCode,
                suggestDesc:suggestDesc,
                sysCode:'1001'
              }
              saveFeedbackAndSuggest(req).then(response =>{
                  if(response.code='8888'){
                    this.dialogFormVisible=false;
                    this.$message({
                      type: 'success',
                      message: '问题提交成功!'
                    });
                    that.queryBtn();
                  }else{
                    this.$message({
                      type: 'error',
                      message: '问题提交失败!'
                    });
                  }
              });
            }
          });
        }
      },
      mounted:function () {
        this.queryBtn();
        this.getFeedbackType();
613d2a9c   Andy   add icon
213
214
215
216
      }
    }
  </script>
  
d3de4a93   Andy   add 我的评价 前端页面 弹窗
217
218
219
220
221
222
223
224
225
226
227
  <style lang="scss">
    .serch-wrap{
      background-color: #FFF;
      padding: 15px;
    }
    .card-second-top{
      margin-top: 15px;
    }
    .el-card__header{
      padding: 10px 20px;
    }
4743da39   Andy   add 我的评价 前端页面 弹窗
228
229
230
231
232
233
234
    .el-radio{
      margin-right: 80px;
    }
    .el-radio.is-bordered+.el-radio.is-bordered{
      margin-left: 0px;
      margin-top: 15px;
    }
d3de4a93   Andy   add 我的评价 前端页面 弹窗
235
  </style>