仓库联系人 模糊搜索

仓库联系人 模糊搜索
pull/1/head
siontion 9 months ago
parent 0896e5542a
commit 7fe87169e4

@ -1,15 +1,9 @@
<template> <template>
<el-card class="hl-card"> <el-card class="hl-card">
<template #header> <template #header>
<span>新建</span> <span v-text="dialogTitle"></span>
</template> </template>
<el-form <el-form ref="formRef" :model="formData" :rules="formRules" label-width="100px" v-loading="formLoading">
ref="formRef"
:model="formData"
:rules="formRules"
label-width="100px"
v-loading="formLoading"
>
<el-card class="hl-card-info"> <el-card class="hl-card-info">
<template #header> <template #header>
<div class="hl-card-info-icona"></div><span class="hl-card-info-text">基础信息</span> <div class="hl-card-info-icona"></div><span class="hl-card-info-text">基础信息</span>
@ -19,25 +13,21 @@
<el-row> <el-row>
<el-col :span="24"> <el-col :span="24">
<el-form-item prop="name" label="入库单号" required> <el-form-item prop="name" label="入库单号" required>
<el-input v-model="formData.name" disabled /> <el-input v-model="formData.stockNo" disabled />
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="24"> <el-col :span="24">
<el-form-item prop="level" label="入库类型"> <el-form-item prop="stockInType" label="入库类型" required>
<el-select v-model="formData.level" clearable style="width: 100%"> <el-select v-model="formData.stockInType" clearable style="width: 100%">
<el-option <el-option v-for="dict in getIntDictOptions(DICT_TYPE.HELI_STORAGE_IN_TYPE)" :key="dict.value"
v-for="dict in getIntDictOptions(DICT_TYPE.HELI_CUSTOMER_LEVEL)" :label="dict.label" :value="dict.value" />
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
<el-row> <el-row>
@ -54,38 +44,36 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
<el-row> <el-row v-if="isShow">
<el-col :span="24"> <el-col :span="24">
<el-form-item prop="industry" label="单据状态"> <el-form-item prop="industry" label="单据状态">
<el-input v-model="formData.industry" disabled /> <el-select v-model="formData.status" placeholder="下拉选择" clearable class="!w-400px" disabled>
<el-option v-for="dict in getIntDictOptions(DICT_TYPE.HELI_STORAGE_STATUS)" :key="dict.value"
:label="dict.label" :value="dict.value" />
</el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="24"> <el-col :span="24">
<el-form-item prop="level" label="入库仓库"> <el-form-item prop="level" label="入库仓库">
<el-select v-model="formData.level" clearable style="width: 100%"> <el-select v-model="formData.whId" placeholder="下拉选择" clearable class="!w-400px">
<el-option <el-option v-for="dict in warehouseList" :key="dict.value" :label="dict.label" :value="dict.value" />
v-for="dict in getIntDictOptions(DICT_TYPE.HELI_CUSTOMER_LEVEL)"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
</el-col> </el-col>
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="24"> <el-col :span="24">
<el-form-item label="备注" prop="description"> <el-form-item label="备注" prop="description">
<el-input type="textarea" v-model="formData.description" show-word-limit maxlength="200"/> <el-input type="textarea" v-model="formData.description" show-word-limit maxlength="200" />
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
@ -99,16 +87,10 @@
<el-col> <el-col>
<el-card class="hl-incard"> <el-card class="hl-incard">
<el-col> <el-col>
<el-button class="hl-addbutton" type="primary" size="large" @click="onAddItem" <el-button class="hl-addbutton" type="primary" size="large" @click="onAddItem"></el-button>
>新增</el-button
>
</el-col> </el-col>
<el-table <el-table :data="formData.productBomItemDOList" class="hl-table" @cell-click="handleCellClick"
:data="formData.productBomItemDOList" @cell-blur="handleCellBlur">
class="hl-table"
@cell-click="handleCellClick"
@cell-blur="handleCellBlur"
>
<el-table-column prop="" label="序号" /> <el-table-column prop="" label="序号" />
<el-table-column prop="projectName" label="物料编码"> <el-table-column prop="projectName" label="物料编码">
<template #default="scope"> <template #default="scope">
@ -117,52 +99,35 @@
</el-table-column> </el-table-column>
<el-table-column prop="name" label="物料名称"> <el-table-column prop="name" label="物料名称">
<template #default="scope"> <template #default="scope">
<el-input <el-input v-model="scope.row.name" @click="openshoopname(scope.$index)"
v-model="scope.row.name" :disabled="!scope.row.editable" />
@click="openshoopname(scope.$index)"
:disabled="!scope.row.editable"
/>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="inventoryType" label="物料类型"> <el-table-column prop="inventoryType" label="物料类型">
<template #default="scope"> <template #default="scope">
<dict-tag <dict-tag :type="DICT_TYPE.HELI_MATERIAL_TYPE" :value="scope.row.inventoryType" />
:type="DICT_TYPE.PRODUCT_SAVE_TYPE"
:value="scope.row.inventoryType"
/>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="spec" label="规格/型号" /> <el-table-column prop="spec" label="规格/型号" />
<el-table-column prop="inventoryUnitId" label="系统单位"> <el-table-column prop="inventoryUnitId" label="系统单位">
<template #default="scope"> <template #default="scope">
<dict-tag <dict-tag :type="DICT_TYPE.HELI_MATERIAL_UNIT" :value="scope.row.inventoryUnitId" />
:type="DICT_TYPE.PRODUCT_INVENTORY_UNIT_ID"
:value="scope.row.inventoryUnitId"
/>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="unit" width="120" label="入库库区"> <el-table-column prop="unit" width="120" label="入库库区">
<template #default="scope"> <template #default="scope">
<el-select v-model="scope.row.unit" placeholder="" style="width: 100%"> <el-select v-model="scope.row.unit" placeholder="" style="width: 100%">
<el-option <el-option v-for="dict in getIntDictOptions(DICT_TYPE.PRODUCT_INVENTORY_UNIT_ID)" :key="dict.value"
v-for="dict in getIntDictOptions(DICT_TYPE.PRODUCT_INVENTORY_UNIT_ID)" :label="dict.label" :value="dict.value.toString()" />
:key="dict.value"
:label="dict.label"
:value="dict.value.toString()"
/>
</el-select> </el-select>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="unit" width="120" label="入库库位"> <el-table-column prop="unit" width="120" label="入库库位">
<template #default="scope"> <template #default="scope">
<el-select v-model="scope.row.unit" placeholder="" style="width: 100%"> <el-select v-model="scope.row.unit" placeholder="" style="width: 100%">
<el-option <el-option v-for="dict in getIntDictOptions(DICT_TYPE.PRODUCT_INVENTORY_UNIT_ID)" :key="dict.value"
v-for="dict in getIntDictOptions(DICT_TYPE.PRODUCT_INVENTORY_UNIT_ID)" :label="dict.label" :value="dict.value.toString()" />
:key="dict.value"
:label="dict.label"
:value="dict.value.toString()"
/>
</el-select> </el-select>
</template> </template>
</el-table-column> </el-table-column>
@ -183,34 +148,16 @@
</el-table-column> </el-table-column>
<el-table-column label="操作" align="center" width="240"> <el-table-column label="操作" align="center" width="240">
<template #default="scope"> <template #default="scope">
<el-button <!-- <el-button v-if="!scope.row.editable" type="primary" size="small" link
v-if="!scope.row.editable" @click="handleEdit(scope.$index)">
type="primary"
size="small"
link
@click="handleEdit(scope.$index)"
>
编辑 编辑
</el-button> </el-button>
<el-button <el-button link v-else type="success" size="small" @click="handleSave(scope.$index)">
link
v-else
type="success"
size="small"
@click="handleSave(scope.$index)"
>
保存 保存
</el-button> </el-button>
<el-button link type="primary" @click="handlefuke(scope.$index, scope.row)" <el-button link type="primary" @click="handlefuke(scope.$index, scope.row)">复制</el-button> -->
>复制</el-button <el-button link type="danger" size="small" @click.prevent="handleDelete2(scope.$index)">
>
<el-button
link
type="danger"
size="small"
@click.prevent="handleDelete2(scope.$index)"
>
删除 删除
</el-button> </el-button>
</template> </template>
@ -229,19 +176,10 @@
<el-col> <el-col>
<el-card class="hl-incard"> <el-card class="hl-incard">
<el-col> <el-col>
<el-upload <el-upload v-model:file-list="fileList" :show-file-list="false" class="upload-demo"
v-model:file-list="fileList" action="https://run.mocky.io/v3/9d059bf9-4660-45f2-925d-ce80ad6c4d15" multiple
:show-file-list="false" :on-preview="handlePreview" :on-remove="handleRemove" :before-remove="beforeRemove" :limit="3"
class="upload-demo" :on-exceed="handleExceed" @before-upload="handleBeforeUpload">
action="https://run.mocky.io/v3/9d059bf9-4660-45f2-925d-ce80ad6c4d15"
multiple
:on-preview="handlePreview"
:on-remove="handleRemove"
:before-remove="beforeRemove"
:limit="3"
:on-exceed="handleExceed"
@before-upload="handleBeforeUpload"
>
<el-button type="primary" size="large" class="hl-addbutton">上传</el-button> <el-button type="primary" size="large" class="hl-addbutton">上传</el-button>
</el-upload> </el-upload>
</el-col> </el-col>
@ -275,37 +213,37 @@
<el-row justify="center"> <el-row justify="center">
<el-col :span="8"> <el-col :span="8">
<el-form-item prop="level" label="创建人"> <el-form-item prop="creator" label="创建人">
<el-input v-model="formData.level" class="!w-300px" disabled /> <el-input v-model="formData.creator" class="!w-300px" disabled />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
<el-form-item prop="level" label="创建时间"> <el-form-item prop="createTime" label="创建时间">
<el-input v-model="formData.level" class="!w-300px" disabled /> <el-input v-model="formData.createTime" class="!w-300px" disabled />
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-row justify="center"> <el-row justify="center">
<el-col :span="8"> <el-col :span="8">
<el-form-item prop="level" label="入库人"> <el-form-item prop="keeper" label="入库人">
<el-input v-model="formData.level" class="!w-300px" disabled /> <el-input v-model="formData.keeper" class="!w-300px" disabled />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
<el-form-item prop="level" label="入库时间"> <el-form-item prop="keeperTime" label="入库时间">
<el-input v-model="formData.level" class="!w-300px" disabled /> <el-input v-model="formData.keeperTime" class="!w-300px" disabled />
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-row justify="center"> <el-row justify="center">
<el-col :span="8"> <el-col :span="8">
<el-form-item prop="level" label="作废人"> <el-form-item prop="outbound" label="作废人">
<el-input v-model="formData.level" class="!w-300px" disabled /> <el-input v-model="formData.outbound" class="!w-300px" disabled />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
<el-form-item prop="level" label="作废时间"> <el-form-item prop="outboundTime" label="作废时间">
<el-input v-model="formData.level" class="!w-300px" disabled /> <el-input v-model="formData.outboundTime" class="!w-300px" disabled />
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
@ -313,15 +251,9 @@
</el-form> </el-form>
<div class="text-center hl-footer"> <div class="text-center hl-footer">
<el-button @click="goback" size="large"> </el-button> <el-button @click="goback" size="large"> </el-button>
<el-button @click="submitForm" type="success" :disabled="formLoading" size="large" <el-button @click="submitForm" type="success" :disabled="formLoading" size="large"> </el-button>
> </el-button <el-button @click="submitForm" type="primary" :disabled="formLoading" size="large"> </el-button>
> <el-button @click="submitForm" type="danger" :disabled="formLoading" size="large"> </el-button>
<el-button @click="submitForm" type="primary" :disabled="formLoading" size="large"
> </el-button
>
<el-button @click="submitForm" type="danger" :disabled="formLoading" size="large"
> </el-button
>
</div> </div>
</el-card> </el-card>
</template> </template>
@ -332,18 +264,36 @@ import { ElMessage, ElMessageBox } from 'element-plus'
import type { UploadProps, UploadUserFile } from 'element-plus' import type { UploadProps, UploadUserFile } from 'element-plus'
import { getIntDictOptions, DICT_TYPE } from '@/utils/dict' import { getIntDictOptions, DICT_TYPE } from '@/utils/dict'
import * as MouldTypeApi from '@/api/heli/mouldtype' import * as MouldTypeApi from '@/api/heli/mouldtype'
import * as WarehouseApi from '@/api/heli/warehouse'
import * as RgApi from '@/api/heli/rg'
import * as PnApi from '@/api/heli/pn'
const { t } = useI18n() // const { t } = useI18n() //
const message = useMessage() // const message = useMessage() //
const isShow = ref(false)
const dialogVisible = ref(false) // const dialogVisible = ref(false) //
const dialogTitle = ref('') // const dialogTitle = ref('') //
const formLoading = ref(false) // 12 const formLoading = ref(false) // 12
const formType = ref('') // create - update - const formType = ref('') // create - update -
const formData = ref({ const formData = ref({
id: undefined, id: undefined,
name: undefined, stockType: undefined,
status: 1, stockInType: undefined,
stockOutType: undefined,
stockNo: undefined,
headerNo: undefined,
description: undefined,
status: undefined,
whId: undefined,
creator :undefined,
createTime :undefined,
keeper: undefined,
keeperTime: undefined,
outbound: undefined,
outboundTime: undefined,
cancel: undefined,
cancelTime: undefined,
productBomItemDOList: [] productBomItemDOList: []
}) })
const formRules = reactive({ const formRules = reactive({
@ -352,6 +302,7 @@ const formRules = reactive({
}) })
const formRef = ref() // Ref const formRef = ref() // Ref
/** 打开弹窗 */ /** 打开弹窗 */
const open = async (type: string, id?: number) => { const open = async (type: string, id?: number) => {
dialogVisible.value = true dialogVisible.value = true
@ -499,8 +450,7 @@ const handlePreview: UploadProps['onPreview'] = (uploadFile) => {
const handleExceed: UploadProps['onExceed'] = (files, uploadFiles) => { const handleExceed: UploadProps['onExceed'] = (files, uploadFiles) => {
ElMessage.warning( ElMessage.warning(
`The limit is 3, you selected ${files.length} files this time, add up to ${ `The limit is 3, you selected ${files.length} files this time, add up to ${files.length + uploadFiles.length
files.length + uploadFiles.length
} totally` } totally`
) )
console.log('333') console.log('333')
@ -512,7 +462,7 @@ const handleBeforeUpload = (file: File) => {
// false // false
// return false; // return false;
// filelist // filelist
const newFile: any = { const newFile: any = {
name: '', name: '',
url: '', // URL url: '', // URL
@ -535,6 +485,66 @@ const beforeRemove: UploadProps['beforeRemove'] = (uploadFile, uploadFiles) => {
const handleDelete = (index: number) => { const handleDelete = (index: number) => {
fileList.value.splice(index, 1) fileList.value.splice(index, 1)
} }
//
const warehouseList = ref([])
//
const rgList = ref([])
//
const pnList = ref([])
/** 初始化 **/
onMounted(async () => {
const router = useRoute();
dialogTitle.value = t('action.' + router.query.type)
isShow.value =router.query.type == "create"?false: true
//-------------------
const queryParamsWarehouse = reactive({
pageNo: 1,
pageSize: 99,
whStatus :1
})
const data = await WarehouseApi.getWarehousePage(queryParamsWarehouse)
data.list.forEach(element => {
element.label = element.whName
element.value = element.id
});
warehouseList.value = data.list
//-------------------
//-------------------
const queryParamsRg = reactive({
pageNo: 1,
pageSize: 99,
rgStatus : 1
})
const dataRg = await RgApi.getRgPage(queryParamsRg)
dataRg.list.forEach(element => {
element.label = element.rgName
element.value = element.id
});
rgList.value = dataRg.list
//-------------------
//-------------------
const queryParamsRPn = reactive({
pageNo: 1,
pageSize: 99,
pnStatus : 1
})
const dataPn = await PnApi.getPnPage(queryParamsRPn)
dataRg.list.forEach(element => {
element.label = element.rgName
element.value = element.id
});
pnList.value = dataPn.list
//-------------------
})
</script> </script>
<style> <style>
a { a {

@ -1,31 +1,26 @@
<template> <template>
<Dialog :title="dialogTitle" v-model="dialogVisible" width="700px"> <Dialog :title="dialogTitle" v-model="dialogVisible" width="700px">
<el-form <el-form ref="formRef" :model="formData" :rules="formRules" label-width="108px" v-loading="formLoading">
ref="formRef"
:model="formData"
:rules="formRules"
label-width="108px"
v-loading="formLoading"
>
<el-form-item label="仓库编号" prop="whNo"> <el-form-item label="仓库编号" prop="whNo">
<el-input v-model="formData.whNo" disabled class="!w-500px" /> <el-input v-model="formData.whNo" disabled class="!w-500px" />
</el-form-item> </el-form-item>
<el-form-item label="仓库名称" prop="whName"> <el-form-item label="仓库名称" prop="whName">
<el-input v-model="formData.whName" placeholder="请输入仓库名称" class="!w-500px" /> <el-input v-model="formData.whName" placeholder="请输入仓库名称" class="!w-500px" />
</el-form-item> </el-form-item>
<el-form-item label="联系人" prop="contact"> <el-form-item label="联系人" prop="contact">
<el-input v-model="formData.contact" placeholder="请输入联系人" class="!w-500px" /> <!-- <el-input v-model="formData.contact" placeholder="请输入联系人" class="!w-500px" /> -->
<el-select v-model="formData.contact" placeholder="请输入联系人" :remote-method="remoteUserSearch" remote-show-suffix
remote clearable reserve-keyword filterable :loading="userSelectLoading">
<el-option v-for="item in userSelectList" :key="item.id" :label="item.username + ' ' + item.nickname"
:value="item.id" />
</el-select>
</el-form-item> </el-form-item>
<el-form-item label="联系电话" prop="telephone"> <el-form-item label="联系电话" prop="telephone">
<el-input v-model="formData.telephone" placeholder="请输入联系电话" class="!w-500px" /> <el-input v-model="formData.telephone" placeholder="请输入联系电话" class="!w-500px" />
</el-form-item> </el-form-item>
<el-form-item label="状态" prop="whStatus"> <el-form-item label="状态" prop="whStatus">
<el-radio-group v-model="formData.whStatus"> <el-radio-group v-model="formData.whStatus">
<el-radio <el-radio v-for="dict in getIntDictOptions(DICT_TYPE.HELI_COMMON_STATUS)" :key="dict.value" :label="dict.value">
v-for="dict in getIntDictOptions(DICT_TYPE.HELI_COMMON_STATUS)"
:key="dict.value"
:label="dict.value"
>
{{ dict.label }} {{ dict.label }}
</el-radio> </el-radio>
</el-radio-group> </el-radio-group>
@ -40,6 +35,7 @@
<script setup lang="ts"> <script setup lang="ts">
import { getIntDictOptions, DICT_TYPE } from '@/utils/dict' import { getIntDictOptions, DICT_TYPE } from '@/utils/dict'
import * as WarehouseApi from '@/api/heli/warehouse' import * as WarehouseApi from '@/api/heli/warehouse'
import * as UserApi from "@/api/system/user";
const { t } = useI18n() // const { t } = useI18n() //
const message = useMessage() // const message = useMessage() //
@ -62,6 +58,23 @@ const formRules = reactive({
}) })
const formRef = ref() // Ref const formRef = ref() // Ref
const userList = ref<UserApi.UserVO[]>([]) //
const userSelectList = ref<UserApi.UserVO[]>([])
const userSelectLoading = ref(false);
const remoteUserSearch = (query: string) => {
if (query) {
userSelectLoading.value = true
setTimeout(() => {
userSelectLoading.value = false
userSelectList.value = userList.value.filter((item) => {
return item.nickname.toLowerCase().includes(query.toLowerCase()) || item.username.toLowerCase().includes(query.toLowerCase())
})
}, 200)
} else {
userSelectList.value = userList.value
}
}
/** 打开弹窗 */ /** 打开弹窗 */
const open = async (type: string, id?: number) => { const open = async (type: string, id?: number) => {
dialogVisible.value = true dialogVisible.value = true
@ -76,7 +89,17 @@ const open = async (type: string, id?: number) => {
} finally { } finally {
formLoading.value = false formLoading.value = false
} }
}
//
let userParams = {
pageNo: 1,
pageSize: 10,
status: "0"
} }
const data = await UserApi.getUserPage(userParams)
userList.value = data.list;
userSelectList.value = data.list;
} }
defineExpose({ open }) // open defineExpose({ open }) // open

Loading…
Cancel
Save