|
@@ -1,5 +1,5 @@
|
|
|
-<template>
|
|
|
- <el-button el-button type="primary" icon="Download" @click="dialogFormVisible = true">收发登记表</el-button>
|
|
|
+<template>
|
|
|
+ <el-button el-button type="primary" icon="Download" @click="showdialog">收发登记表</el-button>
|
|
|
<el-button el-button type="primary" icon="Download" @click="dialogFormVisible1 = true">运输登记表</el-button>
|
|
|
<el-dialog v-model="dialogFormVisible" title="收发登记表" :append-to-body="true" draggable width="30%">
|
|
|
<el-form :model="initParam" ref="ruleFormRef" :rules="rules">
|
|
@@ -25,9 +25,11 @@
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="批号" :label-width="formLabelWidth" prop="batchNumber">
|
|
|
- <el-select v-model="initParam.batchNumber" class="m-2" placeholder="Select" style="width: 100%;">
|
|
|
+ <!-- <el-select v-model="initParam.batchNumber" class="m-2" placeholder="Select" style="width: 100%;">
|
|
|
<el-option v-for="item in options5" :key="item" :label="item" :value="item" />
|
|
|
- </el-select>
|
|
|
+ </el-select> -->
|
|
|
+ <el-autocomplete v-model="initParam.batchNumber" :fetch-suggestions="querySearch" clearable
|
|
|
+ class="inputWidth" placeholder="批号" style="width: 100%;"/>
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
<template #footer>
|
|
@@ -45,14 +47,14 @@
|
|
|
style="width: 100%;" />
|
|
|
</el-form-item>
|
|
|
<el-form-item label="收货单位" :label-width="formLabelWidth" prop="receivingUnit">
|
|
|
- <el-select v-model.number="initParamWord.receivingUnit" filterable remote reserve-keyword placeholder="疫苗名称"
|
|
|
+ <el-select v-model.number="initParamWord.receivingUnit" filterable remote reserve-keyword placeholder="收货单位"
|
|
|
:remote-method="remoteMethod4" :loading="loading" clearable style="width: 100%;"
|
|
|
@clear="initParamWord.receivingUnit = null" @click="click4">
|
|
|
<el-option v-for="item in options4" :key="item.value" :label="item.label" :value="item.value" />
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="疫苗名称" :label-width="formLabelWidth">
|
|
|
- <el-select v-model.number="initParamWord.productId" filterable remote reserve-keyword placeholder="疫苗名称"
|
|
|
+ <el-form-item label="品名" :label-width="formLabelWidth">
|
|
|
+ <el-select v-model.number="initParamWord.productId" filterable remote reserve-keyword placeholder="品名"
|
|
|
:remote-method="remoteMethod1" :loading="loading" clearable style="width: 100%;"
|
|
|
@clear="initParamWord.productId = null" @click="click1">
|
|
|
<el-option v-for="item in options1" :key="item.value" :label="item.label" :value="item.value" />
|
|
@@ -90,7 +92,7 @@ interface RuleForm {
|
|
|
type: string
|
|
|
}
|
|
|
const initParam = reactive<RuleForm>({//请求参数
|
|
|
- "batchNumber": null,
|
|
|
+ "batchNumber":'',
|
|
|
"enterpriseId": null,
|
|
|
"productId": null,
|
|
|
"specId": null,
|
|
@@ -118,7 +120,6 @@ onMounted(async () => {
|
|
|
list2.value = findMap(result2 || [], 'obj')
|
|
|
list3.value = findMap(result3 || [], 'obj')
|
|
|
list4.value = findMap(result4 || [], 'map')
|
|
|
-
|
|
|
})
|
|
|
//函数
|
|
|
const findMap = (arr: any, obj: any) => {
|
|
@@ -147,7 +148,6 @@ const options1 = ref<ListItem[]>([])
|
|
|
const options2 = ref<ListItem[]>([])
|
|
|
const options3 = ref<ListItem[]>([])
|
|
|
const options4 = ref<ListItem[]>([])
|
|
|
-const options5 = ref<ListItem[]>([])
|
|
|
|
|
|
|
|
|
|
|
@@ -204,9 +204,41 @@ const remoteMethod4 = async (query: string) => {
|
|
|
options3.value = []
|
|
|
}
|
|
|
}
|
|
|
-onMounted(async () => {
|
|
|
- options5.value = await LotNumber()
|
|
|
-})
|
|
|
+//函数
|
|
|
+const showdialog = async ()=>{
|
|
|
+ dialogFormVisible.value = true
|
|
|
+ const reslut:any = await LotNumber()
|
|
|
+ console.log('数据1',reslut)
|
|
|
+ const arrMap = reslut
|
|
|
+ const arr:any = []
|
|
|
+ arrMap.forEach((item:any)=>{
|
|
|
+ arr.push({ value: item, link: item})
|
|
|
+ })
|
|
|
+ restaurants.value = arr
|
|
|
+ console.log('数据2',restaurants.value)
|
|
|
+}
|
|
|
+
|
|
|
+interface RestaurantItem {
|
|
|
+ value: string
|
|
|
+ link: string
|
|
|
+}
|
|
|
+const restaurants = ref<RestaurantItem[]>([])
|
|
|
+const querySearch = (queryString: string, cb: any) => {
|
|
|
+ const results = queryString
|
|
|
+ ? restaurants.value.filter(createFilter(queryString))
|
|
|
+ : restaurants.value
|
|
|
+ cb(results)
|
|
|
+}
|
|
|
+const createFilter = (queryString: string) => {
|
|
|
+ return (restaurant: RestaurantItem) => {
|
|
|
+ return (
|
|
|
+ restaurant.value.toLowerCase().indexOf(queryString.toLowerCase()) === 0
|
|
|
+ )
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
const rules = reactive({
|
|
|
batchNumber: [{ required: true, message: '必填项', trigger: 'change' }],
|
|
|
enterpriseId: [{ required: true, message: '必填项', trigger: 'change' }],
|
|
@@ -244,4 +276,7 @@ const submitForm1 = async (formEl: FormInstance | undefined,ty:any) => {
|
|
|
</script>
|
|
|
<style lang="scss">
|
|
|
/* @import url(); 引入css类 */
|
|
|
+.inputWidth {
|
|
|
+ width: 200px;
|
|
|
+}
|
|
|
</style>
|