更新调整用户类型

This commit is contained in:
weipengfei 2024-07-08 18:00:46 +08:00
parent d519d8961f
commit 38e3259be3
2 changed files with 13 additions and 13 deletions

View File

@ -12,7 +12,7 @@ const formDataInfo = reactive({
mobile: '', mobile: '',
code: '', code: '',
real_name: '', real_name: '',
user_ship: '', user_ship: 0,
selectedValues: [], selectedValues: [],
}) })
@ -119,13 +119,13 @@ const props = {
const userShip = ref([]) const userShip = ref([])
const getUserShip = () => { const getUserShip = () => {
userShipApi({ // userShipApi({
type_id: 4 // type_id: 4
}).then(res => { // }).then(res => {
userShip.value = res.data.lists?.filter((item) => { // userShip.value = res.data.lists?.filter((item) => {
return item.id == 0 || item.id == 4 // return item.id == 0 || item.id == 4
}); // });
}) // })
} }
getUserShip() getUserShip()
@ -148,7 +148,7 @@ const addUser = () => {
userAddApi(forms).then(res=>{ userAddApi(forms).then(res=>{
formDataInfo.mobile = ''; formDataInfo.mobile = '';
formDataInfo.code = ''; formDataInfo.code = '';
formDataInfo.user_ship = ''; formDataInfo.user_ship = 0;
formDataInfo.real_name = ''; formDataInfo.real_name = '';
formDataInfo.selectedValues = []; formDataInfo.selectedValues = [];
formDataRef.value.resetFields(); formDataRef.value.resetFields();
@ -196,11 +196,11 @@ defineExpose({
<el-form-item label="用户姓名" prop="real_name"> <el-form-item label="用户姓名" prop="real_name">
<el-input v-model="formDataInfo.real_name" placeholder="请输入用户姓名" /> <el-input v-model="formDataInfo.real_name" placeholder="请输入用户姓名" />
</el-form-item> </el-form-item>
<el-form-item label="用户类型" prop="user_ship"> <!-- <el-form-item label="用户类型" prop="user_ship">
<el-select v-model="formDataInfo.user_ship" placeholder="请选择用户类型" style="width: 100%;"> <el-select v-model="formDataInfo.user_ship" placeholder="请选择用户类型" style="width: 100%;">
<el-option v-for="item in userShip" :key="item.id" :label="item.title" :value="item.id" /> <el-option v-for="item in userShip" :key="item.id" :label="item.title" :value="item.id" />
</el-select> </el-select>
</el-form-item> </el-form-item> -->
<el-form-item label="用户地址" prop="selectedValues"> <el-form-item label="用户地址" prop="selectedValues">
<el-cascader style="width: 100%;" v-model="formDataInfo.selectedValues" :options="options" <el-cascader style="width: 100%;" v-model="formDataInfo.selectedValues" :options="options"
:props="props" :load="loadOptions" class="w-full" /> :props="props" :load="loadOptions" class="w-full" />

View File

@ -512,8 +512,8 @@ onUnmounted(() => {
formData.user_ship_name formData.user_ship_name
}}</el-tag> }}</el-tag>
<el-tag type="success" size="large" v-else>{{ formData.user_ship_name }}</el-tag> <el-tag type="success" size="large" v-else>{{ formData.user_ship_name }}</el-tag>
<el-button type="primary" v-if="formData.user_ship == 0 || formData.user_ship == 4" <!-- <el-button type="primary" v-if="formData.user_ship == 0 || formData.user_ship == 4"
style="margin-left: 1rem;" @click="updateShip = true">修改</el-button> style="margin-left: 1rem;" @click="updateShip = true">修改</el-button> -->
</template> </template>
<template v-else> <template v-else>
<el-select v-model="formData.user_ship" placeholder="请选择用户类型" style="width: 10rem;"> <el-select v-model="formData.user_ship" placeholder="请选择用户类型" style="width: 10rem;">