This commit is contained in:
liushuai
2020-02-12 16:46:01 +08:00
parent c6852ed7c1
commit dd28e09a2d
7 changed files with 163 additions and 109 deletions

View File

@@ -26,15 +26,14 @@ export function initMachine(projectNum) {
}
// 查询项目详情
export function searchatabledata(projectNum, machineValue, pageCurrent, pageSize) {
export function searchatabledata(projectNum, machineValue) {
return request({
url: '',
method: 'post',
data: {
type: '1',
name: '项目工时统计_合同详情查询_工时综合查询',
param: `项目流水号=${projectNum}&机床流水号=${machineValue}`,
Pagination: pageCurrent + '&' + pageSize
param: `项目流水号=${projectNum}&机床流水号=${machineValue}`
}
})
}

View File

@@ -2,7 +2,7 @@
<div class="app-container">
<el-card>
<span>项目名称</span>
<el-select v-model="projectValue" filterable clearable size="small" style="margin-right:10px;width: 180px" placeholder="项目名称" @change="typeChange">
<el-select v-model="projectValue" filterable clearable size="small" style="margin-right:10px;width: 150px" placeholder="项目名称" @change="typeChange">
<el-option
v-for="item in project"
:key="item.value"
@@ -27,95 +27,86 @@
<!-- </el-select>-->
<!-- <span>规格及型号</span>-->
<!-- <el-input v-model="specificationValue" clearable size="small" style="margin-right:10px;width: 150px" placeholder="规格型号"/>-->
<span>加工总工时小时:</span>
<el-input v-model="totalProcessingHours" clearable size="small" style="margin-right:10px;width: 100px"/>
<span>计划总工时小时:</span>
<el-input v-model="totalPlannedHours" clearable size="small" style="margin-right:10px;width: 100px"/>
<!--<span>加工总工时小时:</span>-->
<!--<el-input v-model="totalProcessingHours" clearable size="small" style="margin-right:10px;width: 100px"/>-->
<!--<span>计划总工时小时:</span>-->
<!--<el-input v-model="totalPlannedHours" clearable size="small" style="margin-right:10px;width: 100px"/>-->
<el-button size="small" type="primary" icon="el-icon-search" style="margin: 0 0 0 10px" plain @click="searchTable()">查询</el-button>
<el-button size="small" type="primary" icon="el-icon-download" style="margin: 0 0 0 10px" plain @click="exportExcel()">导出</el-button>
</el-card>
<el-card>
<el-table :data="tableData" highlight-current-row border style="width: 100%;" size="mini" height="700">
<el-table-column label="跟单号" align="center" min-width="150">
<el-table v-loading="loading" :data="tableData" highlight-current-row show-summary border style="width: 1510px;" size="mini" height="700">
<el-table-column label="跟单号" align="center" width="150">
<template slot-scope="scope">
{{ scope.row.跟单号 }}
</template>
</el-table-column>
<el-table-column label="序" align="center" min-width="70">
<el-table-column label="序" align="center" width="50">
<template slot-scope="scope">
{{ scope.row.序号 }}
</template>
</el-table-column>
<el-table-column label="工序名" align="center" min-width="90">
<el-table-column label="工序名" align="center" width="90">
<template slot-scope="scope">
{{ scope.row.工序名 }}
</template>
</el-table-column>
<el-table-column label="计划数" align="center" min-width="70">
<el-table-column label="计划数" align="center" width="70">
<template slot-scope="scope">
{{ scope.row.计划数量 }}
</template>
</el-table-column>
<el-table-column label="计划准备工时" align="center" min-width="70">
<el-table-column label="计划准结(分)" align="center" width="120">
<template slot-scope="scope">
{{ scope.row.计划准备工时 }}
</template>
</el-table-column>
<el-table-column label="单件计划工时" align="center" min-width="70">
<el-table-column label="计划定额(分)" align="center" width="120">
<template slot-scope="scope">
{{ scope.row.单件计划工时 }}
</template>
</el-table-column>
<el-table-column label="计划工时(分)" align="center" min-width="70">
<el-table-column label="计划工时(分)" align="center" prop="计划工时" width="100">
<template slot-scope="scope">
{{ scope.row.计划工时 }}
</template>
</el-table-column>
<el-table-column label="计划加工日期" align="center" min-width="100">
<el-table-column label="计划加工日期" align="center" width="100">
<template slot-scope="scope">
{{ scope.row.计划加工日期 }}
</template>
</el-table-column>
<el-table-column label="加工数" align="center" min-width="70">
<el-table-column label="加工数" align="center" width="70">
<template slot-scope="scope">
{{ scope.row.加工数量 }}
</template>
</el-table-column>
<el-table-column label="加工准备工时" align="center" min-width="70">
<el-table-column label="录入准结(分)" align="center" width="120">
<template slot-scope="scope">
{{ scope.row.加工准备工时 }}
</template>
</el-table-column>
<el-table-column label="加工工时(分)" align="center" min-width="70">
<el-table-column label="加工工时(分)" align="center" prop="加工工时" width="100">
<template slot-scope="scope">
{{ scope.row.加工工时 }}
</template>
</el-table-column>
<el-table-column label="加工日期" align="center" min-width="100">
<el-table-column label="加工日期" align="center" width="100">
<template slot-scope="scope">
{{ scope.row.加工日期 }}
</template>
</el-table-column>
<el-table-column label="图号及规格" align="center" min-width="150">
<el-table-column label="图号及规格" align="center" width="150">
<template slot-scope="scope">
{{ scope.row.图号及规格 }}
</template>
</el-table-column>
<el-table-column label="制品名称" align="center" min-width="150">
<el-table-column label="制品名称" align="center" width="150">
<template slot-scope="scope">
{{ scope.row.制品名称 }}
</template>
</el-table-column>
</el-table>
<div class="block" style="margin: 10px 0;">
<el-pagination
:current-page="PageCurrent"
:page-sizes="[10, 20, 30, 40, 1000]"
:page-size="PageSize"
:total="total"
layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"/>
</div>
</el-card>
</div>
</template>
@@ -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()
}
}
}

View File

@@ -16,13 +16,13 @@
<el-button size="small" type="primary" icon="el-icon-download" plain @click="exportExcel">导出</el-button>
</el-card>
<el-card>
<el-table :data="tableData" size="mini" style="max-height: 720px" height="720px" border>
<el-table v-loading="loading" :data="tableData" size="mini" style="max-height: 720px" height="720px" border>
<el-table-column align="center" label="姓名" width="70px">
<template slot-scope="scope">
{{ scope.row.姓名 }}
</template>
</el-table-column>
<el-table-column align="center" label="图号" width="170px">
<el-table-column align="center" label="图号" width="150px">
<template slot-scope="scope">
{{ scope.row.零件图号_短 }}
</template>
@@ -32,7 +32,7 @@
{{ scope.row.跟单号 }}
</template>
</el-table-column>
<el-table-column align="center" label="序" width="50px">
<el-table-column align="center" label="序" width="50px">
<template slot-scope="scope">
{{ scope.row.工序顺序 }}
</template>
@@ -42,22 +42,22 @@
{{ scope.row.工艺名称 }}
</template>
</el-table-column>
<el-table-column align="center" label="录入准结工时" width="100px">
<el-table-column align="center" label="录入准结(分)" width="100px">
<template slot-scope="scope">
{{ scope.row.修补准结工时 }}
</template>
</el-table-column>
<el-table-column align="center" label="加工工时" width="80px">
<el-table-column align="center" label="加工工时(分)" width="100px">
<template slot-scope="scope">
{{ scope.row.设备工时 }}
</template>
</el-table-column>
<el-table-column align="center" label="合格" width="70px">
<el-table-column align="center" label="合格件数" width="70px">
<template slot-scope="scope">
{{ scope.row.合格数 }}
</template>
</el-table-column>
<el-table-column align="center" label="废品" width="70px">
<el-table-column align="center" label="废品件数" width="70px">
<template slot-scope="scope">
{{ scope.row.不合格数 }}
</template>
@@ -69,15 +69,15 @@
</el-table-column>
<el-table-column align="center" label="加工日期" width="100px">
<template slot-scope="scope">
{{ scope.row.操作时间.substr(0,10) }}
{{ scope.row.操作时间 }}
</template>
</el-table-column>
<el-table-column align="center" label="计划准结工时" width="100px">
<el-table-column align="center" label="计划准结(分)" width="100px">
<template slot-scope="scope">
{{ scope.row.准结定额工时 }}
</template>
</el-table-column>
<el-table-column align="center" label="计划定额工时" width="100px">
<el-table-column align="center" label="计划定额(分)" width="100px">
<template slot-scope="scope">
{{ scope.row.单件定额工时 }}
</template>
@@ -87,7 +87,7 @@
{{ scope.row.项目名称 }}
</template>
</el-table-column>
<el-table-column align="center" label="机床号" width="100px">
<el-table-column align="center" label="机床号" width="100px">
<template slot-scope="scope">
{{ scope.row.机床图号 }}
</template>
@@ -97,7 +97,7 @@
{{ scope.row.组号 }}
</template>
</el-table-column>
<el-table-column align="center" label="设计" width="70px">
<el-table-column align="center" label="设计" width="70px">
<template slot-scope="scope">
{{ scope.row.设计者 }}
</template>
@@ -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('请选择时间段')

View File

@@ -119,7 +119,7 @@
</el-table>
</el-tab-pane>
<el-tab-pane label="外购件">
<el-table :data="tableData2" border size="mini" style="width: 100%" height="300px" @selection-change="handleSelectionChange">
<el-table :data="tableData2" stripe border size="mini" style="width: 100%" height="300px" @selection-change="handleSelectionChange">
<el-table-column align="center" width="50" type="selection"/>
<el-table-column label="物料代码" align="center" width="120">
<template slot-scope="scope">
@@ -169,7 +169,7 @@
</el-table>
</el-tab-pane>
<el-tab-pane label="标准件">
<el-table :data="tableData3" border size="mini" style="width: 100%" height="300px" @selection-change="handleSelectionChange">
<el-table :data="tableData3" stripe border size="mini" style="width: 100%" height="300px" @selection-change="handleSelectionChange">
<el-table-column align="center" width="50" type="selection"/>
<el-table-column label="物料代码" align="center" width="120">
<template slot-scope="scope">
@@ -289,7 +289,7 @@
</el-col>
<el-col style="width: 920px;margin-left: 10px">
<el-card>
<el-table :data="tableData6" border size="mini" style="width: 100%" height="300px">
<el-table :data="tableData6" stripe border size="mini" style="width: 100%" height="300px">
<el-table-column label="序号" type="index" align="center" width="50px"/>
<el-table-column label="零件名称" show-overflow-tooltip align="center" width="90px">
<template slot-scope="scope">

View File

@@ -269,7 +269,7 @@
</el-card>
<el-dialog v-el-drag-dialog :visible.sync="dialogeditVisible" :title="title" :close-on-click-modal="false" width="400px" center >
<el-form ref="form2" :model="form2" :rules="rules" label-position="left">
<el-form-item label="零件号" label-width="80px" style="width: 299px ; display: inline-block; text-align: left;margin-left: 20px" size="small">
<el-form-item label="零件号" label-width="90px" style="width: 299px ; display: inline-block; text-align: left;margin-left: 10px" size="small">
<el-input v-model="form.input1" :disabled="true" auto-complete="off" style="width: 200px"/>
</el-form-item>
<el-form-item label="报废数量" prop="报废数量" label-width="100px" style="width: 299px ; display: inline-block; text-align: left" size="small">
@@ -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() {

View File

@@ -45,7 +45,7 @@
size="small"
plain
icon="el-icon-download"
@click="searchTable1()">导出合同报表</el-button>
@click="exportExcel()">导出合同报表</el-button>
</el-row>
</el-card>
@@ -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

View File

@@ -1,6 +1,6 @@
<template>
<div class="app-container">
<el-card style="width: 47%">
<el-card style="width: 44%">
<span>项目名称:</span>
<el-select v-model="projectValue" placeholder="项目名称" size="small" style="width: 180px" filterable clearable>
<el-option
@@ -22,9 +22,9 @@
plain
icon="el-icon-download"
style="margin-left:10px"
@click="searchTable1()">导出项目采购明细</el-button>
@click="exportExcel()">导出项目采购明细</el-button>
</el-card>
<el-card style="width: 47%">
<el-card style="width: 44%">
<el-table v-loading="" :data="tableData2" :summary-method="getSummaries1" show-summary border style="width: 100%;max-height: 700px;" height="700px">
<el-table-column label="零件名称" align="center" width="150">
<template slot-scope="scope">
@@ -51,7 +51,7 @@
{{ scope.row.单价 }}
</template>
</el-table-column>
<el-table-column label="小计(元)" align="center" width="100" prop="金额">
<el-table-column label="小计(元)" align="center" width="120" prop="金额">
<template slot-scope="scope">
{{ scope.row.金额 }}
</template>
@@ -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 => {