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

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

@ -97,4 +97,14 @@ export const getApprovalStatus = (params) =>{
url:'/api/blade-system/dict/dictionary?code=ProReTemplate-ApprovalStatus',
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>
</template> -->
<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
type="text"
@click="upgradedVersion(scope.row.rfpId)"
@ -36,19 +36,20 @@
<!-- v-if="
(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>
</template>
<template #line="{ row }">
<el-tag v-if="row.line == 1">线上</el-tag>
<el-tag v-if="row.line == 0" type="success">线下</el-tag>
</template>
</avue-crud>
<detailRb
:detail-open="detailOpen"
@ -65,7 +66,11 @@
</templatePreserve>
<!-- 批量新增 -->
<addPreserve @closeDialog="closeDialog" :showDialog="showDialog" v-if="showDialog"></addPreserve>
<addPreserve
@closeDialog="closeDialog"
:showDialog="showDialog"
v-if="showDialog"
></addPreserve>
<!-- <editTable></editTable> -->
@ -83,7 +88,14 @@
</template>
<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 detailRb from './detailRb2.vue';
import templatePreserve from './templatePreserve2.vue';
@ -98,12 +110,12 @@ export default {
approvalStandard,
editTable,
basicImport,
addPreserve
addPreserve,
},
data() {
return {
isShowImport: false,
showDialog:false,
showDialog: false,
data: [],
page: {
pageSize: 10,
@ -202,8 +214,8 @@ export default {
type: 'select',
filterable: true,
remote: true,
dicUrl:`/api/blade-desk/bsProcessSet/list?name={{key}}`,
props:{
dicUrl: `/api/blade-desk/bsProcessSet/list?name={{key}}`,
props: {
label: 'name',
value: 'id',
res: 'data.records',
@ -231,7 +243,7 @@ export default {
// label: '线',
// value: 1,
// },
// ],
// },
{
@ -251,35 +263,47 @@ export default {
sortable: true,
filter: true,
display: false,
width:200,
width: 200,
},
// {
// label: '',
// prop: 'status',
// search: true,
// sortable: true,
// filter: true,
// display: false,
// type: 'select',
// dicUrl:'/api/blade-system/dict/dictionary?code=ProReTemplate-Status',
// props:{
// label: 'dictValue',
// value: 'dictKey',
// }
// },
{
label: '状态',
prop: 'approvalStatus',
prop: 'status',
search: true,
sortable: true,
filter: true,
display: false,
type: 'select',
// dicUrl:'/api/blade-system/dict/dictionary?code=ProReTemplate-ApprovalStatus',
dicData: [
{
label: '新建',
value: 1,
},
{
label: '使用中',
value: 2,
},
{
label: '废弃',
value: 3,
},
],
// type: 'select',
// dicUrl:'/api/blade-system/dict/dictionary?code=ProReTemplate-Status',
// props:{
// label: 'dictValue',
// value: 'dictKey',
// },
dicData: [
// }
},
{
label: '审批状态',
prop: 'approvalStatus',
search: true,
sortable: true,
filter: true,
type: 'select',
dicData: [
{
label: '新建',
value: 0,
@ -288,7 +312,7 @@ export default {
label: '发布',
value: 1,
},
{
{
label: '使用中',
value: 2,
},
@ -311,24 +335,47 @@ export default {
mounted() {},
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() {
this.isShowImport = true
this.isShowImport = true;
},
//
handleAdd(){
this.showDialog = true
handleAdd() {
this.showDialog = true;
},
closeDialog(val){
this.showDialog = false
this.isShowImport = false
if(val){
this.onLoad()
closeDialog(val) {
this.showDialog = false;
this.isShowImport = false;
if (val) {
this.onLoad();
}
},
getPermission(key, row, index) {
if (key === 'editBtn') {
return( row.status == 1 && (row.approvalStatus == 3 || row.approvalStatus == 4)) //
return row.status == 1 && (row.approvalStatus == 3 || row.approvalStatus == 4) //
? true
: false;
} else if (key === 'delBtn') {
@ -382,17 +429,16 @@ export default {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
})
.then(() => {
copyData({
id:row.id
}).then(res =>{
if(res.data.code == 200){
this.$message.success('复制成功')
this.onLoad()
}
})
})
}).then(() => {
copyData({
id: row.id,
}).then(res => {
if (res.data.code == 200) {
this.$message.success('复制成功');
this.onLoad();
}
});
});
// const res = await this.$ajax.post('dsRbFilePreserve/upgradedVersion', {
// rfpId,
// copy: true
@ -421,34 +467,34 @@ export default {
this.$refs.crud.toggleSelection();
},
rowUpdate(row, index, done, loading) {
console.log('row--------------',row)
console.log('row--------------', row);
editRecords({
id:row.id,
wcId:row.wcId,
line:row.line,
ppsId:row.ppsId,
name:row.name
}).then(res =>{
if(res.data.code == 200){
this.$message.success('修改成功')
this.onLoad()
done()
id: row.id,
wcId: row.wcId,
line: row.line,
ppsId: row.ppsId,
name: row.name,
}).then(res => {
if (res.data.code == 200) {
this.$message.success('修改成功');
this.onLoad();
done();
}
})
});
},
rowSave(row, done, loading) {
addRecords({
wcId:row.wcId,
line:row.line,
ppsId:row.ppsId,
name:row.name
}).then(res =>{
if(res.data.code == 200){
this.$message.success('新增成功')
this.onLoad()
done()
wcId: row.wcId,
line: row.line,
ppsId: row.ppsId,
name: row.name,
}).then(res => {
if (res.data.code == 200) {
this.$message.success('新增成功');
this.onLoad();
done();
}
})
});
},
searchReset() {
this.query = {};
@ -466,13 +512,13 @@ export default {
cancelButtonText: '取消',
type: 'warning',
}).then(() => {
deleteRecords({ids:row.id}).then(res =>{
if(res.data.code == 200){
this.$message.success('删除成功')
this.onLoad()
done()
deleteRecords({ ids: row.id }).then(res => {
if (res.data.code == 200) {
this.$message.success('删除成功');
this.onLoad();
done();
}
})
});
});
},
currentChange(currentPage) {
@ -486,19 +532,19 @@ export default {
},
onLoad() {
this.loading = true;
console.log('this.query',this.query)
console.log('this.query', this.query);
getList({
current:this.page.currentPage,
size:this.page.pageSize,
...this.query
}).then(res =>{
this.data = res.data.data.records
this.data.map(item =>{
item.line = parseInt(item.line)
})
this.page.total = res.data.data.total
this.loading = false
})
current: this.page.currentPage,
size: this.page.pageSize,
...this.query,
}).then(res => {
this.data = res.data.data.records;
this.data.map(item => {
item.line = parseInt(item.line);
});
this.page.total = res.data.data.total;
this.loading = false;
});
// this.data = [
// {
// approvalStatus: -1,

Loading…
Cancel
Save