feat:新增事业部确认
This commit is contained in:
parent
86ece01bbd
commit
64c8095345
|
@ -85,3 +85,11 @@ export function deptconfirm(id) {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function deptconfirm_top(id) {
|
||||||
|
return request({
|
||||||
|
url: `/supervision/record/${id}/deptconfirm_top/`,
|
||||||
|
method: 'put',
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -254,7 +254,7 @@ export const asyncRoutes = [
|
||||||
path: 'other',
|
path: 'other',
|
||||||
name: 'other',
|
name: 'other',
|
||||||
component: () => import('@/views/supervision/task.vue'),
|
component: () => import('@/views/supervision/task.vue'),
|
||||||
meta: { title: '其他任务'}
|
meta: { title: '其他任务', perms: ['task2']}
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
@ -289,7 +289,7 @@ export const asyncRoutes = [
|
||||||
path: 'taskdo/:id',
|
path: 'taskdo/:id',
|
||||||
name: 'Taskdo',
|
name: 'Taskdo',
|
||||||
component: () => import('@/views/supervision/taskdo.vue'),
|
component: () => import('@/views/supervision/taskdo.vue'),
|
||||||
meta: { title: '报送任务执行', perms: ['task_view'] },
|
meta: { title: '报送任务执行', perms: ['task2'] },
|
||||||
hidden: true
|
hidden: true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
|
@ -50,6 +50,12 @@
|
||||||
<el-tag type="danger" effect="plain" v-else>未确认</el-tag>
|
<el-tag type="danger" effect="plain" v-else>未确认</el-tag>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
<el-table-column label="事业部确认">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-tag v-if="scope.row.dept_top_yes" effect="plain">已确认</el-tag>
|
||||||
|
<el-tag type="danger" effect="plain" v-else>未确认</el-tag>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
<el-table-column label="记录状态">
|
<el-table-column label="记录状态">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-tag type="danger" v-if="scope.row.state == '待报送'">{{
|
<el-tag type="danger" v-if="scope.row.state == '待报送'">{{
|
||||||
|
@ -108,6 +114,16 @@
|
||||||
@click="handleRecord({ action: 'deptconfirm', record: scope.row })"
|
@click="handleRecord({ action: 'deptconfirm', record: scope.row })"
|
||||||
>二级单位确认</el-link
|
>二级单位确认</el-link
|
||||||
>
|
>
|
||||||
|
<el-link
|
||||||
|
v-if="
|
||||||
|
scope.row.dept_top_yes == false && scope.row.state == '已报送' &&
|
||||||
|
checkPermission(['record_detconfirm_top'])
|
||||||
|
"
|
||||||
|
type="primary"
|
||||||
|
size="small"
|
||||||
|
@click="handleRecord({ action: 'deptconfirm_top', record: scope.row })"
|
||||||
|
>事业部确认</el-link
|
||||||
|
>
|
||||||
<el-link
|
<el-link
|
||||||
v-if="
|
v-if="
|
||||||
(scope.row.state == '已报送' || scope.row.state == '待整改') &&
|
(scope.row.state == '已报送' || scope.row.state == '待整改') &&
|
||||||
|
|
|
@ -162,6 +162,12 @@
|
||||||
<el-tag v-if="scope.row.dept_yes" effect="plain">已确认</el-tag>
|
<el-tag v-if="scope.row.dept_yes" effect="plain">已确认</el-tag>
|
||||||
<el-tag type="danger" effect="plain" v-else>未确认</el-tag>
|
<el-tag type="danger" effect="plain" v-else>未确认</el-tag>
|
||||||
</template>
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="事业部确认">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-tag v-if="scope.row.dept_yes_top" effect="plain">已确认</el-tag>
|
||||||
|
<el-tag type="danger" effect="plain" v-else>未确认</el-tag>
|
||||||
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="记录状态">
|
<el-table-column label="记录状态">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
|
|
|
@ -142,7 +142,9 @@ import {
|
||||||
rejectRecord,
|
rejectRecord,
|
||||||
confirmRecord,
|
confirmRecord,
|
||||||
deleteRecord,
|
deleteRecord,
|
||||||
deptconfirm
|
deptconfirm,
|
||||||
|
deptconfirm_top
|
||||||
|
|
||||||
} from "@/api/record";
|
} from "@/api/record";
|
||||||
export default {
|
export default {
|
||||||
name: "recorddo",
|
name: "recorddo",
|
||||||
|
@ -230,9 +232,12 @@ export default {
|
||||||
this.$message.success("二级单位确认成功");
|
this.$message.success("二级单位确认成功");
|
||||||
this.$emit("handleDo",true);
|
this.$emit("handleDo",true);
|
||||||
});
|
});
|
||||||
|
} else if (this.data.action == "deptconfirm_top") {
|
||||||
}
|
deptconfirm_top(this.record.id).then((res) => {
|
||||||
else if (this.data.action == "reject") {
|
this.$message.success("事业部确认成功");
|
||||||
|
this.$emit("handleDo",true);
|
||||||
|
});
|
||||||
|
} else if (this.data.action == "reject") {
|
||||||
rejectRecord(this.record.id, this.record).then((res) => {
|
rejectRecord(this.record.id, this.record).then((res) => {
|
||||||
this.$message.success("成功");
|
this.$message.success("成功");
|
||||||
this.$emit("handleDo",true);
|
this.$emit("handleDo",true);
|
||||||
|
|
|
@ -257,6 +257,12 @@
|
||||||
<el-tag v-if="scope.row.dept_yes" effect="plain">已确认</el-tag>
|
<el-tag v-if="scope.row.dept_yes" effect="plain">已确认</el-tag>
|
||||||
<el-tag type="danger" effect="plain" v-else>未确认</el-tag>
|
<el-tag type="danger" effect="plain" v-else>未确认</el-tag>
|
||||||
</template>
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="事业部确认">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-tag v-if="scope.row.dept_yes_top" effect="plain">已确认</el-tag>
|
||||||
|
<el-tag type="danger" effect="plain" v-else>未确认</el-tag>
|
||||||
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="报送要求/备注">
|
<el-table-column label="报送要求/备注">
|
||||||
<template slot-scope="scope">{{ scope.row.note }}</template>
|
<template slot-scope="scope">{{ scope.row.note }}</template>
|
||||||
|
|
|
@ -0,0 +1,18 @@
|
||||||
|
# Generated by Django 3.2.12 on 2024-03-22 02:55
|
||||||
|
|
||||||
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('supervision', '0052_task_cate'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AddField(
|
||||||
|
model_name='record',
|
||||||
|
name='dept_top_yes',
|
||||||
|
field=models.BooleanField(default=True, verbose_name='事业部是否确认'),
|
||||||
|
),
|
||||||
|
]
|
|
@ -85,6 +85,7 @@ class Record(CommonBModel):
|
||||||
noteb = models.TextField('报送说明', null=True, blank=True)
|
noteb = models.TextField('报送说明', null=True, blank=True)
|
||||||
files = models.ManyToManyField(File, verbose_name="关联文件")
|
files = models.ManyToManyField(File, verbose_name="关联文件")
|
||||||
dept_yes = models.BooleanField('二级单位是否确认', default=True)
|
dept_yes = models.BooleanField('二级单位是否确认', default=True)
|
||||||
|
dept_top_yes = models.BooleanField('事业部是否确认', default=True)
|
||||||
class Meta:
|
class Meta:
|
||||||
verbose_name = '报送记录'
|
verbose_name = '报送记录'
|
||||||
verbose_name_plural = verbose_name
|
verbose_name_plural = verbose_name
|
||||||
|
|
|
@ -315,6 +315,8 @@ class RecordViewSet(RbacFilterSet, PageOrNot, CreateUpdateCustomMixin, ModelView
|
||||||
obj.state = '已报送'
|
obj.state = '已报送'
|
||||||
if obj.belong_dept.type.name=='2级公司':
|
if obj.belong_dept.type.name=='2级公司':
|
||||||
obj.dept_yes = True
|
obj.dept_yes = True
|
||||||
|
if obj.belong_dept.type.name=='事业部':
|
||||||
|
obj.dept_yes_top = True
|
||||||
obj.up_user = request.user
|
obj.up_user = request.user
|
||||||
obj.up_date = timezone.now()
|
obj.up_date = timezone.now()
|
||||||
obj.save()
|
obj.save()
|
||||||
|
@ -351,6 +353,17 @@ class RecordViewSet(RbacFilterSet, PageOrNot, CreateUpdateCustomMixin, ModelView
|
||||||
obj.save()
|
obj.save()
|
||||||
return Response(status=status.HTTP_200_OK)
|
return Response(status=status.HTTP_200_OK)
|
||||||
return Response('记录状态错误', status=status.HTTP_400_BAD_REQUEST)
|
return Response('记录状态错误', status=status.HTTP_400_BAD_REQUEST)
|
||||||
|
@action(methods=['put'], detail=True, perms_map = {'put':'record_detconfirm_top'})
|
||||||
|
def deptconfirm_top(self, request, *args, **kwargs):
|
||||||
|
"""
|
||||||
|
事业部确认
|
||||||
|
"""
|
||||||
|
obj = self.get_object()
|
||||||
|
if obj.state in ['已报送']:
|
||||||
|
obj.dept_top_yes = True
|
||||||
|
obj.save()
|
||||||
|
return Response(status=status.HTTP_200_OK)
|
||||||
|
return Response('记录状态错误', status=status.HTTP_400_BAD_REQUEST)
|
||||||
@action(methods=['put'], detail=True, perms_map = {'put':'record_confirm'})
|
@action(methods=['put'], detail=True, perms_map = {'put':'record_confirm'})
|
||||||
def confirm(self, request, *args, **kwargs):
|
def confirm(self, request, *args, **kwargs):
|
||||||
"""
|
"""
|
||||||
|
|
Loading…
Reference in New Issue