select.blade.php 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  1. @extends('layouts.base')
  2. @section('title', "代客下单")
  3. @section('content')
  4. <style>
  5. .rightlist #app .rightlist-head{line-height:50px;padding:15px 0;}
  6. .rightlist #app{margin-left:30px;}
  7. .rightlist #app .el-breadcrumb{padding:30px 0;font-size:16px;}
  8. /* .el-form-item__label{padding-right:30px;} */
  9. .tip{font-size:12px;color:#999;font-weight:500}
  10. .rightlist-head-con{padding-right:20px;font-size:16px;color:#888;}
  11. /* .rightlist-head-con{float:left;padding-right:20px;font-size:16px;color:#888;} */
  12. .el-tag{font-weight:700;font-size:15px;margin-bottom:30px;}
  13. .el-icon-edit{font-size:16px;padding:0 15px;color:#409EFF;cursor: pointer;}
  14. /* 滑块选择小白点 */
  15. .el-switch.is-checked .el-switch__core::after {left: 100%;margin-left: -17px;}
  16. .el-switch__core::after {content: "";position: absolute;top: 1px;left: 1px;border-radius: 100%;transition: all .3s;width: 16px;height: 16px;background-color: #fff;}
  17. .tip1{font-size:12px;color:red;font-weight:500}
  18. [v-cloak]{
  19. display:none;
  20. }
  21. </style>
  22. <div class="rightlist">
  23. <div id="app" v-cloak v-loading="loading">
  24. <div class="rightlist-head">
  25. <div class="rightlist-head-con">代客下单</div>
  26. </div>
  27. <el-form label-width="35%">
  28. <el-form-item label="订单类型">
  29. <el-radio v-model.number="type" :label="1">平台自营</el-radio>
  30. <el-radio v-if="store_enabled == 1" v-model.number="type" :label="2">门店</el-radio>
  31. <el-radio v-if="supplier_enabled ==1" v-model.number="type" :label="3">供应商</el-radio>
  32. </el-form-item>
  33. <el-form-item v-if="type==2" label="选择门店">
  34. <el-select v-model="store_id" placeholder="请输入门店Id或者门店名称" filterable remote :remote-method="remoteSearchStoreOrSupplier" :loading="searchStoreOrSupplierLoading" style="width:50%;">
  35. <el-option v-for="item in storeList" :key="item.id" :label="item.store_name" :value="item.id" ></el-option>
  36. </el-select>
  37. </el-form-item>
  38. <el-form-item v-if="type==3" label="选择供应商">
  39. <el-select v-model="supplier_id" placeholder="请选择供应商Id或者供应商名称" style="width:50%;" filterable remote :remote-method="remoteSearchStoreOrSupplier" :loading="searchStoreOrSupplierLoading">
  40. <el-option v-for="item in supplierList" :key="item.id" :label="item.realname" :value="item.id"></el-option>
  41. </el-select>
  42. </el-form-item>
  43. <el-form-item>
  44. <el-button type="success" @click="next()">下一步</el-button>
  45. </el-form-item>
  46. </el-form>
  47. </div>
  48. <script>
  49. var app = new Vue({
  50. el:"#app",
  51. delimiters: ['[[', ']]'],
  52. data() {
  53. let store_enabled = {{ $store_enabled }};
  54. let supplier_enabled = {{ $supplier_enabled }};
  55. // console.log(store_enabled)
  56. // console.log(supplier_enabled)
  57. return{
  58. type:1,
  59. store_id:"",
  60. store_enabled:store_enabled,
  61. supplier_enabled:supplier_enabled,
  62. supplier_id:"",
  63. loading:false,
  64. table_loading:false,
  65. rules:{},
  66. //分页
  67. total:0,
  68. per_size:0,
  69. current_page:0,
  70. rules:{},
  71. storeList:[],
  72. supplierList:[],
  73. searchStoreOrSupplierLoading:false
  74. }
  75. },
  76. created() {
  77. },
  78. methods: {
  79. remoteSearchStoreOrSupplier(keyword){
  80. if(keyword==""){
  81. return;
  82. }
  83. this.searchStoreOrSupplierLoading=true;
  84. this.$http.post("{!! yzWebFullUrl('plugin.help-user-buying.admin.index.get-source') !!}",{
  85. source_input:keyword,
  86. source:this.type==2?'store-cashier':'supplier'
  87. }).then(res=>{
  88. this.searchStoreOrSupplierLoading=false;
  89. if(res.data.result){
  90. return res.data.data;
  91. }
  92. return Promise.reject(res.data);
  93. }).then(({ stores,supplier })=>{
  94. if(this.type==2){
  95. this.storeList=stores;
  96. }else{
  97. this.supplierList=supplier;
  98. }
  99. }).catch(err=>{
  100. this.$message.error(err.msg);
  101. })
  102. },
  103. next(){
  104. if(this.type==1) {
  105. window.location.href="{!! yzWebFullUrl('plugin.help-user-buying.admin.index.shop-index') !!}";
  106. } else if(this.type==2) {
  107. if(!this.store_id) {
  108. this.$message.error("请选择门店!");
  109. return;
  110. }
  111. window.location.href="{!! yzWebFullUrl('plugin.help-user-buying.admin.index.store-index',['store_id' => '']) !!}"+this.store_id;
  112. } else if(this.type==3) {
  113. if(!this.supplier_id) {
  114. this.$message.error("请选择供应商!");
  115. return;
  116. }
  117. window.location.href="{!! yzWebFullUrl('plugin.help-user-buying.admin.index.supplier-index',['supplier_id' => '']) !!}"+this.supplier_id;
  118. }
  119. // window.location.href="{!! yzWebFullUrl('plugin.help-user-buying.admin.index.store-index',['store_id' => '']) !!}"+;
  120. // window.location.href='{!! yzWebFullUrl('plugin.help-user-buying.admin.index.shop-index') !!}';
  121. // window.location.href='{!! yzWebFullUrl('plugin.help-user-buying.admin.index.shop-index') !!}';
  122. },
  123. // 分页
  124. currentChange(page) {
  125. var that = this;
  126. let json = {page:page,id:that.id,leader_name:that.search_form.leader_name,start_time:that.search_form.start_time,
  127. member_num:that.search_form.member_num,status:that.search_form.status,order_sn:that.search_form.order_sn};
  128. that.getData(json);
  129. },
  130. // 搜索
  131. search() {
  132. var that = this;
  133. console.log(that.search_form)
  134. let json = {page:1,id:that.id,leader_name:that.search_form.leader_name,start_time:that.search_form.start_time,
  135. member_num:that.search_form.member_num,status:that.search_form.status,order_sn:that.search_form.order_sn};
  136. that.getData(json);
  137. },
  138. submitForm() {
  139. var that = this;
  140. that.all_loading = true;
  141. that.$http.post("{!! yzWebFullUrl('plugin.wechat.admin.reply.controller.default-reply.add') !!}",{keywords_id:that.data.id}).then(response => {
  142. console.log(response);
  143. if(response.data.result==1){
  144. that.keyword_list = response.data.data;
  145. that.$message.success("保存成功!");
  146. window.location.href='{!! yzWebFullUrl('plugin.wechat.admin.reply.controller.default-reply.index') !!}';
  147. }
  148. else{
  149. that.$message.error(response.data);
  150. }
  151. that.all_loading = false;
  152. }),function(res){
  153. console.log(res);
  154. that.all_loading = false;
  155. };
  156. },
  157. },
  158. })
  159. </script>
  160. @endsection