Ver Fonte

所有单据-增加关闭原因弹窗

jingbb há 1 mês atrás
pai
commit
58a7c9d7c6

+ 81 - 0
src/views/publicComponents/SetCloseReasonModal.vue

@@ -0,0 +1,81 @@
+<template>
+    <a-modal
+      title="关闭原因(close reason)"
+      width="45%"
+      :visible="visible"
+      :maskClosable="false"
+      switchFullscreen
+      @ok = "handleOk"
+      @cancel="handleCancel">
+        <div>
+          <a-card  :body-style="{ padding: '10px' }" :bordered="false" style="margin: 10px;">
+            <div class="table-page-search-wrapper">
+                <a-form :model="form" :label-col="labelCol" :wrapper-col="wrapperCol"  :rules="rules" ref="formRef">
+                <a-row :gutter="24">
+                    <a-col :md="24" :sm="24">
+                        <a-form-item label="原因(reason)" name="reason">
+                            <a-textarea v-model:value="form.reason" placeholder="" :rows="4" />
+                        </a-form-item>
+                    </a-col>
+                </a-row>
+            </a-form>
+           </div>
+        </a-card>
+      </div>
+    </a-modal>
+</template>
+<script lang="ts" setup>
+    import {ref, reactive } from 'vue';
+    import { defHttp } from '/@/utils/http/axios';
+    import { message } from 'ant-design-vue';
+    import { filterObj, getFileAccessHttpUrl } from '/@/utils/common/compUtils';
+    var visible = ref(false);
+    const emit = defineEmits([ 'success']); //定义emit
+    var formRef = ref();
+    var form = ref({
+        reason :""
+    });
+    const labelCol = ref({
+        xs: { span: 24 },
+        sm: { span: 5 },
+    });
+    const wrapperCol = ref({
+        xs: { span: 24 },
+        sm: { span: 19 },
+    });
+    var fatherIds=ref("");
+    const rules = {
+        reason: [
+            {required: true,message: '请输入数值',},
+        ],
+    }
+    function handleOk(){
+        formRef.value .validate().then(() => {
+              emit('success',form.value.reason,fatherIds.value)
+              handleCancel()
+        }).catch((error) => {
+            console.log('error', error);
+        });
+    }
+    function handleCancel(){
+        visible.value = false;
+        form.value.reason=''
+        fatherIds.value = ''
+    }
+    function getTable(ids){
+        visible.value = true
+        fatherIds.value = ids
+    }
+    defineExpose({
+        getTable
+    });
+</script>
+<style scoped lang="less">
+/deep/.ant-form-item{
+    margin-bottom: 8px !important;
+}
+// /deep/.ant-table-wrapper .ant-table-thead > tr > th, .ant-table-wrapper .ant-table-thead > tr > td{
+//     padding: 8px !important;
+// }
+
+</style>

+ 1 - 9
src/views/purchase/arrivedGoods/ArriveGoodsForm.api.ts

@@ -131,18 +131,10 @@ export const cancelBatchSubmit = (params, handleSuccess) => {
 }
 // 关闭
 export const bacthClose = (params, handleSuccess) => {
-  createConfirm({
-    iconType: 'warning',
-    title: '确认关闭',
-    content: '是否关闭选中数据',
-    okText: '确认',
-    cancelText: '取消',
-    onOk: () => {
+
       return defHttp.get({url: Api.closeBatch, params}, {joinParamsToUrl: true}).then(() => {
         handleSuccess();
       });
-    }
-  });
 }
 // 取消关闭
 export const cancelBatchClose = (params, handleSuccess) => {

+ 5 - 0
src/views/purchase/arrivedGoods/ArriveGoodsForm.data.ts

@@ -66,6 +66,11 @@ export const columns: BasicColumn[] = [
     align:"center",
     dataIndex: 'sourceCode'
    },
+   {
+    title: '关闭原因(close reason)',
+    align:"center",
+    dataIndex: 'closeReason'
+   },
    {
       title: '提交(submit)',
       align:"center",

+ 11 - 1
src/views/purchase/arrivedGoods/ArriveGoodsList.vue

@@ -166,6 +166,7 @@
     </BasicTable>
     <!-- 表单区域 -->
     <ArriveGoodsFormModal @register="registerModal" @success="handleSuccess" />
+    <SetCloseReasonModal ref="SetCloseReasonModalRef"  @success="successfullyClosed"></SetCloseReasonModal>
   </div>
 </template>
 
@@ -175,6 +176,7 @@
   import { useListPage } from '/@/hooks/system/useListPage';
   import { useModal } from '/@/components/Modal';
   import ArriveGoodsFormModal from './components/ArriveGoodsFormModal.vue';
+  import SetCloseReasonModal from '../../publicComponents/SetCloseReasonModal.vue'
   import { columns } from './ArriveGoodsForm.data';
   import {
     list,
@@ -196,6 +198,7 @@
   import { message } from 'ant-design-vue';
   const formRef = ref();
   const queryParam = reactive<any>({});
+    var SetCloseReasonModalRef = ref();
     var showField = ref('currency_dictText+name');
   //注册model
   const [registerModal, { openModal }] = useModal();
@@ -350,9 +353,16 @@
       message.warning('请选择数据');
     } else {
       var ids = selectedRowKeys.value.join(',');
-      bacthClose({ ids: ids }, handleSuccess);
+      SetCloseReasonModalRef.value.getTable(ids)
     }
   }
+  function successfullyClosed(reason,id){
+    var params={
+      ids: id,
+      closeReason: reason
+    }
+    bacthClose(params,handleSuccess);
+  }
   function cancelClose() {
     if (selectedRowKeys.value.length == 0) {
       message.warning('请选择数据');

+ 0 - 9
src/views/purchase/freightPurchaseOrder/FreightPurOrder.api.ts

@@ -135,18 +135,9 @@ export const cancelBatchSubmit = (params, handleSuccess) => {
 }
 // 关闭
 export const bacthClose = (params, handleSuccess) => {
-  createConfirm({
-    iconType: 'warning',
-    title: '确认关闭',
-    content: '是否关闭选中数据',
-    okText: '确认',
-    cancelText: '取消',
-    onOk: () => {
       return defHttp.get({url: Api.closeBatch, params}, {joinParamsToUrl: true}).then(() => {
         handleSuccess();
       });
-    }
-  });
 }
 // 取消关闭
 export const cancelBatchClose = (params, handleSuccess) => {

+ 5 - 0
src/views/purchase/freightPurchaseOrder/FreightPurOrderForm.data.ts

@@ -36,6 +36,11 @@ export const columns: BasicColumn[] = [
       align:"center",
       dataIndex: 'notes',
     },
+    {
+      title: '关闭原因(close reason)',
+      align:"center",
+      dataIndex: 'closeReason'
+     },
     {
       title: '提交(submit)',
       align:"center",

+ 12 - 2
src/views/purchase/freightPurchaseOrder/FreightPurchaseOrderList.vue

@@ -83,6 +83,7 @@
     </BasicTable>
     <!-- 表单区域 -->
     <FreightPurOrderModal @register="registerModal" @success="handleSuccess" />
+    <SetCloseReasonModal ref="SetCloseReasonModalRef"  @success="successfullyClosed"></SetCloseReasonModal>
   </div>
 </template>
 
@@ -92,6 +93,7 @@
   import { useListPage } from '/@/hooks/system/useListPage';
   import { useModal } from '/@/components/Modal';
   import FreightPurOrderModal from './components/FreightPurOrderModal.vue';
+  import SetCloseReasonModal from '../../publicComponents/SetCloseReasonModal.vue'
   import { columns } from './FreightPurOrderForm.data';
   import {
     list,
@@ -112,6 +114,7 @@
   import { message } from 'ant-design-vue';
   const formRef = ref();
   const queryParam = reactive<any>({});
+  var SetCloseReasonModalRef = ref();
   var showField = ref('currency_dictText+name');
   //注册model
   const [registerModal, { openModal }] = useModal();
@@ -128,7 +131,7 @@
         fixed: 'right',
       },
       scroll: {
-        x: '1500px',
+        x: '2000px',
         y:'calc(100vh - 400px)',
       },
       beforeFetch: async (params) => {
@@ -267,9 +270,16 @@
       message.warning('请选择数据');
     } else {
       var ids = selectedRowKeys.value.join(',');
-      bacthClose({ ids: ids }, handleSuccess);
+      SetCloseReasonModalRef.value.getTable(ids)
     }
   }
+  function successfullyClosed(reason,id){
+    var params={
+      ids: id,
+      closeReason: reason
+    }
+    bacthClose(params,handleSuccess);
+  }
   function cancelClose() {
     if (selectedRowKeys.value.length == 0) {
       message.warning('请选择数据');

+ 5 - 0
src/views/purchase/purchaseOrder/PurchaseOrderForm.data.ts

@@ -96,6 +96,11 @@ export const columns: BasicColumn[] = [
       }
     }
    },
+   {
+    title: '关闭原因(close reason)',
+    align:"center",
+    dataIndex: 'closeReason'
+   },
    {
     title: '供应商确认(supplier confirm)',
     align:"center",

+ 13 - 3
src/views/purchase/purchaseOrder/PurchaseOrderFormList.vue

@@ -179,6 +179,7 @@
     <ViewFileListModal ref="ViewFileListModalRef" />
     <SelectPurOrderModal ref="SelectPurOrderModalRef" @copy-product="handleCopyProduct" />
     <ViewHistoryVersionModal ref="ViewHistoryVersionModallRef" />
+    <SetCloseReasonModal ref="SetCloseReasonModalRef"  @success="successfullyClosed"></SetCloseReasonModal>
   </div>
 </template>
 
@@ -212,6 +213,7 @@
   import ViewFileListModal from './components/ViewFileListModal.vue';
   import SelectPurOrderModal from './components/SelectPurOrderModal.vue';
   import ViewHistoryVersionModal from './components/ViewHistoryVersionModal.vue';
+  import SetCloseReasonModal from '../../publicComponents/SetCloseReasonModal.vue'
   import { message } from 'ant-design-vue';
   import { useMethods } from '/@/hooks/system/useMethods';
   const { handleExportXlsx, } = useMethods();
@@ -220,7 +222,8 @@
   const SelectPurOrderModalRef = ref();
   const ViewHistoryVersionModallRef = ref();
   const queryParam = reactive<any>({});
-    var showField = ref('currency_dictText+name');
+  var SetCloseReasonModalRef = ref();
+  var showField = ref('currency_dictText+name');
   //注册model
   const [registerModal, { openModal }] = useModal();
   //注册table数据
@@ -236,7 +239,7 @@
         fixed: 'right',
       },
       scroll: {
-        x: '4000px',
+        x: '4300px',
         y:'calc(100vh - 400px)',
       },
       beforeFetch: async (params) => {
@@ -431,9 +434,16 @@
       message.warning('请选择数据');
     } else {
       var ids = selectedRowKeys.value.join(',');
-      bacthClose({ ids: ids }, handleSuccess);
+      SetCloseReasonModalRef.value.getTable(ids)
     }
   }
+  function successfullyClosed(reason,id){
+    var params={
+      ids: id,
+      closeReason: reason
+    }
+    bacthClose(params,handleSuccess);
+  }
   // function cancelClose() {
   //   if (selectedRowKeys.value.length == 0) {
   //     message.warning('请选择数据');

+ 0 - 9
src/views/purchase/purchaseOrder/PurchaseOrderyForm.api.ts

@@ -160,18 +160,9 @@ export const cancelBatchSubmit = (params, handleSuccess) => {
 }
 // 关闭
 export const bacthClose = (params, handleSuccess) => {
-  createConfirm({
-    iconType: 'warning',
-    title: '确认关闭',
-    content: '是否关闭选中数据',
-    okText: '确认',
-    cancelText: '取消',
-    onOk: () => {
       return defHttp.get({url: Api.closeBatch, params}, {joinParamsToUrl: true}).then(() => {
         handleSuccess();
       });
-    }
-  });
 }
 // 取消关闭
 export const cancelBatchClose = (params, handleSuccess) => {

+ 0 - 9
src/views/saleCode/deliveryNotice/delivertNoticeForm.api.ts

@@ -150,18 +150,9 @@ export const cancelBatchSubmit = (params, handleSuccess) => {
 }
 // 关闭
 export const bacthClose = (params, handleSuccess) => {
-  createConfirm({
-    iconType: 'warning',
-    title: '确认关闭',
-    content: '是否关闭选中数据',
-    okText: '确认',
-    cancelText: '取消',
-    onOk: () => {
       return defHttp.get({url: Api.closeBatch, params}, {joinParamsToUrl: true}).then(() => {
         handleSuccess();
       });
-    }
-  });
 }
 
 //获取供应商列表

+ 5 - 0
src/views/saleCode/deliveryNotice/delivertNoticeForm.data.ts

@@ -82,6 +82,11 @@ export const columns: BasicColumn[] = [
     slots: { customRender: 'viewFile' },
     width:250,
    },
+   {
+    title: '关闭原因(close reason)',
+    align:"center",
+    dataIndex: 'closeReason'
+   },
    {
     title: '提交(submit)',
     align:"center",

+ 12 - 2
src/views/saleCode/deliveryNotice/deliveryNoticeList.vue

@@ -157,6 +157,7 @@
       </template>
     </BasicTable>
     <ViewFileListModal ref="ViewFileListModalRef" />
+    <SetCloseReasonModal ref="SetCloseReasonModalRef"  @success="successfullyClosed"></SetCloseReasonModal>
     <deliveryNoticeFormModal @register="registerModal" @success="handleSuccess" />
     <!-- 表单区域 -->
   </div>
@@ -188,12 +189,14 @@
   import { JDictSelectTag, ApiSelect, JInput,JSelect } from '/@/components/Form';
   import ViewFileListModal from './components/ViewFileListModal.vue';
   import deliveryNoticeFormModal from './components/deliveryNoticeFormModal.vue';
+  import SetCloseReasonModal from '../../publicComponents/SetCloseReasonModal.vue'
   import { message } from 'ant-design-vue';
   import { cloneDeep } from 'lodash-es';
   import { useMethods } from '/@/hooks/system/useMethods';
   const { handleExportXlsx, } = useMethods();
   const formRef = ref();
   const ViewFileListModalRef = ref();
+  var SetCloseReasonModalRef = ref();
   const queryParam = reactive<any>({});
   var showField = ref('currency_dictText+name');
   const checkedKeys = ref<Array<string | number>>([]);
@@ -212,7 +215,7 @@
         fixed: 'right',
       },
       scroll: {
-        x: '3500px',
+        x: '3800px',
         y:'calc(100vh - 400px)',
       },
       beforeFetch: async (params) => {
@@ -380,9 +383,16 @@
       message.warning('请选择数据');
     } else {
       var ids = selectedRowKeys.value.join(',');
-      bacthClose({ ids: ids }, handleSuccess);
+      SetCloseReasonModalRef.value.getTable(ids)
     }
   }
+  function successfullyClosed(reason,id){
+    var params={
+      ids: id,
+      closeReason: reason
+    }
+    bacthClose(params,handleSuccess);
+  }
 
   /* ----------------------以下为原生查询需要添加的-------------------------- */
   const toggleSearchStatus = ref<boolean>(false);

+ 0 - 9
src/views/saleCode/saleContract/SaleContract.api.ts

@@ -134,18 +134,9 @@ export const cancelBatchSubmit = (params, handleSuccess) => {
 }
 // 关闭
 export const closeBill = (params, handleSuccess) => {
-  createConfirm({
-    iconType: 'warning',
-    title: '确认关闭',
-    content: '是否关闭选中数据',
-    okText: '确认',
-    cancelText: '取消',
-    onOk: () => {
       return defHttp.get({url: Api.closeBill, params}, {joinParamsToUrl: true}).then(() => {
         handleSuccess();
       });
-    }
-  });
 }
 
 //获取客户下拉框列表

+ 12 - 1
src/views/saleCode/saleContract/SaleContract.data.ts

@@ -49,6 +49,7 @@ export const columns: BasicColumn[] = [
     title: '厂家(maker)',
     align: 'center',
     dataIndex: 'maker',
+    width: 250,
   },
   //  {
   //   title: '业务类型(busyness type)',
@@ -69,22 +70,32 @@ export const columns: BasicColumn[] = [
   {
     title: '来源(sourceCode)',
     align:"center",
-    dataIndex: 'sourceCode'
+    dataIndex: 'sourceCode',
+    width: 200,
    },
   {
     title: '关闭(close)',
     align: 'center',
     dataIndex: 'isClose_dictText',
+    width: 150,
   },
+  {
+    title: '关闭原因(close reason)',
+    align:"center",
+    dataIndex: 'closeReason',
+    width: 300,
+   },
   {
     title: '提交(submit)',
     align: 'center',
     dataIndex: 'status_dictText',
+    width: 150,
   },
   {
     title: '版本号',
     align: 'center',
     dataIndex: 'version',
+    width: 150,
   },
 ];
 //查询数据

+ 13 - 2
src/views/saleCode/saleContract/SaleContractList.vue

@@ -33,6 +33,7 @@
     </BasicTable>
     <!-- 表单区域 -->
     <SaleContractModal @register="registerModal" @success="handleSuccess"></SaleContractModal>
+    <SetCloseReasonModal ref="SetCloseReasonModalRef"  @success="successfullyClosed"></SetCloseReasonModal>
     <ViewHistoryVersionModal ref="ViewHistoryVersionModalRef" @success="handleSuccess"></ViewHistoryVersionModal>
   </div>
 </template>
@@ -44,11 +45,13 @@
   import {useModal} from '/@/components/Modal';
   import SaleContractModal from './components/SaleContractModal.vue'
   import ViewHistoryVersionModal from './components/ViewHistoryVersionModal.vue'
+  import SetCloseReasonModal from '../../publicComponents/SetCloseReasonModal.vue'
   import {columns, searchFormSchema} from './SaleContract.data';
   import {list, deleteOne, batchDelete, getImportUrl,getExportUrl,batchSubmit,cancelBatchSubmit,closeBill} from './SaleContract.api';
   import { message } from 'ant-design-vue';
   const queryParam = reactive<any>({});
   var ViewHistoryVersionModalRef = ref();
+  var SetCloseReasonModalRef = ref();
   //注册model
   const [registerModal, {openModal}] = useModal();
    //注册table数据
@@ -74,7 +77,7 @@
                fixed:'right'
            },
            scroll:{
-              x:'3000px',
+              x:'3300px',
               y:'calc(100vh - 400px)',
            },
            beforeFetch: (params) => {
@@ -214,7 +217,7 @@
       message.warning('请选择数据')
     }else{
       var ids=selectedRowKeys.value.join(',')
-      closeBill({ids: ids},handleSuccess);
+      SetCloseReasonModalRef.value.getTable(ids)
     }
   }
   //修订
@@ -229,10 +232,18 @@
   function handleViewHistory(record: Recordable){
     ViewHistoryVersionModalRef.value.getTable(record)
   }
+  function successfullyClosed(reason,id){
+    var params={
+      ids: id,
+      closeReason: reason
+    }
+    closeBill(params,handleSuccess);
+  }
 </script>
 
 <style lang="less" scoped>
   :deep(.ant-picker),:deep(.ant-input-number){
     width: 100%;
   }
+
 </style>

+ 5 - 0
src/views/saleCode/salesOrder/SaleOrderForm.data.ts

@@ -107,6 +107,11 @@ export const columns: BasicColumn[] = [
       }
     }
    },
+   {
+    title: '关闭原因(close reason)',
+    align:"center",
+    dataIndex: 'closeReason',
+   },
    {
     title: '客户确认(customer confirm)',
     align:"center",

+ 13 - 2
src/views/saleCode/salesOrder/SaleOrderFormList.vue

@@ -221,6 +221,7 @@
     <SaleInquiryFormModal @register="registerModal" @success="handleSuccess" />
     <ViewFileListModal ref="ViewFileListModalRef" />
     <SelectSaleOrderModal ref="SelectSaleOrderModalRef" @copy-product="handleCopyProduct" />
+    <SetCloseReasonModal ref="SetCloseReasonModalRef"  @success="successfullyClosed"></SetCloseReasonModal>
     <ViewHistoryVersionModal ref="ViewHistoryVersionModallRef" />
   </div>
 </template>
@@ -257,6 +258,7 @@
   import JSelectDept from '/@/components/Form/src/jeecg/components/JSelectDept.vue';
   import ViewFileListModal from './components/ViewFileListModal.vue';
   import SelectSaleOrderModal from './components/SelectSaleOrderModal.vue';
+  import SetCloseReasonModal from '../../publicComponents/SetCloseReasonModal.vue'
   import ViewHistoryVersionModal from './components/ViewHistoryVersionModal.vue';
   import { message } from 'ant-design-vue';
   import { useMethods } from '/@/hooks/system/useMethods';
@@ -266,6 +268,7 @@
   const ViewFileListModalRef = ref();
   const SelectSaleOrderModalRef = ref();
   const ViewHistoryVersionModallRef = ref();
+  var SetCloseReasonModalRef = ref();
   const queryParam = reactive<any>({});
   //注册model
   const [registerModal, { openModal }] = useModal();
@@ -282,7 +285,7 @@
         fixed: 'right',
       },
       scroll: {
-        x: '5000px',
+        x: '5300px',
         y:'calc(100vh - 400px)',
       },
       beforeFetch: async (params) => {
@@ -483,9 +486,17 @@
       message.warning('请选择数据');
     } else {
       var ids = selectedRowKeys.value.join(',');
-      bacthClose({ ids: ids }, handleSuccess);
+      var ids=selectedRowKeys.value.join(',')
+      SetCloseReasonModalRef.value.getTable(ids)
     }
   }
+  function successfullyClosed(reason,id){
+    var params={
+      ids: id,
+      closeReason: reason
+    }
+    bacthClose(params,handleSuccess);
+  }
   // function cancelClose() {
   //   if (selectedRowKeys.value.length == 0) {
   //     message.warning('请选择数据');

+ 0 - 9
src/views/saleCode/salesOrder/SaleOrderyForm.api.ts

@@ -164,18 +164,9 @@ export const cancelBatchSubmit = (params, handleSuccess) => {
 }
 // 关闭
 export const bacthClose = (params, handleSuccess) => {
-  createConfirm({
-    iconType: 'warning',
-    title: '确认关闭',
-    content: '是否关闭选中数据',
-    okText: '确认',
-    cancelText: '取消',
-    onOk: () => {
       return defHttp.get({url: Api.closeBatch, params}, {joinParamsToUrl: true}).then(() => {
         handleSuccess();
       });
-    }
-  });
 }
 // 取消关闭
 export const cancelBatchClose = (params, handleSuccess) => {