feat(order/shutdown): 添加工单批量操作功能,分页参数增加100一组

- 新增批量开始生产、批量更新数量、批量完工提报功能
- 添加批量操作对话框界面组件
- 实现工单表格多选功能
- 集成批量操作API接口
- 添加权限控制和操作验证逻辑
- 增加设备筛选和时间范围查询功能
- 添加批量维护停机原因功能
- 实现批量操作对话框界面
- 增加设备代码筛选选项
- 添加时间范围查询功能
- 集成批量更新API接口
- 完善表单验证和权限控制
 扩展分页选项增加100条每页显示
master
zangch@mesnac.com 2 months ago
parent 24d9e4fecb
commit d93d37f5aa

@ -112,3 +112,30 @@ export function getRunningOrderByDevice(deviceCode) {
method: 'get'
})
}
// 批量开始生产
export function batchStartProduction(data) {
return request({
url: '/base/orderInfo/batchStart',
method: 'put',
data: data
})
}
// 批量更新完工数量
export function batchUpdateQuantity(data) {
return request({
url: '/base/orderInfo/batchUpdateQty',
method: 'put',
data: data
})
}
// 批量完工提报
export function batchCompleteProduction(data) {
return request({
url: '/base/orderInfo/batchComplete',
method: 'put',
data: data
})
}

@ -51,3 +51,12 @@ export function delShutDown(recordShutDownId) {
method: 'delete'
})
}
// 批量更新停机原因
export function batchUpdateShutReason(data) {
return request({
url: '/dms/shutDown/batchUpdateReason',
method: 'put',
data: data
})
}

@ -36,7 +36,7 @@ export default {
pageSizes: {
type: Array,
default() {
return [10, 20, 30, 50]
return [10, 20, 30, 50, 100]
}
},
// 5

@ -19,8 +19,46 @@
</el-form-item>
</el-form>
<!-- 批量操作按钮 -->
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-video-play"
size="mini"
:disabled="multiple"
@click="handleBatchStart"
v-hasPermi="['base:orderInfo:edit']"
>批量开始生产</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-edit"
size="mini"
:disabled="multiple"
@click="handleBatchUpdateQty"
v-hasPermi="['base:orderInfo:edit']"
>批量更新数量</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-check"
size="mini"
:disabled="multiple"
@click="handleBatchComplete"
v-hasPermi="['base:orderInfo:edit']"
>批量完工提报</el-button>
</el-col>
</el-row>
<!-- 工单列表 -->
<el-table v-loading="loading" :data="orderList" border>
<el-table v-loading="loading" :data="orderList" border @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="工单编号" prop="orderCode" width="150" />
<el-table-column label="物料名称" prop="materialName" show-overflow-tooltip />
<el-table-column label="计划数量" prop="orderAmount" width="100" align="center" />
@ -144,6 +182,60 @@
</div>
</el-dialog>
<!-- 批量开始生产对话框 -->
<el-dialog title="批量开始生产" :visible.sync="batchStartDialogVisible" width="400px" append-to-body>
<el-form :model="batchStartForm" label-width="100px">
<el-form-item label="操作员">
<el-input v-model="batchStartForm.operator" placeholder="请输入操作员" />
</el-form-item>
<el-form-item>
<span style="color: #909399; font-size: 12px;">已选择 {{ selectedIds.length }} 条工单</span>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="batchStartDialogVisible = false"> </el-button>
<el-button type="primary" @click="confirmBatchStart"> </el-button>
</div>
</el-dialog>
<!-- 批量更新数量对话框 -->
<el-dialog title="批量更新完工数量" :visible.sync="batchUpdateQtyDialogVisible" width="400px" append-to-body>
<el-form :model="batchUpdateForm" label-width="100px">
<el-form-item label="完工数量">
<el-input-number v-model="batchUpdateForm.completeQty" :min="0" style="width: 100%" />
</el-form-item>
<el-form-item label="不良数量">
<el-input-number v-model="batchUpdateForm.defectQty" :min="0" style="width: 100%" />
</el-form-item>
<el-form-item>
<span style="color: #909399; font-size: 12px;">已选择 {{ selectedIds.length }} 条工单</span>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="batchUpdateQtyDialogVisible = false"> </el-button>
<el-button type="primary" @click="confirmBatchUpdateQty"> </el-button>
</div>
</el-dialog>
<!-- 批量完工提报对话框 -->
<el-dialog title="批量完工提报" :visible.sync="batchCompleteDialogVisible" width="400px" append-to-body>
<el-form :model="batchCompleteForm" label-width="100px">
<el-form-item label="完工数量">
<el-input-number v-model="batchCompleteForm.completeQty" :min="0" style="width: 100%" />
</el-form-item>
<el-form-item label="不良数量">
<el-input-number v-model="batchCompleteForm.defectQty" :min="0" style="width: 100%" />
</el-form-item>
<el-form-item>
<span style="color: #909399; font-size: 12px;">已选择 {{ selectedIds.length }} 条工单</span>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="batchCompleteDialogVisible = false"> </el-button>
<el-button type="success" @click="confirmBatchComplete"></el-button>
</div>
</el-dialog>
<!-- 工单详情对话框 -->
<el-dialog title="工单详情" :visible.sync="detailDialogVisible" width="600px" append-to-body>
<el-descriptions :column="2" border>
@ -171,7 +263,7 @@
</template>
<script>
import { listOrderInfo, startProduction, completeProduction, updateQuantity } from "@/api/base/orderInfo";
import { listOrderInfo, startProduction, completeProduction, updateQuantity, batchStartProduction, batchUpdateQuantity, batchCompleteProduction } from "@/api/base/orderInfo";
export default {
name: "OrderExecution",
@ -180,6 +272,8 @@ export default {
loading: false,
total: 0,
orderList: [],
selectedIds: [],
multiple: true,
queryParams: {
pageNum: 1,
pageSize: 10,
@ -190,6 +284,9 @@ export default {
updateQtyDialogVisible: false,
completeDialogVisible: false,
detailDialogVisible: false,
batchStartDialogVisible: false,
batchUpdateQtyDialogVisible: false,
batchCompleteDialogVisible: false,
startForm: {
orderCode: '',
materialName: '',
@ -207,6 +304,17 @@ export default {
completeQty: 0,
defectQty: 0
},
batchStartForm: {
operator: ''
},
batchUpdateForm: {
completeQty: 0,
defectQty: 0
},
batchCompleteForm: {
completeQty: 0,
defectQty: 0
},
detailOrder: {}
};
},
@ -307,6 +415,83 @@ export default {
handleDetail(row) {
this.detailOrder = row;
this.detailDialogVisible = true;
},
handleSelectionChange(selection) {
this.selectedIds = selection.map(item => item.objId);
this.multiple = !selection.length;
},
handleBatchStart() {
if (this.selectedIds.length === 0) {
this.$modal.msgWarning("请至少选择一条工单");
return;
}
this.batchStartForm = {
operator: this.$store.state.user.name || ''
};
this.batchStartDialogVisible = true;
},
confirmBatchStart() {
if (!this.batchStartForm.operator) {
this.$modal.msgWarning("请输入操作员");
return;
}
const data = {
objIds: this.selectedIds,
operator: this.batchStartForm.operator
};
batchStartProduction(data).then(response => {
this.$modal.msgSuccess("批量开始生产成功");
this.batchStartDialogVisible = false;
this.getList();
});
},
handleBatchUpdateQty() {
if (this.selectedIds.length === 0) {
this.$modal.msgWarning("请至少选择一条工单");
return;
}
this.batchUpdateForm = {
completeQty: 0,
defectQty: 0
};
this.batchUpdateQtyDialogVisible = true;
},
confirmBatchUpdateQty() {
const data = {
objIds: this.selectedIds,
completeQty: this.batchUpdateForm.completeQty,
defectQty: this.batchUpdateForm.defectQty
};
batchUpdateQuantity(data).then(response => {
this.$modal.msgSuccess("批量更新数量成功");
this.batchUpdateQtyDialogVisible = false;
this.getList();
});
},
handleBatchComplete() {
if (this.selectedIds.length === 0) {
this.$modal.msgWarning("请至少选择一条工单");
return;
}
this.batchCompleteForm = {
completeQty: 0,
defectQty: 0
};
this.batchCompleteDialogVisible = true;
},
confirmBatchComplete() {
this.$modal.confirm('确认批量完工提报?完工后工单状态将变为已完成').then(() => {
const data = {
objIds: this.selectedIds,
completeQty: this.batchCompleteForm.completeQty,
defectQty: this.batchCompleteForm.defectQty
};
batchCompleteProduction(data).then(response => {
this.$modal.msgSuccess("批量完工提报成功");
this.batchCompleteDialogVisible = false;
this.getList();
});
});
}
}
};

@ -9,6 +9,15 @@
<!-- @keyup.enter.native="handleQuery"-->
<!-- />-->
<!-- </el-form-item>-->
<el-form-item label="设备" prop="deviceCode">
<el-select v-model="queryParams.deviceCode" placeholder="请选择设备" clearable filterable @change="handleQuery">
<el-option
v-for="item in deviceLedgerList"
:key="item.deviceCode"
:label="item.deviceCode + ' - ' + item.deviceName"
:value="item.deviceCode" />
</el-select>
</el-form-item>
<el-form-item label="停机原因" prop="shutReasonId">
<el-select v-model="queryParams.shutReasonId" placeholder="请选择停机原因" clearable @change="handleQuery">
<el-option
@ -18,6 +27,17 @@
:value="item.shutReasonId" />
</el-select>
</el-form-item>
<el-form-item label="停机时间">
<el-date-picker
v-model="dateRange"
type="datetimerange"
range-separator="-"
start-placeholder="开始时间"
end-placeholder="结束时间"
value-format="yyyy-MM-dd HH:mm:ss"
@change="handleQuery">
</el-date-picker>
</el-form-item>
<!-- <el-form-item label="停机时间" prop="shutBeginTime">
<el-date-picker clearable
v-model="queryParams.shutBeginTime"
@ -79,6 +99,17 @@
<!-- v-hasPermi="['dms:shutDown:edit']"-->
<!-- >修改</el-button>-->
<!-- </el-col>-->
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-edit"
size="mini"
:disabled="multiple"
@click="handleBatchUpdate"
v-hasPermi="['dms:shutDown:edit']"
>批量维护</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
@ -225,11 +256,33 @@
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
<!-- 批量维护对话框 -->
<el-dialog title="批量维护停机原因" :visible.sync="batchUpdateOpen" width="400px" append-to-body>
<el-form ref="batchForm" :model="batchForm" :rules="batchRules" label-width="100px">
<el-form-item label="停机原因" prop="shutReasonId">
<el-select v-model="batchForm.shutReasonId" placeholder="请选择停机原因" style="width: 100%">
<el-option
v-for="item in shutReasonList"
:key="item.shutReasonId"
:label="item.shutReason"
:value="item.shutReasonId" />
</el-select>
</el-form-item>
<el-form-item>
<span style="color: #909399; font-size: 12px;">已选择 {{ ids.length }} 条记录</span>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitBatchUpdate"> </el-button>
<el-button @click="batchUpdateOpen = false"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { listShutDown, getShutDown, delShutDown, addShutDown, updateShutDown } from "@/api/dms/shutDown";
import { listShutDown, getShutDown, delShutDown, addShutDown, updateShutDown, batchUpdateShutReason } from "@/api/dms/shutDown";
import { selectDmsBaseShutReasonList } from '@/api/dms/shutReason'
import { getDeviceLedgerList } from '@/api/base/deviceLedger'
@ -239,7 +292,9 @@ export default {
return {
ledgerList:[],
ledgerMap:{},
deviceLedgerList: [],
shutReasonList:[],
dateRange: [],
//
loading: true,
//
@ -258,11 +313,14 @@ export default {
title: "",
//
open: false,
//
batchUpdateOpen: false,
//
queryParams: {
pageNum: 1,
pageSize: 10,
deviceId: null,
deviceCode: null,
shutReasonId: null,
shutBeginTime: null,
shutEndTime: null,
@ -271,11 +329,20 @@ export default {
},
//
form: {},
//
batchForm: {
shutReasonId: null
},
//
rules: {
shutReasonId: [
{ required: true, message: "请选择停机原因", trigger: "change" }
]
},
batchRules: {
shutReasonId: [
{ required: true, message: "请选择停机原因", trigger: "change" }
]
}
};
},
@ -299,6 +366,7 @@ export default {
getDevice(){
getDeviceLedgerList({}).then(response => {
this.ledgerList = response.data;
this.deviceLedgerList = response.data;
this.ledgerMap = Array.isArray(response.data)
? response.data.reduce((acc, cur) => {
acc[cur.deviceId] = cur;
@ -310,6 +378,11 @@ export default {
/** 查询停机记录列表 */
getList() {
this.loading = true;
this.queryParams.params = {};
if (this.dateRange != null && this.dateRange.length === 2) {
this.queryParams.params["beginTime"] = this.dateRange[0];
this.queryParams.params["endTime"] = this.dateRange[1];
}
listShutDown(this.queryParams).then(response => {
this.shutDownList = response.rows;
this.total = response.total;
@ -347,6 +420,7 @@ export default {
},
/** 重置按钮操作 */
resetQuery() {
this.dateRange = [];
this.resetForm("queryForm");
this.handleQuery();
},
@ -413,6 +487,33 @@ export default {
this.download('dms/shutDown/export', {
...this.queryParams
}, `shutDown_${new Date().getTime()}.xlsx`)
},
/** 批量维护按钮操作 */
handleBatchUpdate() {
if (this.ids.length === 0) {
this.$modal.msgWarning("请至少选择一条记录");
return;
}
this.batchForm = {
shutReasonId: null
};
this.batchUpdateOpen = true;
},
/** 批量维护提交 */
submitBatchUpdate() {
this.$refs["batchForm"].validate(valid => {
if (valid) {
const data = {
recordShutDownIds: this.ids,
shutReasonId: this.batchForm.shutReasonId
};
batchUpdateShutReason(data).then(response => {
this.$modal.msgSuccess("批量维护成功");
this.batchUpdateOpen = false;
this.getList();
});
}
});
}
}
};

Loading…
Cancel
Save