|
@@ -0,0 +1,98 @@
|
|
|
+<template>
|
|
|
+ <div id="forms">
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="24" class="main">
|
|
|
+ <el-col :span="24" class="one">
|
|
|
+ <van-form @submit="onSubmit">
|
|
|
+ <van-field v-model="form.company" label="申请单位" readonly />
|
|
|
+ <van-field v-model="form.apply_person" label="申请人" />
|
|
|
+ <van-field v-model="form.phone" label="联系电话" />
|
|
|
+ <van-field v-model="form.apply_money" label="申领金额(元)" :rules="[{ required: true, message: '请填写申领金额' }]" />
|
|
|
+ <van-field name="uploader" label="法人复印件">
|
|
|
+ <template #input>
|
|
|
+ <van-uploader :fileList="form.qyfr" :max-count="1" @delete="(file) => toDelete(file, 'qyfr')" :after-read="(file) => toUpload(file, 'qyfr')" />
|
|
|
+ </template>
|
|
|
+ </van-field>
|
|
|
+ <van-field name="uploader" label="企业营业执照">
|
|
|
+ <template #input>
|
|
|
+ <van-uploader :fileList="form.yyzz" :max-count="1" @delete="(file) => toDelete(file, 'yyzz')" :after-read="(file) => toUpload(file, 'yyzz')" />
|
|
|
+ </template>
|
|
|
+ </van-field>
|
|
|
+ <van-field name="uploader" label="企业利润表">
|
|
|
+ <template #input>
|
|
|
+ <van-uploader :fileList="form.qylr" :max-count="1" @delete="(file) => toDelete(file, 'qylr')" :after-read="(file) => toUpload(file, 'qylr')" />
|
|
|
+ </template>
|
|
|
+ </van-field>
|
|
|
+ <van-col span="24" class="btn">
|
|
|
+ <van-button type="info" size="small" @click="back">取消申领</van-button>
|
|
|
+ <van-button type="primary" size="small" native-type="submit">提交申领</van-button>
|
|
|
+ </van-col>
|
|
|
+ </van-form>
|
|
|
+ </el-col>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+import { mapState, createNamespacedHelpers } from 'vuex';
|
|
|
+const { mapActions: upload } = createNamespacedHelpers('upload');
|
|
|
+export default {
|
|
|
+ name: 'forms',
|
|
|
+ props: {
|
|
|
+ form: { type: Object },
|
|
|
+ },
|
|
|
+ components: {},
|
|
|
+ data: function () {
|
|
|
+ return {};
|
|
|
+ },
|
|
|
+ created() {},
|
|
|
+ methods: {
|
|
|
+ ...upload(['upload']),
|
|
|
+ back() {
|
|
|
+ this.$emit('back');
|
|
|
+ },
|
|
|
+ onSubmit() {
|
|
|
+ this.$emit('onSubmit', { data: this.form });
|
|
|
+ },
|
|
|
+ async toUpload({ file }, model) {
|
|
|
+ // 上传,赋值
|
|
|
+ const res = await this.upload({ file, dir: 'file' });
|
|
|
+ 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);
|
|
|
+ },
|
|
|
+ },
|
|
|
+ computed: {
|
|
|
+ ...mapState(['user']),
|
|
|
+ },
|
|
|
+ metaInfo() {
|
|
|
+ return { title: this.$route.meta.title };
|
|
|
+ },
|
|
|
+ watch: {
|
|
|
+ test: {
|
|
|
+ deep: true,
|
|
|
+ immediate: true,
|
|
|
+ handler(val) {},
|
|
|
+ },
|
|
|
+ },
|
|
|
+};
|
|
|
+</script>
|
|
|
+
|
|
|
+<style lang="less" scoped>
|
|
|
+.main {
|
|
|
+ .one {
|
|
|
+ .btn {
|
|
|
+ text-align: center;
|
|
|
+ margin: 10px 0;
|
|
|
+ .van-button {
|
|
|
+ margin: 0 10px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+</style>
|