|
|
@@ -1,420 +1,619 @@
|
|
|
<template>
|
|
|
- <div>
|
|
|
- <Toptitle title="印章审批">
|
|
|
- <Button type="primary" style="margin-right:10px">导出</Button>
|
|
|
- <Dropdown trigger="click" @on-click='handleTotalAll'>
|
|
|
- <Button type="primary">批量<Icon type="ios-arrow-down" style="padding-left:10px"/></Button>
|
|
|
+ <div>
|
|
|
+ <Toptitle title="印章审批">
|
|
|
+ <Button type="primary" style="margin-right: 10px">导出</Button>
|
|
|
+ <Dropdown trigger="click" @on-click="handleTotalAll">
|
|
|
+ <Button type="primary"
|
|
|
+ >批量<Icon type="ios-arrow-down" style="padding-left: 10px"
|
|
|
+ /></Button>
|
|
|
<DropdownMenu slot="list">
|
|
|
- <DropdownItem name='1'>提交审批</DropdownItem>
|
|
|
- <DropdownItem name='2'>审批</DropdownItem>
|
|
|
- <DropdownItem name='3'>删除</DropdownItem>
|
|
|
- <DropdownItem name='4'>打印</DropdownItem>
|
|
|
+ <DropdownItem name="1">提交审批</DropdownItem>
|
|
|
+ <DropdownItem name="2">审批</DropdownItem>
|
|
|
+ <DropdownItem name="3">删除</DropdownItem>
|
|
|
+ <DropdownItem name="4">打印</DropdownItem>
|
|
|
</DropdownMenu>
|
|
|
- </Dropdown>
|
|
|
- </Toptitle>
|
|
|
- <div class="content">
|
|
|
- <Form class="form_content" :label-width='120'>
|
|
|
- <FormItem label='单据编号:'>
|
|
|
- <Input class="form_item" placeholder="请搜索" v-model="searchData.seal_no" clearable/>
|
|
|
- </FormItem>
|
|
|
- <FormItem label='用印单位:'>
|
|
|
- <Input class="form_item" placeholder="请搜索" v-model="searchData.project_title" clearable/>
|
|
|
- </FormItem>
|
|
|
- <FormItem label='用印人:'>
|
|
|
- <Select class="form_item" v-model="searchData.user_id" filterable clearable>
|
|
|
- <Option v-for="item in users" :key='item.id' :value="item.id" :label="item.nickname"/>
|
|
|
- </Select>
|
|
|
- </FormItem>
|
|
|
- <FormItem label='部门负责人:'>
|
|
|
- <Select class="form_item" v-model="searchData.section_id" filterable clearable>
|
|
|
- <Option v-for="item in users" :key='item.id' :value="item.id" :label="item.nickname"/>
|
|
|
- </Select>
|
|
|
- </FormItem>
|
|
|
- <FormItem label='待审人:'>
|
|
|
- <Select class="form_item" v-model="searchData.pend_id" filterable clearable>
|
|
|
- <Option v-for="item in users" :key='item.id' :value="item.id" :label="item.nickname"/>
|
|
|
- </Select>
|
|
|
- </FormItem>
|
|
|
- <FormItem label='审批人:'>
|
|
|
- <Select class="form_item" v-model="searchData.check_id" filterable clearable>
|
|
|
- <Option v-for="item in users" :key='item.id' :value="item.id" :label="item.nickname"/>
|
|
|
- </Select>
|
|
|
- </FormItem>
|
|
|
- <FormItem label='审批状态:'>
|
|
|
- <Select class="form_item" v-model="searchData.state" filterable clearable>
|
|
|
- <Option :value="0" label="未提交审批"/>
|
|
|
- <Option :value="1" label="已提交未审批"/>
|
|
|
- <Option :value="2" label='已审批'/>
|
|
|
- </Select>
|
|
|
- </FormItem>
|
|
|
- <FormItem label='申请用印时间:' style="width:100%">
|
|
|
- <DatePicker type="date" placeholder="年/月/日" class="form_item" v-model="searchData.start_time"></DatePicker>~
|
|
|
- <DatePicker type="date" placeholder="年/月/日" class="form_item" v-model="searchData.end_time"></DatePicker>
|
|
|
- </FormItem>
|
|
|
- <FormItem label='审批用印时间:'>
|
|
|
- <DatePicker type="date" placeholder="年/月/日" class="form_item" v-model="searchData.start_check_time"></DatePicker>~
|
|
|
- <DatePicker type="date" placeholder="年/月/日" class="form_item" v-model="searchData.end_check_time"></DatePicker>
|
|
|
- </FormItem>
|
|
|
- <FormItem :label-width='50'>
|
|
|
- <Button type="primary" @click="initData(searchData)">搜索</Button>
|
|
|
- </FormItem>
|
|
|
- </Form>
|
|
|
- <div class="before_table"><Button type="primary" @click="goPage(1)">新增</Button></div>
|
|
|
- <Table :data='tableData' :columns='tableColumns' border max-height='550' @on-selection-change='DataSelect' :loading='loading'>
|
|
|
- <template slot="set" slot-scope="{row}">
|
|
|
- <a style="margin-right:10px" v-show="row.state==0||row.state==2" @click='handelSet(row,1)'>提交审批</a>
|
|
|
- <a style="margin-right:10px" v-show="row.state==2" @click='handelSet(row,2)'>弃审</a>
|
|
|
- <a style="margin-right:10px" v-show="row.state==1" @click='handelSet(row,1)'>审批</a>
|
|
|
- <a style="margin-right:10px" v-show="row.state==1" @click='handelSet(row,2)'>撤销提交</a>
|
|
|
- <a style="margin-right:10px" @click="goPage(3,row)">详情</a>
|
|
|
- <a @click="goPage(2,row)" style="margin-right:10px" v-show="row.state==0">编辑</a>
|
|
|
- <a style="margin-right:10px" v-show="row.state==0" @click="handleDel(row)">删除</a>
|
|
|
- <a>打印</a>
|
|
|
- </template>
|
|
|
- </Table>
|
|
|
- </div>
|
|
|
- <div class="pageSlotStyle">
|
|
|
- <Page :page-size-opts="[10, 20, 30, 40,100,1000]"
|
|
|
- @on-page-size-change='changeSize'
|
|
|
- @on-change='changePage'
|
|
|
- :current='page_index'
|
|
|
- show-total
|
|
|
- :total="total"
|
|
|
- show-sizer
|
|
|
- :page-size='page_size' />
|
|
|
+ </Dropdown>
|
|
|
+ </Toptitle>
|
|
|
+ <div class="content">
|
|
|
+ <Form class="form_content" :label-width="120">
|
|
|
+ <FormItem label="单据编号:">
|
|
|
+ <Input
|
|
|
+ class="form_item"
|
|
|
+ placeholder="请搜索"
|
|
|
+ v-model="searchData.seal_no"
|
|
|
+ clearable
|
|
|
+ />
|
|
|
+ </FormItem>
|
|
|
+ <FormItem label="用印单位:">
|
|
|
+ <Input
|
|
|
+ class="form_item"
|
|
|
+ placeholder="请搜索"
|
|
|
+ v-model="searchData.project_title"
|
|
|
+ clearable
|
|
|
+ />
|
|
|
+ </FormItem>
|
|
|
+ <FormItem label="用印人:">
|
|
|
+ <Select
|
|
|
+ class="form_item"
|
|
|
+ v-model="searchData.user_id"
|
|
|
+ filterable
|
|
|
+ clearable
|
|
|
+ >
|
|
|
+ <Option
|
|
|
+ v-for="item in users"
|
|
|
+ :key="item.id"
|
|
|
+ :value="item.id"
|
|
|
+ :label="item.nickname"
|
|
|
+ />
|
|
|
+ </Select>
|
|
|
+ </FormItem>
|
|
|
+ <FormItem label="部门负责人:">
|
|
|
+ <Select
|
|
|
+ class="form_item"
|
|
|
+ v-model="searchData.section_id"
|
|
|
+ filterable
|
|
|
+ clearable
|
|
|
+ >
|
|
|
+ <Option
|
|
|
+ v-for="item in users"
|
|
|
+ :key="item.id"
|
|
|
+ :value="item.id"
|
|
|
+ :label="item.nickname"
|
|
|
+ />
|
|
|
+ </Select>
|
|
|
+ </FormItem>
|
|
|
+ <FormItem label="待审人:">
|
|
|
+ <Select
|
|
|
+ class="form_item"
|
|
|
+ v-model="searchData.pend_id"
|
|
|
+ filterable
|
|
|
+ clearable
|
|
|
+ >
|
|
|
+ <Option
|
|
|
+ v-for="item in users"
|
|
|
+ :key="item.id"
|
|
|
+ :value="item.id"
|
|
|
+ :label="item.nickname"
|
|
|
+ />
|
|
|
+ </Select>
|
|
|
+ </FormItem>
|
|
|
+ <FormItem label="审批人:">
|
|
|
+ <Select
|
|
|
+ class="form_item"
|
|
|
+ v-model="searchData.check_id"
|
|
|
+ filterable
|
|
|
+ clearable
|
|
|
+ >
|
|
|
+ <Option
|
|
|
+ v-for="item in users"
|
|
|
+ :key="item.id"
|
|
|
+ :value="item.id"
|
|
|
+ :label="item.nickname"
|
|
|
+ />
|
|
|
+ </Select>
|
|
|
+ </FormItem>
|
|
|
+ <FormItem label="审批状态:">
|
|
|
+ <Select
|
|
|
+ class="form_item"
|
|
|
+ v-model="searchData.state"
|
|
|
+ filterable
|
|
|
+ clearable
|
|
|
+ >
|
|
|
+ <Option :value="0" label="未提交审批" />
|
|
|
+ <Option :value="1" label="已提交未审批" />
|
|
|
+ <Option :value="2" label="已审批" />
|
|
|
+ </Select>
|
|
|
+ </FormItem>
|
|
|
+ <FormItem label="申请用印时间:" style="width: 100%">
|
|
|
+ <DatePicker
|
|
|
+ type="date"
|
|
|
+ placeholder="年/月/日"
|
|
|
+ class="form_item"
|
|
|
+ v-model="searchData.start_time"
|
|
|
+ ></DatePicker
|
|
|
+ >~
|
|
|
+ <DatePicker
|
|
|
+ type="date"
|
|
|
+ placeholder="年/月/日"
|
|
|
+ class="form_item"
|
|
|
+ v-model="searchData.end_time"
|
|
|
+ ></DatePicker>
|
|
|
+ </FormItem>
|
|
|
+ <FormItem label="审批用印时间:">
|
|
|
+ <DatePicker
|
|
|
+ type="date"
|
|
|
+ placeholder="年/月/日"
|
|
|
+ class="form_item"
|
|
|
+ v-model="searchData.start_check_time"
|
|
|
+ ></DatePicker
|
|
|
+ >~
|
|
|
+ <DatePicker
|
|
|
+ type="date"
|
|
|
+ placeholder="年/月/日"
|
|
|
+ class="form_item"
|
|
|
+ v-model="searchData.end_check_time"
|
|
|
+ ></DatePicker>
|
|
|
+ </FormItem>
|
|
|
+ <FormItem :label-width="50">
|
|
|
+ <Button type="primary" @click="initData(searchData)">搜索</Button>
|
|
|
+ </FormItem>
|
|
|
+ </Form>
|
|
|
+ <div class="before_table">
|
|
|
+ <Button type="primary" @click="goPage(1)">新增</Button>
|
|
|
</div>
|
|
|
- <Modal title="提交审批" v-model="show_submit">
|
|
|
- <Form :label-width='100'>
|
|
|
- <FormItem label="审批人:">
|
|
|
- <Select v-model="check_id">
|
|
|
- <Option v-for="item in users" :key='item.id' :value="item.id" :label="item.nickname"></Option>
|
|
|
- </Select>
|
|
|
- </FormItem>
|
|
|
- </Form>
|
|
|
- <div slot="footer">
|
|
|
- <Button type="primary" ghost @click="show_submit=false">取消</Button>
|
|
|
- <Button type="primary" @click="submit">确认</Button>
|
|
|
-
|
|
|
- </div>
|
|
|
- </Modal>
|
|
|
+ <Table
|
|
|
+ :data="tableData"
|
|
|
+ :columns="tableColumns"
|
|
|
+ border
|
|
|
+ max-height="550"
|
|
|
+ @on-selection-change="DataSelect"
|
|
|
+ :loading="loading"
|
|
|
+ >
|
|
|
+ <template slot="set" slot-scope="{ row }">
|
|
|
+ <a
|
|
|
+ style="margin-right: 10px"
|
|
|
+ v-show="row.state == 0 || row.state == 2"
|
|
|
+ @click="handelSet(row, 1)"
|
|
|
+ >提交审批</a
|
|
|
+ >
|
|
|
+ <a
|
|
|
+ style="margin-right: 10px"
|
|
|
+ v-show="row.state == 2"
|
|
|
+ @click="handelSet(row, 2)"
|
|
|
+ >弃审</a
|
|
|
+ >
|
|
|
+ <a
|
|
|
+ style="margin-right: 10px"
|
|
|
+ v-show="row.state == 1"
|
|
|
+ @click="handelSet(row, 1)"
|
|
|
+ >审批</a
|
|
|
+ >
|
|
|
+ <a
|
|
|
+ style="margin-right: 10px"
|
|
|
+ v-show="row.state == 1"
|
|
|
+ @click="handelSet(row, 2)"
|
|
|
+ >撤销提交</a
|
|
|
+ >
|
|
|
+ <a style="margin-right: 10px" @click="goPage(3, row)">详情</a>
|
|
|
+ <a
|
|
|
+ @click="goPage(2, row)"
|
|
|
+ style="margin-right: 10px"
|
|
|
+ v-show="row.state == 0"
|
|
|
+ >编辑</a
|
|
|
+ >
|
|
|
+ <a
|
|
|
+ style="margin-right: 10px"
|
|
|
+ v-show="row.state == 0"
|
|
|
+ @click="handleDel(row)"
|
|
|
+ >删除</a
|
|
|
+ >
|
|
|
+ <a>打印</a>
|
|
|
+ </template>
|
|
|
+ </Table>
|
|
|
</div>
|
|
|
+ <div class="pageSlotStyle">
|
|
|
+ <Page
|
|
|
+ :page-size-opts="[10, 20, 30, 40, 100, 1000]"
|
|
|
+ @on-page-size-change="changeSize"
|
|
|
+ @on-change="changePage"
|
|
|
+ :current="page_index"
|
|
|
+ show-total
|
|
|
+ :total="total"
|
|
|
+ show-sizer
|
|
|
+ :page-size="page_size"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ <Modal title="提交审批" v-model="show_submit">
|
|
|
+ <Form :label-width="100">
|
|
|
+ <FormItem label="审批人:">
|
|
|
+ <Select v-model="check_id">
|
|
|
+ <Option
|
|
|
+ v-for="item in users"
|
|
|
+ :key="item.id"
|
|
|
+ :value="item.id"
|
|
|
+ :label="item.nickname"
|
|
|
+ ></Option>
|
|
|
+ </Select>
|
|
|
+ </FormItem>
|
|
|
+ </Form>
|
|
|
+ <div slot="footer">
|
|
|
+ <Button type="primary" ghost @click="show_submit = false">取消</Button>
|
|
|
+ <Button type="primary" @click="submit">确认</Button>
|
|
|
+ </div>
|
|
|
+ </Modal>
|
|
|
+ </div>
|
|
|
</template>
|
|
|
<script>
|
|
|
export default {
|
|
|
- data(){
|
|
|
- return{
|
|
|
- loading:false,
|
|
|
- submit_state:false,
|
|
|
- searchData:{
|
|
|
- seal_no:'',
|
|
|
- project_title:'',
|
|
|
- user_id:'',
|
|
|
- section_id:'',
|
|
|
- pend_id:'',
|
|
|
- check_id:'',
|
|
|
- state:'',
|
|
|
- start_time:'',
|
|
|
- end_time:'',
|
|
|
- start_check_time:'',
|
|
|
- end_check_time:'',
|
|
|
- },
|
|
|
- chooseData:{},
|
|
|
- check_id:'',
|
|
|
- users:[],
|
|
|
- show_submit:false,
|
|
|
- page_index:1,
|
|
|
- page_size:10,
|
|
|
- total:0,
|
|
|
- selectData:[],
|
|
|
- tableData:[],
|
|
|
- tableColumns:[
|
|
|
- {type:'selection',minWidth:80,align:'center'},
|
|
|
- {type:'index',minWidth:80,align:'center',title:'序号'},
|
|
|
- {title:'单据编号',align:'center',minWidth:140,key:'seal_no'},
|
|
|
- {title:'用印单位(项目)',align:'center',minWidth:150,key:'project_title'},
|
|
|
- {title:'申请用印时间',align:'center',minWidth:130,key:'user_time',render:(h,params)=>{
|
|
|
- const {row} = params;
|
|
|
- return h('span',{},this.func.replaceDateNoHMS(row.user_time))
|
|
|
- }},
|
|
|
- {title:'申请用印内容',align:'center',minWidth:130,key:'content',ellipsis:true,tooltip:true},
|
|
|
- {title:'用印人',align:'center',minWidth:120,key:'user_name'},
|
|
|
- {title:'部门负责人',align:'center',minWidth:120,key:'section_name'},
|
|
|
- {title:'审批状态',align:'center',minWidth:140,key:'state',render:(h,params)=>{
|
|
|
- const {row} = params;
|
|
|
- const text = row.state==0?'未提交审批':row.state==1?'已提交未审批':'已审批';
|
|
|
- return h('span',{},text)
|
|
|
- }},
|
|
|
- {title:'待审人',align:'center',minWidth:120,key:'pend_name'},
|
|
|
- {title:'审批人',align:'center',minWidth:120,key:'check_name'},
|
|
|
- {title:'审批用印时间',align:'center',minWidth:130,key:'check_time',render:(h,params)=>{
|
|
|
- const {row} = params;
|
|
|
- return h('span',{},this.func.replaceDateNoHMS(row.check_time))
|
|
|
- }},
|
|
|
- {title:'操作',align:'center',minWidth:300,key:'',slot:'set'}
|
|
|
- ]
|
|
|
- }
|
|
|
- },
|
|
|
- created(){
|
|
|
- //获取人员列表
|
|
|
- this.axios.get('/api/user').then(res=>{
|
|
|
- this.users = res.data.data
|
|
|
- })
|
|
|
- },
|
|
|
- mounted(){
|
|
|
- this.initData();
|
|
|
- },
|
|
|
- methods:{
|
|
|
- handleTotalAll(name){
|
|
|
- switch(name){
|
|
|
- case "1":
|
|
|
- if(this.selectData.length==0){
|
|
|
- return this.$Message.warning('请先选择数据!');
|
|
|
- }
|
|
|
- let arr = [];
|
|
|
- arr = this.selectData.filter(v=>{
|
|
|
- return v.state==0||v.state==2
|
|
|
- })
|
|
|
- if(arr.length != this.selectData.length){
|
|
|
- return this.$Message.warning('数据中有不能提交审批的数据!')
|
|
|
- }
|
|
|
- console.log(arr);
|
|
|
- let state = false;
|
|
|
- arr.forEach(v=>{
|
|
|
- if(v.state!=arr[0].state){
|
|
|
- state = true;
|
|
|
- }
|
|
|
- })
|
|
|
- if(state){
|
|
|
- return this.$Message.warning('请选择状态相同的数据!')
|
|
|
- }
|
|
|
- this.show_submit = true;
|
|
|
- this.submit_state = true;
|
|
|
- this.check_id='';
|
|
|
- break;
|
|
|
- case '2':
|
|
|
- if(this.selectData.length==0){
|
|
|
- return this.$Message.warning('请先选择数据!');
|
|
|
- };
|
|
|
- let ar = [];
|
|
|
- ar = this.selectData.filter(v=>{
|
|
|
- return v.state == 1;
|
|
|
- })
|
|
|
- if(ar.length!=this.selectData.length){
|
|
|
- return this.$Message.warning('数据中有不能审批的数据!')
|
|
|
- }
|
|
|
- this.confirmDelete({
|
|
|
- title:'确认?',
|
|
|
- content: "确认审批?",
|
|
|
- then: () => {
|
|
|
- let seal_no = [];
|
|
|
- this.selectData.forEach(v=>{
|
|
|
- seal_no.push(v.seal_no);
|
|
|
- })
|
|
|
- this.axios.post('/api/seal_check',{seal_no,id:JSON.parse(localStorage.getItem('user_info')).id,state:1}).then(res=>{
|
|
|
- if(res.code==200){
|
|
|
- this.$Message.success(res.msg);
|
|
|
- this.initData(this.searchData);
|
|
|
- }
|
|
|
- })
|
|
|
- }
|
|
|
- })
|
|
|
- break;
|
|
|
- case '3':
|
|
|
- if(this.selectData.length==0){
|
|
|
- return this.$Message.warning('请先选择数据!');
|
|
|
- };
|
|
|
- let stateData = this.selectData.filter(v=>{
|
|
|
- return v.state == 1||v.state == 2;
|
|
|
- });
|
|
|
- if(stateData.length!=0){
|
|
|
- return this.$Message.warning('数据中有不能删除的数据,请重新选择!')
|
|
|
- }
|
|
|
- let seal = [];
|
|
|
- this.selectData.forEach(v=>{
|
|
|
- seal.push(v.seal_no);
|
|
|
- })
|
|
|
- this.confirmDelete({
|
|
|
- content: "确认删除么?",
|
|
|
- then: () => {
|
|
|
- this.axios
|
|
|
- .post("/api/seal_del", { seal_no:seal})
|
|
|
- .then((res) => {
|
|
|
- if (res.code == 200) {
|
|
|
- if(this.page_index!=1||this.tableData.length==1){
|
|
|
- this.page_index--;
|
|
|
- }
|
|
|
- this.$Message.success(res.msg);
|
|
|
- this.initData(this.searchData);
|
|
|
- }
|
|
|
- });
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ loading: false,
|
|
|
+ submit_state: false,
|
|
|
+ searchData: {
|
|
|
+ seal_no: "",
|
|
|
+ project_title: "",
|
|
|
+ user_id: "",
|
|
|
+ section_id: "",
|
|
|
+ pend_id: "",
|
|
|
+ check_id: "",
|
|
|
+ state: "",
|
|
|
+ start_time: "",
|
|
|
+ end_time: "",
|
|
|
+ start_check_time: "",
|
|
|
+ end_check_time: "",
|
|
|
+ },
|
|
|
+ chooseData: {},
|
|
|
+ check_id: "",
|
|
|
+ users: [],
|
|
|
+ show_submit: false,
|
|
|
+ page_index: 1,
|
|
|
+ page_size: 10,
|
|
|
+ total: 0,
|
|
|
+ selectData: [],
|
|
|
+ tableData: [],
|
|
|
+ tableColumns: [
|
|
|
+ { type: "selection", minWidth: 80, align: "center" },
|
|
|
+ { type: "index", minWidth: 80, align: "center", title: "序号" },
|
|
|
+ { title: "单据编号", align: "center", minWidth: 140, key: "seal_no" },
|
|
|
+ {
|
|
|
+ title: "用印单位(项目)",
|
|
|
+ align: "center",
|
|
|
+ minWidth: 150,
|
|
|
+ key: "project_title",
|
|
|
},
|
|
|
- });
|
|
|
- break;
|
|
|
- case '4':
|
|
|
- if(this.selectData.length==0){
|
|
|
- return this.$Message.warning('请先选择数据!');
|
|
|
- };
|
|
|
- break;
|
|
|
- }
|
|
|
+ {
|
|
|
+ title: "申请用印时间",
|
|
|
+ align: "center",
|
|
|
+ minWidth: 130,
|
|
|
+ key: "user_time",
|
|
|
+ render: (h, params) => {
|
|
|
+ const { row } = params;
|
|
|
+ return h("span", {}, this.func.replaceDateNoHMS(row.user_time));
|
|
|
+ },
|
|
|
},
|
|
|
- handleDel(row){
|
|
|
- this.confirmDelete({
|
|
|
- content: "确认删除么?",
|
|
|
- then: () => {
|
|
|
- this.axios
|
|
|
- .post("/api/seal_del", { seal_no:[row.seal_no]})
|
|
|
- .then((res) => {
|
|
|
- if (res.code == 200) {
|
|
|
- this.$Message.success(res.msg);
|
|
|
- if(this.page_index!=1||this.tableData.length==1){
|
|
|
- this.page_index--;
|
|
|
- }
|
|
|
- this.initData(this.searchData);
|
|
|
- }
|
|
|
- });
|
|
|
+ {
|
|
|
+ title: "申请用印内容",
|
|
|
+ align: "center",
|
|
|
+ minWidth: 130,
|
|
|
+ key: "content",
|
|
|
+ ellipsis: true,
|
|
|
+ tooltip: true,
|
|
|
},
|
|
|
- });
|
|
|
+ { title: "用印人", align: "center", minWidth: 120, key: "user_name" },
|
|
|
+ {
|
|
|
+ title: "部门负责人",
|
|
|
+ align: "center",
|
|
|
+ minWidth: 120,
|
|
|
+ key: "section_name",
|
|
|
},
|
|
|
- changePage(e){
|
|
|
- this.page_index = e;
|
|
|
- this.initData(this.searchData);
|
|
|
+ {
|
|
|
+ title: "审批状态",
|
|
|
+ align: "center",
|
|
|
+ minWidth: 140,
|
|
|
+ key: "state",
|
|
|
+ render: (h, params) => {
|
|
|
+ const { row } = params;
|
|
|
+ const text =
|
|
|
+ row.state == 0
|
|
|
+ ? "未提交审批"
|
|
|
+ : row.state == 1
|
|
|
+ ? "已提交未审批"
|
|
|
+ : "已审批";
|
|
|
+ return h("span", {}, text);
|
|
|
+ },
|
|
|
},
|
|
|
- changeSize(e){
|
|
|
- this.page_size = e;
|
|
|
- this.page_index =1;
|
|
|
- this.initData(this.searchData);
|
|
|
+ { title: "待审人", align: "center", minWidth: 120, key: "pend_name" },
|
|
|
+ { title: "审批人", align: "center", minWidth: 120, key: "check_name" },
|
|
|
+ {
|
|
|
+ title: "审批用印时间",
|
|
|
+ align: "center",
|
|
|
+ minWidth: 130,
|
|
|
+ key: "check_time",
|
|
|
+ render: (h, params) => {
|
|
|
+ const { row } = params;
|
|
|
+ return h("span", {}, this.func.replaceDateNoHMS(row.check_time));
|
|
|
+ },
|
|
|
},
|
|
|
- submit(){
|
|
|
- if(!this.check_id){
|
|
|
- return this.$Message.warning('请选择审批人!')
|
|
|
+ { title: "操作", align: "center", minWidth: 300, key: "", slot: "set" },
|
|
|
+ ],
|
|
|
+ };
|
|
|
+ },
|
|
|
+ created() {
|
|
|
+ //获取人员列表
|
|
|
+ this.axios.get("/api/user").then((res) => {
|
|
|
+ this.users = res.data.data;
|
|
|
+ });
|
|
|
+ },
|
|
|
+ mounted() {
|
|
|
+ this.initData();
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ handleTotalAll(name) {
|
|
|
+ switch (name) {
|
|
|
+ case "1":
|
|
|
+ if (this.selectData.length == 0) {
|
|
|
+ return this.$Message.warning("请先选择数据!");
|
|
|
+ }
|
|
|
+ let arr = [];
|
|
|
+ arr = this.selectData.filter((v) => {
|
|
|
+ return v.state == 0 || v.state == 2;
|
|
|
+ });
|
|
|
+ if (arr.length != this.selectData.length) {
|
|
|
+ return this.$Message.warning("数据中有不能提交审批的数据!");
|
|
|
+ }
|
|
|
+ console.log(arr);
|
|
|
+ let state = false;
|
|
|
+ arr.forEach((v) => {
|
|
|
+ if (v.state != arr[0].state) {
|
|
|
+ state = true;
|
|
|
}
|
|
|
- if(this.submit_state){
|
|
|
- let seal_no = [];
|
|
|
- this.selectData.forEach(v=>{
|
|
|
- seal_no.push(v.seal_no);
|
|
|
- })
|
|
|
- this.axios.post('/api/seal_check',{id:this.check_id,seal_no,state:this.selectData[0].state}).then(res=>{
|
|
|
- if(res.code==200){
|
|
|
- this.$Message.success(res.msg);
|
|
|
- this.initData(this.searchData);
|
|
|
- this.check_id = '';
|
|
|
- this.show_submit = false;
|
|
|
- this.submit_state = false;
|
|
|
- }
|
|
|
- })
|
|
|
- }else{
|
|
|
- this.axios.post('/api/seal_check',{id:this.check_id,seal_no:[this.chooseData.seal_no],state:this.chooseData.state}).then(res=>{
|
|
|
- if(res.code==200){
|
|
|
- this.$Message.success(res.msg);
|
|
|
- this.initData(this.searchData);
|
|
|
- this.check_id = '';
|
|
|
- this.show_submit = false;
|
|
|
- }
|
|
|
+ });
|
|
|
+ if (state) {
|
|
|
+ return this.$Message.warning("请选择状态相同的数据!");
|
|
|
+ }
|
|
|
+ this.show_submit = true;
|
|
|
+ this.submit_state = true;
|
|
|
+ this.check_id = "";
|
|
|
+ break;
|
|
|
+ case "2":
|
|
|
+ if (this.selectData.length == 0) {
|
|
|
+ return this.$Message.warning("请先选择数据!");
|
|
|
+ }
|
|
|
+ let ar = [];
|
|
|
+ ar = this.selectData.filter((v) => {
|
|
|
+ return v.state == 1;
|
|
|
+ });
|
|
|
+ if (ar.length != this.selectData.length) {
|
|
|
+ return this.$Message.warning("数据中有不能审批的数据!");
|
|
|
+ }
|
|
|
+ this.confirmDelete({
|
|
|
+ title: "确认?",
|
|
|
+ content: "确认审批?",
|
|
|
+ then: () => {
|
|
|
+ let seal_no = [];
|
|
|
+ this.selectData.forEach((v) => {
|
|
|
+ seal_no.push(v.seal_no);
|
|
|
+ });
|
|
|
+ this.axios
|
|
|
+ .post("/api/seal_check", {
|
|
|
+ seal_no,
|
|
|
+ id: JSON.parse(localStorage.getItem("user_info")).id,
|
|
|
+ state: 1,
|
|
|
})
|
|
|
- }
|
|
|
-
|
|
|
- },
|
|
|
- handelSet(row,type){
|
|
|
- switch(type){
|
|
|
- case 1:
|
|
|
- if(row.state == 0||row.state == 2){
|
|
|
- this.show_submit = true;
|
|
|
- this.chooseData = row;
|
|
|
- }else{
|
|
|
- this.confirmDelete({
|
|
|
- title:'确认?',
|
|
|
- content: "确认审批?",
|
|
|
- then: () => {
|
|
|
- this.axios.post('/api/seal_check',{seal_no:[row.seal_no],id:JSON.parse(localStorage.getItem('user_info')).id,state:row.state}).then(res=>{
|
|
|
- if(res.code==200){
|
|
|
- this.$Message.success(res.msg);
|
|
|
- this.initData(this.searchData);
|
|
|
+ .then((res) => {
|
|
|
+ if (res.code == 200) {
|
|
|
+ this.$Message.success(res.msg);
|
|
|
+ this.initData(this.searchData);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ });
|
|
|
+ break;
|
|
|
+ case "3":
|
|
|
+ if (this.selectData.length == 0) {
|
|
|
+ return this.$Message.warning("请先选择数据!");
|
|
|
+ }
|
|
|
+ let stateData = this.selectData.filter((v) => {
|
|
|
+ return v.state == 1 || v.state == 2;
|
|
|
+ });
|
|
|
+ if (stateData.length != 0) {
|
|
|
+ return this.$Message.warning(
|
|
|
+ "数据中有不能删除的数据,请重新选择!"
|
|
|
+ );
|
|
|
+ }
|
|
|
+ let seal = [];
|
|
|
+ this.selectData.forEach((v) => {
|
|
|
+ seal.push(v.seal_no);
|
|
|
+ });
|
|
|
+ this.confirmDelete({
|
|
|
+ content: "确认删除么?",
|
|
|
+ then: () => {
|
|
|
+ this.axios
|
|
|
+ .post("/api/seal_del", { seal_no: seal })
|
|
|
+ .then((res) => {
|
|
|
+ if (res.code == 200) {
|
|
|
+ if (this.page_index != 1 || this.tableData.length == 1) {
|
|
|
+ this.page_index--;
|
|
|
}
|
|
|
-
|
|
|
- })
|
|
|
- }
|
|
|
- })
|
|
|
+ this.$Message.success(res.msg);
|
|
|
+ this.initData(this.searchData);
|
|
|
}
|
|
|
- break;
|
|
|
- case 2:
|
|
|
- this.confirmDelete({
|
|
|
- title:'确认',
|
|
|
- content: `${row.state==1?'确定撤销提交吗?':'确定弃审吗?'}`,
|
|
|
+ });
|
|
|
+ },
|
|
|
+ });
|
|
|
+ break;
|
|
|
+ case "4":
|
|
|
+ if (this.selectData.length == 0) {
|
|
|
+ return this.$Message.warning("请先选择数据!");
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ handleDel(row) {
|
|
|
+ this.confirmDelete({
|
|
|
+ content: "确认删除么?",
|
|
|
then: () => {
|
|
|
this.axios
|
|
|
- .post("/api/seal_un_check", { seal_no:row.seal_no,state: row.state })
|
|
|
+ .post("/api/seal_del", { seal_no: [row.seal_no] })
|
|
|
.then((res) => {
|
|
|
if (res.code == 200) {
|
|
|
this.$Message.success(res.msg);
|
|
|
+ if (this.page_index != 1 || this.tableData.length == 1) {
|
|
|
+ this.page_index--;
|
|
|
+ }
|
|
|
this.initData(this.searchData);
|
|
|
- // this.undata_navData();
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
});
|
|
|
- break
|
|
|
- }
|
|
|
- },
|
|
|
- initData(row){
|
|
|
- let obj = {};
|
|
|
- if(row){
|
|
|
- obj = JSON.parse(JSON.stringify(row));
|
|
|
- obj.start_check_time = obj.start_check_time?Date.parse(obj.start_check_time).toString().slice(0,10):'';
|
|
|
- obj.end_check_time = obj.end_check_time?Date.parse(obj.end_check_time).toString().slice(0,10):'';
|
|
|
- obj.start_time = obj.start_time?Date.parse(obj.start_time).toString().slice(0,10):'';
|
|
|
- obj.end_time = obj.end_time?Date.parse(obj.end_time).toString().slice(0,10):'';
|
|
|
+ },
|
|
|
+ changePage(e) {
|
|
|
+ this.page_index = e;
|
|
|
+ this.initData(this.searchData);
|
|
|
+ },
|
|
|
+ changeSize(e) {
|
|
|
+ this.page_size = e;
|
|
|
+ this.page_index = 1;
|
|
|
+ this.initData(this.searchData);
|
|
|
+ },
|
|
|
+ submit() {
|
|
|
+ if (!this.check_id) {
|
|
|
+ return this.$Message.warning("请选择审批人!");
|
|
|
+ }
|
|
|
+ if (this.submit_state) {
|
|
|
+ let seal_no = [];
|
|
|
+ this.selectData.forEach((v) => {
|
|
|
+ seal_no.push(v.seal_no);
|
|
|
+ });
|
|
|
+ this.axios
|
|
|
+ .post("/api/seal_check", {
|
|
|
+ id: this.check_id,
|
|
|
+ seal_no,
|
|
|
+ state: this.selectData[0].state,
|
|
|
+ })
|
|
|
+ .then((res) => {
|
|
|
+ if (res.code == 200) {
|
|
|
+ this.$Message.success(res.msg);
|
|
|
+ this.initData(this.searchData);
|
|
|
+ this.check_id = "";
|
|
|
+ this.show_submit = false;
|
|
|
+ this.submit_state = false;
|
|
|
}
|
|
|
- this.loading = true;
|
|
|
- this.axios.post('/api/seal_list',{...obj}).then(res=>{
|
|
|
- this.tableData = res.data.data;
|
|
|
- this.total = res.data.total;
|
|
|
- this.loading = false;
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ this.axios
|
|
|
+ .post("/api/seal_check", {
|
|
|
+ id: this.check_id,
|
|
|
+ seal_no: [this.chooseData.seal_no],
|
|
|
+ state: this.chooseData.state,
|
|
|
})
|
|
|
- },
|
|
|
- DataSelect(e){
|
|
|
- this.selectData = e;
|
|
|
- },
|
|
|
- goPage(type,row){
|
|
|
- if(type==1){
|
|
|
- this.$router.push({path:'/cms/SealApprove/edit',query:{type}})
|
|
|
- }else{
|
|
|
- this.$router.push({path:'/cms/SealApprove/edit',query:{type,seal_no:row.seal_no,state:row.state}})
|
|
|
+ .then((res) => {
|
|
|
+ if (res.code == 200) {
|
|
|
+ this.$Message.success(res.msg);
|
|
|
+ this.initData(this.searchData);
|
|
|
+ this.check_id = "";
|
|
|
+ this.show_submit = false;
|
|
|
}
|
|
|
-
|
|
|
- },
|
|
|
- beforeRouteLeave(to, from, next) {
|
|
|
- if (
|
|
|
- to.path == "/cms/SealApprove/edit"
|
|
|
- ) {
|
|
|
- next();
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
+ handelSet(row, type) {
|
|
|
+ switch (type) {
|
|
|
+ case 1:
|
|
|
+ if (row.state == 0 || row.state == 2) {
|
|
|
+ this.show_submit = true;
|
|
|
+ this.chooseData = row;
|
|
|
} else {
|
|
|
- from.meta.keepAlive = false;
|
|
|
- next();
|
|
|
+ this.confirmDelete({
|
|
|
+ title: "确认?",
|
|
|
+ content: "确认审批?",
|
|
|
+ then: () => {
|
|
|
+ this.axios
|
|
|
+ .post("/api/seal_check", {
|
|
|
+ seal_no: [row.seal_no],
|
|
|
+ id: JSON.parse(localStorage.getItem("user_info")).id,
|
|
|
+ state: row.state,
|
|
|
+ })
|
|
|
+ .then((res) => {
|
|
|
+ if (res.code == 200) {
|
|
|
+ this.$Message.success(res.msg);
|
|
|
+ this.initData(this.searchData);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ });
|
|
|
}
|
|
|
- }
|
|
|
+ break;
|
|
|
+ case 2:
|
|
|
+ this.confirmDelete({
|
|
|
+ title: "确认",
|
|
|
+ content: `${row.state == 1 ? "确定撤销提交吗?" : "确定弃审吗?"}`,
|
|
|
+ then: () => {
|
|
|
+ this.axios
|
|
|
+ .post("/api/seal_un_check", {
|
|
|
+ seal_no: row.seal_no,
|
|
|
+ state: row.state,
|
|
|
+ })
|
|
|
+ .then((res) => {
|
|
|
+ if (res.code == 200) {
|
|
|
+ this.$Message.success(res.msg);
|
|
|
+ this.initData(this.searchData);
|
|
|
+ // this.undata_navData();
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ });
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ initData(row) {
|
|
|
+ let obj = {};
|
|
|
+ if (row) {
|
|
|
+ obj = JSON.parse(JSON.stringify(row));
|
|
|
+ obj.start_check_time = obj.start_check_time
|
|
|
+ ? Date.parse(obj.start_check_time).toString().slice(0, 10)
|
|
|
+ : "";
|
|
|
+ obj.end_check_time = obj.end_check_time
|
|
|
+ ? Date.parse(obj.end_check_time).toString().slice(0, 10)
|
|
|
+ : "";
|
|
|
+ obj.start_time = obj.start_time
|
|
|
+ ? Date.parse(obj.start_time).toString().slice(0, 10)
|
|
|
+ : "";
|
|
|
+ obj.end_time = obj.end_time
|
|
|
+ ? Date.parse(obj.end_time).toString().slice(0, 10)
|
|
|
+ : "";
|
|
|
+ }
|
|
|
+ this.loading = true;
|
|
|
+ this.axios.post("/api/seal_list", { ...obj }).then((res) => {
|
|
|
+ this.tableData = res.data.data;
|
|
|
+ this.total = res.data.total;
|
|
|
+ this.loading = false;
|
|
|
+ });
|
|
|
+ },
|
|
|
+ DataSelect(e) {
|
|
|
+ this.selectData = e;
|
|
|
+ },
|
|
|
+ goPage(type, row) {
|
|
|
+ if (type == 1) {
|
|
|
+ this.$router.push({ path: "/cms/SealApprove/edit", query: { type } });
|
|
|
+ } else {
|
|
|
+ this.$router.push({
|
|
|
+ path: "/cms/SealApprove/edit",
|
|
|
+ query: { type, seal_no: row.seal_no, state: row.state },
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
+ },
|
|
|
+ beforeRouteLeave(to, from, next) {
|
|
|
+ if (to.path == "/cms/SealApprove/edit") {
|
|
|
+ next();
|
|
|
+ } else {
|
|
|
+ from.meta.keepAlive = false;
|
|
|
+ next();
|
|
|
}
|
|
|
-}
|
|
|
+ },
|
|
|
+};
|
|
|
</script>
|
|
|
<style lang="scss" scoped>
|
|
|
-.content{
|
|
|
- height: 85%;
|
|
|
- overflow: auto;
|
|
|
- .form_content{
|
|
|
- margin-top:10px;
|
|
|
- display: flex;
|
|
|
- flex-wrap: wrap;
|
|
|
- .form_item{
|
|
|
- width:200px
|
|
|
- }
|
|
|
- }
|
|
|
- .before_table{
|
|
|
- display: flex;
|
|
|
- flex-direction: row-reverse;
|
|
|
- margin-bottom: 10px;
|
|
|
- }
|
|
|
+.content {
|
|
|
+ height: 85%;
|
|
|
+ overflow: auto;
|
|
|
+ .form_content {
|
|
|
+ margin-top: 10px;
|
|
|
+ display: flex;
|
|
|
+ flex-wrap: wrap;
|
|
|
+ .form_item {
|
|
|
+ width: 200px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .before_table {
|
|
|
+ display: flex;
|
|
|
+ flex-direction: row-reverse;
|
|
|
+ margin-bottom: 10px;
|
|
|
+ }
|
|
|
}
|
|
|
-.pageSlotStyle{
|
|
|
- text-align: center;
|
|
|
- margin-top:10px;
|
|
|
+.pageSlotStyle {
|
|
|
+ text-align: center;
|
|
|
+ margin-top: 10px;
|
|
|
}
|
|
|
</style>
|