|
|
|
@ -173,6 +173,18 @@
|
|
|
|
|
>切线调拨
|
|
|
|
|
</el-button>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="1.5">
|
|
|
|
|
<el-button
|
|
|
|
|
type="primary"
|
|
|
|
|
plain
|
|
|
|
|
icon="el-icon-edit"
|
|
|
|
|
size="mini"
|
|
|
|
|
:disabled="single"
|
|
|
|
|
@click="editBatch"
|
|
|
|
|
v-hasPermi="['mes:pro:workorder:edit']"
|
|
|
|
|
>批次编辑
|
|
|
|
|
</el-button>
|
|
|
|
|
</el-col>
|
|
|
|
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
|
|
|
|
</el-row>
|
|
|
|
|
|
|
|
|
@ -622,6 +634,84 @@
|
|
|
|
|
<el-button @click="cancel">取 消</el-button>
|
|
|
|
|
</div>
|
|
|
|
|
</el-dialog>
|
|
|
|
|
<!-- 批次编辑 -->
|
|
|
|
|
<el-dialog :title="batchTitle" :visible.sync="batchOpen" width="1000px" append-to-body>
|
|
|
|
|
<el-row :gutter="10" class="mb8">
|
|
|
|
|
<el-col :span="1.5">
|
|
|
|
|
<el-button
|
|
|
|
|
type="success"
|
|
|
|
|
plain
|
|
|
|
|
icon="el-icon-add"
|
|
|
|
|
size="mini"
|
|
|
|
|
@click="handleAddBatch"
|
|
|
|
|
v-hasPermi="['mes:pro:workorder:edit']"
|
|
|
|
|
>新增
|
|
|
|
|
</el-button>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="1.5">
|
|
|
|
|
<el-button
|
|
|
|
|
type="warning"
|
|
|
|
|
plain
|
|
|
|
|
icon="el-icon-edit"
|
|
|
|
|
size="mini"
|
|
|
|
|
:disabled="batchSingle"
|
|
|
|
|
@click="handleUpdateBatch"
|
|
|
|
|
v-hasPermi="['mes:pro:workorder:edit']"
|
|
|
|
|
>修改
|
|
|
|
|
</el-button>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="1.5">
|
|
|
|
|
<el-button
|
|
|
|
|
type="danger"
|
|
|
|
|
plain
|
|
|
|
|
icon="el-icon-remove"
|
|
|
|
|
size="mini"
|
|
|
|
|
:disabled="batchSingle"
|
|
|
|
|
@click="handleRemoveBatch"
|
|
|
|
|
v-hasPermi="['mes:pro:workorder:edit']"
|
|
|
|
|
>删除
|
|
|
|
|
</el-button>
|
|
|
|
|
</el-col>
|
|
|
|
|
</el-row>
|
|
|
|
|
<el-table border v-loading="batchLoading" :data="batchData" @selection-change="batchSelectionChange"
|
|
|
|
|
ref="batchTable" row-key="orderCode"
|
|
|
|
|
>
|
|
|
|
|
<el-table-column type="selection" align="center" />
|
|
|
|
|
<el-table-column label="工单编号" align="center" prop="workorderCode" width="150"/>
|
|
|
|
|
<el-table-column label="当前批次号" align="center" prop="batchCode"/>
|
|
|
|
|
<el-table-column label="当前批次数量" align="center" prop="batchQuantity"/>
|
|
|
|
|
<el-table-column label="新批次号" align="center" prop="newBatchCode"/>
|
|
|
|
|
<el-table-column label="新批次数量" align="center" prop="newBatchQuantity"/>
|
|
|
|
|
</el-table>
|
|
|
|
|
<div slot="footer" class="dialog-footer">
|
|
|
|
|
<el-button type="primary" @click="hangleCloseEditBatch">关 闭</el-button>
|
|
|
|
|
</div>
|
|
|
|
|
</el-dialog>
|
|
|
|
|
|
|
|
|
|
<!-- 批次编辑新增/修改页面 -->
|
|
|
|
|
<el-dialog :title="bEditTitle" :visible.sync="bEditOpen" width="600px" append-to-body>
|
|
|
|
|
<el-form :model="batchForm" ref="batchForm" :rules="batchRules" label-width="120px">
|
|
|
|
|
<el-form-item label="工单编号" prop="workorderCode">
|
|
|
|
|
<el-input v-model="batchForm.workorderCode" placeholder="" disabled></el-input>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item v-if="editBatchFlag" label="当前批次号" prop="batchCode">
|
|
|
|
|
<el-input v-model="batchForm.batchCode" placeholder="请输入当前批次号" disabled></el-input>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item v-if="editBatchFlag" label="当前批次数量" prop="batchQuantity">
|
|
|
|
|
<el-input type="number" v-model.number="batchForm.batchQuantity" placeholder="请输入当前批次数量" disabled></el-input>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="新批次号" prop="newBatchCode">
|
|
|
|
|
<el-input v-model="batchForm.newBatchCode" placeholder="请输入新批次号"></el-input>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="新批次数量" prop="newBatchQuantity">
|
|
|
|
|
<el-input type="number" v-model.number="batchForm.newBatchQuantity" placeholder="请输入新批次数量"></el-input>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-form>
|
|
|
|
|
<div slot="footer" class="dialog-footer">
|
|
|
|
|
<el-button type="primary" @click="batchSubmitForm">确 定</el-button>
|
|
|
|
|
<el-button @click="batchCancel">取 消</el-button>
|
|
|
|
|
</div>
|
|
|
|
|
</el-dialog>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
@ -634,7 +724,12 @@ import {
|
|
|
|
|
getOrderAndWork,getProSortNo,
|
|
|
|
|
getWorkBatchList,
|
|
|
|
|
subChangeWorkOrderPro,subChangeWorkOrderM,
|
|
|
|
|
checkWorkOrder
|
|
|
|
|
checkWorkOrder,
|
|
|
|
|
getWorkOrderBatch,
|
|
|
|
|
getWorkOrderBatchInfo,
|
|
|
|
|
insertWorkOrderBatch,
|
|
|
|
|
updateWorkOrderBatch,
|
|
|
|
|
removeWorkOrderBatch
|
|
|
|
|
} from '@/api/plan/workorder'
|
|
|
|
|
import moment from 'moment';
|
|
|
|
|
import { getProEquipment, getProRoutes, getProShifts,selectMaterielList} from '@/api/plan/order'
|
|
|
|
@ -714,13 +809,18 @@ export default {
|
|
|
|
|
},
|
|
|
|
|
// 遮罩层
|
|
|
|
|
loading: true,
|
|
|
|
|
batchLoading: true,
|
|
|
|
|
// 选中数组
|
|
|
|
|
ids: [],
|
|
|
|
|
cods: [],
|
|
|
|
|
// 批次编辑列表
|
|
|
|
|
batchData: [],
|
|
|
|
|
// 非单个禁用
|
|
|
|
|
single: true,
|
|
|
|
|
batchSingle: true,
|
|
|
|
|
// 非多个禁用
|
|
|
|
|
multiple: true,
|
|
|
|
|
batchMultiple: true,
|
|
|
|
|
// 下达禁用
|
|
|
|
|
statuses: [],
|
|
|
|
|
// 显示搜索条件
|
|
|
|
@ -732,9 +832,15 @@ export default {
|
|
|
|
|
// 弹出层标题
|
|
|
|
|
title: "",
|
|
|
|
|
titleM:"",
|
|
|
|
|
batchTitle: "",
|
|
|
|
|
bEditTitle: "",
|
|
|
|
|
// 是否显示弹出层
|
|
|
|
|
open: false,
|
|
|
|
|
openM:false,
|
|
|
|
|
batchOpen: false,
|
|
|
|
|
bEditOpen: false,
|
|
|
|
|
// 是否禁止修改批次
|
|
|
|
|
editBatchFlag: false,
|
|
|
|
|
// 查询参数
|
|
|
|
|
queryParams: {
|
|
|
|
|
productDateArray: [new Date(), new Date()],
|
|
|
|
@ -768,6 +874,7 @@ export default {
|
|
|
|
|
},
|
|
|
|
|
// 表单参数
|
|
|
|
|
form: {},
|
|
|
|
|
batchForm: {},
|
|
|
|
|
// 表单校验
|
|
|
|
|
rules: {
|
|
|
|
|
workorderCode: [
|
|
|
|
@ -789,6 +896,17 @@ export default {
|
|
|
|
|
{required: true, message: "单位不能为空", trigger: "blur"}
|
|
|
|
|
],
|
|
|
|
|
},
|
|
|
|
|
batchRules: {
|
|
|
|
|
workorderCode: [
|
|
|
|
|
{required: true, message: "工单编码不能为空", trigger: "blur"}
|
|
|
|
|
],
|
|
|
|
|
batchCode: [
|
|
|
|
|
{required: true, message: "当前批次编码不能为空", trigger: "blur"}
|
|
|
|
|
],
|
|
|
|
|
batchQuantity: [
|
|
|
|
|
{required: true, message: "当前批次数量不能为空", trigger: "blur"}
|
|
|
|
|
]
|
|
|
|
|
},
|
|
|
|
|
/**********************************/
|
|
|
|
|
eRouteProps: {multiple: true},
|
|
|
|
|
eRouteOptions: [],
|
|
|
|
@ -1626,6 +1744,17 @@ export default {
|
|
|
|
|
};
|
|
|
|
|
this.resetForm("form");
|
|
|
|
|
},
|
|
|
|
|
resetBatchForm() {
|
|
|
|
|
this.batchForm = {
|
|
|
|
|
workorderCode: null,
|
|
|
|
|
batchCode: null,
|
|
|
|
|
batchQuantity: null,
|
|
|
|
|
newBatchCode: null,
|
|
|
|
|
newBatchQuantity: null,
|
|
|
|
|
attr1: null,
|
|
|
|
|
}
|
|
|
|
|
this.resetForm("batchForm");
|
|
|
|
|
},
|
|
|
|
|
// 首-搜索按钮操作
|
|
|
|
|
handleQuery() {
|
|
|
|
|
this.queryParams.pageNum = 1;
|
|
|
|
@ -1647,6 +1776,13 @@ export default {
|
|
|
|
|
this.multiple = !selection.length
|
|
|
|
|
this.statuses = selection.map(item => item.status)
|
|
|
|
|
},
|
|
|
|
|
batchSelectionChange(selection) {
|
|
|
|
|
this.batchids = selection.map(item => item.workorderId)
|
|
|
|
|
this.bWorkCodes = selection.map(item => item.workorderCode)
|
|
|
|
|
this.batchCodes = selection.map(item => item.batchCode)
|
|
|
|
|
this.batchSingle = selection.length !== 1
|
|
|
|
|
this.batchMultiple = !selection.length
|
|
|
|
|
},
|
|
|
|
|
// 首-新增按钮操作
|
|
|
|
|
handleAdd() {
|
|
|
|
|
alert("待建设")
|
|
|
|
@ -1664,6 +1800,91 @@ export default {
|
|
|
|
|
})
|
|
|
|
|
return value;
|
|
|
|
|
},
|
|
|
|
|
editBatch() {
|
|
|
|
|
this.batchLoading = true;
|
|
|
|
|
const workOrdercode = this.codes[0];
|
|
|
|
|
getWorkOrderBatch(workOrdercode).then(response => {
|
|
|
|
|
if(response.code == 200) {
|
|
|
|
|
this.batchData = response.rows;
|
|
|
|
|
this.batchOpen = true;
|
|
|
|
|
this.batchLoading = false;
|
|
|
|
|
this.batchTitle = "批次编辑";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
hangleCloseEditBatch() {
|
|
|
|
|
this.batchOpen = false;
|
|
|
|
|
this.getList();
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
// 批次编辑新增
|
|
|
|
|
handleAddBatch() {
|
|
|
|
|
this.resetBatchForm();
|
|
|
|
|
this.batchForm.workorderCode = this.codes[0];
|
|
|
|
|
this.bEditOpen = true;
|
|
|
|
|
this.bEditTitle = "批次新增";
|
|
|
|
|
this.editBatchFlag = false;
|
|
|
|
|
},
|
|
|
|
|
// 批次编辑修改
|
|
|
|
|
handleUpdateBatch() {
|
|
|
|
|
this.editBatchFlag = true;
|
|
|
|
|
this.resetBatchForm();
|
|
|
|
|
const params = {
|
|
|
|
|
workorderCode: this.bWorkCodes[0],
|
|
|
|
|
batchCode: this.batchCodes[0]
|
|
|
|
|
}
|
|
|
|
|
getWorkOrderBatchInfo(params).then(response => {
|
|
|
|
|
this.batchForm = response.data;
|
|
|
|
|
this.bEditOpen = true;
|
|
|
|
|
this.bEditTitle = "批次修改";
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
// 批次编辑取消
|
|
|
|
|
batchCancel() {
|
|
|
|
|
this.bEditOpen = false;
|
|
|
|
|
this.editBatch();
|
|
|
|
|
},
|
|
|
|
|
// 批次编辑提交
|
|
|
|
|
batchSubmitForm() {
|
|
|
|
|
this.$refs["batchForm"].validate(valid => {
|
|
|
|
|
if (valid) {
|
|
|
|
|
if (this.batchForm.batchCode != null) {
|
|
|
|
|
updateWorkOrderBatch(this.batchForm).then(response => {
|
|
|
|
|
if(response.code === 200) {
|
|
|
|
|
this.$modal.msgSuccess("修改成功");
|
|
|
|
|
}else{
|
|
|
|
|
this.$modal.msgError(response.msg);
|
|
|
|
|
}
|
|
|
|
|
this.bEditOpen = false;
|
|
|
|
|
this.editBatch();
|
|
|
|
|
});
|
|
|
|
|
} else {
|
|
|
|
|
insertWorkOrderBatch(this.batchForm).then(response => {
|
|
|
|
|
if(response.code === 200) {
|
|
|
|
|
this.$modal.msgSuccess("新增成功");
|
|
|
|
|
}else{
|
|
|
|
|
this.$modal.msgError(response.msg);
|
|
|
|
|
}
|
|
|
|
|
this.bEditOpen = false;
|
|
|
|
|
this.editBatch();
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
// 删除批次
|
|
|
|
|
handleRemoveBatch() {
|
|
|
|
|
const workorderCode = this.bWorkCodes[0];
|
|
|
|
|
const batchCode = this.batchCodes[0];
|
|
|
|
|
this.$modal.confirm('是否确认删除批次编号为"' + batchCode + '"的数据项?').then(function() {
|
|
|
|
|
return removeWorkOrderBatch(batchCode,workorderCode);
|
|
|
|
|
}).then(() => {
|
|
|
|
|
this.editBatch();
|
|
|
|
|
this.$modal.msgSuccess("删除成功");
|
|
|
|
|
}).catch(() => {});
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
//新增-打开组成白坯选择物料窗口
|
|
|
|
|
selectBPMateriel() {
|
|
|
|
|
// 清除搜索缓存
|
|
|
|
|