Explorar el Código

其他入库-功能

jingbb hace 4 meses
padre
commit
82d31612fe

+ 107 - 33
src/views/inventiry/otherIn/components/otherInForm.vue

@@ -21,32 +21,32 @@
 						</a-col>
 						<a-col :span="12">
 							<a-form-item label="供应商(supplier)" v-bind="validateInfos.supplierName"  id="SaleOrderForm-supplierName" name="supplierName">
-								<a-input v-model:value="formData.supplierName" placeholder="请输入"  allow-clear ></a-input>
+                <JSelectInput   v-model:value="formData.supplier"  placeholder="请选择" allow-clear  :options="supplierOption" @change="changeSupplier"></JSelectInput>
 							</a-form-item>
 						</a-col>
             <a-col :span="12">
 							<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  ></a-input>
+                <JSelectInput   v-model:value="formData.productionClass"  placeholder="请选择" :options="classOption" ></JSelectInput>
 							</a-form-item>
 						</a-col>
 						<a-col :span="12">
 							<a-form-item label="机型(model)" v-bind="validateInfos.model" id="SaleOrderForm-model" name="model">
-                <a-input v-model:value="formData.model" placeholder="请输入"  allow-clear  ></a-input>
+                <JDictSelectTag v-model:value="formData.model" placeholder="请选择" dictCode="model_typer"/>
 							</a-form-item>
 						</a-col>
 						<a-col :span="12">
 							<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 ></a-input>
+								<JDictSelectTag v-model:value="formData.maker" placeholder="请选择" dictCode="factory"/>
 							</a-form-item>
 						</a-col>
             <a-col :span="12">
 							<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>
+                <JDictSelectTag v-model:value="formData.goodsAllocation" placeholder="请选择" dictCode="goods_allocation"/>
 							</a-form-item>
 						</a-col>
             <a-col :span="12">
 							<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>
+                <JDictSelectTag v-model:value="formData.warehouse" placeholder="请选择" dictCode="warehouse"/>
 							</a-form-item>
 						</a-col>
             <a-col :span="12">
@@ -67,14 +67,15 @@
 
 		<!-- 子表单区域 -->
     <a-tabs v-model:activeKey="activeKey" animated  style=" padding: 24px;padding-top: 0px;">
-      <a-tab-pane tab="其他日苦 - 船明细(ship details)" key="purInShip" :forceRender="true">
+      <a-tab-pane tab="其他入库 - 船明细(ship details)" key="otherInShip" :forceRender="true">
+        <a-button type="primary" style="margin-right: 1%;margin-bottom: 1%;" @click="selectShip"> 选择船(select ship)</a-button>
         <j-vxe-table
           :keep-source="true"
           resizable
-          ref="purInShipTableRef"
-          :loading="purInShipTable.loading"
-          :columns="purInShipTable.columns"
-          :dataSource="purInShipTable.dataSource"
+          ref="otherInShipTableRef"
+          :loading="otherInShipTable.loading"
+          :columns="otherInShipTable.columns"
+          :dataSource="otherInShipTable.dataSource"
           :height="340"
           :disabled="disabled"
           :rowNumber="true"
@@ -113,6 +114,7 @@
     <BaseShipArchiveAccessoriesModal ref="BaseShipArchiveAccessoriesModalRef"></BaseShipArchiveAccessoriesModal>
     <SelectPrpductModal ref="SelectPrpductModalRef" @selectProduct ='addProduct'></SelectPrpductModal>
     <SelectProjectModal ref="SelectProjectModalRef" @selectProject="addProject"></SelectProjectModal> <SelectProjectModal ref="SelectProjectModalRef" @selectProject="addProject"></SelectProjectModal>
+    <SelectShipSModal ref="SelectShipSModalRef" @select="addShip"></SelectShipSModal>
   </a-spin>
 </template>
 
@@ -120,14 +122,16 @@
   import { defineComponent, ref, reactive, computed, toRaw} from 'vue';
   import { defHttp } from '/@/utils/http/axios';
   import { useValidateAntFormAndTable } from '/@/hooks/system/useJvxeMethods';
-  import { queryPurInFormShipFormShippTable, querystockInByMainId, queryDataById, saveOrUpdate} from '../otherInForm.api';
+  import { queryOtherInFormShipFormShippTable, querystockInByMainId, queryDataById, saveOrUpdate} from '../otherInForm.api';
   import { JVxeTable } from '/@/components/jeecg/JVxeTable';
   import {otherInShipColumns, stockInColumns} from '../otherInForm.data';
   import BaseShipArchiveAccessoriesModal from '../../../publicComponents/BaseShipArchiveAccessoriesModal.vue';
   import SelectPrpductModal from '../../../publicComponents/SelectPrpductModal.vue';
   import SelectProjectModal from '../../../publicComponents/SelectProjectModal.vue';
+  import SelectShipSModal from '../../../publicComponents/SelectShipSModal.vue';
   import JFormContainer from '/@/components/Form/src/container/JFormContainer.vue';
   import JUpload from '/@/components/Form/src/jeecg/components/JUpload/JUpload.vue';
+  import JSelectInput from '/@/components/Form/src/jeecg/components/JSelectInput.vue';
   import { JDictSelectTag} from '/@/components/Form';
   import { Form, message } from 'ant-design-vue';
   import moment from 'moment';
@@ -141,7 +145,9 @@
       JDictSelectTag,
       BaseShipArchiveAccessoriesModal,
       SelectProjectModal,
-      SelectPrpductModal
+      SelectPrpductModal,
+      SelectShipSModal,
+      JSelectInput
     },
     props:{
       formDisabled:{
@@ -153,13 +159,16 @@
     },
     emits:['success'],
     setup(props, {emit}) {
+      var classOption = ref([]);
+      var supplierOption = ref([]);
       const loading = ref(false);
       const formRef = ref();
       const SelectProjectModalRef = ref()
       const SelectPrpductModalRef = ref()
-      const purInShipTableRef = ref();
+      const SelectShipSModalRef = ref();
+      const otherInShipTableRef = ref();
       const BaseShipArchiveAccessoriesModalRef = ref();
-      const purInShipTable = reactive<Record<string, any>>({
+      const otherInShipTable = reactive<Record<string, any>>({
         loading: false,
         columns: otherInShipColumns,
         dataSource: []
@@ -170,19 +179,17 @@
         columns: stockInColumns,
         dataSource: []
       });
-      const activeKey = ref('purInShip');
+      const activeKey = ref('otherInShip');
       const formData = reactive<Record<string, any>>({
         id: '',
         status: undefined,
         delFlag: undefined,
-        sourceCode:'',
         billCode:'',
         billDate: moment(new Date()).format('YYYY-MM-DD'),   
         project: '', 
         projectName:'',  
         supplier:"",
-        supplierName:'',
-        delivery: '',   
+        supplierName:'',   
         productionClass: '',   
         model:'',   
         maker: '',
@@ -190,8 +197,6 @@
         warehouse:'',
         notes:'',
         attachs:'',
-        arrivalDetails:'',
-        typr:'1'
       });
       //表单验证
       const validatorRules = reactive({
@@ -221,18 +226,22 @@
 
       function add() {
         resetFields();
-        purInShipTable.dataSource = [];
+        otherInShipTable.dataSource = [];
         stockInTable.dataSource = [];
-        activeKey.value = 'purInShip'
+        activeKey.value = 'otherInShip'
+        getSupplierOption()
+        getOptiom()
       }
       async function edit(row) {
         //主表数据
         await queryMainData(row.id);
         //子表数据
-        const purInShipDataList = await queryPurInFormShipFormShippTable(row['id']);
-        purInShipTable.dataSource = [...purInShipDataList];
+        const otherInShipDataList = await queryOtherInFormShipFormShippTable(row['id']);
+        otherInShipTable.dataSource = [...otherInShipDataList];
         const stockInDataList = await querystockInByMainId(row['id']);
         stockInTable.dataSource = [...stockInDataList];
+        getSupplierOption()
+        getOptiom()
       }
 
       async function queryMainData(id) {
@@ -249,8 +258,8 @@
       }
      
       const {getSubFormAndTableData, transformData} = useValidateAntFormAndTable(activeKey, {
-        'storePurchaseInShip': purInShipTableRef,
-        'storePurchaseInDetails': stockInTableRef,
+        'storePurchaseOtherShip': otherInShipTableRef,
+        'storePurchaseOtherDetails': stockInTableRef,
       });
 
       async function getFormData() {
@@ -296,7 +305,7 @@
         let url = '/purCode/purDeliveryNote/queryPurDeliveryNodeShipByMainId'
           defHttp.get({url:url,params}, { isTransformResponse: false }).then(res=>{
             if(res){
-              purInShipTable.dataSource = res.result
+              otherInShipTable.dataSource = res.result
             }
           })
       }
@@ -324,17 +333,76 @@
         } 
       }
       function addProduct(data){
+        debugger
         data.map(item=>{
           item.productClass = item.classId_dictText
           item.productCode = item.code
           item.productId = item.id
         })
-        var arrProduct = data.concat(purOrderFormShipFormProductTable.dataSource)
-        purOrderFormShipFormProductTable.dataSource=arrProduct  
+        var arrProduct = data.concat(stockInTable.dataSource)
+        stockInTable.dataSource=arrProduct  
       }
       function selectProductList(){
         SelectPrpductModalRef.value.getTable()
       }
+      function selectShip(){
+        SelectShipSModalRef.value.getTable()
+      }
+      function addShip(data){
+        var arr = data.concat(otherInShipTable.dataSource)
+        arr.map(item=>item.shipowner = item.relateCustomer)
+        otherInShipTable.dataSource=arr        
+        
+      }
+      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 = ''
+        }
+      }
+      //  产品分类
+      function getOptiom(){
+        defHttp.get({ url: 'baseCode/baseProductClass/list'}, { isTransformResponse: false })
+          .then((res) => {
+           if (res.success) {
+              classOption.value = []
+              res.result.records.forEach(element => {
+                  var obj = {
+                    label: element.name?element.name:'无名称请维护',
+                    value: element.id?element.id:''
+                  };
+                  classOption.value.push( obj)
+              });    
+            } 
+          }).finally(() => {
+                    // loading.value = false;
+          });
+      }
       /**
        * 值改变事件触发-树控件回调
        * @param key
@@ -344,8 +412,8 @@
         formData[key] = value;
       }
       return {
-        purInShipTableRef,
-        purInShipTable,
+        otherInShipTableRef,
+        otherInShipTable,
         stockInTableRef,
         stockInTable,
         validatorRules,
@@ -370,7 +438,13 @@
         addProject,
         selectProductList,
         SelectPrpductModalRef,
-        addProduct
+        addProduct,
+        selectShip,
+        SelectShipSModalRef,
+        addShip,
+        supplierOption,
+        changeSupplier,
+        classOption
       }
     }
   });

+ 4 - 2
src/views/inventiry/otherIn/otherInForm.data.ts

@@ -34,7 +34,7 @@ export const columns: BasicColumn[] = [
    {
     title: '产品分类(production class)',
     align:"center",
-    dataIndex: 'productionClass'
+    dataIndex: 'productionClass_dictText'
    },
    {
     title: '机型(model)',
@@ -60,7 +60,7 @@ export const columns: BasicColumn[] = [
    {
     title: '提交(submit)',
     align:"center",
-    dataIndex: 'submit',
+    dataIndex: 'submit_dictText',
    },
 ];
 
@@ -170,12 +170,14 @@ export const stockInColumns: JVxeColumn[] = [
       placeholder: '请输入${title}',
       width:"200px",
       defaultValue:'',
+      type: JVxeTypes.select,
       options: [],
       dictCode: 'factory',
     },
     {
       title: '质量等级(quality grade)',
       key: 'qualityGrade',
+      type: JVxeTypes.select,
       options: [],
       dictCode: 'quality_grade',
       placeholder: '请输入${title}',

+ 5 - 5
src/views/inventiry/otherIn/othernList.vue

@@ -91,14 +91,14 @@
      <BasicTable @register="registerTable" :rowSelection="rowSelection" size="small" >
        <!--插槽:table标题-->
         <template #tableTitle>
-            <a-button type="primary" v-auth="'saleCode:sale_order:add'"  @click="handleAdd" preIcon="ant-design:plus-outlined"> 新增(add)</a-button>
-            <a-button  type="primary" v-auth="'saleCode:sale_order:exportXls'"  preIcon="ant-design:export-outlined" @click="onExportXls"> 导出(export)</a-button>
+            <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"  @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="'saleCode:sale_order_form:deleteBatch'">
+                    <a-menu-item key="1" @click="batchHandleDelete"  v-auth="'storeCode:store_purchase_other:deleteBatch'">
                       <Icon icon="ant-design:delete-outlined"></Icon>
                       删除(delete)
                     </a-menu-item>
@@ -262,7 +262,7 @@
            {
              label: '编辑(edit)',
              onClick: handleEdit.bind(null, record),
-             auth: 'saleCode:sale_order:edit',
+             auth: 'storeCode:store_purchase_other:edit',
              ifShow: record.submit=='0'||!record.submit
            },
            {
@@ -289,7 +289,7 @@
                confirm: handleDelete.bind(null, record),
                placement: 'topLeft'
              },
-             auth: 'saleCode:sale_order:delete',
+             auth: 'storeCode:store_purchase_other:delete',
              ifShow: record.submit=='0'||!record.submit
            }
          ]