feat 初始化表格管理
This commit is contained in:
parent
4d06f35765
commit
a453919826
46
src/api/business/TableDataManage/TableDatas/tabledata.js
Normal file
46
src/api/business/TableDataManage/TableDatas/tabledata.js
Normal file
@ -0,0 +1,46 @@
|
|||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Descripttion: 表格数据Api接口
|
||||||
|
* @version: (1.0)
|
||||||
|
* @Author: (lwh)
|
||||||
|
* @Date: (2023-11-22)
|
||||||
|
* @LastEditors: (lwh)
|
||||||
|
* @LastEditTime: (2023-11-22)
|
||||||
|
*/
|
||||||
|
|
||||||
|
// 表格数据分页查询列表
|
||||||
|
export function tableDataList(query) {
|
||||||
|
return request({
|
||||||
|
url: '/business/TableData/getTableDataList',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 表格数据新增或修改
|
||||||
|
export function addOrUpdateTableData(data) {
|
||||||
|
return request({
|
||||||
|
url: '/business/TableData/addOrUpdateTableData',
|
||||||
|
method: 'post',
|
||||||
|
data: data,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 表格数据删除
|
||||||
|
export function delTableData(ids) {
|
||||||
|
return request({
|
||||||
|
url: '/business/TableData/'+ ids,
|
||||||
|
method: 'delete'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 表格数据导出
|
||||||
|
export function exportTableData(query) {
|
||||||
|
return request({
|
||||||
|
url: 'business/TableData/exportTableData',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,291 @@
|
|||||||
|
<!--
|
||||||
|
* @Descripttion: (表格数据/tb_table_data 添加弹窗)
|
||||||
|
* @version: (1.0)
|
||||||
|
* @Author: (lwh)
|
||||||
|
* @Date: (2023-11-22)
|
||||||
|
* @LastEditors: (lwh)
|
||||||
|
* @LastEditTime: (2023-11-22)
|
||||||
|
-->
|
||||||
|
<template>
|
||||||
|
<el-dialog v-model="props.modelValue" title="添加表格数据信息" width="900px" @closed="closeDialog" @open="openDialog">
|
||||||
|
<el-form ref="formRef" :model="formData" :rules="rules">
|
||||||
|
|
||||||
|
<div class="title">基本信息</div>
|
||||||
|
<el-row :gutter="20">
|
||||||
|
|
||||||
|
<el-col :lg="12">
|
||||||
|
<el-form-item :label-width="labelWidth" label="涉及产品" prop="productsInvolvedGuid">
|
||||||
|
<el-select v-model="formData.productsInvolvedGuid" multiple placeholder="请选择涉及产品">
|
||||||
|
<el-option v-for="item in dataList " :key="item.productsInvolvedGuid" :label="item.productsInvolvedName"
|
||||||
|
:value="item.productsInvolvedGuid"></el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
<el-col :lg="24">
|
||||||
|
<el-form-item :label-width="labelWidth" label="采购内容" prop="tableDataProcurementContent">
|
||||||
|
<el-input v-model="formData.tableDataProcurementContent" placeholder="请输入采购内容" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :lg="24">
|
||||||
|
<el-form-item :label-width="labelWidth" label="采购单位名称" prop="tableDataProcurementUnit">
|
||||||
|
<el-input v-model="formData.tableDataProcurementUnit" placeholder="请输入采购单位名称" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :lg="24">
|
||||||
|
<el-form-item :label-width="labelWidth" label="采购方式" prop="tableDataProcurementMethod">
|
||||||
|
<el-input v-model="formData.tableDataProcurementMethod" placeholder="请输入采购方式" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :lg="24">
|
||||||
|
<el-form-item :label-width="labelWidth" label="单一来源理由" prop="tableDataSingleSource">
|
||||||
|
<el-input v-model="formData.tableDataSingleSource" placeholder="请输入单一来源理由(如有)" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :lg="24">
|
||||||
|
<el-form-item :label-width="labelWidth" label="供应商名称" prop="tableDataSupplierName">
|
||||||
|
<el-input v-model="formData.tableDataSupplierName" placeholder="请输入供应商名称" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :lg="12">
|
||||||
|
<el-form-item :label-width="labelWidth" label="供应商报价" prop="tableDataSupplierOffer">
|
||||||
|
<el-input-number v-model.number="formData.tableDataSupplierOffer" controls-position="right" :min="0"
|
||||||
|
:precision="2" :step="0.1" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :lg="24">
|
||||||
|
<el-form-item :label-width="labelWidth" label="项目计价形式" prop="tableDataProjectPricingForm">
|
||||||
|
<el-input v-model="formData.tableDataProjectPricingForm" placeholder="请输入项目计价形式" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :lg="24">
|
||||||
|
<el-form-item :label-width="labelWidth" label="链接" prop="tableDataLink">
|
||||||
|
<el-input v-model="formData.tableDataLink" placeholder="请输入链接" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :lg="12">
|
||||||
|
<el-form-item :label-width="labelWidth" label="日期" prop="tableDataDate">
|
||||||
|
<el-date-picker v-model="formData.tableDataDate" type="datetime" :teleported="false"
|
||||||
|
placeholder="选择日期时间"></el-date-picker>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :lg="12">
|
||||||
|
<el-form-item :label-width="labelWidth" label="截止日期" prop="tableDataDeadline">
|
||||||
|
<el-date-picker v-model="formData.tableDataDeadline" type="datetime" :teleported="false"
|
||||||
|
placeholder="选择日期时间"></el-date-picker>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :lg="12">
|
||||||
|
<el-form-item :label-width="labelWidth + 140" label="是否为中标公告" prop="tableDataIsBidAnnouncement">
|
||||||
|
<el-select v-model="formData.tableDataIsBidAnnouncement" placeholder="请选择">
|
||||||
|
<el-option v-for="item in is_bid_announcement " :key="item.dictValue" :label="item.dictLabel"
|
||||||
|
:value="parseInt(item.dictValue)"></el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :lg="24">
|
||||||
|
<el-form-item :label-width="labelWidth + 140" label="是否是人力资源池或框架协议"
|
||||||
|
prop="tableDataIsHumanResourcePoolOrFrameworkAgreement">
|
||||||
|
<el-select v-model="formData.tableDataIsHumanResourcePoolOrFrameworkAgreement" placeholder="请选择">
|
||||||
|
<el-option v-for="item in is_human_resource_pool_or_framework_agreement " :key="item.dictValue"
|
||||||
|
:label="item.dictLabel" :value="parseInt(item.dictValue)"></el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :lg="24">
|
||||||
|
<el-form-item :label-width="labelWidth + 140" label="公告中是否包含多个包/标段/采购内容" prop="tableDataIsMultiple">
|
||||||
|
<el-select v-model="formData.tableDataIsMultiple" placeholder="请选择">
|
||||||
|
<el-option v-for="item in is_multiple " :key="item.dictValue" :label="item.dictLabel"
|
||||||
|
:value="parseInt(item.dictValue)"></el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :lg="12">
|
||||||
|
<el-form-item :label-width="labelWidth + 140" label="是否仅有一个中标人" prop="tableDataIsOnlyBidder">
|
||||||
|
<el-select v-model="formData.tableDataIsOnlyBidder" placeholder="请选择">
|
||||||
|
<el-option v-for="item in is_only_bidder " :key="item.dictValue" :label="item.dictLabel"
|
||||||
|
:value="parseInt(item.dictValue)"></el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :lg="24">
|
||||||
|
<el-form-item :label-width="labelWidth" label="详情" prop="tableDataDetails">
|
||||||
|
<editor v-model="formData.tableDataDetails" :min-height="200" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :lg="12">
|
||||||
|
<el-form-item :label-width="labelWidth" label="排序" prop="tableDataSort">
|
||||||
|
<el-input-number v-model.number="formData.tableDataSort" controls-position="right" :min="0" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="title">中标信息</div>
|
||||||
|
<el-row>
|
||||||
|
<el-col :lg="12">
|
||||||
|
<el-form-item :label-width="labelWidth" label="中标人或候选人" prop="tableDataWinningBidde">
|
||||||
|
<el-input v-model="formData.tableDataWinningBidde" placeholder="请输入中标人或候选人" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :lg="12">
|
||||||
|
<el-form-item :label-width="labelWidth" label="中标金额" prop="tableDataBidWinningPrice">
|
||||||
|
<el-input-number v-model.number="formData.tableDataBidWinningPrice" controls-position="right" :min="0" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
</el-row>
|
||||||
|
</el-form>
|
||||||
|
|
||||||
|
<template #footer>
|
||||||
|
<div key="dialog-footer">
|
||||||
|
<el-button type="primary" @click="handleAddClick(formRef)" :loading="loadingStatus">添加</el-button>
|
||||||
|
<el-button @click="handleResetClick(formRef)">重置</el-button>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</el-dialog>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
import { reactive, ref, watch } from "vue";
|
||||||
|
import { ElMessage } from 'element-plus'
|
||||||
|
import modal from '@/plugins/modal.js'
|
||||||
|
import { addOrUpdateTableData } from '@/api/business/TableDataManage/TableDatas/tableData.js';
|
||||||
|
import { productsInvolvedList } from '@/api/business/ProductsInvolveds/productsInvolved.js'
|
||||||
|
|
||||||
|
|
||||||
|
// 打开弹窗时回调
|
||||||
|
const openDialog = async () => {
|
||||||
|
await getproductsInvolvedList()
|
||||||
|
await getis_bid_announcement()
|
||||||
|
await getis_human_resource_pool_or_framework_agreement()
|
||||||
|
await getis_multiple()
|
||||||
|
await getis_only_bidder()
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// -业务参数
|
||||||
|
// 是否为中标公告字典选项列表
|
||||||
|
const is_bid_announcement = ref([]);
|
||||||
|
// 是否是人力资源池或框架协议字典选项列表
|
||||||
|
const is_human_resource_pool_or_framework_agreement = ref([]);
|
||||||
|
// 公告中是否包含多个包/标段/采购内容字典选项列表
|
||||||
|
const is_multiple = ref([]);
|
||||||
|
// 是否仅有一个中标人字典选项列表
|
||||||
|
const is_only_bidder = ref([]);
|
||||||
|
// 涉及产品列表
|
||||||
|
const dataList = ref([]);
|
||||||
|
|
||||||
|
const queryParams = {
|
||||||
|
pageNum: 1,
|
||||||
|
pageSize: 10000
|
||||||
|
}
|
||||||
|
|
||||||
|
// -业务方法
|
||||||
|
// 字典获取
|
||||||
|
async function getis_bid_announcement() {
|
||||||
|
await proxy.getDicts('is_bid_announcement').then((res) => {
|
||||||
|
is_bid_announcement.value = res.data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 字典获取
|
||||||
|
async function getis_human_resource_pool_or_framework_agreement() {
|
||||||
|
await proxy.getDicts('is_human_resource_pool_or_framework_agreement').then((res) => {
|
||||||
|
is_human_resource_pool_or_framework_agreement.value = res.data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 字典获取
|
||||||
|
async function getis_multiple() {
|
||||||
|
await proxy.getDicts('is_multiple').then((res) => {
|
||||||
|
is_multiple.value = res.data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 字典获取
|
||||||
|
async function getis_only_bidder() {
|
||||||
|
await proxy.getDicts('is_only_bidder').then((res) => {
|
||||||
|
is_only_bidder.value = res.data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
async function getproductsInvolvedList() {
|
||||||
|
productsInvolvedList(queryParams).then((res) => {
|
||||||
|
if (res.code == 200) {
|
||||||
|
dataList.value = res.data.result;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// -基础参数
|
||||||
|
const loadingStatus = ref(false)
|
||||||
|
const labelWidth = 120;
|
||||||
|
const formRef = ref();
|
||||||
|
const { proxy } = getCurrentInstance()
|
||||||
|
const emits = defineEmits(["update:modelValue"]);
|
||||||
|
const formData = reactive({
|
||||||
|
tableDataSort: 100,
|
||||||
|
tableDataSupplierOffer: 0.00
|
||||||
|
});
|
||||||
|
const props = defineProps({
|
||||||
|
modelValue: Boolean,
|
||||||
|
done: Function,
|
||||||
|
});
|
||||||
|
const imgData = ref({
|
||||||
|
fileDir: "TableData"
|
||||||
|
})
|
||||||
|
|
||||||
|
// 验证
|
||||||
|
const rules = reactive({
|
||||||
|
tableDataGuid: [{ required: true, message: "不能为空", trigger: "blur", type: "number" }],
|
||||||
|
tableDataProcurementContent: [{ required: true, message: "采购内容不能为空", trigger: "blur" }],
|
||||||
|
tableDataProcurementUnit: [{ required: true, message: "采购单位名称不能为空", trigger: "blur" }],
|
||||||
|
tableDataDate: [{ required: true, message: "日期不能为空", trigger: "blur" }],
|
||||||
|
tableDataIsBidAnnouncement: [{ required: true, message: "是否为中标公告不能为空", trigger: "change", type: "number" }],
|
||||||
|
tableDataIsHumanResourcePoolOrFrameworkAgreement: [{ required: true, message: "是否是人力资源池或框架协议不能为空", trigger: "change", type: "number" }],
|
||||||
|
tableDataIsMultiple: [{ required: true, message: "公告中是否包含多个包/标段/采购内容不能为空", trigger: "change", type: "number" }],
|
||||||
|
tableDataIsOnlyBidder: [{ required: true, message: "是否仅有一个中标人不能为空", trigger: "change", type: "number" }],
|
||||||
|
tableDataSort: [{ required: true, message: "排序不能为空", trigger: "blur", type: "number" }],
|
||||||
|
});
|
||||||
|
|
||||||
|
// -基础方法
|
||||||
|
|
||||||
|
// 提交
|
||||||
|
const handleAddClick = async (formEl) => {
|
||||||
|
formData.productsInvolvedGuid = formData.productsInvolvedGuid.join(',')
|
||||||
|
console.log(formData, 'aaaaaaaaaaa');
|
||||||
|
if (!formEl) return;
|
||||||
|
formEl.validate(async (valid) => {
|
||||||
|
if (!valid) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
loadingStatus.value = true
|
||||||
|
|
||||||
|
|
||||||
|
const { code } = await addOrUpdateTableData(formData);
|
||||||
|
if (code == 200) {
|
||||||
|
modal.msgSuccess('添加成功')
|
||||||
|
closeDialog();
|
||||||
|
loadingStatus.value = false
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
const closeDialog = () => {
|
||||||
|
handleResetClick(formRef.value);
|
||||||
|
props.done();
|
||||||
|
emits("update:modelValue", false);
|
||||||
|
};
|
||||||
|
const handleResetClick = async (formEl) => {
|
||||||
|
if (!formEl) return;
|
||||||
|
formEl.resetFields();
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
.title {
|
||||||
|
margin-left: 20px;
|
||||||
|
margin-bottom: 20px;
|
||||||
|
font-size: 25px;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
</style>
|
@ -0,0 +1,221 @@
|
|||||||
|
<!--
|
||||||
|
* @Descripttion: (表格数据/tb_table_data 详情弹窗)
|
||||||
|
* @version: (1.0)
|
||||||
|
* @Author: (lwh)
|
||||||
|
* @Date: (2023-11-22)
|
||||||
|
* @LastEditors: (lwh)
|
||||||
|
* @LastEditTime: (2023-11-22)
|
||||||
|
-->
|
||||||
|
<template>
|
||||||
|
<el-dialog v-model="props.modelValue" title="表格数据信息详情" width="900px" @closed="closeDialog" @open="openDialog">
|
||||||
|
<el-form ref="formRef" :model="formData" :disabled="true">
|
||||||
|
|
||||||
|
<el-row :gutter="20">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<el-col :lg="12">
|
||||||
|
<el-form-item :label-width="labelWidth" label="采购内容" >
|
||||||
|
<el-input v-model="formData.tableDataProcurementContent" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
<el-col :lg="12">
|
||||||
|
<el-form-item :label-width="labelWidth" label="采购单位名称" >
|
||||||
|
<el-input v-model="formData.tableDataProcurementUnit" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
<el-col :lg="12">
|
||||||
|
<el-form-item :label-width="labelWidth" label="采购方式" >
|
||||||
|
<el-input v-model="formData.tableDataProcurementMethod" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
<el-col :lg="12">
|
||||||
|
<el-form-item :label-width="labelWidth" label="供应商名称" >
|
||||||
|
<el-input v-model="formData.tableDataSupplierName" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
<el-col :lg="12">
|
||||||
|
<el-form-item :label-width="labelWidth" label="供应商的对应报价" >
|
||||||
|
<el-input-number v-model.number="formData.tableDataSupplierOffer" controls-position="right" :precision="2" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
<el-col :lg="12">
|
||||||
|
<el-form-item :label-width="labelWidth" label="项目计价形式" >
|
||||||
|
<el-input v-model="formData.tableDataProjectPricingForm" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
<el-col :lg="12">
|
||||||
|
<el-form-item :label-width="labelWidth" label="链接" >
|
||||||
|
<el-input v-model="formData.tableDataLink" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
<el-col :lg="12">
|
||||||
|
<el-form-item :label-width="labelWidth" label="日期" >
|
||||||
|
<el-date-picker v-model="formData.tableDataDate" type="datetime" :teleported="false" isabledStr}></el-date-picker>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
<el-col :lg="12">
|
||||||
|
<el-form-item :label-width="labelWidth" label="截止日期" >
|
||||||
|
<el-date-picker v-model="formData.tableDataDeadline" type="datetime" :teleported="false" isabledStr}></el-date-picker>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
<el-col :lg="12">
|
||||||
|
<el-form-item :label-width="labelWidth" label="中标人或候选人" >
|
||||||
|
<el-input v-model="formData.tableDataWinningBidde" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
<el-col :lg="12">
|
||||||
|
<el-form-item :label-width="labelWidth" label="中标金额" >
|
||||||
|
<el-input-number v-model.number="formData.tableDataBidWinningPrice" controls-position="right" :precision="2" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
<el-col :lg="12">
|
||||||
|
<el-form-item :label-width="labelWidth" label="是否为中标公告" >
|
||||||
|
<el-select v-model="formData.tableDataIsBidAnnouncement" >
|
||||||
|
<el-option v-for="item in is_bid_announcement " :key="item.dictValue" :label="item.dictLabel" :value="parseInt(item.dictValue)"></el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
<el-col :lg="12">
|
||||||
|
<el-form-item :label-width="labelWidth" label="是否是人力资源池或框架协议" >
|
||||||
|
<el-select v-model="formData.tableDataIsHumanResourcePoolOrFrameworkAgreement" >
|
||||||
|
<el-option v-for="item in is_human_resource_pool_or_framework_agreement " :key="item.dictValue" :label="item.dictLabel" :value="parseInt(item.dictValue)"></el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
<el-col :lg="12">
|
||||||
|
<el-form-item :label-width="labelWidth" label="公告中是否包含多个包/标段/采购内容" >
|
||||||
|
<el-select v-model="formData.tableDataIsMultiple" >
|
||||||
|
<el-option v-for="item in is_multiple " :key="item.dictValue" :label="item.dictLabel" :value="parseInt(item.dictValue)"></el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
<el-col :lg="12">
|
||||||
|
<el-form-item :label-width="labelWidth" label="是否仅有一个中标人" >
|
||||||
|
<el-select v-model="formData.tableDataIsOnlyBidder" >
|
||||||
|
<el-option v-for="item in is_only_bidder " :key="item.dictValue" :label="item.dictLabel" :value="parseInt(item.dictValue)"></el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
<el-col :lg="12">
|
||||||
|
<el-form-item :label-width="labelWidth" label="单一来源理由(如有)" >
|
||||||
|
<el-input v-model="formData.tableDataSingleSource" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
<el-col :lg="24">
|
||||||
|
<el-form-item :label-width="labelWidth" label="详情" >
|
||||||
|
<editor v-model="formData.tableDataDetails" :editorConfig="{ readOnly: true }" :min-height="200" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
<el-col :lg="12">
|
||||||
|
<el-form-item :label-width="labelWidth" label="排序" >
|
||||||
|
<el-input-number v-model.number="formData.tableDataSort" controls-position="right" :precision="2" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</el-row>
|
||||||
|
</el-form>
|
||||||
|
</el-dialog>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
import { ElMessage } from 'element-plus'
|
||||||
|
import { reactive, ref, watch } from "vue";
|
||||||
|
|
||||||
|
|
||||||
|
// 打开弹窗时回调
|
||||||
|
const openDialog = async () => {
|
||||||
|
await getis_bid_announcement()
|
||||||
|
await getis_human_resource_pool_or_framework_agreement()
|
||||||
|
await getis_multiple()
|
||||||
|
await getis_only_bidder()
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
const formData = ref({
|
||||||
|
...props.data,
|
||||||
|
});
|
||||||
|
watch(props, async (v) => {
|
||||||
|
formData.value = v.data;
|
||||||
|
});
|
||||||
|
|
||||||
|
// -业务参数
|
||||||
|
// 是否为中标公告字典选项列表
|
||||||
|
const is_bid_announcement = ref([]);
|
||||||
|
// 是否是人力资源池或框架协议字典选项列表
|
||||||
|
const is_human_resource_pool_or_framework_agreement = ref([]);
|
||||||
|
// 公告中是否包含多个包/标段/采购内容字典选项列表
|
||||||
|
const is_multiple = ref([]);
|
||||||
|
// 是否仅有一个中标人字典选项列表
|
||||||
|
const is_only_bidder = ref([]);
|
||||||
|
|
||||||
|
// -业务方法
|
||||||
|
// 字典获取
|
||||||
|
async function getis_bid_announcement() {
|
||||||
|
await proxy.getDicts('is_bid_announcement').then((res) => {
|
||||||
|
is_bid_announcement.value = res.data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 字典获取
|
||||||
|
async function getis_human_resource_pool_or_framework_agreement() {
|
||||||
|
await proxy.getDicts('is_human_resource_pool_or_framework_agreement').then((res) => {
|
||||||
|
is_human_resource_pool_or_framework_agreement.value = res.data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 字典获取
|
||||||
|
async function getis_multiple() {
|
||||||
|
await proxy.getDicts('is_multiple').then((res) => {
|
||||||
|
is_multiple.value = res.data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 字典获取
|
||||||
|
async function getis_only_bidder() {
|
||||||
|
await proxy.getDicts('is_only_bidder').then((res) => {
|
||||||
|
is_only_bidder.value = res.data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// 基础参数
|
||||||
|
const formRef = ref();
|
||||||
|
const labelWidth = 100;
|
||||||
|
const { proxy } = getCurrentInstance()
|
||||||
|
const props = defineProps({
|
||||||
|
modelValue: Boolean,
|
||||||
|
data: Object,
|
||||||
|
done: Function,
|
||||||
|
});
|
||||||
|
const emits = defineEmits(["update:modelValue"]);
|
||||||
|
|
||||||
|
|
||||||
|
// -基础方法
|
||||||
|
const closeDialog = () => {
|
||||||
|
emits("update:modelValue", false);
|
||||||
|
};
|
||||||
|
|
||||||
|
</script>
|
@ -0,0 +1,271 @@
|
|||||||
|
<!--
|
||||||
|
* @Descripttion: (表格数据/tb_table_data 编辑弹窗)
|
||||||
|
* @version: (1.0)
|
||||||
|
* @Author: (lwh)
|
||||||
|
* @Date: (2023-11-22)
|
||||||
|
* @LastEditors: (lwh)
|
||||||
|
* @LastEditTime: (2023-11-22)
|
||||||
|
-->
|
||||||
|
<template>
|
||||||
|
<el-dialog v-model="props.modelValue" title="修改表格数据信息" width="900px" @closed="closeDialog" @open="openDialog">
|
||||||
|
<el-form ref="formRef" :model="formData" :rules="rules">
|
||||||
|
<el-row :gutter="20">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<el-col :lg="12">
|
||||||
|
<el-form-item :label-width="labelWidth" label="采购内容" prop="tableDataProcurementContent">
|
||||||
|
<el-input v-model="formData.tableDataProcurementContent" placeholder="请输入采购内容" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
<el-col :lg="12">
|
||||||
|
<el-form-item :label-width="labelWidth" label="采购单位名称" prop="tableDataProcurementUnit">
|
||||||
|
<el-input v-model="formData.tableDataProcurementUnit" placeholder="请输入采购单位名称" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
<el-col :lg="12">
|
||||||
|
<el-form-item :label-width="labelWidth" label="采购方式" prop="tableDataProcurementMethod">
|
||||||
|
<el-input v-model="formData.tableDataProcurementMethod" placeholder="请输入采购方式" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
<el-col :lg="12">
|
||||||
|
<el-form-item :label-width="labelWidth" label="供应商名称" prop="tableDataSupplierName">
|
||||||
|
<el-input v-model="formData.tableDataSupplierName" placeholder="请输入供应商名称" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
<el-col :lg="12">
|
||||||
|
<el-form-item :label-width="labelWidth" label="供应商的对应报价" prop="tableDataSupplierOffer">
|
||||||
|
<el-input-number v-model.number="formData.tableDataSupplierOffer" controls-position="right" :min="0" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
<el-col :lg="12">
|
||||||
|
<el-form-item :label-width="labelWidth" label="项目计价形式" prop="tableDataProjectPricingForm">
|
||||||
|
<el-input v-model="formData.tableDataProjectPricingForm" placeholder="请输入项目计价形式" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
<el-col :lg="12">
|
||||||
|
<el-form-item :label-width="labelWidth" label="链接" prop="tableDataLink">
|
||||||
|
<el-input v-model="formData.tableDataLink" placeholder="请输入链接" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
<el-col :lg="12">
|
||||||
|
<el-form-item :label-width="labelWidth" label="日期" prop="tableDataDate">
|
||||||
|
<el-date-picker v-model="formData.tableDataDate" type="datetime" :teleported="false" placeholder="选择日期时间"></el-date-picker>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
<el-col :lg="12">
|
||||||
|
<el-form-item :label-width="labelWidth" label="截止日期" prop="tableDataDeadline">
|
||||||
|
<el-date-picker v-model="formData.tableDataDeadline" type="datetime" :teleported="false" placeholder="选择日期时间"></el-date-picker>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
<el-col :lg="12">
|
||||||
|
<el-form-item :label-width="labelWidth" label="中标人或候选人" prop="tableDataWinningBidde">
|
||||||
|
<el-input v-model="formData.tableDataWinningBidde" placeholder="请输入中标人或候选人" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
<el-col :lg="12">
|
||||||
|
<el-form-item :label-width="labelWidth" label="中标金额" prop="tableDataBidWinningPrice">
|
||||||
|
<el-input-number v-model.number="formData.tableDataBidWinningPrice" controls-position="right" :min="0" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
<el-col :lg="12">
|
||||||
|
<el-form-item :label-width="labelWidth" label="是否为中标公告" prop="tableDataIsBidAnnouncement">
|
||||||
|
<el-select v-model="formData.tableDataIsBidAnnouncement" placeholder="请选择是否为中标公告">
|
||||||
|
<el-option v-for="item in is_bid_announcement " :key="item.dictValue" :label="item.dictLabel" :value="parseInt(item.dictValue)"></el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
<el-col :lg="12">
|
||||||
|
<el-form-item :label-width="labelWidth" label="是否是人力资源池或框架协议" prop="tableDataIsHumanResourcePoolOrFrameworkAgreement">
|
||||||
|
<el-select v-model="formData.tableDataIsHumanResourcePoolOrFrameworkAgreement" placeholder="请选择是否是人力资源池或框架协议">
|
||||||
|
<el-option v-for="item in is_human_resource_pool_or_framework_agreement " :key="item.dictValue" :label="item.dictLabel" :value="parseInt(item.dictValue)"></el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
<el-col :lg="12">
|
||||||
|
<el-form-item :label-width="labelWidth" label="公告中是否包含多个包/标段/采购内容" prop="tableDataIsMultiple">
|
||||||
|
<el-select v-model="formData.tableDataIsMultiple" placeholder="请选择公告中是否包含多个包/标段/采购内容">
|
||||||
|
<el-option v-for="item in is_multiple " :key="item.dictValue" :label="item.dictLabel" :value="parseInt(item.dictValue)"></el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
<el-col :lg="12">
|
||||||
|
<el-form-item :label-width="labelWidth" label="是否仅有一个中标人" prop="tableDataIsOnlyBidder">
|
||||||
|
<el-select v-model="formData.tableDataIsOnlyBidder" placeholder="请选择是否仅有一个中标人">
|
||||||
|
<el-option v-for="item in is_only_bidder " :key="item.dictValue" :label="item.dictLabel" :value="parseInt(item.dictValue)"></el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
<el-col :lg="12">
|
||||||
|
<el-form-item :label-width="labelWidth" label="单一来源理由(如有)" prop="tableDataSingleSource">
|
||||||
|
<el-input v-model="formData.tableDataSingleSource" placeholder="请输入单一来源理由(如有)" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
<el-col :lg="24">
|
||||||
|
<el-form-item :label-width="labelWidth" label="详情" prop="tableDataDetails">
|
||||||
|
<editor v-model="formData.tableDataDetails" :min-height="200" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
<el-col :lg="12">
|
||||||
|
<el-form-item :label-width="labelWidth" label="排序" prop="tableDataSort">
|
||||||
|
<el-input-number v-model.number="formData.tableDataSort" controls-position="right" :min="0" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</el-row>
|
||||||
|
</el-form>
|
||||||
|
|
||||||
|
<template #footer>
|
||||||
|
<div class="dialog-footer">
|
||||||
|
<el-button type="primary" @click="handleEditClick(formRef)" :loading="loadingStatus">编辑</el-button>
|
||||||
|
<el-button @click="handleResetClick(formRef)">重置</el-button>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</el-dialog>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
import { ElMessage } from 'element-plus'
|
||||||
|
import modal from '@/plugins/modal.js'
|
||||||
|
import { reactive, ref, watch } from "vue";
|
||||||
|
import { addOrUpdateTableData } from "@/api/business/TableDataManage/TableDatas/tableData.js";
|
||||||
|
|
||||||
|
|
||||||
|
// 打开弹窗时回调
|
||||||
|
const openDialog = async () => {
|
||||||
|
await getis_bid_announcement()
|
||||||
|
await getis_human_resource_pool_or_framework_agreement()
|
||||||
|
await getis_multiple()
|
||||||
|
await getis_only_bidder()
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
const formData = ref({
|
||||||
|
...props.data,
|
||||||
|
});
|
||||||
|
watch(props, async (v) => {
|
||||||
|
formData.value = v.data;
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
// 业务参数
|
||||||
|
// 是否为中标公告字典选项列表
|
||||||
|
const is_bid_announcement = ref([]);
|
||||||
|
// 是否是人力资源池或框架协议字典选项列表
|
||||||
|
const is_human_resource_pool_or_framework_agreement = ref([]);
|
||||||
|
// 公告中是否包含多个包/标段/采购内容字典选项列表
|
||||||
|
const is_multiple = ref([]);
|
||||||
|
// 是否仅有一个中标人字典选项列表
|
||||||
|
const is_only_bidder = ref([]);
|
||||||
|
|
||||||
|
// -业务方法
|
||||||
|
//字典获取
|
||||||
|
async function getis_bid_announcement() {
|
||||||
|
await proxy.getDicts('is_bid_announcement').then((res) => {
|
||||||
|
is_bid_announcement.value = res.data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
//字典获取
|
||||||
|
async function getis_human_resource_pool_or_framework_agreement() {
|
||||||
|
await proxy.getDicts('is_human_resource_pool_or_framework_agreement').then((res) => {
|
||||||
|
is_human_resource_pool_or_framework_agreement.value = res.data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
//字典获取
|
||||||
|
async function getis_multiple() {
|
||||||
|
await proxy.getDicts('is_multiple').then((res) => {
|
||||||
|
is_multiple.value = res.data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
//字典获取
|
||||||
|
async function getis_only_bidder() {
|
||||||
|
await proxy.getDicts('is_only_bidder').then((res) => {
|
||||||
|
is_only_bidder.value = res.data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// -基础参数
|
||||||
|
const props = defineProps({
|
||||||
|
modelValue: Boolean,
|
||||||
|
data: Object,
|
||||||
|
done: Function,
|
||||||
|
});
|
||||||
|
|
||||||
|
const loadingStatus = ref(false)
|
||||||
|
const labelWidth = 100;
|
||||||
|
const formRef = ref();
|
||||||
|
const { proxy } = getCurrentInstance()
|
||||||
|
const emits = defineEmits(["update:modelValue"]);
|
||||||
|
const imgData = ref({
|
||||||
|
fileDir: "TableData"
|
||||||
|
})
|
||||||
|
|
||||||
|
// 验证
|
||||||
|
const rules = reactive({
|
||||||
|
tableDataGuid: [{ required: true, message: "不能为空", trigger: "blur", type: "number" }],
|
||||||
|
tableDataProcurementContent: [{ required: true, message: "采购内容不能为空", trigger: "blur" }],
|
||||||
|
tableDataProcurementUnit: [{ required: true, message: "采购单位名称不能为空", trigger: "blur" }],
|
||||||
|
tableDataDate: [{ required: true, message: "日期不能为空", trigger: "blur" }],
|
||||||
|
tableDataIsBidAnnouncement: [{ required: true, message: "是否为中标公告不能为空", trigger: "change", type: "number" }],
|
||||||
|
tableDataIsHumanResourcePoolOrFrameworkAgreement: [{ required: true, message: "是否是人力资源池或框架协议不能为空", trigger: "change", type: "number" }],
|
||||||
|
tableDataIsMultiple: [{ required: true, message: "公告中是否包含多个包/标段/采购内容不能为空", trigger: "change", type: "number" }],
|
||||||
|
tableDataIsOnlyBidder: [{ required: true, message: "是否仅有一个中标人不能为空", trigger: "change", type: "number" }],
|
||||||
|
tableDataSort: [{ required: true, message: "排序不能为空", trigger: "blur", type: "number" }],
|
||||||
|
});
|
||||||
|
|
||||||
|
// -基础方法
|
||||||
|
// 提交
|
||||||
|
const handleEditClick = async (formEl) => {
|
||||||
|
if (!formEl) return;
|
||||||
|
formEl.validate(async (valid) => {
|
||||||
|
if (!valid) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
loadingStatus.value = true
|
||||||
|
|
||||||
|
|
||||||
|
const { code } = await addOrUpdateTableData(formData.value);
|
||||||
|
if (code == 200) {
|
||||||
|
modal.msgSuccess('修改成功')
|
||||||
|
closeDialog();
|
||||||
|
loadingStatus.value = false
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
const handleResetClick = async (formEl) => {
|
||||||
|
if (!formEl) return;
|
||||||
|
formEl.resetFields();
|
||||||
|
}
|
||||||
|
const closeDialog = () => {
|
||||||
|
props.done();
|
||||||
|
emits("update:modelValue", false);
|
||||||
|
};
|
||||||
|
|
||||||
|
</script>
|
@ -0,0 +1,124 @@
|
|||||||
|
<!--
|
||||||
|
* @Descripttion: (表格数据/tb_table_data导入弹窗)
|
||||||
|
* @version: (1.0)
|
||||||
|
* @Author: (lwh)
|
||||||
|
* @Date: (2023-11-22)
|
||||||
|
* @LastEditors: (lwh)
|
||||||
|
* @LastEditTime: (2023-11-22)
|
||||||
|
-->
|
||||||
|
<template>
|
||||||
|
<el-dialog title="导入" v-model="props.modelValue" width="400px" @closed="closeDialog">
|
||||||
|
<el-upload
|
||||||
|
name="file"
|
||||||
|
ref="uploadRef"
|
||||||
|
:limit="1"
|
||||||
|
accept=".xlsx, .xls"
|
||||||
|
:headers="upload.headers"
|
||||||
|
:action="upload.url + '?updateSupport=' + upload.updateSupport"
|
||||||
|
:disabled="upload.isUploading"
|
||||||
|
:on-progress="handleFileUploadProgress"
|
||||||
|
:on-success="handleFileSuccess"
|
||||||
|
:auto-upload="false"
|
||||||
|
drag>
|
||||||
|
<el-icon class="el-icon--upload">
|
||||||
|
<upload-filled />
|
||||||
|
</el-icon>
|
||||||
|
<div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
|
||||||
|
<template #tip>
|
||||||
|
<div class="el-upload__tip text-center">
|
||||||
|
<div class="el-upload__tip">
|
||||||
|
<el-checkbox v-model="upload.updateSupport" /> 是否更新已经存在的表格数据
|
||||||
|
</div>
|
||||||
|
<span>仅允许导入xls、xlsx格式文件。</span>
|
||||||
|
<el-link type="primary" :underline="false" style="font-size: 12px; vertical-align: baseline" @click="importTemplate">下载模板</el-link>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</el-upload>
|
||||||
|
<template #footer>
|
||||||
|
<el-button @click="closeDialog">取消</el-button>
|
||||||
|
<el-button type="primary" @click="submitFileForm">提交</el-button>
|
||||||
|
</template>
|
||||||
|
</el-dialog>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
import { reactive, ref, watch } from "vue";
|
||||||
|
import { ElMessage, ElMessageBox, ElNotification, ElLoading } from 'element-plus'
|
||||||
|
import { getToken } from '@/utils/auth'
|
||||||
|
|
||||||
|
|
||||||
|
// 业务参数
|
||||||
|
const formRef = ref();
|
||||||
|
const labelWidth = 100;
|
||||||
|
const { proxy } = getCurrentInstance()
|
||||||
|
let loadingInstance;
|
||||||
|
let uploadRef = ref()
|
||||||
|
|
||||||
|
/*** 导入参数 */
|
||||||
|
const upload = reactive({
|
||||||
|
// 是否禁用上传
|
||||||
|
isUploading: false,
|
||||||
|
// 是否更新已经存在的数据
|
||||||
|
updateSupport: false,
|
||||||
|
// 设置上传的请求头部
|
||||||
|
headers: { Authorization: 'Bearer ' + getToken() },
|
||||||
|
// 上传的地址
|
||||||
|
url: import.meta.env.VITE_APP_BASE_API + '/business/tableData/importData',
|
||||||
|
})
|
||||||
|
|
||||||
|
// 打开遮罩层
|
||||||
|
function loading(content) {
|
||||||
|
loadingInstance = ElLoading.service({
|
||||||
|
lock: true,
|
||||||
|
text: content,
|
||||||
|
background: "rgba(0, 0, 0, 0.7)",
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 关闭遮罩层
|
||||||
|
function closeLoading() {
|
||||||
|
loadingInstance.close();
|
||||||
|
}
|
||||||
|
|
||||||
|
// -业务方法
|
||||||
|
/** 下载模板操作 */
|
||||||
|
function importTemplate() {
|
||||||
|
proxy.download('/business/tableData/importTemplate', '表格数据数据导入模板')
|
||||||
|
}
|
||||||
|
/**文件上传中处理 */
|
||||||
|
const handleFileUploadProgress = (event, file, fileList) => {
|
||||||
|
upload.isUploading = true
|
||||||
|
loading('正在导入数据,请稍候...')
|
||||||
|
}
|
||||||
|
/** 文件上传成功处理 */
|
||||||
|
const handleFileSuccess = (response, file, fileList) => {
|
||||||
|
closeLoading();
|
||||||
|
closeDialog()
|
||||||
|
upload.isUploading = false
|
||||||
|
uploadRef.value.clearFiles()
|
||||||
|
ElMessageBox.alert("<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" + response.data + '</div>', '导入结果', {
|
||||||
|
dangerouslyUseHTMLString: true,
|
||||||
|
})
|
||||||
|
props.done()
|
||||||
|
}
|
||||||
|
/** 提交上传文件 */
|
||||||
|
function submitFileForm() {
|
||||||
|
uploadRef.value.submit()
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// -基础参数
|
||||||
|
const emits = defineEmits(["update:modelValue"]);
|
||||||
|
const dialogVisible = ref(props.modelValue);
|
||||||
|
const formData = reactive({});
|
||||||
|
const props = defineProps({
|
||||||
|
modelValue: Boolean,
|
||||||
|
done: Function,
|
||||||
|
});
|
||||||
|
|
||||||
|
// -基础方法
|
||||||
|
const closeDialog = () => {
|
||||||
|
dialogVisible.value = false;
|
||||||
|
emits("update:modelValue", false);
|
||||||
|
};
|
||||||
|
</script>
|
307
src/views/business/TableDataManage/TableDatas/index.vue
Normal file
307
src/views/business/TableDataManage/TableDatas/index.vue
Normal file
@ -0,0 +1,307 @@
|
|||||||
|
<!--
|
||||||
|
* @Descripttion: (表格数据/tb_table_data)
|
||||||
|
* @version: (1.0)
|
||||||
|
* @Author: (lwh)
|
||||||
|
* @Date: (2023-11-22)
|
||||||
|
* @LastEditors: (lwh)
|
||||||
|
* @LastEditTime: (2023-11-22)
|
||||||
|
-->
|
||||||
|
<template>
|
||||||
|
<div class="app-container">
|
||||||
|
<el-row :gutter="24">
|
||||||
|
<!-- 搜索框 queryParams.需要搜索的字段 -->
|
||||||
|
<el-form :model="queryParams" label-position="left" style="margin:15px;" inline ref="queryForm" v-show="showSearch"
|
||||||
|
@submit.prevent>
|
||||||
|
<el-form-item label="采购内容" prop="tableDataProcurementContent">
|
||||||
|
<el-input v-model="queryParams.tableDataProcurementContent" placeholder="请输入采购内容" clearable
|
||||||
|
@keyup.enter="handleQuery" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="采购单位名称" prop="tableDataProcurementUnit">
|
||||||
|
<el-input v-model="queryParams.tableDataProcurementUnit" placeholder="请输入采购单位名称" clearable
|
||||||
|
@keyup.enter="handleQuery" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="日期">
|
||||||
|
<el-date-picker v-model="daterange" style="width: 240px" type="daterange" range-separator="-"
|
||||||
|
start-placeholder="开始日期" end-placeholder="结束日期" placeholder="请选择日期" value-format="YYYY-MM-DD HH:mm:ss"
|
||||||
|
:shortcuts="dateOptions">
|
||||||
|
</el-date-picker>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item>
|
||||||
|
<el-button icon="search" type="primary" @click="handleQuery">{{ $t('btn.search') }}</el-button>
|
||||||
|
<el-button icon="refresh" @click="resetQuery">{{ $t('btn.reset') }}</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
</el-row>
|
||||||
|
|
||||||
|
<!-- 工具按钮 -->
|
||||||
|
<el-row :gutter="10" class="mb8">
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button type="primary" v-hasPermi="['business:tabledata:addOrUpdate']" plain icon="plus"
|
||||||
|
@click="AddDialogVisible = true">
|
||||||
|
{{ $t('btn.add') }}
|
||||||
|
</el-button>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button type="danger" :disabled="multiple" v-hasPermi="['business:tabledata:delete']" plain icon="delete"
|
||||||
|
@click="handleDelete">
|
||||||
|
{{ $t('btn.delete') }}
|
||||||
|
</el-button>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button type="primary" plain icon="Upload" @click="UploadDialogVisible = true"
|
||||||
|
v-hasPermi="['business:tabledata:import']">导入</el-button>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button type="warning" plain icon="download" @click="handleExport" v-hasPermi="['business:tabledata:export']">
|
||||||
|
{{ $t('btn.export') }}
|
||||||
|
</el-button>
|
||||||
|
</el-col>
|
||||||
|
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
||||||
|
</el-row>
|
||||||
|
|
||||||
|
<!-- 表格渲染 prop="对应的字段"-->
|
||||||
|
<el-table v-loading="loading" :data="dataList" ref="tableRef" border highlight-current-row
|
||||||
|
@selection-change="handleSelectionChange">
|
||||||
|
<el-table-column type="selection" width="50" align="center" />
|
||||||
|
|
||||||
|
<el-table-column prop="tableDataProcurementContent" label="采购内容" align="center" :show-overflow-tooltip="true" />
|
||||||
|
<el-table-column prop="tableDataProcurementUnit" label="采购单位名称" align="center" :show-overflow-tooltip="true" />
|
||||||
|
<el-table-column prop="tableDataProcurementMethod" label="采购方式" align="center" :show-overflow-tooltip="true" />
|
||||||
|
<el-table-column prop="tableDataSupplierName" label="供应商名称" align="center" :show-overflow-tooltip="true" />
|
||||||
|
<el-table-column prop="tableDataSupplierOffer" label="供应商的对应报价" align="center" />
|
||||||
|
<el-table-column prop="tableDataProjectPricingForm" label="项目计价形式" align="center" :show-overflow-tooltip="true" />
|
||||||
|
<el-table-column prop="tableDataLink" label="链接" align="center" :show-overflow-tooltip="true" />
|
||||||
|
<el-table-column prop="tableDataDate" label="日期" align="center" :show-overflow-tooltip="true" />
|
||||||
|
<el-table-column prop="tableDataDeadline" label="截止日期" align="center" :show-overflow-tooltip="true" />
|
||||||
|
<el-table-column prop="tableDataWinningBidde" label="中标人或候选人" align="center" :show-overflow-tooltip="true" />
|
||||||
|
<el-table-column prop="tableDataBidWinningPrice" label="中标金额" align="center" />
|
||||||
|
<el-table-column prop="tableDataIsBidAnnouncement" label="是否为中标公告" align="center">
|
||||||
|
<template #default="scope">
|
||||||
|
<dict-tag :options="is_bid_announcement" :value="scope.row.tableDataIsBidAnnouncement" />
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="tableDataIsHumanResourcePoolOrFrameworkAgreement" label="是否是人力资源池或框架协议" align="center">
|
||||||
|
<template #default="scope">
|
||||||
|
<dict-tag :options="is_human_resource_pool_or_framework_agreement"
|
||||||
|
:value="scope.row.tableDataIsHumanResourcePoolOrFrameworkAgreement" />
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="tableDataIsMultiple" label="公告中是否包含多个包/标段/采购内容" align="center">
|
||||||
|
<template #default="scope">
|
||||||
|
<dict-tag :options="is_multiple" :value="scope.row.tableDataIsMultiple" />
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="tableDataIsOnlyBidder" label="是否仅有一个中标人" align="center">
|
||||||
|
<template #default="scope">
|
||||||
|
<dict-tag :options="is_only_bidder" :value="scope.row.tableDataIsOnlyBidder" />
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="tableDataSingleSource" label="单一来源理由(如有)" align="center" :show-overflow-tooltip="true" />
|
||||||
|
<el-table-column prop="tableDataDetails" label="详情" align="center" :show-overflow-tooltip="true" />
|
||||||
|
<el-table-column prop="tableDataSort" label="排序" align="center" sortable />
|
||||||
|
|
||||||
|
<el-table-column label="操作" width="350" fixed="right">
|
||||||
|
<template #default="scope">
|
||||||
|
<el-button type="primary" size="small" icon="edit" @click="handleUpdate(scope.row)"
|
||||||
|
v-hasPermi="['business:tabledata:addOrUpdate']">编辑</el-button>
|
||||||
|
<el-button type="danger" size="small" icon="delete" @click="handleDelete(scope.row)"
|
||||||
|
v-hasPermi="['business:tabledata:delete']">删除</el-button>
|
||||||
|
<el-button size="small" icon="view" @click="handleDetail(scope.row)">查看</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
|
</el-table>
|
||||||
|
<pagination :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize"
|
||||||
|
@pagination="getList" />
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- 添加 -->
|
||||||
|
<AddDialog v-model="AddDialogVisible" :done="() => resetQuery()"></AddDialog>
|
||||||
|
<!-- 编辑 -->
|
||||||
|
<EditDialog v-model="EditDialogVisible" :data="EditDialogRow" :done="() => resetQuery()"></EditDialog>
|
||||||
|
<!-- 详情 -->
|
||||||
|
<DetailDialog v-model="DetailDialogVisible" :data="DetailDialogRow" :done="() => resetQuery()"></DetailDialog>
|
||||||
|
<!-- 导入 -->
|
||||||
|
<UploadDialog v-model="UploadDialogVisible" :done="() => resetQuery()"></UploadDialog>
|
||||||
|
</template>
|
||||||
|
<script setup name="tabledata">
|
||||||
|
import { ElMessageBox } from 'element-plus'
|
||||||
|
import modal from '@/plugins/modal.js'
|
||||||
|
import { exportTableData, tableDataList, delTableData } from '@/api/business/TableDataManage/TableDatas/tableData.js'
|
||||||
|
import AddDialog from "./components/AddDialog.vue";
|
||||||
|
import EditDialog from "./components/EditDialog.vue";
|
||||||
|
import DetailDialog from "./components/DetailDialog.vue";
|
||||||
|
import UploadDialog from "./components/UploadDialog.vue";
|
||||||
|
|
||||||
|
const AddDialogVisible = ref(false);
|
||||||
|
const EditDialogVisible = ref(false);
|
||||||
|
const EditDialogRow = ref({});
|
||||||
|
const DetailDialogVisible = ref(false);
|
||||||
|
const DetailDialogRow = ref({});
|
||||||
|
const UploadDialogVisible = ref(false);
|
||||||
|
|
||||||
|
const { proxy } = getCurrentInstance()
|
||||||
|
|
||||||
|
// 选中categoryId数组数组
|
||||||
|
const ids = ref([])
|
||||||
|
// 非单选禁用
|
||||||
|
const single = ref(true)
|
||||||
|
// 非多个禁用
|
||||||
|
const multiple = ref(true)
|
||||||
|
// 显示搜索条件
|
||||||
|
const showSearch = ref(true)
|
||||||
|
// 数据列表
|
||||||
|
const dataList = ref([])
|
||||||
|
// 总记录数
|
||||||
|
const total = ref(0)
|
||||||
|
// 是否加载
|
||||||
|
const loading = ref(true)
|
||||||
|
|
||||||
|
const data = reactive({
|
||||||
|
form: {},
|
||||||
|
queryParams: {
|
||||||
|
pageNum: 1,
|
||||||
|
pageSize: 10
|
||||||
|
},
|
||||||
|
})
|
||||||
|
const { queryParams } = toRefs(data)
|
||||||
|
const dateRange = ref([])
|
||||||
|
|
||||||
|
// 业务参数
|
||||||
|
|
||||||
|
|
||||||
|
// 业务方法
|
||||||
|
|
||||||
|
// 字典获取
|
||||||
|
const is_bid_announcement = ref([]);
|
||||||
|
async function getis_bid_announcement() {
|
||||||
|
await proxy.getDicts('is_bid_announcement').then((res) => {
|
||||||
|
is_bid_announcement.value = res.data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
getis_bid_announcement()
|
||||||
|
// 字典获取
|
||||||
|
const is_human_resource_pool_or_framework_agreement = ref([]);
|
||||||
|
async function getis_human_resource_pool_or_framework_agreement() {
|
||||||
|
await proxy.getDicts('is_human_resource_pool_or_framework_agreement').then((res) => {
|
||||||
|
is_human_resource_pool_or_framework_agreement.value = res.data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
getis_human_resource_pool_or_framework_agreement()
|
||||||
|
// 字典获取
|
||||||
|
const is_multiple = ref([]);
|
||||||
|
async function getis_multiple() {
|
||||||
|
await proxy.getDicts('is_multiple').then((res) => {
|
||||||
|
is_multiple.value = res.data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
getis_multiple()
|
||||||
|
// 字典获取
|
||||||
|
const is_only_bidder = ref([]);
|
||||||
|
async function getis_only_bidder() {
|
||||||
|
await proxy.getDicts('is_only_bidder').then((res) => {
|
||||||
|
is_only_bidder.value = res.data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
getis_only_bidder()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//基础方法
|
||||||
|
|
||||||
|
// 查询数据
|
||||||
|
function getList() {
|
||||||
|
loading.value = true
|
||||||
|
|
||||||
|
// tableDataList(proxy.addDateRange(queryParams.value, dateRange.value)).then((res) => {
|
||||||
|
// tableDataList(proxy.addDateRange(queryParams.value, dateRange.value)).then((res) => {
|
||||||
|
|
||||||
|
tableDataList(queryParams.value).then((res) => {
|
||||||
|
if (res.code == 200) {
|
||||||
|
loading.value = false;
|
||||||
|
dataList.value = res.data.result;
|
||||||
|
total.value = res.data.totalNum;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 多选框选中数据
|
||||||
|
function handleSelectionChange(selection) {
|
||||||
|
ids.value = selection.map((item) => item.tableDataId)
|
||||||
|
single.value = selection.length != 1
|
||||||
|
multiple.value = !selection.length
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 重置查询操作 */
|
||||||
|
function resetQuery() {
|
||||||
|
proxy.resetForm('queryForm')
|
||||||
|
handleQuery()
|
||||||
|
}
|
||||||
|
/** 搜索按钮操作 */
|
||||||
|
function handleQuery() {
|
||||||
|
getList()
|
||||||
|
}
|
||||||
|
/** 删除按钮操作 */
|
||||||
|
function handleDelete(row) {
|
||||||
|
const Ids = row.tableDataId || ids.value
|
||||||
|
|
||||||
|
ElMessageBox.confirm("是否确认删除?", "系统提示", {
|
||||||
|
confirmButtonText: '确定',
|
||||||
|
cancelButtonText: '取消',
|
||||||
|
type: "warning",
|
||||||
|
})
|
||||||
|
.then(function () {
|
||||||
|
return delTableData(Ids)
|
||||||
|
})
|
||||||
|
.then(() => {
|
||||||
|
handleQuery()
|
||||||
|
modal.msgSuccess("删除成功")
|
||||||
|
})
|
||||||
|
.catch(() => { })
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 导出按钮操作 */
|
||||||
|
function handleExport(row) {
|
||||||
|
const Ids = row.tableDataId || ids.value
|
||||||
|
const name = ref("所有")
|
||||||
|
|
||||||
|
if (Ids.length != 0) {
|
||||||
|
let str = ''
|
||||||
|
for (const key in Ids) {
|
||||||
|
str += Ids[key] + ','
|
||||||
|
}
|
||||||
|
str = str.slice(0, str.length - 1)
|
||||||
|
queryParams.value.ids = str
|
||||||
|
name.value = "选中"
|
||||||
|
}
|
||||||
|
|
||||||
|
ElMessageBox.confirm('是否确认导出' + name.value + '数据?', '警告', {
|
||||||
|
confirmButtonText: '确定',
|
||||||
|
cancelButtonText: '取消',
|
||||||
|
type: 'warning',
|
||||||
|
})
|
||||||
|
.then(function () {
|
||||||
|
return exportTableData(queryParams.value)
|
||||||
|
})
|
||||||
|
.then((response) => {
|
||||||
|
proxy.download(response.data.path)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 修改
|
||||||
|
function handleUpdate(row) {
|
||||||
|
EditDialogVisible.value = true
|
||||||
|
EditDialogRow.value = row
|
||||||
|
}
|
||||||
|
|
||||||
|
// 详情
|
||||||
|
function handleDetail(row) {
|
||||||
|
DetailDialogVisible.value = true
|
||||||
|
DetailDialogRow.value = row
|
||||||
|
}
|
||||||
|
|
||||||
|
handleQuery()
|
||||||
|
</script>
|
Loading…
Reference in New Issue
Block a user