|
@@ -3,7 +3,7 @@
|
|
|
<div class="i-layout-page-header">
|
|
<div class="i-layout-page-header">
|
|
|
<PageHeader class="product_tabs" hidden-breadcrumb>
|
|
<PageHeader class="product_tabs" hidden-breadcrumb>
|
|
|
<div slot="title">
|
|
<div slot="title">
|
|
|
- <router-link :to="{ path: `${roterPre}/marketing/serve/index` }">
|
|
|
|
|
|
|
+ <router-link :to="{ path: `${roterPre}/marketing/serve_item/index` }">
|
|
|
<div class="font-sm after-line">
|
|
<div class="font-sm after-line">
|
|
|
<span class="iconfont iconfanhui"></span>
|
|
<span class="iconfont iconfanhui"></span>
|
|
|
<span class="pl10">返回</span>
|
|
<span class="pl10">返回</span>
|
|
@@ -15,31 +15,35 @@
|
|
|
</div>
|
|
</div>
|
|
|
<Card :bordered="false" dis-hover class="ivu-mt">
|
|
<Card :bordered="false" dis-hover class="ivu-mt">
|
|
|
<Form :model="formData" :label-width="150">
|
|
<Form :model="formData" :label-width="150">
|
|
|
- <FormItem label="选择对应服务卡:" required>
|
|
|
|
|
|
|
+ <FormItem label="选择对应服务项目:" required>
|
|
|
<div class="picBox" @click="changeGoods()">
|
|
<div class="picBox" @click="changeGoods()">
|
|
|
- <Button type="primary" v-if="!formData.card_name">选择商品</Button>
|
|
|
|
|
- <div class="" v-if="formData.card_name">
|
|
|
|
|
- {{formData.card_name}}
|
|
|
|
|
|
|
+ <Button type="primary" v-if="!formData.store_name">选择商品</Button>
|
|
|
|
|
+ <div class="" v-if="formData.store_name">
|
|
|
|
|
+ {{formData.store_name}}
|
|
|
</div>
|
|
</div>
|
|
|
- <Button type="primary" v-if="formData.card_name">
|
|
|
|
|
|
|
+ <Button type="primary" v-if="formData.store_name">
|
|
|
切换商品
|
|
切换商品
|
|
|
</Button>
|
|
</Button>
|
|
|
</div>
|
|
</div>
|
|
|
</FormItem>
|
|
</FormItem>
|
|
|
- <!-- <FormItem label="服务卡名称" required>
|
|
|
|
|
- <Input v-model="formData.card_name" v-width="320" placeholder="请输入服务卡名称"></Input>
|
|
|
|
|
- </FormItem> -->
|
|
|
|
|
- <!-- <FormItem label="售价" required>
|
|
|
|
|
- <InputNumber :min="1" :max="100000000" v-model="formData.card_price" v-width="320"></InputNumber>
|
|
|
|
|
|
|
+ <FormItem label="价格" v-if="formData.price">
|
|
|
|
|
+ <Input v-model="formData.price" v-width="320" disabled ></Input>
|
|
|
</FormItem>
|
|
</FormItem>
|
|
|
- <FormItem label="库存" required>
|
|
|
|
|
- <InputNumber :min="1" :max="100000000" v-model="formData.repertory" v-width="320"></InputNumber>
|
|
|
|
|
- </InputNumber>
|
|
|
|
|
- </FormItem> -->
|
|
|
|
|
- <!-- explain -->
|
|
|
|
|
- <FormItem label="备注">
|
|
|
|
|
- <Input v-model="formData.explain" v-width="320" placeholder=""></Input>
|
|
|
|
|
|
|
+ <FormItem label="库存" v-if="formData.repertory">
|
|
|
|
|
+ <Input v-model="formData.repertory" v-width="320" disabled></Input>
|
|
|
|
|
+ </FormItem>
|
|
|
|
|
+ <FormItem label="业绩值" required>
|
|
|
|
|
+ <Input v-model="formData.performance_value" v-width="320"></Input>
|
|
|
|
|
+ </FormItem>
|
|
|
|
|
+ <FormItem label="手工费" required>
|
|
|
|
|
+ <Input v-model="formData.craft_price" v-width="320"></Input>
|
|
|
|
|
+ </FormItem>
|
|
|
|
|
+ <FormItem label="销售提成" required>
|
|
|
|
|
+ <Input v-model="formData.sales_commissions" v-width="320"></Input>
|
|
|
</FormItem>
|
|
</FormItem>
|
|
|
|
|
+ <!-- <FormItem label="备注">
|
|
|
|
|
+ <Input v-model="formData.explain" v-width="320" placeholder=""></Input>
|
|
|
|
|
+ </FormItem> -->
|
|
|
</Form>
|
|
</Form>
|
|
|
<div style="width: 500px; display: flex;justify-content: center;">
|
|
<div style="width: 500px; display: flex;justify-content: center;">
|
|
|
<Button type="primary" class="submission" @click="save" :disabled="disabled" v-if="!formData.id">立即创建</Button>
|
|
<Button type="primary" class="submission" @click="save" :disabled="disabled" v-if="!formData.id">立即创建</Button>
|
|
@@ -49,7 +53,7 @@
|
|
|
<!-- 选择商品-->
|
|
<!-- 选择商品-->
|
|
|
<Modal v-model="modals" title="商品列表" footerHide class="paymentFooter" scrollable width="900"
|
|
<Modal v-model="modals" title="商品列表" footerHide class="paymentFooter" scrollable width="900"
|
|
|
@on-cancel="cancel">
|
|
@on-cancel="cancel">
|
|
|
- <goods-list ref="goodslist" :goodsType="1" v-if="modals" @getProductId="getProductId" :serviceCard="1"></goods-list>
|
|
|
|
|
|
|
+ <goods-list ref="goodslist" :goodsType="1" v-if="modals" @getProductId="getProductId" :serviceProject="1"></goods-list>
|
|
|
</Modal>
|
|
</Modal>
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
@@ -66,7 +70,8 @@
|
|
|
couponDetailApi,
|
|
couponDetailApi,
|
|
|
VipEditApi,
|
|
VipEditApi,
|
|
|
serveAddApi,
|
|
serveAddApi,
|
|
|
- serveReadApi
|
|
|
|
|
|
|
+ serveReadApi,
|
|
|
|
|
+ createServeProduct
|
|
|
} from "@/api/marketing";
|
|
} from "@/api/marketing";
|
|
|
import {
|
|
import {
|
|
|
brandList
|
|
brandList
|
|
@@ -86,10 +91,10 @@
|
|
|
disabled: false,
|
|
disabled: false,
|
|
|
storesList: [],
|
|
storesList: [],
|
|
|
formData: {
|
|
formData: {
|
|
|
- id: '',
|
|
|
|
|
|
|
+ id: 0,
|
|
|
product_name: '',
|
|
product_name: '',
|
|
|
product_id: 0,
|
|
product_id: 0,
|
|
|
- card_name: '',
|
|
|
|
|
|
|
+ store_name: '',
|
|
|
repertory: '',
|
|
repertory: '',
|
|
|
card_price: '',
|
|
card_price: '',
|
|
|
explain: '',
|
|
explain: '',
|
|
@@ -112,8 +117,14 @@
|
|
|
},
|
|
},
|
|
|
created() {
|
|
created() {
|
|
|
if (this.$route.query.id) {
|
|
if (this.$route.query.id) {
|
|
|
- this.id = this.$route.query.id
|
|
|
|
|
- this.getDetail();
|
|
|
|
|
|
|
+ let query = this.$route.query
|
|
|
|
|
+ this.formData.id = query.id;
|
|
|
|
|
+ this.formData.store_name = query.store_name;
|
|
|
|
|
+ this.formData.repertory = query.repertory;
|
|
|
|
|
+ this.formData.slider_image = query.slider_image;
|
|
|
|
|
+ this.formData.performance_value = query.performance_value;
|
|
|
|
|
+ this.formData.craft_price = query.craft_price;
|
|
|
|
|
+ this.formData.sales_commissions = query.sales_commissions
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
@@ -124,13 +135,14 @@
|
|
|
this.modals = false;
|
|
this.modals = false;
|
|
|
setTimeout(() => {
|
|
setTimeout(() => {
|
|
|
this.formData.product_id = row.id
|
|
this.formData.product_id = row.id
|
|
|
- this.formData.card_name = row.store_name
|
|
|
|
|
|
|
+ this.formData.store_name = row.store_name
|
|
|
this.formData.product_id = row.id
|
|
this.formData.product_id = row.id
|
|
|
this.formData.card_price = row.price
|
|
this.formData.card_price = row.price
|
|
|
this.formData.unit_name = row.unit_name
|
|
this.formData.unit_name = row.unit_name
|
|
|
- this.formData.image = row.image
|
|
|
|
|
- this.formData.images = row.slider_image
|
|
|
|
|
- this.formData.is_show = 1
|
|
|
|
|
|
|
+ this.formData.slider_image = row.image
|
|
|
|
|
+ this.formData.price = row.price
|
|
|
|
|
+ // this.formData.slider_image = row.slider_image
|
|
|
|
|
+ // this.formData.is_show = 1
|
|
|
this.formData.repertory = row.stock
|
|
this.formData.repertory = row.stock
|
|
|
// this.formData.image = row.image
|
|
// this.formData.image = row.image
|
|
|
}, 500);
|
|
}, 500);
|
|
@@ -140,27 +152,27 @@
|
|
|
this.modals = true;
|
|
this.modals = true;
|
|
|
},
|
|
},
|
|
|
downTab() {
|
|
downTab() {
|
|
|
- if (!this.formData.card_name) {
|
|
|
|
|
- return this.$Message.error("请输入服务卡名称");
|
|
|
|
|
- }
|
|
|
|
|
- if (!this.formData.card_price) {
|
|
|
|
|
- return this.$Message.error("请输入售价");
|
|
|
|
|
- }
|
|
|
|
|
- if (!this.formData.repertory) {
|
|
|
|
|
- return this.$Message.error("请输入库存");
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ // if (!this.formData.store_name) {
|
|
|
|
|
+ // return this.$Message.error("请输入服务卡名称");
|
|
|
|
|
+ // }
|
|
|
|
|
+ // if (!this.formData.card_price) {
|
|
|
|
|
+ // return this.$Message.error("请输入售价");
|
|
|
|
|
+ // }
|
|
|
|
|
+ // if (!this.formData.repertory) {
|
|
|
|
|
+ // return this.$Message.error("请输入库存");
|
|
|
|
|
+ // }
|
|
|
},
|
|
},
|
|
|
// 创建
|
|
// 创建
|
|
|
save() {
|
|
save() {
|
|
|
this.downTab();
|
|
this.downTab();
|
|
|
console.log('这');
|
|
console.log('这');
|
|
|
- serveAddApi(this.formData)
|
|
|
|
|
|
|
+ createServeProduct(this.formData.id, this.formData)
|
|
|
.then((res) => {
|
|
.then((res) => {
|
|
|
this.disabled = true;
|
|
this.disabled = true;
|
|
|
this.$Message.success(res.msg);
|
|
this.$Message.success(res.msg);
|
|
|
setTimeout(() => {
|
|
setTimeout(() => {
|
|
|
this.$router.push({
|
|
this.$router.push({
|
|
|
- path: this.roterPre + "/marketing/serve/index",
|
|
|
|
|
|
|
+ path: this.roterPre + "/marketing/serve_item/index",
|
|
|
});
|
|
});
|
|
|
}, 1000);
|
|
}, 1000);
|
|
|
})
|
|
})
|
|
@@ -212,7 +224,7 @@
|
|
|
this.formData = {
|
|
this.formData = {
|
|
|
id: row.id,
|
|
id: row.id,
|
|
|
product_id: row.id,
|
|
product_id: row.id,
|
|
|
- card_name: row.card_name,
|
|
|
|
|
|
|
+ store_name: row.store_name,
|
|
|
card_price: row.card_price,
|
|
card_price: row.card_price,
|
|
|
explain: row.explain,
|
|
explain: row.explain,
|
|
|
unit_name: row.unit_name,
|
|
unit_name: row.unit_name,
|