|
@@ -5,7 +5,99 @@
|
|
|
<el-col :span="24" class="top">
|
|
|
<top topType="2" @back="$router.push('/')"></top>
|
|
|
</el-col>
|
|
|
- <el-col :span="24" class="info" :style="{ height: clientHeight + 'px' }"> 机构辅导 </el-col>
|
|
|
+ <el-col :span="24" class="info" :style="{ height: clientHeight + 'px' }">
|
|
|
+ <van-form @submit="onSubmit">
|
|
|
+ <van-col span="24" class="one">
|
|
|
+ <van-col span="24" class="one_txt"> 资质资料 </van-col>
|
|
|
+ <van-col span="24" class="one_info">
|
|
|
+ <van-field v-model="form.company" name="申请单位" label="申请单位" readonly />
|
|
|
+ <van-field v-model="form.apply_person" name="申请人" label="申请人" :rules="[{ required: true, message: '请填写申请人' }]" />
|
|
|
+ <van-field v-model="form.phone" name="联系电话" label="联系电话" :rules="[{ required: true, message: '请填写联系电话' }]" />
|
|
|
+ <van-field name="uploader" label="法人复印件">
|
|
|
+ <template #input>
|
|
|
+ <van-uploader
|
|
|
+ :fileList="form.qyfr"
|
|
|
+ :max-count="1"
|
|
|
+ :after-read="(file) => toUpload(file, 'qyfr')"
|
|
|
+ @delete="(file) => toDelete(file, 'qyfr')"
|
|
|
+ />
|
|
|
+ </template>
|
|
|
+ </van-field>
|
|
|
+ <van-field name="uploader" label="企业营业执照">
|
|
|
+ <template #input>
|
|
|
+ <van-uploader
|
|
|
+ :fileList="form.yyzz"
|
|
|
+ :max-count="1"
|
|
|
+ :after-read="(file) => toUpload(file, 'yyzz')"
|
|
|
+ @delete="(file) => toDelete(file, 'yyzz')"
|
|
|
+ />
|
|
|
+ </template>
|
|
|
+ </van-field>
|
|
|
+ <van-field name="uploader" label="企业利润表">
|
|
|
+ <template #input>
|
|
|
+ <van-uploader
|
|
|
+ :fileList="form.qylr"
|
|
|
+ :max-count="1"
|
|
|
+ :after-read="(file) => toUpload(file, 'qylr')"
|
|
|
+ @delete="(file) => toDelete(file, 'qylr')"
|
|
|
+ />
|
|
|
+ </template>
|
|
|
+ </van-field>
|
|
|
+ </van-col>
|
|
|
+ </van-col>
|
|
|
+ <van-col span="24" class="one">
|
|
|
+ <van-col span="24" class="one_txt"> 信息资料 </van-col>
|
|
|
+ <van-col span="24" class="one_info">
|
|
|
+ <van-field
|
|
|
+ readonly
|
|
|
+ clickable
|
|
|
+ name="picker"
|
|
|
+ :value="form.mechanism_name"
|
|
|
+ label="中介机构"
|
|
|
+ placeholder="点击选择机构"
|
|
|
+ @click="showPicker = true"
|
|
|
+ />
|
|
|
+ <van-popup v-model="showPicker" position="bottom">
|
|
|
+ <van-picker show-toolbar :columns="mechanismList" value-key="name" @confirm="onConfirm" @cancel="showPicker = false" />
|
|
|
+ </van-popup>
|
|
|
+ <van-field name="uploader" label="法人复印件">
|
|
|
+ <template #input>
|
|
|
+ <van-uploader
|
|
|
+ :fileList="form.mqyfr"
|
|
|
+ :max-count="1"
|
|
|
+ :after-read="(file) => toUpload(file, 'mqyfr')"
|
|
|
+ @delete="(file) => toDelete(file, 'mqyfr')"
|
|
|
+ />
|
|
|
+ </template>
|
|
|
+ </van-field>
|
|
|
+ <van-field name="uploader" label="企业营业执照">
|
|
|
+ <template #input>
|
|
|
+ <van-uploader
|
|
|
+ :fileList="form.myyzz"
|
|
|
+ :max-count="1"
|
|
|
+ :after-read="(file) => toUpload(file, 'myyzz')"
|
|
|
+ @delete="(file) => toDelete(file, 'myyzz')"
|
|
|
+ />
|
|
|
+ </template>
|
|
|
+ </van-field>
|
|
|
+ <van-field name="uploader" label="企业利润表">
|
|
|
+ <template #input>
|
|
|
+ <van-uploader
|
|
|
+ :fileList="form.mqylr"
|
|
|
+ :max-count="1"
|
|
|
+ :after-read="(file) => toUpload(file, 'mqylr')"
|
|
|
+ @delete="(file) => toDelete(file, 'mqylr')"
|
|
|
+ />
|
|
|
+ </template>
|
|
|
+ </van-field>
|
|
|
+ </van-col>
|
|
|
+ </van-col>
|
|
|
+ <van-col span="24" class="btn">
|
|
|
+ <van-button type="danger" round>取消提交</van-button>
|
|
|
+ <van-button type="info" round native-type="submit">确认提交</van-button>
|
|
|
+ </van-col>
|
|
|
+ </van-form>
|
|
|
+ </el-col>
|
|
|
<el-col :span="24" class="foot"> <footers /> </el-col>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
@@ -13,7 +105,11 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
+const _ = require('lodash');
|
|
|
import { mapState, createNamespacedHelpers } from 'vuex';
|
|
|
+const { mapActions: upload } = createNamespacedHelpers('upload');
|
|
|
+const { mapActions: declare } = createNamespacedHelpers('declare');
|
|
|
+const { mapActions: mechanism } = createNamespacedHelpers('mechanism');
|
|
|
export default {
|
|
|
name: 'tutor',
|
|
|
props: {},
|
|
@@ -21,14 +117,103 @@ export default {
|
|
|
data: function () {
|
|
|
return {
|
|
|
clientHeight: '',
|
|
|
+ form: {},
|
|
|
+ // 中介机构
|
|
|
+ showPicker: false,
|
|
|
+ mechanismList: [],
|
|
|
};
|
|
|
},
|
|
|
- created() {},
|
|
|
+ created() {
|
|
|
+ this.search();
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ ...upload(['upload']),
|
|
|
+ ...declare(['create']),
|
|
|
+ ...mechanism(['query']),
|
|
|
+ async search() {
|
|
|
+ if (this.user) {
|
|
|
+ let data = {
|
|
|
+ user_id: this.user.id,
|
|
|
+ company: this.user.name,
|
|
|
+ apply_person: this.user.companyperson,
|
|
|
+ phone: this.user.phone,
|
|
|
+ qyfr: [],
|
|
|
+ yyzz: [],
|
|
|
+ qylr: [],
|
|
|
+ mqyfr: [],
|
|
|
+ myyzz: [],
|
|
|
+ mqylr: [],
|
|
|
+ };
|
|
|
+ this.$set(this, `form`, data);
|
|
|
+ }
|
|
|
+ const res = await this.query();
|
|
|
+ if (this.$checkRes(res)) {
|
|
|
+ this.$set(this, 'mechanismList', res.data);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ async onSubmit() {
|
|
|
+ let data = this.form;
|
|
|
+ const material = this.resetData();
|
|
|
+ const medium_material = this.resetDataMM();
|
|
|
+ if (material.length < 3 || medium_material.length < 3) {
|
|
|
+ this.$message.error('缺少所需资料');
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ data.material = material;
|
|
|
+ data.medium_material = medium_material;
|
|
|
+ let res = await this.create(data);
|
|
|
+ if (this.$checkRes(res)) {
|
|
|
+ this.$toast({ type: 'success', message: '机构辅导申报成功,请耐心等待结果' });
|
|
|
+ } else {
|
|
|
+ this.$toast({ type: 'fail', message: '机构辅导申报失败' });
|
|
|
+ }
|
|
|
+ },
|
|
|
+ async toUpload({ file }, model) {
|
|
|
+ // 上传,赋值
|
|
|
+ const res = await this.upload({ file, dir: 'files' });
|
|
|
+ if (this.$checkRes(res)) {
|
|
|
+ this.$set(this.form, model, [{ name: res.name, url: res.uri }]);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ toDelete(file, model) {
|
|
|
+ const index = this.form[model].findIndex((f) => _.isEqual(f, file));
|
|
|
+ this.form[model].splice(index, 1);
|
|
|
+ },
|
|
|
+ resetData() {
|
|
|
+ let data = _.cloneDeep(this.form);
|
|
|
+ const arr = ['qyfr', 'yyzz', 'qylr'];
|
|
|
+ const res = [];
|
|
|
+ for (const key of arr) {
|
|
|
+ const e = data[key];
|
|
|
+ if (e.length <= 0) continue;
|
|
|
+ const head = _.head(e);
|
|
|
+ res.push(head);
|
|
|
+ }
|
|
|
+ return res;
|
|
|
+ },
|
|
|
+ resetDataMM() {
|
|
|
+ let data = _.cloneDeep(this.form);
|
|
|
+ const arr = ['mqyfr', 'myyzz', 'mqylr'];
|
|
|
+ const res = [];
|
|
|
+ for (const key of arr) {
|
|
|
+ const e = data[key];
|
|
|
+ if (e.length <= 0) continue;
|
|
|
+ const head = _.head(e);
|
|
|
+ res.push(head);
|
|
|
+ }
|
|
|
+ return res;
|
|
|
+ },
|
|
|
+ // 选择中介
|
|
|
+ onConfirm(value) {
|
|
|
+ this.$set(this.form, `mechanism_name`, value.name);
|
|
|
+ this.$set(this.form, `mechanism_id`, value._id);
|
|
|
+ this.showPicker = false;
|
|
|
+ },
|
|
|
+ },
|
|
|
mounted() {
|
|
|
let clientHeight = (document.documentElement.clientHeight || document.body.clientHeight) - 80;
|
|
|
this.$set(this, `clientHeight`, clientHeight);
|
|
|
},
|
|
|
- methods: {},
|
|
|
computed: {
|
|
|
...mapState(['user', 'menuParams']),
|
|
|
pageTitle() {
|
|
@@ -51,8 +236,24 @@ export default {
|
|
|
.info {
|
|
|
overflow-x: hidden;
|
|
|
overflow-y: auto;
|
|
|
- background-color: #f9f9f9;
|
|
|
- padding: 5px 5px 0 5px;
|
|
|
+ .van-form {
|
|
|
+ float: left;
|
|
|
+ width: 100%;
|
|
|
+ }
|
|
|
+ .one {
|
|
|
+ .one_txt {
|
|
|
+ font-size: 16px;
|
|
|
+ font-weight: bold;
|
|
|
+ padding: 10px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .btn {
|
|
|
+ text-align: center;
|
|
|
+ margin: 10px 0;
|
|
|
+ .van-button {
|
|
|
+ margin: 0 10px;
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
.foot {
|
|
|
height: 40px;
|