Browse Source

收费页面新增打印页面

caojunjie 4 năm trước cách đây
mục cha
commit
0cf1b87bd8

+ 16 - 0
src/api/system/auditConfiguration.js

@@ -0,0 +1,16 @@
+import request from '@/utils/request'
+// 查询审批
+export function addCharge() {
+  return request({
+    url: 'warehouse/pathsActs/auditPathslist',
+    method: 'get',
+  })
+}
+// 保存配置
+export function preservation(data) {
+  return request({
+    url: '/finance/charge/add',
+    method: 'post',
+    data: data
+  })
+}

+ 157 - 82
src/views/finance/charge/index.vue

@@ -53,7 +53,8 @@
             v-for="item in options"
             :key="item.value"
             :label="item.dictLabel"
-            :value="item.dictValue">
+            :value="item.dictValue"
+          >
           </el-option>
         </el-select>
       </el-form-item>
@@ -235,7 +236,7 @@
         <el-button type="warning" size="small" @click="charGe">收费</el-button>
         <el-button type="primary" size="small" @click="confirmCharge">确认收费</el-button>
         <el-button type="success" size="small">导出</el-button>
-        <el-button type="info" size="small">打印</el-button>
+        <el-button type="info" size="small" @click="printing">打印</el-button>
         <el-button type="danger" size="small">删除</el-button>
       </div>
       <el-table v-loading="loading" :data="increase_s" @selection-change="handleSelectionChange_s">
@@ -246,7 +247,7 @@
         <el-table-column label="品名" align="center" prop="fProductName"/>
         <el-table-column label="业务日期" align="center" prop="fBsdate">
           <template slot-scope="scope">
-            <span>{{scope.row.fBsdate.slice(0,10)}}</span>
+            <span>{{ scope.row.fBsdate.slice(0, 10) }}</span>
           </template>
         </el-table-column>
         <el-table-column label="费用名称" align="center" prop="fFeeName"/>
@@ -261,7 +262,7 @@
             <span v-if="scope.row.fBilltype =='SJRK'">入库</span>
 
             <span v-else-if="scope.row.fBilltype == 'SJCK'">出库</span>
-            <span v-else>{{scope.row.fBilltype}}</span>
+            <span v-else>{{ scope.row.fBilltype }}</span>
           </template>
         </el-table-column>
         <el-table-column label="金额" align="center" prop="fAmtdr"/>
@@ -378,7 +379,9 @@
             <el-button icon="el-icon-refresh" size="mini" @click="resetQuery_s">重置</el-button>
           </el-form-item>
         </el-form>
-        <el-table v-loading="loading" :data="chargeList_s" ref="chargeList" show-summary :summary-method="getSummaries" @selection-change="handleSelectionChange_s">
+        <el-table v-loading="loading" :data="chargeList_s" ref="chargeList" show-summary :summary-method="getSummaries"
+                  @selection-change="handleSelectionChange_s"
+        >
           <el-table-column type="selection" width="55" align="center"/>
           <el-table-column label="序号" type="index" width="55" align="center"/>
           <el-table-column label="货权方" align="center" prop="fName"/>
@@ -389,7 +392,7 @@
             <template slot-scope="scope">
               <span v-if="scope.row.fBilltype =='SJRK'">入库</span>
               <span v-else-if="scope.row.fBilltype == 'SJCK'">出库</span>
-              <span v-else>{{scope.row.fBilltype}}</span>
+              <span v-else>{{ scope.row.fBilltype }}</span>
             </template>
           </el-table-column>
           <el-table-column label="审核日期" align="center" prop="fReviewDate"/>
@@ -424,7 +427,46 @@
         </div>
       </el-dialog>
     </el-dialog>
+    <el-dialog
+      :visible.sync="printStatus"
+      width="80%"
+      :before-close="closePrinting"
+    >
+      <el-table id="print_area2" v-loading="loading" :data="printObject" @selection-change="handleSelectionChange_s">
+        <!-- <el-table-column type="selection" width="55" align="center"/> -->
+        <el-table-column label="序号" type="index" width="55" align="center"/>
+        <el-table-column label="提单号" align="center" prop="fMblno"/>
+        <el-table-column label="存货单号" align="center" prop="fBscorpno"/>
+        <el-table-column label="品名" align="center" prop="fProductName"/>
+        <el-table-column label="业务日期" align="center" prop="fBsdate">
+          <template slot-scope="scope">
+            <span>{{ scope.row.fBsdate.slice(0, 10) }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column label="费用名称" align="center" prop="fFeeName"/>
+        <el-table-column label="收/付" align="center" prop="fSrcdc">
+          <template slot-scope="scope">
+            <span v-if="scope.row.fSrcdc =='D'">收</span>
+            <span v-else-if="scope.row.fSrcdc =='C'">付</span>
+          </template>
+        </el-table-column>
+        <el-table-column label="业务类型" align="center" prop="fBilltype">
+          <template slot-scope="scope">
+            <span v-if="scope.row.fBilltype =='SJRK'">入库</span>
 
+            <span v-else-if="scope.row.fBilltype == 'SJCK'">出库</span>
+            <span v-else>{{ scope.row.fBilltype }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column label="金额" align="center" prop="fAmtdr"/>
+        <el-table-column label="本次金额" align="center" prop="fAmt"/>
+        <el-table-column label="备注" align="center" prop="fRemarks"/>
+      </el-table>
+      <span slot="footer" class="dialog-footer">
+    <el-button @click="printStatus = false">取 消</el-button>
+    <el-button type="primary" @click="printSomething">确 定</el-button>
+  </span>
+    </el-dialog>
   </div>
 </template>
 
@@ -435,13 +477,12 @@ import {
   getCharge,
   delCharge,
   addCharge,
-  updateCharge,
   exportCharge,
   search,
   listCorps
 } from '@/api/finance/charge'
 import { listFees } from '@/api/basicdata/fees'
-import log from '@/views/monitor/job/log'
+import print from "print-js"
 
 export default {
   name: 'Charge',
@@ -449,11 +490,14 @@ export default {
   data() {
     return {
       browseStatus: true,
-      nothing:[],
+      nothing: [],
+      //打印表
+      printObject: [],
+      printStatus: false,
       //导入状态
-      state_s: true ,
+      state_s: true,
       fWbuOptions: [],
-      options:'',
+      options: '',
       // 遮罩层
       loading: true,
       //打开内部弹窗
@@ -472,7 +516,7 @@ export default {
       // 总条数
       total: 0,
       //提单号暂存
-      fMblno:'',
+      fMblno: '',
       // 财务数据主表格数据
       chargeList: [],
       // 弹出层标题
@@ -490,13 +534,13 @@ export default {
         timeExamine: '',
         timeInterval: ''
       },
-      empty:[],
+      empty: [],
       //导入从表传主表
-      pass:{
-        fAmtdr:'',    //应收合计
-        fAmtcr:'',    //应付合计
-        fMblno:'',    //提单号
-        fName:''      //货权方
+      pass: {
+        fAmtdr: '',    //应收合计
+        fAmtcr: '',    //应付合计
+        fMblno: '',    //提单号
+        fName: ''      //货权方
       },
       // 查询参数
       queryParams: {
@@ -569,45 +613,76 @@ export default {
     this.getList()
   },
   methods: {
+    //打印功能
+    printing() {
+      if(this.increase_s.length !== 0){
+        this.printStatus = true
+        this.printObject = this.increase_s
+      }else {
+        this.$message.error('无数据,请检查是否有数据');
+      }
+    },
+    //确认打印
+    printSomething() {
+      console.log("22222");
+      // 此处的style即为打印时的样式
+      const style =
+        "@media print { .print-div{ padding:8px;background-color:#cccccc;line-height:12px } .red{ color:#f00} .green{color:green} td{text-align: center}}";
+      print({
+        printable: "print_area2",
+        type: "html",
+        style: style, // 亦可使用引入的外部css;
+        scanStyles: false,
+      });
+    },
+    //关闭打印弹窗
+    closePrinting() {
+      this.$confirm('确认关闭?')
+        .then(_ => {
+        })
+        .catch(_ => {
+
+        })
+    },
     // 确认收费
     confirmCharge() {
       this.queryParams.fBillstatus = '4'
       let formDate = new window.FormData()
-        formDate.append('tFee',JSON.stringify(this.queryParams))
-        formDate.append("tFeeDo", JSON.stringify(this.increase_s))
+      formDate.append('tFee', JSON.stringify(this.queryParams))
+      formDate.append('tFeeDo', JSON.stringify(this.increase_s))
 
-        collectFee(formDate).then(response=>{
-          console.log(response)
-          this.msgSuccess("操作成功")
-        })
-        this.open = false
+      collectFee(formDate).then(response => {
+        console.log(response)
+        this.msgSuccess('操作成功')
+      })
+      this.open = false
     },
-    charGe(){
+    charGe() {
       this.queryParameter.fToCorpid = this.queryParams.fCorpid
       this.innerVisible = true
     },
     getSummaries(param) {
-      const { columns, data } = param;
-      const sums = [];
+      const { columns, data } = param
+      const sums = []
       columns.forEach((column, index) => {
-        const values = data.map(item => Number(item[column.property]));
+        const values = data.map(item => Number(item[column.property]))
         if (!values.every(value => isNaN(value))) {
           sums[index] = values.reduce((prev, curr) => {
-            const value = Number(curr);
+            const value = Number(curr)
             if (!isNaN(value)) {
-              return prev + curr;
+              return prev + curr
             } else {
-              return prev;
+              return prev
             }
-          }, 0);
-          sums[0] = '合计';
-          sums[3] = '';
+          }, 0)
+          sums[0] = '合计'
+          sums[3] = ''
         }
-      });
-      return sums;
+      })
+      return sums
     },
-    imgChangeI(row){
-      if (row.fAmt && Number(row.fAmt) > Number(row.fAmtdr)){
+    imgChangeI(row) {
+      if (row.fAmt && Number(row.fAmt) > Number(row.fAmtdr)) {
         this.$set(row, 'fAmt', row.fAmtdr)
         this.state_s = true
       }
@@ -642,17 +717,17 @@ export default {
           this.nothing = new Set(this.nothing)
           this.nothing = Array.from(this.nothing)
 
-          if(this.empty.length <= 1){
+          if (this.empty.length <= 1) {
             this.pass.fMblno = this.empty[0]
             console.log(this.pass.fMblno)
-          }else {
-            this.pass.fMblno = this.empty[0] + "..."
+          } else {
+            this.pass.fMblno = this.empty[0] + '...'
             console.log(this.pass.fMblno)
           }
-          if (this.nothing.length <= 1){
+          if (this.nothing.length <= 1) {
             this.pass.fName = this.nothing[0]
-          }else {
-            this.pass.fName = this.nothing[0] + "..."
+          } else {
+            this.pass.fName = this.nothing[0] + '...'
           }
 
           this.increase_s = this.selection
@@ -681,9 +756,9 @@ export default {
     /** 查询财务数据主列表 */
     getList() {
       this.loading = true
-      this.getDicts("approval_process").then((response) => {
+      this.getDicts('approval_process').then((response) => {
         this.options = response.data
-      });
+      })
       listCharge(this.queryParams_s).then(response => {
         console.log(response)
         this.chargeList = response.rows
@@ -792,32 +867,32 @@ export default {
     /** 新增按钮操作 */
     handleAdd() {
       this.reset()
-      this.pass={
-        fAmtdr:'',    //应收合计
-        fAmtcr:'',    //应付合计
-        fMblno:'',    //提单号
-        fName:'',      //货权方
-        fFeesName:'',   //结算单位
-        fCorpid:''     //结算单位ID
+      this.pass = {
+        fAmtdr: '',    //应收合计
+        fAmtcr: '',    //应付合计
+        fMblno: '',    //提单号
+        fName: '',      //货权方
+        fFeesName: '',   //结算单位
+        fCorpid: ''     //结算单位ID
       },
-      // this.queryParams = []
-      this.increase_s = []
+        // this.queryParams = []
+        this.increase_s = []
       this.queryParams = {
         pageNum: 1,
-          pageSize: 10,
-          fBillno: null,
-          fCtrlcorpid: null,
-          fCorpid: null,
-          tMblno: null,
-          fAmtdr: null,
-          fAmtcr: null,
-          fBilltype: null,
-          fBillstatus: null,
-          fRemarks: null,
-          fAccbilldate: null,
-          fDeptid: null
+        pageSize: 10,
+        fBillno: null,
+        fCtrlcorpid: null,
+        fCorpid: null,
+        tMblno: null,
+        fAmtdr: null,
+        fAmtcr: null,
+        fBilltype: null,
+        fBillstatus: null,
+        fRemarks: null,
+        fAccbilldate: null,
+        fDeptid: null
       },
-      this.resetForm('queryParams')
+        this.resetForm('queryParams')
       this.open = true
       this.title = '添加财务数据主'
     },
@@ -825,13 +900,13 @@ export default {
     handleUpdate(row) {
       console.log(row)
       this.reset()
-      this.pass={
-        fAmtdr:'',    //应收合计
-        fAmtcr:'',    //应付合计
-        fMblno:'',    //提单号
-        fName:'',      //货权方
-        fFeesName:'',   //结算单位
-        fCorpid:''     //结算单位ID
+      this.pass = {
+        fAmtdr: '',    //应收合计
+        fAmtcr: '',    //应付合计
+        fMblno: '',    //提单号
+        fName: '',      //货权方
+        fFeesName: '',   //结算单位
+        fCorpid: ''     //结算单位ID
       }
       const fId = row.fId || this.ids
       console.log(fId)
@@ -852,7 +927,7 @@ export default {
       this.$refs['ruless'].validate(valid => {
         console.log(valid)
         if (valid) {
-          if(this.queryParams.fId == null){
+          if (this.queryParams.fId == null) {
             console.log(this.queryParams)
             // this.chargeList.fBillstatus = '1'
             this.queryParams.fBillstatus = '1'
@@ -865,7 +940,7 @@ export default {
               this.open = false
               this.getList()
             })
-          }else {
+          } else {
             console.log(this.queryParams)
             // this.chargeList.fBillstatus = '1'
             this.queryParams.fBillstatus = '1'
@@ -913,17 +988,17 @@ export default {
     deleteRow(index, rows) {
       this.queryParams.fAmtcr = 0
       this.queryParams.fAmtdr = 0
-      rows.splice(index, 1);
-      for(let item in this.increase_s) {
+      rows.splice(index, 1)
+      for (let item in this.increase_s) {
         console.log(this.increase_s[item])
         this.queryParams.fAmtcr += this.increase_s[item].fAmt
         this.queryParams.fAmtdr += this.increase_s[item].fAmtdr
-        
+
       }
       console.log(this.queryParams.fAmtdr)
       console.log(this.queryParams.fAmtcr)
 
-    },
+    }
   }
 }
 </script>

+ 210 - 0
src/views/system/auditConfiguration/index.vue

@@ -0,0 +1,210 @@
+<template>
+  <div class="app-container">
+    <el-form inline :model="dataForm">
+      <el-form-item>
+        <el-select v-model="dataForm.actId" placeholder="请选择活动名" filterable @change="getDataList()">
+          <el-option
+            v-for="item in actList"
+            :key="item.actId"
+            :label="item.name"
+            :value="item.actId">
+          </el-option>
+        </el-select>
+      </el-form-item>
+      <el-form-item>
+        <el-button icon="el-icon-refresh-left" @click="resetSearch">重置</el-button>
+      </el-form-item>
+      <el-form-item>
+        <el-button @click="save" style="float: right">保存</el-button>
+      </el-form-item>
+    </el-form>
+    <el-table :data="dataList" border v-loading="dataListLoading" style="width: 100%;">
+      <el-table-column
+        prop="branName"
+        header-align="center"
+        align="center"
+        label="承包单位"
+        v-if="loginContractorId === 1">
+      </el-table-column>
+      <el-table-column
+        prop="actId"
+        header-align="center"
+        align="center"
+        width="400"
+        label="活动名">
+        <template slot-scope="scope">
+          <span v-if="scope.row.actId === 110">入库</span>
+          <span v-if="scope.row.actId === 120">出库</span>
+          <span v-if="scope.row.actId === 130">货转</span>
+          <span v-if="scope.row.actId === 140">调拨</span>
+          <span v-if="scope.row.actId === 210">对账</span>
+          <span v-if="scope.row.actId === 220">收费</span>
+          <span v-if="scope.row.actId === 230">付费</span>
+          <span v-if="scope.row.actId === 310">仓储费</span>
+          <span v-if="scope.row.actId === 320">计划费</span>
+        </template>
+      </el-table-column>
+      <el-table-column
+        prop="reviewConditions"
+        header-align="center"
+        align="center"
+        width="250"
+        label="审核条件">
+        <template slot-scope="scope">
+          <span v-if="scope.row.reviewConditions === 'O'">
+            正常流程
+          </span>
+          <span v-if="scope.row.reviewConditions === 'I'">
+            非正常流程
+          </span>
+        </template>
+      </el-table-column>
+      <el-table-column
+        prop="pathId"
+        header-align="center"
+        align="center"
+        label="审核路径">
+        <template slot-scope="scope">
+          <el-select v-model="scope.row.pathId" placeholder="审核路径" filterable style="width: 100%">
+            <el-option
+              v-for="item in optionsPathIds"
+              :key="item.id"
+              :label="item.pathName"
+              :value="item.id">
+            </el-option>
+          </el-select>
+        </template>
+      </el-table-column>
+    </el-table>
+    <el-pagination
+      @size-change="sizeChangeHandle"
+      @current-change="currentChangeHandle"
+      :current-page="dataForm.current"
+      :page-sizes="[10, 20, 50, 100]"
+      :page-size="dataForm.size"
+      :total="totalPage"
+      layout="total, sizes, prev, pager, next, jumper">
+    </el-pagination>
+  </div>
+</template>
+
+<script>
+import {addCharge,preservation} from '@/api/system/auditConfiguration'
+export default {
+  data () {
+    return {
+      dataForm: {
+        branchId: this.$store.state.user.loginContractorId,
+        actId: null,
+        current: 1,
+        size: 10
+      },
+      dataList: [],
+      optionsBranch: [],
+      optionsPathIds: [],
+      dataListLoading: false,
+      loginContractorId: null,
+      totalPage: 0,
+      actList: [{
+        name: '入库', actId: 110
+      },{
+        name: '出库', actId: 120
+      },{
+        name: '货转', actId: 130
+      },{
+        name: '调拨', actId: 140
+      },{
+        name: '对账', actId: 210
+      },{
+        name: '收费', actId: 220
+      },{
+        name: '付费', actId: 230
+      },{
+        name: '仓储费', actId: 310
+      },{
+        name: '计划费', actId: 320
+      }
+      ]
+    }
+  },
+  activated () {
+
+    // this.$http({
+    //   url: this.$http.adornUrl('/sys/user/getLoginContractorId'),
+    //   method: 'post'
+    // }).then(({data}) => {
+    //   this.loginContractorId = data.loginContractorId
+    //   this.$set(this.dataForm, 'branchId', data.loginContractorId)
+    // })
+
+
+    // this.$http({
+    //   url: this.$http.adornUrl('/engineering/bbranchs/selectBranchs'),
+    //   method: 'post',
+    //   data: ({postAddr: 'audit'})
+    // }).then(({data}) => {
+    //   if (typeof data.list !== 'undefined' && data.list !== null) {
+    //     if (typeof data.list.branchs !== 'undefined' && data.list.branchs !== null) {
+    //       this.optionsBranch = data.list.branchs
+    //     }
+    //   }
+    // })
+    this.$nextTick(function () {
+      this.getDataList()
+    })
+  },
+  methods: {
+    // 获取数据列表
+    getDataList () {
+      addCharge().then(data =>{
+        console.log(data)
+        this.dataList = data.auditPathAct
+        this.optionsPathIds = data.auditPath
+      })
+    },
+    // 保存
+    save () {
+      console.log(JSON.stringify(this.dataList))
+      preservation().then(data =>{
+        console.log(data)
+      })
+
+      // this.$http({
+      //   url: this.$http.adornUrl('/engineering/auditPaths/saveAuditPathAct'),
+      //   method: 'post',
+      //   data: (JSON.stringify(this.dataList))
+      // }).then(({data}) => {
+      //   if (data && data.code === 0) {
+      //     this.$message({
+      //       message: '操作成功',
+      //       type: 'success',
+      //       duration: 600,
+      //       onClose: () => {
+      //         this.getDataList()
+      //       }
+      //     })
+      //   } else {
+      //     this.$message.error(data.msg)
+      //   }
+      // })
+    },
+    // 每页数
+    sizeChangeHandle (val) {
+      this.dataForm.size = val
+      this.dataForm.current = 1
+      this.getDataList()
+    },
+    // 当前页
+    currentChangeHandle (val) {
+      this.dataForm.current = val
+      this.getDataList()
+    },
+    resetSearch () {
+      this.dataForm.actId = null
+      this.dataForm.current = 1
+      this.dataForm.size = 10
+      this.getDataList()
+    }
+  }
+}
+</script>

+ 2 - 2
vue.config.js

@@ -34,8 +34,8 @@ module.exports = {
     proxy: {
       // detail: https://cli.vuejs.org/config/#devserver-proxy
       [process.env.VUE_APP_BASE_API]: {
-        target: `http://localhost:9010`,
-        //  target: `http://engineering.echepei.com:9010/`,
+        // target: `http://192.168.137.1:9010`,
+         target: `http://engineering.echepei.com:9010/`,
         changeOrigin: true,
         pathRewrite: {
           ['^' + process.env.VUE_APP_BASE_API]: ''