|
@@ -21,9 +21,9 @@
|
|
|
搜索
|
|
|
</el-button>
|
|
|
</div>
|
|
|
- <!-- <el-button class="add-btn" type="primary" size="small" @click="handleAdd"
|
|
|
+ <el-button class="add-btn" type="primary" size="small" @click="handleAdd"
|
|
|
>添加</el-button
|
|
|
- > -->
|
|
|
+ >
|
|
|
|
|
|
</div>
|
|
|
|
|
@@ -124,15 +124,15 @@
|
|
|
<el-form label-width="130px" :model="setQuery"
|
|
|
ref="setQuery"
|
|
|
:rules="rules">
|
|
|
- <el-form-item label="产品类型">
|
|
|
+ <el-form-item label="产品类型" prop="productType">
|
|
|
<el-select
|
|
|
v-model="setQuery.productType"
|
|
|
class="item-width-300"
|
|
|
placeholder="请选择产品类型"
|
|
|
- disabled
|
|
|
+ :disabled="title == '编辑'"
|
|
|
>
|
|
|
<el-option
|
|
|
- v-for="item in typeOptions"
|
|
|
+ v-for="item in options"
|
|
|
:key="item.value"
|
|
|
:label="item.label"
|
|
|
:value="item.value"
|
|
@@ -140,7 +140,7 @@
|
|
|
</el-option>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="产品图片:" prop="logoPath">
|
|
|
+ <el-form-item label="产品图片:" prop="cover">
|
|
|
<Upload
|
|
|
type="logoPath"
|
|
|
id="logoPath"
|
|
@@ -156,12 +156,36 @@
|
|
|
v-model="setQuery.title"
|
|
|
class="item-width-300"
|
|
|
></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="跳转地址" v-if="setQuery.productType == 'Web'" prop="meta.url">
|
|
|
+ <el-input
|
|
|
+ v-model="setQuery.meta.url"
|
|
|
+ class="item-width-300"
|
|
|
+ ></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="地址" >
|
|
|
+ <el-input
|
|
|
+ v-model="setQuery.address"
|
|
|
+ class="item-width-300"
|
|
|
+ ></el-input>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="邮政编码" prop="regionCode">
|
|
|
<el-input
|
|
|
v-model.number="setQuery.regionCode"
|
|
|
class="item-width-300"
|
|
|
></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="经度" >
|
|
|
+ <el-input
|
|
|
+ v-model.number="setQuery.locationPoint.longitude"
|
|
|
+ class="item-width-300"
|
|
|
+ ></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="纬度">
|
|
|
+ <el-input
|
|
|
+ v-model.number="setQuery.locationPoint.latitude"
|
|
|
+ class="item-width-300"
|
|
|
+ ></el-input>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="售价" >
|
|
|
<el-input
|
|
@@ -202,6 +226,7 @@
|
|
|
<script>
|
|
|
import { debounce } from "@/utils/index";
|
|
|
import { goodsStoreList,setHidden,listAllTypes,upsertProduct} from "@/api/goods";
|
|
|
+import guid from "@/utils/guid";
|
|
|
import Upload from "@/components/Upload";
|
|
|
|
|
|
export default {
|
|
@@ -230,7 +255,6 @@ export default {
|
|
|
setQuery1:{
|
|
|
type:''
|
|
|
},
|
|
|
- options:[],
|
|
|
setQuery:{
|
|
|
cover:[],
|
|
|
productType:'',
|
|
@@ -239,6 +263,11 @@ export default {
|
|
|
salePrice:0,
|
|
|
originalPrice:0,
|
|
|
hotCount:0,
|
|
|
+ address:'',
|
|
|
+ locationPoint:{
|
|
|
+ longitude: 0,
|
|
|
+ latitude: 0
|
|
|
+ }
|
|
|
},
|
|
|
topFrom:{
|
|
|
pid:"",
|
|
@@ -248,9 +277,10 @@ export default {
|
|
|
tabList:[],
|
|
|
rules:{
|
|
|
productType: [{ required: true, message: "请选择产品类型", trigger: "change" }],
|
|
|
+ cover: [{ required: true, message: "请上传产品图片", trigger: "change" }],
|
|
|
regionCode: [{ required: true, message: "请输入邮政编码", trigger: "blur" }],
|
|
|
title: [{ required: true, message: "请输入产品名称", trigger: "blur" }],
|
|
|
- // title: [{ required: true, message: "请输入产品名称", trigger: "blur" }],
|
|
|
+ 'meta.url': [{ required: true, message: "请输入跳转链接", trigger: "blur" }],
|
|
|
|
|
|
},
|
|
|
rules1:{
|
|
@@ -302,6 +332,23 @@ export default {
|
|
|
}
|
|
|
};
|
|
|
},
|
|
|
+ computed: {
|
|
|
+ options() {
|
|
|
+ if(this.title == '添加'){
|
|
|
+ return [{
|
|
|
+ value:"Web",
|
|
|
+ label:"Web链接"
|
|
|
+ }]
|
|
|
+ }else{
|
|
|
+ return this.typeOptions
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ return this.data
|
|
|
+ }
|
|
|
+ },
|
|
|
methods: {
|
|
|
// 图片统一上传
|
|
|
uploadEnd(val) {
|
|
@@ -335,17 +382,39 @@ export default {
|
|
|
originalPrice: row.originalPrice,
|
|
|
salePrice: row.salePrice,
|
|
|
hotCount: row.hotCount,
|
|
|
+ address: row.address,
|
|
|
+ locationPoint:row.locationPoint ||{
|
|
|
+ longitude: 0,
|
|
|
+ latitude: 0
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(row.productType == 'Web'){
|
|
|
+ this.setQuery.meta = row.meta
|
|
|
}
|
|
|
},
|
|
|
handleAdd() {
|
|
|
this.title = '添加'
|
|
|
this.dialogFormVisible = true
|
|
|
this.setQuery = {
|
|
|
- "activityContent": "",
|
|
|
- "activityId": "",
|
|
|
- "activityMoney": 0,
|
|
|
- "endTime": "",
|
|
|
- "startTime": ""
|
|
|
+ cover: [],
|
|
|
+ productType: '',
|
|
|
+ regionCode: '',
|
|
|
+ title: '',
|
|
|
+ pid: guid(),
|
|
|
+ meta: {
|
|
|
+ url: '',
|
|
|
+ },
|
|
|
+ top: 0,
|
|
|
+ hidden: false,
|
|
|
+ salesCount: 0,
|
|
|
+ originalPrice: 0,
|
|
|
+ salePrice: 0,
|
|
|
+ hotCount: 0,
|
|
|
+ address:'',
|
|
|
+ locationPoint:{
|
|
|
+ longitude: 0,
|
|
|
+ latitude: 0
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
|