master
xy 2 years ago
parent 6c3026aa49
commit 76b5cb86e3

@ -119,6 +119,9 @@ export default {
},
toggleAllSelection(){
this.$refs.table.toggleAllSelection()
},
setCurrentRow (row) {
this.$refs.table.setCurrentRow(row)
}
},
created() {

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

@ -131,7 +131,7 @@
</el-card>
<div class="demo-split">
<div v-for="(sitem, index) in this.typeList">
<div v-for="(sitem, index) in typeList">
<Split v-model="split" style="height: 580px">
<template #left>
<div class="demo-split-pane" style="padding-right: 5px">
@ -325,6 +325,15 @@ export default {
return `¥ ${value}`.replace(/\B(?=(\d{3})+(?!\d))/g, ",");
},
},
{
label: "已付金额",
width: 160,
prop: "fund_log_total",
align: "right",
formatter: (cell, data, value) => {
return `¥ ${value}`.replace(/\B(?=(\d{3})+(?!\d))/g, ",");
},
},
{
prop: "supply",
label: "承包商/供货商",
@ -343,15 +352,6 @@ export default {
);
},
},
{
label: "已付金额",
width: 160,
prop: "fund_log_total",
align: "right",
formatter: (cell, data, value) => {
return `¥ ${value}`.replace(/\B(?=(\d{3})+(?!\d))/g, ",");
},
},
],
departmentTotal: [],
departmentTotalTable: [
@ -1045,10 +1045,9 @@ export default {
async getNopay() {
const res = await nopayTotal({
is_auth: 1,
year: this.select.year
//year: this.select.year
});
this.nopay = res;
console.log(222, this.nopay);
this.nopay = res.filter(i => i.momey != 0);
},
async getDepartmnetTotal() {
const res = await departmentTotal({

File diff suppressed because it is too large Load Diff

@ -56,7 +56,7 @@
</div>
</div>
</template>
<template v-slot:public_plane_date>
<template v-slot:public_plane_date v-if="role == 0">
<div class="xy-table-item">
<div class="xy-table-item-label">采购意向公开计划时间 </div>
<div class="xy-table-item-content">
@ -69,7 +69,7 @@
</div>
</div>
</template>
<template v-slot:public_act_date>
<template v-slot:public_act_date v-if="role == 1">
<div class="xy-table-item">
<div class="xy-table-item-label">采购意向公开实际时间 </div>
<div class="xy-table-item-content">
@ -82,7 +82,7 @@
</div>
</div>
</template>
<template v-slot:invite_plane_date>
<template v-slot:invite_plane_date v-if="role == 0">
<div class="xy-table-item">
<div class="xy-table-item-label">招标文件挂网计划时间 </div>
<div class="xy-table-item-content">
@ -95,7 +95,7 @@
</div>
</div>
</template>
<template v-slot:invite_act_date>
<template v-slot:invite_act_date v-if="role == 1">
<div class="xy-table-item">
<div class="xy-table-item-label">招标文件挂网实际时间 </div>
<div class="xy-table-item-content">
@ -108,7 +108,7 @@
</div>
</div>
</template>
<template v-slot:open_plane_date>
<template v-slot:open_plane_date v-if="role == 0">
<div class="xy-table-item">
<div class="xy-table-item-label">项目开标计划时间 </div>
<div class="xy-table-item-content">
@ -121,7 +121,7 @@
</div>
</div>
</template>
<template v-slot:open_act_date>
<template v-slot:open_act_date v-if="role == 1">
<div class="xy-table-item">
<div class="xy-table-item-label">项目开标实际时间 </div>
<div class="xy-table-item-content">
@ -134,16 +134,174 @@
</div>
</div>
</template>
<template #plan_id>
<div class="xy-table-item">
<div class="xy-table-item-label">
关联预算计划
</div>
<div class="xy-table-item-content">
<div
class="contract-add-plan"
style="width: 300px"
@click="isShowPlan = true"
>
<template>
<el-input
readonly
:value="form.plan ? form.plan.name : form.plan_id"
clearable
placeholder="请选择关联计划"
style="width: 300px"
@focus="isShowPlan = true"
></el-input>
</template>
</div>
</div>
</div>
</template>
</xy-dialog>
<!-- 新增表 预算计划 -->
<xy-dialog
:is-show.sync="isShowPlan"
:width="720"
title="预算计划"
@on-ok="isShowPlan = false"
>
<template v-slot:normalContent>
<div style="display: flex">
<el-select
placeholder="科室选择"
clearable
size="small"
v-model="planSearch.plan_department_id"
style="width: 160px"
>
<el-option
v-for="item in departments"
:label="item.name"
:value="item.id"
:key="item.id"
>
</el-option>
</el-select>
<Input
v-model="planSearch.name"
enter-button="搜 索"
placeholder="搜索预算计划.."
search
@on-search="searchBudgets"
/>
</div>
<xy-table
highlight-current-row
ref="planTable"
:height="300"
:list="plans"
:show-index="false"
:table-item="planTable"
style="margin-top: 10px"
@cellClick="row => { form.plan_id = row.id;form.plan = row; }"
>
<template #btns>
</template>
</xy-table>
<div style="display: flex; justify-content: flex-end">
<Page :total="planTotal" show-elevator @on-change="e => { planSearch.page = e;getBudgets(); }" />
</div>
</template>
<template v-slot:footerContent>
<Button type="primary" @click="isShowPlan = false">确定</Button>
</template>
</xy-dialog>
</div>
</template>
<script>
import { show, save, store } from "@/api/govPlane";
import {getBudget} from "@/api/budget/budget";
import {listdeptNoAuth} from "@/api/system/department";
import {getparameter} from "@/api/system/dictionary";
export default {
props: {},
props: {
role: Number
},
data() {
return {
isShowPlan: false,
departments: [],
moneyWay: [],
planTotal: 0,
plans: [],
planSearch: {
name: "",
plan_department_id: "",
page: 1,
page_size: 10,
top_pid: 1
},
planTable: [
{
label: "分类",
prop: "type",
formatter: (cell, data, value) => {
let res = this.moneyWay.filter((item) => {
return item.id === value;
});
return res[0]?.value || "未知";
},
width: 100,
fixed: "left",
},
{
label: "科室",
prop: "plan_department.name",
width: 100,
align: "center",
},
{
label: "年份",
prop: "year",
width: 80,
align: "center",
},
{
label: "隶属",
prop: "pid_info.name",
width: 180,
align: "left",
},
{
label: "名称",
prop: "name",
width: 320,
align: "left",
},
{
label: "计划金额",
prop: "money",
align: "right",
width: 120,
customFn: (row) => {
let m1 = row.money;
let m2 = row.update_money;
return m2 == 0 ? m1 : m2;
},
},
{
label: "已用金额",
prop: "use_money_total",
width: 120,
align: "right",
},
],
isShow: false,
id: "",
type: "",
@ -158,6 +316,8 @@ export default {
invite_act_date: "",
open_plane_date: "",
open_act_date: "",
plan_id: "",
plan: {}
},
rules: {
name: [
@ -260,6 +420,43 @@ export default {
});
}
},
//
async getDepartment() {
this.departments = await listdeptNoAuth();
},
//
async getMoneyWay() {
this.moneyWay = (
await getparameter({
number: "money_way",
})
).detail;
},
//
planSelect(row) {
console.log(row)
// if (this.plan.length === 0) {
// this.$message({
// type: "warning",
// message: "",
// });
// return;
// }
//
// this.isShowPlan = false;
},
searchBudgets() {
this.getBudgets();
},
//
async getBudgets() {
let res = await getBudget(this.planSearch);
this.plans = res.list.data;
this.planTotal = res.list.total;
},
},
watch: {
isShow(val) {
@ -275,7 +472,17 @@ export default {
delete this.form.id;
}
},
isShowPlan(val) {
if (val) {
this.$refs['planTable'].setCurrentRow(this.plans.find(row => row.id === this.form.plan_id))
}
}
},
created() {
this.getMoneyWay();
this.getDepartment();
this.getBudgets();
}
};
</script>

@ -34,6 +34,7 @@
</lx-header>
<xy-table
:cell-style="cellStyle"
:list="list"
:table-item="table"
@ -62,7 +63,7 @@
/>
</div>
<addGovPlane ref="addGovPlane" @refresh="getList"></addGovPlane>
<addGovPlane ref="addGovPlane" :role="type" @refresh="getList"></addGovPlane>
</div>
</template>
@ -75,7 +76,7 @@ export default {
},
data() {
return {
type: 0,
type: 0,//01
select: {
page: 1,
page_size: 10,
@ -93,6 +94,7 @@ export default {
prop: "name",
label: "项目名称",
width: 180,
align: 'left'
},
{
prop: "content",
@ -114,7 +116,7 @@ export default {
label: "采购意向公开计划时间",
width: 190,
formatter: (cell, data, value) => {
return this.$moment(new Date(value)).format("YYYY年MM月DD");
return value ? this.$moment(new Date(value)).format("YYYY年MM月DD") : '未完成';
},
},
{
@ -122,7 +124,7 @@ export default {
label: "采购意向公开实际时间",
width: 190,
formatter: (cell, data, value) => {
return this.$moment(new Date(value)).format("YYYY年MM月DD");
return value ? this.$moment(new Date(value)).format("YYYY年MM月DD") : '未完成';
},
},
{
@ -130,7 +132,7 @@ export default {
label: "招标文件挂网计划时间",
width: 190,
formatter: (cell, data, value) => {
return this.$moment(new Date(value)).format("YYYY年MM月DD");
return value ? this.$moment(new Date(value)).format("YYYY年MM月DD") : '未完成';
},
},
{
@ -138,7 +140,7 @@ export default {
label: "招标文件挂网实际时间",
width: 190,
formatter: (cell, data, value) => {
return this.$moment(new Date(value)).format("YYYY年MM月DD");
return value ? this.$moment(new Date(value)).format("YYYY年MM月DD") : '未完成';
},
},
{
@ -146,7 +148,7 @@ export default {
label: "项目开标计划时间",
width: 180,
formatter: (cell, data, value) => {
return this.$moment(new Date(value)).format("YYYY年MM月DD");
return value ? this.$moment(new Date(value)).format("YYYY年MM月DD") : '未完成';
},
},
{
@ -154,13 +156,37 @@ export default {
label: "项目开标实际时间",
width: 180,
formatter: (cell, data, value) => {
return this.$moment(new Date(value)).format("YYYY年MM月DD");
return value ? this.$moment(new Date(value)).format("YYYY年MM月DD") : '未完成';
},
},
{
prop: 'plan.name',
label: '关联计划',
width: 220,
align: 'left'
},
{
prop: 'department.name',
label: '部门',
width: 150
}
],
};
},
methods: {
cellStyle ({ column }) {
if (/计划时间/g.test(column.label)) {
return {
background: 'rgba(200,0,0,.1)'
}
}
if (/实际时间/g.test(column.label)) {
return {
background: 'rgba(0,200,0,.1)'
}
}
},
async getList() {
const res = await index(this.select);
this.total = res.total;

Loading…
Cancel
Save