yuansh 1 mese fa
parent
commit
9eecf16420

+ 71 - 0
src/views/saleCode/saleInterfaceSync/SaleInterfaceSync.api.ts

@@ -0,0 +1,71 @@
+import {defHttp} from '/@/utils/http/axios';
+import { useMessage } from "/@/hooks/web/useMessage";
+
+const { createConfirm } = useMessage();
+
+enum Api {
+  list = '/saleCode/saleInterfaceSync/list',
+  save='/saleCode/saleInterfaceSync/add',
+  edit='/saleCode/saleInterfaceSync/edit',
+  deleteOne = '/saleCode/saleInterfaceSync/delete',
+  deleteBatch = '/saleCode/saleInterfaceSync/deleteBatch',
+  importExcel = '/saleCode/saleInterfaceSync/importExcel',
+  exportXls = '/saleCode/saleInterfaceSync/exportXls',
+  saleInterfaceItemList = '/saleCode/saleInterfaceSync/querySaleInterfaceItemByMainId',
+}
+/**
+ * 导出api
+ * @param params
+ */
+export const getExportUrl = Api.exportXls;
+
+/**
+ * 导入api
+ */
+export const getImportUrl = Api.importExcel;
+/**
+ * 查询子表数据
+ * @param params
+ */
+export const saleInterfaceItemList = Api.saleInterfaceItemList;
+/**
+ * 列表接口
+ * @param params
+ */
+export const list = (params) =>
+  defHttp.get({url: Api.list, params});
+
+/**
+ * 删除单个
+ */
+export const deleteOne = (params,handleSuccess) => {
+  return defHttp.delete({url: Api.deleteOne, params}, {joinParamsToUrl: true}).then(() => {
+    handleSuccess();
+  });
+}
+/**
+ * 批量删除
+ * @param params
+ */
+export const batchDelete = (params, handleSuccess) => {
+  createConfirm({
+    iconType: 'warning',
+    title: '确认删除',
+    content: '是否删除选中数据',
+    okText: '确认',
+    cancelText: '取消',
+    onOk: () => {
+      return defHttp.delete({url: Api.deleteBatch, data: params}, {joinParamsToUrl: true}).then(() => {
+        handleSuccess();
+      });
+    }
+  });
+}
+/**
+ * 保存或者更新
+ * @param params
+ */
+export const saveOrUpdate = (params, isUpdate) => {
+  let url = isUpdate ? Api.edit : Api.save;
+  return defHttp.post({url: url, params});
+}

+ 602 - 0
src/views/saleCode/saleInterfaceSync/SaleInterfaceSync.data.ts

@@ -0,0 +1,602 @@
+import {BasicColumn} from '/@/components/Table';
+import {FormSchema} from '/@/components/Table';
+import { rules} from '/@/utils/helper/validator';
+import { render } from '/@/utils/common/renderUtils';
+import {JVxeTypes,JVxeColumn} from '/@/components/jeecg/JVxeTable/types'
+import { getWeekMonthQuarterYear } from '/@/utils';
+//列表数据
+export const columns: BasicColumn[] = [
+   {
+    title: '交易编号',
+    align:"center",
+    dataIndex: 'transactionId'
+   },
+   {
+    title: '客户号',
+    align:"center",
+    dataIndex: 'buyerTnId'
+   },
+   {
+    title: '客户名称',
+    align:"center",
+    dataIndex: 'buyerName'
+   },
+   {
+    title: '供应商号',
+    align:"center",
+    dataIndex: 'supplierTnId'
+   },
+   {
+    title: '供应商名称',
+    align:"center",
+    dataIndex: 'supplierName'
+   },
+   {
+    title: '优先级',
+    align:"center",
+    dataIndex: 'priority'
+   },
+   {
+    title: '币种',
+    align:"center",
+    dataIndex: 'currencyCode'
+   },
+   {
+    title: '编号',
+    align:"center",
+    dataIndex: 'referenceNumber'
+   },
+   {
+    title: '请求交货日期',
+    align:"center",
+    dataIndex: 'requestedDeliveryDate',
+    customRender:({text}) =>{
+      text = !text ? "" : (text.length > 10 ? text.substr(0,10) : text);
+      return text;
+    },
+   },
+   {
+    title: '建议截止日期',
+    align:"center",
+    dataIndex: 'adviseBeforeDate',
+    customRender:({text}) =>{
+      text = !text ? "" : (text.length > 10 ? text.substr(0,10) : text);
+      return text;
+    },
+   },
+   {
+    title: '提交日期',
+    align:"center",
+    dataIndex: 'submittedDate'
+   },
+   {
+    title: '内容',
+    align:"center",
+    dataIndex: 'content'
+   },
+   {
+    title: '同步状态(0-未同步,1-同步成功,2-同步失败)',
+    align:"center",
+    dataIndex: 'sync'
+   },
+   {
+    title: '同步信息',
+    align:"center",
+    dataIndex: 'syncInfo'
+   },
+   {
+    title: '同步人',
+    align:"center",
+    dataIndex: 'syncBy'
+   },
+   {
+    title: '同步时间',
+    align:"center",
+    dataIndex: 'syncTime'
+   },
+   {
+    title: '同步单号',
+    align:"center",
+    dataIndex: 'syncCode'
+   },
+   {
+    title: 'subject',
+    align:"center",
+    dataIndex: 'subject'
+   },
+   {
+    title: 'comment',
+    align:"center",
+    dataIndex: 'comment'
+   },
+   {
+    title: 'requisitionId',
+    align:"center",
+    dataIndex: 'requisitionId'
+   },
+   {
+    title: 'requestForQuoteId',
+    align:"center",
+    dataIndex: 'requestForQuoteId'
+   },
+   {
+    title: 'quoteId',
+    align:"center",
+    dataIndex: 'quoteId'
+   },
+   {
+    title: 'offeredQuality',
+    align:"center",
+    dataIndex: 'offeredQuality'
+   },
+   {
+    title: 'taxStatus',
+    align:"center",
+    dataIndex: 'taxStatus'
+   },
+   {
+    title: 'paymentTerms',
+    align:"center",
+    dataIndex: 'paymentTerms'
+   },
+   {
+    title: 'vesselCode',
+    align:"center",
+    dataIndex: 'vesselCode'
+   },
+   {
+    title: 'vesselImo',
+    align:"center",
+    dataIndex: 'vesselImo'
+   },
+   {
+    title: 'buyerContactName',
+    align:"center",
+    dataIndex: 'buyerContactName'
+   },
+   {
+    title: 'buyerContactJob',
+    align:"center",
+    dataIndex: 'buyerContactJob'
+   },
+   {
+    title: 'buyerTelephone',
+    align:"center",
+    dataIndex: 'buyerTelephone'
+   },
+   {
+    title: 'buyerFax',
+    align:"center",
+    dataIndex: 'buyerFax'
+   },
+   {
+    title: 'buyerEmail',
+    align:"center",
+    dataIndex: 'buyerEmail'
+   },
+   {
+    title: 'status',
+    align:"center",
+    dataIndex: 'status'
+   },
+];
+//查询数据
+export const searchFormSchema: FormSchema[] = [
+	{
+      label: "客户号",
+      field: "buyerTnId",
+      component: 'Input',
+      //colProps: {span: 6},
+ 	},
+	{
+      label: "客户名称",
+      field: "buyerName",
+      component: 'Input',
+      //colProps: {span: 6},
+ 	},
+     {
+      label: "提交日期",
+      field: "submittedDate",
+      component: 'RangePicker',
+      componentProps: {
+          valueType: 'Date',
+          showTime:true
+      },
+      //colProps: {span: 6},
+	},
+];
+//表单数据
+export const formSchema: FormSchema[] = [
+  {
+    label: '交易编号',
+    field: 'transactionId',
+    component: 'Input',
+  },
+  {
+    label: '客户号',
+    field: 'buyerTnId',
+    component: 'Input',
+    dynamicRules: ({model,schema}) => {
+          return [
+                 { required: true, message: '请输入客户号!'},
+          ];
+     },
+  },
+  {
+    label: '客户名称',
+    field: 'buyerName',
+    component: 'Input',
+    dynamicRules: ({model,schema}) => {
+          return [
+                 { required: true, message: '请输入客户名称!'},
+          ];
+     },
+  },
+  {
+    label: '供应商号',
+    field: 'supplierTnId',
+    component: 'Input',
+  },
+  {
+    label: '供应商名称',
+    field: 'supplierName',
+    component: 'Input',
+  },
+  {
+    label: '优先级',
+    field: 'priority',
+    component: 'Input',
+  },
+  {
+    label: '币种',
+    field: 'currencyCode',
+    component: 'Input',
+  },
+  {
+    label: '编号',
+    field: 'referenceNumber',
+    component: 'Input',
+  },
+  {
+    label: '请求交货日期',
+    field: 'requestedDeliveryDate',
+    component: 'DatePicker',
+    componentProps:{
+      valueFormat: 'YYYY-MM-DD'
+    },    
+  },
+  {
+    label: '建议截止日期',
+    field: 'adviseBeforeDate',
+    component: 'DatePicker',
+    componentProps:{
+      valueFormat: 'YYYY-MM-DD'
+    },    
+  },
+  {
+    label: '提交日期',
+    field: 'submittedDate',
+    component: 'DatePicker',
+    componentProps: {
+       showTime:true,
+       valueFormat: 'YYYY-MM-DD HH:mm:ss'
+     },
+  },
+  {
+    label: '内容',
+    field: 'content',
+    component: 'InputTextArea',
+  },
+  {
+    label: '同步状态(0-未同步,1-同步成功,2-同步失败)',
+    field: 'sync',
+    component: 'InputNumber',
+  },
+  {
+    label: '同步信息',
+    field: 'syncInfo',
+    component: 'Input',
+  },
+  {
+    label: '同步人',
+    field: 'syncBy',
+    component: 'Input',
+  },
+  {
+    label: '同步时间',
+    field: 'syncTime',
+    component: 'DatePicker',
+    componentProps: {
+       showTime:true,
+       valueFormat: 'YYYY-MM-DD HH:mm:ss'
+     },
+  },
+  {
+    label: '同步单号',
+    field: 'syncCode',
+    component: 'Input',
+  },
+  {
+    label: 'subject',
+    field: 'subject',
+    component: 'Input',
+  },
+  {
+    label: 'comment',
+    field: 'comment',
+    component: 'Input',
+  },
+  {
+    label: 'requisitionId',
+    field: 'requisitionId',
+    component: 'Input',
+  },
+  {
+    label: 'requestForQuoteId',
+    field: 'requestForQuoteId',
+    component: 'Input',
+  },
+  {
+    label: 'quoteId',
+    field: 'quoteId',
+    component: 'Input',
+  },
+  {
+    label: 'offeredQuality',
+    field: 'offeredQuality',
+    component: 'Input',
+  },
+  {
+    label: 'taxStatus',
+    field: 'taxStatus',
+    component: 'Input',
+  },
+  {
+    label: 'paymentTerms',
+    field: 'paymentTerms',
+    component: 'Input',
+  },
+  {
+    label: 'vesselCode',
+    field: 'vesselCode',
+    component: 'Input',
+  },
+  {
+    label: 'vesselImo',
+    field: 'vesselImo',
+    component: 'Input',
+  },
+  {
+    label: 'buyerContactName',
+    field: 'buyerContactName',
+    component: 'Input',
+  },
+  {
+    label: 'buyerContactJob',
+    field: 'buyerContactJob',
+    component: 'Input',
+  },
+  {
+    label: 'buyerTelephone',
+    field: 'buyerTelephone',
+    component: 'Input',
+  },
+  {
+    label: 'buyerFax',
+    field: 'buyerFax',
+    component: 'Input',
+  },
+  {
+    label: 'buyerEmail',
+    field: 'buyerEmail',
+    component: 'Input',
+  },
+  {
+    label: 'status',
+    field: 'status',
+    component: 'Input',
+  },
+	// TODO 主键隐藏字段,目前写死为ID
+	{
+	  label: '',
+	  field: 'id',
+	  component: 'Input',
+	  show: false
+	},
+];
+//子表单数据
+//子表表格配置
+export const saleInterfaceItemColumns: JVxeColumn[] = [
+    {
+      title: 'headId',
+      key: 'headId',
+      type: JVxeTypes.input,
+      width:"200px",
+      placeholder: '请输入${title}',
+      defaultValue:'',
+    },
+    {
+      title: '同步状态(0-未同步,1-同步成功,2-同步失败)',
+      key: 'sync',
+      type: JVxeTypes.inputNumber,
+      width:"200px",
+      placeholder: '请输入${title}',
+      defaultValue:'',
+    },
+    {
+      title: '同步信息',
+      key: 'syncInfo',
+      type: JVxeTypes.input,
+      width:"200px",
+      placeholder: '请输入${title}',
+      defaultValue:'',
+    },
+    {
+      title: '同步人',
+      key: 'syncBy',
+      type: JVxeTypes.input,
+      width:"200px",
+      placeholder: '请输入${title}',
+      defaultValue:'',
+    },
+    {
+      title: '同步时间',
+      key: 'syncTime',
+      type: JVxeTypes.datetime,
+      width:"200px",
+      placeholder: '请输入${title}',
+      defaultValue:'',
+    },
+    {
+      title: '同步单号',
+      key: 'syncCode',
+      type: JVxeTypes.input,
+      width:"200px",
+      placeholder: '请输入${title}',
+      defaultValue:'',
+    },
+    {
+      title: '同步后的产品编码',
+      key: 'syncItemCode',
+      type: JVxeTypes.input,
+      width:"200px",
+      placeholder: '请输入${title}',
+      defaultValue:'',
+    },
+    {
+      title: '内容',
+      key: 'content',
+      type: JVxeTypes.textarea,
+      width:"200px",
+      placeholder: '请输入${title}',
+      defaultValue:'',
+    },
+    {
+      title: 'number',
+      key: 'number',
+      type: JVxeTypes.inputNumber,
+      width:"200px",
+      placeholder: '请输入${title}',
+      defaultValue:'',
+    },
+    {
+      title: 'description',
+      key: 'description',
+      type: JVxeTypes.input,
+      width:"200px",
+      placeholder: '请输入${title}',
+      defaultValue:'',
+        validateRules: [
+          { required: true, message: '${title}不能为空' },
+        ],
+    },
+    {
+      title: 'supplierPartNumber',
+      key: 'supplierPartNumber',
+      type: JVxeTypes.input,
+      width:"200px",
+      placeholder: '请输入${title}',
+      defaultValue:'',
+    },
+    {
+      title: 'quantity',
+      key: 'quantity',
+      type: JVxeTypes.input,
+      width:"200px",
+      placeholder: '请输入${title}',
+      defaultValue:'',
+    },
+    {
+      title: 'unitOfMeasure',
+      key: 'unitOfMeasure',
+      type: JVxeTypes.input,
+      width:"200px",
+      placeholder: '请输入${title}',
+      defaultValue:'',
+    },
+    {
+      title: 'unitPrice',
+      key: 'unitPrice',
+      type: JVxeTypes.inputNumber,
+      width:"200px",
+      placeholder: '请输入${title}',
+      defaultValue:'',
+    },
+    {
+      title: 'comment',
+      key: 'comment',
+      type: JVxeTypes.input,
+      width:"200px",
+      placeholder: '请输入${title}',
+      defaultValue:'',
+    },
+  ]
+
+
+// 高级查询数据
+export const superQuerySchema = {
+  transactionId: {title: '交易编号',order: 0,view: 'text', type: 'string',},
+  buyerTnId: {title: '客户号',order: 1,view: 'text', type: 'string',},
+  buyerName: {title: '客户名称',order: 2,view: 'text', type: 'string',},
+  supplierTnId: {title: '供应商号',order: 3,view: 'text', type: 'string',},
+  supplierName: {title: '供应商名称',order: 4,view: 'text', type: 'string',},
+  priority: {title: '优先级',order: 5,view: 'text', type: 'string',},
+  currencyCode: {title: '币种',order: 6,view: 'text', type: 'string',},
+  referenceNumber: {title: '编号',order: 7,view: 'text', type: 'string',},
+  requestedDeliveryDate: {title: '请求交货日期',order: 8,view: 'date', type: 'string',},
+  adviseBeforeDate: {title: '建议截止日期',order: 9,view: 'date', type: 'string',},
+  submittedDate: {title: '提交日期',order: 10,view: 'datetime', type: 'string',},
+  content: {title: '内容',order: 11,view: 'textarea', type: 'string',},
+  sync: {title: '同步状态(0-未同步,1-同步成功,2-同步失败)',order: 12,view: 'number', type: 'number',},
+  syncInfo: {title: '同步信息',order: 13,view: 'text', type: 'string',},
+  syncBy: {title: '同步人',order: 14,view: 'text', type: 'string',},
+  syncTime: {title: '同步时间',order: 15,view: 'datetime', type: 'string',},
+  syncCode: {title: '同步单号',order: 16,view: 'text', type: 'string',},
+  subject: {title: 'subject',order: 18,view: 'text', type: 'string',},
+  comment: {title: 'comment',order: 19,view: 'text', type: 'string',},
+  requisitionId: {title: 'requisitionId',order: 20,view: 'text', type: 'string',},
+  requestForQuoteId: {title: 'requestForQuoteId',order: 21,view: 'text', type: 'string',},
+  quoteId: {title: 'quoteId',order: 22,view: 'text', type: 'string',},
+  offeredQuality: {title: 'offeredQuality',order: 23,view: 'text', type: 'string',},
+  taxStatus: {title: 'taxStatus',order: 24,view: 'text', type: 'string',},
+  paymentTerms: {title: 'paymentTerms',order: 25,view: 'text', type: 'string',},
+  vesselCode: {title: 'vesselCode',order: 26,view: 'text', type: 'string',},
+  vesselImo: {title: 'vesselImo',order: 27,view: 'text', type: 'string',},
+  buyerContactName: {title: 'buyerContactName',order: 28,view: 'text', type: 'string',},
+  buyerContactJob: {title: 'buyerContactJob',order: 29,view: 'text', type: 'string',},
+  buyerTelephone: {title: 'buyerTelephone',order: 30,view: 'text', type: 'string',},
+  buyerFax: {title: 'buyerFax',order: 31,view: 'text', type: 'string',},
+  buyerEmail: {title: 'buyerEmail',order: 32,view: 'text', type: 'string',},
+  status: {title: 'status',order: 33,view: 'text', type: 'string',},
+  //子表高级查询
+  saleInterfaceItem: {
+    title: '询价单-接口同步-子表',
+    view: 'table',
+    fields: {
+        headId: {title: 'headId',order: 0,view: 'text', type: 'string',},
+        sync: {title: '同步状态(0-未同步,1-同步成功,2-同步失败)',order: 2,view: 'number', type: 'number',},
+        syncInfo: {title: '同步信息',order: 3,view: 'text', type: 'string',},
+        syncBy: {title: '同步人',order: 4,view: 'text', type: 'string',},
+        syncTime: {title: '同步时间',order: 5,view: 'datetime', type: 'string',},
+        syncCode: {title: '同步单号',order: 6,view: 'text', type: 'string',},
+        syncItemCode: {title: '同步后的产品编码',order: 7,view: 'text', type: 'string',},
+        content: {title: '内容',order: 8,view: 'textarea', type: 'string',},
+        number: {title: 'number',order: 9,view: 'number', type: 'number',},
+        description: {title: 'description',order: 10,view: 'text', type: 'string',},
+        supplierPartNumber: {title: 'supplierPartNumber',order: 11,view: 'text', type: 'string',},
+        quantity: {title: 'quantity',order: 12,view: 'text', type: 'string',},
+        unitOfMeasure: {title: 'unitOfMeasure',order: 13,view: 'text', type: 'string',},
+        unitPrice: {title: 'unitPrice',order: 14,view: 'number', type: 'number',},
+        comment: {title: 'comment',order: 15,view: 'text', type: 'string',},
+    }
+  },
+};
+
+/**
+* 流程表单调用这个方法获取formSchema
+* @param param
+*/
+export function getBpmFormSchema(_formData): FormSchema[]{
+// 默认和原始表单保持一致 如果流程中配置了权限数据,这里需要单独处理formSchema
+  return formSchema;
+}

+ 193 - 0
src/views/saleCode/saleInterfaceSync/SaleInterfaceSyncList.vue

@@ -0,0 +1,193 @@
+<template>
+  <div>
+    <!--引用表格-->
+   <BasicTable @register="registerTable" :rowSelection="rowSelection">
+     <!--插槽:table标题-->
+      <template #tableTitle>
+          <a-button type="primary" v-auth="'saleCode:sale_interface_sync:add'"  @click="handleAdd" preIcon="ant-design:plus-outlined"> 新增</a-button>
+          <a-button  type="primary" v-auth="'saleCode:sale_interface_sync:exportXls'"  preIcon="ant-design:export-outlined" @click="onExportXls"> 导出</a-button>
+          <j-upload-button  type="primary" v-auth="'saleCode:sale_interface_sync:importExcel'"  preIcon="ant-design:import-outlined" @click="onImportXls">导入</j-upload-button>
+          <a-dropdown v-if="selectedRowKeys.length > 0">
+              <template #overlay>
+                <a-menu>
+                  <a-menu-item key="1" @click="batchHandleDelete">
+                    <Icon icon="ant-design:delete-outlined"></Icon>
+                    删除
+                  </a-menu-item>
+                </a-menu>
+              </template>
+              <a-button v-auth="'saleCode:sale_interface_sync:deleteBatch'">批量操作
+                <Icon icon="mdi:chevron-down"></Icon>
+              </a-button>
+        </a-dropdown>
+        <!-- 高级查询 -->
+        <super-query :config="superQueryConfig" @search="handleSuperQuery" />
+      </template>
+       <!--操作栏-->
+      <template #action="{ record }">
+        <TableAction :actions="getTableAction(record)" :dropDownActions="getDropDownAction(record)"/>
+      </template>
+      <!--字段回显插槽-->
+      <template v-slot:bodyCell="{ column, record, index, text }">
+      </template>
+    </BasicTable>
+    <!-- 表单区域 -->
+    <SaleInterfaceSyncModal @register="registerModal" @success="handleSuccess"></SaleInterfaceSyncModal>
+  </div>
+</template>
+
+<script lang="ts" name="saleCode-saleInterfaceSync" setup>
+  import {ref, reactive, computed, unref} from 'vue';
+  import {BasicTable, useTable, TableAction} from '/@/components/Table';
+  import { useListPage } from '/@/hooks/system/useListPage'
+  import {useModal} from '/@/components/Modal';
+  import SaleInterfaceSyncModal from './components/SaleInterfaceSyncModal.vue'
+  import {columns, searchFormSchema, superQuerySchema} from './SaleInterfaceSync.data';
+  import {list, deleteOne, batchDelete, getImportUrl,getExportUrl} from './SaleInterfaceSync.api';
+  import {downloadFile} from '/@/utils/common/renderUtils';
+  import { useUserStore } from '/@/store/modules/user';
+  const queryParam = reactive<any>({});
+  const checkedKeys = ref<Array<string | number>>([]);
+  const userStore = useUserStore();
+  //注册model
+  const [registerModal, {openModal}] = useModal();
+   //注册table数据
+  const { prefixCls,tableContext,onExportXls,onImportXls } = useListPage({
+      tableProps:{
+           title: '询价单-接口同步表',
+           api: list,
+           columns,
+           canResize:false,
+           formConfig: {
+                //labelWidth: 120,
+                schemas: searchFormSchema,
+                autoSubmitOnEnter:true,
+                showAdvancedButton:true,
+                fieldMapToNumber: [
+                ],
+                fieldMapToTime: [
+                   ['submittedDate', ['submittedDate_begin', 'submittedDate_end'], 'YYYY-MM-DD HH:mm:ss'],
+                ],
+            },
+           actionColumn: {
+               width: 120,
+               fixed:'right'
+           },
+           beforeFetch: (params) => {
+             return Object.assign(params, queryParam);
+           },
+        },
+        exportConfig: {
+            name:"询价单-接口同步表",
+            url: getExportUrl,
+            params: queryParam,
+        },
+        importConfig: {
+            url: getImportUrl,
+            success: handleSuccess
+        },
+    })
+
+  const [registerTable, {reload},{ rowSelection, selectedRowKeys }] = tableContext
+
+  // 高级查询配置
+  const superQueryConfig = reactive(superQuerySchema);
+
+  /**
+   * 高级查询事件
+   */
+  function handleSuperQuery(params) {
+    Object.keys(params).map((k) => {
+      queryParam[k] = params[k];
+    });
+    reload();
+  }
+
+   /**
+    * 新增事件
+    */
+  function handleAdd() {
+     openModal(true, {
+       isUpdate: false,
+       showFooter: true,
+     });
+  }
+   /**
+    * 编辑事件
+    */
+  function handleEdit(record: Recordable) {
+     openModal(true, {
+       record,
+       isUpdate: true,
+       showFooter: true,
+     });
+   }
+   /**
+    * 详情
+   */
+  function handleDetail(record: Recordable) {
+     openModal(true, {
+       record,
+       isUpdate: true,
+       showFooter: false,
+     });
+   }
+   /**
+    * 删除事件
+    */
+  async function handleDelete(record) {
+     await deleteOne({id: record.id}, handleSuccess);
+   }
+   /**
+    * 批量删除事件
+    */
+  async function batchHandleDelete() {
+     await batchDelete({ids: selectedRowKeys.value},handleSuccess);
+   }
+   /**
+    * 成功回调
+    */
+  function handleSuccess() {
+      (selectedRowKeys.value = []) && reload();
+   }
+   /**
+      * 操作栏
+      */
+  function getTableAction(record){
+       return [
+         {
+           label: '编辑',
+           onClick: handleEdit.bind(null, record),
+           auth: 'saleCode:sale_interface_sync:edit'
+         }
+       ]
+   }
+
+
+  /**
+   * 下拉操作栏
+   */
+  function getDropDownAction(record){
+    return [
+      {
+        label: '详情',
+        onClick: handleDetail.bind(null, record),
+      }, {
+        label: '删除',
+        popConfirm: {
+          title: '是否确认删除',
+          confirm: handleDelete.bind(null, record),
+          placement: 'topLeft'
+        },
+        auth: 'saleCode:sale_interface_sync:delete'
+      }
+    ]
+  }
+
+</script>
+
+<style lang="less" scoped>
+  :deep(.ant-picker),:deep(.ant-input-number){
+    width: 100%;
+  }
+</style>

+ 118 - 0
src/views/saleCode/saleInterfaceSync/components/SaleInterfaceSyncForm.vue

@@ -0,0 +1,118 @@
+<template>
+  <div>
+    <BasicForm @register="registerForm" ref="formRef"/>
+    <!-- 子表单区域 -->
+    <a-tabs v-model:activeKey="activeKey" animated  @change="handleChangeTabs">
+      <a-tab-pane tab="询价单-接口同步-子表" key="saleInterfaceItem" :forceRender="true">
+        <JVxeTable
+          keep-source
+          resizable
+          ref="saleInterfaceItem"
+          v-if="saleInterfaceItemTable.show"
+          :loading="saleInterfaceItemTable.loading"
+          :columns="saleInterfaceItemTable.columns"
+          :dataSource="saleInterfaceItemTable.dataSource"
+          :height="340"
+          :rowNumber="true"
+          :rowSelection="true"
+          :disabled="formDisabled"
+          :toolbar="true"
+        />
+      </a-tab-pane>
+    </a-tabs>
+
+    <div style="width: 100%;text-align: center" v-if="!formDisabled">
+      <a-button @click="handleSubmit" pre-icon="ant-design:check" type="primary">提 交</a-button>
+    </div>
+  </div>
+</template>
+
+<script lang="ts">
+
+  import {BasicForm, useForm} from '/@/components/Form/index';
+  import { computed, defineComponent, reactive, ref, unref } from 'vue';
+  import {defHttp} from '/@/utils/http/axios';
+  import { propTypes } from '/@/utils/propTypes';
+  import { useJvxeMethod } from '/@/hooks/system/useJvxeMethods';
+  import { VALIDATE_FAILED } from '/@/utils/common/vxeUtils';
+  import {getBpmFormSchema,saleInterfaceItemColumns} from '../SaleInterfaceSync.data';
+  import {saveOrUpdate,saleInterfaceItemList} from '../SaleInterfaceSync.api';
+
+  export default defineComponent({
+    name: "SaleInterfaceSyncForm",
+    components:{
+      BasicForm,
+    },
+    props:{
+      formData: propTypes.object.def({}),
+      formBpm: propTypes.bool.def(true),
+    },
+    setup(props){
+      const [registerForm, { setFieldsValue, setProps }] = useForm({
+        labelWidth: 150,
+        schemas: getBpmFormSchema(props.formData),
+        showActionButtonGroup: false,
+        baseColProps: {span: 12}
+      });
+
+      const formDisabled = computed(()=>{
+        if(props.formData.disabled === false){
+          return false;
+        }
+        return true;
+      });
+
+      const refKeys = ref(['saleInterfaceItem', ]);
+      const activeKey = ref('saleInterfaceItem');
+      const saleInterfaceItem = ref();
+      const tableRefs = {saleInterfaceItem, };
+      const saleInterfaceItemTable = reactive({
+        loading: false,
+        dataSource: [],
+        columns:saleInterfaceItemColumns,
+        show: false
+      })
+
+      const [handleChangeTabs,handleSubmit,requestSubTableData,formRef] = useJvxeMethod(requestAddOrEdit,classifyIntoFormData,tableRefs,activeKey,refKeys,validateSubForm);
+
+      function classifyIntoFormData(allValues) {
+        let main = Object.assign({}, allValues.formValue)
+        return {
+          ...main, // 展开
+          saleInterfaceItemList: allValues.tablesValue[0].tableData,
+        }
+      }
+
+      //表单提交事件
+      async function requestAddOrEdit(values) {
+        await saveOrUpdate(values, true);
+      }
+
+      const queryByIdUrl = '/saleCode/saleInterfaceSync/queryById';
+      async function initFormData(){
+        let params = {id: props.formData.dataId};
+        const data = await defHttp.get({url: queryByIdUrl, params});
+        //设置表单的值
+        await setFieldsValue({...data});
+        requestSubTableData(saleInterfaceItemList, {id: data.id}, saleInterfaceItemTable, ()=>{
+          saleInterfaceItemTable.show = true;
+        });
+        //默认是禁用
+        await setProps({disabled: formDisabled.value})
+      }
+
+      initFormData();
+
+      return {
+        registerForm,
+        formDisabled,
+        formRef,
+        handleSubmit,
+        activeKey,
+        handleChangeTabs,
+        saleInterfaceItem,
+        saleInterfaceItemTable,
+      }
+    }
+  });
+</script>

+ 113 - 0
src/views/saleCode/saleInterfaceSync/components/SaleInterfaceSyncModal.vue

@@ -0,0 +1,113 @@
+<template>
+  <BasicModal v-bind="$attrs" @register="registerModal" destroyOnClose :title="title" :width="896" @ok="handleSubmit">
+    <BasicForm @register="registerForm" ref="formRef" name="SaleInterfaceSyncForm"/>
+    <!-- 子表单区域 -->
+    <a-tabs v-model:activeKey="activeKey" animated @change="handleChangeTabs">
+      <a-tab-pane tab="询价单-接口同步-子表" key="saleInterfaceItem" :forceRender="true">
+        <JVxeTable
+          keep-source
+          resizable
+          ref="saleInterfaceItem"
+          :loading="saleInterfaceItemTable.loading"
+          :columns="saleInterfaceItemTable.columns"
+          :dataSource="saleInterfaceItemTable.dataSource"
+          :height="340"
+          :rowNumber="true"
+          :rowSelection="true"
+          :disabled="formDisabled"
+          :toolbar="true"
+          />
+      </a-tab-pane>
+    </a-tabs>
+  </BasicModal>
+</template>
+
+<script lang="ts" setup>
+    import {ref, computed, unref,reactive} from 'vue';
+    import {BasicModal, useModalInner} from '/@/components/Modal';
+    import {BasicForm, useForm} from '/@/components/Form/index';
+    import { JVxeTable } from '/@/components/jeecg/JVxeTable'
+    import { useJvxeMethod } from '/@/hooks/system/useJvxeMethods.ts'
+    import {formSchema,saleInterfaceItemColumns} from '../SaleInterfaceSync.data';
+    import {saveOrUpdate,saleInterfaceItemList} from '../SaleInterfaceSync.api';
+    import { VALIDATE_FAILED } from '/@/utils/common/vxeUtils'
+    // Emits声明
+    const emit = defineEmits(['register','success']);
+    const isUpdate = ref(true);
+    const formDisabled = ref(false);
+    const refKeys = ref(['saleInterfaceItem', ]);
+    const activeKey = ref('saleInterfaceItem');
+    const saleInterfaceItem = ref();
+    const tableRefs = {saleInterfaceItem, };
+    const saleInterfaceItemTable = reactive({
+          loading: false,
+          dataSource: [],
+          columns:saleInterfaceItemColumns
+    })
+    //表单配置
+    const [registerForm, {setProps,resetFields, setFieldsValue, validate}] = useForm({
+        schemas: formSchema,
+        showActionButtonGroup: false,
+        baseColProps: {span: 12}
+    });
+     //表单赋值
+    const [registerModal, {setModalProps, closeModal}] = useModalInner(async (data) => {
+        //重置表单
+        await reset();
+        setModalProps({confirmLoading: false,showCancelBtn:data?.showFooter,showOkBtn:data?.showFooter});
+        isUpdate.value = !!data?.isUpdate;
+        formDisabled.value = !data?.showFooter;
+        if (unref(isUpdate)) {
+            //表单赋值
+            await setFieldsValue({
+                ...data.record,
+            });
+             requestSubTableData(saleInterfaceItemList, {id:data?.record?.id}, saleInterfaceItemTable)
+        }
+        // 隐藏底部时禁用整个表单
+       setProps({ disabled: !data?.showFooter })
+    });
+    //方法配置
+    const [handleChangeTabs,handleSubmit,requestSubTableData,formRef] = useJvxeMethod(requestAddOrEdit,classifyIntoFormData,tableRefs,activeKey,refKeys);
+
+    //设置标题
+    const title = computed(() => (!unref(isUpdate) ? '新增' : !unref(formDisabled) ? '编辑' : '详情'));
+
+    async function reset(){
+      await resetFields();
+      activeKey.value = 'saleInterfaceItem';
+      saleInterfaceItemTable.dataSource = [];
+    }
+    function classifyIntoFormData(allValues) {
+         let main = Object.assign({}, allValues.formValue)
+         return {
+           ...main, // 展开
+           saleInterfaceItemList: allValues.tablesValue[0].tableData,
+         }
+       }
+    //表单提交事件
+    async function requestAddOrEdit(values) {
+        try {
+            setModalProps({confirmLoading: true});
+            //提交表单
+            await saveOrUpdate(values, isUpdate.value);
+            //关闭弹窗
+            closeModal();
+            //刷新列表
+            emit('success');
+        } finally {
+            setModalProps({confirmLoading: false});
+        }
+    }
+</script>
+
+<style lang="less" scoped>
+	/** 时间和数字输入框样式 */
+  :deep(.ant-input-number) {
+    width: 100%;
+  }
+
+  :deep(.ant-calendar-picker) {
+    width: 100%;
+  }
+</style>