Commit 9660ff38 by 李长胜

修改

1 parent 28f5db39
......@@ -9,12 +9,15 @@
},
"dependencies": {
"axios": "^0.21.1",
"cnpm": "^7.1.0",
"core-js": "^3.4.4",
"glsx-common": "^1.4.6",
"vue": "^2.6.11",
"glsx-components": "^1.1.2",
"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": {
"@vue/cli-plugin-babel": "^4.1.0",
......@@ -33,8 +36,7 @@
"node-sass": "^4.14.1",
"prettier": "^1.19.1",
"sass-loader": "^8.0.0",
"vue-cli-plugin-element": "^1.0.1",
"vue-template-compiler": "^2.6.11"
"vue-cli-plugin-element": "^1.0.1"
},
"browserslist": [
"> 1%",
......
......@@ -6,23 +6,11 @@
</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 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="上级商户">
......@@ -38,18 +26,8 @@
<el-row>
<el-col :span="12">
<el-form-item label="账户等级" class="level-row">
<el-select
size="small"
: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 size="small" :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-form-item>
</el-col>
......@@ -57,47 +35,22 @@
<el-row>
<el-col :span="12">
<el-form-item label="登录账户名" prop="merchantLoginAccount">
<el-input
:disabled="nextStatus"
size="small"
maxlength="15"
v-model="accountInfoForm.merchantLoginAccount"
placeholder="请输入登录账户名"
></el-input>
<el-input :disabled="nextStatus" size="small" maxlength="15" v-model="accountInfoForm.merchantLoginAccount" placeholder="请输入登录账户名"></el-input>
</el-form-item>
</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="15" :disabled="nextStatus" size="small" type="password" v-model="accountInfoForm.merchantLoginPassword" placeholder="请输入登录密码"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="16">
<div data-v-995a4ff0="" class="el-form-item is-required">
<label
for="merchantLoginAccount"
class="el-form-item__label"
style="width: 120px"
>账户类型</label
>
<label for="merchantLoginAccount" class="el-form-item__label" style="width: 120px">账户类型</label>
<div class="el-form-item__content" style="margin-left: 120px">
<div data-v-995a4ff0="" class="el-input el-input--small">
<auto-button
v-for="(item, index) in accountDetail.accountTypes"
:key="index"
:btnLabel="item.accounttypeName"
:btnValue="item.accounttypeId"
:stopClick="nextStatus"
@getBtnStatus="getBtnStatus"
></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>
</div>
<div class="el-form-item__error" v-if="accountTypesRule">
请选择账户类型
......@@ -109,22 +62,16 @@
</el-form>
</div>
</div>
<select-product
v-show="step == 2"
ref="productForm"
title="功能权限"
></select-product>
<select-product v-show="step == 2" ref="productForm" title="功能权限"></select-product>
<div
class="footer-panel"
:style="{
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="handleSave(1)" v-show="step == 2"
>存草稿</el-button
>
<el-button type="primary" @click="handleSave(1)" 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="handleCancel">取消</el-button>
......@@ -140,50 +87,50 @@
</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 validatePhone = (rule, value, callback) => {
if (!util.checkPhone(value)) {
callback(new Error("请输入正确的手机号"));
callback(new Error('请输入正确的手机号'))
} else {
callback();
callback()
}
};
}
return {
nextStatus: false,
accountTypesRule: false,
filterText: "",
filterText: '',
brandData: [],
defaultProps: {
children: "children",
label: "label",
children: 'children',
label: 'label'
},
parentId: "",
parentId: '',
step: 1,
mapHeight: 400,
typeStatus: false,
loadingImg: false,
dialogMapVisible: false,
businessScopeCustomize: [{ name: "" }],
businessScopeCustomize: [{ name: '' }],
accountAddForm: {
status: 1,
merchantFiles: [],
merchantType: 1,
businessScope: [],
parentId: "",
isloginName: false,
parentId: '',
isloginName: false
},
accounttypeId: [],
accountInfoForm: {},
......@@ -192,197 +139,191 @@ export default {
businessOption: [],
accountValidityPeriod: [],
baseRules: {
merchantName: [{ required: true, message: "请输入商户名称", trigger: "blur" }],
merchantName: [{ required: true, message: '请输入商户名称', trigger: 'blur' }],
merchantLegalPersonPhone: [
{ required: true, message: "请输入联系电话", trigger: "blur" },
{ validator: validatePhone, trigger: "blur" },
],
{ required: true, message: '请输入联系电话', trigger: 'blur' },
{ validator: validatePhone, trigger: 'blur' }
]
},
accountInfoRules: {
merchantLoginAccount: [
{ required: true, message: "请输入登录账户名", trigger: "blur" },
{ min: 3, max: 15, message: "长度在 3 到 15 个字符", trigger: "blur" },
{ required: true, message: '请输入登录账户名', trigger: 'blur' },
{ min: 3, max: 15, message: '长度在 3 到 15 个字符', 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: 15, message: '长度在 6 到 15 个字符', trigger: 'blur' }
]
}
}
},
methods: {
getAddress() {
this.dialogMapVisible = false;
this.accountAddForm.merchantAddress = this.$refs.mapForm.address;
this.dialogMapVisible = false
this.accountAddForm.merchantAddress = this.$refs.mapForm.address
},
getBtnStatus(status, value) {
this.accountTypesRule = false;
this.accountTypesRule = false
if (status) {
this.accounttypeId.push(value);
this.accounttypeId.push(value)
} else {
let idx = this.accounttypeId.findIndex((item) => item == value);
this.accounttypeId.splice(idx, 1);
let idx = this.accounttypeId.findIndex(item => item == value)
this.accounttypeId.splice(idx, 1)
}
},
handleSave(status) {
if (this.$refs.productForm.getSelectInfo().length == 0) {
this.$message.error("请选择产品");
return;
this.$message.error('请选择产品')
return
}
let accountTypes = JSON.stringify(this.$refs.productForm.getSelectInfo());
let accountTypes = JSON.stringify(this.$refs.productForm.getSelectInfo())
let params = {
accountTypes,
status,
merchantId: this.parentId,
};
this.$apis.store.updatePermissions(params).then((res) => {
merchantId: this.parentId
}
this.$apis.store.updatePermissions(params).then(res => {
if (res) {
this.$router.push("/account/index");
this.$router.push('/account/index')
}
});
})
},
handleCancel() {
this.$router.push("/account/index");
this.$router.push('/account/index')
},
handlePrev() {
this.step = 1;
this.step = 1
},
//下一步
handleNext() {
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()
})
})
const pm2 = new Promise((resolve, reject) => {
this.$refs.accountInfoForm.validate((valid) => {
if (valid) resolve();
});
});
this.$refs.accountInfoForm.validate(valid => {
if (valid) resolve()
})
})
if (this.accounttypeId.length == 0) {
this.accountTypesRule = true;
return;
this.accountTypesRule = true
return
}
if (
this.accountAddForm.merchantType == 1 &&
this.accountAddForm.merchantOrgcode &&
!util.checkisCard(this.accountAddForm.merchantOrgcode)
) {
this.$message.error("请输入正确的身份证号码");
return;
if (this.accountAddForm.merchantType == 1 && this.accountAddForm.merchantOrgcode && !util.checkisCard(this.accountAddForm.merchantOrgcode)) {
this.$message.error('请输入正确的身份证号码')
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]
}
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
.getCheckedKeys()
.join(",");
params.isloginName ? (params.isloginName = 1) : (params.isloginName = 0);
params.merchantAccountLevel = this.accountDetail.merchantAccountLevel;
let businessScopeCustomize = this.businessScopeCustomize.map((item) => item.name);
params.businessScopeCustomize = businessScopeCustomize.join(",");
params.accounttypeId = this.accounttypeId.join(",");
console.log(this.$refs.baseInfoForm)
params.merchantBrand = this.$refs.baseInfoForm.$refs.brandTree.getCheckedKeys().join(',')
params.isloginName ? (params.isloginName = 1) : (params.isloginName = 0)
params.merchantAccountLevel = this.accountDetail.merchantAccountLevel
let businessScopeCustomize = this.businessScopeCustomize.map(item => item.name)
params.businessScopeCustomize = businessScopeCustomize.join(',')
params.accounttypeId = this.accounttypeId.join(',')
params.merchantFiles = JSON.stringify(params.merchantFiles)
params.merchantModel = this.accountDetail.merchantModel;
let merchant;
params.merchantModel = this.accountDetail.merchantModel
let merchant
if (this.nextStatus) {
merchant = "updateMerchant";
params.id = this.parentId;
merchant = 'updateMerchant'
params.id = this.parentId
} else {
merchant = "saveMerchant";
merchant = 'saveMerchant'
}
Promise.all([pm1, pm2]).then(() => {
this.$apis.store[merchant](params).then((res) => {
this.$apis.store[merchant](params).then(res => {
if (res) {
this.step = 2;
this.nextStatus = true;
if (typeof res == "number") {
this.parentId = res;
this.step = 2
this.nextStatus = true
if (typeof res == 'number') {
this.parentId = res
let para = {
accountlevel: this.accountDetail.merchantAccountLevel,
id: this.parentId,
parentId: this.accountAddForm.parentId,
};
this.$refs.productForm.findMenuFunTreeByMerId(para,this.accounttypeId);
parentId: this.accountAddForm.parentId
}
this.$refs.productForm.findMenuFunTreeByMerId(para, this.accounttypeId)
}
this.twoMerchantDetail(this.parentId);
this.twoMerchantDetail(this.parentId)
}
});
});
})
})
},
findAllDictData(dictType) {
var params = {
dictType,
};
this.$apis.store.findAllDictData(params).then((res) => {
dictType
}
this.$apis.store.findAllDictData(params).then(res => {
if (res) {
if (dictType == "business_scope") {
this.businessOption = res;
if (dictType == 'business_scope') {
this.businessOption = res
}
}
});
})
},
addBusinessScope() {
this.businessScopeCustomize.push({ name: "" });
this.businessScopeCustomize.push({ name: '' })
},
removeBusinessScope(index) {
this.businessScopeCustomize.splice(index, 1);
this.businessScopeCustomize.splice(index, 1)
},
async findMerchantDetail() {
this.accountDetail = await this.$apis.store.findMerchantDetail({
id: this.accountAddForm.parentId,
});
this.$apis.store.findAllDictData({ dictType: "account_level" }).then((res) => {
id: this.accountAddForm.parentId
})
this.$apis.store.findAllDictData({ dictType: 'account_level' }).then(res => {
if (this.accountDetail.merchantAccountLevel == 1) {
this.accountLevel = res.filter((item) => {
return item.dictValue != 1 && item.dictValue != 3;
});
this.accountDetail.merchantAccountLevel = 2;
}else if (this.accountDetail.merchantAccountLevel == 2) {
this.accountLevel = res.filter((item) => {
return item.dictValue != 1 && item.dictValue != 2;
});
this.accountDetail.merchantAccountLevel = 3;
}else{
this.accountLevel = res.filter((item) => {
return item.dictValue == 4;
});
this.accountDetail.merchantAccountLevel = 4;
this.accountLevel = res.filter(item => {
return item.dictValue != 1 && item.dictValue != 3
})
this.accountDetail.merchantAccountLevel = 2
} else if (this.accountDetail.merchantAccountLevel == 2) {
this.accountLevel = res.filter(item => {
return item.dictValue != 1 && item.dictValue != 2
})
this.accountDetail.merchantAccountLevel = 3
} else {
this.accountLevel = res.filter(item => {
return item.dictValue == 4
})
this.accountDetail.merchantAccountLevel = 4
}
});
})
},
twoMerchantDetail(pid) {
this.$apis.store
.findMerchantDetail({
id: pid,
id: pid
})
.then(res => {
console.log(res)
})
.then((res) => {
console.log(res);
});
},
getCarbrandTree() {
this.$apis.store.getCarbrandTree({}).then((res) => {
this.brandData = res;
});
},
this.$apis.store.getCarbrandTree({}).then(res => {
this.brandData = res
})
}
},
mounted() {
this.footerLeft = document.querySelector(".base-container-right").offsetLeft;
this.footerWidth = document.documentElement.clientWidth - this.footerLeft;
this.accountAddForm.parentId = this.$route.params.id;
this.findMerchantDetail();
this.getCarbrandTree();
this.findAllDictData("business_scope");
},
};
</script>
this.footerLeft = document.querySelector('.base-container-right').offsetLeft
this.footerWidth = document.documentElement.clientWidth - this.footerLeft
this.accountAddForm.parentId = this.$route.params.id
this.findMerchantDetail()
this.getCarbrandTree()
this.findAllDictData('business_scope')
}
}
</script>
<style scoped lang="scss">
.account-header {
......@@ -554,4 +495,4 @@ export default {
z-index: 999;
box-shadow: 0px -1px 1px 0px rgba(88, 80, 255, 0.1);
}
</style>
\ No newline at end of file
</style>
......@@ -82,7 +82,6 @@ export default {
// 设置全选
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))
console.log(tabMenu)
},
productClick(productId) {
this.productTab = productId
......@@ -383,7 +382,7 @@ export default {
// this.findPermissionsByMerId()
}
}
</script>
</script>
<style scoped lang="scss">
.account-body {
......
......@@ -11,21 +11,21 @@
<span class="content-title">账户信息</span>
<div class="detail-content">
<el-row>
<el-col :span="14">
<el-col :span="14" class="flexCol">
<span class="itemName">登录账户名:</span>
<span class="itemValue">{{ firstPageObj.merchantLoginAccount || '-' }}</span>
</el-col>
<el-col :span="10">
<el-col :span="10" class="flexCol">
<span class="itemName itemNameCol2">账户等级:</span>
<span class="itemValue">{{ firstPageObj.accountLevelName || '-' }}</span>
</el-col>
</el-row>
<el-row>
<el-col :span="14">
<el-col :span="14" class="flexCol">
<span class="itemName">开通模式:</span>
<span class="itemValue">{{ firstPageObj.merchantModelName || '-' }}</span>
</el-col>
<el-col :span="10">
<el-col :span="10" class="flexCol">
<span class="itemName itemNameCol2">账户状态:</span>
<span class="itemValue">
{{ firstPageObj.statusName || '-' }}
......@@ -33,11 +33,11 @@
</el-col>
</el-row>
<el-row>
<el-col :span="14">
<el-col :span="14" class="flexCol">
<span class="itemName">关联企业微信名:</span>
<span class="itemValue">{{ firstPageObj.entmicroName || '-' }}</span>
</el-col>
<el-col :span="10">
<el-col :span="10" class="flexCol">
<span class="itemName itemNameCol2">账户有效期:</span>
<span class="itemValue">{{ firstPageObj.effectiveTimeName }}</span>
</el-col>
......@@ -82,13 +82,13 @@
<div class="MsgWrap companyMsg">
<div class="grayLine"></div>
<span class="content-title">企业信息</span>
<div class="detail-content">
<div class="detail-content" style="flex">
<el-row>
<el-col :span="14">
<el-col :span="14" class="flexCol">
<span class="itemName">商户名称:</span>
<span class="itemValue">{{ firstPageObj.merchantName || '-' }}</span>
</el-col>
<el-col :span="10">
<el-col :span="10" class="flexCol">
<span class="itemName itemNameCol2">简称:</span>
<span class="itemValue">
{{ firstPageObj.merchantAbbreviation || '-' }}
......@@ -96,40 +96,43 @@
</el-col>
</el-row>
<el-row>
<el-col :span="14">
<el-col :span="14" class="flexCol">
<span class="itemName">商户类型:</span>
<span class="itemValue">{{ firstPageObj.merchantTypeName || '-' }}</span>
</el-col>
<el-col :span="10">
<span class="itemName itemNameCol2">身份证:</span>
<el-col :span="10" class="flexCol">
<span class="itemName itemNameCol2" v-if="firstPageObj.merchantType == 2">组织机构代码:</span>
<span class="itemName itemNameCol2" v-else>身份证:</span>
<span class="itemValue">{{ firstPageObj.merchantOrgcode || '-' }}</span>
</el-col>
</el-row>
<el-row>
<el-col :span="14">
<el-col :span="14" class="flexCol">
<span class="itemName">地址:</span>
<span class="itemValue">
{{ firstPageObj.merchantAddress || '-' }}
</span>
</el-col>
<el-col :span="10">
<el-col :span="10" class="flexCol">
<span class="itemName itemNameCol2">联系人:</span>
<span class="itemValue">{{ firstPageObj.merchantLegalPerson || '-' }}</span>
</el-col>
</el-row>
<el-row>
<el-col :span="14">
<el-col :span="14" class="flexCol">
<span class="itemName">联系电话:</span>
<span class="itemValue">{{ firstPageObj.merchantLegalPersonPhone || '-' }}</span>
</el-col>
<el-col :span="10">
<el-col :span="10" class="flexCol">
<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-row>
<el-row>
<el-col :span="24">
<el-col :span="12" class="flexCol">
<span class="itemName">主营品牌:</span>
<span class="itemValue">{{ firstPageObj.merchantBrandName || '-' }}</span>
</el-col>
......@@ -147,7 +150,7 @@
<div id="secondmerchantName">{{ secondPageObj.merchantName }}</div>
</el-tooltip>
<div>
商户号:
商户号:
<span id="secondmerchantId">{{ secondPageObj.merchantNo }}</span>
</div>
<div>
......@@ -164,7 +167,8 @@
<el-button type="primary" size="small" @click="filterTreeListFun">查询</el-button>
</div>
<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">
<el-tooltip class="item" effect="dark" :content="node.label" placement="top-start">
......@@ -173,15 +177,7 @@
</span>
</el-tree>
</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 class="merchant-right">
<div>
......@@ -196,7 +192,8 @@
<el-button type="primary" id="tableSearch" size="small" @click="getSecondTable">查询</el-button>
</div>
</div>
<GLTable ref="subMerchantTable" :tableTotal="subMerchantTableTotal" :hasPage="false" :tableData="subMerchantTableList" :hasNum="true" :pageConf="pageConf" :tableParams="secondtableParams" @refreshTable="getSecondTable"></GLTable>
<!-- :height="'350px'" -->
<GLTable ref="subMerchantTable" :tableTotal="subMerchantTableTotal" :hasPage="false" :tableData="subMerchantTableList" :hasNum="true" :pageConf="pageConf" :tableParams="secondtableParams" @refreshTable="getSecondTable"></GLTable>
</div>
</div>
</div>
......@@ -291,7 +288,7 @@ export default {
},
{
label: '修改内容',
prop: 'modifyContent'
prop: 'action'
},
{
label: '操作人',
......@@ -336,6 +333,29 @@ export default {
// },
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() {
this.$router.push('/account/index')
},
......@@ -386,7 +406,6 @@ export default {
getSecondTree() {
this.$apis.merchant.getSecondTree({ id: this.merchantId }).then(res => {
if (res) {
console.log('二页的树', res)
this.secondTreeList = res
this.expandedIds = res.map(item => item.id)
}
......@@ -403,12 +422,17 @@ export default {
this.$apis.merchant.getSecondTable(param).then(res => {
if (res) {
console.log('2', res)
this.subMerchantTableList = res
let data = this.formateNullFieldData(res)
this.subMerchantTableList = data
this.subMerchantTableTotal = res.length
}
if (res && res.length == 0) {
this.$refs.subMerchantTable.setTableHeightFun()
}
// total > 50?calc(100vh - '199px'): calc(100vh - '152px')
this.$refs.subMerchantTable.tableHeightValues=`calc(100vh - 300px)`
// if (res && res.length == 0) {
// this.$refs.subMerchantTable.setTableHeightFun()
// }
})
},
getThirdTable() {
......@@ -515,6 +539,9 @@ export default {
// padding-bottom: 30px;
.el-row {
margin-top: 20px;
.flexCol {
display: flex;
}
.itemName {
display: inline-block;
margin-right: 10px;
......@@ -527,14 +554,19 @@ export default {
line-height: 20px;
}
.itemNameCol2 {
width: 90px;
width: 100px;
}
.itemValue {
height: 20px;
// height: 20px;
font-size: 14px;
font-weight: 400;
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 {
display: inline-block;
......@@ -627,7 +659,9 @@ export default {
.merchant-left {
padding-top: 15px;
padding-left: 20px;
min-height: calc(100vh - 200px);
// min-height: calc(100vh - 200px);
// max-height: 100vh;
background-color: #fff;
width: 360px;
margin-right: 20px;
......@@ -679,6 +713,8 @@ export default {
}
.secondTreeWrap {
margin-top: 20px;
height: calc(100vh - 350px);
overflow-y: auto;
}
}
// .ztree .wrapper-tree {
......
<template>
<div class="scrm-main">
<div class="form-header" v-if="$globalState.session.accountLevel == 1">
<el-button type="primary" @click="handleContact" size="small" icon="el-icon-link"
>门店账户关联企微</el-button
>
<el-button type="primary" @click="handleContact" size="small" icon="el-icon-link">门店账户关联企微</el-button>
</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="80px">
<el-row>
<el-form-item size="small" label="关联企微">
<el-select v-model="searchForm.isRelevance" placeholder="请选择">
<el-option
v-for="item in optionsContact"
:key="item.value"
:label="item.label"
:value="item.value"
></el-option>
<el-option v-for="item in optionsContact" :key="item.value" :label="item.label" :value="item.value"></el-option>
</el-select>
</el-form-item>
<el-form-item class="merchant-row" size="small">
<el-input
size="small"
v-model="searchForm.merchantLoginAccount"
placeholder="请输入"
v-if="searchForm.accountOrPhone == 1"
>
<el-select
size="small"
v-model="searchForm.accountOrPhone"
slot="prepend"
placeholder="请选择"
>
<el-input size="small" 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="2"></el-option>
</el-select>
</el-input>
<el-input
size="small"
v-model="searchForm.merchantLegalPersonPhone"
placeholder="请输入"
v-if="searchForm.accountOrPhone == 2"
>
<el-select
size="small"
v-model="searchForm.accountOrPhone"
slot="prepend"
placeholder="请选择"
>
<el-input size="small" 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="2"></el-option>
</el-select>
......@@ -59,74 +27,34 @@
</el-form-item>
<el-form-item size="small" label="账户状态">
<el-select size="small" v-model="searchForm.status" placeholder="请选择">
<el-option
v-for="item in merchantStatus"
:key="item.dictValue"
:label="item.dictLabel"
:value="item.dictValue"
></el-option>
<el-option v-for="item in merchantStatus" :key="item.dictValue" :label="item.dictLabel" :value="item.dictValue"></el-option>
</el-select>
</el-form-item>
</el-row>
<el-row>
<el-form-item size="small" label="账户等级">
<el-select
size="small"
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 size="small" 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-form-item>
<el-form-item class="merchant-wx" size="small">
<el-input
size="small"
v-model="searchForm.merchantName"
placeholder="请输入商户名称/关联的企业微信名"
></el-input>
<el-input size="small" v-model="searchForm.merchantName" placeholder="请输入商户名称/关联的企业微信名"></el-input>
</el-form-item>
<el-form-item size="small" style="float: right">
<el-button type="primary" @click="handleSearch">查询</el-button>
</el-form-item>
</el-row>
</el-form>
<GLTable
ref="table"
:layout="layout"
:tableData="tableData"
:tableTotal="tableTotal"
:pageConf="pageConf"
:tableParams="tableParams"
@refreshTable="handleSearch"
>
<GLTable ref="table" :layout="layout" :tableData="tableData" :tableTotal="tableTotal" :pageConf="pageConf" :tableParams="tableParams" @refreshTable="handleSearch">
<div slot="accountTypeNames" slot-scope="scope">
<div
class="accountType-row"
v-for="(item, index) in scope.scope.accountTypeNames.split(',')"
:key="index"
>
<div class="accountType-row" v-for="(item, index) in scope.scope.accountTypeNames.split(',')" :key="index">
{{ item }}
</div>
</div>
<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="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
>
<el-button type="text" @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>
</GLTable>
</div>
......@@ -136,161 +64,161 @@
<script>
const optionsContact = [
{
value: "",
label: "全部",
value: '',
label: '全部'
},
{
value: "1",
label: "已关联",
value: '1',
label: '已关联'
},
{
value: "2",
label: "未关联",
},
];
value: '2',
label: '未关联'
}
]
export default {
name: "index",
name: 'index',
data() {
return {
drawer: false,
direction: "rtl",
direction: 'rtl',
searchForm: {
accountOrPhone: 1,
accountOrPhone: 1
},
optionsContact,
accountLevel: [],
accountType: [],
merchantStatus: [],
scope: {
scope: "",
scope: ''
},
pageConf: { pageSize: "pageSize", pageNum: "pageNum", totalCount: "total" },
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' },
// 表格参数
tableParams: {
tableOption: {
width: "150px",
width: '150px'
},
mutiSelectName: "merchant",
mutiSelectName: 'merchant',
btnId: new Date().getTime() + parseInt(Math.random() * 1000),
tableColumns: [
{
label: "商户名",
prop: "merchantName",
label: '商户名',
prop: 'merchantName'
},
{
label: "关联的企业微信",
prop: "entmicroName",
formatter: (cellValue) => {
return cellValue.entmicroName ? cellValue.entmicroName : "--";
},
label: '关联的企业微信',
prop: 'entmicroName',
formatter: cellValue => {
return cellValue.entmicroName ? cellValue.entmicroName : '--'
}
},
{
label: "账户类型",
prop: "accountTypeNames",
addHtml: "accountTypeNames",
label: '账户类型',
prop: 'accountTypeNames',
addHtml: 'accountTypeNames'
},
{
label: "登录账户",
prop: "merchantLoginAccount",
label: '登录账户',
prop: 'merchantLoginAccount'
},
{
label: "账户等级",
prop: "accountLevelName",
width: "80px",
label: '账户等级',
prop: 'accountLevelName',
width: '80px'
},
{
label: "上级商户",
prop: "parentMerchant",
label: '上级商户',
prop: 'parentMerchant'
},
{
label: "账户状态",
prop: "statusName",
width: "80px",
label: '账户状态',
prop: 'statusName',
width: '80px'
},
{
label: "联系人",
prop: "merchantLegalPerson",
formatter: (cellValue) => {
return cellValue.merchantLegalPerson ? cellValue.merchantLegalPerson : "--";
},
label: '联系人',
prop: 'merchantLegalPerson',
formatter: cellValue => {
return cellValue.merchantLegalPerson ? cellValue.merchantLegalPerson : '--'
}
},
{
label: "手机号",
prop: "merchantLegalPersonPhone",
width: "120px",
label: '手机号',
prop: 'merchantLegalPersonPhone',
width: '120px'
},
{
label: "更新时间",
prop: "updatedTime"
},
],
label: '更新时间',
prop: 'updatedTime'
}
]
},
layout: "sizes, prev, pager, next, jumper, ->, total",
layout: 'sizes, prev, pager, next, jumper, ->, total',
tableData: [],
tableTotal: 0,
};
tableTotal: 0
}
},
methods: {
handleContact() {
this.$router.push("/baseInfo/relevance/");
this.$router.push('/baseInfo/relevance/')
},
handleLook(scope) {
this.$router.push("/account/detailAccount/" + scope.id);
this.$router.push('/account/detailAccount/' + scope.id)
},
handleEdit(scope) {
this.$router.push("/account/editAccount/" + scope.id);
this.$router.push('/account/editAccount/' + scope.id)
},
handleAdd(scope) {
this.$router.push("/account/addAccount/" + scope.id);
this.$router.push('/account/addAccount/' + scope.id)
},
findAllDictData(dictType) {
var params = {
dictType,
};
this.$apis.store.findAllDictData(params).then((res) => {
dictType
}
this.$apis.store.findAllDictData(params).then(res => {
if (res) {
if (dictType == "account_level") {
this.accountLevel = res;
if (dictType == 'account_level') {
this.accountLevel = res
}
if (dictType == "account_type") {
this.accountType = res;
if (dictType == 'account_type') {
this.accountType = res
}
if (dictType == "merchant_status") {
this.merchantStatus = res;
if (dictType == 'merchant_status') {
this.merchantStatus = res
}
}
});
})
},
beforeSearchFn() {
return new Promise((resolve) => {
return new Promise(resolve => {
// 调接口前,操作
resolve();
});
resolve()
})
},
handleSearch() {
var params = {
...JSON.parse(JSON.stringify(this.searchForm)),
pageSize: this.$refs.table.page.pageSize,
pageNum: this.$refs.table.page.pageNum,
};
this.$apis.store.findMerchantByPage(params).then((res) => {
this.tableData = res.data;
this.tableTotal = res.count;
pageNum: this.$refs.table.page.pageNum
}
this.$apis.store.findMerchantByPage(params).then(res => {
this.tableData = res.data
this.tableTotal = res.count
if (res.data && res.data.length == []) {
this.$refs.table.setTableHeightFun();
this.$refs.table.setTableHeightFun()
}
});
},
})
}
},
mounted() {
this.handleSearch();
this.findAllDictData("account_level");
this.findAllDictData("account_type");
this.findAllDictData("merchant_status");
},
};
</script>
this.handleSearch()
this.findAllDictData('account_level')
this.findAllDictData('account_type')
this.findAllDictData('merchant_status')
}
}
</script>
<style scoped lang="scss">
.follow-form {
......@@ -304,7 +232,7 @@ export default {
position: relative;
padding-left: 15px;
&::before {
content: "";
content: '';
position: absolute;
width: 6px;
height: 6px;
......@@ -335,4 +263,4 @@ export default {
}
}
}
</style>
\ No newline at end of file
</style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!