| | |
| | | <div class="app-container"> |
| | | <div style="display: flex;justify-content: space-between;margin-bottom: 20px"> |
| | | <el-form :inline="true" style="display: flex;align-items: center;flex-wrap: wrap;" > |
| | | <el-radio-group v-model="queryParams.type"> |
| | | <el-radio-group v-model="queryParams.status" @change="getList"> |
| | | <el-radio-button label="" >全部</el-radio-button> |
| | | <el-radio-button label="1">签署中</el-radio-button> |
| | | <el-radio-button label="0">签署中</el-radio-button> |
| | | <el-radio-button label="2" >已归档</el-radio-button> |
| | | </el-radio-group> |
| | | <!-- <el-form-item label="仓库名称:" >--> |
| | |
| | | <!-- 表格数据 --> |
| | | <el-table v-loading="loading" :data="dataList" :border="true"> |
| | | <el-table-column label="序号" type="index" align="center" width="80" /> |
| | | <el-table-column label="项目名称" prop="name" align="center" /> |
| | | <el-table-column label="模板ID" prop="remark" align="center" /> |
| | | <el-table-column label="发起部门" prop="remark" align="center" /> |
| | | <el-table-column label="发起时间" prop="remark" align="center" /> |
| | | <el-table-column label="最初签署人" prop="remark" align="center" /> |
| | | <el-table-column label="项目名称" prop="itemName" align="center" /> |
| | | <el-table-column label="模板ID" prop="templateId" align="center" /> |
| | | <el-table-column label="发起部门" prop="deptName" align="center" /> |
| | | <el-table-column label="发起时间" prop="originateTime" align="center" /> |
| | | <el-table-column label="最初签署人" prop="initiaiUserName" align="center" /> |
| | | <el-table-column label="流转记录" prop="count" align="center" > |
| | | <template #default="scope"> |
| | | <span style="color: #1890ff;cursor: pointer" @click="record(scope.row)">{{scope.row.count}}</span> |
| | | <span style="color: #1890ff;cursor: pointer" @click="record(scope.row)">{{scope.row.flowCount}}</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="签署状态" prop="remark" align="center" /> |
| | | <el-table-column label="签署状态" prop="itemStatus" align="center" > |
| | | <template #default="scope"> |
| | | <span>{{scope.row.itemStatus == 0 ? '签署中' : scope.row.itemStatus == 1 ? '已签署' :scope.row.itemStatus == 2 ? '已归档' : '' }}</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="250" > |
| | | <template #default="scope"> |
| | | <el-button link type="primary" >预览</el-button> |
| | | <el-button link type="primary" @click="circulationBtn(scope.row)" >流转</el-button> |
| | | <el-button link type="primary" >确认归档</el-button> |
| | | <el-button link type="primary" @click="view(scope.row)">预览</el-button> |
| | | <el-button link type="primary" v-if="scope.row.itemStatus !=2 && (data.userRole.includes('admin') || data.userRole.includes('suprice') ) " @click="circulationBtn(scope.row)" >流转</el-button> |
| | | <el-button link type="primary" v-if="scope.row.itemStatus !=2 &&(data.userRole.includes('admin') || data.userRole.includes('suprice')) && scope.row.isAbleArchive " @click="archiveBtn(scope.row)">确认归档</el-button> |
| | | <el-button link type="danger" @click="handleDelete(scope.row)">删除</el-button> |
| | | </template> |
| | | </el-table-column> |
| | |
| | | /> |
| | | <circulation ref="circulationRef" @getList="getList"></circulation> |
| | | <timeRecord ref="timeRecordRef" @getList="getList"></timeRecord> |
| | | <!-- <view-p ref="viewPRef" @getList="getList"></view-p>--> |
| | | </div> |
| | | </template> |
| | | |
| | |
| | | import {ElMessage, ElMessageBox} from "element-plus"; |
| | | import circulation from './components/circulation' |
| | | import timeRecord from './components/record.vue' |
| | | import viewP from './components/viewPdf.vue' |
| | | import {delSignProject, getSignProject, signArchive} from "@/api/signAgreement/signProject"; |
| | | import Cookies from "js-cookie"; |
| | | const { proxy } = getCurrentInstance(); |
| | | const loading = ref(false); |
| | | const dialogRef = ref(); |
| | | const circulationRef = ref(); |
| | | const cupDialogRef = ref(); |
| | | const viewPRef = ref(); |
| | | const timeRecordRef = ref() |
| | | const data = reactive({ |
| | | queryParams: { |
| | | pageNum: 1, |
| | | pageSize: 10, |
| | | type: '' |
| | | status: '' |
| | | }, |
| | | userRole:[], |
| | | user: {}, |
| | | total: 0, |
| | | dataList: [] |
| | | }); |
| | |
| | | const classHourRef = ref(); |
| | | onMounted(()=>{ |
| | | getList() |
| | | data.userRole = JSON.parse(Cookies.get('userRole')) |
| | | data.user = JSON.parse(Cookies.get('userInfo')) |
| | | }) |
| | | |
| | | onUnmounted(()=>{ |
| | |
| | | |
| | | const getList = async () => { |
| | | loading.value = true |
| | | // const res = await getWarehouse(data.queryParams) |
| | | // if(res.code == 200){ |
| | | // data.dataList = res.data.list |
| | | // data.total = res.data.total |
| | | // }else{ |
| | | // ElMessage.warning(res.message) |
| | | // } |
| | | data.dataList = [ |
| | | { |
| | | id: 1, |
| | | name: 'xxx', |
| | | count: 2 |
| | | } |
| | | ] |
| | | const res = await getSignProject(data.queryParams) |
| | | if(res.code == 200){ |
| | | data.dataList = res.rows.map(item => { |
| | | return { |
| | | ...item, |
| | | flowCount: item.signatureFlows && item.signatureFlows.length >0 ? item.signatureFlows.length : 0 |
| | | } |
| | | }) |
| | | data.dataList.forEach(item => { |
| | | let isAble = true |
| | | item.signatureFlows.forEach(i => { |
| | | if(i.signStatus !=1){ |
| | | isAble = false |
| | | } |
| | | }) |
| | | item.isAbleArchive = isAble |
| | | }) |
| | | console.log('1',data.dataList) |
| | | data.total = res.total |
| | | }else{ |
| | | ElMessage.warning(res.message) |
| | | } |
| | | loading.value = false |
| | | } |
| | | |
| | |
| | | dialogRef.value.openDialog(type, value); |
| | | } |
| | | const record = (val) => { |
| | | timeRecordRef.value.openDialog(val) |
| | | if(val.flowCount > 0){ |
| | | timeRecordRef.value.openDialog(val) |
| | | }else { |
| | | ElMessage.warning('暂无流转记录') |
| | | } |
| | | |
| | | } |
| | | |
| | | const circulationBtn = (value) => { |
| | | circulationRef.value.openDialog(value) |
| | | } |
| | | const view = (val) => { |
| | | const url =import.meta.env.VITE_APP_BASE_API +val.itemFile |
| | | window.open(url) |
| | | } |
| | | const archiveBtn = (val) => { |
| | | ElMessageBox.confirm( |
| | | '确定项目归档?', |
| | | '提示', |
| | | { |
| | | confirmButtonText: '确定', |
| | | cancelButtonText: '取消', |
| | | type: 'warning', |
| | | }) |
| | | |
| | | .then( async() => { |
| | | console.log('1111',val) |
| | | const param = { |
| | | itemId: val.id, |
| | | filePath: val.itemFile, |
| | | userId: data.user.userId |
| | | } |
| | | const res = await signArchive(param) |
| | | if(res.code == 200){ |
| | | ElMessage.success('项目归档成功') |
| | | await getList() |
| | | }else{ |
| | | ElMessage.warning(res.message) |
| | | } |
| | | }) |
| | | } |
| | | /** 重置新增的表单以及其他数据 */ |
| | | function reset() { |
| | | data.queryParams = { |
| | | pageNum: 1, |
| | | pageSize: 10, |
| | | name: '' |
| | | status: '' |
| | | } |
| | | getList() |
| | | } |
| | |
| | | type: 'warning', |
| | | }) |
| | | .then( async() => { |
| | | const res = await delWarehouse(val.id) |
| | | const res = await delSignProject(val.id) |
| | | if(res.code == 200){ |
| | | ElMessage.success('数据删除成功') |
| | | await getList() |
| | |
| | | ElMessage.warning(res.message) |
| | | } |
| | | }) |
| | | } |
| | | const delCup = (val) => { |
| | | ElMessageBox.confirm( |
| | | '确定删除此条数据?', |
| | | '提示', |
| | | { |
| | | confirmButtonText: '确定', |
| | | cancelButtonText: '取消', |
| | | type: 'warning', |
| | | }) |
| | | .then( async() => { |
| | | const res = await delCupboard(val.id) |
| | | if(res.code == 200){ |
| | | ElMessage.success('数据删除成功') |
| | | await getList() |
| | | }else{ |
| | | ElMessage.warning(res.message) |
| | | } |
| | | }) |
| | | } |
| | | const addCupboard = (type,value) => { |
| | | cupDialogRef.value.openDialog(type, value); |
| | | } |
| | | |
| | | const getRowKeys = (row) => { |
| | | return row.name |
| | | } |
| | | |
| | | </script> |