Commit 9660ff38 by 李长胜

修改

1 parent 28f5db39
...@@ -9,12 +9,15 @@ ...@@ -9,12 +9,15 @@
}, },
"dependencies": { "dependencies": {
"axios": "^0.21.1", "axios": "^0.21.1",
"cnpm": "^7.1.0",
"core-js": "^3.4.4", "core-js": "^3.4.4",
"glsx-common": "^1.4.6", "glsx-common": "^1.4.6",
"vue": "^2.6.11",
"glsx-components": "^1.1.2", "glsx-components": "^1.1.2",
"glsx-table": "^1.0.9", "glsx-table": "^1.0.9",
"vue-amap": "^0.5.10" "vue": "^2.6.11",
"vue-amap": "^0.5.10",
"vue-loader": "^15.9.8",
"vue-template-compiler": "^2.6.14"
}, },
"devDependencies": { "devDependencies": {
"@vue/cli-plugin-babel": "^4.1.0", "@vue/cli-plugin-babel": "^4.1.0",
...@@ -33,8 +36,7 @@ ...@@ -33,8 +36,7 @@
"node-sass": "^4.14.1", "node-sass": "^4.14.1",
"prettier": "^1.19.1", "prettier": "^1.19.1",
"sass-loader": "^8.0.0", "sass-loader": "^8.0.0",
"vue-cli-plugin-element": "^1.0.1", "vue-cli-plugin-element": "^1.0.1"
"vue-template-compiler": "^2.6.11"
}, },
"browserslist": [ "browserslist": [
"> 1%", "> 1%",
......
...@@ -6,23 +6,11 @@ ...@@ -6,23 +6,11 @@
</div> </div>
<div class="account-body scrm-box-f"> <div class="account-body scrm-box-f">
<div class="form-title">企业基本信息</div> <div class="form-title">企业基本信息</div>
<base-info <base-info ref="baseInfoForm" :brandData="brandData" :accountAddForm="accountAddForm" :businessScopeCustomize="businessScopeCustomize" :businessOption="businessOption"></base-info>
ref="baseInfoForm"
:brandData="brandData"
:accountAddForm="accountAddForm"
:businessScopeCustomize="businessScopeCustomize"
:businessOption="businessOption"
></base-info>
</div> </div>
<div class="account-body scrm-box-f"> <div class="account-body scrm-box-f">
<div class="form-title">账户信息</div> <div class="form-title">账户信息</div>
<el-form <el-form ref="accountInfoForm" :model="accountInfoForm" class="account-body-form" label-width="120px" :rules="accountInfoRules">
ref="accountInfoForm"
:model="accountInfoForm"
class="account-body-form"
label-width="120px"
:rules="accountInfoRules"
>
<el-row> <el-row>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="上级商户"> <el-form-item label="上级商户">
...@@ -38,18 +26,8 @@ ...@@ -38,18 +26,8 @@
<el-row> <el-row>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="账户等级" class="level-row"> <el-form-item label="账户等级" class="level-row">
<el-select <el-select size="small" :disabled="nextStatus" v-model="accountDetail.merchantAccountLevel" placeholder="请选择">
size="small" <el-option v-for="item in accountLevel" :key="item.dictValue" :label="item.dictLabel" :value="item.dictValue"></el-option>
:disabled="nextStatus"
v-model="accountDetail.merchantAccountLevel"
placeholder="请选择"
>
<el-option
v-for="item in accountLevel"
:key="item.dictValue"
:label="item.dictLabel"
:value="item.dictValue"
></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
...@@ -57,47 +35,22 @@ ...@@ -57,47 +35,22 @@
<el-row> <el-row>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="登录账户名" prop="merchantLoginAccount"> <el-form-item label="登录账户名" prop="merchantLoginAccount">
<el-input <el-input :disabled="nextStatus" size="small" maxlength="15" v-model="accountInfoForm.merchantLoginAccount" placeholder="请输入登录账户名"></el-input>
:disabled="nextStatus"
size="small"
maxlength="15"
v-model="accountInfoForm.merchantLoginAccount"
placeholder="请输入登录账户名"
></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="登录密码" prop="merchantLoginPassword"> <el-form-item label="登录密码" prop="merchantLoginPassword">
<el-input <el-input maxlength="15" :disabled="nextStatus" size="small" type="password" v-model="accountInfoForm.merchantLoginPassword" placeholder="请输入登录密码"></el-input>
maxlength="15"
:disabled="nextStatus"
size="small"
type="password"
v-model="accountInfoForm.merchantLoginPassword"
placeholder="请输入登录密码"
></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="16"> <el-col :span="16">
<div data-v-995a4ff0="" class="el-form-item is-required"> <div data-v-995a4ff0="" class="el-form-item is-required">
<label <label for="merchantLoginAccount" class="el-form-item__label" style="width: 120px">账户类型</label>
for="merchantLoginAccount"
class="el-form-item__label"
style="width: 120px"
>账户类型</label
>
<div class="el-form-item__content" style="margin-left: 120px"> <div class="el-form-item__content" style="margin-left: 120px">
<div data-v-995a4ff0="" class="el-input el-input--small"> <div data-v-995a4ff0="" class="el-input el-input--small">
<auto-button <auto-button v-for="(item, index) in accountDetail.accountTypes" :key="index" :btnLabel="item.accounttypeName" :btnValue="item.accounttypeId" :stopClick="nextStatus" @getBtnStatus="getBtnStatus"></auto-button>
v-for="(item, index) in accountDetail.accountTypes"
:key="index"
:btnLabel="item.accounttypeName"
:btnValue="item.accounttypeId"
:stopClick="nextStatus"
@getBtnStatus="getBtnStatus"
></auto-button>
</div> </div>
<div class="el-form-item__error" v-if="accountTypesRule"> <div class="el-form-item__error" v-if="accountTypesRule">
请选择账户类型 请选择账户类型
...@@ -109,22 +62,16 @@ ...@@ -109,22 +62,16 @@
</el-form> </el-form>
</div> </div>
</div> </div>
<select-product <select-product v-show="step == 2" ref="productForm" title="功能权限"></select-product>
v-show="step == 2"
ref="productForm"
title="功能权限"
></select-product>
<div <div
class="footer-panel" class="footer-panel"
:style="{ :style="{
left: footerLeft + 'px', left: footerLeft + 'px',
width: footerWidth + 'px', width: footerWidth + 'px'
}" }"
> >
<el-button type="primary" @click="handleNext" v-show="step == 1">下一步</el-button> <el-button type="primary" @click="handleNext" v-show="step == 1">下一步</el-button>
<el-button type="primary" @click="handleSave(1)" v-show="step == 2" <el-button type="primary" @click="handleSave(1)" v-show="step == 2">存草稿</el-button>
>存草稿</el-button
>
<el-button type="primary" @click="handlePrev" v-show="step == 2">上一步</el-button> <el-button type="primary" @click="handlePrev" v-show="step == 2">上一步</el-button>
<el-button type="primary" @click="handleSave(2)" v-show="step == 2">确定</el-button> <el-button type="primary" @click="handleSave(2)" v-show="step == 2">确定</el-button>
<el-button type="primary" @click="handleCancel">取消</el-button> <el-button type="primary" @click="handleCancel">取消</el-button>
...@@ -140,50 +87,50 @@ ...@@ -140,50 +87,50 @@
</template> </template>
<script> <script>
import util from "@/utils/util"; import util from '@/utils/util'
import mapView from "@/components/mapView/index"; import mapView from '@/components/mapView/index'
import autoButton from "@/components/auto-button/index"; import autoButton from '@/components/auto-button/index'
import selectProduct from "./components/selectProduct"; import selectProduct from './components/selectProduct'
import baseInfo from "./components/baseInfo"; import baseInfo from './components/baseInfo'
export default { export default {
name: "index", name: 'index',
components: { components: {
mapView, mapView,
autoButton, autoButton,
selectProduct, selectProduct,
baseInfo, baseInfo
}, },
data() { data() {
const validatePhone = (rule, value, callback) => { const validatePhone = (rule, value, callback) => {
if (!util.checkPhone(value)) { if (!util.checkPhone(value)) {
callback(new Error("请输入正确的手机号")); callback(new Error('请输入正确的手机号'))
} else { } else {
callback(); callback()
}
} }
};
return { return {
nextStatus: false, nextStatus: false,
accountTypesRule: false, accountTypesRule: false,
filterText: "", filterText: '',
brandData: [], brandData: [],
defaultProps: { defaultProps: {
children: "children", children: 'children',
label: "label", label: 'label'
}, },
parentId: "", parentId: '',
step: 1, step: 1,
mapHeight: 400, mapHeight: 400,
typeStatus: false, typeStatus: false,
loadingImg: false, loadingImg: false,
dialogMapVisible: false, dialogMapVisible: false,
businessScopeCustomize: [{ name: "" }], businessScopeCustomize: [{ name: '' }],
accountAddForm: { accountAddForm: {
status: 1, status: 1,
merchantFiles: [], merchantFiles: [],
merchantType: 1, merchantType: 1,
businessScope: [], businessScope: [],
parentId: "", parentId: '',
isloginName: false, isloginName: false
}, },
accounttypeId: [], accounttypeId: [],
accountInfoForm: {}, accountInfoForm: {},
...@@ -192,196 +139,190 @@ export default { ...@@ -192,196 +139,190 @@ export default {
businessOption: [], businessOption: [],
accountValidityPeriod: [], accountValidityPeriod: [],
baseRules: { baseRules: {
merchantName: [{ required: true, message: "请输入商户名称", trigger: "blur" }], merchantName: [{ required: true, message: '请输入商户名称', trigger: 'blur' }],
merchantLegalPersonPhone: [ merchantLegalPersonPhone: [
{ required: true, message: "请输入联系电话", trigger: "blur" }, { required: true, message: '请输入联系电话', trigger: 'blur' },
{ validator: validatePhone, trigger: "blur" }, { validator: validatePhone, trigger: 'blur' }
], ]
}, },
accountInfoRules: { accountInfoRules: {
merchantLoginAccount: [ merchantLoginAccount: [
{ required: true, message: "请输入登录账户名", trigger: "blur" }, { required: true, message: '请输入登录账户名', trigger: 'blur' },
{ 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' }
], ]
}, }
}; }
}, },
methods: { methods: {
getAddress() { getAddress() {
this.dialogMapVisible = false; this.dialogMapVisible = false
this.accountAddForm.merchantAddress = this.$refs.mapForm.address; this.accountAddForm.merchantAddress = this.$refs.mapForm.address
}, },
getBtnStatus(status, value) { getBtnStatus(status, value) {
this.accountTypesRule = false; this.accountTypesRule = false
if (status) { if (status) {
this.accounttypeId.push(value); this.accounttypeId.push(value)
} else { } else {
let idx = this.accounttypeId.findIndex((item) => item == value); let idx = this.accounttypeId.findIndex(item => item == value)
this.accounttypeId.splice(idx, 1); this.accounttypeId.splice(idx, 1)
} }
}, },
handleSave(status) { handleSave(status) {
if (this.$refs.productForm.getSelectInfo().length == 0) { if (this.$refs.productForm.getSelectInfo().length == 0) {
this.$message.error("请选择产品"); this.$message.error('请选择产品')
return; return
} }
let accountTypes = JSON.stringify(this.$refs.productForm.getSelectInfo()); let accountTypes = JSON.stringify(this.$refs.productForm.getSelectInfo())
let params = { let params = {
accountTypes, accountTypes,
status, status,
merchantId: this.parentId, merchantId: this.parentId
}; }
this.$apis.store.updatePermissions(params).then((res) => { this.$apis.store.updatePermissions(params).then(res => {
if (res) { if (res) {
this.$router.push("/account/index"); this.$router.push('/account/index')
} }
}); })
}, },
handleCancel() { handleCancel() {
this.$router.push("/account/index"); this.$router.push('/account/index')
}, },
handlePrev() { handlePrev() {
this.step = 1; this.step = 1
}, },
//下一步 //下一步
handleNext() { handleNext() {
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()
}); })
}); })
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()
}); })
}); })
if (this.accounttypeId.length == 0) { if (this.accounttypeId.length == 0) {
this.accountTypesRule = true; this.accountTypesRule = true
return; return
} }
if ( if (this.accountAddForm.merchantType == 1 && this.accountAddForm.merchantOrgcode && !util.checkisCard(this.accountAddForm.merchantOrgcode)) {
this.accountAddForm.merchantType == 1 && this.$message.error('请输入正确的身份证号码')
this.accountAddForm.merchantOrgcode && return
!util.checkisCard(this.accountAddForm.merchantOrgcode) }
) { let params = Object.assign({}, this.accountAddForm, this.accountInfoForm)
this.$message.error("请输入正确的身份证号码");
return;
}
let params = Object.assign({}, this.accountAddForm, this.accountInfoForm);
if (params.bussinessTime) { if (params.bussinessTime) {
params.bussinessBegintime = params.bussinessTime[0]; params.bussinessBegintime = params.bussinessTime[0]
params.bussinessEndtime = params.bussinessTime[1]; params.bussinessEndtime = params.bussinessTime[1]
} }
if (params.businessScope) { if (params.businessScope) {
params.businessScope = params.businessScope.join(","); params.businessScope = params.businessScope.join(',')
} }
console.log(this.$refs.baseInfoForm); console.log(this.$refs.baseInfoForm)
params.merchantBrand = this.$refs.baseInfoForm.$refs.brandTree params.merchantBrand = this.$refs.baseInfoForm.$refs.brandTree.getCheckedKeys().join(',')
.getCheckedKeys() params.isloginName ? (params.isloginName = 1) : (params.isloginName = 0)
.join(","); params.merchantAccountLevel = this.accountDetail.merchantAccountLevel
params.isloginName ? (params.isloginName = 1) : (params.isloginName = 0); let businessScopeCustomize = this.businessScopeCustomize.map(item => item.name)
params.merchantAccountLevel = this.accountDetail.merchantAccountLevel; params.businessScopeCustomize = businessScopeCustomize.join(',')
let businessScopeCustomize = this.businessScopeCustomize.map((item) => item.name); params.accounttypeId = this.accounttypeId.join(',')
params.businessScopeCustomize = businessScopeCustomize.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) {
merchant = "updateMerchant"; merchant = 'updateMerchant'
params.id = this.parentId; params.id = this.parentId
} else { } else {
merchant = "saveMerchant"; merchant = 'saveMerchant'
} }
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) {
this.step = 2; this.step = 2
this.nextStatus = true; this.nextStatus = true
if (typeof res == "number") { if (typeof res == 'number') {
this.parentId = res; this.parentId = res
let para = { let para = {
accountlevel: this.accountDetail.merchantAccountLevel, accountlevel: this.accountDetail.merchantAccountLevel,
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)
} }
}); })
}); })
}, },
findAllDictData(dictType) { findAllDictData(dictType) {
var params = { var params = {
dictType, dictType
}; }
this.$apis.store.findAllDictData(params).then((res) => { this.$apis.store.findAllDictData(params).then(res => {
if (res) { if (res) {
if (dictType == "business_scope") { if (dictType == 'business_scope') {
this.businessOption = res; this.businessOption = res
} }
} }
}); })
}, },
addBusinessScope() { addBusinessScope() {
this.businessScopeCustomize.push({ name: "" }); this.businessScopeCustomize.push({ name: '' })
}, },
removeBusinessScope(index) { removeBusinessScope(index) {
this.businessScopeCustomize.splice(index, 1); this.businessScopeCustomize.splice(index, 1)
}, },
async findMerchantDetail() { async findMerchantDetail() {
this.accountDetail = await this.$apis.store.findMerchantDetail({ this.accountDetail = await this.$apis.store.findMerchantDetail({
id: this.accountAddForm.parentId, id: this.accountAddForm.parentId
}); })
this.$apis.store.findAllDictData({ dictType: "account_level" }).then((res) => { this.$apis.store.findAllDictData({ dictType: 'account_level' }).then(res => {
if (this.accountDetail.merchantAccountLevel == 1) { if (this.accountDetail.merchantAccountLevel == 1) {
this.accountLevel = res.filter((item) => { this.accountLevel = res.filter(item => {
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
}); })
this.accountDetail.merchantAccountLevel = 4; this.accountDetail.merchantAccountLevel = 4
} }
}); })
}, },
twoMerchantDetail(pid) { twoMerchantDetail(pid) {
this.$apis.store this.$apis.store
.findMerchantDetail({ .findMerchantDetail({
id: pid, id: pid
})
.then(res => {
console.log(res)
}) })
.then((res) => {
console.log(res);
});
}, },
getCarbrandTree() { getCarbrandTree() {
this.$apis.store.getCarbrandTree({}).then((res) => { this.$apis.store.getCarbrandTree({}).then(res => {
this.brandData = res; this.brandData = res
}); })
}, }
}, },
mounted() { mounted() {
this.footerLeft = document.querySelector(".base-container-right").offsetLeft; this.footerLeft = document.querySelector('.base-container-right').offsetLeft
this.footerWidth = document.documentElement.clientWidth - this.footerLeft; this.footerWidth = document.documentElement.clientWidth - this.footerLeft
this.accountAddForm.parentId = this.$route.params.id; this.accountAddForm.parentId = this.$route.params.id
this.findMerchantDetail(); this.findMerchantDetail()
this.getCarbrandTree(); this.getCarbrandTree()
this.findAllDictData("business_scope"); this.findAllDictData('business_scope')
}, }
}; }
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
......
...@@ -82,7 +82,6 @@ export default { ...@@ -82,7 +82,6 @@ export default {
// 设置全选 // 设置全选
var arr = tabMenu.find(i => i.accounttypeId == tabName).products.find(j => j.productId == productTab).merchantProTreeResponses var arr = tabMenu.find(i => i.accounttypeId == tabName).products.find(j => j.productId == productTab).merchantProTreeResponses
this.$refs[`tree_${tabName}_${productTab}`][0].setCheckedKeys(this.getAllId(arr)) this.$refs[`tree_${tabName}_${productTab}`][0].setCheckedKeys(this.getAllId(arr))
console.log(tabMenu)
}, },
productClick(productId) { productClick(productId) {
this.productTab = productId this.productTab = productId
......
...@@ -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">
...@@ -173,15 +177,7 @@ ...@@ -173,15 +177,7 @@
</span> </span>
</el-tree> </el-tree>
</div> </div>
<!-- <form class="layui-form" action="">
<div class="layui-inline">
<div class="layui-input-inline" style="width: 232px">
<input class="layui-input" id="treeInput" placeholder="请输入" name="nameVal" />
</div>
<button type="button" id="merchantBtn" class="layui-btn">查询</button>
</div>
</form>
<ul id="merchantTree" class="ztree wrapper-tree"></ul> -->
</div> </div>
<div class="merchant-right"> <div class="merchant-right">
<div> <div>
...@@ -196,6 +192,7 @@ ...@@ -196,6 +192,7 @@
<el-button type="primary" id="tableSearch" size="small" @click="getSecondTable">查询</el-button> <el-button type="primary" id="tableSearch" size="small" @click="getSecondTable">查询</el-button>
</div> </div>
</div> </div>
<!-- :height="'350px'" -->
<GLTable ref="subMerchantTable" :tableTotal="subMerchantTableTotal" :hasPage="false" :tableData="subMerchantTableList" :hasNum="true" :pageConf="pageConf" :tableParams="secondtableParams" @refreshTable="getSecondTable"></GLTable> <GLTable ref="subMerchantTable" :tableTotal="subMerchantTableTotal" :hasPage="false" :tableData="subMerchantTableList" :hasNum="true" :pageConf="pageConf" :tableParams="secondtableParams" @refreshTable="getSecondTable"></GLTable>
</div> </div>
</div> </div>
...@@ -291,7 +288,7 @@ export default { ...@@ -291,7 +288,7 @@ export default {
}, },
{ {
label: '修改内容', label: '修改内容',
prop: 'modifyContent' prop: 'action'
}, },
{ {
label: '操作人', label: '操作人',
...@@ -336,6 +333,29 @@ export default { ...@@ -336,6 +333,29 @@ export default {
// }, // },
methods: { methods: {
//将后台返回数据中数值为空的字段全部替换为“-”
formateNullFieldData(initialData) {
const isEmpty = function(val) {
if (!String(val) || String(val) === 'null') {
return '-'
}
return val
}
var that = this
if (initialData instanceof Array) {
initialData.forEach(function(val, key, array) {
array[key] = that.formateNullFieldData(val)
})
} else if (initialData instanceof Object) {
for (let pro in initialData) {
initialData[pro] = that.formateNullFieldData(initialData[pro])
}
} else {
//数据为基本类型时
initialData = isEmpty(initialData)
}
return initialData
},
handleCancel() { handleCancel() {
this.$router.push('/account/index') this.$router.push('/account/index')
}, },
...@@ -386,7 +406,6 @@ export default { ...@@ -386,7 +406,6 @@ export default {
getSecondTree() { getSecondTree() {
this.$apis.merchant.getSecondTree({ id: this.merchantId }).then(res => { this.$apis.merchant.getSecondTree({ id: this.merchantId }).then(res => {
if (res) { if (res) {
console.log('二页的树', res)
this.secondTreeList = res this.secondTreeList = res
this.expandedIds = res.map(item => item.id) this.expandedIds = res.map(item => item.id)
} }
...@@ -403,12 +422,17 @@ export default { ...@@ -403,12 +422,17 @@ export default {
this.$apis.merchant.getSecondTable(param).then(res => { this.$apis.merchant.getSecondTable(param).then(res => {
if (res) { if (res) {
console.log('2', res) console.log('2', res)
this.subMerchantTableList = res
let data = this.formateNullFieldData(res)
this.subMerchantTableList = data
this.subMerchantTableTotal = res.length this.subMerchantTableTotal = res.length
} }
if (res && res.length == 0) { // total > 50?calc(100vh - '199px'): calc(100vh - '152px')
this.$refs.subMerchantTable.setTableHeightFun() this.$refs.subMerchantTable.tableHeightValues=`calc(100vh - 300px)`
} // if (res && res.length == 0) {
// this.$refs.subMerchantTable.setTableHeightFun()
// }
}) })
}, },
getThirdTable() { getThirdTable() {
...@@ -515,6 +539,9 @@ export default { ...@@ -515,6 +539,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 +554,19 @@ export default { ...@@ -527,14 +554,19 @@ 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);
word-wrap:break-word;
line-height:initial;
} }
.account-type-span { .account-type-span {
display: inline-block; display: inline-block;
...@@ -627,7 +659,9 @@ export default { ...@@ -627,7 +659,9 @@ export default {
.merchant-left { .merchant-left {
padding-top: 15px; padding-top: 15px;
padding-left: 20px; padding-left: 20px;
min-height: calc(100vh - 200px); // min-height: calc(100vh - 200px);
// max-height: 100vh;
background-color: #fff; background-color: #fff;
width: 360px; width: 360px;
margin-right: 20px; margin-right: 20px;
...@@ -679,6 +713,8 @@ export default { ...@@ -679,6 +713,8 @@ export default {
} }
.secondTreeWrap { .secondTreeWrap {
margin-top: 20px; margin-top: 20px;
height: calc(100vh - 350px);
overflow-y: auto;
} }
} }
// .ztree .wrapper-tree { // .ztree .wrapper-tree {
......
<template> <template>
<div class="scrm-main"> <div class="scrm-main">
<div class="form-header" v-if="$globalState.session.accountLevel == 1"> <div class="form-header" v-if="$globalState.session.accountLevel == 1">
<el-button type="primary" @click="handleContact" size="small" icon="el-icon-link" <el-button type="primary" @click="handleContact" size="small" icon="el-icon-link">门店账户关联企微</el-button>
>门店账户关联企微</el-button
>
</div> </div>
<div class="follow-form"> <div class="follow-form">
<el-form <el-form :inline="true" :model="searchForm" class="follow-form-item" label-width="80px">
:inline="true"
:model="searchForm"
class="follow-form-item"
label-width="80px"
>
<el-row> <el-row>
<el-form-item size="small" label="关联企微"> <el-form-item size="small" label="关联企微">
<el-select v-model="searchForm.isRelevance" placeholder="请选择"> <el-select v-model="searchForm.isRelevance" placeholder="请选择">
<el-option <el-option v-for="item in optionsContact" :key="item.value" :label="item.label" :value="item.value"></el-option>
v-for="item in optionsContact"
:key="item.value"
:label="item.label"
:value="item.value"
></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item class="merchant-row" size="small"> <el-form-item class="merchant-row" size="small">
<el-input <el-input size="small" v-model="searchForm.merchantLoginAccount" placeholder="请输入" v-if="searchForm.accountOrPhone == 1">
size="small" <el-select size="small" v-model="searchForm.accountOrPhone" slot="prepend" placeholder="请选择">
v-model="searchForm.merchantLoginAccount"
placeholder="请输入"
v-if="searchForm.accountOrPhone == 1"
>
<el-select
size="small"
v-model="searchForm.accountOrPhone"
slot="prepend"
placeholder="请选择"
>
<el-option label="登录账户名" :value="1"></el-option> <el-option label="登录账户名" :value="1"></el-option>
<el-option label="手机号" :value="2"></el-option> <el-option label="手机号" :value="2"></el-option>
</el-select> </el-select>
</el-input> </el-input>
<el-input <el-input size="small" v-model="searchForm.merchantLegalPersonPhone" placeholder="请输入" v-if="searchForm.accountOrPhone == 2">
size="small" <el-select size="small" v-model="searchForm.accountOrPhone" slot="prepend" placeholder="请选择">
v-model="searchForm.merchantLegalPersonPhone"
placeholder="请输入"
v-if="searchForm.accountOrPhone == 2"
>
<el-select
size="small"
v-model="searchForm.accountOrPhone"
slot="prepend"
placeholder="请选择"
>
<el-option label="登录账户名" :value="1"></el-option> <el-option label="登录账户名" :value="1"></el-option>
<el-option label="手机号" :value="2"></el-option> <el-option label="手机号" :value="2"></el-option>
</el-select> </el-select>
...@@ -59,74 +27,34 @@ ...@@ -59,74 +27,34 @@
</el-form-item> </el-form-item>
<el-form-item size="small" label="账户状态"> <el-form-item size="small" label="账户状态">
<el-select size="small" v-model="searchForm.status" placeholder="请选择"> <el-select size="small" v-model="searchForm.status" placeholder="请选择">
<el-option <el-option v-for="item in merchantStatus" :key="item.dictValue" :label="item.dictLabel" :value="item.dictValue"></el-option>
v-for="item in merchantStatus"
:key="item.dictValue"
:label="item.dictLabel"
:value="item.dictValue"
></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-row> </el-row>
<el-row> <el-row>
<el-form-item size="small" label="账户等级"> <el-form-item size="small" label="账户等级">
<el-select <el-select size="small" v-model="searchForm.merchantAccountLevel" placeholder="请选择">
size="small" <el-option v-for="item in accountLevel" :key="item.dictValue" :label="item.dictLabel" :value="item.dictValue"></el-option>
v-model="searchForm.merchantAccountLevel"
placeholder="请选择"
>
<el-option
v-for="item in accountLevel"
:key="item.dictValue"
:label="item.dictLabel"
:value="item.dictValue"
></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item class="merchant-wx" size="small"> <el-form-item class="merchant-wx" size="small">
<el-input <el-input size="small" v-model="searchForm.merchantName" placeholder="请输入商户名称/关联的企业微信名"></el-input>
size="small"
v-model="searchForm.merchantName"
placeholder="请输入商户名称/关联的企业微信名"
></el-input>
</el-form-item> </el-form-item>
<el-form-item size="small" style="float: right"> <el-form-item size="small" style="float: right">
<el-button type="primary" @click="handleSearch">查询</el-button> <el-button type="primary" @click="handleSearch">查询</el-button>
</el-form-item> </el-form-item>
</el-row> </el-row>
</el-form> </el-form>
<GLTable <GLTable ref="table" :layout="layout" :tableData="tableData" :tableTotal="tableTotal" :pageConf="pageConf" :tableParams="tableParams" @refreshTable="handleSearch">
ref="table"
:layout="layout"
:tableData="tableData"
:tableTotal="tableTotal"
:pageConf="pageConf"
:tableParams="tableParams"
@refreshTable="handleSearch"
>
<div slot="accountTypeNames" slot-scope="scope"> <div slot="accountTypeNames" slot-scope="scope">
<div <div class="accountType-row" v-for="(item, index) in scope.scope.accountTypeNames.split(',')" :key="index">
class="accountType-row"
v-for="(item, index) in scope.scope.accountTypeNames.split(',')"
:key="index"
>
{{ item }} {{ item }}
</div> </div>
</div> </div>
<template slot="auth-button" slot-scope="scope" :data="scope.scope"> <template slot="auth-button" slot-scope="scope" :data="scope.scope">
<el-button type="text" @click="handleLook(scope.scope)">查看</el-button> <el-button type="text" @click="handleLook(scope.scope)">查看</el-button>
<el-button <el-button type="text" @click="handleEdit(scope.scope)" v-if="$globalState.session.merchantId != scope.scope.merchantNo">修改</el-button>
type="text" <el-button type="text" @click="handleAdd(scope.scope)" v-if="scope.scope.status == 2 && scope.scope.merchantAccountLevel != 4">创建子商户/门店</el-button>
@click="handleEdit(scope.scope)"
v-if="$globalState.session.merchantId != scope.scope.merchantNo"
>修改</el-button
>
<el-button
type="text"
@click="handleAdd(scope.scope)"
v-if="scope.scope.status == 2 && scope.scope.merchantAccountLevel != 4"
>创建子商户/门店</el-button
>
</template> </template>
</GLTable> </GLTable>
</div> </div>
...@@ -136,160 +64,160 @@ ...@@ -136,160 +64,160 @@
<script> <script>
const optionsContact = [ const optionsContact = [
{ {
value: "", value: '',
label: "全部", label: '全部'
}, },
{ {
value: "1", value: '1',
label: "已关联", label: '已关联'
}, },
{ {
value: "2", value: '2',
label: "未关联", label: '未关联'
}, }
]; ]
export default { export default {
name: "index", name: 'index',
data() { data() {
return { return {
drawer: false, drawer: false,
direction: "rtl", direction: 'rtl',
searchForm: { searchForm: {
accountOrPhone: 1, accountOrPhone: 1
}, },
optionsContact, optionsContact,
accountLevel: [], accountLevel: [],
accountType: [], accountType: [],
merchantStatus: [], merchantStatus: [],
scope: { scope: {
scope: "", scope: ''
}, },
pageConf: { pageSize: "pageSize", pageNum: "pageNum", totalCount: "total" }, pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' },
// 表格参数 // 表格参数
tableParams: { tableParams: {
tableOption: { tableOption: {
width: "150px", width: '150px'
}, },
mutiSelectName: "merchant", mutiSelectName: 'merchant',
btnId: new Date().getTime() + parseInt(Math.random() * 1000), btnId: new Date().getTime() + parseInt(Math.random() * 1000),
tableColumns: [ tableColumns: [
{ {
label: "商户名", label: '商户名',
prop: "merchantName", prop: 'merchantName'
}, },
{ {
label: "关联的企业微信", label: '关联的企业微信',
prop: "entmicroName", prop: 'entmicroName',
formatter: (cellValue) => { formatter: cellValue => {
return cellValue.entmicroName ? cellValue.entmicroName : "--"; return cellValue.entmicroName ? cellValue.entmicroName : '--'
}, }
}, },
{ {
label: "账户类型", label: '账户类型',
prop: "accountTypeNames", prop: 'accountTypeNames',
addHtml: "accountTypeNames", addHtml: 'accountTypeNames'
}, },
{ {
label: "登录账户", label: '登录账户',
prop: "merchantLoginAccount", prop: 'merchantLoginAccount'
}, },
{ {
label: "账户等级", label: '账户等级',
prop: "accountLevelName", prop: 'accountLevelName',
width: "80px", width: '80px'
}, },
{ {
label: "上级商户", label: '上级商户',
prop: "parentMerchant", prop: 'parentMerchant'
}, },
{ {
label: "账户状态", label: '账户状态',
prop: "statusName", prop: 'statusName',
width: "80px", width: '80px'
}, },
{ {
label: "联系人", label: '联系人',
prop: "merchantLegalPerson", prop: 'merchantLegalPerson',
formatter: (cellValue) => { formatter: cellValue => {
return cellValue.merchantLegalPerson ? cellValue.merchantLegalPerson : "--"; return cellValue.merchantLegalPerson ? cellValue.merchantLegalPerson : '--'
}, }
}, },
{ {
label: "手机号", label: '手机号',
prop: "merchantLegalPersonPhone", prop: 'merchantLegalPersonPhone',
width: "120px", width: '120px'
}, },
{ {
label: "更新时间", label: '更新时间',
prop: "updatedTime" prop: 'updatedTime'
}, }
], ]
}, },
layout: "sizes, prev, pager, next, jumper, ->, total", layout: 'sizes, prev, pager, next, jumper, ->, total',
tableData: [], tableData: [],
tableTotal: 0, tableTotal: 0
}; }
}, },
methods: { methods: {
handleContact() { handleContact() {
this.$router.push("/baseInfo/relevance/"); this.$router.push('/baseInfo/relevance/')
}, },
handleLook(scope) { handleLook(scope) {
this.$router.push("/account/detailAccount/" + scope.id); this.$router.push('/account/detailAccount/' + scope.id)
}, },
handleEdit(scope) { handleEdit(scope) {
this.$router.push("/account/editAccount/" + scope.id); this.$router.push('/account/editAccount/' + scope.id)
}, },
handleAdd(scope) { handleAdd(scope) {
this.$router.push("/account/addAccount/" + scope.id); this.$router.push('/account/addAccount/' + scope.id)
}, },
findAllDictData(dictType) { findAllDictData(dictType) {
var params = { var params = {
dictType, dictType
}; }
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 = 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 = res
} }
} }
}); })
}, },
beforeSearchFn() { beforeSearchFn() {
return new Promise((resolve) => { return new Promise(resolve => {
// 调接口前,操作 // 调接口前,操作
resolve(); resolve()
}); })
}, },
handleSearch() { handleSearch() {
var params = { var params = {
...JSON.parse(JSON.stringify(this.searchForm)), ...JSON.parse(JSON.stringify(this.searchForm)),
pageSize: this.$refs.table.page.pageSize, pageSize: this.$refs.table.page.pageSize,
pageNum: this.$refs.table.page.pageNum, pageNum: this.$refs.table.page.pageNum
}; }
this.$apis.store.findMerchantByPage(params).then((res) => { this.$apis.store.findMerchantByPage(params).then(res => {
this.tableData = res.data; this.tableData = res.data
this.tableTotal = res.count; this.tableTotal = res.count
if (res.data && res.data.length == []) { if (res.data && res.data.length == []) {
this.$refs.table.setTableHeightFun(); this.$refs.table.setTableHeightFun()
}
})
} }
});
},
}, },
mounted() { mounted() {
this.handleSearch(); this.handleSearch()
this.findAllDictData("account_level"); this.findAllDictData('account_level')
this.findAllDictData("account_type"); this.findAllDictData('account_type')
this.findAllDictData("merchant_status"); this.findAllDictData('merchant_status')
}, }
}; }
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
...@@ -304,7 +232,7 @@ export default { ...@@ -304,7 +232,7 @@ export default {
position: relative; position: relative;
padding-left: 15px; padding-left: 15px;
&::before { &::before {
content: ""; content: '';
position: absolute; position: absolute;
width: 6px; width: 6px;
height: 6px; height: 6px;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!