Browse Source

采购订单B2B./销售订单B2B-增加提交,取消提交,关闭功能

jingbb 2 weeks ago
parent
commit
ffe96cf203

+ 47 - 1
src/views/purchase/purchaseOrderB2B/PurchaseOrderFormB2BList.vue

@@ -141,6 +141,15 @@
         <a-button type="primary" v-auth="'b2bCode:pur_order_b2b:exportXls'" preIcon="ant-design:export-outlined" @click="onExportXls">
           导出(export)</a-button
         >
+        <a-button type="primary" @click="submit">
+          提交(submit)</a-button
+        >
+        <a-button type="primary" @click="cancelSubmit">
+          取消提交(cancel submit)</a-button
+        >
+        <a-button type="primary" @click="close">
+          关闭(close)</a-button
+        >
         <a-dropdown v-if="selectedRowKeys.length > 0">
           <template #overlay>
             <a-menu>
@@ -170,6 +179,7 @@
     <!-- 表单区域 -->
     <PurchaseOrderFormB2BModal @register="registerModal" @success="handleSuccess" />
     <ViewFileListModal ref="ViewFileListModalRef" />
+    <SetCloseReasonModal ref="SetCloseReasonModalRef"  @success="successfullyClosed"></SetCloseReasonModal>
   </div>
 </template>
 
@@ -187,11 +197,15 @@
     getImportUrl,
     getExportUrl,
     supplierOption,
-    ProjectOption
+    ProjectOption,
+    batchSubmit,
+    cancelBatchSubmit,
+    bacthClose,
   } from './PurchaseOrderyFormB2B.api';
   import { cloneDeep } from 'lodash-es';
   import { JDictSelectTag, ApiSelect, JInput,JSelect } from '/@/components/Form';
   import JSelectUser from '/@/components/Form/src/jeecg/components/JSelectUser.vue';
+  import SetCloseReasonModal from '../../publicComponents/SetCloseReasonModal.vue'
   import JSelectDept from '/@/components/Form/src/jeecg/components/JSelectDept.vue';
   import ViewFileListModal from './components/ViewFileListModal.vue';
   import { message } from 'ant-design-vue';
@@ -199,6 +213,7 @@
   const ViewFileListModalRef = ref();
   const queryParam = reactive<any>({});
   var showField = ref('currency_dictText+name');
+  var SetCloseReasonModalRef = ref();
   //注册model
   const [registerModal, { openModal }] = useModal();
   //注册table数据
@@ -323,6 +338,37 @@
       },
     ];
   }
+  function submit() {
+    if (selectedRowKeys.value.length == 0) {
+      message.warning('请选择数据');
+    } else {
+      var ids = selectedRowKeys.value.join(',');
+      batchSubmit({ ids: ids }, handleSuccess);
+    }
+  }
+  function cancelSubmit() {
+    if (selectedRowKeys.value.length == 0) {
+      message.warning('请选择数据');
+    } else {
+      var ids = selectedRowKeys.value.join(',');
+      cancelBatchSubmit({ ids: ids }, handleSuccess);
+    }
+  }
+  function close() {
+    if (selectedRowKeys.value.length == 0) {
+      message.warning('请选择数据');
+    } else {
+      var ids = selectedRowKeys.value.join(',');
+      SetCloseReasonModalRef.value.getTable(ids)
+    }
+  }
+  function successfullyClosed(reason,id){
+    var params={
+      ids: id,
+      closeReason: reason
+    }
+    bacthClose(params,handleSuccess);
+  }
 
   /* ----------------------以下为原生查询需要添加的-------------------------- */
   const toggleSearchStatus = ref<boolean>(false);

+ 40 - 1
src/views/purchase/purchaseOrderB2B/PurchaseOrderyFormB2B.api.ts

@@ -16,6 +16,9 @@ enum Api {
   classList='baseCode/baseProductClass/list',
   supplierList='/cuspCode/cuspSupplierProfile/list',
   projectList='/baseCode/baseProjectArchive/list',
+  submitBatch='/b2bCode/purOrderB2b/submitBatch',
+  cancelSubmitBatch='/b2bCode/purOrderB2b/returnSubmitBatch',
+  closeBatch='/b2bCode/purOrderB2b/submitClose',
 }
 /**
  * 导出api
@@ -98,4 +101,40 @@ export const queryDataById = (id) => defHttp.get({url: Api.queryDataById, params
 //获取供应商列表
 export const supplierOption = (params) => defHttp.get({url: Api.supplierList, params});
 //获取项目下拉框列表
-export const ProjectOption = (params) => defHttp.get({ url: Api.projectList, params });
+export const ProjectOption = (params) => defHttp.get({ url: Api.projectList, params });
+// 提交
+export const batchSubmit = (params, handleSuccess) => {
+  createConfirm({
+    iconType: 'warning',
+    title: '确认提交',
+    content: '是否提交选中数据',
+    okText: '确认',
+    cancelText: '取消',
+    onOk: () => {
+      return defHttp.get({url: Api.submitBatch, params}, {joinParamsToUrl: true}).then(() => {
+        handleSuccess();
+      });
+    }
+  });
+}
+// 取消提交
+export const cancelBatchSubmit = (params, handleSuccess) => {
+  createConfirm({
+    iconType: 'warning',
+    title: '确认取消提交',
+    content: '是否取消提交选中数据',
+    okText: '确认',
+    cancelText: '取消',
+    onOk: () => {
+      return defHttp.get({url: Api.cancelSubmitBatch, params}, {joinParamsToUrl: true}).then(() => {
+        handleSuccess();
+      });
+    }
+  });
+}
+// 关闭
+export const bacthClose = (params, handleSuccess) => {
+      return defHttp.get({url: Api.closeBatch, params}, {joinParamsToUrl: true}).then(() => {
+        handleSuccess();
+      });
+}

+ 43 - 6
src/views/saleCode/salesOrderB2B/SaleOrderB2BFormList.vue

@@ -182,12 +182,9 @@
       <!--插槽:table标题-->
       <template #tableTitle>
         <a-button type="primary" v-auth="'b2bCode:sale_order_b2b:exportXls'" preIcon="ant-design:export-outlined" @click="onExportXls">导出(export)</a-button>
-        <!-- <a-button type="primary" @click="submit"> 提交(submit)</a-button>
+        <a-button type="primary" @click="submit"> 提交(submit)</a-button>
         <a-button type="primary" @click="cancelSubmit"> 取消提交(cancelSubmit)</a-button>
-        <a-button type="primary" @click="close" v-auth="'saleCode:sale_order:close'"> 关闭(close)</a-button> -->
-        <!-- <a-button type="primary" @click="cancelClose"> 取消关闭(cancel close)</a-button> -->
-        <!-- <a-button type="primary" @click="confirm" v-auth="'saleCode:sale_order:confirm'"> 确认(confirm)</a-button>
-        <a-button type="primary" @click="cancelConfirm" v-auth="'saleCode:sale_order:cancelConfirm'"> 取消确认(cancel confirm)</a-button> -->
+        <a-button type="primary" @click="close" > 关闭(close)</a-button>
         <a-dropdown v-if="selectedRowKeys.length > 0">
           <template #overlay>
             <a-menu>
@@ -217,6 +214,7 @@
     <!-- 表单区域 -->
     <SaleInquiryFormB2BModal @register="registerModal" @success="handleSuccess" />
     <ViewFileListModal ref="ViewFileListModalRef" />
+    <SetCloseReasonModal ref="SetCloseReasonModalRef"  @success="successfullyClosed"></SetCloseReasonModal>
   </div>
 </template>
 
@@ -225,6 +223,7 @@
   import { BasicTable, useTable, TableAction } from '/@/components/Table';
   import { useListPage } from '/@/hooks/system/useListPage';
   import { useModal } from '/@/components/Modal';
+  import { message } from 'ant-design-vue';
   import SaleInquiryFormB2BModal from './components/SaleOrderFormB2BModal.vue';
   import { columns, superQuerySchema } from './SaleOrderB2BForm.data';
   import {
@@ -237,16 +236,21 @@
     CustomerOption,
     ClassList,
     SaleManOption,
-    shipOption
+    shipOption,
+    batchSubmit,
+    cancelBatchSubmit,
+    bacthClose,
   } from './SaleOrderyB2BForm.api';
   import { cloneDeep } from 'lodash-es';
   import { JDictSelectTag, ApiSelect, JInput,JSelect } from '/@/components/Form';
   import JSelectUser from '/@/components/Form/src/jeecg/components/JSelectUser.vue';
   import JSelectDept from '/@/components/Form/src/jeecg/components/JSelectDept.vue';
   import ViewFileListModal from './components/ViewFileListModal.vue';
+  import SetCloseReasonModal from '../../publicComponents/SetCloseReasonModal.vue'
   const formRef = ref();
   var showField = ref('currency_dictText+name');
   const ViewFileListModalRef = ref();
+  var SetCloseReasonModalRef = ref();
   const queryParam = reactive<any>({});
   //注册model
   const [registerModal, { openModal }] = useModal();
@@ -345,9 +349,42 @@
         label: '编辑(edit)',
         onClick: handleEdit.bind(null, record),
         auth: 'b2bCode:sale_order_b2b:edit',
+        ifShow: record.submit == '0' || !record.submit,
       },
     ];
   }
+  function submit() {
+    if (selectedRowKeys.value.length == 0) {
+      message.warning('请选择数据');
+    } else {
+      var ids = selectedRowKeys.value.join(',');
+      batchSubmit({ ids: ids }, handleSuccess);
+    }
+  }
+  function cancelSubmit() {
+    if (selectedRowKeys.value.length == 0) {
+      message.warning('请选择数据');
+    } else {
+      var ids = selectedRowKeys.value.join(',');
+      cancelBatchSubmit({ ids: ids }, handleSuccess);
+    }
+  }
+  function close() {
+    if (selectedRowKeys.value.length == 0) {
+      message.warning('请选择数据');
+    } else {
+      var ids = selectedRowKeys.value.join(',');
+      var ids=selectedRowKeys.value.join(',')
+      SetCloseReasonModalRef.value.getTable(ids)
+    }
+  }
+  function successfullyClosed(reason,id){
+    var params={
+      ids: id,
+      closeReason: reason
+    }
+    bacthClose(params,handleSuccess);
+  }
   /**
    * 下拉操作栏
    */

+ 40 - 1
src/views/saleCode/salesOrderB2B/SaleOrderyB2BForm.api.ts

@@ -18,6 +18,9 @@ enum Api {
   projectList='/baseCode/baseProjectArchive/list',
   salemanOption = 'sys/user/list',
   linkOption = '/cuspCode/cuspCustomerProfile/queryCuspCustomerProfileManByMainId',
+  submitBatch='/b2bCode/saleOrderB2b/submitBatch',
+  cancelSubmitBatch='/b2bCode/saleOrderB2b/returnSubmitBatch',
+  closeBatch='/b2bCode/saleOrderB2b/submitClose',
 }
 /**
  * 导出api
@@ -109,4 +112,40 @@ export const ProjectOption = (params) => defHttp.get({ url: Api.projectList, par
 export const SaleManOption = (params) => defHttp.get({ url: Api.salemanOption, params });
 //获取船舶下拉框
 export const shipOption = (params) => defHttp.get({ url: Api.shipList, params });
-export const LinkOption = (params) => defHttp.get({ url: Api.linkOption, params });
+export const LinkOption = (params) => defHttp.get({ url: Api.linkOption, params });
+// 提交
+export const batchSubmit = (params, handleSuccess) => {
+  createConfirm({
+    iconType: 'warning',
+    title: '确认提交',
+    content: '是否提交选中数据',
+    okText: '确认',
+    cancelText: '取消',
+    onOk: () => {
+      return defHttp.get({url: Api.submitBatch, params}, {joinParamsToUrl: true}).then(() => {
+        handleSuccess();
+      });
+    }
+  });
+}
+// 取消提交
+export const cancelBatchSubmit = (params, handleSuccess) => {
+  createConfirm({
+    iconType: 'warning',
+    title: '确认取消提交',
+    content: '是否取消提交选中数据',
+    okText: '确认',
+    cancelText: '取消',
+    onOk: () => {
+      return defHttp.get({url: Api.cancelSubmitBatch, params}, {joinParamsToUrl: true}).then(() => {
+        handleSuccess();
+      });
+    }
+  });
+}
+// 关闭
+export const bacthClose = (params, handleSuccess) => {
+      return defHttp.get({url: Api.closeBatch, params}, {joinParamsToUrl: true}).then(() => {
+        handleSuccess();
+      });
+}