PromptInfo.vue 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212
  1. <template>
  2. <div>
  3. <crumbs title="提示信息维护">
  4. <el-form :inline="true" class="demo-form-inline">
  5. <el-form-item label="静态知识名称:">
  6. <el-input size="mini" v-model="filter.proName" placeholder="静态知识名称"></el-input>
  7. </el-form-item>
  8. <el-form-item label="标签系统名称:">
  9. <el-input size="mini" v-model="filter.proName" placeholder="标签系统名称"></el-input>
  10. </el-form-item>
  11. <el-form-item>
  12. <el-button size="mini" @click="filterDatas">确认</el-button>
  13. <router-link to="/admin/LT-YXSJWH-TJTSXX" style="margin:0 10px">
  14. <el-button size="mini" type="warning">添加静态知识</el-button>
  15. </router-link>
  16. </el-form-item>
  17. </el-form>
  18. </crumbs>
  19. <div class="contents">
  20. <el-table :data="list"
  21. border
  22. style="width: 100%">
  23. <el-table-column
  24. :resizable = "false"
  25. type="index"
  26. :index="indexMethod"
  27. label="编号"
  28. width="60">
  29. </el-table-column>
  30. <el-table-column
  31. :resizable = "false"
  32. prop="gmtOperate"
  33. label="操作时间"
  34. width="180"
  35. :show-overflow-tooltip="true">
  36. </el-table-column>
  37. <el-table-column
  38. :resizable = "false"
  39. prop="name"
  40. label="静态知识名称">
  41. </el-table-column>
  42. <el-table-column
  43. :resizable = "false"
  44. prop="questionList"
  45. label="关联标签"
  46. width="240">
  47. </el-table-column>
  48. <el-table-column
  49. :resizable = "false"
  50. prop="operatorName"
  51. label="操作人"
  52. width="80">
  53. </el-table-column>
  54. <el-table-column
  55. :resizable = "false"
  56. label="操作" width="120">
  57. <template slot-scope="scope">
  58. <el-button type="text" size="small" @click="toEditProduct(scope.row)">修改</el-button>
  59. <span style="margin:0 3px;">|</span>
  60. <el-button type="text" size="small" class="delete" @click="showDelDialog(scope.row.id)">删除</el-button>
  61. </template>
  62. </el-table-column>
  63. <el-table-column
  64. :resizable = "false"
  65. label="详情">
  66. <template slot-scope="scope">
  67. <el-button type="text" size="small" @click="getDetailList(scope.row.id)">详情</el-button>
  68. </template>
  69. </el-table-column>
  70. </el-table>
  71. <el-pagination v-if="total>pageSize"
  72. :current-page.sync="currentPage"
  73. @current-change="currentChange"
  74. background
  75. :page-size="pageSize"
  76. layout="total,prev, pager, next, jumper"
  77. :total="total">
  78. </el-pagination>
  79. </div>
  80. </div>
  81. </template>
  82. <script>
  83. import api from '@api/icss.js';
  84. import utils from '@api/utils.js';
  85. export default {
  86. name: 'prompt-info',
  87. data: function () {
  88. return {
  89. list: [],
  90. cacheData: {},
  91. currentPage: 1,
  92. pageSize: 10,
  93. total: 0,
  94. linkIn:[],
  95. pays:[],
  96. filter: {
  97. proName: ''
  98. }
  99. }
  100. },
  101. created() {
  102. this.getDataList();
  103. },
  104. methods: {
  105. toEditProduct(row){
  106. this.$router.push({
  107. name:'AddPromptInfo',
  108. params: {info:row}
  109. })
  110. },
  111. filterDatas(){
  112. this.currentPage = 1;
  113. this.getDataList();
  114. },
  115. getDataList() {
  116. const param = this.getFilterItems();
  117. // const param = {
  118. // 'name':''
  119. // };
  120. api.getPromptList(param).then((res) => {
  121. if (res.data.code == '0') {
  122. const data = res.data.data;
  123. this.list = data.records;
  124. this.cacheData[param.current] = data.records;
  125. this.total = data.total;
  126. }
  127. }).catch((error) => {
  128. console.log(error);
  129. });
  130. },
  131. getDetailList(id) {
  132. const param = {'id': id,};
  133. this.$router.push({name:'DeptInfoDetail', params:{id: id}})
  134. /*api.getDeptInfoDetials(param).then((res) => {
  135. if (res.data.code == '0') {
  136. this.$router.push({name:'DeptInfoDetail', params:{id: id}})
  137. // console.log("详情接口调用成功");
  138. } else {
  139. this.$message({
  140. showClose: true,
  141. message:res.data.msg,
  142. type:'warning'
  143. });
  144. this.getDataList() //刷新列表
  145. }
  146. }).catch((error) => {
  147. console.log(error);
  148. });*/
  149. },
  150. getFilterItems() {
  151. const param = {
  152. current: this.currentPage,
  153. size: this.pageSize
  154. };
  155. return param;
  156. },
  157. indexMethod(index) {
  158. return ((this.currentPage - 1) * this.pageSize) + index + 1;
  159. },
  160. currentChange(next) {
  161. this.currentPage = next;
  162. if (this.cacheData[next]) { //如果已请求过该页数据,则使用缓存不重复请求
  163. this.list = this.cacheData[next];
  164. } else {
  165. this.getDataList();
  166. }
  167. },
  168. warning(msg,type){
  169. this.$message({
  170. showClose: true,
  171. message:msg,
  172. type:type||'warning'
  173. })
  174. },
  175. showConfirmDialog(msg,resolve){
  176. this.$alert(msg, '提示', {
  177. confirmButtonText: '确定',
  178. type: 'warning'
  179. }).then(() => {
  180. resolve();
  181. }).catch(() => {});
  182. },
  183. showDelDialog(id){
  184. this.showConfirmDialog('是否删除该科室?',()=>{
  185. api.deleteDeptInfo({id}).then((res)=>{
  186. if(res.data.code=='0'){
  187. this.warning(res.data.msg||'操作成功','success');
  188. this.getDataList();
  189. }else{
  190. this.warning(res.data.msg);
  191. }
  192. }).catch((error)=>{
  193. this.warning(error);
  194. })
  195. });
  196. }
  197. }
  198. }
  199. </script>
  200. <style lang="less">
  201. @import "../../less/admin.less";
  202. .status-span{
  203. font-size: 12px;
  204. margin-right:10px;
  205. color: unset;
  206. }
  207. </style>