|
@@ -34,6 +34,9 @@ const responseHandle = useResponseHandle();
|
|
|
const loading = ref(false);
|
|
|
const orderList = ref([]);
|
|
|
|
|
|
+//最大开票金额
|
|
|
+const denomination = ref(0);
|
|
|
+
|
|
|
const max = 150;
|
|
|
|
|
|
const initform = {
|
|
@@ -103,6 +106,7 @@ function generatorOrderArr() {
|
|
|
function handleSave() {
|
|
|
formRef.value.validate(async isValid => {
|
|
|
if (!isValid) return;
|
|
|
+
|
|
|
if (ruleForm.value.remark.length > 184) {
|
|
|
return ElMessage.error("发票备注不能超过184个字符");
|
|
|
}
|
|
@@ -111,6 +115,16 @@ function handleSave() {
|
|
|
return ElMessage.error(`订单数量不能超过${max}个`);
|
|
|
}
|
|
|
|
|
|
+ const { orderArr } = generatorOrderArr();
|
|
|
+ const total = orderArr.reduce(
|
|
|
+ (prev, { inv_fee }) => prev + Number(inv_fee),
|
|
|
+ 0
|
|
|
+ );
|
|
|
+
|
|
|
+ if (total > denomination.value) {
|
|
|
+ return ElMessage.error(`订单总金额超过最大开票面额`);
|
|
|
+ }
|
|
|
+
|
|
|
const { code, message } = await httpAdd({
|
|
|
...ruleForm.value,
|
|
|
...generatorOrderArr()
|
|
@@ -161,14 +175,17 @@ function handleInvoiceTitle(
|
|
|
invoiceTitle: Record<string, string>
|
|
|
) {
|
|
|
if (!invoiceTitle) {
|
|
|
- if (_isSeller) return (sellerInvoiceTitle.value = {});
|
|
|
+ if (_isSeller) {
|
|
|
+ return (sellerInvoiceTitle.value = {});
|
|
|
+ }
|
|
|
|
|
|
return (purchaserInvoiceTitle.value = {});
|
|
|
}
|
|
|
|
|
|
if (_isSeller) {
|
|
|
//支持的开票方式
|
|
|
- const { invoiceType } = invoiceTitle;
|
|
|
+ const { invoiceType, denomination: _denomination } = invoiceTitle;
|
|
|
+ denomination.value = Number(_denomination) * 10000;
|
|
|
const chunks = invoiceType.split(",");
|
|
|
ruleForm.value.invtype = "";
|
|
|
invoiceTypes.value = mapInvoiceType.filter(({ map_value }) =>
|