Commit ff455a54 by wenyi.chen

线上

parent 4fce377a
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -38,6 +38,48 @@ export function productApi() { ...@@ -38,6 +38,48 @@ export function productApi() {
data, 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,
});
},
}; };
} }
......
...@@ -119,6 +119,13 @@ export function systemApi() { ...@@ -119,6 +119,13 @@ export function systemApi() {
data data
}); });
}, },
userList: (data) => {
return request({
url: '/api/admin/userList',
method: 'post',
data,
});
},
}; };
} }
......
...@@ -103,7 +103,7 @@ router.beforeEach(async (to, from, next) => { ...@@ -103,7 +103,7 @@ router.beforeEach(async (to, from, next) => {
Session.clear(); Session.clear();
NProgress.done(); NProgress.done();
} else if (token && to.path === '/login') { } else if (token && to.path === '/login') {
next('/enterprise_info'); next('/product_info');
NProgress.done(); NProgress.done();
} else { } else {
const storesRoutesList = useRoutesList(pinia); const storesRoutesList = useRoutesList(pinia);
......
...@@ -23,7 +23,7 @@ export const dynamicRoutes = [ ...@@ -23,7 +23,7 @@ export const dynamicRoutes = [
path: '/', path: '/',
name: '/', name: '/',
component: () => import('/@/layout/index.vue'), component: () => import('/@/layout/index.vue'),
redirect: '/enterprise_info', redirect: '/product_info',
meta: { meta: {
isKeepAlive: false, isKeepAlive: false,
}, },
......
<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="impor()" >导入企业</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="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="productInfo.page_url" label="页面URL" key="page_url" v-if="columns[2].visible" width="200" align="center">
<template #default="scope">
<el-link type="productInfo.primary" :href="scope.row.page_url" target ="_blank">{{scope.row.page_url}}</el-link>
</template>
</el-table-column>
<el-table-column prop="productInfo.product_categ_name" label="产品分类名称" key="product_categ_name" v-if="columns[3].visible" width="200" align="center"></el-table-column>
<el-table-column prop="productInfo.product_name" label="产品名称" key="product_name" v-if="columns[4].visible" width="200" align="center"></el-table-column>
<el-table-column prop="productInfo.product_model" label="产品型号" key="product_model" v-if="columns[5].visible" width="200" align="center"></el-table-column>
<el-table-column prop="productInfo.describe" label="功能描述" key="describe" v-if="columns[6].visible" width="250" show-overflow-tooltip align="center">
</el-table-column>
<el-table-column prop="productInfo.parameter" label="规格参数" key="parameter" v-if="columns[7].visible" width="200" show-overflow-tooltip align="center"></el-table-column>
<el-table-column prop="inspect_status" key="verify_type" v-if="columns[12].visible" label="检查状态" width="200" align="center">
<template #default="scope">
<el-tag type="info" v-if="scope.row.productInfo.inspect_status ==''||scope.row.productInfo.inspect_status ==null||scope.row.productInfo.inspect_status ==0">待分配</el-tag>
<el-tag v-if="scope.row.productInfo.inspect_status ==1">检查完成</el-tag>
<el-tag type="warning" v-if="scope.row.productInfo.inspect_status ==2">检查中</el-tag>
<el-tag type="danger" v-if="scope.row.productInfo.inspect_status ==3">检查异常</el-tag>
<el-tag type="danger" v-if="scope.row.productInfo.inspect_status ==4">数据异常</el-tag>
<el-tag type="danger" v-if="scope.row.productInfo.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="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>
<el-tag v-if="scope.row.inspect_time">{{scope.row.inspect_time}}</el-tag>
</template>
</el-table-column>
<el-table-column prop="distribute_time" key="distribute_time" label="分发时间" v-if="columns[10].visible" width="200" align="center"></el-table-column>
<el-table-column label="操作" width="200" fixed="right" align="center">
<template #default="scope">
<el-button size="small" @click="setup(scope.row.id)" type="primary">检查数据</el-button>
</template>
</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 columns = ref([
{ key: 0, label: `产品ID`, visible: true },
{ key: 1, label: `企业名称`, visible: true },
{ key: 2, label: `页面URL`, visible: true },
{ key: 3, label: `产品分类名称`, visible: true },
{ key: 4, label: `产品名称`, visible: true },
{ key: 5, label: `产品型号`, visible: true },
{key: 6, label: `功能描述`, visible: true },
{ key: 7, label: `规格参数`, visible: true },
{ key: 8, label: `审核类型`, visible: true },
{ key: 9, label: `审核人员`, visible: true },
{ key: 10, label: `审核时间`, visible: true },
{ key: 11, label: `入库时间`, visible: true },
{ key: 12, label: `更新时间`, visible: true }
]);
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().productAllocationList(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 dele = (id) => {
let apiParam = {id: id}
productApi().apiDelete(apiParam).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>
<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-form-item label="选择检查人员" prop="user_id">
<el-select style="width:100%;" v-model="state.user_id" placeholder="选择检查人员" size="default" filterable remote reserve-keyword :remote-method="getList">
<el-option v-for="(item, index) in state.userListData" :key="index" :label="item.name"
:value="item.id"></el-option>
</el-select>
</el-form-item>
<el-form-item label="请选择未分配的产品" prop="product_id"></el-form-item>
<!-- <template>
<el-transfer v-model="productInfoValue" :data="state.productInfoList"></el-transfer>
</template> -->
</el-form>
<el-transfer v-model="state.productInfoValue" :data="state.productInfoList"></el-transfer>
<template #footer>
<span class="dialog-footer">
<el-button @click="closeDialog()" size="default">取 消</el-button>
<el-button type="danger" :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 { systemApi } from '/@/api/system/index';
import { Session } from '/@/utils/storage';
import { productApi } from '/@/api/product'
// 定义子组件向父组件传值/事件
const emit = defineEmits(['refresh']);
// 定义变量内容
const dialogFormRef = ref();
const state = reactive({
taskId: null,
ruleForm: {
},
rules: {
},
dialog: {
isShowDialog: false,
title: '产品分发',
submitTxt: '',
},
dataLoading: false,
btnLoading: false,
userListData:[],
user_id:'',
productInfoList:[
],
productInfoValue:[],
});
// 打开弹窗
const openDialog = () => {
unallocatedProductsList()
userList();
state.dialog.isShowDialog = true;
state.dialog.title = '产品分发';
};
// 关闭弹窗
const closeDialog = () => {
dialogFormRef.value.resetFields();
state.dialog.isShowDialog = false;
};
// 提交
const onSubmit = () => {
if(state.productInfoValue != "" && state.user_id !=""){
let apiData = {'product_id':state.productInfoValue,'user_id':state.user_id};
productApi().productAllocationAdd(apiData).then(res => {
state.btnLoading = false
ElMessage.success('操作成功');
state.user_id = '';
state.productInfoList = []
closeDialog();
emit('refresh');
}).catch(() => {
state.btnLoading = false
closeDialog();
emit('refresh');
})
}else{
ElMessage.error('请选择检查人员和产品信息');
}
};
// 获取列表
const userList = () => {
systemApi().userList().then(res => {
state.userListData = res.data
}).catch(() => {
})
}
// 获取列表
const unallocatedProductsList = () => {
productApi().unallocatedProducts().then(res => {
state.productInfoList = res.data
console.log(state.productInfoList)
}).catch(() => {
})
}
// 暴露变量
defineExpose({
openDialog,
});
onMounted(() => {
});
</script>
<style scoped lang="scss"></style>
\ No newline at end of file
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
</el-select> </el-select>
</div> --> </div> -->
<el-button size="default" type="primary" @click="add()" >新增产品</el-button> <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> --> <!-- <el-button size="default" type="primary" @click="impor()" >导入企业</el-button> -->
</div> </div>
...@@ -35,15 +36,21 @@ ...@@ -35,15 +36,21 @@
<el-table-column prop="describe" label="功能描述" key="describe" v-if="columns[6].visible" width="250" show-overflow-tooltip align="center"> <el-table-column prop="describe" label="功能描述" key="describe" v-if="columns[6].visible" width="250" show-overflow-tooltip align="center">
</el-table-column> </el-table-column>
<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="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"> <el-table-column prop="verify_type" key="verify_type" v-if="columns[12].visible" label="数据状态" width="200" align="center">
<template #default="scope"> <template #default="scope">
{{ verifyType(scope.row.verify_type) }} <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>
<el-tag type="danger" v-if="scope.row.inspect_status ==4">数据异常</el-tag>
<el-tag type="danger" v-if="scope.row.inspect_status ==5">数据废弃</el-tag>
</template> </template>
</el-table-column> </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="inspect_remarks" label="检查备注" key="inspect_remarks" v-if="columns[7].visible" width="200" show-overflow-tooltip align="center"></el-table-column>
<el-table-column prop="verify_time" key="verify_time" label="审核时间" v-if="columns[10].visible" width="200" align="center"></el-table-column> <el-table-column prop="verify_user" label="检查人员" key="verify_user" v-if="columns[9].visible" width="200" align="center"></el-table-column>
<el-table-column prop="verify_time" key="verify_time" label="检查时间" v-if="columns[10].visible" width="200" align="center"></el-table-column>
<el-table-column prop="distribute_time" key="distribute_time" label="分发时间" v-if="columns[10].visible" width="200" align="center"></el-table-column>
<el-table-column prop="created_time" label="入库时间" key="created_at" v-if="columns[11].visible" width="200" align="center"></el-table-column> <el-table-column prop="created_time" label="入库时间" key="created_at" v-if="columns[11].visible" width="200" align="center"></el-table-column>
<el-table-column prop="update_time" label="更新时间" key="update_time" v-if="columns[12].visible" width="200" align="center"></el-table-column>
<el-table-column label="操作" width="200" fixed="right" align="center"> <el-table-column label="操作" width="200" fixed="right" align="center">
<template #default="scope"> <template #default="scope">
<el-button size="small" @click="setup(scope.row)" type="primary">信息修改</el-button> <el-button size="small" @click="setup(scope.row)" type="primary">信息修改</el-button>
...@@ -66,6 +73,7 @@ ...@@ -66,6 +73,7 @@
</div> </div>
<AddDialog ref="AddDialogRef" @refresh="getList()" /> <AddDialog ref="AddDialogRef" @refresh="getList()" />
<DistributeDialog ref="DistributeDialogRef" @refresh="getList()" />
<SetupDialog ref="SetupDialogRef" @refresh="getList()" /> <SetupDialog ref="SetupDialogRef" @refresh="getList()" />
<Search ref="SearchDialogRef" @search-to-parent="searchData" /> <Search ref="SearchDialogRef" @search-to-parent="searchData" />
</div> </div>
...@@ -80,13 +88,14 @@ import { Session } from '/@/utils/storage'; ...@@ -80,13 +88,14 @@ 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 SetupDialog = defineAsyncComponent(() => import('/@/views/product_info/list/setup.vue'));
const AddDialog = defineAsyncComponent(() => import('/@/views/product_info/list/add.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 Toolbar = defineAsyncComponent(() => import('/@/components/RightToolbar/index.vue'));
const Search = defineAsyncComponent(() => import('/@/views/product_info/list/search.vue')); const Search = defineAsyncComponent(() => import('/@/views/product_info/list/search.vue'));
// 定义变量内容 // 定义变量内容
const AddDialogRef = ref() const AddDialogRef = ref()
const DistributeDialogRef = ref()
const SetupDialogRef = ref() const SetupDialogRef = ref()
const SearchDialogRef = ref() const SearchDialogRef = ref()
...@@ -105,7 +114,6 @@ const state = reactive({ ...@@ -105,7 +114,6 @@ const state = reactive({
normListExtend:[], normListExtend:[],
testIndex:0, testIndex:0,
taskList:[], taskList:[],
verifyTypeList:['未确认','审核通过','审核未通过'],
}); });
// 页面加载时 // 页面加载时
...@@ -184,7 +192,12 @@ const getList = () => { ...@@ -184,7 +192,12 @@ const getList = () => {
const add = () => { const add = () => {
AddDialogRef.value.openDialog(); AddDialogRef.value.openDialog();
} }
/**
* 点击添加
*/
const distribute = () => {
DistributeDialogRef.value.openDialog();
}
/** /**
* 点击查看 * 点击查看
...@@ -203,17 +216,6 @@ const dele = (id) => { ...@@ -203,17 +216,6 @@ const dele = (id) => {
}) })
} }
/**
* 企业信息类型显示
* @param {*} data
*/
const verifyType= (data) => {
if(state.verifyTypeList[parseInt(data)] ===undefined){
return data
}else{
return state.verifyTypeList[parseInt(data)]
}
}
</script> </script>
......
...@@ -27,12 +27,6 @@ ...@@ -27,12 +27,6 @@
<el-form-item label="规格参数" prop="parameter"> <el-form-item label="规格参数" prop="parameter">
<el-input type="textarea" v-model="state.ruleForm.parameter" placeholder="" clearable ></el-input> <el-input type="textarea" v-model="state.ruleForm.parameter" placeholder="" clearable ></el-input>
</el-form-item> </el-form-item>
<el-form-item label="审核类型" prop="verify_type">
<el-select v-model="state.ruleForm.verify_type" placeholder="请选择审核类型" size="default">
<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> </el-form>
<template #footer> <template #footer>
<span class="dialog-footer"> <span class="dialog-footer">
......
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