|
@@ -0,0 +1,488 @@
|
|
|
+<template>
|
|
|
+ <div class="tenant">
|
|
|
+ <div class="content">
|
|
|
+ <byTable
|
|
|
+ :source="sourceList.data"
|
|
|
+ :pagination="sourceList.pagination"
|
|
|
+ :config="config"
|
|
|
+ :loading="loading"
|
|
|
+ highlight-current-row
|
|
|
+ :selectConfig="selectConfig"
|
|
|
+ :table-events="{}"
|
|
|
+ :action-list="[]"
|
|
|
+ @get-list="getList"
|
|
|
+ >
|
|
|
+ </byTable>
|
|
|
+ </div>
|
|
|
+ <el-dialog
|
|
|
+ :title="'任务接收'"
|
|
|
+ v-model="dialogVisible"
|
|
|
+ width="700"
|
|
|
+ v-loading="loading"
|
|
|
+ destroy-on-close
|
|
|
+ >
|
|
|
+ <byForm
|
|
|
+ :formConfig="formConfig"
|
|
|
+ :formOption="formOption"
|
|
|
+ v-model="formData.data"
|
|
|
+ :rules="rules"
|
|
|
+ ref="byform"
|
|
|
+ >
|
|
|
+ <template #productRemark>
|
|
|
+ <div style="width: 100%">
|
|
|
+ {{ formData.data.productRemark }}
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ <template #file>
|
|
|
+ <div style="width: 100%">
|
|
|
+ <el-upload
|
|
|
+ v-model:fileList="formData.data.fileList"
|
|
|
+ action="https://winfaster.obs.cn-south-1.myhuaweicloud.com"
|
|
|
+ :data="uploadData"
|
|
|
+ multiple
|
|
|
+ :before-upload="uploadFile"
|
|
|
+ :on-preview="onPreviewFile"
|
|
|
+ >
|
|
|
+ <el-button>选择</el-button>
|
|
|
+ </el-upload>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ <template #fileTwo>
|
|
|
+ <div
|
|
|
+ style="width: 100%"
|
|
|
+ v-if="
|
|
|
+ formData.data.fileListTwo && formData.data.fileListTwo.length > 0
|
|
|
+ "
|
|
|
+ >
|
|
|
+ <span
|
|
|
+ v-for="item in formData.data.fileListTwo"
|
|
|
+ :key="item.id"
|
|
|
+ @click="onPreviewFile(item)"
|
|
|
+ style="margin-right: 10px; cursor: pointer; color: #409eff"
|
|
|
+ >
|
|
|
+ {{ item.name }}
|
|
|
+ </span>
|
|
|
+ </div>
|
|
|
+ <div v-else>无</div>
|
|
|
+ </template>
|
|
|
+ <template #fileThree>
|
|
|
+ <div
|
|
|
+ style="width: 100%"
|
|
|
+ v-if="
|
|
|
+ formData.data.fileListThree &&
|
|
|
+ formData.data.fileListThree.length > 0
|
|
|
+ "
|
|
|
+ >
|
|
|
+ <span
|
|
|
+ v-for="item in formData.data.fileListThree"
|
|
|
+ :key="item.id"
|
|
|
+ @click="onPreviewFile(item)"
|
|
|
+ style="margin-right: 10px; cursor: pointer; color: #409eff"
|
|
|
+ >
|
|
|
+ {{ item.name }}
|
|
|
+ </span>
|
|
|
+ </div>
|
|
|
+ <div v-else>无</div>
|
|
|
+ </template>
|
|
|
+ </byForm>
|
|
|
+ <template #footer>
|
|
|
+ <el-button @click="dialogVisible = false" size="large">取 消</el-button>
|
|
|
+ <el-button
|
|
|
+ type="primary"
|
|
|
+ @click="submitForm(true)"
|
|
|
+ size="large"
|
|
|
+ :loading="submitLoading"
|
|
|
+ >
|
|
|
+ 确认接收
|
|
|
+ </el-button>
|
|
|
+ <!-- <el-button
|
|
|
+ type="danger"
|
|
|
+ @click="submitForm()"
|
|
|
+ size="large"
|
|
|
+ :loading="submitLoading"
|
|
|
+ v-if="otherBtn"
|
|
|
+ >
|
|
|
+ 退回前道工序
|
|
|
+ </el-button> -->
|
|
|
+ </template>
|
|
|
+ </el-dialog>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script setup>
|
|
|
+import { ElMessage, ElMessageBox } from "element-plus";
|
|
|
+import byTable from "@/components/byTable/index";
|
|
|
+import byForm from "@/components/byForm/index";
|
|
|
+const { proxy } = getCurrentInstance();
|
|
|
+const loading = ref(false);
|
|
|
+const submitLoading = ref(false);
|
|
|
+const sourceList = ref({
|
|
|
+ data: [],
|
|
|
+ pagination: {
|
|
|
+ total: 3,
|
|
|
+ pageNum: 1,
|
|
|
+ pageSize: 10,
|
|
|
+ keyword: "",
|
|
|
+ },
|
|
|
+});
|
|
|
+const dialogVisible = ref(false);
|
|
|
+const modalType = ref("add");
|
|
|
+const rules = ref({
|
|
|
+ workOrderId: [{ required: true, message: "请选择工单", trigger: "change" }],
|
|
|
+ startDate: [
|
|
|
+ { required: true, message: "请选择计划开始时间", trigger: "change" },
|
|
|
+ ],
|
|
|
+ stopDate: [
|
|
|
+ { required: true, message: "请选择计划结束时间", trigger: "change" },
|
|
|
+ ],
|
|
|
+ quantity: [{ required: true, message: "请输入计划数量", trigger: "blur" }],
|
|
|
+});
|
|
|
+const workOrderData = ref([]);
|
|
|
+const workOrderDataOne = ref([]);
|
|
|
+
|
|
|
+const statusData = ref([
|
|
|
+ {
|
|
|
+ label: "未开始",
|
|
|
+ value: "0",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "进行中",
|
|
|
+ value: "1",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "完成",
|
|
|
+ value: "2",
|
|
|
+ },
|
|
|
+]);
|
|
|
+
|
|
|
+const selectConfig = reactive([]);
|
|
|
+const config = computed(() => {
|
|
|
+ return [
|
|
|
+ {
|
|
|
+ attrs: {
|
|
|
+ label: "产品名称",
|
|
|
+ prop: "productName",
|
|
|
+ },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ attrs: {
|
|
|
+ label: "规格型号",
|
|
|
+ prop: "productSpec",
|
|
|
+ },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ attrs: {
|
|
|
+ label: "产品SN",
|
|
|
+ prop: "productSn",
|
|
|
+ },
|
|
|
+ },
|
|
|
+
|
|
|
+ {
|
|
|
+ attrs: {
|
|
|
+ label: "当前工序",
|
|
|
+ prop: "productionProcessesName",
|
|
|
+ },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ attrs: {
|
|
|
+ label: "前道工序",
|
|
|
+ prop: "previousProcessesName",
|
|
|
+ },
|
|
|
+ },
|
|
|
+
|
|
|
+ {
|
|
|
+ attrs: {
|
|
|
+ label: "操作",
|
|
|
+ width: "80",
|
|
|
+ align: "center",
|
|
|
+ },
|
|
|
+ renderHTML(row) {
|
|
|
+ return [
|
|
|
+ {
|
|
|
+ attrs: {
|
|
|
+ label: "查看",
|
|
|
+ type: "primary",
|
|
|
+ text: true,
|
|
|
+ },
|
|
|
+ el: "button",
|
|
|
+ click() {
|
|
|
+ getDtl(row);
|
|
|
+ },
|
|
|
+ },
|
|
|
+ ];
|
|
|
+ },
|
|
|
+ },
|
|
|
+ ];
|
|
|
+});
|
|
|
+const formData = reactive({
|
|
|
+ data: {},
|
|
|
+});
|
|
|
+const formOption = reactive({
|
|
|
+ inline: true,
|
|
|
+ labelWidth: 100,
|
|
|
+ itemWidth: 100,
|
|
|
+ rules: [],
|
|
|
+});
|
|
|
+const byform = ref(null);
|
|
|
+const formConfig = computed(() => {
|
|
|
+ return [
|
|
|
+ {
|
|
|
+ type: "input",
|
|
|
+ itemType: "text",
|
|
|
+ prop: "productName",
|
|
|
+ label: "产品名称",
|
|
|
+ disabled: true,
|
|
|
+ style: {
|
|
|
+ width: "50%",
|
|
|
+ },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: "input",
|
|
|
+ itemType: "text",
|
|
|
+ prop: "productSpec",
|
|
|
+ label: "规格型号",
|
|
|
+ disabled: true,
|
|
|
+ style: {
|
|
|
+ width: "50%",
|
|
|
+ },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: "input",
|
|
|
+ itemType: "text",
|
|
|
+ prop: "productSn",
|
|
|
+ label: "产品SN",
|
|
|
+ disabled: true,
|
|
|
+ style: {
|
|
|
+ width: "50%",
|
|
|
+ },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: "slot",
|
|
|
+ slotName: "productRemark",
|
|
|
+ label: "产品备注",
|
|
|
+ disabled: true,
|
|
|
+ style: {
|
|
|
+ width: "50%",
|
|
|
+ },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: "input",
|
|
|
+ itemType: "text",
|
|
|
+ prop: "productionProcessesName",
|
|
|
+ label: "当前工序",
|
|
|
+ disabled: true,
|
|
|
+ style: {
|
|
|
+ width: "50%",
|
|
|
+ },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: "slot",
|
|
|
+ slotName: "fileTwo",
|
|
|
+ label: "生产工序资料",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: "slot",
|
|
|
+ slotName: "fileThree",
|
|
|
+ label: "工单附件",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: "slot",
|
|
|
+ slotName: "file",
|
|
|
+ label: "完工拍摄",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: "input",
|
|
|
+ itemType: "text",
|
|
|
+ prop: "previousProcessesName",
|
|
|
+ label: "前道工序",
|
|
|
+ disabled: true,
|
|
|
+ style: {
|
|
|
+ width: "50%",
|
|
|
+ },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: "input",
|
|
|
+ itemType: "text",
|
|
|
+ prop: "circulationUserName",
|
|
|
+ label: "流转人",
|
|
|
+ disabled: true,
|
|
|
+ style: {
|
|
|
+ width: "50%",
|
|
|
+ },
|
|
|
+ },
|
|
|
+ ];
|
|
|
+});
|
|
|
+const getList = async (req) => {
|
|
|
+ sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
|
|
|
+ loading.value = true;
|
|
|
+ proxy
|
|
|
+ .post("/productionTaskDetail/receivePage", sourceList.value.pagination)
|
|
|
+ .then((message) => {
|
|
|
+ sourceList.value.data = message.rows;
|
|
|
+ sourceList.value.pagination.total = message.total;
|
|
|
+ setTimeout(() => {
|
|
|
+ loading.value = false;
|
|
|
+ }, 200);
|
|
|
+ });
|
|
|
+};
|
|
|
+const submitApi = () => {
|
|
|
+ proxy.post("/productionTaskDetail/receive", { id: formData.data.id }).then(
|
|
|
+ (res) => {
|
|
|
+ ElMessage({
|
|
|
+ message: "操作成功",
|
|
|
+ type: "success",
|
|
|
+ });
|
|
|
+ dialogVisible.value = false;
|
|
|
+ submitLoading.value = false;
|
|
|
+ getList();
|
|
|
+ },
|
|
|
+ (err) => {
|
|
|
+ submitLoading.value = false;
|
|
|
+ return ElMessage({
|
|
|
+ message: err.message,
|
|
|
+ type: "info",
|
|
|
+ });
|
|
|
+ }
|
|
|
+ );
|
|
|
+};
|
|
|
+const submitForm = (flag) => {
|
|
|
+ if (flag) {
|
|
|
+ proxy
|
|
|
+ .post("/productionTaskDetail/haveTaskCount", {
|
|
|
+ productionProcessesId: formData.data.productionProcessesId,
|
|
|
+ })
|
|
|
+ .then((res) => {
|
|
|
+ if (res && Number(res) > 0) {
|
|
|
+ ElMessageBox.confirm(
|
|
|
+ `你当前还有进行中的任务尚未提交,确认接收新任务吗?`,
|
|
|
+ "提示",
|
|
|
+ {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning",
|
|
|
+ }
|
|
|
+ ).then(() => {
|
|
|
+ ElMessageBox.confirm(
|
|
|
+ `你当前还有进行中的任务尚未提交,确认接收新任务吗?`,
|
|
|
+ "提示",
|
|
|
+ {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning",
|
|
|
+ }
|
|
|
+ ).then(() => {
|
|
|
+ submitApi();
|
|
|
+ });
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ submitApi();
|
|
|
+ }
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ proxy
|
|
|
+ .post("/productionTaskDetail/rejection", { id: formData.data.id })
|
|
|
+ .then(
|
|
|
+ (res) => {
|
|
|
+ ElMessage({
|
|
|
+ message: "退回成功",
|
|
|
+ type: "success",
|
|
|
+ });
|
|
|
+ dialogVisible.value = false;
|
|
|
+ submitLoading.value = false;
|
|
|
+ getList();
|
|
|
+ },
|
|
|
+ (err) => {
|
|
|
+ submitLoading.value = false;
|
|
|
+ return ElMessage({
|
|
|
+ message: err.message,
|
|
|
+ type: "info",
|
|
|
+ });
|
|
|
+ }
|
|
|
+ );
|
|
|
+ }
|
|
|
+};
|
|
|
+const submitType = ref("");
|
|
|
+const otherBtn = ref(true);
|
|
|
+const getDtl = (row) => {
|
|
|
+ if (!row.previousProcessesId || row.previousProcessesId == -1) {
|
|
|
+ otherBtn.value = false;
|
|
|
+ } else {
|
|
|
+ otherBtn.value = true;
|
|
|
+ }
|
|
|
+ formOption.disabled = true;
|
|
|
+ formData.data = { ...row };
|
|
|
+ proxy.post("/productionTaskDetail/detail", { id: row.id }).then((res) => {
|
|
|
+ if (
|
|
|
+ res.productionTaskDetailRecordList &&
|
|
|
+ res.productionTaskDetailRecordList.length > 0
|
|
|
+ ) {
|
|
|
+ let id = res.previousProcessesRecordId;
|
|
|
+ proxy.post("/fileInfo/getList", { businessIdList: [id] }).then((res) => {
|
|
|
+ if (res[id] && res[id].length > 0) {
|
|
|
+ formData.data.fileList = res[id].map((item) => {
|
|
|
+ return {
|
|
|
+ raw: item,
|
|
|
+ name: item.fileName,
|
|
|
+ url: item.fileUrl,
|
|
|
+ };
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ proxy
|
|
|
+ .post("/fileInfo/getList", {
|
|
|
+ businessIdList: [res.productionProcessesId],
|
|
|
+ })
|
|
|
+ .then((resOne) => {
|
|
|
+ if (
|
|
|
+ resOne[res.productionProcessesId] &&
|
|
|
+ resOne[res.productionProcessesId].length > 0
|
|
|
+ ) {
|
|
|
+ formData.data.fileListTwo = resOne[res.productionProcessesId].map(
|
|
|
+ (item) => {
|
|
|
+ return {
|
|
|
+ raw: item,
|
|
|
+ name: item.fileName,
|
|
|
+ url: item.fileUrl,
|
|
|
+ };
|
|
|
+ }
|
|
|
+ );
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ proxy
|
|
|
+ .post("/fileInfo/getList", {
|
|
|
+ businessIdList: [res.workOrderId],
|
|
|
+ fileType: 1,
|
|
|
+ })
|
|
|
+ .then((resOne) => {
|
|
|
+ if (resOne[res.workOrderId] && resOne[res.workOrderId].length > 0) {
|
|
|
+ formData.data.fileListThree = resOne[res.workOrderId].map((item) => {
|
|
|
+ return {
|
|
|
+ raw: item,
|
|
|
+ name: item.fileName,
|
|
|
+ url: item.fileUrl,
|
|
|
+ };
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ });
|
|
|
+
|
|
|
+ dialogVisible.value = true;
|
|
|
+};
|
|
|
+
|
|
|
+getList();
|
|
|
+
|
|
|
+const onPreviewFile = (file) => {
|
|
|
+ window.open(file.raw.fileUrl, "_blank");
|
|
|
+};
|
|
|
+</script>
|
|
|
+
|
|
|
+<style lang="scss" scoped>
|
|
|
+.tenant {
|
|
|
+ padding: 20px;
|
|
|
+}
|
|
|
+::v-deep(.el-input-number .el-input__inner) {
|
|
|
+ text-align: left;
|
|
|
+}
|
|
|
+</style>
|