1. 动火作业申请,添加是否安全总监审批字段
2. 动火作业申请,添加是否需要气体检测字段
八项作业
mengfanliang 2024-08-30 11:29:53 +08:00
parent bfe823ed2d
commit c57dda5157
2 changed files with 146 additions and 87 deletions

View File

@ -57,8 +57,8 @@
<u-form-item label="纬度" prop="WORK_LATITUDE" borderBottom required>
<u-input v-model="form.WORK_LATITUDE" border="none" readonly />
</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" />
@ -77,7 +77,7 @@
</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" />
@ -110,7 +110,7 @@ export default {
{ name: '司索人', key_name: 'SISUO_USER', type: 0 },
{ name: '指挥人员', key_name: 'PROJECT_MANAGER', type: 0 },
{ name: '吊物质量(吨)', key_name: 'PART_WEIGHT', type: 0 },
{name: '作业级别', key_name: 'WORK_LEVEL_NAME', key_id: 'WORK_LEVEL', type: 0},
{ name: '作业级别', key_name: 'WORK_LEVEL_NAME', key_id: 'WORK_LEVEL_ID', type: 0 },
{ name: '吊物内容', key_name: 'WORK_CONTENT', type: 0 },
{ name: '作业开始时间', key_name: 'WORK_START_DATE', type: 0 },
{ name: '作业结束时间', key_name: 'WORK_END_DATE', type: 0 },
@ -132,8 +132,8 @@ export default {
SISUO_USER: '',
PROJECT_MANAGER: '',
PART_WEIGHT: '',
WORK_LEVEL_ID: '',
WORK_LEVEL_NAME: '',
WORK_LEVEL: '',
WORK_CONTENT: '',
WORK_START_DATE: '',
WORK_END_DATE: '',
@ -175,7 +175,8 @@ export default {
show: false,
columns: [],
key: 'NAME',
type: 'picker'
type: 'picker',
defaultIndex: [] // ,,, picker ,, fnGetData ,
},
dateTimePicker: {
show: false,
@ -186,6 +187,8 @@ export default {
},
otherAssignmentsShow: false,
otherIdentificationShow: false,
/** 存储作业级别选中态 */
workLevelNameArr: [],
}
},
onLoad(options) {
@ -202,23 +205,37 @@ export default {
if (resData.list.form && resData.list.form.length > 0) {
resData.list.form.forEach((sos, index) => {
this.form[sos.ITEM_NAME] = sos.ITEM_VALUE;
if (sos.FK_NAME) {
this.form[sos.FK_NAME] = sos.FK_VALUE;
// FK_NAME [], [] , u-picker defaultIndex,
// , ,
// u-picker defaultIndex 使:
// https://uviewui.com/components/picker.html#%E9%BB%98%E8%AE%A4%E5%80%BC
if (sos.FK_NAME === 'WORK_LEVEL_ID') {
this.workLevelNameArr = [Number(sos.FK_VALUE)];
}
}
})
}
},
fnSingleChoiceClick(event) {
this.picker.type = event
if (event === 'WORK_LEVEL_NAME') this.picker.columns = [[
{NAME: 'I级高处作业', ID: '1'},
{NAME: 'II级高处作业', ID: '2'},
{NAME: 'III级高处作业', ID: '3'},
{NAME: 'IV级高处作业', ID: '4'},
]]
if (event === 'WORK_LEVEL_NAME') {
this.picker.columns = [[
{ NAME: 'I级高处作业', ID: '0' },
{ NAME: 'II级高处作业', ID: '1' },
{ NAME: 'III级高处作业', ID: '2' },
{ NAME: 'IV级高处作业', ID: '3' },
]];
if (this.workLevelNameArr.length > 0) this.picker.defaultIndex = this.workLevelNameArr;
}
this.picker.show = true
},
fnSingleChoiceConfirm(event) {
if (this.picker.type === 'WORK_LEVEL_NAME') {
this.form.WORK_LEVEL = event.value[0].ID
this.form.WORK_LEVEL_ID = event.value[0].ID
this.form.WORK_LEVEL_NAME = event.value[0].NAME
this.picker.defaultIndex = event.indexs; // picker , this.picker.defaultIndex
}
this.fnSingleChoiceCancel()
},
@ -268,5 +285,4 @@ export default {
}
</script>
<style scoped lang="scss">
</style>
<style scoped lang="scss"></style>

View File

@ -57,13 +57,25 @@
<u-form-item label="动火监火人" prop="SUPERVISOR_OF_HOT_WORK_UNIT" borderBottom required>
<u-input v-model="form.SUPERVISOR_OF_HOT_WORK_UNIT" border="none" placeholder="请输入动火监火人" />
</u-form-item>
<u-form-item label="是否安全总监审批" prop="IS_SAFETY_DIRECTOR" borderBottom required>
<u-radio-group v-model="form.IS_SAFETY_DIRECTOR" :customStyle="{ 'justify-content': 'flex-end' }">
<u-radio label="是" name="1" />
<u-radio :customStyle="{ marginLeft: '8px' }" label="否" name="0" />
</u-radio-group>
</u-form-item>
<u-form-item label="是否需要气体检测" props="IS_GAS_TESTING" borderBottom required>
<u-radio-group v-model="form.IS_GAS_TESTING" :customStyle="{ 'justify-content': 'flex-end' }">
<u-radio label="是" name="1" />
<u-radio :customStyle="{ marginLeft: '8px' }" label="否" name="0" />
</u-radio-group>
</u-form-item>
</u-form>
<view class="mt-10">
<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" />
@ -89,7 +101,7 @@ export default {
{ name: '作业编号', key_name: 'JOB_NUMBER', key_id: 'JOB_NUMBER_ID', type: 0 },
{ name: '申请日期', key_name: 'APPLICATION_DATE', type: 0 },
{ name: '作业类型', key_name: 'JOB_TYPE_NAME', key_id: 'JOB_TYPE_ID', type: 0 },
{ name: '动火部位', key_name: 'WORK_PLACE', type: 0 },
{ name: '动火部位', key_name: 'HOT_WORK_POSITION', type: 0 },
{ name: '动火方法', key_name: 'HOT_WORK_METHOD_ID', type: 0 },
{ name: '动火等级', key_name: 'HOT_WORK_LEVEL_INDEX', key_id: 'HOT_WORK_LEVEL_ID', type: 0 },
{ name: '动火开始时间', key_name: 'HOT_WORK_TIME_START', type: 0 },
@ -97,6 +109,8 @@ export default {
{ name: '作业内容', key_name: 'JOB_CONTENT', type: 0 },
{ name: '动火操作人', key_name: 'USER_NAME', type: 0 },
{ name: '动火操作人', key_name: 'SUPERVISOR_OF_HOT_WORK_UNIT', type: 0 },
{ name: '是否安全总监审批', key_name: 'IS_SAFETY_DIRECTOR', type: 0 },
{ name: '是否需要气体检测', key_name: 'IS_GAS_TESTING', type: 0 },
],
form: {
//
@ -127,26 +141,34 @@ export default {
USER_NAME: '',
/** 动火监火人 */
SUPERVISOR_OF_HOT_WORK_UNIT: '',
/** 是否安全总监审批 */
IS_SAFETY_DIRECTOR: '',
/** 是否需要气体检测 */
IS_GAS_TESTING: '',
},
rules: {
APPLY_DEPARTMENT_NAME: [{ type: 'string', required: true, message: '请选择申请单位', trigger: ['blur', 'change'] }],
APPLY_USER_NAME: [{ type: 'string', required: true, message: '请选择申请办理人', trigger: ['blur', 'change'] }],
JOB_NUMBER: [{ type: 'string', required: false, message: '请输入作业编号', trigger: ['blur', 'change'] }],
APPLICATION_DATE: [{ type: 'string', required: true, message: '请选择申请日期', trigger: ['blur', 'change'] }],
JOB_TYPE_NAME: [{ type: 'string', required: true, message: '请选择动火类型', trigger: ['blur', 'change'] }],
JOB_TYPE_NAME: [{ type: 'string', required: true, message: '请选择作业类型', trigger: ['blur', 'change'] }],
HOT_WORK_POSITION: [{ type: 'string', required: true, message: '请输入动火部位', trigger: ['blur', 'change'] }],
HOT_WORK_METHOD_ID: [{ type: 'string', required: false, message: '请选择动火方法', trigger: ['blur', 'change'] }],
HOT_WORK_LEVEL_INDEX: [{ type: 'string', required: true, message: '请选择动火等级', trigger: ['blue', 'change'] }],
HOT_WORK_TIME_START: [{ type: 'string', required: true, message: '请选择动火开始时间', trigger: ['blur', 'change'] }],
HOT_WORK_TIME_END: [{ type: 'string', required: true, message: '请选择动火结束时间', trigger: ['blur', 'change'] }],
JOB_CONTENT: [{ type: 'string', required: true, message: '请输入作业内容', trigger: ['blur', 'change'] }],
USER_NAME: [{ type: 'string', required: true, message: '请选择动火操作人', trigger: ['blur', 'change'] }],
SUPERVISOR_OF_HOT_WORK_UNIT: [{ type: 'string', required: true, message: '请输入动火监火人', trigger: ['blur', 'change'] }],
IS_SAFETY_DIRECTOR: [{ type: 'string', required: true, message: '请选择是否安全总监审批', trigger: ['blur', 'change'] }],
IS_GAS_TESTING: [{ type: 'string', required: true, message: '请选择是否需要气体检测', trigger: ['blur', 'change'] }],
},
picker: {
show: false,
columns: [],
key: 'NAME',
type: 'picker'
type: 'picker',
defaultIndex: []
},
dateTimePicker: {
show: false,
@ -159,6 +181,10 @@ export default {
otherWorkMethodShow: false,
/** 其他动火操作人选择器是否展示 */
otherUserNameSelectShow: false,
/** 存储作业类型选中态 */
jobTypeNameArr: [],
/** 存储动火等级选中态 */
hotWorkLevelNameArr: []
}
},
onLoad(options) {
@ -175,6 +201,15 @@ export default {
if (resData.list.form && resData.list.form.length > 0) {
resData.list.form.forEach((sos, index) => {
this.form[sos.ITEM_NAME] = sos.ITEM_VALUE;
if (sos.FK_NAME) {
this.form[sos.FK_NAME] = sos.FK_VALUE;
if (sos.FK_NAME === "JOB_TYPE_ID") {
this.jobTypeNameArr = [Number(sos.FK_VALUE)];
}
if (sos.FK_NAME === "HOT_WORK_LEVEL_ID") {
this.hotWorkLevelNameArr = [Number(sos.FK_VALUE)];
}
}
})
}
},
@ -185,18 +220,26 @@ export default {
},
fnSingleChoiceClick(event) {
this.picker.type = event;
if (event === 'JOB_TYPE_NAME') this.picker.columns = [[{ ID: '0', NAME: '内部作业' }, { ID: '1', NAME: '相关方作业' }]];
if (event === 'HOT_WORK_LEVEL_INDEX') this.picker.columns = [[{ ID: '0', NAME: '特级' }, { ID: '1', NAME: '一级' }, { ID: '2', NAME: '二级' }, { ID: '3', NAME: '三级' }]]
if (event === 'JOB_TYPE_NAME') {
this.picker.columns = [[{ ID: '0', NAME: '内部作业' }, { ID: '1', NAME: '相关方作业' }]]
if (this.jobTypeNameArr.length > 0) this.picker.defaultIndex = this.jobTypeNameArr;
};
if (event === 'HOT_WORK_LEVEL_INDEX') {
this.picker.columns = [[{ ID: '0', NAME: '特级' }, { ID: '1', NAME: '一级' }, { ID: '2', NAME: '二级' }, { ID: '3', NAME: '三级' }]]
if (this.hotWorkLevelNameArr.length > 0) this.picker.defaultIndex = this.hotWorkLevelNameArr;
}
this.picker.show = true;
},
fnSingleChoiceConfirm(event) {
if (this.picker.type === 'JOB_TYPE_NAME') {
this.form.JOB_TYPE_ID = event.value[0].ID
this.form.JOB_TYPE_NAME = event.value[0].NAME
this.picker.defaultIndex = event.indexs
}
if (this.picker.type === 'HOT_WORK_LEVEL_INDEX') {
this.form.HOT_WORK_LEVEL_ID = event.value[0].ID
this.form.HOT_WORK_LEVEL_INDEX = event.value[0].NAME
this.picker.defaultIndex = event.indexs
}
this.fnSingleChoiceCancel()
},