|
@@ -38,14 +38,14 @@
|
|
|
<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-button
|
|
|
+ <el-button v-if="!isDetail"
|
|
|
type="primary"
|
|
|
plain
|
|
|
@click="openForm('create')"
|
|
|
>
|
|
|
<Icon icon="ep:plus" class="mr-5px" /> 新增
|
|
|
</el-button>
|
|
|
- <el-button
|
|
|
+ <el-button v-if="!isDetail"
|
|
|
type="success"
|
|
|
plain
|
|
|
@click="handleExport"
|
|
@@ -69,7 +69,7 @@
|
|
|
<el-table-column label="职务" align="center" prop="position" />
|
|
|
<el-table-column label="电话" align="center" prop="telephone" />
|
|
|
<el-table-column label="邮箱" align="center" prop="email" />
|
|
|
- <el-table-column label="联系人负责的产品/业务模块" align="center" prop="productIds" >
|
|
|
+ <el-table-column label="负责的产品/业务模块" align="center" prop="productIds" >
|
|
|
<template #default="scope">
|
|
|
<span>{{ productList.find((item) => item.id === scope.row.productIds)?.name }}</span>
|
|
|
</template>
|
|
@@ -83,7 +83,7 @@
|
|
|
:formatter="dateFormatter"
|
|
|
width="180px"
|
|
|
/>
|
|
|
- <el-table-column label="操作" align="center" min-width="120px">
|
|
|
+ <el-table-column label="操作" v-if="!isDetail" align="center" min-width="120px">
|
|
|
<template #default="scope">
|
|
|
<el-button
|
|
|
link
|
|
@@ -114,7 +114,12 @@
|
|
|
</ContentWrap>
|
|
|
|
|
|
<!-- 表单弹窗:添加/修改 -->
|
|
|
- <ContactForm ref="formRef" @success="getList" />
|
|
|
+ <ContactForm ref="formRef" :supplierId="{ receivedParam }" @success="getList" />
|
|
|
+ <el-form>
|
|
|
+ <el-form-item style="float: right">
|
|
|
+ <el-button @click="close" type="primary">返回</el-button>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
</template>
|
|
|
|
|
|
<script setup lang="ts">
|
|
@@ -125,10 +130,16 @@ import ContactForm from './ContactForm.vue'
|
|
|
import {SupplierVO} from "@/api/supplier/base";
|
|
|
import * as SupplierBaseApi from "@/api/supplier/base";
|
|
|
import * as SupplierDetailApi from "@/api/supplier/product/supplierdetail";
|
|
|
-
|
|
|
+import { propTypes } from '@/utils/propTypes'
|
|
|
+import {useTagsViewStore} from "@/store/modules/tagsView";
|
|
|
+const { delView } = useTagsViewStore() // 视图操作
|
|
|
+const { push, currentRoute } = useRouter() // 路由
|
|
|
/** 供应商联系人 列表 */
|
|
|
defineOptions({ name: 'SupplierContact' })
|
|
|
-
|
|
|
+const props = defineProps({
|
|
|
+ isDetail: propTypes.bool.def(false), // 是否作为详情组件
|
|
|
+ receivedParam: { type: undefined, default: () => null }
|
|
|
+})
|
|
|
const message = useMessage() // 消息弹窗
|
|
|
const { t } = useI18n() // 国际化
|
|
|
const supplierList = ref([] as SupplierVO[])
|
|
@@ -156,19 +167,23 @@ const exportLoading = ref(false) // 导出的加载中
|
|
|
/** 查询列表 */
|
|
|
const getList = async () => {
|
|
|
loading.value = true
|
|
|
+ supplierList.value = await SupplierBaseApi.Api.getAll()
|
|
|
try {
|
|
|
+ queryParams.supplierId = props.receivedParam === null?'0000000000':props.receivedParam
|
|
|
const data = await ContactApi.getContactPage(queryParams)
|
|
|
list.value = data.list
|
|
|
total.value = data.total
|
|
|
+ queryParams.supplierId = undefined
|
|
|
} finally {
|
|
|
loading.value = false
|
|
|
}
|
|
|
}
|
|
|
|
|
|
/** 搜索按钮操作 */
|
|
|
-const handleQuery = () => {
|
|
|
+const handleQuery = async () => {
|
|
|
queryParams.pageNo = 1
|
|
|
- getList()
|
|
|
+ await getList()
|
|
|
+ supplierList.value = await SupplierBaseApi.Api.getAll()
|
|
|
}
|
|
|
|
|
|
/** 重置按钮操作 */
|
|
@@ -217,4 +232,10 @@ onMounted(async () => {
|
|
|
supplierList.value = await SupplierBaseApi.Api.getAll()
|
|
|
productList.value = await SupplierDetailApi.getAll()
|
|
|
})
|
|
|
+const close = () => {
|
|
|
+ delView(unref(currentRoute))
|
|
|
+ push({ name: 'Suppliers',query: {
|
|
|
+ date: new Date().getTime(),
|
|
|
+ } })
|
|
|
+}
|
|
|
</script>
|