123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110 |
- <template>
- <div id="index">
- <el-row>
- <el-col :span="24" class="top">
- <topInfo :topTitle="topTitle" :display="display" @add="add"></topInfo>
- </el-col>
- <el-col :span="24" class="main">
- <el-col :span="24" class="list">
- <tNewAssignList :tableData="tableData" :total="total" @deleteRow="deleteRow" @select="select" @updateState="updateState"></tNewAssignList>
- </el-col>
- </el-col>
- </el-row>
- </div>
- </template>
- <script>
- import topInfo from '@/layout/custom/topInfo.vue';
- import tNewAssignList from '@/layout/tNewAssign/tNewAssignList.vue';
- import { mapState, createNamespacedHelpers, mapGetters } from 'vuex';
- const { mapActions: tNewAssign } = createNamespacedHelpers('tNewAssign');
- const { mapActions: dictionary } = createNamespacedHelpers('dictionary');
- export default {
- name: 'index',
- props: {},
- components: {
- topInfo, //头部导航
- tNewAssignList, //列表
- },
- data: () => ({
- topTitle: '企业申请信息指派',
- display: '',
- tableData: [],
- total: 0,
- }),
- created() {
- this.select();
- },
- computed: {
- ...mapState(['user']),
- },
- methods: {
- ...tNewAssign(['create', 'delete', 'update', 'fetch', 'query']),
- ...dictionary({dictQuery:'query'}),
- async select({ skip = 0, limit = 10, ...info } = {}) {
- const res = await this.query({ skip, limit, ...info });
- if (this.$checkRes(res)) {
- this.$set(this, `tableData`, res.data);
- this.$set(this, `total`, res.total);
- }
- },
- add() {
- this.$router.push({ path: '/tDeclarationApproval/detail' });
- },
- async deleteRow({ id, skip = 0, limit = 10, ...info } = {}) {
- const res = await this.delete(id);
- this.$checkRes(res, '删除成功', '删除失败');
- this.select({ skip, limit, ...info });
- },
- async publish({ row ,skip = 0, limit = 10, ...info } = {}){
- let res = await this.update({id:row.id,publish_state:1,publish_state_description:'已发布',publish_time:new Date().getTime()});
- this.$checkRes(res, '发布成功', '发布失败');
- this.select({ skip, limit, ...info });
- },
- async updateState({ id ,state ,result,skip = 0, limit = 10, ...info } = {}){
- let res = null;
- switch(state)
- {
- case '0':
- break ;
- case '1':
- res = await this.state({id:id,current_approval_id:this.user.uid,state:state,state_description:'',result_description:result});
- this.$checkRes(res, '审核成功', '审核失败');
- break;
- case '2':
- res = await this.state({id:id,current_approval_id:this.user.uid,state:state,state_description:'',result_description:result});
- this.$checkRes(res, '审核成功', '审核失败');
- break;
- case '3':
- res = await this.state({id:id,current_approval_id:this.user.uid,state:state,state_description:'',result_description:result});
- this.$checkRes(res, '停用成功', '停用失败');
- break;
- case '9':
- res = await this.state({id:id,current_approval_id:this.user.uid,state:state,state_description:'',result_description:result});
- this.$checkRes(res, '完成成功', '完成失败');
- break;
- }
- this.select({ skip, limit, ...info });
- },
- },
- };
- </script>
- <style lang="less" scoped>
- .top {
- height: 50px;
- margin: 0 0 10px 0;
- }
- .main {
- min-height: 765px;
- background: #ffffff;
- }
- .search {
- width: 97%;
- height: 35px;
- margin: 20px;
- }
- .list {
- padding: 0 20px;
- }
- </style>
|