|
@@ -16,10 +16,14 @@
|
|
|
text: '打印生产面单',
|
|
|
action: () => clickSelectPrint(),
|
|
|
},
|
|
|
+ {
|
|
|
+ text: '合并工单',
|
|
|
+ disabled: selectData.length < 2,
|
|
|
+ action: () => clickMerge(),
|
|
|
+ },
|
|
|
]"
|
|
|
@get-list="getList"
|
|
|
- @clickReset="clickReset"
|
|
|
- @changeRadioGroup="changeRadioGroup">
|
|
|
+ @clickReset="clickReset">
|
|
|
<template #code="{ item }">
|
|
|
<div>
|
|
|
<a style="color: #409eff; cursor: pointer; word-break: break-all" @click="clickCode(item)">{{ item.code }}</a>
|
|
@@ -62,12 +66,37 @@
|
|
|
|
|
|
<script setup>
|
|
|
import byTable from "/src/components/byTable/index";
|
|
|
-import { getNearDays } from "/src/utils/util";
|
|
|
import QRCode from "qrcodejs2-fix";
|
|
|
-import { ElMessage } from "element-plus";
|
|
|
+import { ElMessage, ElMessageBox } from "element-plus";
|
|
|
import CycleBarcode from "/src/components/CycleBarcode";
|
|
|
|
|
|
const { proxy } = getCurrentInstance();
|
|
|
+const statusList = ref([
|
|
|
+ {
|
|
|
+ dictKey: 0,
|
|
|
+ dictValue: "待投产",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ dictKey: 1,
|
|
|
+ dictValue: "已扫描",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ dictKey: 2,
|
|
|
+ dictValue: "生产中",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ dictKey: 3,
|
|
|
+ dictValue: "生产完成",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ dictKey: 4,
|
|
|
+ dictValue: "生产异常",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ dictKey: 5,
|
|
|
+ dictValue: "重新排单",
|
|
|
+ },
|
|
|
+]);
|
|
|
const sourceList = ref({
|
|
|
data: [],
|
|
|
pagination: {
|
|
@@ -81,9 +110,7 @@ const sourceList = ref({
|
|
|
bomSpecCode: "",
|
|
|
bomSpecName: "",
|
|
|
productionWorkOrderCode: "",
|
|
|
- beginTime: "",
|
|
|
- endTime: "",
|
|
|
- type: 3,
|
|
|
+ status: [0, 4],
|
|
|
},
|
|
|
});
|
|
|
const loading = ref(false);
|
|
@@ -125,28 +152,11 @@ const searchConfig = computed(() => {
|
|
|
label: "工单号",
|
|
|
},
|
|
|
{
|
|
|
- type: "radio-group",
|
|
|
- prop: "type",
|
|
|
- label: "交期",
|
|
|
- data: [
|
|
|
- {
|
|
|
- dictKey: 1,
|
|
|
- dictValue: "近3天",
|
|
|
- },
|
|
|
- {
|
|
|
- dictKey: 3,
|
|
|
- dictValue: "近7天",
|
|
|
- },
|
|
|
- {
|
|
|
- dictKey: 15,
|
|
|
- dictValue: "近31天",
|
|
|
- },
|
|
|
- ],
|
|
|
- },
|
|
|
- {
|
|
|
- type: "date",
|
|
|
- propList: ["beginTime", "endTime"],
|
|
|
- label: "日期",
|
|
|
+ type: "select",
|
|
|
+ prop: "status",
|
|
|
+ label: "生产状态",
|
|
|
+ data: statusList.value,
|
|
|
+ multiple: true,
|
|
|
},
|
|
|
];
|
|
|
});
|
|
@@ -214,9 +224,7 @@ const config = computed(() => {
|
|
|
width: 80,
|
|
|
},
|
|
|
render(val) {
|
|
|
- if (val == 0) {
|
|
|
- return "待投产";
|
|
|
- }
|
|
|
+ return proxy.dictKeyValue(val, statusList.value);
|
|
|
},
|
|
|
},
|
|
|
{
|
|
@@ -253,14 +261,17 @@ const config = computed(() => {
|
|
|
},
|
|
|
];
|
|
|
});
|
|
|
+const selectData = ref([]);
|
|
|
+const selectRow = (data) => {
|
|
|
+ selectData.value = data;
|
|
|
+};
|
|
|
const getList = async (req, status) => {
|
|
|
+ selectData.value = [];
|
|
|
if (status) {
|
|
|
sourceList.value.pagination = {
|
|
|
pageNum: sourceList.value.pagination.pageNum,
|
|
|
pageSize: sourceList.value.pagination.pageSize,
|
|
|
- type: 3,
|
|
|
- beginTime: getNearDays(3).beginTime,
|
|
|
- endTime: getNearDays(3).endTime,
|
|
|
+ status: [0, 4],
|
|
|
};
|
|
|
} else {
|
|
|
sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
|
|
@@ -269,10 +280,17 @@ const getList = async (req, status) => {
|
|
|
proxy.post("/productionWorkOrder/page", sourceList.value.pagination).then((res) => {
|
|
|
if (res.rows && res.rows.length > 0) {
|
|
|
sourceList.value.data = res.rows.map((item) => {
|
|
|
- return {
|
|
|
- ...item,
|
|
|
- isCheck: true,
|
|
|
- };
|
|
|
+ if (item.status == 0 && !item.type) {
|
|
|
+ return {
|
|
|
+ ...item,
|
|
|
+ isCheck: true,
|
|
|
+ };
|
|
|
+ } else {
|
|
|
+ return {
|
|
|
+ ...item,
|
|
|
+ isCheck: false,
|
|
|
+ };
|
|
|
+ }
|
|
|
});
|
|
|
} else {
|
|
|
sourceList.value.data = [];
|
|
@@ -283,13 +301,10 @@ const getList = async (req, status) => {
|
|
|
}, 200);
|
|
|
});
|
|
|
};
|
|
|
-getList({ beginTime: getNearDays(3).beginTime, endTime: getNearDays(3).endTime });
|
|
|
+getList();
|
|
|
const clickReset = () => {
|
|
|
getList("", true);
|
|
|
};
|
|
|
-const changeRadioGroup = () => {
|
|
|
- getList({ beginTime: getNearDays(sourceList.value.pagination.type).beginTime, endTime: getNearDays(sourceList.value.pagination.type).endTime });
|
|
|
-};
|
|
|
const clickCode = (row) => {
|
|
|
proxy.$router.replace({
|
|
|
path: "/addOrder",
|
|
@@ -307,10 +322,6 @@ const printObj = ref({
|
|
|
extraCss: "https://cdn.bootcdn.net/ajax/libs/animate.css/4.1.1/animate.compat.css, https://cdn.bootcdn.net/ajax/libs/hover.css/2.3.1/css/hover-min.css",
|
|
|
extraHead: '<meta http-equiv="Content-Language"content="zh-cn"/>',
|
|
|
});
|
|
|
-const selectData = ref([]);
|
|
|
-const selectRow = (data) => {
|
|
|
- selectData.value = data;
|
|
|
-};
|
|
|
const QRcodeList = ref([]);
|
|
|
const clickPrint = (list) => {
|
|
|
QRcodeList.value = list;
|
|
@@ -340,6 +351,48 @@ const clickSelectPrint = () => {
|
|
|
return ElMessage("请选择需要打印的工单");
|
|
|
}
|
|
|
};
|
|
|
+const clickMerge = () => {
|
|
|
+ ElMessageBox.confirm("你是否确认此操作", "提示", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning",
|
|
|
+ })
|
|
|
+ .then(() => {
|
|
|
+ proxy
|
|
|
+ .post(
|
|
|
+ "/productionWorkOrder/combined",
|
|
|
+ selectData.value.map((item) => item.id)
|
|
|
+ )
|
|
|
+ .then(() => {
|
|
|
+ ElMessage({ message: "操作成功", type: "success" });
|
|
|
+ getList();
|
|
|
+ });
|
|
|
+ })
|
|
|
+ .catch(() => {});
|
|
|
+};
|
|
|
+watch(selectData, (newVal) => {
|
|
|
+ if (newVal && newVal.length > 0) {
|
|
|
+ sourceList.value.data.forEach((x) => {
|
|
|
+ if (x.status == 0 && !x.type) {
|
|
|
+ if (x.bomSpecCode === newVal[0].bomSpecCode && x.skuSpecCode === newVal[0].skuSpecCode) {
|
|
|
+ x.isCheck = true;
|
|
|
+ } else {
|
|
|
+ x.isCheck = false;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ x.isCheck = false;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ sourceList.value.data.forEach((x) => {
|
|
|
+ if (x.status == 0 && !x.type) {
|
|
|
+ x.isCheck = true;
|
|
|
+ } else {
|
|
|
+ x.isCheck = false;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+});
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
@@ -375,4 +428,7 @@ const clickSelectPrint = () => {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+:deep(.el-table__header-wrapper .el-checkbox) {
|
|
|
+ display: none;
|
|
|
+}
|
|
|
</style>
|