reply.vue 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298
  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. width: "220px",
  89. scope: "InfoMore",
  90. },
  91. {
  92. label: "商品名称",
  93. prop: "goodsName",
  94. hidden: true,
  95. },
  96. {
  97. label: "提问内容",
  98. prop: "answerText",
  99. hidden: true,
  100. },
  101. {
  102. label: "提问人",
  103. prop: "assignRealname",
  104. hidden: true,
  105. },
  106. {
  107. label: "提问时间",
  108. prop: "createTime",
  109. hidden: true,
  110. scope: "aTimeList",
  111. },
  112. {
  113. label: "回复内容",
  114. prop: "answerText",
  115. hidden: true,
  116. },
  117. {
  118. label: "回复人",
  119. prop: "realname",
  120. hidden: true,
  121. },
  122. {
  123. label: "回复时间",
  124. prop: "createTime",
  125. hidden: true,
  126. scope: "aTimeList",
  127. width:"190px"
  128. },
  129. ],
  130. tableData: [], //表单数据
  131. total: 0, //一共多少条
  132. };
  133. },
  134. activated(){
  135. this.search();
  136. },
  137. methods: {
  138. search(int) {
  139. this.loading = true;
  140. if (int === 1) {
  141. this.formData.pageNum = 1;
  142. }
  143. if (int === 2) {
  144. this.formData = {
  145. status: 1,
  146. pageSize: 10,
  147. pageNum: 1,
  148. msgType: 2,
  149. };
  150. }
  151. if (int === 3) {
  152. this.formData.pageNum = 1;
  153. }
  154. var data = JSON.parse(JSON.stringify(this.formData));
  155. this.$api
  156. .inquirecourseanswerlist(data)
  157. .then((res) => {
  158. this.tableData = res.rows;
  159. this.total = res.total;
  160. this.navText.index = res.total;
  161. })
  162. .finally(() => {
  163. this.loading = false;
  164. });
  165. },
  166. init() {
  167. this.search(2);
  168. },
  169. del(v) {
  170. this.$alert(
  171. "确定删除此内容?<br />内容删除后将无法恢复,请慎重考虑",
  172. "提示",
  173. {
  174. dangerouslyUseHTMLString: true,
  175. }
  176. )
  177. .then(() => {
  178. // var data = {
  179. // goodsId: v.goodsId,
  180. // status: -1,
  181. // };
  182. // this.$api.editGoods(data).then((res) => {
  183. // this.$message.success("删除成功");
  184. // this.search();
  185. // });
  186. })
  187. .catch(() => {
  188. this.$message({
  189. type: "info",
  190. message: "已取消删除",
  191. });
  192. });
  193. },
  194. handleSizeChange(v) {
  195. this.formData.pageSize = v;
  196. this.formData.pageNum = 1;
  197. this.search();
  198. },
  199. handleCurrentChange(v) {
  200. this.formData.pageNum = v;
  201. this.search();
  202. },
  203. },
  204. };
  205. </script>
  206. <style lang="less" scoped>
  207. /deep/.el-button {
  208. border-radius: 8px;
  209. }
  210. /deep/.el-dialog {
  211. border-radius: 8px;
  212. .el-dialog__header {
  213. padding: 0;
  214. .hearders {
  215. height: 40px;
  216. display: flex;
  217. align-items: center;
  218. justify-content: space-between;
  219. padding: 0px 18px 0px 20px;
  220. border-bottom: 1px solid #e2e2e2;
  221. .leftTitle {
  222. font-size: 14px;
  223. font-weight: bold;
  224. color: #2f4378;
  225. }
  226. .rightBoxs {
  227. display: flex;
  228. align-items: center;
  229. img {
  230. width: 14px;
  231. height: 14px;
  232. margin-left: 13px;
  233. cursor: pointer;
  234. }
  235. }
  236. }
  237. }
  238. .el-dialog__footer {
  239. padding: 0;
  240. .dialog-footer {
  241. padding: 0px 40px;
  242. height: 70px;
  243. border-top: 1px solid #e2e2e2;
  244. display: flex;
  245. align-items: center;
  246. justify-content: flex-end;
  247. }
  248. }
  249. }
  250. .imgBox {
  251. width: 100%;
  252. // height: 210px;
  253. border: 1px solid #e2e2e2;
  254. border-radius: 8px;
  255. padding: 8px 8px 3px;
  256. display: flex;
  257. flex-direction: column;
  258. align-items: center;
  259. .imgLabel {
  260. flex: 1;
  261. width: 100%;
  262. border: 1px dotted #e2e2e2;
  263. color: #999;
  264. font-size: 14px;
  265. cursor: pointer;
  266. border-radius: 8px;
  267. .msPhoto {
  268. display: flex;
  269. justify-content: center;
  270. align-items: center;
  271. max-width: 100%;
  272. max-height: 270px;
  273. img {
  274. max-width: 100%;
  275. max-height: 270px;
  276. }
  277. }
  278. .imgbbx {
  279. display: flex;
  280. flex-direction: column;
  281. align-items: center;
  282. justify-content: center;
  283. width: 100%;
  284. height: 100%;
  285. i {
  286. font-weight: bold;
  287. margin: 14px 0;
  288. font-size: 24px;
  289. }
  290. }
  291. }
  292. p {
  293. margin: 5px 0px;
  294. }
  295. }
  296. </style>