|
@@ -1,48 +1,96 @@
|
|
|
<template>
|
|
|
<div id="detail">
|
|
|
- <data-form :fields="fields" :data="data" @save="toSave" labelWidth="150px" returns="/adminCenter/policy" submitText="审核">
|
|
|
- <template #radios="{ item }">
|
|
|
- <template v-if="item.model === 'status'">
|
|
|
- <el-radio v-for="(i, index) in statusList" :key="`status-${index}`" :label="i.value">{{ i.label }}</el-radio>
|
|
|
- </template>
|
|
|
- </template>
|
|
|
- <template #custom="{ item }">
|
|
|
- <!-- <template v-if="item.model === 'desc'">
|
|
|
- <p v-html="data[item.model]"></p>
|
|
|
- </template> -->
|
|
|
- <template>
|
|
|
- <template v-for="(i, index) in data[item.model]">
|
|
|
- <img v-if="isImg(i.url)" :key="`${item.model}-${index}`" :src="i.url" width="150px" height="150px" />
|
|
|
- <el-link v-else :key="`${item.model}-${index}`" type="primary" @click="toOpen(i.url)"> <i class="el-icon-view"></i> {{ i.name }} </el-link>
|
|
|
- </template>
|
|
|
- </template>
|
|
|
- </template>
|
|
|
- </data-form>
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="24" class="main">
|
|
|
+ <el-col :span="24" class="one">
|
|
|
+ <el-col :span="24" class="top">
|
|
|
+ <el-button type="primary" size="mini" @click="back">返回</el-button>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="24" class="down">
|
|
|
+ <el-form :model="form" ref="form" label-width="100px">
|
|
|
+ <el-col :span="24" class="text">
|
|
|
+ <el-col :span="2" class="left"> 申请单位</el-col>
|
|
|
+ <el-col :span="22" class="right">
|
|
|
+ {{ form.company }}
|
|
|
+ </el-col>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="24" class="text">
|
|
|
+ <el-col :span="2" class="left"> 申请人</el-col>
|
|
|
+ <el-col :span="22" class="right">
|
|
|
+ {{ form.apply_personal }}
|
|
|
+ </el-col>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="24" class="text">
|
|
|
+ <el-col :span="2" class="left"> 申请类型</el-col>
|
|
|
+ <el-col :span="22" class="right">
|
|
|
+ {{ form.type }}
|
|
|
+ </el-col>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="24" class="text">
|
|
|
+ <el-col :span="2" class="left"> 法人复印件:</el-col>
|
|
|
+ <el-col :span="20" class="right">
|
|
|
+ <el-col :span="4" v-for="(i, index) in form.qyfr" :key="`medium_material-${index}`">
|
|
|
+ <img v-if="isImg(i.url)" :src="i.url" width="150px" height="150px" @click="toOpen(i.url)" />
|
|
|
+ <el-link v-else type="primary" @click="toOpen(i.url)"> <i class="el-icon-view"></i> {{ i.name }} </el-link>
|
|
|
+ </el-col>
|
|
|
+ </el-col>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="24" class="text">
|
|
|
+ <el-col :span="2" class="left"> 企业营业执照:</el-col>
|
|
|
+ <el-col :span="20" class="right">
|
|
|
+ <el-col :span="4" v-for="(i, index) in form.yyzz" :key="`medium_material-${index}`">
|
|
|
+ <img v-if="isImg(i.url)" :src="i.url" width="150px" height="150px" @click="toOpen(i.url)" />
|
|
|
+ <el-link v-else type="primary" @click="toOpen(i.url)"> <i class="el-icon-view"></i> {{ i.name }} </el-link>
|
|
|
+ </el-col>
|
|
|
+ </el-col>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="24" class="text">
|
|
|
+ <el-col :span="2" class="left"> 企业利润表:</el-col>
|
|
|
+ <el-col :span="20" class="right">
|
|
|
+ <el-col :span="4" v-for="(i, index) in form.qylr" :key="`medium_material-${index}`">
|
|
|
+ <img v-if="isImg(i.url)" :src="i.url" width="150px" height="150px" @click="toOpen(i.url)" />
|
|
|
+ <el-link v-else type="primary" @click="toOpen(i.url)"> <i class="el-icon-view"></i> {{ i.name }} </el-link>
|
|
|
+ </el-col>
|
|
|
+ </el-col>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="24" class="text">
|
|
|
+ <el-col :span="2" class="left"> 审核状态</el-col>
|
|
|
+ <el-col :span="22" class="right">
|
|
|
+ <el-radio-group v-model="form.status">
|
|
|
+ <el-radio v-for="(i, index) in statusList" :key="`status-${index}`" :label="i.value">{{ i.label }}</el-radio>
|
|
|
+ </el-radio-group>
|
|
|
+ </el-col>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="24" class="text">
|
|
|
+ <el-col :span="2" class="left"> 审核意见</el-col>
|
|
|
+ <el-col :span="22" class="right">
|
|
|
+ <el-input v-model="form.desc" type="textarea" maxlength="300" :autosize="{ minRows: 4, maxRows: 6 }" show-word-limit></el-input>
|
|
|
+ </el-col>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="24" class="formBtn">
|
|
|
+ <el-button type="danger" size="mini" @click="back">取消申领</el-button>
|
|
|
+ <el-button type="primary" size="mini" @click="onSubmit('form')">提交审核</el-button>
|
|
|
+ </el-col>
|
|
|
+ </el-form>
|
|
|
+ </el-col>
|
|
|
+ </el-col>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
const _ = require('lodash');
|
|
|
-const { policyType, policyStatus } = require('@common/dict/index');
|
|
|
+const { policyStatus } = require('@common/dict/index');
|
|
|
import { mapState, createNamespacedHelpers } from 'vuex';
|
|
|
const { mapActions: policy } = createNamespacedHelpers('policy');
|
|
|
export default {
|
|
|
- name: 'policyDetail',
|
|
|
+ name: 'detail',
|
|
|
props: {},
|
|
|
components: {},
|
|
|
data: function () {
|
|
|
return {
|
|
|
- data: {},
|
|
|
- fields: [
|
|
|
- { label: '申请单位', model: 'company', type: 'text' },
|
|
|
- { label: '申请类型', model: 'type', type: 'text' },
|
|
|
- { label: '申请人', model: 'apply_personal', type: 'text' },
|
|
|
- { label: '法人复印件', model: 'qyfr', custom: true },
|
|
|
- { label: '企业营业执照', model: 'yyzz', custom: true },
|
|
|
- { label: '企业利润表', model: 'qylr', custom: true },
|
|
|
- { label: '建议', model: 'desc', type: 'textarea' },
|
|
|
- { label: '审核状态', model: 'status', type: 'radio' },
|
|
|
- ],
|
|
|
+ form: {},
|
|
|
statusList: policyStatus,
|
|
|
imgList: ['jpg', 'jpeg', 'png', 'bmp', 'gif'],
|
|
|
};
|
|
@@ -55,20 +103,26 @@ export default {
|
|
|
async search() {
|
|
|
const res = await this.fetch(this.id);
|
|
|
if (this.$checkRes(res)) {
|
|
|
- this.$set(this, `data`, res.data);
|
|
|
+ this.$set(this, `form`, res.data);
|
|
|
}
|
|
|
},
|
|
|
- async toSave({ data }) {
|
|
|
- let dup = _.cloneDeep(data);
|
|
|
- let res;
|
|
|
- if (_.get(dup, 'id')) {
|
|
|
- res = await this.update(dup);
|
|
|
- } else {
|
|
|
- res = await this.create(dup);
|
|
|
- }
|
|
|
- if (this.$checkRes(res, '保存成功', '保存失败')) {
|
|
|
- if (!this.$dev_mode) this.$router.push('/adminCenter/policy');
|
|
|
- }
|
|
|
+ onSubmit(formName) {
|
|
|
+ this.$refs[formName].validate(async (valid) => {
|
|
|
+ if (valid) {
|
|
|
+ let data = this.form;
|
|
|
+ let res = await this.update(data);
|
|
|
+ if (this.$checkRes(res)) {
|
|
|
+ this.$message({
|
|
|
+ message: '政策服务审核成功',
|
|
|
+ type: 'success',
|
|
|
+ });
|
|
|
+ this.back();
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ console.log('error submit!!');
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ });
|
|
|
},
|
|
|
isImg(url) {
|
|
|
const arr = url.split('.');
|
|
@@ -78,12 +132,12 @@ export default {
|
|
|
toOpen(url) {
|
|
|
window.open(url);
|
|
|
},
|
|
|
+ back() {
|
|
|
+ this.$router.push('/adminCenter/policy');
|
|
|
+ },
|
|
|
},
|
|
|
computed: {
|
|
|
- ...mapState(['user', 'menuParams']),
|
|
|
- pageTitle() {
|
|
|
- return `${this.$route.meta.title}`;
|
|
|
- },
|
|
|
+ ...mapState(['user']),
|
|
|
id() {
|
|
|
return this.$route.query.id;
|
|
|
},
|
|
@@ -91,7 +145,50 @@ export default {
|
|
|
metaInfo() {
|
|
|
return { title: this.$route.meta.title };
|
|
|
},
|
|
|
+ watch: {
|
|
|
+ test: {
|
|
|
+ deep: true,
|
|
|
+ immediate: true,
|
|
|
+ handler(val) {},
|
|
|
+ },
|
|
|
+ },
|
|
|
};
|
|
|
</script>
|
|
|
|
|
|
-<style lang="less" scoped></style>
|
|
|
+<style lang="less" scoped>
|
|
|
+.main {
|
|
|
+ border-radius: 10px;
|
|
|
+ box-shadow: 0 0 5px #cccccc;
|
|
|
+ padding: 20px;
|
|
|
+ .top {
|
|
|
+ text-align: right;
|
|
|
+ margin: 0 0 10px 0;
|
|
|
+ }
|
|
|
+ .down {
|
|
|
+ .text {
|
|
|
+ padding: 10px 0;
|
|
|
+ border-bottom: 1px dashed #333;
|
|
|
+ .left {
|
|
|
+ text-align: left;
|
|
|
+ }
|
|
|
+ .right {
|
|
|
+ img {
|
|
|
+ width: 200px;
|
|
|
+ height: 200px;
|
|
|
+ border: 1px solid #ccc;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .desc {
|
|
|
+ margin: 10px 0 0 0;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .formBtn {
|
|
|
+ text-align: center;
|
|
|
+ padding: 10px 0;
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+.main:hover {
|
|
|
+ box-shadow: 0 0 5px #409eff;
|
|
|
+}
|
|
|
+</style>
|