过程记录模板维护发布和作废修改

dev-scheduling
zhangdi 1 day ago
parent 5efbd7ca93
commit 269a335a3c
  1. 10
      src/api/qualityManagement/inspectionArchiving/rbFilePreserve.js
  2. 164
      src/views/qualityManagement/inspectionArchiving/rbFilePreserve/index.vue

@ -98,3 +98,13 @@ export const getApprovalStatus = (params) =>{
method:'get' method:'get'
}) })
} }
// 修改状态 /QA/ProReTemplate/updateStatus
export const updateStatus = (data) =>{
return request({
url:'/api/blade-desk/QA/ProReTemplate/updateStatus',
method:'post',
data
})
}

@ -26,7 +26,7 @@
<el-button type="primary" @click="handleImport()">导入</el-button> <el-button type="primary" @click="handleImport()">导入</el-button>
</template> --> </template> -->
<template #menu="scope"> <template #menu="scope">
<el-button type="text" @click="copyClick(scope.row)">复制</el-button> <el-button type="text" @click="copyClick(scope.row)" v-if="scope.row.status == 2">复制</el-button>
<!-- <el-button <!-- <el-button
type="text" type="text"
@click="upgradedVersion(scope.row.rfpId)" @click="upgradedVersion(scope.row.rfpId)"
@ -36,19 +36,20 @@
<!-- v-if=" <!-- v-if="
(scope.row.rfpStatus == 1 || scope.row.rfpStatus == 4) && scope.row.approvalStatus != 0 (scope.row.rfpStatus == 1 || scope.row.rfpStatus == 4) && scope.row.approvalStatus != 0
" --> " -->
<el-button
type="text"
@click="templatePreserve(scope.row)"
>维护电子档案</el-button <el-button type="text" @click="updateStatus(scope.row, 2)" v-if="scope.row.status == 1"
>发布</el-button
>
<el-button type="text" @click="updateStatus(scope.row, 3)" v-if="scope.row.status == 2"
>作废</el-button
> >
<el-button type="text" @click="templatePreserve(scope.row)" v-if="scope.row.status != 3">维护电子档案</el-button>
<el-button type="text" @click="detailClick(scope.row)">电子档案详情</el-button> <el-button type="text" @click="detailClick(scope.row)">电子档案详情</el-button>
</template> </template>
<template #line="{ row }"> <template #line="{ row }">
<el-tag v-if="row.line == 1">线上</el-tag> <el-tag v-if="row.line == 1">线上</el-tag>
<el-tag v-if="row.line == 0" type="success">线下</el-tag> <el-tag v-if="row.line == 0" type="success">线下</el-tag>
</template> </template>
</avue-crud> </avue-crud>
<detailRb <detailRb
:detail-open="detailOpen" :detail-open="detailOpen"
@ -65,7 +66,11 @@
</templatePreserve> </templatePreserve>
<!-- 批量新增 --> <!-- 批量新增 -->
<addPreserve @closeDialog="closeDialog" :showDialog="showDialog" v-if="showDialog"></addPreserve> <addPreserve
@closeDialog="closeDialog"
:showDialog="showDialog"
v-if="showDialog"
></addPreserve>
<!-- <editTable></editTable> --> <!-- <editTable></editTable> -->
@ -83,7 +88,14 @@
</template> </template>
<script> <script>
import {getList,addRecords, editRecords,deleteRecords,copyData} from '@/api/qualityManagement/inspectionArchiving/rbFilePreserve' import {
getList,
addRecords,
editRecords,
deleteRecords,
copyData,
updateStatus
} from '@/api/qualityManagement/inspectionArchiving/rbFilePreserve';
import { mapGetters } from 'vuex'; import { mapGetters } from 'vuex';
import detailRb from './detailRb2.vue'; import detailRb from './detailRb2.vue';
import templatePreserve from './templatePreserve2.vue'; import templatePreserve from './templatePreserve2.vue';
@ -98,7 +110,7 @@ export default {
approvalStandard, approvalStandard,
editTable, editTable,
basicImport, basicImport,
addPreserve addPreserve,
}, },
data() { data() {
return { return {
@ -253,32 +265,44 @@ export default {
display: false, display: false,
width: 200, width: 200,
}, },
// { {
// label: '', label: '状态',
// prop: 'status', prop: 'status',
// search: true, search: true,
// sortable: true, sortable: true,
// filter: true, filter: true,
// display: false, display: false,
type: 'select',
dicData: [
{
label: '新建',
value: 1,
},
{
label: '使用中',
value: 2,
},
{
label: '废弃',
value: 3,
},
],
// type: 'select', // type: 'select',
// dicUrl:'/api/blade-system/dict/dictionary?code=ProReTemplate-Status', // dicUrl:'/api/blade-system/dict/dictionary?code=ProReTemplate-Status',
// props:{ // props:{
// label: 'dictValue', // label: 'dictValue',
// value: 'dictKey', // value: 'dictKey',
// } // }
// }, },
{ {
label: '状态', label: '审批状态',
prop: 'approvalStatus', prop: 'approvalStatus',
search: true, search: true,
sortable: true, sortable: true,
filter: true, filter: true,
type: 'select', type: 'select',
// dicUrl:'/api/blade-system/dict/dictionary?code=ProReTemplate-ApprovalStatus',
// props:{
// label: 'dictValue',
// value: 'dictKey',
// },
dicData: [ dicData: [
{ {
label: '新建', label: '新建',
@ -311,24 +335,47 @@ export default {
mounted() {}, mounted() {},
methods: { methods: {
updateStatus(row,type) {
this.$confirm(`即将对此模板进行${type==2?'发布':'作废'}, 是否继续?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
})
.then(() => {
updateStatus({
id:row.id,
status:type
}).then((res) => {
this.$message({
message:'操作成功',
type: 'success',
});
this.onLoad(this.page, this.query)
});
})
.catch(() => {
});
},
// //
handleImport() { handleImport() {
this.isShowImport = true this.isShowImport = true;
}, },
// //
handleAdd() { handleAdd() {
this.showDialog = true this.showDialog = true;
}, },
closeDialog(val) { closeDialog(val) {
this.showDialog = false this.showDialog = false;
this.isShowImport = false this.isShowImport = false;
if (val) { if (val) {
this.onLoad() this.onLoad();
} }
}, },
getPermission(key, row, index) { getPermission(key, row, index) {
if (key === 'editBtn') { if (key === 'editBtn') {
return( row.status == 1 && (row.approvalStatus == 3 || row.approvalStatus == 4)) // return row.status == 1 && (row.approvalStatus == 3 || row.approvalStatus == 4) //
? true ? true
: false; : false;
} else if (key === 'delBtn') { } else if (key === 'delBtn') {
@ -382,17 +429,16 @@ export default {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning', type: 'warning',
}) }).then(() => {
.then(() => {
copyData({ copyData({
id:row.id id: row.id,
}).then(res => { }).then(res => {
if (res.data.code == 200) { if (res.data.code == 200) {
this.$message.success('复制成功') this.$message.success('复制成功');
this.onLoad() this.onLoad();
} }
}) });
}) });
// const res = await this.$ajax.post('dsRbFilePreserve/upgradedVersion', { // const res = await this.$ajax.post('dsRbFilePreserve/upgradedVersion', {
// rfpId, // rfpId,
// copy: true // copy: true
@ -421,34 +467,34 @@ export default {
this.$refs.crud.toggleSelection(); this.$refs.crud.toggleSelection();
}, },
rowUpdate(row, index, done, loading) { rowUpdate(row, index, done, loading) {
console.log('row--------------',row) console.log('row--------------', row);
editRecords({ editRecords({
id: row.id, id: row.id,
wcId: row.wcId, wcId: row.wcId,
line: row.line, line: row.line,
ppsId: row.ppsId, ppsId: row.ppsId,
name:row.name name: row.name,
}).then(res => { }).then(res => {
if (res.data.code == 200) { if (res.data.code == 200) {
this.$message.success('修改成功') this.$message.success('修改成功');
this.onLoad() this.onLoad();
done() done();
} }
}) });
}, },
rowSave(row, done, loading) { rowSave(row, done, loading) {
addRecords({ addRecords({
wcId: row.wcId, wcId: row.wcId,
line: row.line, line: row.line,
ppsId: row.ppsId, ppsId: row.ppsId,
name:row.name name: row.name,
}).then(res => { }).then(res => {
if (res.data.code == 200) { if (res.data.code == 200) {
this.$message.success('新增成功') this.$message.success('新增成功');
this.onLoad() this.onLoad();
done() done();
} }
}) });
}, },
searchReset() { searchReset() {
this.query = {}; this.query = {};
@ -468,11 +514,11 @@ export default {
}).then(() => { }).then(() => {
deleteRecords({ ids: row.id }).then(res => { deleteRecords({ ids: row.id }).then(res => {
if (res.data.code == 200) { if (res.data.code == 200) {
this.$message.success('删除成功') this.$message.success('删除成功');
this.onLoad() this.onLoad();
done() done();
} }
}) });
}); });
}, },
currentChange(currentPage) { currentChange(currentPage) {
@ -486,19 +532,19 @@ export default {
}, },
onLoad() { onLoad() {
this.loading = true; this.loading = true;
console.log('this.query',this.query) console.log('this.query', this.query);
getList({ getList({
current: this.page.currentPage, current: this.page.currentPage,
size: this.page.pageSize, size: this.page.pageSize,
...this.query ...this.query,
}).then(res => { }).then(res => {
this.data = res.data.data.records this.data = res.data.data.records;
this.data.map(item => { this.data.map(item => {
item.line = parseInt(item.line) item.line = parseInt(item.line);
}) });
this.page.total = res.data.data.total this.page.total = res.data.data.total;
this.loading = false this.loading = false;
}) });
// this.data = [ // this.data = [
// { // {
// approvalStatus: -1, // approvalStatus: -1,

Loading…
Cancel
Save