成品工单加顺序

yangwl
zhaoxiaolin 1 year ago
parent 92ff4350e6
commit da2b7358b3

@ -33,6 +33,19 @@ export function getProRoutes(prodCode) {
}) })
} }
// 获取当天的递增工单执行顺序
export function getProSortNo(productDate) {
const data = {
productDate
}
return request({
url: '/plan/order/getProSortNo',
method: 'put',
data: data
})
}
// 通过工艺code获取设备信息 // 通过工艺code获取设备信息
export function getProEquipment(routeCode) { export function getProEquipment(routeCode) {
return request({ return request({

@ -361,7 +361,7 @@
:total="consumeTotal" :total="consumeTotal"
:page.sync="consumeQueryParams.consumePageNum" :page.sync="consumeQueryParams.consumePageNum"
:limit.sync="consumeQueryParams.consumePageSize" :limit.sync="consumeQueryParams.consumePageSize"
@pagination="getReportWorkConsumeList" @pagination="getList"
/> />
</el-dialog> </el-dialog>
@ -370,7 +370,6 @@
<script> <script>
import { listReportWork, getReportWork, delReportWork, addReportWork, updateReportWork } from "@/api/mes/reportWork"; import { listReportWork, getReportWork, delReportWork, addReportWork, updateReportWork } from "@/api/mes/reportWork";
import { listReportWorkConsume, getReportWorkConsume, delReportWorkConsume, addReportWorkConsume, updateReportWorkConsume} from "@/api/mes/reportWorkConsume";
import ReportWorkConsume from "./reportWorkConsume.vue"; import ReportWorkConsume from "./reportWorkConsume.vue";
export default { export default {
@ -543,7 +542,7 @@ export default {
handleAdd() { handleAdd() {
this.reset(); this.reset();
this.open = true; this.open = true;
this.title = "添加报工报表"; this.title = "添加报工记录";
this.optType = "add"; this.optType = "add";
}, },
/** 修改按钮操作 */ /** 修改按钮操作 */

@ -388,13 +388,15 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :offset="1" :span="7"> <el-col :offset="1" :span="7">
<el-form-item label="选择设备:"> <!-- 工单日期 -->
<el-cascader <el-form-item size="small" label="工单日期: ">
@focus="changeEquipment" <el-date-picker @change="checkDate" v-model="splitForm.productDate" type="date" placeholder="选择日期"
:options="eRouteOptions" ></el-date-picker>
:props="eRouteProps" </el-form-item>
v-model="splitForm.prodLineCodeArray" </el-col>
clearable></el-cascader> <el-col :offset="1" :span="7">
<el-form-item label="工单排序(插单<=0)" label-width="130px">
<el-input type="number" v-model="splitForm.sortNo"></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
@ -416,11 +418,17 @@
<el-input required type="number" @input="splitNumChange" v-model="splitForm.splitNum"></el-input> <el-input required type="number" @input="splitNumChange" v-model="splitForm.splitNum"></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :offset="1" :span="5"> </el-row>
<!-- 工单日期 --> <el-row>
<el-form-item size="small" label="工单日期: "> <el-col :span="7">
<el-date-picker @change="checkDate" v-model="splitForm.productDate" type="date" placeholder="选择日期" <el-form-item label="选择设备:">
></el-date-picker> <div style="height: 130px;overflow-y: auto;">
<el-cascader
:options="eRouteOptions"
:props="eRouteProps"
v-model="splitForm.prodLineCodeArray"
clearable></el-cascader>
</div>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
@ -483,7 +491,7 @@
import { import {
getCascadeProOrder, getCascadeProOrder,
getProEquipment, getProEquipment,
getProRoutes, getProRoutes,getProSortNo,
getProShifts, getProShifts,
getWorkOrderList, getWorkOrderList,
subSplitOrder, subSplitOrder,
@ -801,6 +809,7 @@ export default {
splitBtn(e) { splitBtn(e) {
// //
var row; var row;
let _this = this;
getCascadeProOrder(e.orderCode).then(response => { getCascadeProOrder(e.orderCode).then(response => {
row = response.data row = response.data
@ -843,6 +852,12 @@ export default {
this.routes = response.data this.routes = response.data
}) })
var ymd = moment(this.splitForm.productDate).format('YYYY-MM-DD')
//
getProSortNo(ymd).then(response => {
_this.splitForm.sortNo = response
})
this.workerLoading = true // true this.workerLoading = true // true
// //
getWorkOrderList(row.id).then(response => { getWorkOrderList(row.id).then(response => {
@ -946,7 +961,8 @@ export default {
}, },
// - // -
checkDate(e) { checkDate(e) {
var now = new Date() var now = new Date();
let _this = this;
if (e < now) { if (e < now) {
e = now e = now
this.splitForm.productDate = now this.splitForm.productDate = now
@ -954,6 +970,12 @@ export default {
message: "工单日期不能早于今天", message: "工单日期不能早于今天",
type: "warning" type: "warning"
}) })
}else{
var ymd = moment(this.splitForm.productDate).format('YYYY-MM-DD')
//
getProSortNo(ymd).then(response => {
_this.splitForm.sortNo = response
})
} }
}, },
// - // -
@ -1068,6 +1090,13 @@ export default {
}) })
return return
} }
if (this.splitForm.sortNo == null) {
this.$message({
message: '工单生产顺序不能为空!',
type: 'warning'
})
return
}
if (this.splitForm.prodLineCodeArray.length == 0) { if (this.splitForm.prodLineCodeArray.length == 0) {
this.$message({ this.$message({
message: '请选择各流程节点的设备!', message: '请选择各流程节点的设备!',
@ -1139,7 +1168,8 @@ export default {
shiftId: this.splitForm.shiftId, shiftId: this.splitForm.shiftId,
splitNum: this.splitForm.splitNum, splitNum: this.splitForm.splitNum,
product: this.productData[0], product: this.productData[0],
routeCode: this.splitForm.routeCode routeCode: this.splitForm.routeCode,
sortNo: this.splitForm.sortNo
} }
subSplitOrder(data).then(response => { subSplitOrder(data).then(response => {
@ -1160,7 +1190,7 @@ export default {
splitNum: null, splitNum: null,
productDate: null, productDate: null,
shiftId: null, shiftId: null,
formFields: [] formFields: [],
} }
this.formFields = [{ this.formFields = [{
batchCode: '', batchCode: '',
@ -1256,11 +1286,13 @@ export default {
handleSyncSAP() { handleSyncSAP() {
this.loading = true; this.loading = true;
let _this = this; let _this = this;
this.$modal.confirm('是否确认SAP同步操作步骤').then(function () { this.$modal.confirm('是否确认SAP同步操作步骤执行后需要一分钟后查看同步结果').then(function () {
return syncSAP() _this.loading = false;
syncSAP()
}).then(() => { }).then(() => {
this.getList() //this.getList()
this.loading = false; _this.loading = false;
this.$modal.msgSuccess('同步成功') this.$modal.msgSuccess('同步成功')
}).catch( }).catch(
function (e) { function (e) {

@ -395,6 +395,10 @@
<el-form-item v-if="checkType" size="small" label="分配车数:"> <el-form-item v-if="checkType" size="small" label="分配车数:">
<el-input disabled type="number" @input="changeCarNum" v-model="splitForm.carNum"></el-input> <el-input disabled type="number" @input="changeCarNum" v-model="splitForm.carNum"></el-input>
</el-form-item> </el-form-item>
<el-form-item v-else label="工单排序(插单<=0)" label-width="130px">
<el-input type="number" v-model="splitForm.sortNo" disabled></el-input>
</el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-row> <el-row>
@ -526,7 +530,7 @@ import {
listWorkorder, listWorkorder,
delWorkorder, delWorkorder,
downWorkorder, downWorkorder,
getOrderAndWork, getOrderAndWork,getProSortNo,
getWorkBatchList, getWorkBatchList,
subChangeWorkOrder, subChangeWorkOrder,
checkWorkOrder checkWorkOrder
@ -890,6 +894,11 @@ export default {
} }
// //
if (this.productData[0],prototype != 'white'){ if (this.productData[0],prototype != 'white'){
if(this.splitData[0].sortNo != null){
this.splitForm.sortNo = this.splitData[0].sortNo
}
// //
function setAtrr1(order, work) { function setAtrr1(order, work) {
order.quantitySplit = Number(order.quantitySplit) - Number(work.quantitySplit); order.quantitySplit = Number(order.quantitySplit) - Number(work.quantitySplit);
@ -901,6 +910,7 @@ export default {
} }
setAtrr1(this.productData[0], this.splitData[0]); setAtrr1(this.productData[0], this.splitData[0]);
} }
}) })

Loading…
Cancel
Save