增加字段展示
This commit is contained in:
parent
841407953e
commit
008b284a6b
|
@ -34,6 +34,8 @@ const install = (Vue, vm) => {
|
||||||
|
|
||||||
let checkInspectRecord = (id, params)=> vm.$u.put(`/quality/inspectrecord/${id}/check/`, params);
|
let checkInspectRecord = (id, params)=> vm.$u.put(`/quality/inspectrecord/${id}/check/`, params);
|
||||||
|
|
||||||
|
let startInspectDept = (id, params)=>vm.$u.put(`/quality/inspectdept/${id}/start/`, params);//开始检查
|
||||||
|
|
||||||
let upInspectDept = (id, params)=>vm.$u.put(`/quality/inspectdept/${id}/up/`, params);//提交记录
|
let upInspectDept = (id, params)=>vm.$u.put(`/quality/inspectdept/${id}/up/`, params);//提交记录
|
||||||
|
|
||||||
let appointChecker = (params) => vm.$u.post('/quality/inspectrecord/appoint/', params);//检查指派
|
let appointChecker = (params) => vm.$u.post('/quality/inspectrecord/appoint/', params);//检查指派
|
||||||
|
@ -50,6 +52,7 @@ const install = (Vue, vm) => {
|
||||||
checkInspectRecord,
|
checkInspectRecord,
|
||||||
upInspectDept,
|
upInspectDept,
|
||||||
appointChecker,
|
appointChecker,
|
||||||
|
startInspectDept
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -6,10 +6,15 @@
|
||||||
<view class="u-body-item-title">
|
<view class="u-body-item-title">
|
||||||
<span class="itemstate">{{initData.state}}</span>
|
<span class="itemstate">{{initData.state}}</span>
|
||||||
</view>
|
</view>
|
||||||
|
<view class="u-body-item">
|
||||||
|
开始检查日期: <span>{{initData.start_date}}</span>
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="" slot="foot">
|
<view class="" slot="foot">
|
||||||
<view style="flex:true;text-align: right;">
|
<view style="flex:true;text-align: right;">
|
||||||
<u-checkbox @change="selfChange" v-model="is_self">只看我的</u-checkbox>
|
<u-checkbox @change="selfChange" v-model="is_self">只看我的</u-checkbox>
|
||||||
|
<u-button type="primary" size="mini" style="margin-left:6rpx" @click="startCheck"
|
||||||
|
v-if="initData.state=='待检查'&&initData.leader==vuex_user.id">开始检查</u-button>
|
||||||
<u-button type="warning" size="mini" style="margin-left:6rpx" @click="upReport"
|
<u-button type="warning" size="mini" style="margin-left:6rpx" @click="upReport"
|
||||||
v-if="initData.state=='检查中'&&initData.leader==vuex_user.id">提交结果</u-button>
|
v-if="initData.state=='检查中'&&initData.leader==vuex_user.id">提交结果</u-button>
|
||||||
<u-button size="mini" style="margin-left:6rpx" @click="goReport" v-if="initData.state=='已提交'">查看报告
|
<u-button size="mini" style="margin-left:6rpx" @click="goReport" v-if="initData.state=='已提交'">查看报告
|
||||||
|
@ -48,7 +53,7 @@
|
||||||
v-if="initData.leader==vuex_user.id && mutiSelect">指派给</u-button>
|
v-if="initData.leader==vuex_user.id && mutiSelect">指派给</u-button>
|
||||||
</view>
|
</view>
|
||||||
<view style="margin-top:6rpx">
|
<view style="margin-top:6rpx">
|
||||||
<u-gap height="1" bg-color="#bbb"></u-gap>
|
<u-gap height="0.2" bg-color="#bbb"></u-gap>
|
||||||
</view>
|
</view>
|
||||||
<checkbox-group @change="checkboxChange">
|
<checkbox-group @change="checkboxChange">
|
||||||
|
|
||||||
|
@ -66,13 +71,13 @@
|
||||||
<span v-else-if="item.result=='不适用'">{{item.result}}</span>
|
<span v-else-if="item.result=='不适用'">{{item.result}}</span>
|
||||||
</view>
|
</view>
|
||||||
<view style="flex:true;text-align: right;">
|
<view style="flex:true;text-align: right;">
|
||||||
<u-button type="primary" size="mini" style="margin-left:6rpx" @click="clickRow(item)">检查
|
<u-button type="primary" size="mini" style="margin-left:6rpx" @click="clickRow(item)" v-if="initData.state=='检查中'">检查
|
||||||
</u-button>
|
</u-button>
|
||||||
<u-button size="mini" style="margin-left:6rpx" @click="clickRow2(item)" v-if="currentIndex==1">
|
<u-button size="mini" style="margin-left:6rpx" @click="clickRow2(item)" v-if="currentIndex==1">
|
||||||
详情</u-button>
|
详情</u-button>
|
||||||
</view>
|
</view>
|
||||||
<view style="margin-top:6rpx">
|
<view style="margin-top:6rpx">
|
||||||
<u-gap height="1" bg-color="#bbb"></u-gap>
|
<u-gap height="0.5" bg-color="#bbb"></u-gap>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</checkbox-group>
|
</checkbox-group>
|
||||||
|
@ -285,7 +290,7 @@
|
||||||
var that = this
|
var that = this
|
||||||
let checker = that.members[index].member
|
let checker = that.members[index].member
|
||||||
uni.showModal({
|
uni.showModal({
|
||||||
title: '提交',
|
title: '',
|
||||||
content: '确认将' + that.selects.length + '个检查指派给' + that.members[index].member__name + '吗?',
|
content: '确认将' + that.selects.length + '个检查指派给' + that.members[index].member__name + '吗?',
|
||||||
success: function(res) {
|
success: function(res) {
|
||||||
if (res.confirm) {
|
if (res.confirm) {
|
||||||
|
@ -305,7 +310,7 @@
|
||||||
upReport() {
|
upReport() {
|
||||||
let that = this
|
let that = this
|
||||||
uni.showModal({
|
uni.showModal({
|
||||||
title: '提交',
|
title: '',
|
||||||
content: '确认提交吗?',
|
content: '确认提交吗?',
|
||||||
success: function(res) {
|
success: function(res) {
|
||||||
if (res.confirm) {
|
if (res.confirm) {
|
||||||
|
@ -315,6 +320,23 @@
|
||||||
}).catch(e => {})
|
}).catch(e => {})
|
||||||
} else if (res.cancel) {
|
} else if (res.cancel) {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
startCheck(){
|
||||||
|
let that = this
|
||||||
|
uni.showModal({
|
||||||
|
title: '',
|
||||||
|
content: '确认开始检查吗?',
|
||||||
|
success: function(res) {
|
||||||
|
if (res.confirm) {
|
||||||
|
that.$u.api.startInspectDept(that.initData.id).then(res => {
|
||||||
|
that.initData = res.data
|
||||||
|
that.$u.toast('成功')
|
||||||
|
}).catch(e => {})
|
||||||
|
} else if (res.cancel) {
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
</u-form-item>
|
</u-form-item>
|
||||||
</u-form>
|
</u-form>
|
||||||
<!-- <button :style="[inputStyle]" class="getCaptcha">登录</button> -->
|
<!-- <button :style="[inputStyle]" class="getCaptcha">登录</button> -->
|
||||||
<!-- <u-gap height="1" bg-color="#bbb"></u-gap> -->
|
<!-- <u-gap height="0.5" bg-color="#bbb"></u-gap> -->
|
||||||
<view style="margin-top: 16rpx;">
|
<view style="margin-top: 16rpx;">
|
||||||
<u-button @click="submit" type="primary" >登录</u-button>
|
<u-button @click="submit" type="primary" >登录</u-button>
|
||||||
</view>
|
</view>
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
<span style="color:darkblue;" v-if="subtask.members">{{subtask.members.length}}</span>人
|
<span style="color:darkblue;" v-if="subtask.members">{{subtask.members.length}}</span>人
|
||||||
</view>
|
</view>
|
||||||
<view style="margin-top: 6rpx;">
|
<view style="margin-top: 6rpx;">
|
||||||
<u-gap height="1" bg-color="#bbb"></u-gap>
|
<u-gap height="0.5" bg-color="#bbb"></u-gap>
|
||||||
</view>
|
</view>
|
||||||
<u-collapse-item title="巡查组组成" :open="true">
|
<u-collapse-item title="巡查组组成" :open="true">
|
||||||
<view>
|
<view>
|
||||||
|
|
|
@ -99,7 +99,7 @@ class InspectDeptSerializer(serializers.ModelSerializer):
|
||||||
leader = serializers.SerializerMethodField()
|
leader = serializers.SerializerMethodField()
|
||||||
class Meta:
|
class Meta:
|
||||||
model = InspectDept
|
model = InspectDept
|
||||||
fields = ('dept', 'dept__name', 'state', 'subtask', 'id', 'note', 'leader')
|
fields = ('dept', 'dept__name', 'state', 'subtask', 'id', 'note', 'leader', 'start_date')
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def setup_eager_loading(queryset):
|
def setup_eager_loading(queryset):
|
||||||
|
|
|
@ -263,4 +263,5 @@ class InspectRecordViewSet(PageOrNot, ModelViewSet):
|
||||||
serializer = InspectRecordCheckSerializer(instance, data=request.data)
|
serializer = InspectRecordCheckSerializer(instance, data=request.data)
|
||||||
serializer.is_valid(raise_exception=True)
|
serializer.is_valid(raise_exception=True)
|
||||||
serializer.save(checker=request.user, checked=True, check_time=timezone.now())
|
serializer.save(checker=request.user, checked=True, check_time=timezone.now())
|
||||||
|
return Response(status=status.HTTP_200_OK)
|
||||||
return Response('任务状态错误', status=status.HTTP_400_BAD_REQUEST)
|
return Response('任务状态错误', status=status.HTTP_400_BAD_REQUEST)
|
Loading…
Reference in New Issue