Browse Source

fixup! Revert "关贸云字段加长"

wfg 1 month ago
parent
commit
52b83d68ed

+ 3 - 2
public/index.html

@@ -34,12 +34,13 @@
 <!--    <script src="https://mapapi.qq.com/web/mapComponents/geoLocation/v/geolocation.min.js"></script>-->
 <!--    <script charset="utf-8" src="https://map.qq.com/api/gljs?libraries=tools&v=1.exp&key=CB2BZ-T3IWN-UPWFO-SR2Y6-4YBXQ-SGBKT"></script>-->
     <!--  <link rel="icon" href="<%= BASE_URL %>favicon.png">-->
-  <link rel="icon" href="<%= BASE_URL %>tubaoFavicon.ico">
+<!--  <link rel="icon" href="<%= BASE_URL %>tubaoFavicon.ico">-->
+  <link rel="icon" href="<%= BASE_URL %>jmsFavicon.png">
   <!-- stimulsoft -->
   <link rel="stylesheet" href="<%= BASE_URL %>reports/stimulsoft/css/stimulsoft.viewer.office2013.whiteblue.css">
   <link rel="stylesheet" href="<%= BASE_URL %>reports/stimulsoft/css/stimulsoft.designer.office2013.whiteblue.css">
 
-  <title>企业级开发平台</title>
+  <title>JMS ERP SYSTEM</title>
   <style>
     html,
     body,

BIN
public/jmsFavicon.png


+ 9 - 0
src/api/approval/processConfig.js

@@ -92,4 +92,13 @@ export function selectListLos(roles) {
     }
   })
 }
+// 根据岗位从人力资源中查询职员
+export function selectSalesNames(params) {
+    return request({
+        url: '/api/blade-los/bstaffinformation/list',
+        method: 'get',
+        params
+    })
+}
+
 

+ 36 - 4
src/api/iosBasicData/bills.js

@@ -186,14 +186,24 @@ export const billsRevokeDisembarking = (ids) => {
     }
   })
 }
-// 单据请核
-export const billsCheckBills = (data) => {
+
+// 单据请核前校验
+export const billsBeforeApplyBills = (data) => {
   return request({
-    url: '/api/blade-los/bills/checkBills',
+    url: '/api/blade-los/bills/beforeApplyBills',
     method: 'post',
     data: data
   })
 }
+
+// 单据请核
+export const billsCheckBills = (data) => {
+    return request({
+        url: '/api/blade-los/bills/checkBills',
+        method: 'post',
+        data: data
+    })
+}
 // 撤销单据请核
 export const billsRevokeCheckBills = (data) => {
   return request({
@@ -242,6 +252,28 @@ export const reportslogRemove = (ids) => {
     }
   })
 }
+// 查询单证打印次数
+export const getReportslogPrintCount = (logId, reportId) => {
+    return request({
+        url: '/api/blade-los/reportslog/getPrintCount',
+        method: 'get',
+        params: {
+            logId: logId,
+            reportId: reportId,
+        }
+    })
+}
+// 添加单证打印次数
+export const addReportPrintCount = (logId, reportId) => {
+    return request({
+        url: '/api/blade-los/reportslog/addPrintCount',
+        method: 'post',
+        data: {
+            logId: logId,
+            reportId: reportId,
+        }
+    })
+}
 // 根据当前用户查询岗位
 export const postSelectByUser = (userId) => {
   return request({
@@ -385,4 +417,4 @@ export const batchCopyCostPrompt = (data) => {
     method: 'post',
     data: data
   })
-}
+}

+ 15 - 0
src/api/iosBasicData/reports.js

@@ -31,6 +31,7 @@ export const reportsRemove = (ids) => {
     }
   })
 }
+
 export const reportsRemove2 = (ids) => {
   return request({
     url: '/api/blade-los/reports/remove',
@@ -105,3 +106,17 @@ export const getDocumentTypesListAll = (params) => {
     })
 }
 
+export const buildExportFileName = (report, form) => {
+    let fmt = report ? (report.fileNameFormat ? report.fileNameFormat : report.cnName) : "";
+    if(!fmt) fmt = "report";
+    if(form){
+        for(const key in form){
+            if(key){
+                var val = form[key];
+                fmt = fmt.replaceAll("#" + key, val).trim();
+            }
+        }
+    }
+
+    return fmt;
+}

+ 1 - 1
src/lang/zh.js

@@ -1,6 +1,6 @@
 export default {
   tip: '提示',
-  title: '企业级开发平台',
+  title: 'JMS ERP SYSTEM',
   logoutTip: '退出系统, 是否继续?',
   submitText: '确定',
   cancelText: '取消',

+ 1 - 1
src/router/avue-router.js

@@ -33,7 +33,7 @@ RouterPlugin.install = function (vue, option = {}) {
     setTitle: (title) => {
       const defaultTitle = this.$vue.$t('title');
       let titleName=JSON.parse(localStorage.getItem('user-Information')).deptName
-      title = title ? `${title}-${titleName}` : defaultTitle;
+      title = title ? `${defaultTitle} ${title}-${titleName}` : defaultTitle;
       document.title = title;
     },
     closeTag: (value) => {

+ 3 - 3
src/util/messageReminder.js

@@ -32,7 +32,7 @@ export const popupReminder = (form,data)=>{
   // 高雯 船公司是 QDONE 海洋网联船务(中国)有限公司 时,carrierId: 11207
   // 判断交货地是否输入,目的港不判断
   for(let item of data) {
-    console.log('popupReminder', item)
+    // console.log('popupReminder', item)
       var b=true
       if(Array.isArray(item.vif) && item.vif.length>0){
           b=false
@@ -51,13 +51,13 @@ export const popupReminder = (form,data)=>{
           })
       }
     if (b && !form[item.value]) {
-      sum +=item.name.toUpperCase()+' ,'
+      sum += item.name.toUpperCase()+' ,'
     }
   }
   if(sum.length>0){
     sum=sum.substring(0,sum.length-1)
   }
-  console.log(sum)
+  // console.log(sum)
   return sum == '请输'?false:sum
 }
 /**

+ 112 - 60
src/views/iosBasicData/SeafreightExportF/bills/assembly/DocumentCenter.vue

@@ -19,15 +19,18 @@
                         @resetColumn="resetColumnTwo('documentCrud', 'documentOption', 'documentOptionBack', 312.1)"
                         @saveColumn="saveColumnTwo('documentCrud', 'documentOption', 'documentOptionBack', 312.1)">
                         <template slot="menuLeft">
-                            <el-button type="primary" size="small" icon="el-icon-plus" :disabled="disabled"
+<!--                            :disabled="disabled"-->
+                            <el-button type="primary" size="small" icon="el-icon-plus"
                                 @click="addbtnfun()">新增
                             </el-button>
                             <spa style="color: #d4791a; " v-text="'单证类别:' + (businesstypeData && businesstypeData.label ? businesstypeData.label : '未选择')"></spa>
                         </template>
                         <template slot-scope="scope" slot="menu">
-                            <el-button type="text" size="small" :disabled="disabled"
+<!--                            :disabled="disabled"-->
+                            <el-button type="text" size="small"
                                 @click="printEditing(scope.row)">编辑</el-button>
-                            <el-button type="text" size="small" :disabled="disabled" @click="printDelete(scope.row)">
+<!--                            :disabled="disabled"-->
+                            <el-button type="text" size="small"  @click="printDelete(scope.row)">
                                 <span v-if="disabled">删除</span>
                                 <span v-else style="color: red">删除</span>
                             </el-button>
@@ -99,8 +102,14 @@ import {
     getList,
     getDocumentTypesList,
     getDocumentTypesListAll,
+    buildExportFileName,
 } from "@/api/iosBasicData/reports";
-import { reportslogList, reportslogSubmit } from "@/api/iosBasicData/bills";
+import {
+    reportslogList,
+    reportslogSubmit,
+    getReportslogPrintCount,
+    addReportPrintCount,
+} from "@/api/iosBasicData/bills";
 import { bbusinesstypeList } from "@/api/iosBasicData/bbusinesstype";
 import bbusinesstype from "@/views/iosBasicData/bbusinesstype/index.vue";
 import reportformsList from "@/views/iosBasicData/SeafreightExportF/bills/assembly/reportformsList.vue";
@@ -165,15 +174,15 @@ export default {
                             trigger: "blur"
                         }]
                     },
-                    {
-                        label: "报表编码",
-                        prop: "code",
-                        rules: [{
-                            required: true,
-                            message: "请输入报表编码",
-                            trigger: "blur"
-                        }]
-                    },
+                    // {
+                    //     label: "报表编码",
+                    //     prop: "code",
+                    //     rules: [{
+                    //         required: true,
+                    //         message: "请输入报表编码",
+                    //         trigger: "blur"
+                    //     }]
+                    // },
                     {
                         label: "中文名称",
                         prop: "cnName",
@@ -188,14 +197,18 @@ export default {
                         prop: "enName"
                     },
                     {
-                        label: "报表格式",
-                        prop: "content",
-                        rules: [{
-                            required: true,
-                            message: "请输入报表格式",
-                            trigger: "blur"
-                        }]
+                        label: "已打印次数",
+                        prop: "printCount"
                     },
+                    // {
+                    //     label: "报表格式",
+                    //     prop: "content",
+                    //     rules: [{
+                    //         required: true,
+                    //         message: "请输入报表格式",
+                    //         trigger: "blur"
+                    //     }]
+                    // },
                     {
                         label: "备注",
                         prop: "remarks"
@@ -445,7 +458,8 @@ export default {
             const data = await this.PreviewOnLoad(this.PreviewPage, {
                 businessType: 'HYCK',
                 classifyCode: '单证',
-                groupCode: row.groupCode == '提单详情(H)' ? '提单详情' : row.groupCode
+                groupCode: row.groupCode == '提单详情(H)' ? '提单详情' : row.groupCode,
+                logId: row.id,
             });
             this.$nextTick(() => {
                 if (data.length == 1) {
@@ -511,12 +525,14 @@ export default {
             this.PreviewOnLoad(this.PreviewPage, {
                 businessType: 'HYCK',
                 classifyCode: '单证',
-                groupCode: this.editData.groupCode
+                groupCode: this.editData.groupCode,
+                logId: this.editData.id,
             });
         },
         PreviewSearchChange(params, done) {
             this.PreviewQuery = params;
             this.PreviewPage.currentPage = 1;
+            params.logId=this.editData.id,
             this.PreviewOnLoad(this.PreviewPage, params);
             done();
         },
@@ -530,7 +546,8 @@ export default {
             this.PreviewOnLoad(this.PreviewPage, {
                 businessType: 'HYCK',
                 classifyCode: '单证',
-                groupCode: this.editData.groupCode
+                groupCode: this.editData.groupCode,
+                logId: this.editData.id,
             });
         },
         // 打印预览弹窗数据
@@ -543,8 +560,6 @@ export default {
         },
         // 新建单证按钮
         addbtnfun() {
-            console.log("this.businesstypeData", this.businesstypeData)
-
             if (!this.assemblyForm.id) {
                 this.$message.warning("请先保存数据");
                 return;
@@ -556,10 +571,12 @@ export default {
             this.addShow = false
             reportsGetReportData({
                 billId: this.assemblyForm.id,
+                businessType: this.assemblyForm.businessType,
                 reportCode: this.businesstypeData.classifyCode,
                 groupCode: this.businesstypeData.groupCode,
                 reportsType: this.businesstypeData.reportsType,
                 type: 'HYCK',
+                allowCreateCount: this.businesstypeData.allowCreateCount,
                 params: this.businesstypeData.params,
             }).then(res => {
                 this.editData.groupCode = this.businesstypeData.groupCode
@@ -576,7 +593,6 @@ export default {
         },
         focusBusinesstypeData(row){
             var bus = this.reportTypeData.find(b=>b.groupCode==row.groupCode && b.reportsType==row.reportsCode)
-            console.log('bus', bus)
             this.businesstypeData = bus ? bus : {}
         },
         // 编辑
@@ -613,7 +629,7 @@ export default {
             if (this.editData.id) {
                 obj = this.editData
             } else {
-                obj.remarks = this.assemblyForm.remarks
+                // obj.remarks = this.assemblyForm.remarks
                 obj.businessType = this.assemblyForm.businessType
                 obj.billId = this.assemblyForm.id
                 obj.billNo = this.assemblyForm.billNo
@@ -622,21 +638,22 @@ export default {
                 obj.reportsCode = this.businesstypeData.reportsType
                 obj.groupCode = this.businesstypeData.groupCode
                 obj.reportsType = this.businesstypeData.reportsType
+                obj.allowPrintCount = 0
+                obj.printCount = 0
             }
-            console.log(this.documentForm)
             obj.printContent = JSON.stringify({
                 data: {
                     ...this.documentForm,
-                    to: this.documentForm.corpCnName,
-                    attn: this.documentForm.corpAttnName,
+                    // to: this.documentForm.corpCnName,
+                    // attn: this.documentForm.corpAttnName,
                     fm: this.documentForm.createUserName,
                     fax: this.documentForm.fax,
                     cc: this.documentForm.cc,
-                    email: this.documentForm.ematl,
+                    email: this.documentForm.email,
                     department: this.documentForm.corpAttnName,
                     operate: this.documentForm.operatorName,
                     mobilePhone: this.documentForm.mobilePhone,
-                    remarks: this.documentForm.remarks,
+                    // remarks: this.documentForm.remarks,
                     contacts: this.documentForm.cyContacts,
                     deliverylocation: this.documentForm.cyCnName,
                     shippingAgency: this.documentForm.bookingAgentCnName,
@@ -645,7 +662,6 @@ export default {
                 }
                 // url:this.documenturl
             })
-            console.log(obj)
             // 保存
             reportslogSubmit(obj).then(res => {
                 if (type) {
@@ -801,6 +817,9 @@ export default {
                 return
             }
             this.loading = true;
+            if(this.businesstypeData && this.businesstypeData.reportsType){
+                params = {...params, reportsType: this.businesstypeData.reportsType}
+            }
             reportslogList(documentPage.currentPage, documentPage.pageSize, {
                 ...Object.assign(params, this.query),
                 billId: this.assemblyForm.id
@@ -894,11 +913,9 @@ export default {
 
             return lines
         },
-        handleReportPreview(row, url, data) {
+        async handleReportPreview(row, url, data) {
             let rptType = this.reportTypeData.find(r=>r.groupCode == row.groupCode)
-            console.log('rptType', rptType)
-            // console.log(url, 1670)
-            // console.log(data, 1671)
+
             // 处理时间
             data.end = data.end ? data.end.slice(0, 10) : ''
             data.goodsTime = data.goodsTime ? data.goodsTime.slice(0, 10) : ''
@@ -934,13 +951,8 @@ export default {
             // 是创建一个 Stimulsoft 报表查看器的实例的代码
             let viewer = new Stimulsoft.Viewer.StiViewer(options, 'StiViewer', false)
 
-            // 报表
-            console.log("创建一个报表实例");
-            console.log()
             let report = new window.Stimulsoft.Report.StiReport();
 
-            // 加载文件
-            console.log("从url加载报表");
             // report.loadFile("/reports/stimulsoft/demos/SimpleList.mrt");
             report.load(url)
 
@@ -1038,14 +1050,11 @@ export default {
                 }
             }
             */
-            console.log('rptType.params', rptType.params)
             if(rptType && rptType.params){
                 let m = rptType.params.marks
                 if(m){
-                    console.log('rptType.params.marks', m)
                     if(m.lineLength && m.lineLength>0){
                         data.marks = this.formatBLText(data.marks, m.lineLength).join('\n')
-                        console.log('data.marks', data.marks)
                     }
                     if(m.lineCount && m.lineCount>0){
                         var lns1=data.marks.split(/\r\n|\r|\n/)
@@ -1054,15 +1063,12 @@ export default {
                             data.largeMarks = data.marks
                             data.marks = " SEE ATTACHED PAPER"
                         }
-                        console.log('data.marks.lns1', lns1.Count)
                     }
                 }
                 m = rptType.params.commodityDescr
                 if(m){
-                    console.log('rptType.params.commodityDescr', m)
                     if(m.lineLength && m.lineLength>0){
                         data.commodityDescr = this.formatBLText(data.commodityDescr, m.lineLength).join('\n')
-                        console.log('data.commodityDescr', data.marks)
                     }
                     if(m.lineCount && m.lineCount>0){
                         var lns1=data.commodityDescr.split(/\r\n|\r|\n/)
@@ -1071,13 +1077,10 @@ export default {
                             data.largeCommodityDescr = data.commodityDescr
                             data.commodityDescr = " SEE ATTACHED PAPER"
                         }
-                        console.log('data.commodityDescr.lns1', lns1.Count)
                     }
                 }
             }
 
-            // console.log(data.hshipperDetails, 'hshipperDetails2')
-
             // 创建一个 Stimulsoft 数据集(DataSet)的实例的代码
             var dataSet = new Stimulsoft.System.Data.DataSet(
                 'reportData'
@@ -1093,6 +1096,53 @@ export default {
             // 这是将报表对象指定给报表查看器的属性。viewer 是报表查看器的实例,而 report 是之前创建的报表对象。
             viewer.report = report;
 
+            let printData = this.editData
+            let printRow = row
+
+            viewer.los={
+                logId: printData.id,
+                reportId: printRow.id,
+                allowPrintCount: printRow.allowPrintCount,
+                printCount: 0,
+                canPrint: printRow.allowPrintCount>=0,
+                fileName: buildExportFileName(printRow, printData),
+            }
+
+            if(printRow.allowPrintCount>0) {
+                let pc = await getReportslogPrintCount(printData.id, printRow.id)
+                viewer.los.printCount = pc.data.data.count
+                viewer.los.canPrint = pc.data.data.canPrint
+            }
+
+            viewer.onPrintReport = function (sender, args){
+                sender.preventDefault = !viewer.los.canPrint
+
+                if(viewer.los.allowPrintCount>0){
+                    addReportPrintCount(viewer.los.logId, viewer.los.reportId)
+                    viewer.los.printCount += 1
+                    viewer.los.canPrint = viewer.los.allowPrintCount==0 || viewer.los.printCount<viewer.los.allowPrintCount
+                }
+            }
+
+            viewer.onBeginExportReport = async (args) => {
+                // if (args.format == Stimulsoft.Report.StiExportFormat.Pdf)
+                //     args.settings.imageQuality = 0.5;
+                args.preventDefault= !viewer.los.canPrint
+            }
+
+            viewer.onEndExportReport = async (args) => {
+                // args.fileName = "SampleFileName.txt";
+                // args.preventDefault=true
+                if(viewer.los.fileName){
+                    args.fileName = viewer.los.fileName;
+                }
+                if(viewer.los.allowPrintCount>0){
+                    addReportPrintCount(viewer.los.logId, viewer.los.reportId)
+                    viewer.los.printCount += 1
+                    viewer.los.canPrint = viewer.los.allowPrintCount==0 || viewer.los.printCount<viewer.los.allowPrintCount
+                }
+            }
+
             this.$refs.reportContainer.showContainer(
                 () => {
                     setTimeout(() => {
@@ -1104,7 +1154,6 @@ export default {
 
                 },
             )
-            console.log("加载成功完成!");
         },
         createViewerButtons(viewer) {
             viewer.jsObject.collections.images['myClose.png'] =
@@ -1128,28 +1177,31 @@ export default {
             // 获取打印按钮的位置
             const buttonsTablePrint = toolbarTable.rows[0].childNodes[0].lastChild // 打印按钮
             const userButtonPrint = buttonsTablePrint.rows[0].childNodes[0] // 打印按钮dom位置
-
+            const userButtonSave = buttonsTablePrint.rows[0].childNodes[1] // 保存按钮dom位置
 
             userButtonPrint.addEventListener("click", (event) => {
-                console.log("打印点击");
+                // console.log("打印点击");
                 // event.preventDefault()
             });
             userButtonPrint.addEventListener("mouseover", (event) => {
-                console.log("移入打印按钮");
-                console.log(event, 1035)
+                // console.log("移入打印按钮");
+                // console.log(event, 1035)
 
             });
 
+            if(!viewer.los.canPrint) {
+                userButtonPrint.hidden=true
+                userButtonSave.hidden=true
+            }
+
             userButtonCell.className = 'stiJsViewerClearAllStyles'
             userButtonCell.appendChild(closeBtn) // 添加关闭节点
 
             // userButtonPrint.prepend(printBtn) // 在 printBtn 节点里最前面增加一个子级节点
 
-
             let that = this
             // 关闭按钮的监听点击
             closeBtn.action = function () {
-                console.log(that.$refs.ReportContainer, '1022')
                 if (that.$refs.reportContainer)
                     that.$refs.reportContainer.hideContainer()
             }
@@ -1165,8 +1217,8 @@ export default {
         //自定义列保存
         async saveColumnTwo(ref, option, optionBack, code) {
             /**
-             * 已定义全局方法,直接使用,saveColumnData保存列数据方法,参数传值(表格名称,当前表格的option数据)
-             * 已定义全局方法,直接使用,getColumnName方法用来获取枚举值,参数根据自己定义的code值获取中文名
+             * 已定义全局方法,直接使用,saveColumnData 保存列数据方法,参数传值(表格名称,当前表格的option数据)
+             * 已定义全局方法,直接使用,getColumnName 方法用来获取枚举值,参数根据自己定义的code值获取中文名
              * 一定要执行异步操作,要等接口成功返回,才能执行下一行代码
              */
             const inSave = await this.saveColumnData(this.getColumnName(code), this[option]);

+ 65 - 5
src/views/iosBasicData/SeafreightExportF/bills/assembly/businessReports.vue

@@ -56,10 +56,18 @@
 </template>
 
 <script>
-import { getList, getDetail, add, update, remove, reportsGetReportData } from "@/api/iosBasicData/reports";
+import {
+    getList,
+    getDetail,
+    add,
+    update,
+    remove,
+    reportsGetReportData,
+    buildExportFileName,
+} from "@/api/iosBasicData/reports";
 import { getUserApprovalList } from "@/api/approval/processConfig";
 import { mapGetters } from "vuex";
-import { billsDetail } from '@/api/iosBasicData/bills'
+import {addReportPrintCount, billsDetail, getReportslogPrintCount} from '@/api/iosBasicData/bills'
 import { bbusinesstypeList } from "@/api/iosBasicData/bbusinesstype";
 import reportContainer from "@/views/iosBasicData/report-container/report-container.vue"
 import mailComponent from "@/components/iosbasic-data/mail-component.vue";
@@ -695,7 +703,7 @@ export default {
         groupCode: row.groupCode,
         type: 'HYCK'
       }).then(res => {
-        this.handleReportPreview(url, res.data.data.data)
+        this.handleReportPreview(row, url, res.data.data.data)
       })
     },
     dialogPreviewfunDC(row){
@@ -712,7 +720,7 @@ export default {
           this.$refs.mailComponentRef.formData.fileContent = e.data
       },
     // 预览报表
-    handleReportPreview(url, row, rptItem) {
+    async handleReportPreview(rptItem, url, row) {
       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')
@@ -874,6 +882,53 @@ export default {
       // 这是将报表对象指定给报表查看器的属性。viewer 是报表查看器的实例,而 report 是之前创建的报表对象。
       viewer.report = report;
 
+        let printData = {id: this.id}
+        let printRow = rptItem
+        viewer.los={
+            logId: printData.id,
+            reportId: printRow.id,
+            allowPrintCount: printRow.allowPrintCount,
+            printCount: 0,
+            canPrint: printRow.allowPrintCount>=0,
+            fileName: buildExportFileName(printRow, printData),
+        }
+
+        // console.log("handleReportPreview", "viewer", viewer, "assemblyForm", printData)
+
+        if(printRow.allowPrintCount>0) {
+            let pc = await getReportslogPrintCount(printData.id, printRow.id)
+            viewer.los.printCount = pc.data.data.count
+            viewer.los.canPrint = pc.data.data.canPrint
+        }
+
+        viewer.onPrintReport = function (sender, args){
+            sender.preventDefault = !viewer.los.canPrint
+
+            if(viewer.los.allowPrintCount>0){
+                addReportPrintCount(viewer.los.logId, viewer.los.reportId)
+                viewer.los.printCount += 1
+                viewer.los.canPrint = viewer.los.allowPrintCount==0 || viewer.los.printCount<viewer.los.allowPrintCount
+            }
+        }
+
+        viewer.onBeginExportReport = async (args) => {
+            // if (args.format == Stimulsoft.Report.StiExportFormat.Pdf)
+            //     args.settings.imageQuality = 0.5;
+            args.preventDefault= !viewer.los.canPrint
+        }
+
+        viewer.onEndExportReport = async (args) => {
+            // args.fileName = "SampleFileName.txt";
+            // args.preventDefault=true
+            if(viewer.los.fileName){
+                args.fileName = viewer.los.fileName;
+            }
+            if(viewer.los.allowPrintCount>0){
+                addReportPrintCount(viewer.los.logId, viewer.los.reportId)
+                viewer.los.printCount += 1
+                viewer.los.canPrint = viewer.los.allowPrintCount==0 || viewer.los.printCount<viewer.los.allowPrintCount
+            }
+        }
 
       this.$refs.reportContainer.showContainer(
         () => {
@@ -1009,7 +1064,7 @@ export default {
       // 获取打印按钮的位置
       const buttonsTablePrint = toolbarTable.rows[0].childNodes[0].lastChild // 打印按钮
       const userButtonPrint = buttonsTablePrint.rows[0].childNodes[0] // 打印按钮dom位置
-
+      const userButtonSave = buttonsTablePrint.rows[0].childNodes[1] // 保存按钮dom位置
 
       userButtonPrint.addEventListener("click", (event) => {
         console.log("打印点击");
@@ -1021,6 +1076,11 @@ export default {
 
       });
 
+      if(!viewer.los.canPrint) {
+          userButtonPrint.hidden = true
+          userButtonSave.hidden = true
+      }
+
       userButtonCell.className = 'stiJsViewerClearAllStyles'
       userButtonCell.appendChild(closeBtn) // 添加关闭节点
 

+ 109 - 37
src/views/iosBasicData/SeafreightExportF/bills/assembly/feecenter.vue

@@ -640,13 +640,15 @@ import {
     listFeeCountByCorp,
     losbfeestemplateGetListTemplate,
     accountsReceivable,
-    updateCorpBatch
+    updateCorpBatch,
+    getReportslogPrintCount,
+    addReportPrintCount,
 } from "@/api/iosBasicData/bills";
 import { losbfeestemplateDetail } from "@/api/iosBasicData/losbfeestemplate";
 import { popupReminder, requiredMessage } from "@/util/messageReminder";
 import { getBaccelementsList } from "@/api/iosBasicData/baccelements";
 import reportContainer from "@/views/iosBasicData/report-container/report-container.vue";
-import { reportsGetReportData } from "@/api/iosBasicData/reports";
+import {buildExportFileName, reportsGetReportData} from "@/api/iosBasicData/reports";
 import reportformsList from "@/views/iosBasicData/SeafreightExportF/bills/assembly/reportformsList.vue";
 import { getList as reportsList } from "@/api/iosBasicData/reports";
 import { dateFormat } from "@/util/date";
@@ -1562,7 +1564,7 @@ export default {
     async created() {
 
         isProcurement({ "param": "if.station" }).then(res => {
-            console.log(res)
+            // console.log(res)
             if (res.data.data == 1) {
                 this.messageData.push({
                     name: '场站',
@@ -1571,7 +1573,7 @@ export default {
             }
         })
         this.roleName = localStorage.getItem('roleName').split(',') // 获取角色数据
-        console.log("roleName", this.roleName)
+        // console.log("roleName", this.roleName)
         this.isAdmin = this.roleName.indexOf('admin') >= 0;
         this.isFeeEditD = this.isAdmin || this.roleName.indexOf('应收修改') >= 0;
         this.isFeeEditC = this.isAdmin || this.roleName.indexOf('应付修改') >= 0;
@@ -1636,7 +1638,7 @@ export default {
             })
 
             newArr = [... new Set(corpArr)]
-            console.log(sumArr, newArr)
+            // console.log(sumArr, newArr)
             newArr.forEach(e => {
                 let rmbD = 0
                 let rmbC = 0
@@ -1673,7 +1675,7 @@ export default {
                     sumD: _.round(sumD, 2),
                     sumC: _.round(sumC, 2)
                 })
-                console.log(this.sumData)
+                // console.log(this.sumData)
             })
         },
         uniqueItems(list) {
@@ -1720,7 +1722,7 @@ export default {
                 curCode: row.curCode,
                 type: 'HYCK',
             }).then(res => {
-                this.handleReportPreview(this.reportformsObj.url, res.data.data.data)
+                this.handleReportPreview(this.reportformsObj, this.reportformsObj.url, res.data.data.data)
             })
         },
         // 打印弹窗里回调
@@ -1734,7 +1736,7 @@ export default {
                 itemIds: this.idArr.join(','),
                 type: 'HYCK'
             }).then(res => {
-                this.handleReportPreview(val.url, res.data.data.data)
+                this.handleReportPreview(val, val.url, res.data.data.data)
             })
         },
         // 打印费用
@@ -1815,7 +1817,7 @@ export default {
         },
         // 打印表格选择
         reportNodeClick(data) {
-            console.log(data)
+            // console.log(data)
             if (data.cnName == '应收-账单号') {
                 this.printingAccBill = "1"
                 this.printingLoading = true
@@ -1946,13 +1948,12 @@ export default {
         },
         // 模板导入
         templateExport() {
-
             if (!this.lefttemplate.id) {
                 this.$message.warning('请选择左侧模版名')
                 return
             }
             if (this.feesselectionList.length > 0) {
-                console.log(this.lefttemplate)
+                // console.log(this.lefttemplate)
                 feecenterTemplateImport({
                     ...this.lefttemplate,
                     feesTemplateItemsList: this.feesselectionList,
@@ -2426,7 +2427,7 @@ export default {
         },
         // 应收删除
         deletefun(row, index, dc) {
-            console.log(row, index, 1580)
+            // console.log(row, index, 1580)
             this.$confirm("确定将选择数据删除?", {
                 confirmButtonText: "确定",
                 cancelButtonText: "取消",
@@ -2617,6 +2618,10 @@ export default {
                         if (item.quantityRule == 6) {
                             this.$set(row, 'quantity', this.assemblyForm.quantity)
                         }
+                        // 按箱量
+                        if (item.quantityRule == 7 || item.quantityRule == 8 || item.quantityRule == 9) {
+                            this.$set(row, 'quantity', item.boxquantity)
+                        }
                     }
                 }
                 this.$set(row, 'amount', Number(row.price ? row.price : 0) * Number(row.quantity ? row.quantity : 0))
@@ -2880,6 +2885,7 @@ export default {
         },
         // 获取计算属性
         async getBunitsPagefun(type, feeRow, row) {
+            // console.log('getBunitsPagefun')
             let srcBillId = null
             if (this.assemblyForm.billType == 'MH') {
                 srcBillId = this.assemblyForm.masterId
@@ -2888,22 +2894,27 @@ export default {
             }
             const res = await getBunitsPage({ srcBillId })
             this.unitNoData = []
-            let boxarr40 = ['40HC', '40GP']
-            let boxarr20 = ['20GP']
+            let units = {}
             let teunum = 0
-            console.log("getBunitsPagefun", res.data.data, "feeRow", feeRow)
+            // console.log("getBunitsPagefun", res.data.data, "feeRow", feeRow)
             for (let item of res.data.data) {
+                if(feeRow && item.id == feeRow.unitId){
+                    units = item
+                }
                 // 按箱型
                 if (item.quantityRule != 1) {
-                    // TEU
+                    // quantityRule == 4 = TEU
                     if (item.quantityRule == 4) {
                         for (let data of this.assemblyForm.preContainersList) {
                             // 40*2 20*1
+                            /*
                             if (boxarr40.indexOf(data.cntrTypeCode) != -1) {
                                 teunum += Number(data.quantity) * 2
                             } else if (boxarr20.indexOf(data.cntrTypeCode) != -1) {
                                 teunum += Number(data.quantity)
                             }
+                            */
+                            teunum += Number(data.quantity) * (data.cntrTypeCode.substring(0, 2)=='20' ? 1 : 2)
                         }
                         this.unitNoData.push({ ...item, boxquantity: teunum })
                     } else {
@@ -2911,24 +2922,39 @@ export default {
                     }
                 }
             }
+            let C20 = 0, C40 = 0
             let arr = this.assemblyForm.preContainersList.map(item => {
+                C20 += item.cntrTypeCode.substring(0, 2)=='20' ? item.quantity : 0
+                C40 += item.cntrTypeCode.substring(0, 2)!='20' ? item.quantity : 0
                 return {
-                    quantityRule: 1, // 1 是按箱量
+                    quantityRule: 1, // 1 是按箱型箱
                     code: item.cntrTypeCode,
                     boxquantity: item.quantity,
                 }
             })
+            this.unitNoData.forEach(u=>{
+                if(u.quantityRule==7){
+                    u.boxquantity = C20 + C40
+                }
+                if(u.quantityRule==8){
+                    u.boxquantity = C20
+                }
+                if(u.quantityRule==9){
+                    u.boxquantity = C40
+                }
+            })
             this.unitNoData = [...arr, ...this.unitNoData]
-            console.log("getBunitsPagefun.unitNoData", this.unitNoData)
+            console.log("getBunitsPagefun.unitNoData", this.unitNoData, 'units', units, 'feeRow', feeRow)
             // 选择费用时带出第一条
             if (type) {
                 let feeunitNodata = []
-                for (let item of this.unitNoData) {
-                    if (item.quantityRule == feeRow.unitNo) {
-                        feeunitNodata.push(item)
-                    }
-                }
-                this.corpChange(feeunitNodata[0].code, 'unitNo', row)
+                // for (let item of this.unitNoData) {
+                //     if (item.quantityRule == feeRow.unitNo) {
+                //         feeunitNodata.push(item)
+                //     }
+                // }
+                feeunitNodata = this.unitNoData.filter(u=>u.quantityRule==units.quantityRule)
+                this.corpChange(feeunitNodata.length>0 ? feeunitNodata[0].code : 'JOB', 'unitNo', row)
             }
         },
 
@@ -3284,9 +3310,9 @@ export default {
             }
         },
         // 预览报表
-        handleReportPreview(url, data) {
-            console.log(url, 1670)
-            console.log(data, 1671)
+        async handleReportPreview(row, url, data) {
+            // console.log("handleReportPreview", "row", row, "data", data)
+
             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')
@@ -3317,12 +3343,9 @@ export default {
             let viewer = new Stimulsoft.Viewer.StiViewer(options, 'StiViewer', false)
 
             // 报表
-            console.log("创建一个报表实例");
-            console.log()
             let report = new window.Stimulsoft.Report.StiReport();
 
             // 加载文件
-            console.log("从url加载报表");
             // report.loadFile("/reports/stimulsoft/demos/SimpleList.mrt");
             report.load(url)
 
@@ -3422,8 +3445,6 @@ export default {
                 }
             }
 
-            // console.log(data.hshipperDetails, 'hshipperDetails2')
-
             // 创建一个 Stimulsoft 数据集(DataSet)的实例的代码
             var dataSet = new Stimulsoft.System.Data.DataSet(
                 'reportData'
@@ -3439,6 +3460,53 @@ export default {
             // 这是将报表对象指定给报表查看器的属性。viewer 是报表查看器的实例,而 report 是之前创建的报表对象。
             viewer.report = report;
 
+            let printData = this.assemblyForm
+            let printRow = row
+            viewer.los={
+                logId: printData.id,
+                reportId: printRow.id,
+                allowPrintCount: printRow.allowPrintCount,
+                printCount: 0,
+                canPrint: printRow.allowPrintCount>=0,
+                fileName: buildExportFileName(printRow, printData),
+            }
+
+            // console.log("handleReportPreview", "viewer", viewer, "assemblyForm", printData)
+
+            if(printRow.allowPrintCount>0) {
+                let pc = await getReportslogPrintCount(printData.id, printRow.id)
+                viewer.los.printCount = pc.data.data.count
+                viewer.los.canPrint = pc.data.data.canPrint
+            }
+
+            viewer.onPrintReport = function (sender, args){
+                sender.preventDefault = !viewer.los.canPrint
+
+                if(viewer.los.allowPrintCount>0){
+                    addReportPrintCount(viewer.los.logId, viewer.los.reportId)
+                    viewer.los.printCount += 1
+                    viewer.los.canPrint = viewer.los.allowPrintCount==0 || viewer.los.printCount<viewer.los.allowPrintCount
+                }
+            }
+
+            viewer.onBeginExportReport = async (args) => {
+                // if (args.format == Stimulsoft.Report.StiExportFormat.Pdf)
+                //     args.settings.imageQuality = 0.5;
+                args.preventDefault= !viewer.los.canPrint
+            }
+
+            viewer.onEndExportReport = async (args) => {
+                // args.preventDefault=true
+                if(viewer.los.fileName){
+                    args.fileName = viewer.los.fileName;
+                }
+                if(viewer.los.allowPrintCount>0){
+                    addReportPrintCount(viewer.los.logId, viewer.los.reportId)
+                    viewer.los.printCount += 1
+                    viewer.los.canPrint = viewer.los.allowPrintCount==0 || viewer.los.printCount<viewer.los.allowPrintCount
+                }
+            }
+
             this.$refs.reportContainer.showContainer(
                 () => {
                     setTimeout(() => {
@@ -3449,7 +3517,6 @@ export default {
                 () => {
                 },
             )
-            console.log("加载成功完成!");
         },
         createViewerButtons(viewer) {
             viewer.jsObject.collections.images['myClose.png'] =
@@ -3473,18 +3540,23 @@ export default {
             // 获取打印按钮的位置
             const buttonsTablePrint = toolbarTable.rows[0].childNodes[0].lastChild // 打印按钮
             const userButtonPrint = buttonsTablePrint.rows[0].childNodes[0] // 打印按钮dom位置
-
+            const userButtonSave = buttonsTablePrint.rows[0].childNodes[1] // 保存按钮dom位置
 
             userButtonPrint.addEventListener("click", (event) => {
-                console.log("打印点击");
+                // console.log("打印点击");
                 // event.preventDefault()
             });
             userButtonPrint.addEventListener("mouseover", (event) => {
-                console.log("移入打印按钮");
-                console.log(event, 1035)
+                // console.log("移入打印按钮");
+                // console.log(event, 1035)
 
             });
 
+            if(!viewer.los.canPrint) {
+                userButtonPrint.hidden=true
+                userButtonSave.hidden=true
+            }
+
             userButtonCell.className = 'stiJsViewerClearAllStyles'
             userButtonCell.appendChild(closeBtn) // 添加关闭节点
 

+ 25 - 1
src/views/iosBasicData/SeafreightExportF/bills/assembly/mbinformation.vue

@@ -254,6 +254,30 @@
                     </div>
                 </el-col>
             </el-row>
+            <el-row>
+                <el-col :span="6">
+                    <el-form-item label="MB/L 唛头" prop="mmarks">
+                        <span slot="label">
+                            <span style="color: #1e9fff">MB/L 唛头</span>
+                        </span>
+                        <el-input type="textarea" style="width: 100%;" v-model="assemblyForm.detail.mmarks"
+                                  size="small" autocomplete="off" :disabled="detailData.seeDisabled" rows="5" clearable
+                                  placeholder="MB/L 唛头" @change="textareaBlur('mmarks')"></el-input>
+                    </el-form-item>
+                </el-col>
+                <el-col :span="6">
+                    <el-form-item label="MB/L 货描" prop="mcommodityDescr">
+                        <span slot="label">
+                            <span style="color: #1e9fff">MB/L 货描</span>
+                        </span>
+                        <el-input type="textarea" style="width: 100%;" v-model="assemblyForm.detail.mcommodityDescr"
+                                  size="small" autocomplete="off" :disabled="detailData.seeDisabled" rows="5" clearable
+                                  placeholder="MB/L 货描" @change="textareaBlur('mcommodityDescr')"></el-input>
+                    </el-form-item>
+                </el-col>
+                <el-col :span="12">
+                </el-col>
+            </el-row>
         </el-form>
     </div>
 </template>
@@ -329,7 +353,7 @@ export default {
             //         type: 'warning'
             //     });
             // }
-            let arr = ['mshipperDetails', 'mconsigneeDetails', 'mnotifyDetails', 'mnotify2Details']
+            let arr = ['mshipperDetails', 'mconsigneeDetails', 'mnotifyDetails', 'mnotify2Details', 'mcommodityDescr', 'mmarks']
             if (arr.indexOf(name) != -1) {
                 this.assemblyForm.detail[name] = _.toUpper(this.assemblyForm.detail[name])
 

+ 15 - 0
src/views/iosBasicData/SeafreightExportF/bills/assembly/reportformsFrame/BillofLadingDetails.vue

@@ -1,4 +1,18 @@
 <template>
+    <div>
+    <el-form :model="documentForm" ref="form1" label-width="90px" style="margin-bottom: 4px" class="demo-ruleForm">
+        <el-form-item label="TO:" prop="to">
+            <el-input type="age" style="width: 50%;" v-model="documentForm.to" size="small"
+                      autocomplete="off" clearable>
+            </el-input>
+        </el-form-item>
+        <el-form-item label="ATTN:" prop="attn">
+            <el-input type="age" style="width: 50%;" v-model="documentForm.attn" size="small"
+                      autocomplete="off" clearable>
+            </el-input>
+        </el-form-item>
+    </el-form>
+
     <el-form :model="documentForm" ref="form" label-position="top" style="margin-bottom: 4px" class="demo-ruleForm">
         <el-row>
             <el-col :span="14">
@@ -316,6 +330,7 @@
         </el-row>
 
     </el-form>
+    </div>
 </template>
 
 <script>

+ 14 - 0
src/views/iosBasicData/SeafreightExportF/bills/assembly/reportformsFrame/BillofLadingDetailsM.vue

@@ -1,4 +1,17 @@
 <template>
+    <div>
+        <el-form :model="documentForm" ref="form1" label-width="90px" style="margin-bottom: 4px" class="demo-ruleForm">
+            <el-form-item label="TO:" prop="to">
+                <el-input type="age" style="width: 50%;" v-model="documentForm.to" size="small"
+                          autocomplete="off" clearable>
+                </el-input>
+            </el-form-item>
+            <el-form-item label="ATTN:" prop="attn">
+                <el-input type="age" style="width: 50%;" v-model="documentForm.attn" size="small"
+                          autocomplete="off" clearable>
+                </el-input>
+            </el-form-item>
+        </el-form>
     <el-form :model="documentForm" ref="form" label-position="top" style="margin-bottom: 4px" class="demo-ruleForm">
         <el-row>
             <el-col :span="14">
@@ -366,6 +379,7 @@
         </el-row>
 
     </el-form>
+    </div>
 </template>
 
 <script>

+ 77 - 13
src/views/iosBasicData/SeafreightExportF/bills/assembly/reports.vue

@@ -4,7 +4,8 @@
     <avue-crud :option="option" :table-loading="loading" :data="data" :page.sync="page" :search.sync="query"
       :permission="permissionList" :before-open="beforeOpen" v-model="form" ref="crud" id="out-table"
       :header-cell-class-name="headerClassName" @resetColumn="resetColumnTwo('crud', 'option', 'optionBack', 312)"
-      @saveColumn="saveColumnTwo('crud', 'option', 'optionBack', 312)" @row-update="rowUpdate" @row-save="rowSave"
+      @saveColumn="saveColumnTwo('crud', 'option', 'optionBack', 312)"
+      @row-update="rowUpdate" @row-save="rowSave"
       @row-del="rowDel" @search-change="searchChange" @search-reset="searchReset" @selection-change="selectionChange"
       @current-change="currentChange" @size-change="sizeChange" @refresh-change="refreshChange" @on-load="onLoad">
       <template slot-scope="{type,disabled}" slot="urlForm">
@@ -265,15 +266,34 @@ export default {
             prop: "url",
             hide: true,
             formslot: true,
-            rules: [{
-              required: true,
-              message: "请输入备注",
-              trigger: "blur"
-            }]
+            // rules: [{
+            //   required: true,
+            //   message: "请输入备注",
+            //   trigger: "blur"
+            // }]
           },
+            {
+                // 允许打印次数,-1 不允许打印,0 不限制打印 >0 最大打印次数
+                label: "允许打印次数",
+                prop: "allowPrintCount",
+                type: "number",
+                // index: 5,
+                // width: 60,
+                // rules: [
+                //     {
+                //         required: true,
+                //         message: "请输入排序",
+                //         trigger: "blur"
+                //     }
+                // ]
+            },
+            {
+                label: "文件名格式",
+                prop: "fileNameFormat",
+            },
           {
             label: "备注",
-            prop: "remarks"
+            prop: "remarks",
           },
         ]
       },
@@ -387,13 +407,17 @@ export default {
         if (!e.report.isModified)
           return
         var jsonString = e.report.saveToJsonString()
-        // console.log(jsonString)
         this.form.url = jsonString;
+        //
+        // console.log('保存url')
+        // console.log(this.form)
+        // console.log(jsonString)
+        // console.log('保存url结束')
 
-        console.log('保存url')
-        console.log(jsonString)
-        console.log('保存url结束')
-
+          // 修改的报表直接保存
+          if(this.form.id) {
+              update(this.form)
+          }
       }
 
       let report = new window.Stimulsoft.Report.StiReport();
@@ -686,7 +710,6 @@ export default {
     },
     // 预览报表
     handleReportPreview(url, row) {
-      console.log(row, 698)
       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')
@@ -1052,6 +1075,43 @@ export default {
 
 
     addedData(type, scope) {
+        var defRpt = {
+            "ReportGuid": "048d8ba656989354e05fbb23708a7004",
+            "ReportName": "Report",
+            "ReportAlias": "Report",
+            "ReportFile": ".mrt",
+            "ReportCreated": "/Date(1757057062000+0800)/",
+            "ReportChanged": "/Date(1757057062000+0800)/",
+            "EngineVersion": "EngineV2",
+            "CalculationMode": "Interpretation",
+            "ReportUnit": "Centimeters",
+            "PreviewSettings": 260039167,
+            "Pages": {
+                "0": {
+                    "Ident": "StiPage",
+                    "Name": "Page1",
+                    "Guid": "4fdaf16ab775716f0178f1265559ce42",
+                    "Interaction": {
+                        "Ident": "StiInteraction"
+                    },
+                    "Border": ";;2;;;;;solid:Black",
+                    "Brush": "solid:",
+                    "PageWidth": 21,
+                    "PageHeight": 29.7,
+                    "Watermark": {
+                        "TextBrush": "solid:50,0,0,0"
+                    },
+                    "Margins": {
+                        "Left": 1,
+                        "Right": 1,
+                        "Top": 1,
+                        "Bottom": 1
+                    }
+                }
+            }
+        }
+
+      // type 1 查看详情 2 编辑 3 新增
       this.form = {};
       if (type == 1) {
         this.bbDisabled = true;
@@ -1071,12 +1131,14 @@ export default {
         }
         this.$refs.crud.rowEdit(scope.row, scope.$index);
       } else if (type == 3) {
+          this.form.url=JSON.stringify(defRpt)
         this.bbDisabled = false;
         this.$refs.crud.rowAdd();
       }
     },
     // 添加
     rowSave(row, done, loading) {
+        console.log("rowSave", row);
       // row.authorizedUsersId = row.authorizedUsersId.join()
       row.businessType = this.businessValue
       add(row).then(() => {
@@ -1092,6 +1154,7 @@ export default {
       });
     },
     rowUpdate(row, index, done, loading) {
+        console.log("rowUpdate", row);
       // console.log(row.authorizedUsersId)
       // row.authorizedUsersId = row.authorizedUsersId.join()
       update(row).then(() => {
@@ -1107,6 +1170,7 @@ export default {
       });
     },
     rowDel(row) {
+        console.log("rowDel", row);
       this.$confirm("确定将选择数据删除?", {
         confirmButtonText: "确定",
         cancelButtonText: "取消",

+ 225 - 16
src/views/iosBasicData/SeafreightExportF/bills/billsDetails.vue

@@ -330,14 +330,15 @@ import { getBcorpsattnList } from "@/api/iosBasicData/bcorpsattn";
 import { getWorkDicts } from "@/api/system/dictbiz";
 import { getDeptLazyTree, getDeptTree, getLazyList } from "@/api/system/dept";
 import {
-    billsCheckBills, billsCopyBills,
+    billsBeforeApplyBills, billsCheckBills,
+    billsCopyBills,
     billsDetail,
     billsGetBillNo, removeHblNo,
     billsListAll, billsRevokeCheckBills, editypesSendingEdi,
     billsSubmit,
     billsAdd,
     deptGetDetailPol, postSelectByUser, documentVerification,
-    agreementpriceList, createAndAdd
+    agreementpriceList, createAndAdd,
 } from '@/api/iosBasicData/bills'
 import { dateFormat } from "@/util/date";
 import checkSchedule from "@/components/checkH/checkSchedule.vue";
@@ -896,6 +897,9 @@ export default {
         this.editypesListfun()
         // 获取所属团队数据
         this.postSelectByUserfun()
+
+        // console.log("sysitemData", localStorage.getItem('sysitemData'))
+        // console.log("created", "form", this.form)
     },
     methods: {
         applyUnlock() {
@@ -1232,6 +1236,30 @@ export default {
                 });
                 return
             }
+            if (checkFullWidthSymbols(this.form.mmarks).hasFullWidth) {
+                let msg = []
+                for (let item of checkFullWidthSymbols(this.form.mmarks).positions) {
+                    msg.push(`第${item.row}行的"${item.symbol}"`)
+                }
+                this.$message({
+                    dangerouslyUseHTMLString: true,
+                    message: `M/BL 唛头:<br>${msg.join(";<br>")}<br>存在全角或汉字符号,请确认`,
+                    type: 'error'
+                });
+                return
+            }
+            if (checkFullWidthSymbols(this.form.mcommodityDescr).hasFullWidth) {
+                let msg = []
+                for (let item of checkFullWidthSymbols(this.form.mcommodityDescr).positions) {
+                    msg.push(`第${item.row}行的"${item.symbol}"`)
+                }
+                this.$message({
+                    dangerouslyUseHTMLString: true,
+                    message: `M/BL 货描:<br>${msg.join(";<br>")}<br>存在全角或汉字符号,请确认`,
+                    type: 'error'
+                });
+                return
+            }
             if (checkFullWidthSymbols(this.form.forwarding).hasFullWidth) {
                 let msg = []
                 for (let item of checkFullWidthSymbols(this.form.forwarding).positions) {
@@ -1269,6 +1297,12 @@ export default {
             if (!verifyEnglish(this.form.commodityDescr)) {
                 msgsList.push('货描')
             }
+            if (!verifyEnglish(this.form.mmarks)) {
+                msgsList.push('M/BL 唛头')
+            }
+            if (!verifyEnglish(this.form.mcommodityDescr)) {
+                msgsList.push('M/BL 货描')
+            }
             if (!verifyEnglish(this.form.forwarding)) {
                 msgsList.push('FORWARDING')
             }
@@ -1337,6 +1371,7 @@ export default {
         },
         // 获取用户管理数据
         userGetListfun(account = undefined, type = false,) {
+            console.log("userGetListfun", "account", account, "type", type)
             userGetList(1, 10, { account }, this.saberUserInfo.dept_pid.split(',')[0]).then(res => {
                 this.columnforfun('operatorName').dicData = res.data.data.records
                 if (type) {
@@ -1375,6 +1410,34 @@ export default {
         getLazylistfun() {
             getDeptTree().then(res => {
                 this.columnforfun('accDeptName').dicData = res.data.data
+                // console.log("accDept list", res.data.data)
+                if(!this.form.id){
+                    let rootDept = null
+                    function traverseDFS(node, id) {
+                        if (node == null) return null;
+                        if(node.id == id){
+                            return node;
+                        }
+                        if (node.children) {
+                            node.children.forEach(child => {
+                                return traverseDFS(child, id);
+                            });
+                        }
+                    }
+
+                    res.data.data.forEach(d=>{
+                        var dept = traverseDFS(d, this.form.accDept);
+                        if(dept){
+                            rootDept = dept;
+                        }
+                    })
+                    console.log("rootDept", rootDept)
+                    if(rootDept && Array.isArray(rootDept.children) && rootDept.children.length>0){
+                        rootDept = rootDept.children[0]
+                        this.$set(this.form, "accDept", rootDept.value)
+                        this.$set(this.form, "accDeptName", rootDept.title)
+                    }
+                }
             })
         },
         // 获取客户名称数据 往来单位数据
@@ -1978,19 +2041,157 @@ export default {
                 type: "warning"
             }).then(() => {
                 this.pageLoading = true
-                billsCheckBills({
+                billsBeforeApplyBills({
                     id: this.form.id,
-                    url: '/iosBasicData/SeafreightExportF/bills/approvalDetails',
-                    pageStatus: "this.$store.getters.approvalDetails",
-                    pageLabel: "审批详情(F)",
-                }).then(res => {
-                    this.pageLoading = false
-                    this.$message({
-                        type: "success",
-                        message: "操作成功!"
-                    });
-                    // 详情
-                    this.billsDetailfun(this.form.id)
+                }).then(d => {
+                    console.log(d)
+                    if(d.status==200) {
+                        let r = d.data.data
+                        if (r.error === true) {
+                            // 显示错误后退出
+                            this.$alert(r.errorMessage.replaceAll("\n", "<br>"),{
+                                cancelButtonText: "取消",
+                                dangerouslyUseHTMLString: true,
+                                type: 'error'
+                            });
+                            this.pageLoading = false
+
+                            return;
+                        }
+                        // 显示提示信息
+                        if (r.info === true) {
+                            alert(r.infoMessage);
+                        }
+                        // 显示确认信息
+                        if (r.confirm) {
+                            this.$confirm(r.confirmMessage + '<br />请您确认是否继续!', '确认',{
+                                confirmButtonText: "确定",
+                                cancelButtonText: "取消",
+                                dangerouslyUseHTMLString: true,
+                                type: "warning"
+                            }).then(() => {
+                                if(r.need_mail){
+                                    var title = '请输入情况说明';
+                                    if(r.ProfitDescr){
+                                        title += "<br />" + r.ProfitDescr.replaceAll('\n', '<br />');
+                                    }
+                                    this.$prompt(title, '情况说明',{
+                                        confirmButtonText: "确定",
+                                        cancelButtonText: "取消",
+                                        inputType: "textArea",
+                                        type: "warning",
+                                        inputErrorMessage: '请输入情况说明!',
+                                        inputValidator: (value) => {
+                                            console.log('请输入情况说明.inputValidator', value)
+                                            if (!value) {
+                                                return '请输入情况说明!';
+                                            }
+                                        },
+                                    }).then((value) => {
+                                        console.log('请输入情况说明.value', value)
+                                        billsCheckBills({
+                                            reserve1: value.value,
+                                            id: this.form.id,
+                                            url: '/iosBasicData/SeafreightExportF/bills/approvalDetails',
+                                            pageStatus: "this.$store.getters.approvalDetails",
+                                            pageLabel: "审批详情(F)",
+                                        }).then(res => {
+                                            this.pageLoading = false
+                                            this.$message({
+                                                type: "success",
+                                                message: "操作成功!"
+                                            });
+                                            // 详情
+                                            this.billsDetailfun(this.form.id)
+                                        }).catch(() => {
+                                            this.pageLoading = false
+                                        })
+                                    }).catch(() => {
+                                        this.pageLoading = false
+                                    })
+                                }else {
+                                    billsCheckBills({
+                                        id: this.form.id,
+                                        url: '/iosBasicData/SeafreightExportF/bills/approvalDetails',
+                                        pageStatus: "this.$store.getters.approvalDetails",
+                                        pageLabel: "审批详情(F)",
+                                    }).then(res => {
+                                        this.pageLoading = false
+                                        this.$message({
+                                            type: "success",
+                                            message: "操作成功!"
+                                        });
+                                        // 详情
+                                        this.billsDetailfun(this.form.id)
+                                    }).catch(() => {
+                                        this.pageLoading = false
+                                    })
+                                }
+                            }).catch(() => {
+                                this.pageLoading = false
+                            })
+                        } else {
+                            if(r.need_mail){
+                                var title = '请输入情况说明';
+                                if(r.ProfitDescr){
+                                    title += "<br />" + r.ProfitDescr.replaceAll('\n', '<br />');
+                                }
+                                this.$prompt(title, '情况说明', {
+                                    confirmButtonText: "确定",
+                                    cancelButtonText: "取消",
+                                    inputType: "textArea",
+                                    type: "warning",
+                                    inputErrorMessage: '请输入情况说明!',
+                                    inputValidator: (value) => {
+                                        console.log('请输入情况说明.inputValidator', value)
+                                        if (!value) {
+                                            return '请输入情况说明!';
+                                        }
+                                    },
+                                }).then((value) => {
+                                    console.log('请输入情况说明.value', value)
+                                    billsCheckBills({
+                                        reserve1: value.value,
+                                        id: this.form.id,
+                                        url: '/iosBasicData/SeafreightExportF/bills/approvalDetails',
+                                        pageStatus: "this.$store.getters.approvalDetails",
+                                        pageLabel: "审批详情(F)",
+                                    }).then(res => {
+                                        this.pageLoading = false
+                                        this.$message({
+                                            type: "success",
+                                            message: "操作成功!"
+                                        });
+                                        // 详情
+                                        this.billsDetailfun(this.form.id)
+                                    }).catch(() => {
+                                        this.pageLoading = false
+                                    })
+                                }).catch(() => {
+                                    this.pageLoading = false
+                                })
+                            }else {
+                                billsCheckBills({
+                                    id: this.form.id,
+                                    url: '/iosBasicData/SeafreightExportF/bills/approvalDetails',
+                                    pageStatus: "this.$store.getters.approvalDetails",
+                                    pageLabel: "审批详情(F)",
+                                }).then(res => {
+                                    this.pageLoading = false
+                                    this.$message({
+                                        type: "success",
+                                        message: "操作成功!"
+                                    });
+                                    // 详情
+                                    this.billsDetailfun(this.form.id)
+                                }).catch(() => {
+                                    this.pageLoading = false
+                                })
+                            }
+                        }
+                    }else{
+                        this.pageLoading = false
+                    }
                 }).catch(() => {
                     this.pageLoading = false
                 })
@@ -2282,8 +2483,8 @@ export default {
                             }
                         })
 
-                        fldNames = 'marks,commodityDescr,forwarding,siRemarks,bookingRemarks'.split(",");
-                        fldDescs = '唛头,货描,FORWARDING,SI 备注,订舱备注'.split(",");
+                        fldNames = 'marks,commodityDescr,mmarks,mcommodityDescr,forwarding,siRemarks,bookingRemarks'.split(",");
+                        fldDescs = '唛头,货描,M/BL 唛头,M/BL 货描,FORWARDING,SI 备注,订舱备注'.split(",");
                         fldNames.forEach((fld, idx) => {
                             const cfs = checkFullWidthSymbols(this.form[fld]);
                             console.log(fldDescs[idx], cfs)
@@ -2343,6 +2544,12 @@ export default {
                         if (!verifyEnglish(this.form.commodityDescr)) {
                             msgsList.push('货描')
                         }
+                        if (!verifyEnglish(this.form.mmarks)) {
+                            msgsList.push('M/BL 唛头')
+                        }
+                        if (!verifyEnglish(this.form.mcommodityDescr)) {
+                            msgsList.push('M/BL 货描')
+                        }
                         if (!verifyEnglish(this.form.forwarding)) {
                             msgsList.push('FORWARDING')
                         }
@@ -2357,6 +2564,8 @@ export default {
                     this.form.detail.hnotifyDetails = this.getTextTirim(this.form.detail.hnotifyDetails)
                     this.form.detail.marks = this.getTextTirim(this.form.detail.marks)
                     this.form.detail.commodityDescr = this.getTextTirim(this.form.detail.commodityDescr)
+                    this.form.detail.mmarks = this.getTextTirim(this.form.detail.mmarks)
+                    this.form.detail.mcommodityDescr = this.getTextTirim(this.form.detail.mcommodityDescr)
                     this.form.forwarding = this.getTextTirim(this.form.forwarding)
                     // 赋值 ETD 日期
                     this.form.billDate = this.form.etd ? this.form.etd.slice(0, 10) + ' 00:00:00' : null // 单据日期

+ 2 - 1
src/views/iosBasicData/SeafreightExportF/bills/index.vue

@@ -1418,7 +1418,7 @@ export default {
         ).content;
         // 首页快捷跳转进来的
         if (this.$route.query.home) {
-            this.addbtnfun();
+            this.addbtnfun("DD");
         }
         // if (this.$route.query.id) {
         //     this.rowCellfun(this.$route.query.id)
@@ -2026,6 +2026,7 @@ export default {
         },
         // 新增弹窗开启
         addbtnfun(type) {
+            console.log("addbtnfun", "type", type)
             this.detailData.seeDisabled = false;
             this.detailData.billType = type;
             // this.detailData.copyId=this.selectionList[0].id

+ 58 - 7
src/views/iosBasicData/bfeesdefine/index.vue

@@ -43,10 +43,10 @@
                 停用
               </el-button>
             </template>
-            <template slot="unitNoForm">
-              <search-query ref="SearchQuery" :disabled="searchDisabled" :selectValue="form.unitNo"
+            <template slot="unitIdForm">
+              <search-query ref="SearchQuery" :disabled="searchDisabled" :selectValue="form.unitId"
                 :datalist="unitNoData" title="计量单位" :filterable="true" :clearable="true" :buttonIf="false"
-                :forParameter="{ key: 'dictKey', label: 'dictValue', value: 'dictKey' }" @corpChange="unitNoCorpChange">
+                :forParameter="{ key: 'id', label: 'label', value: 'id' }" @corpChange="unitIdChange">
               </search-query>
             </template>
             <template slot="curNoForm">
@@ -280,14 +280,16 @@ export default {
           },
           {
             label: "计量单位",
-            prop: "unitNo",
+            prop: "unitId", // unitNo
             formslot: true,
             overHidden: true,
             type: 'select',
             dicData: [],
             props: {
-              label: "dictValue",
-              value: "dictKey"
+              // label: "dictValue",
+              // value: "dictKey"
+              label: "label",
+              value: "id"
             },
             rules: [{
               required: true,
@@ -411,6 +413,26 @@ export default {
                 //   trigger: "blur"
                 // }]
             },
+            {
+                label: "必须有利润",
+                prop: "isHaveProfit",
+                type: 'select',
+                search: false,
+                dicData: [{
+                    label: '否',
+                    value: 0
+                }, {
+                    label: '是',
+                    value: 1
+                }],
+                value: 0,
+                overHidden: true,
+                // rules: [{
+                //   required: true,
+                //   message: "请输入状态",
+                //   trigger: "blur"
+                // }]
+            },
           {
             label: "状态",
             prop: "status",
@@ -584,10 +606,25 @@ export default {
     },
     // 获取计算单位数据
     getBunitsListfun() {
+        /*
       getWorkDicts('number_rule').then(res => {
         this.unitNoData = res.data.data
         this.findObject(this.option.column, "unitNo").dicData = res.data.data
+         console.log("getBunitsListfun", res.data.data)
       })
+      */
+
+        getBunitsList(1, 1000, {status: 0}).then(res=>{
+            let rdata = Array.isArray(res.data.data.records) ? res.data.data.records : []
+            rdata.forEach(r=>{
+                var label = r.code + (r.cnName && r.cnName!=r.code ? " - " + r.cnName : "")
+                r.label = label
+            })
+            this.unitNoData = [{id: 0, code: '', cnName: '', enName: '', label: ''}].concat(rdata)
+            var col = this.findObject(this.option.column, "unitId")
+            if(col) col.dicData = this.unitNoData
+            console.log("getBunitsListfun", this.unitNoData)
+        })
     },
 
     // 获取币别数据
@@ -616,7 +653,6 @@ export default {
           this.$set(this.form, 'elementsEnName', item.enName)
         }
       }
-
     },
 
     // 费用信息选中回调
@@ -640,6 +676,21 @@ export default {
     unitNoCorpChange(value) {
       this.form.unitNo = value
     },
+      unitIdChange(value) {
+          let obj = undefined
+          if (value) {
+              this.unitNoData.map(item => {
+                  if (item.id == value) {
+                      obj = item
+                  }
+              })
+          }
+          this.form.unitId = obj ? obj.id : 0
+          this.form.unitNo = obj ? obj.code : ''
+          this.form.unitCnName = obj ? obj.cnName : ''
+
+          console.log('this.form', this.form)
+      },
     // 币别选中回调
     curNoCorpChange(value) {
       this.form.curNo = value