|
@ -17,6 +17,7 @@ const RecordModal =(props)=>{ |
|
|
// console.log('endTimex',endTime) |
|
|
// console.log('endTimex',endTime) |
|
|
useEffect(()=>{ |
|
|
useEffect(()=>{ |
|
|
setEndTime(recordRow?.solvingTime) |
|
|
setEndTime(recordRow?.solvingTime) |
|
|
|
|
|
console.log('recordRow',recordRow) |
|
|
},[recordRow]) |
|
|
},[recordRow]) |
|
|
const cancelHandler=()=>{ |
|
|
const cancelHandler=()=>{ |
|
|
onClose() |
|
|
onClose() |
|
@ -26,14 +27,16 @@ const cancelHandler=()=>{ |
|
|
} |
|
|
} |
|
|
const okHandler=()=>{ |
|
|
const okHandler=()=>{ |
|
|
FormApi.current.validate().then((res)=>{ |
|
|
FormApi.current.validate().then((res)=>{ |
|
|
// console.log('res',res) |
|
|
console.log('recordRow',res) |
|
|
const editVal={ |
|
|
const editVal={ |
|
|
|
|
|
id:recordRow?.id, |
|
|
solvingTime:res.endTime, |
|
|
solvingTime:res.endTime, |
|
|
occurrencTime:res.startTime, |
|
|
occurrencTime:res.startTime, |
|
|
sketch:res.name, |
|
|
sketch:res.name, |
|
|
record:res.record, |
|
|
record:res.record, |
|
|
settler:res.settler, |
|
|
settler:res.settler, |
|
|
type:res.type |
|
|
type:res.type, |
|
|
|
|
|
msg:recordRow?'编辑服务记录':'添加服务记录' |
|
|
} |
|
|
} |
|
|
dispatch(service.addRecord(editVal)).then(res => { |
|
|
dispatch(service.addRecord(editVal)).then(res => { |
|
|
if (res.success) { |
|
|
if (res.success) { |
|
@ -45,9 +48,11 @@ const okHandler=()=>{ |
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |
|
|
return <Modal |
|
|
return <Modal |
|
|
title={recordRow?'查看':'服务记录添加'} |
|
|
title={recordRow?'编辑服务记录':'服务记录添加'} |
|
|
visible={visible} |
|
|
visible={visible} |
|
|
footer={recordRow?<Button onClick={cancelHandler}>取消</Button>:<div> |
|
|
footer={ |
|
|
|
|
|
//recordRow?<Button onClick={cancelHandler}>取消</Button>: |
|
|
|
|
|
<div> |
|
|
<Button onClick={cancelHandler}>取消</Button> |
|
|
<Button onClick={cancelHandler}>取消</Button> |
|
|
<Button theme='solid' type='primary' onClick={okHandler}>确定</Button> |
|
|
<Button theme='solid' type='primary' onClick={okHandler}>确定</Button> |
|
|
</div>} |
|
|
</div>} |
|
@ -56,24 +61,24 @@ const okHandler=()=>{ |
|
|
> |
|
|
> |
|
|
<Form wrapperCol={{ span: 20 }} |
|
|
<Form wrapperCol={{ span: 20 }} |
|
|
initValues={{'name':recordRow?.sketch,'startTime':recordRow?.occurrenceTime, |
|
|
initValues={{'name':recordRow?.sketch,'startTime':recordRow?.occurrenceTime, |
|
|
'endTime':recordRow?.solvingTime,'settler':recordRow?.maintenanceRecordExecuteUsers.map((item)=>{return item.name}),'type':recordRow?.type,'record':recordRow?.record}} |
|
|
'endTime':recordRow?.solvingTime,'settler':recordRow?.maintenanceRecordExecuteUsers.map((item)=>{return item.id}),'type':recordRow?.type,'record':recordRow?.record}} |
|
|
getFormApi={formApi => FormApi.current = formApi} |
|
|
getFormApi={formApi => FormApi.current = formApi} |
|
|
labelPosition='left' |
|
|
labelPosition='left' |
|
|
labelAlign='right'> |
|
|
labelAlign='right'> |
|
|
<Form.Input field='name' label='故障简述:' trigger='blur' |
|
|
<Form.Input field='name' label='故障简述:' trigger='blur' |
|
|
disabled={recordRow?true:false} |
|
|
|
|
|
placeholder='选择或搜索项目' rules={[{ required: true, message:'请输入故障简述' }]} maxLength={30}/> |
|
|
placeholder='选择或搜索项目' rules={[{ required: true, message:'请输入故障简述' }]} maxLength={30}/> |
|
|
<Form.DatePicker disabled={recordRow?true:false} field='startTime' label='发生时间:' rules={[{ required: true, message:'请输入发生时间' }]} |
|
|
<Form.DatePicker field='startTime' label='发生时间:' rules={[{ required: true, message:'请输入发生时间' }]} |
|
|
type="dateTime" onChange={(e)=>{ |
|
|
type="dateTime" onChange={(e)=>{ |
|
|
setStartTime(e) |
|
|
setStartTime(e) |
|
|
///console.log('e1',e) |
|
|
///console.log('e1',e) |
|
|
}} |
|
|
}} |
|
|
/> |
|
|
/> |
|
|
<Form.DatePicker disabled={recordRow?true:false} field='endTime' label='解决时间:' initValue={endTime} rules={[{ required: true, message:'请输入解决时间' }]} |
|
|
<Form.DatePicker field='endTime' label='解决时间:' initValue={endTime} rules={[{ required: true, message:'请输入解决时间' }]} |
|
|
type="dateTime" onChange={(e)=>{setEndTime(e);//console.log('sss',moment(endTime-startTime).format('DD天hh时mm分')) |
|
|
type="dateTime" onChange={(e)=>{setEndTime(e);//console.log('sss',moment(endTime-startTime).format('DD天hh时mm分')) |
|
|
}} /> |
|
|
}} /> |
|
|
中断时间:{endTime&&startTime? <span style={{marginLeft:30}}>{`${tdd}天${tdh}时${tds}分`}</span>:''} |
|
|
中断时间:{endTime&&startTime? <span style={{marginLeft:30}}>{`${tdd}天${tdh}时${tds}分`}</span>:''} |
|
|
<Form.Select disabled={recordRow?true:false} field='settler' label='解决者:' trigger='blur' style={{ width:'100%' }} |
|
|
<Form.Select field='settler' label='解决者:' trigger='blur' style={{ width:'100%' }} |
|
|
filter |
|
|
filter |
|
|
rules={[{ required: true, message:'请输入解决者' }]} multiple> |
|
|
rules={[{ required: true, message:'请输入解决者' }]} multiple> |
|
|
{pepList?.map((item)=>{return ( <Form.Select.OptGroup label={item.name}> |
|
|
{pepList?.map((item)=>{return ( <Form.Select.OptGroup label={item.name}> |
|
@ -83,7 +88,7 @@ const okHandler=()=>{ |
|
|
})} |
|
|
})} |
|
|
</Form.Select.OptGroup> )})} |
|
|
</Form.Select.OptGroup> )})} |
|
|
</Form.Select> |
|
|
</Form.Select> |
|
|
<Form.Select disabled={recordRow?true:false} field="type" label={{ text: '故障类型'}} style={{ width: 200 }}> |
|
|
<Form.Select field="type" label={{ text: '故障类型'}} style={{ width: 200 }}> |
|
|
<Form.Select.Option value="es异常">es异常</Form.Select.Option> |
|
|
<Form.Select.Option value="es异常">es异常</Form.Select.Option> |
|
|
<Form.Select.Option value="数据库异常">数据库异常</Form.Select.Option> |
|
|
<Form.Select.Option value="数据库异常">数据库异常</Form.Select.Option> |
|
|
<Form.Select.Option value="应用异常">应用异常</Form.Select.Option> |
|
|
<Form.Select.Option value="应用异常">应用异常</Form.Select.Option> |
|
@ -91,7 +96,7 @@ const okHandler=()=>{ |
|
|
<Form.Select.Option value="服务器异常">服务器异常</Form.Select.Option> |
|
|
<Form.Select.Option value="服务器异常">服务器异常</Form.Select.Option> |
|
|
<Form.Select.Option value="其他">其他</Form.Select.Option> |
|
|
<Form.Select.Option value="其他">其他</Form.Select.Option> |
|
|
</Form.Select> |
|
|
</Form.Select> |
|
|
<Form.TextArea disabled={recordRow?true:false} field="record" label={{text:'故障记录'}} rules={[{ required: true, message:'请输入故障记录' }]}> |
|
|
<Form.TextArea field="record" label={{text:'故障记录'}} rules={[{ required: true, message:'请输入故障记录' }]}> |
|
|
</Form.TextArea> |
|
|
</Form.TextArea> |
|
|
|
|
|
|
|
|
</Form> |
|
|
</Form> |
|
|