财务管理下收款管理 开票申请 、回款计划、回款记录、退款申请增删改查功能
This commit is contained in:
parent
3e44eecdc4
commit
4eeee1087b
26
src/api/InvoicingRequests.ts
Normal file
26
src/api/InvoicingRequests.ts
Normal file
@ -0,0 +1,26 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 开票申请列表
|
||||
export function apiinvoiceapplyLists(params: any) {
|
||||
return request.get({ url: '/finance.finance_invoice_apply/lists', params })
|
||||
}
|
||||
|
||||
// 添加开票申请
|
||||
export function apiinvoiceapplyAdd(params: any) {
|
||||
return request.post({ url: '/finance.finance_invoice_apply/add', params })
|
||||
}
|
||||
|
||||
// 编辑开票申请
|
||||
export function apiinvoiceapplyEdit(params: any) {
|
||||
return request.post({ url: '/finance.finance_invoice_apply/edit', params })
|
||||
}
|
||||
|
||||
// 删除开票申请
|
||||
export function apiinvoiceapplyDelete(params: any) {
|
||||
return request.post({ url: '/finance.finance_invoice_apply/delete', params })
|
||||
}
|
||||
|
||||
// 开票申请详情
|
||||
export function apiinvoiceapplyDetail(params: any) {
|
||||
return request.get({ url: '/finance.finance_invoice_apply/detail', params })
|
||||
}
|
26
src/api/appointment.ts
Normal file
26
src/api/appointment.ts
Normal file
@ -0,0 +1,26 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 项目经理委任列表
|
||||
export function appointmentLists(params: any) {
|
||||
return request.get({ url: '/project.project_manager_appointment/lists', params })
|
||||
}
|
||||
|
||||
// 添加项目经理委任
|
||||
export function appointmentAdd(params: any) {
|
||||
return request.post({ url: '/project.project_manager_appointment/add', params })
|
||||
}
|
||||
|
||||
// 编辑项目经理委任
|
||||
export function appointmentEdit(params: any) {
|
||||
return request.post({ url: '/project.project_manager_appointment/edit', params })
|
||||
}
|
||||
|
||||
// 删除项目经理委任
|
||||
export function appointmentDelete(params: any) {
|
||||
return request.post({ url: '/project.project_manager_appointment/delete', params })
|
||||
}
|
||||
|
||||
//项目经理委任详情
|
||||
export function appointmentDetail(params: any) {
|
||||
return request.get({ url: '/project.project_manager_appointment/detail', params })
|
||||
}
|
28
src/api/recordsPayment.ts
Normal file
28
src/api/recordsPayment.ts
Normal file
@ -0,0 +1,28 @@
|
||||
|
||||
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 回款记录列表
|
||||
export function apireturnedrecordLists(params: any) {
|
||||
return request.get({ url: '/finance.finance_returned_record/lists', params })
|
||||
}
|
||||
|
||||
// 添加回款记录
|
||||
export function apireturnedrecordAdd(params: any) {
|
||||
return request.post({ url: '/finance.finance_returned_record/add', params })
|
||||
}
|
||||
|
||||
// 编辑回款记录
|
||||
export function apireturnedrecordEdit(params: any) {
|
||||
return request.post({ url: '/finance.finance_returned_record/edit', params })
|
||||
}
|
||||
|
||||
// 删除回款记录
|
||||
export function apireturnedrecordDelete(params: any) {
|
||||
return request.post({ url: '/finance.finance_returned_record/delete', params })
|
||||
}
|
||||
|
||||
// 回款记录详情
|
||||
export function apireturnedrecordDetail(params: any) {
|
||||
return request.get({ url: '/finance.finance_returned_record/detail', params })
|
||||
}
|
27
src/api/refund.ts
Normal file
27
src/api/refund.ts
Normal file
@ -0,0 +1,27 @@
|
||||
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 退款申请列表
|
||||
export function apirefundapplyLists(params: any) {
|
||||
return request.get({ url: '/finance.finance_refund_apply/lists', params })
|
||||
}
|
||||
|
||||
// 添加退款申请
|
||||
export function apirefundapplyAdd(params: any) {
|
||||
return request.post({ url: '/finance.finance_refund_apply/add', params })
|
||||
}
|
||||
|
||||
// 编辑退款申请
|
||||
export function apirefundapplyEdit(params: any) {
|
||||
return request.post({ url: '/finance.finance_refund_apply/edit', params })
|
||||
}
|
||||
|
||||
// 删除退款申请
|
||||
export function apirefundapplyDelete(params: any) {
|
||||
return request.post({ url: '/finance.finance_refund_apply/delete', params })
|
||||
}
|
||||
|
||||
// 退款申请详情
|
||||
export function apirefundapplyDetail(params: any) {
|
||||
return request.get({ url: '/finance.finance_refund_apply/detail', params })
|
||||
}
|
26
src/api/remittance.ts
Normal file
26
src/api/remittance.ts
Normal file
@ -0,0 +1,26 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 回款计划列表
|
||||
export function apireturnedLists(params: any) {
|
||||
return request.get({ url: '/finance.finance_returned_money/lists', params })
|
||||
}
|
||||
|
||||
// 添加回款计划
|
||||
export function apireturnedAdd(params: any) {
|
||||
return request.post({ url: '/finance.finance_returned_money/add', params })
|
||||
}
|
||||
|
||||
// 编辑回款计划
|
||||
export function apireturnedEdit(params: any) {
|
||||
return request.post({ url: '/finance.finance_returned_money/edit', params })
|
||||
}
|
||||
|
||||
// 删除回款计划
|
||||
export function apireturnedDelete(params: any) {
|
||||
return request.post({ url: '/finance.finance_returned_money/delete', params })
|
||||
}
|
||||
|
||||
// 回款计划详情
|
||||
export function apireturnedDetail(params: any) {
|
||||
return request.get({ url: '/finance.finance_returned_money/detail', params })
|
||||
}
|
61
src/components/bankaccount/index.vue
Normal file
61
src/components/bankaccount/index.vue
Normal file
@ -0,0 +1,61 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-card class="!border-none" shadow="never">
|
||||
<el-form class="mb-[-16px]" :model="queryParams" inline>
|
||||
<el-form-item label="客户名称" prop="name">
|
||||
<el-input class="w-[280px]" v-model="queryParams.name" clearable placeholder="请输入客户名称" />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="resetPage">查询</el-button>
|
||||
<el-button @click="resetParams">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
<el-card class="!border-none" v-loading="pager.loading" shadow="never">
|
||||
<div class="mt-4">
|
||||
<el-table :data="pager.lists" @cell-click="handleCurrentChange">
|
||||
<el-table-column label="账户编码" property="name" />
|
||||
<el-table-column label="开户银行" property="credit_rating" />
|
||||
<el-table-column label="开户名称" property="master_name" />
|
||||
<el-table-column label="开户账号" property="master_phone" />
|
||||
<el-table-column label="开户日期" property="master_phone" />
|
||||
<el-table-column label="备注" property="master_phone" />
|
||||
</el-table>
|
||||
|
||||
</div>
|
||||
<div class="flex mt-4 justify-end">
|
||||
<pagination v-model="pager" @change="getLists" />
|
||||
</div>
|
||||
</el-card>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { usePaging } from "@/hooks/usePaging"
|
||||
import { useDictData } from "@/hooks/useDictOptions"
|
||||
import { apiCustomLists } from '@/api/custom'
|
||||
import { defineEmits } from "vue"
|
||||
|
||||
// 查询条件
|
||||
const queryParams = reactive({
|
||||
name: ''
|
||||
});
|
||||
|
||||
// 获取字典数据
|
||||
const { dictData } = useDictData('custom_type')
|
||||
// 选中数据
|
||||
const emits = defineEmits(["customEvent"]);
|
||||
|
||||
// 选中数据子父传递
|
||||
const handleCurrentChange = (value: any) => {
|
||||
emits("customEvent", value);
|
||||
};
|
||||
|
||||
// 分页相关
|
||||
const { pager, getLists, resetParams, resetPage } = usePaging({
|
||||
fetchFun: apiCustomLists,
|
||||
params: queryParams,
|
||||
});
|
||||
|
||||
getLists();
|
||||
</script>
|
87
src/components/pending_paymentplan/index.vue
Normal file
87
src/components/pending_paymentplan/index.vue
Normal file
@ -0,0 +1,87 @@
|
||||
<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.contract_no" clearable placeholder="请输入内容" />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="resetPage">查询</el-button>
|
||||
<el-button @click="resetParams">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
|
||||
<el-card class="!border-none" v-loading="pager.loading" shadow="never">
|
||||
<div class="mt-4">
|
||||
<el-table :data="pager.lists" @cell-click="handleCurrentChange">
|
||||
<el-table-column type="selection" width="55" />
|
||||
|
||||
<el-table-column label="合同编号" prop="project_name" show-overflow-tooltip />
|
||||
<el-table-column label="合同类型" prop="contract_type">
|
||||
<template #default="{ row }">
|
||||
<dict-value :options="dictData.contract_type" :value="row.contract_type" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="客户名称" prop="project_name" 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="industry">
|
||||
<template #default="{ row }">
|
||||
<dict-value :options="dictData.pay_period" :value="row.period" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="计划回款日期" prop="return_date" show-overflow-tooltip />
|
||||
<el-table-column label="状态" prop="return_status">
|
||||
<template #default="{ row }">
|
||||
<dict-value :options="dictData.return_status" :value="row.return_status" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="金额" prop="amount" show-overflow-tooltip />
|
||||
<el-table-column label="已回款" prop="remark" show-overflow-tooltip />
|
||||
<el-table-column label="未回款" prop="remark" show-overflow-tooltip />
|
||||
<el-table-column label="回款责任人" prop="remark" 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 { apireturnedLists } from '@/api/remittance'
|
||||
|
||||
import { defineEmits } from "vue"
|
||||
import { timeFormat } from '@/utils/util'
|
||||
|
||||
// 查询条件
|
||||
const queryParams = reactive({
|
||||
contract_no: '',
|
||||
});
|
||||
|
||||
// 获取字典数据
|
||||
const { dictData } = useDictData('return_status,pay_period,contract_type')
|
||||
// 选中数据
|
||||
const emits = defineEmits(["customEvent"]);
|
||||
|
||||
// 选中数据子父传递
|
||||
const handleCurrentChange = (value: any) => {
|
||||
emits("customEvent", value);
|
||||
};
|
||||
|
||||
// 分页相关
|
||||
const { pager, getLists, resetParams, resetPage } = usePaging({
|
||||
fetchFun: apireturnedLists,
|
||||
params: queryParams,
|
||||
|
||||
});
|
||||
|
||||
getLists();
|
||||
</script>
|
@ -10,7 +10,6 @@
|
||||
</el-radio-group>
|
||||
|
||||
|
||||
|
||||
<div v-if="type == 1">
|
||||
<div v-if="isCollapse == 1" style="margin-bottom: 20px">
|
||||
<!-- <el-input v-model="content" clearable placeholder="搜索人员" /> -->
|
||||
@ -222,7 +221,7 @@ import { defineEmits } from "vue"
|
||||
const leixin = ref('0')
|
||||
const props = defineProps({
|
||||
type: {
|
||||
type: String,//1:单选 2.多选
|
||||
type: String || Number,//1:单选 2.多选
|
||||
default: () => ({})
|
||||
}
|
||||
})
|
||||
|
@ -18,7 +18,7 @@
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column label="客户名称" prop="customer_id" show-overflow-tooltip />
|
||||
<el-table-column label="审批id" prop="approve_id" show-overflow-tooltip />
|
||||
<el-table-column label="项目名称" prop="buy_bidding_document_id" show-overflow-tooltip />
|
||||
<el-table-column label="项目名称" prop="project_name" show-overflow-tooltip />
|
||||
|
||||
<el-table-column label="合同编号" prop="contract_code" show-overflow-tooltip />
|
||||
<el-table-column label="合同类型" prop="contract_type">
|
||||
|
76
src/components/salescontract/index.vue
Normal file
76
src/components/salescontract/index.vue
Normal file
@ -0,0 +1,76 @@
|
||||
<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.contract_name" clearable placeholder="请输入内容" />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="resetPage">查询</el-button>
|
||||
<el-button @click="resetParams">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
|
||||
<el-card class="!border-none" v-loading="pager.loading" shadow="never">
|
||||
<div class="mt-4">
|
||||
<el-table :data="pager.lists" @cell-click="handleCurrentChange">
|
||||
<el-table-column label="序号" property="name" />
|
||||
<el-table-column label="合同类型" property="custom_type">
|
||||
<template #default="{ row }">
|
||||
<dict-value :options="dictData.contract_type" :value="row.contract_type" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="客户名称" property="customer_name" />
|
||||
<el-table-column label="订单编号" property="province_name" />
|
||||
<el-table-column label="订单金额" property="city_name" />
|
||||
<el-table-column label="调整金额" property="street_name" />
|
||||
<el-table-column label="实际合同金额" property="master_name" />
|
||||
<el-table-column label="项目名称" property="project_name" />
|
||||
<el-table-column label="项目编码" property="project_code" />
|
||||
<el-table-column label="签约日期" property="contract_date" />
|
||||
<el-table-column label="已回款" property="master_name" />
|
||||
<el-table-column label="未回款" property="master_name" />
|
||||
<el-table-column label="已开票" property="master_name" />
|
||||
<el-table-column label="未开票" property="master_name" />
|
||||
</el-table>
|
||||
|
||||
</div>
|
||||
<div class="flex mt-4 justify-end">
|
||||
<pagination v-model="pager" @change="getLists" />
|
||||
</div>
|
||||
</el-card>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { usePaging } from "@/hooks/usePaging"
|
||||
import { useDictData } from "@/hooks/useDictOptions"
|
||||
import { apiContractLists } from '@/api/contract'
|
||||
import { defineEmits } from "vue"
|
||||
|
||||
// 查询条件
|
||||
const queryParams = reactive({
|
||||
contract_name: '',
|
||||
contract_code: '',
|
||||
contract_type: '2',
|
||||
});
|
||||
const { dictData } = useDictData('contract_type')
|
||||
|
||||
|
||||
// 选中数据
|
||||
const emits = defineEmits(["customEvent"]);
|
||||
|
||||
// 选中数据子父传递
|
||||
const handleCurrentChange = (value: any) => {
|
||||
emits("customEvent", value);
|
||||
};
|
||||
|
||||
// 分页相关
|
||||
const { pager, getLists, resetParams, resetPage } = usePaging({
|
||||
fetchFun: apiContractLists,
|
||||
params: queryParams,
|
||||
});
|
||||
|
||||
getLists();
|
||||
</script>
|
@ -160,3 +160,51 @@ export const getNonDuplicateID = (length = 8) => {
|
||||
idStr += Math.random().toString(36).substring(3, length)
|
||||
return idStr
|
||||
}
|
||||
|
||||
/**
|
||||
* 将数字转成中文大写
|
||||
* @params num
|
||||
*/
|
||||
export const toChinesNum = (value: any) => {
|
||||
const chineseNumbers = ['零', '壹', '贰', '叁', '肆', '伍', '陆', '柒', '捌', '玖'];
|
||||
const chineseUnits = ['', '拾', '佰', '仟', '万', '亿'];
|
||||
|
||||
let integerPart = Math.floor(value);
|
||||
let decimalPart = Math.round((value - integerPart) * 100);
|
||||
|
||||
let result = '';
|
||||
|
||||
// 处理整数部分
|
||||
if (integerPart === 0) {
|
||||
result += chineseNumbers[0];
|
||||
} else {
|
||||
let integerPartStr = integerPart.toString();
|
||||
let len = integerPartStr.length;
|
||||
let zeroFlag = false; // 是否需要添加零
|
||||
|
||||
for (let i = 0; i < len; i++) {
|
||||
let num = parseInt(integerPartStr[i]);
|
||||
let unit = len - i - 1;
|
||||
|
||||
if (num === 0) {
|
||||
zeroFlag = true;
|
||||
} else {
|
||||
if (zeroFlag) {
|
||||
result += chineseNumbers[0];
|
||||
zeroFlag = false;
|
||||
}
|
||||
result += chineseNumbers[num] + chineseUnits[unit];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 处理小数部分
|
||||
if (decimalPart > 0) {
|
||||
result += '点';
|
||||
result += chineseNumbers[decimalPart / 10] + chineseNumbers[decimalPart % 10];
|
||||
}
|
||||
|
||||
|
||||
|
||||
return result;
|
||||
}
|
@ -5,3 +5,19 @@
|
||||
export function isExternal(path: string) {
|
||||
return /^(https?:|mailto:|tel:)/.test(path)
|
||||
}
|
||||
|
||||
//电话
|
||||
export function isPhone(data: string) {
|
||||
return /^1[3|4|5|7|8][0-9]{9}$/.test(data)
|
||||
}
|
||||
|
||||
//身份号
|
||||
export function isIdCard(data: string ){
|
||||
return /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/.test(data)
|
||||
}
|
||||
|
||||
//邮箱
|
||||
export function isEmail(data: string) {
|
||||
return /^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+(.[a-zA-Z0-9_-])+/.test(data)
|
||||
}
|
||||
|
||||
|
288
src/views/InvoicingRequests/detail.vue
Normal file
288
src/views/InvoicingRequests/detail.vue
Normal file
@ -0,0 +1,288 @@
|
||||
|
||||
<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.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) {
|
||||
if (data.annex.includes(",")) {
|
||||
const arry1 = data.annex.split(',').map((item: any, index: any) => {
|
||||
return {
|
||||
name: `文件${index + 1}`,
|
||||
uri: item
|
||||
};
|
||||
});
|
||||
Object.assign(formDataannex, arry1)
|
||||
} else {
|
||||
const arry1 = [{ name: `文件1`, uri: data.annex }]
|
||||
Object.assign(formDataannex, arry1)
|
||||
console.log(formDataannex)
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
// 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">
|
||||
.tit {
|
||||
font-size: 1.2em;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
</style>
|
451
src/views/InvoicingRequests/edit.vue
Normal file
451
src/views/InvoicingRequests/edit.vue
Normal file
@ -0,0 +1,451 @@
|
||||
<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_id" @click="showDialog1 = true">
|
||||
<el-input v-model="project_name" clearable placeholder="请输入项目名称" />
|
||||
</el-form-item>
|
||||
</el-col> <el-col :span="8">
|
||||
<el-form-item label="项目编码" prop="contract_id">
|
||||
<el-input v-model="project_code" clearable placeholder="请输入项目编码" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<el-form-item label="合同编号" prop="contract_no">
|
||||
<el-input v-model="contract_no" clearable placeholder="请输入合同编号" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="合同名称" prop="contract_name">
|
||||
<el-input v-model="contract_name" clearable placeholder="请输入合同名称" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="合同金额" prop="project_amount">
|
||||
<el-input v-model="project_amount" clearable 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="请输入开票金额(含税)" />
|
||||
</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=".pdf" class="upload-demo" :show-file-list="false" aria-hidden="true" :headers="{ Token: userStore.token }" :action="base_url + '/upload/file'" :on-success="handleAvatarSuccess_four" ref="upload">
|
||||
<el-button type="primary">
|
||||
上传
|
||||
</el-button>
|
||||
</el-upload>
|
||||
|
||||
<div>
|
||||
<div v-for="(item, index) in formDataannex" style="margin-left: 5px;display: block;">
|
||||
<a style="margin-left: 10px; color: #4a5dff; align-self: flex-start" :href="item.uri" target="_blank">{{ item.name }}</a>
|
||||
<span style="cursor: pointer;margin-left: 5px;" @click="delFileFn(index)">x</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<div style="margin: 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"></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 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 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
|
||||
|
||||
showDialog1.value = false;
|
||||
};
|
||||
// 弹窗标题
|
||||
const popupTitle = computed(() => {
|
||||
return mode.value == 'edit' ? '编辑项目表' : '新增项目表'
|
||||
})
|
||||
|
||||
// 表单数据
|
||||
const formData = reactive({
|
||||
id: '',
|
||||
customer_id: 0,
|
||||
contract_id: 0,
|
||||
approve_id: 0,
|
||||
invoicing_date: "",
|
||||
period: "",
|
||||
accumulate_amount: 0,
|
||||
accumulated_payments_received: 0,
|
||||
tax_rate: "",
|
||||
invoice_type: '',
|
||||
invoicing_amount: 0,
|
||||
invoicing_amount_daxie: "",
|
||||
tax: 0,
|
||||
amount_including_tax: 0,
|
||||
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) {
|
||||
if (data.annex.includes(",")) {
|
||||
const arry1 = data.annex.split(',').map((item: any, index: any) => {
|
||||
return {
|
||||
name: `文件${index + 1}`,
|
||||
uri: item
|
||||
};
|
||||
});
|
||||
Object.assign(formDataannex, arry1)
|
||||
} else {
|
||||
const arry1 = [{ name: `文件1`, uri: data.annex }]
|
||||
Object.assign(formDataannex, arry1)
|
||||
console.log(formDataannex)
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
for (const key in formData) {
|
||||
if (data[key] != null && data[key] != undefined) {
|
||||
//@ts-ignore
|
||||
formData[key] = data[key]
|
||||
}
|
||||
}
|
||||
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 = formDataannex.map((item: any) => item.uri).toString()
|
||||
}
|
||||
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>
|
189
src/views/InvoicingRequests/index.vue
Normal file
189
src/views/InvoicingRequests/index.vue
Normal file
@ -0,0 +1,189 @@
|
||||
<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">
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column label="客户" prop="customer_name" 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="industry">
|
||||
<template #default="{ row }">
|
||||
<dict-value :options="dictData.pay_period" :value="row.period" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="发票类型" prop="invoice_type">
|
||||
<template #default="{ row }">
|
||||
<dict-value :options="dictData.invoice_type" :value="row.invoice_type" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="开票金额(含税)" prop="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="status" 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>
|
||||
<el-button v-perms="['InvoicingRequests.InvoicingRequests/delete']" type="danger" link @click="handleDelete(row.id)">
|
||||
删除
|
||||
</el-button>
|
||||
<el-button v-perms="['InvoicingRequests.InvoicingRequests/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 { apiinvoiceapplyLists, apiinvoiceapplyDelete, apiinvoiceapplyDetail } from '@/api/InvoicingRequests'
|
||||
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'
|
||||
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 list = ref([])
|
||||
const list1 = ref([])
|
||||
|
||||
// 查询条件
|
||||
const queryParams = reactive({
|
||||
invoicing_company_name: '',
|
||||
contract_id: '',
|
||||
customer_id: '',
|
||||
|
||||
|
||||
})
|
||||
|
||||
// 选中数据
|
||||
const selectData = ref<any[]>([])
|
||||
|
||||
// 表格选择后回调事件
|
||||
const handleSelectionChange = (val: any[]) => {
|
||||
selectData.value = val.map(({ id }) => id)
|
||||
}
|
||||
|
||||
// 获取字典数据
|
||||
const { dictData } = useDictData('pay_period,invoice_type')
|
||||
|
||||
// 分页相关
|
||||
const { pager, getLists, resetParams, resetPage } = usePaging({
|
||||
fetchFun: apiinvoiceapplyLists,
|
||||
params: queryParams
|
||||
})
|
||||
|
||||
// 添加
|
||||
const handleAdd = async () => {
|
||||
showEdit.value = true
|
||||
await nextTick()
|
||||
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 handleDelete = async (id: number | any[]) => {
|
||||
await feedback.confirm('确定要删除?')
|
||||
await apiinvoiceapplyDelete({ id })
|
||||
getLists()
|
||||
}
|
||||
//详情
|
||||
const handledetail = async (data: any) => {
|
||||
let res = await apiinvoiceapplyDetail({ 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()
|
||||
</script>
|
||||
|
@ -14,7 +14,7 @@
|
||||
</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="matsname" clearable readonly placeholder="请输入" />
|
||||
<el-input v-model="matsname" clearable placeholder="请输入" />
|
||||
</el-form-item></el-col><el-col :span="8">
|
||||
<el-form-item label="招标公司名称" prop="invite_tenders_company_name" :rules="[{ required: true, message: '不可为空', trigger: 'blur' }]">
|
||||
<el-input v-model="formData.invite_tenders_company_name" clearable placeholder="请输入招标公司名称" />
|
||||
@ -152,6 +152,7 @@ const popupTitle = computed(() => {
|
||||
const formData = reactive({
|
||||
id: '',
|
||||
project_id: '',
|
||||
approve_id: '1',
|
||||
bid_document_no: '',
|
||||
invite_tenders_company_name: '',
|
||||
bid_company_name: '',
|
||||
|
@ -38,8 +38,8 @@
|
||||
<el-table-column label="处理流程" prop="bid_document_no" show-overflow-tooltip />
|
||||
<el-table-column label="流程步骤" prop="bid_document_no" show-overflow-tooltip />
|
||||
<el-table-column label="流程编号" prop="bid_document_no" show-overflow-tooltip />
|
||||
<el-table-column label="客户名称" prop="bid_document_no" show-overflow-tooltip />
|
||||
<el-table-column label="项目名称" prop="bid_document_no" show-overflow-tooltip />
|
||||
<el-table-column label="客户名称" prop="customer_name" show-overflow-tooltip />
|
||||
<el-table-column label="项目名称" prop="project_name" show-overflow-tooltip />
|
||||
<el-table-column label="标书编号" prop="bid_document_no" show-overflow-tooltip />
|
||||
<el-table-column label="招标公司名称" width="120" prop="invite_tenders_company_name" show-overflow-tooltip />
|
||||
<el-table-column label="投标公司名称" width="120" prop="bid_company_name" show-overflow-tooltip />
|
||||
|
@ -184,10 +184,9 @@ const customEvent = (e: any) => {
|
||||
};
|
||||
const customEvent1 = (e: any) => {
|
||||
formData.buy_bidding_document_id = e.id;
|
||||
document_name.value = e.bid_company_name
|
||||
document_code.value = e.bid_document_no
|
||||
bidding_code.value = e.bid_document_no
|
||||
|
||||
document_name.value = e.name;
|
||||
document_code.value = e.project.project_code
|
||||
bidding_code.value = e.document.bid_document_no
|
||||
showDialog1.value = false;
|
||||
};
|
||||
|
||||
|
@ -30,10 +30,10 @@
|
||||
<div class="mt-4">
|
||||
<el-table :data="pager.lists" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column label="客户名称" prop="customer_id" show-overflow-tooltip />
|
||||
<el-table-column label="客户名称" prop="customer_name" show-overflow-tooltip />
|
||||
<el-table-column label="审批id" prop="approve_id" show-overflow-tooltip />
|
||||
<el-table-column label="项目名称" prop="buy_bidding_document_id" show-overflow-tooltip />
|
||||
|
||||
<el-table-column label="项目名称" prop="project_name" show-overflow-tooltip />
|
||||
<el-table-column label="项目编码" prop="project_code" show-overflow-tooltip />
|
||||
<el-table-column label="合同编号" prop="contract_code" show-overflow-tooltip />
|
||||
<el-table-column label="合同类型" prop="contract_type">
|
||||
<template #default="{ row }">
|
||||
|
189
src/views/division_subdivision/index.vue
Normal file
189
src/views/division_subdivision/index.vue
Normal file
@ -0,0 +1,189 @@
|
||||
<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">
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column label="客户" prop="customer_name" 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="industry">
|
||||
<template #default="{ row }">
|
||||
<dict-value :options="dictData.pay_period" :value="row.period" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="发票类型" prop="invoice_type">
|
||||
<template #default="{ row }">
|
||||
<dict-value :options="dictData.invoice_type" :value="row.invoice_type" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="开票金额(含税)" prop="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="status" 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>
|
||||
<el-button v-perms="['InvoicingRequests.InvoicingRequests/delete']" type="danger" link @click="handleDelete(row.id)">
|
||||
删除
|
||||
</el-button>
|
||||
<el-button v-perms="['InvoicingRequests.InvoicingRequests/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 { apiinvoiceapplyLists, apiinvoiceapplyDelete, apiinvoiceapplyDetail } from '@/api/InvoicingRequests'
|
||||
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'
|
||||
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 list = ref([])
|
||||
const list1 = ref([])
|
||||
|
||||
// 查询条件
|
||||
const queryParams = reactive({
|
||||
invoicing_company_name: '',
|
||||
contract_id: '',
|
||||
customer_id: '',
|
||||
|
||||
|
||||
})
|
||||
|
||||
// 选中数据
|
||||
const selectData = ref<any[]>([])
|
||||
|
||||
// 表格选择后回调事件
|
||||
const handleSelectionChange = (val: any[]) => {
|
||||
selectData.value = val.map(({ id }) => id)
|
||||
}
|
||||
|
||||
// 获取字典数据
|
||||
const { dictData } = useDictData('pay_period,invoice_type')
|
||||
|
||||
// 分页相关
|
||||
const { pager, getLists, resetParams, resetPage } = usePaging({
|
||||
fetchFun: apiinvoiceapplyLists,
|
||||
params: queryParams
|
||||
})
|
||||
|
||||
// 添加
|
||||
const handleAdd = async () => {
|
||||
showEdit.value = true
|
||||
await nextTick()
|
||||
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 handleDelete = async (id: number | any[]) => {
|
||||
await feedback.confirm('确定要删除?')
|
||||
await apiinvoiceapplyDelete({ id })
|
||||
getLists()
|
||||
}
|
||||
//详情
|
||||
const handledetail = async (data: any) => {
|
||||
let res = await apiinvoiceapplyDetail({ 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()
|
||||
</script>
|
||||
|
172
src/views/paymentplan/detail.vue
Normal file
172
src/views/paymentplan/detail.vue
Normal file
@ -0,0 +1,172 @@
|
||||
|
||||
<template>
|
||||
<div class="detail-popup">
|
||||
<popup ref="popupRef" title="项目合同详情" :async="true" width="80%" @confirm="handleSubmit" @close="handleClose">
|
||||
<el-form ref="formRef" :model="formData" label-width="160px">
|
||||
<el-card class="mb-2">
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="合同编号">
|
||||
{{ formData.contract.contract_name }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item label="项目名称">
|
||||
{{ formData.project.name
|
||||
}}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item label="项目编码">
|
||||
{{ formData.project.project_code
|
||||
}}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item label="客户名称">
|
||||
{{ formData.custom.name
|
||||
}}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="退款日期">
|
||||
{{ formData.reason
|
||||
}}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="退款金额">
|
||||
{{ formData.amount }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="金额大写">
|
||||
{{ formData.amount_daxie }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="退款方式">
|
||||
<dict-value :options="dictData.refund_type" :value="formData.refund_type" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="退款人">
|
||||
{{ formData.refunder }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="收款账号">
|
||||
{{ formData.collection_acccount }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="收款银行">
|
||||
{{ formData.collection_bank }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item label="备注">
|
||||
{{ formData.remark
|
||||
}}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
|
||||
|
||||
|
||||
</el-row>
|
||||
</el-card>
|
||||
</el-form>
|
||||
</popup>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup name="customdetail">
|
||||
|
||||
import type { FormInstance } from 'element-plus'
|
||||
import Popup from '@/components/popup/index.vue'
|
||||
import { apiCustomDetail } from '@/api/custom'
|
||||
import { timeFormat } from '@/utils/util'
|
||||
import type { PropType } from 'vue'
|
||||
defineProps({
|
||||
dictData: {
|
||||
type: Object as PropType<Record<string, any[]>>,
|
||||
default: () => ({})
|
||||
}
|
||||
})
|
||||
const emit = defineEmits(['success', 'close'])
|
||||
const formRef = shallowRef<FormInstance>()
|
||||
const popupRef = shallowRef<InstanceType<typeof Popup>>()
|
||||
|
||||
const datas = reactive({
|
||||
provinceOptions: [],
|
||||
cityOptions: [],
|
||||
areaOptions: [],
|
||||
});
|
||||
|
||||
|
||||
// 表单数据
|
||||
const formData = reactive({
|
||||
|
||||
})
|
||||
|
||||
|
||||
|
||||
// 获取详情
|
||||
const setFormData = async (data: Record<any, any>) => {
|
||||
Object.assign(formData, data)
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
const getDetail = async (row: Record<string, any>) => {
|
||||
const data = await apiCustomDetail({
|
||||
id: row.id
|
||||
})
|
||||
setFormData(data)
|
||||
}
|
||||
|
||||
|
||||
// 提交按钮
|
||||
const handleSubmit = async () => {
|
||||
popupRef.value?.close()
|
||||
|
||||
}
|
||||
|
||||
//打开弹窗
|
||||
const open = () => {
|
||||
console.log('1111111')
|
||||
popupRef.value?.open()
|
||||
}
|
||||
|
||||
// 关闭回调
|
||||
const handleClose = () => {
|
||||
emit('close')
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
defineExpose({
|
||||
open,
|
||||
setFormData,
|
||||
getDetail
|
||||
})
|
||||
</script>
|
||||
<style lang="scss">
|
||||
.tit {
|
||||
font-size: 1.2em;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
</style>
|
359
src/views/paymentplan/edit.vue
Normal file
359
src/views/paymentplan/edit.vue
Normal file
@ -0,0 +1,359 @@
|
||||
<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="商务部发起" />
|
||||
<el-step title="商务总监" />
|
||||
<el-step title="财务经理" />
|
||||
<el-step title="总经理" />
|
||||
</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="return_date">
|
||||
<el-date-picker class="flex-1 !flex" v-model="formData.return_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_id" @click="showDialog1 = true">
|
||||
<el-input v-model="project_name" clearable placeholder="请输入项目名称" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="项目编码" prop="contract_id">
|
||||
<el-input v-model="project_code" clearable placeholder="请输入项目编码" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<el-form-item label="合同编号" prop="contract_no">
|
||||
<el-input v-model="contract_no" clearable placeholder="请输入合同编号" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="合同名称" prop="contract_name">
|
||||
<el-input v-model="contract_name" clearable placeholder="请输入合同名称" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="退款原因" prop="reason">
|
||||
<el-input v-model="formData.reason" type='textarea' clearable placeholder="请输入退款原因" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="退款金额" prop="amount">
|
||||
<el-input v-model="formData.amount" clearable placeholder="请输入退款金额" @input="amountinput" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="金额大写" prop="amount_daxie">
|
||||
<el-input v-model="formData.amount_daxie" readonly 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.refund_type" clearable placeholder="请选择退款方式">
|
||||
<el-option v-for="(item, index) in dictData.refund_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="refunder">
|
||||
<el-input v-model="formData.refunder" readonly 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="field127">
|
||||
<el-upload accept=".pdf" class="upload-demo" :show-file-list="false" aria-hidden="true" :headers="{ Token: userStore.token }" :action="base_url + '/upload/file'" :on-success="handleAvatarSuccess_four" ref="upload">
|
||||
<el-button type="primary">
|
||||
上传
|
||||
</el-button>
|
||||
</el-upload>
|
||||
|
||||
<div>
|
||||
<div v-for="(item, index) in formDataannex" style="margin-left: 5px;display: block;">
|
||||
<a style="margin-left: 10px; color: #4a5dff; align-self: flex-start" :href="item.uri" target="_blank">{{ item.name }}</a>
|
||||
<span style="cursor: pointer;margin-left: 5px;" @click="delFileFn(index)">x</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<div style="margin: 20px 0;">客户收款信息</div>
|
||||
|
||||
<el-row :gutter="10">
|
||||
|
||||
<el-col :span="8">
|
||||
<el-form-item label="收款账号" prop="collection_acccount" @click="showDialog2 = true">
|
||||
<el-input v-model="formData.collection_acccount" clearable placeholder="请输入收款账号" />
|
||||
</el-form-item>
|
||||
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<el-form-item label="收款银行" prop="collection_bank">
|
||||
<el-input v-model="formData.collection_bank" 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"></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 salescontractDialog from '@/components/salescontract/index.vue'
|
||||
|
||||
import { apirefundapplyAdd, apirefundapplyEdit, apirefundapplyDetail } from '@/api/refund'
|
||||
import { toChinesNum } from "@/utils/util";
|
||||
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 userInfo = userStore.userInfo
|
||||
console.log(userInfo, '222222')
|
||||
// 上传文件
|
||||
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 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 amount_daxie = ref('')
|
||||
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
|
||||
showDialog1.value = false;
|
||||
};
|
||||
|
||||
|
||||
|
||||
//监听输入
|
||||
const amountinput = (e) => {
|
||||
// console.log(e)
|
||||
if (e && e > 0) {
|
||||
formData.amount_daxie = toChinesNum(e)
|
||||
}
|
||||
}
|
||||
// 弹窗标题
|
||||
const popupTitle = computed(() => {
|
||||
return mode.value == 'edit' ? '编辑退款申请表' : '新增退款申请表'
|
||||
})
|
||||
|
||||
// 表单数据
|
||||
const formData = reactive({
|
||||
id: '',
|
||||
customer_id: "",
|
||||
contract_id: "",
|
||||
approve_id: 0,
|
||||
refund_date: "",
|
||||
reason: "",
|
||||
amount: 0,
|
||||
amount_daxie: "",
|
||||
refund_type: "",
|
||||
refunder: userInfo.name,
|
||||
return_total_amount: "",
|
||||
return_desc: "",
|
||||
collection_bank: "",
|
||||
collection_acccount: ""
|
||||
})
|
||||
|
||||
|
||||
// 表单验证
|
||||
const formRules = reactive<any>({
|
||||
|
||||
})
|
||||
|
||||
|
||||
// 获取详情
|
||||
const setFormData = async (data: Record<any, any>) => {
|
||||
if (data.return_desc && data.return_desc.length > 0) {
|
||||
if (data.return_desc.includes(",")) {
|
||||
const arry1 = data.return_desc.split(',').map((item: any, index: any) => {
|
||||
return {
|
||||
name: `文件${index + 1}`,
|
||||
uri: item
|
||||
};
|
||||
});
|
||||
Object.assign(formDataannex, arry1)
|
||||
} else {
|
||||
const arry1 = [{ name: `文件1`, uri: data.return_desc }]
|
||||
Object.assign(formDataannex, arry1)
|
||||
console.log(formDataannex)
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
for (const key in formData) {
|
||||
if (data[key] != null && data[key] != undefined) {
|
||||
//@ts-ignore
|
||||
formData[key] = data[key]
|
||||
}
|
||||
}
|
||||
custom_name.value = data.custom.name
|
||||
project_name.value = data.project.name
|
||||
project_code.value = data.project.project_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 apirefundapplyDetail({
|
||||
id: row.id
|
||||
})
|
||||
setFormData(data)
|
||||
}
|
||||
|
||||
|
||||
// 提交按钮
|
||||
const handleSubmit = async () => {
|
||||
if (formDataannex.length > 0) {
|
||||
formData.return_desc = formDataannex.map((item: any) => item.uri).toString()
|
||||
}
|
||||
console.log(formRef.value?.validate(), '22222222')
|
||||
await formRef.value?.validate()
|
||||
|
||||
|
||||
const data = { ...formData }
|
||||
mode.value == 'edit'
|
||||
? await apirefundapplyEdit(data)
|
||||
: await apirefundapplyAdd(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>
|
148
src/views/paymentplan/index.vue
Normal file
148
src/views/paymentplan/index.vue
Normal file
@ -0,0 +1,148 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-card class="!border-none mb-4" shadow="never">
|
||||
<el-form class="mb-[-16px]" :model="queryParams" inline>
|
||||
<el-form-item label="合同编号" prop="project_name">
|
||||
<el-input class="w-[280px]" v-model="queryParams.contract_no" clearable placeholder="请输入合同编号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="合同名称" prop="project_role_name">
|
||||
<el-input class="w-[280px]" v-model="queryParams.contract_name" clearable placeholder="请输入合同名称" />
|
||||
</el-form-item>
|
||||
|
||||
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="resetPage">查询</el-button>
|
||||
<el-button @click="resetParams">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
<el-card class="!border-none" v-loading="pager.loading" shadow="never">
|
||||
<el-button v-perms="['refund.refund/add']" type="primary" @click="handleAdd">
|
||||
<template #icon>
|
||||
<icon name="el-icon-Plus" />
|
||||
</template>
|
||||
新增
|
||||
</el-button>
|
||||
<el-button v-perms="['refund.refund/delete']" :disabled="!selectData.length" @click="handleDelete(selectData)">
|
||||
删除
|
||||
</el-button>
|
||||
|
||||
<div class="mt-4">
|
||||
<el-table :data="pager.lists" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column label="退款单号" prop="project_name" show-overflow-tooltip />
|
||||
<el-table-column label="客户名称" prop="project_code" show-overflow-tooltip />
|
||||
<el-table-column label="项目名称" prop="project_role_name" show-overflow-tooltip />
|
||||
<el-table-column label="合同编号" prop="admin_name" show-overflow-tooltip />
|
||||
<el-table-column label="退款原因" prop="reason" show-overflow-tooltip />
|
||||
<el-table-column label="退款日期" prop="refund_date" show-overflow-tooltip />
|
||||
<el-table-column label="退款金额" prop="amount" show-overflow-tooltip />
|
||||
<el-table-column label="退款方式" prop="refund_type" show-overflow-tooltip>
|
||||
<template #default="{ row }">
|
||||
<dict-value :options="dictData.refund_type" :value="row.refund_type" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="退款人" prop="refunder" show-overflow-tooltip />
|
||||
<el-table-column label="备注" prop="remark" show-overflow-tooltip />
|
||||
<el-table-column label="操作" width="150" fixed="right">
|
||||
<template #default="{ row }">
|
||||
<el-button v-perms="['refund.refund/edit']" type="primary" link @click="handleEdit(row)">
|
||||
编辑
|
||||
</el-button>
|
||||
<el-button v-perms="['refund.refund/delete']" type="danger" link @click="handleDelete(row.id)">
|
||||
删除
|
||||
</el-button>
|
||||
<el-button v-perms="['refund.refund/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 { apirefundapplyLists, apirefundapplyDelete, apirefundapplyDetail } from '@/api/refund'
|
||||
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_no: '',
|
||||
contract_name: '',
|
||||
|
||||
})
|
||||
|
||||
|
||||
|
||||
// 选中数据
|
||||
const selectData = ref<any[]>([])
|
||||
|
||||
// 表格选择后回调事件
|
||||
const handleSelectionChange = (val: any[]) => {
|
||||
selectData.value = val.map(({ id }) => id)
|
||||
}
|
||||
|
||||
// 获取字典数据
|
||||
const { dictData } = useDictData('refund_type')
|
||||
// 分页相关
|
||||
const { pager, getLists, resetParams, resetPage } = usePaging({
|
||||
fetchFun: apirefundapplyLists,
|
||||
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 apirefundapplyDetail({ 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 apirefundapplyDelete({ id })
|
||||
getLists()
|
||||
}
|
||||
const handledetail = async (data: any) => {
|
||||
let res = await apirefundapplyDetail({ id: data.id })
|
||||
showDtail.value = true
|
||||
await nextTick()
|
||||
detailRef.value?.open()
|
||||
detailRef.value?.setFormData(res)
|
||||
}
|
||||
|
||||
|
||||
getLists()
|
||||
</script>
|
||||
|
172
src/views/paymentrequest/detail.vue
Normal file
172
src/views/paymentrequest/detail.vue
Normal file
@ -0,0 +1,172 @@
|
||||
|
||||
<template>
|
||||
<div class="detail-popup">
|
||||
<popup ref="popupRef" title="项目合同详情" :async="true" width="80%" @confirm="handleSubmit" @close="handleClose">
|
||||
<el-form ref="formRef" :model="formData" label-width="160px">
|
||||
<el-card class="mb-2">
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="合同编号">
|
||||
{{ formData.contract.contract_name }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item label="项目名称">
|
||||
{{ formData.project.name
|
||||
}}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item label="项目编码">
|
||||
{{ formData.project.project_code
|
||||
}}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item label="客户名称">
|
||||
{{ formData.custom.name
|
||||
}}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="退款日期">
|
||||
{{ formData.reason
|
||||
}}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="退款金额">
|
||||
{{ formData.amount }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="金额大写">
|
||||
{{ formData.amount_daxie }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="退款方式">
|
||||
<dict-value :options="dictData.refund_type" :value="formData.refund_type" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="退款人">
|
||||
{{ formData.refunder }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="收款账号">
|
||||
{{ formData.collection_acccount }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="收款银行">
|
||||
{{ formData.collection_bank }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item label="备注">
|
||||
{{ formData.remark
|
||||
}}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
|
||||
|
||||
|
||||
</el-row>
|
||||
</el-card>
|
||||
</el-form>
|
||||
</popup>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup name="customdetail">
|
||||
|
||||
import type { FormInstance } from 'element-plus'
|
||||
import Popup from '@/components/popup/index.vue'
|
||||
import { apiCustomDetail } from '@/api/custom'
|
||||
import { timeFormat } from '@/utils/util'
|
||||
import type { PropType } from 'vue'
|
||||
defineProps({
|
||||
dictData: {
|
||||
type: Object as PropType<Record<string, any[]>>,
|
||||
default: () => ({})
|
||||
}
|
||||
})
|
||||
const emit = defineEmits(['success', 'close'])
|
||||
const formRef = shallowRef<FormInstance>()
|
||||
const popupRef = shallowRef<InstanceType<typeof Popup>>()
|
||||
|
||||
const datas = reactive({
|
||||
provinceOptions: [],
|
||||
cityOptions: [],
|
||||
areaOptions: [],
|
||||
});
|
||||
|
||||
|
||||
// 表单数据
|
||||
const formData = reactive({
|
||||
|
||||
})
|
||||
|
||||
|
||||
|
||||
// 获取详情
|
||||
const setFormData = async (data: Record<any, any>) => {
|
||||
Object.assign(formData, data)
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
const getDetail = async (row: Record<string, any>) => {
|
||||
const data = await apiCustomDetail({
|
||||
id: row.id
|
||||
})
|
||||
setFormData(data)
|
||||
}
|
||||
|
||||
|
||||
// 提交按钮
|
||||
const handleSubmit = async () => {
|
||||
popupRef.value?.close()
|
||||
|
||||
}
|
||||
|
||||
//打开弹窗
|
||||
const open = () => {
|
||||
console.log('1111111')
|
||||
popupRef.value?.open()
|
||||
}
|
||||
|
||||
// 关闭回调
|
||||
const handleClose = () => {
|
||||
emit('close')
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
defineExpose({
|
||||
open,
|
||||
setFormData,
|
||||
getDetail
|
||||
})
|
||||
</script>
|
||||
<style lang="scss">
|
||||
.tit {
|
||||
font-size: 1.2em;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
</style>
|
359
src/views/paymentrequest/edit.vue
Normal file
359
src/views/paymentrequest/edit.vue
Normal file
@ -0,0 +1,359 @@
|
||||
<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="商务部发起" />
|
||||
<el-step title="商务总监" />
|
||||
<el-step title="财务经理" />
|
||||
<el-step title="总经理" />
|
||||
</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="return_date">
|
||||
<el-date-picker class="flex-1 !flex" v-model="formData.return_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_id" @click="showDialog1 = true">
|
||||
<el-input v-model="project_name" clearable placeholder="请输入项目名称" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="项目编码" prop="contract_id">
|
||||
<el-input v-model="project_code" clearable placeholder="请输入项目编码" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<el-form-item label="合同编号" prop="contract_no">
|
||||
<el-input v-model="contract_no" clearable placeholder="请输入合同编号" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="合同名称" prop="contract_name">
|
||||
<el-input v-model="contract_name" clearable placeholder="请输入合同名称" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="退款原因" prop="reason">
|
||||
<el-input v-model="formData.reason" type='textarea' clearable placeholder="请输入退款原因" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="退款金额" prop="amount">
|
||||
<el-input v-model="formData.amount" clearable placeholder="请输入退款金额" @input="amountinput" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="金额大写" prop="amount_daxie">
|
||||
<el-input v-model="formData.amount_daxie" readonly 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.refund_type" clearable placeholder="请选择退款方式">
|
||||
<el-option v-for="(item, index) in dictData.refund_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="refunder">
|
||||
<el-input v-model="formData.refunder" readonly 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="field127">
|
||||
<el-upload accept=".pdf" class="upload-demo" :show-file-list="false" aria-hidden="true" :headers="{ Token: userStore.token }" :action="base_url + '/upload/file'" :on-success="handleAvatarSuccess_four" ref="upload">
|
||||
<el-button type="primary">
|
||||
上传
|
||||
</el-button>
|
||||
</el-upload>
|
||||
|
||||
<div>
|
||||
<div v-for="(item, index) in formDataannex" style="margin-left: 5px;display: block;">
|
||||
<a style="margin-left: 10px; color: #4a5dff; align-self: flex-start" :href="item.uri" target="_blank">{{ item.name }}</a>
|
||||
<span style="cursor: pointer;margin-left: 5px;" @click="delFileFn(index)">x</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<div style="margin: 20px 0;">客户收款信息</div>
|
||||
|
||||
<el-row :gutter="10">
|
||||
|
||||
<el-col :span="8">
|
||||
<el-form-item label="收款账号" prop="collection_acccount" @click="showDialog2 = true">
|
||||
<el-input v-model="formData.collection_acccount" clearable placeholder="请输入收款账号" />
|
||||
</el-form-item>
|
||||
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<el-form-item label="收款银行" prop="collection_bank">
|
||||
<el-input v-model="formData.collection_bank" 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"></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 salescontractDialog from '@/components/salescontract/index.vue'
|
||||
|
||||
import { apirefundapplyAdd, apirefundapplyEdit, apirefundapplyDetail } from '@/api/refund'
|
||||
import { toChinesNum } from "@/utils/util";
|
||||
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 userInfo = userStore.userInfo
|
||||
console.log(userInfo, '222222')
|
||||
// 上传文件
|
||||
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 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 amount_daxie = ref('')
|
||||
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
|
||||
showDialog1.value = false;
|
||||
};
|
||||
|
||||
|
||||
|
||||
//监听输入
|
||||
const amountinput = (e) => {
|
||||
// console.log(e)
|
||||
if (e && e > 0) {
|
||||
formData.amount_daxie = toChinesNum(e)
|
||||
}
|
||||
}
|
||||
// 弹窗标题
|
||||
const popupTitle = computed(() => {
|
||||
return mode.value == 'edit' ? '编辑退款申请表' : '新增退款申请表'
|
||||
})
|
||||
|
||||
// 表单数据
|
||||
const formData = reactive({
|
||||
id: '',
|
||||
customer_id: "",
|
||||
contract_id: "",
|
||||
approve_id: 0,
|
||||
refund_date: "",
|
||||
reason: "",
|
||||
amount: 0,
|
||||
amount_daxie: "",
|
||||
refund_type: "",
|
||||
refunder: userInfo.name,
|
||||
return_total_amount: "",
|
||||
return_desc: "",
|
||||
collection_bank: "",
|
||||
collection_acccount: ""
|
||||
})
|
||||
|
||||
|
||||
// 表单验证
|
||||
const formRules = reactive<any>({
|
||||
|
||||
})
|
||||
|
||||
|
||||
// 获取详情
|
||||
const setFormData = async (data: Record<any, any>) => {
|
||||
if (data.return_desc && data.return_desc.length > 0) {
|
||||
if (data.return_desc.includes(",")) {
|
||||
const arry1 = data.return_desc.split(',').map((item: any, index: any) => {
|
||||
return {
|
||||
name: `文件${index + 1}`,
|
||||
uri: item
|
||||
};
|
||||
});
|
||||
Object.assign(formDataannex, arry1)
|
||||
} else {
|
||||
const arry1 = [{ name: `文件1`, uri: data.return_desc }]
|
||||
Object.assign(formDataannex, arry1)
|
||||
console.log(formDataannex)
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
for (const key in formData) {
|
||||
if (data[key] != null && data[key] != undefined) {
|
||||
//@ts-ignore
|
||||
formData[key] = data[key]
|
||||
}
|
||||
}
|
||||
custom_name.value = data.custom.name
|
||||
project_name.value = data.project.name
|
||||
project_code.value = data.project.project_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 apirefundapplyDetail({
|
||||
id: row.id
|
||||
})
|
||||
setFormData(data)
|
||||
}
|
||||
|
||||
|
||||
// 提交按钮
|
||||
const handleSubmit = async () => {
|
||||
if (formDataannex.length > 0) {
|
||||
formData.return_desc = formDataannex.map((item: any) => item.uri).toString()
|
||||
}
|
||||
console.log(formRef.value?.validate(), '22222222')
|
||||
await formRef.value?.validate()
|
||||
|
||||
|
||||
const data = { ...formData }
|
||||
mode.value == 'edit'
|
||||
? await apirefundapplyEdit(data)
|
||||
: await apirefundapplyAdd(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>
|
148
src/views/paymentrequest/index.vue
Normal file
148
src/views/paymentrequest/index.vue
Normal file
@ -0,0 +1,148 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-card class="!border-none mb-4" shadow="never">
|
||||
<el-form class="mb-[-16px]" :model="queryParams" inline>
|
||||
<el-form-item label="合同编号" prop="project_name">
|
||||
<el-input class="w-[280px]" v-model="queryParams.contract_no" clearable placeholder="请输入合同编号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="合同名称" prop="project_role_name">
|
||||
<el-input class="w-[280px]" v-model="queryParams.contract_name" clearable placeholder="请输入合同名称" />
|
||||
</el-form-item>
|
||||
|
||||
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="resetPage">查询</el-button>
|
||||
<el-button @click="resetParams">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
<el-card class="!border-none" v-loading="pager.loading" shadow="never">
|
||||
<el-button v-perms="['refund.refund/add']" type="primary" @click="handleAdd">
|
||||
<template #icon>
|
||||
<icon name="el-icon-Plus" />
|
||||
</template>
|
||||
新增
|
||||
</el-button>
|
||||
<el-button v-perms="['refund.refund/delete']" :disabled="!selectData.length" @click="handleDelete(selectData)">
|
||||
删除
|
||||
</el-button>
|
||||
|
||||
<div class="mt-4">
|
||||
<el-table :data="pager.lists" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column label="退款单号" prop="project_name" show-overflow-tooltip />
|
||||
<el-table-column label="客户名称" prop="project_code" show-overflow-tooltip />
|
||||
<el-table-column label="项目名称" prop="project_role_name" show-overflow-tooltip />
|
||||
<el-table-column label="合同编号" prop="admin_name" show-overflow-tooltip />
|
||||
<el-table-column label="退款原因" prop="reason" show-overflow-tooltip />
|
||||
<el-table-column label="退款日期" prop="refund_date" show-overflow-tooltip />
|
||||
<el-table-column label="退款金额" prop="amount" show-overflow-tooltip />
|
||||
<el-table-column label="退款方式" prop="refund_type" show-overflow-tooltip>
|
||||
<template #default="{ row }">
|
||||
<dict-value :options="dictData.refund_type" :value="row.refund_type" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="退款人" prop="refunder" show-overflow-tooltip />
|
||||
<el-table-column label="备注" prop="remark" show-overflow-tooltip />
|
||||
<el-table-column label="操作" width="150" fixed="right">
|
||||
<template #default="{ row }">
|
||||
<el-button v-perms="['refund.refund/edit']" type="primary" link @click="handleEdit(row)">
|
||||
编辑
|
||||
</el-button>
|
||||
<el-button v-perms="['refund.refund/delete']" type="danger" link @click="handleDelete(row.id)">
|
||||
删除
|
||||
</el-button>
|
||||
<el-button v-perms="['refund.refund/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 { apirefundapplyLists, apirefundapplyDelete, apirefundapplyDetail } from '@/api/refund'
|
||||
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_no: '',
|
||||
contract_name: '',
|
||||
|
||||
})
|
||||
|
||||
|
||||
|
||||
// 选中数据
|
||||
const selectData = ref<any[]>([])
|
||||
|
||||
// 表格选择后回调事件
|
||||
const handleSelectionChange = (val: any[]) => {
|
||||
selectData.value = val.map(({ id }) => id)
|
||||
}
|
||||
|
||||
// 获取字典数据
|
||||
const { dictData } = useDictData('refund_type')
|
||||
// 分页相关
|
||||
const { pager, getLists, resetParams, resetPage } = usePaging({
|
||||
fetchFun: apirefundapplyLists,
|
||||
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 apirefundapplyDetail({ 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 apirefundapplyDelete({ id })
|
||||
getLists()
|
||||
}
|
||||
const handledetail = async (data: any) => {
|
||||
let res = await apirefundapplyDetail({ id: data.id })
|
||||
showDtail.value = true
|
||||
await nextTick()
|
||||
detailRef.value?.open()
|
||||
detailRef.value?.setFormData(res)
|
||||
}
|
||||
|
||||
|
||||
getLists()
|
||||
</script>
|
||||
|
@ -196,7 +196,7 @@
|
||||
</el-upload>
|
||||
|
||||
<div>
|
||||
<div v-for="(item, index) in formData.annex" style="margin-left: 5px;display: block;">
|
||||
<div v-for="(item, index) in formDataannex" style="margin-left: 5px;display: block;">
|
||||
<a style="margin-left: 10px; color: #4a5dff; align-self: flex-start" :href="item.uri" target="_blank">{{ item.name }}</a>
|
||||
<span style="cursor: pointer;margin-left: 5px;" @click="delFileFn(index)">x</span>
|
||||
</div>
|
||||
@ -227,6 +227,7 @@ import configs from "@/config"
|
||||
import useUserStore from "@/stores/modules/user";
|
||||
const protype = reactive([])
|
||||
const base_url = configs.baseUrl + configs.urlPrefix
|
||||
const formDataannex = reactive([])
|
||||
const userStore = useUserStore();
|
||||
// 上传文件
|
||||
const handleAvatarSuccess_four = (
|
||||
@ -237,7 +238,7 @@ const handleAvatarSuccess_four = (
|
||||
ElMessage.error(response.msg);
|
||||
return;
|
||||
}
|
||||
formData.annex.push(
|
||||
formDataannex.push(
|
||||
{ uri: response.data.uri, name: response.data.name }
|
||||
|
||||
|
||||
@ -245,7 +246,7 @@ const handleAvatarSuccess_four = (
|
||||
};
|
||||
// 删除上传的文件
|
||||
const delFileFn = (index: number) => {
|
||||
formData.annex.splice(index, 1)
|
||||
formDataannex.splice(index, 1)
|
||||
}
|
||||
defineProps({
|
||||
dictData: {
|
||||
@ -300,7 +301,7 @@ const formData = reactive({
|
||||
strategic_significance: '',
|
||||
industry: '',
|
||||
unit_nature: '',
|
||||
annex: [],
|
||||
annex: '',
|
||||
status: '',
|
||||
})
|
||||
|
||||
@ -319,6 +320,21 @@ const setFormData = async (data: Record<any, any>) => {
|
||||
formData[key] = data[key]
|
||||
}
|
||||
}
|
||||
if (data.annex && data.annex.length > 0) {
|
||||
if (data.annex.includes(",")) {
|
||||
const arry1 = data.annex.split(',').map((item: any, index: any) => {
|
||||
return {
|
||||
name: `文件${index + 1}`,
|
||||
uri: item
|
||||
};
|
||||
});
|
||||
Object.assign(formDataannex, arry1)
|
||||
} else {
|
||||
const arry1 = [{ name: `文件1`, uri: data.annex }]
|
||||
Object.assign(formDataannex, arry1)
|
||||
|
||||
}
|
||||
}
|
||||
//@ts-ignore
|
||||
data.project_content && (formData.project_content = String(data.project_content).split(","))
|
||||
//@ts-ignore
|
||||
@ -337,6 +353,9 @@ const getDetail = async (row: Record<string, any>) => {
|
||||
|
||||
// 提交按钮
|
||||
const handleSubmit = async () => {
|
||||
if (formDataannex.length > 0) {
|
||||
formData.annex = formDataannex.map((item) => item.uri).toString()
|
||||
}
|
||||
await formRef.value?.validate()
|
||||
const data = { ...formData, project_content: formData.project_content.join(",") }
|
||||
mode.value == 'edit'
|
||||
|
0
src/views/project_document/index.vue
Normal file
0
src/views/project_document/index.vue
Normal file
172
src/views/project_manager_appointment/detail.vue
Normal file
172
src/views/project_manager_appointment/detail.vue
Normal file
@ -0,0 +1,172 @@
|
||||
|
||||
<template>
|
||||
<div class="detail-popup">
|
||||
<popup ref="popupRef" title="项目合同详情" :async="true" width="80%" @confirm="handleSubmit" @close="handleClose">
|
||||
<el-form ref="formRef" :model="formData" label-width="160px">
|
||||
<el-card class="mb-2">
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="合同编号">
|
||||
{{ formData.contract.contract_name }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item label="项目名称">
|
||||
{{ formData.project.name
|
||||
}}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item label="项目编码">
|
||||
{{ formData.project.project_code
|
||||
}}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item label="客户名称">
|
||||
{{ formData.custom.name
|
||||
}}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="退款日期">
|
||||
{{ formData.reason
|
||||
}}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="退款金额">
|
||||
{{ formData.amount }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="金额大写">
|
||||
{{ formData.amount_daxie }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="退款方式">
|
||||
<dict-value :options="dictData.refund_type" :value="formData.refund_type" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="退款人">
|
||||
{{ formData.refunder }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="收款账号">
|
||||
{{ formData.collection_acccount }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="收款银行">
|
||||
{{ formData.collection_bank }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item label="备注">
|
||||
{{ formData.remark
|
||||
}}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
|
||||
|
||||
|
||||
</el-row>
|
||||
</el-card>
|
||||
</el-form>
|
||||
</popup>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup name="customdetail">
|
||||
|
||||
import type { FormInstance } from 'element-plus'
|
||||
import Popup from '@/components/popup/index.vue'
|
||||
import { apiCustomDetail } from '@/api/custom'
|
||||
import { timeFormat } from '@/utils/util'
|
||||
import type { PropType } from 'vue'
|
||||
defineProps({
|
||||
dictData: {
|
||||
type: Object as PropType<Record<string, any[]>>,
|
||||
default: () => ({})
|
||||
}
|
||||
})
|
||||
const emit = defineEmits(['success', 'close'])
|
||||
const formRef = shallowRef<FormInstance>()
|
||||
const popupRef = shallowRef<InstanceType<typeof Popup>>()
|
||||
|
||||
const datas = reactive({
|
||||
provinceOptions: [],
|
||||
cityOptions: [],
|
||||
areaOptions: [],
|
||||
});
|
||||
|
||||
|
||||
// 表单数据
|
||||
const formData = reactive({
|
||||
|
||||
})
|
||||
|
||||
|
||||
|
||||
// 获取详情
|
||||
const setFormData = async (data: Record<any, any>) => {
|
||||
Object.assign(formData, data)
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
const getDetail = async (row: Record<string, any>) => {
|
||||
const data = await apiCustomDetail({
|
||||
id: row.id
|
||||
})
|
||||
setFormData(data)
|
||||
}
|
||||
|
||||
|
||||
// 提交按钮
|
||||
const handleSubmit = async () => {
|
||||
popupRef.value?.close()
|
||||
|
||||
}
|
||||
|
||||
//打开弹窗
|
||||
const open = () => {
|
||||
console.log('1111111')
|
||||
popupRef.value?.open()
|
||||
}
|
||||
|
||||
// 关闭回调
|
||||
const handleClose = () => {
|
||||
emit('close')
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
defineExpose({
|
||||
open,
|
||||
setFormData,
|
||||
getDetail
|
||||
})
|
||||
</script>
|
||||
<style lang="scss">
|
||||
.tit {
|
||||
font-size: 1.2em;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
</style>
|
408
src/views/project_manager_appointment/edit.vue
Normal file
408
src/views/project_manager_appointment/edit.vue
Normal file
@ -0,0 +1,408 @@
|
||||
<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="提交委任书" />
|
||||
<el-step title="项目经理确认" />
|
||||
|
||||
</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="contract_id" @click="showDialog2 = true">
|
||||
<el-input v-model="project_name" clearable placeholder="请输入项目名称" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="项目编码" prop="contract_id">
|
||||
<el-input v-model="project_code" clearable placeholder="请输入项目编码" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="客户名称" prop="contract_id">
|
||||
<el-input v-model="custom_name" clearable placeholder="请输入项目名称" />
|
||||
</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 placeholder="请输入合同编号" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="合同名称" prop="contract_name">
|
||||
<el-input v-model="contract_name" clearable placeholder="请输入合同名称" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-form-item label="项目类型" prop="project_type_id">
|
||||
<el-select class="w-[280px]" v-model="formData.project_type_id" clearable placeholder="请选择项目类型">
|
||||
<el-option label="全部" value=""></el-option>
|
||||
<el-option v-for="(item, index) in protype" :key="index" :label="item.name" :value="item.id" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="项目经理" prop="project_manager" @click="userclick">
|
||||
<el-input v-model="formData.project_manager" readonly clearable placeholder="请输入项目经理" />
|
||||
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<el-form-item label="项目金额" prop="amount">
|
||||
<el-input v-model="formData.amount" clearable placeholder="请输入项目金额" />
|
||||
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="立项日期" prop="project_approval_date">
|
||||
<el-date-picker class="flex-1 !flex" v-model="formData.project_approval_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="start_date">
|
||||
<el-date-picker class="flex-1 !flex" v-model="formData.start_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="delivery_date">
|
||||
<el-date-picker class="flex-1 !flex" v-model="formData.delivery_date" clearable type="date" value-format="YYYY-MM-DD " placeholder="选择项目交付日期">
|
||||
</el-date-picker>
|
||||
|
||||
</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="field127">
|
||||
<el-upload accept=".pdf" class="upload-demo" :show-file-list="false" aria-hidden="true" :headers="{ Token: userStore.token }" :action="base_url + '/upload/file'" :on-success="handleAvatarSuccess_four" ref="upload">
|
||||
<el-button type="primary">
|
||||
上传
|
||||
</el-button>
|
||||
</el-upload>
|
||||
|
||||
<div>
|
||||
<div v-for="(item, index) in formDataannex" style="margin-left: 5px;display: block;">
|
||||
<a style="margin-left: 10px; color: #4a5dff; align-self: flex-start" :href="item.uri" target="_blank">{{ item.name }}</a>
|
||||
<span style="cursor: pointer;margin-left: 5px;" @click="delFileFn(index)">x</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- <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"></salescontractDialog>
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog v-model="showDialog2" title="选择项目" width="70%">
|
||||
<projectDialog @customEvent="customEvent2"></projectDialog>
|
||||
</el-dialog>
|
||||
<personnelselector ref="personnel" @confirm="submituser" type="1"></personnelselector>
|
||||
</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 salescontractDialog from '@/components/salescontract/index.vue'
|
||||
import projectDialog from '@/components/project/index.vue'
|
||||
import { appointmentAdd, appointmentEdit, appointmentDetail } from '@/api/appointment'
|
||||
import { toChinesNum } from "@/utils/util";
|
||||
import { getAllProjectTypes } from '@/api/projecttype'
|
||||
import { timeFormat } from '@/utils/util'
|
||||
import { isEmail, isIdCard, isPhone } from '@/utils/validate'
|
||||
import { deptAll } from '@/api/org/department'
|
||||
import { getAll } from '@/api/org/organization'
|
||||
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 list1 = reactive([])
|
||||
const list2 = 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 userInfo = userStore.userInfo
|
||||
const personnel = ref<any>()
|
||||
// console.log(userInfo, '222222')
|
||||
// 上传文件
|
||||
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 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 amount_daxie = ref('')
|
||||
const showDialog = ref(false)
|
||||
const showDialog1 = ref(false)
|
||||
const showDialog2 = 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;
|
||||
contract_name.value = e.contract_name;
|
||||
contract_no.value = e.contract_code
|
||||
showDialog1.value = false;
|
||||
};
|
||||
|
||||
const customEvent2 = (e: any) => {
|
||||
formData.project_id = e.id;
|
||||
project_name.value = e.name;
|
||||
project_code.value = e.project_code;
|
||||
custom_name.value = e.custom_name;
|
||||
showDialog2.value = false;
|
||||
};
|
||||
//打开弹窗
|
||||
|
||||
const userclick = () => {
|
||||
// console.log(personnel.value, '1111111')
|
||||
personnel.value.open()
|
||||
|
||||
}
|
||||
//确认
|
||||
const submituser = (e: any) => {
|
||||
formData.project_manager = e.name;
|
||||
// return_name.value = e.name;
|
||||
}
|
||||
|
||||
|
||||
|
||||
//监听输入
|
||||
const amountinput = (e) => {
|
||||
// console.log(e)
|
||||
if (e && e > 0) {
|
||||
formData.amount_daxie = toChinesNum(e)
|
||||
}
|
||||
}
|
||||
// 弹窗标题
|
||||
const popupTitle = computed(() => {
|
||||
return mode.value == 'edit' ? '编辑退款申请表' : '新增退款申请表'
|
||||
})
|
||||
|
||||
// 表单数据
|
||||
const formData = reactive({
|
||||
id: '',
|
||||
org_id: "",
|
||||
dept_id: "",
|
||||
project_id: 0,
|
||||
contract_id: "",
|
||||
project_type_id: "",
|
||||
project_manager: '',
|
||||
amount: "",
|
||||
project_approval_date: "",
|
||||
start_date: "",
|
||||
delivery_date: "",
|
||||
remark: "",
|
||||
annex: "",
|
||||
process_approval: '{"current_step":"1","action":"1","submit_step":"2","check_user":"2","check_opinions":"dgfdsfds","copy_user":"3,4"}'
|
||||
})
|
||||
|
||||
|
||||
// 表单验证
|
||||
const formRules = reactive<any>({
|
||||
|
||||
})
|
||||
|
||||
//获取所有组织
|
||||
const getlist = () => {
|
||||
getAll().then((res) => {
|
||||
Object.assign(list1, res)
|
||||
if (res.length > 0) {
|
||||
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) => {
|
||||
getlist1(e)
|
||||
}
|
||||
//获取所有部门
|
||||
const getlist1 = (id: any) => {
|
||||
deptAll({ 'org_id': id }).then((res) => {
|
||||
Object.assign(list2, res)
|
||||
})
|
||||
}
|
||||
|
||||
// 获取详情
|
||||
const setFormData = async (data: Record<any, any>) => {
|
||||
if (data.return_desc && data.return_desc.length > 0) {
|
||||
if (data.return_desc.includes(",")) {
|
||||
const arry1 = data.return_desc.split(',').map((item: any, index: any) => {
|
||||
return {
|
||||
name: `文件${index + 1}`,
|
||||
uri: item
|
||||
};
|
||||
});
|
||||
Object.assign(formDataannex, arry1)
|
||||
} else {
|
||||
const arry1 = [{ name: `文件1`, uri: data.return_desc }]
|
||||
Object.assign(formDataannex, arry1)
|
||||
console.log(formDataannex)
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
for (const key in formData) {
|
||||
if (data[key] != null && data[key] != undefined) {
|
||||
//@ts-ignore
|
||||
formData[key] = data[key]
|
||||
}
|
||||
}
|
||||
custom_name.value = data.custom.name
|
||||
project_name.value = data.project.name
|
||||
project_code.value = data.project.project_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 appointmentDetail({
|
||||
id: row.id
|
||||
})
|
||||
setFormData(data)
|
||||
}
|
||||
|
||||
|
||||
// 提交按钮
|
||||
const handleSubmit = async () => {
|
||||
if (formDataannex.length > 0) {
|
||||
formData.return_desc = formDataannex.map((item: any) => item.uri).toString()
|
||||
}
|
||||
console.log(formRef.value?.validate(), '22222222')
|
||||
await formRef.value?.validate()
|
||||
|
||||
const data = { ...formData }
|
||||
mode.value == 'edit'
|
||||
? await appointmentEdit(data)
|
||||
: await appointmentAdd(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);
|
||||
})
|
||||
getlist()
|
||||
|
||||
}
|
||||
|
||||
// 关闭回调
|
||||
const handleClose = () => {
|
||||
emit('close')
|
||||
}
|
||||
|
||||
|
||||
|
||||
defineExpose({
|
||||
open,
|
||||
setFormData,
|
||||
getDetail
|
||||
})
|
||||
</script>
|
152
src/views/project_manager_appointment/index.vue
Normal file
152
src/views/project_manager_appointment/index.vue
Normal file
@ -0,0 +1,152 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-card class="!border-none mb-4" shadow="never">
|
||||
<el-form class="mb-[-16px]" :model="queryParams" inline>
|
||||
<el-form-item label="立项日期" prop="project_name">
|
||||
<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>
|
||||
|
||||
|
||||
<el-form-item label="项目时间范围" prop="project_role_name">
|
||||
<el-date-picker v-model="dtimevalue" type="daterange" start-placeholder="项目开始日期" end-placeholder="项目交付日期" :default-time="defaultTime" value-format="YYYY-MM-DD " />
|
||||
</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_manager_appointment/add']" type="primary" @click="handleAdd">
|
||||
<template #icon>
|
||||
<icon name="el-icon-Plus" />
|
||||
</template>
|
||||
新增
|
||||
</el-button>
|
||||
<el-button v-perms="['project.project_manager_appointment/delete']" :disabled="!selectData.length" @click="handleDelete(selectData)">
|
||||
删除
|
||||
</el-button>
|
||||
|
||||
<div class="mt-4">
|
||||
<el-table :data="pager.lists" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column label="退款单号" prop="project_name" show-overflow-tooltip />
|
||||
<el-table-column label="客户名称" prop="project_code" show-overflow-tooltip />
|
||||
<el-table-column label="项目名称" prop="project_role_name" show-overflow-tooltip />
|
||||
<el-table-column label="合同编号" prop="admin_name" show-overflow-tooltip />
|
||||
<el-table-column label="退款原因" prop="reason" show-overflow-tooltip />
|
||||
<el-table-column label="退款日期" prop="refund_date" show-overflow-tooltip />
|
||||
<el-table-column label="退款金额" prop="amount" show-overflow-tooltip />
|
||||
<el-table-column label="退款方式" prop="refund_type" show-overflow-tooltip>
|
||||
<template #default="{ row }">
|
||||
<dict-value :options="dictData.refund_type" :value="row.refund_type" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="退款人" prop="refunder" show-overflow-tooltip />
|
||||
<el-table-column label="备注" prop="remark" show-overflow-tooltip />
|
||||
<el-table-column label="操作" width="150" fixed="right">
|
||||
<template #default="{ row }">
|
||||
<el-button v-perms="['project.project_manager_appointment/edit']" type="primary" link @click="handleEdit(row)">
|
||||
编辑
|
||||
</el-button>
|
||||
<el-button v-perms="['project.project_manager_appointment/delete']" type="danger" link @click="handleDelete(row.id)">
|
||||
删除
|
||||
</el-button>
|
||||
<el-button v-perms="['project.project_manager_appointment/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 { appointmentLists, appointmentDelete, appointmentDetail } from '@/api/appointment'
|
||||
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 dtimevalue = ref([])
|
||||
|
||||
|
||||
// 查询条件
|
||||
const queryParams = reactive({
|
||||
project_approval_date: '',
|
||||
start_date: dtimevalue.value[0],
|
||||
delivery_date: dtimevalue.value[1]
|
||||
})
|
||||
|
||||
|
||||
// 选中数据
|
||||
const selectData = ref<any[]>([])
|
||||
|
||||
// 表格选择后回调事件
|
||||
const handleSelectionChange = (val: any[]) => {
|
||||
selectData.value = val.map(({ id }) => id)
|
||||
}
|
||||
|
||||
// 获取字典数据
|
||||
const { dictData } = useDictData('invoice_type')
|
||||
// 分页相关
|
||||
const { pager, getLists, resetParams, resetPage } = usePaging({
|
||||
fetchFun: appointmentLists,
|
||||
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 appointmentDetail({ 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 appointmentDelete({ id })
|
||||
getLists()
|
||||
}
|
||||
const handledetail = async (data: any) => {
|
||||
let res = await appointmentDetail({ id: data.id })
|
||||
showDtail.value = true
|
||||
await nextTick()
|
||||
detailRef.value?.open()
|
||||
detailRef.value?.setFormData(res)
|
||||
}
|
||||
|
||||
|
||||
getLists()
|
||||
</script>
|
||||
|
149
src/views/project_milestones/index.vue
Normal file
149
src/views/project_milestones/index.vue
Normal file
@ -0,0 +1,149 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-card class="!border-none mb-4" shadow="never">
|
||||
<el-form class="mb-[-16px]" :model="queryParams" inline>
|
||||
<el-form-item label="立项日期" prop="project_name">
|
||||
<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>
|
||||
<el-form-item label="项目时间范围" prop="project_role_name">
|
||||
<el-date-picker v-model="value" type="daterange" start-placeholder="项目开始日期" end-placeholder="项目交付日期" :default-time="defaultTime" value-format="YYYY-MM-DD " />
|
||||
</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_manager_appointment/add']" type="primary" @click="handleAdd">
|
||||
<template #icon>
|
||||
<icon name="el-icon-Plus" />
|
||||
</template>
|
||||
新增
|
||||
</el-button>
|
||||
<el-button v-perms="['project.project_manager_appointment/delete']" :disabled="!selectData.length" @click="handleDelete(selectData)">
|
||||
删除
|
||||
</el-button>
|
||||
|
||||
<div class="mt-4">
|
||||
<el-table :data="pager.lists" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column label="退款单号" prop="project_name" show-overflow-tooltip />
|
||||
<el-table-column label="客户名称" prop="project_code" show-overflow-tooltip />
|
||||
<el-table-column label="项目名称" prop="project_role_name" show-overflow-tooltip />
|
||||
<el-table-column label="合同编号" prop="admin_name" show-overflow-tooltip />
|
||||
<el-table-column label="退款原因" prop="reason" show-overflow-tooltip />
|
||||
<el-table-column label="退款日期" prop="refund_date" show-overflow-tooltip />
|
||||
<el-table-column label="退款金额" prop="amount" show-overflow-tooltip />
|
||||
<el-table-column label="退款方式" prop="refund_type" show-overflow-tooltip>
|
||||
<template #default="{ row }">
|
||||
<dict-value :options="dictData.refund_type" :value="row.refund_type" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="退款人" prop="refunder" show-overflow-tooltip />
|
||||
<el-table-column label="备注" prop="remark" show-overflow-tooltip />
|
||||
<el-table-column label="操作" width="150" fixed="right">
|
||||
<template #default="{ row }">
|
||||
<el-button v-perms="['project.project_manager_appointment/edit']" type="primary" link @click="handleEdit(row)">
|
||||
编辑
|
||||
</el-button>
|
||||
<el-button v-perms="['project.project_manager_appointment/delete']" type="danger" link @click="handleDelete(row.id)">
|
||||
删除
|
||||
</el-button>
|
||||
<el-button v-perms="['project.project_manager_appointment/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 { appointmentLists, appointmentDelete, appointmentDetail } from '@/api/appointment'
|
||||
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 value = ref([])
|
||||
|
||||
// 查询条件
|
||||
const queryParams = reactive({
|
||||
project_approval_date: '',
|
||||
start_date: '',
|
||||
delivery_date: ''
|
||||
})
|
||||
|
||||
|
||||
// 选中数据
|
||||
const selectData = ref<any[]>([])
|
||||
|
||||
// 表格选择后回调事件
|
||||
const handleSelectionChange = (val: any[]) => {
|
||||
selectData.value = val.map(({ id }) => id)
|
||||
}
|
||||
|
||||
// 获取字典数据
|
||||
const { dictData } = useDictData('invoice_type')
|
||||
// 分页相关
|
||||
const { pager, getLists, resetParams, resetPage } = usePaging({
|
||||
fetchFun: appointmentLists,
|
||||
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 appointmentDetail({ 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 appointmentDelete({ id })
|
||||
getLists()
|
||||
}
|
||||
const handledetail = async (data: any) => {
|
||||
let res = await appointmentDetail({ id: data.id })
|
||||
showDtail.value = true
|
||||
await nextTick()
|
||||
detailRef.value?.open()
|
||||
detailRef.value?.setFormData(res)
|
||||
}
|
||||
|
||||
|
||||
getLists()
|
||||
</script>
|
||||
|
0
src/views/project_plan/index.vue
Normal file
0
src/views/project_plan/index.vue
Normal file
172
src/views/receiptrecord/detail.vue
Normal file
172
src/views/receiptrecord/detail.vue
Normal file
@ -0,0 +1,172 @@
|
||||
|
||||
<template>
|
||||
<div class="detail-popup">
|
||||
<popup ref="popupRef" title="项目合同详情" :async="true" width="80%" @confirm="handleSubmit" @close="handleClose">
|
||||
<el-form ref="formRef" :model="formData" label-width="160px">
|
||||
<el-card class="mb-2">
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="合同编号">
|
||||
{{ formData.contract.contract_name }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item label="项目名称">
|
||||
{{ formData.project.name
|
||||
}}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item label="项目编码">
|
||||
{{ formData.project.project_code
|
||||
}}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item label="客户名称">
|
||||
{{ formData.custom.name
|
||||
}}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="退款日期">
|
||||
{{ formData.reason
|
||||
}}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="退款金额">
|
||||
{{ formData.amount }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="金额大写">
|
||||
{{ formData.amount_daxie }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="退款方式">
|
||||
<dict-value :options="dictData.refund_type" :value="formData.refund_type" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="退款人">
|
||||
{{ formData.refunder }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="收款账号">
|
||||
{{ formData.collection_acccount }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="收款银行">
|
||||
{{ formData.collection_bank }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item label="备注">
|
||||
{{ formData.remark
|
||||
}}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
|
||||
|
||||
|
||||
</el-row>
|
||||
</el-card>
|
||||
</el-form>
|
||||
</popup>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup name="customdetail">
|
||||
|
||||
import type { FormInstance } from 'element-plus'
|
||||
import Popup from '@/components/popup/index.vue'
|
||||
import { apiCustomDetail } from '@/api/custom'
|
||||
import { timeFormat } from '@/utils/util'
|
||||
import type { PropType } from 'vue'
|
||||
defineProps({
|
||||
dictData: {
|
||||
type: Object as PropType<Record<string, any[]>>,
|
||||
default: () => ({})
|
||||
}
|
||||
})
|
||||
const emit = defineEmits(['success', 'close'])
|
||||
const formRef = shallowRef<FormInstance>()
|
||||
const popupRef = shallowRef<InstanceType<typeof Popup>>()
|
||||
|
||||
const datas = reactive({
|
||||
provinceOptions: [],
|
||||
cityOptions: [],
|
||||
areaOptions: [],
|
||||
});
|
||||
|
||||
|
||||
// 表单数据
|
||||
const formData = reactive({
|
||||
|
||||
})
|
||||
|
||||
|
||||
|
||||
// 获取详情
|
||||
const setFormData = async (data: Record<any, any>) => {
|
||||
Object.assign(formData, data)
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
const getDetail = async (row: Record<string, any>) => {
|
||||
const data = await apiCustomDetail({
|
||||
id: row.id
|
||||
})
|
||||
setFormData(data)
|
||||
}
|
||||
|
||||
|
||||
// 提交按钮
|
||||
const handleSubmit = async () => {
|
||||
popupRef.value?.close()
|
||||
|
||||
}
|
||||
|
||||
//打开弹窗
|
||||
const open = () => {
|
||||
console.log('1111111')
|
||||
popupRef.value?.open()
|
||||
}
|
||||
|
||||
// 关闭回调
|
||||
const handleClose = () => {
|
||||
emit('close')
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
defineExpose({
|
||||
open,
|
||||
setFormData,
|
||||
getDetail
|
||||
})
|
||||
</script>
|
||||
<style lang="scss">
|
||||
.tit {
|
||||
font-size: 1.2em;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
</style>
|
385
src/views/receiptrecord/edit.vue
Normal file
385
src/views/receiptrecord/edit.vue
Normal file
@ -0,0 +1,385 @@
|
||||
<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 :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="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="contract_id" @click="showDialog1 = true">
|
||||
<el-input v-model="project_name" clearable placeholder="请输入项目名称" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="项目编码" prop="contract_id">
|
||||
<el-input v-model="project_code" clearable placeholder="请输入项目编码" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<el-form-item label="合同编号" prop="contract_no">
|
||||
<el-input v-model="contract_no" clearable placeholder="请输入合同编号" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="合同名称" prop="contract_name">
|
||||
<el-input v-model="contract_name" clearable placeholder="请输入合同名称" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="开票日期" prop="return_date">
|
||||
<el-date-picker class="flex-1 !flex" v-model="formData.return_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="refunder">
|
||||
<el-input v-model="formData.refunder" readonly clearable placeholder="请输入提交人" />
|
||||
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="发票类型" prop="invoice_type">
|
||||
<el-radio-group v-model="formData.invoice_type" placeholder="请选择发票类型">
|
||||
<el-radio v-for="(item, index) in dictData.invoice_type" :key="index" :label="parseInt(item.value)">
|
||||
{{ item.name }}
|
||||
</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="发票编号" prop="reason">
|
||||
<el-input v-model="formData.reason" clearable placeholder="请输入退款原因" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="发票金额" prop="amount">
|
||||
<el-input v-model="formData.amount" clearable placeholder="请输入退款金额" @input="amountinput" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="发票金额大写" prop="amount_daxie">
|
||||
<el-input v-model="formData.amount_daxie" readonly 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="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="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="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="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=".pdf" class="upload-demo" :show-file-list="false" aria-hidden="true" :headers="{ Token: userStore.token }" :action="base_url + '/upload/file'" :on-success="handleAvatarSuccess_four" ref="upload">
|
||||
<el-button type="primary">
|
||||
上传
|
||||
</el-button>
|
||||
</el-upload>
|
||||
|
||||
<div>
|
||||
<div v-for="(item, index) in formDataannex" style="margin-left: 5px;display: block;">
|
||||
<a style="margin-left: 10px; color: #4a5dff; align-self: flex-start" :href="item.uri" target="_blank">{{ item.name }}</a>
|
||||
<span style="cursor: pointer;margin-left: 5px;" @click="delFileFn(index)">x</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<div style="margin: 20px 0;">客户收款信息</div>
|
||||
|
||||
<el-row :gutter="10">
|
||||
|
||||
<el-col :span="8">
|
||||
<el-form-item label="收款账号" prop="collection_acccount" @click="showDialog2 = true">
|
||||
<el-input v-model="formData.collection_acccount" clearable placeholder="请输入收款账号" />
|
||||
</el-form-item>
|
||||
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<el-form-item label="收款银行" prop="collection_bank">
|
||||
<el-input v-model="formData.collection_bank" 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"></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 salescontractDialog from '@/components/salescontract/index.vue'
|
||||
|
||||
import { apirefundapplyAdd, apirefundapplyEdit, apirefundapplyDetail } from '@/api/refund'
|
||||
import { toChinesNum } from "@/utils/util";
|
||||
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 userInfo = userStore.userInfo
|
||||
console.log(userInfo, '222222')
|
||||
// 上传文件
|
||||
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 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 amount_daxie = ref('')
|
||||
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
|
||||
showDialog1.value = false;
|
||||
};
|
||||
|
||||
|
||||
|
||||
//监听输入
|
||||
const amountinput = (e) => {
|
||||
// console.log(e)
|
||||
if (e && e > 0) {
|
||||
formData.amount_daxie = toChinesNum(e)
|
||||
}
|
||||
}
|
||||
// 弹窗标题
|
||||
const popupTitle = computed(() => {
|
||||
return mode.value == 'edit' ? '编辑退款申请表' : '新增退款申请表'
|
||||
})
|
||||
|
||||
// 表单数据
|
||||
const formData = reactive({
|
||||
id: '',
|
||||
customer_id: "",
|
||||
contract_id: "",
|
||||
approve_id: 0,
|
||||
refund_date: "",
|
||||
reason: "",
|
||||
amount: 0,
|
||||
amount_daxie: "",
|
||||
refund_type: "",
|
||||
refunder: userInfo.name,
|
||||
return_total_amount: "",
|
||||
return_desc: "",
|
||||
collection_bank: "",
|
||||
collection_acccount: ""
|
||||
})
|
||||
|
||||
|
||||
// 表单验证
|
||||
const formRules = reactive<any>({
|
||||
|
||||
})
|
||||
|
||||
|
||||
// 获取详情
|
||||
const setFormData = async (data: Record<any, any>) => {
|
||||
if (data.return_desc && data.return_desc.length > 0) {
|
||||
if (data.return_desc.includes(",")) {
|
||||
const arry1 = data.return_desc.split(',').map((item: any, index: any) => {
|
||||
return {
|
||||
name: `文件${index + 1}`,
|
||||
uri: item
|
||||
};
|
||||
});
|
||||
Object.assign(formDataannex, arry1)
|
||||
} else {
|
||||
const arry1 = [{ name: `文件1`, uri: data.return_desc }]
|
||||
Object.assign(formDataannex, arry1)
|
||||
console.log(formDataannex)
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
for (const key in formData) {
|
||||
if (data[key] != null && data[key] != undefined) {
|
||||
//@ts-ignore
|
||||
formData[key] = data[key]
|
||||
}
|
||||
}
|
||||
custom_name.value = data.custom.name
|
||||
project_name.value = data.project.name
|
||||
project_code.value = data.project.project_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 apirefundapplyDetail({
|
||||
id: row.id
|
||||
})
|
||||
setFormData(data)
|
||||
}
|
||||
|
||||
|
||||
// 提交按钮
|
||||
const handleSubmit = async () => {
|
||||
if (formDataannex.length > 0) {
|
||||
formData.return_desc = formDataannex.map((item: any) => item.uri).toString()
|
||||
}
|
||||
console.log(formRef.value?.validate(), '22222222')
|
||||
await formRef.value?.validate()
|
||||
|
||||
|
||||
const data = { ...formData }
|
||||
mode.value == 'edit'
|
||||
? await apirefundapplyEdit(data)
|
||||
: await apirefundapplyAdd(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>
|
148
src/views/receiptrecord/index.vue
Normal file
148
src/views/receiptrecord/index.vue
Normal file
@ -0,0 +1,148 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-card class="!border-none mb-4" shadow="never">
|
||||
<el-form class="mb-[-16px]" :model="queryParams" inline>
|
||||
<el-form-item label="合同编号" prop="project_name">
|
||||
<el-input class="w-[280px]" v-model="queryParams.contract_no" clearable placeholder="请输入合同编号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="合同名称" prop="project_role_name">
|
||||
<el-input class="w-[280px]" v-model="queryParams.contract_name" clearable placeholder="请输入合同名称" />
|
||||
</el-form-item>
|
||||
|
||||
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="resetPage">查询</el-button>
|
||||
<el-button @click="resetParams">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
<el-card class="!border-none" v-loading="pager.loading" shadow="never">
|
||||
<el-button v-perms="['refund.refund/add']" type="primary" @click="handleAdd">
|
||||
<template #icon>
|
||||
<icon name="el-icon-Plus" />
|
||||
</template>
|
||||
新增
|
||||
</el-button>
|
||||
<el-button v-perms="['refund.refund/delete']" :disabled="!selectData.length" @click="handleDelete(selectData)">
|
||||
删除
|
||||
</el-button>
|
||||
|
||||
<div class="mt-4">
|
||||
<el-table :data="pager.lists" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column label="退款单号" prop="project_name" show-overflow-tooltip />
|
||||
<el-table-column label="客户名称" prop="project_code" show-overflow-tooltip />
|
||||
<el-table-column label="项目名称" prop="project_role_name" show-overflow-tooltip />
|
||||
<el-table-column label="合同编号" prop="admin_name" show-overflow-tooltip />
|
||||
<el-table-column label="退款原因" prop="reason" show-overflow-tooltip />
|
||||
<el-table-column label="退款日期" prop="refund_date" show-overflow-tooltip />
|
||||
<el-table-column label="退款金额" prop="amount" show-overflow-tooltip />
|
||||
<el-table-column label="退款方式" prop="refund_type" show-overflow-tooltip>
|
||||
<template #default="{ row }">
|
||||
<dict-value :options="dictData.refund_type" :value="row.refund_type" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="退款人" prop="refunder" show-overflow-tooltip />
|
||||
<el-table-column label="备注" prop="remark" show-overflow-tooltip />
|
||||
<el-table-column label="操作" width="150" fixed="right">
|
||||
<template #default="{ row }">
|
||||
<el-button v-perms="['refund.refund/edit']" type="primary" link @click="handleEdit(row)">
|
||||
编辑
|
||||
</el-button>
|
||||
<el-button v-perms="['refund.refund/delete']" type="danger" link @click="handleDelete(row.id)">
|
||||
删除
|
||||
</el-button>
|
||||
<el-button v-perms="['refund.refund/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 { apirefundapplyLists, apirefundapplyDelete, apirefundapplyDetail } from '@/api/refund'
|
||||
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_no: '',
|
||||
contract_name: '',
|
||||
|
||||
})
|
||||
|
||||
|
||||
|
||||
// 选中数据
|
||||
const selectData = ref<any[]>([])
|
||||
|
||||
// 表格选择后回调事件
|
||||
const handleSelectionChange = (val: any[]) => {
|
||||
selectData.value = val.map(({ id }) => id)
|
||||
}
|
||||
|
||||
// 获取字典数据
|
||||
const { dictData } = useDictData('invoice_type')
|
||||
// 分页相关
|
||||
const { pager, getLists, resetParams, resetPage } = usePaging({
|
||||
fetchFun: apirefundapplyLists,
|
||||
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 apirefundapplyDetail({ 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 apirefundapplyDelete({ id })
|
||||
getLists()
|
||||
}
|
||||
const handledetail = async (data: any) => {
|
||||
let res = await apirefundapplyDetail({ id: data.id })
|
||||
showDtail.value = true
|
||||
await nextTick()
|
||||
detailRef.value?.open()
|
||||
detailRef.value?.setFormData(res)
|
||||
}
|
||||
|
||||
|
||||
getLists()
|
||||
</script>
|
||||
|
194
src/views/recordsPayment/detail.vue
Normal file
194
src/views/recordsPayment/detail.vue
Normal file
@ -0,0 +1,194 @@
|
||||
|
||||
<template>
|
||||
<div class="detail-popup">
|
||||
<popup ref="popupRef" title="回款记录详情" :async="true" width="80%" @confirm="handleSubmit" @close="handleClose">
|
||||
<el-form ref="formRef" :model="formData" label-width="160px">
|
||||
<el-card class="mb-2">
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="合同编号">
|
||||
{{ formData.contract.contract_name }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item label="项目名称">
|
||||
{{ formData.project.name
|
||||
}}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item label="项目编码">
|
||||
{{ formData.project.project_code
|
||||
}}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item label="客户名称">
|
||||
{{ formData.custom.name
|
||||
}}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="期次">
|
||||
<dict-value :options="dictData.pay_period" :value="formData.period" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="计划回款日期">
|
||||
{{ formData.return_date
|
||||
}}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item label="状态">
|
||||
<dict-value :options="dictData.invoice_status" :value="formData.invoice_status" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="付款方式">
|
||||
<dict-value :options="dictData.pay_type" :value="formData.pay_type" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="收款性质">
|
||||
<dict-value :options="dictData.collection_type" :value="formData.collection_type" />
|
||||
</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.remark
|
||||
}}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="回款责任人">
|
||||
{{ formData.return_date
|
||||
}}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="24">
|
||||
<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>) => {
|
||||
Object.assign(formData, data)
|
||||
if (data.annex && data.annex.length > 0) {
|
||||
if (data.annex.includes(",")) {
|
||||
const arry1 = data.annex.split(',').map((item: any, index: any) => {
|
||||
return {
|
||||
name: `文件${index + 1}`,
|
||||
uri: item
|
||||
};
|
||||
});
|
||||
Object.assign(formDataannex, arry1)
|
||||
} else {
|
||||
const arry1 = [{ name: `文件1`, uri: data.annex }]
|
||||
Object.assign(formDataannex, arry1)
|
||||
console.log(formDataannex)
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
const getDetail = async (row: Record<string, any>) => {
|
||||
const data = await apiCustomDetail({
|
||||
id: row.id
|
||||
})
|
||||
setFormData(data)
|
||||
}
|
||||
|
||||
|
||||
// 提交按钮
|
||||
const handleSubmit = async () => {
|
||||
popupRef.value?.close()
|
||||
|
||||
}
|
||||
|
||||
//打开弹窗
|
||||
const open = () => {
|
||||
popupRef.value?.open()
|
||||
}
|
||||
|
||||
// 关闭回调
|
||||
const handleClose = () => {
|
||||
emit('close')
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
defineExpose({
|
||||
open,
|
||||
setFormData,
|
||||
getDetail
|
||||
})
|
||||
</script>
|
||||
<style lang="scss">
|
||||
.tit {
|
||||
font-size: 1.2em;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
</style>
|
432
src/views/recordsPayment/edit.vue
Normal file
432
src/views/recordsPayment/edit.vue
Normal file
@ -0,0 +1,432 @@
|
||||
<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 :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="return_date">
|
||||
<el-date-picker class="flex-1 !flex" v-model="formData.return_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_id" @click="showDialog1 = true">
|
||||
<el-input v-model="project_name" clearable placeholder="请输入项目名称" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="项目编码" prop="contract_id">
|
||||
<el-input v-model="project_code" clearable placeholder="请输入项目编码" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<el-form-item label="合同编号" prop="contract_no">
|
||||
<el-input v-model="contract_no" clearable placeholder="请输入合同编号" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="合同名称" prop="contract_name">
|
||||
<el-input v-model="contract_name" clearable 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="12">
|
||||
<el-button type="primary" @click="showDialog3 = true">选择待回款计划</el-button>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="收款性质" prop="contacts">
|
||||
<el-select class="flex-1" v-model="formData.collection_type" clearable placeholder="请选择收款性质">
|
||||
<el-option v-for="(item, index) in dictData.collection_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="amount">
|
||||
<el-input v-model="formData.amount" clearable placeholder="请输入金额" @input="amountinput" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="金额大写" prop="amount_daxie">
|
||||
<el-input v-model="amount_daxie" readonly 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_status" clearable placeholder="请选择开票状态">
|
||||
<el-option v-for="(item, index) in dictData.invoice_status" :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="contacts">
|
||||
<el-select class="flex-1" v-model="formData.pay_type" clearable placeholder="请选择付款方式">
|
||||
<el-option v-for="(item, index) in dictData.pay_type" :key="index" :label="item.name" :value="parseInt(item.value)" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="24">
|
||||
<el-form-item label="累计回款" prop="return_total_amount">
|
||||
<el-input v-model="formData.return_total_amount" type="textarea" clearable placeholder="请输入累计回款" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<el-form-item label="款项说明" prop="return_desc">
|
||||
<el-input v-model="formData.return_desc" clearable placeholder="请输入款项说明" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="收款人" prop="receiver">
|
||||
<el-input v-model="formData.receiver" 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="field127">
|
||||
<el-upload accept=".pdf" class="upload-demo" :show-file-list="false" aria-hidden="true" :headers="{ Token: userStore.token }" :action="base_url + '/upload/file'" :on-success="handleAvatarSuccess_four" ref="upload">
|
||||
<el-button type="primary">
|
||||
上传
|
||||
</el-button>
|
||||
</el-upload>
|
||||
|
||||
<div>
|
||||
<div v-for="(item, index) in formDataannex" style="margin-left: 5px;display: block;">
|
||||
<a style="margin-left: 10px; color: #4a5dff; align-self: flex-start" :href="item.uri" target="_blank">{{ item.name }}</a>
|
||||
<span style="cursor: pointer;margin-left: 5px;" @click="delFileFn(index)">x</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<div style="margin: 20px 0;">收款账户</div>
|
||||
|
||||
<el-row :gutter="10">
|
||||
|
||||
<el-col :span="8">
|
||||
<el-form-item label="账户编码" prop="invoicing_company_name" @click="showDialog2 = true">
|
||||
<el-input v-model="formData.invoicing_company_name" 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-col :span="24">
|
||||
<el-form-item label="是否计息" prop="is_interest">
|
||||
<el-radio-group v-model="formData.is_interest" placeholder="请选择是否计息">
|
||||
<el-radio v-for="(item, index) in dictData.isaccrued" :key="index" :label="parseInt(item.value)">
|
||||
{{ item.name }}
|
||||
</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="开始计息日期" prop="interest_date">
|
||||
|
||||
<el-date-picker class="flex-1 !flex" v-model="formData.interest_date" clearable type="datetime" value-format="YYYY-MM-DD HH:mm:ss" placeholder="选择日期">
|
||||
</el-date-picker>
|
||||
|
||||
</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"></salescontractDialog>
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog v-model="showDialog2" title="选择银行账户" width="70%">
|
||||
<bankaccountDialog @customEvent="customEvent"></bankaccountDialog>
|
||||
</el-dialog>
|
||||
<el-dialog v-model="showDialog3" title="选择待回款计划" width="70%">
|
||||
<pendingDialog @customEvent="customEvent3"></pendingDialog>
|
||||
</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 salescontractDialog from '@/components/salescontract/index.vue'
|
||||
import bankaccountDialog from '@/components/bankaccount/index.vue'
|
||||
import pendingDialog from '@/components/pending_paymentplan/index.vue'
|
||||
import { apireturnedrecordAdd, apireturnedrecordEdit, apireturnedrecordDetail } from '@/api/recordsPayment'
|
||||
import { toChinesNum } from "@/utils/util";
|
||||
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 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 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 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 amount_daxie = ref('')
|
||||
const showDialog = ref(false)
|
||||
const showDialog1 = ref(false)
|
||||
const showDialog2 = ref(false)
|
||||
const showDialog3 = 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
|
||||
showDialog1.value = false;
|
||||
};
|
||||
|
||||
const customEvent3 = (e: any) => {
|
||||
formData.finance_returned_money_id = e.id;
|
||||
formData.period = e.period
|
||||
formData.amount = e.amount
|
||||
if (e && e.amount) {
|
||||
amount_daxie.value = toChinesNum(e)
|
||||
}
|
||||
showDialog3.value = false;
|
||||
}
|
||||
|
||||
//监听输入
|
||||
const amountinput = (e) => {
|
||||
// console.log(e)
|
||||
if (e && e > 0) {
|
||||
amount_daxie.value = toChinesNum(e)
|
||||
}
|
||||
}
|
||||
// 弹窗标题
|
||||
const popupTitle = computed(() => {
|
||||
return mode.value == 'edit' ? '编辑回款记录表' : '新增回款记录表'
|
||||
})
|
||||
|
||||
// 表单数据
|
||||
const formData = reactive({
|
||||
id: '',
|
||||
customer_id: '',
|
||||
contract_id: '',
|
||||
finance_returned_money_id: 0,
|
||||
return_date: "",
|
||||
period: "",
|
||||
amount: 0,
|
||||
collection_type: '',
|
||||
invoice_status: '',
|
||||
pay_type: '',
|
||||
return_total_amount: 0,
|
||||
return_desc: "",
|
||||
receiver: "",
|
||||
payee_id: "",
|
||||
is_interest: 0,
|
||||
interest_date: "",
|
||||
remark: "",
|
||||
annex: ""
|
||||
})
|
||||
|
||||
|
||||
// 表单验证
|
||||
const formRules = reactive<any>({
|
||||
|
||||
})
|
||||
|
||||
|
||||
// 获取详情
|
||||
const setFormData = async (data: Record<any, any>) => {
|
||||
if (data.annex && data.annex.length > 0) {
|
||||
if (data.annex.includes(",")) {
|
||||
const arry1 = data.annex.split(',').map((item: any, index: any) => {
|
||||
return {
|
||||
name: `文件${index + 1}`,
|
||||
uri: item
|
||||
};
|
||||
});
|
||||
Object.assign(formDataannex, arry1)
|
||||
} else {
|
||||
const arry1 = [{ name: `文件1`, uri: data.annex }]
|
||||
Object.assign(formDataannex, arry1)
|
||||
console.log(formDataannex)
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
for (const key in formData) {
|
||||
if (data[key] != null && data[key] != undefined) {
|
||||
//@ts-ignore
|
||||
formData[key] = data[key]
|
||||
}
|
||||
}
|
||||
custom_name.value = data.custom.name
|
||||
project_name.value = data.project.name
|
||||
project_code.value = data.project.project_code
|
||||
project_amount.value = data.contract.amount
|
||||
contract_name.value = data.contract.contract_name;
|
||||
contract_no.value = data.contract.contract_code
|
||||
if (data.amount) {
|
||||
amount_daxie.value = toChinesNum(data.amount)
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
const getDetail = async (row: Record<string, any>) => {
|
||||
const data = await apireturnedrecordDetail({
|
||||
id: row.id
|
||||
})
|
||||
setFormData(data)
|
||||
}
|
||||
|
||||
|
||||
// 提交按钮
|
||||
const handleSubmit = async () => {
|
||||
if (formDataannex.length > 0) {
|
||||
formData.annex = formDataannex.map((item: any) => item.uri).toString()
|
||||
}
|
||||
console.log(formRef.value?.validate(), '22222222')
|
||||
await formRef.value?.validate()
|
||||
|
||||
|
||||
const data = { ...formData }
|
||||
mode.value == 'edit'
|
||||
? await apireturnedrecordEdit(data)
|
||||
: await apireturnedrecordAdd(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>
|
164
src/views/recordsPayment/index.vue
Normal file
164
src/views/recordsPayment/index.vue
Normal file
@ -0,0 +1,164 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-card class="!border-none mb-4" shadow="never">
|
||||
<el-form class="mb-[-16px]" :model="queryParams" inline>
|
||||
<el-form-item label="合同编号" prop="project_name">
|
||||
<el-input class="w-[280px]" v-model="queryParams.contract_no" clearable placeholder="请输入合同编号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="合同名称" prop="project_role_name">
|
||||
<el-input class="w-[280px]" v-model="queryParams.contract_name" clearable placeholder="请输入合同名称" />
|
||||
</el-form-item>
|
||||
|
||||
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="resetPage">查询</el-button>
|
||||
<el-button @click="resetParams">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
<el-card class="!border-none" v-loading="pager.loading" shadow="never">
|
||||
<el-button v-perms="['recordsPayment.recordsPayment/add']" type="primary" @click="handleAdd">
|
||||
<template #icon>
|
||||
<icon name="el-icon-Plus" />
|
||||
</template>
|
||||
新增
|
||||
</el-button>
|
||||
<el-button v-perms="['recordsPayment.recordsPayment/delete']" :disabled="!selectData.length" @click="handleDelete(selectData)">
|
||||
删除
|
||||
</el-button>
|
||||
|
||||
<div class="mt-4">
|
||||
<el-table :data="pager.lists" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column label="客户名称" prop="project_name" show-overflow-tooltip />
|
||||
<el-table-column label="合同编号" prop="project_name" show-overflow-tooltip />
|
||||
<el-table-column label="项目名称" prop="project_name" show-overflow-tooltip />
|
||||
|
||||
<el-table-column label="日期" prop="return_date" show-overflow-tooltip />
|
||||
<el-table-column label="期次" prop="industry">
|
||||
<template #default="{ row }">
|
||||
<dict-value :options="dictData.pay_period" :value="row.period" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="金额" prop="amount" show-overflow-tooltip />
|
||||
<el-table-column label="开票状态" prop="invoice_status">
|
||||
<template #default="{ row }">
|
||||
<dict-value :options="dictData.invoice_status" :value="row.invoice_status" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="付款方式" prop="pay_type">
|
||||
<template #default="{ row }">
|
||||
<dict-value :options="dictData.pay_type" :value="row.pay_type" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="收款性质" prop="collection_type">
|
||||
<template #default="{ row }">
|
||||
<dict-value :options="dictData.collection_type" :value="row.collection_type" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="收款人" prop="receiver" show-overflow-tooltip />
|
||||
<!-- <el-table-column label="开户银行" prop="remark" show-overflow-tooltip /> -->
|
||||
<el-table-column label="操作" width="150" fixed="right">
|
||||
<template #default="{ row }">
|
||||
<el-button v-perms="['recordsPayment.recordsPayment/edit']" type="primary" link @click="handleEdit(row)">
|
||||
编辑
|
||||
</el-button>
|
||||
<el-button v-perms="['recordsPayment.recordsPayment/delete']" type="danger" link @click="handleDelete(row.id)">
|
||||
删除
|
||||
</el-button>
|
||||
<el-button v-perms="['recordsPayment.recordsPayment/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 { apireturnedrecordLists, apireturnedrecordDelete, apireturnedrecordDetail } from '@/api/recordsPayment'
|
||||
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_no: '',
|
||||
contract_name: '',
|
||||
|
||||
})
|
||||
|
||||
|
||||
|
||||
// 选中数据
|
||||
const selectData = ref<any[]>([])
|
||||
|
||||
// 表格选择后回调事件
|
||||
const handleSelectionChange = (val: any[]) => {
|
||||
selectData.value = val.map(({ id }) => id)
|
||||
}
|
||||
|
||||
// 获取字典数据
|
||||
const { dictData } = useDictData('isaccrued,pay_type,invoice_status,pay_period,collection_type')
|
||||
// 分页相关
|
||||
const { pager, getLists, resetParams, resetPage } = usePaging({
|
||||
fetchFun: apireturnedrecordLists,
|
||||
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 apireturnedrecordDetail({ 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 apireturnedrecordDelete({ id })
|
||||
getLists()
|
||||
}
|
||||
const handledetail = async (data: any) => {
|
||||
let res = await apireturnedrecordDetail({ id: data.id })
|
||||
showDtail.value = true
|
||||
await nextTick()
|
||||
detailRef.value?.open()
|
||||
detailRef.value?.setFormData(res)
|
||||
}
|
||||
|
||||
|
||||
getLists()
|
||||
</script>
|
||||
|
172
src/views/refund/detail.vue
Normal file
172
src/views/refund/detail.vue
Normal file
@ -0,0 +1,172 @@
|
||||
|
||||
<template>
|
||||
<div class="detail-popup">
|
||||
<popup ref="popupRef" title="项目合同详情" :async="true" width="80%" @confirm="handleSubmit" @close="handleClose">
|
||||
<el-form ref="formRef" :model="formData" label-width="160px">
|
||||
<el-card class="mb-2">
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="合同编号">
|
||||
{{ formData.contract.contract_name }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item label="项目名称">
|
||||
{{ formData.project.name
|
||||
}}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item label="项目编码">
|
||||
{{ formData.project.project_code
|
||||
}}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item label="客户名称">
|
||||
{{ formData.custom.name
|
||||
}}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="退款日期">
|
||||
{{ formData.reason
|
||||
}}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="退款金额">
|
||||
{{ formData.amount }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="金额大写">
|
||||
{{ formData.amount_daxie }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="退款方式">
|
||||
<dict-value :options="dictData.refund_type" :value="formData.refund_type" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="退款人">
|
||||
{{ formData.refunder }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="收款账号">
|
||||
{{ formData.collection_acccount }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="收款银行">
|
||||
{{ formData.collection_bank }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item label="备注">
|
||||
{{ formData.remark
|
||||
}}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
|
||||
|
||||
|
||||
</el-row>
|
||||
</el-card>
|
||||
</el-form>
|
||||
</popup>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup name="customdetail">
|
||||
|
||||
import type { FormInstance } from 'element-plus'
|
||||
import Popup from '@/components/popup/index.vue'
|
||||
import { apiCustomDetail } from '@/api/custom'
|
||||
import { timeFormat } from '@/utils/util'
|
||||
import type { PropType } from 'vue'
|
||||
defineProps({
|
||||
dictData: {
|
||||
type: Object as PropType<Record<string, any[]>>,
|
||||
default: () => ({})
|
||||
}
|
||||
})
|
||||
const emit = defineEmits(['success', 'close'])
|
||||
const formRef = shallowRef<FormInstance>()
|
||||
const popupRef = shallowRef<InstanceType<typeof Popup>>()
|
||||
|
||||
const datas = reactive({
|
||||
provinceOptions: [],
|
||||
cityOptions: [],
|
||||
areaOptions: [],
|
||||
});
|
||||
|
||||
|
||||
// 表单数据
|
||||
const formData = reactive({
|
||||
|
||||
})
|
||||
|
||||
|
||||
|
||||
// 获取详情
|
||||
const setFormData = async (data: Record<any, any>) => {
|
||||
Object.assign(formData, data)
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
const getDetail = async (row: Record<string, any>) => {
|
||||
const data = await apiCustomDetail({
|
||||
id: row.id
|
||||
})
|
||||
setFormData(data)
|
||||
}
|
||||
|
||||
|
||||
// 提交按钮
|
||||
const handleSubmit = async () => {
|
||||
popupRef.value?.close()
|
||||
|
||||
}
|
||||
|
||||
//打开弹窗
|
||||
const open = () => {
|
||||
console.log('1111111')
|
||||
popupRef.value?.open()
|
||||
}
|
||||
|
||||
// 关闭回调
|
||||
const handleClose = () => {
|
||||
emit('close')
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
defineExpose({
|
||||
open,
|
||||
setFormData,
|
||||
getDetail
|
||||
})
|
||||
</script>
|
||||
<style lang="scss">
|
||||
.tit {
|
||||
font-size: 1.2em;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
</style>
|
359
src/views/refund/edit.vue
Normal file
359
src/views/refund/edit.vue
Normal file
@ -0,0 +1,359 @@
|
||||
<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="商务部发起" />
|
||||
<el-step title="商务总监" />
|
||||
<el-step title="财务经理" />
|
||||
<el-step title="总经理" />
|
||||
</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="return_date">
|
||||
<el-date-picker class="flex-1 !flex" v-model="formData.return_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_id" @click="showDialog1 = true">
|
||||
<el-input v-model="project_name" clearable placeholder="请输入项目名称" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="项目编码" prop="contract_id">
|
||||
<el-input v-model="project_code" clearable placeholder="请输入项目编码" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<el-form-item label="合同编号" prop="contract_no">
|
||||
<el-input v-model="contract_no" clearable placeholder="请输入合同编号" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="合同名称" prop="contract_name">
|
||||
<el-input v-model="contract_name" clearable placeholder="请输入合同名称" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="退款原因" prop="reason">
|
||||
<el-input v-model="formData.reason" type='textarea' clearable placeholder="请输入退款原因" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="退款金额" prop="amount">
|
||||
<el-input v-model="formData.amount" clearable placeholder="请输入退款金额" @input="amountinput" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="金额大写" prop="amount_daxie">
|
||||
<el-input v-model="formData.amount_daxie" readonly 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.refund_type" clearable placeholder="请选择退款方式">
|
||||
<el-option v-for="(item, index) in dictData.refund_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="refunder">
|
||||
<el-input v-model="formData.refunder" readonly 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="field127">
|
||||
<el-upload accept=".pdf" class="upload-demo" :show-file-list="false" aria-hidden="true" :headers="{ Token: userStore.token }" :action="base_url + '/upload/file'" :on-success="handleAvatarSuccess_four" ref="upload">
|
||||
<el-button type="primary">
|
||||
上传
|
||||
</el-button>
|
||||
</el-upload>
|
||||
|
||||
<div>
|
||||
<div v-for="(item, index) in formDataannex" style="margin-left: 5px;display: block;">
|
||||
<a style="margin-left: 10px; color: #4a5dff; align-self: flex-start" :href="item.uri" target="_blank">{{ item.name }}</a>
|
||||
<span style="cursor: pointer;margin-left: 5px;" @click="delFileFn(index)">x</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<div style="margin: 20px 0;">客户收款信息</div>
|
||||
|
||||
<el-row :gutter="10">
|
||||
|
||||
<el-col :span="8">
|
||||
<el-form-item label="收款账号" prop="collection_acccount" @click="showDialog2 = true">
|
||||
<el-input v-model="formData.collection_acccount" clearable placeholder="请输入收款账号" />
|
||||
</el-form-item>
|
||||
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<el-form-item label="收款银行" prop="collection_bank">
|
||||
<el-input v-model="formData.collection_bank" 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"></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 salescontractDialog from '@/components/salescontract/index.vue'
|
||||
|
||||
import { apirefundapplyAdd, apirefundapplyEdit, apirefundapplyDetail } from '@/api/refund'
|
||||
import { toChinesNum } from "@/utils/util";
|
||||
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 userInfo = userStore.userInfo
|
||||
console.log(userInfo, '222222')
|
||||
// 上传文件
|
||||
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 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 amount_daxie = ref('')
|
||||
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
|
||||
showDialog1.value = false;
|
||||
};
|
||||
|
||||
|
||||
|
||||
//监听输入
|
||||
const amountinput = (e) => {
|
||||
// console.log(e)
|
||||
if (e && e > 0) {
|
||||
formData.amount_daxie = toChinesNum(e)
|
||||
}
|
||||
}
|
||||
// 弹窗标题
|
||||
const popupTitle = computed(() => {
|
||||
return mode.value == 'edit' ? '编辑退款申请表' : '新增退款申请表'
|
||||
})
|
||||
|
||||
// 表单数据
|
||||
const formData = reactive({
|
||||
id: '',
|
||||
customer_id: "",
|
||||
contract_id: "",
|
||||
approve_id: 0,
|
||||
refund_date: "",
|
||||
reason: "",
|
||||
amount: 0,
|
||||
amount_daxie: "",
|
||||
refund_type: "",
|
||||
refunder: userInfo.name,
|
||||
return_total_amount: "",
|
||||
return_desc: "",
|
||||
collection_bank: "",
|
||||
collection_acccount: ""
|
||||
})
|
||||
|
||||
|
||||
// 表单验证
|
||||
const formRules = reactive<any>({
|
||||
|
||||
})
|
||||
|
||||
|
||||
// 获取详情
|
||||
const setFormData = async (data: Record<any, any>) => {
|
||||
if (data.return_desc && data.return_desc.length > 0) {
|
||||
if (data.return_desc.includes(",")) {
|
||||
const arry1 = data.return_desc.split(',').map((item: any, index: any) => {
|
||||
return {
|
||||
name: `文件${index + 1}`,
|
||||
uri: item
|
||||
};
|
||||
});
|
||||
Object.assign(formDataannex, arry1)
|
||||
} else {
|
||||
const arry1 = [{ name: `文件1`, uri: data.return_desc }]
|
||||
Object.assign(formDataannex, arry1)
|
||||
console.log(formDataannex)
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
for (const key in formData) {
|
||||
if (data[key] != null && data[key] != undefined) {
|
||||
//@ts-ignore
|
||||
formData[key] = data[key]
|
||||
}
|
||||
}
|
||||
custom_name.value = data.custom.name
|
||||
project_name.value = data.project.name
|
||||
project_code.value = data.project.project_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 apirefundapplyDetail({
|
||||
id: row.id
|
||||
})
|
||||
setFormData(data)
|
||||
}
|
||||
|
||||
|
||||
// 提交按钮
|
||||
const handleSubmit = async () => {
|
||||
if (formDataannex.length > 0) {
|
||||
formData.return_desc = formDataannex.map((item: any) => item.uri).toString()
|
||||
}
|
||||
console.log(formRef.value?.validate(), '22222222')
|
||||
await formRef.value?.validate()
|
||||
|
||||
|
||||
const data = { ...formData }
|
||||
mode.value == 'edit'
|
||||
? await apirefundapplyEdit(data)
|
||||
: await apirefundapplyAdd(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>
|
148
src/views/refund/index.vue
Normal file
148
src/views/refund/index.vue
Normal file
@ -0,0 +1,148 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-card class="!border-none mb-4" shadow="never">
|
||||
<el-form class="mb-[-16px]" :model="queryParams" inline>
|
||||
<el-form-item label="合同编号" prop="project_name">
|
||||
<el-input class="w-[280px]" v-model="queryParams.contract_no" clearable placeholder="请输入合同编号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="合同名称" prop="project_role_name">
|
||||
<el-input class="w-[280px]" v-model="queryParams.contract_name" clearable placeholder="请输入合同名称" />
|
||||
</el-form-item>
|
||||
|
||||
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="resetPage">查询</el-button>
|
||||
<el-button @click="resetParams">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
<el-card class="!border-none" v-loading="pager.loading" shadow="never">
|
||||
<el-button v-perms="['refund.refund/add']" type="primary" @click="handleAdd">
|
||||
<template #icon>
|
||||
<icon name="el-icon-Plus" />
|
||||
</template>
|
||||
新增
|
||||
</el-button>
|
||||
<el-button v-perms="['refund.refund/delete']" :disabled="!selectData.length" @click="handleDelete(selectData)">
|
||||
删除
|
||||
</el-button>
|
||||
|
||||
<div class="mt-4">
|
||||
<el-table :data="pager.lists" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column label="退款单号" prop="project_name" show-overflow-tooltip />
|
||||
<el-table-column label="客户名称" prop="project_code" show-overflow-tooltip />
|
||||
<el-table-column label="项目名称" prop="project_role_name" show-overflow-tooltip />
|
||||
<el-table-column label="合同编号" prop="admin_name" show-overflow-tooltip />
|
||||
<el-table-column label="退款原因" prop="reason" show-overflow-tooltip />
|
||||
<el-table-column label="退款日期" prop="refund_date" show-overflow-tooltip />
|
||||
<el-table-column label="退款金额" prop="amount" show-overflow-tooltip />
|
||||
<el-table-column label="退款方式" prop="refund_type" show-overflow-tooltip>
|
||||
<template #default="{ row }">
|
||||
<dict-value :options="dictData.refund_type" :value="row.refund_type" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="退款人" prop="refunder" show-overflow-tooltip />
|
||||
<el-table-column label="备注" prop="remark" show-overflow-tooltip />
|
||||
<el-table-column label="操作" width="150" fixed="right">
|
||||
<template #default="{ row }">
|
||||
<el-button v-perms="['refund.refund/edit']" type="primary" link @click="handleEdit(row)">
|
||||
编辑
|
||||
</el-button>
|
||||
<el-button v-perms="['refund.refund/delete']" type="danger" link @click="handleDelete(row.id)">
|
||||
删除
|
||||
</el-button>
|
||||
<el-button v-perms="['refund.refund/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 { apirefundapplyLists, apirefundapplyDelete, apirefundapplyDetail } from '@/api/refund'
|
||||
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_no: '',
|
||||
contract_name: '',
|
||||
|
||||
})
|
||||
|
||||
|
||||
|
||||
// 选中数据
|
||||
const selectData = ref<any[]>([])
|
||||
|
||||
// 表格选择后回调事件
|
||||
const handleSelectionChange = (val: any[]) => {
|
||||
selectData.value = val.map(({ id }) => id)
|
||||
}
|
||||
|
||||
// 获取字典数据
|
||||
const { dictData } = useDictData('refund_type')
|
||||
// 分页相关
|
||||
const { pager, getLists, resetParams, resetPage } = usePaging({
|
||||
fetchFun: apirefundapplyLists,
|
||||
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 apirefundapplyDetail({ 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 apirefundapplyDelete({ id })
|
||||
getLists()
|
||||
}
|
||||
const handledetail = async (data: any) => {
|
||||
let res = await apirefundapplyDetail({ id: data.id })
|
||||
showDtail.value = true
|
||||
await nextTick()
|
||||
detailRef.value?.open()
|
||||
detailRef.value?.setFormData(res)
|
||||
}
|
||||
|
||||
|
||||
getLists()
|
||||
</script>
|
||||
|
172
src/views/refundrecord/detail.vue
Normal file
172
src/views/refundrecord/detail.vue
Normal file
@ -0,0 +1,172 @@
|
||||
|
||||
<template>
|
||||
<div class="detail-popup">
|
||||
<popup ref="popupRef" title="项目合同详情" :async="true" width="80%" @confirm="handleSubmit" @close="handleClose">
|
||||
<el-form ref="formRef" :model="formData" label-width="160px">
|
||||
<el-card class="mb-2">
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="合同编号">
|
||||
{{ formData.contract.contract_name }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item label="项目名称">
|
||||
{{ formData.project.name
|
||||
}}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item label="项目编码">
|
||||
{{ formData.project.project_code
|
||||
}}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item label="客户名称">
|
||||
{{ formData.custom.name
|
||||
}}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="退款日期">
|
||||
{{ formData.reason
|
||||
}}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="退款金额">
|
||||
{{ formData.amount }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="金额大写">
|
||||
{{ formData.amount_daxie }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="退款方式">
|
||||
<dict-value :options="dictData.refund_type" :value="formData.refund_type" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="退款人">
|
||||
{{ formData.refunder }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="收款账号">
|
||||
{{ formData.collection_acccount }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="收款银行">
|
||||
{{ formData.collection_bank }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item label="备注">
|
||||
{{ formData.remark
|
||||
}}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
|
||||
|
||||
|
||||
</el-row>
|
||||
</el-card>
|
||||
</el-form>
|
||||
</popup>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup name="customdetail">
|
||||
|
||||
import type { FormInstance } from 'element-plus'
|
||||
import Popup from '@/components/popup/index.vue'
|
||||
import { apiCustomDetail } from '@/api/custom'
|
||||
import { timeFormat } from '@/utils/util'
|
||||
import type { PropType } from 'vue'
|
||||
defineProps({
|
||||
dictData: {
|
||||
type: Object as PropType<Record<string, any[]>>,
|
||||
default: () => ({})
|
||||
}
|
||||
})
|
||||
const emit = defineEmits(['success', 'close'])
|
||||
const formRef = shallowRef<FormInstance>()
|
||||
const popupRef = shallowRef<InstanceType<typeof Popup>>()
|
||||
|
||||
const datas = reactive({
|
||||
provinceOptions: [],
|
||||
cityOptions: [],
|
||||
areaOptions: [],
|
||||
});
|
||||
|
||||
|
||||
// 表单数据
|
||||
const formData = reactive({
|
||||
|
||||
})
|
||||
|
||||
|
||||
|
||||
// 获取详情
|
||||
const setFormData = async (data: Record<any, any>) => {
|
||||
Object.assign(formData, data)
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
const getDetail = async (row: Record<string, any>) => {
|
||||
const data = await apiCustomDetail({
|
||||
id: row.id
|
||||
})
|
||||
setFormData(data)
|
||||
}
|
||||
|
||||
|
||||
// 提交按钮
|
||||
const handleSubmit = async () => {
|
||||
popupRef.value?.close()
|
||||
|
||||
}
|
||||
|
||||
//打开弹窗
|
||||
const open = () => {
|
||||
console.log('1111111')
|
||||
popupRef.value?.open()
|
||||
}
|
||||
|
||||
// 关闭回调
|
||||
const handleClose = () => {
|
||||
emit('close')
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
defineExpose({
|
||||
open,
|
||||
setFormData,
|
||||
getDetail
|
||||
})
|
||||
</script>
|
||||
<style lang="scss">
|
||||
.tit {
|
||||
font-size: 1.2em;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
</style>
|
359
src/views/refundrecord/edit.vue
Normal file
359
src/views/refundrecord/edit.vue
Normal file
@ -0,0 +1,359 @@
|
||||
<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="商务部发起" />
|
||||
<el-step title="商务总监" />
|
||||
<el-step title="财务经理" />
|
||||
<el-step title="总经理" />
|
||||
</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="return_date">
|
||||
<el-date-picker class="flex-1 !flex" v-model="formData.return_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_id" @click="showDialog1 = true">
|
||||
<el-input v-model="project_name" clearable placeholder="请输入项目名称" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="项目编码" prop="contract_id">
|
||||
<el-input v-model="project_code" clearable placeholder="请输入项目编码" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<el-form-item label="合同编号" prop="contract_no">
|
||||
<el-input v-model="contract_no" clearable placeholder="请输入合同编号" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="合同名称" prop="contract_name">
|
||||
<el-input v-model="contract_name" clearable placeholder="请输入合同名称" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="退款原因" prop="reason">
|
||||
<el-input v-model="formData.reason" type='textarea' clearable placeholder="请输入退款原因" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="退款金额" prop="amount">
|
||||
<el-input v-model="formData.amount" clearable placeholder="请输入退款金额" @input="amountinput" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="金额大写" prop="amount_daxie">
|
||||
<el-input v-model="formData.amount_daxie" readonly 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.refund_type" clearable placeholder="请选择退款方式">
|
||||
<el-option v-for="(item, index) in dictData.refund_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="refunder">
|
||||
<el-input v-model="formData.refunder" readonly 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="field127">
|
||||
<el-upload accept=".pdf" class="upload-demo" :show-file-list="false" aria-hidden="true" :headers="{ Token: userStore.token }" :action="base_url + '/upload/file'" :on-success="handleAvatarSuccess_four" ref="upload">
|
||||
<el-button type="primary">
|
||||
上传
|
||||
</el-button>
|
||||
</el-upload>
|
||||
|
||||
<div>
|
||||
<div v-for="(item, index) in formDataannex" style="margin-left: 5px;display: block;">
|
||||
<a style="margin-left: 10px; color: #4a5dff; align-self: flex-start" :href="item.uri" target="_blank">{{ item.name }}</a>
|
||||
<span style="cursor: pointer;margin-left: 5px;" @click="delFileFn(index)">x</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<div style="margin: 20px 0;">客户收款信息</div>
|
||||
|
||||
<el-row :gutter="10">
|
||||
|
||||
<el-col :span="8">
|
||||
<el-form-item label="收款账号" prop="collection_acccount" @click="showDialog2 = true">
|
||||
<el-input v-model="formData.collection_acccount" clearable placeholder="请输入收款账号" />
|
||||
</el-form-item>
|
||||
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<el-form-item label="收款银行" prop="collection_bank">
|
||||
<el-input v-model="formData.collection_bank" 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"></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 salescontractDialog from '@/components/salescontract/index.vue'
|
||||
|
||||
import { apirefundapplyAdd, apirefundapplyEdit, apirefundapplyDetail } from '@/api/refund'
|
||||
import { toChinesNum } from "@/utils/util";
|
||||
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 userInfo = userStore.userInfo
|
||||
console.log(userInfo, '222222')
|
||||
// 上传文件
|
||||
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 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 amount_daxie = ref('')
|
||||
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
|
||||
showDialog1.value = false;
|
||||
};
|
||||
|
||||
|
||||
|
||||
//监听输入
|
||||
const amountinput = (e) => {
|
||||
// console.log(e)
|
||||
if (e && e > 0) {
|
||||
formData.amount_daxie = toChinesNum(e)
|
||||
}
|
||||
}
|
||||
// 弹窗标题
|
||||
const popupTitle = computed(() => {
|
||||
return mode.value == 'edit' ? '编辑退款申请表' : '新增退款申请表'
|
||||
})
|
||||
|
||||
// 表单数据
|
||||
const formData = reactive({
|
||||
id: '',
|
||||
customer_id: "",
|
||||
contract_id: "",
|
||||
approve_id: 0,
|
||||
refund_date: "",
|
||||
reason: "",
|
||||
amount: 0,
|
||||
amount_daxie: "",
|
||||
refund_type: "",
|
||||
refunder: userInfo.name,
|
||||
return_total_amount: "",
|
||||
return_desc: "",
|
||||
collection_bank: "",
|
||||
collection_acccount: ""
|
||||
})
|
||||
|
||||
|
||||
// 表单验证
|
||||
const formRules = reactive<any>({
|
||||
|
||||
})
|
||||
|
||||
|
||||
// 获取详情
|
||||
const setFormData = async (data: Record<any, any>) => {
|
||||
if (data.return_desc && data.return_desc.length > 0) {
|
||||
if (data.return_desc.includes(",")) {
|
||||
const arry1 = data.return_desc.split(',').map((item: any, index: any) => {
|
||||
return {
|
||||
name: `文件${index + 1}`,
|
||||
uri: item
|
||||
};
|
||||
});
|
||||
Object.assign(formDataannex, arry1)
|
||||
} else {
|
||||
const arry1 = [{ name: `文件1`, uri: data.return_desc }]
|
||||
Object.assign(formDataannex, arry1)
|
||||
console.log(formDataannex)
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
for (const key in formData) {
|
||||
if (data[key] != null && data[key] != undefined) {
|
||||
//@ts-ignore
|
||||
formData[key] = data[key]
|
||||
}
|
||||
}
|
||||
custom_name.value = data.custom.name
|
||||
project_name.value = data.project.name
|
||||
project_code.value = data.project.project_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 apirefundapplyDetail({
|
||||
id: row.id
|
||||
})
|
||||
setFormData(data)
|
||||
}
|
||||
|
||||
|
||||
// 提交按钮
|
||||
const handleSubmit = async () => {
|
||||
if (formDataannex.length > 0) {
|
||||
formData.return_desc = formDataannex.map((item: any) => item.uri).toString()
|
||||
}
|
||||
console.log(formRef.value?.validate(), '22222222')
|
||||
await formRef.value?.validate()
|
||||
|
||||
|
||||
const data = { ...formData }
|
||||
mode.value == 'edit'
|
||||
? await apirefundapplyEdit(data)
|
||||
: await apirefundapplyAdd(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>
|
148
src/views/refundrecord/index.vue
Normal file
148
src/views/refundrecord/index.vue
Normal file
@ -0,0 +1,148 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-card class="!border-none mb-4" shadow="never">
|
||||
<el-form class="mb-[-16px]" :model="queryParams" inline>
|
||||
<el-form-item label="合同编号" prop="project_name">
|
||||
<el-input class="w-[280px]" v-model="queryParams.contract_no" clearable placeholder="请输入合同编号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="合同名称" prop="project_role_name">
|
||||
<el-input class="w-[280px]" v-model="queryParams.contract_name" clearable placeholder="请输入合同名称" />
|
||||
</el-form-item>
|
||||
|
||||
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="resetPage">查询</el-button>
|
||||
<el-button @click="resetParams">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
<el-card class="!border-none" v-loading="pager.loading" shadow="never">
|
||||
<el-button v-perms="['refund.refund/add']" type="primary" @click="handleAdd">
|
||||
<template #icon>
|
||||
<icon name="el-icon-Plus" />
|
||||
</template>
|
||||
新增
|
||||
</el-button>
|
||||
<el-button v-perms="['refund.refund/delete']" :disabled="!selectData.length" @click="handleDelete(selectData)">
|
||||
删除
|
||||
</el-button>
|
||||
|
||||
<div class="mt-4">
|
||||
<el-table :data="pager.lists" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column label="退款单号" prop="project_name" show-overflow-tooltip />
|
||||
<el-table-column label="客户名称" prop="project_code" show-overflow-tooltip />
|
||||
<el-table-column label="项目名称" prop="project_role_name" show-overflow-tooltip />
|
||||
<el-table-column label="合同编号" prop="admin_name" show-overflow-tooltip />
|
||||
<el-table-column label="退款原因" prop="reason" show-overflow-tooltip />
|
||||
<el-table-column label="退款日期" prop="refund_date" show-overflow-tooltip />
|
||||
<el-table-column label="退款金额" prop="amount" show-overflow-tooltip />
|
||||
<el-table-column label="退款方式" prop="refund_type" show-overflow-tooltip>
|
||||
<template #default="{ row }">
|
||||
<dict-value :options="dictData.refund_type" :value="row.refund_type" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="退款人" prop="refunder" show-overflow-tooltip />
|
||||
<el-table-column label="备注" prop="remark" show-overflow-tooltip />
|
||||
<el-table-column label="操作" width="150" fixed="right">
|
||||
<template #default="{ row }">
|
||||
<el-button v-perms="['refund.refund/edit']" type="primary" link @click="handleEdit(row)">
|
||||
编辑
|
||||
</el-button>
|
||||
<el-button v-perms="['refund.refund/delete']" type="danger" link @click="handleDelete(row.id)">
|
||||
删除
|
||||
</el-button>
|
||||
<el-button v-perms="['refund.refund/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 { apirefundapplyLists, apirefundapplyDelete, apirefundapplyDetail } from '@/api/refund'
|
||||
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_no: '',
|
||||
contract_name: '',
|
||||
|
||||
})
|
||||
|
||||
|
||||
|
||||
// 选中数据
|
||||
const selectData = ref<any[]>([])
|
||||
|
||||
// 表格选择后回调事件
|
||||
const handleSelectionChange = (val: any[]) => {
|
||||
selectData.value = val.map(({ id }) => id)
|
||||
}
|
||||
|
||||
// 获取字典数据
|
||||
const { dictData } = useDictData('refund_type')
|
||||
// 分页相关
|
||||
const { pager, getLists, resetParams, resetPage } = usePaging({
|
||||
fetchFun: apirefundapplyLists,
|
||||
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 apirefundapplyDetail({ 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 apirefundapplyDelete({ id })
|
||||
getLists()
|
||||
}
|
||||
const handledetail = async (data: any) => {
|
||||
let res = await apirefundapplyDetail({ id: data.id })
|
||||
showDtail.value = true
|
||||
await nextTick()
|
||||
detailRef.value?.open()
|
||||
detailRef.value?.setFormData(res)
|
||||
}
|
||||
|
||||
|
||||
getLists()
|
||||
</script>
|
||||
|
181
src/views/remittance/detail.vue
Normal file
181
src/views/remittance/detail.vue
Normal file
@ -0,0 +1,181 @@
|
||||
|
||||
<template>
|
||||
<div class="detail-popup">
|
||||
<popup ref="popupRef" title="项目合同详情" :async="true" width="80%" @confirm="handleSubmit" @close="handleClose">
|
||||
<el-form ref="formRef" :model="formData" label-width="160px">
|
||||
<el-card class="mb-2">
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="合同编号">
|
||||
{{ formData.contract_name }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="合同类型">
|
||||
<dict-value :options="dictData.contract_type" :value="formData.contract.contract_type" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item label="项目名称">
|
||||
{{ formData.project.name
|
||||
}}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item label="项目编码">
|
||||
{{ formData.project.project_code
|
||||
}}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="期次">
|
||||
<dict-value :options="dictData.pay_period" :value="formData.period" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="计划回款日期">
|
||||
{{ formData.return_date
|
||||
}}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item label="状态">
|
||||
<dict-value :options="dictData.return_status" :value="formData.return_status" />
|
||||
</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.remark
|
||||
}}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="回款责任人">
|
||||
{{ formData.return_date
|
||||
}}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<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>) => {
|
||||
Object.assign(formData, data)
|
||||
if (data.annex && data.annex.length > 0) {
|
||||
if (data.annex.includes(",")) {
|
||||
const arry1 = data.annex.split(',').map((item: any, index: any) => {
|
||||
return {
|
||||
name: `文件${index + 1}`,
|
||||
uri: item
|
||||
};
|
||||
});
|
||||
Object.assign(formDataannex, arry1)
|
||||
} else {
|
||||
const arry1 = [{ name: `文件1`, uri: data.annex }]
|
||||
Object.assign(formDataannex, arry1)
|
||||
console.log(formDataannex)
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
const getDetail = async (row: Record<string, any>) => {
|
||||
const data = await apiCustomDetail({
|
||||
id: row.id
|
||||
})
|
||||
setFormData(data)
|
||||
}
|
||||
|
||||
|
||||
// 提交按钮
|
||||
const handleSubmit = async () => {
|
||||
popupRef.value?.close()
|
||||
|
||||
}
|
||||
|
||||
//打开弹窗
|
||||
const open = () => {
|
||||
popupRef.value?.open()
|
||||
}
|
||||
|
||||
// 关闭回调
|
||||
const handleClose = () => {
|
||||
emit('close')
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
defineExpose({
|
||||
open,
|
||||
setFormData,
|
||||
getDetail
|
||||
})
|
||||
</script>
|
||||
<style lang="scss">
|
||||
.tit {
|
||||
font-size: 1.2em;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
</style>
|
290
src/views/remittance/edit.vue
Normal file
290
src/views/remittance/edit.vue
Normal file
@ -0,0 +1,290 @@
|
||||
<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 :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="contract_no" @click="showDialog1 = true">
|
||||
<el-input v-model="contract_no" clearable placeholder="请输入合同编号" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="合同名称" prop="contract_name" rules="[{ required: true, message: '不可为空', trigger: 'blur' }]">
|
||||
<el-input v-model="contract_name" clearable 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="amount" rules="[{ required: true, message: '不可为空', trigger: 'blur' }]">
|
||||
<el-input v-model="formData.amount" type="number" clearable placeholder="请输入金额" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="计划回款日期" prop="return_date" rules="[{ required: true, message: '不可为空', trigger: 'change' }]">
|
||||
|
||||
<el-date-picker class="flex-1 !flex" v-model="formData.return_date" clearable type="datetime" value-format="YYYY-MM-DD HH:mm:ss" placeholder="选择计划回款日期">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item label="回款状态" prop="return_status">
|
||||
<el-radio-group v-model="formData.return_status" placeholder="请选择回款状态">
|
||||
<el-radio v-for="(item, index) in dictData.return_status" :key="index" :label="parseInt(item.value)">
|
||||
{{ item.name }}
|
||||
</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="回款责任人" prop="return_duty_id" @click="userclick">
|
||||
<el-input v-model="return_name" readonly clearable placeholder="请输入回款责任人" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<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=".pdf" class="upload-demo" :show-file-list="false" aria-hidden="true" :headers="{ Token: userStore.token }" :action="base_url + '/upload/file'" :on-success="handleAvatarSuccess_four" ref="upload">
|
||||
<el-button type="primary">
|
||||
上传
|
||||
</el-button>
|
||||
</el-upload>
|
||||
|
||||
<div>
|
||||
<div v-for="(item, index) in formDataannex" style="margin-left: 5px;display: block;">
|
||||
<a style="margin-left: 10px; color: #4a5dff; align-self: flex-start" :href="item.uri" target="_blank">{{ item.name }}</a>
|
||||
<span style="cursor: pointer;margin-left: 5px;" @click="delFileFn(index)">x</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
|
||||
</el-row>
|
||||
<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"></salescontractDialog>
|
||||
</el-dialog>
|
||||
<personnelselector ref="personnel" @confirm="submituser" type="1"></personnelselector>
|
||||
</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 salescontractDialog from '@/components/salescontract/index.vue'
|
||||
import personnelselector from '@/components/personnelselector/index.vue'
|
||||
import { apireturnedAdd, apireturnedEdit, apireturnedDetail } from '@/api/remittance'
|
||||
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 personnel = ref<any>()
|
||||
const project_amount = ref('')
|
||||
const contract_no = ref('')
|
||||
const custom_name = ref('')
|
||||
const return_name = ref('')
|
||||
|
||||
// 上传文件
|
||||
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)
|
||||
}
|
||||
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;
|
||||
contract_name.value = e.contract_name;
|
||||
contract_no.value = e.contract_code
|
||||
showDialog1.value = false;
|
||||
};
|
||||
|
||||
|
||||
// 弹窗标题
|
||||
const popupTitle = computed(() => {
|
||||
return mode.value == 'edit' ? '编辑项目表' : '新增项目表'
|
||||
})
|
||||
|
||||
// 表单数据
|
||||
const formData = reactive({
|
||||
id: '',
|
||||
customer_id: 0,
|
||||
contract_id: 0,
|
||||
return_date: "",
|
||||
period: "",
|
||||
amount: 0,
|
||||
return_status: 0,
|
||||
return_duty_id: '',
|
||||
remark: "",
|
||||
annex: ""
|
||||
})
|
||||
|
||||
|
||||
// 表单验证
|
||||
const formRules = reactive<any>({
|
||||
|
||||
})
|
||||
|
||||
|
||||
// 获取详情
|
||||
const setFormData = async (data: Record<any, any>) => {
|
||||
if (data.annex && data.annex.length > 0) {
|
||||
if (data.annex.includes(",")) {
|
||||
const arry1 = data.annex.split(',').map((item: any, index: any) => {
|
||||
return {
|
||||
name: `文件${index + 1}`,
|
||||
uri: item
|
||||
};
|
||||
});
|
||||
Object.assign(formDataannex, arry1)
|
||||
} else {
|
||||
const arry1 = [{ name: `文件1`, uri: data.annex }]
|
||||
Object.assign(formDataannex, arry1)
|
||||
console.log(formDataannex)
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
for (const key in formData) {
|
||||
if (data[key] != null && data[key] != undefined) {
|
||||
//@ts-ignore
|
||||
formData[key] = data[key]
|
||||
}
|
||||
}
|
||||
custom_name.value = data.custom.name
|
||||
contract_name.value = data.contract.contract_name;
|
||||
contract_no.value = data.contract.contract_code
|
||||
|
||||
}
|
||||
const getDetail = async (row: Record<string, any>) => {
|
||||
const data = await apireturnedDetail({
|
||||
id: row.id
|
||||
})
|
||||
setFormData(data)
|
||||
}
|
||||
|
||||
|
||||
// 提交按钮
|
||||
const handleSubmit = async () => {
|
||||
if (formDataannex.length > 0) {
|
||||
formData.annex = formDataannex.map((item: any) => item.uri).toString()
|
||||
}
|
||||
console.log(formRef.value?.validate(), '22222222')
|
||||
await formRef.value?.validate()
|
||||
|
||||
|
||||
const data = { ...formData }
|
||||
mode.value == 'edit'
|
||||
? await apireturnedEdit(data)
|
||||
: await apireturnedAdd(data)
|
||||
popupRef.value?.close()
|
||||
emit('success')
|
||||
}
|
||||
|
||||
|
||||
|
||||
//打开弹窗
|
||||
|
||||
const userclick = () => {
|
||||
// console.log(personnel.value, '1111111')
|
||||
personnel.value.open()
|
||||
|
||||
}
|
||||
//确认
|
||||
const submituser = (e: any) => {
|
||||
formData.return_duty_id = e.id;
|
||||
return_name.value = e.name;
|
||||
}
|
||||
|
||||
|
||||
//打开弹窗
|
||||
const open = (type = 'add') => {
|
||||
mode.value = type
|
||||
popupRef.value?.open()
|
||||
}
|
||||
|
||||
// 关闭回调
|
||||
const handleClose = () => {
|
||||
emit('close')
|
||||
}
|
||||
|
||||
|
||||
|
||||
defineExpose({
|
||||
open,
|
||||
setFormData,
|
||||
getDetail
|
||||
})
|
||||
</script>
|
161
src/views/remittance/index.vue
Normal file
161
src/views/remittance/index.vue
Normal file
@ -0,0 +1,161 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-card class="!border-none mb-4" shadow="never">
|
||||
<el-form class="mb-[-16px]" :model="queryParams" inline>
|
||||
<el-form-item label="合同编号" prop="project_name">
|
||||
<el-input class="w-[280px]" v-model="queryParams.contract_no" clearable placeholder="请输入合同编号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="合同名称" prop="project_role_name">
|
||||
<el-input class="w-[280px]" v-model="queryParams.contract_name" clearable placeholder="请输入合同名称" />
|
||||
</el-form-item>
|
||||
|
||||
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="resetPage">查询</el-button>
|
||||
<el-button @click="resetParams">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
<el-card class="!border-none" v-loading="pager.loading" shadow="never">
|
||||
<el-button v-perms="['remittance.remittance/add']" type="primary" @click="handleAdd">
|
||||
<template #icon>
|
||||
<icon name="el-icon-Plus" />
|
||||
</template>
|
||||
新增
|
||||
</el-button>
|
||||
<el-button v-perms="['remittance.remittance/delete']" :disabled="!selectData.length" @click="handleDelete(selectData)">
|
||||
删除
|
||||
</el-button>
|
||||
|
||||
<div class="mt-4">
|
||||
<el-table :data="pager.lists" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column label="合同编号" prop="project_name" show-overflow-tooltip />
|
||||
<el-table-column label="合同类型" prop="contract_type">
|
||||
<template #default="{ row }">
|
||||
<dict-value :options="dictData.contract_type" :value="row.contract_type" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="客户名称" prop="project_name" 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="industry">
|
||||
<template #default="{ row }">
|
||||
<dict-value :options="dictData.pay_period" :value="row.period" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="计划回款日期" prop="return_date" show-overflow-tooltip />
|
||||
<el-table-column label="状态" prop="return_status">
|
||||
<template #default="{ row }">
|
||||
<dict-value :options="dictData.return_status" :value="row.return_status" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="金额" prop="amount" show-overflow-tooltip />
|
||||
<el-table-column label="已回款" prop="remark" show-overflow-tooltip />
|
||||
<el-table-column label="未回款" prop="remark" show-overflow-tooltip />
|
||||
<el-table-column label="回款责任人" prop="remark" show-overflow-tooltip />
|
||||
<el-table-column label="备注" prop="remark" show-overflow-tooltip />
|
||||
<el-table-column label="操作" width="150" fixed="right">
|
||||
<template #default="{ row }">
|
||||
<el-button v-perms="['remittance.remittance/edit']" type="primary" link @click="handleEdit(row)">
|
||||
编辑
|
||||
</el-button>
|
||||
<el-button v-perms="['remittance.remittance/delete']" type="danger" link @click="handleDelete(row.id)">
|
||||
删除
|
||||
</el-button>
|
||||
<el-button v-perms="['remittance.remittance/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 { apireturnedLists, apireturnedDelete, apireturnedDetail } from '@/api/remittance'
|
||||
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_no: '',
|
||||
contract_name: '',
|
||||
|
||||
|
||||
})
|
||||
|
||||
|
||||
|
||||
// 选中数据
|
||||
const selectData = ref<any[]>([])
|
||||
|
||||
// 表格选择后回调事件
|
||||
const handleSelectionChange = (val: any[]) => {
|
||||
selectData.value = val.map(({ id }) => id)
|
||||
}
|
||||
|
||||
// 获取字典数据
|
||||
const { dictData } = useDictData('return_status,pay_period,contract_type')
|
||||
// 分页相关
|
||||
const { pager, getLists, resetParams, resetPage } = usePaging({
|
||||
fetchFun: apireturnedLists,
|
||||
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 apireturnedDetail({ 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 apireturnedDelete({ id })
|
||||
getLists()
|
||||
}
|
||||
const handledetail = async (data: any) => {
|
||||
let res = await apireturnedDetail({ id: data.id })
|
||||
showDtail.value = true
|
||||
await nextTick()
|
||||
detailRef.value?.open()
|
||||
detailRef.value?.setFormData(res)
|
||||
}
|
||||
|
||||
|
||||
getLists()
|
||||
</script>
|
||||
|
Loading…
x
Reference in New Issue
Block a user