|
@@ -171,7 +171,7 @@
|
|
|
<el-form-item :prop="'purchaseProductList.' + $index + '.quantity'" :rules="rules.quantity" :inline-message="true"
|
|
|
class="margin-b-0 wid100">
|
|
|
<el-input-number onmousewheel="return false;" v-model="row.quantity" placeholder="请输入" style="width: 100%" :precision="0"
|
|
|
- :controls="false" :min="0" @change="calculationAmount('quantity')" />
|
|
|
+ :controls="false" :min="0" @change="calculationAmount()" />
|
|
|
</el-form-item>
|
|
|
</div>
|
|
|
</template>
|
|
@@ -182,7 +182,7 @@
|
|
|
<el-form-item :prop="'purchaseProductList.' + $index + '.price'" :rules="rules.price" :inline-message="true"
|
|
|
class="margin-b-0 wid100">
|
|
|
<div style="display:flex;">
|
|
|
- <el-input-number onmousewheel="return false;" v-model="row.price" placeholder="请输入" style="width: 100%" :precision="2"
|
|
|
+ <el-input-number onmousewheel="return false;" v-model="row.price" placeholder="请输入" style="width: 100%" :precision="4"
|
|
|
:controls="false" :min="0" @change="calculationAmount()" />
|
|
|
<el-popover placement="top-start" :width="400" trigger="hover" @show="showEcharts(row,$index)">
|
|
|
<template #default>
|
|
@@ -241,8 +241,8 @@
|
|
|
<div style="width: 100%">
|
|
|
<el-form-item :prop="'purchaseProductList.' + $index + '.price'" :rules="rules.price" :inline-message="true"
|
|
|
class="margin-b-0 wid100">
|
|
|
- <el-input-number onmousewheel="return false;" v-model="row.price" placeholder="请输入" style="width: 100%" :precision="2"
|
|
|
- :controls="false" :min="0" @change="calculationAmount()" />
|
|
|
+ <el-input-number onmousewheel="return false;" v-model="row.price" placeholder="请输入" style="width: 100%" :precision="4"
|
|
|
+ :controls="false" :min="0" @change="calculationAmount(true)" />
|
|
|
</el-form-item>
|
|
|
</div>
|
|
|
</template>
|
|
@@ -252,7 +252,7 @@
|
|
|
<div style="width: 100%">
|
|
|
<el-form-item :prop="'purchaseProductList.' + $index + '.priceIncludingTax'" :rules="rules.priceIncludingTax" :inline-message="true"
|
|
|
class="margin-b-0 wid100">
|
|
|
- <el-input-number onmousewheel="return false;" v-model="row.priceIncludingTax" placeholder="请输入" style="width: 100%" :precision="2"
|
|
|
+ <el-input-number onmousewheel="return false;" v-model="row.priceIncludingTax" placeholder="请输入" style="width: 100%" :precision="4"
|
|
|
:controls="false" :min="0" @change="calculationAmount()" disabled />
|
|
|
</el-form-item>
|
|
|
</div>
|
|
@@ -298,7 +298,7 @@
|
|
|
<div style="width: 100%">
|
|
|
<el-form-item :prop="'purchaseProjectList.' + $index + '.amount'" :rules="rules.amount" :inline-message="true"
|
|
|
class="margin-b-0 wid100">
|
|
|
- <el-input-number onmousewheel="return false;" v-model="row.amount" placeholder="请输入金额" style="width: 100%" :precision="2"
|
|
|
+ <el-input-number onmousewheel="return false;" v-model="row.amount" placeholder="请输入金额" style="width: 100%" :precision="4"
|
|
|
:controls="false" :min="0" @change="totalAmount()" />
|
|
|
</el-form-item>
|
|
|
</div>
|
|
@@ -360,6 +360,12 @@ const shippingMethod = computed(
|
|
|
const frontLinesData = computed(
|
|
|
() => proxy.useUserStore().allDict["front_lines"]
|
|
|
);
|
|
|
+const supplierShippingMethod = computed(
|
|
|
+ () => proxy.useUserStore().allDict["supplier_shipping_method"]
|
|
|
+);
|
|
|
+const supplierPaymentMethod = computed(
|
|
|
+ () => proxy.useUserStore().allDict["supplier_payment_method"]
|
|
|
+);
|
|
|
// const companyId = computed(() => proxy.useUserStore().user.companyId);
|
|
|
const deliveryType = ref([
|
|
|
{
|
|
@@ -602,6 +608,44 @@ const formConfig = computed(() => {
|
|
|
placeholder: " ",
|
|
|
},
|
|
|
{
|
|
|
+ type: "select",
|
|
|
+ prop: "deliverMethod",
|
|
|
+ label: "发货方式",
|
|
|
+ required: true,
|
|
|
+ filterable: true,
|
|
|
+ data: supplierShippingMethod.value,
|
|
|
+ itemWidth: 33.33,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: "select",
|
|
|
+ prop: "paymentMethod",
|
|
|
+ label: "付款方式",
|
|
|
+ required: true,
|
|
|
+ filterable: true,
|
|
|
+ data: supplierPaymentMethod.value,
|
|
|
+ itemWidth: 33.33,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: "radio",
|
|
|
+ prop: "taxPointMode",
|
|
|
+ label: "税点模式",
|
|
|
+ border: true,
|
|
|
+ data: [
|
|
|
+ {
|
|
|
+ label: "1+税点",
|
|
|
+ value: "1",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "1-税点",
|
|
|
+ value: "2",
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ itemWidth: 33.33,
|
|
|
+ fn: (val) => {
|
|
|
+ calculationAmount(true);
|
|
|
+ },
|
|
|
+ },
|
|
|
+ {
|
|
|
type: "upload",
|
|
|
listType: "text",
|
|
|
accept: "",
|
|
@@ -973,7 +1017,30 @@ const changeSupplierPrice = (val) => {
|
|
|
for (const key in res) {
|
|
|
if (e.productId === key && res[key]) {
|
|
|
e.price = Number(res[key].price);
|
|
|
- e.priceIncludingTax = Number(res[key].includingTaxPrice);
|
|
|
+ // e.priceIncludingTax = Number(res[key].includingTaxPrice);
|
|
|
+ if (formData.data.taxPointMode == "1") {
|
|
|
+ e.priceIncludingTax = Number(
|
|
|
+ parseFloat(
|
|
|
+ e.price *
|
|
|
+ Number(
|
|
|
+ parseFloat(
|
|
|
+ 1 + Number(formData.data.supplierTaxPoints) / 100
|
|
|
+ ).toFixed(4)
|
|
|
+ )
|
|
|
+ ).toFixed(4)
|
|
|
+ );
|
|
|
+ } else {
|
|
|
+ e.priceIncludingTax = Number(
|
|
|
+ parseFloat(
|
|
|
+ e.price /
|
|
|
+ Number(
|
|
|
+ parseFloat(
|
|
|
+ 1 - Number(formData.data.supplierTaxPoints) / 100
|
|
|
+ ).toFixed(4)
|
|
|
+ )
|
|
|
+ ).toFixed(4)
|
|
|
+ );
|
|
|
+ }
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
@@ -986,10 +1053,6 @@ const changeSupplierPrice = (val) => {
|
|
|
const changeSupplier = (val) => {
|
|
|
// 产品价格趋势
|
|
|
changeProductPrice();
|
|
|
- // 供应价格
|
|
|
- if (route.query.dataType == 1) {
|
|
|
- changeSupplierPrice(val);
|
|
|
- }
|
|
|
|
|
|
formData.data.countryId = "";
|
|
|
formData.data.provinceId = "";
|
|
@@ -1015,6 +1078,10 @@ const changeSupplier = (val) => {
|
|
|
setTimeout(() => changeAddress(), 1500);
|
|
|
formData.data.supplierIncludingTax = res.privIncludingTax;
|
|
|
formData.data.supplierTaxPoints = res.privTaxPoints;
|
|
|
+ formData.data.deliverMethod = res.deliverMethod;
|
|
|
+ formData.data.paymentMethod = res.paymentMethod;
|
|
|
+ // 供应价格
|
|
|
+ changeSupplierPrice(val);
|
|
|
});
|
|
|
}
|
|
|
};
|
|
@@ -1076,20 +1143,42 @@ const handleRemove = (index) => {
|
|
|
totalAmount();
|
|
|
};
|
|
|
|
|
|
-const calculationAmount = () => {
|
|
|
+const calculationAmount = (flag = false) => {
|
|
|
if (
|
|
|
formData.data.purchaseProductList &&
|
|
|
formData.data.purchaseProductList.length > 0
|
|
|
) {
|
|
|
for (let i = 0; i < formData.data.purchaseProductList.length; i++) {
|
|
|
- formData.data.purchaseProductList[i].amount = parseFloat(
|
|
|
- Number(formData.data.purchaseProductList[i].quantity) *
|
|
|
- Number(formData.data.purchaseProductList[i].price)
|
|
|
- ).toFixed(2);
|
|
|
- formData.data.purchaseProductList[i].amountIncludingTax = parseFloat(
|
|
|
- Number(formData.data.purchaseProductList[i].quantity) *
|
|
|
- Number(formData.data.purchaseProductList[i].priceIncludingTax)
|
|
|
- ).toFixed(2);
|
|
|
+ let e = formData.data.purchaseProductList[i];
|
|
|
+ if (flag) {
|
|
|
+ if (formData.data.taxPointMode == "1") {
|
|
|
+ e.priceIncludingTax = Number(
|
|
|
+ parseFloat(
|
|
|
+ e.price *
|
|
|
+ Number(
|
|
|
+ parseFloat(
|
|
|
+ 1 + Number(formData.data.supplierTaxPoints) / 100
|
|
|
+ ).toFixed(4)
|
|
|
+ )
|
|
|
+ ).toFixed(4)
|
|
|
+ );
|
|
|
+ } else {
|
|
|
+ e.priceIncludingTax = Number(
|
|
|
+ parseFloat(
|
|
|
+ e.price /
|
|
|
+ Number(
|
|
|
+ parseFloat(
|
|
|
+ 1 - Number(formData.data.supplierTaxPoints) / 100
|
|
|
+ ).toFixed(4)
|
|
|
+ )
|
|
|
+ ).toFixed(4)
|
|
|
+ );
|
|
|
+ }
|
|
|
+ }
|
|
|
+ e.amount = parseFloat(Number(e.quantity) * Number(e.price)).toFixed(4);
|
|
|
+ e.amountIncludingTax = parseFloat(
|
|
|
+ Number(e.quantity) * Number(e.priceIncludingTax)
|
|
|
+ ).toFixed(4);
|
|
|
}
|
|
|
}
|
|
|
totalAmount();
|
|
@@ -1104,16 +1193,14 @@ const totalAmount = () => {
|
|
|
formData.data.purchaseProductList.length > 0
|
|
|
) {
|
|
|
for (let i = 0; i < formData.data.purchaseProductList.length; i++) {
|
|
|
- if (formData.data.purchaseProductList[i].amount) {
|
|
|
- money = parseFloat(
|
|
|
- Number(money) + Number(formData.data.purchaseProductList[i].amount)
|
|
|
- ).toFixed(2);
|
|
|
+ const row = formData.data.purchaseProductList[i];
|
|
|
+ if (row.amount) {
|
|
|
+ money = parseFloat(Number(money) + Number(row.amount)).toFixed(4);
|
|
|
}
|
|
|
- if (formData.data.purchaseProductList[i].amountIncludingTax) {
|
|
|
+ if (row.amountIncludingTax) {
|
|
|
moneyTwo = parseFloat(
|
|
|
- Number(moneyTwo) +
|
|
|
- Number(formData.data.purchaseProductList[i].amountIncludingTax)
|
|
|
- ).toFixed(2);
|
|
|
+ Number(moneyTwo) + Number(row.amountIncludingTax)
|
|
|
+ ).toFixed(4);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -1122,10 +1209,9 @@ const totalAmount = () => {
|
|
|
formData.data.purchaseProjectList.length > 0
|
|
|
) {
|
|
|
for (let i = 0; i < formData.data.purchaseProjectList.length; i++) {
|
|
|
- if (formData.data.purchaseProjectList[i].amount) {
|
|
|
- money = parseFloat(
|
|
|
- Number(money) + Number(formData.data.purchaseProjectList[i].amount)
|
|
|
- ).toFixed(2);
|
|
|
+ const row = formData.data.purchaseProjectList[i];
|
|
|
+ if (row.amount) {
|
|
|
+ money = parseFloat(Number(money) + Number(row.amount)).toFixed(4);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -1186,7 +1272,10 @@ const remoteMethod = (keyword) => {
|
|
|
return;
|
|
|
};
|
|
|
|
|
|
-const handleSubmit = async () => {
|
|
|
+const handleSubmit = async (isStag = false) => {
|
|
|
+ if (isStag) {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
let flag = await formDom.value.handleSubmit(() => {});
|
|
|
if (flag) {
|
|
|
for (let i = 0; i < formData.data.purchaseProductList.length; i++) {
|
|
@@ -1299,6 +1388,7 @@ const getProductList = (ids) => {
|
|
|
formData.data.purchaseUserId =
|
|
|
res.subcribeUserId || proxy.useUserStore().user.userId;
|
|
|
formData.data.warehouseId = res.putWarehouseId;
|
|
|
+ formData.data.taxPointMode = "1";
|
|
|
|
|
|
let detailList = res.subscribeDetailList;
|
|
|
if (detailList && detailList.length > 0) {
|
|
@@ -1371,7 +1461,7 @@ onMounted(() => {
|
|
|
let ids = route.query.ids.split(",");
|
|
|
getProductList(ids);
|
|
|
}
|
|
|
- if (route.query.businessId && route.query.processType) {
|
|
|
+ if (route.query.businessId) {
|
|
|
getAllData(route.query.businessId);
|
|
|
}
|
|
|
});
|