This commit is contained in:
liushuai
2020-03-21 17:10:21 +08:00
parent 3c554e5909
commit e314062d42
23 changed files with 473 additions and 793 deletions

View File

@@ -1,6 +1,6 @@
<template>
<div class="app-container">
<el-row style="width: 720px">
<el-row style="width: 895px">
<el-card style="margin-bottom: 5px">
<el-row>
<el-input v-model="ManufacturerName" size="small" placeholder="外协厂家" clearable style="width:200px"/>
@@ -15,31 +15,31 @@
style="width:250px;margin-left: 5px;margin-top: 10px;margin-bottom: 10px"
start-placeholder="开始日期"
end-placeholder="结束日期"/>
<el-button type="primary" class="el-icon-search" style="margin-left: 20px" size="small" plain @click="getParts()">查询</el-button>
<el-button type="success" plain class="el-icon-download" style="margin-left: 30px" size="small" @click="exportExcel">导出</el-button>
<el-button type="primary" class="el-icon-search" style="margin-left: 20px" size="small" plain @click="外协厂家流水号 = '';getParts()">查询</el-button>
<el-button type="success" plain class="el-icon-download" style="margin-left: 220px" size="small" @click="exportExcel">导出</el-button>
</el-row>
<el-table v-loading="loading" :data="tableData" size="mini" highlight-current-row height="300" style="width: 690px;margin-bottom: 10px" border element-loading-text="拼命加载中" @row-click="rowClick">
<el-table-column label="厂家" prop="外协厂家名称" align="center" width="230px">
<el-table v-loading="loading" :data="tableData" size="mini" highlight-current-row height="300" style="width: 870px;margin-bottom: 10px" border element-loading-text="拼命加载中" @row-click="rowClick">
<el-table-column label="厂家" prop="外协厂家名称" align="center" width="255px">
<template slot-scope="scope">
{{ scope.row.外协厂家名称 }}
</template>
</el-table-column>
<el-table-column label="外协金额(元)" prop="总价" align="center" width="110px">
<el-table-column label="外协金额(元)" prop="总价" align="center" width="150px">
<template slot-scope="scope">
{{ scope.row.总价 }}
</template>
</el-table-column>
<el-table-column label="到票金额(元)" align="center" width="110px" prop="开票金额">
<el-table-column label="到票金额(元)" align="center" width="150px" prop="开票金额">
<template slot-scope="scope">
{{ scope.row.开票金额 }}
</template>
</el-table-column>
<el-table-column label="付款金额(元)" align="center" width="110px">
<el-table-column label="付款金额(元)" align="center" width="150px">
<template slot-scope="scope">
{{ scope.row.付款金额 }}
</template>
</el-table-column>
<el-table-column label="未付金额(元)" align="center" width="110px">
<el-table-column label="未付金额(元)" align="center" width="150px">
<template slot-scope="scope">
{{ scope.row.应付金额 }}
</template>
@@ -50,8 +50,8 @@
<el-col style="width: 520px">
<el-card>
<el-row>
<span style="margin-top: 10px">票明细:</span>
<el-button type="distribution" size="small" icon="el-icon-circle-plus-outline" style="margin-left:10px" @click="handleAdd1('form1')"></el-button>
<span style="margin-top: 10px">票明细:</span>
<el-button type="distribution" size="small" icon="el-icon-circle-plus-outline" style="margin-left:10px" @click="handleAdd1('form1')"></el-button>
</el-row>
<el-table v-loading="loading2" :data="tableData2" size="mini" stripe height="400" style="width: 100%" border element-loading-text="拼命加载中">
<el-table-column label="发票号" prop="发票号" align="center" width="150px">
@@ -64,15 +64,15 @@
{{ scope.row.开票金额 }}
</template>
</el-table-column>
<el-table-column label="票日期" align="center" width="90px" prop="开票日期">
<el-table-column label="票日期" align="center" width="90px" prop="开票日期">
<template slot-scope="scope">
{{ scope.row.开票时间 }}
</template>
</el-table-column>
<el-table-column align="center" label="操作" fixed="right" width="130px">
<template slot-scope="scope">
<el-button type="text" size="mini" icon="el-icon-edit" @click="ChangeOpen1(scope.row)">编辑</el-button>
<el-button type="text" size="mini" icon="el-icon-delete" @click="handleDelete1(scope.row)">删除</el-button>
<el-button type="text" size="mini" icon="el-icon-edit" @click="ChangeOpen1(scope.row)"/>
<el-button type="text" size="mini" icon="el-icon-delete" @click="handleDelete1(scope.row)"/>
</template>
</el-table-column>
</el-table>
@@ -108,8 +108,8 @@
</el-table-column>
<el-table-column align="center" label="操作" fixed="right" width="130px">
<template slot-scope="scope">
<el-button type="text" size="mini" icon="el-icon-edit" @click="ChangeOpen2(scope.row)">编辑</el-button>
<el-button type="text" size="mini" icon="el-icon-delete" @click="handleDelete2(scope.row)">删除</el-button>
<el-button type="text" size="mini" icon="el-icon-edit" @click="ChangeOpen2(scope.row)"/>
<el-button type="text" size="mini" icon="el-icon-delete" @click="handleDelete2(scope.row)"/>
</template>
</el-table-column>
</el-table>
@@ -136,7 +136,7 @@
</el-row>
<el-row>
<el-form-item label="开票金额(元)" prop="开票金额">
<el-input v-positive="'float'" v-model="form1.开票金额" placeholder="开票金额" type="float" style="width:200px" clearable size="small"/>
<el-input v-positive="'float'" v-model="form1.开票金额" placeholder="开票金额" type="float" style="width:200px" clearable size="small" @blur="checkNumber"/>
</el-form-item>
</el-row>
<el-row>
@@ -163,7 +163,7 @@
<el-form ref="form2" :model="form2" :rules="rules" label-position="left" label-width="120px" class="demo-ruleForm">
<el-row>
<el-form-item label="付款金额(元)" prop="付款金额">
<el-input v-positive="'float'" v-model="form2.付款金额" placeholder="付款金额" type="float" style="width:200px" clearable size="small"/>
<el-input v-positive="'float'" v-model="form2.付款金额" placeholder="付款金额" type="float" style="width:200px" clearable size="small" @blur="checkNumber"/>
</el-form-item>
</el-row>
<el-row>
@@ -244,7 +244,6 @@ export default {
methods: {
// 获取表格1数据
getParts() {
this.外协厂家流水号 = ''
this.loading = true
this.tableData = []
var check
@@ -258,6 +257,11 @@ export default {
}
})
},
checkNumber() {
// content.withdrawAmount = (withdrawAmount.match(/^\d*(\.?\d{0,2})/g)[0]) || null
this.form1.开票金额 = Number(this.form1.开票金额).toFixed(2)
this.form2.付款金额 = Number(this.form2.付款金额).toFixed(2)
},
rowClick(row) {
this.外协厂家流水号 = row.外协厂家流水号
this.外协厂家流水号_Select = row.外协厂家流水号
@@ -286,7 +290,9 @@ export default {
getInvoice() {
this.loading2 = true
this.tableData2 = []
getInvoice(this.外协厂家流水号_Select, this.pageCurrent2, this.pageSize2).then(response => {
var check2
this.startTime ? check2 = 1 : (check2 = 0, this.startTime = '')
getInvoice(this.外协厂家流水号_Select, check2, this.startTime[0], this.startTime[1], this.pageCurrent2, this.pageSize2).then(response => {
this.loading2 = false
if (response.data.rows.length !== 0) {
this.tableData2 = response.data.rows
@@ -298,7 +304,9 @@ export default {
getPayment() {
this.loading3 = true
this.tableData3 = []
getPayment(this.外协厂家流水号_Select, this.pageCurrent2, this.pageSize2).then(response => {
var check2
this.startTime ? check2 = 1 : (check2 = 0, this.startTime = '')
getPayment(this.外协厂家流水号_Select, check2, this.startTime[0], this.startTime[1], this.pageCurrent2, this.pageSize2).then(response => {
this.loading3 = false
if (response.data.rows.length !== 0) {
this.tableData3 = response.data.rows

View File

@@ -1,7 +1,7 @@
<template>
<div class="app-container">
<el-card>
<el-input v-model="partNumber" size="small" placeholder="零件号" clearable style="width:160px;margin-top: 3px"/>
<el-input v-model="partNumber" size="small" placeholder="零件号或零件名称" clearable style="width:160px;margin-top: 3px"/>
<el-button type="primary" size="mini" icon="el-icon-search" style="margin-left:20px" plain @click="getList()">查询</el-button>
<el-button type="danger" plain size="mini" icon="el-icon-caret-right" style="float: right;margin-right:10px" @click="getBack()">打回</el-button>
<el-table v-loading="loading1" ref="multipleTable" :data="List1" border size="mini" stripe highlight-current-row height="265" style="width: 100%;margin-top: 3px" @selection-change="handleSelectionChange">
@@ -53,10 +53,10 @@
<el-table-column label="操作" align="center" min-width="100px">
<template slot-scope="scope">
<div style="display: inline-block">
<el-button type="text" size="mini" icon="el-icon-edit" style="margin-left:10px" @click="handleEdit(scope.row)"/>
<el-button type="text" size="mini" icon="el-icon-edit" @click="handleEdit(scope.row)"/>
</div>
<div style="display: inline-block">
<el-button :disabled="scope.row.单据状态==='成交'" type="text" size="mini" icon="el-icon-delete" @click="handleDelete(scope.row)"/>
<el-button :disabled="scope.row.单据状态==='成交'" type="text" size="mini" icon="el-icon-delete" style="margin-left:10px" @click="handleDelete(scope.row)"/>
</div>
</template>
</el-table-column>
@@ -96,7 +96,7 @@
</el-table-column>
<el-table-column label="外协价格(元)" align="center" width="130px">
<template slot-scope="scope">
<el-input v-positive="'float'" v-model="scope.row.加工价格_成交" class="editWorkTime" type="number" style="text-align: right" size="small" @change="saveAct(scope.row)"/>
<el-input v-positive="'float'" v-model="scope.row.加工价格_成交" class="editWorkTime" type="number" style="text-align: right" size="small" @change="saveAct(scope.row)" @blur="filterNuber(scope.row.加工价格_成交, scope.$index, '加工价格_成交')"/>
</template>
</el-table-column>
<el-table-column label="机加工开始时间" align="center" width="150px">
@@ -292,6 +292,22 @@ export default {
})
this.loading2 = false
},
filterNuber(val, index, date, row) {
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.List3[index][date] = value
},
// 表3合计
getSummaries(param) {
const { data } = param
@@ -303,7 +319,7 @@ export default {
for (let i = 0; i < data.length; i++) {
sums[4] += Math.round(parseFloat(data[i].加工价格_成交) * 100) / 100
}
sums[4] = Math.round(sums[4] * 100) / 100 + ' 元'
sums[4] = sums[4].toFixed(2) + ' 元'
return sums
},
// 查询未选入零件