刘璐珈

This commit is contained in:
Vergil
2020-03-09 17:18:31 +08:00
parent 8d4607b5ca
commit c2d4e64c35
21 changed files with 998 additions and 350 deletions

View File

@@ -38,8 +38,10 @@
active-value="含税"
inactive-value="未税"/>
</el-tooltip>
<el-button v-if="quickChangePrice" size="mini" type="primary" plain style="margin: 0px 0 0 10px" @click="quickChangePrice=!quickChangePrice">快速修改价格</el-button>
<el-button v-else size="mini" style="margin: 10px 0 0 10px" @click="quickChangePrice=!quickChangePrice">还原</el-button>
<el-tooltip content="修改表格内备注/交货期" placement="top">
<el-button v-if="quickChangePrice" size="mini" type="success" plain style="margin: 0px 0 0 10px" @click="quickChangePrice=!quickChangePrice">快速修改价格</el-button>
<el-button v-else size="mini" type="distribution" style="margin: 10px 0 0 10px" @click="quickChangePrice=!quickChangePrice">编辑</el-button>
</el-tooltip>
<el-button v-show="isShowN" type="text" style="margin: 10px 0 0 10px" @click="isShowN=false">折叠</el-button>
<el-button v-show="!isShowN" type="text" style="margin: 10px 0 0 10px" @click="isShowN=true">展开其他说明</el-button>
<el-tooltip v-show="true" :open-delay="300" content="一键删除交货期" placement="right">
@@ -59,9 +61,9 @@
<el-input v-model="otherInfo" :disabled="!contractNumValue" size="small" placeholder="其他说明" type="textarea" rows="1" @blur="contractHeaderChange"/>
</el-row>
<el-table v-loading="loading" :data="tableData1" border style="margin: 10px 0;max-height: 480px;" height="480px" size="mini" show-summary tooltip-effect="dark">
<el-table v-loading="loading" :data="tableData1" :summary-method="getSummaries" border style="margin: 10px 0;max-height: 480px;width: 1365px" height="480px" size="mini" show-summary tooltip-effect="dark">
<el-table-column label="序号" align="center" width="50" type="index"/>
<el-table-column label="机床图号" align="center" min-width="100">
<el-table-column label="机床图号" align="center" width="100" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.机床图号 }}
</template>
@@ -71,17 +73,17 @@
{{ scope.row.组号 }}
</template>
</el-table-column>
<el-table-column label="名称" align="center" min-width="120">
<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="120">
<el-table-column label="图号或型号" align="center" width="130" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.图号 ? 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.规格 ? scope.row.规格 : '—' }}
</template>
@@ -96,18 +98,18 @@
{{ scope.row.计量单位 }}
</template>
</el-table-column>
<el-table-column v-show="hasTax==='含税'" label="单价含税" align="center" width="100">
<el-table-column v-show="hasTax==='含税'" label="单价(含税)元" align="center" width="108">
<template slot-scope="scope">
<el-input v-direction="{x: 0, y: scope.$index}" v-if="hasTax==='含税'" v-model="scope.row.含税单价" size="mini" style="width:100%" @keyup.native="scope.row.含税单价 = scope.row.含税单价.replace(/[^\.\d]/g,'')" @change="priceChange(scope.row.含税单价, scope.row.物料流水号, scope.row.询价单流水号, scope.row, scope.row.零件名称, scope.row.零件图号, scope.row.规格)"/>
<b v-show="hasTax!=='含税'"></b>
</template>
</el-table-column>
<el-table-column label="总额含税" align="center" min-width="100" prop="含税总额">
<el-table-column label="总额(含税)元" align="center" width="108" prop="含税总额">
<template slot-scope="scope">
{{ hasTax==='含税' ? scope.row.含税总额 = (Number(scope.row.数量) * Number(scope.row.含税单价)).toFixed(2) : scope.row.含税总额 = (scope.row.未税总额 * (1+taxRate)).toFixed(2) }}
</template>
</el-table-column>
<el-table-column label="备注" align="center" min-width="80" show-overflow-tooltip>
<el-table-column label="备注" align="center" width="80" show-overflow-tooltip>
<template slot-scope="scope">
<el-input v-direction="{x: 1, y: scope.$index}" v-if="quickChangePrice" v-model="scope.row.备注" size="mini" style="width:100%" @change="remarkChange(scope.row.备注, scope.row.物料流水号, scope.row.询价单流水号, scope.row, scope.row.零件名称, scope.row.零件图号, scope.row.规格)"/>
<b v-else>{{ scope.row.备注 || '' }}</b>
@@ -126,13 +128,13 @@
<b v-else>{{ scope.row.交货期.split(' ')[0] || '' }}</b>
</template>
</el-table-column>
<el-table-column v-show="hasTax==='未税'" label="单价未税" align="center" width="100">
<el-table-column v-show="hasTax==='未税'" label="单价(未税)元" align="center" width="108">
<template slot-scope="scope">
<el-input v-direction="{x: 0, y: scope.$index}" v-if="hasTax==='未税'" v-model="scope.row.未税单价" size="mini" style="width:100%" @keyup.native="scope.row.未税单价 = scope.row.未税单价.replace(/[^\.\d]/g,'')" @change="priceChange(scope.row.未税单价, scope.row.物料流水号, scope.row.询价单流水号, scope.row, scope.row.零件名称, scope.row.零件图号, scope.row.规格)"/>
<b v-show="hasTax!=='未税'"></b>
</template>
</el-table-column>
<el-table-column label="总额未税" align="center" min-width="100" prop="未税总额">
<el-table-column label="总额(未税)元" align="center" width="108" prop="未税总额">
<template slot-scope="scope">
{{ hasTax==='未税' ? scope.row.未税总额 = (Number(scope.row.数量) * Number(scope.row.未税单价)).toFixed(2) : scope.row.未税总额 = (scope.row.含税总额 / (1+taxRate)).toFixed(2) }}
</template>
@@ -144,7 +146,7 @@
</el-radio-group>
<el-button type="primary" plain size="small" style="margin-left:10px;" @click="editContract()">预览合同</el-button>
<span>递交审批</span>
<el-tooltip :open-delay="1000" effect="dark" content="生成合同并提交审" placement="top">
<el-tooltip :open-delay="1000" effect="dark" content="生成合同并提交审" placement="top">
<el-button type="primary" plain size="small" @click="generateContract()">递交</el-button>
</el-tooltip>
<hr>
@@ -237,6 +239,13 @@ export default {
'id'
])
},
watch: {
quickChangePrice: function(val) {
if (val === false) {
this.$message.success('成功修改表格中内容')
}
}
},
created() {
this.fetchData11()
this.fetchData()
@@ -244,6 +253,46 @@ export default {
this.demo1()
},
methods: {
getSummaries(param) { // 合计
const { columns, data } = param
const sums = []
columns.forEach((column, index) => {
if (index === 0) {
sums[index] = '合计'
} else if (index === 9) {
const values = data.map(item => Number(parseFloat(item['含税总额'])))
if (!values.every(value => isNaN(value))) {
sums[index] = values.reduce((prev, curr) => {
const value = Number(curr)
if (!isNaN(value)) {
return prev + curr
} else {
return prev
}
}, 0)
sums[index] = sums[index].toFixed(2) + ' 元'
} else {
sums[index] = 'N/A'
}
} else if (index === 12) {
const values = data.map(item => Number(parseFloat(item['未税总额'])))
if (!values.every(value => isNaN(value))) {
sums[index] = values.reduce((prev, curr) => {
const value = Number(curr)
if (!isNaN(value)) {
return prev + curr
} else {
return prev
}
}, 0)
sums[index] = sums[index].toFixed(2) + ' 元'
} else {
sums[index] = 'N/A'
}
}
})
return sums
},
fetchData11() {
initSupplier11(this.id).then(res => {
this.supplier11 = []
@@ -352,8 +401,8 @@ export default {
row.零件图号 = row.零件图号 || ''
row.规格 = row.规格 || ''
if (Number(v.物料流水号) === Number(row.物料流水号) && Number(v.询价单流水号) === Number(row.询价单流水号) && v.零件名称 === row.零件名称 && v.零件图号 === row.零件图号 && v.规格 === row.规格) {
v.含税单价 = row.含税单价
v.未税单价 = row.未税单价
v.含税单价 = Number(row.含税单价).toFixed(2)
v.未税单价 = Number(row.未税单价).toFixed(2)
}
})
const group = this.tableData1
@@ -510,9 +559,9 @@ export default {
规格: response.data[i].组件零件流水号 ? response.data[i].物料规格 : response.data[i].规格,
数量: response.data[i].数量,
计量单位: response.data[i].计量单位,
未税单价: response.data[i].单价,
未税单价: Number(response.data[i].单价).toFixed(2),
未税总额: 0,
含税单价: response.data[i].单价,
含税单价: Number(response.data[i].单价).toFixed(2),
含税总额: 0,
备注: response.data[i].备注
})
@@ -661,8 +710,8 @@ export default {
<table style="border-collapse: collapse; width: 100%;" border="1">
<tbody id="tbody">
<tr id="tableHead">
<td>序号</td>
<td>机床号-组号</td>
<td style="width: 30px">序号</td>
<td style="width: 110px">机床号-组号</td>
<td>名称</td>
<td>图号或型号</td>
<td>规格</td>
@@ -670,7 +719,7 @@ export default {
<td>单位</td>
<td>单价</td>
<td>合计</td>
<td>交货时间</td>
<td style="width:90px">交货时间</td>
<td>备注</td>
</tr>
</tbody>
@@ -777,10 +826,10 @@ export default {
document.getElementsByClassName('actualTotal')[0].innerHTML = this.actualTotal
document.getElementsByClassName('actualTotal')[1].innerHTML = this.actualTotal
document.getElementById('actualTotal_zh').innerHTML = convertCurrency(this.actualTotal)
this.contentNew = document.getElementsByClassName('editor-content')[0].innerHTML
// this.contentNew = document.getElementsByClassName('editor-content')[0].innerHTML
// this.$refs.tinymce.initTinymce()
setTimeout(() => {
this.$refs.tinymce.setContent(this.contentNew)
// this.$refs.tinymce.setContent(this.contentNew)
}, 1000)
} else {
this.$message.warning('请先选择合同模板,再预览')
@@ -820,7 +869,7 @@ export default {
})
if (this.contractNumValue) {
if (this.demoRadio) {
this.$confirm('此采购合同将递交审,递交后该合同不可删除,确认完成编辑?', '提示', {
this.$confirm('此采购合同将递交审,递交后该合同不可删除,确认完成编辑?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'