Explorar o código

Merge branch 'dev' into test

莫凡 %!s(int64=3) %!d(string=hai) anos
pai
achega
9cd867044d

+ 11 - 3
src/components/DiagManager/index.js

@@ -74,6 +74,14 @@ function DiagManager() {
     post(api.deleteRecord, { id: Diagid }).then((res) => {
     post(api.deleteRecord, { id: Diagid }).then((res) => {
 	  setDelvisible(false);
 	  setDelvisible(false);
       if (res.data.code === 200) {
       if (res.data.code === 200) {
+		//刷新列表
+		const totalPage = Math.ceil((total-1) / size);
+		//将当前页码与删除数据之后的总页数进行比较,避免当前页码不存在
+		const pagenum =
+		    params.current > totalPage ? totalPage : params.current;
+		//避免pagenum变为0
+		params.current = pagenum < 1 ? 1 : pagenum;
+		setParams(params)
         getDiseasePage();
         getDiseasePage();
         setDiagid("");
         setDiagid("");
         message.success("删除成功");
         message.success("删除成功");
@@ -177,17 +185,17 @@ function DiagManager() {
           <Row gutter={24}>
           <Row gutter={24}>
             <Col span={5} key={0}>
             <Col span={5} key={0}>
               <Form.Item label="医院诊断名称" name="hisName">
               <Form.Item label="医院诊断名称" name="hisName">
-                <Input placeholder="请输入" autoComplete='off' allowClear/>
+                <Input placeholder="请输入" autoComplete='off' allowClear maxLength='30'/>
               </Form.Item>
               </Form.Item>
             </Col>
             </Col>
             <Col span={5} key={1}>
             <Col span={5} key={1}>
               <Form.Item label="ICD-10编码" name="hisCode">
               <Form.Item label="ICD-10编码" name="hisCode">
-                <Input placeholder="请输入" autoComplete='off' allowClear/>
+                <Input placeholder="请输入" autoComplete='off' allowClear maxLength='30'/>
               </Form.Item>
               </Form.Item>
             </Col>
             </Col>
             <Col span={5} key={2}>
             <Col span={5} key={2}>
               <Form.Item label="标准诊断名称" name="uniqueName">
               <Form.Item label="标准诊断名称" name="uniqueName">
-                <Input placeholder="请输入" autoComplete='off' allowClear/>
+                <Input placeholder="请输入" autoComplete='off' allowClear maxLength='30'/>
               </Form.Item>
               </Form.Item>
             </Col>
             </Col>
             <Col span={5} key={3}>
             <Col span={5} key={3}>

+ 8 - 8
src/components/DocTemplate/index.js

@@ -115,23 +115,23 @@ function DocTemplate() {
 		  >
 		  >
 			<Row gutter={24}>
 			<Row gutter={24}>
 			  <Col span={5} key={0}>
 			  <Col span={5} key={0}>
-				<Form.Item label="医院模板ID" name="code" rules={[{ max: 30, message: '不能超过30个字符' }]}>
-				  <Input placeholder="请输入" autoComplete='off' allowClear/>
+				<Form.Item label="医院模板ID" name="code">
+				  <Input placeholder="请输入" autoComplete='off' allowClear maxLength='30'/>
 				</Form.Item>
 				</Form.Item>
 			  </Col>
 			  </Col>
 			  <Col span={5} key={1}>
 			  <Col span={5} key={1}>
-				<Form.Item label="医院模板名称" name="name" rules={[{ max: 30, message: '不能超过30个字符' }]}>
-				  <Input placeholder="请输入" autoComplete='off' allowClear/>
+				<Form.Item label="医院模板名称" name="name">
+				  <Input placeholder="请输入" autoComplete='off' allowClear maxLength='30'/>
 				</Form.Item>
 				</Form.Item>
 			  </Col>
 			  </Col>
 			  <Col span={5} key={2}>
 			  <Col span={5} key={2}>
-				<Form.Item label="医院父类模板ID" name="parentCode" rules={[{ max: 30, message: '不能超过30个字符' }]}>
-				  <Input placeholder="请输入" autoComplete='off' allowClear/>
+				<Form.Item label="医院父类模板ID" name="parentCode">
+				  <Input placeholder="请输入" autoComplete='off' allowClear maxLength='30'/>
 				</Form.Item>
 				</Form.Item>
 			  </Col>
 			  </Col>
-			  <Col span={5} key={4} rules={[{ max: 30, message: '不能超过30个字符' }]}>
+			  <Col span={5} key={4}>
 				<Form.Item label="医院父类模板名称" name="parentName">
 				<Form.Item label="医院父类模板名称" name="parentName">
-				  <Input placeholder="请输入" autoComplete='off' allowClear/>
+				  <Input placeholder="请输入" autoComplete='off' allowClear maxLength='30'/>
 				</Form.Item>
 				</Form.Item>
 			  </Col>
 			  </Col>
 			  <Col span={4} key={5}>
 			  <Col span={4} key={5}>

+ 11 - 3
src/components/DrugManager/index.js

@@ -75,6 +75,14 @@ function DrugManager() {
 	post(api.deleteRecord, { id: Drugid }).then((res) => {
 	post(api.deleteRecord, { id: Drugid }).then((res) => {
 	  setDelvisible(false);
 	  setDelvisible(false);
 	  if (res.data.code === 200) {
 	  if (res.data.code === 200) {
+		//刷新列表
+		const totalPage = Math.ceil((total-1) / size);
+		//将当前页码与删除数据之后的总页数进行比较,避免当前页码不存在
+		const pagenum =
+		     params.current > totalPage ? totalPage : params.current;
+		//避免pagenum变为0
+		params.current = pagenum < 1 ? 1 : pagenum;
+		setParams(params)
 		getDrugeryPage();
 		getDrugeryPage();
 		setDrugid("");
 		setDrugid("");
 		message.success("删除成功");
 		message.success("删除成功");
@@ -183,17 +191,17 @@ function DrugManager() {
 			<Row gutter={24}>
 			<Row gutter={24}>
 			  <Col span={5} key={0}>
 			  <Col span={5} key={0}>
 				<Form.Item label="医院药品名称" name="hisName">
 				<Form.Item label="医院药品名称" name="hisName">
-				  <Input placeholder="请输入" autoComplete='off' allowClear/>
+				  <Input placeholder="请输入" autoComplete='off' allowClear maxLength='30'/>
 				</Form.Item>
 				</Form.Item>
 			  </Col>
 			  </Col>
 			  <Col span={5} key={1}>
 			  <Col span={5} key={1}>
 				<Form.Item label="标准药品名称" name="uniqueName">
 				<Form.Item label="标准药品名称" name="uniqueName">
-				  <Input placeholder="请输入" autoComplete='off' allowClear/>
+				  <Input placeholder="请输入" autoComplete='off' allowClear maxLength='30'/>
 				</Form.Item>
 				</Form.Item>
 			  </Col>
 			  </Col>
 			  <Col span={5} key={2}>
 			  <Col span={5} key={2}>
 				<Form.Item label="药品剂型" name="form">
 				<Form.Item label="药品剂型" name="form">
-				  <Input placeholder="请输入" autoComplete='off' allowClear/>
+				  <Input placeholder="请输入" autoComplete='off' allowClear maxLength='30'/>
 				</Form.Item>
 				</Form.Item>
 			  </Col>
 			  </Col>
 			  <Col span={5} key={3}>
 			  <Col span={5} key={3}>

+ 16 - 8
src/components/DutyRecord/index.js

@@ -96,6 +96,14 @@ function DutyRecord() {
 	function delRecord() {
 	function delRecord() {
 		post(api.delOfficialCapacityPage, { id: selectedRowKeys }).then((res) => {
 		post(api.delOfficialCapacityPage, { id: selectedRowKeys }).then((res) => {
 			if (res.data.code === 200) {
 			if (res.data.code === 200) {
+				//刷新列表
+				const totalPage = Math.ceil((total - selectedRowKeys.length) / size);
+				//将当前页码与删除数据之后的总页数进行比较,避免当前页码不存在
+				const pagenum =
+				    params.current > totalPage ? totalPage : params.current;
+				//避免pagenum变为0
+				params.current = pagenum < 1 ? 1 : pagenum;
+				setParams(params)
 				//刷新列表
 				//刷新列表
 				getDutyRecord()
 				getDutyRecord()
 			} else {
 			} else {
@@ -183,23 +191,23 @@ function DutyRecord() {
 				>
 				>
 					<Row gutter={24}>
 					<Row gutter={24}>
 						<Col span={5} key={0}>
 						<Col span={5} key={0}>
-							<Form.Item label="医生姓名" name="doctorName" rules={[{ max: 30, message: '不能超过30个字符' }]}>
-								<Input placeholder="请输入" autoComplete='off' allowClear/>
+							<Form.Item label="医生姓名" name="doctorName">
+								<Input placeholder="请输入" autoComplete='off' allowClear maxLength='30'/>
 							</Form.Item>
 							</Form.Item>
 						</Col>
 						</Col>
 						<Col span={5} key={1}>
 						<Col span={5} key={1}>
-							<Form.Item label="科室" name="deptName" rules={[{ max: 30, message: '不能超过30个字符' }]}>
-								<Input placeholder="请输入" autoComplete='off' allowClear/>
+							<Form.Item label="科室" name="deptName">
+								<Input placeholder="请输入" autoComplete='off' allowClear maxLength='30'/>
 							</Form.Item>
 							</Form.Item>
 						</Col>
 						</Col>
 						<Col span={5} key={2}>
 						<Col span={5} key={2}>
-							<Form.Item label="工号" name="doctorCode" rules={[{ max: 30, message: '不能超过30个字符' }]}>
-								<Input placeholder="请输入" autoComplete='off' allowClear/>
+							<Form.Item label="工号" name="doctorCode">
+								<Input placeholder="请输入" autoComplete='off' allowClear maxLength='30'/>
 							</Form.Item>
 							</Form.Item>
 						</Col>
 						</Col>
 						<Col span={5} key={3}>
 						<Col span={5} key={3}>
-							<Form.Item label="职务/职称名称" name="name" rules={[{ max: 30, message: '不能超过30个字符' }]}>
-								<Input placeholder="请输入" autoComplete='off' allowClear/>
+							<Form.Item label="职务/职称名称" name="name">
+								<Input placeholder="请输入" autoComplete='off' allowClear maxLength='30'/>
 							</Form.Item>
 							</Form.Item>
 						</Col>
 						</Col>
 						<Col span={5} key={4}>
 						<Col span={5} key={4}>

+ 11 - 3
src/components/SurgeryManager/index.js

@@ -74,6 +74,14 @@ function SurgManager() {
 	post(api.deleteRecord, { id: Surgid }).then((res) => {
 	post(api.deleteRecord, { id: Surgid }).then((res) => {
 	  setDelvisible(false);
 	  setDelvisible(false);
 	  if (res.data.code === 200) {
 	  if (res.data.code === 200) {
+		//刷新列表
+		const totalPage = Math.ceil((total-1) / size);
+		//将当前页码与删除数据之后的总页数进行比较,避免当前页码不存在
+		const pagenum =
+		    params.current > totalPage ? totalPage : params.current;
+		//避免pagenum变为0
+		params.current = pagenum < 1 ? 1 : pagenum;
+		setParams(params)
 		getSurgeryPage();
 		getSurgeryPage();
 		setSurgid("");
 		setSurgid("");
 		message.success("删除成功");
 		message.success("删除成功");
@@ -178,17 +186,17 @@ function SurgManager() {
 			<Row gutter={24}>
 			<Row gutter={24}>
 			  <Col span={5} key={0}>
 			  <Col span={5} key={0}>
 				<Form.Item label="医院手术/操作名称" name="hisName">
 				<Form.Item label="医院手术/操作名称" name="hisName">
-				  <Input placeholder="请输入" autoComplete='off' allowClear/>
+				  <Input placeholder="请输入" autoComplete='off' allowClear maxLength='30'/>
 				</Form.Item>
 				</Form.Item>
 			  </Col>
 			  </Col>
 			  <Col span={5} key={1}>
 			  <Col span={5} key={1}>
 				<Form.Item label="手术/操作代码" name="hisCode">
 				<Form.Item label="手术/操作代码" name="hisCode">
-				  <Input placeholder="请输入" autoComplete='off' allowClear/>
+				  <Input placeholder="请输入" autoComplete='off' allowClear maxLength='30'/>
 				</Form.Item>
 				</Form.Item>
 			  </Col>
 			  </Col>
 			  <Col span={5} key={2}>
 			  <Col span={5} key={2}>
 				<Form.Item label="标准手术/操作名称" name="uniqueName">
 				<Form.Item label="标准手术/操作名称" name="uniqueName">
-				  <Input placeholder="请输入" autoComplete='off' allowClear/>
+				  <Input placeholder="请输入" autoComplete='off' allowClear maxLength='30'/>
 				</Form.Item>
 				</Form.Item>
 			  </Col>
 			  </Col>
 			  <Col span={5} key={3}>
 			  <Col span={5} key={3}>