middleground-configuration.blade.php 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310
  1. @extends('layouts.base')
  2. @section('title', '中台配置列表')
  3. @section('content')
  4. <link rel="stylesheet" href="{{resource_get('plugins/store-cashier/src/common/static/index.css')}}">
  5. <link rel="stylesheet" href="{{resource_get('plugins/yz-supply/assent/css/album1.css?time='.time())}}">
  6. <style>
  7. .edit-i{display:none;}
  8. .el-table_1_column_2:hover .edit-i{font-weight:900;padding:0;margin:0;display:inline-block;}
  9. .el-tabs__item,.is-top{font-size:16px}
  10. .el-tabs__active-bar { height: 3px;}
  11. .iframe {
  12. position: absolute;
  13. width: 100%;
  14. height: 100%;
  15. background: #fff;
  16. overflow-y: hidden;
  17. }
  18. </style>
  19. <div class="all">
  20. <div id="qrcode" ref="qrcode" style="display:none;"></div>
  21. <div id="app" v-cloak>
  22. <div class="vue-head">
  23. <div class="top-title">
  24. <span :class="item.class" v-for="(item,index) in albumTopTitle" @click="skipUrl(item)" :key="index">[[item.name]]</span>
  25. </div>
  26. </div>
  27. <div class="vue-head">
  28. <div class="vue-main-title" style="margin-bottom:20px">
  29. <div class="vue-main-title-left"></div>
  30. <div class="vue-main-title-content">中台配置列表</div>
  31. <div class="vue-main-title-button">
  32. <el-button type="primary" plain icon="el-icon-plus" size="small" @click="add">添加供应链</el-button>
  33. </div>
  34. </div>
  35. <div class="vue-search">
  36. <el-form :inline="true" :model="search_form" class="demo-form-inline">
  37. <el-form-item label="" prop="title">
  38. <el-input v-model="search_form.title" placeholder="供应链名称"></el-input>
  39. </el-form-item>
  40. <el-form-item label="">
  41. <el-button type="primary" @click="search(1)">搜索</el-button>
  42. </el-form-item>
  43. <div style="color: red">*关闭配置会下架所有商品,关闭之后再开启不会上架任何商品</div>
  44. </el-form>
  45. </div>
  46. </div>
  47. <div class="vue-main">
  48. <div class="vue-main-form">
  49. <div class="vue-main-title" style="margin-bottom:20px">
  50. <div class="vue-main-title-left"></div>
  51. <div class="vue-main-title-content" style="flex:0 0 130px">中台配置列表</div>
  52. <div class="vue-main-title-button">
  53. </div>
  54. </div>
  55. <el-table :data="list" style="width: 100%;margin-bottom: 130px;!important;" :class="table_loading==true?'loading-height':''" v-loading="table_loading" >
  56. <el-table-column prop="id" label="ID" width="70" align="center"></el-table-column>
  57. <el-table-column prop="title" label="供应链名称" align="center"></el-table-column>
  58. <el-table-column prop="tel" label="手机号" align="center"></el-table-column>
  59. <el-table-column prop="app_key" label="appKey" align="center"></el-table-column>
  60. <el-table-column prop="app_url" label="供应链API地址" align="center"></el-table-column>
  61. <el-table-column label="状态" prop="status_message" align="center">
  62. <template slot-scope="scope">
  63. [[scope.row.status == 1?'开启':'关闭']]
  64. <el-switch v-model="scope.row.status" :active-value="1" :inactive-value="2" @change="putAway(scope.row.id,scope.$index)"></el-switch>
  65. </template>
  66. </el-table-column>
  67. <el-table-column prop="sort" label="排序" width="" align="center">
  68. <template slot-scope="scope">
  69. [[scope.row.sort]]
  70. </template>
  71. </el-table-column>
  72. <el-table-column prop="created_at" label="创建时间" width="" align="center">
  73. <template slot-scope="scope">
  74. [[scope.row.created_at]]
  75. </template>
  76. </el-table-column>
  77. <el-table-column label="操作" width="" align="center">
  78. <template slot-scope="scope">
  79. <div class="table-option">
  80. <a :href="'{{ yzWebFullUrl('plugin.yz-supply.admin.middleground-configuration.edit', array('id' => '')) }}'+[[scope.row.id]]">
  81. 编辑
  82. </a>&nbsp;&nbsp;
  83. <a @click="delMid(scope.row.id)">
  84. 删除
  85. </a>&nbsp;&nbsp;
  86. <div>
  87. <input v-model="scope.row.link" :ref="'list'+scope.row.id" style="position:absolute;opacity:0;height:1px;" />
  88. </div>
  89. </div>
  90. </template>
  91. </el-table-column>
  92. </el-table>
  93. </div>
  94. </div>
  95. <!-- 分页 -->
  96. <div class="vue-page" v-if="total>0">
  97. <el-row>
  98. <el-col align="right">
  99. <el-pagination layout="prev, pager, next,jumper" @current-change="search" :total="total"
  100. :page-size="per_size" :current-page="current_page" background
  101. ></el-pagination>
  102. </el-col>
  103. </el-row>
  104. </div>
  105. </div>
  106. </div>
  107. <script src="{{resource_get('static/js/qrcode.min.js')}}"></script>
  108. <script>
  109. var app = new Vue({
  110. el:"#app",
  111. delimiters: ['[[', ']]'],
  112. data() {
  113. return{
  114. albumTopTitle: [
  115. {
  116. id: 1,
  117. name: "基础设置",
  118. class:"album-name-against",
  119. url:"{!! yzWebFullUrl('plugin.yz-supply.admin.set.index') !!}"
  120. },
  121. {
  122. id: 2,
  123. name: "中台配置列表",
  124. class:"album-name",
  125. url:"{!! yzWebFullUrl('plugin.yz-supply.admin.middleground-configuration.index') !!}"
  126. },
  127. {
  128. id: 3,
  129. name: "支付设置",
  130. class:"album-name-against",
  131. url:"{!! yzWebFullUrl('plugin.yz-supply.admin.set.pay') !!}"
  132. },
  133. {
  134. id: 4,
  135. name: "快递匹配",
  136. class:"album-name-against",
  137. url:"{!! yzWebFullUrl('plugin.yz-supply.admin.express-matching.index') !!}"
  138. },
  139. {
  140. id: 5,
  141. name: "导入分类",
  142. class:"album-name-against",
  143. url:"{!! yzWebFullUrl('plugin.yz-supply.admin.import-categorys.index') !!}"
  144. },
  145. ],
  146. is_initialize:{!! $is_initialize ? $is_initialize:0 !!},
  147. list:[],//商品列表
  148. table_loading:false,
  149. all_loading:false,
  150. loading:false,
  151. search_form:{},
  152. //分页
  153. total:0,
  154. per_size:0,
  155. current_page:0,
  156. }
  157. },
  158. created() {
  159. if(this.is_initialize == 1){
  160. this.initialize();
  161. }else{
  162. this.getData(1);
  163. }
  164. },
  165. methods: {
  166. skipUrl(item){
  167. window.location.href = item.url
  168. },
  169. initialize(){
  170. var that = this;
  171. that.$message.success("首次进入,会初始化,将基础配置中的参数添加到中台配置列表中,以及其他一些兼容多中台的设置。");
  172. that.table_loading = true;
  173. that.$http.post("{!! yzWebFullUrl('plugin.yz-supply.admin.middleground-configuration.initialize') !!}").then(response => {
  174. if(response.data.result==1){
  175. that.$message.success("初始化成功");
  176. location.reload();
  177. }
  178. else{
  179. that.$message.error(response.data.msg);
  180. }
  181. that.table_loading = false;
  182. }),function(res){
  183. console.log(res);
  184. that.table_loading = false;
  185. };
  186. },
  187. delMid(id){
  188. var that = this;
  189. that.table_loading = true;
  190. let json = {id:id};
  191. this.$confirm('确认删除?', '提示', {confirmButtonText: '确定',cancelButtonText: '取消',type: 'warning'}).then(() => {
  192. that.$http.post("{!! yzWebFullUrl('plugin.yz-supply.admin.middleground-configuration.del-mid') !!}",json).then(response => {
  193. if(response.data.result==1){
  194. that.$message.success('操作成功!');
  195. this.getData(1);
  196. }else{
  197. that.$message.error(response.data.msg);
  198. }
  199. that.table_loading = false;
  200. }),function(res){
  201. console.log(res);
  202. that.table_loading = false;
  203. };
  204. }).catch(() => {
  205. that.table_loading = false;
  206. this.$message({type: 'info',message: '已取消操作'});
  207. });
  208. },
  209. add(){
  210. window.location.href = "{!! yzWebFullUrl('plugin.yz-supply.admin.middleground-configuration.add') !!}";
  211. },
  212. putAway(id,index) {
  213. var that = this;
  214. that.table_loading = true;
  215. let json = {id:id};
  216. // yzWebFullUrl('plugin.yz-supply.admin.shop-goods.goods-search')
  217. that.$http.post("{!! yzWebFullUrl('plugin.yz-supply.admin.middleground-configuration.setPutaway') !!}",json).then(response => {
  218. console.log(response);
  219. if(response.data.result==1){
  220. that.$message.success('操作成功!');
  221. }
  222. else{
  223. that.$message.error(response.data.msg);
  224. that.goods_list[index].status == 1 ? 2 : 1;
  225. }
  226. that.table_loading = false;
  227. }),function(res){
  228. console.log(res);
  229. that.table_loading = false;
  230. };
  231. },
  232. getData(page){
  233. var that = this;
  234. that.table_loading = true;
  235. that.$http.post("{!! yzWebFullUrl('plugin.yz-supply.admin.middleground-configuration.index-list') !!}",{page:page,search:that.search_form}).then(response => {
  236. if(response.data.result==1){
  237. that.list = response.data.data.page_data.data;
  238. that.total = response.data.data.page_data.total;
  239. that.current_page = response.data.data.page_data.current_page;
  240. that.per_size = response.data.data.page_data.per_page;
  241. }
  242. else{
  243. that.$message.error(response.data.msg);
  244. }
  245. that.table_loading = false;
  246. }),function(res){
  247. console.log(res);
  248. that.table_loading = false;
  249. };
  250. },
  251. // 搜索、分页
  252. search(page) {
  253. this.getData(page);
  254. },
  255. // 上一页
  256. prev() {
  257. let page = parseInt(this.current_page) - 1;
  258. if (page < 1) {
  259. return false;
  260. }
  261. this.getMessageList(page);
  262. },
  263. //下一页
  264. next() {
  265. let page = parseInt(this.current_page) + 1;
  266. if (this.per_size < this.page_number) {
  267. return false;
  268. }
  269. this.getMessageList(page);
  270. },
  271. //跳页
  272. jumpPage() {
  273. if (this.current_page <= 1) {
  274. this.current_page = 1;
  275. }
  276. // if(this.current_page>100){
  277. // this.current_page = 100
  278. // }
  279. this.getMessageList(this.current_page);
  280. },
  281. },
  282. })
  283. </script>
  284. @endsection