Переглянути джерело

bug:修复submit提交按钮不释放,上传支持多图片,工位启用禁用

lupeng 1 рік тому
батько
коміт
c8332037bf

+ 4 - 0
src/api/station/types.ts

@@ -10,6 +10,10 @@ export interface Station {
   code?: string;
   //上级产线编码
   parentCode?: string;
+
+  //是否启用
+  enable?: string;
+
 }
 
 

+ 9 - 1
src/components/Upload/FilesUpload.vue

@@ -73,6 +73,10 @@ const props = defineProps({
     type: Array<string>,
     default: () => [],
   },
+  fileNameList: {
+    type: Array<string>,
+    default: () => [],
+  },
   generatePdf: {
     type: Boolean,
     default: false,
@@ -85,6 +89,7 @@ const emit = defineEmits([
   "update:src",
   "update:srcList",
   "update:pdfList",
+  "update:fileNameList",
   "finished",
 ]);
 
@@ -92,6 +97,7 @@ const emit = defineEmits([
 const src = useVModel(props, "src", emit); //单文件用这个
 const srcList = useVModel(props, "srcList", emit); //多文件用这个
 const pdfList = useVModel(props, "pdfList", emit); //转换成pdf后的多文件用这个
+const fileNameList=useVModel(props,"fileNameList",emit);//多文件上传要显示文件名
 
 // el-upload 绑定的值
 const fileList = ref<UploadUserFile[]>([]);
@@ -108,6 +114,7 @@ const handleChange = async (uploadFile: UploadFile) => {
       src.value = res.data.fileUrl;
       pdfList.value.push(res.data.pdfUrl);
       srcList.value.push(res.data.fileUrl);
+      fileNameList.value.push(res.data.fileName);
       emit("finished");
     })
     .catch((err) => {
@@ -120,7 +127,8 @@ const deleteFile = (index: number) => {
   src.value = ""; //删除直接清空src即可,不用考虑是哪个,因为单文件不会有多个
   fileList.value.splice(index, 1);
   srcList.value.splice(index, 1);
-  pdfList.value.splice(index,1)
+  pdfList.value.splice(index,1);
+  fileNameList.value.splice(index,1)
 };
 
 const PDFVisible = ref(false);

+ 2 - 2
src/views/base/bom/components/version-drawing.vue

@@ -63,9 +63,9 @@
   //   editBtn: checkPerm(buttonPermission.PLAN.BTNS.order_edit),
   //   menu: true,
   // });
-  function rowSave(form2,done,loading) {
+  function rowSave(form2,done) {
     form.value.materialCode=props.materialCode;
-    createRow(form,done,loading);
+    createRow(form,done,done);
 
   }
 

+ 2 - 2
src/views/base/bom/components/version-page.vue

@@ -70,9 +70,9 @@
   //   editBtn: checkPerm(buttonPermission.PLAN.BTNS.order_edit),
   //   menu: true,
   // });
-  function rowSave(form2,done,loading) {
+  function rowSave(form2,done) {
     form.value.materialCode=props.materialCode;
-    createRow(form,done,loading);
+    createRow(form,done,done);
 
   }
 

+ 8 - 4
src/views/base/bom/index.vue

@@ -37,13 +37,15 @@
           @click="openMaterial"
           >新增</el-button>
           <el-select v-model="version" placeholder="请选择BOM版本" style="width:150px;margin-left:15px" @click="openBomVersion">
-          <el-option
+
+            <el-option
             v-for="item in options"
             :key="item.value"
             :label="item.label"
             :value="item.value"
           >
           </el-option>
+
         </el-select>
 
           </div>
@@ -341,9 +343,11 @@ const queryMaterialDetail = () => {
 };
 
 const selectedFinish=(selectedValue)=> {
-
-  version.value.value=selectedValue.bomVersion;
-  version.value.label=selectedValue.bomVersion;
+  console.info(selectedValue.bomVersion);
+  if (selectedValue.bomVersion!=undefined&&selectedValue.bomVersion!=null) {
+   version.value.value = selectedValue.bomVersion;
+   version.value.label = selectedValue.bomVersion;
+ }
   search.value.bomVersion = version.value.value;
   dataNoPageList();
 }

+ 55 - 7
src/views/base/information/index.vue

@@ -19,8 +19,10 @@
       <template #drawingPath-form="scope">
 <!--        <single-upload v-model="form.drawingPath" :generatePdf="true"/>-->
         <FilesUpload
-            v-model:src="fileUrl"
+            v-model:src-list="srcList"
             v-model:pdf-list="pdfUrlList"
+            v-model:file-name-list="fileNameList"
+            :limit="10"
             :generate-pdf="true"
             @finished="testFiles"
         />
@@ -73,10 +75,14 @@ const { isShowTable, tableType } = toRefs(useCommonStoreHook());
 // 数据字典相关
 const { dicts } = useDictionaryStoreHook();
 const fileUrl = ref(""); //单文件
-const pdfUrlList = ref([])
+const pdfUrlList = ref([]);
+const srcList = ref([]);
+const fileNameList = ref([]);
 const testFiles =()=>{
-  form.value.pdfPath = pdfUrlList.value[0]
-  form.value.drawingPath = fileUrl.value
+  form.value.pdfPathList = pdfUrlList.value;
+  form.value.drawingPathList = srcList.value;
+  form.value.drawingPath = srcList.value[0];
+  form.value.fileNameList=fileNameList.value;
 }
 const filePath = import.meta.env.VITE_APP_UPLOAD_URL;
 const test = () => {
@@ -121,6 +127,7 @@ onMounted?.(() => {
 const onSelectedFinish = (selectedValue) => {
   form.value.associationCode=selectedValue.materialCode;
   form.value.associationName=selectedValue.materialCode;
+  form.value.materialCode=selectedValue.materialCode;
 };
 
 
@@ -143,17 +150,25 @@ option.value = Object.assign(option.value, {
   delBtn:false,
   menu:true,
   column: [
-    { label: "图纸编号", prop: "drawingCode", width: 180,search: true,overHidden: true ,rules: [{
+    { label: "图纸编号", prop: "drawingCode", width: 150,search: true,overHidden: true ,rules: [{
         required: true,
         message: "请填写图纸编号",
         trigger: "blur"
       }],},
-    { label: "图纸名称", prop: "drawingTitle", width: 180,overHidden: true,search: true ,rules: [{
+    { label: "图纸名称", prop: "drawingTitle", width: 150,overHidden: true,search: true ,rules: [{
         required: true,
         message: "请填写图纸名称",
         trigger: "blur"
       }],},
-    { label: "物料编号", prop: "associationCode", width: 180,search: true,overHidden: true ,editDisplay: false,
+    { label: "物料编号", prop: "associationCode", width: 150,search: true,overHidden: true ,editDisplay: false,addDisplay: false,
+      rules: [{
+        required: true,
+        message: "请填写物料编号",
+        trigger: "blur"
+      }],
+     },
+
+    { label: "物料编号", prop: "materialCode", width: 150,overHidden: true ,editDisplay: false,hide:true,
       rules: [{
         required: true,
         message: "请填写物料编号",
@@ -196,6 +211,37 @@ option.value = Object.assign(option.value, {
         trigger: "blur"
       }],
     },
+    {
+      label: "文件名称",
+      prop: "fileName",
+      span: 24,
+      width:120,
+      display:false,
+    },
+    {
+      label: "文件数组",
+      prop: "drawingPathList",
+      span: 24,
+      hide:true,
+      display:false,
+    },
+    {
+      label: "pdf数组",
+      prop: "pdfPathList",
+      span: 24,
+      hide:true,
+      display:false,
+
+    },
+
+    {
+      label: "文件名称数组",
+      prop: "fileNameList",
+      span: 24,
+      slot: true,
+      hide:true,
+      display:false,
+    },
     /*{ label: "文件",
       prop: "drawing",
       type: 'img',
@@ -220,6 +266,8 @@ option.value = Object.assign(option.value, {
     {
       label: "创建时间",
       prop: "created",
+      width:120,
+      overHidden:true,
       display:false,
     },
     { label: "启用状态",

+ 42 - 4
src/views/base/materials/components/drawing-page.vue

@@ -4,8 +4,10 @@
       <template #drawingPath="scope">
         <!--        <single-upload v-model="form.drawingPath" :generatePdf="true"/>-->
         <FilesUpload
-          v-model:src="fileUrl"
+          v-model:src-list="srcList"
           v-model:pdf-list="pdfUrlList"
+          v-model:file-name-list="fileNameList"
+          :limit="10"
           :generate-pdf="true"
           @finished="testFiles"
         />
@@ -75,8 +77,10 @@ const test = () => {
   tableType.value = tableType.value == 1 ? 2 : 1;
 };
 const testFiles =()=>{
-  form.value.pdfPath = pdfUrlList.value[0]
-  form.value.drawingPath = fileUrl.value
+  form.value.pdfPathList = pdfUrlList.value;
+  form.value.drawingPathList = srcList.value;
+  form.value.drawingPath = srcList.value[0];
+  form.value.fileNameList=fileNameList.value;
 }
 // 传入一个url,后面不带/
 const { form, data, option, search, page, toDeleteIds, Methords, Utils } =
@@ -101,6 +105,8 @@ const version=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"){
@@ -109,7 +115,7 @@ const getVersionDrawing=()=>{
     dataList();
   }
 }
-function rowSave(form,done,loading) {
+function rowSave(form,done) {
   form.associationCode = props.materialCode;
   form.associationName=props.materialName;
   console.info("formRef.value",done);
@@ -128,6 +134,7 @@ function rowSave(form,done,loading) {
           message: data.msg,
           type: "error",
         });
+
       }
     }
   )
@@ -213,6 +220,37 @@ option.value = Object.assign(option.value, {
       }],
     },
     {
+      label: "文件名称",
+      prop: "fileName",
+      span: 24,
+      width:120,
+      display:false,
+    },
+    {
+      label: "文件数组",
+      prop: "drawingPathList",
+      span: 24,
+      hide:true,
+      display:false,
+    },
+    {
+      label: "pdf数组",
+      prop: "pdfPathList",
+      span: 24,
+      hide:true,
+      display:false,
+
+    },
+
+    {
+      label: "文件名称数组",
+      prop: "fileNameList",
+      span: 24,
+      slot: true,
+      hide:true,
+      display:false,
+    },
+    {
       label: "版本",
       prop: "drawingVersion",
       type: "number",

+ 36 - 2
src/views/base/modeling/station/index.vue

@@ -16,6 +16,19 @@
       @current-change="dataList"
       @selection-change="selectionChange"
     >
+      <template #enable="scope">
+        <el-switch
+          active-value="1"
+          inactive-value="0"
+          inline-prompt
+          active-text="启用"
+          inactive-text="禁用"
+          v-model="scope.row.enable"
+          @click="changeItem(scope.row)"
+          class="ml-2"
+          style="--el-switch-on-color: #13ce66; --el-switch-off-color: #ff4949"
+        />
+      </template>
       <template #menu-left="{ size }">
         <el-button
           :disabled="toDeleteIds.length < 1"
@@ -56,7 +69,7 @@
   import { useCrud } from "@/hooks/userCrud";
   import ButtonPermKeys from "@/common/configs/buttonPermission";
   import { useCommonStoreHook } from "@/store";
-
+  import { updateStation } from "@/api/station";
   const { isShowTable, tableType } = toRefs(useCommonStoreHook());
   import { useDictionaryStoreHook } from "@/store";
   const { dicts } = useDictionaryStoreHook();
@@ -118,7 +131,21 @@
   }
   const onSelectedFinish=(selectedValue)=>{
     form.value.manager=selectedValue.userName;
-    form.value.managerId=selectedValue.userId;
+    form.value.managerId=selectedValue.id;
+  }
+  const stationUpdate=ref({});
+  const changeItem=(row)=>{
+    stationUpdate.value.id=row.id;
+    stationUpdate.value.enable=row.enable;
+    updateStation(stationUpdate.value).then((data) => {
+      dataList();
+      ElMessage({
+        message: data.msg,
+        type: "success",
+      });
+
+    });
+
   }
   // 设置表格列或者其他自定义的option
   option.value = Object.assign(option.value, {
@@ -236,6 +263,13 @@
         }],
 
       },
+      { label: "启用状态",
+        slot:true,
+        headerAlign: 'center',
+        prop: "enable",
+        width: 100,
+        display: false
+      },
       {
         label: "工位描述",
         width:90,

+ 1 - 0
src/views/plan/order/index.vue

@@ -241,6 +241,7 @@ option.value = {
       type: "select", //类型为下拉选择框
       width: 100,
       overHidden: true,
+      editDisabled:true,
       dicUrl: dictDataUtil.request_url + dictDataUtil.TYPE_CODE.plan_order_type,
       props: {
         label: "dictLabel",

src/views/report/statistics/stationBeat/index.vue → src/views/report/statistics/stationbeat/index.vue