phcodeList.vue 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204
  1. <style lang="scss">
  2. .avatar-uploader .el-upload {
  3. border: 1px dashed #d9d9d9;
  4. border-radius: 6px;
  5. cursor: pointer;
  6. position: relative;
  7. overflow: hidden;
  8. }
  9. .avatar-uploader .el-upload:hover {
  10. border-color: #409eff;
  11. }
  12. .avatar-uploader-icon {
  13. font-size: 28px;
  14. color: #8c939d;
  15. width: 178px;
  16. height: 178px;
  17. line-height: 178px;
  18. text-align: center;
  19. }
  20. .avatar {
  21. width: 178px;
  22. height: 178px;
  23. display: block;
  24. }
  25. </style>
  26. <template>
  27. <section class="content">
  28. <h4>短信记录列表</h4>
  29. <el-divider></el-divider>
  30. <el-form :inline="true">
  31. <el-form-item label="手机号" >
  32. <el-input v-model="queryParams.phone" placeholder="请输入手机号"></el-input>
  33. </el-form-item>
  34. <el-form-item>
  35. <el-button @click="getData" type="primary">搜索</el-button>
  36. </el-form-item>
  37. </el-form>
  38. <el-table
  39. v-loading="loading"
  40. :data="list"
  41. style="width: 100%; margin-top: 10px"
  42. height="50vh"
  43. >
  44. <el-table-column align="center" prop="phone" label="手机号" />
  45. <el-table-column align="center" prop="code" label="验证码" />
  46. <el-table-column align="center" prop="result" label="发送状态">
  47. <template slot-scope="scope">
  48. <div>
  49. <span style="color:green;" v-if="scope.row.result && scope.row.result.indexOf('success') >-1">成功</span>
  50. <span v-else="失败">失败:{{scope.row.result}}</span>
  51. </div>
  52. </template>
  53. </el-table-column>
  54. <el-table-column align="center" prop="ctime" label="创建时间" />
  55. <el-table-column align="center" prop="date" label="操作" width="320">
  56. <template slot-scope="scope">
  57. <el-button @click="edit(scope.row)" size="mini" type="warning"
  58. >重新发送</el-button
  59. >
  60. </template>
  61. </el-table-column>
  62. </el-table>
  63. <Page
  64. ref="pageButton"
  65. :current="form.page"
  66. :page_size="form.page_size"
  67. :total="total"
  68. @pageChange="gopage"
  69. />
  70. <!-- 新增医生 -->
  71. <el-dialog :title="title" :visible.sync="open" width="800px" append-to-body>
  72. <el-form ref="form" :model="form" :rules="rules" label-width="80px">
  73. <el-form-item label="手机号" prop="name">
  74. <el-input
  75. clearable
  76. v-model="form.phone"
  77. placeholder="请输入手机号"
  78. ></el-input>
  79. </el-form-item>
  80. </el-form>
  81. <div slot="footer" class="dialog-footer">
  82. <el-button @click="open = false">取 消</el-button>
  83. <el-button type="primary" @click="submitForm">发 送</el-button>
  84. </div>
  85. </el-dialog>
  86. </section>
  87. </template>
  88. <script>
  89. import Page from "../../components/Page";
  90. import fuEditor from "@/components/fuEditor/index.vue";
  91. export default {
  92. components: {
  93. Page,
  94. fuEditor
  95. },
  96. data() {
  97. return {
  98. loading: false,
  99. queryParams: {
  100. page: 1,
  101. },
  102. form: {},
  103. form1: {},
  104. form2: {},
  105. list: [{}, {}],
  106. total: 0,
  107. title: "新增用户",
  108. open: false,
  109. doctorList: [],
  110. rules: {},
  111. myConfig: {
  112. // 编辑器自动被内容撑高
  113. autoHeightEnabled: true,
  114. // 初始容器高度
  115. initialFrameHeight: 500,
  116. // 初始容器宽度
  117. initialFrameWidth: '100%',
  118. // 上传文件接口,实现上传图片功能必须的配置,这个地址会在后端配置的时候产生,此处先放上结果
  119. serverUrl: '/api/admin/ueditor/upload',
  120. },
  121. };
  122. },
  123. methods: {
  124. del(id) {
  125. this.$confirm("确认删除?", "提示", {
  126. type: "warning",
  127. }).then(() => {
  128. this.$api
  129. .delDoctorInfo({
  130. id: id,
  131. })
  132. .then((res) => {
  133. if (!res.data.code) {
  134. this.$msgSuccess("删除成功");
  135. this.getData();
  136. } else {
  137. this.$msgError(res.data.message);
  138. }
  139. });
  140. });
  141. },
  142. gopage(size) {
  143. if (size) {
  144. this.queryParams.page_size = size;
  145. }
  146. this.queryParams.page = this.$refs.pageButton.page;
  147. this.getData();
  148. },
  149. getData() {
  150. this.loading = true;
  151. this.$api.getPhoneRecordList(this.queryParams).then((res) => {
  152. this.list = res.data.data.list;
  153. this.total = res.data.data.total;
  154. this.loading = false;
  155. });
  156. },
  157. handleAdd() {
  158. this.open = true;
  159. this.title = "新增医生";
  160. this.form = {};
  161. },
  162. edit(row) {
  163. this.title = "重新发送";
  164. this.open = true;
  165. this.form = row;
  166. },
  167. /** 提交按钮 */
  168. submitForm() {
  169. this.$refs["form"].validate((valid) => {
  170. this.$api.sendPhoneCode(this.form).then(res=>{
  171. if(res.data.data.indexOf("success")>-1){
  172. this.$message.success("成功")
  173. this.open = false
  174. this.getData()
  175. }
  176. })
  177. });
  178. },
  179. remoteMethod(query) {
  180. if (query !== "") {
  181. // this.loading = true;
  182. this.$api
  183. .getDoctorsSearchList({
  184. name: query,
  185. })
  186. .then((res) => {
  187. this.doctorList = res.data.data;
  188. this.$set(this.doctorList, res.data.data);
  189. // this.loading = false;
  190. });
  191. } else {
  192. this.doctorList = [];
  193. }
  194. },
  195. },
  196. created() {
  197. this.getData();
  198. },
  199. };
  200. </script>