فهرست منبع

工时上报 样式修复

XuZinan 2 سال پیش
والد
کامیت
9bfc1e5ff4

+ 6 - 8
src/pages/PurchaseAdmin/PurchaseList/WorkingHours/WorkList.js

@@ -10,12 +10,12 @@ function WorkList(props) {
     {
       title: '分类',
       dataIndex: 'type_id',
-      width: '30%',
+      width: '25%',
       render: type_id => allType[type_id]?.name,
     },
     {
       title: '所属项目',
-      width: '40%',
+      width: '30%',
       render: item => {
         if (item.zIndex === 0) return '';
         return item.Project?.Name || '-';
@@ -41,14 +41,16 @@ function WorkList(props) {
             min={0}
             step={0.5}
             defaultValue={item?.workload}
-            onChange={value => onChange(value, `${item.type_id}.${item.project_id}.${item.time}`)}
+            onChange={value => {
+              workHour[`${item.type_id}.${item.project_id}.${item.time}`] = value;
+            }}
           />
         );
       },
     },
     {
       title: '操作',
-      width: 140,
+      width: '15%',
       render: item => {
         if (item.zIndex === 0) return '';
         if (item.audit_state == 1 || item.audit_state == 2) return;
@@ -95,10 +97,6 @@ function WorkList(props) {
     }
   };
 
-  const onChange = (value, name) => {
-    workHour[name] = value;
-  };
-
   const onHandleSave = (item, data) => {
     let currentWorkload = list.reduce((total, temp) => {
       if (temp.id == item.id) return total;

+ 2 - 2
src/pages/PurchaseAdmin/PurchaseList/WorkingHours/index.js

@@ -318,14 +318,14 @@ function List(props) {
     <div>
       <Spin spinning={loading}>
         <Row gutter={8}>
-          <Col span={12}>
+          <Col span={10}>
             <Calendar
               value={current.date}
               dateCellRender={dateCellRender}
               onChange={onChangeDate}
             />
           </Col>
-          <Col span={12}>
+          <Col span={14}>
             <div>
               <Button type="primary" style={{ marginBottom: 20 }} onClick={() => setVisible(true)}>
                 新增