Commit b8aa36f0 by yangming

商户

1 parent 56794448
......@@ -43,7 +43,7 @@
</el-col>
<el-col :span="12">
<el-form-item label="登录密码" prop="merchantLoginPassword">
<el-input maxlength="15" :disabled="nextStatus" size="small" type="password" v-model="accountInfoForm.merchantLoginPassword" placeholder="请输入登录密码"></el-input>
<el-input maxlength="20" :disabled="nextStatus" size="small" type="password" v-model="accountInfoForm.merchantLoginPassword" placeholder="请输入登录密码(必须包含6-20个字母+数字)" show-password></el-input>
</el-form-item>
</el-col>
</el-row>
......@@ -109,6 +109,13 @@ export default {
callback()
}
}
const validatePwd = (rule, value, callback) => {
if (!(/^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]{6,20}$/.test(value))) {
callback(new Error('请输入正确的6-20个字母+数字密码'))
} else {
callback()
}
}
return {
nextStatus: false,
accountTypesRule: false,
......@@ -153,7 +160,8 @@ export default {
],
merchantLoginPassword: [
{ required: true, message: '请输入登录密码', trigger: 'blur' },
{ min: 6, max: 15, message: '长度在 6 到 15 个字符', trigger: 'blur' }
{ min: 6, max: 20, message: '长度在 6 到 20 个字符', trigger: 'blur' },
{ validator: validatePwd, trigger: 'blur' }
]
}
}
......
......@@ -4,123 +4,51 @@
<div class="el-tabs__header is-top">
<div class="el-tabs__nav-wrap is-top">
<div class="el-tabs__nav-scroll">
<div
role="tablist"
class="el-tabs__nav is-top"
style="transform: translateX(0px)"
>
<div
class="el-tabs__active-bar is-top"
:style="{ width: '84px', transform: 'translateX(' + tabWidth + 'px)' }"
></div>
<div
@click="hanleTab(1)"
id="tab-first"
aria-controls="pane-first"
role="tab"
aria-selected="true"
tabindex="0"
class="el-tabs__item is-top"
:class="{ 'is-active': step == 'first' }"
>
修改功能权限
</div>
<div
@click="hanleTab(2)"
id="tab-second"
aria-controls="pane-second"
role="tab"
tabindex="-1"
class="el-tabs__item is-top"
:class="{ 'is-active': step == 'second' }"
>
修改基本信息
</div>
<div role="tablist" class="el-tabs__nav is-top" style="transform: translateX(0px)">
<div class="el-tabs__active-bar is-top" :style="{ width: '84px', transform: 'translateX(' + tabWidth + 'px)' }"></div>
<div @click="hanleTab(1)" id="tab-first" aria-controls="pane-first" role="tab" aria-selected="true" tabindex="0" class="el-tabs__item is-top" :class="{ 'is-active': step == 'first' }">修改功能权限</div>
<div @click="hanleTab(2)" id="tab-second" aria-controls="pane-second" role="tab" tabindex="-1" class="el-tabs__item is-top" :class="{ 'is-active': step == 'second' }">修改基本信息</div>
</div>
</div>
</div>
</div>
<div class="el-tabs__content">
<div
data-v-db55ad92=""
role="tabpanel"
id="pane-first"
aria-labelledby="tab-first"
class="el-tab-pane"
></div>
<div
data-v-db55ad92=""
role="tabpanel"
aria-hidden="true"
id="pane-second"
aria-labelledby="tab-second"
class="el-tab-pane"
style="display: none"
></div>
<div data-v-db55ad92="" role="tabpanel" id="pane-first" aria-labelledby="tab-first" class="el-tab-pane"></div>
<div data-v-db55ad92="" role="tabpanel" aria-hidden="true" id="pane-second" aria-labelledby="tab-second" class="el-tab-pane" style="display: none"></div>
</div>
</div>
<div v-show="step == 'second'">
<div class="account-body scrm-box-f">
<div class="form-title">修改账户信息</div>
<el-form
ref="accountInfoForm"
:model="accountInfoForm"
class="account-body-form"
label-width="120px"
:rules="accountInfoRules"
>
<el-form ref="accountInfoForm" :model="accountInfoForm" class="account-body-form" label-width="120px" :rules="accountInfoRules">
<el-row>
<el-col :span="12">
<el-form-item label="登录账户名" prop="merchantLoginAccount">
<el-input
readonly
size="small"
v-model="accountInfoForm.merchantLoginAccount"
placeholder="请输入登录账户名"
>
</el-input>
<el-input readonly size="small" v-model="accountInfoForm.merchantLoginAccount" placeholder="请输入登录账户名"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item
size="small"
label="登录密码"
prop="merchantLoginPassword"
class="form-row"
>
<el-input
type="password"
:readonly="pwdStatus ? 'readonly' : false"
v-model="accountInfoForm.merchantLoginPassword"
placeholder="请输入登录密码"
></el-input>
<el-form-item size="small" label="登录密码" prop="merchantLoginPassword" class="form-row">
<el-input type="password" :readonly="pwdStatus ? 'readonly' : false" v-model="accountInfoForm.merchantLoginPassword" placeholder="请输入登录密码(必须包含6-20个字母+数字)" show-password></el-input>
<el-button
type="primary"
class="form-btn"
@click="
pwdStatus = false;
accountInfoForm.merchantLoginPassword = '';
pwdStatus = false
accountInfoForm.merchantLoginPassword = ''
"
>重置密码</el-button
>
重置密码
</el-button>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="16">
<el-form-item label="账户类型">
<auto-button
v-for="(item, index) in accountTypes"
:key="index"
:btnLabel="item.accounttypeName"
:btnValue="item.accounttypeId"
stopClick="true"
:typeStatus="
accounttypeId.indexOf(item.accounttypeId) == -1 ? true : false
"
></auto-button>
<auto-button v-for="(item, index) in accountTypes" :key="index" :btnLabel="item.accounttypeName" :btnValue="item.accounttypeId" stopClick="true" :typeStatus="accounttypeId.indexOf(item.accounttypeId) == -1 ? true : false"></auto-button>
</el-form-item>
</el-col>
</el-row>
......@@ -128,13 +56,7 @@
</div>
<div class="account-body scrm-box-f">
<div class="form-title">修改企业信息</div>
<base-info
ref="baseInfoForm"
:brandData="brandData"
:accountAddForm="accountAddForm"
:businessScopeCustomize="businessScopeCustomize"
:businessOption="businessOption"
></base-info>
<base-info ref="baseInfoForm" :brandData="brandData" :accountAddForm="accountAddForm" :businessScopeCustomize="businessScopeCustomize" :businessOption="businessOption"></base-info>
</div>
</div>
<div v-show="step == 'first'">
......@@ -144,15 +66,11 @@
class="footer-panel"
:style="{
left: footerLeft + 'px',
width: footerWidth + 'px',
width: footerWidth + 'px'
}"
>
<el-button type="primary" @click="handleSave()" v-show="step == 'first'"
>确定</el-button
>
<el-button type="primary" @click="handleNext()" v-show="step == 'second'"
>确定</el-button
>
<el-button type="primary" @click="handleSave()" v-show="step == 'first'">确定</el-button>
<el-button type="primary" @click="handleNext()" v-show="step == 'second'">确定</el-button>
<el-button type="primary" @click="handleCancel">取消</el-button>
</div>
<el-dialog :visible.sync="dialogMapVisible" width="60%">
......@@ -166,39 +84,46 @@
</template>
<script>
import util from "@/utils/util";
import mapView from "@/components/mapView/index";
import autoButton from "@/components/auto-button/index";
import selectProduct from "./components/selectProduct";
import baseInfo from "./components/baseInfo";
import util from '@/utils/util'
import mapView from '@/components/mapView/index'
import autoButton from '@/components/auto-button/index'
import selectProduct from './components/selectProduct'
import baseInfo from './components/baseInfo'
export default {
name: "index",
name: 'index',
components: {
mapView,
autoButton,
selectProduct,
baseInfo,
baseInfo
},
data() {
const validatePwd = (rule, value, callback) => {
if (!/^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]{6,20}$/.test(value)) {
callback(new Error('请输入正确的6-20个字母+数字密码'))
} else {
callback()
}
}
return {
editStatus: false,
detailFirst: {},
tabWidth: 0,
editInfo: {},
pwdStatus: true,
step: "first",
filterText: "",
step: 'first',
filterText: '',
brandData: [],
defaultProps: {
children: "children",
label: "label",
children: 'children',
label: 'label'
},
parentId: "1",
parentId: '1',
mapHeight: 400,
typeStatus: false,
loadingImg: false,
dialogMapVisible: false,
businessScopeCustomize: [{ name: "" }],
businessScopeCustomize: [{ name: '' }],
accountAddForm: {
id: null,
isloginName: null,
......@@ -218,12 +143,12 @@ export default {
merchantModel: null,
businessScope: [],
bussinessTime: [],
merchantFiles: [],
merchantFiles: []
},
accounttypeId: [],
accountInfoForm: {
merchantLoginAccount: "",
merchantLoginPassword: "",
merchantLoginAccount: '',
merchantLoginPassword: ''
},
accountTypes: [],
accountLevel: [],
......@@ -231,281 +156,236 @@ export default {
businessOption: [],
accountValidityPeriod: [],
baseRules: {
merchantName: [{ required: true, message: "请输入商户名称", trigger: "blur" }],
merchantLegalPersonPhone: [
{ required: true, message: "请输入联系电话", trigger: "blur" },
],
merchantName: [{ required: true, message: '请输入商户名称', trigger: 'blur' }],
merchantLegalPersonPhone: [{ required: true, message: '请输入联系电话', trigger: 'blur' }]
},
accountInfoRules: {
merchantLoginAccount: [
{ required: true, message: "请输入登录账户名", trigger: "blur" },
],
merchantLoginAccount: [{ required: true, message: '请输入登录账户名', trigger: 'blur' }],
merchantLoginPassword: [
{ required: true, message: "请输入登录密码", trigger: "blur" },
{ min: 6, max: 15, message: "长度在 6 到 15 个字符", trigger: "blur" },
],
},
};
{ required: true, message: '请输入登录密码', trigger: 'blur' },
{ min: 6, max: 20, message: '长度在 6 到 20 个字符', trigger: 'blur' },
{ validator: validatePwd, trigger: 'blur' }
]
}
}
},
watch: {
filterText(val) {
this.$refs.brandTree.filter(val);
this.$refs.brandTree.filter(val)
},
accountAddForm: {
handler() {
this.editStatus = true;
this.editStatus = true
},
deep: true,
deep: true
},
accountInfoForm: {
handler() {
this.editStatus = true;
this.editStatus = true
},
deep: true,
},
deep: true
}
},
methods: {
hanleTab(status) {
if (this.editStatus) {
this.$confirm("是否保存修改信息?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
this.$confirm('是否保存修改信息?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
.then(() => {
status == 1? this.handleNext(status):this.handleSave(status);
status == 1 ? this.handleNext(status) : this.handleSave(status)
})
.catch(() => {
this.tabCancel(status);
});
this.tabCancel(status)
})
} else {
this.handleTabs(status);
this.handleTabs(status)
}
},
tabCancel(status) {
if (status == 2) {
this.$refs.productForm.resetView();
this.$refs.productForm.resetView()
} else {
this.renderView(this.detailFirst);
this.pwdStatus = true;
this.renderView(this.detailFirst)
this.pwdStatus = true
}
this.handleTabs(status);
this.handleTabs(status)
},
handleTabs(status) {
this.editStatus = false;
if (status == 1 && this.step == "second") {
this.tabWidth = 0;
this.step = "first";
this.editStatus = false
if (status == 1 && this.step == 'second') {
this.tabWidth = 0
this.step = 'first'
}
if (status == 2 && this.step == "first") {
this.step = "second";
this.tabWidth = 124;
if (status == 2 && this.step == 'first') {
this.step = 'second'
this.tabWidth = 124
}
},
handleCancel() {
this.$router.push("/account/index");
this.$router.push('/account/index')
},
//保存
handleSave(status) {
let product = this.$refs.productForm.getSelectInfo();
if (product && product.every((item) => item.products.length == 0)) {
this.$message.error("请选择产品");
return;
let product = this.$refs.productForm.getSelectInfo()
if (product && product.every(item => item.products.length == 0)) {
this.$message.error('请选择产品')
return
}
let accountTypes = JSON.stringify(this.$refs.productForm.getSelectInfo());
let accountTypes = JSON.stringify(this.$refs.productForm.getSelectInfo())
let params = {
accountTypes,
status: 2,
merchantId: this.accountAddForm.id,
};
this.$apis.store.updatePermissions(params).then((res) => {
if (res) {
status ? this.handleTabs(status) : this.$router.push("/account/index");
}
});
merchantId: this.accountAddForm.id
}
this.$apis.store.updatePermissions(params).then(res => {
if (res) {
status ? this.handleTabs(status) : this.$router.push('/account/index')
}
})
},
//下一步
handleNext(status) {
const pm1 = new Promise((resolve, reject) => {
this.$refs.baseInfoForm.$refs.baseForm.validate((valid) => {
if (valid) resolve();
this.$refs.baseInfoForm.$refs.baseForm.validate(valid => {
if (valid) resolve()
setTimeout(() => {
var isError = document.getElementsByClassName("is-error");
isError[0].querySelector("input").focus();
}, 100);
});
});
var isError = document.getElementsByClassName('is-error')
isError[0].querySelector('input').focus()
}, 100)
})
})
const pm2 = new Promise((resolve, reject) => {
this.$refs.accountInfoForm.validate((valid) => {
if (valid) resolve();
this.$refs.accountInfoForm.validate(valid => {
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;
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;
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;
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;
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) {
params.bussinessBegintime = params.bussinessTime[0];
params.bussinessEndtime = params.bussinessTime[1];
params.bussinessBegintime = params.bussinessTime[0]
params.bussinessEndtime = params.bussinessTime[1]
} else {
params.bussinessBegintime = "";
params.bussinessEndtime = "";
params.bussinessBegintime = ''
params.bussinessEndtime = ''
}
if (params.businessScope) {
params.businessScope = params.businessScope.join(",");
params.businessScope = params.businessScope.join(',')
}
params.merchantBrand = this.$refs.baseInfoForm.$refs.brandTree
.getCheckedKeys()
.join(",");
params.isloginName ? (params.isloginName = 1) : (params.isloginName = 0);
let businessScopeCustomize = this.businessScopeCustomize.map((item) => item.name);
params.businessScopeCustomize = businessScopeCustomize.join(",");
params.merchantFiles = JSON.stringify(params.merchantFiles);
params.merchantBrand = this.$refs.baseInfoForm.$refs.brandTree.getCheckedKeys().join(',')
params.isloginName ? (params.isloginName = 1) : (params.isloginName = 0)
let businessScopeCustomize = this.businessScopeCustomize.map(item => item.name)
params.businessScopeCustomize = businessScopeCustomize.join(',')
params.merchantFiles = JSON.stringify(params.merchantFiles)
Promise.all([pm1, pm2]).then(() => {
this.$apis.store.updateMerchant(params).then((res) => {
this.$apis.store.updateMerchant(params).then(res => {
if (res) {
status ? this.handleTabs(status) : this.$router.push("/account/index");
status ? this.handleTabs(status) : this.$router.push('/account/index')
}
});
});
})
})
},
async findAllDictData() {
let accountLevel = this.$apis.store.findAllDictData({ dictType: "account_level" });
let accountType = this.$apis.store.findAllDictData({ dictType: "account_type" });
let accountLevel = this.$apis.store.findAllDictData({ dictType: 'account_level' })
let accountType = this.$apis.store.findAllDictData({ dictType: 'account_type' })
let businessOption = this.$apis.store.findAllDictData({
dictType: "business_scope",
});
await Promise.all([accountLevel, accountType, businessOption]).then((res) => {
[this.accountLevel, this.accountType, this.businessOption] = res;
});
this.findMerchantDetail();
dictType: 'business_scope'
})
await Promise.all([accountLevel, accountType, businessOption]).then(res => {
;[this.accountLevel, this.accountType, this.businessOption] = res
})
this.findMerchantDetail()
},
async findMerchantDetail() {
this.$apis.store
.findMerchantDetail({
id: this.accountAddForm.id,
id: this.accountAddForm.id
})
.then((res) => {
let para;
.then(res => {
let para
if (res.parentMerchant) {
para = {
id: this.accountAddForm.id,
parentId: res.parentId,
accountlevel: res.merchantAccountLevel,
};
accountlevel: res.merchantAccountLevel
}
} else {
para = {
ids: res.accountType,
merchantId: res.id,
accountlevel: res.merchantAccountLevel,
};
accountlevel: res.merchantAccountLevel
}
}
this.$refs.productForm.accountTypeSearchRequest(para, res.parentMerchant);
this.detailFirst = util.deepClone(res);
this.renderView(res);
});
this.$refs.productForm.accountTypeSearchRequest(para, res.parentMerchant)
this.detailFirst = util.deepClone(res)
this.renderView(res)
})
},
renderView(res) {
let {
isloginName,
bussinessBegintime,
bussinessEndtime,
lat,
lng,
merchantAddress,
merchantName,
merchantAbbreviation,
merchantType,
merchantOrgcode,
merchantLegalPerson,
merchantLegalPersonPhone,
residentContact,
residentPhone,
merchantLoginAccount,
merchantLoginPassword,
merchantAccountLevel,
businessScope,
businessScopeCustomize,
merchantBrand,
merchantFileResponses,
merchantModel,
accountTypes,
accountType,
accounttypeId,
channelId,
status,
parentId,
} = res;
this.accountInfoForm.merchantLoginAccount = merchantLoginAccount;
this.accountInfoForm.merchantLoginPassword = merchantLoginPassword;
this.accountTypes = accountTypes;
this.accountAddForm.businessScope = businessScope ? businessScope.split(",") : [];
let { isloginName, bussinessBegintime, bussinessEndtime, lat, lng, merchantAddress, merchantName, merchantAbbreviation, merchantType, merchantOrgcode, merchantLegalPerson, merchantLegalPersonPhone, residentContact, residentPhone, merchantLoginAccount, merchantLoginPassword, merchantAccountLevel, businessScope, businessScopeCustomize, merchantBrand, merchantFileResponses, merchantModel, accountTypes, accountType, accounttypeId, channelId, status, parentId } = res
this.accountInfoForm.merchantLoginAccount = merchantLoginAccount
this.accountInfoForm.merchantLoginPassword = merchantLoginPassword
this.accountTypes = accountTypes
this.accountAddForm.businessScope = businessScope ? businessScope.split(',') : []
if (this.accountAddForm.businessScope.length > 0) {
for (let i in this.accountAddForm.businessScope) {
this.accountAddForm.businessScope[i] = parseInt(
this.accountAddForm.businessScope[i]
);
this.accountAddForm.businessScope[i] = parseInt(this.accountAddForm.businessScope[i])
}
}
this.accountAddForm.bussinessTime = [bussinessBegintime, bussinessEndtime];
businessScopeCustomize = businessScopeCustomize
? businessScopeCustomize.split(",")
: [];
this.accountAddForm.bussinessTime = [bussinessBegintime, bussinessEndtime]
businessScopeCustomize = businessScopeCustomize ? businessScopeCustomize.split(',') : []
if (businessScopeCustomize.length > 0) {
this.businessScopeCustomize = businessScopeCustomize.map((item) => {
this.businessScopeCustomize = businessScopeCustomize.map(item => {
return {
name: item,
};
});
}else {
this.businessScopeCustomize = [{name:''}];
name: item
}
})
} else {
this.businessScopeCustomize = [{ name: '' }]
}
this.accounttypeId = accountType ? accountType.split(",") : [];
this.accounttypeId = accountType ? accountType.split(',') : []
if (this.accounttypeId.length > 0) {
this.accounttypeId = this.accounttypeId.map((item) => {
this.accounttypeId = this.accounttypeId.map(item => {
return {
name: item,
};
});
name: item
}
})
}
if (merchantFileResponses.length > 0) {
this.accountAddForm.merchantFiles = merchantFileResponses.map((item) => {
this.accountAddForm.merchantFiles = merchantFileResponses.map(item => {
return {
fileUrl: item.fileUrl,
};
});
fileUrl: item.fileUrl
}
})
}
merchantBrand = merchantBrand ? merchantBrand.split(",") : [];
merchantBrand = merchantBrand ? merchantBrand.split(',') : []
for (let i in merchantBrand) {
merchantBrand[i] = parseInt(merchantBrand[i]);
merchantBrand[i] = parseInt(merchantBrand[i])
}
this.$refs.baseInfoForm.$refs.brandTree.setCheckedKeys(merchantBrand);
this.$refs.baseInfoForm.$refs.brandTree.setCheckedKeys(merchantBrand)
this.accountAddForm = Object.assign(this.accountAddForm, {
isloginName: isloginName ? true : false,
lat,
......@@ -524,29 +404,28 @@ export default {
parentId,
channelId,
status,
accounttypeId: accountType,
});
accounttypeId: accountType
})
this.$nextTick(() => {
this.$refs.baseInfoForm.$refs.baseForm.validate();
this.editStatus = false;
});
this.$refs.baseInfoForm.$refs.baseForm.validate()
this.editStatus = false
})
},
getCarbrandTree() {
this.$apis.store.getCarbrandTree({}).then((res) => {
this.brandData = res;
});
},
this.$apis.store.getCarbrandTree({}).then(res => {
this.brandData = res
})
}
},
mounted() {
document.querySelector("#app").scrollTop = 0;
this.footerLeft = document.querySelector(".base-container-right").offsetLeft;
this.footerWidth = document.documentElement.clientWidth - this.footerLeft;
this.accountAddForm.id = this.$route.params.id;
this.getCarbrandTree();
this.findAllDictData();
},
};
document.querySelector('#app').scrollTop = 0
this.footerLeft = document.querySelector('.base-container-right').offsetLeft
this.footerWidth = document.documentElement.clientWidth - this.footerLeft
this.accountAddForm.id = this.$route.params.id
this.getCarbrandTree()
this.findAllDictData()
}
}
</script>
<style scoped lang="scss">
......
......@@ -7,7 +7,7 @@
> -->
</div>
<div class="follow-form">
<el-form :inline="true" :model="searchForm" class="follow-form-item" label-width="80px">
<el-form :inline="true" :model="searchForm" class="follow-form-item" label-width="90px">
<el-row>
<el-form-item size="small" label="关联企微">
<el-select v-model="searchForm.isRelevance" placeholder="请选择">
......@@ -61,6 +61,17 @@
<el-form-item class="merchant-wx" size="small">
<el-input size="small" v-model="searchForm.merchantName" placeholder="请输入商户名称/关联的企业微信名"></el-input>
</el-form-item>
<el-form-item size="small" label="商户号">
<el-input size="small" v-model="searchForm.merchantNo" onkeyup="value=value.replace(/[^\d]/g,'')" placeholder="请输入商户号,仅限11位" maxlength="11"></el-input>
</el-form-item>
<el-form-item size="small" style="float: right" v-if="$globalState.session.accountLevel == 4">
<el-button type="primary" @click="handleSearch">查询</el-button>
</el-form-item>
</el-row>
<el-row v-if="$globalState.session.accountLevel != 4">
<el-form-item size="small" label="上级商户号">
<el-input size="small" v-model="searchForm.parentMerchantNo" onkeyup="value=value.replace(/[^\d]/g,'')" placeholder="请输入上级商户号,仅限11位" maxlength="11"></el-input>
</el-form-item>
<el-form-item size="small" style="float: right">
<el-button type="primary" @click="handleSearch">查询</el-button>
</el-form-item>
......@@ -255,6 +266,11 @@ export default {
background: #ffffff;
box-shadow: 0 10px 20px 0 rgba(88, 80, 255, 0.1);
padding: 10px;
/deep/ {
.el-input--small .el-input__inner {
width: 215px;
}
}
}
.accountType-row {
text-align: left;
......@@ -287,8 +303,8 @@ export default {
.merchant-wx {
margin-left: 20px;
/deep/ {
.el-input__inner {
width: 310px;
.el-input--small .el-input__inner {
width: 325px;
}
}
}
......
......@@ -5,39 +5,11 @@
</div> -->
<div class="container edit-box">
<p class="edit-title">员工基本信息</p>
<glsx-combi-form
style="margin: 20px 20px 0 0;"
ref="editFormRef"
defaultWidth="320px"
@handleImgDelete="handleImgDelete"
:isBlock="isBlock"
:formRef="editChildRef"
:formObj="editForm"
:formData="editFormData"
:formRules="editRule"
isEdit="true"
>
<glsx-combi-form style="margin: 20px 20px 0 0" ref="editFormRef" defaultWidth="320px" @handleImgDelete="handleImgDelete" :isBlock="isBlock" :formRef="editChildRef" :formObj="editForm" :formData="editFormData" :formRules="editRule" isEdit="true">
<template slot="merchantId" slot-scope="item">
<span
class="txt-ellipsis"
v-if="routeInfo.addOrEdit == 2 || (routeInfo.addOrEdit == 1 && userInfo.accountLevel == 4)"
:title="editForm.merchantName"
>{{ editForm.merchantName}}</span>
<el-select
v-else
:style="{ width: item.scope.width }"
v-model="editForm[item.scope.name]"
:clearable="item.scope.isClear || false"
:placeholder="'请选择' + item.scope.label"
:filterable="!item.scope.noFilter"
@change="handleChangeMerchant($event)"
>
<el-option
v-for="subItem in baseData.allMerchantList"
:key="subItem[item.scope.optionId]"
:label="subItem[item.scope.optionLabel]"
:value="subItem[item.scope.optionId]"
></el-option>
<span class="txt-ellipsis" v-if="routeInfo.addOrEdit == 2 || (routeInfo.addOrEdit == 1 && userInfo.accountLevel == 4)" :title="editForm.merchantName">{{ editForm.merchantName }}</span>
<el-select v-else :style="{ width: item.scope.width }" v-model="editForm[item.scope.name]" :clearable="item.scope.isClear || false" :placeholder="'请选择' + item.scope.label" :filterable="!item.scope.noFilter" @change="handleChangeMerchant($event)">
<el-option v-for="subItem in baseData.allMerchantList" :key="subItem[item.scope.optionId]" :label="subItem[item.scope.optionLabel]" :value="subItem[item.scope.optionId]"></el-option>
</el-select>
<!-- <select-page v-else :form="editForm" width="320" :targetItem="item.scope" @handleChange="handleChangeMerchant"></select-page> -->
</template>
......@@ -49,26 +21,9 @@
<el-button class="m-l-10 el-icon-refresh" type="primary" @click="handleRefresh">刷新</el-button>
</template>
<template slot="visibleInferiorMer" slot-scope="item">
<el-input
:style="{ width: item.width || '320px' }"
placeholder="可见商户"
v-model="filterText"
></el-input>
<el-button class="m-l-10" type="primary" @click="checkAll">{{isCheckAll ? '全不选':'全选'}}</el-button>
<el-tree
v-show="baseData.merchantTree.length != 0"
show-checkbox
check-on-click-node
check-strictly
class="filter-tree"
node-key="id"
:data="baseData.merchantTree"
:props="defaultProps"
default-expand-all
:filter-node-method="filterNode"
ref="tree"
@check="handleClickNode"
></el-tree>
<el-input :style="{ width: item.width || '320px' }" placeholder="可见商户" v-model="filterText"></el-input>
<el-button class="m-l-10" type="primary" @click="checkAll">{{ isCheckAll ? '全不选' : '全选' }}</el-button>
<el-tree v-show="baseData.merchantTree.length != 0" show-checkbox check-on-click-node check-strictly class="filter-tree" node-key="id" :data="baseData.merchantTree" :props="defaultProps" default-expand-all :filter-node-method="filterNode" ref="tree" @check="handleClickNode"></el-tree>
</template>
</glsx-combi-form>
</div>
......@@ -113,6 +68,7 @@ export default {
value: 'id',
label: 'label'
},
editStatus: false,
editForm: {
merchantId: '',
merchantName: '',
......@@ -248,6 +204,12 @@ export default {
watch: {
filterText(val) {
this.$refs.tree.filter(val)
},
editForm: {
handler() {
this.editStatus = true
},
deep: true
}
},
......@@ -289,6 +251,9 @@ export default {
fileName: res.merchantFileResponse ? res.merchantFileResponse.fileName : ''
}
this.handleChangeMerchant(this.editForm.merchantId, true)
this.$nextTick(()=>{
this.editStatus = false
})
})
},
handleChangeMerchant(e, editRecovery = false) {
......@@ -394,16 +359,30 @@ export default {
type: res.code == '0' ? 'success' : 'error'
})
if (res.code == '0') {
this.handleCancel()
this.$router.push({
path: '/employee/index'
})
}
})
}
})
},
handleCancel() {
this.$router.push({
path: '/employee/index'
})
if (this.editStatus) {
this.$confirm('当前有内容信息未保存,是否继续返回?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$router.push({
path: '/employee/index'
})
})
} else {
this.$router.push({
path: '/employee/index'
})
}
},
getAllId(data, arr = []) {
if (data) {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!