panhui 4 年 前
コミット
907dec9d43

+ 1 - 1
src/main/h5/src/plugins/http.js

@@ -4,7 +4,7 @@ import qs from "qs";
 let baseUrl = "http://localhost:8080";
 switch (process.env.NODE_ENV) {
   case "development":
-    // baseUrl = "http://wlj.izouma.com";
+    // baseUrl = "https://wljtest.izouma.com";
     baseUrl = 'http://localhost:8080';
     break;
   case "test":

+ 5 - 0
src/main/h5/src/router/index.js

@@ -14,6 +14,11 @@ const routes = [
     name: "home",
     component: () => import("../views/Home.vue")
   },
+  {
+    path: "/trainingInstitution",
+    name: "trainingInstitution",
+    component: () => import("../views/TrainingInstitution.vue")
+  },
   {
     path: "/login",
     name: "login",

+ 396 - 0
src/main/h5/src/views/TrainingInstitution.vue

@@ -0,0 +1,396 @@
+<template>
+  <div class="page">
+    <van-form @submit="submit" :submit-on-enter="false">
+      <van-popover v-model="showPopover">
+        <template #reference>
+          <van-field
+            name="企业名称"
+            label="企业名称"
+            placeholder="请输入企业名称"
+            v-model="form.name"
+            :rules="[{ required: true, message: '请填写企业名称' }]"
+            @change="like"
+          />
+        </template>
+
+        <van-cell-group>
+          <van-cell
+            v-for="item in list"
+            :key="item.id"
+            :title="item.name"
+            :label="item.uscc"
+            @click="choose(item)"
+          />
+        </van-cell-group>
+      </van-popover>
+      <van-field
+        name="注册号"
+        label="注册号"
+        placeholder="请输入注册号"
+        v-model="form.uscc"
+        @change="changeUsscc"
+        :rules="[{ required: true, message: '请填写注册号' }]"
+      />
+      <template v-if="form.id">
+        <van-field
+          type="textarea"
+          name="经营范围"
+          label="经营范围"
+          placeholder="请输入经营范围"
+          v-model="form.businessScope"
+          autosize
+        />
+        <van-field
+          name="企业住所"
+          label="企业住所"
+          placeholder="请输入企业住所"
+          v-model="form.address"
+        />
+        <van-field
+          name="生产经营场所"
+          label="生产经营场所"
+          placeholder="请输入生产经营场所"
+          v-model="form.businessPremise"
+        />
+        <van-field
+          name="生产法人姓名"
+          label="生产法人姓名"
+          placeholder="请输入生产法人姓名"
+          v-model="form.privacyPolicy"
+          :rules="[{ required: true, message: '请填写生产法人姓名' }]"
+        />
+        <van-field
+          type="tel"
+          maxlength="11"
+          name="生产短信号码"
+          label="生产短信号码"
+          placeholder="请输入短信号码"
+          v-model="form.phone"
+          :rules="[{ required: true, message: '请填写短信号码' }]"
+        />
+        <van-field
+          type="digit"
+          name="企业联系方式"
+          label="企业联系方式"
+          placeholder="请输入企业联系方式"
+          v-model="form.contactPhone"
+          :rules="[{ required: true, message: '请填写企业联系方式' }]"
+        />
+        <van-field
+          name="企业联系方式"
+          label="企业联系方式"
+          placeholder="请输入企业联系方式"
+          v-model="form.contactPhone"
+        />
+        <van-field
+          name="所属管区"
+          label="所属管区"
+          placeholder="请输入所属管区"
+          v-model="form.district"
+        />
+        <van-field
+          name="注册资本"
+          label="注册资本(万)"
+          placeholder="请输入注册资本"
+          v-model="form.registeredCapital"
+        />
+        <van-field
+          name="单位性质"
+          label="单位性质"
+          placeholder="请输入单位性质"
+          v-model="form.category"
+        />
+        <van-field
+          name="专业种类"
+          label="专业种类"
+          placeholder="请输入专业种类"
+          v-model="form.specialty"
+        />
+        <van-field
+          type="digit"
+          name="培训点数量三楼及以下"
+          label="培训点数量三楼及以下"
+          placeholder="请输入培训点数量三楼及以下"
+          v-model="form.trainingSite"
+        />
+        <van-field
+          type="digit"
+          name="培训点数量四楼及以上"
+          label="培训点数量四楼及以上"
+          placeholder="请输入培训点数量四楼及以上"
+          v-model="form.trainingSiteFour"
+        />
+        <van-field
+          type="number"
+          name="总面积"
+          label="总面积"
+          placeholder="请输入总面积"
+          v-model="form.area"
+        />
+        <van-field
+          type="digit"
+          name="教室数量"
+          label="教室数量"
+          placeholder="请输入教室数量"
+          v-model="form.trainingSiteFour"
+          :rules="[{ required: true, message: '请填写教室数量' }]"
+        />
+        <van-field
+          type="digit"
+          name="教师总数"
+          label="教师总数"
+          placeholder="请输入教师总数"
+          v-model="form.teacherNum"
+          :rules="[{ required: true, message: '请填写教师总数' }]"
+        />
+        <van-field
+          type="digit"
+          name="专职数量"
+          label="专职数量"
+          placeholder="请输入专职数量"
+          v-model="form.fullTimeNum"
+          :rules="[{ required: true, message: '请填写专职数量' }]"
+        />
+        <van-field
+          type="digit"
+          name="兼职数量"
+          label="兼职数量"
+          placeholder="请输入兼职数量"
+          v-model="form.partTimeNum"
+          :rules="[{ required: true, message: '请填写兼职数量' }]"
+        />
+        <van-field
+          type="digit"
+          name="音乐类"
+          label="音乐类"
+          placeholder="请输入音乐类"
+          v-model="form.musicNum"
+          :rules="[{ required: true, message: '请填写音乐类' }]"
+        />
+        <van-field
+          type="digit"
+          name="舞蹈类"
+          label="舞蹈类"
+          placeholder="请输入舞蹈类"
+          v-model="form.danceNum"
+          :rules="[{ required: true, message: '请填写舞蹈类' }]"
+        />
+        <van-field
+          type="digit"
+          name="美术类"
+          label="美术类"
+          placeholder="请输入美术类"
+          v-model="form.artNum"
+          :rules="[{ required: true, message: '请填写美术类' }]"
+        />
+        <van-field
+          type="digit"
+          name="戏剧戏曲"
+          label="戏剧戏曲"
+          placeholder="请输入戏剧戏曲"
+          v-model="form.theatreOperaNum"
+          :rules="[{ required: true, message: '请填写戏剧戏曲' }]"
+        />
+        <van-field
+          type="digit"
+          name="曲艺类"
+          label="曲艺类"
+          placeholder="请输入曲艺类"
+          v-model="form.folkMusicNum"
+          :rules="[{ required: true, message: '请填写曲艺类' }]"
+        />
+        <van-field
+          type="digit"
+          name="有教师资格证"
+          label="有教师资格证"
+          placeholder="请输入有教师资格证"
+          v-model="form.qualificationNum"
+          :rules="[{ required: true, message: '请填写有教师资格证' }]"
+        />
+        <van-field
+          type="digit"
+          name="年培训人数"
+          label="年培训人数"
+          placeholder="请输入年培训人数"
+          v-model="form.traineesPerYearNum"
+          :rules="[{ required: true, message: '请填写年培训人数' }]"
+        />
+        <van-field
+          name="是否是艺术水平考级考点"
+          label="是否是艺术水平考级考点"
+          placeholder="请输入是否是艺术水平考级考点"
+        >
+          <template #input>
+            <van-radio-group v-model="form.examPoint" direction="horizontal">
+              <van-radio :name="true"> 是</van-radio>
+              <van-radio :name="false">否</van-radio>
+            </van-radio-group>
+          </template>
+        </van-field>
+        <van-field
+          name="艺术水平考级机构名称"
+          label="艺术水平考级机构名称"
+          placeholder="请输入艺术水平考级机构名称"
+          v-model="form.gradingOrganization"
+        />
+        <van-field
+          type="textarea"
+          name="备注"
+          label="备注"
+          placeholder="请输入备注"
+          v-model="form.remark"
+        />
+
+        <div class="bottom">
+          <van-button
+            @click="saveWeb"
+            class="preview"
+            color="#ffcf6a"
+            block
+            round
+            native-type="button"
+            style="margin-right:12px"
+            >暂存</van-button
+          >
+          <van-button
+            class="submit"
+            round
+            block
+            type="info"
+            native-type="submit"
+            >提交</van-button
+          >
+        </div>
+      </template>
+    </van-form>
+  </div>
+</template>
+
+<script>
+export default {
+  data() {
+    return {
+      form: {
+        examPoint: false
+      },
+      list: [],
+      showPopover: false
+    };
+  },
+
+  mounted() {
+    let data = JSON.parse(
+      window.localStorage.getItem("trainingInstitution") || "{}"
+    );
+    this.form = data;
+  },
+  methods: {
+    like(info, key = "") {
+      this.$toast.loading({
+        message: "加载中...",
+        forbidClick: true,
+        duration: 0
+      });
+      this.showPopover = false;
+      let data = { search: this.form.name, size: 4, query: {} };
+      if (key) {
+        data.query[key] = this.form[key];
+      }
+      this.$http
+        .post("/trainingInstitution/all", data, { body: "json" })
+        .then(res => {
+          this.$toast.clear();
+          if (res.empty) {
+            this.$toast("暂无该企业信息");
+          } else {
+            this.list = res.content;
+            setTimeout(() => {
+              this.$nextTick(() => {
+                this.showPopover = true;
+              });
+            }, 500);
+          }
+        });
+    },
+    changeUsscc() {
+      if (!this.form.id) {
+        this.like("", "uscc");
+      }
+    },
+    choose(info) {
+      this.form = { examPoint: false, ...info };
+      this.showPopover = false;
+    },
+    submit() {
+      this.$toast.loading({
+        message: "加载中...",
+        forbidClick: true,
+        duration: 0
+      });
+      let data = { ...this.form };
+      this.$http
+        .post("/trainingInstitution/save", data, { body: "json" })
+        .then(res => {
+          this.$toast.clear();
+          this.$dialog({
+            title: "提交成功",
+            message: "信息已经提交成功,感谢您的配合。",
+            showConfirmButton: false
+          });
+        });
+    },
+    saveWeb() {
+      let data = JSON.stringify({ ...this.form });
+      window.localStorage.setItem("trainingInstitution", data);
+      this.$toast.success("暂存成功");
+    }
+  }
+};
+</script>
+
+<style lang="less" scoped>
+.page {
+  position: relative;
+  padding-bottom: 100px;
+}
+/deep/.van-field {
+  margin: 16px 16px 0;
+  width: calc(100vw - 32px);
+  border-radius: 12px;
+  flex-direction: column;
+
+  .van-field__label {
+    font-size: 18px;
+    font-weight: bold;
+    color: #313233;
+    line-height: 28px;
+    width: auto;
+  }
+  .van-field__value {
+    margin-top: 14px;
+    font-size: 16px;
+    line-height: 32px;
+  }
+}
+
+.bottom {
+  position: fixed;
+  bottom: 0;
+  left: 0;
+  right: 0;
+  padding: 6px 26px calc(env(safe-area-inset-bottom) + 6px);
+  background-color: #fff;
+  z-index: 20;
+
+  display: flex;
+
+  .preview {
+    min-width: 82px;
+    width: 82px;
+  }
+  .submit {
+    flex-grow: 1;
+    // margin-left: 13px;
+  }
+}
+</style>