This commit is contained in:
liushuai
2020-03-17 18:45:44 +08:00
parent a588a6d9e6
commit dc9860ef34
3 changed files with 36 additions and 16 deletions

View File

@@ -108,7 +108,7 @@ export function searchSupplier(check1, value1, check2, value2, check3, value3, c
}) })
} }
// 生成采购合同 // 生成采购合同
export function doneContract(num1, RequisitionNumber, name1, time1, time2, num2, text, type, freight, num3, partsNum, priceGroup, taxGroup, currency, num4, id, singleQuota, readyQuota, AdvanceCharge) { export function doneContract(num1, RequisitionNumber, name1, time1, time2, num2, text, type, freight, num3, partsNum, priceGroup, taxGroup, currency, num4, id, singleQuota, readyQuota, AdvanceCharge, group) {
return request({ return request({
url: '', url: '',
method: 'post', method: 'post',
@@ -117,7 +117,7 @@ export function doneContract(num1, RequisitionNumber, name1, time1, time2, num2,
ModularID: router.currentRoute.path, ModularID: router.currentRoute.path,
type: '2', type: '2',
name: '车间管理_基本件采购_请购单和请购单明细_增加数据', name: '车间管理_基本件采购_请购单和请购单明细_增加数据',
param: `请购单流水号=${num1}&请购单编号=${RequisitionNumber}&采购合同名称=${name1}&预到货时间=${time1}&规定到货时间=${time2}&采购员=${id}&供应商流水号=${num2}&合同文本=${text}&模板类型=${type}&运费=${freight}&物料流水号组=${num3}&请购单明细流水号组=${num4}&数量组=${partsNum}&单价组=${priceGroup}&税率组=${taxGroup}&币种流水号组=${currency}&单件定额工时组=${singleQuota}&准结定额工时组=${readyQuota}&预付款=${AdvanceCharge}` param: `请购单流水号=${num1}&请购单编号=${RequisitionNumber}&采购合同名称=${name1}&预到货时间=${time1}&规定到货时间=${time2}&采购员=${id}&供应商流水号=${num2}&合同文本=${text}&模板类型=${type}&运费=${freight}&物料流水号组=${num3}&请购单明细流水号组=${num4}&数量组=${partsNum}&单价组=${priceGroup}&税率组=${taxGroup}&币种流水号组=${currency}&单件定额工时组=${singleQuota}&准结定额工时组=${readyQuota}&预付款=${AdvanceCharge}&未选请购单明细流水号组=${group}`
} }
}) })
} }

View File

@@ -1,6 +1,6 @@
import axios from 'axios' import axios from 'axios'
export const wsuri = `ws://123.56.95.229:61101//WebMoudule//websocket` export const wsuri = `ws://123.56.95.229:8010//WebMoudule//websocket`
export const name = `OP8888` export const name = `OP8888`
export const name1 = `OP1000` export const name1 = `OP1000`
export const name3 = `OP2000` export const name3 = `OP2000`

View File

@@ -44,6 +44,7 @@
</el-card> </el-card>
<el-card> <el-card>
<el-table v-show="contractNumType===1" :data="tableData5" border style="width: 1200px" height="100px" size="mini"> <el-table v-show="contractNumType===1" :data="tableData5" border style="width: 1200px" height="100px" size="mini">
<el-table-column align="center" width="50" type="selection"/>
<el-table-column label="组件名称" align="center" width="180"> <el-table-column label="组件名称" align="center" width="180">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.组件名称 }} {{ scope.row.组件名称 }}
@@ -90,7 +91,8 @@
</el-table> </el-table>
</el-card> </el-card>
<el-card> <el-card>
<el-table v-show="contractNumType===0" :data="tableData4" border style="width: 1200px;max-height: 420px;" height="320px" size="mini"> <el-table v-show="contractNumType===0" :data="tableData4" border style="width: 1200px;max-height: 420px;" height="320px" size="mini" @selection-change="handleSelectionChange">
<el-table-column align="center" width="50" type="selection"/>
<el-table-column label="物料名称" align="center" min-width="180"> <el-table-column label="物料名称" align="center" min-width="180">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.物料名称 }} {{ scope.row.物料名称 }}
@@ -433,14 +435,16 @@ export default {
tableData5: [], tableData5: [],
groupNum2: [], groupNum2: [],
groupNum5: [], groupNum5: [],
multipleSelection: [],
Selection: [],
group1: '', group1: '',
group2: '', group2: '',
group3: '', group3: '',
group5: '', group5: [],
group6: '', group6: '',
group7: '', group7: '',
group8: '', group8: '',
group9: '', group9: [],
group10: '', group10: '',
group11: '', group11: '',
group12: '' group12: ''
@@ -495,6 +499,12 @@ export default {
this.tableData5[index][date] = value this.tableData5[index][date] = value
this.update1(row) this.update1(row)
}, },
handleSelectionChange(val) {
this.multipleSelection = val
for (let i = 0; i < this.multipleSelection.length; i++) {
this.Selection.push(Number(this.multipleSelection[i].请购单明细流水号))
}
},
submitGroup() { submitGroup() {
submitGroup(this.contractNumValue, this.form3.groupNumValue).then(response => { submitGroup(this.contractNumValue, this.form3.groupNumValue).then(response => {
if (response.data[0].result === '1') { if (response.data[0].result === '1') {
@@ -759,21 +769,31 @@ export default {
this.group1 = '' this.group1 = ''
this.group2 = '' this.group2 = ''
this.group3 = '' this.group3 = ''
this.group5 = []
this.group7 = '' this.group7 = ''
this.group8 = '' this.group8 = ''
this.group9 = '' this.group9 = []
this.group10 = '' this.group10 = ''
this.group11 = '' this.group11 = ''
this.group12 = '' this.group12 = ''
for (let i = 0; i < this.tableData4.length; i++) { for (let i = 0; i < this.tableData4.length; i++) {
for (let j = 0; j < this.multipleSelection.length; j++) {
if (this.tableData4[i].请购单明细流水号 === this.multipleSelection[j].请购单明细流水号) {
console.log(333333)
this.group1 += this.tableData4[i].物料流水号 + ',' this.group1 += this.tableData4[i].物料流水号 + ','
this.group2 += this.tableData4[i].零件数量 + ',' this.group2 += this.tableData4[i].零件数量 + ','
this.group3 += this.tableData4[i].单价 + ',' this.group3 += this.tableData4[i].单价 + ','
this.group7 += this.taxRate + ',' this.group7 += this.taxRate + ','
this.group8 += this.currencyValue + ',' this.group8 += this.currencyValue + ','
this.group9 += this.tableData4[i].请购单明细流水号 + ',' this.group9.push(Number(this.tableData4[i].请购单明细流水号))
this.group11 += this.tableData4[i].单件定额工时 + ',' this.group11 += this.tableData4[i].单件定额工时 + ','
this.group12 += this.tableData4[i].准结定额工时 + ',' this.group12 += this.tableData4[i].准结定额工时 + ','
} else {
if (this.group5.indexOf(Number(this.tableData4[i].请购单明细流水号)) === -1 && this.Selection.indexOf(Number(this.tableData4[i].请购单明细流水号)) === -1) {
this.group5.push(Number(this.tableData4[i].请购单明细流水号))
}
}
}
} }
for (let i = 0; i < this.contractNum.length; i++) { for (let i = 0; i < this.contractNum.length; i++) {
if (this.contractNum[i].value === this.contractNumValue) { if (this.contractNum[i].value === this.contractNumValue) {
@@ -783,7 +803,7 @@ export default {
this.group1 = this.group1.substr(0, this.group1.length - 1) this.group1 = this.group1.substr(0, this.group1.length - 1)
this.group2 = this.group2.substr(0, this.group2.length - 1) this.group2 = this.group2.substr(0, this.group2.length - 1)
this.group3 = this.group3.substr(0, this.group3.length - 1) this.group3 = this.group3.substr(0, this.group3.length - 1)
doneContract(this.contractNumValue, this.RequisitionNumber, this.contractName, this.planArrivalTime, this.stipulateArrivalTime, this.supplierValue, this.textArea, this.contractValue, this.freight, this.group1, this.group2, this.group3, this.group7, this.group8, this.group9, this.id, this.group11, this.group12, this.AdvanceCharge).then(response => { doneContract(this.contractNumValue, this.RequisitionNumber, this.contractName, this.planArrivalTime, this.stipulateArrivalTime, this.supplierValue, this.textArea, this.contractValue, this.freight, this.group1, this.group2, this.group3, this.group7, this.group8, this.group9, this.id, this.group11, this.group12, this.AdvanceCharge, this.group5).then(response => {
if (response.data[0].result === '1') { if (response.data[0].result === '1') {
this.$message.success('生成合同成功') this.$message.success('生成合同成功')
this.reload() this.reload()