项目管理

This commit is contained in:
liushuai
2019-04-09 09:25:49 +08:00
parent b8f5e48f7f
commit a23217515d
8 changed files with 189 additions and 44 deletions

View File

@@ -6,7 +6,7 @@ export function getProject() {
method: 'post',
data: {
type: '1',
name: '车间生产管理工艺_传递后_项目名称_查询数据_加工进度修改'
name: 'PDM_项目名称_查询数据'
}
})
}

View File

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

View File

@@ -16,7 +16,7 @@ export function searchPurchase(num) {
method: 'post',
data: {
type: '1',
name: 'PDM_项目名称_查询数据_成本分析',
name: '采购管理_项目采购总价_成本分析_查询数据',
param: '项目流水号=' + num
}
})

View File

@@ -486,6 +486,7 @@ export default {
接收任务时间: response.data[i].接收任务时间,
任务开始时间: response.data[i].任务开始时间,
计划完成时间: response.data[i].计划完成时间,
货期: response.data[i].货期,
实际完成时间: response.data[i].实际完成时间,
备注: response.data[i].备注
})
@@ -539,6 +540,7 @@ export default {
接收任务时间: response.data[i].接收任务时间,
任务开始时间: response.data[i].任务开始时间,
计划完成时间: response.data[i].计划完成时间,
货期: response.data[i].货期,
实际完成时间: response.data[i].实际完成时间,
备注: response.data[i].备注
})

View File

@@ -52,7 +52,9 @@
<!--style="width: 160px"-->
<!--type="date"-->
<!--placeholder="选择日期"/>-->
<!--<span>提前</span>-->
<!--<el-input-number v-model="warningValue" :min="1" controls-position="right" size="small" style="width: 90px"/>-->
<!--<span>天预警</span>-->
<el-button icon="el-icon-search" type="success" size="small" style="margin-left: 20px" @click="searchTable()">查询</el-button>
<el-table v-loading="loading" :data="tableData" size="mini" highlight-current-row style="width: 100%; margin-top: 30px" border element-loading-text="拼命加载中">
<el-table-column label="项目名称" align="center">
@@ -108,17 +110,22 @@
</el-table-column>
<el-table-column label="开始时间" align="center">
<template slot-scope="scope">
{{ scope.row.开始时间 }}
{{ scope.row.任务开始时间 }}
</template>
</el-table-column>
<el-table-column label="完成时间" align="center">
<el-table-column label="计划完成时间" align="center">
<template slot-scope="scope">
{{ scope.row.完成时间 }}
{{ scope.row.计划完成时间 }}
</template>
</el-table-column>
<el-table-column label="实际完成时间" align="center">
<template slot-scope="scope">
{{ scope.row.实际完成时间 }}
</template>
</el-table-column>
<el-table-column label="工期" align="center">
<template slot-scope="scope">
{{ scope.row. }}
{{ scope.row. }}
</template>
</el-table-column>
<el-table-column label="备注" align="center">
@@ -143,17 +150,22 @@
</el-table-column>
<el-table-column label="开始时间" align="center">
<template slot-scope="scope">
{{ scope.row.开始时间 }}
{{ scope.row.任务开始时间 }}
</template>
</el-table-column>
<el-table-column label="完成时间" align="center">
<el-table-column label="计划完成时间" align="center">
<template slot-scope="scope">
{{ scope.row.完成时间 }}
{{ scope.row.计划完成时间 }}
</template>
</el-table-column>
<el-table-column label="实际完成时间" align="center">
<template slot-scope="scope">
{{ scope.row.实际完成时间 }}
</template>
</el-table-column>
<el-table-column label="工期" align="center">
<template slot-scope="scope">
{{ scope.row. }}
{{ scope.row. }}
</template>
</el-table-column>
<el-table-column label="备注" align="center">
@@ -178,17 +190,22 @@
</el-table-column>
<el-table-column label="开始时间" align="center">
<template slot-scope="scope">
{{ scope.row.开始时间 }}
{{ scope.row.任务开始时间 }}
</template>
</el-table-column>
<el-table-column label="完成时间" align="center">
<el-table-column label="计划完成时间" align="center">
<template slot-scope="scope">
{{ scope.row.完成时间 }}
{{ scope.row.计划完成时间 }}
</template>
</el-table-column>
<el-table-column label="实际完成时间" align="center">
<template slot-scope="scope">
{{ scope.row.实际完成时间 }}
</template>
</el-table-column>
<el-table-column label="工期" align="center">
<template slot-scope="scope">
{{ scope.row. }}
{{ scope.row. }}
</template>
</el-table-column>
<el-table-column label="备注" align="center">
@@ -213,17 +230,22 @@
</el-table-column>
<el-table-column label="开始时间" align="center">
<template slot-scope="scope">
{{ scope.row.开始时间 }}
{{ scope.row.任务开始时间 }}
</template>
</el-table-column>
<el-table-column label="完成时间" align="center">
<el-table-column label="计划完成时间" align="center">
<template slot-scope="scope">
{{ scope.row.完成时间 }}
{{ scope.row.计划完成时间 }}
</template>
</el-table-column>
<el-table-column label="实际完成时间" align="center">
<template slot-scope="scope">
{{ scope.row.实际完成时间 }}
</template>
</el-table-column>
<el-table-column label="工期" align="center">
<template slot-scope="scope">
{{ scope.row. }}
{{ scope.row. }}
</template>
</el-table-column>
<el-table-column label="备注" align="center">
@@ -248,17 +270,22 @@
</el-table-column>
<el-table-column label="开始时间" align="center">
<template slot-scope="scope">
{{ scope.row.开始时间 }}
{{ scope.row.任务开始时间 }}
</template>
</el-table-column>
<el-table-column label="完成时间" align="center">
<el-table-column label="计划完成时间" align="center">
<template slot-scope="scope">
{{ scope.row.完成时间 }}
{{ scope.row.计划完成时间 }}
</template>
</el-table-column>
<el-table-column label="实际完成时间" align="center">
<template slot-scope="scope">
{{ scope.row.实际完成时间 }}
</template>
</el-table-column>
<el-table-column label="工期" align="center">
<template slot-scope="scope">
{{ scope.row. }}
{{ scope.row. }}
</template>
</el-table-column>
<el-table-column label="备注" align="center">
@@ -282,6 +309,18 @@ export default {
machine: [],
loading: false,
loading1: false,
now: '',
arrival: [],
judge: [],
arrival1: [],
judge1: [],
arrival2: [],
judge2: [],
arrival3: [],
judge3: [],
arrival4: [],
judge4: [],
warningValue: '',
tableData: [], // 表格数据
tableData1: [], // 表格数据
tableData2: [], // 表格数据
@@ -318,6 +357,7 @@ export default {
this.tableData3 = []
this.tableData4 = []
this.tableData5 = []
this.now = new Date()
if (this.projectValue !== '') {
if (this.machineValue !== '') {
searchtable(this.projectValue, this.machineValue).then(response => {
@@ -334,12 +374,23 @@ export default {
}).then(() => {
searchtable2(this.machineValue, 1).then(response => {
for (let i = 0; i < response.data.length; i++) {
// this.arrival.push(new Date(response.data[i].计划完成时间))
// if ((this.arrival[i] - this.now) > 0 && (this.arrival[i] - this.now) < (86400000 * this.warningValue)) {
// this.judge[i] = 1 // 即将拖期
// } else if ((this.arrival[i] - this.now) < 0) {
// this.judge[i] = 2 // 已拖期
// } else if ((this.arrival[i] - this.now) > (86400000 * this.warningValue)) {
// this.judge[i] = 3 // 进度正常
// }
if (response.data[i].任务开始时间 !== '' && response.data[i].任务开始时间 !== null) {
response.data[i].任务开始时间 = response.data[i].任务开始时间.split(' ')[0]
}
if (response.data[i].实际完成时间 !== '' && response.data[i].实际完成时间 !== null) {
response.data[i].实际完成时间 = response.data[i].实际完成时间.split(' ')[0]
}
if (response.data[i].计划完成时间 !== '' && response.data[i].计划完成时间 !== null) {
response.data[i].计划完成时间 = response.data[i].计划完成时间.split(' ')[0]
}
}
this.loading1 = false
console.log(response.data, 2)
@@ -347,12 +398,23 @@ export default {
})
searchtable2(this.machineValue, 2).then(response => {
for (let i = 0; i < response.data.length; i++) {
// this.arrival1.push(new Date(response.data[i].计划完成时间))
// if ((this.arrival1[i] - this.now) > 0 && (this.arrival1[i] - this.now) < (86400000 * this.warningValue)) {
// this.judge1[i] = 1 // 即将拖期
// } else if ((this.arrival1[i] - this.now) < 0) {
// this.judge1[i] = 2 // 已拖期
// } else if ((this.arrival1[i] - this.now) > (86400000 * this.warningValue)) {
// this.judge1[i] = 3 // 进度正常
// }
if (response.data[i].任务开始时间 !== '' && response.data[i].任务开始时间 !== null) {
response.data[i].任务开始时间 = response.data[i].任务开始时间.split(' ')[0]
}
if (response.data[i].实际完成时间 !== '' && response.data[i].实际完成时间 !== null) {
response.data[i].实际完成时间 = response.data[i].实际完成时间.split(' ')[0]
}
if (response.data[i].计划完成时间 !== '' && response.data[i].计划完成时间 !== null) {
response.data[i].计划完成时间 = response.data[i].计划完成时间.split(' ')[0]
}
}
this.loading1 = false
console.log(response.data, 3)
@@ -360,12 +422,23 @@ export default {
})
searchtable2(this.machineValue, 3).then(response => {
for (let i = 0; i < response.data.length; i++) {
// this.arrival2.push(new Date(response.data[i].计划完成时间))
// if ((this.arrival2[i] - this.now) > 0 && (this.arrival2[i] - this.now) < (86400000 * this.warningValue)) {
// this.judge2[i] = 1 // 即将拖期
// } else if ((this.arrival2[i] - this.now) < 0) {
// this.judge2[i] = 2 // 已拖期
// } else if ((this.arrival[i] - this.now) > (86400000 * this.warningValue)) {
// this.judge2[i] = 3 // 进度正常
// }
if (response.data[i].任务开始时间 !== '' && response.data[i].任务开始时间 !== null) {
response.data[i].任务开始时间 = response.data[i].任务开始时间.split(' ')[0]
}
if (response.data[i].实际完成时间 !== '' && response.data[i].实际完成时间 !== null) {
response.data[i].实际完成时间 = response.data[i].实际完成时间.split(' ')[0]
}
if (response.data[i].计划完成时间 !== '' && response.data[i].计划完成时间 !== null) {
response.data[i].计划完成时间 = response.data[i].计划完成时间.split(' ')[0]
}
}
this.loading1 = false
console.log(response.data, 4)
@@ -373,12 +446,23 @@ export default {
})
searchtable2(this.machineValue, 4).then(response => {
for (let i = 0; i < response.data.length; i++) {
// this.arrival3.push(new Date(response.data[i].计划完成时间))
// if ((this.arrival3[i] - this.now) > 0 && (this.arrival3[i] - this.now) < (86400000 * this.warningValue)) {
// this.judge3[i] = 1 // 即将拖期
// } else if ((this.arrival3[i] - this.now) < 0) {
// this.judge3[i] = 2 // 已拖期
// } else if ((this.arrival3[i] - this.now) > (86400000 * this.warningValue)) {
// this.judge3[i] = 3 // 进度正常
// }
if (response.data[i].任务开始时间 !== '' && response.data[i].任务开始时间 !== null) {
response.data[i].任务开始时间 = response.data[i].任务开始时间.split(' ')[0]
}
if (response.data[i].实际完成时间 !== '' && response.data[i].实际完成时间 !== null) {
response.data[i].实际完成时间 = response.data[i].实际完成时间.split(' ')[0]
}
if (response.data[i].计划完成时间 !== '' && response.data[i].计划完成时间 !== null) {
response.data[i].计划完成时间 = response.data[i].计划完成时间.split(' ')[0]
}
}
this.loading1 = false
console.log(response.data, 5)
@@ -386,12 +470,23 @@ export default {
})
searchtable2(this.machineValue, 5).then(response => {
for (let i = 0; i < response.data.length; i++) {
// this.arrival4.push(new Date(response.data[i].计划完成时间))
// if ((this.arrival4[i] - this.now) > 0 && (this.arrival4[i] - this.now) < (86400000 * this.warningValue)) {
// this.judge4[i] = 1 // 即将拖期
// } else if ((this.arrival3[i] - this.now) < 0) {
// this.judge4[i] = 2 // 已拖期
// } else if ((this.arrival3[i] - this.now) > (86400000 * this.warningValue)) {
// this.judge4[i] = 3 // 进度正常
// }
if (response.data[i].任务开始时间 !== '' && response.data[i].任务开始时间 !== null) {
response.data[i].任务开始时间 = response.data[i].任务开始时间.split(' ')[0]
}
if (response.data[i].实际完成时间 !== '' && response.data[i].实际完成时间 !== null) {
response.data[i].实际完成时间 = response.data[i].实际完成时间.split(' ')[0]
}
if (response.data[i].计划完成时间 !== '' && response.data[i].计划完成时间 !== null) {
response.data[i].计划完成时间 = response.data[i].计划完成时间.split(' ')[0]
}
}
this.loading1 = false
console.log(response.data, 6)

View File

@@ -542,7 +542,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, data.备件数量)
const resp = await transferMX(data.图号或者型号, data.名称, total, data.备注, data.标记, data.设计者编号, data.组件流水号, data.材料流水号, data.规格, 1, data.是否传递, data.序号, data.id, data.备件数量, data.部件数量)
await sleep(10)
if (resp.data[0].result === '0') {
this.err++
@@ -558,7 +558,7 @@ export default {
} else {
dataType = 1
}
const resp = await transferWG(data.组件流水号, data.物料流水号, total, data.备注, data.标记, data.设计者编号, data.是否传递, dataType, data.序号, data.id, data.备件数量)
const resp = await transferWG(data.组件流水号, data.物料流水号, total, data.备注, data.标记, data.设计者编号, data.是否传递, dataType, data.序号, data.id, data.备件数量, data.部件数量)
await sleep(10)
if (resp.data[0].result === '0') {
this.err++

View File

@@ -73,6 +73,11 @@
align="center">
<template slot-scope="scope">{{ scope.row.零件数量 }}</template>
</el-table-column>
<el-table-column label="部件数量" align="center">
<template slot-scope="scope">
{{ scope.row.部件数量 }}
</template>
</el-table-column>
<el-table-column label="机床数量" align="center">
<template slot-scope="scope">
{{ scope.row.机床数量 }}
@@ -164,6 +169,11 @@
{{ scope.row.零件数量 }}
</template>
</el-table-column>
<el-table-column label="部件数量" align="center">
<template slot-scope="scope">
{{ scope.row.部件数量 }}
</template>
</el-table-column>
<el-table-column label="机床数量" align="center">
<template slot-scope="scope">
{{ scope.row.机床数量 }}

View File

@@ -75,7 +75,7 @@
</div>
</template>
<script>import { initProject, searchOutsourcing, searchHome } from '@/api/WorkshopProcurement/costStatistics'
<script>import { initProject, searchOutsourcing, searchHome, searchWorkPurchase, searchPurchase } from '@/api/WorkshopProcurement/costStatistics'
import echarts from 'echarts'
import CountTo from 'vue-count-to'
export default {
@@ -84,10 +84,10 @@ export default {
},
data() {
return {
Purchase: 25040,
WorkPurchase: 5308,
Outsourcing: 3240,
Home: 37806,
Purchase: 0,
WorkPurchase: 0,
Outsourcing: 0,
Home: 0,
projectValue: 1,
project: [],
data: []
@@ -103,11 +103,17 @@ export default {
methods: {
fetchData() {
this.getSelect(initProject, ['项目名称', '项目流水号'], 'project')
this.searchTable()
},
searchTable() {
this.data = []
searchOutsourcing(this.projectValue).then(response => {
this.Outsourcing = parseFloat(response.data[0].外协总价)
console.log(response, 111)
if (response.data.length === 0) {
this.Outsourcing = 0
} else {
this.Outsourcing = parseFloat(response.data[0].外协总价)
}
return this.Outsourcing
}).then(data => {
this.data.push({
@@ -116,15 +122,51 @@ export default {
})
}).then(() => {
searchHome(this.projectValue).then(response => {
this.Home = parseFloat(response.data[0].项目工时)
console.log(response, 222)
if (response.data.length === 0) {
this.Home = 0
} else {
this.Home = parseFloat(response.data[0].项目工时)
}
return this.Home
}).then(data => {
this.data.push({
value: data,
name: '自家工时'
})
this.drawLine()
this.drawLine1()
}).then(() => {
searchWorkPurchase(this.projectValue).then(response => {
console.log(response, 333)
if (response.data.length === 0) {
this.WorkPurchase = 0
} else {
this.WorkPurchase = parseFloat(response.data[0].总金额)
}
return this.WorkPurchase
}).then(data => {
this.data.push({
value: data,
name: '制造部采购'
})
})
}).then(() => {
searchPurchase(this.projectValue).then(response => {
console.log(response, 444)
if (response.data.length === 0) {
this.Purchase = 0
} else {
this.Purchase = parseFloat(response.data[0].优惠后总价)
}
return this.Purchase
}).then(data => {
this.data.push({
value: data,
name: '采购部采购'
})
}).then(() => {
this.drawLine()
this.drawLine1()
})
})
})
},
@@ -152,11 +194,7 @@ export default {
type: 'pie',
radius: '57%',
center: ['50%', '50%'],
data: [{ value: 25040, name: '采购部采购' },
{ value: 5308, name: '制造部采购' },
{ value: 3240, name: '外协工时' },
{ value: 37806, name: '自家工时' }
],
data: this.data,
itemStyle: {
emphasis: {
shadowBlur: 10,
@@ -198,7 +236,7 @@ export default {
series: [{
name: '销量',
type: 'bar',
data: [25040, 5308, 3240, 37806]
data: [this.Outsourcing, this.Home, this.Purchase, this.WorkPurchase]
}]
})
setTimeout(function() {