项目管理
This commit is contained in:
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user