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() {
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() {
data
});
},
userList: (data) => {
return request({
url: '/api/admin/userList',
method: 'post',
data,
});
},
};
}
......
......@@ -103,7 +103,7 @@ router.beforeEach(async (to, from, next) => {
Session.clear();
NProgress.done();
} else if (token && to.path === '/login') {
next('/enterprise_info');
next('/product_info');
NProgress.done();
} else {
const storesRoutesList = useRoutesList(pinia);
......
......@@ -23,7 +23,7 @@ export const dynamicRoutes = [
path: '/',
name: '/',
component: () => import('/@/layout/index.vue'),
redirect: '/enterprise_info',
redirect: '/product_info',
meta: {
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 @@
</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>
......@@ -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>
<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">
{{ 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>
</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="verify_time" key="verify_time" label="审核时间" v-if="columns[10].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_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="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">
<template #default="scope">
<el-button size="small" @click="setup(scope.row)" type="primary">信息修改</el-button>
......@@ -66,6 +73,7 @@
</div>
<AddDialog ref="AddDialogRef" @refresh="getList()" />
<DistributeDialog ref="DistributeDialogRef" @refresh="getList()" />
<SetupDialog ref="SetupDialogRef" @refresh="getList()" />
<Search ref="SearchDialogRef" @search-to-parent="searchData" />
</div>
......@@ -80,13 +88,14 @@ 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()
......@@ -105,7 +114,6 @@ const state = reactive({
normListExtend:[],
testIndex:0,
taskList:[],
verifyTypeList:['未确认','审核通过','审核未通过'],
});
// 页面加载时
......@@ -184,7 +192,12 @@ const getList = () => {
const add = () => {
AddDialogRef.value.openDialog();
}
/**
* 点击添加
*/
const distribute = () => {
DistributeDialogRef.value.openDialog();
}
/**
* 点击查看
......@@ -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>
......
<template>
<div class="system-menu-container">
<!-- <div class="breadcrumb-box">
<Breadcrumb />
</div> -->
<!--
<div class="header-search flex space-between">
<el-page-header @back="backToPreviousPage">
</el-page-header>
</div> -->
<div style="background-color: #ffffff; padding: 10px;">
<el-row >
<el-col :span="8" style="padding-right: 5px;">
<div class="grid-content bg-purple" style=" max-height: 830px;overflow-y: auto;">
<div>
<el-button type="info" @click="backToPreviousPage">返回页面</el-button>
<el-button type="primary" style="margin-left: 50px;" @click="page_turning(state.number.front)">上一条</el-button>
<el-button type="primary" style="margin-left: 30px;" @click="page_turning(state.number.after)">下一条</el-button>
<el-button type="warning" style="float: right;" @click="source_address(state.info.page_url)">源网站</el-button>
</div>
<div style="margin-top: 20px;">
<el-row>
<el-col :span="8"><div class="grid-content bg-purple">
<p class="tle">分发时间</p>
<p class="tle_ce">{{state.info.distribute_time}}</p>
</div></el-col>
<el-col :span="8"><div class="grid-content bg-purple-light">
<p class="tle">检查状态</p>
<p class="tle_ce">
<el-tag type="info" v-if="state.info.inspect_status ==''||state.info.inspect_status ==null||state.info.inspect_status ==0">待分配</el-tag>
<el-tag v-if="state.info.inspect_status ==1">检查完成</el-tag>
<el-tag type="warning" v-if="state.info.inspect_status ==2">检查中</el-tag>
<el-tag type="danger" v-if="state.info.inspect_status ==3">检查异常</el-tag>
<el-tag type="danger" v-if="state.info.inspect_status ==4">数据异常</el-tag>
<el-tag type="danger" v-if="state.info.inspect_status ==5">数据废弃</el-tag>
</p>
</div></el-col>
<el-col :span="8"><div class="grid-content bg-purple">
<p class="tle">检查人</p>
<p class="tle_ce">{{state.info.user_name}}</p>
</div></el-col>
</el-row>
</div>
<div style="margin-top: 5px;">
<div class="number"><span>产品编号:</span><span>RS1722417085980508</span></div>
<el-form ref="dialogFormRef" :model="state.info" size="default" label-width="100px" v-loading="state.dataLoading" label-position="right" style="width: 500px;">
<el-form-item label="企业名称:" prop="企业名称">
<el-input v-model="state.info.enterprise_name" placeholder="企业名称" clearable disabled></el-input>
</el-form-item>
<el-form-item label="产品名称:" prop="product_name">
<el-input type="textarea" v-model="state.info.product_name" placeholder="请输入产品分类名称" clearable ></el-input>
</el-form-item>
<el-form-item label="产品分类:" prop="product_categ_name">
<el-input type="textarea" v-model="state.info.product_categ_name" placeholder="请输入产品分类名称" clearable ></el-input>
</el-form-item>
<el-form-item label="产品链接:" prop="page_url">
<el-input type="textarea" v-model="state.info.page_url" placeholder="请输入产品链接" clearable ></el-input>
</el-form-item>
<el-form-item label="产品型号:" prop="product_model">
<el-input type="textarea" v-model="state.info.product_model" placeholder="请输入产品分类名称" clearable ></el-input>
</el-form-item>
<el-form-item label="产品功能描述:" prop="describe">
<el-input type="textarea" v-model="state.info.describe" placeholder="产品功能描述" clearable ></el-input>
</el-form-item>
<el-form-item label="产品规格参数:" prop="parameter">
<el-input type="textarea" v-model="state.info.parameter" placeholder="产品规格参数" clearable ></el-input>
</el-form-item>
<el-form-item label="检查备注:" prop="inspect_remarks">
<el-input type="textarea" v-model="state.info.inspect_remarks" placeholder="请输入检查备注" clearable ></el-input>
</el-form-item>
</el-form>
<div style="margin-top: 30px;padding-right: 50px;">
<el-button type="danger" :loading="state.btnLoading" @click="abnormal(4)">数据异常</el-button>
<el-button type="warning" :loading="state.btnLoading" @click="abnormal(5)">数据废弃</el-button>
<el-button type="primary" style="float: right;" :loading="state.btnLoading" @click="onSubmit()">检查完成</el-button>
</div>
</div>
</div>
</el-col>
<el-col :span="16"><div class="grid-content bg-purple-light">
<!-- <div style="float: right;"><el-link type="primary" href="https://element.eleme.io">主要链接</el-link></div> -->
<div><iframe src="https://element.eleme.io/#/zh-CN/component/layout" width="100%" height="830px" style=" border: #909399 1px dotted ; padding: 15px;" scrolling="no"></iframe></div>
</div>
</el-col>
</el-row>
</div>
</div>
</template>
<script setup name="systemRoleDialog">
const router = useRouter();
import { ElMessage } from 'element-plus';
import { create } from 'lodash';
import { productApi } from '/@/api/product'
// 定义子组件向父组件传值/事件
const emit = defineEmits(['refresh']);
// 定义变量内容
const dialogFormRef = ref();
const state = reactive({
value1:0,
dialog: {
isShowDialog: false,
title: '产品信息',
submitTxt: '',
},
dataLoading: false,
btnLoading: false,
verifyTypeList:[
{name:'未确认',value:0},
{name:'审核通过',value:1},
{name:'审核未通过',value:2}
],
query_id : '',
info:{},
number:{},
});
const onSubmit = () => {
console.log(state.info);
if(state.info.product_name ==""){
ElMessage.error('产品名称必填');
return false;
}
if(state.info.product_categ_name ==""){
ElMessage.error('产品分类必填');
return false;
}
if(state.info.page_url ==""){
ElMessage.error('产品链接');
return false;
}
state.btnLoading = true
const apiData = JSON.parse(JSON.stringify(state.info))
productApi().productAllocationSave(apiData).then(res => {
state.btnLoading = false
ElMessage.success('ok');
emit('refresh');
closeDialog();
}).catch(() => {
state.btnLoading = false
})
};
const source_address= (source_address) => {
window.open(source_address, '_blank');
}
const abnormal = (type) => {
console.log(state.info);
if(state.info.product_name ==""){
ElMessage.error('产品名称必填');
return false;
}
if(state.info.product_categ_name ==""){
ElMessage.error('产品分类必填');
return false;
}
if(state.info.page_url ==""){
ElMessage.error('产品链接');
return false;
}
state.btnLoading = true
state.info.is = type
const apiData = JSON.parse(JSON.stringify(state.info))
productApi().productAllocationAbnormal(apiData).then(res => {
state.btnLoading = false
ElMessage.success('ok');
emit('refresh');
closeDialog();
}).catch(() => {
state.btnLoading = false
})
}
// 获取信息
const getProductAllocation = () => {
productApi().productAllocationSee({id:state.query_id}).then(res => {
state.info.id= res.data.productAllocationInfo.id
state.info.product_id= res.data.productInfo.id
state.info.inspect_status= res.data.productInfo.inspect_status
state.info.enterprise_name= res.data.enterpriseInfo.enterprise_name
state.info.product_name= res.data.productInfo.product_name
state.info.product_categ_name= res.data.productInfo.product_categ_name
state.info.page_url= res.data.productInfo.page_url
state.info.product_model= res.data.productInfo.product_model
state.info.describe= res.data.productInfo.describe
state.info.parameter= res.data.productInfo.parameter
state.info.inspect_remarks= res.data.productInfo.inspect_remarks
state.info.distribute_time= res.data.productAllocationInfo.distribute_time
state.info.user_name= res.data.userInfo.name
state.number = res.data.number
}).catch(() => {
})
}
const page_turning = (num) => {
if(router.currentRoute.value.query.id == num){
ElMessage.error('数据已经加载完');
}else{
router.push({ path: '/product_info/inspect', query: { id: num }});
}
}
// 暴露变量
defineExpose({
});
/**
* 返回上一级页面
*/
const backToPreviousPage = () => {
// this.$router.push('/target')
router.push({ path: '/product_info/allocation'});
}
created:{
if(router.currentRoute.value.query.id =="" ||router.currentRoute.value.query.id==null|| router.currentRoute.value.query.id==undefined){
router.push({ path: '/product_info/list'});
}else{
state.query_id = router.currentRoute.value.query.id
getProductAllocation()
}
}
onMounted(() => {
});
</script>
<style scoped lang="scss">
.tle{
text-align: center;
background: rgb(242, 246, 252);
line-height: 30px;
height: 30px;
}
.tle_ce{
text-align: center;
margin-top:10px ;
}
.number{
margin-top:20px;
margin-bottom: 10px;
text-align: center;
font-weight: bold;
}
/* 定义滚动条的宽度和背景色 */
::-webkit-scrollbar {
width: 6px;
background-color: #f9f9f9;
}
/* 定义滚动条滑块的颜色 */
::-webkit-scrollbar-thumb {
border-radius: 10px;
background-color: #c1c1c1;
}
/* 定义滚动条轨道的颜色 */
::-webkit-scrollbar-track {
border-radius: 10px;
box-shadow: inset 0 0 3px rgba(0, 0, 0, 0.3);
background-color: #f0f0f0;
}
</style>
......@@ -27,12 +27,6 @@
<el-form-item label="规格参数" prop="parameter">
<el-input type="textarea" v-model="state.ruleForm.parameter" placeholder="" clearable ></el-input>
</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>
<template #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