jingbb il y a 5 mois
Parent
commit
9cf7b221c0

+ 32 - 0
src/views/saleCode/saleInquiryForm/SaleInquiryForm.api.ts

@@ -14,6 +14,8 @@ enum Api {
   queryDataById = '/saleCode/saleInquiryForm/queryById',
   saleInquiryFormShipList = '/saleCode/saleInquiryForm/querySaleInquiryFormShipByMainId',
   saleInquiryFormProductList = '/saleCode/saleInquiryForm/querySaleInquiryFormProductByMainId',
+  submitBatch='/saleCode/saleInquiryForm/submitBatch',
+  cancelSubmitBatch='/saleCode/saleInquiryForm/returnSubmitBatch'
 }
 /**
  * 导出api
@@ -85,3 +87,33 @@ export const saveOrUpdate = (params, isUpdate) => {
 */
 export const queryDataById = (id) => defHttp.get({url: Api.queryDataById, params:{ id }});
 
+// 提交
+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();
+      });
+    }
+  });
+}

+ 2 - 2
src/views/saleCode/saleInquiryForm/SaleInquiryForm.data.ts

@@ -24,12 +24,12 @@ export const columns: BasicColumn[] = [
    {
     title: '询价项目(inquiry project)',
     align:"center",
-    dataIndex: 'inquiryProject'
+    dataIndex: 'inquiryProject_dictText'
    },
    {
     title: '询价客户(inquiry customer)',
     align:"center",
-    dataIndex: 'inquiryCustomer'
+    dataIndex: 'inquiryCustomer_dictText'
    },
    {
     title: '询价有效期(inquiry period)始',

+ 19 - 1
src/views/saleCode/saleInquiryForm/SaleInquiryFormList.vue

@@ -138,6 +138,8 @@
           <a-button type="primary" v-auth="'saleCode:sale_inquiry_form:add'"  @click="handleAdd" preIcon="ant-design:plus-outlined"> 新增(add)</a-button>
           <a-button  type="primary" v-auth="'saleCode:sale_inquiry_form:exportXls'"  preIcon="ant-design:export-outlined" @click="onExportXls"> 导出(export)</a-button>
           <a-button  type="primary"  @click="setStatus"> 设置其他状态(set other status)</a-button>
+          <a-button  type="primary"  @click="submit"> 提交(submit)</a-button>
+          <a-button  type="primary"  @click="cancelSubmit"> 设置其他状态(cancelSubmit)</a-button>
           <a-dropdown v-if="selectedRowKeys.length > 0">
               <template #overlay>
                 <a-menu>
@@ -173,7 +175,7 @@
   import {useModal} from '/@/components/Modal';
   import SaleInquiryFormModal from './components/SaleInquiryFormModal.vue'
   import {columns, superQuerySchema} from './SaleInquiryForm.data';
-  import {list, deleteOne, batchDelete, getImportUrl,getExportUrl} from './SaleInquiryForm.api';
+  import {list, deleteOne, batchDelete, getImportUrl,getExportUrl,batchSubmit,cancelBatchSubmit} from './SaleInquiryForm.api';
   import {downloadFile} from '/@/utils/common/renderUtils';
   import { cloneDeep } from "lodash-es";
   import { useUserStore } from '/@/store/modules/user';
@@ -345,6 +347,22 @@
      SetOtherStatusRef.value.getTable(ids)
     }
   }
+  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);
+    }
+  }
 
   
 

+ 28 - 5
src/views/saleCode/saleInquiryForm/components/SaleInquiryFormForm.vue

@@ -6,12 +6,12 @@
           <a-row>
 						<a-col :span="12">
 							<a-form-item label="单据日期(bill date)" v-bind="validateInfos.billDate" id="SaleInquiryFormForm-billDate" name="billDate">
-								<a-date-picker placeholder="请选择单据日期(bill date)"  v-model:value="formData.billDate" value-format="YYYY-MM-DD"  style="width: 100%"  allow-clear />
+								<a-date-picker placeholder="请选择单据日期(bill date)"  v-model:value="formData.billDate"  value-format="YYYY-MM-DD"  style="width: 100%"  allow-clear />
 							</a-form-item>
 						</a-col>
 						<a-col :span="12">
 							<a-form-item label="询价单号(bill code)" v-bind="validateInfos.billCode" id="SaleInquiryFormForm-billCode" name="billCode">
-								<a-input v-model:value="formData.billCode" placeholder="请输入询价单号(bill code)"  allow-clear ></a-input>
+								<a-input v-model:value="formData.billCode" placeholder="请输入询价单号(bill code)" disabled></a-input>
 							</a-form-item>
 						</a-col>
 						<a-col :span="12">
@@ -21,7 +21,7 @@
 						</a-col>
 						<a-col :span="12">
 							<a-form-item label="询价客户(inquiry customer)" v-bind="validateInfos.inquiryCustomer" id="SaleInquiryFormForm-inquiryCustomer" name="inquiryCustomer">
-								<a-input v-model:value="formData.inquiryCustomer" placeholder="请输入询价客户(inquiry customer)"  allow-clear ></a-input>
+                <JSelectInput   v-model:value="formData.inquiryCustomer"  placeholder="请选择" :options="customerOption" ></JSelectInput>
 							</a-form-item>
 						</a-col>
 						<a-col :span="12">
@@ -163,6 +163,8 @@
 <script lang="ts">
   import { defineComponent, ref, reactive, computed, toRaw, onMounted } from 'vue';
   import { defHttp } from '/@/utils/http/axios';
+  
+// import moment from "moment";
   import { useValidateAntFormAndTable } from '/@/hooks/system/useJvxeMethods';
   import { querySaleInquiryFormShipListByMainId, querySaleInquiryFormProductListByMainId, queryDataById, saveOrUpdate } from '../SaleInquiryForm.api';
   import { JVxeTable } from '/@/components/jeecg/JVxeTable';
@@ -224,6 +226,7 @@
       var BaseShipArchiveAccessoriesListRef = ref();
       const activeKey = ref('saleInquiryFormShip');
       var classOption = ref([]);
+      var customerOption =ref([]);
       const formData = reactive<Record<string, any>>({
         id: '',
         status: undefined,
@@ -281,6 +284,7 @@
         saleInquiryFormProductTable.dataSource = [];
         activeKey.value = 'saleInquiryFormShip'
         getOptiom()
+        getCustomerOptions()
       }
 
       async function edit(row) {
@@ -292,6 +296,7 @@
         const saleInquiryFormProductDataList = await querySaleInquiryFormProductListByMainId(row['id']);
         saleInquiryFormProductTable.dataSource = [...saleInquiryFormProductDataList];
         getOptiom()
+        getCustomerOptions()
       }
 
       async function queryMainData(id) {
@@ -356,7 +361,7 @@
         formData[key] = value;
       }
       function handleDelete({row}) {
-        saleInquiryFormShipTableRef.value?.removeRows(row)    
+        saleInquiryFormShipTableRef.value?.removeRows(row)   
       }
       function handleDelete1({row}) {
         saleInquiryFormProductTableRef.value?.removeRows(row)    
@@ -368,6 +373,7 @@
         var arr = data.concat(saleInquiryFormShipTable.dataSource)
         arr.map(item=>item.shipowner = item.relateCustomer)
         saleInquiryFormShipTable.dataSource=arr        
+        
       }
       function addProduct(data){
         var arrProduct = data.concat(saleInquiryFormProductTable.dataSource)
@@ -380,6 +386,21 @@
       }
       function addProject(data) {
         formData.inquiryProject = data[0].name
+        formData.inquiryCustomer =data[0].customerId
+      }
+      function getCustomerOptions(){
+          let params = {pageSize:'-1',status:1}
+          defHttp.get({url:'/cuspCode/cuspCustomerProfile/list',params}, { isTransformResponse: false }).then(res=>{
+            if(res){
+              customerOption.value = []
+              res.result.records.forEach(item=>{
+                customerOption.value.push({
+                  label: item.name,
+                  value: item.id
+                })
+              })
+            }
+          })
       }
       function viewAccessory(prop){
         BaseShipArchiveAccessoriesListRef.value.getTable(prop.row)
@@ -470,7 +491,9 @@
         onSearchProject,
         addProject,
         getOptiom,
-        classOption
+        classOption,
+        getCustomerOptions,
+        customerOption
       }
     }
   });