yuansh пре 1 недеља
родитељ
комит
060bda6ca0

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

@@ -62,6 +62,62 @@ export const batchDelete = (params, handleSuccess) => {
     },
   });
 };
+
+/**
+ * 批量提交
+ * @param params
+ */
+export const submitBatch = (params, handleSuccess) => {
+  
+  createConfirm({
+    iconType: 'warning',
+    title: '确认提交',
+    content: '是否提交选中数据',
+    okText: '确认',
+    cancelText: '取消',
+    onOk: () => {
+      return defHttp.get({ url:"/saleCode/saleInterfaceSync/submitBatch",  params }, { joinParamsToUrl: true }).then(() => {
+        handleSuccess();
+      });
+    },
+  });
+};
+/**
+ * 批量提交
+ * @param params
+ */
+export const returnSubmitBatch = (params, handleSuccess) => {
+  createConfirm({
+    iconType: 'warning',
+    title: '确认取消提交',
+    content: '是否取消提交选中数据',
+    okText: '确认',
+    cancelText: '取消',
+    onOk: () => {
+      return defHttp.get({ url:"/saleCode/saleInterfaceSync/returnSubmitBatch",  params }, { joinParamsToUrl: true }).then(() => {
+        handleSuccess();
+      });
+    },
+  });
+};
+/**
+ * 批量关闭
+ * @param params
+ */
+export const submitClose = (params, handleSuccess) => {
+  createConfirm({
+    iconType: 'warning',
+    title: '确认关闭',
+    content: '是否关闭选中数据',
+    okText: '确认',
+    cancelText: '取消',
+    onOk: () => {
+      return defHttp.get({ url:"/saleCode/saleInterfaceSync/submitClose", params }, { joinParamsToUrl: true }).then(() => {
+        handleSuccess();
+      });
+    },
+  });
+};
 /**
  * 保存或者更新
  * @param params

+ 174 - 160
src/views/saleCode/saleInterfaceSync/SaleInterfaceSync.data.ts

@@ -6,11 +6,11 @@ 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: 'transactionId'
+   // },
    {
     title: '客户号',
     align:"center",
@@ -21,16 +21,16 @@ export const columns: BasicColumn[] = [
     align:"center",
     dataIndex: 'buyerName'
    },
-   {
-    title: '供应商号',
-    align:"center",
-    dataIndex: 'supplierTnId'
-   },
-   {
-    title: '供应商名称',
-    align:"center",
-    dataIndex: 'supplierName'
-   },
+   // {
+   //  title: '供应商号',
+   //  align:"center",
+   //  dataIndex: 'supplierTnId'
+   // },
+   // {
+   //  title: '供应商名称',
+   //  align:"center",
+   //  dataIndex: 'supplierName'
+   // },
    {
     title: '优先级',
     align:"center",
@@ -70,14 +70,28 @@ export const columns: BasicColumn[] = [
     dataIndex: 'submittedDate'
    },
    {
-    title: '内容',
+    title: '创建日期',
     align:"center",
-    dataIndex: 'content'
+    dataIndex: 'createdDate'
    },
+   // {
+   //  title: '内容',
+   //  align:"center",
+   //  dataIndex: 'content'
+   // },
    {
     title: '同步状态',
     align:"center",
-    dataIndex: 'sync'
+    dataIndex: 'sync',
+    customRender:function (t, r, index) {
+      if(t.text==0){
+        return '未同步(no)'
+      }else if(t.text==1){
+        return '同步成功(yes)'
+      }else if(t.text==2){
+        return '同步失败(error)'
+      }
+    }
    },
    {
     title: '同步信息',
@@ -109,31 +123,31 @@ export const columns: BasicColumn[] = [
     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: '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",
@@ -207,11 +221,11 @@ export const searchFormSchema: FormSchema[] = [
 ];
 //表单数据
 export const formSchema: FormSchema[] = [
-  {
-    label: '交易编号',
-    field: 'transactionId',
-    component: 'Input',
-  },
+  // {
+  //   label: '交易编号',
+  //   field: 'transactionId',
+  //   component: 'Input',
+  // },
   {
     label: '客户号',
     field: 'buyerTnId',
@@ -232,16 +246,16 @@ export const formSchema: FormSchema[] = [
           ];
      },
   },
-  {
-    label: '供应商号',
-    field: 'supplierTnId',
-    component: 'Input',
-  },
-  {
-    label: '供应商名称',
-    field: 'supplierName',
-    component: 'Input',
-  },
+  // {
+  //   label: '供应商号',
+  //   field: 'supplierTnId',
+  //   component: 'Input',
+  // },
+  // {
+  //   label: '供应商名称',
+  //   field: 'supplierName',
+  //   component: 'Input',
+  // },
   {
     label: '优先级',
     field: 'priority',
@@ -282,11 +296,11 @@ export const formSchema: FormSchema[] = [
        valueFormat: 'YYYY-MM-DD HH:mm:ss'
      },
   },
-  {
-    label: '内容',
-    field: 'content',
-    component: 'InputTextArea',
-  },
+  // {
+  //   label: '内容',
+  //   field: 'content',
+  //   component: 'InputTextArea',
+  // },
   {
     label: 'subject',
     field: 'subject',
@@ -297,31 +311,31 @@ export const formSchema: FormSchema[] = [
     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: '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',
@@ -378,70 +392,63 @@ export const formSchema: FormSchema[] = [
 //子表单数据
 //子表表格配置
 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: '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: 'number',
       key: 'number',
@@ -485,14 +492,14 @@ export const saleInterfaceItemColumns: JVxeColumn[] = [
       placeholder: '请输入${title}',
       defaultValue:'',
     },
-    {
-      title: 'unitPrice',
-      key: 'unitPrice',
-      type: JVxeTypes.inputNumber,
-      width:"200px",
-      placeholder: '请输入${title}',
-      defaultValue:'',
-    },
+    // {
+    //   title: 'unitPrice',
+    //   key: 'unitPrice',
+    //   type: JVxeTypes.inputNumber,
+    //   width:"200px",
+    //   placeholder: '请输入${title}',
+    //   defaultValue:'',
+    // },
     {
       title: 'comment',
       key: 'comment',
@@ -500,6 +507,13 @@ export const saleInterfaceItemColumns: JVxeColumn[] = [
       width:"200px",
       placeholder: '请输入${title}',
       defaultValue:'',
+    },{
+      title: '内容',
+      key: 'content',
+      type: JVxeTypes.textarea,
+      width:"200px",
+      placeholder: '请输入${title}',
+      defaultValue:'',
     },
   ]
 

+ 102 - 15
src/views/saleCode/saleInterfaceSync/SaleInterfaceSyncList.vue

@@ -18,6 +18,18 @@
                 <Icon icon="ant-design:delete-outlined" />
                 删除
               </a-menu-item>
+              <a-menu-item key="2" @click="batchSubmitBatch">
+                <Icon icon="ant-design:submit-outlined" />
+                提交
+              </a-menu-item>
+              <a-menu-item key="3" @click="batchReturnSubmitBatch">
+                <Icon icon="ant-design:commit-outlined" />
+                取消提交
+              </a-menu-item>
+              <a-menu-item key="4" @click="showCloseModal">
+                <Icon icon="ant-design:close-outlined" />
+                关闭
+              </a-menu-item>
             </a-menu>
           </template>
           <a-button v-auth="'saleCode:sale_interface_sync:deleteBatch'"
@@ -26,7 +38,7 @@
           </a-button>
         </a-dropdown>
         <!-- 高级查询 -->
-        <super-query :config="superQueryConfig" @search="handleSuperQuery" />
+        <!-- <super-query :config="superQueryConfig" @search="handleSuperQuery" /> -->
         <!-- 获取接口数据 -->
         <a-button type="primary" v-auth="'saleCode:sale_interface_sync:deleteBatch'" @click="showSyncModal">获取接口数据</a-button>
         <!-- 同步订单 -->
@@ -41,6 +53,20 @@
     </BasicTable>
     <!-- 表单区域 -->
     <SaleInterfaceSyncModal @register="registerModal" @success="handleSuccess" />
+    <!-- 关闭弹窗 -->
+    <a-modal v-model:open="closeVisiable" title="关闭原因(Close reason)" centered @ok="batchSubmitClose">
+      <div style="padding: 20px">
+        <a-form ref="closeFormRef" :model="closeForm"  :rules="closeRules" :label-col="labelCol" :wrapper-col="wrapperCol">
+          <a-row :gutter="24">
+              <a-col :md="24" :sm="24">
+              <a-form-item label="关闭原因" required name="closeInfo">
+                <a-textarea v-model:value="closeForm.closeInfo" placeholder="" :rows="4" />
+              </a-form-item>
+           </a-col>
+           </a-row>
+        </a-form>
+      </div>
+    </a-modal>
     <!-- 获取接口弹窗 -->
     <a-modal v-model:open="syncVisiable" title="获取接口数据" centered @ok="handleSyncOk">
       <div style="padding: 20px">
@@ -51,8 +77,8 @@
               type="date"
               placeholder=""
               style="width: 100%"
-              valueFormat="YYYY-MM-DD HH:mm:ss"
-              format="YYYY-MM-DD HH:mm:ss"
+              valueFormat="YYYY-MM-DD"
+              format="YYYY-MM-DD"
               show-time
             />
           </a-form-item>
@@ -62,8 +88,8 @@
               type="date"
               placeholder=""
               style="width: 100%"
-              valueFormat="YYYY-MM-DD HH:mm:ss"
-              format="YYYY-MM-DD HH:mm:ss"
+              valueFormat="YYYY-MM-DD"
+              format="YYYY-MM-DD"
               show-time
             />
           </a-form-item>
@@ -80,7 +106,12 @@
   import { useModal } from '/@/components/Modal';
   import SaleInterfaceSyncModal from './components/SaleInterfaceSyncModal.vue';
   import { columns, searchFormSchema, superQuerySchema } from './SaleInterfaceSync.data';
-  import { list, deleteOne, batchDelete, getImportUrl, getExportUrl, getData, getSyncOrder } from './SaleInterfaceSync.api';
+  import { list, deleteOne, batchDelete, getImportUrl, getExportUrl
+  , getData
+  , getSyncOrder 
+  , submitBatch 
+  , returnSubmitBatch 
+  , submitClose } from './SaleInterfaceSync.api';
   import { downloadFile } from '/@/utils/common/renderUtils';
   import { message } from 'ant-design-vue';
   import { useUserStore } from '/@/store/modules/user';
@@ -181,6 +212,30 @@
   async function batchHandleDelete() {
     await batchDelete({ ids: selectedRowKeys.value }, handleSuccess);
   }
+  /**
+   * 批量提交事件
+   */
+  async function batchSubmitBatch() {
+    if (selectedRowKeys.value.length == 0) {
+      message.warning('请选择数据');
+    } else {
+      var ids = selectedRowKeys.value.join(',');
+     await submitBatch({ ids: ids }, handleSuccess);
+    }
+    // await submitBatch({ ids: selectedRowKeys.value }, handleSuccess);
+  }
+  /**
+   * 批量取消提交事件
+   */
+  async function batchReturnSubmitBatch() {
+    if (selectedRowKeys.value.length == 0) {
+      message.warning('请选择数据');
+    } else {
+      var ids = selectedRowKeys.value.join(',');
+     await returnSubmitBatch({ ids: ids }, handleSuccess);
+    }
+    // await returnSubmitBatch({ ids: selectedRowKeys.value }, handleSuccess);
+  }
   /**
    * 成功回调
    */
@@ -209,31 +264,41 @@
         label: '详情',
         onClick: handleDetail.bind(null, record),
       },
-      {
-        label: '删除',
-        popConfirm: {
-          title: '是否确认删除',
-          confirm: handleDelete.bind(null, record),
-          placement: 'topLeft',
-        },
-        auth: 'saleCode:sale_interface_sync:delete',
-      },
+      // {
+      //   label: '删除',
+      //   popConfirm: {
+      //     title: '是否确认删除',
+      //     confirm: handleDelete.bind(null, record),
+      //     placement: 'topLeft',
+      //   },
+      //   auth: 'saleCode:sale_interface_sync:delete',
+      // },
     ];
   }
 
   const syncVisiable = ref(false);
+  const closeVisiable = ref(false);
+  const closeForm = ref({});
   const syncForm = ref({});
   const syncRules = {
     requestedDeliveryDate: [{ required: true, message: '请选择开始时间', trigger: 'blur' }],
     adviseBeforeDate: [{ required: true, message: '请选择结束时间', trigger: 'blur' }],
   };
+  const closeRules = {
+    closeInfo: [{ required: true, message: '请填写关闭原因', trigger: 'blur' }]
+  };
   const syncFormRef = ref();
+  const closeFormRef = ref();
   const labelCol = { span: 5 };
   const wrapperCol = { span: 13 };
   const showSyncModal = () => {
     syncForm.value = {};
     syncVisiable.value = true;
   };
+  const showCloseModal = () => {
+    closeForm.value = {};
+    closeVisiable.value = true;
+  };
   const handleSyncOk = () => {
     syncFormRef.value.validate().then(() => {
       getData(syncForm.value).then((res) => {
@@ -259,6 +324,28 @@
       },
     });
   };
+  
+  
+  /**
+   * 批量关闭事件
+   */
+  async function batchSubmitClose() {
+    
+    
+    if (selectedRowKeys.value.length == 0) {
+      message.warning('请选择数据');
+    } else {
+      var ids = selectedRowKeys.value.join(',');
+  
+      closeFormRef.value.validate().then(() => {
+         submitClose({ ids: ids,closeInfo:closeForm.value.closeInfo}, handleSuccess);
+         closeVisiable.value = false;
+      });
+      
+     // await submitClose({ ids: ids }, handleSuccess);
+    }
+  //   // await submitClose({ ids: selectedRowKeys.value }, handleSuccess);
+  }
 </script>
 
 <style lang="less" scoped>