|
@@ -3,16 +3,47 @@
|
|
|
|
|
|
<!-- 搜索工作栏 -->
|
|
<!-- 搜索工作栏 -->
|
|
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
|
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
|
|
|
+ <el-form-item label="商品编号" prop="code">
|
|
|
|
+ <el-input v-model="queryParams.code" placeholder="请输入商品编号" clearable @keyup.enter.native="handleQuery" />
|
|
|
|
+ </el-form-item>
|
|
<el-form-item label="商品名称" prop="name">
|
|
<el-form-item label="商品名称" prop="name">
|
|
<el-input v-model="queryParams.name" placeholder="请输入商品名称" clearable @keyup.enter.native="handleQuery" />
|
|
<el-input v-model="queryParams.name" placeholder="请输入商品名称" clearable @keyup.enter.native="handleQuery" />
|
|
</el-form-item>
|
|
</el-form-item>
|
|
- <el-form-item label="商品类型" prop="category">
|
|
|
|
- <el-input v-model="queryParams.category" placeholder="请输入商品类型" clearable @keyup.enter.native="handleQuery" />
|
|
|
|
- </el-form-item>
|
|
|
|
<el-form-item label="商品状态" prop="state">
|
|
<el-form-item label="商品状态" prop="state">
|
|
- <el-input v-model="queryParams.state" placeholder="请输入商品状态" clearable @keyup.enter.native="handleQuery" />
|
|
|
|
|
|
+ <el-select v-model="queryParams.state" placeholder="请选择商品状态" clearable @keyup.enter.native="handleQuery">
|
|
|
|
+ <el-option v-for="dict in isEnable" :key="parseInt(dict.value)" :label="dict.label"
|
|
|
|
+ :value="parseInt(dict.value)" />
|
|
|
|
+ </el-select>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<el-form-item>
|
|
<el-form-item>
|
|
|
|
+ <el-popover placement="bottom" width="300" trigger="click">
|
|
|
|
+ <el-form-item label="商品编号" prop="code">
|
|
|
|
+ <el-input v-model="queryParams.code" placeholder="请输入商品编号" clearable @keyup.enter.native="handleQuery" />
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item label="商品名称" prop="name">
|
|
|
|
+ <el-input v-model="queryParams.name" placeholder="请输入商品名称" clearable @keyup.enter.native="handleQuery" />
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item label="商品类型" prop="category">
|
|
|
|
+ <el-input v-model="queryParams.category" placeholder="请输入商品类型" clearable
|
|
|
|
+ @keyup.enter.native="handleQuery" />
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item label="商品品牌" prop="brand">
|
|
|
|
+ <el-input v-model="queryParams.brand" placeholder="请输入商品品牌" clearable @keyup.enter.native="handleQuery" />
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item label="关键词" prop="keyword">
|
|
|
|
+ <el-input v-model="queryParams.keyword" placeholder="请输入商品关键词" clearable
|
|
|
|
+ @keyup.enter.native="handleQuery" />
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item label="商品状态" prop="state">
|
|
|
|
+ <el-select v-model="queryParams.state" placeholder="请选择商品状态" clearable @keyup.enter.native="handleQuery">
|
|
|
|
+ <el-option v-for="dict in isEnable" :key="parseInt(dict.value)" :label="dict.label"
|
|
|
|
+ :value="parseInt(dict.value)" />
|
|
|
|
+ </el-select>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
|
|
|
|
+ <el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button>
|
|
|
|
+ <el-button slot="reference" style="margin-right: 10px;">复合查询</el-button>
|
|
|
|
+ </el-popover>
|
|
<el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
|
|
<el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
|
|
<el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button>
|
|
<el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
@@ -34,62 +65,67 @@
|
|
<!-- 列表 -->
|
|
<!-- 列表 -->
|
|
<el-table v-loading="loading" :data="list">
|
|
<el-table v-loading="loading" :data="list">
|
|
<el-table-column label="序号" align="center" prop="id" />
|
|
<el-table-column label="序号" align="center" prop="id" />
|
|
- <el-table-column label="商品编号" align="center" prop="code" />
|
|
|
|
- <el-table-column label="商品名称" align="center" prop="name" />
|
|
|
|
- <el-table-column label="商品类型" align="center" prop="category">
|
|
|
|
- <template v-slot="scope">
|
|
|
|
- <el-tag> {{ getCategoryName(scope.row.category) }}</el-tag>
|
|
|
|
- </template>
|
|
|
|
- </el-table-column>
|
|
|
|
- <el-table-column label="商品单价" align="center" prop="price" />
|
|
|
|
- <el-table-column label="付款方式" align="center" prop="payMethod">
|
|
|
|
|
|
+ <el-table-column label="商品封面" align="center" prop="cover" width="200px">
|
|
<template v-slot="scope">
|
|
<template v-slot="scope">
|
|
- <dict-tag v-for="item in scope.row.payMethod" :type="DICT_TYPE.PAY_METHOD" :value="item" />
|
|
|
|
|
|
+ <img :src="scope.row.cover" width="200px" />
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
- <el-table-column label="价格策略" align="center" prop="priceStrategy">
|
|
|
|
- <template v-slot="scope">
|
|
|
|
- <dict-tag :type="DICT_TYPE.PRICE_STRATEGY" :value="scope.row.priceStrategy" />
|
|
|
|
- </template>
|
|
|
|
- </el-table-column>
|
|
|
|
- <el-table-column label="售后策略" align="center" prop="aftersaleStrategy">
|
|
|
|
|
|
+ <el-table-column label="商品名称" align="center" prop="name" />
|
|
|
|
+ <el-table-column label="商品信息" align="center" width="240px">
|
|
<template v-slot="scope">
|
|
<template v-slot="scope">
|
|
- <dict-tag :type="DICT_TYPE.AFTERSALE_STRATEGY" :value="scope.row.aftersaleStrategy" />
|
|
|
|
|
|
+ <el-descriptions :column="1" :contentstyle="{ width: '40%' }">
|
|
|
|
+ <el-descriptions-item label="商品编号">{{ scope.row.code }}</el-descriptions-item>
|
|
|
|
+ <el-descriptions-item label="商品类型">
|
|
|
|
+ <el-tag> {{ getCategoryName(scope.row.category) }}</el-tag>
|
|
|
|
+ </el-descriptions-item>
|
|
|
|
+ <el-descriptions-item label="商品品牌">{{ scope.row.brand }}</el-descriptions-item>
|
|
|
|
+ <el-descriptions-item label="商品型号">{{ scope.row.model }}</el-descriptions-item>
|
|
|
|
+ <el-descriptions-item label="商品关键词">
|
|
|
|
+ <el-tag v-for="item in scope.row.keyword"> {{ item }}</el-tag>
|
|
|
|
+ </el-descriptions-item>
|
|
|
|
+ <el-descriptions-item label="商品参数">{{ scope.row.productParameter }}</el-descriptions-item>
|
|
|
|
+ </el-descriptions>
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
- <el-table-column label="关键词" align="center" prop="keyword">
|
|
|
|
|
|
+ <el-table-column label="商品策略" align="center" width="250px">
|
|
<template v-slot="scope">
|
|
<template v-slot="scope">
|
|
- <el-tag v-for="item2 in scope.row.keyword"> {{ item2 }}</el-tag>
|
|
|
|
|
|
+ <el-descriptions :column="1" :contentstyle="{ width: '40%' }">
|
|
|
|
+ <el-descriptions-item label="自定义策略">{{ scope.row.customStrategy }}</el-descriptions-item>
|
|
|
|
+ <el-descriptions-item label="价格策略">
|
|
|
|
+ <dict-tag :type="DICT_TYPE.PRICE_STRATEGY" :value="scope.row.priceStrategy" />
|
|
|
|
+ </el-descriptions-item>
|
|
|
|
+ <el-descriptions-item label="售后策略">
|
|
|
|
+ <dict-tag :type="DICT_TYPE.AFTERSALE_STRATEGY" :value="scope.row.aftersaleStrategy" />
|
|
|
|
+ </el-descriptions-item>
|
|
|
|
+ <el-descriptions-item label="付款策略">
|
|
|
|
+ <dict-tag v-for="item in scope.row.payMethod" :type="DICT_TYPE.PAY_METHOD" :value="item" />
|
|
|
|
+ </el-descriptions-item>
|
|
|
|
+ </el-descriptions>
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
- <!-- <el-table-column label="商品详情" align="center" prop="productDetail" /> -->
|
|
|
|
- <el-table-column label="商品图片" align="center" prop="picture" />
|
|
|
|
<el-table-column label="商品状态" align="center" prop="state">
|
|
<el-table-column label="商品状态" align="center" prop="state">
|
|
<template v-slot="scope">
|
|
<template v-slot="scope">
|
|
<el-switch v-model="scope.row.state" :active-value="0" :inactive-value="1"
|
|
<el-switch v-model="scope.row.state" :active-value="0" :inactive-value="1"
|
|
@change="handleStatusChange(scope.row)" />
|
|
@change="handleStatusChange(scope.row)" />
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
-
|
|
|
|
- <!-- <el-table-column label="商品型号" align="center" prop="model" /> -->
|
|
|
|
- <!-- <el-table-column label="商品成本" align="center" prop="cost" /> -->
|
|
|
|
- <!-- <el-table-column label="单位" align="center" prop="unit" /> -->
|
|
|
|
- <!-- <el-table-column label="包装方式" align="center" prop="pack" /> -->
|
|
|
|
- <!-- <el-table-column label="自定义策略" align="center" prop="customStrategy" /> -->
|
|
|
|
- <!-- <el-table-column label="商品参数" align="center" prop="productParameter" /> -->
|
|
|
|
- <!-- <el-table-column label="附件1" align="center" prop="attachmentOne" /> -->
|
|
|
|
- <!-- <el-table-column label="附件2" align="center" prop="attachmentTwo" /> -->
|
|
|
|
- <!-- <el-table-column label="创建时间" align="center" prop="createTime" width="180">
|
|
|
|
|
|
+ <el-table-column label="商品成本价" align="center" prop="cost" />
|
|
|
|
+ <el-table-column label="附件" align="center">
|
|
<template v-slot="scope">
|
|
<template v-slot="scope">
|
|
- <span>{{ parseTime(scope.row.createTime) }}</span>
|
|
|
|
|
|
+ <el-button type="text" @click="handleAttachment(scope.row)">查看附件</el-button>
|
|
</template>
|
|
</template>
|
|
-</el-table-column> -->
|
|
|
|
|
|
+ </el-table-column>
|
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
|
<template v-slot="scope">
|
|
<template v-slot="scope">
|
|
- <el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)"
|
|
|
|
- v-hasPermi="['supplier:goods:update']">修改</el-button>
|
|
|
|
- <el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
|
|
|
|
- v-hasPermi="['supplier:goods:delete']">删除</el-button>
|
|
|
|
|
|
+ <el-button size="mini" type="text" @click="handleDetail(scope.row)">详情</el-button>
|
|
|
|
+ <el-button size="mini" type="text" @click="handleUpdate(scope.row)" v-hasPermi="['supplier:goods:update']"
|
|
|
|
+ v-if="scope.row.state == 1">修改</el-button>
|
|
|
|
+ <el-button size="mini" type="text" @click="handleEnable(scope.row)" v-if="scope.row.state == 1">启用</el-button>
|
|
|
|
+ <el-button size="mini" type="text" @click="handleDisable(scope.row)"
|
|
|
|
+ v-if="scope.row.state == 0">停用</el-button>
|
|
|
|
+ <el-button size="mini" type="text" @click="handleOn(scope.row)" v-if="scope.row.state == 1">上架</el-button>
|
|
|
|
+ <el-button size="mini" type="text" @click="handleDelete(scope.row)" v-hasPermi="['supplier:goods:delete']"
|
|
|
|
+ v-if="scope.row.state == 1">删除</el-button>
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
</el-table>
|
|
</el-table>
|
|
@@ -99,7 +135,7 @@
|
|
|
|
|
|
<!-- 对话框(添加 / 修改) -->
|
|
<!-- 对话框(添加 / 修改) -->
|
|
<el-dialog :title="title" :visible.sync="open" width="800px" v-dialogDrag append-to-body>
|
|
<el-dialog :title="title" :visible.sync="open" width="800px" v-dialogDrag append-to-body>
|
|
- <el-form ref="form" :model="form" :rules="rules" label-width="90px">
|
|
|
|
|
|
+ <el-form ref="form" :model="form" :rules="rules" label-width="93px">
|
|
<el-row>
|
|
<el-row>
|
|
<el-col :span="13">
|
|
<el-col :span="13">
|
|
<el-form-item label="商品编号" prop="code">
|
|
<el-form-item label="商品编号" prop="code">
|
|
@@ -121,20 +157,22 @@
|
|
<el-input v-model="form.model" placeholder="请输入商品型号" />
|
|
<el-input v-model="form.model" placeholder="请输入商品型号" />
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</el-col>
|
|
</el-col>
|
|
|
|
+ <el-col :span="13">
|
|
|
|
+ <el-form-item label="商品封面" prop="cover">
|
|
|
|
+ <imageUpload v-model="form.cover" :limit='1' />
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </el-col>
|
|
<el-col :span="13">
|
|
<el-col :span="13">
|
|
<el-form-item label="商品图片" prop="picture">
|
|
<el-form-item label="商品图片" prop="picture">
|
|
- <!-- <el-input v-model="form.picture" placeholder="请输入商品图片" /> -->
|
|
|
|
<imageUpload v-model="form.picture" />
|
|
<imageUpload v-model="form.picture" />
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</el-col>
|
|
</el-col>
|
|
<el-col :span="12">
|
|
<el-col :span="12">
|
|
<el-form-item label="商品类型" prop="category">
|
|
<el-form-item label="商品类型" prop="category">
|
|
- <!-- <el-input v-model="form.category" placeholder="请输入商品类型" /> -->
|
|
|
|
<el-cascader v-model="form.category" :options="goodsCategory" :show-all-levels="false"
|
|
<el-cascader v-model="form.category" :options="goodsCategory" :show-all-levels="false"
|
|
:props="{ label: 'name', value: 'id', children: 'children', checkStrictly: true }" />
|
|
:props="{ label: 'name', value: 'id', children: 'children', checkStrictly: true }" />
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</el-col>
|
|
</el-col>
|
|
-
|
|
|
|
<el-col :span="12">
|
|
<el-col :span="12">
|
|
<el-form-item label="商品成本" prop="cost">
|
|
<el-form-item label="商品成本" prop="cost">
|
|
<el-input-number v-model="form.cost" :precision="2" :step="100" />
|
|
<el-input-number v-model="form.cost" :precision="2" :step="100" />
|
|
@@ -150,12 +188,11 @@
|
|
<el-input v-model="form.unit" placeholder="请输入单位" />
|
|
<el-input v-model="form.unit" placeholder="请输入单位" />
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</el-col>
|
|
</el-col>
|
|
-
|
|
|
|
<el-col :span="12">
|
|
<el-col :span="12">
|
|
<el-form-item label="包装方式" prop="pack">
|
|
<el-form-item label="包装方式" prop="pack">
|
|
<el-select v-model="form.pack" placeholder="请选择包装方式" clearable>
|
|
<el-select v-model="form.pack" placeholder="请选择包装方式" clearable>
|
|
- <el-option v-for="dict in this.getDictDatas(DICT_TYPE.GOODS_PACK)" :key="dict.value" :label="dict.label"
|
|
|
|
- :value="dict.value" />
|
|
|
|
|
|
+ <el-option v-for="dict in this.getDictDatas(DICT_TYPE.GOODS_PACK)" :key="parseInt(dict.value)" :label="dict.label"
|
|
|
|
+ :value="parseInt(dict.value)" />
|
|
</el-select>
|
|
</el-select>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</el-col>
|
|
</el-col>
|
|
@@ -170,8 +207,8 @@
|
|
<el-col :span="12">
|
|
<el-col :span="12">
|
|
<el-form-item label="价格策略" prop="priceStrategy">
|
|
<el-form-item label="价格策略" prop="priceStrategy">
|
|
<el-select v-model="form.priceStrategy" placeholder="请选择价格策略" clearable>
|
|
<el-select v-model="form.priceStrategy" placeholder="请选择价格策略" clearable>
|
|
- <el-option v-for="dict in this.getDictDatas(DICT_TYPE.PRICE_STRATEGY)" :key="dict.value"
|
|
|
|
- :label="dict.label" :value="dict.value" />
|
|
|
|
|
|
+ <el-option v-for="dict in this.getDictDatas(DICT_TYPE.PRICE_STRATEGY)" :key="parseInt(dict.value)"
|
|
|
|
+ :label="dict.label" :value="parseInt(dict.value)" />
|
|
</el-select>
|
|
</el-select>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</el-col>
|
|
</el-col>
|
|
@@ -188,8 +225,8 @@
|
|
<el-col :span="12">
|
|
<el-col :span="12">
|
|
<el-form-item label="售后策略" prop="aftersaleStrategy">
|
|
<el-form-item label="售后策略" prop="aftersaleStrategy">
|
|
<el-select v-model="form.aftersaleStrategy" placeholder="请选择售后策略" clearable>
|
|
<el-select v-model="form.aftersaleStrategy" placeholder="请选择售后策略" clearable>
|
|
- <el-option v-for="dict in this.getDictDatas(DICT_TYPE.AFTERSALE_STRATEGY)" :key="dict.value"
|
|
|
|
- :label="dict.label" :value="dict.value" />
|
|
|
|
|
|
+ <el-option v-for="dict in this.getDictDatas(DICT_TYPE.AFTERSALE_STRATEGY)" :key="parseInt(dict.value)"
|
|
|
|
+ :label="dict.label" :value="parseInt(dict.value)" />
|
|
</el-select>
|
|
</el-select>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</el-col>
|
|
</el-col>
|
|
@@ -223,28 +260,290 @@
|
|
</el-col>
|
|
</el-col>
|
|
<el-col :span="12">
|
|
<el-col :span="12">
|
|
<el-form-item label="附件1" prop="attachmentOne">
|
|
<el-form-item label="附件1" prop="attachmentOne">
|
|
- <!-- <el-input v-model="form.attachmentOne" placeholder="请输入附件1" /> -->
|
|
|
|
- <file-upload v-model="form.attachmentOne" />
|
|
|
|
|
|
+ <fileUpload v-model="form.attachmentOne" />
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</el-col>
|
|
</el-col>
|
|
<el-col :span="12">
|
|
<el-col :span="12">
|
|
<el-form-item label="附件2" prop="attachmentTwo">
|
|
<el-form-item label="附件2" prop="attachmentTwo">
|
|
- <!-- <el-input v-model="form.attachmentTwo" placeholder="请输入附件2" /> -->
|
|
|
|
- <file-upload v-model="form.attachmentTwo" />
|
|
|
|
|
|
+ <fileUpload v-model="form.attachmentTwo" />
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</el-col>
|
|
</el-col>
|
|
-
|
|
|
|
- <!-- <el-form-item label="商品状态" prop="state">
|
|
|
|
- <el-input v-model="form.state" placeholder="请输入商品状态" />
|
|
|
|
- </el-form-item> -->
|
|
|
|
</el-row>
|
|
</el-row>
|
|
</el-form>
|
|
</el-form>
|
|
|
|
+ <div slot="footer" class="dialog-footer">
|
|
|
|
+ <el-button type="primary" @click="submitForm" :disabled="buttonDisable">确 定</el-button>
|
|
|
|
+ <el-button @click="cancel" :disabled="buttonDisable">取 消</el-button>
|
|
|
|
+ </div>
|
|
|
|
+ </el-dialog>
|
|
|
|
|
|
|
|
+ <!-- 对话框(上架) -->
|
|
|
|
+ <el-dialog title="上架/补货" :visible.sync="openOn" width="800px" v-dialogDrag append-to-body>
|
|
|
|
+ <el-form ref="formOn" :model="formOn" :rules="rulesOn" label-width="93px">
|
|
|
|
+ <el-row>
|
|
|
|
+ <el-col :span="12">
|
|
|
|
+ <el-form-item label="商品编号" prop="code">
|
|
|
|
+ <el-input v-model="formOn.code" disabled />
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </el-col>
|
|
|
|
+ <el-col :span="12">
|
|
|
|
+ <el-form-item label="商品名称" prop="name">
|
|
|
|
+ <el-input v-model="formOn.name" disabled />
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </el-col>
|
|
|
|
+ <el-col :span="24">
|
|
|
|
+ <el-form-item label="上架标题" prop="onTitle">
|
|
|
|
+ <el-input v-model="formOn.onTitle" placeholder="请输入上架标题" />
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </el-col>
|
|
|
|
+ <el-col :span="12">
|
|
|
|
+ <el-form-item label="付款方式" prop="payMethod">
|
|
|
|
+ <el-select v-model="formOn.payMethod" placeholder="请选择付款方式" multiple>
|
|
|
|
+ <el-option v-for="dict in this.getDictDatas(DICT_TYPE.PAY_METHOD)" :key="dict.value" :label="dict.label"
|
|
|
|
+ :value="dict.value" />
|
|
|
|
+ </el-select>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </el-col>
|
|
|
|
+ <el-col :span="12">
|
|
|
|
+ <el-form-item label="售后策略" prop="aftersaleStrategy">
|
|
|
|
+ <el-select v-model="formOn.aftersaleStrategy" placeholder="请选择售后策略" clearable>
|
|
|
|
+ <el-option v-for="dict in this.getDictDatas(DICT_TYPE.AFTERSALE_STRATEGY)" :key="parseInt(dict.value)"
|
|
|
|
+ :label="dict.label" :value="parseInt(dict.value)" />
|
|
|
|
+ </el-select>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </el-col>
|
|
|
|
+ <el-col :span="12">
|
|
|
|
+ <el-form-item label="价格策略" prop="priceStrategy">
|
|
|
|
+ <el-select v-model="formOn.priceStrategy" placeholder="请选择价格策略" clearable>
|
|
|
|
+ <el-option v-for="dict in this.getDictDatas(DICT_TYPE.PRICE_STRATEGY)" :key="parseInt(dict.value)"
|
|
|
|
+ :label="dict.label" :value="parseInt(dict.value)" />
|
|
|
|
+ </el-select>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </el-col>
|
|
|
|
+ <!-- 阶梯价格策略 -->
|
|
|
|
+ <el-col :span="24" v-if="formOn.priceStrategy == 2" style="margin-bottom: 20px;">
|
|
|
|
+ <el-table :data="priceStrategyTableData" style="width: 100%">
|
|
|
|
+ <el-table-column prop="level" align="center" label="阶梯" />
|
|
|
|
+ <el-table-column prop="condition" align="center" label="数量条件" />
|
|
|
|
+ <el-table-column prop="unit" align="center" label="单位" />
|
|
|
|
+ <el-table-column prop="category" align="center" label="策略类型" />
|
|
|
|
+ <el-table-column prop="price" align="center" label="价格/RMB(元)" />
|
|
|
|
+ </el-table>
|
|
|
|
+ </el-col>
|
|
|
|
+ <el-col :span="12">
|
|
|
|
+ <el-form-item label="商品类型" prop="category">
|
|
|
|
+ <el-cascader v-model="formOn.category" :options="goodsCategory" :show-all-levels="false"
|
|
|
|
+ :props="{ label: 'name', value: 'id', children: 'children', checkStrictly: true }" disabled />
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </el-col>
|
|
|
|
+ <el-col :span="12">
|
|
|
|
+ <el-form-item label="是否置顶" prop="sticky">
|
|
|
|
+ <el-select v-model="formOn.sticky" placeholder="请选择是否置顶" clearable>
|
|
|
|
+ <el-option v-for="dict in [{ label: '否', value: 0 }, { label: '是', value: 1 }]" :key="dict.value"
|
|
|
|
+ :label="dict.label" :value="dict.value" />
|
|
|
|
+ </el-select>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </el-col>
|
|
|
|
+ <el-col :span="24">
|
|
|
|
+ <el-form-item label="自定义策略" prop="customStrategy">
|
|
|
|
+ <el-input type="textarea" v-model="formOn.customStrategy" placeholder="请输入自定义策略" />
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </el-col>
|
|
|
|
+ <el-col :span="12">
|
|
|
|
+ <el-form-item label="上架价格" prop="marketPrice">
|
|
|
|
+ <el-input-number v-model="formOn.marketPrice" :precision="2" :step="100" />
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </el-col>
|
|
|
|
+ <el-col :span="12">
|
|
|
|
+ <el-form-item label="单位" prop="unit">
|
|
|
|
+ <el-input v-model="formOn.unit" placeholder="请输入单位" />
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </el-col>
|
|
|
|
+ <el-col :span="12">
|
|
|
|
+ <el-form-item label="上架方式" prop="upMethod">
|
|
|
|
+ <el-select v-model="formOn.upMethod" placeholder="请选择上架方式" clearable>
|
|
|
|
+ <el-option v-for="dict in this.getDictDatas(DICT_TYPE.ON_SOURCE)" :key="dict.value" :label="dict.label"
|
|
|
|
+ :value="dict.value" />
|
|
|
|
+ </el-select>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </el-col>
|
|
|
|
+ <el-col :span="12">
|
|
|
|
+ <el-form-item label="上架数量" prop="upNum">
|
|
|
|
+ <el-input-number :precision="0" :min="0" v-model="formOn.upNum" placeholder="请输入数量" />
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </el-col>
|
|
|
|
+ <el-col :span="12">
|
|
|
|
+ <el-form-item label="立即上架" prop="upNow">
|
|
|
|
+ <el-select v-model="formOn.upNow" placeholder="请选择是否立即上架" clearable>
|
|
|
|
+ <el-option v-for="dict in [{ label: '否', value: 0 }, { label: '是', value: 1 }]" :key="dict.value"
|
|
|
|
+ :label="dict.label" :value="dict.value" />
|
|
|
|
+ </el-select>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </el-col>
|
|
|
|
+ <el-col :span="12">
|
|
|
|
+ <el-form-item label="上架时间" prop="upTime" v-if="formOn.upNow == 0">
|
|
|
|
+ <el-date-picker v-model="formOn.upTime" type="datetime" placeholder="选择上架时间">
|
|
|
|
+ </el-date-picker>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </el-col>
|
|
|
|
+ <el-col :span="24">
|
|
|
|
+ <el-form-item label="商品详情" prop="productDetail">
|
|
|
|
+ <editor v-model="formOn.productDetail" :min-height="192" />
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </el-col>
|
|
|
|
+ <el-col :span="24">
|
|
|
|
+ <el-form-item label="商品封面" prop="cover">
|
|
|
|
+ <imageUpload v-model="formOn.cover" :limit='1' />
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </el-col>
|
|
|
|
+ </el-row>
|
|
|
|
+ </el-form>
|
|
<div slot="footer" class="dialog-footer">
|
|
<div slot="footer" class="dialog-footer">
|
|
- <el-button type="primary" @click="submitForm">确 定</el-button>
|
|
|
|
- <el-button @click="cancel">取 消</el-button>
|
|
|
|
|
|
+ <el-button type="primary" @click="submitFormOn" :disabled="buttonDisable">确 定</el-button>
|
|
|
|
+ <el-button @click="cancelFormOn" :disabled="buttonDisable">取 消</el-button>
|
|
</div>
|
|
</div>
|
|
</el-dialog>
|
|
</el-dialog>
|
|
|
|
+ <!-- 对话框(附件) -->
|
|
|
|
+ <el-dialog title="附件" :visible.sync="openAttachment" width="600px" v-dialogDrag append-to-body>
|
|
|
|
+ <a v-for="(item, index) in attachmentDetail" :href="item" target="downloadFile" download>
|
|
|
|
+ {{ item }}<br>
|
|
|
|
+ </a>
|
|
|
|
+ </el-dialog>
|
|
|
|
+ <!-- 对话框(详情) -->
|
|
|
|
+ <el-dialog title="详情" :visible.sync="openDetail" width="800px" v-dialogDrag append-to-body>
|
|
|
|
+ <el-form ref="formDetail" :model="formDetail" label-width="93px">
|
|
|
|
+ <el-row>
|
|
|
|
+ <el-col :span="13">
|
|
|
|
+ <el-form-item label="商品编号" prop="code">
|
|
|
|
+ <el-input v-model="formDetail.code" disabled />
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </el-col>
|
|
|
|
+ <el-col :span="13">
|
|
|
|
+ <el-form-item label="商品名称" prop="name">
|
|
|
|
+ <el-input v-model="formDetail.name" disabled />
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </el-col>
|
|
|
|
+ <el-col :span="13">
|
|
|
|
+ <el-form-item label="商品品牌" prop="brand">
|
|
|
|
+ <el-input v-model="formDetail.brand" disabled />
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </el-col>
|
|
|
|
+ <el-col :span="13">
|
|
|
|
+ <el-form-item label="商品型号" prop="model">
|
|
|
|
+ <el-input v-model="formDetail.model" disabled />
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </el-col>
|
|
|
|
+ <el-col :span="13">
|
|
|
|
+ <el-form-item label="商品封面" prop="cover">
|
|
|
|
+ <img :src="formDetail.cover" class="avatar" width="200" />
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </el-col>
|
|
|
|
+ <el-col :span="13">
|
|
|
|
+ <el-form-item label="商品图片" prop="picture">
|
|
|
|
+ <img v-for="item in formDetail.picture" :src="item" class="avatar" width="200" />
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </el-col>
|
|
|
|
+ <el-col :span="12">
|
|
|
|
+ <el-form-item label="商品类型" prop="category">
|
|
|
|
+ <!-- <el-input v-model="form.category" placeholder="请输入商品类型" /> -->
|
|
|
|
+ <el-cascader v-model="formDetail.category" :options="goodsCategory" :show-all-levels="false"
|
|
|
|
+ :props="{ label: 'name', value: 'id', children: 'children', checkStrictly: true }" disabled />
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </el-col>
|
|
|
|
+ <el-col :span="12">
|
|
|
|
+ <el-form-item label="商品成本" prop="cost">
|
|
|
|
+ <el-input-number v-model="formDetail.cost" :precision="2" :step="100" disabled />
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </el-col>
|
|
|
|
+ <el-col :span="12">
|
|
|
|
+ <el-form-item label="商品单价" prop="price">
|
|
|
|
+ <el-input-number v-model="formDetail.price" :precision="2" :step="100" disabled />
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </el-col>
|
|
|
|
+ <el-col :span="10">
|
|
|
|
+ <el-form-item label="单位" prop="unit">
|
|
|
|
+ <el-input v-model="formDetail.unit" disabled />
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </el-col>
|
|
|
|
+ <el-col :span="12">
|
|
|
|
+ <el-form-item label="包装方式" prop="pack">
|
|
|
|
+ <el-select v-model="formDetail.pack" disabled clearable>
|
|
|
|
+ <el-option v-for="dict in this.getDictDatas(DICT_TYPE.GOODS_PACK)" :key="dict.value" :label="dict.label"
|
|
|
|
+ :value="dict.value" />
|
|
|
|
+ </el-select>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </el-col>
|
|
|
|
+ <el-col :span="12">
|
|
|
|
+ <el-form-item label="付款方式" prop="payMethod">
|
|
|
|
+ <el-select v-model="formDetail.payMethod" disabled multiple>
|
|
|
|
+ <el-option v-for="dict in this.getDictDatas(DICT_TYPE.PAY_METHOD)" :key="dict.value" :label="dict.label"
|
|
|
|
+ :value="dict.value" />
|
|
|
|
+ </el-select>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </el-col>
|
|
|
|
+ <el-col :span="12">
|
|
|
|
+ <el-form-item label="价格策略" prop="priceStrategy">
|
|
|
|
+ <el-select v-model="formDetail.priceStrategy" disabled clearable>
|
|
|
|
+ <el-option v-for="dict in this.getDictDatas(DICT_TYPE.PRICE_STRATEGY)" :key="dict.value"
|
|
|
|
+ :label="dict.label" :value="dict.value" />
|
|
|
|
+ </el-select>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </el-col>
|
|
|
|
+ <!-- 阶梯价格策略 -->
|
|
|
|
+ <el-col :span="24" v-if="formDetail.priceStrategy == 2" style="margin-bottom: 20px;">
|
|
|
|
+ <el-table :data="priceStrategyTableData" style="width: 100%">
|
|
|
|
+ <el-table-column prop="level" align="center" label="阶梯" />
|
|
|
|
+ <el-table-column prop="condition" align="center" label="数量条件" />
|
|
|
|
+ <el-table-column prop="unit" align="center" label="单位" />
|
|
|
|
+ <el-table-column prop="category" align="center" label="策略类型" />
|
|
|
|
+ <el-table-column prop="price" align="center" label="价格/RMB(元)" />
|
|
|
|
+ </el-table>
|
|
|
|
+ </el-col>
|
|
|
|
+ <el-col :span="12">
|
|
|
|
+ <el-form-item label="售后策略" prop="aftersaleStrategy">
|
|
|
|
+ <el-select v-model="formDetail.aftersaleStrategy" disabled clearable>
|
|
|
|
+ <el-option v-for="dict in this.getDictDatas(DICT_TYPE.AFTERSALE_STRATEGY)" :key="dict.value"
|
|
|
|
+ :label="dict.label" :value="dict.value" />
|
|
|
|
+ </el-select>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </el-col>
|
|
|
|
+ <el-col :span="24">
|
|
|
|
+ <el-form-item label="自定义策略" prop="customStrategy">
|
|
|
|
+ <el-input type="textarea" v-model="formDetail.customStrategy" disabled />
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </el-col>
|
|
|
|
+ <el-col :span="24">
|
|
|
|
+ <el-form-item label="关键词" prop="keyword">
|
|
|
|
+ <!-- <el-input v-model="form.keyword" placeholder="请输入关键词" /> -->
|
|
|
|
+ <el-tag v-for="tag in formDetail.keyword">{{ tag }}</el-tag>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </el-col>
|
|
|
|
+ <el-col :span="24">
|
|
|
|
+ <el-form-item label="商品参数" prop="productParameter">
|
|
|
|
+ <el-input type="textarea" v-model="formDetail.productParameter" disabled />
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </el-col>
|
|
|
|
+ <el-col :span="24">
|
|
|
|
+ <el-form-item label="商品详情" prop="productDetail">
|
|
|
|
+ <editor v-model="formDetail.productDetail" :min-height="192" :readOnly="true" />
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </el-col>
|
|
|
|
+ <el-col :span="12">
|
|
|
|
+ <el-form-item label="附件1" prop="attachmentOne">
|
|
|
|
+ <a v-for="(item, index) in formDetail.attachmentOne" :href="item" target="downloadFile" download>
|
|
|
|
+ {{ item }}<br>
|
|
|
|
+ </a>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </el-col>
|
|
|
|
+ <el-col :span="12">
|
|
|
|
+ <el-form-item label="附件2" prop="attachmentTwo">
|
|
|
|
+ <a v-for="(item, index) in formDetail.attachmentTwo" :href="item" target="downloadFile" download>
|
|
|
|
+ {{ item }}<br>
|
|
|
|
+ </a>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </el-col>
|
|
|
|
+ </el-row>
|
|
|
|
+ </el-form>
|
|
|
|
+ </el-dialog>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
@@ -258,6 +557,7 @@ import {
|
|
exportGoodsExcel,
|
|
exportGoodsExcel,
|
|
changeGoodsStatus,
|
|
changeGoodsStatus,
|
|
} from "@/api/supplier/goods";
|
|
} from "@/api/supplier/goods";
|
|
|
|
+import { createGoodsDetail, } from "@/api/supplier/goodsDetail";
|
|
import { getGoodsCategoryListAll, } from "@/api/supplier/goodsCategory";
|
|
import { getGoodsCategoryListAll, } from "@/api/supplier/goodsCategory";
|
|
import { CommonStatusEnum } from "@/utils/constants";
|
|
import { CommonStatusEnum } from "@/utils/constants";
|
|
import Editor from '@/components/Editor';
|
|
import Editor from '@/components/Editor';
|
|
@@ -273,12 +573,18 @@ export default {
|
|
},
|
|
},
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
|
|
+ buttonDisable: false,
|
|
|
|
+ attachmentDetail: [],
|
|
goodsCategory: [],
|
|
goodsCategory: [],
|
|
categoryList: [],
|
|
categoryList: [],
|
|
dynamicTags: [],
|
|
dynamicTags: [],
|
|
inputVisible: false,
|
|
inputVisible: false,
|
|
inputValue: '',
|
|
inputValue: '',
|
|
SysCommonStatusEnum: CommonStatusEnum,
|
|
SysCommonStatusEnum: CommonStatusEnum,
|
|
|
|
+ isEnable: [
|
|
|
|
+ { label: "启用", value: '0' },
|
|
|
|
+ { label: "禁用", value: '1' },
|
|
|
|
+ ],
|
|
// 遮罩层
|
|
// 遮罩层
|
|
loading: true,
|
|
loading: true,
|
|
// 导出遮罩层
|
|
// 导出遮罩层
|
|
@@ -293,6 +599,9 @@ export default {
|
|
title: "",
|
|
title: "",
|
|
// 是否显示弹出层
|
|
// 是否显示弹出层
|
|
open: false,
|
|
open: false,
|
|
|
|
+ openOn: false,
|
|
|
|
+ openAttachment: false,
|
|
|
|
+ openDetail: false,
|
|
// 查询参数
|
|
// 查询参数
|
|
queryParams: {
|
|
queryParams: {
|
|
pageNo: 1,
|
|
pageNo: 1,
|
|
@@ -319,8 +628,47 @@ export default {
|
|
},
|
|
},
|
|
// 表单参数
|
|
// 表单参数
|
|
form: {},
|
|
form: {},
|
|
|
|
+ formOn: {},
|
|
|
|
+ formDetail: {},
|
|
// 表单校验
|
|
// 表单校验
|
|
rules: {
|
|
rules: {
|
|
|
|
+ code: [{ required: true, message: "商品编号不能为空", trigger: "blur" }],
|
|
|
|
+ name: [{ required: true, message: "商品名称不能为空", trigger: "blur" }],
|
|
|
|
+ brand: [{ required: true, message: "商品品牌不能为空", trigger: "blur" }],
|
|
|
|
+ model: [{ required: true, message: "商品型号不能为空", trigger: "blur" }],
|
|
|
|
+ cover: [{ required: true, message: "商品封面不能为空", trigger: "blur" }],
|
|
|
|
+ category: [{ required: true, message: "商品类型不能为空", trigger: "blur" }],
|
|
|
|
+ cost: [{ required: true, message: "商品成本不能为空", trigger: "blur" }],
|
|
|
|
+ price: [{ required: true, message: "商品单价不能为空", trigger: "blur" }],
|
|
|
|
+ unit: [{ required: true, message: "单位不能为空", trigger: "blur" }],
|
|
|
|
+ pack: [{ required: true, message: "包装方式不能为空", trigger: "blur" }],
|
|
|
|
+ payMethod: [{ required: true, message: "付款方式不能为空", trigger: "blur" }],
|
|
|
|
+ priceStrategy: [{ required: true, message: "价格策略不能为空", trigger: "blur" }],
|
|
|
|
+ aftersaleStrategy: [{ required: true, message: "售后策略不能为空", trigger: "blur" }],
|
|
|
|
+ customStrategy: [{ required: true, message: "自定义策略不能为空", trigger: "blur" }],
|
|
|
|
+ keyword: [{ required: true, message: "关键词不能为空", trigger: "blur" }],
|
|
|
|
+ productParameter: [{ required: true, message: "商品参数不能为空", trigger: "blur" }],
|
|
|
|
+ productDetail: [{ required: true, message: "商品详情不能为空", trigger: "blur" }],
|
|
|
|
+ },
|
|
|
|
+ rulesOn: {
|
|
|
|
+ code: [{ required: true, message: "商品编号不能为空", trigger: "blur" }],
|
|
|
|
+ name: [{ required: true, message: "商品名称不能为空", trigger: "blur" }],
|
|
|
|
+ onTitle: [{ required: true, message: "商品品牌不能为空", trigger: "blur" }],
|
|
|
|
+ model: [{ required: true, message: "上架标题不能为空", trigger: "blur" }],
|
|
|
|
+ payMethod: [{ required: true, message: "付款方式不能为空", trigger: "blur" }],
|
|
|
|
+ aftersaleStrategy: [{ required: true, message: "售后策略不能为空", trigger: "blur" }],
|
|
|
|
+ priceStrategy: [{ required: true, message: "价格策略不能为空", trigger: "blur" }],
|
|
|
|
+ category: [{ required: true, message: "商品类型不能为空", trigger: "blur" }],
|
|
|
|
+ sticky: [{ required: true, message: "是否置顶不能为空", trigger: "blur" }],
|
|
|
|
+ customStrategy: [{ required: true, message: "自定义策略不能为空", trigger: "blur" }],
|
|
|
|
+ marketPrice: [{ required: true, message: "上架价格不能为空", trigger: "blur" }],
|
|
|
|
+ unit: [{ required: true, message: "单位不能为空", trigger: "blur" }],
|
|
|
|
+ upMethod: [{ required: true, message: "上架方式不能为空", trigger: "blur" }],
|
|
|
|
+ upNum: [{ required: true, message: "上架数量不能为空", trigger: "blur" }],
|
|
|
|
+ upNow: [{ required: true, message: "立即上架不能为空", trigger: "blur" }],
|
|
|
|
+ upTime: [{ required: true, message: "上架时间不能为空", trigger: "blur" }],
|
|
|
|
+ productDetail: [{ required: true, message: "商品详情不能为空", trigger: "blur" }],
|
|
|
|
+ cover: [{ required: true, message: "商品封面不能为空", trigger: "blur" }],
|
|
},
|
|
},
|
|
priceStrategyTableData: [
|
|
priceStrategyTableData: [
|
|
{ level: '1', condition: '0 ≤ 数量 ≤ 1', unit: '个', category: '固定价格', price: '¥100' },
|
|
{ level: '1', condition: '0 ≤ 数量 ≤ 1', unit: '个', category: '固定价格', price: '¥100' },
|
|
@@ -336,6 +684,111 @@ export default {
|
|
});
|
|
});
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
|
|
+ /** 上架 */
|
|
|
|
+ handleOn(row) {
|
|
|
|
+ this.resetFormOn();
|
|
|
|
+ this.buttonDisable = false;
|
|
|
|
+ const id = row.id;
|
|
|
|
+ getGoods(id).then(response => {
|
|
|
|
+ let temp = response.data;
|
|
|
|
+ this.formOn = response.data;
|
|
|
|
+ this.formOn.goodsId = id;
|
|
|
|
+ this.formOn.num = response.data.upNum;
|
|
|
|
+ if (temp.payMethod) {
|
|
|
|
+ this.formOn.payMethod = temp.payMethod.split(",");
|
|
|
|
+ }
|
|
|
|
+ if (temp.keyword) {
|
|
|
|
+ this.formOn.keyword = temp.keyword.split(",");
|
|
|
|
+ }
|
|
|
|
+ this.openOn = true;
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ /**上架提交 */
|
|
|
|
+ submitFormOn() {
|
|
|
|
+ this.buttonDisable = true;
|
|
|
|
+ this.$refs["formOn"].validate(valid => {
|
|
|
|
+ if (!valid) {
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ if (this.formOn.category != null && this.formOn.category != "" && this.formOn.category instanceof Array) {
|
|
|
|
+ this.formOn.category = this.formOn.category[this.formOn.category.length - 1];
|
|
|
|
+ }
|
|
|
|
+ if (this.formOn.payMethod != null) {
|
|
|
|
+ let temp = "";
|
|
|
|
+ for (let i = 0; i < this.formOn.payMethod.length; i++) {
|
|
|
|
+ if (!temp) {
|
|
|
|
+ temp = this.formOn.payMethod[i];
|
|
|
|
+ } else {
|
|
|
|
+ temp = temp + "," + this.formOn.payMethod[i];
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ this.formOn.payMethod = temp;
|
|
|
|
+ }
|
|
|
|
+ if (this.formOn.keyword != null) {
|
|
|
|
+ let temp = "";
|
|
|
|
+ for (let i = 0; i < this.formOn.keyword.length; i++) {
|
|
|
|
+ if (!temp) {
|
|
|
|
+ temp = this.formOn.keyword[i];
|
|
|
|
+ } else {
|
|
|
|
+ temp = temp + "," + this.formOn.keyword[i];
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ this.formOn.keyword = temp;
|
|
|
|
+ }
|
|
|
|
+ createGoodsDetail(this.formOn).then(response => {
|
|
|
|
+ this.$modal.msgSuccess("上架成功");
|
|
|
|
+ this.openOn = false;
|
|
|
|
+ this.buttonDisable = false;
|
|
|
|
+ this.getList();
|
|
|
|
+ });
|
|
|
|
+ })
|
|
|
|
+
|
|
|
|
+ },
|
|
|
|
+ /** 取消上架 */
|
|
|
|
+ cancelFormOn() {
|
|
|
|
+ this.buttonDisable = true;
|
|
|
|
+ this.openOn = false;
|
|
|
|
+ this.resetFormOn();
|
|
|
|
+ this.buttonDisable = false;
|
|
|
|
+ },
|
|
|
|
+ /** 详情 */
|
|
|
|
+ handleDetail(row) {
|
|
|
|
+ this.resetDetail();
|
|
|
|
+ const id = row.id;
|
|
|
|
+ getGoods(id).then(response => {
|
|
|
|
+ this.formDetail = response.data;
|
|
|
|
+ if (this.formDetail.keyword) {
|
|
|
|
+ this.formDetail.keyword = this.formDetail.keyword.split(",");
|
|
|
|
+ }
|
|
|
|
+ if (this.formDetail.payMethod) {
|
|
|
|
+ this.formDetail.payMethod = this.formDetail.payMethod.split(",");
|
|
|
|
+ }
|
|
|
|
+ this.formDetail.priceStrategy = this.formDetail.priceStrategy + "";
|
|
|
|
+ this.formDetail.aftersaleStrategy = this.formDetail.aftersaleStrategy + "";
|
|
|
|
+ this.formDetail.pack = this.formDetail.pack + "";
|
|
|
|
+ if (this.formDetail.picture) {
|
|
|
|
+ this.formDetail.picture = this.formDetail.picture.split(",");
|
|
|
|
+ }
|
|
|
|
+ if (this.formDetail.attachmentOne) {
|
|
|
|
+ this.formDetail.attachmentOne = this.formDetail.attachmentOne.split(",");
|
|
|
|
+ }
|
|
|
|
+ if (this.formDetail.attachmentTwo) {
|
|
|
|
+ this.formDetail.attachmentTwo = this.formDetail.attachmentTwo.split(",");
|
|
|
|
+ }
|
|
|
|
+ this.openDetail = true;
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ /** 查看附件 */
|
|
|
|
+ handleAttachment(row) {
|
|
|
|
+ this.attachmentDetail = [];
|
|
|
|
+ if (row.attachmentOne) {
|
|
|
|
+ this.attachmentDetail.push(...row.attachmentOne.split(","))
|
|
|
|
+ }
|
|
|
|
+ if (row.attachmentTwo) {
|
|
|
|
+ this.attachmentDetail.push(...row.attachmentTwo.split(","))
|
|
|
|
+ }
|
|
|
|
+ this.openAttachment = true;
|
|
|
|
+ },
|
|
//获得商品类型名称
|
|
//获得商品类型名称
|
|
getCategoryName(category) {
|
|
getCategoryName(category) {
|
|
for (const item of this.categoryList) {
|
|
for (const item of this.categoryList) {
|
|
@@ -361,11 +814,29 @@ export default {
|
|
.catch(function () {
|
|
.catch(function () {
|
|
// 异常时,需要将 row.status 状态重置回之前的
|
|
// 异常时,需要将 row.status 状态重置回之前的
|
|
row.state =
|
|
row.state =
|
|
- row.status === CommonStatusEnum.ENABLE
|
|
|
|
|
|
+ row.state === CommonStatusEnum.ENABLE
|
|
? CommonStatusEnum.DISABLE
|
|
? CommonStatusEnum.DISABLE
|
|
: CommonStatusEnum.ENABLE;
|
|
: CommonStatusEnum.ENABLE;
|
|
});
|
|
});
|
|
},
|
|
},
|
|
|
|
+ //启用
|
|
|
|
+ handleEnable(row) {
|
|
|
|
+ this.$modal.confirm('是否确认启用名为"' + row.name + '"的商品吗?').then(function () {
|
|
|
|
+ return changeGoodsStatus(row.id, 0);
|
|
|
|
+ }).then(() => {
|
|
|
|
+ this.getList();
|
|
|
|
+ this.$modal.msgSuccess("启用成功");
|
|
|
|
+ }).catch(() => { });
|
|
|
|
+ },
|
|
|
|
+ //停用
|
|
|
|
+ handleDisable(row) {
|
|
|
|
+ this.$modal.confirm('是否确认停用名为"' + row.name + '"的商品吗?').then(function () {
|
|
|
|
+ return changeGoodsStatus(row.id, 1);
|
|
|
|
+ }).then(() => {
|
|
|
|
+ this.getList();
|
|
|
|
+ this.$modal.msgSuccess("停用成功");
|
|
|
|
+ }).catch(() => { });
|
|
|
|
+ },
|
|
// 关键词标签
|
|
// 关键词标签
|
|
handleClose(tag) {
|
|
handleClose(tag) {
|
|
this.form.keyword.splice(this.form.keyword.indexOf(tag), 1);
|
|
this.form.keyword.splice(this.form.keyword.indexOf(tag), 1);
|
|
@@ -430,6 +901,61 @@ export default {
|
|
};
|
|
};
|
|
this.resetForm("form");
|
|
this.resetForm("form");
|
|
},
|
|
},
|
|
|
|
+ resetDetail() {
|
|
|
|
+ this.formDetail = {
|
|
|
|
+ id: undefined,
|
|
|
|
+ code: undefined,
|
|
|
|
+ name: undefined,
|
|
|
|
+ model: undefined,
|
|
|
|
+ picture: undefined,
|
|
|
|
+ category: undefined,
|
|
|
|
+ cost: undefined,
|
|
|
|
+ unit: undefined,
|
|
|
|
+ price: undefined,
|
|
|
|
+ state: undefined,
|
|
|
|
+ pack: undefined,
|
|
|
|
+ payMethod: undefined,
|
|
|
|
+ priceStrategy: undefined,
|
|
|
|
+ aftersaleStrategy: undefined,
|
|
|
|
+ customStrategy: undefined,
|
|
|
|
+ keyword: [],
|
|
|
|
+ productParameter: undefined,
|
|
|
|
+ productDetail: undefined,
|
|
|
|
+ attachmentOne: undefined,
|
|
|
|
+ attachmentTwo: undefined,
|
|
|
|
+ };
|
|
|
|
+ this.resetForm("formDetail");
|
|
|
|
+ },
|
|
|
|
+ resetFormOn() {
|
|
|
|
+ this.formOn = {
|
|
|
|
+ id: undefined,
|
|
|
|
+ goodsId: undefined,
|
|
|
|
+ code: undefined,
|
|
|
|
+ name: undefined,
|
|
|
|
+ keyword: undefined,
|
|
|
|
+ unit: undefined,
|
|
|
|
+ marketPrice: undefined,
|
|
|
|
+ platPrice: undefined,
|
|
|
|
+ brand: undefined,
|
|
|
|
+ num: undefined,
|
|
|
|
+ state: undefined,
|
|
|
|
+ category: undefined,
|
|
|
|
+ saleNum: undefined,
|
|
|
|
+ payMethod: undefined,
|
|
|
|
+ aftersaleStrategy: undefined,
|
|
|
|
+ priceStrategy: undefined,
|
|
|
|
+ upMethod: undefined,
|
|
|
|
+ upNum: undefined,
|
|
|
|
+ upTime: undefined,
|
|
|
|
+ sticky: undefined,
|
|
|
|
+ productDetail: undefined,
|
|
|
|
+ cover: undefined,
|
|
|
|
+ onTitle: undefined,
|
|
|
|
+ upNow: undefined,
|
|
|
|
+ customStrategy: undefined,
|
|
|
|
+ };
|
|
|
|
+ this.resetForm("formOn");
|
|
|
|
+ },
|
|
/** 搜索按钮操作 */
|
|
/** 搜索按钮操作 */
|
|
handleQuery() {
|
|
handleQuery() {
|
|
this.queryParams.pageNo = 1;
|
|
this.queryParams.pageNo = 1;
|
|
@@ -443,12 +969,14 @@ export default {
|
|
/** 新增按钮操作 */
|
|
/** 新增按钮操作 */
|
|
handleAdd() {
|
|
handleAdd() {
|
|
this.reset();
|
|
this.reset();
|
|
|
|
+ this.buttonDisable = false;
|
|
this.open = true;
|
|
this.open = true;
|
|
this.title = "添加商品列表";
|
|
this.title = "添加商品列表";
|
|
},
|
|
},
|
|
/** 修改按钮操作 */
|
|
/** 修改按钮操作 */
|
|
handleUpdate(row) {
|
|
handleUpdate(row) {
|
|
this.reset();
|
|
this.reset();
|
|
|
|
+ this.buttonDisable = false;
|
|
const id = row.id;
|
|
const id = row.id;
|
|
getGoods(id).then(response => {
|
|
getGoods(id).then(response => {
|
|
this.form = response.data;
|
|
this.form = response.data;
|
|
@@ -458,9 +986,6 @@ export default {
|
|
if (this.form.payMethod) {
|
|
if (this.form.payMethod) {
|
|
this.form.payMethod = this.form.payMethod.split(",");
|
|
this.form.payMethod = this.form.payMethod.split(",");
|
|
}
|
|
}
|
|
- this.form.priceStrategy = this.form.priceStrategy + "";
|
|
|
|
- this.form.aftersaleStrategy = this.form.aftersaleStrategy + "";
|
|
|
|
- this.form.pack = this.form.pack + "";
|
|
|
|
this.open = true;
|
|
this.open = true;
|
|
this.title = "修改商品列表";
|
|
this.title = "修改商品列表";
|
|
});
|
|
});
|
|
@@ -468,6 +993,10 @@ export default {
|
|
/** 提交按钮 */
|
|
/** 提交按钮 */
|
|
submitForm() {
|
|
submitForm() {
|
|
this.$refs["form"].validate(valid => {
|
|
this.$refs["form"].validate(valid => {
|
|
|
|
+ if (!valid) {
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ this.buttonDisable = true;
|
|
if (this.form.category != null && this.form.category != "" && this.form.category instanceof Array) {
|
|
if (this.form.category != null && this.form.category != "" && this.form.category instanceof Array) {
|
|
this.form.category = this.form.category[this.form.category.length - 1];
|
|
this.form.category = this.form.category[this.form.category.length - 1];
|
|
}
|
|
}
|
|
@@ -493,14 +1022,12 @@ export default {
|
|
}
|
|
}
|
|
this.form.keyword = temp;
|
|
this.form.keyword = temp;
|
|
}
|
|
}
|
|
- if (!valid) {
|
|
|
|
- return;
|
|
|
|
- }
|
|
|
|
// 修改的提交
|
|
// 修改的提交
|
|
if (this.form.id != null) {
|
|
if (this.form.id != null) {
|
|
updateGoods(this.form).then(response => {
|
|
updateGoods(this.form).then(response => {
|
|
this.$modal.msgSuccess("修改成功");
|
|
this.$modal.msgSuccess("修改成功");
|
|
this.open = false;
|
|
this.open = false;
|
|
|
|
+ this.buttonDisable = false;
|
|
this.getList();
|
|
this.getList();
|
|
});
|
|
});
|
|
return;
|
|
return;
|
|
@@ -509,6 +1036,7 @@ export default {
|
|
createGoods(this.form).then(response => {
|
|
createGoods(this.form).then(response => {
|
|
this.$modal.msgSuccess("新增成功");
|
|
this.$modal.msgSuccess("新增成功");
|
|
this.open = false;
|
|
this.open = false;
|
|
|
|
+ this.buttonDisable = false;
|
|
this.getList();
|
|
this.getList();
|
|
});
|
|
});
|
|
});
|
|
});
|