Przeglądaj źródła

feat: 软件锁记录备注编辑

outaozhen 4 lat temu
rodzic
commit
390cc7465a

+ 0 - 2
src/pages/Product/Lock/LockStore/components/LockDetail/LowerList.tsx

@@ -1,6 +1,4 @@
 import { Tabs } from 'antd'
-import consts from '@/consts'
-import { isDevMode } from '@/utils/env'
 import ProTable from '@ant-design/pro-table'
 import type { ProColumns } from '@ant-design/pro-table'
 import { VList } from 'virtuallist-antd'

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

@@ -2,7 +2,7 @@ import React, { useState, useEffect, useRef } from 'react'
 import { Modal, Form, Select, Input, Spin, Button, Radio, Popconfirm, message } from 'antd'
 import { SearchOutlined } from '@ant-design/icons'
 import { queryClient } from '@/services/customer'
-import { queryLock } from '@/services/product'
+import { apiUpdateLonglelog, queryLock } from '@/services/product'
 import consts from '@/basic/consts'
 import { useDebounceFn } from 'ahooks'
 import { apiSoftwareAddLonglelog, apiReceiveLock } from '@/services/product'
@@ -30,7 +30,9 @@ const placeholderEnum = {
 }
 
 const OpreateLock = props => {
-  const { onConfirm, onCancel, type, longleId, keyNum, prodList, upgradeProduct, ...resetModalProps } = props
+  const { onConfirm, onCancel, type, longleId, id, keyNum, prodList, upgradeProduct, ...resetModalProps } =
+    props
+  console.log(id)
   const [form] = Form.useForm()
   const dispatch = useDispatch()
   const scrollRef = useRef()
@@ -155,6 +157,20 @@ const OpreateLock = props => {
               }
             })
           }
+        }
+        if (type === lockTypeEnum.REMARK) {
+          const { code = -1 } = await apiUpdateLonglelog({ id })
+          if (code === consts.RET_CODE.SUCCESS) {
+            message.success('修改成功')
+            onCancel()
+            dispatch({
+              type: 'refresh/commitAction',
+              payload: {
+                main: 'software',
+                target: longleId
+              }
+            })
+          }
         } else {
           const isSuccess = await onConfirm({ ...values, preserveStatus: type })
           isSuccess && onCancel()

+ 13 - 1
src/pages/Product/Lock/LockStore/components/LockDetail/TabList.tsx

@@ -193,6 +193,18 @@ const LockTabList: React.FC<LockTabListProps> = ({
                   </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}
             </div>
           </div>
         </div>
@@ -235,7 +247,7 @@ const LockTabList: React.FC<LockTabListProps> = ({
             type="primary"
             ghost
             size="small"
-            className="mr-3px"
+            className="mr-1"
             onClick={() => openLockModal(lockTypeEnum.SALE)}>
             借销赠
           </Button>

+ 8 - 0
src/services/product.js

@@ -68,6 +68,14 @@ export async function apiDelLonglelog(params) {
   })
 }
 
+/** 编辑软件锁日志-备注 */
+export async function apiUpdateLonglelog(params) {
+  return request('/software/update/longlelog', {
+    method: 'POST',
+    data: params
+  })
+}
+
 /** 云版产品列表 */
 export async function queryRoadpricingList(params) {
   return request('/RoadPricing/list', {