Commit 0456f899 by cwq0219

bug修复

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