|
@@ -102,224 +102,9 @@
|
|
|
:page.sync="queryParams.pageNum"
|
|
|
:limit.sync="queryParams.pageSize"
|
|
|
@pagination="getList"
|
|
|
- :pageSizes="[10, 20, 30, 50]"
|
|
|
+ :pageSizes="[10, 20, 30, 50,100]"
|
|
|
/>
|
|
|
|
|
|
- <!-- 添加直播 -->
|
|
|
- <el-dialog
|
|
|
- :title="!!ids ? '修改规则' : '新增规则'"
|
|
|
- :visible.sync="openAllocation"
|
|
|
- width="800px"
|
|
|
- append-to-body
|
|
|
- :close-on-click-modal="false"
|
|
|
- >
|
|
|
- <el-form
|
|
|
- ref="formBroadcast"
|
|
|
- :model="formBroadcast"
|
|
|
- :rules="rulesBroadcast"
|
|
|
- label-width="150px"
|
|
|
- :inline="true"
|
|
|
- >
|
|
|
- <span
|
|
|
- style="
|
|
|
- color: red;
|
|
|
- display: inline-block;
|
|
|
- width: 100%;
|
|
|
- text-align: center;
|
|
|
- font-size: 18px;
|
|
|
- "
|
|
|
- >
|
|
|
- 新增完成后,子规则不可删除</span
|
|
|
- >
|
|
|
-
|
|
|
- <el-form-item label="创建人" prop="userName" style="width: 100%">
|
|
|
- {{ $store.getters.name }}
|
|
|
- </el-form-item>
|
|
|
- <el-form-item
|
|
|
- label="规则名称"
|
|
|
- prop="ruleName"
|
|
|
- style="width: 100%"
|
|
|
- class="entire-line"
|
|
|
- >
|
|
|
- <el-input
|
|
|
- placeholder="请输入规则名称"
|
|
|
- style="width: 240px"
|
|
|
- :disabled="!!ids"
|
|
|
- v-model="formBroadcast.ruleName"
|
|
|
- >
|
|
|
- </el-input>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item
|
|
|
- label="规则类型"
|
|
|
- prop="ruleType"
|
|
|
- style="width: 100%"
|
|
|
- class="entire-line"
|
|
|
- >
|
|
|
- <el-select
|
|
|
- filterable
|
|
|
- :disabled="!!ids"
|
|
|
- v-model="formBroadcast.ruleType"
|
|
|
- placeholder="请选择规则类型"
|
|
|
- clearable
|
|
|
- style="width: 240px"
|
|
|
- >
|
|
|
- <el-option label="常规规则" value="1"></el-option>
|
|
|
- <el-option label="冲量规则" value="2"></el-option>
|
|
|
- </el-select>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label=" " style="width: 100%" class="entire-line">
|
|
|
- <el-button
|
|
|
- type="primary"
|
|
|
- plain
|
|
|
- icon="el-icon-document-add"
|
|
|
- size="mini"
|
|
|
- @click="
|
|
|
- formBroadcast.ruleDetails.push({
|
|
|
- startItemCount: undefined,
|
|
|
- endItemCount: undefined,
|
|
|
- anchorAmount: undefined,
|
|
|
- referenceAmount: undefined,
|
|
|
- })
|
|
|
- "
|
|
|
- >子规则新增
|
|
|
- </el-button>
|
|
|
- </el-form-item>
|
|
|
- <div
|
|
|
- style="
|
|
|
- height: 300px;
|
|
|
- overflow-y: auto;
|
|
|
- width: 100%;
|
|
|
- overflow-x: hidden;
|
|
|
- border: 2px solid #f2f2f2;
|
|
|
- padding-top: 10px;
|
|
|
- "
|
|
|
- v-if="formBroadcast.ruleDetails.length > 0"
|
|
|
- >
|
|
|
- <div
|
|
|
- v-for="(item, index) in formBroadcast.ruleDetails"
|
|
|
- :key="index"
|
|
|
- style="position: relative"
|
|
|
- >
|
|
|
- <div style="position: absolute; right: 25px">
|
|
|
- <el-button
|
|
|
- type="error"
|
|
|
- plain
|
|
|
- icon="el-icon-close"
|
|
|
- size="mini"
|
|
|
- v-if="!item.id"
|
|
|
- @click="formBroadcast.ruleDetails.splice(index, 1)"
|
|
|
- >删除
|
|
|
- </el-button
|
|
|
- >
|
|
|
- <el-button
|
|
|
- type="error"
|
|
|
- plain
|
|
|
- size="mini"
|
|
|
- @click="addOrEdit(item, index)"
|
|
|
- v-if="!!ids"
|
|
|
- >确定
|
|
|
- </el-button
|
|
|
- >
|
|
|
- </div>
|
|
|
-
|
|
|
- <el-form-item
|
|
|
- label="序号"
|
|
|
- prop="sortCount"
|
|
|
- style="width: 100%"
|
|
|
- class="entire-line"
|
|
|
- >
|
|
|
- {{ index + 1 }}
|
|
|
- </el-form-item>
|
|
|
- <el-form-item
|
|
|
- label="起始单数"
|
|
|
- style="width: 100%"
|
|
|
- class="entire-line"
|
|
|
- :prop="'ruleDetails.' + index + '.startItemCount'"
|
|
|
- :rules="{
|
|
|
- required: true,
|
|
|
- message: '起始单数不能为空',
|
|
|
- trigger: 'blur',
|
|
|
- }"
|
|
|
- >
|
|
|
- <el-input
|
|
|
- placeholder="请输入起始单数"
|
|
|
- style="width: 240px"
|
|
|
- v-model.number="item.startItemCount"
|
|
|
- >
|
|
|
- </el-input>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item
|
|
|
- label="结束单数"
|
|
|
- :prop="'ruleDetails.' + index + '.endItemCount'"
|
|
|
- :rules="{
|
|
|
- required: true,
|
|
|
- message: '结束单数不能为空',
|
|
|
- trigger: 'blur',
|
|
|
- }"
|
|
|
- style="width: 100%"
|
|
|
- class="entire-line"
|
|
|
- >
|
|
|
- <el-input
|
|
|
- placeholder="请输入结束单数"
|
|
|
- style="width: 240px"
|
|
|
- v-model.number="item.endItemCount"
|
|
|
- >
|
|
|
- </el-input>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item
|
|
|
- label="主播奖励金额"
|
|
|
- :prop="'ruleDetails.' + index + '.anchorAmount'"
|
|
|
- :rules="{
|
|
|
- required: true,
|
|
|
- message: '主播奖励金额不能为空',
|
|
|
- trigger: 'blur',
|
|
|
- }"
|
|
|
- style="width: 100%"
|
|
|
- class="entire-line"
|
|
|
- >
|
|
|
- <el-input-number
|
|
|
- style="width: 240px"
|
|
|
- v-model="item.anchorAmount"
|
|
|
- :precision="2"
|
|
|
- :step="0.1"
|
|
|
- :min="0"
|
|
|
- placeholder="请输入主播奖励金额"
|
|
|
- ></el-input-number>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item
|
|
|
- label="推荐人奖励金额"
|
|
|
- prop="referenceAmount"
|
|
|
- style="width: 100%"
|
|
|
- class="entire-line"
|
|
|
- >
|
|
|
- <el-input-number
|
|
|
- style="width: 240px"
|
|
|
- v-model="item.referenceAmount"
|
|
|
- :precision="2"
|
|
|
- :step="0.1"
|
|
|
- :min="0"
|
|
|
- placeholder="请输入推荐人奖励金额"
|
|
|
- ></el-input-number>
|
|
|
- </el-form-item>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </el-form>
|
|
|
- <div slot="footer" class="dialog-footer" v-if="!ids">
|
|
|
- <el-button type="primary" @click="submitFormBroadcast" :loading="confirmLoading"
|
|
|
- >确 定
|
|
|
- </el-button
|
|
|
- >
|
|
|
- <el-button
|
|
|
- @click="
|
|
|
- confirmLoading = false;
|
|
|
- openAllocation = false;
|
|
|
- formBroadcast = {};
|
|
|
- "
|
|
|
- >取 消
|
|
|
- </el-button
|
|
|
- >
|
|
|
- </div>
|
|
|
- </el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
@@ -404,16 +189,6 @@
|
|
|
// 表单校验
|
|
|
rules: {},
|
|
|
rulesBroadcast: {
|
|
|
- ruleName: {
|
|
|
- required: true,
|
|
|
- message: "规则名称必填",
|
|
|
- trigger: "blur",
|
|
|
- },
|
|
|
- ruleType: {
|
|
|
- required: true,
|
|
|
- message: "规则类型必选",
|
|
|
- trigger: "change",
|
|
|
- },
|
|
|
},
|
|
|
// 分配销售展示列表
|
|
|
ksInfo: null,
|
|
@@ -437,43 +212,7 @@
|
|
|
},
|
|
|
filters: {},
|
|
|
methods: {
|
|
|
- addOrEdit(item, index) {
|
|
|
- if (item.id) {
|
|
|
- console.log(item);
|
|
|
- editDetail({
|
|
|
- id: item.id,
|
|
|
- ruleId: this.ids,
|
|
|
- anchorAmount: item.anchorAmount,
|
|
|
- endItemCount: item.endItemCount,
|
|
|
- referenceAmount: item.referenceAmount,
|
|
|
- sortCount: item.sortCount,
|
|
|
- startItemCount: item.startItemCount,
|
|
|
- }).then((res) => {
|
|
|
- this.$message.success("修改成功");
|
|
|
- });
|
|
|
- } else {
|
|
|
- addDetail({
|
|
|
- ruleId: this.ids,
|
|
|
- anchorAmount: item.anchorAmount,
|
|
|
- endItemCount: item.endItemCount,
|
|
|
- referenceAmount: item.referenceAmount,
|
|
|
- sortCount: index,
|
|
|
- startItemCount: item.startItemCount,
|
|
|
- }).then((res) => {
|
|
|
- this.$message.success("添加成功");
|
|
|
- });
|
|
|
- }
|
|
|
- },
|
|
|
- lookDetail(item) {
|
|
|
- getRuleDetailByRuleId({ruleId: item.id}).then((res) => {
|
|
|
- this.ids = item.id;
|
|
|
- this.edit = true;
|
|
|
- this.openAllocation = true;
|
|
|
- this.$set(this.formBroadcast, "ruleName", item.ruleName);
|
|
|
- this.$set(this.formBroadcast, "ruleType", "" + item.ruleType);
|
|
|
- this.$set(this.formBroadcast, "ruleDetails", res.data);
|
|
|
- });
|
|
|
- },
|
|
|
+
|
|
|
toDetail(item) {
|
|
|
this.$router.replace({
|
|
|
path: "/goodsManagement/settlementDetails",
|