Procházet zdrojové kódy

销售出库-参照发货通知单查询接口修改/赋值修改

jingbb před 2 měsíci
rodič
revize
2e4cdf04fd

+ 71 - 73
src/views/inventiry/salesOutbound/components/SelectDeliveryModal.vue

@@ -117,13 +117,13 @@
             </a-alert>
             <a-table
                 :columns="columns"
-                :row-key="record => record.childId"
+                :row-key="record => record.id"
                 :data-source="dataSource"
                 bordered
                 size="small"
                 @change="handleTableChange"
                 :pagination="pagination"
-                :scroll="{ x: 3500, y: 400 }"
+                :scroll="{ x: 2500, y: 400 }"
                 :rowSelection="{  onSelect: onSelect, onSelectAll: onSelectAll,selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
             >
             </a-table>
@@ -187,61 +187,61 @@
         },
         {
             title: '产品分类(production class)',
-            dataIndex: 'productClass',
-            key: 'productClass',
+            dataIndex: 'productionClass_dictText',
+            key: 'productionClass_dictText',
             align:"center",
             width:250,
         },
         {
             title: '机型(model)',
-            dataIndex: 'headModel',
-            key: 'headModel',
+            dataIndex: 'model',
+            key: 'model',
             align:"center",
             ellipsis: true,
         },
         {
             title: '销售部门(sale department)',
-            dataIndex: 'saleDepartment',
-            key: 'saleDepartment',
+            dataIndex: 'saleDepartmentName',
+            key: 'saleDepartmentName',
             align:"center",
             width:250,
         },
         {
             title: '业务员(salesman)',
-            dataIndex: 'salesman',
-            key: 'salesman',
+            dataIndex: 'salesmanName',
+            key: 'salesmanName',
             align:"center",
             ellipsis: true,
         },
-        {
-            title: '产品编码(product code)',
-            dataIndex: 'productCode',
-            key: 'productCode',
-            align:"center",
-            width:250,
-        },
-        {
-            title: '产品英文名(English name)',
-            key: 'englishName',
-            dataIndex: 'englishName',
-            align:"center",
-            width:250,
-            ellipsis: true,
-        },
-        {
-            title: '型号(childModel)',
-            key: 'childModel',
-            dataIndex: 'childModel',
-            align:"center",
-            ellipsis: true,
-        },
-        {
-            title: '厂家(factory)',
-            key: 'factory',
-            ellipsis: true,
-            dataIndex: 'factory',
-            align:"center",
-        },
+        // {
+        //     title: '产品编码(product code)',
+        //     dataIndex: 'productCode',
+        //     key: 'productCode',
+        //     align:"center",
+        //     width:250,
+        // },
+        // {
+        //     title: '产品英文名(English name)',
+        //     key: 'englishName',
+        //     dataIndex: 'englishName',
+        //     align:"center",
+        //     width:250,
+        //     ellipsis: true,
+        // },
+        // {
+        //     title: '型号(childModel)',
+        //     key: 'childModel',
+        //     dataIndex: 'childModel',
+        //     align:"center",
+        //     ellipsis: true,
+        // },
+        // {
+        //     title: '厂家(factory)',
+        //     key: 'factory',
+        //     ellipsis: true,
+        //     dataIndex: 'factory',
+        //     align:"center",
+        // },
         {
             title: '质量等级(quantity grade)',
             key: 'quantityGrade',
@@ -249,27 +249,27 @@
             align:"center",
             width:250,
         },
-        {
-            title: '数量(quantity)',
-            key: 'quantity',
-            dataIndex: 'quantity',
-            align:"center",
-            ellipsis: true,
-        },
-        {
-            title: '单价(price)',
-            key: 'taxPrice',
-            dataIndex: 'taxPrice',
-            align:"center",
-            ellipsis: true,
-        },
-        {
-            title: '金额(tax money)',
-            key: 'money',
-            dataIndex: 'money',
-            align:"center",
-            ellipsis: true,
-        },
+        // {
+        //     title: '数量(quantity)',
+        //     key: 'quantity',
+        //     dataIndex: 'quantity',
+        //     align:"center",
+        //     ellipsis: true,
+        // },
+        // {
+        //     title: '单价(price)',
+        //     key: 'taxPrice',
+        //     dataIndex: 'taxPrice',
+        //     align:"center",
+        //     ellipsis: true,
+        // },
+        // {
+        //     title: '金额(tax money)',
+        //     key: 'money',
+        //     dataIndex: 'money',
+        //     align:"center",
+        //     ellipsis: true,
+        // },
     ];
     const labelCol = ref({
     xs: { span: 24 },
@@ -320,7 +320,7 @@
     });
     function loadData(){
         let params = getQueryParams();
-        defHttp.get({ url: '/saleCode/saleDelivery/selectSaleDeliveryAlert',params}, { isTransformResponse: false })
+        defHttp.get({ url: '/saleCode/saleDelivery/listAlert',params}, { isTransformResponse: false })
         .then((res) => {
             if (res.success) {
                 dataSource.value = res.result.records;
@@ -383,7 +383,7 @@
     function onSelectChange(selectedRowKeys1, selectionRows1) {
         var arr = []
         selectionRows.value.map(item=>{
-            arr.push(item.childId)
+            arr.push(item.id)
         })
         selectedRowKeys.value =  arr
     }
@@ -393,7 +393,7 @@
             console.log( selectionRows.value);
         }else{
             const delIndex = selectionRows.value.findIndex((val) => {
-            return val.childId === record.childId
+            return val.id === record.id
             })
             selectionRows.value.splice(delIndex, 1)
         }
@@ -407,7 +407,7 @@
             const delIndex = []
             selectionRows2.forEach((item, index) => {
             changeRows.forEach((val, itemIndex) => {
-                if (item.childId === val.childId) {
+                if (item.id === val.id) {
                 delIndex.push(index)
                 }
             })
@@ -422,15 +422,13 @@
         }
     }
     function handleOk(){
-        var arr = []
-        selectionRows.value.map(item=>arr.push(item.billCode))
-        if(fatherSourceCode.value&&fatherSourceCode.value!==''){
-            arr.push(fatherSourceCode.value)
-        }
-        if(selectedRowKeys.value.length==0){
-            message.error('请勾选数据');
-        }else if(new Set(arr).size!==1){
-            message.error('请勾选发货单号相同的数据');
+        // var arr = []
+        // selectionRows.value.map(item=>arr.push(item.billCode))
+        // if(fatherSourceCode.value&&fatherSourceCode.value!==''){
+        //     arr.push(fatherSourceCode.value)
+        // }
+        if(selectedRowKeys.value.length!==1){
+            message.error('请勾选一条数据');
         }else{
             emit('SelectDelivery', selectionRows.value)
             handleCancel()

+ 30 - 23
src/views/inventiry/salesOutbound/components/salesOutForm.vue

@@ -68,6 +68,11 @@
                 <JDictSelectTag v-model:value="formData.warehouse" placeholder="请选择" dictCode="warehouse" />
               </a-form-item>
             </a-col>
+            <a-col :span="12">
+              <a-form-item label="发货通知单号(sourceCode)" v-bind="validateInfos.sourceCode" id="SaleOrderForm-sourceCode" name="sourceCode">
+                <a-input v-model:value="formData.sourceCode" placeholder="请输入" disabled allow-clear />
+              </a-form-item>
+            </a-col>
             <a-col :span="12">
               <a-form-item label="备注(notes)" v-bind="validateInfos.notes" id="SaleOrderForm-notes" name="notes">
                 <a-input v-model:value="formData.notes" AutoComplete="off" />
@@ -81,7 +86,7 @@
     <!-- 子表单区域 -->
     <a-tabs v-model:activeKey="activeKey" animated style="padding: 24px; padding-top: 0px">
       <a-tab-pane tab="销售出库 - 出库明细(stock out details)" key="stockOut" :forceRender="true">
-        <a-button type="primary" style="margin-right: 1%; margin-bottom: 1%" @click="selectDelivery"> 选择发货单(select delivery)</a-button>
+        <a-button type="primary" style="margin-right: 1%; margin-bottom: 1%" @click="selectDelivery" :disabled="notAllowEdit"> 选择发货单(select delivery)</a-button>
         <j-vxe-table
           :keep-source="true"
           resizable
@@ -137,7 +142,7 @@
   import { defineComponent, ref, reactive, computed, toRaw } from 'vue';
   import { defHttp } from '/@/utils/http/axios';
   import { useValidateAntFormAndTable } from '/@/hooks/system/useJvxeMethods';
-  import { querySaleOutShipFormShip, querystockOutByMainId, queryDataById, saveOrUpdate } from '../salesOutboundForm.api';
+  import { querySaleOutShipFormShip, querystockOutByMainId, queryDataById, saveOrUpdate,getDeitailFromDelivery } from '../salesOutboundForm.api';
   import { JVxeTable } from '/@/components/jeecg/JVxeTable';
   import { stockOutShipColumns, stockOutColumns } from '../salesOutboundForm.data';
   import BaseShipArchiveAccessoriesModal from '../../../publicComponents/BaseShipArchiveAccessoriesModal.vue';
@@ -366,27 +371,29 @@
       function selectDelivery() {
         SelectDeliveryModalRef.value.getTable(formData);
       }
-      function getDeliveryList(data) {
-        data.map((item) => {
-          item.model = item.childModel;
-          item.sourceId = item.childId;
-          item.deliveryQuantity = item.quantity;
-          item.stockOutQuantity = item.quantity;
-        });
-        var xTable = stockOutTableRef.value!.getXTable()
-        var arrProduct = xTable.data.concat(data);
-        notAllowEdit.value = true;
-        stockOutTable.dataSource = arrProduct;
-        formData.sourceCode = data[0].billCode;
-        formData.project = data[0].project;
-        formData.projectName = data[0].projectName;
-        formData.customerName = data[0].customerName;
-        formData.customer = data[0].customer;
-        formData.productionClass = data[0].productionClass;
-        formData.model = data[0].headModel;
-        formData.maker = data[0].maker;
-        formData.isExport = data[0].isExport;
-        getShipList(data[0].headId);
+      async function getDeliveryList(data) {
+        var arr = await getDeitailFromDelivery({headId:data[0].id})
+        if(arr.records.length!==0){
+          arr.records.map((item) => {
+            item.model = item.childModel;
+            item.sourceId = item.childId;
+            item.deliveryQuantity = item.quantity;
+            item.stockOutQuantity = item.quantity;
+          });
+          notAllowEdit.value = true;
+          stockOutTable.dataSource = arr.records;
+          formData.sourceCode = arr.records[0].billCode;
+          formData.project = arr.records[0].project;
+          formData.projectName = arr.records[0].projectName;
+          formData.customerName = arr.records[0].customerName;
+          formData.customer = arr.records[0].customer;
+          formData.productionClass = arr.records[0].productionClass;
+          formData.model = arr.records[0].headModel;
+          formData.maker = arr.records[0].maker;
+          formData.isExport = arr.records[0].isExport;
+          getShipList(arr.records[0].headId);
+        }
+       
       }
       function onSearchInventory(props) {
         if (

+ 5 - 1
src/views/inventiry/salesOutbound/salesOutboundForm.api.ts

@@ -22,6 +22,7 @@ enum Api {
   customerList='/cuspCode/cuspCustomerProfile/list',
   projectList='/baseCode/baseProjectArchive/list',
   supplierList='/cuspCode/cuspSupplierProfile/list',
+  getDeliveryDetail='/saleCode/saleDelivery/selectSaleDeliveryAlert',
 }
 /**
  * 导出api
@@ -158,4 +159,7 @@ export const CustomerOption = (params) => defHttp.get({ url: Api.customerList, p
 //获取项目下拉框列表
 export const ProjectOption = (params) => defHttp.get({ url: Api.projectList, params });
 //获取供应商列表
-export const supplierOption = (params) => defHttp.get({url: Api.supplierList, params});
+export const supplierOption = (params) => defHttp.get({url: Api.supplierList, params});
+
+//获取发货通知单子表信息
+export const getDeitailFromDelivery = (params) => defHttp.get({url: Api.getDeliveryDetail, params});