|
@@ -1,13 +1,14 @@
|
|
|
<template v-if="show">
|
|
|
|
|
|
<div>
|
|
|
+ <a-spin :spinning="loading">
|
|
|
<a-form layout="vertical" class="form">
|
|
|
<a-row :gutter="24">
|
|
|
<a-col :xl="24" :lg="24" :md="12" :sm="24" :xs="24">
|
|
|
- <a-form-item class="formItem">
|
|
|
- <a-radio-group v-model="flag.status" class="checkBoxGroup" @change="deleteRdfm" :disabled="!$api.btnPms">
|
|
|
- <a-radio value="0">{{ $t('functional-analysis.top-modal.manual tagging') }}</a-radio>
|
|
|
- <a-radio class="radio" value="1">{{ $t('functional-analysis.top-modal.automatic tagging') }}</a-radio>
|
|
|
+ <a-form-item class="formItem" :label="$t('functional-analysis.top-modal.whether-enable-automatic-marking')">
|
|
|
+ <a-radio-group v-model="flag.status" class="checkBoxGroup" :disabled="!$api.btnPms">
|
|
|
+ <a-radio class="radio" value="1">{{ $t('functional-analysis.top-modal.yes') }}</a-radio>
|
|
|
+ <a-radio value="0">{{ $t('functional-analysis.top-modal.no') }}</a-radio>
|
|
|
</a-radio-group>
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
@@ -23,57 +24,42 @@
|
|
|
:dataSource="tableData"
|
|
|
:scroll="{ y: 'calc(88vh - 400px)' }"
|
|
|
:pagination="false">
|
|
|
-
|
|
|
- <!-- <template v-slot:picFlag='text, record'>-->
|
|
|
- <!-- <span v-if="record.classifyType === '2'">{{ record.lexplain }}</span>-->
|
|
|
- <!-- <img width='25' height='25' v-else :src=" this.$api.baseUrl + '/DFMEA/file/' + record.fileName" />-->
|
|
|
- <!-- </template>-->
|
|
|
- <!-- 操作-->
|
|
|
- <template v-slot:action='text, record'>
|
|
|
- <a
|
|
|
- href="javascript:;"
|
|
|
- @click="update(record)"
|
|
|
- :disabled="!$api.btnPms"
|
|
|
- class="operate-btn"
|
|
|
- >
|
|
|
- <a-tooltip :title="$t('functional-analysis.top-modal.update')">
|
|
|
- <i class="iconfont iconicon-bainji"></i>
|
|
|
- </a-tooltip>
|
|
|
- </a>
|
|
|
-
|
|
|
- </template>
|
|
|
</a-table>
|
|
|
<div class="mt10 text-right">
|
|
|
<a-button @click="mark" :disabled="!$api.btnPms">
|
|
|
{{ $t('functional-analysis.top-modal.flush tagging') }}
|
|
|
</a-button>
|
|
|
+ <!-- 确定-->
|
|
|
+ <a-button @click="ascertain" class="ml-2" type='primary' :disabled="!$api.btnPms">
|
|
|
+ {{ $t('functional-analysis.top-modal.confirm') }}
|
|
|
+ </a-button>
|
|
|
+ <!-- 取消-->
|
|
|
+ <a-button @click="countermand" class="ml-2">
|
|
|
+ {{ $t('functional-analysis.top-modal.cancel') }}
|
|
|
+ </a-button>
|
|
|
</div>
|
|
|
</a-form>
|
|
|
-
|
|
|
- <EditPropertyTagged :queryParam="modalData" ref="visible"></EditPropertyTagged>
|
|
|
+ </a-spin>
|
|
|
</div>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import EditPropertyTagged from "@/views/fmeaTree/components/TopBtnModal/components/EditPropertyTagged";
|
|
|
|
|
|
export default {
|
|
|
inject: ['reload'],
|
|
|
name: "PropertyTagged",
|
|
|
- components: {EditPropertyTagged},
|
|
|
data() {
|
|
|
return {
|
|
|
tableData: [],
|
|
|
loading: false,
|
|
|
show: true,
|
|
|
flag: {
|
|
|
+ originalStatus: '',// 是否开启自动标记原始值
|
|
|
status: ''
|
|
|
},
|
|
|
propDetailData: {},
|
|
|
pductClassifyId: '',
|
|
|
- //模态窗的值
|
|
|
- modalData: [],
|
|
|
// 表头
|
|
|
tableColumns: [
|
|
|
{
|
|
@@ -113,42 +99,47 @@ export default {
|
|
|
width: 125,
|
|
|
ellipsis: true,
|
|
|
},
|
|
|
+ // s值范围
|
|
|
{
|
|
|
- title: () => this.$t('functional-analysis.top-modal.S start'),
|
|
|
- dataIndex: 'severityMax',
|
|
|
- width: 125,
|
|
|
+ title: () => this.$t('functional-analysis.top-modal.S-scope'),
|
|
|
+ customRender: (text, row, index) => {
|
|
|
+ if (row.sstart && row.send){
|
|
|
+ return row.sstart + '~' + row.send;
|
|
|
+ } else {
|
|
|
+ return '~';
|
|
|
+ }
|
|
|
+ },
|
|
|
align: 'center',
|
|
|
- // ellipsis: true,
|
|
|
- },
|
|
|
- {
|
|
|
- title: () => this.$t('functional-analysis.top-modal.S end'),
|
|
|
- dataIndex: 'severityMin',
|
|
|
width: 125,
|
|
|
- align: 'center',
|
|
|
- // ellipsis: true,
|
|
|
+ ellipsis: true,
|
|
|
},
|
|
|
+ // o值范围
|
|
|
{
|
|
|
- title: () => this.$t('functional-analysis.top-modal.O start'),
|
|
|
- dataIndex: 'occurrenceMax',
|
|
|
- width: 125,
|
|
|
+ title: () => this.$t('functional-analysis.top-modal.O-scope'),
|
|
|
+ customRender: (text, row, index) => {
|
|
|
+ if (row.ostart && row.oend){
|
|
|
+ return row.ostart + '~' + row.oend;
|
|
|
+ } else {
|
|
|
+ return '~';
|
|
|
+ }
|
|
|
+ },
|
|
|
align: 'center',
|
|
|
- // ellipsis: true,
|
|
|
- },
|
|
|
- {
|
|
|
- title: () => this.$t('functional-analysis.top-modal.O end'),
|
|
|
- dataIndex: 'occurrenceMin',
|
|
|
width: 125,
|
|
|
- align: 'center',
|
|
|
- // ellipsis: true,
|
|
|
+ ellipsis: true,
|
|
|
},
|
|
|
+ // d值范围
|
|
|
{
|
|
|
- title: () => this.$t('functional-analysis.top-modal.operate'),
|
|
|
- // width: 100,
|
|
|
- align: "center",
|
|
|
- scopedSlots: {
|
|
|
- customRender: "action"
|
|
|
+ title: () => this.$t('functional-analysis.top-modal.D-scope'),
|
|
|
+ customRender: (text, row, index) => {
|
|
|
+ if (row.dstart && row.dend){
|
|
|
+ return row.dstart + '~' + row.dend;
|
|
|
+ } else {
|
|
|
+ return '~';
|
|
|
+ }
|
|
|
},
|
|
|
- ellipsis: true
|
|
|
+ align: 'center',
|
|
|
+ width: 125,
|
|
|
+ ellipsis: true,
|
|
|
}
|
|
|
],
|
|
|
}
|
|
@@ -170,8 +161,10 @@ export default {
|
|
|
this.$api.getRPClassifyState(data1).then(res => {
|
|
|
if (res.flag) {
|
|
|
this.flag.status = '0';
|
|
|
+ this.flag.originalStatus = '0';
|
|
|
if (res.data && res.data.state == 1) {
|
|
|
this.flag.status = '1';
|
|
|
+ this.flag.originalStatus = '1';
|
|
|
}
|
|
|
} else {
|
|
|
this.$notification.error({message: res.message});
|
|
@@ -183,16 +176,42 @@ export default {
|
|
|
this.loading = false;
|
|
|
} else {
|
|
|
this.$notification.error({message: res.message});
|
|
|
+ this.loading = false;
|
|
|
}
|
|
|
});
|
|
|
} else {
|
|
|
this.$notification.error({message: res.message});
|
|
|
+ this.loading = false;
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
- update(record) {
|
|
|
- this.$refs.visible.showModal = true;
|
|
|
- this.$refs.visible.queryParam = record;
|
|
|
+ // 特性自动标记弹窗--确定
|
|
|
+ ascertain() {
|
|
|
+ // 判断是否开启自动标记是否更改
|
|
|
+ if (this.flag.status === this.flag.originalStatus) {
|
|
|
+ // 未作任何修改直接关闭弹窗
|
|
|
+ this.countermand();
|
|
|
+ } else {
|
|
|
+ // 开启警示弹窗
|
|
|
+ this.deleteRdfm();
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 特性自动标记弹窗--取消
|
|
|
+ countermand() {
|
|
|
+ // 数据恢复默认值
|
|
|
+ this.tableData = [];
|
|
|
+ this.loading = false;
|
|
|
+ this.show = true;
|
|
|
+ this.flag = {
|
|
|
+ originalStatus: '',// 是否开启自动标记原始值
|
|
|
+ status: ''
|
|
|
+ };
|
|
|
+ this.propDetailData = {};
|
|
|
+ this.pductClassifyId = '';
|
|
|
+ // 关闭弹窗
|
|
|
+ this.$emit("closeModal");
|
|
|
+ // 初始化右侧树
|
|
|
+ this.initRightTree();
|
|
|
},
|
|
|
//改为手动配置删除数据
|
|
|
deleteRdfm() {
|
|
@@ -208,42 +227,36 @@ export default {
|
|
|
okText: this.$t('global-btn.ok'),
|
|
|
cancelText: this.$t('global-btn.cancel'),
|
|
|
onOk() {
|
|
|
+ _that.loading = true;
|
|
|
_that.$api.deleteRPClassifyState(data).then(res => {
|
|
|
if (res.flag) {
|
|
|
_that.confirm();
|
|
|
} else {
|
|
|
_that.$notification.error({message: res.message});
|
|
|
+ _that.loading = false;
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
- onCancel() {
|
|
|
- if (_that.flag.status == '0') {
|
|
|
- _that.flag.status = '1'
|
|
|
- } else {
|
|
|
- _that.flag.status = '0'
|
|
|
- }
|
|
|
- }
|
|
|
+ onCancel() {}
|
|
|
});
|
|
|
},
|
|
|
- cancel() {
|
|
|
- this.$refs.visible.showModal = false;
|
|
|
- },
|
|
|
closeModal() {
|
|
|
this.$emit("closeModal");
|
|
|
},
|
|
|
//自动标记
|
|
|
mark() {
|
|
|
+ this.loading = true;
|
|
|
var data = {
|
|
|
fmeaId: this.$route.query.rfmeaId
|
|
|
};
|
|
|
this.$api.markRPClassifyState(data).then(res => {
|
|
|
if (res.flag) {
|
|
|
this.$message.success(res.message, 1);
|
|
|
- this.$emit("closeModal");
|
|
|
- // 初始化右侧树
|
|
|
- this.initRightTree();
|
|
|
+ // 关闭弹窗
|
|
|
+ this.countermand();
|
|
|
} else {
|
|
|
this.$notification.error({message: res.message});
|
|
|
+ this.loading = false;
|
|
|
}
|
|
|
})
|
|
|
},
|
|
@@ -261,12 +274,12 @@ export default {
|
|
|
};
|
|
|
this.$api.saveRPClassifyState(data).then(res => {
|
|
|
if (res.flag) {
|
|
|
- this.$message.success(res.message, 1);
|
|
|
+ this.mark();
|
|
|
} else {
|
|
|
this.$notification.error({message: res.message});
|
|
|
+ this.loading = false;
|
|
|
}
|
|
|
});
|
|
|
- this.initData();
|
|
|
}
|
|
|
},
|
|
|
mounted() {
|
|
@@ -283,5 +296,10 @@ export default {
|
|
|
.ml10 {
|
|
|
margin-left: 500px;
|
|
|
}
|
|
|
-
|
|
|
+/deep/ .ant-table-fixed-header .ant-table-scroll .ant-table-header {
|
|
|
+ overflow: hidden !important;
|
|
|
+ margin-bottom: 0 !important;
|
|
|
+ padding-right: 3px;
|
|
|
+ background: rgb(250, 250, 250);
|
|
|
+}
|
|
|
</style>
|