Commit 34c578c7 by cwq0219

员工

1 parent 434eb2b7
...@@ -10,6 +10,12 @@ ...@@ -10,6 +10,12 @@
<template slot="merchantId" slot-scope="item"> <template slot="merchantId" slot-scope="item">
<select-page :form="editForm" width="360" :targetItem="item.scope" @handleChange="handleChangeMerchant"></select-page> <select-page :form="editForm" width="360" :targetItem="item.scope" @handleChange="handleChangeMerchant"></select-page>
</template> </template>
<template v-if="routeInfo.addOrEdit == 2" slot="passwordSlot">
<el-button type="primary" @click="handleResetPass">重置密码</el-button>
</template>
<template v-if="userInfo.accountLevel == 4" slot="roleIdsSlot">
<el-button type="primary" @click="handleJumpRole">创建角色</el-button>
</template>
<template slot="visibleInferiorMer" slot-scope="item"> <template slot="visibleInferiorMer" slot-scope="item">
<el-input :style="{ width: item.width || '360px' }" placeholder="可见商户" v-model="filterText"></el-input> <el-input :style="{ width: item.width || '360px' }" placeholder="可见商户" v-model="filterText"></el-input>
<el-tree 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-tree 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>
...@@ -114,7 +120,8 @@ export default { ...@@ -114,7 +120,8 @@ export default {
showPass: true, showPass: true,
width: '360px', width: '360px',
type: 'input', type: 'input',
maxlength: 15 maxlength: 15,
suffixSlot: 'passwordSlot'
}, },
{ {
label: '可见商户', label: '可见商户',
...@@ -129,7 +136,8 @@ export default { ...@@ -129,7 +136,8 @@ export default {
optionList: [], optionList: [],
optionId: 'id', optionId: 'id',
optionLabel: 'roleName', optionLabel: 'roleName',
optionsName: 'roleList' optionsName: 'roleList',
suffixSlot: 'roleIdsSlot'
}, },
{ {
label: '头像', label: '头像',
...@@ -188,6 +196,7 @@ export default { ...@@ -188,6 +196,7 @@ export default {
}, },
mounted() { mounted() {
this.userInfo = this.$globalState.session
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.routeInfo = this.$route.params this.routeInfo = this.$route.params
...@@ -290,6 +299,12 @@ export default { ...@@ -290,6 +299,12 @@ export default {
this.editForm.visibleInferiorMer = node.checkedNodes.map(item => item.id).join(',') this.editForm.visibleInferiorMer = node.checkedNodes.map(item => item.id).join(',')
this.$refs.editFormRef.$refs[this.editChildRef].validateField('visibleInferiorMer') this.$refs.editFormRef.$refs[this.editChildRef].validateField('visibleInferiorMer')
}, },
handleResetPass() {
this.editForm.password = ''
},
handleJumpRole() {
this.$router.push("/role/create/"+0)
},
handleConfirm() { handleConfirm() {
// console.log(this.$refs.tree.getCheckedNodes()) // console.log(this.$refs.tree.getCheckedNodes())
this.$refs.editFormRef.$refs[this.editChildRef].validate(valid => { this.$refs.editFormRef.$refs[this.editChildRef].validate(valid => {
......
...@@ -12,7 +12,10 @@ ...@@ -12,7 +12,10 @@
{{ item.label ? ':' : '' }} {{ item.label ? ':' : '' }}
</span> </span>
<slot v-if="item.addHtml" :name="item.addHtml" :scope="item"></slot> <slot v-if="item.addHtml" :name="item.addHtml" :scope="item"></slot>
<el-input v-else-if="item.type === 'input'" :placeholder="item.placeholder || '请输入' + item.label" v-model.trim="formObj[item.name]" :disabled="item.isDisabled" :maxlength="item.maxlength" :clearable="item.isClear || false" :type="item.inputType || 'text'" :style="{ width: item.width || 'auto' }" :show-word-limit="item.showLimit || false" :show-password="item.showPass || false" @keydown.native="e => handleInputDown(e, item)"></el-input> <div v-else-if="item.type === 'input'">
<el-input :placeholder="item.placeholder || '请输入' + item.label" v-model.trim="formObj[item.name]" :disabled="item.isDisabled" :maxlength="item.maxlength" :clearable="item.isClear || false" :type="item.inputType || 'text'" :style="{ width: item.width || 'auto' }" :show-word-limit="item.showLimit || false" :show-password="item.showPass || false" @keydown.native="e => handleInputDown(e, item)"></el-input>
<slot :name="item.suffixSlot" :scope="item"></slot>
</div>
<!-- 选择-输入框 --> <!-- 选择-输入框 -->
<el-input v-else-if="item.type === 'selectInput'" :placeholder="'请输入' + item.selectOption.find(k => k.name === searchSelectObj[item.selectName].attr).label" :maxlength="item.maxlength" v-model.trim="searchSelectObj[item.selectName].value" :clearable="item.isClear || false" :style="{ width: item.inputWidth || '130px' }" class="input-with-select"> <el-input v-else-if="item.type === 'selectInput'" :placeholder="'请输入' + item.selectOption.find(k => k.name === searchSelectObj[item.selectName].attr).label" :maxlength="item.maxlength" v-model.trim="searchSelectObj[item.selectName].value" :clearable="item.isClear || false" :style="{ width: item.inputWidth || '130px' }" class="input-with-select">
<el-select v-model="searchSelectObj[item.selectName].attr" :style="{ width: item.selectWidth || '130px' }" slot="prepend" placeholder="请选择" @change="item.handleSelectChange"> <el-select v-model="searchSelectObj[item.selectName].attr" :style="{ width: item.selectWidth || '130px' }" slot="prepend" placeholder="请选择" @change="item.handleSelectChange">
...@@ -37,9 +40,12 @@ ...@@ -37,9 +40,12 @@
</el-select> </el-select>
</template> </template>
<!-- 选择框 --> <!-- 选择框 -->
<el-select v-else-if="item.type === 'select'" :style="{ width: item.width || '100%' }" v-model="formObj[item.name]" :clearable="item.isClear || false" :placeholder="'请选择' + item.label" :filterable="!item.noFilter" :disabled="item.isDisabled" :no-data-text="item.noDataText || '无数据'" :multiple="item.multiple || false" :collapse-tags="item.collapseTags || true" @change="selectAddAttr($event, item)"> <div v-else-if="item.type === 'select'">
<el-option v-for="subItem in item.optionList" :key="subItem[item.optionId]" :label="subItem[item.optionLabel]" :value="subItem[item.optionId]" :disabled="subItem.isDisabled || false"></el-option> <el-select :style="{ width: item.width || '100%' }" v-model="formObj[item.name]" :clearable="item.isClear || false" :placeholder="'请选择' + item.label" :filterable="!item.noFilter" :disabled="item.isDisabled" :no-data-text="item.noDataText || '无数据'" :multiple="item.multiple || false" :collapse-tags="item.collapseTags || true" @change="selectAddAttr($event, item)">
</el-select> <el-option v-for="subItem in item.optionList" :key="subItem[item.optionId]" :label="subItem[item.optionLabel]" :value="subItem[item.optionId]" :disabled="subItem.isDisabled || false"></el-option>
</el-select>
<slot :name="item.suffixSlot" :scope="item"></slot>
</div>
<!-- radio --> <!-- radio -->
<el-radio-group v-else-if="item.type === 'radio'" v-model="formObj[item.name]" :disabled="item.isDisabled" @change="item.handleRadioChange"> <el-radio-group v-else-if="item.type === 'radio'" v-model="formObj[item.name]" :disabled="item.isDisabled" @change="item.handleRadioChange">
<el-radio v-for="subItem in item.optionList" :key="subItem[item.optionId]" :label="subItem[item.optionId]">{{ subItem[item.optionLabel] }}</el-radio> <el-radio v-for="subItem in item.optionList" :key="subItem[item.optionId]" :label="subItem[item.optionId]">{{ subItem[item.optionLabel] }}</el-radio>
......
...@@ -131,7 +131,8 @@ export default { ...@@ -131,7 +131,8 @@ export default {
{ {
label: '员工企微号', label: '员工企微号',
prop: 'entmicroName', prop: 'entmicroName',
line: 2 line: 2,
minWidth: '100px'
}, },
{ {
label: '角色', label: '角色',
...@@ -193,25 +194,28 @@ export default { ...@@ -193,25 +194,28 @@ export default {
}, },
mounted() { mounted() {
this.getBaseData().then(res => { this.userInfo = this.$globalState.session
this.getOptionsList('searchFormData') // 门店
}) if (this.userInfo.accountLevel == 4) {
this.searchFormData.splice(0, 1)
var idx = this.tableParams.tableColumns.findIndex(item => item.prop == 'merchantName')
this.tableParams.tableColumns.splice(idx, 1)
}
this.getAllMerchantList()
this.getStaffStatusList()
}, },
methods: { methods: {
getAllMerchantList() { getAllMerchantList() {
this.$apis.employee.getAllMerchantListApi({}).then(res => { this.$apis.employee.getAllMerchantListApi({}).then(res => {
this.baseData.allMerchantList = res this.baseData.allMerchantList = res
this.userInfo.accountLevel == 4 ? this.handleChangeMerchant(res[0].id) : this.getOptionsList('searchFormData', true, 'merchantId')
}) })
}, },
getBaseData() { getStaffStatusList() {
// 1.product(产品) 2.account_type(账户类型) 3.(functional_attributes) 功能属性 4.(owned_customer_group)所属客户群 5.channel渠道 6.account_level(商户层级) this.$apis.employee.getAllDictApi({ dictType: 'staff_status' }).then(res => {
return new Promise(resolve => { this.baseData.staffStatusList = res
Promise.all([this.$apis.employee.getAllMerchantListApi({}), this.$apis.employee.getAllDictApi({ dictType: 'staff_status' })]).then(([allMerchant, staffStatus]) => { this.getOptionsList('searchFormData', true, 'status')
this.baseData.allMerchantList = allMerchant
this.baseData.staffStatusList = staffStatus
resolve()
})
}) })
}, },
getOptionsList(formName, hasAll = true, refreshSigle) { getOptionsList(formName, hasAll = true, refreshSigle) {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!