修改了对应的用户模块

This commit is contained in:
chendaze 2024-03-22 17:34:16 +08:00
parent 3fa8b9abeb
commit 432b5046d0
7 changed files with 34 additions and 36 deletions

View File

@ -54,7 +54,7 @@
<span v-if='text == 2'><a-tag color='danger'>离线</a-tag></span>
</span>
<span slot='persons' slot-scope='text,record'>
<a @click='handlePersonList(record)'>{{ 1 }}</a>
<a @click='handlePersonList(record)'>{{ record.personCount }}</a>
</span>
<span slot='action' slot-scope='text, record'>
<a v-if='editEnabel' @click='handleEdit(record)'>编辑</a>
@ -205,7 +205,7 @@ export default {
},
{
title: '授权人员',
dataIndex: 'persons',
dataIndex: 'personCount',
scopedSlots: { customRender: 'persons' }
},
{

View File

@ -257,6 +257,9 @@ export default {
this.mdl = Object.assign(record)
if (this.mdl.pic) {
this.imageUrl = process.env.VUE_APP_API_BASE_URL + this.mdl.pic
}
this.visible = true
this.$nextTick(() => {
this.form.setFieldsValue(pick(this.mdl, 'id', 'type', 'equipmentName', 'status', 'createDate', 'equipmentNum', 'pic', 'deleteFlag', 'createBy', 'createTime', 'updateBy', 'updateTime'))

View File

@ -376,6 +376,9 @@ export default {
}
this.mdl = Object.assign(record)
if (this.mdl.indoorPicUrl) {
this.imageUrl = process.env.VUE_APP_API_BASE_URL + this.mdl.indoorPicUrl
}
this.visible = true
this.$nextTick(() => {
this.form.setFieldsValue(

View File

@ -122,34 +122,16 @@ export default {
})
}
},
handleChange1 (info) {
if (info.file.status === 'uploading') {
this.loading1 = true
return
}
if (info.file.status === 'done') {
const { form: { setFieldsValue } } = this
const result = info.file.response
//
this.$nextTick(() => {
setFieldsValue({
//
fileUrl: result.fileName
})
})
// Get this url from response in real world.
getBase64(info.file.originFileObj, imageUrl => {
this.imageUrl1 = imageUrl
this.loading1 = false
})
}
},
add () {
this.form.resetFields()
this.edit({ id: 0 })
},
edit (record) {
this.mdl = Object.assign(record)
if (this.mdl.picUrl) {
this.imageUrl = process.env.VUE_APP_API_BASE_URL + this.mdl.picUrl
}
this.visible = true
this.$nextTick(() => {
this.form.setFieldsValue(pick(this.mdl, 'id', 'name', 'brand', 'specification', 'picUrl', 'fileUrl', 'remark', 'delFlag', 'createBy', 'createTime', 'updateBy', 'updateTime'))

View File

@ -19,14 +19,14 @@
</a-form-item>
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="服务类型">
<a-select placeholder="服务类型" @change='changeServeType' v-decorator="['serveType', {rules: [{required: true, message: '请选择服务类型' }]}]">
<a-select-option :value="'1'">免费服务</a-select-option>
<a-select-option :value="'2'">增值服务</a-select-option>
<a-select-option :value="1">免费服务</a-select-option>
<a-select-option :value="2">增值服务</a-select-option>
</a-select>
</a-form-item>
<a-form-item v-if="form.type == 2" :labelCol="labelCol" :wrapperCol="wrapperCol" label="金额描述">
<a-form-item v-if="form.serveType === 2" :labelCol="labelCol" :wrapperCol="wrapperCol" label="金额描述">
<a-input placeholder="金额描述" v-decorator="['money',{rules:[{required: true, message: '请输入金额描述' }]}]" />
</a-form-item>
<a-form-item v-if="form.type == 1" :labelCol="labelCol" :wrapperCol="wrapperCol" label="服务图标">
<a-form-item v-if="form.serveType === 1" :labelCol="labelCol" :wrapperCol="wrapperCol" label="服务图标">
<!-- <a-input placeholder="室内图片url" v-decorator="['indoorPicUrl']" />-->
<a-upload
v-decorator="['pic']"
@ -92,8 +92,6 @@ export default {
methods: {
changeServeType(value){
this.form.type = value
console.log(this.form.type)
},
beforeUpload (file) {
@ -135,9 +133,16 @@ export default {
},
edit (record) {
this.mdl = Object.assign(record)
if (this.mdl.pic) {
this.imageUrl = process.env.VUE_APP_API_BASE_URL + this.mdl.pic
}
console.log(this.mdl.serveType)
this.form.setFieldsValue({
serveType:this.mdl.serveType.toString()
})
this.visible = true
this.$nextTick(() => {
this.form.setFieldsValue(pick(this.mdl, 'id', 'serveName', 'serveType', 'serveTime', 'remake', 'createBy', 'createTime', 'updateBy', 'updateTime', 'version', 'deleteFlag'))
this.form.setFieldsValue(pick(this.mdl, 'id', 'serveName', 'serveType', 'serveTime', 'remake','type', 'createBy', 'createTime', 'updateBy', 'updateTime', 'version', 'deleteFlag'))
})
},
handleSubmit (e) {

View File

@ -24,7 +24,7 @@
</a-select>
</a-form-item>
<a-form-item :labelCol='labelCol' :wrapperCol='wrapperCol' label='被访人姓名'>
<a-select v-decorator="['userId',{rules: [{ required: true, message: '请选择被访人姓名' }]}]"
<a-select v-decorator="['intervieweeId',{rules: [{ required: true, message: '请选择被访人姓名' }]}]"
placeholder='请选择被访人姓名'
@change='getPersonData'>
<a-select-option v-for='item in personList' :key='item.id' :value='item.id'>

View File

@ -64,7 +64,7 @@
</a-form-item>
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="选择企业">
<a-select v-decorator="['customerId', {rules: [{ required: true, message: '请选择企业' }]}]">
<a-select-option v-for="item in customerList" :key="item.id" :value='item.id'>{{ item.name }}</a-select-option>
<a-select-option v-for="item in customerList" :key="item.value" >{{ item.text }}</a-select-option>
</a-select>
</a-form-item>
@ -122,7 +122,9 @@ export default {
},
created () {
getCustomerList().then(res =>{
this.customerList = res.rows
res.rows.forEach(r => {
this.customerList.push({ value: r.id, text: r.name })
})
})
//
@ -149,19 +151,22 @@ export default {
this.mdl = Object.assign({}, { id: 0, deptId: '' })
this.visible = true
this.$nextTick(() => {
this.form.setFieldsValue(pick(this.mdl, 'id', 'username', 'nickname', 'status', 'mobile', 'roleIds', 'remark', 'deptId', 'parkId', 'tenantId'))
this.form.setFieldsValue(pick(this.mdl, 'id', 'username', 'nickname', 'status', 'mobile', 'roleIds','customerId', 'remark', 'deptId', 'parkId', 'tenantId'))
})
},
edit (record) {
if (record.id > 0) {
this.spinning = true
getUser(record.id).then(res => {
this.mdl = Object.assign({}, res)
this.visible = true
this.$nextTick(() => {
this.form.setFieldsValue(pick(this.mdl, 'id', 'username', 'nickname', 'status', 'mobile', 'roleIds', 'remark', 'deptId', 'parkId', 'tenantId'))
this.form.setFieldsValue(pick(this.mdl, 'id', 'username', 'nickname', 'status', 'mobile', 'roleIds','customerId', 'remark', 'deptId', 'parkId', 'tenantId'))
this.spinning = false
// this.form.setFieldsValue({ ...record })
})
})
}