feat: 盲板抽堵作业申请的回显修补

八项作业
mengfanliang 2024-08-30 12:28:31 +08:00
parent c57dda5157
commit 743a7408e8
1 changed files with 125 additions and 95 deletions

View File

@ -3,131 +3,126 @@
<view class="card">
<u-form labelPosition="left" :model="form" :rules="rules" ref="formRef" labelWidth="140px">
<u-form-item label="申请单位" prop="APPLY_DEPARTMENT_NAME" borderBottom required>
<u-input v-model="form.APPLY_DEPARTMENT_NAME" border="none" readonly/>
<u-input v-model="form.APPLY_DEPARTMENT_NAME" border="none" readonly />
</u-form-item>
<u-form-item label="申请人" prop="APPLY_USER_NAME" borderBottom required>
<u-input v-model="form.APPLY_USER_NAME" border="none" readonly/>
<u-input v-model="form.APPLY_USER_NAME" border="none" readonly />
</u-form-item>
<u-form-item label="作业分公司" prop="CORP_NAME" borderBottom required>
<u-input v-model="form.CORP_NAME" border="none" readonly/>
<u-input v-model="form.CORP_NAME" border="none" readonly />
</u-form-item>
<u-form-item label="作业类别" prop="WORK_TYPE_NAME" borderBottom required
@click="fnSingleChoiceClick('WORK_TYPE_NAME')">
<u-input v-model="form.WORK_TYPE_NAME" border="none" readonly/>
@click="fnSingleChoiceClick('WORK_TYPE_NAME')">
<u-input v-model="form.WORK_TYPE_NAME" border="none" readonly />
<u-icon name="arrow-right"></u-icon>
</u-form-item>
<u-form-item label="设备管道名称" prop="NAME" borderBottom required>
<u-input v-model="form.NAME" border="none"/>
<u-input v-model="form.NAME" border="none" />
</u-form-item>
<u-form-item label="实际作业开始时间" prop="BOARD_INSTALL_TIME" borderBottom required
@click="fnDateTimePickerClick('BOARD_INSTALL_TIME')">
<u-input v-model="form.BOARD_INSTALL_TIME" border="none" readonly/>
@click="fnDateTimePickerClick('BOARD_INSTALL_TIME')">
<u-input v-model="form.BOARD_INSTALL_TIME" border="none" readonly />
<u-icon name="arrow-right"></u-icon>
</u-form-item>
<u-form-item label="作业结束时间" prop="WORK_END_DATE" borderBottom required
@click="fnDateTimePickerClick('WORK_END_DATE')">
<u-input v-model="form.WORK_END_DATE" border="none" readonly/>
@click="fnDateTimePickerClick('WORK_END_DATE')">
<u-input v-model="form.WORK_END_DATE" border="none" readonly />
<u-icon name="arrow-right"></u-icon>
</u-form-item>
<u-form-item label="作业人" prop="WORK_USER" borderBottom required>
<u-input v-model="form.WORK_USER" border="none"/>
<u-input v-model="form.WORK_USER" border="none" />
</u-form-item>
<u-form-item label="地点坐标" borderBottom required>
<u-button type="primary" size="small" text="定位" :customStyle="{width:'100upx',margin:0}"
@click="fnLocation"/>
<u-button type="primary" size="small" text="定位" :customStyle="{ width: '100upx', margin: 0 }"
@click="fnLocation" />
</u-form-item>
<u-form-item label="经度" prop="WORK_LONGITUDE" borderBottom required>
<u-input v-model="form.WORK_LONGITUDE" border="none" readonly/>
<u-input v-model="form.WORK_LONGITUDE" border="none" readonly />
</u-form-item>
<u-form-item label="纬度" prop="WORK_LATITUDE" borderBottom required>
<u-input v-model="form.WORK_LATITUDE" border="none" readonly/>
<u-input v-model="form.WORK_LATITUDE" border="none" readonly />
</u-form-item>
<u-divider text="管道参数" textPosition="left" textColor="#3c9cff" lineColor="#3c9cff"/>
<u-divider text="管道参数" textPosition="left" textColor="#3c9cff" lineColor="#3c9cff" />
<u-form-item label="介质" prop="MEDIUM" borderBottom required>
<u-input v-model="form.MEDIUM" border="none"/>
<u-input v-model="form.MEDIUM" border="none" />
</u-form-item>
<u-form-item label="温度" prop="TEMPERATURE" borderBottom required>
<u-input v-model="form.TEMPERATURE" border="none"/>
<u-input v-model="form.TEMPERATURE" border="none" />
</u-form-item>
<u-form-item label="压力" prop="PRESSURE" borderBottom required>
<u-input v-model="form.PRESSURE" border="none"/>
<u-input v-model="form.PRESSURE" border="none" />
</u-form-item>
<u-divider text="盲板抽堵参数" textPosition="left" textColor="#3c9cff" lineColor="#3c9cff"/>
<u-divider text="盲板抽堵参数" textPosition="left" textColor="#3c9cff" lineColor="#3c9cff" />
<view v-for="(item, index) in form.boardList" :key="item.ID" class="mt-10 p-10"
style="background-color: #f9f9f9;border-radius: 4px">
style="background-color: #f9f9f9;border-radius: 4px">
<view style="display: flex;justify-content: end">
<u-button v-if="index === 0" type="primary" size="small" text="新增"
:customStyle="{width:'100upx',margin:0}" @click="fnAddBoardList"/>
:customStyle="{ width: '100upx', margin: 0 }" @click="fnAddBoardList" />
<u-button v-if="index !== 0" type="error" size="small" text="删除"
:customStyle="{width:'100upx',margin:0}" @click="fnDeleteBoardList(index)"/>
:customStyle="{ width: '100upx', margin: 0 }" @click="fnDeleteBoardList(index)" />
</view>
<u-form-item label="材质" prop="BOARD_MATERIAL" borderBottom required>
<u-input v-model="item.BOARD_MATERIAL" border="none"/>
<u-input v-model="item.BOARD_MATERIAL" border="none" />
</u-form-item>
<u-form-item label="规格" prop="BOARD_SPECIFICATION" borderBottom required>
<u-input v-model="item.BOARD_SPECIFICATION" border="none"/>
<u-input v-model="item.BOARD_SPECIFICATION" border="none" />
</u-form-item>
<u-form-item label="编号" prop="BOARD_NO" borderBottom required>
<u-input v-model="item.BOARD_NO" border="none"/>
<u-input v-model="item.BOARD_NO" border="none" />
</u-form-item>
</view>
<u-divider text="盲板抽堵位置及安全措施" textPosition="left" textColor="#3c9cff" lineColor="#3c9cff"/>
<u-divider text="盲板抽堵位置及安全措施" textPosition="left" textColor="#3c9cff" lineColor="#3c9cff" />
<u-form-item label="盲板抽堵位置图" prop="BOARD_PATH" borderBottom required labelPosition="top" labelWidth="auto">
<u-upload
class="mt-10"
:fileList="form.BOARD_PATH"
@afterRead="fnAfterRead($event,'BOARD_PATH')"
@delete="fnDeletePic($event,'BOARD_PATH')"
multiple
:maxCount="1"
></u-upload>
<u-upload class="mt-10" :fileList="form.BOARD_PATH" @afterRead="fnAfterRead($event, 'BOARD_PATH')"
@delete="fnDeletePic($event, 'BOARD_PATH')" multiple :maxCount="1"></u-upload>
</u-form-item>
<u-form-item label="关联的其他特殊作业及安全作业票编号" prop="SPECIAL_WORK" borderBottom required
labelPosition="top" labelWidth="auto">
<u-form-item label="关联的其他特殊作业及安全作业票编号" prop="SPECIAL_WORK" borderBottom required labelPosition="top"
labelWidth="auto">
<u-button type="primary" size="mini" text="选择其它"
:customStyle="{position: 'absolute',top: '-46upx',right: '20upx',width: '150upx'}"
@click="otherAssignmentsShow = true"/>
<u-textarea v-model="form.SPECIAL_WORK" border="none" autoHeight maxlength="-1"/>
:customStyle="{ position: 'absolute', top: '-46upx', right: '20upx', width: '150upx' }"
@click="otherAssignmentsShow = true" />
<u-textarea v-model="form.SPECIAL_WORK" border="none" autoHeight maxlength="-1" />
</u-form-item>
<u-form-item label="风险辨识结果" prop="RISK_IDENTIFICATION" borderBottom required labelPosition="top"
labelWidth="auto">
labelWidth="auto">
<u-button type="primary" size="mini" text="选择其它"
:customStyle="{position: 'absolute',top: '-46upx',right: '20upx',width: '150upx'}"
@click="otherIdentificationShow = true"/>
<u-textarea v-model="form.RISK_IDENTIFICATION" border="none" autoHeight maxlength="-1"/>
:customStyle="{ position: 'absolute', top: '-46upx', right: '20upx', width: '150upx' }"
@click="otherIdentificationShow = true" />
<u-textarea v-model="form.RISK_IDENTIFICATION" border="none" autoHeight maxlength="-1" />
</u-form-item>
<u-form-item label="申请单位负责人签字" prop="SIGN" borderBottom required labelPosition="top" labelWidth="auto">
<view style="flex: 1">
<view>
<u-button type="primary" size="mini" text="签字"
:customStyle="{position: 'absolute',top: '-46upx',right: '20upx',width: '100upx'}"
@click="signVisible = true"/>
:customStyle="{ position: 'absolute', top: '-46upx', right: '20upx', width: '100upx' }"
@click="signVisible = true" />
</view>
<view v-if="form.SIGN">
<u-image width="400rpx" height="200rpx" :src="form.SIGN"/>
<u-image width="400rpx" height="200rpx" :src="form.SIGN" />
</view>
</view>
</u-form-item>
</u-form>
<view class="mt-10">
<u-button type="primary" text="下一步" @click="$u.debounce(fnSubmit, 1000,true)"/>
<u-button type="primary" text="下一步" @click="$u.debounce(fnSubmit, 1000, true)" />
</view>
</view>
<u-picker :show="picker.show" :columns="picker.columns" :keyName="picker.key" :key="picker.type"
@confirm="fnSingleChoiceConfirm" @cancel="fnSingleChoiceCancel"/>
:defaultIndex="picker.defaultIndex" @confirm="fnSingleChoiceConfirm" @cancel="fnSingleChoiceCancel" />
<u-datetime-picker :show="dateTimePicker.show" v-model="dateTimePicker.value" :mode="dateTimePicker.mode"
:minDate="dateTimePicker.min" :key="dateTimePicker.type" @confirm="fnDateTimePickerConfirm"
@cancel="fnDateTimePickerCancel"/>
<other-select :visible.sync="otherAssignmentsShow" v-model="form.SPECIAL_WORK" type="assignments"/>
<other-select :visible.sync="otherIdentificationShow" v-model="form.RISK_IDENTIFICATION" type="identification"/>
<sign :signShow.sync="signVisible" @confirm="fnSign"/>
:minDate="dateTimePicker.min" :key="dateTimePicker.type" @confirm="fnDateTimePickerConfirm"
@cancel="fnDateTimePickerCancel" />
<other-select :visible.sync="otherAssignmentsShow" v-model="form.SPECIAL_WORK" type="assignments" />
<other-select :visible.sync="otherIdentificationShow" v-model="form.RISK_IDENTIFICATION" type="identification" />
<sign :signShow.sync="signVisible" @confirm="fnSign" />
</view>
</template>
<script>
import { getTaskInfo } from "@/api";
import OtherSelect from '@/components/other-select/index.vue';
import Sign from '@/components/sign/sign.vue'
import {setSubmitForm} from "@/utils/submitHomeworkProcess";
import { setSubmitForm } from "@/utils/submitHomeworkProcess";
export default {
components: {
@ -138,35 +133,35 @@ export default {
return {
type: '',
formItems: [
{name: '申请单位', key_name: 'APPLY_DEPARTMENT_NAME', key_id: 'APPLY_DEPARTMENT_ID', type: 0},
{name: '申请人', key_name: 'APPLY_USER_NAME', key_id: 'APPLY_USER_ID', type: 0},
{name: '作业分公司', key_name: 'CORP_NAME', key_id: 'CORP_ID', type: 0},
{name: '作业类别', key_name: 'WORK_TYPE_NAME', key_id: 'WORK_TYPE', type: 0},
{name: '设备管道名称', key_name: 'NAME', type: 0},
{name: '实际作业开始时间', key_name: 'BOARD_INSTALL_TIME', type: 0},
{name: '作业结束时间', key_name: 'WORK_END_DATE', type: 0},
{name: '作业人', key_name: 'WORK_USER', type: 0},
{name: '经度', key_name: 'WORK_LONGITUDE', type: 0},
{name: '纬度', key_name: 'WORK_LATITUDE', type: 0},
{name: '管道参数', type: 3},
{name: '介质', key_name: 'MEDIUM', type: 0},
{name: '温度', key_name: 'TEMPERATURE', type: 0},
{name: '压力', key_name: 'PRESSURE', type: 0},
{name: '盲板抽堵参数', type: 3},
{ name: '申请单位', key_name: 'APPLY_DEPARTMENT_NAME', key_id: 'APPLY_DEPARTMENT_ID', type: 0 },
{ name: '申请人', key_name: 'APPLY_USER_NAME', key_id: 'APPLY_USER_ID', type: 0 },
{ name: '作业分公司', key_name: 'CORP_NAME', key_id: 'CORP_ID', type: 0 },
{ name: '作业类别', key_name: 'WORK_TYPE_NAME', key_id: 'WORK_TYPE', type: 0 },
{ name: '设备管道名称', key_name: 'NAME', type: 0 },
{ name: '实际作业开始时间', key_name: 'BOARD_INSTALL_TIME', type: 0 },
{ name: '作业结束时间', key_name: 'WORK_END_DATE', type: 0 },
{ name: '作业人', key_name: 'WORK_USER', type: 0 },
{ name: '经度', key_name: 'WORK_LONGITUDE', type: 0 },
{ name: '纬度', key_name: 'WORK_LATITUDE', type: 0 },
{ name: '管道参数', type: 3 },
{ name: '介质', key_name: 'MEDIUM', type: 0 },
{ name: '温度', key_name: 'TEMPERATURE', type: 0 },
{ name: '压力', key_name: 'PRESSURE', type: 0 },
{ name: '盲板抽堵参数', type: 3 },
{
key_name: 'boardList',
type: 4,
listStructure: [
{name: '材质', key_name: 'BOARD_MATERIAL', type: 0},
{name: '规格', key_name: 'BOARD_SPECIFICATION', type: 0},
{name: '编号', key_name: 'BOARD_NO', type: 0},
{ name: '材质', key_name: 'BOARD_MATERIAL', type: 0 },
{ name: '规格', key_name: 'BOARD_SPECIFICATION', type: 0 },
{ name: '编号', key_name: 'BOARD_NO', type: 0 },
]
},
{name: '盲板抽堵位置及安全措施', type: 3},
{name: '盲板抽堵位置图', key_name: 'BOARD_PATH', type: 1},
{name: '关联的其他特殊作业及安全作业票编号', key_name: 'SPECIAL_WORK', type: 0},
{name: '风险辨识结果', key_name: 'RISK_IDENTIFICATION', type: 0},
{name: '申请单位负责人签字', key_name: 'SIGN', type: 5},
{ name: '盲板抽堵位置及安全措施', type: 3 },
{ name: '盲板抽堵位置图', key_name: 'BOARD_PATH', type: 1 },
{ name: '关联的其他特殊作业及安全作业票编号', key_name: 'SPECIAL_WORK', type: 0 },
{ name: '风险辨识结果', key_name: 'RISK_IDENTIFICATION', type: 0 },
{ name: '申请单位负责人签字', key_name: 'SIGN', type: 5 },
],
form: {
APPLY_DEPARTMENT_ID: this.$store.getters.getUserInfo.DEPARTMENT_ID,
@ -193,24 +188,24 @@ export default {
SIGN: '',
},
rules: {
APPLY_DEPARTMENT_ID: [{type: 'string', required: true, message: '请选择申请单位', trigger: ['blur', 'change']}],
APPLY_USER_NAME: [{type: 'string', required: true, message: '请选择申请人', trigger: ['blur', 'change']}],
CORP_NAME: [{type: 'string', required: true, message: '请选择作业分公司', trigger: ['blur', 'change']}],
WORK_TYPE_NAME: [{type: 'string', required: true, message: '请选择作业类别', trigger: ['blur', 'change']}],
NAME: [{type: 'string', required: true, message: '请输入设备管道名称', trigger: ['blur', 'change']}],
APPLY_DEPARTMENT_ID: [{ type: 'string', required: true, message: '请选择申请单位', trigger: ['blur', 'change'] }],
APPLY_USER_NAME: [{ type: 'string', required: true, message: '请选择申请人', trigger: ['blur', 'change'] }],
CORP_NAME: [{ type: 'string', required: true, message: '请选择作业分公司', trigger: ['blur', 'change'] }],
WORK_TYPE_NAME: [{ type: 'string', required: true, message: '请选择作业类别', trigger: ['blur', 'change'] }],
NAME: [{ type: 'string', required: true, message: '请输入设备管道名称', trigger: ['blur', 'change'] }],
BOARD_INSTALL_TIME: [{
type: 'string',
required: true,
message: '请选择实际作业开始时间',
trigger: ['blur', 'change']
}],
WORK_END_DATE: [{type: 'string', required: true, message: '请选择作业结束时间', trigger: ['blur', 'change']}],
WORK_USER: [{type: 'string', required: true, message: '请输入作业人', trigger: ['blur', 'change']}],
WORK_LONGITUDE: [{type: 'string', required: true, message: '请输入经度', trigger: ['blur', 'change']}],
WORK_LATITUDE: [{type: 'string', required: true, message: '请输入纬度', trigger: ['blur', 'change']}],
MEDIUM: [{type: 'string', required: true, message: '请输入介质', trigger: ['blur', 'change']}],
TEMPERATURE: [{type: 'string', required: true, message: '请输入温度', trigger: ['blur', 'change']}],
PRESSURE: [{type: 'string', required: true, message: '请输入压力', trigger: ['blur', 'change']}],
WORK_END_DATE: [{ type: 'string', required: true, message: '请选择作业结束时间', trigger: ['blur', 'change'] }],
WORK_USER: [{ type: 'string', required: true, message: '请输入作业人', trigger: ['blur', 'change'] }],
WORK_LONGITUDE: [{ type: 'string', required: true, message: '请输入经度', trigger: ['blur', 'change'] }],
WORK_LATITUDE: [{ type: 'string', required: true, message: '请输入纬度', trigger: ['blur', 'change'] }],
MEDIUM: [{ type: 'string', required: true, message: '请输入介质', trigger: ['blur', 'change'] }],
TEMPERATURE: [{ type: 'string', required: true, message: '请输入温度', trigger: ['blur', 'change'] }],
PRESSURE: [{ type: 'string', required: true, message: '请输入压力', trigger: ['blur', 'change'] }],
BOARD_PATH: [{
type: 'array',
required: true,
@ -240,7 +235,8 @@ export default {
show: false,
columns: [],
key: 'NAME',
type: 'picker'
type: 'picker',
defaultIndex: []
},
dateTimePicker: {
show: false,
@ -252,6 +248,8 @@ export default {
otherAssignmentsShow: false,
otherIdentificationShow: false,
signVisible: false,
/** 存储作业类别选中态 */
jobTypeNameArr: [],
}
},
onLoad(options) {
@ -259,11 +257,44 @@ export default {
this.form.CORP_NAME = options.CORP_NAME
this.type = options.type
this.fnAddBoardList()
if (options.taskId) {
this.fnGetData(options.taskId)
}
},
methods: {
async fnGetData(taskId) {
let resData = await getTaskInfo({ EW_RU_TASK_ID: taskId })
if (resData.list.form && resData.list.form.length > 0) {
let newFormData = { ...this.form };
resData.list.form.forEach((sos, index) => {
newFormData[sos.ITEM_NAME] = sos.ITEM_VALUE;
if (sos.FK_NAME) {
newFormData[sos.FK_NAME] = sos.FK_VALUE;
if (sos.FK_NAME === "WORK_TYPE") {
this.jobTypeNameArr = [Number(sos.FK_VALUE)];
}
}
//
if (sos.ITEM_NAME === "BOARD_PATH") {
newFormData.BOARD_PATH = [{ url: `${this.$filePath}${sos.ITEM_VALUE}` }]
}
//
if (sos.ITEM_NAME === "SIGN") {
newFormData.SIGN = `${this.$filePath}${sos.ITEM_VALUE}`
}
});
this.form = newFormData;
}
},
fnSingleChoiceClick(event) {
this.picker.type = event
if (event === 'WORK_TYPE_NAME') this.picker.columns = [[{NAME: "堵盲板", ID: '1'}, {NAME: "抽盲板", ID: '2'}]]
if (event === 'WORK_TYPE_NAME') {
this.picker.columns = [[{ NAME: "堵盲板", ID: '1' }, { NAME: "抽盲板", ID: '2' }]]
if (this.jobTypeNameArr.length > 0) {
this.picker.defaultIndex = this.jobTypeNameArr;
}
}
this.picker.show = true
},
fnSingleChoiceConfirm(event) {
@ -300,7 +331,7 @@ export default {
})
},
fnAddBoardList() {
this.form.boardList.push({BOARD_MATERIAL: '', BOARD_SPECIFICATION: '', BOARD_NO: '', ID: uni.$u.guid()})
this.form.boardList.push({ BOARD_MATERIAL: '', BOARD_SPECIFICATION: '', BOARD_NO: '', ID: uni.$u.guid() })
},
fnDeleteBoardList(index) {
uni.showModal({
@ -364,5 +395,4 @@ export default {
}
</script>
<style scoped lang="scss">
</style>
<style scoped lang="scss"></style>