Browse Source

采购入库-功能

jingbb 4 months ago
parent
commit
2efc4118a6

+ 59 - 56
src/views/inventiry/purchaseIn/components/purchaseInForm.vue

@@ -10,7 +10,7 @@
 							</a-form-item>
 						</a-col>
 						<a-col :span="12">
-							<a-form-item label="入库日期(bill date)" v-bind="validateInfos.billDate" :label-col="formItemLayout.labelCol1" :wrapper-col="formItemLayout.wrapperCol1" id="SaleOrderForm-billDate" name="billDate">
+							<a-form-item label="入库日期(bill date)" v-bind="validateInfos.billDate"  id="SaleOrderForm-billDate" name="billDate">
 								<a-date-picker placeholder="请选择入库日期(bill date)"  v-model:value="formData.billDate"  value-format="YYYY-MM-DD"  style="width: 100%"  allow-clear />
 							</a-form-item>
 						</a-col>		
@@ -20,8 +20,8 @@
 							</a-form-item>
 						</a-col>
 						<a-col :span="12">
-							<a-form-item label="供应商(supplier)" v-bind="validateInfos.supplierName" :label-col="formItemLayout.labelCol1" :wrapper-col="formItemLayout.wrapperCol1" id="SaleOrderForm-supplierName" name="supplierName">
-                <JSelectInput   v-model:value="formData.supplier"  placeholder="请选择" allow-clear disabled  :options="supplierOption" @change="changeSupplier"></JSelectInput>
+							<a-form-item label="供应商(supplier)" v-bind="validateInfos.supplierName"  id="SaleOrderForm-supplierName" name="supplierName">
+								<a-input v-model:value="formData.supplierName" placeholder="请输入" disabled allow-clear ></a-input>
 							</a-form-item>
 						</a-col>
             <a-col :span="12">
@@ -30,27 +30,27 @@
 							</a-form-item>
 						</a-col>
             <a-col :span="12">
-							<a-form-item label="产品分类(production class)" v-bind="validateInfos.productionClass" :label-col="formItemLayout.labelCol1" :wrapper-col="formItemLayout.wrapperCol1" id="SaleOrderForm-productionClass" name="productionClass">
+							<a-form-item label="产品分类(production class)" v-bind="validateInfos.productionClass"  id="SaleOrderForm-productionClass" name="productionClass">
 								<a-input v-model:value="formData.productionClass" placeholder="请输入"  allow-clear disabled ></a-input>
 							</a-form-item>
 						</a-col>
 						<a-col :span="12">
 							<a-form-item label="机型(model)" v-bind="validateInfos.model" id="SaleOrderForm-model" name="model">
-                <JDictSelectTag v-model:value="formData.model" placeholder="请选择" dictCode="model_typer" disabled />
+                <a-input v-model:value="formData.model" placeholder="请输入"  allow-clear disabled ></a-input>
 							</a-form-item>
 						</a-col>
 						<a-col :span="12">
-							<a-form-item label="厂家(maker)" v-bind="validateInfos.maker" :label-col="formItemLayout.labelCol1" :wrapper-col="formItemLayout.wrapperCol1" id="SaleOrderForm-maker" name="maker">
+							<a-form-item label="厂家(maker)" v-bind="validateInfos.maker"  id="SaleOrderForm-maker" name="maker">
 								<a-input v-model:value="formData.maker" placeholder="请输入厂家(maker)"  allow-clear disabled></a-input>
 							</a-form-item>
 						</a-col>
             <a-col :span="12">
-							<a-form-item label="货位(goods allocation)" v-bind="validateInfos.goodsAllocation" :label-col="formItemLayout.labelCol1" :wrapper-col="formItemLayout.wrapperCol1" id="SaleOrderForm-goodsAllocation" name="goodsAllocation">
+							<a-form-item label="货位(goods allocation)" v-bind="validateInfos.goodsAllocation" id="SaleOrderForm-goodsAllocation" name="goodsAllocation">
 								<a-input v-model:value="formData.goodsAllocation" placeholder="请输入货位(goods allocation)"  allow-clear ></a-input>
 							</a-form-item>
 						</a-col>
             <a-col :span="12">
-							<a-form-item label="仓库(warehouse)" v-bind="validateInfos.warehouse" :label-col="formItemLayout.labelCol1" :wrapper-col="formItemLayout.wrapperCol1" id="SaleOrderForm-warehouse" name="warehouse">
+							<a-form-item label="仓库(warehouse)" v-bind="validateInfos.warehouse" id="SaleOrderForm-warehouse" name="warehouse">
 								<a-input v-model:value="formData.warehouse" placeholder="请输入仓库(warehouse)"  allow-clear ></a-input>
 							</a-form-item>
 						</a-col>
@@ -60,10 +60,16 @@
 							</a-form-item>
 						</a-col>   
             <a-col :span="12">
-							<a-form-item label="附件(attachs)" v-bind="validateInfos.attachs" :label-col="formItemLayout.labelCol1" :wrapper-col="formItemLayout.wrapperCol1" id="PuechaseInquiryFormForm-attachs" name="attachs" >
+							<a-form-item label="到货详情(arrival details)" v-bind="validateInfos.arrivalDetails"  id="PuechaseInquiryFormForm-attachs" name="arrivalDetails" >
+								<a :href="baseUrl+formData.arrivalDetails">{{formData.arrivalDetails}}</a>
+							</a-form-item>
+						</a-col>   
+            <a-col :span="12">
+							<a-form-item label="附件(attachs)" v-bind="validateInfos.attachs"  id="PuechaseInquiryFormForm-attachs" name="attachs" >
 								<JUpload v-model:value="formData.attachs"></JUpload>
 							</a-form-item>
-						</a-col>        
+						</a-col>    
+             
           </a-row>
         </a-form>
       </template>
@@ -108,12 +114,14 @@
               <a-popconfirm title="确定删除吗?" @confirm="handleDelete(props)">
                 <a>删除(delete)</a>
               </a-popconfirm>
+              <!-- 逻辑不通暂时取消次功能 -->
+              <!-- <a>复制(copy)</a> -->
             </template>
           </j-vxe-table>
       </a-tab-pane>
     </a-tabs>
     <BaseShipArchiveAccessoriesModal ref="BaseShipArchiveAccessoriesModalRef"></BaseShipArchiveAccessoriesModal>
-    <selectArrivalList ref="selectArrivalListRef"></selectArrivalList>
+    <selectArrivalList ref="SelectArrivalListRef" @selectArrrivalOrder="addStockInList"></selectArrivalList>
   </a-spin>
 </template>
 
@@ -125,12 +133,12 @@
   import { JVxeTable } from '/@/components/jeecg/JVxeTable';
   import {purInShipColumns, stockInColumns} from '../puechaseInForm.data';
   import BaseShipArchiveAccessoriesModal from '../../../publicComponents/BaseShipArchiveAccessoriesModal.vue';
-  import selectArrivalList from './selectArrivalList.vue';
+  import selectArrivalList from '../../../publicComponents/selectArrivalList.vue';
   import JFormContainer from '/@/components/Form/src/container/JFormContainer.vue';
   import JUpload from '/@/components/Form/src/jeecg/components/JUpload/JUpload.vue';
   import { JDictSelectTag} from '/@/components/Form';
-  import JSelectInput from '/@/components/Form/src/jeecg/components/JSelectInput.vue';
   import { Form, message } from 'ant-design-vue';
+  import { useGlobSetting } from '/@/hooks/setting';
   import moment from 'moment';
   const useForm = Form.useForm;
   export default defineComponent({
@@ -140,7 +148,6 @@
 			JFormContainer,
       JUpload,
       JDictSelectTag,
-      JSelectInput,
       BaseShipArchiveAccessoriesModal,
       selectArrivalList
     },
@@ -154,6 +161,8 @@
     },
     emits:['success'],
     setup(props, {emit}) {
+      const { domainUrl } = useGlobSetting();
+      const baseUrl = domainUrl + '/sys/common/static/';
       const loading = ref(false);
       const formRef = ref();
       const SelectArrivalListRef = ref()
@@ -184,14 +193,15 @@
         supplierName:'',
         delivery: '',   
         productionClass: '',   
-        model: '',   
+        model:'',   
         maker: '',
         goodsAllocation:'',
         warehouse:'',
         notes:'',
         attachs:'',
+        arrivalDetails:'',
+        typr:'1'
       });
-      var supplierOption = ref([]);
       //表单验证
       const validatorRules = reactive({
       });
@@ -223,7 +233,6 @@
         purInShipTable.dataSource = [];
         stockInTable.dataSource = [];
         activeKey.value = 'purInShip'
-        getSupplierOption()
       }
       async function edit(row) {
         //主表数据
@@ -233,7 +242,6 @@
         purInShipTable.dataSource = [...purInShipDataList];
         const stockInDataList = await querystockInByMainId(row['id']);
         stockInTable.dataSource = [...stockInDataList];
-        getSupplierOption()
       }
 
       async function queryMainData(id) {
@@ -250,8 +258,8 @@
       }
      
       const {getSubFormAndTableData, transformData} = useValidateAntFormAndTable(activeKey, {
-        'purDeliveryNodeShip': purInShipTableRef,
-        'purDeliveryNoteArrival': stockInTableRef,
+        'storePurchaseInShip': purInShipTableRef,
+        'storePurchaseInDetails': stockInTableRef,
       });
 
       async function getFormData() {
@@ -271,6 +279,9 @@
       }
 
       async function submitForm() {
+        if( formData.sourceCode==''){
+          message.error('请添加入库明细!');
+        }else{
           const mainData = await getFormData();
           const subData = await getSubFormAndTableData();
           const values = Object.assign({}, dbData, mainData, subData);
@@ -279,6 +290,7 @@
           await saveOrUpdate(values, isUpdate);
           //关闭弹窗
           emit('success');
+        }
       }
       
       function setFieldsValue(values) {
@@ -290,7 +302,7 @@
       }
       function getShipList(id){
         let params = {id:id}
-        let url = '/purCode/purOrder/queryPurOrderShipByMainId'
+        let url = '/purCode/purDeliveryNote/queryPurDeliveryNodeShipByMainId'
           defHttp.get({url:url,params}, { isTransformResponse: false }).then(res=>{
             if(res){
               purInShipTable.dataSource = res.result
@@ -306,43 +318,34 @@
       function handleDelete(prop) {
         var newArray = [...stockInTable.dataSource]
         newArray.splice(prop.rowIndex, 1)
-        stockInTable.dataSource = newArray       
-      }
-      function getSupplierOption(){
-        defHttp
-            .get({ url: '/cuspCode/cuspSupplierProfile/list'}, { isTransformResponse: false })
-            .then((res) => {
-                if (res.success) {
-                  supplierOption.value = []
-                  res.result.records.forEach(element => {
-                      var obj = {
-                        label: element.name?element.name:'无名称请维护',
-                        value: element.id?element.id:''
-                      };
-                      supplierOption.value.push( obj)
-                  });    
-                }
-            })
-            .finally(() => {
-                // loading.value = false;
-            });
-      }
-      function changeSupplier(prop){
-        if(prop){
-          supplierOption.value.map(item=>{
-            if(item.value==prop){
-              formData.supplierName = item.label
-            }
-          })
-        }else{
-          formData.supplier = ''
-          formData.supplierName = ''
+        stockInTable.dataSource = newArray      
+        if(stockInTable.dataSource.length==0){
+          formData.sourceCode=''
         }
       }
       function selectArrivalList(){
         SelectArrivalListRef.value.getTable(formData)
       }
-        
+      function addStockInList(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
+        getShipList(data[0].headId)
+        var arr = data.concat(stockInTable.dataSource)
+        arr.map(item=>{
+          item.model = item.childModel
+          item.sourceId = item.childId
+          item.arrivalQuantity = item.quantity
+        })
+        stockInTable.dataSource=arr  
+      }
       /**
        * 值改变事件触发-树控件回调
        * @param key
@@ -373,10 +376,10 @@
         handleDelete,
         BaseShipArchiveAccessoriesModalRef,
         viewAccessory,
-        changeSupplier,
-        supplierOption,
         SelectArrivalListRef,
-        selectArrivalList
+        selectArrivalList,
+        addStockInList,
+        baseUrl
       }
     }
   });

+ 3 - 3
src/views/inventiry/purchaseIn/puechaseInForm.data.ts

@@ -190,15 +190,15 @@ export const stockInColumns: JVxeColumn[] = [
     },
     {
       title: '需要船检证书(ship inspection certificate)', 
-      key: 'needShip',
+      key: 'needShipInspection',
       type: JVxeTypes.normal,
       placeholder: '请输入${title}',
       width:"200px",
       defaultValue:'',
     },
     {
-      title: '船检证书(quality grade)',
-      key: 'needShip',
+      title: '船检证书(ship inspection)',
+      key: 'shipInspection',
       type: JVxeTypes.normal,
       placeholder: '请输入${title}',
       width:"200px",

+ 12 - 12
src/views/inventiry/purchaseIn/purchaseInForm.api.ts

@@ -4,18 +4,18 @@ import { useMessage } from "/@/hooks/web/useMessage";
 const { createConfirm } = useMessage();
 
 enum Api {
-  list = '/saleCode/saleOrder/list',
-  save='/saleCode/saleOrder/add',
-  edit='/saleCode/saleOrder/edit',
-  deleteOne = '/saleCode/saleOrder/delete',
-  deleteBatch = '/saleCode/saleOrder/deleteBatch',
-  importExcel = '/saleCode/saleOrder/importExcel',
-  exportXls = '/saleCode/saleOrder/exportXls',
-  queryDataById = '/saleCode/saleOrder/queryById',
-  purInFormShipList = '/saleCode/saleOrder/querySaleOrderShipByMainId',
-  stockInFormProductList = '/saleCode/saleOrder/querySaleOrderProductByMainId',
-  submitBatch='/saleCode/saleOrder/submitBatch',
-  cancelSubmitBatch='saleCode/saleOrder/returnSubmitBatch',
+  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',
+  purInFormShipList = '/storeCode/storePurchaseIn/queryStorePurchaseInShipByMainId',
+  stockInFormProductList = '/storeCode/storePurchaseIn/queryStorePurchaseInDetailsByMainId',
+  submitBatch='/storeCode/storePurchaseIn/submitBatch',
+  cancelSubmitBatch='/storeCode/storePurchaseIn/returnSubmitBatch',
 }
 /**
  * 导出api

+ 13 - 4
src/views/inventiry/purchaseIn/purchaseInList.vue

@@ -112,7 +112,7 @@
         </template>
       </BasicTable>
       <!-- 表单区域 -->
-      <SaleInquiryFormModal @register="registerModal" @success="handleSuccess"></SaleInquiryFormModal>
+      <puechaseInFormModal @register="registerModal" @success="handleSuccess"></puechaseInFormModal>
     </div>
   </template>
   
@@ -121,7 +121,7 @@
     import {BasicTable, useTable, TableAction} from '/@/components/Table';
     import { useListPage } from '/@/hooks/system/useListPage'
     import {useModal} from '/@/components/Modal';
-    import SaleInquiryFormModal from './components/SaleOrderFormModal.vue'
+    import puechaseInFormModal from './components/puechaseInFormModal.vue'
     import {columns} from './puechaseInForm.data';
     import {list, deleteOne, batchDelete, getImportUrl,getExportUrl,batchSubmit,cancelBatchSubmit} from './purchaseInForm.api';
     import { cloneDeep } from "lodash-es";
@@ -130,7 +130,9 @@
     import JSelectInput from '/@/components/Form/src/jeecg/components/JSelectInput.vue';
     import { message } from 'ant-design-vue';
     const formRef = ref();
-    const queryParam = reactive<any>({});
+    const queryParam = reactive<any>({
+        type:'1'
+    });
     //注册model
     const [registerModal, {openModal}] = useModal();
     var classOption = ref([]);
@@ -147,7 +149,7 @@
                  fixed:'right'
              },
              scroll:{
-              x:'4000px'
+              x:'2500px'
              },
              beforeFetch: async (params) => {
                let rangerQuery = await setRangeQuery();
@@ -259,6 +261,11 @@
              auth: 'saleCode:sale_order:edit',
              ifShow: record.submit=='0'||!record.submit
            },
+           {
+             label: '详情(detail)',
+             onClick: handleDetail.bind(null, record),
+             ifShow: record.submit=='1'
+           },
          ]
      }
        /**
@@ -269,6 +276,7 @@
            {
              label: '详情(detail)',
              onClick: handleDetail.bind(null, record),
+             ifShow: record.submit=='0'||!record.submit
            },
            {
              label: '删除(delete)',
@@ -323,6 +331,7 @@
     function searchReset() {
       formRef.value.resetFields();
       selectedRowKeys.value = [];
+      queryParam.type='1'
       //刷新数据
       reload();
     }

+ 6 - 8
src/views/inventiry/purchaseIn/components/selectArrivalList.vue → src/views/publicComponents/selectArrivalList.vue

@@ -13,7 +13,7 @@
                 <a-form :model="queryParams" :label-col="labelCol" :wrapper-col="wrapperCol" @keyup.enter.native="searchQuery">
                 <a-row :gutter="24">
                     <a-col :md="6" :sm="8">
-                        <a-form-item label="到货号(bill code)">
+                        <a-form-item label="到货号(bill code)">
                             <a-input placeholder="请输入" v-model:value="queryParams.billCode"></a-input>
                         </a-form-item>
                     </a-col>
@@ -92,7 +92,7 @@
                 size="small"
                 @change="handleTableChange"
                 :pagination="pagination"
-                :scroll="{ x: 4000, y: 300 }"
+                :scroll="{ x: 3200, y: 300 }"
                 :rowSelection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
             >
             </a-table>
@@ -155,8 +155,8 @@
         },
         {
             title: '机型(model)',
-            dataIndex: 'headModel',
-            key: 'headModel',
+            dataIndex: 'model',
+            key: 'model',
             align:"center"
         },
         {
@@ -246,7 +246,7 @@
     });
     function loadData(){
         let params = getQueryParams();
-        defHttp.get({ url: '/purCode/purOrder/selectPurOrderDetailAlert',params}, { isTransformResponse: false })
+        defHttp.get({ url: '/purCode/purDeliveryNote/purDeliveryNoteArrivalAlert',params}, { isTransformResponse: false })
         .then((res) => {
             if (res.success) {
                 dataSource.value = res.result.records;
@@ -335,7 +335,7 @@
         if(selectedRowKeys.value.length==0){
             message.error('请勾选数据');
         }else if(new Set(arr).size!==1){
-            message.error('请勾选订单编号相同的数据');
+            message.error('请勾选到货单号相同的数据');
         }else{
             emit('selectArrrivalOrder', selectedRows.value)
             handleCancel()
@@ -360,8 +360,6 @@
         }
     }
     function getTable(formData){
-        debugger
-
         visible.value = true
         if(formData.projectName&&formData.projectName!==''){
             fatherProject.value = formData.project