This commit is contained in:
““shijing 2022-06-05 22:50:13 +08:00
parent ae0e8da35f
commit af539a6a17
3 changed files with 144 additions and 186 deletions

View File

@ -66,7 +66,7 @@
v-if="buttonsShow&&checkPermission(['qaction_create'])"
type="primary"
style="float: right"
@click="serviceUpdate(scope)"
@click="serviceUpdate()"
>
更新服务
</el-button>
@ -74,7 +74,7 @@
v-if="buttonsShow&&checkPermission(['qaction_create'])"
type="primary"
style="float: right;margin-right: 10px"
@click="qualiUpdate(scope)"
@click="qualiUpdate()"
>
编辑资质
</el-button>
@ -82,7 +82,7 @@
v-if="buttonsShow&&checkPermission(['qaction_create'])"
type="primary"
style="float: right;margin-right: 10px"
@click="qualiCreate(scope)"
@click="qualiCreate()"
>
新增资质
</el-button>
@ -90,7 +90,7 @@
v-if="buttonsShow&&checkPermission(['qaction_create'])"
type="primary"
style="float: right;margin-right: 10px"
@click="abilityCreate(scope)"
@click="abilityCreate()"
>
新增能力
</el-button>
@ -131,11 +131,13 @@
@click="handleRecord({ action: 'view', record: scope.row })"
>
<span style="color: red">{{ scope.row.files.length }}</span>
个文件</el-link
个文件
</el-link
>
<div v-else v-for="item in scope.row.files_" v-bind:key="item.id">
<el-link :href="item.path" target="_blank" type="primary">
{{item.name }}</el-link>
{{item.name }}
</el-link>
</div>
</template>
</el-table-column>
@ -160,7 +162,8 @@
type="danger"
size="small"
@click="handleDelete( scope.row.id )"
>删除</el-link>
>删除
</el-link>
</template>
</el-table-column>
@ -323,6 +326,7 @@
reserve-keyword
:remote-method="searchCity"
:loading="loading"
@change="getCheckCity"
>
<el-option
v-for="item in cityOptions"
@ -390,12 +394,13 @@
align="center"
label="操作"
>
<template slot-scope="scope">
<template #default="scope">
<el-link
type="primary"
size="small"
@click="handleEdit(scope.row)"
>编辑</el-link>
>编辑
</el-link>
</template>
</el-table-column>
</el-table>
@ -458,53 +463,16 @@
></el-input>
</el-form-item>
<el-form-item label="备案城市" v-if="qualiForm.type==='OTHER'">
<el-select
v-model="qualiForm.citys"
placeholder="备案城市"
style="width: 100%;"
filterable
remote
multiple
disabled
reserve-keyword
>
<el-option
v-for="item in cityOptions"
:key="item.id"
:label="item.name"
:value="item.id"
/>
</el-select>
<el-input v-model="qualiForm.citys" disabled placeholder="备案城市"/>
<!--<span v-for="item in qualiForm.citys" :key="item.id">{{item.name}}</span>-->
</el-form-item>
<el-form-item label="所在省" v-if="qualiForm.grade===20">
<el-select
v-model="qualiForm.province"
placeholder="省份"
style="width: 100%"
disabled
>
<el-option
v-for="item in proviceOptions"
:key="item.id"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
<el-input v-model="qualiForm.province_name" disabled placeholder="所在省"/>
<!--{{ formData.province_name }}-->
</el-form-item>
<el-form-item label="所在市" v-if="qualiForm.grade===30">
<el-select
style="width: 100%;"
v-model="qualiForm.city"
placeholder="所在市"
disabled
>
<el-option
v-for="item in cityOptions"
:key="item.id"
:label="item.name"
:value="item.id"
/>
</el-select>
<el-input v-model="qualiForm.city_name" disabled placeholder="所在市"/>
<!--{{ formData.city_name }}-->
</el-form-item>
</el-form>
<div style="text-align: right">
@ -541,7 +509,19 @@
</template>
<script>
import {getQtaskMy, getQtask,qactionMy, getQualityMy,createQuali,qactionDelete,updateQuali, createAbility, updateService,provinceLists,cityLists} from "@/api/ability";
import {
getQtaskMy,
getQtask,
qactionMy,
getQualityMy,
createQuali,
qactionDelete,
updateQuali,
createAbility,
updateService,
provinceLists,
cityLists
} from "@/api/ability";
import {getDictList} from "@/api/dict";
import {genTree} from "@/utils";
import {getOrgList} from "@/api/org";
@ -684,6 +664,11 @@
this.cityOptions = [];
}
},
getCheckCity(data) {
debugger;
console.log(data);
this.qualiForm.citys = data;
},
getCites(province) {
this.qualiForm.city = '';
cityLists({parent: province, page: 1, page_size: 100}).then(res => {
@ -791,6 +776,7 @@
},
//编辑资质
handleEdit(row) {
this.showForm = true;
this.qualiForm.id = row.id;
this.qualiForm.name = row.name;
@ -798,13 +784,18 @@
this.qualiForm.grade = row.grade;
this.qualiForm.scope = row.scope;
this.qualiForm.level = row.level;
this.qualiForm.province=row.province;
this.qualiForm.city=row.city;
this.qualiForm.province_name = row.province_name?row.province_name:'';
this.qualiForm.city_name = row.city_name?row.city_name:'';
this.qualiForm.description = row.description;
this.qualiForm.citys=row.citys;
cityLists({parent:row.province,page:1,page_size:100}).then(res=>{
this.cityOptions = res.data.results;
this.qualiForm.citys = null;
if(row.citys_&&row.citys_.length>0){
let citys = '';
row.citys_.forEach(item=>{
citys = citys+item.name;
})
this.qualiForm.citys = citys;
}
},
//新增能力
abilityCreate() {
@ -815,13 +806,6 @@
let that = this;
that.$refs[form].validate((valid) => {
if (valid) {
if(that.qualiForm.type==='OTHER'){
that.qualiForm.citys=[];
let city = parseInt(that.qualiForm.city);
let province = parseInt(that.qualiForm.province);
that.qualiForm.citys.push(province);
that.qualiForm.citys.push(city);
}else{}
let obj = new Object();
obj.qtask = that.qtask;
obj.value2 = that.qualiForm;

View File

@ -356,28 +356,21 @@
},
//操作处理
handleRecord(type, item) {
// debugger;
this.showData.data = item;
this.showData.id = item.id;
this.showData.type = item.action;
this.showData.action = type;
this.actionType = type;
this.fieldList2 =[];
qactionItem(item.id).then(res=>{
if (res.code>=200) {
debugger;
let updateDetail = res.data.update_detail;//更改字段
updateDetail.forEach(item=>{
this.fieldList2.push(item.field);//所有字段
})
this.drawer = true;
}
debugger;
console.log(this.fieldList2)
})
qactionItem(item.id).then(res => {
console.log(res)
})
},
handleDelete(id) {
this.$confirm("确认删除该操作吗?", "提示")

View File

@ -8,56 +8,34 @@
label-position="left"
>
<el-form-item label="资质名称">
{{ data.value2.name }}
</el-form-item>
<el-form-item label="" v-if="data.value2.name1">
<span style="color: #f56c6c;">{{data.value2.name1}}</span>
{{ data.name }}
</el-form-item>
<el-form-item label="资质类型">
{{ data.value2.type }}
</el-form-item>
<el-form-item label="" v-if="data.value2.type1">
<span style="color: #f56c6c;">{{data.value2.type1}}</span>
{{ data.type }}
</el-form-item>
<el-form-item label="资质等级" v-if="data.type!=='OTHER'">
<span v-if="data.value2.grade===10">国家级</span>
<span v-if="data.value2.grade===20">省级</span>
<span v-if="data.value2.grade===30">市级</span>
</el-form-item>
<el-form-item label="" v-if="data.value2.grade1">
<span v-if="data.value2.grade1===10">国家级</span>
<span v-if="data.value2.grade1===20">省级</span>
<span v-if="data.value2.grade1===30">市级</span>
<span v-if="data.grade===10">国家级</span>
<span v-if="data.grade===20">省级</span>
<span v-if="data.grade===30">市级</span>
</el-form-item>
<el-form-item label="二级等级" v-if="data.type==='OTHER'">
{{ data.value2.level }}
</el-form-item>
<el-form-item label="" v-if="data.value2.level1">
<span style="color: #f56c6c;">{{data.value2.level1}}</span>
{{ data.level }}
</el-form-item>
<el-form-item label="资质范围">
{{data.value2.scope}}
</el-form-item>
<el-form-item label="" v-if="data.value2.scope1">
<span style="color: #f56c6c;">{{data.value2.scope1}}</span>
{{data.scope}}
</el-form-item>
<el-form-item label="描述">
{{data.value2.description}}
</el-form-item>
<el-form-item label="" v-if="data.value2.description1">
<span style="color: #f56c6c;">{{data.value2.description1}}</span>
{{data.description}}
</el-form-item>
<el-form-item label="备案城市" v-if="data.type==='OTHER'">
{{ data.value2.citys }}
<span v-for="item in data.citys_" :key="item.id">{{item.name}}</span>
<!--{{ data.value2.citys }}-->
</el-form-item>
<el-form-item label="所在省" v-if="data.type!=='OTHER'">
{{ data.value2.province }}
<el-form-item label="所在省" v-if="data.grade===20">
{{ data.province_name }}
</el-form-item>
<el-form-item label="所在市" v-if="data.type!=='OTHER'">
{{ data.value2.city }}
</el-form-item>
<el-form-item label="报送人">
{{ data.value2.name }}
<el-form-item label="所在市" v-if="data.grade==30">
{{ data.city_name }}
</el-form-item>
</el-form>
<div v-if="showData.type==='quali:update'">
@ -86,7 +64,7 @@
{{formData.description}}
</el-form-item>
<el-form-item label="备案城市" v-if="formData.type==='OTHER'">
{{ formData.province_name }}{{ formData.city_name }}
<span v-for="item in data.value2.citys_" :key="item.id">{{item.name}}</span>
</el-form-item>
<el-form-item label="所在省" v-if="formData.grade===20">
{{ formData.province_name }}
@ -121,7 +99,8 @@
<span :class="setClass('description')"> {{ formData2.description }}</span>
</el-form-item>
<el-form-item label="备案城市" v-if="formData2.type==='OTHER'">
<span :class="setClass('citys')"> {{ formData2.province_name}}{{ formData2.city_name }}</span>
<span :class="setClass('citys')" v-for="item in data.value2.citys_" :key="item.id">{{item.name}}</span>
<!--<span :class="setClass('citys')"> {{ formData2.province_name}}{{ formData2.city_name }}</span>-->
</el-form-item>
<el-form-item label="所在省" v-if="formData2.grade===20">
<span :class="setClass('provice')"> {{ formData2.province_name}}</span>
@ -174,7 +153,6 @@
},
mounted() {
this.initRecord();
this.getProvince();
},
methods: {
setClass(item){
@ -185,27 +163,30 @@
return obj;
},
initRecord() {
// debugger;
//操作类型查看/确认
this.action = this.showData.action;
this.data = Object.assign({}, this.showData.data);
qactionItem(this.data.id).then(res=>{
let that = this;
that.action = that.showData.action;
let type = that.showData.type;
qactionItem(that.showData.id).then(res=>{
if (res.code>=200) {
this.formData =Object.assign({}, res.data.value1);
this.formData2 = res.data.value1;
debugger;
console.log(this.formData);
console.log(this.formData2);
if(type==='quali:create'){
that.data = res.data.value2;
}else{
that.formData =Object.assign({}, res.data.value1);
that.formData2 = res.data.value1;
let fieldList = [];
let updateDetail = res.data.update_detail;//更改字段
for( let key in this.formData2 ){
for( let key in that.formData2 ){
fieldList.push(key);//所有字段
}
updateDetail.forEach(item=>{
if(fieldList.indexOf(item.field)>-1){
this.formData2[item.field] = item.value2;
that.formData2[item.field] = item.value2;
}
});
}
}
})
},
confirm() {