فهرست منبع

现存量-筛选条件修改

jingbb 4 ماه پیش
والد
کامیت
05174710ea

+ 16 - 0
src/views/inventiry/existingQuantity/existingQuantityForm.api.ts

@@ -6,6 +6,10 @@ const { createConfirm } = useMessage();
 enum Api {
   list = '/storeCode/storeOnhand/list',
   exportXls = '/storeCode/storeOnhand/exportXls',
+  classList='baseCode/baseProductClass/list',
+  customerList='/cuspCode/cuspCustomerProfile/list',
+  projectList='/baseCode/baseProjectArchive/list',
+  supplierList='/cuspCode/cuspSupplierProfile/list',
 }
 /**
  * 导出api
@@ -20,3 +24,15 @@ export const getExportUrl = Api.exportXls;
 export const list = (params) =>
   defHttp.get({url: Api.list, params});
 
+//获取客户下拉框列表
+export const CustomerOption = (params) => defHttp.get({ url: Api.customerList, params });
+
+//获取项目下拉框列表
+export const ProjectOption = (params) => defHttp.get({ url: Api.projectList, params });
+/**
+ * 分类列表接口
+ * @param params
+ */
+export const ClassList = (params) => defHttp.get({url: Api.classList, params});
+// 获取供应商列表
+export const supplierOption = (params) => defHttp.get({url: Api.supplierList, params});

+ 49 - 46
src/views/inventiry/existingQuantity/existingQuantityList.vue

@@ -7,38 +7,74 @@
             <a-col :lg="8">
                 <a-form-item name="warehouse">
                   <template #label><span title="仓库(warehouse)">仓库(warehouse)</span></template>
-                  <a-input placeholder="请输入仓库(warehouse)" v-model:value="queryParam.warehouseName" 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="goods allocation">
+                <a-form-item name="goodsAllocation">
                   <template #label><span title="货位(goods allocation)">货位(goods allocation)</span></template>
-                  <a-input placeholder="请输入货位(goods allocation)" v-model:value="queryParam.goodsAllocation" allow-clear ></a-input>
+                  <JDictSelectTag v-model:value="queryParam.goodsAllocation" placeholder="请选择" dictCode="goods_allocation"/>
                 </a-form-item>
             </a-col>          
             <template v-if="toggleSearchStatus">
               <a-col :lg="8">
-                <a-form-item name="projectName">
+                <a-form-item name="project">
                   <template #label><span title="项目(project)">项目(project)</span></template>
-                  <a-input v-model:value="queryParam.projectName" placeholder="请选择" AutoComplete="off"/>
+                  <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="supplierName">
+                <a-form-item name="supplier">
                   <template #label><span title="供应商(supplier)">供应商(supplier)</span></template>
-                  <a-input placeholder="请输入供应商(supplier)" v-model:value="queryParam.supplierName" 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="customerName">
-                  <template #label><span title="客户(customerName)">客户(customerName)</span></template>
-                  <a-input placeholder="请输入" v-model:value="queryParam.customerName" allow-clear ></a-input>
+                <a-form-item name="customer">
+                  <template #label><span title="客户(customer)">客户(customer)</span></template>
+                  <ApiSelect
+                    :api="CustomerOption"
+                    showSearch
+                    v-model:value="queryParam.customer"
+                    :filterOption="false"
+                    resultField="records"
+                    labelField="abbreviation"
+                    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">
@@ -92,21 +128,15 @@
     import {ref, reactive,onMounted} from 'vue';
     import {BasicTable, useTable, TableAction} from '/@/components/Table';
     import { useListPage } from '/@/hooks/system/useListPage'
-    import {useModal} from '/@/components/Modal';
     import {columns} from './existingQuantityForm.data';
-    import {list,getExportUrl} from './existingQuantityForm.api';
+    import {list,getExportUrl,CustomerOption,ProjectOption,ClassList,supplierOption} from './existingQuantityForm.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 { message } from 'ant-design-vue';
+    import { JDictSelectTag,ApiSelect} from '/@/components/Form';
     const formRef = ref();
     const queryParam = reactive<any>({
       type:'2'
     });
     //注册model
-    const [registerModal, {openModal}] = useModal();
-    var classOption = ref([]);
      //注册table数据
     const { prefixCls,tableContext,onExportXls,onImportXls } = useListPage({
         tableProps:{
@@ -138,32 +168,6 @@
     const [registerTable, {reload},{ rowSelection, selectedRowKeys }] = tableContext
   
 
-     // 自动请求并暴露内部方法
-     onMounted(() => {
-      getOptiom()
-    });
-
-    //  产品分类
-    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;
-              });
-    }
-
     /* ----------------------以下为原生查询需要添加的-------------------------- */
     const toggleSearchStatus = ref<boolean>(false);
     const labelCol = reactive({
@@ -188,7 +192,6 @@
     function searchReset() {
       formRef.value.resetFields();
       selectedRowKeys.value = [];
-      queryParam.value.type='2'
       //刷新数据
       reload();
     }