|
@@ -3,9 +3,18 @@
|
|
|
<el-dialog :title="title" :visible.sync="dialogVisible" @close="close" width="60%">
|
|
<el-dialog :title="title" :visible.sync="dialogVisible" @close="close" width="60%">
|
|
|
<el-form ref="form" :model="form" :rules="rules" label-width="82px">
|
|
<el-form ref="form" :model="form" :rules="rules" label-width="82px">
|
|
|
<el-row :gutter="15">
|
|
<el-row :gutter="15">
|
|
|
|
|
+ <el-col v-bind="styleResponsive ? { sm: 12 } : { span: 12 }">
|
|
|
|
|
+ <el-form-item prop="holderType" label="持证类型">
|
|
|
|
|
+ <el-select style="width: 100%" v-model="form.holderType" @change="holderTypeChange">
|
|
|
|
|
+ <el-option :label="item.label" :value="item.value" v-for="(item, index) in holderTypeOptions" :key="index">
|
|
|
|
|
+ </el-option>
|
|
|
|
|
+ </el-select>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ </el-col>
|
|
|
<el-col v-bind="styleResponsive ? { sm: 12 } : { span: 12 }">
|
|
<el-col v-bind="styleResponsive ? { sm: 12 } : { span: 12 }">
|
|
|
<el-form-item prop="type" label="证件类型">
|
|
<el-form-item prop="type" label="证件类型">
|
|
|
- <DictSelection v-model="form.type" dictName="证件类型"></DictSelection>
|
|
|
|
|
|
|
+ <DictSelection v-model="form.type" dictName="证件类型" v-if="['1'].includes(form.holderType)"></DictSelection>
|
|
|
|
|
+ <DictSelection v-model="form.type" dictName="客户/供应商资质类型" v-if="['2','3','4','5','6'].includes(form.holderType)"></DictSelection>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
</el-col>
|
|
</el-col>
|
|
|
<el-col v-bind="styleResponsive ? { sm: 12 } : { span: 12 }">
|
|
<el-col v-bind="styleResponsive ? { sm: 12 } : { span: 12 }">
|
|
@@ -26,16 +35,9 @@
|
|
|
<DictSelection v-model="form.status" dictName="规则状态"></DictSelection>
|
|
<DictSelection v-model="form.status" dictName="规则状态"></DictSelection>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
</el-col>
|
|
</el-col>
|
|
|
|
|
+
|
|
|
<el-col v-bind="styleResponsive ? { sm: 12 } : { span: 12 }">
|
|
<el-col v-bind="styleResponsive ? { sm: 12 } : { span: 12 }">
|
|
|
- <el-form-item prop="holderType" label="持证类型">
|
|
|
|
|
- <el-select style="width: 100%" v-model="form.holderType" @change="holderTypeChange">
|
|
|
|
|
- <el-option :label="item.label" :value="item.value" v-for="(item, index) in holderTypeOptions" :key="index">
|
|
|
|
|
- </el-option>
|
|
|
|
|
- </el-select>
|
|
|
|
|
- </el-form-item>
|
|
|
|
|
- </el-col>
|
|
|
|
|
- <el-col v-bind="styleResponsive ? { sm: 12 } : { span: 12 }">
|
|
|
|
|
- <el-form-item prop="holder" label="持证人">
|
|
|
|
|
|
|
+ <el-form-item prop="holder" label="持证对象">
|
|
|
<el-input v-if="form.holderType != 2" v-model="form.holder" clearable readonly placeholder="请选择"
|
|
<el-input v-if="form.holderType != 2" v-model="form.holder" clearable readonly placeholder="请选择"
|
|
|
@click.native="openStaffSelection"></el-input>
|
|
@click.native="openStaffSelection"></el-input>
|
|
|
<ele-tree-select
|
|
<ele-tree-select
|
|
@@ -67,8 +69,8 @@
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
</el-col>
|
|
</el-col>
|
|
|
<el-col v-bind="styleResponsive ? { sm: 24 } : { span: 24 }">
|
|
<el-col v-bind="styleResponsive ? { sm: 24 } : { span: 24 }">
|
|
|
- <el-form-item prop="fileObj" label="证照图片">
|
|
|
|
|
- <fileUpload v-model="form.fileObj" module="main" :showLib="true" :limit="5" />
|
|
|
|
|
|
|
+ <el-form-item prop="fileObj" label="附件">
|
|
|
|
|
+ <fileMain v-model="form.fileObj" />
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
</el-col>
|
|
</el-col>
|
|
|
<el-col v-bind="styleResponsive ? { sm: 24 } : { span: 24 }">
|
|
<el-col v-bind="styleResponsive ? { sm: 24 } : { span: 24 }">
|
|
@@ -83,7 +85,7 @@
|
|
|
<supplierSelection ref="supplierSelectionRef" @confirm="confirmStaffSelection" />
|
|
<supplierSelection ref="supplierSelectionRef" @confirm="confirmStaffSelection" />
|
|
|
<customerSelection ref="customerSelectionRef" @confirm="confirmStaffSelection" />
|
|
<customerSelection ref="customerSelectionRef" @confirm="confirmStaffSelection" />
|
|
|
<div slot="footer" class="dialog-footer">
|
|
<div slot="footer" class="dialog-footer">
|
|
|
- <el-button size="small" @click="submit" type="primary">提 交</el-button>
|
|
|
|
|
|
|
+ <el-button size="small" @click="save" type="primary">保 存</el-button>
|
|
|
<el-button size="small" @click="close">关 闭</el-button>
|
|
<el-button size="small" @click="close">关 闭</el-button>
|
|
|
</div>
|
|
</div>
|
|
|
</el-dialog>
|
|
</el-dialog>
|
|
@@ -92,33 +94,35 @@
|
|
|
<script>
|
|
<script>
|
|
|
import staffSelection from './staffSelection.vue';
|
|
import staffSelection from './staffSelection.vue';
|
|
|
import { saveOrEdit, getPhotoInfo } from '@/api/documentManagement';
|
|
import { saveOrEdit, getPhotoInfo } from '@/api/documentManagement';
|
|
|
- import fileUpload from '@/components/upload/fileUpload';
|
|
|
|
|
- import imgUpload from '@/components/upload/imgUpload';
|
|
|
|
|
|
|
+ import fileMain from '@/components/addDoc/index.vue';
|
|
|
|
|
+
|
|
|
import { getCode } from '@/api/ruleManagement/matter';
|
|
import { getCode } from '@/api/ruleManagement/matter';
|
|
|
import productTable from './productTable.vue';
|
|
import productTable from './productTable.vue';
|
|
|
import supplierSelection from './supplierSelection.vue';
|
|
import supplierSelection from './supplierSelection.vue';
|
|
|
import customerSelection from './customerSelection.vue';
|
|
import customerSelection from './customerSelection.vue';
|
|
|
import { listOrganizations } from '@/api/system/organization';
|
|
import { listOrganizations } from '@/api/system/organization';
|
|
|
-
|
|
|
|
|
|
|
+ import { holderTypeOptions } from '@/enum/dict.js';
|
|
|
|
|
+ const defaultForm = {
|
|
|
|
|
+ code: '',
|
|
|
|
|
+ holder: '',
|
|
|
|
|
+ holderId: '',
|
|
|
|
|
+ type:'',
|
|
|
|
|
+ date: [],
|
|
|
|
|
+ fileObj: [],
|
|
|
|
|
+ holderType: '4',
|
|
|
|
|
+ status:1,
|
|
|
|
|
+ };
|
|
|
export default {
|
|
export default {
|
|
|
components: {
|
|
components: {
|
|
|
- fileUpload,
|
|
|
|
|
- imgUpload,
|
|
|
|
|
staffSelection,
|
|
staffSelection,
|
|
|
productTable,
|
|
productTable,
|
|
|
supplierSelection,
|
|
supplierSelection,
|
|
|
- customerSelection
|
|
|
|
|
|
|
+ customerSelection,
|
|
|
|
|
+ fileMain
|
|
|
},
|
|
},
|
|
|
//注册组件
|
|
//注册组件
|
|
|
data() {
|
|
data() {
|
|
|
- const defaultForm = {
|
|
|
|
|
- code: '',
|
|
|
|
|
- holder: '',
|
|
|
|
|
- holderId: '',
|
|
|
|
|
- date: [],
|
|
|
|
|
- fileObj: [],
|
|
|
|
|
- holderType: '1',
|
|
|
|
|
- };
|
|
|
|
|
|
|
+
|
|
|
return {
|
|
return {
|
|
|
dialogVisible: false,
|
|
dialogVisible: false,
|
|
|
levelOptions: [
|
|
levelOptions: [
|
|
@@ -147,35 +151,18 @@
|
|
|
{ required: true, trigger: 'change', message: '请选择有效期' }
|
|
{ required: true, trigger: 'change', message: '请选择有效期' }
|
|
|
],
|
|
],
|
|
|
holder: [
|
|
holder: [
|
|
|
- { required: true, trigger: 'change', message: '请输入持证人' }
|
|
|
|
|
|
|
+ { required: true, trigger: 'change', message: '请选择持证对象' }
|
|
|
],
|
|
],
|
|
|
status: [
|
|
status: [
|
|
|
{ required: true, trigger: 'change', message: '请选择状态' }
|
|
{ required: true, trigger: 'change', message: '请选择状态' }
|
|
|
],
|
|
],
|
|
|
fileObj: [
|
|
fileObj: [
|
|
|
- { required: true, trigger: 'change', message: '请选择证照图片' }
|
|
|
|
|
|
|
+ { required: true, trigger: 'change', message: '请选择' }
|
|
|
],
|
|
],
|
|
|
},
|
|
},
|
|
|
form: { ...defaultForm },
|
|
form: { ...defaultForm },
|
|
|
title: '新增',
|
|
title: '新增',
|
|
|
- holderTypeOptions:[
|
|
|
|
|
- {
|
|
|
|
|
- label: '个人',
|
|
|
|
|
- value: '1'
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- label: '企业自身',
|
|
|
|
|
- value: '2'
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- label: '供应商',
|
|
|
|
|
- value: '3'
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- label: '客户',
|
|
|
|
|
- value: '4'
|
|
|
|
|
- }
|
|
|
|
|
- ],
|
|
|
|
|
|
|
+ holderTypeOptions,
|
|
|
companyData: [], //公司分类
|
|
companyData: [], //公司分类
|
|
|
};
|
|
};
|
|
|
},
|
|
},
|
|
@@ -201,7 +188,7 @@
|
|
|
openStaffSelection() {
|
|
openStaffSelection() {
|
|
|
if (this.form.holderType == 1) {
|
|
if (this.form.holderType == 1) {
|
|
|
this.$refs.staffSelection.open([]);
|
|
this.$refs.staffSelection.open([]);
|
|
|
- } else if (this.form.holderType == 3) {
|
|
|
|
|
|
|
+ } else if (this.form.holderType == 3||this.form.holderType == 6) {
|
|
|
this.$refs.supplierSelectionRef.open([]);
|
|
this.$refs.supplierSelectionRef.open([]);
|
|
|
} else if (this.form.holderType == 4) {
|
|
} else if (this.form.holderType == 4) {
|
|
|
this.$refs.customerSelectionRef.open([]);
|
|
this.$refs.customerSelectionRef.open([]);
|
|
@@ -215,9 +202,6 @@
|
|
|
this.getInfo(row.id);
|
|
this.getInfo(row.id);
|
|
|
} else {
|
|
} else {
|
|
|
this.title = '新增';
|
|
this.title = '新增';
|
|
|
- this.$refs.form.resetFields();
|
|
|
|
|
- this.form = { ...this.defaultForm };
|
|
|
|
|
- this.getOrderCode();
|
|
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
async getOrderCode() {
|
|
async getOrderCode() {
|
|
@@ -229,6 +213,7 @@
|
|
|
const data = await getPhotoInfo(id);
|
|
const data = await getPhotoInfo(id);
|
|
|
this.form = {
|
|
this.form = {
|
|
|
...data,
|
|
...data,
|
|
|
|
|
+ type:data.type+'',
|
|
|
date: [data.validityStartTime, data.validityEndTime],
|
|
date: [data.validityStartTime, data.validityEndTime],
|
|
|
holderType: data.holderType || '1'
|
|
holderType: data.holderType || '1'
|
|
|
};
|
|
};
|
|
@@ -240,11 +225,11 @@
|
|
|
close() {
|
|
close() {
|
|
|
this.dialogVisible = false;
|
|
this.dialogVisible = false;
|
|
|
// this.$refs.form.resetFields()
|
|
// this.$refs.form.resetFields()
|
|
|
- this.form = { ...this.defaultForm };
|
|
|
|
|
|
|
+ this.form = { defaultForm };
|
|
|
this.$refs.productTableRef.initData()
|
|
this.$refs.productTableRef.initData()
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
- submit() {
|
|
|
|
|
|
|
+ save() {
|
|
|
this.$refs.form.validate((valid) => {
|
|
this.$refs.form.validate((valid) => {
|
|
|
if (!valid) {
|
|
if (!valid) {
|
|
|
return false;
|
|
return false;
|
|
@@ -281,6 +266,7 @@
|
|
|
}
|
|
}
|
|
|
this.form.holder = ''
|
|
this.form.holder = ''
|
|
|
this.form.holderId = ''
|
|
this.form.holderId = ''
|
|
|
|
|
+ this.form.type = ''
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
//查询公司分类
|
|
//查询公司分类
|