Merge branch 'master' of https://e.coding.net/ctcdevteam/cma_search
This commit is contained in:
commit
83a0ed11ff
|
|
@ -97,3 +97,10 @@ export function getmytasklist(query) {
|
||||||
params: query
|
params: query
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function confirmTaskdept(id) {
|
||||||
|
return request({
|
||||||
|
url: `/supervision/taskdept/${id}/confirm/`,
|
||||||
|
method: 'put'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
@ -124,6 +124,25 @@
|
||||||
{{ scope.row.confirm_rate }}%
|
{{ scope.row.confirm_rate }}%
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
align="center"
|
||||||
|
label="操作"
|
||||||
|
width="240px"
|
||||||
|
fixed="right"
|
||||||
|
>
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-link
|
||||||
|
v-if="
|
||||||
|
scope.row.confirm_rate != 100 &&
|
||||||
|
checkPermission(['record_confirm'])
|
||||||
|
"
|
||||||
|
type="warning"
|
||||||
|
size="small"
|
||||||
|
@click="handleConfirmDept(scope)"
|
||||||
|
>确认</el-link
|
||||||
|
>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
</el-card>
|
</el-card>
|
||||||
<el-card style="margin-top: 2px">
|
<el-card style="margin-top: 2px">
|
||||||
|
|
@ -309,7 +328,7 @@
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
<script>
|
<script>
|
||||||
import { gettask, inittask, gettaskdeptall, starttask, appendtask } from "@/api/task";
|
import { gettask, inittask, gettaskdeptall, starttask, appendtask, confirmTaskdept } from "@/api/task";
|
||||||
import { getRecordList, updateRecords } from "@/api/record";
|
import { getRecordList, updateRecords } from "@/api/record";
|
||||||
import Pagination from "@/components/Pagination";
|
import Pagination from "@/components/Pagination";
|
||||||
import taskinit from "@/views/supervision/taskinit";
|
import taskinit from "@/views/supervision/taskinit";
|
||||||
|
|
@ -442,6 +461,12 @@ export default {
|
||||||
}
|
}
|
||||||
this.selectRecords = selects;
|
this.selectRecords = selects;
|
||||||
},
|
},
|
||||||
|
handleConfirmDept(scope){
|
||||||
|
confirmTaskdept(scope.row.id).then(res=>{
|
||||||
|
this.getRecordList()
|
||||||
|
this.gettaskdeptall()
|
||||||
|
})
|
||||||
|
},
|
||||||
handleUp2(){
|
handleUp2(){
|
||||||
if (this.selectRecords.length) {
|
if (this.selectRecords.length) {
|
||||||
this.$prompt('请输入备注内容', '提示').then(({ value }) => {
|
this.$prompt('请输入备注内容', '提示').then(({ value }) => {
|
||||||
|
|
|
||||||
|
|
@ -13,25 +13,40 @@
|
||||||
/**
|
/**
|
||||||
* h5,app-plus(nvue下也为app-plus),mp-weixin,mp-alipay......
|
* h5,app-plus(nvue下也为app-plus),mp-weixin,mp-alipay......
|
||||||
*/
|
*/
|
||||||
var that=this
|
//var that=this
|
||||||
// 小程序自动登录
|
// 小程序自动登录
|
||||||
|
uni.showLoading({
|
||||||
|
title:'微信自动登录中...',
|
||||||
|
mask: true
|
||||||
|
})
|
||||||
uni.login({
|
uni.login({
|
||||||
provider: 'weixin',
|
provider: 'weixin',
|
||||||
success: function (loginRes) {
|
success: (loginRes)=>{
|
||||||
that.$u.api.wxmplogin({code:loginRes.code}).then(res=>{
|
this.$u.api.wxmplogin({code:loginRes.code}).then(res=>{
|
||||||
that.$u.vuex('vuex_token', res.data.access)
|
this.$u.vuex('vuex_token', res.data.access)
|
||||||
}).catch(e=>{uni.reLaunch({
|
this.$u.api.getUserInfo().then(res=>{
|
||||||
|
uni.hideLoading()
|
||||||
|
uni.showToast({
|
||||||
|
title:"登录成功",
|
||||||
|
icon:"none"
|
||||||
|
})
|
||||||
|
uni.reLaunch({
|
||||||
|
url:"/pages/home/home"
|
||||||
|
})
|
||||||
|
this.$u.vuex('vuex_user', res.data)
|
||||||
|
})
|
||||||
|
}).catch(e=>{
|
||||||
|
uni.hideLoading()
|
||||||
|
uni.showToast({
|
||||||
|
title:"暂未绑定微信!",
|
||||||
|
icon:"none"
|
||||||
|
})
|
||||||
|
uni.reLaunch({
|
||||||
url:'/pages/login/login'
|
url:'/pages/login/login'
|
||||||
})})
|
})})
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
// this.$u.api.getUserInfo().then(res=>{
|
|
||||||
// this.$u.vuex('vuex_user', res.data)
|
|
||||||
// }).catch(e=>{
|
|
||||||
// uni.reLaunch({
|
|
||||||
// url:'/pages/login/login'
|
|
||||||
// })
|
|
||||||
// })
|
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,15 @@
|
||||||
// }]
|
// }]
|
||||||
// },
|
// },
|
||||||
"pages": [
|
"pages": [
|
||||||
|
{
|
||||||
|
"path" : "pages/login/login",
|
||||||
|
"style" :
|
||||||
|
{
|
||||||
|
"navigationBarTitleText": "验证码登录",
|
||||||
|
"enablePullDownRefresh": false
|
||||||
|
}
|
||||||
|
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"path" : "pages/home/home",
|
"path" : "pages/home/home",
|
||||||
"style" :
|
"style" :
|
||||||
|
|
@ -28,15 +37,6 @@
|
||||||
"enablePullDownRefresh": false
|
"enablePullDownRefresh": false
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
|
||||||
,{
|
|
||||||
"path" : "pages/login/login",
|
|
||||||
"style" :
|
|
||||||
{
|
|
||||||
"navigationBarTitleText": "验证码登录",
|
|
||||||
"enablePullDownRefresh": false
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
,{
|
,{
|
||||||
"path" : "pages/login/login_password",
|
"path" : "pages/login/login_password",
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@
|
||||||
<u-form-item label="拍照取证">
|
<u-form-item label="拍照取证">
|
||||||
<u-image
|
<u-image
|
||||||
@click="imgListPreview(index)"
|
@click="imgListPreview(index)"
|
||||||
width="260rpx" height="260rpx" :src="item" v-for="(item, index) in fileList" v-bind:key="index" style="margin: 8rpx;"></u-image>
|
width="260rpx" height="260rpx" :src="item" v-for="(item, index) in fileList" v-bind:key="index" style="margin: 2rpx;"></u-image>
|
||||||
</u-form-item>
|
</u-form-item>
|
||||||
|
|
||||||
</u-form>
|
</u-form>
|
||||||
|
|
|
||||||
|
|
@ -34,12 +34,12 @@ const store = new Vuex.Store({
|
||||||
vuex_user: lifeData.vuex_user ? lifeData.vuex_user : {},
|
vuex_user: lifeData.vuex_user ? lifeData.vuex_user : {},
|
||||||
vuex_token: lifeData.vuex_token ? lifeData.vuex_token : '',
|
vuex_token: lifeData.vuex_token ? lifeData.vuex_token : '',
|
||||||
// vuex_host: 'http://127.0.0.1:8000',
|
// vuex_host: 'http://127.0.0.1:8000',
|
||||||
// vuex_api: 'http://127.0.0.1:8000/api',
|
vuex_api: 'http://127.0.0.1:8000/api',
|
||||||
// vuex_apifile: 'http://127.0.0.1:8000/api/file/',
|
vuex_apifile: 'http://127.0.0.1:8000/api/file/',
|
||||||
|
|
||||||
vuex_host: 'https://testsearch.ctc.ac.cn',
|
vuex_host: 'https://testsearch.ctc.ac.cn',
|
||||||
vuex_api: 'https://testsearch.ctc.ac.cn/api',
|
// vuex_api: 'https://testsearch.ctc.ac.cn/api',
|
||||||
vuex_apifile: 'https://testsearch.ctc.ac.cn/api/file/',
|
// vuex_apifile: 'https://testsearch.ctc.ac.cn/api/file/',
|
||||||
|
|
||||||
// 如果vuex_version无需保存到本地永久存储,无需lifeData.vuex_version方式
|
// 如果vuex_version无需保存到本地永久存储,无需lifeData.vuex_version方式
|
||||||
// vuex_version: '1.0.1',
|
// vuex_version: '1.0.1',
|
||||||
|
|
|
||||||
|
|
@ -196,7 +196,7 @@ class InspectDeptViewSet(OptimizationMixin, ListModelMixin, RetrieveModelMixin,
|
||||||
if not InspectRecord.objects.filter(dept=obj.dept, subtask=obj.subtask).exists():
|
if not InspectRecord.objects.filter(dept=obj.dept, subtask=obj.subtask).exists():
|
||||||
for i in InspectItem.objects.filter(is_deleted=False, template=obj.subtask.inspecttask.template):
|
for i in InspectItem.objects.filter(is_deleted=False, template=obj.subtask.inspecttask.template):
|
||||||
r = {}
|
r = {}
|
||||||
r['dept'] = obj.dpet
|
r['dept'] = obj.dept
|
||||||
r['item'] = i
|
r['item'] = i
|
||||||
r['subtask'] = obj.subtask
|
r['subtask'] = obj.subtask
|
||||||
r['create_by'] = request.user
|
r['create_by'] = request.user
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,13 @@
|
||||||
|
from apps.supervision.serializers import TaskDeptSerializer
|
||||||
from django.urls import path, include
|
from django.urls import path, include
|
||||||
from rest_framework import routers
|
from rest_framework import routers
|
||||||
from .views import ContentViewSet, TaskViewSet,RecordViewSet
|
from .views import ContentViewSet, TaskViewSet,RecordViewSet, TaskDeptViewSet
|
||||||
|
|
||||||
router = routers.DefaultRouter()
|
router = routers.DefaultRouter()
|
||||||
router.register('content', ContentViewSet, basename="content")
|
router.register('content', ContentViewSet, basename="content")
|
||||||
router.register('task', TaskViewSet, basename="task")
|
router.register('task', TaskViewSet, basename="task")
|
||||||
router.register('record', RecordViewSet, basename="record")
|
router.register('record', RecordViewSet, basename="record")
|
||||||
|
router.register('taskdept', TaskDeptViewSet, basename="taskdept")
|
||||||
urlpatterns = [
|
urlpatterns = [
|
||||||
path('', include(router.urls))
|
path('', include(router.urls))
|
||||||
]
|
]
|
||||||
|
|
@ -331,3 +331,26 @@ class RecordViewSet(PageOrNot, CreateUpdateCustomMixin, ModelViewSet):
|
||||||
return Response('记录状态错误', status=status.HTTP_400_BAD_REQUEST)
|
return Response('记录状态错误', status=status.HTTP_400_BAD_REQUEST)
|
||||||
|
|
||||||
|
|
||||||
|
class TaskDeptViewSet(ModelViewSet):
|
||||||
|
"""
|
||||||
|
任务关联部门 操作
|
||||||
|
"""
|
||||||
|
perms_map = {'get': '*', 'post': 'task_update',
|
||||||
|
'put': 'task_update', 'delete': 'task_update'}
|
||||||
|
queryset = TaskDept.objects.all()
|
||||||
|
serializer_class = TaskDeptSerializer
|
||||||
|
filterset_fields = ['task','dept']
|
||||||
|
ordering = ['dept__sort']
|
||||||
|
|
||||||
|
@action(methods=['put'], detail=True, perms_map = {'put':'record_confirm'})
|
||||||
|
def confirm(self, request, *args, **kwargs):
|
||||||
|
"""
|
||||||
|
批量确认
|
||||||
|
"""
|
||||||
|
obj = self.get_object()
|
||||||
|
if obj.up_rate == 100:
|
||||||
|
Record.objects.filter(task=obj.task, belong_dept=obj.dept).update(state='已确认')
|
||||||
|
obj.confirm_rate = 100
|
||||||
|
obj.save()
|
||||||
|
return Response(status=status.HTTP_200_OK)
|
||||||
|
return Response('报送未完成', status=status.HTTP_400_BAD_REQUEST)
|
||||||
|
|
@ -0,0 +1,19 @@
|
||||||
|
# Generated by Django 3.0.5 on 2021-04-30 03:56
|
||||||
|
|
||||||
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('system', '0017_userthird'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name='userthird',
|
||||||
|
name='openid',
|
||||||
|
field=models.CharField(default='xx', max_length=200, unique=True, verbose_name='第三方账号'),
|
||||||
|
preserve_default=False,
|
||||||
|
),
|
||||||
|
]
|
||||||
|
|
@ -229,4 +229,4 @@ class UserThird(models.Model):
|
||||||
|
|
||||||
user = models.ForeignKey(User, on_delete=models.CASCADE, verbose_name='关联账户', related_name='third_user')
|
user = models.ForeignKey(User, on_delete=models.CASCADE, verbose_name='关联账户', related_name='third_user')
|
||||||
type = models.CharField('类型', max_length=50, choices=type_choices, default='wx_mp')
|
type = models.CharField('类型', max_length=50, choices=type_choices, default='wx_mp')
|
||||||
openid = models.CharField('第三方账号', null=True, blank=True, max_length=200)
|
openid = models.CharField('第三方账号', max_length=200, unique=True)
|
||||||
|
|
|
||||||
|
|
@ -315,8 +315,8 @@ class UserViewSet(PageOrNot, ModelViewSet):
|
||||||
'perms': perms,
|
'perms': perms,
|
||||||
}
|
}
|
||||||
try:
|
try:
|
||||||
user = UserThird.objects.get(user=user,type='wx_mp').user
|
usert = UserThird.objects.get(user=user,type='wx_mp')
|
||||||
data['wxmp_openid'] = user.openid
|
data['wxmp_openid'] = usert.openid
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
return Response(data)
|
return Response(data)
|
||||||
|
|
@ -343,7 +343,13 @@ class UserViewSet(PageOrNot, ModelViewSet):
|
||||||
code+'&grant_type=authorization_code').content.decode('utf-8')
|
code+'&grant_type=authorization_code').content.decode('utf-8')
|
||||||
info = json.loads(info)
|
info = json.loads(info)
|
||||||
openid = info['openid']
|
openid = info['openid']
|
||||||
UserThird.objects.get_or_create(openid=openid, type='wx_mp', user=request.user, defaults={'openid':openid, 'user':request.user, 'type':'wx_mp'})
|
instances = UserThird.objects.filter(openid=openid)
|
||||||
|
if instances.exists():
|
||||||
|
instance = instances[0]
|
||||||
|
instance.user = request.user
|
||||||
|
instance.save()
|
||||||
|
else:
|
||||||
|
UserThird.objects.get_or_create(openid=openid, type='wx_mp', user=request.user, defaults={'openid':openid, 'user':request.user, 'type':'wx_mp'})
|
||||||
return Response({'wxmp_openid':openid},status=status.HTTP_200_OK)
|
return Response({'wxmp_openid':openid},status=status.HTTP_200_OK)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue