This commit is contained in:
liushuai
2018-12-28 12:29:43 +08:00
parent b12546fb64
commit 75981dca52
11 changed files with 251 additions and 64 deletions

View File

@@ -105,14 +105,14 @@ export function updateMachineData(No, number, remark) {
})
}
export function getGroupData(project, machine) {
export function getGroupData(machine) {
return request({
url: '',
method: 'post',
data: {
type: '1',
name: 'PDM_装箱单_机床所属部件_查询数据',
param: `项目=${project}&机床=${machine}`
param: `机床流水号=${machine}`
}
})
}

View File

@@ -291,14 +291,14 @@ export function allDelete(project, machine, group) {
})
}
// 传递零件
export function transferMX(num1, name, num2, remark, mark, num3, num4, num5, num7, type, transmit, num6, id) {
export function transferMX(num1, name, num2, remark, mark, num3, num4, num5, num7, type, transmit, num6, id, Num) {
return request({
url: '',
method: 'post',
data: {
type: '2',
name: 'PDM_零件明细表_基本件_大量导入',
param: '图号或者型号=' + num1 + '&零件名称=' + name + '&零件数量=' + num2 + '&零件备注=' + remark + '&标记=' + mark + '&设计者编号=' + num3 + '&组件流水号=' + num4 + '&材料流水号=' + num5 + '&规格\\=' + num7 + '&数据类型=' + type + '&是否传递=' + transmit + '&序号=' + num6 + '&id=' + id
param: '图号或者型号=' + num1 + '&零件名称=' + name + '&零件数量=' + num2 + '&零件备注=' + remark + '&标记=' + mark + '&设计者编号=' + num3 + '&组件流水号=' + num4 + '&材料流水号=' + num5 + '&规格\\=' + num7 + '&数据类型=' + type + '&是否传递=' + transmit + '&序号=' + num6 + '&id=' + id + '&备件数量=' + Num
}
})
}
@@ -314,14 +314,14 @@ export function transferMX1(num1, name, num2, remark, mark, num3, num4, num5, nu
}
})
}
export function transferWG(groupNum, materialNum, totalNum, remarks, mark, designNum, isTransfer, dataType, No, id) {
export function transferWG(groupNum, materialNum, totalNum, remarks, mark, designNum, isTransfer, dataType, No, id, Num) {
return request({
url: '',
method: 'post',
data: {
type: '2',
name: 'PDM_零件明细表_标准件和外购件_大量导入',
param: `组件流水号=${groupNum}&物料流水号=${materialNum}&零件数量=${totalNum}&备注=${remarks}&标记=${mark}&设计者编号=${designNum}&是否传递=${isTransfer}&数据类型=${dataType}&序号=${No}&id=${id}`
param: `组件流水号=${groupNum}&物料流水号=${materialNum}&零件数量=${totalNum}&备注=${remarks}&标记=${mark}&设计者编号=${designNum}&是否传递=${isTransfer}&数据类型=${dataType}&序号=${No}&id=${id}&备件数量=${Num}`
}
})
}

View File

@@ -0,0 +1,38 @@
import request from '@/utils/request'
// 初始化合同
export function initPayState() {
return request({
url: '',
method: 'post',
data: {
type: '1',
name: '车间管理_基本件外购质检_合同查询'
}
})
}
// 查询表1
export function searchParts(pageCurrent, pageSize, check1, num, check2, name) {
return request({
url: '',
method: 'post',
data: {
type: '1',
name: '车间管理_基本件外购质检_查询数据',
param: `采购合同流水号_check=${check1}&采购合同流水号=${num}&供应商名称_check=${check2}&供应商名称=${name}`,
Pagination: pageCurrent + '&' + pageSize
}
})
}
// 保存
export function Preservation(id, num, num1) {
return request({
url: '',
method: 'post',
data: {
type: '2',
name: '车间管理_核算总额_编辑数据',
param: `请购单明细流水号组=${id}&核算总额组=${num}&核算单价组=${num1}`
}
})
}

View File

@@ -131,18 +131,6 @@ export function searchTolerance(val1, val2) {
}
})
}
// 工艺定额人员查询
export function initPerson() {
return request({
url: '',
method: 'post',
data: {
type: '1',
name: '人事档案管理_人员_部门与人员_查询数据_根据部门编号',
param: '考核部门编号=17'
}
})
}
// 完艺工艺拷贝
export function gongyiCopy(num1, num2) {
return request({

View File

@@ -11,26 +11,15 @@ export function initPayState() {
}
})
}
// 初始化零件
export function initParts() {
return request({
url: '',
method: 'post',
data: {
type: '1',
name: '车间管理_基本件外购质检_零件查询'
}
})
}
// 查询表1
export function searchParts(pageCurrent, pageSize, check1, num, check2, name, check3, num1) {
export function searchParts(pageCurrent, pageSize, check1, num, check2, name) {
return request({
url: '',
method: 'post',
data: {
type: '1',
name: '车间管理_基本件外购质检_查询数据',
param: `采购合同流水号_check=${check1}&采购合同流水号=${num}&供应商名称_check=${check2}&供应商名称=${name}&物料流水号_check=${check3}&物料流水号=${num1}`,
param: `采购合同流水号_check=${check1}&采购合同流水号=${num}&供应商名称_check=${check2}&供应商名称=${name}`,
Pagination: pageCurrent + '&' + pageSize
}
})

View File

@@ -98,7 +98,7 @@
/>
<el-table-column
align="center"
prop="部件名称"
prop="名称"
label="名称"
/>
<el-table-column
@@ -108,7 +108,7 @@
/>
<el-table-column
align="center"
prop="部件数量"
prop="数量"
label="数量"
/>
<el-table-column
@@ -183,10 +183,10 @@
<template slot-scope="scope">{{ scope.row.名称 }}</template>
</el-table-column>
<el-table-column
label="规格"
label="代号"
align="center"
min-width="100px">
<template slot-scope="scope">{{ scope.row.规格 }}</template>
<template slot-scope="scope">{{ scope.row.图号 }}</template>
</el-table-column>
<el-table-column
label="数量"
@@ -595,13 +595,16 @@ export default {
this.machineTableData = []
const response = await getMachineData(this.receiptNum)
const data = response.data
console.log(data, 1111)
for (let i = 0; i < data.length; i++) {
const resp = await getGroupData(this.projectName, data[i].)
const resp = await getGroupData(data[i].机床)
console.log(resp)
const groupData = resp.data.map(item => {
item.类别 = '机床所属部件'
item.代号 = data[i].代号 + '-' + item..split('-')[0]
item.代号 = data[i].代号 + '-' + item. + '组'
return item
})
console.log(groupData)
this.machineTableData.push({
序号: data[i].序号,
代号: data[i].代号,
@@ -686,6 +689,10 @@ export default {
},
async getSpareData() {
const response = await getSpareData(this.receiptNum)
console.log(response)
for (let i = 0; i < response.data.length; i++) {
response.data[i].图号 = response.data[i].图号 + response.data[i].规格
}
this.spareData = response.data
},
addSpare() {

View File

@@ -118,6 +118,7 @@ export default {
},
async selected(data) { // 选择需要导入的文件
this.worksheet = data.worksheet // 获取每个多选文件的表格坐标及值
console.log(this.worksheet)
this.itemFile = data.itemFile
},
handleRemove(file) { // 移除文件

View File

@@ -522,7 +522,7 @@ export default {
const data = this.tableDataAll[i]
console.log(data)
const total = parseInt(data.备件数量) + parseInt(data.装机数量) * parseInt(data.部件数量)
const resp = await transferMX(data.图号或者型号, data.名称, total, data.备注, data.标记, data.设计者编号, data.组件流水号, data.材料流水号, data.规格, 1, data.是否传递, data.序号, data.id)
const resp = await transferMX(data.图号或者型号, data.名称, total, data.备注, data.标记, data.设计者编号, data.组件流水号, data.材料流水号, data.规格, 1, data.是否传递, data.序号, data.id, data.备件数量)
await sleep(10)
if (resp.data[0].result === '0') {
this.err++
@@ -538,7 +538,7 @@ export default {
} else {
dataType = 1
}
const resp = await transferWG(data.组件流水号, data.物料流水号, total, data.备注, data.标记, data.设计者编号, data.是否传递, dataType, data.序号, data.id)
const resp = await transferWG(data.组件流水号, data.物料流水号, total, data.备注, data.标记, data.设计者编号, data.是否传递, dataType, data.序号, data.id, data.备件数量)
await sleep(10)
if (resp.data[0].result === '0') {
this.err++

View File

@@ -0,0 +1,180 @@
<template>
<div class="app-container">
<el-card>
<el-row>
<span>合同号:</span>
<el-select v-model="contractNumValue" placeholder="合同号" size="small" filterable clearable>
<el-option
v-for="item in contractNum"
:key="item.value"
:label="item.label"
:value="item.value">
<div style="float: left">{{ item.label }}</div>
<div style="float: right; color: #8492a6; font-size: 13px">{{ item.name }}</div>
</el-option>
</el-select>
<el-button type="success" size="small" icon="el-icon-search" style="margin-left:10px" @click="total=0;pageCurrent=1;pageSize=10;searchTable()">查询</el-button>
<el-button type="primary" size="small" icon="el-icon-cjn-09" style="margin-left:10px" @click="Preservation">保存</el-button>
</el-row>
</el-card>
<el-card>
<el-table
v-loading="loading"
:data="tableData"
style="width: 100%"
size="small"
highlight-current-row
min-height="540px"
height="540px"
border>
<el-table-column align="center" label="采购合同编号">
<template slot-scope="scope">
{{ scope.row.采购合同编号 }}
</template>
</el-table-column>
<el-table-column align="center" label="供应商">
<template slot-scope="scope">
{{ scope.row.供应商名称 }}
</template>
</el-table-column>
<el-table-column align="center" label="零件号" width="170px">
<template slot-scope="scope">
{{ scope.row.物料型号 }}
</template>
</el-table-column>
<el-table-column align="center" label="零件名称" width="170px">
<template slot-scope="scope">
{{ scope.row.物料名称 }}
</template>
</el-table-column>
<el-table-column align="center" label="数量" width="70px">
<template slot-scope="scope">
{{ scope.row.数量 }}
</template>
</el-table-column>
<el-table-column align="center" label="重量或面积" width="150px">
<template slot-scope="scope">
{{ scope.row.重量或面积 }}
</template>
</el-table-column>
<el-table-column align="center" label="单位" width="80px">
<template slot-scope="scope">
{{ scope.row.单位 }}
</template>
</el-table-column>
<el-table-column align="center" label="单价" width="100px">
<template slot-scope="scope">
<el-input v-model="scope.row.核算单价" size="mini" width="80px" align="center" @change="update(scope.row)"/>
</template>
</el-table-column>
<el-table-column align="center" label="总额" width="100px">
<template slot-scope="scope">
<el-input v-model="scope.row.核算总额" size="mini" width="80px" align="center" readonly/>
</template>
</el-table-column>
</el-table>
<div class="block" style="margin-top: 10px;">
<el-pagination
:current-page="pageCurrent"
:page-sizes="[10, 20, 30, 40, 50]"
:page-size="pageSize"
:total="total"
layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"/>
</div>
</el-card>
</div>
</template>
<script>import { initPayState, searchParts, Preservation } from '@/api/WorkshopProcurement/AccountingPrice'
import { mapGetters } from 'vuex'
export default {
data() {
return {
check1: 0,
loading: false,
contractNumValue: '',
contractNum: [],
tableData: [],
Requisition: [],
Total: [],
UnitPrice: [],
pageSize: 10,
pageCurrent: 1,
total: 0
}
},
computed: {
...mapGetters([
'sidebar',
'avatar',
'name',
'id' // 人员编号
])
},
created() {
this.fetchData()
},
methods: {
fetchData() {
initPayState().then(response => {
for (let i = 0; i < response.data.length; i++) {
this.contractNum.push({
label: response.data[i].采购合同编号,
name: response.data[i].采购合同名称,
value: response.data[i].采购合同流水号
})
}
})
},
searchTable() {
this.loading = true
this.contractNumValue ? this.check1 = 1 : this.check1 = 0
searchParts(this.pageCurrent, this.pageSize, this.check1, this.contractNumValue).then(response => {
this.loading = false
console.log(response.data.rows)
for (let i = 0; i < response.data.rows.length; i++) {
if (response.data.rows[i].物料型号 === null || response.data.rows[i].物料型号 === '') {
response.data.rows[i].物料型号 = response.data.rows[i].零件图号
}
}
this.tableData = response.data.rows
console.log(this.tableData)
this.total = response.data.total
})
},
update(row) {
row.核算总额 = row.核算单价 * parseFloat(row.重量或面积)
},
Preservation() {
for (let i = 0; i < this.tableData.length; i++) {
console.log(this.tableData[i].请购单明细流水号, this.tableData[i].核算总额)
this.Requisition.push(this.tableData[i].请购单明细流水号)
this.UnitPrice.push(this.tableData[i].核算单价)
this.Total.push(this.tableData[i].核算总额)
}
Preservation(this.Requisition, this.Total, this.UnitPrice).then(response => {
if (response.data[0].result === '1') {
this.$message.success('保存成功')
} else {
this.$message.error('保存失败')
}
})
},
handleSizeChange(val) {
this.pageSize = val
this.pageCurrent = 1
this.searchTable()
},
handleCurrentChange(val) {
this.pageCurrent = val
this.searchTable()
}
}
}
</script>
<style scoped>
</style>

View File

@@ -633,7 +633,6 @@ export default {
},
created() {
this.fetchData()
this.initPerson()
},
methods: {
fetchData() {

View File

@@ -15,14 +15,6 @@
</el-select>
<span>供应商:</span>
<el-input v-model="supplierName" placeholder="供应商" size="small" clearable style="width: 200px"/>
<span>零件名称:</span>
<el-select v-model="PartNumberValue" placeholder="零件名称" size="small" clearable>
<el-option
v-for="item in PartNumber"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<el-button type="success" size="small" icon="el-icon-search" style="margin-left:10px" @click="total=0;pageCurrent=1;pageSize=10;searchTable()">查询</el-button>
</el-row>
</el-card>
@@ -105,8 +97,7 @@
<el-button
size="mini"
type="primary"
icon="el-icon-star-off"
@click="handleEdit(scope.row)">通过</el-button>
@click="handleEdit(scope.row)">完成</el-button>
</template>
</el-table-column>
</el-table>
@@ -125,7 +116,7 @@
</template>
<script>
import { initPayState, initParts, searchParts, update, deleteData, editData } from '@/api/WorkshopProcurement/PurchasingQualityInspection'
import { initPayState, searchParts, update, deleteData, editData } from '@/api/WorkshopProcurement/PurchasingQualityInspection'
import { mapGetters } from 'vuex'
export default {
@@ -133,13 +124,10 @@ export default {
return {
check1: 0,
check2: 0,
check3: 0,
loading: false,
contractNumValue: '',
contractNum: [],
supplierName: '',
PartNumberValue: '',
PartNumber: [],
tableData: [],
pageSize: 10,
pageCurrent: 1,
@@ -168,22 +156,19 @@ export default {
})
}
})
initParts().then(response => {
for (let i = 0; i < response.data.length; i++) {
this.PartNumber.push({
label: response.data[i].物料名称,
value: response.data[i].物料流水号
})
}
})
},
searchTable() {
this.loading = true
this.contractNumValue ? this.check1 = 1 : this.check1 = 0
this.supplierName ? this.check2 = 1 : this.check2 = 0
this.PartNumberValue ? this.check3 = 1 : this.check3 = 0
searchParts(this.pageCurrent, this.pageSize, this.check1, this.contractNumValue, this.check2, this.supplierName, this.check3, this.PartNumberValue).then(response => {
searchParts(this.pageCurrent, this.pageSize, this.check1, this.contractNumValue, this.check2, this.supplierName).then(response => {
this.loading = false
console.log(response.data.rows)
for (let i = 0; i < response.data.rows.length; i++) {
if (response.data.rows[i].物料型号 === null || response.data.rows[i].物料型号 === '') {
response.data.rows[i].物料型号 = response.data.rows[i].零件图号
}
}
this.tableData = response.data.rows
this.total = response.data.total
})