Commit 0456f899 by cwq0219

bug修复

1 parent d1256ca3
......@@ -12,7 +12,6 @@
"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"
},
......@@ -29,7 +28,7 @@
"eslint": "^5.16.0",
"eslint-plugin-prettier": "^3.1.1",
"eslint-plugin-vue": "^5.0.0",
"glsx-components": "^1.1.2",
"glsx-components": "^1.1.8",
"node-sass": "^4.14.1",
"prettier": "^1.19.1",
"sass-loader": "^8.0.0",
......
......@@ -140,4 +140,10 @@ export default {
justify-content: space-between;
align-items: center;
}
.select-page .el-radio__input{
display: none;
}
.select-page .el-radio__label{
padding-left: 0;
}
</style>
......@@ -29,17 +29,26 @@ export default {
{
label: '登录账户',
prop: 'operator',
line: 2
line: 2,
formatter: cellValue => {
return cellValue.operator || '-'
}
},
{
label: '登录产品',
prop: 'productName',
line: 2
line: 2,
formatter: cellValue => {
return cellValue.productName || '-'
}
},
{
label: '登录IP',
prop: 'ip',
line: 2
line: 2,
formatter: cellValue => {
return cellValue.ip || '-'
}
},
{
label: '修改内容',
......@@ -51,12 +60,18 @@ export default {
{
label: '操作人',
prop: 'userName',
line: 2
line: 2,
formatter: cellValue => {
return cellValue.userName || '-'
}
},
{
label: '操作时间',
prop: 'createdTime',
width: '180px'
width: '180px',
formatter: cellValue => {
return cellValue.createdTime || '-'
}
}
]
}
......@@ -70,8 +85,7 @@ export default {
}
},
mounted() {
},
mounted() {},
methods: {
beforeSearchFn() {
......
......@@ -7,8 +7,11 @@
<p class="edit-sub-title p-rl-20">员工基本信息</p>
<glsx-combi-form class="p-tr-20" ref="editFormRef" labelWidth="160px" @handleImgDelete="handleImgDelete" :isBlock="isBlock" :formRef="editChildRef" :formObj="editForm" :formData="editFormData" :formRules="editRule">
<template slot="merchantId" slot-scope="item">
<span v-if="routeInfo.addOrEdit == 2 || (routeInfo.addOrEdit == 1 && userInfo.accountLevel == 4)">{{ editForm.merchantName + '(' + editForm.merchantId + ')' }}</span>
<select-page v-else :form="editForm" width="360" :targetItem="item.scope" @handleChange="handleChangeMerchant"></select-page>
<span class="txt-ellipsis" v-if="routeInfo.addOrEdit == 2 || (routeInfo.addOrEdit == 1 && userInfo.accountLevel == 4)" :title="editForm.merchantName + '(' + editForm.merchantId + ')'">{{ editForm.merchantName + '(' + editForm.merchantId + ')' }}</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="360" :targetItem="item.scope" @handleChange="handleChangeMerchant"></select-page> -->
</template>
<template v-if="routeInfo.addOrEdit == 2" slot="passwordSlot">
<el-button class="m-l-10" type="primary" @click="handleResetPass">重置密码</el-button>
......@@ -32,14 +35,14 @@
<script>
import { utils } from 'glsx-common'
import selectPage from './components/selectPage'
// import selectPage from './components/selectPage'
import glsxCombiForm from './glsx-combi-form'
export default {
name: 'editEmployee',
components: {
glsxCombiForm,
selectPage
glsxCombiForm
// selectPage
},
data() {
......@@ -108,8 +111,9 @@ export default {
{
label: '所属商户',
name: 'merchantId',
nameLabel: 'merchantName',
// nameLabel: 'merchantName',
noClearable: true,
width: '360px',
optionList: [],
optionId: 'id',
optionLabel: 'merchantName',
......@@ -169,10 +173,8 @@ export default {
const base64 = file.name.split('.')[1] + '@' + imgFile.split(',')[1]
this.$apis.common.pictureUpload({ file: base64 }).then(res => {
if (res) {
console.log(res)
this.editForm[targetItem.name] = res
this.editForm.fileName = file.name
console.log(this.editForm)
this.$refs.editFormRef.$refs[this.editChildRef].validateField(targetItem.name)
}
})
......@@ -215,11 +217,16 @@ export default {
getAllMerchantList() {
this.$apis.employee.getAllMerchantListApi({}).then(res => {
this.baseData.allMerchantList = res
// this.getOptionsList('editFormData', false, 'merchantId')
this.setMerchantMd()
})
},
setMerchantMd() {
this.editForm.merchantId = this.userInfo.merchantId
this.editForm.merchantName = this.userInfo.merchantName
if (this.userInfo.accountLevel == 4 && this.routeInfo.addOrEdit == 1) {
this.editForm.merchantId = this.baseData.allMerchantList[0].id
this.editForm.merchantName = this.baseData.allMerchantList[0].merchantName
this.handleChangeMerchant(this.editForm.merchantId)
}
},
getInfo() {
this.$apis.employee.getDetailInfoApi({ id: this.routeInfo.id }).then(res => {
......@@ -241,7 +248,6 @@ export default {
})
},
handleChangeMerchant(e, editRecovery = false) {
// console.log(e)
if (!editRecovery) {
this.editForm.roleIds = ''
this.editForm.visibleInferiorMer = String(e)
......@@ -301,7 +307,6 @@ export default {
}
},
handleClickNode(data, node) {
// console.log(node.checkedNodes)
this.editForm.visibleInferiorMer = node.checkedNodes.map(item => item.id).join(',')
this.$refs.editFormRef.$refs[this.editChildRef].validateField('visibleInferiorMer')
},
......@@ -320,7 +325,6 @@ export default {
})
},
handleConfirm() {
// console.log(this.$refs.tree.getCheckedNodes())
this.$refs.editFormRef.$refs[this.editChildRef].validate(valid => {
if (valid) {
var params = this.$common.utils.deepClone(this.editForm)
......@@ -337,7 +341,7 @@ export default {
fileUrl: ''
})
}
console.log(params)
// console.log(params)
var apiName = this.routeInfo.addOrEdit == 1 ? 'addEmployeeApi' : 'updateEmployeeApi'
this.$apis.employee[apiName](params).then(res => {
this.$message({
......@@ -368,7 +372,7 @@ export default {
this.routeInfo = this.$route.params
this.title = this.titleObj[this.routeInfo.addOrEdit]
this.getAllMerchantList()
this.routeInfo.addOrEdit != 1 ? this.getInfo() : this.setMerchantMd()
this.routeInfo.addOrEdit != 1 ? this.getInfo() : ''
}
}
</script>
......@@ -446,4 +450,12 @@ export default {
.config-employee .m-l-10 {
margin-left: 10px;
}
.config-employee .txt-ellipsis {
display: inline-block;
width: 320px;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
word-wrap: break-word;
}
</style>
......@@ -7,9 +7,9 @@
<div class="container">
<div>
<glsx-combi-form ref="showSearch" labelWidth="90px" :formObj="searchForm" :searchSelectObj="searchSelectObj" :formData="searchFormData">
<template slot="merchantId" slot-scope="item">
<!-- <template slot="merchantId" slot-scope="item">
<select-page :form="searchForm" width="200" :targetItem="item.scope" @handleChange="handleChangeMerchant"></select-page>
</template>
</template> -->
<span slot="footer" class="footer-btns">
<el-button :size="size" type="primary" @click="handleSearch">查询</el-button>
<el-button :size="size" type="primary" @click="handleExport">导出</el-button>
......@@ -18,7 +18,7 @@
</div>
<!-- 表格区域 开始 -->
<GLTable ref="employeeRef" :getListApi="getListApi" :searchForm="tableSearchForm" :tableParams="tableParams" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn">
<GLTable ref="employeeRef" :getListApi="getListApi" :searchForm="tableSearchForm" :tableParams="tableParams" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn" @setTableFinishFun="setTableFinishFun">
<div class="table-btns" slot="optionBtns" slot-scope="scope">
<el-button type="text" @click="handleDetail(scope.scope)">查看</el-button>
<el-button type="text" @click="handleEdit(2, scope.scope)">修改</el-button>
......@@ -41,7 +41,7 @@
<script>
import { utils } from 'glsx-common'
import glsxCombiForm from './glsx-combi-form'
import selectPage from './components/selectPage'
// import selectPage from './components/selectPage'
export default {
name: 'index',
data() {
......@@ -69,11 +69,12 @@ export default {
label: '商户名称',
name: 'merchantId',
nameLabel: 'merchantName',
type: 'select',
optionList: [],
optionId: 'id',
optionLabel: 'merchantName',
optionsName: 'allMerchantList',
addHtml: 'merchantId'
optionsName: 'allMerchantList'
// addHtml: 'merchantId'
},
{
label: '角色',
......@@ -199,8 +200,8 @@ export default {
},
components: {
glsxCombiForm,
selectPage
glsxCombiForm
// selectPage
// glsxTable
},
......@@ -288,6 +289,11 @@ export default {
resolve()
})
},
setTableFinishFun() {
if (this.$refs.employeeRef.data && !this.$refs.employeeRef.data.length) {
this.$refs.employeeRef.setTableHeightFun()
}
},
handleDetail(row) {
this.$router.push('/employee/detailEmployee/' + row.id)
},
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!