Browse Source

报表预览按委托、费用分类显示,单证不显示

wfg 1 month ago
parent
commit
a1fad351cd

+ 206 - 17
src/views/iosBasicData/SeafreightExportF/bills/assembly/businessReports.vue

@@ -11,6 +11,45 @@
           @click="reportsGetReportDatafun(scope.row.url, scope.row)">预览报表</el-link>
       </template>
     </avue-crud>
+
+<!--      // DC print-->
+      <el-dialog title="打印" :visible.sync="printingDialogDC" append-to-body="" width="70%" :close-on-click-modal="false">
+          <div>
+              <el-row :gutter="10">
+                <avue-crud :option="optionPrintingDC" :table-loading="printingLoadingDC" :data="PrintingDataDC"
+                           id="out-table" :header-cell-class-name="headerClassName" :row-style="{ height: '20px' }"
+                           :cell-style="{ padding: '0px' }">
+                    <template slot-scope="scope" slot="menu">
+                        <el-button type="text" size="small"
+                                   @click="dialogPreviewfunDC(scope.row)">打印预览</el-button>
+                    </template>
+                </avue-crud>
+              </el-row>
+          </div>
+          <span slot="footer" class="dialog-footer">
+                <el-button size="small" @click="printingDialogDC = false;">取 消</el-button>
+            </span>
+      </el-dialog>
+
+<!--      D/C Bill print-->
+      <el-dialog title="打印" :visible.sync="printingDialogDCB" append-to-body width="70%" :close-on-click-modal="false">
+          <div>
+              <el-row :gutter="10">
+                  <avue-crud :option="optionPrintingDCB" :table-loading="printingLoadingDC" :data="PrintingDataDCB"
+                             id="out-table" :header-cell-class-name="headerClassName" :row-style="{ height: '20px' }"
+                             :cell-style="{ padding: '0px' }">
+                      <template slot-scope="scope" slot="menu">
+                          <el-button type="text" size="small"
+                                     @click="dialogPreviewfunDCB(scope.row)">打印预览</el-button>
+                      </template>
+                  </avue-crud>
+              </el-row>
+          </div>
+          <span slot="footer" class="dialog-footer">
+                <el-button size="small" @click="printingDialogDCB = false;">取 消</el-button>
+            </span>
+      </el-dialog>
+
     <reportContainer ref="reportContainer"></reportContainer>
   </div>
 </template>
@@ -35,10 +74,10 @@ export default {
       type: Boolean,
       default: false,
     },
-      classifycode:{
-          type: String,
-          default: '',
-      },
+    classifycode:{
+      type: String,
+      default: '',
+    },
   },
   data() {
     return {
@@ -53,7 +92,11 @@ export default {
         businessType: 'HYCK',
         classifyCode: '业务',
       },
-      classifyCodeReadonly: false,
+      classifycodes:[
+          {value: 'wt', name: '业务'},
+          {value: 'dz', name: '单证'},
+          {value: 'fy', name: '费用'},
+      ],
       loading: true,
       page: {
         pageSize: 10,
@@ -88,7 +131,7 @@ export default {
             label: "业务类别",
             prop: "classifyCode",
             type: 'select',
-            search: true,
+            search: false,
             dicData: [{
               label: '业务',
               value: '业务'
@@ -138,18 +181,105 @@ export default {
           },
         ]
       },
-      data: []
+      data: [],
+
+        printBill:{},
+        printingDialogDC: false, // DC Print
+        printingLoadingDC: false, // 打印弹窗加载动画
+        PrintingDataDC: [], // 打印弹窗列表数据
+        optionPrintingDC: {
+            stripe: true,
+            maxHeight: '250',
+            calcHeight: 30,
+            tip: false,
+            searchShow: true,
+            searchMenuSpan: 6,
+            border: true,
+            selection: true,
+            dialogClickModal: false,
+            refreshBtn: false,
+            columnBtn: false,
+            addBtn: false,
+            viewBtn: false,
+            delBtn: false,
+            editBtn: false,
+            menuWidth: '100',
+            column: [
+                {
+                    label: "币别",
+                    prop: "curCode",
+                    width: 100,
+                    cell: true,
+                    type: 'select',
+                    dicData: [{
+                        label: '全部',
+                        value: null
+                    }, {
+                        label: 'USD',
+                        value: 'USD'
+                    }, {
+                        label: 'CNY',
+                        value: 'CNY'
+                    }],
+                    overHidden: true,
+                },
+                {
+                    label: "客户名称",
+                    prop: "cnName",
+                    overHidden: true,
+                },
+                {
+                    label: "客户编号",
+                    prop: "code",
+                    overHidden: true,
+                },
+            ]
+        },
+
+        printingDialogDCB: false, // D/C Bill Print
+        printingLoadingDCB: false, // 打印弹窗加载动画
+        PrintingDataDCB: [], // 打印弹窗列表数据
+        optionPrintingDCB: {
+            stripe: true,
+            maxHeight: '250',
+            calcHeight: 30,
+            tip: false,
+            searchShow: true,
+            searchMenuSpan: 6,
+            border: true,
+            selection: true,
+            dialogClickModal: false,
+            refreshBtn: false,
+            columnBtn: false,
+            addBtn: false,
+            viewBtn: false,
+            delBtn: false,
+            editBtn: false,
+            menuWidth: '100',
+            column: [
+                {
+                    label: "账单编号",
+                    prop: "accBillNo",
+                    cell: true,
+                    overHidden: true,
+                },
+                {
+                    label: "客户名称",
+                    prop: "cnName",
+                    overHidden: true,
+                },
+                {
+                    label: "客户编号",
+                    prop: "code",
+                    overHidden: true,
+                },
+            ]
+        },
+
     };
   },
   async created() {
-      if(!!this.classifycode) {
-          this.query.classifyCode = this.classifycode;
-          this.classifyCodeReadonly = true;
-          let col = this.optionBack.column.find(c=>c.prop=="classifyCode")
-          if(col){
-              col.search = false;
-          }
-      }
+      this.reset();
 
       this.option = await this.getColumnData(this.getColumnName(312.4), this.optionBack);
       console.log('report.create', this.option)
@@ -183,6 +313,21 @@ export default {
     }
   },
   methods: {
+    reset(){
+        console.log('report.created.classifycode', this.classifycode)
+
+        let cc = this.classifycodes.find(j => j.value==this.classifycode)
+
+        if(cc) {
+            this.query.classifyCode = cc.name;
+
+            let col = this.optionBack.column.find(c=>c.prop=="classifyCode")
+            console.log('report.created.classifycode', col)
+            if(col){
+                this.$set(col, 'search', false);
+            }
+        }
+    },
     // 设计报表
     async reportDesignButton(url) {
       Stimulsoft.Base.StiLicense.key = '6vJhGtLLLz2GNviWmUTrhSqnOItdDwjBylQzQcAOiHn0s4gy0Fr5YoUZ9V00Y0igCSFQzwEqYBh/N77k4f0fWXTHW5rqeBNLkaurJDenJ9o97TyqHs9HfvINK18Uwzsc/bG01Rq+x3H3Rf+g7AY92gvWmp7VA2Uxa30Q97f61siWz2dE5kdBVcCnSFzC6awE74JzDcJMj8OuxplqB1CYcpoPcOjKy1PiATlC3UsBaLEXsok1xxtRMQ283r282tkh8XQitsxtTczAJBxijuJNfziYhci2jResWXK51ygOOEbVAxmpflujkJ8oEVHkOA/CjX6bGx05pNZ6oSIu9H8deF94MyqIwcdeirCe60GbIQByQtLimfxbIZnO35X3fs/94av0ODfELqrQEpLrpU6FNeHttvlMc5UVrT4K+8lPbqR8Hq0PFWmFrbVIYSi7tAVFMMe2D1C59NWyLu3AkrD3No7YhLVh7LV0Tttr/8FrcZ8xirBPcMZCIGrRIesrHxOsZH2V8t/t0GXCnLLAWX+TNvdNXkB8cF2y9ZXf1enI064yE5dwMs2fQ0yOUG/xornE'
@@ -533,17 +678,60 @@ export default {
     },
     // 打印报表获取数据
     reportsGetReportDatafun(url, row) {
+      let groupDC=false
+      let groupDCB=false
+      if(row.classifyCode=="费用"){
+          groupDC="应收,应付".split(',').indexOf(row.groupCode)>=0
+          groupDCB="应收-账单,应付-账单".split(',').indexOf(row.groupCode)>=0
+      }
+
       reportsGetReportData({
         billId: this.id,
         reportCode: row.classifyCode,
         groupCode: row.groupCode,
         type: 'HYCK'
       }).then(res => {
-        this.handleReportPreview(url, res.data.data.data)
+        this.printBill = res.data.data.data
+        if(groupDC){
+            this.PrintingDataDC = []
+            let feeList = [];
+            if(row.groupCode=="应收") feeList=Array.isArray(this.printBill.feeCenterListD) ? this.printBill.feeCenterListD : [];
+            if(row.groupCode=="应付") feeList=Array.isArray(this.printBill.feeCenterListC) ? this.printBill.feeCenterListC : [];
+            console.log('feeList', feeList)
+            // curCode corpId code cnName
+            feeList.forEach(item => {
+                if(this.PrintingDataDC.findIndex(r=>r.curCode==item.curCode && r.corpId==item.corpId)<0){
+                    this.PrintingDataDC.push({curCode: item.curCode, corpId: item.corpId, code: item.shortName, cnName: item.corpCnName ? item.corpCnName : item.corpEnName})
+                }
+            })
+            console.log('PrintingDataDC', this.PrintingDataDC)
+            this.printingDialogDC = true
+        }else if(groupDCB){
+            this.PrintingDataDCB = []
+            let feeList = [];
+            if(row.groupCode=="应收-账单") feeList=Array.isArray(this.printBill.feeCenterListD) ? this.printBill.feeCenterListD : [];
+            if(row.groupCode=="应付-账单") feeList=Array.isArray(this.printBill.feeCenterListC) ? this.printBill.feeCenterListC : [];
+            console.log('feeList', feeList)
+            // accBillId, accBillNo corpId code cnName
+            feeList.forEach(item => {
+                if(item.accStatus==1 && item.accBillId>0 && this.PrintingDataDCB.findIndex(r=>r.accBillId==item.accBillId && r.corpId==item.corpId)<0){
+                    this.PrintingDataDCB.push({accBillId: item.accBillId, accBillNo: item.accBillNo, corpId: item.corpId, code: item.shortName, cnName: item.corpCnName ? item.corpCnName : item.corpEnName})
+                }
+            })
+            console.log('PrintingDataDCB', this.PrintingDataDCB)
+            this.printingDialogDCB = true
+        }else
+            this.handleReportPreview(url, this.printBill, row)
       })
     },
+    dialogPreviewfunDC(row){
+      console.log('row', row, 'this.printBill', this.printBill)
+    },
+    dialogPreviewfunDCB(row){
+        console.log('row', row, 'this.printBill', this.printBill)
+    },
     // 预览报表
-    handleReportPreview(url, row) {
+    handleReportPreview(url, row, rptItem) {
       Stimulsoft.Base.StiLicense.key = '6vJhGtLLLz2GNviWmUTrhSqnOItdDwjBylQzQcAOiHn0s4gy0Fr5YoUZ9V00Y0igCSFQzwEqYBh/N77k4f0fWXTHW5rqeBNLkaurJDenJ9o97TyqHs9HfvINK18Uwzsc/bG01Rq+x3H3Rf+g7AY92gvWmp7VA2Uxa30Q97f61siWz2dE5kdBVcCnSFzC6awE74JzDcJMj8OuxplqB1CYcpoPcOjKy1PiATlC3UsBaLEXsok1xxtRMQ283r282tkh8XQitsxtTczAJBxijuJNfziYhci2jResWXK51ygOOEbVAxmpflujkJ8oEVHkOA/CjX6bGx05pNZ6oSIu9H8deF94MyqIwcdeirCe60GbIQByQtLimfxbIZnO35X3fs/94av0ODfELqrQEpLrpU6FNeHttvlMc5UVrT4K+8lPbqR8Hq0PFWmFrbVIYSi7tAVFMMe2D1C59NWyLu3AkrD3No7YhLVh7LV0Tttr/8FrcZ8xirBPcMZCIGrRIesrHxOsZH2V8t/t0GXCnLLAWX+TNvdNXkB8cF2y9ZXf1enI064yE5dwMs2fQ0yOUG/xornE'
       // Stimulsoft.Base.StiLicense.Key = '6vJhGtLLLz2GNviWmUTrhSqnOItdDwjBylQzQcAOiHkcgIvwL0jnpsDqRpWg5FI5kt2G7A0tYIcUygBh1sPs7plofUOqPB1a4HBIXJB621mau2oiAIj+ysU7gKUXfjn/D5BocmduNB+ZMiDGPxFrAp3PoD0nYNkkWh8r7gBZ1v/JZSXGE3bQDrCQCNSy6mgby+iFAMV8/PuZ1z77U+Xz3fkpbm6MYQXYp3cQooLGLUti7k1TFWrnawT0iEEDJ2iRcU9wLqn2g9UiWesEZtKwI/UmEI2T7nv5NbgV+CHguu6QU4WWzFpIgW+3LUnKCT/vCDY+ymzgycw9A9+HFSzARiPzgOaAuQYrFDpzhXV+ZeX31AxWlnzjDWqpfluygSNPtGul5gyNt2CEoJD1Yom0VN9fvRonYsMsimkFFx2AwyVpPcs+JfVBtpPbTcZscnzUdmiIvxv8Gcin6sNSibM6in/uUKFt3bVgW/XeMYa7MLGF53kvBSwi78poUDigA2n12SmghLR0AHxyEDIgZGOTbNI33GWu7ZsPBeUdGu55R8w='
       Stimulsoft.Base.Localization.StiLocalization.addLocalizationFile('/reports/stimulsoft/Localization/zh-CHS.xml', true, 'zh-CHS')
@@ -583,6 +771,7 @@ export default {
       // report.loadFile("/reports/stimulsoft/demos/SimpleList.mrt");
       report.load(url)
 
+      console.log("rptItem", rptItem, "datarow", row);
 
       // 获取报表数据
       var data = row

+ 6 - 11
src/views/iosBasicData/SeafreightExportF/bills/billsDetails.vue

@@ -54,7 +54,7 @@
                 </el-dropdown>
 
                 <el-button size="small" style="margin-right: 8px" :loading="saveLoading" :disabled="!form.id"
-                    @click="previewDialogfun">预 览
+                    v-if="bigtabs!='dz'" @click="previewDialogfun">预 览
                 </el-button>
                 <el-button size="small" type="warning" :disabled="!form.id || detailData.seeDisabled || showLock"
                     v-if="form.status == 1" @click.stop="revokeDocumentApproval">撤销单据请核
@@ -297,7 +297,7 @@
         <!--预览报表弹窗-->
         <el-dialog append-to-body title="预览报表" class="el-dialogDeep" :visible.sync="previewDialog" width="60%"
             :close-on-click-modal="false" :destroy-on-close="true" :close-on-press-escape="false" v-dialog-drag>
-            <business-reports :id="form.id" :classifycode="getReportTypeByBigHandle()"
+            <business-reports ref="businessReports" :id="form.id" :classifycode="bigtabs" v-if="previewDialog"
                 :disabled="detailData.seeDisabled"></business-reports>
         </el-dialog>
     </div>
@@ -1253,7 +1253,6 @@ export default {
         },
         // 报表弹窗
         previewDialogfun() {
-            this.getReportTypeByBigHandle('业务')
             this.previewDialog = true
         },
         //请核关闭
@@ -1296,6 +1295,7 @@ export default {
                     // 核算部门 默认登录人的部门
                     for (let item of this.columnforfun('operatorName').dicData) {
                         if (item.name == this.form.operatorName) {
+                            console.log('set accDeptName', item)
                             this.$set(this.form, 'accDeptName', item.deptName)
                             this.$set(this.form, 'accDept', item.deptId)
                             this.$set(this.form, 'operatorDept', item.deptId.split(',').pop())
@@ -1303,7 +1303,6 @@ export default {
                         }
                     }
                 }
-
             })
         },
         // 获取所属岗位数据
@@ -2646,7 +2645,7 @@ export default {
         },
         // 大tbas切换
         bigHandleClick() {
-            if (this.bigtabs == 'fd') {
+            if (this.bigtabs == 'wt') {
                 if (this.form.id) {
                     this.billsListAllfun(this.form.id)
                 }
@@ -2655,13 +2654,9 @@ export default {
                 if (this.form.id) {
                     this.$refs.documentCenter.reportslogListfun({ currentPage: 1, pageSize: 10 })
                 }
-                this.getReportTypeByBigHandle('单证')
             }
-            if (this.bigtabs == 'fy') this.getReportTypeByBigHandle('费用')
-
-        },
-        getReportTypeByBigHandle(name) {
-            return name;
+            if (this.bigtabs == 'fy') {
+            };
         },
         // 获取不分页的分单列表
         billsListAllfun(masterId) {