采购申请 以及 项目预算模块
This commit is contained in:
parent
1c8479b198
commit
089c140dec
27
src/api/material_purchase_request.ts
Normal file
27
src/api/material_purchase_request.ts
Normal file
@ -0,0 +1,27 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 材料申购列表
|
||||
export function materialrequestLists(params: any) {
|
||||
return request.get({ url: '/material.material_purchase_request/lists', params })
|
||||
}
|
||||
|
||||
// 添加材料申购
|
||||
export function materialrequestAdd(params: any) {
|
||||
return request.post({ url: '/material.material_purchase_request/add', params })
|
||||
}
|
||||
|
||||
// 编辑材料申购
|
||||
export function materialrequestEdit(params: any) {
|
||||
return request.post({ url: '/material.material_purchase_request/edit', params })
|
||||
}
|
||||
|
||||
// 删除材料申购
|
||||
export function materialrequestDelete(params: any) {
|
||||
return request.post({ url: '/material.material_purchase_request/delete', params })
|
||||
}
|
||||
|
||||
// 材料申购详情
|
||||
export function materialrequestDetail(params: any) {
|
||||
return request.get({ url: '/material.material_purchase_request/detail', params })
|
||||
}
|
||||
|
27
src/api/material_purchase_request_detail.ts
Normal file
27
src/api/material_purchase_request_detail.ts
Normal file
@ -0,0 +1,27 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 材料申购明细列表
|
||||
export function materialrequestDetailLists(params: any) {
|
||||
return request.get({ url: '/material.material_purchase_request_detail/lists', params })
|
||||
}
|
||||
|
||||
// 添加材料申购明细
|
||||
export function materialrequestDetailAdd(params: any) {
|
||||
return request.post({ url: '/material.material_purchase_request_detail/add', params })
|
||||
}
|
||||
|
||||
// 编辑材料申购明细
|
||||
export function materialrequestDetailEdit(params: any) {
|
||||
return request.post({ url: '/material.material_purchase_request_detail/edit', params })
|
||||
}
|
||||
|
||||
// 删除材料申购明细
|
||||
export function materialrequestDetailDelete(params: any) {
|
||||
return request.post({ url: '/material.material_purchase_request_detail/delete', params })
|
||||
}
|
||||
|
||||
// 材料申购明细详情
|
||||
export function materialrequestDetailDetail(params: any) {
|
||||
return request.get({ url: '/material.material_purchase_request_detail/detail', params })
|
||||
}
|
||||
|
26
src/api/project_material_budget.ts
Normal file
26
src/api/project_material_budget.ts
Normal file
@ -0,0 +1,26 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 材料预算表列表
|
||||
export function apiMaterialbudgetLists(params: any) {
|
||||
return request.get({ url: '/project.project_material_budget/lists', params })
|
||||
}
|
||||
|
||||
// 添加材料预算
|
||||
export function apiMaterialbudgetAdd(params: any) {
|
||||
return request.post({ url: '/project.project_material_budget/add', params })
|
||||
}
|
||||
|
||||
// 编辑材料预算
|
||||
export function apiMaterialbudgetEdit(params: any) {
|
||||
return request.post({ url: '/project.project_material_budget/edit', params })
|
||||
}
|
||||
|
||||
// 删除材料预算
|
||||
export function apiMaterialbudgetDelete(params: any) {
|
||||
return request.post({ url: '/project.project_material_budget/delete', params })
|
||||
}
|
||||
|
||||
// 材料预算详情
|
||||
export function apiMaterialbudgetDetail(params: any) {
|
||||
return request.get({ url: '/project.project_material_budget/detail', params })
|
||||
}
|
26
src/api/project_material_budget_detail.ts
Normal file
26
src/api/project_material_budget_detail.ts
Normal file
@ -0,0 +1,26 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 材料预算明细表列表
|
||||
export function MaterialbudgetDetailLists(params: any) {
|
||||
return request.get({ url: '/project.project_material_budget_detail/lists', params })
|
||||
}
|
||||
|
||||
// 添加材料预算明细
|
||||
export function MaterialbudgetDetailAdd(params: any) {
|
||||
return request.post({ url: '/project.project_material_budget_detail/add', params })
|
||||
}
|
||||
|
||||
// 编辑材料预算明细
|
||||
export function MaterialbudgetDetailEdit(params: any) {
|
||||
return request.post({ url: '/project.project_material_budget_detail/edit', params })
|
||||
}
|
||||
|
||||
// 删除材料预算明细
|
||||
export function MaterialbudgetDetailDelete(params: any) {
|
||||
return request.post({ url: '/project.project_material_budget_detail/delete', params })
|
||||
}
|
||||
|
||||
// 材料预算明细详情
|
||||
export function MaterialbudgetDetailDetail(params: any) {
|
||||
return request.get({ url: '/project.project_material_budget_detail/detail', params })
|
||||
}
|
72
src/components/material_budget/index.vue
Normal file
72
src/components/material_budget/index.vue
Normal file
@ -0,0 +1,72 @@
|
||||
<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="序号" type="index" width="55" />
|
||||
<el-table-column label="预算单号" prop="material_budget_code" show-overflow-tooltip />
|
||||
<el-table-column label="项目名称" prop="project_name" show-overflow-tooltip />
|
||||
<el-table-column label="项目编码" prop="project_code" show-overflow-tooltip />
|
||||
<el-table-column label="预算总数量" prop="total_num" show-overflow-tooltip />
|
||||
<el-table-column label="申请总数量" prop="total_apply_num" show-overflow-tooltip />
|
||||
<el-table-column label="剩余预算数量" prop="total_residual_num" show-overflow-tooltip />
|
||||
<el-table-column label="预算金额" prop="total_amount" 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 { apiMaterialbudgetLists } from '@/api/project_material_budget'
|
||||
|
||||
import { defineEmits } from "vue"
|
||||
import { timeFormat } from '@/utils/util'
|
||||
const props = defineProps({
|
||||
project_id: {
|
||||
type: String
|
||||
}
|
||||
})
|
||||
// 查询条件
|
||||
const queryParams = reactive({
|
||||
|
||||
|
||||
project_id: props.project_id
|
||||
});
|
||||
const { dictData } = useDictData('')
|
||||
|
||||
// 选中数据
|
||||
const emits = defineEmits(["customEvent"]);
|
||||
|
||||
// 选中数据子父传递
|
||||
const handleCurrentChange = (value: any) => {
|
||||
emits("customEvent", value);
|
||||
};
|
||||
|
||||
// 分页相关
|
||||
const { pager, getLists, resetParams, resetPage } = usePaging({
|
||||
fetchFun: apiMaterialbudgetLists,
|
||||
params: queryParams,
|
||||
|
||||
});
|
||||
|
||||
getLists();
|
||||
</script>
|
79
src/components/material_budget_detail/index.vue
Normal file
79
src/components/material_budget_detail/index.vue
Normal file
@ -0,0 +1,79 @@
|
||||
<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="序号" type="index" width="55" />
|
||||
<el-table-column label="材料大类" prop="material_first_level" show-overflow-tooltip />
|
||||
<el-table-column label="材料中类" prop="material_second_level" show-overflow-tooltip />
|
||||
<el-table-column label="材料小类" prop="material_three_level" show-overflow-tooltip />
|
||||
<el-table-column label="材料名称" prop="material_name" show-overflow-tooltip />
|
||||
<el-table-column label="材料编码" prop="material_code" show-overflow-tooltip />
|
||||
<el-table-column label="规格型号" prop="material_specs" show-overflow-tooltip />
|
||||
<el-table-column label="品牌" prop="material_brand" show-overflow-tooltip />
|
||||
<el-table-column label="参数说明" prop="material_parameter_description" show-overflow-tooltip />
|
||||
<el-table-column label="单位" prop="material_unit" show-overflow-tooltip />
|
||||
<el-table-column label="申请数量" prop="apply_num" show-overflow-tooltip />
|
||||
<el-table-column label="预算数量" prop="num" show-overflow-tooltip />
|
||||
<el-table-column label="剩余预算数量" prop="residual_num" show-overflow-tooltip />
|
||||
<el-table-column label="备注" prop="remark" 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 { MaterialbudgetDetailLists } from '@/api/project_material_budget_detail'
|
||||
|
||||
|
||||
import { defineEmits } from "vue"
|
||||
import { timeFormat } from '@/utils/util'
|
||||
const props = defineProps({
|
||||
project_id: {
|
||||
type: String
|
||||
}
|
||||
})
|
||||
// 查询条件
|
||||
const queryParams = reactive({
|
||||
|
||||
|
||||
project_id: props.project_id
|
||||
});
|
||||
const { dictData } = useDictData('')
|
||||
|
||||
// 选中数据
|
||||
const emits = defineEmits(["customEvent"]);
|
||||
|
||||
// 选中数据子父传递
|
||||
const handleCurrentChange = (value: any) => {
|
||||
emits("customEvent", value);
|
||||
};
|
||||
|
||||
// 分页相关
|
||||
const { pager, getLists, resetParams, resetPage } = usePaging({
|
||||
fetchFun: MaterialbudgetDetailLists,
|
||||
params: queryParams,
|
||||
|
||||
});
|
||||
|
||||
getLists();
|
||||
</script>
|
@ -1,287 +0,0 @@
|
||||
|
||||
<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="8">
|
||||
<el-form-item label="项目名称">
|
||||
{{ formData.project_name }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="客户名称">
|
||||
{{ formData.custom.name }}
|
||||
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="项目编码">
|
||||
{{ formData.project_code
|
||||
}}
|
||||
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="合同编号">
|
||||
{{ formData.contract.contract_name }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="合同名称">
|
||||
{{ formData.contract ? formData.contract.contract_code : '暂无数据' }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="合同金额">
|
||||
{{ formData.contract.amount
|
||||
}}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="期次">
|
||||
<dict-value :options="dictData.pay_period" :value="formData.period" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="累计开票金额">
|
||||
{{ formData.accumulate_amount }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="累计回款金额">
|
||||
{{ formData.accumulated_payments_received }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="税率">
|
||||
{{ formData.tax_rate }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="发票类型">
|
||||
|
||||
<dict-value :options="dictData.invoice_type" :value="formData.invoice_type" />
|
||||
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="开票金额(含税)">
|
||||
{{ formData.invoicing_amount }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="金额大写">
|
||||
{{ formData.invoicing_amount_daxie }}
|
||||
</el-form-item>
|
||||
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="开票金额(税额)">
|
||||
{{ formData.invoicing_amount }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<el-form-item label="开票金额(非税)">
|
||||
{{ formData.amount_including_tax }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="开票内容">
|
||||
{{ formData.content }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="发票编号">
|
||||
{{ formData.invoice_no }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="开票公司名称">
|
||||
{{ formData.invoicing_company_name }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="纳税人识别号">
|
||||
{{ formData.taxpayer_identification_number }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<el-form-item label="开户银行">
|
||||
{{ formData.deposit_bank }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="账号">
|
||||
{{ formData.bank_accnout }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="开户地址及电话">
|
||||
{{ formData.address_phone }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="收票地址">
|
||||
{{ formData.receiving_address }}
|
||||
</el-form-item>
|
||||
</el-col> <el-col :span="8">
|
||||
<el-form-item label="联系人">
|
||||
{{ formData.contacts }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="联系电话">
|
||||
{{ formData.phone }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="邮寄时间">
|
||||
{{ formData.mailing_time }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="邮寄方式">
|
||||
{{ formData.mailing_type }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="邮寄单号">
|
||||
{{ formData.mailing_no }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="备注">
|
||||
{{ formData.remark }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="附件">
|
||||
<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>
|
||||
</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 formDataannex = reactive([])
|
||||
const datas = reactive({
|
||||
provinceOptions: [],
|
||||
cityOptions: [],
|
||||
areaOptions: [],
|
||||
});
|
||||
|
||||
|
||||
// 表单数据
|
||||
const formData = reactive({
|
||||
|
||||
})
|
||||
|
||||
|
||||
|
||||
|
||||
// 获取详情
|
||||
const setFormData = async (data: Record<any, any>) => {
|
||||
if (data.annex && data.annex.length > 0) {
|
||||
|
||||
const arry1 = data.annex.map((item: any, index: any) => {
|
||||
return {
|
||||
name: `文件${index + 1}`,
|
||||
uri: item
|
||||
};
|
||||
});
|
||||
Object.assign(formDataannex, arry1)
|
||||
|
||||
}
|
||||
|
||||
// for (const key in formData) {
|
||||
// if (data[key] != null && data[key] != undefined) {
|
||||
// //@ts-ignore
|
||||
// formData[key] = data[key]
|
||||
|
||||
// }
|
||||
|
||||
// }
|
||||
|
||||
Object.assign(formData, data)
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
const getDetail = async (row: Record<string, any>) => {
|
||||
const data = await apiCustomDetail({
|
||||
id: formData.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" scoped>
|
||||
.tit {
|
||||
font-size: 1.2em;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
:deep(.my-label) {
|
||||
width: 150px;
|
||||
}
|
||||
</style>
|
@ -1,315 +0,0 @@
|
||||
<template>
|
||||
<div class="edit-popup">
|
||||
|
||||
<popup ref="popupRef" :title="popupTitle" :async="true" width="80%" @confirm="handleSubmit" @close="handleClose">
|
||||
<el-steps :active="active" align-center style="margin-bottom: 20px;">
|
||||
<el-step title="Step 1" description="Some description" />
|
||||
<el-step title="Step 2" description="Some description" />
|
||||
<el-step title="Step 3" description="Some description" />
|
||||
<el-step title="Step 4" description="Some description" />
|
||||
</el-steps>
|
||||
|
||||
<el-form ref="formRef" :model="formData" label-width="auto" :rules="formRules">
|
||||
<el-row :gutter="10">
|
||||
|
||||
|
||||
<el-col :span="8">
|
||||
<el-form-item label="项目名称" prop="contract_id" @click="showDialog1 = true">
|
||||
<el-input v-model="project_name" clearable disabled placeholder="系统自动填写" />
|
||||
</el-form-item>
|
||||
</el-col> <el-col :span="8">
|
||||
<el-form-item label="项目编码" prop="contract_id">
|
||||
<el-input v-model="project_code" clearable disabled placeholder="系统自动填写" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="formData.remark" type="textarea" clearable placeholder="请输入备注" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="申请日期" prop="invoicing_date" :rules="[{ required: true, message: '不可为空', trigger: 'change' }]">
|
||||
|
||||
<el-date-picker class="flex-1 !flex" v-model="formData.invoicing_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="invoicing_date" :rules="[{ required: true, message: '不可为空', trigger: 'change' }]">
|
||||
|
||||
<el-date-picker class="flex-1 !flex" v-model="formData.invoicing_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="annex">
|
||||
<el-input v-model="formData.annex" clearable placeholder="请输入附件" />
|
||||
</el-form-item> -->
|
||||
<el-form-item label="附件" prop="field127">
|
||||
<el-upload accept="doc, docx, xls, xlsx, ppt, pptx, pdf, txt, zip, rar, tar, jpg, png, gif, jpeg, webp, wmv, avi, mpg, mpeg, 3gp, mov, mp4, flv, f4v, rmvb, mkv" 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>
|
||||
|
||||
<el-dialog v-model="showDialog" title="选择客户" width="70%">
|
||||
<customDialog @customEvent="customEvent"></customDialog>
|
||||
</el-dialog>
|
||||
<el-dialog v-model="showDialog1" title="选择合同" width="70%">
|
||||
<projectDialog @customEvent="customEvent1" contract_type="2"></projectDialog>
|
||||
</el-dialog>
|
||||
</el-form>
|
||||
</popup>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup name="projectEdit">
|
||||
import customDialog from '@/components/custom-dialog/index.vue'
|
||||
import type { FormInstance } from 'element-plus'
|
||||
import Popup from '@/components/popup/index.vue'
|
||||
import { toChinesNum } from "@/utils/util";
|
||||
import projectDialog from '@/components/project/index.vue'
|
||||
import { apiinvoiceapplyAdd, apiinvoiceapplyEdit, apiinvoiceapplyDetail } from '@/api/InvoicingRequests'
|
||||
import { getAllProjectTypes } from '@/api/projecttype'
|
||||
import { timeFormat } from '@/utils/util'
|
||||
import { isEmail, isIdCard, isPhone } from '@/utils/validate'
|
||||
import type { PropType } from 'vue'
|
||||
import configs from "@/config"
|
||||
import useUserStore from "@/stores/modules/user";
|
||||
const protype = reactive([])
|
||||
const base_url = configs.baseUrl + configs.urlPrefix
|
||||
const userStore = useUserStore();
|
||||
const active = ref(0)
|
||||
const formDataannex = reactive([])
|
||||
const contract_name = ref('')
|
||||
const project_name = ref('')
|
||||
const project_code = ref('')
|
||||
const project_amount = ref('')
|
||||
const contract_no = ref('')
|
||||
const custom_name = ref('')
|
||||
const next = () => {
|
||||
if (active.value++ > 3) active.value = 0
|
||||
}
|
||||
// 上传文件
|
||||
const handleAvatarSuccess_four = (
|
||||
response,
|
||||
uploadFile
|
||||
) => {
|
||||
if (response.code == 0) {
|
||||
ElMessage.error(response.msg);
|
||||
return;
|
||||
}
|
||||
formDataannex.push(
|
||||
{ uri: response.data.uri, name: response.data.name }
|
||||
|
||||
|
||||
);
|
||||
};
|
||||
//验证
|
||||
const checkPhone = (rule: any, value: any, callback: (arg0: Error) => any) => {
|
||||
|
||||
if (value && !/^1\d{10}$/.test(value)) {
|
||||
callback(new Error('请输入正确的手机号码'));
|
||||
} else {
|
||||
callback()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
const userEmail = (rule: any, value: string, callback: (arg0: Error | undefined) => void) => {
|
||||
|
||||
// const mailReg = /^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+(.[a-zA-Z0-9_-])+/
|
||||
// // if (!value) {
|
||||
// // return callback(new Error('邮箱不能为空'))
|
||||
// // }
|
||||
|
||||
|
||||
if (value && !mailReg.test(value)) {
|
||||
callback(new Error('请输入正确的邮箱格式'))
|
||||
} else {
|
||||
callback()
|
||||
}
|
||||
|
||||
};
|
||||
//监听输入
|
||||
const amountinput = (e) => {
|
||||
// console.log(e)
|
||||
if (e && e > 0) {
|
||||
formData.invoicing_amount_daxie = toChinesNum(e)
|
||||
}
|
||||
}
|
||||
// 删除上传的文件
|
||||
const delFileFn = (index: number) => {
|
||||
formDataannex.splice(index, 1)
|
||||
}
|
||||
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 customEvent = (e: any) => {
|
||||
formData.customer_id = e.id;
|
||||
custom_name.value = e.name;
|
||||
showDialog.value = false;
|
||||
};
|
||||
const customEvent1 = (e: any) => {
|
||||
formData.contract_id = e.id;
|
||||
project_name.value = e.project_name;
|
||||
project_code.value = e.project_code;
|
||||
contract_name.value = e.contract_name;
|
||||
contract_no.value = e.contract_code
|
||||
project_amount.value = e.amount
|
||||
|
||||
showDialog1.value = false;
|
||||
};
|
||||
// 弹窗标题
|
||||
const popupTitle = computed(() => {
|
||||
return mode.value == 'edit' ? '编辑采购需求目表' : '新增采购需求表'
|
||||
})
|
||||
|
||||
// 表单数据
|
||||
const formData = reactive({
|
||||
id: '',
|
||||
customer_id: '',
|
||||
contract_id: '',
|
||||
approve_id: '',
|
||||
invoicing_date: "",
|
||||
period: "",
|
||||
accumulate_amount: '',
|
||||
accumulated_payments_received: '',
|
||||
tax_rate: "",
|
||||
invoice_type: '',
|
||||
invoicing_amount: '',
|
||||
invoicing_amount_daxie: "",
|
||||
tax: '',
|
||||
amount_including_tax: '',
|
||||
content: "",
|
||||
invoice_no: "",
|
||||
remark: "",
|
||||
annex: "",
|
||||
invoicing_company_name: "",
|
||||
taxpayer_identification_number: "",
|
||||
deposit_bank: "",
|
||||
bank_accnout: "",
|
||||
address_phone: "",
|
||||
receiving_address: "",
|
||||
contacts: "",
|
||||
phone: "",
|
||||
mailing_time: "",
|
||||
mailing_type: "",
|
||||
mailing_no: ""
|
||||
})
|
||||
|
||||
|
||||
// 表单验证
|
||||
const formRules = reactive<any>({
|
||||
|
||||
})
|
||||
|
||||
|
||||
// 获取详情
|
||||
const setFormData = async (data: Record<any, any>) => {
|
||||
if (data.annex && data.annex.length > 0) {
|
||||
|
||||
const arry1 = data.annex.map((item: any, index: any) => {
|
||||
return {
|
||||
name: `文件${index + 1}`,
|
||||
uri: item
|
||||
};
|
||||
});
|
||||
Object.assign(formDataannex, arry1)
|
||||
|
||||
}
|
||||
|
||||
|
||||
for (const key in formData) {
|
||||
if (data[key] != null && data[key] != undefined) {
|
||||
//@ts-ignore
|
||||
formData[key] = data[key]
|
||||
}
|
||||
}
|
||||
if (formData.invoicing_amount) {
|
||||
toChinesNum(formData.invoicing_amount)
|
||||
}
|
||||
custom_name.value = data.custom.name
|
||||
project_name.value = data.contract_name;
|
||||
project_code.value = data.contract_code
|
||||
project_amount.value = data.contract.amount
|
||||
contract_name.value = data.contract.contract_name;
|
||||
contract_no.value = data.contract.contract_code
|
||||
|
||||
|
||||
}
|
||||
const getDetail = async (row: Record<string, any>) => {
|
||||
const data = await apiinvoiceapplyDetail({
|
||||
id: row.id
|
||||
})
|
||||
setFormData(data)
|
||||
}
|
||||
|
||||
|
||||
// 提交按钮
|
||||
const handleSubmit = async () => {
|
||||
if (formDataannex.length > 0) {
|
||||
formData.annex = JSON.stringify(formDataannex.map((item: any) => item.uri))
|
||||
}
|
||||
|
||||
console.log(formRef.value?.validate(), '22222222')
|
||||
await formRef.value?.validate()
|
||||
|
||||
|
||||
const data = { ...formData }
|
||||
mode.value == 'edit'
|
||||
? await apiinvoiceapplyEdit(data)
|
||||
: await apiinvoiceapplyAdd(data)
|
||||
popupRef.value?.close()
|
||||
emit('success')
|
||||
}
|
||||
|
||||
//打开弹窗
|
||||
const open = (type = 'add') => {
|
||||
mode.value = type
|
||||
popupRef.value?.open()
|
||||
|
||||
getAllProjectTypes().then((res) => {
|
||||
|
||||
protype.splice(0, protype.length, ...res);
|
||||
})
|
||||
}
|
||||
|
||||
// 关闭回调
|
||||
const handleClose = () => {
|
||||
emit('close')
|
||||
}
|
||||
|
||||
|
||||
|
||||
defineExpose({
|
||||
open,
|
||||
setFormData,
|
||||
getDetail
|
||||
})
|
||||
</script>
|
@ -1,287 +0,0 @@
|
||||
|
||||
<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="8">
|
||||
<el-form-item label="项目名称">
|
||||
{{ formData.project_name }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="客户名称">
|
||||
{{ formData.custom.name }}
|
||||
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="项目编码">
|
||||
{{ formData.project_code
|
||||
}}
|
||||
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="合同编号">
|
||||
{{ formData.contract.contract_name }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="合同名称">
|
||||
{{ formData.contract ? formData.contract.contract_code : '暂无数据' }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="合同金额">
|
||||
{{ formData.contract.amount
|
||||
}}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="期次">
|
||||
<dict-value :options="dictData.pay_period" :value="formData.period" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="累计开票金额">
|
||||
{{ formData.accumulate_amount }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="累计回款金额">
|
||||
{{ formData.accumulated_payments_received }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="税率">
|
||||
{{ formData.tax_rate }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="发票类型">
|
||||
|
||||
<dict-value :options="dictData.invoice_type" :value="formData.invoice_type" />
|
||||
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="开票金额(含税)">
|
||||
{{ formData.invoicing_amount }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="金额大写">
|
||||
{{ formData.invoicing_amount_daxie }}
|
||||
</el-form-item>
|
||||
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="开票金额(税额)">
|
||||
{{ formData.invoicing_amount }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<el-form-item label="开票金额(非税)">
|
||||
{{ formData.amount_including_tax }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="开票内容">
|
||||
{{ formData.content }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="发票编号">
|
||||
{{ formData.invoice_no }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="开票公司名称">
|
||||
{{ formData.invoicing_company_name }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="纳税人识别号">
|
||||
{{ formData.taxpayer_identification_number }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<el-form-item label="开户银行">
|
||||
{{ formData.deposit_bank }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="账号">
|
||||
{{ formData.bank_accnout }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="开户地址及电话">
|
||||
{{ formData.address_phone }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="收票地址">
|
||||
{{ formData.receiving_address }}
|
||||
</el-form-item>
|
||||
</el-col> <el-col :span="8">
|
||||
<el-form-item label="联系人">
|
||||
{{ formData.contacts }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="联系电话">
|
||||
{{ formData.phone }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="邮寄时间">
|
||||
{{ formData.mailing_time }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="邮寄方式">
|
||||
{{ formData.mailing_type }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="邮寄单号">
|
||||
{{ formData.mailing_no }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="备注">
|
||||
{{ formData.remark }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="附件">
|
||||
<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>
|
||||
</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 formDataannex = reactive([])
|
||||
const datas = reactive({
|
||||
provinceOptions: [],
|
||||
cityOptions: [],
|
||||
areaOptions: [],
|
||||
});
|
||||
|
||||
|
||||
// 表单数据
|
||||
const formData = reactive({
|
||||
|
||||
})
|
||||
|
||||
|
||||
|
||||
|
||||
// 获取详情
|
||||
const setFormData = async (data: Record<any, any>) => {
|
||||
if (data.annex && data.annex.length > 0) {
|
||||
|
||||
const arry1 = data.annex.map((item: any, index: any) => {
|
||||
return {
|
||||
name: `文件${index + 1}`,
|
||||
uri: item
|
||||
};
|
||||
});
|
||||
Object.assign(formDataannex, arry1)
|
||||
|
||||
}
|
||||
|
||||
// for (const key in formData) {
|
||||
// if (data[key] != null && data[key] != undefined) {
|
||||
// //@ts-ignore
|
||||
// formData[key] = data[key]
|
||||
|
||||
// }
|
||||
|
||||
// }
|
||||
|
||||
Object.assign(formData, data)
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
const getDetail = async (row: Record<string, any>) => {
|
||||
const data = await apiCustomDetail({
|
||||
id: formData.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" scoped>
|
||||
.tit {
|
||||
font-size: 1.2em;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
:deep(.my-label) {
|
||||
width: 150px;
|
||||
}
|
||||
</style>
|
@ -1,459 +0,0 @@
|
||||
<template>
|
||||
<div class="edit-popup">
|
||||
|
||||
<popup ref="popupRef" :title="popupTitle" :async="true" width="80%" @confirm="handleSubmit" @close="handleClose">
|
||||
<el-steps :active="active" align-center style="margin-bottom: 20px;">
|
||||
<el-step title="Step 1" description="Some description" />
|
||||
<el-step title="Step 2" description="Some description" />
|
||||
<el-step title="Step 3" description="Some description" />
|
||||
<el-step title="Step 4" description="Some description" />
|
||||
</el-steps>
|
||||
|
||||
<el-form ref="formRef" :model="formData" label-width="auto" :rules="formRules">
|
||||
<el-row :gutter="10">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="客户名称" prop="customer_id" :rules="[{ required: true, message: '不可为空', trigger: 'blur' }]">
|
||||
<el-input v-model="custom_name" @click="showDialog = true" clearable placeholder="请选择客户" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="开票日期" prop="invoicing_date" :rules="[{ required: true, message: '不可为空', trigger: 'change' }]">
|
||||
|
||||
<el-date-picker class="flex-1 !flex" v-model="formData.invoicing_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="contract_no" @click="showDialog1 = true">
|
||||
<el-input v-model="contract_no" clearable readonly placeholder="请选择合同" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="合同名称" prop="contract_name">
|
||||
<el-input v-model="contract_name" clearable disabled placeholder="系统自动填写" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="项目名称" prop="contract_id">
|
||||
<el-input v-model="project_name" clearable disabled placeholder="系统自动填写" />
|
||||
</el-form-item>
|
||||
</el-col> <el-col :span="8">
|
||||
<el-form-item label="项目编码" prop="contract_id">
|
||||
<el-input v-model="project_code" clearable disabled placeholder="系统自动填写" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
|
||||
<el-col :span="8">
|
||||
<el-form-item label="合同金额" prop="project_amount">
|
||||
<el-input v-model="project_amount" clearable disabled placeholder="系统自动填写" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="期次" prop="period" :rules="[{ required: true, message: '不可为空', trigger: 'change' }]">
|
||||
<el-select class="flex-1" v-model="formData.period" clearable placeholder="请选择期次">
|
||||
<el-option v-for="(item, index) in dictData.pay_period" :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="accumulate_amount">
|
||||
<el-input v-model="formData.accumulate_amount" clearable placeholder="请输入累计开票金额" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="累计回款金额" prop="accumulated_payments_received">
|
||||
<el-input v-model="formData.accumulated_payments_received" clearable placeholder="请输入累计回款金额" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="税率" prop="tax_rate">
|
||||
<el-input v-model="formData.tax_rate" clearable placeholder="请输入税率" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="发票类型" prop="contacts">
|
||||
<el-select class="flex-1" v-model="formData.invoice_type" clearable placeholder="请选择发票类型">
|
||||
<el-option v-for="(item, index) in dictData.invoice_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="invoicing_amount">
|
||||
<el-input v-model="formData.invoicing_amount" clearable placeholder="请输入开票金额(含税)" @input="amountinput" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="金额大写" prop="invoicing_amount_daxie">
|
||||
<el-input v-model="formData.invoicing_amount_daxie" clearable placeholder="请输入金额大写" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="开票金额(税额)" prop="tax">
|
||||
<el-input v-model="formData.tax" clearable placeholder="请输入开票金额(税额)" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="开票金额(非税)" prop="amount_including_tax">
|
||||
<el-input v-model="formData.amount_including_tax" clearable placeholder="请输入开票金额(非税)" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
|
||||
<el-col :span="24">
|
||||
<el-form-item label="开票内容" prop="content">
|
||||
<el-input v-model="formData.content" type="textarea" clearable placeholder="请输入开票内容" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<el-form-item label="发票编号" prop="invoice_no">
|
||||
<el-input v-model="formData.invoice_no" clearable placeholder="请输入发票编号" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="formData.remark" type="textarea" clearable placeholder="请输入备注" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<!-- <el-form-item label="附件" prop="annex">
|
||||
<el-input v-model="formData.annex" clearable placeholder="请输入附件" />
|
||||
</el-form-item> -->
|
||||
<el-form-item label="附件" prop="field127">
|
||||
<el-upload accept="doc, docx, xls, xlsx, ppt, pptx, pdf, txt, zip, rar, tar, jpg, png, gif, jpeg, webp, wmv, avi, mpg, mpeg, 3gp, mov, mp4, flv, f4v, rmvb, mkv" 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: 20px 0;">客户开票信息</div>
|
||||
|
||||
<el-row :gutter="10">
|
||||
|
||||
<el-col :span="8">
|
||||
<el-form-item label="开票公司名称" prop="invoicing_company_name">
|
||||
<el-input v-model="formData.invoicing_company_name" clearable placeholder="请输入开票公司名称" />
|
||||
</el-form-item>
|
||||
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="纳税人识别号" prop="taxpayer_identification_number">
|
||||
<el-input v-model="formData.taxpayer_identification_number" clearable placeholder="请输入纳税人识别号" />
|
||||
</el-form-item>
|
||||
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="开户银行" prop="deposit_bank">
|
||||
<el-input v-model="formData.deposit_bank" clearable placeholder="请输入开户银行" />
|
||||
</el-form-item>
|
||||
|
||||
</el-col> <el-col :span="8">
|
||||
<el-form-item label="账号" prop="bank_accnout">
|
||||
<el-input v-model="formData.bank_accnout" clearable placeholder="请输入开票公司名称" />
|
||||
</el-form-item>
|
||||
|
||||
</el-col> <el-col :span="8">
|
||||
<el-form-item label="开户地址及电话" prop="address_phone">
|
||||
<el-input v-model="formData.address_phone" clearable placeholder="请输入开户地址及电话" />
|
||||
</el-form-item>
|
||||
|
||||
</el-col>
|
||||
</el-row>
|
||||
<div style="margin: 20px 0;">发票邮寄信息</div>
|
||||
<el-row :gutter="10">
|
||||
|
||||
<el-col :span="8">
|
||||
<el-form-item label="收票地址" prop="receiving_address">
|
||||
<el-input v-model="formData.receiving_address" clearable placeholder="请输入收票地址" />
|
||||
</el-form-item>
|
||||
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="联系人" prop="contacts">
|
||||
<el-input v-model="formData.contacts" clearable placeholder="请输入联系人" />
|
||||
</el-form-item>
|
||||
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="联系电话" prop="phone" :rules="[{ validator: checkPhone, trigger: 'blur' }]">
|
||||
<el-input v-model="formData.phone" clearable placeholder="请输入联系电话" />
|
||||
</el-form-item>
|
||||
|
||||
</el-col> <el-col :span="8">
|
||||
<el-form-item label="邮寄时间" prop="mailing_time">
|
||||
|
||||
<el-date-picker class="flex-1 !flex" v-model="formData.mailing_time" 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="mailing_type">
|
||||
<el-input v-model="formData.mailing_type" clearable placeholder="请输入邮寄方式" />
|
||||
</el-form-item>
|
||||
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="邮寄单号" prop="mailing_no">
|
||||
<el-input v-model="formData.mailing_no" clearable placeholder="请输入邮寄单号" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-dialog v-model="showDialog" title="选择客户" width="70%">
|
||||
<customDialog @customEvent="customEvent"></customDialog>
|
||||
</el-dialog>
|
||||
<el-dialog v-model="showDialog1" title="选择合同" width="70%">
|
||||
<salescontractDialog @customEvent="customEvent1" contract_type="2"></salescontractDialog>
|
||||
</el-dialog>
|
||||
</el-form>
|
||||
</popup>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup name="projectEdit">
|
||||
import customDialog from '@/components/custom-dialog/index.vue'
|
||||
import type { FormInstance } from 'element-plus'
|
||||
import Popup from '@/components/popup/index.vue'
|
||||
import { toChinesNum } from "@/utils/util";
|
||||
import salescontractDialog from '@/components/salescontract/index.vue'
|
||||
import { apiinvoiceapplyAdd, apiinvoiceapplyEdit, apiinvoiceapplyDetail } from '@/api/InvoicingRequests'
|
||||
import { getAllProjectTypes } from '@/api/projecttype'
|
||||
import { timeFormat } from '@/utils/util'
|
||||
import { isEmail, isIdCard, isPhone } from '@/utils/validate'
|
||||
import type { PropType } from 'vue'
|
||||
import configs from "@/config"
|
||||
import useUserStore from "@/stores/modules/user";
|
||||
const protype = reactive([])
|
||||
const base_url = configs.baseUrl + configs.urlPrefix
|
||||
const userStore = useUserStore();
|
||||
const active = ref(0)
|
||||
const formDataannex = reactive([])
|
||||
const contract_name = ref('')
|
||||
const project_name = ref('')
|
||||
const project_code = ref('')
|
||||
const project_amount = ref('')
|
||||
const contract_no = ref('')
|
||||
const custom_name = ref('')
|
||||
const next = () => {
|
||||
if (active.value++ > 3) active.value = 0
|
||||
}
|
||||
// 上传文件
|
||||
const handleAvatarSuccess_four = (
|
||||
response,
|
||||
uploadFile
|
||||
) => {
|
||||
if (response.code == 0) {
|
||||
ElMessage.error(response.msg);
|
||||
return;
|
||||
}
|
||||
formDataannex.push(
|
||||
{ uri: response.data.uri, name: response.data.name }
|
||||
|
||||
|
||||
);
|
||||
};
|
||||
//验证
|
||||
const checkPhone = (rule: any, value: any, callback: (arg0: Error) => any) => {
|
||||
|
||||
if (value && !/^1\d{10}$/.test(value)) {
|
||||
callback(new Error('请输入正确的手机号码'));
|
||||
} else {
|
||||
callback()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
const userEmail = (rule: any, value: string, callback: (arg0: Error | undefined) => void) => {
|
||||
|
||||
// const mailReg = /^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+(.[a-zA-Z0-9_-])+/
|
||||
// // if (!value) {
|
||||
// // return callback(new Error('邮箱不能为空'))
|
||||
// // }
|
||||
|
||||
|
||||
if (value && !mailReg.test(value)) {
|
||||
callback(new Error('请输入正确的邮箱格式'))
|
||||
} else {
|
||||
callback()
|
||||
}
|
||||
|
||||
};
|
||||
//监听输入
|
||||
const amountinput = (e) => {
|
||||
// console.log(e)
|
||||
if (e && e > 0) {
|
||||
formData.invoicing_amount_daxie = toChinesNum(e)
|
||||
}
|
||||
}
|
||||
// 删除上传的文件
|
||||
const delFileFn = (index: number) => {
|
||||
formDataannex.splice(index, 1)
|
||||
}
|
||||
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 customEvent = (e: any) => {
|
||||
formData.customer_id = e.id;
|
||||
custom_name.value = e.name;
|
||||
showDialog.value = false;
|
||||
};
|
||||
const customEvent1 = (e: any) => {
|
||||
formData.contract_id = e.id;
|
||||
project_name.value = e.project_name;
|
||||
project_code.value = e.project_code;
|
||||
contract_name.value = e.contract_name;
|
||||
contract_no.value = e.contract_code
|
||||
project_amount.value = e.amount
|
||||
|
||||
showDialog1.value = false;
|
||||
};
|
||||
// 弹窗标题
|
||||
const popupTitle = computed(() => {
|
||||
return mode.value == 'edit' ? '编辑项目表' : '新增项目表'
|
||||
})
|
||||
|
||||
// 表单数据
|
||||
const formData = reactive({
|
||||
id: '',
|
||||
customer_id: '',
|
||||
contract_id: '',
|
||||
approve_id: '',
|
||||
invoicing_date: "",
|
||||
period: "",
|
||||
accumulate_amount: '',
|
||||
accumulated_payments_received: '',
|
||||
tax_rate: "",
|
||||
invoice_type: '',
|
||||
invoicing_amount: '',
|
||||
invoicing_amount_daxie: "",
|
||||
tax: '',
|
||||
amount_including_tax: '',
|
||||
content: "",
|
||||
invoice_no: "",
|
||||
remark: "",
|
||||
annex: "",
|
||||
invoicing_company_name: "",
|
||||
taxpayer_identification_number: "",
|
||||
deposit_bank: "",
|
||||
bank_accnout: "",
|
||||
address_phone: "",
|
||||
receiving_address: "",
|
||||
contacts: "",
|
||||
phone: "",
|
||||
mailing_time: "",
|
||||
mailing_type: "",
|
||||
mailing_no: ""
|
||||
})
|
||||
|
||||
|
||||
// 表单验证
|
||||
const formRules = reactive<any>({
|
||||
|
||||
})
|
||||
|
||||
|
||||
// 获取详情
|
||||
const setFormData = async (data: Record<any, any>) => {
|
||||
if (data.annex && data.annex.length > 0) {
|
||||
|
||||
const arry1 = data.annex.map((item: any, index: any) => {
|
||||
return {
|
||||
name: `文件${index + 1}`,
|
||||
uri: item
|
||||
};
|
||||
});
|
||||
Object.assign(formDataannex, arry1)
|
||||
|
||||
}
|
||||
|
||||
|
||||
for (const key in formData) {
|
||||
if (data[key] != null && data[key] != undefined) {
|
||||
//@ts-ignore
|
||||
formData[key] = data[key]
|
||||
}
|
||||
}
|
||||
if (formData.invoicing_amount) {
|
||||
toChinesNum(formData.invoicing_amount)
|
||||
}
|
||||
custom_name.value = data.custom.name
|
||||
project_name.value = data.contract_name;
|
||||
project_code.value = data.contract_code
|
||||
project_amount.value = data.contract.amount
|
||||
contract_name.value = data.contract.contract_name;
|
||||
contract_no.value = data.contract.contract_code
|
||||
|
||||
|
||||
}
|
||||
const getDetail = async (row: Record<string, any>) => {
|
||||
const data = await apiinvoiceapplyDetail({
|
||||
id: row.id
|
||||
})
|
||||
setFormData(data)
|
||||
}
|
||||
|
||||
|
||||
// 提交按钮
|
||||
const handleSubmit = async () => {
|
||||
if (formDataannex.length > 0) {
|
||||
formData.annex = JSON.stringify(formDataannex.map((item: any) => item.uri))
|
||||
}
|
||||
|
||||
console.log(formRef.value?.validate(), '22222222')
|
||||
await formRef.value?.validate()
|
||||
|
||||
|
||||
const data = { ...formData }
|
||||
mode.value == 'edit'
|
||||
? await apiinvoiceapplyEdit(data)
|
||||
: await apiinvoiceapplyAdd(data)
|
||||
popupRef.value?.close()
|
||||
emit('success')
|
||||
}
|
||||
|
||||
//打开弹窗
|
||||
const open = (type = 'add') => {
|
||||
mode.value = type
|
||||
popupRef.value?.open()
|
||||
|
||||
getAllProjectTypes().then((res) => {
|
||||
|
||||
protype.splice(0, protype.length, ...res);
|
||||
})
|
||||
}
|
||||
|
||||
// 关闭回调
|
||||
const handleClose = () => {
|
||||
emit('close')
|
||||
}
|
||||
|
||||
|
||||
|
||||
defineExpose({
|
||||
open,
|
||||
setFormData,
|
||||
getDetail
|
||||
})
|
||||
</script>
|
176
src/views/material_purchase_request/detail.vue
Normal file
176
src/views/material_purchase_request/detail.vue
Normal file
@ -0,0 +1,176 @@
|
||||
|
||||
<template>
|
||||
<div class="detail-popup">
|
||||
<popup ref="popupRef" title="材料采购申请详情" :async="true" width="80%" @confirm="handleSubmit" @close="handleClose">
|
||||
<el-descriptions :column="2" border>
|
||||
|
||||
<el-descriptions-item label="项目名称" label-align="left" align="left" label-class-name="my-label"> {{ formData.project_name }}</el-descriptions-item>
|
||||
<el-descriptions-item label="项目编码" label-align="left" align="left" label-class-name="my-label"> {{ formData.project_code }}</el-descriptions-item>
|
||||
<el-descriptions-item label="采购申请单号" label-align="left" align="left" label-class-name="my-label"> {{ formData.material_purchase_request_code }}</el-descriptions-item>
|
||||
<el-descriptions-item label="备注" label-align="left" align="left" label-class-name="my-label"> {{ formData.remark
|
||||
}}</el-descriptions-item>
|
||||
|
||||
|
||||
<el-descriptions-item label="附件" label-align="left" align="left" label-class-name="my-label">
|
||||
<div v-if="formData.annex.length > 0">
|
||||
<div v-for="(item, index) in formData.annex" style="margin-left: 5px;display: block;">
|
||||
<el-link style="margin-left: 10px; color: #4a5dff; align-self: flex-start" :href="item" target="_blank">文件{{ index + 1 }}查看</el-link>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div v-else>
|
||||
暂无附件
|
||||
</div>
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
|
||||
<div>
|
||||
<el-table :data="tableData" stripe style="width: 100%">
|
||||
<el-table-column label="类型" prop='budget_type' width="180" />
|
||||
<el-table-column label="材料大类" prop='material_first_level' width="180" />
|
||||
<el-table-column label="材料名称" prop='material_name' />
|
||||
<el-table-column label="材料编码" prop='material_code' />
|
||||
<el-table-column label="规格型号" prop='material_specs' />
|
||||
|
||||
<el-table-column label="品牌" prop='material_brand' />
|
||||
<el-table-column label="参数说明" prop='material_parameter_description' width="200px" />
|
||||
<el-table-column label="单位" prop='material_unit' />
|
||||
<el-table-column label="数量" prop='num' />
|
||||
<el-table-column label="单价" prop='price' />
|
||||
<el-table-column label="金额" prop='amount' />
|
||||
<el-table-column label="备注" prop='remark' />
|
||||
</el-table>
|
||||
</div>
|
||||
<div style="margin: 10px 0;">
|
||||
<el-pagination v-model:current-page="pager1.page_no" v-model:page-size="pager1.page_size" :page-sizes="[10, 20, 30, 40]" layout="total, sizes, prev, pager, next, jumper" :total="total" @size-change="handleSizeChange1" @current-change="handleCurrentChange1" />
|
||||
</div>
|
||||
</popup>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup name="customdetail">
|
||||
import { MaterialbudgetDetailLists } from '@/api/project_material_budget_detail'
|
||||
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 formDataannex = reactive([])
|
||||
const pager1 = reactive({
|
||||
page_size: 10,
|
||||
page_no: 1,
|
||||
customer_demand_id: ""
|
||||
})
|
||||
const total = ref(0)
|
||||
const datas = reactive({
|
||||
provinceOptions: [],
|
||||
cityOptions: [],
|
||||
areaOptions: [],
|
||||
});
|
||||
|
||||
const tableData = ref([])
|
||||
// 表单数据
|
||||
const formData = reactive({
|
||||
|
||||
})
|
||||
|
||||
//条数
|
||||
const handleSizeChange1 = (val: number) => {
|
||||
|
||||
pager1.page_size = val
|
||||
budgetDetailLists(formData.id)
|
||||
}
|
||||
|
||||
//分页
|
||||
const handleCurrentChange1 = (val: number) => {
|
||||
console.log(`current page: ${val}`)
|
||||
pager1.page_no = val
|
||||
budgetDetailLists(formData.id)
|
||||
}
|
||||
|
||||
//获取预算明细列表
|
||||
const budgetDetailLists = (id) => {
|
||||
MaterialbudgetDetailLists({ 'page_no': pager1.page_no, 'page_size': pager1.page_size, material_budget_id: id }).then((res) => {
|
||||
tableData.value = res.lists
|
||||
total.value = res.count
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
// 获取详情
|
||||
const setFormData = async (data: Record<any, any>) => {
|
||||
Object.assign(formData, data)
|
||||
budgetDetailLists(data.id)
|
||||
if (data.annex && data.annex.length > 0) {
|
||||
|
||||
const arry1 = data.annex.map((item: any, index: any) => {
|
||||
return {
|
||||
name: `文件${index + 1}`,
|
||||
uri: item
|
||||
};
|
||||
});
|
||||
Object.assign(formDataannex, arry1)
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
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" scoped>
|
||||
.tit {
|
||||
font-size: 1.2em;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
:deep(.my-label) {
|
||||
width: 150px;
|
||||
}
|
||||
</style>
|
380
src/views/material_purchase_request/edit.vue
Normal file
380
src/views/material_purchase_request/edit.vue
Normal file
@ -0,0 +1,380 @@
|
||||
<template>
|
||||
<div class="edit-popup">
|
||||
|
||||
<popup ref="popupRef" :title="popupTitle" :async="true" width="80%" @confirm="handleSubmit" @close="handleClose">
|
||||
<el-steps :active="active" align-center style="margin-bottom: 20px;">
|
||||
<el-step title="项目经理" description="Some description" />
|
||||
<el-step title="采购确认" description="Some description" />
|
||||
|
||||
</el-steps>
|
||||
|
||||
<el-form ref="formRef" :model="formData" label-width="auto" :rules="formRules">
|
||||
<div style="display: flex; flex-direction: row-reverse; justify-content: flex-start;margin-bottom: 30px;">
|
||||
|
||||
<el-select class="w-[180px]" v-model="formData.dept_id" clearable placeholder="请选择部门">
|
||||
<el-option v-for="(item, index) in list2" :key="index" :label="item.name" :value="item.id" />
|
||||
</el-select>
|
||||
<el-select class="w-[180px]" v-model="formData.org_id" clearable placeholder="请选择组织" @change="deptrmt">
|
||||
<el-option v-for="(item, index) in list1" :key="index" :label="item.name" :value="item.id" />
|
||||
</el-select>
|
||||
</div>
|
||||
|
||||
<el-row :gutter="10">
|
||||
|
||||
|
||||
<el-col :span="8">
|
||||
<el-form-item label="项目名称" prop="project_id" @click="showDialog1 = true">
|
||||
<el-input v-model="project_name" clearable readonly placeholder="系统自动填写" />
|
||||
</el-form-item>
|
||||
</el-col> <el-col :span="8">
|
||||
<el-form-item label="项目编码" prop="contract_id">
|
||||
<el-input v-model="project_code" clearable disabled placeholder="系统自动填写" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="formData.remark" type="textarea" clearable placeholder="请输入备注" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="申请日期" prop="apply_date" :rules="[{ required: true, message: '不可为空', trigger: 'change' }]">
|
||||
|
||||
<el-date-picker class="flex-1 !flex" v-model="formData.apply_date" clearable type="date" value-format="YYYY-MM-DD" placeholder="选择申请日期">
|
||||
</el-date-picker>
|
||||
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="希望到货日期" prop="arrival_date" :rules="[{ required: true, message: '不可为空', trigger: 'change' }]">
|
||||
|
||||
<el-date-picker class="flex-1 !flex" v-model="formData.arrival_date" clearable type="date" value-format="YYYY-MM-DD " placeholder="选择希望到货日期">
|
||||
</el-date-picker>
|
||||
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<!-- <el-form-item label="附件" prop="annex">
|
||||
<el-input v-model="formData.annex" clearable placeholder="请输入附件" />
|
||||
</el-form-item> -->
|
||||
<el-form-item label="附件" prop="field127">
|
||||
<el-upload accept="doc, docx, xls, xlsx, ppt, pptx, pdf, txt, zip, rar, tar, jpg, png, gif, jpeg, webp, wmv, avi, mpg, mpeg, 3gp, mov, mp4, flv, f4v, rmvb, mkv" 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: 20px 0;">申购明细</div>
|
||||
<el-col :span="24">
|
||||
<div style=" display: flex;justify-content: flex-end;margin-bottom: 30px;">
|
||||
<el-button @click="showDialog = true" type="primary" plain>选择材料</el-button>
|
||||
|
||||
</div>
|
||||
</el-col>
|
||||
<el-row>
|
||||
|
||||
<el-table :data="tablist1">
|
||||
<el-table-column label="序号">
|
||||
<template #default="{ row }">
|
||||
|
||||
<el-button @click="handleAdd(row)" size="small">+</el-button>
|
||||
<el-button @click="handleDelete(row)" size="small">-</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="材料名称" prop="material_name">
|
||||
<template #default="{ row, $index }">
|
||||
<el-input v-model="row.material_name" disabled @click="subjectmu(row, $index)" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="材料编码" prop="material_code">
|
||||
<template #default="{ row }">
|
||||
<el-input v-model="row.material_code" disabled />
|
||||
</template></el-table-column>
|
||||
|
||||
<el-table-column label="规格型号" prop="material_specs">
|
||||
<template #default="{ row }">
|
||||
<el-input v-model="row.material_specs" disabled /> </template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="品牌" prop="material_brand">
|
||||
<template #default="{ row }">
|
||||
<el-input v-model="row.material_brand" disabled /> </template>
|
||||
</el-table-column>
|
||||
<el-table-column label="参数说明" prop="material_parameter_description">
|
||||
<template #default="{ row }">
|
||||
<el-input v-model="row.material_parameter_description" disabled /> </template>
|
||||
</el-table-column>
|
||||
<el-table-column label="单位" prop="material_unit">
|
||||
<template #default="{ row }">
|
||||
<el-input v-model="row.material_unit" disabled /> </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="remark">
|
||||
<template #default="{ row }">
|
||||
<el-input v-model="row.remark" /> </template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
|
||||
</el-row>
|
||||
|
||||
<el-dialog v-model="showDialog" title="选择材料预算" width="70%">
|
||||
<materialDialog @customEvent="customEvent" :project_id="formData.project_id"></materialDialog>
|
||||
</el-dialog>
|
||||
<el-dialog v-model="showDialog1" title="选择项目" width="70%">
|
||||
<projectDialog @customEvent="customEvent1"></projectDialog>
|
||||
</el-dialog>
|
||||
</el-form>
|
||||
</popup>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup name="projectEdit">
|
||||
import materialDialog from '@/components/material_budget_detail/index.vue'
|
||||
import type { FormInstance } from 'element-plus'
|
||||
import Popup from '@/components/popup/index.vue'
|
||||
import { toChinesNum } from "@/utils/util";
|
||||
import projectDialog from '@/components/project/index.vue'
|
||||
import { materialrequestAdd, materialrequestEdit, materialrequestDetail } from '@/api/material_purchase_request'
|
||||
import { getAllProjectTypes } from '@/api/projecttype'
|
||||
import { timeFormat } from '@/utils/util'
|
||||
import { isEmail, isIdCard, isPhone } from '@/utils/validate'
|
||||
import type { PropType } from 'vue'
|
||||
import configs from "@/config"
|
||||
import useUserStore from "@/stores/modules/user";
|
||||
const list1 = reactive([])
|
||||
const list2 = reactive([])
|
||||
import { deptAll } from '@/api/org/department'
|
||||
import { getAll } from '@/api/org/organization'
|
||||
|
||||
|
||||
const base_url = configs.baseUrl + configs.urlPrefix
|
||||
const userStore = useUserStore();
|
||||
const active = ref(0)
|
||||
const formDataannex = reactive([])
|
||||
const project_name = ref('')
|
||||
const project_code = ref('')
|
||||
|
||||
const tablist1 = reactive([])
|
||||
const next = () => {
|
||||
if (active.value++ > 3) active.value = 0
|
||||
}
|
||||
// 上传文件
|
||||
const handleAvatarSuccess_four = (
|
||||
response,
|
||||
uploadFile
|
||||
) => {
|
||||
if (response.code == 0) {
|
||||
ElMessage.error(response.msg);
|
||||
return;
|
||||
}
|
||||
formDataannex.push(
|
||||
{ uri: response.data.uri, name: response.data.name }
|
||||
|
||||
|
||||
);
|
||||
};
|
||||
|
||||
const handleAdd = (row: any) => {
|
||||
// 在 row 后面插入一行数据
|
||||
const index = tablist1.indexOf(row);
|
||||
tablist1.splice(index + 1, 0, {});
|
||||
};
|
||||
|
||||
const handleDelete = (row: any) => {
|
||||
// 删除 row
|
||||
const index = tablist1.indexOf(row);
|
||||
tablist1.splice(index, 1);
|
||||
};
|
||||
|
||||
// 删除上传的文件
|
||||
const delFileFn = (index: number) => {
|
||||
formDataannex.splice(index, 1)
|
||||
}
|
||||
//获取所有组织
|
||||
const getlist = () => {
|
||||
getAll().then((res) => {
|
||||
Object.assign(list1, res)
|
||||
if (res.length > 0 && !formData.org_id) {
|
||||
formData.org_id = res[0].id
|
||||
deptAll({ 'org_id': res[0].id }).then((res) => {
|
||||
if (res.length > 0) {
|
||||
Object.assign(list2, res)
|
||||
formData.dept_id = res[0].id
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
//获取部门
|
||||
const deptrmt = (e: any) => {
|
||||
formData.dept_id = ''
|
||||
getlist1(e)
|
||||
|
||||
}
|
||||
//获取所有部门
|
||||
const getlist1 = (id: any) => {
|
||||
deptAll({ 'org_id': id }).then((res) => {
|
||||
list2.splice(0, list2.length, ...res)
|
||||
})
|
||||
}
|
||||
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 customEvent = (e: any) => {
|
||||
tablist1.splice(0, tablist1.length, {
|
||||
'id': e.id,
|
||||
'material_name': e.material_name,
|
||||
'material_code': e.material_code,
|
||||
'material_specs': e.material_specs,
|
||||
'material_parameter_description': e.material_parameter_description,
|
||||
'material_brand': e.material_brand,
|
||||
'material_unit': e.material_unit
|
||||
})
|
||||
showDialog.value = false;
|
||||
};
|
||||
const customEvent1 = (e: any) => {
|
||||
formData.project_id = e.id;
|
||||
project_name.value = e.name;
|
||||
project_code.value = e.project_code;
|
||||
showDialog1.value = false;
|
||||
};
|
||||
// 弹窗标题
|
||||
const popupTitle = computed(() => {
|
||||
return mode.value == 'edit' ? '编辑采购需求目表' : '新增采购需求表'
|
||||
})
|
||||
|
||||
// 表单数据
|
||||
const formData = reactive({
|
||||
id: '',
|
||||
org_id: '',
|
||||
dept_id: '',
|
||||
project_id: '',
|
||||
apply_date: '',
|
||||
arrival_date: '',
|
||||
remark: '',
|
||||
annex: '',
|
||||
purchase_request_detail: '',
|
||||
})
|
||||
|
||||
|
||||
// 表单验证
|
||||
const formRules = reactive<any>({
|
||||
|
||||
})
|
||||
|
||||
|
||||
// 获取详情
|
||||
const setFormData = async (data: Record<any, any>) => {
|
||||
if (data.annex && data.annex.length > 0) {
|
||||
|
||||
const arry1 = data.annex.map((item: any, index: any) => {
|
||||
return {
|
||||
name: `文件${index + 1}`,
|
||||
uri: item
|
||||
};
|
||||
});
|
||||
Object.assign(formDataannex, arry1)
|
||||
|
||||
}
|
||||
|
||||
if (data.dept_id) {
|
||||
getlist1(data.org_id)
|
||||
}
|
||||
for (const key in formData) {
|
||||
if (data[key] != null && data[key] != undefined) {
|
||||
//@ts-ignore
|
||||
formData[key] = data[key]
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
project_name.value = data.contract_name;
|
||||
project_code.value = data.contract_code
|
||||
|
||||
|
||||
|
||||
}
|
||||
const getDetail = async (row: Record<string, any>) => {
|
||||
const data = await materialrequestDetail({
|
||||
id: row.id
|
||||
})
|
||||
setFormData(data)
|
||||
}
|
||||
|
||||
|
||||
// 提交按钮
|
||||
const handleSubmit = async () => {
|
||||
if (formDataannex.length > 0) {
|
||||
formData.annex = JSON.stringify(formDataannex.map((item: any) => item.uri))
|
||||
}
|
||||
if (tablist1.length > 0) {
|
||||
formData.purchase_request_detail = JSON.stringify(tablist1.map((item) => ({
|
||||
"project_material_budget_detail_id": item.id,
|
||||
"num": item.num,
|
||||
"remark": item.remark
|
||||
})))
|
||||
}
|
||||
|
||||
console.log(formRef.value?.validate(), '22222222')
|
||||
await formRef.value?.validate()
|
||||
|
||||
|
||||
const data = { ...formData }
|
||||
mode.value == 'edit'
|
||||
? await materialrequestEdit(data)
|
||||
: await materialrequestAdd(data)
|
||||
popupRef.value?.close()
|
||||
emit('success')
|
||||
}
|
||||
|
||||
//打开弹窗
|
||||
const open = (type = 'add') => {
|
||||
mode.value = type
|
||||
popupRef.value?.open()
|
||||
|
||||
getlist()
|
||||
}
|
||||
|
||||
// 关闭回调
|
||||
const handleClose = () => {
|
||||
emit('close')
|
||||
}
|
||||
|
||||
|
||||
|
||||
defineExpose({
|
||||
open,
|
||||
setFormData,
|
||||
getDetail
|
||||
})
|
||||
</script>
|
@ -2,24 +2,10 @@
|
||||
<div>
|
||||
<el-card class="!border-none mb-4" shadow="never">
|
||||
<el-form class="mb-[-16px]" :model="queryParams" inline>
|
||||
<el-form-item label="开票公司名称" prop="invoicing_company_name">
|
||||
<el-input class="w-[280px]" v-model="queryParams.invoicing_company_name" clearable placeholder="请输入开票公司名称" />
|
||||
<el-form-item label="采购申请单号" prop="material_purchase_request_code">
|
||||
<el-input class="w-[280px]" v-model="queryParams.material_purchase_request_code" clearable placeholder="请输入采购申请单号" />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="客户" prop="customer_id">
|
||||
<el-select class="w-[280px]" v-model="queryParams.customer_id" clearable placeholder="请选择客户">
|
||||
<el-option label="全部" value=""></el-option>
|
||||
<el-option v-for="(item, i) in list1" :key="i" :label="item.name" :value="item.id" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="合同" prop="contract_id">
|
||||
<el-select class="w-[280px]" v-model="queryParams.contract_id" clearable placeholder="请选择合同">
|
||||
<el-option label="全部" value=""></el-option>
|
||||
<el-option v-for="(item, index) in list" :key="index" :label="item.contract_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>
|
||||
@ -33,9 +19,9 @@
|
||||
</template>
|
||||
新增
|
||||
</el-button>
|
||||
<el-button v-perms="['InvoicingRequests.InvoicingRequests/delete']" :disabled="!selectData.length" @click="handleDelete(selectData)">
|
||||
<!-- <el-button v-perms="['InvoicingRequests.InvoicingRequests/delete']" :disabled="!selectData.length" @click="handleDelete(selectData)">
|
||||
删除
|
||||
</el-button>
|
||||
</el-button> -->
|
||||
|
||||
<div class="mt-4">
|
||||
<el-table :data="pager.lists" @selection-change="handleSelectionChange">
|
||||
@ -43,24 +29,21 @@
|
||||
<el-table-column label="序号" type="index" width="55" />
|
||||
<el-table-column label="处理流程" prop="customer_name" show-overflow-tooltip />
|
||||
<el-table-column label="流程步骤" prop="customer_name" show-overflow-tooltip />
|
||||
<el-table-column label="采购申请单号" prop="customer_name" show-overflow-tooltip />
|
||||
<el-table-column label="采购申请单号" prop="material_purchase_request_code" show-overflow-tooltip />
|
||||
<el-table-column label="项目编码" prop="project_code" show-overflow-tooltip />
|
||||
<el-table-column label="项目名称" prop="project_name" show-overflow-tooltip />
|
||||
|
||||
<el-table-column label="开票日期" prop="invoicing_date" show-overflow-tooltip />
|
||||
<el-table-column label="希望到货日期" prop="invoicing_date" show-overflow-tooltip />
|
||||
<el-table-column label="备注" prop="invoicing_date" show-overflow-tooltip />
|
||||
<el-table-column label="申请人" prop="invoicing_date" show-overflow-tooltip />
|
||||
|
||||
|
||||
<el-table-column label="开票日期" prop="apply_date" show-overflow-tooltip />
|
||||
<el-table-column label="希望到货日期" prop="arrival_date" show-overflow-tooltip />
|
||||
<el-table-column label="备注" prop="remark" show-overflow-tooltip />
|
||||
<!-- <el-table-column label="申请人" prop="invoicing_date" show-overflow-tooltip /> -->
|
||||
<el-table-column label="操作" width="160" fixed="right">
|
||||
<template #default="{ row }">
|
||||
<el-button v-perms="['InvoicingRequests.InvoicingRequests/edit']" type="primary" link @click="handleEdit(row)">
|
||||
<!-- <el-button v-perms="['InvoicingRequests.InvoicingRequests/edit']" type="primary" link @click="handleEdit(row)">
|
||||
编辑
|
||||
</el-button>
|
||||
<el-button v-perms="['InvoicingRequests.InvoicingRequests/delete']" type="danger" link @click="handleDelete(row.id)">
|
||||
删除
|
||||
</el-button>
|
||||
</el-button> -->
|
||||
<el-button v-perms="['InvoicingRequests.InvoicingRequests/detail']" link @click="handledetail(row)">
|
||||
详情
|
||||
</el-button>
|
||||
@ -80,11 +63,8 @@
|
||||
<script lang="ts" setup name="projectLists">
|
||||
import { usePaging } from '@/hooks/usePaging'
|
||||
import { useDictData } from '@/hooks/useDictOptions'
|
||||
import { apiinvoiceapplyLists, apiinvoiceapplyDelete, apiinvoiceapplyDetail } from '@/api/InvoicingRequests'
|
||||
import { materialrequestLists, materialrequestDelete, materialrequestDetail } from '@/api/material_purchase_request'
|
||||
import { timeFormat } from '@/utils/util'
|
||||
import { apiContractLists } from '@/api/contract'
|
||||
import { apiCustomLists } from '@/api/custom'
|
||||
import { getAllProjectTypes } from '@/api/projecttype'
|
||||
const protype = reactive([])
|
||||
import feedback from '@/utils/feedback'
|
||||
import EditPopup from './edit.vue'
|
||||
@ -96,14 +76,12 @@ const showEdit = ref(false)
|
||||
|
||||
const showDtail = ref(false)
|
||||
|
||||
const list = ref([])
|
||||
const list1 = ref([])
|
||||
|
||||
|
||||
// 查询条件
|
||||
const queryParams = reactive({
|
||||
invoicing_company_name: '',
|
||||
contract_id: '',
|
||||
customer_id: '',
|
||||
material_purchase_request_code: '',
|
||||
|
||||
|
||||
|
||||
})
|
||||
@ -121,7 +99,7 @@ const { dictData } = useDictData('pay_period,invoice_type')
|
||||
|
||||
// 分页相关
|
||||
const { pager, getLists, resetParams, resetPage } = usePaging({
|
||||
fetchFun: apiinvoiceapplyLists,
|
||||
fetchFun: materialrequestLists,
|
||||
params: queryParams
|
||||
})
|
||||
|
||||
@ -132,48 +110,33 @@ const handleAdd = async () => {
|
||||
editRef.value?.open('add')
|
||||
}
|
||||
|
||||
// 编辑
|
||||
const handleEdit = async (data: any) => {
|
||||
let res = await apiinvoiceapplyDetail({ id: data.id })
|
||||
showEdit.value = true
|
||||
await nextTick()
|
||||
editRef.value?.open('edit')
|
||||
editRef.value?.setFormData(res)
|
||||
}
|
||||
// // 编辑
|
||||
// const handleEdit = async (data: any) => {
|
||||
// let res = await materialrequestDetail({ 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 apiinvoiceapplyDelete({ id })
|
||||
getLists()
|
||||
}
|
||||
// // 删除
|
||||
// const handleDelete = async (id: number | any[]) => {
|
||||
// await feedback.confirm('确定要删除?')
|
||||
// await materialrequestDelete({ id })
|
||||
// getLists()
|
||||
// }
|
||||
//详情
|
||||
const handledetail = async (data: any) => {
|
||||
let res = await apiinvoiceapplyDetail({ id: data.id })
|
||||
let res = await materialrequestDetail({ id: data.id })
|
||||
showDtail.value = true
|
||||
await nextTick()
|
||||
detailRef.value?.open()
|
||||
detailRef.value?.setFormData(res)
|
||||
}
|
||||
|
||||
//获取客户
|
||||
const getlist1 = () => {
|
||||
apiContractLists().then((res) => {
|
||||
list.value = res.lists
|
||||
})
|
||||
}
|
||||
|
||||
//获取合同
|
||||
const getlist2 = () => {
|
||||
apiCustomLists().then((res) => {
|
||||
// console.log(res)
|
||||
list1.value = res.lists
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
getlist1()
|
||||
getlist2()
|
||||
|
||||
|
||||
|
||||
getLists()
|
141
src/views/material_purchase_request_detail/detail.vue
Normal file
141
src/views/material_purchase_request_detail/detail.vue
Normal file
@ -0,0 +1,141 @@
|
||||
|
||||
<template>
|
||||
<div class="detail-popup">
|
||||
<popup ref="popupRef" title="项目材料采购申请明细调整" :async="true" width="80%" @confirm="handleSubmit" @close="handleClose">
|
||||
<el-descriptions :column="2" border>
|
||||
|
||||
<el-descriptions-item label="项目名称" label-align="left" align="left" label-class-name="my-label"> {{ formData.project_name }}</el-descriptions-item>
|
||||
<el-descriptions-item label="项目编码" label-align="left" align="left" label-class-name="my-label"> {{ formData.project_code }}</el-descriptions-item>
|
||||
<el-descriptions-item label="申请日期" label-align="left" align="left" label-class-name="my-label"> {{ formData.apply_date }}</el-descriptions-item>
|
||||
<el-descriptions-item label="希望到货日期" label-align="left" align="left" label-class-name="my-label"> {{ formData.arrival_date }}</el-descriptions-item>
|
||||
<el-descriptions-item label="材料名称" label-align="left" align="left" label-class-name="my-label"> {{ formData.material_name }}</el-descriptions-item>
|
||||
<el-descriptions-item label="材料编码" label-align="left" align="left" label-class-name="my-label"> {{ formData.material_code }}</el-descriptions-item>
|
||||
<el-descriptions-item label="材料大类" label-align="left" align="left" label-class-name="my-label"> {{ formData.material_first_level }}</el-descriptions-item>
|
||||
<el-descriptions-item label="材料中类" label-align="left" align="left" label-class-name="my-label"> {{ formData.material_second_level
|
||||
}}</el-descriptions-item>
|
||||
<el-descriptions-item label="材料小类" label-align="left" align="left" label-class-name="my-label"> {{ formData.material_three_level }}</el-descriptions-item>
|
||||
<el-descriptions-item label="单位" label-align="left" align="left" label-class-name="my-label"> {{ formData.material_unit }}</el-descriptions-item>
|
||||
|
||||
<el-descriptions-item label="单价" label-align="left" align="left" label-class-name="my-label"> {{ formData.price }}</el-descriptions-item>
|
||||
<el-descriptions-item label="数量" label-align="left" align="left" label-class-name="my-label"> {{ formData.num
|
||||
}}</el-descriptions-item>
|
||||
<el-descriptions-item label="品牌" label-align="left" align="left" label-class-name="my-label"> {{ formData.material_brand
|
||||
}}</el-descriptions-item>
|
||||
|
||||
<el-descriptions-item label="参数说明" label-align="left" align="left" label-class-name="my-label"> {{ formData.material_parameter_description
|
||||
}}</el-descriptions-item>
|
||||
|
||||
|
||||
<el-descriptions-item label="备注" label-align="left" align="left" label-class-name="my-label"> {{ formData.remark
|
||||
}}</el-descriptions-item>
|
||||
|
||||
|
||||
|
||||
</el-descriptions>
|
||||
|
||||
|
||||
</popup>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup name="customdetail">
|
||||
import { MaterialbudgetDetailLists } from '@/api/project_material_budget_detail'
|
||||
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 formDataannex = reactive([])
|
||||
|
||||
|
||||
const datas = reactive({
|
||||
provinceOptions: [],
|
||||
cityOptions: [],
|
||||
areaOptions: [],
|
||||
});
|
||||
|
||||
|
||||
// 表单数据
|
||||
const formData = reactive({
|
||||
|
||||
})
|
||||
|
||||
|
||||
|
||||
// 获取详情
|
||||
const setFormData = async (data: Record<any, any>) => {
|
||||
Object.assign(formData, data)
|
||||
|
||||
if (data.annex && data.annex.length > 0) {
|
||||
|
||||
const arry1 = data.annex.map((item: any, index: any) => {
|
||||
return {
|
||||
name: `文件${index + 1}`,
|
||||
uri: item
|
||||
};
|
||||
});
|
||||
Object.assign(formDataannex, arry1)
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
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" scoped>
|
||||
.tit {
|
||||
font-size: 1.2em;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
:deep(.my-label) {
|
||||
width: 150px;
|
||||
}
|
||||
</style>
|
241
src/views/material_purchase_request_detail/edit.vue
Normal file
241
src/views/material_purchase_request_detail/edit.vue
Normal file
@ -0,0 +1,241 @@
|
||||
<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="auto" :rules="formRules">
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="项目名称">
|
||||
<el-input v-model="project_name" clearable placeholder="请选择项目材料预算" />
|
||||
</el-form-item> </el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="项目编码">
|
||||
<el-input v-model="project_code" clearable placeholder="系统自动填写" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="申请日期" prop="apply_date">
|
||||
|
||||
<el-date-picker class="flex-1 !flex" v-model="apply_date" clearable type="date" value-format="YYYY-MM-DD" placeholder="选择申请日期">
|
||||
</el-date-picker>
|
||||
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="希望到货日期" prop="arrival_date">
|
||||
|
||||
<el-date-picker class="flex-1 !flex" v-model="arrival_date" clearable type="date" value-format="YYYY-MM-DD " placeholder="选择希望到货日期">
|
||||
</el-date-picker>
|
||||
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="材料类别">
|
||||
<el-input v-model="material_first_level" disabled clearable placeholder="系统自动填写" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="材料中类">
|
||||
<el-input v-model="material_second_level" disabled clearable placeholder="系统自动填写" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="材料小类">
|
||||
<el-input v-model="material_three_level" disabled clearable placeholder="系统自动填写" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="材料名称">
|
||||
<el-input v-model="material_name" disabled clearable placeholder="系统自动填写" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="材料编码">
|
||||
<el-input v-model="material_code" disabled clearable placeholder="系统自动填写" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="规格型号">
|
||||
<el-input v-model="material_specs" disabled clearable placeholder="系统自动填写" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="品牌">
|
||||
<el-input v-model="material_brand" disabled clearable placeholder="系统自动填写" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="单位">
|
||||
<el-input v-model="material_unit" disabled clearable placeholder="系统自动填写" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="参数说明">
|
||||
<el-input v-model="material_parameter_description" disabled clearable placeholder="请输入单位" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="单价" prop="price">
|
||||
<el-input v-model="formData.price" disabled clearable placeholder="请输入单价" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<!-- <el-col :span="8">
|
||||
<el-form-item label="预算总数量">
|
||||
<el-input v-model="material_num" clearable placeholder="请输入预算总数量" />
|
||||
</el-form-item>
|
||||
</el-col> -->
|
||||
<el-col :span="8">
|
||||
<el-form-item label="数量" prop="num">
|
||||
<el-input v-model="formData.num" clearable placeholder="请输入数量" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="formData.remark" type="textarea" clearable placeholder="请输入备注" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
</el-row>
|
||||
</el-form>
|
||||
</popup>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup name="projectEdit">
|
||||
import customDialog from '@/components/custom-dialog/index.vue'
|
||||
import type { FormInstance } from 'element-plus'
|
||||
import Popup from '@/components/popup/index.vue'
|
||||
import { toChinesNum } from "@/utils/util";
|
||||
import { materialrequestDetailAdd, materialrequestDetailEdit, materialrequestDetailDetail } from '@/api/material_purchase_request_detail'
|
||||
import { getAllProjectTypes } from '@/api/projecttype'
|
||||
import { timeFormat } from '@/utils/util'
|
||||
import type { PropType } from 'vue'
|
||||
import configs from "@/config"
|
||||
import useUserStore from "@/stores/modules/user";
|
||||
const base_url = configs.baseUrl + configs.urlPrefix
|
||||
const userStore = useUserStore();
|
||||
const active = ref(0)
|
||||
|
||||
const project_name = ref('')
|
||||
const project_code = ref('')
|
||||
const apply_date = ref('')
|
||||
const arrival_date = ref('')
|
||||
const material_name = ref('')
|
||||
const material_code = ref('')
|
||||
const material_parameter_description = ref('')
|
||||
const material_brand = ref('')
|
||||
const material_unit = ref('')
|
||||
const material_specs = ref('')
|
||||
const material_first_level = ref('')
|
||||
const material_second_level = ref('')
|
||||
const material_three_level
|
||||
= ref('')
|
||||
const next = () => {
|
||||
if (active.value++ > 3) active.value = 0
|
||||
}
|
||||
|
||||
defineProps({
|
||||
dictData: {
|
||||
type: Object as PropType<Record<string, any[]>>,
|
||||
default: () => ({})
|
||||
}
|
||||
})
|
||||
const emit = defineEmits(['success', 'close'])
|
||||
const formRef = shallowRef<FormInstance>()
|
||||
const popupRef = shallowRef<InstanceType<typeof Popup>>()
|
||||
const mode = ref('add')
|
||||
|
||||
// 弹窗标题
|
||||
const popupTitle = computed(() => {
|
||||
return mode.value == 'edit' ? '编辑项目表' : '新增项目表'
|
||||
})
|
||||
|
||||
// 表单数据
|
||||
const formData = reactive({
|
||||
id: '',
|
||||
num: '',
|
||||
remark: '',
|
||||
|
||||
})
|
||||
|
||||
|
||||
// 表单验证
|
||||
const formRules = reactive<any>({
|
||||
|
||||
})
|
||||
|
||||
|
||||
// 获取详情
|
||||
const setFormData = async (data: Record<any, any>) => {
|
||||
|
||||
for (const key in formData) {
|
||||
if (data[key] != null && data[key] != undefined) {
|
||||
//@ts-ignore
|
||||
formData[key] = data[key]
|
||||
}
|
||||
}
|
||||
project_name.value = data.project_name
|
||||
project_code.value = data.project_code
|
||||
material_name.value = data.material_name
|
||||
material_code.value = data.material_code
|
||||
material_parameter_description.value = data.material_parameter_description
|
||||
material_brand.value = data.material_brand
|
||||
material_unit.value = data.material_unit
|
||||
material_first_level.value = data.material_first_level
|
||||
material_second_level.value = data.material_second_level
|
||||
material_three_level.value = data.material_three_level
|
||||
material_specs.value = data.material_specs
|
||||
project_name.value = data.project_name;
|
||||
project_code.value = data.project_code
|
||||
apply_date.value = data.apply_date
|
||||
|
||||
arrival_date.value = data.arrival_date
|
||||
|
||||
|
||||
}
|
||||
const getDetail = async (row: Record<string, any>) => {
|
||||
const data = await materialrequestDetailDetail({
|
||||
id: row.id
|
||||
})
|
||||
setFormData(data)
|
||||
}
|
||||
|
||||
|
||||
// 提交按钮
|
||||
const handleSubmit = async () => {
|
||||
|
||||
await formRef.value?.validate()
|
||||
|
||||
|
||||
const data = { ...formData }
|
||||
mode.value == 'edit'
|
||||
? await materialrequestDetailEdit(data)
|
||||
: await materialrequestDetailAdd(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>
|
@ -1,41 +1,8 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-card class="!border-none mb-4" shadow="never">
|
||||
<el-form class="mb-[-16px]" :model="queryParams" inline>
|
||||
<el-form-item label="开票公司名称" prop="invoicing_company_name">
|
||||
<el-input class="w-[280px]" v-model="queryParams.invoicing_company_name" clearable placeholder="请输入开票公司名称" />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="客户" prop="customer_id">
|
||||
<el-select class="w-[280px]" v-model="queryParams.customer_id" clearable placeholder="请选择客户">
|
||||
<el-option label="全部" value=""></el-option>
|
||||
<el-option v-for="(item, i) in list1" :key="i" :label="item.name" :value="item.id" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="合同" prop="contract_id">
|
||||
<el-select class="w-[280px]" v-model="queryParams.contract_id" clearable placeholder="请选择合同">
|
||||
<el-option label="全部" value=""></el-option>
|
||||
<el-option v-for="(item, index) in list" :key="index" :label="item.contract_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="['InvoicingRequests.InvoicingRequests/add']" type="primary" @click="handleAdd">
|
||||
<template #icon>
|
||||
<icon name="el-icon-Plus" />
|
||||
</template>
|
||||
新增
|
||||
</el-button>
|
||||
<el-button v-perms="['InvoicingRequests.InvoicingRequests/delete']" :disabled="!selectData.length" @click="handleDelete(selectData)">
|
||||
删除
|
||||
</el-button>
|
||||
|
||||
|
||||
<div class="mt-4">
|
||||
<el-table :data="pager.lists" @selection-change="handleSelectionChange">
|
||||
@ -45,22 +12,21 @@
|
||||
|
||||
<el-table-column label="项目名称" prop="project_name" show-overflow-tooltip />
|
||||
|
||||
|
||||
<el-table-column label="申请日期" prop="invoicing_amount" show-overflow-tooltip />
|
||||
<el-table-column label="希望到货日期" prop="amount_including_tax" show-overflow-tooltip />
|
||||
<el-table-column label="材料类别" prop="tax_rate" show-overflow-tooltip />
|
||||
<el-table-column label="材料中类" prop="tax" show-overflow-tooltip />
|
||||
<el-table-column label="材料小类" prop="tax" show-overflow-tooltip />
|
||||
<el-table-column label="材料名称" prop="tax" show-overflow-tooltip />
|
||||
<el-table-column label="材料编码" prop="tax" show-overflow-tooltip />
|
||||
<el-table-column label="规格型号" prop="tax" show-overflow-tooltip />
|
||||
<el-table-column label="品牌" prop="tax" show-overflow-tooltip />
|
||||
<el-table-column label="参数说明" prop="tax" show-overflow-tooltip />
|
||||
<el-table-column label="单位" prop="tax" show-overflow-tooltip />
|
||||
<el-table-column label="申请采购数量" prop="tax" show-overflow-tooltip />
|
||||
<el-table-column label="已采购数量" prop="tax" show-overflow-tooltip />
|
||||
<el-table-column label="已调拨数量" prop="tax" show-overflow-tooltip />
|
||||
<el-table-column label="未采购数量" prop="tax" show-overflow-tooltip />
|
||||
<el-table-column label="申请日期" prop="apply_date" show-overflow-tooltip />
|
||||
<el-table-column label="希望到货日期" prop="arrival_date" show-overflow-tooltip />
|
||||
<el-table-column label="材料类别" prop="material_first_level" show-overflow-tooltip />
|
||||
<el-table-column label="材料中类" prop="material_second_level" show-overflow-tooltip />
|
||||
<el-table-column label="材料小类" prop="material_three_level" show-overflow-tooltip />
|
||||
<el-table-column label="材料名称" prop="material_name" show-overflow-tooltip />
|
||||
<el-table-column label="材料编码" prop="material_code" show-overflow-tooltip />
|
||||
<el-table-column label="规格型号" prop="material_specs" show-overflow-tooltip />
|
||||
<el-table-column label="品牌" prop="material_brand" show-overflow-tooltip />
|
||||
<el-table-column label="参数说明" prop="material_parameter_description" show-overflow-tooltip />
|
||||
<el-table-column label="单位" prop="material_unit" show-overflow-tooltip />
|
||||
<el-table-column label="申请采购数量" prop="num" show-overflow-tooltip />
|
||||
<el-table-column label="已采购数量" prop="has_procure_num" show-overflow-tooltip />
|
||||
<!-- <el-table-column label="已调拨数量" prop="tax" show-overflow-tooltip /> -->
|
||||
<el-table-column label="未采购数量" prop="not_procure_num" show-overflow-tooltip />
|
||||
<el-table-column label="备注" prop="tax" show-overflow-tooltip />
|
||||
|
||||
<el-table-column label="操作" width="160" fixed="right">
|
||||
@ -68,9 +34,9 @@
|
||||
<el-button v-perms="['InvoicingRequests.InvoicingRequests/edit']" type="primary" link @click="handleEdit(row)">
|
||||
编辑
|
||||
</el-button>
|
||||
<el-button v-perms="['InvoicingRequests.InvoicingRequests/delete']" type="danger" link @click="handleDelete(row.id)">
|
||||
<!-- <el-button v-perms="['InvoicingRequests.InvoicingRequests/delete']" type="danger" link @click="handleDelete(row.id)">
|
||||
删除
|
||||
</el-button>
|
||||
</el-button> -->
|
||||
<el-button v-perms="['InvoicingRequests.InvoicingRequests/detail']" link @click="handledetail(row)">
|
||||
详情
|
||||
</el-button>
|
||||
@ -90,7 +56,7 @@
|
||||
<script lang="ts" setup name="projectLists">
|
||||
import { usePaging } from '@/hooks/usePaging'
|
||||
import { useDictData } from '@/hooks/useDictOptions'
|
||||
import { apiinvoiceapplyLists, apiinvoiceapplyDelete, apiinvoiceapplyDetail } from '@/api/InvoicingRequests'
|
||||
import { materialrequestDetailLists, materialrequestDetailDelete, materialrequestDetailDetail } from '@/api/material_purchase_request_detail'
|
||||
import { timeFormat } from '@/utils/util'
|
||||
import { apiContractLists } from '@/api/contract'
|
||||
import { apiCustomLists } from '@/api/custom'
|
||||
@ -106,14 +72,10 @@ const showEdit = ref(false)
|
||||
|
||||
const showDtail = ref(false)
|
||||
|
||||
const list = ref([])
|
||||
const list1 = ref([])
|
||||
|
||||
// 查询条件
|
||||
const queryParams = reactive({
|
||||
invoicing_company_name: '',
|
||||
contract_id: '',
|
||||
customer_id: '',
|
||||
|
||||
|
||||
|
||||
})
|
||||
@ -131,7 +93,7 @@ const { dictData } = useDictData('pay_period,invoice_type')
|
||||
|
||||
// 分页相关
|
||||
const { pager, getLists, resetParams, resetPage } = usePaging({
|
||||
fetchFun: apiinvoiceapplyLists,
|
||||
fetchFun: materialrequestDetailLists,
|
||||
params: queryParams
|
||||
})
|
||||
|
||||
@ -144,7 +106,7 @@ const handleAdd = async () => {
|
||||
|
||||
// 编辑
|
||||
const handleEdit = async (data: any) => {
|
||||
let res = await apiinvoiceapplyDetail({ id: data.id })
|
||||
let res = await materialrequestDetailDetail({ id: data.id })
|
||||
showEdit.value = true
|
||||
await nextTick()
|
||||
editRef.value?.open('edit')
|
||||
@ -154,36 +116,19 @@ const handleEdit = async (data: any) => {
|
||||
// 删除
|
||||
const handleDelete = async (id: number | any[]) => {
|
||||
await feedback.confirm('确定要删除?')
|
||||
await apiinvoiceapplyDelete({ id })
|
||||
await materialrequestDetailDelete({ id })
|
||||
getLists()
|
||||
}
|
||||
//详情
|
||||
const handledetail = async (data: any) => {
|
||||
let res = await apiinvoiceapplyDetail({ id: data.id })
|
||||
let res = await materialrequestDetailDetail({ id: data.id })
|
||||
showDtail.value = true
|
||||
await nextTick()
|
||||
detailRef.value?.open()
|
||||
detailRef.value?.setFormData(res)
|
||||
}
|
||||
|
||||
//获取客户
|
||||
const getlist1 = () => {
|
||||
apiContractLists().then((res) => {
|
||||
list.value = res.lists
|
||||
})
|
||||
}
|
||||
|
||||
//获取合同
|
||||
const getlist2 = () => {
|
||||
apiCustomLists().then((res) => {
|
||||
// console.log(res)
|
||||
list1.value = res.lists
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
getlist1()
|
||||
getlist2()
|
||||
|
||||
|
||||
getLists()
|
176
src/views/project_material_budget/detail.vue
Normal file
176
src/views/project_material_budget/detail.vue
Normal file
@ -0,0 +1,176 @@
|
||||
|
||||
<template>
|
||||
<div class="detail-popup">
|
||||
<popup ref="popupRef" title="材料预算详情" :async="true" width="80%" @confirm="handleSubmit" @close="handleClose">
|
||||
<el-descriptions :column="2" border>
|
||||
|
||||
<el-descriptions-item label="项目名称" label-align="left" align="left" label-class-name="my-label"> {{ formData.project_name }}</el-descriptions-item>
|
||||
<el-descriptions-item label="项目编码" label-align="left" align="left" label-class-name="my-label"> {{ formData.project_code }}</el-descriptions-item>
|
||||
<el-descriptions-item label="材料预算单号" label-align="left" align="left" label-class-name="my-label"> {{ formData.material_budget_code }}</el-descriptions-item>
|
||||
<el-descriptions-item label="备注" label-align="left" align="left" label-class-name="my-label"> {{ formData.remark
|
||||
}}</el-descriptions-item>
|
||||
|
||||
|
||||
<el-descriptions-item label="附件" label-align="left" align="left" label-class-name="my-label">
|
||||
<div v-if="formData.annex.length > 0">
|
||||
<div v-for="(item, index) in formData.annex" style="margin-left: 5px;display: block;">
|
||||
<el-link style="margin-left: 10px; color: #4a5dff; align-self: flex-start" :href="item" target="_blank">文件{{ index + 1 }}查看</el-link>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div v-else>
|
||||
暂无附件
|
||||
</div>
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
|
||||
<div>
|
||||
<el-table :data="tableData" stripe style="width: 100%">
|
||||
<el-table-column label="类型" prop='budget_type' width="180" />
|
||||
<el-table-column label="材料大类" prop='material_first_level' width="180" />
|
||||
<el-table-column label="材料名称" prop='material_name' />
|
||||
<el-table-column label="材料编码" prop='material_code' />
|
||||
<el-table-column label="规格型号" prop='material_specs' />
|
||||
|
||||
<el-table-column label="品牌" prop='material_brand' />
|
||||
<el-table-column label="参数说明" prop='material_parameter_description' width="200px" />
|
||||
<el-table-column label="单位" prop='material_unit' />
|
||||
<el-table-column label="数量" prop='num' />
|
||||
<el-table-column label="单价" prop='price' />
|
||||
<el-table-column label="金额" prop='amount' />
|
||||
<el-table-column label="备注" prop='remark' />
|
||||
</el-table>
|
||||
</div>
|
||||
<div style="margin: 10px 0;">
|
||||
<el-pagination v-model:current-page="pager1.page_no" v-model:page-size="pager1.page_size" :page-sizes="[10, 20, 30, 40]" layout="total, sizes, prev, pager, next, jumper" :total="total" @size-change="handleSizeChange1" @current-change="handleCurrentChange1" />
|
||||
</div>
|
||||
</popup>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup name="customdetail">
|
||||
import { MaterialbudgetDetailLists } from '@/api/project_material_budget_detail'
|
||||
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 formDataannex = reactive([])
|
||||
const pager1 = reactive({
|
||||
page_size: 10,
|
||||
page_no: 1,
|
||||
customer_demand_id: ""
|
||||
})
|
||||
const total = ref(0)
|
||||
const datas = reactive({
|
||||
provinceOptions: [],
|
||||
cityOptions: [],
|
||||
areaOptions: [],
|
||||
});
|
||||
|
||||
const tableData = ref([])
|
||||
// 表单数据
|
||||
const formData = reactive({
|
||||
|
||||
})
|
||||
|
||||
//条数
|
||||
const handleSizeChange1 = (val: number) => {
|
||||
|
||||
pager1.page_size = val
|
||||
budgetDetailLists(formData.id)
|
||||
}
|
||||
|
||||
//分页
|
||||
const handleCurrentChange1 = (val: number) => {
|
||||
console.log(`current page: ${val}`)
|
||||
pager1.page_no = val
|
||||
budgetDetailLists(formData.id)
|
||||
}
|
||||
|
||||
//获取预算明细列表
|
||||
const budgetDetailLists = (id) => {
|
||||
MaterialbudgetDetailLists({ 'page_no': pager1.page_no, 'page_size': pager1.page_size, material_budget_id: id }).then((res) => {
|
||||
tableData.value = res.lists
|
||||
total.value = res.count
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
// 获取详情
|
||||
const setFormData = async (data: Record<any, any>) => {
|
||||
Object.assign(formData, data)
|
||||
budgetDetailLists(data.id)
|
||||
if (data.annex && data.annex.length > 0) {
|
||||
|
||||
const arry1 = data.annex.map((item: any, index: any) => {
|
||||
return {
|
||||
name: `文件${index + 1}`,
|
||||
uri: item
|
||||
};
|
||||
});
|
||||
Object.assign(formDataannex, arry1)
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
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" scoped>
|
||||
.tit {
|
||||
font-size: 1.2em;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
:deep(.my-label) {
|
||||
width: 150px;
|
||||
}
|
||||
</style>
|
373
src/views/project_material_budget/edit.vue
Normal file
373
src/views/project_material_budget/edit.vue
Normal file
@ -0,0 +1,373 @@
|
||||
<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" inline>
|
||||
<div style="display: flex; flex-direction: row-reverse; justify-content: flex-start;margin-bottom: 30px;">
|
||||
|
||||
<el-select class="w-[180px]" v-model="formData.dept_id" clearable placeholder="请选择部门">
|
||||
<el-option v-for="(item, index) in list2" :key="index" :label="item.name" :value="item.id" />
|
||||
</el-select>
|
||||
<el-select class="w-[180px]" v-model="formData.org_id" clearable placeholder="请选择组织" @change="deptrmt">
|
||||
<el-option v-for="(item, index) in list1" :key="index" :label="item.name" :value="item.id" />
|
||||
</el-select>
|
||||
</div>
|
||||
<el-row>
|
||||
<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" 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="24">
|
||||
<div style=" display: flex;justify-content: flex-end;margin-bottom: 30px;">
|
||||
<el-button @click="showDialog1 = true" type="primary" plain>选择材料</el-button>
|
||||
<el-button @click="showDialog1 = true" type="primary" plain>下载导入表</el-button>
|
||||
<el-button @click="showDialog1 = true" type="primary" plain>导入预算</el-button>
|
||||
<el-button @click="showDialog1 = true" type="primary" plain>清空</el-button>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<div style="margin-bottom: 30px;">材料预算清单</div>
|
||||
<div style="margin-bottom: 30px;">
|
||||
<el-table :data="tableData">
|
||||
<el-table-column label="序号" type="index">
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="材料名称" >
|
||||
<template #default="{ row }"> <el-input v-model="row.name" /> </template></el-table-column>
|
||||
<el-table-column label="材料编码" >
|
||||
<template #default="{ row }"> <el-input v-model="row.code" /> </template></el-table-column>
|
||||
|
||||
<el-table-column label="规格型号" >
|
||||
<template #default="{ row }">
|
||||
<el-input v-model="row.specs" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="品牌" >
|
||||
<template #default="{ row }">
|
||||
<el-input v-model="row.brand" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="参数说明" >
|
||||
<template #default="{ row }">
|
||||
<el-input v-model="row.parameter_description" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="单位" prop="unit">
|
||||
<template #default="{ row }">
|
||||
<el-input v-model="row.unit" />
|
||||
</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="price">
|
||||
<template #default="{ row }">
|
||||
<el-input v-model="row.price" />
|
||||
</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-column label="管理" prop="amount_including_tax">
|
||||
<template #default="{ row }">
|
||||
<!-- <el-button @click="handleAdd(row)">+</el-button> -->
|
||||
<el-button @click="handleDelete(row)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="formData.remark" type="textarea" clearable placeholder="请输入备注" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="附件" prop="field127">
|
||||
<el-upload accept="doc, docx, xls, xlsx, ppt, pptx, pdf, txt, zip, rar, tar, jpg, png, gif, jpeg, webp, wmv, avi, mpg, mpeg, 3gp, mov, mp4, flv, f4v, rmvb, mkv" 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>
|
||||
</el-form>
|
||||
</popup>
|
||||
<el-dialog v-model="showDialog" title="选择项目" width="70%">
|
||||
<projectDialog @customEvent="customEvent"></projectDialog>
|
||||
</el-dialog>
|
||||
<el-dialog v-model="showDialog1" title="选择产品" width="70%">
|
||||
<prodctTable @customEvent="customEvent1" :project_id='formData.project_id'></prodctTable>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup name="procurementContractEdit">
|
||||
import type { FormInstance } from 'element-plus'
|
||||
import Popup from '@/components/popup/index.vue'
|
||||
import projectDialog from '@/components/project/index.vue'
|
||||
import { MaterialbudgetDetailLists } from '@/api/project_material_budget_detail'
|
||||
import prodctTable from '@/components/product/index.vue'
|
||||
import { apiMaterialbudgetAdd, apiMaterialbudgetEdit, apiMaterialbudgetDetail } from '@/api/project_material_budget'
|
||||
import customDialog from '@/components/project_personnel/index.vue'
|
||||
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')
|
||||
import feedback from '@/utils/feedback'
|
||||
const showDialog = ref(false)
|
||||
const showDialog1 = ref(false)
|
||||
const project_name = ref('')
|
||||
const project_code = ref('')
|
||||
const person_name = ref('')
|
||||
const idcard = ref('')
|
||||
const tableData=ref([])
|
||||
const list1 = reactive([])
|
||||
const list2 = reactive([])
|
||||
import { deptAll } from '@/api/org/department'
|
||||
import { getAll } from '@/api/org/organization'
|
||||
import configs from "@/config"
|
||||
import useUserStore from "@/stores/modules/user";
|
||||
const base_url = configs.baseUrl + configs.urlPrefix
|
||||
const userStore = useUserStore();
|
||||
const formDataannex = reactive([])
|
||||
|
||||
|
||||
|
||||
//获取值
|
||||
const customEvent = (e) => {
|
||||
formData.project_id = e.id
|
||||
project_name.value = e.project_nam
|
||||
project_code.value = e.project_code
|
||||
showDialog.value = false
|
||||
|
||||
}
|
||||
const customEvent1 = (e) => {
|
||||
// formData.project_person_id = e.id
|
||||
// idcard.value = e.idcard
|
||||
// person_name.value = e.name
|
||||
tableData.value.push({
|
||||
"material_id":e.id,
|
||||
"name":e.name,
|
||||
"code":e.code,
|
||||
'parameter_description':e.parameter_description,
|
||||
"brand":e.brand,
|
||||
"unit":e.unit,
|
||||
"specs":e.specs,
|
||||
"num":e.num,
|
||||
"price":e.price,
|
||||
"remark":e.remark
|
||||
})
|
||||
showDialog1.value = false
|
||||
|
||||
}
|
||||
// 弹窗标题
|
||||
const popupTitle = computed(() => {
|
||||
return mode.value == 'edit' ? '编辑材料预算' : '新增材料预算'
|
||||
})
|
||||
// 上传文件
|
||||
const handleAvatarSuccess_four = (
|
||||
response,
|
||||
uploadFile
|
||||
) => {
|
||||
if (response.code == 0) {
|
||||
ElMessage.error(response.msg);
|
||||
return;
|
||||
}
|
||||
formDataannex.push(
|
||||
{ uri: response.data.uri, name: response.data.name }
|
||||
|
||||
|
||||
);
|
||||
};
|
||||
|
||||
// 删除上传的文件
|
||||
const delFileFn = (index: number) => {
|
||||
formDataannex.splice(index, 1)
|
||||
}
|
||||
//获取所有组织
|
||||
const getlist = () => {
|
||||
getAll().then((res) => {
|
||||
Object.assign(list1, res)
|
||||
if (res.length > 0 && !formData.org_id) {
|
||||
formData.org_id = res[0].id
|
||||
deptAll({ 'org_id': res[0].id }).then((res) => {
|
||||
if (res.length > 0) {
|
||||
Object.assign(list2, res)
|
||||
formData.dept_id = res[0].id
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
//获取部门
|
||||
const deptrmt = (e: any) => {
|
||||
formData.dept_id = ''
|
||||
getlist1(e)
|
||||
|
||||
}
|
||||
//获取所有部门
|
||||
const getlist1 = (id: any) => {
|
||||
deptAll({ 'org_id': id }).then((res) => {
|
||||
list2.splice(0, list2.length, ...res)
|
||||
})
|
||||
}
|
||||
//获取预算明细列表
|
||||
const budgetDetailLists = (id) => {
|
||||
MaterialbudgetDetailLists({ 'page_no': 1,'page_size':20,material_budget_id:id }).then((res) => {
|
||||
|
||||
tableData.value=res.lists.map((item:any)=>({
|
||||
"id":item.id,
|
||||
"material_id":item.material_id,
|
||||
"name":item.material_name,
|
||||
"code":item.material_code,
|
||||
'parameter_description':item.material_parameter_description,
|
||||
"brand":item.material_brand,
|
||||
"unit":item.material_unit,
|
||||
"specs":item.material_specs,
|
||||
"num":item.num,
|
||||
"price":item.price,
|
||||
"remark":item.remark
|
||||
}))
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
|
||||
// 表单数据
|
||||
const formData = reactive({
|
||||
id: '',
|
||||
dept_id: '',
|
||||
org_id: '',
|
||||
project_id: '',
|
||||
material_budget_detail: '',
|
||||
remark: '',
|
||||
annex: '',
|
||||
})
|
||||
const handleAdd = (row: any) => {
|
||||
// 在 row 后面插入一行数据
|
||||
const index = tableData.value.indexOf(row);
|
||||
tableData.value.splice(index + 1, 0, {});
|
||||
};
|
||||
|
||||
const handleDelete = (row: any) => {
|
||||
// 删除 row
|
||||
const index = tableData.value.indexOf(row);
|
||||
tableData.value.splice(index, 1);
|
||||
};
|
||||
|
||||
// 表单验证
|
||||
const formRules = reactive<any>({
|
||||
|
||||
})
|
||||
|
||||
|
||||
|
||||
|
||||
// 获取详情
|
||||
const setFormData = async (data: Record<any, any>) => {
|
||||
if (data.annex && data.annex.length > 0) {
|
||||
|
||||
const arry1 = data.annex.map((item: any, index: any) => {
|
||||
return {
|
||||
name: `文件${index + 1}`,
|
||||
uri: item
|
||||
};
|
||||
});
|
||||
Object.assign(formDataannex, arry1)
|
||||
}
|
||||
budgetDetailLists(data.id)
|
||||
if (data.dept_id) {
|
||||
getlist1(data.org_id)
|
||||
}
|
||||
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_code
|
||||
|
||||
|
||||
}
|
||||
|
||||
const getDetail = async (row: Record<string, any>) => {
|
||||
const data = await apiMaterialbudgetDetail({
|
||||
id: row.id
|
||||
})
|
||||
setFormData(data)
|
||||
}
|
||||
|
||||
|
||||
// 提交按钮
|
||||
const handleSubmit = async () => {
|
||||
if (formDataannex.length > 0) {
|
||||
formData.annex = JSON.stringify(formDataannex.map((item: any) => item.uri))
|
||||
}
|
||||
if(tableData.value.length>0){
|
||||
formData.material_budget_detail=JSON.stringify(tableData.value.map((item:any)=>({
|
||||
'id':item.id,
|
||||
"material_id":item.material_id,
|
||||
"num":item.num,
|
||||
"price":item.price,
|
||||
"remark":item.remark
|
||||
})))
|
||||
}
|
||||
await formRef.value?.validate()
|
||||
const data = { ...formData, }
|
||||
mode.value == 'edit'
|
||||
? await apiMaterialbudgetEdit(data)
|
||||
: await apiMaterialbudgetAdd(data)
|
||||
popupRef.value?.close()
|
||||
emit('success')
|
||||
}
|
||||
|
||||
//打开弹窗
|
||||
const open = (type = 'add') => {
|
||||
mode.value = type
|
||||
popupRef.value?.open()
|
||||
getlist()
|
||||
}
|
||||
|
||||
// 关闭回调
|
||||
const handleClose = () => {
|
||||
emit('close')
|
||||
}
|
||||
|
||||
|
||||
defineExpose({
|
||||
open,
|
||||
setFormData,
|
||||
getDetail
|
||||
})
|
||||
</script>
|
143
src/views/project_material_budget/index.vue
Normal file
143
src/views/project_material_budget/index.vue
Normal file
@ -0,0 +1,143 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-card class="!border-none mb-4" shadow="never">
|
||||
<el-form class="mb-[-16px]" :model="queryParams" inline>
|
||||
|
||||
|
||||
<el-form-item label="类型" prop="budget_type">
|
||||
<el-select class="w-[280px]" v-model="queryParams.budget_type" clearable placeholder="请选择类型">
|
||||
<el-option label="全部" value=""></el-option>
|
||||
<el-option v-for="(item, index) in dictData.budget_type" :key="index" :label="item.name" :value="item.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="resetPage">查询</el-button>
|
||||
<el-button @click="resetParams">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
<el-card class="!border-none" v-loading="pager.loading" shadow="never">
|
||||
<el-button v-perms="['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="序号" type="index" width="55" />
|
||||
<el-table-column label="预算单号" prop="material_budget_code" show-overflow-tooltip />
|
||||
<el-table-column label="项目名称" prop="project_name" show-overflow-tooltip />
|
||||
<el-table-column label="项目编码" prop="project_code" show-overflow-tooltip />
|
||||
<el-table-column label="预算总数量" prop="total_num" show-overflow-tooltip />
|
||||
<el-table-column label="申请总数量" prop="total_apply_num" show-overflow-tooltip />
|
||||
<el-table-column label="剩余预算数量" prop="total_residual_num" show-overflow-tooltip />
|
||||
<el-table-column label="预算金额" prop="total_amount" 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 { apiMaterialbudgetLists, apiMaterialbudgetDelete, apiMaterialbudgetDetail } from '@/api/project_material_budget'
|
||||
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({
|
||||
budget_type: ''
|
||||
|
||||
|
||||
})
|
||||
|
||||
|
||||
|
||||
// 选中数据
|
||||
const selectData = ref<any[]>([])
|
||||
|
||||
// 表格选择后回调事件
|
||||
const handleSelectionChange = (val: any[]) => {
|
||||
selectData.value = val.map(({ id }) => id)
|
||||
}
|
||||
|
||||
// 获取字典数据
|
||||
const { dictData } = useDictData('labor_contract_status,labor_contract_type,labor_contract_name')
|
||||
// 分页相关
|
||||
const { pager, getLists, resetParams, resetPage } = usePaging({
|
||||
fetchFun: apiMaterialbudgetLists,
|
||||
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 apiMaterialbudgetDetail({ 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 apiMaterialbudgetDelete({ id })
|
||||
getLists()
|
||||
}
|
||||
const handledetail = async (data: any) => {
|
||||
let res = await apiMaterialbudgetDetail({ id: data.id })
|
||||
showDtail.value = true
|
||||
await nextTick()
|
||||
detailRef.value?.open()
|
||||
detailRef.value?.setFormData(res)
|
||||
}
|
||||
|
||||
|
||||
getLists()
|
||||
</script>
|
||||
|
141
src/views/project_material_budget_detail/detail.vue
Normal file
141
src/views/project_material_budget_detail/detail.vue
Normal file
@ -0,0 +1,141 @@
|
||||
|
||||
<template>
|
||||
<div class="detail-popup">
|
||||
<popup ref="popupRef" title="项目材料预算调整" :async="true" width="80%" @confirm="handleSubmit" @close="handleClose">
|
||||
<el-descriptions :column="2" border>
|
||||
<el-descriptions-item label="预算单号" label-align="left" align="left" label-class-name="my-label"> {{ formData.material_budget_code
|
||||
}}</el-descriptions-item>
|
||||
<el-descriptions-item label="项目名称" label-align="left" align="left" label-class-name="my-label"> {{ formData.project_name }}</el-descriptions-item>
|
||||
<el-descriptions-item label="项目编码" label-align="left" align="left" label-class-name="my-label"> {{ formData.project_code }}</el-descriptions-item>
|
||||
<el-descriptions-item label="类型" label-align="left" align="left" label-class-name="my-label"> {{ formData.budget_type_text }}</el-descriptions-item>
|
||||
<el-descriptions-item label="材料名称" label-align="left" align="left" label-class-name="my-label"> {{ formData.material_name }}</el-descriptions-item>
|
||||
<el-descriptions-item label="材料编码" label-align="left" align="left" label-class-name="my-label"> {{ formData.material_code }}</el-descriptions-item>
|
||||
<el-descriptions-item label="材料大类" label-align="left" align="left" label-class-name="my-label"> {{ formData.material_first_level }}</el-descriptions-item>
|
||||
<el-descriptions-item label="材料中类" label-align="left" align="left" label-class-name="my-label"> {{ formData.material_second_level
|
||||
}}</el-descriptions-item>
|
||||
<el-descriptions-item label="材料小类" label-align="left" align="left" label-class-name="my-label"> {{ formData.material_three_level }}</el-descriptions-item>
|
||||
<el-descriptions-item label="单位" label-align="left" align="left" label-class-name="my-label"> {{ formData.material_unit }}</el-descriptions-item>
|
||||
|
||||
<el-descriptions-item label="单价" label-align="left" align="left" label-class-name="my-label"> {{ formData.price }}</el-descriptions-item>
|
||||
<el-descriptions-item label="数量" label-align="left" align="left" label-class-name="my-label"> {{ formData.num
|
||||
}}</el-descriptions-item>
|
||||
<el-descriptions-item label="品牌" label-align="left" align="left" label-class-name="my-label"> {{ formData.material_brand
|
||||
}}</el-descriptions-item>
|
||||
|
||||
<el-descriptions-item label="参数说明" label-align="left" align="left" label-class-name="my-label"> {{ formData.material_parameter_description
|
||||
}}</el-descriptions-item>
|
||||
|
||||
|
||||
<el-descriptions-item label="备注" label-align="left" align="left" label-class-name="my-label"> {{ formData.remark
|
||||
}}</el-descriptions-item>
|
||||
|
||||
|
||||
|
||||
</el-descriptions>
|
||||
|
||||
|
||||
</popup>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup name="customdetail">
|
||||
import { MaterialbudgetDetailLists } from '@/api/project_material_budget_detail'
|
||||
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 formDataannex = reactive([])
|
||||
|
||||
|
||||
const datas = reactive({
|
||||
provinceOptions: [],
|
||||
cityOptions: [],
|
||||
areaOptions: [],
|
||||
});
|
||||
|
||||
|
||||
// 表单数据
|
||||
const formData = reactive({
|
||||
|
||||
})
|
||||
|
||||
|
||||
|
||||
// 获取详情
|
||||
const setFormData = async (data: Record<any, any>) => {
|
||||
Object.assign(formData, data)
|
||||
|
||||
if (data.annex && data.annex.length > 0) {
|
||||
|
||||
const arry1 = data.annex.map((item: any, index: any) => {
|
||||
return {
|
||||
name: `文件${index + 1}`,
|
||||
uri: item
|
||||
};
|
||||
});
|
||||
Object.assign(formDataannex, arry1)
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
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" scoped>
|
||||
.tit {
|
||||
font-size: 1.2em;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
:deep(.my-label) {
|
||||
width: 150px;
|
||||
}
|
||||
</style>
|
214
src/views/project_material_budget_detail/edit.vue
Normal file
214
src/views/project_material_budget_detail/edit.vue
Normal file
@ -0,0 +1,214 @@
|
||||
<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" inline>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="项目名称" prop="material_budget_id" @click="showDialog = true" :rules="[{ required: true, message: '不可为空', trigger: 'blur' }]">
|
||||
<el-input v-model="project_name" clearable placeholder="请选择项目材料预算" />
|
||||
</el-form-item> </el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="项目编码" prop="material_budget_id">
|
||||
<el-input v-model="project_code" clearable placeholder="系统自动填写" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="类型" prop="budget_type">
|
||||
<el-select v-model="formData.budget_type" clearable placeholder="请选择类型">
|
||||
<el-option label="全部" value=""></el-option>
|
||||
<el-option v-for="(item, index) in dictData.budget_type" :key="index" :label="item.name" :value="item.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="材料名称">
|
||||
<el-input v-model="material_name" disabled clearable placeholder="系统自动填写" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="材料编码">
|
||||
<el-input v-model="material_code" disabled clearable placeholder="系统自动填写" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="规格型号">
|
||||
<el-input v-model="material_specs" disabled clearable placeholder="系统自动填写" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="品牌">
|
||||
<el-input v-model="material_brand" disabled clearable placeholder="系统自动填写" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="单位">
|
||||
<el-input v-model="material_unit" disabled clearable placeholder="系统自动填写" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="参数说明">
|
||||
<el-input v-model="material_parameter_description" disabled clearable placeholder="请输入单位" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="单价" prop="price">
|
||||
<el-input v-model="formData.price" clearable placeholder="请输入单价" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<!-- <el-col :span="8">
|
||||
<el-form-item label="预算总数量">
|
||||
<el-input v-model="material_num" clearable placeholder="请输入预算总数量" />
|
||||
</el-form-item>
|
||||
</el-col> -->
|
||||
<el-col :span="8">
|
||||
<el-form-item label="预算调整数量" prop="num">
|
||||
<el-input v-model="formData.num" clearable placeholder="请输入预算调整数量" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="formData.remark" type="textarea" clearable placeholder="请输入备注" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
</el-row>
|
||||
</el-form>
|
||||
</popup>
|
||||
<el-dialog v-model="showDialog" title="选择材料预算" width="70%">
|
||||
<projectDialog @customEvent="customEvent"></projectDialog>
|
||||
</el-dialog>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup name="procurementContractEdit">
|
||||
import type { FormInstance } from 'element-plus'
|
||||
import Popup from '@/components/popup/index.vue'
|
||||
import projectDialog from '@/components/material_budget/index.vue'
|
||||
import { MaterialbudgetDetailLists, MaterialbudgetDetailAdd, MaterialbudgetDetailEdit, MaterialbudgetDetailDetail } from '@/api/project_material_budget_detail'
|
||||
import { timeFormat } from '@/utils/util'
|
||||
import type { PropType } from 'vue'
|
||||
defineProps({
|
||||
dictData: {
|
||||
type: Object as PropType<Record<string, any[]>>,
|
||||
default: () => ({})
|
||||
}
|
||||
})
|
||||
const emit = defineEmits(['success', 'close'])
|
||||
const formRef = shallowRef<FormInstance>()
|
||||
const popupRef = shallowRef<InstanceType<typeof Popup>>()
|
||||
const mode = ref('add')
|
||||
import feedback from '@/utils/feedback'
|
||||
const showDialog = ref(false)
|
||||
const showDialog1 = ref(false)
|
||||
const project_name = ref('')
|
||||
const project_code = ref('')
|
||||
|
||||
|
||||
const material_name = ref('')
|
||||
const material_code = ref('')
|
||||
const material_parameter_description = ref('')
|
||||
const material_brand = ref('')
|
||||
const material_unit = ref('')
|
||||
const material_specs = ref('')
|
||||
|
||||
|
||||
|
||||
//获取值
|
||||
const customEvent = (e) => {
|
||||
formData.material_budget_id = e.id
|
||||
project_name.value = e.project_name
|
||||
project_code.value = e.project_code
|
||||
showDialog.value = false
|
||||
budgetDetailLists(e.id)
|
||||
}
|
||||
|
||||
// 弹窗标题
|
||||
const popupTitle = computed(() => {
|
||||
return mode.value == 'edit' ? '编辑项目材料预算调整' : '新增项目材料预算调整'
|
||||
})
|
||||
|
||||
// 表单数据
|
||||
const formData = reactive({
|
||||
id: '',
|
||||
material_budget_id: '',
|
||||
material_id: '',
|
||||
budget_type: '',
|
||||
price: '',
|
||||
num: '',
|
||||
remark: '',
|
||||
})
|
||||
|
||||
// 获取详情
|
||||
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]
|
||||
}
|
||||
}
|
||||
project_name.value = data.project_name
|
||||
project_code.value = data.project_code
|
||||
material_name.value = data.material_name
|
||||
material_code.value = data.material_code
|
||||
material_parameter_description.value = data.material_parameter_description
|
||||
material_brand.value = data.material_brand
|
||||
material_unit.value = data.material_unit
|
||||
material_specs.value = data.material_specs
|
||||
|
||||
}
|
||||
|
||||
const getDetail = async (row: Record<string, any>) => {
|
||||
const data = await MaterialbudgetDetailDetail({
|
||||
id: row.id
|
||||
})
|
||||
setFormData(data)
|
||||
}
|
||||
|
||||
//获取预算明细列表
|
||||
const budgetDetailLists = (id) => {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
// 提交按钮
|
||||
const handleSubmit = async () => {
|
||||
|
||||
await formRef.value?.validate()
|
||||
const data = { ...formData, }
|
||||
mode.value == 'edit'
|
||||
? await MaterialbudgetDetailEdit(data)
|
||||
: await MaterialbudgetDetailAdd(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>
|
166
src/views/project_material_budget_detail/index.vue
Normal file
166
src/views/project_material_budget_detail/index.vue
Normal file
@ -0,0 +1,166 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-card class="!border-none mb-4" shadow="never">
|
||||
<el-form class="mb-[-16px]" :model="queryParams" inline>
|
||||
|
||||
|
||||
|
||||
<el-form-item label="是否有剩余" prop="is_residual">
|
||||
<el-select class="w-[280px]" v-model="queryParams.is_residual" clearable placeholder="请选择是否有剩余">
|
||||
<el-option v-for="(item, index) in dictData.is_residual" :key="index" :label="item.name" :value="parseInt(item.value)" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="类型" prop="budget_type">
|
||||
<el-select class="w-[280px]" v-model="queryParams.budget_type" clearable placeholder="请选择类型">
|
||||
<el-option label="全部" value=""></el-option>
|
||||
<el-option v-for="(item, index) in dictData.budget_type" :key="index" :label="item.name" :value="item.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="resetPage">查询</el-button>
|
||||
<el-button @click="resetParams">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
<el-card class="!border-none" v-loading="pager.loading" shadow="never">
|
||||
<el-button v-perms="['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="序号" type="index" width="55" />
|
||||
<el-table-column label="预算单号" prop="material_budget_code" show-overflow-tooltip />
|
||||
<el-table-column label="项目名称" prop="project_name" show-overflow-tooltip />
|
||||
<el-table-column label="项目编码" prop="project_code" show-overflow-tooltip />
|
||||
<el-table-column label="类型" prop="budget_type" show-overflow-tooltip />
|
||||
<el-table-column label="材料大类" prop="material_first_level" show-overflow-tooltip />
|
||||
<el-table-column label="材料中类" prop="material_second_level" show-overflow-tooltip />
|
||||
<el-table-column label="材料小类" prop="material_three_level" show-overflow-tooltip />
|
||||
<el-table-column label="材料名称" prop="material_name" show-overflow-tooltip />
|
||||
<el-table-column label="材料编码" prop="material_code" show-overflow-tooltip />
|
||||
<el-table-column label="规格型号" prop="material_specs" show-overflow-tooltip />
|
||||
<el-table-column label="品牌" prop="material_brand" show-overflow-tooltip />
|
||||
<el-table-column label="参数说明" prop="material_parameter_description" show-overflow-tooltip />
|
||||
<el-table-column label="单位" prop="material_unit" show-overflow-tooltip />
|
||||
<el-table-column label="申请数量" prop="apply_num" show-overflow-tooltip />
|
||||
<el-table-column label="预算数量" prop="num" show-overflow-tooltip />
|
||||
<el-table-column label="剩余预算数量" prop="residual_num" show-overflow-tooltip />
|
||||
<el-table-column label="单价" prop="price" show-overflow-tooltip />
|
||||
<el-table-column label="金额" prop="amount" 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 { MaterialbudgetDetailLists, MaterialbudgetDetailDelete, MaterialbudgetDetailDetail } from '@/api/project_material_budget_detail'
|
||||
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({
|
||||
|
||||
contract_type: '',
|
||||
budget_type: ''
|
||||
|
||||
|
||||
})
|
||||
|
||||
|
||||
|
||||
// 选中数据
|
||||
const selectData = ref<any[]>([])
|
||||
|
||||
// 表格选择后回调事件
|
||||
const handleSelectionChange = (val: any[]) => {
|
||||
selectData.value = val.map(({ id }) => id)
|
||||
}
|
||||
|
||||
|
||||
// 获取字典数据
|
||||
const { dictData } = useDictData('budget_type,is_residual')
|
||||
// 分页相关
|
||||
const { pager, getLists, resetParams, resetPage } = usePaging({
|
||||
fetchFun: MaterialbudgetDetailLists,
|
||||
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 MaterialbudgetDetailDetail({ 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 MaterialbudgetDetailDelete({ id })
|
||||
getLists()
|
||||
}
|
||||
const handledetail = async (data: any) => {
|
||||
let res = await MaterialbudgetDetailDetail({ id: data.id })
|
||||
showDtail.value = true
|
||||
await nextTick()
|
||||
detailRef.value?.open()
|
||||
detailRef.value?.setFormData(res)
|
||||
}
|
||||
|
||||
|
||||
getLists()
|
||||
</script>
|
||||
|
@ -1,92 +1,47 @@
|
||||
|
||||
<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>
|
||||
<popup ref="popupRef" title="项目总预算详情" :async="true" width="80%" @confirm="handleSubmit" @close="handleClose">
|
||||
<el-descriptions :column="2" title="基本信息" border>
|
||||
|
||||
<el-descriptions-item label="部门名称" label-align="left" align="left" label-class-name="my-label"> {{ formData.dept_name }}</el-descriptions-item>
|
||||
<el-descriptions-item label="项目名称" label-align="left" align="left" label-class-name="my-label">{{ formData.project_name }}</el-descriptions-item>
|
||||
<el-descriptions-item label="项目编码" label-align="left" align="left" label-class-name="my-label"> {{ formData.project_code }}</el-descriptions-item>
|
||||
<el-descriptions-item label="项目利润(元)" label-align="left" align="left" label-class-name="my-label"> {{ formData.profit }}</el-descriptions-item>
|
||||
<el-descriptions-item label="项目利润率(%)" label-align="left" align="left" label-class-name="my-label"> {{ formData.profit_rate }}</el-descriptions-item>
|
||||
<el-descriptions-item label="合同金额" label-align="left" align="left" label-class-name="my-label"> {{ formData.contract_amount }}</el-descriptions-item>
|
||||
|
||||
<el-descriptions-item label="备注" label-align="left" align="left" label-class-name="my-label"> {{ formData.remark }}</el-descriptions-item>
|
||||
<el-descriptions-item label="项目经理" label-align="left" align="left" label-class-name="my-label"> {{ formData.project_manager }}</el-descriptions-item>
|
||||
<el-descriptions-item label="预算日期" label-align="left" align="left" label-class-name="my-label"> {{ formData.budget_date }}</el-descriptions-item>
|
||||
<el-descriptions-item label="预算清单" label-align="left" align="left" label-class-name="my-label">
|
||||
<div v-if="formData.budget_list && formData.budget_list.length > 0">
|
||||
<div v-for="(item, index) in formData.budget_list" style="margin-left: 5px;display: block;">
|
||||
<a style="margin-left: 10px; color: #4a5dff; align-self: flex-start" :href="item.uri" target="_blank">文件{{ index + 1 }} 查看</a>
|
||||
</div>
|
||||
</div>
|
||||
<div v-else>
|
||||
暂无文件
|
||||
</div>
|
||||
</el-descriptions-item>
|
||||
|
||||
</el-descriptions>
|
||||
<el-table :data="tableData">
|
||||
<el-table-column label="序号" type="index" width="56" show-overflow-tooltip />
|
||||
<el-table-column label="分项">
|
||||
<template #default="{ row }">
|
||||
<div>{{ row.name }}</div>
|
||||
<div>{{ row.text }}</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="预算成本" prop="cost" show-overflow-tooltip />
|
||||
|
||||
|
||||
<el-table-column label="成本占比" prop="rate" width="156" show-overflow-tooltip />
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item label="项目名称">
|
||||
{{ formData.project_name
|
||||
}}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-table>
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item label="项目编码">
|
||||
{{ formData.project_code
|
||||
|
||||
}}
|
||||
</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.project_type_name
|
||||
}}
|
||||
</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.project_manager_name }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="立项日期">
|
||||
{{ formData.project_approval_date }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="项目开始日期">
|
||||
{{ formData.start_date }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="项目交付日期">
|
||||
{{ formData.delivery_date }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item label="备注">
|
||||
{{ formData.remark
|
||||
}}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
|
||||
<el-form-item label="附件" prop="field127">
|
||||
|
||||
|
||||
<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>
|
||||
</el-card>
|
||||
</el-form>
|
||||
</popup>
|
||||
</div>
|
||||
</template>
|
||||
@ -114,7 +69,34 @@ const datas = reactive({
|
||||
areaOptions: [],
|
||||
});
|
||||
|
||||
const tableData = reactive([{
|
||||
name: "材料/设备成本(元)",
|
||||
text: '用于控制材料成本',
|
||||
cost: "", rate: "",
|
||||
cl_cost: ''
|
||||
},
|
||||
{
|
||||
name: "分包成本(元)",
|
||||
text: '用于控制分包成本', cost: "", rate: "",
|
||||
fb_cost: '',
|
||||
},
|
||||
{
|
||||
name: "人工成本(元)",
|
||||
text: '用于控制工时成本及项目人力成本', cost: "", rate: "",
|
||||
rg_cost: ''
|
||||
},
|
||||
{
|
||||
name: "费用成本(元)",
|
||||
text: '用于控制费用报销及差旅报销', cost: "", rate: "",
|
||||
fy_cost: ''
|
||||
},
|
||||
{
|
||||
name: "机械 & 工具成本(元)",
|
||||
text: '用于控制机械及设备成本', cost: "", rate: "",
|
||||
jj_cost: ''
|
||||
},
|
||||
|
||||
])
|
||||
// 表单数据
|
||||
const formData = reactive({
|
||||
|
||||
@ -125,21 +107,20 @@ const formData = reactive({
|
||||
// 获取详情
|
||||
const setFormData = async (data: Record<any, any>) => {
|
||||
Object.assign(formData, data)
|
||||
tableData[0].cost = data.cl_cost
|
||||
tableData[1].cost = data.fb_cost
|
||||
tableData[2].cost = data.rg_cost
|
||||
tableData[3].cost = data.fy_cost
|
||||
tableData[4].cost = data.jj_cost
|
||||
tableData[0].rate = (Number(data.cl_cost) / data.total_cost).toFixed(2) + '%'
|
||||
tableData[1].rate = (Number(data.fb_cost) / data.total_cost).toFixed(2) + '%'
|
||||
tableData[2].rate = (Number(data.rg_cost) / data.total_cost).toFixed(2) + '%'
|
||||
tableData[3].rate = (Number(data.fy_cost) / data.total_cost).toFixed(2) + '%'
|
||||
tableData[4].rate = (Number(data.jj_cost) / data.total_cost).toFixed(2) + '%'
|
||||
|
||||
if (data.annex && data.annex.length > 0) {
|
||||
|
||||
const arry1 = data.annex.map((item: any, index: any) => {
|
||||
return {
|
||||
name: `文件${index + 1}`,
|
||||
uri: item
|
||||
};
|
||||
});
|
||||
Object.assign(formDataannex, arry1)
|
||||
|
||||
}
|
||||
// console.log(tableData)
|
||||
|
||||
}
|
||||
|
||||
const getDetail = async (row: Record<string, any>) => {
|
||||
const data = await apiCustomDetail({
|
||||
id: row.id
|
||||
|
@ -32,23 +32,28 @@
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="合同金额(元)" prop="project_manager" :rules="[{ required: true, message: '不可为空', trigger: 'blur' }]">
|
||||
<el-input v-model="manage_name" readonly clearable placeholder="请输入合同金额(元)" />
|
||||
<el-form-item label="合同金额(元)" prop="contract_amount" :rules="[{ required: true, message: '不可为空', trigger: 'blur' }]">
|
||||
<el-input v-model="formData.contract_amount" type="number" @input="contractamount" clearable placeholder="请输入合同金额(元)" />
|
||||
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="项目利润(元)" prop="amount" :rules="[{ required: true, message: '不可为空', trigger: 'blur' }]">
|
||||
<el-input v-model="formData.amount" clearable placeholder="请输入项目利润(元)" />
|
||||
<el-form-item label="项目利润(元)" prop="project_id" :rules="[{ required: true, message: '不可为空', trigger: 'blur' }]">
|
||||
<el-input v-model="project_amount" clearable disabled placeholder="请输入项目利润(元)" />
|
||||
|
||||
</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_rate" clearable disabled placeholder="请输入项目利润率(%)" />
|
||||
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
|
||||
|
||||
</el-row>
|
||||
|
||||
|
||||
<br />
|
||||
<el-row>
|
||||
<el-table :data="tableData" :summary-method="getSummaries" show-summary>
|
||||
<el-table-column label="序号" type="index" width="56">
|
||||
@ -62,12 +67,12 @@
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="预算成本" prop="cost">
|
||||
<template #default="{ row }">
|
||||
<el-input v-model="row.cost" /> </template>
|
||||
<template #default="{ row, $index }">
|
||||
<el-input v-model="row.cost" @input="costinput(row, $index)" /> </template>
|
||||
</el-table-column>
|
||||
|
||||
|
||||
<el-table-column label="成本占比" prop="rate">
|
||||
<el-table-column label="成本占比" prop="rate" width="156">
|
||||
<template #default="{ row }">
|
||||
{{ row.rate }}
|
||||
</template>
|
||||
@ -82,7 +87,7 @@
|
||||
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-row style="margin: 20px 0;">
|
||||
|
||||
|
||||
|
||||
@ -93,13 +98,14 @@
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="项目经理" prop="amount" :rules="[{ required: true, message: '不可为空', trigger: 'blur' }]">
|
||||
<el-input v-model="formData.amount" clearable placeholder="请输入项目经理" />
|
||||
<el-form-item label="项目经理" prop="project_manager" :rules="[{ required: true, message: '不可为空', trigger: 'blur' }]">
|
||||
<el-input v-model="formData.project_manager" clearable placeholder="请输入项目经理" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<el-form-item label="预算日期" prop="project_approval_date" :rules="[{ required: true, message: '不可为空', trigger: 'blur' }]">
|
||||
<el-date-picker v-model="formData.project_approval_date" clearable type="date" value-format="YYYY-MM-DD " placeholder="选择预算日期">
|
||||
<el-form-item label="预算日期" prop="budget_date" :rules="[{ required: true, message: '不可为空', trigger: 'blur' }]">
|
||||
<el-date-picker v-model="formData.budget_date" clearable type="date" value-format="YYYY-MM-DD " placeholder="选择预算日期">
|
||||
</el-date-picker>
|
||||
|
||||
</el-form-item>
|
||||
@ -157,6 +163,7 @@ import { getAll } from '@/api/org/organization'
|
||||
import type { PropType } from 'vue'
|
||||
import configs from "@/config"
|
||||
import useUserStore from "@/stores/modules/user";
|
||||
import { number } from 'echarts/core'
|
||||
const protype = reactive([])
|
||||
const base_url = configs.baseUrl + configs.urlPrefix
|
||||
const userStore = useUserStore();
|
||||
@ -164,6 +171,11 @@ const active = ref(0)
|
||||
const formDataannex = reactive([])
|
||||
const list1 = reactive([])
|
||||
const list2 = reactive([])
|
||||
|
||||
|
||||
const project_amount = ref(0)
|
||||
const project_rate = ref(0)
|
||||
|
||||
const tableData = reactive([{
|
||||
name: "材料/设备成本(元)",
|
||||
text: '用于控制材料成本',
|
||||
@ -252,9 +264,9 @@ defineProps({
|
||||
})
|
||||
const emit = defineEmits(['success', 'close'])
|
||||
const formRef = shallowRef<FormInstance>()
|
||||
const popupRef = shallowRef<InstanceType<typeof Popup>>()
|
||||
const popupRef = shallowRef<InstanceType<Popup>>()
|
||||
const mode = ref('add')
|
||||
const amount_daxie = ref('')
|
||||
const totalenum = ref('')
|
||||
const showDialog = ref(false)
|
||||
const showDialog1 = ref(false)
|
||||
const showDialog2 = ref(false)
|
||||
@ -277,6 +289,54 @@ const customEvent2 = (e: any) => {
|
||||
custom_name.value = e.custom_name;
|
||||
showDialog2.value = false;
|
||||
};
|
||||
const updateCost = () => {
|
||||
|
||||
for (let i = 0; i < tableData.length; i++) {
|
||||
const row = tableData[i];
|
||||
|
||||
if (row.cost && row.cost > 0) {
|
||||
row.rate = (row.cost / Number(totalenum.value)).toFixed(2) + '%';
|
||||
} else {
|
||||
row.rate = ''
|
||||
}
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
//监听合同金额
|
||||
// const contractamount = (e) => {
|
||||
// console.log(e)
|
||||
// if (project_amount.value != 0) {
|
||||
// project_amount.value = e - Number(project_amount.value)
|
||||
// project_rate.value = (Number(project_amount.value) / Number(e)).toFixed(2) + '%'
|
||||
// }
|
||||
// console.log(project_rate.value, project_amount.value)
|
||||
// }
|
||||
|
||||
//监听获取成本%
|
||||
const costinput = (row, index) => {
|
||||
|
||||
row.rate = (row.cost / Number(totalenum.value)).toFixed(2) + '%'
|
||||
|
||||
if (index == 0) {
|
||||
formData.cl_cost = row.cost
|
||||
} else if (index == 2) {
|
||||
formData.fb_cost = row.cost
|
||||
} else if (index == 3) {
|
||||
formData.rg_cost = row.cost
|
||||
} else if (index == 4) {
|
||||
formData.fy_cost = row.cost
|
||||
} else if (index == 5) {
|
||||
formData.jj_cost = row.cost
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
//打开弹窗
|
||||
|
||||
const userclick = () => {
|
||||
@ -337,7 +397,9 @@ const getSummaries = (param: SummaryMethodProps) => {
|
||||
}
|
||||
|
||||
})
|
||||
console.log(sums)
|
||||
// console.log(sums)
|
||||
totalenum.value = sums[2]
|
||||
project_amount.value = sums[2]
|
||||
return sums
|
||||
}
|
||||
|
||||
@ -351,7 +413,7 @@ const amountinput = (e) => {
|
||||
}
|
||||
// 弹窗标题
|
||||
const popupTitle = computed(() => {
|
||||
return mode.value == 'edit' ? '编辑项目经理委任表' : '新增项目经理委任表'
|
||||
return mode.value == 'edit' ? '编辑总预算表' : '新增总预算表'
|
||||
})
|
||||
|
||||
// 表单数据
|
||||
@ -360,7 +422,7 @@ const formData = reactive({
|
||||
org_id: "",
|
||||
dept_id: "",
|
||||
project_id: "",
|
||||
contract_amount: "",
|
||||
contract_amount: 0,
|
||||
cl_cost: "",
|
||||
fb_cost: "",
|
||||
rg_cost: "",
|
||||
@ -408,9 +470,9 @@ const getlist1 = (id: any) => {
|
||||
|
||||
// 获取详情
|
||||
const setFormData = async (data: Record<any, any>) => {
|
||||
if (data.annex && data.annex.length > 0) {
|
||||
if (data.budget_list && data.budget_list.length > 0) {
|
||||
|
||||
const arry1 = data.annex.map((item: any, index: any) => {
|
||||
const arry1 = data.budget_list.map((item: any, index: any) => {
|
||||
return {
|
||||
name: `文件${index + 1}`,
|
||||
uri: item
|
||||
@ -427,11 +489,20 @@ const setFormData = async (data: Record<any, any>) => {
|
||||
formData[key] = data[key]
|
||||
}
|
||||
}
|
||||
custom_name.value = data.custom_name
|
||||
|
||||
project_name.value = data.project_name
|
||||
project_code.value = data.project_code
|
||||
contract_no.value = data.contract_code
|
||||
manage_name.value = data.project_manager_name
|
||||
|
||||
tableData[0].cost = data.cl_cost
|
||||
|
||||
tableData[1].cost = data.fb_cost
|
||||
|
||||
tableData[2].cost = data.rg_cost
|
||||
|
||||
tableData[3].cost = data.fy_cost
|
||||
|
||||
tableData[4].cost = data.jj_cost
|
||||
|
||||
|
||||
if (data && data.contract_name) {
|
||||
contract_name.value = data.contract_name;
|
||||
@ -451,7 +522,7 @@ const getDetail = async (row: Record<string, any>) => {
|
||||
// 提交按钮
|
||||
const handleSubmit = async () => {
|
||||
if (formDataannex.length > 0) {
|
||||
formData.annex = JSON.stringify(formDataannex.map((item: any) => item.uri))
|
||||
formData.budget_list = JSON.stringify(formDataannex.map((item: any) => item.uri))
|
||||
}
|
||||
|
||||
console.log(formRef.value?.validate(), '22222222')
|
||||
@ -482,7 +553,28 @@ const handleClose = () => {
|
||||
emit('close')
|
||||
}
|
||||
|
||||
watch(
|
||||
[totalenum, project_amount, project_rate,], (newValue, oldValue) => {
|
||||
updateCost();
|
||||
if (formData && formData.contract_amount && project_amount.value) {
|
||||
project_amount.value = Number(formData.contract_amount) - Number(project_amount.value);
|
||||
project_rate.value = (Number(project_amount.value) / Number(formData.contract_amount)).toFixed(2) + '%';
|
||||
}
|
||||
// console.log(formData.contract_amount, project_amount.value)
|
||||
},
|
||||
|
||||
)
|
||||
|
||||
watch(
|
||||
() => formData.contract_amount,
|
||||
(newValue, oldValue) => {
|
||||
|
||||
if (project_amount.value) {
|
||||
project_amount.value = Number(formData.contract_amount) - Number(project_amount.value);
|
||||
project_rate.value = (Number(project_amount.value) / Number(formData.contract_amount)).toFixed(2) + '%';
|
||||
}
|
||||
}
|
||||
)
|
||||
|
||||
defineExpose({
|
||||
open,
|
||||
|
@ -2,20 +2,18 @@
|
||||
<div>
|
||||
<el-card class="!border-none mb-4" shadow="never">
|
||||
<el-form class="mb-[-16px]" :model="queryParams" inline>
|
||||
<el-form-item label="立项日期" prop="project_approval_date">
|
||||
<el-date-picker class="flex-1 !flex" v-model="queryParams.project_approval_date" clearable type="date" value-format="YYYY-MM-DD " placeholder="选择签订日期">
|
||||
</el-date-picker>
|
||||
|
||||
<el-form-item label="项目经理">
|
||||
<el-input v-model="queryParams.project_manager" clearable placeholder="请输入项目经理" />
|
||||
</el-form-item>
|
||||
|
||||
|
||||
<el-form-item label="项目时间范围">
|
||||
<el-date-picker v-model="dtimevalue" type="daterange" start-placeholder="项目开始日期" end-placeholder="项目交付日期" :default-time="defaultTime" value-format="YYYY-MM-DD " @change="dateclick" />
|
||||
<el-form-item label="项目总预算编码">
|
||||
<el-input v-model="queryParams.total_budget_code" clearable placeholder="请输入项目总预算编码" />
|
||||
</el-form-item>
|
||||
|
||||
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="resetPage">查询</el-button>
|
||||
<el-button @click="reset">重置</el-button>
|
||||
<el-button @click="resetParams">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
@ -34,19 +32,36 @@
|
||||
<el-table :data="pager.lists" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column label="序号" type="index" width="55" />
|
||||
<el-table-column label="处理流程" prop="project_name" show-overflow-tooltip />
|
||||
<el-table-column label="流程步骤" prop="project_code" show-overflow-tooltip />
|
||||
<el-table-column label="委任单号" prop="process_code" show-overflow-tooltip />
|
||||
<el-table-column label="处理流程" prop="" show-overflow-tooltip />
|
||||
<el-table-column label="流程步骤" prop="" show-overflow-tooltip />
|
||||
<el-table-column label="预算单号" prop="total_budget_code" show-overflow-tooltip />
|
||||
<el-table-column label="项目名称" prop="project_name" show-overflow-tooltip />
|
||||
<el-table-column label="客户名称" prop="custom_name" show-overflow-tooltip />
|
||||
<el-table-column label="合同编号" prop="contract_code" show-overflow-tooltip />
|
||||
<el-table-column label="项目类型" prop="project_type_name" show-overflow-tooltip />
|
||||
<el-table-column label="项目金额" prop="amount" show-overflow-tooltip />
|
||||
<el-table-column label="立项日期" prop="project_approval_date" show-overflow-tooltip />
|
||||
<el-table-column label="项目开始日期" prop="start_date" show-overflow-tooltip />
|
||||
<el-table-column label="项目交付日期" prop="delivery_date" show-overflow-tooltip />
|
||||
|
||||
<el-table-column label="项目编码" prop="project_code" show-overflow-tooltip />
|
||||
<el-table-column label="项目经理" prop="project_manager" show-overflow-tooltip />
|
||||
<el-table-column label="预算日期" prop="budget_date" show-overflow-tooltip />
|
||||
<el-table-column label="合同金额" prop="contract_amount" show-overflow-tooltip />
|
||||
<el-table-column label="总成本" prop="total_cost" show-overflow-tooltip />
|
||||
<el-table-column label="项目利润" prop="profit" show-overflow-tooltip />
|
||||
<el-table-column label="项目利润率" prop="profit_rate" show-overflow-tooltip />
|
||||
<el-table-column label="材料预算成本" prop="cl_cost" show-overflow-tooltip />
|
||||
<el-table-column label="分包预算成本" prop="fb_cost" show-overflow-tooltip />
|
||||
<el-table-column label="人工预算成本" prop="rg_cost" show-overflow-tooltip />
|
||||
<el-table-column label="费用预算成本" prop="fy_cost" show-overflow-tooltip />
|
||||
<el-table-column label="机具预算成本" prop="jj_cost" show-overflow-tooltip />
|
||||
<el-table-column label="备注" prop="remark" show-overflow-tooltip />
|
||||
<el-table-column label="预算清单" show-overflow-tooltip>
|
||||
|
||||
<template #default="{ row }">
|
||||
<div v-if="row.budget_list && row.budget_list.length > 0">
|
||||
<div v-for="(item, i) in row.budget_list " :key='i'>
|
||||
<el-link :href="item" target="_blank">文件{{ i + 1 }}查看</el-link>
|
||||
</div>
|
||||
</div>
|
||||
<div v-else>
|
||||
暂无文件
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="150" fixed="right">
|
||||
<template #default="{ row }">
|
||||
<el-button v-perms="['project.project_manager_apiprojectbudget/edit']" type="primary" link @click="handleEdit(row)">
|
||||
@ -77,8 +92,8 @@ import { usePaging } from '@/hooks/usePaging'
|
||||
import { useDictData } from '@/hooks/useDictOptions'
|
||||
import { apiProjectbudgetLists, apiProjectbudgetDelete, apiProjectbudgetDetail } from '@/api/project_total_budget'
|
||||
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'
|
||||
@ -87,31 +102,15 @@ const editRef = shallowRef<InstanceType<typeof EditPopup>>()
|
||||
// 是否显示编辑框
|
||||
const showEdit = ref(false)
|
||||
const showDtail = ref(false)
|
||||
const dtimevalue = ref([])
|
||||
|
||||
//查询
|
||||
const dateclick = (e: any) => {
|
||||
queryParams.start_date = e[0]
|
||||
queryParams.delivery_date = e[1]
|
||||
}
|
||||
|
||||
// 查询条件
|
||||
const queryParams = reactive({
|
||||
project_approval_date: '',
|
||||
start_date: '',
|
||||
delivery_date: '',
|
||||
total_budget_code: '',
|
||||
project_manager: '',
|
||||
})
|
||||
|
||||
//重置
|
||||
const reset = () => {
|
||||
Object.assign(queryParams, {
|
||||
project_approval_date: '',
|
||||
start_date: '',
|
||||
delivery_date: '',
|
||||
})
|
||||
dtimevalue.value = ''
|
||||
getLists()
|
||||
}
|
||||
|
||||
// 选中数据
|
||||
const selectData = ref<any[]>([])
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user