瀏覽代碼

商品管理

阿拉蕾 2 年之前
父節點
當前提交
7d3df958c2

+ 60 - 0
src/api/oms/category.js

@@ -0,0 +1,60 @@
+import request from '@/utils/request'
+
+// 查询商品分类列表
+export function listCategory(query) {
+  return request({
+    url: '/oms/category/list',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询商品分类详细
+export function getCategory(cateId) {
+  return request({
+    url: '/oms/category/' + cateId,
+    method: 'get'
+  })
+}
+
+// 新增商品分类
+export function addCategory(data) {
+  return request({
+    url: '/oms/category',
+    method: 'post',
+    data: data
+  })
+}
+
+// 修改商品分类
+export function updateCategory(data) {
+  return request({
+    url: '/oms/category',
+    method: 'put',
+    data: data
+  })
+}
+
+// 删除商品分类
+export function delCategory(cateId) {
+  return request({
+    url: '/oms/category/' + cateId,
+    method: 'delete'
+  })
+}
+
+// 导出商品分类
+export function exportCategory(query) {
+  return request({
+    url: '/oms/category/export',
+    method: 'get',
+    params: query
+  })
+}
+
+export function getAllOmsProductCategory() {
+  return request({
+    url: '/oms/category/getAllList' ,
+    method: 'get'
+  })
+}

+ 63 - 0
src/api/oms/product.js

@@ -0,0 +1,63 @@
+import request from '@/utils/request'
+
+// 查询商品列表
+export function listProduct(query) {
+  return request({
+    url: '/oms/product/list',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询商品详细
+export function getProduct(productId) {
+  return request({
+    url: '/oms/product/' + productId,
+    method: 'get'
+  })
+}
+
+// 新增商品
+export function addOrEdit(data) {
+  return request({
+    url: '/oms/product/addOrEdit',
+    method: 'post',
+    data: data
+  })
+}
+
+
+// 删除商品
+export function delProduct(productId) {
+  return request({
+    url: '/oms/product/' + productId,
+    method: 'delete'
+  })
+}
+
+// 导出商品
+export function exportProduct(query) {
+  return request({
+    url: '/oms/product/export',
+    method: 'get',
+    params: query
+  })
+}
+
+// 生成属性
+export function genFormatAttr(productId,json) {
+  return request({
+    url: '/oms/product/genFormatAttr/' + productId,
+    method: 'post',
+    data:json
+  })
+}
+
+//获取属性值
+export function getOmsProductAttrValueList(query) {
+  return request({
+    url: '/oms/product/getOmsProductAttrValueList',
+    method: 'get',
+    params: query
+  })
+}

+ 53 - 0
src/api/oms/supplier.js

@@ -0,0 +1,53 @@
+import request from '@/utils/request'
+
+// 查询供应商管理列表
+export function listSupplier(query) {
+  return request({
+    url: '/oms/supplier/list',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询供应商管理详细
+export function getSupplier(id) {
+  return request({
+    url: '/oms/supplier/' + id,
+    method: 'get'
+  })
+}
+
+// 新增供应商管理
+export function addSupplier(data) {
+  return request({
+    url: '/oms/supplier',
+    method: 'post',
+    data: data
+  })
+}
+
+// 修改供应商管理
+export function updateSupplier(data) {
+  return request({
+    url: '/oms/supplier',
+    method: 'put',
+    data: data
+  })
+}
+
+// 删除供应商管理
+export function delSupplier(id) {
+  return request({
+    url: '/oms/supplier/' + id,
+    method: 'delete'
+  })
+}
+
+// 导出供应商管理
+export function exportSupplier(query) {
+  return request({
+    url: '/oms/supplier/export',
+    method: 'get',
+    params: query
+  })
+}

+ 53 - 0
src/api/oms/supplierProduct.js

@@ -0,0 +1,53 @@
+import request from '@/utils/request'
+
+// 查询供应商商品列表
+export function listSupplierProduct(query) {
+  return request({
+    url: '/oms/supplierProduct/list',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询供应商商品详细
+export function getSupplierProduct(id) {
+  return request({
+    url: '/oms/supplierProduct/' + id,
+    method: 'get'
+  })
+}
+
+// 新增供应商商品
+export function addSupplierProduct(data) {
+  return request({
+    url: '/oms/supplierProduct',
+    method: 'post',
+    data: data
+  })
+}
+
+// 修改供应商商品
+export function updateSupplierProduct(data) {
+  return request({
+    url: '/oms/supplierProduct',
+    method: 'put',
+    data: data
+  })
+}
+
+// 删除供应商商品
+export function delSupplierProduct(id) {
+  return request({
+    url: '/oms/supplierProduct/' + id,
+    method: 'delete'
+  })
+}
+
+// 导出供应商商品
+export function exportSupplierProduct(query) {
+  return request({
+    url: '/oms/supplierProduct/export',
+    method: 'get',
+    params: query
+  })
+}

+ 279 - 0
src/views/oms/category/index.vue

@@ -0,0 +1,279 @@
+<template>
+  <div class="app-container">
+    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
+      <el-form-item label="分类名称" prop="cateName">
+        <el-input
+          v-model="queryParams.cateName"
+          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="['oms:category:add']"
+        >新增</el-button>
+      </el-col>
+      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+    </el-row>
+
+    <el-table
+    height="500" border
+      v-loading="loading"
+      :data="productCategoryList"
+      row-key="cateId"
+      :tree-props="{children: 'children', hasChildren: 'hasChildren'}"
+    >
+      <el-table-column label="分类名称" align="left" prop="cateName" />
+      <el-table-column  label="状态" align="center" prop="isShow">
+        <template slot-scope="scope">
+          <div>
+            <el-tag v-if="scope.row.isShow === 1" :type="''">显示</el-tag>
+            <el-tag v-else :type=" 'info' ">隐藏</el-tag>
+          </div>
+        </template>
+      </el-table-column>
+      <el-table-column label="排序" sortable 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="['oms:category:edit']"
+          >修改</el-button>
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-delete"
+            @click="handleDelete(scope.row)"
+            v-hasPermi="['oms:category:remove']"
+          >删除</el-button>
+        </template>
+      </el-table-column>
+    </el-table>
+
+    <!-- 添加或修改商品分类对话框 -->
+    <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="上级分类" prop="pid"  >
+          <treeselect v-model="form.pid" :options="productCategoryOptions" :normalizer="normalizer" placeholder="请选择上级分类" />
+        </el-form-item>
+        <el-form-item label="分类名称" prop="cateName">
+          <el-input v-model="form.cateName" placeholder="请输入分类名称" />
+        </el-form-item>
+        <el-form-item label="图标"  prop="pic" v-if="form.pid!=0">
+           <Material v-model="picArr" type="image" :num="1" :width="150" :height="150" />
+        </el-form-item>
+        <el-form-item label="状态" prop="isShow">
+            <el-radio v-model="form.isShow" label="1">显示</el-radio>
+            <el-radio v-model="form.isShow" label="0">隐藏</el-radio>
+        </el-form-item>
+        <el-form-item label="排序" prop="sort">
+          <el-input-number 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>
+  </div>
+</template>
+<script>
+import { listCategory, getCategory, delCategory, addCategory, updateCategory, exportCategory } from "@/api/oms/category";
+import Treeselect from "@riophae/vue-treeselect";
+import "@riophae/vue-treeselect/dist/vue-treeselect.css";
+import Material from '@/components/Material'
+export default {
+  name: "Category",
+  components: {
+    Treeselect,
+    Material
+  },
+  watch: {
+    picArr: function(val) {
+      this.form.pic = val.join(',')
+    }
+  },
+  data() {
+    return {
+      picArr: [],
+      // 遮罩层
+      loading: true,
+      // 显示搜索条件
+      showSearch: true,
+      // 商品分类表格数据
+      productCategoryList: [],
+      // 商品分类树选项
+      productCategoryOptions: [],
+      // 弹出层标题
+      title: "",
+      // 是否显示弹出层
+      open: false,
+      // 查询参数
+      queryParams: {
+        pid: null,
+        cateName: null,
+        sort: null,
+        pic: null,
+        isShow: null,
+        isDel: null
+      },
+      // 表单参数
+      form: {},
+      // 表单校验
+      rules: {
+        pid: [
+          { required: true, message: "父id不能为空", trigger: "blur" }
+        ],
+        cateName: [
+          { required: true, message: "分类名称不能为空", trigger: "blur" }
+        ],
+        pic: [
+          { required: true, message: "图标不能为空", trigger: "blur" }
+        ],
+      }
+    };
+  },
+  created() {
+    this.getList();
+  },
+  methods: {
+    /** 查询商品分类列表 */
+    getList() {
+      this.loading = true;
+      listCategory(this.queryParams).then(response => {
+        this.productCategoryList = this.handleTree(response.data, "cateId", "pid");
+        this.loading = false;
+      });
+    },
+    /** 转换商品分类数据结构 */
+    normalizer(node) {
+      if (node.children && !node.children.length) {
+        delete node.children;
+      }
+      return {
+        id: node.cateId,
+        label: node.cateName,
+        children: node.children
+      };
+    },
+	  /** 查询部门下拉树结构 */
+    getTreeselect() {
+      listCategory().then(response => {
+        this.productCategoryOptions = [];
+        const data = { cateId: 0, cateName: '顶级目录', children: [] };
+        data.children = response.data.filter(item => item.pid == 0)
+        this.productCategoryOptions.push(data);
+      });
+    },
+    // 取消按钮
+    cancel() {
+      this.open = false;
+      this.reset();
+    },
+    // 表单重置
+    reset() {
+      this.form = {
+        cateId: null,
+        pid: "0",
+        cateName: null,
+        sort: null,
+        pic: null,
+        isShow: "1",
+        createTime: null,
+        updateTime: null,
+        isDel: null
+      };
+      this.picArr=[];
+      this.resetForm("form");
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.getList();
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.resetForm("queryForm");
+      this.handleQuery();
+    },
+    /** 新增按钮操作 */
+    handleAdd() {
+      this.reset();
+	    this.getTreeselect();
+      this.open = true;
+      this.title = "添加商品分类";
+    },
+    /** 修改按钮操作 */
+    handleUpdate(row) {
+      this.reset();
+	    this.getTreeselect();
+      if (row != null) {
+        this.form.productId = row.cateId;
+      }
+      
+      getCategory(row.cateId).then(response => {
+        this.form = response.data;
+        if(this.form.pic!=null){
+          this.picArr=this.form.pic.split(",");
+        }
+        this.form.isShow = response.data.isShow.toString();
+        this.open = true;
+        this.title = "修改商品分类";
+      });
+    },
+    /** 提交按钮 */
+    submitForm() {
+      this.$refs["form"].validate(valid => {
+        if (valid) {
+          if (this.form.cateId != null) {
+            updateCategory(this.form).then(response => {
+              if (response.code === 200) {
+                this.msgSuccess("修改成功");
+                this.open = false;
+                this.getList();
+              }
+            });
+          } else {
+            addCategory(this.form).then(response => {
+              if (response.code === 200) {
+                this.msgSuccess("新增成功");
+                this.open = false;
+                this.getList();
+              }
+            });
+          }
+        }
+      });
+    },
+    /** 删除按钮操作 */
+    handleDelete(row) {
+      this.$confirm('是否确认删除商品分类编号为"' + row.cateId + '"的数据项?', "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(function() {
+          return delCategory(row.cateId);
+        }).then(() => {
+          this.getList();
+          this.msgSuccess("删除成功");
+        }).catch(function() {});
+    }
+  }
+};
+</script>

+ 771 - 0
src/views/oms/product/index.vue

@@ -0,0 +1,771 @@
+<template>
+  <div class="app-container">
+    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
+      <el-form-item label="商品分类" prop="cateId">
+         <treeselect  v-model="queryParams.cateId"  style="width:205.4px" :options="categoryOptions" :normalizer="normalizer" placeholder="请选择分类" />
+      </el-form-item>
+
+      <el-form-item label="商品名称" prop="productName">
+        <el-input
+          v-model="queryParams.productName"
+          placeholder="请输入商品名称"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+
+       <el-form-item label="商品编号" prop="barCode">
+        <el-input
+          v-model="queryParams.barCode"
+          placeholder="请输入商品编号"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+
+
+      <el-form-item label="商品类型" prop="productType">
+        <el-select   v-model="queryParams.productType" placeholder="请选择商品类型" clearable size="small" >
+         <el-option
+                v-for="item in productTypeOptions"
+                :key="item.dictValue"
+                :label="item.dictLabel"
+                :value="item.dictValue"
+              />
+        </el-select>
+      </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="['oms:product: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="['oms:product: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="['oms:product:remove']"
+        >删除</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="warning"
+          icon="el-icon-download"
+          size="mini"
+          @click="handleExport"
+          v-hasPermi="['oms:product:export']"
+        >导出</el-button>
+      </el-col>
+	  <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+    </el-row>
+
+    <el-tabs type="card" v-model="activeName" @tab-click="handleClick">
+      <el-tab-pane label="已审核" name="1"></el-tab-pane>
+      <el-tab-pane label="未审核" name="0"></el-tab-pane>
+    </el-tabs>
+    <el-table height="500" border v-loading="loading" :data="productList" @selection-change="handleSelectionChange">
+      <el-table-column type="selection" width="55" align="center" />
+      <el-table-column label="ID" align="center" prop="productId" />
+      <el-table-column label="商品图片" align="center" width="120">
+        <template slot-scope="scope">
+          <el-popover
+            placement="right"
+            title=""
+            trigger="hover"
+          >
+            <img slot="reference" :src="scope.row.image" width="100">
+            <img :src="scope.row.image" style="max-width: 150px;">
+          </el-popover>
+        </template>
+      </el-table-column>
+      <el-table-column label="商品名称" show-overflow-tooltip align="center" prop="productName" />
+      <el-table-column label="商品分类" align="center" prop="cateName" />
+      <el-table-column label="售价" align="center" prop="price" >
+         <template slot-scope="scope" >
+              <span v-if="scope.row.price!=null">{{scope.row.price.toFixed(2)}}</span>
+          </template>
+      </el-table-column>
+      <el-table-column label="原价" align="center" prop="otPrice" >
+          <template slot-scope="scope" >
+              <span v-if="scope.row.otPrice!=null">{{scope.row.otPrice.toFixed(2)}}</span>
+          </template>
+        </el-table-column>
+    
+      <el-table-column label="类型" align="center" prop="productType" >
+          <template slot-scope="scope">
+              <el-tag prop="productType" v-for="(item, index) in productTypeOptions"    v-if="scope.row.productType==item.dictValue">{{item.dictLabel}}</el-tag>
+          </template>
+      </el-table-column>
+
+      <el-table-column label="状态" align="center" prop="isAudit" >
+          <template slot-scope="scope">
+              <el-tag prop="status" v-for="(item, index) in isAuditOptions"    v-if="scope.row.isAudit==item.dictValue">{{item.dictLabel}}</el-tag>
+          </template>
+      </el-table-column>
+      <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="['oms:product:edit']"
+          >修改</el-button>
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-delete"
+            @click="handleDelete(scope.row)"
+            v-hasPermi="['oms:product: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="1000px" append-to-body>
+      <el-form ref="form" :model="form" :rules="rules" label-width="100px">
+        <el-row >
+          <el-col :span="12">
+            <el-form-item label="商品名称" prop="productName">
+              <el-input v-model="form.productName" placeholder="请输入商品名称" />
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item label="商品分类" prop="cateId">
+               <treeselect v-model="form.cateId" :options="categoryOptions" :normalizer="normalizer" placeholder="请选择商品分类" />
+            </el-form-item>
+          </el-col>
+        </el-row>
+        <el-row>
+          <el-col :span="24">
+            <el-form-item label="商品简介" prop="productInfo">
+              <el-input v-model="form.productInfo" type="textarea" :rows="2" placeholder="请输入商品简介" />
+            </el-form-item>
+          </el-col>
+        </el-row>
+        <el-form-item label="商品图片" prop="image">
+          <Material v-model="imageArr" type="image" :num="1" :width="150" :height="150" />
+        </el-form-item>
+        <el-form-item label="轮播图" prop="sliderImage">
+          <Material v-model="photoArr" type="image" :num="10" :width="150" :height="150" />
+        </el-form-item>
+        <el-row>
+          <el-col :span="24">
+            <el-form-item label="商品规格:" props="specType">
+              <el-radio-group v-model="form.specType" >
+                <el-radio :label="0" class="radio">单规格</el-radio>
+                <el-radio :label="1">多规格</el-radio>
+              </el-radio-group>
+            </el-form-item>
+          </el-col>
+           <!-- 多规格添加-->
+          <el-col :span="24" v-if="form.specType === 1" class="noForm">
+            <el-col :span="24">
+              <el-form-item v-if="attrs!=null&&attrs.length!==0">
+                <div  v-for="(item, index) in attrs" :key="index">
+                  <div class="acea-row row-middle"><span class="mr5">{{item.value}}</span>
+                    <i class="el-icon-circle-close"  @click="handleRemoveRole(index)"></i>
+                  </div>
+                  <div class="rulesBox">
+                    <el-tag type="dot" closable color="primary" v-for="(j, indexn) in item.detail" :key="indexn" :name="j" class="mr20" @close="handleRemove2(item.detail,indexn)">{{j}}</el-tag>
+                    <el-input placeholder="请输入属性名称" v-model="item.detail.attrsVal"
+                              style="width: 200px">
+                      <el-button slot="append" type="primary" @click="createAttr(item.detail.attrsVal,index)">添加</el-button>
+                    </el-input>
+                  </div>
+                </div>
+              </el-form-item>
+            </el-col>
+             <el-col :span="24" v-if="createBnt">
+              <el-form-item>
+                <el-button type="primary" size="small" icon="md-add" @click="addBtn" class="mr15">添加新规格</el-button>
+                <el-button type="success" size="small"  @click="generate">立即生成</el-button>
+              </el-form-item>
+            </el-col>
+            <el-col :span="24" v-if="showIput">
+              <el-col  :xl="6" :lg="9" :md="10" :sm="24" :xs="24" >
+                <el-form-item label="规格:">
+                  <el-input  placeholder="请输入规格" v-model="formDynamic.attrsName"  />
+                </el-form-item>
+              </el-col>
+              <el-col  :xl="6" :lg="9" :md="10" :sm="24" :xs="24">
+                <el-form-item label="规格值:">
+                  <el-input v-model="formDynamic.attrsVal" placeholder="请输入规格值"  />
+                </el-form-item>
+              </el-col>
+              <el-col :xl="6" :lg="5" :md="10" :sm="24" :xs="24" >
+                  <el-button type="primary"    @click="createAttrName">确定</el-button>
+                  <el-button type="danger" @click="closeAttrName" >取消</el-button>
+              </el-col>
+            </el-col>
+            <!-- 多规格设置-->
+            <el-col :xl="24" :lg="24" :md="24" :sm="24" :xs="24" v-if="manyFormValidate!=null&&manyFormValidate.length">
+              <!-- 多规格表格-->
+              <el-col :span="24">
+                <el-form-item label="商品属性:" class="labeltop">
+                  <el-table :data="manyFormValidate" size="small" style="width: 90%;">
+                    <el-table-column type="myindex" v-for="(item,index) in form.header" :key="index"  :width="item.minWidth" :label="item.title" :property="item.slot" align="center">
+                      <template slot-scope="scope">
+                        <div v-if="scope.column.property == 'image'" align="center">
+                          <single-img v-model="scope.row[scope.column.property]" type="image" :num="1" :width="60" :height="60" />
+                        </div>
+                        <div v-else-if="scope.column.property.indexOf('value') != -1" align="center">
+                         {{ scope.row[scope.column.property] }}
+                        </div>
+                        <div v-else-if="scope.column.property == 'action'" align="center" >
+                          <a @click="delAttrTable(scope.$index)" align="center">删除</a>
+                        </div>
+                        <div v-else align="center">
+                          <el-input  v-model="scope.row[scope.column.property]" align="center" />
+                        </div>
+                      </template>
+                    </el-table-column>
+                  </el-table>
+                </el-form-item>
+              </el-col>
+            </el-col>
+          </el-col>
+          <!-- 单规格表格-->
+          <el-col :xl="23" :lg="24" :md="24" :sm="24" :xs="24" v-if="form.specType === 0">
+            <el-form-item >
+              <el-table :data="oneFormValidate"  size="small" style="width: 90%;">
+                <el-table-column prop="image" label="图片" align="center">
+                  <template slot-scope="scope">
+                    <single-img v-model="scope.row.image" type="image" :num="1" :width="60" :height="60" />
+                  </template>
+                </el-table-column>
+                <el-table-column prop="price" label="商品价格" align="center">
+                  <template slot-scope="scope">
+                    <el-input type="text" v-model="scope.row.price"/>
+                  </template>
+                </el-table-column>
+                <el-table-column prop="cost" label="成本价" align="center">
+                  <template slot-scope="scope">
+                    <el-input type="text" v-model="scope.row.cost"/>
+                  </template>
+                </el-table-column>
+                <el-table-column prop="otPrice" label="原价" align="center">
+                  <template slot-scope="scope">
+                    <el-input type="text" v-model="scope.row.otPrice"/>
+                  </template>
+                </el-table-column>
+                <el-table-column prop="barCode" label="商品编号" width="130px" align="center">
+                  <template slot-scope="scope">
+                    <el-input type="text" v-model="scope.row.barCode"/>
+                  </template>
+                </el-table-column>
+                <el-table-column prop="weight" label="重量(KG)" align="center">
+                  <template slot-scope="scope">
+                    <el-input type="text" v-model="scope.row.weight"/>
+                  </template>
+                </el-table-column>
+                <el-table-column prop="volume" label="体积(m³)" align="center">
+                  <template slot-scope="scope">
+                    <el-input type="text" v-model="scope.row.volume"/>
+                  </template>
+                </el-table-column>
+              </el-table>
+            </el-form-item>
+          </el-col>
+        </el-row>
+        <el-row>
+          <el-col :span="8">
+            <el-form-item label="单位名" prop="unitName">
+              <el-input v-model="form.unitName" placeholder="请输入单位名" />
+            </el-form-item>
+          </el-col>
+          <el-col :span="8">
+            <el-form-item label="排序" prop="sort">
+               <el-input-number :min="0"  v-model="form.sort" placeholder="请输入排序" />
+            </el-form-item>
+          </el-col>
+        </el-row>
+        <el-form-item label="审核状态" prop="isAudit">
+          <el-select style="width: 240px" v-model="form.isAudit" placeholder="请选择是否审核" clearable size="small" >
+            <el-option
+                    v-for="item in isAuditOptions"
+                    :key="item.dictValue"
+                    :label="item.dictLabel"
+                    :value="item.dictValue"
+                  />
+            </el-select>
+        </el-form-item>
+        <el-form-item label="商品类型" prop="productType">
+          <el-select style="width: 240px" v-model="form.productType" placeholder="请选择商品类型" clearable size="small" >
+            <el-option
+                    v-for="item in productTypeOptions"
+                    :key="item.dictValue"
+                    :label="item.dictLabel"
+                    :value="item.dictValue"
+                  />
+            </el-select>
+        </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 {genFormatAttr, listProduct, getProduct, delProduct, addOrEdit, exportProduct } from "@/api/oms/product";
+import { getAllOmsProductCategory } from "@/api/oms/category";
+
+import Treeselect from "@riophae/vue-treeselect";
+import "@riophae/vue-treeselect/dist/vue-treeselect.css";
+import Editor from '@/components/Editor/wang';
+import Material from '@/components/Material'
+import singleImg from '@/components/Material/single'
+export default {
+  name: "StoreProduct",
+  components: {
+    Treeselect,
+    Editor,
+    Material,
+    singleImg,
+  },
+  watch: {
+    imageArr: function(val) {
+      this.form.image = val.join(',')
+    },
+    photoArr: function(val) {
+      this.form.sliderImage = val.join(',')
+    }
+  },
+  data() {
+    return {
+      showIput: false,
+      createBnt:true,
+       // 规格数据
+       formDynamic: {
+        attrsName: '',
+        attrsVal: ''
+      },
+      isBtn: false,
+      attrs:[],
+      // 多规格表格data
+      manyFormValidate: [],
+      // 单规格表格data
+      oneFormValidate: [
+        {
+          image: '',
+          price: 0,
+          cost: 0,
+          otPrice: 0,
+          barCode: '',
+          weight: 0,
+          volume: 0
+        }
+      ],
+      photoArr:[],
+      imageArr:[],
+      activeName:"1",
+      productTypeOptions:[],
+      isAuditOptions:[],
+      categoryOptions:[],
+      // 遮罩层
+      loading: true,
+      // 选中数组
+      ids: [],
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      // 显示搜索条件
+      showSearch: true,
+      // 总条数
+      total: 0,
+      // 商品表格数据
+      productList: [],
+      // 弹出层标题
+      title: "",
+      // 是否显示弹出层
+      open: false,
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        productName: null,
+        productType: null,
+        isAudit: "1",
+        barCode:null,
+       
+      },
+      // 表单参数
+      form: {},
+      // 表单校验
+      rules: {
+        image: [
+          { required: true, message: "商品图片不能为空", trigger: "blur" }
+        ],
+        sliderImage: [
+          { required: true, message: "轮播图不能为空", trigger: "blur" }
+        ],
+        productName: [
+          { required: true, message: "商品名称不能为空", trigger: "blur" }
+        ],
+        productInfo: [
+          { required: true, message: "商品简介不能为空", trigger: "blur" }
+        ],
+        unitName: [
+          { required: true, message: "单位名不能为空", trigger: "blur" }
+        ],
+        cateId: [
+          { required: true, message: "分类id不能为空", trigger: "blur" }
+        ],
+        price: [
+          { required: true, message: "商品价格不能为空", trigger: "blur" }
+        ],
+        prescribeSpec: [
+          { required: true, message: "规格不能为空", trigger: "blur" }
+        ],
+      }
+    };
+  },
+  created() {
+    this.getDicts("store_product_type").then((response) => {
+      this.productTypeOptions = response.data;
+    });
+    this.getDicts("store_product_is_audit").then((response) => {      
+      this.isAuditOptions = response.data;
+    });
+    this.getTreeselect();
+    this.getList();
+  },
+  methods: {
+    // 删除表格中的属性
+    delAttrTable (index) {
+      this.manyFormValidate.splice(index, 1);
+    },
+    addBtn () {
+      this.clearAttr();
+      this.createBnt = false;
+      this.showIput = true;
+    },
+    //生成SKU
+    generate () {
+      genFormatAttr(this.form.productId, { attrs: this.attrs }).then(res => {
+        if(this.form.specType === 0){
+            this.oneFormValidate = res.value;
+            this.form.header = res.header;
+            let header = res.header;
+            header.pop();
+            this.oneFormValidate.map((item) => {
+              if(this.imageArr.length>0){
+                item.image = this.imageArr[0]
+              }
+            });
+        }else if(this.form.specType === 1) {
+            this.manyFormValidate = res.value;
+            let headerdel = {
+              title: '操作',
+              slot: 'action',
+              fixed: 'right',
+              width: 220
+            };
+            res.header.push(headerdel);
+            this.form.header = res.header;
+            let header = res.header;
+            header.pop();
+            // this.manyFormValidate.map((item) => {
+            //   if(this.imageArr.length>0){
+            //     item.image = this.imageArr[0]
+            //   }
+            // });
+        }
+        
+      }).catch(res => {
+      })
+    },
+    // 取消添加新规格
+    closeAttrName () {
+      this.showIput = false;
+      this.createBnt = true;
+    },
+    clearAttr () {
+      this.formDynamic.attrsName = '';
+      this.formDynamic.attrsVal = '';
+    },
+    // 删除规格
+    handleRemoveRole (index) {
+      this.attrs.splice(index, 1);
+      this.manyFormValidate.splice(index, 1);
+    },
+    // 删除属性
+    handleRemove2 (item, index) {
+      item.splice(index, 1);
+    },
+    // 添加规则名称
+    createAttrName () {
+      if (this.formDynamic.attrsName && this.formDynamic.attrsVal) {
+        let data = {
+          value: this.formDynamic.attrsName,
+          detail: [
+            this.formDynamic.attrsVal
+          ]
+        };
+        this.attrs.push(data);
+        var hash = {};
+        this.attrs = this.attrs.reduce(function (item, next) {
+          hash[next.value] ? '' : hash[next.value] = true && item.push(next);
+          return item
+        }, [])
+        this.clearAttr();
+        this.showIput = false;
+        this.createBnt = true;
+      } else {
+        this.$message.warning('请添加完整的规格!');
+      }
+    },
+    // 添加属性
+    createAttr (num, idx) {
+      if (num) {
+        this.attrs[idx].detail.push(num);
+        var hash = {};
+        this.attrs[idx].detail = this.attrs[idx].detail.reduce(function (item, next) {
+          hash[next] ? '' : hash[next] = true && item.push(next);
+          return item
+        }, [])
+      } else {
+        this.$message.warning('请添加属性!');
+      }
+    },
+    updateText(text){
+      this.form.description=text
+    },
+    handleClick(tab, event) {
+      this.queryParams.isAudit=tab.name;
+      this.getList();
+    },
+    /** 转换商品分类数据结构 */
+    normalizer(node) {
+      if (node.children && !node.children.length) {
+        delete node.children;
+      }
+      return {
+        id: node.cateId,
+        label: node.cateName,
+        children: node.children
+      };
+    },
+    getTreeselect() {
+      getAllOmsProductCategory().then(response => {
+        this.categoryOptions = [];
+        const data = this.handleTree(response.data, "cateId", "pid");
+        this.categoryOptions=data;
+      });
+    },
+    /** 查询商品列表 */
+    getList() {
+      this.loading = true;
+      listProduct(this.queryParams).then(response => {
+        this.productList = response.rows;
+        this.total = response.total;
+        this.loading = false;
+      });
+    },
+    // 取消按钮
+    cancel() {
+      this.open = false;
+      this.reset();
+    },
+    // 表单重置
+    reset() {
+      this.form = {
+        productId: 0,
+        image: null,
+        sliderImage: null,
+        productName: null,
+        productInfo: null,
+        barCode: null,
+        cateId: null,
+        price: null,
+        otPrice: null,
+        cost: null,
+        specType: 0,
+        unitName: null,
+        sort: null,
+        productType: "1",
+        createTime: null,
+        updateTime: null,
+        isDel: null,
+        isAudit: "0"
+      };
+      this.resetForm("form");
+      this.oneFormValidate = [
+        {
+          image: '',
+          price: 0,
+          cost: 0,
+          otPrice: 0,
+          barCode: '',
+          weight: 0,
+          volume: 0
+        }
+      ]
+      this.attrs=[];
+      this.photoArr=[];
+      this.imageArr=[];
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.pageNum = 1;
+      this.getList();
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.resetForm("queryForm");
+      this.handleQuery();
+    },
+    // 多选框选中数据
+    handleSelectionChange(selection) {
+      this.ids = selection.map(item => item.productId)
+      this.single = selection.length!==1
+      this.multiple = !selection.length
+    },
+    /** 新增按钮操作 */
+    handleAdd() {
+      this.reset();
+
+      this.open = true;
+      this.title = "添加商品";
+    },
+
+     /** 修改按钮操作 */
+     handleUpdate(row) {
+      var that=this;
+      this.reset();
+      const productId = row.productId || this.ids
+      getProduct(productId).then(response => {
+        this.form = response.data;
+        // this.form.isDel = response.data.isDel.toString();
+        this.form.isAudit = response.data.isAudit.toString();
+        this.form.productType = response.data.productType.toString();
+        //组装attrs数据
+        if(response.attrs!=null){
+          this.attrs=[];
+          response.attrs.forEach(function (item, index) {
+             var data={value:item.attrName,detail:item.attrValues.split(',')}
+             that.attrs.push(data);
+          });
+        }
+        setTimeout(() => {
+          that.generate();
+        }, 200);
+        if(this.form.specType === 0){
+          that.manyFormValidate = [];
+        }else {
+          that.createBnt = true;
+          that.oneFormValidate = [
+            {
+              image: '',
+              price: 0,
+              cost: 0,
+              otPrice: 0,
+              barCode: '',
+              weight: 0,
+              volume: 0
+            }
+          ]
+        }
+        if(this.form.image!=null){
+          this.imageArr=this.form.image.split(",");
+        }
+        if(this.form.sliderImage!=null){
+          this.photoArr=this.form.sliderImage.split(",");
+        }
+        console.log(this.oneFormValidate)
+        this.open = true;
+        this.title = "修改商品";
+      });
+    },
+    /** 提交按钮 */
+    submitForm() {
+      this.$refs["form"].validate(valid => {
+        if (valid) {
+          if(this.form.specType ===0 ){
+            this.form.items = [];
+            this.form.values = this.oneFormValidate;
+          }else{
+            this.form.items = this.attrs;
+            this.form.values = this.manyFormValidate;
+          }
+          if(this.form.specType === 1 && this.manyFormValidate.length===0){
+            return this.$message.warning('请点击生成规格!');
+          }
+          addOrEdit(this.form).then(response => {
+            if (response.code === 200) {
+              this.msgSuccess("修改成功");
+              this.open = false;
+              this.getList();
+            }
+          });
+        }
+      });
+    },
+    /** 删除按钮操作 */
+    handleDelete(row) {
+      const productIds = row.productId || this.ids;
+      this.$confirm('是否确认删除商品编号为"' + productIds + '"的数据项?', "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(function() {
+          return delProduct(productIds);
+        }).then(() => {
+          this.getList();
+          this.msgSuccess("删除成功");
+        }).catch(function() {});
+    },
+    /** 导出按钮操作 */
+    handleExport() {
+      const queryParams = this.queryParams;
+      this.$confirm('是否确认导出所有商品数据项?', "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(function() {
+          return exportProduct(queryParams);
+        }).then(response => {
+          this.download(response.msg);
+        }).catch(function() {});
+    }
+  }
+};
+</script>

+ 558 - 0
src/views/oms/supplier/index.vue

@@ -0,0 +1,558 @@
+<template>
+  <div class="app-container">
+    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="90px">
+      <el-form-item label="供应商编码" prop="code">
+        <el-input
+          v-model="queryParams.code"
+          placeholder="请输入"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <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 label="状态 " prop="status">
+        <el-select v-model="queryParams.status" placeholder="请选择状态 " clearable size="small">
+          <el-option
+            v-for="dict in statusOptions"
+            :key="dict.dictValue"
+            :label="dict.dictLabel"
+            :value="dict.dictValue"
+          />
+        </el-select>
+      </el-form-item>
+      <el-form-item label="供应商分类" prop="type">
+        <el-input
+          v-model="queryParams.type"
+          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="['oms:supplier: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="['oms:supplier: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="['oms:supplier:remove']"
+        >删除</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="warning"
+          icon="el-icon-download"
+          size="mini"
+          @click="handleExport"
+          v-hasPermi="['oms:supplier:export']"
+        >导出</el-button>
+      </el-col>
+	  <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+    </el-row>
+
+    <el-table height="700" border v-loading="loading" :data="supplierList" @selection-change="handleSelectionChange">
+      <el-table-column type="selection" width="55" align="center" />
+      <el-table-column label="供应商名称" width="160" align="center" prop="name" />
+      <el-table-column label="序号" width="55" align="center" prop="id" />
+      <el-table-column label="状态" align="center" prop="status" >
+          <template slot-scope="scope">
+              <el-tag prop="status" v-for="(item, index) in statusOptions"    v-if="scope.row.status==item.dictValue">{{item.dictLabel}}</el-tag>
+          </template>
+      </el-table-column>
+      <el-table-column label="供应商编码" width="160" align="center" prop="code" />
+      <el-table-column label="供应商分类" width="140" align="center" prop="type" />
+      <el-table-column label="供应商等级" width="130" align="center" prop="level" />
+      <el-table-column label="溢装比例" width="120" align="center" prop="overfillRate" >
+        <template v-slot="scope">
+          {{ scope.row.overfillRate }} %
+        </template>
+      </el-table-column>
+      <el-table-column label="送货周期" width="120" align="center" prop="cycleDay" >
+        <template v-slot="scope">
+          {{ scope.row.overfillRate }} 天
+        </template>
+      </el-table-column>
+      <el-table-column label="默认开票" width="140" align="left" prop="invoiceType" :formatter="invoiceTypeFormat" />
+      
+      <el-table-column label="默认税率" width="140" align="center" prop="taxRate" >
+        <template v-slot="scope">
+          {{ scope.row.taxRate }} %
+        </template>
+      </el-table-column>
+      <el-table-column label="默认结算方式" width="140" align="center" prop="paymentType" />
+      <el-table-column label="公司全称" width="140" align="center" prop="fullName" />
+      <el-table-column label="助记码" width="180" align="center" prop="mnemonic" />
+      <el-table-column label="合作日期" align="center" prop="cooperationTime" width="180">
+        <template slot-scope="scope">
+          <span>{{ parseTime(scope.row.cooperationTime, '{y}-{m}-{d}') }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="联系人" width="160" align="center" prop="contactName" />
+      <el-table-column label="联系人电话" width="160" align="center" prop="contractTel" />
+      <el-table-column label="联系人手机" width="160" align="center" prop="contactPhone" />
+      <el-table-column width="105" label="所属省市区" align="center" prop="cityIds" />
+      <el-table-column label="详情地址" align="center" prop="address" />
+      <el-table-column label="账户名称" width="160" align="center" prop="bankName" />
+      <el-table-column label="开户银行" width="160" align="center" prop="bankDeposit" />
+      <el-table-column label="银行账户" width="200" align="center" prop="bankAccount" />
+      <el-table-column label="备注" align="center" prop="remark" />
+      <el-table-column label="操作" align="center" width="110" fixed="right" 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="['oms:supplier:edit']"
+          >修改</el-button>
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-delete"
+            @click="handleDelete(scope.row)"
+            v-hasPermi="['oms:supplier: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="1080px" append-to-body>
+      <el-form ref="form" :model="form" :rules="rules" label-width="100px">
+        <el-row>
+          <el-col span="12">
+            <el-form-item label="供应商编码" prop="code">
+              <el-input v-model="form.code" placeholder="请输入" />
+            </el-form-item>
+          </el-col>
+          <el-col span="12">
+            <el-form-item label="供应商名称" prop="name">
+              <el-input v-model="form.name" placeholder="请输入" />
+            </el-form-item>
+          </el-col>
+        </el-row>
+        <el-row>
+          <el-col span="12">
+            <el-form-item label="供应商分类" prop="type">
+              <el-input v-model="form.type" placeholder="请输入" />
+            </el-form-item>
+          </el-col>
+          <el-col span="12">
+            <el-form-item label="供应商等级" prop="level">
+              <el-input v-model="form.level" placeholder="请输入" />
+            </el-form-item>
+          </el-col>
+        </el-row>
+        <el-row>
+          <el-col span="12">
+            <el-form-item label="公司全称" prop="fullName">
+              <el-input v-model="form.fullName" placeholder="请输入" />
+            </el-form-item>
+          </el-col>
+          <el-col span="12">
+            <el-form-item label="助记码" prop="mnemonic">
+              <el-input v-model="form.mnemonic" placeholder="请输入" />
+            </el-form-item>
+          </el-col>
+        </el-row>
+        <el-row>
+          <el-col span="12">
+            <el-form-item label="送货周期" prop="cycleDay">
+              <el-input v-model="form.cycleDay" placeholder="请输入" >
+                <template slot="append">天</template>
+              </el-input>
+            </el-form-item>
+          </el-col>
+          <el-col span="12">
+            <el-form-item label="溢装比例" prop="overfillRate">
+              <el-input v-model="form.overfillRate" placeholder="请输入" >
+                <template slot="append">%</template>
+              </el-input>
+            </el-form-item>
+          </el-col>
+        </el-row>        
+        <el-row>
+          <el-col span="12">
+            <el-form-item label="默认开票" prop="invoiceType">
+              <el-select v-model="form.invoiceType" placeholder="请选择">
+                <el-option
+                v-for="dict in invoiceTypeOptions"
+                :key="dict.dictValue"
+                :label="dict.dictLabel"
+                :value="parseInt(dict.dictValue)"
+              ></el-option>
+              </el-select>
+            </el-form-item>
+          </el-col>
+          <el-col span="12">
+            <el-form-item label="默认税率" prop="taxRate">
+              <el-input v-model="form.taxRate" placeholder="请输入默认税率" >
+                <template slot="append">%</template>
+              </el-input>
+            </el-form-item>
+          </el-col>
+        </el-row>
+        <el-row>
+          <el-col span="12">
+            <el-form-item label="默认结算方式" prop="paymentType">
+              <el-input v-model="form.paymentType" placeholder="请输入默认结算方"/>
+            </el-form-item>
+          </el-col>
+          <el-col span="12">
+            <el-form-item label="合作日期" prop="cooperationTime">
+              <el-date-picker clearable size="small" style="width: 200px"
+              v-model="form.cooperationTime"
+              type="date"
+              value-format="yyyy-MM-dd"
+              placeholder="选择合作日期">
+              </el-date-picker>
+            </el-form-item>
+          </el-col>
+        </el-row>
+        <el-row>
+          <el-col span="8">
+            <el-form-item label="联系人" prop="contactName">
+              <el-input v-model="form.contactName" placeholder="请输入联系人" />
+            </el-form-item>
+          </el-col>
+          <el-col span="8">
+            <el-form-item label="联系人电话" prop="contractTel">
+              <el-input v-model="form.contractTel" placeholder="请输入联系人电话" />
+            </el-form-item>
+          </el-col>
+          <el-col span="8">
+            <el-form-item label="联系人手机" prop="contactPhone">
+              <el-input v-model="form.contactPhone" placeholder="请输入联系人手机" />
+            </el-form-item>
+          </el-col>
+        </el-row> 
+        <el-row>
+          <el-col span="8">
+            <el-form-item  label-width="100px" label="所属省市区" prop="cityIds">
+              <el-cascader
+              ref="citySelect"
+              v-model="cityIds"
+              :options="citys"
+              @change="handleCityChange"></el-cascader>
+            </el-form-item>
+          </el-col>
+          <el-col span="10">
+            <el-form-item label="详情地址" prop="address">
+              <el-input v-model="form.address" placeholder="请输入详情地址" />
+            </el-form-item>
+          </el-col>
+        </el-row>
+        <el-row>
+          <el-col span="12">
+            <el-form-item label="账户名称" prop="bankName">
+              <el-input v-model="form.bankName" placeholder="请输入账户名称" />
+            </el-form-item>
+          </el-col>
+          <el-col span="12">
+            <el-form-item label="开户银行" prop="bankDeposit">
+              <el-input v-model="form.bankDeposit" placeholder="请输入开户银行" />
+            </el-form-item>
+          </el-col>
+        </el-row>    
+        <el-form-item label="银行账户" prop="bankAccount">
+          <el-input v-model="form.bankAccount" placeholder="请输入银行账户" />
+        </el-form-item>
+        <el-row>
+          <el-col :span="24">
+            <el-form-item label="备注" prop="remark">
+              <el-input v-model="form.remark" type="textarea" :rows="2" placeholder="请输入" />
+            </el-form-item>
+          </el-col>
+        </el-row>
+        <el-form-item label="状态 ">
+          <el-radio-group v-model="form.status">
+            <el-radio
+              v-for="dict in statusOptions"
+              :key="dict.dictValue"
+              :label="parseInt(dict.dictValue)"
+            >{{dict.dictLabel}}</el-radio>
+          </el-radio-group>
+        </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 { listSupplier, getSupplier, delSupplier, addSupplier, updateSupplier, exportSupplier } from "@/api/oms/supplier";
+import {getCitys} from "@/api/store/city";
+export default {
+  name: "Supplier",
+  data() {
+    return {
+      // 遮罩层
+      loading: true,
+      // 选中数组
+      ids: [],
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      // 显示搜索条件
+      showSearch: true,
+      // 总条数
+      total: 0,
+      // 供应商管理表格数据
+      supplierList: [],
+      // 弹出层标题
+      title: "",
+      // 是否显示弹出层
+      open: false,
+      // 默认开票 0无 1电子发票 2增值税普通发票 3增值税专用发票字典
+      invoiceTypeOptions: [],
+      // 状态 字典
+      statusOptions: [],
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        code: null,
+        name: null,
+        type: null,
+        level: null,
+        cycleDay: null,
+        invoiceType: null,
+        overfillRate: null,
+        taxRate: null,
+        paymentType: null,
+        fullName: null,
+        mnemonic: null,
+        cooperationTime: null,
+        contactName: null,
+        contractTel: null,
+        contactPhone: null,
+        cityIds: null,
+        address: null,
+        bankName: null,
+        bankDeposit: null,
+        bankAccount: null,
+        status: null,
+        createUserId: null,
+        updateUserId: null,
+      },
+      // 表单参数
+      form: {},
+      // 表单校验
+      rules: {
+      }
+    };
+  },
+  created() {
+    this.getList();
+    this.getDicts("oms_invoice_type").then(response => {
+      this.invoiceTypeOptions = response.data;
+    });
+    this.getDicts("oms_supplier_status").then(response => {
+      this.statusOptions = response.data;
+    });
+    this.getCitys();
+  },
+  methods: {
+    /** 查询供应商管理列表 */
+    getList() {
+      this.loading = true;
+      listSupplier(this.queryParams).then(response => {
+        this.supplierList = response.rows;
+        this.total = response.total;
+        this.loading = false;
+      });
+    },
+    // 默认开票 0无 1电子发票 2增值税普通发票 3增值税专用发票字典翻译
+    invoiceTypeFormat(row, column) {
+      return this.selectDictLabel(this.invoiceTypeOptions, row.invoiceType);
+    },
+    // 状态 字典翻译
+    statusFormat(row, column) {
+      return this.selectDictLabel(this.statusOptions, row.status);
+    },
+    // 取消按钮
+    cancel() {
+      this.open = false;
+      this.reset();
+    },
+    // 表单重置
+    reset() {
+      this.form = {
+        id: null,
+        code: null,
+        name: null,
+        type: null,
+        level: null,
+        cycleDay: null,
+        invoiceType: null,
+        overfillRate: null,
+        taxRate: null,
+        paymentType: null,
+        fullName: null,
+        mnemonic: null,
+        cooperationTime: null,
+        contactName: null,
+        contractTel: null,
+        contactPhone: null,
+        cityIds: null,
+        address: null,
+        bankName: null,
+        bankDeposit: null,
+        bankAccount: null,
+        remark: null,
+        status: null,
+        createUserId: null,
+        updateUserId: null,
+        createTime: null,
+        updateTime: 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
+      getSupplier(id).then(response => {
+        this.form = response.data;
+        this.open = true;
+        this.title = "修改供应商管理";
+      });
+      
+    },
+    handleCityChange(value) {
+          console.log(value);
+          var nodes=this.$refs.citySelect.getCheckedNodes();
+          this.form.cityIds=nodes[0].pathLabels[0]+"-"+nodes[0].pathLabels[1]+"-"+nodes[0].pathLabels[2];
+          this.form.cityIdsStr=value.toString();
+          console.log(this.form.cityIdsStr);
+    },
+    getCitys(){
+          getCitys().then(res => {
+             this.loading = false;
+             this.citys=res.data;
+          });
+    },
+    /** 提交按钮 */
+    submitForm() {
+      this.$refs["form"].validate(valid => {
+        if (valid) {
+          if (this.form.id != null) {
+            updateSupplier(this.form).then(response => {
+              if (response.code === 200) {
+                this.msgSuccess("修改成功");
+                this.open = false;
+                this.getList();
+              }
+            });
+          } else {
+            addSupplier(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 delSupplier(ids);
+        }).then(() => {
+          this.getList();
+          this.msgSuccess("删除成功");
+        }).catch(function() {});
+    },
+    /** 导出按钮操作 */
+    handleExport() {
+      const queryParams = this.queryParams;
+      this.$confirm('是否确认导出所有供应商管理数据项?', "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(function() {
+          return exportSupplier(queryParams);
+        }).then(response => {
+          this.download(response.msg);
+        }).catch(function() {});
+    }
+  }
+};
+</script>

+ 513 - 0
src/views/oms/supplierProduct/index.vue

@@ -0,0 +1,513 @@
+<template>
+  <div class="app-container">
+    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="115px">
+      <el-form-item label="供应商编码" prop="supplierCode">
+        <el-input
+          v-model="queryParams.supplierCode"
+          placeholder="请输入"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="供应商名称" prop="supplierName">
+        <el-input
+          v-model="queryParams.supplierName"
+          placeholder="请输入"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="是否含包装" prop="">
+        <el-select   v-model="queryParams.packagingFlag" placeholder="请选择" clearable size="small" >
+         <el-option
+                v-for="item in packagingFlagOptions"
+                :key="item.dictValue"
+                :label="item.dictLabel"
+                :value="item.dictValue"
+              />
+        </el-select>
+      </el-form-item>
+      <el-form-item label="是否包邮" prop="">
+        <el-select   v-model="queryParams.shippingFlag" placeholder="请选择" clearable size="small" >
+         <el-option
+                v-for="item in shippingFlagOptions"
+                :key="item.dictValue"
+                :label="item.dictLabel"
+                :value="item.dictValue"
+              />
+        </el-select>
+      </el-form-item>
+      <el-form-item label="供应商商品编码" prop="supplierSpucode">
+        <el-input
+          v-model="queryParams.supplierSpucode"
+          placeholder="请输入"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="供应商SKU编码" prop="supplierSkucode">
+        <el-input
+          v-model="queryParams.supplierSkucode"
+          placeholder="请输入"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="商品编码" prop="spuCode">
+        <el-input
+          v-model="queryParams.spuCode"
+          placeholder="请输入"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="SKU编码" prop="skuCode">
+        <el-input
+          v-model="queryParams.skuCode"
+          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="['oms:supplierProduct: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="['oms:supplierProduct: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="['oms:supplierProduct:remove']"
+        >删除</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="warning"
+          icon="el-icon-download"
+          size="mini"
+          @click="handleExport"
+          v-hasPermi="['oms:supplierProduct:export']"
+        >导出</el-button>
+      </el-col>
+	  <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+    </el-row>
+
+    <el-table v-loading="loading" :data="supplierProductList" @selection-change="handleSelectionChange">
+      <el-table-column type="selection" width="55" align="center" />
+      <el-table-column label="序号"  width="55" align="center" prop="id" />
+      <el-table-column label="商品图片" align="center" width="160">
+        <template slot-scope="scope">
+          <el-popover
+            placement="right"
+            title=""
+            trigger="hover"
+          >
+            <img slot="reference" :src="scope.row.image" width="100">
+            <img :src="scope.row.image" style="max-width: 150px;">
+          </el-popover>
+        </template>
+      </el-table-column>
+      <el-table-column label="商品编码" width="160" align="center" prop="spuCode" />
+      <el-table-column label="商品名称" width="160" show-overflow-tooltip align="center" prop="spuName" />
+      <el-table-column label="SKU编码" width="160" align="center" prop="skuCode" />
+      <el-table-column label="SKU名称" width="160" align="center" prop="skuName" />
+      <el-table-column label="供应商编码" width="160" align="center" prop="supplierCode" />
+      <el-table-column label="供应商名称" width="160" align="center" prop="supplierName" />
+      <el-table-column label="含税采购价" width="120" align="center" prop="taxunitPrice" />
+      <el-table-column label="不含税采购价" width="120" align="center" prop="unitPrice" />
+      <el-table-column label="税率" width="100" align="center" prop="taxRate" />
+      <el-table-column label="供应商SKU编码" width="160" align="center" prop="supplierSkucode" />
+      <el-table-column label="供应商商品编码" width="160" align="center" prop="supplierSpucode" />
+      <el-table-column label="是否含包装" width="100" align="center" prop="packagingFlag" >
+          <template slot-scope="scope">
+              <el-tag prop="packagingFlag" v-for="(item, index) in packagingFlagOptions"    v-if="scope.row.packagingFlag==item.dictValue">{{item.dictLabel}}</el-tag>
+          </template>
+      </el-table-column>
+      <el-table-column label="是否包邮" width="100" align="center" prop="shippingFlag" >
+          <template slot-scope="scope">
+              <el-tag prop="shippingFlag" v-for="(item, index) in shippingFlagOptions"    v-if="scope.row.shippingFlag==item.dictValue">{{item.dictLabel}}</el-tag>
+          </template>
+      </el-table-column>
+      <el-table-column label="备注" width="124" align="left" prop="remark" />
+      <el-table-column label="操作" align="center" width="110" fixed="right" 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="['oms:supplierProduct:edit']"
+          >修改</el-button>
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-delete"
+            @click="handleDelete(scope.row)"
+            v-hasPermi="['oms:supplierProduct: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="1030px" append-to-body>
+      <el-form ref="form" :model="form" :rules="rules" label-width="130px" >
+        <el-row >
+          <el-col :span="12">
+            <el-form-item label="供应商" prop="supplierId">
+               <treeselect v-model="form.supplierId" :options="supplierOptions" :normalizer="normalizer" placeholder="请选择" />
+            </el-form-item>
+          </el-col>
+          <el-col :span="12" >
+            <el-form-item label="供应商商品编码" prop="supplierSpucode" >
+              <el-input v-model="form.supplierSpucode" placeholder="请输入" />
+            </el-form-item>
+          </el-col>
+        </el-row>
+        <el-row >
+          <el-col :span="12" >
+            <el-form-item label="供应商SKU编码" prop="supplierSkucode">
+              <el-input v-model="form.supplierSkucode" placeholder="请输入" />
+            </el-form-item>
+          </el-col>
+          <el-col :span="12" >
+            <el-form-item label="含税采购价" prop="taxunitPrice">
+              <el-input v-model="form.taxunitPrice" placeholder="请输入" />
+            </el-form-item>
+          </el-col>
+        </el-row>
+        <el-row >
+          <el-col :span="12">
+            <el-form-item label="不含税采购价" prop="unitPrice">
+              <el-input v-model="form.unitPrice" placeholder="请输入" />
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item label="税率" prop="taxRate">
+              <el-input v-model="form.taxRate" placeholder="请输入" />
+            </el-form-item>
+          </el-col>
+        </el-row>
+        <el-row>
+          <el-col :span="12">
+            <el-form-item label="是否含包装" prop="packagingFlag">
+              <el-radio-group v-model="form.packagingFlag">
+                <el-radio :label="item.dictValue" v-for="item in packagingFlagOptions" >{{item.dictLabel}}</el-radio>
+              </el-radio-group>
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item label="是否包邮" prop="shippingFlag">
+              <el-radio-group v-model="form.shippingFlag">
+                <el-radio :label="item.dictValue" v-for="item in shippingFlagOptions" >{{item.dictLabel}}</el-radio>
+              </el-radio-group>
+            </el-form-item>
+          </el-col>
+        </el-row>
+        <el-row>
+          <el-col :span="24">
+            <el-form-item label="备注" prop="remark">
+              <el-input v-model="form.remark" type="textarea" :rows="2" placeholder="请输入" />
+            </el-form-item>
+          </el-col>
+        </el-row>
+        <el-form-item>
+          <el-button type="primary" size="small" icon="md-add" @click="addBtn" class="mr15">添加商品</el-button>
+        </el-form-item>
+       
+        
+        <el-form-item label="商品图片" prop="image">
+          <Material v-model="imageArr" type="image" :num="1" :width="150" :height="150" />
+        </el-form-item>
+        <el-row>
+          <el-col :span="12">
+            <el-form-item label="商品名称" prop="spuName">
+              <el-input v-model="form.spuName" placeholder="请输入商品名称" />
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item label="商品编码" prop="spuCode">
+              <el-input v-model="form.spuCode" placeholder="请输入商品编码" />
+            </el-form-item>
+          </el-col>
+      </el-row>
+      <el-row>
+          <el-col :span="12">
+            <el-form-item label="SKU编码" prop="skuCode">
+          <el-input v-model="form.skuCode" placeholder="请输入" />
+        </el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item label="SKU名称" prop="spuCode">
+              <el-input v-model="form.spuCode" placeholder="请输入" />
+            </el-form-item>
+          </el-col>
+      </el-row> 
+      </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 { listSupplierProduct, getSupplierProduct, delSupplierProduct, addSupplierProduct, updateSupplierProduct, exportSupplierProduct } from "@/api/oms/supplierProduct";
+import singleImg from '@/components/Material/single'
+import Material from '@/components/Material'
+export default {
+  name: "SupplierProduct",
+  components: {
+    Material,
+    singleImg,
+  },
+  watch: {
+    imageArr: function(val) {
+      this.form.image = val.join(',')
+    }
+  },
+  data() {
+    return {
+      // 遮罩层
+      loading: true,
+      // 选中数组
+      ids: [],
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      // 显示搜索条件
+      showSearch: true,
+      // 总条数
+      total: 0,
+      // 供应商商品表格数据
+      supplierProductList: [],
+      // 弹出层标题
+      title: "",
+      // 是否显示弹出层
+      open: false,
+      // 是否含包装 0否  1是字典
+      packagingFlagOptions: [],
+      // 是否包邮 0否  1是字典
+      shippingFlagOptions: [],
+      //供应商
+      supplierOptions:[],
+      imageArr:[],
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        supplierId: null,
+        supplierCode: null,
+        supplierSkucode: null,
+        supplierSpucode: null,
+        taxunitPrice: null,
+        unitPrice: null,
+        taxRate: null,
+        packagingFlag: null,
+        shippingFlag: null,
+        image: null,
+        spuName: null,
+        spuCode: null,
+        skuId: null,
+        skuCode: null,
+        skuName: null,
+        createUserId: null,
+        updateUserId: null,
+      },
+      // 表单参数
+      form: {},
+      // 表单校验
+      rules: {
+        image: [
+          { required: true, message: "商品图片不能为空", trigger: "blur" }
+        ],
+      }
+    };
+  },
+  created() {
+    this.getList();
+    this.getDicts("oms_packaging_flag").then(response => {
+      this.packagingFlagOptions = response.data;
+    });
+    this.getDicts("oms_shipping_flag").then(response => {
+      this.shippingFlagOptions = response.data;
+    });
+  },
+  methods: {
+    /** 查询供应商商品列表 */
+    getList() {
+      this.loading = true;
+      listSupplierProduct(this.queryParams).then(response => {
+        this.supplierProductList = response.rows;
+        this.total = response.total;
+        this.loading = false;
+      });
+    },
+    // 是否含包装 0否  1是字典翻译
+    packagingFlagFormat(row, column) {
+      return this.selectDictLabel(this.packagingFlagOptions, row.packagingFlag);
+    },
+    // 是否包邮 0否  1是字典翻译
+    shippingFlagFormat(row, column) {
+      return this.selectDictLabel(this.shippingFlagOptions, row.shippingFlag);
+    },
+    // 取消按钮
+    cancel() {
+      this.open = false;
+      this.reset();
+    },
+    // 表单重置
+    reset() {
+      this.form = {
+        id: null,
+        supplierId: null,
+        supplierCode: null,
+        supplierSkucode: null,
+        supplierSpucode: null,
+        taxunitPrice: null,
+        unitPrice: null,
+        taxRate: null,
+        packagingFlag: null,
+        shippingFlag: null,
+        remark: null,
+        image: null,
+        spuName: null,
+        spuCode: null,
+        skuId: null,
+        skuCode: null,
+        skuName: null,
+        createUserId: null,
+        updateUserId: null,
+        createTime: null,
+        updateTime: null
+      };
+      this.resetForm("form");
+      this.imageArr=[];
+    },
+    /** 搜索按钮操作 */
+    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
+      getSupplierProduct(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) {
+            updateSupplierProduct(this.form).then(response => {
+              if (response.code === 200) {
+                this.msgSuccess("修改成功");
+                this.open = false;
+                this.getList();
+              }
+            });
+          } else {
+            addSupplierProduct(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 delSupplierProduct(ids);
+        }).then(() => {
+          this.getList();
+          this.msgSuccess("删除成功");
+        }).catch(function() {});
+    },
+    /** 导出按钮操作 */
+    handleExport() {
+      const queryParams = this.queryParams;
+      this.$confirm('是否确认导出所有供应商商品数据项?', "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(function() {
+          return exportSupplierProduct(queryParams);
+        }).then(response => {
+          this.download(response.msg);
+        }).catch(function() {});
+    }
+  }
+};
+</script>