Browse Source

管理费用添加打印次数与打印时间记录

wangzhuo 2 years ago
parent
commit
faa50b6534
2 changed files with 52 additions and 2 deletions
  1. 10 0
      src/api/costManagement/index.js
  2. 42 2
      src/views/costManagement/index.vue

+ 10 - 0
src/api/costManagement/index.js

@@ -159,3 +159,13 @@ export function queryUserVal(data) {
     data:data
   })
 }
+
+
+// 修改打印次数
+export function setPrintTime(data) {
+  return request({
+    url: '/anpin/management/printTimes',
+    method: 'post',
+    data:data
+  })
+}

+ 42 - 2
src/views/costManagement/index.vue

@@ -140,6 +140,12 @@
           </el-radio-group>
         </div>
         <table class="table table-striped table-bordered" align="center" valign="center">
+
+          <tr>
+            <td colspan="8"></td>
+            <td>打印次数:{{ formList.printTime + 1 }}</td>
+            <td colspan="2">打印日期:{{ formList.printDate }}</td>
+          </tr>
           <tr>
             <td style="font-size: 24px;font-weight:bold" class="column" colspan="11">{{ reverse }}</td>
           </tr>
@@ -249,6 +255,9 @@ import { listDept, treeselect } from '@/api/system/dept'
 import { getliable } from '@/api/project'
 import cUpload from '@/components/cUpload/index.vue'
 
+import { setPrintTime } from '@/api/costManagement/index'
+
+
 export default {
   name: 'index',
   components: {
@@ -384,6 +393,22 @@ export default {
         },
         {
           surface: '11',
+          label: 'printTime',
+          name: '打印次数',
+          checked: 0,
+          width: 200,
+          operation: 1
+        },
+        {
+          surface: '12',
+          label: 'printDate',
+          name: '打印时间',
+          checked: 0,
+          width: 200,
+          operation: 1
+        },
+        {
+          surface: '13',
           label: 'fReviewDate',
           name: '审核日期',
           checked: 0,
@@ -391,7 +416,7 @@ export default {
           operation: 1
         },
         {
-          surface: '12',
+          surface: '14',
           label: 'operation',
           name: '操作',
           checked: 0,
@@ -1425,7 +1450,18 @@ export default {
     },
     //确认打印
     Printing() {
-      this.$print(this.$refs.print)
+      // 添加打印次数
+      let data = {
+        id : this.formList.fId + '',
+        printDate : this.formList.printDate
+      };
+      setPrintTime(data).then(res => {
+        if (res.code === 200) {
+          this.$print(this.$refs.print)
+        } else {
+          this.$message.error('修改打印此处出错');
+        }
+      })
     },
     //返回列表
     backToList() {
@@ -1532,9 +1568,13 @@ export default {
               this.$message.error('未保存,不允许打印')
             } else if (this.$refs.avatar.form.fBillstatus >= 4) {
               this.formList = this.$refs.avatar.form
+              let printDate = new Date();
+              this.formList.printDate = printDate.toLocaleString();
               this.dialogVisible = true
             } else {
               this.formList = this.$refs.avatar.form
+              let printDate = new Date();
+              this.formList.printDate = printDate.toLocaleString();
               this.submitAndSave(1)
             }
           } else {