61 lines
1.5 KiB
Vue
61 lines
1.5 KiB
Vue
<!--
|
|
* @Date: 2021-01-07 20:09:37
|
|
* @LastEditors: guo
|
|
* @LastEditTime: 2021-03-18 15:19:21
|
|
* @FilePath: \basic-admin\src\views\QualityManager\scrap\ScrapInfoCause.vue
|
|
* @Description:
|
|
-->
|
|
<template>
|
|
<span>
|
|
<el-button type="text" size="small" @click="emitClick">{{ $t('module.basicData.ScrapInfo.cause') }}</el-button>
|
|
</span>
|
|
</template>
|
|
|
|
<script>
|
|
import { getscrapReason } from '@/api/quality-manage/scrap'
|
|
export default {
|
|
props: {
|
|
injectData: {
|
|
type: Object,
|
|
default: () => ({})
|
|
}
|
|
},
|
|
data() {
|
|
return {
|
|
formData: {}
|
|
}
|
|
},
|
|
methods: {
|
|
async emitClick() {
|
|
const h = this.$createElement
|
|
await this.getReason()
|
|
await this.$msgbox({
|
|
title: this.$t('module.basicData.ScrapInfo.cause'),
|
|
message: h('div', null, [
|
|
h('span', null, `${this.$t('module.basicData.ScrapInfo.scrapType')}:${this.formData.scrapType}`),
|
|
h('br'),
|
|
h('div', null, `${this.$t('module.basicData.ScrapInfo.cause')}:${this.formData.scrap}`)
|
|
]),
|
|
showCancelButton: false,
|
|
confirmButtonText: this.$t('module.basicData.visual.confirmButtonText')
|
|
})
|
|
},
|
|
async getReason() {
|
|
if (this.injectData.scrapReasonId) {
|
|
const result = await getscrapReason({
|
|
id: this.injectData.scrapReasonId
|
|
})
|
|
if (result.code === 0) {
|
|
this.formData = result.data
|
|
}
|
|
} else {
|
|
this.formData = {
|
|
scrapType: '暂无',
|
|
scrap: '暂无'
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
</script>
|