This commit is contained in:
liushuai
2020-02-06 11:49:53 +08:00
10 changed files with 127 additions and 557 deletions

BIN
dist.zip

Binary file not shown.

View File

@@ -13,14 +13,14 @@ export function shouhuo(num) {
})
}
// 初始化获取已生成的外协加工任务单初始化获取已生成的外协加工任务单
export function getTable(checked, contractNumber, checked1, manufacturers, checked2, time1, time2, num, pageCurrent, pageSize) {
export function getTable(checked, contractNumber, pageCurrent, pageSize) {
return request({
url: '',
method: 'post',
data: {
type: '1',
name: '车间生产管理_外协加工任务单_查询数据_查询页',
param: '外协加工任务单_check=0&外协加工任务单流水号=null&表单号_check=' + checked + '&表单号=' + contractNumber + '&外协厂家_check=' + checked1 + '&外协厂家=' + manufacturers + '&任务下达日期_时间段=' + checked2 + '&开始时间=' + time1 + '&结束时间=' + time2 + '&单据状态_check=0&单据状态=1&外协员编号_check=0&外协员编号=' + num,
name: '车间生产管理工艺_外协执行_查询外协任务单',
param: '厂家或表单号_check=' + checked + '&厂家或表单号=' + contractNumber,
Pagination: pageCurrent + '&' + pageSize
}
})
@@ -156,14 +156,14 @@ export function deleteData1(Number) {
})
}
// 零件到货
export function Arrival(Number, Num) {
export function Arrival(num1, Number, Num) {
return request({
url: '',
method: 'post',
data: {
type: '2',
name: '车间生产管理_外协零件_到货',
param: `外协加工任务单明细流水号组=${Number}&工艺计划流水号组=${Num}`
param: '外协加工任务单流水号=' + num1 + `&外协加工任务单明细流水号组=${Number}&工艺计划流水号组=${Num}`
}
})
}
@@ -174,7 +174,7 @@ export function getParts(Number) {
method: 'post',
data: {
type: '1',
name: '车间生产管理_外协加工任务单明细_查询数据',
name: '车间生产管理工艺_外协加工任务单明细_查询数据',
param: '外协加工任务单流水号=' + Number + '=int'
}
})

View File

@@ -39,7 +39,7 @@ export function searchTable(num1, num2, num3, num4, num5, num6, check, num7, pag
method: 'post',
data: {
type: '1',
name: '车间生产管理工艺_零件工艺计划_查询数据_状态_新',
name: '车间生产管理工艺_序间外协_查询零件',
param: '项目流水号_check=' + num1 + '&项目流水号=' + num2 + '&机床流水号_check=' + num3 + '&机床流水号=' + num4 + '&组件流水号_check=' + num5 + '&组件流水号=' + num6 + '&零件图号_check=' + check + '&零件图号=' + num7 + '&考核状态_check=0&考核状态=0&单件是否外协_check=1&单件是否外协=1&时间=0&机加工开始时间=0&机加工结束时间=0&零件类型=0',
Pagination: pageCurrent + '&' + pageSize
}

View File

@@ -62,14 +62,14 @@ export function searchLxMateriel(num, check, num1) {
})
}
// 查询到货单
export function searchArriveOrder(num8, num9, num6, num7, pageCurrent, pageSize) {
export function searchArriveOrder(num8, num9, num6, num7, datecheck, starttime, endtime, pageCurrent, pageSize) {
return request({
url: '',
method: 'post',
data: {
type: '1',
name: '备料管理_到货单查询_新',
param: `供应商流水号_check=${num8}&供应商流水号=${num9}&是否关联_check=${num6}&是否关联=${num7}`,
param: `供应商流水号_check=${num8}&供应商流水号=${num9}&是否关联_check=${num6}&是否关联=${num7}&日期check=${datecheck}&开始时间=${starttime}&结束时间=${endtime}`,
Pagination: pageCurrent + '&' + pageSize
}
})

View File

@@ -113,7 +113,7 @@
{{ scope.row.零件名称 }}
</template>
</el-table-column>
<el-table-column label="规格" prop="规格" align="center">
<el-table-column label="规格" prop="规格" align="center" width="170">
<template slot-scope="scope">
{{ scope.row.规格 }}
</template>
@@ -148,17 +148,19 @@
{{ scope.row.零件类型名称 }}
</template>
</el-table-column>
<el-table-column label="操作" width="200px" fixed="right" align="center">
<el-table-column label="操作" width="170px" fixed="right" align="center">
<template slot-scope="scope">
<el-button
:disabled="checked_hebing"
size="mini"
type="primary"
style="padding: 4px 8px"
plain
@click="handleEdit(scope.$index, scope.row, 'form')">分批投产</el-button>
<el-button
size="mini"
type="primary"
style="padding: 4px 8px"
plain
@click="handleEditNumber(scope.$index, scope.row)">更改数量</el-button>
</template>

View File

@@ -43,6 +43,14 @@
<el-tooltip :open-delay="1200" effect="dark" content="新增项目" placement="top">
<el-button type="primary" icon="el-icon-circle-plus-outline" size="small" style="margin-left: 10px;background: #fdf6ec;border-color: #ff9759;color: #ff9759;" @click="ADD()">新增</el-button>
</el-tooltip>
<!--<<<<<<< HEAD-->
<!--&lt;!&ndash;<<<<<<< HEAD&ndash;&gt;-->
<!--&lt;!&ndash; &lt;!&ndash; <el-button type="info" size="small" style="margin-left: 10px">导出Excel</el-button>&ndash;&gt;&ndash;&gt;-->
<!--&lt;!&ndash;=======&ndash;&gt;-->
<!--&lt;!&ndash; &lt;!&ndash;<el-button type="info" size="small" style="margin-left: 10px">导出Excel</el-button>&ndash;&gt;&ndash;&gt;-->
<!--&lt;!&ndash;&gt;>>>>>> d828757fc0d137c09d0339446a35ae8651355ce7&ndash;&gt;-->
<!--=======-->
<!--&gt;>>>>>> 75e884a0fca545b1a478c0a0dcaf498a46cbe009-->
</div>
</el-card>
<el-row>
@@ -73,7 +81,7 @@
</el-table-column>
<el-table-column align="center" label="项目下达日期" prop="合同签订日期" width="100">
<template slot-scope="scope">
{{ scope.row.合同签订日期 }}
{{ scope.row.合同签订日期.substring(0,10) }}
</template>
</el-table-column>
<el-table-column align="center" label="合同信息备注" min-width="150">

View File

@@ -5,7 +5,7 @@
<!--<span>表单号:</span>-->
<!--<el-input v-model="formNumber" size="small" placeholder="表单号" clearable style="width:150px"/>-->
<span>厂家:</span>
<el-input v-model="manufacturers" size="small" placeholder="厂家" style="width:160px" clearable @keyup.enter.native="pageSize=10;pageList=1;fetchData()"/>
<el-input v-model="manufacturers" size="small" placeholder="厂家或外协任务单号" style="width:160px" clearable @keyup.enter.native="pageSize=20;pageList=1;fetchData()"/>
<!--<span>下达任务日期:</span>-->
<!--<el-date-picker-->
<!--v-model="time"-->
@@ -15,7 +15,7 @@
<el-button type="success" size="mini" icon="el-icon-search" style="margin-left:10px" @click="pageSize=10;pageList=1;fetchData()">查询</el-button>
</el-card>
<el-card>
<el-table v-loading="loading2" :data="List" highlight-current-row stripe size="mini" height="550" border @row-click="searchProcess" >
<el-table v-loading="loading2" :data="List" :row-class-name="tableData1ClassName" highlight-current-row size="mini" height="550" border @row-click="searchProcess" >
<el-table-column label="表单号" prop="表单号" align="center" min-width="200px">
<template slot-scope="scope">
{{ scope.row.表单号 }}
@@ -23,7 +23,7 @@
</el-table-column>
<el-table-column label="外协厂家" prop="外协厂家" align="center" min-width="200px">
<template slot-scope="scope">
{{ scope.row.外协厂家 }}
{{ scope.row.外协厂家名称 }}
</template>
</el-table-column>
</el-table>
@@ -43,9 +43,6 @@
<el-col :span="14">
<el-card>
<el-button :disabled="loading=false" type="warning" size="mini" icon="el-icon-arrow-down" style="margin-left:10px" @click="getSpareParts">收货</el-button>
<!--<el-tooltip :open-delay="1200" effect="dark" content="打印外协任务单" placement="top">-->
<!--<el-button type="primary" size="mini" icon="el-icon-download" style="margin-left:10px;float: right" @click="exportTable('RWD')">导出单据</el-button>-->
<!--</el-tooltip>-->
<el-table v-loading="loading" :data="List3" border stripe size="mini" highlight-current-row height="595" tooltip-effect="dark" style="width: 100%" @selection-change="handleSelectionChange">
<el-table-column
:selectable="selectable"
@@ -73,93 +70,21 @@
{{ 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.外协工序 }}-->
<!--</template>-->
<!--</el-table-column>-->
</el-table>
</el-card>
</el-col>
<el-card v-show="false">
<div id="RWD">
<table cellspacing="0px" align="center" width="100%" style="">
<tbody id="1">
<tr>
<td colspan="4" style="text-align: left;font-size: 30px;font-weight: bold">GAOJING</td>
<td colspan="24" style="text-align:center;font-size: 30px;font-weight: bold">外协加工任务单</td>
</tr>
<tr class="tbodyHead">
<td colspan="2">任务单号:</td>
<td colspan="6">{{ 任务单号 }}</td>
<td colspan="4">任务下达日期:</td>
<td colspan="4">{{ 任务下达日期 }}</td>
<td colspan="3">外协厂家:</td>
<td colspan="9">{{ 外协厂家 }}</td>
</tr>
<tr class="tbodyHead">
<td colspan="2">外协员:</td>
<td colspan="6">{{ 外协员 }}</td>
<td colspan="2">电话:</td>
<td colspan="6">{{ 外协员电话 }}</td>
<td colspan="3">联系人:</td>
<td colspan="3">{{ 联系人 }}</td>
<td colspan="2">电话:</td>
<td colspan="4">{{ 联系人电话 }}</td>
</tr>
<tr id="tableHead">
<td style="width: 2%">序号</td>
<td colspan="5">零件图号</td>
<td colspan="2" style="width: 4%">零件名称</td>
<td colspan="2" style="width: 2%">数量</td>
<td colspan="9" width="30%">内容</td>
<td colspan="1">零件类型</td>
<td>外协类别</td>
<td>加工价格</td>
<td>材料价格</td>
<td>其他价格</td>
<td colspan="2">计划开始</td>
<td colspan="2">计划结束</td>
</tr>
</tbody>
<tfoot>
<tr id="tableFoot">
<td>费用</td>
<td colspan="17" style="text-align: left;">加工费{{ 加工价格合计 }}材料费{{ 材料价格合计 }}其他费用{{ 其他价格合计 }}运费{{ 运费 }}合计{{ 总计 }}人民币大写{{ 大写金额 }}</td>
<td colspan="1">0</td>
<td colspan="1"/>
<td/>
<td>{{ 加工价格合计 }}</td>
<td>{{ 材料价格合计 }}</td>
<td>{{ 其他价格合计 }}</td>
<td colspan="2">{{ 最早时间 }}</td>
<td colspan="2">{{ 最晚时间 }}</td>
</tr>
<tr class="foot">
<td colspan="4">外协员:</td>
<td colspan="4">外协科长:</td>
<td colspan="4">采购二部长:</td>
<td colspan="4">制品部长:</td>
<td colspan="4">定额科统计员:</td>
<td colspan="4">定额科长:</td>
<td colspan="4">外协厂:</td>
</tr>
</tfoot>
</table>
</div>
</el-card>
</div>
</template>
<script>
import { handlechange, shouhuo, getTable, getprocedure, spareParts, Arrival, getParts } from '@/api/Outsourcing/OutsourcingTaskQuery'
import { getExplorer, method5, Cleanup } from '@/vendor/exportExcel'
import { convertCurrency } from '@/vendor/int2Chinese'
import { getTable, Arrival, getParts } from '@/api/Outsourcing/OutsourcingTaskQuery'
import { mapGetters } from 'vuex'
import elInput from 'element-ui/packages/input'
import $ from 'jquery'
export default {
components: {
@@ -263,7 +188,7 @@ export default {
机加工结束时间: [],
外协加工任务单明细流水号: [],
total: null, // 总条数
pageSize: 10, // 每页显示条数
pageSize: 20, // 每页显示条数
pageList: 1, // 后台获取页
currentPage: 1 // 显示当前页
}
@@ -280,320 +205,32 @@ export default {
this.fetchData()
},
methods: {
exportTable() {
if (this.List3.length === 0) {
this.$message.warning('暂无数据')
} else {
const htmlNode = $('#RWD').html()
const body = $('body')
body.children().hide()
const printNode = $(htmlNode)
body.append(printNode)
window.print()
body.children().not('script').show()
printNode.remove()
}
},
shouhuo(row) {
this.$confirm('此操作将不可更改, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
if (this.wancheng === 1) {
for (let i = 0; i < this.gongxulsh.length; i++) {
handlechange(this.gongxulsh[i].工序流水号, '0000')
if (i === this.gongxulsh.length - 1) {
shouhuo(row.外协加工任务单流水号).then(response => {
if (response.data[0].result === '1') {
this.fetchData()
}
})
}
}
}
}).catch(() => {
this.$message({
type: 'info',
message: '已取消'
})
})
},
fetchData() {
this.loading2 = true
var day3 = new Date(this.time)
var day4 = new Date(this.time)
day3.setTime(day3.getTime() - 24 * 60 * 60 * 1000)
day4.setTime(day4.getTime() + 24 * 60 * 60 * 1000)
var month1 = day3.getMonth() + 1
var month2 = day4.getMonth() + 1
var day1 = day3.getDate()
var day2 = day4.getDate()
if (month1 >= 1 && month1 <= 9) {
month1 = '0' + month1
}
if (day1 >= 1 && day1 <= 9) {
day1 = '0' + day1
}
if (month2 >= 1 && month2 <= 9) {
month2 = '0' + month2
}
if (day2 >= 1 && day2 <= 9) {
day2 = '0' + day2
}
this.time1 = day3.getFullYear() + '/' + month1 + '/' + day1
this.time2 = day4.getFullYear() + '/' + month2 + '/' + day2
if (this.formNumber !== '') {
this.num = 1
} else {
this.num = 0
}
if (this.manufacturers !== '') {
this.num1 = 1
} else {
this.num1 = 0
}
if (this.time === '' || this.time === null) {
this.num2 = 0
} else {
this.num2 = 1
}
if (this.time1 === 'NaN/NaN/NaN') {
this.time1 = ''
}
if (this.time2 === 'NaN/NaN/NaN') {
this.time2 = ''
}
this.List = []
this.List3 = []
getTable(this.num, this.formNumber, this.num1, this.manufacturers, this.num2, this.time1, this.time2, this.id, this.pageList, this.pageSize).then(response => {
var check
this.manufacturers ? check = 1 : check = 0
getTable(check, this.manufacturers, this.pageList, this.pageSize).then(response => {
this.total = parseInt(response.data.total)
for (let i = 0; i < response.data.rows.length; i++) {
if (response.data.rows[i].任务下达日期 !== null) {
response.data.rows[i].任务下达日期 = response.data.rows[i].任务下达日期.substr(0, 10)
}
}
this.List = response.data.rows
})
this.loading2 = false
},
selectable(row, index) { // 控制某行是否可选
// 控制某行是否可选
selectable(row, index) {
return parseInt(row.到货状态) !== 1 // 已经到货
},
// 查询
searchProcess(row) {
this.wancheng = ''
this.gongxulsh = []
this.任务单号 = row.表单号
this.任务下达日期 = row.任务下达日期
this.外协厂家 = row.外协厂家
this.外协员 = row.外协计划员
// 以上是新增的
this.contrast = 3000000000000
this.contrast1 = 0
this.Number = row.外协加工任务单流水号
this.loading = true
this.List3 = []
this.bianliang = []
this.零件图号 = []
this.零件名称 = []
this.批次数量 = []
this.外协预算总价格 = []
this.加工价格_成交 = []
this.外协分类 = []
this.材料费 = []
this.材料价格_价格 = []
this.其他价格 = []
this.机加工开始时间 = []
this.机加工结束时间 = []
this.外协加工任务单明细流水号 = []
this.process = []
this.freight = row.运费
this.Number = row.外协加工任务单流水号
getParts(this.Number).then(response => {
const data = response.data
for (let i = 0; i < data.length; i++) {
data[i].差价 = data[i].外协预算总价格 * 1.15.toFixed(2) + data[i].材料费 * 1.15.toFixed(2) - data[i].加工价格_成交.toFixed(2) - data[i].材料价格_价格.toFixed(2) - data[i].其他价格.toFixed(2)
}
this.returns = data
for (let j = 0; j < data.length; j++) {
this.List3.push({
零件图号: data[j].零件图号,
零件名称: data[j].零件名称,
批次数量: data[j].批次数量,
到货状态: data[j].到货状态,
工艺计划流水号: data[j].工艺计划流水号,
外协加工任务单明细流水号: data[j].外协加工任务单明细流水号,
单件是否外协: data[j].单件是否外协,
外协工序: ''
})
}
this.getProcedure(this.List3)
this.加工价格合计 = 0
this.材料价格合计 = 0
this.其他价格合计 = 0
if (response.data.length !== 0) {
this.外协员电话 = response.data[0].联系电话
this.联系人 = response.data[0].联系人
this.联系人电话 = response.data[0].电话
this.运费 = response.data[0].运费
this.card = true
} else {
this.card = false
}
const children = document.getElementsByClassName('tableData')
const parent = document.getElementById('1')
if (children.length !== 0) {
for (let i = children.length - 1; i >= 0; i--) {
parent.removeChild(children[i])
}
}
const tr = []
for (let i = 0; i < this.returns.length; i++) {
tr[i] = document.createElement('tr')
tr[i].setAttribute('class', 'tableData')
tr[i].innerHTML = '<td></td>' + '<td colspan="5"></td>' + '<td colspan="2"></td>' + '<td colspan="2"></td>' +
'<td colspan="9" style="text-align: left;"></td>' + '<td colspan="1"></td>' + '<td></td><td></td><td></td><td></td><td colspan="2"></td><td colspan="2"></td>'
$('#tableHead').after(tr[i])
}
for (let j = 0; j < this.returns.length; j++) {
document.getElementsByClassName('tableData')[j].children[0].innerHTML = j + 1
document.getElementsByClassName('tableData')[j].children[1].innerHTML = response.data[j].零件图号
document.getElementsByClassName('tableData')[j].children[2].innerHTML = response.data[j].零件名称
document.getElementsByClassName('tableData')[j].children[3].innerHTML = response.data[j].批次数量
document.getElementsByClassName('tableData')[j].children[4].innerHTML = ''
document.getElementsByClassName('tableData')[j].children[5].innerHTML = response.data[j].是否临时件1
document.getElementsByClassName('tableData')[j].children[6].innerHTML = response.data[j].外协分类
document.getElementsByClassName('tableData')[j].children[7].innerHTML = parseInt(response.data[j].加工价格_成交.toFixed(2))
document.getElementsByClassName('tableData')[j].children[8].innerHTML = parseInt(response.data[j].材料价格_价格.toFixed(2))
document.getElementsByClassName('tableData')[j].children[9].innerHTML = parseInt(response.data[j].其他价格.toFixed(2))
if (response.data[j].机加工开始时间 !== null) {
document.getElementsByClassName('tableData')[j].children[10].innerHTML = response.data[j].机加工开始时间.substr(0, 10)
}
if (response.data[j].机加工结束时间 !== null) {
document.getElementsByClassName('tableData')[j].children[11].innerHTML = response.data[j].机加工结束时间.substr(0, 10)
}
this.加工价格合计 += parseInt(document.getElementsByClassName('tableData')[j].children[7].innerHTML)
this.材料价格合计 += parseInt(document.getElementsByClassName('tableData')[j].children[8].innerHTML)
this.其他价格合计 += parseInt(document.getElementsByClassName('tableData')[j].children[9].innerHTML)
}
this.总计 = this.加工价格合计 + this.材料价格合计 + this.其他价格合计 + this.运费
this.大写金额 = convertCurrency(this.总计)
// RWD end
for (let i = 0; i < response.data.length; i++) { // 声明二维数组
this.零件图号.push(response.data[i].零件图号)
this.零件名称.push(response.data[i].零件名称)
this.批次数量.push(response.data[i].批次数量)
this.外协预算总价格.push(response.data[i].外协预算总价格.toFixed(2))
this.加工价格_成交.push(response.data[i].加工价格_成交.toFixed(2))
this.外协分类.push(response.data[i].外协分类)
this.材料费.push(response.data[i].材料费.toFixed(2))
this.材料价格_价格.push(response.data[i].材料价格_价格.toFixed(2))
this.其他价格.push(response.data[i].其他价格.toFixed(2))
if (response.data[i].机加工开始时间 !== null) {
this.机加工开始时间.push(response.data[i].机加工开始时间.substr(0, 10))
} else {
this.机加工开始时间.push(' ')
}
if (response.data[i].机加工结束时间 !== null) {
this.机加工结束时间.push(response.data[i].机加工结束时间.substr(0, 10))
} else {
this.机加工结束时间.push(' ')
}
this.外协加工任务单明细流水号.push(response.data[i].外协加工任务单明细流水号)
this.process[i] = []
}
for (let i = 0; i < this.returns.length; i++) {
spareParts(this.returns[i].工艺计划流水号, this.returns[i].单件是否外协).then(response => {
for (let k = 0; k < response.data.length; k++) {
this.gongxulsh.push({
工序流水号: response.data[k].工序流水号
})
this.process[i][k] = response.data[k].工艺名称简称
document.getElementsByClassName('tableData')[i].children[4].innerHTML += response.data[k].工艺名称简称 + '/'
}
}).then(() => {
this.wancheng = 1
})
}
}).then(() => {
// this.List3 = this.bianliang
getParts(row.外协加工任务单流水号).then(response => {
this.List3 = response.data
this.loading = false
})
},
callOff(formName) {
this.dialogFormVisible = false
this.$refs[formName].resetFields()
},
getProcedure(row) {
for (let i = 0; i < row.length; i++) {
getprocedure(row[i].工艺计划流水号, row[i].单件是否外协).then(response => {
this.List3[i].外协工序 = ''
this.procedure[i] = ''
for (let j = 0; j < response.data.length; j++) {
this.procedure[i] = this.procedure[i] + ' ' + response.data[j].工艺名称简称
}
this.List3[i].外协工序 = this.procedure[i]
})
}
},
getSummaries(param) {
const { data } = param
const sums = ['', '', '', 0, '', 0, '', 0, '', 0, '', 0, '', '', '', '', '', '', '', '', '', '', '', '', 0, 0, '', 0, 0, 0, '', '']
sums[1] = '费用'
sums[2] = '加工费:'
sums[4] = '材料费:'
sums[6] = '其他费用:'
sums[8] = '运费:'
sums[9] = parseInt(this.freight)
sums[10] = '合计:'
for (let i = 0; i < data.length; i++) {
sums[24] += Math.round(parseFloat(data[i].外协预算总价格) * 100) / 100
}
sums[24] = Math.round(sums[24] * 100) / 100
for (let i = 0; i < data.length; i++) {
sums[25] += Math.round(parseFloat(data[i].加工价格_成交) * 100) / 100
}
sums[25] = Math.round(sums[25] * 100) / 100
for (let i = 0; i < data.length; i++) {
sums[27] += Math.round(parseFloat(data[i].材料费) * 100) / 100
}
sums[27] = Math.round(sums[27] * 100) / 100
for (let i = 0; i < data.length; i++) {
sums[28] += Math.round(parseFloat(data[i].材料价格_价格) * 100) / 100
}
sums[28] = Math.round(sums[28] * 100) / 100
for (let i = 0; i < data.length; i++) {
sums[29] += Math.round(parseFloat(data[i].其他价格) * 100) / 100
}
sums[29] = Math.round(sums[29] * 100) / 100
for (let i = 0; i < data.length; i++) {
if (data[i].机加工开始时间 !== null) {
if (Date.parse(data[i].机加工开始时间) <= this.contrast) {
this.contrast = Date.parse(data[i].机加工开始时间)
sums[30] = data[i].机加工开始时间.substr(0, 10)
this.最早时间 = data[i].机加工开始时间.substr(0, 10)
}
}
}
for (let i = 0; i < data.length; i++) {
if (data[i].机加工结束时间 !== null) {
if (Date.parse(data[i].机加工结束时间) >= this.contrast1) {
this.contrast1 = Date.parse(data[i].机加工结束时间)
sums[31] = data[i].机加工结束时间.substr(0, 10)
this.最晚时间 = data[i].机加工结束时间.substr(0, 10)
}
}
}
sums[3] = sums[25]
sums[5] = sums[28]
sums[7] = sums[29]
sums[11] = Math.round((sums[3] + sums[5] + sums[7] + sums[9]) * 100) / 100
sums[26] = '---'
return sums
},
indexMethod(index) {
return index + 1
},
handleSelectionChange(val) {
this.OutsouringNumber = []
this.工艺计划流水号 = []
@@ -602,124 +239,17 @@ export default {
this.工艺计划流水号.push(val[i].工艺计划流水号)
}
},
// 收货
getSpareParts() {
if (this.OutsouringNumber.length !== 0) {
this.loading = true
Arrival(this.OutsouringNumber, this.工艺计划流水号).then(response => {
Arrival(this.Number, this.OutsouringNumber, this.工艺计划流水号).then(response => {
if (response.data[0].result === '1') {
this.$message.success('到货成功')
this.contrast = 3000000000000
this.contrast1 = 0
this.List3 = []
this.零件图号 = []
this.零件名称 = []
this.批次数量 = []
this.外协预算总价格 = []
this.加工价格_成交 = []
this.外协分类 = []
this.材料费 = []
this.材料价格_价格 = []
this.其他价格 = []
this.机加工开始时间 = []
this.机加工结束时间 = []
this.外协加工任务单明细流水号 = []
this.process = []
this.fetchData()
getParts(this.Number).then(response => {
this.returns = response.data
for (let j = 0; j < response.data.length; j++) {
this.List3.push({
零件图号: response.data[j].零件图号,
零件名称: response.data[j].零件名称,
批次数量: response.data[j].批次数量,
到货状态: response.data[j].到货状态,
工艺计划流水号: response.data[j].工艺计划流水号,
外协加工任务单明细流水号: response.data[j].外协加工任务单明细流水号,
单件是否外协: response.data[j].单件是否外协,
外协工序: ''
})
}
this.getProcedure(this.List3)
this.加工价格合计 = 0
this.材料价格合计 = 0
this.其他价格合计 = 0
if (response.data.length !== 0) {
this.外协员电话 = response.data[0].联系电话
this.联系人 = response.data[0].联系人
this.联系人电话 = response.data[0].电话
this.运费 = response.data[0].运费
this.card = true
} else {
this.card = false
}
const children = document.getElementsByClassName('tableData')
const parent = document.getElementById('1')
if (children.length !== 0) {
for (let i = children.length - 1; i >= 0; i--) {
parent.removeChild(children[i])
}
}
const tr = []
for (let i = 0; i < this.returns.length; i++) {
tr[i] = document.createElement('tr')
tr[i].setAttribute('class', 'tableData')
tr[i].innerHTML = '<td></td>' + '<td colspan="5"></td>' + '<td colspan="2"></td>' + '<td colspan="2"></td>' +
'<td colspan="9" style="text-align: left;"></td>' + '<td colspan="1"></td>' + '<td></td><td></td><td></td><td></td><td colspan="2"></td><td colspan="2"></td>'
$('#tableHead').after(tr[i])
}
for (let j = 0; j < this.returns.length; j++) {
document.getElementsByClassName('tableData')[j].children[0].innerHTML = j + 1
document.getElementsByClassName('tableData')[j].children[1].innerHTML = response.data[j].零件图号
document.getElementsByClassName('tableData')[j].children[2].innerHTML = response.data[j].零件名称
document.getElementsByClassName('tableData')[j].children[3].innerHTML = response.data[j].批次数量
document.getElementsByClassName('tableData')[j].children[4].innerHTML = ''
document.getElementsByClassName('tableData')[j].children[5].innerHTML = response.data[j].是否临时件1
document.getElementsByClassName('tableData')[j].children[6].innerHTML = response.data[j].外协分类
document.getElementsByClassName('tableData')[j].children[7].innerHTML = parseInt(response.data[j].加工价格_成交.toFixed(2))
document.getElementsByClassName('tableData')[j].children[8].innerHTML = parseInt(response.data[j].材料价格_价格.toFixed(2))
document.getElementsByClassName('tableData')[j].children[9].innerHTML = parseInt(response.data[j].其他价格.toFixed(2))
if (response.data[j].机加工开始时间 !== null) {
document.getElementsByClassName('tableData')[j].children[10].innerHTML = response.data[j].机加工开始时间.substr(0, 10)
}
if (response.data[j].机加工结束时间 !== null) {
document.getElementsByClassName('tableData')[j].children[11].innerHTML = response.data[j].机加工结束时间.substr(0, 10)
}
this.加工价格合计 += parseInt(document.getElementsByClassName('tableData')[j].children[7].innerHTML)
this.材料价格合计 += parseInt(document.getElementsByClassName('tableData')[j].children[8].innerHTML)
this.其他价格合计 += parseInt(document.getElementsByClassName('tableData')[j].children[9].innerHTML)
}
this.总计 = this.加工价格合计 + this.材料价格合计 + this.其他价格合计 + this.运费
this.大写金额 = convertCurrency(this.总计)
for (let i = 0; i < response.data.length; i++) { // 声明二维数组
this.零件图号.push(response.data[i].零件图号)
this.零件名称.push(response.data[i].零件名称)
this.批次数量.push(response.data[i].批次数量)
this.外协预算总价格.push(response.data[i].外协预算总价格.toFixed(2))
this.加工价格_成交.push(response.data[i].加工价格_成交.toFixed(2))
this.外协分类.push(response.data[i].外协分类)
this.材料费.push(response.data[i].材料费.toFixed(2))
this.材料价格_价格.push(response.data[i].材料价格_价格.toFixed(2))
this.其他价格.push(response.data[i].其他价格.toFixed(2))
if (response.data[i].机加工开始时间 !== null) {
this.机加工开始时间.push(response.data[i].机加工开始时间.substr(0, 10))
} else {
this.机加工开始时间.push(' ')
}
if (response.data[i].机加工结束时间 !== null) {
this.机加工结束时间.push(response.data[i].机加工结束时间.substr(0, 10))
} else {
this.机加工结束时间.push(' ')
}
this.外协加工任务单明细流水号.push(response.data[i].外协加工任务单明细流水号)
this.process[i] = []
spareParts(this.returns[i].工艺计划流水号, this.returns[i].单件是否外协).then(response => {
for (let k = 0; k < response.data.length; k++) { // 执行n次2
this.process[i].push(response.data[k].工艺名称简称)
document.getElementsByClassName('tableData')[i].children[4].innerHTML += response.data[k].工艺名称简称 + '/'
}
}).then(() => {
this.loading = false
})
}
this.List3 = response.data
this.loading = false
})
} else {
this.$message.error('到货失败')
@@ -729,21 +259,10 @@ export default {
this.$message.warning('请选择零件')
}
},
downLoadRWD(tableid) {
if (this.List3.length === 0) {
this.$message.warning('暂无数据')
} else {
getExplorer()
method5(tableid)
Cleanup()
}
},
// 表格颜色
tableRowClassName({ row }) {
if (row.差价 < 0) {
return 'chajia'
} else {
return ''
tableData1ClassName({ row, rowIndex }) {
row.index = rowIndex
if (row.到货状态 === '1') {
return 'WXDHdh'
}
},
// 分页
@@ -766,6 +285,9 @@ export default {
}
</style>
<style>
.WXDHdh{
background: #9bd7fc !important;
}
td{
width: 100px;
height: 30px;
@@ -799,4 +321,3 @@ export default {
height: 30px;
}
</style>

View File

@@ -21,7 +21,7 @@
</el-select>
<el-input v-model="partName" placeholder="零件图号" size="small" clearable style="width:150px"/>
<el-button size="small" icon="el-icon-search" type="primary" plain @click="pageSize1=50; pageCurrent1=1;searchTable()">查询</el-button>
<el-table v-loading="loading1" :data="tableData1" size="mini" highlight-current-row height="550px" style="width: 100%;" border element-loading-text="拼命加载中" @row-click="searchTable2">
<el-table v-loading="loading1" :data="tableData1" :row-class-name="tableData1ClassName2" size="mini" highlight-current-row height="550px" style="width: 100%;" border element-loading-text="拼命加载中" @row-click="searchTable2">
<el-table-column label="零件图号" prop="零件图号" align="center" width="140px" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.零件图号 }}
@@ -235,6 +235,12 @@ export default {
return 'XJWXywc'
}
},
tableData1ClassName2({ row, rowIndex }) {
row.index = rowIndex
if (row.状态 === 1 || row.状态 === '1') {
return 'XJWXwx'
}
},
// 修改外协状态
edit(index, row) {
this.count = 0
@@ -245,21 +251,20 @@ export default {
}
}
if (this.count === this.tableData2.length) {
this.tableData1[this.index2].状态 = 0
edit2(row.工序流水号, row.工艺计划流水号, 0)
}
if (this.checkBox[index] === true) {
this.InOut = 2
this.tableData2[this.index].工序间是否外协 = 2
this.tableData1[this.index2].状态 = 1
edit(row.工序流水号, this.InOut).then(response => {
edit2(row.工序流水号, row.工艺计划流水号, 1).then(response => {
this.tableData2[this.index].工序间是否外协 = 2
this.tableData1[this.index2].工序间是否外协 = 2
})
edit2(row.工序流水号, row.工艺计划流水号, 1)
})
} else {
this.InOut = 1
edit(row.工序流水号, this.InOut).then(response => {
this.tableData2[this.index].工序间是否外协 = 1
})
this.tableData2[this.index].工序间是否外协 = 1
edit(row.工序流水号, this.InOut)
}
},
// 保存行价格

View File

@@ -88,7 +88,7 @@
<el-button type="success" size="small" icon="el-icon-download" style="margin-left: 10px" @click="addMateriel">选入</el-button>
</el-tooltip>
<el-tooltip :open-delay="1200" effect="dark" content="保存选中的采购计划单" placement="top">
<el-button type="baocun" size="small" icon="el-icon-download" style="margin-left: 50px" @click="saveMateriel">保存</el-button>
<el-button type="baocun" size="small" icon="el-icon-download" style="margin-left: 140px" @click="saveMateriel">保存</el-button>
</el-tooltip>
</div>
<el-table v-loading="" :data="tableData2" border stripe style="max-height: 460px;" height="200px" size="mini" highlight-current-row @row-click="searchTable3">
@@ -105,13 +105,13 @@
{{ scope.row.采购单号 }}
</template>
</el-table-column>
<el-table-column label="购计划单名称" prop="采购单名称" align="center" width="120">
<el-table-column label="购计划单名称" prop="采购单名称" align="center" width="120">
<template slot-scope="scope">
{{ scope.row.采购单名称 }}
</template>
</el-table-column>
<!--<el-table-column label="供应商" prop="供应商名称" align="center" min-width="200" width="200" show-overflow-tooltip>-->
<el-table-column label="供应商" prop="供应商名称" align="center" min-width="200" width="230" show-overflow-tooltip>
<el-table-column label="供应商" prop="供应商名称" align="center" min-width="200" width="200" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.供应商名称 }}
</template>
@@ -232,7 +232,7 @@
<el-form ref="form2" :model="form2" :rules="rules2" label-position="right" label-width="120px">
<el-row>
<el-col :span="12">
<el-form-item label="购计划单名称" prop="采购计划单名称">
<el-form-item label="购计划单名称" prop="采购计划单名称">
<el-input v-model="form2.采购单名称" size="small"/>
</el-form-item>
</el-col>
@@ -269,13 +269,13 @@
</el-form>
<div slot="footer" class="dialog-footer">
<el-button
v-show="title2==='创建购计划单'"
v-show="title2==='创建购计划单'"
type="primary"
size="small"
icon="el-icon-check"
@click="submitAddPurchaseOrder">确定</el-button>
<el-button
v-show="title2==='编辑购计划单'"
v-show="title2==='编辑购计划单'"
type="primary"
size="small"
icon="el-icon-check"
@@ -466,7 +466,7 @@ export default {
},
created() {
this.searchRawMaterial()
this.searchTable1()
// this.searchTable1()
// this.searchTable2()
},
methods: {
@@ -604,7 +604,7 @@ export default {
if (this.$refs['form2'] !== undefined) {
this.$refs['form2'].resetFields()
}
this.title2 = '创建购计划单'
this.title2 = '创建购计划单'
this.form2.supplierNameValue = ''
this.form2.供应商名称 = ''
this.form2.计划完成日期 = ''
@@ -683,18 +683,18 @@ export default {
},
exportExcel2(row) {
this.searchTable3(row).then(val => {
console.log(val)
console.log(row, 11111)
console.log(this.tableData4)
if (this.tableData4.length !== 0) {
import('@/vendor/Export2Excel').then(excel => {
const tHeader = ['备料状态', '物料编码', '零件名称', '材料', '数量', '成品尺寸', '单位', '备注']
const filterVal = ['备料状态', '物料零件编码', '零件名称', '材料', '采购数量', '成品尺寸', '备注1']
const filterVal = ['备料状态', '物料零件编码', '零件名称', '材料', '数量', '成品尺寸', '单位', '备注1']
const list = this.tableData4
const data = this.formatJson(filterVal, list)
excel.export_json_to_excel({
header: tHeader,
data,
filename: '详情',
filename: row.采购单名称 + '-' + row.计划完成日期,
autoWidth: true,
bookType: 'xlsx'
})

View File

@@ -10,18 +10,20 @@
:label="item.label"
:value="item.value"/>
</el-select>
<!--<el-input v-model="Name" placeholder="供应商" size="small" clearable/>-->
<!--<span>关联情况:</span>-->
<!--<el-select v-model="PickingValue" placeholder="关联情况" size="small" clearable>-->
<!--<el-option-->
<!--v-for="item in Picking"-->
<!--:key="item.value"-->
<!--:label="item.label"-->
<!--:value="item.value"/>-->
<!--</el-select>-->
<!--<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-tooltip>-->
<span>请款时间段:</span>
<el-date-picker
v-model="dateRange"
:picker-options="pickerOptions"
size="small"
type="daterange"
align="center"
style="width: 300px;margin: 3px 0"
value-format="yyyy-MM-dd"
format="yyyy-MM-dd"
range-separator=""
start-placeholder="开始日期"
end-placeholder="结束日期"/>
<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="primary" size="small" icon="el-icon-plus" style="margin-left: 10px" @click="addArrivalOrder">新增到货单</el-button>
</div>
</el-card>
@@ -245,7 +247,7 @@
</el-dialog>
<el-dialog v-el-drag-dialog :visible.sync="dialogVisible10" title="添加到货明细" center style="min-height: 400px" width="1600px">
<el-form ref="form10" :model="form10" :rules="rules10" label-position="right" label-width="60px">
<el-row>
<el-row style="background-color: white">
<el-col :span="5" style="margin-left: 2%">
<span>供应商</span>
<el-input v-model="供应商名称" style="width: 250px" size="small" readonly/>
@@ -274,7 +276,7 @@
</el-row>
<el-row>
<div style="width: 20%;float: left;margin-top: 20px">
<div style="background: gainsboro">
<div style="background: white">
<el-row style="height: 50px">
<el-form-item label="材料" prop="CailiaoValue">
<el-input v-model="form10.CailiaoValue" size="small"/>
@@ -505,6 +507,37 @@ import { ExcelWaiGou } from '@/utils/request'
export default {
data() {
return {
check1: 0,
check2: 0,
dateRange: '',
expands: [],
pickerOptions: {
shortcuts: [{
text: '上季度',
onClick(picker) {
const end = new Date()
const start = new Date()
start.setTime(end.getTime() - 3600 * 1000 * 24 * 30 * 3)
picker.$emit('pick', [start, end])
}
}, {
text: '过去半年',
onClick(picker) {
const end = new Date()
const start = new Date()
start.setTime(end.getTime() - 3600 * 1000 * 24 * 366 / 2)
picker.$emit('pick', [start, end])
}
}, {
text: '过去一年',
onClick(picker) {
const end = new Date()
const start = new Date()
start.setTime(end.getTime() - 3600 * 1000 * 24 * 365)
picker.$emit('pick', [start, end])
}
}]
},
excle_row: [],
supplierNameValue: '',
supplierName: [], // 供应商
@@ -628,7 +661,7 @@ export default {
created() {
this.fetchdata()
this.searchTable2()
this.searchTable4()
// this.searchTable4()
},
methods: {
saveData(row) {
@@ -711,7 +744,7 @@ export default {
const sums = []
columns.forEach((column, index) => {
if (index === 1) {
sums[index] = '总量:'
sums[index] = '总量:'
return
} else if (index === 2) {
const values = data.map(item => Number(item['数量']))
@@ -804,12 +837,13 @@ export default {
this.tableData5 = []
this.tableData6 = []
this.supplierNameValue ? this.check = 1 : this.check = 0
this.dateRange ? this.check1 = 1 : (this.check1 = 0, this.dateRange = '')
if (this.PickingValue === 0 || this.PickingValue === 1) {
this.check2 = 1
} else {
this.check2 = 0
}
searchArriveOrder(this.check, this.supplierNameValue, this.check2, this.PickingValue, this.pageCurrent4, this.pageSize4).then(response => {
searchArriveOrder(this.check, this.supplierNameValue, this.check2, this.PickingValue, this.check1, this.dateRange[0], this.dateRange[1], this.pageCurrent4, this.pageSize4).then(response => {
this.tableData4 = response.data.rows
this.total4 = response.data.total
})