diff --git a/src/assets/icons/svg/order.svg b/src/assets/icons/svg/order.svg
index 82365f9e..bdb17fdb 100644
--- a/src/assets/icons/svg/order.svg
+++ b/src/assets/icons/svg/order.svg
@@ -1 +1,14 @@
-
\ No newline at end of file
+
+
\ No newline at end of file
diff --git a/src/views/OperationalOverview/coldBoard.vue b/src/views/OperationalOverview/coldBoard.vue
index 6e09491a..430b57df 100644
--- a/src/views/OperationalOverview/coldBoard.vue
+++ b/src/views/OperationalOverview/coldBoard.vue
@@ -2,7 +2,7 @@
* @Author: zwq
* @Date: 2021-07-19 15:18:30
* @LastEditors: zhp
- * @LastEditTime: 2024-01-11 15:54:50
+ * @LastEditTime: 2024-01-17 14:00:15
* @Description:
-->
@@ -30,8 +30,9 @@
-
+
+
@@ -48,8 +49,9 @@
-
+
+
@@ -78,25 +80,30 @@
-
+
融化风机
-
+
+
退火风机
-
+
+
产线设备
-
+
+
+
@@ -136,11 +143,12 @@ import pileBarChart from './components/pileBarChart'
import colorDiv from './components/colorDiv'
// import axios from '@/utils/request'
-import doubleYChart from './components/doubleYChart '
+import doubleYChart from './components/coldDoubleYChart'
// import elementResizeDetectorMaker from 'element-resize-detector';
// var erd = elementResizeDetectorMaker(); //创建实例
// let resizeFun = null
import { parseTime } from '../core/mixins/code-filter';
+import { formatDate } from '@/utils'
import LinearBarChart from './components/linearBarChart'
@@ -264,6 +272,61 @@ export default {
ISRATableProps,
orderList: [],
times: '',
+ cutConfig: {
+ header: ['序号', '产线', '时间', '规格', '良品面积', '废品面积', '良品率'],
+ headerBGC: 'rgba(32, 55, 96, 0.8)',
+ oddRowBGC: 'rgba(32, 55, 96, 0.8)',
+ evenRowBGC: 'rgba(14, 32, 62, 0.8)',
+ columnWidth: [70,70, 130, 150, 110,110,90],
+ align: ['center'],
+ data: [],
+ // index:true,
+ rowNum: 10
+ },
+ funConfig: {
+ header: ['序号', '设备名称', '运行状态'],
+ headerBGC: 'rgba(32, 55, 96, 0.8)',
+ oddRowBGC: 'rgba(32, 55, 96, 0.8)',
+ evenRowBGC: 'rgba(14, 32, 62, 0.8)',
+ columnWidth: [60, 90, 90],
+ align: ['center'],
+ data: [],
+ // index:true,
+ rowNum: 10
+ },
+ realEqConfig: {
+ header: ['序号', '产线', '设备名称', '设备编码', '运行状态','故障状态'],
+ headerBGC: 'rgba(32, 55, 96, 0.8)',
+ oddRowBGC: 'rgba(32, 55, 96, 0.8)',
+ evenRowBGC: 'rgba(14, 32, 62, 0.8)',
+ columnWidth: [60, 80, 90,90,90,90],
+ align: ['center'],
+ data: [],
+ // index:true,
+ rowNum: 10
+ },
+ annealFunConfig: {
+ header: ['序号', '设备名称', '运行状态'],
+ headerBGC: 'rgba(32, 55, 96, 0.8)',
+ oddRowBGC: 'rgba(32, 55, 96, 0.8)',
+ evenRowBGC: 'rgba(14, 32, 62, 0.8)',
+ columnWidth: [60, 90, 90],
+ align: ['center'],
+ data: [],
+ // index:true,
+ rowNum: 10
+ },
+ ISRAConfig: {
+ header: ['序号', '产线', '时间', '缺陷类型', '缺陷数量', '占比'],
+ headerBGC: 'rgba(32, 55, 96, 0.8)',
+ oddRowBGC: 'rgba(32, 55, 96, 0.8)',
+ evenRowBGC: 'rgba(14, 32, 62, 0.8)',
+ columnWidth: [70, 70, 130, 150, 110, 110,],
+ align: ['center'],
+ data: [],
+ // index:true,
+ rowNum: 10
+ },
ISRAList:[],
EnergyMonitoringNameList: [],
equipmentList: [],
@@ -484,22 +547,47 @@ export default {
if (this.funWsData.type === 'AnnealFanInfo') {
let arr = []
for (let i in this.funWsData.data.annealFanInfo) {
- arr.push({
- equipmentName: i,
- status: this.funWsData.data.annealFanInfo[i]
- })
+ // arr.push({
+ // equipmentName: i,
+ // status: this.funWsData.data.annealFanInfo[i]
+ // })
+ arr.push([
+ // console.log(item)
+ `
+ ${index + 1 || ''}
+ `,
+ // formatDate(item.planStartTime) || '',
+ `
+ ${i || ''}
+ `,
+ `${this.funWsData.data.annealFanInfo[i] || ''}`,
+ ])
}
- this.annealFunList = arr
+ this.annealFanConfig.data = arr
+ this.$refs['annealFanScrollBoard'].updateRows(arr)
}
if (this.funWsData.type === 'FanInfo') {
let arr = []
for (let i in this.funWsData.data.fanInfo) {
- arr.push({
- equipmentName: i,
- status: this.funWsData.data.fanInfo[i]
- })
+ // arr.push({
+ // equipmentName: i,
+ // status: this.funWsData.data.fanInfo[i]
+ // })
+ arr.push([
+ // console.log(item)
+ `
+ ${index + 1 || ''}
+ `,
+ // formatDate(item.planStartTime) || '',
+ `
+ ${i || ''}
+ `,
+ `${this.funWsData.data.fanInfo[i] || ''}`,
+ ])
}
- this.funList = arr
+ this.funConfig.data = arr
+ this.$refs['funScrollBoard'].updateRows(arr)
+ // this.funList = arr
}
},
cutWebsocketOnOpen() {
@@ -511,30 +599,49 @@ export default {
this.CutInitWebSocket()
},
getSize(str) {
- console.log(str.match(/\d+(\.\d+)?/g))
+ // console.log(str.match(/\d+(\.\d+)?/g))
let size = str.match(/\d+(\.\d+)?/g).map(ele => {
return parseFloat(ele)
})
- console.log(size[0] + '*' + size[1] + '*' + size[2]);
+ // console.log(size[0] + '*' + size[1] + '*' + size[2]);
return size[0] + '*' + size[1] + '*' + size[2]
},
// 数据接收
cutWebsocketOnMessage(e) {
this.cutWsData = e?.data ? JSON.parse(e?.data) : {}
if (this.cutWsData.type === 'cutting' && this.cutWsData.name === 'table') {
- this.cutTableDataList = this.cutWsData.productHourData.map((ele, index) => {
- // if (ele.progressRate != 1) {
- return {
- id: ele.id,
- lineName: ele.lineName,
- time: ele.time,
- size: this.getSize(ele.size),
- productArea: ele.productArea + '㎡',
- wasteArea: ele.wasteArea + '㎡',
- product: (ele.product * 100).toFixed(2)
- }
- // }
- });
+ // this.cutTableDataList = this.cutWsData.productHourData.map((ele, index) => {
+ // // if (ele.progressRate != 1) {
+ // return {
+ // id: ele.id,
+ // lineName: ele.lineName,
+ // time: ele.time,
+ // size: this.getSize(ele.size),
+ // productArea: ele.productArea + '㎡',
+ // wasteArea: ele.wasteArea + '㎡',
+ // product: (ele.product * 100).toFixed(2)
+ // }
+ // // }
+ // });
+ let cutArr = this.cutWsData.productHourData.map((item, index) => [
+ // console.log(item)
+ `
+ ${index + 1 || ''}
+ `,
+ // formatDate(item.planStartTime) || '',
+ `
+ ${item.lineName || ''}
+ `,
+ `${formatDate(item.time) || ''}`,
+ `${this.getSize(item.size) || ''}`,
+ `${item.productArea + '㎡' || ''}`,
+ `${item.wasteArea + '㎡' || ''}`,
+ `${(item.product * 100).toFixed(2) + '%' || ''}
+ ${(item.product * 100).toFixed(2) + '%' || ''}
`
+ ])
+ this.cutConfig.data = cutArr
+ this.$refs['cutScrollBoard'].updateRows(cutArr)
+
} else if (this.cutWsData.type === 'cutting' && this.cutWsData.name === 'chart' && this.cutWsData.dateType === 'day') {
let nameList = []
let nameWasteList = []
@@ -571,33 +678,51 @@ export default {
// let obj = JSON.parse(data.data)
this.SJGWsData = e?.data ? JSON.parse(e?.data) : {}
if (this.SJGWsData.type === 'isra') {
- this.ISRAList = this.SJGWsData.detData.map((ele, index) => {
- // if (ele.progressRate != 1) {
- return {
- id: ele.id,
- linename: ele.linename,
- type: ele.type,
- num: ele.num,
- time:ele.time,
- percent: ele.percent
- }
- // }
- });
+ // this.ISRAList = this.SJGWsData.detData.map((ele, index) => {
+ // // if (ele.progressRate != 1) {
+ // return {
+ // id: ele.id,
+ // linename: ele.linename,
+ // type: ele.type,
+ // num: ele.num,
+ // time:ele.time,
+ // percent: ele.percent
+ // }
+ // // }
+ // });
+ console.log(this.SJGWsData.detData);
+ let ISRAArr = this.SJGWsData.detData.map((item, index) => [
+ // console.log(item)
+ `${index + 1 || ''}
+ `,
+ // formatDate(item.planStartTime) || '',
+ `
+ ${item.linename || ''}
+ `,
+ `${item.time || ''}`,
+ `${item.type || ''}`,
+ `${item.num || ''}`,
+ `${item.percent|| ''}`,
+ ])
+ this.ISRAConfig.data = ISRAArr
+ this.$refs['ISRAScrollBoard'].updateRows(ISRAArr)
} else if (this.SJGWsData.type === 'equipment') {
- this.realEqList = this.SJGWsData.detData.map((ele, index) => {
- // if (ele.progressRate != 1) {
- return {
- line: ele.line,
- name: ele.name,
- code: ele.code,
- run: ele.run,
- error: ele.error,
- // percent: ele.percent
- }
- // }
- });
-
+ this.realEqList = this.SJGWsData.detData.map((ele, index) =>[
+ // console.log(item)
+ `${index + 1 || ''}
+ `,
+ // formatDate(item.planStartTime) || '',
+ `
+ ${item.line || ''}
+ `,
+ `${item.name || ''}`,
+ `${item.code || ''}`,
+ `${item.run || ''}`,
+ `${item.error || ''}`,
+ ]);
}
+ this.realEqConfig.data = this.realEqList
+ this.$refs['realEqScrollBoard'].updateRows(this.realEqList)
},
windowWidth(value) {
this.clientWidth = value
@@ -818,4 +943,44 @@ export default {
/* .container-main {
min-height: calc(100vh - 10em);
} */
+.orange {
+ color: rgba(255, 209, 96, 1)
+}
+
+.white {
+ color: rgba(255, 255, 255, 0.5)
+}
+.tooltip {
+ position: relative;
+ display: inline-block;
+}
+.tooltip .tooltiptext {
+ visibility: hidden;
+ width: 120px;
+ background-color: black;
+ color: #fff;
+ text-align: center;
+ border-radius: 6px;
+ padding: 5px 0;
+ position: absolute;
+ z-index: 1;
+ bottom: 150%;
+ left: 50%;
+ margin-left: -60px;
+}
+
+.tooltip .tooltiptext::after {
+ content: "";
+ position: absolute;
+ top: 100%;
+ left: 50%;
+ margin-left: -5px;
+ border-width: 5px;
+ border-style: solid;
+ border-color: black transparent transparent transparent;
+}
+
+.tooltip:hover .tooltiptext {
+ visibility: visible;
+}
diff --git a/src/views/OperationalOverview/components/baseContainer/index.vue b/src/views/OperationalOverview/components/baseContainer/index.vue
index 4df9f082..27a7b647 100644
--- a/src/views/OperationalOverview/components/baseContainer/index.vue
+++ b/src/views/OperationalOverview/components/baseContainer/index.vue
@@ -2,7 +2,7 @@
* @Author: gtz
* @Date: 2022-01-19 15:58:17
* @LastEditors: zhp
- * @LastEditTime: 2024-01-11 15:54:37
+ * @LastEditTime: 2024-01-17 14:57:00
* @Description: file content
* @FilePath: \mt-bus-fe\src\views\OperationalOverview\components\baseContainer\index.vue
-->
@@ -22,12 +22,21 @@
-
+
{{ title }}
+
+
@@ -83,21 +92,39 @@ export default {
data() {
return {
curIndex: 0,
+ time: null,
+ time2:null
// imgUrl: require(`../../../../assets/img/${this.back}.png`),
}
},
created() {
- // console.log(this.back);
- // this.$nextTick(() => {
- // this.$refs.baseContainer.style = `background:url('../../../../assets/img/${this.back}.png') no-repeat;)`
- // })
- // console.log(this.$refs.baseContainer.style)
+ },
+ mounted () {
+ this.time = this.format(new Date().setHours(7,0,0));
+ // console.log(time);
+ //前一天时间
+ this.time2 = this.format(new Date().setHours(7, 0, 0) - 86400000 * 1);
+ console.log(new Date().setHours(7, 0, 0) - 86400000 * 1);
},
methods: {
+ add0(m) {
+ return m < 10 ? '0' + m : m
+ },
+ format(shijianchuo) {
+ //shijianchuo是整数,否则要parseInt转换
+ var time = new Date(shijianchuo);
+ var y = time.getFullYear();
+ var m = time.getMonth() + 1;
+ var d = time.getDate();
+ var h = time.getHours();
+ var mm = time.getMinutes();
+ var s = time.getSeconds();
+ return y + '-' + this.add0(m) + '-' + this.add0(d) + ' ' + h + '时'
+ },
changeTab(num) {
this.curIndex = num
this.$emit('tabSelect', num)
- }
+ },
}
}
@@ -198,11 +225,13 @@ export default {
color: #ffffff;
font-size: 24px;
padding: 0.67em;
+ display: flex;
}
.bar-content {
// padding: 1em;
flex: 1 auto;
+ position: relative;
}
.no-padding {
diff --git a/src/views/OperationalOverview/components/baseTable.vue b/src/views/OperationalOverview/components/baseTable.vue
index dd9d66f8..877e6d40 100644
--- a/src/views/OperationalOverview/components/baseTable.vue
+++ b/src/views/OperationalOverview/components/baseTable.vue
@@ -1,7 +1,7 @@
@@ -110,12 +110,12 @@ export default {
},
classOption() {
return {
- step: 0.3, // 数值越大速度滚动越快
- limitMoveNum: 1, // 开始无缝滚动的数据量 this.list
+ step: 0.2, // 数值越大速度滚动越快
+ limitMoveNum: 10, // 开始无缝滚动的数据量 this.list
hoverStop: true, // 是否开启鼠标悬停stop
direction: 1, // 0向下 1向上 2向左 3向右
openWatch: true, // 开启数据实时监控刷新dom
- singleHeight: 0, // 单步运动停止的高度(默认值0是无缝不停止的滚动) direction => 0/1
+ singleHeight: 0/1, // 单步运动停止的高度(默认值0是无缝不停止的滚动) direction => 0/1
singleWidth: 0, // 单步运动停止的宽度(默认值0是无缝不停止的滚动) direction => 2/3
waitTime: 1000, // 单步运动停止的时间(默认值1000ms)
};
diff --git a/src/views/OperationalOverview/components/coldDoubleYChart.vue b/src/views/OperationalOverview/components/coldDoubleYChart.vue
new file mode 100644
index 00000000..b8e4ebba
--- /dev/null
+++ b/src/views/OperationalOverview/components/coldDoubleYChart.vue
@@ -0,0 +1,292 @@
+
+
+
+
+
+
+
+
diff --git a/src/views/OperationalOverview/components/doubleYChart .vue b/src/views/OperationalOverview/components/doubleYChart .vue
index 2ab204d9..2d43f501 100644
--- a/src/views/OperationalOverview/components/doubleYChart .vue
+++ b/src/views/OperationalOverview/components/doubleYChart .vue
@@ -1,13 +1,13 @@
@@ -70,9 +70,9 @@ export default {
mounted() {
console.log('mounted')
console.log('borderRadius: ', this.borderRadius)
- this.$nextTick(() => {
- this.initChart()
- })
+ // this.$nextTick(() => {
+ // this.initChart()
+ // })
},
beforeDestroy() {
if (!this.chart) {
@@ -83,6 +83,7 @@ export default {
},
methods: {
initChart(nameList, passRateList, outputNumList) {
+ console.log(nameList, passRateList)
let series= [
{
name: '产线产量',
@@ -151,11 +152,12 @@ export default {
left: "3%",
right: "5%",
bottom: "3%",
- width: 'auto',
- height: "auto",
containLabel: true
},
legend: {
+ itemWidth: 10,
+ itemHeight: 10,
+ right: '20px',
data: ['产线产量', '产线良品率'],
textStyle: {
fontSize: 12 * this.beilv,
@@ -281,3 +283,8 @@ export default {
}
}
+
diff --git a/src/views/OperationalOverview/components/linearBarChart.vue b/src/views/OperationalOverview/components/linearBarChart.vue
index 2ddb9ea3..3ad80f95 100644
--- a/src/views/OperationalOverview/components/linearBarChart.vue
+++ b/src/views/OperationalOverview/components/linearBarChart.vue
@@ -173,3 +173,4 @@ export default {
}
}
+
diff --git a/src/views/OperationalOverview/components/pileBarChart.vue b/src/views/OperationalOverview/components/pileBarChart.vue
index 8aa32129..ecd50270 100644
--- a/src/views/OperationalOverview/components/pileBarChart.vue
+++ b/src/views/OperationalOverview/components/pileBarChart.vue
@@ -1,13 +1,13 @@
@@ -133,14 +133,17 @@ export default {
// }
this.chart.setOption({
legend: {
+ // top: '2.5%',
+ // right: '20px',
textStyle: {
color: '#ffffff'
}
},
grid: {
+ top:'80',
left: '3%',
right: '4%',
- bottom: '3%',
+ // bottom: '3%',
width: 'auto',
height: 'auto',
containLabel: true
@@ -213,3 +216,7 @@ export default {
}
}
+
diff --git a/src/views/OperationalOverview/processingBoard.vue b/src/views/OperationalOverview/processingBoard.vue
index 73cfe297..6adc59b0 100644
--- a/src/views/OperationalOverview/processingBoard.vue
+++ b/src/views/OperationalOverview/processingBoard.vue
@@ -2,7 +2,7 @@
* @Author: zwq
* @Date: 2021-07-19 15:18:30
* @LastEditors: zhp
- * @LastEditTime: 2024-01-12 09:59:58
+ * @LastEditTime: 2024-01-17 13:52:44
* @Description:
-->
@@ -32,22 +32,25 @@
-
+
+
+
-
+
+
-
+
@@ -126,8 +129,7 @@
-->
-
+
@@ -547,6 +549,28 @@ export default {
// offsetWidth: null,
qualityYearTableProps,
cxNameList,
+ eqConfig: {
+ header: ['序号', '设备名称', '工序', '损耗片数', '缺陷类型'],
+ headerBGC: 'rgba(32, 55, 96, 0.8)',
+ oddRowBGC: 'rgba(32, 55, 96, 0.8)',
+ evenRowBGC: 'rgba(14, 32, 62, 0.8)',
+ columnWidth: [70, 130, 100, 120, 110,],
+ align: ['center'],
+ data: [],
+ // index:true,
+ rowNum: 10
+ },
+ processConfig: {
+ header: ['序号', '产线名', '设备编码', '设备状态', '是否故障'],
+ headerBGC: 'rgba(32, 55, 96, 0.8)',
+ oddRowBGC: 'rgba(32, 55, 96, 0.8)',
+ evenRowBGC: 'rgba(14, 32, 62, 0.8)',
+ columnWidth: [70, 70, 130, 150, 110,],
+ align: ['center'],
+ data: [],
+ // index:true,
+ rowNum: 10
+ },
cxDataList,
productLineList:[],
qualityYearList,
@@ -607,8 +631,7 @@ export default {
this.SJGInitWebSocket()
this.getTimes()
this.$refs.EnergyMonitoringChart.initChart(['Y61', 'Y62', 'Y63', 'Y64', 'Y65',], [3134, 2323, 3232, 3233, 2321])
- this.$refs.productLineChart.initChart(['Y61', 'Y62', 'Y63', 'Y64', 'Y65',], ['98', '97', '98.7', '98.5', '98.3',], ['4532', '1223', '3442', '4343', '2232'])
-
+ this.$refs.productLineChart.initChart(['Y61', 'Y62', 'Y63', 'Y64', 'Y65',], [98, 97, 98.7, 98.5, 98.3,], [3134, 2323, 3232, 3233, 2321])
const _this = this;
_this.beilv2 = document.documentElement.clientWidth / 1920
window.onresize = () => {
@@ -651,13 +674,28 @@ export default {
// console.log('11111', res);
this.productLineList = res.data
})
- // this.$axios.get(
- // 'base/quality-inspection-record/dayStatistics',
- // 'get',
- // ).then((res) => {
- // // console.log('11111', res);
- // this.qualityMonthList = res.data ? res.data : []
- // })
+ this.$axios.get(
+ 'base/quality-inspection-record/dayStatistics',
+ 'get',
+ ).then((res) => {
+ // console.log('11111', res);
+ if (res.data) {
+ let processArr = res.data.map((item, index) => [
+ // console.log(item)
+ `
${index + 1 || ''}
+ `,
+ // formatDate(item.planStartTime) || '',
+ `
+
${item.productionLineName || ''}
+ `,
+ `
${item.sectionName || ''}`,
+ `
${item.count || ''}`,
+ `
${item.inspectionTypeName || ''}`,
+ ])
+ this.processConfig.data = processArr
+ this.$refs['processScrollBoard'].updateRows(processArr)
+ }
+ })
},
getTimes() {
setInterval(this.getTimesInterval, 1000);
@@ -752,17 +790,31 @@ export default {
});
console.log(this.orderList)
} else if (this.SJGWsData.type === 'equipment') {
- this.equipmentList = this.SJGWsData.detData.map((ele, index) => {
- // if (ele.progressRate != 1) {
- return {
- id: ele.id,
- name: ele.name,
- code: ele.code,
- status: ele.status,
- error: ele.error=== true ? '是' : '否'
- }
- // }
- });
+ // this.equipmentList = this.SJGWsData.detData.map((ele, index) => {
+ // // if (ele.progressRate != 1) {
+ // return {
+ // id: ele.id,
+ // name: ele.name,
+ // code: ele.code,
+ // status: ele.status,
+ // error: ele.error=== true ? '是' : '否'
+ // }
+ // // }
+ // });
+ let eqArr = this.SJGWsData.detData.map((item, index) => [
+ // console.log(item)
+ `
${index + 1 || ''}
+ `,
+ // formatDate(item.planStartTime) || '',
+ `
+
${item.name || ''}
+ `,
+ `
${item.code || ''}`,
+ `
${item.status || ''}`,
+ `
${item.error || ''}`,
+ ])
+ this.eqConfig.data = eqArr
+ this.$refs['eqScrollBoard'].updateRows(eqArr)
// console.log(SJGWsData.orderList)
} else if (this.SJGWsData.type === 'productline') {
// console.log(this.wsData.detData);
@@ -1061,7 +1113,7 @@ export default {
flex: 1 1;
}
.h-full {
- height: calc(100vh - 150px);
+ height: calc(100vh);
}
/* .container-main {
min-height: calc(100vh - 10em);
diff --git a/src/views/quality/base/qualityHotMaterial/add-or-updata.vue b/src/views/quality/base/qualityHotMaterial/add-or-updata.vue
index d9575dff..73e9691b 100644
--- a/src/views/quality/base/qualityHotMaterial/add-or-updata.vue
+++ b/src/views/quality/base/qualityHotMaterial/add-or-updata.vue
@@ -1,13 +1,13 @@
-
-
+
+
{{ isdetail ? '详情' : !dataForm.id ? '新增' : '编辑' }}
@@ -90,6 +90,18 @@
+
+
+
+
+
+
+
+
+
+
@@ -252,6 +264,10 @@ export default {
this.dataForm.checkValueList[index].isStandard = false
}
},
+ handleClose() {
+ this.ingredientList = undefined
+ console.log(222222222);
+ },
dataFormSubmit() {
this.$refs["dataForm"].validate((valid) => {
if (!valid) {
@@ -288,7 +304,9 @@ export default {
Promise.all(array).then(res => {
console.log(res)
this.visible = false;
+ this.$modal.msgSuccess("修改成功");
this.$emit("refreshDataList");
+ this.ingredientList = []
}).catch(error => {
// 如果任何一个请求失败,将会进入这个 catch 块
console.log(error)
@@ -326,6 +344,7 @@ export default {
Promise.all(array).then(res => {
this.$modal.msgSuccess("新增成功");
this.visible = false;
+ this.ingredientList= []
this.$emit("refreshDataList");
}).catch(error => {
// 如果任何一个请求失败,将会进入这个 catch 块
@@ -434,6 +453,7 @@ export default {
init(id, isdetail) {
this.initData()
this.getDict()
+ this.ingredientList = []
this.isdetail = isdetail || false;
this.dataForm.id = id || undefined;
this.visible = true;
@@ -445,7 +465,6 @@ export default {
this.$nextTick(() => {
this.$refs['dataForm'].resetFields();
-
if (this.dataForm.id) {
// 获取产品详情
let valueList = []
@@ -459,6 +478,7 @@ export default {
valueList = arr.map((ele) => {
// console.log(ele)
return {
+ checkDetId:ele.id,
maxValue: ele.maxValue,
minValue: ele.minValue
}
@@ -472,8 +492,8 @@ export default {
id: ele.id,
checkDetId: ele.id,
checkValue: ele.checkValue,
- // isStandard: true,
- // showIcon: false,
+ maxValue:null,
+ minValue: null
}
})
console.log(this.ingredientList);
@@ -487,9 +507,15 @@ export default {
showIcon: false,
}
})
+ valueList.forEach((ele, index) => {
+ if (this.ingredientList[index].checkDetId >= ele.checkDetId) {
+ this.ingredientList[index].minValue = ele.minValue
+ this.ingredientList[index].maxValue = ele.maxValue
+ }
+ })
valueList.forEach((ele,index) => {
console.log(ele);
- if (this.dataForm.checkValueList[index].checkValue >= ele.minValue && this.dataForm.checkValueList[index].checkValue <= ele.maxValue) {
+ if (this.dataForm.checkValueList[index].checkDetId >= ele.checkDetId && this.dataForm.checkValueList[index].checkValue >= ele.minValue && this.dataForm.checkValueList[index].checkValue <= ele.maxValue) {
this.dataForm.checkValueList[index].showIcon = true
this.dataForm.checkValueList[index].isStandard = true
} else {
@@ -512,7 +538,8 @@ export default {
},
goback() {
this.$emit('refreshDataList');
- this.visible = false;
+ this.visible = false
+ this.ingredientList = []
// this.initData();
},
goEdit() {