Преглед изворни кода

发货通知单-页面修改

jingbb пре 4 месеци
родитељ
комит
d509091d40

+ 109 - 0
src/views/saleCode/deliveryNotice/components/FileUploadModal.vue

@@ -0,0 +1,109 @@
+<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';
+    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 = '/saleCode/saleOrderFiles/add'
+        }else{
+            executeUrl = '/saleCode/saleOrderFiles/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=='customsClearanceDocuments'?'清关资料(customs clearance documents)':'证书/报告(certificate/report)'
+        queryParams.value.type = fatherTitle.value=='customsClearanceDocuments'?'1':'2'
+        executeMethod.value = status
+        if(status=='edit'){
+            getForm(id)
+        }
+    }
+    function getForm(id){
+        defHttp.get({ url: '/saleCode/saleOrderFiles/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>

+ 128 - 0
src/views/saleCode/deliveryNotice/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:"/saleCode/saleOrderFiles/list",params:params.value}).then(res=>{
+          if(res){
+            dataSource.value = res.records
+          }
+        })
+      }
+      function getTable(dataIndex,record){
+          visible.value = true
+          title.value = dataIndex=='customsClearanceDocuments'?'清关资料(customs clearance documents)':'证书/报告(certificate/report)'
+          fatherId.value = record.id
+          fatherTitle.value = dataIndex
+          params.value.headId=record.id
+          params.value.type = dataIndex=='customsClearanceDocuments'?'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: '/saleCode/saleOrderFiles/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>
+  

+ 27 - 40
src/views/saleCode/deliveryNotice/components/deliveryNoticeForm.vue

@@ -127,7 +127,6 @@
 		<!-- 子表单区域 -->
     <a-tabs v-model:activeKey="activeKey" animated  style=" padding: 24px;padding-top: 0px;">
       <a-tab-pane tab="发货通知单 - 发货明细(delivery details)" key="deliveryDetailFormProduct" :forceRender="true">
-        <a-button type="primary" @click="selectProducts" style="margin-right: 1%;margin-bottom: 1%;"> 选择产品(select product)</a-button>
         <a-button type="primary" @click="selectSaleOrderList"> 选择销售订单(selete saleOrder)</a-button>
         <j-vxe-table
           :keep-source="true"
@@ -170,7 +169,6 @@
       
     </a-tabs>
     <BaseShipArchiveAccessoriesModal ref="BaseShipArchiveAccessoriesListRef"></BaseShipArchiveAccessoriesModal>
-    <SelectPrpductModal ref="SelectPrpductModalRef" @selectProduct="addProduct"></SelectPrpductModal>
     <SelectProjectModal ref="SelectProjectModalRef" @selectProject="addProject"></SelectProjectModal>
     <SelectSaleOrderModal ref="SelectSaleOrderModalRef" @selectSaleOrder="addFormSaleOrder"></SelectSaleOrderModal>
  </a-spin>
@@ -223,7 +221,6 @@
       const loading = ref(false);
       const formRef = ref();
       const SelectSaleOrderModalRef = ref();
-      var SelectPrpductModalRef = ref()
       var SelectProjectModalRef = ref()
       const deliveryNoticeFormShipTableRef = ref();
       const deliveryNoticeFormShipTable = reactive<Record<string, any>>({
@@ -363,7 +360,7 @@
       //保存
       async function submitForm() {
         if(formData.sourceCode==''){
-          message.warning('请选择供应商报价单')
+          message.warning('请选择销售订单单')
         }else{
           const mainData = await getFormData();
           const subData = await getSubFormAndTableData();
@@ -399,43 +396,22 @@
         newArray.splice(prop.rowIndex, 1)
         deliveryDetailFormProductTable.dataSource = newArray  
         if( deliveryDetailFormProductTable.dataSource.length!==0){
-          var arr = []
-          deliveryDetailFormProductTable.dataSource.map(item=>{
-            if(item.sourceId){
-              arr.push(item.sourceId)
-            } 
-          })
-          if(arr.length==0){
-            formData.sourceCode=''
-            notAllowEdit.value=false
-          }
+          notAllowEdit.value=true
         }else{
            formData.sourceCode=''
            notAllowEdit.value=false
         }
       }
-      //增行-产品明细
-      function addProduct(data){
-        data.map(item=>{
-          item.productClass = item.classId_dictText
-          item.productCode = item.code
-          // item.unit = item.measurementUnit
-          item.deliveryTime = formData.deliveryTime
-          item.productId = item.id
-        })
-        var arrProduct = data.concat(deliveryDetailFormProductTable.dataSource)
-        deliveryDetailFormProductTable.dataSource=arrProduct      
-      }
       //选择项目
       function addProject(data) {
         if(data.length==0){
-          formData.quotationProject = 
-          formData.quotationProjectName = ''
+          formData.project = 
+          formData.projectName = ''
         }else{
-          formData.quotationProject = data[0].id
-          formData.quotationProjectName = data[0].name
-          formData.quotationCustomer =data[0].customerId
-          formData.quotationCustomerName =data[0].customerId_dictText
+          formData.project = data[0].id
+          formData.projectName = data[0].name
+          formData.customer =data[0].customerId
+          formData.customerName =data[0].customerId_dictText
           customerOption.value.map(item=>{
             if(item.value==data[0].customerId){
               formData.priority =item.priority
@@ -464,10 +440,6 @@
       function viewAccessory(prop){
         BaseShipArchiveAccessoriesListRef.value.getTable(prop.row)
       }
-      //选择产品
-      function selectProducts(){
-        SelectPrpductModalRef.value.getTable()
-      }
       //选择项目  
       function onSearchProject(){
         SelectProjectModalRef.value.getTable()
@@ -494,9 +466,27 @@
       }
       // 选择销售订单
       function selectSaleOrderList(){
-        SelectSaleOrderModalRef.value.getTable(formData)
+        var obj = formData
+        obj.sourceCode2 = formData.sourceCode
+        SelectSaleOrderModalRef.value.getTable(obj)
       }
       function addFormSaleOrder(data){
+        data.map(item=>{
+          item.model = item.childModel
+          item.sourceId = item.childId
+        })
+        var arrProduct = data.concat(deliveryDetailFormProductTable.dataSource)
+        deliveryDetailFormProductTable.dataSource=arrProduct  
+        notAllowEdit.value=true
+        formData.sourceCode =data[0].billCode
+        formData.project = data[0].project
+        formData.projectName = data[0].projectName
+        formData.quotationCustomerName = data[0].customerName
+        formData.customer = data[0].customer
+        formData.priority =data[0].priority
+        formData.productionClass =data[0].productionClass
+        formData.model =data[0].headModel
+        formData.maker =data[0].maker
       }
 
       return {
@@ -519,12 +509,9 @@
         add,
         edit,
         formRef,
-        addProduct,
         BaseShipArchiveAccessoriesListRef,
         viewAccessory,
         handleDelete1,
-        selectProducts,
-        SelectPrpductModalRef,
         SelectProjectModalRef,
         onSearchProject,
         addProject,

+ 4 - 2
src/views/saleCode/deliveryNotice/delivertNoticeForm.data.ts

@@ -71,12 +71,14 @@ export const columns: BasicColumn[] = [
    {
     title: '清关资料(customs clearance documents)',
     align:"center",
-    dataIndex: 'customsClearanceDocuments'
+    dataIndex: 'customsClearanceDocuments',
+    slots: { customRender: 'viewFile' },
    },
    {
     title: '证书/报告(certificate/report)',
     align:"center",
-    dataIndex: 'file'
+    dataIndex: 'file',
+    slots: { customRender: 'viewFile' },
    },
    {
     title: '提交(submit)',

+ 12 - 1
src/views/saleCode/deliveryNotice/deliveryNoticeList.vue

@@ -124,7 +124,12 @@
         <!--字段回显插槽-->
         <template v-slot:bodyCell="{ column, record, index, text }">
         </template>
+
+        <template #viewFile="props">
+            <a @click="viewFileDetail(props)">查看(view)</a>
+        </template>
       </BasicTable>
+      <ViewFileListModal ref="ViewFileListModalRef"></ViewFileListModal>
       <deliveryNoticeFormModal  @register="registerModal" @success="handleSuccess"></deliveryNoticeFormModal>
       <!-- 表单区域 -->
     </div>
@@ -139,10 +144,13 @@
     import {list, deleteOne, batchDelete, getImportUrl,getExportUrl,batchSubmit,cancelBatchSubmit} from './delivertNoticeForm.api';
     import { defHttp } from '/@/utils/http/axios';
     import { JDictSelectTag} from '/@/components/Form';
+    import ViewFileListModal from './components/ViewFileListModal.vue';
     import JSelectInput from '/@/components/Form/src/jeecg/components/JSelectInput.vue';
     import deliveryNoticeFormModal from './components/deliveryNoticeFormModal.vue';
     import { message } from 'ant-design-vue';
+    import { cloneDeep } from "lodash-es";
     const formRef = ref();
+    const ViewFileListModalRef = ref();
     const queryParam = reactive<any>({});
     const checkedKeys = ref<Array<string | number>>([]);
     //注册model
@@ -161,7 +169,7 @@
                  fixed:'right'
              },
              scroll:{
-              x:'2700px'
+              x:'3500px'
              },
              beforeFetch: async (params) => {
                let rangerQuery = await setRangeQuery();
@@ -307,6 +315,9 @@
         cancelBatchSubmit({ids: ids},handleSuccess);
       }
     }
+    function viewFileDetail(props){
+        ViewFileListModalRef.value.getTable(props.column.dataIndex,props.record)
+    }