Browse Source

treeshaking

谢杰标 2 years ago
parent
commit
8fe3550c54
4 changed files with 47 additions and 519 deletions
  1. 0 294
      src/components/AccountTag/index.vue
  2. 0 194
      src/components/quickLogin/index.vue
  3. 0 3
      src/main.js
  4. 47 28
      src/views/financed/arap/index.vue

+ 0 - 294
src/components/AccountTag/index.vue

@@ -1,294 +0,0 @@
-<template>
-  <div id="AccountTag">
-    <el-dialog
-      :visible.sync="dialogVisible"
-      width="460px"
-      :show-close="false"
-      :close-on-click-modal="false"
-    >
-      <div slot="title" class="hearders">
-        <div class="leftTitle">
-          {{
-            stice == 1
-              ? "学习完成状态标记"
-              : stice == 4
-              ? "学习账号开通状态标记"
-              : stice == 3
-              ? "移除学员"
-              : ""
-          }}
-        </div>
-        <div class="rightBoxs">
-          <img
-            src="@/assets/images/Close@2x.png"
-            alt=""
-            @click="dialogVisible = false"
-          />
-        </div>
-      </div>
-      <div>
-        <ul>
-          <li
-            v-for="(item, index) in allCheckList"
-            :key="index"
-            class="btnLists"
-          >
-            {{ item.realname }}
-            <i
-              class="el-icon-close btnIcon"
-              v-if="allCheckList.length > 1"
-              @click="clearStudent(index)"
-            ></i>
-          </li>
-          <div style="clear: both"></div>
-          <p>
-            {{
-              stice == 1
-                ? "请对以上所选学员进行学习完成状态标记:"
-                : stice == 3
-                ? "是否移除所选中的学员?"
-                : stice == 4
-                ? "请对以上所选学员进行账号开通状态标记:"
-                : ""
-            }}
-          </p>
-          <div style="text-align: center">
-            <el-radio-group v-model="finishStatusOS" v-if="stice == 1">
-              <el-radio :label="1">已学完</el-radio>
-              <el-radio :label="0">未学完</el-radio>
-            </el-radio-group>
-            <el-radio-group
-              v-model="finishStatusOS"
-              v-if="stice == 4"
-              @change="failReason = ''"
-            >
-              <el-radio :label="1">已开通</el-radio>
-              <el-radio :label="0">未开通</el-radio>
-              <el-radio :label="2">标记失败</el-radio>
-            </el-radio-group>
-          </div>
-          <div v-if="stice == 4 && finishStatusOS === 2">
-            <p>失败原因:</p>
-            <el-input type="textarea" v-model="failReason"></el-input>
-          </div>
-        </ul>
-      </div>
-      <span slot="footer" class="dialog-footer">
-        <el-button @click="dialogVisible = false">取 消</el-button>
-        <el-button type="primary" @click="submit">确 定</el-button>
-      </span>
-    </el-dialog>
-  </div>
-</template>
-
-<script>
-export default {
-  data() {
-    return {
-      dialogVisible: false,
-      stice: "",
-      allCheckList: [],
-      finishStatusOS: "",
-      failReason: "",
-    };
-  },
-  methods: {
-    clearStudent(index) {
-      this.allCheckList.splice(index, 1);
-    },
-    openBox(int, array, status) {
-      this.stice = int;
-      this.allCheckList = JSON.parse(JSON.stringify(array));
-      this.finishStatusOS = "";
-      if (status) {
-        this.initData();
-      }
-      this.dialogVisible = true;
-    },
-    /**
-     * 修改回填
-     */
-    initData() {
-      if (this.stice === 1) {
-        this.finishStatusOS = this.allCheckList[0].finishStatus;
-      }
-      if (this.stice === 4) {
-        this.finishStatusOS = this.allCheckList[0].learnStatus;
-        if (this.finishStatusOS === 2) {
-          this.failReason = this.allCheckList[0].reason;
-        }
-      }
-    },
-    submit() {
-      if (!this.allCheckList.length) {
-        this.dialogVisible = false;
-        return;
-      }
-      let ars = [];
-      this.allCheckList.map((item) => {
-        ars.push(item.id);
-      });
-      let data = {
-        id: ars,
-      };
-      if (this.stice === 1 || this.stice === 4) {
-        if (this.stice === 1) {
-          if (this.finishStatusOS !== 0 && this.finishStatusOS !== 1) {
-            this.$message.warning("请进行学习完成状态标记");
-            return;
-          }
-        }
-        if (this.stice === 4) {
-          if (
-            this.finishStatusOS !== 0 &&
-            this.finishStatusOS !== 1 &&
-            this.finishStatusOS !== 2
-          ) {
-            this.$message.warning("请选择账号开通状态标记");
-            return;
-          }
-        }
-        if (this.stice === 1) {
-          data.finishStatus = this.finishStatusOS;
-        }
-        if (this.stice === 4) {
-          data.learnStatus = this.finishStatusOS;
-          if (this.finishStatusOS === 2) {
-            if (!this.failReason) {
-              this.$message.error("请填写失败原因");
-              return;
-            }
-            data.reason = this.failReason;
-          }
-        }
-      }
-      if (this.stice === 3) {
-        data.status = 0;
-      }
-      this.$api.editGradeUserGradegrade(data).then((res) => {
-        this.$message.success("成功");
-        this.$emit("successFuncBack");
-        this.dialogVisible = false;
-      });
-    },
-  },
-};
-</script>
-
-<style lang="less" scoped>
-.dis__s {
-  margin-bottom: 14px;
-  display: flex;
-  align-items: center;
-  justify-content: space-between;
-}
-.btnLists {
-  float: left;
-  border: 1px solid #333;
-  padding: 0px 10px;
-  margin-right: 10px;
-  margin-bottom: 10px;
-  border-radius: 4px;
-  height: 30px;
-  line-height: 30px;
-  .btnIcon {
-    cursor: pointer;
-    transition: all 0.2s;
-    &:hover {
-      color: blue;
-    }
-  }
-}
-/deep/.el-button {
-  border-radius: 8px;
-}
-/deep/.el-dialog {
-  border-radius: 8px;
-  .el-dialog__header {
-    padding: 0;
-    .hearders {
-      height: 40px;
-      display: flex;
-      align-items: center;
-      justify-content: space-between;
-      padding: 0px 18px 0px 20px;
-      border-bottom: 1px solid #e2e2e2;
-      .leftTitle {
-        font-size: 14px;
-        font-weight: bold;
-        color: #2f4378;
-      }
-      .rightBoxs {
-        display: flex;
-        align-items: center;
-        img {
-          width: 14px;
-          height: 14px;
-          margin-left: 13px;
-          cursor: pointer;
-        }
-      }
-    }
-  }
-  .el-dialog__footer {
-    padding: 0;
-    .dialog-footer {
-      padding: 0px 40px;
-      height: 70px;
-      border-top: 1px solid #e2e2e2;
-      display: flex;
-      align-items: center;
-      justify-content: flex-end;
-    }
-  }
-}
-.imgBox {
-  width: 100%;
-  // height: 210px;
-  border: 1px solid #e2e2e2;
-  border-radius: 8px;
-  padding: 8px 8px 3px;
-  display: flex;
-  flex-direction: column;
-  align-items: center;
-  .imgLabel {
-    flex: 1;
-    width: 100%;
-    border: 1px dotted #e2e2e2;
-    color: #999;
-    font-size: 14px;
-    cursor: pointer;
-    border-radius: 8px;
-    .msPhoto {
-      display: flex;
-      justify-content: center;
-      align-items: center;
-      max-width: 100%;
-      max-height: 270px;
-      img {
-        max-width: 100%;
-        max-height: 270px;
-      }
-    }
-    .imgbbx {
-      display: flex;
-      flex-direction: column;
-      align-items: center;
-      justify-content: center;
-      width: 100%;
-      height: 100%;
-      i {
-        font-weight: bold;
-        margin: 14px 0;
-        font-size: 24px;
-      }
-    }
-  }
-  p {
-    margin: 5px 0px;
-  }
-}
-/deep/.radioTables > .el-radio__label {
-  display: none;
-}
-</style>

+ 0 - 194
src/components/quickLogin/index.vue

@@ -1,194 +0,0 @@
-<template>
-  <div id="quickLogin">
-    <el-dialog
-      @closed="loadingClose"
-      :visible.sync="dialogVisible"
-      width="500px"
-      :show-close="false"
-      :close-on-click-modal="false"
-    >
-      <div slot="title" class="hearders">
-        <div class="leftTitle">快捷验证登录:</div>
-        <div class="rightBoxs">
-          <img
-            src="@/assets/images/Close@2x.png"
-            alt=""
-            @click="dialogVisible = false"
-          />
-        </div>
-      </div>
-      <div>
-        <el-form
-          label-position="right"
-          label-width="100px"
-          :model="formLabelAlign"
-          :rules="rules"
-          ref="formLabelAlign"
-        >
-          <el-form-item label="验证码:" prop="yzm">
-            <el-input v-model="formLabelAlign.yzm"
-              ><el-button
-                type="text"
-                slot="append"
-                @click="getCode"
-                :disabled="changeStatus"
-                >{{
-                  changeStatus ? `倒计时${time}秒` : "获取验证码"
-                }}</el-button
-              ></el-input
-            >
-          </el-form-item>
-          <el-form-item label="密码:" prop="password">
-            <el-input v-model="formLabelAlign.password"></el-input>
-          </el-form-item>
-        </el-form>
-      </div>
-      <span slot="footer" class="dialog-footer">
-        <el-button @click="dialogVisible = false">取 消</el-button>
-        <el-button
-          type="primary"
-          @click="submitForm('formLabelAlign')"
-          :loading="disabledBtn"
-          >确 定</el-button
-        >
-      </span>
-    </el-dialog>
-  </div>
-</template>
-
-<script>
-export default {
-  data() {
-    return {
-      loading: false,
-      size: "small",
-      dialogVisible: false,
-      disabledBtn: false,
-      list: [],
-      formLabelAlign: {},
-      time: 120,
-      setFunc: null,
-      changeStatus: false,
-      rules: {
-        yzm: [{ required: true, message: "请输入验证码", trigger: "blur" }],
-        password: [{ required: true, message: "请输入密码", trigger: "blur" }],
-      },
-    };
-  },
-  methods: {
-    /**
-     * 获取验证码
-     */
-    getCode() {
-      this.changeStatus = true;
-      this.$api
-        .gradesendCode()
-        .then((res) => {
-          this.$message.success("验证码已发送");
-          this.setFunc = setInterval(() => {
-            this.time--;
-            if (this.time <= 0) {
-              clearInterval(this.setFunc);
-              this.time = 120;
-              this.changeStatus = false;
-            }
-          }, 1000);
-        })
-        .finally(() => {
-          this.changeStatus = false;
-        });
-    },
-    loadingClose() {
-      this.$refs.formLabelAlign.resetFields();
-      this.disabledBtn = false;
-      this.list = [];
-    },
-    /**
-     * status 从有接口数据标记进来 false 班级学员进来 true
-     */
-    openBoxs(arr, goodsId, status = true) {
-      if (status) {
-        this.$api.obtainGoods(goodsId).then((res) => {
-          if (res.data.categoryName) {
-            this.list = arr.map((item) => {
-              return {
-                id: item.id,
-                realname: item.realname,
-                idCard: item.idCard,
-                telphone: item.telPhone,
-                workTypeName: res.data.categoryName,
-              };
-            });
-            this.dialogVisible = true;
-          } else {
-            this.$message.error("请前往商品列表编辑设置该商品专业");
-            return;
-          }
-        });
-      } else {
-        const CHECKNAME = arr.every((item) => {
-          return item.categoryName != null;
-        });
-        if (!CHECKNAME) {
-          this.$message.error("勾选的商品必须设置专业");
-          return;
-        }
-        const GFSTATUS = arr.every((item) => {
-          return item.learnStatus !== 1;
-        });
-        if (!GFSTATUS) {
-          this.$message.error("勾选的数据不能包含账号标记已开通的数据");
-          return;
-        }
-        this.list = arr.map((item) => {
-          return {
-            id: item.id,
-            realname: item.realname,
-            idCard: item.idCard,
-            telphone: item.telPhone,
-            workTypeName: item.categoryName,
-          };
-        });
-        this.dialogVisible = true;
-      }
-    },
-    submitForm(formName) {
-      this.$refs[formName].validate((valid) => {
-        if (valid) {
-          this.submitApi();
-        } else {
-          console.log("error submit!!");
-          return false;
-        }
-      });
-    },
-    submitApi() {
-      this.disabledBtn = true;
-      let data = {
-        studyAccountStatusQueryBos: this.list,
-        trainYear: new Date().getFullYear(),
-      };
-      data = Object.assign(data, this.formLabelAlign);
-      this.$api
-        .gradeOpenQdyAccount(data)
-        .then((res) => {
-          this.$message.success("开通成功");
-          this.$emit("backData");
-          this.dialogVisible = false;
-        })
-        .finally(() => {
-          this.disabledBtn = false;
-        });
-    },
-  },
-};
-</script>
-
-<style lang="less" scoped>
-/deep/ .el-input-group__append {
-  background-color: #fff;
-  width: 100px;
-  text-align: center;
-  color: #409eff;
-}
-</style>

+ 0 - 3
src/main.js

@@ -32,8 +32,6 @@ import RightToolbar from "@/components/RightToolbar"
 import Editor from "@/components/Editor"
 // 文件上传组件
 import FileUpload from "@/components/FileUpload"
-// 图片上传组件
-import ImageUpload from "@/components/ImageUpload"
 // 字典标签组件
 import DictTag from '@/components/DictTag'
 // 头部标签组件
@@ -66,7 +64,6 @@ Vue.component('BaseDialog', BaseDialog)
 Vue.component('RightToolbar', RightToolbar)
 Vue.component('Editor', Editor)
 Vue.component('FileUpload', FileUpload)
-Vue.component('ImageUpload', ImageUpload)
 const fontRate = {
   CHAR_RATE: 1.1, // 汉字比率
   NUM_RATE: 0.65, // 数字

+ 47 - 28
src/views/financed/arap/index.vue

@@ -26,7 +26,7 @@
       :loading="loading"
     >
       <template slot="customize">
-        <el-button @click="() => {}" type="primary"> 导出excel </el-button>
+        <el-button @click="batchExport" type="primary"> 导出excel </el-button>
       </template>
       <template slot="pcost" slot-scope="props">
         <div>税收:40%</div>
@@ -70,7 +70,7 @@ export default {
     return {
       loading: false, //当前表单加载是否加载动画
       navText: {
-        title: "成本模板",
+        title: "应收应付",
         index: 0,
         ch: "条",
         num: true,
@@ -84,30 +84,6 @@ export default {
           title: "配置下单填选模板",
         },
       },
-      //搜索
-      formList: [
-        {
-          prop: "status1",
-          placeholder: "账款状态",
-          scope: "select",
-          options: [
-            { label: "不限", value: 2 },
-            { label: "已结清", value: 1 },
-            { label: "未结清", value: 0 },
-          ],
-        },
-        {
-          prop1: "classStartTime",
-          prop2: "classEndTime",
-          placeholder1: "开始时间",
-          placeholder2: "结束时间",
-          scope: "moreDataPicker",
-        },
-        {
-          prop: "name",
-          placeholder: "机构/业务号",
-        },
-      ],
       formData: {
         pageSize: 10,
         pageNum: 1,
@@ -277,10 +253,15 @@ export default {
     this.search();
   },
   methods: {
+    batchExport() {
+      let len = this.$refs.tableList.allCheckData.length;
+      if (!len) {
+        return this.$message.warning("请先勾应收应付");
+      }
+      const ids = this.$refs.tableList.allCheckData.map((item) => item.id);
+    },
     changeSearch() {
       this.init();
-      console.log(this.$refs["tableList"])
-      this.$refs["tableList"].initTR();
     },
     handelClick() {
       this.dialogVisible = false;
@@ -319,6 +300,44 @@ export default {
     tableSet() {
       return this["tableSet" + this.radio1];
     },
+    formList() {
+      let data = [
+        {
+          prop: "status1",
+          placeholder: "账款状态",
+          scope: "select",
+          options: [
+            { label: "不限", value: 2 },
+            { label: "已结清", value: 1 },
+            { label: "未结清", value: 0 },
+          ],
+        },
+        {
+          prop1: "classStartTime",
+          prop2: "classEndTime",
+          placeholder1: "开始时间",
+          placeholder2: "结束时间",
+          scope: "moreDataPicker",
+        },
+        {
+          prop: "name",
+          placeholder: "机构/业务号",
+        },
+      ];
+      if (this.radio1 != 1) {
+        data.unshift({
+          prop: "status1",
+          placeholder: "角色选择",
+          scope: "select",
+          options: [
+            { label: "不限", value: 2 },
+            { label: "已结清", value: 1 },
+            { label: "未结清", value: 0 },
+          ],
+        });
+      }
+      return data;
+    },
   },
 };
 </script>