This commit is contained in:
bryan sun
2020-01-07 12:54:41 +08:00
14 changed files with 2558 additions and 223 deletions

View File

@@ -1,14 +1,6 @@
<template>
<div class="app-container">
<el-card>
<span>项目名称</span>
<el-select v-model="projectValue" placeholder="请选择项目名称" style="margin: 0px 20px 0px 0px" filterable size="small">
<el-option
v-for="item in project"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<span>机床图号</span>
<el-select v-model="machineValue" placeholder="请选择机床图号" style="margin: 0px 20px 0px 0px" filterable size="small">
<el-option
@@ -646,13 +638,12 @@
</template>
<script>
import { alldeleteWB, alldelete, projectSelect, machineSelect, groupSelect, basicPartsData, deleteBasicParts, deleteBasicParts5, deleteBasicParts6, alldeleteBasicParts5, alldeleteBasicParts6, purchasePartsData, deletePurchaseData, editPurchaseData, editBasicParts, getTable, editProductNum, getTable1, editProduceNum, searchTable1, searchTable2, searchTable5, searchTable6, searchTable7, editGroupBasicPartNum, editGroupPartNum } from '@/api/BasicData/PartsNumberMaintenance'
import { alldeleteWB, alldelete, machineSelect, groupSelect, basicPartsData, deleteBasicParts, deleteBasicParts5, deleteBasicParts6, alldeleteBasicParts5, alldeleteBasicParts6, purchasePartsData, deletePurchaseData, editPurchaseData, editBasicParts, getTable, editProductNum, getTable1, editProduceNum, searchTable1, searchTable2, searchTable5, searchTable6, editGroupBasicPartNum, editGroupPartNum } from '@/api/BasicData/PartsNumberMaintenance'
export default {
name: 'Index',
data() {
return {
activeName: '1',
projectValue: '',
projectName: '',
BasicParts: '',
PurchaseData: '',
@@ -662,7 +653,6 @@ export default {
groupPartNum: '',
groupBasicPartNum: '',
type: '',
project: [],
machineValue: '',
machineName: '',
machine: [],
@@ -685,7 +675,6 @@ export default {
tableData4: [],
tableData5: [],
tableData6: [],
tableData7: [],
tableDataWB: [],
// pageCurrent: 1,
// pageSize: 10,
@@ -725,25 +714,6 @@ export default {
}
},
watch: {
project(val) {
if (val.length > 0) {
this.projectValue = val[0].value
}
},
projectValue(val) {
for (let i = 0; i < this.project.length; i++) {
if (this.project[i].value === this.projectValue) {
this.projectName = this.project[i].label
}
}
this.machineValue = ''
this.machine = []
this.groupValue = ''
this.group = []
if (val) {
this.getMachineSelect(val)
}
},
machine(val) {
if (val.length > 0) {
this.machineValue = val[0].value
@@ -755,6 +725,12 @@ export default {
}
},
machineValue(val) {
for (let i = 0; i < this.machine.length; i++) {
if (val === this.machine[i].value) {
this.machineName = this.machine[i].label
}
}
console.log(val, 11, this.machineName)
this.groupValue = ''
this.group = []
if (val) {
@@ -788,10 +764,8 @@ export default {
},
methods: {
fetchData() {
this.getSelect(projectSelect, ['项目名称', '项目流水号'], 'project')
},
getMachineSelect(val) {
this.getSelect(machineSelect, ['机床图号', '机床流水号'], 'machine', val)
this.getSelect(machineSelect, ['机床图号', '机床流水号'], 'machine')
console.log(this.machine)
},
getGroupSelect(val) {
this.getSelect(groupSelect, ['组号', '组件流水号'], 'group', val)
@@ -867,11 +841,10 @@ export default {
})
},
getTableData() {
const project_check = this.projectValue ? 1 : 0
const machine_check = this.machineValue ? 1 : 0
const group_check = this.groupValue ? 1 : 0
this.loading = true
basicPartsData(project_check, this.projectValue, machine_check, this.machineValue, group_check, this.groupValue).then(response => {
basicPartsData(machine_check, this.machineValue, group_check, this.groupValue).then(response => {
this.loading = false
const res = response.data
this.total = res.total
@@ -959,59 +932,44 @@ export default {
})
},
searchTable1() { // 查询标准件和外购件
let check0, check1, check2
this.projectValue ? check2 = 1 : check2 = 0
let check0, check1
this.machineValue ? check0 = 1 : check0 = 0
this.groupValue ? check1 = 1 : check1 = 0
searchTable1(check2, this.projectValue, check0, this.machineValue, check1, this.groupValue).then(response => {
searchTable1(check0, this.machineValue, check1, this.groupValue).then(response => {
this.tableData3 = response.data
this.total3 = response.data.total
})
},
searchTable2() { // 查询基本件
let check0, check1, check2
this.projectValue ? check2 = 1 : check2 = 0
let check0, check1
this.machineValue ? check0 = 1 : check0 = 0
this.groupValue ? check1 = 1 : check1 = 0
searchTable2(check2, this.projectValue, check0, this.machineValue, check1, this.groupValue).then(response => {
searchTable2(check0, this.machineValue, check1, this.groupValue).then(response => {
this.tableData4 = response.data
this.total4 = response.data.total
})
},
searchTable5() { // 查询标准件
let check0, check1, check2
this.projectName ? check2 = 1 : check2 = 0
let check0, check1
this.machineName ? check0 = 1 : check0 = 0
this.groupName ? check1 = 1 : check1 = 0
searchTable5(check2, this.projectName, check0, this.machineName, check1, this.groupName).then(response => {
searchTable5(check0, this.machineName, check1, this.groupName).then(response => {
console.log(response, 5, this.activeName)
this.tableData5 = response.data
this.total5 = response.data.total
})
},
searchTable6() { // 查询基本件
let check0, check1, check2
this.projectName ? check2 = 1 : check2 = 0
let check0, check1
this.machineName ? check0 = 1 : check0 = 0
this.groupName ? check1 = 1 : check1 = 0
// console.log(this.projectName, this.machineName, this.groupName, 44)
searchTable6(check2, this.projectName, check0, this.machineName, check1, this.groupName).then(response => {
searchTable6(check0, this.machineName, check1, this.groupName).then(response => {
console.log(response, 6)
this.tableData6 = response.data
this.total6 = response.data.total
})
},
searchTable7() { // 查询外购件
let check0, check1, check2
this.projectName ? check2 = 1 : check2 = 0
this.machineName ? check0 = 1 : check0 = 0
this.groupName ? check1 = 1 : check1 = 0
searchTable7(this.pageCurrent7, this.pageSize7, check2, this.projectName, check0, this.machineName, check1, this.groupName).then(response => {
console.log(response, 7)
this.tableData7 = response.data.rows
this.total7 = response.data.total
})
},
handleEdit(row) {
this.BasicParts = ''
this.PurchaseData = ''
@@ -1125,7 +1083,7 @@ export default {
this.searchTable6()
})
}
},
}
// handleSizeChanges(val) {
// this.pageCurrent = 1
// this.pageSize = val
@@ -1198,15 +1156,6 @@ export default {
// this.pageCurrent6 = val
// this.searchTable6()
// },
handleSizeChange7(val) {
this.pageSize7 = val
this.pageCurrent7 = 1
this.searchTable7()
},
handleCurrentChange7(val) {
this.pageCurrent7 = val
this.searchTable7()
}
}
}
</script>

View File

@@ -11,15 +11,6 @@
<el-tooltip :open-delay="1200" effect="dark" content="将所有机床零件入库" placement="top">
<el-button type="warning" size="small" class="el-icon-success" style="margin: 0 0 0 10px" plain @click="Innumber">入库</el-button>
</el-tooltip>
<el-tooltip :open-delay="1200" effect="dark" content="清除该条零件信息" placement="top">
<el-button
size="small"
type="danger"
style="float: right; margin-right: 10px;margin-top: 12px"
plain
class="el-icon-delete"
@click="handleDelete()">移除</el-button>
</el-tooltip>
</el-row>
</el-card>
@@ -27,7 +18,6 @@
<el-table
v-loading="listLoading"
:data="tableDataNum"
:row-class-name="tableRowClassName"
stripe
highlight-current-row
border
@@ -80,6 +70,16 @@
<el-input v-model="tableData[scope.$index].note" clearable size="mini"/>
</template>
</el-table-column>
<el-table-column label="操作" min-width="100" align="center">
<template slot-scope="scope">
<el-button
:disabled="scope.row.是否禁用"
size="mini"
type="danger"
class="el-icon-delete"
@click="handleDelete(scope.$index, scope.row)">移除</el-button>
</template>
</el-table-column>
</el-table>
</el-card>
</div>
@@ -122,17 +122,9 @@ export default {
},
methods: {
// 移除
handleDelete() {
this.tableDataNum.splice(this.NUM, 1)
this.tableData.splice(this.NUM, 1)
this.NUM = ''
},
tableRowClassName({ row, rowIndex }) {
console.log(rowIndex)
this.NUM = rowIndex
},
searchData(index) {
this.NUM = index
handleDelete(index, row) {
this.tableDataNum.splice(index, 1)
this.tableData.splice(index, 1)
},
// 获取人员编号
getpeopleid() {

View File

@@ -0,0 +1,159 @@
<template>
<div class="app-container">
<el-card>
<el-date-picker
v-model="startTime"
size="small"
type="daterange"
align="center"
value-format="yyyy-MM-dd"
format="yyyy-MM-dd"
range-separator=""
style="width:250px;margin-left: 5px;margin-top: 10px;margin-bottom: 10px"
start-placeholder="开始日期"
end-placeholder="结束日期"/>
<el-button size="small" type="success" icon="el-icon-search" style="margin-left: 5px" @click="searchTable">查询</el-button>
<el-button size="small" type="primary" icon="el-icon-download" @click="exportExcel">导出</el-button>
</el-card>
<el-card>
<el-table :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">
<template slot-scope="scope">
{{ scope.row.零件图号_短 }}
</template>
</el-table-column>
<el-table-column align="center" label="跟单号" width="120px">
<template slot-scope="scope">
{{ scope.row.跟单号 }}
</template>
</el-table-column>
<el-table-column align="center" label="序号" width="50px">
<template slot-scope="scope">
{{ scope.row.工序顺序 }}
</template>
</el-table-column>
<el-table-column align="center" label="工序名称" width="80px">
<template slot-scope="scope">
{{ scope.row.工艺名称 }}
</template>
</el-table-column>
<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">
<template slot-scope="scope">
{{ scope.row.设备工时 }}
</template>
</el-table-column>
<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">
<template slot-scope="scope">
{{ scope.row.不合格数 }}
</template>
</el-table-column>
<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">
<template slot-scope="scope">
{{ scope.row.操作时间 }}
</template>
</el-table-column>
<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">
<template slot-scope="scope">
{{ scope.row.单件定额工时 }}
</template>
</el-table-column>
<el-table-column align="center" label="项目名称" width="130px">
<template slot-scope="scope">
{{ scope.row.项目名称 }}
</template>
</el-table-column>
<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">
<template slot-scope="scope">
{{ scope.row.组号 }}
</template>
</el-table-column>
<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="100px">
<template slot-scope="scope">
{{ scope.row.材料 }}
</template>
</el-table-column>
</el-table>
</el-card>
</div>
</template>
<script>
import { searchTable } from '@/api/ManufacturingCenter/MonthEndHourAccounting'
export default {
data() {
return {
tableData: [],
startTime: ''
}
},
methods: {
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'
})
})
},
searchTable() {
if (this.startTime[0] && this.startTime[1]) {
searchTable(this.startTime[0], this.startTime[1]).then(response => {
this.tableData = response.data
})
} else {
this.$message.warning('请选择时间段')
}
}
}
}
</script>

File diff suppressed because it is too large Load Diff

View File

@@ -404,7 +404,6 @@
size="mini"
style="width: 97%;max-height: 300px"
height="400"
stripe
highlight-current-row
border>
<el-table-column align="center" label="零件图号">
@@ -476,7 +475,6 @@
size="mini"
style="width: 97%;max-height: 300px"
height="400"
stripe
highlight-current-row
border>
<el-table-column align="center" label="物料名称">

View File

@@ -17,24 +17,11 @@
type="date"
placeholder="选择加工完成日期"/>
<el-button type="success" class="el-icon-search" size="small" style="margin:0px 10px" @click="pageCurrent=1;total = 0;searchTable();">查询</el-button>
<!-- <el-tooltip :open-delay="1000" content="导出人员工时统计表" placement="right">-->
<!-- <el-button type="primary" size="small" icon="el-icon-download" style="margin:0px 10px" @click="exportUninquirySheet1()">导出</el-button>-->
<!-- </el-tooltip>-->
</el-card>
<el-row>
<el-col style="width: 350px">
<el-col :span="9">
<el-card>
<el-table
v-loading="loading"
:data="tableData"
highlight-current-row
size="mini"
stripe
style="width: 100%;"
height="700px"
border
element-loading-text="拼命加载中"
@row-click="searchTable2">
<el-table v-loading="loading" :data="tableData" highlight-current-row size="mini" style="width: 100%;" height="700px" border element-loading-text="拼命加载中" @row-click="searchTable2">
<el-table-column label="操作者" align="center" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.姓名 }}
@@ -42,17 +29,27 @@
</el-table-column>
<el-table-column label="计划工时" align="center" width="70px">
<template slot-scope="scope">
{{ scope.row.理论加工时间段 }}
{{ scope.row.定额总工时 }}
</template>
</el-table-column>
<el-table-column label="实际工时" align="center" width="70px">
<template slot-scope="scope">
{{ scope.row.设备工时 }}
{{ scope.row.设备工时 }}
</template>
</el-table-column>
<el-table-column label="录入准结工时" align="center" width="100px">
<template slot-scope="scope">
{{ scope.row.修补准结总工时 }}
</template>
</el-table-column>
<el-table-column label="完成数量" align="center" width="70px">
<template slot-scope="scope">
{{ scope.row.完成数量 }}
{{ scope.row.数量 }}
</template>
</el-table-column>
<el-table-column label="扫码工时" align="center" width="70px">
<template slot-scope="scope">
{{ scope.row.扫码总工时 }}
</template>
</el-table-column>
</el-table>
@@ -66,9 +63,9 @@
</div>
</el-card>
</el-col>
<el-col style="margin-left: 0px;width: 860px">
<el-col :span="15">
<el-card>
<el-table v-loading="loading2" :data="tableData2" size="mini" stripe highlight-current-row style="width: 100%;" height="700px" border element-loading-text="拼命加载中">
<el-table v-loading="loading2" :data="tableData2" size="mini" stripe style="width: 100%;" height="700px" border element-loading-text="拼命加载中">
<el-table-column label="零件图号" align="center" width="140px" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.零件图号 }}
@@ -89,34 +86,29 @@
{{ scope.row.完成数量 }}
</template>
</el-table-column>
<el-table-column label="序间质检" align="center" width="70px">
<template slot-scope="scope">
{{ scope.row.质检结果 }}
</template>
</el-table-column>
<!--<el-table-column label="不合格数" align="center" width="70px">-->
<!--<template slot-scope="scope">-->
<!--{{ scope.row.不合格数量 }}-->
<!--</template>-->
<!--</el-table-column>-->
<el-table-column label="计划工时" align="center" width="70px">
<template slot-scope="scope">
{{ scope.row.理论加工时间段 }}
{{ scope.row.工时总额 }}
</template>
</el-table-column>
<el-table-column label="加工工时" align="center" width="70px">
<el-table-column label="实际工时" align="center" width="70px">
<template slot-scope="scope">
{{ scope.row.设备工时 ? scope.row.设备工时 : 0 }}
{{ scope.row.设备工时 }}
</template>
</el-table-column>
<el-table-column label="加工开始" align="center" width="135px">
<el-table-column label="录入准结工时" align="center" width="100px">
<template slot-scope="scope">
{{ scope.row.加工开始时间 }}
{{ scope.row.修补准结工时 }}
</template>
</el-table-column>
<el-table-column label="加工完成" align="center" width="135px">
<el-table-column label="加工时间" align="center" width="135px">
<template slot-scope="scope">
{{ scope.row.加工完成时间 }}
{{ scope.row.操作时间 }}
</template>
</el-table-column>
<el-table-column label="扫码工时" align="center" width="70px">
<template slot-scope="scope">
{{ scope.row.扫码工时 }}
</template>
</el-table-column>
</el-table>
@@ -168,12 +160,8 @@ export default {
this.tableData = []
this.tableData2 = []
this.total2 = 0
if (this.startTime !== '' && this.startTime !== null && this.endTime !== null && this.endTime !== null) {
this.timeCheck = 1
} else {
this.timeCheck = 0
}
searchtable(this.operater, this.timeCheck, this.startTime, this.endTime, this.pageCurrent, this.pageSize).then(response => {
searchtable(this.startTime, this.endTime, this.pageCurrent, this.pageSize).then(response => {
console.log(response.data, 111)
if (response.data.total === 0) {
this.loading = false
} else {
@@ -188,23 +176,10 @@ export default {
this.loading2 = true
this.tableData2 = []
this.pageCurrent2 = 1
searchtable2(row.人员编号, this.timeCheck, this.startTime, this.endTime, this.pageCurrent2, this.pageSize2).then(response => {
searchtable2(row.人员编号, this.startTime, this.endTime, this.pageCurrent2, this.pageSize2).then(response => {
console.log(response.data, 222)
if (response.data.rows.length !== 0) {
for (let i = 0; i < response.data.rows.length; i++) {
this.tableData2.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].设备工时,
不合格数量: response.data.rows[i].不合格数量,
理论加工时间段: 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.tableData2 = response.data.rows
}
this.loading2 = false
this.total2 = response.data.total

View File

@@ -653,7 +653,7 @@ export default {
物料型号: '',
计量单位流水号: '',
物料来源流水号: '',
GonghuoshangValue: ''
GonghuoshangValue: 1
},
rules: {
物料名称: [{ required: true, message: '请输入物料名称', trigger: 'blur' }],

View File

@@ -22,6 +22,17 @@
<el-input v-model="Name" placeholder="名称规格型号" size="small" clearable/>
<!-- <el-input v-model="spec" placeholder="规格" size="small" clearable/>-->
<!-- <el-input v-model="model" placeholder="型号" size="small" clearable/>-->
<el-date-picker
v-model="startTime"
size="small"
type="daterange"
align="center"
value-format="yyyy-MM-dd"
format="yyyy-MM-dd"
range-separator=""
style="width:250px;margin-left: 5px"
start-placeholder="开始日期"
end-placeholder="结束日期"/>
<el-button type="success" size="small" icon="el-icon-search" style="margin-left: 15px" @click="searchTable()">查询</el-button>
<el-tooltip :open-delay="1000" effect="dark" content="将全部采购件导出到表格" placement="top">
<el-button type="warning" size="small" icon="el-icon-download" style="margin-left: 15px" @click="exportDetail()">导出</el-button>
@@ -116,6 +127,11 @@
{{ scope.row.备注 || '—' }}
</template>
</el-table-column>
<el-table-column align="center" label="下达任务时间" min-width="100px" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.操作日期 ? scope.row.操作日期.split(' ')[0] : '-' }}
</template>
</el-table-column>
</el-table>
<div class="block">
<el-pagination
@@ -215,6 +231,11 @@
{{ scope.row.备注 || '—' }}
</template>
</el-table-column>
<el-table-column align="center" label="下达任务时间" min-width="100px" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.操作日期 ? scope.row.操作日期.split(' ')[0] : '-' }}
</template>
</el-table-column>
</el-table>
<div class="block">
<el-pagination
@@ -321,6 +342,11 @@
{{ scope.row.备注 || '—' }}
</template>
</el-table-column>
<el-table-column align="center" label="下达任务时间" min-width="100px" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.操作日期 ? scope.row.操作日期.split(' ')[0] : '-' }}
</template>
</el-table-column>
</el-table>
<div class="block">
<el-pagination
@@ -345,6 +371,7 @@ export default {
name: '', // 采购件采购查询
data() {
return {
startTime: '',
Name: '',
spec: '',
model: '',
@@ -381,17 +408,18 @@ export default {
methods: {
// 导出采购物料执行情况
exportDetail() {
let check1, check2
let check1, check2, check3
this.machineNumberValue ? check1 = 1 : check1 = 0
this.groupNumberValue ? check2 = 1 : check2 = 0
searchTable1Export(check1, this.machineNumberValue, check2, this.groupNumberValue, 1).then(res1 => { // 标准件
searchTable1Export(check1, this.machineNumberValue, check2, this.groupNumberValue, 2).then(res2 => { // 外购
searchTable2Export(check1, this.machineNumberValue, check2, this.groupNumberValue).then(res3 => { // 基本
this.startTime ? check3 = 1 : (check3 = 0, this.startTime = '')
searchTable1Export(check1, this.machineNumberValue, check2, this.groupNumberValue, 1, check3, this.startTime[0], this.startTime[1]).then(res1 => { // 标准
searchTable1Export(check1, this.machineNumberValue, check2, this.groupNumberValue, 2, check3, this.startTime[0], this.startTime[1]).then(res2 => { // 外购
searchTable2Export(check1, this.machineNumberValue, check2, this.groupNumberValue, check3, this.startTime[0], this.startTime[1]).then(res3 => { // 基本件
import('./Export2Excel').then(excel => {
const dataGroup = []
const filterVal1 = ['机床图号', '组号', '物料名称', '物料型号', '物料规格', '零件数量', ['数量', '离线采购数量'], ['已到货数量', '离线到货数量'], ['供应商名称', '离线合同供应商名称'], ['采购合同编号', '离线合同编号'], '姓名', '供货商', '备注'] // tableData0里的属性名
const filterVal2 = ['机床图号', '组号', '物料名称', '物料型号', '物料规格', '零件数量', ['数量', '离线采购数量'], ['已到货数量', '离线到货数量'], ['供应商名称', '离线合同供应商名称'], ['采购合同编号', '离线合同编号'], '姓名', '供货商', '备注'] // tableData1里的属性名
const filterVal3 = ['机床图号', '组号', '零件名称', '零件图号', '规格', '材料', '零件数量', '数量', '已到货数量', '供应商名称', '采购合同编号', '姓名', '供货商', '备注'] // tableData2里的属性名
const filterVal1 = ['机床图号', '组号', '物料名称', '物料型号', '物料规格', '零件数量', ['数量', '离线采购数量'], ['已到货数量', '离线到货数量'], ['供应商名称', '离线合同供应商名称'], ['采购合同编号', '离线合同编号'], '姓名', '供货商', '操作日期', '备注'] // tableData0里的属性名
const filterVal2 = ['机床图号', '组号', '物料名称', '物料型号', '物料规格', '零件数量', ['数量', '离线采购数量'], ['已到货数量', '离线到货数量'], ['供应商名称', '离线合同供应商名称'], ['采购合同编号', '离线合同编号'], '姓名', '供货商', '操作日期', '备注'] // tableData1里的属性名
const filterVal3 = ['机床图号', '组号', '零件名称', '零件图号', '规格', '材料', '零件数量', '数量', '已到货数量', '供应商名称', '采购合同编号', '姓名', '供货商', '操作日期', '备注'] // tableData2里的属性名
const data1 = res1.data.map(v => filterVal1.map(j => {
if (typeof (j) === 'string') {
return v[j] || '—'
@@ -402,13 +430,13 @@ export default {
data1.map(v => {
v.push('') // 物料状态
if (v[10] === '—') {
v[13] = '未分配'
v[14] = '未分配'
} else if (v[6] === '—') {
v[13] = '未采购'
v[14] = '未采购'
} else if (v[6] !== '—' && v[6] !== v[7]) {
v[13] = '未全部到货'
v[14] = '未全部到货'
} else if (v[6] !== '—' && v[6] === v[7]) {
v[13] = '全部到货'
v[14] = '全部到货'
}
})
dataGroup.push(data1)
@@ -422,13 +450,13 @@ export default {
data2.map(v => {
v.push('') // 物料状态
if (v[10] === '—') {
v[13] = '未分配'
v[14] = '未分配'
} else if (v[6] === '—') {
v[13] = '未采购'
v[14] = '未采购'
} else if (v[6] !== '—' && v[6] !== v[7]) {
v[13] = '未全部到货'
v[14] = '未全部到货'
} else if (v[6] !== '—' && v[6] === v[7]) {
v[13] = '全部到货'
v[14] = '全部到货'
}
})
dataGroup.push(data2)
@@ -442,19 +470,19 @@ export default {
data3.map(v => {
v.push('') // 物料状态
if (v[11] === '—') {
v[14] = '未分配'
v[15] = '未分配'
} else if (v[7] === '—') {
v[14] = '未采购'
v[15] = '未采购'
} else if (v[7] !== '—' && v[7] !== v[8]) {
v[14] = '未全部到货'
v[15] = '未全部到货'
} else if (v[7] !== '—' && v[7] === v[8]) {
v[14] = '全部到货'
v[15] = '全部到货'
}
})
dataGroup.push(data3)
const headerGroup = [['机床号', '组号', '名称', '图号或型号', '规格', '技术下达数量', '合同采购数量', '到货数量', '供应商', '合同编号', '采购员', '供货商', '备注', '物料状态'],
['机床号', '组号', '名称', '图号或型号', '规格', '技术下达数量', '合同采购数量', '到货数量', '供应商', '合同编号', '采购员', '供货商', '备注', '物料状态'],
['机床号', '组号', '名称', '图号或型号', '规格', '材料', '技术下达数量', '合同采购数量', '到货数量', '供应商', '合同编号', '采购员', '供货商', '备注', '物料状态']]
const headerGroup = [['机床号', '组号', '名称', '图号或型号', '规格', '技术下达数量', '合同采购数量', '到货数量', '供应商', '合同编号', '采购员', '供货商', '下达任务时间', '备注', '物料状态'],
['机床号', '组号', '名称', '图号或型号', '规格', '技术下达数量', '合同采购数量', '到货数量', '供应商', '合同编号', '采购员', '供货商', '下达任务时间', '备注', '物料状态'],
['机床号', '组号', '名称', '图号或型号', '规格', '材料', '技术下达数量', '合同采购数量', '到货数量', '供应商', '合同编号', '采购员', '供货商', '下达任务时间', '备注', '物料状态']]
const sheetGroup = ['标准件', '外购件', '基本件']
excel.export_json_to_excel({
headerGroup: headerGroup,
@@ -529,13 +557,15 @@ export default {
this.searchTable2()
},
searchTable0() { // 查询标准件
let check1, check2, check3, check4, check5
this.tableData0 = []
let check1, check2, check3, check4, check5, check6
this.machineNumberValue ? check1 = 1 : check1 = 0
this.groupNumberValue ? check2 = 1 : check2 = 0
this.Name ? check3 = 1 : check3 = 0
this.spec ? check4 = 1 : check4 = 0
this.model ? check5 = 1 : check5 = 0
searchTable1(check1, this.machineNumberValue, check2, this.groupNumberValue, this.pageCurrent0, this.pageSize0, 1, check3, this.Name, check4, this.spec, check5, this.model).then(response => {
this.startTime ? check6 = 1 : (check6 = 0, this.startTime = '')
searchTable1(check1, this.machineNumberValue, check2, this.groupNumberValue, this.pageCurrent0, this.pageSize0, 1, check3, this.Name, check4, this.spec, check5, this.model, check6, this.startTime[0], this.startTime[1]).then(response => {
console.log(this.tableData0)
if (response.data.rows.length !== 0) {
for (let i = 0; i < response.data.rows.length; i++) {
@@ -561,7 +591,8 @@ export default {
备注: response.data.rows[i].备注,
采购数量: Number(response.data.rows[i].询价状态编号) === 1 && response.data.rows[i].人员编号 !== '' ? '—' : response.data.rows[i].数量 || response.data.rows[i].离线采购数量 || '—',
到货数量: Number(response.data.rows[i].询价状态编号) === 1 && response.data.rows[i].人员编号 !== '' ? '—' : response.data.rows[i].已到货数量 || response.data.rows[i].离线到货数量 || '—',
不合格数量: response.data.rows[i].不合格数量
不合格数量: response.data.rows[i].不合格数量,
操作日期: response.data.rows[i].操作日期
})
}
}
@@ -569,13 +600,15 @@ export default {
})
},
searchTable1() { // 查询外购件
let check1, check2, check3, check4, check5
this.tableData1 = []
let check1, check2, check3, check4, check5, check6
this.machineNumberValue ? check1 = 1 : check1 = 0
this.groupNumberValue ? check2 = 1 : check2 = 0
this.Name ? check3 = 1 : check3 = 0
this.spec ? check4 = 1 : check4 = 0
this.model ? check5 = 1 : check5 = 0
searchTable1(check1, this.machineNumberValue, check2, this.groupNumberValue, this.pageCurrent1, this.pageSize1, 2, check3, this.Name, check4, this.spec, check5, this.model).then(response => {
this.startTime ? check6 = 1 : (check6 = 0, this.startTime = '')
searchTable1(check1, this.machineNumberValue, check2, this.groupNumberValue, this.pageCurrent1, this.pageSize1, 2, check3, this.Name, check4, this.spec, check5, this.model, check6, this.startTime[0], this.startTime[1]).then(response => {
this.total1 = response.data.total
if (response.data.rows.length !== 0) {
for (let i = 0; i < response.data.rows.length; i++) {
@@ -601,7 +634,8 @@ export default {
备注: response.data.rows[i].备注,
采购数量: Number(response.data.rows[i].询价状态编号) === 1 && response.data.rows[i].人员编号 !== '' ? '—' : response.data.rows[i].数量 || response.data.rows[i].离线采购数量 || '—',
到货数量: Number(response.data.rows[i].询价状态编号) === 1 && response.data.rows[i].人员编号 !== '' ? '—' : response.data.rows[i].已到货数量 || response.data.rows[i].离线到货数量 || '—',
不合格数量: response.data.rows[i].不合格数量
不合格数量: response.data.rows[i].不合格数量,
操作日期: response.data.rows[i].操作日期
})
}
}
@@ -609,13 +643,14 @@ export default {
})
},
searchTable2() { // 查询基本件
let check1, check2, check3, check4, check5
let check1, check2, check3, check4, check5, check6
this.machineNumberValue ? check1 = 1 : check1 = 0
this.groupNumberValue ? check2 = 1 : check2 = 0
this.Name ? check3 = 1 : check3 = 0
this.spec ? check4 = 1 : check4 = 0
this.model ? check5 = 1 : check5 = 0
searchTable2(check1, this.machineNumberValue, check2, this.groupNumberValue, this.pageCurrent2, this.pageSize2, check3, this.Name, check4, this.spec, check5, this.model).then(response => {
this.startTime ? check6 = 1 : (check6 = 0, this.startTime = '')
searchTable2(check1, this.machineNumberValue, check2, this.groupNumberValue, this.pageCurrent2, this.pageSize2, check3, this.Name, check4, this.spec, check5, this.model, check6, this.startTime[0], this.startTime[1]).then(response => {
this.tableData2 = response.data.rows
this.total2 = response.data.total
})