Commit 78b8312b1222f8f9c958ec4b90f7312410a0f921

Authored by 曾国涛
1 parent 96450634

feat: 自行派送、金额不一致提醒。

src/pages/Order/components/DeliverModal.tsx
... ... @@ -205,6 +205,107 @@ const DeliverModal = ({
205 205 onCancel={() => {
206 206 setVisible(false);
207 207 }}
  208 + footer={[
  209 + <Button
  210 + key="back"
  211 + size="large"
  212 + onClick={() => {
  213 + setVisible(false);
  214 + }}
  215 + >
  216 + 取消
  217 + </Button>,
  218 + <Button
  219 + key="selfDeliver"
  220 + type="primary"
  221 + size="large"
  222 + onClick={async () => {
  223 + //请求体封装
  224 + let list = data.map((item) => {
  225 + return {
  226 + id: item.id,
  227 + deliverType: 'SELF_DELIVER',
  228 + };
  229 + });
  230 +
  231 + let body = { id: data[0].mainOrderId, list: list, flag: false };
  232 + if (isSendProduct) {
  233 + body.flag = true;
  234 + }
  235 + //发货请求
  236 + let res;
  237 + if (optType(CHECK_TYPE.SUPPLIER)) {
  238 + res = await postServiceOrderSupplierSendOrder({ data: body });
  239 + } else if (optType(CHECK_TYPE.PROCURE)) {
  240 + res = await postServiceOrderProcureSend({ data: body });
  241 + } else {
  242 + res = await postServiceOrderSendProduct({ data: body });
  243 + }
  244 +
  245 + if (res.result === RESPONSE_CODE.SUCCESS) {
  246 + message.success(res.message);
  247 + onClose();
  248 + }
  249 + }}
  250 + >
  251 + 自行派送
  252 + </Button>,
  253 + <Button
  254 + key="submit"
  255 + type="primary"
  256 + size="large"
  257 + onClick={async () => {
  258 + //请求体封装
  259 + let list = data.map((item) => {
  260 + return {
  261 + id: item.id,
  262 + logisticsMethod: item.logisticsMethod,
  263 + serialNumber: item.serialNumber,
  264 + packageNumber:
  265 + item.packageNumber === null ||
  266 + item.packageNumber === undefined
  267 + ? 1
  268 + : item.packageNumber,
  269 + logisticsNotes: item.logisticsNotes,
  270 + };
  271 + });
  272 +
  273 + for (let item of list) {
  274 + let method = item.logisticsMethod;
  275 + let notes = item.logisticsNotes;
  276 + if (
  277 + method === 'OTHER_LOGISTICS' &&
  278 + (notes === '' || notes === undefined)
  279 + ) {
  280 + message.error(
  281 + '请检查:物流方式为[其他物流方式]的记录中,物流备注不能为空!请将实际的物流方式填写在备注中!',
  282 + );
  283 + return;
  284 + }
  285 + }
  286 + let body = { id: data[0].mainOrderId, list: list, flag: false };
  287 + if (isSendProduct) {
  288 + body.flag = true;
  289 + }
  290 + //发货请求
  291 + let res;
  292 + if (optType(CHECK_TYPE.SUPPLIER)) {
  293 + res = await postServiceOrderSupplierSendOrder({ data: body });
  294 + } else if (optType(CHECK_TYPE.PROCURE)) {
  295 + res = await postServiceOrderProcureSend({ data: body });
  296 + } else {
  297 + res = await postServiceOrderSendProduct({ data: body });
  298 + }
  299 +
  300 + if (res.result === RESPONSE_CODE.SUCCESS) {
  301 + message.success(res.message);
  302 + onClose();
  303 + }
  304 + }}
  305 + >
  306 + 确认
  307 + </Button>,
  308 + ]}
208 309 >
209 310 <Flex vertical>
210 311 <strong>将物流方式和物流单号更新到下方所有订单</strong>
... ...
src/pages/Order/components/OrderDrawer.tsx
... ... @@ -105,6 +105,7 @@ export default ({ onClose, data, subOrders, orderOptType }) =&gt; {
105 105 let copyData = cloneDeep(data);
106 106  
107 107 let originSubOrders = cloneDeep(subOrders);
  108 +
108 109 /**
109 110 * 获取当前的操作类型boolean值
110 111 * @param type 操作类型,如果与当前匹配返回true
... ... @@ -571,11 +572,14 @@ export default ({ onClose, data, subOrders, orderOptType }) =&gt; {
571 572 };
572 573  
573 574 /**
574   - * 是否有草稿
575   - */
  575 + * 是否有草稿
  576 + */
576 577 function checkHasLocalData() {
577 578 let preOrderData = localStorage.getItem('preOrderData');
578   - let hasLocalData = preOrderData !== null && preOrderData !== undefined && preOrderData !== '';
  579 + let hasLocalData =
  580 + preOrderData !== null &&
  581 + preOrderData !== undefined &&
  582 + preOrderData !== '';
579 583 setHasLocalData(hasLocalData);
580 584 return hasLocalData;
581 585 }
... ... @@ -586,25 +590,25 @@ export default ({ onClose, data, subOrders, orderOptType }) =&gt; {
586 590 function saveFormDataToLocal() {
587 591 let preOrderData = localStorage.getItem('preOrderData');
588 592 let values = form.getFieldsValue();
589   - values.isLocalData = true;//标识为本地草稿数据
  593 + values.isLocalData = true; //标识为本地草稿数据
590 594 let formData = JSON.stringify(values);
591 595  
592 596 //检查本地是否已有数据
593 597 if (preOrderData) {
594 598 Modal.confirm({
595   - title: "提示",
596   - content: "检测到本地有订单数据,是否覆盖?",
  599 + title: '提示',
  600 + content: '检测到本地有订单数据,是否覆盖?',
597 601 onOk: () => {
598   - localStorage.setItem("preOrderData", formData);
599   - message.success("本地保存成功");
  602 + localStorage.setItem('preOrderData', formData);
  603 + message.success('本地保存成功');
600 604 },
601 605 onCancel: () => {
602   - message.info("取消保存");
603   - }
604   - })
  606 + message.info('取消保存');
  607 + },
  608 + });
605 609 } else {
606   - localStorage.setItem("preOrderData", formData);
607   - message.success("本地保存成功");
  610 + localStorage.setItem('preOrderData', formData);
  611 + message.success('本地保存成功');
608 612 }
609 613  
610 614 checkHasLocalData();
... ... @@ -625,11 +629,10 @@ export default ({ onClose, data, subOrders, orderOptType }) =&gt; {
625 629 /**
626 630 * 刪除草稿数据
627 631 */
628   - function removeLocalFormData(){
629   - localStorage.removeItem("preOrderData");
  632 + function removeLocalFormData() {
  633 + localStorage.removeItem('preOrderData');
630 634 }
631 635  
632   -
633 636 useEffect(() => {
634 637 checkHasLocalData();
635 638 getSalesCodeOptions();
... ... @@ -659,7 +662,7 @@ export default ({ onClose, data, subOrders, orderOptType }) =&gt; {
659 662 minWidth: 400,
660 663 }}
661 664 onFinishFailed={() => {
662   - message.error("表单项存在错误,请检查");
  665 + message.error('表单项存在错误,请检查');
663 666 setSubmitBtnLoading(false);
664 667 }}
665 668 submitter={{
... ... @@ -676,7 +679,7 @@ export default ({ onClose, data, subOrders, orderOptType }) =&gt; {
676 679 <Button
677 680 key="localSave"
678 681 loading={localSaveLoading}
679   - hidden={!optType('add') && !optType("copy")}
  682 + hidden={!optType('add') && !optType('copy')}
680 683 onClick={() => {
681 684 setLocalSaveLoading(true);
682 685 saveFormDataToLocal();
... ... @@ -692,7 +695,6 @@ export default ({ onClose, data, subOrders, orderOptType }) =&gt; {
692 695 onClick={() => {
693 696 setSubmitBtnLoading(true);
694 697 props.submit();
695   -
696 698 }}
697 699 >
698 700 提交
... ... @@ -705,7 +707,18 @@ export default ({ onClose, data, subOrders, orderOptType }) =&gt; {
705 707 drawerProps={{
706 708 destroyOnClose: true,
707 709 maskClosable: false,
708   - extra: [<Button key="useLocalData" hidden={!hasLocalData} type='link' onClick={() => { useLocalFormData() }}>使用草稿</Button>]
  710 + extra: [
  711 + <Button
  712 + key="useLocalData"
  713 + hidden={!hasLocalData}
  714 + type="link"
  715 + onClick={() => {
  716 + useLocalFormData();
  717 + }}
  718 + >
  719 + 使用草稿
  720 + </Button>,
  721 + ],
709 722 }}
710 723 submitTimeout={2000}
711 724 onFinish={async (values) => {
... ... @@ -779,8 +792,8 @@ export default ({ onClose, data, subOrders, orderOptType }) =&gt; {
779 792 onClose(true);
780 793  
781 794 //判断保存的数据是否是本地草稿,是的话将草稿删除
782   - let isLocalData = form.getFieldValue("isLocalData");
783   - if(isLocalData){
  795 + let isLocalData = form.getFieldValue('isLocalData');
  796 + if (isLocalData) {
784 797 removeLocalFormData();
785 798 checkHasLocalData();
786 799 }
... ... @@ -955,7 +968,7 @@ export default ({ onClose, data, subOrders, orderOptType }) =&gt; {
955 968 },
956 969 }}
957 970 debounceTime={1000}
958   - request={async (value, { }) => {
  971 + request={async (value, {}) => {
959 972 const keywords = value.keyWords;
960 973 const res = await postKingdeeRepCustomer({
961 974 data: { search: keywords },
... ... @@ -1170,6 +1183,20 @@ export default ({ onClose, data, subOrders, orderOptType }) =&gt; {
1170 1183 max: 1000, // 最大长度为1000个字符
1171 1184 message: '备注不能超过1000个字符',
1172 1185 },
  1186 + {
  1187 + validator: (rule, value) => {
  1188 + let totalPayment = form.getFieldValue('totalPayment');
  1189 + let list = form.getFieldValue('list');
  1190 + let reduce = list.reduce(
  1191 + (sum, item) => sum + item.subOrderPayment,
  1192 + 0,
  1193 + );
  1194 + if (reduce === totalPayment || value) {
  1195 + return Promise.resolve();
  1196 + }
  1197 + return Promise.reject(new Error('请填写订单金额不一致的原因'));
  1198 + },
  1199 + },
1173 1200 ]}
1174 1201 />
1175 1202  
... ... @@ -1364,7 +1391,7 @@ export default ({ onClose, data, subOrders, orderOptType }) =&gt; {
1364 1391 rules={[{ required: true, message: '商品参数必填' }]}
1365 1392 disabled={
1366 1393 productParametersDisabledFlagList[listMeta.index] !==
1367   - false || optType('after-sales-check')
  1394 + false || optType('after-sales-check')
1368 1395 }
1369 1396 />,
1370 1397 <ProFormDigit
... ... @@ -1405,7 +1432,7 @@ export default ({ onClose, data, subOrders, orderOptType }) =&gt; {
1405 1432 placeholder="请输入商品单位"
1406 1433 disabled={
1407 1434 productParametersDisabledFlagList[listMeta.index] !==
1408   - false || optType('after-sales-check')
  1435 + false || optType('after-sales-check')
1409 1436 }
1410 1437 rules={[{ required: true, message: '商品单位必填' }]}
1411 1438 />,
... ...
src/pages/Order/index.tsx
... ... @@ -79,6 +79,7 @@ import FinancialEditDrawer from &#39;./components/FinancialEditDrawer&#39;;
79 79 import FinancialMergeDrawer from './components/FinancialMergeDrawer';
80 80 import FinancialReceiptsModal from './components/FinancialReceiptsModal';
81 81 import HistoryModal from './components/HistoryModal';
  82 +import ImagesViewerModal from './components/ImagesViewerModal';
82 83 import ImportModal from './components/ImportModal';
83 84 import MessageListDrawer from './components/MessageListDrawer';
84 85 import ModifiedDiffModal from './components/ModifiedDiffModal';
... ... @@ -88,6 +89,7 @@ import ProcureCheckModal from &#39;./components/ProcureCheckModal&#39;;
88 89 import ProcureConvertModal from './components/ProcureConvertModal';
89 90 import ProductionTimeModal from './components/ProductionTimeModal';
90 91 import ShippingWarehouseChangeModal from './components/ShippingWarehouseChangeModal';
  92 +import UploadPayBillModal from './components/UploadPayBillModal';
91 93 import {
92 94 AFTER_INVOICING_STATUS,
93 95 CHECK_TYPE,
... ... @@ -109,18 +111,14 @@ import {
109 111 } from './constant';
110 112 import './index.less';
111 113 import { OrderListItemType, OrderType } from './type.d';
112   -import UploadPayBillModal from './components/UploadPayBillModal';
113   -import ImagesViewerModal from './components/ImagesViewerModal';
114 114  
115 115 const OrderPage = () => {
116 116 const [orderDrawerVisible, setOrderDrawerVisible] = useState<boolean>(false);
117 117 const [checkVisible, setCheckVisible] = useState<boolean>(false);
118 118 const [orderPrintVisible, setOrderPrintVisible] = useState<boolean>(false);
119 119 const [allMainChecked, setAllMainChecked] = useState(false);
120   - const [
121   - imagesViewerModalVisible,
122   - setImagesViewerModalVisible,
123   - ] = useState<boolean>(false);
  120 + const [imagesViewerModalVisible, setImagesViewerModalVisible] =
  121 + useState<boolean>(false);
124 122 const [data, setData] = useState([]); //列表数据
125 123 const [notesEditVisible, setNotesEditVisible] = useState<boolean>(false);
126 124 const [financialMergeDrawerVisible, setFinancialMergeDrawerVisible] =
... ... @@ -174,7 +172,7 @@ const OrderPage = () =&gt; {
174 172 const [pageSize, setPageSize] = useState(10);
175 173 const [currentPage, setCurrentPage] = useState(1);
176 174 const [orderCheckType, setOrderCheckType] = useState('');
177   - const [imagesViewerOptType,setImagesViewerOptType] = useState('');
  175 + const [imagesViewerOptType, setImagesViewerOptType] = useState('');
178 176 const [filterCondifion, setFilterCondition] = useState(0);
179 177 const [mainOrderSelectedMap] = useState(new Map()); //选中的主订单Map key:主订单id value:主订单数据
180 178 const [subOrderSelectedMap] = useState(new Map()); //选中的子订单Map key:主订单id value:选中的子订单数据集合
... ... @@ -764,7 +762,7 @@ const OrderPage = () =&gt; {
764 762 onConfirm={() => {
765 763 window.open(
766 764 '/previewApi/onlinePreview?url=' +
767   - encodeURIComponent(Base64.encode(item.url)),
  765 + encodeURIComponent(Base64.encode(item.url)),
768 766 );
769 767 }}
770 768 onCancel={() => {
... ... @@ -836,7 +834,7 @@ const OrderPage = () =&gt; {
836 834 </span>
837 835 {(roleCode === 'salesRepresentative' ||
838 836 roleCode === 'salesManager') &&
839   - !optRecord.isCurrentUserOrder ? (
  837 + !optRecord.isCurrentUserOrder ? (
840 838 <span className="text-[#f44e4e]">(非本账号订单)</span>
841 839 ) : (
842 840 ''
... ... @@ -918,7 +916,7 @@ const OrderPage = () =&gt; {
918 916 {(roleCode === 'procure' ||
919 917 roleCode === 'warehouseKeeper' ||
920 918 roleCode === 'admin') &&
921   - !isSupplier() ? (
  919 + !isSupplier() ? (
922 920 <>
923 921 <Flex title={optRecord.supplierName}>
924 922 <div className="max-w-[90%] whitespace-no-wrap overflow-hidden overflow-ellipsis">
... ... @@ -1055,20 +1053,29 @@ const OrderPage = () =&gt; {
1055 1053 {/* 回款审核状态 */}
1056 1054 {optRecord.paymentReceiptStatus !== null ? (
1057 1055 <div className="overflow-hidden whitespace-no-wrap overflow-ellipsis">
1058   - <Tag className='hover:cursor-pointer'
  1056 + <Tag
  1057 + className="hover:cursor-pointer"
1059 1058 onMouseEnter={(e: any) => {
1060   - e.target.innerText = "点击查看回款凭证"
  1059 + e.target.innerText = '点击查看回款凭证';
1061 1060 }}
1062 1061 onMouseLeave={(e: any) => {
1063   - e.target.innerText = enumValueToLabel(optRecord.paymentReceiptStatus, PAYMENT_RECEIPTS_STATUS_OPTIONS);
  1062 + e.target.innerText = enumValueToLabel(
  1063 + optRecord.paymentReceiptStatus,
  1064 + PAYMENT_RECEIPTS_STATUS_OPTIONS,
  1065 + );
1064 1066 }}
1065   - onClick={()=>{
1066   - createOptObject(optRecord.id,record.id);
1067   - setImagesViewerOptType("paymentReceipt");
  1067 + onClick={() => {
  1068 + createOptObject(optRecord.id, record.id);
  1069 + setImagesViewerOptType('paymentReceipt');
1068 1070 setImagesViewerModalVisible(true);
1069 1071 }}
1070   - key="key" color={TAGS_COLOR.get(optRecord.paymentReceiptStatus)}>
1071   - {enumValueToLabel(optRecord.paymentReceiptStatus, PAYMENT_RECEIPTS_STATUS_OPTIONS)}
  1072 + key="key"
  1073 + color={TAGS_COLOR.get(optRecord.paymentReceiptStatus)}
  1074 + >
  1075 + {enumValueToLabel(
  1076 + optRecord.paymentReceiptStatus,
  1077 + PAYMENT_RECEIPTS_STATUS_OPTIONS,
  1078 + )}
1072 1079 </Tag>
1073 1080 </div>
1074 1081 ) : (
... ... @@ -1110,21 +1117,23 @@ const OrderPage = () =&gt; {
1110 1117 )}
1111 1118  
1112 1119 {/* 开票状态 */}
1113   - {optRecord.afterInvoicingStatus !== null ?
  1120 + {optRecord.afterInvoicingStatus !== null ? (
1114 1121 <div className="overflow-hidden whitespace-no-wrap overflow-ellipsis">
1115 1122 <Tooltip
1116 1123 title={
1117 1124 optRecord.invoicingUrgentCause !== null &&
1118   - optRecord.afterInvoicingStatus ===
  1125 + optRecord.afterInvoicingStatus ===
1119 1126 'URGENT_INVOICE_AUDITING'
1120 1127 ? optRecord.invoicingUrgentCause
1121 1128 : enumValueToLabel(
1122   - optRecord.afterInvoicingStatus,
1123   - AFTER_INVOICING_STATUS,
1124   - )
  1129 + optRecord.afterInvoicingStatus,
  1130 + AFTER_INVOICING_STATUS,
  1131 + )
1125 1132 }
1126 1133 >
1127   - <Tag color={TAGS_COLOR.get(optRecord.afterInvoicingStatus)}>
  1134 + <Tag
  1135 + color={TAGS_COLOR.get(optRecord.afterInvoicingStatus)}
  1136 + >
1128 1137 {enumValueToLabel(
1129 1138 optRecord.afterInvoicingStatus,
1130 1139 AFTER_INVOICING_STATUS,
... ... @@ -1132,8 +1141,9 @@ const OrderPage = () =&gt; {
1132 1141 </Tag>
1133 1142 </Tooltip>
1134 1143 </div>
1135   - : ""
1136   - }
  1144 + ) : (
  1145 + ''
  1146 + )}
1137 1147  
1138 1148 {/* 是否加急图标显示 */}
1139 1149 {optRecord.isUrgent ? (
... ... @@ -1149,7 +1159,7 @@ const OrderPage = () =&gt; {
1149 1159 )}
1150 1160  
1151 1161 {(roleCode === 'warehouseKeeper' || roleCode === 'admin') &&
1152   - optRecord.shippingWarehouse !== null ? (
  1162 + optRecord.shippingWarehouse !== null ? (
1153 1163 <div
1154 1164 className="overflow-hidden whitespace-no-wrap overflow-ellipsis"
1155 1165 title={enumValueToLabel(
... ... @@ -1171,7 +1181,7 @@ const OrderPage = () =&gt; {
1171 1181 {/* 生产时间 */}
1172 1182 <div className="overflow-hidden whitespace-no-wrap overflow-ellipsis">
1173 1183 {optRecord.productionStartTime !== null ||
1174   - optRecord.productionEndTime !== null ? (
  1184 + optRecord.productionEndTime !== null ? (
1175 1185 <MyToolTip
1176 1186 title={
1177 1187 formatdate(optRecord.productionStartTime) +
... ... @@ -1201,7 +1211,7 @@ const OrderPage = () =&gt; {
1201 1211 <Tag
1202 1212 color={
1203 1213 optRecord.invoicingTime === null ||
1204   - optRecord.invoicingTime === undefined
  1214 + optRecord.invoicingTime === undefined
1205 1215 ? TAGS_COLOR.get(optRecord.invoicingStatus)
1206 1216 : 'success'
1207 1217 }
... ... @@ -1229,7 +1239,7 @@ const OrderPage = () =&gt; {
1229 1239  
1230 1240 {/**采购是否已下单状态 */}
1231 1241 {optRecord.procureOrderStatus !== null &&
1232   - optRecord.procureOrderStatus !== undefined ? (
  1242 + optRecord.procureOrderStatus !== undefined ? (
1233 1243 <div className="overflow-hidden whitespace-no-wrap overflow-ellipsis">
1234 1244 <Tag color="success">
1235 1245 {enumValueToLabel(
... ... @@ -1245,21 +1255,23 @@ const OrderPage = () =&gt; {
1245 1255 {/* 物流信息 */}
1246 1256 <div className="overflow-hidden whitespace-no-wrap overflow-ellipsis">
1247 1257 {optRecord.orderStatus === 'CONFIRM_RECEIPT' ||
1248   - optRecord.orderStatus === 'AFTER_SALES_COMPLETION' ||
1249   - optRecord.orderStatus === 'IN_AFTER_SALES' ||
1250   - optRecord.orderStatus === 'SHIPPED' ? (
  1258 + optRecord.orderStatus === 'AFTER_SALES_COMPLETION' ||
  1259 + optRecord.orderStatus === 'IN_AFTER_SALES' ||
  1260 + optRecord.orderStatus === 'SHIPPED' ? (
1251 1261 <MyToolTip
1252 1262 title={
1253   - optRecord.serialNumber === undefined
1254   - ? '暂无物流信息'
1255   - : enumValueToLabel(
1256   - optRecord.logisticsMethod,
1257   - LOGISTICS_STATUS_OPTIONS,
1258   - ) +
1259   - ' ' +
1260   - optRecord.serialNumber +
1261   - ' ' +
1262   - optRecord.logisticsNotes
  1263 + optRecord.serialNumber
  1264 + ? enumValueToLabel(
  1265 + optRecord.logisticsMethod,
  1266 + LOGISTICS_STATUS_OPTIONS,
  1267 + ) +
  1268 + ' ' +
  1269 + optRecord.serialNumber +
  1270 + ' ' +
  1271 + optRecord.logisticsNotes
  1272 + : optRecord.deliverType
  1273 + ? '自行派送'
  1274 + : '暂无物流信息'
1263 1275 }
1264 1276 content={
1265 1277 <Button type="link" size="small" style={{ padding: 0 }}>
... ... @@ -1273,7 +1285,7 @@ const OrderPage = () =&gt; {
1273 1285  
1274 1286 {/* 修改审核状态 */}
1275 1287 {optRecord.modifiedAuditStatus !== null &&
1276   - optRecord.modifiedAuditStatus !== 'AUDIT_FAILURE' ? (
  1288 + optRecord.modifiedAuditStatus !== 'AUDIT_FAILURE' ? (
1277 1289 <div className="overflow-hidden whitespace-no-wrap overflow-ellipsis">
1278 1290 <Tooltip
1279 1291 title={enumValueToLabel(
... ... @@ -1318,7 +1330,6 @@ const OrderPage = () =&gt; {
1318 1330 </div>
1319 1331 </Flex>
1320 1332 <Flex className="w-[18%]" wrap="wrap" gap="small">
1321   -
1322 1333 {optRecord.subPath?.includes('uploadPaymentReceiptBill') ? (
1323 1334 <Button
1324 1335 className="p-0"
... ... @@ -1334,7 +1345,6 @@ const OrderPage = () =&gt; {
1334 1345 ''
1335 1346 )}
1336 1347  
1337   -
1338 1348 {optRecord.subPath?.includes('leaderAudit') ? (
1339 1349 <Button
1340 1350 className="p-0"
... ... @@ -1572,7 +1582,7 @@ const OrderPage = () =&gt; {
1572 1582 )}
1573 1583  
1574 1584 {optRecord.subPath?.includes('queryAnnex') &&
1575   - optRecord.listAnnex?.length > 0 ? (
  1585 + optRecord.listAnnex?.length > 0 ? (
1576 1586 <Button
1577 1587 className="p-0"
1578 1588 type="link"
... ... @@ -1914,7 +1924,7 @@ const OrderPage = () =&gt; {
1914 1924 type="link"
1915 1925 onClick={() => {
1916 1926 createOptObject(optRecord.id, record.id);
1917   - setImagesViewerOptType("shippingReceipt");
  1927 + setImagesViewerOptType('shippingReceipt');
1918 1928 setImagesViewerModalVisible(true);
1919 1929 }}
1920 1930 >
... ... @@ -1947,9 +1957,9 @@ const OrderPage = () =&gt; {
1947 1957 </Flex>
1948 1958  
1949 1959 {roleCode === 'admin' ||
1950   - roleCode === 'salesManager' ||
1951   - roleCode === 'salesRepresentative' ||
1952   - roleCode === 'finance' ? (
  1960 + roleCode === 'salesManager' ||
  1961 + roleCode === 'salesRepresentative' ||
  1962 + roleCode === 'finance' ? (
1953 1963 <Flex title={optRecord.notes}>
1954 1964 <div className="flex items-center">
1955 1965 <div className="flex items-center max-w-[500px]">
... ... @@ -1961,7 +1971,7 @@ const OrderPage = () =&gt; {
1961 1971 <span className="text-[#8C8C8C]">
1962 1972 申请开票备注:
1963 1973 {optRecord.applyInvoicingNotes === undefined ||
1964   - optRecord.applyInvoicingNotes === null
  1974 + optRecord.applyInvoicingNotes === null
1965 1975 ? '暂无备注'
1966 1976 : optRecord.applyInvoicingNotes}
1967 1977 </span>
... ... @@ -1989,7 +1999,7 @@ const OrderPage = () =&gt; {
1989 1999 <span className="text-[#8C8C8C] mr-3">
1990 2000 财务审核备注:
1991 2001 {optRecord.checkNotes === undefined ||
1992   - optRecord.checkNotes === null
  2002 + optRecord.checkNotes === null
1993 2003 ? '暂无备注'
1994 2004 : optRecord.checkNotes}
1995 2005 </span>
... ... @@ -2282,9 +2292,9 @@ const OrderPage = () =&gt; {
2282 2292 <span className="text-slate-700">
2283 2293 {record.receivingCompany !== null
2284 2294 ? enumValueToLabel(
2285   - record.receivingCompany,
2286   - getReceivingCompanyOptions(PAYEE_OPTIONS),
2287   - )
  2295 + record.receivingCompany,
  2296 + getReceivingCompanyOptions(PAYEE_OPTIONS),
  2297 + )
2288 2298 : '暂无'}
2289 2299 </span>
2290 2300 </div>
... ... @@ -2325,44 +2335,43 @@ const OrderPage = () =&gt; {
2325 2335 ''
2326 2336 )}
2327 2337  
2328   - {
2329   - record.goodsWeight !== null ?
2330   - <div title={record.goodsWeight + "kg"} className='pl-3'>
2331   - <div
2332   - className="max-w-md overflow-hidden whitespace-no-wrap overflow-ellipsis hover:cursor-pointer"
2333   - onClick={() => {
2334   - copyToClipboard(record.goodsWeight + "kg");
2335   - message.info('包裹重量复制成功:' + record.goodsWeight + "kg");
2336   - }}
2337   - >
2338   - <span className="text-[#8C8C8C]">包裹重量:</span>
2339   - <span className="ml-2">
2340   - {record.goodsWeight + "kg"}
2341   - </span>
2342   - </div>
  2338 + {record.goodsWeight !== null ? (
  2339 + <div title={record.goodsWeight + 'kg'} className="pl-3">
  2340 + <div
  2341 + className="max-w-md overflow-hidden whitespace-no-wrap overflow-ellipsis hover:cursor-pointer"
  2342 + onClick={() => {
  2343 + copyToClipboard(record.goodsWeight + 'kg');
  2344 + message.info(
  2345 + '包裹重量复制成功:' + record.goodsWeight + 'kg',
  2346 + );
  2347 + }}
  2348 + >
  2349 + <span className="text-[#8C8C8C]">包裹重量:</span>
  2350 + <span className="ml-2">{record.goodsWeight + 'kg'}</span>
2343 2351 </div>
2344   - : ""
2345   - }
  2352 + </div>
  2353 + ) : (
  2354 + ''
  2355 + )}
2346 2356  
2347   - {
2348   - record.goodsVolume !== null ?
2349   - <div title={record.goodsVolume + "m³"} className='pl-3'>
2350   - <div
2351   - className="max-w-md overflow-hidden whitespace-no-wrap overflow-ellipsis hover:cursor-pointer"
2352   - onClick={() => {
2353   - copyToClipboard(record.goodsVolume + "m³");
2354   - message.info('包裹体积复制成功:' + record.goodsVolume + "m³");
2355   - }}
2356   - >
2357   - <span className="text-[#8C8C8C]">包裹体积:</span>
2358   - <span className="ml-2">
2359   - {record.goodsVolume + "m³"}
2360   - </span>
2361   - </div>
  2357 + {record.goodsVolume !== null ? (
  2358 + <div title={record.goodsVolume + 'm³'} className="pl-3">
  2359 + <div
  2360 + className="max-w-md overflow-hidden whitespace-no-wrap overflow-ellipsis hover:cursor-pointer"
  2361 + onClick={() => {
  2362 + copyToClipboard(record.goodsVolume + 'm³');
  2363 + message.info(
  2364 + '包裹体积复制成功:' + record.goodsVolume + 'm³',
  2365 + );
  2366 + }}
  2367 + >
  2368 + <span className="text-[#8C8C8C]">包裹体积:</span>
  2369 + <span className="ml-2">{record.goodsVolume + 'm³'}</span>
2362 2370 </div>
2363   - : ""
2364   - }
2365   -
  2371 + </div>
  2372 + ) : (
  2373 + ''
  2374 + )}
2366 2375 </Flex>
2367 2376 </Flex>
2368 2377 <Flex wrap="wrap" gap="middle" vertical>
... ... @@ -2930,9 +2939,9 @@ const OrderPage = () =&gt; {
2930 2939 for (let i = 0; i < selectedSubOrders.length; i++) {
2931 2940 if (
2932 2941 selectedSubOrders[i].invoicingStatus ===
2933   - 'UN_INVOICE' ||
  2942 + 'UN_INVOICE' ||
2934 2943 selectedSubOrders[i].afterInvoicingStatus ===
2935   - 'APPLY_FOR_INVOICING'
  2944 + 'APPLY_FOR_INVOICING'
2936 2945 ) {
2937 2946 message.error(
2938 2947 '请选择需要开票且未申请开票的子订单进行申请',
... ... @@ -3121,13 +3130,13 @@ const OrderPage = () =&gt; {
3121 3130 if (
3122 3131 selectedSubOrders[i].orderStatus !== 'AUDITED' &&
3123 3132 selectedSubOrders[i].orderStatus !==
3124   - 'PROCURE_PROCESS' &&
  3133 + 'PROCURE_PROCESS' &&
3125 3134 selectedSubOrders[i].orderStatus !==
3126   - 'PROCURE_PROCESS_FOR_MINE' &&
  3135 + 'PROCURE_PROCESS_FOR_MINE' &&
3127 3136 selectedSubOrders[i].orderStatus !==
3128   - 'PROCURE_WAIT_SHIP' &&
  3137 + 'PROCURE_WAIT_SHIP' &&
3129 3138 selectedSubOrders[i].orderStatus !==
3130   - 'SUPPLIER_WAIT_SHIP' &&
  3139 + 'SUPPLIER_WAIT_SHIP' &&
3131 3140 selectedSubOrders[i].orderStatus !== 'WAIT_SHIP'
3132 3141 ) {
3133 3142 message.error(
... ... @@ -3214,9 +3223,9 @@ const OrderPage = () =&gt; {
3214 3223 if (
3215 3224 selectedSubOrders[i].orderStatus !== 'UNAUDITED' &&
3216 3225 selectedSubOrders[i].orderStatus !==
3217   - 'FINANCE_PROCESS' &&
  3226 + 'FINANCE_PROCESS' &&
3218 3227 selectedSubOrders[i].orderStatus !==
3219   - 'LEADER_AUDITED'
  3228 + 'LEADER_AUDITED'
3220 3229 ) {
3221 3230 message.error(
3222 3231 '请选择[未审核]、[财务待审核]、[领导已审核]的子订单进行审核',
... ... @@ -3284,9 +3293,9 @@ const OrderPage = () =&gt; {
3284 3293 for (let i = 0; i < selectedSubOrders.length; i++) {
3285 3294 if (
3286 3295 selectedSubOrders[i].orderStatus !==
3287   - 'CONFIRM_RECEIPT' &&
  3296 + 'CONFIRM_RECEIPT' &&
3288 3297 selectedSubOrders[i].orderStatus !==
3289   - 'AFTER_SALES_FAILURE'
  3298 + 'AFTER_SALES_FAILURE'
3290 3299 ) {
3291 3300 message.error('请选择确认收货状态的子订单进行售后');
3292 3301 return;
... ... @@ -3490,10 +3499,7 @@ const OrderPage = () =&gt; {
3490 3499 (item) => {
3491 3500 //首能账号只能搜索订单编号
3492 3501 let canSearchIndex = ['id', 'salesCode', 'subNotes', 'orderStatus'];
3493   - if (
3494   - isSupplier() &&
3495   - !canSearchIndex.includes(item.dataIndex)
3496   - ) {
  3502 + if (isSupplier() && !canSearchIndex.includes(item.dataIndex)) {
3497 3503 item.search = false;
3498 3504 }
3499 3505 if (item.dataIndex === 'name') {
... ... @@ -3521,10 +3527,7 @@ const OrderPage = () =&gt; {
3521 3527 /**
3522 3528 * 采购可以筛选供应商备注
3523 3529 */
3524   - if (
3525   - (roleCode === 'procure' || roleCode === 'admin') &&
3526   - !isSupplier()
3527   - ) {
  3530 + if ((roleCode === 'procure' || roleCode === 'admin') && !isSupplier()) {
3528 3531 mainOrdersColumns.push({
3529 3532 title: '供应商备注',
3530 3533 width: 120,
... ... @@ -3537,10 +3540,7 @@ const OrderPage = () =&gt; {
3537 3540 /**
3538 3541 * 采购可以筛选其他采购
3539 3542 */
3540   - if (
3541   - (roleCode === 'procure' || roleCode === 'admin') &&
3542   - !isSupplier()
3543   - ) {
  3543 + if ((roleCode === 'procure' || roleCode === 'admin') && !isSupplier()) {
3544 3544 mainOrdersColumns.push({
3545 3545 title: '采购名称',
3546 3546 width: 120,
... ... @@ -3687,7 +3687,7 @@ const OrderPage = () =&gt; {
3687 3687  
3688 3688 const exportMenuProps = {
3689 3689 items: exportItems,
3690   - onClick: () => { },
  3690 + onClick: () => {},
3691 3691 };
3692 3692  
3693 3693 //导出按钮配置
... ... @@ -3723,7 +3723,7 @@ const OrderPage = () =&gt; {
3723 3723  
3724 3724 const auditProps = {
3725 3725 items: auditItems,
3726   - onClick: () => { },
  3726 + onClick: () => {},
3727 3727 };
3728 3728  
3729 3729 if (rolePath?.includes('leaderMergeAudit')) {
... ... @@ -3831,8 +3831,8 @@ const OrderPage = () =&gt; {
3831 3831 if (errorIds.size > 0) {
3832 3832 message.error(
3833 3833 '订单号为:' +
3834   - [...errorIds.values()].join(',') +
3835   - '的订单存在不是[申请开票]或者[部分开票]状态的子订单,请检查!',
  3834 + [...errorIds.values()].join(',') +
  3835 + '的订单存在不是[申请开票]或者[部分开票]状态的子订单,请检查!',
3836 3836 );
3837 3837 return;
3838 3838 }
... ... @@ -4271,7 +4271,7 @@ const OrderPage = () =&gt; {
4271 4271  
4272 4272 {imagesViewerModalVisible && (
4273 4273 <ImagesViewerModal
4274   - optType={imagesViewerOptType}
  4274 + optType={imagesViewerOptType}
4275 4275 setVisible={(val: boolean) => {
4276 4276 setImagesViewerModalVisible(val);
4277 4277 if (!val) {
... ...