|
@@ -211,6 +211,7 @@
|
|
|
选择供应商询价单(select supplier inquiry form)</a-button
|
|
|
>
|
|
|
<a-button type="primary" @click="selectProducts" style="margin-right: 1%; margin-bottom: 1%"> 选择产品(select product)</a-button>
|
|
|
+ <a-button type="primary" @click="setDiscountForSonList" style="margin-right: 1%; margin-bottom: 1%"> 设置折扣(set discount)</a-button>
|
|
|
<j-vxe-table
|
|
|
:keep-source="true"
|
|
|
resizable
|
|
@@ -223,6 +224,7 @@
|
|
|
:rowNumber="true"
|
|
|
:rowSelection="true"
|
|
|
asyncRemove
|
|
|
+ @value-change="changeValues"
|
|
|
>
|
|
|
<template #action="props">
|
|
|
<a-popconfirm title="确定删除吗?" @confirm="handleDelete1(props)">
|
|
@@ -254,6 +256,7 @@
|
|
|
<SelectPrpductModal ref="SelectPrpductModalRef" @select-product="addProduct" />
|
|
|
<SelectProjectModal ref="SelectProjectModalRef" @select-project="addProject" />
|
|
|
<SelectSupplierInquiryModal ref="SelectSupplierInquiryModalRef" @select-customer-inquiry="addProductFromCustomer" />
|
|
|
+ <SetSonList ref="SetSonListRef" @success="setSonListFiled"></SetSonList>
|
|
|
</a-spin>
|
|
|
</template>
|
|
|
|
|
@@ -279,6 +282,7 @@
|
|
|
import JUpload from '/@/components/Form/src/jeecg/components/JUpload/JUpload.vue';
|
|
|
import { JDictSelectTag,ApiSelect,JSelect } from '/@/components/Form';
|
|
|
import JSelectInput from '/@/components/Form/src/jeecg/components/JSelectInput.vue';
|
|
|
+ import SetSonList from './SetSonList.vue';
|
|
|
import { Form, message } from 'ant-design-vue';
|
|
|
import moment from 'moment';
|
|
|
const useForm = Form.useForm;
|
|
@@ -295,7 +299,8 @@
|
|
|
JSelectInput,
|
|
|
SelectSupplierInquiryModal,
|
|
|
ApiSelect,
|
|
|
- JSelect
|
|
|
+ JSelect,
|
|
|
+ SetSonList
|
|
|
},
|
|
|
props: {
|
|
|
formDisabled: {
|
|
@@ -310,6 +315,7 @@
|
|
|
const loading = ref(false);
|
|
|
const formRef = ref();
|
|
|
var showField = ref('currency+name');
|
|
|
+ var SetSonListRef =ref();
|
|
|
var SelectPrpductModalRef = ref();
|
|
|
var SelectProjectModalRef = ref();
|
|
|
var SelectSupplierInquiryModalRef = ref();
|
|
@@ -608,6 +614,40 @@
|
|
|
formData.suppilerName = ''
|
|
|
}
|
|
|
}
|
|
|
+ function changeValues(prop){
|
|
|
+ if (prop.col.key == 'quantity'||prop.col.key == 'taxPriceOriginal') {
|
|
|
+ if (prop.row.quantity||prop.row.taxPriceOriginal) {
|
|
|
+ var num = Number(prop.row.quantity) * Number(prop.row.taxPriceOriginal)
|
|
|
+ prop.row.taxAmountOriginal = isNaN(num) ? '' : num.toFixed(2);
|
|
|
+ prop.row.discount = isNaN( prop.row.discount)?0:Number( prop.row.discount)
|
|
|
+ prop.row.taxPrice = (Number(prop.row.taxPriceOriginal)*(1-prop.row.discount/100)).toFixed(2)
|
|
|
+ prop.row.taxAmount = (Number(prop.row.taxPrice)*Number(prop.row.quantity)).toFixed(2)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (prop.col.key == 'discount') {
|
|
|
+ if (prop.row.discount||prop.row.taxPriceOriginal||prop.row.quantity) {
|
|
|
+ prop.row.taxPrice = (Number(prop.row.taxPriceOriginal)*(1-prop.row.discount/100)).toFixed(2)
|
|
|
+ prop.row.taxAmount = (Number(prop.row.taxPrice)*Number(prop.row.quantity)).toFixed(2)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ function setDiscountForSonList(){
|
|
|
+ SetSonListRef.value.getTable()
|
|
|
+ }
|
|
|
+ function setSonListFiled(value){
|
|
|
+ var xTable = (PuechaseQuotationFormProductTableRef.value!.getXTable()).data
|
|
|
+ if(xTable.length>0){
|
|
|
+ xTable.map(item=>{
|
|
|
+ item.discount = isNaN(value.numericalValue)?0:value.numericalValue
|
|
|
+ if (item.taxAmountOriginal) {
|
|
|
+ item.taxPrice = (Number(item.taxPriceOriginal)*(1-item.discount/100)).toFixed(2)
|
|
|
+ item.taxAmount = (Number(item.taxPrice)*Number(item.quantity)).toFixed(2)
|
|
|
+
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ PuechaseQuotationFormProductTable.dataSource =[...xTable]
|
|
|
+ }
|
|
|
return {
|
|
|
PuechaseQuotationFormShipTableRef,
|
|
|
PuechaseQuotationFormShipTable,
|
|
@@ -646,7 +686,11 @@
|
|
|
changeSupplier,
|
|
|
notAllowEdit,
|
|
|
ClassList,
|
|
|
- showField
|
|
|
+ showField,
|
|
|
+ changeValues,
|
|
|
+ setDiscountForSonList,
|
|
|
+ SetSonListRef,
|
|
|
+ setSonListFiled
|
|
|
};
|
|
|
},
|
|
|
});
|