Commit b50d21a5 by ym

code

1 parent d1256ca3
...@@ -131,7 +131,7 @@ img { ...@@ -131,7 +131,7 @@ img {
::-webkit-scrollbar { ::-webkit-scrollbar {
/*滚动条整体样式*/ /*滚动条整体样式*/
width: 6px; width: 6px;
height: 1px; height: 4px;
} }
::-webkit-scrollbar-thumb { ::-webkit-scrollbar-thumb {
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
<script> <script>
import AMap from "AMap"; import AMap from "AMap";
let map, placeSearch; let map,marker, placeSearch;
export default { export default {
name: "map", name: "map",
props: { props: {
...@@ -49,17 +49,20 @@ export default { ...@@ -49,17 +49,20 @@ export default {
map.on("click", this.getAddress); map.on("click", this.getAddress);
placeSearch.on("markerClick", this.getAddress); placeSearch.on("markerClick", this.getAddress);
}, },
// addMarker(lnglat) { addMarker(lnglat) {
// let position = [lnglat.lng,lnglat.lat] let position = [lnglat.lng,lnglat.lat]
// const marker = new AMap.Marker({ marker = new AMap.Marker({
// icon: "//a.amap.com/jsapi_demos/static/demo-center/icons/poi-marker-default.png", icon: new AMap.Icon({
// position, image: "//a.amap.com/jsapi_demos/static/demo-center/icons/poi-marker-default.png",
// offset: new AMap.Pixel(-13, -30) size: new AMap.Size(27, 34), //图标大小
// }); imageSize: new AMap.Size(27,34)
// marker.setMap(map); }),
// }, position:position,
offset: new AMap.Pixel(-13, -30)
});
marker.setMap(map);
},
getAddress(e) { getAddress(e) {
console.log(e)
let self = this; let self = this;
let lnglat; let lnglat;
if (e.type == "click") { if (e.type == "click") {
...@@ -68,6 +71,10 @@ export default { ...@@ -68,6 +71,10 @@ export default {
let { lng, lat } = e.data.entr_location?e.data.entr_location:e.data.location; let { lng, lat } = e.data.entr_location?e.data.entr_location:e.data.location;
lnglat = [lng, lat]; lnglat = [lng, lat];
} }
if (marker) {
marker.setMap(null);
marker = null;
}
self.addMarker(lnglat) self.addMarker(lnglat)
AMap.plugin("AMap.Geocoder", () => { AMap.plugin("AMap.Geocoder", () => {
const geocoder = new AMap.Geocoder(); const geocoder = new AMap.Geocoder();
......
...@@ -25,9 +25,83 @@ util.checkPhone = function(mobile) { ...@@ -25,9 +25,83 @@ util.checkPhone = function(mobile) {
/** /**
* 校验手机号码格式 * 校验手机号码格式
*/ */
util.checkisCard = function(card) { util.checkIdCard = function(code) {
let myreg = /^(^\d{15}$)|(^\d{17}([0-9]|X)$)/; var city = {
return myreg.test(card); 11: '北京',
12: '天津',
13: '河北',
14: '山西',
15: '内蒙古',
21: '辽宁',
22: '吉林',
23: '黑龙江',
31: '上海',
32: '江苏',
33: '浙江',
34: '安徽',
35: '福建',
36: '江西',
37: '山东',
41: '河南',
42: '湖北',
43: '湖南',
44: '广东',
45: '广西',
46: '海南',
50: '重庆',
51: '四川',
52: '贵州',
53: '云南',
54: '西藏',
61: '陕西',
62: '甘肃',
63: '青海',
64: '宁夏',
65: '新疆',
71: '台湾',
81: '香港',
82: '澳门',
91: '国外 '
}
// var tip = ''
var pass = true
// 身份证位数为15或18位
// if (![15, 18].includes(code.length)) {
if (!((code.length == 15) || (code.length == 18))) {
pass = false
} else if (!code || (code.length === 18 && !/^\d{6}(18|19|20)\d{2}(0[1-9]|1[012])(0[1-9]|[12]\d|3[01])\d{3}(\d|X)$/i.test(code))) {
// tip = '身份证号格式错误'
pass = false
} else if (code.length === 15 && !/^\d{6}\d{2}(0[1-9]|1[012])(0[1-9]|[12]\d|3[01])\d{3}$/i.test(code)) {
pass = false
} else if (!city[code.substr(0, 2)]) {
// tip = '地址编码错误'
pass = false
} else {
// 18位身份证需要验证最后一位校验位
if (code.length === 18) {
code = code.split('')
// ∑(ai×Wi)(mod 11)
// 加权因子
var factor = [7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2]
// 校验位
var parity = [1, 0, 'X', 9, 8, 7, 6, 5, 4, 3, 2]
var sum = 0
var ai = 0
var wi = 0
for (var i = 0; i < 17; i++) {
ai = code[i]
wi = factor[i]
sum += ai * wi
}
// var last = parity[sum % 11]
if (parity[sum % 11] != code[17]) {
// tip = '校验位错误'
pass = false
}
}
}
return pass
} }
util.deepClone = function(obj) { util.deepClone = function(obj) {
// Handle the 3 simple types, and null or undefined or function // Handle the 3 simple types, and null or undefined or function
......
...@@ -178,7 +178,7 @@ export default { ...@@ -178,7 +178,7 @@ export default {
dialogMapVisible: false, dialogMapVisible: false,
businessScopeCustomize: [{ name: "" }], businessScopeCustomize: [{ name: "" }],
accountAddForm: { accountAddForm: {
status: 1, status: "",
merchantFiles: [], merchantFiles: [],
merchantType: 1, merchantType: 1,
businessScope: [], businessScope: [],
...@@ -204,7 +204,7 @@ export default { ...@@ -204,7 +204,7 @@ export default {
{ min: 3, max: 15, message: "长度在 3 到 15 个字符", trigger: "blur" }, { min: 3, max: 15, message: "长度在 3 到 15 个字符", trigger: "blur" },
], ],
merchantLoginPassword: [ merchantLoginPassword: [
{ required: true, message: "请输入登录账户名", trigger: "blur" }, { required: true, message: "请输入登录密码", trigger: "blur" },
{ min: 6, max: 15, message: "长度在 6 到 15 个字符", trigger: "blur" }, { min: 6, max: 15, message: "长度在 6 到 15 个字符", trigger: "blur" },
], ],
}, },
...@@ -225,11 +225,12 @@ export default { ...@@ -225,11 +225,12 @@ export default {
} }
}, },
handleSave(status) { handleSave(status) {
if (this.$refs.productForm.getSelectInfo().length == 0) { let product = this.$refs.productForm.getSelectInfo();
if (product && product.every((item) => item.products.length == 0)) {
this.$message.error("请选择产品"); this.$message.error("请选择产品");
return; return;
} }
let accountTypes = JSON.stringify(this.$refs.productForm.getSelectInfo()); let accountTypes = JSON.stringify(product);
let params = { let params = {
accountTypes, accountTypes,
status, status,
...@@ -245,6 +246,7 @@ export default { ...@@ -245,6 +246,7 @@ export default {
this.$router.push("/account/index"); this.$router.push("/account/index");
}, },
handlePrev() { handlePrev() {
document.querySelector("#app").scrollTop = 0;
this.step = 1; this.step = 1;
}, },
//下一步 //下一步
...@@ -252,11 +254,27 @@ export default { ...@@ -252,11 +254,27 @@ export default {
const pm1 = new Promise((resolve, reject) => { const pm1 = new Promise((resolve, reject) => {
this.$refs.baseInfoForm.$refs.baseForm.validate((valid) => { this.$refs.baseInfoForm.$refs.baseForm.validate((valid) => {
if (valid) resolve(); if (valid) resolve();
else {
setTimeout(() => {
var isError = document.getElementsByClassName("is-error");
isError[0].querySelector("input").focus();
}, 100);
reject();
}
}); });
}); });
const pm2 = new Promise((resolve, reject) => { const pm2 = new Promise((resolve, reject) => {
this.$refs.accountInfoForm.validate((valid) => { this.$refs.accountInfoForm.validate((valid) => {
if (valid) resolve(); if (valid) resolve();
else {
pm1.then(() => {
document.querySelector("#app").scrollTop = 1000;
});
setTimeout(() => {
var isError = document.getElementsByClassName("is-error");
isError[0].querySelector("input").focus();
}, 100);
}
}); });
}); });
if (this.accounttypeId.length == 0) { if (this.accounttypeId.length == 0) {
...@@ -266,9 +284,26 @@ export default { ...@@ -266,9 +284,26 @@ export default {
if ( if (
this.accountAddForm.merchantType == 1 && this.accountAddForm.merchantType == 1 &&
this.accountAddForm.merchantOrgcode && this.accountAddForm.merchantOrgcode &&
!util.checkisCard(this.accountAddForm.merchantOrgcode) !util.checkIdCard(this.accountAddForm.merchantOrgcode)
) { ) {
this.$message.error("请输入正确的身份证号码"); this.$message.error("请输入正确的身份证号码");
document.querySelector("#app").scrollTop = 0;
setTimeout(() => {
var isError = document.getElementsByClassName("card-input");
isError[0].querySelectorAll(".el-input__inner")[1].focus();
}, 100);
return;
}
if (
this.accountAddForm.residentPhone &&
!util.checkPhone(this.accountAddForm.residentPhone)
) {
this.$message.error("请输入正确的驻店电话");
document.querySelector("#app").scrollTop = 0;
setTimeout(() => {
var isError = document.getElementsByClassName("phone-input");
isError[0].querySelector("input").focus();
}, 100);
return; return;
} }
let params = Object.assign({}, this.accountAddForm, this.accountInfoForm); let params = Object.assign({}, this.accountAddForm, this.accountInfoForm);
...@@ -279,16 +314,17 @@ export default { ...@@ -279,16 +314,17 @@ export default {
if (params.businessScope) { if (params.businessScope) {
params.businessScope = params.businessScope.join(","); params.businessScope = params.businessScope.join(",");
} }
console.log(this.$refs.baseInfoForm);
params.merchantBrand = this.$refs.baseInfoForm.$refs.brandTree params.merchantBrand = this.$refs.baseInfoForm.$refs.brandTree
.getCheckedKeys() .getCheckedKeys()
.join(","); .join(",");
params.isloginName ? (params.isloginName = 1) : (params.isloginName = 0); params.isloginName ? (params.isloginName = 1) : (params.isloginName = 0);
params.merchantAccountLevel = this.accountDetail.merchantAccountLevel; params.merchantAccountLevel = this.accountDetail.merchantAccountLevel;
params.status = this.accountDetail.status;
params.channelId = this.accountDetail.channelId;
let businessScopeCustomize = this.businessScopeCustomize.map((item) => item.name); let businessScopeCustomize = this.businessScopeCustomize.map((item) => item.name);
params.businessScopeCustomize = businessScopeCustomize.join(","); params.businessScopeCustomize = businessScopeCustomize.join(",");
params.accounttypeId = this.accounttypeId.join(","); params.accounttypeId = this.accounttypeId.join(",");
params.merchantFiles = JSON.stringify(params.merchantFiles) params.merchantFiles = JSON.stringify(params.merchantFiles);
params.merchantModel = this.accountDetail.merchantModel; params.merchantModel = this.accountDetail.merchantModel;
let merchant; let merchant;
if (this.nextStatus) { if (this.nextStatus) {
...@@ -297,6 +333,7 @@ export default { ...@@ -297,6 +333,7 @@ export default {
} else { } else {
merchant = "saveMerchant"; merchant = "saveMerchant";
} }
document.querySelector("#app").scrollTop = 0;
Promise.all([pm1, pm2]).then(() => { Promise.all([pm1, pm2]).then(() => {
this.$apis.store[merchant](params).then((res) => { this.$apis.store[merchant](params).then((res) => {
if (res) { if (res) {
...@@ -309,7 +346,7 @@ export default { ...@@ -309,7 +346,7 @@ export default {
id: this.parentId, id: this.parentId,
parentId: this.accountAddForm.parentId, parentId: this.accountAddForm.parentId,
}; };
this.$refs.productForm.findMenuFunTreeByMerId(para,this.accounttypeId); this.$refs.productForm.findMenuFunTreeByMerId(para, this.accounttypeId);
} }
this.twoMerchantDetail(this.parentId); this.twoMerchantDetail(this.parentId);
} }
...@@ -344,12 +381,12 @@ export default { ...@@ -344,12 +381,12 @@ export default {
return item.dictValue != 1 && item.dictValue != 3; return item.dictValue != 1 && item.dictValue != 3;
}); });
this.accountDetail.merchantAccountLevel = 2; this.accountDetail.merchantAccountLevel = 2;
}else if (this.accountDetail.merchantAccountLevel == 2) { } else if (this.accountDetail.merchantAccountLevel == 2) {
this.accountLevel = res.filter((item) => { this.accountLevel = res.filter((item) => {
return item.dictValue != 1 && item.dictValue != 2; return item.dictValue != 1 && item.dictValue != 2;
}); });
this.accountDetail.merchantAccountLevel = 3; this.accountDetail.merchantAccountLevel = 3;
}else{ } else {
this.accountLevel = res.filter((item) => { this.accountLevel = res.filter((item) => {
return item.dictValue == 4; return item.dictValue == 4;
}); });
......
...@@ -47,6 +47,7 @@ ...@@ -47,6 +47,7 @@
<el-input <el-input
size="small" size="small"
maxlength="18" maxlength="18"
class="card-input"
v-model="accountAddForm.merchantOrgcode" v-model="accountAddForm.merchantOrgcode"
placeholder="请输入正确的身份证号" placeholder="请输入正确的身份证号"
v-if="accountAddForm.merchantType == 1" v-if="accountAddForm.merchantType == 1"
...@@ -113,6 +114,7 @@ ...@@ -113,6 +114,7 @@
<el-input <el-input
maxlength="11" maxlength="11"
size="small" size="small"
class="phone-input"
v-model="accountAddForm.residentPhone" v-model="accountAddForm.residentPhone"
placeholder="请输入驻店电话" placeholder="请输入驻店电话"
></el-input> ></el-input>
...@@ -202,9 +204,11 @@ ...@@ -202,9 +204,11 @@
:key="index" :key="index"
v-for="(item, index) in accountAddForm.merchantFiles" v-for="(item, index) in accountAddForm.merchantFiles"
class="store-border" class="store-border"
@mouseenter="imgIndex = index"
@mouseleave="imgIndex = ''"
> >
<img :src="item.fileUrl" /> <img :src="item.fileUrl" />
<div class="uploader-del-icon"> <div class="uploader-del-icon" v-if="imgIndex === index">
<i class="el-icon-delete-solid" @click.stop="delImg(index)"></i> <i class="el-icon-delete-solid" @click.stop="delImg(index)"></i>
</div> </div>
</div> </div>
...@@ -267,6 +271,7 @@ export default { ...@@ -267,6 +271,7 @@ export default {
} }
}; };
return { return {
imgIndex: '',
filterText: "", filterText: "",
defaultProps: { defaultProps: {
children: "children", children: "children",
...@@ -319,13 +324,17 @@ export default { ...@@ -319,13 +324,17 @@ export default {
upLoadImg(file) { upLoadImg(file) {
let fileName = file.name; let fileName = file.name;
if (file.name.lastIndexOf(".") === -1) { if (file.name.lastIndexOf(".") === -1) {
this.$message.info("路径不正确"); this.$message.warning("路径不正确");
return false; return false;
} }
let AllImgExt = ".jpg|.jpeg|.gif|.bmp|.png|.swf"; let AllImgExt = ".jpg|.jpeg|.gif|.bmp|.png|.swf";
let extName = file.name.substring(file.name.lastIndexOf(".")).toLowerCase(); let extName = file.name.substring(file.name.lastIndexOf(".")).toLowerCase();
if (AllImgExt.indexOf(extName + "|") === -1) { if (AllImgExt.indexOf(extName + "|") === -1) {
this.$message.info("图片格式不正确"); this.$message.warning("图片格式不正确");
return false;
}
if(this.accountAddForm.merchantFiles.length == 3) {
this.$message.warning("最多上传3张");
return false; return false;
} }
// if (fileSize < 3145728) { // if (fileSize < 3145728) {
......
...@@ -11,21 +11,21 @@ ...@@ -11,21 +11,21 @@
<span class="content-title">账户信息</span> <span class="content-title">账户信息</span>
<div class="detail-content"> <div class="detail-content">
<el-row> <el-row>
<el-col :span="14"> <el-col :span="14" class="flexCol">
<span class="itemName">登录账户名:</span> <span class="itemName">登录账户名:</span>
<span class="itemValue">{{ firstPageObj.merchantLoginAccount || '-' }}</span> <span class="itemValue">{{ firstPageObj.merchantLoginAccount || '-' }}</span>
</el-col> </el-col>
<el-col :span="10"> <el-col :span="10" class="flexCol">
<span class="itemName itemNameCol2">账户等级:</span> <span class="itemName itemNameCol2">账户等级:</span>
<span class="itemValue">{{ firstPageObj.accountLevelName || '-' }}</span> <span class="itemValue">{{ firstPageObj.accountLevelName || '-' }}</span>
</el-col> </el-col>
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="14"> <el-col :span="14" class="flexCol">
<span class="itemName">开通模式:</span> <span class="itemName">开通模式:</span>
<span class="itemValue">{{ firstPageObj.merchantModelName || '-' }}</span> <span class="itemValue">{{ firstPageObj.merchantModelName || '-' }}</span>
</el-col> </el-col>
<el-col :span="10"> <el-col :span="10" class="flexCol">
<span class="itemName itemNameCol2">账户状态:</span> <span class="itemName itemNameCol2">账户状态:</span>
<span class="itemValue"> <span class="itemValue">
{{ firstPageObj.statusName || '-' }} {{ firstPageObj.statusName || '-' }}
...@@ -33,11 +33,11 @@ ...@@ -33,11 +33,11 @@
</el-col> </el-col>
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="14"> <el-col :span="14" class="flexCol">
<span class="itemName">关联企业微信名:</span> <span class="itemName">关联企业微信名:</span>
<span class="itemValue">{{ firstPageObj.entmicroName || '-' }}</span> <span class="itemValue">{{ firstPageObj.entmicroName || '-' }}</span>
</el-col> </el-col>
<el-col :span="10"> <el-col :span="10" class="flexCol">
<span class="itemName itemNameCol2">账户有效期:</span> <span class="itemName itemNameCol2">账户有效期:</span>
<span class="itemValue">{{ firstPageObj.effectiveTimeName }}</span> <span class="itemValue">{{ firstPageObj.effectiveTimeName }}</span>
</el-col> </el-col>
...@@ -82,13 +82,13 @@ ...@@ -82,13 +82,13 @@
<div class="MsgWrap companyMsg"> <div class="MsgWrap companyMsg">
<div class="grayLine"></div> <div class="grayLine"></div>
<span class="content-title">企业信息</span> <span class="content-title">企业信息</span>
<div class="detail-content"> <div class="detail-content" style="flex">
<el-row> <el-row>
<el-col :span="14"> <el-col :span="14" class="flexCol">
<span class="itemName">商户名称:</span> <span class="itemName">商户名称:</span>
<span class="itemValue">{{ firstPageObj.merchantName || '-' }}</span> <span class="itemValue">{{ firstPageObj.merchantName || '-' }}</span>
</el-col> </el-col>
<el-col :span="10"> <el-col :span="10" class="flexCol">
<span class="itemName itemNameCol2">简称:</span> <span class="itemName itemNameCol2">简称:</span>
<span class="itemValue"> <span class="itemValue">
{{ firstPageObj.merchantAbbreviation || '-' }} {{ firstPageObj.merchantAbbreviation || '-' }}
...@@ -96,40 +96,43 @@ ...@@ -96,40 +96,43 @@
</el-col> </el-col>
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="14"> <el-col :span="14" class="flexCol">
<span class="itemName">商户类型:</span> <span class="itemName">商户类型:</span>
<span class="itemValue">{{ firstPageObj.merchantTypeName || '-' }}</span> <span class="itemValue">{{ firstPageObj.merchantTypeName || '-' }}</span>
</el-col> </el-col>
<el-col :span="10"> <el-col :span="10" class="flexCol">
<span class="itemName itemNameCol2">身份证:</span> <span class="itemName itemNameCol2" v-if="firstPageObj.merchantType == 2">组织机构代码:</span>
<span class="itemName itemNameCol2" v-else>身份证:</span>
<span class="itemValue">{{ firstPageObj.merchantOrgcode || '-' }}</span> <span class="itemValue">{{ firstPageObj.merchantOrgcode || '-' }}</span>
</el-col> </el-col>
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="14"> <el-col :span="14" class="flexCol">
<span class="itemName">地址:</span> <span class="itemName">地址:</span>
<span class="itemValue"> <span class="itemValue">
{{ firstPageObj.merchantAddress || '-' }} {{ firstPageObj.merchantAddress || '-' }}
</span> </span>
</el-col> </el-col>
<el-col :span="10"> <el-col :span="10" class="flexCol">
<span class="itemName itemNameCol2">联系人:</span> <span class="itemName itemNameCol2">联系人:</span>
<span class="itemValue">{{ firstPageObj.merchantLegalPerson || '-' }}</span> <span class="itemValue">{{ firstPageObj.merchantLegalPerson || '-' }}</span>
</el-col> </el-col>
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="14"> <el-col :span="14" class="flexCol">
<span class="itemName">联系电话:</span> <span class="itemName">联系电话:</span>
<span class="itemValue">{{ firstPageObj.merchantLegalPersonPhone || '-' }}</span> <span class="itemValue">{{ firstPageObj.merchantLegalPersonPhone || '-' }}</span>
</el-col> </el-col>
<el-col :span="10"> <el-col :span="10" class="flexCol">
<span class="itemName itemNameCol2">营业范围:</span> <span class="itemName itemNameCol2">营业范围:</span>
<span class="itemValue">{{ firstPageObj.businessScopName || '-' }}</span> <!-- roleData.businessScopName = roleData.businessScopName ? roleData.businessScopName + ',' + roleData.businessScopeCustomize : roleData.businessScopeCustomize -->
<span class="itemValue">{{ firstPageObj.businessScopName ? firstPageObj.businessScopName + ',' + firstPageObj.businessScopeCustomize : firstPageObj.businessScopeCustomize ? firstPageObj.businessScopeCustomize : '-' }}</span>
</el-col> </el-col>
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="24"> <el-col :span="12" class="flexCol">
<span class="itemName">主营品牌:</span> <span class="itemName">主营品牌:</span>
<span class="itemValue">{{ firstPageObj.merchantBrandName || '-' }}</span> <span class="itemValue">{{ firstPageObj.merchantBrandName || '-' }}</span>
</el-col> </el-col>
...@@ -164,7 +167,8 @@ ...@@ -164,7 +167,8 @@
<el-button type="primary" size="small" @click="filterTreeListFun">查询</el-button> <el-button type="primary" size="small" @click="filterTreeListFun">查询</el-button>
</div> </div>
<div class="secondTreeWrap"> <div class="secondTreeWrap">
<el-tree ref="tree" :default-expanded-keys="expandedIds" :data="secondTreeList" node-key="id" :filter-node-method="filterNode"> <!-- :default-expanded-keys="expandedIds" -->
<el-tree ref="tree" default-expand-all :data="secondTreeList" node-key="id" :filter-node-method="filterNode">
<!--知识点过长处理,鼠标悬浮文字弹框显示全部内容--> <!--知识点过长处理,鼠标悬浮文字弹框显示全部内容-->
<span slot-scope="{ node }" class="custom-tree-node"> <span slot-scope="{ node }" class="custom-tree-node">
<el-tooltip class="item" effect="dark" :content="node.label" placement="top-start"> <el-tooltip class="item" effect="dark" :content="node.label" placement="top-start">
...@@ -291,7 +295,7 @@ export default { ...@@ -291,7 +295,7 @@ export default {
}, },
{ {
label: '修改内容', label: '修改内容',
prop: 'modifyContent' prop: 'action'
}, },
{ {
label: '操作人', label: '操作人',
...@@ -515,6 +519,9 @@ export default { ...@@ -515,6 +519,9 @@ export default {
// padding-bottom: 30px; // padding-bottom: 30px;
.el-row { .el-row {
margin-top: 20px; margin-top: 20px;
.flexCol {
display: flex;
}
.itemName { .itemName {
display: inline-block; display: inline-block;
margin-right: 10px; margin-right: 10px;
...@@ -527,14 +534,17 @@ export default { ...@@ -527,14 +534,17 @@ export default {
line-height: 20px; line-height: 20px;
} }
.itemNameCol2 { .itemNameCol2 {
width: 90px; width: 100px;
} }
.itemValue { .itemValue {
height: 20px; // height: 20px;
font-size: 14px; font-size: 14px;
font-weight: 400; font-weight: 400;
color: #666666; color: #666666;
line-height: 20px;
// line-height: 20px;
display: inline-block;
width: calc(100% - 200px);
} }
.account-type-span { .account-type-span {
display: inline-block; display: inline-block;
......
...@@ -241,7 +241,8 @@ export default { ...@@ -241,7 +241,8 @@ export default {
{ required: true, message: "请输入登录账户名", trigger: "blur" }, { required: true, message: "请输入登录账户名", trigger: "blur" },
], ],
merchantLoginPassword: [ merchantLoginPassword: [
{ required: true, message: "请输入登录账户名", trigger: "blur" }, { required: true, message: "请输入登录密码", trigger: "blur" },
{ min: 6, max: 15, message: "长度在 6 到 15 个字符", trigger: "blur" }
], ],
}, },
}; };
...@@ -306,7 +307,8 @@ export default { ...@@ -306,7 +307,8 @@ export default {
}, },
//保存 //保存
handleSave(status) { handleSave(status) {
if (this.$refs.productForm.getSelectInfo().length == 0) { let product = this.$refs.productForm.getSelectInfo();
if (product && product.every((item) => item.products.length == 0)) {
this.$message.error("请选择产品"); this.$message.error("请选择产品");
return; return;
} }
...@@ -327,13 +329,46 @@ export default { ...@@ -327,13 +329,46 @@ export default {
const pm1 = new Promise((resolve, reject) => { const pm1 = new Promise((resolve, reject) => {
this.$refs.baseInfoForm.$refs.baseForm.validate((valid) => { this.$refs.baseInfoForm.$refs.baseForm.validate((valid) => {
if (valid) resolve(); if (valid) resolve();
setTimeout(() => {
var isError = document.getElementsByClassName("is-error");
isError[0].querySelector("input").focus();
}, 100);
}); });
}); });
const pm2 = new Promise((resolve, reject) => { const pm2 = new Promise((resolve, reject) => {
this.$refs.accountInfoForm.validate((valid) => { this.$refs.accountInfoForm.validate((valid) => {
if (valid) resolve(); if (valid) resolve();
setTimeout(() => {
var isError = document.getElementsByClassName("is-error");
isError[0].querySelector("input").focus();
}, 100);
}); });
}); });
if (
this.accountAddForm.merchantType == 1 &&
this.accountAddForm.merchantOrgcode &&
!util.checkIdCard(this.accountAddForm.merchantOrgcode)
) {
this.$message.error("请输入正确的身份证号码");
document.querySelector("#app").scrollTop = 0;
setTimeout(() => {
var isError = document.getElementsByClassName("card-input");
isError[0].querySelectorAll(".el-input__inner")[1].focus();
}, 100);
return;
}
if (
this.accountAddForm.residentPhone &&
!util.checkPhone(this.accountAddForm.residentPhone)
) {
this.$message.error("请输入正确的驻店电话");
document.querySelector("#app").scrollTop = 0;
setTimeout(() => {
var isError = document.getElementsByClassName("phone-input");
isError[0].querySelector("input").focus();
}, 100);
return;
}
let params = Object.assign({}, this.accountAddForm, this.accountInfoForm); let params = Object.assign({}, this.accountAddForm, this.accountInfoForm);
if (params.bussinessTime) { if (params.bussinessTime) {
params.bussinessBegintime = params.bussinessTime[0]; params.bussinessBegintime = params.bussinessTime[0];
...@@ -418,7 +453,11 @@ export default { ...@@ -418,7 +453,11 @@ export default {
merchantFileResponses, merchantFileResponses,
merchantModel, merchantModel,
accountTypes, accountTypes,
accountType,
accounttypeId, accounttypeId,
channelId,
status,
parentId,
} = res; } = res;
this.accountInfoForm.merchantLoginAccount = merchantLoginAccount; this.accountInfoForm.merchantLoginAccount = merchantLoginAccount;
this.accountInfoForm.merchantLoginPassword = merchantLoginPassword; this.accountInfoForm.merchantLoginPassword = merchantLoginPassword;
...@@ -442,9 +481,9 @@ export default { ...@@ -442,9 +481,9 @@ export default {
}; };
}); });
} }
accounttypeId = accounttypeId ? accounttypeId.split(",") : []; this.accounttypeId = accountType ? accountType.split(",") : [];
if (accounttypeId.length > 0) { if (this.accounttypeId.length > 0) {
this.accounttypeId = accounttypeId.map((item) => { this.accounttypeId = this.accounttypeId.map((item) => {
return { return {
name: item, name: item,
}; };
...@@ -477,7 +516,12 @@ export default { ...@@ -477,7 +516,12 @@ export default {
residentPhone, residentPhone,
merchantAccountLevel, merchantAccountLevel,
merchantModel, merchantModel,
parentId,
channelId,
status,
accounttypeId: accountType,
}); });
console.log(accounttypeId);
this.$nextTick(() => { this.$nextTick(() => {
this.editStatus = false; this.editStatus = false;
}); });
......
...@@ -201,6 +201,9 @@ export default { ...@@ -201,6 +201,9 @@ export default {
{ {
label: "上级商户", label: "上级商户",
prop: "parentMerchant", prop: "parentMerchant",
formatter: (cellValue) => {
return cellValue.parentMerchant ? cellValue.parentMerchant : "--";
},
}, },
{ {
label: "账户状态", label: "账户状态",
...@@ -221,7 +224,7 @@ export default { ...@@ -221,7 +224,7 @@ export default {
}, },
{ {
label: "更新时间", label: "更新时间",
prop: "updatedTime" prop: "updatedTime",
}, },
], ],
}, },
...@@ -250,13 +253,13 @@ export default { ...@@ -250,13 +253,13 @@ export default {
this.$apis.store.findAllDictData(params).then((res) => { this.$apis.store.findAllDictData(params).then((res) => {
if (res) { if (res) {
if (dictType == "account_level") { if (dictType == "account_level") {
this.accountLevel = res; this.accountLevel = [{ dictValue: "", dictLabel: "全部" }].concat(res);
} }
if (dictType == "account_type") { if (dictType == "account_type") {
this.accountType = res; this.accountType = res;
} }
if (dictType == "merchant_status") { if (dictType == "merchant_status") {
this.merchantStatus = res; this.merchantStatus = [{ dictValue: "", dictLabel: "全部" }].concat(res);
} }
} }
}); });
......
...@@ -125,7 +125,7 @@ export default { ...@@ -125,7 +125,7 @@ export default {
this.$refs.cascaderRef.dropDownVisible = false this.$refs.cascaderRef.dropDownVisible = false
}, },
getDepartmentList() { getDepartmentList() {
this.$apis.baseInfo.getDepartment({ id: 1 }).then(res => { this.$apis.baseInfo.getDepartment({ id: 1,flag:'false' }).then(res => {
this.departmentList = this.traverse(1,res, 'relevanceMerchant') this.departmentList = this.traverse(1,res, 'relevanceMerchant')
}) })
}, },
......
...@@ -370,7 +370,7 @@ export default { ...@@ -370,7 +370,7 @@ export default {
// this.findPermissionsByMerId() // this.findPermissionsByMerId()
} }
} }
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.account-body { .account-body {
...@@ -469,4 +469,4 @@ export default { ...@@ -469,4 +469,4 @@ export default {
margin-bottom: 12px; margin-bottom: 12px;
} }
} }
</style> </style>
\ No newline at end of file \ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!