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

增加用章 提交附件

xiao-xx 2 місяців тому
батько
коміт
ca8df0b15b

+ 34 - 1
src/views/clocking/contSeal.vue

@@ -111,6 +111,19 @@
                     ></el-input>
                   </el-col>
                 </el-form-item>
+                <el-form-item  label="附件信息:">
+                  <el-upload
+                      ref="fujianUpload"
+                      v-model:file-list="fujian"
+                      :action="upload.url"
+                      :headers="upload.headers"
+                      :limit="1"
+                      :on-success="uploadFuJianFiles1"
+                      multiple
+                  >
+                    <el-button type="primary">点击上传附件</el-button>
+                  </el-upload>
+                </el-form-item>
                 <el-form-item prop="signetCopies" label="盖章份数:">
                   <el-col :span="24">
                     <el-input
@@ -290,6 +303,7 @@
 
 <script>
 import { addCar } from "@/api/car";
+import { getToken } from "@/utils/auth";
 import {
   generNextStepNode,
   generNextStepAllNode,
@@ -348,6 +362,12 @@ export default {
     return {
       signet_type: useDict("signet_type").signet_type,
       defaultTime: new Date(2000, 1, 1, 12, 0, 0),
+      upload: {
+        // 设置上传的请求头部
+        headers: { Authorization: "Bearer " + getToken() },
+        // 上传的地址
+        url: import.meta.env.VITE_APP_BASE_API + "/system/file/fileupload",
+      },
       optionsData: [
         {
           value: "选项1",
@@ -384,6 +404,7 @@ export default {
         params: {},
       },
       options: [],
+      fujian: [],
       leaveTime: "",
       formRules: {
         createBy: [
@@ -500,6 +521,7 @@ export default {
     onSubmit() {
       this.$refs["ruleFormRef"].validate((valid) => {
         this.form.useTime = this.form1.useTime;
+        this.form.fileId = this.fujian[0].response.data.fileId;
         this.form.signetType = this.form1.signetType;
         this.form.usingReason = this.form1.usingReason;
         this.form.activeSend = this.form1.activeSend;
@@ -579,4 +601,15 @@ export default {
 };
 </script>
 
-<style lang="scss" scoped></style>
+<style lang="scss" scoped>
+::v-deep .el-upload-list__item {
+  transition: all .5s cubic-bezier(.55,0,.1,1);
+  font-size: 14px;
+  color: var(--el-text-color-regular);
+  margin-bottom: 5px;
+  position: relative;
+  box-sizing: border-box;
+  border-radius: 4px;
+  width: 200px;
+}
+</style>

+ 36 - 9
src/views/clocking/sealApplication.vue

@@ -121,6 +121,19 @@
                     ></el-input>
                   </el-col>
                 </el-form-item>
+                <el-form-item  label="附件信息:">
+                  <el-upload
+                      ref="fujianUpload"
+                      v-model:file-list="fujian"
+                      :action="upload.url"
+                      :headers="upload.headers"
+                      :limit="1"
+                      :on-success="uploadFuJianFiles1"
+                      multiple
+                  >
+                    <el-button type="primary">点击上传附件</el-button>
+                  </el-upload>
+                </el-form-item>
                 <el-form-item prop="signetCopies" label="盖章份数:">
                   <el-col :span="24">
                     <el-input
@@ -148,14 +161,7 @@
                           :value="item.NodeID"
                       /></el-select>
                     </el-form-item>
-                    <el-form-item label="销假日期:">
-                      <el-date-picker
-                        v-model="valDate"
-                        type="date"
-                        placeholder="请选择销假日期"
-                        :size="size"
-                      />
-                    </el-form-item>
+
                   </div>
                   <div v-else>
                     <el-form-item
@@ -300,6 +306,7 @@
 
 <script>
 import { addCar } from "@/api/car";
+import { getToken } from "@/utils/auth";
 import {
   generNextStepNode,
   generNextStepAllNode,
@@ -380,6 +387,12 @@ export default {
           label: "值班司机",
         },
       ],
+      upload: {
+        // 设置上传的请求头部
+        headers: { Authorization: "Bearer " + getToken() },
+        // 上传的地址
+        url: import.meta.env.VITE_APP_BASE_API + "/system/file/fileupload",
+      },
       value: "",
       deptOptions: undefined,
       flowDatas: {
@@ -393,6 +406,7 @@ export default {
         params: {},
       },
       options: [],
+      fujian: [],
       leaveTime: "",
       formRules: {
         createBy: [
@@ -477,6 +491,7 @@ export default {
     onSubmit() {
       this.$refs["ruleFormRef"].validate((valid) => {
         this.form.useTime = this.form1.useTime;
+        this.form.fileId = this.fujian[0].response.data.fileId;
         this.form.signetType = this.form1.signetType;
         this.form.usingReason = this.form1.usingReason;
         this.form.activeSend = this.form1.activeSend;
@@ -553,4 +568,16 @@ export default {
 };
 </script>
 
-<style lang="scss" scoped></style>
+
+<style lang="scss" scoped>
+::v-deep .el-upload-list__item {
+  transition: all .5s cubic-bezier(.55,0,.1,1);
+  font-size: 14px;
+  color: var(--el-text-color-regular);
+  margin-bottom: 5px;
+  position: relative;
+  box-sizing: border-box;
+  border-radius: 4px;
+  width: 200px;
+}
+</style>

+ 15 - 0
src/views/liucheng/todowork/formView/contSeal.vue

@@ -127,6 +127,18 @@
                         ></el-input>
                       </el-col>
                     </el-form-item>
+
+                    <el-form-item label="附件信息:">
+                      <el-link
+                          v-if="form.fuJianFile!=null"
+                          type="primary"
+                          @click="openFujianFile(form.fuJianFile.url)">
+                        <el-icon class="el-icon--left">
+                          <Document />
+                        </el-icon>
+                        {{ form.fuJianFile.name }}
+                      </el-link>
+                    </el-form-item>
                     <el-form-item prop="signetCopies" label="盖章份数:">
                       <el-col :span="24">
                         <el-input
@@ -557,6 +569,9 @@ export default {
           this.$message.success("修改进度评价成功");
         }
       );
+    },
+     openFujianFile(url) {
+      window.open(url, "_blank");
     },
     getInfo() {
       getInfo().then((res) => {

+ 15 - 0
src/views/liucheng/todowork/formView/sealApplicational.vue

@@ -142,6 +142,18 @@
                         ></el-input>
                       </el-col>
                     </el-form-item>
+
+                    <el-form-item label="附件信息:">
+                      <el-link
+                          v-if="form.fuJianFile!=null"
+                          type="primary"
+                          @click="openFujianFile(form.fuJianFile.url)">
+                        <el-icon class="el-icon--left">
+                          <Document />
+                        </el-icon>
+                        {{ form.fuJianFile.name }}
+                      </el-link>
+                    </el-form-item>
                     <el-form-item prop="signetCopies" label="盖章份数:">
                       <el-col :span="24">
                         <el-input
@@ -616,6 +628,9 @@ export default {
         this.deptOptions = response.data;
       });
     },
+    openFujianFile(url) {
+      window.open(url, "_blank");
+    },
     sumbitSupervise() {
       sendFlowToNext;
     },

+ 2 - 2
src/views/offcial/mysupervision/index.vue

@@ -87,12 +87,12 @@
     </el-form>
 
     <el-row :gutter="10" class="mb8">
-      <el-col :span="1.5">
+      <el-col :span="1.5" v-hasPermi="['offcial:supervision:add']">
         <el-button type="success" plain icon="Select" @click="submitSelect"
           >提交</el-button
         >
       </el-col>
-      <el-col :span="1.5">
+      <el-col :span="1.5" v-hasPermi="['offcial:supervision:add']">
         <el-button type="primary" plain icon="plus" @click="addDuban"
           >添加</el-button
         >