123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297 |
- <template>
- <basic-container>
- <avue-crud :option="option"
- :data="dataList"
- ref="crud"
- v-model="form"
- :page.sync="page"
- :search.sync="search"
- :table-loading="loading"
- @search-change="searchChange"
- @search-reset="searchReset"
- @selection-change="selectionChange"
- @current-change="currentChange"
- @size-change="sizeChange"
- @refresh-change="refreshChange"
- @on-load="onLoad">
- <template slot="corpsIdSearch">
- <select-component
- v-model="search.corpsId"
- :configuration="configuration"
- ></select-component>
- </template>
- <template slot-scope="scope" slot="checkType">
- <span v-if="scope.row.checkType == 'ffsq'">付费申请</span>
- <span v-else-if="scope.row.checkType == 'xsqh'">销售请核</span>
- <span v-else-if="scope.row.checkType == 'cgqh'">采购请核</span>
- </template>
- <template slot="menuLeft">
- <el-button size="small"
- type="success"
- :disabled="selectionList.length == 0 "
- @click.stop="batchCheck"
- >批量审批
- </el-button>
- </template>
- <template slot-scope="scope" slot="menu">
- <el-button
- type="text"
- size="small"
- :disabled="scope.row.operate"
- @click.stop="jumpPage(scope.row)"
- >查看
- </el-button>
- <el-button
- type="text"
- size="small"
- :disabled="scope.row.auditStatus != 'S'"
- @click.stop="openCheck(scope.row)"
- >审批
- </el-button>
- <el-button
- type="text"
- size="small"
- @click.stop="openCheckSchedule(scope.row)"
- >审批流程
- </el-button>
- </template>
- </avue-crud>
- <el-dialog
- append-to-body
- title="审批进度"
- class="el-dialogDeep"
- :visible.sync="checkScheduleDialog"
- width="40%"
- :close-on-click-modal="false"
- :destroy-on-close="true"
- :close-on-press-escape="false"
- v-dialog-drag
- >
- <check-schedule
- :checkId="checkId"
- :batchNo="batchNo"
- @choceScheduleFun="choceScheduleFun"
- >
- </check-schedule>
- </el-dialog>
- <el-dialog
- append-to-body
- title="审批"
- class="el-dialogDeep"
- :visible.sync="checkDialog"
- width="50%"
- :close-on-click-modal="false"
- :destroy-on-close="true"
- :close-on-press-escape="false"
- v-dialog-drag
- >
- <check
- :checkData="checkData"
- :checkDetail="true"
- :idList="idList"
- @operationType="operationType"
- @choceCheckFun="choceCheckFun"
- >
- </check>
- </el-dialog>
- </basic-container>
- </template>
- <script>
- import option from "./configuration/mainList.json";
- import { getList,approvePass } from "@/api/approveData/main";
- import checkSchedule from "@/components/check/checkSchedule";
- import check from "@/components/check/check";
- let previousRouterName = ""
- let checkRefresh = ""
- export default {
- components:{
- check,
- checkSchedule
- },
- data() {
- return {
- loading : false,
- form: {},
- search:{},
- show:true,
- checkDialog:false,
- checkId:"",
- batchNo:'',
- checkScheduleDialog:false,
- detailData:{},
- option: option,
- parentId:0,
- checkData:{},
- dataList: [],
- idList:[],
- selectionList:[],
- page: {
- pageSize: 10,
- pagerCount: 5,
- total: 0,
- },
- query:{},
- configuration:{
- multipleChoices:false,
- multiple:false,
- disabled:false,
- searchShow:true,
- collapseTags:false,
- clearable:true,
- placeholder:'请点击右边按钮选择',
- dicData:[]
- },
- }
- },
- created() {
- },
- mounted() {
- // option.height = window.innerHeight - 200 ;
- },
- activated() {
- if(this.$route.query.check === 'refresh'){
- this.onLoad(this.page,this.search)
- }
- },
- methods: {
- batchCheck(){
- for(let i=0;i<this.selectionList.length;i++){
- if(this.selectionList[i].auditStatus != "S"){
- return this.$message.error("审核状态必须都为待审核状态!")
- }else{
- this.idList.push(this.selectionList[i].id)
- }
- }
- //打开cheack
- this.checkDialog = true;
- },
- operationType(){
- this.checkDialog = false;
- this.refreshChange()
- this.idList = []
- },
- //跳转页面
- jumpPage(row){
- if(row.url){
- if(eval('(' + row.pageStatus + ')')){
- this.$alert(""+row.pageLabel+"页面已存在,请关闭"+row.pageLabel+"页面再进行操作", "温馨提示", {
- confirmButtonText: "确定",
- type: 'warning',
- callback: action => {
- }
- });
- }else{
- this.$router.$avueRouter.closeTag(row.url);
- this.$router.push({
- path: row.url,
- query: {check : row},
- });
- }
- }
- },
- //审批通过
- pass(row,operate){
- row.operate = operate
- this.loading = true;
- approvePass(row).then(res=>{
- this.$message.success("操作成功!")
- this.refreshChange()
- }).finally(()=>{
- this.loading = false
- })
- },
- openCheck(row){
- this.batch = false //单条操作
- this.checkDialog = true
- this.checkData = row
- },
- choceCheckFun(){
- this.checkDialog = false;
- this.refreshChange()
- },
- openCheckSchedule(row){
- this.checkId = row.srcBillId
- this.batchNo = row.batchNo
- this.checkScheduleDialog = true
- },
- //关闭审批流程页面
- choceScheduleFun(){
- this.checkScheduleDialog = false
- },
- //新单打开
- addReceipt(row){
- },
- //编辑打开
- editOpen(row, status){
- this.detailData = {
- id: row.id,
- status: status
- };
- this.show = false;
- },
- rowDel(row, index, done) {
- if(row.id){
- this.$confirm("确定将选择数据删除?", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning"
- }).then(() => {
- remove(row.id).then(res =>{
- if(res.data.success){
- this.$message.success("操作成功!");
- this.onLoad(this.page);
- }
- })
- });
- }
- },
- //点击搜索按钮触发
- searchChange(params, done) {
- this.query = params;
- this.page.currentPage = 1;
- this.onLoad(this.page, params);
- done()
- },
- searchReset() {
- console.log('1')
- },
- selectionChange(list) {
- this.selectionList = list
- },
- currentChange(val) {
- this.page.currentPage = val
- },
- sizeChange() {
- console.log('1')
- },
- refreshChange(params) {
- this.onLoad(this.page,params);
- },
- paramsAdjustment(params) {
- params = Object.assign({}, this.search);
- if(!params.auditStatus && params.auditStatus !== ""){
- params.auditStatus = "S";
- }
- return params
- },
- onLoad(page, params) {
- this.loading = true
- params = this.paramsAdjustment(params)
- getList(page.currentPage, page.pageSize,params).then(res=>{
- this.dataList = res.data.data.records
- this.page.total = res.data.data.total
- }).finally(()=>{
- this.loading = false;
- })
- },
- }
- }
- </script>
- <style scoped>
- </style>
|