|
|
|
@ -68,12 +68,9 @@
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="班次" prop="shiftId">
|
|
|
|
|
<el-select v-model="queryParams.shiftId" placeholder="请选择班次" clearable>
|
|
|
|
|
<el-option
|
|
|
|
|
v-for="dict in dict.type.shift_type"
|
|
|
|
|
:key="dict.value"
|
|
|
|
|
:label="dict.label"
|
|
|
|
|
:value="dict.value"
|
|
|
|
|
/>
|
|
|
|
|
<el-option v-for="item in workShift" :key="item.shiftId" :label="item.shiftDesc"
|
|
|
|
|
:value="item.shiftId"
|
|
|
|
|
></el-option>
|
|
|
|
|
</el-select>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item>
|
|
|
|
@ -188,10 +185,7 @@
|
|
|
|
|
<span>{{ parseTime(scope.row.productDate, '{y}-{m}-{d}') }}</span>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column label="班次" align="center" prop="shiftId">
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<dict-tag :options="dict.type.shift_type" :value="scope.row.shiftId"/>
|
|
|
|
|
</template>
|
|
|
|
|
<el-table-column label="班次" align="center" prop="shiftId" :formatter="shiftFormat">
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column label="工单状态" align="center" prop="status">
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
@ -275,10 +269,7 @@
|
|
|
|
|
prop="prodLineCode"
|
|
|
|
|
label="产线设备">
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column label="班次" align="center" prop="shiftId">
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<dict-tag :options="dict.type.shift_type" :value="scope.row.shiftId"/>
|
|
|
|
|
</template>
|
|
|
|
|
<el-table-column label="班次" align="center" prop="shiftId" :formatter="shiftFormat">
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column label="工单状态" align="center" prop="status">
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
@ -354,15 +345,6 @@
|
|
|
|
|
</el-select>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :offset="1" :span="7">
|
|
|
|
|
<el-form-item label="选择设备:">
|
|
|
|
|
<el-cascader
|
|
|
|
|
:options="eRouteOptions"
|
|
|
|
|
:props="eRouteProps"
|
|
|
|
|
v-model="splitForm.prodLineCodeArray"
|
|
|
|
|
clearable></el-cascader>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :offset="1" :span="7">
|
|
|
|
|
<!-- 工单日期 -->
|
|
|
|
|
<el-form-item size="small" label="工单日期: ">
|
|
|
|
@ -370,28 +352,44 @@
|
|
|
|
|
></el-date-picker>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
</el-row>
|
|
|
|
|
<!-- 第二行 -->
|
|
|
|
|
<el-row>
|
|
|
|
|
<el-col :span="7">
|
|
|
|
|
<el-col :offset="1" :span="7">
|
|
|
|
|
<!-- 选择班次 -->
|
|
|
|
|
<el-form-item size="small" label="选择班次:" class="my-select my-first">
|
|
|
|
|
<el-select @change="shiftChange" v-model="splitForm.shiftId" placeholder="请选择班次" clearable>
|
|
|
|
|
<el-option
|
|
|
|
|
v-for="dict in dict.type.shift_type"
|
|
|
|
|
:key="dict.value"
|
|
|
|
|
:label="dict.label"
|
|
|
|
|
:value="dict.value"
|
|
|
|
|
/>
|
|
|
|
|
<el-option v-for="item in workShift" :key="item.shiftId" :label="item.shiftDesc"
|
|
|
|
|
:value="item.shiftId"
|
|
|
|
|
></el-option>
|
|
|
|
|
</el-select>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :offset="1" :span="7">
|
|
|
|
|
<!-- 拆分数量 -->
|
|
|
|
|
<el-form-item size="small" label="拆分数量:">
|
|
|
|
|
<el-input required type="number" @input="splitNumChange" v-model="splitForm.splitNum"></el-input>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
</el-row>
|
|
|
|
|
<!-- 第二行 -->
|
|
|
|
|
<el-row>
|
|
|
|
|
<div v-if="splitForm.prodType == 'white'">
|
|
|
|
|
<el-col :span="7">
|
|
|
|
|
<!-- 选择物料 -->
|
|
|
|
|
<el-form-item size="small" label="投料名称:">
|
|
|
|
|
<el-input @focus="selectBPMateriel" readonly v-model="splitForm.materialName" placeholder="点击选择物料"/>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item size="small" label="投料编码:">
|
|
|
|
|
<el-input readonly v-model="splitForm.materialCode" placeholder="点击选择物料" disabled/>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :offset="1" :span="7">
|
|
|
|
|
<!-- 拆分数量 -->
|
|
|
|
|
<el-form-item size="small" label="拆分数量:">
|
|
|
|
|
<el-input required type="number" @input="splitNumChange" v-model="splitForm.splitNum"></el-input>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
</div>
|
|
|
|
|
<div v-else>
|
|
|
|
|
<el-col :span="7">
|
|
|
|
|
<!-- 拆分数量 -->
|
|
|
|
|
<el-form-item size="small" label="拆分数量:">
|
|
|
|
|
<el-input required type="number" @input="splitNumChange" v-model="splitForm.splitNum"></el-input>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
</div>
|
|
|
|
|
<el-col :offset="1" :span="7">
|
|
|
|
|
<!-- 车数 -->
|
|
|
|
|
<el-form-item v-if="checkType" size="small" label="分配车数:">
|
|
|
|
@ -399,6 +397,19 @@
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
</el-row>
|
|
|
|
|
<el-row>
|
|
|
|
|
<el-col :span="7">
|
|
|
|
|
<el-form-item label="选择设备:">
|
|
|
|
|
<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-col>
|
|
|
|
|
</el-row>
|
|
|
|
|
<!-- 第三行 -->
|
|
|
|
|
<el-row v-for="(item, index) in formFields" :key="index">
|
|
|
|
|
<!-- 批次编号 -->
|
|
|
|
@ -446,7 +457,7 @@
|
|
|
|
|
<el-table-column width="80" align="center" prop="quantitySplit" label="数量"></el-table-column>
|
|
|
|
|
<el-table-column width="60" label="单位" align="center" prop="unit"/>
|
|
|
|
|
<el-table-column width="90" label="工艺编码" align="center" prop="routeCode"/>
|
|
|
|
|
<el-table-column width="90" label="班次" align="center" prop="shiftDesc"/>
|
|
|
|
|
<el-table-column width="90" label="班次" align="center" prop="shiftDesc" :formatter="shiftFormat"/>
|
|
|
|
|
<el-table-column align="center" prop="batchCodeList" label="批次号"></el-table-column>
|
|
|
|
|
</el-table>
|
|
|
|
|
<!-- 测试 -->
|
|
|
|
@ -456,7 +467,56 @@
|
|
|
|
|
<el-button @click="cancel">取 消</el-button>
|
|
|
|
|
</div>
|
|
|
|
|
</el-dialog>
|
|
|
|
|
<!--组成白坯物料选择弹窗-->
|
|
|
|
|
<el-dialog
|
|
|
|
|
width="800px"
|
|
|
|
|
title="物料选择"
|
|
|
|
|
:visible.sync="innerBPVisible"
|
|
|
|
|
append-to-body>
|
|
|
|
|
|
|
|
|
|
<el-form :model="materielParams" ref="queryBPForm" size="small" :inline="true" v-show="showSearch"
|
|
|
|
|
label-width="68px">
|
|
|
|
|
<el-form-item label="物料编码" prop="productCode">
|
|
|
|
|
<el-input
|
|
|
|
|
v-model="materielParams.productCode"
|
|
|
|
|
placeholder="请输入物料编码"
|
|
|
|
|
clearable
|
|
|
|
|
@keyup.enter.native="handleMaterielQuery"
|
|
|
|
|
/>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="物料名称" prop="productCode">
|
|
|
|
|
<el-input
|
|
|
|
|
v-model="materielParams.productDescZh"
|
|
|
|
|
placeholder="请输入物料名称"
|
|
|
|
|
clearable
|
|
|
|
|
@keyup.enter.native="handleMaterielQuery"
|
|
|
|
|
/>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item>
|
|
|
|
|
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleMaterielQuery">搜索</el-button>
|
|
|
|
|
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-form>
|
|
|
|
|
|
|
|
|
|
<!-- 物料列表展示 -->
|
|
|
|
|
<el-table v-loading="loading" :data="materielList" @selection-change="selectionChange">
|
|
|
|
|
<el-table-column type="selection" width="55" align="center"/>
|
|
|
|
|
<el-table-column width="60" align="center" label="序号" type="index"></el-table-column>
|
|
|
|
|
<el-table-column label="物料编码" align="center" prop="productCode"/>
|
|
|
|
|
<el-table-column label="物料名称" align="center" prop="productDescZh"/>
|
|
|
|
|
</el-table>
|
|
|
|
|
|
|
|
|
|
<pagination
|
|
|
|
|
v-show="total>0"
|
|
|
|
|
:total="total"
|
|
|
|
|
:page.sync="materielParams.pageNum"
|
|
|
|
|
:limit.sync="materielParams.pageSize"
|
|
|
|
|
@pagination="getBPMaterielList"
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
|
|
<el-button @click="subMaterielBP" class="my-materiel-btn" type="primary">确定</el-button>
|
|
|
|
|
|
|
|
|
|
</el-dialog>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
@ -472,12 +532,12 @@ import {
|
|
|
|
|
checkWorkOrder
|
|
|
|
|
} from '@/api/plan/workorder'
|
|
|
|
|
import moment from 'moment';
|
|
|
|
|
import { getProEquipment, getProRoutes, getProShifts} from '@/api/plan/order'
|
|
|
|
|
import { getProEquipment, getProRoutes, getProShifts,selectMaterielList} from '@/api/plan/order'
|
|
|
|
|
import {prototype} from "clipboard";
|
|
|
|
|
|
|
|
|
|
export default {
|
|
|
|
|
name: "Workorder",
|
|
|
|
|
dicts: ['product_type', 'workorder_type', 'shift_type'],
|
|
|
|
|
dicts: ['product_type', 'workorder_type'],
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
|
// 拆分车数换算值
|
|
|
|
@ -539,6 +599,9 @@ export default {
|
|
|
|
|
shiftId: null,
|
|
|
|
|
routeCode: null,
|
|
|
|
|
carNum: 0,
|
|
|
|
|
prodType:null,
|
|
|
|
|
materialCode:null,
|
|
|
|
|
materialName:null
|
|
|
|
|
},
|
|
|
|
|
// 遮罩层
|
|
|
|
|
loading: true,
|
|
|
|
@ -617,12 +680,28 @@ export default {
|
|
|
|
|
},
|
|
|
|
|
/**********************************/
|
|
|
|
|
eRouteProps: {multiple: true},
|
|
|
|
|
eRouteOptions: []
|
|
|
|
|
eRouteOptions: [],
|
|
|
|
|
// 班次
|
|
|
|
|
workShift: [],
|
|
|
|
|
//组成白坯物料弹窗
|
|
|
|
|
innerBPVisible: false,
|
|
|
|
|
materielParams: {
|
|
|
|
|
mtart: 'material_type1',
|
|
|
|
|
productCode: null,
|
|
|
|
|
productDescZh: null,
|
|
|
|
|
pageNum: 1,
|
|
|
|
|
pageSize: 10,
|
|
|
|
|
},
|
|
|
|
|
materielBP: [],
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
created() {
|
|
|
|
|
this.getList();
|
|
|
|
|
// 获取班次信息
|
|
|
|
|
getProShifts().then(response => {
|
|
|
|
|
this.workShift = response.data
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
// 变更-车数数量校验
|
|
|
|
@ -701,13 +780,14 @@ export default {
|
|
|
|
|
productDate: null,
|
|
|
|
|
shiftId: null,
|
|
|
|
|
routeCode: null,
|
|
|
|
|
carNum: null
|
|
|
|
|
carNum: null,
|
|
|
|
|
prodType:null,
|
|
|
|
|
materialCode:null,
|
|
|
|
|
materialName:null
|
|
|
|
|
}
|
|
|
|
|
this.formFields = []
|
|
|
|
|
this.converCarNum = null;
|
|
|
|
|
|
|
|
|
|
//初始化日期为默认今天
|
|
|
|
|
this.splitForm.productDate = new Date()
|
|
|
|
|
// 获取班次信息
|
|
|
|
|
getProShifts().then(response => {
|
|
|
|
|
this.workShift = response.data
|
|
|
|
@ -741,8 +821,14 @@ export default {
|
|
|
|
|
getOrderAndWork(this.selectWork).then(response => {
|
|
|
|
|
this.splitData.push(response.data.workOrder)
|
|
|
|
|
this.productData.push(response.data.order)
|
|
|
|
|
|
|
|
|
|
//订单产品类型
|
|
|
|
|
this.splitForm.prodType = this.splitData[0].prodType
|
|
|
|
|
|
|
|
|
|
if(this.productData[0].prodType == 'white') {
|
|
|
|
|
this.checkType = true
|
|
|
|
|
this.splitForm.materialName = this.splitData[0].materialName
|
|
|
|
|
this.splitForm.materialCode = this.splitData[0].materialCode
|
|
|
|
|
}else {
|
|
|
|
|
this.checkType = false
|
|
|
|
|
}
|
|
|
|
@ -771,6 +857,13 @@ export default {
|
|
|
|
|
// 设置工艺
|
|
|
|
|
this.splitForm.routeCode = this.splitData[0].routeCode
|
|
|
|
|
|
|
|
|
|
//初始化日期为默认今天
|
|
|
|
|
if(this.splitData[0].productDate != null){
|
|
|
|
|
this.splitForm.productDate = this.splitData[0].productDate;
|
|
|
|
|
}else{
|
|
|
|
|
this.splitForm.productDate = new Date();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 订单为白坯
|
|
|
|
|
if (this.productData[0].prodType == 'white'){
|
|
|
|
@ -1050,6 +1143,8 @@ export default {
|
|
|
|
|
routeCode: this.workForm.routeCode,
|
|
|
|
|
proOrderWorkorder: this.selectWork,
|
|
|
|
|
carNum: this.workForm.carNum,
|
|
|
|
|
materialCode: this.splitForm.materialCode,
|
|
|
|
|
materialName: this.splitForm.materialName
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
subChangeWorkOrder(data).then(response => {
|
|
|
|
@ -1070,7 +1165,9 @@ export default {
|
|
|
|
|
productDate: null,
|
|
|
|
|
shiftId: null,
|
|
|
|
|
formFields: [],
|
|
|
|
|
carNum: null
|
|
|
|
|
carNum: null,
|
|
|
|
|
materialCode: null,
|
|
|
|
|
materialName: null
|
|
|
|
|
}
|
|
|
|
|
this.formFields = [{
|
|
|
|
|
batchCode: '',
|
|
|
|
@ -1228,6 +1325,60 @@ export default {
|
|
|
|
|
//this.reset();
|
|
|
|
|
//this.open = true;
|
|
|
|
|
//this.title = "添加生产工单";
|
|
|
|
|
},
|
|
|
|
|
shiftFormat(row,column){
|
|
|
|
|
let array = this.workShift;
|
|
|
|
|
let value = '其他';
|
|
|
|
|
array.forEach((item) => {
|
|
|
|
|
if (item.shiftId == row.shiftId) {
|
|
|
|
|
value = item.shiftDesc
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
return value;
|
|
|
|
|
},
|
|
|
|
|
//新增-打开组成白坯选择物料窗口
|
|
|
|
|
selectBPMateriel() {
|
|
|
|
|
// 清除搜索缓存
|
|
|
|
|
this.materielParams.productCode = null;
|
|
|
|
|
this.materielParams.productDescZh = null;
|
|
|
|
|
this.innerBPVisible = true;
|
|
|
|
|
this.getBPMaterielList();
|
|
|
|
|
},
|
|
|
|
|
//新增-打开组成白坯选择物料窗口
|
|
|
|
|
getBPMaterielList() {
|
|
|
|
|
this.loading = true;
|
|
|
|
|
selectMaterielList(this.materielParams).then(response => {
|
|
|
|
|
this.materielList = response.rows;
|
|
|
|
|
this.total = response.total;
|
|
|
|
|
this.loading = false;
|
|
|
|
|
}
|
|
|
|
|
);
|
|
|
|
|
},
|
|
|
|
|
// 新增-打开组成白坯选择物料窗口-选中物料信息
|
|
|
|
|
selectionChange(e) {
|
|
|
|
|
this.materielBP = e;
|
|
|
|
|
},
|
|
|
|
|
// 新增-打开组成白坯选择物料窗口-确认选择物料
|
|
|
|
|
subMaterielBP() {
|
|
|
|
|
if (this.materielBP.length == 0) {
|
|
|
|
|
this.$message({
|
|
|
|
|
message: '请选择物料!',
|
|
|
|
|
type: 'warning'
|
|
|
|
|
})
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
if (this.materielBP.length > 1) {
|
|
|
|
|
this.$message({
|
|
|
|
|
message: '物料只能选择一个!',
|
|
|
|
|
type: 'warning'
|
|
|
|
|
})
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
this.splitForm.materialCode = this.materielBP[0].productCode;
|
|
|
|
|
this.splitForm.materialName = this.materielBP[0].productDescZh;
|
|
|
|
|
|
|
|
|
|
this.innerBPVisible = false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|