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

@ -73,17 +73,11 @@
</view>
<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" />
@ -114,7 +108,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" />
@ -125,6 +119,7 @@
</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";
@ -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) {
@ -364,5 +395,4 @@ export default {
}
</script>
<style scoped lang="scss">
</style>
<style scoped lang="scss"></style>