reply.vue 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297
  1. <template>
  2. <div id="reply">
  3. <search-box-new
  4. ref="searchBox"
  5. :formData="formData"
  6. :formList="formList"
  7. @search="search"
  8. @init="init"
  9. />
  10. <table-list
  11. :tableSets="tableSet"
  12. :tableData="tableData"
  13. :navText="navText"
  14. :loading="loading"
  15. >
  16. <template slot="btn" slot-scope="props">
  17. <el-button type="text" @click="del(props.scope.row)">删除</el-button>
  18. </template>
  19. </table-list>
  20. <pagination
  21. :total="total"
  22. :pageSize="formData.pageSize"
  23. :currentPage="formData.pageNum"
  24. @handleSizeChange="handleSizeChange"
  25. @handleCurrentChange="handleCurrentChange"
  26. />
  27. </div>
  28. </template>
  29. <script>
  30. import searchBoxNew from "@/components/searchBoxNew";
  31. import tableList from "@/components/tableList";
  32. import pagination from "@/components/pagination";
  33. export default {
  34. name: "reply",
  35. components: { searchBoxNew, tableList, pagination },
  36. data() {
  37. return {
  38. loading: false, //当前表单加载是否加载动画
  39. navText: {
  40. title: "回复信息",
  41. index: 0,
  42. ch: "条",
  43. num: false,
  44. border: true,
  45. choice: true,
  46. addHide: true,
  47. backFatherBtn: {
  48. status: false,
  49. title: "未定义",
  50. },
  51. },
  52. //搜索
  53. formList: [
  54. {
  55. prop: "educationTypeId",
  56. placeholder: "教育类型",
  57. scope: "educationType",
  58. },
  59. {
  60. prop: "businessId",
  61. placeholder: "业务层次",
  62. scope: "businessLevel",
  63. edu: "educationTypeId",
  64. },
  65. {
  66. prop: "searchKey",
  67. placeholder: "请输入商品标题/提问内容",
  68. },
  69. ],
  70. formData: {
  71. status: 1,
  72. pageSize: 10,
  73. pageNum: 1,
  74. msgType: 2,
  75. },
  76. // 表单
  77. tableSet: [
  78. {
  79. label: "教育类型",
  80. prop: "educationName",
  81. hidden: true,
  82. },
  83. {
  84. label: "业务层次",
  85. prop1: "projectName",
  86. prop2: "businessName",
  87. hidden: true,
  88. scope: "InfoMore",
  89. },
  90. {
  91. label: "商品名称",
  92. prop: "goodsName",
  93. hidden: true,
  94. },
  95. {
  96. label: "提问内容",
  97. prop: "answerText",
  98. hidden: true,
  99. },
  100. {
  101. label: "提问人",
  102. prop: "assignRealname",
  103. hidden: true,
  104. },
  105. {
  106. label: "提问时间",
  107. prop: "createTime",
  108. hidden: true,
  109. scope: "aTimeList",
  110. },
  111. {
  112. label: "回复内容",
  113. prop: "assignAnswerText",
  114. hidden: true,
  115. width:"250px"
  116. },
  117. {
  118. label: "回复人",
  119. prop: "realname",
  120. hidden: true,
  121. },
  122. {
  123. label: "回复时间",
  124. prop: "createTime",
  125. hidden: true,
  126. scope: "aTimeList",
  127. },
  128. ],
  129. tableData: [], //表单数据
  130. total: 0, //一共多少条
  131. };
  132. },
  133. activated(){
  134. this.search();
  135. },
  136. methods: {
  137. search(int) {
  138. this.loading = true;
  139. if (int === 1) {
  140. this.formData.pageNum = 1;
  141. }
  142. if (int === 2) {
  143. this.formData = {
  144. status: 1,
  145. pageSize: 10,
  146. pageNum: 1,
  147. msgType: 2,
  148. };
  149. }
  150. if (int === 3) {
  151. this.formData.pageNum = 1;
  152. }
  153. var data = JSON.parse(JSON.stringify(this.formData));
  154. this.$api
  155. .inquirecourseanswerlist(data)
  156. .then((res) => {
  157. this.tableData = res.rows;
  158. this.total = res.total;
  159. this.navText.index = res.total;
  160. })
  161. .finally(() => {
  162. this.loading = false;
  163. });
  164. },
  165. init() {
  166. this.search(2);
  167. },
  168. del(v) {
  169. this.$alert(
  170. "确定删除此内容?<br />内容删除后将无法恢复,请慎重考虑",
  171. "提示",
  172. {
  173. dangerouslyUseHTMLString: true,
  174. }
  175. )
  176. .then(() => {
  177. // var data = {
  178. // goodsId: v.goodsId,
  179. // status: -1,
  180. // };
  181. // this.$api.editGoods(data).then((res) => {
  182. // this.$message.success("删除成功");
  183. // this.search();
  184. // });
  185. })
  186. .catch(() => {
  187. this.$message({
  188. type: "info",
  189. message: "已取消删除",
  190. });
  191. });
  192. },
  193. handleSizeChange(v) {
  194. this.formData.pageSize = v;
  195. this.formData.pageNum = 1;
  196. this.search();
  197. },
  198. handleCurrentChange(v) {
  199. this.formData.pageNum = v;
  200. this.search();
  201. },
  202. },
  203. };
  204. </script>
  205. <style lang="less" scoped>
  206. /deep/.el-button {
  207. border-radius: 8px;
  208. }
  209. /deep/.el-dialog {
  210. border-radius: 8px;
  211. .el-dialog__header {
  212. padding: 0;
  213. .hearders {
  214. height: 40px;
  215. display: flex;
  216. align-items: center;
  217. justify-content: space-between;
  218. padding: 0px 18px 0px 20px;
  219. border-bottom: 1px solid #e2e2e2;
  220. .leftTitle {
  221. font-size: 14px;
  222. font-weight: bold;
  223. color: #2f4378;
  224. }
  225. .rightBoxs {
  226. display: flex;
  227. align-items: center;
  228. img {
  229. width: 14px;
  230. height: 14px;
  231. margin-left: 13px;
  232. cursor: pointer;
  233. }
  234. }
  235. }
  236. }
  237. .el-dialog__footer {
  238. padding: 0;
  239. .dialog-footer {
  240. padding: 0px 40px;
  241. height: 70px;
  242. border-top: 1px solid #e2e2e2;
  243. display: flex;
  244. align-items: center;
  245. justify-content: flex-end;
  246. }
  247. }
  248. }
  249. .imgBox {
  250. width: 100%;
  251. // height: 210px;
  252. border: 1px solid #e2e2e2;
  253. border-radius: 8px;
  254. padding: 8px 8px 3px;
  255. display: flex;
  256. flex-direction: column;
  257. align-items: center;
  258. .imgLabel {
  259. flex: 1;
  260. width: 100%;
  261. border: 1px dotted #e2e2e2;
  262. color: #999;
  263. font-size: 14px;
  264. cursor: pointer;
  265. border-radius: 8px;
  266. .msPhoto {
  267. display: flex;
  268. justify-content: center;
  269. align-items: center;
  270. max-width: 100%;
  271. max-height: 270px;
  272. img {
  273. max-width: 100%;
  274. max-height: 270px;
  275. }
  276. }
  277. .imgbbx {
  278. display: flex;
  279. flex-direction: column;
  280. align-items: center;
  281. justify-content: center;
  282. width: 100%;
  283. height: 100%;
  284. i {
  285. font-weight: bold;
  286. margin: 14px 0;
  287. font-size: 24px;
  288. }
  289. }
  290. }
  291. p {
  292. margin: 5px 0px;
  293. }
  294. }
  295. </style>