作者端预接收按钮
This commit is contained in:
@@ -995,8 +995,8 @@ colTitle: 'Template title',
|
|||||||
step3: 'References',
|
step3: 'References',
|
||||||
step: 'step',
|
step: 'step',
|
||||||
Information: 'Fill in information',
|
Information: 'Fill in information',
|
||||||
|
startPreAccept: 'Start the pre-acceptance process',
|
||||||
|
startPreAcceptWithPayment: 'Start the pre-acceptance process and complete your payment',
|
||||||
},
|
},
|
||||||
Formula: {
|
Formula: {
|
||||||
FormulaTemplate: 'Formula Template'
|
FormulaTemplate: 'Formula Template'
|
||||||
|
|||||||
@@ -984,8 +984,8 @@ const zh = {
|
|||||||
step3: '参考',
|
step3: '参考',
|
||||||
step: 'step',
|
step: 'step',
|
||||||
Information: 'Fill in information',
|
Information: 'Fill in information',
|
||||||
|
startPreAccept: '开始预接收流程',
|
||||||
|
startPreAcceptWithPayment: '开始预接收流程并完成支付',
|
||||||
},
|
},
|
||||||
Formula:{
|
Formula:{
|
||||||
FormulaTemplate:'公式模版'
|
FormulaTemplate:'公式模版'
|
||||||
|
|||||||
@@ -107,11 +107,11 @@
|
|||||||
</span>
|
</span>
|
||||||
|
|
||||||
|
|
||||||
<span v-if="item.state == 6" style="text-decoration: none;margin-left: 20px;">
|
<span v-if="item.state == 6 && preAcceptButtonReady(item)" style="text-decoration: none;margin-left: 20px;">
|
||||||
|
|
||||||
<span @click="goPre_ingested(item.article_id)" class="preButton">
|
<span @click="goPre_ingested(item.article_id)" class="preButton">
|
||||||
<!-- <el-badge is-dot class="item" > -->
|
<!-- <el-badge is-dot class="item" > -->
|
||||||
<i class="el-icon-bank-card"></i>Start the pre-acceptance process and complete your payment
|
<i class="el-icon-bank-card"></i>{{ preAcceptEntryButtonText(item) }}
|
||||||
<!-- </el-badge> -->
|
<!-- </el-badge> -->
|
||||||
</span>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
@@ -539,6 +539,61 @@
|
|||||||
this.getdate();
|
this.getdate();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
/** 与 Complete_profile.vue getDetail 中订单/支付展示逻辑一致:preOrderDetail → is_buy、期刊费、折后费、isFree */
|
||||||
|
_feeNum(v) {
|
||||||
|
if (v == null || v === '') return 0;
|
||||||
|
const n = Number(String(v).replace(/,/g, ''));
|
||||||
|
return Number.isFinite(n) ? n : 0;
|
||||||
|
},
|
||||||
|
computePreacceptShortButton(articleInfo, journalInfo) {
|
||||||
|
if (!articleInfo || !journalInfo) return false;
|
||||||
|
const journalFee = journalInfo.fee;
|
||||||
|
const articleFee = articleInfo.fee;
|
||||||
|
const isBuy = Number(articleInfo.is_buy) === 1;
|
||||||
|
const tableFee = journalFee ? this._feeNum(articleFee) : 0;
|
||||||
|
const isFree = isBuy && tableFee === 0;
|
||||||
|
const noJournalFee = !journalFee || this._feeNum(journalFee) === 0 || String(journalFee) === '0.00';
|
||||||
|
// Complete_profile: active=1 当已付,或 未付但期刊无 APC
|
||||||
|
if (isFree) return true;
|
||||||
|
if (isBuy) return true;
|
||||||
|
if (!isBuy && noJournalFee) return true;
|
||||||
|
return false;
|
||||||
|
},
|
||||||
|
preAcceptButtonReady(item) {
|
||||||
|
const p = item._preacceptPay;
|
||||||
|
return !!(p && p.loading === false);
|
||||||
|
},
|
||||||
|
async hydratePreacceptPaymentForList(rows) {
|
||||||
|
if (!rows || !rows.length) return;
|
||||||
|
const targets = rows.filter((r) => Number(r.state) === 6);
|
||||||
|
await Promise.all(
|
||||||
|
targets.map(async (row) => {
|
||||||
|
try {
|
||||||
|
const res = await this.$api.post('api/Order/preOrderDetail', {
|
||||||
|
article_id: row.article_id
|
||||||
|
});
|
||||||
|
if (res && Number(res.code) === 0) {
|
||||||
|
const article = res.data.article_detail || {};
|
||||||
|
const journal = res.data.journal_detail || {};
|
||||||
|
const shortButton = this.computePreacceptShortButton(article, journal);
|
||||||
|
this.$set(row, '_preacceptPay', { loading: false, shortButton });
|
||||||
|
} else {
|
||||||
|
this.$set(row, '_preacceptPay', { loading: false, shortButton: false });
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
console.error(e);
|
||||||
|
this.$set(row, '_preacceptPay', { loading: false, shortButton: false });
|
||||||
|
}
|
||||||
|
})
|
||||||
|
);
|
||||||
|
},
|
||||||
|
preAcceptEntryButtonText(item) {
|
||||||
|
const pay = item._preacceptPay;
|
||||||
|
if (!pay || pay.loading) return '';
|
||||||
|
return pay.shortButton
|
||||||
|
? this.$t('PreAccept.startPreAccept')
|
||||||
|
: this.$t('PreAccept.startPreAcceptWithPayment');
|
||||||
|
},
|
||||||
formatToHtml(val) {
|
formatToHtml(val) {
|
||||||
|
|
||||||
if (!val) return '';
|
if (!val) return '';
|
||||||
@@ -612,8 +667,12 @@ return processedText;
|
|||||||
1 + '-';
|
1 + '-';
|
||||||
let D = date.getDate() < 10 ? '0' + date.getDate() : date.getDate();
|
let D = date.getDate() < 10 ? '0' + date.getDate() : date.getDate();
|
||||||
res.data[i].ctime = Y + M + D;
|
res.data[i].ctime = Y + M + D;
|
||||||
|
if (Number(res.data[i].state) === 6) {
|
||||||
|
this.$set(res.data[i], '_preacceptPay', { loading: true, shortButton: false });
|
||||||
|
}
|
||||||
}
|
}
|
||||||
this.tableData = res.data
|
this.tableData = res.data;
|
||||||
|
this.hydratePreacceptPaymentForList(res.data);
|
||||||
})
|
})
|
||||||
.catch(err => {
|
.catch(err => {
|
||||||
console.log(err);
|
console.log(err);
|
||||||
|
|||||||
Reference in New Issue
Block a user