魏超 5 年之前
父節點
當前提交
df4af2b80e

+ 1
- 1
src/pages/h5SampleManager/h5Demand/components/AddDemand.jsx 查看文件

@@ -28,7 +28,7 @@ const BatchDel = props => {
28 28
             <Button type="primary" onClick={() => sampleList()}>
29 29
               查看全部样例
30 30
             </Button>
31
-            <Button type="primary" onClick={props.onCancel} style={{marginLeft:'20px'}}>
31
+            <Button onClick={props.onCancel} style={{marginLeft:'20px'}}>
32 32
               取消
33 33
             </Button>
34 34
           </Form.Item>

+ 1
- 1
src/pages/h5SampleManager/h5Demand/detail.jsx 查看文件

@@ -98,7 +98,7 @@ const header = props => {
98 98
   return (
99 99
     <>
100 100
       <Form labelCol={{ span: 7 }} wrapperCol={{ span: 12 }} onSubmit={handleSubmit}>
101
-        <Form.Item label="样例名1">
101
+        <Form.Item label="样例名">
102 102
           <a onClick={() => sampleDetail(demandData.sampleId)} style={{ color: 'blue' }}>{demandData.sampleName}</a>
103 103
         </Form.Item>
104 104
         <Form.Item label="下单人">

+ 3
- 1
src/pages/h5SampleManager/h5Sample/add.jsx 查看文件

@@ -84,7 +84,9 @@ const header = props => {
84 84
           rules: [
85 85
             {
86 86
               required: true,
87
-              message: '请填写联系方式',
87
+              message: '请填写正确的联系方式',
88
+              max:11,
89
+              min:11,
88 90
             },
89 91
           ],
90 92
         })(<Input/>)}

+ 7
- 7
src/pages/h5SampleManager/h5Sample/components/ContactInfo.jsx 查看文件

@@ -57,32 +57,32 @@ class TypeForm extends React.Component {
57 57
             </div>
58 58
             <div className={styles.flexItem} style={{ justifyContent: 'space-between' }}>
59 59
               <div>
60
-                {this.props.type.sex != '' && <div className={styles.flexItem}>
60
+                {this.props.type.sex != '' && this.props.type.sex != null && <div className={styles.flexItem}>
61 61
                   <div className={styles.left}> 性别 </div>
62 62
                   <div className={styles.right} style={{ display: 'flex', alignItems: 'center' }}>{this.props.type.sex == '1' ? '男' : '女'}<img src={this.props.type.sex == '1' ? boyImg : girlImg} height="16px" width="16px" style={{ marginLeft: '5px' }} /></div>
63 63
                 </div>}
64
-                {this.props.type.appellation != '' && <div className={styles.flexItem}>
64
+                {this.props.type.appellation != '' && this.props.type.appellation != null && <div className={styles.flexItem}>
65 65
                   <div className={styles.left}><img src={cardImg} height="18px" width="24px" /></div>
66 66
                   <div className={styles.right}>{this.props.type.appellation}</div>
67 67
                 </div>}
68
-                {this.props.type.telephone != '' && <div className={styles.flexItem}>
68
+                {this.props.type.telephone != '' && this.props.type.telephone != null && <div className={styles.flexItem}>
69 69
                   <div className={styles.left}> 固话 </div>
70 70
                   <div className={styles.right}>{this.props.type.telephone}</div>
71 71
                 </div>}
72
-                {this.props.type.phone != '' && <div className={styles.flexItem}>
72
+                {this.props.type.phone != '' && this.props.type.phone != null && <div className={styles.flexItem}>
73 73
                   <div className={styles.left}> 手机 </div>
74 74
                   <div className={styles.right}>{this.props.type.phone}</div>
75 75
                 </div>}
76
-                {this.props.type.mail && <div className={styles.flexItem}>
76
+                {this.props.type.mail != '' && this.props.type.mail != null && <div className={styles.flexItem}>
77 77
                   <div className={styles.left}> 邮箱 </div>
78 78
                   <div className={styles.right}>{this.props.type.mail}</div>
79 79
                 </div>}
80
-                {this.props.type.address != '' && <div className={styles.flexItem}>
80
+                {this.props.type.address != '' && this.props.type.address != null && <div className={styles.flexItem}>
81 81
                   <div className={styles.left}> 联系地址 </div>
82 82
                   <div className={styles.right}>{this.props.type.address}</div>
83 83
                 </div>}
84 84
               </div>
85
-              {this.props.type.avatar != null &&
85
+              {this.props.type.avatar != null && this.props.type.avatar != '' &&
86 86
               <div style={{ textAlign: 'center' }}>
87 87
                 <img src={this.props.type.wxCardImg} height="80px" width="80px" />
88 88
                 <p style={{ margin: ' 0px', fontSize: '0.096rem', color: '#666' }}>扫码添加微信好友</p>

+ 7
- 2
src/pages/h5SampleManager/h5Sample/detail.jsx 查看文件

@@ -20,6 +20,7 @@ const { MonthPicker, RangePicker, WeekPicker } = DatePicker;
20 20
 const header = props => {
21 21
   const sampleId  = props.location.query.id;
22 22
   const [demandData, setDemandData] = useState({})
23
+  const [demandNum, setDemandNum] = useState()
23 24
 
24 25
   useEffect(() => {
25 26
     getDemandData(sampleId);
@@ -29,6 +30,7 @@ const header = props => {
29 30
   const getDemandData = (demandId) => {
30 31
       request({ ...apis.taH5SampleManager.taH5SampleById, urlData: {id: sampleId} }).then((data) => {
31 32
           setDemandData(data)
33
+          setDemandNum(data.demandNum)
32 34
           props.form.setFieldsValue(data)
33 35
       })
34 36
   }
@@ -103,10 +105,13 @@ const header = props => {
103 105
           <Button danger  onClick={() => toCancel()} style={{marginLeft:'20px'}}>
104 106
             取消
105 107
           </Button>
106
-            <span style={{marginLeft:'25%'}}>已有需求单> ></span>
108
+          {demandNum != 0 && <span style={{marginLeft:'25%'}}>已有{demandNum}需求单> >
107 109
             <Button danger  onClick={() => viewDemand()}>
108
-              查看已有需求单
110
+            查看已有需求单
109 111
             </Button>
112
+            </span>
113
+          }
114
+            
110 115
           </div>
111 116
           
112 117