Commit dfda4d33 by cwy

多个pdf文件问题

parent 110aef9a
import request from '/@/utils/request';
/**
* (不建议写成 request.post(xxx),因为这样 post 时,无法 params 与 data 同时传参)
*
* 任务相关api接口集合
* @method taskPackageList 任务包列表
* @method taskPackageAdd 发布任务
*/
export function productApi() {
return {
list: (data) => {
return request({
url: '/api/product/list',
method: 'post',
data,
});
},
apiAdd: (data) => {
return request({
url: '/api/product/add',
method: 'post',
data,
});
},
apiDelete: (data) => {
return request({
url: '/api/product/delete',
method: 'post',
data,
});
},
apiSave: (data) => {
return request({
url: '/api/product/save',
method: 'post',
data,
});
},
unallocatedProducts: (data) => {
return request({
url: '/api/product/unallocatedProducts',
method: 'post',
data,
});
},
productAllocationAdd: (data) => {
return request({
url: '/api/productAllocation/add',
method: 'post',
data,
});
},
productAllocationList: (data) => {
return request({
url: '/api/productAllocation/list',
method: 'post',
data,
});
},
productAllocationSee: (data) => {
return request({
url: '/api/productAllocation/see',
method: 'post',
data,
});
},
productAllocationSave: (data) => {
return request({
url: '/api/productAllocation/save',
method: 'post',
data,
});
},
productAllocationAbnormal: (data) => {
return request({
url: '/api/productAllocation/abnormal',
method: 'post',
data,
});
},
enterpriseAllocationList: (data) => {
return request({
url: '/api/enterpriseAllocation/list',
method: 'post',
data,
});
},
equalDistributionEnterprise: (data) => {
return request({
url: '/api/enterpriseAllocation/equalDistributionEnterprise',
method: 'post',
data,
});
},
};
}
...@@ -95,6 +95,13 @@ export function productApi() { ...@@ -95,6 +95,13 @@ export function productApi() {
data, data,
}); });
}, },
userEnterpriseList: (data) => {
return request({
url: '/api/enterpriseAllocation/userEnterpriseList',
method: 'post',
data,
});
},
}; };
} }
......
import request from '/@/utils/request';
/**
* (不建议写成 request.post(xxx),因为这样 post 时,无法 params 与 data 同时传参)
*
* 任务相关api接口集合
* @method taskPackageList 任务包列表
* @method taskPackageAdd 发布任务
*/
export function taskApi() {
return {
list: (data) => {
return request({
url: '/api/task/list',
method: 'post',
data,
});
},
add: (data) => {
return request({
url: '/api/task/add',
method: 'post',
data,
});
},
};
}
<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: 500px;">
<el-form-item label="采集组名称" prop="采集组名称">
<el-input v-model="state.ruleForm.name" placeholder="请输入采集组名称" clearable ></el-input>
</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 { taskApi } from '/@/api/task'
import { Session } from '/@/utils/storage';
// 定义子组件向父组件传值/事件
const emit = defineEmits(['refresh']);
// 定义变量内容
const dialogFormRef = ref();
const state = reactive({
// 查询列表参数
apiListParam: {
page: 1,
limit: 100,
search:[],
},
ruleForm: {
name:'',
},
rules: {
},
dialog: {
isShowDialog: false,
title: '添加采集组',
submitTxt: '',
},
dataLoading: false,
btnLoading: false,
userList:[],
enterpriseList:[],
});
// 打开弹窗
const openDialog = () => {
state.dialog.isShowDialog = true;
state.dialog.title = '新增采集组';
};
// 关闭弹窗
const closeDialog = () => {
emit('refresh');
dialogFormRef.value.resetFields();
state.dialog.isShowDialog = false;
};
// 提交
const onSubmit = () => {
dialogFormRef.value.validate((valid, fields) => {
if (valid) {
state.btnLoading = true
const apiData = JSON.parse(JSON.stringify(state.ruleForm))
taskApi().add(apiData).then(res => {
state.btnLoading = false
ElMessage.success('操作成功');
closeDialog();
emit('refresh');
}).catch(() => {
state.btnLoading = false
closeDialog();
emit('refresh');
})
}
})
};
// 暴露变量
defineExpose({
openDialog,
});
onMounted(() => {
});
</script>
<style scoped lang="scss"></style>
<template>
<div class="system-menu-container">
<div class="breadcrumb-box">
<Breadcrumb />
</div>
<div class="header-search flex space-between">
<el-page-header @back="backToPreviousPage" content="列表页面">
</el-page-header>
</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"/> -->
<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>
<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>
<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>
<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()" />
<DistributeDialog ref="DistributeDialogRef" @refresh="getList()" />
<SetupDialog ref="SetupDialogRef" @refresh="getList()" />
<Search ref="SearchDialogRef" @search-to-parent="searchData" />
</div>
</template>
<script setup name="taskPackage-list">
import { getCurrentInstance } from 'vue';
import { productApi } from '/@/api/product'
const router = useRouter();
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 DistributeDialog = defineAsyncComponent(() => import('/@/views/product_info/list/distribute.vue'));
const Toolbar = defineAsyncComponent(() => import('/@/components/RightToolbar/index.vue'));
const Search = defineAsyncComponent(() => import('/@/views/product_info/list/search.vue'));
// 定义变量内容
const AddDialogRef = ref()
const DistributeDialogRef = ref()
const SetupDialogRef = ref()
const SearchDialogRef = ref()
const state = reactive({
// 查询列表参数
apiListParam: {
page: 1,
limit: 10,
},
tableData: {
data: [],
total: 0
},
tableHeight: '30vh',
normListExtend:[],
testIndex:0,
taskList:[],
query_id:'',
});
// 页面加载时
onMounted(() => {
state.tableHeight = getCurrentInstance().refs.pageMain.offsetHeight - 130 - 52 + "px";
});
const emits = defineEmits(['update:showSearch', 'queryTable','search','refresh']);
// 分页改变
const onHandleSizeChange = (val) => {
state.apiListParam.limit = val;
getList();
};
const onHandleCurrentChange = (val) => {
state.apiListParam.page = val;
getList();
};
// 获取列表
const getList = () => {
state.apiListParam.department_id = state.query_id
productApi().enterpriseAllocationList(state.apiListParam).then(res => {
state.tableData.data = res.data.data
state.tableData.total = res.data.total
}).catch(() => {
})
}
/**
* 返回上一级页面
*/
const backToPreviousPage = () => {
// this.$router.push('/target')
router.push({ path: '/task/user_task_group'});
}
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'});
}else{
state.query_id = router.currentRoute.value.query.id
getList()
}
}
</script>
<style lang="scss" scoped>
.page-main {
height: calc(100vh - 50px - 106px);
}
</style>
<template>
<div class="system-menu-container">
<div class="breadcrumb-box">
<Breadcrumb />
</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> -->
</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"/> -->
<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>
<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>
<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>
<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()" />
<DistributeDialog ref="DistributeDialogRef" @refresh="getList()" />
<SetupDialog ref="SetupDialogRef" @refresh="getList()" />
<Search ref="SearchDialogRef" @search-to-parent="searchData" />
</div>
</template>
<script setup name="taskPackage-list">
import { getCurrentInstance } from 'vue';
import { productApi } from '/@/api/product'
const router = useRouter();
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 DistributeDialog = defineAsyncComponent(() => import('/@/views/product_info/list/distribute.vue'));
const Toolbar = defineAsyncComponent(() => import('/@/components/RightToolbar/index.vue'));
const Search = defineAsyncComponent(() => import('/@/views/product_info/list/search.vue'));
// 定义变量内容
const AddDialogRef = ref()
const DistributeDialogRef = ref()
const SetupDialogRef = ref()
const SearchDialogRef = ref()
const state = reactive({
// 查询列表参数
apiListParam: {
page: 1,
limit: 10,
},
tableData: {
data: [],
total: 0
},
tableHeight: '30vh',
normListExtend:[],
testIndex:0,
taskList:[],
verifyTypeList:['待检查','已检查'],
});
// 页面加载时
onMounted(() => {
getList()
state.tableHeight = getCurrentInstance().refs.pageMain.offsetHeight - 130 - 52 + "px";
});
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;
getList();
};
const onHandleCurrentChange = (val) => {
state.apiListParam.page = val;
getList();
};
// 获取列表
const getList = () => {
productApi().userEnterpriseList(state.apiListParam).then(res => {
state.tableData.data = res.data.data
state.tableData.total = res.data.total
}).catch(() => {
})
}
/**
* 点击添加
*/
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)]
}
}
</script>
<style lang="scss" scoped>
.page-main {
height: calc(100vh - 50px - 106px);
}
</style>
...@@ -5,15 +5,7 @@ ...@@ -5,15 +5,7 @@
</div> </div>
<div class="header-search flex space-between"> <div class="header-search flex space-between">
<!-- <div> <el-button size="default" type="primary" @click="addGather()" >新增采集组</el-button>
<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>
</div> </div>
<div class="page-main" ref="pageMain"> <div class="page-main" ref="pageMain">
...@@ -22,18 +14,13 @@ ...@@ -22,18 +14,13 @@
<el-table :data="state.tableData.data" style="width: 100%" :height="state.tableHeight" <el-table :data="state.tableData.data" style="width: 100%" :height="state.tableHeight"
ref="multipleTableRef"> ref="multipleTableRef">
<el-table-column label="序号" type="index" width="100" show-overflow-tooltip align="center"></el-table-column> <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="name" label="采集组名称" key="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="number" label="人数" key="product_name" align="center"></el-table-column>
<el-table-column prop="total" label="产品总数" key="product_model" width="200" align="center"> <el-table-column label="操作" width="200" fixed="right" align="center">
<template #default="scope"><span style="color: #409EFF;">{{scope.row.total }}</span></template> <template #default="scope">
<el-button size="small" @click="viewAllocation(scope.row.id)" type="primary">查看分配数据</el-button>
</template>
</el-table-column> </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>
<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>
<el-table-column prop="distribute_time" label="分发时间" key="product_model" align="center"></el-table-column>
</el-table> </el-table>
...@@ -49,29 +36,23 @@ ...@@ -49,29 +36,23 @@
</div> </div>
<AddDialog ref="AddDialogRef" @refresh="getList()" /> <AddDialog ref="AddDialogRef" @refresh="getList()" />
<DistributeDialog ref="DistributeDialogRef" @refresh="getList()" /> <DistributeDialog ref="DistributeDialogRef" @refresh="getList()" />
<SetupDialog ref="SetupDialogRef" @refresh="getList()" />
<Search ref="SearchDialogRef" @search-to-parent="searchData" />
</div> </div>
</template> </template>
<script setup name="taskPackage-list"> <script setup name="taskPackage-list">
import { getCurrentInstance } from 'vue'; import { getCurrentInstance } from 'vue';
import { productApi } from '/@/api/product' import { taskApi } from '/@/api/task'
const router = useRouter(); const router = useRouter();
import { ElMessageBox, ElMessage } from 'element-plus'; import { ElMessageBox, ElMessage } from 'element-plus';
import { Session } from '/@/utils/storage'; import { Session } from '/@/utils/storage';
// 引入组件 // 引入组件
const Breadcrumb = defineAsyncComponent(() => import('/@/layout/navBars/breadcrumb/breadcrumb.vue')); const Breadcrumb = defineAsyncComponent(() => import('/@/layout/navBars/breadcrumb/breadcrumb.vue'));
const SetupDialog = defineAsyncComponent(() => import('/@/views/product_info/list/setup.vue')); const AddDialog = defineAsyncComponent(() => import('/@/views/task/list/add.vue'));
const AddDialog = defineAsyncComponent(() => import('/@/views/product_info/list/add.vue')); const DistributeDialog = defineAsyncComponent(() => import('/@/views/task/list/distribute.vue'));
const DistributeDialog = defineAsyncComponent(() => import('/@/views/product_info/list/distribute.vue'));
const Toolbar = defineAsyncComponent(() => import('/@/components/RightToolbar/index.vue'));
const Search = defineAsyncComponent(() => import('/@/views/product_info/list/search.vue'));
// 定义变量内容 // 定义变量内容
const AddDialogRef = ref() const AddDialogRef = ref()
const DistributeDialogRef = ref() const DistributeDialogRef = ref()
const SetupDialogRef = ref()
const SearchDialogRef = ref() const SearchDialogRef = ref()
const state = reactive({ const state = reactive({
...@@ -86,9 +67,6 @@ const state = reactive({ ...@@ -86,9 +67,6 @@ const state = reactive({
}, },
tableHeight: '30vh', tableHeight: '30vh',
normListExtend:[], normListExtend:[],
testIndex:0,
taskList:[],
verifyTypeList:['待检查','已检查'],
}); });
// 页面加载时 // 页面加载时
...@@ -100,30 +78,6 @@ onMounted(() => { ...@@ -100,30 +78,6 @@ onMounted(() => {
const emits = defineEmits(['update:showSearch', 'queryTable','search','refresh']); 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) => { const onHandleSizeChange = (val) => {
...@@ -137,7 +91,7 @@ const onHandleCurrentChange = (val) => { ...@@ -137,7 +91,7 @@ const onHandleCurrentChange = (val) => {
// 获取列表 // 获取列表
const getList = () => { const getList = () => {
productApi().enterpriseAllocationList(state.apiListParam).then(res => { taskApi().list(state.apiListParam).then(res => {
state.tableData.data = res.data.data state.tableData.data = res.data.data
state.tableData.total = res.data.total state.tableData.total = res.data.total
}).catch(() => { }).catch(() => {
...@@ -145,47 +99,15 @@ const getList = () => { ...@@ -145,47 +99,15 @@ const getList = () => {
} }
/** /**
* 点击添加 * 点击添加
*/ */
const add = () => { const addGather = () => {
AddDialogRef.value.openDialog(); AddDialogRef.value.openDialog();
} }
/**
* 点击添加
*/
const distribute = () => {
DistributeDialogRef.value.openDialog();
}
/** const viewAllocation = (id) => {
* 点击查看 router.push({ path: '/task/assigned', query: { id: id }});
*/
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)]
}
} }
</script> </script>
......
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