流程间接关联支付未展示问题修复,打印流程出现上传文件控件问题修复

master
weizong song 2 weeks ago
parent 0eadaa96ab
commit 00b4687091

@ -1,5 +1,13 @@
import store from '@/store'
import moment from 'moment'
function sanitizePrintFieldHtml(html) {
const wrapper = document.createElement('div')
wrapper.innerHTML = html || ''
wrapper.querySelectorAll('input[type="file"], .el-upload__input').forEach(el => el.remove())
return wrapper.innerHTML
}
/**
* @param{string} printJs 打印模版
* @param{boolean} isLog 是否带审批
@ -78,7 +86,7 @@ export async function print(printJs, isLog, form, logContent) {
printStr = printStr.replace(fieldMath,subFormBody)
// console.log(fieldMath, printStr)
} else {
printStr = printStr.replace(fieldMath,`<span>${value}</span>`)
printStr = printStr.replace(fieldMath,`<span>${sanitizePrintFieldHtml(value)}</span>`)
}
}
} else {

@ -507,7 +507,8 @@ export default {
try {
await this.getFlows();
const res = await getInfo()
this.usualFlows = res.quick_enter?res.quick_enter:[]
const quickEnterIds = this.normalizeQuickEnter(res.quick_enter)
this.usualFlows = this.flows.filter(flow => quickEnterIds.includes(Number(flow.id)))
// const res = await configIndex({
// filter: [
// {
@ -533,16 +534,27 @@ export default {
console.error(err);
}
},
normalizeQuickEnter(quickEnter) {
if (!quickEnter) return []
if (!Array.isArray(quickEnter)) return []
return quickEnter.map(item => {
if (item && typeof item === 'object') {
return Number(item.id)
}
return Number(item)
}).filter(id => Number.isInteger(id) && id > 0)
},
openQucik(){
const quickEnterIds = this.normalizeQuickEnter(this.usualFlows)
this.flows.map(flow => {
const isChecked = this.usualFlows.some(usualFlow => usualFlow.id === flow.id);
const isChecked = quickEnterIds.includes(Number(flow.id));
flow.checked = isChecked
});
this.isShowQuick = true
},
updatequick(){
this.quickLoading = true
let arr = this.flows.filter((i)=> i.checked===true)
let arr = this.flows.filter((i)=> i.checked===true).map(i => Number(i.id))
saveMyself({
quick_enter:arr
}).then(res=>{

@ -2281,25 +2281,30 @@ export default {
//
async loadRelatedPayments() {
if (!this.$route.query.flow_id) {
return;
return
}
this.loadingPayments = true;
try {
// request.js res.data payment null
const payment = await getPaymentsByFlowId(this.$route.query.flow_id, { all: true });
// (null)
if (payment) {
// request.js res.data
const result = await getPaymentsByFlowId(this.$route.query.flow_id, { all: true })
const payments = Array.isArray(result) ? result : (result ? [result] : [])
if (payments.length > 0) {
// breadcrumb
if (payment.payment_type_info && payment.payment_type_info.breadcrumb) {
const bc = payment.payment_type_info.breadcrumb;
payments.forEach((payment) => {
if (!payment.payment_type_info || !payment.payment_type_info.breadcrumb) {
return
}
const bc = payment.payment_type_info.breadcrumb
if (Array.isArray(bc)) {
payment.payment_type_info.breadcrumb = bc;
payment.payment_type_info.breadcrumb = bc
} else if (typeof bc === 'string') {
payment.payment_type_info.breadcrumb = bc.split(/\s*>\s*|\s*\/\s*/).filter(Boolean);
payment.payment_type_info.breadcrumb = bc.split(/\s*>\s*|\s*\/\s*/).filter(Boolean)
}
}
this.relatedPayments = [payment];
})
this.relatedPayments = payments
const payment = payments[0]
// fields
await this.loadPaymentTemplateElements(payment);

Loading…
Cancel
Save