Browse Source

其他入库-筛选条件修改

jingbb 4 months ago
parent
commit
ac3048b4a7

+ 14 - 1
src/views/inventiry/otherIn/otherInForm.api.ts

@@ -16,6 +16,9 @@ enum Api {
   stockInFormProductList = '/storeCode/storePurchaseOther/queryStorePurchaseOtherDetailsByMainId',
   submitBatch='/storeCode/storePurchaseOther/submitBatch',
   cancelSubmitBatch='/storeCode/storePurchaseOther/returnSubmitBatch',
+  classList='baseCode/baseProductClass/list',
+  supplierList='/cuspCode/cuspSupplierProfile/list',
+  projectList='/baseCode/baseProjectArchive/list',
 }
 /**
  * 导出api
@@ -116,4 +119,14 @@ export const cancelBatchSubmit = (params, handleSuccess) => {
       });
     }
   });
-}
+}
+//获取供应商列表
+export const supplierOption = (params) => defHttp.get({url: Api.supplierList, params});
+
+//获取项目下拉框列表
+export const ProjectOption = (params) => defHttp.get({ url: Api.projectList, params });
+/**
+ * 分类列表接口
+ * @param params
+ */
+export const ClassList = (params) => defHttp.get({url: Api.classList, params});

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

@@ -20,19 +20,46 @@
               <a-col :lg="8">
                 <a-form-item name="project">
                   <template #label><span title="项目(project)">项目(project)</span></template>
-                  <a-input v-model:value="queryParam.project" placeholder="请选择"/>
+                  <ApiSelect
+                    :api="ProjectOption"
+                    showSearch
+                    v-model:value="queryParam.project"
+                    :filterOption="false"
+                    resultField="records"
+                    labelField="name"
+                    valueField="id"
+                    :params='{pageSize:-1}'
+                  />
                 </a-form-item>
               </a-col>
               <a-col :lg="8">
                 <a-form-item name="supplier">
                   <template #label><span title="供应商(supplier)">供应商(supplier)</span></template>
-                  <a-input placeholder="请输入供应商(supplier)" v-model:value="queryParam.supplier" allow-clear ></a-input>
+                  <ApiSelect
+                    :api="supplierOption"
+                    showSearch
+                    v-model:value="queryParam.supplier"
+                    :filterOption="false"
+                    resultField="records"
+                    labelField="name"
+                    valueField="id"
+                    :params='{pageSize:-1}'
+                  />
                 </a-form-item>
               </a-col>
               <a-col :lg="8">
                 <a-form-item name="productionClass" >
                   <template #label><span title="产品分类(production class)">产品分类(production class)</span></template>
-                  <JSelectInput   v-model:value="queryParam.productionClass"  placeholder="请选择" :options="classOption" style="width: 100%;"></JSelectInput>
+                  <ApiSelect
+                      :api="ClassList"
+                      showSearch
+                      v-model:value="queryParam.productionClass"
+                      :filterOption="false"
+                      resultField="records"
+                      labelField="name"
+                      valueField="id"
+                      :params='{pageSize:-1}'
+                  />
                 </a-form-item>
               </a-col>
               <a-col :lg="8">
@@ -44,7 +71,7 @@
               <a-col :lg="8">
                 <a-form-item name="maker">
                   <template #label><span title="厂家(maker)">厂家(maker)</span></template>
-                  <a-input placeholder="请输入厂家(maker)" v-model:value="queryParam.maker" allow-clear AutoComplete="off"></a-input>
+                  <JDictSelectTag v-model:value="queryParam.maker" placeholder="请选择" dictCode="factory"/>
                 </a-form-item>
               </a-col>            
               <a-col :lg="8">
@@ -56,13 +83,13 @@
               <a-col :lg="8">
                 <a-form-item name="warehouse">
                   <template #label><span title="仓库(warehouse)">仓库(warehouse)</span></template>
-                  <a-input placeholder="请输" v-model:value="queryParam.warehouse" allow-clear ></a-input>
+                  <JDictSelectTag v-model:value="queryParam.warehouse" placeholder="请选择" dictCode="warehouse"/>
                 </a-form-item>
               </a-col>
               <a-col :lg="8">
                 <a-form-item name="goodsAllocation">
                   <template #label><span title="货位(goods allocation)">货位(goods allocation)</span></template>
-                  <a-input placeholder="请输" v-model:value="queryParam.goodsAllocation" allow-clear ></a-input>
+                  <JDictSelectTag v-model:value="queryParam.goodsAllocation" placeholder="请选择" dictCode="goods_allocation"/>
                 </a-form-item>
               </a-col>
               <a-col :lg="8">
@@ -129,17 +156,14 @@
     import {useModal} from '/@/components/Modal';
     import otherInFormModal from './components/otherInFormModal.vue'
     import {columns} from './otherInForm.data';
-    import {list, deleteOne, batchDelete, getImportUrl,getExportUrl,batchSubmit,cancelBatchSubmit} from './otherInForm.api';
+    import {list, deleteOne, batchDelete, getImportUrl,getExportUrl,batchSubmit,cancelBatchSubmit,supplierOption,ProjectOption,ClassList} from './otherInForm.api';
     import { cloneDeep } from "lodash-es";
-    import { defHttp } from '/@/utils/http/axios';
-    import { JDictSelectTag} from '/@/components/Form';
-    import JSelectInput from '/@/components/Form/src/jeecg/components/JSelectInput.vue';
+    import { JDictSelectTag,ApiSelect} from '/@/components/Form';
     import { message } from 'ant-design-vue';
     const formRef = ref();
     const queryParam = reactive<any>({});
     //注册model
     const [registerModal, {openModal}] = useModal();
-    var classOption = ref([]);
      //注册table数据
     const { prefixCls,tableContext,onExportXls,onImportXls } = useListPage({
         tableProps:{
@@ -182,10 +206,6 @@
       });
       reload();
     }
-     // 自动请求并暴露内部方法
-     onMounted(() => {
-      getOptiom()
-    });
   
      /**
       * 新增事件
@@ -206,26 +226,6 @@
          showFooter: true,
        });
      }
-    //  产品分类
-    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;
-              });
-    }
      /**
       * 详情
      */