diff --git a/src/api/Assembly/QualityInspectionInformationInquiry.js b/src/api/Assembly/QualityInspectionInformationInquiry.js
index 615372cc..70849d00 100644
--- a/src/api/Assembly/QualityInspectionInformationInquiry.js
+++ b/src/api/Assembly/QualityInspectionInformationInquiry.js
@@ -35,14 +35,15 @@ export function searchgroup(num) {
})
}
// 组件查询
-export function selecttable(check1, value1, check2, value2, check3, value3, check4, value4) {
+export function selecttable(check1, value1, check2, value2, check3, value3, check4, value4, pageCurrent, pageSize) {
return request({
url: '',
method: 'post',
data: {
type: '1',
name: '质量管理_质量情况_查询数据',
- param: '机床流水号_check=' + check1 + '&机床流水号=' + value1 + '&组件流水号_check=' + check2 + '&组件流水号=' + value2 + '&零件名称_check=' + check3 + '&零件名称=' + value3 + '&质检类型代码_check=' + check4 + '&质检类型代码=' + value4
+ param: '机床流水号_check=' + check1 + '&机床流水号=' + value1 + '&组件流水号_check=' + check2 + '&组件流水号=' + value2 + '&零件名称_check=' + check3 + '&零件名称=' + value3 + '&质检类型代码_check=' + check4 + '&质检类型代码=' + value4,
+ Pagination: pageCurrent + '&' + pageSize
}
})
}
diff --git a/src/api/Assembly/SparePartsOutStockRecord.js b/src/api/Assembly/SparePartsOutStockRecord.js
index 2cfefe58..09a480be 100644
--- a/src/api/Assembly/SparePartsOutStockRecord.js
+++ b/src/api/Assembly/SparePartsOutStockRecord.js
@@ -24,14 +24,15 @@ export function searchgroup(num) {
})
}
// 车间生产管理工艺_备料管理_备料出库记录_视图_查询数据
-export function selecttable(check1, value1, check2, value2, check3, value3, check4, value4, check5, value5) {
+export function selecttable(check1, value1, check2, value2, check3, value3, check4, value4, check5, value5, pageCurrent, pageSize) {
return request({
url: '',
method: 'post',
data: {
type: '1',
name: '车间生产管理工艺_备料管理_备料出库记录_视图_查询数据',
- param: '机床流水号_check=' + check1 + '&机床流水号=' + value1 + '&组件流水号_check=' + check2 + '&组件流水号=' + value2 + '&零件图号_check=' + check3 + '&零件图号=' + value3 + '&开始时间_check=' + check4 + '&开始时间=' + value4 + '&结束时间_check=' + check5 + '&结束时间=' + value5
+ param: '机床流水号_check=' + check1 + '&机床流水号=' + value1 + '&组件流水号_check=' + check2 + '&组件流水号=' + value2 + '&零件图号_check=' + check3 + '&零件图号=' + value3 + '&开始时间_check=' + check4 + '&开始时间=' + value4 + '&结束时间_check=' + check5 + '&结束时间=' + value5,
+ Pagination: pageCurrent + '&' + pageSize
}
})
}
diff --git a/src/api/Inventory/CreatePickingList.js b/src/api/Inventory/CreatePickingList.js
new file mode 100644
index 00000000..643fe665
--- /dev/null
+++ b/src/api/Inventory/CreatePickingList.js
@@ -0,0 +1,122 @@
+import request from '@/utils/request'
+
+// 初始化人员
+export function initPickPerson() {
+ return request({
+ url: '',
+ method: 'post',
+ data: {
+ type: '3',
+ name: 'select 姓名,人员编号 from 人事档案管理_人员名单 where 是否离职 = 0'
+ }
+ })
+}
+// 初始化机床项目
+export function initMachineProject() {
+ return request({
+ url: '',
+ method: 'post',
+ data: {
+ type: '1',
+ name: 'PDM_项目名称_查询数据'
+ }
+ })
+}
+// 组件查询
+export function searchgroup(num) {
+ return request({
+ url: '',
+ method: 'post',
+ data: {
+ type: '1',
+ name: 'PDM_组件名称_查询数据',
+ param: '机床流水号=' + num
+ }
+ })
+}
+// 查询三表
+export function searchTable(...params) {
+ return request({
+ url: '',
+ method: 'post',
+ data: {
+ type: '1',
+ name: '车间装配管理_领料单_三表_查询数据',
+ param: `机床流水号_check=${params[0]}&机床流水号=${params[1]}&组件流水号_check=${params[2]}&组件流水号=${params[3]}&零件类型=${params[6]}`,
+ Pagination: params[4] + '&' + params[5]
+ }
+ })
+}
+// 领料单查询
+export function searchList(pageCurrent, pageSize, listNumber_check, listNumber) {
+ return request({
+ url: '',
+ method: 'post',
+ data: {
+ type: '1',
+ name: '车间装配管理_领料单_查询数据',
+ param: '领料单编号_check=' + listNumber_check + '&领料单编号=' + listNumber,
+ Pagination: pageCurrent + '&' + pageSize
+ }
+ })
+}
+// 创建领料单
+export function createList(num, remark) {
+ return request({
+ url: '',
+ method: 'post',
+ data: {
+ type: '2',
+ name: '车间装配管理_领料单_增加数据',
+ param: '领料人流水号=' + num + '&领料单备注=' + remark
+ }
+ })
+}
+// 删除领料单
+export function dropList(num) {
+ return request({
+ url: '',
+ method: 'post',
+ data: {
+ type: '2',
+ name: '车间装配管理_领料单_删除数据',
+ param: '领料单流水号=' + num
+ }
+ })
+}
+// 选入领料单
+export function searchListDetail(...params) {
+ return request({
+ url: '',
+ method: 'post',
+ data: {
+ type: '1',
+ name: '车间装配管理_领料单明细_查询数据',
+ param: `领料单流水号=${params[0]}`
+ }
+ })
+}
+// 选入领料单
+export function selectIntoList(...params) {
+ return request({
+ url: '',
+ method: 'post',
+ data: {
+ type: '2',
+ name: '车间装配管理_领料单明细_增加数据',
+ param: `基本件流水号组=${params[0]}&标准件和外购件流水号组=${params[1]}&领料单流水号=${params[2]}`
+ }
+ })
+}
+// 删除领料单
+export function dropListDetail(num) {
+ return request({
+ url: '',
+ method: 'post',
+ data: {
+ type: '1',
+ name: '车间装配管理_领料单明细_删除数据',
+ param: '领料单明细流水号=' + num
+ }
+ })
+}
diff --git a/src/api/ManufacturingCenter/machiningHoursStatistics.js b/src/api/ManufacturingCenter/machiningHoursStatistics.js
index 444da7f9..ee02ffc3 100644
--- a/src/api/ManufacturingCenter/machiningHoursStatistics.js
+++ b/src/api/ManufacturingCenter/machiningHoursStatistics.js
@@ -13,6 +13,18 @@ export function searchtable(num1, num2, num3, num4, num5, pageCurrent, pageSize)
}
})
}
+// 查询人员总工工时
+export function searchtable11(num1, num2, num3, num4, num5) {
+ return request({
+ url: '',
+ method: 'post',
+ data: {
+ type: '1',
+ name: '车间生产管理工艺_工时统计_查询数据2',
+ param: '操作者_check=' + num1 + '&姓名=' + num2 + '&时间_check=' + num3 + '&开始时间=' + num4 + '&结束时间=' + num5
+ }
+ })
+}
// 查询人员具体工序
export function searchtable2(num1, num2, num3, num4, pageCurrent, pageSize) {
return request({
@@ -26,3 +38,76 @@ export function searchtable2(num1, num2, num3, num4, pageCurrent, pageSize) {
}
})
}
+// 查询人员具体工序
+export function searchtable22(num1, num2, num3, num4) {
+ return request({
+ url: '',
+ method: 'post',
+ data: {
+ type: '1',
+ name: '车间生产管理工艺_工时统计按人员查询_查询数据2',
+ param: '工作者编号=' + num1 + '&时间_check=' + num2 + '&开始时间=' + num3 + '&结束时间=' + num4
+ }
+ })
+}
+// 初始化机床项目
+export function initProject() {
+ return request({
+ url: '',
+ method: 'post',
+ data: {
+ type: '1',
+ name: 'PDM_项目名称_查询数据'
+ }
+ })
+}
+// 车间生产管理工艺_工时统计_机床查询_查询数据
+export function searchtable4(num1, num2, pageCurrent, pageSize) {
+ return request({
+ url: '',
+ method: 'post',
+ data: {
+ type: '1',
+ name: '车间生产管理工艺_工时统计_机床查询_查询数据',
+ param: '机床流水号_check=' + num1 + '&机床流水号=' + num2,
+ Pagination: pageCurrent + '&' + pageSize
+ }
+ })
+}
+// 车间生产管理工艺_工时统计_机床查询_查询数据
+export function searchtable44(num1, num2) {
+ return request({
+ url: '',
+ method: 'post',
+ data: {
+ type: '1',
+ name: '车间生产管理工艺_工时统计_机床查询_查询数据',
+ param: '机床流水号_check=' + num1 + '&机床流水号=' + num2
+ }
+ })
+}
+// 车间生产管理工艺_工时统计_组号查询_查询数据
+export function searchtable5(num1, pageCurrent, pageSize) {
+ return request({
+ url: '',
+ method: 'post',
+ data: {
+ type: '1',
+ name: '车间生产管理工艺_工时统计_组号查询_查询数据',
+ param: '机床流水号=' + num1,
+ Pagination: pageCurrent + '&' + pageSize
+ }
+ })
+}
+// 车间生产管理工艺_工时统计_组号查询_查询数据
+export function searchtable55(num1) {
+ return request({
+ url: '',
+ method: 'post',
+ data: {
+ type: '1',
+ name: '车间生产管理工艺_工时统计_组号查询_查询数据',
+ param: '机床流水号=' + num1
+ }
+ })
+}
diff --git a/src/views/Assembly/QualityInspectionInformationInquiry/index.vue b/src/views/Assembly/QualityInspectionInformationInquiry/index.vue
index c91260a6..fa12ff43 100644
--- a/src/views/Assembly/QualityInspectionInformationInquiry/index.vue
+++ b/src/views/Assembly/QualityInspectionInformationInquiry/index.vue
@@ -31,7 +31,7 @@
零件:
- 查询
+ 查询
@@ -97,6 +97,17 @@
+
+
+
@@ -114,7 +125,11 @@ export default {
QualityTypeNumber: [],
QualityTypeValue: '',
tableData1: [],
- SpareParts: ''
+ SpareParts: '',
+ loading: false,
+ total: null, // 总条数
+ pageSize: 10, // 每页显示条数
+ pageCurrent: 1 // 后台获取页
}
},
created() {
@@ -165,10 +180,21 @@ export default {
if (this.groupNumberValue !== '' && this.groupNumberValue !== null) { this.check2 = 1 } else { this.check2 = 0 }
if (this.SpareParts !== '' && this.SpareParts !== null) { this.check3 = 1 } else { this.check3 = 0 }
if (this.QualityTypeValue !== '' && this.QualityTypeValue !== null) { this.check4 = 1 } else { this.check4 = 0 }
- selecttable(this.check1, this.machineNumberValue, this.check2, this.groupNumberValue, this.check3, this.SpareParts, this.check4, this.QualityTypeValue).then(response => {
- this.tableData1 = response.data
- console.log(response.data, 1111)
+ selecttable(this.check1, this.machineNumberValue, this.check2, this.groupNumberValue, this.check3, this.SpareParts, this.check4, this.QualityTypeValue, this.pageCurrent, this.pageSize).then(response => {
+ this.tableData1 = response.data.rows
+ this.loading = false
+ this.total = response.data.total
})
+ },
+ // 分页
+ handleSizeChange(val) {
+ this.pageCurrent = 1
+ this.pageSize = val
+ this.selecttable()
+ },
+ handleCurrentChange(val) {
+ this.pageCurrent = val
+ this.selecttable()
}
}
}
diff --git a/src/views/Assembly/SparePartsOutStockRecord/index.vue b/src/views/Assembly/SparePartsOutStockRecord/index.vue
index 94b32697..7f415c0c 100644
--- a/src/views/Assembly/SparePartsOutStockRecord/index.vue
+++ b/src/views/Assembly/SparePartsOutStockRecord/index.vue
@@ -39,7 +39,7 @@
style="width: 160px"
type="date"
placeholder="选择日期"/>
- 查询
+ 查询
@@ -54,16 +54,6 @@
{{ scope.row.机床图号 }}
-
-
- {{ scope.row.机床名称 }}
-
-
-
-
- {{ scope.row.组号 }}
-
-
{{ scope.row.零件图号 }}
@@ -74,17 +64,23 @@
{{ scope.row.零件名称 }}
-
+
- {{ scope.row.质检类型 }}
-
-
-
-
- {{ scope.row.数量 }}
+ {{ scope.row.出库时间 }}
+
+
+
@@ -104,7 +100,11 @@ export default {
machineNumber: [],
groupNumberValue: '',
groupNumber: [],
- tableData1: []
+ tableData1: [],
+ loading: false,
+ total: null, // 总条数
+ pageSize: 10, // 每页显示条数
+ pageCurrent: 1 // 后台获取页
}
},
created() {
@@ -144,10 +144,21 @@ export default {
if (this.PartDrawingNumber !== '' && this.PartDrawingNumber !== null) { this.check3 = 1 } else { this.check3 = 0 }
if (this.startTime === '' || this.startTime === null) { this.startTime_check = 0 } else { this.startTime_check = 1 }
if (this.endTime === '' || this.endTime === null) { this.endTime_check = 0 } else { this.endTime_check = 1 }
- selecttable(this.check1, this.machineNumberValue, this.check2, this.groupNumberValue, this.check3, this.PartDrawingNumber, this.startTime_check, this.startTime, this.endTime_check, this.endTime).then(response => {
- this.tableData1 = response.data
- console.log(response.data, 1111)
+ selecttable(this.check1, this.machineNumberValue, this.check2, this.groupNumberValue, this.check3, this.PartDrawingNumber, this.startTime_check, this.startTime, this.endTime_check, this.endTime, this.pageCurrent, this.pageSize).then(response => {
+ this.tableData1 = response.data.rows
+ this.loading = false
+ this.total = response.data.total
})
+ },
+ // 分页
+ handleSizeChange(val) {
+ this.pageCurrent = 1
+ this.pageSize = val
+ this.selecttable()
+ },
+ handleCurrentChange(val) {
+ this.pageCurrent = val
+ this.selecttable()
}
}
}
diff --git a/src/views/Inventory/CreatePickingList/index.vue b/src/views/Inventory/CreatePickingList/index.vue
new file mode 100644
index 00000000..15561bbd
--- /dev/null
+++ b/src/views/Inventory/CreatePickingList/index.vue
@@ -0,0 +1,645 @@
+
+
+
+
+
机床编号:
+
+
+ {{ item.label }}
+ {{ item.name }}
+
+
+
组号:
+
+
+
+
查询
+
+
+
+
+
+
+
+ {{ scope.row.机床图号 }}
+
+
+
+
+ {{ scope.row.组号 }}
+
+
+
+
+ {{ scope.row.物料名称 }}
+
+
+
+
+ {{ scope.row.物料型号 || '—' }}
+
+
+
+
+ {{ scope.row.物料规格 || '—' }}
+
+
+
+
+ {{ scope.row.单台机床数量 }}
+
+
+
+
+ {{ scope.row.总数量 }}
+
+
+
+
+ {{ scope.row.备件总数量 }}
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ scope.row.机床图号 }}
+
+
+
+
+ {{ scope.row.组号 }}
+
+
+
+
+ {{ scope.row.物料名称 }}
+
+
+
+
+ {{ scope.row.物料型号 || '—' }}
+
+
+
+
+ {{ scope.row.物料规格 || '—' }}
+
+
+
+
+ {{ scope.row.总数量 }}
+
+
+
+
+ {{ scope.row.备件总数量 }}
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ scope.row.机床图号 }}
+
+
+
+
+ {{ scope.row.组号 }}
+
+
+
+
+ {{ scope.row.零件名称 }}
+
+
+
+
+ {{ scope.row.零件图号 }}
+
+
+
+
+ {{ scope.row.规格 || '—' }}
+
+
+
+
+ {{ scope.row.材料 || '—' }}
+
+
+
+
+ {{ scope.row.总数量 }}
+
+
+
+
+ {{ scope.row.备件总数量 }}
+
+
+
+
+
+
+
+
+
+
+
+
+ 领料单编号:
+
+ 查询
+ 创建
+ 选入
+
+ 领料单
+
+
+
+
+ {{ scope.row.领料单编号 }}
+
+
+
+
+ {{ scope.row.操作日期.split(' ')[0] }}
+
+
+
+
+ {{ scope.row.姓名 }}
+
+
+
+
+ {{ scope.row.领料单备注 }}
+
+
+
+
+ 未确认
+ 已确认
+
+
+
+
+ 确认
+ 删除
+
+
+
+
+
+
+ 领料单明细:{{ pickingListNumberShow }}
+
+
+
+
+ {{ scope.row.名称 }}
+
+
+
+
+ {{ scope.row.图号或型号 || '—' }}
+
+
+
+
+ {{ scope.row.规格 || '—' }}
+
+
+
+
+ {{ scope.row.机床图号 }}
+
+
+
+
+ {{ scope.row.组号 }}
+
+
+
+
+ {{ scope.row.总数量 }}
+
+
+
+
+ {{ scope.row.备件数量 }}
+
+
+
+
+ 删除
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/ManufacturingCenter/PartWorkCraftSelect_rdlc/index.vue b/src/views/ManufacturingCenter/PartWorkCraftSelect_rdlc/index.vue
index 7f13feea..5655b5fe 100644
--- a/src/views/ManufacturingCenter/PartWorkCraftSelect_rdlc/index.vue
+++ b/src/views/ManufacturingCenter/PartWorkCraftSelect_rdlc/index.vue
@@ -155,7 +155,7 @@
定额员 |
{{ tableData2[0] ? tableData2[0].定额员 : '' }} |
工艺完成 |
- {{ tableData2[0] ? tableData2[0].工艺实际完成时间.split(' ')[0] : '' }} |
+ {{ tableData2[0].工艺实际完成时间 ? tableData2[0].工艺实际完成时间.split(' ')[0] : '' }} |
加工开始 |
{{ tableData2[0] ? tableData2[0].机加工开始时间 : '' }} |
加工结束 |
diff --git a/src/views/ManufacturingCenter/machiningHoursStatistics/Export2Excel.js b/src/views/ManufacturingCenter/machiningHoursStatistics/Export2Excel.js
new file mode 100644
index 00000000..a4a80fd7
--- /dev/null
+++ b/src/views/ManufacturingCenter/machiningHoursStatistics/Export2Excel.js
@@ -0,0 +1,224 @@
+/* eslint-disable */
+require('script-loader!file-saver');
+// import XLSX from 'xlsx'
+import XLSX from 'xlsx-style'
+function generateArray(table) {
+ var out = [];
+ var rows = table.querySelectorAll('tr');
+ var ranges = [];
+ for (var R = 0; R < rows.length; ++R) {
+ var outRow = [];
+ var row = rows[R];
+ var columns = row.querySelectorAll('td');
+ for (var C = 0; C < columns.length; ++C) {
+ var cell = columns[C];
+ var colspan = cell.getAttribute('colspan');
+ var rowspan = cell.getAttribute('rowspan');
+ var cellValue = cell.innerText;
+ if (cellValue !== "" && cellValue == +cellValue) cellValue = +cellValue;
+
+ //Skip ranges
+ ranges.forEach(function (range) {
+ if (R >= range.s.r && R <= range.e.r && outRow.length >= range.s.c && outRow.length <= range.e.c) {
+ for (var i = 0; i <= range.e.c - range.s.c; ++i) outRow.push(null);
+ }
+ });
+
+ //Handle Row Span
+ if (rowspan || colspan) {
+ rowspan = rowspan || 1;
+ colspan = colspan || 1;
+ ranges.push({
+ s: {
+ r: R,
+ c: outRow.length
+ },
+ e: {
+ r: R + rowspan - 1,
+ c: outRow.length + colspan - 1
+ }
+ });
+ };
+
+ //Handle Value
+ outRow.push(cellValue !== "" ? cellValue : null);
+
+ //Handle Colspan
+ if (colspan)
+ for (var k = 0; k < colspan - 1; ++k) outRow.push(null);
+ }
+ out.push(outRow);
+ }
+ return [out, ranges];
+};
+
+function datenum(v, date1904) {
+ if (date1904) v += 1462;
+ var epoch = Date.parse(v);
+ return (epoch - new Date(Date.UTC(1899, 11, 30))) / (24 * 60 * 60 * 1000);
+}
+
+function sheet_from_array_of_arrays(data, opts) {
+ var ws = {};
+ var range = {
+ s: {
+ c: 10000000,
+ r: 10000000
+ },
+ e: {
+ c: 0,
+ r: 0
+ }
+ };
+ for (var R = 0; R != data.length; ++R) {
+ for (var C = 0; C != data[R].length; ++C) {
+ if (range.s.r > R) range.s.r = R;
+ if (range.s.c > C) range.s.c = C;
+ if (range.e.r < R) range.e.r = R;
+ if (range.e.c < C) range.e.c = C;
+ var cell = {
+ v: data[R][C]
+ };
+ if (cell.v == null) continue;
+ var cell_ref = XLSX.utils.encode_cell({
+ c: C,
+ r: R
+ });
+
+ if (typeof cell.v === 'number') cell.t = 'n';
+ else if (typeof cell.v === 'boolean') cell.t = 'b';
+ else if (cell.v instanceof Date) {
+ cell.t = 'n';
+ cell.z = XLSX.SSF._table[14];
+ cell.v = datenum(cell.v);
+ } else cell.t = 's';
+
+ ws[cell_ref] = cell;
+ }
+ }
+ if (range.s.c < 10000000) ws['!ref'] = XLSX.utils.encode_range(range);
+ return ws;
+}
+
+function Workbook() {
+ if (!(this instanceof Workbook)) return new Workbook();
+ this.SheetNames = [];
+ this.Sheets = {};
+}
+
+function s2ab(s) {
+ var buf = new ArrayBuffer(s.length);
+ var view = new Uint8Array(buf);
+ for (var i = 0; i != s.length; ++i) view[i] = s.charCodeAt(i) & 0xFF;
+ return buf;
+}
+
+export function export_table_to_excel(id) {
+ var theTable = document.getElementById(id);
+ var oo = generateArray(theTable);
+ var ranges = oo[1];
+
+ /* original data */
+ var data = oo[0];
+ var ws_name = "SheetJS";
+
+ var wb = new Workbook(),
+ ws = sheet_from_array_of_arrays(data);
+
+ /* add ranges to worksheet */
+ // ws['!cols'] = ['apple', 'banan'];
+ ws['!merges'] = ranges;
+
+ /* add worksheet to workbook */
+ wb.SheetNames.push(ws_name);
+ wb.Sheets[ws_name] = ws;
+
+ var wbout = XLSX.write(wb, {
+ bookType: 'xlsx',
+ bookSST: false,
+ type: 'binary'
+ });
+
+ saveAs(new Blob([s2ab(wbout)], {
+ type: "application/octet-stream"
+ }), "test.xlsx")
+}
+
+export function export_json_to_excel({
+ headerGroup,
+ dataGroup,
+ sheetGroup,
+ filename,
+ autoWidth = true,
+ bookType= 'xlsx'
+} = {}) {
+ var wb = new Workbook()
+ for (let i = 0; i < dataGroup.length; i++) {
+ /* original data */
+ let data = dataGroup[i]
+ filename = filename || 'excel-list'
+ data = [...data]
+ data.unshift(headerGroup[i]);
+ var ws_name = sheetGroup[i];
+ var ws = sheet_from_array_of_arrays(data);
+
+ if (autoWidth) {
+ /*设置worksheet每列的最大宽度*/
+ const colWidth = data.map(row => row.map(val => {
+ /*先判断是否为null/undefined*/
+ if (val == null) {
+ return {
+ 'wch': 10
+ };
+ }
+ /*再判断是否为中文*/
+ else if (val.toString().charCodeAt(0) > 255) {
+ return {
+ 'wch': val.toString().length * 2
+ };
+ } else {
+ return {
+ 'wch': val.toString().length
+ };
+ }
+ }))
+ /*以第一行为初始值*/
+ let result = colWidth[0];
+ for (let i = 1; i < colWidth.length; i++) {
+ for (let j = 0; j < colWidth[i].length; j++) {
+ if (result[j]['wch'] < colWidth[i][j]['wch']) {
+ result[j]['wch'] = colWidth[i][j]['wch'];
+ }
+ }
+ }
+ ws['!cols'] = result;
+ }
+ let R = 0;
+ data.map(item => {
+ let C = 0;
+ item.map(itm => {
+ var cell_ref = XLSX.utils.encode_cell({c:C,r:R});
+ var cell = {v: itm }
+ cell.s= {
+ alignment: {
+ horizontal: "center"
+ }
+ }
+ ws[cell_ref] = cell;
+ C++;
+ })
+ R++;
+ })
+ /* add worksheet to workbook */
+ wb.SheetNames.push(ws_name);
+ wb.Sheets[ws_name] = ws;
+ }
+ var wbout = XLSX.write(wb, {
+ bookType: bookType,
+ bookSST: false,
+ type: 'binary'
+ });
+ saveAs(new Blob([s2ab(wbout)], {
+ type: "application/octet-stream"
+ }), `${filename}.${bookType}`);
+}
diff --git a/src/views/ManufacturingCenter/machiningHoursStatistics/exportExcel.js b/src/views/ManufacturingCenter/machiningHoursStatistics/exportExcel.js
new file mode 100644
index 00000000..c5075de7
--- /dev/null
+++ b/src/views/ManufacturingCenter/machiningHoursStatistics/exportExcel.js
@@ -0,0 +1,24 @@
+// 导出Excel方法(表格id,不加扩展名的文件名,sheet名)
+export function exportExcelMethod(tableId, fileName, sheetName) {
+ tableToExcel(tableId, fileName, sheetName)
+}
+const tableToExcel = (function() {
+ const uri = 'data:application/vnd.ms-excel;base64,'
+ // 设置导出表格的单元格默认高度/宽度/边框样式/字体颜色/背景颜色/居中,网页显示表格宽度建议1240,tr/td视情况而定
+ const template = `{worksheet}`
+ const base64 = function(s) { return window.btoa(unescape(encodeURIComponent(s))) }
+ const format = function(s, c) { return s.replace(/{(\w+)}/g, function(m, p) { return c[p] }) }
+ return function(table, filename, sheetname) {
+ if (!table.nodeType) table = document.getElementById(table)
+ const ctx = { worksheet: sheetname || 'Worksheet', table: table.innerHTML }
+ const blob = new Blob([format(template, ctx)])
+ if ('msSaveOrOpenBlob' in navigator) {
+ window.navigator.msSaveOrOpenBlob(blob, filename + '.xls')
+ return
+ }
+ const aTag = document.createElement('a')
+ aTag.href = uri + base64(format(template, ctx))
+ aTag.download = filename
+ aTag.click()
+ }
+})()
diff --git a/src/views/ManufacturingCenter/machiningHoursStatistics/index.vue b/src/views/ManufacturingCenter/machiningHoursStatistics/index.vue
index 93e072fb..5783f32d 100644
--- a/src/views/ManufacturingCenter/machiningHoursStatistics/index.vue
+++ b/src/views/ManufacturingCenter/machiningHoursStatistics/index.vue
@@ -22,11 +22,12 @@
type="date"
placeholder="选择日期"/>
查询
+ 导出
-
+
{{ scope.row.姓名 }}
@@ -55,7 +56,7 @@
-
+
{{ scope.row.零件图号 }}
@@ -104,10 +105,90 @@
+
+ 机床编号:
+
+
+ {{ item.label }}
+ {{ item.name }}
+
+
+ 机床导出
+ 组件导出
+
+
+
+
+
+
+ {{ scope.row.机床图号 }}
+
+
+
+
+ {{ scope.row.理论加工时间段 }}
+
+
+
+
+ {{ scope.row.实际加工时间段 }}
+
+
+
+
+
+
+
+
+
+
+
+ {{ scope.row.机床图号 }}
+
+
+
+
+ {{ scope.row.组号 }}
+
+
+
+
+ {{ scope.row.理论加工时间段 }}
+
+
+
+
+ {{ scope.row.实际加工时间段 }}
+
+
+
+
+
+
+
+