jingbb 3 месяцев назад
Родитель
Сommit
aaf9d39087

+ 30 - 8
src/views/baseCode/ShipArchive/BaseShipArchive.data.ts

@@ -1,8 +1,6 @@
 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';
+import {defHttp} from '/@/utils/http/axios';
 //列表数据
 export const columns: BasicColumn[] = [
    {
@@ -60,7 +58,15 @@ export const searchFormSchema: FormSchema[] = [
    {
     label: '关联客户(relate customer)',
     field: 'relateCustomer',
-    component: 'Input',
+    component: 'ApiSelect',
+    componentProps: {
+      api: ()=> defHttp.get({ url: '/cuspCode/cuspCustomerProfile/list?pageSize=-1' }),
+      numberToString: false,
+      labelField: 'name',
+      valueField: 'id',
+      params:{},
+      resultField:'records'
+    },
     labelWidth: 180,
 
    },
@@ -73,7 +79,7 @@ export const searchFormSchema: FormSchema[] = [
    {
     label: "船厂(ship factory)",
     field: 'shipFactory',
-    component: 'JSelectMultiple',
+    component: 'JDictSelectTag',
     labelWidth: 150,
     componentProps:{
       dictCode:"ship_factory"
@@ -94,7 +100,7 @@ export const searchFormSchema: FormSchema[] = [
 {
   label: "船类型(ship type)",
   field: 'shipType',
-  component: 'JSelectMultiple',
+  component: 'JDictSelectTag',
   labelWidth: 180,
   componentProps:{
     dictCode:"ship_type"
@@ -105,7 +111,7 @@ export const searchFormSchema: FormSchema[] = [
 {
   label: "状态(status)",
   field: 'status',
-  component: 'JSelectMultiple',
+  component: 'JDictSelectTag',
   componentProps:{
     dictCode:"valid_status"
   },
@@ -129,6 +135,23 @@ export const formSchema: FormSchema[] = [
     field: 'shipName',
     component: 'Input',
     required: true,
+    componentProps:  ({ formModel }) =>{
+      return {
+        AutoComplete:'off',
+        onblur: ({currentTarget}) => {
+          var stringLog = currentTarget.value;
+          var newString = ''
+          for (let i = 0; i < stringLog.length; i++) {
+              if( (/^[A-Za-z]$/.test(stringLog[i]))&&(/^[a-z]$/.test(stringLog[i]))){
+                newString=newString+stringLog[i].toUpperCase()
+              }else{
+                newString =newString+stringLog[i]
+              }
+          }
+          formModel.shipName = newString
+        },
+      }
+    },
   },
   {
     label: 'hull number',
@@ -173,7 +196,6 @@ export const formSchema: FormSchema[] = [
         stringToNumber:true,
      },
   },
-  
 	// TODO 主键隐藏字段,目前写死为ID
 	{
 	  label: '',

+ 8 - 9
src/views/baseCode/ShipArchive/BaseShipArchiveAccessories.data.ts

@@ -1,8 +1,5 @@
 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[] = [
    
@@ -64,25 +61,27 @@ export const formSchema: FormSchema[] = [
     },
   },
   {
-    label: '规格(specifications)',
+    label: '生产厂家(manufacturer)',
     field: 'specifications',
-    component: 'Input',
+    component: 'JDictSelectTag',
     componentProps:{
-      AutoComplete:'off'
+      AutoComplete:'off',
+      dictCode:'accessory_manufacturer'
     },
   },
   {
     label: '型号(model)',
     field: 'model',
-    component: 'Input',
+    component: 'JDictSelectTag',
     componentProps:{
-      AutoComplete:'off'
+      AutoComplete:'off',
+      dictCode:'accessory_model'
     },
   },
   {
     label: '序列号(serial number)',
     field: 'serialNumber',
-    component: 'InputNumber',
+    component: 'Input',
   },
   {
     label: '备注(notes)',

+ 1 - 1
src/views/baseCode/ShipArchive/BaseShipArchiveList.vue

@@ -1,7 +1,7 @@
 <template>
   <div>
     <!--引用表格-->
-   <BasicTable @register="registerTable" :rowSelection="rowSelection">
+   <BasicTable @register="registerTable" :rowSelection="rowSelection" size="small">
      <!--插槽:table标题-->
       <template #tableTitle>
           <a-button type="primary" v-auth="'baseCode:base_ship_archive:add'" @click="handleAdd" preIcon="ant-design:plus-outlined"> 新增(add)</a-button>

+ 11 - 5
src/views/baseCode/ShipArchive/BaseShipArchiveRelateCustomer.data.ts

@@ -1,8 +1,6 @@
 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';
+import {defHttp} from '/@/utils/http/axios';
 //列表数据
 export const columns: BasicColumn[] = [
    
@@ -52,8 +50,16 @@ export const formSchema: FormSchema[] = [
   {
     label: '客户(customer)',
     field: 'customerId',
-    component: 'Input',
-      show: ({ values }) => {
+    component: 'ApiSelect',
+    componentProps: {
+      api: ()=> defHttp.get({ url: '/cuspCode/cuspCustomerProfile/list?pageSize=-1' }),
+      numberToString: false,
+      labelField: 'name',
+      valueField: 'id',
+      params:{},
+      resultField:'records'
+    },
+    show: ({ values }) => {
         return isShow;
       }
   },

+ 9 - 3
src/views/baseCode/ShipArchive/components/BaseShipArchiveModal.vue

@@ -1,7 +1,9 @@
 <template>
-  <BasicModal v-bind="$attrs" @register="registerModal" destroyOnClose :title="title" :width="800" @ok="handleSubmit">
-      <BasicForm @register="registerForm" name="BaseShipArchiveForm" />
-  </BasicModal>
+  <div ref="BaseShipRef">
+    <BasicModal v-bind="$attrs" @register="registerModal" destroyOnClose :title="title" :width="800" @ok="handleSubmit"  :getContainer ='()=>$refs.BaseShipRef'>
+        <BasicForm @register="registerForm" name="BaseShipArchiveForm" />
+    </BasicModal>
+  </div>
 </template>
 
 <script lang="ts" setup>
@@ -14,6 +16,7 @@
     const emit = defineEmits(['register','success']);
     const isUpdate = ref(true);
     const isDetail = ref(false);
+    const BaseShipRef = ref();
     //表单配置
     const [registerForm, { setProps,resetFields, setFieldsValue, validate, scrollToField }] = useForm({
         labelWidth: 150,
@@ -73,4 +76,7 @@
   :deep(.ant-calendar-picker) {
     width: 100%;
   }
+  /deep/ .ant-form-item{
+    margin-bottom: 12px !important;
+  }
 </style>