This commit is contained in:
bryan sun
2019-12-17 15:31:34 +08:00
9 changed files with 201 additions and 54 deletions

View File

@@ -12,3 +12,24 @@ export function search1(num1, num2, num3, num4, num5) {
} }
}) })
} }
export function search2(num1, num2, num3, num4, num5) {
return request({
url: '',
method: 'post',
data: {
type: '1',
name: '车间生产管理工艺_金工工时统计_查询数据',
param: '操作者_check=' + num1 + '&姓名=' + num2 + '&时间_check=' + num3 + '&开始时间=' + num4 + '&结束时间=' + num5
}
})
}
export function searchPerson() {
return request({
url: '',
method: 'post',
data: {
type: '3',
name: `select distinct 姓名 from 车间生产管理工艺_工时查询_实际工时_视图 where 加工完成时间 is not null and 是否启用 = 1`
}
})
}

View File

@@ -1,7 +1,7 @@
import request from '@/utils/request' import request from '@/utils/request'
// 查询询价单号 // 查询询价单号
export function getBillNum(num) { export function getBillNum() {
return request({ return request({
url: '', url: '',
method: 'post', method: 'post',

View File

@@ -134,6 +134,17 @@ export function deleteMateriel(num) {
} }
}) })
} }
// 查询离线合同编号
export function getBillNum() {
return request({
url: '',
method: 'post',
data: {
type: '1',
name: '采购管理_创建离线合同编号_查询数据'
}
})
}
// 使用库存 // 使用库存
export function changeNum(num, num1, num2, num3, num4) { export function changeNum(num, num1, num2, num3, num4) {
return request({ return request({

View File

@@ -26,6 +26,14 @@
<el-col :span="12"> <el-col :span="12">
<el-card v-loading="loading2" style="height: 450px"> <el-card v-loading="loading2" style="height: 450px">
<span>工人时间段统计</span> <span>工人时间段统计</span>
<el-select v-model="nameValue" filterable size="small" placeholder="工位号" style="width: 110px">
<el-option
v-for="item in name"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<el-date-picker v-model="startTime2" :clearable="false" size="small" type="year" value-format="yyyy" format="yyyy" style="width: 150px" placeholder="选择年"/>
<el-button size="small" type="success" icon="el-icon-search" @click="search2()">查询</el-button> <el-button size="small" type="success" icon="el-icon-search" @click="search2()">查询</el-button>
<div v-if="chart2" id="myChart2" :style="{width: '100%', height: '400px', margin: 'auto'}"/> <div v-if="chart2" id="myChart2" :style="{width: '100%', height: '400px', margin: 'auto'}"/>
</el-card> </el-card>
@@ -35,7 +43,7 @@
</template> </template>
<script> <script>
import { search1 } from '@/api/ManufacturingCenter/ManHourAnalysis' import { search1, search2, searchPerson } from '@/api/ManufacturingCenter/ManHourAnalysis'
import echarts from 'echarts' import echarts from 'echarts'
export default { export default {
@@ -46,12 +54,31 @@ export default {
chart1: true, chart1: true,
res1: [], res1: [],
loading1: false, // 图表1 loading1: false, // 图表1
nameValue: '',
name: [],
startTime2: '',
chart2: true, chart2: true,
res2: [], res2: [],
loading2: false // 2 loading2: false // 2
} }
}, },
created() {
this.fetchData()
},
methods: { methods: {
fetchData() {
this.name = []
searchPerson().then(response => {
for (let i = 0; i < response.data.length; i++) {
this.name.push({
label: response.data[i].姓名,
value: response.data[i].姓名
})
}
}).then(() => {
this.nameValue = this.name[0].value
})
},
// 时间段工时 // 时间段工时
search1() { search1() {
this.chart1 = false this.chart1 = false
@@ -138,6 +165,96 @@ export default {
} }
] ]
}) })
},
search2() {
this.chart2 = false
this.loading2 = true
var check, startTime, endtime
if (this.startTime2) { check = 1 } else { check = 0 }
if (check === 1) {
startTime = this.startTime2 + '-01-01'
endtime = this.startTime2 + '-12-31'
}
search2(1, this.nameValue, check, startTime, endtime).then(response => {
this.res2 = response.data
this.loading2 = false
this.chart2 = true
}).then(() => {
var myChart2 = echarts.init(document.getElementById('myChart2'))
myChart2.clear()
this.drawLine2(this.res2)
})
},
drawLine2(data) {
var dataX = []
var lineData1 = []
var lineData2 = []
for (let i = 0; i < data.length; i++) {
dataX.push(data[i].月份)
lineData1.push(data[i].理论加工时间段)
lineData2.push(data[i].实际加工时间段)
}
var myChart2 = echarts.init(document.getElementById('myChart2'))
myChart2.clear()
myChart2.setOption({
legend: {
data: ['理论工时', '实际工时']
},
grid: {
left: '3%',
right: '8%',
bottom: '3%',
containLabel: true
},
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'shadow'
}
},
xAxis: {
type: 'category',
name: '月份',
axisLabel: {
interval: 0,
rotate: 0,
margin: 10
},
data: dataX
},
yAxis: {
type: 'value',
name: 'min',
min: 0,
scale: 'true'
},
series: [
{
name: '理论工时',
type: 'bar',
color: '#67C23A',
label: {
normal: {
show: true,
position: 'inside'
}
},
data: lineData1
},
{
name: '实际工时',
type: 'bar',
color: 'rgb(213,58,53)',
label: {
normal: {
show: true,
position: 'top'
}
},
data: lineData2
}
]
})
} }
} }
} }

View File

@@ -97,7 +97,8 @@
<div id="son16" :class="[isActive ? color[0] : 'weikaishi']" class="module" style="position: relative;left: -1125px;top:236px; width: 80px;height: 48px;"> <div id="son16" :class="[isActive ? color[0] : 'weikaishi']" class="module" style="position: relative;left: -1125px;top:236px; width: 80px;height: 48px;">
<el-tooltip :open-delay="600" placement="top"> <el-tooltip :open-delay="600" placement="top">
<div slot="content">回款进度{{ parseInt(`${data2[0].签订合同}`) + '%' }}</div> <div slot="content">回款进度{{ parseInt(`${data2[0].签订合同}`) + '%' }}</div>
<el-button :disabled="disabled" :class="[isActive ? color[0] : 'weikaishi']" type="text" @click.stop="searchDiv1">签订合同<br>{{ parseInt(`${data2[0].签订合同}`) + '%' }}</el-button> <el-button :disabled="disabled" :class="[isActive ? color[0] : 'weikaishi']" type="text" @click.stop="searchDiv1">签订合同</el-button>
<!--<br>{{ parseInt(`${data2[0].签订合同}`) + '%' }}-->
</el-tooltip> </el-tooltip>
</div> </div>
<div id="son17" :class="[isActive ? color[1] : 'weikaishi']" class="module" style="position: relative;left: -1111px;top:236px; width: 80px;height: 48px;"> <div id="son17" :class="[isActive ? color[1] : 'weikaishi']" class="module" style="position: relative;left: -1111px;top:236px; width: 80px;height: 48px;">
@@ -248,7 +249,7 @@
</div> </div>
</div> </div>
</el-col> </el-col>
<el-col :span="8"> <el-col v-if="false" :span="8">
<div class="grid-content bg-purple" style="width: 99%; height: 340px; border: 1px solid #DCDFE6"> <div class="grid-content bg-purple" style="width: 99%; height: 340px; border: 1px solid #DCDFE6">
<div style="margin:0 auto; width:400px; height:100px;margin-top: 70px"> <div style="margin:0 auto; width:400px; height:100px;margin-top: 70px">
<div style="margin-top: 17px"> <div style="margin-top: 17px">

View File

@@ -42,6 +42,9 @@
<el-button v-else size="mini" style="margin: 10px 0 0 10px" @click="quickChangePrice=!quickChangePrice">还原</el-button> <el-button v-else size="mini" style="margin: 10px 0 0 10px" @click="quickChangePrice=!quickChangePrice">还原</el-button>
<el-button v-show="isShowN" type="text" style="margin: 10px 0 0 10px" @click="isShowN=false">折叠</el-button> <el-button v-show="isShowN" type="text" style="margin: 10px 0 0 10px" @click="isShowN=false">折叠</el-button>
<el-button v-show="!isShowN" type="text" style="margin: 10px 0 0 10px" @click="isShowN=true">展开其他说明</el-button> <el-button v-show="!isShowN" type="text" style="margin: 10px 0 0 10px" @click="isShowN=true">展开其他说明</el-button>
<el-tooltip v-show="true" :open-delay="300" content="一键删除交货期" placement="right">
<el-button type="danger" icon="el-icon-date" size="small" @click="deleteAllDate()"/>
</el-tooltip>
</el-row> </el-row>
<el-row v-show="isShowN" style="margin-top: 10px"> <el-row v-show="isShowN" style="margin-top: 10px">
<!--<span>交货日期:</span>--> <!--<span>交货日期:</span>-->
@@ -135,9 +138,6 @@
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<el-tooltip v-show="false" :open-delay="1000" content="一键删除交货期" placement="right">
<el-button type="danger" icon="el-icon-date" size="small" @click="deleteAllDate()"/>
</el-tooltip>
<el-radio-group v-show="false" v-model="demoRadio" size="small" @change="demoChange"> <el-radio-group v-show="false" v-model="demoRadio" size="small" @change="demoChange">
<el-radio-button label="模板1"/> <el-radio-button label="模板1"/>
<el-radio-button label="模板2" disabled/> <el-radio-button label="模板2" disabled/>

View File

@@ -606,7 +606,7 @@
<script> <script>
import { tiaozheng2, tiaozheng1, searchOfflineContract, searchOfflineContract2, searchSupplier, addOfflineContract, editOfflineContract, deleteOfflineContract, searchMateriel, searchMaterial1, import { tiaozheng2, tiaozheng1, searchOfflineContract, searchOfflineContract2, searchSupplier, addOfflineContract, editOfflineContract, deleteOfflineContract, searchMateriel, searchMaterial1,
addMateriel, deleteMateriel, saveOfflineContact, doneOfflineContact, searchMaterial22, searchMachine, searchGroup, initProject, changeNum, submitUseInventory, addMateriel, deleteMateriel, saveOfflineContact, doneOfflineContact, searchMaterial22, searchMachine, searchGroup, initProject, changeNum, submitUseInventory, getBillNum,
searchPart, getPerson, searchSupplier1 } from '@/api/PurchasingCenter/OfflineContract' searchPart, getPerson, searchSupplier1 } from '@/api/PurchasingCenter/OfflineContract'
import QRCode from 'qrcode' import QRCode from 'qrcode'
import $ from 'jquery' import $ from 'jquery'
@@ -1084,13 +1084,15 @@ export default {
} }
this.getSupplier1() this.getSupplier1()
this.title2 = '创建离线合同' this.title2 = '创建离线合同'
this.form2.离线合同编号 = '' getBillNum().then(response => { // 查询询价单号
this.form2.离线合同名称 = '' this.form2.离线合同编号 = response.data[0].单号
this.form2.供应商流水号 = '' this.form2.离线合同名称 = ''
this.form2.供应商名称 = '' this.form2.供应商流水号 = ''
this.form2.规定到货时间 = '' this.form2.供应商名称 = ''
this.form2.离线合同备注 = '付款方式:;付款时间:;到货时间:;开票信息:;其他说明:;' this.form2.规定到货时间 = ''
this.dialogVisible2 = true this.form2.离线合同备注 = '付款方式:;付款时间:;到货时间:;开票信息:;其他说明:;'
this.dialogVisible2 = true
})
}, },
getSupplier1() { getSupplier1() {
this.supplierNames = [] this.supplierNames = []

View File

@@ -57,8 +57,8 @@
<el-card style="margin-left: 10px;width: 62.3%;float: left"> <el-card style="margin-left: 10px;width: 62.3%;float: left">
<div> <!--slot="header"--> <div> <!--slot="header"-->
<el-input v-model="purchasingOrder" placeholder="采购计划单号" size="small" style="margin: 3px 0" clearable/> <el-input v-model="purchasingOrder" placeholder="采购计划单号" size="small" style="margin: 3px 0;width: 155px" clearable @keyup.enter.native="pageCurrent2=1;pageSize2=10;total2=0;searchTable2()"/>
<el-select v-model="supplierName0" placeholder="供应商" size="small" filterable clearable> <el-select v-model="supplierName0" placeholder="供应商" size="small" filterable clearable @change="pageCurrent2=1;pageSize2=10;total2=0;searchTable2()">
<el-option <el-option
v-for="item in supplierName0s" v-for="item in supplierName0s"
:key="item.value" :key="item.value"
@@ -66,9 +66,9 @@
:value="item.value"/> :value="item.value"/>
</el-select> </el-select>
<!--<el-input v-model="supplierName0" placeholder="供应商" size="small" clearable/>--> <!--<el-input v-model="supplierName0" placeholder="供应商" size="small" clearable/>-->
<el-tooltip :open-delay="1200" effect="dark" content="查询采购计划单" placement="top"> <!--<el-tooltip :open-delay="1200" effect="dark" content="查询采购计划单" placement="top">-->
<el-button type="success" size="small" icon="el-icon-search" style="margin-left: 10px" @click="pageCurrent2=1;pageSize2=10;total2=0;searchTable2()">查询</el-button> <!--<el-button type="success" size="small" icon="el-icon-search" style="margin-left: 10px" @click="pageCurrent2=1;pageSize2=10;total2=0;searchTable2()">查询</el-button>-->
</el-tooltip> <!--</el-tooltip>-->
<el-button type="primary" size="small" icon="el-icon-plus" style="margin-left: 10px" @click="addPurchaseOrder">新增</el-button> <el-button type="primary" size="small" icon="el-icon-plus" style="margin-left: 10px" @click="addPurchaseOrder">新增</el-button>
<el-tooltip :open-delay="1200" effect="dark" content="向选择的采购计划里添加采购零件" placement="top"> <el-tooltip :open-delay="1200" effect="dark" content="向选择的采购计划里添加采购零件" placement="top">
<el-button type="success" size="small" icon="el-icon-download" style="margin-left: 10px" @click="addMateriel">选入</el-button> <el-button type="success" size="small" icon="el-icon-download" style="margin-left: 10px" @click="addMateriel">选入</el-button>
@@ -137,7 +137,7 @@
:page-sizes="[10, 20, 30, 40]" :page-sizes="[10, 20, 30, 40]"
:page-size="pageSize2" :page-size="pageSize2"
:total="total2" :total="total2"
style="display:inline-block;width:50%" style="display:inline-block;width:40%;float: right"
layout="total, sizes, prev, pager, next, jumper" layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChange2" @size-change="handleSizeChange2"
@current-change="handleCurrentChange2"/> @current-change="handleCurrentChange2"/>

View File

@@ -3,7 +3,7 @@
<el-card> <el-card>
<div> <div>
<span style="margin-left: 10px">供应商:</span> <span style="margin-left: 10px">供应商:</span>
<el-select v-model="supplierNameValue" placeholder="供应商" size="small" filterable clearable> <el-select v-model="supplierNameValue" placeholder="供应商" size="small" filterable clearable @change="pageCurrent4=1;pageSize4=10;total4=0;searchTable4()">
<el-option <el-option
v-for="item in supplierName" v-for="item in supplierName"
:key="item.value" :key="item.value"
@@ -11,22 +11,22 @@
:value="item.value"/> :value="item.value"/>
</el-select> </el-select>
<!--<el-input v-model="Name" placeholder="供应商" size="small" clearable/>--> <!--<el-input v-model="Name" placeholder="供应商" size="small" clearable/>-->
<span>关联情况:</span> <!--<span>关联情况:</span>-->
<el-select v-model="PickingValue" placeholder="关联情况" size="small" clearable> <!--<el-select v-model="PickingValue" placeholder="关联情况" size="small" clearable>-->
<el-option <!--<el-option-->
v-for="item in Picking" <!--v-for="item in Picking"-->
:key="item.value" <!--:key="item.value"-->
:label="item.label" <!--:label="item.label"-->
:value="item.value"/> <!--:value="item.value"/>-->
</el-select> <!--</el-select>-->
<el-tooltip :open-delay="1200" effect="dark" content="查询到货单" placement="top"> <!--<el-tooltip :open-delay="1200" effect="dark" content="查询到货单" placement="top">-->
<el-button type="success" size="small" icon="el-icon-search" style="margin-left: 10px" @click="pageCurrent4=1;pageSize4=10;total4=0;searchTable4()">查询</el-button> <!--<el-button type="success" size="small" icon="el-icon-search" style="margin-left: 10px" @click="pageCurrent4=1;pageSize4=10;total4=0;searchTable4()">查询</el-button>-->
</el-tooltip> <!--</el-tooltip>-->
<el-button type="primary" size="small" icon="el-icon-plus" style="margin-left: 10px" @click="addArrivalOrder">新增到货单</el-button> <el-button type="primary" size="small" icon="el-icon-plus" style="margin-left: 10px" @click="addArrivalOrder">新增到货单</el-button>
</div> </div>
</el-card> </el-card>
<el-card style="width: 45%;float: left"> <el-card style="width: 45%;float: left">
<h3>到货单</h3> <span>到货单</span>
<el-table v-loading="" :data="tableData4" border stripe style="width: 100%" height="230px" size="mini" highlight-current-row @row-click="searchTable5"> <el-table v-loading="" :data="tableData4" border stripe style="width: 100%" height="230px" size="mini" highlight-current-row @row-click="searchTable5">
<el-table-column label="关联情况" align="center" width="80"> <el-table-column label="关联情况" align="center" width="80">
<template slot-scope="scope"> <template slot-scope="scope">
@@ -49,9 +49,9 @@
{{ scope.row.到货单编号 }} {{ scope.row.到货单编号 }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" align="center" width="220" fixed="right"> <el-table-column label="操作" align="center" width="200" fixed="right">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button :disabled="Number(scope.row.是否关联) === 1" type="success" size="mini" icon="el-icon-circle-plus-outline" plain @click="addArrivalOrderMX(scope.row)">添加到货明细</el-button> <el-button :disabled="Number(scope.row.是否关联) === 1" type="text" size="mini" style="margin-left: 10px" icon="el-icon-circle-plus-outline" @click="addArrivalOrderMX(scope.row)">到货明细</el-button>
<el-button :disabled="Number(scope.row.是否关联) === 1" type="text" size="mini" style="margin-left: 20px" icon="el-icon-delete" @click="deleteArrivalOrder(scope.row)">删除</el-button> <el-button :disabled="Number(scope.row.是否关联) === 1" type="text" size="mini" style="margin-left: 20px" icon="el-icon-delete" @click="deleteArrivalOrder(scope.row)">删除</el-button>
</template> </template>
</el-table-column> </el-table-column>
@@ -82,7 +82,7 @@
</div> </div>
</el-card> </el-card>
<el-card style="width: 54%;float: left;margin-left: 10px"> <el-card style="width: 54%;float: left;margin-left: 10px">
<h3>到货单明细</h3> <span>到货单明细</span>
<el-table <el-table
v-loading="" v-loading=""
:data="tableData5" :data="tableData5"
@@ -111,21 +111,21 @@
{{ scope.row.单位 }} {{ scope.row.单位 }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="单价" align="center"> <el-table-column label="单价" align="right">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.单价 }} {{ scope.row.单价.toFixed(2) }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="金额" align="center"> <el-table-column label="金额" align="right">
<template slot-scope="scope"> <template slot-scope="scope">
{{ parseInt(scope.row.金额 * 100) / 100 }} {{ (parseInt(scope.row.金额 * 100) / 100).toFixed(2) }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" align="center" width="220" fixed="right"> <el-table-column label="操作" align="center" width="220" fixed="right">
<template slot-scope="scope"> <template slot-scope="scope">
<el-tooltip :open-delay="1200" effect="dark" content="关联备料材料" placement="top"> <el-tooltip :open-delay="1200" effect="dark" content="关联备料材料" placement="top">
<div style="display: inline-block"> <div style="display: inline-block">
<el-button :disabled="disable === '1'" type="warning" size="mini" icon="el-icon-circle-plus-outline" plain @click="addArrivalCL(scope.row)">关联备料材料</el-button> <el-button :disabled="disable === '1'" type="text" size="mini" icon="el-icon-circle-plus-outline" @click="addArrivalCL(scope.row)">备料材料</el-button>
</div> </div>
</el-tooltip> </el-tooltip>
<el-tooltip :open-delay="1200" effect="dark" content="删除" placement="top"> <el-tooltip :open-delay="1200" effect="dark" content="删除" placement="top">
@@ -138,7 +138,7 @@
</el-table> </el-table>
</el-card> </el-card>
<el-card style="width: 100%"> <el-card style="width: 100%">
<h3>关联备料材料</h3> <span>关联备料材料</span>
<el-table <el-table
v-loading="" v-loading=""
:data="tableData6" :data="tableData6"
@@ -187,7 +187,7 @@
</el-table-column> </el-table-column>
<el-table-column label="总金额" align="center" prop="总金额"> <el-table-column label="总金额" align="center" prop="总金额">
<template slot-scope="scope"> <template slot-scope="scope">
{{ parseInt(scope.row.金额 * 100) / 100 }} {{ (parseInt(scope.row.金额 * 100) / 100).toFixed(2) }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="备注" align="center" > <el-table-column label="备注" align="center" >
@@ -199,7 +199,7 @@
<template slot-scope="scope"> <template slot-scope="scope">
<el-tooltip effect="dark" content="取消关联" placement="top"> <el-tooltip effect="dark" content="取消关联" placement="top">
<div style="display: inline-block"> <div style="display: inline-block">
<el-button :disabled="disable === '1'" type="primary" size="mini" plain @click="deleteMateriel(scope.row)">取消关联</el-button> <el-button :disabled="disable === '1'" type="text" size="mini" @click="deleteMateriel(scope.row)">取消关联</el-button>
</div> </div>
</el-tooltip> </el-tooltip>
</template> </template>
@@ -225,11 +225,6 @@
<el-date-picker v-model="form.日期" size="small" type="date" value-format="yyyy-MM-dd" format="yyyy-MM-dd" placeholder="选择日期"/> <el-date-picker v-model="form.日期" size="small" type="date" value-format="yyyy-MM-dd" format="yyyy-MM-dd" placeholder="选择日期"/>
</el-form-item> </el-form-item>
</el-row> </el-row>
<el-row>
<el-form-item label="备注" prop="备注">
<el-input v-model="form.备注" size="small"/>
</el-form-item>
</el-row>
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button <el-button
@@ -740,9 +735,9 @@ export default {
sums[index] = values.reduce((prev, curr) => { sums[index] = values.reduce((prev, curr) => {
const value = Number(curr) const value = Number(curr)
if (!isNaN(value)) { if (!isNaN(value)) {
return parseInt((Number(prev) + Number(curr)) * 100) / 100 return (parseInt((Number(prev) + Number(curr)) * 100) / 100).toFixed(2)
} else { } else {
return Number(prev) return (parseInt(Number(prev) * 100) / 100).toFixed(2)
} }
}, 0) }, 0)
sums[index] += ' 元' sums[index] += ' 元'
@@ -789,9 +784,9 @@ export default {
sums[index] = values.reduce((prev, curr) => { sums[index] = values.reduce((prev, curr) => {
const value = Number(curr) const value = Number(curr)
if (!isNaN(value)) { if (!isNaN(value)) {
return parseInt((Number(prev) + Number(curr)) * 100) / 100 return (parseInt((Number(prev) + Number(curr)) * 100) / 100).toFixed(2)
} else { } else {
return parseInt(Number(prev) * 100) / 100 return (parseInt(Number(prev) * 100) / 100).toFixed(2)
} }
}, 0) }, 0)
sums[index] += ' 元' sums[index] += ' 元'