Browse Source

到货单-功能

jingbb 5 months ago
parent
commit
452e8d6cfb

+ 413 - 0
src/views/publicComponents/SelectPurchaseOrderModal.vue

@@ -0,0 +1,413 @@
+<template>
+    <a-modal
+      title="选择采购订单(Select Purchase Order)"
+      width="95%"
+      :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="queryParams" :label-col="labelCol" :wrapper-col="wrapperCol" @keyup.enter.native="searchQuery">
+                <a-row :gutter="24">
+                    <a-col :md="6" :sm="8">
+                        <a-form-item label="订单编号(bill code)">
+                            <a-input placeholder="请输入" v-model:value="queryParams.billCode"></a-input>
+                        </a-form-item>
+                    </a-col>
+                    <a-col :md="6" :sm="8">
+                        <a-form-item label="单据日期(bill date)">
+                            <a-range-picker value-format="YYYY-MM-DD"  v-model:value="billDate"  @change="changeBillDate" class="query-group-cust"/>
+                        </a-form-item>
+                    </a-col> 
+                    <template v-if="toggleSearchStatus">
+                        <a-col :md="6" :sm="8">
+                            <a-form-item label="项目(project)">
+                                <a-input placeholder="请输入" v-model:value="queryParams.project" :disabled="fatherProject!==''"></a-input>
+                            </a-form-item>
+                        </a-col>
+                        <a-col :md="6" :sm="8">
+                            <a-form-item label="产品分类(production class)" :label-col="labelCol1" :wrapper-col="wrapperCol1">
+                                <!-- <a-input placeholder="请输入" v-model:value="queryParams.classId"></a-input> -->
+                                <JSelectInput   v-model:value="queryParams.productionClass"  placeholder="请选择" :options="classOption" ></JSelectInput>
+                            </a-form-item>
+                        </a-col>
+                        <a-col :md="6" :sm="8">
+                            <a-form-item label="供应商(supplier)">
+                                <a-input placeholder="请输入" v-model:value="queryParams.supplierName"></a-input>
+                            </a-form-item>
+                        </a-col>
+                        <a-col :md="6" :sm="8">
+                            <a-form-item label="优先级(priority)" >
+                                <JDictSelectTag v-model:value="queryParams.priority" placeholder="请选择" dictCode="priority" style="width: 100%;"/>
+                            </a-form-item>
+                        </a-col>
+                        
+                        <a-col :md="6" :sm="8">
+                            <a-form-item label="机型(model)">
+                                <a-input placeholder="请输入" v-model:value="queryParams.headModel"></a-input>
+                            </a-form-item>
+                        </a-col>
+                        <a-col :md="6" :sm="8">
+                            <a-form-item label="产品编码(product code)" :label-col="labelCol1" :wrapper-col="wrapperCol1">
+                                <a-input placeholder="请输入" v-model:value="queryParams.productCode"></a-input>
+                            </a-form-item>
+                        </a-col>                  
+                    </template>
+                    <a-col :md="6" :sm="8">
+                        <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
+                            <a-button type="primary" @click="searchQuery" >查询(search)</a-button>
+                            <a-button type="primary" @click="searchReset"  style="margin-left: 8px">重置(reset)</a-button>
+                            <a @click="handleToggleSearch" style="margin-left: 8px">
+                            {{ toggleSearchStatus ? '收起' : '展开' }}
+                            <a-icon :type="toggleSearchStatus ? 'up' : 'down'" />
+                            </a>
+                        </span>
+                    </a-col>
+                </a-row>
+            </a-form>
+           </div>
+        </a-card>
+
+        <a-card  :body-style="{ padding: '10px' }" :bordered="false" style="margin: 10px;">
+            <a-alert type="info" show-icon class="alert" style="margin-bottom: 8px">
+            <template #message>
+                <template v-if="selectedRowKeys.length > 0">
+                <span>已选中 {{ selectedRowKeys.length }} 条记录</span>
+                <a-divider type="vertical" />
+                <a @click="selectedRowKeys = []">清空</a>
+                </template>
+                <template v-else>
+                <span>未选中任何数据</span>
+                </template>
+            </template>
+            </a-alert>
+            <a-table
+                :columns="columns"
+                :row-key="record => record.childId"
+                :data-source="dataSource"
+                bordered
+                size="small"
+                @change="handleTableChange"
+                :pagination="pagination"
+                :scroll="{ x: 4000, y: 300 }"
+                :rowSelection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
+            >
+            </a-table>
+        </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';
+    import { JDictSelectTag} from '/@/components/Form';
+    import JSelectInput from '/@/components/Form/src/jeecg/components/JSelectInput.vue';
+    const emit = defineEmits([ 'selectPurchaseOrder']); //定义emit
+    let classOption = ref([])
+    var visible = ref(false)
+    var fatherProject = ref('')
+    var fatherSourceCode = ref('')
+    const columns = [
+        {
+            title: '订单编号(bill code)',
+            dataIndex: 'billCode',
+            key: 'billCode',
+            align:"center",
+            width:250,
+            
+        },
+        {
+            title: '单据日期(bill date)',
+            dataIndex: 'billDate',
+            key: 'billDate',
+            align:"center"
+        },
+        {
+            title: '项目(project)',
+            dataIndex: 'projectName',
+            key: 'projectName',
+            align:"center",
+            width:250,
+        },
+        {
+            title: '供应商(supplier name)',
+            dataIndex: 'supplierName',
+            key: 'supplierName',
+            align:"center"
+        },
+        {
+            title: '优先级(priority)',
+            dataIndex: 'priority_dictText',
+            key: 'priority_dictText',
+            align:"center"
+        },
+        {
+            title: '产品分类(production class)',
+            dataIndex: 'productionClass',
+            key: 'productionClass',
+            align:"center",
+            width:250,
+        },
+        {
+            title: '机型(model)',
+            dataIndex: 'headModel',
+            key: 'headModel',
+            align:"center"
+        },
+        {
+            title: '采购部门(puechase department)',
+            dataIndex: 'purchaseDepartment',
+            key: 'purchaseDepartment',
+            align:"center"
+        },
+        {
+            title: '采购员(puechaseman)',
+            dataIndex: 'purchaseman',
+            key: 'purchaseman',
+            align:"center"
+        },
+        {
+            title: '产品英文名(English name)',
+            key: 'englishName',
+            dataIndex: 'englishName',
+            align:"center",
+            width:250,
+        },
+        {
+            title: '型号(childModel)',
+            key: 'childModel',
+            dataIndex: 'childModel',
+            align:"center"
+        },
+        {
+            title: '厂家(factory)',
+            key: 'factory',
+            dataIndex: 'factory',
+            align:"center",
+            width:250
+        },
+        {
+            title: '质量等级(quantity grade)',
+            key: 'qualityGrade',
+            dataIndex: 'qualityGrade',
+            align:"center",
+            width:250,
+        },
+        {
+            title: '数量(quanlity)',
+            key: 'quanlity',
+            dataIndex: 'quanlity',
+            align:"center",
+            width:250,
+        },
+        {
+            title: '单价(price)',
+            key: 'taxPrice',
+            dataIndex: 'taxPrice',
+            align:"center",
+            width:250,
+        },
+        {
+            title: '金额(tax money)',
+            key: 'taxAmount',
+            dataIndex: 'taxAmount',
+            align:"center",
+            width:250,
+        },
+    ];
+    const labelCol = ref({
+    xs: { span: 24 },
+    sm: { span: 9 },
+    });
+    const wrapperCol = ref({
+        xs: { span: 24 },
+        sm: { span: 15 },
+    });
+    const labelCol1 = ref({
+    xs: { span: 24 },
+    sm: { span: 10 },
+    });
+    const wrapperCol1 = ref({
+        xs: { span: 24 },
+        sm: { span: 14 },
+    });
+    const dataSource =ref([]);
+    let selectedRowKeys = ref([]);
+    let selectedRows = ref([]);
+    const toggleSearchStatus = ref(false);
+    var billDate = ref([])
+    const queryParams = ref({
+        billCode:'',
+        project:'',
+        projectName:'',
+        productionClass:'',
+        priority:'',
+        supplier:'',
+        supplierName:'',
+        headModel:'',
+        productCode:'',
+        billDate_begin:'',
+        billDate_end:'',
+        saleDepartment:'',
+        salesman:'',
+    });
+    let pagination = ref({
+      current: 1,
+      pageSize: 10,
+      total: '', // 假设总共有100条数据
+      showSizeChanger: true,
+      showQuickJumper: true,
+      showTotal: (total, range) => {
+          return range[0] + "-" + range[1] + " 共" + total + "条"
+      },
+      size:'small'
+    });
+    function loadData(){
+        let params = getQueryParams();
+        defHttp.get({ url: '/purCode/purOrder/selectPurOrderDetailAlert',params}, { isTransformResponse: false })
+        .then((res) => {
+            if (res.success) {
+                dataSource.value = res.result.records;
+                pagination.value.total = res.result.total;
+                pagination.value.current = res.result.current;
+                pagination.value.pageSize = res.result.size;                
+            } else {
+                message.error(res.message);
+            }
+        })
+        .finally(() => {
+            // loading.value = false;
+        });
+    }
+    function getQueryParams(){
+        let params = Object.assign(queryParams.value);
+        params.pageNo = pagination.value.current;
+        params.pageSize = pagination.value.pageSize;
+        if(fatherProject.value&&fatherProject.value!==''){
+            queryParams.value.quotationProject = fatherProject.value
+        }else {
+            queryParams.value.quotationProject = ''
+        }
+        return filterObj(params);
+    }
+    function handleTableChange(paginations, filters, sorter){
+        pagination.value.total = paginations.total;
+        pagination.value.current = paginations.current;
+        pagination.value.pageSize = paginations.pageSize;
+        loadData()
+    };
+    function getOptiom(){
+    defHttp
+        .get({ url: 'baseCode/baseProductClass/list'}, { isTransformResponse: false })
+        .then((res) => {
+            if (res.success) {
+              classOption.value = []
+              res.result.records.forEach(element => {
+                  var obj = {
+                    label: element.name?element.name:'无名称请维护',
+                    value: element.id?element.id:''
+                  };
+                  classOption.value.push( obj)
+              });    
+            }
+        })
+        .finally(() => {
+            // loading.value = false;
+        });
+  }
+    function searchQuery(){
+        loadData();
+    }
+    function searchReset(){
+        billDate.value = []
+        queryParams.value = {
+            billCode:'',
+            project:'',
+            projectName:'',
+            productionClass:'',
+            priority:'',
+            supplier:'',
+            supplierName:'',
+            headModel:'',
+            productCode:'',
+            billDate_begin:'',
+            billDate_end:'',
+            saleDepartment:'',
+            salesman:'',
+        }
+        pagination.value.current =1;
+        pagination.value.pageSize = 10; 
+        loadData();
+    }
+    function handleToggleSearch(){
+        toggleSearchStatus.value = !toggleSearchStatus.value;
+    }
+    function onSelectChange(keys,rows){
+        selectedRowKeys.value = keys
+        selectedRows.value = rows
+    }
+    function handleOk(){
+        var arr = []
+        selectedRows.value.map(item=>arr.push(item.billCode))
+        if(fatherSourceCode.value&&fatherSourceCode.value!==''){
+            arr.push(fatherSourceCode.value)
+        }
+        if(selectedRowKeys.value.length==0){
+            message.error('请勾选数据');
+        }else if(new Set(arr).size!==1){
+            message.error('请勾选订单编号相同的数据');
+        }else{
+            emit('selectPurchaseOrder', selectedRows.value)
+            handleCancel()
+        }
+    }
+    function handleCancel(){
+      visible.value = false
+      selectedRowKeys.value = []
+      selectedRows.value=[]
+    }
+    function getTable(formData){
+        visible.value = true
+        if(formData.projectName&&formData.projectName!==''){
+            fatherProject.value = formData.project
+        }else{
+            fatherProject.value = ''
+        }
+        if(formData.sourceCode&&formData.sourceCode!==''){
+            fatherSourceCode.value = formData.sourceCode
+        }else{
+            fatherSourceCode.value = ''
+        }
+        loadData()
+        getOptiom()
+    }
+    function changeBillDate(prop){
+       if(prop){
+            billDate.value = prop
+            queryParams.value.billDate_begin = prop[0]
+            queryParams.value.billDate_end = prop[1]
+       }else{
+            billDate.value = []
+            queryParams.value.billDate_begin = ''
+            queryParams.value.billDate_end = ''
+       }
+       
+    }
+    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>

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

@@ -5,6 +5,7 @@ const { createConfirm } = useMessage();
 
 enum Api {
   list = '/purCode/purDeliveryNote/list',
+  supplierList='/cuspCode/cuspSupplierProfile/list',
   save='/purCode/purDeliveryNote/add',
   edit='/purCode/purDeliveryNote/edit',
   deleteOne = '/purCode/purDeliveryNote/delete',
@@ -48,6 +49,14 @@ export const queryArriveGoodsDetailByMainId = (id) => defHttp.get({url: Api.Arri
 export const list = (params) =>
   defHttp.get({url: Api.list, params});
 
+/**
+ * 供应商列表接口
+ * @param params
+ */
+export const Supplierlist = (params) =>
+  defHttp.get({url: Api.supplierList, params});
+
+
 /**
  * 删除单个
  */

+ 2 - 2
src/views/purchase/arrivedGoods/ArriveGoodsForm.data.ts

@@ -29,7 +29,7 @@ export const columns: BasicColumn[] = [
    {
     title: '供应商(supplier)',
     align:"center",
-    dataIndex: 'suppilerName'
+    dataIndex: 'supplierName'
    },
    {
     title: '优先级(priority)',
@@ -69,7 +69,7 @@ export const columns: BasicColumn[] = [
     {
       title: '关闭(close)',
       align:"center",
-      dataIndex: 'close',
+      dataIndex: 'close_dictText',
     },
 ];
 

+ 51 - 15
src/views/purchase/arrivedGoods/ArriveGoodsList.vue

@@ -18,7 +18,7 @@
           </a-col>           
           <template v-if="toggleSearchStatus">
             <a-col :lg="8">
-              <a-form-item name="projectName">
+              <a-form-item name="projectName" :label-col="labelCol1" :wrapper-col="wrapperCol1">
                 <template #label><span title="项目(projectName)">项目(projectName)</span></template>
                 <a-input placeholder="请输入项目(projectName)" v-model:value="queryParam.projectName" allow-clear ></a-input>
               </a-form-item>
@@ -26,7 +26,15 @@
             <a-col :lg="8">
               <a-form-item name="supplierName">
                 <template #label><span title="供应商(supplierName)">供应商(supplierName)</span></template>
-                <a-input placeholder="请输入" v-model:value="queryParam.supplierName" allow-clear ></a-input>
+                <ApiSelect
+                  :api="Supplierlist"
+                  showSearch
+                  v-model:value="queryParam.supplier"
+                  :filterOption="false"
+                  resultField="records"
+                  labelField="name"
+                  valueField="id"
+                />
               </a-form-item>
             </a-col>
             <a-col :lg="8">
@@ -36,7 +44,7 @@
               </a-form-item>
             </a-col>
             <a-col :lg="8">
-              <a-form-item name="productionClass" >
+              <a-form-item name="productionClass" :label-col="labelCol1" :wrapper-col="wrapperCol1">
                 <template #label><span title="产品分类(production class)">产品分类(production class)</span></template>
                 <JSelectInput   v-model:value="queryParam.productionClass"  placeholder="请选择" :options="classOption" ></JSelectInput>
               </a-form-item>
@@ -60,8 +68,8 @@
               </a-form-item>
             </a-col> -->
             <a-col :lg="8">
-              <a-form-item name="purchaseDepartment">
-                <template #label><span title="采购部门(purchase department)">采购部门(purchase department)</span></template>
+              <a-form-item name="purchaseDepartment" :label-col="labelCol1" :wrapper-col="wrapperCol1">
+                <template #label ><span title="采购部门(purchase department)">采购部门(purchase department)</span></template>
                 <a-input placeholder="请输入采购部门(purchase department)" v-model:value="queryParam.purchaseDepartment" allow-clear ></a-input>
               </a-form-item>
             </a-col>
@@ -78,7 +86,7 @@
               </a-form-item>
             </a-col>
             <a-col :lg="8">
-              <a-form-item name="close">
+              <a-form-item name="close" :label-col="labelCol1" :wrapper-col="wrapperCol1">
                 <template #label><span title="关闭(close)">关闭(close)</span></template>
                 <JDictSelectTag v-model:value="queryParam.close" placeholder="请选择" dictCode="yes_or_no"/>
               </a-form-item>
@@ -103,14 +111,16 @@
    <BasicTable @register="registerTable" :rowSelection="rowSelection" size="small" >
      <!--插槽:table标题-->
       <template #tableTitle>
-          <a-button type="primary"  @click="handleAdd" preIcon="ant-design:plus-outlined" v-auth="'purCode:pur_inquiry_form:add'"> 新增(add)</a-button>
-          <a-button  type="primary"   preIcon="ant-design:export-outlined" @click="onExportXls" v-auth="'purCode:pur_inquiry_form:exportXls'"> 导出(export)</a-button>
+          <a-button type="primary"  @click="handleAdd" preIcon="ant-design:plus-outlined" v-auth="'purCode:pur_delivery_note:add'"> 新增(add)</a-button>
+          <a-button  type="primary"   preIcon="ant-design:export-outlined" @click="onExportXls" v-auth="'purCode:pur_delivery_note: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"  @click="close" > 关闭(close)</a-button>
+          <a-button  type="primary"  @click="cancelClose" > 取消关闭(cancel close)</a-button>
           <a-dropdown v-if="selectedRowKeys.length > 0">
               <template #overlay>
                 <a-menu>
-                  <a-menu-item key="1" @click="batchHandleDelete" v-auth="'purCode:pur_inquiry_form:deleteBatch'" >
+                  <a-menu-item key="1" @click="batchHandleDelete" v-auth="'purCode:pur_delivery_note:deleteBatch'" >
                     <Icon icon="ant-design:delete-outlined"></Icon>
                     删除(delete)
                   </a-menu-item>
@@ -141,11 +151,12 @@
   import {useModal} from '/@/components/Modal';
   import ArriveGoodsFormModal from './components/ArriveGoodsFormModal.vue'
   import {columns,} from './ArriveGoodsForm.data';
-  import {list, deleteOne, batchDelete, getImportUrl,getExportUrl,batchSubmit,cancelBatchSubmit} from './ArriveGoodsForm.api';
+  import {list, deleteOne, batchDelete, getImportUrl,bacthClose,cancelBatchClose,getExportUrl,batchSubmit,cancelBatchSubmit,Supplierlist} from './ArriveGoodsForm.api';
   import { cloneDeep } from "lodash-es";
   import { defHttp } from '/@/utils/http/axios';
   import { JDictSelectTag} from '/@/components/Form';
   import JSelectInput from '/@/components/Form/src/jeecg/components/JSelectInput.vue';
+  import {ApiSelect} from '/@/components/Form/index';
   import { message } from 'ant-design-vue';
   const formRef = ref();
   const queryParam = reactive<any>({});
@@ -276,8 +287,13 @@
            label: '编辑(edit)',
            onClick: handleEdit.bind(null, record),
            auth: 'purCode:pur_inquiry_form:edit',
-           ifShow: record.submit=='0'
+           ifShow: record.submit=='0'|| record.submit==''
          },
+         {
+           label: '详情(detail)',
+           onClick: handleDetail.bind(null, record),
+           ifShow: record.submit=='1'
+         }, 
        ]
    }   
    /**
@@ -288,6 +304,7 @@
          {
            label: '详情(detail)',
            onClick: handleDetail.bind(null, record),
+           ifShow: record.submit=='0'|| record.submit==''
          }, 
          {
            label: '删除(delete)',
@@ -296,8 +313,8 @@
              confirm: handleDelete.bind(null, record),
              placement: 'topLeft'
            },
-           auth: 'purCode:pur_inquiry_form:delete',
-           ifShow: record.submit=='0',
+           auth: 'purCode:pur_delivery_note:delete',
+           ifShow: record.submit=='0'|| record.submit=='',
            
          }
        ]
@@ -318,6 +335,23 @@
       cancelBatchSubmit({ids: ids},handleSuccess);
     }
   }
+  function close(){
+    if(selectedRowKeys.value.length==0){
+      message.warning('请选择数据')
+    }else{
+      var ids=selectedRowKeys.value.join(',')
+      bacthClose({ids: ids},handleSuccess);
+    }
+  }
+  function cancelClose(){
+    if(selectedRowKeys.value.length==0){
+      message.warning('请选择数据')
+    }else{
+      var ids=selectedRowKeys.value.join(',')
+      cancelBatchClose({ids: ids},handleSuccess);
+    }
+  }
+
 
   
 
@@ -333,17 +367,19 @@
   });
   const labelCol1 = reactive({
     xs:24,
-    sm:12,
+    sm:10,
   });
   const wrapperCol1 = reactive({
     xs: 24,
-    sm: 12,
+    sm: 14,
   });
   /**
    * 重置
    */
   function searchReset() {
+    debugger
     formRef.value.resetFields();
+    queryParam.supplier = '';
     selectedRowKeys.value = [];
     //刷新数据
     reload();

+ 111 - 71
src/views/purchase/arrivedGoods/components/ArriveGoodsFormForm.vue

@@ -10,7 +10,7 @@
 							</a-form-item>
 						</a-col>
 						<a-col :span="12">
-							<a-form-item label="到货日期(arrival date)" v-bind="validateInfos.arrivalDate" id="SaleOrderForm-arrivalDate" name="arrivalDate">
+							<a-form-item label="到货日期(arrival date)" v-bind="validateInfos.arrivalDate" :label-col="formItemLayout.labelCol1" :wrapper-col="formItemLayout.wrapperCol1" id="SaleOrderForm-arrivalDate" name="arrivalDate">
 								<a-date-picker placeholder="请选择到货日期(arrival date)"  v-model:value="formData.arrivalDate"  value-format="YYYY-MM-DD"  style="width: 100%"  allow-clear />
 							</a-form-item>
 						</a-col>		
@@ -20,8 +20,8 @@
 							</a-form-item>
 						</a-col>
 						<a-col :span="12">
-							<a-form-item label="供应商(supplier)" v-bind="validateInfos.supplierName" id="SaleOrderForm-supplierName" name="supplierName">
-                  <a-input   v-model:value="formData.supplierName"  placeholder="请选择" allow-clear  ></a-input>
+							<a-form-item label="供应商(supplier)" v-bind="validateInfos.supplierName" :label-col="formItemLayout.labelCol1" :wrapper-col="formItemLayout.wrapperCol1" id="SaleOrderForm-supplierName" name="supplierName">
+                <JSelectInput   v-model:value="formData.inquirySuppiler"  placeholder="请选择" allow-clear  :options="supplierOption" @change="changeSupplier"></JSelectInput>
 							</a-form-item>
 						</a-col>
 						<a-col :span="12">
@@ -30,7 +30,7 @@
 							</a-form-item>
 						</a-col>
 						<a-col :span="12">
-							<a-form-item label="产品分类(production class)" v-bind="validateInfos.productionClass" id="SaleOrderForm-productionClass" name="productionClass">
+							<a-form-item label="产品分类(production class)" v-bind="validateInfos.productionClass" :label-col="formItemLayout.labelCol1" :wrapper-col="formItemLayout.wrapperCol1" id="SaleOrderForm-productionClass" name="productionClass">
 								<a-input v-model:value="formData.productionClass" placeholder="请输入"  allow-clear disabled ></a-input>
 							</a-form-item>
 						</a-col>
@@ -40,7 +40,7 @@
 							</a-form-item>
 						</a-col>
 						<a-col :span="12">
-							<a-form-item label="厂家(maker)" v-bind="validateInfos.maker" id="SaleOrderForm-maker" name="maker">
+							<a-form-item label="厂家(maker)" v-bind="validateInfos.maker" :label-col="formItemLayout.labelCol1" :wrapper-col="formItemLayout.wrapperCol1" id="SaleOrderForm-maker" name="maker">
 								<a-input v-model:value="formData.maker" placeholder="请输入厂家(maker)"  allow-clear disabled></a-input>
 							</a-form-item>
 						</a-col>
@@ -50,17 +50,17 @@
 							</a-form-item>
 						</a-col>
             <a-col :span="12">
-							<a-form-item label="运单号(waybill number)" v-bind="validateInfos.waybillNumber" id="SaleOrderForm-waybillNumber" name="waybillNumber">
-								<a-input v-model:value="formData.waybillNumber" placeholder="请输入运单号(waybill number)"  allow-clear ></a-input>
+							<a-form-item label="包装要求(package requirement)" v-bind="validateInfos.packagebRequirement" :label-col="formItemLayout.labelCol1" :wrapper-col="formItemLayout.wrapperCol1" id="SaleOrderForm-packagebRequirement" name="packagebRequirement">
+								<a-input v-model:value="formData.packagebRequirement" placeholder="请输入包装要求(package requirement)"  allow-clear disabled></a-input>
 							</a-form-item>
 						</a-col>
             <a-col :span="12">
-							<a-form-item label="包装要求(package requirement)" v-bind="validateInfos.packagebRequirement" id="SaleOrderForm-packagebRequirement" name="packagebRequirement">
-								<a-input v-model:value="formData.packagebRequirement" placeholder="请输入包装要求(package requirement)"  allow-clear disabled></a-input>
+							<a-form-item label="运单号(waybill number)" v-bind="validateInfos.waybillNumber" id="SaleOrderForm-waybillNumber" name="waybillNumber">
+								<a-input v-model:value="formData.waybillNumber" placeholder="请输入运单号(waybill number)"  allow-clear ></a-input>
 							</a-form-item>
 						</a-col>
             <a-col :span="12">
-							<a-form-item label="收件人(recipient)" v-bind="validateInfos.recipient" id="SaleOrderForm-recipient" name="recipient">
+							<a-form-item label="收件人(recipient)" v-bind="validateInfos.recipient" :label-col="formItemLayout.labelCol1" :wrapper-col="formItemLayout.wrapperCol1" id="SaleOrderForm-recipient" name="recipient">
 								<a-input v-model:value="formData.recipient" placeholder="请输入收件人(recipient)"  allow-clear disabled></a-input>
 							</a-form-item>
 						</a-col>
@@ -70,17 +70,17 @@
 							</a-form-item>
 						</a-col>
             <a-col :span="12">
-							<a-form-item label="收件人地址(recipient address)" v-bind="validateInfos.recipientAddress" id="SaleOrderForm-recipientAddress" name="recipientAddress">
+							<a-form-item label="收件人地址(recipient address)" v-bind="validateInfos.recipientAddress" :label-col="formItemLayout.labelCol1" :wrapper-col="formItemLayout.wrapperCol1" id="SaleOrderForm-recipientAddress" name="recipientAddress">
 								<a-input v-model:value="formData.recipientAddress" placeholder="请输入收件人地址(recipient address)"  allow-clear disabled></a-input>
 							</a-form-item>
 						</a-col>
             <a-col :span="12">
 							<a-form-item label="质保条款(warranty terms)" v-bind="validateInfos.warrantyTerms" id="SaleOrderForm-warrantyTerms" name="warrantyTerms">
-								<a-input v-model:value="formData.warrantyTerms" placeholder="请输入质保条款(warranty terms)"  allow-clear ></a-input>
+								<a-input v-model:value="formData.warrantyTerms" placeholder="请输入质保条款(warranty terms)"  allow-clear disabled></a-input>
 							</a-form-item>
 						</a-col> 
             <a-col :span="12">
-							<a-form-item label="采购部门(purchase department)" v-bind="validateInfos.purchaseDepartment" id="SaleOrderForm-purchaseDepartment" name="purchaseDepartment">
+							<a-form-item label="采购部门(purchase department)" v-bind="validateInfos.purchaseDepartment" :label-col="formItemLayout.labelCol1" :wrapper-col="formItemLayout.wrapperCol1" id="SaleOrderForm-purchaseDepartment" name="purchaseDepartment">
 								<a-input v-model:value="formData.purchaseDepartment" placeholder="请输入"  allow-clear disabled></a-input>
 							</a-form-item>
 						</a-col>   
@@ -90,7 +90,7 @@
 							</a-form-item>
 						</a-col> 
             <a-col :span="12">
-							<a-form-item label="发票/发货日期(delivery/invoice date)" v-bind="validateInfos.invoiceDate" id="SaleOrderForm-invoiceDate" name="invoiceDate">
+							<a-form-item label="发票/发货日期(delivery/invoice date)" v-bind="validateInfos.invoiceDate" :label-col="formItemLayout.labelCol1" :wrapper-col="formItemLayout.wrapperCol1" id="SaleOrderForm-invoiceDate" name="invoiceDate">
 								<a-date-picker placeholder="请选择发票/发货日期(delivery/invoice date)"  v-model:value="formData.invoiceDate"  value-format="YYYY-MM-DD"  style="width: 100%"  allow-clear />
 							</a-form-item>
 						</a-col>
@@ -100,7 +100,7 @@
 							</a-form-item>
 						</a-col>   
             <a-col :span="12">
-							<a-form-item label="到货详情(arrival details)" v-bind="validateInfos.arrivalDetails" id="PuechaseInquiryFormForm-arrivalDetails" name="arrivalDetails" :label-col="formItemLayout.labelCol1" :wrapper-col="formItemLayout.wrapperCol1">
+							<a-form-item label="到货详情(arrival details)" v-bind="validateInfos.arrivalDetails" :label-col="formItemLayout.labelCol1" :wrapper-col="formItemLayout.wrapperCol1" id="PuechaseInquiryFormForm-arrivalDetails" name="arrivalDetails" >
 								<JUpload v-model:value="formData.arrivalDetails"></JUpload>
 							</a-form-item>
 						</a-col>        
@@ -130,7 +130,7 @@
           </j-vxe-table>
       </a-tab-pane>
       <a-tab-pane tab="到货单 - 到货明细(arrive details)" key="arriveDetailsFormProduct" :forceRender="true">
-        <a-button type="primary" style="margin-right: 1%;margin-bottom: 1%;" > 选择采购单(select purchase order)</a-button>
+        <a-button type="primary" style="margin-right: 1%;margin-bottom: 1%;" @click="selectPurchaseOrderList"> 选择采购单(select purchase order)</a-button>
         <j-vxe-table
           :keep-source="true"
           resizable
@@ -154,6 +154,7 @@
     </a-tabs>
     <SelectProjectModal ref="SelectProjectModalRef" @selectProject="addProject"></SelectProjectModal>
     <BaseShipArchiveAccessoriesModal ref="BaseShipArchiveAccessoriesModalRef"></BaseShipArchiveAccessoriesModal>
+    <SelectPurchaseOrderModal ref="SelectPurchaseOrderModalRef" @selectPurchaseOrder="addAddiveGoods"></SelectPurchaseOrderModal>
   </a-spin>
 </template>
 
@@ -161,11 +162,12 @@
   import { defineComponent, ref, reactive, computed, toRaw} from 'vue';
   import { defHttp } from '/@/utils/http/axios';
   import { useValidateAntFormAndTable } from '/@/hooks/system/useJvxeMethods';
-  import { queryArriveGoodsShipTable, queryArriveGoodsDetailByMainId, queryDataById, saveOrUpdate} from '../ArriveGoodsForm.api';
+  import { queryArriveGoodsShipTable, queryArriveGoodsDetailByMainId, queryDataById, saveOrUpdate,Supplierlist} from '../ArriveGoodsForm.api';
   import { JVxeTable } from '/@/components/jeecg/JVxeTable';
   import {ArriveGoodsFormShipColumns, ArriveGoodsDetailColumns} from '../ArriveGoodsForm.data';
   import SelectProjectModal from '../../../publicComponents/SelectProjectModal.vue';
   import BaseShipArchiveAccessoriesModal from '../../../publicComponents/BaseShipArchiveAccessoriesModal.vue';
+  import SelectPurchaseOrderModal from '../../../publicComponents/SelectPurchaseOrderModal.vue';
   import JFormContainer from '/@/components/Form/src/container/JFormContainer.vue';
   import JUpload from '/@/components/Form/src/jeecg/components/JUpload/JUpload.vue';
   import { JDictSelectTag} from '/@/components/Form';
@@ -184,6 +186,7 @@
       JSelectInput,
       SelectProjectModal,
       BaseShipArchiveAccessoriesModal,
+      SelectPurchaseOrderModal,
     },
     props:{
       formDisabled:{
@@ -201,6 +204,7 @@
       const ArriveGoodsFormShipTableRef = ref();
       const SelectProjectModalRef = ref()
       const BaseShipArchiveAccessoriesModalRef = ref();
+      const SelectPurchaseOrderModalRef = ref();
       const ArriveGoodsFormShipFormShipTable = reactive<Record<string, any>>({
         loading: false,
         columns: ArriveGoodsFormShipColumns,
@@ -219,10 +223,9 @@
         status: undefined,
         delFlag: undefined,
         sourceCode:'',
-        sourceCode2:'',
         submit:'',
         billCode:'',
-        billDate: moment(new Date()).format('YYYY-MM-DD'),   
+        arrivalDate: moment(new Date()).format('YYYY-MM-DD'),   
         project: '', 
         projectName:'',  
         supplier:"",
@@ -231,23 +234,20 @@
         productionClass: '',   
         model: '',   
         maker: '',
-        tradeTerms:'',
-        isExport:'',
+        delivery:'',
+        waybillNumber:'',
         packagebRequirement:'',
         recipient:'',
         recipientTel:'',
         recipientAddress:'',
-        paymentTerms:'',
-        delivery:'',
-        warrantyPeriod:'',
         warrantyTerms:'',
-        exchangeRate:'',
-        purchaseDepartment:"",
+        purchaseDepartment:'',
         purchaseman:'',
-        currency:'',
-        notes:''
+        invoiceDate:'',
+        notes:'',
+        arrivalDetails:"",
       });
-
+      var supplierOption = ref([]);
       //表单验证
       const validatorRules = reactive({
       });
@@ -256,6 +256,8 @@
       const formItemLayout = {
         labelCol: {xs: {span: 24}, sm: {span: 5}},
         wrapperCol: {xs: {span: 24}, sm: {span: 16}},
+        labelCol1: {xs: {span: 24}, sm: {span: 7}},
+        wrapperCol1: {xs: {span: 24}, sm: {span: 15}},
       };
 
       // 表单禁用
@@ -279,29 +281,7 @@
         activeKey.value = 'ArriveGoodsFormShipFormShip'
         formData.purchaseman=userStore.getUserInfo.username;
         formData.purchaseDepartment = userStore.getUserInfo.orgCode
-      }
-      // 判断有没有参照的子表
-      function isSelect(){
-        var arrQuo = [],
-            arrCon=[]
-        arriveDetailsFormProductTable.dataSource.map(item=>{
-            var sign = ''
-            sign = item.sourceId?(item.sourceId).substring(0, 3):''
-            if(item.sourceId&&sign=='Quo'){
-              arrQuo.push(item.sourceId)
-            }else if(item.sourceId&&sign=='Con'){
-              arrCon.push(item.sourceId)
-            }
-        })
-        if(arrQuo.length==0&&arrCon.length==0){
-          formData.sourceCode2 = ''
-          formData.sourceCode = ''
-          notAllowEdit.value=false
-        }else if(arrQuo.length==0){
-          formData.sourceCode = ''
-        }else if(arrCon.length==0){
-          formData.sourceCode2 = ''
-        }
+        getSupplierOption()
       }
       async function edit(row) {
         //主表数据
@@ -311,6 +291,12 @@
         ArriveGoodsFormShipFormShipTable.dataSource = [...ArriveGoodsFormShipFormShipDataList];
         const arriveDetailsFormProductDataList = await queryArriveGoodsDetailByMainId(row['id']);
         arriveDetailsFormProductTable.dataSource = [...arriveDetailsFormProductDataList];
+        getSupplierOption()
+        if(arriveDetailsFormProductTable.dataSource.length!==0){
+          notAllowEdit.value = true
+        }else{
+          notAllowEdit.value = false
+        }
       }
 
       async function queryMainData(id) {
@@ -348,7 +334,7 @@
       }
 
       async function submitForm() {
-        if(formData.sourceCode==''&&formData.sourceCode2==''){
+        if(formData.sourceCode==''){
           message.warning('请选择销售订单或报价单')
         }else{
           const mainData = await getFormData();
@@ -356,7 +342,7 @@
           const values = Object.assign({}, dbData, mainData, subData);
           console.log('表单提交数据', values)
           const isUpdate = values.id ? true : false
-          await saveOrUpdate(values, isUpdate,isRevise);
+          await saveOrUpdate(values, isUpdate);
           //关闭弹窗
           emit('success');
         }
@@ -372,9 +358,12 @@
       function onSearchProject(){
         SelectProjectModalRef.value.getTable()
       }
-      function getShipList(id,status){
+      function selectPurchaseOrderList(){
+        SelectPurchaseOrderModalRef.value.getTable(formData)
+      }
+      function getShipList(id){
         let params = {id:id}
-        let url = status=='quotation'?'/purCode/purPurchaseQuotation/queryPurPurchaseQuotationShipByMainId':'/saleCode/saleOrder/querySaleOrderShipByMainId'
+        let url = '/purCode/purOrder/queryPurOrderShipByMainId'
           defHttp.get({url:url,params}, { isTransformResponse: false }).then(res=>{
             if(res){
               ArriveGoodsFormShipFormShipTable.dataSource = res.result
@@ -395,33 +384,78 @@
         newArray.splice(prop.rowIndex, 1)
         if( arriveDetailsFormProductTable.dataSource.length!==0){
           arriveDetailsFormProductTable.dataSource = newArray  
-          var arrQuo = [],
-              arrCon=[]
+          var arr=[]
           arriveDetailsFormProductTable.dataSource.map(item=>{
-            var sign = ''
-            sign = item.sourceId?(item.sourceId).substring(0, 3):''
-            if(item.sourceId&&sign=='Quo'){
-              arrQuo.push(item.sourceId)
-            }else if(item.sourceId&&sign=='Con'){
-              arrCon.push(item.sourceId)
+            if(item.sourceId&&item.sourceId!==''){
+              arr.push(item.sourceId)
             }
           })
-          if(arrQuo.length==0&&arrCon.length==0){
-            formData.sourceCode2 = ''
+          if(arr.length==0){
             formData.sourceCode = ''
             notAllowEdit.value=false
-          }else if(arrQuo.length==0){
-            formData.sourceCode = ''
-          }else if(arrCon.length==0){
-            formData.sourceCode2 = ''
           }
         }else{
            notAllowEdit.value=false
-           formData.sourceCode2 = ''
            formData.sourceCode = ''
         }
         
       }
+      function addAddiveGoods(data){
+        debugger
+        data.map(item=>{
+          item.model = item.childModel
+        })
+        var arr = data.concat(arriveDetailsFormProductTable.dataSource)
+        arriveDetailsFormProductTable.dataSource=arr  
+        notAllowEdit.value=true
+        formData.sourceCode =data[0].billCode
+          formData.project = data[0].project
+          formData.projectName = data[0].projectName
+          formData.supplierName = data[0].supplierName
+          formData.supplier= data[0].supplier
+          formData.priority =data[0].priority
+          formData.productionClass =data[0].productionClass
+          formData.model =data[0].headModel
+          formData.maker =data[0].maker
+          formData.delivery = data[0].delivery
+          formData.packagebRequirement = data[0].packagebRequirement
+          formData.recipient = data[0].recipient
+          formData.recipientTel = data[0].recipientTel
+          formData.recipientAddress = data[0].recipientAddress
+          getShipList(data[0].headId)
+      }
+      function getSupplierOption(){
+        defHttp
+            .get({ url: '/cuspCode/cuspSupplierProfile/list'}, { isTransformResponse: false })
+            .then((res) => {
+                if (res.success) {
+                  supplierOption.value = []
+                  res.result.records.forEach(element => {
+                      var obj = {
+                        label: element.name?element.name:'无名称请维护',
+                        value: element.id?element.id:''
+                      };
+                      supplierOption.value.push( obj)
+                  });    
+                }
+            })
+            .finally(() => {
+                // loading.value = false;
+            });
+      }
+      function changeSupplier(prop){
+        if(prop){
+          supplierOption.value.map(item=>{
+            if(item.value==prop){
+              formData.supplierName = item.label
+            }
+          })
+        }else{
+          formData.supplier = ''
+          formData.supplierName = ''
+        }
+      }
+        
       /**
        * 值改变事件触发-树控件回调
        * @param key
@@ -456,6 +490,12 @@
         BaseShipArchiveAccessoriesModalRef,
         viewAccessory,
         notAllowEdit,
+        SelectPurchaseOrderModalRef,
+        selectPurchaseOrderList,
+        addAddiveGoods,
+        Supplierlist,
+        changeSupplier,
+        supplierOption
       }
     }
   });