|
|
|
@ -47,6 +47,7 @@ |
|
|
|
<el-option label="生产中" value="生产中"></el-option> |
|
|
|
<el-option label="样品确认" value="样品确认"></el-option> |
|
|
|
<el-option label="已完成" value="已完成"></el-option> |
|
|
|
<el-option label="已取消" value="已取消"></el-option> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
|
|
|
|
@ -76,6 +77,30 @@ |
|
|
|
<el-button @click="getDataList('Y')" type="primary" plain class="search-btn">查询</el-button> |
|
|
|
<el-button @click="resetQuery()" plain class="reset-btn">重置</el-button> |
|
|
|
<el-button @click="openCreateDialog()" type="success" plain class="add-btn">新增申请单</el-button> |
|
|
|
<el-button |
|
|
|
@click="deleteApplyFromToolbar()" |
|
|
|
:disabled="!currentRow.applyNo || currentRow.status !== '草稿'" |
|
|
|
type="danger" |
|
|
|
plain |
|
|
|
class="delete-btn">删除</el-button> |
|
|
|
<el-button |
|
|
|
@click="withdrawApplyFromToolbar()" |
|
|
|
:disabled="!currentRow.applyNo || currentRow.status === '草稿' || currentRow.status === '已完成' || currentRow.status === '已驳回' || currentRow.status === '已取消'" |
|
|
|
type="warning" |
|
|
|
plain |
|
|
|
class="withdraw-btn">撤回</el-button> |
|
|
|
<el-button |
|
|
|
@click="cancelApplyFromToolbar()" |
|
|
|
:disabled="!currentRow.applyNo || currentRow.status === '草稿' || currentRow.status === '已完成' || currentRow.status === '已取消'" |
|
|
|
type="info" |
|
|
|
plain |
|
|
|
class="cancel-btn">取消</el-button> |
|
|
|
<el-button |
|
|
|
@click="openCopyDialog()" |
|
|
|
:disabled="!currentRow.applyNo" |
|
|
|
type="primary" |
|
|
|
plain |
|
|
|
class="copy-btn">复制</el-button> |
|
|
|
</el-form-item> |
|
|
|
</el-form> |
|
|
|
|
|
|
|
@ -102,12 +127,6 @@ |
|
|
|
<a |
|
|
|
v-if="scope.row.status === '草稿' || scope.row.status === '已驳回'" |
|
|
|
@click="submitApply(scope.row)">{{ scope.row.status === '已驳回' ? '重新下达' : '下达' }}</a> |
|
|
|
<a |
|
|
|
v-if="scope.row.status === '草稿'" |
|
|
|
@click="deleteApply(scope.row)">删除</a> |
|
|
|
<a |
|
|
|
v-if="scope.row.status !== '草稿' && scope.row.status !== '已完成' && scope.row.status !== '已驳回'" |
|
|
|
@click="withdrawApply(scope.row)">撤回</a> |
|
|
|
<a |
|
|
|
v-if="showSampleConfirmBtn(scope.row)" |
|
|
|
@click="openSampleConfirm(scope.row)">样品确认</a> |
|
|
|
@ -447,6 +466,37 @@ |
|
|
|
</div> |
|
|
|
</el-dialog> |
|
|
|
|
|
|
|
<!-- 复制申请单弹窗 --> |
|
|
|
<el-dialog |
|
|
|
title="复制申请单" |
|
|
|
:visible.sync="copyDialogVisible" |
|
|
|
width="400px" |
|
|
|
:close-on-click-modal="false"> |
|
|
|
<div style="margin-bottom: 15px;margin-left: 40px; color: #606266; font-size: 13px"> |
|
|
|
<i class="el-icon-info" style="color: #409EFF"></i> |
|
|
|
选择需要复制的内容,将创建一个新的草稿申请单 |
|
|
|
</div> |
|
|
|
<el-form :model="copyData" label-width="120px" size="small"> |
|
|
|
<el-form-item label="源申请单号"> |
|
|
|
<el-tag type="primary">{{ copyData.sourceApplyNo }}</el-tag> |
|
|
|
</el-form-item> |
|
|
|
|
|
|
|
<el-form-item label="复制选项"> |
|
|
|
<el-checkbox-group v-model="copyData.copyOptions"> |
|
|
|
<el-checkbox v-if="currentRow.experimentType === 'High Risk'" label="triConfirm">三方确认信息</el-checkbox> |
|
|
|
<el-checkbox label="attachment">附件</el-checkbox> |
|
|
|
</el-checkbox-group> |
|
|
|
</el-form-item> |
|
|
|
</el-form> |
|
|
|
|
|
|
|
<div slot="footer" class="dialog-footer"> |
|
|
|
<el-button type="primary" @click="confirmCopy" :loading="copyLoading"> |
|
|
|
{{ copyLoading ? '复制中...' : '确认复制' }} |
|
|
|
</el-button> |
|
|
|
<el-button @click="copyDialogVisible = false">取消</el-button> |
|
|
|
</div> |
|
|
|
</el-dialog> |
|
|
|
|
|
|
|
<!-- 下达确认弹窗 - 选择审批人 --> |
|
|
|
<el-dialog |
|
|
|
title="确认审批人信息" |
|
|
|
@ -515,7 +565,7 @@ |
|
|
|
</template> |
|
|
|
|
|
|
|
<script> |
|
|
|
import { searchExpApplyList, submitExpApply, deleteExpApply, withdrawExpApply, getSubmitApprovers, getFlowStatus, getTriConfirmList, confirmSample } from '@/api/erf/erf' |
|
|
|
import { searchExpApplyList, submitExpApply, deleteExpApply, withdrawExpApply, cancelExpApply, copyExpApply, getSubmitApprovers, getFlowStatus, getTriConfirmList, confirmSample } from '@/api/erf/erf' |
|
|
|
import { getBuList } from '@/api/factory/site' |
|
|
|
import ExpApplyForm from './components/expApplyForm.vue' |
|
|
|
import ExpProjectDetail from './components/expProjectDetail.vue' |
|
|
|
@ -604,6 +654,14 @@ export default { |
|
|
|
applyNo: '', |
|
|
|
sampleQuantity: null, |
|
|
|
finalFinishDate: '' |
|
|
|
}, |
|
|
|
|
|
|
|
// 复制申请单弹窗 |
|
|
|
copyDialogVisible: false, |
|
|
|
copyLoading: false, |
|
|
|
copyData: { |
|
|
|
sourceApplyNo: '', |
|
|
|
copyOptions: ['triConfirm'] // 默认全选 |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
@ -1296,6 +1354,131 @@ export default { |
|
|
|
this.sampleConfirmLoading = false |
|
|
|
this.$message.error('样品确认异常') |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
/** |
|
|
|
* 工具栏删除申请单 |
|
|
|
*/ |
|
|
|
deleteApplyFromToolbar() { |
|
|
|
if (!this.currentRow.applyNo) { |
|
|
|
this.$message.warning('请先选择一条申请单记录') |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
if (this.currentRow.status !== '草稿') { |
|
|
|
this.$message.warning('只能删除草稿状态的申请单') |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
this.deleteApply(this.currentRow) |
|
|
|
}, |
|
|
|
|
|
|
|
/** |
|
|
|
* 工具栏撤回申请单 |
|
|
|
*/ |
|
|
|
withdrawApplyFromToolbar() { |
|
|
|
if (!this.currentRow.applyNo) { |
|
|
|
this.$message.warning('请先选择一条申请单记录') |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
if (this.currentRow.status === '草稿' || this.currentRow.status === '已完成' || |
|
|
|
this.currentRow.status === '已驳回' || this.currentRow.status === '已取消') { |
|
|
|
this.$message.warning('该状态下无法撤回') |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
this.withdrawApply(this.currentRow) |
|
|
|
}, |
|
|
|
|
|
|
|
/** |
|
|
|
* 工具栏取消申请单 |
|
|
|
*/ |
|
|
|
cancelApplyFromToolbar() { |
|
|
|
if (!this.currentRow.applyNo) { |
|
|
|
this.$message.warning('请先选择一条申请单记录') |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
if (this.currentRow.status === '草稿') { |
|
|
|
this.$message.warning('草稿状态的申请单请直接删除') |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
if (this.currentRow.status === '已完成' || this.currentRow.status === '已取消') { |
|
|
|
this.$message.warning('该状态下无法取消') |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
this.$confirm('确定取消该申请单?取消后将终止所有待审批流程,状态变更为已取消', '操作提示', { |
|
|
|
confirmButtonText: '确定', |
|
|
|
cancelButtonText: '取消', |
|
|
|
type: 'warning' |
|
|
|
}).then(() => { |
|
|
|
cancelExpApply({ |
|
|
|
applyNo: this.currentRow.applyNo, |
|
|
|
currentUserId: this.$store.state.user.id |
|
|
|
}).then(({data}) => { |
|
|
|
if (data && data.code === 0) { |
|
|
|
this.$message.success('取消成功') |
|
|
|
this.getDataList() |
|
|
|
} else { |
|
|
|
this.$message.error(data.msg || '取消失败') |
|
|
|
} |
|
|
|
}).catch(() => { |
|
|
|
this.$message.error('取消异常') |
|
|
|
}) |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
/** |
|
|
|
* 打开复制申请单弹窗 |
|
|
|
*/ |
|
|
|
openCopyDialog() { |
|
|
|
if (!this.currentRow.applyNo) { |
|
|
|
this.$message.warning('请先选择一条申请单记录') |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
// 根据试验类型判断是否显示三方确认选项 |
|
|
|
const defaultOptions = [] |
|
|
|
if (this.currentRow.experimentType === 'High Risk') { |
|
|
|
defaultOptions.unshift('triConfirm') |
|
|
|
} |
|
|
|
|
|
|
|
this.copyData = { |
|
|
|
sourceApplyNo: this.currentRow.applyNo, |
|
|
|
copyOptions: defaultOptions |
|
|
|
} |
|
|
|
this.copyDialogVisible = true |
|
|
|
}, |
|
|
|
|
|
|
|
/** |
|
|
|
* 确认复制申请单 |
|
|
|
*/ |
|
|
|
confirmCopy() { |
|
|
|
this.copyLoading = true |
|
|
|
|
|
|
|
const copyParams = { |
|
|
|
sourceApplyNo: this.copyData.sourceApplyNo, |
|
|
|
copyTriConfirm: this.copyData.copyOptions.includes('triConfirm'), |
|
|
|
copyAttachment: this.copyData.copyOptions.includes('attachment'), |
|
|
|
currentUserId: this.$store.state.user.id |
|
|
|
} |
|
|
|
|
|
|
|
copyExpApply(copyParams).then(({data}) => { |
|
|
|
this.copyLoading = false |
|
|
|
if (data && data.code === 0) { |
|
|
|
this.$message.success('复制成功,已创建新的草稿申请单:' + data.newApplyNo) |
|
|
|
this.copyDialogVisible = false |
|
|
|
this.getDataList() |
|
|
|
} else { |
|
|
|
this.$message.error(data.msg || '复制失败') |
|
|
|
} |
|
|
|
}).catch(() => { |
|
|
|
this.copyLoading = false |
|
|
|
this.$message.error('复制异常') |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
@ -1404,6 +1587,64 @@ export default { |
|
|
|
color: #FFFFFF; |
|
|
|
} |
|
|
|
|
|
|
|
/* 删除按钮 - 红色扁平 */ |
|
|
|
.exp-apply-page .delete-btn { |
|
|
|
background-color: #FEF0F0; |
|
|
|
border-color: #FAB6B6; |
|
|
|
color: #F56C6C; |
|
|
|
} |
|
|
|
|
|
|
|
.exp-apply-page .delete-btn:hover:not(:disabled) { |
|
|
|
background-color: #F56C6C; |
|
|
|
border-color: #F56C6C; |
|
|
|
color: #FFFFFF; |
|
|
|
} |
|
|
|
|
|
|
|
/* 撤回按钮 - 橙色扁平 */ |
|
|
|
.exp-apply-page .withdraw-btn { |
|
|
|
background-color: #FDF6EC; |
|
|
|
border-color: #F5DAB1; |
|
|
|
color: #E6A23C; |
|
|
|
} |
|
|
|
|
|
|
|
.exp-apply-page .withdraw-btn:hover:not(:disabled) { |
|
|
|
background-color: #E6A23C; |
|
|
|
border-color: #E6A23C; |
|
|
|
color: #FFFFFF; |
|
|
|
} |
|
|
|
|
|
|
|
/* 取消按钮 - 灰色扁平 */ |
|
|
|
.exp-apply-page .cancel-btn { |
|
|
|
background-color: #F4F4F5; |
|
|
|
border-color: #D3D4D6; |
|
|
|
color: #909399; |
|
|
|
} |
|
|
|
|
|
|
|
.exp-apply-page .cancel-btn:hover:not(:disabled) { |
|
|
|
background-color: #909399; |
|
|
|
border-color: #909399; |
|
|
|
color: #FFFFFF; |
|
|
|
} |
|
|
|
|
|
|
|
/* 复制按钮 - 蓝色扁平 */ |
|
|
|
.exp-apply-page .copy-btn { |
|
|
|
background-color: #ECF5FF; |
|
|
|
border-color: #B3D8FF; |
|
|
|
color: #409EFF; |
|
|
|
} |
|
|
|
|
|
|
|
.exp-apply-page .copy-btn:hover:not(:disabled) { |
|
|
|
background-color: #409EFF; |
|
|
|
border-color: #409EFF; |
|
|
|
color: #FFFFFF; |
|
|
|
} |
|
|
|
|
|
|
|
/* 禁用按钮样式 */ |
|
|
|
.exp-apply-page .el-button:disabled { |
|
|
|
opacity: 0.5; |
|
|
|
cursor: not-allowed; |
|
|
|
} |
|
|
|
|
|
|
|
/* 数据表格样式 */ |
|
|
|
.exp-apply-page .data-table { |
|
|
|
background-color: #FFFFFF; |
|
|
|
|