|
@@ -222,7 +222,6 @@
|
|
|
var BaseShipArchiveAccessoriesListRef = ref();
|
|
|
const activeKey = ref('saleInvoiceDetails');
|
|
|
var notAllowEdit = ref(false);
|
|
|
- var classOption = ref([]);
|
|
|
var customerOption =ref([]);
|
|
|
const formData = reactive<Record<string, any>>({
|
|
|
id: '',
|
|
@@ -281,10 +280,7 @@
|
|
|
saleInvoiceFormShipTable.dataSource = [];
|
|
|
saleInvoiceDetailsTable.dataSource = [];
|
|
|
activeKey.value = 'saleInvoiceDetails'
|
|
|
- getOptiom()
|
|
|
getCustomerOptions()
|
|
|
- formData.salesman=userStore.getUserInfo.username;
|
|
|
- formData.saleDepartment = userStore.getUserInfo.orgCode
|
|
|
notAllowEdit.value = false
|
|
|
}
|
|
|
//编辑方法
|
|
@@ -296,7 +292,6 @@
|
|
|
saleInvoiceFormShipTable.dataSource = [...saleInvoiceFormShipDataList];
|
|
|
const saleInvoiceDetailsDataList = await querySaleInvoiceDetailListByMainId(row['id']);
|
|
|
saleInvoiceDetailsTable.dataSource = [...saleInvoiceDetailsDataList];
|
|
|
- getOptiom()
|
|
|
getCustomerOptions()
|
|
|
notAllowEdit.value=true
|
|
|
}
|
|
@@ -371,32 +366,32 @@
|
|
|
var newArray = [...saleInvoiceDetailsTable.dataSource]
|
|
|
newArray.splice(prop.rowIndex, 1)
|
|
|
saleInvoiceDetailsTable.dataSource = newArray
|
|
|
- if( saleInvoiceDetailsTable.dataSource.length!==0){
|
|
|
- var arr = []
|
|
|
- saleInvoiceDetailsTable.dataSource.map(item=>{
|
|
|
- if(item.sourceId){
|
|
|
- arr.push(item.sourceId)
|
|
|
- }
|
|
|
- })
|
|
|
- if(arr.length==0){
|
|
|
- formData.sourceCode=''
|
|
|
- notAllowEdit.value=false
|
|
|
- }
|
|
|
- }else{
|
|
|
- formData.sourceCode=''
|
|
|
- notAllowEdit.value=false
|
|
|
- }
|
|
|
+ // if( saleInvoiceDetailsTable.dataSource.length!==0){
|
|
|
+ // var arr = []
|
|
|
+ // saleInvoiceDetailsTable.dataSource.map(item=>{
|
|
|
+ // if(item.sourceId){
|
|
|
+ // arr.push(item.sourceId)
|
|
|
+ // }
|
|
|
+ // })
|
|
|
+ // if(arr.length==0){
|
|
|
+ // formData.sourceCode=''
|
|
|
+ // notAllowEdit.value=false
|
|
|
+ // }
|
|
|
+ // }else{
|
|
|
+ // formData.sourceCode=''
|
|
|
+ // notAllowEdit.value=false
|
|
|
+ // }
|
|
|
}
|
|
|
//选择项目
|
|
|
function addProject(data) {
|
|
|
if(data.length==0){
|
|
|
- formData.quotationProject =
|
|
|
- formData.quotationProjectName = ''
|
|
|
+ formData.project =
|
|
|
+ formData.projectName = ''
|
|
|
}else{
|
|
|
- formData.quotationProject = data[0].id
|
|
|
- formData.quotationProjectName = data[0].name
|
|
|
- formData.quotationCustomer =data[0].customerId
|
|
|
- formData.quotationCustomerName =data[0].customerId_dictText
|
|
|
+ formData.project = data[0].id
|
|
|
+ formData.projectName = data[0].name
|
|
|
+ // formData.customer =data[0].customerId
|
|
|
+ // formData.customerName =data[0].customerId_dictText
|
|
|
}
|
|
|
}
|
|
|
//获取客户列表
|
|
@@ -425,39 +420,8 @@
|
|
|
function onSearchProject(){
|
|
|
SelectProjectModalRef.value.getTable()
|
|
|
}
|
|
|
- //获取产品分类下拉框
|
|
|
- function getOptiom(){
|
|
|
- defHttp
|
|
|
- .get({ url: 'baseCode/baseProductClass/list'}, { isTransformResponse: false })
|
|
|
- .then((res) => {
|
|
|
- if (res.success) {
|
|
|
- classOption.value = []
|
|
|
- res.result.records.forEach(element => {
|
|
|
- var obj = {
|
|
|
- label: element.name?element.name:'无名称请维护',
|
|
|
- value: element.id?element.id:''
|
|
|
- };
|
|
|
- classOption.value.push( obj)
|
|
|
- });
|
|
|
- }
|
|
|
- })
|
|
|
- .finally(() => {
|
|
|
- // loading.value = false;
|
|
|
- });
|
|
|
- }
|
|
|
function changeValues(prop){
|
|
|
- if(prop.col.key=='purchasePrice'||prop.col.key=='taxRate'||prop.col.key=='tariff'||prop.col.key=='discount'||prop.col.key=='grossMargin'||prop.col.key=='customerCommision'||prop.col.key=='intermediatorCommission'){
|
|
|
- if(prop.row.purchasePrice&&prop.row.taxRate&&prop.row.tariff&&prop.row.discount&&prop.row.grossMargin&&prop.row.customerCommision&&prop.row.intermediatorCommission){
|
|
|
- var num= prop.row.purchasePrice/1*(1+prop.row.taxRate/100)*(1+prop.row.tariff/100)*(1-prop.row.discount/100)/(1-prop.row.grossMargin/100-prop.row.customerCommision/100-prop.row.intermediatorCommission/100)
|
|
|
- prop.row.salePrice = num.toFixed(2)
|
|
|
- if(prop.row.quantity){
|
|
|
- prop.row.taxAmount = (prop.row.salePrice*prop.row.quantity).toFixed(2)
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- if(prop.col.key=='quantity'&&prop.row.salePrice&&prop.row.quantity){
|
|
|
- prop.row.taxAmount = (prop.row.salePrice*prop.row.quantity).toFixed(2)
|
|
|
- }
|
|
|
+
|
|
|
}
|
|
|
function selectDeliveryList(){
|
|
|
SelectDeliveryNoticeModalRef.value.getTable()
|
|
@@ -490,8 +454,6 @@
|
|
|
SelectProjectModalRef,
|
|
|
onSearchProject,
|
|
|
addProject,
|
|
|
- getOptiom,
|
|
|
- classOption,
|
|
|
getCustomerOptions,
|
|
|
customerOption,
|
|
|
notAllowEdit,
|