Commit cd26d2b6 authored by pengyunqian's avatar pengyunqian

update:bugfile

parents 47740529 94ce5b84
...@@ -70,19 +70,19 @@ ...@@ -70,19 +70,19 @@
> >
<template #reference> <template #reference>
<el-image <el-image
v-if="scope.row.sensitiveWord && scope.row.entterprise_image" v-if="scope.row.sensitiveWord && scope.row.entterprise_image_url"
fit="fill" fit="fill"
:src="scope.row.entterprise_image" :src="scope.row.entterprise_image_url"
></el-image> ></el-image>
<span v-else-if=" <span v-else-if="
scope.row.sensitiveWord && !scope.row.entterprise_image scope.row.sensitiveWord && !scope.row.entterprise_image_url
"></span> "></span>
<span v-else>无权限</span> <span v-else>无权限</span>
</template> </template>
<el-image <el-image
fit="fill" fit="fill"
style="width:100%;height:100%" style="width:100%;height:100%"
:src="scope.row.entterprise_image" :src="scope.row.entterprise_image_url"
></el-image> ></el-image>
</el-popover> </el-popover>
</template> </template>
...@@ -119,19 +119,19 @@ ...@@ -119,19 +119,19 @@
> >
<template #reference> <template #reference>
<el-image <el-image
v-if="scope.row.sensitiveWord && scope.row.legal_front_id_card" v-if="scope.row.sensitiveWord && scope.row.legal_front_id_card_url"
:src="scope.row.legal_front_id_card" :src="scope.row.legal_front_id_card_url"
fit="fill" fit="fill"
></el-image> ></el-image>
<span v-else-if=" <span v-else-if="
scope.row.sensitiveWord && !scope.row.legal_front_id_card scope.row.sensitiveWord && !scope.row.legal_front_id_card_url
"></span> "></span>
<span v-else>无权限</span> <span v-else>无权限</span>
</template> </template>
<el-image <el-image
fit="fill" fit="fill"
style="width:100%;height:100%" style="width:100%;height:100%"
:src="scope.row.legal_front_id_card" :src="scope.row.legal_front_id_card_url"
></el-image> ></el-image>
</el-popover> </el-popover>
</template> </template>
...@@ -148,19 +148,19 @@ ...@@ -148,19 +148,19 @@
> >
<template #reference> <template #reference>
<el-image <el-image
v-if="scope.row.sensitiveWord && scope.row.legal_back_id_card" v-if="scope.row.sensitiveWord && scope.row.legal_back_id_card_url"
fit="fill" fit="fill"
:src="scope.row.legal_back_id_card" :src="scope.row.legal_back_id_card_url"
></el-image> ></el-image>
<span v-else-if=" <span v-else-if="
scope.row.sensitiveWord && !scope.row.legal_back_id_card scope.row.sensitiveWord && !scope.row.legal_back_id_card_url
"></span> "></span>
<span v-else>无权限</span> <span v-else>无权限</span>
</template> </template>
<el-image <el-image
fit="fill" fit="fill"
style="width:100%;height:100%" style="width:100%;height:100%"
:src="scope.row.legal_back_id_card" :src="scope.row.legal_back_id_card_url"
></el-image> ></el-image>
</el-popover> </el-popover>
......
...@@ -33,12 +33,13 @@ ...@@ -33,12 +33,13 @@
prop="businessLicense" prop="businessLicense"
> >
<el-image <el-image
v-if="establishForm.entterpriseImage" v-if="establishForm.entterprise_image_url"
style="width:200px;height:200px;border-radius:10px" style="width:200px;height:200px;border-radius:10px"
:src="establishForm.entterpriseImage" :src="establishForm.entterprise_image_url"
fit="cover" fit="cover"
></el-image> ></el-image>
<el-upload <el-upload
:data="{scenario:`business_license`}"
:show-file-list="false" :show-file-list="false"
:action="domainName" :action="domainName"
:accept="'image/*'" :accept="'image/*'"
...@@ -84,12 +85,13 @@ ...@@ -84,12 +85,13 @@
prop="front_img" prop="front_img"
> >
<el-image <el-image
v-if="establishForm.frontImg" v-if="establishForm.legal_front_id_card_url"
style="width:200px;height:200px;border-radius:10px" style="width:200px;height:200px;border-radius:10px"
:src="establishForm.frontImg" :src="establishForm.legal_front_id_card_url"
fit="cover" fit="cover"
></el-image> ></el-image>
<el-upload <el-upload
:data="{scenario:`id_card`}"
:show-file-list="false" :show-file-list="false"
:action="domainName" :action="domainName"
:accept="'image/*'" :accept="'image/*'"
...@@ -109,12 +111,13 @@ ...@@ -109,12 +111,13 @@
prop="bak_img" prop="bak_img"
> >
<el-image <el-image
v-if="establishForm.bakImg" v-if="establishForm.legal_back_id_card_url"
style="width:200px;height:200px;border-radius:10px" style="width:200px;height:200px;border-radius:10px"
:src="establishForm.bakImg" :src="establishForm.legal_back_id_card_url"
fit="cover" fit="cover"
></el-image> ></el-image>
<el-upload <el-upload
:data="{scenario:`id_card`}"
:show-file-list="false" :show-file-list="false"
:action="domainName" :action="domainName"
:accept="'image/*'" :accept="'image/*'"
...@@ -188,7 +191,7 @@ export default { ...@@ -188,7 +191,7 @@ export default {
data () { data () {
// 营业执照校验规则 // 营业执照校验规则
const businessRules = (rule, value, callback) => { const businessRules = (rule, value, callback) => {
if (!this.establishForm.entterprise_image) { if (this.establishForm.entterprise_image.length === 0) {
callback(new Error("请上传营业执照")); callback(new Error("请上传营业执照"));
} else { } else {
callback(); callback();
...@@ -197,7 +200,7 @@ export default { ...@@ -197,7 +200,7 @@ export default {
}; };
// 身份证照片正面校验规则 // 身份证照片正面校验规则
const idPhotoFontRules = (rule, value, callback) => { const idPhotoFontRules = (rule, value, callback) => {
if (!this.establishForm.front_img) { if (this.establishForm.legal_front_id_card.length === 0) {
callback(new Error("请上传身份正面证照片")); callback(new Error("请上传身份正面证照片"));
} else { } else {
callback(); callback();
...@@ -206,7 +209,7 @@ export default { ...@@ -206,7 +209,7 @@ export default {
}; };
// 身份证照片反面校验规则 // 身份证照片反面校验规则
const idPhotoBackRules = (rule, value, callback) => { const idPhotoBackRules = (rule, value, callback) => {
if (!this.establishForm.bak_img) { if (this.establishForm.legal_back_id_card.length === 0) {
callback(new Error("请上传身份反面证照片")); callback(new Error("请上传身份反面证照片"));
} else { } else {
callback(); callback();
...@@ -254,7 +257,7 @@ export default { ...@@ -254,7 +257,7 @@ export default {
establishForm: { establishForm: {
code: null, // 企业代码(!) code: null, // 企业代码(!)
name: null, // 企业名称(!) name: null, // 企业名称(!)
entterprise_image: null, // 金山云key(!) entterprise_image_url: null, // 金山云图片地址(!)
/* *********身份认证信息********* */ /* *********身份认证信息********* */
record_id: null, // 企业认证id record_id: null, // 企业认证id
front_img: "", // 身份证正面照的金山云objectid(!) front_img: "", // 身份证正面照的金山云objectid(!)
...@@ -263,7 +266,8 @@ export default { ...@@ -263,7 +266,8 @@ export default {
userName: "", // 用户姓名(!) userName: "", // 用户姓名(!)
legal_mobile: "", // 法人手机号 legal_mobile: "", // 法人手机号
data_type: null, // 企业类型(!) data_type: null, // 企业类型(!)
mobile: "" // 用户手机号 mobile: "", // 用户手机号
enterprise_id: "" // 返回的企业id
}, },
// 表单校验规则 // 表单校验规则
...@@ -324,9 +328,12 @@ export default { ...@@ -324,9 +328,12 @@ export default {
this.establishForm.data_type = val.record.data_type; this.establishForm.data_type = val.record.data_type;
this.establishForm.name = val.record.name; this.establishForm.name = val.record.name;
this.establishForm.code = val.record.code; this.establishForm.code = val.record.code;
this.establishForm.entterprise_image_url = val.record.entterprise_image_url;
this.establishForm.entterprise_image = val.record.entterprise_image; this.establishForm.entterprise_image = val.record.entterprise_image;
this.establishForm.front_img = val.record.legal_front_id_card; this.establishForm.legal_front_id_card_url = val.record.legal_front_id_card_url;
this.establishForm.bak_img = val.record.legal_back_id_card; this.establishForm.legal_front_id_card = val.record.legal_front_id_card;
this.establishForm.legal_back_id_card_url = val.record.legal_back_id_card_url;
this.establishForm.legal_back_id_card = val.record.legal_back_id_card;
this.establishForm.idcard_number = val.record.legal_id_card; this.establishForm.idcard_number = val.record.legal_id_card;
this.establishForm.userName = val.record.legal_person; this.establishForm.userName = val.record.legal_person;
this.establishForm.legal_mobile = val.record.legal_mobile; this.establishForm.legal_mobile = val.record.legal_mobile;
...@@ -334,9 +341,6 @@ export default { ...@@ -334,9 +341,6 @@ export default {
this.establishForm.legal_mobile = val.record.mobile; this.establishForm.legal_mobile = val.record.mobile;
this.establishForm.user_id = val.record.user_id; this.establishForm.user_id = val.record.user_id;
this.establishForm.sensitiveWord = val.record.sensitiveWord; this.establishForm.sensitiveWord = val.record.sensitiveWord;
this.establishForm.entterpriseImage = val.record.entterprise_image;
this.establishForm.frontImg = val.record.legal_front_id_card;
this.establishForm.bakImg = val.record.legal_back_id_card;
} }
}, },
...@@ -345,24 +349,24 @@ export default { ...@@ -345,24 +349,24 @@ export default {
handleEnterpriseSuccess (res) { handleEnterpriseSuccess (res) {
if (res.code !== 0) return this.$message.error(res.reason); if (res.code !== 0) return this.$message.error(res.reason);
this.clearValidate("entterpriseImageRef"); this.clearValidate("entterpriseImageRef");
this.establishForm.entterpriseImage = `http://${res.result.file_url}`; this.establishForm.entterprise_image_url = `http://${res.result.file_url}`;
this.establishForm.entterprise_image = res.result.object_id; this.establishForm.entterprise_image = `${res.result.bucket}/${res.result.object_id}`;
}, },
// 上传身份证前面 // 上传身份证前面
handleFontSuccess (res) { handleFontSuccess (res) {
if (res.code !== 0) return this.$message.error(res.reason); if (res.code !== 0) return this.$message.error(res.reason);
this.clearValidate("frontImgRef"); this.clearValidate("frontImgRef");
this.establishForm.frontImg = `http://${res.result.file_url}`; this.establishForm.legal_front_id_card_url = `http://${res.result.file_url}`;
this.establishForm.front_img = res.result.object_id; this.establishForm.legal_front_id_card = `${res.result.bucket}/${res.result.object_id}`;
}, },
// 上传身份证后面 // 上传身份证后面
handleBackSuccess (res) { handleBackSuccess (res) {
if (res.code !== 0) return this.$message.error(res.reason); if (res.code !== 0) return this.$message.error(res.reason);
this.clearValidate("bakImgRef"); this.clearValidate("bakImgRef");
this.establishForm.bakImg = `http://${res.result.file_url}`; this.establishForm.legal_back_id_card_url = `http://${res.result.file_url}`;
this.establishForm.bak_img = res.result.object_id; this.establishForm.legal_back_id_card = `${res.result.bucket}/${res.result.object_id}`;
}, },
// 取消创建表单 // 取消创建表单
...@@ -394,7 +398,7 @@ export default { ...@@ -394,7 +398,7 @@ export default {
const enterpriseQuery = { const enterpriseQuery = {
code, code,
name, name,
entterprise_image, entterprise_image_url: entterprise_image,
data_from: 3, data_from: 3,
data_type, data_type,
mobile, mobile,
...@@ -417,12 +421,11 @@ export default { ...@@ -417,12 +421,11 @@ export default {
data_type, data_type,
mobile mobile
} = this.establishForm; } = this.establishForm;
entterprise_image = this.transformObjectId(entterprise_image);
const editQuery = { const editQuery = {
record_id: this.enterpriseId, enterprise_auth_record_id: this.enterpriseId,
code, code,
name, name,
entterprise_image, entterprise_image_url: entterprise_image,
data_type, data_type,
data_from: 3, data_from: 3,
mobile mobile
...@@ -445,24 +448,22 @@ export default { ...@@ -445,24 +448,22 @@ export default {
let { let {
data_type, data_type,
user_id, user_id,
front_img, legal_front_id_card,
bak_img, legal_back_id_card,
idcard_number, idcard_number,
userName, userName,
legal_mobile legal_mobile
} = this.establishForm; } = this.establishForm;
front_img = this.transformObjectId(front_img);
bak_img = this.transformObjectId(bak_img);
// 提交法人信息 // 提交法人信息
let legalQuery = { let legalQuery = {
record_id: this.enterpriseId enterprise_auth_record_id: this.enterpriseId
? this.enterpriseId ? this.enterpriseId
: this.establishForm.enterprise_id, : this.establishForm.enterprise_id,
front_completeness: 0, front_completeness: 0,
bak_completeness: 0, bak_completeness: 0,
user_id: user_id ? parseInt(user_id) : "", user_id: user_id ? parseInt(user_id) : "",
front_img, posit_image_url: legal_front_id_card,
bak_img, back_image_url: legal_back_id_card,
idcard_number, idcard_number,
name: userName, name: userName,
legal_mobile, legal_mobile,
...@@ -477,18 +478,6 @@ export default { ...@@ -477,18 +478,6 @@ export default {
}); });
}, },
// 转换图片地址为ObjectId
transformObjectId (urls) {
try {
const url = new URL(urls);
let pathName = url.pathname;
let objectId = pathName.slice(1);
return objectId;
} catch (error) {
return urls;
}
},
// 清除校验 // 清除校验
clearValidate (formName) { clearValidate (formName) {
this.$refs[formName].clearValidate(); this.$refs[formName].clearValidate();
......
...@@ -48,3 +48,10 @@ ...@@ -48,3 +48,10 @@
background-color: #199ffb; background-color: #199ffb;
} }
} }
.el-input__inner {
padding-right: 15%;
}
.el-textarea__inner {
padding-bottom: 10%;
}
This diff is collapsed.
.goods {
width: 100%;
height: 100%;
padding: 0 30px;
}
.goods .search_condition {
display: flex;
justify-content: space-between;
flex-wrap: wrap;
align-items: center;
}
.goods .search_condition .search_button {
display: flex;
align-items: center;
justify-self: flex-end;
}
.goods .search_condition .search_button .el-form-item__content {
display: flex;
justify-content: space-around;
}
.goods .commodity_list {
margin-top: 30px;
}
.goods .pagination {
margin-top: 30px;
}
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
<!-- 所属分类 --> <!-- 所属分类 -->
<el-form-item label="所属分类"> <el-form-item label="所属分类">
<el-cascader <el-cascader
v-model="searchProps.classValue"
@change="handleTypeChange" @change="handleTypeChange"
:options="labelOptions" :options="labelOptions"
:props="cascaderProps" :props="cascaderProps"
...@@ -32,8 +33,8 @@ ...@@ -32,8 +33,8 @@
<el-form-item label="生活号名称"> <el-form-item label="生活号名称">
<el-input v-model="searchProps.life_account_name"></el-input> <el-input v-model="searchProps.life_account_name"></el-input>
</el-form-item> </el-form-item>
<!-- 商品状态 --> <!-- 审核状态 -->
<el-form-item label="商品状态"> <el-form-item label="审核状态">
<el-select <el-select
v-model="audit_status" v-model="audit_status"
multiple multiple
...@@ -134,15 +135,15 @@ ...@@ -134,15 +135,15 @@
>审核驳回</span> >审核驳回</span>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
<span <span
v-if="scope.row.online_status == 0" v-if="scope.row.online_status == 0 && scope.row.audit_status != 2"
style="color:#FF982C;" style="color:#FF982C;"
>未上架</span> >未上架</span>
<span <span
v-if="scope.row.online_status == 1" v-if="scope.row.online_status == 1 && scope.row.audit_status != 2"
style="color:#5CC247;" style="color:#5CC247;"
>已上架</span> >已上架</span>
<span <span
v-if="scope.row.online_status == 2" v-if="scope.row.online_status == 2 && scope.row.audit_status != 2"
style="color:#FD6B6F;" style="color:#FD6B6F;"
>已下架</span> >已下架</span>
</template> </template>
...@@ -166,7 +167,6 @@ ...@@ -166,7 +167,6 @@
> >
<template #default="scope"> <template #default="scope">
<el-button <el-button
v-if="scope.row.audit_status == 2 || scope.row.online_status == 1 || scope.row.online_status == 2"
type="text" type="text"
@click="goDetail(`EDIT`, scope.row.goods_spu_id)" @click="goDetail(`EDIT`, scope.row.goods_spu_id)"
>编辑</el-button> >编辑</el-button>
...@@ -178,7 +178,7 @@ ...@@ -178,7 +178,7 @@
>审核</el-button> >审核</el-button>
<el-popconfirm <el-popconfirm
v-if="scope.row.online_status == 2 || scope.row.audit_status != 0 && scope.row.online_status == 0" v-if="scope.row.online_status == 2 "
title="您确定要上架该商品吗?" title="您确定要上架该商品吗?"
cancelButtonType="default" cancelButtonType="default"
@confirm="changeGoodsState('GROUNDING', scope.row.goods_spu_id)" @confirm="changeGoodsState('GROUNDING', scope.row.goods_spu_id)"
...@@ -189,7 +189,7 @@ ...@@ -189,7 +189,7 @@
</el-popconfirm> </el-popconfirm>
<el-popconfirm <el-popconfirm
v-if="scope.row.online_status == 1" v-if=" scope.row.online_status != 2 && (scope.row.audit_status == 1 || scope.row.online_status == 1) "
title="您确定要下架该商品吗?" title="您确定要下架该商品吗?"
cancelButtonType="default" cancelButtonType="default"
@confirm=" @confirm="
...@@ -200,6 +200,11 @@ ...@@ -200,6 +200,11 @@
<el-button type="text">下架</el-button> <el-button type="text">下架</el-button>
</template> </template>
</el-popconfirm> </el-popconfirm>
<el-button
@click="goDetail(`DETAIL`,scope.row.goods_spu_id)"
type="text"
>详情</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
...@@ -262,14 +267,15 @@ export default { ...@@ -262,14 +267,15 @@ export default {
category_2_id: "", // 二级分类id category_2_id: "", // 二级分类id
life_account_id: "", life_account_id: "",
life_account_name: "", life_account_name: "",
audit_status: "", // 商品状态 audit_status: "", // 审核状态
online_status: "" // 上架状态 online_status: "", // 上架状态
classValue: ""
}, },
// 级联选择器 // 级联选择器
labelOptions: [], labelOptions: [],
// 商品状态 // 审核状态
stateOption: [ stateOption: [
{ value: 0, label: "待审核" }, { value: 0, label: "待审核" },
{ value: 1, label: "审核通过" }, { value: 1, label: "审核通过" },
...@@ -333,7 +339,7 @@ export default { ...@@ -333,7 +339,7 @@ export default {
this.searchProps.category_1_id = this.getVal(val, 0); this.searchProps.category_1_id = this.getVal(val, 0);
this.searchProps.category_2_id = this.getVal(val, 1); this.searchProps.category_2_id = this.getVal(val, 1);
}, },
// 商品状态赋值 // 审核状态赋值
handleStatusChange (val) { handleStatusChange (val) {
this.searchProps.audit_status = this.getValue(val); this.searchProps.audit_status = this.getValue(val);
}, },
...@@ -348,7 +354,7 @@ export default { ...@@ -348,7 +354,7 @@ export default {
}, },
// 重置表单 // 重置表单
resetList () { resetList () {
(this.searchProps = { this.searchProps = {
page: 1, // 页码 page: 1, // 页码
page_size: 20, // 页数大小 page_size: 20, // 页数大小
goods_spu_id: "", // 后台商品id goods_spu_id: "", // 后台商品id
...@@ -357,9 +363,12 @@ export default { ...@@ -357,9 +363,12 @@ export default {
category_2_id: "", // 二级分类id category_2_id: "", // 二级分类id
life_account_id: "", life_account_id: "",
life_account_name: "", life_account_name: "",
audit_status: "", // 商品状态 audit_status: "", // 审核状态
online_status: "" // 上架状态 online_status: "", // 上架状态
}), classValue: ""
};
this.audit_status = [];
this.onlineStatus = [];
this.getCommodityList(); this.getCommodityList();
}, },
// 上架/下架操作 // 上架/下架操作
......
<template> <template>
<layout> <layout>
<el-card class="container" style="width: 100%; height: 100%"> <el-card
class="container"
style="width: 100%; height: 100%"
>
<div class="retail"> <div class="retail">
<el-form inline :model="retailActivitie" ref="retailActivitie"> <el-form
inline
:model="retailActivitie"
ref="retailActivitie"
>
<!-- 查询 --> <!-- 查询 -->
<el-row> <el-row>
<el-form-item label="分销活动id" prop="marketing_id"> <el-form-item
label="分销活动id"
prop="marketing_id"
>
<!-- :rules="[{ type: 'number', message: '活动id必须为数字值' }]" --> <!-- :rules="[{ type: 'number', message: '活动id必须为数字值' }]" -->
<el-input <el-input
onkeyup="value=value.replace(/[^\d]/g,'')" onkeyup="value=value.replace(/[^\d]/g,'')"
...@@ -34,7 +44,10 @@ ...@@ -34,7 +44,10 @@
</el-form-item> </el-form-item>
<!-- 按钮操作 --> <!-- 按钮操作 -->
<el-form-item class="search_button"> <el-form-item class="search_button">
<el-button type="primary" @click="toSearch">搜索</el-button> <el-button
type="primary"
@click="toSearch"
>搜索</el-button>
<el-button @click="reset('retailActivitie')">重置</el-button> <el-button @click="reset('retailActivitie')">重置</el-button>
</el-form-item> </el-form-item>
</el-row> </el-row>
...@@ -42,10 +55,14 @@ ...@@ -42,10 +55,14 @@
type="primary" type="primary"
style="margin-bottom: 10px" style="margin-bottom: 10px"
@click="createDtb" @click="createDtb"
>创建分销活动</el-button >创建分销活动</el-button>
>
<!-- Tab --> <!-- Tab -->
<el-table :data="tableData" type="index" align="center" border> <el-table
:data="tableData"
type="index"
align="center"
border
>
<el-table-column <el-table-column
align="center" align="center"
prop="marketing_id" prop="marketing_id"
...@@ -91,11 +108,13 @@ ...@@ -91,11 +108,13 @@
</span> </span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column align="center" prop="online_status" label="状态"> <el-table-column
<template #default="scope"> align="center"
<span prop="online_status"
:style="{ color: scope.row.online_status == 3 ? 'red' : '' }" label="状态"
> >
<template #default="scope">
<span :style="{ color: scope.row.online_status == 3 ? 'red' : '' }">
{{ {{
scope.row.online_status == 2 scope.row.online_status == 2
? "关闭" ? "关闭"
...@@ -112,9 +131,17 @@ ...@@ -112,9 +131,17 @@
label="创建人" label="创建人"
> >
</el-table-column> </el-table-column>
<el-table-column align="center" prop="create_time" label="创建时间"> <el-table-column
align="center"
prop="create_time"
label="创建时间"
>
</el-table-column> </el-table-column>
<el-table-column align="center" prop="update_time" label="更新时间"> <el-table-column
align="center"
prop="update_time"
label="更新时间"
>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
align="center" align="center"
...@@ -122,14 +149,17 @@ ...@@ -122,14 +149,17 @@
label="分销到期时间" label="分销到期时间"
> >
</el-table-column> </el-table-column>
<el-table-column fixed="right" align="center" label="操作"> <el-table-column
fixed="right"
align="center"
label="操作"
>
<template #default="scope"> <template #default="scope">
<el-button <el-button
@click="handleClick(scope.row)" @click="handleClick(scope.row)"
type="text" type="text"
size="mini" size="mini"
>查看</el-button >查看</el-button>
>
<el-button <el-button
type="text" type="text"
size="mini" size="mini"
...@@ -149,8 +179,7 @@ ...@@ -149,8 +179,7 @@
scope.row.online_status !== 3 scope.row.online_status !== 3
" "
@click.stop="handelEnable(scope.row, 1)" @click.stop="handelEnable(scope.row, 1)"
>启用</el-button >启用</el-button>
>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
...@@ -197,7 +226,10 @@ ...@@ -197,7 +226,10 @@
:disabled="shopStart !== 0" :disabled="shopStart !== 0"
></el-input> ></el-input>
</el-form-item> </el-form-item>
<el-form-item label="一级佣金:" prop="first_commission_value"> <el-form-item
label="一级佣金:"
prop="first_commission_value"
>
<el-input <el-input
v-model="ruleForm.first_commission_value" v-model="ruleForm.first_commission_value"
@input="changeValue($event, 'first_commission_value')" @input="changeValue($event, 'first_commission_value')"
...@@ -206,7 +238,10 @@ ...@@ -206,7 +238,10 @@
<template #append>%</template> <template #append>%</template>
</el-input> </el-input>
</el-form-item> </el-form-item>
<el-form-item label="二级佣金: " prop="second_commission_value"> <el-form-item
label="二级佣金: "
prop="second_commission_value"
>
<el-input <el-input
v-model="ruleForm.second_commission_value" v-model="ruleForm.second_commission_value"
@input="changeValue($event, 'second_commission_value')" @input="changeValue($event, 'second_commission_value')"
...@@ -238,7 +273,10 @@ ...@@ -238,7 +273,10 @@
ref="ruleIdForm" ref="ruleIdForm"
size="mini" size="mini"
> >
<div class="queryBox" v-show="shopStart == 0"> <div
class="queryBox"
v-show="shopStart == 0"
>
<el-form-item label="关联商品:"> </el-form-item> <el-form-item label="关联商品:"> </el-form-item>
<el-form-item label="商品id:"> <el-form-item label="商品id:">
<el-input <el-input
...@@ -257,8 +295,7 @@ ...@@ -257,8 +295,7 @@
size="mini" size="mini"
style="margin-bottom: 30px" style="margin-bottom: 30px"
@click="findProducts" @click="findProducts"
>查询</el-button >查询</el-button>
>
</div> </div>
<div :class="shopStart == 0 ? 'newTab' : 'readTab'"> <div :class="shopStart == 0 ? 'newTab' : 'readTab'">
<el-table <el-table
...@@ -271,7 +308,10 @@ ...@@ -271,7 +308,10 @@
style="width: 100%" style="width: 100%"
@selection-change="selectGoodsChange" @selection-change="selectGoodsChange"
> >
<el-table-column align="center" type="selection"> <el-table-column
align="center"
type="selection"
>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
align="center" align="center"
...@@ -333,7 +373,7 @@ import { ...@@ -333,7 +373,7 @@ import {
} from "@/service/Goods/goods"; } from "@/service/Goods/goods";
import { ElMessage } from "element-plus"; import { ElMessage } from "element-plus";
// 开启关闭防抖 // 开启关闭防抖
function debounce(callback, delay) { function debounce (callback, delay) {
let timer = null; let timer = null;
return function (...args) { return function (...args) {
if (timer) { if (timer) {
...@@ -443,7 +483,7 @@ export default { ...@@ -443,7 +483,7 @@ export default {
else this.ruleForm[level] = ""; else this.ruleForm[level] = "";
}, },
// 查看详情列表 // 查看详情列表
async handleClick(row) { async handleClick (row) {
this.dialogFormVisible = true; this.dialogFormVisible = true;
this.shopStart = 1; this.shopStart = 1;
this.disabled = true; this.disabled = true;
...@@ -459,13 +499,13 @@ export default { ...@@ -459,13 +499,13 @@ export default {
} }
}, },
// 页码变化 // 页码变化
handleCurrentChange(e) { handleCurrentChange (e) {
this.retailActivitie.page = e; this.retailActivitie.page = e;
this.getMarketingList(); this.getMarketingList();
}, },
// 营销活动列表 // 营销活动列表
async getMarketingList() { async getMarketingList () {
try { try {
const res = await getMarketingList(this.retailActivitie); const res = await getMarketingList(this.retailActivitie);
this.tableData = res.result; this.tableData = res.result;
...@@ -493,12 +533,12 @@ export default { ...@@ -493,12 +533,12 @@ export default {
} }
}, 300), }, 300),
// 创建分销活动 // 创建分销活动
createDtb() { createDtb () {
this.dialogFormVisible = true; this.dialogFormVisible = true;
this.shopStart = 0; this.shopStart = 0;
}, },
// 重置 // 重置
reset(retailActivitie) { reset (retailActivitie) {
(this.retailActivitie = { (this.retailActivitie = {
marketing_id: "", marketing_id: "",
marketing_name: "", marketing_name: "",
...@@ -511,11 +551,11 @@ export default { ...@@ -511,11 +551,11 @@ export default {
this.getMarketingList({}); this.getMarketingList({});
}, },
// 搜索 // 搜索
toSearch() { toSearch () {
this.getMarketingList(); this.getMarketingList();
console.log(this.retailActivitie); console.log(this.retailActivitie);
}, },
selectTime(e) { selectTime (e) {
let date = new Date(); let date = new Date();
if (e && e[1] < date) { if (e && e[1] < date) {
ElMessage(`'活动结束时间不能早于当前时间'`); ElMessage(`'活动结束时间不能早于当前时间'`);
...@@ -523,9 +563,9 @@ export default { ...@@ -523,9 +563,9 @@ export default {
} }
}, },
// 获取时间格式 // 获取时间格式
formatTime(date) { formatTime (date) {
// 封装函数判断是否要在目标前边加 ’0‘ // 封装函数判断是否要在目标前边加 ’0‘
function getStr(target) { function getStr (target) {
return ("" + target).length === 1 ? "0" + target : target; return ("" + target).length === 1 ? "0" + target : target;
} }
// 获取月 // 获取月
...@@ -546,7 +586,7 @@ export default { ...@@ -546,7 +586,7 @@ export default {
return timeStr; return timeStr;
}, },
// 查询商品列表 // 查询商品列表
async findProducts() { async findProducts () {
// 获取参数 // 获取参数
const { goods_sku_id, life_account_id } = this.ruleIdForm; const { goods_sku_id, life_account_id } = this.ruleIdForm;
let [start_time, end_time] = this.timeSelect; let [start_time, end_time] = this.timeSelect;
...@@ -575,10 +615,10 @@ export default { ...@@ -575,10 +615,10 @@ export default {
ElMessage.error("请求查询商品列表失败"); ElMessage.error("请求查询商品列表失败");
} }
}, },
selectGoodsChange(e) { selectGoodsChange (e) {
this.ruleForm.goods_sku_id = e.map((item) => item.goods_sku_id); this.ruleForm.goods_sku_id = e.map((item) => item.goods_sku_id);
}, },
async getAllList() { async getAllList () {
let all = await getMarketingList({ let all = await getMarketingList({
page: 1, page: 1,
page_size: this.retailActivitie.count, page_size: this.retailActivitie.count,
...@@ -640,7 +680,7 @@ export default { ...@@ -640,7 +680,7 @@ export default {
}, },
// 清空 // 清空
resetDate() { resetDate () {
(this.ruleForm = { (this.ruleForm = {
marketing_name: "", marketing_name: "",
first_commission_value: "", first_commission_value: "",
...@@ -659,13 +699,13 @@ export default { ...@@ -659,13 +699,13 @@ export default {
}); });
}, },
// 取消 // 取消
cancel() { cancel () {
this.dialogFormVisible = false; this.dialogFormVisible = false;
this.resetDate(); this.resetDate();
this.getMarketingList(); this.getMarketingList();
}, },
}, },
created() { created () {
this.getMarketingList(); this.getMarketingList();
this.getAllList(); this.getAllList();
}, },
......
// 检测内容是否带表情符号
function checkString (strings) {
const checkKey = /[^\u0020-\u007E\u00A0-\u00BE\u2E80-\uA4CF\uF900-\uFAFF\uFE30-\uFE4F\uFF00-\uFFEF\u0080-\u009F\u2000-\u201f\u2026\u2022\u20ac\r\n]/g;
if (checkKey.test(strings)) {
return false;
} else {
return true;
};
};
export default { checkString }
\ No newline at end of file
...@@ -14,7 +14,7 @@ import goodsRouter from "./Goods/index"; ...@@ -14,7 +14,7 @@ import goodsRouter from "./Goods/index";
const routes = [ const routes = [
{ {
path: "/op/enterprise", path: "/op/enterprise",
redirect: "/enterprise/certification" redirect: "/op/enterprise/certification"
}, },
{ {
path: "/op/404", path: "/op/404",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment