userCenterMyConsultingService1.vue 9.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242
  1. <template>
  2. <div style="width: 100%;background: #fff;min-height: 700px;color: #666;" class="userCenterMyProject">
  3. <div style="height: 60px;line-height: 60px;padding-top: 30px;margin-left: 30px;margin-right: 30px; border-bottom: 1px solid rgba(228, 228, 228, 1);">
  4. {{$t('common.IntentionConsultation')}}
  5. </div>
  6. <div style="margin-left: 30px;" class="red">
  7. <el-table
  8. :data="tableData"
  9. stripe
  10. highlight-current-row
  11. @cell-click="projectToView"
  12. style="width: 100%" >
  13. <template slot="empty">
  14. {{$t('common.UserNoData')}}
  15. </template>
  16. <el-table-column type="index" fixed :label="$t('common.serialNumber')" width="120"> </el-table-column>
  17. <el-table-column style="color: red" prop="columnCodeName" :label="$t('common.projectName')" width='320'> </el-table-column>
  18. <el-table-column prop="content" :label="$t('common.ConsultingContent')" width='320'> </el-table-column>
  19. <el-table-column prop="consultMessageInfo.content" :label="$t('common.ReplyContent')" width='320'> </el-table-column>
  20. <el-table-column :prop="senderDate" :formatter="dateFormat" :label="$t('common.ConsultationTime')" width="150"></el-table-column>
  21. <el-table-column fixed="right" prop="address5" :label="$t('common.Option')" width="210">
  22. <template slot-scope="scope">
  23. <el-button
  24. @click="change(scope.row)"
  25. type="text"
  26. size="small"
  27. :disabled="!scope.row.consultMessageInfo"
  28. >
  29. {{$t('common.check')}}
  30. </el-button>
  31. <el-button
  32. @click.native.prevent="deleteRow(scope.$index, tableData)"
  33. type="text"
  34. size="small">
  35. {{$t('common.Delete')}}
  36. </el-button>
  37. </template>
  38. </el-table-column>
  39. </el-table>
  40. </div>
  41. <div style="width: 100%;text-align: center;">
  42. <el-pagination
  43. style="margin-top: 50px;height: 80px;"
  44. background
  45. layout="prev, pager, next"
  46. :total=totalCount @size-change="handleSizeChange"
  47. @current-change="handleCurrentChange">
  48. </el-pagination>
  49. </div>
  50. <el-dialog
  51. v-if="row.consultMessageInfo"
  52. :title="$t('common.IntentionConsultation')"
  53. :visible.sync="dialogVisible"
  54. width="30%"
  55. :before-close="handleClose">
  56. <div style="padding: 0 20px;">
  57. <div class="consultTitle">
  58. <span>{{projectName}}</span>
  59. </div>
  60. <div style="border-bottom:1px solid #dfdfdf">
  61. <div style="margin-top:24px;">
  62. <div style="display:inline-block;background:#0091ff;width:20px;height:20px;color:#fff;line-height:20px;border-radius:50%;text-align:center">Q</div>
  63. <span style="color:#0091ff;margin-left:10px">{{$t('common.qustion')}}:</span>
  64. </div>
  65. <p v-html="row.content"></p>
  66. <span style="float:right;margin-bottom:20px">{{$t('common.qustionTime')}}:{{dateFormat(row)}}</span>
  67. <div style="clear:both"></div>
  68. </div>
  69. <div>
  70. <div style="margin-top:24px;">
  71. <div style="display:inline-block;background:#6dd400;width:20px;height:20px;color:#fff;line-height:20px;border-radius:50%;text-align:center">A</div>
  72. <span style="color:#6dd400;margin-left:10px">{{$t('common.replyMessage')}}</span>
  73. </div>
  74. <p v-html="row.consultMessageInfo.content"></p>
  75. <span style="float:right;margin-bottom:20px">{{$t('common.replyMessageTime')}}:{{dateFormat(row)}}</span>
  76. <div style="clear:both"></div>
  77. </div>
  78. </div>
  79. </el-dialog>
  80. </div>
  81. </template>
  82. <script>
  83. import {getReplyAndSenderMessage,gateDelConsultMessageInfo} from "@/api/operation/consultMessageInfo"
  84. import { getToken,resetToken } from '@/utils/auth'
  85. import { getBaseProjectInfoName } from '@/api/project/baseProjectEntity'
  86. import Base from "@/views/base/Base";
  87. import {getDicts} from '@/api/dict';
  88. import Bus from "@/api/bus";
  89. import moment from 'moment'
  90. export default {
  91. name: 'userCenterMyConsultingService',
  92. extends: Base,
  93. data () {
  94. return {
  95. formInline: {
  96. user: '',
  97. region: ''
  98. },
  99. totalCount:0,
  100. param:{
  101. pageNo:0,
  102. pageSize:10,
  103. language:'',
  104. },
  105. projectName: "",
  106. tableData: [],
  107. row:{},
  108. dialogVisible:false,
  109. params: {
  110. pageNo: 1,
  111. pageSize: 6,
  112. language: '',
  113. continentCountry: "",
  114. technicalCategories: "",
  115. //0为默认排序,1为关注排序
  116. descStatus:0,
  117. messageOpenType:"Y",
  118. status:1
  119. },
  120. }
  121. },
  122. mounted(){
  123. this.getReply();
  124. },
  125. computed: {
  126. // projectMap: function() {
  127. // return this.projectDicts.array2Obj("value", "label");
  128. // }
  129. },
  130. methods:{
  131. toView(router, json) {
  132. var index = this.params.descStatus;
  133. var dataIndex = this.params;
  134. var cruPage = this.params.pageNo;
  135. window.localStorage.setItem('router', router);
  136. this.$store.commit('modify', router);
  137. Bus.$emit("router", router); //存 Bus.$emit
  138. const { href } =this.$router.resolve({
  139. name: router,
  140. query: {
  141. key: json,
  142. screenId:index,
  143. dataIndex:index,
  144. cruPage:cruPage
  145. }
  146. });
  147. window.open(href, '_blank');
  148. },
  149. getReply(){
  150. let token = getToken();
  151. this.param.language = this.$i18n.locale.toUpperCase();
  152. getReplyAndSenderMessage(this.param,this.param.language,token).then(res=>{
  153. console.log(res);
  154. this.tableData=res.data.consultMessageInfos;
  155. this.totalCount=res.data.page.totalCount-0;
  156. this.resetToken();
  157. })
  158. },
  159. dateFormat(row) {
  160. return moment(row.senderDate).format('YYYY-MM-DD');
  161. },
  162. // 编辑
  163. change(row) {
  164. this.row=row;
  165. this.dialogVisible=true;
  166. var language = this.$i18n.locale.toUpperCase()
  167. getBaseProjectInfoName(language,row.columnCode).then(res=>{
  168. this.projectName = res.data.baseProjectInfoName;
  169. })
  170. },
  171. projectToView(row,column,event,cell) {
  172. if(column.property=='columnCodeName'){
  173. this.toView('projectPresentationDetails',row.columnCode)
  174. }
  175. },
  176. // 删除
  177. deleteRow(index, rows) {
  178. this.$confirm(this.$t('common.Thisoperationwillpermanently'), this.$t('common.Tips'), {
  179. confirmButtonText: this.$t('common.OK'),
  180. cancelButtonText: this.$t('common.cancel'),
  181. type: 'warning'
  182. }).then(() => {
  183. gateDelConsultMessageInfo(rows[index].id).then(res=>{
  184. this.$message({
  185. message: res.msg,
  186. type: 'success'
  187. });
  188. this.getReply();
  189. }).catch((error) => {
  190. this.$message.error(res.msg);
  191. })
  192. }).catch(() => {
  193. this.$message({
  194. type: 'info',
  195. message: this.$i18n.locale === 'zh' ? '已取消删除' : 'Deletion canceled',
  196. });
  197. });
  198. },
  199. handleCurrentChange(val) {
  200. this.param.pageNo=val;
  201. this.getReply()
  202. }
  203. }
  204. }
  205. </script>
  206. <style scoped>
  207. .el-input {
  208. width: 200px ;
  209. }
  210. .el-form-item__content,.el-select {
  211. width: 200px !important;
  212. }
  213. .el-table thead {
  214. background: #eee;
  215. }
  216. .userCenterMyProject >>> .el-pagination .el-pager li,
  217. .userCenterMyProject >>> .el-pagination .btn-next,
  218. .userCenterMyProject >>> .el-pagination .btn-prev{
  219. width: 35px;
  220. height: 35px;
  221. line-height: 35px;
  222. }
  223. .userCenterMyProject >>> .el-pagination.is-background .el-pager li:not(.disabled).active {
  224. background: #0050d8;
  225. }
  226. .consultTitle{
  227. font-size: 16px;
  228. font-weight: 700;
  229. text-align: center;
  230. }
  231. .red .el-table >>> td:nth-child(2) .cell{
  232. color: red;
  233. }
  234. </style>