|
|
|
@ -37,6 +37,10 @@ |
|
|
|
<el-button @click="exportExcel()" type="primary" |
|
|
|
style="margin-left: 2px">{{ $t('qc.common.export') }}</el-button> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item :label="' '"> |
|
|
|
<el-button v-if="!authSync" type="primary" :loading="syncLoading" @click="syncPartCatalog()" |
|
|
|
style="margin-left: 2px">{{ $t('qc.partAttributePage.dataSync') }}</el-button> |
|
|
|
</el-form-item> |
|
|
|
</el-form> |
|
|
|
|
|
|
|
<!-- 展示列表 --> |
|
|
|
@ -1686,6 +1690,7 @@ |
|
|
|
import { |
|
|
|
qcPartAttributeSearch, // 查询物料属性 |
|
|
|
qcPartAttributeEdit, // 修改物料属性 |
|
|
|
qcPartCatalogSync, // 物料目录数据同步 |
|
|
|
searchPartAttributeDetails, // 查询物料属性模板 |
|
|
|
savePartAttributeDetails, // 新增物料属性模板 |
|
|
|
deletePartAttributeDetails, // 删除物料属性模板 |
|
|
|
@ -2630,6 +2635,8 @@ export default { |
|
|
|
authDelete: false, |
|
|
|
authDetail: false, |
|
|
|
authFile: false, |
|
|
|
authSync: false, |
|
|
|
syncLoading: false, |
|
|
|
menuId: this.$route.meta.menuId, |
|
|
|
activeTable: 'qcSpec', |
|
|
|
partCurrentRow: {}, |
|
|
|
@ -5725,6 +5732,7 @@ export default { |
|
|
|
let deleteFlag = this.isAuth(this.menuId + ':delete') |
|
|
|
let detailFlag = this.isAuth(this.menuId + ':detail') |
|
|
|
let fileFlag = this.isAuth(this.menuId + ':file') |
|
|
|
let syncFlag = this.isAuth(this.menuId + ':sync') |
|
|
|
//处理页面的权限数据 |
|
|
|
this.authSearch = !searchFlag |
|
|
|
this.authSave = !saveFlag |
|
|
|
@ -5732,6 +5740,39 @@ export default { |
|
|
|
this.authDelete = !deleteFlag |
|
|
|
this.authDetail = !detailFlag |
|
|
|
this.authFile = !fileFlag |
|
|
|
this.authSync = !syncFlag |
|
|
|
}, |
|
|
|
|
|
|
|
syncPartCatalog() { |
|
|
|
this.$confirm( |
|
|
|
this.$t('qc.partAttributePage.dataSyncConfirm'), |
|
|
|
this.$t('qc.common.tip'), |
|
|
|
{ |
|
|
|
confirmButtonText: this.$t('qc.common.confirm'), |
|
|
|
cancelButtonText: this.$t('qc.common.cancel'), |
|
|
|
type: 'warning', |
|
|
|
} |
|
|
|
) |
|
|
|
.then(() => { |
|
|
|
this.syncLoading = true |
|
|
|
return qcPartCatalogSync() |
|
|
|
}) |
|
|
|
.then(({ data }) => { |
|
|
|
this.syncLoading = false |
|
|
|
if (data && data.code === 0) { |
|
|
|
this.$message.success(this.$t('qc.partAttributePage.dataSyncSuccess')) |
|
|
|
if (!this.authSearch) { |
|
|
|
this.getDataList() |
|
|
|
} |
|
|
|
} else { |
|
|
|
this.$message.error( |
|
|
|
(data && data.msg) || this.$t('qc.partAttributePage.dataSyncFail') |
|
|
|
) |
|
|
|
} |
|
|
|
}) |
|
|
|
.catch(() => { |
|
|
|
this.syncLoading = false |
|
|
|
}) |
|
|
|
}, |
|
|
|
}, |
|
|
|
} |
|
|
|
|