|
|
|
@ -56,8 +56,8 @@
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="11">
|
|
|
|
|
<el-form-item label="扣费账户" prop="account">
|
|
|
|
|
<el-input v-model="formData.account" placeholder="请输入扣费账户" />
|
|
|
|
|
<el-form-item label="司机" prop="account">
|
|
|
|
|
<el-input v-model="formData.account" readonly @click="openUser" />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
</el-row>
|
|
|
|
@ -127,11 +127,96 @@
|
|
|
|
|
<el-button @click="closeDialog">取 消</el-button>
|
|
|
|
|
</template>
|
|
|
|
|
</Dialog>
|
|
|
|
|
<!-- 用户选择 -->
|
|
|
|
|
<el-dialog v-model="dialogVisible_binding" title="用户选择" width="1200">
|
|
|
|
|
<div style="display: flex; flex-direction: column; justify-content: space-between">
|
|
|
|
|
<el-form
|
|
|
|
|
class="-mb-15px"
|
|
|
|
|
:model="bind_queryParams"
|
|
|
|
|
ref="bind_queryFormRef"
|
|
|
|
|
:inline="true"
|
|
|
|
|
label-width="68px"
|
|
|
|
|
>
|
|
|
|
|
<!-- <el-form-item label="用户ID" prop="id">
|
|
|
|
|
<el-input
|
|
|
|
|
v-model="bind_queryParams.id"
|
|
|
|
|
placeholder="请输入"
|
|
|
|
|
clearable
|
|
|
|
|
@keyup.enter="get_team_list"
|
|
|
|
|
class="!w-240px"
|
|
|
|
|
/>
|
|
|
|
|
</el-form-item> -->
|
|
|
|
|
<el-form-item label="手机号" prop="mobile">
|
|
|
|
|
<el-input
|
|
|
|
|
v-model="bind_queryParams.mobile"
|
|
|
|
|
placeholder="请输入"
|
|
|
|
|
clearable
|
|
|
|
|
@keyup.enter="get_team_list"
|
|
|
|
|
class="!w-240px"
|
|
|
|
|
/>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="用户昵称" prop="nickname">
|
|
|
|
|
<el-input
|
|
|
|
|
v-model="bind_queryParams.nickname"
|
|
|
|
|
placeholder="请输入"
|
|
|
|
|
clearable
|
|
|
|
|
@keyup.enter="get_team_list"
|
|
|
|
|
class="!w-240px"
|
|
|
|
|
/>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item>
|
|
|
|
|
<el-button @click="get_team_list"
|
|
|
|
|
><Icon icon="ep:search" class="mr-5px" /> 搜索</el-button
|
|
|
|
|
>
|
|
|
|
|
<el-button @click="bind_resetQuery"
|
|
|
|
|
><Icon icon="ep:refresh" class="mr-5px" /> 重置</el-button
|
|
|
|
|
>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-form>
|
|
|
|
|
<!-- -->
|
|
|
|
|
<el-table
|
|
|
|
|
ref="singleTableRef"
|
|
|
|
|
|
|
|
|
|
:data="userIdlist"
|
|
|
|
|
border
|
|
|
|
|
style="width: 100%; margin-top: 15px"
|
|
|
|
|
max-height="500"
|
|
|
|
|
highlight-current-row
|
|
|
|
|
@current-change="selectionChange"
|
|
|
|
|
>
|
|
|
|
|
<!-- <el-table-column label="用户ID" align="center" prop="id" /> -->
|
|
|
|
|
<el-table-column label="用户昵称" align="center" prop="nickname" />
|
|
|
|
|
<el-table-column label="手机号" align="center" prop="mobile" />
|
|
|
|
|
<el-table-column label="用户头像" align="center" prop="avatar" >
|
|
|
|
|
<template #default="scope">
|
|
|
|
|
<div style="display: flex; align-items: center; justify-content: center">
|
|
|
|
|
<el-image :src="scope.row.avatar" style="width: 160px; height: 90px" />
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
|
|
|
|
|
</el-table>
|
|
|
|
|
<div>
|
|
|
|
|
<Pagination
|
|
|
|
|
:total="bind_total"
|
|
|
|
|
v-model:page="bind_queryParams.pageNo"
|
|
|
|
|
v-model:limit="bind_queryParams.pageSize"
|
|
|
|
|
@pagination="get_team_list"
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<template #footer>
|
|
|
|
|
<div class="dialog-footer">
|
|
|
|
|
<el-button @click="dialogVisible_binding = false">取消</el-button>
|
|
|
|
|
<el-button type="primary" @click="submit_bind"> 确认 </el-button>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
</el-dialog>
|
|
|
|
|
</template>
|
|
|
|
|
<script setup lang="ts">
|
|
|
|
|
import { getIntDictOptions, DICT_TYPE } from '@/utils/dict'
|
|
|
|
|
import { SwapOrderApi, SwapOrderVO } from '@/api/biz/swaporder'
|
|
|
|
|
|
|
|
|
|
import { UserApi, UserVO } from '@/api/member/driver'
|
|
|
|
|
/** 换电订单 表单 */
|
|
|
|
|
defineOptions({ name: 'SwapOrderForm' })
|
|
|
|
|
const props = defineProps({
|
|
|
|
@ -139,9 +224,12 @@ const props = defineProps({
|
|
|
|
|
})
|
|
|
|
|
const { t } = useI18n() // 国际化
|
|
|
|
|
const message = useMessage() // 消息弹窗
|
|
|
|
|
|
|
|
|
|
const bind_total = ref(0)
|
|
|
|
|
const dialogVisible = ref(false) // 弹窗的是否展示
|
|
|
|
|
const dialogVisible_binding = ref(false) // 绑定车队的弹窗
|
|
|
|
|
const dialogTitle = ref('') // 弹窗的标题
|
|
|
|
|
const userIdlist=ref([])
|
|
|
|
|
const selectUser=ref({})
|
|
|
|
|
const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用
|
|
|
|
|
const formType = ref('') // 表单的类型:create - 新增;update - 修改
|
|
|
|
|
const formData = ref({
|
|
|
|
@ -195,6 +283,7 @@ const formData = ref({
|
|
|
|
|
amendExpenseAcMeter: undefined,
|
|
|
|
|
elecTotalExpense: undefined,
|
|
|
|
|
discountFlag: undefined,
|
|
|
|
|
nickname:undefined,
|
|
|
|
|
setMealFlag: undefined,
|
|
|
|
|
discountPercent: undefined,
|
|
|
|
|
discountScope: undefined,
|
|
|
|
@ -221,7 +310,7 @@ const formRules = reactive({
|
|
|
|
|
upBatterySoc: [{ required: true, message: '不能为空', trigger: 'blur' }]
|
|
|
|
|
})
|
|
|
|
|
const formRef = ref() // 表单 Ref
|
|
|
|
|
|
|
|
|
|
const singleTableRef=ref()
|
|
|
|
|
/** 打开弹窗 */
|
|
|
|
|
const open = async (type: string, id?: number) => {
|
|
|
|
|
dialogVisible.value = true
|
|
|
|
@ -256,7 +345,50 @@ const addDomain = () => {
|
|
|
|
|
const removeDomain = (index: number) => {
|
|
|
|
|
formData.value.batteryList.splice(index, 1)
|
|
|
|
|
}
|
|
|
|
|
const openUser=()=>{
|
|
|
|
|
dialogVisible_binding.value=true
|
|
|
|
|
|
|
|
|
|
get_team_list()
|
|
|
|
|
}
|
|
|
|
|
const get_team_list = async () => {
|
|
|
|
|
try {
|
|
|
|
|
const data2 = await UserApi.getUserPage(bind_queryParams)
|
|
|
|
|
userIdlist.value=data2.list
|
|
|
|
|
if(formData.value.userId){
|
|
|
|
|
userIdlist.value.forEach(item=>{
|
|
|
|
|
if(item.id==formData.value.userId){
|
|
|
|
|
singleTableRef.value!.setCurrentRow(item)
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
bind_total.value = data2.total
|
|
|
|
|
} finally {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
const submit_bind=()=>{
|
|
|
|
|
formData.value={...formData.value,userId:selectUser.value.id,account:selectUser.value.nickname}
|
|
|
|
|
dialogVisible_binding.value= false
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const selectionChange = (rows: UserVO[]) => {
|
|
|
|
|
selectUser.value=rows
|
|
|
|
|
// let array = []
|
|
|
|
|
// array = rows.map((item) => item.id)
|
|
|
|
|
// // console.log(array, 'array')
|
|
|
|
|
// currentRow_id.value = array
|
|
|
|
|
}
|
|
|
|
|
const bind_queryParams = reactive({
|
|
|
|
|
nickname:undefined,
|
|
|
|
|
id:undefined,
|
|
|
|
|
Type:2,
|
|
|
|
|
})
|
|
|
|
|
const bind_queryFormRef = ref() // 搜索的表单
|
|
|
|
|
// 用户选择列表重置
|
|
|
|
|
const bind_resetQuery = () => {
|
|
|
|
|
bind_queryFormRef.value.resetFields()
|
|
|
|
|
get_team_list()
|
|
|
|
|
}
|
|
|
|
|
/** 提交表单 */
|
|
|
|
|
const emit = defineEmits(['success']) // 定义 success 事件,用于操作成功后的回调
|
|
|
|
|
const submitForm = async () => {
|
|
|
|
|