修改bug

This commit is contained in:
‘937886381’ 2023-06-30 17:03:47 +08:00
parent ae1a9c1883
commit 3c93b8045a
17 changed files with 420 additions and 254 deletions

70
package-lock.json generated
View File

@ -3201,6 +3201,7 @@
"thread-loader": "^2.1.3",
"url-loader": "^2.2.0",
"vue-loader": "^15.9.2",
"vue-loader-v16": "npm:vue-loader@^16.1.0",
"vue-style-loader": "^4.1.2",
"webpack": "^4.0.0",
"webpack-bundle-analyzer": "^3.8.0",
@ -16945,6 +16946,75 @@
}
}
},
"vue-loader-v16": {
"version": "npm:vue-loader@16.8.3",
"resolved": "https://registry.npmmirror.com/vue-loader/-/vue-loader-16.8.3.tgz",
"integrity": "sha512-7vKN45IxsKxe5GcVCbc2qFU5aWzyiLrYJyUuMz4BQLKctCj/fmCa0w6fGiiQ2cLFetNcek1ppGJQDCup0c1hpA==",
"dev": true,
"optional": true,
"requires": {
"chalk": "^4.1.0",
"hash-sum": "^2.0.0",
"loader-utils": "^2.0.0"
},
"dependencies": {
"ansi-styles": {
"version": "4.3.0",
"resolved": "https://registry.npmmirror.com/ansi-styles/-/ansi-styles-4.3.0.tgz",
"integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
"dev": true,
"optional": true,
"requires": {
"color-convert": "^2.0.1"
}
},
"chalk": {
"version": "4.1.2",
"resolved": "https://registry.npmmirror.com/chalk/-/chalk-4.1.2.tgz",
"integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==",
"dev": true,
"optional": true,
"requires": {
"ansi-styles": "^4.1.0",
"supports-color": "^7.1.0"
}
},
"color-convert": {
"version": "2.0.1",
"resolved": "https://registry.npmmirror.com/color-convert/-/color-convert-2.0.1.tgz",
"integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
"dev": true,
"optional": true,
"requires": {
"color-name": "~1.1.4"
}
},
"color-name": {
"version": "1.1.4",
"resolved": "https://registry.npmmirror.com/color-name/-/color-name-1.1.4.tgz",
"integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==",
"dev": true,
"optional": true
},
"has-flag": {
"version": "4.0.0",
"resolved": "https://registry.npmmirror.com/has-flag/-/has-flag-4.0.0.tgz",
"integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==",
"dev": true,
"optional": true
},
"supports-color": {
"version": "7.2.0",
"resolved": "https://registry.npmmirror.com/supports-color/-/supports-color-7.2.0.tgz",
"integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==",
"dev": true,
"optional": true,
"requires": {
"has-flag": "^4.0.0"
}
}
}
},
"vue-router": {
"version": "3.0.7",
"resolved": "https://registry.npmmirror.com/vue-router/-/vue-router-3.0.7.tgz",

View File

@ -646,57 +646,9 @@ t.code.uploaded = '已上传'
t.code.notUploaded = '未上传'
t.code.Examiner = '检验人'
t.dictionary = {}
t.dictionary.name = ' 名称'
t.dictionary.code = ' 编码'
export default t

View File

@ -1,7 +1,7 @@
<!--
* @Author: zhp
* @Date: 2023-02-14 15:02:26
* @LastEditTime: 2023-06-26 09:44:09
* @LastEditTime: 2023-06-30 16:58:55
* @LastEditors: zhp
* @Description:
-->
@ -20,7 +20,7 @@
<el-switch v-model="dataForm.incomingInspection" :active-value="1" :inactive-value="0">
</el-switch>
</el-form-item>
<el-form-item prop="finishInspection" :label="$t('basic.stock')">
<el-form-item prop="finishInspection" :label="$t('basic.finishedProduct')">
<el-switch v-model="dataForm.finishInspection" :active-value="1" :inactive-value="0">
</el-switch>
</el-form-item>
@ -32,8 +32,8 @@
<el-switch v-model="dataForm.processInspection" :active-value="1" :inactive-value="0">
</el-switch>
</el-form-item>
<el-form-item prop="customerTypeStatus" :label="$t('basic.status')">
<el-select v-model="dataForm.customerTypeStatus" :placeholder="$t('basic.status')">
<el-form-item prop="controlStatus" :label="$t('basic.status')">
<el-select v-model="dataForm.controlStatus" :placeholder="$t('basic.status')">
<el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value">
</el-option>
</el-select>
@ -49,8 +49,8 @@ export default {
data() {
return {
urlOptions: {
submitURL: "/basic/qmsCustomerType",
infoURL: "/basic/qmsCustomerType/{id}",
submitURL: "/basic/qmsControlMode",
infoURL: "/basic/qmsControlMode/{id}",
getCodeURL: '/basic/qmsControlMode/getCode'
},
options: [{
@ -66,7 +66,7 @@ export default {
id: "",
controlCode:null,
controlName:null,
customerTypeStatus: null,
controlStatus: null,
finishInspection: null,
incomingInspection: null,
outInspection: null,
@ -106,13 +106,14 @@ export default {
methods: {
init(id, ) {
this.dataForm.id = id || ""
this.getControlCode()
// this.dataForm.dictTypeId = dictTypeId || "";
this.visible = true
this.$nextTick(() => {
this.$refs["dataForm"].resetFields();
if (this.dataForm.id) {
this.getInfo();
} else {
this.getControlCode()
}
});
},

View File

@ -2,7 +2,7 @@
* @Author: zwq
* @Date: 2023-01-04 10:29:40
* @LastEditors: zhp
* @LastEditTime: 2023-02-20 08:52:46
* @LastEditTime: 2023-06-29 16:59:18
* @Description:
-->
<template>
@ -126,7 +126,7 @@ export default {
})
},
handleConditionSearch() {
this.$emit("successSubmit", this.dataForm.key);
this.$emit("successSubmit", this.dataForm);
},
// dataFormSubmitHandle: debounce(
// function () {

View File

@ -1,7 +1,7 @@
<!--
* @Author: zhp
* @Date: 2023-01-31 09:49:36
* @LastEditTime: 2023-05-17 15:00:50
* @LastEditTime: 2023-06-30 16:54:37
* @LastEditors: zhp
* @Description:
-->
@ -22,6 +22,7 @@ export default {
},
data() {
return {
// injectData:{},
urlOptions: {
syncURL: "/basic/qmsProduct/connectAllProduct"
},
@ -30,21 +31,23 @@ export default {
methods: {
//
emitClick() {
console.log(this.injectData)
const data = {
id: this.injectData.id,
finishInspection: this.injectData.finishInspection,
incomingInspection: this.injectData.incomingInspection,
outInspection: this.injectData.outInspection,
processInspection: this.injectData.outInspection
processInspection: this.injectData.processInspection
}
this.$http.put(this.urlOptions.syncURL, { data }).then(({ data }) => {
this.$http.put(this.urlOptions.syncURL, data ).then(({ data }) => {
if (data && data.code === 0) {
this.$message({
message: "操作成功",
type: "success",
duration: 1500,
onClose: () => {
this.$message.error(data.msg);
this.$message.error(data.msg)
// this.$parent.$parent.$parent.$parent.getDataList()
},
});
} else {

View File

@ -1,7 +1,7 @@
<!--
* @Author: zhp
* @Date: 2023-02-14 15:02:26
* @LastEditTime: 2023-04-04 15:35:31
* @LastEditTime: 2023-06-30 08:57:14
* @LastEditors: zhp
* @Description:
-->
@ -42,8 +42,8 @@ export default {
data() {
return {
urlOptions: {
submitURL: "/basic/qmsProductType",
infoURL: "/basic/qmsProductType/{id}",
submitURL: "/basic/qmsProduct",
infoURL: "/basic/qmsProduct/{id}",
getCodeURL: '/basic/qmsProduct/getCode',
getTypeListURL: '/basic/qmsProductType/page'
},
@ -111,7 +111,7 @@ export default {
.then(({ data: res }) => {
if (res.code === 0) {
console.log(res);
this.dataForm.productTypeCode = res.data
this.dataForm.productCode = res.data
}
})
.catch(() => {
@ -130,7 +130,7 @@ export default {
//
getInfo() {
this.$http
.get(`/basic/qmsProductType/${this.dataForm.id}`)
.get(`/basic/qmsProduct/${this.dataForm.id}`)
.then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg);

View File

@ -1,16 +1,16 @@
<!--
* @Author: zhp
* @Date: 2023-01-31 14:12:10
* @LastEditTime: 2023-01-31 16:47:32
* @LastEditTime: 2023-06-30 17:00:43
* @LastEditors: zhp
* @Description:
-->
<template>
<span>
<el-radio v-model="injectData.incomingInspection" :label="1">{{ $t('basic.stock') }}</el-radio>
<el-radio v-model="injectData.processInspection" :label="1">{{ $t('basic.course') }}</el-radio>
<el-radio v-model="injectData.finishInspection" :label="1">{{ $t('basic.finishedProduct') }}</el-radio>
<el-radio v-model="injectData.outInspection" :label="1">{{ $t('basic.shipment') }}</el-radio>
<el-radio v-model="injectData.processInspection" :label="1">{{ $t('basic.course') }}</el-radio>
</span>
</template>

View File

@ -2,7 +2,7 @@
* @Author: zwq
* @Date: 2023-01-04 10:29:40
* @LastEditors: zhp
* @LastEditTime: 2023-02-14 14:12:11
* @LastEditTime: 2023-06-30 16:39:46
* @Description:
-->
<template>
@ -122,7 +122,7 @@ export default {
},
methods: {
init(data) {
console.log();
console.log(data)
// this.dataForm.id = id || "";
this.productData = data? data: {}
this.visible = true;
@ -130,23 +130,28 @@ export default {
this.listQuery.controllerModeId = data ? data.id : null;
// this.$refs["dataForm"].resetFields();
// if (this.dataForm.id) {
this.getDataList();
this.getDataList()
// }
});
},
handleClick() {
handleClick(val) {
console.log(val)
if (val.type === "synchronous") {
if (!this.listQuery.controllerModeId) {
console.log(val)
console.log(this.listQuery.controllerModeId)
if (!this.listQuery.controllerModeId === null) {
this.$message({
message: '请先选择控制模式',
type: 'warning'
});
} else {
const data={
controlCodeId: this.listQuery.controlCodeId,
const data = {
id:val.data.id,
controlCodeId: this.listQuery.controllerModeId,
finishInspection: this.productData.finishInspection,
incomingInspection: this.productData.finishInspection,
processInspection: this.productData.processInspection
incomingInspection: this.productData.incomingInspection,
processInspection: this.productData.processInspection,
outInspection: this.productData.outInspection
}
this.$http['put']('/basic/qmsProduct',data).then(({ data: res }) => {
if (res.code !== 0) {
@ -157,8 +162,9 @@ export default {
type: 'success',
duration: 500,
onClose: () => {
this.visible = false
this.$emit('refreshDataList')
this.$nextTick(() => {
this.getDataList()
})
}
})
}).catch(() => { })
@ -170,10 +176,12 @@ export default {
// });
} else if (val.type === 'cancel') {
const data = {
controlCodeId: null,
finishInspection: null,
incomingInspection: null,
processInspection: null
id: val.data.id,
controlCodeId: 0,
finishInspection: 0,
incomingInspection: 0,
processInspection: 0,
outInspection:0
}
this.$http['put']('/basic/qmsProduct', data).then(({ data: res }) => {
if (res.code !== 0) {
@ -184,8 +192,10 @@ export default {
type: 'success',
duration: 500,
onClose: () => {
this.visible = false
this.$emit('refreshDataList')
this.$nextTick(() => {
this.getDataList()
})
// this.$emit('refreshDataList')
}
})
}).catch(() => { })

View File

@ -1,7 +1,7 @@
<!--
* @Author: zhp
* @Date: 2023-02-14 15:02:26
* @LastEditTime: 2023-06-26 15:01:44
* @LastEditTime: 2023-06-30 09:58:35
* @LastEditors: zhp
* @Description:
-->
@ -33,9 +33,6 @@ export default {
chooseData: [],
urlOptions: {
submitURL: "/basic/qmsCustomer",
getCustomerPageListURL: "/basic/qmsCustomerType/page",
infoURL: "/basic/qmsCustomer/{id}",
getCodeURL: '/basic/qmsCustomer/getCode',
getTeamMemberURL: '/basic/qmsTeamMember/page',
getUserListURL: '/sys/user/page',
editTeamMemberListURL: '/basic/qmsTeamMember'
@ -84,10 +81,40 @@ export default {
};
},
},
destroyed() {
this.notChooseData = []
this.chooseData = []
},
methods: {
init(id,) {
this.teamId = id || ""
this.notChooseData = []
this.chooseData = []
// this.dataForm.dictTypeId = dictTypeId || "";
// this.$http
// .get(this.urlOptions.getTeamMemberURL, {
// params: {
// teamId: id
// }
// })
// .then(({ data: res }) => {
// console.log(res)
// this.dataListLoading = false;
// if (res.code === 0) {
// var data = res.data.memberDTOS
// for (let i = 0; i < data.length; i++) {
// this.chooseData.push(data[i].userId)
// }
// this.notChooseData = res.data.undefinedUserDTOS.map((item) => {
// return {
// key: item.id,
// label: item.userName
// }
// })
// console.log(this.chooseData)
// console.log(this.notChooseData)
// }
// })
this.$http
.get(this.urlOptions.getTeamMemberURL, {
params: {
@ -179,6 +206,8 @@ export default {
duration: 500,
onClose: () => {
this.visible = false
this.notChooseData = []
this.chooseData = []
this.$emit("refreshDataList")
},
});

View File

@ -21,12 +21,12 @@
</base-dialog>
<base-dialog :dialogTitle="addOrEditTitle" :dialogVisible="addOrUpdateVisible" @cancel="handleCancel"
@confirm="handleConfirm" :before-close="handleCancel">
<control-add ref="addOrUpdate" @successSubmit="successSubmit"></control-add>
<control-add ref="addOrUpdate" @refreshDataList="successSubmit"></control-add>
<!-- <el-row slot="footer" type="flex" justify="end"> </el-row> -->
</base-dialog>
<base-dialog :dialogTitle="searchOrEditTitle" :dialogVisible="searchOrUpdateVisible" @cancel="handleSearchCancel"
@confirm="handleSearchConfirm" :before-close="handleSearchCancel">
<control-search ref="searchOrUpdate" @refreshDataList="conditionSearchSubmit"></control-search>
<control-search ref="searchOrUpdate" @successSubmit="conditionSearchSubmit"></control-search>
<el-row slot="footer" type="flex" justify="end">
<el-col :span="12">
<el-button size="small" type="primary" plain class="btnTextStyle" @click="handleSearchCancel">
@ -189,12 +189,10 @@ export default {
// },
// conditionSearchSubmit() {},
conditionSearchSubmit(key) {
// console.log(key);
console.log(key);
this.listQuery.key = key;
this.listQuery.page = 1;
this.getDataList(key);
this.searchOrUpdateVisible = false;
this.listQuery.key = key
this.listQuery.page = 1
this.getDataList(key)
this.searchOrUpdateVisible = false
// console.log(11111);
// this.conditionSearchSubmit();
},
@ -247,14 +245,14 @@ export default {
this.getDataList();
break;
case "correlation":
this.productOrEditTitle = "产品";
this.productOrUpdateVisible = true;
this.productOrEditTitle = "产品"
this.productOrUpdateVisible = true
// this.searchOrUpdateHandle(this.productData);
// this.searchOrUpdateVisible = true;
this.$nextTick(() => {
this.$refs.productOrUpdate.init(this.productData);
this.$refs.productOrUpdate.init(this.productData)
});
console.log(this.productId);
// console.log(this.productId);
break;
case "add":
this.addOrEditTitle = '新增'

View File

@ -83,7 +83,7 @@ export default {
return {
urlOptions: {
getDataListURL: "/basic/qmsCustomer/page",
deleteURL: "/basic/qmsCustomerType",
deleteURL: "/basic/qmsCustomer",
exportURL: '/basic/qmsCustomer/export'
},
tableProps,
@ -166,7 +166,7 @@ export default {
// console.log(11111);
// this.conditionSearchSubmit();
},
handleClick() {
handleClick(val) {
console.log(val);
if (val.type === "delete") {
this.$confirm(`确定对[名称=${val.data.customerName}]进行删除操作?`, "提示", {

View File

@ -21,7 +21,7 @@
</base-dialog>
<base-dialog :dialogTitle="searchOrEditTitle" :dialogVisible="searchOrUpdateVisible" @cancel="handleSearchCancel"
@confirm="handleSearchConfirm" :before-close="handleSearchCancel">
<customerType-search ref="searchOrUpdate" @refreshDataList="conditionSearchSubmit"></customerType-search>
<customerType-search ref="searchOrUpdate" @successSubmit="conditionSearchSubmit"></customerType-search>
<el-row slot="footer" type="flex" justify="end">
<el-col :span="12">
<el-button size="small" type="primary" plain class="btnTextStyle" @click="handleSearchCancel">

View File

@ -1,7 +1,7 @@
<!--
* @Author: zhp
* @Date: 2023-01-11 09:24:58
* @LastEditTime: 2023-06-20 15:37:39
* @LastEditTime: 2023-06-29 17:02:33
* @LastEditors: zhp
* @Description:
-->
@ -27,7 +27,7 @@
</base-dialog>
<base-dialog :dialogTitle="searchOrEditTitle" :dialogVisible="searchOrUpdateVisible" @cancel="handleSearchCancel"
@confirm="handleSearchConfirm" :before-close="handleSearchCancel">
<failureType-search ref="searchOrUpdate" @refreshDataList="conditionSearchSubmit"></failureType-search>
<failureType-search ref="searchOrUpdate" @successSubmit="conditionSearchSubmit"></failureType-search>
<el-row slot="footer" type="flex" justify="end">
<el-col :span="12">
<el-button size="small" type="primary" plain class="btnTextStyle" @click="handleSearchCancel">

View File

@ -158,7 +158,7 @@ export default {
this.searchOrEditTitle = "搜索";
this.searchOrUpdateVisible = true;
this.$nextTick(() => {
this.$refs.searchOrUpdate.init();
this.$refs.searchOrUpdate.init()
});
},
// handleConfirm() {
@ -171,7 +171,7 @@ export default {
this.listQuery.productName = dataForm.productName
this.listQuery.productCode = dataForm.productCode
this.listQuery.page = 1;
this.getDataList();
this.getDataList()
this.searchOrUpdateVisible = false;
// console.log(11111);
// this.conditionSearchSubmit();
@ -219,7 +219,8 @@ export default {
switch (val.btnName) {
case "search":
// this.listQuery.paramCode = val.paramCode;
this.listQuery.key = null;
this.listQuery.productName = null
this.listQuery.productCode = null
// console.log(i18n);
this.listQuery.page = 1;
this.getDataList();

View File

@ -1,7 +1,7 @@
<!--
* @Author: zhp
* @Date: 2023-02-14 15:02:26
* @LastEditTime: 2023-06-28 14:15:42
* @LastEditTime: 2023-06-29 16:36:33
* @LastEditors: zhp
* @Description:
-->
@ -126,13 +126,96 @@
</el-col>
</el-row>
<el-button @click="getTableData()" type="primary">{{ $t('gage.tabularComputations') }}</el-button>
<base-table :table-props="tableProps" :table-data="tableData" :page="1" :limit="20" />
<base-table :table-props="tableProps" :table-data="tableData" />
</el-form>
</template>
<script>
import debounce from "lodash/debounce";
import basicAdd from "@/mixins/basic-add";
import available from "./available";
// const tableProps = [
// {
// prop: 'equipmentName',
// label: ''
// },
// // {
// // prop: 'lineA',
// // label: '(h)',
// // children: [
// // {
// // prop: 'workTime',
// // label: ''
// // },
// // {
// // prop: 'workTimeRate',
// // label: ''
// // }
// // ]
// // },
// // {
// // prop: 'lineB',
// // label: '(h)',
// // children: [
// // {
// // prop: 'downTime',
// // label: ''
// // },
// // {
// // prop: 'downTimeRate',
// // label: ''
// // }
// // ]
// // },
// // {
// // prop: 'lineC',
// // label: '',
// // children: [
// // {
// // prop: 'faultTime',
// // label: ''
// // },
// // {
// // prop: 'faultTimeRate',
// // label: ''
// // }
// // ]
// // },
// // {
// // prop: 'lineD',
// // label: '',
// // children: [
// // {
// // prop: 'actualProcessingSpeed',
// // label: ''
// // },
// // {
// // prop: 'theoreticalProcessingSpeed',
// // label: ''
// // },
// // {
// // prop: 'speedActuationRate',
// // label: ''
// // }
// // ]
// // }
// ]
const tableProps = [
{
prop: 'testUserName',
label: '人员'
},
{
prop: 'orderNumber',
label: '序号'
},
{
prop: 'test',
label: '零件',
children: [
]
}
]
export default {
mixins: [basicAdd],
data() {
@ -147,10 +230,11 @@ export default {
getCustomerListURL: '/basic/qmsCustomer/page',
getTabularComputationsURL: '/gage/qmsGageGrrTester/table'
},
trueTableProps: [],
gageList: [],
userList: [],
tableProps,
customerList: [],
tableProps: [],
tableData:[],
gageTypeList:[],
departmentList: [],
@ -217,6 +301,8 @@ export default {
}
],
visible: false,
// tableProp2,
chartDataArr: [],
dataForm: {
connection:null,
corporation: null,
@ -271,6 +357,10 @@ export default {
mounted () {
this.getData();
},
destroyed () {
this.tableData = []
this.tableProps = []
},
methods: {
getTableData() {
this.$http.get(this.urlOptions.getTabularComputationsURL, {
@ -278,119 +368,131 @@ export default {
gageGrrId:this.dataForm.id
},
})
.then(({ data: res }) => {
if (res.code === 0) {
console.log(res)
.then(({ data: result }) => {
if (result.code === 0) {
console.log(result)
let arr = []
// let aa = []
// let moreData = [
// // {
// // testUserName: null,
// // data: [
// // {
// // orderNumber: result.data.qmsGageGrrTesterDTOList[i].list[j].orderNumber,
// // data: aa
// // },
// // {
// // equipmentName: '',
// // data: aa
// // },
// // {
// // equipmentName: '',
// // data: aa
// // },
// // {
// // equipmentName: '',
// // data: aa
// // }
// // ]
// // },
// ]
for (let i = 0; i < result.data.qmsGageGrrTesterDTOList.length; i++){
// console.log(result.data.qmsGageGrrTesterDTOList[i].orderMapList)
Object.keys(result.data.qmsGageGrrTesterDTOList[i].partMapList).forEach((item) => {
this.tableProps[2].children.push({
label: String(item),
prop: 'measuredData'+String(item),
})
})
Object.keys(result.data.qmsGageGrrTesterDTOList[i].orderMapList).forEach((item) => {
let measuredData = 'measuredData' + String(item)
this.tableData.push({
testUserName: result.data.qmsGageGrrTesterDTOList[i].testUserName,
orderNumber: item,
[measuredData]: '',
})
result.data.qmsGageGrrTesterDTOList[i].orderMapList[item].forEach((ele, index, arr) => {
// console.log(arr)
// console.log(ele)
// console.log(this.tableProps[2].children.prop);
// console.log(this.tableProps[2].children[item - 1].prop)
console.log(ele)
let measuredData = 'measuredData' + item
console.log(measuredData)
console.log(this.tableData[item - 1])
this.tableData[item - 1][measuredData] = ele
// console.log(this.tableData[item - 1])
})
})
}
console.log(this.tableProps)
console.log(this.tableData)
// console.log(this.table)
// console.log(moreData,'1111')
// for (let i = 0; i < 30; i++) {
// let a = {
// time: '2022-11-' + i,
// eqCT: 0.01,
// eqTT: 0.62,
// lineCT: 0.73,
// lineTT: 0.45
// }
// aa.push(a)
// }
// this.numArr = []
// let num = 0
// const tableConfig = []
// this.chartDataArr = []
// const dataArr = moreData.map((item, index) => {
// let dataArr = []
// if (item.data) {
// this.chartDataArr = this.chartDataArr.concat(item.data)
// num += item.data.length
// this.numArr.push(num)
// dataArr = item.data.map((z, idx) => {
// const dataArr = {}
// z.data.forEach((i) => {
// // tableConfig
// if (index === 0 && idx === 0) {
// tableConfig.push({
// label: i.time,
// prop: i.time,
// children: [
// { prop: i.time + 'eqCT', label: 'CT', subcomponent: available },
// { prop: i.time + 'eqTT', label: 'TT' },
// { prop: i.time + 'lineCT', label: '线CT' },
// {
// prop: i.time + 'lineTT',
// label: '线TT',
// // subcomponent: demo3Sub
// }
// ]
// })
// }
// //
// dataArr[i.time + 'eqCT'] = i.eqCT
// dataArr[i.time + 'eqTT'] = i.eqTT
// dataArr[i.time + 'lineCT'] = i.lineCT
// dataArr[i.time + 'lineTT'] = i.lineTT
// dataArr.testUserName = item.testUserName
// dataArr.orderNumber = z.orderNumber
// })
// console.log(dataArr)
// return dataArr
// })
// }
// return dataArr
// })
// console.log(tableConfig)
// this.trueTableProps = this.tableProp2.concat(tableConfig)
// console.log(this.trueTableProps,'22112112')
// this.tableData = this.flatten(dataArr)
// console.log(this.tableData)
}
})
.catch(() => {
})
let aa = []
let moreData = [
{
process: '综合',
data: [
{
equipmentName: '上片投入数量',
data: aa
},
{
equipmentName: '机器人投入数',
data: aa
},
{
equipmentName: '良品总投入数',
data: aa
},
{
equipmentName: '工序损耗',
data: aa
}
]
},
{
process: '上片',
data: [
{
equipmentName: '上片损失',
data: aa
}
]
},
{
process: '精切',
data: [
{
equipmentName: '精切损失',
data: aa
},
{
equipmentName: '精切抽检',
data: aa
}
]
}
]
for (let i = 0; i < 30; i++) {
let a = {
time: '2022-11-' + i,
eqCT: 0.01,
eqTT: 0.62,
lineCT: 0.73,
lineTT: 0.45
}
aa.push(a)
}
this.numArr = []
let num = 0
const tableConfig = []
this.chartDataArr = []
const dataArr = moreData.map((item, index) => {
let dataArr = []
if (item.data) {
this.chartDataArr = this.chartDataArr.concat(item.data)
num += item.data.length
this.numArr.push(num)
dataArr = item.data.map((z, idx) => {
const dataArr = {}
z.data.forEach((i) => {
// tableConfig
if (index === 0 && idx === 0) {
tableConfig.push({
label: i.time,
prop: i.time,
children: [
{ prop: i.time + 'eqCT', label: '设备CT' },
{ prop: i.time + 'eqTT', label: '设备TT' },
{ prop: i.time + 'lineCT', label: '产线CT' },
{
prop: i.time + 'lineTT',
label: '产线TT',
subcomponent: demo3Sub
}
]
})
}
//
dataArr[i.time + 'eqCT'] = i.eqCT
dataArr[i.time + 'eqTT'] = i.eqTT
dataArr[i.time + 'lineCT'] = i.lineCT
dataArr[i.time + 'lineTT'] = i.lineTT
dataArr.process = item.process
dataArr.equipmentName = z.equipmentName
})
console.log(dataArr)
return dataArr
})
}
return dataArr
})
console.log(tableConfig)
this.trueTableProps = this.tableProp2.concat(tableConfig)
console.log(this.trueTableProps)
this.tableData = this.flatten(dataArr)
console.log(this.tableData)
},
// tree->[]
flatten(arr) {

View File

@ -1,7 +1,7 @@
<!--
* @Author: zhp
* @Date: 2023-02-14 15:02:26
* @LastEditTime: 2023-06-27 15:38:27
* @LastEditTime: 2023-06-28 14:27:59
* @LastEditors: zhp
* @Description:
-->
@ -216,3 +216,34 @@ export default {
},
};
</script>
<style scoped>
td{
width: 400px;
}
table {
border-collapse: collapse;
margin: 0 auto;
text-align: center;
}
table td,
table th {
border: 1px solid #cad9ea;
color: #666;
height: 30px;
}
table thead th {
background-color: #CCE8EB;
width: 100px;
}
table tr:nth-child(odd) {
background: #fff;
}
table tr:nth-child(even) {
background: #F5FAFA;
}
</style>

View File

@ -1,7 +1,7 @@
<!--
* @Author: zhp
* @Date: 2023-01-11 09:24:58
* @LastEditTime: 2023-06-27 14:51:34
* @LastEditTime: 2023-06-28 14:27:57
* @LastEditors: zhp
* @Description:
-->
@ -327,34 +327,3 @@ export default {
}
};
</script>
<style>
td{
width: 400px;
}
table {
border-collapse: collapse;
margin: 0 auto;
text-align: center;
}
table td,
table th {
border: 1px solid #cad9ea;
color: #666;
height: 30px;
}
table thead th {
background-color: #CCE8EB;
width: 100px;
}
table tr:nth-child(odd) {
background: #fff;
}
table tr:nth-child(even) {
background: #F5FAFA;
}
</style>