Explorar el Código

Merge branch 'xf_dev' of http://192.168.101.4:3000/jiaxiaoqiang/JG-ADMIN-TEMP into xf_dev

# Conflicts:
#	.env.development
jiaxiaoqiang hace 10 meses
padre
commit
30e71a889d

+ 1 - 5
.env.development

@@ -10,10 +10,6 @@ VITE_APP_BASE_API = '/dev-api'
 # 上传文件接口地址
 VITE_APP_UPLOAD_URL = 'http://192.168.101.4:9000'
 # 开发接口地址
- VITE_APP_API_URL = 'http://192.168.101.4:8078'
-#VITE_APP_API_URL = 'http://127.0.0.1:8078'
-#  VITE_APP_API_URL = 'http://121.41.179.41:8078'  #lup
-#VITE_APP_API_URL = 'http://192.168.101.64:8078'  #hetao
-
+VITE_APP_API_URL = 'http://192.168.101.4:8078'
 # 是否启用 Mock 服务
 VITE_MOCK_DEV_SERVER = false

+ 1 - 0
.gitignore

@@ -17,3 +17,4 @@ package-lock.json
 pnpm-lock.yaml
 stats.html
 /docker/.run
+/.vite/deps_temp_327c80ff

+ 2 - 2
src/api/material/index.ts

@@ -14,9 +14,9 @@ export function getMaterialDetails(materialCode: String): AxiosPromise<any> {
   });
 }
 
-export function getMaterialDetailsByseqNo(seqNo: String): AxiosPromise<any> {
+export function getMaterialDetailsByseqNo(workOrderCode: String,seqNo: String): AxiosPromise<any> {
   return request({
-    url: "/api/v1/process/web/traceability/get/" + seqNo,
+    url: "/api/v1/process/web/traceability/get/" + workOrderCode + "/" + seqNo,
     method: "get",
   });
 }

+ 3 - 0
src/common/configs/buttonPermission.ts

@@ -68,6 +68,9 @@ const ButtonPermKeys = {
       maintenance: "device:maintenance",
     },
     BTNS: {
+      instance_add: "device:instance:add",
+      instance_del: "device:instance:del",
+      instance_edit: "device:instance:edit",
       maintenance_add: "device:maintenance:add",
       maintenance_handle: "device:maintenance:handle",
       maintenance_edit: "device:maintenance:edit",

+ 1 - 4
src/directive/permission/index.ts

@@ -37,10 +37,7 @@ export function checkPerm(str: string) {
   if (roles.includes("ROOT")) {
     return true;
   }
-  const hasPerm = perms?.some((perm) => {
-    return str.includes(perm);
-  });
-  return hasPerm;
+  return perms.includes(str)
 }
 
 /**

+ 3 - 0
src/hooks/userCrud.ts

@@ -45,6 +45,7 @@ export const useCrud = (config?: UseCrudConfig) => {
     tip: false, //选中的提示
   });
   const data = ref<any>([]); //表格数据
+  const lines = ref<any>([]); //产线
   const form = ref({}); //新增或者编辑弹出的表单绑定值
   /** 表格顶部搜索的表单的变量 v-model */
   const search = ref({});
@@ -123,6 +124,7 @@ export const useCrud = (config?: UseCrudConfig) => {
             page.value.total = res?.data?.length || 0;
           } else {
             data.value = res?.data?.records || [];
+            lines.value = res?.data?.productLines || [];
             page.value.total = res?.data?.totalCount || 0;
           }
         }
@@ -391,6 +393,7 @@ export const useCrud = (config?: UseCrudConfig) => {
     url,
     option,
     data,
+    lines,
     form,
     search,
     page,

+ 16 - 0
src/views/base/craftManagement/route/bindConfig.ts

@@ -135,6 +135,22 @@ export const formOption = {
       value: 0,
     },
     {
+      label: "是否互检",
+      prop: "mutualInspection",
+      span: 24,
+      type: "switch",
+      dicData: switchOp,
+      value: 0,
+    },
+    {
+      label: "是否专检",
+      prop: "specialInspection",
+      span: 24,
+      type: "switch",
+      dicData: switchOp,
+      value: 0,
+    },
+    {
       label: "是否巡检",
       prop: "inspection",
       span: 24,

+ 13 - 4
src/views/base/craftManagement/route/index.vue

@@ -9,7 +9,6 @@
       v-model:page="page"
       @row-save="createRow"
       @row-update="updateRow"
-      @row-del="deleteRow"
       @search-change="searchChange"
       @search-reset="resetChange"
       @size-change="dataList"
@@ -44,11 +43,19 @@
           link
           type="primary"
           icon="el-icon-edit"
-          :disabled="false"
+          v-if="row.usable === 0"
           @click="doEdit(row, index)"
           >编辑</el-button
         >
         <el-button
+            link
+            type="danger"
+            icon="el-icon-edit"
+            v-if="row.usable === 0"
+            @click="deleteRow(row, index)"
+        >删除</el-button
+        >
+        <el-button
           link
           type="primary"
           icon="el-icon-copy-document"
@@ -212,9 +219,11 @@ const bindProcess = (row) => {
 // 设置表格列或者其他自定义的option
 option.value = Object.assign(option.value, {
   selection: true,
-  labelWidth: 110,
+  labelWidth: 100,
   editBtn: false,
-  searchLabelWidth: 110,
+  delBtn: false,
+  menuWidth: 250,
+  searchLabelWidth: 100,
   column: [
     {
       label: "工艺路线编号",

+ 8 - 3
src/views/base/information/index.vue

@@ -7,7 +7,7 @@
       :data="data"
       :option="option"
       v-model:page="page"
-      @row-save="createRow"
+      @row-save="addRow"
       @row-update="updateRow"
       @row-del="deleteRow"
       @search-change="searchChange"
@@ -130,10 +130,15 @@ onMounted?.(() => {
   // console.log("crudRef", crudRef)
   dataEditList();
 });
-
+const addRow = (form2, done) => {
+  createRow(form, done, done);
+  pdfUrlList.value = [];
+  srcList.value = [];
+  fileNameList.value = [];
+};
 const onSelectedFinish = (selectedValue) => {
   form.value.associationCode = selectedValue.materialCode;
-  form.value.associationName = selectedValue.materialCode;
+  form.value.associationName = selectedValue.materialName;
   form.value.materialCode = selectedValue.materialCode;
 };
 

+ 76 - 73
src/views/base/materials/components/drawing-page.vue

@@ -20,7 +20,7 @@
       :data="data"
       :option="option"
       v-model:page="page"
-      @row-save="createRow"
+      @row-save="addRow"
       @row-update="updateRow"
       @row-del="deleteRow"
       @search-change="searchChange"
@@ -39,7 +39,12 @@
           @click="multipleDelete"
           >删除</el-button
         >
-        <el-select v-model="version" placeholder="请选择BOM版本" style="width:150px;margin-left:15px" @change="getVersionDrawing">
+        <el-select
+          v-model="version"
+          placeholder="请选择BOM版本"
+          style="width: 150px; margin-left: 15px"
+          @change="getVersionDrawing"
+        >
           <el-option
             v-for="item in options"
             :key="item"
@@ -49,7 +54,7 @@
           </el-option>
         </el-select>
       </template>
-      <template #menu="{row,index,type}">
+      <template #menu="{ row, index, type }">
         <PDFView
           :need-to-show-pdf="true"
           content-type="button"
@@ -69,25 +74,31 @@ import { useCommonStoreHook } from "@/store";
 
 const { isShowTable, tableType } = toRefs(useCommonStoreHook());
 import { useDictionaryStore } from "@/store";
-import { addDrawing,getDrawing } from "@/api/drawing";
+import { addDrawing, getDrawing } from "@/api/drawing";
 const { dicts } = useDictionaryStore();
 const filePath = import.meta.env.VITE_APP_UPLOAD_URL;
 const test = () => {
   isShowTable.value = true;
   tableType.value = tableType.value == 1 ? 2 : 1;
 };
-const testFiles =()=>{
+const addRow = (form2, done) => {
+  createRow(form, done, done);
+  pdfUrlList.value = [];
+  srcList.value = [];
+  fileNameList.value = [];
+};
+const testFiles = () => {
   form.value.pdfPathList = pdfUrlList.value;
   form.value.drawingPathList = srcList.value;
   form.value.drawingPath = srcList.value[0];
-  form.value.fileNameList=fileNameList.value;
-}
+  form.value.fileNameList = fileNameList.value;
+};
 // 传入一个url,后面不带/
 const { form, data, option, search, page, toDeleteIds, Methords, Utils } =
   useCrud({
     src: "/api/v1/base/drawing",
   });
-const { dataList} = Methords; //增删改查
+const { dataList } = Methords; //增删改查
 const { selectionChange, multipleDelete } = Methords; //选中和批量删除事件
 const { checkBtnPerm, downloadTemplate, exportData } = Utils; //按钮权限等工具
 // checkBtnPerm(ButtonPermKeys.PLAN.BTNS.order_add) :permission="permission"
@@ -97,73 +108,65 @@ const { checkBtnPerm, downloadTemplate, exportData } = Utils; //按钮权限等
 //   editBtn: checkPerm(buttonPermission.PLAN.BTNS.order_edit),
 //   menu: true,
 // });
-const formRef=ref(null);
-const version=ref({
-  value: '0',
-  label: '请选择图纸版本',
+const formRef = ref(null);
+const version = ref({
+  value: "0",
+  label: "请选择图纸版本",
 });
-const options=ref([]);
+const options = ref([]);
 const fileUrl = ref(""); //单文件
 const pdfUrlList = ref([]);
 const srcList = ref([]);
 const fileNameList = ref([]);
 import dictDataUtil from "@/common/configs/dictDataUtil";
-const getVersionDrawing=()=>{
-  if(version.value.value!="0"){
+const getVersionDrawing = () => {
+  if (version.value.value != "0") {
     search.value.materialCode = props.materialCode;
-    search.value.drawingVersion=version.value;
+    search.value.drawingVersion = version.value;
     dataList();
   }
-}
-function rowSave(form,done) {
+};
+function rowSave(form, done) {
   form.associationCode = props.materialCode;
-  form.associationName=props.materialName;
-  console.info("formRef.value",done);
-  addDrawing(form).then(
-    (data)=>{
-      if(data.code==="200") {
-        ElMessage({
-          message: data.msg,
-          type: "success",
-        });
-
-        formRef.value.resetForm();
-        dataList();
-      } else {
-        ElMessage({
-          message: data.msg,
-          type: "error",
-        });
+  form.associationName = props.materialName;
+  console.info("formRef.value", done);
+  addDrawing(form).then((data) => {
+    if (data.code === "200") {
+      ElMessage({
+        message: data.msg,
+        type: "success",
+      });
 
-      }
+      formRef.value.resetForm();
+      dataList();
+    } else {
+      ElMessage({
+        message: data.msg,
+        type: "error",
+      });
     }
-  )
+  });
   done();
 }
 
-
 onMounted(() => {
   // console.log("crudRef", crudRef)
-  getDrawing(props.materialCode).then(
-    (data)=>{
-      if(data.code==="200") {
-        options.value=Array.from(data.data);
-      } else {
-        ElMessage({
-          message: data.msg,
-          type: "error",
-        });
-      }
+  getDrawing(props.materialCode).then((data) => {
+    if (data.code === "200") {
+      options.value = Array.from(data.data);
+    } else {
+      ElMessage({
+        message: data.msg,
+        type: "error",
+      });
     }
-  )
+  });
   search.value.materialCode = props.materialCode;
   dataList();
 });
 
-
 const ctableRef = ref(null);
 
-
 // 设置表格列或者其他自定义的option
 option.value = Object.assign(option.value, {
   selection: true,
@@ -209,38 +212,40 @@ option.value = Object.assign(option.value, {
       label: "图纸类型",
       prop: "drawingDictValue",
       filterable: true,
-      type: 'select',
-      width: 100,overHidden: true,
+      type: "select",
+      width: 100,
+      overHidden: true,
       dicUrl: dictDataUtil.request_url + "drawing_type",
       props: { label: "dictLabel", value: "dictValue" },
-      rules: [{
-        required: true,
-        message: "请选择物料属性",
-        trigger: "blur"
-      }],
+      rules: [
+        {
+          required: true,
+          message: "请选择物料属性",
+          trigger: "blur",
+        },
+      ],
     },
     {
       label: "文件名称",
       prop: "fileName",
       span: 24,
-      width:120,
-      overHidden:true,
-      display:false,
+      width: 120,
+      overHidden: true,
+      display: false,
     },
     {
       label: "文件数组",
       prop: "drawingPathList",
       span: 24,
-      hide:true,
-      display:false,
+      hide: true,
+      display: false,
     },
     {
       label: "pdf数组",
       prop: "pdfPathList",
       span: 24,
-      hide:true,
-      display:false,
-
+      hide: true,
+      display: false,
     },
 
     {
@@ -248,8 +253,8 @@ option.value = Object.assign(option.value, {
       prop: "fileNameList",
       span: 24,
       slot: true,
-      hide:true,
-      display:false,
+      hide: true,
+      display: false,
     },
     {
       label: "版本",
@@ -263,9 +268,9 @@ option.value = Object.assign(option.value, {
           trigger: "blur",
         },
       ],
-      click(){
-        dialog1.visible=true;
-      }
+      click() {
+        dialog1.visible = true;
+      },
     },
     {
       label: "图纸上传",
@@ -286,7 +291,6 @@ option.value = Object.assign(option.value, {
         }
 */
     },
-
   ],
   delBtn: false,
   editBtn: false,
@@ -313,5 +317,4 @@ const props = defineProps({
     },
   },
 });
-
 </script>

+ 173 - 128
src/views/base/skill/components/edit-skill.vue

@@ -2,12 +2,11 @@
   <div class="mainContentBox">
     <avue-form
       ref="formRef"
-      v-model="form"
       v-model:search="search"
+      v-model="form"
       :data="data2"
       :option="option2"
-    >
-    </avue-form>
+    />
     <avue-crud
       ref="crudRef"
       v-model="form"
@@ -18,15 +17,8 @@
       @row-del="deleteRow"
     >
       <template #menu-left="{ size }">
-        <el-button
-          circle
-          icon="el-icon-plus"
-          type="primary"
-          @click="addSkill"
-        ></el-button
-        >
-      </template>
-
+        <el-button type="primary" icon="el-icon-plus" circle @click="addSkill"
+      /></template>
     </avue-crud>
     <CommonTable
       ref="ctableRef"
@@ -35,22 +27,24 @@
       @selected-sure="onSelectedFinish"
     />
     <div class="detail-footer">
-      <el-button type="primary" @click="onHandle"> 确定</el-button>
+      <el-button type="primary" @click="onHandle"> 确定 </el-button>
       <el-button @click="cancelWindow">取消</el-button>
-
     </div>
   </div>
 </template>
 <script setup>
-import {ref, getCurrentInstance} from "vue";
-import {useCrud} from "@/hooks/userCrud";
-import {useCommonStoreHook, useDictionaryStore} from "@/store";
+import { ref, getCurrentInstance } from "vue";
+import { useCrud } from "@/hooks/userCrud";
+import { useCommonStoreHook, useDictionaryStore } from "@/store";
 import dictDataUtil from "@/common/configs/dictDataUtil";
-
-const {isShowTable, tableType} = toRefs(useCommonStoreHook());
-import {getPostSkill, addEmployeeSkill, getSkillDetail} from "@/api/system/skill";
+const { isShowTable, tableType } = toRefs(useCommonStoreHook());
+import {
+  getPostSkill,
+  addEmployeeSkill,
+  getSkillDetail,
+} from "@/api/system/skill";
 // 数据字典相关
-const {dicts} = useDictionaryStore();
+const { dicts } = useDictionaryStore();
 
 const test = () => {
   isShowTable.value = true;
@@ -59,15 +53,21 @@ const test = () => {
 const data3 = ref([]);
 const data2 = ref(null);
 // 传入一个url,后面不带/
-const {form, data, option, search, page, toDeleteIds, Methords, Utils} =
+const { form, data, option, search, page, toDeleteIds, Methords, Utils } =
   useCrud({
     src: "/api/v1/sys/skillScore",
     dataListUrl: "/api/v1/sys/skillScore/list",
   });
-const {dataList, createRow, updateRow, deleteRow, searchChange, dataNoPageList} =
-  Methords; //增删改查
-const {selectionChange, multipleDelete} = Methords; //选中和批量删除事件
-const {checkBtnPerm, downloadTemplate, exportData} = Utils; //按钮权限等工具
+const {
+  dataList,
+  createRow,
+  updateRow,
+  deleteRow,
+  searchChange,
+  dataNoPageList,
+} = Methords; //增删改查
+const { selectionChange, multipleDelete } = Methords; //选中和批量删除事件
+const { checkBtnPerm, downloadTemplate, exportData } = Utils; //按钮权限等工具
 // checkBtnPerm(ButtonPermKeys.PLAN.BTNS.order_add) :permission="permission"
 // const permission = reactive({
 //   delBtn: checkPerm(buttonPermission.PLAN.BTNS.order_del),
@@ -80,25 +80,25 @@ const ctableRef = ref(null); //crudRef.value 获取avue-crud对象
 const router = useRouter();
 onMounted(() => {
   // console.log("crudRef", crudRef)
-  getSkillDetail(props.skillId).then(
-    (data) => {
-      form.value = data.data;
-    }
-  )
+  getSkillDetail(props.skillId).then((data) => {
+    form.value = data.data;
+  });
   search.value.employeeSkillId = props.skillId;
   dataList();
-
-
 });
 
 const skillChange = (row) => {
-  if (skillValue.value !== undefined && skillValue.value !== null && skillValue.value !== "") {
+  if (
+    skillValue.value !== undefined &&
+    skillValue.value !== null &&
+    skillValue.value !== ""
+  ) {
     data.value[row.$index].skillDictValue = skillValue.value;
   }
-}
+};
 const cancelWindow = () => {
   props.editDialog.visible = false;
-}
+};
 const addSkill = () => {
   const bom = ref({
     $cellEdit: true,
@@ -107,15 +107,23 @@ const addSkill = () => {
 };
 const employeeSkill = ref({});
 const onHandle = () => {
-  console.info(form.value);
-  if (form.value.userId === null || form.value.userId === undefined || form.value.userId === "") {
+  console.info("dddd", data);
+  if (
+    form.value.userId === null ||
+    form.value.userId === undefined ||
+    form.value.userId === ""
+  ) {
     ElMessage({
       message: "未选择打分用户",
       type: "error",
     });
     return false;
   }
-  if (form.value.postId === null || form.value.postId === undefined || form.value.postId === "") {
+  if (
+    form.value.postId === null ||
+    form.value.postId === undefined ||
+    form.value.postId === ""
+  ) {
     ElMessage({
       message: "未选择岗位",
       type: "error",
@@ -131,14 +139,22 @@ const onHandle = () => {
   }
   if (data.value.length > 0) {
     for (let i = 0; i < data.value.length; i++) {
-      if (data.value[i].skillDictValue === undefined || data.value[i].skillDictValue === null || data.value[i].skillDictValue === "") {
+      if (
+        data.value[i].skillDictValue === undefined ||
+        data.value[i].skillDictValue === null ||
+        data.value[i].skillDictValue === ""
+      ) {
         ElMessage({
           message: "第" + (i + 1) + "项没有选择技能",
           type: "error",
         });
         return false;
       }
-      if (data.value[i].score === undefined || data.value[i].score === null || data.value[i].score === "") {
+      if (
+        data.value[i].score === undefined ||
+        data.value[i].score === null ||
+        data.value[i].score === ""
+      ) {
         ElMessage({
           message: "第" + (i + 1) + "项没有打分",
           type: "error",
@@ -151,24 +167,21 @@ const onHandle = () => {
   employeeSkill.value.postId = form.value.postId;
   employeeSkill.value.skillList = Array.from(data.value);
   employeeSkill.value.id = form.value.id;
-  addEmployeeSkill(employeeSkill.value).then(
-    (data) => {
-      if (data.code === "200") {
-        ElMessage({
-          message: data.msg,
-          type: "success",
-        });
-        props.editDialog.visible = false;
-      } else {
-        ElMessage({
-          message: data.msg,
-          type: "error",
-        });
-      }
+  addEmployeeSkill(employeeSkill.value).then((data) => {
+    if (data.code === "200") {
+      ElMessage({
+        message: data.msg,
+        type: "success",
+      });
+      props.editDialog.visible = false;
+    } else {
+      ElMessage({
+        message: data.msg,
+        type: "error",
+      });
     }
-  )
-
-}
+  });
+};
 // 设置表格列或者其他自定义的option
 option2.value = {
   selection: true,
@@ -177,37 +190,53 @@ option2.value = {
   emptyBtn: false,
   column: [
     {
-      label: "id", prop: "id", width: 130, overHidden: true, search: true,
+      label: "id",
+      prop: "id",
+      width: 130,
+      overHidden: true,
+      search: true,
       filterable: true,
+      width: 100,
+      overHidden: true,
       disabled: false,
       display: false,
-
     },
 
     {
-      label: "用户id", prop: "userId", width: 130, overHidden: true, search: true,
+      label: "用户id",
+      prop: "userId",
+      width: 130,
+      overHidden: true,
+      search: true,
       filterable: true,
       disabled: true,
       display: false,
-
     },
     {
-      label: "用户名", prop: "userName", width: 140, overHidden: true, search: true, rules: [{
-        required: true,
-        search: true,
-        message: "请选择员工姓名",
-        trigger: "blur"
-      }],
-      click: ({value, column}) => {
+      label: "用户名",
+      prop: "userName",
+      width: 140,
+      overHidden: true,
+      search: true,
+      rules: [
+        {
+          required: true,
+          search: true,
+          message: "请选择员工姓名",
+          trigger: "blur",
+        },
+      ],
+      click: ({ value, column }) => {
         ctableRef.value.startSelect();
       },
     },
-   /* {
-      label: "所属机构", prop: "institution", width: 130, overHidden: true, search: true,
+    /* {
+      label: "所属机构",
+      prop: "institution",
+      width: 130,
+      overHidden: true,
+      search: true,
       filterable: true,
-      width: 100, overHidden: true,
-      disabled: true,
-
     },*/
     {
       label: "员工编号",
@@ -216,29 +245,17 @@ option2.value = {
       disabled: true,
     },
     {
-      label: "岗位", prop: "postName",
+      label: "岗位",
+      prop: "postName",
       search: true,
       filterable: true,
       overHidden: true,
       disabled: true,
       dicUrl: dictDataUtil.post_list_url,
       dicMethod: "post",
-      change: ({value, column}) => {
-        if (value !== undefined) {
-          props.postId = value;
-          skillValue.value = null;
-          optionSkill.value = null;
-          dataNoPageList();
-        }
-      },
-      props: {label: "postName", value: "id"},
-
+      props: { label: "postName", value: "id" },
     },
-    {
-      label: "所属机构", prop: "deptName", overHidden: true,
-      disabled: true,
-    },
-
+    { label: "所属机构", prop: "deptName", overHidden: true, disabled: true },
   ],
 };
 const postIdValue = ref({});
@@ -248,23 +265,24 @@ const props = defineProps({
     type: Object,
     default: () => {
       return {};
-    }
+    },
   },
   skillId: {
     type: String,
     default: () => {
       return "0";
-    }
+    },
   },
   postId: {
     type: Number,
     default: () => {
       return "0";
-    }
-  }
-
-})
+    },
+  },
+});
 const postIdSkill = ref({});
+
+const focusedElement = ref(null);
 // 设置表格列或者其他自定义的option
 option.value = Object.assign(option.value, {
   selection: false,
@@ -274,59 +292,91 @@ option.value = Object.assign(option.value, {
   saveBtn: false,
 
   cellBtn: true,
-  column: [{
-    label: "技能",
-    prop: "skillDictValue",
-    align: 'center',
-    headerAlign: 'center',
-    span: 24,
-    cell: true,
-    type: 'select',
-    dicUrl: import.meta.env.VITE_APP_BASE_API + "/api/v1/sys/postSkill/list/" + props.postId,
-    props: {
-      label: "skillDictLabel", // 下拉菜单显示的字段
-      value: "skillDictValue", // 下拉菜单值的字段
+  column: [
+    {
+      label: "技能",
+      prop: "skillDictValue",
+      align: "center",
+      headerAlign: "center",
+      span: 24,
+      cell: true,
+      type: "select",
+      dicUrl:
+        import.meta.env.VITE_APP_BASE_API +
+        "/api/v1/sys/postSkill/list/" +
+        props.postId,
+      props: {
+        label: "skillDictLabel", // 下拉菜单显示的字段
+        value: "skillDictValue", // 下拉菜单值的字段
+      },
+      change: function (value, row) {
+        nextTick(() => {
+          focusedElement.value.blur();
+        });
+      },
+      focus: function (row) {
+        focusedElement.value = row.event.target;
+      },
+      blur: function (row) {
+        if (
+          data.value
+            .filter((value, index) => {
+              return index != row.index;
+            })
+            .map((item, index) => {
+              return item.skillDictValue;
+            })
+            .includes(row.value)
+        ) {
+          ElMessage({
+            message: row.row.$skillDictValue + " 打分项重复",
+            type: "error",
+          });
+          row.row.skillDictValue = "";
+          row.row.$skillDictValue = "";
+          row.value = "";
+        }
+      },
     },
-  },
     {
       label: "分数",
       prop: "score",
-      align: 'center',
-      headerAlign: 'center',
+      align: "center",
+      headerAlign: "center",
       cell: true,
       type: "number",
       precision: 2,
       max: 100,
       min: 0,
       span: 24,
-    },],
+    },
+  ],
 });
 const onSelectedFinish = (selectedValue) => {
   form.value.userId = selectedValue.id;
-
   form.value.userName = selectedValue.userName;
   form.value.deptName = selectedValue.deptName;
   form.value.employeeCode = selectedValue.employeeCode;
   //form.value.institution = selectedValue.institution;
-
-}
+};
 const skillValue = ref(null);
 const optionSkill = ref([]);
 const getPostSkills = () => {
-  if (postIdValue.value === undefined || postIdValue.value === null || postIdValue.value === "") {
+  if (
+    postIdValue.value === undefined ||
+    postIdValue.value === null ||
+    postIdValue.value === ""
+  ) {
     ElMessage({
       message: "未选择岗位",
       type: "error",
     });
     return false;
   }
-  getPostSkill(postIdValue.value).then(
-    (data) => {
-      optionSkill.value = Array.from(data.data);
-    }
-  )
-}
-
+  getPostSkill(postIdValue.value).then((data) => {
+    optionSkill.value = Array.from(data.data);
+  });
+};
 </script>
 <style type="text/css">
 .title-detail {
@@ -336,23 +386,18 @@ const getPostSkills = () => {
   margin: 25px 20px 25px 0;
   float: left;
 }
-
 .detail {
   margin: 0 auto;
   width: 100%;
 }
-
 .avue-crud {
   float: left;
 }
-
 .detail-footer {
   float: right;
   margin-top: 15px;
 }
-
 .el-select__selection {
   width: 150px;
 }
-
 </style>

+ 201 - 161
src/views/base/skill/components/user-skill.vue

@@ -14,8 +14,7 @@
       @size-change="dataList"
       @current-change="dataList"
       @selection-change="selectionChange"
-    >
-    </avue-form>
+    />
     <avue-crud
       ref="crudRef"
       v-model="form"
@@ -26,26 +25,24 @@
       @row-update="updateRow"
       @row-del="deleteRow"
     >
-      <template #skillDictValue="{row,index,type}">
-        <el-select v-model="skillValue" placeholder="请选择技能" @click="getPostSkills()" @change="skillChange(row)">
+      <template #skillDictValue="{ row, index, type }">
+        <el-select
+          v-model="row.skillValue"
+          placeholder="请选择技能"
+          @click="getPostSkills()"
+          @change="skillChange(row)"
+        >
           <el-option
             v-for="item in optionSkill"
             :key="item.value"
             :label="item.skillDictLabel"
             :value="item.skillDictValue"
-          >
-          </el-option>
+          />
         </el-select>
       </template>
       <template #menu-left="{ size }">
-        <el-button
-          type="primary"
-          icon="el-icon-plus"
-          circle
-          @click="addSkill"
-        ></el-button
-        ></template>
-
+        <el-button type="primary" icon="el-icon-plus" circle @click="addSkill"
+      /></template>
     </avue-crud>
     <CommonTable
       ref="ctableRef"
@@ -56,17 +53,18 @@
     <div class="detail-footer">
       <el-button type="primary" @click="onHandle"> 确定 </el-button>
       <el-button @click="cancelWindow">取消</el-button>
-
     </div>
   </div>
 </template>
 <script setup>
 import { ref, getCurrentInstance } from "vue";
 import { useCrud } from "@/hooks/userCrud";
+import ButtonPermKeys from "@/common/configs/buttonPermission";
 import { useCommonStoreHook, useDictionaryStore } from "@/store";
 import dictDataUtil from "@/common/configs/dictDataUtil";
+import SingleUpload from "@/components/Upload/SingleUpload.vue";
 const { isShowTable, tableType } = toRefs(useCommonStoreHook());
-import {getPostSkill,addEmployeeSkill} from "@/api/system/skill";
+import { getPostSkill, addEmployeeSkill } from "@/api/system/skill";
 // 数据字典相关
 const { dicts } = useDictionaryStore();
 
@@ -74,14 +72,20 @@ const test = () => {
   isShowTable.value = true;
   tableType.value = tableType.value == 1 ? 2 : 1;
 };
-const data2=ref(null);
+const data2 = ref(null);
 // 传入一个url,后面不带/
 const { form, data, option, search, page, toDeleteIds, Methords, Utils } =
   useCrud({
     src: "/api/v1/sys/skillScore",
   });
-const { dataList, createRow, updateRow, deleteRow, searchChange, dataNoPageList } =
-  Methords; //增删改查
+const {
+  dataList,
+  createRow,
+  updateRow,
+  deleteRow,
+  searchChange,
+  dataNoPageList,
+} = Methords; //增删改查
 const { selectionChange, multipleDelete } = Methords; //选中和批量删除事件
 const { checkBtnPerm, downloadTemplate, exportData } = Utils; //按钮权限等工具
 // checkBtnPerm(ButtonPermKeys.PLAN.BTNS.order_add) :permission="permission"
@@ -91,236 +95,272 @@ const { checkBtnPerm, downloadTemplate, exportData } = Utils; //按钮权限等
 //   editBtn: checkPerm(buttonPermission.PLAN.BTNS.order_edit),
 //   menu: true,
 // });
-const option2=ref(null);
+const option2 = ref(null);
 const ctableRef = ref(null); //crudRef.value 获取avue-crud对象
 const router = useRouter();
 
 onMounted(() => {
   // console.log("crudRef", crudRef)
   //dataNoPageList();
-
 });
-const skillChange=(row)=>{
-  if(skillValue.value!==undefined&&skillValue.value!==null&&skillValue.value!==""){
-    data.value[row.$index].skillDictValue=skillValue.value;
+const skillChange = (row) => {
+  if (
+    row.skillValue !== undefined &&
+    row.skillValue !== null &&
+    row.skillValue !== ""
+  ) {
+    data.value[row.$index].skillDictValue = row.skillValue;
   }
-}
-const cancelWindow=()=>{
-  props.dialog.visible=false;
-}
+  console.log(data.value);
+};
+const cancelWindow = () => {
+  props.dialog.visible = false;
+};
 const addSkill = () => {
-  const bom=ref({
-    $cellEdit:true,
+  const bom = ref({
+    $cellEdit: true,
   });
   data.value.push(bom.value);
 };
-const employeeSkill=ref({});
-const onHandle=()=>{
+const employeeSkill = ref({});
+const onHandle = () => {
   console.info(form.value);
-  if(form.value.userId===null||form.value.userId===undefined||form.value.userId===""){
+  if (
+    form.value.userId === null ||
+    form.value.userId === undefined ||
+    form.value.userId === ""
+  ) {
     ElMessage({
       message: "未选择打分用户",
       type: "error",
     });
     return false;
   }
-  if(form.value.postId===null||form.value.postId===undefined||form.value.postId===""){
+  if (
+    form.value.postId === null ||
+    form.value.postId === undefined ||
+    form.value.postId === ""
+  ) {
     ElMessage({
       message: "未选择岗位",
       type: "error",
     });
     return false;
   }
-  console.info("data",data.value);
-  if(data.value.length===0){
+  console.info("data", data.value);
+  if (data.value.length === 0) {
     ElMessage({
       message: "没有要保存的打分项",
       type: "error",
     });
     return false;
   }
-  if(data.value.length>0){
-    for(let i=0;i<data.value.length;i++){
-      if(data.value[i].skillDictValue===undefined||data.value[i].skillDictValue===null||data.value[i].skillDictValue===""){
+  if (data.value.length > 0) {
+    for (let i = 0; i < data.value.length; i++) {
+      if (
+        data.value[i].skillDictValue === undefined ||
+        data.value[i].skillDictValue === null ||
+        data.value[i].skillDictValue === ""
+      ) {
         ElMessage({
-          message: "第"+(i+1)+"项没有选择技能",
+          message: "第" + (i + 1) + "项没有选择技能",
           type: "error",
         });
         return false;
       }
-      if(data.value[i].score===undefined||data.value[i].score===null||data.value[i].score===""){
+      if (
+        data.value[i].score === undefined ||
+        data.value[i].score === null ||
+        data.value[i].score === ""
+      ) {
         ElMessage({
-          message: "第"+(i+1)+"项没有打分",
+          message: "第" + (i + 1) + "项没有打分",
           type: "error",
         });
         return false;
       }
     }
   }
-  employeeSkill.value.userId=form.value.userId;
-  employeeSkill.value.postId=form.value.postId;
-  employeeSkill.value.skillList=Array.from(data.value);
-  console.info("11",employeeSkill.value)
-  addEmployeeSkill(employeeSkill.value).then(
-    (data)=>{
-      if(data.code==="200") {
-        ElMessage({
-          message: data.msg,
-          type: "success",
-        });
-        props.dialog.visible=false;
-      }
-      else {
-        ElMessage({
-          message: data.msg,
-          type: "error",
-        });
-      }
+  employeeSkill.value.userId = form.value.userId;
+  employeeSkill.value.postId = form.value.postId;
+  employeeSkill.value.skillList = Array.from(data.value);
+  console.info("11", employeeSkill.value);
+  addEmployeeSkill(employeeSkill.value).then((data) => {
+    if (data.code === "200") {
+      ElMessage({
+        message: data.msg,
+        type: "success",
+      });
+      props.dialog.visible = false;
+    } else {
+      ElMessage({
+        message: data.msg,
+        type: "error",
+      });
     }
-  )
-
-}
+  });
+};
 
-const postIdValue=ref(null);
+const postIdValue = ref(null);
 // 设置表格列或者其他自定义的option
 option2.value = {
   selection: true,
-  submitBtn:false,
-  clearAbleBtn:false,
-  emptyBtn:false,
+  submitBtn: false,
+  clearAbleBtn: false,
+  emptyBtn: false,
   column: [
-
-    { label: "用户id", prop: "userId", width: 130,overHidden: true,search: true ,
+    {
+      label: "用户id",
+      prop: "userId",
+      width: 130,
+      overHidden: true,
+      search: true,
       filterable: true,
-      disabled:true,
-      display:false,
+      disabled: true,
+      display: false,
     },
-    { label: "用户名", prop: "userName", width: 140,overHidden: true,search: true ,rules: [{
-        required: true,
-        search: true,
-        message: "请选择员工姓名",
-        trigger: "blur"
-      }],
+    {
+      label: "用户名",
+      prop: "userName",
+      width: 140,
+      overHidden: true,
+      search: true,
+      rules: [
+        {
+          required: true,
+          search: true,
+          message: "请选择员工姓名",
+          trigger: "blur",
+        },
+      ],
       click: ({ value, column }) => {
         ctableRef.value.startSelect();
-      },},
-    { label: "所属机构", prop: "deptName", width: 130,overHidden: true,search: true ,
-      filterable: true,
-      disabled:true,
+      },
     },
+    /*{
+          label: "所属机构",
+          prop: "institution",
+          width: 130,
+          overHidden: true,
+          search: true,
+          filterable: true,
+          disabled: true,
+        },*/
     {
       label: "员工编号",
       prop: "employeeCode",
       search: true,
-      disabled:true,
+      disabled: true,
     },
-    { label: "岗位", prop: "postId",
+    {
+      label: "岗位",
+      prop: "postId",
       search: true,
       filterable: true,
       type: "select",
       overHidden: true,
-      dicUrl:dictDataUtil.post_list_url,
-      dicMethod:"post",
-      change:({ value, column })=>{
-       if(value!==undefined) {
-         postIdValue.value = value;
-         skillValue.value=null;
-         optionSkill.value=null;
-       }
+      dicUrl: dictDataUtil.post_list_url,
+      dicMethod: "post",
+      change: ({ value, column }) => {
+        if (value !== undefined) {
+          postIdValue.value = value;
+          data.value = [];
+          optionSkill.value = null;
+        }
       },
       props: { label: "postName", value: "id" },
-
     },
-  /*  { label: "部门", prop: "deptName", overHidden: true,
-      disabled:true, },*/
+    { label: "部门", prop: "deptName", overHidden: true, disabled: true },
   ],
 };
 
 const props = defineProps({
-  dialog:{
-    type:Object,
-    default:()=>{
+  dialog: {
+    type: Object,
+    default: () => {
       return {};
-    }
-  }
-})
+    },
+  },
+});
 // 设置表格列或者其他自定义的option
-option.value = Object.assign(option.value,{
+option.value = Object.assign(option.value, {
   selection: false,
   addBtn: false,
   viewBtn: false,
-  editBtn:false,
-  saveBtn:false,
+  editBtn: false,
+  saveBtn: false,
+
   cellBtn: true,
-  column: [{
-    label: "技能",
-    prop: "skillDictValue",
-    align: 'center',
-    headerAlign: 'center',
-    span:24,
-    type: 'select',
-    dicData:dicts.skill_type,
-    props: { label: "dictLabel", value: "dictValue" },
-  },
+  column: [
+    {
+      label: "技能",
+      prop: "skillDictValue",
+      align: "center",
+      headerAlign: "center",
+      span: 24,
+      type: "select",
+      dicData: dicts.skill_type,
+      props: { label: "dictLabel", value: "dictValue" },
+    },
     {
       label: "分数",
       prop: "score",
-      align: 'center',
-      headerAlign: 'center',
+      align: "center",
+      headerAlign: "center",
       cell: true,
-      type:"number",
+      type: "number",
       precision: 2,
-      max:100,
-      min:0,
-      span:24,
-    },],
+      max: 100,
+      min: 0,
+      span: 24,
+    },
+  ],
 });
-const onSelectedFinish=(selectedValue)=>{
-  form.value.userId=selectedValue.id;
-  form.value.userName=selectedValue.userName;
-  form.value.deptName=selectedValue.deptName;
-  form.value.employeeCode=selectedValue.employeeCode;
-  form.value.institution=selectedValue.institution;
-}
-const skillValue=ref(null);
-const optionSkill=ref([]);
-const getPostSkills=()=>{
-  if(postIdValue.value===undefined||postIdValue.value===null||postIdValue.value===""){
+const onSelectedFinish = (selectedValue) => {
+  form.value.userId = selectedValue.id;
+  form.value.userName = selectedValue.userName;
+  form.value.deptName = selectedValue.deptName;
+  form.value.employeeCode = selectedValue.employeeCode;
+  //form.value.institution = selectedValue.institution;
+};
+const optionSkill = ref([]);
+const getPostSkills = () => {
+  if (
+    postIdValue.value === undefined ||
+    postIdValue.value === null ||
+    postIdValue.value === ""
+  ) {
     ElMessage({
       message: "未选择岗位",
       type: "error",
     });
     return false;
   }
-  getPostSkill(postIdValue.value).then(
-    (data)=>{
-      optionSkill.value=Array.from(data.data);
-    }
-  )
-}
-
+  getPostSkill(postIdValue.value).then((data) => {
+    optionSkill.value = Array.from(data.data);
+  });
+};
 </script>
 <style type="text/css">
-  .title-detail{
-    width: 30%;
-    height: 50px;
-    line-height: 50px;
-    margin: 25px 20px 25px 0;
-    float: left;
-  }
-  .detail{
-    margin: 0 auto;
-    width: 100%;
-  }
-  .avue-crud{
-    float: left;
-  }
-  .detail-footer{
-    float: right;
-    margin-top:15px;
-  }
-  .el-select__selection{
-    width: 150px;
-  }
-
+.title-detail {
+  width: 30%;
+  height: 50px;
+  line-height: 50px;
+  margin: 25px 20px 25px 0;
+  float: left;
+}
+.detail {
+  margin: 0 auto;
+  width: 100%;
+}
+.avue-crud {
+  float: left;
+}
+.detail-footer {
+  float: right;
+  margin-top: 15px;
+}
+.el-select__selection {
+  width: 150px;
+}
 </style>

+ 10 - 1
src/views/device/instance/index.vue

@@ -10,6 +10,7 @@
       @row-save="createRow"
       @row-update="updateRow"
       @row-del="deleteRow"
+      :permission="permission"
       @search-change="searchChange"
       @search-reset="resetChange"
       @size-change="dataList"
@@ -31,7 +32,7 @@
       </template>-->
       <template #menu="{ size, row, index }">
         <el-button
-          v-hasPerm="[buttonPermission.DEVICE.BTNS.maintenance_edit]"
+          v-hasPerm="[buttonPermission.DEVICE.BTNS.instance_edit]"
           type="primary"
           link
           size="small"
@@ -48,6 +49,7 @@
           type="danger"
           icon="el-icon-delete"
           :size="size"
+          v-hasPerm="[buttonPermission.DEVICE.BTNS.instance_del]"
           @click="multipleDelete"
           >删除</el-button
         >
@@ -152,6 +154,7 @@ import { useCommonStoreHook } from "@/store";
 import ChoiceWorkshopPage from "../../plan/workOrder/components/choice-workshop-page.vue";
 import ChoiceStationPage from "./components/choice-station-page.vue";
 import dictDataUtil from "@/common/configs/dictDataUtil";
+import { checkPerm } from "@/directive/permission";
 const { isShowTable, tableType } = toRefs(useCommonStoreHook());
 const test = () => {
   isShowTable.value = true;
@@ -166,6 +169,12 @@ const addItem = () => {
     type: 1,
   });
 };
+const permission = reactive({
+  delBtn: checkPerm(buttonPermission.DEVICE.BTNS.instance_del),
+  addBtn: checkPerm(buttonPermission.DEVICE.BTNS.instance_add),
+  editBtn: checkPerm(buttonPermission.DEVICE.BTNS.instance_edit),
+  menu: true,
+});
 const minusItem = (row) => {
   pageData.value = pageData.value.filter(
     (item) => item.fieldCode !== row.fieldCode

+ 14 - 0
src/views/plan/order/components/order-page.vue

@@ -102,6 +102,20 @@ option.value = Object.assign(option.value, {
       prop: "materialModel",
     },
     {
+      label: "订单数量",
+      prop: "orderNum",
+      type: "number",
+      width: "100",
+      min: 1,
+      max: 99999,
+    },
+    {
+      label: "排产数量",
+      prop: "scheduledNum",
+      width: "100",
+      display: false,
+    },
+    {
       label: "产品版本",
       width: 130,
       overHidden: true,

+ 1 - 1
src/views/pro/traceability/components/traceabilityCom.vue

@@ -47,7 +47,7 @@ const { checkBtnPerm, downloadTemplate, exportData } = Utils; //按钮权限等
 const crudRef = ref(null); //crudRef.value 获取avue-crud对象
 
 const refreshTra = (row) => {
-  commonConfig.value.params = { seqNo: row.seqNo };
+  commonConfig.value.params = { seqNo: row.seqNo,workOrderCode: row.workOrderCode };
   dataList();
 };
 defineExpose({ refreshTra });

+ 23 - 10
src/views/pro/traceability/index.vue

@@ -13,11 +13,11 @@
           @search-change="searchChange"
           @size-change="dataList"
           @current-change="dataList"
-      
+
         >
           <template #seqNo="{ row }">
-            <el-tag :type="chooseTagType(row.seqNo, 'css')">{{
-              chooseTagType(row.seqNo, "text")
+            <el-tag :type="chooseTagType(row.level, 'css')">{{
+              chooseTagType(row.level, "text")
             }}</el-tag>
             {{ row.seqNo }}
           </template>
@@ -40,7 +40,7 @@
             }}</el-descriptions-item>
             <el-descriptions-item label="铭牌号">-</el-descriptions-item>
             <el-descriptions-item label="是否返工">
-              <el-tag size="small"></el-tag>
+              <el-tag size="small">{{productReviewInfo.rework}}</el-tag>
             </el-descriptions-item>
             <el-descriptions-item label="工单出站">{{
               productReviewInfo.outNum
@@ -48,6 +48,9 @@
             <el-descriptions-item label="交付日期">{{
               productReviewInfo.planStartEnd
             }}</el-descriptions-item>
+            <el-descriptions-item label="工单报故">
+              <el-tag size="small">{{productReviewInfo.bug}}</el-tag>
+            </el-descriptions-item>
           </el-descriptions>
         </el-header>
         <el-main>
@@ -208,15 +211,15 @@ const tabsEvent = (pane, ev) => {
 const chooseTagType = (row, type) => {
   let daynamicType = "";
   if (type == "text") {
-    daynamicType = row.startsWith("DD")
+    daynamicType = row === 'order'
       ? "订单"
-      : row.startsWith("GD")
+      : row === 'workOrder'
         ? "工单"
         : "流转卡号";
   } else {
-    daynamicType = row.startsWith("DD")
+    daynamicType = row === 'order'
       ? "success"
-      : row.startsWith("GD")
+      : row === 'workOrder'
         ? "warning"
         : "primary";
   }
@@ -231,6 +234,8 @@ let productReviewInfo = reactive({
   planStartEnd: "",
   workOrderCode: "",
   outNum: "",
+  rework: "-",
+  bug: "-"
 });
 
 let tabCount = reactive({
@@ -244,13 +249,21 @@ let tabCount = reactive({
 });
 
 const handleCellClick = (row, column, event) => {
+  if(row.level === 'order'){
+    productReviewInfo.bug = '-'
+  }
+  if(row.orderType){
+    productReviewInfo.rework = row.orderType === '2' ? '是' : '否'
+  }
   //获取出单的数量
   if (data.value) {
     for (let topTree of data.value) {
       if (topTree) {
         for (let secondTree of topTree.children) {
           if (row.workOrderCode == secondTree.workOrderCode) {
+            productReviewInfo.rework = topTree.orderType === '2' ? '是' : '否'
             productReviewInfo.outNum = secondTree.children.length;
+            productReviewInfo.bug = secondTree.bugNum === 0 ? '否' : '是'
           }
         }
       }
@@ -265,7 +278,7 @@ const handleCellClick = (row, column, event) => {
       tabNameComRef.get(defaultTabName.value)?.value.refreshTra(temRow.value);
     }
     //每次点击都要获取tab页面的数量
-    traceabilityTabCount({ seqNo: row.seqNo }).then(({ data }) => {
+    traceabilityTabCount({workOrderCode: row.workOrderCode, seqNo: row.seqNo }).then(({ data }) => {
       tabCount = Object.assign(tabCount, data);
     });
     if (row.workOrderCode == productReviewInfo.workOrderCode) {
@@ -273,7 +286,7 @@ const handleCellClick = (row, column, event) => {
       return;
     }
     //产品信息
-    getMaterialDetailsByseqNo(row.seqNo).then(({ data }) => {
+    getMaterialDetailsByseqNo(row.workOrderCode,row.seqNo).then(({ data }) => {
       productReviewInfo = Object.assign(productReviewInfo, data);
       productReviewInfo.workOrderCode = row.workOrderCode;
       // productReviewInfo.outNum =

+ 38 - 32
src/views/report/productionScheduling/line/index.vue

@@ -25,12 +25,22 @@ import "dhtmlx-gantt/codebase/dhtmlxgantt.css";
 import html2canvas from "html2canvas";
 import { htmlPdf } from "@/utils/htmlPDF.js";
 import { useCrud } from "@/hooks/userCrud";
+import { v4 as uuidv4 } from "uuid";
 const ganttRef = ref(null);
-const { form, data, option, search, page, toDeleteIds, Methords, Utils } =
-  useCrud({
-    src: "/api/v1/process/census/productLineApsResultGant",
-    pageStr: "no",
-  });
+const {
+  form,
+  data,
+  option,
+  search,
+  page,
+  toDeleteIds,
+  Methords,
+  Utils,
+  lines,
+} = useCrud({
+  src: "/api/v1/process/census/productLineApsResultGant",
+  pageStr: "no",
+});
 const exportToPDF = () => {
   var fileName = "甘特图pdf";
   const fileList = document.getElementsByClassName("gantt_here");
@@ -217,27 +227,9 @@ const initGantt = (type) => {
     {
       tree: true,
       name: "text",
-      label: "订单名称",
+      label: "产线名称",
       width: "240",
     },
-    {
-      name: "startTime",
-      label: "开始时间",
-      align: "center",
-      width: "160",
-      template(task) {
-        return task.startTime;
-      },
-    },
-    {
-      name: "endTime",
-      label: "结束时间",
-      align: "center",
-      width: "160",
-      template(task) {
-        return task.endTime;
-      },
-    },
   ];
   gantt.config.autofit = true;
   gantt.config.resize_rows = true;
@@ -248,10 +240,10 @@ const initGantt = (type) => {
   gantt.config.readonly = true; //是否只读
   gantt.i18n.setLocale("cn"); //设置语言
   gantt.templates.tooltip_text = function (start, end, task) {
-    const text = `名称: ${task.text}<br/>总数: ${task.num}<br/>完成进度: ${task.progress * 100}%`;
-    return !task.parent
-      ? `${text}<br/>交期时间: ${task.deliverWhen}`
-      : `${text}<br/>计划开始时间: ${task.startTime}<br/>计划结束时间: ${task.endTime}`; // eslint-disable-line
+    const text = `产线名称: ${task.name}`;
+    return task.parent
+      ? `名称: ${task.text}<br/>完成进度: ${task.progress * 100}%<br/>计划开始时间: ${task.startTime}<br/>计划结束时间: ${task.endTime}`
+      : `${text}<br/>`;
   };
   const dateToStr = gantt.date.date_to_str(gantt.config.task_date);
   const today = new Date(new Date().setHours(0, 0, 0, 0));
@@ -412,9 +404,11 @@ const setGantt = () => {
   }
 };
 const useData = ref([]);
-const setUseData = (data) => {
+const setUseData = (data, lines) => {
   useData.value = [];
-  const data1 = [...data];
+  const reslinedata = ref([]);
+  const data1 = JSON.parse(JSON.stringify(data));
+  const line1 = JSON.parse(JSON.stringify(lines));
   data1.forEach((element) => {
     element.start_date = element.startTime;
     if (element.progress != 1) {
@@ -422,9 +416,21 @@ const setUseData = (data) => {
     } else {
       element.color = "green";
     }
+    element.id = uuidv4();
+    element.parent = element.productLineId;
   });
   const data2 = JSON.parse(JSON.stringify(data1));
-  useData.value = data2;
+  line1.forEach((element) => {
+    let obj = {};
+    obj.id = element.productLineId;
+    obj.name = element.productLineName;
+    obj.text = element.productLineName;
+    obj.render = "split";
+    reslinedata.value.push(obj);
+  });
+  const data3 = JSON.parse(JSON.stringify(reslinedata.value));
+  const data4 = [...data3, ...data2];
+  useData.value = data4;
 };
 onMounted(() => {
   setTime();
@@ -435,7 +441,7 @@ watch(
   () => data.value,
   () => {
     if (data.value) {
-      setUseData(data.value);
+      setUseData(data.value, lines.value);
       setGantt();
     }
   },