WINDOWS-7IFQK7E\EDY 1 rok temu
rodzic
commit
d9175432be
3 zmienionych plików z 35 dodań i 21 usunięć
  1. 0 1
      src/stores/user.js
  2. 23 11
      src/views/cjxt/tjdj/index.vue
  3. 12 9
      src/views/xsczda/xslb/index.vue

Plik diff jest za duży
+ 0 - 1
src/stores/user.js


+ 23 - 11
src/views/cjxt/tjdj/index.vue

@@ -147,6 +147,15 @@
             value-format="yyyy-MM-dd"
             clearable
           />
+          <el-upload
+            action="#"
+            :show-file-list="false"
+            :http-request="httpRequest"
+            :file-list="FILE_LIST"
+            style="display: inline-block; margin: 0 10px"
+          >
+            <el-button type="primary">导入</el-button>
+          </el-upload>
         </el-form-item>
       </el-form>
       <div slot="footer">
@@ -161,15 +170,8 @@
         >
           <el-button type="primary">确 定</el-button>
         </el-upload> -->
-        <el-upload
-          action="#"
-          :show-file-list="false"
-          :http-request="httpRequest"
-          :file-list="FILE_LIST"
-          style="display: inline-block; margin: 0 10px"
-        >
-          <el-button type="primary">确 定</el-button>
-        </el-upload>
+
+        <el-button type="primary" @click="formCancel">确 定</el-button>
       </div>
     </el-dialog>
   </div>
@@ -230,19 +232,30 @@ export default {
     formCancel() {
       this.dialogFormVisible = false;
     },
+
     importAll() {
       this.dialogFormVisible = true;
       this.dialogForm = {
         xdct_tjrq: this.firstForm.time[0],
       };
     },
+
     httpRequest(file) {
       const formData = new FormData();
       formData.append("token", token);
       formData.append("issubmit", "1");
       formData.append("xdct_tjrq", this.dialogForm.xdct_tjrq);
-      console.log(formData, 444444444444);
       formData.append("file", file.file);
+      console.log(formData, 444444444444);
+      if (
+        this.dialogForm.xdct_tjrq == "" ||
+        this.dialogForm.xdct_tjrq == null
+      ) {
+        return this.$message({
+          message: "请先选择日期",
+          type: "error",
+        });
+      }
       request({
         url: "/xddy/dygl_cjxt_tjdj/import_new",
         data: formData,
@@ -266,7 +279,6 @@ export default {
       val.forEach((item) => {
         this.multipleSelection.push(item.grade_id);
       });
-      console.log(this.multipleSelection, 1111);
     },
     getTimeFormat() {
       var date = new Date();

+ 12 - 9
src/views/xsczda/xslb/index.vue

@@ -87,18 +87,21 @@
             >导入模板下载</el-button
           >
         </el-form-item>
+        <el-form-item label="" prop="">
+          <el-upload
+            action="#"
+            :show-file-list="false"
+            :http-request="httpRequest"
+            :file-list="FILE_LIST"
+            style="display: inline-block; margin: 0 10px"
+          >
+            <el-button style="margin-left: -8px" type="primary">导入</el-button>
+          </el-upload></el-form-item
+        >
       </el-form>
       <div slot="footer">
         <el-button @click="formCancel">取 消</el-button>
-        <el-upload
-          action="#"
-          :show-file-list="false"
-          :http-request="httpRequest"
-          :file-list="FILE_LIST"
-          style="display: inline-block; margin: 0 10px"
-        >
-          <el-button type="primary">确 定</el-button>
-        </el-upload>
+        <el-button type="primary" @click="formCancel">确 定</el-button>
       </div>
     </el-dialog>
   </div>