Ver código fonte

发货通知单-基本功能

jingbb 5 meses atrás
pai
commit
f9b319ab64

+ 15 - 2
src/views/saleCode/deliveryNotice/components/FileUploadModal.vue

@@ -14,8 +14,16 @@
                 <a-form :model="queryParams" :label-col="labelCol" :wrapper-col="wrapperCol">
                 <a-row :gutter="24">
                     <a-col :xl="24" :lg="24" :md="24">
-                        <a-form-item label="名字(name)">
-                            <a-input placeholder="请输入" v-model:value="queryParams.name"></a-input>
+                        <a-form-item label="产品(name)">
+                          <ApiSelect
+                                    :api="productListList"
+                                    showSearch
+                                    v-model:value="queryParams.name"
+                                    optionFilterProp="label"
+                                    resultField="records"
+                                    labelField="chineseName"
+                                    valueField="code"
+                                    />
                         </a-form-item>
                     </a-col>
                     <a-col :xl="24" :lg="24" :md="24">
@@ -34,6 +42,7 @@
     import {ref,reactive  } from 'vue';
     import { defHttp } from '/@/utils/http/axios';
     import { message,Modal  } from 'ant-design-vue';
+    import {  ApiSelect, } from '/@/components/Form/index';
     import JUpload from '/@/components/Form/src/jeecg/components/JUpload/JUpload.vue';
     const emit = defineEmits([ 'addList']); //定义emit
     var visible = ref(false)
@@ -94,6 +103,10 @@
           }
         })
     }
+    function productListList(){
+        let params = {pageSize:-1}
+        return defHttp.get({url:'/baseCode/baseProductArchive/list',params});
+    }
     defineExpose({
       getTable
     });

+ 59 - 34
src/views/saleCode/deliveryNotice/components/deliveryNoticeForm.vue

@@ -60,13 +60,13 @@
 							</a-form-item>
 						</a-col>
             <a-col :span="12">
-							<a-form-item label="交货地点(place of delivery)" v-bind="validateInfos.placeDelivery" id="quotationFormForm-placeDelivery" name="placeDelivery">
-								<a-input v-model:value="formData.placeDelivery" placeholder="请输入交货地点(place of delivery)"  allow-clear ></a-input>
+							<a-form-item label="交货地点(place of delivery)" v-bind="validateInfos.deliveryAddress" id="quotationFormForm-deliveryAddress" name="deliveryAddress">
+								<a-input v-model:value="formData.deliveryAddress" placeholder="请输入交货地点(place of delivery)"  allow-clear ></a-input>
 							</a-form-item>
 						</a-col>
             <a-col :span="12">
-							<a-form-item label="是否希望出口(export)" v-bind="validateInfos.export" id="quotationFormForm-export" name="export" :labelCol="formItemLayout.labelCol1" :wrapperCol="formItemLayout.wrapperCol1">
-                <JDictSelectTag v-model:value="formData.export" placeholder="请选择" dictCode="yes_or_no"/>
+							<a-form-item label="是否希望出口(isExport)" v-bind="validateInfos.isExport" id="quotationFormForm-isExport" name="isExport" :labelCol="formItemLayout.labelCol1" :wrapperCol="formItemLayout.wrapperCol1">
+                <JDictSelectTag v-model:value="formData.isExport" placeholder="请选择" dictCode="yes_or_no"/>
 							</a-form-item>
 						</a-col>
             <a-col :span="12">
@@ -80,13 +80,13 @@
 							</a-form-item>
 						</a-col>
             <a-col :span="12">
-							<a-form-item label="包装要求(packaging requirement)" v-bind="validateInfos.packagingRequirement" id="quotationFormForm-packagingMethod" name="packagingMethod" :labelCol="formItemLayout.labelCol1" :wrapperCol="formItemLayout.wrapperCol1">
-								<a-input v-model:value="formData.packagingMethod" placeholder="请输入包装要求(packaging requirement)"  allow-clear ></a-input>
+							<a-form-item label="包装要求(packaging requirement)" v-bind="validateInfos.packagingRequirement" id="quotationFormForm-packagebRequirement" name="packagebRequirement" :labelCol="formItemLayout.labelCol1" :wrapperCol="formItemLayout.wrapperCol1">
+								<a-input v-model:value="formData.packagebRequirement" placeholder="请输入包装要求(packaging requirement)"  allow-clear ></a-input>
 							</a-form-item>
 						</a-col>
             <a-col :span="12">
-							<a-form-item label="联系人(linkman)" v-bind="validateInfos.linkman" id="quotationFormForm-linkman" name="linkman" :labelCol="formItemLayout.labelCol1" :wrapperCol="formItemLayout.wrapperCol1">
-								<a-input v-model:value="formData.linkman" placeholder="请输入联系人(linkman)"  allow-clear ></a-input>
+							<a-form-item label="联系人(linkMan)" v-bind="validateInfos.linkMan" id="quotationFormForm-linkMan" name="linkMan" :labelCol="formItemLayout.labelCol1" :wrapperCol="formItemLayout.wrapperCol1">
+								<a-input v-model:value="formData.linkMan" placeholder="请输入联系人(linkMan)"  allow-clear ></a-input>
 							</a-form-item>
 						</a-col>
             <a-col :span="12">
@@ -95,8 +95,8 @@
 							</a-form-item>
 						</a-col>
             <a-col :span="12">
-							<a-form-item label="联系电话(linkman phone)" v-bind="validateInfos.linkmanPhone" id="quotationFormForm-linkmanPhone" name="linkmanPhone">
-								<a-input v-model:value="formData.linkmanPhone" placeholder=""  allow-clear ></a-input>
+							<a-form-item label="联系电话(linkMan phone)" v-bind="validateInfos.linkNumber" id="quotationFormForm-linkNumber" name="linkNumber">
+								<a-input v-model:value="formData.linkNumber" placeholder=""  allow-clear ></a-input>
 							</a-form-item>
 						</a-col>
             <a-col :span="12">
@@ -105,13 +105,13 @@
 							</a-form-item>
 						</a-col>
             <a-col :span="12">
-							<a-form-item label="F号(F number)" v-bind="validateInfos.FNumber" id="quotationFormForm-FNumber" name="FNumber" :labelCol="formItemLayout.labelCol1" :wrapperCol="formItemLayout.wrapperCol1">
-                <a-input v-model:value="formData.FNumber" placeholder="请选择" />
+							<a-form-item label="F号(F number)" v-bind="validateInfos.fnumber" id="quotationFormForm-fnumber" name="fnumber" :labelCol="formItemLayout.labelCol1" :wrapperCol="formItemLayout.wrapperCol1">
+                <a-input v-model:value="formData.fnumber" placeholder="请选择" />
 							</a-form-item>
 						</a-col>
             <a-col :span="12">
-							<a-form-item label="提单号(B/L NO)" v-bind="validateInfos.BLNO" id="quotationFormForm-BLNO" name="BLNO">
-								<a-input v-model:value="formData.BLNO" placeholder="请输入"  allow-clear ></a-input>
+							<a-form-item label="提单号(B/L NO)" v-bind="validateInfos.blno" id="quotationFormForm-blno" name="blno">
+								<a-input v-model:value="formData.blno" placeholder="请输入"  allow-clear ></a-input>
 							</a-form-item>
 						</a-col>						
             <a-col :span="12">
@@ -140,6 +140,7 @@
           :rowNumber="true"
           :rowSelection="true"
           asyncRemove
+          @valueChange="changeValues"
           >
             <template #action="props">
                   <a-popconfirm title="确定删除吗?" @confirm="handleDelete1(props)">
@@ -160,6 +161,7 @@
           :disabled="disabled"
           :rowNumber="true"
           :rowSelection="true"
+          
           >
             <template #action="props" >
               <a @click="viewAccessory(props)" >查看配件信息(view accessory information)</a>
@@ -178,7 +180,7 @@
   import { defineComponent, ref, reactive, computed, toRaw, onMounted } from 'vue';
   import { defHttp } from '/@/utils/http/axios';
   import { useValidateAntFormAndTable } from '/@/hooks/system/useJvxeMethods';
-  import { querysaleQuotationFormShipListByMainId,querySaleQuotationFormProductListByMainId,queryDataById, saveOrUpdate } from '../delivertNoticeForm.api';
+  import { querydeliveryNoticeFormShipListByMainId,querydeliveryNoticeFormProductListByMainId,queryDataById, saveOrUpdate } from '../delivertNoticeForm.api';
   import { JVxeTable } from '/@/components/jeecg/JVxeTable';
   import {deliveryNoticeShipColumns, deliveryNoticeProductColumns} from '../delivertNoticeForm.data';
   import BaseShipArchiveAccessoriesModal from '../../../publicComponents/BaseShipArchiveAccessoriesModal.vue';
@@ -244,6 +246,7 @@
         id: '',
         status: undefined,
         delFlag: undefined,   
+        sourceCode:'',
         deliveryDate: moment(new Date()).format('YYYY-MM-DD'),   
         billCode: '',   
         project: '',   
@@ -257,20 +260,19 @@
         currency:"",
         deliveryTerms: '',   
         delivery: '',
-        placeDelivery:'',
-        export:'',
+        deliveryAddress:'',
+        isExport:'',
         warrantyPeriod:'',
-        paymentTerms: '',
         saleDepartment:'',
-        packagingMethod:'', 
-        linkman:'',    
+        packagebRequirement:'', 
+        linkMan:'',    
         address:'', 
-        linkmanPhone:'',
+        linkNumber:'',
         salesman: '', 
-        FNumber:"",
-        BLNO: '',   
+        fnumber:"",
+        blno: '',   
         notes: '',   
-        sourceCode:'',
+        
       });
 
       //表单验证
@@ -315,9 +317,9 @@
         //主表数据
         await queryMainData(row.id);
         //子表数据
-        const deliveryNoticeFormShipDataList = await querysaleQuotationFormShipListByMainId(row['id']);
+        const deliveryNoticeFormShipDataList = await querydeliveryNoticeFormShipListByMainId(row['id']);
         deliveryNoticeFormShipTable.dataSource = [...deliveryNoticeFormShipDataList];
-        const deliveryDetailFormProductDataList = await querySaleQuotationFormProductListByMainId(row['id']);
+        const deliveryDetailFormProductDataList = await querydeliveryNoticeFormProductListByMainId(row['id']);
         deliveryDetailFormProductTable.dataSource = [...deliveryDetailFormProductDataList];
         getOptiom()
         getCustomerOptions()
@@ -338,8 +340,8 @@
       }
 
       const {getSubFormAndTableData, transformData} = useValidateAntFormAndTable(activeKey, {
-        'saleQuotationShip': deliveryNoticeFormShipTableRef,
-        'saleQuotationProduct': deliveryDetailFormProductTableRef,
+        'saleDeliveryShip': deliveryNoticeFormShipTableRef,
+        'saleDeliveryDetails': deliveryDetailFormProductTableRef,
       });
       //获取表单信息
       async function getFormData() {
@@ -367,8 +369,7 @@
           const values = Object.assign({}, dbData, mainData, subData);
           console.log('表单提交数据', values)
           const isUpdate = values.id ? true : false
-          const isRevise = values.status=='1' ? true : false
-          await saveOrUpdate(values, isUpdate,isRevise);
+          await saveOrUpdate(values, isUpdate);
           //关闭弹窗
           emit('success');
         }        
@@ -471,9 +472,12 @@
         SelectSaleOrderModalRef.value.getTable(obj)
       }
       function addFormSaleOrder(data){
-        data.map(item=>{
+        data.map((item)=>{
           item.model = item.childModel
           item.sourceId = item.childId
+          item.orderQuantity = item.quantity
+          item.orderMoney = item.taxAmount
+          item.money=item.taxAmount
         })
         var arrProduct = data.concat(deliveryDetailFormProductTable.dataSource)
         deliveryDetailFormProductTable.dataSource=arrProduct  
@@ -481,14 +485,34 @@
         formData.sourceCode =data[0].billCode
         formData.project = data[0].project
         formData.projectName = data[0].projectName
-        formData.quotationCustomerName = data[0].customerName
+        formData.customerName = data[0].customerName
         formData.customer = data[0].customer
         formData.priority =data[0].priority
         formData.productionClass =data[0].productionClass
         formData.model =data[0].headModel
         formData.maker =data[0].maker
+        formData.currency =data[0].currency
+        formData.deliveryTerms =data[0].deliveryTerms
+        formData.delivery=data[0].delivery
+        getShipList(data[0].headId)
+      }
+      function getShipList(id){
+        let params = {id:id}
+        let url = '/saleCode/saleOrder/querySaleOrderShipByMainId'
+          defHttp.get({url:url,params}, { isTransformResponse: false }).then(res=>{
+            if(res){
+              deliveryNoticeFormShipTable.dataSource = res.result
+            }
+          })
+      }
+      function changeValues(prop){
+        if(prop.col.key=='quantity'){
+          if(prop.row.quantity){
+            var num= prop.row.quantity*Number(prop.row.taxPrice)
+            prop.row.money = num.toFixed(2)
+          }
+        }
       }
-
       return {
         deliveryNoticeFormShipTableRef,
         deliveryNoticeFormShipTable,
@@ -522,7 +546,8 @@
         notAllowEdit,
         selectSaleOrderList,
         SelectSaleOrderModalRef,
-        addFormSaleOrder
+        addFormSaleOrder,
+        changeValues
       }
     }
   });

+ 31 - 15
src/views/saleCode/deliveryNotice/delivertNoticeForm.api.ts

@@ -4,19 +4,20 @@ import { useMessage } from "/@/hooks/web/useMessage";
 const { createConfirm } = useMessage();
 
 enum Api {
-  list = '/saleCode/saleQuotation/list',
-  save='/saleCode/saleQuotation/add',
-  edit='/saleCode/saleQuotation/edit',
-  deleteOne = '/saleCode/saleQuotation/delete',
-  deleteBatch = '/saleCode/saleQuotation/deleteBatch',
-  importExcel = '/saleCode/saleQuotation/importExcel',
-  exportXls = '/saleCode/saleQuotation/exportXls',
-  queryDataById = '/saleCode/saleQuotation/queryById',
-  saleQuotationFormShipList = '/saleCode/saleQuotation/querySaleQuotationShipByMainId',
-  saleQuotationFormProductList = '/saleCode/saleQuotation/querySaleQuotationProductByMainId',
-  submitBatch='/saleCode/saleQuotation/submitBatch',
-  cancelSubmitBatch='/saleCode/saleQuotation/returnSubmitBatch',
-  supplierList='/cuspCode/cuspSupplierProfile/list?pageSize=-1'
+  list = '/saleCode/saleDelivery/list',
+  save='/saleCode/saleDelivery/add',
+  edit='/saleCode/saleDelivery/edit',
+  deleteOne = '/saleCode/saleDelivery/delete',
+  deleteBatch = '/saleCode/saleDelivery/deleteBatch',
+  importExcel = '/saleCode/saleDelivery/importExcel',
+  exportXls = '/saleCode/saleDelivery/exportXls',
+  queryDataById = '/saleCode/saleDelivery/queryById',
+  deliveryNoticeFormShipList = '/saleCode/saleDelivery/querySaleDeliveryShipByMainId',
+  deliveryNoticeFormProductList = '/saleCode/saleDelivery/querySaleDeliveryDetailsByMainId',
+  submitBatch='/saleCode/saleDelivery/submitBatch',
+  cancelSubmitBatch='/saleCode/saleDelivery/returnSubmitBatch',
+  supplierList='/cuspCode/cuspSupplierProfile/list?pageSize=-1',
+  closeBatch='/saleCode/saleDelivery/closeBatch',
 }
 /**
  * 导出api
@@ -33,13 +34,13 @@ export const getImportUrl = Api.importExcel;
  * 查询子表数据
  * @param params
  */
-export const querysaleQuotationFormShipListByMainId = (id) => defHttp.get({url: Api.saleQuotationFormShipList, params:{ id }});
+export const querydeliveryNoticeFormShipListByMainId = (id) => defHttp.get({url: Api.deliveryNoticeFormShipList, params:{ id }});
 
 /**
  * 查询子表数据
  * @param params
  */
-export const querySaleQuotationFormProductListByMainId = (id) => defHttp.get({url: Api.saleQuotationFormProductList, params:{ id }});
+export const querydeliveryNoticeFormProductListByMainId = (id) => defHttp.get({url: Api.deliveryNoticeFormProductList, params:{ id }});
 
 
 /**
@@ -120,6 +121,21 @@ 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 supplierOption = (params) => defHttp.get({url: Api.supplierList, params});

+ 7 - 10
src/views/saleCode/deliveryNotice/delivertNoticeForm.data.ts

@@ -9,16 +9,11 @@ export const columns: BasicColumn[] = [
     title: '通知单号(bill code)',
     align:"center",
     dataIndex: 'billCode'
-   }, 
-   {
-    title: '合同编号(contract code)',
-    align:"center",
-    dataIndex: 'contractCode'
    },  
    {
     title: '发货日期(delivert date)',
     align:"center",
-    dataIndex: 'delivertDate',
+    dataIndex: 'deliveryDate',
     customRender:({text}) =>{
       text = !text ? "" : (text.length > 10 ? text.substr(0,10) : text);
       return text;
@@ -73,22 +68,24 @@ export const columns: BasicColumn[] = [
     align:"center",
     dataIndex: 'customsClearanceDocuments',
     slots: { customRender: 'viewFile' },
+    width:300,
    },
    {
     title: '证书/报告(certificate/report)',
     align:"center",
     dataIndex: 'file',
     slots: { customRender: 'viewFile' },
+    width:250,
    },
    {
     title: '提交(submit)',
     align:"center",
-    dataIndex: 'submit',
+    dataIndex: 'submit_dictText',
    },
    {
     title: '关闭(close)',
     align:"center",
-    dataIndex: 'close',
+    dataIndex: 'close_dictText',
    },
 ];
 
@@ -244,7 +241,7 @@ export const deliveryNoticeProductColumns: JVxeColumn[] = [
     {
       title: '订单数量(order quantity)',
       key: 'orderQuantity',
-      type: JVxeTypes.inputNumber,
+      type: JVxeTypes.normal,
       placeholder: '请输入${title}',
       width:"200px",
       defaultValue:'',
@@ -276,7 +273,7 @@ export const deliveryNoticeProductColumns: JVxeColumn[] = [
     {
       title: '金额(money)',
       key: 'money',
-      type: JVxeTypes.inputNumber,
+      type: JVxeTypes.normal,
       placeholder: '请输入${title}',
       width:"200px",
       defaultValue:'',

+ 30 - 13
src/views/saleCode/deliveryNotice/deliveryNoticeList.vue

@@ -20,13 +20,13 @@
               <a-col :lg="8">
                 <a-form-item name="project">
                   <template #label><span title="项目(project)">项目(project)</span></template>
-                  <a-input placeholder="请输入项目(project)" v-model:value="queryParam.project" allow-clear ></a-input>
+                  <a-input placeholder="请输入项目(project)" v-model:value="queryParam.projectName" allow-clear ></a-input>
                 </a-form-item>
               </a-col>
               <a-col :lg="8">
                 <a-form-item name="customer">
                   <template #label><span title="客户(customer)">客户(customer)</span></template>
-                  <a-input placeholder="请输入客户(customer)" v-model:value="queryParam.customer" allow-clear ></a-input>
+                  <a-input placeholder="请输入客户(customer)" v-model:value="queryParam.customerName" allow-clear ></a-input>
                 </a-form-item>
               </a-col>
               <a-col :lg="8">
@@ -97,16 +97,15 @@
      <BasicTable @register="registerTable" :rowSelection="rowSelection" size="small" >
        <!--插槽:table标题-->
         <template #tableTitle>
-            <a-button type="primary"  @click="handleAdd" preIcon="ant-design:plus-outlined"> 新增(add)</a-button>
-            <a-button  type="primary"   preIcon="ant-design:export-outlined" @click="onExportXls"> 导出(export)</a-button>
-            <a-button  type="primary"  @click="submit"> 提交(submit)</a-button>
+            <a-button type="primary"  @click="handleAdd" preIcon="ant-design:plus-outlined" v-auth="'saleCode:sale_delivery:add'"> 新增(add)</a-button>
+            <a-button  type="primary"   preIcon="ant-design:export-outlined" @click="onExportXls"  v-auth="'saleCode:sale_delivery:exportXls'"> 导出(export)</a-button>
+            <a-button  type="primary"  @click="submit" > 提交(submit)</a-button>
             <a-button  type="primary"  @click="cancelSubmit"> 取消提交(cancelSubmit)</a-button>
-            <a-button  type="primary"  > 关闭(close)</a-button>
-            <a-button  type="primary" > 取消关闭(cancelClose)</a-button>
+            <a-button  type="primary"   @click="close" > 关闭(close)</a-button>
             <a-dropdown v-if="selectedRowKeys.length > 0">
                 <template #overlay>
                   <a-menu>
-                    <a-menu-item key="1" @click="batchHandleDelete"  >
+                    <a-menu-item key="1" @click="batchHandleDelete"   v-auth="'saleCode:sale_delivery:deleteBatch'">
                       <Icon icon="ant-design:delete-outlined"></Icon>
                       删除(delete)
                     </a-menu-item>
@@ -141,7 +140,7 @@
     import { useListPage } from '/@/hooks/system/useListPage'
     import {useModal} from '/@/components/Modal';
     import {columns} from './delivertNoticeForm.data';
-    import {list, deleteOne, batchDelete, getImportUrl,getExportUrl,batchSubmit,cancelBatchSubmit} from './delivertNoticeForm.api';
+    import {list, deleteOne, batchDelete, getImportUrl,getExportUrl,batchSubmit,cancelBatchSubmit,bacthClose} from './delivertNoticeForm.api';
     import { defHttp } from '/@/utils/http/axios';
     import { JDictSelectTag} from '/@/components/Form';
     import ViewFileListModal from './components/ViewFileListModal.vue';
@@ -273,7 +272,8 @@
            {
              label: '编辑(edit)',
              onClick: handleEdit.bind(null, record),
-             ifShow: record.submit=='0'
+             ifShow: record.submit=='0',
+             auth: 'saleCode:sale_delivery:edit',
            },
            {
              label: '详情(detail)',
@@ -287,7 +287,6 @@
           */
     function getDropDownAction(record){
          return [
-         
            {
              label: '删除(delete)',
              popConfirm: {
@@ -295,8 +294,18 @@
                confirm: handleDelete.bind(null, record),
                placement: 'topLeft'
              },
-             ifShow: record.status=='0',
-           }
+             auth: 'saleCode:sale_delivery:delete',
+             ifShow: record.submit=='0',
+           },
+           {
+             label: '导出装箱单(export paking list)'
+           },
+           {
+             label: '导出签单(export markt)'
+           },
+           {
+             label: '导出唛头(export mark) '
+           },
          ]
      }
     function submit(){
@@ -318,6 +327,14 @@
     function viewFileDetail(props){
         ViewFileListModalRef.value.getTable(props.column.dataIndex,props.record)
     }
+    function close(){
+    if(selectedRowKeys.value.length==0){
+      message.warning('请选择数据')
+    }else{
+      var ids=selectedRowKeys.value.join(',')
+      bacthClose({ids: ids},handleSuccess);
+    }
+  }