Эх сурвалжийг харах

打印日志 打印统计

ymy 1 жил өмнө
parent
commit
b85175b1bd

+ 1 - 1
src/api/login.ts

@@ -1,5 +1,5 @@
 import request from '@/benyun/utils/request'
-
+import store from '@/store/index'
 // 登录方法
 export function login(username : string, password : string, code : string, uuid : string, tenantId : any) {
 	return request({

+ 1 - 0
src/api/print.ts

@@ -18,6 +18,7 @@ export function preview(data:any){
 		url: '/print/preview',
 		method: 'POST',
     data:data,
+    responseType:'blob',
     headers:{
       'Print-User':'admin'
     }

+ 1 - 1
src/benyun/compVue/ModuleViewHandle.ts

@@ -123,7 +123,7 @@ export default class ModuleViewHandle extends VueViews{
   }
   //重置
   resertHandle(){
-    (this.$refs[this.searchID] as any).setValue({});
+    (this.$refs[this.searchID] as any).clearValue({});
     (this.$refs[this.tableID] as any).setPage({pageNo:1,total:0})
     this.$emit('resert')
     // this.getList();

+ 1 - 1
src/benyun/components/byInput/byInput.vue

@@ -84,7 +84,7 @@ export default class ByInput extends VueViews {
 
   // 清空数据
   clearValue(){
-    this.value = ''
+    this.value = '';
   }
 
   onChange(){

+ 4 - 4
src/benyun/plugins/componentRegister.ts

@@ -55,10 +55,10 @@ const comps: Array<ComBase> = [
     name: "textChange",
     component: () => import("@/benyun/components/textChange/textChange.vue"),
   },
-  {
-    name: "byMonacoEditor",
-    component: () => import("@/benyun/components/byMonacoEditor/byMonacoEditor.vue"),
-  },
+  // {
+  //   name: "byMonacoEditor",
+  //   component: () => import("@/benyun/components/byMonacoEditor/byMonacoEditor.vue"),
+  // },
 ];
 
 const install = function (Vue: any) {

+ 15 - 3
src/components/userModal/userModal.vue

@@ -1,6 +1,6 @@
 <template>
   <div>
-    <el-input placeholder="请选择标签" :value="userValue.userName" @clear="clearValue" size="small" class="myinpuy-with-select" clearable>
+    <el-input :placeholder="attrs.placeholder" :value="userValue.userName" @clear="clearValue" size="small" class="myinpuy-with-select" clearable>
       <el-button slot="append" icon="el-icon-more" @click="value = true"></el-button>
     </el-input>
     <vxe-modal v-model="value" id="userDialogModal" v-loading="load" width="900px" height="80%" @show="show" show-zoom resize transfer show-footer>
@@ -23,8 +23,9 @@
 <script lang="ts">
 import { Component, Prop, Vue, Watch } from "vue-property-decorator";
 import { listUser } from '@/api/system/user'
+import VueViews from '@/benyun/compVue/VueViews'
 @Component
-export default class UserModal extends Vue {
+export default class UserModal extends VueViews {
   value=false;
   load=false;
   isSearch=false
@@ -107,6 +108,11 @@ export default class UserModal extends Vue {
       }]
     }
   }
+
+  @Watch('propValue')
+  propValueChange(v:any){
+    this.setValue(v);
+  }
   mounted(){
     
   }
@@ -182,9 +188,15 @@ export default class UserModal extends Vue {
   onChange(){
     this.$emit('onChange',this.userValue);
   }
+  setValue(v:any){
+    this.userValue.userName = v;
+    if(this.parentValue){
+      this.userValue.userId = this.parentValue.userId;
+    }
+  }
   // 清空数据
   clearValue(){
-    this.userValue = {}
+    this.userValue = {};
   }
 }
 </script>

+ 0 - 129
src/views/index2.vue

@@ -1,129 +0,0 @@
-<template>
-  <div class="app-container home">
-    <el-row :gutter="20">
-      <el-col :sm="24" :lg="12" style="padding-left: 20px">
-        <h2>SaaS协同平台</h2>
-        <p>
-          <b>当前版本:</b> <span>v{{ version }}</span>
-        </p>
-      </el-col>
-
-      <el-col :sm="24" :lg="12" style="padding-left: 50px">
-        <el-row>
-          <el-col :span="12">
-            <h2>技术选型</h2>
-          </el-col>
-        </el-row>
-        <el-row>
-          <el-col :span="6">
-            <h4>后端技术</h4>
-            <ul>
-              <li>SpringBoot</li>
-              <li>SpringCloud</li>
-              <li>Nacos</li>
-              <li>Sentinel</li>
-              <li>Seata</li>
-              <li>Minio</li>
-              <li>...</li>
-            </ul>
-          </el-col>
-          <el-col :span="6">
-            <h4>前端技术</h4>
-            <ul>
-              <li>Vue</li>
-              <li>Vuex</li>
-              <li>Element-ui</li>
-              <li>Axios</li>
-              <li>Echarts</li>
-              <li>Quill</li>
-              <li>...</li>
-            </ul>
-          </el-col>
-        </el-row>
-      </el-col>
-    </el-row>
-    <el-divider />
-  </div>
-</template>
-
-<script>
-export default {
-  name: "Index",
-  data() {
-    return {
-      // 版本号
-      version: "3.5.0",
-    };
-  },
-  methods: {
-    goTarget(href) {
-      window.open(href, "_blank");
-    },
-  },
-};
-</script>
-
-<style scoped lang="scss">
-.home {
-  blockquote {
-    padding: 10px 20px;
-    margin: 0 0 20px;
-    font-size: 17.5px;
-    border-left: 5px solid #eee;
-  }
-  hr {
-    margin-top: 20px;
-    margin-bottom: 20px;
-    border: 0;
-    border-top: 1px solid #eee;
-  }
-  .col-item {
-    margin-bottom: 20px;
-  }
-
-  ul {
-    padding: 0;
-    margin: 0;
-  }
-
-  font-family: "open sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
-  font-size: 13px;
-  color: #676a6c;
-  overflow-x: hidden;
-
-  ul {
-    list-style-type: none;
-  }
-
-  h4 {
-    margin-top: 0px;
-  }
-
-  h2 {
-    margin-top: 10px;
-    font-size: 26px;
-    font-weight: 100;
-  }
-
-  p {
-    margin-top: 10px;
-
-    b {
-      font-weight: 700;
-    }
-  }
-
-  .update-log {
-    ol {
-      display: block;
-      list-style-type: decimal;
-      margin-block-start: 1em;
-      margin-block-end: 1em;
-      margin-inline-start: 0;
-      margin-inline-end: 0;
-      padding-inline-start: 40px;
-    }
-  }
-}
-</style>
-

+ 1 - 1
src/views/oms/orderPay/components/tag.vue

@@ -8,7 +8,7 @@
 <script lang="ts">
 import { Component, Prop, Vue, Watch } from "vue-property-decorator";
 @Component
-export default class ShopTag extends Vue {
+export default class PayTag extends Vue {
   value:any=null;
 
   @Prop()

+ 8 - 7
src/views/print/printCount/index.vue

@@ -34,17 +34,15 @@ export default class PrintCount extends Vue {
         },{
           span:8,
           label:'外部用户标识',
-          prop:'userId',
-          component:'user-modal',
+          prop:'userName',
+          component:'user-modal'
         }]
       ]
     },
     tool:{
       tools:{
         search:true,
-        refresh:true,
-        add:true,
-        delete:true
+        refresh:true
       }
     },
     table:{
@@ -55,7 +53,7 @@ export default class PrintCount extends Vue {
       },
       columns:[{
         title:'外部用户标识',
-        field:'userId',
+        field:'userName',
         width:130
       },{
         title:'模板名称',
@@ -67,10 +65,13 @@ export default class PrintCount extends Vue {
       },{
         title:'最后一次打印时间',
         field:'lastTime',
-        width:150
+        width:160
       }]
     }
   }
+  mounted(){
+    this.getList();
+  }
   //分页
   pagination(){
     if(this.isSearch){

+ 40 - 0
src/views/print/printLog/components/successTag.vue

@@ -0,0 +1,40 @@
+<template>
+  <el-tag type="success" v-if="value == 1" size="mini">成功</el-tag>
+  <el-tag type="danger" v-else size="mini">失败</el-tag>
+</template>
+
+<script lang="ts">
+import { Component, Prop, Vue, Watch } from "vue-property-decorator";
+@Component
+export default class SuccessTag extends Vue {
+  value:any=null;
+
+  @Prop()
+  propConfig: any
+
+  @Prop()
+  propValue?:any
+
+  @Prop()
+  parentValue:any
+
+  @Watch('propValue')
+  propValueChange(v:any){
+    this.setValue(v);
+  }
+
+  mounted(){
+    if(this.propValue){
+      this.setValue(this.propValue)
+    }
+  }
+
+  setValue(v:any){
+    this.value = v;
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+
+</style>

+ 11 - 8
src/views/print/printLog/index.vue

@@ -5,8 +5,9 @@
 </template>
 
 <script lang="ts">
-  import { Component, Prop, Vue, Watch } from "vue-property-decorator";
+import { Component, Prop, Vue, Watch } from "vue-property-decorator";
 import { query} from '@/api/printLog'
+import SuccessTag from "./components/successTag.vue";
 @Component({components:{}})
 export default class PrintLog extends Vue {
   load=false;
@@ -33,18 +34,16 @@ export default class PrintLog extends Vue {
           }
         },{
           span:8,
-          label:'打印时间',
-          prop:'printTime',
-          component:'user-modal',
+          label:'外部用户标识',
+          prop:'userId',
+          component:'user-modal'
         }]
       ]
     },
     tool:{
       tools:{
         search:true,
-        refresh:true,
-        add:true,
-        delete:true
+        refresh:true
       }
     },
     table:{
@@ -71,10 +70,14 @@ export default class PrintLog extends Vue {
       },{
         title:'输出是否成功',
         field:'success',
-        width:120
+        width:120,
+        component:SuccessTag
       }]
     }
   }
+  mounted(){
+    this.getList();
+  }
   //分页
   pagination(){
     if(this.isSearch){

+ 26 - 4
src/views/print/printPermission/index.vue

@@ -109,12 +109,21 @@ export default class PrintPermission extends Vue {
       form:{
         attr:{
           size:'small',
-          width:'900px',
+          width:'800px',
           labelWidth:'150px',
           rules:{
-            templateName:[
+            userName:[
               { required: true, message: '模版名称不能为空!', trigger: 'blur' }
             ],
+            role:[
+              {required: true, message: '角色不能为空!', trigger: 'change'}
+            ],
+            customPermission:[
+              {required: true, message: '自定义权限不能为空!', trigger: 'change'}
+            ],
+            customLimit:[
+              {required: true, message: '自定义打印次数限制不能为空!', trigger: 'blur'}
+            ]
           }
         },
         columns:[
@@ -149,10 +158,23 @@ export default class PrintPermission extends Vue {
           [{
             label:'自定义权限',
             prop:'customPermission',
-            component:'by-input',
+            component:'by-select',
             compConfig:{
               attr:{
-                clearable:true
+                clearable:true,
+                data:[{
+                  label:'新增模板',
+                  value:'add'
+                },{
+                  label:'编辑模板',
+                  value:'edit'
+                },{
+                  label:'删除模板',
+                  value:'del'
+                },{
+                  label:'打印模板',
+                  value:'print'
+                }]
               }
             }
           }],

+ 10 - 2
src/views/print/printTemplate/index.vue

@@ -8,6 +8,8 @@
 <script lang="ts">
 import { Component, Prop, Vue, Watch } from "vue-property-decorator";
 import {query,add,update,del} from '@/api/printTemplate'
+import byMonacoEditor  from '@/benyun/components/byMonacoEditor/byMonacoEditor.vue'
+
 import {preview} from '@/api/print'
 @Component({components:{}})
 export default class PrintTemplate extends Vue {
@@ -187,7 +189,7 @@ export default class PrintTemplate extends Vue {
           [{
             label:'模板内容',
             prop:'templateHtml',
-            component:'byMonacoEditor',
+            component:byMonacoEditor,
           }],
           [{
             label:'示例数据',
@@ -233,7 +235,13 @@ export default class PrintTemplate extends Vue {
       outType:'PDF'
     }).then((res:any) => {
       this.load=false;
-      (window as any).open(res);
+      const blob = new Blob([res],{
+        type: "application/pdf;chartset=UTF-8"
+      })
+      const qrUrl:any =(window as any).URL.createObjectURL(blob);
+      (window as any).open(qrUrl);
+      // const myWindow =(window as any).open(qrUrl);
+      // myWindow.print();
 
     }).catch((err:any)=>{
       this.load=false;