更新
This commit is contained in:
parent
d13be9eeb6
commit
9c6dbac48e
@ -1,4 +1,4 @@
|
||||
|
||||
NODE_ENV = 'production'
|
||||
# Base API
|
||||
VITE_APP_BASE_URL='https://ceshi-engineering.lihaink.cn'
|
||||
VITE_APP_BASE_URL='http://a.com/'
|
7407
package-lock.json
generated
7407
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
26
src/api/bid_bidding_decision.ts
Normal file
26
src/api/bid_bidding_decision.ts
Normal file
@ -0,0 +1,26 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 投标决策列表
|
||||
export function apiBidBiddingDecisionLists(params: any) {
|
||||
return request.get({ url: '/bid.bid_bidding_decision/lists', params })
|
||||
}
|
||||
|
||||
// 添加投标决策
|
||||
export function apiBidBiddingDecisionAdd(params: any) {
|
||||
return request.post({ url: '/bid.bid_bidding_decision/add', params })
|
||||
}
|
||||
|
||||
// 编辑投标决策
|
||||
export function apiBidBiddingDecisionEdit(params: any) {
|
||||
return request.post({ url: '/bid.bid_bidding_decision/edit', params })
|
||||
}
|
||||
|
||||
// 删除投标决策
|
||||
export function apiBidBiddingDecisionDelete(params: any) {
|
||||
return request.post({ url: '/bid.bid_bidding_decision/delete', params })
|
||||
}
|
||||
|
||||
// 投标决策详情
|
||||
export function apiBidBiddingDecisionDetail(params: any) {
|
||||
return request.get({ url: '/bid.bid_bidding_decision/detail', params })
|
||||
}
|
26
src/api/bid_buy_bidding_document.ts
Normal file
26
src/api/bid_buy_bidding_document.ts
Normal file
@ -0,0 +1,26 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 购买标书列表
|
||||
export function apiBidBuyBiddingDocumentLists(params: any) {
|
||||
return request.get({ url: '/bid.bid_buy_bidding_document/lists', params })
|
||||
}
|
||||
|
||||
// 添加购买标书
|
||||
export function apiBidBuyBiddingDocumentAdd(params: any) {
|
||||
return request.post({ url: '/bid.bid_buy_bidding_document/add', params })
|
||||
}
|
||||
|
||||
// 编辑购买标书
|
||||
export function apiBidBuyBiddingDocumentEdit(params: any) {
|
||||
return request.post({ url: '/bid.bid_buy_bidding_document/edit', params })
|
||||
}
|
||||
|
||||
// 删除购买标书
|
||||
export function apiBidBuyBiddingDocumentDelete(params: any) {
|
||||
return request.post({ url: '/bid.bid_buy_bidding_document/delete', params })
|
||||
}
|
||||
|
||||
// 购买标书详情
|
||||
export function apiBidBuyBiddingDocumentDetail(params: any) {
|
||||
return request.get({ url: '/bid.bid_buy_bidding_document/detail', params })
|
||||
}
|
26
src/api/quotation.ts
Normal file
26
src/api/quotation.ts
Normal file
@ -0,0 +1,26 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 报价单列表
|
||||
export function apiQuotationLists(params: any) {
|
||||
return request.get({ url: '/quotation.quotation/lists', params })
|
||||
}
|
||||
|
||||
// 添加报价单
|
||||
export function apiQuotationAdd(params: any) {
|
||||
return request.post({ url: '/quotation.quotation/add', params })
|
||||
}
|
||||
|
||||
// 编辑报价单
|
||||
export function apiQuotationEdit(params: any) {
|
||||
return request.post({ url: '/quotation.quotation/edit', params })
|
||||
}
|
||||
|
||||
// 删除报价单
|
||||
export function apiQuotationDelete(params: any) {
|
||||
return request.post({ url: '/quotation.quotation/delete', params })
|
||||
}
|
||||
|
||||
// 报价单详情
|
||||
export function apiQuotationDetail(params: any) {
|
||||
return request.get({ url: '/quotation.quotation/detail', params })
|
||||
}
|
26
src/api/quotation_detail.ts
Normal file
26
src/api/quotation_detail.ts
Normal file
@ -0,0 +1,26 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 报价明细列表
|
||||
export function apiQuotationDetailLists(params: any) {
|
||||
return request.get({ url: '/quotation.quotation_detail/lists', params })
|
||||
}
|
||||
|
||||
// 添加报价明细
|
||||
export function apiQuotationDetailAdd(params: any) {
|
||||
return request.post({ url: '/quotation.quotation_detail/add', params })
|
||||
}
|
||||
|
||||
// 编辑报价明细
|
||||
export function apiQuotationDetailEdit(params: any) {
|
||||
return request.post({ url: '/quotation.quotation_detail/edit', params })
|
||||
}
|
||||
|
||||
// 删除报价明细
|
||||
export function apiQuotationDetailDelete(params: any) {
|
||||
return request.post({ url: '/quotation.quotation_detail/delete', params })
|
||||
}
|
||||
|
||||
// 报价明细详情
|
||||
export function apiQuotationDetailDetail(params: any) {
|
||||
return request.get({ url: '/quotation.quotation_detail/detail', params })
|
||||
}
|
@ -1,10 +1,10 @@
|
||||
const config = {
|
||||
terminal: 1, //终端
|
||||
title: '后台管理系统', //网站默认标题
|
||||
version: '1.6.0', //版本号
|
||||
baseUrl: `${import.meta.env.VITE_APP_BASE_URL || 'https://ceshi-engineering.lihaink.cn'}/`, //请求接口域名
|
||||
urlPrefix: 'adminapi', //请求默认前缀
|
||||
timeout: 10 * 1000 //请求超时时长
|
||||
}
|
||||
terminal: 1, //终端
|
||||
title: "后台管理系统", //网站默认标题
|
||||
version: "1.6.0", //版本号
|
||||
baseUrl: `${import.meta.env.VITE_APP_BASE_URL || "http://a.com"}/`, //请求接口域名
|
||||
urlPrefix: "adminapi", //请求默认前缀
|
||||
timeout: 10 * 1000, //请求超时时长
|
||||
};
|
||||
|
||||
export default config
|
||||
export default config;
|
||||
|
197
src/views/bid_bidding_decision/edit.vue
Normal file
197
src/views/bid_bidding_decision/edit.vue
Normal file
@ -0,0 +1,197 @@
|
||||
<template>
|
||||
<div class="edit-popup">
|
||||
<popup
|
||||
ref="popupRef"
|
||||
:title="popupTitle"
|
||||
:async="true"
|
||||
width="550px"
|
||||
@confirm="handleSubmit"
|
||||
@close="handleClose"
|
||||
>
|
||||
<el-form ref="formRef" :model="formData" label-width="90px" :rules="formRules">
|
||||
<el-form-item label="" prop="project_id">
|
||||
<el-input v-model="formData.project_id" clearable placeholder="请输入" />
|
||||
</el-form-item>
|
||||
<el-form-item label="项目估算" prop="project_estimation">
|
||||
<el-input v-model="formData.project_estimation" clearable placeholder="请输入项目估算" />
|
||||
</el-form-item>
|
||||
<el-form-item label="招标项目资金来源" prop="bidding_project_fund_source">
|
||||
<el-radio-group v-model="formData.bidding_project_fund_source" placeholder="请选择招标项目资金来源">
|
||||
<el-radio
|
||||
v-for="(item, index) in dictData.construction_funds_sources"
|
||||
:key="index"
|
||||
:label="parseInt(item.value)"
|
||||
>
|
||||
{{ item.name }}
|
||||
</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="投标时间" prop="bidding_time">
|
||||
<el-input v-model="formData.bidding_time" clearable placeholder="请输入投标时间" />
|
||||
</el-form-item>
|
||||
<el-form-item label="购买标书时间" prop="buy_bid_document_date">
|
||||
<el-input v-model="formData.buy_bid_document_date" clearable placeholder="请输入购买标书时间" />
|
||||
</el-form-item>
|
||||
<el-form-item label="招标方式" prop="bid_type">
|
||||
<el-radio-group v-model="formData.bid_type" placeholder="请选择招标方式">
|
||||
<el-radio
|
||||
v-for="(item, index) in dictData.bidding_method"
|
||||
:key="index"
|
||||
:label="parseInt(item.value)"
|
||||
>
|
||||
{{ item.name }}
|
||||
</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="竞争对手" prop="competitor">
|
||||
<el-input v-model="formData.competitor" clearable placeholder="请输入竞争对手" />
|
||||
</el-form-item>
|
||||
<el-form-item label="是否需要保证金" prop="is_margin">
|
||||
<el-radio-group v-model="formData.is_margin" placeholder="请选择是否需要保证金">
|
||||
<el-radio
|
||||
v-for="(item, index) in dictData.whether_status"
|
||||
:key="index"
|
||||
:label="parseInt(item.value)"
|
||||
>
|
||||
{{ item.name }}
|
||||
</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="保证金金额" prop="margin_amount">
|
||||
<el-input v-model="formData.margin_amount" clearable placeholder="请输入保证金金额" />
|
||||
</el-form-item>
|
||||
<el-form-item label="开标日期" prop="bid_opening_date">
|
||||
<el-input v-model="formData.bid_opening_date" clearable placeholder="请输入开标日期" />
|
||||
</el-form-item>
|
||||
<el-form-item label="保证金退还时间" prop="margin_amount_return_date">
|
||||
<el-input v-model="formData.margin_amount_return_date" clearable placeholder="请输入保证金退还时间" />
|
||||
</el-form-item>
|
||||
<el-form-item label="有无内部资源" prop="is_internal_resources">
|
||||
<el-radio-group v-model="formData.is_internal_resources" placeholder="请选择有无内部资源">
|
||||
<el-radio
|
||||
v-for="(item, index) in dictData.whether_status"
|
||||
:key="index"
|
||||
:label="parseInt(item.value)"
|
||||
>
|
||||
{{ item.name }}
|
||||
</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="项目把握度" prop="project_assurance">
|
||||
<el-input v-model="formData.project_assurance" clearable placeholder="请输入项目把握度" />
|
||||
</el-form-item>
|
||||
<el-form-item label="招标项目概况" prop="bid_project_overview">
|
||||
<el-input v-model="formData.bid_project_overview" clearable placeholder="请输入招标项目概况" />
|
||||
</el-form-item>
|
||||
<el-form-item label="项目简介" prop="project_desc">
|
||||
<el-input v-model="formData.project_desc" clearable placeholder="请输入项目简介" />
|
||||
</el-form-item>
|
||||
<el-form-item label="附件" prop="annex">
|
||||
<el-input v-model="formData.annex" clearable placeholder="请输入附件" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</popup>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup name="bidBiddingDecisionEdit">
|
||||
import type { FormInstance } from 'element-plus'
|
||||
import Popup from '@/components/popup/index.vue'
|
||||
import { apiBidBiddingDecisionAdd, apiBidBiddingDecisionEdit, apiBidBiddingDecisionDetail } from '@/api/bid_bidding_decision'
|
||||
import { timeFormat } from '@/utils/util'
|
||||
import type { PropType } from 'vue'
|
||||
defineProps({
|
||||
dictData: {
|
||||
type: Object as PropType<Record<string, any[]>>,
|
||||
default: () => ({})
|
||||
}
|
||||
})
|
||||
const emit = defineEmits(['success', 'close'])
|
||||
const formRef = shallowRef<FormInstance>()
|
||||
const popupRef = shallowRef<InstanceType<typeof Popup>>()
|
||||
const mode = ref('add')
|
||||
|
||||
|
||||
// 弹窗标题
|
||||
const popupTitle = computed(() => {
|
||||
return mode.value == 'edit' ? '编辑投标决策' : '新增投标决策'
|
||||
})
|
||||
|
||||
// 表单数据
|
||||
const formData = reactive({
|
||||
id: '',
|
||||
project_id: '',
|
||||
project_estimation: '',
|
||||
bidding_project_fund_source: '',
|
||||
bidding_time: '',
|
||||
buy_bid_document_date: '',
|
||||
bid_type: '',
|
||||
competitor: '',
|
||||
is_margin: '',
|
||||
margin_amount: '',
|
||||
bid_opening_date: '',
|
||||
margin_amount_return_date: '',
|
||||
is_internal_resources: '',
|
||||
project_assurance: '',
|
||||
bid_project_overview: '',
|
||||
project_desc: '',
|
||||
annex: '',
|
||||
})
|
||||
|
||||
|
||||
// 表单验证
|
||||
const formRules = reactive<any>({
|
||||
|
||||
})
|
||||
|
||||
|
||||
// 获取详情
|
||||
const setFormData = async (data: Record<any, any>) => {
|
||||
for (const key in formData) {
|
||||
if (data[key] != null && data[key] != undefined) {
|
||||
//@ts-ignore
|
||||
formData[key] = data[key]
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
const getDetail = async (row: Record<string, any>) => {
|
||||
const data = await apiBidBiddingDecisionDetail({
|
||||
id: row.id
|
||||
})
|
||||
setFormData(data)
|
||||
}
|
||||
|
||||
|
||||
// 提交按钮
|
||||
const handleSubmit = async () => {
|
||||
await formRef.value?.validate()
|
||||
const data = { ...formData, }
|
||||
mode.value == 'edit'
|
||||
? await apiBidBiddingDecisionEdit(data)
|
||||
: await apiBidBiddingDecisionAdd(data)
|
||||
popupRef.value?.close()
|
||||
emit('success')
|
||||
}
|
||||
|
||||
//打开弹窗
|
||||
const open = (type = 'add') => {
|
||||
mode.value = type
|
||||
popupRef.value?.open()
|
||||
}
|
||||
|
||||
// 关闭回调
|
||||
const handleClose = () => {
|
||||
emit('close')
|
||||
}
|
||||
|
||||
|
||||
|
||||
defineExpose({
|
||||
open,
|
||||
setFormData,
|
||||
getDetail
|
||||
})
|
||||
</script>
|
153
src/views/bid_bidding_decision/index.vue
Normal file
153
src/views/bid_bidding_decision/index.vue
Normal file
@ -0,0 +1,153 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-card class="!border-none mb-4" shadow="never">
|
||||
<el-form
|
||||
class="mb-[-16px]"
|
||||
:model="queryParams"
|
||||
inline
|
||||
>
|
||||
<el-form-item label="" prop="project_id">
|
||||
<el-input class="w-[280px]" v-model="queryParams.project_id" clearable placeholder="请输入" />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="resetPage">查询</el-button>
|
||||
<el-button @click="resetParams">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
<el-card class="!border-none" v-loading="pager.loading" shadow="never">
|
||||
<el-button v-perms="['bid.bid_bidding_decision/add']" type="primary" @click="handleAdd">
|
||||
<template #icon>
|
||||
<icon name="el-icon-Plus" />
|
||||
</template>
|
||||
新增
|
||||
</el-button>
|
||||
<el-button
|
||||
v-perms="['bid.bid_bidding_decision/delete']"
|
||||
:disabled="!selectData.length"
|
||||
@click="handleDelete(selectData)"
|
||||
>
|
||||
删除
|
||||
</el-button>
|
||||
<div class="mt-4">
|
||||
<el-table :data="pager.lists" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column label="" prop="project_id" show-overflow-tooltip />
|
||||
<el-table-column label="项目估算" prop="project_estimation" show-overflow-tooltip />
|
||||
<el-table-column label="招标项目资金来源" prop="bidding_project_fund_source">
|
||||
<template #default="{ row }">
|
||||
<dict-value :options="dictData.construction_funds_sources" :value="row.bidding_project_fund_source" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="投标时间" prop="bidding_time" show-overflow-tooltip />
|
||||
<el-table-column label="购买标书时间" prop="buy_bid_document_date" show-overflow-tooltip />
|
||||
<el-table-column label="招标方式" prop="bid_type">
|
||||
<template #default="{ row }">
|
||||
<dict-value :options="dictData.bidding_method" :value="row.bid_type" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="竞争对手" prop="competitor" show-overflow-tooltip />
|
||||
<el-table-column label="是否需要保证金" prop="is_margin">
|
||||
<template #default="{ row }">
|
||||
<dict-value :options="dictData.whether_status" :value="row.is_margin" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="保证金金额" prop="margin_amount" show-overflow-tooltip />
|
||||
<el-table-column label="开标日期" prop="bid_opening_date" show-overflow-tooltip />
|
||||
<el-table-column label="保证金退还时间" prop="margin_amount_return_date" show-overflow-tooltip />
|
||||
<el-table-column label="有无内部资源" prop="is_internal_resources">
|
||||
<template #default="{ row }">
|
||||
<dict-value :options="dictData.whether_status" :value="row.is_internal_resources" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="项目把握度" prop="project_assurance" show-overflow-tooltip />
|
||||
<el-table-column label="操作" width="120" fixed="right">
|
||||
<template #default="{ row }">
|
||||
<el-button
|
||||
v-perms="['bid.bid_bidding_decision/edit']"
|
||||
type="primary"
|
||||
link
|
||||
@click="handleEdit(row)"
|
||||
>
|
||||
编辑
|
||||
</el-button>
|
||||
<el-button
|
||||
v-perms="['bid.bid_bidding_decision/delete']"
|
||||
type="danger"
|
||||
link
|
||||
@click="handleDelete(row.id)"
|
||||
>
|
||||
删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
<div class="flex mt-4 justify-end">
|
||||
<pagination v-model="pager" @change="getLists" />
|
||||
</div>
|
||||
</el-card>
|
||||
<edit-popup v-if="showEdit" ref="editRef" :dict-data="dictData" @success="getLists" @close="showEdit = false" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup name="bidBiddingDecisionLists">
|
||||
import { usePaging } from '@/hooks/usePaging'
|
||||
import { useDictData } from '@/hooks/useDictOptions'
|
||||
import { apiBidBiddingDecisionLists, apiBidBiddingDecisionDelete } from '@/api/bid_bidding_decision'
|
||||
import { timeFormat } from '@/utils/util'
|
||||
import feedback from '@/utils/feedback'
|
||||
import EditPopup from './edit.vue'
|
||||
|
||||
const editRef = shallowRef<InstanceType<typeof EditPopup>>()
|
||||
// 是否显示编辑框
|
||||
const showEdit = ref(false)
|
||||
|
||||
|
||||
// 查询条件
|
||||
const queryParams = reactive({
|
||||
project_id: ''
|
||||
})
|
||||
|
||||
// 选中数据
|
||||
const selectData = ref<any[]>([])
|
||||
|
||||
// 表格选择后回调事件
|
||||
const handleSelectionChange = (val: any[]) => {
|
||||
selectData.value = val.map(({ id }) => id)
|
||||
}
|
||||
|
||||
// 获取字典数据
|
||||
const { dictData } = useDictData('construction_funds_sources,bidding_method,whether_status')
|
||||
|
||||
// 分页相关
|
||||
const { pager, getLists, resetParams, resetPage } = usePaging({
|
||||
fetchFun: apiBidBiddingDecisionLists,
|
||||
params: queryParams
|
||||
})
|
||||
|
||||
// 添加
|
||||
const handleAdd = async () => {
|
||||
showEdit.value = true
|
||||
await nextTick()
|
||||
editRef.value?.open('add')
|
||||
}
|
||||
|
||||
// 编辑
|
||||
const handleEdit = async (data: any) => {
|
||||
showEdit.value = true
|
||||
await nextTick()
|
||||
editRef.value?.open('edit')
|
||||
editRef.value?.setFormData(data)
|
||||
}
|
||||
|
||||
// 删除
|
||||
const handleDelete = async (id: number | any[]) => {
|
||||
await feedback.confirm('确定要删除?')
|
||||
await apiBidBiddingDecisionDelete({ id })
|
||||
getLists()
|
||||
}
|
||||
|
||||
getLists()
|
||||
</script>
|
||||
|
209
src/views/bid_buy_bidding_document/edit.vue
Normal file
209
src/views/bid_buy_bidding_document/edit.vue
Normal file
@ -0,0 +1,209 @@
|
||||
<template>
|
||||
<div class="edit-popup">
|
||||
<popup
|
||||
ref="popupRef"
|
||||
:title="popupTitle"
|
||||
:async="true"
|
||||
width="550px"
|
||||
@confirm="handleSubmit"
|
||||
@close="handleClose"
|
||||
>
|
||||
<el-form ref="formRef" :model="formData" label-width="90px" :rules="formRules">
|
||||
<el-form-item label="项目id" prop="project_id">
|
||||
<el-input v-model="formData.project_id" clearable placeholder="请输入项目id" />
|
||||
</el-form-item>
|
||||
<el-form-item label="标书编号" prop="bid_document_no">
|
||||
<el-input v-model="formData.bid_document_no" clearable placeholder="请输入标书编号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="招标公司名称" prop="invite_tenders_company_name">
|
||||
<el-input v-model="formData.invite_tenders_company_name" clearable placeholder="请输入招标公司名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="投标公司名称" prop="bid_company_name">
|
||||
<el-input v-model="formData.bid_company_name" clearable placeholder="请输入投标公司名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="购买人员" prop="buyer">
|
||||
<el-input v-model="formData.buyer" clearable placeholder="请输入购买人员" />
|
||||
</el-form-item>
|
||||
<el-form-item label="购买标书金额" prop="amount">
|
||||
<el-input v-model="formData.amount" clearable placeholder="请输入购买标书金额" />
|
||||
</el-form-item>
|
||||
<el-form-item label="招标项目资金来源" prop="project_fund_source">
|
||||
<el-radio-group v-model="formData.project_fund_source" placeholder="请选择招标项目资金来源">
|
||||
<el-radio
|
||||
v-for="(item, index) in dictData.construction_funds_sources"
|
||||
:key="index"
|
||||
:label="parseInt(item.value)"
|
||||
>
|
||||
{{ item.name }}
|
||||
</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="投标时间" prop="bid_date">
|
||||
<el-date-picker
|
||||
class="flex-1 !flex"
|
||||
v-model="formData.bid_date"
|
||||
clearable
|
||||
type="datetime"
|
||||
value-format="YYYY-MM-DD HH:mm:ss"
|
||||
placeholder="选择投标时间">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="购买标书时间" prop="buy_date">
|
||||
<el-date-picker
|
||||
class="flex-1 !flex"
|
||||
v-model="formData.buy_date"
|
||||
clearable
|
||||
type="datetime"
|
||||
value-format="YYYY-MM-DD HH:mm:ss"
|
||||
placeholder="选择购买标书时间">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="招标方式" prop="invite_tenders_type">
|
||||
<el-checkbox-group v-model="formData.invite_tenders_type" placeholder="请选择招标方式">
|
||||
<el-checkbox
|
||||
v-for="(item, index) in dictData.bidding_method"
|
||||
:key="index"
|
||||
:label="item.value"
|
||||
>
|
||||
{{ item.name }}
|
||||
</el-checkbox>
|
||||
</el-checkbox-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="投标地址" prop="bid_address">
|
||||
<el-input v-model="formData.bid_address" clearable placeholder="请输入投标地址" />
|
||||
</el-form-item>
|
||||
<el-form-item label="是否需要保证金" prop="is_margin">
|
||||
<el-radio-group v-model="formData.is_margin" placeholder="请选择是否需要保证金">
|
||||
<el-radio
|
||||
v-for="(item, index) in dictData.whether_status"
|
||||
:key="index"
|
||||
:label="parseInt(item.value)"
|
||||
>
|
||||
{{ item.name }}
|
||||
</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="保证金金额" prop="margin_amount">
|
||||
<el-input v-model="formData.margin_amount" clearable placeholder="请输入保证金金额" />
|
||||
</el-form-item>
|
||||
<el-form-item label="招标项目慨况" prop="bid_project_overview">
|
||||
<el-input v-model="formData.bid_project_overview" clearable placeholder="请输入招标项目慨况" />
|
||||
</el-form-item>
|
||||
<el-form-item label="项目简介" prop="project_desc">
|
||||
<el-input v-model="formData.project_desc" clearable placeholder="请输入项目简介" />
|
||||
</el-form-item>
|
||||
<el-form-item label="附件" prop="annex">
|
||||
<el-input v-model="formData.annex" clearable placeholder="请输入附件" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</popup>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup name="bidBuyBiddingDocumentEdit">
|
||||
import type { FormInstance } from 'element-plus'
|
||||
import Popup from '@/components/popup/index.vue'
|
||||
import { apiBidBuyBiddingDocumentAdd, apiBidBuyBiddingDocumentEdit, apiBidBuyBiddingDocumentDetail } from '@/api/bid_buy_bidding_document'
|
||||
import { timeFormat } from '@/utils/util'
|
||||
import type { PropType } from 'vue'
|
||||
defineProps({
|
||||
dictData: {
|
||||
type: Object as PropType<Record<string, any[]>>,
|
||||
default: () => ({})
|
||||
}
|
||||
})
|
||||
const emit = defineEmits(['success', 'close'])
|
||||
const formRef = shallowRef<FormInstance>()
|
||||
const popupRef = shallowRef<InstanceType<typeof Popup>>()
|
||||
const mode = ref('add')
|
||||
|
||||
|
||||
// 弹窗标题
|
||||
const popupTitle = computed(() => {
|
||||
return mode.value == 'edit' ? '编辑购买标书' : '新增购买标书'
|
||||
})
|
||||
|
||||
// 表单数据
|
||||
const formData = reactive({
|
||||
id: '',
|
||||
project_id: '',
|
||||
bid_document_no: '',
|
||||
invite_tenders_company_name: '',
|
||||
bid_company_name: '',
|
||||
buyer: '',
|
||||
amount: '',
|
||||
project_fund_source: '',
|
||||
bid_date: '',
|
||||
buy_date: '',
|
||||
invite_tenders_type: [],
|
||||
bid_address: '',
|
||||
is_margin: '',
|
||||
margin_amount: '',
|
||||
bid_project_overview: '',
|
||||
project_desc: '',
|
||||
annex: '',
|
||||
})
|
||||
|
||||
|
||||
// 表单验证
|
||||
const formRules = reactive<any>({
|
||||
|
||||
})
|
||||
|
||||
|
||||
// 获取详情
|
||||
const setFormData = async (data: Record<any, any>) => {
|
||||
for (const key in formData) {
|
||||
if (data[key] != null && data[key] != undefined) {
|
||||
//@ts-ignore
|
||||
formData[key] = data[key]
|
||||
}
|
||||
}
|
||||
//@ts-ignore
|
||||
data.invite_tenders_type && (formData.invite_tenders_type = String(data.invite_tenders_type).split(","))
|
||||
//@ts-ignore
|
||||
formData.bid_date = timeFormat(formData.bid_date,'yyyy-mm-dd hh:MM:ss')
|
||||
//@ts-ignore
|
||||
formData.buy_date = timeFormat(formData.buy_date,'yyyy-mm-dd hh:MM:ss')
|
||||
}
|
||||
|
||||
const getDetail = async (row: Record<string, any>) => {
|
||||
const data = await apiBidBuyBiddingDocumentDetail({
|
||||
id: row.id
|
||||
})
|
||||
setFormData(data)
|
||||
}
|
||||
|
||||
|
||||
// 提交按钮
|
||||
const handleSubmit = async () => {
|
||||
await formRef.value?.validate()
|
||||
const data = { ...formData, invite_tenders_type: formData.invite_tenders_type.join(",") }
|
||||
mode.value == 'edit'
|
||||
? await apiBidBuyBiddingDocumentEdit(data)
|
||||
: await apiBidBuyBiddingDocumentAdd(data)
|
||||
popupRef.value?.close()
|
||||
emit('success')
|
||||
}
|
||||
|
||||
//打开弹窗
|
||||
const open = (type = 'add') => {
|
||||
mode.value = type
|
||||
popupRef.value?.open()
|
||||
}
|
||||
|
||||
// 关闭回调
|
||||
const handleClose = () => {
|
||||
emit('close')
|
||||
}
|
||||
|
||||
|
||||
|
||||
defineExpose({
|
||||
open,
|
||||
setFormData,
|
||||
getDetail
|
||||
})
|
||||
</script>
|
172
src/views/bid_buy_bidding_document/index.vue
Normal file
172
src/views/bid_buy_bidding_document/index.vue
Normal file
@ -0,0 +1,172 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-card class="!border-none mb-4" shadow="never">
|
||||
<el-form
|
||||
class="mb-[-16px]"
|
||||
:model="queryParams"
|
||||
inline
|
||||
>
|
||||
<el-form-item label="项目id" prop="project_id">
|
||||
<el-input class="w-[280px]" v-model="queryParams.project_id" clearable placeholder="请输入项目id" />
|
||||
</el-form-item>
|
||||
<el-form-item label="标书编号" prop="bid_document_no">
|
||||
<el-input class="w-[280px]" v-model="queryParams.bid_document_no" clearable placeholder="请输入标书编号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="招标公司名称" prop="invite_tenders_company_name">
|
||||
<el-input class="w-[280px]" v-model="queryParams.invite_tenders_company_name" clearable placeholder="请输入招标公司名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="投标公司名称" prop="bid_company_name">
|
||||
<el-input class="w-[280px]" v-model="queryParams.bid_company_name" clearable placeholder="请输入投标公司名称" />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="resetPage">查询</el-button>
|
||||
<el-button @click="resetParams">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
<el-card class="!border-none" v-loading="pager.loading" shadow="never">
|
||||
<el-button v-perms="['bid.bid_buy_bidding_document/add']" type="primary" @click="handleAdd">
|
||||
<template #icon>
|
||||
<icon name="el-icon-Plus" />
|
||||
</template>
|
||||
新增
|
||||
</el-button>
|
||||
<el-button
|
||||
v-perms="['bid.bid_buy_bidding_document/delete']"
|
||||
:disabled="!selectData.length"
|
||||
@click="handleDelete(selectData)"
|
||||
>
|
||||
删除
|
||||
</el-button>
|
||||
<div class="mt-4">
|
||||
<el-table :data="pager.lists" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column label="项目id" prop="project_id" show-overflow-tooltip />
|
||||
<el-table-column label="标书编号" prop="bid_document_no" show-overflow-tooltip />
|
||||
<el-table-column label="招标公司名称" prop="invite_tenders_company_name" show-overflow-tooltip />
|
||||
<el-table-column label="投标公司名称" prop="bid_company_name" show-overflow-tooltip />
|
||||
<el-table-column label="购买人员" prop="buyer" show-overflow-tooltip />
|
||||
<el-table-column label="购买标书金额" prop="amount" show-overflow-tooltip />
|
||||
<el-table-column label="招标项目资金来源" prop="project_fund_source">
|
||||
<template #default="{ row }">
|
||||
<dict-value :options="dictData.construction_funds_sources" :value="row.project_fund_source" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="投标时间" prop="bid_date">
|
||||
<template #default="{ row }">
|
||||
<span>{{ row.bid_date ? timeFormat(row.bid_date, 'yyyy-mm-dd hh:MM:ss') : '' }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="购买标书时间" prop="buy_date">
|
||||
<template #default="{ row }">
|
||||
<span>{{ row.buy_date ? timeFormat(row.buy_date, 'yyyy-mm-dd hh:MM:ss') : '' }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="招标方式" prop="invite_tenders_type">
|
||||
<template #default="{ row }">
|
||||
<dict-value :options="dictData.bidding_method" :value="row.invite_tenders_type" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="投标地址" prop="bid_address" show-overflow-tooltip />
|
||||
<el-table-column label="是否需要保证金" prop="is_margin">
|
||||
<template #default="{ row }">
|
||||
<dict-value :options="dictData.whether_status" :value="row.is_margin" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="保证金金额" prop="margin_amount" show-overflow-tooltip />
|
||||
<el-table-column label="招标项目慨况" prop="bid_project_overview" show-overflow-tooltip />
|
||||
<el-table-column label="项目简介" prop="project_desc" show-overflow-tooltip />
|
||||
<el-table-column label="附件" prop="annex" show-overflow-tooltip />
|
||||
<el-table-column label="操作" width="120" fixed="right">
|
||||
<template #default="{ row }">
|
||||
<el-button
|
||||
v-perms="['bid.bid_buy_bidding_document/edit']"
|
||||
type="primary"
|
||||
link
|
||||
@click="handleEdit(row)"
|
||||
>
|
||||
编辑
|
||||
</el-button>
|
||||
<el-button
|
||||
v-perms="['bid.bid_buy_bidding_document/delete']"
|
||||
type="danger"
|
||||
link
|
||||
@click="handleDelete(row.id)"
|
||||
>
|
||||
删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
<div class="flex mt-4 justify-end">
|
||||
<pagination v-model="pager" @change="getLists" />
|
||||
</div>
|
||||
</el-card>
|
||||
<edit-popup v-if="showEdit" ref="editRef" :dict-data="dictData" @success="getLists" @close="showEdit = false" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup name="bidBuyBiddingDocumentLists">
|
||||
import { usePaging } from '@/hooks/usePaging'
|
||||
import { useDictData } from '@/hooks/useDictOptions'
|
||||
import { apiBidBuyBiddingDocumentLists, apiBidBuyBiddingDocumentDelete } from '@/api/bid_buy_bidding_document'
|
||||
import { timeFormat } from '@/utils/util'
|
||||
import feedback from '@/utils/feedback'
|
||||
import EditPopup from './edit.vue'
|
||||
|
||||
const editRef = shallowRef<InstanceType<typeof EditPopup>>()
|
||||
// 是否显示编辑框
|
||||
const showEdit = ref(false)
|
||||
|
||||
|
||||
// 查询条件
|
||||
const queryParams = reactive({
|
||||
project_id: '',
|
||||
bid_document_no: '',
|
||||
invite_tenders_company_name: '',
|
||||
bid_company_name: ''
|
||||
})
|
||||
|
||||
// 选中数据
|
||||
const selectData = ref<any[]>([])
|
||||
|
||||
// 表格选择后回调事件
|
||||
const handleSelectionChange = (val: any[]) => {
|
||||
selectData.value = val.map(({ id }) => id)
|
||||
}
|
||||
|
||||
// 获取字典数据
|
||||
const { dictData } = useDictData('construction_funds_sources,bidding_method,whether_status')
|
||||
|
||||
// 分页相关
|
||||
const { pager, getLists, resetParams, resetPage } = usePaging({
|
||||
fetchFun: apiBidBuyBiddingDocumentLists,
|
||||
params: queryParams
|
||||
})
|
||||
|
||||
// 添加
|
||||
const handleAdd = async () => {
|
||||
showEdit.value = true
|
||||
await nextTick()
|
||||
editRef.value?.open('add')
|
||||
}
|
||||
|
||||
// 编辑
|
||||
const handleEdit = async (data: any) => {
|
||||
showEdit.value = true
|
||||
await nextTick()
|
||||
editRef.value?.open('edit')
|
||||
editRef.value?.setFormData(data)
|
||||
}
|
||||
|
||||
// 删除
|
||||
const handleDelete = async (id: number | any[]) => {
|
||||
await feedback.confirm('确定要删除?')
|
||||
await apiBidBuyBiddingDocumentDelete({ id })
|
||||
getLists()
|
||||
}
|
||||
|
||||
getLists()
|
||||
</script>
|
||||
|
153
src/views/quotation/edit.vue
Normal file
153
src/views/quotation/edit.vue
Normal file
@ -0,0 +1,153 @@
|
||||
<template>
|
||||
<div class="edit-popup">
|
||||
<popup ref="popupRef" :title="popupTitle" :async="true" width="550px" @confirm="handleSubmit" @close="handleClose">
|
||||
<el-form ref="formRef" :model="formData" label-width="90px" :rules="formRules">
|
||||
<el-form-item label="客户id" prop="customer_id">
|
||||
<el-input v-model="formData.customer_id" clearable placeholder="请输入客户id" />
|
||||
</el-form-item>
|
||||
<el-form-item label="报价日期" prop="quotation_date">
|
||||
<el-date-picker class="flex-1 !flex" v-model="formData.quotation_date" clearable type="datetime"
|
||||
value-format="YYYY-MM-DD HH:mm:ss" placeholder="选择报价日期">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="联系人" prop="contacts">
|
||||
<el-input v-model="formData.contacts" clearable placeholder="请输入联系人" />
|
||||
</el-form-item>
|
||||
<el-form-item label="联系电话" prop="contacts_phone">
|
||||
<el-input v-model="formData.contacts_phone" clearable placeholder="请输入联系电话" />
|
||||
</el-form-item>
|
||||
<el-form-item label="制单人" prop="create_user">
|
||||
<el-input v-model="formData.create_user" clearable placeholder="请输入制单人" />
|
||||
</el-form-item>
|
||||
<el-form-item label="发票类型" prop="invoice_type">
|
||||
<el-radio-group v-model="formData.invoice_type" placeholder="请选择发票类型">
|
||||
<el-radio v-for="(item, index) in dictData.invoice_type" :key="index" :label="parseInt(item.value)">
|
||||
{{ item.name }}
|
||||
</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="含税金额" prop="amount_including_tax">
|
||||
<el-input v-model="formData.amount_including_tax" clearable placeholder="请输入含税金额" />
|
||||
</el-form-item>
|
||||
<el-form-item label="运费" prop="freight">
|
||||
<el-input v-model="formData.freight" clearable placeholder="请输入运费" />
|
||||
</el-form-item>
|
||||
<el-form-item label="其他费用" prop="other_fee">
|
||||
<el-input v-model="formData.other_fee" clearable placeholder="请输入其他费用" />
|
||||
</el-form-item>
|
||||
<el-form-item label="合计金额" prop="total_amount">
|
||||
<el-input v-model="formData.total_amount" clearable placeholder="请输入合计金额" />
|
||||
</el-form-item>
|
||||
<el-form-item label="客户需求" prop="customer_require">
|
||||
<el-input v-model="formData.customer_require" clearable placeholder="请输入客户需求" />
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="formData.remark" clearable placeholder="请输入备注" />
|
||||
</el-form-item>
|
||||
<el-form-item label="附件" prop="annex">
|
||||
<el-input v-model="formData.annex" clearable placeholder="请输入附件" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</popup>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup name="quotationEdit">
|
||||
import type { FormInstance } from 'element-plus'
|
||||
import Popup from '@/components/popup/index.vue'
|
||||
import { apiQuotationAdd, apiQuotationEdit, apiQuotationDetail } from '@/api/quotation'
|
||||
import { timeFormat } from '@/utils/util'
|
||||
import type { PropType } from 'vue'
|
||||
defineProps({
|
||||
dictData: {
|
||||
type: Object as PropType<Record<string, any[]>>,
|
||||
default: () => ({})
|
||||
}
|
||||
})
|
||||
const emit = defineEmits(['success', 'close'])
|
||||
const formRef = shallowRef<FormInstance>()
|
||||
const popupRef = shallowRef<InstanceType<typeof Popup>>()
|
||||
const mode = ref('add')
|
||||
|
||||
|
||||
// 弹窗标题
|
||||
const popupTitle = computed(() => {
|
||||
return mode.value == 'edit' ? '编辑报价单' : '新增报价单'
|
||||
})
|
||||
|
||||
// 表单数据
|
||||
const formData = reactive({
|
||||
id: '',
|
||||
customer_id: '',
|
||||
quotation_date: '',
|
||||
contacts: '',
|
||||
contacts_phone: '',
|
||||
create_user: '',
|
||||
invoice_type: '',
|
||||
amount_including_tax: '',
|
||||
freight: '',
|
||||
other_fee: '',
|
||||
total_amount: '',
|
||||
customer_require: '',
|
||||
remark: '',
|
||||
annex: '',
|
||||
})
|
||||
|
||||
|
||||
// 表单验证
|
||||
const formRules = reactive<any>({
|
||||
|
||||
})
|
||||
|
||||
|
||||
// 获取详情
|
||||
const setFormData = async (data: Record<any, any>) => {
|
||||
for (const key in formData) {
|
||||
if (data[key] != null && data[key] != undefined) {
|
||||
//@ts-ignore
|
||||
formData[key] = data[key]
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
const getDetail = async (row: Record<string, any>) => {
|
||||
const data = await apiQuotationDetail({
|
||||
id: row.id
|
||||
})
|
||||
setFormData(data)
|
||||
}
|
||||
|
||||
|
||||
// 提交按钮
|
||||
const handleSubmit = async () => {
|
||||
await formRef.value?.validate()
|
||||
const data = { ...formData, }
|
||||
mode.value == 'edit'
|
||||
? await apiQuotationEdit(data)
|
||||
: await apiQuotationAdd(data)
|
||||
popupRef.value?.close()
|
||||
emit('success')
|
||||
}
|
||||
|
||||
//打开弹窗
|
||||
const open = (type = 'add') => {
|
||||
mode.value = type
|
||||
popupRef.value?.open()
|
||||
}
|
||||
|
||||
// 关闭回调
|
||||
const handleClose = () => {
|
||||
emit('close')
|
||||
}
|
||||
|
||||
|
||||
|
||||
defineExpose({
|
||||
open,
|
||||
setFormData,
|
||||
getDetail
|
||||
})
|
||||
</script>
|
130
src/views/quotation/index.vue
Normal file
130
src/views/quotation/index.vue
Normal file
@ -0,0 +1,130 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-card class="!border-none mb-4" shadow="never">
|
||||
<el-form class="mb-[-16px]" :model="queryParams" inline>
|
||||
<el-form-item label="客户id" prop="customer_id">
|
||||
<el-input class="w-[280px]" v-model="queryParams.customer_id" clearable placeholder="请输入客户id" />
|
||||
</el-form-item>
|
||||
<el-form-item label="联系人" prop="contacts">
|
||||
<el-input class="w-[280px]" v-model="queryParams.contacts" clearable placeholder="请输入联系人" />
|
||||
</el-form-item>
|
||||
<el-form-item label="制单人" prop="create_user">
|
||||
<el-input class="w-[280px]" v-model="queryParams.create_user" clearable placeholder="请输入制单人" />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="resetPage">查询</el-button>
|
||||
<el-button @click="resetParams">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
<el-card class="!border-none" v-loading="pager.loading" shadow="never">
|
||||
<el-button v-perms="['quotation.quotation/add']" type="primary" @click="handleAdd">
|
||||
<template #icon>
|
||||
<icon name="el-icon-Plus" />
|
||||
</template>
|
||||
新增
|
||||
</el-button>
|
||||
<el-button v-perms="['quotation.quotation/delete']" :disabled="!selectData.length"
|
||||
@click="handleDelete(selectData)">
|
||||
删除
|
||||
</el-button>
|
||||
<div class="mt-4">
|
||||
<el-table :data="pager.lists" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column label="客户id" prop="customer_id" show-overflow-tooltip />
|
||||
<el-table-column label="报价日期" prop="quotation_date" show-overflow-tooltip />
|
||||
<el-table-column label="联系人" prop="contacts" show-overflow-tooltip />
|
||||
<el-table-column label="联系电话" prop="contacts_phone" show-overflow-tooltip />
|
||||
<el-table-column label="制单人" prop="create_user" show-overflow-tooltip />
|
||||
<el-table-column label="发票类型" prop="invoice_type">
|
||||
<template #default="{ row }">
|
||||
<dict-value :options="dictData.invoice_type" :value="row.invoice_type" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="含税金额" prop="amount_including_tax" show-overflow-tooltip />
|
||||
<el-table-column label="运费" prop="freight" show-overflow-tooltip />
|
||||
<el-table-column label="其他费用" prop="other_fee" show-overflow-tooltip />
|
||||
<el-table-column label="合计金额" prop="total_amount" show-overflow-tooltip />
|
||||
<el-table-column label="操作" width="120" fixed="right">
|
||||
<template #default="{ row }">
|
||||
<el-button v-perms="['quotation.quotation/edit']" type="primary" link @click="handleEdit(row)">
|
||||
编辑
|
||||
</el-button>
|
||||
<el-button v-perms="['quotation.quotation/delete']" type="danger" link
|
||||
@click="handleDelete(row.id)">
|
||||
删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
<div class="flex mt-4 justify-end">
|
||||
<pagination v-model="pager" @change="getLists" />
|
||||
</div>
|
||||
</el-card>
|
||||
<edit-popup v-if="showEdit" ref="editRef" :dict-data="dictData" @success="getLists" @close="showEdit = false" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup name="quotationLists">
|
||||
import { usePaging } from '@/hooks/usePaging'
|
||||
import { useDictData } from '@/hooks/useDictOptions'
|
||||
import { apiQuotationLists, apiQuotationDelete } from '@/api/quotation'
|
||||
import { timeFormat } from '@/utils/util'
|
||||
import feedback from '@/utils/feedback'
|
||||
import EditPopup from './edit.vue'
|
||||
|
||||
const editRef = shallowRef<InstanceType<typeof EditPopup>>()
|
||||
// 是否显示编辑框
|
||||
const showEdit = ref(false)
|
||||
|
||||
|
||||
// 查询条件
|
||||
const queryParams = reactive({
|
||||
customer_id: '',
|
||||
contacts: '',
|
||||
create_user: ''
|
||||
})
|
||||
|
||||
// 选中数据
|
||||
const selectData = ref<any[]>([])
|
||||
|
||||
// 表格选择后回调事件
|
||||
const handleSelectionChange = (val: any[]) => {
|
||||
selectData.value = val.map(({ id }) => id)
|
||||
}
|
||||
|
||||
// 获取字典数据
|
||||
const { dictData } = useDictData('invoice_type')
|
||||
|
||||
// 分页相关
|
||||
const { pager, getLists, resetParams, resetPage } = usePaging({
|
||||
fetchFun: apiQuotationLists,
|
||||
params: queryParams
|
||||
})
|
||||
|
||||
// 添加
|
||||
const handleAdd = async () => {
|
||||
showEdit.value = true
|
||||
await nextTick()
|
||||
editRef.value?.open('add')
|
||||
}
|
||||
|
||||
// 编辑
|
||||
const handleEdit = async (data: any) => {
|
||||
showEdit.value = true
|
||||
await nextTick()
|
||||
editRef.value?.open('edit')
|
||||
editRef.value?.setFormData(data)
|
||||
}
|
||||
|
||||
// 删除
|
||||
const handleDelete = async (id: number | any[]) => {
|
||||
await feedback.confirm('确定要删除?')
|
||||
await apiQuotationDelete({ id })
|
||||
getLists()
|
||||
}
|
||||
|
||||
getLists()
|
||||
</script>
|
||||
|
128
src/views/quotation_detail/edit.vue
Normal file
128
src/views/quotation_detail/edit.vue
Normal file
@ -0,0 +1,128 @@
|
||||
<template>
|
||||
<div class="edit-popup">
|
||||
<popup
|
||||
ref="popupRef"
|
||||
:title="popupTitle"
|
||||
:async="true"
|
||||
width="550px"
|
||||
@confirm="handleSubmit"
|
||||
@close="handleClose"
|
||||
>
|
||||
<el-form ref="formRef" :model="formData" label-width="90px" :rules="formRules">
|
||||
<el-form-item label="报价单id" prop="quotation_id">
|
||||
<el-input v-model="formData.quotation_id" clearable placeholder="请输入报价单id" />
|
||||
</el-form-item>
|
||||
<el-form-item label="产品id" prop="product_id">
|
||||
<el-input v-model="formData.product_id" clearable placeholder="请输入产品id" />
|
||||
</el-form-item>
|
||||
<el-form-item label="产品数量" prop="product_num">
|
||||
<el-input v-model="formData.product_num" clearable placeholder="请输入产品数量" />
|
||||
</el-form-item>
|
||||
<el-form-item label="税率" prop="tax_rate">
|
||||
<el-select class="flex-1" v-model="formData.tax_rate" clearable placeholder="请选择税率">
|
||||
<el-option
|
||||
v-for="(item, index) in dictData.tax_rate"
|
||||
:key="index"
|
||||
:label="item.name"
|
||||
:value="parseInt(item.value)"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="formData.remark" clearable placeholder="请输入备注" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</popup>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup name="quotationDetailEdit">
|
||||
import type { FormInstance } from 'element-plus'
|
||||
import Popup from '@/components/popup/index.vue'
|
||||
import { apiQuotationDetailAdd, apiQuotationDetailEdit, apiQuotationDetailDetail } from '@/api/quotation_detail'
|
||||
import { timeFormat } from '@/utils/util'
|
||||
import type { PropType } from 'vue'
|
||||
defineProps({
|
||||
dictData: {
|
||||
type: Object as PropType<Record<string, any[]>>,
|
||||
default: () => ({})
|
||||
}
|
||||
})
|
||||
const emit = defineEmits(['success', 'close'])
|
||||
const formRef = shallowRef<FormInstance>()
|
||||
const popupRef = shallowRef<InstanceType<typeof Popup>>()
|
||||
const mode = ref('add')
|
||||
|
||||
|
||||
// 弹窗标题
|
||||
const popupTitle = computed(() => {
|
||||
return mode.value == 'edit' ? '编辑报价明细' : '新增报价明细'
|
||||
})
|
||||
|
||||
// 表单数据
|
||||
const formData = reactive({
|
||||
id: '',
|
||||
quotation_id: '',
|
||||
product_id: '',
|
||||
product_num: '',
|
||||
tax_rate: '',
|
||||
remark: '',
|
||||
})
|
||||
|
||||
|
||||
// 表单验证
|
||||
const formRules = reactive<any>({
|
||||
|
||||
})
|
||||
|
||||
|
||||
// 获取详情
|
||||
const setFormData = async (data: Record<any, any>) => {
|
||||
for (const key in formData) {
|
||||
if (data[key] != null && data[key] != undefined) {
|
||||
//@ts-ignore
|
||||
formData[key] = data[key]
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
const getDetail = async (row: Record<string, any>) => {
|
||||
const data = await apiQuotationDetailDetail({
|
||||
id: row.id
|
||||
})
|
||||
setFormData(data)
|
||||
}
|
||||
|
||||
|
||||
// 提交按钮
|
||||
const handleSubmit = async () => {
|
||||
await formRef.value?.validate()
|
||||
const data = { ...formData, }
|
||||
mode.value == 'edit'
|
||||
? await apiQuotationDetailEdit(data)
|
||||
: await apiQuotationDetailAdd(data)
|
||||
popupRef.value?.close()
|
||||
emit('success')
|
||||
}
|
||||
|
||||
//打开弹窗
|
||||
const open = (type = 'add') => {
|
||||
mode.value = type
|
||||
popupRef.value?.open()
|
||||
}
|
||||
|
||||
// 关闭回调
|
||||
const handleClose = () => {
|
||||
emit('close')
|
||||
}
|
||||
|
||||
|
||||
|
||||
defineExpose({
|
||||
open,
|
||||
setFormData,
|
||||
getDetail
|
||||
})
|
||||
</script>
|
153
src/views/quotation_detail/index.vue
Normal file
153
src/views/quotation_detail/index.vue
Normal file
@ -0,0 +1,153 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-card class="!border-none mb-4" shadow="never">
|
||||
<el-form
|
||||
class="mb-[-16px]"
|
||||
:model="queryParams"
|
||||
inline
|
||||
>
|
||||
<el-form-item label="报价单id" prop="quotation_id">
|
||||
<el-input class="w-[280px]" v-model="queryParams.quotation_id" clearable placeholder="请输入报价单id" />
|
||||
</el-form-item>
|
||||
<el-form-item label="产品id" prop="product_id">
|
||||
<el-input class="w-[280px]" v-model="queryParams.product_id" clearable placeholder="请输入产品id" />
|
||||
</el-form-item>
|
||||
<el-form-item label="产品数量" prop="product_num">
|
||||
<el-input class="w-[280px]" v-model="queryParams.product_num" clearable placeholder="请输入产品数量" />
|
||||
</el-form-item>
|
||||
<el-form-item label="税率" prop="tax_rate">
|
||||
<el-select class="w-[280px]" v-model="queryParams.tax_rate" clearable placeholder="请选择税率">
|
||||
<el-option label="全部" value=""></el-option>
|
||||
<el-option
|
||||
v-for="(item, index) in dictData.tax_rate"
|
||||
:key="index"
|
||||
:label="item.name"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="resetPage">查询</el-button>
|
||||
<el-button @click="resetParams">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
<el-card class="!border-none" v-loading="pager.loading" shadow="never">
|
||||
<el-button v-perms="['quotation.quotation_detail/add']" type="primary" @click="handleAdd">
|
||||
<template #icon>
|
||||
<icon name="el-icon-Plus" />
|
||||
</template>
|
||||
新增
|
||||
</el-button>
|
||||
<el-button
|
||||
v-perms="['quotation.quotation_detail/delete']"
|
||||
:disabled="!selectData.length"
|
||||
@click="handleDelete(selectData)"
|
||||
>
|
||||
删除
|
||||
</el-button>
|
||||
<div class="mt-4">
|
||||
<el-table :data="pager.lists" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column label="报价单id" prop="quotation_id" show-overflow-tooltip />
|
||||
<el-table-column label="产品id" prop="product_id" show-overflow-tooltip />
|
||||
<el-table-column label="产品数量" prop="product_num" show-overflow-tooltip />
|
||||
<el-table-column label="税率" prop="tax_rate">
|
||||
<template #default="{ row }">
|
||||
<dict-value :options="dictData.tax_rate" :value="row.tax_rate" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="备注" prop="remark" show-overflow-tooltip />
|
||||
<el-table-column label="操作" width="120" fixed="right">
|
||||
<template #default="{ row }">
|
||||
<el-button
|
||||
v-perms="['quotation.quotation_detail/edit']"
|
||||
type="primary"
|
||||
link
|
||||
@click="handleEdit(row)"
|
||||
>
|
||||
编辑
|
||||
</el-button>
|
||||
<el-button
|
||||
v-perms="['quotation.quotation_detail/delete']"
|
||||
type="danger"
|
||||
link
|
||||
@click="handleDelete(row.id)"
|
||||
>
|
||||
删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
<div class="flex mt-4 justify-end">
|
||||
<pagination v-model="pager" @change="getLists" />
|
||||
</div>
|
||||
</el-card>
|
||||
<edit-popup v-if="showEdit" ref="editRef" :dict-data="dictData" @success="getLists" @close="showEdit = false" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup name="quotationDetailLists">
|
||||
import { usePaging } from '@/hooks/usePaging'
|
||||
import { useDictData } from '@/hooks/useDictOptions'
|
||||
import { apiQuotationDetailLists, apiQuotationDetailDelete } from '@/api/quotation_detail'
|
||||
import { timeFormat } from '@/utils/util'
|
||||
import feedback from '@/utils/feedback'
|
||||
import EditPopup from './edit.vue'
|
||||
|
||||
const editRef = shallowRef<InstanceType<typeof EditPopup>>()
|
||||
// 是否显示编辑框
|
||||
const showEdit = ref(false)
|
||||
|
||||
|
||||
// 查询条件
|
||||
const queryParams = reactive({
|
||||
quotation_id: '',
|
||||
product_id: '',
|
||||
product_num: '',
|
||||
tax_rate: ''
|
||||
})
|
||||
|
||||
// 选中数据
|
||||
const selectData = ref<any[]>([])
|
||||
|
||||
// 表格选择后回调事件
|
||||
const handleSelectionChange = (val: any[]) => {
|
||||
selectData.value = val.map(({ id }) => id)
|
||||
}
|
||||
|
||||
// 获取字典数据
|
||||
const { dictData } = useDictData('tax_rate')
|
||||
|
||||
// 分页相关
|
||||
const { pager, getLists, resetParams, resetPage } = usePaging({
|
||||
fetchFun: apiQuotationDetailLists,
|
||||
params: queryParams
|
||||
})
|
||||
|
||||
// 添加
|
||||
const handleAdd = async () => {
|
||||
showEdit.value = true
|
||||
await nextTick()
|
||||
editRef.value?.open('add')
|
||||
}
|
||||
|
||||
// 编辑
|
||||
const handleEdit = async (data: any) => {
|
||||
showEdit.value = true
|
||||
await nextTick()
|
||||
editRef.value?.open('edit')
|
||||
editRef.value?.setFormData(data)
|
||||
}
|
||||
|
||||
// 删除
|
||||
const handleDelete = async (id: number | any[]) => {
|
||||
await feedback.confirm('确定要删除?')
|
||||
await apiQuotationDetailDelete({ id })
|
||||
getLists()
|
||||
}
|
||||
|
||||
getLists()
|
||||
</script>
|
||||
|
Loading…
x
Reference in New Issue
Block a user