Commit fb8ac859 by pangchong

feat: 定检管理-非计划

parent aa46e879
import { post, http } from 'mocp/utils/http'
export const unplanApplyListApi = (data, config) => {
return http({
method: 'POST',
url: '/workbench/unplanApply/unplanApplyList',
data,
config
})
}
export const addUnplanApplyApi = (data, config) => {
return post({
method: 'POST',
url: '/workbench/unplanApply/addUnplanApply',
data,
config
})
}
export const checkPakgeNoApi = (data, config) => {
return http({
method: 'POST',
url: '/workbench/unplanApply/checkPakgeNo',
data,
config
})
}
export const getUnplanApplyApi = (data, config) => {
return http({
method: 'POST',
url: '/workbench/unplanApply/getUnplanApply',
data,
config
})
}
export const changeStatusApi = (data, config) => {
return http({
method: 'POST',
url: '/workbench/unplanApply/changeStatus',
data,
config
})
}
export const changeExemptStatusApi = (data, config) => {
return http({
method: 'POST',
url: '/workbench/unplanApply/changeExemptStatus',
data,
config
})
}
import { post, http } from 'mocp/utils/http'
export const unplanWarningListApi = (data, config) => {
return http({
method: 'POST',
url: '/workbench/unplanWarning/unplanWarningList',
data,
config
})
}
export const addUnplanWarningApi = (data, config) => {
return post({
method: 'POST',
url: '/workbench/unplanWarning/addUnplanWarning',
data,
config
})
}
export const checkPakgeNoApi = (data, config) => {
return http({
method: 'POST',
url: '/workbench/unplanWarning/checkPakgeNo',
data,
config
})
}
export const getUnplanWarningApi = (data, config) => {
return http({
method: 'POST',
url: '/workbench/unplanWarning/getUnplanWarning',
data,
config
})
}
export const changeStatusApi = (data, config) => {
return http({
method: 'POST',
url: '/workbench/unplanWarning/changeStatus',
data,
config
})
}
...@@ -65,3 +65,9 @@ export const st_followStatus = [ ...@@ -65,3 +65,9 @@ export const st_followStatus = [
{ text: '已到位', class: 'mocp-color-warning-6', value: 3 }, { text: '已到位', class: 'mocp-color-warning-6', value: 3 },
{ text: '已登机', class: 'mocp-color-success-6', value: 4 } { text: '已登机', class: 'mocp-color-success-6', value: 4 }
] ]
export const unPlan_applyStatus = [
{ text: '申请中', class: 'mocp-color-danger-6', value: '0' },
{ text: '已通过', class: 'mocp-color-primary-6', value: '1' },
{ text: '已驳回', class: 'mocp-color-primary-6', value: '2' },
{ text: '已撤销', class: 'mocp-color-primary-6', value: '3' }
]
...@@ -16,3 +16,4 @@ export * from './technicalAnalysis' ...@@ -16,3 +16,4 @@ export * from './technicalAnalysis'
export * from './engineeringEvaluation' export * from './engineeringEvaluation'
export * from './windDamageManagement' export * from './windDamageManagement'
export * from './inforDisclosure' export * from './inforDisclosure'
export * from './noPlan'
// 建议以文件名首字母作为前缀sa_
export const np_applyStatus = [
{ label: '申请中', value: '0' },
{ label: '已通过', value: '1' },
{ label: '已驳回', value: '2' },
{ label: '已撤销', value: '3' }
]
export const np_checkLevel = [
{ label: '高级别定检', value: '1' },
{ label: '低级别定检', value: '2' },
{ label: '专项定检', value: '3' }
]
export const np_sourceType = [
{ label: 'MOCP', value: '1' },
{ label: 'CMIC', value: '2' }
]
export const np_exemptStatus = [
{ label: '是', value: '1' },
{ label: '否', value: '0' }
]
import { getUnplanApplyApi } from 'mocp/api/unplanApply'
import { defineStore } from 'pinia'
const useUnplanApplyStore = defineStore('unplanApply', {
state: () => {
return {
searchData: {
applyStatus: '',
packageNo: '',
exemptStatus: null,
sourceType: '',
checkLevel: null,
acType: '',
airline: '',
startTime: null,
startTimeEnd: null,
applyTimeStart: null,
applyTimeEnd: null
},
id: '',
details: undefined
}
},
getters: {},
actions: {
async getDetails() {
this.details = {
acType: '73N',
airline: 'YZJ',
applyStatus: '0',
approver: '17',
approverName: '',
checkLevel: '2',
createTime: 1734679857000,
createUser: '21',
createUserName: '',
delayDay: 12,
delayEntTime: 1735412399000,
endTime: '1734375599000',
examineReason: '',
exemptStatus: '0',
id: '1870008971817910272',
isDel: '0',
materialDelay: '1',
materialPns: '1,2',
packageName: '航线--督办杀虫EO',
packageNo: '500001099668',
planStayingDay: '0',
reason: '3',
sourceType: '1',
startTime: '1734364740000',
updateTime: 0,
updateUser: null,
warningReason: '2,3'
}
const res = await getUnplanApplyApi({ id: this.id }, { loading: true })
if (res.code == 200) {
this.details = res.data
} else {
uni.$mocpMessage.error(res.message)
}
},
resetForm() {
this.searchData = {
applyStatus: '',
packageNo: '',
exemptStatus: null,
sourceType: '',
checkLevel: null,
acType: '',
airline: '',
startTime: null,
startTimeEnd: null,
applyTimeStart: null,
applyTimeEnd: null
}
},
setState(...args) {
this.$patch({ [args[0]]: args[1] })
}
},
// 配置持久化
persist: false
})
export default useUnplanApplyStore
import { getUnplanWarningApi } from 'mocp/api/unplanWarning'
import { defineStore } from 'pinia'
const useUnplanWarningStore = defineStore('unplanWarning', {
state: () => {
return {
searchData: {
applyStatus: '',
packageNo: '',
sourceType: '',
checkLevel: null,
acType: '',
airline: '',
startTime: null,
startTimeEnd: null,
applyTimeStart: null,
applyTimeEnd: null
},
id: '',
details: undefined
}
},
getters: {},
actions: {
async getDetails() {
// this.details = {
// acType: '73N',
// airline: 'YZJ',
// applyStatus: '0',
// approver: '6',
// approverName: '',
// checkLevel: '2',
// createTime: 1734507585000,
// createUser: '21',
// createUserName: '',
// endTime: '1734386399000',
// examineReason: '',
// id: '1869286413837533184',
// isDel: '0',
// materialDelay: '1',
// materialPns: '666,8999',
// packageName: '航线-织物包检查',
// packageNo: '500001101955',
// planStayingDay: '0',
// reason: '112',
// sourceType: '1',
// startTime: '1734361200000',
// updateTime: 0,
// updateUser: null,
// warningReason: '1'
// }
const res = await getUnplanWarningApi({ id: this.id }, { loading: true })
if (res.code == 200) {
this.details = res.data
} else {
uni.$mocpMessage.error(res.message)
}
},
resetForm() {
this.searchData = {
applyStatus: '',
packageNo: '',
sourceType: '',
checkLevel: null,
acType: '',
airline: '',
startTime: null,
startTimeEnd: null,
applyTimeStart: null,
applyTimeEnd: null
}
},
setState(...args) {
this.$patch({ [args[0]]: args[1] })
}
},
// 配置持久化
persist: false
})
export default useUnplanWarningStore
...@@ -29,7 +29,10 @@ const menuList = ref([ ...@@ -29,7 +29,10 @@ const menuList = ref([
{ id: 'gcfx', name: '工程分析', icon: 'gcfx', group: '运行品质', default: false, count: 0, url: '/panel/engineeringEvaluation/list' }, { id: 'gcfx', name: '工程分析', icon: 'gcfx', group: '运行品质', default: false, count: 0, url: '/panel/engineeringEvaluation/list' },
// 航站管理 // 航站管理
{ id: 'bzcsj', name: '不正常事件', icon: 'bzcsj', group: '航站管理', default: false, count: 0, url: '/panel/abnormalEventManage/list' }, { id: 'bzcsj', name: '不正常事件', icon: 'bzcsj', group: '航站管理', default: false, count: 0, url: '/panel/abnormalEventManage/list' },
{ id: 'xydw', name: '协议单位', icon: 'xydw', group: '航站管理', default: false, count: 0, url: '/panel/workSupervision/list' } { id: 'xydw', name: '协议单位', icon: 'xydw', group: '航站管理', default: false, count: 0, url: '/panel/workSupervision/list' },
// 定检管理
{ id: 'fjhyj', name: '非计划预警', icon: 'fjhyj', group: '定检管理', default: false, count: 0, url: '/panel/unplanWarning/list' },
{ id: 'fjhsq', name: '非计划申请', icon: 'fjhsq', group: '定检管理', default: false, count: 0, url: '/panel/unplanApply/list' }
]) ])
const useUserStore = defineStore('mocpUser', { const useUserStore = defineStore('mocpUser', {
state: () => { state: () => {
......
...@@ -776,6 +776,54 @@ ...@@ -776,6 +776,54 @@
"style": { "style": {
"navigationBarTitleText": "防沙尘暴签署单" "navigationBarTitleText": "防沙尘暴签署单"
} }
},
{
"path": "pages/modules/mocp/panel/unplanWarning/list",
"style": {
"navigationBarTitleText": "非计划预警"
}
},
{
"path": "pages/modules/mocp/panel/unplanWarning/search",
"style": {
"navigationBarTitleText": "筛选"
}
},
{
"path": "pages/modules/mocp/panel/unplanWarning/add",
"style": {
"navigationBarTitleText": "新建非计划预警"
}
},
{
"path": "pages/modules/mocp/panel/unplanWarning/details",
"style": {
"navigationBarTitleText": "非计划预警详情"
}
},
{
"path": "pages/modules/mocp/panel/unplanApply/list",
"style": {
"navigationBarTitleText": "非计划申请"
}
},
{
"path": "pages/modules/mocp/panel/unplanApply/search",
"style": {
"navigationBarTitleText": "筛选"
}
},
{
"path": "pages/modules/mocp/panel/unplanApply/add",
"style": {
"navigationBarTitleText": "新建非计划申请"
}
},
{
"path": "pages/modules/mocp/panel/unplanApply/details",
"style": {
"navigationBarTitleText": "非计划申请详情"
}
} }
], ],
"globalStyle": { "globalStyle": {
......
...@@ -24,7 +24,8 @@ ...@@ -24,7 +24,8 @@
} }
} }
]" ]"
> ></up-swipe-action-item>
</up-swipe-action>
<view class="item" @tap="goDetails(item)"> <view class="item" @tap="goDetails(item)">
<view class="item-title"> <view class="item-title">
<view class="left"> <view class="left">
...@@ -47,8 +48,6 @@ ...@@ -47,8 +48,6 @@
</view> </view>
</view> </view>
</view> </view>
</up-swipe-action-item>
</up-swipe-action>
</template> </template>
</global-page> </global-page>
</up-collapse-item> </up-collapse-item>
......
...@@ -34,7 +34,7 @@ import { storeToRefs } from 'pinia' ...@@ -34,7 +34,7 @@ import { storeToRefs } from 'pinia'
const { windowHeight, safeAreaInsets } = uni.getSystemInfoSync() const { windowHeight, safeAreaInsets } = uni.getSystemInfoSync()
//内容高度-nav高度-底部安全区-底部安全区 //内容高度-nav高度-底部安全区-底部安全区
const getHeight = computed(() => { const getHeight = computed(() => {
return windowHeight - 44 - safeAreaInsets?.top - safeAreaInsets?.bottom - 75 * 4 + 'px' return windowHeight - 44 - safeAreaInsets?.top - safeAreaInsets?.bottom - 75 * 5 + 'px'
}) })
const myToDoStore = useMyToDoStore() const myToDoStore = useMyToDoStore()
const { getTotal } = storeToRefs(myToDoStore) const { getTotal } = storeToRefs(myToDoStore)
......
<template>
<global-page title="新增非计划申请" showFooterBtn footerBtnText="提交" @handleFooterClick="handleFooterClick">
<view class="mocp-form">
<up-form labelPosition="left" labelWidth="auto" :model="formData" :rules="rules" ref="formRef">
<up-form-item label="工作包号" prop="packageNo" :borderBottom="true" required>
<up-input
v-model="formData.packageNo"
border="none"
inputAlign="right"
placeholder="请输入"
clearable
@blur="checkPakgeNo"
></up-input>
</up-form-item>
<up-form-item label="延期天数" prop="delayDay" :borderBottom="true" required>
<up-input v-model="formData.delayDay" type="number" border="none" inputAlign="right" placeholder="请输入" clearable></up-input>
</up-form-item>
<up-form-item label="申请原因" prop="warningReason" :borderBottom="true" required>
<global-picker
v-model="formData.warningReason"
pickAlign="right"
:options="getParamsByType('WarningReason')"
clearable
></global-picker>
</up-form-item>
<up-form-item label="缺件航材" :borderBottom="true">
<global-switch v-model="formData.materialDelay" switchAlign="right"></global-switch>
</up-form-item>
<up-form-item :borderBottom="true" v-if="formData.materialDelay == 1">
<view style="width: 100%">
<view class="materialDelay__input" v-for="(item, index) in materialPns" :key="index">
<up-input v-model="materialPns[index]" placeholder="请输入" clearable />
<view class="materialDelay__icon">
<up-icon
name="minus-circle-fill"
size="22"
style="margin-left: 10rpx"
v-if="index > 0"
@tap="materialPns.splice(index, 1)"
></up-icon>
<up-icon
name="plus-circle-fill"
size="22"
style="margin-left: 10rpx"
v-if="index + 1 == materialPns.length"
@tap="materialPns.push('')"
></up-icon>
</view>
</view>
</view>
</up-form-item>
<up-form-item label="具体原因" prop="reason" :borderBottom="true" labelPosition="top" required>
<up-textarea placeholder="请输入" :height="40" border="none" v-model="formData.reason"></up-textarea>
</up-form-item>
<up-form-item label="审核人" prop="approver" :borderBottom="true" required>
<custom-admin-picker pickAlign="right" clearable v-model="formData.approver"></custom-admin-picker>
</up-form-item>
</up-form>
</view>
</global-page>
</template>
<script setup>
import { getParamsByType } from 'mocp/hooks/use-params/useParams'
import { formData, formRef, materialPns, rules } from './constants/add.compositions'
import { handleSubmit, checkPakgeNo } from './constants/add.functionals'
const handleFooterClick = () => {
handleSubmit()
}
</script>
<style lang="scss" scoped>
.mocp-form {
background: #fff;
padding: 0 32rpx;
.materialDelay__input {
width: 100%;
display: flex;
margin-bottom: 10rpx;
&:last-child {
margin-bottom: 0;
}
}
.materialDelay__icon {
width: 100rpx;
display: flex;
}
}
</style>
import { reactive, ref } from 'vue'
export const formRef = ref()
//验证
export const rules = reactive({
packageNo: [
{
required: true,
message: '请输入工作包号',
trigger: ['blur', 'change']
}
],
warningReason: [
{
required: true,
message: '请输入申请原因',
trigger: ['blur', 'change']
}
],
reason: [
{
required: true,
message: '请输入具体原因',
trigger: ['blur', 'change']
}
],
delayDay: [
{
required: true,
type: 'number',
message: '请输入延期天数',
trigger: ['blur', 'change']
}
],
approver: [
{
required: true,
message: '请选择审核人',
trigger: ['blur']
}
]
})
// 表单数据
export const materialPns = ref([''])
export const formData = reactive({
packageNo: '',
delayDay: '',
approver: '',
warningReason: '',
materialDelay: 0,
materialPns: '',
reason: '',
delayDay: null
})
import { addUnplanApplyApi, checkPakgeNoApi } from 'mocp/api/unplanApply'
import { formData, formRef, materialPns } from './add.compositions'
//验证包号
export const checkPakgeNo = async (packageNo) => {
if (!packageNo) return
const res = await checkPakgeNoApi({ packageNo }, { loading: '验证包号中...' })
if (res.code == 200) {
} else {
formData.packageNo = ''
uni.$mocpMessage.error(res.message)
}
}
//提交表单
export const handleSubmit = async () => {
await formRef.value?.validate()
if (formData.materialDelay == '0') {
formData.materialPns = ''
} else {
const materialPnsStr = materialPns.value.join(',')
if (materialPnsStr) {
formData.materialPns = materialPnsStr
} else {
return uni.$mocpMessage.error('请输入缺件航材')
}
}
const res = await addUnplanApplyApi(formData, { loading: true })
if (res.code == 200) {
uni.$mocpJump.navigateBack()
uni.$mocpMessage.success(res.message)
uni.$emit('unplanApplyReload')
} else {
uni.$mocpMessage.error(res.message)
}
}
import { reactive, ref } from 'vue'
export const formRef = ref()
export const rules = reactive({
examineReason: [
{
required: true,
message: '请输入审核说明',
trigger: ['blur', 'change']
}
]
})
export const showAction = ref(false)
export const showConfirm = ref(false)
export const formData = reactive({
examineReason: ''
})
import { changeStatusApi } from 'mocp/api/unplanApply'
import { formData, formRef } from './details.compositions'
export const handleSelect = async (value, id) => {
if (value !== '3') {
await formRef.value?.validate()
}
const params = {
id,
applyStatus: value,
examineReason: formData.examineReason
}
const res = await changeStatusApi(params, { loading: true })
if (res.code == 200) {
uni.$mocpJump.navigateBack()
uni.$emit('unplanApplyReload')
uni.$mocpMessage.success(res.message)
} else {
uni.$mocpMessage.error(res.message)
}
}
<template>
<global-page title="非计划申请详情" showFooterBtn :footerBtnText="isCreateUser ? '撤销' : '审核'" @handleFooterClick="handleFooterClick">
<view class="mocp-cell">
<up-cell-group v-if="details">
<up-cell title="审核状态">
<template #value>
<global-text-status :value="details.applyStatus" dictkey="unPlan_applyStatus"></global-text-status>
</template>
</up-cell>
<up-cell title="数据来源" :value="useGetDictByValue('np_sourceType', details.sourceType)"></up-cell>
<up-cell title="工作包号" :value="details.packageNo || '-'"></up-cell>
<up-cell title="工作包名称" :value="details.packageName || '-'"></up-cell>
<up-cell title="计划开始时间" :value="timeStampFormat(details.startTime) || '-'"></up-cell>
<up-cell title="计划结束时间" :value="timeStampFormat(details.endTime) || '-'"></up-cell>
<up-cell title="延期天数" :value="details.delayDay || '-'"></up-cell>
<up-cell title="申请原因" :value="getParamNameByValue('WarningReason', details.warningReason) || '-'"></up-cell>
<up-cell title="缺件航材">
<template #label>
<template v-if="details.materialPns && details.materialDelay == '1'">
<view v-for="(item, index) in details.materialPns.split(',')" :key="index">{{ item }}</view>
</template>
<view v-else></view>
</template>
</up-cell>
<up-cell title="具体原因">
<template #label>{{ details.reason || '-' }}</template>
</up-cell>
<up-cell title="申请人" :value="details.createUserName || '-'"></up-cell>
<up-cell title="申请时间" :value="timeStampFormat(details.createTime) || '-'"></up-cell>
<template v-if="details.applyStatus != '0'">
<up-cell title="审核人" :value="details.approverName"></up-cell>
</template>
<view class="mocp-form">
<up-form labelPosition="left" labelWidth="auto" :model="formData" :rules="rules" ref="formRef">
<up-form-item label="审核说明" prop="examineReason" :borderBottom="true" required>
<up-input v-model="formData.examineReason" border="none" inputAlign="right" placeholder="请输入" clearable></up-input>
</up-form-item>
</up-form>
</view>
</up-cell-group>
</view>
<global-action-sheet
v-model="showAction"
title="审核"
description="审核本条非计划申请"
:options="[
{ label: '审核驳回', value: '2' },
{ label: '审核通过', value: '1' }
]"
@select="(value) => handleSelect(value, details.id)"
></global-action-sheet>
<up-modal
:width="250"
content="确认撤销审核吗?"
:show="showConfirm"
showCancelButton
closeOnClickOverlay
@confirm="handleSelect('3', details.id)"
@cancel="showConfirm = false"
@close="showConfirm = false"
></up-modal>
</global-page>
</template>
<script setup>
import { storeToRefs } from 'pinia'
import { useGetDictByValue } from 'mocp/hooks/use-dict/useDict'
import { getParamNameByValue } from 'mocp/hooks/use-params/useParams'
import { onLoad } from '@dcloudio/uni-app'
import { timeStampFormat } from 'mocp/utils/tool'
import { handleSelect } from './constants/details.functionals'
import { formData, rules, formRef, showAction, showConfirm } from './constants/details.compositions'
import { computed } from 'vue'
import useUserStore from 'mocp/store/user'
import useUnplanApplyStore from 'mocp/store/unplanApply'
const query = defineProps(['id'])
const unplanApplyStore = useUnplanApplyStore()
const { details } = storeToRefs(unplanApplyStore)
const userStore = useUserStore()
const isCreateUser = computed(() => {
return userStore.userInfo.id == details.value?.createUser
})
onLoad(() => {
unplanApplyStore.setState('id', query.id)
unplanApplyStore.getDetails()
formData.examineReason = ''
})
const handleFooterClick = () => {
if (isCreateUser.value) {
showConfirm.value = true
} else {
showAction.value = true
}
}
</script>
<style lang="scss" scoped>
.mocp-cell {
background: #fff;
}
.mocp-form {
background: #fff;
padding: 0 32rpx;
}
</style>
<template>
<global-page
title="非计划申请"
isDataList
refresherEnabled
loadingMoreEnabled
auto
ref="paging"
:params="searchData"
showNavRight
navRightType="icon"
navRightIcon="saixuan-01"
@handleRightClick="handleRightClick"
:api="unplanApplyListApi"
:padding="24"
showFooterBtn
footerBtnText="新增申请"
@handleFooterClick="handleFooterClick"
>
<template #default="{ item }">
<view class="item" :class="{ 'wrong-class': item.applyStatus == '0' }" @tap="goDetails(item)">
<view class="item-title">
<view class="left">
<global-text-status :value="item.applyStatus" dictkey="unPlan_applyStatus"></global-text-status>
</view>
<view class="right">
<text class="txt u-line-1" v-if="item.acType">{{ item.acType }}</text>
<text class="txt u-line-1" v-if="item.packageName">{{ item.packageName }}</text>
</view>
</view>
<view class="item-content">
<view class="u-line-3">预警原因:{{ getParamNameByValue('WarningReason', item.warningReason) || '无' }}</view>
<view class="u-line-3">具体原因:{{ item.reason || '无' }}</view>
</view>
<view class="item-footer">
<view class="label">
<global-icon icon="calendar"></global-icon>
<text class="txt">
{{ timeStampFormat(item.createTime, { format: 'YYYY/MM/DD HH:mm' }) }}
</text>
</view>
<view class="label">
<global-icon icon="idcard"></global-icon>
<text class="txt u-line-1">申请人:{{ item.createUserName || '-' }}</text>
</view>
</view>
</view>
</template>
</global-page>
</template>
<script setup>
import { ref } from 'vue'
import { storeToRefs } from 'pinia'
import { onUnload } from '@dcloudio/uni-app'
import { getParamNameByValue } from 'mocp/hooks/use-params/useParams'
import { timeStampFormat } from 'mocp/utils/tool'
import { unplanApplyListApi } from 'mocp/api/unplanApply'
import useUnplanApplyStore from 'mocp/store/unplanApply'
//跳转
const unplanApplyStore = useUnplanApplyStore()
const { searchData } = storeToRefs(unplanApplyStore)
const goDetails = (data) => {
uni.$mocpJump.navigateTo('/panel/unplanApply/details', { id: data.id })
}
//筛选
const handleRightClick = () => {
uni.$mocpJump.navigateTo('/panel/unplanApply/search')
}
//刷新
const paging = ref()
uni.$on('unplanApplyReload', () => {
paging.value?.reload()
})
//新建
const handleFooterClick = () => {
uni.$mocpJump.navigateTo('/panel/unplanApply/add')
}
onUnload(() => {
uni.$off('unplanApplyReload')
})
</script>
<style lang="scss" scoped>
@import 'mocpStatic/css/list.scss';
.wrong-class {
background: linear-gradient(138.51deg, #ffe1e1 6.14%, #ffffff 125.66%);
}
</style>
<template>
<global-page title="筛选">
<view class="search-form">
<up-form labelPosition="left" labelWidth="auto">
<up-form-item label="申请状态" prop="applyStatus" :borderBottom="true">
<global-picker v-model="formData.applyStatus" pickAlign="right" clearable dictkey="np_applyStatus"></global-picker>
</up-form-item>
<up-form-item label="包号" prop="packageNo" :borderBottom="true">
<up-input v-model="formData.packageNo" inputAlign="right" border="none" placeholder="请输入" clearable></up-input>
</up-form-item>
<up-form-item label="是否豁免" prop="exemptStatus" :borderBottom="true">
<global-picker v-model="formData.exemptStatus" pickAlign="right" clearable dictkey="np_exemptStatus"></global-picker>
</up-form-item>
<up-form-item label="数据来源" prop="sourceType" :borderBottom="true">
<global-picker pickAlign="right" v-model="formData.sourceType" dictkey="np_sourceType" clearable></global-picker>
</up-form-item>
<up-form-item label="定检类型" prop="checkLevel" :borderBottom="true">
<global-picker pickAlign="right" v-model="formData.checkLevel" dictkey="np_checkLevel" clearable></global-picker>
</up-form-item>
<up-form-item label="机型" prop="acType" :borderBottom="true">
<global-picker v-model="formData.acType" pickAlign="right" :options="baseStore.getTypeSelect" clearable filter></global-picker>
</up-form-item>
<up-form-item label="航司" prop="airline" :borderBottom="true">
<global-picker
v-model="formData.airline"
pickAlign="right"
:options="baseStore.getAirlineSelect"
clearable
filter
></global-picker>
</up-form-item>
<up-form-item label="计划开工时间" :borderBottom="true">
<global-calendar
pickAlign="right"
v-model:startTime="formData.startTime"
v-model:endTime="formData.startTimeEnd"
clearable
></global-calendar>
</up-form-item>
<up-form-item label="申请时间" :borderBottom="true">
<global-calendar
pickAlign="right"
v-model:startTime="formData.applyTimeStart"
v-model:endTime="formData.applyTimeEnd"
clearable
></global-calendar>
</up-form-item>
</up-form>
</view>
<template #bottom>
<view class="footer-btn">
<up-row gutter="10">
<up-col span="6">
<global-button type="primary" plain size="large" :radius="5" @tap="handleReset">重置</global-button>
</up-col>
<up-col span="6"><global-button type="primary" size="large" :radius="5" @tap="handleConfirm">确定</global-button></up-col>
</up-row>
</view>
</template>
</global-page>
</template>
<script setup>
import useBaseStore from 'mocp/store/base'
import { storeToRefs } from 'pinia'
import { cloneDeep } from 'lodash'
import { ref } from 'vue'
import useUnplanApplyStore from 'mocp/store/unplanApply'
//获取下拉框选项
const baseStore = useBaseStore()
const unplanApplyStore = useUnplanApplyStore()
//获取查询表单数据
const { searchData } = storeToRefs(unplanApplyStore)
const formData = ref(cloneDeep(searchData.value))
const handleReset = () => {
unplanApplyStore.resetForm()
uni.$mocpJump.navigateBack()
uni.$emit('unplanApplyReload')
}
const handleConfirm = () => {
unplanApplyStore.setState('searchData', formData.value)
uni.$mocpJump.navigateBack()
uni.$emit('unplanApplyReload')
}
</script>
<style lang="scss" scoped>
.search-form {
padding: 24rpx 24rpx 0 24rpx;
background: #fff;
}
.footer-btn {
padding: 24rpx 32rpx;
background-color: #fff;
}
</style>
<template>
<global-page title="新增非计划预警" showFooterBtn footerBtnText="提交" @handleFooterClick="handleFooterClick">
<view class="mocp-form">
<up-form labelPosition="left" labelWidth="auto" :model="formData" :rules="rules" ref="formRef">
<up-form-item label="工作包号" prop="packageNo" :borderBottom="true" required>
<up-input
v-model="formData.packageNo"
border="none"
inputAlign="right"
placeholder="请输入"
clearable
@blur="checkPakgeNo"
></up-input>
</up-form-item>
<up-form-item label="申请原因" prop="warningReason" :borderBottom="true" required>
<global-picker
v-model="formData.warningReason"
pickAlign="right"
:options="getParamsByType('WarningReason')"
clearable
></global-picker>
</up-form-item>
<up-form-item label="缺件航材" :borderBottom="true">
<global-switch v-model="formData.materialDelay" switchAlign="right"></global-switch>
</up-form-item>
<up-form-item :borderBottom="true" v-if="formData.materialDelay == 1">
<view style="width: 100%">
<view class="materialDelay__input" v-for="(item, index) in materialPns" :key="index">
<up-input v-model="materialPns[index]" placeholder="请输入" clearable />
<view class="materialDelay__icon">
<up-icon
name="minus-circle-fill"
size="22"
style="margin-left: 10rpx"
v-if="index > 0"
@tap="materialPns.splice(index, 1)"
></up-icon>
<up-icon
name="plus-circle-fill"
size="22"
style="margin-left: 10rpx"
v-if="index + 1 == materialPns.length"
@tap="materialPns.push('')"
></up-icon>
</view>
</view>
</view>
</up-form-item>
<up-form-item label="具体原因" prop="reason" :borderBottom="true" labelPosition="top" required>
<up-textarea placeholder="请输入" :height="40" border="none" v-model="formData.reason"></up-textarea>
</up-form-item>
<up-form-item label="审核人" prop="approver" :borderBottom="true" required>
<custom-admin-picker pickAlign="right" clearable v-model="formData.approver"></custom-admin-picker>
</up-form-item>
</up-form>
</view>
</global-page>
</template>
<script setup>
import { getParamsByType } from 'mocp/hooks/use-params/useParams'
import { formData, formRef, materialPns, rules } from './constants/add.compositions'
import { handleSubmit, checkPakgeNo } from './constants/add.functionals'
const handleFooterClick = () => {
handleSubmit()
}
</script>
<style lang="scss" scoped>
.mocp-form {
background: #fff;
padding: 0 32rpx;
.materialDelay__input {
width: 100%;
display: flex;
margin-bottom: 10rpx;
&:last-child {
margin-bottom: 0;
}
}
.materialDelay__icon {
width: 100rpx;
display: flex;
}
}
</style>
import { reactive, ref } from 'vue'
export const formRef = ref()
//验证
export const rules = reactive({
packageNo: [
{
required: true,
message: '请输入工作包号',
trigger: ['blur', 'change']
}
],
warningReason: [
{
required: true,
message: '请输入申请原因',
trigger: ['blur', 'change']
}
],
reason: [
{
required: true,
message: '请输入具体原因',
trigger: ['blur', 'change']
}
],
approver: [
{
required: true,
message: '请选择审核人',
trigger: ['blur']
}
]
})
// 表单数据
export const materialPns = ref([''])
export const formData = reactive({
packageNo: '',
delayDay: '',
approver: '',
warningReason: '',
materialDelay: 0,
materialPns: '',
reason: ''
})
import { addUnplanWarningApi, checkPakgeNoApi } from 'mocp/api/unplanWarning'
import { formData, formRef, materialPns } from './add.compositions'
//验证包号
export const checkPakgeNo = async (packageNo) => {
if (!packageNo) return
const res = await checkPakgeNoApi({ packageNo }, { loading: '验证包号中...' })
if (res.code == 200) {
} else {
formData.packageNo = ''
uni.$mocpMessage.error(res.message)
}
}
//提交表单
export const handleSubmit = async () => {
await formRef.value?.validate()
if (formData.materialDelay == '0') {
formData.materialPns = ''
} else {
const materialPnsStr = materialPns.value.join(',')
if (materialPnsStr) {
formData.materialPns = materialPnsStr
} else {
return uni.$mocpMessage.error('请输入缺件航材')
}
}
const res = await addUnplanWarningApi(formData, { loading: true })
if (res.code == 200) {
uni.$mocpJump.navigateBack()
uni.$mocpMessage.success(res.message)
uni.$emit('unplanWarningReload')
} else {
uni.$mocpMessage.error(res.message)
}
}
import { reactive, ref } from 'vue'
export const formRef = ref()
export const rules = reactive({
examineReason: [
{
required: true,
message: '请输入审核说明',
trigger: ['blur', 'change']
}
]
})
export const showAction = ref(false)
export const showConfirm = ref(false)
export const formData = reactive({
examineReason: ''
})
import { changeStatusApi } from 'mocp/api/unplanWarning'
import { formData, formRef } from './details.compositions'
export const handleSelect = async (value, id) => {
if (value !== '3') {
await formRef.value?.validate()
}
const params = {
id,
applyStatus: value,
examineReason: formData.examineReason
}
const res = await changeStatusApi(params, { loading: true })
if (res.code == 200) {
uni.$mocpJump.navigateBack()
uni.$emit('unplanWarningReload')
uni.$mocpMessage.success(res.message)
} else {
uni.$mocpMessage.error(res.message)
}
}
<template>
<global-page title="非计划预警详情" showFooterBtn :footerBtnText="isCreateUser ? '撤销' : '审核'" @handleFooterClick="handleFooterClick">
<view class="mocp-cell">
<up-cell-group v-if="details">
<up-cell title="审核状态">
<template #value>
<global-text-status :value="details.applyStatus" dictkey="unPlan_applyStatus"></global-text-status>
</template>
</up-cell>
<up-cell title="数据来源" :value="useGetDictByValue('np_sourceType', details.sourceType)"></up-cell>
<up-cell title="工作包号" :value="details.packageNo || '-'"></up-cell>
<up-cell title="工作包名称" :value="details.packageName || '-'"></up-cell>
<up-cell title="计划开始时间" :value="timeStampFormat(details.startTime) || '-'"></up-cell>
<up-cell title="计划结束时间" :value="timeStampFormat(details.endTime) || '-'"></up-cell>
<up-cell title="申请原因" :value="getParamNameByValue('WarningReason', details.warningReason) || '-'"></up-cell>
<up-cell title="缺件航材">
<template #label>
<template v-if="details.materialPns && details.materialDelay == '1'">
<view v-for="(item, index) in details.materialPns.split(',')" :key="index">{{ item }}</view>
</template>
<view v-else></view>
</template>
</up-cell>
<up-cell title="具体原因">
<template #label>{{ details.reason || '-' }}</template>
</up-cell>
<up-cell title="申请人" :value="details.createUserName || '-'"></up-cell>
<up-cell title="申请时间" :value="timeStampFormat(details.createTime) || '-'"></up-cell>
<template v-if="details.applyStatus != '0'">
<up-cell title="审核人" :value="details.approverName"></up-cell>
</template>
<view class="mocp-form" v-if="!isCreateUser">
<up-form labelPosition="left" labelWidth="auto" :model="formData" :rules="rules" ref="formRef">
<up-form-item label="审核说明" prop="examineReason" :borderBottom="true" required>
<up-input v-model="formData.examineReason" border="none" inputAlign="right" placeholder="请输入" clearable></up-input>
</up-form-item>
</up-form>
</view>
</up-cell-group>
</view>
<global-action-sheet
v-model="showAction"
title="审核"
description="审核本条非计划申请"
:options="[
{ label: '审核驳回', value: '2' },
{ label: '审核通过', value: '1' }
]"
@select="(value) => handleSelect(value, details.id)"
></global-action-sheet>
<up-modal
:width="250"
content="确认撤销审核吗?"
:show="showConfirm"
showCancelButton
closeOnClickOverlay
@confirm="handleSelect('3', details.id)"
@cancel="showConfirm = false"
@close="showConfirm = false"
></up-modal>
</global-page>
</template>
<script setup>
import { storeToRefs } from 'pinia'
import { useGetDictByValue } from 'mocp/hooks/use-dict/useDict'
import { getParamNameByValue } from 'mocp/hooks/use-params/useParams'
import useUnplanWarningStore from 'mocp/store/unplanWarning'
import { onLoad } from '@dcloudio/uni-app'
import { timeStampFormat } from 'mocp/utils/tool'
import { handleSelect } from './constants/details.functionals'
import { formData, rules, formRef, showAction, showConfirm } from './constants/details.compositions'
import { computed } from 'vue'
import useUserStore from 'mocp/store/user'
const query = defineProps(['id'])
const unplanWarningStore = useUnplanWarningStore()
const { details } = storeToRefs(unplanWarningStore)
const userStore = useUserStore()
const isCreateUser = computed(() => {
return userStore.userInfo.id == details.value?.createUser
})
onLoad(() => {
unplanWarningStore.setState('id', query.id)
unplanWarningStore.getDetails()
formData.examineReason = ''
})
const handleFooterClick = () => {
if (isCreateUser.value) {
showConfirm.value = true
} else {
showAction.value = true
}
}
</script>
<style lang="scss" scoped>
.mocp-cell {
background: #fff;
}
.mocp-form {
background: #fff;
padding: 0 32rpx;
}
</style>
<template>
<global-page
title="非计划预警"
isDataList
refresherEnabled
loadingMoreEnabled
auto
ref="paging"
:params="searchData"
showNavRight
navRightType="icon"
navRightIcon="saixuan-01"
@handleRightClick="handleRightClick"
:api="unplanWarningListApi"
:padding="24"
showFooterBtn
footerBtnText="新增申请"
@handleFooterClick="handleFooterClick"
>
<template #default="{ item }">
<view class="item" :class="{ 'wrong-class': item.applyStatus == '0' }" @tap="goDetails(item)">
<view class="item-title">
<view class="left">
<global-text-status :value="item.applyStatus" dictkey="unPlan_applyStatus"></global-text-status>
</view>
<view class="right">
<text class="txt u-line-1" v-if="item.acType">{{ item.acType }}</text>
<text class="txt u-line-1" v-if="item.packageName">{{ item.packageName }}</text>
</view>
</view>
<view class="item-content">
<view class="u-line-3">预警原因:{{ getParamNameByValue('WarningReason', item.warningReason) || '无' }}</view>
<view class="u-line-3">具体原因:{{ item.reason || '无' }}</view>
</view>
<view class="item-footer">
<view class="label">
<global-icon icon="calendar"></global-icon>
<text class="txt">
{{ timeStampFormat(item.createTime, { format: 'YYYY/MM/DD HH:mm' }) }}
</text>
</view>
<view class="label">
<global-icon icon="idcard"></global-icon>
<text class="txt u-line-1">申请人:{{ item.createUserName || '-' }}</text>
</view>
</view>
</view>
</template>
</global-page>
</template>
<script setup>
import { ref } from 'vue'
import { storeToRefs } from 'pinia'
import { onUnload } from '@dcloudio/uni-app'
import { unplanWarningListApi } from 'mocp/api/unplanWarning'
import useUnplanWarningStore from 'mocp/store/unplanWarning'
import { getParamNameByValue } from 'mocp/hooks/use-params/useParams'
import { timeStampFormat } from 'mocp/utils/tool'
//跳转
const unplanWarningStore = useUnplanWarningStore()
const { searchData } = storeToRefs(unplanWarningStore)
const goDetails = (data) => {
uni.$mocpJump.navigateTo('/panel/unplanWarning/details', { id: data.id })
}
//筛选
const handleRightClick = () => {
uni.$mocpJump.navigateTo('/panel/unplanWarning/search')
}
//刷新
const paging = ref()
uni.$on('unplanWarningReload', () => {
paging.value?.reload()
})
//新建
const handleFooterClick = () => {
uni.$mocpJump.navigateTo('/panel/unplanWarning/add')
}
onUnload(() => {
uni.$off('unplanWarningReload')
})
</script>
<style lang="scss" scoped>
@import 'mocpStatic/css/list.scss';
.wrong-class {
background: linear-gradient(138.51deg, #ffe1e1 6.14%, #ffffff 125.66%);
}
</style>
<template>
<global-page title="筛选">
<view class="search-form">
<up-form labelPosition="left" labelWidth="auto">
<up-form-item label="申请状态" prop="applyStatus" :borderBottom="true">
<global-picker v-model="formData.applyStatus" pickAlign="right" clearable dictkey="np_applyStatus"></global-picker>
</up-form-item>
<up-form-item label="包号" prop="packageNo" :borderBottom="true">
<up-input v-model="formData.packageNo" inputAlign="right" border="none" placeholder="请输入" clearable></up-input>
</up-form-item>
<up-form-item label="数据来源" prop="sourceType" :borderBottom="true">
<global-picker pickAlign="right" v-model="formData.sourceType" dictkey="np_sourceType" clearable></global-picker>
</up-form-item>
<up-form-item label="定检类型" prop="checkLevel" :borderBottom="true">
<global-picker pickAlign="right" v-model="formData.checkLevel" dictkey="np_checkLevel" clearable></global-picker>
</up-form-item>
<up-form-item label="机型" prop="acType" :borderBottom="true">
<global-picker v-model="formData.acType" pickAlign="right" :options="baseStore.getTypeSelect" clearable filter></global-picker>
</up-form-item>
<up-form-item label="航司" prop="airline" :borderBottom="true">
<global-picker
v-model="formData.airline"
pickAlign="right"
:options="baseStore.getAirlineSelect"
clearable
filter
></global-picker>
</up-form-item>
<up-form-item label="计划开工时间" :borderBottom="true">
<global-calendar
pickAlign="right"
v-model:startTime="formData.startTime"
v-model:endTime="formData.startTimeEnd"
clearable
></global-calendar>
</up-form-item>
<up-form-item label="申请时间" :borderBottom="true">
<global-calendar
pickAlign="right"
v-model:startTime="formData.applyTimeStart"
v-model:endTime="formData.applyTimeEnd"
clearable
></global-calendar>
</up-form-item>
</up-form>
</view>
<template #bottom>
<view class="footer-btn">
<up-row gutter="10">
<up-col span="6">
<global-button type="primary" plain size="large" :radius="5" @tap="handleReset">重置</global-button>
</up-col>
<up-col span="6"><global-button type="primary" size="large" :radius="5" @tap="handleConfirm">确定</global-button></up-col>
</up-row>
</view>
</template>
</global-page>
</template>
<script setup>
import useBaseStore from 'mocp/store/base'
import { storeToRefs } from 'pinia'
import { cloneDeep } from 'lodash'
import { ref } from 'vue'
import useUnplanWarningStore from 'mocp/store/unplanWarning'
//获取下拉框选项
const baseStore = useBaseStore()
const unplanWarningStore = useUnplanWarningStore()
//获取查询表单数据
const { searchData } = storeToRefs(unplanWarningStore)
const formData = ref(cloneDeep(searchData.value))
const handleReset = () => {
unplanWarningStore.resetForm()
uni.$mocpJump.navigateBack()
uni.$emit('unplanWarningReload')
}
const handleConfirm = () => {
unplanWarningStore.setState('searchData', formData.value)
uni.$mocpJump.navigateBack()
uni.$emit('unplanWarningReload')
}
</script>
<style lang="scss" scoped>
.search-form {
padding: 24rpx 24rpx 0 24rpx;
background: #fff;
}
.footer-btn {
padding: 24rpx 32rpx;
background-color: #fff;
}
</style>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment