瀏覽代碼

feat: 软件锁服务记录备注的编辑和删除

outaozhen 4 年之前
父節點
當前提交
784fb65e33

+ 9 - 12
src/pages/Customer/Client/components/AddClient/index.jsx

@@ -115,14 +115,12 @@ const AddClient = props => {
                 }
                 formRef?.setFieldsValue(values)
                 handleOnOk()
-              }}
-            >
+              }}>
               添加并关联
             </Button>
           ) : null}
         </div>
-      }
-    >
+      }>
       <Form {...layout} form={formRef} onValuesChange={handleChange} initialValues={defaultValues}>
         {dataId ? <ProFormText name={`${dataType}Id`} hidden /> : null}
         <ProFormText
@@ -153,26 +151,26 @@ const AddClient = props => {
               name="telephone"
               validateStatus={state.validStatusFtl}
               hasFeedback
-              rules={[{ required: true, message: '请输入手机号码' }]}
-            >
+              rules={[{ required: true, message: '请输入手机号码' }]}>
               <TelephoneFormItem validateFn={status => setState({ ...state, validStatusFtl: status })} />
             </Form.Item>
+            <ProFormText label="微信号" name="wechat" rules={[{ message: '请输入微信号' }]} placeholder="" />
+          </Col>
+          <Col span={12}>
             <ProFormText
               label="电话"
               name="phone"
               rules={[{ message: '请输入电话/座机号' }]}
               placeholder=""
             />
-          </Col>
-          <Col span={12}>
             <ProFormText label="昵称" name="niceName" placeholder="" />
             <ProFormText label="职位" name="position" placeholder="" />
             <ProFormText label="QQ" name="qq" placeholder="" />
-            <ProFormText label="邮箱" name="email" placeholder="" />
           </Col>
         </Row>
         <Row>
           <Col span={12}>
+            <ProFormText label="邮箱" name="email" placeholder="" />
             <ProFormText label="办公室" name="office" placeholder="" />
           </Col>
           <Col span={12}>
@@ -183,19 +181,18 @@ const AddClient = props => {
               rules={[{ message: '来源' }]}
               options={sourceList}
             />
+            <ProFormText label="客户地址" name="address" placeholder="" />
           </Col>
         </Row>
         <Row>
           <Col span={12}>
-            <ProFormText label="客户地址" name="address" placeholder="" />
             <ProFormText label="客户地标" name="landmarks" placeholder="" />
+            <ProFormText label="客户乘车" name="ride" placeholder="" />
           </Col>
           <Col span={12}>
-            <ProFormText label="客户乘车" name="ride" placeholder="" />
             <ProFormText label="客户住宿" name="stay" placeholder="" />
           </Col>
         </Row>
-
         <ProFormTextArea label="备注" name="mark" placeholder="" />
       </Form>
     </Modal>

+ 18 - 5
src/pages/Product/Lock/LockStore/components/LockDetail/OpreateLock.jsx

@@ -30,9 +30,19 @@ const placeholderEnum = {
 }
 
 const OpreateLock = props => {
-  const { onConfirm, onCancel, type, longleId, id, keyNum, prodList, upgradeProduct, ...resetModalProps } =
-    props
-  console.log(id)
+  const {
+    onConfirm,
+    onCancel,
+    type,
+    longleId,
+    isOperation,
+    id,
+    mark,
+    keyNum,
+    prodList,
+    upgradeProduct,
+    ...resetModalProps
+  } = props
   const [form] = Form.useForm()
   const dispatch = useDispatch()
   const scrollRef = useRef()
@@ -136,6 +146,9 @@ const OpreateLock = props => {
       if (type === lockTypeEnum.RECOVER) {
         form.setFieldsValue({ longleId })
       }
+      // if (type === lockTypeEnum.REMARK) {
+      //   form.setFieldsValue({ id, mark })
+      // }
     }
   }, [resetModalProps.visible, type])
 
@@ -158,8 +171,8 @@ const OpreateLock = props => {
             })
           }
         }
-        if (type === lockTypeEnum.REMARK) {
-          const { code = -1 } = await apiUpdateLonglelog({ id })
+        if (isOperation === true) {
+          const { code = -1 } = await apiUpdateLonglelog({ id, mark })
           if (code === consts.RET_CODE.SUCCESS) {
             message.success('修改成功')
             onCancel()

+ 37 - 26
src/pages/Product/Lock/LockStore/components/LockDetail/TabList.tsx

@@ -130,9 +130,12 @@ const LockTabList: React.FC<LockTabListProps> = ({
     }
   }
 
-  const openLockModal = type => {
+  const openLockModal = (type, isOperation, id, mark) => {
     dispatchModal('M_OPREATE_LOCK', {
       type,
+      isOperation,
+      id,
+      mark,
       onConfirm: handleAddLonglelog,
       keyNum,
       upgradeProduct,
@@ -179,32 +182,40 @@ const LockTabList: React.FC<LockTabListProps> = ({
             </div>
             <div>
               服务内容:{renderLongleCon(item)}
-              {hasAddPerm &&
-              (item.status === 3 || item.status === 4 || item.status === 5 || item.status === 9) ? (
-                <Popconfirm
-                  title="确认删除"
-                  onConfirm={() => delLonglelog(item.id)}
-                  okText="确认"
-                  cancelText="取消">
-                  <div>
-                    <Button className="mt-2" type="primary" ghost size="small" danger>
-                      删除
+              <div>
+                {hasAddPerm && item.status === 8 && item.isOperation ? (
+                  <span className="mr-2">
+                    <Button
+                      className="mt-2"
+                      type="primary"
+                      ghost
+                      size="small"
+                      onClick={() =>
+                        openLockModal(lockTypeEnum.REMARK, item.isOperation, item.id, item.mark)
+                      }>
+                      编辑
                     </Button>
-                  </div>
-                </Popconfirm>
-              ) : null}
-              {hasAddPerm && item.status === 8 ? (
-                <div>
-                  <Button
-                    className="mt-2"
-                    type="primary"
-                    ghost
-                    size="small"
-                    onClick={() => openLockModal(lockTypeEnum.REMARK, { id: item.id })}>
-                    编辑
-                  </Button>
-                </div>
-              ) : null}
+                  </span>
+                ) : null}
+                {hasAddPerm &&
+                (item.status === 3 ||
+                  item.status === 4 ||
+                  item.status === 5 ||
+                  item.status === 9 ||
+                  (item.status === 8 && item.isOperation)) ? (
+                  <Popconfirm
+                    title="确认删除"
+                    onConfirm={() => delLonglelog(item.id)}
+                    okText="确认"
+                    cancelText="取消">
+                    <span>
+                      <Button className="mt-2" type="primary" ghost size="small" danger>
+                        删除
+                      </Button>
+                    </span>
+                  </Popconfirm>
+                ) : null}
+              </div>
             </div>
           </div>
         </div>

+ 1 - 0
src/services/typding.d.ts

@@ -45,6 +45,7 @@ declare namespace API {
     status?: string
     remindTime?: string
     remarks?: string
+    isOperation?: boolean
   }
 
   type ServiceLogList = ServiceLogItem[]