更新
This commit is contained in:
@@ -170,6 +170,9 @@
|
||||
<el-tooltip :open-delay="1200" effect="dark" content="选中零件进行投产" placement="top">
|
||||
<el-button :loading="listLoading3" type="primary" size="small" style="float:right;" @click="production">投产</el-button>
|
||||
</el-tooltip>
|
||||
<el-tooltip :open-delay="1200" effect="dark" content="选中零件进行备料投产" placement="top">
|
||||
<el-button :loading="listLoading3" type="primary" size="small" style="float:right;" @click="production10">备料投产</el-button>
|
||||
</el-tooltip>
|
||||
<el-tooltip :open-delay="1200" effect="dark" content="将不同组号中相同图号的零件合并" placement="top">
|
||||
<el-checkbox v-model="checked_hebing" style="float:right;margin-top:10px;margin-right:10px">合并生产</el-checkbox>
|
||||
</el-tooltip>
|
||||
@@ -318,7 +321,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getEntryNameValue, getToolNum, getNum, getTable, production, getTable1, revisionBatch, editList, dele, production2, edit } from '@/api/ManufacturingCenter/InitialProduction'
|
||||
import { getEntryNameValue, getToolNum, getNum, getTable, production, getTable1, revisionBatch, editList, dele, production2, production20, production10, edit } from '@/api/ManufacturingCenter/InitialProduction'
|
||||
import { mapGetters } from 'vuex'
|
||||
import Cookie from 'js-cookie'
|
||||
|
||||
@@ -928,6 +931,122 @@ export default {
|
||||
}
|
||||
}
|
||||
},
|
||||
// 备料投产
|
||||
production10() {
|
||||
this.result = 0
|
||||
if (this.time_machiningFinish === '' || this.time_machiningFinish === null) {
|
||||
this.$message.error('请输入加工结束时间')
|
||||
} else {
|
||||
this.shijiancuo1 = Date.parse(this.time_machiningStart)
|
||||
this.shijiancuo = Date.parse(this.time_machiningFinish)
|
||||
this.jieguo = this.shijiancuo1 - this.shijiancuo
|
||||
if (this.jieguo >= 0) {
|
||||
this.$message.error('加工结束时间应大于开始时间')
|
||||
} else {
|
||||
if (this.multipleSelection.length === 0) {
|
||||
this.$message.error('请至少选择一个零件')
|
||||
} else {
|
||||
if (this.checked_hebing === true) {
|
||||
this.listLoading3 = true
|
||||
for (let i = 0; i < this.multipleSelection.length; i++) {
|
||||
if (this.multipleSelection[i].checked_waixie === false) {
|
||||
this.multipleSelection[i].checked_waixie = 1
|
||||
} else {
|
||||
this.multipleSelection[i].checked_waixie = 2
|
||||
}
|
||||
if (this.multipleSelection[i].checked_zhaoji === false) {
|
||||
this.multipleSelection[i].checked_zhaoji = 0
|
||||
} else {
|
||||
this.multipleSelection[i].checked_zhaoji = 1
|
||||
}
|
||||
if (this.multipleSelection[i].checked_dailiao === true) {
|
||||
this.multipleSelection[i].checked_dailiao = 2
|
||||
} else {
|
||||
this.multipleSelection[i].checked_dailiao = 1
|
||||
}
|
||||
if (this.checked_gaonandu === false) {
|
||||
this.checked_gaonandu = 0
|
||||
} else {
|
||||
this.checked_gaonandu = 1
|
||||
}
|
||||
if (this.checked_baitu === false) {
|
||||
this.checked_baitu = 0
|
||||
} else {
|
||||
this.checked_baitu = 1
|
||||
}
|
||||
production20(this.multipleSelection[i].零件图号, this.multipleSelection[i].规格, this.toolNumValue, this.multipleSelection[i].数据类型, this.multipleSelection[i].投产总数量, this.time_planStart, this.time_planFinish, this.time_gongyiStart, this.time_gongyiFinish, this.time_dingeStart, this.time_dingeFinish, this.time_planpinghengStart, this.time_planpinghengFinish, this.time_machiningStart, this.time_machiningFinish, this.time_planStart, this.multipleSelection[i].checked_waixie, this.multipleSelection[i].checked_dailiao, this.id, this.multipleSelection[i].材料流水号, this.radio, this.checked_gaonandu, this.multipleSelection[i].checked_zhaoji, this.checked_baitu).then(response => {
|
||||
this.result += parseInt(response.data[0].result)
|
||||
if (this.result === this.multipleSelection.length) {
|
||||
this.$message.success('投产成功')
|
||||
this.total = 0
|
||||
this.pageList = 1
|
||||
this.getTable()
|
||||
this.checked_baitu = false
|
||||
this.checked_gaonandu = false
|
||||
this.tableData1 = []
|
||||
this.listLoading3 = false
|
||||
} else if (response.data[0].result === '0') {
|
||||
this.listLoading3 = false
|
||||
this.$message.error('投产失败')
|
||||
}
|
||||
})
|
||||
this.shijiancuo1 = 0
|
||||
this.shijiancuo = 0
|
||||
this.jieguo = 0
|
||||
}
|
||||
} else {
|
||||
this.listLoading3 = true
|
||||
for (let i = 0; i < this.multipleSelection.length; i++) {
|
||||
if (this.multipleSelection[i].checked_waixie === false) {
|
||||
this.multipleSelection[i].checked_waixie = 1
|
||||
} else {
|
||||
this.multipleSelection[i].checked_waixie = 2
|
||||
}
|
||||
if (this.multipleSelection[i].checked_zhaoji === false) {
|
||||
this.multipleSelection[i].checked_zhaoji = 0
|
||||
} else {
|
||||
this.multipleSelection[i].checked_zhaoji = 1
|
||||
}
|
||||
if (this.multipleSelection[i].checked_dailiao === true) {
|
||||
this.multipleSelection[i].checked_dailiao = 2
|
||||
} else {
|
||||
this.multipleSelection[i].checked_dailiao = 1
|
||||
}
|
||||
if (this.checked_gaonandu === false) {
|
||||
this.checked_gaonandu = 0
|
||||
} else {
|
||||
this.checked_gaonandu = 1
|
||||
}
|
||||
if (this.checked_baitu === false) {
|
||||
this.checked_baitu = 0
|
||||
} else {
|
||||
this.checked_baitu = 1
|
||||
}
|
||||
production10(this.multipleSelection[i].组件零件基本件流水号, this.multipleSelection[i].投产类型流水号, this.multipleSelection[i].数据类型, this.multipleSelection[i].投产总数量, this.time_planStart, this.time_planFinish, this.time_gongyiStart, this.time_gongyiFinish, this.time_dingeStart, this.time_dingeFinish, this.time_planpinghengStart, this.time_planpinghengFinish, this.time_machiningStart, this.time_machiningFinish, this.time_planStart, this.multipleSelection[i].checked_waixie, this.multipleSelection[i].checked_dailiao, this.id, this.multipleSelection[i].材料流水号, this.radio, this.checked_gaonandu, this.multipleSelection[i].checked_zhaoji, this.checked_baitu).then(response => {
|
||||
this.result += parseInt(response.data[0].result)
|
||||
if (this.result === this.multipleSelection.length) {
|
||||
this.$message.success('投产成功')
|
||||
this.total = 0
|
||||
this.pageList = 1
|
||||
this.getTable()
|
||||
this.checked_baitu = false
|
||||
this.checked_gaonandu = false
|
||||
this.tableData1 = []
|
||||
this.listLoading3 = false
|
||||
} else if (response.data[0].result === '0') {
|
||||
this.listLoading3 = false
|
||||
this.$message.error('投产失败')
|
||||
}
|
||||
})
|
||||
this.shijiancuo1 = 0
|
||||
this.shijiancuo = 0
|
||||
this.jieguo = 0
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
back() {
|
||||
if (this.multipleSelection.length === 0) {
|
||||
this.$message.error('请至少选择一个零件')
|
||||
|
||||
Reference in New Issue
Block a user