Browse Source

提交审批流页面

caojunjie 4 years ago
parent
commit
f23ce8ff7e

+ 7 - 0
src/api/finance/charge.js

@@ -77,3 +77,10 @@ export function collectFee(queryParameter) {
     data:queryParameter
   })
 }
+//删除前的判断
+export function delCharge_s(fId) {
+  return request({
+    url: '/finance/charge/queryRemove/' + fId,
+    method: 'delete'
+  })
+}

+ 8 - 0
src/api/finance/payment.js

@@ -68,3 +68,11 @@ export function listCorps(query) {
     params: query
   })
 }
+
+//删除前的判断
+export function delCharge_s(fId) {
+  return request({
+    url: '/finance/payment/queryRemove/' + fId,
+    method: 'delete'
+  })
+}

+ 4 - 2
src/api/system/auditConfiguration.js

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

+ 77 - 34
src/views/finance/charge/index.vue

@@ -137,29 +137,45 @@
           <span v-else-if="scope.row.fBillstatus == '6'">审核完成</span>
         </template>
       </el-table-column>
-
+        <el-table-column label="操作" width="100" align="center" class-name="small-padding fixed-width">
+          <template slot-scope="scope">
+            <el-button
+              size="mini"
+              type="text"
+              icon="el-icon-edit"
+              @click="handleUpdate(scope.row)"
+              v-hasPermi="['finance:charge:edit']"
+              v-if="scope.row.fBillstatus <= 3"
+            >修改
+            </el-button>
+            <el-button
+              size="mini"
+              type="text"
+              icon="el-icon-delete"
+              @click="handleDelete(scope.row)"
+              v-hasPermi="['finance:charge:remove']"
+              v-if="scope.row.fBillstatus <= 3"
+            >删除
+            </el-button>
+            <el-button
+              size="mini"
+              type="text"
+              icon="el-icon-delete"
+              v-if="scope.row.fBillstatus === 6"
+            >查看
+            </el-button>
+            <el-button
+              size="mini"
+              type="text"
+              icon="el-icon-delete"
+              v-if="scope.row.fBillstatus > 3 && scope.row.fBillstatus < 6"
+            >查看审批流
+            </el-button>
+          </template>
+        </el-table-column>
       <!--      <el-table-column label="单据类型" align="center" prop="fBilltype"/>-->
       <!--      <el-table-column label="制单部门" align="center" prop="fDeptid"/>-->
-      <el-table-column label="操作" width="100" align="center" class-name="small-padding fixed-width">
-        <template slot-scope="scope">
-          <el-button
-            size="mini"
-            type="text"
-            icon="el-icon-edit"
-            @click="handleUpdate(scope.row)"
-            v-hasPermi="['finance:charge:edit']"
-          >修改
-          </el-button>
-          <el-button
-            size="mini"
-            type="text"
-            icon="el-icon-delete"
-            @click="handleDelete(scope.row)"
-            v-hasPermi="['finance:charge:remove']"
-          >删除
-          </el-button>
-        </template>
-      </el-table-column>
+
     </el-table>
 
     <pagination
@@ -479,10 +495,11 @@ import {
   addCharge,
   exportCharge,
   search,
-  listCorps
+  listCorps,
+  delCharge_s
 } from '@/api/finance/charge'
 import { listFees } from '@/api/basicdata/fees'
-import print from "print-js"
+import print from 'print-js'
 
 export default {
   name: 'Charge',
@@ -615,25 +632,25 @@ export default {
   methods: {
     //打印功能
     printing() {
-      if(this.increase_s.length !== 0){
+      if (this.increase_s.length !== 0) {
         this.printStatus = true
         this.printObject = this.increase_s
-      }else {
-        this.$message.error('无数据,请检查是否有数据');
+      } else {
+        this.$message.error('无数据,请检查是否有数据')
       }
     },
     //确认打印
     printSomething() {
-      console.log("22222");
+      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}}";
+        '@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",
+        printable: 'print_area2',
+        type: 'html',
         style: style, // 亦可使用引入的外部css;
-        scanStyles: false,
-      });
+        scanStyles: false
+      })
     },
     //关闭打印弹窗
     closePrinting() {
@@ -891,7 +908,7 @@ export default {
         fRemarks: null,
         fAccbilldate: null,
         fDeptid: null
-      },
+      }
         this.resetForm('queryParams')
       this.open = true
       this.title = '添加财务数据主'
@@ -960,7 +977,33 @@ export default {
     /** 删除按钮操作 */
     handleDelete(row) {
       const fIds = row.fId || this.ids
-      this.$confirm('是否确认删除财务数据主编号为"' + fIds + '"的数据项?', '警告', {
+      console.log(fIds)
+      let tips = ''
+      delCharge_s(fIds).then(data => {
+        console.log(data)
+        switch (data.msg) {
+          case '0': {
+            this.$message.error('当前数据已被其他操作员操作请刷新页面')
+            break
+          }
+          case '1': {
+            tips = '当前主表有数据从表无数据是否删除'
+            this.delete_S(fIds, tips)
+            break
+          }
+          case '2': {
+            tips = '当前主表有数据从表有数据是否删除'
+            this.delete_S(fIds, tips)
+            break
+          }
+          default:{
+            return this.$message.error('未知错误,无状态')
+          }
+        }
+      })
+    },
+    delete_S(fIds, tips) {
+      this.$confirm(tips, '警告', {
         confirmButtonText: '确定',
         cancelButtonText: '取消',
         type: 'warning'

+ 1 - 1
src/views/finance/payment/index.vue

@@ -438,7 +438,7 @@ import {
   exportCharge,
   search,
   listCorps
-} from '@/api/finance/charge'
+} from '@/api/finance/payment'
 import { listFees } from '@/api/basicdata/fees'
 import log from '@/views/monitor/job/log'
 

+ 22 - 4
src/views/index.vue

@@ -31,19 +31,19 @@
           <p>调拨</p>
         </div>
       </li>
-      <li>
+      <li @click="jump('/finance/charge')">
         <div>
           <i class="el-icon-wallet" style="font-size: 50px;text-align: center"></i>
           <p>收款</p>
         </div>
       </li>
-      <li>
+      <li @click="jump('/finance/payment')">
         <div>
           <i class="el-icon-money" style="font-size: 50px;text-align: center"></i>
           <p>付款</p>
         </div>
       </li>
-      <li>
+      <li @click="jump('/finance/contrast')">
         <div>
           <i class="el-icon-s-management" style="font-size: 50px;text-align: center"></i>
           <p>对账</p>
@@ -116,21 +116,27 @@
     <el-button type="primary" @click="dialogVisible = false">关 闭</el-button>
   </span>
     </el-dialog>
+    <el-button type="primary" @click="addOrUpdateHandle">点击我</el-button>
+    <!-- 弹窗, 新增 / 修改 -->
+    <add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList" :dataForm="editModel"></add-or-update>
   </div>
 </template>
 
 <script>
 import { listCorps, information, warehouse } from '../../src/api/index'
-
+import AddOrUpdate from '@/views/viewApproval'
+// import AddOrUpdate from '@/views/system/toConfigure/auditPaths-add-or-update'
 export default {
   name: 'index',
   data() {
     return {
+      editModel: {},
       // 版本号
       version: '3.2.1',
       select: '',
       text: '',
       dialogVisible: false,
+      addOrUpdateVisible: false,
       tableData: [{
         date: '2020-11-20 12:00',
         name: '某客户账单审核',
@@ -153,6 +159,9 @@ export default {
       tableDataTwo: []
     }
   },
+  components: {
+    AddOrUpdate
+  },
   mounted() {
 
   },
@@ -162,6 +171,15 @@ export default {
     this.firstinventory()
   },
   methods: {
+    addOrUpdateHandle(){
+      this.addOrUpdateVisible = true
+      this.$nextTick(() => {
+        this.$refs.addOrUpdate.init()
+      })
+    },
+    getDataList(){
+      this.dataListLoading = true
+    },
     bug(res) {
       this.dialogVisible = true
       this.text = res

+ 16 - 14
src/views/system/auditConfiguration/index.vue

@@ -76,15 +76,13 @@
         </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>
+    <pagination
+      v-show="total>0"
+      :total="total"
+      :page.sync="dataForm.pageNum"
+      :limit.sync="dataForm.pageSize"
+      @pagination="getDataList"
+    />
   </div>
 </template>
 
@@ -96,9 +94,10 @@ export default {
       dataForm: {
         branchId: this.$store.state.user.loginContractorId,
         actId: null,
-        current: 1,
-        size: 10
+        pageNum: 1,
+        pageSize: 10,
       },
+      total:0,
       dataList: [],
       optionsBranch: [],
       optionsPathIds: [],
@@ -156,16 +155,19 @@ export default {
   methods: {
     // 获取数据列表
     getDataList () {
-      addCharge().then(data =>{
+      console.log(this.dataForm)
+      addCharge(this.dataForm).then(data =>{
         console.log(data)
         this.dataList = data.auditPathAct
         this.optionsPathIds = data.auditPath
+        this.total = data.count
       })
     },
     // 保存
     save () {
-      console.log(JSON.stringify(this.dataList))
-      preservation().then(data =>{
+      let formData = new window.FormData()
+      formData.append('auditPathsActs', JSON.stringify(this.dataList))
+      preservation(formData).then(data =>{
         console.log(data)
       })
 

+ 51 - 0
src/views/viewApproval.vue

@@ -0,0 +1,51 @@
+<template>
+  <el-dialog
+    title="标题"
+    :close-on-click-modal="false"
+    :before-close="closeDialog"
+    :visible.sync="visible"
+    :modal="false"
+    width="75%">
+    <span slot="footer" class="dialog-footer">
+      <el-button @click="closeDia">取消</el-button>
+      <el-button type="primary" @click="dataFormSubmit()">确定</el-button>
+    </span>
+  </el-dialog>
+</template>
+
+<script>
+import {addCharge,reviewer,modify} from '@/api/system/auditPaths-add-or-update'
+
+export default {
+  data () {
+    return {
+      visible: false,
+    }
+  },
+  methods: {
+    init (val) {
+      this.optionsUsers = []
+      this.visible = true
+      if (typeof val !== 'undefined') {
+        console.log(val)
+        this.queryAuditPath(val)
+      } else {
+      }
+    },
+    // 表单提交
+    dataFormSubmit () {
+
+    },
+    closeDialog (done) {
+      this.visible = false
+      this.$emit('refreshDataList')
+      Object.assign(this.$data, this.$options.data.call(this))
+    },
+    closeDia () {
+      this.visible = false
+      this.$emit('refreshDataList')
+      Object.assign(this.$data, this.$options.data.call(this))
+    }
+  }
+}
+</script>