Commit 3300a1f0 by cwy

多个pdf文件问题

parent c73e05c7
......@@ -102,6 +102,13 @@ export function productApi() {
data,
});
},
collectStatistics: (data) => {
return request({
url: '/api/enterpriseAllocation/collectStatistics',
method: 'post',
data,
});
},
};
}
......
......@@ -24,6 +24,13 @@ export function taskApi() {
data,
});
},
exportDataFile: (data) => {
return request({
url: '/api/exportData',
method: 'post',
data,
});
},
};
}
......
......@@ -3,28 +3,28 @@ export function getHost() {
if (process.env.NODE_ENV === 'development') {
return '/dev'
} else {
return '/element-plus-api_v1'
return '/product_library_api'
}
}
export function getUploadUrl() {
if (process.env.NODE_ENV === 'development') {
return '/dev/api/upload/picture'
} else {
return '/element-plus-api_v1/api/upload/picture'
return '/product_library_api/api/upload/picture'
}
}
export function getUploadPdf() {
if (process.env.NODE_ENV === 'development') {
return '/dev/api/getUploadUrl'
} else {
return '/element-plus-api_v1/api/getUploadUrl'
return '/product_library_api/api/getUploadUrl'
}
}
export function getServerUrl() {
if (process.env.NODE_ENV === 'development') {
return '/dev/api'
} else {
return '/element-plus-api_v1/api'
return '/product_library_api/api'
}
}
......
......@@ -5,15 +5,7 @@
</div>
<div class="header-search flex space-between">
<!-- <div>
<el-select v-model="state.apiListParam.task_id" placeholder="请选择任务" size="default" @change="searchChange" clearable filterable style="width:200px;margin-right: 20px;">
<el-option v-for="(item, index) in state.taskList" :key="index" :label="item.name"
:value="item.id"></el-option>
</el-select>
</div> -->
<!-- <el-button size="default" type="primary" @click="add()" >新增产品</el-button>
<el-button size="default" type="primary" @click="distribute()" >产品分发</el-button> -->
<!-- <el-button size="default" type="primary" @click="impor()" >导入企业</el-button> -->
</div>
<div class="page-main" ref="pageMain">
......@@ -22,6 +14,8 @@
<el-table :data="state.tableData.data" style="width: 100%" :height="state.tableHeight"
ref="multipleTableRef">
<el-table-column label="序号" type="index" width="100" show-overflow-tooltip align="center"></el-table-column>
<el-table-column prop="enterprise_name" label="企业名称" key="enterprise_name" v-if="columns[0].visible" width="300" show-overflow-tooltip align="center"></el-table-column>
<el-table-column prop="product_id" label="产品ID" key="product_id" v-if="columns[0].visible" width="200" show-overflow-tooltip align="center"></el-table-column>
<el-table-column prop="page_url" label="页面URL" key="page_url" v-if="columns[2].visible" width="200" align="center">
<template #default="scope">
......@@ -44,7 +38,7 @@
<el-tag type="danger" v-if="scope.row.inspect_status ==5">数据废弃</el-tag>
</template>
</el-table-column>
<el-table-column prop="adminInfo.name" label="检查人员" key="verify_user_id" v-if="columns[9].visible" width="200" align="center"></el-table-column>
<el-table-column prop="name" label="检查人员" key="name" v-if="columns[9].visible" width="200" align="center"></el-table-column>
<el-table-column prop="inspect_time" key="inspect_time" label="检查时间" v-if="columns[10].visible" width="200" align="center">
<template #default="scope">
<el-tag type="info" v-if="scope.row.inspect_time ==''||scope.row.inspect_time ==null||scope.row.inspect_time ==undefined">待检查</el-tag>
......@@ -103,6 +97,8 @@ const state = reactive({
apiListParam: {
page: 1,
limit: 10,
user_id:'',
enterprise_id:'',
},
tableData: {
data: [],
......@@ -117,6 +113,8 @@ const state = reactive({
// 页面加载时
onMounted(() => {
state.apiListParam.user_id = router.currentRoute.value.query.user_id
state.apiListParam.enterprise_id = router.currentRoute.value.query.enterprise_id
getList()
state.tableHeight = getCurrentInstance().refs.pageMain.offsetHeight - 130 - 52 + "px";
});
......
......@@ -38,7 +38,7 @@
<el-table-column prop="parameter" label="规格参数" key="parameter" v-if="columns[7].visible" width="200" show-overflow-tooltip align="center"></el-table-column>
<el-table-column prop="verify_type" key="verify_type" v-if="columns[12].visible" label="数据状态" width="200" align="center">
<template #default="scope">
<el-tag type="info" v-if="scope.row.inspect_status ==''||scope.row.inspect_status ==null||scope.row.inspect_status ==0">分配</el-tag>
<el-tag type="info" v-if="scope.row.inspect_status ==''||scope.row.inspect_status ==null||scope.row.inspect_status ==0">检查</el-tag>
<el-tag v-if="scope.row.inspect_status ==1">检查完成</el-tag>
<el-tag type="warning" v-if="scope.row.inspect_status ==2">检查中</el-tag>
<el-tag type="danger" v-if="scope.row.inspect_status ==3">检查异常</el-tag>
......
......@@ -277,6 +277,7 @@ const page_turning = (num) => {
defineExpose({
});
/**
* 返回上一级页面
*/
......
......@@ -55,7 +55,7 @@
userList:[],
userId:'',
verifyTypeList:[
{name:'待分配',value:0},
{name:'待检查',value:0},
{name:'检查完成',value:1},
{name:'检查中',value:'2'},
{name:'数据异常',value:'3'},
......
<template>
<div class="system-role-dialog-container">
<el-dialog :title="state.dialog.title" v-model="state.dialog.isShowDialog" width="700px" @close="closeDialog" :close-on-click-modal="false">
<el-form ref="dialogFormRef" :model="state.ruleForm" :rules="state.rules" size="default" label-width="200px"
v-loading="state.dataLoading" label-position="right" style="width:100%">
<el-divider>模糊搜索条件</el-divider>
<el-form-item label="请选择人员" prop="inspect_status">
<el-select v-model="state.ruleForm.inspect_status" filterable placeholder="请选择检查员" size="default" style="width: 100%;">
<el-option v-for="(item, index) in state.verifyTypeList" :key="index" :label="item.name"
:value="item.value"></el-option>
</el-select>
</el-form-item>
</el-form>
<template #footer>
<span class="dialog-footer">
<el-button @click="closeDialog()" size="default">取 消</el-button>
<el-button type="primary" :loading="state.btnLoading" @click="onSubmit(dialogFormRef)"
size="default">确认</el-button>
</span>
</template>
</el-dialog>
</div>
</template>
<script setup name="systemRoleDialog">
import { ElMessage } from 'element-plus';
import { enterpriseApi } from '/@/api/enterpriseInfo'
import { Session } from '/@/utils/storage';
// 定义子组件向父组件传值/事件
// const emit = defineEmits(['refresh']);
const emits = defineEmits(['search-to-parent']);
// 定义变量内容
const dialogFormRef = ref();
const state = reactive({
taskId: null,
ruleForm: {
},
rules: {
},
dialog: {
isShowDialog: false,
title: '搜索条件',
submitTxt: '',
},
dataLoading: false,
btnLoading: false,
userList:[],
userId:'',
verifyTypeList:[
{name:'待检查',value:0},
{name:'检查完成',value:1},
{name:'检查中',value:'2'},
{name:'数据异常',value:'3'},
{name:'检查异常',value:'4'},
{name:'数据废弃',value:'5'}
],
enterpriseList:[
],
enterpriseId:'',
});
// 打开弹窗
const openDialog = () => {
state.dialog.isShowDialog = true;
state.dialog.title = '搜索条件';
};
// 关闭弹窗
const closeDialog = () => {
dialogFormRef.value.resetFields();
state.dialog.isShowDialog = false;
};
// 提交
const onSubmit = () => {
emits('search-to-parent', state.ruleForm);
// state.ruleForm = {};
};
// 暴露变量
defineExpose({
openDialog,
});
onMounted(() => {
});
</script>
<style scoped lang="scss"></style>
\ No newline at end of file
......@@ -5,39 +5,43 @@
</div>
<div class="header-search flex space-between">
<el-page-header @back="backToPreviousPage" content="列表页面">
<el-page-header @back="backToPreviousPage" content="统计页面">
</el-page-header>
</div>
<div class="page-main" ref="pageMain">
<el-card shadow="hover" style="height:100%;">
<el-tag class="er">企业数量:{{state.tableData.total.enterprise_quantity}}</el-tag>
<el-tag class="er">产品数量:{{state.tableData.total.product_quantity}}</el-tag>
<el-tag class="er" type="success">已完成产品数量:{{state.tableData.total.completed_product}}</el-tag>
<el-tag class="er" type="danger">未完成产品数量:{{state.tableData.total.unfinished_product}}</el-tag>
<!-- <Toolbar ref="ToolbarRef" v-model:showSearch="showSearch" @queryTable="getList" @search="search" :columns="columns"/> -->
<el-table :data="state.tableData.data" style="width: 100%" :height="state.tableHeight"
ref="multipleTableRef">
<el-table-column label="序号" type="index" width="100" show-overflow-tooltip align="center"></el-table-column>
<el-table-column prop="enterpriseInfo.enterprise_name" label="企业名称" key="product_categ_name" align="center"></el-table-column>
<el-table-column prop="adminInfo.name" label="检查人员" key="product_name" align="center"></el-table-column>
<el-table-column prop="total" label="产品总数" key="product_model" width="200" align="center">
<template #default="scope"><span style="color: #409EFF;">{{scope.row.total }}</span></template>
<el-table-column prop="user_name" label="检查员" key="user_name" align="center"></el-table-column>
<el-table-column prop="enterprise_quantity" label="企业数量" key="enterprise_quantity" align="center"></el-table-column>
<el-table-column prop="product_quantity" label="产品总数" key="product_quantity" width="200" align="center">
<template #default="scope"><span style="color: #409EFF;">{{scope.row.product_quantity }}</span></template>
</el-table-column>
<el-table-column prop="not_checked" label="未检查数量" key="product_model" width="200" align="center">
<template #default="scope"><span style="color: #E6A23C;">{{scope.row.not_checked }}</span></template>
<el-table-column prop="unfinished_product" label="未检查数量" key="unfinished_product" width="200" align="center">
<template #default="scope"><span style="color: #E6A23C;">{{scope.row.unfinished_product }}</span></template>
</el-table-column>
<el-table-column prop="checked" label="已检查数量" key="product_model" width="200" align="center">
<template #default="scope"><span style="color: #67C23A;">{{scope.row.checked }}</span></template>
<el-table-column prop="completed_product" label="已检查数量" key="completed_product" width="200" align="center">
<template #default="scope"><span style="color: #67C23A;">{{scope.row.completed_product }}</span></template>
</el-table-column>
<el-table-column prop="enterprise_status" label="完成情况" key="enterprise_status" align="center">
<template #default="scope">
<el-tag v-if="scope.row.enterprise_status=='已完成'">{{scope.row.enterprise_status}}</el-tag>
<el-tag type="warning" v-if="scope.row.enterprise_status=='未完成'">{{scope.row.enterprise_status}}</el-tag>
</template>
</el-table-column>
<el-table-column label="操作" width="200" align="center">
<template #default="scope">
<el-button size="small" @click="assigned(scope.row.user_id)" type="primary">查看详情</el-button>
</template>
</el-table-column>
<el-table-column prop="distribute_time" label="分发时间" key="product_model" align="center"></el-table-column>
</el-table>
<div class="pagination-box">
<el-pagination @size-change="onHandleSizeChange" @current-change="onHandleCurrentChange" class="mt15"
:pager-count="5" :page-sizes="[10, 20, 30]" v-model:current-page="state.apiListParam.page" background
v-model:page-size="state.apiListParam.limit" layout="total, sizes, prev, pager, next, jumper"
:total="state.tableData.total">
</el-pagination>
</div>
</el-card>
</div>
<AddDialog ref="AddDialogRef" @refresh="getList()" />
......@@ -106,7 +110,7 @@ const onHandleCurrentChange = (val) => {
// 获取列表
const getList = () => {
state.apiListParam.department_id = state.query_id
productApi().enterpriseAllocationList(state.apiListParam).then(res => {
productApi().collectStatistics(state.apiListParam).then(res => {
state.tableData.data = res.data.data
state.tableData.total = res.data.total
}).catch(() => {
......@@ -120,6 +124,14 @@ const getList = () => {
// this.$router.push('/target')
router.push({ path: '/task/user_task_group'});
}
/**
* 进入详情页面
*/
const assigned = (user_id) => {
router.push({ path: '/task/enterprise_allocation', query: { user_id: user_id }});
}
created:{
if(router.currentRoute.value.query.id =="" ||router.currentRoute.value.query.id==null|| router.currentRoute.value.query.id==undefined){
router.push({ path: '/task/user_task_group'});
......@@ -136,4 +148,7 @@ created:{
.page-main {
height: calc(100vh - 50px - 106px);
}
.er{
margin-right: 10px;
}
</style>
......@@ -5,21 +5,11 @@
</div>
<div class="header-search flex space-between">
<!-- <div>
<el-select v-model="state.apiListParam.task_id" placeholder="请选择任务" size="default" @change="searchChange" clearable filterable style="width:200px;margin-right: 20px;">
<el-option v-for="(item, index) in state.taskList" :key="index" :label="item.name"
:value="item.id"></el-option>
</el-select>
</div> -->
<!-- <el-button size="default" type="primary" @click="add()" >新增产品</el-button>
<el-button size="default" type="primary" @click="distribute()" >产品分发</el-button> -->
<!-- <el-button size="default" type="primary" @click="allocation()" >分配任务</el-button> -->
<el-button size="default" type="primary" @click="allocation()" >分配任务</el-button>
<el-button type="info" @click="backToPreviousPage">返回页面</el-button>
</div>
<div class="page-main" ref="pageMain">
<el-card shadow="hover" style="height:100%;">
<!-- <Toolbar ref="ToolbarRef" v-model:showSearch="showSearch" @queryTable="getList" @search="search" :columns="columns"/> -->
<Toolbar ref="ToolbarRef" v-model:showSearch="showSearch" @queryTable="getList" @search="search" :columns="columns"/>
<el-table :data="state.tableData.data" style="width: 100%" :height="state.tableHeight"
ref="multipleTableRef">
<el-table-column label="序号" type="index" width="100" show-overflow-tooltip align="center"></el-table-column>
......@@ -35,6 +25,11 @@
<template #default="scope"><span style="color: #67C23A;">{{scope.row.checked }}</span></template>
</el-table-column>
<el-table-column prop="distribute_time" label="分发时间" key="product_model" align="center"></el-table-column>
<el-table-column label="操作" width="200" align="center">
<template #default="scope">
<el-button size="small" @click="allocation(scope.row.adminInfo.id,scope.row.enterpriseInfo.id)" type="primary">查看详情</el-button>
</template>
</el-table-column>
</el-table>
......@@ -48,9 +43,6 @@
</el-card>
</div>
<AddDialog ref="AddDialogRef" @refresh="getList()" />
<SetupDialog ref="SetupDialogRef" @refresh="getList()" />
<Search ref="SearchDialogRef" @search-to-parent="searchData" />
</div>
</template>
......@@ -62,10 +54,6 @@ import { ElMessageBox, ElMessage } from 'element-plus';
import { Session } from '/@/utils/storage';
// 引入组件
const Breadcrumb = defineAsyncComponent(() => import('/@/layout/navBars/breadcrumb/breadcrumb.vue'));
const SetupDialog = defineAsyncComponent(() => import('/@/views/product_info/list/setup.vue'));
const AddDialog = defineAsyncComponent(() => import('/@/views/product_info/list/add.vue'));
const Toolbar = defineAsyncComponent(() => import('/@/components/RightToolbar/index.vue'));
const Search = defineAsyncComponent(() => import('/@/views/product_info/list/search.vue'));
// 定义变量内容
const AddDialogRef = ref()
......@@ -77,6 +65,7 @@ const state = reactive({
apiListParam: {
page: 1,
limit: 10,
user_id:'',
},
tableData: {
data: [],
......@@ -86,11 +75,15 @@ const state = reactive({
normListExtend:[],
testIndex:0,
taskList:[],
verifyTypeList:['待检查','已检查'],
});
// 页面加载时
onMounted(() => {
if(router.currentRoute.value.query.user_id =="" ||router.currentRoute.value.query.user_id==null|| router.currentRoute.value.query.user_id==undefined){
router.push({ path: '/task/user_task_group'});
}else{
state.apiListParam.user_id = router.currentRoute.value.query.user_id
}
getList()
state.tableHeight = getCurrentInstance().refs.pageMain.offsetHeight - 130 - 52 + "px";
});
......@@ -98,31 +91,6 @@ onMounted(() => {
const emits = defineEmits(['update:showSearch', 'queryTable','search','refresh']);
const search = () => {
SearchDialogRef.value.openDialog();
}
/**
* 搜索条件
*/
const searchData = (va) => {
console.log(va)
productApi().list({search:va}).then(res => {
state.tableData.data = res.data.data
state.tableData.total = res.data.total
}).catch(() => {
})
}
/**
* 重置按钮
*/
const reset = () => {
state.apiListParam.page = 1
state.apiListParam.name = '';
getList()
}
// 分页改变
const onHandleSizeChange = (val) => {
state.apiListParam.limit = val;
......@@ -143,53 +111,28 @@ const getList = () => {
}
/**
* 点击添加
*/
const add = () => {
AddDialogRef.value.openDialog();
}
/**
* 点击添加
*/
const distribute = () => {
DistributeDialogRef.value.openDialog();
}
/**
* 点击查看
* 返回上一级页面
*/
const setup = (id) => {
router.push({ path: '/product_info/inspect', query: { id: id }});
}
const allocation = () => {
productApi().equalDistributionEnterprise().then(res => {
ElMessage.success('分配成功!');
getList();
}).catch(() => {
getList();
})
const backToPreviousPage = () => {
// this.$router.push('/target')
router.go(-1);
}
/**
* 企业信息类型显示
* @param {*} data
*/
const verifyType= (data) => {
if(state.verifyTypeList[parseInt(data)] ===undefined){
return data
}else{
return state.verifyTypeList[parseInt(data)]
}
const allocation = (user_id,enterprise_id) => {
router.push({ path: '/product_info/allocation', query: { user_id: user_id,enterprise_id: enterprise_id }});
}
// const allocation = () => {
// productApi().equalDistributionEnterprise().then(res => {
// ElMessage.success('分配成功!');
// getList();
// }).catch(() => {
// getList();
// })
// }
</script>
<style lang="scss" scoped>
.page-main {
height: calc(100vh - 50px - 106px);
height: calc(100vh - 50px - 116px);
}
</style>
......@@ -34,6 +34,11 @@
<template #default="scope"><span style="color: #67C23A;">{{scope.row.checked }}</span></template>
</el-table-column>
<el-table-column prop="distribute_time" label="分发时间" key="product_model" align="center"></el-table-column>
<el-table-column label="操作" width="200" align="center">
<template #default="scope">
<el-button size="small" @click="allocation(scope.row.adminInfo.id,scope.row.enterpriseInfo.id)" type="primary">查看详情</el-button>
</template>
</el-table-column>
</el-table>
......@@ -97,9 +102,6 @@ onMounted(() => {
const emits = defineEmits(['update:showSearch', 'queryTable','search','refresh']);
const search = () => {
SearchDialogRef.value.openDialog();
}
/**
* 搜索条件
*/
......@@ -113,14 +115,6 @@ const search = () => {
}
/**
* 重置按钮
*/
const reset = () => {
state.apiListParam.page = 1
state.apiListParam.name = '';
getList()
}
// 分页改变
const onHandleSizeChange = (val) => {
......@@ -141,48 +135,11 @@ const getList = () => {
})
}
/**
* 点击添加
*/
const add = () => {
AddDialogRef.value.openDialog();
}
/**
* 点击添加
*/
const distribute = () => {
DistributeDialogRef.value.openDialog();
}
/**
* 点击查看
*/
const setup = (id) => {
router.push({ path: '/product_info/inspect', query: { id: id }});
}
const allocation = () => {
productApi().equalDistributionEnterprise().then(res => {
ElMessage.success('分配成功!');
getList();
}).catch(() => {
getList();
})
}
/**
* 企业信息类型显示
* @param {*} data
* 进入详情页面
*/
const verifyType= (data) => {
if(state.verifyTypeList[parseInt(data)] ===undefined){
return data
}else{
return state.verifyTypeList[parseInt(data)]
}
const allocation = (user_id,enterprise_id) => {
router.push({ path: '/product_info/allocation', query: { user_id: user_id,enterprise_id: enterprise_id }});
}
</script>
......
......@@ -16,9 +16,10 @@
<el-table-column label="序号" type="index" width="100" show-overflow-tooltip align="center"></el-table-column>
<el-table-column prop="name" label="采集组名称" key="name" align="center"></el-table-column>
<el-table-column prop="number" label="人数" key="product_name" align="center"></el-table-column>
<el-table-column label="操作" width="200" fixed="right" align="center">
<el-table-column label="操作" align="center">
<template #default="scope">
<el-button size="small" @click="viewAllocation(scope.row.id)" type="primary">查看分配数据</el-button>
<el-button size="small" @click="viewAllocation(scope.row.id)" type="primary">查看统计数据</el-button>
<el-button size="small" @click="exportData" type="danger">导出数据</el-button>
</template>
</el-table-column>
</el-table>
......@@ -95,7 +96,21 @@ const getList = () => {
})
}
// 导出文件
const exportData = () => {
taskApi().exportDataFile().then(res => {
// let url = getServerPublic()+'/public/template.xlsx';
const iframe = document.createElement('iframe'); // 创建一个HTML 元素
iframe.style.display = 'none'; // 隐藏iframe 防止影响页面
iframe.style.height = 0; // 高度设置0 防止影响页面
iframe.src = res.data;// 下载链接
document.body.appendChild(iframe); // 这一行必须,iframe挂在到dom树上才会发请求 // 5分钟之后删除
setTimeout(() => { iframe.remove(); }, 5 * 60 * 1000);
ElMessage.success('下载成功,请点击下载列表查看!');
}).catch(() => {
})
}
/**
* 点击添加
*/
......
......@@ -37,7 +37,7 @@ const viteConfig = defineConfig((mode) => {
hmr: true,
proxy: {
'/dev': {
target: 'http://gcspider.raisound.com:81/element-plus-api_v1',
target: 'http://gcspider.raisound.com:81/product_library_api',
// target: 'http://192.168.10.168/smart-detection',
ws: true,
changeOrigin: true,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment