制造部采购
This commit is contained in:
@@ -40,33 +40,33 @@
|
||||
</el-row>
|
||||
</el-card>
|
||||
<el-card>
|
||||
<el-table v-show="contractNumType===1" :data="tableData5" border style="width: 100%" height="100px" size="mini">
|
||||
<el-table-column label="组件名称" align="center" width="150">
|
||||
<el-table v-show="contractNumType===1" :data="tableData5" border style="width: 1200px" height="100px" size="mini">
|
||||
<el-table-column label="组件名称" align="center" width="180">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.组件名称 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="组号" align="center" width="100">
|
||||
<el-table-column label="组号" align="center" width="70">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.组号 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="数量" align="center" width="120">
|
||||
<el-table-column label="数量" align="center" width="90">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.数量" size="mini" style="width:100%" @change="update1(scope.row)"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="单价" align="center" width="10">
|
||||
<el-table-column label="单价" align="center" width="150">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.单价" size="mini" style="width:100%" @change="update1(scope.row)"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="金额" align="center" width="150">
|
||||
<template slot-scope="scope">
|
||||
{{ parseInt(scope.row.数量) * parseFloat(scope.row.单价) }}
|
||||
{{ (parseInt(scope.row.数量) * parseFloat(scope.row.单价)).toFixed(2) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="交货期" align="center" width="150">
|
||||
<el-table-column label="交货期" align="center" width="160">
|
||||
<template slot-scope="scope">
|
||||
<el-date-picker
|
||||
v-model="scope.row.物料计划到货时间"
|
||||
@@ -78,7 +78,7 @@
|
||||
@change="update1(scope.row)"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="备注" align="center" width="250">
|
||||
<el-table-column label="备注" align="center" min-width="100">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.备注" size="mini" style="width:100%" @change="update1(scope.row)"/>
|
||||
</template>
|
||||
@@ -460,6 +460,16 @@ export default {
|
||||
if (response.data[0].result === '1') {
|
||||
this.contractNumType = 1
|
||||
this.dialogVisible2 = false
|
||||
this.contractNum = []
|
||||
initPurchaseOrder().then(response => {
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
this.contractNum.push({
|
||||
label: response.data[i].请购单编号,
|
||||
value: response.data[i].请购单流水号,
|
||||
id: response.data[i].请购类型
|
||||
})
|
||||
}
|
||||
})
|
||||
this.searchData()
|
||||
this.$message.success('转换成功')
|
||||
} else {
|
||||
@@ -483,6 +493,7 @@ export default {
|
||||
},
|
||||
searchData() {
|
||||
this.contractSum = 0.00
|
||||
this.contractSum2 = 0.00
|
||||
for (let i = 0; i < this.contractNum.length; i++) {
|
||||
if (this.contractNum[i].value === this.contractNumValue) {
|
||||
this.contractNumType = this.contractNum[i].id
|
||||
@@ -503,6 +514,7 @@ export default {
|
||||
this.form3.机床 = response.data[0].机床图号
|
||||
this.form3.groupNumValue = response.data[0].组件流水号
|
||||
console.log(this.machineValue, 111)
|
||||
this.groupNum = []
|
||||
initGroupNum(this.machineValue).then(response => {
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
this.groupNum.push({
|
||||
@@ -524,24 +536,44 @@ export default {
|
||||
})
|
||||
},
|
||||
calculateContractSum() { // 计算合同总额
|
||||
this.contractSum = 0
|
||||
this.contractSum1 = 0
|
||||
this.costAccount = 0
|
||||
this.riseFallPoint = 0
|
||||
this.tableData4 = []
|
||||
for (let i = 0; i < this.groupNum2.length; i++) {
|
||||
this.groupNum2[i].金额 = parseFloat(this.groupNum2[i].单价) * parseFloat(this.groupNum2[i].零件数量)
|
||||
this.contractSum1 += parseFloat(this.groupNum2[i].金额)
|
||||
this.tableData4.push(this.groupNum2[i])
|
||||
}
|
||||
this.contractSum = (this.contractSum1).toFixed(2)
|
||||
this.contractSum2 = parseInt(this.contractSum * (1 + parseFloat(this.taxRate)) * 100) / 100
|
||||
this.costAccount = this.contractSum
|
||||
if (parseInt(this.costAccount) === 0) {
|
||||
this.$message.error('成本核算不可为0')
|
||||
} else {
|
||||
this.riseFallPoint = (this.contractSum - this.costAccount) / this.costAccount
|
||||
this.riseFallPoint = this.riseFallPoint.toFixed(2)
|
||||
if (this.contractNumType === 0) {
|
||||
this.contractSum = 0
|
||||
this.contractSum1 = 0
|
||||
this.costAccount = 0
|
||||
this.riseFallPoint = 0
|
||||
this.tableData4 = []
|
||||
for (let i = 0; i < this.groupNum2.length; i++) {
|
||||
this.groupNum2[i].金额 = parseFloat(this.groupNum2[i].单价) * parseFloat(this.groupNum2[i].零件数量)
|
||||
this.contractSum1 += parseFloat(this.groupNum2[i].金额)
|
||||
this.tableData4.push(this.groupNum2[i])
|
||||
}
|
||||
this.contractSum = (this.contractSum1).toFixed(2)
|
||||
this.contractSum2 = parseInt(this.contractSum * (1 + parseFloat(this.taxRate)) * 100) / 100
|
||||
this.costAccount = this.contractSum
|
||||
if (parseInt(this.costAccount) === 0) {
|
||||
this.$message.error('成本核算不可为0')
|
||||
} else {
|
||||
this.riseFallPoint = (this.contractSum - this.costAccount) / this.costAccount
|
||||
this.riseFallPoint = this.riseFallPoint.toFixed(2)
|
||||
}
|
||||
} else if (this.contractNumType === 1) {
|
||||
this.contractSum = 0
|
||||
this.contractSum1 = 0
|
||||
this.costAccount = 0
|
||||
this.riseFallPoint = 0
|
||||
for (let i = 0; i < this.groupNum5.length; i++) {
|
||||
this.contractSum1 += parseFloat((parseInt(this.groupNum5[i].数量) * parseFloat(this.groupNum5[i].单价)).toFixed(2))
|
||||
}
|
||||
console.log(this.contractSum1, this.groupNum5, 898989)
|
||||
this.contractSum = (this.contractSum1).toFixed(2)
|
||||
this.contractSum2 = parseInt(this.contractSum * (1 + parseFloat(this.taxRate)) * 100) / 100
|
||||
this.costAccount = this.contractSum
|
||||
if (parseInt(this.costAccount) === 0) {
|
||||
this.$message.error('成本核算不可为0')
|
||||
} else {
|
||||
this.riseFallPoint = (this.contractSum - this.costAccount) / this.costAccount
|
||||
this.riseFallPoint = this.riseFallPoint.toFixed(2)
|
||||
}
|
||||
}
|
||||
},
|
||||
fetchData() {
|
||||
|
||||
Reference in New Issue
Block a user