jy-safe-app/pages/apply/subPages/SK/riskRectifyRecordEdit.vue

582 lines
20 KiB
Vue
Raw Permalink Normal View History

2025-10-14 15:17:30 +08:00
<template>
<view class="todo-page">
<step-title :stepPage="stepsPage" :stepText="stepsText"></step-title>
<view class="allview">
<view class="card">
<u--form labelWidth="auto" :model="dataModel" ref="wForm" class="demo-ruleForm">
<view style="position: relative;">
<view style="position: absolute;left: -10px;color: #3d4b70;top: -3px;">*</view>
</view>
<view style="font-size: 15px; font-weight: bold;color: #3d4b70;margin-bottom: 10px;">基本信息填写</view>
<u-form-item label="生产单元:" prop="Product_Unit" @click="handleChangeUnit()">
<u--input v-model="dataModel.Product_Unit" disabled disabledColor="#ffffff" placeholder="请选择生产单元" border="none" inputAlign="right" fontSize="14px">
</u--input>
<u-icon style="margin-left: 4px;" slot="right" name="arrow-down" size="12">
</u-icon>
</u-form-item>
<u-form-item label="检查区域:" @click="handleChangeArea">
<u--input v-model="dataModel.Nav_RiskArea.NAME" placeholder="请选择检查区域" suffixIcon="arrow-down" suffixIconStyle="font-size: 12px" disabled disabledColor="#ffffff" border="none" inputAlign="right"
fontSize="14px">
</u--input>
</u-form-item>
<u-form-item label="隐患地点:" prop="HIDDEN_PLACE">
<u--input v-model="dataModel.HIDDEN_PLACE" placeholder="请填写隐患地点" disabledColor="#ffffff" inputAlign="right" fontSize="14px" border="none">
</u--input>
</u-form-item>
<u-form-item label="隐患描述:" prop="HIDDEN_DESCRIPTION">
<u--input v-model="dataModel.HIDDEN_DESCRIPTION" placeholder="请填写隐患描述" disabledColor="#ffffff" inputAlign="right" fontSize="14px" border="none">
</u--input>
</u-form-item>
<u-form-item label="隐患等级" prop="HIDDEN_LEVEL" @click="handleChangeRiskLevel">
<u--input v-model="dataModel.HIDDEN_LEVEL" disabled placeholder="请选择隐患等级" suffixIcon="arrow-down" suffixIconStyle="font-size: 12px" disabledColor="#ffffff" inputAlign="right" fontSize="14px" border="none">
</u--input>
</u-form-item>
<u-form-item label="整改措施:">
<u--input v-model="dataModel.RECTIFICATION_MEASURES" placeholder="请填写整改措施" disabledColor="#ffffff" border="none" inputAlign="right" fontSize="14px">
</u--input>
</u-form-item>
<u-form-item label="整改期限" prop="HIDDEN_PLACE" @click="handleChangeRecitify()">
<u--input v-model="dataModel.RECITIFY_TIME" disabled placeholder="请选择整改期限" disabledColor="#ffffff" inputAlign="right" fontSize="14px" border="none">
</u--input>
<u-icon style="margin-left: 4px;" slot="right" name="arrow-down" size="12">
</u-icon>
</u-form-item>
<u-form-item label="验收人" prop="HIDDEN_PLACE" @click="handleChangeMonitor">
<u--input v-model="dataModel.Nav_AcceptUser.NAME" disabled placeholder="请选择整改责任人" suffixIcon="arrow-down" suffixIconStyle="font-size: 12px" disabledColor="#ffffff" inputAlign="right"
fontSize="14px" border="none">
</u--input>
</u-form-item>
<u-form-item label="整改情况描述:">
<u--input v-model="dataModel.RECTIFICATION_DESCRIPTION" placeholder="请填写整改情况描述" disabledColor="#ffffff" border="none" inputAlign="right" fontSize="14px">
</u--input>
</u-form-item>
<u-form-item label="整改资金(万元):">
<u--input v-model="dataModel.RECTIFICATION_MONEY" placeholder="请填写整改资金" disabledColor="#ffffff" border="none" inputAlign="right" fontSize="14px">
</u--input>
</u-form-item>
<u-form-item label="整改完成时间" prop="HIDDEN_PLACE" @click="handleChangeDate()">
<u--input v-model="dataModel.COMPLETE_DATE" disabled placeholder="请选择整改完成时间" disabledColor="#ffffff" inputAlign="right" fontSize="14px" border="none">
</u--input>
<u-icon style="margin-left: 4px;" slot="right" name="arrow-down" size="12">
</u-icon>
</u-form-item>
<view class="upload-title">整改前照片</view>
<full-upload v-model="dataModel.Nav_RectifyPhotoas" :isShowBtn='true' :listProp='listPropUpload' :listPropVal='listPropValUpload' v-if="dataModel.Nav_RectifyPhotoas"></full-upload>
<view class="upload-title">整改后照片</view>
<full-upload v-model="dataModel.Nav_RectifyPhotobs" :isShowBtn='true' :listProp='listPropUpload' :listPropVal='listPropValUpload' v-if="dataModel.Nav_RectifyPhotobs"></full-upload>
<view class="upload-title">预案或方案</view>
<full-upload v-model="dataModel.Nav_RectifyFiles" :isShowBtn='true' :listProp='listPropUpload' :listPropVal='listPropValUpload' v-if="dataModel.Nav_RectifyFiles"></full-upload>
<u-form-item v-if="dataModel.STATUS !== 0" label="验收时间" prop="HIDDEN_PLACE" @click="handleChangeDateTwo()">
<u--input v-model="dataModel.ACCEPT_DATE" disabled placeholder="请选择整改期限" disabledColor="#ffffff" inputAlign="right" fontSize="14px" border="none">
</u--input>
<u-icon style="margin-left: 4px;" slot="right" name="arrow-down" size="12">
</u-icon>
</u-form-item>
<u-form-item v-if="dataModel.STATUS !== 0" label="验收结论" prop="HIDDEN_LEVEL" @click="handleChangeAccept">
<u--input v-model="dataModel.ACCEPT_RESULTE" disabled placeholder="请选择验收结论" suffixIcon="arrow-down" suffixIconStyle="font-size: 12px" disabledColor="#ffffff" inputAlign="right" fontSize="14px"
border="none">
</u--input>
</u-form-item>
<u-form-item v-if="dataModel.STATUS !== 0" label="验收意见:">
<u--input v-model="dataModel.ACCEPT_OPINION" placeholder="请填写验收意见" disabledColor="#ffffff" border="none" inputAlign="right" fontSize="14px">
</u--input>
</u-form-item>
</u--form>
</view>
<view style="padding: 10px 16px;" class="bottom-button">
<u-button type="primary" @click="submit" color="#3d4b70">提交</u-button>
</view>
<u-picker :show="showPopupUnit" :columns="UnitLists" @confirm="confirmUnit" @cancel="cancelUnit" :defaultIndex="UnitDefaultIndex"></u-picker>
<u-picker :show="showPopupRiskLevel" :columns="RiskLevel" @confirm="confirmRiskLevel" @cancel="cancelRiskLevel" :defaultIndex="RiskLevelDefaultIndex"></u-picker>
<u-picker :show="showPopupAccept" :columns="Accept" @confirm="confirmAccept" @cancel="cancelAccept" :defaultIndex="AcceptDefaultIndex"></u-picker>
<u-picker :show="showPopupType" :columns="TypeLists" @confirm="confirmType" @cancel="cancelType" :defaultIndex="TypeDefaultIndex"></u-picker>
<u-picker :show="showPopupPeriod" :columns="PeriodLists" @confirm="confirmPeriod" @cancel="cancelPeriod" :defaultIndex="PeriodDefaultIndex"></u-picker>
<u-picker :show="showPopupLevel" :columns="LevelLists" @confirm="confirmLevel" @cancel="cancelLevel" :defaultIndex="LevelDefaultIndex"></u-picker>
<u-modal :show="showDelModalIndex >= 0" @confirm="confirmDel" @cancel="cacelDel" :showCancelButton="true" title="确认删除?"></u-modal>
<u-datetime-picker :show="showPopupRecitifyDate" v-model="dateRecitifyTime" mode="date" @confirm="confirmRecitifyDate" @cancel="cancelRecitifyDate"></u-datetime-picker>
<u-datetime-picker :show="showPopupDate" v-model="dateTime" mode="date" @confirm="confirmDate" @cancel="cancelDate"></u-datetime-picker>
<u-datetime-picker :show="showPopupDateTwo" v-model="dateTimeTwo" mode="date" @confirm="confirmDateTwo" @cancel="cancelDateTwo"></u-datetime-picker>
<people-selector :defaultChecked="peopleSelectOption.defaultChecked" :show="peopleSelectOption.showSelector" @select="handleSelectorPeople" @close="peopleSelectOption.showSelector = false">
</people-selector>
<query-selector :show="showPopupMonitor" :total="curTotalMonitor" :lists="monitorLists" :defaultValue="currentOperateMonitor.NAME" @close="handleClosePopupMonitor" @search="handleSearchMonitor"
@select="handleSelectedMonitor" />
<query-selector :show="showPopupArea" :total="curTotalArea" :lists="areaLists" :defaultValue="currentOperateArea.NAME" @close="handleClosePopupArea" @search="handleSearchArea" @select="handleSelectedArea" />
</view>
</view>
</template>
<script>
import {
extendFilterGroup,
extendGroupRule,
extendInclude,
extendOrder,
extendRule,
extendIgnoreDataRule,
guid,
initFilter,
initFilterGroup
} from '../../../../utils/common'
import {
FMProductionUnit,
CheckPeriods,
CheckLevels,
SKAcceptResultEnum,
MineTypeIndex,
MineTypeName
} from '../../../../utils/enums.js'
import {
GetCheckContentsInfo,
GetRiskVerifyRecodrReport,
RectifyFullUpdateEdit,
GetRiskAreaInfo,
getUserLists
} from '../../../../services/apply/subPages/SK/SKServices.js'
import {
getRequest,
} from '../../../../services/apply/FOServices/FOServices';
import stepTitle from '@/components/custom/step-title.vue'
import swipeActionItem from '../../../../uni_modules/uview-ui/libs/config/props/swipeActionItem';
export default {
components: {
stepTitle,
},
data() {
return {
showDelModalIndex: undefined,
showDelModalIndex1: undefined,
subsectionList: ['入库', '不入库', ],
radiolist1: [{
name: '是',
disabled: false
}, {
name: '否',
disabled: false
}],
curNow: 1,
RiskLevel: ['一般', '重大'],
Accept: [],
showPopupUnit: false,
UnitDefaultIndex: [0],
showPopupRiskLevel: false,
RiskLevelDefaultIndex: [0],
showPopupAccept: false,
AcceptDefaultIndex: [0],
UnitLists: [],
TypeLists: [],
showPopupType: false,
TypeDefaultIndex: [0],
PeriodLists: [],
showPopupPeriod: false,
PeriodDefaultIndex: [0],
LevelLists: [],
showPopupStep: false,
showPopupArea: false,
showPopupLevel: false,
curTotalStep: 0,
curTotalArea: 0,
stepLists: [],
areaLists: [],
LevelDefaultIndex: [0],
showPopupDate: false,
showPopupDateTwo: false,
showPopupRecitifyDate: false,
listPropUpload: ['NOTIFY_ID'],
listPropValUpload: [],
ORG_ID: uni.getStorageSync('orgId'),
dataModel: {
Product_Unit: '',
Nav_RiskArea: {
NAME: ''
},
RISK_AREA_ID: '',
HIDDEN_PLACE: '',
HIDDEN_DESCRIPTION: '',
HIDDEN_LEVEL: '',
RECTIFICATION_MEASURES: '',
RECITIFY_TIME: '',
Nav_AcceptUser: {
NAME: ''
},
ACCEPT_USER_ID: '',
RECTIFICATION_DESCRIPTION: '',
RECTIFICATION_MONEY: '',
COMPLETE_DATE: '',
Nav_RectifyPhotoas: [],
Nav_RectifyPhotobs: [],
Nav_RectifyFiles: [],
ACCEPT_DATE: '',
ACCEPT_RESULTE: '',
ACCEPT_OPINION: '',
},
model: {
ORG_ID: '',
MineType: '',
Nav_RiskArea: {
NAME: ''
},
RISK_AREA_ID: '',
HIDDEN_PLACE: '',
HIDDEN_DESCRIPTION: '',
HIDDEN_LEVEL: '',
RECTIFICATION_MEASURES: '',
RECITIFY_TIME: '',
Nav_AcceptUser: {
NAME: ''
},
ACCEPT_USER_ID: '',
RECTIFICATION_DESCRIPTION: '',
RECTIFICATION_MONEY: '',
COMPLETE_DATE: '',
Nav_RectifyPhotoas: [],
Nav_RectifyPhotobs: [],
Nav_RectifyFiles: [],
ACCEPT_DATE: '',
ACCEPT_RESULTE: '',
ACCEPT_OPINION: '',
},
peopleSelectOption: {
showSelector: false,
value: null,
index: 0,
defaultChecked: []
},
dateTime: uni.$u.timeFormat(new Date(), 'yyyy-mm-dd'),
dateTimeTwo: uni.$u.timeFormat(new Date(), 'yyyy-mm-dd'),
dateRecitifyTime: uni.$u.timeFormat(new Date(), 'yyyy-mm-dd'),
stepsText: ['发起', '确认', '审批', '归档'],
stepsPage: 0,
stepsPageList: 0,
Pu: '',
Check_Type_ID: '',
TypeListres: {},
TaskID: '',
poparr: '',
currentOperateStep: {},
currentOperateArea: {},
chooseCheckContent: '',
chooseCheckArea: '',
showPopupMonitor: false,
currentOperateMonitor: {},
monitorLists: [],
curTotalMonitor: 0,
chooseCheckMonitor: '',
chooseRecitify: '',
}
},
onLoad(option) {
this.TaskID = option.taskID ? option.taskID : '';
this.ID = option.ID ? option.ID : '';
this.loadData()
},
methods: {
loadData() {
// const json = {}
const orgId = uni.getStorageSync('orgId')
const json = initFilter(orgId, "", "")
extendRule(json, 'ID', 1, this.ID);
extendInclude(json, 'Nav_RiskArea');
extendInclude(json, 'Nav_AcceptUser');
extendInclude(json, 'Nav_RectifyPhotoas');
extendInclude(json, 'Nav_RectifyPhotobs');
extendInclude(json, 'Nav_RectifyFiles');
extendInclude(json, 'Nav_RectifyFiles.Nav_ImgFile');
extendInclude(json, 'Nav_RectifyPhotobs.Nav_ImgFile');
extendInclude(json, 'Nav_RectifyPhotoas.Nav_ImgFile');
extendIgnoreDataRule(json)
// extendRule(json, 'TASK_ID', 1, this.TaskID);
GetRiskVerifyRecodrReport(json).then(res => {
this.dataModel = res;
this.model = res
this.dataModel.RECITIFY_TIME = uni.$u.timeFormat(res.RECITIFY_TIME,
'yyyy-mm-dd')
this.dataModel.COMPLETE_DATE = uni.$u.timeFormat(res.COMPLETE_DATE,
'yyyy-mm-dd')
this.dataModel.ACCEPT_DATE = uni.$u.timeFormat(res.ACCEPT_DATE,
'yyyy-mm-dd')
this.dataModel.Nav_RectifyPhotoas = res.Nav_RectifyPhotoas ? res.Nav_RectifyPhotoas : [],
this.dataModel.Nav_RectifyPhotobs = res.Nav_RectifyPhotobs ? res.Nav_RectifyPhotobs : [],
this.dataModel.Nav_RectifyFiles = res.Nav_RectifyFiles ? res.Nav_RectifyFiles : [],
this.dataModel.Nav_AcceptUser = res.Nav_AcceptUser?res.Nav_AcceptUser:{},
this.stepsPage = res.STATUS == 0 ? 0 : res.STATUS == 10 ? 1 : res.STATUS == 20 ? 2 : 3
this.dataModel.HIDDEN_LEVEL = res.HIDDEN_LEVEL == 0 ? '一般' : '重大'
this.dataModel.ACCEPT_RESULTE = res.ACCEPT_RESULTE == 0 ? '合格' : '不合格'
this.dataModel.Product_Unit = MineTypeName[res.MineType]
})
},
cancelRecitifyDate() {
this.showPopupRecitifyDate = false
},
handleChangeRecitify() {
this.showPopupRecitifyDate = true
},
confirmRecitifyDate(e) {
this.dataModel.RECITIFY_TIME = uni.$u.timeFormat(e.value,
'yyyy-mm-dd ')
this.dateRecitifyTime = uni.$u.timeFormat(e.value,
'yyyy-mm-dd ')
this.showPopupRecitifyDate = false
},
cancelDate() {
this.showPopupDate = false
},
handleChangeDate() {
this.showPopupDate = true
},
confirmDate(e) {
this.dataModel.COMPLETE_DATE = uni.$u.timeFormat(e.value,
'yyyy-mm-dd')
this.dateTime = uni.$u.timeFormat(e.value,
'yyyy-mm-dd')
this.showPopupDate = false
},
cancelDateTwo() {
this.showPopupDateTwo = false
},
handleChangeDateTwo() {
this.showPopupDateTwo = true
},
confirmDateTwo(e) {
this.dataModel.ACCEPT_DATE = uni.$u.timeFormat(e.value,
'yyyy-mm-dd')
this.dateTimeTwo = uni.$u.timeFormat(e.value,
'yyyy-mm-dd')
this.showPopupDateTwo = false
},
handleClosePopupMonitor() {
this.showPopupMonitor = false
// this.showPopupCertificate = false
},
handleChangeMonitor(user) {
this.currentOperateMonitor = {}
this.chooseCheckMonitor = user
this.showPopupMonitor = true
this.handleSearchMonitor('init')
},
handleSearchMonitor(val, pageIndex) {
const orgId = uni.getStorageSync('orgId')
const json = initFilter(orgId, "", "NAME", '', pageIndex)
if (val !== 'init') {
const tempGroup = initFilterGroup(false);
extendGroupRule(tempGroup, 'NAME', 9, val)
extendFilterGroup(json, tempGroup);
}
json.Limit = 20
if (pageIndex) {
json.Start = (pageIndex - 1) * 20;
}
getUserLists(json).then(res => {
if (res.IsSuccessful) {
this.monitorLists = res.Data.map(i => {
return {
...i,
name: i.NAME,
code: i.CODE
}
})
this.curTotalMonitor = res.TotalCount
}
})
},
handleSelectedMonitor(val) {
this.dataModel.Nav_AcceptUser = val
this.dataModel.ACCEPT_USER_ID = val.ID
this.showPopupMonitor = false
},
cancelUnit() {
this.showPopupUnit = false
},
handleChangeUnit() {
this.UnitLists = [FMProductionUnit]
this.showPopupUnit = true
},
confirmUnit(e) {
this.dataModel.Product_Unit = e.value[0]
this.showPopupUnit = false
},
handleClosePopupArea() {
this.showPopupArea = false
// this.showPopupCertificate = false
},
handleChangeArea() {
this.currentOperateArea = {}
this.showPopupArea = true
this.handleSearchArea()
},
handleSearchArea(val, pageIndex) {
const orgId = uni.getStorageSync('orgId')
const json = initFilter(orgId, "", "",0, pageIndex ?? 1)
if (val) {
extendRule(json, 'NAME', 9, val);
}
json.Limit = 20
if (pageIndex) {
json.Start = (pageIndex - 1) * json.Limit;
}
GetRiskAreaInfo(json).then(res => {
// if (res.IsSuccessful) {
this.areaLists = (res.Data || res).map(i => {
return {
...i,
id: i.ID,
name: i.NAME,
}
})
this.curTotalArea = res.TotalCount
// }
})
},
handleSelectedArea(val) {
this.dataModel.RISK_AREA_ID = val.ID
this.dataModel.Nav_RiskArea = val
this.showPopupArea = false
},
cancelRiskLevel() {
this.showPopupRiskLevel = false
},
handleChangeRiskLevel() {
this.RiskLevel = [
['一般', '重大']
]
this.showPopupRiskLevel = true
},
confirmRiskLevel(e) {
this.dataModel.HIDDEN_LEVEL = e.value[0]
this.showPopupRiskLevel = false
},
cancelAccept() {
this.showPopupAccept = false
},
handleChangeAccept() {
this.Accept = [
SKAcceptResultEnum
]
this.showPopupAccept = true
},
confirmAccept(e) {
this.dataModel.ACCEPT_RESULTE = e.value[0]
this.showPopupAccept = false
},
submit() {
if (!this.dataModel.Product_Unit) {
uni.showToast({
title: '请选择生产单元',
icon: 'none'
})
return
}
if (!this.dataModel.Nav_RiskArea.NAME) {
uni.showToast({
title: '请选择检查区域',
icon: 'none'
})
return
}
if (!this.dataModel.HIDDEN_DESCRIPTION) {
uni.showToast({
title: '请填写隐患描述',
icon: 'none'
})
return
}
if (!this.dataModel.HIDDEN_PLACE) {
uni.showToast({
title: '请填写隐患地点',
icon: 'none'
})
return
}
if (!this.dataModel.HIDDEN_LEVEL) {
uni.showToast({
title: '请选择隐患等级',
icon: 'none'
})
return
}
if (!this.dataModel.Nav_AcceptUser.NAME) {
uni.showToast({
title: '请选择验收人',
icon: 'none'
})
return
}
// this.model = this.dataModel
this.model = {
STATUS:this.dataModel.STATUS,
ORG_ID: this.ORG_ID,
MineType: MineTypeIndex[this.dataModel.Product_Unit],
RISK_AREA_ID: this.dataModel.RISK_AREA_ID,
HIDDEN_PLACE: this.dataModel.HIDDEN_PLACE,
HIDDEN_DESCRIPTION: this.dataModel.HIDDEN_DESCRIPTION,
HIDDEN_LEVEL: this.dataModel.HIDDEN_LEVEL == '一般' ? 0 : 10,
RECTIFICATION_MEASURES: this.dataModel.RECTIFICATION_MEASURES,
RECITIFY_TIME: this.dataModel.RECITIFY_TIME,
ACCEPT_USER_ID: this.dataModel.ACCEPT_USER_ID,
RECTIFICATION_DESCRIPTION: this.dataModel.RECTIFICATION_DESCRIPTION,
RECTIFICATION_MONEY: this.dataModel.RECTIFICATION_MONEY,
COMPLETE_DATE: this.dataModel.COMPLETE_DATE,
Nav_RectifyPhotoas: this.dataModel.Nav_RectifyPhotoas.map((obj) => {
return Object.assign({}, obj, {
IMG_FILE_ID: obj.IMG_FILE_ID,
})
return obj
}),
Nav_RectifyPhotobs: this.dataModel.Nav_RectifyPhotobs.map((obj) => {
return Object.assign({}, obj, {
IMG_FILE_ID: obj.IMG_FILE_ID,
})
return obj
}),
Nav_RectifyFiles: this.dataModel.Nav_RectifyFiles.map((obj) => {
return Object.assign({}, obj, {
IMG_FILE_ID: obj.IMG_FILE_ID,
})
return obj
}),
ACCEPT_DATE: this.dataModel.ACCEPT_DATE,
ACCEPT_RESULTE: this.dataModel.ACCEPT_RESULTE =='合格'?0:10,
ACCEPT_OPINION: this.dataModel.ACCEPT_OPINION,
},
this.model.ID = this.ID
this.model.TaskID = this.TaskID
this.model.PUBLISH = "SaveAndNotify";
RectifyFullUpdateEdit(this.model).then(res => {
if (res) {
uni.$showMsgFunc('操作成功!', () => {
uni.navigateBack()
}, 'success', 1000)
}
})
}
}
}
</script>
<style scoped>
@import url("../../../../style/css/newTemplate.css");
</style>