更新
This commit is contained in:
@@ -565,11 +565,6 @@ export default {
|
||||
purchasingOrder: '',
|
||||
ArrivalOrderNumber: '',
|
||||
ArrivalOrderMXNumber: '',
|
||||
ArrivalDetailSerialNumber: '',
|
||||
ArrivalOrderGroup: [],
|
||||
ArrivalOrderMXNumberGroup: [],
|
||||
numberGroup: [],
|
||||
LxnumberGroup: [],
|
||||
supplierName0: '',
|
||||
planType: 0,
|
||||
planTypes: [
|
||||
@@ -897,12 +892,9 @@ export default {
|
||||
sums[index] = 'N/A'
|
||||
}
|
||||
} else if (index === 7) {
|
||||
sums[index] = '总金额:'
|
||||
return
|
||||
} else if (index === 8) {
|
||||
const values = data.map(item => Number(item['金额']))
|
||||
if (!values.every(value => isNaN(value))) {
|
||||
sums[index] = values.reduce((prev, curr) => {
|
||||
sums[index] = '总金额:' + values.reduce((prev, curr) => {
|
||||
const value = Number(curr)
|
||||
if (!isNaN(value)) {
|
||||
return (parseInt((Number(prev) + Number(curr)) * 100) / 100).toFixed(2)
|
||||
@@ -1041,34 +1033,12 @@ export default {
|
||||
})
|
||||
},
|
||||
deleteArrivalOrder(row) { // 删除采购单
|
||||
this.ArrivalOrderGroup = []
|
||||
this.ArrivalOrderMXNumberGroup = []
|
||||
this.numberGroup = []
|
||||
this.LxnumberGroup = []
|
||||
this.ArrivalDetailSerialNumber = ''
|
||||
searchTable5(row.到货单流水号).then(response => {
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
this.ArrivalDetailSerialNumber = response.data[i].到货单明细流水号
|
||||
this.ArrivalOrderGroup.push(response.data[i].到货单明细流水号)
|
||||
console.log(this.ArrivalDetailSerialNumber, 231)
|
||||
searchTable6(this.ArrivalDetailSerialNumber).then(response => {
|
||||
for (let j = 0; j < response.data.length; j++) {
|
||||
this.ArrivalOrderMXNumberGroup.push(response.data[j].到货单明细绑定流水号)
|
||||
this.numberGroup.push(response.data[j].采购计划明细流水号)
|
||||
this.LxnumberGroup.push(response.data[j].离线采购计划明细流水号)
|
||||
}
|
||||
})
|
||||
}
|
||||
console.log(this.ArrivalOrderMXNumberGroup, this.numberGroup, this.LxnumberGroup, 111)
|
||||
})
|
||||
this.$confirm('确定删除该到货单?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
console.log(row.到货单流水号, this.ArrivalOrderGroup, this.ArrivalOrderMXNumberGroup, this.numberGroup, this.LxnumberGroup, 2222)
|
||||
deletePurchaseOrder(row.到货单流水号, this.ArrivalOrderGroup, this.ArrivalOrderMXNumberGroup, this.numberGroup, this.LxnumberGroup).then(response => {
|
||||
console.log(response, 123)
|
||||
deletePurchaseOrder(row.到货单流水号).then(response => {
|
||||
if (response.data[0].result === '1') {
|
||||
this.$message.success('删除成功')
|
||||
this.searchTable4()
|
||||
@@ -1128,14 +1098,12 @@ export default {
|
||||
this.到货重量组 = []
|
||||
this.到货金额组 = []
|
||||
this.arrest.map(v => {
|
||||
if (v.到货重量 > 0) {
|
||||
this.工艺计划流水号组.push(v.工艺计划流水号)
|
||||
this.采购计划明细流水号组.push(v.采购计划明细流水号)
|
||||
this.离线采购计划明细流水号组.push(v.离线采购计划明细流水号)
|
||||
this.本次到货数量组.push(v.未到货数量)
|
||||
this.到货重量组.push(v.到货重量)
|
||||
this.到货金额组.push(v.到货重量 * this.form10.单价)
|
||||
}
|
||||
this.工艺计划流水号组.push(v.工艺计划流水号)
|
||||
this.采购计划明细流水号组.push(v.采购计划明细流水号)
|
||||
this.离线采购计划明细流水号组.push(v.离线采购计划明细流水号)
|
||||
this.本次到货数量组.push(v.未到货数量)
|
||||
this.到货重量组.push(v.到货重量)
|
||||
this.到货金额组.push(v.到货重量 * this.form10.单价)
|
||||
})
|
||||
AddArrivalOrderMX(this.ArrivalOrderNumber, this.form10.CailiaoValue, this.form10.数量, this.form10.单位, this.form10.单价, this.form10.金额, this.工艺计划流水号组, this.采购计划明细流水号组, this.本次到货数量组, this.离线采购计划明细流水号组, this.到货重量组, this.到货金额组, this.userId).then(response => {
|
||||
if (response.data[0].result === '1') {
|
||||
@@ -1205,28 +1173,17 @@ export default {
|
||||
})
|
||||
},
|
||||
deleteArrivalMX(row) {
|
||||
this.ArrivalOrderMXNumberGroup = []
|
||||
this.numberGroup = []
|
||||
this.LxnumberGroup = []
|
||||
searchTable6(this.ArrivalOrderMXNumber).then(response => {
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
this.ArrivalOrderMXNumberGroup.push(response.data[i].到货单明细绑定流水号)
|
||||
this.numberGroup.push(response.data[i].采购计划明细流水号)
|
||||
this.LxnumberGroup.push(response.data[i].离线采购计划明细流水号)
|
||||
}
|
||||
})
|
||||
this.$confirm('确定取消该物料的到货信息?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
deleteArrivalMX(row.到货单明细流水号, this.ArrivalOrderMXNumberGroup, this.numberGroup, this.LxnumberGroup).then(response => {
|
||||
deleteArrivalMX(row.到货单明细流水号).then(response => {
|
||||
if (response.data[0].result === '1') {
|
||||
this.$message.success('删除成功')
|
||||
searchTable5(this.ArrivalOrderNumber).then(response => {
|
||||
this.tableData5 = response.data
|
||||
})
|
||||
this.tableData6 = []
|
||||
} else { this.$message.error('数据占用,删除失败') }
|
||||
})
|
||||
}).catch(() => {
|
||||
@@ -1245,6 +1202,7 @@ export default {
|
||||
if (response.data.length !== 0) {
|
||||
this.中间变量 = response.data[0].单件重量
|
||||
this.未绑定数量 = response.data[0].未绑定数量
|
||||
console.log(this.未绑定数量, 111)
|
||||
} else {
|
||||
this.未绑定数量 = row.数量
|
||||
}
|
||||
@@ -1287,14 +1245,12 @@ export default {
|
||||
this.到货重量组 = []
|
||||
this.到货金额组 = []
|
||||
this.arrest1.map(v => {
|
||||
if (v.到货数量 > 0) {
|
||||
this.工艺计划流水号组.push(v.工艺计划流水号)
|
||||
this.采购计划明细流水号组.push(v.采购计划明细流水号)
|
||||
this.离线采购计划明细流水号组.push(v.离线采购计划明细流水号)
|
||||
this.本次到货数量组.push(v.未到货数量)
|
||||
this.到货重量组.push(v.到货重量)
|
||||
this.到货金额组.push(v.到货重量 * this.单价)
|
||||
}
|
||||
this.工艺计划流水号组.push(v.工艺计划流水号)
|
||||
this.采购计划明细流水号组.push(v.采购计划明细流水号)
|
||||
this.离线采购计划明细流水号组.push(v.离线采购计划明细流水号)
|
||||
this.本次到货数量组.push(v.未到货数量)
|
||||
this.到货重量组.push(v.到货重量)
|
||||
this.到货金额组.push(v.到货重量 * this.单价)
|
||||
})
|
||||
addMateriel(this.ArrivalOrderMXNumber, this.工艺计划流水号组, this.采购计划明细流水号组, this.本次到货数量组, this.离线采购计划明细流水号组, this.到货重量组, this.到货金额组, this.userId).then(response => {
|
||||
if (response.data[0].result === '1') {
|
||||
|
||||
@@ -505,6 +505,16 @@ export default {
|
||||
if (response.data[0].result === '1') {
|
||||
this.$message.success('增加成功')
|
||||
this.dialogVisible1 = false
|
||||
this.gongyingshangValue = ''
|
||||
this.gongyingshang = []
|
||||
getGongyingshang().then(response => {
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
this.gongyingshang.push({
|
||||
label: response.data[i].供应商名称,
|
||||
value: response.data[i].供应商
|
||||
})
|
||||
}
|
||||
})
|
||||
this.searchTable1()
|
||||
} else {
|
||||
this.addTable1_disable = false
|
||||
|
||||
@@ -0,0 +1,297 @@
|
||||
<template>
|
||||
<div>
|
||||
<div style="width: 1900px;overflow:auto">
|
||||
<div style="white-space: nowrap">
|
||||
<el-card>
|
||||
<el-row>
|
||||
<el-select v-model="machineNameValue" placeholder="机床图号" style="width: 150px" size="small" filterable clearable>
|
||||
<el-option
|
||||
v-for="item in machineName"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"/>
|
||||
</el-select>
|
||||
<el-input v-model="partName" placeholder="零件图号名称" size="small" clearable style="width:150px"/>
|
||||
<el-date-picker
|
||||
v-model="outTime"
|
||||
type="daterange"
|
||||
size="small"
|
||||
format="yyyy-MM-dd"
|
||||
value-format="yyyy-MM-dd"
|
||||
range-separator="~"
|
||||
style="width:240px;margin-left: 10px"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"/>
|
||||
<el-button type="primary" icon="el-icon-search" size="small" plain style="margin-left: 10px" @click="total=0;pageSize = 20;pageCurrent = 1;searchTable()">查询</el-button>
|
||||
<!--<el-button type="primary" icon="el-icon-search" size="small" plain style="margin-left: 10px" @click="total=0;pageSize = 20;pageCurrent = 1;loginsession()">session</el-button>-->
|
||||
</el-row>
|
||||
</el-card>
|
||||
</div>
|
||||
</div>
|
||||
<el-card>
|
||||
<el-table
|
||||
v-loading="loading"
|
||||
:data="tableData"
|
||||
:row-class-name="tableRowClassName"
|
||||
height="590"
|
||||
style="width: 1390px; margin: 3px 0"
|
||||
size="mini"
|
||||
border
|
||||
highlight-current-row
|
||||
element-loading-text="拼命加载中">
|
||||
<el-table-column label="机床图号" prop="机床图号" align="center" width="140px" show-overflow-tooltip>
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.机床图号 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="机床名称" prop="机床名称" align="center" width="200px" show-overflow-tooltip>
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.机床名称 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="组号" prop="组号" align="center" width="100px" show-overflow-tooltip>
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.组号 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="零件图号" prop="零件图号" align="center" width="173px" show-overflow-tooltip>
|
||||
<!--<el-table-column label="零件图号" prop="零件图号" align="center" width="180" show-overflow-tooltip>-->
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.零件图号 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="零件名称" align="center" width="129" show-overflow-tooltip>
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.零件名称 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="投产数" align="center" width="70px">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.投产数量 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="报废数" align="center" width="70px">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.报废数量 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="补投数" align="center" width="70px">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.补投数量 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="报废日期" align="center" width="100">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.报废时间 ? scope.row.报废时间.split(' ')[0] : '' }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="报废人" align="center" width="100">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.姓名 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="补投日期" align="center" width="100">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.补投时间 ? scope.row.补投时间.split(' ')[0] : '' }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" width="90px" fixed="right">
|
||||
<template slot-scope="scope">
|
||||
<el-tooltip :open-delay="1000" effect="dark" content="补投报废零件" placement="top">
|
||||
<div style="display: inline-block">
|
||||
<el-button :disabled="scope.row.报废数量-scope.row.补投数量===0" type="text" size="mini" @click="Supplementation(scope.row)">补投</el-button>
|
||||
</div>
|
||||
</el-tooltip>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div class="block">
|
||||
<el-pagination
|
||||
v-if="!loading"
|
||||
:current-page="pageCurrent"
|
||||
:page-sizes="[10, 20, 30, 40, 100]"
|
||||
:page-size="pageSize"
|
||||
:total="total"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange"/>
|
||||
</div>
|
||||
</el-card>
|
||||
<el-dialog :visible.sync="dialogFormVisible" title="补投" center width="300px">
|
||||
<el-form ref="form" :model="form" label-position="left" label-width="80px" class="demo-ruleForm">
|
||||
<el-form-item label="补投数量" prop="补投数量">
|
||||
<el-input-number v-model="form.补投数量" :min="1" :max="scrapNumber-supplementationNumber" :step="1" size="small" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button size="small" @click="dialogFormVisible=false">取消</el-button>
|
||||
<el-button :disabled="handleEdit_disable" size="small" type="primary" @click="submit()">确 定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { searchMachine, searchtable, editA } from '@/api/WorkshopProcurement/ScrappedSupplementaryInvestment1'
|
||||
import { mapGetters } from 'vuex'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
machineNameValue: '', // 机床图号
|
||||
machineName: [],
|
||||
partName: '',
|
||||
all: false,
|
||||
loading: false,
|
||||
handleEdit_disable: false,
|
||||
dialogFormVisible: false,
|
||||
form: {
|
||||
补投数量: ''
|
||||
},
|
||||
scrapNumber: '',
|
||||
supplementationNumber: '',
|
||||
Data: [],
|
||||
CutCodeBefore: '', // 工艺计划流水号
|
||||
tableData: [], // 表格数据
|
||||
total: 0, // 总条数
|
||||
pageSize: 30, // 每页显示条数
|
||||
pageCurrent: 1, // 后台获取页
|
||||
outTime: '',
|
||||
order: ''
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapGetters([
|
||||
'id',
|
||||
'token'
|
||||
])
|
||||
},
|
||||
created() {
|
||||
this.projectChange()
|
||||
},
|
||||
methods: {
|
||||
projectChange() {
|
||||
this.machineName = []
|
||||
this.machineNameValue = ''
|
||||
searchMachine().then(response => {
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
this.machineName.push({
|
||||
label: response.data[i].机床图号,
|
||||
value: response.data[i].机床流水号
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
exportTable() {
|
||||
let check7, check8
|
||||
if (this.partName !== '' && this.partName !== null) {
|
||||
this.partNamecheck = true
|
||||
} else {
|
||||
this.partNamecheck = false
|
||||
}
|
||||
this.outTime ? check7 = 1 : (check7 = 0, this.outTime = '')
|
||||
this.all === false ? check8 = 0 : check8 = 1
|
||||
var param = []
|
||||
param[0] = ['机床流水号', this.machineNameValue]
|
||||
param[1] = ['零件图号_check', this.partNamecheck]
|
||||
param[2] = ['零件图号', this.partName]
|
||||
param[3] = ['投产时间_check', check7]
|
||||
if (check7 === 0) {
|
||||
param[4] = ['开始时间', '']
|
||||
param[5] = ['结束时间', '']
|
||||
} else {
|
||||
param[4] = ['开始时间', this.outTime[0]]
|
||||
param[5] = ['结束时间', this.outTime[1]]
|
||||
}
|
||||
param[6] = ['加急_check', check8]
|
||||
var Data = this.CreateData('2001', '报表_生产计划查询', param)
|
||||
this.exportExcel_NPOI(Data)
|
||||
},
|
||||
// 查询表格数据
|
||||
searchTable() {
|
||||
this.loading = true
|
||||
let check, check1, check7
|
||||
this.machineNameValue ? check = 1 : check = 0
|
||||
this.partName ? check1 = 1 : check1 = 0
|
||||
this.outTime ? check7 = 1 : (check7 = 0, this.outTime = '')
|
||||
searchtable(check, this.machineNameValue, check1, this.partName, check7, this.outTime[0], this.outTime[1], this.pageCurrent, this.pageSize).then(response => {
|
||||
console.log(response.data, 123)
|
||||
this.tableData = response.data.result
|
||||
this.loading = false
|
||||
this.total = parseInt(response.data.output[0].ItemCount)
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
Supplementation(row) {
|
||||
this.form.补投数量 = Number(row.报废数量) - Number(row.补投数量)
|
||||
this.scrapNumber = row.报废数量
|
||||
this.supplementationNumber = row.补投数量
|
||||
this.CutCodeBefore = row.工艺计划流水号
|
||||
this.dialogFormVisible = true
|
||||
},
|
||||
submit() {
|
||||
if (this.form.补投数量 > 0) {
|
||||
if (!this.editB_disable) {
|
||||
this.handleEdit_disable = true
|
||||
editA(this.CutCodeBefore, this.form.补投数量, this.id).then(response => {
|
||||
if (response.data[0].result === '1') {
|
||||
this.$message.success('补投成功')
|
||||
this.dialogFormVisible = false
|
||||
this.searchTable()
|
||||
this.handleEdit_disable = false
|
||||
} else {
|
||||
this.handleEdit_disable = false
|
||||
this.$message.error('补投失败')
|
||||
}
|
||||
})
|
||||
}
|
||||
} else {
|
||||
this.$message.warning('补投数量不能为零')
|
||||
}
|
||||
},
|
||||
tableRowClassName({ row }) {
|
||||
if (row.是否加急 === '1') {
|
||||
return 'UrgentItem'
|
||||
}
|
||||
},
|
||||
// 分页
|
||||
handleSizeChange(val) {
|
||||
this.pageCurrent = 1
|
||||
this.pageSize = val
|
||||
this.searchTable()
|
||||
},
|
||||
handleCurrentChange(val) {
|
||||
this.pageCurrent = val
|
||||
this.searchTable()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.el-form--label-left >>> .el-form-item__label {
|
||||
text-align: right;
|
||||
}
|
||||
>>>.el-dialog--center .el-dialog__body {
|
||||
text-align: initial;
|
||||
padding: 20px 30px 20px
|
||||
}
|
||||
>>>.el-dialog__header {
|
||||
padding: 20px 20px 0px;
|
||||
}
|
||||
>>>.el-dialog__footer {
|
||||
padding: 0px 20px 20px;
|
||||
/*text-align: right;*/
|
||||
-webkit-box-sizing: border-box;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
>>>.el-form-item {
|
||||
margin-bottom: 13px;
|
||||
}
|
||||
</style>
|
||||
<style>
|
||||
.el-table .UrgentItem{
|
||||
background: #FF9797;
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user