master
lion 12 months ago
parent fbefb493f4
commit a19bf6f73b

@ -0,0 +1,94 @@
import request from "@/utils/request";
function customParamsSerializer(params) {
let result = '';
for (let key in params) {
if (params.hasOwnProperty(key)) {
if (Array.isArray(params[key])) {
params[key].forEach((item,index) => {
if (item instanceof Array) {
item.forEach((item1, index1) => {
result += `${key}[${index}][${index1}]=${item1}&`
})
} else if (typeof item === 'object') {
for (let key1 in item) {
result += `${key}[${index}][${key1}]=${item[key1]}&`
}
}
// result += `${key}[${index}][key]=${item.key}&${key}[${index}][op]=${item.op}&${key}[${index}][value]=${item.value}&`;
});
} else {
result += `${key}=${params[key]}&`;
}
}
}
return result.slice(0, -1);
}
// 借款
export function getBorrow(params,noloading = false){
return request({
method:'get',
url:'/api/ht/borrow/index',
params,
noloading,
paramsSerializer: customParamsSerializer
})
}
export function addBorrow(data){
return request({
method:"post",
url:'/api/ht/borrow/save',
data
})
}
export function detailBorrow(params){
return request({
method:'get',
url:'/api/ht/borrow/show',
params
})
}
export function delBorrow(params){
return request({
method:'get',
url:'/api/ht/borrow/destroy',
params
})
}
// 还款
export function getRepayment(params,noloading = false){
return request({
method:'get',
url:'/api/ht/borrow-repayment/index',
params,
noloading,
paramsSerializer: customParamsSerializer
})
}
export function addRepayment(data){
return request({
method:"post",
url:'/api/ht/borrow-repayment/save',
data
})
}
export function detailRepayment(params){
return request({
method:'get',
url:'/api/ht/borrow-repayment/show',
params
})
}
export function delRepayment(params){
return request({
method:'get',
url:'/api/ht/borrow-repayment/destroy',
params
})
}

@ -191,14 +191,14 @@ export default {
['expand-change']: (row, expanded) => this.$emit('expand-change', { row, expanded })
}}
>
<el-table-column
{showIndex?(<el-table-column
label=" "
fixed='left'
align='center'
width='60'
type='index'
>
</el-table-column>
</el-table-column>):''}
{
tableItem.filter(i => !i.hidden).map((item, index) => {
if ($scopedSlots[item.prop]) {

@ -1,4 +1,5 @@
<template>
<!-- 借款登记 -->
<div v-if="detail">
<!-- 合同详情-->
<xy-dialog :is-show.sync="isShowDetail" type="normal" title="经费借款" class="contract-detail">
@ -68,52 +69,41 @@
</div>
</div>
</div>
</div>
<div class="link-budget-plan">
<div class="link-budget-plan-title">关联预算计划</div>
<div style="display: flex;align-items: center;" v-if="detail.plan_link.length<1">
<DatePicker :value="planSelect.year" placeholder="选择所属年份" placement="bottom-start"
style="width: 140px;margin-right: 10px;" type="year" @on-change="(e) => {
planSelect.year = e
getPlan()
}"></DatePicker>
<el-select placeholder="科室选择" clearable size="small" v-model="planSelect.plan_department_id"
style="width: 180px;margin-right: 10px;" @change="getPlan">
<el-option v-for="item in departments" :label="item.name" :value="item.id" :key="item.id">
</el-option>
</el-select>
<Input v-model="planSelect.name" search enter-button=" " placeholder="搜索预算计划.." @on-search="getPlan" />
</div>
<xy-table :list="plans" :show-index="false" :table-item="planTable" :height="310" style="margin-top: 10px;"
ref="PlanTable" row-key="id" border default-expand-all
:tree-props="{ children: 'children', hasChildren: 'hasChildren' }" @selection-change="planPick">
<template v-slot:btns>
<el-table-column label="使用金额(元)" header-align="center" width="150"
:fixed="$store.getters.device === 'mobile'?false:'right'">
<template slot-scope="scope" v-if="scope.row.pid > 0">
<Input :value="scope.row._inputMoney" @input="planInput($event,scope.row)" />
<!-- <InputNumber style="width: 120px" :min="0" :precision="2" :active-change="false"
:value="Number(scope.row._inputMoney)" @input="e => scope.row._inputMoney = e" :formatter="
(value) => `${value}`.replace(/\B(?=(\d{3})+(?!\d))/g, ',')
" :parser="(value) => value.replace(/\$\s?|(,*)/g, '')"></InputNumber> -->
</template>
</el-table-column>
</template>
</xy-table>
<div class="base-info-item">
<div class="base-info-item-title"><span style="color:red">*</span>借款说明</div>
<div class="base-info-item-content">
<el-input placeholder="请填写借款说明" v-model="form.name" style="width: 300px;" />
</div>
</div>
<div class="base-info-item">
<div class="base-info-item-title"><span style="color:red">*</span>借款金额</div>
<div class="base-info-item-content">
<el-input type="number" placeholder="请填写借款金额" v-model="form.money" style="width: 300px;" />
</div>
</div>
<div class="base-info-item">
<div class="base-info-item-title">借款备注</div>
<div class="base-info-item-content">
<el-input placeholder="请填写备注" v-model="form.remark" style="width: 300px;" />
</div>
</div>
</div>
<!-- <xy-table :height="260" :table-item="linkBudgetPlanTable" :show-index="false" :list="detail.plans">
<template v-slot:btns>
<div></div>
</template>
</xy-table> -->
</template>
<template v-slot:footerContent>
<div style="display: flex;align-items: center;justify-content: flex-end;">
<Button ghost type="primary" @click="isShowDetail=false"></Button>
<Button type="primary" style="margin-left: 10px;" @click="submit"></Button>
</div>
</template>
<template v-slot:footerContent>
<div style="display: flex;align-items: center;justify-content: flex-end;">
<Button ghost type="primary" @click="isShowDetail=false"></Button>
<Button type="primary" style="margin-left: 10px;" @click="submit"></Button>
</div>
</template>
</xy-dialog>
@ -121,21 +111,14 @@
<template>
<iframe style="width: 100%; height: 57vh" :src="codeUri" border="0"></iframe>
</template>
</Modal>
<!-- oa办理-->
<Modal
:width="86"
class-name="oa-modal"
title="流程办理"
fullscreen
:mask-closable="false"
v-model="isShowOaModal"
footer-hide
>
<div style="width: 100%;height: 100%;">
<iframe style="width: 100%;height: 100%;border-radius: 0 0 6px 6px;" :src="oaUrl" frameborder="0"></iframe>
</div>
</Modal>
</Modal>
<!-- oa办理-->
<Modal :width="86" class-name="oa-modal" title="流程办理" fullscreen :mask-closable="false" v-model="isShowOaModal"
footer-hide>
<div style="width: 100%;height: 100%;">
<iframe style="width: 100%;height: 100%;border-radius: 0 0 6px 6px;" :src="oaUrl" frameborder="0"></iframe>
</div>
</Modal>
</div>
</template>
@ -144,6 +127,9 @@
detailContract,
editorContract
} from "@/api/contract/contract";
import {
addBorrow
} from "@/api/borrow/borrow";
import {
Message
} from "element-ui";
@ -152,29 +138,26 @@
} from "@/utils";
import axios from "axios";
import {
getBudget
} from "@/api/budget/budget";
import {
getToken
} from "@/utils/auth";
import {
deepCopy
} from "@/utils";
import {flowStatusConfig} from "@/api/common";
} from "@/utils";
import {
flowStatusConfig
} from "@/api/common";
export default {
props: {
departments: {
type: Array,
default: () => []
},
},
components: {},
data() {
return {
showModal: false,
codeUri: '',
isShowOaModal: false,
codeUri: '',
isShowOaModal: false,
oaUrl: "",
window: {
width: 0,
@ -182,214 +165,86 @@
top: 0,
left: 0,
},
//
id: "",
detail: null,
isShowDetail: false,
plans: [],
contract_plan_links: [],
custom_model_id:'',
planSelect: {
name: "",
page_size: 20,
page: 1,
is_tree: 1,
year: new Date().getFullYear().toString(),
plan_department_id: "",
type: ""
},
planTable: [{
fixed: 'left',
sortable: false,
width: 44,
reserveSelection: true,
type: "selection",
selectable: (row, index) => {
return row.pid > 0
},
},
{
label: "科室",
prop: 'plan_department.name',
width: 160,
align: 'center'
},
{
label: "年份",
prop: 'year',
width: 80,
align: 'center'
},
{
label: "分类",
prop: 'type_detail.value',
},
{
label: "名称",
prop: 'name',
align: 'left',
width: 220,
},
{
label: "计划金额",
prop: 'money',
align: 'right',
width: 120,
},
{
label: "实付金额",
prop: 'use_money_total',
width: 120,
align: 'right'
},
{
label: '已用金额',
prop: 'has_money_total',
width: 120,
align: 'right'
}
],
custom_model_id: '',
form: {
name: '',
money: '',
remark: ''
}
};
},
methods: {
async getFlowConfig() {
try {
const res = await flowStatusConfig()
let arr = []
arr = res.map(i => JSON.parse(i.value))
arr.map(item=>{
if(item.tag==='unit_loan'){
this.custom_model_id = item.custom_model_id
}
})
} catch (err) {
this.custom_model_id = ''
}
},
async getPlan() {
try {
let res = await getBudget(this.planSelect)
let copyPlan = deepCopy(this.detail.plan_link)
console.log("res", copyPlan, this.detail.plan_link)
this.$refs['PlanTable'].clearSelection()
//
if (copyPlan.length > 0) {
let arr = []
res.list.forEach((item) => {
item._inputMoney = 0
let temp = copyPlan.find(i => i.plan_id === item.id)
if (temp) {
item._linkId = temp.id
item._inputMoney = temp.use_money
if (item.children && item.children.length > 0) {
item.children.forEach((i => {
i._inputMoney = temp.use_money
}))
}
arr.push(item)
}
});
this.plans = arr;
} else {
res.list.forEach((item => {
item._inputMoney = 0
if (item.children && item.children.length > 0) {
item.children.forEach((i => {
i._inputMoney = 0
}))
}
}))
this.plans = res.list;
}
} catch (e) {
async getFlowConfig() {
try {
const res = await flowStatusConfig()
let arr = []
arr = res.map(i => JSON.parse(i.value))
arr.map(item => {
if (item.tag === 'unit_loan') {
this.custom_model_id = item.custom_model_id
}
})
} catch (err) {
this.custom_model_id = ''
}
},
planPick(selection) {
console.log("selection", selection)
this.contract_plan_links = selection.map(i => ({
plan_id: i.id,
is_pre: 1,
use_money: i._inputMoney,
new_money: i._inputMoney,
custom_model_id: this.custom_model_id
}))
},
//
planInput(e, row) {
if (!/^[0-9]+.?[0-9]*$/.test(e) && e) {
Message({
type: 'warning',
message: '金额格式错误'
})
row._inputMoney = 0
return
}
if (e <= (Number(row.money) - Number(row.use_money_total))) {
row._inputMoney = e
return
}
Message({
type: 'warning',
message: '使用金额大于剩余预算'
})
row._inputMoney = 0
},
async getDetail(id) {
this.id = id;
let res = await detailContract({
id: id,
});
this.detail = res;
// let plans = res.plans;
// let linkPlan = res.plan_link;
// let linkPlanTable = plans.map((item) => {
// let res = linkPlan.filter((item1) => {
// return item1.plan_id === item.id;
// })[0];
// return {
// id: item.id,
// type: item.type,
// name: item.name,
// money: item.money,
// useMoney: res.use_money,
// };
// });
// this.detail.plans = linkPlanTable;
await this.getPlan()
},
async submit() {
if (!this.form.name) {
this.$message.warning('请填写借款说明')
return
}
if (!this.form.money) {
this.$message.warning('请填写借款金额')
return
}
if (parseFloat(this.form.money) > parseFloat(this.detail.plan_price)) {
this.$message.warning('借款金额不能多于项目预算')
return
}
// return
const res = await addBorrow({
contract_id: this.id,
name: this.form.name,
money: this.form.money,
remark: this.form.remark
})
this.$message.success('提交成功')
// this.$emit('refresh')
console.log("res", res)
await this.openOa(res)
// this.isShowDetail = false
// this.$emit('update:isShow', false)
},
submit(){
if(this.contract_plan_links.length<1){
this.$message.warning('请选择预算计划')
return
}
console.log("123",{
id:this.id,
has_act_links:1,
contract_plan_links:this.contract_plan_links,
})
// return
editorContract({
id:this.id,
has_act_links:1,
contract_plan_links:this.contract_plan_links,
}).then(_ => {
this.$message.success('提交成功')
this.$emit('update:isShowDetail', false)
this.$emit('refresh')
this.openOa()
})
},
openOa(){
let url = `${process.env.VUE_APP_OUT_URL}/#/flow/create?auth_token=${window.encodeURIComponent(getToken())}&module_name=oa&isSinglePage=1&module_id=${this.custom_model_id}&out_contract_id=${this.id}&default_json={}`
this.oaUrl = url
this.isShowOaModal = true
openOa(res) {
console.log("res123", res)
let default_json = {
zhichuyongtu: res.name ? res.name : '',
fukuanjine: res.money ? res.money : ''
}
let url =
`${process.env.VUE_APP_OUT_URL}/#/flow/create?auth_token=${window.encodeURIComponent(getToken())}&module_name=oa&isSinglePage=1&module_id=${this.custom_model_id}&borrow_id=${res.id}&default_json=${window.encodeURIComponent(JSON.stringify(default_json))}`
this.oaUrl = url
console.log("oaUrl", this.oaUrl)
this.isShowOaModal = true
console.log("this.isShowOaModal", this.isShowOaModal)
},
open(e) {
this.codeUri = `http://view.ali251.langye.net:8012/onlinePreview?url=${encodeURIComponent(
@ -438,31 +293,29 @@
isShowDetail(val) {
if (val) {
}else{
this.plans = []
this.contract_plan_links = []
this.planSelect = {
name: "",
page_size: 20,
page: 1,
is_tree: 1,
year: new Date().getFullYear().toString(),
plan_department_id: "",
type: ""
},
this.$refs['PlanTable'].clearSelection()
} else {
this.detail = null
this.form = {
name: '',
money: '',
remark: ''
}
}
},
isShowOaModal(newVal) {
if (newVal) {
} else {
this.oaUrl = ''
this.isShowDetail = false
this.$emit('update:isShow', false)
this.$emit("refresh")
}
},
isShowOaModal(newVal) {
if (newVal) {
} else {
this.oaUrl = ''
}
}
},
mounted() {
mounted() {
this.getFlowConfig()
// this.openOa({})
this.window.width = screen.availWidth * 0.95;
this.window.height = screen.availHeight * 0.95;
this.window.top = (window.screen.height - 30 - this.window.height) / 2;

@ -0,0 +1,274 @@
<template>
<div>
<xy-dialog :is-show.sync="isShowDetail" type="normal" title="借还款记录" class="contract-detail">
<template v-slot:default>
<xy-table ref="xyTable" :showIndex="false" :list="list" :table-item="table" :isPage="false">
<template v-slot:id>
<el-table-column
header-align="center"
label="操作"
width="50"
type="expand"
>
<template slot-scope="scope">
<xy-table ref="payTable" :showIndex="false" :list="scope.row.repayments" :table-item="payTable" :isPage="false">
<template v-slot:btns>
<el-table-column
header-align="center"
label="操作"
width="200"
>
<template slot-scope="repay">
<Button
class="slot-btns-item"
size="small"
type="primary"
@click="openPay(scope.row,repay.row.id)"
>
编辑
</Button>
<Poptip
:transfer="true"
confirm
placement="bottom"
title="确认要删除吗"
@on-ok="() => delPay(repay.row.id)"
>
<i-button
class="slot-btns-item"
ghost
size="small"
type="error"
style="margin-left:10px"
>删除
</i-button>
</Poptip>
</template>
</el-table-column>
</template>
</xy-table>
</template>
</el-table-column>
</template>
<template v-slot:btns>
<el-table-column
header-align="center"
label="操作"
width="200"
>
<template slot-scope="scope">
<!-- 没有发起流程的 发起流程 -->
<Button
v-if="scope.row.contract_flow_links && scope.row.contract_flow_links.length==0"
class="slot-btns-item"
size="small"
type="primary"
@click="openOa(scope.row)"
>
发起借款流程
</Button>
<!-- 有流程 且流程已经走完的 还款金额不能大于借款金额 才能发起还款 && <scope.row.money-->
<Button
v-if="scope.row.contract_flow_links && scope.row.contract_flow_links.length>0
&& scope.row.contract_flow_links[0]['flow_status']==1 &&
(!scope.row.repayment_total || (scope.row.repayment_total && parseFloat(scope.row.repayment_total)< parseFloat(scope.row.money)))
"
class="slot-btns-item"
size="small"
type="primary"
@click="openPay(scope.row)"
>
新增还款
</Button>
</template>
</el-table-column>
</template>
</xy-table>
</template>
<template v-slot:footerContent>
<div style="display: flex;align-items: center;justify-content: flex-end;">
<Button ghost type="primary" @click="isShowDetail=false"></Button>
</div>
</template>
</xy-dialog>
<borrowPay ref="borrowPay" @refresh="getList"></borrowPay>
<!-- oa办理-->
<Modal :width="86" class-name="oa-modal" title="流程办理" fullscreen :mask-closable="false" v-model="isShowOaModal"
footer-hide>
<div style="width: 100%;height: 100%;">
<iframe style="width: 100%;height: 100%;border-radius: 0 0 6px 6px;" :src="oaUrl" frameborder="0"></iframe>
</div>
</Modal>
</div>
</template>
<script>
import {
getBorrow,
delRepayment
} from '@/api/borrow/borrow'
import borrowPay from "../components/borrowPay.vue";
import {
getToken
} from "@/utils/auth";
import {
flowStatusConfig
} from "@/api/common";
export default {
components:{
borrowPay
},
data() {
return {
id: '',
isShowDetail: false,
isShowOaModal:false,
custom_model_id: '',
oaUrl:'',
list: [],
payTable:[{
prop:'id',
label:'id',
width:50,
},{
prop:'money',
label:'还款金额',
width:120,
},{
prop:'remark',
label:'还款备注',
align:'left'
},{
prop:'admin.name',
label:'还款人',
width:120
},{
prop:'created_at',
label:'发起时间',
width:180
}],
table: [{
prop:'id',
label:'id',
width:50,
// type:'expend',
// expendFn(row){
// return "123"
// }
},{
prop:'name',
label:'借款说明',
align:'left'
},{
prop:'money',
label:'借款金额',
width:120,
},{
prop:'remark',
label:'借款备注',
align:'left'
},{
prop:'status',
label:'流程状态',
align:'center',
customFn: (row) => {
if(row.contract_flow_links && row.contract_flow_links.length>0){
return this.getStatus(row.contract_flow_links[0]['flow_status'])
}
},
},{
prop:'admin.name',
label:'申请人',
width:120
},{
prop:'created_at',
label:'发起时间',
width:180
}]
}
},
created() {
this.getFlowConfig()
},
watch: {
isShowDetail(val) {
if (val) {
this.getList()
}
},
isShowOaModal(newVal) {
if (newVal) {
} else {
this.oaUrl = ''
this.getList()
}
}
},
methods: {
getStatus(status){
let list = {
'-1':'退回',
'0':'处理中',
'1':'已完成'
}
return list[status]
},
async getFlowConfig() {
try {
const res = await flowStatusConfig()
let arr = []
arr = res.map(i => JSON.parse(i.value))
arr.map(item => {
if (item.tag === 'unit_loan') {
this.custom_model_id = item.custom_model_id
}
})
} catch (err) {
this.custom_model_id = ''
}
},
async getList() {
const res = await getBorrow({
page: 1,
page_size: 999,
contract_id:this.id,
})
this.list = res.data
},
openPay(row,id){
this.$refs.borrowPay.setRow(row,id)
this.$refs.borrowPay.isShowDetail = true
},
//
delPay(id) {
delRepayment({
id,
}).then((res) => {
this.$message.success('操作成功')
this.getList();
});
},
openOa(res) {
console.log("res",res)
let default_json = {
zhichuyongtu: res.name ? res.name : '',
fukuanjine: res.money ? res.money : ''
}
let url =
`${process.env.VUE_APP_OUT_URL}/#/flow/create?auth_token=${window.encodeURIComponent(getToken())}&module_name=oa&isSinglePage=1&module_id=${this.custom_model_id}&borrow_id=${res.id}&default_json=${window.encodeURIComponent(JSON.stringify(default_json))}`
this.oaUrl = url
this.isShowOaModal = true
},
}
}
</script>
<style>
</style>

@ -0,0 +1,244 @@
<template>
<div>
<!-- 合同详情-->
<xy-dialog :is-show.sync="isShowDetail" type="normal" title="经费借款" class="contract-detail">
<template v-slot:default>
<div class="base-info">
<div class="base-info-item">
<div class="base-info-item-title"><span style="color:red"></span>借款金额</div>
<div class="base-info-item-content">
{{borrow_money}}
</div>
</div>
<div class="base-info-item">
<div class="base-info-item-title"><span style="color:red"></span>已还款金额</div>
<div class="base-info-item-content">
{{repayment_total}}
</div>
</div>
<div class="base-info-item">
<div class="base-info-item-title"><span style="color:red">*</span>还款金额</div>
<div class="base-info-item-content">
<el-input type="number" placeholder="请填写借款金额" v-model="form.money" style="width: 300px;" />
</div>
</div>
<div class="base-info-item">
<div class="base-info-item-title">备注</div>
<div class="base-info-item-content">
<el-input placeholder="请填写备注" v-model="form.remark" style="width: 300px;" />
</div>
</div>
</div>
</template>
<template v-slot:footerContent>
<div style="display: flex;align-items: center;justify-content: flex-end;">
<Button ghost type="primary" @click="isShowDetail=false"></Button>
<Button type="primary" style="margin-left: 10px;" @click="submit"></Button>
</div>
</template>
</xy-dialog>
</div>
</template>
<script>
import {
addRepayment,
detailRepayment
} from "@/api/borrow/borrow";
import {
Message
} from "element-ui";
export default {
props: {
},
components: {},
data() {
return {
//
id: "",
isShowDetail: false,
borrow_money:0,
repayment_total:0,
form: {
borrow_id: '',
money: '',
remark: ''
}
};
},
methods: {
setRow(row,id){
this.repayment_total = row.repayment_total?row.repayment_total:0
this.form.borrow_id = row.id
this.borrow_money = row.money
if(id){
this.id = id
this.getDetail(id)
}
},
async getDetail(id) {
this.id = id;
let res = await detailRepayment({
id: id,
});
this.form = res;
},
async submit() {
if (!this.form.money) {
this.$message.warning('请填写还款金额')
return
}
if ((parseFloat(this.form.money)+parseFloat(this.repayment_total)) > parseFloat(this.borrow_money)) {
this.$message.warning('还款总金额不能多于借款金额')
return
}
// return
const res = await addRepayment({
id:this.id?this.id:'',
borrow_id: this.form.borrow_id,
money: this.form.money,
remark: this.form.remark
})
this.$message.success('提交成功')
this.$emit('refresh')
this.isShowDetail = false
},
},
computed: {
},
watch: {
isShowDetail(val) {
if (val) {
} else {
this.borrow_money = 0
this.repayment_total = 0
this.form = {
borrow_id: '',
money: '',
remark: ''
}
}
},
},
mounted() {
},
created() {},
};
</script>
<style scoped lang="scss">
.contract-detail {
.base-info {
&-title {
font-weight: 600;
padding: 0 10px;
}
&-item {
display: flex;
margin-top: 8px;
&-title {
padding: 0 20px;
}
&-content {}
&-unit {
margin-left: 20px;
}
}
}
.link-budget-plan {
margin-top: 20px;
&-title {
@extend .base-info-title;
padding-bottom: 10px;
}
}
.sign-info {
&-title {
@extend .link-budget-plan-title;
}
&-item {
@extend .base-info-item;
&-title {
@extend .base-info-item-title;
}
&-content {
@extend .base-info-item-content;
}
&-unit {
@extend .base-info-item-unit;
}
}
}
.out-sign-info {
margin-top: 20px;
@extend .sign-info;
}
.pay-plan {
margin-top: 20px;
&-title {
@extend .link-budget-plan-title;
}
}
.related-processes {
margin-top: 20px;
&-title {
@extend .link-budget-plan-title;
}
&-item {
//color: red;
display: flex;
&>div {
cursor: pointer;
margin: 0 20px;
}
}
}
.journal {
margin-top: 20px;
&-title {
@extend .link-budget-plan-title;
}
}
}
a {
color: red;
&:hover {
color: red;
text-decoration: underline;
}
}
</style>

File diff suppressed because it is too large Load Diff

@ -412,7 +412,8 @@
>
<template slot-scope="scope">
<div class="slot-btns">
<!-- <Button
<Button
v-if="scope.row.plans.length>0 && scope.row.borrows.length==0"
class="slot-btns-item"
size="small"
type="primary"
@ -421,7 +422,31 @@
($refs['borrowContract'].isShowDetail = true)
"
>
经费借款
借款登记
</Button>
<Button
v-if="scope.row.borrows.length>0 && scope.row.borrows"
class="slot-btns-item"
size="small"
type="primary"
@click="
$refs['borrowList'].id = scope.row.id,
($refs['borrowList'].isShowDetail = true)
"
>
借还款记录
</Button>
<!-- <Button
class="slot-btns-item"
size="small"
type="primary"
@click="
$refs['paymentRegistration'].getContract(scope.row),
($refs[
'paymentRegistration'
].isShowPaymentRegistration = true)
"
>付款登记
</Button> -->
<template v-if="scope.row.FLOWSTATUS['zhifu'].isEnabled()">
@ -680,8 +705,8 @@
<detail ref="detailContract"></detail>
<!-- 借款 -->
<borrow ref="borrowContract" :departments="departments"></borrow>
<borrow ref="borrowContract" @refresh="getContracts"></borrow>
<borrowList ref="borrowList"></borrowList>
<!--付款登记-->
<paymentRegistration
ref="paymentRegistration"
@ -739,6 +764,8 @@ import { getToken } from "@/utils/auth";
import editor from "./components/editorContract";
import detail from "./components/detailContract";
import borrow from "./components/borrowContract";
import borrowList from "./components/borrowList";
import paymentRegistration from "./components/paymentRegistration";
import contractSign from "@/views/contract/components/contractSign";
import contractPaymentRegistration from "@/views/contract/components/contractPaymentRegistration";
@ -761,7 +788,8 @@ export default {
biddingUpload,
oaFiles,
EditContract,
borrow
borrow,
borrowList
},
data() {
return {

@ -111,15 +111,40 @@
"
>打印</Button
>
<Button
v-if="authOa(scope.row)"
size="small"
type="primary"
style="margin-left: 10px; margin-bottom: 4px"
@click="toOutPay(scope.row)"
>
支付审批
</Button>
<!-- 申请金额是否为0 -->
<template v-if="authOa(scope.row) && scope.row.status===0">
<Poptip
v-if="parseFloat(scope.row.apply_money)==0"
placement="bottom"
confirm
:transfer="true"
title="该申请付款金额为0,是否直接审核?"
@on-ok="saveFundLog(scope.row)"
>
<Button
size="small"
type="primary"
style="margin-left: 10px; margin-bottom: 4px"
>
支付审批
</Button>
</Poptip>
<Button
v-else
size="small"
type="primary"
style="margin-left: 10px; margin-bottom: 4px"
@click="toOutPay(scope.row)"
>
支付审批
</Button>
</template>
<Button
v-if="scope.row.property && scope.row.property_type_id"
size="small"
@ -176,7 +201,7 @@
<script>
import { detailContract } from "@/api/contract/contract";
import { fundlogFlow,httpCurl } from "@/api/out";
import { getFundLog, delFundLog } from "@/api/paymentRegistration/fundLog";
import { getFundLog, delFundLog,editorFundLog } from "@/api/paymentRegistration/fundLog";
import { parseTime } from "@/utils";
import { Message } from "element-ui";
import { show } from "@/api/away"
@ -210,7 +235,8 @@ export default {
align: "left",
fixed: this.$store.getters.device === 'mobile'?false:'left',
customFn: row => {
return (<span>{ row.contract_id ? row.contract.name : row.away.title }</span>)
console.log("row",row)
return (<span>{ row.contract_id ? (row.contract?row.contract.name:'') : row.away.title }</span>)
}
},
{
@ -245,7 +271,7 @@ export default {
width: 330,
align: "left",
customFn: (row) => {
if (row.act_plan_link.length > 0) {
if (row.act_plan_link && row.act_plan_link.length > 0) {
return row.act_plan_link.map((item) => {
return (
<div>
@ -347,7 +373,16 @@ export default {
}
},
saveFundLog(row){
editorFundLog({
...row,
status:1
}).then(res => {
this.getFundLogs()
})
},
async toOutPay(row) {
let payments = [];
const actNumsTotal = () => {
return payments.reduce((pre,cur) => {

@ -201,7 +201,20 @@
</div>
</div>
</template>
<template v-slot:extraFormBottom>
<!-- 借款数据 -->
<template v-slot:extraFormBottom v-if="paymentRegistrationForm.plan_act_link_by_unit_loan && paymentRegistrationForm.plan_act_link_by_unit_loan.length>0">
<xy-table :list="paymentRegistrationForm.plan_act_link_by_unit_loan" :show-index="false" :table-item="planLinkTable" :height="310" style="margin-top: 10px;"
ref="planTable">
<template v-slot:btns>
<!-- <el-table-column label="使用金额(元)" header-align="center" width="140" :fixed="$store.getters.device === 'mobile'?false:'right'">
<template slot-scope="scope">
<Input :value="scope.row.use_money" @input="inputMoney($event,scope.row)" />
</template>
</el-table-column> -->
</template>
</xy-table>
</template>
<template v-slot:extraFormBottom v-else>
<div style="display: flex;align-items: center;">
<el-select
placeholder="科室选择"
@ -343,7 +356,8 @@ import {listdeptNoAuth} from "@/api/system/department";
plan: [],
actMoney: '',
moneyWay: [], //
files: []
files: [],
plan_act_link_by_unit_loan:[]
},
paymentRegistrationRules: {
applyMoney: [{
@ -473,6 +487,78 @@ import {listdeptNoAuth} from "@/api/system/department";
value ? `${value}`.replace(/\B(?=(\d{3})+(?!\d))/g, ",") : "",
},
],
planLinkTable: [
{
label: "id",
prop: 'plan.id',
align: 'center',
width: 96,
},
{
label: "年份",
prop: 'plan.year',
align: 'center',
width: 96,
},
{
label: "分类",
width: 136,
prop: 'type_detail.value',
formatter: (row, column, value) => {
const findVal = (arr, id) => {
for (let i = 0;i < arr.length;i++) {
if (i.id === id) {
return arr[i].name
} else if (arr.children instanceof Array) {
findVal(arr.children, id)
}
}
}
return value ? value : findVal(this.planTypes, row.plan.type)
}
},
{
label: "科室",
prop: 'plan_department.name',
width: 140,
align: 'center',
formatter: (row, column, value) => {
return value ? value : this.departments.find(i => i.id === row.plan.plan_department_id)?.name
}
},
// {
// label: "",
// prop: 'pid_info.name',
// width: 180,
// align: 'left'
// },
{
label: "名称",
prop: 'plan.name',
width: 280,
align: 'left'
},
{
label: "计划金额",
prop: 'plan.money',
width: 136,
align: 'right',
customFn: (row) => {
let m1 = row.plan.money;
let m2 = row.plan.update_money;
return m2 == 0 ? m1 : m2;
}
},
{
label: "借款金额",
prop: "use_money",
width: 120,
align: "right",
formatter: (v1, v2, value) =>
value ? `${value}`.replace(/\B(?=(\d{3})+(?!\d))/g, ",") : "",
},
],
}
},
methods: {
@ -590,6 +676,7 @@ import {listdeptNoAuth} from "@/api/system/department";
this.paymentRegistrationForm.deductionMoney = res.discount_money
this.paymentRegistrationForm.applyMoney = res.apply_money
this.paymentRegistrationForm.remark = res.remark
this.paymentRegistrationForm.plan_act_link_by_unit_loan = res.plan_act_link_by_unit_loan?res.plan_act_link_by_unit_loan:[]
for (var m of res.plan_link) {
m.label = m.plan ? m.plan.name : "无计划名称";
}
@ -600,7 +687,8 @@ import {listdeptNoAuth} from "@/api/system/department";
await this.getContract(res.contract,res.plan_link?.map(i => i.plan_id)?.toString())
// this.getBudgets(this.paymentRegistrationForm.plan?.map(i => i.plan_id)?.toString())
this.getBudgets(res.plan_link?.map(i => i.plan_id)?.toString())
// this.getBudgets(res.plan_link?.map(i => i.plan_id)?.toString())
this.getBudgets()
await this.moneyWayChange()
},
@ -634,6 +722,15 @@ import {listdeptNoAuth} from "@/api/system/department";
// return
// }
// return
let contract_plan_act_links = []
if(this.paymentRegistrationForm.plan_act_link_by_unit_loan.length>0){
this.paymentRegistrationForm.plan_act_link_by_unit_loan.map(item=>{
item.fund_log_id = this.registrationId
})
contract_plan_act_links = this.paymentRegistrationForm.plan_act_link_by_unit_loan
}else{
contract_plan_act_links = this.paymentRegistrationForm.plan
}
editorFundLog({
id: this.registrationId,
contract_id: this.contract.id,
@ -642,7 +739,7 @@ import {listdeptNoAuth} from "@/api/system/department";
apply_money: this.paymentRegistrationForm.applyMoney,
// discount_money: this.paymentRegistrationForm.deductionMoney,
// money_way_id: this.paymentRegistrationForm.moneyWay.toString(),
contract_plan_act_links: this.paymentRegistrationForm.plan,
contract_plan_act_links: contract_plan_act_links,
property: this.paymentRegistrationForm.property,
property_type_id: this.paymentRegistrationForm.property_type_id,
}).then(res => {

@ -308,7 +308,7 @@ export default {
align: "left",
customFn: (row) => {
{
if (row.act_plan_link.length > 0) {
if (row.act_plan_link && row.act_plan_link.length > 0) {
return row.act_plan_link.map((item) => {
return (
<div>

Loading…
Cancel
Save