分包合同 分包洽商代码
This commit is contained in:
parent
ec78fa5a6c
commit
257ace98b3
27
src/api/procurement_changes.ts
Normal file
27
src/api/procurement_changes.ts
Normal file
@ -0,0 +1,27 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 采购变更表列表
|
||||
export function apiProcurementLists(params: any) {
|
||||
return request.get({ url: '/contract.procurement_contract/lists', params })
|
||||
}
|
||||
|
||||
// 添加采购变更
|
||||
export function apiProcurementAdd(params: any) {
|
||||
return request.post({ url: '/contract.procurement_contract_change/add', params })
|
||||
}
|
||||
|
||||
// 编辑采购变更
|
||||
export function apiProcurementEdit(params: any) {
|
||||
return request.post({ url: '/contract.procurement_contract_change/edit', params })
|
||||
}
|
||||
|
||||
// 删除采购变更
|
||||
export function apiProcurementDelete(params: any) {
|
||||
return request.post({ url: '/contract.procurement_contract_change/delete', params })
|
||||
}
|
||||
|
||||
|
||||
// 采购变更详情
|
||||
export function apiProcurementDetail(params: any) {
|
||||
return request.get({ url: '/contract.procurement_contract_change/detail', params })
|
||||
}
|
27
src/api/subcontractor.ts
Normal file
27
src/api/subcontractor.ts
Normal file
@ -0,0 +1,27 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 分包洽商表列表
|
||||
export function apinegotiationLists(params: any) {
|
||||
return request.get({ url: '/contract.subcontracting_contract_negotiation/lists', params })
|
||||
}
|
||||
|
||||
// 添加分包洽商
|
||||
export function apinegotiationAdd(params: any) {
|
||||
return request.post({ url: '/contract.subcontracting_contract_negotiation/add', params })
|
||||
}
|
||||
|
||||
// 编辑分包洽商
|
||||
export function apinegotiationEdit(params: any) {
|
||||
return request.post({ url: '/contract.subcontracting_contract_negotiation/edit', params })
|
||||
}
|
||||
|
||||
// 删除分包洽商
|
||||
export function apinegotiationDelete(params: any) {
|
||||
return request.post({ url: '/contract.subcontracting_contract_negotiation/delete', params })
|
||||
}
|
||||
|
||||
|
||||
// 分包洽商详情
|
||||
export function apinegotiationDetail(params: any) {
|
||||
return request.get({ url: '/contract.subcontracting_contract_negotiation/detail', params })
|
||||
}
|
85
src/components/procurement/index.vue
Normal file
85
src/components/procurement/index.vue
Normal file
@ -0,0 +1,85 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-card class="!border-none" shadow="never">
|
||||
<el-form class="mb-[-16px]" :model="queryParams" inline>
|
||||
<el-form-item label="查询" prop="name">
|
||||
<el-input class="w-[280px]" v-model="queryParams.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">
|
||||
<div class="mt-4">
|
||||
<el-table :data="pager.lists" @cell-click="handleCurrentChange">
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column label="项目名称" prop="org_id" show-overflow-tooltip />
|
||||
<el-table-column label="供应商名称" prop="department_id" show-overflow-tooltip />
|
||||
|
||||
<el-table-column label="合同编号" prop="contract_no" show-overflow-tooltip />
|
||||
<el-table-column label="合同名称" prop="contract_name" show-overflow-tooltip />
|
||||
|
||||
<el-table-column label="合同类型" prop="contract_type">
|
||||
<template #default="{ row }">
|
||||
<dict-value :options="dictData.contract_type" :value="row.contract_type" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="签订日期" prop="signing_date" show-overflow-tooltip />
|
||||
<el-table-column label="付款方式" prop="pay_type" show-overflow-tooltip />
|
||||
<el-table-column label="账期" prop="account_period">
|
||||
<template #default="{ row }">
|
||||
<dict-value :options="dictData.account_period" :value="row.account_period" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="合同金额" prop="amount" show-overflow-tooltip />
|
||||
<el-table-column label="金额大写" prop="amount_daxie" 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="amount_excluding_tax" show-overflow-tooltip />
|
||||
<el-table-column label="质保金比例" prop="retention_money" show-overflow-tooltip />
|
||||
<el-table-column label="质保金" prop="retention_money_rate" show-overflow-tooltip />
|
||||
</el-table>
|
||||
|
||||
</div>
|
||||
<div class="flex mt-4 justify-end">
|
||||
<pagination v-model="pager" @change="getLists" />
|
||||
</div>
|
||||
</el-card>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { usePaging } from "@/hooks/usePaging"
|
||||
import { useDictData } from "@/hooks/useDictOptions"
|
||||
import { apiSubcontractingContractLists } from '@/api/subcontracting_contract'
|
||||
|
||||
import { defineEmits } from "vue"
|
||||
|
||||
// 查询条件
|
||||
const queryParams = reactive({
|
||||
name: ''
|
||||
});
|
||||
|
||||
const { dictData } = useDictData('contract_type,account_period,tax_rate,pay_type,pay_period ')
|
||||
// 选中数据
|
||||
const emits = defineEmits(["customEvent"]);
|
||||
|
||||
// 选中数据子父传递
|
||||
const handleCurrentChange = (value: any) => {
|
||||
emits("customEvent", value);
|
||||
};
|
||||
|
||||
// 分页相关
|
||||
const { pager, getLists, resetParams, resetPage } = usePaging({
|
||||
fetchFun: apiSubcontractingContractLists,
|
||||
params: queryParams,
|
||||
});
|
||||
|
||||
getLists();
|
||||
</script>
|
82
src/components/proontract/index.vue
Normal file
82
src/components/proontract/index.vue
Normal file
@ -0,0 +1,82 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-card class="!border-none" shadow="never">
|
||||
<el-form class="mb-[-16px]" :model="queryParams" inline>
|
||||
<el-form-item label="查询" prop="name">
|
||||
<el-input class="w-[280px]" v-model="queryParams.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">
|
||||
<div class="mt-4">
|
||||
<el-table :data="pager.lists" @cell-click="handleCurrentChange">
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column label="客户名称" prop="customer_id" show-overflow-tooltip />
|
||||
<el-table-column label="审批id" prop="approve_id" show-overflow-tooltip />
|
||||
<el-table-column label="项目名称" prop="buy_bidding_document_id" show-overflow-tooltip />
|
||||
|
||||
<el-table-column label="合同编号" prop="contract_code" show-overflow-tooltip />
|
||||
<el-table-column label="合同类型" prop="contract_type">
|
||||
<template #default="{ row }">
|
||||
<dict-value :options="dictData.contract_type" :value="row.contract_type" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="合同计价方式" prop="contract_pricing_method">
|
||||
<template #default="{ row }">
|
||||
<dict-value :options="dictData.contract_pricing_method" :value="row.contract_pricing_method" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="甲方" prop="party_a" show-overflow-tooltip />
|
||||
<el-table-column label="乙方" prop="party_b" show-overflow-tooltip />
|
||||
<el-table-column label="金额" prop="amount" show-overflow-tooltip />
|
||||
<el-table-column label="业务负责人" prop="business_director" show-overflow-tooltip />
|
||||
<el-table-column label="合同状态" prop="contract_status" show-overflow-tooltip />
|
||||
<el-table-column label="合同有效期" prop="expire" show-overflow-tooltip />
|
||||
<el-table-column label="签约日期" prop="contract_date" show-overflow-tooltip />
|
||||
</el-table>
|
||||
|
||||
</div>
|
||||
<div class="flex mt-4 justify-end">
|
||||
<pagination v-model="pager" @change="getLists" />
|
||||
</div>
|
||||
</el-card>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { usePaging } from "@/hooks/usePaging"
|
||||
import { useDictData } from "@/hooks/useDictOptions"
|
||||
import { apiContractLists } from '@/api/contract'
|
||||
|
||||
import { defineEmits } from "vue"
|
||||
import { timeFormat } from '@/utils/util'
|
||||
|
||||
// 查询条件
|
||||
const queryParams = reactive({
|
||||
custom_name: '',
|
||||
project_type: ""
|
||||
});
|
||||
const { dictData } = useDictData('project_type,project_content,bidding_method,relationship,information_sources,construction_funds_sources,construction_financial_status,construction_recognition,my_construction_recognition,strategic_significance,industry,unit_nature')
|
||||
|
||||
// 选中数据
|
||||
const emits = defineEmits(["customEvent"]);
|
||||
|
||||
// 选中数据子父传递
|
||||
const handleCurrentChange = (value: any) => {
|
||||
emits("customEvent", value);
|
||||
};
|
||||
|
||||
// 分页相关
|
||||
const { pager, getLists, resetParams, resetPage } = usePaging({
|
||||
fetchFun: apiContractLists,
|
||||
params: queryParams,
|
||||
|
||||
});
|
||||
|
||||
getLists();
|
||||
</script>
|
67
src/components/supplier/index.vue
Normal file
67
src/components/supplier/index.vue
Normal file
@ -0,0 +1,67 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-card class="!border-none" shadow="never">
|
||||
<el-form class="mb-[-16px]" :model="queryParams" inline>
|
||||
<el-form-item label="查询" prop="name">
|
||||
<el-input class="w-[280px]" v-model="queryParams.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">
|
||||
<div class="mt-4">
|
||||
<el-table :data="pager.lists" @cell-click="handleCurrentChange">
|
||||
<el-table-column label="序号" property="name" />
|
||||
<el-table-column label="建档人" property="custom_type" />
|
||||
<el-table-column label="供应商名称" property="credit_rating" />
|
||||
<el-table-column label="供应商分组" property="province_name" />
|
||||
<el-table-column label="供应商等级" property="city_name" />
|
||||
<el-table-column label="联系人" property="street_name" />
|
||||
<el-table-column label="性别" property="master_name" />
|
||||
<el-table-column label="电话号码" property="master_name" />
|
||||
<el-table-column label="性别" property="master_name" />
|
||||
<el-table-column label="邮箱地址" property="master_name" />
|
||||
<el-table-column label="邮箱地址" property="master_name" />
|
||||
|
||||
</el-table>
|
||||
|
||||
</div>
|
||||
<div class="flex mt-4 justify-end">
|
||||
<pagination v-model="pager" @change="getLists" />
|
||||
</div>
|
||||
</el-card>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { usePaging } from "@/hooks/usePaging"
|
||||
import { useDictData } from "@/hooks/useDictOptions"
|
||||
import { apiCustomLists } from '@/api/custom'
|
||||
import { defineEmits } from "vue"
|
||||
|
||||
// 查询条件
|
||||
const queryParams = reactive({
|
||||
name: ''
|
||||
});
|
||||
|
||||
|
||||
// 选中数据
|
||||
const emits = defineEmits(["customEvent"]);
|
||||
|
||||
// 选中数据子父传递
|
||||
const handleCurrentChange = (value: any) => {
|
||||
emits("customEvent", value);
|
||||
};
|
||||
|
||||
// 分页相关
|
||||
const { pager, getLists, resetParams, resetPage } = usePaging({
|
||||
fetchFun: apiCustomLists,
|
||||
params: queryParams,
|
||||
});
|
||||
|
||||
getLists();
|
||||
</script>
|
@ -3,7 +3,7 @@
|
||||
|
||||
<template>
|
||||
<div class="detail-popup">
|
||||
<popup ref="popupRef" title="投标决策详情" :async="true" width="80%" @confirm="handleSubmit" @close="handleClose">
|
||||
<popup ref="popupRef" title="投标审查详情" :async="true" width="80%" @confirm="handleSubmit" @close="handleClose">
|
||||
<el-form ref="formRef" :model="formData" label-width="160px">
|
||||
<el-card class="mb-2">
|
||||
<el-row>
|
||||
@ -11,16 +11,12 @@
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item label="开标时间">
|
||||
{{ formData.bid_opening_dat }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="购买标书时间">
|
||||
{{ formData.buy_bid_document_date }}
|
||||
{{ formData.bid_opening_date }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item label="是否需要保证金">
|
||||
<dict-value :options="dictData.whether_status" :value="formData.is_need_deposit" />
|
||||
|
@ -133,7 +133,7 @@ const formData = reactive({
|
||||
//获取值
|
||||
const customEvent = (e: any) => {
|
||||
formData.buy_bidding_document_id = e.id;
|
||||
bidding_name.value = e.bid_company_name
|
||||
bidding_name.value = e.bid_document_no
|
||||
showDialog.value = false
|
||||
|
||||
};
|
||||
@ -145,6 +145,7 @@ const formRules = reactive<any>({
|
||||
|
||||
// 获取详情
|
||||
const setFormData = async (data: Record<any, any>) => {
|
||||
bidding_name.value = data.document.bid_document_no
|
||||
for (const key in formData) {
|
||||
if (data[key] != null && data[key] != undefined) {
|
||||
//@ts-ignore
|
||||
|
@ -139,10 +139,11 @@ const handleAdd = async () => {
|
||||
|
||||
// 编辑
|
||||
const handleEdit = async (data: any) => {
|
||||
let res = await apiBidDocumentExaminationDetail({ id: data.id })
|
||||
showEdit.value = true
|
||||
await nextTick()
|
||||
editRef.value?.open('edit')
|
||||
editRef.value?.setFormData(data)
|
||||
editRef.value?.setFormData(res)
|
||||
}
|
||||
|
||||
// 删除
|
||||
|
@ -1,34 +1,47 @@
|
||||
<template>
|
||||
<div class="edit-popup">
|
||||
<popup ref="popupRef" :title="popupTitle" :async="true" width="550px" @confirm="handleSubmit" @close="handleClose">
|
||||
<popup ref="popupRef" :title="popupTitle" :async="true" width="80%" @confirm="handleSubmit" @close="handleClose">
|
||||
<el-form ref="formRef" :model="formData" label-width="90px" :rules="formRules">
|
||||
<el-form-item label="标书审查id" prop="bid_document_examination_id" @click="showDialog = true">
|
||||
<el-input v-model="formData.bid_document_examination_id" clearable placeholder="请输入标书审查id" />
|
||||
</el-form-item>
|
||||
<el-form-item label="产品id" prop="product_id" @click="showDialog1 = true">
|
||||
<el-input v-model="formData.product_id" readonly 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="cost_unit_price">
|
||||
<el-input v-model="formData.cost_unit_price" 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="rate">
|
||||
<el-input v-model="formData.rate" clearable placeholder="请输入点数" />
|
||||
</el-form-item>
|
||||
<el-form-item label="报价单价" prop="unit_price">
|
||||
<el-input v-model="formData.unit_price" 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="create_user">
|
||||
<el-input v-model="formData.create_user" clearable placeholder="请输入" />
|
||||
</el-form-item>
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="项目名称" prop="bid_document_examination_id" :rules="[{ required: true, message: '不可为空', trigger: 'blur' }]" @click="showDialog = true">
|
||||
<el-input v-model="project_name" readonly clearable placeholder="请输入" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="项目编码" prop="bid_document_examination_id" :rules="[{ required: true, message: '不可为空', trigger: 'blur' }]">
|
||||
<el-input v-model="project_code" clearable readonly placeholder="请输入" />
|
||||
</el-form-item></el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="客户名称" prop="bid_document_examination_id" :rules="[{ required: true, message: '不可为空', trigger: 'blur' }]">
|
||||
<el-input v-model="matsname" clearable readonly placeholder="请输入" />
|
||||
</el-form-item></el-col><el-col :span="8">
|
||||
<!-- @click="showDialog1 = true" -->
|
||||
<el-form-item label="产品id" prop="product_id">
|
||||
<el-input v-model="formData.product_id" readonly clearable placeholder="请输入产品id" />
|
||||
</el-form-item></el-col><el-col :span="8">
|
||||
<el-form-item label="产品数量" prop="product_num">
|
||||
<el-input v-model="formData.product_num" clearable placeholder="请输入产品数量" />
|
||||
</el-form-item></el-col><el-col :span="8">
|
||||
<el-form-item label="成本单价" prop="cost_unit_price">
|
||||
<el-input v-model="formData.cost_unit_price" clearable placeholder="请输入成本单价" />
|
||||
</el-form-item></el-col><el-col :span="8">
|
||||
<el-form-item label="金额" prop="amount">
|
||||
<el-input v-model="formData.amount" clearable placeholder="请输入金额" />
|
||||
</el-form-item></el-col><el-col :span="8">
|
||||
<el-form-item label="点数" prop="rate">
|
||||
<el-input v-model="formData.rate" clearable placeholder="请输入点数" />
|
||||
</el-form-item></el-col><el-col :span="8">
|
||||
<el-form-item label="报价单价" prop="unit_price">
|
||||
<el-input v-model="formData.unit_price" clearable placeholder="请输入报价单价" />
|
||||
</el-form-item></el-col><el-col :span="8">
|
||||
<el-form-item label="报价金额" prop="total_amount">
|
||||
<el-input v-model="formData.total_amount" clearable placeholder="请输入报价金额" />
|
||||
</el-form-item></el-col><el-col :span="8">
|
||||
<el-form-item label="" prop="create_user">
|
||||
<el-input v-model="formData.create_user" clearable placeholder="请输入" />
|
||||
</el-form-item></el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</popup>
|
||||
<el-dialog v-model="showDialog" title="选择标书" width="70%">
|
||||
@ -56,12 +69,15 @@ defineProps({
|
||||
default: () => ({})
|
||||
}
|
||||
})
|
||||
const matsname = ref('')
|
||||
const project_name = ref('')
|
||||
const project_code = ref('')
|
||||
const emit = defineEmits(['success', 'close'])
|
||||
const formRef = shallowRef<FormInstance>()
|
||||
const popupRef = shallowRef<InstanceType<typeof Popup>>()
|
||||
const mode = ref('add')
|
||||
|
||||
|
||||
const showDialog = ref(false)
|
||||
const showDialog1 = ref(false)
|
||||
// 弹窗标题
|
||||
const popupTitle = computed(() => {
|
||||
return mode.value == 'edit' ? '编辑标书审查-报价明细' : '新增标书审查-报价明细'
|
||||
@ -89,17 +105,19 @@ const formRules = reactive<any>({
|
||||
|
||||
//获取值
|
||||
const customEvent = (e: any) => {
|
||||
formData.buy_bidding_document_id = e.id;
|
||||
|
||||
bidding_name.value = e.custom_name
|
||||
formData.bid_document_examination_id = e.id;
|
||||
matsname.value = e.person
|
||||
project_name.value = e.custom_name
|
||||
project_code.value = e.project_code
|
||||
showDialog.value = false;
|
||||
|
||||
|
||||
};
|
||||
//获取值
|
||||
const customEvent1 = (e: any) => {
|
||||
formData.buy_bidding_document_id = e.id;
|
||||
// formData.buy_bidding_document_id = e.id;
|
||||
|
||||
bidding_name.value = e.custom_name
|
||||
showDialog1.value = false;
|
||||
|
||||
|
||||
};
|
||||
|
@ -4,24 +4,30 @@
|
||||
<el-form ref="formRef" :model="formData" label-width="140px" :rules="formRules">
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="客户id" prop="customer_id" @click="showDialog = true">
|
||||
<el-input v-model="custom_name_" clearable placeholder="请输入客户id" />
|
||||
<el-form-item label="客户" prop="customer_id" @click="showDialog = true" :rules="[{ required: true, message: '不可为空', trigger: 'blur' }]">
|
||||
<el-input v-model="custom_name" readonly clearable placeholder="请选择客户" />
|
||||
</el-form-item> </el-col><el-col :span="8">
|
||||
<el-form-item label="购买标书id" prop="buy_bidding_document_id">
|
||||
<el-input v-model="formData.buy_bidding_document_id" clearable placeholder="请输入购买标书id" />
|
||||
<el-form-item label="投标编号" prop="buy_bidding_document_id" @click="showDialog1 = true" :rules="[{ required: true, message: '不可为空', trigger: 'blur' }]">
|
||||
<el-input v-model="bidding_code" readonly clearable placeholder="请选择购买标书" />
|
||||
</el-form-item></el-col><el-col :span="8">
|
||||
<el-form-item label="合同名称" prop="contract_name">
|
||||
<el-form-item label="项目名称" prop="buy_bidding_document_id" :rules="[{ required: true, message: '不可为空', trigger: 'blur' }]">
|
||||
<el-input v-model="document_name" readonly clearable placeholder="请选择购买标书" />
|
||||
</el-form-item></el-col><el-col :span="8">
|
||||
<el-form-item label="项目编码" prop="buy_bidding_document_id" :rules="[{ required: true, message: '不可为空', trigger: 'blur' }]">
|
||||
<el-input v-model="document_code" readonly clearable placeholder="请选择购买标书" />
|
||||
</el-form-item></el-col><el-col :span="8">
|
||||
<el-form-item label="合同名称" prop="contract_name" :rules="[{ required: true, message: '不可为空', trigger: 'blur' }]">
|
||||
<el-input v-model="formData.contract_name" clearable placeholder="请输入合同名称" />
|
||||
</el-form-item></el-col><el-col :span="8">
|
||||
<el-form-item label="合同编号" prop="contract_code">
|
||||
<el-form-item label="合同编号" prop="contract_code" :rules="[{ required: true, message: '不可为空', trigger: 'blur' }]">
|
||||
<el-input v-model="formData.contract_code" clearable placeholder="请输入合同编号" />
|
||||
</el-form-item></el-col><el-col :span="8">
|
||||
<el-form-item label="合同类型" prop="contract_type">
|
||||
<el-form-item label="合同类型" prop="contract_type" :rules="[{ required: true, message: '不可为空', trigger: 'change' }]">
|
||||
<el-select class="flex-1" v-model="formData.contract_type" clearable placeholder="请选择合同类型">
|
||||
<el-option v-for="(item, index) in dictData.contract_type" :key="index" :label="item.name" :value="parseInt(item.value)" />
|
||||
</el-select>
|
||||
</el-form-item></el-col><el-col :span="8">
|
||||
<el-form-item label="合同计价方式" prop="contract_pricing_method">
|
||||
<el-form-item label="合同计价方式" prop="contract_pricing_method" :rules="[{ required: true, message: '不可为空', trigger: 'change' }]">
|
||||
<el-select class="flex-1" v-model="formData.contract_pricing_method" clearable placeholder="请选择合同计价方式">
|
||||
<el-option v-for="(item, index) in dictData.contract_pricing_method" :key="index" :label="item.name" :value="parseInt(item.value)" />
|
||||
</el-select>
|
||||
@ -44,7 +50,7 @@
|
||||
<el-form-item label="甲方邮箱" prop="party_a_email">
|
||||
<el-input v-model="formData.party_a_email" clearable placeholder="请输入甲方邮箱" />
|
||||
</el-form-item></el-col><el-col :span="8">
|
||||
<el-form-item label="乙方" prop="party_b">
|
||||
<el-form-item label="乙方" prop="party_b" :rules="[{ required: true, message: '不可为空', trigger: 'blur' }]">
|
||||
<el-input v-model="formData.party_b" clearable placeholder="请输入乙方" />
|
||||
</el-form-item></el-col><el-col :span="8">
|
||||
<el-form-item label="乙方通讯地址" prop="party_b_contact_address">
|
||||
@ -114,6 +120,10 @@
|
||||
|
||||
|
||||
|
||||
</el-dialog>
|
||||
<el-dialog v-model="showDialog1" title="选择标书" width="70%">
|
||||
<biddocumentTable @customEvent="customEvent1"></biddocumentTable>
|
||||
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
@ -121,6 +131,7 @@
|
||||
<script lang="ts" setup name="contractEdit">
|
||||
import type { FormInstance } from 'element-plus'
|
||||
import Popup from '@/components/popup/index.vue'
|
||||
import biddocumentTable from "@/components/biddocument/index.vue"
|
||||
import { apiContractAdd, apiContractEdit, apiContractDetail } from '@/api/contract'
|
||||
import { timeFormat } from '@/utils/util'
|
||||
import type { PropType } from 'vue'
|
||||
@ -139,7 +150,11 @@ import configs from "@/config"
|
||||
const base_url = configs.baseUrl + configs.urlPrefix
|
||||
import useUserStore from "@/stores/modules/user";
|
||||
const showDialog = ref(false)
|
||||
const showDialog1 = ref(false)
|
||||
const custom_name = ref('')
|
||||
const document_name = ref('')
|
||||
const document_code = ref('')
|
||||
const bidding_code = ref('')
|
||||
const userStore = useUserStore();
|
||||
// 上传文件
|
||||
const handleAvatarSuccess_four = (
|
||||
@ -160,11 +175,21 @@ const delFileFn = (index: number) => {
|
||||
formDataannex.splice(index, 1)
|
||||
}
|
||||
|
||||
//获取值
|
||||
const customEvent = (e: any) => {
|
||||
formData.customer_id = e.id;
|
||||
custom_name.value = e.name;
|
||||
console.log(custom_name.value, e.name)
|
||||
showDialog.value = false;
|
||||
};
|
||||
const customEvent1 = (e: any) => {
|
||||
formData.buy_bidding_document_id = e.id;
|
||||
document_name.value = e.bid_company_name
|
||||
document_code.value = e.bid_document_no
|
||||
bidding_code.value = e.bid_document_no
|
||||
|
||||
showDialog1.value = false;
|
||||
};
|
||||
|
||||
// 弹窗标题
|
||||
const popupTitle = computed(() => {
|
||||
@ -173,6 +198,7 @@ const popupTitle = computed(() => {
|
||||
|
||||
// 表单数据
|
||||
const formData = reactive({
|
||||
id: '',
|
||||
approve_id: '',
|
||||
customer_id: '',
|
||||
buy_bidding_document_id: '',
|
||||
@ -212,13 +238,17 @@ 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]
|
||||
}
|
||||
}
|
||||
|
||||
custom_name.value = data.custom.name
|
||||
document_name.value = data.document.bid_company_name
|
||||
document_code.value = data.document.bid_document_no
|
||||
bidding_code.value = data.document.bid_document_no
|
||||
|
||||
}
|
||||
|
||||
|
@ -30,10 +30,10 @@
|
||||
<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="customer_id" show-overflow-tooltip />
|
||||
<el-table-column label="审批id" prop="approve_id" show-overflow-tooltip />
|
||||
<el-table-column label="购买标书id" prop="buy_bidding_document_id" show-overflow-tooltip />
|
||||
<el-table-column label="合同名称" prop="contract_name" show-overflow-tooltip />
|
||||
<el-table-column label="项目名称" prop="buy_bidding_document_id" show-overflow-tooltip />
|
||||
|
||||
<el-table-column label="合同编号" prop="contract_code" show-overflow-tooltip />
|
||||
<el-table-column label="合同类型" prop="contract_type">
|
||||
<template #default="{ row }">
|
||||
@ -124,10 +124,13 @@ const handleAdd = async () => {
|
||||
|
||||
// 编辑
|
||||
const handleEdit = async (data: any) => {
|
||||
let res = await apiContractDetail({
|
||||
id: data.id
|
||||
})
|
||||
showEdit.value = true
|
||||
await nextTick()
|
||||
editRef.value?.open('edit')
|
||||
editRef.value?.setFormData(data)
|
||||
editRef.value?.setFormData(res)
|
||||
}
|
||||
|
||||
// 删除
|
||||
|
@ -1,80 +1,92 @@
|
||||
<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="contract_id">
|
||||
<el-input v-model="formData.contract_id" clearable placeholder="请输入合同id" />
|
||||
</el-form-item>
|
||||
<el-form-item label="审批id" prop="approve_id">
|
||||
<el-input v-model="formData.approve_id" clearable placeholder="请输入审批id" />
|
||||
</el-form-item>
|
||||
<el-form-item label="洽商单名称" prop="negotiation_name">
|
||||
<el-input v-model="formData.negotiation_name" clearable placeholder="请输入洽商单名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="洽商编号" prop="negotiation_no">
|
||||
<el-input v-model="formData.negotiation_no" clearable placeholder="请输入洽商编号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="洽商金额" prop="negotiation_amount">
|
||||
<el-input v-model="formData.negotiation_amount" clearable placeholder="请输入洽商金额" />
|
||||
</el-form-item>
|
||||
<el-form-item label="洽商类别" prop="negotiation_type">
|
||||
<el-radio-group v-model="formData.negotiation_type" placeholder="请选择洽商类别">
|
||||
<el-radio
|
||||
v-for="(item, index) in dictData.negotiation_type"
|
||||
:key="index"
|
||||
:label="parseInt(item.value)"
|
||||
>
|
||||
{{ item.name }}
|
||||
</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="成本金额(人工)" prop="labor_costs">
|
||||
<el-input v-model="formData.labor_costs" clearable placeholder="请输入成本金额(人工)" />
|
||||
</el-form-item>
|
||||
<el-form-item label="成本金额(材料" prop="material_costs">
|
||||
<el-input v-model="formData.material_costs" clearable placeholder="请输入成本金额(材料" />
|
||||
</el-form-item>
|
||||
<el-form-item label="洽商质保金额" prop="warranty_amount">
|
||||
<el-input v-model="formData.warranty_amount" clearable placeholder="请输入洽商质保金额" />
|
||||
</el-form-item>
|
||||
<el-form-item label="洽商质保到期时间" prop="Warranty_expire_date">
|
||||
<el-date-picker
|
||||
class="flex-1 !flex"
|
||||
v-model="formData.Warranty_expire_date"
|
||||
clearable
|
||||
type="datetime"
|
||||
value-format="YYYY-MM-DD HH:mm:ss"
|
||||
placeholder="选择洽商质保到期时间">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="利润" prop="profit">
|
||||
<el-input v-model="formData.profit" clearable placeholder="请输入利润" />
|
||||
</el-form-item>
|
||||
<el-form-item label="利润率" prop="profit_rate">
|
||||
<el-input v-model="formData.profit_rate" clearable placeholder="请输入利润率" />
|
||||
</el-form-item>
|
||||
<el-form-item label="洽商内容" prop="negotiation_content">
|
||||
<el-input v-model="formData.negotiation_content" clearable placeholder="请输入洽商内容" />
|
||||
</el-form-item>
|
||||
<el-form-item label="具体说明" prop="negotiation_detail">
|
||||
<el-input v-model="formData.negotiation_detail" clearable placeholder="请输入具体说明" />
|
||||
</el-form-item>
|
||||
<el-form-item label="签证报价表" prop="negotiation_quotation">
|
||||
<el-input v-model="formData.negotiation_quotation" clearable placeholder="请输入签证报价表" />
|
||||
</el-form-item>
|
||||
<el-form-item label="洽商依据" prop="negotiation_basis">
|
||||
<el-input v-model="formData.negotiation_basis" clearable placeholder="请输入洽商依据" />
|
||||
</el-form-item>
|
||||
<popup ref="popupRef" :title="popupTitle" :async="true" width="80%" @confirm="handleSubmit" @close="handleClose">
|
||||
<el-form ref="formRef" :model="formData" label-width="160px" :rules="formRules">
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="合同名称" prop="contract_id" @click="showDialog = true">
|
||||
<el-input v-model="contract_name" readonly clearable placeholder="请选择合同" :rules="[{ required: true, message: '不可为空', trigger: 'blur' }]" />
|
||||
</el-form-item></el-col><el-col :span="8">
|
||||
<el-form-item label="合同编号" prop="contract_id" @click="showDialog = true">
|
||||
<el-input v-model="contract_name" readonly clearable placeholder="请选择合同" :rules="[{ required: true, message: '不可为空', trigger: 'blur' }]" />
|
||||
</el-form-item></el-col><el-col :span="8">
|
||||
<el-form-item label="项目名称" prop="contract_id" @click="showDialog = true">
|
||||
<el-input v-model="contract_name" readonly clearable placeholder="请选择合同" :rules="[{ required: true, message: '不可为空', trigger: 'blur' }]" />
|
||||
</el-form-item></el-col><el-col :span="8">
|
||||
<el-form-item label="客户名称" prop="contract_id" @click="showDialog = true">
|
||||
<el-input v-model="contract_name" readonly clearable placeholder="请选择合同" :rules="[{ required: true, message: '不可为空', trigger: 'blur' }]" />
|
||||
</el-form-item></el-col><el-col :span="8">
|
||||
<el-form-item label="合同类型" prop="contract_id" @click="showDialog = true">
|
||||
<el-input v-model="contract_name" readonly clearable placeholder="请选择合同" :rules="[{ required: true, message: '不可为空', trigger: 'blur' }]" />
|
||||
</el-form-item></el-col><el-col :span="8">
|
||||
<el-form-item label="合同计价方式" prop="contract_id" @click="showDialog = true">
|
||||
<el-input v-model="contract_name" readonly clearable placeholder="请选择合同" :rules="[{ required: true, message: '不可为空', trigger: 'blur' }]" />
|
||||
</el-form-item></el-col><el-col :span="8">
|
||||
<el-form-item label="业务负责人" prop="contract_id" @click="showDialog = true">
|
||||
<el-input v-model="contract_name" readonly clearable placeholder="请选择合同" :rules="[{ required: true, message: '不可为空', trigger: 'blur' }]" />
|
||||
</el-form-item></el-col><el-col :span="8">
|
||||
|
||||
<el-form-item label="审批id" prop="approve_id">
|
||||
<el-input v-model="formData.approve_id" clearable placeholder="请输入审批id" />
|
||||
</el-form-item></el-col><el-col :span="8">
|
||||
<el-form-item label="洽商单名称" prop="negotiation_name">
|
||||
<el-input v-model="formData.negotiation_name" clearable placeholder="请输入洽商单名称" />
|
||||
</el-form-item></el-col><el-col :span="8">
|
||||
<el-form-item label="洽商编号" prop="negotiation_no">
|
||||
<el-input v-model="formData.negotiation_no" clearable placeholder="请输入洽商编号" />
|
||||
</el-form-item></el-col><el-col :span="8">
|
||||
<el-form-item label="洽商金额" prop="negotiation_amount">
|
||||
<el-input v-model="formData.negotiation_amount" clearable placeholder="请输入洽商金额" />
|
||||
</el-form-item></el-col><el-col :span="24">
|
||||
<el-form-item label="洽商类别" prop="negotiation_type">
|
||||
<el-radio-group v-model="formData.negotiation_type" placeholder="请选择洽商类别">
|
||||
<el-radio v-for="(item, index) in dictData.negotiation_type" :key="index" :label="parseInt(item.value)">
|
||||
{{ item.name }}
|
||||
</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item></el-col><el-col :span="8">
|
||||
<el-form-item label="成本金额(人工)" prop="labor_costs">
|
||||
<el-input v-model="formData.labor_costs" clearable placeholder="请输入成本金额(人工)" />
|
||||
</el-form-item></el-col><el-col :span="8">
|
||||
<el-form-item label="成本金额(材料" prop="material_costs">
|
||||
<el-input v-model="formData.material_costs" clearable placeholder="请输入成本金额(材料" />
|
||||
</el-form-item></el-col><el-col :span="8">
|
||||
<el-form-item label="洽商质保金额" prop="warranty_amount">
|
||||
<el-input v-model="formData.warranty_amount" clearable placeholder="请输入洽商质保金额" />
|
||||
</el-form-item></el-col><el-col :span="8">
|
||||
<el-form-item label="洽商质保到期时间" prop="Warranty_expire_date">
|
||||
<el-date-picker class="flex-1 !flex" v-model="formData.Warranty_expire_date" clearable type="datetime" value-format="YYYY-MM-DD HH:mm:ss" placeholder="选择洽商质保到期时间">
|
||||
</el-date-picker>
|
||||
</el-form-item></el-col><el-col :span="8">
|
||||
|
||||
<el-form-item label="利润" prop="profit">
|
||||
<el-input v-model="formData.profit" clearable placeholder="请输入利润" />
|
||||
</el-form-item></el-col><el-col :span="8">
|
||||
<el-form-item label="利润率" prop="profit_rate">
|
||||
<el-input v-model="formData.profit_rate" clearable placeholder="请输入利润率" />
|
||||
</el-form-item></el-col><el-col :span="8">
|
||||
<el-form-item label="洽商内容" prop="negotiation_content">
|
||||
<el-input v-model="formData.negotiation_content" clearable placeholder="请输入洽商内容" />
|
||||
</el-form-item></el-col><el-col :span="8">
|
||||
<el-form-item label="具体说明" prop="negotiation_detail">
|
||||
<el-input v-model="formData.negotiation_detail" clearable placeholder="请输入具体说明" />
|
||||
</el-form-item></el-col><el-col :span="8">
|
||||
<el-form-item label="签证报价表" prop="negotiation_quotation">
|
||||
<el-input v-model="formData.negotiation_quotation" clearable placeholder="请输入签证报价表" />
|
||||
</el-form-item></el-col><el-col :span="8">
|
||||
<el-form-item label="洽商依据" prop="negotiation_basis">
|
||||
<el-input v-model="formData.negotiation_basis" clearable placeholder="请输入洽商依据" />
|
||||
</el-form-item></el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</popup>
|
||||
<el-dialog v-model="showDialog" title="选择客户" width="70%">
|
||||
|
||||
<proontractTable @customEvent="customEvent"></proontractTable>
|
||||
|
||||
|
||||
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@ -83,6 +95,7 @@ import type { FormInstance } from 'element-plus'
|
||||
import Popup from '@/components/popup/index.vue'
|
||||
import { apiContractNegotiationAdd, apiContractNegotiationEdit, apiContractNegotiationDetail } from '@/api/contract_negotiation'
|
||||
import { timeFormat } from '@/utils/util'
|
||||
import proontractTable from "@/components/proontract/index.vue"
|
||||
import type { PropType } from 'vue'
|
||||
defineProps({
|
||||
dictData: {
|
||||
@ -94,8 +107,8 @@ const emit = defineEmits(['success', 'close'])
|
||||
const formRef = shallowRef<FormInstance>()
|
||||
const popupRef = shallowRef<InstanceType<typeof Popup>>()
|
||||
const mode = ref('add')
|
||||
|
||||
|
||||
const showDialog = ref(false)
|
||||
const contract_name = ref('')
|
||||
// 弹窗标题
|
||||
const popupTitle = computed(() => {
|
||||
return mode.value == 'edit' ? '编辑合同洽商' : '新增合同洽商'
|
||||
@ -122,10 +135,14 @@ const formData = reactive({
|
||||
negotiation_basis: '',
|
||||
})
|
||||
|
||||
|
||||
//获取值
|
||||
const customEvent = (e: any) => {
|
||||
formData.contract_id = e.id;
|
||||
contract_name.value = e.contract_name;
|
||||
showDialog.value = false;
|
||||
};
|
||||
// 表单验证
|
||||
const formRules = reactive<any>({
|
||||
|
||||
})
|
||||
|
||||
|
||||
@ -137,9 +154,9 @@ const setFormData = async (data: Record<any, any>) => {
|
||||
formData[key] = data[key]
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//@ts-ignore
|
||||
formData.Warranty_expire_date = timeFormat(formData.Warranty_expire_date,'yyyy-mm-dd hh:MM:ss')
|
||||
formData.Warranty_expire_date = timeFormat(formData.Warranty_expire_date, 'yyyy-mm-dd hh:MM:ss')
|
||||
}
|
||||
|
||||
const getDetail = async (row: Record<string, any>) => {
|
||||
@ -153,9 +170,9 @@ const getDetail = async (row: Record<string, any>) => {
|
||||
// 提交按钮
|
||||
const handleSubmit = async () => {
|
||||
await formRef.value?.validate()
|
||||
const data = { ...formData, }
|
||||
mode.value == 'edit'
|
||||
? await apiContractNegotiationEdit(data)
|
||||
const data = { ...formData, }
|
||||
mode.value == 'edit'
|
||||
? await apiContractNegotiationEdit(data)
|
||||
: await apiContractNegotiationAdd(data)
|
||||
popupRef.value?.close()
|
||||
emit('success')
|
||||
|
181
src/views/procurement_contract/detail.vue
Normal file
181
src/views/procurement_contract/detail.vue
Normal file
@ -0,0 +1,181 @@
|
||||
|
||||
<template>
|
||||
<div class="detail-popup">
|
||||
<popup ref="popupRef" title="采购合同详情" :async="true" width="80%" @confirm="handleSubmit" @close="handleClose">
|
||||
<el-form ref="formRef" :model="formData" label-width="120px">
|
||||
<el-card class="mb-2">
|
||||
<el-row>
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item label="项目名称">
|
||||
{{ formData.project_name }}
|
||||
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="客户名称">
|
||||
{{ formData.custom_name }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="合同编号">
|
||||
{{ formData.supplier_contract_no }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="供应商合同号">
|
||||
|
||||
{{ formData.supplier_contract_no }}
|
||||
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item label="合同类型">
|
||||
<dict-value :options="dictData.procurement_contract_type" :value="formData.contract_type" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="签订日期">
|
||||
{{ formData.signing_date }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="付款方式">
|
||||
<dict-value :options="dictData.pay_type" :value="formData.pay_type" />
|
||||
</el-form-item>
|
||||
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="账期">
|
||||
<dict-value :options="dictData.account_period" :value="formData.account_period" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item label="合同金额">
|
||||
{{ formData.amount }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="不含税金额">
|
||||
{{ formData.amount_excluding_tax }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item label="金额大写">
|
||||
{{ formData.amount_daxie }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="合同金额">
|
||||
{{ formData.amount }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="质保金比例">
|
||||
{{ formData.retention_money_rate }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="质保金">
|
||||
{{ formData.retention_money }}
|
||||
</el-form-item>
|
||||
</el-col> <el-col :span="12">
|
||||
<el-form-item label="备注">
|
||||
{{ formData.remark }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
</el-row>
|
||||
</el-card>
|
||||
</el-form>
|
||||
</popup>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup name="customdetail">
|
||||
|
||||
import type { FormInstance } from 'element-plus'
|
||||
import Popup from '@/components/popup/index.vue'
|
||||
import { apiCustomDetail } from '@/api/custom'
|
||||
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 datas = reactive({
|
||||
provinceOptions: [],
|
||||
cityOptions: [],
|
||||
areaOptions: [],
|
||||
});
|
||||
|
||||
|
||||
// 表单数据
|
||||
const formData = reactive({
|
||||
|
||||
})
|
||||
|
||||
|
||||
|
||||
// 获取详情
|
||||
const setFormData = async (data: Record<any, any>) => {
|
||||
Object.assign(formData, data)
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
const getDetail = async (row: Record<string, any>) => {
|
||||
const data = await apiCustomDetail({
|
||||
id: row.id
|
||||
})
|
||||
setFormData(data)
|
||||
}
|
||||
|
||||
|
||||
// 提交按钮
|
||||
const handleSubmit = async () => {
|
||||
popupRef.value?.close()
|
||||
|
||||
}
|
||||
|
||||
//打开弹窗
|
||||
const open = () => {
|
||||
console.log('1111111')
|
||||
popupRef.value?.open()
|
||||
}
|
||||
|
||||
// 关闭回调
|
||||
const handleClose = () => {
|
||||
emit('close')
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
defineExpose({
|
||||
open,
|
||||
setFormData,
|
||||
getDetail
|
||||
})
|
||||
</script>
|
||||
<style lang="scss">
|
||||
.tit {
|
||||
font-size: 1.2em;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
</style>
|
@ -1,102 +1,215 @@
|
||||
<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="supplier_id">
|
||||
<el-input v-model="formData.supplier_id" clearable placeholder="请输入供应商id" />
|
||||
</el-form-item>
|
||||
<el-form-item label="审批id" prop="approve_id">
|
||||
<el-input v-model="formData.approve_id" clearable placeholder="请输入审批id" />
|
||||
</el-form-item>
|
||||
<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="contract_no">
|
||||
<el-input v-model="formData.contract_no" clearable placeholder="请输入合同编号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="供应商合同号" prop="supplier_contract_no">
|
||||
<el-input v-model="formData.supplier_contract_no" clearable placeholder="请输入供应商合同号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="合同类型" prop="contract_type">
|
||||
<el-radio-group v-model="formData.contract_type" placeholder="请选择合同类型">
|
||||
<el-radio
|
||||
v-for="(item, index) in dictData.procurement_contract_type"
|
||||
:key="index"
|
||||
:label="parseInt(item.value)"
|
||||
>
|
||||
{{ item.name }}
|
||||
</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="签订日期" prop="signing_date">
|
||||
<el-date-picker
|
||||
class="flex-1 !flex"
|
||||
v-model="formData.signing_date"
|
||||
clearable
|
||||
type="datetime"
|
||||
value-format="YYYY-MM-DD HH:mm:ss"
|
||||
placeholder="选择签订日期">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="付款方式" prop="pay_type">
|
||||
<el-radio-group v-model="formData.pay_type" placeholder="请选择付款方式">
|
||||
<el-radio
|
||||
v-for="(item, index) in dictData.pay_type"
|
||||
:key="index"
|
||||
:label="parseInt(item.value)"
|
||||
>
|
||||
{{ item.name }}
|
||||
</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="账期" prop="account_period">
|
||||
<el-radio-group v-model="formData.account_period" placeholder="请选择账期">
|
||||
<el-radio
|
||||
v-for="(item, index) in dictData.account_period"
|
||||
:key="index"
|
||||
:label="parseInt(item.value)"
|
||||
>
|
||||
{{ item.name }}
|
||||
</el-radio>
|
||||
</el-radio-group>
|
||||
</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="amount_excluding_tax">
|
||||
<el-input v-model="formData.amount_excluding_tax" clearable placeholder="请输入不含税金额" />
|
||||
</el-form-item>
|
||||
<el-form-item label="金额大写" prop="amount_daxie">
|
||||
<el-input v-model="formData.amount_daxie" clearable placeholder="请输入金额大写" />
|
||||
</el-form-item>
|
||||
<el-form-item label="质保金比例" prop="retention_money_rate">
|
||||
<el-input v-model="formData.retention_money_rate" clearable placeholder="请输入质保金比例" />
|
||||
</el-form-item>
|
||||
<el-form-item label="质保金" prop="retention_money">
|
||||
<el-input v-model="formData.retention_money" 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>
|
||||
<popup ref="popupRef" :title="popupTitle" :async="true" width="80%" @confirm="handleSubmit" @close="handleClose">
|
||||
<el-form ref="formRef" :model="formData" label-width="120px" :rules="formRules">
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="供应商名称" prop="supplier_id" :rules="[{ required: true, message: '不可为空', trigger: 'blur' }]">
|
||||
<el-input v-model="formData.supplier_id" clearable placeholder="请输入供应商id" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="供应商编码" prop="supplier_id" :rules="[{ required: true, message: '不可为空', trigger: 'blur' }]">
|
||||
<el-input v-model="formData.supplier_id" clearable placeholder="请输入供应商id" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="审批id" prop="approve_id">
|
||||
<el-input v-model="formData.approve_id" clearable placeholder="请输入审批id" />
|
||||
</el-form-item> </el-col> <el-col :span="8">
|
||||
<el-form-item label="项目名称" prop="project_id" @click="showDialog = true" :rules="[{ required: true, message: '不可为空', trigger: 'blur' }]">
|
||||
<el-input v-model="project_name" readonly clearable placeholder="请输入项目id" />
|
||||
</el-form-item> </el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="项目编码" prop="project_id" :rules="[{ required: true, message: '不可为空', trigger: 'blur' }]">
|
||||
<el-input v-model="project_code" readonly clearable placeholder="请输入项目id" />
|
||||
</el-form-item> </el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="合同编号" prop="contract_no">
|
||||
<el-input v-model="formData.contract_no" clearable placeholder="请输入合同编号" />
|
||||
</el-form-item> </el-col> <el-col :span="8">
|
||||
<el-form-item label="供应商合同号" prop="supplier_contract_no">
|
||||
<el-input v-model="formData.supplier_contract_no" clearable placeholder="请输入供应商合同号" />
|
||||
</el-form-item> </el-col> <el-col :span="24">
|
||||
<el-form-item label="合同类型" prop="contract_type">
|
||||
<el-radio-group v-model="formData.contract_type" placeholder="请选择合同类型" :rules="[{ required: true, message: '不可为空', trigger: 'blur' }]">
|
||||
<el-radio v-for="(item, index) in dictData.procurement_contract_type" :key="index" :label="parseInt(item.value)">
|
||||
{{ item.name }}
|
||||
</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item> </el-col> <el-col :span="8">
|
||||
<el-form-item label="签订日期" prop="signing_date" :rules="[{ required: true, message: '不可为空', trigger: 'blur' }]">
|
||||
<el-date-picker class="flex-1 !flex" v-model="formData.signing_date" clearable type="datetime" value-format="YYYY-MM-DD HH:mm:ss" placeholder="选择签订日期">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col> <el-col :span="24">
|
||||
<el-form-item label="付款方式" prop="pay_type">
|
||||
<el-radio-group v-model="formData.pay_type" placeholder="请选择付款方式">
|
||||
<el-radio v-for="(item, index) in dictData.pay_type" :key="index" :label="parseInt(item.value)">
|
||||
{{ item.name }}
|
||||
</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item> </el-col> <el-col :span="24">
|
||||
<el-form-item label="账期" prop="account_period">
|
||||
<el-radio-group v-model="formData.account_period" placeholder="请选择账期">
|
||||
<el-radio v-for="(item, index) in dictData.account_period" :key="index" :label="parseInt(item.value)">
|
||||
{{ item.name }}
|
||||
</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item> </el-col> <el-col :span="8">
|
||||
<el-form-item label="合同金额" prop="amount">
|
||||
<el-input v-model="formData.amount" clearable placeholder="请输入合同金额" />
|
||||
</el-form-item> </el-col> <el-col :span="8">
|
||||
<el-form-item label="不含税金额" prop="amount_excluding_tax">
|
||||
<el-input v-model="formData.amount_excluding_tax" clearable placeholder="请输入不含税金额" />
|
||||
</el-form-item> </el-col> <el-col :span="8">
|
||||
<el-form-item label="金额大写" prop="amount_daxie" :rules="[{ required: true, message: '不可为空', trigger: 'blur' }]">
|
||||
<el-input v-model="formData.amount_daxie" clearable placeholder="请输入金额大写" />
|
||||
</el-form-item> </el-col> <el-col :span="8">
|
||||
<el-form-item label="质保金比例" prop="retention_money_rate">
|
||||
<el-input v-model="formData.retention_money_rate" clearable placeholder="请输入质保金比例" />
|
||||
</el-form-item> </el-col> <el-col :span="8">
|
||||
<el-form-item label="质保金" prop="retention_money" :rules="[{ required: true, message: '不可为空', trigger: 'blur' }]">
|
||||
<el-input v-model="formData.retention_money" clearable placeholder="请输入质保金" />
|
||||
</el-form-item> </el-col> <el-col :span="8">
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="formData.remark" clearable placeholder="请输入备注" />
|
||||
</el-form-item> </el-col> <el-col :span="8">
|
||||
<el-form-item label="附件" prop="field127">
|
||||
<el-upload accept=".pdf" class="upload-demo" :show-file-list="false" aria-hidden="true" :headers="{ Token: userStore.token }" :action="base_url + '/upload/file'" :on-success="handleAvatarSuccess_four" ref="upload">
|
||||
<el-button type="primary">
|
||||
上传
|
||||
</el-button>
|
||||
</el-upload>
|
||||
|
||||
<div>
|
||||
<div v-for="(item, index) in formDataannex" style="margin-left: 5px;display: block;">
|
||||
<a style="margin-left: 10px; color: #4a5dff; align-self: flex-start" :href="item.uri" target="_blank">{{ item.name }}</a>
|
||||
<span style="cursor: pointer;margin-left: 5px;" @click="delFileFn(index)">x</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</el-form-item></el-col>
|
||||
<el-col :span="24">
|
||||
<div style="margin-bottom: 30px;">采购合同明细</div>
|
||||
<div style="margin-bottom: 30px;">
|
||||
<el-table :data="formData.material">
|
||||
<el-table-column label="序号">
|
||||
<template #default="{ row }">
|
||||
<el-button @click="handleAdd1(row)">+</el-button>
|
||||
<el-button @click="handleDelete1(row)">-</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="采购申请单号" prop="material_procurement_application_id">
|
||||
<template #default="{ row }">
|
||||
<el-input v-model="row.material_procurement_application_id" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="材料名称" prop="material_procurement_application_id">
|
||||
<template #default="{ row }"> <el-input v-model="row.material_procurement_application_id" /> </template></el-table-column>
|
||||
<el-table-column label="材料编码" prop="material_procurement_application_id">
|
||||
<template #default="{ row }"> <el-input v-model="row.material_procurement_application_id" /> </template></el-table-column>
|
||||
|
||||
<el-table-column label="规格型号" prop="material_procurement_application_id">
|
||||
<template #default="{ row }">
|
||||
<el-input v-model="row.material_procurement_application_id" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
|
||||
<el-table-column label="数量" prop="product_num">
|
||||
<template #default="{ row }">
|
||||
<el-input v-model="row.product_num" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="单位" prop="tax_rate">
|
||||
<template #default="{ row }">
|
||||
<el-input v-model="row.tax_rate" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="数量" prop="num">
|
||||
<template #default="{ row }">
|
||||
<el-input v-model="row.num" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="含税单价" prop="unit_price_including_tax">
|
||||
<template #default="{ row }">
|
||||
<el-input v-model="row.unit_price_including_tax" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="税率" prop="tax_rate">
|
||||
<template #default="{ row }">
|
||||
<el-input v-model="row.tax_rate" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="不含税金额" prop="amount_excluding_tax">
|
||||
<template #default="{ row }">
|
||||
<el-input v-model="row.amount_excluding_tax" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="含税金额" prop="amount_including_tax">
|
||||
<template #default="{ row }">
|
||||
<el-input v-model="row.amount_including_tax" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
</el-table>
|
||||
</div>
|
||||
<div style="margin-bottom: 30px;">付款计划</div>
|
||||
<div style="margin-bottom: 30px;">
|
||||
<el-table :data="formData.pay_plan">
|
||||
<el-table-column label="序号">
|
||||
<template #default="{ row }">
|
||||
<el-button @click="handleAdd(row)">+</el-button>
|
||||
<el-button @click="handleDelete(row)">-</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="期次" prop="name1">
|
||||
<template #default="{ row }">
|
||||
<el-select v-model="row.period" clearable placeholder="请选择期次">
|
||||
<el-option v-for="(item, index) in dictData.pay_period " :key="index" :label="item.name" :value="item.id" />
|
||||
</el-select>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="计划付款日期" prop="pay_date">
|
||||
<template #default="{ row }">
|
||||
<el-date-picker v-model="row.pay_date" clearable type="datetime" value-format="YYYY-MM-DD HH:mm:ss" placeholder="选择签订日期">
|
||||
</el-date-picker>
|
||||
</template></el-table-column>
|
||||
<el-table-column label="金额" prop="pay_amount">
|
||||
<template #default="{ row }"> <el-input v-model="row.pay_amount" /> </template></el-table-column>
|
||||
|
||||
<el-table-column label="备注" prop="remark">
|
||||
<template #default="{ row }">
|
||||
<el-input v-model="row.remark" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
</el-col>
|
||||
|
||||
</el-row>
|
||||
</el-form>
|
||||
</popup>
|
||||
<el-dialog v-model="showDialog" title="选择项目" width="70%">
|
||||
<projectTable @customEvent="customEvent"></projectTable>
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog v-model="showDialog1" title="选择供应商" width="70%">
|
||||
<suppliertable @customEvent="customEvent1"></suppliertable>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup name="procurementContractEdit">
|
||||
import type { FormInstance } from 'element-plus'
|
||||
import Popup from '@/components/popup/index.vue'
|
||||
import projectTable from '@/components/project/index.vue'
|
||||
import suppliertable from '@/components/supplier/index.vue'
|
||||
import { apiProcurementContractAdd, apiProcurementContractEdit, apiProcurementContractDetail } from '@/api/procurement_contract'
|
||||
import { timeFormat } from '@/utils/util'
|
||||
import type { PropType } from 'vue'
|
||||
@ -110,8 +223,56 @@ const emit = defineEmits(['success', 'close'])
|
||||
const formRef = shallowRef<FormInstance>()
|
||||
const popupRef = shallowRef<InstanceType<typeof Popup>>()
|
||||
const mode = ref('add')
|
||||
const showDialog = ref(false)
|
||||
const showDialog1 = ref(false)
|
||||
const project_name = ref('')
|
||||
const project_code = ref('')
|
||||
const formDataannex = reactive([])
|
||||
import feedback from '@/utils/feedback'
|
||||
import configs from "@/config"
|
||||
const base_url = configs.baseUrl + configs.urlPrefix
|
||||
import useUserStore from "@/stores/modules/user";
|
||||
const userStore = useUserStore();
|
||||
// 上传文件
|
||||
const handleAvatarSuccess_four = (
|
||||
response,
|
||||
uploadFile
|
||||
) => {
|
||||
if (response.code == 0) {
|
||||
feedback.msgError(response.msg);
|
||||
return;
|
||||
}
|
||||
formDataannex.push(
|
||||
{ uri: response.data.uri, name: response.data.name }
|
||||
|
||||
);
|
||||
};
|
||||
// 删除上传的文件
|
||||
const delFileFn = (index: number) => {
|
||||
formDataannex.splice(index, 1)
|
||||
}
|
||||
const handleAdd = (row: any) => {
|
||||
// 在 row 后面插入一行数据
|
||||
const index = formData.pay_plan.indexOf(row);
|
||||
formData.pay_plan.splice(index + 1, 0, {});
|
||||
};
|
||||
|
||||
const handleDelete = (row: any) => {
|
||||
// 删除 row
|
||||
const index = formData.pay_plan.indexOf(row);
|
||||
formData.pay_plan.splice(index, 1);
|
||||
};
|
||||
const handleAdd1 = (row: any) => {
|
||||
// 在 row 后面插入一行数据
|
||||
const index = formData.pay_plan.indexOf(row);
|
||||
formData.material.splice(index + 1, 0, {});
|
||||
};
|
||||
|
||||
const handleDelete1 = (row: any) => {
|
||||
// 删除 row
|
||||
const index = formData.pay_plan.indexOf(row);
|
||||
formData.material.splice(index, 1);
|
||||
};
|
||||
// 弹窗标题
|
||||
const popupTitle = computed(() => {
|
||||
return mode.value == 'edit' ? '编辑采购合同' : '新增采购合同'
|
||||
@ -136,9 +297,33 @@ const formData = reactive({
|
||||
retention_money: '',
|
||||
remark: '',
|
||||
annex: '',
|
||||
material:[{
|
||||
material_procurement_application_id: 2222,
|
||||
num: 0,
|
||||
unit_price_including_tax: 0,
|
||||
tax_rate: "",
|
||||
amount_excluding_tax: 0,
|
||||
amount_including_tax: 0
|
||||
}],
|
||||
pay_plan:[{
|
||||
period:'',
|
||||
pay_date:'',
|
||||
pay_amount:'',
|
||||
remark:''
|
||||
}]
|
||||
})
|
||||
const customEvent = (e: any) => {
|
||||
project_name.value = e.name
|
||||
formData.project_id = e.id
|
||||
project_code.value = e.project_code
|
||||
showDialog.value = false;
|
||||
};
|
||||
const customEvent1 = (e: any) => {
|
||||
|
||||
|
||||
showDialog1.value = false;
|
||||
};
|
||||
|
||||
// 表单验证
|
||||
const formRules = reactive<any>({
|
||||
|
||||
@ -147,15 +332,33 @@ const formRules = reactive<any>({
|
||||
|
||||
// 获取详情
|
||||
const setFormData = async (data: Record<any, any>) => {
|
||||
if (data.annex.length > 0) {
|
||||
if (data.annex.includes(",")) {
|
||||
const arry1 = data.annex.split(',').map((item: any, index: any) => {
|
||||
return {
|
||||
name: `文件${index + 1}`,
|
||||
uri: item
|
||||
};
|
||||
});
|
||||
Object.assign(formDataannex, arry1)
|
||||
} else {
|
||||
const arry1 = [{ name: `文件1`, uri: data.annex }]
|
||||
Object.assign(formDataannex, arry1)
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
for (const key in formData) {
|
||||
if (data[key] != null && data[key] != undefined) {
|
||||
//@ts-ignore
|
||||
formData[key] = data[key]
|
||||
}
|
||||
}
|
||||
|
||||
project_name.value = data.project.name
|
||||
project_code.value = data.project.project_code
|
||||
|
||||
//@ts-ignore
|
||||
formData.signing_date = timeFormat(formData.signing_date,'yyyy-mm-dd hh:MM:ss')
|
||||
formData.signing_date = timeFormat(formData.signing_date, 'yyyy-mm-dd hh:MM:ss')
|
||||
}
|
||||
|
||||
const getDetail = async (row: Record<string, any>) => {
|
||||
@ -169,9 +372,9 @@ const getDetail = async (row: Record<string, any>) => {
|
||||
// 提交按钮
|
||||
const handleSubmit = async () => {
|
||||
await formRef.value?.validate()
|
||||
const data = { ...formData, }
|
||||
mode.value == 'edit'
|
||||
? await apiProcurementContractEdit(data)
|
||||
const data = { ...formData, }
|
||||
mode.value == 'edit'
|
||||
? await apiProcurementContractEdit(data)
|
||||
: await apiProcurementContractAdd(data)
|
||||
popupRef.value?.close()
|
||||
emit('success')
|
||||
|
@ -1,11 +1,7 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-card class="!border-none mb-4" shadow="never">
|
||||
<el-form
|
||||
class="mb-[-16px]"
|
||||
:model="queryParams"
|
||||
inline
|
||||
>
|
||||
<el-form class="mb-[-16px]" :model="queryParams" inline>
|
||||
<el-form-item label="供应商id" prop="supplier_id">
|
||||
<el-input class="w-[280px]" v-model="queryParams.supplier_id" clearable placeholder="请输入供应商id" />
|
||||
</el-form-item>
|
||||
@ -25,11 +21,7 @@
|
||||
</template>
|
||||
新增
|
||||
</el-button>
|
||||
<el-button
|
||||
v-perms="['contract.procurement_contract/delete']"
|
||||
:disabled="!selectData.length"
|
||||
@click="handleDelete(selectData)"
|
||||
>
|
||||
<el-button v-perms="['contract.procurement_contract/delete']" :disabled="!selectData.length" @click="handleDelete(selectData)">
|
||||
删除
|
||||
</el-button>
|
||||
<div class="mt-4">
|
||||
@ -47,7 +39,7 @@
|
||||
</el-table-column>
|
||||
<el-table-column label="签订日期" prop="signing_date">
|
||||
<template #default="{ row }">
|
||||
<span>{{ row.signing_date ? timeFormat(row.signing_date, 'yyyy-mm-dd hh:MM:ss') : '' }}</span>
|
||||
<span>{{ row.signing_date ? timeFormat(row.signing_date, 'yyyy-mm-dd hh:MM:ss') : '' }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="付款方式" prop="pay_type">
|
||||
@ -65,24 +57,17 @@
|
||||
<el-table-column label="金额大写" prop="amount_daxie" show-overflow-tooltip />
|
||||
<el-table-column label="质保金比例" prop="retention_money_rate" show-overflow-tooltip />
|
||||
<el-table-column label="质保金" prop="retention_money" show-overflow-tooltip />
|
||||
<el-table-column label="操作" width="120" fixed="right">
|
||||
<el-table-column label="操作" width="160" fixed="right">
|
||||
<template #default="{ row }">
|
||||
<el-button
|
||||
v-perms="['contract.procurement_contract/edit']"
|
||||
type="primary"
|
||||
link
|
||||
@click="handleEdit(row)"
|
||||
>
|
||||
<el-button v-perms="['contract.procurement_contract/edit']" type="primary" link @click="handleEdit(row)">
|
||||
编辑
|
||||
</el-button>
|
||||
<el-button
|
||||
v-perms="['contract.procurement_contract/delete']"
|
||||
type="danger"
|
||||
link
|
||||
@click="handleDelete(row.id)"
|
||||
>
|
||||
<el-button v-perms="['contract.procurement_contract/delete']" type="danger" link @click="handleDelete(row.id)">
|
||||
删除
|
||||
</el-button>
|
||||
<el-button v-perms="['contract.procurement_contract/detail']" link @click="handleDetail(row)">
|
||||
详情
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
@ -91,6 +76,7 @@
|
||||
<pagination v-model="pager" @change="getLists" />
|
||||
</div>
|
||||
</el-card>
|
||||
<detail-popup v-if="showDtail" ref="detailRef" :dict-data="dictData" @close="showDtail = false" />
|
||||
<edit-popup v-if="showEdit" ref="editRef" :dict-data="dictData" @success="getLists" @close="showEdit = false" />
|
||||
</div>
|
||||
</template>
|
||||
@ -98,15 +84,17 @@
|
||||
<script lang="ts" setup name="procurementContractLists">
|
||||
import { usePaging } from '@/hooks/usePaging'
|
||||
import { useDictData } from '@/hooks/useDictOptions'
|
||||
import { apiProcurementContractLists, apiProcurementContractDelete } from '@/api/procurement_contract'
|
||||
import { apiProcurementContractLists, apiProcurementContractDelete, apiProcurementContractDetail } from '@/api/procurement_contract'
|
||||
import { timeFormat } from '@/utils/util'
|
||||
import feedback from '@/utils/feedback'
|
||||
import EditPopup from './edit.vue'
|
||||
|
||||
import DetailPopup from './detail.vue'
|
||||
const detailRef = shallowRef<InstanceType<typeof DetailPopup>>()
|
||||
const editRef = shallowRef<InstanceType<typeof EditPopup>>()
|
||||
// 是否显示编辑框
|
||||
const showEdit = ref(false)
|
||||
|
||||
const showDtail = ref(false)
|
||||
|
||||
// 查询条件
|
||||
const queryParams = reactive({
|
||||
@ -123,7 +111,7 @@ const handleSelectionChange = (val: any[]) => {
|
||||
}
|
||||
|
||||
// 获取字典数据
|
||||
const { dictData } = useDictData('procurement_contract_type,pay_type,account_period')
|
||||
const { dictData } = useDictData('procurement_contract_type,pay_type,account_period,pay_period')
|
||||
|
||||
// 分页相关
|
||||
const { pager, getLists, resetParams, resetPage } = usePaging({
|
||||
@ -140,10 +128,11 @@ const handleAdd = async () => {
|
||||
|
||||
// 编辑
|
||||
const handleEdit = async (data: any) => {
|
||||
let res = await apiProcurementContractDetail({ id: data.id })
|
||||
showEdit.value = true
|
||||
await nextTick()
|
||||
editRef.value?.open('edit')
|
||||
editRef.value?.setFormData(data)
|
||||
editRef.value?.setFormData(res)
|
||||
}
|
||||
|
||||
// 删除
|
||||
@ -152,6 +141,13 @@ const handleDelete = async (id: number | any[]) => {
|
||||
await apiProcurementContractDelete({ id })
|
||||
getLists()
|
||||
}
|
||||
const handleDetail = async (data: any) => {
|
||||
let res = await apiProcurementContractDetail({ id: data.id })
|
||||
showDtail.value = true
|
||||
await nextTick()
|
||||
detailRef.value?.open()
|
||||
detailRef.value?.setFormData(res)
|
||||
}
|
||||
|
||||
getLists()
|
||||
</script>
|
||||
|
161
src/views/procurement_contract_detail/detail.vue
Normal file
161
src/views/procurement_contract_detail/detail.vue
Normal file
@ -0,0 +1,161 @@
|
||||
|
||||
<template>
|
||||
<div class="detail-popup">
|
||||
<popup ref="popupRef" title="采购合同详情" :async="true" width="80%" @confirm="handleSubmit" @close="handleClose">
|
||||
<el-form ref="formRef" :model="formData" label-width="120px">
|
||||
<el-card class="mb-2">
|
||||
<el-row>
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item label="项目名称">
|
||||
{{ formData.project_name }}
|
||||
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="客户名称">
|
||||
{{ formData.custom_name }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="合同编号">
|
||||
{{ formData.supplier_contract_no }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="供应商合同号">
|
||||
|
||||
{{ formData.supplier_contract_no }}
|
||||
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item label="合同类型">
|
||||
<dict-value :options="dictData.procurement_contract_type" :value="formData.contract_type" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="签订日期">
|
||||
{{ formData.signing_date }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="数量">
|
||||
{{ formData.num }}
|
||||
</el-form-item>
|
||||
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="税率">
|
||||
{{ formData.tax_rate }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="含税单价">
|
||||
{{ formData.unit_price_including_tax }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item label="含税金额">
|
||||
{{ formData.amount_including_tax }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="不含税金额">
|
||||
{{ formData.amount_excluding_tax }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
|
||||
</el-row>
|
||||
</el-card>
|
||||
</el-form>
|
||||
</popup>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup name="customdetail">
|
||||
|
||||
import type { FormInstance } from 'element-plus'
|
||||
import Popup from '@/components/popup/index.vue'
|
||||
import { apiCustomDetail } from '@/api/custom'
|
||||
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 datas = reactive({
|
||||
provinceOptions: [],
|
||||
cityOptions: [],
|
||||
areaOptions: [],
|
||||
});
|
||||
|
||||
|
||||
// 表单数据
|
||||
const formData = reactive({
|
||||
|
||||
})
|
||||
|
||||
|
||||
|
||||
// 获取详情
|
||||
const setFormData = async (data: Record<any, any>) => {
|
||||
Object.assign(formData, data)
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
const getDetail = async (row: Record<string, any>) => {
|
||||
const data = await apiCustomDetail({
|
||||
id: row.id
|
||||
})
|
||||
setFormData(data)
|
||||
}
|
||||
|
||||
|
||||
// 提交按钮
|
||||
const handleSubmit = async () => {
|
||||
popupRef.value?.close()
|
||||
|
||||
}
|
||||
|
||||
//打开弹窗
|
||||
const open = () => {
|
||||
console.log('1111111')
|
||||
popupRef.value?.open()
|
||||
}
|
||||
|
||||
// 关闭回调
|
||||
const handleClose = () => {
|
||||
emit('close')
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
defineExpose({
|
||||
open,
|
||||
setFormData,
|
||||
getDetail
|
||||
})
|
||||
</script>
|
||||
<style lang="scss">
|
||||
.tit {
|
||||
font-size: 1.2em;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
</style>
|
@ -1,14 +1,7 @@
|
||||
<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">
|
||||
<popup ref="popupRef" :title="popupTitle" :async="true" width="550px" @confirm="handleSubmit" @close="handleClose">
|
||||
<el-form ref="formRef" :model="formData" label-width="120px" :rules="formRules">
|
||||
<el-form-item label="采购合同id" prop="procurement_contract_id">
|
||||
<el-input v-model="formData.procurement_contract_id" clearable placeholder="请输入采购合同id" />
|
||||
</el-form-item>
|
||||
@ -23,12 +16,7 @@
|
||||
</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="item.value"
|
||||
/>
|
||||
<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 label="不含税金额" prop="amount_excluding_tax">
|
||||
@ -37,6 +25,7 @@
|
||||
<el-form-item label="含税金额" prop="amount_including_tax">
|
||||
<el-input v-model="formData.amount_including_tax" clearable placeholder="请输入含税金额" />
|
||||
</el-form-item>
|
||||
|
||||
</el-form>
|
||||
</popup>
|
||||
</div>
|
||||
@ -92,8 +81,8 @@ const setFormData = async (data: Record<any, any>) => {
|
||||
formData[key] = data[key]
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
const getDetail = async (row: Record<string, any>) => {
|
||||
@ -107,9 +96,9 @@ const getDetail = async (row: Record<string, any>) => {
|
||||
// 提交按钮
|
||||
const handleSubmit = async () => {
|
||||
await formRef.value?.validate()
|
||||
const data = { ...formData, }
|
||||
mode.value == 'edit'
|
||||
? await apiProcurementContractDetailEdit(data)
|
||||
const data = { ...formData, }
|
||||
mode.value == 'edit'
|
||||
? await apiProcurementContractDetailEdit(data)
|
||||
: await apiProcurementContractDetailAdd(data)
|
||||
popupRef.value?.close()
|
||||
emit('success')
|
||||
|
@ -1,11 +1,7 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-card class="!border-none mb-4" shadow="never">
|
||||
<el-form
|
||||
class="mb-[-16px]"
|
||||
:model="queryParams"
|
||||
inline
|
||||
>
|
||||
<el-form class="mb-[-16px]" :model="queryParams" inline>
|
||||
<el-form-item label="采购合同id" prop="procurement_contract_id">
|
||||
<el-input class="w-[280px]" v-model="queryParams.procurement_contract_id" clearable placeholder="请输入采购合同id" />
|
||||
</el-form-item>
|
||||
@ -25,11 +21,7 @@
|
||||
</template>
|
||||
新增
|
||||
</el-button>
|
||||
<el-button
|
||||
v-perms="['procurement_contract_detail/delete']"
|
||||
:disabled="!selectData.length"
|
||||
@click="handleDelete(selectData)"
|
||||
>
|
||||
<el-button v-perms="['procurement_contract_detail/delete']" :disabled="!selectData.length" @click="handleDelete(selectData)">
|
||||
删除
|
||||
</el-button>
|
||||
<div class="mt-4">
|
||||
@ -46,24 +38,17 @@
|
||||
</el-table-column>
|
||||
<el-table-column label="不含税金额" prop="amount_excluding_tax" show-overflow-tooltip />
|
||||
<el-table-column label="含税金额" prop="amount_including_tax" show-overflow-tooltip />
|
||||
<el-table-column label="操作" width="120" fixed="right">
|
||||
<el-table-column label="操作" width="160" fixed="right">
|
||||
<template #default="{ row }">
|
||||
<el-button
|
||||
v-perms="['procurement_contract_detail/edit']"
|
||||
type="primary"
|
||||
link
|
||||
@click="handleEdit(row)"
|
||||
>
|
||||
<el-button v-perms="['procurement_contract_detail/edit']" type="primary" link @click="handleEdit(row)">
|
||||
编辑
|
||||
</el-button>
|
||||
<el-button
|
||||
v-perms="['procurement_contract_detail/delete']"
|
||||
type="danger"
|
||||
link
|
||||
@click="handleDelete(row.id)"
|
||||
>
|
||||
<el-button v-perms="['procurement_contract_detail/delete']" type="danger" link @click="handleDelete(row.id)">
|
||||
删除
|
||||
</el-button>
|
||||
<el-button v-perms="['procurement_contract_detail/detail']" link @click="handleDetail(row)">
|
||||
详情
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
@ -72,6 +57,7 @@
|
||||
<pagination v-model="pager" @change="getLists" />
|
||||
</div>
|
||||
</el-card>
|
||||
<detail-popup v-if="showDtail" ref="detailRef" :dict-data="dictData" @close="showDtail = false" />
|
||||
<edit-popup v-if="showEdit" ref="editRef" :dict-data="dictData" @success="getLists" @close="showEdit = false" />
|
||||
</div>
|
||||
</template>
|
||||
@ -79,15 +65,18 @@
|
||||
<script lang="ts" setup name="procurementContractDetailLists">
|
||||
import { usePaging } from '@/hooks/usePaging'
|
||||
import { useDictData } from '@/hooks/useDictOptions'
|
||||
import { apiProcurementContractDetailLists, apiProcurementContractDetailDelete } from '@/api/procurement_contract_detail'
|
||||
import { apiProcurementContractDetailLists, apiProcurementContractDetailDetail } from '@/api/procurement_contract_detail'
|
||||
import { timeFormat } from '@/utils/util'
|
||||
import feedback from '@/utils/feedback'
|
||||
import EditPopup from './edit.vue'
|
||||
|
||||
import DetailPopup from './detail.vue'
|
||||
const detailRef = shallowRef<InstanceType<typeof DetailPopup>>()
|
||||
const editRef = shallowRef<InstanceType<typeof EditPopup>>()
|
||||
// 是否显示编辑框
|
||||
const showEdit = ref(false)
|
||||
|
||||
const showDtail = ref(false)
|
||||
|
||||
|
||||
// 查询条件
|
||||
const queryParams = reactive({
|
||||
@ -133,6 +122,14 @@ const handleDelete = async (id: number | any[]) => {
|
||||
await apiProcurementContractDetailDelete({ id })
|
||||
getLists()
|
||||
}
|
||||
//详情
|
||||
const handleDetail = async (data: any) => {
|
||||
let res = await apiProcurementContractDetailDetail({ id: data.id })
|
||||
showDtail.value = true
|
||||
await nextTick()
|
||||
detailRef.value?.open()
|
||||
detailRef.value?.setFormData(res)
|
||||
}
|
||||
|
||||
getLists()
|
||||
</script>
|
||||
|
@ -139,7 +139,7 @@ const handleAvatarSuccess_four = (
|
||||
uploadFile
|
||||
) => {
|
||||
if (response.code == 0) {
|
||||
ElMessage.error(response.msg);
|
||||
feedback.msgError(response.msg);
|
||||
return;
|
||||
}
|
||||
formDataannex.push(
|
||||
|
171
src/views/purchaseContracts/detail.vue
Normal file
171
src/views/purchaseContracts/detail.vue
Normal file
@ -0,0 +1,171 @@
|
||||
|
||||
<template>
|
||||
<div class="detail-popup">
|
||||
<popup ref="popupRef" title="项目合同详情" :async="true" width="80%" @confirm="handleSubmit" @close="handleClose">
|
||||
<el-form ref="formRef" :model="formData" label-width="120px">
|
||||
<el-card class="mb-2">
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="合同名称">
|
||||
{{ formData.contract_name }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="合同编号">
|
||||
{{ formData.contract_code }}
|
||||
</el-form-item>
|
||||
</el-col> <el-col :span="12">
|
||||
<el-form-item label="合同类型">
|
||||
<dict-value :options="dictData.contract_type" :value="formData.contract_type" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item label="洽商类别">
|
||||
<dict-value :options="dictData.negotiation_type" :value="formData.negotiation_type" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="洽商金额">
|
||||
{{ formData.negotiation_amount }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item label="洽商编号">
|
||||
{{ formData.negotiation_no }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="成本金额(人工)">
|
||||
{{ formData.labor_costs }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="成本金额(材料">
|
||||
{{ formData.material_costs }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="洽商质保到期时间">
|
||||
{{ formData.Warranty_expire_date }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="利润率">
|
||||
{{ formData.profit_rate }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="利润">
|
||||
{{ formData.profit }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="具体说明">
|
||||
{{ formData.negotiation_content }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="签证报价表">
|
||||
{{ formData.negotiation_quotation }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="洽商依据">
|
||||
{{ formData.negotiation_basis }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
|
||||
|
||||
</el-row>
|
||||
</el-card>
|
||||
</el-form>
|
||||
</popup>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup name="customdetail">
|
||||
|
||||
import type { FormInstance } from 'element-plus'
|
||||
import Popup from '@/components/popup/index.vue'
|
||||
import { apiCustomDetail } from '@/api/custom'
|
||||
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 datas = reactive({
|
||||
provinceOptions: [],
|
||||
cityOptions: [],
|
||||
areaOptions: [],
|
||||
});
|
||||
|
||||
|
||||
// 表单数据
|
||||
const formData = reactive({
|
||||
|
||||
})
|
||||
|
||||
|
||||
|
||||
// 获取详情
|
||||
const setFormData = async (data: Record<any, any>) => {
|
||||
Object.assign(formData, data)
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
const getDetail = async (row: Record<string, any>) => {
|
||||
const data = await apiCustomDetail({
|
||||
id: row.id
|
||||
})
|
||||
setFormData(data)
|
||||
}
|
||||
|
||||
|
||||
// 提交按钮
|
||||
const handleSubmit = async () => {
|
||||
popupRef.value?.close()
|
||||
|
||||
}
|
||||
|
||||
//打开弹窗
|
||||
const open = () => {
|
||||
console.log('1111111')
|
||||
popupRef.value?.open()
|
||||
}
|
||||
|
||||
// 关闭回调
|
||||
const handleClose = () => {
|
||||
emit('close')
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
defineExpose({
|
||||
open,
|
||||
setFormData,
|
||||
getDetail
|
||||
})
|
||||
</script>
|
||||
<style lang="scss">
|
||||
.tit {
|
||||
font-size: 1.2em;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
</style>
|
412
src/views/purchaseContracts/edit.vue
Normal file
412
src/views/purchaseContracts/edit.vue
Normal file
@ -0,0 +1,412 @@
|
||||
<template>
|
||||
<div class="edit-popup">
|
||||
<popup ref="popupRef" :title="popupTitle" :async="true" width="80%" @confirm="handleSubmit" @close="handleClose">
|
||||
<el-form ref="formRef" :model="formData" label-width="120px" :rules="formRules">
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="合同编号" prop="contract_no">
|
||||
<el-input v-model="formData.contract_no" clearable placeholder="请输入合同编号" />
|
||||
</el-form-item> </el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="供应商合同号" prop="supplier_contract_no">
|
||||
<el-input v-model="formData.supplier_contract_no" clearable placeholder="请输入供应商合同号" />
|
||||
</el-form-item> </el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="供应商名称" prop="supplier_contract_no">
|
||||
<el-input v-model="formData.supplier_contract_no" clearable placeholder="请输入供应商合同号" />
|
||||
</el-form-item> </el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="供应商编码" prop="supplier_contract_no">
|
||||
<el-input v-model="formData.supplier_contract_no" clearable placeholder="请输入供应商合同号" />
|
||||
</el-form-item> </el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="供应商编码" prop="supplier_contract_no">
|
||||
<el-input v-model="formData.supplier_contract_no" clearable placeholder="请输入供应商合同号" />
|
||||
</el-form-item> </el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="项目名称" prop="supplier_contract_no">
|
||||
<el-input v-model="formData.supplier_contract_no" clearable placeholder="请输入供应商合同号" />
|
||||
</el-form-item> </el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="项目编码" prop="supplier_contract_no">
|
||||
<el-input v-model="formData.supplier_contract_no" clearable placeholder="请输入供应商合同号" />
|
||||
</el-form-item> </el-col>
|
||||
|
||||
|
||||
<el-col :span="24">
|
||||
|
||||
|
||||
<el-form-item label="合同类型" prop="contract_type">
|
||||
<el-radio-group v-model="formData.contract_type" placeholder="请选择合同类型">
|
||||
<el-radio v-for="(item, index) in dictData.procurement_contract_type" :key="index" :label="parseInt(item.value)">
|
||||
{{ item.name }}
|
||||
</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item> </el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="签订日期" prop="signing_date">
|
||||
<el-date-picker class="flex-1 !flex" v-model="formData.signing_date" clearable type="datetime" value-format="YYYY-MM-DD HH:mm:ss" placeholder="选择签订日期">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="合同金额" prop="amount">
|
||||
<el-input v-model="formData.amount" clearable placeholder="请输入合同金额" />
|
||||
</el-form-item> </el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="付款方式" prop="pay_type">
|
||||
<el-radio-group v-model="formData.pay_type" placeholder="请选择付款方式">
|
||||
<el-radio v-for="(item, index) in dictData.pay_type" :key="index" :label="parseInt(item.value)">
|
||||
{{ item.name }}
|
||||
</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item> </el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="账期" prop="account_period">
|
||||
<el-radio-group v-model="formData.account_period" placeholder="请选择账期">
|
||||
<el-radio v-for="(item, index) in dictData.account_period" :key="index" :label="parseInt(item.value)">
|
||||
{{ item.name }}
|
||||
</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item> </el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<el-form-item label="不含税金额" prop="amount_excluding_tax">
|
||||
<el-input v-model="formData.amount_excluding_tax" clearable placeholder="请输入不含税金额" />
|
||||
</el-form-item> </el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="金额大写" prop="amount_daxie">
|
||||
<el-input v-model="formData.amount_daxie" clearable placeholder="请输入金额大写" />
|
||||
</el-form-item> </el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="质保金比例" prop="retention_money_rate">
|
||||
<el-input v-model="formData.retention_money_rate" clearable placeholder="请输入质保金比例" />
|
||||
</el-form-item> </el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="质保金" prop="retention_money">
|
||||
<el-input v-model="formData.retention_money" clearable placeholder="请输入质保金" />
|
||||
</el-form-item> </el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="formData.remark" clearable placeholder="请输入备注" />
|
||||
</el-form-item> </el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="附件" prop="field127">
|
||||
<el-upload accept=".pdf" class="upload-demo" :show-file-list="false" aria-hidden="true" :headers="{ Token: userStore.token }" :action="base_url + '/upload/file'" :on-success="handleAvatarSuccess_four" ref="upload">
|
||||
<el-button type="primary">
|
||||
上传
|
||||
</el-button>
|
||||
</el-upload>
|
||||
|
||||
<div>
|
||||
<div v-for="(item, index) in formDataannex" style="margin-left: 5px;display: block;">
|
||||
<a style="margin-left: 10px; color: #4a5dff; align-self: flex-start" :href="item.uri" target="_blank">{{ item.name }}</a>
|
||||
<span style="cursor: pointer;margin-left: 5px;" @click="delFileFn(index)">x</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<div style="margin-bottom: 30px;">采购合同明细</div>
|
||||
<div style="margin-bottom: 30px;">
|
||||
<el-table :data="formData.material">
|
||||
<el-table-column label="序号">
|
||||
<template #default="{ row }">
|
||||
<el-button @click="handleAdd1(row)">+</el-button>
|
||||
<el-button @click="handleDelete1(row)">-</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="采购申请单号" prop="material_procurement_application_id">
|
||||
<template #default="{ row }">
|
||||
<el-input v-model="row.material_procurement_application_id" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="材料名称" prop="material_procurement_application_id">
|
||||
<template #default="{ row }"> <el-input v-model="row.material_procurement_application_id" /> </template></el-table-column>
|
||||
<el-table-column label="材料编码" prop="material_procurement_application_id">
|
||||
<template #default="{ row }"> <el-input v-model="row.material_procurement_application_id" /> </template></el-table-column>
|
||||
|
||||
<el-table-column label="规格型号" prop="material_procurement_application_id">
|
||||
<template #default="{ row }">
|
||||
<el-input v-model="row.material_procurement_application_id" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
|
||||
<el-table-column label="数量" prop="product_num">
|
||||
<template #default="{ row }">
|
||||
<el-input v-model="row.product_num" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="单位" prop="tax_rate">
|
||||
<template #default="{ row }">
|
||||
<el-input v-model="row.tax_rate" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="数量" prop="num">
|
||||
<template #default="{ row }">
|
||||
<el-input v-model="row.num" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="含税单价" prop="unit_price_including_tax">
|
||||
<template #default="{ row }">
|
||||
<el-input v-model="row.unit_price_including_tax" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="税率" prop="tax_rate">
|
||||
<template #default="{ row }">
|
||||
<el-input v-model="row.tax_rate" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="不含税金额" prop="amount_excluding_tax">
|
||||
<template #default="{ row }">
|
||||
<el-input v-model="row.amount_excluding_tax" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="含税金额" prop="amount_including_tax">
|
||||
<template #default="{ row }">
|
||||
<el-input v-model="row.amount_including_tax" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
</el-table>
|
||||
</div>
|
||||
<div style="margin-bottom: 30px;">付款计划</div>
|
||||
<div style="margin-bottom: 30px;">
|
||||
<el-table :data="formData.pay_plan">
|
||||
<el-table-column label="序号">
|
||||
<template #default="{ row }">
|
||||
<el-button @click="handleAdd(row)">+</el-button>
|
||||
<el-button @click="handleDelete(row)">-</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="期次" prop="name1">
|
||||
<template #default="{ row }">
|
||||
<el-select v-model="row.period" clearable placeholder="请选择期次">
|
||||
<el-option v-for="(item, index) in dictData.pay_period " :key="index" :label="item.name" :value="item.id" />
|
||||
</el-select>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="计划付款日期" prop="pay_date">
|
||||
<template #default="{ row }">
|
||||
<el-date-picker v-model="row.pay_date" clearable type="datetime" value-format="YYYY-MM-DD HH:mm:ss" placeholder="选择签订日期">
|
||||
</el-date-picker>
|
||||
</template></el-table-column>
|
||||
<el-table-column label="金额" prop="pay_amount">
|
||||
<template #default="{ row }"> <el-input v-model="row.pay_amount" /> </template></el-table-column>
|
||||
|
||||
<el-table-column label="备注" prop="remark">
|
||||
<template #default="{ row }">
|
||||
<el-input v-model="row.remark" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
</el-form>
|
||||
</popup>
|
||||
<el-dialog v-model="showDialog" title="选择项目" width="70%">
|
||||
<procurementTable @customEvent="customEvent"></procurementTable>
|
||||
</el-dialog>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup name="procurementContractEdit">
|
||||
import type { FormInstance } from 'element-plus'
|
||||
import Popup from '@/components/popup/index.vue'
|
||||
|
||||
import procurementTable from '@/components/procurement/index.vue'
|
||||
import { apiProcurementAdd, apiProcurementEdit, apiProcurementDetail } from '@/api/procurement_changes'
|
||||
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 showDialog = ref(false)
|
||||
const showDialog1 = ref(false)
|
||||
const project_name = ref('')
|
||||
const project_code = ref('')
|
||||
const formDataannex = reactive([])
|
||||
const tableData = reactive([])
|
||||
const tableData1 = reactive([])
|
||||
import feedback from '@/utils/feedback'
|
||||
import configs from "@/config"
|
||||
const base_url = configs.baseUrl + configs.urlPrefix
|
||||
import useUserStore from "@/stores/modules/user";
|
||||
const userStore = useUserStore();
|
||||
// 上传文件
|
||||
const handleAvatarSuccess_four = (
|
||||
response,
|
||||
uploadFile
|
||||
) => {
|
||||
if (response.code == 0) {
|
||||
feedback.msgError(response.msg);
|
||||
return;
|
||||
}
|
||||
formDataannex.push(
|
||||
{ uri: response.data.uri, name: response.data.name }
|
||||
|
||||
);
|
||||
};
|
||||
// 删除上传的文件
|
||||
const delFileFn = (index: number) => {
|
||||
formDataannex.splice(index, 1)
|
||||
}
|
||||
const handleAdd = (row: any) => {
|
||||
// 在 row 后面插入一行数据
|
||||
const index = tableData.indexOf(row);
|
||||
tableData.splice(index + 1, 0, {});
|
||||
};
|
||||
|
||||
const handleDelete = (row: any) => {
|
||||
// 删除 row
|
||||
const index = tableData.indexOf(row);
|
||||
tableData.splice(index, 1);
|
||||
}
|
||||
const handleDelete1 = (row: any) => {
|
||||
// 删除 row
|
||||
const index = formData.pay_plan.indexOf(row);
|
||||
formData.material.splice(index, 1);
|
||||
};
|
||||
// 弹窗标题
|
||||
const popupTitle = computed(() => {
|
||||
return mode.value == 'edit' ? '编辑采购变更' : '新增采购变更'
|
||||
})
|
||||
|
||||
// 表单数据
|
||||
const formData = reactive({
|
||||
id: '',
|
||||
supplier_id: '',
|
||||
approve_id: '',
|
||||
procurement_contract_id: '',
|
||||
contract_no: '',
|
||||
supplier_contract_no: '',
|
||||
contract_type: '',
|
||||
signing_date: '',
|
||||
pay_type: '',
|
||||
account_period: '',
|
||||
amount: '',
|
||||
amount_excluding_tax: '',
|
||||
amount_daxie: '',
|
||||
retention_money_rate: '',
|
||||
retention_money: '',
|
||||
remark: '',
|
||||
annex: '',
|
||||
material: [{
|
||||
material_procurement_application_id: 2222,
|
||||
num: 0,
|
||||
unit_price_including_tax: 0,
|
||||
tax_rate: "",
|
||||
amount_excluding_tax: 0,
|
||||
amount_including_tax: 0
|
||||
}],
|
||||
pay_plan: [{
|
||||
period: '',
|
||||
pay_date: '',
|
||||
pay_amount: '',
|
||||
remark: ''
|
||||
}]
|
||||
})
|
||||
const customEvent = (e: any) => {
|
||||
project_name.value = e.name
|
||||
formData.project_id = e.id
|
||||
project_code.value = e.project_code
|
||||
showDialog.value = false;
|
||||
showDialog.value = false;
|
||||
};
|
||||
const customEvent1 = (e: any) => {
|
||||
|
||||
|
||||
showDialog1.value = false;
|
||||
};
|
||||
|
||||
// 表单验证
|
||||
const formRules = reactive<any>({
|
||||
|
||||
})
|
||||
|
||||
|
||||
// 获取详情
|
||||
const setFormData = async (data: Record<any, any>) => {
|
||||
if (data.file.length > 0) {
|
||||
if (data.file.includes(",")) {
|
||||
const arry1 = data.file.split(',').map((item: any, index: any) => {
|
||||
return {
|
||||
name: `文件${index + 1}`,
|
||||
uri: item
|
||||
};
|
||||
});
|
||||
Object.assign(formDataannex, arry1)
|
||||
} else {
|
||||
const arry1 = [{ name: `文件1`, uri: data.file }]
|
||||
Object.assign(formDataannex, arry1)
|
||||
|
||||
}
|
||||
}
|
||||
project_name.value = data.project.name
|
||||
project_code.value = data.project.project_code
|
||||
|
||||
for (const key in formData) {
|
||||
if (data[key] != null && data[key] != undefined) {
|
||||
//@ts-ignore
|
||||
formData[key] = data[key]
|
||||
}
|
||||
}
|
||||
|
||||
//@ts-ignore
|
||||
formData.signing_date = timeFormat(formData.signing_date, 'yyyy-mm-dd hh:MM:ss')
|
||||
}
|
||||
|
||||
const getDetail = async (row: Record<string, any>) => {
|
||||
const data = await apiProcurementDetail({
|
||||
id: row.id
|
||||
})
|
||||
setFormData(data)
|
||||
}
|
||||
|
||||
|
||||
// 提交按钮
|
||||
const handleSubmit = async () => {
|
||||
if (formDataannex.length > 0) {
|
||||
formData.annex = formDataannex.map((item) => item.uri).toString()
|
||||
}
|
||||
await formRef.value?.validate()
|
||||
const data = { ...formData, }
|
||||
mode.value == 'edit'
|
||||
? await apiProcurementEdit(data)
|
||||
: await apiProcurementAdd(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>
|
183
src/views/purchaseContracts/index.vue
Normal file
183
src/views/purchaseContracts/index.vue
Normal file
@ -0,0 +1,183 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-card class="!border-none mb-4" shadow="never">
|
||||
<el-form class="mb-[-16px]" :model="queryParams" inline>
|
||||
<el-form-item label="合同编号" prop="procurement_contract_id">
|
||||
<el-input class="w-[280px]" v-model="queryParams.procurement_contract_id" clearable placeholder="请输入合同编号" />
|
||||
</el-form-item>
|
||||
|
||||
|
||||
<el-form-item label="项目" prop="project_id">
|
||||
<el-select class="w-[280px]" v-model="queryParams.project_id" clearable placeholder="项目">
|
||||
<el-option label="全部" value=""></el-option>
|
||||
<el-option v-for="(item, index) in protype" :key="index" :label="item.name" :value="item.id" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="采购合同" prop="supplier_id">
|
||||
<el-select class="w-[280px]" v-model="queryParams.supplier_id" clearable placeholder="请选择采购合同">
|
||||
<el-option label="全部" value=""></el-option>
|
||||
<el-option v-for="(item, index) in protype" :key="index" :label="item.name" :value="item.id" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="供应商" prop="project_type">
|
||||
<el-select class="w-[280px]" v-model="queryParams.project_type" clearable placeholder="请选择供应商">
|
||||
<el-option label="全部" value=""></el-option>
|
||||
<el-option v-for="(item, index) in protype" :key="index" :label="item.name" :value="item.id" />
|
||||
</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="['project.project/add']" type="primary" @click="handleAdd">
|
||||
<template #icon>
|
||||
<icon name="el-icon-Plus" />
|
||||
</template>
|
||||
新增
|
||||
</el-button>
|
||||
<el-button v-perms="['project.project/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="custom_name" show-overflow-tooltip />
|
||||
<el-table-column label="流程步骤" prop="custom_name" show-overflow-tooltip />
|
||||
<el-table-column label="流程编号" prop="custom_name" show-overflow-tooltip />
|
||||
<el-table-column label="项目名称" prop="custom_name" show-overflow-tooltip />
|
||||
<el-table-column label="合同编号" prop="contract_no" show-overflow-tooltip />
|
||||
<el-table-column label="供应商合同号" prop="supplier_contract_no" show-overflow-tooltip />
|
||||
<el-table-column label="供应商名称" prop="project_code" show-overflow-tooltip />
|
||||
<el-table-column label="供应商编码" prop="project_code" show-overflow-tooltip />
|
||||
|
||||
<el-table-column label="合同金额" prop="amount" show-overflow-tooltip />
|
||||
<el-table-column label="不含税金额" prop="amount_excluding_tax" show-overflow-tooltip />
|
||||
<el-table-column label="含税金额" prop="amount_including_tax" show-overflow-tooltip />
|
||||
<el-table-column label="合同类型" prop="contract_type">
|
||||
<template #default="{ row }">
|
||||
<dict-value :options="dictData.procurement_contract_type" :value="row.contract_type" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="签订日期" prop="signing_date">
|
||||
<template #default="{ row }">
|
||||
<span>{{ row.signing_date ? timeFormat(row.signing_date, 'yyyy-mm-dd hh:MM:ss') : '' }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="付款方式" prop="pay_type">
|
||||
<template #default="{ row }">
|
||||
<dict-value :options="dictData.pay_type" :value="row.pay_type" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="账期" prop="account_period">
|
||||
<template #default="{ row }">
|
||||
<dict-value :options="dictData.account_period" :value="row.account_period" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="质保金比例(%)" prop="retention_money_rate" show-overflow-tooltip />
|
||||
<el-table-column label="质保金" prop="retention_money" show-overflow-tooltip />
|
||||
<el-table-column label="备注" prop="remark" show-overflow-tooltip />
|
||||
<el-table-column label="操作" width="160" fixed="right">
|
||||
<template #default="{ row }">
|
||||
<el-button v-perms="['project.project/edit']" type="primary" link @click="handleEdit(row)">
|
||||
编辑
|
||||
</el-button>
|
||||
<el-button v-perms="['project.project/delete']" type="danger" link @click="handleDelete(row.id)">
|
||||
删除
|
||||
</el-button>
|
||||
<el-button v-perms="['project.project/detail']" link @click="handledetail(row)">
|
||||
详情
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
<div class="flex justify-end mt-4">
|
||||
<pagination v-model="pager" @change="getLists" />
|
||||
</div>
|
||||
</el-card>
|
||||
<edit-popup v-if="showEdit" ref="editRef" :dict-data="dictData" @success="getLists" @close="showEdit = false" />
|
||||
<detail-popup v-if="showDtail" ref="detailRef" :dict-data="dictData" @close="showDtail = false" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup name="projectLists">
|
||||
import { usePaging } from '@/hooks/usePaging'
|
||||
import { useDictData } from '@/hooks/useDictOptions'
|
||||
import { apiProcurementLists, apiProcurementDelete, apiProcurementDetail } from '@/api/procurement_changes'
|
||||
import { timeFormat } from '@/utils/util'
|
||||
import { getAllProjectTypes } from '@/api/projecttype'
|
||||
const protype = reactive([])
|
||||
import feedback from '@/utils/feedback'
|
||||
import EditPopup from './edit.vue'
|
||||
import DetailPopup from './detail.vue'
|
||||
const detailRef = shallowRef<InstanceType<typeof DetailPopup>>()
|
||||
const editRef = shallowRef<InstanceType<typeof EditPopup>>()
|
||||
// 是否显示编辑框
|
||||
const showEdit = ref(false)
|
||||
const showDtail = ref(false)
|
||||
|
||||
// 查询条件
|
||||
const queryParams = reactive({
|
||||
supplier_id: '',
|
||||
procurement_contract_id: '',
|
||||
contract_no: '',
|
||||
|
||||
project_id: '',
|
||||
|
||||
})
|
||||
|
||||
// 选中数据
|
||||
const selectData = ref<any[]>([])
|
||||
|
||||
// 表格选择后回调事件
|
||||
const handleSelectionChange = (val: any[]) => {
|
||||
selectData.value = val.map(({ id }) => id)
|
||||
}
|
||||
|
||||
// 获取字典数据
|
||||
const { dictData } = useDictData('procurement_contract_type,pay_type,account_period,pay_period')
|
||||
// 分页相关
|
||||
const { pager, getLists, resetParams, resetPage } = usePaging({
|
||||
fetchFun: apiProcurementLists,
|
||||
params: queryParams
|
||||
})
|
||||
|
||||
// 添加
|
||||
const handleAdd = async () => {
|
||||
showEdit.value = true
|
||||
await nextTick()
|
||||
editRef.value?.open('add')
|
||||
}
|
||||
|
||||
// 编辑
|
||||
const handleEdit = async (data: any) => {
|
||||
console.log(data.id)
|
||||
let res = await apiProcurementDetail({ id: data.id })
|
||||
showEdit.value = true
|
||||
await nextTick()
|
||||
editRef.value?.open('edit')
|
||||
editRef.value?.setFormData(res)
|
||||
}
|
||||
|
||||
// 删除
|
||||
const handleDelete = async (id: number | any[]) => {
|
||||
await feedback.confirm('确定要删除?')
|
||||
await apiProcurementDelete({ id })
|
||||
getLists()
|
||||
}
|
||||
const handledetail = async (data: any) => {
|
||||
let res = await apiProcurementDetail({ id: data.id })
|
||||
showDtail.value = true
|
||||
await nextTick()
|
||||
detailRef.value?.open()
|
||||
detailRef.value?.setFormData(res)
|
||||
}
|
||||
|
||||
|
||||
getLists()
|
||||
</script>
|
||||
|
@ -64,7 +64,7 @@
|
||||
</el-upload>
|
||||
|
||||
<div>
|
||||
<div v-for="(item, index) in formData.annex" style="margin-left: 5px;display: block;">
|
||||
<div v-for="(item, index) in formDataannex" style="margin-left: 5px;display: block;">
|
||||
<a style="margin-left: 10px; color: #4a5dff; align-self: flex-start" :href="item.uri" target="_blank">{{ item.name }}</a>
|
||||
<span style="cursor: pointer;margin-left: 5px;" @click="delFileFn(index)">x</span>
|
||||
</div>
|
||||
@ -167,8 +167,6 @@ import { apiQuotationAdd, apiQuotationEdit, apiQuotationDetail } from '@/api/quo
|
||||
import { timeFormat } from '@/utils/util'
|
||||
import customDialog1 from '@/components/product/index.vue'
|
||||
import reviewprocess from '@/components/reviewprocess/index.vue'
|
||||
import useUserStore from "@/stores/modules/user";
|
||||
import configs from "@/config"
|
||||
const base_url = configs.baseUrl + configs.urlPrefix
|
||||
import type { PropType } from 'vue'
|
||||
defineProps({
|
||||
@ -184,27 +182,31 @@ const mode = ref('add')
|
||||
const showDialog = ref(false)
|
||||
const showDialog1 = ref(false)
|
||||
const customer_name = ref('')
|
||||
const userStore = useUserStore();
|
||||
const tableData = reactive([{}])
|
||||
const formDataannex = reactive([])
|
||||
import feedback from '@/utils/feedback'
|
||||
import configs from "@/config"
|
||||
const base_url = configs.baseUrl + configs.urlPrefix
|
||||
import useUserStore from "@/stores/modules/user";
|
||||
const userStore = useUserStore();
|
||||
// 上传文件
|
||||
const handleAvatarSuccess_four = (
|
||||
response,
|
||||
uploadFile
|
||||
) => {
|
||||
if (response.code == 0) {
|
||||
ElMessage.error(response.msg);
|
||||
feedback.msgError(response.msg);
|
||||
return;
|
||||
}
|
||||
formData.annex.push(
|
||||
formDataannex.push(
|
||||
{ uri: response.data.uri, name: response.data.name }
|
||||
|
||||
);
|
||||
};
|
||||
// 删除上传的文件
|
||||
const delFileFn = (index: number) => {
|
||||
formData.annex.splice(index, 1)
|
||||
formDataannex.splice(index, 1)
|
||||
}
|
||||
|
||||
// 弹窗标题
|
||||
const popupTitle = computed(() => {
|
||||
return mode.value == 'edit' ? '编辑报价单' : '新增报价单'
|
||||
@ -259,6 +261,21 @@ const handleDelete = (row: any) => {
|
||||
};
|
||||
// 获取详情
|
||||
const setFormData = async (data: Record<any, any>) => {
|
||||
if (data.annex.length > 0) {
|
||||
if (data.annex.includes(",")) {
|
||||
const arry1 = data.annex.split(',').map((item: any, index: any) => {
|
||||
return {
|
||||
name: `文件${index + 1}`,
|
||||
uri: item
|
||||
};
|
||||
});
|
||||
Object.assign(formDataannex, arry1)
|
||||
} else {
|
||||
const arry1 = [{ name: `文件1`, uri: data.annex }]
|
||||
Object.assign(formDataannex, arry1)
|
||||
|
||||
}
|
||||
}
|
||||
customer_name.value = data.custom.name
|
||||
for (const key in formData) {
|
||||
if (data[key] != null && data[key] != undefined) {
|
||||
@ -303,6 +320,9 @@ const isMobileNumber = (rule: any, value: string | number | any[], callback: (ar
|
||||
|
||||
// 提交按钮
|
||||
const handleSubmit = async () => {
|
||||
if (formDataannex.length > 0) {
|
||||
formData.annex = formDataannex.map((item) => item.uri).toString()
|
||||
}
|
||||
await formRef.value?.validate()
|
||||
const data = { ...formData, }
|
||||
mode.value == 'edit'
|
||||
|
156
src/views/subcontract/detail.vue
Normal file
156
src/views/subcontract/detail.vue
Normal file
@ -0,0 +1,156 @@
|
||||
|
||||
<template>
|
||||
<div class="detail-popup">
|
||||
<popup ref="popupRef" title="分包合同详情" :async="true" width="80%" @confirm="handleSubmit" @close="handleClose">
|
||||
<el-form ref="formRef" :model="formData" label-width="120px">
|
||||
<el-card class="mb-2">
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="项目名称">
|
||||
{{ formData.contract_name }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="项目编码">
|
||||
{{ formData.contract_name }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="合同名称">
|
||||
{{ formData.contract_name }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="合同编号">
|
||||
{{ formData.contract_code }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="洽商类别">
|
||||
<dict-value :options="dictData.negotiation_type" :value="formData.negotiation_type" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item label="项目编码">
|
||||
{{ formData.supplier_contract_no }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="洽商单名称">
|
||||
{{ formData.negotiation_name }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="签订日期">
|
||||
{{ formData.signing_date }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="洽商金额">
|
||||
{{ formData.negotiation_amount }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="洽商质保金额">
|
||||
{{ formData.warranty_amount }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="洽商质保到期时间">
|
||||
{{ formData.Warranty_expire_date }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
|
||||
|
||||
</el-row>
|
||||
</el-card>
|
||||
</el-form>
|
||||
</popup>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup name="customdetail">
|
||||
|
||||
import type { FormInstance } from 'element-plus'
|
||||
import Popup from '@/components/popup/index.vue'
|
||||
import { apiCustomDetail } from '@/api/custom'
|
||||
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 datas = reactive({
|
||||
provinceOptions: [],
|
||||
cityOptions: [],
|
||||
areaOptions: [],
|
||||
});
|
||||
|
||||
|
||||
// 表单数据
|
||||
const formData = reactive({
|
||||
|
||||
})
|
||||
|
||||
|
||||
|
||||
// 获取详情
|
||||
const setFormData = async (data: Record<any, any>) => {
|
||||
Object.assign(formData, data)
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
const getDetail = async (row: Record<string, any>) => {
|
||||
const data = await apiCustomDetail({
|
||||
id: row.id
|
||||
})
|
||||
setFormData(data)
|
||||
}
|
||||
|
||||
|
||||
// 提交按钮
|
||||
const handleSubmit = async () => {
|
||||
popupRef.value?.close()
|
||||
|
||||
}
|
||||
|
||||
//打开弹窗
|
||||
const open = () => {
|
||||
console.log('1111111')
|
||||
popupRef.value?.open()
|
||||
}
|
||||
|
||||
// 关闭回调
|
||||
const handleClose = () => {
|
||||
emit('close')
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
defineExpose({
|
||||
open,
|
||||
setFormData,
|
||||
getDetail
|
||||
})
|
||||
</script>
|
||||
<style lang="scss">
|
||||
.tit {
|
||||
font-size: 1.2em;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
</style>
|
317
src/views/subcontract/edit.vue
Normal file
317
src/views/subcontract/edit.vue
Normal file
@ -0,0 +1,317 @@
|
||||
<template>
|
||||
<div class="edit-popup">
|
||||
<popup ref="popupRef" :title="popupTitle" :async="true" width="80%" @confirm="handleSubmit" @close="handleClose">
|
||||
<el-form ref="formRef" :model="formData" label-width="160px" :rules="formRules">
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="合同编号" prop="contract_no" @click="showDialog = true">
|
||||
<el-input v-model="project_code" clearable placeholder="请输入合同编号" />
|
||||
</el-form-item> </el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<el-form-item label="供应商名称" prop="supplier_contract_no">
|
||||
<el-input v-model="formData.supplier_contract_no" clearable placeholder="请输入供应商合同号" />
|
||||
</el-form-item> </el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="供应商编码" prop="supplier_contract_no">
|
||||
<el-input v-model="formData.supplier_contract_no" clearable placeholder="请输入供应商合同号" />
|
||||
</el-form-item> </el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<el-form-item label="项目名称" prop="supplier_contract_no">
|
||||
<el-input v-model="formData.supplier_contract_no" clearable placeholder="请输入供应商合同号" />
|
||||
</el-form-item> </el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="项目编码" prop="supplier_contract_no">
|
||||
<el-input v-model="formData.supplier_contract_no" clearable placeholder="请输入供应商合同号" />
|
||||
</el-form-item> </el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="洽商编号" prop="negotiation_no">
|
||||
<el-input v-model="formData.negotiation_no" clearable placeholder="请输入供应商合同号" />
|
||||
</el-form-item> </el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="洽商单名称" prop="negotiation_name">
|
||||
<el-input v-model="formData.negotiation_name" clearable placeholder="请输入供应商合同号" />
|
||||
</el-form-item> </el-col>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<el-col :span="8">
|
||||
<el-form-item label="签订日期" prop="signing_date">
|
||||
<el-date-picker class="flex-1 !flex" v-model="formData.signing_date" clearable type="datetime" value-format="YYYY-MM-DD HH:mm:ss" placeholder="选择签订日期">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="洽商金额" prop="negotiation_amount">
|
||||
<el-input v-model="formData.negotiation_amount" clearable placeholder="请输入合同金额" />
|
||||
</el-form-item> </el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="洽商类别" prop="negotiation_type">
|
||||
<el-radio-group v-model="formData.negotiation_type" placeholder="请选择付款方式">
|
||||
<el-radio v-for="(item, index) in dictData.negotiation_type" :key="index" :label="parseInt(item.value)">
|
||||
{{ item.name }}
|
||||
</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item> </el-col>
|
||||
|
||||
|
||||
<el-col :span="8">
|
||||
<el-form-item label="洽商质保金额" prop="warranty_amount">
|
||||
<el-input v-model="formData.warranty_amount" clearable placeholder="请输入不含税金额" />
|
||||
</el-form-item> </el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="洽商质保到期时间" prop="Warranty_expire_date">
|
||||
<el-date-picker class="flex-1 !flex" v-model="formData.Warranty_expire_date" clearable type="datetime" value-format="YYYY-MM-DD HH:mm:ss" placeholder="选择洽商质保到期时间">
|
||||
</el-date-picker>
|
||||
</el-form-item> </el-col>
|
||||
|
||||
<el-col :span="24">
|
||||
<el-form-item label="签证报价表" prop="field127">
|
||||
<el-upload accept=".pdf" class="upload-demo" :show-file-list="false" aria-hidden="true" :headers="{ Token: userStore.token }" :action="base_url + '/upload/file'" :on-success="handleAvatarSuccess_four" ref="upload">
|
||||
<el-button type="primary">
|
||||
上传
|
||||
</el-button>
|
||||
</el-upload>
|
||||
|
||||
<div>
|
||||
<div v-for="(item, index) in formDataannex" :key="index" style="margin-left: 5px;display: block;">
|
||||
<a style="margin-left: 10px; color: #4a5dff; align-self: flex-start" :href="item.uri" target="_blank">{{ item.name }}</a>
|
||||
<span style="cursor: pointer;margin-left: 5px;" @click="delFileFn(index)">x</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="洽商依据" prop="field127">
|
||||
<el-upload accept=".pdf" class="upload-demo" :show-file-list="false" aria-hidden="true" :headers="{ Token: userStore.token }" :action="base_url + '/upload/file'" :on-success="handleAvatarSuccess_five" ref="upload">
|
||||
<el-button type="primary">
|
||||
上传
|
||||
</el-button>
|
||||
</el-upload>
|
||||
|
||||
<div>
|
||||
<div v-for="(item, index) in formDataannex1" :key="index" style="margin-left: 5px;display: block;">
|
||||
<a style="margin-left: 10px; color: #4a5dff; align-self: flex-start" :href="item.uri" target="_blank">{{ item.name }}</a>
|
||||
<span style="cursor: pointer;margin-left: 5px;" @click="delFileFn1(index)">x</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
|
||||
</el-form>
|
||||
</popup>
|
||||
<el-dialog v-model="showDialog" title="选择分包合同" width="70%">
|
||||
<procurementTable @customEvent="customEvent"></procurementTable>
|
||||
</el-dialog>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup name="procurementContractEdit">
|
||||
import type { FormInstance } from 'element-plus'
|
||||
import Popup from '@/components/popup/index.vue'
|
||||
|
||||
import procurementTable from '@/components/procurement/index.vue'
|
||||
import { apinegotiationAdd, apinegotiationEdit, apinegotiationDetail } from '@/api/subcontractor'
|
||||
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 showDialog = ref(false)
|
||||
|
||||
const project_name = ref('')
|
||||
const project_code = ref('')
|
||||
const formDataannex = reactive([])
|
||||
const formDataannex1 = reactive([])
|
||||
const tableData = reactive([])
|
||||
const tableData1 = reactive([])
|
||||
import feedback from '@/utils/feedback'
|
||||
import configs from "@/config"
|
||||
const base_url = configs.baseUrl + configs.urlPrefix
|
||||
import useUserStore from "@/stores/modules/user";
|
||||
const userStore = useUserStore();
|
||||
// 上传文件
|
||||
const handleAvatarSuccess_four = (
|
||||
response,
|
||||
uploadFile
|
||||
) => {
|
||||
if (response.code == 0) {
|
||||
feedback.msgError(response.msg);
|
||||
return;
|
||||
}
|
||||
formDataannex.push(
|
||||
{ uri: response.data.uri, name: response.data.name }
|
||||
|
||||
);
|
||||
};
|
||||
// 删除上传的文件
|
||||
const delFileFn = (index: number) => {
|
||||
formDataannex.splice(index, 1)
|
||||
}
|
||||
// 上传文件
|
||||
const handleAvatarSuccess_five = (
|
||||
response,
|
||||
uploadFile
|
||||
) => {
|
||||
if (response.code == 0) {
|
||||
feedback.msgError(response.msg);
|
||||
return;
|
||||
}
|
||||
formDataannex1.push(
|
||||
{ uri: response.data.uri, name: response.data.name }
|
||||
|
||||
);
|
||||
};
|
||||
// 删除上传的文件
|
||||
const delFileFn1 = (index: number) => {
|
||||
formDataannex1.splice(index, 1)
|
||||
}
|
||||
|
||||
|
||||
// 弹窗标题
|
||||
const popupTitle = computed(() => {
|
||||
return mode.value == 'edit' ? '编辑分包洽商' : '新增分包洽商'
|
||||
})
|
||||
|
||||
// 表单数据
|
||||
const formData = reactive({
|
||||
id: '',
|
||||
subcontracting_contract_id: '1',
|
||||
negotiation_name: '',
|
||||
negotiation_no: '',
|
||||
contract_no: '',
|
||||
negotiation_amount: '',
|
||||
negotiation_type: '',
|
||||
signing_date: '',
|
||||
warranty_amount: '',
|
||||
Warranty_expire_date: '',
|
||||
negotiation_content: '',
|
||||
negotiation_quotation: '',
|
||||
negotiation_basis: '',
|
||||
|
||||
})
|
||||
const customEvent = (e: any) => {
|
||||
|
||||
project_name.value = e.name
|
||||
formData.project_id = e.id
|
||||
project_code.value = e.project_code
|
||||
showDialog.value = false;
|
||||
|
||||
};
|
||||
|
||||
|
||||
// 表单验证
|
||||
const formRules = reactive<any>({
|
||||
|
||||
})
|
||||
|
||||
|
||||
// 获取详情
|
||||
const setFormData = async (data: Record<any, any>) => {
|
||||
if (data.negotiation_quotation.length > 0) {
|
||||
if (data.negotiation_quotation.includes(",")) {
|
||||
const arry1 = data.negotiation_quotation.split(',').map((item: any, index: any) => {
|
||||
return {
|
||||
name: `文件${index + 1}`,
|
||||
uri: item
|
||||
};
|
||||
});
|
||||
Object.assign(formDataannex, arry1)
|
||||
} else {
|
||||
const arry1 = [{ name: `文件1`, uri: data.negotiation_quotation }]
|
||||
Object.assign(formDataannex, arry1)
|
||||
|
||||
}
|
||||
}
|
||||
if (data.negotiation_basis.length > 0) {
|
||||
if (data.negotiation_basis.includes(",")) {
|
||||
const arry1 = data.negotiation_basis.split(',').map((item: any, index: any) => {
|
||||
return {
|
||||
name: `文件${index + 1}`,
|
||||
uri: item
|
||||
};
|
||||
});
|
||||
Object.assign(formDataannex1, arry1)
|
||||
} else {
|
||||
const arry1 = [{ name: `文件1`, uri: data.negotiation_basis }]
|
||||
Object.assign(formDataannex1, arry1)
|
||||
|
||||
}
|
||||
}
|
||||
// project_name.value = data.project.name
|
||||
// project_code.value = data.project.project_code
|
||||
|
||||
for (const key in formData) {
|
||||
if (data[key] != null && data[key] != undefined) {
|
||||
//@ts-ignore
|
||||
formData[key] = data[key]
|
||||
}
|
||||
}
|
||||
|
||||
//@ts-ignore
|
||||
formData.signing_date = timeFormat(formData.signing_date, 'yyyy-mm-dd hh:MM:ss')
|
||||
}
|
||||
|
||||
const getDetail = async (row: Record<string, any>) => {
|
||||
const data = await apinegotiationDetail({
|
||||
id: row.id
|
||||
})
|
||||
setFormData(data)
|
||||
}
|
||||
|
||||
|
||||
// 提交按钮
|
||||
const handleSubmit = async () => {
|
||||
if (formDataannex.length > 0) {
|
||||
formData.negotiation_quotation = formDataannex.map((item) => item.uri).toString()
|
||||
}
|
||||
if (formDataannex1.length > 0) {
|
||||
formData.negotiation_basis = formDataannex1.map((item) => item.uri).toString()
|
||||
}
|
||||
await formRef.value?.validate()
|
||||
const data = { ...formData, }
|
||||
mode.value == 'edit'
|
||||
? await apinegotiationEdit(data)
|
||||
: await apinegotiationAdd(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>
|
167
src/views/subcontract/index.vue
Normal file
167
src/views/subcontract/index.vue
Normal file
@ -0,0 +1,167 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-card class="!border-none mb-4" shadow="never">
|
||||
<el-form class="mb-[-16px]" :model="queryParams" inline>
|
||||
<el-form-item label="合同编号" prop="procurement_contract_id">
|
||||
<el-input class="w-[280px]" v-model="queryParams.procurement_contract_id" clearable placeholder="请输入合同编号" />
|
||||
</el-form-item>
|
||||
|
||||
|
||||
<el-form-item label="项目" prop="project_id">
|
||||
<el-select class="w-[280px]" v-model="queryParams.project_id" clearable placeholder="项目">
|
||||
<el-option label="全部" value=""></el-option>
|
||||
<el-option v-for="(item, index) in protype" :key="index" :label="item.name" :value="item.id" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="采购合同" prop="supplier_id">
|
||||
<el-select class="w-[280px]" v-model="queryParams.supplier_id" clearable placeholder="请选择采购合同">
|
||||
<el-option label="全部" value=""></el-option>
|
||||
<el-option v-for="(item, index) in protype" :key="index" :label="item.name" :value="item.id" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="供应商" prop="project_type">
|
||||
<el-select class="w-[280px]" v-model="queryParams.project_type" clearable placeholder="请选择供应商">
|
||||
<el-option label="全部" value=""></el-option>
|
||||
<el-option v-for="(item, index) in protype" :key="index" :label="item.name" :value="item.id" />
|
||||
</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="['project.project/add']" type="primary" @click="handleAdd">
|
||||
<template #icon>
|
||||
<icon name="el-icon-Plus" />
|
||||
</template>
|
||||
新增
|
||||
</el-button>
|
||||
<el-button v-perms="['project.project/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="custom_name" show-overflow-tooltip />
|
||||
<el-table-column label="流程步骤" prop="custom_name" show-overflow-tooltip />
|
||||
<el-table-column label="流程编号" prop="custom_name" show-overflow-tooltip />
|
||||
<el-table-column label="洽商编号" prop="negotiation_no" show-overflow-tooltip />
|
||||
<el-table-column label="合同编号" prop="contract_no" show-overflow-tooltip />
|
||||
<el-table-column label="洽商单名称" prop="negotiation_name" show-overflow-tooltip />
|
||||
<el-table-column label="项目名称" prop="project_code" show-overflow-tooltip />
|
||||
<el-table-column label="供应商" prop="amount" show-overflow-tooltip />
|
||||
<el-table-column label="合同编号" prop="amount_excluding_tax" show-overflow-tooltip />
|
||||
<el-table-column label="洽商报价金额" prop="amount_including_tax" show-overflow-tooltip />
|
||||
<el-table-column label="洽商金额" prop="negotiation_amount" show-overflow-tooltip />
|
||||
<el-table-column label="洽商类别" prop="contract_type">
|
||||
<template #default="{ row }">
|
||||
<dict-value :options="dictData.negotiation_type" :value="row.negotiation_type" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="洽商质保金额" prop="warranty_amount" show-overflow-tooltip />
|
||||
<el-table-column label="洽商质保到期时间" prop="Warranty_expire_date" show-overflow-tooltip />
|
||||
<el-table-column label="备注" prop="remark" show-overflow-tooltip />
|
||||
<el-table-column label="操作" width="160" fixed="right">
|
||||
<template #default="{ row }">
|
||||
<el-button v-perms="['subcontractor.subcontractor/edit']" type="primary" link @click="handleEdit(row)">
|
||||
编辑
|
||||
</el-button>
|
||||
<el-button v-perms="['subcontractor.subcontractor/delete']" type="danger" link @click="handleDelete(row.id)">
|
||||
删除
|
||||
</el-button>
|
||||
<el-button v-perms="['subcontractor.subcontractor/detail']" link @click="handledetail(row)">
|
||||
详情
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
<div class="flex justify-end mt-4">
|
||||
<pagination v-model="pager" @change="getLists" />
|
||||
</div>
|
||||
</el-card>
|
||||
<edit-popup v-if="showEdit" ref="editRef" :dict-data="dictData" @success="getLists" @close="showEdit = false" />
|
||||
<detail-popup v-if="showDtail" ref="detailRef" :dict-data="dictData" @close="showDtail = false" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup name="projectLists">
|
||||
import { usePaging } from '@/hooks/usePaging'
|
||||
import { useDictData } from '@/hooks/useDictOptions'
|
||||
import { apinegotiationLists, apinegotiationDelete, apinegotiationDetail } from '@/api/subcontractor'
|
||||
import { timeFormat } from '@/utils/util'
|
||||
import { getAllProjectTypes } from '@/api/projecttype'
|
||||
const protype = reactive([])
|
||||
import feedback from '@/utils/feedback'
|
||||
import EditPopup from './edit.vue'
|
||||
import DetailPopup from './detail.vue'
|
||||
const detailRef = shallowRef<InstanceType<typeof DetailPopup>>()
|
||||
const editRef = shallowRef<InstanceType<typeof EditPopup>>()
|
||||
// 是否显示编辑框
|
||||
const showEdit = ref(false)
|
||||
const showDtail = ref(false)
|
||||
|
||||
// 查询条件
|
||||
const queryParams = reactive({
|
||||
supplier_id: '',
|
||||
procurement_contract_id: '',
|
||||
contract_no: '',
|
||||
|
||||
project_id: '',
|
||||
|
||||
})
|
||||
|
||||
// 选中数据
|
||||
const selectData = ref<any[]>([])
|
||||
|
||||
// 表格选择后回调事件
|
||||
const handleSelectionChange = (val: any[]) => {
|
||||
selectData.value = val.map(({ id }) => id)
|
||||
}
|
||||
|
||||
// 获取字典数据
|
||||
const { dictData } = useDictData('negotiation_type')
|
||||
// 分页相关
|
||||
const { pager, getLists, resetParams, resetPage } = usePaging({
|
||||
fetchFun: apinegotiationLists,
|
||||
params: queryParams
|
||||
})
|
||||
|
||||
// 添加
|
||||
const handleAdd = async () => {
|
||||
showEdit.value = true
|
||||
await nextTick()
|
||||
editRef.value?.open('add')
|
||||
}
|
||||
|
||||
// 编辑
|
||||
const handleEdit = async (data: any) => {
|
||||
console.log(data.id)
|
||||
let res = await apinegotiationDetail({ id: data.id })
|
||||
showEdit.value = true
|
||||
await nextTick()
|
||||
editRef.value?.open('edit')
|
||||
editRef.value?.setFormData(res)
|
||||
}
|
||||
|
||||
// 删除
|
||||
const handleDelete = async (id: number | any[]) => {
|
||||
await feedback.confirm('确定要删除?')
|
||||
await apinegotiationDelete({ id })
|
||||
getLists()
|
||||
}
|
||||
const handledetail = async (data: any) => {
|
||||
let res = await apinegotiationDetail({ id: data.id })
|
||||
showDtail.value = true
|
||||
await nextTick()
|
||||
detailRef.value?.open()
|
||||
detailRef.value?.setFormData(res)
|
||||
}
|
||||
|
||||
|
||||
getLists()
|
||||
</script>
|
||||
|
161
src/views/subcontracting_contract/detail.vue
Normal file
161
src/views/subcontracting_contract/detail.vue
Normal file
@ -0,0 +1,161 @@
|
||||
|
||||
<template>
|
||||
<div class="detail-popup">
|
||||
<popup ref="popupRef" title="分包合同详情" :async="true" width="80%" @confirm="handleSubmit" @close="handleClose">
|
||||
<el-form ref="formRef" :model="formData" label-width="120px">
|
||||
<el-card class="mb-2">
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="项目名称">
|
||||
{{ formData.contract_name }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="项目编码">
|
||||
{{ formData.contract_name }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="合同名称">
|
||||
{{ formData.contract_name }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="合同编号">
|
||||
{{ formData.contract_code }}
|
||||
</el-form-item>
|
||||
</el-col> <el-col :span="12">
|
||||
<el-form-item label="合同类型">
|
||||
<dict-value :options="dictData.contract_type" :value="formData.contract_type" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item label="付款方式">
|
||||
<dict-value :options="dictData.pay_type" :value="formData.pay_type" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="账期">
|
||||
<dict-value :options="dictData.account_period" :value="formData.account_period" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item label="不含税金额">
|
||||
{{ formData.amount_daxie }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="含税金额">
|
||||
{{ formData.labor_costs }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="金额大写">
|
||||
{{ formData.amount_daxie }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="质保金比例">
|
||||
{{ formData.retention_money_rate }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="质保金">
|
||||
{{ formData.retention_mone }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
|
||||
|
||||
</el-row>
|
||||
</el-card>
|
||||
</el-form>
|
||||
</popup>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup name="customdetail">
|
||||
|
||||
import type { FormInstance } from 'element-plus'
|
||||
import Popup from '@/components/popup/index.vue'
|
||||
import { apiCustomDetail } from '@/api/custom'
|
||||
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 datas = reactive({
|
||||
provinceOptions: [],
|
||||
cityOptions: [],
|
||||
areaOptions: [],
|
||||
});
|
||||
|
||||
|
||||
// 表单数据
|
||||
const formData = reactive({
|
||||
|
||||
})
|
||||
|
||||
|
||||
|
||||
// 获取详情
|
||||
const setFormData = async (data: Record<any, any>) => {
|
||||
Object.assign(formData, data)
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
const getDetail = async (row: Record<string, any>) => {
|
||||
const data = await apiCustomDetail({
|
||||
id: row.id
|
||||
})
|
||||
setFormData(data)
|
||||
}
|
||||
|
||||
|
||||
// 提交按钮
|
||||
const handleSubmit = async () => {
|
||||
popupRef.value?.close()
|
||||
|
||||
}
|
||||
|
||||
//打开弹窗
|
||||
const open = () => {
|
||||
console.log('1111111')
|
||||
popupRef.value?.open()
|
||||
}
|
||||
|
||||
// 关闭回调
|
||||
const handleClose = () => {
|
||||
emit('close')
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
defineExpose({
|
||||
open,
|
||||
setFormData,
|
||||
getDetail
|
||||
})
|
||||
</script>
|
||||
<style lang="scss">
|
||||
.tit {
|
||||
font-size: 1.2em;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
</style>
|
@ -1,107 +1,221 @@
|
||||
<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="org_id">
|
||||
<el-input v-model="formData.org_id" clearable placeholder="请输入组织id" />
|
||||
</el-form-item>
|
||||
<el-form-item label="部门id" prop="department_id">
|
||||
<el-input v-model="formData.department_id" clearable placeholder="请输入部门id" />
|
||||
</el-form-item>
|
||||
<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="contract_no">
|
||||
<el-input v-model="formData.contract_no" clearable placeholder="请输入合同编号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="合同名称" prop="contract_name">
|
||||
<el-input v-model="formData.contract_name" clearable placeholder="请输入合同名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="供应商id" prop="supplier_id">
|
||||
<el-input v-model="formData.supplier_id" clearable placeholder="请输入供应商id" />
|
||||
</el-form-item>
|
||||
<el-form-item label="合同类型" prop="contract_type">
|
||||
<el-radio-group v-model="formData.contract_type" placeholder="请选择合同类型">
|
||||
<el-radio
|
||||
v-for="(item, index) in dictData.contract_type"
|
||||
:key="index"
|
||||
:label="parseInt(item.value)"
|
||||
>
|
||||
{{ item.name }}
|
||||
</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="签订日期" prop="signing_date">
|
||||
<el-date-picker
|
||||
class="flex-1 !flex"
|
||||
v-model="formData.signing_date"
|
||||
clearable
|
||||
type="datetime"
|
||||
value-format="YYYY-MM-DD HH:mm:ss"
|
||||
placeholder="选择签订日期">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="付款方式" prop="pay_type">
|
||||
<el-input v-model="formData.pay_type" clearable placeholder="请输入付款方式" />
|
||||
</el-form-item>
|
||||
<el-form-item label="账期" prop="account_period">
|
||||
<el-radio-group v-model="formData.account_period" placeholder="请选择账期">
|
||||
<el-radio
|
||||
v-for="(item, index) in dictData.account_period"
|
||||
:key="index"
|
||||
:label="parseInt(item.value)"
|
||||
>
|
||||
{{ item.name }}
|
||||
</el-radio>
|
||||
</el-radio-group>
|
||||
</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="amount_daxie">
|
||||
<el-input v-model="formData.amount_daxie" 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="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="不含税金额" prop="amount_excluding_tax">
|
||||
<el-input v-model="formData.amount_excluding_tax" clearable placeholder="请输入不含税金额" />
|
||||
</el-form-item>
|
||||
<el-form-item label="质保金比例" prop="retention_money">
|
||||
<el-input v-model="formData.retention_money" clearable placeholder="请输入质保金比例" />
|
||||
</el-form-item>
|
||||
<el-form-item label="质保金" prop="retention_money_rate">
|
||||
<el-input v-model="formData.retention_money_rate" 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>
|
||||
<popup ref="popupRef" :title="popupTitle" :async="true" width="80%" @confirm="handleSubmit" @close="handleClose">
|
||||
<el-form ref="formRef" :model="formData" label-width="120px" :rules="formRules">
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="项目名称" prop="project_id" @click="showDialog = true">
|
||||
<el-input v-model="project_name" clearable placeholder="请选择项目" />
|
||||
</el-form-item> </el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="项目编码" prop="project_id">
|
||||
<el-input v-model="project_code" clearable placeholder="请选择项目" />
|
||||
</el-form-item> </el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<el-form-item label="合同编号" prop="contract_no">
|
||||
<el-input v-model="formData.contract_no" clearable placeholder="请输入合同编号" />
|
||||
</el-form-item> </el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<el-form-item label="合同名称" prop="contract_name">
|
||||
<el-input v-model="formData.contract_name" clearable placeholder="请输入合同名称" />
|
||||
</el-form-item> </el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<el-form-item label="供应商名称" prop="supplier_id">
|
||||
<el-input v-model="formData.supplier_id" clearable placeholder="请输入供应商合同号" />
|
||||
</el-form-item> </el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="供应商编码" prop="supplier_id">
|
||||
<el-input v-model="formData.supplier_id" clearable placeholder="请输入供应商合同号" />
|
||||
</el-form-item> </el-col>
|
||||
|
||||
|
||||
|
||||
|
||||
<el-col :span="24">
|
||||
|
||||
|
||||
<el-form-item label="合同类型" prop="contract_type">
|
||||
<el-radio-group v-model="formData.contract_type" placeholder="请选择合同类型">
|
||||
<el-radio v-for="(item, index) in dictData.contract_type" :key="index" :label="parseInt(item.value)">
|
||||
{{ item.name }}
|
||||
</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item> </el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="签订日期" prop="signing_date">
|
||||
<el-date-picker class="flex-1 !flex" v-model="formData.signing_date" clearable type="datetime" value-format="YYYY-MM-DD HH:mm:ss" placeholder="选择签订日期">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="合同金额" prop="amount">
|
||||
<el-input v-model="formData.amount" clearable placeholder="请输入合同金额" />
|
||||
</el-form-item> </el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="付款方式" prop="pay_type">
|
||||
<el-radio-group v-model="formData.pay_type" placeholder="请选择付款方式">
|
||||
<el-radio v-for="(item, index) in dictData.pay_type" :key="index" :label="parseInt(item.value)">
|
||||
{{ item.name }}
|
||||
</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item> </el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="账期" prop="account_period">
|
||||
<el-radio-group v-model="formData.account_period" placeholder="请选择账期">
|
||||
<el-radio v-for="(item, index) in dictData.account_period" :key="index" :label="parseInt(item.value)">
|
||||
{{ item.name }}
|
||||
</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item> </el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<el-form-item label="不含税金额" prop="amount_excluding_tax">
|
||||
<el-input v-model="formData.amount_excluding_tax" clearable placeholder="请输入不含税金额" />
|
||||
</el-form-item> </el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="金额大写" prop="amount_daxie">
|
||||
<el-input v-model="formData.amount_daxie" clearable placeholder="请输入金额大写" />
|
||||
</el-form-item> </el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="质保金比例" prop="retention_money_rate">
|
||||
<el-input v-model="formData.retention_money_rate" clearable placeholder="请输入质保金比例" />
|
||||
</el-form-item> </el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="质保金" prop="retention_money">
|
||||
<el-input v-model="formData.retention_money" clearable placeholder="请输入质保金" />
|
||||
</el-form-item> </el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="formData.remark" clearable placeholder="请输入备注" />
|
||||
</el-form-item> </el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="附件" prop="field127">
|
||||
<el-upload accept=".pdf" class="upload-demo" :show-file-list="false" aria-hidden="true" :headers="{ Token: userStore.token }" :action="base_url + '/upload/file'" :on-success="handleAvatarSuccess_four" ref="upload">
|
||||
<el-button type="primary">
|
||||
上传
|
||||
</el-button>
|
||||
</el-upload>
|
||||
|
||||
<div>
|
||||
<div v-for="(item, index) in formDataannex" style="margin-left: 5px;display: block;">
|
||||
<a style="margin-left: 10px; color: #4a5dff; align-self: flex-start" :href="item.uri" target="_blank">{{ item.name }}</a>
|
||||
<span style="cursor: pointer;margin-left: 5px;" @click="delFileFn(index)">x</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<div style="margin-bottom: 30px;">分包合同明细</div>
|
||||
<div style="margin-bottom: 30px;">
|
||||
<el-table :data="formData.work">
|
||||
<el-table-column label="序号">
|
||||
<template #default="{ row }">
|
||||
<el-button @click="handleAdd1(row)">+</el-button>
|
||||
<el-button @click="handleDelete1(row)">-</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="工作类型" prop="subcontracting_budget_id">
|
||||
<template #default="{ row }">
|
||||
<el-input v-model="row.subcontracting_budget_id" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="工作内容" prop="subcontracting_budget_id">
|
||||
<template #default="{ row }"> <el-input v-model="row.subcontracting_budget_id" /> </template></el-table-column>
|
||||
<el-table-column label="项目特征" prop="material_procurement_application_id">
|
||||
<template #default="{ row }"> <el-input v-model="row.subcontracting_budget_id" /> </template></el-table-column>
|
||||
|
||||
|
||||
|
||||
|
||||
<el-table-column label="单位" prop="tax_rate">
|
||||
<template #default="{ row }">
|
||||
<el-input v-model="row.tax_rate" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="工作量" prop="workload">
|
||||
<template #default="{ row }">
|
||||
<el-input v-model="row.workload" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="含税单价" prop="unit_price_including_tax">
|
||||
<template #default="{ row }">
|
||||
<el-input v-model="row.unit_price_including_tax" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="税率" prop="tax_rate">
|
||||
<template #default="{ row }">
|
||||
<el-input v-model="row.tax_rate" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="不含税金额" prop="amount_excluding_tax">
|
||||
<template #default="{ row }">
|
||||
<el-input v-model="row.amount_excluding_tax" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="含税金额" prop="amount_including_tax">
|
||||
<template #default="{ row }">
|
||||
<el-input v-model="row.amount_including_tax" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label=" 备注" prop="remark">
|
||||
<template #default="{ row }">
|
||||
<el-input v-model="row.remark" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
<div style="margin-bottom: 30px;">付款计划</div>
|
||||
<div style="margin-bottom: 30px;">
|
||||
<el-table :data="formData.pay_plan">
|
||||
<el-table-column label="序号">
|
||||
<template #default="{ row }">
|
||||
<el-button @click="handleAdd(row)">+</el-button>
|
||||
<el-button @click="handleDelete(row)">-</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="期次" prop="name1">
|
||||
<template #default="{ row }">
|
||||
<el-select v-model="row.period" clearable placeholder="请选择期次">
|
||||
<el-option v-for="(item, index) in dictData.pay_period " :key="index" :label="item.name" :value="item.id" />
|
||||
</el-select>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="计划付款日期" prop="pay_date">
|
||||
<template #default="{ row }">
|
||||
<el-date-picker v-model="row.pay_date" clearable type="datetime" value-format="YYYY-MM-DD HH:mm:ss" placeholder="选择签订日期">
|
||||
</el-date-picker>
|
||||
</template></el-table-column>
|
||||
<el-table-column label="金额" prop="pay_amount">
|
||||
<template #default="{ row }"> <el-input v-model="row.pay_amount" /> </template></el-table-column>
|
||||
|
||||
<el-table-column label="备注" prop="remark">
|
||||
<template #default="{ row }">
|
||||
<el-input v-model="row.remark" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
</el-form>
|
||||
</popup>
|
||||
<el-dialog v-model="showDialog" title="选择项目" width="70%">
|
||||
<projectTable @customEvent="customEvent"></projectTable>
|
||||
</el-dialog>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup name="subcontractingContractEdit">
|
||||
<script lang="ts" setup name="procurementContractEdit">
|
||||
import type { FormInstance } from 'element-plus'
|
||||
import Popup from '@/components/popup/index.vue'
|
||||
import projectTable from '@/components/project/index.vue'
|
||||
import { apiSubcontractingContractAdd, apiSubcontractingContractEdit, apiSubcontractingContractDetail } from '@/api/subcontracting_contract'
|
||||
import { timeFormat } from '@/utils/util'
|
||||
import type { PropType } from 'vue'
|
||||
@ -115,8 +229,52 @@ const emit = defineEmits(['success', 'close'])
|
||||
const formRef = shallowRef<FormInstance>()
|
||||
const popupRef = shallowRef<InstanceType<typeof Popup>>()
|
||||
const mode = ref('add')
|
||||
const showDialog = ref(false)
|
||||
const showDialog1 = ref(false)
|
||||
const project_name = ref('')
|
||||
const project_code = ref('')
|
||||
const formDataannex = reactive([])
|
||||
const tableData = reactive([])
|
||||
const tableData1 = reactive([])
|
||||
import feedback from '@/utils/feedback'
|
||||
import configs from "@/config"
|
||||
const base_url = configs.baseUrl + configs.urlPrefix
|
||||
import useUserStore from "@/stores/modules/user";
|
||||
const userStore = useUserStore();
|
||||
// 上传文件
|
||||
const handleAvatarSuccess_four = (
|
||||
response,
|
||||
uploadFile
|
||||
) => {
|
||||
if (response.code == 0) {
|
||||
feedback.msgError(response.msg);
|
||||
return;
|
||||
}
|
||||
formDataannex.push(
|
||||
{ uri: response.data.uri, name: response.data.name }
|
||||
|
||||
);
|
||||
};
|
||||
// 删除上传的文件
|
||||
const delFileFn = (index: number) => {
|
||||
formDataannex.splice(index, 1)
|
||||
}
|
||||
const handleAdd = (row: any) => {
|
||||
// 在 row 后面插入一行数据
|
||||
const index = tableData.indexOf(row);
|
||||
tableData.splice(index + 1, 0, {});
|
||||
};
|
||||
|
||||
const handleDelete = (row: any) => {
|
||||
// 删除 row
|
||||
const index = tableData.indexOf(row);
|
||||
tableData.splice(index, 1);
|
||||
}
|
||||
const handleDelete1 = (row: any) => {
|
||||
// 删除 row
|
||||
const index = formData.pay_plan.indexOf(row);
|
||||
formData.material.splice(index, 1);
|
||||
};
|
||||
// 弹窗标题
|
||||
const popupTitle = computed(() => {
|
||||
return mode.value == 'edit' ? '编辑分包合同' : '新增分包合同'
|
||||
@ -125,27 +283,49 @@ const popupTitle = computed(() => {
|
||||
// 表单数据
|
||||
const formData = reactive({
|
||||
id: '',
|
||||
org_id: '',
|
||||
department_id: '',
|
||||
supplier_id: '',
|
||||
approve_id: 1,
|
||||
project_id: '',
|
||||
contract_no: '',
|
||||
contract_name: '',
|
||||
supplier_id: '',
|
||||
contract_type: '',
|
||||
signing_date: '',
|
||||
pay_type: '',
|
||||
account_period: '',
|
||||
amount: '',
|
||||
amount_daxie: '',
|
||||
tax_rate: '',
|
||||
amount_excluding_tax: '',
|
||||
retention_money: '',
|
||||
amount_daxie: '',
|
||||
retention_money_rate: '',
|
||||
retention_money: '',
|
||||
remark: '',
|
||||
annex: '',
|
||||
work: [{
|
||||
subcontracting_budget_id: 2222,
|
||||
workload: 0,
|
||||
unit_price_including_tax: 0,
|
||||
remark: "",
|
||||
amount_excluding_tax: 0,
|
||||
amount_including_tax: 0
|
||||
}],
|
||||
pay_plan: [{
|
||||
period: '',
|
||||
pay_date: '',
|
||||
pay_amount: '',
|
||||
remark: ''
|
||||
}]
|
||||
})
|
||||
const customEvent = (e: any) => {
|
||||
project_name.value = e.name
|
||||
formData.project_id = e.id
|
||||
project_code.value = e.project_code
|
||||
showDialog.value = false;
|
||||
};
|
||||
const customEvent1 = (e: any) => {
|
||||
|
||||
|
||||
showDialog1.value = false;
|
||||
};
|
||||
|
||||
// 表单验证
|
||||
const formRules = reactive<any>({
|
||||
|
||||
@ -154,18 +334,39 @@ const formRules = reactive<any>({
|
||||
|
||||
// 获取详情
|
||||
const setFormData = async (data: Record<any, any>) => {
|
||||
project_name.value = data.project.name
|
||||
project_code.value = data.project.project_code
|
||||
for (const key in formData) {
|
||||
if (data[key] != null && data[key] != undefined) {
|
||||
//@ts-ignore
|
||||
formData[key] = data[key]
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (data.annex.length > 0) {
|
||||
if (data.file.includes(",")) {
|
||||
const arry1 = data.annex.split(',').map((item: any, index: any) => {
|
||||
return {
|
||||
name: `文件${index + 1}`,
|
||||
uri: item
|
||||
};
|
||||
});
|
||||
Object.assign(formDataannex, arry1)
|
||||
} else {
|
||||
const arry1 = [{ name: `文件1`, uri: data.annex }]
|
||||
Object.assign(formDataannex, arry1)
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//@ts-ignore
|
||||
formData.signing_date = timeFormat(formData.signing_date, 'yyyy-mm-dd hh:MM:ss')
|
||||
}
|
||||
|
||||
const getDetail = async (row: Record<string, any>) => {
|
||||
const data = await apiSubcontractingContractDetail({
|
||||
const data = await apiSubcontractingContractAdd({
|
||||
id: row.id
|
||||
})
|
||||
setFormData(data)
|
||||
@ -174,10 +375,13 @@ const getDetail = async (row: Record<string, any>) => {
|
||||
|
||||
// 提交按钮
|
||||
const handleSubmit = async () => {
|
||||
if (formDataannex.length > 0) {
|
||||
formData.annex = formDataannex.map((item) => item.uri).toString()
|
||||
}
|
||||
await formRef.value?.validate()
|
||||
const data = { ...formData, }
|
||||
mode.value == 'edit'
|
||||
? await apiSubcontractingContractEdit(data)
|
||||
const data = { ...formData, }
|
||||
mode.value == 'edit'
|
||||
? await apiSubcontractingContractEdit(data)
|
||||
: await apiSubcontractingContractAdd(data)
|
||||
popupRef.value?.close()
|
||||
emit('success')
|
||||
|
@ -1,11 +1,7 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-card class="!border-none mb-4" shadow="never">
|
||||
<el-form
|
||||
class="mb-[-16px]"
|
||||
:model="queryParams"
|
||||
inline
|
||||
>
|
||||
<el-form class="mb-[-16px]" :model="queryParams" inline>
|
||||
<el-form-item label="部门id" prop="department_id">
|
||||
<el-input class="w-[280px]" v-model="queryParams.department_id" clearable placeholder="请输入部门id" />
|
||||
</el-form-item>
|
||||
@ -25,22 +21,18 @@
|
||||
</template>
|
||||
新增
|
||||
</el-button>
|
||||
<el-button
|
||||
v-perms="['contract.subcontracting_contract/delete']"
|
||||
:disabled="!selectData.length"
|
||||
@click="handleDelete(selectData)"
|
||||
>
|
||||
<el-button v-perms="['contract.subcontracting_contract/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="org_id" show-overflow-tooltip />
|
||||
<el-table-column label="部门id" prop="department_id" show-overflow-tooltip />
|
||||
<el-table-column label="项目id" prop="project_id" show-overflow-tooltip />
|
||||
<el-table-column label="项目名称" prop="org_id" show-overflow-tooltip />
|
||||
<el-table-column label="供应商名称" prop="department_id" show-overflow-tooltip />
|
||||
|
||||
<el-table-column label="合同编号" prop="contract_no" show-overflow-tooltip />
|
||||
<el-table-column label="合同名称" prop="contract_name" show-overflow-tooltip />
|
||||
<el-table-column label="供应商id" prop="supplier_id" show-overflow-tooltip />
|
||||
|
||||
<el-table-column label="合同类型" prop="contract_type">
|
||||
<template #default="{ row }">
|
||||
<dict-value :options="dictData.contract_type" :value="row.contract_type" />
|
||||
@ -63,24 +55,17 @@
|
||||
<el-table-column label="不含税金额" prop="amount_excluding_tax" show-overflow-tooltip />
|
||||
<el-table-column label="质保金比例" prop="retention_money" show-overflow-tooltip />
|
||||
<el-table-column label="质保金" prop="retention_money_rate" show-overflow-tooltip />
|
||||
<el-table-column label="操作" width="120" fixed="right">
|
||||
<el-table-column label="操作" width="160" fixed="right">
|
||||
<template #default="{ row }">
|
||||
<el-button
|
||||
v-perms="['contract.subcontracting_contract/edit']"
|
||||
type="primary"
|
||||
link
|
||||
@click="handleEdit(row)"
|
||||
>
|
||||
<el-button v-perms="['contract.subcontracting_contract/edit']" type="primary" link @click="handleEdit(row)">
|
||||
编辑
|
||||
</el-button>
|
||||
<el-button
|
||||
v-perms="['contract.subcontracting_contract/delete']"
|
||||
type="danger"
|
||||
link
|
||||
@click="handleDelete(row.id)"
|
||||
>
|
||||
<el-button v-perms="['contract.subcontracting_contract/delete']" type="danger" link @click="handleDelete(row.id)">
|
||||
删除
|
||||
</el-button>
|
||||
<el-button v-perms="['contract.subcontracting_contract/detail']" link @click="handleDetail(row)">
|
||||
详情
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
@ -89,6 +74,7 @@
|
||||
<pagination v-model="pager" @change="getLists" />
|
||||
</div>
|
||||
</el-card>
|
||||
<detail-popup v-if="showDtail" ref="detailRef" :dict-data="dictData" @close="showDtail = false" />
|
||||
<edit-popup v-if="showEdit" ref="editRef" :dict-data="dictData" @success="getLists" @close="showEdit = false" />
|
||||
</div>
|
||||
</template>
|
||||
@ -96,14 +82,16 @@
|
||||
<script lang="ts" setup name="subcontractingContractLists">
|
||||
import { usePaging } from '@/hooks/usePaging'
|
||||
import { useDictData } from '@/hooks/useDictOptions'
|
||||
import { apiSubcontractingContractLists, apiSubcontractingContractDelete } from '@/api/subcontracting_contract'
|
||||
import { apiSubcontractingContractLists, apiSubcontractingContractDelete, apiSubcontractingContractDetail } from '@/api/subcontracting_contract'
|
||||
import { timeFormat } from '@/utils/util'
|
||||
import feedback from '@/utils/feedback'
|
||||
import EditPopup from './edit.vue'
|
||||
|
||||
import DetailPopup from './detail.vue'
|
||||
const detailRef = shallowRef<InstanceType<typeof DetailPopup>>()
|
||||
const editRef = shallowRef<InstanceType<typeof EditPopup>>()
|
||||
// 是否显示编辑框
|
||||
const showEdit = ref(false)
|
||||
const showDtail = ref(false)
|
||||
|
||||
|
||||
// 查询条件
|
||||
@ -121,7 +109,7 @@ const handleSelectionChange = (val: any[]) => {
|
||||
}
|
||||
|
||||
// 获取字典数据
|
||||
const { dictData } = useDictData('contract_type,account_period,tax_rate')
|
||||
const { dictData } = useDictData('contract_type,account_period,tax_rate,pay_type,pay_period ')
|
||||
|
||||
// 分页相关
|
||||
const { pager, getLists, resetParams, resetPage } = usePaging({
|
||||
@ -138,10 +126,11 @@ const handleAdd = async () => {
|
||||
|
||||
// 编辑
|
||||
const handleEdit = async (data: any) => {
|
||||
let res = await apiSubcontractingContractDetail({ id: data.id })
|
||||
showEdit.value = true
|
||||
await nextTick()
|
||||
editRef.value?.open('edit')
|
||||
editRef.value?.setFormData(data)
|
||||
editRef.value?.setFormData(res)
|
||||
}
|
||||
|
||||
// 删除
|
||||
@ -150,6 +139,15 @@ const handleDelete = async (id: number | any[]) => {
|
||||
await apiSubcontractingContractDelete({ id })
|
||||
getLists()
|
||||
}
|
||||
const handleDetail = async (data: any) => {
|
||||
let res = await apiSubcontractingContractDetail({ id: data.id })
|
||||
showDtail.value = true
|
||||
await nextTick()
|
||||
detailRef.value?.open()
|
||||
detailRef.value?.setFormData(res)
|
||||
}
|
||||
|
||||
|
||||
|
||||
getLists()
|
||||
</script>
|
||||
|
204
src/views/supplier/detail.vue
Normal file
204
src/views/supplier/detail.vue
Normal file
@ -0,0 +1,204 @@
|
||||
|
||||
|
||||
|
||||
<template>
|
||||
<div class="detail-popup">
|
||||
<popup ref="popupRef" title="投标决策详情" :async="true" width="80%" @confirm="handleSubmit" @close="handleClose">
|
||||
<el-form ref="formRef" :model="formData" label-width="160px">
|
||||
<el-card class="mb-2">
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="客户名称">
|
||||
|
||||
{{ formData.custom_name }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="项目名称">
|
||||
{{ formData.project.name }}
|
||||
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="项目编码">
|
||||
{{ formData.project.project_code }}
|
||||
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="项目估算(万元)">
|
||||
{{ formData.project_estimation }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="投标时间">
|
||||
{{ formData.bidding_time }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="购买标书时间">
|
||||
{{ formData.buy_bid_document_date }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="招标项目资金来源">
|
||||
<dict-value :options="dictData.construction_funds_sources" :value="formData.bidding_project_fund_source" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="招标方式">
|
||||
<dict-value :options="dictData.bidding_method" :value="formData.bid_type" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="竞争对手">
|
||||
{{ formData.competitor }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="保证金金额">
|
||||
{{ formData.margin_amount }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="是否需要保证金">
|
||||
<dict-value :options="dictData.whether_status" :value="formData.whether_status" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="保证金金额">
|
||||
{{ formData.competitor }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="开标日期">
|
||||
{{ bid_opening_date }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item label="保证金退还时间">
|
||||
{{ formData.margin_amount_return_date }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="有无内部资源">
|
||||
<dict-value :options="dictData.whether_status" :value="formData.is_internal_resources" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="项目把握度">
|
||||
{{ formData.project_assurancee }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="招标项目概况">
|
||||
{{ formData.bid_project_overview }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="项目简介">
|
||||
{{ formData.project_desc }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
|
||||
</el-row>
|
||||
</el-card>
|
||||
</el-form>
|
||||
</popup>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup name="customdetail">
|
||||
|
||||
import type { FormInstance } from 'element-plus'
|
||||
import Popup from '@/components/popup/index.vue'
|
||||
import { apiCustomDetail } from '@/api/custom'
|
||||
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 datas = reactive({
|
||||
provinceOptions: [],
|
||||
cityOptions: [],
|
||||
areaOptions: [],
|
||||
});
|
||||
|
||||
|
||||
// 表单数据
|
||||
const formData = reactive({
|
||||
|
||||
|
||||
})
|
||||
|
||||
|
||||
// 获取详情
|
||||
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]
|
||||
|
||||
// }
|
||||
|
||||
// }
|
||||
|
||||
Object.assign(formData, data)
|
||||
console.log(formData, '2222222222')
|
||||
|
||||
|
||||
}
|
||||
|
||||
const getDetail = async (row: Record<string, any>) => {
|
||||
const data = await apiCustomDetail({
|
||||
id: row.id
|
||||
})
|
||||
setFormData(data)
|
||||
}
|
||||
|
||||
|
||||
// 提交按钮
|
||||
const handleSubmit = async () => {
|
||||
popupRef.value?.close()
|
||||
|
||||
}
|
||||
|
||||
//打开弹窗
|
||||
const open = () => {
|
||||
console.log('1111111')
|
||||
popupRef.value?.open()
|
||||
}
|
||||
|
||||
// 关闭回调
|
||||
const handleClose = () => {
|
||||
emit('close')
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
defineExpose({
|
||||
open,
|
||||
setFormData,
|
||||
getDetail
|
||||
})
|
||||
</script>
|
||||
<style lang="scss">
|
||||
.tit {
|
||||
font-size: 1.2em;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
</style>
|
173
src/views/supplier/edit.vue
Normal file
173
src/views/supplier/edit.vue
Normal file
@ -0,0 +1,173 @@
|
||||
<template>
|
||||
<div class="edit-popup">
|
||||
<popup ref="popupRef" :title="popupTitle" :async="true" width="80%" @confirm="handleSubmit" @close="handleClose">
|
||||
<el-form ref="formRef" :model="formData" label-width="90px" :rules="formRules">
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="项目名称" prop="bid_document_examination_id" :rules="[{ required: true, message: '不可为空', trigger: 'blur' }]" @click="showDialog = true">
|
||||
<el-input v-model="project_name" readonly clearable placeholder="请输入" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="项目编码" prop="bid_document_examination_id" :rules="[{ required: true, message: '不可为空', trigger: 'blur' }]">
|
||||
<el-input v-model="project_code" clearable readonly placeholder="请输入" />
|
||||
</el-form-item></el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="客户名称" prop="bid_document_examination_id" :rules="[{ required: true, message: '不可为空', trigger: 'blur' }]">
|
||||
<el-input v-model="matsname" clearable readonly placeholder="请输入" />
|
||||
</el-form-item></el-col><el-col :span="8">
|
||||
<!-- @click="showDialog1 = true" -->
|
||||
<el-form-item label="产品id" prop="product_id">
|
||||
<el-input v-model="formData.product_id" readonly clearable placeholder="请输入产品id" />
|
||||
</el-form-item></el-col><el-col :span="8">
|
||||
<el-form-item label="产品数量" prop="product_num">
|
||||
<el-input v-model="formData.product_num" clearable placeholder="请输入产品数量" />
|
||||
</el-form-item></el-col><el-col :span="8">
|
||||
<el-form-item label="成本单价" prop="cost_unit_price">
|
||||
<el-input v-model="formData.cost_unit_price" clearable placeholder="请输入成本单价" />
|
||||
</el-form-item></el-col><el-col :span="8">
|
||||
<el-form-item label="金额" prop="amount">
|
||||
<el-input v-model="formData.amount" clearable placeholder="请输入金额" />
|
||||
</el-form-item></el-col><el-col :span="8">
|
||||
<el-form-item label="点数" prop="rate">
|
||||
<el-input v-model="formData.rate" clearable placeholder="请输入点数" />
|
||||
</el-form-item></el-col><el-col :span="8">
|
||||
<el-form-item label="报价单价" prop="unit_price">
|
||||
<el-input v-model="formData.unit_price" clearable placeholder="请输入报价单价" />
|
||||
</el-form-item></el-col><el-col :span="8">
|
||||
<el-form-item label="报价金额" prop="total_amount">
|
||||
<el-input v-model="formData.total_amount" clearable placeholder="请输入报价金额" />
|
||||
</el-form-item></el-col><el-col :span="8">
|
||||
<el-form-item label="" prop="create_user">
|
||||
<el-input v-model="formData.create_user" clearable placeholder="请输入" />
|
||||
</el-form-item></el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</popup>
|
||||
<el-dialog v-model="showDialog" title="选择标书" width="70%">
|
||||
<biddocumentTable @customEvent="customEvent"></biddocumentTable>
|
||||
|
||||
</el-dialog>
|
||||
<el-dialog v-model="showDialog1" title="选择产品" width="70%">
|
||||
<prodctTable @customEvent="customEvent1"></prodctTable>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup name="bidDocumentExaminationDetailEdit">
|
||||
import type { FormInstance } from 'element-plus'
|
||||
import Popup from '@/components/popup/index.vue'
|
||||
import biddocumentTable from "@/components/biddocument/index.vue"
|
||||
import prodctTable from "@/components/product/index.vue"
|
||||
import { apiBidDocumentExaminationDetailAdd, apiBidDocumentExaminationDetailEdit, apiBidDocumentExaminationDetailDetail } from '@/api/bid_document_examination_detail'
|
||||
import { timeFormat } from '@/utils/util'
|
||||
import projectTable from "@/components/project/index.vue"
|
||||
import type { PropType } from 'vue'
|
||||
defineProps({
|
||||
dictData: {
|
||||
type: Object as PropType<Record<string, any[]>>,
|
||||
default: () => ({})
|
||||
}
|
||||
})
|
||||
const matsname = ref('')
|
||||
const project_name = ref('')
|
||||
const project_code = ref('')
|
||||
const emit = defineEmits(['success', 'close'])
|
||||
const formRef = shallowRef<FormInstance>()
|
||||
const popupRef = shallowRef<InstanceType<typeof Popup>>()
|
||||
const mode = ref('add')
|
||||
const showDialog = ref(false)
|
||||
const showDialog1 = ref(false)
|
||||
// 弹窗标题
|
||||
const popupTitle = computed(() => {
|
||||
return mode.value == 'edit' ? '编辑标书审查-报价明细' : '新增标书审查-报价明细'
|
||||
})
|
||||
|
||||
// 表单数据
|
||||
const formData = reactive({
|
||||
id: '',
|
||||
bid_document_examination_id: '',
|
||||
product_id: '',
|
||||
product_num: '',
|
||||
cost_unit_price: '',
|
||||
amount: '',
|
||||
rate: '',
|
||||
unit_price: '',
|
||||
total_amount: '',
|
||||
create_user: '',
|
||||
})
|
||||
|
||||
|
||||
// 表单验证
|
||||
const formRules = reactive<any>({
|
||||
|
||||
})
|
||||
|
||||
//获取值
|
||||
const customEvent = (e: any) => {
|
||||
formData.bid_document_examination_id = e.id;
|
||||
matsname.value = e.person
|
||||
project_name.value = e.custom_name
|
||||
project_code.value = e.project_code
|
||||
showDialog.value = false;
|
||||
|
||||
|
||||
};
|
||||
//获取值
|
||||
const customEvent1 = (e: any) => {
|
||||
// formData.buy_bidding_document_id = e.id;
|
||||
|
||||
showDialog1.value = false;
|
||||
|
||||
|
||||
};
|
||||
// 获取详情
|
||||
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 apiBidDocumentExaminationDetailDetail({
|
||||
id: row.id
|
||||
})
|
||||
setFormData(data)
|
||||
}
|
||||
|
||||
|
||||
// 提交按钮
|
||||
const handleSubmit = async () => {
|
||||
await formRef.value?.validate()
|
||||
const data = { ...formData, }
|
||||
mode.value == 'edit'
|
||||
? await apiBidDocumentExaminationDetailEdit(data)
|
||||
: await apiBidDocumentExaminationDetailAdd(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>
|
135
src/views/supplier/index.vue
Normal file
135
src/views/supplier/index.vue
Normal file
@ -0,0 +1,135 @@
|
||||
<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="bid_document_examination_id">
|
||||
<el-input class="w-[280px]" v-model="queryParams.bid_document_examination_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>
|
||||
<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_document_examination_detail/add']" type="primary" @click="handleAdd">
|
||||
<template #icon>
|
||||
<icon name="el-icon-Plus" />
|
||||
</template>
|
||||
新增
|
||||
</el-button>
|
||||
<el-button v-perms="['bid.bid_document_examination_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="bid_document_examination_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="cost_unit_price" show-overflow-tooltip />
|
||||
<el-table-column label="金额" prop="amount" show-overflow-tooltip />
|
||||
<el-table-column label="点数" prop="rate" show-overflow-tooltip />
|
||||
<el-table-column label="报价单价" prop="unit_price" show-overflow-tooltip />
|
||||
<el-table-column label="报价金额" prop="total_amount" show-overflow-tooltip />
|
||||
<el-table-column label="" prop="create_user" show-overflow-tooltip />
|
||||
<el-table-column label="操作" width="160" fixed="right">
|
||||
<template #default="{ row }">
|
||||
<el-button v-perms="['bid.bid_document_examination_detail/edit']" type="primary" link @click="handleEdit(row)">
|
||||
编辑
|
||||
</el-button>
|
||||
<el-button v-perms="['bid.bid_document_examination_detail/delete']" type="danger" link @click="handleDelete(row.id)">
|
||||
删除
|
||||
</el-button>
|
||||
<el-button v-perms="['bid.bid_document_examination_detail/detail']" link @click="handledetail(row)">
|
||||
详情
|
||||
</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>
|
||||
<detail-popup v-if="showDtail" ref="detailRef" :dict-data="dictData" @close="showDtail = false" />
|
||||
<edit-popup v-if="showEdit" ref="editRef" :dict-data="dictData" @success="getLists" @close="showEdit = false" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup name="bidDocumentExaminationDetailLists">
|
||||
import { usePaging } from '@/hooks/usePaging'
|
||||
import { useDictData } from '@/hooks/useDictOptions'
|
||||
import { apiBidDocumentExaminationDetailLists, apiBidDocumentExaminationDetailDelete, apiBidDocumentExaminationDetailDetail } from '@/api/bid_document_examination_detail'
|
||||
import { timeFormat } from '@/utils/util'
|
||||
import feedback from '@/utils/feedback'
|
||||
import EditPopup from './edit.vue'
|
||||
import DetailPopup from './detail.vue'
|
||||
const detailRef = shallowRef<InstanceType<typeof DetailPopup>>()
|
||||
const editRef = shallowRef<InstanceType<typeof EditPopup>>()
|
||||
// 是否显示编辑框
|
||||
const showEdit = ref(false)
|
||||
|
||||
const showDtail = ref(false)
|
||||
|
||||
|
||||
|
||||
// 查询条件
|
||||
const queryParams = reactive({
|
||||
bid_document_examination_id: '',
|
||||
product_id: ''
|
||||
})
|
||||
|
||||
// 选中数据
|
||||
const selectData = ref<any[]>([])
|
||||
|
||||
// 表格选择后回调事件
|
||||
const handleSelectionChange = (val: any[]) => {
|
||||
selectData.value = val.map(({ id }) => id)
|
||||
}
|
||||
|
||||
// 获取字典数据
|
||||
const { dictData } = useDictData('')
|
||||
|
||||
// 分页相关
|
||||
const { pager, getLists, resetParams, resetPage } = usePaging({
|
||||
fetchFun: apiBidDocumentExaminationDetailLists,
|
||||
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 apiBidDocumentExaminationDetailDelete({ id })
|
||||
getLists()
|
||||
}
|
||||
//详情
|
||||
const handledetail = async (data: any) => {
|
||||
let res = await apiBidDocumentExaminationDetailDetail({ id: data.id })
|
||||
showDtail.value = true
|
||||
await nextTick()
|
||||
|
||||
detailRef.value?.open()
|
||||
detailRef.value?.setFormData(res)
|
||||
}
|
||||
getLists()
|
||||
</script>
|
||||
|
Loading…
x
Reference in New Issue
Block a user