| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215 |
- @extends('layouts.base')
- @section('title', '配送模板管理')
- @section('content')
- <link rel="stylesheet" type="text/css" href="{{static_url('yunshop/goods/vue-goods1.css')}}" />
- <link rel="stylesheet" href="{{resource_get('plugins/yz-supply/assent/css/album1.css?time='.time())}}">
- <style>
- .edit-i{display:none;}
- .el-table_1_column_2:hover .edit-i{font-weight:900;padding:0;margin:0;display:inline-block;}
- </style>
- <div class="all">
- <div id="app" v-cloak>
- <div class="vue-head">
- <div class="top-title">
- <span :class="item.class" v-for="(item,index) in albumTopTitle" @click="skipUrl(item)" :key="index">[[item.name]]</span>
- </div>
- </div>
- <div class="vue-main">
- <div class="vue-main-title">
- <div class="vue-main-title-left"></div>
- <div class="vue-main-title-content">配送模板列表</div>
- <div class="vue-main-title-button">
- <el-button type="primary" plain icon="el-icon-plus" size="small" @click="addModal">新增配送模板</el-button>
- </div>
- </div>
- <div class="vue-search">
- <el-form :inline="true" :model="search_form" class="demo-form-inline">
- <el-form-item label="" prop="">
- <el-select v-model="search_form.middleground_configuration_id" placeholder="请选择供应链" clearable remote filterable >
- <el-option v-for="item in middleground_configuration" :key="item.id" :label="item.title" :value="item.id"></el-option>
- </el-select>
- </el-form-item>
- <el-button type="primary" @click="cutMiddlegroundConfiguration">切换</el-button>
- </el-form>
- </div>
- <div class="vue-main-form">
- <el-table :data="list" style="width: 100%">
- <el-table-column prop="id" label="ID" align="center" width="90"></el-table-column>
- <el-table-column prop="name" label="配送方式名称" align="center"></el-table-column>
- <el-table-column prop="id" label="计费方式" align="center">
- <template slot-scope="scope">
- <div>
- [[scope.row.type==1?'按件计费':'按重量计费']]
- </div>
- </template>
- </el-table-column>
- <el-table-column prop="refund_time" label="操作" align="center" width="250">
- <template slot-scope="scope">
- {{-- <el-link title="编辑模板" :underline="false" :href="'{{ yzWebUrl('plugin.yz-supply.admin.cloud.cloud-dispatch.edit', array('id' => '')) }}'+[[scope.row.id]]+','+[[search_form.middleground_configuration_id]]" style="width:50px;">--}}
- <el-link title="编辑模板" :underline="false" @click="edit(scope.row.id)" style="width:50px;">
- <i class="iconfont icon-ht_operation_edit"></i>
- </el-link>
- <el-link title="删除模板" :underline="false" @click="del(scope.row.id,scope.$index)" style="width:50px;">
- <i class="iconfont icon-ht_operation_delete"></i>
- </el-link>
- </template>
- </el-table-column>
- </el-table>
- </div>
- </div>
- <!-- 分页 -->
- <div class="vue-page" v-if="total>0">
- <el-row>
- <el-col align="right">
- <el-pagination layout="prev, pager, next,jumper" @current-change="search" :total="total"
- :page-size="per_page" :current-page="current_page" background
- ></el-pagination>
- </el-col>
- </el-row>
- </div>
- </div>
- </div>
- <script>
- var app = new Vue({
- el: "#app",
- delimiters: ['[[', ']]'],
- name: 'test',
- data() {
- return {
- albumTopTitle: [
- {
- id: 1,
- name: "基础设置",
- class:"album-name-against",
- url:"{!! yzWebFullUrl('plugin.yz-supply.admin.cloud.cloud-set.index') !!}"
- },
- {
- id: 2,
- name: "分类匹配",
- class:"album-name-against",
- url:"{!! yzWebFullUrl('plugin.yz-supply.admin.cloud.cloud-category.index') !!}"
- },
- {
- id: 3,
- name: "运费模板",
- class:"album-name",
- url:"{!! yzWebFullUrl('plugin.yz-supply.admin.cloud.cloud-dispatch.index') !!}"
- },
- ],
- list:[],
- change_sort:'',
- middleground_configuration:[],
- search_form:{
- middleground_configuration_id:0,
- },
- rules: {},
- current_page:1,
- total:1,
- per_page:1,
- }
- },
- created() {
- },
- mounted() {
- this.getMiddlegroundConfiguration();
- },
- methods: {
- skipUrl(item){
- window.location.href = item.url
- },
- edit(id){
- window.location.href = "{!! yzWebUrl('plugin.yz-supply.admin.cloud.cloud-dispatch.edit') !!}&id="+id+"&middleground_configuration_id="+this.search_form.middleground_configuration_id
- },
- cutMiddlegroundConfiguration(){
- this.getData(1);
- },
- getMiddlegroundConfiguration(){
- this.$http.post('{!! yzWebFullUrl('plugin.yz-supply.admin.middleground-configuration.get-middleground-configurations') !!}').then(function (response) {
- if (response.data.result) {
- this.middleground_configuration = response.data.data;
- this.search_form.middleground_configuration_id = this.middleground_configuration[0].id;
- this.getData(1);
- } else {
- this.$message({message: response.data.msg, type: 'error'});
- }
- }, function (response) {
- this.$message({message: response.data.msg, type: 'error'});
- })
- },
- getData(page) {
- let loading = this.$loading({target:document.querySelector(".content"),background: 'rgba(0, 0, 0, 0)'});
- this.$http.post('{!! yzWebFullUrl('plugin.yz-supply.admin.cloud.cloud-dispatch.index') !!}',{page:page,middleground_configuration_id:this.search_form.middleground_configuration_id }).then(function(response) {
- if (response.data.result) {
- this.list = response.data.data.data;
- this.current_page=response.data.data.current_page;
- this.total=response.data.data.total;
- this.per_page=response.data.data.per_page;
- loading.close();
- } else {
- this.$message({
- message: response.data.msg,
- type: 'error'
- });
- }
- loading.close();
- }, function(response) {
- this.$message({
- message: response.data.msg,
- type: 'error'
- });
- loading.close();
- });
- },
- // 添加
- addModal() {
- let link = `{!! yzWebFullUrl('plugin.yz-supply.admin.cloud.cloud-dispatch.add') !!}`;
- console.log(link);
- window.location.href = link;
- },
- search(val) {
- this.getData(val);
- },
- del(id,index) {
- console.log(id,index)
- this.$confirm('确定删除吗', '提示', {confirmButtonText: '确定',cancelButtonText: '取消',type: 'warning'}).then(() => {
- let loading = this.$loading({target:document.querySelector(".content"),background: 'rgba(0, 0, 0, 0)'});
- this.$http.post('{!! yzWebFullUrl('plugin.yz-supply.admin.cloud.cloud-dispatch.delete') !!}',{id:id,middleground_configuration_id:this.search_form.middleground_configuration_id}).then(function (response) {
- if (response.data.result) {
- this.list.splice(index,1);
- this.$message({type: 'success',message: '删除成功!'});
- }
- else{
- this.$message({type: 'error',message: response.data.msg});
- }
- loading.close();
- this.search(this.current_page)
- },function (response) {
- this.$message({type: 'error',message: response.data.msg});
- loading.close();
- }
- );
- }).catch(() => {
- this.$message({type: 'info',message: '已取消删除'});
- });
- },
- },
- })
- </script>
- @endsection
|