diff --git a/src/utils/request.js b/src/utils/request.js index 38aeec07..c4edcdbc 100644 --- a/src/utils/request.js +++ b/src/utils/request.js @@ -19,7 +19,7 @@ const service = axios.create({ // baseURL: `http://192.168.1.149:8411/submit/MESCommonBase.ashx`, // baseURL: `http://localhost:8411/submit/MESCommonBase.ashx`, // baseURL: `http://localhost:8411/submit/MESCommonBase.ashx`, - baseURL: `http://localhost:8411/submit/MESCommonBase.ashx`, + baseURL: `http://192.168.1.231:8411/submit/MESCommonBase.ashx`, // baseURL: `http://localhost:8077/submit/MESCommonBase.ashx`, // baseURL: `http://192.168.0.112:8411/submit/MESCommonBase.ashx`, timeout: 1500000 // 请求超时时间 diff --git a/src/views/ManufacturingCenter/GroupMatching/index.vue b/src/views/ManufacturingCenter/GroupMatching/index.vue index 74a0d86e..a8d981ee 100644 --- a/src/views/ManufacturingCenter/GroupMatching/index.vue +++ b/src/views/ManufacturingCenter/GroupMatching/index.vue @@ -53,7 +53,7 @@ :data="tableData" :summary-method="getSummaries" style="width: 100%;max-height: 600px" - height="300" + height="400" show-summary highlight-current-row border> @@ -116,7 +116,7 @@ :data="tableDataPurchase" border style="width: 100%;" - height="300"> + height="400"> + height="400"> { for (let i = 0; i < response.data.rows.length; i++) { - if (response.data.rows[i].入库时间 !== null) { + if (response.data.rows[i].入库时间 !== '') { + this.totalNum += 1 response.data.rows[i].入库时间 = response.data.rows[i].入库时间.split(' ', 2)[0] } - if (response.data.rows[i].计划完成时间 !== null) { + if (response.data.rows[i].计划完成时间 !== '') { response.data.rows[i].计划完成时间 = response.data.rows[i].计划完成时间.split(' ', 2)[0] } } @@ -624,6 +628,7 @@ export default { this.dialogFormVisible3 = false }, handleSizeChange(val) { + this.totalNum = 0 this.pageCurrent = 1 this.pageSize = val if (this.entryNameValue !== null && this.entryNameValue !== '') { @@ -659,10 +664,11 @@ export default { } searchTable(this.check, this.entryNameValue, this.check1, this.machine, this.check2, this.groupNum, this.check3, this.year, this.check4, this.month, this.check5, this.time, this.pageCurrent, this.pageSize).then(response => { for (let i = 0; i < response.data.rows.length; i++) { - if (response.data.rows[i].入库时间 !== null) { + if (response.data.rows[i].入库时间 !== '') { + this.totalNum += 1 response.data.rows[i].入库时间 = response.data.rows[i].入库时间.split(' ', 2)[0] } - if (response.data.rows[i].计划完成时间 !== null) { + if (response.data.rows[i].计划完成时间 !== '') { response.data.rows[i].计划完成时间 = response.data.rows[i].计划完成时间.split(' ', 2)[0] } } @@ -676,6 +682,7 @@ export default { } }, handleCurrentChange(val) { + this.totalNum = 0 this.pageCurrent = val if (this.entryNameValue !== null && this.entryNameValue !== '') { if (this.entryNameValue !== null && this.entryNameValue !== '') { @@ -710,10 +717,11 @@ export default { } searchTable(this.check, this.entryNameValue, this.check1, this.machine, this.check2, this.groupNum, this.check3, this.year, this.check4, this.month, this.check5, this.time, this.pageCurrent, this.pageSize).then(response => { for (let i = 0; i < response.data.rows.length; i++) { - if (response.data.rows[i].入库时间 !== null) { + if (response.data.rows[i].入库时间 !== '') { + this.totalNum += 1 response.data.rows[i].入库时间 = response.data.rows[i].入库时间.split(' ', 2)[0] } - if (response.data.rows[i].计划完成时间 !== null) { + if (response.data.rows[i].计划完成时间 !== '') { response.data.rows[i].计划完成时间 = response.data.rows[i].计划完成时间.split(' ', 2)[0] } } @@ -921,6 +929,39 @@ export default { this.loading = false this.$message.warning('请先选择项目') } + }, + getSummaries(param) { + const { columns } = param + const sums = [] + columns.forEach((column, index) => { + if (index === 4) { + sums[index] = '总件数' + return + } else if (index === 5) { + sums[index] = this.total + '件' + } else if (index === 6) { + sums[index] = '入库数量' + } else if (index === 7) { + sums[index] = this.totalNum + ' 件' + // const values = data.map(item => item['入库时间']) + // console.log(values) + // if (!values.every(value => value !== '')) { + // sums[index] = values.reduce((prev, curr) => { + // const value = curr + // console.log(value) + // if (value !== '') { + // return this.totalNum1 + 1 + // } else { + // return this.totalNum1 + // } + // }, '') + // sums[index] += '件' + // } else { + // sums[index] = 'N/A' + // } + } + }) + return sums } } } diff --git a/src/views/TechnologyCenter/ImportParts/specificationData.vue b/src/views/TechnologyCenter/ImportParts/specificationData.vue index 7fd8a925..42fd6277 100644 --- a/src/views/TechnologyCenter/ImportParts/specificationData.vue +++ b/src/views/TechnologyCenter/ImportParts/specificationData.vue @@ -565,8 +565,9 @@ export default { } } if (this.err === 0) { // 传递成功后,清除该分组。当所有组都传递完成后,该项目下的机床和分组消失 - const index = this.groupsNames.indexOf(this.groupValue) - this.groupsNames.splice(index, 1) + console.log(this.groupsNames.indexOf(this.groupValue), 22222) + // const index = this.groupsNames.indexOf(this.groupValue) + // this.groupsNames.splice(index, 1) if (this.groupsNames.length === 0) { const groupIndex = this.machineNames.indexOf(this.machineValue) this.machineNames.splice(groupIndex, 1)