reply.php 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208
  1. <?php
  2. use common\helpers\ComponentHelper;
  3. ComponentHelper::loadComponentView('com-rich-text');
  4. ?>
  5. <div id="app" v-cloak>
  6. <el-card class="box-card" shadow="never" style="border:0;min-width: 1250px;" body-style="background-color: #f3f3f3;padding: 10px 0 0;">
  7. <div slot="header">
  8. <el-breadcrumb separator="/">
  9. <el-breadcrumb-item>
  10. <span style="color: #409EFF;cursor: pointer" @click="$navigate({r:'mall/optimize/list'})">优化建议</span>
  11. </el-breadcrumb-item>
  12. <el-breadcrumb-item>优化建议回复</el-breadcrumb-item>
  13. </el-breadcrumb>
  14. </div>
  15. <el-card class="box-card">
  16. <div slot="header" class="clearfix">
  17. <span>沟通记录</span>
  18. <span style="float: right;">当前状态:{{ examine_arr[optimize.examine_status] }}</span>
  19. </div>
  20. <div class="connect-box">
  21. <ul>
  22. <li class="connect-li" v-for="(item, index) in list">
  23. <div class="connect-user">
  24. <el-image :src="item.member_id == 0 ? '/resources/img/mall/mall_logo_default.jpg' : config.logo"></el-image>
  25. </div>
  26. <div class="connect-question">
  27. <div class="connect-desc">
  28. <p>{{ item.member_id == 0 ? '七件事工程师' : item.member_name }}</p>
  29. <p>{{ item.created_at | dateTimeFormat('Y-m-d H:i:s') }}</p>
  30. </div>
  31. <div class="connect-content" ref="connect_content" v-html="item.optimize" @click="handleClick($event)"></div>
  32. </div>
  33. </li>
  34. </ul>
  35. </div>
  36. <el-button v-if="optimize.examine_status == 2" type="primary" size="small" style="margin-top: 10px;" @click="dialogVisible=true">回复</el-button>
  37. </el-card>
  38. </el-card>
  39. <!-- 图片大图预览隐藏 -->
  40. <el-image style="display: none;" src="/resources/img/mall/mall_logo_default.jpg" ref="preview" :initial-index="preview_index" :preview-src-list="preview_imgs"></el-image>
  41. <!-- 沟通回复弹框 -->
  42. <el-dialog title="沟通回复" :visible.sync="dialogVisible" width="60%" :close-on-click-modal="false">
  43. <el-form :model="ruleForm" :rules="rules" size="small" ref="ruleForm" label-width="160px">
  44. <el-row>
  45. <el-col :span="24">
  46. <el-form-item label="内容描述" prop="optimize">
  47. <com-rich-text style="width: 90%;" v-model="ruleForm.optimize"></com-rich-text>
  48. </el-form-item>
  49. </el-col>
  50. </el-row>
  51. </el-form>
  52. <span slot="footer" class="dialog-footer">
  53. <el-button @click="dialogVisible = false">取 消</el-button>
  54. <el-button type="primary" :loading="submitLoading" @click="submitForm">确 定</el-button>
  55. </span>
  56. </el-dialog>
  57. </div>
  58. <script>
  59. const app = new Vue({
  60. el: '#app',
  61. data() {
  62. return {
  63. submitLoading: false,
  64. ruleForm: {
  65. optimize_id: 0,
  66. optimize: '',
  67. },
  68. list:[],
  69. optimize: {},
  70. config: {},
  71. preview_imgs: [],
  72. preview_index: 0,
  73. examine_arr: {
  74. 1: '等待中台回复',
  75. 2: '等待客户回复',
  76. 3: '已结束',
  77. },
  78. dialogVisible: false,
  79. rules: {
  80. optimize: [
  81. {required: true, message: '请输入内容', trigger: 'change'},
  82. ],
  83. },
  84. };
  85. },
  86. mounted() {
  87. this.getDetail();
  88. },
  89. methods: {
  90. getDetail() {
  91. request({
  92. params: {
  93. r: 'mall/optimize/reply',
  94. id: getQuery('id')
  95. },
  96. method: 'get',
  97. }).then(e => {
  98. if (e.data.code == 0) {
  99. this.list = e.data.data.list
  100. this.optimize = e.data.data.optimize
  101. this.config = e.data.data.config
  102. this.preview_imgs = e.data.data.preview_imgs
  103. this.ruleForm.optimize_id = this.optimize.id
  104. } else {
  105. this.$message.error(e.data.msg);
  106. }
  107. }).catch(e => {
  108. this.$message.error(e.data.msg);
  109. });
  110. },
  111. handleClick(event){// 大图预览处理
  112. if (event.srcElement.attributes.length >= 1) {
  113. // 获取被选中的图片url
  114. let click_img = event.srcElement.attributes[0].value
  115. // 根据被点击选中的url获取其在数组中对应的下标
  116. this.preview_index = this.preview_imgs.indexOf(click_img)
  117. this.$refs.preview.clickHandler();
  118. }
  119. },
  120. //提交表单
  121. submitForm() {
  122. let self = this;
  123. if (isEmpty(self.ruleForm.optimize)) {
  124. self.$message.error('回复内容不能为空!');
  125. return;
  126. }
  127. self.submitLoading = true;
  128. request({
  129. params: {
  130. r: 'mall/optimize/resubmit'
  131. },
  132. method: 'post',
  133. data: {
  134. form: self.ruleForm,
  135. }
  136. }).then(e => {
  137. self.submitLoading = false;
  138. if (e.data.code == 0) {
  139. this.dialogVisible = false
  140. navigateTo({
  141. r: 'mall/optimize/reply',
  142. id: self.ruleForm.optimize_id
  143. })
  144. } else {
  145. self.$message.error(e.data.msg);
  146. }
  147. }).catch(e => {
  148. self.$message.error(e.data.msg);
  149. self.submitLoading = false;
  150. });
  151. },
  152. }
  153. });
  154. </script>
  155. <style>
  156. .connect-box {
  157. height: 500px;
  158. overflow-y: auto;
  159. }
  160. .connect-li:first-child {
  161. padding-top: 0px;
  162. }
  163. .connect-li {
  164. display: flex;
  165. padding: 25px 0;
  166. border-bottom: 1px dashed #d3d3d3;
  167. }
  168. .connect-user {
  169. padding: 0 10px;
  170. min-width: 100px;
  171. text-align: center;
  172. }
  173. .connect-user img {
  174. width: 50px;
  175. height: 50px;
  176. }
  177. .connect-desc {
  178. color: #a2a2a2;
  179. display: flex;
  180. justify-content: space-between;
  181. }
  182. .connect-content {
  183. padding: 10px 0;
  184. }
  185. .connect-content p {
  186. padding: 5px 0;
  187. }
  188. .connect-content img {
  189. max-width: 10%;
  190. cursor: pointer;
  191. }
  192. .connect-annex .el-image {
  193. height: 70px;
  194. margin-right: 10px;
  195. }
  196. .connect-question {
  197. width: 100%;
  198. }
  199. ::-webkit-scrollbar {
  200. width: 5px;
  201. }
  202. </style>