This commit is contained in:
liushuai
2019-11-02 18:37:48 +08:00
parent 7fd34ec94c
commit a2595e981b
3 changed files with 152 additions and 6 deletions

View File

@@ -73,6 +73,30 @@ export function production2(num1, num2, num, b, d, e, f, g, h, i, j, k, l, m, n,
}
})
}
// 备料投产
export function production10(num, a, b, d, e, f, g, h, i, j, k, l, m, n, o, p, q, x, s, t, u, v, w) {
return request({
url: '',
method: 'post',
data: {
type: '2',
name: '设备管理_可安排生产计划零件排序_制定组时间_同时传递_备料',
param: '组件零件基本件流水号=' + num + '=int&投产类型流水号=' + a + '=int&数据类型=' + b + '=int&投产批次=1=int&批次数量=' + d + '=string&计划开始时间=' + e + '=string&计划结束时间=' + f + '=string&工艺计划开始时间=' + g + '=string&工艺计划结束时间=' + h + '=string&定额计划开始时间=' + i + '=string&定额计划结束时间=' + j + '=string&计划编制计划开始时间=' + k + '=string&计划编制计划结束时间=' + l + '=string&机加工开始时间=' + m + '=string&机加工结束时间=' + n + '=string&单件外协时间=' + o + '=string&单件是否外协=' + p + '=int&单件是否外协分类=' + q + '=string&计划制定人员编号=' + x + '&材料流水号=' + s + '=int&是否临时件=' + t + '=int&是否难度件=' + u + '=string&是否着急=' + v + '=int&是否白图=' + w + '=int'
}
})
}
// 合并备料投产
export function production20(num1, num2, num, b, d, e, f, g, h, i, j, k, l, m, n, o, p, q, x, s, t, u, v, w) {
return request({
url: '',
method: 'post',
data: {
type: '2',
name: '设备管理_可安排生产计划零件排序_制定组时间_同时传递_合并投产_备料',
param: '零件图号=' + num1 + '&规格=' + num2 + '&机床流水号=' + num + '&投产类型流水号=' + 1 + '=int&数据类型=' + b + '=int&投产批次=1=int&批次数量=' + d + '=string&计划开始时间=' + e + '=string&计划结束时间=' + f + '=string&工艺计划开始时间=' + g + '=string&工艺计划结束时间=' + h + '=string&定额计划开始时间=' + i + '=string&定额计划结束时间=' + j + '=string&计划编制计划开始时间=' + k + '=string&计划编制计划结束时间=' + l + '=string&机加工开始时间=' + m + '=string&机加工结束时间=' + n + '=string&单件外协时间=' + o + '=string&单件是否外协=' + p + '=int&单件是否外协分类=' + q + '=string&计划制定人员编号=' + x + '&材料流水号=' + s + '=int&是否临时件=' + t + '=int&是否难度件=' + u + '=string&是否着急=' + v + '=int&是否白图=' + w + '=int'
}
})
}
// 获取表2的值
export function getTable1(num, pageList, pageSize) {
return request({

View File

@@ -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('请至少选择一个零件')

View File

@@ -196,14 +196,17 @@
format="yyyy-MM-dd"
value-format="yyyy-MM-dd"
placeholder="选择日期"/>
<span style="font-weight: bold">制造:</span>
<el-tooltip :open-delay="1200" effect="dark" content="将零件选择到采购单" placement="top">
<el-button type="success" size="small" icon="el-icon-star-off" style="margin-top: 3px; margin-left: 15px" @click="purchaseRequisition()">制造部采购</el-button>
</el-tooltip>
<el-tooltip :open-delay="1200" effect="dark" content="所选零件分配到采购部" placement="top">
<el-button type="primary" size="small" icon="el-icon-star-off" style="margin-top: 3px; margin-left: 15px" @click="PurchasingDepartment()">采购部门采购</el-button>
<el-button type="success" size="small" icon="el-icon-star-off" style="margin-top: 3px; margin-left: 5px" @click="purchaseRequisition()">制造部采购</el-button>
</el-tooltip>
<span style="margin-left: 40px;font-weight: bold">金工:</span>
<el-tooltip :open-delay="1200" effect="dark" content="所选零件分配为自家生产" placement="top">
<el-button type="warning" size="small" icon="el-icon-star-off" style="margin: 3px 15px 10px 15px; margin-left: 15px" @click="Production()">车间生产</el-button>
<el-button type="danger" size="small" icon="el-icon-star-off" style="margin-top: 3px; margin-left: 5px" @click="Production()">车间生产</el-button>
</el-tooltip>
<span style="margin-left: 40px;font-weight: bold">采购:</span>
<el-tooltip :open-delay="1200" effect="dark" content="所选零件分配到采购部" placement="top">
<el-button type="primary" size="small" icon="el-icon-star-off" style="margin-top: 3px; margin-left: 5px" @click="PurchasingDepartment()">采购部门采购</el-button>
</el-tooltip>
</el-card>
<el-card>