info.blade.php 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  1. @extends('layouts.base')
  2. @section('title', '物流公司信息详情')
  3. @section('content')
  4. <link rel="stylesheet" type="text/css" href="{{static_url('yunshop/goods/vue-goods1.css')}}"/>
  5. <div class="all">
  6. <div id="app" v-cloak>
  7. <div class="vue-main">
  8. <div class="vue-main-title">
  9. <div class="vue-main-title-left"></div>
  10. <div class="vue-main-title-content">公司信息</div>
  11. </div>
  12. <p style="color: red;padding-left: 135px;">注:仅支持快递鸟支持的物流公司,若快递鸟不支持或填错快递公司名称和快递公司编码,会导致无法查询物流信息(编码区分大小写)</p>
  13. <div class="vue-main-form">
  14. <el-form ref="form" :model="form" :rules="rules" label-width="15%">
  15. <el-form-item label="物流公司名称" prop="name">
  16. <el-input v-model="form.name" style="width:70%;"></el-input>
  17. </el-form-item>
  18. <el-form-item label="物流公司编码" prop="value">
  19. <el-input v-model="form.value" style="width:70%;"></el-input>
  20. </el-form-item>
  21. </el-form>
  22. </div>
  23. </div>
  24. <!-- 分页 -->
  25. <div class="vue-page">
  26. <div class="vue-center">
  27. <el-button type="primary" @click="submitForm('form')">保存设置</el-button>
  28. <el-button @click="goBack">返回</el-button>
  29. </div>
  30. </div>
  31. <upload-img :upload-show="uploadShow" :name="chooseImgName" @replace="changeProp" @sure="sureImg"></upload-img>
  32. </div>
  33. </div>
  34. <script src="{{resource_get('static/yunshop/tinymce4.7.5/tinymce.min.js')}}"></script>
  35. <!-- <script src="{{resource_get('static/yunshop/tinymceTemplate.js')}}"></script> -->
  36. @include('public.admin.tinymceee')
  37. @include('public.admin.uploadImg')
  38. <script>
  39. var app = new Vue({
  40. el:"#app",
  41. delimiters: ['[[', ']]'],
  42. name: 'test',
  43. data() {
  44. let id = {!! $id?:0 !!};
  45. console.log(id);
  46. return{
  47. id:id,
  48. form:{
  49. },
  50. uploadShow:false,
  51. chooseImgName:'',
  52. submit_url:'',
  53. showVisible:false,
  54. loading: false,
  55. uploadImg1:'',
  56. rules:{
  57. name:{ required: true, message: '请输入物流公司名称'},
  58. value:{ required: true, message: '请输入物流公司编码'}
  59. },
  60. }
  61. },
  62. created() {
  63. },
  64. mounted() {
  65. // this.getData();
  66. if(this.id) {
  67. this.getData();
  68. this.submit_url = '{!! yzWebFullUrl('plugin.express-company.Backend.Controllers.list.edit-company') !!}';
  69. }
  70. else {
  71. this.submit_url = '{!! yzWebFullUrl('plugin.express-company.Backend.Controllers.list.add-company') !!}';
  72. }
  73. },
  74. methods: {
  75. getData() {
  76. let loading = this.$loading({target:document.querySelector(".content"),background: 'rgba(0, 0, 0, 0)'});
  77. this.$http.post('{!! yzWebFullUrl('plugin.express-company.Backend.Controllers.list.edit-company') !!}',{id:this.id}).then(function (response) {
  78. if (response.data.result){
  79. this.form = {
  80. ...response.data.data,
  81. };
  82. }
  83. else {
  84. this.$message({message: response.data.msg,type: 'error'});
  85. }
  86. loading.close();
  87. },function (response) {
  88. this.$message({message: response.data.msg,type: 'error'});
  89. loading.close();
  90. }
  91. );
  92. },
  93. submitForm(formName) {
  94. console.log('1111',this.form)
  95. let that = this;
  96. this.$refs[formName].validate((valid) => {
  97. if (valid) {
  98. let loading = this.$loading({target:document.querySelector(".content"),background: 'rgba(0, 0, 0, 0)'});
  99. this.$http.post(this.submit_url,{form:this.form,id:this.id}).then(response => {
  100. if (response.data.result) {
  101. this.$message({type: 'success',message: '操作成功!'});
  102. this.goBack();
  103. } else {
  104. this.$message({message: response.data.msg,type: 'error'});
  105. }
  106. loading.close();
  107. },response => {
  108. loading.close();
  109. });
  110. }
  111. else {
  112. console.log('error submit!!');
  113. return false;
  114. }
  115. });
  116. },
  117. goBack() {
  118. history.go(-1)
  119. },
  120. openUpload(str) {
  121. this.chooseImgName = str;
  122. this.uploadShow = true;
  123. },
  124. changeProp(val) {
  125. if(val == true) {
  126. this.uploadShow = false;
  127. }
  128. else {
  129. this.uploadShow = true;
  130. }
  131. },
  132. sureImg(name,image,image_url) {
  133. this.form[name] = image;
  134. this.form[name+'_url'] = image_url;
  135. },
  136. clearImg(str) {
  137. this.form[str] = "";
  138. this.form[str+'_url'] = "";
  139. this.$forceUpdate();
  140. },
  141. },
  142. })
  143. </script>
  144. @endsection