Просмотр исходного кода

销售发票-选择发货通知单-来源修改

jingbb 4 месяцев назад
Родитель
Сommit
b6d400dfc8

+ 2 - 3
src/views/saleCode/salesInvoice/components/SelectDeliveryNoticeModal.vue

@@ -113,7 +113,7 @@
             </a-alert>
             <a-table
                 :columns="columns"
-                :row-key="record => record.childId"
+                :row-key="record => record.id"
                 :data-source="dataSource"
                 bordered
                 size="small"
@@ -134,7 +134,6 @@
     import { filterObj, getFileAccessHttpUrl } from '/@/utils/common/compUtils';
     import { JDictSelectTag,JInput,JSelect} from '/@/components/Form';
     import {  ApiSelect, } from '/@/components/Form/index';
-    import JSelectInput from '/@/components/Form/src/jeecg/components/JSelectInput.vue';
     import {ProjectOption,CustomerOption,ClassList} from '../salesInvoiceForm.api';
     const emit = defineEmits([ 'addDelivery']); //定义emit
     var showField = ref('currency+name');
@@ -310,7 +309,7 @@
         if(data){
             queryParams.value.project = data;
         }
-        defHttp.get({ url: '/saleCode/saleDelivery/selectSaleDeliveryAlertInvoice',params}, { isTransformResponse: false })
+        defHttp.get({ url: '/saleCode/saleDelivery/list',params}, { isTransformResponse: false })
         .then((res) => {
             if (res.success) {
                 dataSource.value = res.result.records;

+ 7 - 7
src/views/saleCode/salesInvoice/components/saleInvoiceForm.vue

@@ -294,6 +294,7 @@
     queryDataById,
     saveOrUpdate,
     listHeard,
+    queryDeliverDataById
   } from '../salesInvoiceForm.api';
   import { JVxeTable } from '/@/components/jeecg/JVxeTable';
   import { saleInvoiceShipColumns, saleInvoiceDetailColumns } from '../salesInvoiceForm.data';
@@ -416,7 +417,6 @@
         saleInvoiceFormShipTable.dataSource = [];
         saleInvoiceDetailsTable.dataSource = [];
         activeKey.value = 'saleInvoiceDetails';
-        getCustomerOptions();
         notAllowEdit.value = false;
       }
       //编辑方法
@@ -428,7 +428,6 @@
         saleInvoiceFormShipTable.dataSource = [...saleInvoiceFormShipDataList];
         const saleInvoiceDetailsDataList = await querySaleInvoiceDetailListByMainId(row['id']);
         saleInvoiceDetailsTable.dataSource = [...saleInvoiceDetailsDataList];
-        getCustomerOptions();
         notAllowEdit.value = true;
       }
       //获取主表
@@ -568,9 +567,10 @@
           message.warning('发票明细只可有一条数据');
         }
       }
-      function addSonList(data) {
-        data.map((item) => {
-          item.sourceId = item.childId;
+      async function addSonList(data) {
+        var arrDeliverSon = await queryDeliverDataById(data[0].id)
+        arrDeliverSon.map((item) => {
+          item.sourceId = item.id;
           item.quantity = item.quantity && item.quantity !== '' ? item.quantity : 0;
           item.taxPrice = item.taxPrice && item.taxPrice !== '' ? item.taxPrice : 0;
           item.taxMoney = item.money && item.money !== '' ? item.money : 0;
@@ -580,7 +580,7 @@
         });
         notAllowEdit.value = true;
         var xTable = saleInvoiceDetailsTableRef.value!.getXTable();
-        var arrSonFormDelivery = xTable.data.concat(data);
+        var arrSonFormDelivery = xTable.data.concat(arrDeliverSon);
         saleInvoiceDetailsTable.dataSource = arrSonFormDelivery;
         formData.project = data[0].project;
         formData.projectName = data[0].projectName;
@@ -596,7 +596,7 @@
           formData.buyerAddress = res.records[0].invoiceAddress;
         });
 
-        getShipDetail(data[0].headId, 'delivery');
+        getShipDetail(data[0].id, 'delivery');
       }
       function getShipDetail(id, status) {
         let params = { id: id };

+ 2 - 0
src/views/saleCode/salesInvoice/salesInvoiceForm.api.ts

@@ -13,6 +13,7 @@ enum Api {
   exportXls = '/saleCode/saleInvoice/exportXls',
   exportXlsRow = '/saleCode/saleInvoice/exportBillXls',
   queryDataById = '/saleCode/saleInvoice/queryById',
+  queryDeliverDataById = '/saleCode/saleDelivery/querySaleDeliveryDetailsByMainId',
   saleInvoiceFormShipList = '/saleCode/saleInvoice/querySaleInvoiceShipByMainId',
   saleInvoiceDetailList = '/saleCode/saleInvoice/querySaleInvoiceProductByMainId',
   submitBatch='/saleCode/saleInvoice/submitBatch',
@@ -111,6 +112,7 @@ export const saveOrUpdate = (params, isUpdate) => {
 * @param params
 */
 export const queryDataById = (id) => defHttp.get({url: Api.queryDataById, params:{ id }});
+export const queryDeliverDataById = (id) => defHttp.get({url: Api.queryDeliverDataById, params:{ id }});
 // 提交
 export const batchSubmit = (params, handleSuccess) => {
   createConfirm({