|
|
|
@ -87,11 +87,12 @@ |
|
|
|
fixed="right" |
|
|
|
header-align="center" |
|
|
|
align="center" |
|
|
|
width="160" |
|
|
|
width="220" |
|
|
|
label="Action"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<!-- <el-link style="cursor: pointer" v-if="scope.row.flowStatus === 'COMPLETED' || scope.row.flowStatus === 'TERMINATED'" @click="handleRestart(scope.row)">重新审批 |</el-link> |
|
|
|
<el-link style="cursor: pointer" v-if="scope.row.flowStatus === 'RUNNING'" @click="openApproveDialog(scope.row)">审批 |</el-link> --> |
|
|
|
<el-link style="cursor: pointer" v-if="scope.row.partStage === 'Created'" @click="startFormalApprove(scope.row)">转正 |</el-link> |
|
|
|
<el-link style="cursor: pointer" @click="editPart(scope.row)">编辑 |</el-link> |
|
|
|
<el-link style="cursor: pointer" @click="deletePart(scope.row)">删除</el-link> |
|
|
|
</template> |
|
|
|
@ -129,7 +130,8 @@ |
|
|
|
<Chooselist ref="baseList" @getBaseData="getBaseData"></Chooselist> |
|
|
|
|
|
|
|
<!-- 产品编辑对话框 --> |
|
|
|
<el-dialog :title="isAdd ? '新增产品' : '编辑产品'" :visible.sync="partDialogVisible" width="720px" top="3vh" :close-on-click-modal="false" class="part-dialog"> |
|
|
|
<!-- 默认弹窗可拖动,特殊需求除外 - rqrq --> |
|
|
|
<el-dialog :title="isAdd ? '新增产品' : '编辑产品'" :visible.sync="partDialogVisible" width="720px" top="3vh" :close-on-click-modal="false" class="part-dialog" v-drag> |
|
|
|
<div class="dialog-content"> |
|
|
|
<el-form |
|
|
|
:model="currentpart" |
|
|
|
@ -274,14 +276,20 @@ |
|
|
|
</div> |
|
|
|
</el-dialog> |
|
|
|
|
|
|
|
<el-dialog title="复制物料" :visible.sync="copyDialogVisible" width="420px" :close-on-click-modal="false"> |
|
|
|
<el-form :model="copyForm" :rules="copyRules" ref="copyForm" label-width="100px"> |
|
|
|
<el-dialog title="复制物料" :visible.sync="copyDialogVisible" width="520px" :close-on-click-modal="false" v-drag> |
|
|
|
<el-form :model="copyForm" :rules="copyRules" ref="copyForm" label-position="top"> |
|
|
|
<el-row :gutter="24"> |
|
|
|
<el-col :span="12"> |
|
|
|
<el-form-item label="基准料号" prop="basePartNo"> |
|
|
|
<el-input v-model="copyForm.basePartNo"></el-input> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="12"> |
|
|
|
<el-form-item label="物料后缀" prop="partSuffix"> |
|
|
|
<el-input v-model="copyForm.partSuffix"></el-input> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
</el-form> |
|
|
|
<div slot="footer" class="dialog-footer"> |
|
|
|
<el-button type="primary" @click="confirmCopyPart">确认</el-button> |
|
|
|
@ -328,7 +336,8 @@ import { |
|
|
|
createPart, |
|
|
|
updatePart, |
|
|
|
copyPartByBase, |
|
|
|
deletePart |
|
|
|
deletePart, |
|
|
|
startPartFormalApprove |
|
|
|
} from '@/api/part/partInfo.js' |
|
|
|
import excel from '@/utils/excel-util.js' |
|
|
|
import Chooselist from '@/views/modules/common/Chooselist_eam' |
|
|
|
@ -899,7 +908,13 @@ export default { |
|
|
|
|
|
|
|
methods: { |
|
|
|
formatPartStageDesc (partStage) { |
|
|
|
return partStage === 'Approved' ? '正式物料' : '新增物料' |
|
|
|
if (partStage === 'Approved') { |
|
|
|
return '正式物料' |
|
|
|
} |
|
|
|
if (partStage === 'Approving') { |
|
|
|
return '转正审批中' |
|
|
|
} |
|
|
|
return '新增物料' |
|
|
|
}, |
|
|
|
formatTableCell (columnProp, row) { |
|
|
|
if (columnProp === 'partStage') { |
|
|
|
@ -944,8 +959,10 @@ export default { |
|
|
|
return index > 0 && index < value.length - 1 ? value.substring(index + 1) : '' |
|
|
|
}, |
|
|
|
openCopyDialog () { |
|
|
|
const selectedBasePartNo = (this.currentRow && this.currentRow.basePartNo) ? this.currentRow.basePartNo : '' |
|
|
|
this.copyForm = { |
|
|
|
basePartNo: '', |
|
|
|
// 复制弹窗默认带出当前选中行基准料号 - rqrq |
|
|
|
basePartNo: (selectedBasePartNo || '').trim().toUpperCase(), |
|
|
|
partSuffix: '' |
|
|
|
} |
|
|
|
this.copyDialogVisible = true |
|
|
|
@ -981,6 +998,33 @@ export default { |
|
|
|
}) |
|
|
|
}) |
|
|
|
}, |
|
|
|
startFormalApprove (row) { |
|
|
|
if (!row || !row.partNo) { |
|
|
|
this.$message.warning('未找到有效物料编码') |
|
|
|
return |
|
|
|
} |
|
|
|
// 新增物料阶段手动发起转正审批 - rqrq |
|
|
|
this.$confirm('确认发起该物料的转正流程吗?', '提示', { |
|
|
|
confirmButtonText: '确定', |
|
|
|
cancelButtonText: '取消', |
|
|
|
type: 'warning' |
|
|
|
}).then(() => { |
|
|
|
let inData = { |
|
|
|
site: this.$store.state.user.site, |
|
|
|
partNo: row.partNo |
|
|
|
} |
|
|
|
startPartFormalApprove(inData).then(({ data }) => { |
|
|
|
if (data && data.code === 0) { |
|
|
|
this.$message.success(data.msg || '操作成功') |
|
|
|
this.getMainData() |
|
|
|
return |
|
|
|
} |
|
|
|
this.$message.error((data && data.msg) || '发起转正失败') |
|
|
|
}).catch(error => { |
|
|
|
this.$message.error('发起转正失败: ' + error.message) |
|
|
|
}) |
|
|
|
}).catch(() => {}) |
|
|
|
}, |
|
|
|
fetchPartFamilyOptions (familyType, parentPartFamily) { |
|
|
|
return listPartFamilyByType({ |
|
|
|
site: this.$store.state.user.site, |
|
|
|
@ -1397,7 +1441,11 @@ export default { |
|
|
|
cancelButtonText: '取消', |
|
|
|
type: 'warning' |
|
|
|
}).then(() => { |
|
|
|
deletePart(row.id).then(({data}) => { |
|
|
|
deletePart({ |
|
|
|
id: row.id, |
|
|
|
site: row.site, |
|
|
|
partNo: row.partNo |
|
|
|
}).then(({data}) => { |
|
|
|
if (data && data.code === 0) { |
|
|
|
this.$message.success('产品删除成功') |
|
|
|
this.getMainData() |
|
|
|
|