修改了对应设备类型列表和楼层列表

This commit is contained in:
chenze 2024-08-10 18:17:51 +08:00
parent 77e6b9dde3
commit 48c28a9b41
3 changed files with 41 additions and 22 deletions

View File

@ -31,4 +31,11 @@ export function delRepairType (parameter) {
})
}
export function selectUserListByType (parameter) {
return axios({
url: api.repairType + '/selectUserListByType',
method: 'get'
})
}
export const repairTypeExport = api.repairType + '/export'

View File

@ -32,8 +32,8 @@
:columns="columns"
:data="loadData"
>
<span slot="worker" slot-scope="text, record">
<a @click="seeWorKerList(record.id,record.workerList)">{{record.workerNames}}</a>
<span slot="workers" slot-scope="text, record">
<a @click="seeWorKerList(record.id,record.workerName)">{{ record.worker }}</a>
</span>
<span slot="action" slot-scope="text, record">
<a v-if="editEnabel" @click="handleEdit(record)">编辑</a>
@ -42,7 +42,7 @@
</span>
</s-table>
<repairType-modal ref="modal" @ok="handleOk" />
<a-modal v-model='workerVisible' title='维修人员' width='700px' >
<a-modal v-model="workerVisible" title="维修人员" width="700px">
<a-table :row-selection="rowSelection" :columns="workerColumns" :data-source="data" />
</a-modal>
</a-card>
@ -90,8 +90,8 @@
},
{
title: '维修人员',
dataIndex: 'workerNames',
scopedSlots: { customRender: 'worker' }
dataIndex: 'worker',
scopedSlots: { customRender: 'workers' }
},
{
@ -125,14 +125,17 @@
removeEnable: checkPermission('RepairDeviceType:type:remove')
}
},
filters: {
},
filters: {},
created () {
},
methods: {
seeWorKerList (id, list) {
this.workerVisible = true
this.data = list
this.data = list.map(item => {
return {
username: item
}
})
},
onSelectChange (selectedRowKeys, selectedRows) {

View File

@ -19,12 +19,12 @@
</a-form-item>
<a-form-item :labelCol='labelCol' :wrapperCol='wrapperCol' label='派单员'>
<a-select v-decorator="['staffId', {rules: [{ required: true, message: '派单员' }]}]">
<a-select-option v-for='item in staffLists' :key='item.id'>{{ item.name }}--{{ item.mobile }}</a-select-option>
<a-select-option v-for='item in staffLists' :key='item.id'>{{ item.username }}--{{ item.mobile }}</a-select-option>
</a-select>
</a-form-item>
<a-form-item :labelCol='labelCol' :wrapperCol='wrapperCol' label='维修员'>
<a-select mode="multiple" v-decorator="['staffId', {rules: [{ required: true, message: '维修员' }]}]">
<a-select-option v-for='item in staffLists' :key='item.id'>{{ item.name }}--{{ item.mobile }}</a-select-option>
<a-select mode="multiple" v-decorator="['workerId', {rules: [{ required: true, message: '维修员' }]}]">
<a-select-option v-for='item in staffLists' :key='item.id'>{{ item.username }}--{{ item.mobile }}</a-select-option>
</a-select>
</a-form-item>
<a-form-item :labelCol='labelCol' :wrapperCol='wrapperCol' label='备注'>
@ -34,7 +34,7 @@
</a-modal>
</template>
<script>
import { saveRepairType } from '@/api/admin/repair/repairDeviceType'
import { saveRepairType, selectUserListByType } from '@/api/admin/repair/repairDeviceType'
import pick from 'lodash.pick'
export default {
@ -59,20 +59,29 @@ export default {
}
},
beforeCreate() {
},
created() {
},
methods: {
selectUserListByType (){
selectUserListByType().then(res =>{
this.staffLists =res.data
})
},
add() {
this.form.resetFields()
this.edit({ id: 0 })
},
edit(record) {
this.selectUserListByType()
this.mdl = Object.assign(record)
console.log(this.mdl)
this.visible = true
this.$nextTick(() => {
this.form.setFieldsValue(pick(this.mdl, 'id', 'name', 'remark', 'deleteFlag', 'createBy', 'createTime', 'updateBy', 'updateTime', 'tenantId', 'parkId'))
this.form.setFieldsValue(pick(this.mdl, 'id', 'name', 'staffId', 'workerId', 'staffLists', 'remark', 'deleteFlag', 'createBy', 'createTime', 'updateBy', 'updateTime', 'tenantId', 'parkId'))
})
},
handleSubmit(e) {