qa-prevention-xgf-app/pages/eight_assignments/other_security_measures.vue

77 lines
2.2 KiB
Vue
Raw Normal View History

2024-07-11 18:04:46 +08:00
<template>
<view class="content">
<view class="card">
<u-form labelPosition="top" :model="form" :rules="rules" ref="formRef" labelWidth="auto">
<u-form-item label="其它安全措施" borderBottom required v-for="(item,index) in form.value" :key="item.id">
<u-button v-if="index === 0" type="primary" size="mini" text="新增"
:customStyle="{position: 'absolute',top: '-46upx',right: '20upx',width:'100upx',margin:0}"
@click="fnAddValue"/>
<u-button v-if="index !== 0" type="error" size="mini" text="删除"
:customStyle="{position: 'absolute',top: '-46upx',right: '20upx',width:'100upx',margin:0}"
@click="fnDeleteValue(index)"/>
<u-textarea v-model="item.value" border="none" autoHeight maxlength="-1"/>
</u-form-item>
</u-form>
<view class="mt-10">
<u-button type="primary" text="下一步" @click="$u.debounce(fnSubmit, 1000,true)"/>
</view>
</view>
</view>
</template>
<script>
import {setOtherSecurityMeasures} from "@/utils/submitHomeworkProcess";
export default {
data() {
return {
EW_RU_JOB_ID: '',
taskId: '',
TYPE: '',
CORP_ID: '',
vernier: '',
2024-07-11 18:04:46 +08:00
form: {
value: []
},
rules: {},
}
},
onLoad(query) {
this.EW_RU_JOB_ID = query.EW_RU_JOB_ID
this.taskId = query.taskId
this.TYPE = query.TYPE
this.CORP_ID = query.CORP_ID
this.vernier = query.vernier
2024-07-11 18:04:46 +08:00
this.fnAddValue()
},
methods: {
fnAddValue() {
this.form.value.push({value: '', id: uni.$u.guid()})
},
fnDeleteValue(index) {
this.form.value.splice(index, 1)
},
async fnSubmit() {
for (let i = 0; i < this.form.value.length; i++) {
if (!this.form.value[i].value) {
uni.$u.toast(`${i + 1}项中,请输入内容`)
return
}
}
await setOtherSecurityMeasures({
value: this.form.value,
taskId: this.taskId,
EW_RU_JOB_ID: this.EW_RU_JOB_ID,
CORP_ID: this.CORP_ID,
TYPE: this.TYPE,
vernier: this.vernier
2024-07-11 18:04:46 +08:00
})
}
},
}
</script>
<style scoped lang="scss">
</style>