master
271556543@qq.com 4 years ago
parent 53f3c86126
commit 99b8382867

@ -24,6 +24,7 @@
"path-to-regexp": "2.4.0",
"view-design": "^4.7.0",
"vue": "2.6.10",
"vue-print-nb": "^1.7.5",
"vue-router": "3.0.6",
"vuex": "3.1.0",
"wangeditor": "^4.7.12"

@ -7,3 +7,4 @@ export function addContractSign(data){
data
})
}

@ -7,3 +7,11 @@ export function getNotice(params){
params
})
}
export function readNotice(params){
return request({
method:'get',
url:'/api/admin/notice/has-read',
params
})
}

@ -15,3 +15,27 @@ export function addFundLog(data){
data
})
}
export function delFundLog(params){
return request({
method:'get',
url:'/api/admin/fund_log/destroy',
params
})
}
export function detailFundLog(params){
return request({
method:'get',
url:'/api/admin/fund_log/show',
params
})
}
export function editorFundLog(data){
return request({
method:"post",
url:"/api/admin/fund_log/save",
data
})
}

@ -130,7 +130,7 @@ export default {
},
footer(){
{
return ($scopedSlots.footerContent ? $scopedSlots.footerContent() : footerRender())
if(type === 'form') return ($scopedSlots.footerContent ? $scopedSlots.footerContent() : footerRender())
}
}
}}>
@ -151,8 +151,8 @@ export default {
}
}
.ivu-modal-body{
height: 70vh !important;
min-height: 400px;
max-height: 65vh !important;
min-height: 300px;
overflow-y: scroll;
}

@ -42,6 +42,10 @@ import xyDialog from "@/components/XyDialog"
Vue.component('xy-dialog',xyDialog)
Vue.config.productionTip = false
import Print from "vue-print-nb"
Vue.use(Print)
new Vue({
el: '#app',
router,

@ -50,7 +50,7 @@
<template v-slot:name>
<Row>
<Col span="5"><span style="color: red;font-weight: 600;padding-right: 4px;">*</span>项目名称</Col>
<Col style="width: 100%;">
<Col >
<Input placeholder="请填写项目名称" v-model="form.name" style="width: 300px;"/>
</Col>
</Row>

@ -1,22 +1,91 @@
<template>
<div>
<xy-dialog :is-show.sync="isShow" title="合同签订" type="form">
<template v-slot:extraFormTop>
<xy-dialog :is-show.sync="isShow" title="合同签订" type="noraml">
<template v-slot:normalContent>
<div class="base-info">
<div class="base-info-title">合同信息</div>
<div class="base-info-item">
<div class="base-info-item-title">合同名称</div>
<div class="base-info-item-content">{{contract.name}}</div>
</div>
<div class="base-info-item">
<div class="base-info-item-title">合同金额</div>
<div class="base-info-item-content">{{contract.money}}</div>
<div class="base-info-item-unit">()</div>
</div>
<div class="base-info-item">
<div class="base-info-item-title">承包商\供应商</div>
<div class="base-info-item-content">{{contract.supply || '无'}}</div>
</div>
<div class="base-info-item">
<div class="base-info-item-title">执行部门</div>
<div class="base-info-item-content">{{contract.carry_department || '无'}}</div>
</div>
</div>
<div class="base-info add-plan" style="margin-top: 20px;">
<div class="base-info-title">付款计划</div>
<Button type="primary" style="margin-left: 50px;" @click="isShowAddPlan = true">新增计划</Button>
</div>
<xy-table></xy-table>
</template>
</xy-dialog>
<!-- 新增计划-->
<xy-dialog :is-show.sync="isShowAddPlan" type="form" title="新增计划" :form="planForm" :rules="planRules" :width="40" @submit="submit">
<template v-slot:date>
<div class="form-item">
<div class="form-item-title">
<span style="color: red;">*</span>
<span>日期</span>
</div>
<div class="form-item-value">
<DatePicker style="width: 100%" v-model="planForm.date" type="date" placeholder="请选择日期"></DatePicker>
</div>
</div>
</template>
<template v-slot:content>
<div class="form-item">
<div class="form-item-title">
<span style="color: red;">*</span>
<span>内容</span>
</div>
<div class="form-item-value">
<Input style="width: 100%" type="textarea" v-model="planForm.content" placeholder="请输入内容"/>
</div>
</div>
</template>
<template v-slot:money>
<div class="form-item">
<div class="form-item-title">
<span style="color: red;">*</span>
<span>金额</span>
</div>
<div class="form-item-value">
<Input style="width: 100%" v-model="planForm.money" placeholder="请输入金额"/>
</div>
</div>
</template>
<template v-slot:remark>
<div class="form-item">
<div class="form-item-title">
<span>备注</span>
</div>
<div class="form-item-value">
<Input style="width: 100%" type="textarea" v-model="planForm.remark" placeholder="请输入备注"/>
</div>
</div>
</template>
</xy-dialog>
</div>
</template>
<script>
import {addContractSign} from "@/api/contractSign/contractSign";
import {detailContract} from "@/api/contract/contract";
import {Message} from "element-ui";
export default {
data() {
@ -24,12 +93,49 @@ export default {
isShow:false,
contractId:null,
contract:{},
isShowAddPlan:false,
planForm:{
date:'',
money:'',
content:'',
remark:''
},
planRules:{
date:[
{required:true,message:"必填"}
],
content:[
{required:true,message:"必填"}
],
money:[
{required:true,message:"必填"}
]
}
}
},
methods: {
async getContract(){
const res = await detailContract({id:this.contractId})
this.contract = res
console.log(this.contract)
},
submit(){
console.log(this.planForm)
addContractSign({
contract_id:this.contract.id,
date:'2022-7-22',
content:this.planForm.content,
money:this.planForm.money,
remark:this.planForm.remark
}).then(res=>{
this.isShowAddPlan = false
console.log(res)
Message({
type:'success',
message:'操作成功'
})
})
}
},
watch:{
@ -65,4 +171,23 @@ export default {
}
}
}
.add-plan{
display: flex;
align-items: center;
}
.form-item{
display: flex;
align-items: center;
justify-content: space-between;
padding: 6px 0;
&-title{
padding-right: 20px;
}
&-value{
flex-basis: 80%;
}
}
</style>

@ -0,0 +1,344 @@
<template>
<div>
<!-- 付款登记审核-->
<xy-dialog title="付款登记" :is-show.sync="isShow" type="form" class="payment-registration" :form="paymentRegistrationForm" :rules="paymentRegistrationRules" ref="paymentRegistration" @submit="editor">
<template v-slot:extraFormTop>
<div class="payment-registration-row">
<div class="payment-registration-row-title">受款单位</div>
<div class="payment-registration-row-content">受款单位</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">{{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">{{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">{{payment.length}}</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>
<Row>
<Col span="5"><span style="font-weight: 600;padding-right: 4px;color: red;">*</span>申请付款金额</Col>
<Col>
<Input readonly placeholder="请填写付款金额" v-model="paymentRegistrationForm.applyMoney" style="width: 300px;"></Input>
</Col>
</Row>
</template>
<template v-slot:deductionMoney>
<Row>
<Col span="5"><span style="font-weight: 600;padding-right: 4px;color: red;">*</span>本期扣款金额</Col>
<Col>
<Input readonly placeholder="请填写扣款金额" v-model="paymentRegistrationForm.deductionMoney" style="width: 300px;"></Input>
</Col>
</Row>
</template>
<template v-slot:type>
<Row>
<Col span="5"><span style="font-weight: 600;padding-right: 4px;color: red;">*</span>款项类型
</Col>
<Col>
<Select placeholder="请选择款项类型" v-model="paymentRegistrationForm.type" style="width: 300px;">
<Option v-for="item in paymentType" :key="item.id" :value="item.id">{{item.value}}</Option>
</Select>
</Col>
</Row>
</template>
<template v-slot:isLast>
<Row>
<Col span="5"><span style="font-weight: 600;padding-right: 4px;color: red;">*</span>是否最后一笔</Col>
<Col>
<i-switch :value="paymentRegistrationForm.isLast" @on-change="(e)=>paymentRegistrationForm.isLast = e"/>
</Col>
</Row>
</template>
<template v-slot:actMoney>
<Row>
<Col span="5"><span style="font-weight: 600;padding-right: 4px;color: red;">*</span>实际付款金额</Col>
<Col>
<Input placeholder="请填写实际付款金额" v-model="paymentRegistrationForm.actMoney" style="width: 300px;"></Input>
</Col>
</Row>
</template>
<template v-slot:extraFormBottom>
<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 ? scope.row.useMoney: scope.row.money" @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,detailFundLog,editorFundLog} from "@/api/paymentRegistration/fundLog"
import {getBudget} from "@/api/budget/budget";
import {detailContract} from "@/api/contract/contract";
import {Message} from "element-ui";
import {parseTime} from "@/utils";
export default {
data() {
return {
searchContent:"",
planTotal:0,
pageIndex:1,
//
plans:[],
contract:{},
payment:[],//
payTable:[
{
label:'支付金额',
prop:'act_money',
sortable:false,
align:'right'
},
{
label:'时间',
prop:'created_at',
sortable:false,
width:120,
formatter:(t1,t2,value)=>{
return parseTime(new Date(value),'{y}-{m}-{d}')
}
}
],
paymentType:[],
isShow:false,
registrationId:"",
paymentRegistrationForm:{
applyMoney:"",
deductionMoney:"",
type:"",
isLast:false,
plan:[],
actMoney:''
},
paymentRegistrationRules:{
applyMoney:[
{required:true,message:"必填"}
],
deductionMoney:[
{required:true,message:"必填"}
],
type:[
{required:true,message:"必选"}
],
actMoney:[
{required:true,message:"必填"}
]
},
planTable:[
{
sortable:false,
width:36,
type:'selection'
},
{
label:"分类",
prop:'type',
formatter:(cell,data,value)=>{
switch (value){
case 1:
return "部门预算"
break;
case 2:
return "水务计划"
break;
default:
return "未知"
}
}
},
{
label:"名称",
prop:'name',
align:'left'
},
{
label:"计划金额",
prop:'money',
align:'right'
}
],
}
},
methods: {
//
pageChange(e){
this.pageIndex = e
this.getBudgets()
},
//
totalMoney(){
let total = 0.00
this.payment.map(item => {
total += Number(item.act_money)
})
return total.toFixed(2)
},
//
percentPay(){
let total = this.totalMoney()
return this.contract.money/total || 0
},
async getRegistration(id){
this.registrationId = id
const res = await detailFundLog({id})
this.paymentRegistrationForm.type = res.type
this.paymentRegistrationForm.isLast = res.is_end === 1 ? true : false
this.paymentRegistrationForm.deductionMoney = res.apply_money
this.paymentRegistrationForm.applyMoney = res.apply_money
this.getContract(res.contract)
},
//
async getContract(info){
this.contract = info
this.paymentRegistrationForm.plan = this.contract.plans.map(item=>{
return {
plan_id:item.id,
use_money:item.useMoney ?? item.money,
new_money:item.money,
}
})
const res = await getFundLog({contract_id:this.contract.id})
this.payment = res.data
this.toggleSelection(this.paymentRegistrationForm.plan.map(item => {
return item.plan_id
}))
},
//
async getPaymentType(){
const res = await getparameter({number:'payment_type'})
this.paymentType = res.detail
},
//
editor(){
editorFundLog({
id:this.registrationId,
contract_id:this.contract.id,
act_money:this.paymentRegistrationForm.actMoney
}).then(res=>{
this.$emit('refresh')
this.isShow = false
this.paymentRegistrationForm.actMoney = ''
Message({
type:'success',
message:'操作成功'
})
})
},
//
//
async getBudgets(){
let res = await getBudget({name:this.searchContent,page_size:10,page:this.pageIndex})
this.plans = res.data
this.planTotal = res.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 ?? item.money,
new_money:item.money
}
})
}else{
this.paymentRegistrationForm.plan = []
}
},
toggleSelection(plans) {
if (plans) {
this.plans.filter(plan => {
return plans.includes(plan.id)
}).map(row => {
this.$refs.planTable.toggleRowSelection(row);
})
} else {
this.$refs.planTable.clearSelection();
}
},
},
async mounted() {
await this.getPaymentType()
await this.getBudgets()
}
}
</script>
<style scoped lang="scss">
.payment-registration{
&-row{
display: flex;
padding: 6px 0;
&-title{
padding: 0 10px;
}
&-content{
}
}
}
</style>

@ -1,7 +1,7 @@
<template>
<div>
<!-- 付款登记-->
<xy-dialog title="付款登记" :is-show.sync="isShowPaymentRegistration" type="form" class="payment-registration" :form="paymentRegistrationForm" :rules="paymentRegistrationRules" @submit="submit">
<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>
@ -61,14 +61,6 @@
</Col>
</Row>
</template>
<template v-slot:actMoney>
<Row>
<Col span="5"><span style="font-weight: 600;padding-right: 4px;color: red;">*</span>实际支付金额</Col>
<Col>
<Input placeholder="请填写实际支付金额" v-model="paymentRegistrationForm.actMoney" style="width: 300px;"></Input>
</Col>
</Row>
</template>
<template v-slot:type>
<Row>
<Col span="5"><span style="font-weight: 600;padding-right: 4px;color: red;">*</span>款项类型
@ -84,7 +76,7 @@
<Row>
<Col span="5"><span style="font-weight: 600;padding-right: 4px;color: red;">*</span>是否最后一笔</Col>
<Col>
<i-switch v-model="paymentRegistrationForm.isLast" @on-change="paymentRegistrationForm.isLast = $event" />
<i-switch :value="paymentRegistrationForm.isLast" @on-change="(e)=>paymentRegistrationForm.isLast = e"/>
</Col>
</Row>
</template>
@ -148,9 +140,8 @@ export default {
paymentRegistrationForm:{
applyMoney:"",
deductionMoney:"",
actMoney:'',
type:"",
isLast:"",
isLast:false,
plan:[]
},
paymentRegistrationRules:{
@ -160,9 +151,6 @@ export default {
deductionMoney:[
{required:true,message:"必填"}
],
actMoney:[
{required:true,message:"必填"}
],
type:[
{required:true,message:"必选"}
]
@ -253,9 +241,8 @@ export default {
contract_id:this.contract.id,
apply_money:this.paymentRegistrationForm.applyMoney,
discount_money:this.paymentRegistrationForm.deductionMoney,
act_money:this.paymentRegistrationForm.actMoney,
type:this.paymentRegistrationForm.type,
is_end:this.paymentRegistrationForm ? 1 : 0,
is_end:this.paymentRegistrationForm.isLast ? 1 : 0,
contract_plan_links:this.paymentRegistrationForm.plan
}).then(res=>{
this.isShowPaymentRegistration = false
@ -263,6 +250,7 @@ export default {
type:'success',
message:"操作成功"
})
this.$refs['paymentRegistration'].reset()
})
},

@ -0,0 +1,88 @@
<template>
<div v-if="registration">
<xy-dialog :is-show.sync="isShow" :width="69">
<template v-slot:normalContent>
<div class="print-table1" id="printtable1">
<div style="grid-area: title;justify-content: center;">苏州市河道管理处资金划拨审批</div>
<div style="grid-area: department">科室</div>
<div style="grid-area: date">{{registration.created_at}}</div>
<div style="grid-area: tb1-1">收款单位</div>
<div style="grid-area: tb1-2">{{registration.contract.supply}}</div>
<div style="grid-area: tb1-3">经办人</div>
<div style="grid-area: tb1-4"></div>
<div style="grid-area: tb2-1">合同名称或摘要</div>
<div style="grid-area: tb2-2">{{registration.contract.name}}</div>
<div style="grid-area: tb2-3">科室负责人</div>
<div style="grid-area: tb2-4"></div>
<div style="grid-area: tb3-1">合同价</div>
<div style="grid-area: tb3-2">{{registration.contract.plan_price}}万元</div>
<div style="grid-area: tb3-3">财审科审核</div>
<div style="grid-area: tb3-4"></div>
<div style="grid-area: tb4-1">申请付款金额</div>
<div style="grid-area: tb4-2">{{registration.apply_money}}万元</div>
<div style="grid-area: tb4-3">分管领导审核</div>
<div style="grid-area: tb4-4"></div>
<div style="grid-area: tb5-1">资金列支渠道</div>
<div style="grid-area: tb5-2"></div>
<div style="grid-area: tb5-3">财务分管领导审核</div>
<div style="grid-area: tb5-4"></div>
<div style="grid-area: tb6-1">同意支付金额</div>
<div style="grid-area: tb6-2"></div>
<div style="grid-area: tb6-3">单位负责人审批</div>
<div style="grid-area: tb6-4"></div>
</div>
<Button v-print="'#printtable1'">print</Button>
</template>
</xy-dialog>
</div>
</template>
<script>
import {detailFundLog} from "@/api/paymentRegistration/fundLog"
export default {
data() {
return {
isShow:false,
registration:null
}
},
methods: {
async getDetailFundLog(id){
let res = await detailFundLog({id})
this.registration = res
console.log(this.registration)
}
},
}
</script>
<style scoped lang="scss">
.print-table1{
border: 1px #000 solid;
display: grid;
grid-template-rows: repeat(8,auto);
grid-template-columns: repeat(2,1fr 2.5fr);
grid-template-areas:
"title title title title"
"department department date date"
"tb1-1 tb1-2 tb1-3 tb1-4"
"tb2-1 tb2-2 tb2-3 tb2-4"
"tb3-1 tb3-2 tb3-3 tb3-4"
"tb4-1 tb4-2 tb4-3 tb4-4"
"tb5-1 tb5-2 tb5-3 tb5-4"
"tb6-1 tb6-2 tb6-3 tb6-4";
&>div{
border: 1px #000 solid;
display: flex;
align-items: center;
padding: 10px 6px;
}
}
</style>

@ -93,7 +93,17 @@
<Button class="slot-btns-item" type="primary" size="small">请示流程</Button>
<Button class="slot-btns-item" type="primary" size="small">合同会签流程申请</Button>
<Button class="slot-btns-item" type="primary" size="small">采购流程申请</Button>
<Button class="slot-btns-item" type="error" size="small" @click="()=>deleteContract(scope.row.id)" ghost>删除</Button>
<Poptip
placement="bottom"
:transfer="true"
confirm
title="确认要删除吗"
@on-ok="()=>deleteContract(scope.row.id)">
<i-button
type="error"
size="small"
ghost>删除</i-button>
</Poptip>
<Button class="slot-btns-item" type="primary" size="small" @click="$refs['detailContract'].isShowDetail = true,$refs['detailContract'].getDetail(scope.row.id)">查看</Button>
<Button class="slot-btns-item" type="primary" size="small" @click="$refs['editor'].isShowEditor = true,$refs['editor'].getDetail(scope.row.id)">编辑</Button>
</div>

@ -14,18 +14,53 @@
</span>
<Button type="primary" style="margin-left: 10px" ghost>重置</Button>
<Button type="primary" style="margin-left: 10px"></Button>
<Button type="primary" style="margin-left: 10px" @click="getFundLogs"></Button>
</slot>
</lx-header>
<xy-table :list="list" :table-item="table"></xy-table>
<xy-table :list="list" :table-item="table">
<template v-slot:btns>
<el-table-column label="操作" fixed="right" width="200" header-align="center">
<template slot-scope="scope">
<Poptip
placement="bottom"
confirm
:transfer="true"
title="确认要删除吗"
@on-ok="deleteFundLog(scope.row)">
<Button size="small" type="error" style="margin-left: 10px" ghost>删除</Button>
</Poptip>
<Button size="small" type="primary" style="margin-left: 10px" @click="$refs['examineRegistration'].isShow = true,$refs['examineRegistration'].getRegistration(scope.row.id)">审核确认</Button>
<Button size="small" type="primary" style="margin-left: 10px" @click="$refs['printRegistration'].getDetailFundLog(scope.row.id),$refs['printRegistration'].isShow = true">打印</Button>
</template>
</el-table-column>
</template>
</xy-table>
<div style="display: flex;justify-content: flex-end;">
<Page :total="total" show-elevator @on-change="pageChange"/>
</div>
<printRegistration ref="printRegistration"></printRegistration>
<examineRegistration ref="examineRegistration" @refresh="getFundLogs"></examineRegistration>
</div>
</template>
<script>
import {getFundLog} from "@/api/paymentRegistration/fundLog"
import {getFundLog,delFundLog} from "@/api/paymentRegistration/fundLog"
import {parseTime} from "@/utils"
import {Message} from "element-ui";
import printRegistration from "./components/printRegistration";
import examineRegistration from "./components/examineRegistration";
export default {
components:{
printRegistration,
examineRegistration
},
data() {
return {
list:[],
@ -34,7 +69,8 @@ export default {
table:[
{
label:"项目名称",
width: 150
width: 150,
prop:'contract.name'
},
{
label:"付款申请金额(万元)",
@ -73,10 +109,25 @@ export default {
}
},
methods: {
pageChange(e){
this.pageIndex = e
this.getFundLogs()
},
async getFundLogs(){
const res = await getFundLog()
const res = await getFundLog({page_size:10,page:this.pageIndex})
this.list = res.data
this.total = res.total
},
deleteFundLog(row){
delFundLog({id:row.id}).then(res=>{
Message({
type:'success',
message:'操作成功'
})
this.getFundLogs()
})
}
},
mounted() {

@ -13,16 +13,19 @@
<div class="table-tree">
<el-table :data="list" border class="v-table" style="width: 100%;margin-bottom: 20px;">
<el-table-column type="index" label="序号" align="center" />
<el-table-column prop="content" label="内容" align="center" />
<el-table-column prop="created_at" width="200" label="下发时间" align="center" />
<el-table-column fixed="right" width="100" label="状态" align="center">
<el-table-column prop="content" label="内容" align="left" />
<el-table-column prop="created_at" width="200" label="下发时间" align="center" :formatter="timeFormatter"/>
<el-table-column fixed="right" width="100" label="状态" align="center" prop="read_count">
<template slot-scope="{row, $index}">
<el-link v-if="row.is_read" type="success" :underline="false"></el-link>
<el-link v-if="row.read_count" type="success" :underline="false"></el-link>
<Button v-else type="error" size="small" style="margin-left: 10px;" ghost @click="readIt(row, $index)">未读</Button>
</template>
</el-table-column>
</el-table>
<pagination v-show="total > 0" :total="total" :page.sync="listQuery.page" :limit.sync="listQuery.page_size" @pagination="getList" />
<div style="display: flex;justify-content: flex-end;">
<Page :total="total" show-elevator @on-change="pageChange"/>
</div>
</div>
</div>
</template>
@ -32,7 +35,9 @@ import LxHeader from '@/components/LxHeader/index.vue'
import Pagination from '@/components/Pagination'
import { adminDepartmentList } from '../../api/system/department.js'
import { adminUserList, getInfo } from '../../api/user.js'
import {getNotice} from "@/api/dashboard/notice"
import {getNotice,readNotice} from "@/api/dashboard/notice"
import {parseTime} from "@/utils/index"
import {Message} from "element-ui";
export default {
name: 'Manage',
components: {
@ -44,11 +49,12 @@ export default {
userIds: [],
list: [],
total: 0,
listQuery: {
page: 1,
page_size: 10,
show_self: 1,
},
pageIndex:1,
// listQuery: {
// page: 1,
// page_size: 10,
// show_self: 1,
// },
form: {
id: undefined,
},
@ -60,7 +66,7 @@ export default {
}
},
created() {
this.getList()
//this.getList()
getInfo().then(response => {
console.log(response)
@ -68,9 +74,19 @@ export default {
}).catch(error => {})
},
methods: {
pageChange(e){
this.pageIndex = e
this.getNotices()
},
timeFormatter(cell,data,value) {
return parseTime(new Date(value))
},
async getNotices(){
const res = await getNotice({page_size:10})
console.log(res)
const res = await getNotice({page_size:10,page:this.pageIndex})
this.list = res.data
this.total = res.total
},
departmentChange(v) {
@ -101,9 +117,16 @@ export default {
this.listQuery.page = 1
this.getList()
},
readIt(row, index) {
show({id: row.id}).then(r => { this.form = r }).catch(error => {})
this.list[index].is_read = 1
readIt(row) {
readNotice({id:row.id}).then(res=>{
Message({
type:'success',
message:'已读'
})
this.getNotices()
})
// show({id: row.id}).then(r => { this.form = r }).catch(error => {})
// this.list[index].is_read = 1
},
save() {
this.$refs['dataForm'].validate((valid) => {
@ -137,7 +160,7 @@ export default {
},
},
mounted() {
//this.getNotices()
this.getNotices()
}
}
</script>

Loading…
Cancel
Save