|
@@ -40,6 +40,29 @@
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</el-col>
|
|
</el-col>
|
|
</el-row>
|
|
</el-row>
|
|
|
|
+ <el-row :gutter="40" style="width: 500px">
|
|
|
|
+ <el-col :span="23">
|
|
|
|
+ <el-form-item label="供应商:" prop="supplerId">
|
|
|
|
+ <el-select
|
|
|
|
+ v-model="addData.supplerId"
|
|
|
|
+ placeholder="请选择供应商"
|
|
|
|
+ clearable
|
|
|
|
+ >
|
|
|
|
+ <el-option :label="item.name" :value="item.id" v-for="(item, index) in SupplierList" :key="index" />
|
|
|
|
+ </el-select>
|
|
|
|
+ <a style="margin-left: 20px;color:#3983EF;" @click="handleAdd">创建供应商</a>
|
|
|
|
+ </el-form-item>
|
|
|
|
+
|
|
|
|
+ </el-col>
|
|
|
|
+ </el-row>
|
|
|
|
+ <el-row :gutter="40" style="width: 500px">
|
|
|
|
+ <el-col :span="23">
|
|
|
|
+ <el-form-item label="商品采购链接:">
|
|
|
|
+ <el-input v-model="addData.shoppingLink" placeholder="请输入商品采购链接"/>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </el-col>
|
|
|
|
+ </el-row>
|
|
|
|
+
|
|
<el-row :gutter="40" style="width: 500px">
|
|
<el-row :gutter="40" style="width: 500px">
|
|
<el-col :span="23">
|
|
<el-col :span="23">
|
|
<el-form-item label="商品标签:">
|
|
<el-form-item label="商品标签:">
|
|
@@ -132,6 +155,11 @@
|
|
<el-button type="primary" @click="updateItem()">保存</el-button>
|
|
<el-button type="primary" @click="updateItem()">保存</el-button>
|
|
</el-col>
|
|
</el-col>
|
|
</el-row>
|
|
</el-row>
|
|
|
|
+ <add-supplier
|
|
|
|
+ v-if="createShow"
|
|
|
|
+ :dialog-show="createShow"
|
|
|
|
+ @close="close"
|
|
|
|
+ />
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
<script>
|
|
<script>
|
|
@@ -141,30 +169,36 @@ import Spec from './components/spec'
|
|
import TinyEditor from '@/components/TinyEditor'
|
|
import TinyEditor from '@/components/TinyEditor'
|
|
import { getGoodsDetail, addGoods } from '@/api/business/goods'
|
|
import { getGoodsDetail, addGoods } from '@/api/business/goods'
|
|
import { goodsCategoryItems } from '@/api/business/category'
|
|
import { goodsCategoryItems } from '@/api/business/category'
|
|
|
|
+import { getSupplierList } from '@/api/business/supplier'
|
|
import { goodsTagItems } from '@/api/business/tag'
|
|
import { goodsTagItems } from '@/api/business/tag'
|
|
import { publicFileGetUrl } from "@/api/common"
|
|
import { publicFileGetUrl } from "@/api/common"
|
|
import { accDiv, accMul } from '@/utils/util'
|
|
import { accDiv, accMul } from '@/utils/util'
|
|
|
|
+import AddSupplier from "../supplier/components/addSupplier";
|
|
export default {
|
|
export default {
|
|
components: {
|
|
components: {
|
|
TinyEditor,
|
|
TinyEditor,
|
|
WangEditor,
|
|
WangEditor,
|
|
Upload,
|
|
Upload,
|
|
- Spec
|
|
|
|
|
|
+ Spec,
|
|
|
|
+ AddSupplier
|
|
},
|
|
},
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
IMG_URL: publicFileGetUrl,
|
|
IMG_URL: publicFileGetUrl,
|
|
id: this.$route.query.id,
|
|
id: this.$route.query.id,
|
|
goodsCategoryItemsList: [],
|
|
goodsCategoryItemsList: [],
|
|
|
|
+ SupplierList: [],
|
|
goodsTagItemsList: [],
|
|
goodsTagItemsList: [],
|
|
addData: {
|
|
addData: {
|
|
multiSku: 0,
|
|
multiSku: 0,
|
|
description: ''
|
|
description: ''
|
|
},
|
|
},
|
|
|
|
+ createShow:false,
|
|
rules: {
|
|
rules: {
|
|
title: [{ required: true, message: '请输入商品名称', trigger: 'blur' }],
|
|
title: [{ required: true, message: '请输入商品名称', trigger: 'blur' }],
|
|
picUrl: [{ required: true, message: '请上传商品图片', trigger: 'change' }],
|
|
picUrl: [{ required: true, message: '请上传商品图片', trigger: 'change' }],
|
|
categoryId: [{ required: true, message: '请选择商品分类', trigger: 'change' }],
|
|
categoryId: [{ required: true, message: '请选择商品分类', trigger: 'change' }],
|
|
|
|
+ supplerId: [{ required: true, message: '请选择供应商', trigger: 'change' }],
|
|
exchangeShow: [{ required: true, message: '请选择是否支持盲豆兑换', trigger: 'change' }],
|
|
exchangeShow: [{ required: true, message: '请选择是否支持盲豆兑换', trigger: 'change' }],
|
|
multiSku: [{ required: true, message: '请选择SKU类型', trigger: 'change' }],
|
|
multiSku: [{ required: true, message: '请选择SKU类型', trigger: 'change' }],
|
|
value: [
|
|
value: [
|
|
@@ -215,14 +249,15 @@ export default {
|
|
},
|
|
},
|
|
created() {
|
|
created() {
|
|
this.getGoodsCategoryItems()
|
|
this.getGoodsCategoryItems()
|
|
|
|
+ this.getSupplierItems()
|
|
this.getGoodsTagItems()
|
|
this.getGoodsTagItems()
|
|
if (this.id) {
|
|
if (this.id) {
|
|
getGoodsDetail(this.id).then(res => {
|
|
getGoodsDetail(this.id).then(res => {
|
|
- const { goodsId, title, goodsCode, picUrl,merchantInfo, exchangeShow, multiSku, value, exchangePrice, cost, quantity, description, skuList, categoryId, tagIds } = res.data
|
|
|
|
|
|
+ const { goodsId, title, goodsCode, picUrl,merchantInfo, exchangeShow, multiSku, value, exchangePrice, cost, quantity, description, skuList, categoryId, supplerId, shoppingLink, tagIds } = res.data
|
|
this.addData = {
|
|
this.addData = {
|
|
value: accDiv(value, 100),
|
|
value: accDiv(value, 100),
|
|
cost: cost == '' || cost == null ? '' : accDiv(cost, 100),
|
|
cost: cost == '' || cost == null ? '' : accDiv(cost, 100),
|
|
- goodsId, title, goodsCode, picUrl,merchantInfo, exchangeShow, multiSku, exchangePrice, quantity, description, skuList, categoryId, tagIds
|
|
|
|
|
|
+ goodsId, title, goodsCode, picUrl,merchantInfo, exchangeShow, multiSku, exchangePrice, quantity, description, skuList, categoryId, supplerId, shoppingLink, tagIds
|
|
}
|
|
}
|
|
if(description) {
|
|
if(description) {
|
|
this.$refs.editor.setContent(description)
|
|
this.$refs.editor.setContent(description)
|
|
@@ -241,6 +276,19 @@ export default {
|
|
this.goodsCategoryItemsList = res && res.data
|
|
this.goodsCategoryItemsList = res && res.data
|
|
})
|
|
})
|
|
},
|
|
},
|
|
|
|
+ //获取供应商
|
|
|
|
+ getSupplierItems(){
|
|
|
|
+ getSupplierList({name:""}).then(res => {
|
|
|
|
+ this.SupplierList = res && res.rows
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ handleAdd() {
|
|
|
|
+ this.createShow = true;
|
|
|
|
+ },
|
|
|
|
+ close(){
|
|
|
|
+ this.createShow = false;
|
|
|
|
+ this.getSupplierItems()
|
|
|
|
+ },
|
|
getGoodsTagItems(){
|
|
getGoodsTagItems(){
|
|
goodsTagItems({}).then(res => {
|
|
goodsTagItems({}).then(res => {
|
|
this.goodsTagItemsList = res && res.data
|
|
this.goodsTagItemsList = res && res.data
|