Commit 0eb64338 by chenwq

表单改版,优惠券管理,定向礼包

1 parent 883b9b19
......@@ -110,7 +110,8 @@ html {
position: relative;
}
.marketing .w-100-per {
.marketing .w-100-per,
.marketing .w-100-percent {
width: 100% !important;
}
......@@ -132,9 +133,9 @@ html {
}
.marketing .form-sub-block {
width: 686px;
// width: 686px;
background: #f9f9f9;
padding: 20px;
padding: 20px 80px 20px 20px;
}
.marketing .f-right {
......@@ -718,86 +719,3 @@ html {
vertical-align: middle;
margin-right: 8px;
}
// ----------------------
.gl-form-page {
.ml12 {
margin-left: 12px;
}
.ml20 {
margin-left: 20px;
}
.mr12 {
margin-right: 12px;
}
.mr24 {
margin-right: 24px;
}
.mb10 {
margin-bottom: 10px;
}
.mb12 {
margin-bottom: 12px;
}
.mb20 {
margin-bottom: 20px;
}
.w136 {
width: 136px !important;
}
.w154 {
width: 154px !important;
}
.w284 {
width: 284px !important;
}
.w432 {
width: 432px !important;
}
.w580 {
width: 580px !important;
}
.w728 {
width: 728px !important;
}
.el-form {
.el-form-item {
&:last-child {
margin-bottom: 0;
}
margin-bottom: 20px;
}
.el-form-item__label {
padding: 0;
width: 154px;
}
.el-button--medium {
padding: 10px 20px;
font-size: 14px;
border-radius: 4px;
}
.el-input {
width: 432px;
}
.el-textarea {
width: 580px !important;
}
.el-select {
width: 432px;
margin-right: 12px;
.el-input {
width: 432px;
}
.el-input--small .el-input__inner {
height: 32px;
line-height: 32px;
}
}
.el-date-editor {
width: 432px;
}
.welcome-box {
width: 580px;
}
}
}
......@@ -57,8 +57,7 @@
</div>
</div>
<p class="edit-title">{{ title }}代金券</p>
<glsx-combi-form class="edit-form-container" style="min-height: 570px" ref="editFormRef" :isEdit="true"
:isBlock="true" :formRef="editChildRef" :formObj="editForm" :formData="editFormData" :formRules="editRule">
<glsx-combi-form class="edit-form-container" style="min-height: 570px" ref="editFormRef" :isEdit="true" :isBlock="true" :formRef="editChildRef" :formObj="editForm" :formData="editFormData" :formRules="editRule">
<template slot="useChannelHtml">
<el-radio v-model="editForm.useChannel" label="1" :disabled="apear != 'couponAdd'">线上商品</el-radio>
<el-radio v-model="editForm.useChannel" label="2" :disabled="apear != 'couponAdd'">到店核销</el-radio>
......@@ -82,18 +81,14 @@
<br />
<el-form-item prop="effectiveTime" ref="effectiveTime" style="margin-top: 12px; display: block">
<el-radio v-model="editForm.effectiveType" label="2" :disabled="apear != 'couponAdd'">
<el-date-picker v-model="editForm.effectiveTime" @change="haveChange" type="datetimerange"
style="width: 340px" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期"
value-format="yyyy-MM-dd HH:mm:ss" :picker-options="pickerOption" :default-time="defaultTime"
:format="format" :disabled="editForm.effectiveType != 2 || apear != 'couponAdd'" clearable>
<el-date-picker v-model="editForm.effectiveTime" @change="haveChange" type="datetimerange" style="width: 340px" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" value-format="yyyy-MM-dd HH:mm:ss" :picker-options="pickerOption" :default-time="defaultTime" :format="format" :disabled="editForm.effectiveType != 2 || apear != 'couponAdd'" clearable>
</el-date-picker>
</el-radio>
</el-form-item>
<el-form-item prop="effectiveDays" ref="effectiveDays">
<el-radio v-model="editForm.effectiveType" label="1" :disabled="apear != 'couponAdd'">
领取后
<el-input v-model="editForm.effectiveDays" style="width: 100px; margin-left: 5px; margin-right: 5px"
:disabled="apear != 'couponAdd' || editForm.effectiveType != 1" />
<el-input v-model="editForm.effectiveDays" style="width: 100px; margin-left: 5px; margin-right: 5px" :disabled="apear != 'couponAdd' || editForm.effectiveType != 1" />
天内有效
</el-radio>
</el-form-item>
......@@ -101,20 +96,15 @@
<template slot="useBarriersHtml">
<el-radio v-model="editForm.useBarriers" label="1" :disabled="apear != 'couponAdd'">无限制</el-radio>
<el-form-item prop="full" ref="full">
<el-radio v-model="editForm.useBarriers" label="2"
:disabled="apear != 'couponAdd' || editForm.useChannel == 2">
<el-radio v-model="editForm.useBarriers" label="2" :disabled="apear != 'couponAdd' || editForm.useChannel == 2">
订单满
<el-input v-model="editForm.full" placeholder="输入金额(元)"
style="width: 110px; margin-left: 5px; margin-right: 5px"
:disabled="apear != 'couponAdd' || editForm.useBarriers != 2" />
<el-input v-model="editForm.full" placeholder="输入金额(元)" style="width: 110px; margin-left: 5px; margin-right: 5px" :disabled="apear != 'couponAdd' || editForm.useBarriers != 2" />
元可用
</el-radio>
</el-form-item>
</template>
<template slot="denominationHtml">
<el-input v-model="editForm.denomination" id="denomination" style="width: 150px"
:disabled="apear != 'couponAdd'"
@blur.native.capture="editForm.useChannel == 1 && denominationBlur($event)">
<el-input v-model="editForm.denomination" id="denomination" style="width: 150px" :disabled="apear != 'couponAdd'" @blur.native.capture="editForm.useChannel == 1 && denominationBlur($event)">
<span slot="append">元</span>
</el-input>
<span style="color: red; margin-left: 15px" v-if="priceFlag && editForm.useChannel == 1">{{
......@@ -124,8 +114,7 @@
<!-- 库存,集团版集团账号-无限制库存;其他-输入框 -->
<template slot="stock" slot-scope="scope">
<span v-if="$isGroupUp">无库存限制</span>
<el-input :disabled="apear != 'couponAdd'" v-else class="w-150" v-model="editForm[scope.scope.name]"
placeholder="请输入库存">
<el-input :disabled="apear != 'couponAdd'" v-else class="w-150" v-model="editForm[scope.scope.name]" placeholder="请输入库存">
<span slot="suffix">张</span>
</el-input>
</template>
......@@ -138,22 +127,19 @@
</el-radio>
</template>
<!-- 新增时并且为指定商品时显示,编辑或者查看时也显示 -->
<div slot="proTable" class="select-pro">
<div slot="proTable" class="select-pro" :style="{ 'margin-left': defaultLabelWidth, width: `calc(100% - ${defaultLabelWidth} )` }">
<!-- <div style="height:70px" v-if="editForm.goodsRefList.length"></div> -->
<GLTable v-show="editForm.goodsRefList.length" :hasPage="false" :tableParams="tableParams"
:tableData="editForm.goodsRefList"
style="padding-left: 10px; margin-right: 340px; max-height: 350px; overflow: auto">
<GLTable v-show="editForm.goodsRefList.length" :hasPage="false" :tableParams="tableParams" :tableData="editForm.goodsRefList" style="padding-left: 10px; margin-right: 340px; max-height: 350px; overflow: auto">
<template slot="goodsImage" slot-scope="scope">
<img class="img-60" :src="scope.scope.goodsImage" />
</template>
<span slot="auth-button" slot-scope="scope">
<el-button type="text" @click="handleProDelete(scope)">删除</el-button>
<span slot="customBtn" slot-scope="scope">
<el-button class="p-0" type="text" @click="handleProDelete(scope)">删除</el-button>
</span>
</GLTable>
</div>
<template slot="useDescriptionHtml">
<el-input type="textarea" v-model="editForm.useDescription" style="width: 320px"
:autosize="{ minRows: 2, maxRows: 4 }" maxlength="200" :disabled="userDisable" />
<el-input type="textarea" v-model="editForm.useDescription" style="width: 320px" :autosize="{ minRows: 2, maxRows: 4 }" maxlength="200" :disabled="userDisable" />
</template>
<template slot="editHtml">
<el-button style="margin-left: 80px" @click="editMessage">编辑</el-button>
......@@ -161,8 +147,7 @@
</glsx-combi-form>
<div v-if="$isGroupUp">
<p class="edit-title">适用门店配置</p>
<glsx-combi-form class="edit-form-container" ref="merchantRef" :isEdit="true" :isBlock="true"
:formRef="editChildRef" :formObj="editForm" :formData="merchantEditFormData" :formRules="merchantRule">
<glsx-combi-form class="edit-form-container" ref="merchantRef" :isEdit="true" :isBlock="true" :formRef="editChildRef" :formObj="editForm" :formData="merchantEditFormData" :formRules="merchantRule">
</glsx-combi-form>
</div>
</div>
......@@ -170,9 +155,7 @@
<el-button @click="handleCancel" size="medium">{{ apear != 'couponSee' ? '取消' : '返回' }}</el-button>
<el-button v-if="showSubmit" type="primary" @click="handleConfirm" size="medium" :loading="loading">提交</el-button>
</GLFooter>
<select-muti-pro-forcoupon-dialog v-if="isMutiSelectVisible" :isMutiSelectVisible="isMutiSelectVisible"
:searchForm="searchProForm" :selectedProList="selectedProList" @handleMutiSelectConfirm="handleMutiSelectConfirm"
@handleMutiSelectClose="handleMutiSelectClose"></select-muti-pro-forcoupon-dialog>
<select-muti-pro-forcoupon-dialog v-if="isMutiSelectVisible" :isMutiSelectVisible="isMutiSelectVisible" :searchForm="searchProForm" :selectedProList="selectedProList" @handleMutiSelectConfirm="handleMutiSelectConfirm" @handleMutiSelectClose="handleMutiSelectClose"></select-muti-pro-forcoupon-dialog>
</div>
</template>
......@@ -224,7 +207,6 @@ export default {
},
//商品列表
tableParams: {
tableOption: true,
tableColumns: [
{
label: '缩略图',
......@@ -238,6 +220,11 @@ export default {
{
label: '零售价(元)',
prop: 'retailPrice'
},
{
label: '操作',
prop: '',
addHtml: 'customBtn'
}
]
},
......@@ -272,14 +259,12 @@ export default {
{
label: '优惠券名称',
name: 'couponName',
width: '320px',
type: 'input',
maxlength: 20
},
{
label: '预估成本/元',
name: 'anticipatedCost',
width: '320px',
type: 'input',
isDisabled: false
},
......@@ -817,9 +802,9 @@ export default {
this.cancelJump()
}
})
.finally(() => {
this.loading = false
})
.finally(() => {
this.loading = false
})
}
})
},
......
......@@ -2,27 +2,6 @@
<template>
<div class="edit-share marketing edit-box">
<div class="container edit-container" style="position: relative" v-loading="loading">
<!-- <div class="right_show">
<div class="card-top"></div>
<div class="card-middle">
<div>
<span class="cname">{{ editForm.couponName }}</span>
<span class="ctype"><span class="ctypeName">折扣券</span></span>
</div>
<div class="ctime">
<span class="ctime_name">有效期:</span>
<span class="ctime_content" v-if="editForm.effectiveType == 1">{{ editForm.effectiveDays }}天</span>
<span class="ctime_content" v-if="editForm.effectiveType == 2">{{ couponTime }}</span>
</div>
<div class="ctime">
<span class="ctime_name">核销券码:</span>
</div>
<img class="ccode" src="../../assets/coupon/code2.png" />
<div class="ccodeName">GH078-003</div>
<div class="cremarks">使用说明:</div>
<div class="cremarks_content">{{ editForm.useDescription }}</div>
</div>
</div> -->
<div class="right_show">
<div class="card-top"></div>
<div class="slider">
......@@ -32,9 +11,6 @@
<img src="../../images/unDiscount.png" class="couponImg" v-if="editForm.status == 3" />
<img src="../../images/discount.png" class="couponImg" v-else />
</div>
<!-- <div class="ctype">
<div class="ctypeName"></div>
</div> -->
<div class="validityPeriod">
<!-- <span class="ctime_name">有效期:</span> -->
<span v-if="editForm.effectiveType == 3">永久有效</span>
......@@ -45,8 +21,7 @@
<div :class="editForm.status == 3 ? 'darkColor' : ''" class="ctime">
<!-- <span class="ctime_name">使用限制:</span> -->
<span class="ctime_content" style="font-size: 20px;font-weight: 600;"
v-show="editForm.discountIntensity">{{ editForm.discountIntensity }}</span>
<span class="ctime_content" style="font-size: 20px;font-weight: 600;" v-show="editForm.discountIntensity">{{ editForm.discountIntensity }}</span>
<span v-show="editForm.discountIntensity" style="font-size: 12px;">折</span>
<span class="ctime_content">{{ editForm.useBarriers == 1 ? '无门槛' : '满' + editForm.full + '元可用' }}</span>
</div>
......@@ -81,8 +56,7 @@
</div>
</div>
<p class="edit-title">{{ title }}折扣券</p>
<glsx-combi-form class="edit-form-container" ref="editFormRef" :isEdit="true" :isBlock="true"
:formRef="editChildRef" :formObj="editForm" :formData="editFormData" :formRules="editRule">
<glsx-combi-form class="edit-form-container" ref="editFormRef" :isEdit="true" :isBlock="true" :formRef="editChildRef" :formObj="editForm" :formData="editFormData" :formRules="editRule">
<template slot="directionalFlagHtml">
<div>
<el-radio v-model="editForm.directionalFlag" label="1" :disabled="apear != 'couponAdd'">所有客户可用</el-radio>
......@@ -100,18 +74,13 @@
<template slot="effectiveHtml">
<el-form-item prop="effectiveTime" ref="effectiveTime" style="margin-top: 12px; display: block">
<el-radio v-model="editForm.effectiveType" label="2" :disabled="apear != 'couponAdd'" id="effectiveTime">
<el-date-picker v-model="editForm.effectiveTime" @change="haveChange" type="datetimerange"
style="width: 340px" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期"
value-format="yyyy-MM-dd HH:mm:ss" :default-time="defaultTime" :format="format"
:picker-options="pickerOption" :disabled="editForm.effectiveType != 2 || apear != 'couponAdd'"
clearable></el-date-picker>
<el-date-picker v-model="editForm.effectiveTime" @change="haveChange" type="datetimerange" style="width: 340px" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" value-format="yyyy-MM-dd HH:mm:ss" :default-time="defaultTime" :format="format" :picker-options="pickerOption" :disabled="editForm.effectiveType != 2 || apear != 'couponAdd'" clearable></el-date-picker>
</el-radio>
</el-form-item>
<el-form-item prop="effectiveDays" ref="effectiveDays" id="effectiveDays">
<el-radio v-model="editForm.effectiveType" label="1" :disabled="apear != 'couponAdd'">
领取后
<el-input v-model="editForm.effectiveDays" style="width: 100px; margin-left: 5px; margin-right: 5px"
:disabled="apear != 'couponAdd' || editForm.effectiveType != 1" />
<el-input v-model="editForm.effectiveDays" style="width: 100px; margin-left: 5px; margin-right: 5px" :disabled="apear != 'couponAdd' || editForm.effectiveType != 1" />
天内有效
</el-radio>
</el-form-item>
......@@ -121,9 +90,7 @@
<el-form-item prop="full" ref="full">
<el-radio v-model="editForm.useBarriers" label="2" :disabled="apear != 'couponAdd'">
满
<el-input v-model="editForm.full" @blur="loseFocus"
style="width: 100px; margin-left: 5px; margin-right: 5px"
:disabled="apear != 'couponAdd' || editForm.useBarriers != 2" />
<el-input v-model="editForm.full" @blur="loseFocus" style="width: 100px; margin-left: 5px; margin-right: 5px" :disabled="apear != 'couponAdd' || editForm.useBarriers != 2" />
元可用
</el-radio>
</el-form-item>
......@@ -131,14 +98,12 @@
<!-- 库存,集团版集团账号-无限制库存;其他-输入框 -->
<template slot="stock" slot-scope="scope">
<span v-if="$isGroupUp">无库存限制</span>
<el-input :disabled="apear != 'couponAdd'" v-else class="w-150" v-model="editForm[scope.scope.name]"
placeholder="请输入库存">
<el-input :disabled="apear != 'couponAdd'" v-else class="w-150" v-model="editForm[scope.scope.name]" placeholder="请输入库存">
<span slot="suffix">张</span>
</el-input>
</template>
<template slot="useDescriptionHtml">
<el-input type="textarea" v-model="editForm.useDescription" style="width: 320px"
:autosize="{ minRows: 2, maxRows: 4 }" maxlength="200" :disabled="userDisable" />
<el-input type="textarea" v-model="editForm.useDescription" :autosize="{ minRows: 2, maxRows: 4 }" maxlength="200" :disabled="userDisable" />
</template>
<template slot="editHtml">
<el-button style="margin-left: 80px" @click="editMessage">编辑</el-button>
......@@ -146,9 +111,7 @@
</glsx-combi-form>
<div v-if="$isGroupUp">
<p class="edit-title">适用门店配置</p>
<glsx-combi-form class="edit-form-container" ref="merchantRef" :isEdit="true" :isBlock="true"
:formRef="editChildRef" :formObj="editForm" :formData="merchantEditFormData" :formRules="merchantRule">
</glsx-combi-form>
<glsx-combi-form class="edit-form-container" ref="merchantRef" :isEdit="true" :isBlock="true" :formRef="editChildRef" :formObj="editForm" :formData="merchantEditFormData" :formRules="merchantRule"></glsx-combi-form>
</div>
</div>
<GLFooter>
......@@ -230,21 +193,18 @@ export default {
{
label: '优惠券名称',
name: 'couponName',
width: '320px',
type: 'input',
maxlength: 20
},
{
label: '预估成本/元',
name: 'anticipatedCost',
width: '320px',
type: 'input',
isDisabled: false
},
{
label: '优惠内容',
name: 'discountIntensity',
width: '180px',
type: 'input',
append: '折'
},
......@@ -576,9 +536,9 @@ export default {
this.cancelJump()
}
})
.finally(() => {
this.loading = false
})
.finally(() => {
this.loading = false
})
}
})
},
......
......@@ -174,14 +174,12 @@ export default {
{
label: '优惠券名称',
name: 'couponName',
width: '320px',
type: 'input',
maxlength: 20
},
{
label: '预估成本/元',
name: 'anticipatedCost',
width: '320px',
type: 'input',
isDisabled: false
},
......
......@@ -3,15 +3,15 @@
<div class="topMsg">
<p class="pageTitle">基本信息</p>
</div>
<div class="live-room container" style="padding-top: 20px;" v-loading="sloading">
<el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="120px" class="demo-ruleForm">
<el-form-item size="small" label="服务名称" prop="couponName" style="width: 440px" id="couponName">
<div class="live-room container gl-form-page" style="padding-top: 20px;" v-loading="sloading">
<el-form :model="ruleForm" :rules="rules" ref="ruleForm" :label-width="defaultLabelWidth" class="demo-ruleForm ml20">
<el-form-item size="small" label="服务名称:" prop="couponName" style="width: 440px" id="couponName">
<el-input size="small" :disabled="disabledContent" v-model.trim="ruleForm.couponName" maxlength="20" placeholder="请输入服务名称,如“精洗轿车”"></el-input>
</el-form-item>
<el-form-item size="small" label="预估成本/元" prop="anticipatedCost" style="width: 440px" id="anticipatedCost">
<el-form-item size="small" label="预估成本/元:" prop="anticipatedCost" style="width: 440px" id="anticipatedCost">
<el-input size="small" :disabled="disabledCost" v-model.trim="ruleForm.anticipatedCost" maxlength="20" placeholder="请输入预估成本"></el-input>
</el-form-item>
<el-form-item size="small" label="有效期" prop="effectiveType">
<el-form-item size="small" label="有效期:" prop="effectiveType">
<div class="radioGroupWrap">
<el-radio-group v-model="ruleForm.effectiveType" :disabled="disabledContent">
<el-radio :label="3" class="itemBlock">永久有效</el-radio>
......@@ -32,7 +32,7 @@
</el-radio-group>
</div>
</el-form-item>
<el-form-item size="small" label="使用限制" prop="customUseLimit">
<el-form-item size="small" label="使用限制:" prop="customUseLimit">
<div class="radioGroupWrap">
<el-radio-group v-model="ruleForm.customUseLimit" :disabled="disabledContent">
<el-radio :label="0" class="itemBlock">不限制使用次数</el-radio>
......@@ -60,36 +60,32 @@
</el-radio-group>
</div>
</el-form-item>
<el-form-item v-if="!$isGroupUp" size="small" label="会员价" prop="vipPrice" style="width: 315px">
<el-form-item v-if="!$isGroupUp" size="small" label="会员价:" prop="vipPrice">
<el-input size="small" :disabled="disabledContent" maxlength="8" v-model="ruleForm.vipPrice" placeholder="请输入" @keyup.native="ruleForm.vipPrice = oninput(ruleForm.vipPrice)">
<!-- <template slot="append">元</template> -->
<span slot="suffix" class="suffix-label">元</span>
</el-input>
</el-form-item>
<el-form-item v-if="!$isGroupUp" size="small" label="门店价" prop="shopPrice" style="width: 315px">
<el-form-item v-if="!$isGroupUp" size="small" label="门店价:" prop="shopPrice">
<el-input size="small" :disabled="disabledContent" maxlength="8" v-model="ruleForm.shopPrice" placeholder="请输入" @keyup.native="ruleForm.shopPrice = oninput(ruleForm.shopPrice)">
<!-- <template slot="append">元</template> -->
<span slot="suffix" class="suffix-label">元</span>
</el-input>
</el-form-item>
<!-- 库存,集团版集团账号-无限制库存;其他-输入框 -->
<el-form-item size="small" label="库存" prop="stock" style="width: 315px">
<el-form-item size="small" label="库存:" prop="stock">
<!-- <el-input size="small" :disabled="title == '查看'" maxlength="6" v-model.number="ruleForm.stock" placeholder="请输入"></el-input> -->
<span v-if="$isGroupUp">无库存限制</span>
<el-input :disabled="title == '查看'" v-else class="w-150" v-model="ruleForm.stock" placeholder="请输入库存">
<span slot="suffix">张</span>
</el-input>
</el-form-item>
<el-form-item size="small" label="使用说明" prop="useDescription" style="width: 670px">
<el-form-item size="small" label="使用说明:" prop="useDescription">
<el-input size="small" :rows="6" :disabled="disabledDescription" type="textarea" v-model="ruleForm.useDescription" placeholder="请输入" maxlength="200" show-word-limit></el-input>
</el-form-item>
<el-form-item size="small" style="margin-left: -100px" v-show="isEdit">
<el-button style="margin-left: 80px" @click="editMessage">编辑</el-button>
</el-form-item>
<!-- <el-form-item size="small">
<el-button type="primary" @click="submitForm('ruleForm')" size="small">创建</el-button>
<el-button type="primary" @click="resetForm('ruleForm')" size="small">重置</el-button>
</el-form-item> -->
</el-form>
<div class="edit-container" v-if="$isGroupUp">
......@@ -225,12 +221,6 @@ export default {
ruleForm: {
anticipatedCost: '',
couponName: '',
// region: '',
// date1: '',
// date2: '',
// delivery: false,
// type: [],
// resource: '',
effectiveType: 3, //有效期(默认永久有效)
effectiveDays: '',
customUseLimit: 0, //使用限制(默认不限制使用次数)
......@@ -248,10 +238,6 @@ export default {
rules: {
anticipatedCost: [{ required: true, message: '请输入预估成本', trigger: 'change' }],
couponName: [{ required: true, message: '请输入服务名称', trigger: 'blur' }],
// region: [{ required: true, message: '请选择活动区域', trigger: 'change' }],
// date1: [{ type: 'date', required: true, message: '请选择日期', trigger: 'change' }],
// date2: [{ type: 'date', required: true, message: '请选择时间', trigger: 'change' }],
// type: [{ type: 'array', required: true, message: '请至少选择一个活动性质', trigger: 'change' }],
effectiveType: [{ required: true, message: '请选择有效期', trigger: 'change' }],
customUseLimit: [{ required: true, message: '请选择使用限制', trigger: 'change' }],
vipPrice: [
......@@ -403,33 +389,33 @@ export default {
},
submitForm(formName) {
clearTimeout(this.timer)
this.timer = setTimeout(() => {
this.$refs[formName].validate((valid, errorObj) => {
var merchantval = true
var merchantErrorObj = []
if (this.$isGroupUp) {
this.$refs.merchantRef.$refs[this.editChildRef].validate((merchantVaild, errorObj) => {
merchantval = merchantVaild
merchantErrorObj = errorObj
})
}
if (!valid) {
this.whereToGo(Object.keys(errorObj)[0])
} else if (!merchantval) {
this.whereToGo(Object.keys(merchantErrorObj)[0])
}
if (valid && merchantval) {
if (this.isEdit == true) {
this.updateService()
clearTimeout(this.timer)
this.timer = setTimeout(() => {
this.$refs[formName].validate((valid, errorObj) => {
var merchantval = true
var merchantErrorObj = []
if (this.$isGroupUp) {
this.$refs.merchantRef.$refs[this.editChildRef].validate((merchantVaild, errorObj) => {
merchantval = merchantVaild
merchantErrorObj = errorObj
})
}
if (!valid) {
this.whereToGo(Object.keys(errorObj)[0])
} else if (!merchantval) {
this.whereToGo(Object.keys(merchantErrorObj)[0])
}
if (valid && merchantval) {
if (this.isEdit == true) {
this.updateService()
} else {
this.createService()
}
} else {
this.createService()
return false
}
} else {
return false
}
})
},500)
})
}, 500)
},
//创建服务
createService() {
......@@ -636,7 +622,7 @@ export default {
.radioGroupWrap {
width: 550px;
height: 164px;
background-color: #f4f6fc;
background-color: #f9f9f9;
padding-top: 10px;
padding-left: 20px;
}
......
......@@ -26,11 +26,11 @@
<span class="cursor-pointer" @click="orderCodeHandleDetail(scope.scope)" v-else>{{ scope.scope.orderCode }}</span>
</span>
</GLTable>
<GLDialog mode="small" :visible.sync="isDialogVisible" @onCancel="handleClose" @onOk="handleConfirm">
<GLDialog mode="mid" :visible.sync="isDialogVisible" @onCancel="handleClose" @onOk="handleConfirm">
<div slot="title">优惠券核销(请确保用户到店后核销,避免引起不必要问题)</div>
<div class="small-content">
<el-form :rules="rules" ref="ruleForm" :model="ruleForm" label-width="80px">
<el-form-item size="small" label="核销码" prop="verficationCode" style="width: 380px">
<div class="gl-form-page m-t-20">
<el-form :rules="rules" ref="ruleForm" :model="ruleForm" :label-width="defaultLabelWidth">
<el-form-item size="small" label="核销码:" prop="verficationCode">
<el-input size="small" v-model.trim="ruleForm.verficationCode" maxlength="50" placeholder="请输入核销码"></el-input>
</el-form-item>
</el-form>
......
......@@ -52,17 +52,23 @@
<el-radio :disabled="routeInfo.receivedStock" v-model="editForm.approveFlag" :label="2">无需审批</el-radio>
<p class="approval-tip">无需审批,可直接赠送给客户</p>
</div>
<div v-if="editForm.receiveRule === 1 || editForm.receiveRule === 4" class="telArea" slot="configSlot">
<label class="receiving" for="" v-show="editForm.receiveRule !== 4">领取条件:</label>
<label class="receiving" for="" v-show="editForm.receiveRule === 4">用户手机号:</label>
<div v-if="editForm.receiveRule === 1 || editForm.receiveRule === 4" class="telArea form-sub-block" slot="configSlot">
<label class="receiving" :style="{ width: defaultLabelWidth }" for="" v-show="editForm.receiveRule !== 4">
<span class="txt-red">*</span>
领取条件:
</label>
<label class="receiving" :style="{ width: defaultLabelWidth }" for="" v-show="editForm.receiveRule === 4">
<span class="txt-red">*</span>
用户手机号:
</label>
<el-radio-group v-if="editForm.receiveRule !== 4" @change="resetTextArea" v-model="receiveWay">
<el-radio :label="1">指定手机号</el-radio>
<el-radio :label="2">指定车架号后6位</el-radio>
</el-radio-group>
<div style="margin-left:70px;width: calc(100% - 70px);">
<div :style="{ 'margin-left': defaultLabelWidth }">
<el-input :style="editForm.receiveRule === 4?'margin-top: -22px;margin-left: 8px;':''" @blur="formatPhone" type="textarea" v-model="phone" :placeholder="placeholder"></el-input>
<span v-if="editForm.receiveRule !== 4" class="approval-tip" style="margin-left:0;">客户需准确输入该{{ receiveWay == 1 ? '手机号码' : '车架号后6位' }}才能成功领取</span>
<div :style="editForm.receiveRule === 4?'margin-left: 7px;':''">
<p v-if="editForm.receiveRule !== 4" class="approval-tip">客户需准确输入该{{ receiveWay == 1 ? '手机号码' : '车架号后6位' }}才能成功领取</p>
<div :style="editForm.receiveRule === 4 ? 'margin-left: 7px;' : ''">
<div :class="['tel-item', !item.valid ? 'valid-tel': receiveWay == 1?'realTel':'realNum']" v-for="(item, index) in phoneList" :key="index">
{{ item.tel }}
<i style="cursor:pointer" class="el-icon-close" @click="delPhone(item.tel)"></i>
......@@ -72,22 +78,22 @@
</div>
<span slot="bubble">
<el-popover placement="top-start" width="200" trigger="hover" content="创建礼包时指定好领取条件,客户需正确输入领取条件方可成功领取">
<i slot="reference" class="el-icon-question" style="color: #C6C6C6;"></i>
<i slot="reference" class="el-icon-question" style="color: #C6C6C6;"></i>
</el-popover>
</span>
<span slot="giveAway">
<el-popover placement="top-start" width="200" trigger="hover" content="员工在每次发送礼包给客户之前,需设置好领取条件,客户需正确输入领取条件方可成功领取">
<i slot="reference" class="el-icon-question" style="color: #C6C6C6;"></i>
<i slot="reference" class="el-icon-question" style="color: #C6C6C6;"></i>
</el-popover>
</span>
<span slot="receives">
<el-popover placement="top-start" width="200" trigger="hover" content="客户无需输入任何领取条件,即可直接领取礼包">
<i slot="reference" class="el-icon-question" style="color: #C6C6C6;"></i>
<i slot="reference" class="el-icon-question" style="color: #C6C6C6;"></i>
</el-popover>
</span>
<span slot="cardHolder">
<el-popover placement="top-start" width="200" trigger="hover" content="将根据手机号直接发送至小程序客户的卡包当中,客户无需领取">
<i slot="reference" class="el-icon-question" style="color: #C6C6C6;"></i>
<i slot="reference" class="el-icon-question" style="color: #C6C6C6;"></i>
</el-popover>
</span>
<!-- <div slot="receiveDetails" class="edit-tips m-t-8">客户需要输入该{{ editForm.receiveWay == '1' ? '手机号' : '车架号后6位' }}才能成功领取</div> -->
......@@ -133,7 +139,7 @@ export default {
return {
phone: '',
isLoaded: true,
loading:false,
loading: false,
phoneList: [],
size: 'small',
title: '新增礼包',
......@@ -321,7 +327,7 @@ export default {
],
suffixSlot: 'configSlot',
handleRadioChange: (e) => {
if(e==4){
if (e == 4) {
this.receiveWay = 1
}
this.resetTextArea()
......@@ -411,16 +417,16 @@ export default {
}
},
'editForm.receiveRule'(newValue) {
let idx = this.editFormData.findIndex(item => item.name == 'staffList')
let idxx = this.editFormData.findIndex(item => item.name == 'approveFlag')
let idxxx = this.editFormData.findIndex(item => item.name == 'stock')
this.editFormData[idx].isHide = newValue == 4
this.editFormData[idxx].isHide = newValue == 4
this.editFormData[idxxx].isHide = newValue == 4
if(newValue == 4) {
this.editForm.staffList = []
this.editForm.stock = 1
}
let idx = this.editFormData.findIndex(item => item.name == 'staffList')
let idxx = this.editFormData.findIndex(item => item.name == 'approveFlag')
let idxxx = this.editFormData.findIndex(item => item.name == 'stock')
this.editFormData[idx].isHide = newValue == 4
this.editFormData[idxx].isHide = newValue == 4
this.editFormData[idxxx].isHide = newValue == 4
if (newValue == 4) {
this.editForm.staffList = []
this.editForm.stock = 1
}
},
},
computed: {
......@@ -457,7 +463,7 @@ export default {
delPhone(val) {
let phone = '\n' + this.phone + '\n'
phone = phone.replace(/[\n]/g, '\n\n')
phone = phone.replace(new RegExp('[\n]'+ val + '[\n]', 'g'), '\n')
phone = phone.replace(new RegExp('[\n]' + val + '[\n]', 'g'), '\n')
phone = phone.replace(/[\n]+/g, '\n')
phone = phone.replace(/^[\n]+/, '')
this.phone = phone
......@@ -637,7 +643,7 @@ export default {
if (this.editForm.receiveRule == 1 || this.editForm.receiveRule == 4) {
params.receiveDetailList = this.phoneList.map(item => item.tel)
let maxLength = 500
if(params.receiveDetailList && params.receiveDetailList.length > maxLength){
if (params.receiveDetailList && params.receiveDetailList.length > maxLength) {
return this.$message.error(`领取${this.receiveWay == 1 ? '手机号' : '车架号'}不能超过${maxLength}个`)
}
params.receiveWay = this.receiveWay
......@@ -655,11 +661,11 @@ export default {
params.requestSource = 1
// 插入判断是否存在审批模板
// const { session } = this.$globalState
if(this.editForm.receiveRule == 1 || this.editForm.receiveRule == 4){
if(!((this.editForm.receiveRule == 1 || this.editForm.receiveRule == 4) && params.receiveDetailList && params.receiveDetailList.length)) {
return this.$message.error(`${this.editForm.receiveRule == 1 ? '领取条件不能为空!':'用户手机号不能为空!'}`)
}
}
if (this.editForm.receiveRule == 1 || this.editForm.receiveRule == 4) {
if (!((this.editForm.receiveRule == 1 || this.editForm.receiveRule == 4) && params.receiveDetailList && params.receiveDetailList.length)) {
return this.$message.error(`${this.editForm.receiveRule == 1 ? '领取条件不能为空!' : '用户手机号不能为空!'}`)
}
}
this.insertHttp(params)
// this.$apis.giftBag.templateModal({ merchantId: session.merchantId }).then(result => {
// if (result.data && (!this.isChangeCoupons || !this.isChangePeople)) {
......@@ -688,7 +694,7 @@ export default {
text: '正在Loading···',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.5)',
customClass:'loadingClass'
customClass: 'loadingClass'
})
this.$apis.giftBag
.insertGiftApi(params)
......@@ -721,7 +727,7 @@ export default {
.then(() => {
this.cancelJump()
})
.catch(() => {})
.catch(() => { })
} else {
this.cancelJump()
}
......@@ -767,21 +773,23 @@ export default {
font-weight: 400;
color: #999999;
line-height: 12px;
margin-left: 24px;
margin-top: 10px;
}
.telArea {
width: 713px;
background: #f9f9f9;
padding: 10px 20px;
// width: 713px;
// background: #f9f9f9;
// padding: 10px 20px;
.receiving {
display: inline-block;
color: #666;
width: 70px;
// width: 70px;
position: relative;
&::before {
content: '*';
text-align: right;
.txt-red {
// content: '*';
color: #f56c6c;
left: -10px;
position: absolute;
// left: -10px;
// position: absolute;
}
}
.el-textarea__inner {
......@@ -806,10 +814,10 @@ export default {
border: 1px solid #ffa39e;
color: #ff4d4f;
}
.realTel{
.realTel {
width: 130px;
}
.realNum{
.realNum {
width: 90px;
}
}
......
......@@ -3,11 +3,11 @@
<div class="edit-car marketing edit-box">
<div class="container edit-container">
<p class="edit-title">{{ title }}</p>
<glsx-combi-form class="edit-form-container m-r-20" ref="editFormRef" :isEdit="isEdit" :labelWidth="labelWidth" :isBlock="true" :formRef="editChildRef" :formObj="editForm" :formData="editFormData" :formRules="editRule">
<glsx-combi-form class="edit-form-container m-r-20" ref="editFormRef" :isEdit="isEdit" :labelWidth="defaultLabelWidth" :isBlock="true" :formRef="editChildRef" :formObj="editForm" :formData="editFormData" :formRules="editRule">
<div slot="selectMerchant" slot-scope="scope" class="select-merchant">
<el-button type="default" @click="handleRelateStoreClose(scope)">{{ editForm.merchantList.length ? '更换门店' : '+选择门店' }}</el-button>
</div>
<div slot="merchantTable" :style="{ 'margin-left': labelWidth, width: `calc(100% - ${labelWidth} )` }">
<div slot="merchantTable" :style="{ 'margin-left': defaultLabelWidth, width: `calc(100% - ${defaultLabelWidth} )` }">
<GLTable v-show="editForm.merchantList.length" ref="warehousListRef" :hasPage="false" :tableParams="tableParams" :tableData="editForm.merchantList">
<span slot="auth-button" slot-scope="scope">
<el-button type="text" @click="handleMerchantDelete(scope)">删除</el-button>
......@@ -58,7 +58,6 @@ export default {
id: ''
},
editStatus: false,
labelWidth: '144px',
editForm: {
// 专区类型(1发现频道,2商城专区)
zoneType: '2',
......
......@@ -61,11 +61,11 @@
</div>
<!-- 快递信息 -->
<GLDialog v-if="isExpressVisible" title="输入快递信息" mode="mid" okText="确定" cancelText="取消" :visible.sync="isExpressVisible" @onOk="handleExpressConfirm" @onCancel="handleExpressClose">
<glsx-combi-form class="small-content m-t-20" ref="expressRef" :isBlock="true" :isEdit="isEdit" :formRef="editChildRef" :formObj="expressForm" :formData="expressFormData" :formRules="expressRules"></glsx-combi-form>
<glsx-combi-form class="small-content m-t-20" ref="expressRef" :isBlock="true" defaultWidth="284px" :isEdit="isEdit" :formRef="editChildRef" :formObj="expressForm" :formData="expressFormData" :formRules="expressRules"></glsx-combi-form>
</GLDialog>
<!-- 订单核销 -->
<GLDialog v-if="isWriteOffVisible" title="订单核销(请确保用户到店后核销,避免引起不必要问题)" mode="mid" okText="确定" cancelText="取消" :visible.sync="isWriteOffVisible" @onOk="handleWriteOffConfirm" @onCancel="handleWriteOffClose">
<glsx-combi-form class="small-content m-t-20" ref="writeOffRef" :isBlock="true" :formRef="editChildRef" :formObj="writeOffForm" :formData="writeOffFormData" :formRules="writeOffRules"></glsx-combi-form>
<glsx-combi-form class="small-content m-t-20" ref="writeOffRef" :isBlock="true" defaultWidth="284px" :formRef="editChildRef" :formObj="writeOffForm" :formData="writeOffFormData" :formRules="writeOffRules"></glsx-combi-form>
</GLDialog>
<!-- 退款审核 -->
<GLDialog v-if="isExamineVisible" bigTitle="退款审核" mode="big" :visible.sync="isExamineVisible" @onOk="handleExamineConfirm" @onCancel="handleExamineClose">
......
......@@ -15,10 +15,10 @@
<img class="img-60" :src="selectedProInfo.goodsImage" />
&nbsp;&nbsp;&nbsp; 零售价 {{ (selectedProInfo.retailPrice / 100).toFixed(2) }}元 &nbsp;&nbsp;&nbsp; 商品库存 {{ selectedProInfo.goodsStock }}件
</p>
<el-form-item label="设置秒杀价" prop="activityPrice">
<el-form-item label="设置秒杀价:" prop="activityPrice">
<el-input v-model="editForm.activityPrice" style="width: 150px" :disabled="isDisabled"><span slot="append">元</span></el-input>
</el-form-item>
<el-form-item label="活动库存" prop="goodsStock">
<el-form-item label="活动库存:" prop="goodsStock">
<el-input v-model="editForm.goodsStock" style="width: 150px" :disabled="isDisabled"><span slot="append">件</span></el-input>
</el-form-item>
</div>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!