浏览代码

盘盈盘亏-功能点开发

jingbb 4 月之前
父节点
当前提交
c1cfc6a12a

+ 44 - 19
src/views/inventiry/inventoryCheck/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()
     }

+ 61 - 35
src/views/inventiry/inventoryCheck/components/inventoryCheckForm.vue

@@ -26,7 +26,7 @@
 						</a-col>
             <a-col :span="12">
 							<a-form-item label="项目(project)" v-bind="validateInfos.projectName" id="SaleOrderForm-projectName" name="projectName">
-								<a-input v-model:value="formData.projectName" placeholder="请输入项目(project)"  allow-clear ></a-input>
+								<a-input-search v-model:value="formData.projectName" placeholder="请输入项目(project)" :disabled="notAllowEdit"  allow-clear enter-button="Search" @search="onSearchProject"></a-input-search>
 							</a-form-item>
 						</a-col>
             <a-col :span="12">
@@ -55,6 +55,7 @@
           :rowNumber="true"
           :rowSelection="true"
           asyncRemove
+          @valueChange="changeValues"
           >
             <template #action="props">
               <a-popconfirm title="确定删除吗?" @confirm="handleDelete(props)">
@@ -66,7 +67,8 @@
           </j-vxe-table>
       </a-tab-pane>     
     </a-tabs>
-    <SelectStaningStockModal ref="SelectStaningStockModalRef"></SelectStaningStockModal>
+    <SelectProjectModal ref="SelectProjectModalRef" @selectProject="addProject"></SelectProjectModal>
+    <SelectStaningStockModal ref="SelectStaningStockModalRef" @SelectStaningStock="addSonList"></SelectStaningStockModal>
   </a-spin>
 </template>
 
@@ -76,6 +78,7 @@
   import { querystockDetailsByMainId, queryDataById, saveOrUpdate} from '../inventoryCheckForm.api';
   import {stockDetailColumns} from '../inventoryCheckForm.data';
   import SelectStaningStockModal from './SelectStaningStockModal.vue';
+  import SelectProjectModal from '../../../publicComponents/SelectProjectModal.vue';
   import { JVxeTable } from '/@/components/jeecg/JVxeTable';
   import JFormContainer from '/@/components/Form/src/container/JFormContainer.vue';
   import JUpload from '/@/components/Form/src/jeecg/components/JUpload/JUpload.vue';
@@ -90,7 +93,8 @@
 			JFormContainer,
       JUpload,
       JDictSelectTag,
-      SelectStaningStockModal
+      SelectStaningStockModal,
+      SelectProjectModal
     },
     props:{
       formDisabled:{
@@ -104,6 +108,7 @@
     setup(props, {emit}) {
       const loading = ref(false);
       const formRef = ref();
+      const SelectProjectModalRef = ref()
       const stockDetailsTableRef = ref();
       const stockDetailsTable = reactive<Record<string, any>>({
         loading: false,
@@ -116,13 +121,10 @@
         id: '',
         status: undefined,
         delFlag: undefined,
-        sourceCode:'',
         billCode:'',
         billDate: moment(new Date()).format('YYYY-MM-DD'),   
         project: '', 
         projectName:'',  
-        customer:"",
-        customerName:'',
         productionClass: '',   
         goodsAllocation:'',
         warehouse:'',
@@ -180,7 +182,7 @@
       }
      
       const {getSubFormAndTableData, transformData} = useValidateAntFormAndTable(activeKey, {
-        'storePurchaseInDetails': stockDetailsTableRef,
+        'storeCheckDetails': stockDetailsTableRef,
       });
 
       async function getFormData() {
@@ -200,11 +202,12 @@
       }
 
       async function submitForm() {
-        if( formData.sourceCode==''){
-          message.error('请添加出库明细!');
+        const mainData = await getFormData();
+        const subData = await getSubFormAndTableData();
+        if(!subData.storeCheckDetailsList||subData.storeCheckDetailsList.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
@@ -227,28 +230,6 @@
         var newArray = [...stockDetailsTable.dataSource]
         newArray.splice(prop.rowIndex, 1)
         stockDetailsTable.dataSource = newArray      
-        if(stockDetailsTable.dataSource.length==0){
-          formData.sourceCode=''
-        }
-      }
-      function addstockDetailsList(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.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(stockDetailsTable.dataSource)
-        arr.map(item=>{
-          item.model = item.childModel
-          item.sourceId = item.childId
-          item.arrivalQuantity = item.quantity
-        })
-        stockDetailsTable.dataSource=arr  
       }
       /**
        * 值改变事件触发-树控件回调
@@ -262,7 +243,47 @@
         SelectStaningStockModalRef.value.getTable(formData)
 
       }
-
+      function onSearchProject(){
+        SelectProjectModalRef.value.getTable()
+      }
+      function addProject(data){
+        if(data.lenght==0){
+          formData.projectName = ''
+          formData.projectName = ''
+        }else{
+          formData.project = data[0].id
+          formData.projectName = data[0].name
+        } 
+      }
+      function addSonList(data){
+        formData.project = data[0].project
+        formData.projectName = data[0].projectName
+        formData.goodsAllocation = data[0].goodsAllocation
+        formData.warehouse = data[0].warehouse
+        formData.productionClass = data[0].productionClass
+        var arr = data.concat(stockDetailsTable.dataSource)
+        arr.map(item=>{
+          item.model = item.childModel
+          item.batchId = item.id
+          item.productClass = item.productionClass_dictText
+          item.inventoryQuantity = item.quantity?item.quantity:0
+          item.countedQuantity = 0
+          item.inventory = Number(item.countedQuantity)-Number(item.inventoryQuantity)
+        })
+        stockDetailsTable.dataSource=arr  
+      }
+      function changeValues(prop){
+        if(prop.col.key=='countedQuantity'){
+          if(prop.row.countedQuantity){
+            prop.row.inventory = Number(prop.row.countedQuantity)-Number(prop.row.inventoryQuantity)
+          }
+        }
+        if(prop.col.key=='inventory'){
+          if(prop.row.inventory){
+            prop.row.countedQuantity = Number(prop.row.inventoryQuantity)+Number(prop.row.inventory)
+          }
+        }
+      }
       return {
         stockDetailsTableRef,
         stockDetailsTable,
@@ -282,7 +303,12 @@
         formRef,
         handleDelete,
         SelectStaningStockModalRef,
-        selectStandingStock
+        selectStandingStock,
+        onSearchProject,
+        SelectProjectModalRef,
+        addProject,
+        addSonList,
+        changeValues
       }
     }
   });

+ 1 - 1
src/views/inventiry/inventoryCheck/components/inventoryCheckModal.vue

@@ -15,7 +15,7 @@
     name: "inventoryCheckModal",
     components:{
       BasicModal,
-      otherOutForm
+      inventoryCheckForm
     },
     emits:['register','success'],
     setup(_p, {emit}){

+ 11 - 11
src/views/inventiry/inventoryCheck/inventoryCheckForm.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',
-  stockFormProductList = '/storeCode/storePurchaseIn/queryStorePurchaseInDetailsByMainId',
-  submitBatch='/storeCode/storePurchaseIn/submitBatch',
-  cancelSubmitBatch='/storeCode/storePurchaseIn/returnSubmitBatch',
+  list = '/storeCode/storeCheck/list',
+  save='/storeCode/storeCheck/add',
+  edit='/storeCode/storeCheck/edit',
+  deleteOne = '/storeCode/storeCheck/delete',
+  deleteBatch = '/storeCode/storeCheck/deleteBatch',
+  importExcel = '/storeCode/storeCheck/importExcel',
+  exportXls = '/storeCode/storeCheck/exportXls',
+  queryDataById = '/storeCode/storeCheck/queryById',
+  stockFormProductList = '/storeCode/storeCheck/queryStoreCheckDetailsByMainId',
+  submitBatch='/storeCode/storeCheck/submitBatch',
+  cancelSubmitBatch='/storeCode/storeCheck/returnSubmitBatch',
   classList='baseCode/baseProductClass/list'
 }
 /**

+ 3 - 4
src/views/inventiry/inventoryCheck/inventoryCheckForm.data.ts

@@ -120,7 +120,7 @@ export const stockDetailColumns: JVxeColumn[] = [
       defaultValue:'',
     },
     {
-      title: '号(batch code)',
+      title: '号(batch code)',
       key: 'batchCode',
       placeholder: '请输入${title}',
       width:"200px",
@@ -130,7 +130,7 @@ export const stockDetailColumns: JVxeColumn[] = [
     {
       title: '库存数量(inventory quantity)',
       key: 'inventoryQuantity',
-      type: JVxeTypes.inputNumber,
+      type: JVxeTypes.normal,
       placeholder: '请输入${title}',
       defaultValue:'',  
       width:"200px",
@@ -149,8 +149,7 @@ export const stockDetailColumns: JVxeColumn[] = [
       width:"200px",
       placeholder: '请输入${title}',
       defaultValue:'',
-      type: JVxeTypes.input,
-      
+      type: JVxeTypes.inputNumber,      
     },
     {
       title: '备注(notes)',

+ 9 - 9
src/views/inventiry/inventoryCheck/inventoryCheckList.vue

@@ -29,12 +29,12 @@
                   <a-input placeholder="请输" v-model:value="queryParam.goodsAllocation" allow-clear ></a-input>
                 </a-form-item>
               </a-col>          
-              <a-col :lg="8">
+              <!-- <a-col :lg="8">
                 <a-form-item name="productCode">
                   <template #label><span title="产品编号(productCode)">产品编号(productCode)</span></template>
                   <a-input placeholder="请输入产品编号(productCode)" v-model:value="queryParam.productCode" allow-clear ></a-input>
                 </a-form-item>
-              </a-col> 
+              </a-col>  -->
              
               <a-col :lg="8">
                 <a-form-item name="submit">
@@ -62,20 +62,20 @@
      <BasicTable @register="registerTable" :rowSelection="rowSelection" size="small" >
        <!--插槽:table标题-->
         <template #tableTitle>
-            <a-button type="primary" v-auth="'storeCode:store_purchase_other:add'"  @click="handleAdd" preIcon="ant-design:plus-outlined"> 新增(add)</a-button>
-            <a-button  type="primary" v-auth="'storeCode:store_purchase_other:exportXls'"  preIcon="ant-design:export-outlined" @click="onExportXls"> 导出(export)</a-button>
+            <a-button type="primary" v-auth="'storeCode:store_check:add'"  @click="handleAdd" preIcon="ant-design:plus-outlined"> 新增(add)</a-button>
+            <a-button  type="primary" v-auth="'storeCode:store_check:exportXls'"  preIcon="ant-design:export-outlined" @click="onExportXls"> 导出(export)</a-button>
             <a-button  type="primary"  @click="submit" > 提交(submit)</a-button>
             <a-button  type="primary"  @click="cancelSubmit"> 取消提交(cancelSubmit)</a-button>
             <a-dropdown v-if="selectedRowKeys.length > 0">
                 <template #overlay>
                   <a-menu>
-                    <a-menu-item key="1" @click="batchHandleDelete"  v-auth="'storeCode:store_purchase_other:deleteBatch'">
+                    <a-menu-item key="1" @click="batchHandleDelete"  v-auth="'storeCode:store_check:deleteBatch'">
                       <Icon icon="ant-design:delete-outlined"></Icon>
                       删除(delete)
                     </a-menu-item>
                   </a-menu>
                 </template>
-                <a-button v-auth="'saleCode:sale_order:delete'">批量操作
+                <a-button v-auth="'storeCode:store_check:deleteBatch'">批量操作
                   <Icon icon="mdi:chevron-down"></Icon>
                 </a-button>
           </a-dropdown>
@@ -121,7 +121,7 @@
                  fixed:'right'
              },
              scroll:{
-              x:'2500px'
+              x:'1600px'
              },
              beforeFetch: async (params) => {
                let rangerQuery = await setRangeQuery();
@@ -205,7 +205,7 @@
            {
              label: '编辑(edit)',
              onClick: handleEdit.bind(null, record),
-             auth: 'storeCode:store_purchase_other:edit',
+             auth: 'storeCode:store_check:edit',
              ifShow: record.submit=='0'||!record.submit
            },
            {
@@ -232,7 +232,7 @@
                confirm: handleDelete.bind(null, record),
                placement: 'topLeft'
              },
-             auth: 'storeCode:store_purchase_other:delete',
+             auth: 'storeCode:store_check:delete',
              ifShow: record.submit=='0'||!record.submit
            }
          ]

+ 0 - 4
src/views/inventiry/otherOut/components/otherOutForm.vue

@@ -131,8 +131,6 @@
         goodsAllocation:'',
         warehouse:'',
         notes:'',
-        supplier:'',
-        supplierName:'',
       });
       //表单验证
       const validatorRules = reactive({
@@ -237,8 +235,6 @@
       function addSonList(data){
         formData.project = data[0].project
         formData.projectName = data[0].projectName
-        formData.supplier = data[0].supplier
-        formData.supplierName = data[0].supplierName
         formData.customerName = data[0].customerName
         formData.customer = data[0].customer
         formData.goodsAllocation = data[0].goodsAllocation