lion 7 months ago
parent 63d0595c15
commit 27007ca020

@ -35,3 +35,13 @@ export function getFundLog(params,noloading = false){
noloading noloading
}) })
} }
// 设置最后一笔为 最后一笔支付
export function fundLogEnd(params){
return request({
method:'get',
url:'/api/ht/fund_log/end',
params
})
}

@ -23,6 +23,7 @@
<el-select v-model="form.type"> <el-select v-model="form.type">
<el-option value="workday" label="工作日" /> <el-option value="workday" label="工作日" />
<el-option value="holiday" label="节假日" /> <el-option value="holiday" label="节假日" />
<el-option value="week" label="双休日" />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="说明" prop="reason"> <el-form-item label="说明" prop="reason">

@ -31,6 +31,7 @@
<el-select v-model="row.type"> <el-select v-model="row.type">
<el-option value="workday" label="工作日" /> <el-option value="workday" label="工作日" />
<el-option value="holiday" label="节假日" /> <el-option value="holiday" label="节假日" />
<el-option value="week" label="双休日" />
</el-select> </el-select>
</template> </template>
</vxe-column> </vxe-column>

@ -2,40 +2,135 @@
<div> <div>
<vxe-modal :value="isShow" show-footer :z-index="zIndex" title="支付审批明细" show-zoom show-confirm-button transfer <vxe-modal :value="isShow" show-footer :z-index="zIndex" title="支付审批明细" show-zoom show-confirm-button transfer
resize :width="defaultModalSize.width" :height="defaultModalSize.height" @input="e => $emit('update:isShow',e)"> resize :width="defaultModalSize.width" :height="defaultModalSize.height" @input="e => $emit('update:isShow',e)">
<div> <div>
<div style="display: flex;align-items: center;justify-content: space-between;"> <!-- 历史支付记录查看 -->
<div style="display: flex;align-items: center;"> <h3>历史支付记录查看</h3>
<div class="xy-table-item-label"> <vxe-table ref="tables" stripe style="margin-top: 10px" keep-source :column-config="{ resizable: true }"
<span style="color: red; font-weight: 600; padding-right: 4px">*</span>申请付款金额 :print-config="{}" :export-config="{}" :expand-config="{
</div> accordion: true,
<div class="xy-table-item-content xy-table-item-price"> padding: true,
<el-input clearable type="number" placeholder="请填写付款金额" v-model="fundlogForm.applyMoney" }" :row-config="{ keyField: 'id' }" :custom-config="{ mode: 'popup' }" :data="paymentsList">
style="width: 150px;margin-left:10px" />
</div> <vxe-column title="项目名称" width="250" align="left" field="contract.name">
</div> <template #default="{ row }">
<div style="display: flex;align-items: center;"> {{row.contract_id ? (row.contract?row.contract.name:'') : row.away.title}}
<div class="xy-table-item-label"> </template>
<span style="color: red; font-weight: 600; padding-right: 4px">*</span>款项类型 </vxe-column>
</div> <vxe-column title="付款申请金额(元)" width="180" align="right" field="apply_money">
<div style="display: flex;align-items: center;"> <template #default="{ row }">
<el-select placeholder="选择款项类型或直接录入其他类型" v-model="fundlogForm.type" style="width: 200px;margin-left:10px" {{Number(row.apply_money).toFixed(2).replace(/(\d)(?=(\d{3})+\.)/g, "$1,")}}
filterable allow-create clearable popper-append-to-body> </template>
<el-option v-for="item in paymentType" :key="item" :label="item" :value="item"> </vxe-column>
</el-option> <vxe-column title="实际支付金额(元)" width="180" align="right" field="act_money">
</el-select> <template #default="{ row }">
</div> {{Number(row.act_money).toFixed(2).replace(/(\d)(?=(\d{3})+\.)/g, "$1,")}}
</div> </template>
<div style="display: flex;align-items: center;"> </vxe-column>
<div class="xy-table-item-label"> <vxe-column title="款项类型" width="120" align="center" field="type"></vxe-column>
<span style="color: red; font-weight: 600; padding-right: 4px">*</span>是否为最后一笔 <vxe-column title="预算计划" width="330" align="left" field="act_plan_link">
</div> <template #default="{ row }">
<div class="xy-table-item-content" style="margin-left:10px"> <template v-if="row.act_plan_link && row.act_plan_link.length > 0">
<el-switch v-model="fundlogForm.isLast" /> <div v-for="item in row.act_plan_link">
<!-- @change="toggleSelection"--> [{{item.plan?item.plan.year:''}}] {{(item.plan && item.plan.pid_info) ? item.plan.pid_info.name: ''}}
</div> - {{item.plan?item.plan.name:''}}
</div> <br />
[使用金额] {{item.use_money}}
</div>
</template>
</template>
</vxe-column>
<vxe-column title="审核状态" width="120" align="center" field="status">
<template #default="{ row }">
<div v-if="row.status===0"></div>
<div v-else></div>
</template>
</vxe-column>
<vxe-column title="流程状态" width="120" align="center" field="fund_log_flow_links">
<template #default="{ row }">
<template v-for="item in row.fund_log_flow_links">
<div v-if="item.tag === 'pay'">
{{flowStatus[item.flow_status]}}
</div>
</template>
</template>
</vxe-column>
<vxe-column title="次数" width="80" align="center" field="pay_count">
<template #default="{ row }">
{{row.contract_id ? row.pay_count : row.pay_count_away}}
</template>
</vxe-column>
<vxe-column title="是否为最后一笔" width="120" align="center" field="is_end">
<template #default="{ row }">
<div v-if="row.is_end===1"></div>
<div v-else></div>
</template>
</vxe-column>
<vxe-column title="经办人" width="120" align="center" field="admin.name">
<template #default="{ row }">
{{row.admin?row.admin.name:''}}
</template>
</vxe-column>
<vxe-column title="业务科室" width="160" align="center" field="department.name">
<template #default="{ row }">
{{row.department?row.department.name:''}}
</template>
</vxe-column>
<vxe-column title="备注" width="460" align="left" field="remark">
</vxe-column>
<vxe-column title="创建信息" width="180" align="center" field="created_at">
</vxe-column>
<vxe-column
min-width="120"
header-align="center"
field="operate"
title="操作"
fixed="right"
>
<template #default="{ row }">
<el-button type="primary" size="small" @click="showDetail(row)"
>查看</el-button>
</template>
</vxe-column>
</vxe-table>
<div style="display: flex;justify-content: center;margin-top:15px">
<el-button :disabled="paymentsList.length>0?false:true" type="primary" size="small" @click="payClose"> <i class="el-icon-arrow-right"></i> </el-button>
</div> </div>
<h3>发起新的支付审批</h3>
<div style="display: flex;align-items: center;justify-content: space-between;">
<div style="display: flex;align-items: center;">
<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 type="number" placeholder="请填写付款金额" v-model="fundlogForm.applyMoney"
style="width: 150px;margin-left:10px" />
</div>
</div>
<div style="display: flex;align-items: center;">
<div class="xy-table-item-label">
<span style="color: red; font-weight: 600; padding-right: 4px">*</span>款项类型
</div>
<div style="display: flex;align-items: center;">
<el-select placeholder="选择款项类型或直接录入其他类型" v-model="fundlogForm.type" style="width: 200px;margin-left:10px"
filterable allow-create clearable popper-append-to-body>
<el-option v-for="item in paymentType" :key="item" :label="item" :value="item">
</el-option>
</el-select>
</div>
</div>
<div style="display: flex;align-items: center;">
<div class="xy-table-item-label">
<span style="color: red; font-weight: 600; padding-right: 4px">*</span>是否为最后一笔
</div>
<div class="xy-table-item-content" style="margin-left:10px">
<el-switch v-model="fundlogForm.isLast" />
<!-- @change="toggleSelection"-->
</div>
</div>
</div>
<vxe-table ref="table" stripe style="margin-top: 10px" keep-source :column-config="{ resizable: true }" <vxe-table ref="table" stripe style="margin-top: 10px" keep-source :column-config="{ resizable: true }"
:print-config="{}" :export-config="{}" :expand-config="{ :print-config="{}" :export-config="{}" :expand-config="{
accordion: true, accordion: true,
@ -50,10 +145,11 @@
}" :row-config="{ keyField: 'id' }" :custom-config="{ mode: 'popup' }" :data="list"> }" :row-config="{ keyField: 'id' }" :custom-config="{ mode: 'popup' }" :data="list">
<vxe-column type="checkbox" width="50" align="center"></vxe-column> <vxe-column type="checkbox" width="50" align="center"></vxe-column>
<vxe-column title="本次报销数量" width="120" align="center" field="payNum"> <vxe-column title="本次报销数量" width="120" align="center" field="payNum">
<template #default="{ row }"> <template #default="{ row }">
<vxe-number-input v-if="parseFloat(row.hasPayNum) < parseFloat(row.num)" v-model="row.payNum" placeholder="数量"></vxe-number-input> <vxe-number-input v-if="parseFloat(row.hasPayNum) < parseFloat(row.num)" v-model="row.payNum"
<div v-else>-</div> placeholder="数量"></vxe-number-input>
<div v-else>-</div>
</template> </template>
</vxe-column> </vxe-column>
<vxe-column title="已报销数量" width="100" align="center" field="hasPayNum"> <vxe-column title="已报销数量" width="100" align="center" field="hasPayNum">
@ -68,20 +164,19 @@
<el-button type="primary" size="small" @click="submit"> <i class="el-icon-arrow-right"></i> </el-button> <el-button type="primary" size="small" @click="submit"> <i class="el-icon-arrow-right"></i> </el-button>
</div> </div>
</template> </template>
</vxe-modal> </vxe-modal>
<!-- <Modal <vxe-modal
:width="86"
class-name="oa-modal"
title="流程办理"
fullscreen fullscreen
:mask-closable="false" :remember="true"
class-name="oa-modal"
title="流程查看"
v-model="isShowOaModal" v-model="isShowOaModal"
footer-hide :z-index="zIndex+100"
> >
<div style="width: 100%;height: 100%;"> <div style="width: 100%;height: 100%;">
<iframe style="width: 100%;height: 100%;border-radius: 0 0 6px 6px;" :src="oaUrl" frameborder="0"></iframe> <iframe style="width: 100%;height: 100%;border-radius: 0 0 6px 6px;" :src="oaUrl" frameborder="0"></iframe>
</div> </div>
</Modal> --> </vxe-modal>
</div> </div>
</template> </template>
@ -93,7 +188,8 @@
import { import {
getItems, getItems,
detailContract, detailContract,
getFundLog getFundLog,
fundLogEnd
} from '@/api/flow/pay' } from '@/api/flow/pay'
import { import {
PopupManager PopupManager
@ -101,7 +197,7 @@
import { import {
defaultModalSize defaultModalSize
} from "@/settings"; } from "@/settings";
import {getToken} from "@/utils/auth";
export default { export default {
props: { props: {
isShow: { isShow: {
@ -117,15 +213,21 @@
zIndex: PopupManager.nextZIndex(), zIndex: PopupManager.nextZIndex(),
list: [], list: [],
table_item: [], table_item: [],
flowDetail: {}, flowDetail: {},
fundlogForm:{ fundlogForm: {
applyMoney:0, applyMoney: 0,
type:'', type: '',
isLast:false, isLast: false,
}, },
paymentType: ["进度款", "结算款", "质保金"], paymentType: ["进度款", "结算款", "质保金"],
oaUrl:'', oaUrl: '',
isShowOaModal:false, isShowOaModal: false,
paymentsList: [],
flowStatus: {
'-1': '已退回',
'0': '办理中',
'1': '已完成'
}
} }
}, },
methods: { methods: {
@ -151,13 +253,14 @@
// //
this.list = JSON.parse(data[field.name]) this.list = JSON.parse(data[field.name])
this.list.map(item => { this.list.map(item => {
item.payNum = 0 item.payNum = 0
item.hasPayNum = 0 item.hasPayNum = 0
}) })
this.getItemNum(this.payId) this.getItemNum(this.payId)
this.getFieldConfig(field.sub_custom_model_id) this.getFieldConfig(field.sub_custom_model_id)
} }
}); });
this.getFundLogList()
console.log("this.list", this.list) console.log("this.list", this.list)
loading.close(); loading.close();
} catch (err) { } catch (err) {
@ -166,6 +269,18 @@
loading.close(); loading.close();
} }
}, },
//
async getFundLogList() {
let payments =
(
await getFundLog({
contract_id: this.flowDetail.out_contract_id,
show_type: 1
})
)?.data || [];
this.paymentsList = payments
console.log("paymentsList", this.paymentsList)
},
// //
async getFieldConfig(id) { async getFieldConfig(id) {
try { try {
@ -177,8 +292,8 @@
label: field.label, label: field.label,
prop: field.name prop: field.name
}) })
}); });
} catch (err) { } catch (err) {
console.error(err) console.error(err)
@ -190,46 +305,73 @@
try { try {
const item = await getItems({ const item = await getItems({
flow_id: id flow_id: id
}) })
console.log("item",item) console.log("item", item)
if(item.length>0){ if (item.length > 0) {
const itemMap = new Map(); const itemMap = new Map();
item.forEach(item => { item.forEach(item => {
itemMap.set(item.wuzicaigou_item_id, item.total_num); itemMap.set(item.wuzicaigou_item_id, item.total_num);
}); });
// list id Map total_num hasPayNum // list id Map total_num hasPayNum
this.list.forEach(item => { this.list.forEach(item => {
if (itemMap.has(item.id)) { if (itemMap.has(item.id)) {
item.hasPayNum = itemMap.get(item.id); item.hasPayNum = itemMap.get(item.id);
} }
}); });
} }
} catch (err) { } catch (err) {
console.error(err) console.error(err)
} }
},
showDetail(row){
let url = `/oa/#/flow/detail?module_name=oa&auth_token=${window.encodeURIComponent(getToken())}&isSinglePage=1&flow_id=`
let pay = row.fund_log_flow_links.find(i => i.tag === 'pay')
//url += `&to=/flow/detail?flow_id=${caigou.id}`
url += pay?.flow_id
this.oaUrl = url
this.isShowOaModal = true
},
payClose(){
this.$confirm('将此采购记录设为“已⽀付完毕”,同时会将最后⼀笔⽀付记录的“是否为最后⼀笔”属性设置为“是”,请确认是否要进⾏此操作', '提示', {
confirmButtonText: '确定',
callback: action => {
if(action==='confirm'){
fundLogEnd({
contract_id:this.flowDetail.out_contract_id,
}).then(res=>{
this.$emit('update:isShow', false)
this.$emit('refresh')
})
}
// this.fundlogForm.isLast = true
}
});
}, },
async submit() { async submit() {
try { try {
if(!this.fundlogForm.applyMoney){ if (!this.fundlogForm.applyMoney) {
this.$message({ this.$message({
message: '请填写本次申请付款金额', message: '请填写本次申请付款金额',
duration: 2000, duration: 2000,
type: 'warning' type: 'warning'
}) })
return return
} }
if(!this.fundlogForm.type){ if (!this.fundlogForm.type) {
this.$message({ this.$message({
message: '请选择款项类型', message: '请选择款项类型',
duration: 2000, duration: 2000,
type: 'warning' type: 'warning'
}) })
return return
} }
const records = this.$refs.table.getCheckboxRecords() const records = this.$refs.table.getCheckboxRecords()
console.log("records", records) console.log("records", records)
let count = 0 let count = 0
let totalCount = 0 let totalCount = 0
let allCount = 0 // + =
if (records.length < 1) { if (records.length < 1) {
this.$message({ this.$message({
message: '请选择需要报销的明细', message: '请选择需要报销的明细',
@ -241,9 +383,12 @@
records.map(item => { records.map(item => {
if (parseFloat(item.payNum) === 0 || parseFloat(item.payNum) > parseFloat(item.num)) { if (parseFloat(item.payNum) === 0 || parseFloat(item.payNum) > parseFloat(item.num)) {
count++ count++
} }
if(parseFloat(item.payNum)+parseFloat(item.hasPayNum) > parseFloat(item.num)){ if (parseFloat(item.payNum) + parseFloat(item.hasPayNum) > parseFloat(item.num)) {
totalCount++ totalCount++
}
if (parseFloat(item.payNum) + parseFloat(item.hasPayNum) === parseFloat(item.num)) {
allCount++
} }
}) })
if (count > 0) { if (count > 0) {
@ -253,32 +398,41 @@
type: 'warning' type: 'warning'
}) })
return return
} }
if (totalCount > 0) { if (totalCount > 0) {
this.$message({ this.$message({
message: '本次报销数量大于剩余可报销数量', message: '本次报销数量大于剩余可报销数量',
duration: 2000, duration: 2000,
type: 'warning' type: 'warning'
}) })
return return
} }
//wuzicaigou_items if (allCount === records.length) {
let wuzicaigou_items = [] this.$alert('本次报销数量已等于总数量,默认为最后一笔', '提示', {
let zhifutitle = '' confirmButtonText: '确定',
records.map(item=>{ callback: action => {
wuzicaigou_items.push({ this.fundlogForm.isLast = true
flow_id:this.payId, }
wuzicaigou_id:item.belongs_id, });
wuzicaigou_item_id:item.id, }
name:item.pinminghuofuwuxuqiu, // return
num:item.payNum, //wuzicaigou_items
total:item.num let wuzicaigou_items = []
}) let zhifutitle = ''
zhifutitle+= item.pinminghuofuwuxuqiu+'*'+item.payNum+',' records.map(item => {
}) wuzicaigou_items.push({
flow_id: this.payId,
wuzicaigou_id: item.belongs_id,
wuzicaigou_item_id: item.id,
name: item.pinminghuofuwuxuqiu,
num: item.payNum,
total: item.num
})
zhifutitle += item.pinminghuofuwuxuqiu + '*' + item.payNum + ','
})
// //
let payments = []; let payments = this.paymentsList;
const actNumsTotal = () => { const actNumsTotal = () => {
return payments.reduce((pre, cur) => { return payments.reduce((pre, cur) => {
return pre + (!!Number(cur.act_money) ? Number(cur.act_money) : 0); return pre + (!!Number(cur.act_money) ? Number(cur.act_money) : 0);
@ -291,45 +445,45 @@
}); });
} }
payments = // payments = this.paymentsList
( // (
await getFundLog({ // await getFundLog({
contract_id: this.flowDetail.out_contract_id, // contract_id: this.flowDetail.out_contract_id,
show_type: 1 // show_type: 1
}) // })
)?.data || []; // )?.data || [];
// //
let zhifutitle2 = zhifutitle.slice(0,-1) let zhifutitle2 = zhifutitle.slice(0, -1)
zhifutitle += ""+this.flowDetail.title+'' zhifutitle += "" + this.flowDetail.title + ''
let baseInfo = { let baseInfo = {
"oaUrl": contract?.number, "oaUrl": contract?.number,
"zhifutitle": zhifutitle, "zhifutitle": zhifutitle,
// ?contract?.name
// ?contract?.name "contract_id": contract.id,
"contract_id":contract.id, "type": this.fundlogForm.type,
"type":this.fundlogForm.type, "is_end": this.fundlogForm.isLast ? 1 : 0,
"is_end":this.fundlogForm.isLast ? 1 : 0, "amt": this.fundlogForm.applyMoney,
"amt": this.fundlogForm.applyMoney, // out_pay_id: row?.id,
// out_pay_id: row?.id, "xiangxishuoming": zhifutitle,
"xiangxishuoming": zhifutitle, "yifujine": actNumsTotal(),
"yifujine": actNumsTotal(), "xiangmuzonge": contract.money,
"xiangmuzonge": contract.money, "zhifucishu": contract?.sign_plan?.length,
"zhifucishu": contract?.sign_plan?.length, "cishu": payments.length,
"cishu": payments.length,
"liezhiqudao": contract?.plans.map(i => i.name)?.toString(), "liezhiqudao": contract?.plans.map(i => i.name)?.toString(),
"contractno": contract?.number, "contractno": contract?.number,
"guanlianliucheng": contract?.contract_flow_links?.map(i => i.flow_id)?.toString(), "guanlianliucheng": contract?.contract_flow_links?.map(i => i.flow_id)?.toString(),
"wuzicaigou_items":wuzicaigou_items "wuzicaigou_items": wuzicaigou_items
}; };
console.log(baseInfo,baseInfo) console.log(baseInfo, baseInfo)
let url = `/flow/create?&module_name=oa&isSinglePage=1&module_id=75&default_json=${window.encodeURIComponent(JSON.stringify(baseInfo))}`; let url =
this.$router.push( `/flow/create?&module_name=oa&isSinglePage=1&module_id=75&default_json=${window.encodeURIComponent(JSON.stringify(baseInfo))}`;
url this.$router.push(
); url
// this.oaUrl = url; );
// this.isShowOaModal = true; // this.oaUrl = url;
this.$emit('update:isShow',false) // this.isShowOaModal = true;
this.$emit('update:isShow', false)
} catch (err) { } catch (err) {
console.error(err) console.error(err)
} }
@ -346,17 +500,18 @@
} }
} else { } else {
this.list = [] this.list = []
this.payId = '' this.payId = ''
this.oaUrl = '' this.oaUrl = ''
this.isShowOaModal = false this.isShowOaModal = false
this.table_item = [] this.table_item = []
this.flowDetail = {} this.paymentsList = []
this.fundlogForm = { this.flowDetail = {}
applyMoney:0, this.fundlogForm = {
type:'', applyMoney: 0,
isLast:false, type: '',
} isLast: false,
}
this.$refs.table.clearCheckboxRow() this.$refs.table.clearCheckboxRow()
} }
} }

@ -491,7 +491,7 @@
>删除</el-button >删除</el-button
> >
<el-button <el-button
v-if="$route.params.type === 'handled' && row.custom_model_id===99 && row.status===1" v-if="$route.params.type === 'handled' && row.custom_model_id===99 && row.status===1 && row.fund_log_is_end===0"
type="primary" type="primary"
size="mini" size="mini"
@click="toOutPay(row)" @click="toOutPay(row)"
@ -542,7 +542,7 @@
</el-card> </el-card>
<share ref="share" :is-show.sync="isShowShare" :flow="pickedFlow"></share> <share ref="share" :is-show.sync="isShowShare" :flow="pickedFlow"></share>
<payMx ref="payMx" :is-show.sync="isShowPay" ></payMx> <payMx ref="payMx" :is-show.sync="isShowPay" @refresh="getList"></payMx>
<list-popover :is-show.sync="isShowListPopover" :id="listPopoverId" :pos="listPopoverPos" /> <list-popover :is-show.sync="isShowListPopover" :id="listPopoverId" :pos="listPopoverPos" />
<multi-deal :is-show.sync="isShowMultiDeal" :deal-flows="multiDealFlows" @refresh="getList" /> <multi-deal :is-show.sync="isShowMultiDeal" :deal-flows="multiDealFlows" @refresh="getList" />
<field-export ref="isShowFieldExport" :is-show.sync="isShowFieldExport" :select="select" /> <field-export ref="isShowFieldExport" :is-show.sync="isShowFieldExport" :select="select" />

Loading…
Cancel
Save