| | |
| | | <el-select v-model="form.operatorUids" multiple> |
| | | <el-option |
| | | v-for="item in workerList" |
| | | :key="item.uid" |
| | | :label="item.username" |
| | | :value="item.uid" |
| | | :key="item.id" |
| | | :label="item.realname + '(' + item.username.toString().replace(/^(\d{3})\d{4}(\d{4})$/,'$1****$2') + ')'" |
| | | :value="item.id" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="作业内容" prop="workContent"> |
| | | <el-input |
| | | v-model="form.workContent" |
| | | autosize |
| | | type="textarea" |
| | | placeholder="请输入作业内容" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="作业时间" prop="workTimeLine"> |
| | | <el-date-picker |
| | | v-model="form.workTimeLine" |
| | | format="YYYY-MM-DD HH:mm" |
| | | value-format="YYYY-MM-DD HH:mm:00" |
| | | value-format="yyyy-MM-dd HH:mm:ss" |
| | | type="datetimerange" |
| | | range-separator="至" |
| | | start-placeholder="开始时间" |
| | |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="作业内容" prop="workContent"> |
| | | <el-input |
| | | v-model="form.workContent" |
| | | autosize |
| | | type="textarea" |
| | | placeholder="请输入作业内容" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="作业地址" prop="workLocation"> |
| | | <el-input |
| | | v-model="form.workLocation" |
| | | autosize |
| | | type="textarea" |
| | | placeholder="请输入作业地址" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="作业地址" prop="workLocation"> |
| | | <el-input |
| | | v-model="form.workLocation" |
| | | autosize |
| | | type="textarea" |
| | | placeholder="请输入作业地址" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | |
| | | |
| | |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="危险辨识" prop="hazardIdentification"> |
| | | <el-input |
| | | v-model="form.hazardIdentification" |
| | | autosize |
| | | type="textarea" |
| | | placeholder="请输入危险辨识" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | </div> |
| | | </el-form> |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | export default{ |
| | | import {workApplyApi} from "../../../../../api/workApply"; |
| | | |
| | | export default{ |
| | | name: 'hoistForm', |
| | | components: {}, |
| | | props:['workerList'], |
| | |
| | | }, |
| | | workTimeLine: [], |
| | | expStartTime: '', |
| | | hazardIdentification: '', |
| | | expEndTime: '' |
| | | }, |
| | | workLevelList: [ |
| | |
| | | } |
| | | ], |
| | | applyRules:{ |
| | | operatorUids: [{ required: true, message: '该内容不能为空', trigger: 'blur' }], |
| | | operatorUids: [{ required: true, message: '该内容不能为空', trigger: 'change' }], |
| | | workType: [{ required: true, message: '该内容不能为空', trigger: 'blur' }], |
| | | workLevel: [{ required: true, message: '该内容不能为空', trigger: 'blur' }], |
| | | workLevel: [{ required: true, message: '该内容不能为空', trigger: 'change' }], |
| | | workContent: [{ required: true, message: '该内容不能为空', trigger: 'blur' }], |
| | | hazardIdentification: [{ required: true, message: '该内容不能为空', trigger: 'blur' }], |
| | | workLocation: [{ required: true, message: '该内容不能为空', trigger: 'blur' }], |
| | | workTimeLine: [{ required: true, message: '该内容不能为空', trigger: 'blur' }], |
| | | "workDetail.powerAccessPoint": [{ required: true, message: '该内容不能为空', trigger: 'blur' }], |
| | |
| | | } |
| | | }, |
| | | methods:{ |
| | | async submitForm(formEl) { |
| | | if (!formEl) return |
| | | await formEl.validate(async (valid, fields) => { |
| | | submitForm() { |
| | | this.$refs["ruleFormRef"].validate(async (valid, fields) => { |
| | | if (valid) { |
| | | state.form.expStartTime = JSON.parse(JSON.stringify(state.form.workTimeLine))[0] |
| | | state.form.expEndTime = JSON.parse(JSON.stringify(state.form.workTimeLine))[1] |
| | | let { workTimeLine, ...data } = JSON.parse(JSON.stringify(state.form)) |
| | | this.form.expStartTime = JSON.parse(JSON.stringify(this.form.workTimeLine))[0] |
| | | this.form.expEndTime = JSON.parse(JSON.stringify(this.form.workTimeLine))[1] |
| | | let { workTimeLine, ...data } = JSON.parse(JSON.stringify(this.form)) |
| | | // data.workDetail.weightMass = Number(data.workDetail.weightMass) |
| | | const res = await workApplyApi().postPowerApply(data) |
| | | if (res.data.code === '200') { |
| | | ElMessage({ |
| | | this.$message({ |
| | | type: 'success', |
| | | message: '提交成功!' |
| | | }); |
| | | formEl.resetFields() |
| | | this.$refs["ruleFormRef"].clearValidate() |
| | | this.form = { |
| | | operatorUids: [], |
| | | workType: 7, |
| | | workLevel: 0, |
| | | workContent: '', |
| | | workLocation: '', |
| | | workDetail:{ |
| | | powerAccessPoint: '', |
| | | workingVoltage: null, |
| | | equipmentAndPower: '' |
| | | }, |
| | | workTimeLine: [], |
| | | expStartTime: '', |
| | | hazardIdentification: '', |
| | | expEndTime: '' |
| | | } |
| | | } else { |
| | | ElMessage({ |
| | | this.$message({ |
| | | type: 'warning', |
| | | message: res.data.msg |
| | | }); |