修改产品画像检验检测信息,不良反应信息

main
李劲龙 1 year ago
parent 265677dbef
commit 6b9c34f458

@ -1,8 +1,8 @@
import request from "@/utils/request";
// 本地
// let api = "API"
let api = "API"
// 线上
let api = location.origin
// let api = location.origin
export default {
frimLogin() {
return request({
@ -16,10 +16,10 @@ export default {
method: "POST",
timeout: 60000,
data: {
pdma: "Q2V0YzI4QGNvbQ==",
urne: "2112042170015",
// pdma: "MTExMTEx",
// pdma: "Q2V0YzI4QGNvbQ==",
// urne: "2112042170015",
pdma: "MTExMTEx",
urne: "2112042170015",
},
});
},

@ -71,14 +71,14 @@ DictData.install()
import { setToken } from '@/utils/auth'
// 临时获取token
// let token = async () => {
// let Authentication = await API.login.frimLogin();
// localStorage.setItem(
// "MSSM-LIAONING__TOKEN",
// Authentication.data.result.userToken
// );
// }
// token()
let token = async () => {
let Authentication = await API.login.frimLogin();
localStorage.setItem(
"MSSM-LIAONING__TOKEN",
Authentication.data.result.userToken
);
}
token()
let infor = async () => {
let response = await API.login.getuserinfo();
localStorage.setItem("userDto", JSON.stringify(response?.result.userDto));
@ -94,7 +94,10 @@ infor()
* Currently MockJs will be used in the production environment,
* please remove it before going online! ! !
*/
/*
*/
Vue.use(Element, {
size: Cookies.get('size') || 'medium' // set element-ui default size
})

@ -15,9 +15,9 @@ axios.defaults.headers['Content-Type'] = 'application/json;charset=utf-8'
// 创建axios实例
const service = axios.create({
// axios中请求配置有baseURL选项表示请求URL公共部分
// baseURL: process.env.VUE_APP_BASE_API,
baseURL: process.env.VUE_APP_BASE_API,
//!线上
baseURL:location.origin,
// baseURL:location.origin,
// 超时
timeout: 10000
})

@ -55,20 +55,20 @@
<div class="bottom-box" ref="bottom-box"></div>
</div>
<div class="rights">
<div>
<div v-for="(item, index) in pieDatalist">
<div class="pt-top">
<div class="ptleftbox">
<div class="rectangular1"></div>
<div :class="'rectangular' + (index + 1)"></div>
</div>
<div class="texts">一般不良反应</div>
<div class="texts">{{ item.name }}</div>
</div>
<div class="pt-top">
<div class="ptleftbox"></div>
<div class="boxLine"></div>
<div class="ptStyle react1">0%</div>
<div :class="('react' + (index + 1))" class="ptStyle">{{item.percent}}%</div>
</div>
</div>
<div>
<!-- <div>
<div class="pt-top">
<div class="ptleftbox">
<div class="rectangular2"></div>
@ -80,8 +80,8 @@
<div class="boxLine"></div>
<div class="ptStyle react2">0%</div>
</div>
</div>
<div>
</div> -->
<!-- <div>
<div class="pt-top">
<div class="ptleftbox">
<div class="rectangular3"></div>
@ -93,7 +93,7 @@
<div class="boxLine"></div>
<div class="ptStyle react3">0%</div>
</div>
</div>
</div> -->
</div>
</div>
</div>
@ -115,6 +115,7 @@ export default {
option1: {},
// echarts
myChart1: {},
a1: 0,
a2: 0,
a3: 0,
@ -133,6 +134,20 @@ export default {
name: "发生死亡不良反应",
},
],
pieDatalist: [
{
percent: 0,
name: "一般不良反应",
},
{
percent: 0,
name: "严重不良反应",
},
{
percent: 0,
name: "发生死亡不良反应",
},
],
total: 0,
};
},
@ -376,6 +391,13 @@ export default {
normal: {
show: false,
formatter: "",
formatter: (params)=> {
if (params.name == "一般不良反应") this.pieDatalist[0].percent = params.percent || 0;
if (params.name == "严重不良反应") this.pieDatalist[1].percent = params.percent || 0;
if (params.name == "发生死亡不良反应") this.pieDatalist[2].percent = params.percent || 0;
return (params.percent || 0) + "%";
},
textStyle: {
fontSize: 12,
},
@ -505,6 +527,7 @@ export default {
.topbox-item-right {
flex: 1;
.redStyle {
font-size: 16px;
font-family: Alibaba PuHuiTi;
@ -515,6 +538,7 @@ export default {
-webkit-text-fill-color: transparent;
margin-right: 5px;
}
div {
font-size: 16px;
font-family: Alibaba PuHuiTi;
@ -542,6 +566,7 @@ export default {
}
}
}
.footers {
height: calc(100% - 120px);
display: flex;
@ -550,11 +575,13 @@ export default {
height: 100%;
width: 50%;
padding: 10px;
.bottom-box {
height: 100%;
width: 100%;
}
}
.rights {
height: 100%;
padding-left: 15px;
@ -569,25 +596,30 @@ export default {
display: flex;
align-items: center;
position: relative;
.ptleftbox {
width: 12%;
height: 100%;
.rectangular1 {
height: 8px;
width: 8px;
background: #2e87e8;
}
.rectangular2 {
height: 8px;
width: 8px;
background: #f0a436;
}
.rectangular3 {
height: 8px;
width: 8px;
background: #f35656;
}
}
.texts {
width: 60%;
font-size: 16px;
@ -595,6 +627,7 @@ export default {
font-weight: 400;
color: #b7d4f5;
}
.react1 {
// font-size: 20px;
font-family: Alibaba PuHuiTi;
@ -602,6 +635,7 @@ export default {
color: #2e87e8;
padding-left: 10px;
}
.react2 {
// font-size: 20px;
font-family: Alibaba PuHuiTi;
@ -609,6 +643,7 @@ export default {
color: #f0a436;
padding-left: 10px;
}
.react3 {
// font-size: 20px;
font-family: Alibaba PuHuiTi;
@ -617,15 +652,15 @@ export default {
color: #f35656;
}
.ptStyle {
width: 60%;
margin-top: 5px;
background: linear-gradient(
to right,
background: linear-gradient(to right,
rgba(36, 64, 97, 1),
rgba(36, 64, 97, 0)
);
rgba(36, 64, 97, 0));
}
.boxLine {
position: absolute;
width: 18px;

@ -109,7 +109,7 @@ export default {
<style scoped lang='scss'>
.Basic-box {
margin-top: 10px;
width: 100%;
max-width: 100%;
height: calc(100% - 41px - 10px);
// padding: 0 11px 11px 11px;
overflow-y: auto;

@ -76,7 +76,25 @@ export default {
option1: {},
// echarts
myChart1: {},
myChart1data: [
// : valuenameitemStyle
// : namelegend-data
{
value: "0",
name: "生产抽样环节",
percent: "0",
// itemStyle: { color: "#007EFF" },
},
{
value: "0",
name: "流通环节抽样",
percent: "0",
// itemStyle: { color: "#2CD8EC" },
},
],
option2: {},
myChart2data: [],
myChart2data2: [],
// echarts
myChart2: {},
//==============
@ -94,21 +112,51 @@ export default {
this.getData();
},
methods: {
reducefn(data = []) {
return data.reduce((accumulator, current) => current.sampleType + accumulator, 0);
},
getData() {
let newRouter = this.$route.query;
getCPCJ({ name: newRouter.code }).then((res) => {
res.data.result.forEach((value, index) => {
if (value.sampleType == 1) {
this.provinceC += 1;
} else if (value.sampleType == 2) {
this.countryC += 1;
if (res.code == 200) {
if (res.data.result.length != 0) {
//
this.myChart1data[0].value = res.data.result.filter(item => item.inspectType === "生产环节").length
this.myChart1data[0].percent = ((res.data.result.filter(item => item.inspectType === "生产环节").length / res.data.result.length) * 100).toFixed(1)
this.myChart1data[1].value = res.data.result.filter(item => item.inspectType === "流通环节").length
this.myChart1data[1].percent = ((res.data.result.filter(item => item.inspectType === "流通环节").length / res.data.result.length) * 100).toFixed(1)
//
let mergedData = {};
res.data.result.forEach((item) => {
if (item.qualified === "合格") {
if (mergedData[item.province]) {
mergedData[item.province].sampleType += item.sampleType;
} else {
mergedData[item.province] = {
province: item.province,
sampleType: item.sampleType
};
}
}
});
// this.countryC = 12;
// this.provinceC = 12;
// this.pt = 67;
// this.sccy = 60;
// this.ltcy = 40;
const result = Object.values(mergedData);
result.forEach(item=>{
this.myChart2data.push(item.province)
this.myChart2data2.push(item.sampleType)
})
//
this.countryC = res.data.result.length
//
const filteredData = res.data.result.filter(item => item.qualified === "不合格");
this.pt = Math.floor(((this.reducefn(res.data.result) - this.reducefn(filteredData)) / this.reducefn(res.data.result)) * 100)
}else{
this.myChart2data = ["暂无"]
this.myChart2data2 = ['0']
}
}
this.$nextTick(() => {
let chartDom = this.$refs["left-echart"];
this.myChart1 = echarts.init(chartDom);
@ -131,9 +179,9 @@ export default {
params.marker +
params.name +
": " +
params.value +
( params.value||0) +
" (" +
params.percent +
( params.percent || 0) +
"%)</div>"
);
},
@ -156,15 +204,15 @@ export default {
{
name: "",
type: "pie",
radius: ["45%", "70%"],
center: ["50%", "40%"], // y '40%'使
radius: ["45%", "66%"],
center: ["50%", "44%"], // y '40%'使
// itemStyle:{
// borderWidth:1, //border
// borderColor:'#fff',
// },
labelLine: {
normal: {
length: 15, // 线
length: 10, // 线
position: "outer", // 线
lineStyle: function (params) {
//
@ -180,7 +228,7 @@ export default {
//
// params: data,
formatter: function (params) {
return params.percent + "%";
return (params.data.percent || 0) + "%";
},
textStyle: {
color: "auto",
@ -188,22 +236,7 @@ export default {
},
},
},
data: [
// : valuenameitemStyle
// : namelegend-data
{
value: "1",
name: "生产抽样环节",
// percent: "39",
// itemStyle: { color: "#007EFF" },
},
{
value: "1",
name: "流通环节抽样",
// percent: "21",
// itemStyle: { color: "#2CD8EC" },
},
],
data: this.myChart1data
},
],
};
@ -238,11 +271,12 @@ export default {
fontSize: 12,
margin: 0,
},
rotate: -30, //
},
axisTick: {
show: false,
},
data: ["辽宁", "江苏", "湖南", "山西", "湖北", "山东"],
data: this.myChart2data
},
],
yAxis: [
@ -302,7 +336,7 @@ export default {
},
},
data: [12, 15, 17, 20, 25, 26],
data: this.myChart2data2
},
],
};
@ -313,8 +347,7 @@ export default {
};
</script>
<style scoped lang='scss'>
.box {
}
.box {}
.top-box {
margin: 10px 0;

@ -349,7 +349,8 @@ div {
}
.system-box-left {
flex: 1;
// flex: 1;
width: 25vw;
.system-boxleft-top,
.system-boxleft-bottom {
@ -366,6 +367,8 @@ div {
.system-box-right {
flex: 1;
width: 25vw;
}
}

@ -105,7 +105,7 @@ export default {
</script>
<style scoped lang='scss'>
::v-deep .el-pagination {
width: 100%;
max-width: 100%;
display: flex;
justify-content: end;
padding: 8px 5px;

@ -102,7 +102,8 @@ export default {
gotoBgpage() {
if (this.input) {
console.log(this.searchList, 'this.searchList')
if (this.searchList.length == 1) {
console.log( this.getData.code," this.getData");
if (this.searchList.length == 1 || this.getData.code) {
this.$router.push({ path: "/bgpage", query: { code: this.getData.code, name: this.getData.name, type: this.getData.type } })
this.searchList = [];
} else if (this.searchList.length > 1) {

Loading…
Cancel
Save