Преглед на файлове

销售发票-代码修改

jingbb преди 4 месеца
родител
ревизия
df14d93a51
променени са 2 файла, в които са добавени 23 реда и са изтрити 64 реда
  1. 22 60
      src/views/saleCode/salesInvoice/components/saleInvoiceForm.vue
  2. 1 4
      src/views/saleCode/salesInvoice/salesInvoiceForm.api.ts

+ 22 - 60
src/views/saleCode/salesInvoice/components/saleInvoiceForm.vue

@@ -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,

+ 1 - 4
src/views/saleCode/salesInvoice/salesInvoiceForm.api.ts

@@ -122,7 +122,4 @@ export const cancelBatchSubmit = (params, handleSuccess) => {
       });
     }
   });
-}
-
-//获取供应商列表
-export const supplierOption = (params) => defHttp.get({url: Api.supplierList, params});
+}