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

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

@@ -134,25 +134,25 @@ export function searchDetailed1(num) {
}
})
}
export function purchaseRequisition(RequisitionList, projectName, projectFloatValue, MachineToolNumber, machineFloatValue, groupName, groupFloatValue, BasicPartsNumber, MaterialName, PartToolNumber, Material, NumberOfParts, PartType, time, MaterialNum) {
export function purchaseRequisition(RequisitionList, projectName, projectFloatValue, MachineToolNumber, machineFloatValue, groupName, groupFloatValue, BasicPartsNumber, MaterialName, PartToolNumber, Material, NumberOfParts, PartType, time, MaterialNum, ReMarks) {
return request({
url: '',
method: 'post',
data: {
type: '2',
name: '车间管理_基本件采购_请购单明细_请购',
param: '请购单流水号=' + RequisitionList + '&项目名称=' + projectName + '&项目流水号=' + projectFloatValue + '&机床图号=' + MachineToolNumber + '&机床流水号=' + machineFloatValue + '&组号=' + groupName + '&组件流水号=' + groupFloatValue + '&基本件流水号=' + BasicPartsNumber + '&物料名称=' + MaterialName + '&零件图号=' + PartToolNumber + '&材料=' + Material + '&零件数量=' + NumberOfParts + '&零件类型=' + PartType + '&物料计划到货时间=' + time + '&物料流水号=' + MaterialNum
param: '请购单流水号=' + RequisitionList + '&项目名称=' + projectName + '&项目流水号=' + projectFloatValue + '&机床图号=' + MachineToolNumber + '&机床流水号=' + machineFloatValue + '&组号=' + groupName + '&组件流水号=' + groupFloatValue + '&基本件流水号=' + BasicPartsNumber + '&物料名称=' + MaterialName + '&零件图号=' + PartToolNumber + '&材料=' + Material + '&零件数量=' + NumberOfParts + '&零件类型=' + PartType + '&物料计划到货时间=' + time + '&物料流水号=' + MaterialNum + '&备注=' + ReMarks
}
})
}
export function purchaseRequisition1(RequisitionList, projectName, projectFloatValue, MachineToolNumber, machineFloatValue, groupName, groupFloatValue, StandardPartsAndOutsourcing, MaterialName, MaterialSpecification, MaterialModel, NumberOfParts, PartType, time, MaterialNum) {
export function purchaseRequisition1(RequisitionList, projectName, projectFloatValue, MachineToolNumber, machineFloatValue, groupName, groupFloatValue, StandardPartsAndOutsourcing, MaterialName, MaterialSpecification, MaterialModel, NumberOfParts, PartType, time, MaterialNum, ReMarks) {
return request({
url: '',
method: 'post',
data: {
type: '2',
name: '车间管理_基本件采购_请购单明细_请购',
param: '请购单流水号=' + RequisitionList + '&项目名称=' + projectName + '&项目流水号=' + projectFloatValue + '&机床图号=' + MachineToolNumber + '&机床流水号=' + machineFloatValue + '&组号=' + groupName + '&组件流水号=' + groupFloatValue + '&标准件和外购件流水号=' + StandardPartsAndOutsourcing + '&物料名称=' + MaterialName + '&物料规格=' + MaterialSpecification + '&物料型号=' + MaterialModel + '&零件数量=' + NumberOfParts + '&零件类型=' + PartType + '&物料计划到货时间=' + time + '&物料流水号=' + MaterialNum
param: '请购单流水号=' + RequisitionList + '&项目名称=' + projectName + '&项目流水号=' + projectFloatValue + '&机床图号=' + MachineToolNumber + '&机床流水号=' + machineFloatValue + '&组号=' + groupName + '&组件流水号=' + groupFloatValue + '&标准件和外购件流水号=' + StandardPartsAndOutsourcing + '&物料名称=' + MaterialName + '&物料规格=' + MaterialSpecification + '&物料型号=' + MaterialModel + '&零件数量=' + NumberOfParts + '&零件类型=' + PartType + '&物料计划到货时间=' + time + '&物料流水号=' + MaterialNum + '&备注=' + ReMarks
}
})
}

View File

@@ -66,6 +66,17 @@ export function searchData2(num) {
}
})
}
export function update(num, time, remarks) {
return request({
url: '',
method: 'post',
data: {
type: '1',
name: '车间管理_基本件采购_请购单明细_编辑数据',
param: '请购单明细流水号=' + num + '&物料计划到货时间=' + time + '&备注=' + remarks
}
})
}
// 初始化付款时间节点
export function initPayTimeNode() {
return request({

View File

@@ -15,7 +15,7 @@ const service = axios.create({
// baseURL: `http://192.168.1.149:8411/submit/MESCommonBase.ashx`,
// baseURL: `http://localhost:8411/submit/MESCommonBase.ashx`,
// baseURL: `http://localhost:8411/submit/MESCommonBase.ashx`,
baseURL: `http://192.168.1.149:8411/submit/MESCommonBase.ashx`,
baseURL: `http://localhost:8411/submit/MESCommonBase.ashx`,
// baseURL: `http://192.168.1.112:8411/submit/MESCommonBase.ashx`,
timeout: 1500000 // 请求超时时间
})

View File

@@ -827,6 +827,7 @@ export default {
this.processNameClassValue = ''
this.processNameValue = ''
this.processRequestValue = ''
this.processName = []
this.Procedure = row.装配工序流水号
this.number = row.序号
},

View File

@@ -177,7 +177,7 @@
</el-table>
</el-tab-pane>
</el-tabs>
<span>物料计划到货时间</span>
<span>交货期</span>
<el-date-picker
v-model="time"
size="small"
@@ -186,8 +186,8 @@
value-format="yyyy-MM-dd"
placeholder="选择日期"/>
<el-button type="success" size="small" icon="el-icon-star-off" style="margin-top: 15px; margin-left: 15px" @click="purchaseRequisition()">车间请购</el-button>
<el-button v-show="PartType!=='基本件'" type="primary" size="small" icon="el-icon-star-off" style="margin-top: 15px; margin-left: 15px" @click="PurchasingDepartment()">采购部门采购</el-button>
<el-button v-show="PartType==='基本件'" type="warning" size="small" icon="el-icon-star-off" style="margin-top: 15px; margin-left: 15px" @click="Production()">车间生产</el-button>
<el-button type="primary" size="small" icon="el-icon-star-off" style="margin-top: 15px; margin-left: 15px" @click="PurchasingDepartment()">采购部门采购</el-button>
<el-button type="warning" size="small" icon="el-icon-star-off" style="margin-top: 15px; margin-left: 15px" @click="Production()">车间生产</el-button>
</el-card>
<el-card>
<el-row>
@@ -255,7 +255,7 @@
{{ scope.row.零件类型 }}
</template>
</el-table-column>
<el-table-column label="物料计划到货时间" align="center">
<el-table-column label="交货期" align="center">
<template slot-scope="scope">
{{ scope.row.物料计划到货时间 }}
</template>
@@ -309,7 +309,7 @@
{{ scope.row.零件类型 }}
</template>
</el-table-column>
<el-table-column label="物料计划到货时间" align="center">
<el-table-column label="交货期" align="center">
<template slot-scope="scope">
{{ scope.row.物料计划到货时间 }}
</template>
@@ -427,6 +427,7 @@ export default {
MaterialSpecification: [],
MaterialModel: [],
NumberOfParts: [],
ReMarks: [],
projectName: '',
MachineToolNumber: '',
groupName: '',
@@ -668,6 +669,7 @@ export default {
this.PartToolNumber[i] = val[i].零件图号
this.Material[i] = val[i].材料
this.NumberOfParts[i] = val[i].零件数量
this.ReMarks[i] = val[i].备注
}
} else if (this.PartType === '外购件') {
this.MaterialNum = []
@@ -683,6 +685,7 @@ export default {
this.MaterialSpecification[i] = val[i].物料规格
this.MaterialModel[i] = val[i].物料型号
this.NumberOfParts[i] = val[i].零件数量
this.ReMarks[i] = val[i].备注
}
} else if (this.PartType === '标准件') {
this.MaterialNum = []
@@ -698,6 +701,7 @@ export default {
this.MaterialSpecification[i] = val[i].物料规格
this.MaterialModel[i] = val[i].物料型号
this.NumberOfParts[i] = val[i].零件数量
this.ReMarks[i] = val[i].备注
}
}
},
@@ -707,7 +711,7 @@ export default {
this.result = 0
if (this.PartType === '基本件') {
for (let i = 0; i < this.BasicPartsNumber.length; i++) {
purchaseRequisition(this.RequisitionList, this.projectName, this.projectFloatValue, this.MachineToolNumber, this.machineFloatValue, this.groupName, this.groupFloatValue, this.BasicPartsNumber[i], this.MaterialName[i], this.PartToolNumber[i], this.Material[i], this.NumberOfParts[i], 3, this.time, this.MaterialNum[i]).then(response => {
purchaseRequisition(this.RequisitionList, this.projectName, this.projectFloatValue, this.MachineToolNumber, this.machineFloatValue, this.groupName, this.groupFloatValue, this.BasicPartsNumber[i], this.MaterialName[i], this.PartToolNumber[i], this.Material[i], this.NumberOfParts[i], 3, this.time, this.MaterialNum[i], this.ReMarks[i]).then(response => {
this.result += parseInt(response.data[0].result)
console.log(this.result)
if (this.result === this.BasicPartsNumber.length) {
@@ -729,7 +733,7 @@ export default {
}
} else if (this.PartType === '外购件') {
for (let i = 0; i < this.StandardPartsAndOutsourcing.length; i++) {
purchaseRequisition1(this.RequisitionList, this.projectName, this.projectFloatValue, this.MachineToolNumber, this.machineFloatValue, this.groupName, this.groupFloatValue, this.StandardPartsAndOutsourcing[i], this.MaterialName[i], this.MaterialSpecification[i], this.MaterialModel[i], this.NumberOfParts[i], 2, this.time, this.MaterialNum[i]).then(response => {
purchaseRequisition1(this.RequisitionList, this.projectName, this.projectFloatValue, this.MachineToolNumber, this.machineFloatValue, this.groupName, this.groupFloatValue, this.StandardPartsAndOutsourcing[i], this.MaterialName[i], this.MaterialSpecification[i], this.MaterialModel[i], this.NumberOfParts[i], 2, this.time, this.MaterialNum[i], this.ReMarks[i]).then(response => {
this.result += parseInt(response.data[0].result)
if (this.result === this.StandardPartsAndOutsourcing.length) {
this.$message.success('请购成功')
@@ -749,7 +753,7 @@ export default {
}
} else if (this.PartType === '标准件') {
for (let i = 0; i < this.StandardPartsAndOutsourcing.length; i++) {
purchaseRequisition1(this.RequisitionList, this.projectName, this.projectFloatValue, this.MachineToolNumber, this.machineFloatValue, this.groupName, this.groupFloatValue, this.StandardPartsAndOutsourcing[i], this.MaterialName[i], this.MaterialSpecification[i], this.MaterialModel[i], this.NumberOfParts[i], 1, this.time, this.MaterialNum[i]).then(response => {
purchaseRequisition1(this.RequisitionList, this.projectName, this.projectFloatValue, this.MachineToolNumber, this.machineFloatValue, this.groupName, this.groupFloatValue, this.StandardPartsAndOutsourcing[i], this.MaterialName[i], this.MaterialSpecification[i], this.MaterialModel[i], this.NumberOfParts[i], 1, this.time, this.MaterialNum[i], this.ReMarks[i]).then(response => {
this.result += parseInt(response.data[0].result)
if (this.result === this.StandardPartsAndOutsourcing.length) {
this.$message.success('请购成功')

View File

@@ -665,6 +665,7 @@ export default {
})
},
handleEdit(row) {
console.log(row)
this.title = '编辑'
this.dialogFormVisible1 = true
this.form.contractNumber = row.合同编号

View File

@@ -167,6 +167,7 @@ export default {
this.disabled = false
return
} else {
console.log(this.worksheet[j], 2222)
this.worksheet[j].G1 ? establishment = this.worksheet[j].G1.v : establishment = ''
this.worksheet[j].I1 ? proofread = this.worksheet[j].I1.v : proofread = ''
this.worksheet[j].L1 ? review = this.worksheet[j].L1.v : review = ''
@@ -179,8 +180,7 @@ export default {
this.worksheet[j].Q2 ? totalNum = parseInt(this.worksheet[j].Q2.v.replace(/[^0-9]/ig, '')) : totalNum = ''
this.worksheet[j].R2 ? contractNum = this.worksheet[j].R2.v : contractNum = ''
this.worksheet[j].M2 ? groupNum = this.worksheet[j].M2.v : groupNum = ''
const len = parseInt(this.worksheet[j]['!ref'].split(':')[1].substring(1)) - 3
for (let i = 0; i < len; i++) {
for (let i = 0; i < 999; i++) {
const attr = i + 4
drawingNum = this.worksheet[j][`B${attr}`] ? this.worksheet[j][`B${attr}`].v : ''
name = this.worksheet[j][`D${attr}`] ? this.worksheet[j][`D${attr}`].v : ''
@@ -237,6 +237,7 @@ export default {
}
}
} catch (e) {
alert(3)
this.err++
this.$message.error(`导入数据错误`)
console.log(`导入数据错误${e}`)

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')