瀏覽代碼

其他出库-功能点

jingbb 4 月之前
父節點
當前提交
d830ae0710

+ 44 - 19
src/views/inventiry/otherOut/components/SelectStaningStockModal.vue

@@ -14,12 +14,12 @@
                 <a-row :gutter="24">
                     <a-col :md="6" :sm="8">
                         <a-form-item label="仓库(warehouse)">
-                            <a-input placeholder="请输入" v-model:value="queryParams.warehouse"></a-input>
+                            <a-input placeholder="请输入" v-model:value="queryParams.warehouse" :disabled="fatherWarehouse!==''"></a-input>
                         </a-form-item>
                     </a-col>
                     <a-col :md="6" :sm="8">
                         <a-form-item label="货位(goods allocation)">
-                            <a-input placeholder="请输入" v-model:value="queryParams.goodsAllocation"></a-input>
+                            <a-input placeholder="请输入" v-model:value="queryParams.goodsAllocation" :disabled="fatherGoodsAllocation!==''"></a-input>
                         </a-form-item>
                     </a-col> 
                     <template v-if="toggleSearchStatus">
@@ -105,7 +105,7 @@
             </a-alert>
             <a-table
                 :columns="columns"
-                :row-key="record => record.childId"
+                :row-key="record => record.id"
                 :data-source="dataSource"
                 bordered
                 size="small"
@@ -131,11 +131,13 @@
     let classOption = ref([])
     var visible = ref(false)
     var fatherProject = ref('')
+    var fatherWarehouse = ref('')
+    var fatherGoodsAllocation = ref('')
     const columns = [
         {
             title: '仓库(warehouse)',
-            dataIndex: 'billCode',
-            key: 'billCode',
+            dataIndex: 'warehouse',
+            key: 'warehouse',
             align:"center",
             width:250,
             
@@ -155,9 +157,9 @@
             ellipsis: true,
         },
         {
-            title: '供应商(customer)',
-            dataIndex: 'customerName',
-            key: 'customerName',
+            title: '供应商(supplier)',
+            dataIndex: 'supplierName',
+            key: 'supplierName',
             align:"center",
             width:250,
             ellipsis: true,
@@ -171,8 +173,8 @@
         },
         {
             title: '产品分类(production class)',
-            dataIndex: 'productClass',
-            key: 'productClass',
+            dataIndex: 'productionClass_dictText',
+            key: 'productionClass_dictText',
             align:"center",
             width:250,
         },
@@ -286,7 +288,7 @@
     });
     function loadData(){
         let params = getQueryParams();
-        defHttp.get({ url: '/saleCode/saleQuotation/saleQuotationDetailsAlert',params}, { isTransformResponse: false })
+        defHttp.get({ url: '/storeCode/storeOnhand/list',params}, { isTransformResponse: false })
         .then((res) => {
             if (res.success) {
                 dataSource.value = res.result.records;
@@ -310,6 +312,16 @@
         }else {
             queryParams.value.project = params.project
         }
+        if(fatherWarehouse.value&&fatherWarehouse.value!==''){
+            queryParams.value.warehouse = fatherWarehouse.value
+        }else{
+            queryParams.value.warehouse =params.warehouse
+        }
+        if(fatherGoodsAllocation.value&&fatherGoodsAllocation.value!==''){
+            queryParams.value.goodsAllocation = fatherGoodsAllocation.value
+        }else{
+            queryParams.value.goodsAllocation = params.goodsAllocation
+        }
         return filterObj(params);
     }
     function handleTableChange(paginations, filters, sorter){
@@ -372,10 +384,18 @@
         selectedRows.value = rows
     }
     function handleOk(){
-        var arr = []
-        selectedRows.value.map(item=>arr.push(item.billCode))
+        var arrProject = [],
+        arrWareHouse=[],
+        arrGoodsAllocation=[]
+        selectedRows.value.map(item=>{
+            arrProject.push(item.project)
+            arrWareHouse.push(item.warehouse)
+            arrGoodsAllocation.push(item.goodsAllocation)
+        })
         if(selectedRowKeys.value.length==0){
             message.error('请勾选数据');
+        }else if(new Set(arrProject).size!==1||new Set(arrWareHouse).size!==1||new Set(arrGoodsAllocation).size!==1){
+            message.error('请勾选项目、仓库、货位都相同的数据');
         }else{
             emit('SelectStaningStock', selectedRows.value)
             handleCancel()
@@ -403,16 +423,21 @@
     }
     function getTable(formData){
         visible.value = true
-        if(formData.projectName&&formData.projectName!==''){
+        if(formData.project&&formData.project!==''){
             fatherProject.value = formData.project
         }else{
             fatherProject.value = ''
         }
-        // if(formData.sourceCode&&formData.sourceCode!==''){
-        //     fatherSourceCode.value = formData.sourceCode
-        // }else{
-        //     fatherSourceCode.value = ''
-        // }
+        if(formData.warehouse&&formData.warehouse!==''){
+            fatherWarehouse.value = formData.warehouse
+        }else{
+            fatherWarehouse.value = ''
+        }
+        if(formData.goodsAllocation&&formData.goodsAllocation!==''){
+            fatherGoodsAllocation.value = formData.goodsAllocation
+        }else{
+            fatherGoodsAllocation.value = ''
+        }
         loadData()
         getOptiom()
     }

+ 18 - 18
src/views/inventiry/otherOut/components/otherOutForm.vue

@@ -71,7 +71,7 @@
           </j-vxe-table>
       </a-tab-pane>     
     </a-tabs>
-    <SelectStaningStockModal ref="SelectStaningStockModalRef"></SelectStaningStockModal>
+    <SelectStaningStockModal ref="SelectStaningStockModalRef" @SelectStaningStock="addSonList"></SelectStaningStockModal>
   </a-spin>
 </template>
 
@@ -121,7 +121,6 @@
         id: '',
         status: undefined,
         delFlag: undefined,
-        sourceCode:'',
         billCode:'',
         billDate: moment(new Date()).format('YYYY-MM-DD'),   
         project: '', 
@@ -132,6 +131,8 @@
         goodsAllocation:'',
         warehouse:'',
         notes:'',
+        supplier:'',
+        supplierName:'',
       });
       //表单验证
       const validatorRules = reactive({
@@ -185,7 +186,7 @@
       }
      
       const {getSubFormAndTableData, transformData} = useValidateAntFormAndTable(activeKey, {
-        'storePurchaseInDetails': otherOutTableRef,
+        'storeOtherOutDetails': otherOutTableRef,
       });
 
       async function getFormData() {
@@ -205,11 +206,11 @@
       }
 
       async function submitForm() {
-        if( formData.sourceCode==''){
+        const mainData = await getFormData();
+        const subData = await getSubFormAndTableData();
+        if(!subData.storeOtherOutDetailsList||subData.storeOtherOutDetailsList.lenght==0){
           message.error('请添加出库明细!');
         }else{
-          const mainData = await getFormData();
-          const subData = await getSubFormAndTableData();
           const values = Object.assign({}, dbData, mainData, subData);
           console.log('表单提交数据', values)
           const isUpdate = values.id ? true : false
@@ -232,26 +233,24 @@
         var newArray = [...otherOutTable.dataSource]
         newArray.splice(prop.rowIndex, 1)
         otherOutTable.dataSource = newArray      
-        if(otherOutTable.dataSource.length==0){
-          formData.sourceCode=''
-        }
       }
-      function addotherOutList(data){
+      function addSonList(data){
         formData.project = data[0].project
         formData.projectName = data[0].projectName
         formData.supplier = data[0].supplier
         formData.supplierName = data[0].supplierName
-        formData.delivery = data[0].delivery
+        formData.customerName = data[0].customerName
+        formData.customer = data[0].customer
+        formData.goodsAllocation = data[0].goodsAllocation
+        formData.warehouse = data[0].warehouse
         formData.productionClass = data[0].productionClass
-        formData.model = data[0].model
-        formData.maker = data[0].maker
-        formData.sourceCode = data[0].billCode
-        formData.arrivalDetails = data[0].arrivalDetails
         var arr = data.concat(otherOutTable.dataSource)
         arr.map(item=>{
           item.model = item.childModel
-          item.sourceId = item.childId
-          item.arrivalQuantity = item.quantity
+          item.batchId = item.id
+          item.productClass = item.productionClass_dictText
+          item.stockOutQuantity = item.quantity
+          item.inventorySelsection = item.batchCode
         })
         otherOutTable.dataSource=arr  
       }
@@ -287,7 +286,8 @@
         formRef,
         handleDelete,
         SelectStaningStockModalRef,
-        selectStandingStock
+        selectStandingStock,
+        addSonList
       }
     }
   });

+ 11 - 11
src/views/inventiry/otherOut/otherOutForm.api.ts

@@ -4,17 +4,17 @@ import { useMessage } from "/@/hooks/web/useMessage";
 const { createConfirm } = useMessage();
 
 enum Api {
-  list = '/storeCode/storePurchaseIn/list',
-  save='/storeCode/storePurchaseIn/add',
-  edit='/storeCode/storePurchaseIn/edit',
-  deleteOne = '/storeCode/storePurchaseIn/delete',
-  deleteBatch = '/storeCode/storePurchaseIn/deleteBatch',
-  importExcel = '/storeCode/storePurchaseIn/importExcel',
-  exportXls = '/storeCode/storePurchaseIn/exportXls',
-  queryDataById = '/storeCode/storePurchaseIn/queryById',
-  stockOutFormProductList = '/storeCode/storePurchaseIn/queryStorePurchaseInDetailsByMainId',
-  submitBatch='/storeCode/storePurchaseIn/submitBatch',
-  cancelSubmitBatch='/storeCode/storePurchaseIn/returnSubmitBatch',
+  list = '/storeCode/storeOtherOut/list',
+  save='/storeCode/storeOtherOut/add',
+  edit='/storeCode/storeOtherOut/edit',
+  deleteOne = '/storeCode/storeOtherOut/delete',
+  deleteBatch = '/storeCode/storeOtherOut/deleteBatch',
+  importExcel = '/storeCode/storeOtherOut/importExcel',
+  exportXls = '/storeCode/storeOtherOut/exportXls',
+  queryDataById = '/storeCode/storeOtherOut/queryById',
+  stockOutFormProductList = '/storeCode/storeOtherOut/queryStoreOtherOutDetailsByMainId',
+  submitBatch='/storeCode/storeOtherOut/submitBatch',
+  cancelSubmitBatch='/storeCode/storeOtherOut/returnSubmitBatch',
   classList='baseCode/baseProductClass/list'
 }
 /**

+ 1 - 3
src/views/inventiry/otherOut/otherOutForm.data.ts

@@ -143,9 +143,7 @@ export const otherOutDetailColumns: JVxeColumn[] = [
       width:"200px",
       placeholder: '请输入${title}',
       defaultValue:'',
-      type: JVxeTypes.slot,
-      // slot 的名称,对应 v-slot 冒号后面和等号前面的内容
-      slotName: 'inventorySelsection',
+      type: JVxeTypes.normal,
       
     },
     {

+ 1 - 1
src/views/inventiry/otherOut/otherOutList.vue

@@ -133,7 +133,7 @@
                  fixed:'right'
              },
              scroll:{
-              x:'2500px'
+              x:'2000px'
              },
              beforeFetch: async (params) => {
                let rangerQuery = await setRangeQuery();

+ 2 - 2
src/views/publicComponents/SelectStaningStockModal.vue

@@ -170,8 +170,8 @@
         },
         {
             title: '产品分类(production class)',
-            dataIndex: 'productClass',
-            key: 'productClass',
+            dataIndex: 'productionClass_dictText',
+            key: 'productionClass_dictText',
             align:"center",
             width:250,
         },