wechat_tmp_list.blade.php 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236
  1. @extends('layouts.base')
  2. @section('title', '微信模板管理')
  3. @section('content')
  4. <style>
  5. .panel{
  6. margin-bottom:10px!important;
  7. border-radius: 10px;
  8. padding-left: 20px;
  9. }
  10. .panel .active a {
  11. background-color: #29ba9c!important;
  12. border-radius: 18px!important;
  13. color:#fff;
  14. }
  15. .panel a{
  16. border:none!important;
  17. background-color:#fff!important;
  18. }
  19. .content{
  20. background: #eff3f6;
  21. padding: 10px!important;
  22. }
  23. .con{
  24. position:relative;
  25. border-radius: 8px;
  26. min-height:100vh;
  27. background: #fff;
  28. }
  29. .con .setting .block{
  30. padding:10px;
  31. background-color:#fff;
  32. border-radius: 8px;
  33. margin-bottom:10px;
  34. }
  35. .con .setting .block .title{
  36. font-size:18px;
  37. margin-bottom:15px;
  38. display:flex;
  39. align-items:center;
  40. justify-content:space-between;
  41. }
  42. .el-form-item{
  43. padding-left:300px;
  44. margin-bottom:10px!important;
  45. }
  46. .confirm-btn{
  47. width: 100%;
  48. position:absolute;
  49. bottom:0;
  50. left:0;
  51. line-height:63px;
  52. background-color: #ffffff;
  53. box-shadow: 0px 8px 23px 1px
  54. rgba(51, 51, 51, 0.3);
  55. background-color:#fff;
  56. text-align:center;
  57. }
  58. .add{
  59. width: 154px;
  60. height: 36px;
  61. border-radius: 4px;
  62. border: solid 1px #29ba9c;
  63. color:#29ba9c;
  64. display:flex;
  65. align-items:center;
  66. justify-content:center;
  67. }
  68. .el-table--fit{
  69. margin-top:-10px;
  70. }
  71. b{
  72. font-size:14px;
  73. }
  74. .el-checkbox__inner{
  75. border:solid 1px #56be69!important;
  76. }
  77. .el-table--border::after, .el-table--group::after, .el-table::before{
  78. background-color:#fff;
  79. }
  80. </style>
  81. <div id='re_content' >
  82. @include('layouts.newTabs')
  83. <div class="con">
  84. <div class="setting">
  85. <div class="block">
  86. <div class="title"><div style="display:flex;align-items:center;"><span style="width: 4px;height: 18px;background-color: #29ba9c;margin-right:15px;display:inline-block;"></span><b>添加模板</b>
  87. <i class="iconfont icon-ht_tips" style="font-size:16px;color:#ff9b19;margin-left:16px;" slot="reference">
  88. <el-popover
  89. placement="bottom-start"
  90. title="提示"
  91. width="400"
  92. trigger="hover"
  93. content="请将公众平台模板消息所在行业选择为:IT科技/互联网|电子商务 其他/其他,所选行业不一致将会导致模板消息不可用。
  94. 您的公众平台模板消息目前所属行业为:IT科技/互联网|电子商务 IT科技/IT软件与服务。
  95. 当前列表内的模板消息为您已申请的模板消息,您可以点击查看详情或者删除处理。">
  96. <el-button slot="reference" style="opacity: 0;margin-left:-10px;"></el-button>
  97. </el-popover>
  98. </i>
  99. </div>
  100. </div>
  101. <el-input style="width:15%;margin-right:16px;" placeholder="请输入模板编号" v-model="tempcode"></el-input><el-button type="primary" @click="addWechat">添加微信模板</el-button>
  102. </div>
  103. <div style="background: #eff3f6;width:100%;height:15px;"></div>
  104. <div class="block">
  105. <div class="title"><div style="display:flex;align-items:center;"><span style="width: 4px;height: 18px;background-color: #29ba9c;margin-right:15px;display:inline-block;"></span><b>模板列表</b><el-button style="margin-left:15px;" size="mini" type="primary">删除</el-button></div></div>
  106. </div>
  107. <el-table
  108. :data="list"
  109. style="width: 100%;padding:0 10px;"
  110. @selection-change="handleSelectionChange"
  111. >
  112. <el-table-column
  113. label="全选"
  114. type="selection"
  115. align="center"
  116. >
  117. </el-table-column>
  118. <el-table-column
  119. align="center"
  120. label="序号"
  121. >
  122. <template slot-scope="scope" >
  123. [[scope.row.id]]
  124. </template>
  125. </el-table-column>
  126. <el-table-column
  127. prop="title"
  128. align="center"
  129. label="模板名称"
  130. >
  131. </el-table-column>
  132. <el-table-column
  133. prop="primary_industry"
  134. align="center"
  135. label=" 所属行业"
  136. >
  137. </el-table-column>
  138. <el-table-column
  139. align="center"
  140. label="操作"
  141. >
  142. <template slot-scope="scope" >
  143. <a :href="'{{ yzWebFullUrl('setting.wechat-notice.see', array('tmp_id' => '')) }}'+[[scope.row.template_id]]" style="color:#999;margin-right:35px;"><i class="iconfont icon-ht_operation_perview" style="font-size:16px;"></i></a>
  144. <a style="color:#999"><i class="iconfont icon-ht_operation_delete" style="font-size:16px;" @click="del(scope, list)"></i></a>
  145. </template>
  146. </el-table-column>
  147. </el-table>
  148. </template>
  149. </div>
  150. </div>
  151. </div>
  152. <script>
  153. var vm = new Vue({
  154. el: "#re_content",
  155. delimiters: ['[[', ']]'],
  156. data() {
  157. return {
  158. list:[],
  159. tempcode:'',
  160. activeName: 'one',
  161. multipleSelection:[]
  162. }
  163. },
  164. mounted () {
  165. this.getData();
  166. },
  167. methods: {
  168. handleSelectionChange(val) {
  169. this.multipleSelection = val;
  170. },
  171. // allDelete(){
  172. // rows.splice(scope.$index, 1);
  173. // let json={
  174. // id:scope.row.id
  175. // }
  176. // this.$http.post('{!! yzWebFullUrl('setting.wechat-notice.del') !!}',json).then(function (response){
  177. // if (response.data.result) {
  178. // this.$message({message:"删除成功!",type:"success"});
  179. // this.loading = false;
  180. // }else {
  181. // this.$message({message: response.data.msg,type: 'error'});
  182. // }
  183. // },function (response) {
  184. // console.log(response);
  185. // this.loading = false;
  186. // }
  187. // );
  188. // },
  189. addWechat(){
  190. this.$http.post('{!! yzWebFullUrl('setting.wechat-notice.addTmp') !!}',{ templateidshort:this.tempcode}).then(function (response){
  191. if (response.data.result) {
  192. this.$message({message: response.data.msg,type: 'success'});
  193. }else{
  194. this.$message({message: response.data.msg,type: 'error'});
  195. }
  196. },function (response) {
  197. this.$message({message: response.data.msg,type: 'error'});
  198. })
  199. },
  200. del(scope,rows){
  201. rows.splice(scope.$index, 1);
  202. let json={
  203. id:scope.row.template_id
  204. }
  205. this.$http.post('{!! yzWebFullUrl('setting.wechat-notice.del') !!}',json).then(function (response){
  206. if (response.data.result) {
  207. this.$message({message:"删除成功!",type:"success"});
  208. this.loading = false;
  209. }else {
  210. this.$message({message: response.data.msg,type: 'error'});
  211. }
  212. },function (response) {
  213. console.log(response);
  214. this.loading = false;
  215. }
  216. );
  217. },
  218. getData(){
  219. this.$http.post('{!! yzWebFullUrl('setting.wechat-notice.index') !!}').then(function (response){
  220. if (response.data.result) {
  221. this.list=response.data.data.list;
  222. this.list.forEach((item,index,key)=>{
  223. item.id=index+1
  224. })
  225. }else{
  226. this.$message({message: response.data.msg,type: 'error'});
  227. }
  228. },function (response) {
  229. this.$message({message: response.data.msg,type: 'error'});
  230. })
  231. },
  232. },
  233. });
  234. </script>
  235. @endsection