This commit is contained in:
SelfRidicule 2024-08-12 13:49:30 +08:00
parent 48c28a9b41
commit f8fa62c8ce

View File

@ -19,12 +19,14 @@
</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.username }}--{{ 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="['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 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='备注'>
@ -62,23 +64,22 @@ export default {
},
created() {
this.selectUserListByType()
},
methods: {
selectUserListByType (){
selectUserListByType().then(res =>{
this.staffLists =res.data
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)
console.log('edit', this.mdl)
console.log('this.staffLists ' , this.staffLists )
this.visible = true
this.$nextTick(() => {
this.form.setFieldsValue(pick(this.mdl, 'id', 'name', 'staffId', 'workerId', 'staffLists', 'remark', 'deleteFlag', 'createBy', 'createTime', 'updateBy', 'updateTime', 'tenantId', 'parkId'))