|
@@ -31,7 +31,7 @@
|
|
|
</div>
|
|
|
|
|
|
<div class="btn_grooup">
|
|
|
- <el-button type="primary" size="mini" @click="xxxx">批量同意</el-button>
|
|
|
+ <el-button type="primary" size="mini" @click="audits">批量审批</el-button>
|
|
|
</div>
|
|
|
|
|
|
<el-table
|
|
@@ -62,7 +62,7 @@
|
|
|
>
|
|
|
<template slot-scope="scope">
|
|
|
<el-button type="text" size="mini" @click="check(scope.row)">查看</el-button>
|
|
|
- <el-button type="text" size="mini" @click="agree(scope.row)">同意</el-button>
|
|
|
+ <el-button type="text" size="mini" @click="audit(scope.row)">审批</el-button>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
@@ -83,7 +83,7 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { getWorkSpaceList } from '@/api/purchase/workSpace.js'
|
|
|
+import { getWorkSpaceList, auditWork } from '@/api/purchase/workSpace.js'
|
|
|
export default {
|
|
|
name: 'workSpace',
|
|
|
dicts: ['oa_templete_id'],
|
|
@@ -97,7 +97,8 @@ export default {
|
|
|
},
|
|
|
loading: false,
|
|
|
tableList: [],
|
|
|
- total: 0
|
|
|
+ total: 0,
|
|
|
+ ids: []
|
|
|
}
|
|
|
},
|
|
|
created() {
|
|
@@ -119,17 +120,61 @@ export default {
|
|
|
searchList() {
|
|
|
this.getList(this.queryParams)
|
|
|
},
|
|
|
- resetList() {},
|
|
|
- handleSelectionChange() {},
|
|
|
- rowSelect() {},
|
|
|
- doubleClick() {},
|
|
|
- xxxx() {},
|
|
|
+ resetList() {
|
|
|
+ this.queryParams = {
|
|
|
+ modelIds:[],
|
|
|
+ docSubject: '',
|
|
|
+ pageNum: 1,
|
|
|
+ pageSize: 20
|
|
|
+ }
|
|
|
+ this.searchList()
|
|
|
+ },
|
|
|
+ handleSelectionChange(selection) {
|
|
|
+ console.log('选中', selection)
|
|
|
+ this.ids = selection
|
|
|
+ // console.log('选中数组', this.ids.join())
|
|
|
+ },
|
|
|
+ rowSelect(row) {
|
|
|
+ this.$refs.tables.toggleRowSelection(row);
|
|
|
+ },
|
|
|
+ doubleClick(row) {
|
|
|
+ this.check(row)
|
|
|
+ },
|
|
|
+ audits() {
|
|
|
+ if(this.ids.length == 0) {
|
|
|
+ this.$modal.notifyWarning("请选中至少一条数据");
|
|
|
+ } else {
|
|
|
+ this.$modal.confirm('确认审批选中单据?').then(() => {
|
|
|
+ this.$modal.loading("审批中...");
|
|
|
+ auditWork(this.ids).then(res => {
|
|
|
+ if (res.code === 200) {
|
|
|
+ this.$modal.closeLoading();
|
|
|
+ this.$modal.notifySuccess("审批成功");
|
|
|
+ this.searchList()
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }).catch(() => {
|
|
|
+ this.$modal.closeLoading();
|
|
|
+ this.searchList()
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
check(row) {
|
|
|
console.log(row)
|
|
|
this.$router.push({path: row.linkUrl ,query: {billCode: row.billCode}})
|
|
|
},
|
|
|
- agree(row) {
|
|
|
-
|
|
|
+ audit(row) {
|
|
|
+ this.$modal.loading("审批中...");
|
|
|
+ auditWork([row]).then(res => {
|
|
|
+ if(res.code === 200) {
|
|
|
+ this.$modal.closeLoading();
|
|
|
+ this.$modal.notifySuccess("审批成功");
|
|
|
+ this.searchList()
|
|
|
+ }
|
|
|
+ }).catch(() => {
|
|
|
+ this.$modal.closeLoading();
|
|
|
+ this.searchList()
|
|
|
+ })
|
|
|
},
|
|
|
handleSizeChange(val) {
|
|
|
this.queryParams.pageSize = val
|