rk
昨天 585ff1cd29e9875f5f2a0fa2b0fdc876c5c6301f
admin/src/views/business/platformGoods.vue
@@ -2,11 +2,6 @@
  <TableLayout :permissions="['business:goods:query']">
    <!-- 搜索表单 -->
    <el-form ref="searchForm" slot="search-form" :model="searchForm" label-width="100px" inline>
<!--      <el-tabs v-model="activeName" @tab-click="handleClick">
        <el-tab-pane label="全部商品" name="first"></el-tab-pane>
        <el-tab-pane label="已售罄商品" name="second"></el-tab-pane>
        <el-tab-pane label="回收站商品" name="third"></el-tab-pane>
      </el-tabs>-->
      <el-form-item label="商品名称" prop="name">
        <el-input v-model="searchForm.name" placeholder="请输入商品名称" @keypress.enter.native="search"></el-input>
      </el-form-item>
@@ -49,6 +44,8 @@
        <el-select
          v-model="searchForm.status"
          placeholder="请选择上架状态"
          clearable
          @change="search"
        >
          <el-option :key="0" :value="0" label="上架"></el-option>
          <el-option :key="1" :value="1" label="下架"></el-option>
@@ -61,10 +58,11 @@
    </el-form>
    <!-- 表格和分页 -->
    <template v-slot:table-wrap>
      <ul class="toolbar" v-permissions="['business:goods:create', 'business:goods:delete']">
      <ul class="toolbar" >
        <li><el-button type="primary" icon="el-icon-plus" @click="$refs.operaGoodsWindow.open('新建商品', null, 0)" v-permissions="['business:goods:create']">新建</el-button></li>
        <li><el-button type="primary"  icon="el-icon-edit"  @click="issued(0)">上架</el-button></li>
        <li><el-button type="danger"  icon="el-icon-edit"  @click="issued(1)">下架</el-button></li>
        <li><p class="tip-warn" style="width: 100%;margin-left: 20px;"><i class="el-icon-warning"></i>提示:【供货价设置】只统计启用状态的供销商设置数据,(已定价供销商数/全部供销商数)</p></li>
      </ul>
      <el-table
        v-loading="isWorking.search"
@@ -87,7 +85,7 @@
        <el-table-column prop="skuPrice" label="销售价(元)" min-width="100px"></el-table-column>
        <el-table-column prop="shopPrice" label="供货价设置" min-width="100px" align="center">
          <template slot-scope="{row}" >
            <div @click="goPriceSet(row)" style="cursor:pointer;"><span  class="red"> {{row.pricedShopNum||0}}</span> / <span class="green"> {{row.shopNum||0}}</span>  </div>
            <div title="针对启用供销商价格设置统计" @click="goPriceSet(row)" style="cursor:pointer;"><span  class="red"> {{row.pricedShopNum||0}}</span> / <span class="green"> {{row.shopNum||0}}</span>  </div>
          </template>
        </el-table-column>
        <el-table-column prop="stockNum" label="剩余库存量" min-width="100px"></el-table-column>
@@ -107,12 +105,12 @@
        </el-table-column>
        <el-table-column
          label="操作"
          min-width="250"
          min-width="160"
          fixed="right"
        >
          <template slot-scope="{row}">
             <el-button type="text" v-if="row.status == 1" @click="$refs.operaGoodsWindow.open('编辑商品', row, 0)" v-permissions="['business:goods:update']">编辑</el-button>
            <el-button type="text"  @click="goPriceSet(row)">供货价</el-button>
            <el-button type="text" v-permissions="['business:goods:update']" @click="goPriceSet(row)">供货价</el-button>
            <el-button type="text" style="color: red;" @click="deleteById(row)" v-permissions="['business:goods:delete']">删除</el-button>
            <!-- <el-button type="text" @click="$refs.operaGoodsDetailWindow.open('商品详情', row, 0)">查看详情</el-button>-->
          </template>
@@ -145,39 +143,24 @@
export default {
  name: 'Goods',
  extends: BaseTable,
  components: { TableLayout, Pagination, OperaGoodsWindow, OperaGoodsDetailWindow, OperaPlatformGoodsSkuWindow ,OperaShopGoodsWindow},
  components: { TableLayout, Pagination, OperaGoodsWindow, OperaGoodsDetailWindow, OperaPlatformGoodsSkuWindow, OperaShopGoodsWindow },
  data () {
    return {
      activeName: 'first',
      // 搜索
      searchForm: {
        id: '',
        creator: '',
        createDate: '',
        editor: '',
        editDate: '',
        isdeleted: '',
        remark: '',
        imgurl: '',
        name: '',
        info: '',
        categoryId: '',
        brandId: '',
        price: '',
        salenum: '',
        content: '',
        sortnum: '',
        looknum: '',
        // 类型 0平台商城 1咖豆商城 2咖啡计划商品
        type: '0', // 平台商品
        status: '',
        isrec: '',
        styleImg: '',
        labels: ''
      },
      labels: [],
      serials: [],
      brands: []
      brands: [],
      serials: []
    }
  },
  provide () {
@@ -207,15 +190,15 @@
      })
  },
  methods: {
    priceSuccess(){
    priceSuccess () {
      this.handlePageChange()
    },
    goPriceSet(row){
      if(row.skuPrice == null){
    goPriceSet (row) {
      if (row.skuPrice == null) {
        this.$tip.warning('请先设置商品销售价!')
        return
      }
      this.$refs.OperaShopGoodsWindow.open('设置供货价 - '+row.name, row )
      this.$refs.OperaShopGoodsWindow.open('设置供货价 - ' + row.name, row)
    },
    handleClick (val) {
@@ -232,6 +215,11 @@
      const message = `确认${status === 0 ? '上架' : '下架'}选中的商品么?`
      this.$dialog.messageWaring(message)
        .then(() => {
          var temp = []
          this.tableData.selectedRows.forEach(item => {
            temp.push({ id: item.id, name: item.name, status: status })
          })
          this.statusChangeBiz(temp)
        })
    },
    statusChange (row) {