|
@@ -143,15 +143,6 @@
|
|
|
padding-left: 10px;
|
|
padding-left: 10px;
|
|
|
line-height: 30px;
|
|
line-height: 30px;
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
- .level-ratio-table {
|
|
|
|
|
- margin-top: 15px;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- .level-ratio-table .layui-input {
|
|
|
|
|
- width: 100px;
|
|
|
|
|
- text-align: center;
|
|
|
|
|
- }
|
|
|
|
|
</style>
|
|
</style>
|
|
|
</head>
|
|
</head>
|
|
|
<body>
|
|
<body>
|
|
@@ -639,21 +630,6 @@
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
- <div class="layui-col-xs12 layui-col-sm6 layui-col-md6">
|
|
|
|
|
- <div class="grid-demo grid-demo-bg1">
|
|
|
|
|
- <div class="layui-form-item">
|
|
|
|
|
- <label class="layui-form-label">门店选择<i class="red">*</i></label>
|
|
|
|
|
- <div class="layui-input-block">
|
|
|
|
|
- <select name="mer_id" lay-filter="mer_id">
|
|
|
|
|
- <option value="0">请选择</option>
|
|
|
|
|
- <option :value="item.id" v-for="item in merList"
|
|
|
|
|
- :selected=" item.id == formData.mer_id ? true : false ">{{item.store_name}}</option>
|
|
|
|
|
- </select>
|
|
|
|
|
- </div>
|
|
|
|
|
- </div>
|
|
|
|
|
- </div>
|
|
|
|
|
- </div>
|
|
|
|
|
-
|
|
|
|
|
<div class="layui-row layui-col-space15">
|
|
<div class="layui-row layui-col-space15">
|
|
|
<div class="layui-col-xs12 layui-col-sm4 layui-col-md4">
|
|
<div class="layui-col-xs12 layui-col-sm4 layui-col-md4">
|
|
|
<div class="grid-demo grid-demo-bg1">
|
|
<div class="grid-demo grid-demo-bg1">
|
|
@@ -695,12 +671,11 @@
|
|
|
<div class="layui-col-xs12 layui-col-sm4 layui-col-md4">
|
|
<div class="layui-col-xs12 layui-col-sm4 layui-col-md4">
|
|
|
<div class="grid-demo grid-demo-bg1">
|
|
<div class="grid-demo grid-demo-bg1">
|
|
|
<div class="layui-form-item">
|
|
<div class="layui-form-item">
|
|
|
- <label class="layui-form-label">返利积分比例(%)</label>
|
|
|
|
|
|
|
+ <label class="layui-form-label">赠送积分</label>
|
|
|
<div class="layui-input-block">
|
|
<div class="layui-input-block">
|
|
|
- <input type="number" name="rebate_ratio" lay-verify="title"
|
|
|
|
|
- autocomplete="off"
|
|
|
|
|
- placeholder="请输入返利点数" class="layui-input"
|
|
|
|
|
- v-model="formData.rebate_ratio">
|
|
|
|
|
|
|
+ <input type="number" name="give_integral" lay-verify="title"
|
|
|
|
|
+ autocomplete="off" placeholder="请输入赠送积分" class="layui-input"
|
|
|
|
|
+ v-model="formData.give_integral">
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
@@ -708,89 +683,164 @@
|
|
|
<div class="layui-col-xs12 layui-col-sm4 layui-col-md4">
|
|
<div class="layui-col-xs12 layui-col-sm4 layui-col-md4">
|
|
|
<div class="grid-demo grid-demo-bg1">
|
|
<div class="grid-demo grid-demo-bg1">
|
|
|
<div class="layui-form-item">
|
|
<div class="layui-form-item">
|
|
|
- <label class="layui-form-label">赠送积分</label>
|
|
|
|
|
|
|
+ <label class="layui-form-label">排序</label>
|
|
|
<div class="layui-input-block">
|
|
<div class="layui-input-block">
|
|
|
- <input type="number" name="give_integral" lay-verify="title"
|
|
|
|
|
- autocomplete="off" placeholder="请输入赠送积分" class="layui-input"
|
|
|
|
|
- v-model="formData.give_integral">
|
|
|
|
|
|
|
+ <input type="number" name="sort" lay-verify="title"
|
|
|
|
|
+ autocomplete="off"
|
|
|
|
|
+ placeholder="请输入排序" class="layui-input"
|
|
|
|
|
+ v-model="formData.sort">
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
-
|
|
|
|
|
- <!-- 等级返利设置 -->
|
|
|
|
|
<div class="layui-col-xs12 layui-col-sm12 layui-col-md12">
|
|
<div class="layui-col-xs12 layui-col-sm12 layui-col-md12">
|
|
|
<div class="grid-demo grid-demo-bg1">
|
|
<div class="grid-demo grid-demo-bg1">
|
|
|
<div class="layui-form-item">
|
|
<div class="layui-form-item">
|
|
|
- <label class="layui-form-label">等级返利比例(%)</label>
|
|
|
|
|
|
|
+ <label class="layui-form-label">佣金设置</label>
|
|
|
<div class="layui-input-block">
|
|
<div class="layui-input-block">
|
|
|
- <div class="level-ratio-table">
|
|
|
|
|
- <table class="layui-table">
|
|
|
|
|
- <thead>
|
|
|
|
|
- <tr>
|
|
|
|
|
- <th width="20%">等级名称</th>
|
|
|
|
|
- <th width="16%">青源客</th>
|
|
|
|
|
- <th width="16%">青润使</th>
|
|
|
|
|
- <th width="16%">青金团</th>
|
|
|
|
|
- <th width="16%">青玉团</th>
|
|
|
|
|
- <th width="16%">青谷团</th>
|
|
|
|
|
- </tr>
|
|
|
|
|
- </thead>
|
|
|
|
|
- <tbody>
|
|
|
|
|
- <tr>
|
|
|
|
|
- <td>返利比例(%)</td>
|
|
|
|
|
- <td><input type="number" v-model="level_radio[0].ratio" class="layui-input"
|
|
|
|
|
- placeholder="请输入" step="0.01" min="0" max="100"></td>
|
|
|
|
|
- <td><input type="number" v-model="level_radio[1].ratio" class="layui-input"
|
|
|
|
|
- placeholder="请输入" step="0.01" min="0" max="100"></td>
|
|
|
|
|
- <td><input type="number" v-model="level_radio[2].ratio" class="layui-input"
|
|
|
|
|
- placeholder="请输入" step="0.01" min="0" max="100"></td>
|
|
|
|
|
- <td><input type="number" v-model="level_radio[3].ratio" class="layui-input"
|
|
|
|
|
- placeholder="请输入" step="0.01" min="0" max="100"></td>
|
|
|
|
|
- <td><input type="number" v-model="level_radio[4].ratio" class="layui-input"
|
|
|
|
|
- placeholder="请输入" step="0.01" min="0" max="100"></td>
|
|
|
|
|
- </tr>
|
|
|
|
|
- </tbody>
|
|
|
|
|
- </table>
|
|
|
|
|
- <span class="info">设置每个等级对应的返利百分比(0-100之间)</span>
|
|
|
|
|
- </div>
|
|
|
|
|
|
|
+ <input type="radio" name="is_sub" lay-filter="is_sub" value="1"
|
|
|
|
|
+ title="单独设置"
|
|
|
|
|
+ :checked="formData.is_sub == 1 ? true : false">
|
|
|
|
|
+ <input type="radio" name="is_sub" lay-filter="is_sub" value="0"
|
|
|
|
|
+ title="默认设置"
|
|
|
|
|
+ :checked="formData.is_sub == 0 ? true : false">
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
-
|
|
|
|
|
- <div class="layui-col-xs12 layui-col-sm4 layui-col-md4">
|
|
|
|
|
|
|
+ <div class="layui-col-xs12 layui-col-sm12 layui-col-md12"
|
|
|
|
|
+ v-if="formData.is_sub == 1 && formData.spec_type == 1">
|
|
|
<div class="grid-demo grid-demo-bg1">
|
|
<div class="grid-demo grid-demo-bg1">
|
|
|
<div class="layui-form-item">
|
|
<div class="layui-form-item">
|
|
|
- <label class="layui-form-label">排序</label>
|
|
|
|
|
|
|
+ <label class="layui-form-label">批量设置</label>
|
|
|
<div class="layui-input-block">
|
|
<div class="layui-input-block">
|
|
|
- <input type="number" name="sort" lay-verify="title"
|
|
|
|
|
- autocomplete="off"
|
|
|
|
|
- placeholder="请输入排序" class="layui-input"
|
|
|
|
|
- v-model="formData.sort">
|
|
|
|
|
|
|
+ <input style="width: 20%;display: inline-block;" type="number"
|
|
|
|
|
+ name="brokerage" lay-verify="title" autocomplete="off"
|
|
|
|
|
+ placeholder="请输入一级返佣" class="layui-input"
|
|
|
|
|
+ v-model="brokerage.brokerage">
|
|
|
|
|
+ <input style="width: 20%;display: inline-block;" type="number"
|
|
|
|
|
+ name="brokerage_two" lay-verify="title" autocomplete="off"
|
|
|
|
|
+ placeholder="请输入二级返佣" class="layui-input"
|
|
|
|
|
+ v-model="brokerage.brokerage_two">
|
|
|
|
|
+ <button class="layui-btn layui-btn-sm" style="height: 38px;"
|
|
|
|
|
+ type="button"
|
|
|
|
|
+ @click="addBrokerage">批量设置
|
|
|
|
|
+ </button>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
-
|
|
|
|
|
- <!-- 佣金设置部分已经注释掉 -->
|
|
|
|
|
- <div class="layui-col-xs12 layui-col-sm12 layui-col-md12">
|
|
|
|
|
|
|
+ <!-- 单属性-->
|
|
|
|
|
+ <div class="layui-col-xs12 layui-col-sm12 layui-col-md12"
|
|
|
|
|
+ v-if="formData.spec_type == 0 && formData.is_sub == 1">
|
|
|
<div class="grid-demo grid-demo-bg1">
|
|
<div class="grid-demo grid-demo-bg1">
|
|
|
<div class="layui-form-item">
|
|
<div class="layui-form-item">
|
|
|
- <!-- <label class="layui-form-label">佣金设置</label>-->
|
|
|
|
|
- <!-- <div class="layui-input-block">-->
|
|
|
|
|
- <!-- <input type="radio" name="is_sub" lay-filter="is_sub" value="1"-->
|
|
|
|
|
- <!-- title="单独设置"-->
|
|
|
|
|
- <!-- :checked="formData.is_sub == 1 ? true : false">-->
|
|
|
|
|
- <!-- <input type="radio" name="is_sub" lay-filter="is_sub" value="0"-->
|
|
|
|
|
- <!-- title="默认设置"-->
|
|
|
|
|
- <!-- :checked="formData.is_sub == 0 ? true : false">-->
|
|
|
|
|
- <!-- </div>-->
|
|
|
|
|
|
|
+ <label class="layui-form-label">商品属性:</label>
|
|
|
|
|
+ <div class="layui-input-block">
|
|
|
|
|
+ <table class="layui-table">
|
|
|
|
|
+ <thead>
|
|
|
|
|
+ <tr>
|
|
|
|
|
+ <th>图片</th>
|
|
|
|
|
+ <th>售价</th>
|
|
|
|
|
+ <th>积分</th>
|
|
|
|
|
+ <th>成本价</th>
|
|
|
|
|
+ <th>原价</th>
|
|
|
|
|
+ <th>库存</th>
|
|
|
|
|
+ <th>产品编号</th>
|
|
|
|
|
+ <th>重量</th>
|
|
|
|
|
+ <th>体积</th>
|
|
|
|
|
+ <th>一级返佣</th>
|
|
|
|
|
+ <th>二级返佣</th>
|
|
|
|
|
+ </tr>
|
|
|
|
|
+ </thead>
|
|
|
|
|
+ <tr>
|
|
|
|
|
+ <td>
|
|
|
|
|
+ <div class="pictrueBox">
|
|
|
|
|
+ <div class="pictrue" v-if="formData.attr.pic">
|
|
|
|
|
+ <img :src="formData.attr.pic">
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </td>
|
|
|
|
|
+ <td>{{formData.attr.price}}</td>
|
|
|
|
|
+ <td>{{formData.attr.integral}}</td>
|
|
|
|
|
+ <td>{{formData.attr.cost}}</td>
|
|
|
|
|
+ <td>{{formData.attr.ot_price}}</td>
|
|
|
|
|
+ <td>{{formData.attr.stock}}</td>
|
|
|
|
|
+ <td>{{formData.attr.bar_code}}</td>
|
|
|
|
|
+ <td>{{formData.attr.weight}}</td>
|
|
|
|
|
+ <td>{{formData.attr.volume}}</td>
|
|
|
|
|
+ <td><input type="text" v-model="formData.attr.brokerage"
|
|
|
|
|
+ class="layui-input"></td>
|
|
|
|
|
+ <td><input type="text" v-model="formData.attr.brokerage_two"
|
|
|
|
|
+ class="layui-input"></td>
|
|
|
|
|
+ </tr>
|
|
|
|
|
+ </table>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <!-- 单属性结束-->
|
|
|
|
|
+ <!-- 多属性-->
|
|
|
|
|
+ <div class="layui-col-xs12 layui-col-sm12 layui-col-md12"
|
|
|
|
|
+ v-if="formData.attrs.length && formHeader.length && formData.is_sub == 1 && formData.spec_type == 1">
|
|
|
|
|
+ <div class="grid-demo grid-demo-bg1" style="margin-top: 20px">
|
|
|
|
|
+ <div class="layui-form-item">
|
|
|
|
|
+ <label class="layui-form-label">商品属性:</label>
|
|
|
|
|
+ <div class="layui-input-block">
|
|
|
|
|
+ <table class="layui-table">
|
|
|
|
|
+ <thead>
|
|
|
|
|
+ <tr>
|
|
|
|
|
+ <th v-for="(item,index) in formHeader"
|
|
|
|
|
+ v-if="item.slot != 'action'">
|
|
|
|
|
+ {{item.title}}
|
|
|
|
|
+ </th>
|
|
|
|
|
+ </tr>
|
|
|
|
|
+ </thead>
|
|
|
|
|
+ <tr v-for="(item,index) in formData.attrs">
|
|
|
|
|
+ <td v-for="(n,v) in item.detail">{{n}}</td>
|
|
|
|
|
+ <td>
|
|
|
|
|
+ <div class="pictrueBox">
|
|
|
|
|
+ <div class="pictrue" v-if="item.pic"><img
|
|
|
|
|
+ :src="item.pic"></div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </td>
|
|
|
|
|
+ <td>{{item.price}}</td>
|
|
|
|
|
+ <td>{{item.integral}}</td>
|
|
|
|
|
+ <td>{{item.cost}}</td>
|
|
|
|
|
+ <td>{{item.ot_price}}</td>
|
|
|
|
|
+ <td>{{item.stock}}</td>
|
|
|
|
|
+ <td>{{item.bar_code}}</td>
|
|
|
|
|
+ <td>{{item.weight}}</td>
|
|
|
|
|
+ <td>{{item.volume}}</td>
|
|
|
|
|
+ <td>
|
|
|
|
|
+ <input type="number" v-model="item.brokerage"
|
|
|
|
|
+ class="layui-input">
|
|
|
|
|
+ </td>
|
|
|
|
|
+ <td>
|
|
|
|
|
+ <input type="number" v-model="item.brokerage_two"
|
|
|
|
|
+ class="layui-input">
|
|
|
|
|
+ </td>
|
|
|
|
|
+ </tr>
|
|
|
|
|
+ </table>
|
|
|
|
|
+ </div>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
+ <!--多属性结束-->
|
|
|
|
|
|
|
|
- <!-- 其他设置保持原样 -->
|
|
|
|
|
|
|
+ <!-- <div class="layui-col-xs12 layui-col-sm4 layui-col-md4">-->
|
|
|
|
|
+ <!-- <div class="grid-demo grid-demo-bg1">-->
|
|
|
|
|
+ <!-- <div class="layui-form-item">-->
|
|
|
|
|
+ <!-- <label class="layui-form-label">商品状态</label>-->
|
|
|
|
|
+ <!-- <div class="layui-input-block">-->
|
|
|
|
|
+ <!-- <input type="radio" name="is_show" lay-filter="is_show" value="1" title="上架"-->
|
|
|
|
|
+ <!-- :checked="formData.is_show == 1 ? true : false">-->
|
|
|
|
|
+ <!-- <input type="radio" name="is_show" lay-filter="is_show" value="0" title="下架"-->
|
|
|
|
|
+ <!-- :checked="formData.is_show == 0 ? true : false">-->
|
|
|
|
|
+ <!-- </div>-->
|
|
|
|
|
+ <!-- </div>-->
|
|
|
|
|
+ <!-- </div>-->
|
|
|
|
|
+ <!-- </div>-->
|
|
|
<div class="layui-col-xs12 layui-col-sm4 layui-col-md4">
|
|
<div class="layui-col-xs12 layui-col-sm4 layui-col-md4">
|
|
|
<div class="grid-demo grid-demo-bg1">
|
|
<div class="grid-demo grid-demo-bg1">
|
|
|
<div class="layui-form-item">
|
|
<div class="layui-form-item">
|
|
@@ -866,17 +916,24 @@
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
- <div class="layui-col-xs12 layui-col-sm4 layui-col-md4">
|
|
|
|
|
- <div class="grid-demo grid-demo-bg1">
|
|
|
|
|
- <div class="layui-form-item">
|
|
|
|
|
- <label class="layui-form-label">批发商品</label>
|
|
|
|
|
- <div class="layui-input-block">
|
|
|
|
|
- <input type="radio" name="is_wholesale" lay-filter="is_wholesale" value="1"
|
|
|
|
|
- title="开启"
|
|
|
|
|
- :checked="formData.is_wholesale == 1 ? true : false">
|
|
|
|
|
- <input type="radio" name="is_wholesale" lay-filter="is_wholesale" value="0"
|
|
|
|
|
- title="关闭"
|
|
|
|
|
- :checked="formData.is_wholesale == 0 ? true : false">
|
|
|
|
|
|
|
+ <div class="layui-row layui-col-space15">
|
|
|
|
|
+ <div class="layui-col-xs12 layui-col-sm12 layui-col-md12">
|
|
|
|
|
+ <div class="grid-demo grid-demo-bg1">
|
|
|
|
|
+ <div class="layui-form-item">
|
|
|
|
|
+ <label class="layui-form-label">活动优先级</label>
|
|
|
|
|
+ <div class="layui-input-block">
|
|
|
|
|
+ <span class="layui-btn layui-btn-sm layui-btn-normal"
|
|
|
|
|
+ :style="'background-color:'+activity[item]"
|
|
|
|
|
+ v-for="(item,index) in formData.activity" :key="index"
|
|
|
|
|
+ draggable="true"
|
|
|
|
|
+ @dragstart="handleDragStart($event, item)"
|
|
|
|
|
+ @dragover.prevent="handleDragOver($event, item)"
|
|
|
|
|
+ @dragenter="handleDragEnter($event, item)"
|
|
|
|
|
+ @dragend="handleDragEnd($event, item)">
|
|
|
|
|
+ {{item}}
|
|
|
|
|
+ </span>
|
|
|
|
|
+ <span class="info">可拖动按钮调整活动的优先展示顺序</span>
|
|
|
|
|
+ </div>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
@@ -930,15 +987,12 @@
|
|
|
cateList: [],
|
|
cateList: [],
|
|
|
//运费模板
|
|
//运费模板
|
|
|
tempList: [],
|
|
tempList: [],
|
|
|
- //门店
|
|
|
|
|
- merList: [],
|
|
|
|
|
upload: {
|
|
upload: {
|
|
|
videoIng: false
|
|
videoIng: false
|
|
|
},
|
|
},
|
|
|
formData: {
|
|
formData: {
|
|
|
cate_id: [],
|
|
cate_id: [],
|
|
|
temp_id: 0,
|
|
temp_id: 0,
|
|
|
- mer_id: 0,
|
|
|
|
|
commission: 0,
|
|
commission: 0,
|
|
|
store_name: '',
|
|
store_name: '',
|
|
|
keyword: '',
|
|
keyword: '',
|
|
@@ -966,7 +1020,6 @@
|
|
|
attrs: [],
|
|
attrs: [],
|
|
|
description: '',
|
|
description: '',
|
|
|
ficti: 0,
|
|
ficti: 0,
|
|
|
- rebate_ratio: 0,
|
|
|
|
|
give_integral: 0,
|
|
give_integral: 0,
|
|
|
sort: 0,
|
|
sort: 0,
|
|
|
is_show: 1,
|
|
is_show: 1,
|
|
@@ -974,7 +1027,6 @@
|
|
|
is_benefit: 0,
|
|
is_benefit: 0,
|
|
|
is_best: 0,
|
|
is_best: 0,
|
|
|
is_new: 0,
|
|
is_new: 0,
|
|
|
- is_wholesale: 0,
|
|
|
|
|
is_good: 0,
|
|
is_good: 0,
|
|
|
store_type: 1,
|
|
store_type: 1,
|
|
|
is_sub: 0,
|
|
is_sub: 0,
|
|
@@ -1015,7 +1067,7 @@
|
|
|
activity: {'秒杀': '#1E9FFF', '砍价': '#189688', '拼团': '#FEB900'},
|
|
activity: {'秒杀': '#1E9FFF', '砍价': '#189688', '拼团': '#FEB900'},
|
|
|
attr: [],//临时属性
|
|
attr: [],//临时属性
|
|
|
newRule: false,//是否添加新规则
|
|
newRule: false,//是否添加新规则
|
|
|
- radioRule: ['store_type', 'is_sub', 'is_show', 'is_hot', 'is_benefit', 'is_new', 'is_good', 'is_best','is_wholesale', 'spec_type'],//radio 当选规则
|
|
|
|
|
|
|
+ radioRule: ['store_type', 'is_sub', 'is_show', 'is_hot', 'is_benefit', 'is_new', 'is_good', 'is_best', 'spec_type'],//radio 当选规则
|
|
|
rule: { //多图选择规则
|
|
rule: { //多图选择规则
|
|
|
slider_image: {
|
|
slider_image: {
|
|
|
maxLength: 5
|
|
maxLength: 5
|
|
@@ -1028,14 +1080,6 @@
|
|
|
form: null,//layui.form
|
|
form: null,//layui.form
|
|
|
layTabId: 1,
|
|
layTabId: 1,
|
|
|
ruleBool: id ? true : false,
|
|
ruleBool: id ? true : false,
|
|
|
- // 等级返利设置 - 添加grade字段,从1到5
|
|
|
|
|
- level_radio: [
|
|
|
|
|
- { level_name: '青源客', ratio: '', grade: 1 },
|
|
|
|
|
- { level_name: '青润使', ratio: '', grade: 2 },
|
|
|
|
|
- { level_name: '青金团', ratio: '', grade: 3 },
|
|
|
|
|
- { level_name: '青玉团', ratio: '', grade: 4 },
|
|
|
|
|
- { level_name: '青谷团', ratio: '', grade: 5 }
|
|
|
|
|
- ],
|
|
|
|
|
},
|
|
},
|
|
|
watch: {
|
|
watch: {
|
|
|
'formData.is_sub': function (n) {
|
|
'formData.is_sub': function (n) {
|
|
@@ -1052,6 +1096,14 @@
|
|
|
this.render();
|
|
this.render();
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
|
|
+ // 'formData.image':function (n) {
|
|
|
|
|
+ // if(!this.batchAttr.pic){
|
|
|
|
|
+ // this.batchAttr.pic = n;
|
|
|
|
|
+ // }
|
|
|
|
|
+ // if(!this.formData.attr.pic){
|
|
|
|
|
+ // this.formData.attr.pic = n;
|
|
|
|
|
+ // }
|
|
|
|
|
+ // }
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
back: function () {
|
|
back: function () {
|
|
@@ -1152,7 +1204,7 @@
|
|
|
|
|
|
|
|
},
|
|
},
|
|
|
/**
|
|
/**
|
|
|
- * 获取商品信息 - 修复等级返利数据填充问题
|
|
|
|
|
|
|
+ * 获取商品信息
|
|
|
* */
|
|
* */
|
|
|
getProductInfo: function () {
|
|
getProductInfo: function () {
|
|
|
var that = this;
|
|
var that = this;
|
|
@@ -1163,68 +1215,11 @@
|
|
|
})).then(function (res) {
|
|
})).then(function (res) {
|
|
|
that.$set(that, 'cateList', res.data.cateList);
|
|
that.$set(that, 'cateList', res.data.cateList);
|
|
|
that.$set(that, 'tempList', res.data.tempList);
|
|
that.$set(that, 'tempList', res.data.tempList);
|
|
|
- that.$set(that, 'merList', res.data.merList);
|
|
|
|
|
var productInfo = res.data.productInfo || {};
|
|
var productInfo = res.data.productInfo || {};
|
|
|
if (productInfo.id && that.id) {
|
|
if (productInfo.id && that.id) {
|
|
|
- // 将产品信息赋值给formData
|
|
|
|
|
that.$set(that, 'formData', productInfo);
|
|
that.$set(that, 'formData', productInfo);
|
|
|
-
|
|
|
|
|
- // 修复等级返利数据填充问题
|
|
|
|
|
- console.log('获取到的level_radio数据:', productInfo.level_radio);
|
|
|
|
|
-
|
|
|
|
|
- // 初始化默认的等级数组
|
|
|
|
|
- var defaultLevels = [
|
|
|
|
|
- { level_name: '青源客', ratio: '', grade: 1 },
|
|
|
|
|
- { level_name: '青润使', ratio: '', grade: 2 },
|
|
|
|
|
- { level_name: '青金团', ratio: '', grade: 3 },
|
|
|
|
|
- { level_name: '青玉团', ratio: '', grade: 4 },
|
|
|
|
|
- { level_name: '青谷团', ratio: '', grade: 5 }
|
|
|
|
|
- ];
|
|
|
|
|
-
|
|
|
|
|
- // 检查是否有保存的等级返利数据
|
|
|
|
|
- if (productInfo.level_radio && productInfo.level_radio.length > 0) {
|
|
|
|
|
- console.log('有保存的等级返利数据,开始处理...');
|
|
|
|
|
-
|
|
|
|
|
- // 遍历后台返回的数据,更新默认数组中的比例
|
|
|
|
|
- productInfo.level_radio.forEach(function(savedItem) {
|
|
|
|
|
- // 查找对应的等级
|
|
|
|
|
- var foundIndex = defaultLevels.findIndex(function(defaultItem) {
|
|
|
|
|
- // 优先使用grade匹配,如果没有grade则使用level_name匹配
|
|
|
|
|
- if (savedItem.grade) {
|
|
|
|
|
- return defaultItem.grade == savedItem.grade;
|
|
|
|
|
- } else {
|
|
|
|
|
- return defaultItem.level_name === savedItem.level_name;
|
|
|
|
|
- }
|
|
|
|
|
- });
|
|
|
|
|
-
|
|
|
|
|
- if (foundIndex !== -1) {
|
|
|
|
|
- // 更新比例
|
|
|
|
|
- defaultLevels[foundIndex].ratio = savedItem.ratio || '';
|
|
|
|
|
- console.log('更新等级 ' + defaultLevels[foundIndex].level_name + ' 的比例为: ' + defaultLevels[foundIndex].ratio);
|
|
|
|
|
- }
|
|
|
|
|
- });
|
|
|
|
|
- } else {
|
|
|
|
|
- console.log('没有保存的等级返利数据,使用默认值');
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- // 设置到Vue实例
|
|
|
|
|
- that.$set(that, 'level_radio', defaultLevels);
|
|
|
|
|
- console.log('最终设置的level_radio:', defaultLevels);
|
|
|
|
|
-
|
|
|
|
|
- // 生成商品规格
|
|
|
|
|
that.generate();
|
|
that.generate();
|
|
|
- } else {
|
|
|
|
|
- // 新增商品时使用默认值
|
|
|
|
|
- that.$set(that, 'level_radio', [
|
|
|
|
|
- { level_name: '青源客', ratio: '', grade: 1 },
|
|
|
|
|
- { level_name: '青润使', ratio: '', grade: 2 },
|
|
|
|
|
- { level_name: '青金团', ratio: '', grade: 3 },
|
|
|
|
|
- { level_name: '青玉团', ratio: '', grade: 4 },
|
|
|
|
|
- { level_name: '青谷团', ratio: '', grade: 5 }
|
|
|
|
|
- ]);
|
|
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
- // 获取规则列表并初始化
|
|
|
|
|
that.getRuleList();
|
|
that.getRuleList();
|
|
|
that.init();
|
|
that.init();
|
|
|
}).catch(function (res) {
|
|
}).catch(function (res) {
|
|
@@ -1477,8 +1472,7 @@
|
|
|
});
|
|
});
|
|
|
//实例化编辑器
|
|
//实例化编辑器
|
|
|
this.um = UM.getEditor('myEditor', {initialFrameWidth: '99%', initialFrameHeight: 400});
|
|
this.um = UM.getEditor('myEditor', {initialFrameWidth: '99%', initialFrameHeight: 400});
|
|
|
- // 注意:这里使用Vue实例的formData.description,而不是直接设置
|
|
|
|
|
- // 我们会在mounted后通过getProductInfo获取数据后设置
|
|
|
|
|
|
|
+ this.um.setContent(that.formData.description);
|
|
|
that.$nextTick(function () {
|
|
that.$nextTick(function () {
|
|
|
layui.use(['form', 'element'], function () {
|
|
layui.use(['form', 'element'], function () {
|
|
|
that.form = layui.form;
|
|
that.form = layui.form;
|
|
@@ -1486,9 +1480,6 @@
|
|
|
that.form.on('select(temp_id)', function (data) {
|
|
that.form.on('select(temp_id)', function (data) {
|
|
|
that.$set(that.formData, 'temp_id', data.value);
|
|
that.$set(that.formData, 'temp_id', data.value);
|
|
|
});
|
|
});
|
|
|
- that.form.on('select(mer_id)', function (data) {
|
|
|
|
|
- that.$set(that.formData, 'mer_id', data.value);
|
|
|
|
|
- });
|
|
|
|
|
that.form.on('select(rule_index)', function (data) {
|
|
that.form.on('select(rule_index)', function (data) {
|
|
|
that.ruleIndex = data.value;
|
|
that.ruleIndex = data.value;
|
|
|
});
|
|
});
|
|
@@ -1577,9 +1568,6 @@
|
|
|
if (!that.formData.temp_id) {
|
|
if (!that.formData.temp_id) {
|
|
|
return that.showMsg('请选择运费模板');
|
|
return that.showMsg('请选择运费模板');
|
|
|
}
|
|
}
|
|
|
- if (!that.formData.mer_id) {
|
|
|
|
|
- return that.showMsg('请选择门店');
|
|
|
|
|
- }
|
|
|
|
|
if (!that.formData.store_name) {
|
|
if (!that.formData.store_name) {
|
|
|
return that.showMsg('请填写商品名称');
|
|
return that.showMsg('请填写商品名称');
|
|
|
}
|
|
}
|
|
@@ -1643,33 +1631,7 @@
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
- // 处理等级返利数据 - 确保传递当前填写的level_radio
|
|
|
|
|
- that.formData.level_radio = that.level_radio;
|
|
|
|
|
- console.log('提交的level_radio数据:', that.level_radio);
|
|
|
|
|
-
|
|
|
|
|
- // 验证等级返利数据(改为可选验证,可以不填)
|
|
|
|
|
- var hasLevelRatio = false;
|
|
|
|
|
- for (var i = 0; i < that.level_radio.length; i++) {
|
|
|
|
|
- var ratio = that.level_radio[i].ratio;
|
|
|
|
|
- if (ratio && ratio !== '') {
|
|
|
|
|
- hasLevelRatio = true;
|
|
|
|
|
- var ratioNum = parseFloat(ratio);
|
|
|
|
|
- if (isNaN(ratioNum) || ratioNum < 0 || ratioNum > 100) {
|
|
|
|
|
- return that.showMsg('等级返利比例必须在0-100之间');
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- // 如果有填写等级返利,则设置到formData,否则设置为空数组
|
|
|
|
|
- if (!hasLevelRatio) {
|
|
|
|
|
- that.formData.level_radio = [];
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- // 获取编辑器内容
|
|
|
|
|
that.formData.description = that.getContent();
|
|
that.formData.description = that.getContent();
|
|
|
-
|
|
|
|
|
- // 提交数据
|
|
|
|
|
that.requestPost(that.U({
|
|
that.requestPost(that.U({
|
|
|
c: 'store.StoreProduct',
|
|
c: 'store.StoreProduct',
|
|
|
a: 'save',
|
|
a: 'save',
|
|
@@ -1755,11 +1717,7 @@
|
|
|
mounted: function () {
|
|
mounted: function () {
|
|
|
var that = this;
|
|
var that = this;
|
|
|
axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest';
|
|
axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest';
|
|
|
-
|
|
|
|
|
- // 获取商品信息
|
|
|
|
|
that.getProductInfo();
|
|
that.getProductInfo();
|
|
|
-
|
|
|
|
|
- // 设置全局变量
|
|
|
|
|
window.$vm = that;
|
|
window.$vm = that;
|
|
|
window.changeIMG = that.changeIMG;
|
|
window.changeIMG = that.changeIMG;
|
|
|
window.insertEditor = that.insertEditor;
|
|
window.insertEditor = that.insertEditor;
|
|
@@ -1767,8 +1725,6 @@
|
|
|
window.successFun = function () {
|
|
window.successFun = function () {
|
|
|
that.getRuleList(1);
|
|
that.getRuleList(1);
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
- // 视频上传
|
|
|
|
|
$(that.$refs.filElem).change(function () {
|
|
$(that.$refs.filElem).change(function () {
|
|
|
var inputFile = this.files[0];
|
|
var inputFile = this.files[0];
|
|
|
that.requestPost(that.U({c: "widget.video", a: 'get_signature'})).then(function (res) {
|
|
that.requestPost(that.U({c: "widget.video", a: 'get_signature'})).then(function (res) {
|
|
@@ -1798,52 +1754,7 @@
|
|
|
}).catch(function (res) {
|
|
}).catch(function (res) {
|
|
|
return that.showMsg(res.msg || '获取密钥失败,请检查您的配置');
|
|
return that.showMsg(res.msg || '获取密钥失败,请检查您的配置');
|
|
|
});
|
|
});
|
|
|
- });
|
|
|
|
|
-
|
|
|
|
|
- // 监听编辑器内容变化,更新到formData
|
|
|
|
|
- that.$nextTick(function() {
|
|
|
|
|
- // 延迟初始化编辑器,确保textarea存在
|
|
|
|
|
- setTimeout(function() {
|
|
|
|
|
- // 检查textarea是否存在
|
|
|
|
|
- var editorElement = document.getElementById('myEditor');
|
|
|
|
|
- if (!editorElement) {
|
|
|
|
|
- console.error('找不到编辑器元素 #myEditor');
|
|
|
|
|
- return;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- // 如果已经存在编辑器实例,先销毁
|
|
|
|
|
- if (that.um) {
|
|
|
|
|
- that.um.destroy();
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- // 创建新的编辑器实例
|
|
|
|
|
- that.um = UM.getEditor('myEditor', {
|
|
|
|
|
- initialFrameWidth: '99%',
|
|
|
|
|
- initialFrameHeight: 400,
|
|
|
|
|
- autoHeightEnabled: true
|
|
|
|
|
- });
|
|
|
|
|
-
|
|
|
|
|
- // 编辑器就绪后设置内容
|
|
|
|
|
- that.um.addListener('ready', function() {
|
|
|
|
|
- console.log('UMEditor已就绪');
|
|
|
|
|
- // 设置内容(如果有)
|
|
|
|
|
- if (that.formData.description) {
|
|
|
|
|
- console.log('设置编辑器内容:', that.formData.description.substring(0, 50) + '...');
|
|
|
|
|
- that.um.setContent(that.formData.description);
|
|
|
|
|
- } else {
|
|
|
|
|
- console.log('没有商品详情内容');
|
|
|
|
|
- that.um.setContent('');
|
|
|
|
|
- }
|
|
|
|
|
- });
|
|
|
|
|
-
|
|
|
|
|
- // 监听内容变化
|
|
|
|
|
- that.um.addListener('contentChange', function() {
|
|
|
|
|
- that.formData.description = that.um.getContent();
|
|
|
|
|
- console.log('编辑器内容已更新');
|
|
|
|
|
- });
|
|
|
|
|
- }, 800); // 适当延迟
|
|
|
|
|
- });
|
|
|
|
|
-
|
|
|
|
|
|
|
+ })
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
</script>
|
|
</script>
|