| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159 |
- @extends('layouts.base')
- @section('title', '物流公司信息详情')
- @section('content')
- <link rel="stylesheet" type="text/css" href="{{static_url('yunshop/goods/vue-goods1.css')}}"/>
- <div class="all">
- <div id="app" v-cloak>
- <div class="vue-main">
- <div class="vue-main-title">
- <div class="vue-main-title-left"></div>
- <div class="vue-main-title-content">公司信息</div>
- </div>
- <p style="color: red;padding-left: 135px;">注:仅支持快递鸟支持的物流公司,若快递鸟不支持或填错快递公司名称和快递公司编码,会导致无法查询物流信息(编码区分大小写)</p>
- <div class="vue-main-form">
- <el-form ref="form" :model="form" :rules="rules" label-width="15%">
- <el-form-item label="物流公司名称" prop="name">
- <el-input v-model="form.name" style="width:70%;"></el-input>
- </el-form-item>
- <el-form-item label="物流公司编码" prop="value">
- <el-input v-model="form.value" style="width:70%;"></el-input>
- </el-form-item>
- </el-form>
- </div>
- </div>
- <!-- 分页 -->
- <div class="vue-page">
- <div class="vue-center">
- <el-button type="primary" @click="submitForm('form')">保存设置</el-button>
- <el-button @click="goBack">返回</el-button>
- </div>
- </div>
- <upload-img :upload-show="uploadShow" :name="chooseImgName" @replace="changeProp" @sure="sureImg"></upload-img>
- </div>
- </div>
- <script src="{{resource_get('static/yunshop/tinymce4.7.5/tinymce.min.js')}}"></script>
- <!-- <script src="{{resource_get('static/yunshop/tinymceTemplate.js')}}"></script> -->
-
- @include('public.admin.tinymceee')
- @include('public.admin.uploadImg')
- <script>
- var app = new Vue({
- el:"#app",
- delimiters: ['[[', ']]'],
- name: 'test',
- data() {
- let id = {!! $id?:0 !!};
- console.log(id);
- return{
- id:id,
- form:{
- },
- uploadShow:false,
- chooseImgName:'',
- submit_url:'',
- showVisible:false,
-
- loading: false,
- uploadImg1:'',
- rules:{
- name:{ required: true, message: '请输入物流公司名称'},
- value:{ required: true, message: '请输入物流公司编码'}
- },
- }
- },
- created() {
- },
- mounted() {
- // this.getData();
- if(this.id) {
- this.getData();
- this.submit_url = '{!! yzWebFullUrl('plugin.express-company.Backend.Controllers.list.edit-company') !!}';
- }
- else {
- this.submit_url = '{!! yzWebFullUrl('plugin.express-company.Backend.Controllers.list.add-company') !!}';
- }
- },
- methods: {
- getData() {
- let loading = this.$loading({target:document.querySelector(".content"),background: 'rgba(0, 0, 0, 0)'});
- this.$http.post('{!! yzWebFullUrl('plugin.express-company.Backend.Controllers.list.edit-company') !!}',{id:this.id}).then(function (response) {
- if (response.data.result){
- this.form = {
- ...response.data.data,
- };
- }
- else {
- this.$message({message: response.data.msg,type: 'error'});
- }
- loading.close();
- },function (response) {
- this.$message({message: response.data.msg,type: 'error'});
- loading.close();
- }
- );
- },
- submitForm(formName) {
- console.log('1111',this.form)
- let that = this;
- this.$refs[formName].validate((valid) => {
- if (valid) {
- let loading = this.$loading({target:document.querySelector(".content"),background: 'rgba(0, 0, 0, 0)'});
- this.$http.post(this.submit_url,{form:this.form,id:this.id}).then(response => {
- if (response.data.result) {
- this.$message({type: 'success',message: '操作成功!'});
- this.goBack();
- } else {
- this.$message({message: response.data.msg,type: 'error'});
- }
- loading.close();
- },response => {
- loading.close();
- });
- }
- else {
- console.log('error submit!!');
- return false;
- }
- });
- },
- goBack() {
- history.go(-1)
- },
- openUpload(str) {
- this.chooseImgName = str;
- this.uploadShow = true;
- },
- changeProp(val) {
- if(val == true) {
- this.uploadShow = false;
- }
- else {
- this.uploadShow = true;
- }
- },
- sureImg(name,image,image_url) {
- this.form[name] = image;
- this.form[name+'_url'] = image_url;
- },
- clearImg(str) {
- this.form[str] = "";
- this.form[str+'_url'] = "";
- this.$forceUpdate();
- },
- },
- })
- </script>
- @endsection
|