master
xy 3 years ago
parent cd07bf67c3
commit 8b8ca090ff

@ -136,7 +136,9 @@ export default {
toggleRowExpansion(row,expanded){ toggleRowExpansion(row,expanded){
this.$refs['table'].toggleRowExpansion(row,expanded) this.$refs['table'].toggleRowExpansion(row,expanded)
}, },
getSelection(){
return this.$refs.table?.store?.states?.selection ?? []
},
}, },
created() { created() {
this.initLoad() this.initLoad()

@ -252,7 +252,6 @@
</xy-table> </xy-table>
</div> </div>
</template> </template>
</xy-dialog> </xy-dialog>
<detailContractSign <detailContractSign
@ -578,15 +577,15 @@ export default {
}, },
statusFormat() { statusFormat() {
return function (status) { return function (status) {
if(status === 'end') { if (status === "end") {
return "已办结" return "已办结";
} }
if (Number(status)) { if (Number(status)) {
return "进行中" return "进行中";
}
return "待办理"
}
} }
return "待办理";
};
},
}, },
watch: { watch: {
isShowDetail(val) { isShowDetail(val) {
@ -601,11 +600,9 @@ export default {
this.outCaigouDetail = res; this.outCaigouDetail = res;
} }
); );
getOutDetail({ tbname: "pay", out_pay_id: this.id }).then( getOutDetail({ tbname: "pay", out_pay_id: this.id }).then((res) => {
(res) => {
this.outPayDetail = res; this.outPayDetail = res;
} });
);
} }
}, },
}, },
@ -617,7 +614,7 @@ export default {
}, },
created() { created() {
this.getPlanTypes(); this.getPlanTypes();
} },
}; };
</script> </script>

@ -1,49 +1,80 @@
<template> <template>
<div> <div>
<!-- 付款登记--> <!-- 付款登记-->
<xy-dialog title="付款登记" :is-show.sync="isShowPaymentRegistration" type="form" class="payment-registration" <xy-dialog
:form="paymentRegistrationForm" :rules="paymentRegistrationRules" @submit="submit" ref="paymentRegistration"> title="付款登记"
:is-show.sync="isShowPaymentRegistration"
type="form"
class="payment-registration"
:form="paymentRegistrationForm"
:rules="paymentRegistrationRules"
@submit="submit"
ref="paymentRegistration"
>
<template v-slot:extraFormTop> <template v-slot:extraFormTop>
<div class="payment-registration-row"> <div class="payment-registration-row">
<div class="payment-registration-row-title">受款单位</div> <div class="payment-registration-row-title">受款单位</div>
<div class="payment-registration-row-content">{{contract.supply}}</div> <div class="payment-registration-row-content">
{{ contract.supply }}
</div>
</div> </div>
<div class="payment-registration-row"> <div class="payment-registration-row">
<div class="payment-registration-row-title">合同名称</div> <div class="payment-registration-row-title">合同名称</div>
<div class="payment-registration-row-content">{{contract.name}}</div> <div class="payment-registration-row-content">
{{ contract.name }}
</div>
</div> </div>
<div class="payment-registration-row"> <div class="payment-registration-row">
<div class="payment-registration-row-title">合同金额</div> <div class="payment-registration-row-title">合同金额</div>
<div class="payment-registration-row-content">{{priceFormat(contract.money)}} </div> <div class="payment-registration-row-content">
{{ priceFormat(contract.money) }}
</div>
</div> </div>
<div style="display: flex"> <div style="display: flex">
<div class="payment-registration-row"> <div class="payment-registration-row">
<div class="payment-registration-row-title">已申请金额</div> <div class="payment-registration-row-title">已申请金额</div>
<div class="payment-registration-row-content">{{totalApplyMoney()}} </div> <div class="payment-registration-row-content">
{{ totalApplyMoney() }}
</div>
</div> </div>
<div class="payment-registration-row"> <div class="payment-registration-row">
<div class="payment-registration-row-title">已申请笔数</div> <div class="payment-registration-row-title">已申请笔数</div>
<div class="payment-registration-row-content">{{payment.length}}</div> <div class="payment-registration-row-content">
{{ payment.length }}
</div>
</div> </div>
</div> </div>
<div style="display: flex"> <div style="display: flex">
<div class="payment-registration-row"> <div class="payment-registration-row">
<div class="payment-registration-row-title">已付金额</div> <div class="payment-registration-row-title">已付金额</div>
<div class="payment-registration-row-content">{{totalMoney()}} </div> <div class="payment-registration-row-content">
{{ totalMoney() }}
</div>
</div> </div>
<div class="payment-registration-row"> <div class="payment-registration-row">
<div class="payment-registration-row-title">支付占比</div> <div class="payment-registration-row-title">支付占比</div>
<div class="payment-registration-row-content">{{percentPay()}}%</div> <div class="payment-registration-row-content">
{{ percentPay() }}%
</div>
</div> </div>
<div class="payment-registration-row"> <div class="payment-registration-row">
<div class="payment-registration-row-title">已付笔数</div> <div class="payment-registration-row-title">已付笔数</div>
<div class="payment-registration-row-content">{{actNumsTotal()}}</div> <div class="payment-registration-row-content">
<div class="payment-registration-row-content" style="color: #ff0000;padding-left: 16px;cursor: pointer;"> {{ actNumsTotal() }}
</div>
<div
class="payment-registration-row-content"
style="color: #ff0000; padding-left: 16px; cursor: pointer"
>
<Poptip :transfer="true"> <Poptip :transfer="true">
<div>点击查看列表</div> <div>点击查看列表</div>
<template v-slot:content> <template v-slot:content>
<template v-if="payment && payment.length > 0"> <template v-if="payment && payment.length > 0">
<xy-table :height="200" :list="payment" :table-item="payTable"> <xy-table
:height="200"
:list="payment"
:table-item="payTable"
>
<template v-slot:btns> <template v-slot:btns>
<p></p> <p></p>
</template> </template>
@ -61,55 +92,88 @@
<template v-slot:applyMoney> <template v-slot:applyMoney>
<div class="xy-table-item"> <div class="xy-table-item">
<div class="xy-table-item-label"> <div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;">*</span>申请付款金额 <span style="color: red; font-weight: 600; padding-right: 4px"
>*</span
>申请付款金额
</div> </div>
<div class="xy-table-item-content xy-table-item-price"> <div class="xy-table-item-content xy-table-item-price">
<el-input clearable placeholder="请填写付款金额" v-model="paymentRegistrationForm.applyMoney" <el-input
style="width: 150px;" /> clearable
placeholder="请填写付款金额"
v-model="paymentRegistrationForm.applyMoney"
style="width: 150px"
/>
</div> </div>
</div> </div>
</template> </template>
<template v-slot:audit_money> <template v-slot:audit_money>
<div class="xy-table-item"> <div class="xy-table-item">
<div class="xy-table-item-label">审计金额 <div class="xy-table-item-label">审计金额</div>
</div>
<div class="xy-table-item-content xy-table-item-price"> <div class="xy-table-item-content xy-table-item-price">
<el-input clearable placeholder="请填写审计金额" v-model="form.audit_money" style="width: 150px;" /> <el-input
clearable
placeholder="请填写审计金额"
v-model="form.audit_money"
style="width: 150px"
/>
</div> </div>
</div> </div>
</template> </template>
<template v-slot:deductionMoney> <template v-slot:deductionMoney>
<div class="xy-table-item"> <div class="xy-table-item">
<div class="xy-table-item-label"> <div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;">*</span>本期扣款金额 <span style="color: red; font-weight: 600; padding-right: 4px"
>*</span
>本期扣款金额
</div> </div>
<div class="xy-table-item-content xy-table-item-price"> <div class="xy-table-item-content xy-table-item-price">
<el-input clearable placeholder="请填写扣款金额" v-model="paymentRegistrationForm.deductionMoney" <el-input
style="width: 150px;" /> clearable
placeholder="请填写扣款金额"
v-model="paymentRegistrationForm.deductionMoney"
style="width: 150px"
/>
</div> </div>
</div> </div>
</template> </template>
<template v-slot:remark> <template v-slot:remark>
<div class="xy-table-item"> <div class="xy-table-item">
<div class="xy-table-item-label">备注 <div class="xy-table-item-label">备注</div>
</div>
<div class="xy-table-item-content"> <div class="xy-table-item-content">
<el-input type="textarea" clearable placeholder="进度款日期2022.6.8-2022.7.7" <el-input
v-model="paymentRegistrationForm.remark" style="width: 300px;" /> type="textarea"
clearable
placeholder="进度款日期2022.6.8-2022.7.7"
v-model="paymentRegistrationForm.remark"
style="width: 300px"
/>
</div> </div>
</div> </div>
</template> </template>
<template v-slot:type> <template v-slot:type>
<div class="xy-table-item"> <div class="xy-table-item">
<div class="xy-table-item-label"> <div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;">*</span>款项类型 <span style="color: red; font-weight: 600; padding-right: 4px"
>*</span
>款项类型
</div> </div>
<div class="xy-table-item-content"> <div class="xy-table-item-content">
<el-select placeholder="选择款项类型或直接录入其他类型" v-model="paymentRegistrationForm.type" style="width: 150px;" <el-select
filterable allow-create clearable> placeholder="选择款项类型或直接录入其他类型"
<el-option v-for="item in paymentType" :key="item" :label="item" :value="item"> v-model="paymentRegistrationForm.type"
style="width: 150px"
filterable
allow-create
clearable
>
<el-option
v-for="item in paymentType"
:key="item"
:label="item"
:value="item"
>
</el-option> </el-option>
</el-select> </el-select>
</div> </div>
@ -118,7 +182,9 @@
<template v-slot:isLast> <template v-slot:isLast>
<div class="xy-table-item"> <div class="xy-table-item">
<div class="xy-table-item-label" style="width: 200px"> <div class="xy-table-item-label" style="width: 200px">
<span style="color: red;font-weight: 600;padding-right: 4px;">*</span>是否为最后一笔 <span style="color: red; font-weight: 600; padding-right: 4px"
>*</span
>是否为最后一笔
</div> </div>
<div class="xy-table-item-content"> <div class="xy-table-item-content">
<el-switch v-model="paymentRegistrationForm.isLast" /> <el-switch v-model="paymentRegistrationForm.isLast" />
@ -127,19 +193,35 @@
</div> </div>
</template> </template>
<template v-slot:extraFormBottom v-if="false"> <template v-slot:extraFormBottom v-if="false">
<Input search enter-button=" " placeholder="搜索预算计划.." v-model="searchContent" @on-search="getBudgets" /> <Input
<xy-table :list="plans" :show-index="false" :table-item="planTable" :height="310" style="margin-top: 10px;" search
ref="planTable" @select="selectPlan"> enter-button="搜 索"
placeholder="搜索预算计划.."
v-model="searchContent"
@on-search="getBudgets"
/>
<xy-table
:list="plans"
:show-index="false"
:table-item="planTable"
:height="310"
style="margin-top: 10px"
ref="planTable"
@select="selectPlan"
>
<template v-slot:btns> <template v-slot:btns>
<el-table-column label="使用金额" header-align="center"> <el-table-column label="使用金额" header-align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<Input :value="scope.row.useMoney" @input="(e)=>scope.row.useMoney = e" /> <Input
:value="scope.row.useMoney"
@input="(e) => (scope.row.useMoney = e)"
/>
</template> </template>
</el-table-column> </el-table-column>
</template> </template>
</xy-table> </xy-table>
<div style="display: flex;justify-content: flex-end;"> <div style="display: flex; justify-content: flex-end">
<Page :total="planTotal" show-elevator @on-change="pageChange" /> <Page :total="planTotal" show-elevator @on-change="pageChange" />
</div> </div>
</template> </template>
@ -148,26 +230,12 @@
</template> </template>
<script> <script>
import { import { getparameter } from "@/api/system/dictionary";
getparameter import { getFundLog, addFundLog } from "@/api/paymentRegistration/fundLog";
} from "@/api/system/dictionary" import { getBudget } from "@/api/budget/budget";
import { import { detailContract, editorContract } from "@/api/contract/contract";
getFundLog, import { Message } from "element-ui";
addFundLog import { parseTime } from "@/utils";
} from "@/api/paymentRegistration/fundLog"
import {
getBudget
} from "@/api/budget/budget";
import {
detailContract,
editorContract
} from "@/api/contract/contract";
import {
Message
} from "element-ui";
import {
parseTime
} from "@/utils";
export default { export default {
data() { data() {
@ -180,29 +248,30 @@
planTypes: [], planTypes: [],
contract: {}, contract: {},
payment: [], // payment: [], //
payTable: [{ payTable: [
label: '申请金额', {
prop: 'apply_money', label: "申请金额",
prop: "apply_money",
sortable: false, sortable: false,
width: 160, width: 160,
align: 'right' align: "right",
}, },
{ {
label: '已付金额', label: "已付金额",
prop: 'act_money', prop: "act_money",
sortable: false, sortable: false,
width: 160, width: 160,
align: 'right' align: "right",
}, },
{ {
label: '时间', label: "时间",
prop: 'created_at', prop: "created_at",
sortable: false, sortable: false,
width: 120, width: 120,
formatter: (t1, t2, value) => { formatter: (t1, t2, value) => {
return parseTime(new Date(value), '{y}-{m}-{d}') return parseTime(new Date(value), "{y}-{m}-{d}");
} },
} },
], ],
paymentType: ["进度款", "结算款", "质保金"], paymentType: ["进度款", "结算款", "质保金"],
isShowPaymentRegistration: false, isShowPaymentRegistration: false,
@ -213,130 +282,135 @@
type: "", type: "",
isLast: false, isLast: false,
plan: [], plan: [],
remark: "" remark: "",
}, },
form: { form: {
audit_money: 0 audit_money: 0,
}, },
paymentRegistrationRules: { paymentRegistrationRules: {
applyMoney: [{ applyMoney: [
{
required: true, required: true,
message: "必填" message: "必填",
}, },
{ {
pattern: /^\d+(\.\d+)?$/, pattern: /^\d+(\.\d+)?$/,
message: '必须为数字' message: "必须为数字",
} },
], ],
deductionMoney: [{ deductionMoney: [
{
required: true, required: true,
message: "必填" message: "必填",
}, },
{ {
pattern: /^\d+(\.\d+)?$/, pattern: /^\d+(\.\d+)?$/,
message: '必须为数字' message: "必须为数字",
} },
], ],
type: [{ type: [
{
required: true, required: true,
message: "必选" message: "必选",
}] },
],
}, },
planTable: [{ planTable: [
{
sortable: false, sortable: false,
width: 36, width: 36,
type: 'selection' type: "selection",
}, },
{ {
label: "分类", label: "分类",
prop: 'type', prop: "type",
formatter: (cell, data, value) => { formatter: (cell, data, value) => {
let res = this.planTypes.filter(item => { let res = this.planTypes.filter((item) => {
return item.id === value return item.id === value;
}) });
return res[0]?.value || '未知' return res[0]?.value || "未知";
} },
}, },
{ {
label: "名称", label: "名称",
prop: 'name', prop: "name",
align: 'left' align: "left",
}, },
{ {
label: "计划金额", label: "计划金额",
prop: 'money', prop: "money",
align: 'right' align: "right",
} },
], ],
} };
}, },
methods: { methods: {
async getPlanTypes() { async getPlanTypes() {
const res = await getparameter({ const res = await getparameter({
number: 'money_way' number: "money_way",
}) });
this.planTypes = res.detail this.planTypes = res.detail;
}, },
// //
pageChange(e) { pageChange(e) {
this.pageIndex = e this.pageIndex = e;
this.getBudgets() this.getBudgets();
}, },
// //
totalApplyMoney() { totalApplyMoney() {
let total = 0.00 let total = 0.0;
this.payment.map(item => { this.payment.map((item) => {
total += Number(item.apply_money) total += Number(item.apply_money);
}) });
return total.toFixed(2) return total.toFixed(2);
}, },
// //
totalMoney() { totalMoney() {
let total = 0.00 let total = 0.0;
this.payment.map(item => { this.payment.map((item) => {
total += Number(item.act_money) total += Number(item.act_money);
}) });
return total.toFixed(2) return total.toFixed(2);
}, },
// //
actNumsTotal() { actNumsTotal() {
let total = 0 let total = 0;
this.payment.map(item => { this.payment.map((item) => {
if (Number(item.act_money)) { if (Number(item.act_money)) {
total++ total++;
} }
}) });
return total return total;
}, },
// //
percentPay() { percentPay() {
let total = this.totalMoney() let total = this.totalMoney();
return ((total / this.contract.money) * 100).toFixed(2) || 0 return ((total / this.contract.money) * 100).toFixed(2) || 0;
}, },
// //
async getContract(info) { async getContract(info) {
this.contract = await detailContract({ this.contract = await detailContract({
id: info.id id: info.id,
}); });
this.paymentRegistrationForm.plan = this.contract.plans.map(item => { this.paymentRegistrationForm.plan = this.contract.plans.map((item) => {
return { return {
plan_id: item.id, plan_id: item.id,
use_money: item.useMoney, use_money: item.useMoney,
new_money: item.money, new_money: item.money,
} };
}); });
this.form.audit_money = this.contract.audit_money; this.form.audit_money = this.contract.audit_money;
const res = await getFundLog({ const res = await getFundLog({
contract_id: this.contract.id contract_id: this.contract.id,
}) });
this.payment = res.data this.payment = res.data;
}, },
submit() { submit() {
@ -347,22 +421,22 @@
type: this.paymentRegistrationForm.type, type: this.paymentRegistrationForm.type,
is_end: this.paymentRegistrationForm.isLast ? 1 : 0, is_end: this.paymentRegistrationForm.isLast ? 1 : 0,
remark: this.paymentRegistrationForm.remark, remark: this.paymentRegistrationForm.remark,
audit_money: this.paymentRegistrationForm.audit_money audit_money: this.paymentRegistrationForm.audit_money,
} };
addFundLog(data).then(res => { addFundLog(data).then((res) => {
this.isShowPaymentRegistration = false this.isShowPaymentRegistration = false;
// //
editorContract({ editorContract({
id: this.contract.id, id: this.contract.id,
audit_money: this.form.audit_money audit_money: this.form.audit_money,
}).then(r => { }).then((r) => {
Message({ Message({
type: 'success', type: "success",
message: "操作成功" message: "操作成功",
}) });
});
this.$refs["paymentRegistration"].reset();
}); });
this.$refs['paymentRegistration'].reset()
})
}, },
// //
@ -371,86 +445,89 @@
let res = await getBudget({ let res = await getBudget({
name: this.searchContent, name: this.searchContent,
page_size: 10, page_size: 10,
page: this.pageIndex page: this.pageIndex,
}) });
this.plans = res.list.data this.plans = res.list.data;
this.planTotal = res.list.total this.planTotal = res.list.total;
// this.toggleSelection(this.paymentRegistrationForm.plan.map(item => { // this.toggleSelection(this.paymentRegistrationForm.plan.map(item => {
// return item.plan_id // return item.plan_id
// })) // }))
}, },
planPageChange(e) { planPageChange(e) {
this.plansPageIndex = e this.plansPageIndex = e;
this.getBudgets() this.getBudgets();
}, },
selectPlan(sel, row) { selectPlan(sel, row) {
if (sel) { if (sel) {
this.paymentRegistrationForm.plan = sel.map(item => { this.paymentRegistrationForm.plan = sel.map((item) => {
return { return {
plan_id: item.id, plan_id: item.id,
use_money: item.useMoney, use_money: item.useMoney,
new_money: item.money new_money: item.money,
} };
}) });
} else { } else {
this.paymentRegistrationForm.plan = [] this.paymentRegistrationForm.plan = [];
} }
}, },
toggleSelection(e) { toggleSelection(e) {
if (!e) { if (!e) {
return return;
} }
let plans = this.paymentRegistrationForm.plan.map(item => { let plans = this.paymentRegistrationForm.plan.map((item) => {
return item.plan_id return item.plan_id;
}) });
if (plans) { if (plans) {
this.plans.filter(plan => { this.plans
return plans.includes(plan.id) .filter((plan) => {
}).map(row => { return plans.includes(plan.id);
this.$nextTick(() => {
this.$refs['planTable'].toggleRowSelection(row);
})
}) })
.map((row) => {
this.$nextTick(() => {
this.$refs["planTable"].toggleRowSelection(row);
});
});
} else { } else {
this.$refs['planTable'].clearSelection(); this.$refs["planTable"].clearSelection();
} }
}, },
}, },
computed: { computed: {
priceFormat() { priceFormat() {
return function (price) { return function (price) {
return Number(price).toFixed(2).replace(/(\d)(?=(\d{3})+\.)/g, '$1,') return Number(price)
} .toFixed(2)
} .replace(/(\d)(?=(\d{3})+\.)/g, "$1,");
};
},
}, },
watch: { watch: {
isShowPaymentRegistration(newVal) { isShowPaymentRegistration(newVal) {
if (newVal) { if (newVal) {
this.getBudgets() this.getBudgets();
}
} }
}, },
},
mounted() { mounted() {
this.getPlanTypes() this.getPlanTypes();
} },
} };
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.payment-registration { .payment-registration {
&-row { &-row {
display: flex; display: flex;
padding: 6px 0; padding: 6px 0;
&-title { &-title {
padding: 0 10px; padding: 0 10px;
} }
&-content {} &-content {
}
} }
} }
@ -466,7 +543,7 @@
position: absolute; position: absolute;
right: 0; right: 0;
top: 0; top: 0;
content: '(元)' content: "(元)";
} }
::v-deep .el-input__clear { ::v-deep .el-input__clear {

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save