Explorar el Código

Merge branch 'js_dev' of http://113.44.0.55:8014/jiaxiaoqiang/JG-CLIENT-TEMP into js_dev

lupeng hace 1 semana
padre
commit
78e2fff504

La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 9 - 0
src/assets/icons/check.svg


+ 9 - 0
src/router/modules/process.ts

@@ -170,6 +170,15 @@ export default {
       },
     },
     {
+      path: "inspectCommon",
+      component: () => import("@/views/pro-operation/inspectCommon/index.vue"),
+      name: "inspectCommon",
+      meta: {
+        title: "自检/互检",
+        back: true,
+      },
+    },
+    {
       path: "appoint",
       component: () => import("@/views/pro-operation/appoint-out/index.vue"),
       name: "appoint-out",

+ 4 - 4
src/views/pro-operation/inspect/index.vue

@@ -309,18 +309,18 @@ const options = [
     value: "inspection",
     label: "巡检",
   },
-  {
+  /*{
     value: "self_check",
     label: "自检",
-  },
+  },*/
   {
     value: "special_inspection",
     label: "专检",
   },
-  {
+/*  {
     value: "mutual_inspection",
     label: "互检",
-  },
+  },*/
 ];
 const inputValue = ref("");
 const handleSubmit = () => {

+ 170 - 0
src/views/pro-operation/inspectCommon/components/checkForm.vue

@@ -0,0 +1,170 @@
+<template>
+  <el-form ref="formRef" :model="modelValue" :rules="rules" label-width="120px">
+    <!-- <el-form-item label="检验项名称" prop="checkName">
+      <el-input v-model="modelValue.checkName" />
+    </el-form-item> -->
+    <el-form-item label="检验名称" prop="checkName">
+      <el-input v-model="modelValue.checkName" :disabled="true" />
+      <!-- <el-select v-model="modelValue.checkContent" filterable>
+        <el-option
+          v-for="(item, index) in options"
+          :key="index"
+          :label="item.label"
+          :value="item.label"
+        />
+      </el-select> -->
+    </el-form-item>
+    <el-form-item label="检验编码" prop="checkCode">
+      <div class="flex" style="justify-content: space-between; width: 100%">
+        <el-input v-model="modelValue.checkCode" :disabled="true" />
+        <el-button
+          style="margin-left: 10px"
+          class="sureBtn"
+          type="primary"
+          @click="openPop"
+          >选 择
+        </el-button>
+      </div>
+
+      <!-- <el-select v-model="modelValue.checkContent" filterable>
+        <el-option
+          v-for="(item, index) in options"
+          :key="index"
+          :label="item.label"
+          :value="item.label"
+        />
+      </el-select> -->
+    </el-form-item>
+
+    <el-form-item label="检验内容" prop="checkContent">
+      <el-input
+        v-model="modelValue.checkContent"
+        :disabled="true"
+        type="textarea"
+      />
+      <!-- <el-select v-model="modelValue.checkContent" filterable>
+        <el-option
+          v-for="(item, index) in options"
+          :key="index"
+          :label="item.label"
+          :value="item.label"
+        />
+      </el-select> -->
+    </el-form-item>
+    <el-form-item label="结果" prop="result">
+      <el-select v-model="modelValue.result">
+        <el-option label="合格" value="1" />
+        <el-option label="不合格" value="2" />
+      </el-select>
+    </el-form-item>
+    <el-form-item label="流转卡号" prop="seqNoList">
+      <el-select v-model="modelValue.seqNoList" multiple :disabled="true">
+        <el-option
+          v-for="(item, index) in SeqArray"
+          :key="index"
+          :label="item"
+          :value="item"
+        />
+      </el-select>
+    </el-form-item>
+    <el-form-item label="备注" prop="remark">
+      <el-input v-model="modelValue.remark" type="textarea" />
+    </el-form-item>
+    <!--    <el-form-item label="上传附件">-->
+    <!--      <FilesUpload v-model:src="modelValue.filePath" ref="uploadRef" />-->
+    <!--    </el-form-item>-->
+  </el-form>
+  <Pop v-model="showPop" v-if="showPop" />
+</template>
+<script setup>
+import { useProcessStore } from "@/store/modules/processView";
+
+import Pop from "./pop.vue";
+const processStore = useProcessStore();
+const checkListData = ref([]);
+const showPop = ref(false);
+const openPop = () => {
+  showPop.value = true;
+};
+const getCheckOpList = async () => {};
+const rules = reactive({
+  checkContent: [{ required: true,message:"检验项内容为空", trigger: "blur" }],
+  checkName: [{ required: true,message:"检验项名称为空", trigger: "blur" }],
+  checkCode: [{ required: true,message:"检验项编码为空", trigger: "blur" }],
+  result: [{ required: true,message:"请选择", trigger: "blur" }],
+  seqNoList: [{ required: true,message:"流转卡号为空", trigger: "blur" }],
+});
+
+const uploadRef = ref(null);
+const setFileList = (value) => {
+  uploadRef.value.resetFileList(value);
+};
+
+const formRef = ref(null);
+const props = defineProps({
+  modelValue: {
+    type: [Object],
+  },
+});
+const SeqArray = ref([]);
+const emits = defineEmits(["update:modelValue", "submit"]);
+const getSeq = async () => {
+  // const { data } = await getSeqData(processStore.scanInfo.id);
+  SeqArray.value = [processStore.useSeqNo];
+  emits("update:modelValue", {
+    ...props.modelValue.value,
+    seqNoList: SeqArray.value,
+  });
+};
+// const options = computed(() => {
+//   let arr = [];
+//   for (let i = 0; i < checkListData.value.length; i++) {
+//     arr.push({
+//       label: checkListData.value[i].content,
+//     });
+//   }
+//   return arr;
+// });
+onMounted(() => {
+  getSeq();
+  getCheckOpList();
+});
+const fileName = inject("fileName");
+watch(
+  () => props.modelValue.filePath,
+  (value) => {
+    if (value) {
+      fileName.value = uploadRef.value.fileList[0].name;
+    } else {
+      fileName.value = "";
+    }
+  },
+  { deep: true }
+);
+defineExpose({
+  setFileList,
+  formRef,
+  fileName,
+  getSeq,
+});
+</script>
+
+<style lang="scss" scoped>
+.body {
+  display: flex;
+  width: 100%;
+  height: 100%;
+}
+
+.btns {
+  width: 100%;
+  height: 60px;
+  display: flex;
+  align-items: center;
+  padding: 0 20%;
+  justify-content: space-evenly;
+}
+:deep(.el-form-item__label) {
+  font-size: 16px;
+}
+</style>

+ 145 - 0
src/views/pro-operation/inspectCommon/components/pop.vue

@@ -0,0 +1,145 @@
+<template>
+  <div class="midPopUp" v-if="modelValue" @click="handleClose">
+    <div class="container" @click.stop>
+      <div class="search">
+        <div class="body">
+          <el-form
+            ref="formRef"
+            :model="searchData"
+            label-width="100px"
+            style="display: flex"
+          >
+            <el-form-item
+              style="margin-right: 10px"
+              label="点检项名称:"
+              prop="checkName"
+            >
+              <el-input v-model="searchData.checkName" />
+            </el-form-item>
+            <el-form-item label="点检项编码:" prop="checkCode">
+              <el-input v-model="searchData.checkCode" />
+            </el-form-item>
+          </el-form>
+        </div>
+        <div class="seatchBtn">
+          <el-button class="sureBtn" type="primary" @click="getListData"
+            >搜 索
+          </el-button>
+          <el-button class="sureBtn" @click="clearSearch">清 空 </el-button>
+        </div>
+      </div>
+      <el-scrollbar class="table">
+        <el-table id="table" :data="checkListData">
+          <el-table-column label="点检项名称" prop="checkName" />
+          <el-table-column label="点检项编码" prop="checkCode" />
+          <el-table-column label="内容" prop="content" />
+          <el-table-column label="操作" width="80px">
+            <template #default="scope">
+              <span class="opera" @click="select(scope.row)">选择</span>
+            </template>
+          </el-table-column>
+          <template #empty>
+            <div class="empty">
+              <Empty />
+            </div>
+          </template>
+        </el-table>
+      </el-scrollbar>
+      <div class="bottom">
+        <div>
+          <Pagination
+            v-model:limit="page.pageSize"
+            v-model:page="page.pageNo"
+            :total="page.total"
+            @pagination="getListData"
+          />
+        </div>
+        <div>
+          <el-button class="sureBtn" @click="handleClose">关闭 </el-button>
+        </div>
+      </div>
+    </div>
+  </div>
+</template>
+
+<script setup>
+import { checkLists } from "@/api/prosteps/dianjian";
+const emits = defineEmits(["update:modelValue"]);
+const props = defineProps({
+  modelValue: {
+    type: Boolean,
+    default: false,
+  },
+});
+const page = reactive({
+  pageSize: 10,
+  pageNo: 1,
+  total: 0,
+});
+const searchData = ref({
+  checkName: null,
+  checkCode: null,
+});
+const formData = inject("formData");
+const select = (row) => {
+  formData.value.checkCode = row.checkCode;
+  formData.value.checkName = row.checkName;
+  formData.value.checkContent = row.content;
+  handleClose();
+};
+const checkListData = ref([]);
+const reset = () => {
+  searchData.value.checkCode = null;
+  searchData.value.checkName = null;
+  page.pageNo = 1;
+  getListData();
+};
+const clearSearch = async () => {
+  reset();
+};
+const getListData = async () => {
+  const { data } = await checkLists({
+    pageSize: page.pageSize,
+    pageNo: page.pageNo,
+    ...searchData.value,
+  });
+  checkListData.value = data.records;
+  page.total = data.totalCount;
+};
+const handleClose = () => {
+  emits("update:modelValue", false);
+};
+onMounted(() => {
+  getListData();
+});
+</script>
+
+<style lang="scss" scoped>
+.opera {
+  font-size: 20px;
+  margin-right: 10px;
+  cursor: pointer;
+  color: rgb(64, 158, 255);
+}
+.search {
+  width: 100%;
+  height: 90px;
+}
+.seatchBtn {
+  width: 100%;
+  display: flex;
+  justify-content: center;
+}
+.table {
+  width: 100%;
+  flex: 1;
+  border-radius: 16px;
+}
+.bottom {
+  width: 100%;
+  height: 40px;
+  display: flex;
+  align-items: center;
+  justify-content: space-between;
+}
+</style>

+ 433 - 0
src/views/pro-operation/inspectCommon/index.vue

@@ -0,0 +1,433 @@
+<template>
+  <div class="body">
+<!--    <div v-if="!checkName" class="checkBody">
+      <div class="titleText" style="text-align: center; margin-bottom: 20px">
+        请先扫描铭牌或输入工牌号:
+      </div>
+      <ScanCodeInput v-model="inputValue" @keyup.enter="handleSubmit" />
+    </div>-->
+    <div class="checkForm">
+      <div v-if="!editStatus" class="headerName">
+        <div class="titleText"><!--当前检验人:{{ checkName }}--></div>
+        <div
+          class="titleText"
+          style="margin-right: 15%; display: flex; align-items: center"
+        >
+          检验类型:
+          <el-select
+            v-model="checkType"
+            placeholder="Select"
+            style="width: 100px; font-size: 16px"
+            @change="
+              search.page = 1;
+              getPagination();
+            "
+          >
+            <el-option
+              v-for="item in options"
+              :key="item.value"
+              :label="item.label"
+              :value="item.value"
+              style="color: black; font-size: 16px"
+            />
+          </el-select>
+        </div>
+
+        <div
+          class="titleText"
+          style="color: red; cursor: pointer"
+          @click="logOff"
+        >
+          注销
+        </div>
+      </div>
+      <div v-if="!editStatus" class="content">
+        <div>
+          <el-button
+            class="sureBtn"
+            style="margin-bottom: 10px"
+            type="success"
+            @click="addCheck"
+            >新 增
+          </el-button>
+        </div>
+        <el-table
+          :data="dataList"
+          style="height: calc(100vh - 250px); border-radius: 16px"
+        >
+          <el-table-column label="序号" type="index" width="80" />
+          <el-table-column label="检验项名称" prop="checkName" />
+          <el-table-column label="检验项编码" prop="checkCode" />
+          <el-table-column label="检验项内容" prop="checkContent" />
+          <el-table-column label="流转卡号" prop="seqNo" />
+          <el-table-column label="备注" prop="remark" />
+          <!-- <el-table-column label="附件" prop="filePath">
+            <template #default="scope">
+              <span
+                v-if="scope.row.filePath"
+                class="opera"
+                @click="downLoad(scope.row.filePath)"
+                >下载</span
+              >
+              <span v-else>无附件</span>
+            </template>
+          </el-table-column> -->
+          <el-table-column label="结果" prop="result">
+            <template #default="scope">
+              <span
+                :style="{ color: scope.row.result == '1' ? 'green' : 'red' }"
+                >{{ scope.row.result == "1" ? "合格" : "不合格" }}</span
+              >
+            </template>
+          </el-table-column>
+          <el-table-column label="操作" width="180">
+            <template #default="scope">
+              <span class="opera" @click="editCheck(scope.row)">编辑</span>
+              <span
+                class="opera"
+                style="color: red"
+                @click="deleteCheck(scope.row.id)"
+                >删除</span
+              >
+            </template>
+          </el-table-column>
+          <template #empty>
+            <div class="empty">
+              <Empty />
+            </div>
+          </template>
+        </el-table>
+        <Pagination
+          :limit="search.limit"
+          :page="search.page"
+          :position="'right'"
+          :total="search.total"
+          @pagination="getPagination"
+        />
+      </div>
+      <div v-if="editStatus" class="headerName">
+        <div class="titleText">当前检验人:{{ checkName }}</div>
+        <div
+          class="titleText"
+          style="margin-right: 15%; display: flex; align-items: center"
+        >
+          操作类型:{{ editType == "add" ? "新增" : "修改" }}
+        </div>
+        <div></div>
+      </div>
+      <div v-show="editStatus" class="content">
+        <div class="form">
+          <div class="formContent">
+            <el-scrollbar style="height: calc(100vh - 200px); padding: 20px">
+              <CheckForm ref="formRef" v-model="formData" />
+            </el-scrollbar>
+          </div>
+          <div class="btns">
+            <el-button class="sureBtn" type="primary" @click="submit"
+              >提 交
+            </el-button>
+            <el-button class="sureBtn" type="info" @click="toBack"
+              >返 回
+            </el-button>
+          </div>
+        </div>
+      </div>
+    </div>
+  </div>
+</template>
+
+<script setup>
+import {
+  addCheckList,
+  checkUser,
+  deleteCheckList,
+  editCheckList,
+  getCheckList,
+} from "@/api/inspect";
+
+import { useProcessStore } from "@/store/modules/processView";
+import { useInspectStore } from "@/store/modules/inspect";
+import { downloadFile } from "@/utils/downLoad";
+import CheckForm from "./components/checkForm.vue";
+
+const formRef = ref(null);
+const formData = ref({});
+provide("formData", formData);
+const checkName = ref(null);
+const checkType = ref("self_check");
+const editStatus = ref(false);
+const editCheck = async (row) => {
+  editType.value = "edit";
+  formData.value.checkContent = row.checkContent;
+  formData.value.checkName = row.checkName;
+  formData.value.checkCode = row.checkCode;
+  formData.value.result = row.result;
+  formData.value.remark = row.remark;
+  formData.value.id = row.id;
+  formData.value.seqNoList = [processStore.useSeqNo];
+  editStatus.value = true;
+  if (row.filePath) {
+    setTimeout(() => {
+      formRef.value.setFileList([{ name: row.fileName }]);
+    }, 0);
+  }
+};
+
+const search = ref({
+  limit: 10,
+  page: 1,
+  total: 0,
+});
+const downLoad = async (url) => {
+  let resUrl = url;
+  await downloadFile(resUrl, "附件");
+};
+const addCheck = () => {
+  formData.value = { ...checkObj };
+  formRef.value.getSeq();
+  editStatus.value = true;
+  editType.value = "add";
+};
+const check = () => {
+  return new Promise(async (resolve, reject) => {
+    await formRef.value.formRef.validate((valid) => {
+      if (valid) {
+        resolve();
+      } else {
+        ElMessage.error("请检查表单");
+        reject();
+      }
+    });
+  });
+};
+const reset = () => {
+  formData.value = {};
+  editStatus.value = false;
+  editType.value = "add";
+  getPagination();
+};
+const addCheckAsync = async () => {
+  const { data, code } = await addCheckList({
+    ...formData.value,
+    checkType: checkType.value,
+    operationId: processStore.odersData.operationId,
+    workOrderCode: processStore.odersData.workOrderCode,
+    operator: checkName.value,
+    processId: processStore.scanInfo.id,
+    fileName: fileName.value,
+    operationName: processStore.scanInfo.operationName,
+  });
+  if (code == "200") {
+    ElMessage.success("操作成功!");
+  }
+};
+const deleteCheck = (id) => {
+  deleteCheckAsync(id);
+};
+const deleteCheckAsync = async (id) => {
+  const { data, code } = await deleteCheckList({
+    id,
+  });
+  if (code == "200") {
+    ElMessage.success("操作成功!");
+    getPagination();
+  }
+};
+const editCheckAsync = async () => {
+  const { data, code } = await editCheckList({
+    ...formData.value,
+    checkType: checkType.value,
+    operationId: processStore.odersData.operationId,
+    workOrderCode: processStore.odersData.workOrderCode,
+    operator: checkName.value,
+    processId: processStore.scanInfo.id,
+    fileName: fileName.value,
+    operationName: processStore.scanInfo.operationName,
+  });
+  if (code == "200") {
+    ElMessage.success("操作成功!");
+  }
+};
+const fileName = ref("");
+provide("fileName", fileName);
+const submit = async () => {
+  check().then(async () => {
+    if (editType.value == "add") {
+      await addCheckAsync();
+      reset();
+    } else {
+      await editCheckAsync();
+      reset();
+    }
+  });
+};
+const checkObj = {
+  checkContent: "",
+  checkName: "",
+  checkType: "",
+  filePath: "",
+  result: "",
+  seqNoList: [],
+};
+const dataList = ref([]);
+const getPagination = async () => {
+  const { data } = await getCheckList({
+    checkType: checkType.value,
+    pageNo: search.value.page,
+    pageSize: search.value.limit,
+    operationId: processStore.odersData.operationId,
+    workOrderCode: processStore.odersData.workOrderCode,
+    seqNo: processStore.useSeqNo,
+    operationName: processStore.scanInfo.operationName,
+  });
+  search.value.total = data.totalCount;
+  dataList.value = data.records;
+};
+const inspectStore = useInspectStore();
+const processStore = useProcessStore();
+const editType = ref("add");
+const toBack = () => {
+  editStatus.value = false;
+};
+//add 或者edit
+const options = [
+  /*{
+    value: "first_check",
+    label: "首检",
+  },*/
+ /* {
+    value: "inspection",
+    label: "巡检",
+  },*/
+  {
+    value: "self_check",
+    label: "自检",
+  },
+  /*{
+    value: "special_inspection",
+    label: "专检",
+  },*/
+  {
+    value: "mutual_inspection",
+    label: "互检",
+  },
+];
+const inputValue = ref("");
+const handleSubmit = () => {
+  inputValue.value = inputValue.value.trim();
+  checkUserVal();
+};
+const logOff = () => {
+  checkName.value = "";
+  inspectStore.checkName = "";
+};
+
+// const drawingData = ref<any>([]);
+const checkUserVal = async () => {
+  setTimeout(() => {
+    inputValue.value = "";
+  }, 0);
+  const { data, code, msg } = await checkUser({
+    employeeCode: inputValue.value,
+  });
+  if (code == "200") {
+    ElMessage.success("记录成功!请开展检验操作");
+    inspectStore.checkName = data.userName;
+    checkName.value = data.userName;
+  } else {
+    ElMessage.error(msg);
+  }
+};
+// const baseUrl = import.meta.env.VITE_APP_UPLOAD_URL;
+
+onMounted(() => {
+  /*if (inspectStore.checkName) {
+    checkName.value = inspectStore.checkName;
+  }*/
+});
+watch(checkName, (val) => {
+  if (val !== "") {
+    getPagination();
+  }
+});
+onUnmounted(() => {
+  inspectStore.checkName = "";
+});
+</script>
+
+<style lang="scss" scoped>
+.opera {
+  font-size: 20px;
+  margin-right: 10px;
+  cursor: pointer;
+  color: rgb(64, 158, 255);
+}
+
+.sureBtn {
+  border-radius: 25px;
+  font-size: 20px;
+  font-size: 500;
+  height: 50px;
+}
+
+.body {
+  width: 100vw;
+  height: calc(100vh - 120px);
+  display: flex;
+  align-items: center;
+  justify-content: center;
+
+  .checkBody {
+    width: 30vw;
+    align-items: center;
+    justify-content: center;
+  }
+
+  .checkForm {
+    width: 100%;
+    height: 100%;
+    display: flex;
+    flex-direction: column;
+
+    .headerName {
+      width: 100%;
+      height: 40px;
+      background-color: white;
+      border-radius: 20px;
+      lighting-color: 40px;
+      padding: 0 20px;
+      display: flex;
+      justify-content: space-between;
+      align-items: center;
+    }
+
+    .content {
+      flex: 1;
+      padding: 20px;
+
+      .form {
+        width: 800px;
+        height: 100%;
+        margin: 0 auto;
+        background-color: white;
+        border-radius: 16px;
+        display: flex;
+        flex-direction: column;
+
+        .formContent {
+          flex: 1;
+        }
+
+        .btns {
+          width: 100%;
+          height: 60px;
+          display: flex;
+          align-items: center;
+          padding: 0 20%;
+          justify-content: space-evenly;
+        }
+      }
+    }
+  }
+}
+</style>

+ 7 - 4
src/views/pro-steps/components/operates.vue

@@ -62,6 +62,9 @@ const setIndex = (index: number) => {
     case "baogong":
       reportWorkRef.value?.openReportWorkDrawer();
       break;
+    case "check":
+      router.push({ name: "inspectCommon" });
+      break;
     case "jianyan":
       router.push({ name: "inspect" });
       break;
@@ -86,10 +89,10 @@ const stepComponents = ref([
     compentName: "检验",
     compentType: "jianyan",
   },
-  // {
-  //   compentName: "编号填写",
-  //   compentType: "bianhao",
-  // },
+  {
+    compentName: "自检/互检",
+    compentType: "check",
+  },
   {
     compentName: "报工",
     compentType: "baogong",