Sfoglia il codice sorgente

update: 收货增加异常上报

xyh 2 anni fa
parent
commit
b932909d84
2 ha cambiato i file con 36 aggiunte e 1 eliminazioni
  1. 28 0
      src/pages/receive/exception/index.jsx
  2. 8 1
      src/pages/receive/index.jsx

+ 28 - 0
src/pages/receive/exception/index.jsx

@@ -0,0 +1,28 @@
+import {View, Text, Textarea} from '@tarojs/components';
+import {Switch} from '@nutui/nutui-react-taro';
+import classNames from 'classnames';
+
+export default function Exception({checked, onChange}) {
+  return (
+    <>
+      <View className='flex items-center'>
+        <Switch
+          activeColor='#58C6EA'
+          activeText='是'
+          inactiveText='否'
+          checked={checked}
+          onChange={onChange}
+        />
+        <Text className='text-sm text-[#999] ml-2'>是否异常</Text>
+      </View>
+
+      <Textarea
+        className={classNames(
+          'border border-solid border-gray-200 rounded-md mt-3 w-[calc(100%-32px)] p-4',
+          {hidden: !checked},
+        )}
+        placeholder='请输入异常原因'
+      />
+    </>
+  );
+}

+ 8 - 1
src/pages/receive/index.jsx

@@ -5,10 +5,13 @@ import {useScanOrder} from '@hooks';
 import {Button} from '@nutui/nutui-react-taro';
 import {useUpload} from './hooks';
 import Upload from './upload';
+import Exception from './exception';
+import {useBoolean} from 'ahooks';
 
 export default function Receive() {
   const [{goodsList, customerNo, truckNo}, onScan] = useScanOrder();
   const [files, {onRemove, onAdd}] = useUpload();
+  const [checked, {set: onChange}] = useBoolean();
 
   return (
     <View className='h-screen overflow-auto bg-gray-100 flex flex-col'>
@@ -45,10 +48,14 @@ export default function Receive() {
         </View>
       ) : null}
 
-      <View className='mt-3 bg-white px-4 py-2  mb-10'>
+      <View className='mt-3 bg-white px-4 py-2'>
         <Upload files={files} onDelete={onRemove} onAdd={onAdd} />
       </View>
 
+      <View className='mt-3 bg-white px-4 py-2 mb-10'>
+        <Exception checked={checked} onChange={onChange} />
+      </View>
+
       <View className='flex mt-auto justify-around pb-12'>
         <Button className='w-36' onClick={onScan}>
           扫码