Przeglądaj źródła

采购订单-功能开发

jingbb 4 miesięcy temu
rodzic
commit
a5a9213c31

+ 444 - 0
src/views/publicComponents/SelectSaleOrderModal.vue

@@ -0,0 +1,444 @@
+<template>
+    <a-modal
+      title="选择销售订单(Select Sale 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="优先级(priority)" >
+                                <JDictSelectTag v-model:value="queryParams.priority" placeholder="请选择" dictCode="priority"/>
+                            </a-form-item>
+                        </a-col>
+                        <a-col :md="6" :sm="8">
+                            <a-form-item label="客户(customer)">
+                                <a-input placeholder="请输入" v-model:value="queryParams.customerName"></a-input>
+                            </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="产品英文名(English name)" :label-col="labelCol1" :wrapper-col="wrapperCol1">
+                                <a-input placeholder="请输入" v-model:value="queryParams.englishName"></a-input>
+                            </a-form-item>
+                        </a-col>
+                        <a-col :md="6" :sm="8">
+                            <a-form-item label="产品编码(product code)">
+                                <a-input placeholder="请输入" v-model:value="queryParams.productCode"></a-input>
+                            </a-form-item>
+                        </a-col>
+                        <a-col :md="6" :sm="8">
+                            <a-form-item label="型号(model)">
+                                <a-input placeholder="请输入" v-model:value="queryParams.childModel"></a-input>
+                            </a-form-item>
+                        </a-col> 
+                        <a-col :md="6" :sm="8">
+                            <a-form-item label="销售部门(sale department)">
+                                <a-input placeholder="请输入" v-model:value="queryParams.saleDepartment"></a-input>
+                            </a-form-item>
+                        </a-col> 
+                        <a-col :md="6" :sm="8">
+                            <a-form-item label="业务员(salesman)">
+                                <a-input placeholder="请输入" v-model:value="queryParams.salesman"></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: 3500, 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([ 'selectQuotation']); //定义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: '客户(custormer)',
+            dataIndex: 'customerName',
+            key: 'customerName',
+            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: '销售部门(sale department)',
+            dataIndex: 'saleDepartment',
+            key: 'saleDepartment',
+            align:"center"
+        },
+        {
+            title: '业务员(salesman)',
+            dataIndex: 'salesman',
+            key: 'salesman',
+            align:"center"
+        },
+        {
+            title: '产品编码(product code)',
+            dataIndex: 'productCode',
+            key: 'productCode',
+            align:"center",
+            width:250,
+        },
+        {
+            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: 'quantityGrade',
+            dataIndex: 'quantityGrade',
+            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: 12 },
+    });
+    const wrapperCol1 = ref({
+        xs: { span: 24 },
+        sm: { span: 12 },
+    });
+    const dataSource =ref([]);
+    let selectedRowKeys = ref([]);
+    let selectedRows = ref([]);
+    const toggleSearchStatus = ref(false);
+    var billDate = ref([])
+    const queryParams = ref({
+        billCode:'',
+        project:'',
+        projectName:'',
+        productionClass:'',
+        priority:'',
+        customer:'',
+        customerName:'',
+        headModel:'',
+        englishName:'',
+        productCode:'',
+        childModel:'',
+        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: '/saleCode/saleOrder/selectSaleOrderDetailAlert',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:'',
+            customer:'',
+            customerName:'',
+            headModel:'',
+            englishName:'',
+            productCode:'',
+            childModel:'',
+            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('selectSaleOrder', 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.sourceCode2
+        }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>

+ 412 - 0
src/views/publicComponents/SelectSupplierQuotationModal.vue

@@ -0,0 +1,412 @@
+<template>
+    <a-modal
+      title="选择供应商报价单(Select Supplier Quotation)"
+      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.quotationProject" :disabled="fatherProject!==''"></a-input>
+                            </a-form-item>
+                        </a-col>
+                        <a-col :md="6" :sm="8">
+                            <a-form-item label="报价供应商(supplier)">
+                                <a-input placeholder="请输入" v-model:value="queryParams.quotationSuppiler" ></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="优先级(priority)" >
+                                <JDictSelectTag v-model:value="queryParams.priority" placeholder="请选择" dictCode="priority"/>
+                            </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)">
+                                <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: 3500, 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([ 'selectSupplierQuotation']); //定义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)',
+            dataIndex: 'suppilerName',
+            key: 'suppilerName',
+            align:"center"
+        },
+        {
+            title: '报价截止日期(quotation period)',
+            dataIndex: 'quotationValidityDate',
+            key: 'quotationValidityDate',
+            align:"center",
+            width:250,
+        },
+        {
+            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: '产品编码(product code)',
+            dataIndex: 'productCode',
+            key: 'productCode',
+            align:"center",
+            width:250,
+        },
+        {
+            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: 'quantityGrade',
+            dataIndex: 'quantityGrade',
+            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: 12 },
+    });
+    const wrapperCol1 = ref({
+        xs: { span: 24 },
+        sm: { span: 12 },
+    });
+    const dataSource =ref([]);
+    let selectedRowKeys = ref([]);
+    let selectedRows = ref([]);
+    const toggleSearchStatus = ref(false);
+    var billDate = ref([])
+    const queryParams = ref({
+        billCode:'',
+        quotationProject:'',
+        projectName:'',
+        productionClass:'',
+        priority:'',
+        quotationSuppiler:'',
+        suppilerName:'',
+        headModel:'',
+        productCode:'',
+        childModel:'',
+        billDate_begin:'',
+        billDate_end:'',
+    });
+    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/purPurchaseQuotation/supplierQuotationDetails2',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.name?element.name:''
+                  };
+                  classOption.value.push( obj)
+              });    
+            }
+        })
+        .finally(() => {
+            // loading.value = false;
+        });
+  }
+    function searchQuery(){
+        loadData();
+    }
+    function searchReset(){
+        billDate.value = []
+        queryParams.value = {
+            billCode:'',
+            quotationProject:'',
+            projectName:'',
+            productionClass:'',
+            priority:'',
+            quotationSuppiler:'',
+            suppilerName:'',
+            headModel:'',
+            productCode:'',
+            childModel:'',
+            billDate_begin:'',
+            billDate_end:'',
+        }
+        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('selectSupplierQuotation', 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>

+ 2 - 2
src/views/purchase/purchaseOrder/PurchaseOrderForm.data.ts

@@ -182,7 +182,7 @@ export const purchaseOrderProductColumns: JVxeColumn[] = [
     },
     {
       title: '最早发货日期(earline delivery date)',
-      key: 'earlineDeliveryDate',
+      key: 'earliestDeliveryDate',
       type: JVxeTypes.date,
       placeholder: '请输入${title}',
       width:"200px",
@@ -257,7 +257,7 @@ export const purchaseOrderProductColumns: JVxeColumn[] = [
     {
       title: '质量等级(quality grade)',
       key: 'qualityGrade',
-      ttype: JVxeTypes.select,
+      type: JVxeTypes.select,
       options: [],
       dictCode: 'quality_grade',
       placeholder: '请输入${title}',

+ 11 - 11
src/views/purchase/purchaseOrder/PurchaseOrderFormList.vue

@@ -144,10 +144,10 @@
       </template>
     </BasicTable>
     <!-- 表单区域 -->
-    <!-- <SaleInquiryFormModal @register="registerModal" @success="handleSuccess"></SaleInquiryFormModal>
+    <PurchaseOrderFormModal @register="registerModal" @success="handleSuccess"></PurchaseOrderFormModal>
     <ViewFileListModal ref="ViewFileListModalRef"></ViewFileListModal>
-    <SelectSaleOrderModal ref="SelectSaleOrderModalRef" @copyProduct="handleCopyProduct"></SelectSaleOrderModal>
-    <ViewHistoryVersionModal ref="ViewHistoryVersionModallRef" ></ViewHistoryVersionModal> -->
+    <SelectPurOrderModal ref="SelectPurOrderModalRef" @copyProduct="handleCopyProduct"></SelectPurOrderModal>
+    <ViewHistoryVersionModal ref="ViewHistoryVersionModallRef" ></ViewHistoryVersionModal>
   </div>
 </template>
 
@@ -156,7 +156,7 @@
   import {BasicTable, useTable, TableAction} from '/@/components/Table';
   import { useListPage } from '/@/hooks/system/useListPage'
   import {useModal} from '/@/components/Modal';
-  // import SaleInquiryFormModal from './components/SaleOrderFormModal.vue'
+  import PurchaseOrderFormModal from './components/PurchaseOrderFormModal.vue'
   import {columns, superQuerySchema} from './PurchaseOrderForm.data';
   import {list, deleteOne, batchDelete, getImportUrl,getExportUrl,batchSubmit,cancelBatchSubmit,bacthClose,cancelBatchClose,bacthConfirm,cancelBatchConfirm} from './PurchaseOrderyForm.api';
   import { cloneDeep } from "lodash-es";
@@ -165,13 +165,13 @@
   import JSelectInput from '/@/components/Form/src/jeecg/components/JSelectInput.vue';
   import JSelectUser from '/@/components/Form/src/jeecg/components/JSelectUser.vue';
   import JSelectDept from '/@/components/Form/src/jeecg/components/JSelectDept.vue';
-  // import ViewFileListModal from './components/ViewFileListModal.vue';
-  // import SelectSaleOrderModal from './components/SelectSaleOrderModal.vue';
-  // import ViewHistoryVersionModal from './components/ViewHistoryVersionModal.vue';
+  import ViewFileListModal from './components/ViewFileListModal.vue';
+  import SelectPurOrderModal from './components/SelectPurOrderModal.vue';
+  import ViewHistoryVersionModal from './components/ViewHistoryVersionModal.vue';
   import { message } from 'ant-design-vue';
   const formRef = ref();
   const ViewFileListModalRef = ref();
-  const SelectSaleOrderModalRef = ref()
+  const SelectPurOrderModalRef = ref()
   const ViewHistoryVersionModallRef =ref()
   const queryParam = reactive<any>({});
   //注册model
@@ -265,7 +265,7 @@
    }
    //复制
    function handleCopy(record: Recordable){
-    SelectSaleOrderModalRef.value.getTable(record)
+    SelectPurOrderModalRef.value.getTable(record)
    }
    //下载合同
    function handleDownContract(){
@@ -336,7 +336,7 @@
            label: '编辑(edit)',
            onClick: handleEdit.bind(null, record),
            auth: 'saleCode:sale_order:edit',
-           ifShow: record.submit=='0'
+           ifShow: record.submit=='0'||!record.submit
          },
          {
            label: '修订(revise)',
@@ -386,7 +386,7 @@
              placement: 'topLeft'
            },
            auth: 'saleCode:sale_order:delete',
-           ifShow: record.submit=='0'
+           ifShow:record.submit=='0'||!record.submit
          }
        ]
    }

+ 23 - 23
src/views/purchase/purchaseOrder/PurchaseOrderyForm.api.ts

@@ -5,25 +5,25 @@ const { createConfirm } = useMessage();
 
 enum Api {
   list = '/purCode/purOrder/list',
-  save='/saleCode/saleOrder/add',
-  edit='/saleCode/saleOrder/edit',
-  revise='/saleCode/saleOrder//editHis',
-  deleteOne = '/saleCode/saleOrder/delete',
-  deleteBatch = '/saleCode/saleOrder/deleteBatch',
-  importExcel = '/saleCode/saleOrder/importExcel',
-  exportXls = '/saleCode/saleOrder/exportXls',
-  queryDataById = '/saleCode/saleOrder/queryById',
-  queryVersonHistoryById='/saleCode/saleOrderHis/queryById',
-  saleOrderFormShipList = '/saleCode/saleOrder/querySaleOrderShipByMainId',
-  saleVersonFormShipList = '/saleCode/saleOrderHis/querySaleOrderShipHisByMainId',
-  saleOrderFormProductList = '/saleCode/saleOrder/querySaleOrderProductByMainId',
-  salVersonFormProductList = '/saleCode/saleOrderHis/querySaleOrderProductHisByMainId',
-  submitBatch='/saleCode/saleOrder/submitBatch',
-  cancelSubmitBatch='saleCode/saleOrder/returnSubmitBatch',
-  closeBatch='/saleCode/saleOrder/submitClose',
-  cancelBatchClose = '/saleCode/saleOrder/returnClose',
-  confirmBatch='/saleCode/saleOrder/submitConfirm',
-  cancelBatchConfirm = '/saleCode/saleOrder/returnSubmitConfirm'
+  save='/purCode/purOrder/add',
+  edit='/purCode/purOrder/edit',
+  revise='/purCode/purOrder/editHis',
+  deleteOne = '/purCode/purOrder/delete',
+  deleteBatch = '/purCode/purOrder/deleteBatch',
+  importExcel = '/purCode/purOrder/importExcel',
+  exportXls = '/purCode/purOrder/exportXls',
+  queryDataById = '/purCode/purOrder/queryById',
+  queryVersonHistoryById='/purCode/purOrderHis/queryById',
+  PurOrderFormShipList = '/purCode/purOrder/queryPurOrderShipByMainId',
+  purVersonFormShipList = '/purCode/purOrderHis/queryPurOrderShipHisByMainId',
+  purOrderFormProductList = '/purCode/purOrder/queryPurOrderProductByMainId',
+  purVersonFormProductList = '/purCode/purOrderHis/queryPurOrderProductHisByMainId',
+  submitBatch='/purCode/purOrder/submitBatch',
+  cancelSubmitBatch='/purCode/purOrder/returnSubmitBatch',
+  closeBatch='/purCode/purOrder/submitClose',
+  cancelBatchClose = '/purCode/purOrder/returnClose',
+  confirmBatch='/purCode/purOrder/submitConfirm',
+  cancelBatchConfirm = '/purCode/purOrder/returnSubmitConfirm'
 }
 /**
  * 导出api
@@ -40,12 +40,12 @@ export const getImportUrl = Api.importExcel;
  * 查询子表数据
  * @param params
  */
-export const querySaleOrderFormShipFormShippTable = (id) => defHttp.get({url: Api.saleOrderFormShipList, params:{ id }});
+export const queryPurOrderFormShipFormShippTable = (id) => defHttp.get({url: Api.PurOrderFormShipList, params:{ id }});
 /**
  * 查询子表数据
  * @param params
  */
-export const querySaleOrderFormProductListByMainId = (id) => defHttp.get({url: Api.saleOrderFormProductList, params:{ id }});
+export const queryPurOrderFormProductListByMainId = (id) => defHttp.get({url: Api.purOrderFormProductList, params:{ id }});
 
 /**
  * 列表接口
@@ -103,13 +103,13 @@ export const queryVersonHistoryById = (id) => defHttp.get({url: Api.queryVersonH
  * 查询历史版本船子表数据
  * @param params
  */
-export const querysaleVersonFormShipListByMainId = (id) => defHttp.get({url: Api.saleVersonFormShipList, params:{ id }});
+export const queryPurVersonFormShipListByMainId = (id) => defHttp.get({url: Api.purVersonFormShipList, params:{ id }});
 
 /**
  * 查询历史版本产品子表数据
  * @param params
  */
-export const querySaleVersonProductListByMainId = (id) => defHttp.get({url: Api.salVersonFormProductList, params:{ id }});
+export const queryPurVersonProductListByMainId = (id) => defHttp.get({url: Api.purVersonFormProductList, params:{ id }});
 
 // 提交
 export const batchSubmit = (params, handleSuccess) => {

+ 110 - 0
src/views/purchase/purchaseOrder/components/FileUploadModal.vue

@@ -0,0 +1,110 @@
+<template>
+    <a-modal
+      :title="title"
+      width="45%"
+      :visible="visible"
+      :maskClosable="false"
+      ref="FileUploadModalRef"
+      switchFullscreen
+      @ok = "handleOk"
+      @cancel="handleCancel">
+        <div>
+          <a-card >
+            <div class="table-page-search-wrapper">
+                <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>
+                    </a-col>
+                    <a-col :xl="24" :lg="24" :md="24">
+                        <a-form-item label="附件(attachs)">
+							<JUpload v-model:value="queryParams.attachs"></JUpload>
+						</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,Modal  } from 'ant-design-vue';
+    import JUpload from '/@/components/Form/src/jeecg/components/JUpload/JUpload.vue';
+    import { idText } from 'typescript';
+    const emit = defineEmits([ 'addList']); //定义emit
+    var visible = ref(false)
+    var title = ref('')
+    var executeMethod =ref('')
+    const labelCol = reactive({
+        xs:24,
+        sm:4,
+    });
+    const wrapperCol = reactive({
+        xs: 24,
+        sm: 16,
+    });
+    const FileUploadModalRef = ref();
+    const queryParams = ref({
+        name:'',
+        attachs:'',
+        headId:'',
+        type:''
+    });
+    function handleOk(){
+        let executeUrl = ''
+        if(executeMethod.value=='add'){
+            executeUrl = '/purCode/purOrderFiles/add'
+        }else{
+            executeUrl = '/purCode/purOrderFiles/edit'
+        }
+        defHttp.post({ url: executeUrl, params: queryParams.value }, { isTransformResponse: false }).then((res) => {
+          if (res.success) {
+            emit('addList');
+            message.warning(res.message);
+            handleCancel()
+          } else {
+            message.warning(res.message);
+          }
+        })
+    }
+    function handleCancel(){
+      visible.value = false
+      Modal.destroyAll();
+    }
+    function getTable(fatherId,fatherTitle,status,id){
+        visible.value = true
+        queryParams.value.headId = fatherId.value
+        title.value = fatherTitle.value=='scanProtocaol'?'扫描合同查看(view scan contract)':'基础协议查看(view basic agreement)'
+        queryParams.value.type = fatherTitle.value=='scanProtocaol'?'1':'2'
+        executeMethod.value = status
+        if(status=='edit'){
+            getForm(id)
+        }
+    }
+    function getForm(id){
+        defHttp.get({ url: '/purCode/purOrderFiles/queryById', params: {id:id} }, { isTransformResponse: false }).then((res) => {
+          if (res.success) {
+            queryParams.value = res.result
+          } else {
+            message.warning(res.message);
+          }
+        })
+    }
+    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>

+ 620 - 0
src/views/purchase/purchaseOrder/components/PurchaseOrderFormForm.vue

@@ -0,0 +1,620 @@
+<template>
+  <a-spin :spinning="loading">
+    <JFormContainer :disabled="disabled">
+      <template #detail>
+        <a-form v-bind="formItemLayout" name="SaleOrderForm" ref="formRef">
+          <a-row>
+            <a-col :span="12">
+							<a-form-item label="订单编号(bill code)" v-bind="validateInfos.billCode" id="SaleOrderForm-billCode" name="billCode">
+								<a-input v-model:value="formData.billCode" placeholder="订单编号(bill code)" disabled></a-input>
+							</a-form-item>
+						</a-col>
+						<a-col :span="12">
+							<a-form-item label="单据日期(bill date)" v-bind="validateInfos.billDate" id="SaleOrderForm-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-form-item>
+						</a-col>
+						
+						<a-col :span="12">
+							<a-form-item label="项目(project)" v-bind="validateInfos.projectName" id="SaleOrderForm-projectName" name="projectName">
+								<a-input-search v-model:value="formData.projectName" placeholder="请输入项目(project)" :disabled="notAllowEdit"  allow-clear enter-button="Search" @search="onSearchProject"></a-input-search>
+							</a-form-item>
+						</a-col>
+						<a-col :span="12">
+							<a-form-item label="供应商(supplier)" v-bind="validateInfos.supplier" id="SaleOrderForm-supplier" name="supplier">
+                  <a-input   v-model:value="formData.supplierName"  placeholder="请选择" allow-clear  ></a-input>
+							</a-form-item>
+						</a-col>
+						<a-col :span="12">
+							<a-form-item label="优先级(priority)" v-bind="validateInfos.priority" id="SaleOrderForm-priority" name="priority">
+                <JDictSelectTag v-model:value="formData.priority" placeholder="请选择" dictCode="priority" disabled/>
+							</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-input v-model:value="formData.productionClass" placeholder="请输入"  allow-clear disabled ></a-input>
+							</a-form-item>
+						</a-col>
+						<a-col :span="12">
+							<a-form-item label="机型(model)" v-bind="validateInfos.model" id="SaleOrderForm-model" name="model">
+                <JDictSelectTag v-model:value="formData.model" placeholder="请选择" dictCode="model_typer" disabled />
+							</a-form-item>
+						</a-col>
+						<a-col :span="12">
+							<a-form-item label="厂家(maker)" v-bind="validateInfos.maker" id="SaleOrderForm-maker" name="maker">
+								<a-input v-model:value="formData.maker" placeholder="请输入厂家(maker)"  allow-clear disabled></a-input>
+							</a-form-item>
+						</a-col>
+            <a-col :span="12">
+							<a-form-item label="贸易条款(trade term)" v-bind="validateInfos.tradeTerms" id="SaleOrderForm-tradeTerms" name="tradeTerms">
+                <JDictSelectTag v-model:value="formData.tradeTerms" placeholder="请选择" dictCode="delivery_terms"/>
+							</a-form-item>
+						</a-col>
+            <a-col :span="12">
+							<a-form-item label="是否出口(export)" v-bind="validateInfos.isExport" id="SaleOrderForm-isExport" name="isExport">
+                <JDictSelectTag v-model:value="formData.isExport" placeholder="请选择" dictCode="yes_or_no" />
+							</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 ></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-input v-model:value="formData.recipient" placeholder="请选择"  />
+							</a-form-item>
+						</a-col>
+            <a-col :span="12">
+							<a-form-item label="收件人电话(recipient tel)" v-bind="validateInfos.recipientTel" id="SaleOrderForm-recipientTel" name="recipientTel">
+                <a-input v-model:value="formData.recipientTel" placeholder="请选择"  />
+							</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-input v-model:value="formData.recipientAddress" placeholder="请选择"  />
+							</a-form-item>
+						</a-col>
+            <a-col :span="12">
+							<a-form-item label="付款条件(payment terms)" v-bind="validateInfos.paymentTerms" id="SaleOrderForm-paymentTerms" name="paymentTerms">
+                <JDictSelectTag v-model:value="formData.paymentTerms" placeholder="请选择" dictCode="payment_terms" />
+							</a-form-item>
+						</a-col>
+            <a-col :span="12">
+							<a-form-item label="发货方式(delivery)" v-bind="validateInfos.delivery" id="SaleOrderForm-delivery" name="delivery">
+                <JDictSelectTag v-model:value="formData.delivery" placeholder="请选择" dictCode="delivery_methods" />
+							</a-form-item>
+						</a-col>
+            <a-col :span="12">
+							<a-form-item label="质保期(warranty period)" v-bind="validateInfos.warrantyPeriod" id="SaleOrderForm-warrantyPeriod" name="warrantyPeriod">
+                <a-input v-model:value="formData.warrantyPeriod" placeholder="请输入" style="width: 85%;margin-right: 1%;"/>月(month)
+							</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-form-item>
+						</a-col> 
+						<a-col :span="12">
+							<a-form-item label="汇率(exchange rate)" v-bind="validateInfos.exchangeRate" id="SaleOrderForm-exchangeRate" name="exchangeRate">
+								<a-input v-model:value="formData.exchangeRate" placeholder="请输入厂家(maker)"  allow-clear ></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-input v-model:value="formData.purchaseDepartment" placeholder="请输入"  allow-clear disabled></a-input>
+							</a-form-item>
+						</a-col>   
+            <a-col :span="12">
+							<a-form-item label="采购员(purchasesman)" v-bind="validateInfos.purchaseman" id="SaleOrderForm-purchaseman" name="purchaseman">
+								<a-input v-model:value="formData.purchaseman" placeholder="请输入采购员(salesman)"  allow-clear disabled ></a-input>
+							</a-form-item>
+						</a-col> 
+            <a-col :span="12">
+							<a-form-item label="币种(currency)" v-bind="validateInfos.currency" id="SaleOrderForm-currency" name="currency">
+                <JDictSelectTag v-model:value="formData.currency" placeholder="请选择" dictCode="currency" />
+							</a-form-item>
+						</a-col> 
+            <a-col :span="12">
+							<a-form-item label="备注(notes)" v-bind="validateInfos.notes" id="SaleOrderForm-notes" name="notes">
+								<a-input v-model:value="formData.notes"></a-input>
+							</a-form-item>
+						</a-col>           
+          </a-row>
+        </a-form>
+      </template>
+    </JFormContainer>
+
+		<!-- 子表单区域 -->
+    <a-tabs v-model:activeKey="activeKey" animated  style=" padding: 24px;padding-top: 0px;">
+      <a-tab-pane tab="采购订单 - 船明细(ship details)" key="PurOrderFormShipFormShip" :forceRender="true">
+        <j-vxe-table
+          :keep-source="true"
+          resizable
+          ref="PurOrderFormShipFormShipTableRef"
+          :loading="PurOrderFormShipFormShipTable.loading"
+          :columns="PurOrderFormShipFormShipTable.columns"
+          :dataSource="PurOrderFormShipFormShipTable.dataSource"
+          :height="340"
+          :disabled="disabled"
+          :rowNumber="true"
+          :rowSelection="true"
+          >
+            <template #action="props" >
+              <a  @click="viewAccessory(props)">查看配件信息(view accessory information)</a>
+            </template>
+          </j-vxe-table>
+      </a-tab-pane>
+      <a-tab-pane tab="采购订单 - 产品明细(product details)" key="purOrderFormShipFormProduct" :forceRender="true">
+        <a-button type="primary"  style="margin-right: 1%;margin-bottom: 1%;" @click="selectSaleOrderList"> 选择销售订单(select saleorder)</a-button>
+        <a-button type="primary"  style="margin-right: 1%;margin-bottom: 1%;" @click="SelectSupplierQuotationList"> 选择报价单(select quotation)</a-button>
+        <a-button type="primary" style="margin-right: 1%;margin-bottom: 1%;" @click="selectProductList"> 选择产品(select product)</a-button>
+        <j-vxe-table
+          :keep-source="true"
+          resizable
+          ref="purOrderFormShipFormProductTableRef"
+          :loading="purOrderFormShipFormProductTable.loading"
+          :columns="purOrderFormShipFormProductTable.columns"
+          :dataSource="purOrderFormShipFormProductTable.dataSource"
+          :height="340"
+          :disabled="disabled"
+          :rowNumber="true"
+          :rowSelection="true"
+          asyncRemove
+          >
+            <template #action="props">
+              <a-popconfirm title="确定删除吗?" @confirm="handleDelete(props)">
+                <a>删除(delete)</a>
+              </a-popconfirm>
+            </template>
+          </j-vxe-table>
+      </a-tab-pane>
+    </a-tabs>
+    <SelectPrpductModal ref="SelectPrpductModalRef" @selectProduct ='addProduct'></SelectPrpductModal>
+    <SelectProjectModal ref="SelectProjectModalRef" @selectProject="addProject"></SelectProjectModal>
+    <BaseShipArchiveAccessoriesModal ref="BaseShipArchiveAccessoriesModalRef"></BaseShipArchiveAccessoriesModal>
+    <SelectSupplierQuotationModal ref="SelectSupplierQuotationModalRef" @selectSupplierQuotation="addFromQuotation"></SelectSupplierQuotationModal>
+    <SelectSaleOrderModal ref="SelectSaleOrderModalRef" @selectSaleOrder="addFormSaleOrder"></SelectSaleOrderModal>
+  </a-spin>
+</template>
+
+<script lang="ts">
+  import { defineComponent, ref, reactive, computed, toRaw} from 'vue';
+  import { defHttp } from '/@/utils/http/axios';
+  import { useValidateAntFormAndTable } from '/@/hooks/system/useJvxeMethods';
+  import { queryPurOrderFormShipFormShippTable, queryPurOrderFormProductListByMainId, queryDataById, saveOrUpdate,queryVersonHistoryById,queryPurVersonFormShipListByMainId, queryPurVersonProductListByMainId} from '../PurchaseOrderyForm.api';
+  import { JVxeTable } from '/@/components/jeecg/JVxeTable';
+  import {purchaseOrderShipColumns, purchaseOrderProductColumns} from '../PurchaseOrderForm.data';
+  import SelectPrpductModal from '../../../publicComponents/SelectPrpductModal.vue';
+  import SelectProjectModal from '../../../publicComponents/SelectProjectModal.vue';
+  import SelectSaleOrderModal from '../../../publicComponents/SelectSaleOrderModal.vue';
+  import SelectSupplierQuotationModal from '../../../publicComponents/SelectSupplierQuotationModal.vue';
+  import BaseShipArchiveAccessoriesModal from '../../../publicComponents/BaseShipArchiveAccessoriesModal.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';
+  import JSelectInput from '/@/components/Form/src/jeecg/components/JSelectInput.vue';
+  import { Form, message } from 'ant-design-vue';
+  import { useUserStore } from '/@/store/modules/user';
+  import moment from 'moment';
+  const useForm = Form.useForm;
+  export default defineComponent({
+    name: "SaleOrderForm",
+    components:{
+      JVxeTable,
+			JFormContainer,
+      SelectPrpductModal,
+      JUpload,
+      JDictSelectTag,
+      JSelectInput,
+      SelectProjectModal,
+      BaseShipArchiveAccessoriesModal,
+      SelectSupplierQuotationModal,
+      SelectSaleOrderModal
+    },
+    props:{
+      formDisabled:{
+        type: Boolean,
+        default: false
+      },
+      formData: { type: Object, default: ()=>{} },
+      formBpm: { type: Boolean, default: true }
+    },
+    emits:['success'],
+    setup(props, {emit}) {
+      const userStore = useUserStore();
+      const loading = ref(false);
+      const formRef = ref();
+      const PurOrderFormShipFormShipTableRef = ref();
+      const SelectPrpductModalRef = ref()
+      const SelectProjectModalRef = ref()
+      const BaseShipArchiveAccessoriesModalRef = ref();
+      const SelectSupplierQuotationModalRef = ref();
+      const SelectSaleOrderModalRef = ref();
+      const PurOrderFormShipFormShipTable = reactive<Record<string, any>>({
+        loading: false,
+        columns: purchaseOrderShipColumns,
+        dataSource: []
+      });
+      const purOrderFormShipFormProductTableRef = ref();
+      const purOrderFormShipFormProductTable = reactive<Record<string, any>>({
+        loading: false,
+        columns: purchaseOrderProductColumns,
+        dataSource: []
+      });
+      const activeKey = ref('PurOrderFormShipFormShip');
+      var notAllowEdit = ref(false);
+      const formData = reactive<Record<string, any>>({
+        id: '',
+        status: undefined,
+        delFlag: undefined,
+        sourceCode:'',
+        sourceCode2:'',
+        submit:'',
+        billCode:'',
+        billDate: moment(new Date()).format('YYYY-MM-DD'),   
+        project: '', 
+        projectName:'',  
+        supplier:"",
+        supplierName:'',
+        priority: '',   
+        productionClass: '',   
+        model: '',   
+        maker: '',
+        tradeTerms:'',
+        isExport:'',
+        packagebRequirement:'',
+        recipient:'',
+        recipientTel:'',
+        recipientAddress:'',
+        paymentTerms:'',
+        delivery:'',
+        warrantyPeriod:'',
+        warrantyTerms:'',
+        exchangeRate:'',
+        purchaseDepartment:"",
+        purchaseman:'',
+        currency:'',
+        notes:''
+      });
+
+      //表单验证
+      const validatorRules = reactive({
+      });
+      const {resetFields, validate, validateInfos} = useForm(formData, validatorRules, {immediate: false});
+      const dbData = {};
+      const formItemLayout = {
+        labelCol: {xs: {span: 24}, sm: {span: 5}},
+        wrapperCol: {xs: {span: 24}, sm: {span: 16}},
+      };
+
+      // 表单禁用
+      const disabled = computed(()=>{
+        if(props.formBpm === true){
+          if(props.formData.disabled === false){
+            return false;
+          }else{
+            return true;
+          }
+        }
+        return props.formDisabled;
+      });
+
+      
+
+      function add() {
+        resetFields();
+        PurOrderFormShipFormShipTable.dataSource = [];
+        purOrderFormShipFormProductTable.dataSource = [];
+        activeKey.value = 'PurOrderFormShipFormShip'
+        formData.purchaseman=userStore.getUserInfo.username;
+        formData.purchaseDepartment = userStore.getUserInfo.orgCode
+      }
+      async function copy(data,id){
+        //主表数据
+        await queryMainData(id);
+        formData.id = ''
+        formData.billCode = ''
+        //子表数据
+        const PurOrderFormShipFormShipDataList = await queryPurOrderFormShipFormShippTable(id);
+        PurOrderFormShipFormShipTable.dataSource = [...PurOrderFormShipFormShipDataList];
+        purOrderFormShipFormProductTable.dataSource = [...data];
+        isSelect()
+      }
+      // 判断有没有参照的子表
+      function isSelect(){
+        var arrQuo = [],
+            arrCon=[]
+        purOrderFormShipFormProductTable.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 = ''
+        }
+      }
+      async function edit(row) {
+        //主表数据
+        await queryMainData(row.id);
+        //子表数据
+        const PurOrderFormShipFormShipDataList = await queryPurOrderFormShipFormShippTable(row['id']);
+        PurOrderFormShipFormShipTable.dataSource = [...PurOrderFormShipFormShipDataList];
+        const purOrderFormShipFormProductDataList = await queryPurOrderFormProductListByMainId(row['id']);
+        purOrderFormShipFormProductTable.dataSource = [...purOrderFormShipFormProductDataList];
+      }
+
+      async function queryMainData(id) {
+        const row = await queryDataById(id);
+        resetFields();
+        const tmpData = {};
+        Object.keys(formData).forEach((key) => {
+          if(row.hasOwnProperty(key)){
+            tmpData[key] = row[key]
+          }
+        })
+        //赋值
+        Object.assign(formData,tmpData);
+      }
+      //查看版本详情
+      async function VersionDetail(record){
+         //主表数据
+        await queryVersonHistoryData(record.id);
+         //子表数据
+        const SaleOrderFormShipFormShipDataList = await queryPurVersonFormShipListByMainId(record.id);
+        PurOrderFormShipFormShipTable.dataSource = [...SaleOrderFormShipFormShipDataList];
+        const purOrderFormShipFormProductDataList = await queryPurVersonProductListByMainId(record.id);
+        purOrderFormShipFormProductTable.dataSource = [...purOrderFormShipFormProductDataList];
+      }
+      async function queryVersonHistoryData(id){
+        const row = await queryVersonHistoryById(id);
+        resetFields();
+        const tmpData = {};
+        Object.keys(formData).forEach((key) => {
+          if(row.hasOwnProperty(key)){
+            tmpData[key] = row[key]
+          }
+        })
+        //赋值
+        Object.assign(formData,tmpData);
+      }
+
+      const {getSubFormAndTableData, transformData} = useValidateAntFormAndTable(activeKey, {
+        'purOrderShip': PurOrderFormShipFormShipTableRef,
+        'purOrderProduct': purOrderFormShipFormProductTableRef,
+      });
+
+      async function getFormData() {
+        try {
+          // 触发表单验证
+          await validate();
+        } catch ({ errorFields }) {
+          if (errorFields) {
+            const firstField = errorFields[0];
+            if (firstField) {
+              formRef.value.scrollToField(firstField.name, { behavior: 'smooth', block: 'center' });
+            }
+          }
+          return Promise.reject(errorFields);
+        }
+        return transformData(toRaw(formData))
+      }
+
+      async function submitForm() {
+        if(formData.sourceCode==''&&formData.sourceCode2==''){
+          message.warning('请选择销售订单或报价单')
+        }else{
+          const mainData = await getFormData();
+          const subData = await getSubFormAndTableData();
+          const values = Object.assign({}, dbData, mainData, subData);
+          console.log('表单提交数据', values)
+          const isUpdate = values.id ? true : false
+          const isRevise = values.submit=='1' ? true : false
+          await saveOrUpdate(values, isUpdate,isRevise);
+          //关闭弹窗
+          emit('success');
+        }
+      }
+      
+      function setFieldsValue(values) {
+        if(values){
+          Object.keys(values).map(k=>{
+            formData[k] = values[k];
+          });
+        }
+      }
+      function selectProductList(){
+        SelectPrpductModalRef.value.getTable()
+      }
+      function onSearchProject(){
+        SelectProjectModalRef.value.getTable()
+      }
+      function addProduct(data){
+        var arrProduct = data.concat(purOrderFormShipFormProductTable.dataSource)
+        arrProduct.map(item=>{
+          item.productClass = item.classId_dictText
+          item.productCode = item.code
+        })
+        purOrderFormShipFormProductTable.dataSource=arrProduct  
+      }
+      function getShipList(id,status){
+        let params = {id:id}
+        let url = status=='quotation'?'/purCode/purPurchaseQuotation/queryPurPurchaseQuotationShipByMainId':'/saleCode/saleOrder/querySaleOrderShipByMainId'
+          defHttp.get({url:url,params}, { isTransformResponse: false }).then(res=>{
+            if(res){
+              PurOrderFormShipFormShipTable.dataSource = res.result
+            }
+          })
+      }
+      function addFromQuotation(data){
+        data.map(item=>{
+          item.model = item.childModel
+          item.sourceId = 'Quo'+item.childId
+          item.sourceCode =data[0].billCode
+        })
+        var arrProduct = data.concat(purOrderFormShipFormProductTable.dataSource)
+        purOrderFormShipFormProductTable.dataSource=arrProduct  
+        notAllowEdit.value=true
+        formData.sourceCode =data[0].billCode
+        if(formData.sourceCode2==''){
+          formData.project = data[0].quotationProject
+          formData.projectName = data[0].projectName
+          formData.supplier= data[0].quotationSuppiler
+          formData.supplierName= data[0].suppilerName
+          formData.priority =data[0].priority
+          formData.productionClass =data[0].productionClass
+          formData.model =data[0].headModel
+          formData.maker =data[0].maker
+          getShipList(data[0].headId,'quotation')
+        }
+      }
+      function addFormSaleOrder(data){
+        data.map(item=>{
+          item.model = item.childModel
+          item.sourceId = 'Con'+item.childId
+          item.sourceCode =data[0].billCode
+        })
+        var arrProduct = data.concat(purOrderFormShipFormProductTable.dataSource)
+        purOrderFormShipFormProductTable.dataSource=arrProduct  
+        notAllowEdit.value=true
+        formData.sourceCode2 =data[0].billCode
+        if(formData.sourceCode==''){
+          formData.project = data[0].project
+          formData.projectName = data[0].projectName
+          formData.priority =data[0].priority
+          formData.productionClass =data[0].productionClass
+          formData.model =data[0].headModel
+          formData.maker =data[0].maker
+          getShipList(data[0].headId,'contract')
+        }
+      }
+      function addProject(data){
+        formData.project = data[0].id
+        formData.projectName = data[0].name
+      }
+       //查看配件信息
+       function viewAccessory(prop){
+        BaseShipArchiveAccessoriesModalRef.value.getTable(prop.row)
+      }
+      //产品明细-删除行
+      function handleDelete(prop) {
+        var newArray = [...purOrderFormShipFormProductTable.dataSource]
+        newArray.splice(prop.rowIndex, 1)
+        if( purOrderFormShipFormProductTable.dataSource.length!==0){
+          purOrderFormShipFormProductTable.dataSource = newArray  
+          var arrQuo = [],
+              arrCon=[]
+          purOrderFormShipFormProductTable.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 = ''
+          }
+        }else{
+           notAllowEdit.value=false
+           formData.sourceCode2 = ''
+           formData.sourceCode = ''
+        }
+        
+      }
+      //选择供应商报价单
+      function SelectSupplierQuotationList (){
+        SelectSupplierQuotationModalRef.value.getTable(formData)
+      }
+
+      // 选择销售订单
+      function selectSaleOrderList(){
+        SelectSaleOrderModalRef.value.getTable(formData)
+      }
+      /**
+       * 值改变事件触发-树控件回调
+       * @param key
+       * @param value
+       */
+      function handleFormChange(key, value) {
+        formData[key] = value;
+      }
+      return {
+        PurOrderFormShipFormShipTableRef,
+        PurOrderFormShipFormShipTable,
+        purOrderFormShipFormProductTableRef,
+        purOrderFormShipFormProductTable,
+        SelectSupplierQuotationModalRef,
+        SelectSaleOrderModalRef,
+        validatorRules,
+        validateInfos,
+        activeKey,
+        loading,
+        formData,
+        setFieldsValue,
+        handleFormChange,
+        formItemLayout,
+        disabled,
+        getFormData,
+        submitForm,
+        add,
+        edit,
+        copy,
+        formRef,
+        selectProductList,
+        SelectPrpductModalRef,
+        addProduct,
+        onSearchProject,
+        SelectProjectModalRef,
+        addProject,
+        handleDelete,
+        BaseShipArchiveAccessoriesModalRef,
+        viewAccessory,
+        VersionDetail,
+        SelectSupplierQuotationList,
+        addFromQuotation,
+        notAllowEdit,
+        selectSaleOrderList,
+        addFormSaleOrder
+      }
+    }
+  });
+</script>
+<style lang="less" scoped>
+  /** 时间和数字输入框样式 */
+  :deep(.ant-input-number) {
+    width: 100%;
+  }
+
+  :deep(.ant-calendar-picker) {
+    width: 100%;
+  }
+  /deep/.vxe-table--body-wrapper{
+    height: 100% !important;
+  }
+  /deep/.ant-modal-body{
+    padding: 24px !important;
+  }
+  
+  /deep/.ant-form-item{
+    margin-bottom: 8px !important;
+  }
+      
+</style>

+ 93 - 0
src/views/purchase/purchaseOrder/components/PurchaseOrderFormModal.vue

@@ -0,0 +1,93 @@
+<template>
+  <div ref="SaleOrderDetailsRef">
+    <BasicModal v-bind="$attrs" @register="registerModal" :title="title" width="95%"  @ok="handleSubmit" :getContainer ='()=>$refs.SaleOrderDetailsRef'>
+      <PurchaseOrderFormForm ref="formComponent" :formDisabled="formDisabled" :formBpm="false" @success="submitSuccess"></PurchaseOrderFormForm>
+    </BasicModal>
+  </div>
+</template>
+
+<script lang="ts">
+  import { ref, unref } from 'vue';
+  import { BasicModal, useModalInner } from '/@/components/Modal';
+  import PurchaseOrderFormForm from './PurchaseOrderFormForm.vue';
+
+  export default {
+    name: "SaleOrderFormModal",
+    components:{
+      BasicModal,
+      PurchaseOrderFormForm
+    },
+    emits:['register','success'],
+    setup(_p, {emit}){
+      const formComponent = ref()
+      const isUpdate = ref(true);
+      const formDisabled = ref(false);
+      const title = ref('')
+      var SaleOrderDetailsRef = ref()
+      //表单赋值
+      const [registerModal, {setModalProps, closeModal}] = useModalInner(async (data) => {
+        setModalProps({confirmLoading: false,showCancelBtn:data?.showFooter,showOkBtn:data?.showFooter});
+        if(!data.isCopy){
+          isUpdate.value = !!data?.isUpdate;
+          formDisabled.value = !data?.showFooter;
+          title.value = data?.isUpdate ? (unref(formDisabled) ? '详情' : '编辑') : '新增';
+          title.value = data.isRevise?'修订':title.value;
+          if (unref(isUpdate)) {
+            formComponent.value.edit(data.record)
+          }else{
+            formComponent.value.add()
+          }
+        }else{
+          isUpdate.value = !!data?.isUpdate;
+          formDisabled.value = !data?.showFooter;
+          title.value = '新增'
+          formComponent.value.copy(data.data,data.mainId)
+        }
+      });
+
+      function handleSubmit() {
+        formComponent.value.submitForm();
+      }
+
+      function submitSuccess(){
+        emit('success');
+        closeModal();
+      }
+      function getVersionDetail(record){
+        setModalProps({open: true,showOkBtn:false});
+        title.value ='详情'
+        formDisabled.value = true
+        setTimeout(()=>{
+          formComponent.value.VersionDetail(record)
+        },100)
+      }
+
+      return {
+        registerModal,
+        title,
+        formComponent,
+        formDisabled,
+        handleSubmit,
+        submitSuccess,
+        SaleOrderDetailsRef,
+        getVersionDetail
+      }
+    }
+  }
+</script>
+<style lang="less" scoped>
+	/** 时间和数字输入框样式 */
+  :deep(.ant-input-number) {
+    width: 100%;
+  }
+
+  :deep(.ant-calendar-picker) {
+    width: 100%;
+  }
+  /deep/.ant-modal {
+    // width: 520px;
+    padding-bottom: 0;
+    margin-top: -10px;
+    height: 100%;
+}
+</style>

+ 290 - 0
src/views/purchase/purchaseOrder/components/SelectPurOrderModal.vue

@@ -0,0 +1,290 @@
+<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="8" :sm="8">
+                          <a-form-item label="产品分类(production class)">
+                              <a-input placeholder="请输入" v-model:value="queryParams.productionClass"></a-input>
+                          </a-form-item>
+                      </a-col>
+                     
+                      <a-col :md="8" :sm="8">
+                          <a-form-item label="产品英文名(english name)" >
+                              <a-input v-model:value="queryParams.englishName" placeholder="请选择" />
+                          </a-form-item>
+                      </a-col>
+                  <template v-if="toggleSearchStatus">                     
+                      <a-col :md="8" :sm="8">
+                          <a-form-item label="产品编码(product code)" >
+                              <a-input v-model:value="queryParams.productCode" placeholder="请选择" />
+                          </a-form-item>
+                      </a-col>
+                      <a-col :md="8" :sm="8">
+                          <a-form-item label="产品中文名(chinese name)" >
+                              <a-input v-model:value="queryParams.chineseName" placeholder="请选择" />
+                          </a-form-item>
+                      </a-col>
+                  </template>
+                  <a-col :md="8" :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  >
+          <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.id"
+              :data-source="dataSource"
+              bordered
+              size="small"
+              @change="handleTableChange"
+              :pagination="false"
+              :scroll="{ x: 4500, 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';
+  const emit = defineEmits([ 'copyProduct']); //定义emit
+  var visible = ref(false)
+  const columns = [
+      {
+          title: '交期(delivery time)',
+          dataIndex: 'deliveryTime',
+          key: 'deliveryTime',
+          align:"center"
+      },
+      {
+          title: '最早发货日期(earline delivery date)',
+          dataIndex: 'earliestDeliveryDate',
+          key: 'earliestDeliveryDate',
+          align:"center"
+      },
+      {
+          title: '最晚发货日期(latest delivery date)',
+          dataIndex: 'latestDeliveryDate',
+          key: 'latestDeliveryDate',
+          align:"center",
+      },
+      {
+          title: '产品中文名(chinese name)',
+          key: 'chineseName',
+          dataIndex: 'chineseName',
+          align:"center"
+      },
+      {
+          title: '产品英文名(english name)',
+          key: 'englishName',
+          dataIndex: 'englishName',
+          align:"center"
+      },
+      {
+          title: '型号(model)',
+          key: 'model',
+          dataIndex: 'model',
+          align:"center"
+      },
+      {
+          title: '备件号(partno)',
+          key: 'partno',
+          dataIndex: 'partno',
+          align:"center",
+          width:250
+      },
+      {
+          title: '订货号(orderno)',
+          key: 'orderno',
+          dataIndex: 'orderno',
+          align:"center",
+      },
+      {
+          title: '图号(drawingno)',
+          key: 'drawingno',
+          dataIndex: 'drawingno',
+          align:"center",
+      },
+      {
+          title: '厂家(factory)',
+          key: 'factory',
+          dataIndex: 'factory',
+          align:"center",
+      },
+      {
+          title: '质量等级(quality grade)',
+          key: 'qualityGrade',
+          dataIndex: 'qualityGrade',
+          align:"center",
+      },
+      {
+          title: '需要船检证书(need Ship inspection certificate)',
+          key: 'needShip',
+          dataIndex: 'needShip',
+          align:"center",
+      },
+      {
+          title: '船检证书(ship Inspection certificate)',
+          key: 'shipInspection',
+          dataIndex: 'shipInspection',
+          align:"center",
+      },
+      {
+          title: '数量(quantity)',
+          key: 'quantity',
+          dataIndex: 'quantity',
+          align:"center",
+      },
+      {
+          title: '单价(price)',
+          key: 'taxPrice',
+          dataIndex: 'taxPrice',
+          align:"center",
+      },
+      {
+          title: '金额(money)',
+          key: 'taxAmount',
+          dataIndex: 'taxAmount',
+          align:"center",
+      },
+      {
+          title: '备注(note)',
+          key: 'notes',
+          dataIndex: 'notes',
+          align:"center",
+      },
+  ];
+  const labelCol = ref({
+      xs: { span: 24 },
+      sm: { span: 9 },
+  });
+  const wrapperCol = ref({
+      xs: { span: 24 },
+      sm: { span: 15 },
+  });
+  const dataSource =ref([]);
+  let selectedRowKeys = ref([]);
+  let selectedRows = ref([]);
+  const toggleSearchStatus = ref(false);
+  var mainId = ref('')
+  const queryParams = ref({
+      productionClass:'',
+      englishName:'',
+      productCode:'',
+      chineseName:'',
+      id:'',
+      pageSize:''
+  });
+  function loadData(){
+      let params = getQueryParams();
+      defHttp
+      .get({ url: '/purCode/purOrder/queryPurOrderProductByMainId',params}, { isTransformResponse: false })
+      .then((res) => {
+          if (res.success) {
+              dataSource.value = res.result              
+          } else {
+              message.error(res.message);
+          }
+      })
+      .finally(() => {
+          // loading.value = false;
+      });
+  }
+  function getQueryParams(){
+      let params = Object.assign(queryParams.value);
+      params.id = mainId.value
+      params.pageSize = '-1'
+      return filterObj(params);
+  }
+  function handleTableChange(paginations, filters, sorter){
+      loadData()
+  };
+  function searchQuery(){
+      loadData();
+  }
+  function searchReset(){
+      queryParams.value = {
+        productionClass:'',
+        englishName:'',
+        productCode:'',
+        chineseName:'',
+        id:'',
+        pageSize:''
+      }
+      loadData();
+  }
+  function handleToggleSearch(){
+      toggleSearchStatus.value = !toggleSearchStatus.value;
+  }
+  function onSelectChange(keys,rows){
+      selectedRowKeys.value = keys
+      selectedRows.value = rows
+  }
+  function handleOk(){
+    if(selectedRowKeys.value.length==0){
+      message.error('请选择数据')
+    }else{
+      emit('copyProduct',selectedRows.value,mainId)
+      handleCancel()
+    }
+  }
+  function handleCancel(){
+    visible.value = false
+    selectedRowKeys.value = []
+    selectedRows.value=[]
+  }
+  function getTable(record){
+      mainId.value = record.id
+      visible.value = true
+      loadData()
+  }
+  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>

+ 128 - 0
src/views/purchase/purchaseOrder/components/ViewFileListModal.vue

@@ -0,0 +1,128 @@
+<template>
+    <div ref="viewFileDetailRef">
+        <a-modal
+            :title="title"
+            width="60%"
+            :visible="visible"
+            :maskClosable="false"
+            :getContainer ='()=>$refs.viewFileDetailRef'
+            switchFullscreen
+            :footer="false"
+            @cancel="handleCancel">
+                <div>
+                    <a-button type="primary"  @click="handleAdd" preIcon="ant-design:plus-outlined" style="margin-bottom: 1%;"> 新增(add)</a-button>
+                    <a-table
+                        :columns="columns"
+                        :row-key="record => record.id"
+                        :data-source="dataSource"
+                        bordered
+                        size="small"
+                        height="500"
+                        :pagination="false"
+                        :scroll="{ x: 1000, y: 500 }"
+                    > 
+                        <template #operation="{ text, record,index }">
+                            <a @click="handleEdit(record)">编辑(edit)</a>
+                            <a-divider type="vertical"/>
+                            <a-popconfirm title="确定删除吗?" @confirm="handleDelete(record)">
+                            <a>删除(delete)</a>
+                            </a-popconfirm>
+                        </template>
+                    </a-table>
+                </div>
+        </a-modal>
+        <FileUploadModal ref="FileUploadModalRef" @addList="loadData"></FileUploadModal>
+    </div>
+  </template>
+  
+  <script lang="ts" setup>
+      import {ref} from 'vue';
+      import {defHttp} from '/@/utils/http/axios';
+      import FileUploadModal from './FileUploadModal.vue';
+    import { message} from 'ant-design-vue';
+      var visible = ref(false);
+      var title = ref('')
+      var fatherId = ref('')
+      var fatherTitle = ref('')
+      var FileUploadModalRef = ref()
+      var params=ref({
+        headId:'',
+        type:'',
+        pageSize:'-1',
+      })
+      var columns = ref([
+            {
+            title: '上传时间(upload time)',
+            align:"center",
+            dataIndex: 'createTime',
+            key: 'createTime'
+          },
+          {
+            title: '名称(name)',
+            align:"center",
+            dataIndex: 'name',
+            key: 'name'
+          },
+          {
+            title: '操作(operation)',
+            align:"center",
+            dataIndex: 'operation',
+            key: 'operation',
+            slots: { customRender: 'operation' },
+          },
+      ])
+      var dataSource=ref([])
+      function loadData(){
+        defHttp.get({url:"/purCode/purOrderFiles/list",params:params.value}).then(res=>{
+          if(res){
+            dataSource.value = res.records
+          }
+        })
+      }
+      function getTable(dataIndex,record){
+          visible.value = true
+          title.value = dataIndex=='scanProtocaol'?'扫描合同查看(view scan contract)':'基础协议查看(view basic agreement)'
+          fatherId.value = record.id
+          fatherTitle.value = dataIndex
+          params.value.headId=record.id
+          params.value.type = dataIndex=='scanProtocaol'?'1':'2'
+          loadData()
+      }
+      function handleCancel(){
+        visible.value = false;
+      }
+      function handleAdd(){
+        FileUploadModalRef.value.getTable(fatherId,fatherTitle,'add')
+      }
+      function handleEdit(record){
+        FileUploadModalRef.value.getTable(fatherId,fatherTitle,'edit',record.id)
+      }
+      function handleDelete(record){
+        let params = {id:record.id}
+        defHttp.delete({ url: '/purCode/purOrderFiles/delete', params},{joinParamsToUrl: true,isTransformResponse: false}).then((res) => {
+          if (res) {
+            loadData()
+          } else {
+            message.warning(res.message);
+          }
+        })
+     }
+      defineExpose({
+        getTable
+      });
+    </script>
+  
+  <style lang="less" scoped>
+      /** 时间和数字输入框样式 */
+    :deep(.ant-input-number) {
+      width: 100%;
+    }
+  
+    :deep(.ant-calendar-picker) {
+      width: 100%;
+    }
+    /deep/.ant-modal-body{
+      padding: 14px !important;
+    }
+  </style>
+  

+ 163 - 0
src/views/purchase/purchaseOrder/components/ViewHistoryVersionModal.vue

@@ -0,0 +1,163 @@
+<template>
+  <a-modal
+    title="历史版本查看(view historical version)"
+    width="55%"
+    :visible="visible"
+    :maskClosable="false"
+    switchFullscreen
+    @cancel="handleCancel">
+      <template #footer>
+        <a-button  @click="handleCancel" >关闭(close)</a-button>
+      </template>
+      <div>
+        <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.id"
+                :data-source="dataSource"
+                bordered
+                size="small"
+                @change="handleTableChange"
+                :pagination="pagination"
+                :scroll="{ x: 1000, y: 300 }"
+                :rowSelection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
+            >
+                <template #bodyCell="{ column, record }">
+                    <template v-if="column.key === 'operation'">
+                        <span>
+                            <a @click="viewDetail(record)">查看(view)</a>
+                        </span>
+                    </template>
+                </template>
+            </a-table>
+        </a-card>
+      </div>
+      <PurchaseOrderFormModal  ref="PurchaseOrderFormModalRef"></PurchaseOrderFormModal>
+  </a-modal>
+</template>
+<script lang="ts" setup>
+  import {ref } from 'vue';
+  import { defHttp } from '/@/utils/http/axios';
+  import { message } from 'ant-design-vue';
+  import { filterObj } from '/@/utils/common/compUtils';
+  import PurchaseOrderFormModal from './PurchaseOrderFormModal.vue';
+  const emit = defineEmits([ 'selectProduct']); //定义emit
+  var visible = ref(false)
+  var PurchaseOrderFormModalRef = ref()
+  const columns = [
+      {
+          title: '版本号(version)',
+          dataIndex: 'version',
+          key: 'version',
+          align:"center"
+      },
+      {
+          title: '创建时间(create time)',
+          dataIndex: 'createTime',
+          key: 'createTime',
+          align:"center"
+      },
+      {
+          title: '创建人(create by)',
+          dataIndex: 'createBy',
+          key: 'price',
+          align:"createBy",
+          width:200
+      },
+      {
+            title: '操作(operation)',
+            key: 'operation',
+            dataIndex: 'operation',
+            align:"center",
+            fixed: 'right',
+      },
+  ];
+  const dataSource =ref([]);
+  let selectedRowKeys = ref([]);
+  let selectedRows = ref([]);
+  var Father = ref({})
+  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/purOrderHis/list',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 = {}
+        params.pageNo = pagination.value.current;
+        params.hisId = Father.value.id;
+        params.pageSize = pagination.value.pageSize;
+        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 onSelectChange(keys,rows){
+      selectedRowKeys.value = keys
+      selectedRows.value = rows
+  }
+  function handleCancel(){
+    visible.value = false
+    selectedRowKeys.value = []
+    selectedRows.value=[]
+  }
+  function getTable(record){
+      visible.value = true
+      Father.value = record
+      loadData()
+  }
+  function viewDetail(record){
+    PurchaseOrderFormModalRef.value.getVersionDetail(record)
+  }
+  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>