创建采购合同部分和零件导入

This commit is contained in:
liushuai
2018-12-05 20:05:28 +08:00
parent 495f746ea2
commit d74e75eff9
9 changed files with 85 additions and 105 deletions

View File

@@ -25,8 +25,8 @@
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="付款方式">
<el-select v-model="payMethodValue" placeholder="付款方式" size="small" @change="payMethodChange">
<el-form-item label="付款">
<el-select v-model="payMethodValue" placeholder="付款" size="small" @change="payMethodChange">
<el-option
v-for="item in payMethod"
:key="item.value"
@@ -48,75 +48,6 @@
</el-select>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="第1次付款时间">
<el-select v-model="payTime1Value" placeholder="请选择" size="small" clearable>
<el-option
v-for="item in payTime1"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="第2次付款时间">
<el-select v-model="payTime2Value" :disabled="disable2" placeholder="请选择" size="small" clearable>
<el-option
v-for="item in payTime2"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="第3次付款时间">
<el-select v-model="payTime3Value" :disabled="disable3" placeholder="请选择" size="small" clearable>
<el-option
v-for="item in payTime3"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="6">
<el-form-item label="第4次付款时间">
<el-select v-model="payTime4Value" :disabled="disable4" placeholder="请选择" size="small" clearable>
<el-option
v-for="item in payTime4"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="第5次付款时间">
<el-select v-model="payTime5Value" :disabled="disable5" placeholder="请选择" size="small" clearable>
<el-option
v-for="item in payTime5"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
</el-form-item>
</el-col>
<!--<el-col :span="6">-->
<!--<el-form-item label="第6次付款时间">-->
<!--<el-select v-model="payTime6Value" placeholder="请选择" :disabled="disable6" size="small" clearable>-->
<!--<el-option-->
<!--v-for="item in payTime6"-->
<!--:key="item.value"-->
<!--:label="item.label"-->
<!--:value="item.value">-->
<!--</el-option>-->
<!--</el-select>-->
<!--</el-form-item>-->
<!--</el-col>-->
<el-col :span="6">
<el-form-item label="规定到货时间">
<el-date-picker
@@ -136,13 +67,13 @@
<el-input v-model="name" size="small" readonly/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="6">
<el-form-item label="运费">
<el-input v-model="freight" size="small"/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="6">
<el-form-item label="税率">
<el-input v-model="taxRate" size="small"/>
@@ -159,12 +90,7 @@
<el-input v-model="scope.row.单价" size="mini" style="width:70px"/>
</template>
</el-table-column>
<!--<el-table-column label="发货天数" align="center" width="150">-->
<!--<template slot-scope="scope">-->
<!--<el-input v-model="deliveryDay1[scope.$index]" size="mini" style="width:70px"/>-->
<!--</template>-->
<!--</el-table-column>-->
<el-table-column label="零件名称" align="center" min-width="200">
<el-table-column label="零件名称" align="center" min-width="100">
<template slot-scope="scope">
{{ scope.row.物料名称 }}
</template>
@@ -189,9 +115,21 @@
{{ scope.row.金额 }}
</template>
</el-table-column>
<el-table-column label="物料计划到货时间" align="center" width="150">
<el-table-column label="交货期" align="center" width="150">
<template slot-scope="scope">
{{ scope.row.物料计划到货时间 }}
<el-date-picker
v-model="scope.row.物料计划到货时间"
size="small"
type="date"
format="yyyy-MM-dd"
value-format="yyyy-MM-dd"
style="width: 133px"
@change="update(scope.row)"/>
</template>
</el-table-column>
<el-table-column label="备注" align="center" width="150">
<template slot-scope="scope">
<el-input v-model="scope.row.备注" size="mini" style="width: 120px" @change="update(scope.row)"/>
</template>
</el-table-column>
</el-table>
@@ -206,7 +144,7 @@
<!--<el-input v-model="deliveryDay[scope.$index]" size="mini" style="width:70px"/>-->
<!--</template>-->
<!--</el-table-column>-->
<el-table-column label="物料名称" align="center" min-width="200">
<el-table-column label="物料名称" align="center" min-width="100">
<template slot-scope="scope">
{{ scope.row.物料名称 }}
</template>
@@ -231,9 +169,21 @@
{{ scope.row.金额 }}
</template>
</el-table-column>
<el-table-column label="物料计划到货时间" align="center" width="150">
<el-table-column label="交货期" align="center" width="150">
<template slot-scope="scope">
{{ scope.row.物料计划到货时间 }}
<el-date-picker
v-model="scope.row.物料计划到货时间"
size="small"
type="date"
format="yyyy-MM-dd"
value-format="yyyy-MM-dd"
style="width: 133px"
@change="update(scope.row)"/>
</template>
</el-table-column>
<el-table-column label="备注" align="center" width="150">
<template slot-scope="scope">
<el-input v-model="scope.row.备注" size="small" style="width: 120px" @change="update(scope.row)"/>
</template>
</el-table-column>
<!--<el-table-column label="计算方式" align="center" width="110">-->
@@ -405,7 +355,7 @@
</template>
<script>
import { searchSupplier, initPayMethod, initPayTimeNode, doneContract, initPurchaseOrder, searchData, searchData1, searchData2, searchContractDemo } from '@/api/WorkshopProcurement/CreatingProcurementContracts'
import { searchSupplier, initPayMethod, initPayTimeNode, update, doneContract, initPurchaseOrder, searchData, searchData1, searchData2, searchContractDemo } from '@/api/WorkshopProcurement/CreatingProcurementContracts'
import { mapGetters } from 'vuex'
export default {
inject: ['reload'],
@@ -499,7 +449,7 @@ export default {
planArrivalTime: '', // 计划到货时间
stipulateArrivalTime: '', // 规定到货时间
freight: '', // 运费
taxRate: '', // 税率
taxRate: '0.16', // 税率
tableData3: [],
tableData4: [],
groupNum1: [],
@@ -530,12 +480,14 @@ export default {
searchData() {
const numGroup = [] // 空数组,放物料的计划到货时间
searchData(this.contractNumValue).then(response => {
console.log(response.data, 111)
for (let i = 0; i < response.data.length; i++) {
numGroup.push(Date.parse(response.data[i].物料计划到货时间))
}
this.minDate = new Date(Math.min(...numGroup))
})
searchData1(this.contractNumValue).then(response => {
console.log(response.data, 222)
for (let j = 0; j < response.data.length; j++) {
response.data[j].物料计划到货时间 = (response.data[j].物料计划到货时间).split(' ')[0]
}
@@ -562,6 +514,10 @@ export default {
console.log(this.tableData4)
})
},
update(row) {
update(row.请购单明细流水号, row.物料计划到货时间, row.备注).then(response => {
})
},
calculateContractSum() { // 计算合同总额
this.contractSum = 0
this.contractSum1 = 0
@@ -652,7 +608,6 @@ export default {
this.getSelect(initPurchaseOrder, ['请购单编号', '请购单流水号'], 'contractNum')
},
searchSupplier() { // 查询创立日期和注册资本大于符合条件的数据
console.log(this.id)
this.supplierName ? this.supplierCheck1 = 1 : (this.supplierCheck1 = 0, this.supplierName = '')
this.enterpriseNature ? this.supplierCheck2 = 1 : (this.supplierCheck2 = 0, this.enterpriseNature = '')
this.createDate ? this.supplierCheck3 = 1 : (this.supplierCheck3 = 0, this.createDate = '')

View File

@@ -134,9 +134,13 @@
<td colspan="1" align="center">{{ freight }}</td>
</tr>
<tr style="height: 40px">
<td colspan="6">总价: (人民币){{ RMB }}(含0.17增值税) </td>
<td colspan="6">总价: (人民币){{ RMB }} </td>
<td colspan="1" align="center">{{ TotalAmount }}</td>
</tr>
<tr style="height: 40px">
<td colspan="6">总价: (人民币){{ RMB1 }}({{ taxRate }}增值税) </td>
<td colspan="1" align="center">{{ TotalAmount1 }}</td>
</tr>
</tfoot>
</table>
<div id="23"/>
@@ -289,7 +293,7 @@
<td colspan="1" align="center">{{ freight1 }}</td>
</tr>
<tr style="height: 40px">
<td colspan="6">总价: (人民币){{ RMB1 }}(含0.17增值税) </td>
<td colspan="6">总价: (人民币){{ RMB1 }}(含0.16增值税) </td>
<td colspan="1" align="center">{{ TotalAmount1 }}</td>
</tr>
</tfoot>
@@ -375,6 +379,7 @@ export default {
contract1: '',
freight: '',
freight1: '',
taxRate: '',
contractNumValue: '',
contractNum: [],
contractNumValue1: '',
@@ -486,6 +491,7 @@ export default {
}
searchTable1(this.pageCurrent1, this.pageSize1, this.check1, this.startEndDate[0], this.startEndDate[1], this.check2, this.contractNumValue, this.check3, this.buyerValue, this.check4, this.supplierName, this.check5, this.approvalValue).then(response => {
this.loading1 = false
console.log(response.data.rows)
for (let j = 0; j < response.data.rows.length; j++) {
if (response.data.rows[j].规定到货时间 !== null || response.data.rows[j].规定到货时间 !== '') {
response.data.rows[j].规定到货时间 = response.data.rows[j].规定到货时间.substring(0, response.data.rows[j].规定到货时间.indexOf(' '))
@@ -558,7 +564,6 @@ export default {
this.searchTable3()
},
searchTable2(row) {
console.log(row)
this.textarea = row.合同文本
this.supplier = row.供应商名称
this.contract = row.采购合同编号
@@ -568,6 +573,8 @@ export default {
document.getElementById('23').innerText = this.textarea
this.contractValue = parseInt(row.采购合同流水号)
searchTable2(this.contractValue).then(response => {
console.log(response.data)
this.taxRate = response.data[0].税率
this.returns = response.data
const children = document.getElementsByClassName('tableData')
const parent = document.getElementById('4')