组织修改
This commit is contained in:
parent
54896344ee
commit
858049d38e
|
|
@ -1,5 +1,6 @@
|
|||
import request from '@/utils/request'
|
||||
|
||||
|
||||
export function getEnterpriseList(query) {
|
||||
return request({
|
||||
url: '/crm/enterprise/',
|
||||
|
|
|
|||
|
|
@ -212,11 +212,11 @@ export default {
|
|||
this.afromOptions = genTree(res.data);
|
||||
});
|
||||
},
|
||||
getauditor_abilitysOptions() {
|
||||
getDictList({ type__code: "auditor_ability" }).then(res => {
|
||||
this.auditor_abilitysOptions = genTree(res.data);
|
||||
});
|
||||
},
|
||||
//getauditor_abilitysOptions() {
|
||||
// getDictList({ type__code: "auditor_ability" }).then(res => {
|
||||
// this.auditor_abilitysOptions = genTree(res.data);
|
||||
// });
|
||||
//},
|
||||
getmajorOptions1() {
|
||||
getDictList({ type__code: "cnas_scope" }).then(res => {
|
||||
this.majorOptions1 = genTree(res.data);
|
||||
|
|
|
|||
|
|
@ -79,15 +79,15 @@
|
|||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="地域选择" prop="county_code">
|
||||
<el-cascader v-model="addressData.county_code" :options="countyOptions" :props="county_prosecode"
|
||||
<el-form-item label="地域选择" prop="countyarry">
|
||||
<el-cascader v-model="addressData.countyarry" :options="countyOptions" :props="county_prosecode"
|
||||
:style="{width: '60%'}" clearable placeholder="请选择地区"></el-cascader>
|
||||
</el-form-item>
|
||||
|
||||
</el-form>
|
||||
<div style="text-align:right;">
|
||||
<el-button type="danger" @click="dialogVisible=false">取消</el-button>
|
||||
<el-button type="primary" @click="confirm('Form')">确认</el-button>
|
||||
<el-button type="primary" @click="confirms('Form')">确认</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
|
|
@ -248,7 +248,7 @@ handleDelete(scope){
|
|||
|
||||
},
|
||||
|
||||
async confirm(form) {
|
||||
async confirms(form) {
|
||||
this.$refs[form].validate(valid => {
|
||||
if (valid) {
|
||||
const isEdit = this.dialogType === 'update'
|
||||
|
|
|
|||
|
|
@ -24,12 +24,11 @@
|
|||
|
||||
<el-table v-loading="listLoading"
|
||||
:data="enterpriseList.results"
|
||||
style="width: 100%;margin-top:10px;"
|
||||
style="width: 100%;margin-bottom: 20px;"
|
||||
row-key="id"
|
||||
border
|
||||
fit
|
||||
stripe
|
||||
highlight-current-row
|
||||
max-height="1000">
|
||||
default-expand-all
|
||||
:tree-props="{children: 'children', hasChildren: 'hasChildren'}">
|
||||
<el-table-column fixed="left" type="index" width="50" />
|
||||
<el-table-column fixed="left" width="150" label="组织查询码">
|
||||
<template slot-scope="scope">
|
||||
|
|
@ -145,7 +144,8 @@
|
|||
<script>
|
||||
import { getEnterpriseList,deleteEnterprise } from "@/api/enterprise"
|
||||
import Pagination from "@/components/Pagination"
|
||||
import checkPermission from '@/utils/permission'
|
||||
import checkPermission from '@/utils/permission'
|
||||
import { genTree } from "@/utils";
|
||||
export default {
|
||||
components: { Pagination },
|
||||
data() {
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@
|
|||
clearable
|
||||
:style="{width: '100%'}"></el-input>
|
||||
</el-form-item>
|
||||
|
||||
</el-col>
|
||||
<el-col :span="8" font="right">
|
||||
<el-form-item label="组织名称" prop="name">
|
||||
|
|
@ -139,17 +140,8 @@
|
|||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="5" font="right">
|
||||
<el-form-item label="建厂时间" prop="build_time">
|
||||
<el-date-picker v-model="formData.build_time"
|
||||
type="date"
|
||||
placeholder="选择日期"
|
||||
format="yyyy 年 MM 月 dd 日"
|
||||
value-format="yyyy-MM-dd">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="5" font="left">
|
||||
|
||||
<el-col :span="8" font="left">
|
||||
<el-form-item label="工厂编号" prop="code">
|
||||
<el-input v-model="formData.code"
|
||||
placeholder="请输入工厂编号"
|
||||
|
|
@ -157,7 +149,27 @@
|
|||
:style="{width: '100%'}"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8" font="left">
|
||||
<el-form-item label="上级公司" prop="parent">
|
||||
|
||||
<treeselect v-model="formData.parent"
|
||||
:multiple="false"
|
||||
placeholder="请选择上级"
|
||||
clearable
|
||||
:style="{width: '100%'}"
|
||||
:options="tableData"></treeselect>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8" font="right">
|
||||
<el-form-item label="建厂时间" prop="build_time">
|
||||
<el-date-picker v-model="formData.build_time"
|
||||
type="date"
|
||||
placeholder="选择日期"
|
||||
format="yyyy 年 MM 月 dd 日"
|
||||
value-format="yyyy-MM-dd":style="{width: '100%'}">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="经营范围" prop="business_type">
|
||||
<el-input type="textarea" :rows="2" v-model="formData.business_type"
|
||||
|
|
@ -198,7 +210,7 @@
|
|||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8" font="left">
|
||||
<el-form-item label="联系电话" prop="linkman1_tel" >
|
||||
<el-form-item label="联系电话" prop="linkman1_tel">
|
||||
<el-input v-model="formData.linkman1_tel"
|
||||
placeholder="联系电话"
|
||||
clearable
|
||||
|
|
@ -214,7 +226,7 @@
|
|||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8" font="right">
|
||||
<el-form-item label="Email" prop="linkman1_email" >
|
||||
<el-form-item label="Email" prop="linkman1_email">
|
||||
<el-input v-model="formData.linkman1_email"
|
||||
placeholder="Email"
|
||||
clearable
|
||||
|
|
@ -361,7 +373,7 @@
|
|||
</style>
|
||||
<script>
|
||||
import { getDictList } from "@/api/dict";
|
||||
import { createEnterprise,getEnterprise } from "@/api/enterprise";
|
||||
import { createEnterprise,getEnterprise,getEnterpriseList } from "@/api/enterprise";
|
||||
import { genTree } from "@/utils";
|
||||
import Treeselect from "@riophae/vue-treeselect";
|
||||
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
|
||||
|
|
@ -409,14 +421,17 @@
|
|||
linkman3_mobile: undefined,
|
||||
linkman3_tel: undefined,
|
||||
linkman3_fax: undefined,
|
||||
linkman3_email: undefined
|
||||
linkman3_email: undefined,
|
||||
parent: undefined
|
||||
},
|
||||
|
||||
economy_classOptions: [
|
||||
],
|
||||
economy_typeOptions:[],
|
||||
professional_classOptions: [
|
||||
],
|
||||
type_Options: [],
|
||||
tableData: [],
|
||||
rule1: {
|
||||
query_code: [{ required: true, message: '请输入组织查询码', trigger: 'blur' }],
|
||||
code: [{ required: true, message: '请输入工厂编号', trigger: 'blur' }],
|
||||
|
|
@ -435,6 +450,7 @@
|
|||
computed: {},
|
||||
|
||||
created() {
|
||||
this.getList(),
|
||||
this.getECclass(),
|
||||
this.getPfclass(),
|
||||
this.getTypeclass(),
|
||||
|
|
@ -443,6 +459,17 @@
|
|||
},
|
||||
mounted() { },
|
||||
methods: {
|
||||
|
||||
getList() {
|
||||
this.listLoading = true
|
||||
getEnterpriseList().then(response => {
|
||||
this.tableData = genTree(response.data.results)
|
||||
console.log(this.tableData)
|
||||
|
||||
})
|
||||
this.listLoading = false
|
||||
},
|
||||
|
||||
handlePreview(file) {
|
||||
if ("url" in file) {
|
||||
window.open(file.url);
|
||||
|
|
|
|||
|
|
@ -139,17 +139,8 @@
|
|||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="5" font="right">
|
||||
<el-form-item label="建厂时间" prop="build_time">
|
||||
<el-date-picker v-model="formData.build_time"
|
||||
type="date"
|
||||
placeholder="选择日期"
|
||||
format="yyyy 年 MM 月 dd 日"
|
||||
value-format="yyyy-MM-dd">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="5" font="left">
|
||||
|
||||
<el-col :span="8" font="left">
|
||||
<el-form-item label="工厂编号" prop="code">
|
||||
<el-input v-model="formData.code"
|
||||
placeholder="请输入工厂编号"
|
||||
|
|
@ -157,7 +148,27 @@
|
|||
:style="{width: '100%'}"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8" font="left">
|
||||
<el-form-item label="上级公司" prop="parent">
|
||||
|
||||
<treeselect v-model="formData.parent"
|
||||
:multiple="false"
|
||||
placeholder="请选择上级"
|
||||
clearable
|
||||
:style="{width: '100%'}"
|
||||
:options="tableData"></treeselect>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8" font="left">
|
||||
<el-form-item label="建厂时间" prop="build_time">
|
||||
<el-date-picker v-model="formData.build_time"
|
||||
type="date"
|
||||
placeholder="选择日期"
|
||||
format="yyyy 年 MM 月 dd 日"
|
||||
value-format="yyyy-MM-dd" :style="{width: '100%'}">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="经营范围" prop="business_type">
|
||||
<el-input type="textarea" :rows="2" v-model="formData.business_type"
|
||||
|
|
@ -361,7 +372,7 @@
|
|||
</style>
|
||||
<script>
|
||||
import { getDictList } from "@/api/dict";
|
||||
import { updateEnterprise,getEnterprise } from "@/api/enterprise";
|
||||
import { updateEnterprise,getEnterprise ,getEnterpriseList} from "@/api/enterprise";
|
||||
import { genTree } from "@/utils";
|
||||
import Treeselect from "@riophae/vue-treeselect";
|
||||
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
|
||||
|
|
@ -409,8 +420,10 @@
|
|||
linkman3_mobile: undefined,
|
||||
linkman3_tel: undefined,
|
||||
linkman3_fax: undefined,
|
||||
linkman3_email: undefined
|
||||
linkman3_email: undefined,
|
||||
parent:undefined
|
||||
},
|
||||
tableData:[],
|
||||
economy_classOptions: [
|
||||
],
|
||||
economy_typeOptions:[],
|
||||
|
|
@ -439,7 +452,8 @@
|
|||
computed: {},
|
||||
|
||||
created() {
|
||||
this.formData.id = this.$route.query.id , //接收参数
|
||||
this.formData.id = this.$route.query.id, //接收参数
|
||||
this.getList(),
|
||||
this.getData(),
|
||||
this.getECclass(),
|
||||
this.getPfclass(),
|
||||
|
|
@ -449,6 +463,15 @@
|
|||
},
|
||||
mounted() { },
|
||||
methods: {
|
||||
getList() {
|
||||
this.listLoading = true
|
||||
getEnterpriseList().then(response => {
|
||||
this.tableData = genTree(response.data.results)
|
||||
console.log(this.tableData)
|
||||
|
||||
})
|
||||
this.listLoading = false
|
||||
},
|
||||
handlePreview(file) {
|
||||
if ("url" in file) {
|
||||
window.open(file.url);
|
||||
|
|
|
|||
|
|
@ -0,0 +1,35 @@
|
|||
# Generated by Django 3.0.5 on 2020-08-03 01:39
|
||||
|
||||
from django.db import migrations, models
|
||||
import django.db.models.deletion
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('system', '0024_auto_20200716_0927'),
|
||||
('certset', '0010_auto_20200731_1418'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='evaluationitem',
|
||||
name='ccc_list',
|
||||
field=models.ManyToManyField(blank=True, related_name='EvaluationItem_ccc_list', to='system.Dict', verbose_name='CCC产品分类'),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='evaluationitem',
|
||||
name='cert_field',
|
||||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='EvaluationItem_cert_field', to='system.Dict', verbose_name='所属认证领域'),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='evaluationitem',
|
||||
name='cnas_scope',
|
||||
field=models.ManyToManyField(blank=True, related_name='EvaluationItem_cnas_scope', to='system.Dict', verbose_name='CNAS业务范围'),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='evaluationitem',
|
||||
name='pv_class',
|
||||
field=models.ManyToManyField(blank=True, null=True, related_name='EvaluationItem_pv_class', to='system.Dict', verbose_name='自愿性产品认证产品分类'),
|
||||
),
|
||||
]
|
||||
|
|
@ -0,0 +1,33 @@
|
|||
# Generated by Django 3.0.5 on 2020-08-04 01:31
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('system', '0024_auto_20200716_0927'),
|
||||
('certset', '0011_auto_20200803_0939'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.RemoveField(
|
||||
model_name='evaluationitem',
|
||||
name='cnas_scope',
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='evaluationitem',
|
||||
name='ccc_list',
|
||||
field=models.ManyToManyField(blank=True, related_name='EvaluationItem_ccc_list', to='system.Dict', verbose_name='CCC产品认证分类'),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='evaluationitem',
|
||||
name='cert_field',
|
||||
field=models.CharField(blank=True, max_length=1000, verbose_name='所属认证领域分类'),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='evaluationitem',
|
||||
name='pv_class',
|
||||
field=models.ManyToManyField(blank=True, null=True, related_name='EvaluationItem_pv_class', to='system.Dict', verbose_name='自愿产品认证分类'),
|
||||
),
|
||||
]
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
# Generated by Django 3.0.5 on 2020-08-04 01:32
|
||||
|
||||
from django.db import migrations
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('certset', '0012_auto_20200804_0931'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.RemoveField(
|
||||
model_name='evaluationitem',
|
||||
name='pv_class',
|
||||
),
|
||||
]
|
||||
|
|
@ -0,0 +1,37 @@
|
|||
# Generated by Django 3.0.5 on 2020-08-04 07:58
|
||||
|
||||
from django.conf import settings
|
||||
from django.db import migrations, models
|
||||
import django.db.models.deletion
|
||||
import django.utils.timezone
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
|
||||
('certset', '0013_remove_evaluationitem_pv_class'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.RemoveField(
|
||||
model_name='evaluationitem',
|
||||
name='content',
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='Evaluations',
|
||||
fields=[
|
||||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('create_time', models.DateTimeField(default=django.utils.timezone.now, help_text='创建时间', verbose_name='创建时间')),
|
||||
('update_time', models.DateTimeField(auto_now=True, help_text='修改时间', verbose_name='修改时间')),
|
||||
('is_deleted', models.BooleanField(default=False, help_text='删除标记', verbose_name='删除标记')),
|
||||
('content', models.TextField(blank=True, verbose_name='内容')),
|
||||
('create_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='evaluations_create_by', to=settings.AUTH_USER_MODEL, verbose_name='创建人')),
|
||||
('update_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='evaluations_update_by', to=settings.AUTH_USER_MODEL, verbose_name='最后编辑人')),
|
||||
],
|
||||
options={
|
||||
'verbose_name': '评审列',
|
||||
'verbose_name_plural': '评审列',
|
||||
},
|
||||
),
|
||||
]
|
||||
|
|
@ -61,10 +61,19 @@ class UnitType(CommonAModel):
|
|||
return self.name
|
||||
|
||||
class EvaluationItem(CommonAModel):
|
||||
content = models.TextField('内容', blank=True)
|
||||
cert_field = models.CharField('所属认证领域分类',max_length=1000,blank=True)
|
||||
ccc_list = models.ManyToManyField(Dict,blank=True, verbose_name='CCC产品认证分类', related_name= 'EvaluationItem_ccc_list')
|
||||
class Meta:
|
||||
verbose_name = '评审表项目'
|
||||
verbose_name_plural = verbose_name
|
||||
|
||||
def __str__(self):
|
||||
return self.cert_field
|
||||
class Evaluations(CommonAModel):
|
||||
content = models.TextField('内容', blank=True)
|
||||
class Meta:
|
||||
verbose_name = '评审列'
|
||||
verbose_name_plural = verbose_name
|
||||
|
||||
def __str__(self):
|
||||
return self.content
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
# Generated by Django 3.0.5 on 2020-08-03 01:39
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('crm', '0009_remove_enterpriseaddress_provincecode'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='enterprise',
|
||||
name='name',
|
||||
field=models.CharField(blank=True, max_length=1000, null=True, unique=True, verbose_name='工厂名称'),
|
||||
),
|
||||
]
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
# Generated by Django 3.0.5 on 2020-08-04 01:31
|
||||
|
||||
from django.db import migrations, models
|
||||
import django.db.models.deletion
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('crm', '0010_auto_20200803_0939'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='enterprise',
|
||||
name='parent',
|
||||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='crm.Enterprise', verbose_name='父'),
|
||||
),
|
||||
]
|
||||
|
|
@ -5,6 +5,8 @@ from django.contrib.postgres.fields import ArrayField
|
|||
import uuid
|
||||
# Create your models here.
|
||||
class Enterprise(CommonBModel):
|
||||
parent= models.ForeignKey('self', null=True, blank=True,
|
||||
on_delete=models.SET_NULL, verbose_name='父')
|
||||
code = models.CharField('工厂编号',unique=True, max_length=300)
|
||||
name = models.CharField('工厂名称',null=True,unique=True, blank=True,max_length=1000)
|
||||
ename = models.CharField('工厂英文名称',null=True, blank=True,max_length=1000)
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ class EnterpriseListSerializer(serializers.ModelSerializer):
|
|||
economy_class = DictSerializer()
|
||||
class Meta:
|
||||
model = Enterprise
|
||||
fields = ['id','query_code', 'code', 'name','ename','type','legal','build_time','person_count','ceramics_output','gassets','linkman1_name','linkman1_tel','linkman1_mobile','country_code','credit_code','professional','all_person','economy_class','economy_type','linkman1_duty','business_type']
|
||||
fields = ['id','query_code', 'code', 'name','ename','type','legal','build_time','person_count','ceramics_output','gassets','linkman1_name','linkman1_tel','linkman1_mobile','country_code','parent','credit_code','professional','all_person','economy_class','economy_type','linkman1_duty','business_type']
|
||||
@staticmethod
|
||||
def setup_eager_loading(queryset):
|
||||
""" Perform necessary eager loading of data. """
|
||||
|
|
|
|||
Loading…
Reference in New Issue