Browse Source

新增迁移运费模板,快递公司

yfh 1 week ago
parent
commit
875b8efcc4

+ 76 - 0
src/api/hisStore/express.js

@@ -0,0 +1,76 @@
+import request from '@/utils/request'
+
+// 查询快递公司列表
+export function listExpress(query) {
+  return request({
+    url: '/his/express/list',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询快递公司详细
+export function getExpress(id) {
+  return request({
+    url: '/his/express/' + id,
+    method: 'get'
+  })
+}
+
+export function getExpressList() {
+  return request({
+    url: '/his/express/getExpressList',
+    method: 'get'
+  })
+}
+
+// 新增快递公司
+export function addExpress(data) {
+  return request({
+    url: '/his/express',
+    method: 'post',
+    data: data
+  })
+}
+
+// 修改快递公司
+export function updateExpress(data) {
+  return request({
+    url: '/his/express',
+    method: 'put',
+    data: data
+  })
+}
+
+// 删除快递公司
+export function delExpress(id) {
+  return request({
+    url: '/his/express/' + id,
+    method: 'delete'
+  })
+}
+
+// 导出快递公司
+export function exportExpress(query) {
+  return request({
+    url: '/his/express/export',
+    method: 'get',
+    params: query
+  })
+}
+
+//分配快递公司
+export function allotExpress(data,omsCode) {
+  return request({
+    url: '/his/express/allotExpress/'+omsCode,
+    method: 'post',
+    data: data
+  })
+}
+
+export function getCompanyByOmsCode(omsCode) {
+  return request({
+    url: '/his/express/omsCode/' + omsCode,
+    method: 'get'
+  })
+}

+ 53 - 0
src/api/hisStore/shippingTemplatesFree.js

@@ -0,0 +1,53 @@
+import request from '@/utils/request'
+
+// 查询免邮费列表
+export function listShippingTemplatesFree(query) {
+  return request({
+    url: '/store/shippingTemplatesFree/list',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询免邮费详细
+export function getShippingTemplatesFree(id) {
+  return request({
+    url: '/store/shippingTemplatesFree/' + id,
+    method: 'get'
+  })
+}
+
+// 新增免邮费
+export function addShippingTemplatesFree(data) {
+  return request({
+    url: '/store/shippingTemplatesFree',
+    method: 'post',
+    data: data
+  })
+}
+
+// 修改免邮费
+export function updateShippingTemplatesFree(data) {
+  return request({
+    url: '/store/shippingTemplatesFree',
+    method: 'put',
+    data: data
+  })
+}
+
+// 删除免邮费
+export function delShippingTemplatesFree(id) {
+  return request({
+    url: '/store/shippingTemplatesFree/' + id,
+    method: 'delete'
+  })
+}
+
+// 导出免邮费
+export function exportShippingTemplatesFree(query) {
+  return request({
+    url: '/store/shippingTemplatesFree/export',
+    method: 'get',
+    params: query
+  })
+}

+ 53 - 0
src/api/hisStore/shippingTemplatesRegion.js

@@ -0,0 +1,53 @@
+import request from '@/utils/request'
+
+// 查询邮费区域列表
+export function listShippingTemplatesRegion(query) {
+  return request({
+    url: '/store/shippingTemplatesRegion/list',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询邮费区域详细
+export function getShippingTemplatesRegion(id) {
+  return request({
+    url: '/store/shippingTemplatesRegion/' + id,
+    method: 'get'
+  })
+}
+
+// 新增邮费区域
+export function addShippingTemplatesRegion(data) {
+  return request({
+    url: '/store/shippingTemplatesRegion',
+    method: 'post',
+    data: data
+  })
+}
+
+// 修改邮费区域
+export function updateShippingTemplatesRegion(data) {
+  return request({
+    url: '/store/shippingTemplatesRegion',
+    method: 'put',
+    data: data
+  })
+}
+
+// 删除邮费区域
+export function delShippingTemplatesRegion(id) {
+  return request({
+    url: '/store/shippingTemplatesRegion/' + id,
+    method: 'delete'
+  })
+}
+
+// 导出邮费区域
+export function exportShippingTemplatesRegion(query) {
+  return request({
+    url: '/store/shippingTemplatesRegion/export',
+    method: 'get',
+    params: query
+  })
+}

+ 262 - 0
src/components/City/index.vue

@@ -0,0 +1,262 @@
+<template>
+  <el-dialog :close-on-click-modal="false"
+             :visible.sync="addressView"
+             append-to-body
+             class="modal"
+             title="选择城市" width="950px">
+    <el-row :gutter="24" type="flex">
+      <el-col :xl="24" :lg="24" :md="24" :sm="24" :xs="24" class="item">
+        <div class="check-btn">
+          <el-checkbox v-model="iSselect" @change="allCheckbox">全选</el-checkbox>
+          <div class="empty" @click="empty">清空</div>
+        </div>
+      </el-col>
+    </el-row>
+    <el-row  :gutter="24"  :loading="loading" >
+      <el-col  :xl="6" :lg="6" :md="6" :sm="8" :xs="6" class="item"  v-for="(item,index) in cityList" :key="index">
+        <div @mouseenter="enter(index)" @mouseleave="leave()" v-if="item.level==0">
+          <el-checkbox v-model="item.checked" :label="item.name" @change="checkedClick(index)">{{item.name}}</el-checkbox>
+          <div class="city" v-show="activeCity===index">
+            <div class="checkBox">
+              <div class="arrow"></div>
+              <div>
+                <el-checkbox v-model="subitem.checked" :label="subitem.name" @change="primary(index,subindex)"
+                class="itemn"  v-for="(subitem,subindex) in item.children" :key="subindex"
+                >{{subitem.name}}</el-checkbox>
+              </div>
+            </div>
+          </div>
+        </div>
+      </el-col>
+    </el-row>
+    <div slot="footer">
+      <el-button @click="close">取消</el-button>
+      <el-button type="primary" @click="confirm">确定</el-button>
+    </div>
+  </el-dialog>
+</template>
+
+<script>
+ import { getAllList } from "@/api/store/city";
+
+  export default {
+    name: 'city',
+    props: {
+      type: {
+        type: Number,
+        default: 0
+      }
+    },
+    data () {
+      return {
+        iSselect: false,
+        addressView: false,
+        cityList: [],
+        activeCity: -1,
+        loading: false
+      }
+    },
+    methods: {
+      enter (index) {
+        this.activeCity = index;
+      },
+      leave () {
+        this.activeCity = null;
+      },
+      getCityList () {
+        this.loading = true;
+        getAllList().then(res => {
+          this.loading = false;
+          var data=res.data;
+          this.cityList=data.filter(item => item.level===0 )
+          this.cityList.forEach(function(item,index,arr){
+            var subData=data.filter(subitem => subitem.parentId===item.cityId )
+            console.log(subData)
+            item.children=subData;
+          });
+        })
+      },
+      /**
+       * 全选或者反选
+       * @param checked
+       */
+      allCheckbox: function () {
+        let that = this, checked = this.iSselect;
+        that.cityList.forEach(function (item, key) {
+          that.$set(that.cityList[key], 'checked', checked);
+          if (checked) {
+            that.$set(that.cityList[key], 'count', that.cityList[key].children.length);
+          } else {
+            that.$set(that.cityList[key], 'count', 0);
+          }
+          that.cityList[key].children.forEach(function (val, k) {
+            that.$set(that.cityList[key].children[k], 'checked', checked);
+          })
+        });
+      },
+      // 清空;
+      empty () {
+        let that = this;
+        that.cityList.forEach(function (item, key) {
+          that.$set(that.cityList[key], 'checked', false);
+          that.cityList[key].children.forEach(function (val, k) {
+            that.$set(that.cityList[key].children[k], 'checked', false);
+          });
+          that.$set(that.cityList[key], 'count', 0);
+        });
+        this.iSselect = false;
+      },
+      /**
+       * 点击省
+       * @param index
+       */
+      checkedClick: function (index) {
+        let that = this;
+        if (that.cityList[index].checked) {
+          that.$set(that.cityList[index], 'count', that.cityList[index].children.length);
+          that.cityList[index].children.forEach(function (item, key) {
+            that.$set(that.cityList[index].children[key], 'checked', true);
+          });
+        } else {
+          that.$set(that.cityList[index], 'count', 0);
+          that.$set(that.cityList[index], 'checked', false);
+          that.cityList[index].children.forEach(function (item, key) {
+            that.$set(that.cityList[index].children[key], 'checked', false);
+          });
+          that.iSselect = false;
+        }
+      },
+      /**
+       * 点击市区
+       * @param index
+       * @param ind
+       */
+      primary: function (index, ind) {
+        let checked = false, count = 0;
+        this.cityList[index].children.forEach(function (item, key) {
+          console.log("item:"+item.checked)
+          if (item.checked) {
+            checked = true;
+            count++;
+          }
+        });
+        this.$set(this.cityList[index], 'count', count);
+        this.$set(this.cityList[index], 'checked', checked);
+      },
+      // 确定;
+      confirm () {
+        let that = this;
+        // 被选中的省市;
+        let selectList = [];
+        that.cityList.forEach(function (item, key) {
+          let data = {};
+          if (item.checked) {
+            data = {
+              name: item.name,
+              cityId: item.cityId,
+              children: []
+            };
+
+          }
+          that.cityList[key].children.forEach(function (i, k) {
+            if (i.checked) {
+              data.children.push({
+                cityId: i.cityId
+              })
+            }
+          });
+          if (data.cityId !== undefined) {
+            selectList.push(data);
+          }
+        });
+        console.log(selectList);
+        if (selectList.length === 0) {
+          return this.$message({
+            message:'至少选择一个省份或者城市',
+            type: 'error'
+          });
+        } else {
+          this.$emit('selectCity', selectList, this.type);
+          that.addressView = false;
+          this.cityList = []
+        }
+      },
+      close () {
+        this.addressView = false;
+        this.cityList = []
+      }
+    },
+    mounted () {
+    }
+  }
+</script>
+
+<style scoped>
+
+  .modal .item {
+    position: relative;
+    margin-bottom: 20px;
+  }
+
+  .modal .item .city {
+    position: absolute;
+    z-index: 9;
+    top: 17px;
+    width: 100%;
+    padding-top: 18px;
+  }
+
+  .modal .item .city .checkBox {
+    width: 97%;
+    padding: 10px;
+    border: 1px solid #eee;
+    background-color: #fff;
+    max-height: 100px;
+    overflow-x: hidden;
+    overflow-y: auto;
+  }
+
+  .modal .item .city .checkBox .arrow {
+    position: absolute;
+    top: 3px;
+    width: 0;
+    height: 0;
+    border: 8px solid transparent;
+    border-bottom-color: #ddd;
+  }
+
+  .modal .item .city .checkBox .arrow:before {
+    position: absolute;
+    bottom: -8px;
+    right: -7px;
+    content: "";
+    width: 0;
+    height: 0;
+    border: 7px solid transparent;
+    border-bottom-color: #fff;
+  }
+
+  .modal .item .city .checkBox .itemn {
+    margin-bottom: 10px;
+  }
+
+  .radio {
+    padding: 5px 0;
+    font-size: 14px !important;
+  }
+
+  .red {
+    color: #ff0000;
+  }
+
+  .empty {
+    cursor: pointer;
+    margin-left:10px
+  }
+  .check-btn{
+    display: flex;
+    flex-direction: row;
+    align-items: center;
+    justify-content: flex-end;
+  }
+</style>

+ 394 - 0
src/views/hisStore/express/index.vue

@@ -0,0 +1,394 @@
+<template>
+  <div class="app-container">
+    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
+      <el-form-item label="公司名称" prop="name">
+        <el-input
+          v-model="queryParams.name"
+          placeholder="请输入快递公司名称"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item>
+        <el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
+        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
+      </el-form-item>
+    </el-form>
+
+    <el-row :gutter="10" class="mb8">
+      <el-col :span="1.5">
+        <el-button
+          type="primary"
+          icon="el-icon-plus"
+          size="mini"
+          @click="handleAdd"
+          v-hasPermi="['store:express:add']"
+        >新增</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="success"
+          icon="el-icon-edit"
+          size="mini"
+          :disabled="single"
+          @click="handleUpdate"
+          v-hasPermi="['store:express:edit']"
+        >修改</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="danger"
+          icon="el-icon-delete"
+          size="mini"
+          :disabled="multiple"
+          @click="handleDelete"
+          v-hasPermi="['store:express:remove']"
+        >删除</el-button>
+      </el-col>
+	  <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+    </el-row>
+
+    <el-table  height="500" border v-loading="loading" :data="expressList" @selection-change="handleSelectionChange">
+      <el-table-column type="selection" width="55" align="center" />
+      <el-table-column label="ID" align="center" prop="id" />
+      <el-table-column label="快递公司编号" align="center" prop="code" />
+      <el-table-column label="快递公司" align="center" prop="name" />
+      <el-table-column label="OMS编号" align="center" prop="omsCode" />
+      <el-table-column label="排序" align="center" prop="sort" />
+      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
+        <template slot-scope="scope">
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-edit"
+            @click="handleAllot(scope.row)"
+            v-hasPermi="['store:express:allot']"
+          >分配公司</el-button>
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-edit"
+            @click="handleUpdate(scope.row)"
+            v-hasPermi="['store:express:edit']"
+          >修改</el-button>
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-delete"
+            @click="handleDelete(scope.row)"
+            v-hasPermi="['store:express:remove']"
+          >删除</el-button>
+        </template>
+      </el-table-column>
+    </el-table>
+
+    <pagination
+      v-show="total>0"
+      :total="total"
+      :page.sync="queryParams.pageNum"
+      :limit.sync="queryParams.pageSize"
+      @pagination="getList"
+    />
+
+    <!-- 添加或修改快递公司对话框 -->
+    <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
+      <el-form ref="form" :model="form" :rules="rules" label-width="120px">
+        <el-form-item label="快递公司简称" prop="code">
+          <el-input v-model="form.code" placeholder="请输入快递公司简称" />
+        </el-form-item>
+        <el-form-item label="快递公司全称" prop="name">
+          <el-input v-model="form.name" placeholder="请输入快递公司全称" />
+        </el-form-item>
+        <el-form-item label="OMS编号" prop="omsCode">
+          <el-input v-model="form.omsCode" placeholder="请输入快递公司简称" />
+        </el-form-item>
+        <el-form-item label="排序" prop="sort">
+          <el-input-number :min="0"  v-model="form.sort" placeholder="请输入排序" />
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="submitForm">确 定</el-button>
+        <el-button @click="cancel">取 消</el-button>
+      </div>
+    </el-dialog>
+
+    <el-dialog :title="allot.title" :visible.sync="allot.open" width="1100px"   append-to-body>
+      <el-transfer
+        filterable
+        width="960px"
+        :filter-method="filterMethod"
+        filter-placeholder="请输入公司名称"
+        v-model="value"
+        :titles="['所有公司', '已选公司']"
+        :right-default-checked="value"
+        :data="allCompanies">
+      </el-transfer>
+      <div slot="footer" class="dialog-footer">
+          <el-button type="primary" @click="handleAllotCompany">分 配</el-button>
+          <el-button @click="cancel1">取 消</el-button>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import { listExpress, getExpress, delExpress, addExpress, updateExpress, exportExpress ,allotExpress ,getExpressList,getCompanyByOmsCode} from "@/api/hisStore/express";
+import { getCompanyList} from "@/api/company/company";
+export default {
+  name: "Express",
+  data() {
+    return {
+
+      formId:null,
+        value: [],
+        value2:[],
+        filterMethod(query, item) {
+          return item.label.indexOf(query) > -1;
+        },
+      // 遮罩层
+      loading: true,
+      // 选中数组
+      ids: [],
+      allCompanies:undefined,
+      allot:{
+        title:"分配公司",
+        open:false,
+      },
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      // 显示搜索条件
+      showSearch: true,
+      // 总条数
+      total: 0,
+      // 快递公司表格数据
+      expressList: [],
+      // 弹出层标题
+      title: "",
+      // 是否显示弹出层
+      open: false,
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        code: null,
+        name: null,
+        sort: null,
+        isShow: null,
+        isDel: null
+      },
+      // 表单参数
+      form: {},
+      // 表单校验
+      rules: {
+        code: [
+          { required: true, message: "快递公司简称不能为空", trigger: "blur" }
+        ],
+        omsCode: [
+          { required: true, message: "OMS编号不能为空", trigger: "blur" }
+        ],
+        name: [
+          { required: true, message: "快递公司全称不能为空", trigger: "blur" }
+        ],
+        sort: [
+          { required: true, message: "排序不能为空", trigger: "blur" }
+        ],
+        isShow: [
+          { required: true, message: "是否显示不能为空", trigger: "blur" }
+        ],
+      }
+    };
+  },
+  created() {
+    this.getList();
+
+  },
+
+  methods: {
+    handleAllotCompany(){
+      console.log(this.value);
+      allotExpress(this.value,this.formId).then(response => {
+      if (response.code === 200) {
+      this.msgSuccess("修改成功");
+      this.allot.open = false;
+      this.getList();
+      }
+      });
+    },
+
+    /** 查询快递公司列表 */
+    getList() {
+      this.loading = true;
+      listExpress(this.queryParams).then(response => {
+        this.expressList = response.rows;
+        this.total = response.total;
+        this.loading = false;
+      });
+    },
+    // 取消按钮
+    cancel() {
+      this.open = false;
+      this.reset();
+    },
+    cancel1() {
+      this.allot.open = false;
+    },
+    // 表单重置
+    reset() {
+      this.form = {
+        id: null,
+        code: null,
+        omsCode: null,
+        name: null,
+        sort: null,
+        isShow: null,
+        createTime: null,
+        updateTime: null,
+        isDel: null
+      };
+      this.resetForm("form");
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.pageNum = 1;
+      this.getList();
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.resetForm("queryForm");
+      this.handleQuery();
+    },
+    // 多选框选中数据
+    handleSelectionChange(selection) {
+      this.ids = selection.map(item => item.id)
+      this.single = selection.length!==1
+      this.multiple = !selection.length
+    },
+    /** 新增按钮操作 */
+    handleAdd() {
+      this.reset();
+      this.open = true;
+      this.title = "添加快递公司";
+    },
+    /**分配公司按钮 */
+    handleAllot(row){
+      this.allot.open = true;
+      this.formId = row.omsCode;
+      getCompanyList().then(response => {
+      let data = [];
+      response.data.forEach((item,index) => {
+        data.push({
+          key: item.companyId,
+          label:item.companyName,
+        })
+      });
+      this.allCompanies = data;
+    });
+    const omsCode = row.omsCode;
+    getCompanyByOmsCode(omsCode).then(response => {
+      this.value = response.data2
+      console.log(this.value);
+    });
+
+    },
+    /** 修改按钮操作 */
+    handleUpdate(row) {
+      this.reset();
+      const id = row.id || this.ids
+      getExpress(id).then(response => {
+        this.form = response.data;
+        this.open = true;
+        this.title = "修改快递公司";
+      });
+    },
+    /** 提交按钮 */
+    submitForm() {
+      this.$refs["form"].validate(valid => {
+        if (valid) {
+          if (this.form.id != null) {
+            updateExpress(this.form).then(response => {
+              if (response.code === 200) {
+                this.msgSuccess("修改成功");
+                this.open = false;
+                this.getList();
+              }
+            });
+          } else {
+            addExpress(this.form).then(response => {
+              if (response.code === 200) {
+                this.msgSuccess("新增成功");
+                this.open = false;
+                this.getList();
+              }
+            });
+          }
+        }
+      });
+    },
+    /** 删除按钮操作 */
+    handleDelete(row) {
+      const ids = row.id || this.ids;
+      this.$confirm('是否确认删除快递公司编号为"' + ids + '"的数据项?', "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(function() {
+          return delExpress(ids);
+        }).then(() => {
+          this.getList();
+          this.msgSuccess("删除成功");
+        }).catch(function() {});
+    },
+    /** 导出按钮操作 */
+    handleExport() {
+      const queryParams = this.queryParams;
+      this.$confirm('是否确认导出所有快递公司数据项?', "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(function() {
+          return exportExpress(queryParams);
+        }).then(response => {
+          this.download(response.msg);
+        }).catch(function() {});
+    }
+  },
+};
+</script>
+<style scoped lang="scss">
+.container {
+  display: flex;
+  justify-content: space-between;
+  margin-bottom: 20px;
+}
+.box {
+  width: 300px;
+}
+.el-scrollbar {
+  max-height: 300px;
+  overflow-y: auto; /* 添加滚动条 */
+}
+/* 新增样式 */
+.container {
+  display: flex;
+  justify-content: center;
+  align-items: flex-start;
+}
+.box {
+  margin: 0 10px;
+}
+
+/deep/.el-transfer-panel {
+    width:40%;
+}
+/deep/.el-transfer-panel__body{
+  height: 450px;
+}
+/deep/.el-transfer-panel__list.is-filterable {
+   height: 88%;
+}
+
+</style>
+

+ 443 - 0
src/views/hisStore/shippingTemplates/index.vue

@@ -0,0 +1,443 @@
+<template>
+  <div class="app-container">
+
+    <el-row :gutter="10" class="mb8">
+      <el-col :span="1.5">
+        <el-button
+          type="primary"
+          icon="el-icon-plus"
+          size="mini"
+          @click="handleAdd"
+          v-hasPermi="['store:shippingTemplates:add']"
+        >新增</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="success"
+          icon="el-icon-edit"
+          size="mini"
+          :disabled="single"
+          @click="handleUpdate"
+          v-hasPermi="['store:shippingTemplates:edit']"
+        >修改</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="danger"
+          icon="el-icon-delete"
+          size="mini"
+          :disabled="multiple"
+          @click="handleDelete"
+          v-hasPermi="['store:shippingTemplates:remove']"
+        >删除</el-button>
+      </el-col>
+	  <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+    </el-row>
+
+    <el-table  height="500" border v-loading="loading" :data="shippingTemplatesList" @selection-change="handleSelectionChange">
+      <el-table-column type="selection" width="55" align="center" />
+      <el-table-column label="模板ID" align="center" prop="id" />
+      <el-table-column label="模板名称" align="center" prop="name" />
+      <el-table-column label="计费方式" align="center" prop="type" >
+          <template slot-scope="scope">
+              <el-tag prop="type" v-for="(item, index) in typeOptions"    v-if="scope.row.type==item.dictValue">{{item.dictLabel}}</el-tag>
+          </template>
+      </el-table-column>
+      <el-table-column label="指定包邮开关" align="center" prop="appoint" >
+          <template slot-scope="scope">
+              <el-tag prop="type" v-for="(item, index) in appointOptions"    v-if="scope.row.appoint==item.dictValue">{{item.dictLabel}}</el-tag>
+          </template>
+      </el-table-column>
+      <el-table-column label="添加时间" align="center" prop="createTime" />
+      <el-table-column label="排序" align="center" prop="sort" />
+      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
+        <template slot-scope="scope">
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-edit"
+            @click="handleUpdate(scope.row)"
+            v-hasPermi="['store:shippingTemplates:edit']"
+          >修改</el-button>
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-delete"
+            @click="handleDelete(scope.row)"
+            v-hasPermi="['store:shippingTemplates:remove']"
+          >删除</el-button>
+        </template>
+      </el-table-column>
+    </el-table>
+
+    <pagination
+      v-show="total>0"
+      :total="total"
+      :page.sync="queryParams.pageNum"
+      :limit.sync="queryParams.pageSize"
+      @pagination="getList"
+    />
+
+    <!-- 添加或修改运费模板对话框 -->
+    <el-dialog :title="title" :visible.sync="open" width="800px" append-to-body>
+      <el-form ref="form" :model="form" :rules="rules" label-width="130px">
+        <el-form-item label="模板名称" prop="name">
+          <el-input v-model="form.name" placeholder="请输入模板名称" />
+        </el-form-item>
+        <el-form-item label="计费方式" prop="type">
+            <el-radio-group v-model="form.type" >
+               <el-radio :label="item.dictValue" v-for="item in typeOptions" >{{item.dictLabel}}</el-radio>-radio>
+            </el-radio-group>
+        </el-form-item>
+        <el-row :gutter="24" type="flex">
+          <el-col :xl="24" :lg="24" :md="24" :sm="24" :xs="24">
+            <el-form-item class="label" label="配送区域及运费:" props="state">
+              <el-table
+                ref="table"
+                :data="templateList"
+                empty-text="暂无数据"
+                border
+              >
+                <el-table-column prop="regionName" label="可配送区域" width="130" />
+                <el-table-column prop="first" label="首件" width="120">
+                  <template slot="header" slot-scope="scope">
+                    <span v-if="form.type == 1">首件</span>
+                    <span v-else-if="form.type == 2">首件重量(KG)</span>
+                    <span v-else>首件体积(m³)</span>
+                  </template>
+                  <template slot-scope="scope">
+                    <span><el-input type="text" v-model="scope.row.first" /></span>
+                  </template>
+                </el-table-column>
+                <el-table-column prop="price" label="运费(元)" width="110">
+                  <template slot-scope="scope">
+                    <span><el-input type="text" v-model="scope.row.price"/></span>
+                  </template>
+                </el-table-column>
+                <el-table-column prop="_continue" label="续件" width="120">
+                  <template slot="header" slot-scope="scope">
+                    <span v-if="form.type == 1">续件</span>
+                    <span v-else-if="form.type == 2">续件重量(KG)</span>
+                    <span v-else>续件体积(m³)</span>
+                  </template>
+                  <template slot-scope="scope">
+                    <span><el-input type="text" v-model="scope.row.continues"/></span>
+                  </template>
+                </el-table-column>
+                <el-table-column prop="continuePrice" label="续费(元)" width="110">
+                  <template slot-scope="scope">
+                    <span><el-input type="text" v-model="scope.row.continuePrice"/></span>
+                  </template>
+                </el-table-column>
+                <el-table-column  label="操作">
+                  <template slot-scope="scope">
+                    <a v-if="scope.row.regionName!=='默认全国'" @click="delCity(scope.row.index,1)">删除</a>
+                  </template>
+                </el-table-column>
+
+              </el-table>
+              <el-row type="flex" class="addTop">
+                <el-col>
+                  <el-button size="small" type="primary" icon="md-add" @click="addCity(1)">单独添加配送区域</el-button>
+                </el-col>
+              </el-row>
+            </el-form-item>
+          </el-col>
+        </el-row>
+        <el-row :gutter="24" type="flex">
+          <el-col :xl="24" :lg="24" :md="24" :sm="24" :xs="24">
+            <el-form-item label="指定包邮:" prop="appoint">
+              <el-radio-group v-model="form.appoint" >
+                    <el-radio :label="item.dictValue" v-for="item in appointOptions" >{{item.dictLabel}}</el-radio>-radio>
+                  </el-radio-group>
+              <el-table
+                ref="table"
+                :data="appointList"
+                empty-text="暂无数据"
+                border
+                v-if="form.appoint === '1'"
+              >
+                <el-table-column prop="placeName" label="选择地区" />
+                <el-table-column prop="a_num" label="包邮件数" width="120" >
+                  <template slot="header" slot-scope="scope">
+                    <span v-if="form.type == 1">包邮件数</span>
+                    <span v-else-if="form.type == 2">包邮重量(KG)</span>
+                    <span v-else>包邮体积(m³)</span>
+                  </template>
+                  <template slot-scope="scope">
+                    <span><el-input type="text" v-model="scope.row.number"/></span>
+                  </template>
+                </el-table-column>
+                <el-table-column prop="price" label="包邮金额(元)" width="120">
+                  <template slot-scope="scope">
+                    <span><el-input type="text" v-model="scope.row.price"/></span>
+                  </template>
+                </el-table-column>
+                <el-table-column  label="操作">
+                  <template slot-scope="scope">
+                    <a v-if="scope.row.regionName!=='默认全国'" @click="delCity(scope.row.index,2)">删除</a>
+                  </template>
+                </el-table-column>
+
+              </el-table>
+              <el-row type="flex" v-if="form.appoint === '1'">
+                <el-col>
+                  <el-button size="small" type="primary" icon="md-add" @click="addCity(2)">单独指定包邮</el-button>
+                </el-col>
+              </el-row>
+            </el-form-item>
+          </el-col>
+        </el-row>
+        <el-form-item label="排序" prop="sort">
+          <el-input-number :min="0"  v-model="form.sort" placeholder="请输入排序" />
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="submitForm">确 定</el-button>
+        <el-button @click="cancel">取 消</el-button>
+      </div>
+    </el-dialog>
+    <city ref="city" @selectCity="selectCity" :type="type"></city>
+  </div>
+</template>
+
+<script>
+import { listShippingTemplates, getShippingTemplates, delShippingTemplates, addShippingTemplates, updateShippingTemplates, exportShippingTemplates } from "@/api/hisStore/shippingTemplates";
+import City from '@/components/City'
+export default {
+  name: "ShippingTemplates",
+  components: {
+    City
+  },
+  data() {
+    return {
+      type:0,
+      appointList:[],
+      templateList:[],
+      appointOptions:[],
+      typeOptions:[],
+      // 遮罩层
+      loading: true,
+      // 选中数组
+      ids: [],
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      // 显示搜索条件
+      showSearch: true,
+      // 总条数
+      total: 0,
+      // 运费模板表格数据
+      shippingTemplatesList: [],
+      // 弹出层标题
+      title: "",
+      // 是否显示弹出层
+      open: false,
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        name: null,
+        type: null,
+        regionInfo: null,
+        appoint: null,
+        appointInfo: null,
+        isDel: null,
+        sort: null
+      },
+      // 表单参数
+      form: {},
+      // 表单校验
+      rules: {
+        name: [
+          { required: true, message: "名称不能为空", trigger: "blur" }
+        ],
+      }
+    };
+  },
+  created() {
+    this.getDicts("store_shipping_type").then((response) => {
+      this.typeOptions = response.data;
+    });
+    this.getDicts("store_shipping_appoint").then((response) => {
+      this.appointOptions = response.data;
+    });
+    this.getList();
+  },
+  methods: {
+    delCity (index,type) {
+      console.log(index)
+      if (type === 1) {
+        this.templateList.splice(index, 1);
+      } else {
+        this.appointList.splice(index, 1);
+      }
+    },
+    selectCity: function (data, type) {
+      let cityName = data.map(function (item) {
+        return item.name;
+      }).join(';');
+      switch (type) {
+        case 1:
+          this.templateList.push({
+            region: data,
+            regionName: cityName,
+            first: 1,
+            price: 0,
+            continues: 1,
+            continuePrice: 0
+          });
+          break;
+        case 2:
+          this.appointList.push({
+            place: data,
+            placeName: cityName,
+            number: 0,
+            price: 0
+          });
+          break;
+      }
+    },
+    // 单独添加配送区域
+    addCity (type) {
+      this.$refs.city.addressView = true;
+      this.type = type;
+      this.$refs.city.getCityList()
+    },
+    /** 查询运费模板列表 */
+    getList() {
+      this.loading = true;
+      listShippingTemplates(this.queryParams).then(response => {
+        this.shippingTemplatesList = response.rows;
+        this.total = response.total;
+        this.loading = false;
+      });
+    },
+    // 取消按钮
+    cancel() {
+      this.open = false;
+      this.reset();
+    },
+    // 表单重置
+    reset() {
+      this.form = {
+        id: null,
+        name: null,
+        type: "1",
+        appoint: "0",
+        createTime: null,
+        updateTime: null,
+        isDel: null,
+        sort: null
+      };
+      this.templateList = [
+        {
+          region: [
+            {
+              name: '默认全国',
+              cityId: 0
+            }
+          ],
+          regionName: '默认全国',
+          first: 1,
+          price: 0,
+          continues: 1,
+          continuePrice: 0
+        }
+      ];
+      this.appointList=[],
+      this.resetForm("form");
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.pageNum = 1;
+      this.getList();
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.resetForm("queryForm");
+      this.handleQuery();
+    },
+    // 多选框选中数据
+    handleSelectionChange(selection) {
+      this.ids = selection.map(item => item.id)
+      this.single = selection.length!==1
+      this.multiple = !selection.length
+    },
+    /** 新增按钮操作 */
+    handleAdd() {
+      this.reset();
+      this.open = true;
+      this.title = "添加运费模板";
+    },
+    /** 修改按钮操作 */
+    handleUpdate(row) {
+      this.reset();
+      const id = row.id || this.ids
+      getShippingTemplates(id).then(response => {
+        this.form = response.data;
+        this.form.type = response.data.type.toString();
+        this.form.appoint = response.data.appoint.toString();
+        this.appointList=JSON.parse(this.form.appointInfo)
+        this.templateList=JSON.parse(this.form.regionInfo)
+        this.open = true;
+        this.title = "修改运费模板";
+      });
+    },
+    /** 提交按钮 */
+    submitForm() {
+      this.$refs["form"].validate(valid => {
+        if (valid) {
+          this.form.regionInfo=this.templateList;
+          this.form.appointInfo=this.appointList;
+          if (this.form.id != null) {
+            updateShippingTemplates(this.form).then(response => {
+              if (response.code === 200) {
+                this.msgSuccess("修改成功");
+                this.open = false;
+                this.getList();
+              }
+            });
+          } else {
+            addShippingTemplates(this.form).then(response => {
+              if (response.code === 200) {
+                this.msgSuccess("新增成功");
+                this.open = false;
+                this.getList();
+              }
+            });
+          }
+        }
+      });
+    },
+    /** 删除按钮操作 */
+    handleDelete(row) {
+      const ids = row.id || this.ids;
+      this.$confirm('是否确认删除运费模板编号为"' + ids + '"的数据项?', "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(function() {
+          return delShippingTemplates(ids);
+        }).then(() => {
+          this.getList();
+          this.msgSuccess("删除成功");
+        }).catch(function() {});
+    },
+    /** 导出按钮操作 */
+    handleExport() {
+      const queryParams = this.queryParams;
+      this.$confirm('是否确认导出所有运费模板数据项?', "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(function() {
+          return exportShippingTemplates(queryParams);
+        }).then(response => {
+          this.download(response.msg);
+        }).catch(function() {});
+    }
+  }
+};
+</script>

+ 366 - 0
src/views/hisStore/shippingTemplatesFree/index.vue

@@ -0,0 +1,366 @@
+<template>
+  <div class="app-container">
+    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
+      <el-form-item label="模板ID" prop="tempId">
+        <el-input
+          v-model="queryParams.tempId"
+          placeholder="请输入模板ID"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="省ID" prop="provinceId">
+        <el-input
+          v-model="queryParams.provinceId"
+          placeholder="请输入省ID"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="城市ID" prop="cityId">
+        <el-input
+          v-model="queryParams.cityId"
+          placeholder="请输入城市ID"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="包邮件数" prop="number">
+        <el-input
+          v-model="queryParams.number"
+          placeholder="请输入包邮件数"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="包邮金额" prop="price">
+        <el-input
+          v-model="queryParams.price"
+          placeholder="请输入包邮金额"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="计费方式" prop="type">
+        <el-select v-model="queryParams.type" placeholder="请选择计费方式" clearable size="small">
+          <el-option label="请选择字典生成" value="" />
+        </el-select>
+      </el-form-item>
+      <el-form-item label="产品ID" prop="productId">
+        <el-input
+          v-model="queryParams.productId"
+          placeholder="请输入产品ID"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item>
+        <el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
+        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
+      </el-form-item>
+    </el-form>
+
+    <el-row :gutter="10" class="mb8">
+      <el-col :span="1.5">
+        <el-button
+          type="primary"
+          icon="el-icon-plus"
+          size="mini"
+          @click="handleAdd"
+          v-hasPermi="['store:shippingTemplatesFree:add']"
+        >新增</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="success"
+          icon="el-icon-edit"
+          size="mini"
+          :disabled="single"
+          @click="handleUpdate"
+          v-hasPermi="['store:shippingTemplatesFree:edit']"
+        >修改</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="danger"
+          icon="el-icon-delete"
+          size="mini"
+          :disabled="multiple"
+          @click="handleDelete"
+          v-hasPermi="['store:shippingTemplatesFree:remove']"
+        >删除</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="warning"
+          icon="el-icon-download"
+          size="mini"
+          @click="handleExport"
+          v-hasPermi="['store:shippingTemplatesFree:export']"
+        >导出</el-button>
+      </el-col>
+	  <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+    </el-row>
+
+    <el-table v-loading="loading" :data="shippingTemplatesFreeList" @selection-change="handleSelectionChange" border>
+      <el-table-column type="selection" width="55" align="center" />
+      <el-table-column label="编号" align="center" prop="id" />
+      <el-table-column label="模板ID" align="center" prop="tempId" />
+      <el-table-column label="省ID" align="center" prop="provinceId" />
+      <el-table-column label="城市ID" align="center" prop="cityId" />
+      <el-table-column label="包邮件数" align="center" prop="number" />
+      <el-table-column label="包邮金额" align="center" prop="price" />
+      <el-table-column label="计费方式" align="center" prop="type" />
+      <el-table-column label="产品ID" align="center" prop="productId" />
+      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
+        <template slot-scope="scope">
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-edit"
+            @click="handleUpdate(scope.row)"
+            v-hasPermi="['store:shippingTemplatesFree:edit']"
+          >修改</el-button>
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-delete"
+            @click="handleDelete(scope.row)"
+            v-hasPermi="['store:shippingTemplatesFree:remove']"
+          >删除</el-button>
+        </template>
+      </el-table-column>
+    </el-table>
+
+    <pagination
+      v-show="total>0"
+      :total="total"
+      :page.sync="queryParams.pageNum"
+      :limit.sync="queryParams.pageSize"
+      @pagination="getList"
+    />
+
+    <!-- 添加或修改免邮费对话框 -->
+    <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
+      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
+        <el-form-item label="模板ID" prop="tempId">
+          <el-input v-model="form.tempId" placeholder="请输入模板ID" />
+        </el-form-item>
+        <el-form-item label="省ID" prop="provinceId">
+          <el-input v-model="form.provinceId" placeholder="请输入省ID" />
+        </el-form-item>
+        <el-form-item label="城市ID" prop="cityId">
+          <el-input v-model="form.cityId" placeholder="请输入城市ID" />
+        </el-form-item>
+        <el-form-item label="包邮件数" prop="number">
+          <el-input v-model="form.number" placeholder="请输入包邮件数" />
+        </el-form-item>
+        <el-form-item label="包邮金额" prop="price">
+          <el-input v-model="form.price" placeholder="请输入包邮金额" />
+        </el-form-item>
+        <el-form-item label="计费方式" prop="type">
+          <el-select v-model="form.type" placeholder="请选择计费方式">
+            <el-option label="请选择字典生成" value="" />
+          </el-select>
+        </el-form-item>
+        <el-form-item label="产品ID" prop="productId">
+          <el-input v-model="form.productId" placeholder="请输入产品ID" />
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="submitForm">确 定</el-button>
+        <el-button @click="cancel">取 消</el-button>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import { listShippingTemplatesFree, getShippingTemplatesFree, delShippingTemplatesFree, addShippingTemplatesFree, updateShippingTemplatesFree, exportShippingTemplatesFree } from "@/api/hisStore/shippingTemplatesFree";
+
+export default {
+  name: "ShippingTemplatesFree",
+  data() {
+    return {
+      // 遮罩层
+      loading: true,
+      // 选中数组
+      ids: [],
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      // 显示搜索条件
+      showSearch: true,
+      // 总条数
+      total: 0,
+      // 免邮费表格数据
+      shippingTemplatesFreeList: [],
+      // 弹出层标题
+      title: "",
+      // 是否显示弹出层
+      open: false,
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        tempId: null,
+        provinceId: null,
+        cityId: null,
+        number: null,
+        price: null,
+        type: null,
+        productId: null
+      },
+      // 表单参数
+      form: {},
+      // 表单校验
+      rules: {
+        tempId: [
+          { required: true, message: "模板ID不能为空", trigger: "blur" }
+        ],
+        provinceId: [
+          { required: true, message: "省ID不能为空", trigger: "blur" }
+        ],
+        cityId: [
+          { required: true, message: "城市ID不能为空", trigger: "blur" }
+        ],
+        number: [
+          { required: true, message: "包邮件数不能为空", trigger: "blur" }
+        ],
+        price: [
+          { required: true, message: "包邮金额不能为空", trigger: "blur" }
+        ],
+        type: [
+          { required: true, message: "计费方式不能为空", trigger: "change" }
+        ],
+        productId: [
+          { required: true, message: "产品ID不能为空", trigger: "blur" }
+        ]
+      }
+    };
+  },
+  created() {
+    this.getList();
+  },
+  methods: {
+    /** 查询免邮费列表 */
+    getList() {
+      this.loading = true;
+      listShippingTemplatesFree(this.queryParams).then(response => {
+        this.shippingTemplatesFreeList = response.rows;
+        this.total = response.total;
+        this.loading = false;
+      });
+    },
+    // 取消按钮
+    cancel() {
+      this.open = false;
+      this.reset();
+    },
+    // 表单重置
+    reset() {
+      this.form = {
+        id: null,
+        tempId: null,
+        provinceId: null,
+        cityId: null,
+        number: null,
+        price: null,
+        type: null,
+        productId: null
+      };
+      this.resetForm("form");
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.pageNum = 1;
+      this.getList();
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.resetForm("queryForm");
+      this.handleQuery();
+    },
+    // 多选框选中数据
+    handleSelectionChange(selection) {
+      this.ids = selection.map(item => item.id)
+      this.single = selection.length!==1
+      this.multiple = !selection.length
+    },
+    /** 新增按钮操作 */
+    handleAdd() {
+      this.reset();
+      this.open = true;
+      this.title = "添加免邮费";
+    },
+    /** 修改按钮操作 */
+    handleUpdate(row) {
+      this.reset();
+      const id = row.id || this.ids
+      getShippingTemplatesFree(id).then(response => {
+        this.form = response.data;
+        this.open = true;
+        this.title = "修改免邮费";
+      });
+    },
+    /** 提交按钮 */
+    submitForm() {
+      this.$refs["form"].validate(valid => {
+        if (valid) {
+          if (this.form.id != null) {
+            updateShippingTemplatesFree(this.form).then(response => {
+              if (response.code === 200) {
+                this.msgSuccess("修改成功");
+                this.open = false;
+                this.getList();
+              }
+            });
+          } else {
+            addShippingTemplatesFree(this.form).then(response => {
+              if (response.code === 200) {
+                this.msgSuccess("新增成功");
+                this.open = false;
+                this.getList();
+              }
+            });
+          }
+        }
+      });
+    },
+    /** 删除按钮操作 */
+    handleDelete(row) {
+      const ids = row.id || this.ids;
+      this.$confirm('是否确认删除免邮费编号为"' + ids + '"的数据项?', "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(function() {
+          return delShippingTemplatesFree(ids);
+        }).then(() => {
+          this.getList();
+          this.msgSuccess("删除成功");
+        }).catch(function() {});
+    },
+    /** 导出按钮操作 */
+    handleExport() {
+      const queryParams = this.queryParams;
+      this.$confirm('是否确认导出所有免邮费数据项?', "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(function() {
+          return exportShippingTemplatesFree(queryParams);
+        }).then(response => {
+          this.download(response.msg);
+        }).catch(function() {});
+    }
+  }
+};
+</script>

+ 402 - 0
src/views/hisStore/shippingTemplatesRegion/index.vue

@@ -0,0 +1,402 @@
+<template>
+  <div class="app-container">
+    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
+      <el-form-item label="省ID" prop="provinceId">
+        <el-input
+          v-model="queryParams.provinceId"
+          placeholder="请输入省ID"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="模板ID" prop="tempId">
+        <el-input
+          v-model="queryParams.tempId"
+          placeholder="请输入模板ID"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="城市ID" prop="cityId">
+        <el-input
+          v-model="queryParams.cityId"
+          placeholder="请输入城市ID"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="首件" prop="first">
+        <el-input
+          v-model="queryParams.first"
+          placeholder="请输入首件"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="首件运费" prop="firstPrice">
+        <el-input
+          v-model="queryParams.firstPrice"
+          placeholder="请输入首件运费"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="续件" prop="continues">
+        <el-input
+          v-model="queryParams.continues"
+          placeholder="请输入续件"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="续件运费" prop="continuePrice">
+        <el-input
+          v-model="queryParams.continuePrice"
+          placeholder="请输入续件运费"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="计费方式" prop="type">
+        <el-select v-model="queryParams.type" placeholder="请选择计费方式" clearable size="small">
+          <el-option label="请选择字典生成" value="" />
+        </el-select>
+      </el-form-item>
+      <el-form-item label="分组唯一值" prop="productId">
+        <el-input
+          v-model="queryParams.productId"
+          placeholder="请输入分组唯一值"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item>
+        <el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
+        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
+      </el-form-item>
+    </el-form>
+
+    <el-row :gutter="10" class="mb8">
+      <el-col :span="1.5">
+        <el-button
+          type="primary"
+          icon="el-icon-plus"
+          size="mini"
+          @click="handleAdd"
+          v-hasPermi="['store:shippingTemplatesRegion:add']"
+        >新增</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="success"
+          icon="el-icon-edit"
+          size="mini"
+          :disabled="single"
+          @click="handleUpdate"
+          v-hasPermi="['store:shippingTemplatesRegion:edit']"
+        >修改</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="danger"
+          icon="el-icon-delete"
+          size="mini"
+          :disabled="multiple"
+          @click="handleDelete"
+          v-hasPermi="['store:shippingTemplatesRegion:remove']"
+        >删除</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="warning"
+          icon="el-icon-download"
+          size="mini"
+          @click="handleExport"
+          v-hasPermi="['store:shippingTemplatesRegion:export']"
+        >导出</el-button>
+      </el-col>
+	  <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+    </el-row>
+
+    <el-table v-loading="loading" :data="shippingTemplatesRegionList" @selection-change="handleSelectionChange" border>
+      <el-table-column type="selection" width="55" align="center" />
+      <el-table-column label="编号" align="center" prop="id" />
+      <el-table-column label="省ID" align="center" prop="provinceId" />
+      <el-table-column label="模板ID" align="center" prop="tempId" />
+      <el-table-column label="城市ID" align="center" prop="cityId" />
+      <el-table-column label="首件" align="center" prop="first" />
+      <el-table-column label="首件运费" align="center" prop="firstPrice" />
+      <el-table-column label="续件" align="center" prop="continues" />
+      <el-table-column label="续件运费" align="center" prop="continuePrice" />
+      <el-table-column label="计费方式" align="center" prop="type" />
+      <el-table-column label="分组唯一值" align="center" prop="productId" />
+      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
+        <template slot-scope="scope">
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-edit"
+            @click="handleUpdate(scope.row)"
+            v-hasPermi="['store:shippingTemplatesRegion:edit']"
+          >修改</el-button>
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-delete"
+            @click="handleDelete(scope.row)"
+            v-hasPermi="['store:shippingTemplatesRegion:remove']"
+          >删除</el-button>
+        </template>
+      </el-table-column>
+    </el-table>
+
+    <pagination
+      v-show="total>0"
+      :total="total"
+      :page.sync="queryParams.pageNum"
+      :limit.sync="queryParams.pageSize"
+      @pagination="getList"
+    />
+
+    <!-- 添加或修改邮费区域对话框 -->
+    <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
+      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
+        <el-form-item label="省ID" prop="provinceId">
+          <el-input v-model="form.provinceId" placeholder="请输入省ID" />
+        </el-form-item>
+        <el-form-item label="模板ID" prop="tempId">
+          <el-input v-model="form.tempId" placeholder="请输入模板ID" />
+        </el-form-item>
+        <el-form-item label="城市ID" prop="cityId">
+          <el-input v-model="form.cityId" placeholder="请输入城市ID" />
+        </el-form-item>
+        <el-form-item label="首件" prop="first">
+          <el-input v-model="form.first" placeholder="请输入首件" />
+        </el-form-item>
+        <el-form-item label="首件运费" prop="firstPrice">
+          <el-input v-model="form.firstPrice" placeholder="请输入首件运费" />
+        </el-form-item>
+        <el-form-item label="续件" prop="continues">
+          <el-input v-model="form.continues" placeholder="请输入续件" />
+        </el-form-item>
+        <el-form-item label="续件运费" prop="continuePrice">
+          <el-input v-model="form.continuePrice" placeholder="请输入续件运费" />
+        </el-form-item>
+        <el-form-item label="计费方式" prop="type">
+          <el-select v-model="form.type" placeholder="请选择计费方式">
+            <el-option label="请选择字典生成" value="" />
+          </el-select>
+        </el-form-item>
+        <el-form-item label="分组唯一值" prop="productId">
+          <el-input v-model="form.productId" placeholder="请输入分组唯一值" />
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="submitForm">确 定</el-button>
+        <el-button @click="cancel">取 消</el-button>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import { listShippingTemplatesRegion, getShippingTemplatesRegion, delShippingTemplatesRegion, addShippingTemplatesRegion, updateShippingTemplatesRegion, exportShippingTemplatesRegion } from "@/api/hisStore/shippingTemplatesRegion";
+
+export default {
+  name: "ShippingTemplatesRegion",
+  data() {
+    return {
+      // 遮罩层
+      loading: true,
+      // 选中数组
+      ids: [],
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      // 显示搜索条件
+      showSearch: true,
+      // 总条数
+      total: 0,
+      // 邮费区域表格数据
+      shippingTemplatesRegionList: [],
+      // 弹出层标题
+      title: "",
+      // 是否显示弹出层
+      open: false,
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        provinceId: null,
+        tempId: null,
+        cityId: null,
+        first: null,
+        firstPrice: null,
+        continues: null,
+        continuePrice: null,
+        type: null,
+        productId: null
+      },
+      // 表单参数
+      form: {},
+      // 表单校验
+      rules: {
+        provinceId: [
+          { required: true, message: "省ID不能为空", trigger: "blur" }
+        ],
+        tempId: [
+          { required: true, message: "模板ID不能为空", trigger: "blur" }
+        ],
+        cityId: [
+          { required: true, message: "城市ID不能为空", trigger: "blur" }
+        ],
+        first: [
+          { required: true, message: "首件不能为空", trigger: "blur" }
+        ],
+        firstPrice: [
+          { required: true, message: "首件运费不能为空", trigger: "blur" }
+        ],
+        continues: [
+          { required: true, message: "续件不能为空", trigger: "blur" }
+        ],
+        continuePrice: [
+          { required: true, message: "续件运费不能为空", trigger: "blur" }
+        ],
+        type: [
+          { required: true, message: "计费方式不能为空", trigger: "change" }
+        ],
+        productId: [
+          { required: true, message: "分组唯一值不能为空", trigger: "blur" }
+        ]
+      }
+    };
+  },
+  created() {
+    this.getList();
+  },
+  methods: {
+    /** 查询邮费区域列表 */
+    getList() {
+      this.loading = true;
+      listShippingTemplatesRegion(this.queryParams).then(response => {
+        this.shippingTemplatesRegionList = response.rows;
+        this.total = response.total;
+        this.loading = false;
+      });
+    },
+    // 取消按钮
+    cancel() {
+      this.open = false;
+      this.reset();
+    },
+    // 表单重置
+    reset() {
+      this.form = {
+        id: null,
+        provinceId: null,
+        tempId: null,
+        cityId: null,
+        first: null,
+        firstPrice: null,
+        continues: null,
+        continuePrice: null,
+        type: null,
+        productId: null
+      };
+      this.resetForm("form");
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.pageNum = 1;
+      this.getList();
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.resetForm("queryForm");
+      this.handleQuery();
+    },
+    // 多选框选中数据
+    handleSelectionChange(selection) {
+      this.ids = selection.map(item => item.id)
+      this.single = selection.length!==1
+      this.multiple = !selection.length
+    },
+    /** 新增按钮操作 */
+    handleAdd() {
+      this.reset();
+      this.open = true;
+      this.title = "添加邮费区域";
+    },
+    /** 修改按钮操作 */
+    handleUpdate(row) {
+      this.reset();
+      const id = row.id || this.ids
+      getShippingTemplatesRegion(id).then(response => {
+        this.form = response.data;
+        this.open = true;
+        this.title = "修改邮费区域";
+      });
+    },
+    /** 提交按钮 */
+    submitForm() {
+      this.$refs["form"].validate(valid => {
+        if (valid) {
+          if (this.form.id != null) {
+            updateShippingTemplatesRegion(this.form).then(response => {
+              if (response.code === 200) {
+                this.msgSuccess("修改成功");
+                this.open = false;
+                this.getList();
+              }
+            });
+          } else {
+            addShippingTemplatesRegion(this.form).then(response => {
+              if (response.code === 200) {
+                this.msgSuccess("新增成功");
+                this.open = false;
+                this.getList();
+              }
+            });
+          }
+        }
+      });
+    },
+    /** 删除按钮操作 */
+    handleDelete(row) {
+      const ids = row.id || this.ids;
+      this.$confirm('是否确认删除邮费区域编号为"' + ids + '"的数据项?', "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(function() {
+          return delShippingTemplatesRegion(ids);
+        }).then(() => {
+          this.getList();
+          this.msgSuccess("删除成功");
+        }).catch(function() {});
+    },
+    /** 导出按钮操作 */
+    handleExport() {
+      const queryParams = this.queryParams;
+      this.$confirm('是否确认导出所有邮费区域数据项?', "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(function() {
+          return exportShippingTemplatesRegion(queryParams);
+        }).then(response => {
+          this.download(response.msg);
+        }).catch(function() {});
+    }
+  }
+};
+</script>