|
@@ -0,0 +1,260 @@
|
|
|
+<template>
|
|
|
+ <el-drawer
|
|
|
+ v-model="drawerVisible"
|
|
|
+ :close-on-click-modal="false"
|
|
|
+ :show-close="false"
|
|
|
+ :with-header="false"
|
|
|
+ destroy-on-close
|
|
|
+ direction="rtl"
|
|
|
+ size="990px"
|
|
|
+ >
|
|
|
+ <template #default>
|
|
|
+ <el-scrollbar>
|
|
|
+ <div id="drawContent">
|
|
|
+ <el-form
|
|
|
+ ref="formRef"
|
|
|
+ :model="formLabelAlign"
|
|
|
+ :rules="rules"
|
|
|
+ label-position="top"
|
|
|
+ label-width="auto"
|
|
|
+ >
|
|
|
+ <el-form-item label="基本信息">
|
|
|
+ <div class="base-info">
|
|
|
+ <div class="info-item">
|
|
|
+ <div class="item-label">产品名称</div>
|
|
|
+ <div class="item-value">{{ infoData?.materialName }}</div>
|
|
|
+ </div>
|
|
|
+ <div class="info-item">
|
|
|
+ <div class="item-label">产品型号</div>
|
|
|
+ <div class="item-value">{{ infoData?.spec }}</div>
|
|
|
+ </div>
|
|
|
+ <div class="info-item">
|
|
|
+ <div class="item-label">阶段</div>
|
|
|
+ <div class="item-value">
|
|
|
+ {{
|
|
|
+ dictStroe.getLableByValue(
|
|
|
+ "stage",
|
|
|
+ infoData?.stageDictValue
|
|
|
+ )
|
|
|
+ }}
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="info-item">
|
|
|
+ <div class="item-label">生产数量</div>
|
|
|
+ <div class="item-value">{{ infoData?.planNum }}</div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </el-form-item>
|
|
|
+
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="24">
|
|
|
+ <el-form-item
|
|
|
+ :label="`反馈数量[${formLabelAlign.seqNoList.length}]`"
|
|
|
+ prop="seqNoList"
|
|
|
+ >
|
|
|
+ <el-select
|
|
|
+ v-model="formLabelAlign.seqNoList"
|
|
|
+ multiple
|
|
|
+ placeholder="请选择"
|
|
|
+ value-key="value"
|
|
|
+ @change="selectProcessWorkSeqChange"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="item in infoData?.processWorkSeq"
|
|
|
+ :key="item"
|
|
|
+ :label="item"
|
|
|
+ :value="item"
|
|
|
+ />
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+<!-- <el-row>
|
|
|
+ <el-col :span="24">
|
|
|
+ <el-form-item label="责任/经办者" prop="personResponsible">
|
|
|
+ <el-select
|
|
|
+ v-model="formLabelAlign.personResponsible"
|
|
|
+ filterable
|
|
|
+ placeholder="请选择"
|
|
|
+ value-key="id"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="item in dictStroe.allUsers"
|
|
|
+ :key="item.id"
|
|
|
+ :label="item.userName"
|
|
|
+ :value="item.userName"
|
|
|
+ />
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>-->
|
|
|
+
|
|
|
+ <el-form-item label="备注" prop="remark">
|
|
|
+ <el-input
|
|
|
+ v-model="formLabelAlign.remark"
|
|
|
+ :rows="3"
|
|
|
+ type="textarea"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ </div>
|
|
|
+ <div class="bottom-btns">
|
|
|
+ <el-button class="cancelBtn" @click="cancelClick">取消</el-button>
|
|
|
+ <el-button class="sureBtn" type="primary" @click="confirmClick"
|
|
|
+ >反馈
|
|
|
+ </el-button>
|
|
|
+ </div>
|
|
|
+ </el-scrollbar>
|
|
|
+ </template>
|
|
|
+ <template #footer></template>
|
|
|
+ </el-drawer>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script lang="ts" setup>
|
|
|
+import {
|
|
|
+ addProblemReport,
|
|
|
+ breakReportInfoById,
|
|
|
+} from "@/api/process/reportBreak";
|
|
|
+import { useProcessStore } from "@/store/modules/processView";
|
|
|
+import { useDictionaryStore } from "@/store/modules/dictionary";
|
|
|
+import { getProcessInfo } from "@/api/prosteps";
|
|
|
+
|
|
|
+const processStore = useProcessStore();
|
|
|
+const dictStroe = useDictionaryStore();
|
|
|
+
|
|
|
+const drawerVisible = ref(false);
|
|
|
+
|
|
|
+const infoData = ref<any>({});
|
|
|
+
|
|
|
+const formRef = ref<InstanceType<typeof ElForm>>();
|
|
|
+const formLabelAlign = reactive({
|
|
|
+ seqNoList: [],
|
|
|
+ reasonType: "",
|
|
|
+ type: 1,
|
|
|
+ reasonList: [],
|
|
|
+ processesList: [],
|
|
|
+ firstInspection: 0,
|
|
|
+ personResponsible: "",
|
|
|
+ remark: "",
|
|
|
+});
|
|
|
+const rules = reactive({
|
|
|
+ remark: [{ required: true, message: "请输入反馈内容 ", trigger: "blur" }],
|
|
|
+ seqNoList: [{ required: true, message: "请选择 ", trigger: "blur" }],
|
|
|
+ personResponsible: [{ required: true, message: "请选择责任人", trigger: "blur" }],
|
|
|
+});
|
|
|
+
|
|
|
+const openReportProblemDrawer = () => {
|
|
|
+ getProcessInfo(processStore.scanInfo.id).then((res) => {
|
|
|
+ processStore.scanInfo.currentState = res.data.currentState;
|
|
|
+ if (res.data.currentState !== "start") {
|
|
|
+ ElMessage.error("当前工单状态不允许报故");
|
|
|
+ return;
|
|
|
+ } else {
|
|
|
+ drawerVisible.value = true;
|
|
|
+ breakReportInfoById(processStore.scanInfo.id).then((res) => {
|
|
|
+ infoData.value = res.data;
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+};
|
|
|
+
|
|
|
+
|
|
|
+const cancelClick = () => {
|
|
|
+ drawerVisible.value = false;
|
|
|
+};
|
|
|
+
|
|
|
+const confirmClick = () => {
|
|
|
+ formRef.value &&
|
|
|
+ formRef.value.validate((valid: boolean) => {
|
|
|
+ if (valid) {
|
|
|
+ let params = {
|
|
|
+ processId: processStore.scanInfo.id,
|
|
|
+ ...formLabelAlign,
|
|
|
+ };
|
|
|
+ addProblemReport(params).then(() => {
|
|
|
+ ElMessage.success("反馈成功");
|
|
|
+ drawerVisible.value = false;
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ });
|
|
|
+};
|
|
|
+
|
|
|
+window.addEventListener("message", (event) => {
|
|
|
+ const data = JSON.parse(event.data);
|
|
|
+ if (data.fullUrl && data.messageKey && data.messageKey === "report_bad") {
|
|
|
+ formLabelAlign.fileList.push(data.fullUrl);
|
|
|
+ }
|
|
|
+});
|
|
|
+
|
|
|
+defineExpose({
|
|
|
+ openReportProblemDrawer,
|
|
|
+});
|
|
|
+</script>
|
|
|
+
|
|
|
+<style lang="scss" scoped>
|
|
|
+#drawContent {
|
|
|
+ width: 100%;
|
|
|
+ //:deep(.el-form--large.el-form--label-top .el-form-item .el-form-item__label) {
|
|
|
+ // font-weight: 500;
|
|
|
+ // font-size: 22px;
|
|
|
+ // color: rgba(0, 0, 0, 0.9);
|
|
|
+ // text-align: left;
|
|
|
+ //}
|
|
|
+}
|
|
|
+
|
|
|
+.base-info {
|
|
|
+ width: 100%;
|
|
|
+ background: #f1f3f5;
|
|
|
+ border-radius: 16px 16px 16px 16px;
|
|
|
+ padding: 0 30px;
|
|
|
+
|
|
|
+ .info-item {
|
|
|
+ display: flex;
|
|
|
+ justify-content: space-between;
|
|
|
+ align-items: center;
|
|
|
+ height: 40px;
|
|
|
+
|
|
|
+ .item-label {
|
|
|
+ font-size: 18px;
|
|
|
+ color: rgba(0, 0, 0, 0.6);
|
|
|
+ }
|
|
|
+
|
|
|
+ .item-value {
|
|
|
+ font-weight: 500;
|
|
|
+ font-size: 18px;
|
|
|
+ color: rgba(0, 0, 0, 0.9);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .info-item:not(:last-child) {
|
|
|
+ border-bottom: 1px solid rgba(0, 0, 0, 0.2);
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+.bottom-btns {
|
|
|
+ display: flex;
|
|
|
+ justify-content: center;
|
|
|
+ //margin-top: 20px;
|
|
|
+ //margin-bottom: 20px;
|
|
|
+
|
|
|
+ .button {
|
|
|
+ margin-right: 20px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .cancelBtn {
|
|
|
+ width: 292px;
|
|
|
+ height: 40px;
|
|
|
+ background: rgba(0, 0, 0, 0.06);
|
|
|
+ border-radius: 76px 76px 76px 76px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .sureBtn {
|
|
|
+ width: 292px;
|
|
|
+ height: 40px;
|
|
|
+ background: #0a59f7;
|
|
|
+ border-radius: 76px 76px 76px 76px;
|
|
|
+ }
|
|
|
+}
|
|
|
+</style>
|