Commit c7009759 by cwy

指标详情修改完成

parent 430501a3
......@@ -28,6 +28,13 @@ export function normApi() {
data,
});
},
normWhole: (data) => {
return request({
url: '/api/norm/whole',
method: 'post',
data,
});
},
normEdit: (data) => {
return request({
url: '/api/norm/edit',
......
......@@ -196,7 +196,6 @@ const backToPreviousPage = () => {
}
// 详情信息
const whole= () => {
alert(111)
router.push({
path: '/norm/list/whole',query: {norm_id:state.apiData.id}
});
......
......@@ -15,14 +15,23 @@
ref="multipleTableRef">
<el-table-column v-for="column in state.columns" :key="column.prop" :label="column.label" :prop="column.prop" :width="column.width" show-overflow-tooltip align="center">
<template #default="scope">
<span style="color:#409EFF" v-if="column.label =='用户名称'">{{scope.row[column.prop]}}</span>
<el-link type="danger" v-if="checkUrl(scope.row[column.prop])" :href="scope.row[column.prop]" target ="_blank">点击查看</el-link>
<span v-else>{{scope.row[column.prop]}}</span>
<!-- <span style="color:#409EFF" v-if="column.label =='用户名称'">{{scope.row[column.prop]}}</span>
<span style="color:#909399" v-else-if="column.label =='领取状态' && scope.row[column.prop] ==1">已领取</span>
<span style="color:#E6A23C" v-else-if="column.label =='完成状态' && scope.row[column.prop] ==0">未完成</span>
<span style="color:#409EFF" v-else-if="column.label =='完成状态' && scope.row[column.prop] ==1">已完成</span>
<span v-else>{{scope.row[column.prop]}}</span>
<span v-else>{{scope.row[column.prop]}}</span> -->
</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.apiData.page" background
v-model:page-size="state.apiData.limit" layout="total, sizes, prev, pager, next, jumper"
:total="state.total">
</el-pagination>
</div>
</el-card>
</div>
</div>
......@@ -41,134 +50,134 @@
const dialogFormRef = ref();
const state = reactive({
userId: null,
index:0,
userIndex:0,
loading:false,
apiData: {
id:'',
page: 1,
limit: 13,
},
rules: {
},
dialog: {
isShowDialog: false,
title: '',
submitTxt: '',
},
tableData:[
],
columns:[
],
total: 0,
tableData:[],
columns:[],
collectsTableData:[],
collectsColumns:[],
dataLoading: false,
btnLoading: false,
// 填写内容及自定义文本框
formItem: {
addItem:{
name:'',
level:'',
sort:'',
refer:'',
price:'',
task_id:'',
},
dynamicItem: [
//默认显示一条
// {
// name: '',
// value:''
// }
],
userFilled: [
//默认显示一条
// {
// name: '',
// radio:'1',
// }
]
}
});
// 打开弹窗
// 打开页面
const getInfo = () => {
normApi().normDetail(state.apiData).then(res => {
let addItem = res.data.addItem;
state.tableData=[],
state.columns=[],
state.collectsTableData=[],
state.collectsColumns=[],
state.loading = true
normApi().normWhole(state.apiData).then(res => {
state.total = res.data.total;
let custom = res.data.custom;
// 数据详情
state.formItem.addItem.name = addItem.name;
state.formItem.addItem.level = addItem.level;
state.formItem.addItem.sort = addItem.sort+'';
state.formItem.addItem.refer = addItem.refer;
state.formItem.addItem.price =addItem.price;
state.formItem.addItem.task_id= addItem.task_id
state.formItem.addItem.guide= addItem.guide
state.userIndex = 0;
state.index = 0;
let addItem = res.data.addItem
let titleColumn = []; // 表格列标题
custom.forEach(item => {
if(item.user_filled==1){
state.formItem.userFilled.push({name:item.extend_name,radio:item.required+"",remarks:item.extend_remarks});
state.userIndex++
}else{
state.formItem.dynamicItem.push({name:item.extend_name,value:item.extend_value});
state.index++
}
titleColumn.push(item.extend_name);
});
//领取列表
let receivesList = res.data.receivesList
if(receivesList){
let arr = [
// 表格列名称
state.columns = [
{ label:'序号', prop: 'index',width:'80px'},
// { label:'ID', prop: 'id'},
{ label:'用户名称', prop: 'userInfo.name',width:120},
{ label:'任务名称', prop: 'task_info.name',width:180},
{ label:'指标名称', prop: 'norm_list_info.name',width:180},
{ label:'子任务名称', prop: 'norm_info.name',width:180},
{ label:'难度等级', prop: 'norm_info.level',width:180},
{ label:'参考信源', prop: 'norm_info.refer',width:180},
{ label:'单价', prop: 'norm_info.price',width:180},
{ label:'参考指南', prop: 'norm_info.guide',width:180},
{ label:'指标名称', prop: 'norm_list_info.name',width:280},
{ label:'上传文件', prop: 'fileListPdf',width:280},
];
state.columns = arr;
titleColumn.forEach(function(item, index, arr) {
state.columns.push({ label:item, prop: 'extend_name'+index,width:350});
});
//领取列表
let receivesList = res.data.receivesList
receivesList.forEach(function(item, index, arr) {
let list = {
'index': index+1,
// 'id':item.id,
'userInfo.name': item.userInfo.name,
'task_info.name': item.task_info.name,
'norm_info.name': addItem.name,
'norm_info.level': addItem.level,
'norm_info.refer': addItem.refer?addItem.refer:'/',
'norm_info.price': addItem.price,
'norm_info.guide': addItem.guide?addItem.guide:'/',
'norm_list_info.name': item.norm_list_info.name,
'receives_status': item.receives_status,
'completion_status': item.completion_status,
'not_collectible_remarks': item.not_collectible_remarks?item.not_collectible_remarks:"是",
'fileListPdf': item.fileListPdf,
}
state.tableData.push(list);
item.norm_list_extend.forEach(function(items, indexs, arrs) {
if(state.columns.length>0){
state.columns.forEach(function(itemss, indexss, arrss) {
let vlues = state.columns.map(itemsss => itemsss.prop).indexOf('extend_value'+indexs)
if(vlues== -1){
state.columns.push( { label: items.extend_name, prop: 'extend_value'+indexs,width:180 })
// list['extend_name'+indexs] =items.extend_value;
let indexInfo = titleColumn.indexOf(items.extend_name);
if( indexInfo != "-1"){
list['extend_name'+indexInfo] =items.extend_value;
}
});
item.normCollectsExtend.forEach(function(items, indexs, arrs) {
let indexInfo = titleColumn.indexOf(items.extend_name);
if( indexInfo != "-1"){
if(items.extend_value){
list['extend_name'+indexInfo] =items.extend_value;
}else{
state.columns.push( { label: items.extend_name, prop: 'extend_value'+indexs,width:180 })
list['extend_name'+indexInfo] ='/';
}
}
list['extend_value'+indexs] =items.extend_value;
});
});
state.columns.push( { label: '领取状态', prop:'receives_status',width:100 })
state.columns.push( { label: '完成状态', prop:'completion_status',width:100 })
state.columns.push( { label: '是否可采集', prop:'not_collectible_remarks',width:200 })
if(item.status == 0){
list['status'] ='已领取、未填写'
}
if(item.status == 1){
list['status'] ='已完成、未审核'
}
if(item.status == 2){
list['status'] ='已审核、未通过'
}
if(item.status == 3){
list['status'] ='已通过、未结算'
}
if(item.status == 4){
list['status'] ='已通过、已结算'
}
if(item.not_collectible==0||item.not_collectible==""){
list['not_collectible'] ='可采集'
list['not_collectible_remarks'] ='/'
}else{
list['not_collectible'] ='不可采集'
list['not_collectible_remarks'] ='/'
}
list['not_collectible_remarks'] =item.not_collectible_remarks?item.not_collectible_remarks:"是"
});
state.columns.push( { label: '状态', prop:'status',width:350 })
state.columns.push( { label: '是否可采集', prop:'not_collectible',width:200 })
state.columns.push( { label: '不可采集原因', prop:'not_collectible_remarks',width:350 })
state.loading = false
}).catch(() => {
})
};
// 关闭弹窗
const closeDialog = () => {
dialogFormRef.value.resetFields();
state.dialog.isShowDialog = false;
// 分页改变
const onHandleSizeChange = (val) => {
state.apiData.limit = val;
getInfo();
};
const onHandleCurrentChange = (val) => {
state.apiData.page = val;
getInfo();
};
//校验链接
const checkUrl = (vlaue) =>{
if (/^https?:\/\//.test(vlaue)) {
return true;
} else {
return false;
}
}
// 暴露变量
defineExpose({
......@@ -184,11 +193,11 @@
}else{
router.go(-1);
}
state.tableHeight = getCurrentInstance().refs.pageMain.offsetHeight - 50 - 22 + "px";
state.tableHeight = getCurrentInstance().refs.pageMain.offsetHeight - 80 - 22 + "px";
});
</script>
<style scoped lang="scss">
<style scoped lang="scss">
.page-main {
height: calc(100vh - 50px - 116px);
}
......
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