Commit cd26d2b6 authored by pengyunqian's avatar pengyunqian

update:bugfile

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