This commit is contained in:
liushuai
2020-03-26 18:31:59 +08:00
parent 6480d06063
commit 7317c3d73e
11 changed files with 326 additions and 191 deletions

View File

@@ -32,14 +32,14 @@
</el-card>
<el-tabs type="border-card" @tab-click="selectPart">
<el-tab-pane label="基本件">
<el-table :data="tableData1" :row-class-name="tableRowClassName1" stripe border size="mini" style="width: 100%" height="300px" @selection-change="handleSelectionChange">
<el-table :data="tableData1" :row-class-name="tableRowClassName1" stripe border size="mini" style="width: 1160px" height="300px" @selection-change="handleSelectionChange">
<el-table-column align="center" width="50" type="selection"/>
<el-table-column label="零件名称" align="center" min-width="140px" show-overflow-tooltip>
<el-table-column label="零件名称" align="center" width="140px" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.零件名称 }}
</template>
</el-table-column>
<el-table-column label="零件图号" align="center" min-width="120px" show-overflow-tooltip>
<el-table-column label="零件图号" align="center" width="120px" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.零件图号 }}
</template>
@@ -69,19 +69,19 @@
{{ scope.row.总数量 }}
</template>
</el-table-column>
<el-table-column label="投产总数量" align="center" width="150px">
<el-table-column label="投产总数量" align="center" width="120px">
<template slot-scope="scope">
<el-input-number v-model="scope.row.投产总数量" :min="0" size="mini" style="width: 100%"/>
<el-input-number v-model="scope.row.投产总数量" :min="0" size="mini" style="width: 95px"/>
</template>
</el-table-column>
<el-table-column label="备注" align="center" min-width="90px">
<el-table-column label="备注" align="center" width="90px">
<template slot-scope="scope">
{{ scope.row.零件备注 }}
</template>
</el-table-column>
<el-table-column label="操作" align="center" width="100px">
<template slot-scope="scope">
<el-button type="text" size="mini" icon="el-icon-right" @click="OutParts(scope.row)">移出</el-button>
<el-button type="text" size="mini" icon="el-icon-right" plain @click="OutParts(scope.row)">移出</el-button>
</template>
</el-table-column>
</el-table>
@@ -89,22 +89,22 @@
<el-tab-pane label="外购件">
<el-table :data="tableData2" 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" min-width="120">
<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="120">
<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="120">
<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="120">
<el-table-column label="物料型号" align="center" width="120">
<template slot-scope="scope">
{{ scope.row.物料型号 }}
</template>
@@ -124,12 +124,12 @@
{{ scope.row.总数量 }}
</template>
</el-table-column>
<el-table-column label="采购总数量" align="center" width="150px">
<el-table-column label="采购总数量" align="center" width="135px">
<template slot-scope="scope">
<el-input-number v-model="scope.row.采购总数量" :min="0" size="mini" style="width: 100%"/>
</template>
</el-table-column>
<el-table-column label="备注" align="center" min-width="120">
<el-table-column label="备注" align="center" width="120">
<template slot-scope="scope">
{{ scope.row.备注 }}
</template>
@@ -139,22 +139,22 @@
<el-tab-pane label="标准件">
<el-table :data="tableData3" 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" min-width="120">
<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="120">
<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="120">
<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="120">
<el-table-column label="物料型号" align="center" width="120">
<template slot-scope="scope">
{{ scope.row.物料型号 }}
</template>
@@ -174,12 +174,12 @@
{{ scope.row.总数量 }}
</template>
</el-table-column>
<el-table-column label="采购总数量" align="center" width="150px">
<el-table-column label="采购总数量" align="center" width="115px">
<template slot-scope="scope">
<el-input-number v-model="scope.row.采购总数量" :min="0" size="mini" style="width: 100%"/>
<el-input-number v-model="scope.row.采购总数量" :min="0" size="mini" style="width: 90px"/>
</template>
</el-table-column>
<el-table-column label="备注" align="center" min-width="120">
<el-table-column label="备注" align="center" width="120">
<template slot-scope="scope">
{{ scope.row.备注 }}
</template>
@@ -211,10 +211,10 @@
</el-card>
<el-card style="padding: 3px;">
<el-row>
<el-input v-model="PurchaseOrder" size="small" style="width: 155px" placeholder="请购单号" clearable/>
<el-input v-model="PurchaseOrder" size="small" style="width: 155px" placeholder="请购单号" clearable @change="searchTable1"/>
<el-button icon="el-icon-search" type="primary" size="mini" style="margin-left: 10px" plain @click="searchTable1()">查询</el-button>
<el-button icon="el-icon-circle-plus-outline" type="warning" size="mini" style="margin-left: 10px" plain @click="handleAdd()">请购单</el-button>
<el-button icon="el-icon-delete" type="danger" size="mini" style="margin-left: 10px" plain @click="handleDelete()">删除</el-button>
<el-button icon="el-icon-delete" type="info" size="mini" style="margin-left: 50px" plain @click="handleDelete()">删除</el-button>
<el-button icon="el-icon-bottom" type="success" plain size="mini" @click="exportExcel()">导出</el-button>
</el-row>
</el-card>
@@ -301,7 +301,7 @@
</el-tooltip>
<el-tooltip :open-delay="1200" effect="dark" content="移出" placement="top">
<div style="display: inline-block">
<el-button type="text" size="mini" icon="el-icon-right" @click="MoveOut(scope.row)"/>
<el-button type="text" size="mini" icon="el-icon-delete" @click="MoveOut(scope.row)"/>
</div>
</el-tooltip>
</template>
@@ -325,6 +325,17 @@
readonly
style="width:160px;"/>
</el-form-item>
<el-form-item label="请购时间" prop="请购时间">
<el-date-picker
v-model="form.请购时间"
size="small"
type="date"
format="yyyy-MM-dd"
value-format="yyyy-MM-dd"
style="width: 160px"
placeholder="选择日期"/>
</el-form-item>
<el-form-item label="备注">
<el-input
v-model="form.Remarks"
@@ -369,9 +380,21 @@
center
width="70%"
style="min-height: 400px">
<el-input v-model="partNumber" size="small" placeholder="零件图号及名称" style="width: 200px" clearable @change="PartCallbackInformation"/>
<el-date-picker
v-model="dateRange"
type="daterange"
size="small"
format="yyyy-MM-dd"
value-format="yyyy-MM-dd"
range-separator="~"
style="width:240px;margin-left: 10px"
start-placeholder="开始日期"
end-placeholder="结束日期"
@change="PartCallbackInformation"/>
<!-- :row-class-name="tableRowClassName"-->
<el-table
:data="tableData9"
:row-class-name="tableRowClassName"
size="mini"
style="width: 97%;max-height: 300px"
height="400"
@@ -392,7 +415,7 @@
{{ scope.row.材料 }}
</template>
</el-table-column>
<el-table-column align="center" label="零件数量" width="70">
<el-table-column align="center" label="零件数量" width="80">
<template slot-scope="scope">
{{ scope.row.零件数量 }}
</template>
@@ -417,20 +440,20 @@
{{ scope.row.退回时间 }}
</template>
</el-table-column>
<el-table-column property="date" label="操作" width="200" align="center">
<template slot-scope="scope">
<el-button
size="mini"
type="success"
plain
@click="submit(scope.row)">确认</el-button>
<el-button
size="mini"
type="danger"
plain
@click="Delete(scope.row)">删除</el-button>
</template>
</el-table-column>
<!-- <el-table-column property="date" label="操作" width="200" align="center">-->
<!-- <template slot-scope="scope">-->
<!-- <el-button-->
<!-- size="mini"-->
<!-- type="success"-->
<!-- plain-->
<!-- @click="submit(scope.row)">确认</el-button>-->
<!-- <el-button-->
<!-- size="mini"-->
<!-- type="danger"-->
<!-- plain-->
<!-- @click="Delete(scope.row)">删除</el-button>-->
<!-- </template>-->
<!-- </el-table-column>-->
</el-table>
</el-dialog>
<el-dialog
@@ -440,9 +463,21 @@
center
width="70%"
style="min-height: 400px">
<el-input v-model="partNumber1" size="small" placeholder="零件图号及名称" style="width: 200px" clearable @change="PartCallbackInformation1"/>
<el-date-picker
v-model="dateRange1"
type="daterange"
size="small"
format="yyyy-MM-dd"
value-format="yyyy-MM-dd"
range-separator="~"
style="width:240px;margin-left: 10px"
start-placeholder="开始日期"
end-placeholder="结束日期"
@change="PartCallbackInformation1"/>
<!-- :row-class-name="tableRowClassName"-->
<el-table
:data="tableData10"
:row-class-name="tableRowClassName"
size="mini"
style="width: 97%;max-height: 300px"
height="400"
@@ -488,20 +523,20 @@
{{ scope.row.退回时间 }}
</template>
</el-table-column>
<el-table-column property="date" label="操作" width="200" align="center">
<template slot-scope="scope">
<el-button
size="mini"
type="success"
plain
@click="submit1(scope.row)">确认</el-button>
<el-button
size="mini"
type="danger"
plain
@click="Delete1(scope.row)">删除</el-button>
</template>
</el-table-column>
<!-- <el-table-column property="date" label="操作" width="200" align="center">-->
<!-- <template slot-scope="scope">-->
<!-- <el-button-->
<!-- size="mini"-->
<!-- type="success"-->
<!-- plain-->
<!-- @click="submit1(scope.row)">确认</el-button>-->
<!-- <el-button-->
<!-- size="mini"-->
<!-- type="danger"-->
<!-- plain-->
<!-- @click="Delete1(scope.row)">删除</el-button>-->
<!-- </template>-->
<!-- </el-table-column>-->
</el-table>
</el-dialog>
</div>
@@ -515,6 +550,10 @@ export default {
inject: ['reload'],
data() {
return {
dateRange: '',
partNumber: '',
dateRange1: '',
partNumber1: '',
DeliveryTime: '', // 三表下达时间
projectFloatValue: '',
machineNumberValue: '',
@@ -665,35 +704,43 @@ export default {
})
}
})
PartCallbackInformation().then(response => {
for (let i = 0; i < response.data.length; i++) {
if (response.data[i].退回时间 !== '') {
response.data[i].退回时间 = (response.data[i].退回时间).split(' ')[0]
}
if (response.data[i].是否确认 === 0) {
this.value += 1
}
}
this.tableData9 = response.data
})
PartCallbackInformation1().then(response => {
for (let i = 0; i < response.data.length; i++) {
if (response.data[i].退回时间 !== '') {
response.data[i].退回时间 = (response.data[i].退回时间).split(' ')[0]
}
if (response.data[i].是否确认 === 0) {
this.value1 += 1
}
}
this.tableData10 = response.data
})
}
},
PartCallbackInformation() {
let check, check1
this.dialogFormVisible1 = true
this.tableData9 = []
this.partNumber ? check = 1 : check = 0
this.dateRange ? check1 = 1 : (check1 = 0, this.dateRange = '')
PartCallbackInformation(check, this.partNumber, check1, this.dateRange[0], this.dateRange[1]).then(response => {
for (let i = 0; i < response.data.length; i++) {
if (response.data[i].退回时间 !== '') {
response.data[i].退回时间 = (response.data[i].退回时间).split(' ')[0]
}
if (response.data[i].是否确认 === 0) {
this.value += 1
}
}
this.tableData9 = response.data
})
},
PartCallbackInformation1() {
this.dialogFormVisible2 = true
let check, check1
this.tableData10 = []
this.partNumber1 ? check = 1 : check = 0
this.dateRange1 ? check1 = 1 : (check1 = 0, this.dateRange1 = '')
PartCallbackInformation1(check, this.partNumber1, check1, this.dateRange1[0], this.dateRange1[1]).then(response => {
for (let i = 0; i < response.data.length; i++) {
if (response.data[i].退回时间 !== '') {
response.data[i].退回时间 = (response.data[i].退回时间).split(' ')[0]
}
if (response.data[i].是否确认 === 0) {
this.value1 += 1
}
}
this.tableData10 = response.data
})
},
submit(row) {
submit(row.基本件流水号).then(response => {
@@ -923,7 +970,7 @@ export default {
submitAdd(formName) {
this.$refs[formName].validate((valid) => {
if (valid) {
addData(this.form.请购车间, this.name, this.id, this.form.Remarks).then(response => {
addData(this.form.请购车间, this.name, this.id, this.form.请购时间, this.form.Remarks).then(response => {
if (response.data[0].result === '1') {
this.$message.success('增加成功')
this.dialogFormVisible = false
@@ -945,11 +992,12 @@ export default {
this.dialogFormVisible = true
this.RequisitionList = row.请购单流水号
this.form.请购车间 = row.请购车间
this.form.请购时间 = row.请购时间
},
submitEdit(formName) { // 提交单据编辑
this.$refs[formName].validate((valid) => {
if (valid) {
editData(this.RequisitionList, this.form.请购车间).then(response => {
editData(this.RequisitionList, this.form.请购车间, this.form.请购时间).then(response => {
if (response.data[0].result === '1') {
this.$message.success('编辑成功')
this.dialogFormVisible = false
@@ -978,19 +1026,6 @@ export default {
this.$message.success('删除成功')
this.tableData6 = []
this.searchTable1()
if (this.PartType === '基本件') {
searchPart(this.groupFloatValue).then(response => {
this.tableData1 = response.data
})
} else if (this.PartType === '外购件') {
searchPart1(this.groupFloatValue, 2).then(response => {
this.tableData2 = response.data
})
} else if (this.PartType === '标准件') {
searchPart1(this.groupFloatValue, 1).then(response => {
this.tableData3 = response.data
})
}
} else {
this.$message.error('删除失败')
}