Browse Source

选择项目弹窗-测试问题修改

jingbb 5 months ago
parent
commit
f15cc0ebb3

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

@@ -252,7 +252,7 @@
           formData.projectName = ''
         }else{
           formData.project = data[0].id
-          formData.projectName = data[0].name
+          formData.projectName = data[0].code
         } 
       }
       function addSonList(data){

+ 2 - 2
src/views/inventiry/otherIn/components/otherInForm.vue

@@ -113,7 +113,7 @@
     </a-tabs>
     <BaseShipArchiveAccessoriesModal ref="BaseShipArchiveAccessoriesModalRef"></BaseShipArchiveAccessoriesModal>
     <SelectPrpductModal ref="SelectPrpductModalRef" @selectProduct ='addProduct'></SelectPrpductModal>
-    <SelectProjectModal ref="SelectProjectModalRef" @selectProject="addProject"></SelectProjectModal> <SelectProjectModal ref="SelectProjectModalRef" @selectProject="addProject"></SelectProjectModal>
+    <SelectProjectModal ref="SelectProjectModalRef" @selectProject="addProject"></SelectProjectModal>
     <SelectShipSModal ref="SelectShipSModalRef" @select="addShip"></SelectShipSModal>
   </a-spin>
 </template>
@@ -329,7 +329,7 @@
           formData.projectName = ''
         }else{
           formData.project = data[0].id
-          formData.projectName = data[0].name
+          formData.projectName = data[0].code
         } 
       }
       function addProduct(data){

+ 16 - 2
src/views/publicComponents/SelectProjectModal.vue

@@ -10,8 +10,12 @@
         <div>
             <!--引用表格-->
           <BasicTable @register="registerTable" :rowSelection="rowSelection" size="small">
+            <template #tableTitle>
+              <a-button type="primary"  v-if="allowAdd=='yes'"  @click="handleAdd" preIcon="ant-design:plus-outlined"> 新增(add)</a-button>
+            </template>
           </BasicTable>
         </div>
+        <AddProjectModal ref="addProjectModalRef" @success="reload"></AddProjectModal>
       </a-modal>
 </template>
 <script lang="ts" name="baseCode-baseShipArchive" setup>
@@ -21,10 +25,12 @@
   import {columns, searchFormSchema} from './components/BaseProjectArchive.data';
   import {list} from './components/BaseProjectArchive.api';
   import { message } from 'ant-design-vue';
-
+  import AddProjectModal from './components/AddProjectModal.vue';
   const queryParam = reactive<any>({});
   var visible = ref(false);
   const emit = defineEmits([ 'selectProject']); //定义emit
+  const addProjectModalRef = ref();
+  var allowAdd = ref('')
   //注册table数据
   const { tableContext} = useListPage({
       tableProps:{
@@ -67,7 +73,12 @@
             handleCancel()
         }  
     }
-  function getTable(){
+  function getTable(data){
+    if(data){
+      allowAdd.value='yes'
+    }else{
+      allowAdd.value='no'
+    }
     visible.value = true
    }
    async function getCustom(quotationProject){
@@ -80,6 +91,9 @@
       })
       return cc
     }
+    function handleAdd(){
+     addProjectModalRef.value.getTable()
+   }
    defineExpose({
     getTable,
     getCustom

+ 2 - 2
src/views/saleCode/saleInquiryForm/components/AddProjectModal.vue → src/views/publicComponents/components/AddProjectModal.vue

@@ -53,7 +53,7 @@
     import { defHttp } from '/@/utils/http/axios';
     import { message } from 'ant-design-vue';
     import {ApiSelect} from '/@/components/Form/index';
-    import{CustomerOption} from '../SaleInquiryForm.api';
+    import{CustomerOption} from '../../saleCode/saleInquiryForm/SaleInquiryForm.api';
     var visible = ref(false);
     var form = ref();
     var addProjectModalRef = ref()
@@ -101,7 +101,7 @@
       emit('success')
       visible.value = false
       model.value = {
-            customer:'',
+            customerId:'',
             code:'',
             name:'',
             notes:'',

+ 0 - 8
src/views/publicComponents/components/BaseProjectArchive.data.ts

@@ -39,14 +39,6 @@ export const columns: BasicColumn[] = [
 ];
 //查询数据
 export const searchFormSchema: FormSchema[] = [
-	  {
-      label: "编码(code)",
-      field: 'code',
-      component: 'Input',
-      componentProps:{
-      },
-      //colProps: {span: 6},
- 	  },
    {
       label: "名称(name)",
       field: 'name',

+ 1 - 1
src/views/purchase/arrivedGoods/components/ArriveGoodsFormForm.vue

@@ -388,7 +388,7 @@
           formData.projectName = ''
         }else{
           formData.project = data[0].id
-          formData.projectName = data[0].name
+          formData.projectName = data[0].code
         }
         
       }

+ 1 - 1
src/views/purchase/purchaseInquiryForm/components/PurchaseInquiryFormForm.vue

@@ -405,7 +405,7 @@
       function addProject(data) {
         if(data.length!==0){
           formData.inquiryProject = data[0].id
-           formData.projectName = data[0].name
+           formData.projectName = data[0].code
         }else{
           formData.inquiryProject = ''
           formData.projectName = ''

+ 1 - 1
src/views/purchase/purchaseOrder/components/PurchaseOrderFormForm.vue

@@ -537,7 +537,7 @@
           formData.projectName = ''
         }else{
           formData.project = data[0].id
-          formData.projectName = data[0].name
+          formData.projectName = data[0].code
         } 
       }
        //查看配件信息

+ 1 - 1
src/views/purchase/purchaseQuotationFrm/components/PurchaseQuotationFormForm.vue

@@ -416,7 +416,7 @@
       function addProject(data) {
         if(data.length!==0){
           formData.qutationProject = data[0].id
-           formData.projectName = data[0].name
+           formData.projectName = data[0].code
         }else{
           formData.projectName = ''
           formData.qutationProject = ''

+ 1 - 1
src/views/purchase/selectionQuotationForm/components/SelectQuotationFormForm.vue

@@ -346,7 +346,7 @@
       async function addProject(data) {
         if(data.length!==0){
            formData.inquiryProject = data[0].id
-           formData.projectName = data[0].name
+           formData.projectName = data[0].code
            await getShipDetail(data[0].id)
            await getSupplierQuotationDetail(data[0].id)
            await getSupplierSummaryAmount(data[0].id)

+ 1 - 1
src/views/saleCode/deliveryNotice/components/deliveryNoticeForm.vue

@@ -424,7 +424,7 @@
           formData.projectName = ''
         }else{
           formData.project = data[0].id
-          formData.projectName = data[0].name
+          formData.projectName = data[0].code
           formData.customer =data[0].customerId
           formData.customerName =data[0].customerId_dictText
           customerOption.value.map(item=>{

+ 1 - 1
src/views/saleCode/quotation/components/quotationFormForm.vue

@@ -470,7 +470,7 @@
           formData.quotationProjectName = ''
         }else{
           formData.quotationProject = data[0].id
-          formData.quotationProjectName = data[0].name
+          formData.quotationProjectName = data[0].code
           formData.quotationCustomer =data[0].customerId
           formData.quotationCustomerName =data[0].customerId_dictText
           formData.custumerDiscount==data[0].discount

+ 1 - 1
src/views/saleCode/saleContract/components/SaleContractModal.vue

@@ -194,7 +194,7 @@
           await setFieldsValue({ quotationProjectName: '' });
           await setFieldsValue({ quotationProject: '' });
        }else{
-          await setFieldsValue({ quotationProjectName: data[0].name });
+          await setFieldsValue({ quotationProjectName: data[0].code });
           await setFieldsValue({ quotationProject: data[0].id });
           await setFieldsValue({ quotationCustomerName: data[0].customerId_dictText });
           await setFieldsValue({ quotationCustomer: data[0].customerId });

+ 0 - 14
src/views/saleCode/saleInquiryForm/components/BaseProjectArchive.api.ts

@@ -1,14 +0,0 @@
-import {defHttp} from '/@/utils/http/axios';
-import { useMessage } from "/@/hooks/web/useMessage";
-
-const { createConfirm } = useMessage();
-
-enum Api {
-  list = '/baseCode/baseProjectArchive/list'
-}
-/**
- * 列表接口
- * @param params
- */
-export const list = (params) =>
-  defHttp.get({url: Api.list, params});

+ 0 - 80
src/views/saleCode/saleInquiryForm/components/BaseProjectArchive.data.ts

@@ -1,80 +0,0 @@
-import {BasicColumn} from '/@/components/Table';
-import {FormSchema} from '/@/components/Table';
-import { rules} from '/@/utils/helper/validator';
-import { render } from '/@/utils/common/renderUtils';
-import { getWeekMonthQuarterYear } from '/@/utils';
-//列表数据
-export const columns: BasicColumn[] = [
-  {
-    title: '编码(code)',
-    align:"center",
-    dataIndex: 'code'
-   },
-   {
-    title: '名称(name)',
-    align:"center",
-    dataIndex: 'name'
-   },
-  
-   {
-    title: '客户(customer)',
-    align:"center",
-    dataIndex: 'customerId_dictText'
-   },
-   {
-    title: '备注(notes)',
-    align:"center",
-    dataIndex: 'notes'
-   },
-   {
-    title: '创建时间(create time)',
-    align:"center",
-    dataIndex: 'createTime'
-   },
-   {
-    title: '创建人(create by)',
-    align:"center",
-    dataIndex: 'createBy'
-   },
-];
-//查询数据
-export const searchFormSchema: FormSchema[] = [
-	  {
-      label: "编码(code)",
-      field: 'code',
-      component: 'Input',
-      componentProps:{
-      },
-      //colProps: {span: 6},
- 	  },
-   {
-      label: "名称(name)",
-      field: 'name',
-      component: 'Input',
-        //colProps: {span: 6},
-    },
-    {
-      label: '客户名称(customer name)',
-      field: 'relateCustomer',
-      component: 'Input',
-     },
-     {
-      label: "创建时间(create time)",
-      field: "createTime",
-      component: 'RangePicker',
-      labelWidth: 150,
-      componentProps: {
-          valueType: 'Date',
-          showTime:true
-      },
-      //colProps: {span: 6},
-	},
-	{
-    label: "创建人(create by)",
-    field: 'createBy',
-    component: 'Input',
-    labelWidth: 120,
-    //colProps: {span: 6},
-   },
-	
-];

+ 3 - 3
src/views/saleCode/saleInquiryForm/components/SaleInquiryFormForm.vue

@@ -164,7 +164,7 @@
   import SelectShipSModal from '../../../publicComponents/SelectShipSModal.vue';
   import BaseShipArchiveAccessoriesModal from '../../../publicComponents/BaseShipArchiveAccessoriesModal.vue';
   import SelectPrpductModal from '../../../publicComponents/SelectPrpductModal.vue';
-  import SelectProjectModal from './SelectProjectModal.vue';
+  import SelectProjectModal from '../../../publicComponents/SelectProjectModal.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';
@@ -400,7 +400,7 @@
           formData.projectName = ''
         }else{
           formData.inquiryProject = data[0].id
-          formData.projectName = data[0].name
+          formData.projectName = data[0].code
           formData.inquiryCustomer =data[0].customerId
           formData.customerName =data[0].customerId_dictText
           customerOption.value.map(item=>{
@@ -459,7 +459,7 @@
         })
       }
       function onSearchProject(){
-        SelectProjectModalRef.value.getTable()
+        SelectProjectModalRef.value.getTable('allowAdd')
       }
       function getOptiom(){
         defHttp

+ 0 - 93
src/views/saleCode/saleInquiryForm/components/SelectProjectModal.vue

@@ -1,93 +0,0 @@
-<template>
-    <a-modal
-      title="选择项目(select project)"
-      width="95%"
-      :visible="visible"
-      :maskClosable="false"
-      switchFullscreen
-      @ok = "handleOk"
-      @cancel="handleCancel">
-        <div>
-            <!--引用表格-->
-          <BasicTable @register="registerTable" :rowSelection="rowSelection">
-            <template #tableTitle>
-                <a-button type="primary" v-auth="'saleCode:sale_inquiry_form:add'"  @click="handleAdd" preIcon="ant-design:plus-outlined"> 新增(add)</a-button>
-            </template>
-          </BasicTable>
-          <AddProjectModal ref="addProjectModalRef" @success="reload"></AddProjectModal>
-        </div>
-      </a-modal>
-</template>
-<script lang="ts" name="baseCode-baseShipArchive" setup>
-  import {ref, reactive } from 'vue';
-  import {BasicTable} from '/@/components/Table';
-  import { useListPage } from '/@/hooks/system/useListPage'
-  import {columns, searchFormSchema} from './BaseProjectArchive.data';
-  import AddProjectModal from './AddProjectModal.vue';
-  import {list} from './BaseProjectArchive.api';
-  import { message } from 'ant-design-vue';
-
-  const queryParam = reactive<any>({});
-  var visible = ref(false);
-  const emit = defineEmits([ 'selectProject']); //定义emit
-  var addProjectModalRef = ref();
-  //注册table数据
-  const { tableContext} = useListPage({
-      tableProps:{
-           api:list,
-           columns,
-           canResize:false,
-           formConfig: {
-              schemas: searchFormSchema,
-              autoSubmitOnEnter:true,
-              showAdvancedButton:true,
-              fieldMapToNumber: [
-              ],
-              fieldMapToTime: [
-                 ['shipDate', ['shipDate_begin', 'shipDate_end'], 'YYYY-MM-DD HH:mm:ss'],
-              ],
-            },
-           showTableSetting:false,
-           showActionColumn:false,
-           actionColumn: {
-               width: 200,
-               fixed:'right'
-            },
-            beforeFetch: (params) => {
-              return Object.assign(params, queryParam);
-            },
-      }
-  })
-
-  const [registerTable, {reload},{ rowSelection, selectedRowKeys }] = tableContext
-  
-  function handleCancel() {
-    visible.value = false;
-    selectedRowKeys.value = []
-  }
-  function handleOk() {
-        if(selectedRowKeys.value.length!==1){
-          message.warning('请选择一条数据数据')
-        }else{
-            emit('selectProject',rowSelection.selectedRows)
-            handleCancel()
-        }  
-    }
-  function getTable(){
-    visible.value = true
-   }
-   function handleAdd(){
-     addProjectModalRef.value.getTable()
-   }
-   defineExpose({
-    getTable
-  });
-
-
-</script>
-
-<style lang="less" scoped>
-  :deep(.ant-picker),:deep(.ant-input-number){
-    width: 100%;
-  }
-</style>

+ 1 - 1
src/views/saleCode/salesInvoice/components/saleInvoiceForm.vue

@@ -408,7 +408,7 @@
           formData.projectName = ''
         }else{
           formData.project = data[0].id
-          formData.projectName = data[0].name
+          formData.projectName = data[0].code
           formData.customer =data[0].customerId
           formData.customerName =data[0].customerId_dictText
         }

+ 1 - 1
src/views/saleCode/salesOrder/components/SlaeOrderFormForm.vue

@@ -631,7 +631,7 @@
       }
       function addProject(data){
         formData.project = data[0].id
-        formData.projectName = data[0].name
+        formData.projectName = data[0].code
         formData.customer =data[0].customerId
         formData.customerName =data[0].customerId_dictText
       }