瀏覽代碼

feat: 收入、支出合同相关编号规则字段变更

lanjianrong 4 年之前
父節點
當前提交
34717ec3a3

+ 8 - 0
src/assets/css/common.scss

@@ -390,6 +390,8 @@
 .pi-circle-gray {
   position: relative;
   padding-left: 14px;
+  line-height: 16px;
+  height: 16px;
   &::before {
     content: '';
     position: absolute;
@@ -405,6 +407,8 @@
 .pi-circle-yellow {
   position: relative;
   padding-left: 14px;
+  line-height: 16px;
+  height: 16px;
   &::before {
     content: '';
     position: absolute;
@@ -421,6 +425,8 @@
 .pi-circle-green {
   position: relative;
   padding-left: 14px;
+  line-height: 16px;
+  height: 16px;
   &::before {
     content: '';
     position: absolute;
@@ -438,6 +444,8 @@
 .pi-circle-red {
   position: relative;
   padding-left: 14px;
+  line-height: 16px;
+  height: 16px;
   &::before {
     content: '';
     position: absolute;

+ 5 - 4
src/pages/Contract/Content/Income/api.ts

@@ -1,4 +1,5 @@
 import request from '@/utils/common/request'
+import consts from '@/utils/consts'
 
 /**
  * 标段升降、上下移、增删
@@ -27,7 +28,7 @@ export async function apiResfulContractTree(type: string, payload: object) {
     default:
       break
   }
-  const { data } = await request[method](url, payload)
+  const { data } = await request[method](url, { ...payload, treeType: consts.CONTRACT_TREE.RETURN })
   return data
 }
 
@@ -48,7 +49,7 @@ export async function apiGetIncome(id: string, bidsectionId: string) {
  * @param serial 序号
  */
 export async function apiUpdateSerial(id: string, bidsectionId: string, serial: string) {
-  const { data } = await request.post('/api/contract/section/serial/update', { id, bidsectionId, serial: parseInt(serial) })
+  const { data } = await request.post('/api/contract/section/serial/update', { id, bidsectionId, serial: parseInt(serial), treeType: consts.CONTRACT_TREE.RETURN })
   return data
 }
 
@@ -59,7 +60,7 @@ export async function apiUpdateSerial(id: string, bidsectionId: string, serial:
  * @param name 名称
  */
 export async function apiUpdateName(id: string, bidsectionId: string, name: string) {
-  const { data } = await request.post('/api/contract/section/save', { id, bidsectionId, name })
+  const { data } = await request.post('/api/contract/section/save', { id, bidsectionId, name, treeType: consts.CONTRACT_TREE.RETURN })
   return data
 }
 
@@ -98,6 +99,6 @@ export async function apiResfulContract(type: string, payload: object) {
     default:
       break
   }
-  const { data } = await request[method](url, payload)
+  const { data } = await request[method](url, { ...payload, treeType: consts.CONTRACT_TREE.RETURN })
   return data
 }

+ 2 - 2
src/pages/Contract/Content/Income/components/Modal/index.tsx

@@ -68,7 +68,7 @@ const ContractModal: React.FC<iModalCommonProps> = ({ modalObj: { type, visible,
     }
   }, [ visible ])
   const autoCodeHandler = async () => {
-    const { code = -1, data = "" } = await apiAutoCode(tenderStore.tender.bidsectionId, 'contractRule')
+    const { code = -1, data = "" } = await apiAutoCode(tenderStore.tender.bidsectionId, 'contractReturnRule')
     if (code === consts.RET_CODE.SUCCESS) {
       if (data) {
         const ruleArr: string[] = []
@@ -146,7 +146,7 @@ const ContractModal: React.FC<iModalCommonProps> = ({ modalObj: { type, visible,
               </Select>
             </Form.Item> */}
             <Form.Item name="price" label="合同金额" rules={[ { required: true, message: '请输入合同金额' } ]}>
-              <Input placeholder="输入合同金额" addonAfter={<span>元</span>}></Input>
+              <Input type="number" placeholder="输入合同金额" addonAfter={<span>元</span>}></Input>
             </Form.Item>
           </>
           ) : ''

+ 1 - 1
src/pages/Contract/Content/Income/components/TableContent/index.tsx

@@ -198,7 +198,7 @@ const GCsheet: React.FC<iTableContentPorps> = ({ modalHandler, row, setRow }) =>
       title: '状态',
       dataIndex: 'contractStatus',
       // eslint-disable-next-line react/display-name
-      render: (_: any, record: iIncomeTree) => record.contractCode ? <span><i className={contractConsts[record.contractStatus].className}></i>{contractConsts[record.contractStatus].text}</span> : ''
+      render: (_: any, record: iIncomeTree) => record.contractCode ? <span className={contractConsts[record.contractStatus].className}>{contractConsts[record.contractStatus].text}</span> : ''
     }
 
   ]

+ 2 - 2
src/pages/Contract/Content/Income/index.tsx

@@ -95,7 +95,7 @@ export default function Income() {
 
   const onRuleCreate = async (ruleValue: any) => {
     setRuleModal({ ...ruleModal, loading: true })
-    const { code = -1 } = await apiSaveRule({ bidsectionId: tenderStore.bid, type: 'contract_rule', rule: ruleValue })
+    const { code = -1 } = await apiSaveRule({ bidsectionId: tenderStore.bid, type: 'contract_return_rule', rule: ruleValue })
     if (code === consts.RET_CODE.SUCCESS) {
       message.success("规则更改成功!")
     }
@@ -178,7 +178,7 @@ export default function Income() {
       </Header>
       <TableContent modalHandler={modalHandler} row={row} setRow={(record: iIncomeTree) => setRow({ ...row, ...record })}></TableContent>
       <RuleModal
-        type={consts.RULE.CONTRACT}
+        type={consts.RULE.CONTRACT_RETURN}
         title="合同管理编号设置"
         visible={ruleModal.visible}
         onCreate={onRuleCreate}

+ 4 - 3
src/pages/Contract/Content/Spending/api.ts

@@ -1,4 +1,5 @@
 import request from '@/utils/common/request'
+import consts from '@/utils/consts'
 
 /**
  * 标段升降、上下移、增删
@@ -27,7 +28,7 @@ export async function apiResfulContractTree(type: string, payload: object) {
     default:
       break
   }
-  const { data } = await request[method](url, payload)
+  const { data } = await request[method](url, { ...payload, treeType: consts.CONTRACT_TREE.PAID })
   return data
 }
 
@@ -48,7 +49,7 @@ export async function apiGetExpenditure(id: string, bidsectionId: string) {
  * @param serial 序号
  */
 export async function apiUpdateSerial(id: string, bidsectionId: string, serial: string) {
-  const { data } = await request.post('/api/contract/section/serial/update', { id, bidsectionId, serial: parseInt(serial) })
+  const { data } = await request.post('/api/contract/section/serial/update', { id, bidsectionId, serial: parseInt(serial), treeType: consts.CONTRACT_TREE.PAID })
   return data
 }
 
@@ -59,7 +60,7 @@ export async function apiUpdateSerial(id: string, bidsectionId: string, serial:
  * @param name 名称
  */
 export async function apiUpdateName(id: string, bidsectionId: string, name: string) {
-  const { data } = await request.post('/api/contract/section/save', { id, bidsectionId, name })
+  const { data } = await request.post('/api/contract/section/save', { id, bidsectionId, name, treeType: consts.CONTRACT_TREE.PAID })
   return data
 }
 

+ 1 - 1
src/pages/Contract/Content/Spending/components/Modal/index.tsx

@@ -68,7 +68,7 @@ const ContractModal: React.FC<iModalCommonProps> = ({ modalObj: { type, visible,
     }
   }, [ visible ])
   const autoCodeHandler = async () => {
-    const { code = -1, data = "" } = await apiAutoCode(tenderStore.tender.bidsectionId, 'contractRule')
+    const { code = -1, data = "" } = await apiAutoCode(tenderStore.tender.bidsectionId, 'contractPaidRule')
     if (code === consts.RET_CODE.SUCCESS) {
       if (data) {
         const ruleArr: string[] = []

+ 1 - 1
src/pages/Contract/Content/Spending/components/TableContent/index.tsx

@@ -199,7 +199,7 @@ const GCsheet: React.FC<iTableContentPorps> = ({ modalHandler, row, setRow }) =>
       title: '状态',
       dataIndex: 'contractStatus',
       // eslint-disable-next-line react/display-name
-      render: (_: any, record: iIncomeTree) => record.contractCode ? <span><i className={contractConsts[record.contractStatus].className}></i>{contractConsts[record.contractStatus].text}</span> : ''
+      render: (_: any, record: iIncomeTree) => record.contractCode ? <span className={contractConsts[record.contractStatus].className}>{contractConsts[record.contractStatus].text}</span> : ''
     }
 
   ]

+ 2 - 2
src/pages/Contract/Content/Spending/index.tsx

@@ -95,7 +95,7 @@ export default function Expenditure() {
 
   const onRuleCreate = async (ruleValue: any) => {
     setRuleModal({ ...ruleModal, loading: true })
-    const { code = -1 } = await apiSaveRule({ bidsectionId: tenderStore.bid, type: 'contract_rule', rule: ruleValue })
+    const { code = -1 } = await apiSaveRule({ bidsectionId: tenderStore.bid, type: 'contract_paid_rule', rule: ruleValue })
     if (code === consts.RET_CODE.SUCCESS) {
       message.success("规则更改成功!")
     }
@@ -178,7 +178,7 @@ export default function Expenditure() {
       </Header>
       <TableContent modalHandler={modalHandler} row={row} setRow={(record: iIncomeTree) => setRow({ ...row, ...record })}></TableContent>
       <RuleModal
-        type={consts.RULE.CONTRACT}
+        type={consts.RULE.CONTRACT_PAID}
         title="合同管理编号设置"
         visible={ruleModal.visible}
         onCreate={onRuleCreate}

+ 4 - 35
src/pages/Quality/Content/Info/Detail/index.tsx

@@ -6,8 +6,9 @@ import Slot from '@/components/Header/slot'
 import OssUploadModal from '@/components/OssUpload'
 import SvgIcon from '@/components/SvgIcon'
 import { userStore } from '@/store/mobx'
+import { iDetailState } from '@/types/auditDetail'
 import { iFile } from '@/types/file'
-import { iAuditHistoryState, iAuditor, iLatestAuditorState, iRectifiedState } from '@/types/safe'
+import { iAuditor } from '@/types/safe'
 import { iUserInfo } from '@/types/setting'
 import { apiDelFile, apiGetFileList, apiSaveFileInfo } from '@/utils/common/api'
 import { auditProgress } from '@/utils/common/constStatus'
@@ -22,38 +23,6 @@ import { apiGetQualityDetail, apiResfulQualityAudit } from './api'
 import AuditModal from './components/Modal'
 import styles from './index.module.scss'
 const { TextArea } = Input
-interface iDetailState {
-  times: number
-  auditName: string
-  auditors: iAuditor[]
-  bidsectionId: string
-  uid: string
-  code: string
-  createTime: string | undefined
-  demand: string
-  file: iFileState
-  id: string
-  inspection: string
-  inspectionDetail: string
-  position: string
-  status: number
-  checkOrder: iModifiedOrder
-  auditHistory: iAuditHistoryState[][]
-  rectifiedInfo: iRectifiedState[]
-  latestAuditor: iLatestAuditorState
-}
-
-interface iModifiedOrder {
-  name: string
-  create_time: string | undefined
-  opinion: string
-  status: number
-}
-interface iFileState {
-  fileList: any[]
-  total: number
-}
-
 interface iModalObj {
   ossModal: boolean
   auditModal: boolean
@@ -287,7 +256,7 @@ const Detail: React.FC<RouteComponentProps> = props => {
 
   return (
     <div className="wrap-contaniner">
-      <Header title="安全巡检">
+      <Header title="质量巡检">
         <Slot position="right">{renderHeaderBtn(detail.status)}</Slot>
       </Header>
       <div className={styles.detailContainer}>
@@ -297,7 +266,7 @@ const Detail: React.FC<RouteComponentProps> = props => {
             <thead>
               <tr>
                 <th colSpan={2} className="pi-text-center">
-                  安全巡检单
+                  质量巡检单
                 </th>
               </tr>
             </thead>

+ 1 - 1
src/pages/Quality/Content/List/index.tsx

@@ -154,7 +154,7 @@ const QualityList:React.FC<{}> =() => {
 
   return (
     <div className="wrap-contaniner">
-      <Header title="巡检概况">
+      <Header title="质量巡检">
         <Slot position="right">
           {
             !list.length ?

+ 4 - 35
src/pages/Safe/Content/Info/Detail/index.tsx

@@ -6,13 +6,14 @@ import Slot from '@/components/Header/slot'
 import OssUploadModal from '@/components/OssUpload'
 import SvgIcon from '@/components/SvgIcon'
 import { userStore } from '@/store/mobx'
+import { iDetailState } from '@/types/auditDetail'
 import { iFile } from '@/types/file'
-import { iAuditHistoryState, iAuditor, iLatestAuditorState, iRectifiedState } from '@/types/safe'
+import { iAuditor } from '@/types/safe'
 import { iUserInfo } from '@/types/setting'
 import { apiDelFile, apiGetFileList, apiSaveFileInfo } from '@/utils/common/api'
-import { auditConsts, auditProgress } from '@/utils/common/constStatus'
+import { auditProgress } from '@/utils/common/constStatus'
 import consts from '@/utils/consts'
-import { dayjsFormat, formatDate } from '@/utils/util'
+import { dayjsFormat } from '@/utils/util'
 import { Button, Input, message, Pagination, Tooltip } from 'antd'
 import locale from 'antd/es/date-picker/locale/zh_CN'
 import dayjs from 'dayjs'
@@ -22,38 +23,6 @@ import { apiGetSafeDetail, apiResfulSafeAudit } from './api'
 import AuditModal from './components/Modal'
 import styles from './index.module.scss'
 const { TextArea } = Input
-interface iDetailState {
-  times: number
-  auditName: string
-  auditors: iAuditor[]
-  bidsectionId: string
-  uid: string
-  code: string
-  createTime: string | undefined
-  demand: string
-  file: iFileState
-  id: string
-  inspection: string
-  inspectionDetail: string
-  position: string
-  status: number
-  checkOrder: iModifiedOrder
-  auditHistory: iAuditHistoryState[][]
-  rectifiedInfo: iRectifiedState[]
-  latestAuditor: iLatestAuditorState
-}
-
-interface iModifiedOrder {
-  name: string
-  create_time: string | undefined
-  opinion: string
-  status: number
-}
-interface iFileState {
-  fileList: any[]
-  total: number
-}
-
 interface iModalObj {
   ossModal: boolean
   auditModal: boolean

+ 1 - 1
src/pages/Safe/Content/List/index.tsx

@@ -155,7 +155,7 @@ const SafeList:React.FC<{}> =() => {
 
   return (
     <div className="wrap-contaniner">
-      <Header title="巡检概况">
+      <Header title="安全巡检">
         <Slot position="right">
           {
             !list.length ?

+ 33 - 0
src/types/auditDetail.d.ts

@@ -0,0 +1,33 @@
+import { iAuditHistoryState, iLatestAuditorState, iRectifiedState } from "./safe"
+
+export interface iDetailState {
+  times: number
+  auditName: string
+  auditors: iAuditor[]
+  bidsectionId: string
+  uid: string
+  code: string
+  createTime: string | undefined
+  demand: string
+  file: iFileState
+  id: string
+  inspection: string
+  inspectionDetail: string
+  position: string
+  status: number
+  checkOrder: iModifiedOrder
+  auditHistory: iAuditHistoryState[][]
+  rectifiedInfo: iRectifiedState[]
+  latestAuditor: iLatestAuditorState
+}
+
+export interface iModifiedOrder {
+  name: string
+  create_time: string | undefined
+  opinion: string
+  status: number
+}
+export interface iFileState {
+  fileList: any[]
+  total: number
+}

+ 1 - 1
src/types/rule.d.ts

@@ -1,6 +1,6 @@
 export interface iRulePayload {
   bidsectionId: string
-  type: 'safe_rule' | 'quality_rule' | 'contract_rule'
+  type: 'safe_rule' | 'quality_rule' | 'contract_return_rule' | 'contract_paid_rule'
   rule: ruleOption[]
 }
 

+ 4 - 3
src/utils/consts.ts

@@ -9,8 +9,8 @@ export default {
   TOKEN_INVALID_CODE: [ 1 ], // 接口返回码如果是1 则表明token过期或无效 需要重新登录
   TOKEN_WHITE_LIST: [ '/api/login' ], // 不需要设置token的白名单
   RET_CODE: { SUCCESS: 0, FAIL: 1, TOKEN_UNDEFINED: 19, TOKEN_EXPIRED: 1 }, // 接口返回状态码
-  RETRY: { COUNT: 3, DELAY: 1000 }, // 请求重试次数/间隙
-  RULE: { SAFE: 'safeRule', QUALITY: 'qualityRule', CONTRACT: 'contractRule' }, // 编号规则弹窗常量
+  RETRY: { COUNT: 2, DELAY: 1000 }, // 请求重试次数/间隙
+  RULE: { SAFE: 'safeRule', QUALITY: 'qualityRule', CONTRACT_RETURN: 'contractReturnRule', CONTRACT_PAID: 'contractPaidRule' }, // 编号规则弹窗常量
   UPLOAD_WHITE: "(.json|.txt|.xls|.xlsx|.doc|.docx|.pdf|.ppt|.pptx|.png|.jpg|.jpeg|.gif|.bmp|.cad|.dwg|.zip|.rar|.7z)$"  , // 上传类型-白名单
   UPLOAD_LIMIT: 30, // 上传限制30MB
   DATA_TYPE: { RETURN: 1, QUALITY: 2, SAFE: 3, CONTRACT_RETURN: 4, PAID: 5, CONTRACT_PAID: 6 }, // 附件类型
@@ -18,6 +18,7 @@ export default {
   OSS_PATH: {
     REVIEW: 'https://file-upload.6jlzf.cn/',
     DOWNLOAD: 'https://measuresaas.oss-cn-shenzhen.aliyuncs.com/'
-  }
+  },
+  CONTRACT_TREE: { RETURN: 0, PAID: 1 } // 合同管理-树结构, 0 - 收入, 1- 支出
 }