2022-06-08 14:51:11 +08:00
|
|
|
|
<template>
|
|
|
|
|
|
<!-- 检查部位 -->
|
|
|
|
|
|
<vue-scroll style="height: 100%">
|
|
|
|
|
|
<div class="checkPoint">
|
2023-04-27 15:22:14 +08:00
|
|
|
|
<el-button type="primary" size="medium" @click="newRootNode">新增区域</el-button>
|
2022-06-08 14:51:11 +08:00
|
|
|
|
<el-table
|
|
|
|
|
|
:data="tableData"
|
|
|
|
|
|
style="width: 100%; margin: 20px 0"
|
|
|
|
|
|
row-key="id"
|
|
|
|
|
|
default-expand-all
|
|
|
|
|
|
:tree-props="{ children: 'children' }"
|
|
|
|
|
|
class="tables"
|
|
|
|
|
|
>
|
|
|
|
|
|
<el-table-column
|
|
|
|
|
|
prop="regionName"
|
|
|
|
|
|
:label="$t('message.quality.regionName')"
|
2023-04-27 15:22:14 +08:00
|
|
|
|
|
2022-06-08 14:51:11 +08:00
|
|
|
|
>
|
|
|
|
|
|
</el-table-column>
|
|
|
|
|
|
<el-table-column
|
2023-04-27 15:22:14 +08:00
|
|
|
|
align="center"
|
|
|
|
|
|
|
2022-06-08 14:51:11 +08:00
|
|
|
|
prop="regionCode"
|
|
|
|
|
|
:label="$t('message.quality.coding')"
|
|
|
|
|
|
>
|
|
|
|
|
|
</el-table-column>
|
|
|
|
|
|
<el-table-column
|
2024-04-29 15:57:52 +08:00
|
|
|
|
align="center"
|
|
|
|
|
|
|
|
|
|
|
|
prop="regionCode"
|
|
|
|
|
|
:label="$t('message.quality.unit')"
|
|
|
|
|
|
>
|
|
|
|
|
|
</el-table-column>
|
|
|
|
|
|
<el-table-column
|
2023-04-27 15:22:14 +08:00
|
|
|
|
align="center"
|
|
|
|
|
|
|
2022-06-08 14:51:11 +08:00
|
|
|
|
prop="dutyName"
|
|
|
|
|
|
:label="$t('message.quality.rectificationPeople')"
|
|
|
|
|
|
>
|
|
|
|
|
|
</el-table-column>
|
2023-10-13 17:51:24 +08:00
|
|
|
|
<!-- <el-table-column
|
2023-04-27 15:22:14 +08:00
|
|
|
|
align="center"
|
|
|
|
|
|
|
2022-06-08 14:51:11 +08:00
|
|
|
|
prop="intendanceNames"
|
|
|
|
|
|
:label="$t('message.quality.notifier')"
|
|
|
|
|
|
>
|
2023-10-13 17:51:24 +08:00
|
|
|
|
</el-table-column> -->
|
2023-04-27 15:22:14 +08:00
|
|
|
|
<el-table-column prop="remark" :label="$t('message.quality.explain')" align="center"
|
|
|
|
|
|
>
|
2022-06-08 14:51:11 +08:00
|
|
|
|
</el-table-column>
|
|
|
|
|
|
<el-table-column
|
|
|
|
|
|
prop="remark"
|
|
|
|
|
|
:label="$t('message.quality.operation')"
|
|
|
|
|
|
align="center"
|
|
|
|
|
|
>
|
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
|
<div class="flex2 edit">
|
|
|
|
|
|
<img src="@/assets/images/icon-edit.png" />
|
|
|
|
|
|
<el-button type="text" @click="editBtn(scope.row)">{{
|
2023-02-27 18:47:21 +08:00
|
|
|
|
$t('message.quality.compile')
|
|
|
|
|
|
}}</el-button>
|
|
|
|
|
|
<el-button type="text" @click="newJuniorBtn(scope.row)">{{
|
|
|
|
|
|
$t('message.quality.newJunior')
|
|
|
|
|
|
}}</el-button>
|
|
|
|
|
|
<el-button type="text" @click="deleteBtn(scope.row)">{{
|
|
|
|
|
|
$t('message.quality.delete')
|
2022-06-08 14:51:11 +08:00
|
|
|
|
}}</el-button>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
</el-table-column>
|
|
|
|
|
|
</el-table>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<el-dialog
|
|
|
|
|
|
:modal-append-to-body="false"
|
|
|
|
|
|
@close="close"
|
|
|
|
|
|
:title="title"
|
|
|
|
|
|
:visible.sync="editDialog"
|
|
|
|
|
|
width="666px"
|
|
|
|
|
|
>
|
|
|
|
|
|
<div class="dialog_content">
|
|
|
|
|
|
<el-form ref="form" :model="form" label-width="80px" size="medium">
|
|
|
|
|
|
<el-form-item
|
|
|
|
|
|
:label="$t('message.quality.regionName')"
|
|
|
|
|
|
prop="regionName"
|
|
|
|
|
|
:rules="[
|
|
|
|
|
|
{
|
|
|
|
|
|
required: true,
|
|
|
|
|
|
message:
|
|
|
|
|
|
$t('message.quality.pleaseEnter') +
|
|
|
|
|
|
$t('message.quality.regionName'),
|
2023-02-27 18:47:21 +08:00
|
|
|
|
trigger: 'blur'
|
|
|
|
|
|
}
|
2022-06-08 14:51:11 +08:00
|
|
|
|
]"
|
|
|
|
|
|
>
|
|
|
|
|
|
<el-input
|
2023-04-27 15:22:14 +08:00
|
|
|
|
placeholder="请输入区域名称"
|
2022-06-08 14:51:11 +08:00
|
|
|
|
v-model="form.regionName"
|
|
|
|
|
|
:disabled="dialogType == 2"
|
|
|
|
|
|
></el-input>
|
|
|
|
|
|
</el-form-item>
|
2024-04-29 15:57:52 +08:00
|
|
|
|
<!-- 责任单位 start -->
|
|
|
|
|
|
<el-form-item :label="$t('message.quality.personWork')">
|
2022-06-08 14:51:11 +08:00
|
|
|
|
<el-select
|
|
|
|
|
|
v-model="form.dutyId"
|
|
|
|
|
|
filterable
|
2024-04-29 15:57:52 +08:00
|
|
|
|
multiple
|
2022-06-08 14:51:11 +08:00
|
|
|
|
@change="changeDutyId"
|
|
|
|
|
|
:placeholder="$t('message.quality.pleaseSelect')"
|
|
|
|
|
|
style="width: 100%"
|
|
|
|
|
|
prop="dutyId"
|
|
|
|
|
|
clearable
|
2024-04-29 15:57:52 +08:00
|
|
|
|
>
|
|
|
|
|
|
<el-option
|
|
|
|
|
|
v-for="item in enterpriseInfoList"
|
|
|
|
|
|
:key="item.id"
|
|
|
|
|
|
:label="item.enterpriseName"
|
|
|
|
|
|
:value="item.id"
|
|
|
|
|
|
>
|
|
|
|
|
|
<span style="float: left">{{ item.enterpriseName }}</span>
|
|
|
|
|
|
</el-option>
|
|
|
|
|
|
</el-select>
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
<!-- 责任单位 end -->
|
|
|
|
|
|
<!-- 责任人 start -->
|
|
|
|
|
|
<el-form-item :label="$t('message.quality.personLiable')">
|
|
|
|
|
|
<el-select
|
|
|
|
|
|
v-model="form.personId"
|
|
|
|
|
|
filterable
|
|
|
|
|
|
multiple
|
|
|
|
|
|
@change="changeDutyId"
|
|
|
|
|
|
:placeholder="$t('message.quality.pleaseSelect')"
|
|
|
|
|
|
style="width: 100%"
|
|
|
|
|
|
prop="personId"
|
|
|
|
|
|
clearable
|
2022-06-08 14:51:11 +08:00
|
|
|
|
>
|
|
|
|
|
|
<el-option
|
|
|
|
|
|
v-for="item in notifierOrPeopleList"
|
|
|
|
|
|
:key="item.userId"
|
2024-04-29 15:57:52 +08:00
|
|
|
|
:label="item.notifierOrPeopleList"
|
2022-06-08 14:51:11 +08:00
|
|
|
|
:value="item.userId"
|
|
|
|
|
|
>
|
|
|
|
|
|
<span style="float: left">{{ item.realName }}</span>
|
|
|
|
|
|
</el-option>
|
|
|
|
|
|
</el-select>
|
|
|
|
|
|
</el-form-item>
|
2024-04-29 15:57:52 +08:00
|
|
|
|
<!-- 责任人 end -->
|
|
|
|
|
|
|
2023-10-13 17:51:24 +08:00
|
|
|
|
<!-- <el-form-item :label="$t('message.quality.notifier')">
|
2022-06-08 14:51:11 +08:00
|
|
|
|
<el-select
|
|
|
|
|
|
v-model="form.intendanceIds"
|
|
|
|
|
|
filterable
|
|
|
|
|
|
@change="changeIntendanceIds"
|
|
|
|
|
|
multiple
|
|
|
|
|
|
prop="intendanceIds"
|
|
|
|
|
|
:placeholder="$t('message.quality.pleaseSelect')"
|
|
|
|
|
|
style="width: 100%"
|
|
|
|
|
|
>
|
|
|
|
|
|
<el-option
|
|
|
|
|
|
v-for="item in notifierOrPeopleList"
|
|
|
|
|
|
:key="item.userId"
|
|
|
|
|
|
:label="item.workerName"
|
|
|
|
|
|
:value="item.userId"
|
|
|
|
|
|
>
|
2023-10-13 17:51:24 +08:00
|
|
|
|
<span style="float: left">{{ item.realName }}</span> -->
|
2023-02-27 18:47:21 +08:00
|
|
|
|
<!-- <span-->
|
|
|
|
|
|
<!-- style="-->
|
|
|
|
|
|
<!-- float: right;-->
|
|
|
|
|
|
<!-- color: #aaaaaa;-->
|
|
|
|
|
|
<!-- font-size: 13px;-->
|
|
|
|
|
|
<!-- margin-right: 24px;-->
|
|
|
|
|
|
<!-- "-->
|
|
|
|
|
|
<!-- >{{ $t('message.quality.phoneNumber') }}:{{-->
|
|
|
|
|
|
<!-- item.userTel-->
|
|
|
|
|
|
<!-- ? item.userTel.substring(0, 3) +-->
|
|
|
|
|
|
<!-- "****" +-->
|
|
|
|
|
|
<!-- item.userTel.substring(7)-->
|
|
|
|
|
|
<!-- : ""-->
|
|
|
|
|
|
<!-- }}</span-->
|
|
|
|
|
|
<!-- >-->
|
2023-10-13 17:51:24 +08:00
|
|
|
|
<!-- </el-option>
|
2022-06-08 14:51:11 +08:00
|
|
|
|
</el-select>
|
2023-10-13 17:51:24 +08:00
|
|
|
|
</el-form-item> -->
|
2022-06-08 14:51:11 +08:00
|
|
|
|
<el-form-item :label="$t('message.quality.explain')">
|
|
|
|
|
|
<el-input
|
|
|
|
|
|
prop="remark"
|
|
|
|
|
|
v-model="form.remark"
|
|
|
|
|
|
type="textarea"
|
|
|
|
|
|
></el-input>
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
<el-form-item>
|
|
|
|
|
|
<!-- <el-checkbox-group v-model="showList">
|
|
|
|
|
|
<el-checkbox :label="1" name="type"
|
|
|
|
|
|
>{{ $t("message.quality.rectificationPeople")
|
|
|
|
|
|
}}{{ $t("message.quality.copyToSubordinate") }}</el-checkbox
|
|
|
|
|
|
>
|
|
|
|
|
|
<el-checkbox :label="2" name="type"
|
|
|
|
|
|
>{{ $t("message.quality.notifier")
|
|
|
|
|
|
}}{{ $t("message.quality.copyToSubordinate") }}</el-checkbox
|
|
|
|
|
|
>
|
|
|
|
|
|
</el-checkbox-group> -->
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
</el-form>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div class="dialog-footer">
|
|
|
|
|
|
<el-button
|
|
|
|
|
|
class="cancleBtn"
|
|
|
|
|
|
@click="editDialog = false"
|
|
|
|
|
|
icon="el-icon-circle-close"
|
|
|
|
|
|
size="medium"
|
2023-02-27 18:47:21 +08:00
|
|
|
|
>{{ $t('message.alarmValueSet.cancel') }}
|
2022-06-08 14:51:11 +08:00
|
|
|
|
</el-button>
|
|
|
|
|
|
<el-button
|
|
|
|
|
|
type="primary"
|
|
|
|
|
|
icon="el-icon-circle-check"
|
|
|
|
|
|
@click="submit('form')"
|
|
|
|
|
|
size="medium"
|
2023-02-27 18:47:21 +08:00
|
|
|
|
>{{ $t('message.alarmValueSet.save') }}
|
2022-06-08 14:51:11 +08:00
|
|
|
|
</el-button>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</el-dialog>
|
|
|
|
|
|
</vue-scroll>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
|
|
|
import {
|
|
|
|
|
|
addQualityRegionApi,
|
|
|
|
|
|
getQualityRegionListApi,
|
|
|
|
|
|
deleteQualityRegionListApi,
|
2023-02-27 18:47:21 +08:00
|
|
|
|
editQualityRegionListApi
|
|
|
|
|
|
} from '@/assets/js/api/quality.js'
|
2024-04-29 15:57:52 +08:00
|
|
|
|
import { getProjectChilderSystemUserListApi,getEnterpriseInfoListApi } from '@/assets/js/api/configManage.js'
|
2022-06-08 14:51:11 +08:00
|
|
|
|
export default {
|
|
|
|
|
|
data() {
|
|
|
|
|
|
return {
|
|
|
|
|
|
title: this.$t('message.quality.NewRootNode'),
|
|
|
|
|
|
dialogType: 1,
|
2023-02-27 18:47:21 +08:00
|
|
|
|
projectSn: '',
|
2022-06-08 14:51:11 +08:00
|
|
|
|
notifierOrPeopleList: [],
|
2024-04-29 15:57:52 +08:00
|
|
|
|
enterpriseInfoList:[],
|
2023-02-27 18:47:21 +08:00
|
|
|
|
value: '',
|
2022-06-08 14:51:11 +08:00
|
|
|
|
tableData: [],
|
|
|
|
|
|
editDialog: false,
|
|
|
|
|
|
form: {
|
2023-02-27 18:47:21 +08:00
|
|
|
|
regionName: '',
|
|
|
|
|
|
dutyId: '',
|
2024-04-29 15:57:52 +08:00
|
|
|
|
personId: [],
|
2022-06-08 14:51:11 +08:00
|
|
|
|
intendanceIds: [],
|
2023-02-27 18:47:21 +08:00
|
|
|
|
intendanceNames: '',
|
2024-04-29 15:57:52 +08:00
|
|
|
|
remark: '',
|
|
|
|
|
|
enterpriseName:''
|
2022-06-08 14:51:11 +08:00
|
|
|
|
},
|
2023-02-27 18:47:21 +08:00
|
|
|
|
showList: []
|
|
|
|
|
|
}
|
2022-06-08 14:51:11 +08:00
|
|
|
|
},
|
|
|
|
|
|
created() {
|
2023-02-27 18:47:21 +08:00
|
|
|
|
this.projectSn = this.$store.state.projectSn
|
|
|
|
|
|
this.getQualityRegionList()
|
2022-06-08 14:51:11 +08:00
|
|
|
|
},
|
|
|
|
|
|
methods: {
|
|
|
|
|
|
// 获取列表信息
|
|
|
|
|
|
getQualityRegionList() {
|
|
|
|
|
|
let data = {
|
2023-02-27 18:47:21 +08:00
|
|
|
|
projectSn: this.projectSn
|
|
|
|
|
|
}
|
2022-06-08 14:51:11 +08:00
|
|
|
|
getQualityRegionListApi(data).then((res) => {
|
2024-04-29 15:57:52 +08:00
|
|
|
|
console.log(res);
|
2022-06-08 14:51:11 +08:00
|
|
|
|
if (res.code == 200) {
|
2023-02-27 18:47:21 +08:00
|
|
|
|
this.tableData = res.result
|
2022-06-08 14:51:11 +08:00
|
|
|
|
}
|
2023-02-27 18:47:21 +08:00
|
|
|
|
})
|
2022-06-08 14:51:11 +08:00
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
//新增根节点按钮
|
|
|
|
|
|
newRootNode() {
|
|
|
|
|
|
this.form = {
|
2023-02-27 18:47:21 +08:00
|
|
|
|
regionName: '',
|
|
|
|
|
|
dutyId: '',
|
2022-06-08 14:51:11 +08:00
|
|
|
|
intendanceIds: [],
|
2023-02-27 18:47:21 +08:00
|
|
|
|
intendanceNames: '',
|
2024-04-29 15:57:52 +08:00
|
|
|
|
remark: '',
|
2023-02-27 18:47:21 +08:00
|
|
|
|
}
|
|
|
|
|
|
this.editDialog = true
|
2023-04-27 15:22:14 +08:00
|
|
|
|
this.title ='新增区域'
|
2023-02-27 18:47:21 +08:00
|
|
|
|
this.dialogType = 1
|
|
|
|
|
|
this.getNotifierOrPeopleList()
|
2022-06-08 14:51:11 +08:00
|
|
|
|
},
|
|
|
|
|
|
//切换 整改人
|
|
|
|
|
|
changeDutyId(value) {
|
|
|
|
|
|
for (let i = 0; i < this.notifierOrPeopleList.length; i++) {
|
|
|
|
|
|
if (value == this.notifierOrPeopleList[i].userId) {
|
2023-02-27 18:47:21 +08:00
|
|
|
|
this.form.dutyName = this.notifierOrPeopleList[i].workerName
|
2022-06-08 14:51:11 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
//切换 通知人
|
|
|
|
|
|
changeIntendanceIds(value) {
|
2023-02-27 18:47:21 +08:00
|
|
|
|
let arrList = this.notifierOrPeopleList
|
|
|
|
|
|
let nameArr = []
|
2022-06-08 14:51:11 +08:00
|
|
|
|
for (let i = 0; i < value.length; i++) {
|
|
|
|
|
|
for (let j = 0; j < arrList.length; j++) {
|
|
|
|
|
|
if (arrList[j].userId == value[i]) {
|
2023-02-27 18:47:21 +08:00
|
|
|
|
nameArr.push(arrList[j].workerName)
|
2022-06-08 14:51:11 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2023-02-27 18:47:21 +08:00
|
|
|
|
this.form.intendanceNames = nameArr.length > 0 ? nameArr.join(',') : ''
|
2022-06-08 14:51:11 +08:00
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
//编辑按钮
|
|
|
|
|
|
editBtn(value) {
|
2023-12-02 11:52:03 +08:00
|
|
|
|
if(value.intendanceIds == '' || value.intendanceIds == null) {
|
2023-07-04 21:16:23 +08:00
|
|
|
|
this.form.intendanceIds = null
|
|
|
|
|
|
}else {
|
|
|
|
|
|
this.form.intendanceIds = value.intendanceIds.split(',')
|
|
|
|
|
|
}
|
|
|
|
|
|
console.log('编辑',value)
|
2023-02-27 18:47:21 +08:00
|
|
|
|
this.form.regionName = value.regionName
|
|
|
|
|
|
this.form.dutyId = value.dutyId ? value.dutyId : ''
|
|
|
|
|
|
this.form.remark = value.remark
|
|
|
|
|
|
this.form.id = value.id
|
2023-04-27 15:22:14 +08:00
|
|
|
|
this.title = '编辑区域'
|
2023-02-27 18:47:21 +08:00
|
|
|
|
this.dialogType = 2
|
|
|
|
|
|
this.getNotifierOrPeopleList()
|
|
|
|
|
|
this.editDialog = true
|
2022-06-08 14:51:11 +08:00
|
|
|
|
},
|
|
|
|
|
|
//新增下级---按钮
|
|
|
|
|
|
newJuniorBtn(value) {
|
2023-02-27 18:47:21 +08:00
|
|
|
|
console.log(value)
|
2022-06-08 14:51:11 +08:00
|
|
|
|
this.form = {
|
2023-02-27 18:47:21 +08:00
|
|
|
|
regionName: '',
|
|
|
|
|
|
dutyId: '',
|
2022-06-08 14:51:11 +08:00
|
|
|
|
intendanceIds: [],
|
2023-02-27 18:47:21 +08:00
|
|
|
|
intendanceNames: '',
|
2024-04-29 15:57:52 +08:00
|
|
|
|
remark: '',
|
2023-02-27 18:47:21 +08:00
|
|
|
|
}
|
|
|
|
|
|
this.form.parentRegion = value.id
|
2024-04-29 15:57:52 +08:00
|
|
|
|
// console.log(this.form)
|
2023-02-27 18:47:21 +08:00
|
|
|
|
this.editDialog = true
|
|
|
|
|
|
this.title = this.$t('message.quality.newJunior')
|
|
|
|
|
|
this.dialogType = 3
|
|
|
|
|
|
this.getNotifierOrPeopleList()
|
2022-06-08 14:51:11 +08:00
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
//获取 整改人 通知人下拉列表
|
|
|
|
|
|
getNotifierOrPeopleList() {
|
|
|
|
|
|
let data = {
|
2024-04-29 15:57:52 +08:00
|
|
|
|
projectSn: this.projectSn,
|
|
|
|
|
|
enterpriseId: this.enterpriseId
|
2023-02-27 18:47:21 +08:00
|
|
|
|
}
|
2022-06-08 14:51:11 +08:00
|
|
|
|
getProjectChilderSystemUserListApi(data).then((res) => {
|
2024-04-29 15:57:52 +08:00
|
|
|
|
console.log(res);
|
2022-06-08 14:51:11 +08:00
|
|
|
|
if (res.code == 200) {
|
2023-02-27 18:47:21 +08:00
|
|
|
|
console.log('------整改人', res)
|
2024-04-29 15:57:52 +08:00
|
|
|
|
console.log('------form', this.form)
|
2023-02-27 18:47:21 +08:00
|
|
|
|
this.notifierOrPeopleList = res.result
|
2022-06-08 14:51:11 +08:00
|
|
|
|
}
|
2023-02-27 18:47:21 +08:00
|
|
|
|
})
|
2024-04-29 15:57:52 +08:00
|
|
|
|
getEnterpriseInfoListApi({projectSn: this.projectSn}).then(res=>{
|
|
|
|
|
|
console.log(res);
|
|
|
|
|
|
if(res.code==200){
|
|
|
|
|
|
this.enterpriseInfoList = res.result
|
|
|
|
|
|
}
|
|
|
|
|
|
})
|
2022-06-08 14:51:11 +08:00
|
|
|
|
},
|
|
|
|
|
|
//弹窗---保存按钮
|
|
|
|
|
|
submit(formName) {
|
|
|
|
|
|
this.$refs[formName].validate((valid) => {
|
|
|
|
|
|
if (valid) {
|
|
|
|
|
|
let data = {
|
|
|
|
|
|
dutyId: this.form.dutyId,
|
|
|
|
|
|
dutyName: this.form.dutyName,
|
2023-10-19 15:01:53 +08:00
|
|
|
|
// intendanceIds: this.form.intendanceIds.join(','),
|
2022-06-08 14:51:11 +08:00
|
|
|
|
intendanceNames: this.form.intendanceNames,
|
|
|
|
|
|
regionName: this.form.regionName,
|
|
|
|
|
|
remark: this.form.remark,
|
|
|
|
|
|
projectSn: this.projectSn,
|
2023-02-27 18:47:21 +08:00
|
|
|
|
parentRegion: this.form.parentRegion
|
|
|
|
|
|
}
|
2022-06-08 14:51:11 +08:00
|
|
|
|
if (this.dialogType == 1) {
|
|
|
|
|
|
addQualityRegionApi(data).then((res) => {
|
|
|
|
|
|
// console.log(res);
|
|
|
|
|
|
if (res.code == 200) {
|
2023-02-27 18:47:21 +08:00
|
|
|
|
this.$message.success(this.$t('message.quality.newSuccess'))
|
|
|
|
|
|
this.editDialog = false
|
|
|
|
|
|
this.getQualityRegionList()
|
2022-06-08 14:51:11 +08:00
|
|
|
|
}
|
2023-02-27 18:47:21 +08:00
|
|
|
|
})
|
2022-06-08 14:51:11 +08:00
|
|
|
|
} else if (this.dialogType == 2) {
|
2023-02-27 18:47:21 +08:00
|
|
|
|
data.id = this.form.id
|
2022-06-08 14:51:11 +08:00
|
|
|
|
editQualityRegionListApi(data).then((res) => {
|
|
|
|
|
|
if (res.code == 200) {
|
2023-02-27 18:47:21 +08:00
|
|
|
|
this.editDialog = false
|
|
|
|
|
|
this.$message.success(res.message)
|
|
|
|
|
|
this.getQualityRegionList()
|
2022-06-08 14:51:11 +08:00
|
|
|
|
}
|
2023-02-27 18:47:21 +08:00
|
|
|
|
})
|
2022-06-08 14:51:11 +08:00
|
|
|
|
} else if (this.dialogType == 3) {
|
2023-02-27 18:47:21 +08:00
|
|
|
|
data.parentRegion = this.form.parentRegion
|
2022-06-08 14:51:11 +08:00
|
|
|
|
addQualityRegionApi(data).then((res) => {
|
|
|
|
|
|
if (res.code == 200) {
|
2023-02-27 18:47:21 +08:00
|
|
|
|
this.$message.success(this.$t('message.quality.newSuccess'))
|
|
|
|
|
|
this.editDialog = false
|
|
|
|
|
|
this.getQualityRegionList()
|
2022-06-08 14:51:11 +08:00
|
|
|
|
}
|
2023-02-27 18:47:21 +08:00
|
|
|
|
})
|
2022-06-08 14:51:11 +08:00
|
|
|
|
}
|
|
|
|
|
|
} else {
|
2023-02-27 18:47:21 +08:00
|
|
|
|
return false
|
2022-06-08 14:51:11 +08:00
|
|
|
|
}
|
2023-02-27 18:47:21 +08:00
|
|
|
|
})
|
2022-06-08 14:51:11 +08:00
|
|
|
|
},
|
|
|
|
|
|
//删除 按钮
|
|
|
|
|
|
deleteBtn(value) {
|
2023-02-27 18:47:21 +08:00
|
|
|
|
this.$confirm(
|
|
|
|
|
|
this.$t('message.quality.deleteHint'),
|
|
|
|
|
|
this.$t('message.quality.hint'),
|
|
|
|
|
|
{
|
|
|
|
|
|
confirmButtonText: this.$t('message.quality.confirm'),
|
|
|
|
|
|
cancelButtonText: this.$t('message.quality.cancel'),
|
|
|
|
|
|
type: 'warning'
|
|
|
|
|
|
}
|
|
|
|
|
|
)
|
2022-06-08 14:51:11 +08:00
|
|
|
|
.then(() => {
|
|
|
|
|
|
let data = {
|
2023-02-27 18:47:21 +08:00
|
|
|
|
id: value.id
|
|
|
|
|
|
}
|
2022-06-08 14:51:11 +08:00
|
|
|
|
|
|
|
|
|
|
deleteQualityRegionListApi(data).then((res) => {
|
|
|
|
|
|
if (res.code == 200) {
|
|
|
|
|
|
this.$message({
|
2023-02-27 18:47:21 +08:00
|
|
|
|
type: 'success',
|
|
|
|
|
|
message: this.$t('message.quality.successfullyDelete') + '!'
|
|
|
|
|
|
})
|
|
|
|
|
|
this.getQualityRegionList()
|
2022-06-08 14:51:11 +08:00
|
|
|
|
}
|
2023-02-27 18:47:21 +08:00
|
|
|
|
})
|
2022-06-08 14:51:11 +08:00
|
|
|
|
})
|
2023-02-27 18:47:21 +08:00
|
|
|
|
.catch(() => {})
|
2022-06-08 14:51:11 +08:00
|
|
|
|
},
|
|
|
|
|
|
|
2023-10-13 17:51:24 +08:00
|
|
|
|
close() {
|
|
|
|
|
|
this.$nextTick(() => {
|
|
|
|
|
|
this.$refs.form.clearValidate()
|
|
|
|
|
|
})
|
|
|
|
|
|
}
|
2023-02-27 18:47:21 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
2022-06-08 14:51:11 +08:00
|
|
|
|
</script>
|
|
|
|
|
|
<style lang="less" scoped>
|
|
|
|
|
|
.flex {
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
}
|
|
|
|
|
|
.flex2 {
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
align-items: center;
|
|
|
|
|
|
}
|
|
|
|
|
|
.checkPoint {
|
|
|
|
|
|
padding: 16px 20px;
|
|
|
|
|
|
box-sizing: border-box;
|
|
|
|
|
|
.edit {
|
|
|
|
|
|
width: 100%;
|
|
|
|
|
|
justify-content: center;
|
|
|
|
|
|
cursor: pointer;
|
|
|
|
|
|
img {
|
|
|
|
|
|
margin-right: 5px;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
</style>
|