|
@@ -142,7 +142,7 @@
|
|
|
</a-col>
|
|
|
<a-col :span="12">
|
|
|
<a-form-item label="折上折(double discount)" v-bind="validateInfos.doubleDiscount" id="SaleOrderForm-doubleDiscount" name="doubleDiscount">
|
|
|
- <a-input v-model:value="formData.doubleDiscount" placeholder="请输入折上折(double discount)" allow-clear AutoComplete="off"></a-input>
|
|
|
+ <a-input v-model:value="formData.doubleDiscount" placeholder="请输入折上折(double discount)" suffix="%" allow-clear AutoComplete="off" @change="changeDiscount"></a-input>
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
<a-col :span="12">
|
|
@@ -246,7 +246,6 @@
|
|
|
import { useUserStore } from '/@/store/modules/user';
|
|
|
import { ApiSelect, } from '/@/components/Form/index';
|
|
|
import moment from 'moment';
|
|
|
-import { InputNumberItem } from '/@/layouts/default/setting/components';
|
|
|
const useForm = Form.useForm;
|
|
|
export default defineComponent({
|
|
|
name: "SaleOrderForm",
|
|
@@ -528,7 +527,11 @@ import { InputNumberItem } from '/@/layouts/default/setting/components';
|
|
|
item.sourceId = item.childId
|
|
|
item.sourceType = 'Quo'+item.childId
|
|
|
item.taxPrice = item.salePrice
|
|
|
- item.discountedPrice = (Number(item.taxPrice) *(1-Number(item.discount)/100))
|
|
|
+ if(formData.doubleDiscount&&formData.doubleDiscount!==''){
|
|
|
+ item.discountedPrice = (Number(item.taxPrice) *(1-Number(item.discount)/100))
|
|
|
+ }else{
|
|
|
+ item.discountedPrice = Number(item.taxPrice)
|
|
|
+ }
|
|
|
item.discountedAmount =Number(item.discountedPrice) *Number(item.quantity)
|
|
|
item.discountedPrice = (item.discountedPrice).toFixed(2)
|
|
|
item.discountedAmount = (item.discountedAmount).toFixed(2)
|
|
@@ -555,6 +558,19 @@ import { InputNumberItem } from '/@/layouts/default/setting/components';
|
|
|
getShipList(data[0].headId,'quotation')
|
|
|
}
|
|
|
}
|
|
|
+ function changeDiscount(){
|
|
|
+ var detail =[...SaleOrderFormShipFormProductTable.dataSource]
|
|
|
+ detail.map(item=>{
|
|
|
+ if(formData.doubleDiscount&&formData.doubleDiscount!==''){
|
|
|
+ item.discountedPrice = ((Number(item.taxPrice) *(1-Number(formData.doubleDiscount)/100))).toFixed(2)
|
|
|
+ }else{
|
|
|
+ item.discountedPrice = Number(item.taxPrice)
|
|
|
+ }
|
|
|
+ item.discountedAmount =Number(item.discountedPrice) *Number(item.quantity)
|
|
|
+ item.discountedAmount = (item.discountedAmount).toFixed(2)
|
|
|
+ })
|
|
|
+ SaleOrderFormShipFormProductTable.dataSource=detail
|
|
|
+ }
|
|
|
function addContract(data){
|
|
|
var allDiscountPrice = 0
|
|
|
data.map(item=>{
|
|
@@ -562,7 +578,11 @@ import { InputNumberItem } from '/@/layouts/default/setting/components';
|
|
|
item.deliveryTime = formData.deliveryTime
|
|
|
item.sourceId = item.childId
|
|
|
item.sourceType = 'Con'+item.childId
|
|
|
- item.discountedPrice =Number(item.taxPrice)*(1-Number(item.discount)/100)
|
|
|
+ if(formData.doubleDiscount&&formData.doubleDiscount!==''){
|
|
|
+ item.discountedPrice = (Number(item.taxPrice) *(1-Number(item.discount)/100))
|
|
|
+ }else{
|
|
|
+ item.discountedPrice = Number(item.taxPrice)
|
|
|
+ }
|
|
|
item.discountedAmount =Number(item.discountedPrice) *Number(item.quantity)
|
|
|
item.discountedPrice = (item.discountedPrice).toFixed(2)
|
|
|
item.discountedAmount = (item.discountedAmount).toFixed(2)
|
|
@@ -683,7 +703,8 @@ import { InputNumberItem } from '/@/layouts/default/setting/components';
|
|
|
VersionDetail,
|
|
|
notAllowEdit,
|
|
|
ClassList,
|
|
|
- changeValues
|
|
|
+ changeValues,
|
|
|
+ changeDiscount
|
|
|
}
|
|
|
}
|
|
|
});
|