项目计划管理
This commit is contained in:
@@ -9,7 +9,7 @@
|
||||
:label="item.label"
|
||||
:value="item.value"/>
|
||||
</el-select>
|
||||
<el-button :disabled="disabled" type="primary" size="small" icon="el-icon-circle-plus-outline" @click="addReceipt">增加</el-button>
|
||||
<el-button type="primary" size="small" icon="el-icon-circle-plus-outline" @click="addReceipt">增加</el-button>
|
||||
<el-button type="warning" size="small" icon="el-icon-download" @click="exportTable()">导出</el-button>
|
||||
<div class="title">总装箱单</div>
|
||||
<el-table
|
||||
@@ -17,7 +17,8 @@
|
||||
:data="receiptData"
|
||||
border
|
||||
size="mini"
|
||||
style="margin-top:20px">
|
||||
style="margin-top:20px"
|
||||
@row-click="searchTable">
|
||||
<el-table-column
|
||||
label="装箱单号"
|
||||
align="center"
|
||||
@@ -417,7 +418,7 @@
|
||||
<el-button v-else-if="spareTitle==='编辑备件'" type="primary" @click="submitEditSpare">确定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<div v-show="false" id="cjn">
|
||||
<div v-show="true" id="cjn">
|
||||
<!--封面-->
|
||||
<table class="tg" style="width: 900px">
|
||||
<colgroup>
|
||||
@@ -597,6 +598,7 @@ export default {
|
||||
receiptVisible: false,
|
||||
machineTitle: '',
|
||||
machineVisible: false,
|
||||
GroupDataVisible: false,
|
||||
spareVisible: false,
|
||||
spareTitle: '',
|
||||
spareForm: {
|
||||
@@ -621,6 +623,18 @@ export default {
|
||||
联系人: '',
|
||||
联系方式: ''
|
||||
},
|
||||
GroupDataForm: {
|
||||
部件编号: '',
|
||||
代号: '',
|
||||
名称: '',
|
||||
规格: '',
|
||||
备注: '',
|
||||
数量: ''
|
||||
},
|
||||
GroupDataRule: {
|
||||
名称: [{ required: true, message: '请输入名称', trigger: 'blur' }],
|
||||
数量: [{ required: true, message: '请输入数量', trigger: 'blur' }]
|
||||
},
|
||||
receiptRules: {
|
||||
装箱单号: [{ required: true, message: '请输入装箱单号', trigger: 'blur' }],
|
||||
名称: [{ required: true, message: '请输入名称', trigger: 'blur' }],
|
||||
@@ -678,6 +692,8 @@ export default {
|
||||
this.receiptData = []
|
||||
this.spareData = []
|
||||
this.fileData = []
|
||||
this.receiptNum = 0
|
||||
this.receiptName = ''
|
||||
if (val) {
|
||||
this.getMachineSelect(val)
|
||||
}
|
||||
@@ -686,13 +702,12 @@ export default {
|
||||
receiptNum(val) {
|
||||
if (val !== 0) {
|
||||
this.getMachineData()
|
||||
this.getFileData()
|
||||
this.getSpareData()
|
||||
}
|
||||
},
|
||||
machine(val) {
|
||||
machineTableData(val) {
|
||||
if (val.length > 0) {
|
||||
this.machineValue = val[0].value
|
||||
this.getFileData()
|
||||
this.getSpareData()
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -712,12 +727,12 @@ export default {
|
||||
const response = await getReciptData(this.projectValue)
|
||||
const data = response.data
|
||||
if (data.length > 0) {
|
||||
this.receiptNum = data[0].装箱单编号
|
||||
this.receiptName = data[0].装箱单号
|
||||
// this.receiptNum = data[0].装箱单编号
|
||||
// this.receiptName = data[0].装箱单号
|
||||
this.receiptData = data
|
||||
} else {
|
||||
this.receiptNum = 0
|
||||
this.receiptName = ''
|
||||
// this.receiptNum = 0
|
||||
// this.receiptName = ''
|
||||
}
|
||||
},
|
||||
addReceipt() {
|
||||
@@ -733,6 +748,8 @@ export default {
|
||||
submitAddReceipt() {
|
||||
this.addTable(insertReciptData, [this.receiptForm.装箱单号, this.receiptForm.发货节点, this.receiptForm.名称, this.receiptForm.收货单位, this.receiptForm.联系方式, this.receiptForm.联系人, this.projectValue], 'receiptForm', function() {
|
||||
this.receiptVisible = false
|
||||
this.receiptNum = 0
|
||||
this.receiptName = ''
|
||||
this.getReceipt()
|
||||
})
|
||||
},
|
||||
@@ -745,6 +762,8 @@ export default {
|
||||
submitEditReceipt() {
|
||||
this.editTable(updateReciptData, [this.receiptForm.装箱单号, this.receiptForm.发货节点, this.receiptForm.名称, this.receiptForm.收货单位, this.receiptForm.联系方式, this.receiptForm.联系人, this.receiptNum], 'receiptForm', function() {
|
||||
this.receiptVisible = false
|
||||
this.receiptNum = 0
|
||||
this.receiptName = ''
|
||||
this.getReceipt()
|
||||
})
|
||||
},
|
||||
@@ -761,11 +780,24 @@ export default {
|
||||
this.fileVisible = false
|
||||
this.spareVisible = false
|
||||
},
|
||||
searchTable(row) {
|
||||
console.log(row)
|
||||
this.receiptNum = row.装箱单编号
|
||||
this.receiptName = row.装箱单号
|
||||
},
|
||||
async getMachineData() {
|
||||
this.machineTableData = []
|
||||
const response = await getMachineData(this.receiptNum)
|
||||
const data = response.data
|
||||
console.log(data, 1111)
|
||||
console.log(data, 111)
|
||||
if (data.length === 0) {
|
||||
this.machineValue = ''
|
||||
this.spareData = []
|
||||
this.fileData = []
|
||||
} else {
|
||||
this.machineValue = data[0].机床号
|
||||
}
|
||||
console.log(this.machineValue, 222)
|
||||
this.groupData = []
|
||||
for (let i = 0; i < data.length; i++) {
|
||||
const resp = await getGroupData(data[i].机床号)
|
||||
@@ -782,7 +814,6 @@ export default {
|
||||
数量: data[i].数量,
|
||||
备注: data[i].备注
|
||||
})
|
||||
console.log(this.groupData, 11112)
|
||||
}
|
||||
},
|
||||
addMachine() {
|
||||
@@ -824,6 +855,24 @@ export default {
|
||||
this.getMachineData()
|
||||
})
|
||||
},
|
||||
// editGroupData(row) {
|
||||
// console.log(row)
|
||||
// this.editForm(row, 'GroupDataForm', function() {
|
||||
// this.GroupDataVisible = true
|
||||
// })
|
||||
// },
|
||||
// async submitEditGroupData() {
|
||||
// console.log(this.GroupDataForm.部件编号, this.GroupDataForm.代号, this.GroupDataForm.名称, this.GroupDataForm.规格, this.GroupDataForm.数量, this.GroupDataForm.备注)
|
||||
// editGroupData(this.GroupDataForm.部件编号, this.GroupDataForm.代号, this.GroupDataForm.名称, this.GroupDataForm.规格, this.GroupDataForm.数量, this.GroupDataForm.备注).then(response => {
|
||||
// if (response.data[0].result === '1') {
|
||||
// this.$message.success('编辑成功')
|
||||
// this.GroupDataVisible = false
|
||||
// this.getMachineData()
|
||||
// } else {
|
||||
// this.$message.error('编辑失败')
|
||||
// }
|
||||
// })
|
||||
// },
|
||||
async getFileData() {
|
||||
const response = await getFileData(this.receiptNum)
|
||||
this.fileData = response.data
|
||||
@@ -858,6 +907,7 @@ export default {
|
||||
})
|
||||
},
|
||||
async getSpareData() {
|
||||
console.log(this.machineValue, 333)
|
||||
const response = await getSpareData(this.projectValue, this.machineValue)
|
||||
console.log(response)
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
@@ -910,7 +960,7 @@ export default {
|
||||
},
|
||||
exportTable() {
|
||||
const htmlNode = $('#cjn').html()
|
||||
const body = $('body').attr('style', 'padding: 20px;margin: 0 auto;display: block;width: 800px;background: #fff;')
|
||||
const body = $('body').attr('style', 'padding: 20px;margin: 0 auto;display: block;width: 950px;background: #fff;')
|
||||
body.children().hide()
|
||||
const printNode = $(htmlNode)
|
||||
body.append(printNode)
|
||||
|
||||
Reference in New Issue
Block a user