Browse Source

销售报价单-增加审核功能

jingbb 2 months ago
parent
commit
d1b68ead67

+ 84 - 0
src/views/saleCode/quotation/components/SetToExamine.vue

@@ -0,0 +1,84 @@
+<template>
+    <a-modal
+      title="审核(to examine)"
+      width="45%"
+      :visible="visible"
+      :maskClosable="false"
+      switchFullscreen
+      @cancel="handleCancel">
+        <template #footer>
+            <a-button @click="handleOk(-1)"> 驳回</a-button>
+            <a-button type="primary" @click="handleOk(1)"> 通过</a-button>
+        </template>
+        <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="审核意见(review comments)" name="approveInfo">
+                            <a-textarea  placeholder="请输入" v-model:value="form.approveInfo" style="width: 100%;" :rows="4"></a-textarea >
+                        </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 {setEditExamine} from '../quotationForm.api';
+    var visible = ref(false);
+    const emit = defineEmits([ 'success']); //定义emit
+    var form = ref({
+        approveInfo:''
+    });
+    var formRef = ref();
+    const labelCol = ref({
+        xs: { span: 24 },
+        sm: { span: 6 },
+    });
+    const wrapperCol = ref({
+        xs: { span: 24 },
+        sm: { span: 18 },
+    });
+    var orderId = ref('')
+    const rules = {
+    //   numericalValue: [{required: true,message: '请输入数值',},],
+    }
+     function handleOk(data){
+        formRef.value .validate().then(async() => {
+              var params =form.value
+              params.id = orderId.value
+              params.approveType = data
+              await setEditExamine(params);
+              emit('success')
+              handleCancel()
+          }).catch((error) => {
+            console.log('error', error);
+          });
+    }
+    function handleCancel(){
+        visible.value = false;
+        form.value.approveInfo=''
+        formRef.value.resetFields();
+    }
+    function getTable(record){
+        visible.value = true
+        orderId.value = record.id
+    }
+    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>

+ 15 - 2
src/views/saleCode/quotation/quotation.vue

@@ -144,6 +144,7 @@
     </BasicTable>
     <quotationFormModal @register="registerModal" @success="handleSuccess" />
     <ViewHistoryVersionModal ref="ViewHistoryVersionModalRef" @success="handleSuccess" />
+    <SetToExamine ref="SetToExamineRef" @success="handleSuccess" ></SetToExamine>
     <!-- 表单区域 -->
   </div>
 </template>
@@ -167,6 +168,7 @@
   } from './quotationForm.api';
   import { cloneDeep } from 'lodash-es';
   import { JDictSelectTag, ApiSelect, JInput ,JSelect} from '/@/components/Form';
+  import SetToExamine from './components/SetToExamine.vue';
   import quotationFormModal from './components/quotationFormModal.vue';
   import ViewHistoryVersionModal from './components/ViewHistoryVersionModal.vue';
   import { message } from 'ant-design-vue';
@@ -179,6 +181,7 @@
   const [registerModal, { openModal }] = useModal();
   var showField = ref('currency+name');
   var ViewHistoryVersionModalRef = ref();
+  var SetToExamineRef = ref();
   //注册table数据
   const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
     tableProps: {
@@ -288,6 +291,10 @@
   function handleSuccess() {
     (selectedRowKeys.value = []) && reload();
   }
+  // 审核
+  function handleToExamine(record) {
+    SetToExamineRef.value.getTable(record);
+  }
   /**
    * 操作栏
    */
@@ -311,9 +318,10 @@
         onClick: handleRevise.bind(null, record),
       },
       {
-        label: '查看历史版本(history)',
-        onClick: handleViewHistory.bind(null, record),
+        label: '审核(to examine)',
         ifShow: record.status == '1',
+        // auth: 'saleCode:sale_quotation:editHis',
+        onClick: handleToExamine.bind(null, record),
       },
       {
         label: '删除(delete)',
@@ -336,6 +344,11 @@
         label: '详情(detail)',
         onClick: handleDetail.bind(null, record),
       },
+      {
+        label: '查看历史版本(history)',
+        onClick: handleViewHistory.bind(null, record),
+        ifShow: record.status == '1',
+      },
     ];
   }
   function submit() {

+ 10 - 1
src/views/saleCode/quotation/quotationForm.api.ts

@@ -24,7 +24,8 @@ enum Api {
   supplierList='/cuspCode/cuspSupplierProfile/list?pageSize=-1',
   customerList='/cuspCode/cuspCustomerProfile/list',
   projectList='/baseCode/baseProjectArchive/list',
-  getRate='/baseCode/baseExchangeRate/getRateByUsd'
+  getRate='/baseCode/baseExchangeRate/getRateByUsd',
+  editExamine = '/baseCode/baseApproverHead/actionApprove'
 }
 /**
  * 导出api
@@ -101,6 +102,14 @@ export const saveOrUpdate = (params, isUpdate,isRevise) => {
   url = isRevise?Api.editHis:url;
   return defHttp.post({url: url, params});
 }
+
+/**
+ * 审核
+ * @param params
+ */
+export const setEditExamine = (params) => {
+  return defHttp.get({url: Api.editExamine, params});
+}
 //
 
 /**