diff --git a/src/api/ManufacturingCenter/ContractDetailsInquiry.js b/src/api/ManufacturingCenter/ContractDetailsInquiry.js
index b85965ee..c36b006f 100644
--- a/src/api/ManufacturingCenter/ContractDetailsInquiry.js
+++ b/src/api/ManufacturingCenter/ContractDetailsInquiry.js
@@ -32,7 +32,7 @@ export function initMachine(projectNum) {
}
// 查询项目详情
-export function searchatabledata(projectNum, machineValue, pageCurrent, pageSize) {
+export function searchatabledata(projectNum, machineValue) {
return request({
url: '',
method: 'post',
@@ -41,8 +41,7 @@ export function searchatabledata(projectNum, machineValue, pageCurrent, pageSize
ModularID: router.currentRoute.path,
type: '1',
name: '项目工时统计_合同详情查询_工时综合查询',
- param: `项目流水号=${projectNum}&机床流水号=${machineValue}`,
- Pagination: pageCurrent + '&' + pageSize
+ param: `项目流水号=${projectNum}&机床流水号=${machineValue}`
}
})
}
diff --git a/src/views/ManufacturingCenter/ContractDetailsInquiry/index.vue b/src/views/ManufacturingCenter/ContractDetailsInquiry/index.vue
index 76c40d39..b469b23e 100644
--- a/src/views/ManufacturingCenter/ContractDetailsInquiry/index.vue
+++ b/src/views/ManufacturingCenter/ContractDetailsInquiry/index.vue
@@ -2,7 +2,7 @@
项目名称
-
+
-->
- 加工总工时(小时):
-
- 计划总工时(小时):
-
+
+
+
+
查询
+ 导出
-
-
+
+
{{ 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.制品名称 }}
-
-
-
@@ -129,15 +120,13 @@ export default {
projectValue: '', // 项目名称
machineValue: '', // 机床名称
machine: [],
+ loading: false,
part: [], // 分組
partValue: '',
specificationValue: '', // 规格型号
totalProcessingHours: '', // 加工总工时
totalPlannedHours: '', // 计划总工时
- tableData: [], // 详情表
- PageCurrent: 1,
- PageSize: 1000,
- total: 0
+ tableData: [] // 详情表
}
},
created() {
@@ -161,40 +150,58 @@ export default {
}, // 查询按钮
searchTable() {
this.tableData = []
- searchatabledata(this.projectValue, this.machineValue, this.PageCurrent, this.PageSize).then(response => {
- if (response.data.rows.length !== 0) {
- for (let i = 0; i < response.data.rows.length; i++) {
- this.tableData.push({
- 跟单号: response.data.rows[i].跟单号,
- 序号: response.data.rows[i].工序顺序,
- 工序名: response.data.rows[i].工艺名称,
- 计划数量: response.data.rows[i].批次数量,
- 计划准备工时: response.data.rows[i].准结定额工时,
- 单件计划工时: response.data.rows[i].单件定额工时,
- 计划工时: Number(response.data.rows[i].批次数量) * (Number(response.data.rows[i].单件定额工时) + Number(response.data.rows[i].准结定额工时)),
- 计划加工日期: response.data.rows[i].计划日期.split(' ')[0],
- 加工数量: response.data.rows[i].批次数量,
- 加工准备工时: response.data.rows[i].修补准结工时,
- 加工工时: response.data.rows[i].设备工时,
- 加工日期: response.data.rows[i].操作时间,
- 图号及规格: response.data.rows[i].机床图号,
- 制品名称: response.data.rows[i].零件名称
- })
- this.totalProcessingHours += Number(response.data.rows[i].设备工时)
- this.totalPlannedHours += Number(Number(response.data.rows[i].批次数量) * (Number(response.data.rows[i].单件定额工时) + Number(response.data.rows[i].准结定额工时)))
+ if (this.machineValue) {
+ this.loading = true
+ searchatabledata(this.projectValue, this.machineValue).then(response => {
+ if (response.data.length !== 0) {
+ for (let i = 0; i < response.data.length; i++) {
+ this.tableData.push({
+ 跟单号: response.data[i].跟单号,
+ 序号: response.data[i].工序顺序,
+ 工序名: response.data[i].工艺名称,
+ 计划数量: response.data[i].批次数量,
+ 计划准备工时: response.data[i].准结定额工时,
+ 单件计划工时: response.data[i].单件定额工时,
+ 计划工时: Number(response.data[i].批次数量) * (Number(response.data[i].单件定额工时) + Number(response.data[i].准结定额工时)),
+ 计划加工日期: response.data[i].计划日期.split(' ')[0],
+ 加工数量: response.data[i].批次数量,
+ 加工准备工时: response.data[i].修补准结工时,
+ 加工工时: response.data[i].设备工时,
+ 加工日期: response.data[i].操作时间,
+ 图号及规格: response.data[i].机床图号,
+ 制品名称: response.data[i].零件名称
+ })
+ }
+ this.loading = false
}
- }
- this.total = response.data.total
+ })
+ } else {
+ this.$message.warning('请选择要查询的机床')
+ }
+ },
+ formatJson(filterVal, jsonData) {
+ return jsonData.map(v => filterVal.map(j => {
+ return v[j]
+ }))
+ },
+ exportExcel() {
+ if (this.tableData.length === 0) {
+ this.$message.warning('请查询出要导出的数据')
+ return
+ }
+ import('@/vendor/Export2Excel').then(excel => {
+ const tHeader = ['跟单号', '工序', '工序名', '计划件数', '计划准结(分)', '计划定额(分)', '计划工时(分)', '计划加工日期', '加工件数', '录入准结(分)', '加工工时(分)', '加工日期', '图号及规格', '制品名称']
+ const filterVal = ['跟单号', '序号', '工序名', '计划数量', '计划准备工时', '单件计划工时', '计划工时', '计划加工日期', '加工数量', '加工准备工时', '加工工时', '加工日期', '图号及规格', '制品名称']
+ const list = this.tableData
+ const data = this.formatJson(filterVal, list)
+ excel.export_json_to_excel({
+ header: tHeader,
+ data,
+ filename: '机床工时表',
+ autoWidth: true,
+ bookType: 'xlsx'
+ })
})
- },
- handleSizeChange(val) {
- this.PageCurrent = 1
- this.PageSize = val
- this.searchTable()
- },
- handleCurrentChange(val) {
- this.PageCurrent = val
- this.searchTable()
}
}
}
diff --git a/src/views/ManufacturingCenter/MonthEndHourAccounting/index.vue b/src/views/ManufacturingCenter/MonthEndHourAccounting/index.vue
index cce8e487..af9ec742 100644
--- a/src/views/ManufacturingCenter/MonthEndHourAccounting/index.vue
+++ b/src/views/ManufacturingCenter/MonthEndHourAccounting/index.vue
@@ -16,13 +16,13 @@
导出
-
+
{{ scope.row.姓名 }}
-
+
{{ scope.row.零件图号_短 }}
@@ -32,7 +32,7 @@
{{ scope.row.跟单号 }}
-
+
{{ scope.row.工序顺序 }}
@@ -42,22 +42,22 @@
{{ scope.row.工艺名称 }}
-
+
{{ scope.row.修补准结工时 }}
-
+
{{ scope.row.设备工时 }}
-
+
{{ scope.row.合格数 }}
-
+
{{ scope.row.不合格数 }}
@@ -69,15 +69,15 @@
- {{ scope.row.操作时间.substr(0,10) }}
+ {{ scope.row.操作时间 }}
-
+
{{ scope.row.准结定额工时 }}
-
+
{{ scope.row.单件定额工时 }}
@@ -87,7 +87,7 @@
{{ scope.row.项目名称 }}
-
+
{{ scope.row.机床图号 }}
@@ -97,7 +97,7 @@
{{ scope.row.组号 }}
-
+
{{ scope.row.设计者 }}
@@ -117,7 +117,8 @@ export default {
data() {
return {
tableData: [],
- startTime: ''
+ startTime: '',
+ loading: false
}
},
methods: {
@@ -132,7 +133,7 @@ export default {
return
}
import('@/vendor/Export2Excel').then(excel => {
- const tHeader = ['日期', '姓名', '图号', '跟单号', '序号', '工序名称', '录入准结工时', '实际工时', '合格数', '不合格数', '备注', '计划准结工时', '计划定额工时', '项目名称', '机床图号', '组号', '设计', '材料']
+ const tHeader = ['日期', '姓名', '图号', '跟单号', '工序', '工序名', '录入准结(分)', '实际工时(分)', '合格件数', '废品件数', '备注', '计划准结(分)', '计划定额(分)', '项目名称', '机床图号', '组号', '设计', '材料']
const filterVal = ['操作时间', '姓名', '零件图号_短', '跟单号', '工序顺序', '工艺名称', '修补准结工时', '设备工时', '合格数', '不合格数', '备注', '准结定额工时', '单件定额工时', '项目名称', '机床图号', '组号', '设计者', '材料']
const list = this.tableData
const data = this.formatJson(filterVal, list)
@@ -147,8 +148,10 @@ export default {
},
searchTable() {
if (this.startTime[0] && this.startTime[1]) {
+ this.loading = true
searchTable(this.startTime[0], this.startTime[1]).then(response => {
this.tableData = response.data
+ this.loading = false
})
} else {
this.$message.warning('请选择时间段')
diff --git a/src/views/ManufacturingCenter/PartAssignment/index.vue b/src/views/ManufacturingCenter/PartAssignment/index.vue
index 34c9667e..03955470 100644
--- a/src/views/ManufacturingCenter/PartAssignment/index.vue
+++ b/src/views/ManufacturingCenter/PartAssignment/index.vue
@@ -119,7 +119,7 @@
-
+
@@ -169,7 +169,7 @@
-
+
@@ -289,7 +289,7 @@
-
+
diff --git a/src/views/ManufacturingCenter/SparePartsForScrap/index.vue b/src/views/ManufacturingCenter/SparePartsForScrap/index.vue
index 3a01874c..e2977f0a 100644
--- a/src/views/ManufacturingCenter/SparePartsForScrap/index.vue
+++ b/src/views/ManufacturingCenter/SparePartsForScrap/index.vue
@@ -269,7 +269,7 @@
-
+
@@ -480,15 +480,19 @@ export default {
submit(formName) {
this.$refs[formName].validate((valid) => {
if (valid) {
- editSpare(this.code, this.form2.报废数量, this.form2.报废原因, this.form2.报废时间).then(response => {
- if (response.data[0].result === '1') {
- this.$message.success('报废成功')
- this.dialogeditVisible = false
- this.fetchTableData()
- } else {
- this.$message.success('报废失败')
- }
- })
+ if (this.form2.报废数量 > 0) {
+ editSpare(this.code, this.form2.报废数量, this.form2.报废原因, this.form2.报废时间).then(response => {
+ if (response.data[0].result === '1') {
+ this.$message.success('报废成功')
+ this.dialogeditVisible = false
+ this.fetchTableData()
+ } else {
+ this.$message.success('报废失败')
+ }
+ })
+ } else {
+ this.$message.warning('报废数量不能为零')
+ }
}
})
},
@@ -511,14 +515,19 @@ export default {
},
editB() {
if (this.spareNumber - this.SupplementationNumber > 0) {
- editA(this.CutCodeBefore, this.inputC).then(response => {
- if (response.data[0].result === '1') {
- this.$message.success('补投成功')
- this.fetchTableData()
- } else {
- this.$message.error('补投失败')
- }
- })
+ if (this.inputC > 0) {
+ editA(this.CutCodeBefore, this.inputC).then(response => {
+ if (response.data[0].result === '1') {
+ this.$message.success('补投成功')
+ this.fetchTableData()
+ this.inputC = 0
+ } else {
+ this.$message.error('补投失败')
+ }
+ })
+ } else {
+ this.$message.warning('补投数量不能为零')
+ }
} else { alert('请选择停产零件') }
},
goToCapacityBalance() {
diff --git a/src/views/WorkshopProcurement/ProcurementContractEnquiry/index.vue b/src/views/WorkshopProcurement/ProcurementContractEnquiry/index.vue
index bed309cb..74030d17 100644
--- a/src/views/WorkshopProcurement/ProcurementContractEnquiry/index.vue
+++ b/src/views/WorkshopProcurement/ProcurementContractEnquiry/index.vue
@@ -45,7 +45,7 @@
size="small"
plain
icon="el-icon-download"
- @click="searchTable1()">导出合同报表
+ @click="exportExcel()">导出合同报表
@@ -482,6 +482,36 @@ export default {
submitSelectBuyer() { // 确定
this.dialogVisible2 = false
},
+ exportExcel() { // 导出
+ this.startTime ? this.check1 = 1 : this.check1 = 0
+ this.contractNumValue ? this.check2 = 1 : this.check2 = 0
+ this.supplierName ? this.check4 = 1 : this.check4 = 0
+ if (this.approvalValue === '' || this.approvalValue === 0) {
+ this.check5 = 0
+ } else {
+ this.check5 = 1
+ }
+ console.log(this.check1, this.check2, this.contractNumValue, this.check4, this.supplierName, this.check5, this.approvalValue, 111)
+ var param = []
+ param[0] = ['时间段_check', this.check1]
+ if (this.check1 === 0) {
+ param[1] = ['开始时间', '']
+ param[2] = ['结束时间', '']
+ } else {
+ param[1] = ['开始时间', this.startTime[0]]
+ param[2] = ['结束时间', this.startTime[1]]
+ }
+ // param[1] = ['开始时间', this.startTime[0]]
+ // param[2] = ['结束时间', this.startTime[1]]
+ param[3] = ['采购合同流水号_check', this.check2]
+ param[4] = ['采购合同流水号', this.contractNumValue]
+ param[5] = ['供应商名称_check', this.check4]
+ param[6] = ['供应商名称', this.supplierName]
+ param[7] = ['审批情况流水号_check', this.check5]
+ param[8] = ['审批情况流水号', this.approvalValue]
+ var Data = this.CreateData('12', '采购管理_合同_查询数据_导出', param)
+ this.exportExcel_NPOI(Data)
+ },
searchTable1() {
this.textarea = ``
this.loading1 = true
diff --git a/src/views/WorkshopProcurement/ProjectTotalSearch/index.vue b/src/views/WorkshopProcurement/ProjectTotalSearch/index.vue
index 480991a3..88f62fb8 100644
--- a/src/views/WorkshopProcurement/ProjectTotalSearch/index.vue
+++ b/src/views/WorkshopProcurement/ProjectTotalSearch/index.vue
@@ -1,6 +1,6 @@
-
+
项目名称:
导出项目采购明细
+ @click="exportExcel()">导出项目采购明细
-
+
@@ -51,7 +51,7 @@
{{ scope.row.单价 }}
-
+
{{ scope.row.金额 }}
@@ -97,6 +97,12 @@ export default {
}
})
},
+ exportExcel() {
+ var param = []
+ param[0] = ['项目流水号', this.projectValue]
+ var Data = this.CreateData('12', '车间采购管理_项目总价_明细_查询数据_导出', param)
+ this.exportExcel_NPOI(Data)
+ },
searchTable1() {
if (this.projectValue) {
searchProjectTotal2(this.projectValue).then(response => {