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

View File

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

View File

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