Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
product_library
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wenyi.chen
product_library
Commits
3d1f2855
Commit
3d1f2855
authored
Oct 31, 2024
by
wenyi.chen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
v1版本
parent
3300a1f0
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
664 additions
and
124 deletions
+664
-124
src/api/product/index.js
+28
-0
src/views/product_info/list/allocation.vue
+23
-4
src/views/product_info/list/index.vue
+2
-1
src/views/task/list/add.vue
+0
-103
src/views/task/list/assigned.vue
+0
-2
src/views/task/list/enterprise_product.vue
+194
-0
src/views/task/list/review.vue
+361
-0
src/views/task/list/user_enterprise.vue
+56
-14
No files found.
src/api/product/index.js
View file @
3d1f2855
...
...
@@ -109,6 +109,34 @@ export function productApi() {
data
,
});
},
productAllocationAbnormal
:
(
data
)
=>
{
return
request
({
url
:
'/api/enterpriseAllocation/enterpriseAbnormality'
,
method
:
'post'
,
data
,
});
},
taskAllocation
:
(
data
)
=>
{
return
request
({
url
:
'/api/productAllocation/task_allocation'
,
method
:
'post'
,
data
,
});
},
getProductAllocationInfo
:
(
data
)
=>
{
return
request
({
url
:
'/api/productAllocation/getProductAllocationInfo'
,
method
:
'post'
,
data
,
});
},
productReview
:
(
data
)
=>
{
return
request
({
url
:
'/api/productAllocation/productReview'
,
method
:
'post'
,
data
,
});
},
};
}
...
...
src/views/product_info/list/allocation.vue
View file @
3d1f2855
...
...
@@ -10,11 +10,11 @@
<div
class=
"page-main"
ref=
"pageMain"
>
<el-card
shadow=
"hover"
style=
"height:100%;"
>
<Toolbar
ref=
"ToolbarRef"
v-model:showSearch=
"showSearch"
@
queryTable=
"
getLis
t"
@
search=
"search"
:columns=
"columns"
/>
<Toolbar
ref=
"ToolbarRef"
v-model:showSearch=
"showSearch"
@
queryTable=
"
rese
t"
@
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=
"enterprise_id"
label=
"企业ID"
key=
"enterprise_name"
v-if=
"columns[0].visible"
width=
"300"
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"
>
...
...
@@ -57,7 +57,7 @@
<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
:pager-count=
"5"
:page-sizes=
"[10, 20, 30
,50,100,100
]"
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>
...
...
@@ -109,6 +109,7 @@ const state = reactive({
testIndex
:
0
,
taskList
:[],
verifyTypeList
:[
'待检查'
,
'已检查'
],
searchQuery
:
''
,
});
// 页面加载时
...
...
@@ -145,6 +146,8 @@ const search = () => {
*/
const
searchData
=
(
va
)
=>
{
if
(
va
){
state
.
searchQuery
=
va
;
Session
.
set
(
'allocation'
,
state
.
searchQuery
);
productApi
().
productAllocationList
(
va
).
then
(
res
=>
{
state
.
tableData
.
data
=
res
.
data
.
data
state
.
tableData
.
total
=
res
.
data
.
total
...
...
@@ -160,17 +163,34 @@ const search = () => {
* 重置按钮
*/
const
reset
=
()
=>
{
Session
.
set
(
'allocation'
,
''
);
state
.
apiListParam
.
page
=
1
state
.
apiListParam
.
name
=
''
;
state
.
apiListParam
.
limit
=
10
;
state
.
apiListParam
.
inspect_status
=
''
;
getList
()
}
// 分页改变
const
onHandleSizeChange
=
(
val
)
=>
{
let
allocationQuery
=
Session
.
get
(
'allocation'
);
let
arr
=
[
0
,
1
,
2
,
3
,
4
,
5
];
if
(
allocationQuery
){
if
(
arr
.
includes
(
allocationQuery
.
inspect_status
)){
state
.
apiListParam
.
inspect_status
=
allocationQuery
.
inspect_status
}
}
state
.
apiListParam
.
limit
=
val
;
getList
();
};
const
onHandleCurrentChange
=
(
val
)
=>
{
let
allocationQuery
=
Session
.
get
(
'allocation'
);
let
arr
=
[
0
,
1
,
2
,
3
,
4
,
5
];
if
(
allocationQuery
){
if
(
arr
.
includes
(
allocationQuery
.
inspect_status
)){
state
.
apiListParam
.
inspect_status
=
allocationQuery
.
inspect_status
}
}
state
.
apiListParam
.
page
=
val
;
getList
();
};
...
...
@@ -182,7 +202,6 @@ const getList = () => {
state
.
tableData
.
total
=
res
.
data
.
total
}).
catch
(()
=>
{
})
}
...
...
src/views/product_info/list/index.vue
View file @
3d1f2855
...
...
@@ -87,7 +87,7 @@ 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
AddDialog
=
defineAsyncComponent
(()
=>
import
(
'
../../task
/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'
));
...
...
@@ -177,6 +177,7 @@ const onHandleCurrentChange = (val) => {
// 获取列表
const
getList
=
()
=>
{
console
.
log
(
state
.
apiListParam
)
productApi
().
list
(
state
.
apiListParam
).
then
(
res
=>
{
state
.
tableData
.
data
=
res
.
data
.
data
state
.
tableData
.
total
=
res
.
data
.
total
...
...
src/views/task/list/add.vue
deleted
100644 → 0
View file @
3300a1f0
<
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
>
src/views/task/list/assigned.vue
View file @
3d1f2855
...
...
@@ -60,13 +60,11 @@ 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
()
...
...
src/views/task/list/enterprise_product.vue
0 → 100644
View file @
3d1f2855
<
template
>
<div
class=
"system-menu-container"
>
<div
class=
"breadcrumb-box"
>
<Breadcrumb
/>
</div>
<div
class=
"header-search flex space-between"
>
<div>
<el-button
type=
"info"
@
click=
"backToPreviousPage"
>
返回页面
</el-button>
</div>
</div>
<div
class=
"page-main"
ref=
"pageMain"
>
<el-card
shadow=
"hover"
style=
"height:100%;"
>
<!--
<Toolbar
ref=
"ToolbarRef"
v-model:showSearch=
"showSearch"
@
queryTable=
"reset"
@
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=
"enterprise_id"
label=
"企业ID"
key=
"enterprise_name"
v-if=
"columns[0].visible"
width=
"300"
show-overflow-tooltip
align=
"center"
></el-table-column>
<el-table-column
prop=
"product_info_id"
label=
"产品ID"
key=
"product_info_id"
v-if=
"columns[0].visible"
width=
"200"
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=
"产品编号"
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"
>
<el-link
type=
"primary"
:href=
"scope.row.page_url"
target =
"_blank"
>
{{
scope
.
row
.
page_url
}}
</el-link>
</
template
>
</el-table-column>
<el-table-column
prop=
"product_categ_name"
label=
"产品分类名称"
key=
"product_categ_name"
v-if=
"columns[3].visible"
width=
"200"
align=
"center"
></el-table-column>
<el-table-column
prop=
"product_name"
label=
"产品名称"
key=
"product_name"
v-if=
"columns[4].visible"
width=
"200"
align=
"center"
></el-table-column>
<el-table-column
prop=
"product_model"
label=
"产品型号"
key=
"product_model"
v-if=
"columns[5].visible"
width=
"200"
align=
"center"
></el-table-column>
<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=
"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.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=
"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>
<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.product_info_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,50,100,100]"
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/search/allocation.vue'
));
// 定义变量内容
const
AddDialogRef
=
ref
()
const
DistributeDialogRef
=
ref
()
const
SetupDialogRef
=
ref
()
const
SearchDialogRef
=
ref
()
const
state
=
reactive
({
// 查询列表参数
apiListParam
:
{
page
:
1
,
limit
:
10
,
enterprise_id
:
''
,
},
tableData
:
{
data
:
[],
total
:
0
},
tableHeight
:
'30vh'
,
normListExtend
:[],
testIndex
:
0
,
taskList
:[],
verifyTypeList
:[
'待检查'
,
'已检查'
],
searchQuery
:
''
,
});
// 页面加载时
onMounted
(()
=>
{
if
(
router
.
currentRoute
.
value
.
query
.
enterprise_id
){
state
.
apiListParam
.
enterprise_id
=
router
.
currentRoute
.
value
.
query
.
enterprise_id
getList
()
state
.
tableHeight
=
getCurrentInstance
().
refs
.
pageMain
.
offsetHeight
-
130
-
52
+
"px"
;
}
else
{
router
.
push
({
path
:
'/product_info/allocation'
});
}
});
/**
* 返回上一级页面
*/
const
backToPreviousPage
=
()
=>
{
// this.$router.push('/target')
router
.
push
({
path
:
'/product_info/user_enterprise'
});
}
/**
* 点击查看
*/
const
setup
=
(
product_id
)
=>
{
router
.
push
({
path
:
'/task/review'
,
query
:
{
product_id
:
product_id
}});
}
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
reset
=
()
=>
{
state
.
apiListParam
.
page
=
1
state
.
apiListParam
.
limit
=
10
;
getList
()
}
// 分页改变
const
onHandleSizeChange
=
(
val
)
=>
{
state
.
apiListParam
.
limit
=
val
;
getList
();
};
const
onHandleCurrentChange
=
(
val
)
=>
{
state
.
apiListParam
.
page
=
val
;
getList
();
};
// 获取列表
const
getList
=
()
=>
{
productApi
().
taskAllocation
(
state
.
apiListParam
).
then
(
res
=>
{
state
.
tableData
.
data
=
res
.
data
.
data
state
.
tableData
.
total
=
res
.
data
.
total
}).
catch
(()
=>
{
})
}
</
script
>
<
style
lang=
"scss"
scoped
>
.page-main
{
height
:
calc
(
100vh
-
50px
-
106px
);
}
</
style
>
src/views/task/list/review.vue
0 → 100644
View file @
3d1f2855
<
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
v-loading=
"state.loading"
>
<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"
>
-----
</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>
{{
state
.
info
.
product_number
}}
</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=
"state.info.page_url"
style=
" border: #909399 1px dotted ; padding: 15px;"
:height=
"state.tableHeight"
width=
"100%"
></iframe></div>
</div>
</el-col>
</el-row>
</div>
</div>
</
template
>
<
script
setup
name=
"systemRoleDialog"
>
const
router
=
useRouter
();
import
{
getCurrentInstance
}
from
'vue'
;
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
}
],
product_id
:
''
,
info
:{},
number
:{},
xhr
:
null
,
// 请求对象
mscontent
:
''
,
tableHeight
:
'30vh'
,
loading
:
true
});
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'
);
page_turning
(
state
.
number
.
after
)
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'
);
page_turning
(
state
.
number
.
after
)
emit
(
'refresh'
);
closeDialog
();
}).
catch
(()
=>
{
state
.
btnLoading
=
false
})
}
// 获取信息
const
getProductAllocation
=
()
=>
{
state
.
loading
=
true
productApi
().
productReview
({
product_id
:
state
.
product_id
}).
then
(
res
=>
{
state
.
info
.
product_number
=
res
.
data
.
productInfo
.
product_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
.
user_name
=
res
.
data
.
userInfo
.
name
state
.
number
=
res
.
data
.
number
state
.
loading
=
false
}).
catch
(()
=>
{
})
}
//大模型
const
fileContentExtraction
=
()
=>
{
state
.
mscontent
=
''
;
state
.
xhr
=
new
XMLHttpRequest
();
var
url
=
"https://api.moonshot.cn/v1/chat/completions"
;
state
.
xhr
.
open
(
"POST"
,
url
,
true
);
state
.
xhr
.
setRequestHeader
(
"Authorization"
,
"Bearer sk-RR9fGn86n9sdqMf7dwTB2eseGzsWrs1kKXEajbGWSfxlMQoj"
);
// 请求前处理
// requestProcessing();
state
.
xhr
.
onreadystatechange
=
function
()
{
if
(
state
.
xhr
.
status
==
200
){
if
(
state
.
xhr
.
readyState
==
2
){
state
.
txt
=
''
;
}
else
if
(
state
.
xhr
.
readyState
==
3
){
let
chunkText
=
state
.
xhr
.
response
;
var
lines
=
chunkText
.
split
(
'
\
n'
);
for
(
var
i
=
0
;
i
<
lines
.
length
;
i
++
)
{
var
line
=
lines
[
i
];
if
(
line
)
{
// 这里只是简单地打印事件数据,你可能需要更复杂的解析逻辑
var
txt
=
line
.
split
(
'choices'
)
if
(
txt
[
1
]
!=
undefined
){
var
parts
=
txt
[
1
].
split
(
'['
);
// 使用中括号 [ 分割字符串
var
result
=
parts
[
1
].
split
(
']'
)[
0
];
var
jsonObject
=
JSON
.
parse
(
result
);
state
.
mscontent
+=
jsonObject
.
delta
.
content
}
}
}
state
.
mscontent
.
replace
(
'undefined'
,
''
);
console
.
log
(
state
.
mscontent
)
}
else
if
(
state
.
xhr
.
readyState
==
4
){
state
.
httpStatus
=
false
;
}
}
else
{
// 请求异常处理
if
(
state
.
xhr
.
status
==
0
){
let
chunkText
=
state
.
xhr
.
response
;
var
lines
=
chunkText
.
split
(
'
\
n'
);
ElMessage
.
success
(
'停止输出 '
+
lines
[
0
])
// xhr.abort()
state
.
httpStatus
=
false
;
}
else
{
let
chunkText
=
state
.
xhr
.
response
;
var
lines
=
chunkText
.
split
(
'
\
n'
);
ElMessage
.
error
(
'服务器开小差 '
+
lines
[
0
])
// xhr.abort()
state
.
httpStatus
=
false
;
}
}
};
var
data
=
JSON
.
stringify
({
"model"
:
'moonshot-v1-8k'
,
"messages"
:[
{
"role"
:
"user"
,
"content"
:
'请帮我整理以下内容为json格式“符合《广东省高速公路电子不停车收费联网用户卡、ESAM卡文件结构与数据定义》 高速公路双片式OBE-SAM”'
}
],
"temperature"
:
0.3
,
"stream"
:
true
});
state
.
xhr
.
send
(
data
);
}
const
page_turning
=
(
num
)
=>
{
if
(
router
.
currentRoute
.
value
.
query
.
product_id
==
num
){
ElMessage
.
error
(
'数据已经加载完'
);
}
else
{
router
.
push
({
path
:
'/task/review'
,
query
:
{
product_id
:
num
}});
}
}
// 暴露变量
defineExpose
({
});
/**
* 返回上一级页面
*/
const
backToPreviousPage
=
()
=>
{
// this.$router.push('/target')
router
.
push
({
path
:
'/product_info/allocation'
});
}
const
handleKeyDown
=
(
event
)
=>
{
//监听 ctrl+s
if
(
event
.
key
===
'1'
&&
event
.
altKey
)
{
abnormal
(
4
)
}
if
(
event
.
key
===
'2'
&&
event
.
altKey
)
{
abnormal
(
5
)
}
if
(
event
.
key
===
'3'
&&
event
.
altKey
)
{
onSubmit
()
}
if
(
event
.
key
===
'4'
&&
event
.
altKey
)
{
source_address
(
state
.
info
.
page_url
)
}
}
created
:{
if
(
router
.
currentRoute
.
value
.
query
.
product_id
==
""
||
router
.
currentRoute
.
value
.
query
.
product_id
==
null
||
router
.
currentRoute
.
value
.
query
.
product_id
==
undefined
){
router
.
push
({
path
:
'/product_info/list'
});
}
else
{
state
.
product_id
=
router
.
currentRoute
.
value
.
query
.
product_id
getProductAllocation
()
}
let
height
=
window
.
innerHeight
-
70
;
state
.
tableHeight
=
height
+
"px"
;
}
onMounted
(()
=>
{
document
.
addEventListener
(
'keydown'
,
handleKeyDown
)
});
onUnmounted
(()
=>
{
document
.
removeEventListener
(
'keydown'
,
handleKeyDown
)
});
</
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
>
src/views/task/list/user_enterprise.vue
View file @
3d1f2855
...
...
@@ -19,24 +19,48 @@
<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"
<el-table
v-loading=
"state.loading"
: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=
"distribute_time"
label=
"源网站"
key=
"product_model"
align=
"center"
>
<template
#
default=
"scope"
>
<el-button
type=
"warning"
size=
"small"
@
click=
"source_address(scope.row.enterpriseInfo.enterprise_website_official)"
>
源网站
</el-button>
</
template
>
</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=
"
2
00"
align=
"center"
>
<el-table-column
prop=
"total"
label=
"产品总数"
key=
"product_model"
width=
"
1
00"
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
prop=
"a"
label=
"待分配"
key=
"product_model"
width=
"100"
align=
"center"
>
<
template
#
default=
"scope"
><span>
{{
scope
.
row
.
a
}}
</span></
template
>
</el-table-column>
<el-table-column
prop=
"b"
label=
"正确"
key=
"product_model"
width=
"100"
align=
"center"
>
<
template
#
default=
"scope"
><span>
{{
scope
.
row
.
b
}}
</span></
template
>
</el-table-column>
<el-table-column
prop=
"c"
label=
"数据异常"
key=
"product_model"
width=
"100"
align=
"center"
>
<
template
#
default=
"scope"
><span>
{{
scope
.
row
.
c
}}
</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=
"d"
label=
"检查异常"
key=
"product_model"
width=
"100"
align=
"center"
>
<
template
#
default=
"scope"
><span>
{{
scope
.
row
.
d
}}
</span></
template
>
</el-table-column>
<el-table-column
prop=
"e"
label=
"废弃"
key=
"product_model"
width=
"100"
align=
"center"
>
<
template
#
default=
"scope"
><span
>
{{
scope
.
row
.
e
}}
</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"
>
<el-table-column
prop=
"abnormal"
label=
"是否异常"
key=
"product_model"
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>
<span
style=
"color: #409EFF;"
v-if=
"scope.row.abnormal==1"
>
正常
</span>
<span
style=
"color: #E6A23C;"
v-if=
"scope.row.abnormal==0"
>
未检查
</span>
<span
style=
"color: #67C23A;"
v-if=
"scope.row.abnormal==2"
>
异常
</span>
</
template
>
</el-table-column>
<el-table-column
label=
"操作"
width=
"400"
align=
"center"
>
<
template
#
default=
"scope"
>
<el-button
size=
"small"
type=
"danger"
@
click=
"enterpriseAbnormality(scope.row.id,scope.row.enterpriseInfo.id,2)"
>
异常企业
</el-button>
<el-button
size=
"small"
type=
"primary"
@
click=
"enterpriseAbnormality(scope.row.id,scope.row.enterpriseInfo.id,1)"
>
正常企业
</el-button>
<el-button
size=
"small"
@
click=
"allocation(scope.row.enterpriseInfo.id)"
>
查看详情
</el-button>
</
template
>
</el-table-column>
</el-table>
...
...
@@ -44,7 +68,7 @@
<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
:pager-count=
"5"
:page-sizes=
"[10, 20, 30
,100,500
]"
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>
...
...
@@ -67,7 +91,7 @@ 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 AddDialog = defineAsyncComponent(() => import('.
/add.vue'));
const
Toolbar
=
defineAsyncComponent
(()
=>
import
(
'/@/components/RightToolbar/index.vue'
));
const
Search
=
defineAsyncComponent
(()
=>
import
(
'/@/views/product_info/list/search.vue'
));
...
...
@@ -91,6 +115,7 @@ const state = reactive({
testIndex
:
0
,
taskList
:[],
verifyTypeList
:[
'待检查'
,
'已检查'
],
loading
:
true
});
// 页面加载时
...
...
@@ -113,8 +138,23 @@ const emits = defineEmits(['update:showSearch', 'queryTable','search','refresh']
}).
catch
(()
=>
{
})
}
const
source_address
=
(
source_address
)
=>
{
window
.
open
(
source_address
,
'_blank'
);
}
const
enterpriseAbnormality
=
(
id
,
enterprise_info_id
,
type
)
=>
{
let
apiData
=
{
id
:
id
,
enterprise_info_id
:
enterprise_info_id
,
type
:
type
};
productApi
().
productAllocationAbnormal
(
apiData
).
then
(
res
=>
{
state
.
btnLoading
=
false
ElMessage
.
success
(
'ok'
);
getList
();
}).
catch
(()
=>
{
state
.
btnLoading
=
false
})
}
// 分页改变
const
onHandleSizeChange
=
(
val
)
=>
{
...
...
@@ -128,9 +168,11 @@ const onHandleCurrentChange = (val) => {
// 获取列表
const
getList
=
()
=>
{
state
.
loading
=
true
productApi
().
userEnterpriseList
(
state
.
apiListParam
).
then
(
res
=>
{
state
.
tableData
.
data
=
res
.
data
.
data
state
.
tableData
.
total
=
res
.
data
.
total
state
.
loading
=
false
}).
catch
(()
=>
{
})
...
...
@@ -138,8 +180,8 @@ const getList = () => {
/**
* 进入详情页面
*/
const
allocation
=
(
user_id
,
enterprise_id
)
=>
{
router
.
push
({
path
:
'/
product_info/allocation'
,
query
:
{
user_id
:
user_id
,
enterprise_id
:
enterprise_id
}});
const
allocation
=
(
enterprise_id
)
=>
{
router
.
push
({
path
:
'/
task/enterprise_product'
,
query
:
{
enterprise_id
:
enterprise_id
}});
}
</
script
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment