Browse Source

Merge branch 'qingban' of http://maven.jgiot.com:7012/jiaxiaoqiang/JG-ADMIN-TEMP into qingban

jiaxiaoqiang 10 months ago
parent
commit
0a63827cc1

+ 0 - 28
src/components/ExcelView/index.vue

@@ -199,34 +199,6 @@ const saveCellData = () => {
   };
   };
   enter();
   enter();
 };
 };
-function convertFromReadableFormat(rangeString) {
-  // 解析单元格区域描述,例如 "A1:A10"
-  const regex = /([A-Z]+)(\d+):([A-Z]+)(\d+)/;
-  const match = rangeString.match(regex);
-
-  if (!match) {
-    throw new Error("Invalid range format");
-  }
-
-  const startColumn = match[1]; // 起始列,例如 "A"
-  const startRow = parseInt(match[2], 10); // 起始行,例如 1
-  const endColumn = match[3]; // 结束列,例如 "A"
-  const endRow = parseInt(match[4], 10); // 结束行,例如 10
-
-  // 将列名转换为列索引,例如 "A" -> 0, "B" -> 1, ...
-  const startColumnIndex = startColumn.charCodeAt(0) - 65;
-  const endColumnIndex = endColumn.charCodeAt(0) - 65;
-
-  // 构建结果对象
-  const result = {
-    row: startRow - 1,
-    column: startColumnIndex,
-    row_end: endRow - 1,
-    column_end: endColumnIndex,
-  };
-
-  return result;
-}
 //配置单元格校验
 //配置单元格校验
 const setVerification = () => {
 const setVerification = () => {
   for (let i = 0; i < props.verifications.length; i++) {
   for (let i = 0; i < props.verifications.length; i++) {

+ 5 - 1
src/views/base/craftManagement/route/bindProcess.vue

@@ -180,7 +180,11 @@ provide("currentProcess", currentProcess);
 const nodeClick = (event) => {
 const nodeClick = (event) => {
   if (!editStatus.value) return;
   if (!editStatus.value) return;
   currentProcess.value = event.node;
   currentProcess.value = event.node;
-  console.log("------------" + JSON.stringify(event.node))
+  if (!editStatus.value) return;
+  currentProcess.value = event.node;
+
+
+
 };
 };
 onConnect(addEdges);
 onConnect(addEdges);
 const getPng = () => {
 const getPng = () => {

+ 11 - 11
src/views/base/craftManagement/route/components/CustomConnectionLine/index.vue

@@ -28,24 +28,24 @@
 <script lang="ts" setup>
 <script lang="ts" setup>
 import { getSmoothStepPath, SmoothStepEdgeProps } from "@vue-flow/core";
 import { getSmoothStepPath, SmoothStepEdgeProps } from "@vue-flow/core";
 import { computed, inject } from "vue";
 import { computed, inject } from "vue";
-//由于props不包含及时的selected参数只有靠依赖注入解决
-const edges = inject("edges");
+
+const selectLine = inject("selectLine");
 const status = ref(true);
 const status = ref(true);
 const props = defineProps<SmoothStepEdgeProps>();
 const props = defineProps<SmoothStepEdgeProps>();
 const path = computed(() => getSmoothStepPath(props)[0]);
 const path = computed(() => getSmoothStepPath(props)[0]);
 const setSeletedStatus = () => {
 const setSeletedStatus = () => {
-  edges?.value.forEach((item: any) => {
-    if (item.id == props.id) {
-      if (item.selected == true) {
-        status.value = false;
-      } else {
-        status.value = true;
-      }
+  if (selectLine.value != null) {
+    if (props.id == selectLine.value.id) {
+      status.value = false;
+    } else {
+      status.value = true;
     }
     }
-  });
+  } else {
+    status.value = true;
+  }
 };
 };
 watch(
 watch(
-  () => edges.value,
+  () => selectLine.value,
   () => {
   () => {
     setSeletedStatus();
     setSeletedStatus();
   },
   },

+ 32 - 5
src/views/base/craftManagement/route/components/CustomNode/index.vue

@@ -2,18 +2,42 @@
 import { Position, Handle } from "@vue-flow/core";
 import { Position, Handle } from "@vue-flow/core";
 const props = defineProps(["data", "id"]);
 const props = defineProps(["data", "id"]);
 const currentProcess = inject("currentProcess");
 const currentProcess = inject("currentProcess");
+const selectNode = inject("selectNode");
 const selectStatus = ref(false);
 const selectStatus = ref(false);
-
+const editStatus = inject("editStatus");
 const getBorderClass = computed(() => {
 const getBorderClass = computed(() => {
   let str = "borderBlack";
   let str = "borderBlack";
   if (selectStatus.value) {
   if (selectStatus.value) {
-    str = "borderBlue";
+    if (editStatus.value == true) {
+      str = "borderBlue";
+    } else {
+      str = "borderGreen";
+    }
   }
   }
   return str;
   return str;
 });
 });
-watchEffect(() => {
-  selectStatus.value = props.id == currentProcess.value.id;
-});
+watch(
+  () => currentProcess.value,
+  () => {
+    if (currentProcess.value == null) {
+      selectStatus.value = false;
+      return;
+    }
+    selectStatus.value = props.id == currentProcess.value.id;
+  },
+  { deep: true }
+);
+watch(
+  () => selectNode.value,
+  () => {
+    if (selectNode.value == null) {
+      selectStatus.value = false;
+      return;
+    }
+    selectStatus.value = props.id == selectNode.value.id;
+  },
+  { deep: true }
+);
 </script>
 </script>
 
 
 <template>
 <template>
@@ -70,4 +94,7 @@ watchEffect(() => {
 .borderBlue {
 .borderBlue {
   border-color: blue;
   border-color: blue;
 }
 }
+.borderGreen {
+  border-color: green;
+}
 </style>
 </style>

+ 0 - 1
src/views/base/craftManagement/route/components/setExcel/index.vue

@@ -159,7 +159,6 @@ option.value = Object.assign(option.value, {
   viewBtn: false,
   viewBtn: false,
   editBtn: false,
   editBtn: false,
   delBtn: false,
   delBtn: false,
-  addBtn: false,
   searchMenuSpan: 8,
   searchMenuSpan: 8,
   column: [
   column: [
     {
     {

+ 4 - 2
src/views/error-page/404.vue

@@ -34,7 +34,7 @@ function message() {
       </div>
       </div>
       <div class="bullshit">
       <div class="bullshit">
         <div class="bullshit__oops">OOPS!</div>
         <div class="bullshit__oops">OOPS!</div>
-<!--        <div class="bullshit__info">
+        <!--        <div class="bullshit__info">
           All rights reserved
           All rights reserved
           <a
           <a
             style="color: #20a0ff"
             style="color: #20a0ff"
@@ -48,7 +48,9 @@ function message() {
           Please check that the URL you entered is correct, or click the button
           Please check that the URL you entered is correct, or click the button
           below to return to the homepage.
           below to return to the homepage.
         </div>
         </div>
-        <a href="" class="bullshit__return-home">跳转首页</a>
+        <router-link class="bullshit__return-home" to="/welcome">
+          跳转欢迎页
+        </router-link>
       </div>
       </div>
     </div>
     </div>
   </div>
   </div>

+ 46 - 6
src/views/plan/schedule/index.vue

@@ -1,12 +1,31 @@
 <template>
 <template>
   <div class="mainContentBox">
   <div class="mainContentBox">
-    <avue-crud ref="crudRef" v-model:search="search" v-model="form" :data="data" :option="option" v-model:page="page"
-      @row-save="createRow" @row-update="updateRow" @row-del="deleteRow" @search-change="searchChange"
-      @search-reset="resetChange" @size-change="dataList" @current-change="dataList"
-      @selection-change="selectionChange">
+    <avue-crud
+      ref="crudRef"
+      v-model:search="search"
+      v-model="form"
+      :data="data"
+      :option="option"
+      v-model:page="page"
+      @row-save="createRow"
+      @row-update="updateRow"
+      @row-del="deleteRow"
+      @search-change="searchChange"
+      @search-reset="resetChange"
+      @size-change="dataList"
+      @current-change="dataList"
+      @selection-change="selectionChange"
+    >
       <template #menu="{ size, row, index }">
       <template #menu="{ size, row, index }">
-        <el-button icon="el-icon-edit" text v-if="row.state === '-1' || row.state === '0'"
-          @click="handleEdit(row, index)" type="primary" :size="size">编辑</el-button>
+        <el-button
+          icon="el-icon-edit"
+          text
+          v-if="row.state === '-1' || row.state === '0' || row.state === '1'"
+          @click="handleEdit(row, index)"
+          type="primary"
+          :size="size"
+          >编辑</el-button
+        >
       </template>
       </template>
       <template #menu-left>
       <template #menu-left>
         <div id="charts"></div>
         <div id="charts"></div>
@@ -19,6 +38,7 @@ import { ref } from "vue";
 import { useCrud } from "@/hooks/userCrud";
 import { useCrud } from "@/hooks/userCrud";
 import dictDataUtil from "@/common/configs/dictDataUtil";
 import dictDataUtil from "@/common/configs/dictDataUtil";
 import { queryStationByLineId } from "@/api/station";
 import { queryStationByLineId } from "@/api/station";
+import { getUserList } from "@/api/system/user";
 import { useDictionaryStore } from "@/store";
 import { useDictionaryStore } from "@/store";
 import { getStatistics } from "@/api/order/index";
 import { getStatistics } from "@/api/order/index";
 import * as echarts from "echarts";
 import * as echarts from "echarts";
@@ -38,11 +58,20 @@ const { checkBtnPerm, downloadTemplate, exportData } = Utils; //按钮权限等
 
 
 const crudRef = ref(null); //crudRef.value 获取avue-crud对象
 const crudRef = ref(null); //crudRef.value 获取avue-crud对象
 const stationList = ref([]);
 const stationList = ref([]);
+const userList = ref([]);
 const charts = shallowRef(null);
 const charts = shallowRef(null);
 const handleEdit = (row, index) => {
 const handleEdit = (row, index) => {
   queryStationByLineId(row.productLineId).then((data) => {
   queryStationByLineId(row.productLineId).then((data) => {
     stationList.value = data.data;
     stationList.value = data.data;
   });
   });
+  getUserList({}).then((data) => {
+    userList.value = data.data;
+  });
+  if (row.state === "1") {
+    option.value.column[2].editDisabled = true;
+    option.value.column[12].editDisabled = true;
+    option.value.column[13].editDisabled = true;
+  }
   crudRef.value && crudRef.value.rowEdit(row, index);
   crudRef.value && crudRef.value.rowEdit(row, index);
 };
 };
 onMounted(() => {
 onMounted(() => {
@@ -115,6 +144,7 @@ option.value = Object.assign(option.value, {
       editDisabled: false,
       editDisabled: false,
       type: "select",
       type: "select",
       dicData: stationList,
       dicData: stationList,
+      filterable: true,
       prop: "stationId",
       prop: "stationId",
       props: { label: "name", value: "id" },
       props: { label: "name", value: "id" },
       rules: [
       rules: [
@@ -126,6 +156,16 @@ option.value = Object.assign(option.value, {
       ],
       ],
     },
     },
     {
     {
+      label: "分配人员",
+      editDisabled: false,
+      type: "select",
+      dicData: userList,
+      filterable: true,
+      prop: "allocationUser",
+      dicMethod: "post",
+      props: { label: "userName", value: "userName" },
+    },
+    {
       label: "工单编码",
       label: "工单编码",
       prop: "workOrderCode",
       prop: "workOrderCode",
       search: true,
       search: true,

+ 236 - 0
src/views/plan/workOrder/components/check-task.vue

@@ -0,0 +1,236 @@
+<template>
+  <div class="mainContentBox">
+    <avue-crud
+        ref="crudRef"
+        v-model:search="search"
+        v-model="form"
+        :data="data"
+        :option="option"
+        v-model:page="page"
+        @row-save="createRow"
+        @row-update="updateRow"
+        @row-del="deleteRow"
+        @search-change="searchChange"
+        @search-reset="resetChange"
+        @size-change="dataList"
+        @current-change="dataList"
+        @selection-change="selectionChange1"
+    >
+      <template #menu="{size,row,index}">
+        <el-button @click="deleteTep(row.id)" text type="primary" v-if ="info.workOrderState  === '1' || info.workOrderState  === '2' || info.workOrderState  === '0'"
+        >删除</el-button
+        >
+      </template>
+      <template #menu-left="{}">
+        <el-button
+          v-if ="info.workOrderState  === '1' || info.workOrderState  === '2' || info.workOrderState  === '0'"
+          type="primary"
+          icon="el-icon-plus"
+          @click="addObj"
+        >新增</el-button>
+      </template>
+
+    </avue-crud>
+    <el-dialog
+        v-model="editDialog.visible"
+        :title="editDialog.title"
+        width="650px"
+        @close="handleClose"
+    >
+      <el-form
+          ref="taskFormRef"
+          status-icon
+          :model="taskForm"
+          :rules="rules"
+          label-width="auto"
+          class="demo-ruleForm">
+        <el-form-item label="任务名称" prop="formName">
+          <el-input v-model="taskForm.formName">
+          </el-input>
+        </el-form-item>
+        <el-form-item label="Excel模板" prop="baseFormIds">
+          <el-select v-model="taskForm.baseFormIds" multiple placeholder="Select">
+            <el-option
+                v-for="item in options"
+                :key="item.value"
+                :label="item.label"
+                :value="item.value"
+            />
+          </el-select>
+        </el-form-item>
+      </el-form>
+      <template #footer>
+        <div class="dialog-footer">
+          <el-button @click="handleClose">取消</el-button>
+          <el-button type="primary" @click="onSelected"> 确定 </el-button>
+        </div>
+      </template>
+    </el-dialog>
+  </div>
+</template>
+<script setup>
+import {defineProps, ref} from "vue";
+import { getForm, add, deleteTemp } from "@/api/excel";
+import { useCrud } from "@/hooks/userCrud";
+import { useCommonStoreHook,useDictionaryStore } from "@/store";
+const { isShowTable, tableType } = toRefs(useCommonStoreHook());
+const toPrintRef = ref(null);
+const options = ref([]);
+const test = () => {
+  isShowTable.value = true;
+  tableType.value = tableType.value == 1 ? 2 : 1;
+};
+const taskFormRef = ref();
+const taskForm = ref({
+  formName: "",
+  baseFormIds: "",
+  workOrderId: ""
+
+});
+const rules = reactive({
+  formName: [{ required: true, trigger: "blur" }],
+  baseFormIds: [{ required: true, trigger: "blur" }],
+});
+const editDialog = ref({ visible: false, title: "绑定模版" });
+const value1 = ref([]);
+const info = ref({})
+const props = defineProps({
+  workOrderInfo: {
+    type: Object,
+    default: () => {
+      return null;
+    }
+  }
+})
+const handleClose = () => {
+  editDialog.value.visible = false;
+  value1.value = [];
+};
+const dialog = reactive({
+  title: "二维码打印",
+  visible: false,
+});
+const clickObjs = ref([])
+const selectionChange1 =(row)=>{
+  toDeleteIds.value = [];
+  row?.forEach((element) => {
+    toDeleteIds.value.push(element.id);
+  });
+  clickObjs.value = row
+}
+const crudRef = ref(null); //crudRef.value 获取avue-crud对象
+const addObj =()=>{
+  editDialog.value.visible = true
+}
+const deleteTep = async (id) => {
+  const { data, code } = await deleteTemp({
+    id,
+  });
+  if (code == "200") {
+    ElMessage.success("删除成功!");
+    dataList();
+  }
+};
+//新增
+const onSelected = () => {
+  taskFormRef.value.validate((valid) => {
+    if (valid) {
+      add(taskForm.value).then((data)=>{
+        if (data.code == "200") {
+          ElMessage.success("添加成功!");
+          dataList();
+          handleClose();
+          taskForm.value.baseFormIds = []
+          taskForm.value.formName = ''
+        }else{
+          ElMessage.error(data.msg);
+        }
+      })
+    }
+  });
+};
+//获取Excel模版列表
+const getTemplate = async () => {
+  const { data } = await getForm({
+    pageNo: 1,
+    pageSize: 9999999,
+    formType: 1
+  });
+  options.value = [];
+  data.records.forEach((element) => {
+    options.value.push({
+      value: element.id,
+      label: element.formName,
+    });
+  });
+};
+watch(
+    () => props.workOrderInfo,
+    () => {
+      form.value.workOrderCode = props.workOrderInfo.workOrderCode
+      info.value = props.workOrderInfo
+      search.value.workOrderCode = props.workOrderInfo.workOrderCode
+      dataList();
+    }
+);
+// 传入一个url,后面不带/
+const { form, data, option, search, page, toDeleteIds, Methords, Utils } =
+  useCrud({
+    src: "/api/v1/opExcelForm",
+  });
+const { dataList, createRow, updateRow, deleteRow, searchChange, resetChange } = Methords; //增删改查
+const { selectionChange, multipleDelete } = Methords; //选中和批量删除事件
+const { checkBtnPerm, downloadTemplate, exportData } = Utils; //按钮权限等工具
+const { dicts } = useDictionaryStore();
+
+
+// 设置表格列或者其他自定义的option
+option.value = Object.assign(option.value, {
+  delBtn: false,
+  selection: false,
+  search: false,
+  filterBtn: false,
+  columnBtn: false,
+  editBtn: false,
+  addBtn: false,
+  viewBtn: false,
+  menu: true,
+  column: [
+    {
+      label: "任务名称",
+      prop: "formName",
+      addDisabled: true,
+      editDisabled: true,
+    },
+    {
+      label: "模版类型",
+      prop: "formType",
+      addDisabled: true,
+      editDisabled: true,
+      dicData: dicts.excel_type,
+      props: { label: "dictLabel", value: "dictValue" },
+    },
+    {
+      label: "修改时间",
+      prop: "updated",
+      addDisabled: true,
+      editDisabled: true,
+    },
+    {
+      label: "操作人",
+      prop: "updator",
+      addDisabled: true,
+      editDisabled: true,
+    },
+  ],
+});
+
+onMounted(() => {
+  info.value = props.workOrderInfo
+  taskForm.value.workOrderId = info.value.id
+  form.value.workOrderId = props.workOrderInfo.id
+  search.value.workOrderId = props.workOrderInfo.id
+  dataList();
+  getTemplate()
+});
+</script>

+ 20 - 4
src/views/plan/workOrder/index.vue

@@ -90,12 +90,12 @@
             @click="revoke(row.id)"
             @click="revoke(row.id)"
             type="primary"
             type="primary"
             :size="size">撤销</el-button>
             :size="size">撤销</el-button>
-<!--        <el-button
+        <el-button
             icon="el-icon-setting"
             icon="el-icon-setting"
             text
             text
-            @click="jumpPage(row.workOrderCode,1)"
+            @click="showCheckTask(row)"
             type="primary"
             type="primary"
-            :size="size">领用申请</el-button>-->
+            :size="size">检验任务</el-button>
         <el-button
         <el-button
             icon="el-icon-setting"
             icon="el-icon-setting"
             text
             text
@@ -164,7 +164,14 @@
     >
     >
       <work-order-seq :workOrderInfo="form"/>
       <work-order-seq :workOrderInfo="form"/>
     </el-dialog>
     </el-dialog>
-
+    <el-dialog
+        v-model="dialog6.visible"
+        :title="dialog6.title"
+        width="1100px"
+        @close="dialog6.visible = false"
+    >
+      <check-task :workOrderInfo="form"/>
+    </el-dialog>
     <el-dialog
     <el-dialog
         v-model="dialog5.visible"
         v-model="dialog5.visible"
         :title="dialog5.title"
         :title="dialog5.title"
@@ -222,6 +229,7 @@ import dictDataUtil from "@/common/configs/dictDataUtil";
 import ChoiceRoutePage from "./components/choice-route-page.vue";
 import ChoiceRoutePage from "./components/choice-route-page.vue";
 import ChoiceWorkshopPage from "./components/choice-workshop-page.vue";
 import ChoiceWorkshopPage from "./components/choice-workshop-page.vue";
 import WorkOrderSeq from "./components/work-order-seq.vue";
 import WorkOrderSeq from "./components/work-order-seq.vue";
+import CheckTask from "./components/check-task.vue";
 import { checkPerm } from "@/directive/permission";
 import { checkPerm } from "@/directive/permission";
 import {queryDictDataByType} from "@/api/system/dict"
 import {queryDictDataByType} from "@/api/system/dict"
 const { isShowTable, tableType } = toRefs(useCommonStoreHook());
 const { isShowTable, tableType } = toRefs(useCommonStoreHook());
@@ -272,6 +280,10 @@ const dialog5 = reactive({
   title: "排程确认",
   title: "排程确认",
   visible: false,
   visible: false,
 });
 });
+const dialog6 = reactive({
+  title: "检验任务",
+  visible: false,
+});
 const apsType = ref(0)
 const apsType = ref(0)
 const aps =(id)=>{
 const aps =(id)=>{
   apsType.value = 0
   apsType.value = 0
@@ -282,6 +294,10 @@ const showSeqPage =(workOrderCode)=>{
   form.value = workOrderCode
   form.value = workOrderCode
   dialog4.visible = true
   dialog4.visible = true
 }
 }
+const showCheckTask =(workOrderCode)=>{
+  form.value = workOrderCode
+  dialog6.visible = true
+}
 const distribute = (id)=>{
 const distribute = (id)=>{
   ElMessageBox.confirm("当前操作不可逆,确定下发工单吗?")
   ElMessageBox.confirm("当前操作不可逆,确定下发工单吗?")
       .then(() => {
       .then(() => {