|
|
@ -9,6 +9,7 @@ import styles from './spotMeeting.module.scss' |
|
|
|
import code from '@/static/img/code.png' |
|
|
|
import code from '@/static/img/code.png' |
|
|
|
import Icon from "@/components/icon"; |
|
|
|
import Icon from "@/components/icon"; |
|
|
|
import failure from "@/static/img/failure.png" |
|
|
|
import failure from "@/static/img/failure.png" |
|
|
|
|
|
|
|
import {Profile} from "@/store"; |
|
|
|
|
|
|
|
|
|
|
|
const SpotMeeting: FC = () => { |
|
|
|
const SpotMeeting: FC = () => { |
|
|
|
const path = encodeURIComponent("/pages/meeting/meeting") |
|
|
|
const path = encodeURIComponent("/pages/meeting/meeting") |
|
|
@ -23,6 +24,7 @@ const SpotMeeting: FC = () => { |
|
|
|
const [loading, setLoading] = useState(false) |
|
|
|
const [loading, setLoading] = useState(false) |
|
|
|
const [status, setStatus] = useState(0) // 状态
|
|
|
|
const [status, setStatus] = useState(0) // 状态
|
|
|
|
const [id, setId] = useState<number | undefined>(params.id ? Number(params.id) : undefined) |
|
|
|
const [id, setId] = useState<number | undefined>(params.id ? Number(params.id) : undefined) |
|
|
|
|
|
|
|
const {company} = Profile.useContainer() |
|
|
|
|
|
|
|
|
|
|
|
function setData(res: Meeting | null) { |
|
|
|
function setData(res: Meeting | null) { |
|
|
|
/** |
|
|
|
/** |
|
|
@ -31,13 +33,13 @@ const SpotMeeting: FC = () => { |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
if (params.id || id !== res?.id) { |
|
|
|
if (params.id || id !== res?.id) { |
|
|
|
setImgUrl('') |
|
|
|
setImgUrl('') |
|
|
|
setDepid(res?.department_id || null) |
|
|
|
setDepid(res?.dep_id || null) |
|
|
|
setName(res?.name || '') |
|
|
|
setName(res?.name || '') |
|
|
|
setDescription(res?.description || '') |
|
|
|
setDescription(res?.description || '') |
|
|
|
setStatus(res?.status || 0) |
|
|
|
setStatus(res?.status || 0) |
|
|
|
setId(res?.id || 0) |
|
|
|
setId(res?.id || 0) |
|
|
|
|
|
|
|
|
|
|
|
if (!Array.isArray(res) && res) { |
|
|
|
if (res) { |
|
|
|
downUrl(res.id, false) |
|
|
|
downUrl(res.id, false) |
|
|
|
setEnd(formatDate(new Date(res.estimate_end_time), "YY-MM-dd 18:00:00")) |
|
|
|
setEnd(formatDate(new Date(res.estimate_end_time), "YY-MM-dd 18:00:00")) |
|
|
|
setStart(formatDate(new Date(res.estimate_start_time), "YY-MM-dd 08:00:00")) |
|
|
|
setStart(formatDate(new Date(res.estimate_start_time), "YY-MM-dd 08:00:00")) |
|
|
@ -120,6 +122,8 @@ const SpotMeeting: FC = () => { |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
Taro.showToast({title: '请截图保存', icon: 'none'}) |
|
|
|
} |
|
|
|
} |
|
|
|
}, [imgUrl]); |
|
|
|
}, [imgUrl]); |
|
|
|
|
|
|
|
|
|
|
@ -166,10 +170,6 @@ const SpotMeeting: FC = () => { |
|
|
|
Taro.showToast({title: '请填写会议名称', icon: 'error'}) |
|
|
|
Taro.showToast({title: '请填写会议名称', icon: 'error'}) |
|
|
|
return |
|
|
|
return |
|
|
|
} |
|
|
|
} |
|
|
|
if (!depid) { |
|
|
|
|
|
|
|
Taro.showToast({title: '请选择部门', icon: 'error'}) |
|
|
|
|
|
|
|
return |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
setLoading(true) |
|
|
|
setLoading(true) |
|
|
|
try { |
|
|
|
try { |
|
|
@ -177,7 +177,8 @@ const SpotMeeting: FC = () => { |
|
|
|
...values, |
|
|
|
...values, |
|
|
|
estimate_end_time: new Date(end).getTime(), |
|
|
|
estimate_end_time: new Date(end).getTime(), |
|
|
|
estimate_start_time: new Date(start).getTime(), |
|
|
|
estimate_start_time: new Date(start).getTime(), |
|
|
|
department_id: depid |
|
|
|
dep_id: depid, |
|
|
|
|
|
|
|
company_id: company?.id! |
|
|
|
}) |
|
|
|
}) |
|
|
|
downUrl(res.id) |
|
|
|
downUrl(res.id) |
|
|
|
setStatus(0) |
|
|
|
setStatus(0) |
|
|
@ -192,14 +193,6 @@ const SpotMeeting: FC = () => { |
|
|
|
setLoading(false) |
|
|
|
setLoading(false) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
useEffect(() => { |
|
|
|
|
|
|
|
if (imgUrl) { |
|
|
|
|
|
|
|
setImgUrl('') |
|
|
|
|
|
|
|
setStatus(0) |
|
|
|
|
|
|
|
setId(undefined) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, [start, end, name, depid, description]) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** 开始 */ |
|
|
|
/** 开始 */ |
|
|
|
async function onStart() { |
|
|
|
async function onStart() { |
|
|
|
try { |
|
|
|
try { |
|
|
@ -222,6 +215,20 @@ const SpotMeeting: FC = () => { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
async function putMeeting() { |
|
|
|
|
|
|
|
Taro.showLoading() |
|
|
|
|
|
|
|
await meetingAPi.putMeeting(id!, { |
|
|
|
|
|
|
|
name, |
|
|
|
|
|
|
|
dep_id: depid, |
|
|
|
|
|
|
|
company_id: company?.id!, |
|
|
|
|
|
|
|
description, |
|
|
|
|
|
|
|
estimate_end_time: new Date(end).getTime(), |
|
|
|
|
|
|
|
estimate_start_time: new Date(start).getTime(), |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
Taro.hideLoading() |
|
|
|
|
|
|
|
Taro.showToast({title: '修改成功'}) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return ( |
|
|
|
return ( |
|
|
|
<View className={styles.page}> |
|
|
|
<View className={styles.page}> |
|
|
@ -251,13 +258,13 @@ const SpotMeeting: FC = () => { |
|
|
|
<View className={styles.choice}> |
|
|
|
<View className={styles.choice}> |
|
|
|
<Form onSubmit={submit}> |
|
|
|
<Form onSubmit={submit}> |
|
|
|
<PopPut |
|
|
|
<PopPut |
|
|
|
title='会议标题' |
|
|
|
title='会议名称' |
|
|
|
chevron |
|
|
|
chevron |
|
|
|
content={<Input |
|
|
|
content={<Input |
|
|
|
className='input' |
|
|
|
className='input' |
|
|
|
name='name' |
|
|
|
name='name' |
|
|
|
value={name} |
|
|
|
value={name} |
|
|
|
disabled={!!params.id || status > 0} |
|
|
|
disabled={status > 0} |
|
|
|
placeholder='请输入会议标题' |
|
|
|
placeholder='请输入会议标题' |
|
|
|
onInput={(e) => setName(e.detail.value)} |
|
|
|
onInput={(e) => setName(e.detail.value)} |
|
|
|
/>} |
|
|
|
/>} |
|
|
@ -265,7 +272,7 @@ const SpotMeeting: FC = () => { |
|
|
|
<Picker |
|
|
|
<Picker |
|
|
|
mode="date" |
|
|
|
mode="date" |
|
|
|
value={start} |
|
|
|
value={start} |
|
|
|
disabled={!!params.id || status === 1} |
|
|
|
disabled={status === 1} |
|
|
|
onChange={(e) => change_start(e.detail.value + ' 8:00:00')} |
|
|
|
onChange={(e) => change_start(e.detail.value + ' 8:00:00')} |
|
|
|
name='estimate_start_time'> |
|
|
|
name='estimate_start_time'> |
|
|
|
<PopPut title='开始时间' content={start}/> |
|
|
|
<PopPut title='开始时间' content={start}/> |
|
|
@ -273,7 +280,7 @@ const SpotMeeting: FC = () => { |
|
|
|
<Picker |
|
|
|
<Picker |
|
|
|
mode="date" |
|
|
|
mode="date" |
|
|
|
value={end} |
|
|
|
value={end} |
|
|
|
disabled={!!params.id || status === 1} |
|
|
|
disabled={status === 1} |
|
|
|
onChange={(e) => change_end(e.detail.value + ' 18:00:00')} |
|
|
|
onChange={(e) => change_end(e.detail.value + ' 18:00:00')} |
|
|
|
name='estimate_end_time'> |
|
|
|
name='estimate_end_time'> |
|
|
|
<PopPut title='结束时间' content={end}/> |
|
|
|
<PopPut title='结束时间' content={end}/> |
|
|
@ -282,9 +289,9 @@ const SpotMeeting: FC = () => { |
|
|
|
mode='selector' |
|
|
|
mode='selector' |
|
|
|
range={manages} |
|
|
|
range={manages} |
|
|
|
onChange={depChange} |
|
|
|
onChange={depChange} |
|
|
|
disabled={!!params.id || status === 1} |
|
|
|
disabled={status === 1} |
|
|
|
rangeKey='name' |
|
|
|
rangeKey='name' |
|
|
|
name='department_id'> |
|
|
|
name='dep_id'> |
|
|
|
<PopPut title='选择部门' content={manages?.find(x => x.id == depid)?.name}/> |
|
|
|
<PopPut title='选择部门' content={manages?.find(x => x.id == depid)?.name}/> |
|
|
|
</Picker> |
|
|
|
</Picker> |
|
|
|
|
|
|
|
|
|
|
@ -299,20 +306,39 @@ const SpotMeeting: FC = () => { |
|
|
|
{/* style={{height: '60px'}}>*/} |
|
|
|
{/* style={{height: '60px'}}>*/} |
|
|
|
{/*</Textarea>*/} |
|
|
|
{/*</Textarea>*/} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<View className='flex justify-between'> |
|
|
|
|
|
|
|
|
|
|
|
{ |
|
|
|
{ |
|
|
|
id !== undefined && <> |
|
|
|
id !== undefined && <> |
|
|
|
{ |
|
|
|
{ |
|
|
|
status === 0 && |
|
|
|
status === 0 && <MyButton |
|
|
|
<MyButton fillet type='warn' width={200} className={styles.buttonDel} onClick={onStart}>开始</MyButton> |
|
|
|
fillet |
|
|
|
|
|
|
|
type='warn' |
|
|
|
|
|
|
|
width={150} |
|
|
|
|
|
|
|
className={styles.buttonDel} |
|
|
|
|
|
|
|
onClick={onStart}> |
|
|
|
|
|
|
|
开始 |
|
|
|
|
|
|
|
</MyButton> |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
{ |
|
|
|
{ |
|
|
|
status === 1 && |
|
|
|
status === 1 && |
|
|
|
<MyButton fillet type='warn' width={200} className={styles.buttonDel} onClick={onEnd}>结束</MyButton> |
|
|
|
<MyButton fillet type='warn' width={150} className={styles.buttonDel} onClick={onEnd}>结束</MyButton> |
|
|
|
} |
|
|
|
} |
|
|
|
</> |
|
|
|
</> |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
imgUrl && <MyButton |
|
|
|
|
|
|
|
fillet |
|
|
|
|
|
|
|
disabled={!imgUrl || status === 1} |
|
|
|
|
|
|
|
width={150} |
|
|
|
|
|
|
|
onClick={putMeeting} |
|
|
|
|
|
|
|
className={styles.button}> |
|
|
|
|
|
|
|
修改 |
|
|
|
|
|
|
|
</MyButton> |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</View> |
|
|
|
|
|
|
|
|
|
|
|
<MyButton |
|
|
|
<MyButton |
|
|
|
formType='submit' |
|
|
|
formType='submit' |
|
|
@ -320,9 +346,8 @@ const SpotMeeting: FC = () => { |
|
|
|
width={200} |
|
|
|
width={200} |
|
|
|
className={styles.button} |
|
|
|
className={styles.button} |
|
|
|
loading={loading}> |
|
|
|
loading={loading}> |
|
|
|
保存二维码 |
|
|
|
{imgUrl ? "保存二维码" : "新建现场会"} |
|
|
|
</MyButton> |
|
|
|
</MyButton> |
|
|
|
|
|
|
|
|
|
|
|
</Form> |
|
|
|
</Form> |
|
|
|
</View> |
|
|
|
</View> |
|
|
|
|
|
|
|
|
|
|
|