This commit is contained in:
liushuai
2020-04-17 18:07:27 +08:00
parent 199f7fbbec
commit 1f2325301a
10 changed files with 500 additions and 39 deletions

View File

@@ -322,9 +322,9 @@
{{ scope.row.物料型号 ? scope.row.物料型号 : scope.row.零件图号 }}
</template>
</el-table-column>
<el-table-column label="采购数" align="center" width="100">
<el-table-column label="采购数" align="center" width="120">
<template slot-scope="scope">
<el-input v-direction="{x: 0, y: scope.$index}" v-if="quickChangePrice" v-model="scope.row.数量" :disabled="disable" size="mini" style="width:60px" @change="saveContract()"/>
<el-input v-positive="'float'" v-direction="{x: 0, y: scope.$index}" v-if="quickChangePrice" v-model="scope.row.数量" :disabled="disable" size="mini" style="width:100px" type="number" @change="saveContract()"/>
<b v-else>{{ scope.row.数量 }}</b>
</template>
</el-table-column>
@@ -344,9 +344,20 @@
<b v-show="hasTax!=='未税'">{{ (scope.row.单价 / (1 + taxRate)).toFixed(2) }}</b>
</template>
</el-table-column>
<el-table-column label="单价(含税)元" align="center" width="120" prop="单价">
<el-table-column label="单价(含税)元" align="center" width="120" prop="单价(含税)">
<template slot-scope="scope">
<el-input v-direction="{x: 1, y: scope.$index}" v-if="hasTax==='含税'" v-model="scope.row.单价" :disabled="disable" size="mini" style="width:80px" @change="saveContract()"/>
<el-input
v-positive="'float'"
v-direction="{x: 1, y: scope.$index}"
v-if="hasTax==='含税'"
v-model="scope.row.单价"
:disabled="disable"
class="editWorkTime"
size="mini"
style="width:100px"
type="number"
@blur="changefixed(scope.row.单价, scope.$index, '单价')"
@change="saveContract()"/>
<b v-show="hasTax!=='含税'">{{ (scope.row.未税单价 * (1 + taxRate)).toFixed(2) }}</b>
</template>
</el-table-column>
@@ -844,6 +855,23 @@ export default {
this.initDirection()
},
methods: {
changefixed(val, index, date) {
console.log(index, 6666)
let value = '' + val
value = value
.replace(/[^\d.]/g, '') // 清除“数字”和“.”以外的字符
.replace(/\.{2,}/g, '.') // 只保留第一个. 清除多余的
.replace('.', '$#$')
.replace(/\./g, '')
.replace('$#$', '.')
.replace(/^(\-)*(\d+)\.(\d\d).*$/, '$1$2.$3') // 只能输入两个小数
if (value.indexOf('.') < 0 && value !== '') {
value = parseFloat(value).toFixed(2)
}
console.log(value, this.tableData3[index][date])
this.tableData3[index][date] = value
console.log(this.tableData3[index][date], 'this.tableData3[index][date]')
},
handleSelection(val, row) {
console.log(row, 123)
this.tableData00.forEach((item, i) => {
@@ -1294,13 +1322,14 @@ export default {
this.离线合同状态 = row.离线合同状态
this.loading4 = true
searchMateriel(this.offlineContractNum).then(response => {
console.log(response.data)
console.log(response, 'response')
this.tableData3 = response.data
this.tableData3.map(v => {
this.$set(v, '未税总额', 0)
this.$set(v, '含税总额', 0)
!v.单价 ? v.单价 = v.参考价格 : v.单价
this.$set(v, '未税单价', v.单价 / (1 + this.taxRate))
this.$set(v, '单价', (v.单价).toFixed(2))
!v.单价 ? v.单价 = parseFloat(v.参考价格).toFixed(2) : parseFloat(v.单价).toFixed(2)
this.$set(v, '未税单价', (v.单价 / (1 + this.taxRate)).toFixed(2))
})
console.log(this.tableData3, 'tableData31')
this.loading4 = false
@@ -1372,7 +1401,7 @@ export default {
this.$set(v, '未税总额', 0)
this.$set(v, '含税总额', 0)
!v.单价 ? v.单价 = v.参考价格 : v.单价
this.$set(v, '未税单价', v.单价 / (1 + this.taxRate))
this.$set(v, '未税单价', (v.单价 / (1 + this.taxRate)).toFixed(2))
})
})
} else { this.$message.error('选入失败') }
@@ -1395,7 +1424,7 @@ export default {
this.$set(v, '未税总额', 0)
this.$set(v, '含税总额', 0)
!v.单价 ? v.单价 = v.参考价格 : v.单价
this.$set(v, '未税单价', v.单价 / (1 + this.taxRate))
this.$set(v, '未税单价', (v.单价 / (1 + this.taxRate)).toFixed(2))
})
})
if (this.tabName === '外购件' || this.tabName === '标准件') {
@@ -1768,6 +1797,13 @@ export default {
width:150px;
margin-right: 10px;
}
.editWorkTime input::-webkit-outer-spin-button, input::-webkit-inner-spin-button {
-webkit-appearance: none;
text-align: center;
}
.editWorkTime input[type="number"]{
-moz-appearance: textfield;
}
</style>
<style>
.el-table .MistyRose {