This commit is contained in:
bryan sun
2019-11-06 17:04:05 +08:00
4 changed files with 158 additions and 12 deletions

View File

@@ -165,11 +165,14 @@
@size-change="handleSizeChange"
@current-change="handleCurrentChange"/>
<el-tooltip :open-delay="1200" effect="dark" content="打回到零件分配" placement="top">
<el-button :loading="listLoading3" type="primary" size="small" style="float:right;margin-left: 10px" @click="back">打回</el-button>
<el-button :loading="listLoading3" type="danger" size="small" style="float:right;margin-left: 10px" @click="back">打回</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="production">投产</el-button>
</el-tooltip>
<el-tooltip :open-delay="1200" effect="dark" content="选中零件进行备料投产" placement="top">
<el-button :loading="listLoading3" type="success" 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>

View File

@@ -136,7 +136,7 @@
<el-pagination
v-show="false"
:current-page="currentPage"
:page-sizes="[10, 20, 30, 1000000]"
:page-sizes="[10, 20, 30, 100]"
:page-size="pageSize"
:total="total"
style="float:left"
@@ -151,7 +151,7 @@
<div v-if="是否扫描 === true" class="block" style="margin-top: 10px;">
<el-pagination
:current-page="currentPage5"
:page-sizes="[10, 20, 30, 1000000]"
:page-sizes="[10, 20, 30, 100]"
:page-size="pageSize5"
:total="total5"
style="float:left"
@@ -706,15 +706,15 @@ export default {
tableData2: [], // 导出临时表
length: 0, // 记TABLEDATA1的长度
total: 0, // 总条数
pageSize: 1000000, // 每页显示条数
pageSize: 100, // 每页显示条数
pageList: 1, // 后台获取页
currentPage: 1, // 显示当前页
total1: 0, // 总条数
pageSize1: 1000000, // 每页显示条数
pageSize1: 10, // 每页显示条数
pageList1: 1, // 后台获取页
currentPage1: 1, // 显示当前页
total5: 0, // 总条数
pageSize5: 1000000, // 每页显示条数
pageSize5: 100, // 每页显示条数
pageList5: 1, // 后台获取页
currentPage5: 1 // 显示当前页
}