车辆,办公,修改.办公组件完成.
This commit is contained in:
parent
9bc2a61c67
commit
2deff3d46d
@ -57,19 +57,21 @@
|
|||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="申请物品" prop="usageId">
|
<el-form-item label="申请物品" prop="usageId">
|
||||||
<el-select v-model="formData.usageId" placeholder="请选择申请物品">
|
<el-row style="width: 100%;" :gutter="2">
|
||||||
<el-option
|
<el-col :span="22">
|
||||||
v-for="dict in getIntDictOptions(DICT_TYPE.BGYP_USAGE_NAME)"
|
<el-input v-model="formData.usageName" placeholder="请输入申请物品" disabled />
|
||||||
:key="dict.value"
|
</el-col>
|
||||||
:label="dict.label"
|
<el-col :span="2">
|
||||||
:value="dict.value"
|
<el-button @click="openForm()" size="small" type="text">
|
||||||
/>
|
<Icon icon="ep:plus" />
|
||||||
</el-select>
|
</el-button>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="物品分类" prop="unit">
|
<el-form-item label="物品分类" prop="unit">
|
||||||
<el-select v-model="formData.unit" placeholder="请选择申请物品分类">
|
<el-select disabled v-model="formData.unit" placeholder="请选择申请物品分类">
|
||||||
<el-option
|
<el-option
|
||||||
v-for="dict in getIntDictOptions(DICT_TYPE.BGYP_UNIT)"
|
v-for="dict in getIntDictOptions(DICT_TYPE.BGYP_UNIT)"
|
||||||
:key="dict.value"
|
:key="dict.value"
|
||||||
@ -88,6 +90,8 @@
|
|||||||
<el-button @click="submitForm" type="primary" :disabled="formLoading">确 定</el-button>
|
<el-button @click="submitForm" type="primary" :disabled="formLoading">确 定</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-card>
|
</el-card>
|
||||||
|
<!-- 办公用品信息选择 -->
|
||||||
|
<SelectItemForm ref="selectItemRef" @success="changeItem"/>
|
||||||
</template>
|
</template>
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { getIntDictOptions, DICT_TYPE } from '@/utils/dict'
|
import { getIntDictOptions, DICT_TYPE } from '@/utils/dict'
|
||||||
@ -97,6 +101,7 @@ import * as DefinitionApi from '@/api/bpm/definition'
|
|||||||
import * as UserApi from '@/api/system/user'
|
import * as UserApi from '@/api/system/user'
|
||||||
import {getUserProfile} from "@/api/system/user/profile";
|
import {getUserProfile} from "@/api/system/user/profile";
|
||||||
import {FormProcessMappingApi} from "@/api/bpm/formprocessmapping";
|
import {FormProcessMappingApi} from "@/api/bpm/formprocessmapping";
|
||||||
|
import SelectItemForm from "@/views/Home/bgnr/items/SelectItemForm.vue";
|
||||||
|
|
||||||
|
|
||||||
/** 办公用品管理 表单 */
|
/** 办公用品管理 表单 */
|
||||||
@ -123,6 +128,19 @@ const formData = ref({
|
|||||||
})
|
})
|
||||||
const formRef = ref() // 表单 Ref
|
const formRef = ref() // 表单 Ref
|
||||||
|
|
||||||
|
const selectItemRef = ref() //信息表单Ref
|
||||||
|
const openForm = async ()=>{
|
||||||
|
selectItemRef.value.open()
|
||||||
|
}
|
||||||
|
|
||||||
|
const changeItem = (val:any) => {
|
||||||
|
const form = formData.value
|
||||||
|
form.usageId = val.id
|
||||||
|
form.usageName = val.itemName
|
||||||
|
form.unit = val.categoryId
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// 获取用户部门
|
// 获取用户部门
|
||||||
const getUserInfo = async () => {
|
const getUserInfo = async () => {
|
||||||
const user = await getUserProfile();
|
const user = await getUserProfile();
|
||||||
|
203
src/views/Home/bgnr/items/SelectItemForm.vue
Normal file
203
src/views/Home/bgnr/items/SelectItemForm.vue
Normal file
@ -0,0 +1,203 @@
|
|||||||
|
<template>
|
||||||
|
<Dialog :title="dialogTitle" v-model="dialogVisible" style="width: 80%">
|
||||||
|
<!-- 搜索工作栏 -->
|
||||||
|
<ContentWrap>
|
||||||
|
<el-form
|
||||||
|
class="-mb-15px"
|
||||||
|
:model="queryParams"
|
||||||
|
ref="queryFormRef"
|
||||||
|
:inline="true"
|
||||||
|
label-width="68px"
|
||||||
|
>
|
||||||
|
<el-form-item label="物品名字" prop="itemName">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.itemName"
|
||||||
|
placeholder="请输入物品名字"
|
||||||
|
clearable
|
||||||
|
@keyup.enter="handleQuery"
|
||||||
|
class="!w-240px"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="物品分类" prop="categoryId">
|
||||||
|
<el-select
|
||||||
|
v-model="queryParams.categoryId"
|
||||||
|
placeholder="请选择物品分类"
|
||||||
|
clearable
|
||||||
|
class="!w-240px"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="dict in getIntDictOptions(DICT_TYPE.BGYP_UNIT)"
|
||||||
|
:key="dict.value"
|
||||||
|
:label="dict.label"
|
||||||
|
:value="dict.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="物品状态" prop="itemStatus">
|
||||||
|
<el-select
|
||||||
|
v-model="queryParams.itemStatus"
|
||||||
|
placeholder="请选择物品状态"
|
||||||
|
clearable
|
||||||
|
class="!w-240px"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="dict in getStrDictOptions(DICT_TYPE.DRIVER_STATUS)"
|
||||||
|
:key="dict.value"
|
||||||
|
:label="dict.label"
|
||||||
|
:value="dict.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item>
|
||||||
|
<el-button @click="handleQuery"><Icon icon="ep:search" class="mr-5px" /> 搜索</el-button>
|
||||||
|
<el-button @click="resetQuery"><Icon icon="ep:refresh" class="mr-5px" /> 重置</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
</ContentWrap>
|
||||||
|
|
||||||
|
<!-- 列表 -->
|
||||||
|
<ContentWrap>
|
||||||
|
<el-table
|
||||||
|
v-loading="loading"
|
||||||
|
:data="list"
|
||||||
|
:stripe="true"
|
||||||
|
:show-overflow-tooltip="true"
|
||||||
|
highlight-current-row
|
||||||
|
@current-change="handleCurrentChange"
|
||||||
|
>
|
||||||
|
<el-table-column label="序号" align="center" type="index" width="70" />
|
||||||
|
<el-table-column label="物品名字" align="center" prop="itemName" />
|
||||||
|
<el-table-column label="物品分类" align="center" prop="categoryId">
|
||||||
|
<template #default="scope">
|
||||||
|
<dict-tag :type="DICT_TYPE.BGYP_UNIT" :value="scope.row.categoryId" />
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="物品状态" align="center" prop="itemStatus">
|
||||||
|
<template #default="scope">
|
||||||
|
<dict-tag :type="DICT_TYPE.DRIVER_STATUS" :value="scope.row.itemStatus" />
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="单位" align="center" prop="unit" />
|
||||||
|
<el-table-column
|
||||||
|
label="创建时间"
|
||||||
|
align="center"
|
||||||
|
prop="createTime"
|
||||||
|
:formatter="dateFormatter2"
|
||||||
|
width="180px"
|
||||||
|
/>
|
||||||
|
</el-table>
|
||||||
|
<!-- 分页 -->
|
||||||
|
<Pagination
|
||||||
|
:total="total"
|
||||||
|
v-model:page="queryParams.pageNo"
|
||||||
|
v-model:limit="queryParams.pageSize"
|
||||||
|
@pagination="getList"
|
||||||
|
/>
|
||||||
|
</ContentWrap>
|
||||||
|
|
||||||
|
<!-- 表单弹窗:添加/修改 -->
|
||||||
|
<ItemsForm ref="formRef" @success="getList" />
|
||||||
|
<template #footer>
|
||||||
|
<el-button type="primary" @click="submit()">确定</el-button>
|
||||||
|
<el-button @click="dialogVisible=false">取消</el-button>
|
||||||
|
</template>
|
||||||
|
</Dialog>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts">
|
||||||
|
import {DICT_TYPE, getIntDictOptions, getStrDictOptions} from "@/utils/dict";
|
||||||
|
import {ItemsApi, ItemsVO} from "@/api/home/items";
|
||||||
|
import {dateFormatter2} from "@/utils/formatTime";
|
||||||
|
import ItemsForm from "@/views/Home/bgnr/items/ItemsForm.vue";
|
||||||
|
|
||||||
|
defineOptions({ name: 'SelectItemForm' })
|
||||||
|
/** 自定义事件 */
|
||||||
|
const emit = defineEmits(['success'])
|
||||||
|
|
||||||
|
const message = useMessage() // 消息弹窗
|
||||||
|
const dialogVisible = ref(false) // 弹窗的是否展示
|
||||||
|
const dialogTitle = ref('') // 弹窗的标题
|
||||||
|
|
||||||
|
const loading = ref(true) // 列表的加载中
|
||||||
|
const list = ref<ItemsVO[]>([]) // 列表的数据
|
||||||
|
const total = ref(0) // 列表的总页数
|
||||||
|
const queryParams = reactive({
|
||||||
|
pageNo: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
id: undefined,
|
||||||
|
itemName: undefined,
|
||||||
|
categoryId: undefined,
|
||||||
|
itemStatus: undefined,
|
||||||
|
stockQuantity: undefined,
|
||||||
|
unitPrice: undefined,
|
||||||
|
stockDate: [],
|
||||||
|
itemDescription: undefined,
|
||||||
|
unit: undefined,
|
||||||
|
remarks: undefined,
|
||||||
|
createTime: [],
|
||||||
|
})
|
||||||
|
const queryFormRef = ref() // 搜索的表单
|
||||||
|
|
||||||
|
/** 查询列表 */
|
||||||
|
const getList = async () => {
|
||||||
|
loading.value = true
|
||||||
|
try {
|
||||||
|
const data = await ItemsApi.getItemsPage(queryParams)
|
||||||
|
list.value = data.list
|
||||||
|
total.value = data.total
|
||||||
|
} finally {
|
||||||
|
loading.value = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 搜索按钮操作 */
|
||||||
|
const handleQuery = () => {
|
||||||
|
queryParams.pageNo = 1
|
||||||
|
getList()
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 重置按钮操作 */
|
||||||
|
const resetQuery = () => {
|
||||||
|
queryFormRef.value.resetFields()
|
||||||
|
handleQuery()
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 打开弹窗 */
|
||||||
|
const open = async () => {
|
||||||
|
dialogVisible.value = true
|
||||||
|
dialogTitle.value = '选择办公用品'
|
||||||
|
resetForm()
|
||||||
|
loading.value = true
|
||||||
|
try {
|
||||||
|
await getList()
|
||||||
|
} finally {
|
||||||
|
loading.value = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
defineExpose({ open }) // 提供 open 方法,用于打开弹窗
|
||||||
|
|
||||||
|
/** 处理单选数据 */
|
||||||
|
const handleCurrentChange = async (val: any | undefined)=>{
|
||||||
|
resetForm()
|
||||||
|
info.value = val
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
const info= ref()
|
||||||
|
/** 确定*/
|
||||||
|
const submit = ()=>{
|
||||||
|
dialogVisible.value = false
|
||||||
|
if (info.value) {
|
||||||
|
message.success('选择成功')
|
||||||
|
emit('success',info.value)
|
||||||
|
}else {
|
||||||
|
message.error('未选择')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 重置表单 */
|
||||||
|
const resetForm = () => {
|
||||||
|
info.value={
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
@ -27,50 +27,39 @@
|
|||||||
<el-form-item label="标题" prop="title">
|
<el-form-item label="标题" prop="title">
|
||||||
<el-input v-model="formData.title" placeholder="请输入标题" />
|
<el-input v-model="formData.title" placeholder="请输入标题" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-row :gutter="8" style="width: 100%;">
|
<el-form-item label="车辆状态" prop="carStatus">
|
||||||
<el-col :span="6">
|
<el-radio-group v-model="formData.carStatus" disabled>
|
||||||
<el-form-item label="请选择" >
|
<el-radio
|
||||||
<el-row :gutter="8">
|
v-for="dict in getIntDictOptions(DICT_TYPE.CLGL_CAR_STATUS)"
|
||||||
<el-col :span="12">
|
:key="dict.value"
|
||||||
<el-button @click="openForm()" size="small" type="info">
|
:label="dict.value"
|
||||||
<Icon icon="ep:plus" /> 选择车辆
|
disabled
|
||||||
</el-button>
|
>
|
||||||
</el-col>
|
{{ dict.label }}
|
||||||
<el-col :span="12">
|
</el-radio>
|
||||||
<el-button @click="openDriverForm()" size="small" type="info">
|
</el-radio-group>
|
||||||
<Icon icon="ep:plus" /> 选择驾驶员
|
</el-form-item>
|
||||||
</el-button>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="18">
|
|
||||||
<el-form-item label="车辆状态" prop="carStatus">
|
|
||||||
<el-radio-group v-model="formData.carStatus" disabled>
|
|
||||||
<el-radio
|
|
||||||
v-for="dict in getIntDictOptions(DICT_TYPE.CLGL_CAR_STATUS)"
|
|
||||||
:key="dict.value"
|
|
||||||
:label="dict.value"
|
|
||||||
disabled
|
|
||||||
>
|
|
||||||
{{ dict.label }}
|
|
||||||
</el-radio>
|
|
||||||
</el-radio-group>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="车辆类型" prop="carType">
|
<el-form-item label="车辆类型" prop="carType">
|
||||||
<el-select v-model="formData.carType" placeholder="请选择用车类型" disabled>
|
<el-row style="width: 100%;" :gutter="2">
|
||||||
<el-option
|
<el-col :span="22">
|
||||||
v-for="dict in getIntDictOptions(DICT_TYPE.CLGL_CAR_TYPE)"
|
<el-select v-model="formData.carType" placeholder="请选择用车类型" disabled>
|
||||||
:key="dict.value"
|
<el-option
|
||||||
:label="dict.label"
|
v-for="dict in getIntDictOptions(DICT_TYPE.CLGL_CAR_TYPE)"
|
||||||
:value="dict.value"
|
:key="dict.value"
|
||||||
disabled
|
:label="dict.label"
|
||||||
/>
|
:value="dict.value"
|
||||||
</el-select>
|
disabled
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="2">
|
||||||
|
<el-button @click="openForm()" size="small" type="text">
|
||||||
|
<Icon icon="ep:plus" />
|
||||||
|
</el-button>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
@ -82,7 +71,16 @@
|
|||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="驾驶员" prop="carDriver">
|
<el-form-item label="驾驶员" prop="carDriver">
|
||||||
<el-input v-model="formData.carDriver" placeholder="请输入驾驶员" disabled />
|
<el-row style="width: 100%;" :gutter="2">
|
||||||
|
<el-col :span="22">
|
||||||
|
<el-input v-model="formData.carDriver" placeholder="请输入驾驶员" disabled />
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="2">
|
||||||
|
<el-button @click="openDriverForm()" size="small" type="text">
|
||||||
|
<Icon icon="ep:plus" />
|
||||||
|
</el-button>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
|
Loading…
Reference in New Issue
Block a user