Commit c4c7f26339f5a526e85804f752e60218511ee771

Authored by zhongnanhuang
2 parents 642d0aa2 59db6e31

feat: update 与金蝶功能分支合并

Too many changes to show.

To preserve performance only 5 of 7 files are displayed.

src/pages/Order/components/KingdeeCustomerModal.tsx 0 → 100644
  1 +import {
  2 + postKingdeeRepCustomerDetail,
  3 + postKingdeeRepCustomerSave,
  4 +} from '@/services';
  5 +import { getTeacherCustomFieldNumber } from '@/utils/kingdee';
  6 +import { CloseCircleOutlined } from '@ant-design/icons';
  7 +import {
  8 + ModalForm,
  9 + ProFormGroup,
  10 + ProFormList,
  11 + ProFormText,
  12 +} from '@ant-design/pro-components';
  13 +import { Form, message } from 'antd';
  14 +
  15 +// import { cloneDeep } from 'lodash';
  16 +export default ({ setVisible, data, onClose }) => {
  17 + const [form] = Form.useForm();
  18 + console.log(data);
  19 +
  20 + /**
  21 + * 回显客户信息
  22 + * @param id
  23 + */
  24 + async function queryAndShowCustomer(id: any) {
  25 + //查询客户信息
  26 + let res = await postKingdeeRepCustomerDetail({
  27 + data: {
  28 + id: id,
  29 + },
  30 + });
  31 +
  32 + if (res) {
  33 + form.setFieldValue('name', res.name);
  34 + form.setFieldValue('id', res.id);
  35 + form.setFieldValue('contact_persons', res.bomentity);
  36 + let customFiledNumber = await getTeacherCustomFieldNumber();
  37 + form.setFieldValue('teacherName', res.custom_field[customFiledNumber]);
  38 + }
  39 + }
  40 +
  41 + if (data) {
  42 + //修改
  43 + if (data.id) {
  44 + queryAndShowCustomer(data.id);
  45 + } else {
  46 + //新增
  47 + form.setFieldValue('name', data.name);
  48 + form.setFieldValue('contact_persons', [{}]);
  49 + }
  50 + }
  51 + return (
  52 + <>
  53 + <ModalForm
  54 + width={900}
  55 + open
  56 + title="客户信息"
  57 + form={form}
  58 + autoFocusFirstInput
  59 + modalProps={{
  60 + okText: '保存',
  61 + cancelText: '取消',
  62 + destroyOnClose: true,
  63 + onCancel: () => {
  64 + setVisible(false);
  65 + },
  66 + }}
  67 + onFinish={async (values) => {
  68 + //查询客户自定义字段,课题组
  69 + let custom_field_umber = await getTeacherCustomFieldNumber();
  70 +
  71 + if (custom_field_umber) {
  72 + let customFieldObj = {};
  73 + customFieldObj[custom_field_umber] = values.teacherName;
  74 + values.custom_field = customFieldObj;
  75 + }
  76 + let customSaveRes = await postKingdeeRepCustomerSave({
  77 + data: values,
  78 + });
  79 + if (customSaveRes) {
  80 + let id_number_map = customSaveRes.id_number_map;
  81 + let ids = customSaveRes.ids;
  82 + if (id_number_map && ids) {
  83 + message.success('保存成功');
  84 + let id = ids[0];
  85 + onClose(id);
  86 + }
  87 + }
  88 + }}
  89 + onOpenChange={setVisible}
  90 + >
  91 + <ProFormText key="key" name="id" label="id" placeholder="id" hidden />
  92 + <ProFormGroup key="group">
  93 + <ProFormText
  94 + name="name"
  95 + width="md"
  96 + label="客户名称"
  97 + initialValue={data}
  98 + placeholder="请输入客户名称"
  99 + rules={[
  100 + {
  101 + required: true,
  102 + pattern: new RegExp('^.+-.+$'),
  103 + message:
  104 + '格式错误,请按照:“单位-名称” 命名,若无单位可写:“无-名称”',
  105 + },
  106 + { required: true, message: '客户名称必填' },
  107 + ]}
  108 + />
  109 + <ProFormText
  110 + name="teacherName"
  111 + width="md"
  112 + label="课题组老师"
  113 + placeholder="请输入课题组老师"
  114 + rules={[
  115 + { required: true, message: '课题组老师必填,若没有请填“无”' },
  116 + ]}
  117 + />
  118 + </ProFormGroup>
  119 +
  120 + <ProFormList
  121 + creatorButtonProps={{ disabled: false }}
  122 + name="contact_persons"
  123 + label="联系人信息"
  124 + actionGuard={{
  125 + beforeRemoveRow: async () => {
  126 + return new Promise((resolve) => {
  127 + let contactPersons = form.getFieldValue('contact_persons');
  128 + if (contactPersons.length === 1) {
  129 + message.error('至少要有一个联系人');
  130 + resolve(false);
  131 + return;
  132 + }
  133 + resolve(true);
  134 + });
  135 + },
  136 + }}
  137 + deleteIconProps={{
  138 + Icon: CloseCircleOutlined,
  139 + tooltipText: '不需要这行了',
  140 + }}
  141 + >
  142 + <ProFormGroup key="group">
  143 + {[
  144 + <ProFormText
  145 + key="key"
  146 + name="id"
  147 + label="id"
  148 + placeholder="id"
  149 + hidden
  150 + />,
  151 + <ProFormText
  152 + key="key"
  153 + name="contact_person"
  154 + label="收货人姓名"
  155 + placeholder="联系人姓名"
  156 + rules={[{ required: true, message: '收货人姓名必填' }]}
  157 + />,
  158 + <ProFormText
  159 + key="key"
  160 + name="mobile"
  161 + label="联系方式"
  162 + placeholder="联系方式"
  163 + rules={[{ required: true, message: '联系方式必填' }]}
  164 + />,
  165 + <ProFormText
  166 + key="key"
  167 + name="contact_address"
  168 + label="收货地址"
  169 + width="md"
  170 + placeholder="请输入收货地址"
  171 + rules={[{ required: true, message: '收货地址必填' }]}
  172 + />,
  173 + ]}
  174 + </ProFormGroup>
  175 + </ProFormList>
  176 + </ModalForm>
  177 + </>
  178 + );
  179 +};
... ...
src/pages/Order/components/OrderDrawer copy.tsx 0 → 100644
  1 +import { RESPONSE_CODE } from '@/constants/enum';
  2 +import {
  3 + postKingdeeRepCustomer,
  4 + postKingdeeRepCustomerDetail,
  5 + postKingdeeRepMaterial,
  6 + postKingdeeRepMaterialUnit,
  7 + postKingdeeRepMeasureUnit,
  8 + postServiceOrderAddOrder,
  9 + postServiceOrderQuerySalesCode,
  10 + postServiceOrderUpdateOrder,
  11 +} from '@/services';
  12 +import {
  13 + enumToSelect,
  14 + getAliYunOSSFileNameFromUrl,
  15 + getUserInfo,
  16 +} from '@/utils';
  17 +import { getTeacherCustomFieldNumber } from '@/utils/kingdee';
  18 +import {
  19 + DrawerForm,
  20 + FormListActionType,
  21 + ProCard,
  22 + ProFormDateTimePicker,
  23 + ProFormDigit,
  24 + ProFormList,
  25 + ProFormSelect,
  26 + ProFormText,
  27 + ProFormTextArea,
  28 + ProFormUploadDragger,
  29 +} from '@ant-design/pro-components';
  30 +import { Button, Form, message } from 'antd';
  31 +import { cloneDeep } from 'lodash';
  32 +import { useEffect, useRef, useState } from 'react';
  33 +import {
  34 + INVOCING_STATUS_OPTIONS,
  35 + INVOCING_STATUS_OPTIONS_OLD,
  36 + PAYMENT_CHANNEL_OPTIONS,
  37 + PAYMENT_METHOD_OPTIONS,
  38 + PRODUCT_BELONG_DEPARTMENT_OPTIONS,
  39 +} from '../constant';
  40 +import KingdeeCustomerModal from './KingdeeCustomerModal';
  41 +
  42 +export default ({ onClose, data, subOrders, orderOptType }) => {
  43 + const [invoicingStatus, setInvoicingStatus] = useState('');
  44 + const [salesCodeOptions, setSalesCodeOptions] = useState([]);
  45 + const [customer, setCustomer] = useState({});
  46 + const [kingdeeCstomerModalVisible, setKingdeeCstomerModalVisible] =
  47 + useState(false);
  48 + const [
  49 + productParametersDisabledFlagList,
  50 + setProductParametersDisabledFlagList,
  51 + ] = useState([]);
  52 + // const [productInvStockOptionsList, setProductInvStockOptionsList] = useState(
  53 + // [],
  54 + // ); //商品的仓库选项
  55 + const [productUnitOptionsList, setProductUnitOptionsList] = useState([]); //商品的单位选项
  56 + const [productCustomerContactOptions, setProductCustomerContactOptions] =
  57 + useState([]); //客户的收货人选项
  58 + const [form] = Form.useForm<{
  59 + salesCode: '';
  60 + customerName: '';
  61 + customerContactNumber: '';
  62 + institution: '';
  63 + institutionContactName: '';
  64 + customerShippingAddress: '';
  65 + totalPayment: '';
  66 + paymentChannel: '';
  67 + paymentMethod: '';
  68 + productBelongBusiness: '';
  69 + invoicingStatus: '';
  70 + invoiceIdentificationNumber: '';
  71 + invoicingTime: '';
  72 + bank: '';
  73 + bankAccountNumber: '';
  74 + deleteSubOrderLists: [];
  75 + notes: '';
  76 + list: [
  77 + {
  78 + productCode: '';
  79 + productName: '';
  80 + quantity: '';
  81 + productPrice: '';
  82 + parameters: '';
  83 + subOrderPayment: '';
  84 + unit: '';
  85 + serialNumber: '';
  86 + notes: '';
  87 + },
  88 + ];
  89 + }>();
  90 +
  91 + let originSubOrders = cloneDeep(subOrders);
  92 + /**
  93 + * 获取当前的操作类型boolean值
  94 + * @param type 操作类型,如果与当前匹配返回true
  95 + */
  96 + function optType(type: string) {
  97 + return orderOptType === type;
  98 + }
  99 +
  100 + /**
  101 + *
  102 + * @returns 获取开票选项
  103 + */
  104 + function getInvoicingSelect() {
  105 + if (optType('edit')) {
  106 + return enumToSelect(INVOCING_STATUS_OPTIONS_OLD);
  107 + }
  108 + return enumToSelect(INVOCING_STATUS_OPTIONS);
  109 + }
  110 +
  111 + const fileList: any = [];
  112 +
  113 + const getSalesCodeOptions = async () => {
  114 + const res = await postServiceOrderQuerySalesCode();
  115 + let options = res.data?.map((item) => {
  116 + return {
  117 + label: item.userName,
  118 + value: item.userName,
  119 + number: item.number,
  120 + };
  121 + });
  122 + setSalesCodeOptions(options);
  123 +
  124 + if (optType('copy') || optType('edit')) {
  125 + let includeFlag = false;
  126 + //销售代码校验,如果是旧的销售代码,则提示并清空
  127 + for (let option of options) {
  128 + if (option.value === data.salesCode) {
  129 + includeFlag = true;
  130 + }
  131 + }
  132 + if (!includeFlag) {
  133 + form.resetFields(['salesCode']);
  134 + message.warning('检测到销售代码为旧的,已清空,请重新选择');
  135 + }
  136 + }
  137 + };
  138 +
  139 + //复制的时候,如果是不需要开票,要把开票信息清空
  140 + if (optType('copy') && data.invoicingStatus === 'UN_INVOICE') {
  141 + data.invoiceIdentificationNumber = undefined;
  142 + }
  143 +
  144 + if (subOrders !== undefined && subOrders.length > 0) {
  145 + data.list = subOrders;
  146 + }
  147 +
  148 + const actionRef = useRef<
  149 + FormListActionType<{
  150 + name: string;
  151 + }>
  152 + >();
  153 +
  154 + useEffect(() => {
  155 + form.setFieldsValue({ ...data });
  156 + //如果是新建,需要清空list
  157 + if (optType('add')) {
  158 + form.resetFields(['list']);
  159 + }
  160 + }, [data]);
  161 +
  162 + /**
  163 + * 选择客户后自动为收货人Select添加选项,填充课题组和单位信息
  164 + * @param option 客户选项
  165 + */
  166 + async function autoFillCustomerContactSelectOptions(customerId: any) {
  167 + //查询单位详细信息
  168 + let res = await postKingdeeRepCustomerDetail({
  169 + data: {
  170 + id: customerId,
  171 + },
  172 + });
  173 +
  174 + //erp客户名称
  175 + form.setFieldValue('erpCustomerName', res?.name);
  176 +
  177 + //重新设置当前option
  178 + form.setFieldValue('erpCustomerId', {
  179 + label: res?.name,
  180 + value: res?.id,
  181 + id: res?.id,
  182 + });
  183 +
  184 + //查询客户自定义字段,课题组
  185 + let entity_number = await getTeacherCustomFieldNumber();
  186 +
  187 + //在单位详细信息中拿到自定义字段的值
  188 + let customField = res?.custom_field;
  189 + if (customField) {
  190 + let teacherName = customField[entity_number];
  191 + //填充到课题组老师表单字段中
  192 + form.setFieldValue('institutionContactName', teacherName);
  193 + }
  194 +
  195 + //单位名称,从客户名称中获取,客户名称规则<单位名称>-<联系人名称和电话>
  196 + let namePortions = res?.name?.split('-');
  197 + if (namePortions && namePortions.length >= 2) {
  198 + form.setFieldValue('institution', namePortions[0]);
  199 + }
  200 +
  201 + //如果原来的收货信息没有包含在这次查询出来的收货人选项中,那么清除原来的收货人信息
  202 + let existFlag = false;
  203 +
  204 + //填充收货人选项
  205 + let newProductCustomerContactOptions = res?.bomentity?.map((item) => {
  206 + let address =
  207 + item.contact_person + ',' + item.mobile + ',' + item.contact_address;
  208 + if (address === data.contactAddress) {
  209 + existFlag = true;
  210 + }
  211 + return { ...item, label: address, value: address };
  212 + });
  213 +
  214 + setProductCustomerContactOptions(newProductCustomerContactOptions);
  215 +
  216 + if (!existFlag) {
  217 + //清空原来的收货人信息
  218 + form.setFieldValue('customerShippingAddress', undefined);
  219 + form.setFieldValue('customerContactNumber', undefined);
  220 + form.setFieldValue('customerName', undefined);
  221 + form.setFieldValue('erpCustomerAddress', undefined);
  222 + }
  223 + }
  224 +
  225 + /**
  226 + * 回显金蝶信息
  227 + */
  228 + async function showKindeeInfo() {
  229 + //客户信息
  230 + if (data.customerId) {
  231 + //客户回显
  232 + autoFillCustomerContactSelectOptions(data.customerId);
  233 + }
  234 +
  235 + //商品单位回显
  236 + let list = data?.subOrderInformationLists;
  237 + if (list) {
  238 + let newProductUnitOptionsList = [...productUnitOptionsList];
  239 + for (let i = 0; i < list.length; i++) {
  240 + newProductUnitOptionsList[i] = [
  241 + { label: list[i].unit, value: list[i].unitId },
  242 + ];
  243 + }
  244 + setProductUnitOptionsList(newProductUnitOptionsList);
  245 + }
  246 + }
  247 +
  248 + /**
  249 + *
  250 + * @param option 商品名称所对应的商品数据
  251 + * @param currentRowData list中当前行的数据
  252 + */
  253 + async function autoFillProductInfo(
  254 + option: any,
  255 + currentRowData: any,
  256 + index: any,
  257 + ) {
  258 + let newProductParametersDisabledFlagList = [
  259 + ...productParametersDisabledFlagList,
  260 + ];
  261 + let newProductUnitOptionsList = [...productUnitOptionsList];
  262 + newProductUnitOptionsList[index] = [];
  263 +
  264 + //是新增商品
  265 + if (option.type === 'add') {
  266 + //商品参数开放权限可以编辑
  267 + newProductParametersDisabledFlagList[index] = false;
  268 +
  269 + //清空商品信息
  270 + let copyList = form.getFieldValue('list');
  271 + let currentData = copyList[index];
  272 + currentData.productCode = undefined;
  273 + currentData.parameters = undefined;
  274 + currentData.unit = undefined;
  275 + currentData.subOrderPayment = undefined;
  276 + currentData.quantity = undefined;
  277 + currentData.notes = undefined;
  278 + currentData.productPrice = undefined;
  279 + form.setFieldValue('list', copyList);
  280 +
  281 + //查询计量单价列表
  282 + let res = await postKingdeeRepMeasureUnit({ data: {} });
  283 + if (res && res?.rows) {
  284 + for (let row of res?.rows) {
  285 + newProductUnitOptionsList[index].push({
  286 + label: row.name,
  287 + value: row.id,
  288 + });
  289 + }
  290 + }
  291 + } else {
  292 + //选择的是已有的商品,进行内容自动填充
  293 + let copyList = form.getFieldValue('list');
  294 + let currentData = copyList[index];
  295 + currentData.productCode = option?.number;
  296 + currentData.parameters = option?.model;
  297 + currentData.unit = option?.base_unit_name;
  298 +
  299 + //商品id
  300 + currentData.materialId = option?.id;
  301 +
  302 + //单位
  303 + currentData.unit = option.base_unit_name;
  304 + currentData.unitId = option.base_unit_id;
  305 +
  306 + form.setFieldValue('list', copyList);
  307 +
  308 + //商品所在的仓库选项填充
  309 + // let res = await postKingdeeRepMaterialStock({
  310 + // data: {
  311 + // material_id: option.id,
  312 + // },
  313 + // });
  314 + // let newProductInvStockOptionsList = [...productInvStockOptionsList];
  315 + // newProductInvStockOptionsList[index] = res?.rows?.map((item) => {
  316 + // return { label: item.inv_stock, value: item.inv_stock_id };
  317 + // });
  318 + // setProductInvStockOptionsList(newProductInvStockOptionsList);
  319 +
  320 + //商品单位填充,查询商品单位列表
  321 + let res = await postKingdeeRepMaterialUnit({
  322 + data: { material_id: option.id },
  323 + });
  324 + if (res && res.rows) {
  325 + for (let row of res.rows) {
  326 + newProductUnitOptionsList[index].push({
  327 + label: row.unit_name,
  328 + value: row.unit_id,
  329 + });
  330 + }
  331 + }
  332 + //商品参数不允许编辑
  333 + newProductParametersDisabledFlagList[index] = true;
  334 + }
  335 +
  336 + setProductParametersDisabledFlagList(newProductParametersDisabledFlagList);
  337 + setProductUnitOptionsList(newProductUnitOptionsList);
  338 + }
  339 +
  340 + /**
  341 + * 选择收货人后自动填充信息
  342 + * @param option 收货人信息
  343 + */
  344 + async function autoFillCustomerInfo(option: any) {
  345 + form.setFieldValue('customerShippingAddress', option.contact_address);
  346 + form.setFieldValue('customerContactNumber', option.mobile);
  347 + form.setFieldValue('customerName', option.contact_person);
  348 +
  349 + //erp收货地址:需要与客户联系人中的地址一样:姓名,手机号,地址
  350 + form.setFieldValue('contactAddress', option.value);
  351 + }
  352 +
  353 + /**
  354 + * 填充销售代表的信息
  355 + * @param option
  356 + */
  357 + function autoFillSalesInfo(option: any) {
  358 + console.log(option);
  359 + //销售代表对应职员编码填充
  360 + form.setFieldValue('empNumber', option.number);
  361 + }
  362 +
  363 + /**
  364 + * 选择商品单位后自动填充
  365 + * @param option
  366 + * @param index
  367 + */
  368 + function autoFillUnit(option: any, index: any) {
  369 + let copyList = form.getFieldValue('list');
  370 + let currentData = copyList[index];
  371 + currentData.unit = option?.label;
  372 + form.setFieldValue('list', copyList);
  373 + }
  374 +
  375 + /**
  376 + * 计算子订单金额
  377 + * @param listMeta 当前商品信息
  378 + */
  379 + function computeSubOrderPayment(listMeta: any) {
  380 + let quantity = listMeta?.record?.quantity;
  381 + let productPrice = listMeta?.record?.productPrice;
  382 + quantity = quantity === '' || quantity === undefined ? 0 : quantity;
  383 + productPrice =
  384 + productPrice === '' || productPrice === undefined ? 0 : productPrice;
  385 +
  386 + listMeta.subOrderPayment = quantity * productPrice;
  387 + let list = form.getFieldValue('list');
  388 + list[listMeta?.index].subOrderPayment = quantity * productPrice;
  389 + form.setFieldValue('list', list);
  390 + }
  391 +
  392 + /**
  393 + * 计算支付总额
  394 + */
  395 + function computeTotalPayment() {
  396 + let list = form.getFieldValue('list');
  397 + let totalPayment = 0;
  398 + list?.forEach((subOrder: any) => {
  399 + let subOrderPayment = subOrder?.subOrderPayment;
  400 + if (subOrderPayment === '' || subOrderPayment === undefined) {
  401 + totalPayment += 0;
  402 + } else {
  403 + totalPayment += subOrderPayment;
  404 + }
  405 + });
  406 + form.setFieldValue('totalPayment', totalPayment);
  407 + }
  408 +
  409 + useEffect(() => {
  410 + getSalesCodeOptions();
  411 + showKindeeInfo();
  412 + }, []);
  413 +
  414 + useEffect(() => {
  415 + // 在组件挂载或数据变化时,更新组件状态
  416 + if (data) {
  417 + setInvoicingStatus(data.invoicingStatus);
  418 + }
  419 + }, [data]);
  420 +
  421 + // let mainInfoDisbled = optType('edit');
  422 + if (optType('edit') || optType('copy')) {
  423 + //如果是复制,需要开票,不回显是否需要开票字段
  424 + if (optType('copy')) {
  425 + if (data.invoicingStatus === 'INVOICED') {
  426 + data.invoicingStatus = undefined;
  427 + }
  428 + }
  429 + //订单修改和新增的子订单列表命名是list
  430 + data.list = data.subOrderInformationLists;
  431 + //主订单事业部默认显示子订单第一条的事业部
  432 + data.productBelongBusiness = data.list[0].productBelongBusiness;
  433 + data.paymentMethod = data.list[0].paymentMethod;
  434 + data.paymentChannel = data.list[0].paymentChannel;
  435 + data.invoicingStatus = data.list[0].invoicingStatus;
  436 +
  437 + data.list = data.list?.map((item) => {
  438 + item.filePaths = item.listAnnex?.map((path) => {
  439 + let i = 0;
  440 + return {
  441 + uid: i++,
  442 + name: getAliYunOSSFileNameFromUrl(path),
  443 + status: 'uploaded',
  444 + url: path,
  445 + response: { data: [path] },
  446 + };
  447 + });
  448 + return item;
  449 + });
  450 + }
  451 +
  452 + return (
  453 + <>
  454 + <DrawerForm<{
  455 + deleteSubOrderLists: any;
  456 + name: string;
  457 + company: string;
  458 + }>
  459 + open
  460 + width="35%"
  461 + title={optType('add') || optType('copy') ? '新建订单' : '修改订单'}
  462 + resize={{
  463 + onResize() {
  464 + console.log('resize!');
  465 + },
  466 + maxWidth: window.innerWidth * 0.8,
  467 + minWidth: 400,
  468 + }}
  469 + // layout="horizontal"
  470 + // labelCol={{ span: 8 }}
  471 + form={form}
  472 + autoFocusFirstInput
  473 + drawerProps={{
  474 + destroyOnClose: true,
  475 + maskClosable: false,
  476 + }}
  477 + submitTimeout={2000}
  478 + onFinish={async (values) => {
  479 + let res = {};
  480 + //附件处理
  481 + let list = values.list;
  482 + // console.log(list);
  483 + list = list.map((item) => {
  484 + item.filePaths = item.filePaths?.map((file) => {
  485 + console.log(file);
  486 + return { url: file.response.data[0] };
  487 + });
  488 + return item;
  489 + });
  490 +
  491 + values.list = list;
  492 + values.institution = values.institution?.trim();
  493 + values.institutionContactName = values.institutionContactName?.trim();
  494 +
  495 + if (typeof values.erpCustomerId !== 'string') {
  496 + values.erpCustomerId = values.erpCustomerId?.id;
  497 + }
  498 +
  499 + if (optType('add') || optType('copy')) {
  500 + res = await postServiceOrderAddOrder({ data: values });
  501 + } else {
  502 + //计算已删除的子订单id
  503 + const originIds = originSubOrders.map((item) => {
  504 + return item.id;
  505 + });
  506 + const curIds = form.getFieldValue('list')?.map((item) => {
  507 + return item.id;
  508 + });
  509 + let diff = originIds.filter((item) => !curIds.includes(item));
  510 + values.deleteSubOrderLists = diff;
  511 + res = await postServiceOrderUpdateOrder({ data: values });
  512 + }
  513 +
  514 + if (res.result === RESPONSE_CODE.SUCCESS) {
  515 + message.success(res.message);
  516 + // 不返回不会关闭弹框
  517 + onClose(true);
  518 + return true;
  519 + }
  520 + }}
  521 + onOpenChange={(val) => {
  522 + return !val && onClose();
  523 + }}
  524 + >
  525 + <h2>订单基本信息</h2>
  526 + <ProFormText
  527 + key="id"
  528 + name="id"
  529 + width="lg"
  530 + disabled
  531 + label="id"
  532 + placeholder="id"
  533 + hidden
  534 + />
  535 +
  536 + <ProFormText
  537 + key="empNumber"
  538 + name="empNumber"
  539 + width="lg"
  540 + label="销售职员编码"
  541 + placeholder="销售职员编码"
  542 + hidden
  543 + />
  544 +
  545 + <ProFormSelect
  546 + name="salesCode"
  547 + key="salesCode"
  548 + width="lg"
  549 + showSearch
  550 + label="销售代表"
  551 + placeholder="请输入销售代表"
  552 + rules={[{ required: true, message: '销售代表必填' }]}
  553 + options={salesCodeOptions}
  554 + onChange={(_, option) => {
  555 + autoFillSalesInfo(option);
  556 + }}
  557 + // disabled={mainInfoDisbled}
  558 + />
  559 + <ProFormText
  560 + key="erpCustomerName"
  561 + name="erpCustomerName"
  562 + hidden
  563 + ></ProFormText>
  564 +
  565 + <ProFormText
  566 + key="contactAddress"
  567 + name="contactAddress"
  568 + hidden
  569 + ></ProFormText>
  570 +
  571 + <ProFormSelect
  572 + name="erpCustomerId"
  573 + key="erpCustomerId"
  574 + width="lg"
  575 + showSearch
  576 + label={
  577 + <>
  578 + <span>客户</span>
  579 + <span
  580 + className="pl-2 text-xs text-[#1677ff] cursor-pointer"
  581 + onClick={() => {
  582 + let customerId = form.getFieldValue('erpCustomerId');
  583 + if (typeof customerId === 'string') {
  584 + setCustomer({ ...customer, id: customerId });
  585 + } else {
  586 + setCustomer({ ...customer, id: customerId.id });
  587 + }
  588 + setKingdeeCstomerModalVisible(true);
  589 + }}
  590 + >
  591 + 编辑客户信息
  592 + </span>
  593 + </>
  594 + }
  595 + placeholder="请选择客户"
  596 + rules={[{ required: true, message: '客户必填' }]}
  597 + onChange={(_, option) => {
  598 + //新增客户
  599 + if (option.type === 'add') {
  600 + setCustomer({ name: option.name });
  601 + setKingdeeCstomerModalVisible(true);
  602 + return;
  603 + }
  604 + autoFillCustomerContactSelectOptions(option.id);
  605 + }}
  606 + initialValue={{
  607 + label: data?.erpCustomerName,
  608 + value: data?.customerId,
  609 + id: data?.customerId,
  610 + }}
  611 + fieldProps={{
  612 + optionItemRender(item) {
  613 + if (item.type === 'add') {
  614 + return (
  615 + <div title={item.name + '(新增客户)'}>
  616 + <span style={{ color: '#333333' }}>{item.name}</span>
  617 + {' | '}
  618 + <span style={{ color: 'orange' }}>自定义</span>
  619 + </div>
  620 + );
  621 + }
  622 + return (
  623 + <div
  624 + title={
  625 + item.name +
  626 + ' | ' +
  627 + item.customerContactNumber +
  628 + ' | ' +
  629 + (item.customerShippingAddress === undefined
  630 + ? '无地址'
  631 + : item.customerShippingAddress) +
  632 + ' | ' +
  633 + item.institutionContactName +
  634 + ' | ' +
  635 + item.institution
  636 + }
  637 + >
  638 + <span style={{ color: '#333333' }}>{item.name}</span>
  639 + </div>
  640 + );
  641 + },
  642 + }}
  643 + debounceTime={1000}
  644 + request={async (value, {}) => {
  645 + const keywords = value.keyWords;
  646 + const res = await postKingdeeRepCustomer({
  647 + data: { search: keywords },
  648 + });
  649 + let options = res?.rows?.map((c: any) => {
  650 + return {
  651 + ...c,
  652 + label: c.name,
  653 + value: c.id,
  654 + key: c.id,
  655 + };
  656 + });
  657 +
  658 + //第一个商品默认为要新增客户
  659 + if (keywords.trim() !== '') {
  660 + options.unshift({
  661 + name: keywords,
  662 + type: 'add',
  663 + label: keywords,
  664 + value: 3.1415926,
  665 + key: keywords,
  666 + });
  667 + }
  668 + return options;
  669 + }}
  670 + />
  671 + <ProFormSelect
  672 + key="customerName"
  673 + label="收货人"
  674 + width="lg"
  675 + showSearch
  676 + name="customerName"
  677 + placeholder="请选择收货人"
  678 + rules={[{ required: true, message: '收货人必填' }]}
  679 + onChange={(_, option) => {
  680 + autoFillCustomerInfo(option);
  681 + }}
  682 + initialValue={data.contactAddress}
  683 + options={productCustomerContactOptions}
  684 + />
  685 + <ProFormText
  686 + width="lg"
  687 + key="customerContactNumber"
  688 + name="customerContactNumber"
  689 + label="联系方式"
  690 + placeholder="请输入联系方式"
  691 + rules={[{ required: true, message: '联系方式必填' }]}
  692 + disabled
  693 + />
  694 + <ProFormText
  695 + width="lg"
  696 + key="institution"
  697 + name="institution"
  698 + label="单位"
  699 + placeholder="请输入单位"
  700 + rules={[{ required: true, message: '单位必填' }]}
  701 + disabled
  702 + />
  703 + <ProFormText
  704 + width="lg"
  705 + key="institutionContactName"
  706 + name="institutionContactName"
  707 + label="课题组"
  708 + placeholder="请输入课题组"
  709 + rules={[{ required: true, message: '课题组必填' }]}
  710 + disabled
  711 + />
  712 + <ProFormTextArea
  713 + width="lg"
  714 + key="customerShippingAddress"
  715 + name="customerShippingAddress"
  716 + label="收货地址"
  717 + placeholder="请输入收货地址"
  718 + rules={[{ required: true, message: '收货地址必填' }]}
  719 + disabled
  720 + />
  721 + <div id="total-payment">
  722 + <ProFormDigit
  723 + name="totalPayment"
  724 + width="lg"
  725 + key="totalPayment"
  726 + label="支付总额(¥)"
  727 + rules={[{ required: true, message: '支付总额必填' }]}
  728 + tooltip="点击计算,合计所有子订单金额"
  729 + fieldProps={{
  730 + addonAfter: (
  731 + <Button
  732 + className="rounded-l-none"
  733 + type="primary"
  734 + onClick={computeTotalPayment}
  735 + >
  736 + 计算
  737 + </Button>
  738 + ),
  739 + }}
  740 + // disabled={mainInfoDisbled}
  741 + />
  742 + </div>
  743 +
  744 + <ProFormSelect
  745 + placeholder="请输入支付渠道"
  746 + name="paymentChannel"
  747 + width="lg"
  748 + key="paymentChannel"
  749 + label="支付渠道"
  750 + options={enumToSelect(PAYMENT_CHANNEL_OPTIONS)}
  751 + rules={[{ required: true, message: '支付渠道必填' }]}
  752 + // disabled={mainInfoDisbled}
  753 + />
  754 + <ProFormSelect
  755 + placeholder="请输入支付方式"
  756 + name="paymentMethod"
  757 + width="lg"
  758 + key="paymentMethod"
  759 + label="支付方式"
  760 + options={enumToSelect(PAYMENT_METHOD_OPTIONS)}
  761 + rules={[{ required: true, message: '支付方式必填' }]}
  762 + // disabled={mainInfoDisbled}
  763 + />
  764 + <ProFormSelect
  765 + placeholder="选择是否需要开票"
  766 + name="invoicingStatus"
  767 + width="lg"
  768 + key="invoicingStatus"
  769 + label="是否需要开票"
  770 + options={getInvoicingSelect()}
  771 + // disabled={mainInfoDisbled}
  772 + onChange={(_, option) => {
  773 + setInvoicingStatus(option.value);
  774 + if (option.value === 'UN_INVOICE') {
  775 + form.setFieldValue('invoiceIdentificationNumber', undefined);
  776 + form.setFieldValue('bank', undefined);
  777 + form.setFieldValue('bankAccountNumber', undefined);
  778 + }
  779 + }}
  780 + rules={[{ required: true, message: '是否需要开票必填' }]}
  781 + />
  782 + <ProFormText
  783 + width="lg"
  784 + name="invoiceIdentificationNumber"
  785 + label="开票信息"
  786 + key="invoiceIdentificationNumber"
  787 + // disabled={mainInfoDisbled}
  788 + hidden={invoicingStatus === 'UN_INVOICE'}
  789 + placeholder="请输入开票信息"
  790 + rules={[
  791 + {
  792 + required: invoicingStatus === 'UN_INVOICE' ? false : true,
  793 + message: '开票信息必填',
  794 + },
  795 + ]}
  796 + />
  797 +
  798 + {getUserInfo().roleSmallVO?.code === 'admin' ? (
  799 + <ProFormDateTimePicker
  800 + width="lg"
  801 + key="invoicingTime"
  802 + name="invoicingTime"
  803 + // disabled={mainInfoDisbled}
  804 + hidden={invoicingStatus === 'UN_INVOICE'}
  805 + label="开票时间"
  806 + placeholder="请输入开票时间"
  807 + />
  808 + ) : (
  809 + ''
  810 + )}
  811 + <ProFormText
  812 + width="lg"
  813 + name="bank"
  814 + key="bank"
  815 + label="开户银行"
  816 + // disabled={mainInfoDisbled}
  817 + hidden={invoicingStatus === 'UN_INVOICE'}
  818 + placeholder="请输入开户银行"
  819 + />
  820 + <ProFormText
  821 + width="lg"
  822 + key="bankAccountNumber"
  823 + name="bankAccountNumber"
  824 + hidden={invoicingStatus === 'UN_INVOICE'}
  825 + label="银行账号"
  826 + // disabled={mainInfoDisbled}
  827 + placeholder="请输入银行账号"
  828 + />
  829 + <ProFormTextArea
  830 + width="lg"
  831 + name="notes"
  832 + label="备注"
  833 + key="notes"
  834 + // disabled={mainInfoDisbled}
  835 + placeholder="请输入备注"
  836 + rules={[
  837 + {
  838 + max: 120, // 最大长度为120个字符
  839 + message: '备注不能超过120个字符',
  840 + },
  841 + ]}
  842 + />
  843 +
  844 + <h2>商品信息</h2>
  845 + <ProFormList
  846 + creatorButtonProps={{ disabled: false }}
  847 + name="list"
  848 + label=""
  849 + copyIconProps={false} //复制按钮不显示
  850 + initialValue={[
  851 + {
  852 + productCode: '',
  853 + productName: '',
  854 + quantity: '',
  855 + productPrice: '',
  856 + parameters: '',
  857 + subOrderPayment: '',
  858 + },
  859 + ]}
  860 + actionGuard={{
  861 + beforeRemoveRow: async (index) => {
  862 + return new Promise((resolve) => {
  863 + if (index === 0) {
  864 + message.error('第一行数据不能删除');
  865 + resolve(false);
  866 + return;
  867 + }
  868 + resolve(true);
  869 + });
  870 + },
  871 + }}
  872 + itemRender={(doms, listMeta) => {
  873 + if (optType('edit')) {
  874 + let i = 0;
  875 + let defaultFileList = listMeta.record?.listAnnex?.map((annex) => {
  876 + return {
  877 + uid: i++,
  878 + name: annex,
  879 + status: 'uploaded',
  880 + url: annex,
  881 + response: { data: [annex] },
  882 + };
  883 + });
  884 + fileList[listMeta.index] = defaultFileList;
  885 + }
  886 + let itemFileList = fileList[listMeta.index];
  887 + return (
  888 + <ProCard
  889 + bordered
  890 + extra={doms.action}
  891 + title={'商品' + (listMeta.index + 1)}
  892 + style={{
  893 + marginBlockEnd: 8,
  894 + }}
  895 + >
  896 + {[
  897 + <ProFormText
  898 + key={'material' + listMeta.index}
  899 + name="materialId"
  900 + hidden
  901 + ></ProFormText>,
  902 + <ProFormSelect
  903 + key="key"
  904 + label="商品名称"
  905 + width="lg"
  906 + showSearch
  907 + name="productName"
  908 + // options={options}
  909 + placeholder="请搜索商品"
  910 + rules={[{ required: true, message: '商品名称必填' }]}
  911 + onChange={(_, option) => {
  912 + autoFillProductInfo(option, listMeta, listMeta.index);
  913 + }}
  914 + initialValue={{
  915 + label: listMeta?.record?.productName,
  916 + value: listMeta?.record?.materialId,
  917 + }}
  918 + fieldProps={{
  919 + optionItemRender(item) {
  920 + if (item.type === 'add') {
  921 + return (
  922 + <div title={item.name + '(新增商品信息)'}>
  923 + <span style={{ color: '#333333' }}>
  924 + {item.label}
  925 + </span>
  926 + {' | '}
  927 + <span style={{ color: 'orange' }}>新增商品</span>
  928 + </div>
  929 + );
  930 + }
  931 + return (
  932 + <div
  933 + title={
  934 + item.label +
  935 + ' | ' +
  936 + (item.model === undefined
  937 + ? '无参数'
  938 + : item.model) +
  939 + ' | ' +
  940 + item.base_unit_name
  941 + }
  942 + >
  943 + <span style={{ color: '#333333' }}>
  944 + {item.label}
  945 + </span>
  946 + {' | '}
  947 + <span style={{ color: '#339999' }}>
  948 + {item.model === undefined ? '无参数' : item.model}
  949 + </span>
  950 + {' | '}
  951 + <span style={{ color: '#666666' }}>
  952 + {item.base_unit_name === undefined
  953 + ? '无单位'
  954 + : item.base_unit_name}
  955 + </span>
  956 + </div>
  957 + );
  958 + },
  959 + }}
  960 + debounceTime={1000}
  961 + request={async (value) => {
  962 + const keywords = value.keyWords;
  963 + const res = await postKingdeeRepMaterial({
  964 + data: { search: keywords },
  965 + });
  966 + let options = res?.rows?.map((p: any) => {
  967 + return {
  968 + ...p,
  969 + label: p.name,
  970 + value: p.id + '|' + p.name,
  971 + key: p.id,
  972 + };
  973 + });
  974 +
  975 + //第一个商品默认为要新增的商品
  976 + if (keywords.trim() !== '') {
  977 + options.unshift({
  978 + productName: keywords,
  979 + type: 'add',
  980 + label: keywords,
  981 + value: 13 + '|' + keywords,
  982 + key: keywords,
  983 + });
  984 + }
  985 + return options;
  986 + }}
  987 + />,
  988 + <ProFormText
  989 + key={'productCode' + listMeta.index}
  990 + width="lg"
  991 + name="productCode"
  992 + disabled
  993 + label={
  994 + <>
  995 + <span>商品编码</span>
  996 + <span className="pl-2 text-xs text-gray-400">
  997 + 新增商品时,商品编码由系统自动生成
  998 + </span>
  999 + </>
  1000 + }
  1001 + placeholder="商品编码"
  1002 + />,
  1003 + // <ProFormSelect
  1004 + // key="inv_stock"
  1005 + // placeholder="请选择仓库"
  1006 + // name="invStockId"
  1007 + // width="lg"
  1008 + // label="仓库"
  1009 + // options={productInvStockOptionsList[listMeta.index]}
  1010 + // />,
  1011 + <ProFormText
  1012 + key={'parameters' + listMeta.index}
  1013 + width="lg"
  1014 + name="parameters"
  1015 + label="商品参数"
  1016 + placeholder="请输入商品参数"
  1017 + rules={[{ required: true, message: '商品参数必填' }]}
  1018 + disabled={
  1019 + productParametersDisabledFlagList[listMeta.index] !==
  1020 + false
  1021 + }
  1022 + />,
  1023 + <ProFormDigit
  1024 + key={'quantity' + listMeta.index}
  1025 + width="lg"
  1026 + name="quantity"
  1027 + label="商品数量"
  1028 + fieldProps={{
  1029 + onChange: (value) => {
  1030 + listMeta.record.quantity = value;
  1031 + computeSubOrderPayment(listMeta);
  1032 + },
  1033 + }}
  1034 + placeholder="请输入商品数量"
  1035 + rules={[{ required: true, message: '商品数量必填' }]}
  1036 + />,
  1037 +
  1038 + <ProFormDigit
  1039 + key={'productPrice' + listMeta.index}
  1040 + width="lg"
  1041 + name="productPrice"
  1042 + label="商品单价"
  1043 + fieldProps={{
  1044 + onChange: (value) => {
  1045 + listMeta.record.productPrice = value;
  1046 + computeSubOrderPayment(listMeta);
  1047 + },
  1048 + }}
  1049 + placeholder="请输入商品单价"
  1050 + rules={[{ required: true, message: '商品单价必填' }]}
  1051 + />,
  1052 +
  1053 + <ProFormSelect
  1054 + key="unitId"
  1055 + placeholder="请选择单位"
  1056 + name="unitId"
  1057 + width="lg"
  1058 + label="单位"
  1059 + showSearch
  1060 + onChange={(_, option) => {
  1061 + autoFillUnit(option, listMeta.index);
  1062 + }}
  1063 + options={productUnitOptionsList[listMeta.index]}
  1064 + rules={[{ required: true, message: '商品单位必填' }]}
  1065 + />,
  1066 + <ProFormText
  1067 + key={'unit' + listMeta.index}
  1068 + width="lg"
  1069 + name="unit"
  1070 + label="商品单位"
  1071 + placeholder="请输入商品单位"
  1072 + rules={[{ required: true, message: '商品单位必填' }]}
  1073 + hidden
  1074 + />,
  1075 +
  1076 + <ProFormDigit
  1077 + width="lg"
  1078 + key={'subOrderPayment' + listMeta.index}
  1079 + name="subOrderPayment"
  1080 + label="子订单金额"
  1081 + placeholder="请输入子订单金额"
  1082 + tooltip="商品数量和单价变化后会自动计算子订单金额"
  1083 + rules={[{ required: true, message: '子订单金额必填' }]}
  1084 + />,
  1085 + <ProFormSelect
  1086 + key={'productBelongBusiness' + listMeta.index}
  1087 + placeholder="请输入所属事业部"
  1088 + name="productBelongBusiness"
  1089 + width="lg"
  1090 + label="所属事业部"
  1091 + options={enumToSelect(PRODUCT_BELONG_DEPARTMENT_OPTIONS)}
  1092 + initialValue={'EXPERIMENTAL_CONSUMABLES'}
  1093 + rules={[{ required: true, message: '所属事业部必填' }]}
  1094 + // disabled={mainInfoDisbled}
  1095 + />,
  1096 + <ProFormTextArea
  1097 + key={'notes' + listMeta.index}
  1098 + width="lg"
  1099 + name="notes"
  1100 + label={
  1101 + <div>
  1102 + <span>备注</span>
  1103 + <span className="pl-2 text-xs text-gray-400">
  1104 + 备注将体现在出货单上,请将需要仓管看见的信息写在备注上,例如需要开收据等信息。
  1105 + </span>
  1106 + </div>
  1107 + }
  1108 + placeholder="请输入备注"
  1109 + rules={[
  1110 + {
  1111 + max: 120, // 最大长度为120个字符
  1112 + message: '备注不能超过120个字符',
  1113 + },
  1114 + ]}
  1115 + />,
  1116 + <>
  1117 + <ProFormUploadDragger
  1118 + key={'filePaths' + listMeta.index}
  1119 + label="附件"
  1120 + name="filePaths"
  1121 + action="/api/service/order/fileProcess"
  1122 + fieldProps={{
  1123 + headers: {
  1124 + Authorization: localStorage.getItem('token'),
  1125 + },
  1126 + itemFileList,
  1127 + }}
  1128 + />
  1129 + </>,
  1130 + ]}
  1131 + </ProCard>
  1132 + );
  1133 + }}
  1134 + actionRef={actionRef}
  1135 + ></ProFormList>
  1136 + </DrawerForm>
  1137 +
  1138 + {kingdeeCstomerModalVisible && (
  1139 + <KingdeeCustomerModal
  1140 + setVisible={setKingdeeCstomerModalVisible}
  1141 + data={customer}
  1142 + onClose={(customerId: any) => {
  1143 + setKingdeeCstomerModalVisible(false);
  1144 + //回显已经新建好的客户
  1145 + autoFillCustomerContactSelectOptions(customerId);
  1146 + }}
  1147 + />
  1148 + )}
  1149 + </>
  1150 + );
  1151 +};
... ...
src/pages/Order/components/OrderDrawer.tsx
1 1 import { RESPONSE_CODE } from '@/constants/enum';
2 2 import {
  3 + postKingdeeRepCustomer,
  4 + postKingdeeRepCustomerDetail,
  5 + postKingdeeRepMaterial,
  6 + postKingdeeRepMaterialUnit,
  7 + postKingdeeRepMeasureUnit,
3 8 postServiceOrderAddOrder,
4 9 postServiceOrderAfterSalesQuerySnapshotOrder,
5 10 postServiceOrderApplyAfterSales,
6   - postServiceOrderQueryCustomerNameInformation,
7   - postServiceOrderQueryProductInformation,
8 11 postServiceOrderQuerySalesCode,
9 12 postServiceOrderUpdateOrder,
10 13 } from '@/services';
... ... @@ -15,6 +18,7 @@ import {
15 18 getAliYunOSSFileNameFromUrl,
16 19 getUserInfo,
17 20 } from '@/utils';
  21 +import { getTeacherCustomFieldNumber } from '@/utils/kingdee';
18 22 import {
19 23 DrawerForm,
20 24 FormListActionType,
... ... @@ -38,12 +42,26 @@ import {
38 42 PAYMENT_METHOD_OPTIONS,
39 43 PRODUCT_BELONG_DEPARTMENT_OPTIONS,
40 44 } from '../constant';
  45 +import KingdeeCustomerModal from './KingdeeCustomerModal';
41 46  
42 47 export default ({ onClose, data, subOrders, orderOptType }) => {
43 48 const [invoicingStatus, setInvoicingStatus] = useState('');
44 49 const [salesCodeOptions, setSalesCodeOptions] = useState([]);
45 50 const [submitBtnLoading, setSubmitBtnLoading] = useState(false);
46 51 const [drawerTitle, setDrawerTitle] = useState('');
  52 + const [customer, setCustomer] = useState({});
  53 + const [kingdeeCstomerModalVisible, setKingdeeCstomerModalVisible] =
  54 + useState(false);
  55 + const [
  56 + productParametersDisabledFlagList,
  57 + setProductParametersDisabledFlagList,
  58 + ] = useState([]);
  59 + // const [productInvStockOptionsList, setProductInvStockOptionsList] = useState(
  60 + // [],
  61 + // ); //商品的仓库选项
  62 + const [productUnitOptionsList, setProductUnitOptionsList] = useState([]); //商品的单位选项
  63 + const [productCustomerContactOptions, setProductCustomerContactOptions] =
  64 + useState([]); //客户的收货人选项
47 65 const [form] = Form.useForm<{
48 66 salesCode: '';
49 67 customerName: '';
... ... @@ -95,7 +113,11 @@ export default ({ onClose, data, subOrders, orderOptType }) =&gt; {
95 113 const getSalesCodeOptions = async () => {
96 114 const res = await postServiceOrderQuerySalesCode();
97 115 let options = res.data?.map((item) => {
98   - return { label: item.userName, value: item.userName };
  116 + return {
  117 + label: item.userName,
  118 + value: item.userName,
  119 + number: item.number,
  120 + };
99 121 });
100 122 setSalesCodeOptions(options);
101 123  
... ... @@ -107,6 +129,7 @@ export default ({ onClose, data, subOrders, orderOptType }) =&gt; {
107 129 includeFlag = true;
108 130 }
109 131 }
  132 + console.log(includeFlag);
110 133 if (!includeFlag) {
111 134 form.resetFields(['salesCode']);
112 135 message.warning('检测到销售代码为旧的,已清空,请重新选择');
... ... @@ -115,6 +138,92 @@ export default ({ onClose, data, subOrders, orderOptType }) =&gt; {
115 138 };
116 139  
117 140 /**
  141 + * 选择客户后自动为收货人Select添加选项,填充课题组和单位信息
  142 + * @param option 客户选项
  143 + */
  144 + async function autoFillCustomerContactSelectOptions(customerId: any) {
  145 + //查询单位详细信息
  146 + let res = await postKingdeeRepCustomerDetail({
  147 + data: {
  148 + id: customerId,
  149 + },
  150 + });
  151 +
  152 + //erp客户名称
  153 + form.setFieldValue('erpCustomerName', res?.name);
  154 +
  155 + //重新设置当前option
  156 + form.setFieldValue('erpCustomerId', {
  157 + label: res?.name,
  158 + value: res?.id,
  159 + id: res?.id,
  160 + });
  161 +
  162 + //查询客户自定义字段,课题组
  163 + let entity_number = await getTeacherCustomFieldNumber();
  164 +
  165 + //在单位详细信息中拿到自定义字段的值
  166 + let customField = res?.custom_field;
  167 + if (customField) {
  168 + let teacherName = customField[entity_number];
  169 + //填充到课题组老师表单字段中
  170 + form.setFieldValue('institutionContactName', teacherName);
  171 + }
  172 +
  173 + //单位名称,从客户名称中获取,客户名称规则<单位名称>-<联系人名称和电话>
  174 + let namePortions = res?.name?.split('-');
  175 + if (namePortions && namePortions.length >= 2) {
  176 + form.setFieldValue('institution', namePortions[0]);
  177 + }
  178 +
  179 + //如果原来的收货信息没有包含在这次查询出来的收货人选项中,那么清除原来的收货人信息
  180 + let existFlag = false;
  181 +
  182 + //填充收货人选项
  183 + let newProductCustomerContactOptions = res?.bomentity?.map((item) => {
  184 + let address =
  185 + item.contact_person + ',' + item.mobile + ',' + item.contact_address;
  186 + if (address === data.contactAddress) {
  187 + existFlag = true;
  188 + }
  189 + return { ...item, label: address, value: address };
  190 + });
  191 +
  192 + setProductCustomerContactOptions(newProductCustomerContactOptions);
  193 +
  194 + if (!existFlag) {
  195 + //清空原来的收货人信息
  196 + form.setFieldValue('customerShippingAddress', undefined);
  197 + form.setFieldValue('customerContactNumber', undefined);
  198 + form.setFieldValue('customerName', undefined);
  199 + form.setFieldValue('erpCustomerAddress', undefined);
  200 + }
  201 + }
  202 +
  203 + /**
  204 + * 回显金蝶信息
  205 + */
  206 + async function showKindeeInfo() {
  207 + //客户信息
  208 + if (data.customerId) {
  209 + //客户回显
  210 + autoFillCustomerContactSelectOptions(data.customerId);
  211 + }
  212 +
  213 + //商品单位回显
  214 + let list = data?.subOrderInformationLists;
  215 + if (list) {
  216 + let newProductUnitOptionsList = [...productUnitOptionsList];
  217 + for (let i = 0; i < list.length; i++) {
  218 + newProductUnitOptionsList[i] = [
  219 + { label: list[i].unit, value: list[i].unitId },
  220 + ];
  221 + }
  222 + setProductUnitOptionsList(newProductUnitOptionsList);
  223 + }
  224 + }
  225 +
  226 + /**
118 227 * 构建回显数据
119 228 */
120 229 function buildOrderData() {
... ... @@ -167,6 +276,7 @@ export default ({ onClose, data, subOrders, orderOptType }) =&gt; {
167 276 }
168 277  
169 278 getSalesCodeOptions();
  279 + showKindeeInfo();
170 280 }
171 281  
172 282 async function getOldOrderData(id: any) {
... ... @@ -222,36 +332,144 @@ export default ({ onClose, data, subOrders, orderOptType }) =&gt; {
222 332 }>
223 333 >();
224 334  
  335 + useEffect(() => {
  336 + form.setFieldsValue({ ...data });
  337 + //如果是新建,需要清空list
  338 + if (optType('add')) {
  339 + form.resetFields(['list']);
  340 + }
  341 + }, [data]);
  342 +
225 343 /**
226 344 *
227 345 * @param option 商品名称所对应的商品数据
228 346 * @param currentRowData list中当前行的数据
229 347 */
230   - function autoFillProductInfo(option: any, currentRowData: any, index: any) {
231   - let copyList = form.getFieldValue('list');
232   - let currentData = copyList[index];
233   - currentData.productCode = option?.productCode;
234   - currentData.parameters = option?.specifications;
235   - currentData.unit = option?.unit;
236   - form.setFieldValue('list', copyList);
  348 + async function autoFillProductInfo(
  349 + option: any,
  350 + currentRowData: any,
  351 + index: any,
  352 + ) {
  353 + let newProductParametersDisabledFlagList = [
  354 + ...productParametersDisabledFlagList,
  355 + ];
  356 + let newProductUnitOptionsList = [...productUnitOptionsList];
  357 + newProductUnitOptionsList[index] = [];
  358 +
  359 + //是新增商品
  360 + if (option.type === 'add') {
  361 + //商品参数开放权限可以编辑
  362 + newProductParametersDisabledFlagList[index] = false;
  363 +
  364 + //清空商品信息
  365 + let copyList = form.getFieldValue('list');
  366 + let currentData = copyList[index];
  367 + currentData.productCode = undefined;
  368 + currentData.parameters = undefined;
  369 + currentData.unit = undefined;
  370 + currentData.subOrderPayment = undefined;
  371 + currentData.quantity = undefined;
  372 + currentData.notes = undefined;
  373 + currentData.productPrice = undefined;
  374 + form.setFieldValue('list', copyList);
  375 +
  376 + //todo 查询计量单价列表
  377 + if (false) {
  378 + let res = await postKingdeeRepMeasureUnit({ data: {} });
  379 + if (res && res?.rows) {
  380 + for (let row of res?.rows) {
  381 + newProductUnitOptionsList[index].push({
  382 + label: row.name,
  383 + value: row.id,
  384 + });
  385 + }
  386 + }
  387 + }
  388 + } else {
  389 + //选择的是已有的商品,进行内容自动填充
  390 + let copyList = form.getFieldValue('list');
  391 + let currentData = copyList[index];
  392 + currentData.productCode = option?.number;
  393 + currentData.parameters = option?.model;
  394 + currentData.unit = option?.base_unit_name;
  395 +
  396 + //商品id
  397 + currentData.materialId = option?.id;
  398 +
  399 + //单位
  400 + currentData.unit = option.base_unit_name;
  401 + currentData.unitId = option.base_unit_id;
  402 +
  403 + form.setFieldValue('list', copyList);
  404 +
  405 + //商品所在的仓库选项填充
  406 + // let res = await postKingdeeRepMaterialStock({
  407 + // data: {
  408 + // material_id: option.id,
  409 + // },
  410 + // });
  411 + // let newProductInvStockOptionsList = [...productInvStockOptionsList];
  412 + // newProductInvStockOptionsList[index] = res?.rows?.map((item) => {
  413 + // return { label: item.inv_stock, value: item.inv_stock_id };
  414 + // });
  415 + // setProductInvStockOptionsList(newProductInvStockOptionsList);
  416 +
  417 + //商品单位填充,查询商品单位列表
  418 + let res = await postKingdeeRepMaterialUnit({
  419 + data: { material_id: option.id },
  420 + });
  421 + if (res && res.rows) {
  422 + for (let row of res.rows) {
  423 + newProductUnitOptionsList[index].push({
  424 + label: row.unit_name,
  425 + value: row.unit_id,
  426 + });
  427 + }
  428 + }
  429 + //商品参数不允许编辑
  430 + newProductParametersDisabledFlagList[index] = true;
  431 + }
  432 +
  433 + setProductParametersDisabledFlagList(newProductParametersDisabledFlagList);
  434 + setProductUnitOptionsList(newProductUnitOptionsList);
237 435 }
238 436  
239 437 /**
240 438 * 选择收货人后自动填充信息
241 439 * @param option 收货人信息
242 440 */
243   - function autoFillCustomerInfo(option: any) {
244   - form.setFieldValue('institution', option.institution);
245   - form.setFieldValue('institutionContactName', option.institutionContactName);
246   - form.setFieldValue(
247   - 'customerShippingAddress',
248   - option.customerShippingAddress,
249   - );
250   - form.setFieldValue('customerContactNumber', option.customerContactNumber);
251   - form.setFieldValue('customerName', option.customerName);
  441 + async function autoFillCustomerInfo(option: any) {
  442 + form.setFieldValue('customerShippingAddress', option.contact_address);
  443 + form.setFieldValue('customerContactNumber', option.mobile);
  444 + form.setFieldValue('customerName', option.contact_person);
  445 +
  446 + //erp收货地址:需要与客户联系人中的地址一样:姓名,手机号,地址
  447 + form.setFieldValue('contactAddress', option.value);
  448 + }
  449 +
  450 + /**
  451 + * 填充销售代表的信息
  452 + * @param option
  453 + */
  454 + function autoFillSalesInfo(option: any) {
  455 + console.log(option);
  456 + //销售代表对应职员编码填充
  457 + form.setFieldValue('empNumber', option.number);
252 458 }
253 459  
254 460 /**
  461 + * todo 选择商品单位后自动填充
  462 + * @param option
  463 + * @param index
  464 + */
  465 + // function autoFillUnit(option: any, index: any) {
  466 + // let copyList = form.getFieldValue('list');
  467 + // let currentData = copyList[index];
  468 + // currentData.unit = option?.label;
  469 + // form.setFieldValue('list', copyList);
  470 + // }
  471 +
  472 + /**
255 473 * 计算子订单金额
256 474 * @param listMeta 当前商品信息
257 475 */
... ... @@ -294,685 +512,760 @@ export default ({ onClose, data, subOrders, orderOptType }) =&gt; {
294 512 }, []);
295 513  
296 514 return (
297   - <DrawerForm<{
298   - deleteSubOrderLists: any;
299   - name: string;
300   - company: string;
301   - }>
302   - open
303   - width="35%"
304   - title={drawerTitle}
305   - resize={{
306   - onResize() {
307   - console.log('resize!');
308   - },
309   - maxWidth: window.innerWidth * 0.8,
310   - minWidth: 400,
311   - }}
312   - submitter={{
313   - render: (props) => {
314   - return [
315   - <Button
316   - key="cancel"
317   - onClick={() => {
318   - onClose();
319   - }}
320   - >
321   - 取消
322   - </Button>,
323   - <Button
324   - key="ok"
325   - type="primary"
326   - loading={submitBtnLoading}
327   - disabled={optType('after-sales-check')}
328   - onClick={() => {
329   - setSubmitBtnLoading(true);
330   - props.submit();
331   - }}
332   - >
333   - 确定
334   - </Button>,
335   - ];
336   - },
337   - }}
338   - form={form}
339   - autoFocusFirstInput
340   - drawerProps={{
341   - destroyOnClose: true,
342   - maskClosable: false,
343   - }}
344   - submitTimeout={2000}
345   - onFinish={async (values) => {
346   - let res = {};
347   - //附件处理
348   - let list = values.list;
349   - // console.log(list);
350   - list = list.map((item) => {
351   - item.filePaths = item.filePaths?.map((file) => {
352   - console.log(file);
353   - return { url: file.response.data[0] };
  515 + <>
  516 + <DrawerForm<{
  517 + deleteSubOrderLists: any;
  518 + name: string;
  519 + company: string;
  520 + }>
  521 + open
  522 + width="35%"
  523 + title={drawerTitle}
  524 + resize={{
  525 + onResize() {
  526 + console.log('resize!');
  527 + },
  528 + maxWidth: window.innerWidth * 0.8,
  529 + minWidth: 400,
  530 + }}
  531 + submitter={{
  532 + render: (props) => {
  533 + return [
  534 + <Button
  535 + key="cancel"
  536 + onClick={() => {
  537 + onClose();
  538 + }}
  539 + >
  540 + 取消
  541 + </Button>,
  542 + <Button
  543 + key="ok"
  544 + type="primary"
  545 + loading={submitBtnLoading}
  546 + disabled={optType('after-sales-check')}
  547 + onClick={() => {
  548 + setSubmitBtnLoading(true);
  549 + props.submit();
  550 + }}
  551 + >
  552 + 确定
  553 + </Button>,
  554 + ];
  555 + },
  556 + }}
  557 + form={form}
  558 + autoFocusFirstInput
  559 + drawerProps={{
  560 + destroyOnClose: true,
  561 + maskClosable: false,
  562 + }}
  563 + submitTimeout={2000}
  564 + onFinish={async (values) => {
  565 + let res = {};
  566 + //附件处理
  567 + let list = values.list;
  568 + // console.log(list);
  569 + list = list.map((item) => {
  570 + item.filePaths = item.filePaths?.map((file) => {
  571 + console.log(file);
  572 + return { url: file.response.data[0] };
  573 + });
  574 + return item;
354 575 });
355   - return item;
356   - });
357 576  
358   - values.list = list;
359   - values.institution = values.institution?.trim();
360   - values.institutionContactName = values.institutionContactName?.trim();
  577 + values.list = list;
  578 + values.institution = values.institution?.trim();
  579 + values.institutionContactName = values.institutionContactName?.trim();
361 580  
362   - //新增
363   - if (optType('add') || optType('copy')) {
364   - res = await postServiceOrderAddOrder({ data: values });
365   - }
366   - //修改或者申请售后
367   - if (optType('edit') || optType('after-sales')) {
368   - //计算已删除的子订单id
369   - const originIds = originSubOrders.map((item) => {
370   - return item.id;
371   - });
372   - const curIds = form.getFieldValue('list')?.map((item) => {
373   - return item.id;
374   - });
375   - let diff = originIds.filter((item) => !curIds.includes(item));
376   - values.deleteSubOrderLists = diff;
377   -
378   - if (optType('edit')) {
379   - res = await postServiceOrderUpdateOrder({ data: values });
  581 + if (typeof values.erpCustomerId !== 'string') {
  582 + values.erpCustomerId = values.erpCustomerId?.id;
380 583 }
381 584  
382   - if (optType('after-sales')) {
383   - values.filePaths = values.filePaths?.map((file) => {
384   - return { url: file.response.data[0] };
385   - });
386   - res = await postServiceOrderApplyAfterSales({ data: values });
  585 + //新增
  586 + if (optType('add') || optType('copy')) {
  587 + res = await postServiceOrderAddOrder({ data: values });
387 588 }
388   - }
  589 + //修改或者申请售后
  590 + if (optType('edit') || optType('after-sales')) {
  591 + //计算已删除的子订单id
  592 + const originIds = originSubOrders.map((item) => {
  593 + return item.id;
  594 + });
  595 + const curIds = form.getFieldValue('list')?.map((item) => {
  596 + return item.id;
  597 + });
  598 + let diff = originIds.filter((item) => !curIds.includes(item));
  599 + values.deleteSubOrderLists = diff;
389 600  
390   - if (res.result === RESPONSE_CODE.SUCCESS) {
391   - message.success(res.message);
392   - // 不返回不会关闭弹框
393   - onClose(true);
394   - return true;
395   - }
  601 + if (optType('edit')) {
  602 + res = await postServiceOrderUpdateOrder({ data: values });
  603 + }
396 604  
397   - setSubmitBtnLoading(false);
398   - }}
399   - onOpenChange={(val) => {
400   - return !val && onClose();
401   - }}
402   - >
403   - {optType('after-sales') ? (
404   - <>
405   - <h2>售后信息</h2>
406   - <ProFormSelect
407   - key="key"
408   - label="售后方案"
409   - width="lg"
410   - showSearch
411   - name="afterSalesPlan"
412   - options={enumToSelect(AFTE_SALES_PLAN_OPTIONS)}
413   - placeholder="请搜索"
414   - rules={[{ required: true, message: '售后方案必填' }]}
415   - ></ProFormSelect>
416   - <ProFormTextArea
417   - width="lg"
418   - label="售后原因"
419   - name="afterSalesNotes"
420   - rules={[{ required: true, message: '售后原因必填' }]}
421   - />
422   - <ProFormUploadDragger
423   - key="filePaths"
424   - label="售后附件"
425   - name="filePaths"
426   - action="/api/service/order/fileProcess"
427   - fieldProps={{
428   - headers: { Authorization: localStorage.getItem('token') },
429   - }}
430   - />
431   - </>
432   - ) : (
433   - ''
434   - )}
  605 + if (optType('after-sales')) {
  606 + values.filePaths = values.filePaths?.map((file) => {
  607 + return { url: file.response.data[0] };
  608 + });
  609 + res = await postServiceOrderApplyAfterSales({ data: values });
  610 + }
  611 + }
435 612  
436   - <h2>订单基本信息</h2>
437   - <ProFormText
438   - key="id"
439   - name="id"
440   - width="lg"
441   - disabled
442   - label="id"
443   - placeholder="id"
444   - hidden
445   - />
446   - <ProFormSelect
447   - name="salesCode"
448   - key="salesCode"
449   - width="lg"
450   - showSearch
451   - label="销售代表"
452   - placeholder="请输入销售代表"
453   - rules={[{ required: true, message: '销售代表必填' }]}
454   - options={salesCodeOptions}
455   - disabled={optType('after-sales-check')}
456   - />
457   - <ProFormSelect
458   - key="customerName"
459   - label="收货人"
460   - width="lg"
461   - showSearch
462   - name="customerName"
463   - // options={options}
464   - placeholder="请输入收货人"
465   - disabled={optType('after-sales-check')}
466   - rules={[{ required: true, message: '收货人必填' }]}
467   - onChange={(_, option) => {
468   - autoFillCustomerInfo(option);
  613 + if (res.result === RESPONSE_CODE.SUCCESS) {
  614 + message.success(res.message);
  615 + // 不返回不会关闭弹框
  616 + onClose(true);
  617 + return true;
  618 + }
  619 +
  620 + setSubmitBtnLoading(false);
  621 + }}
  622 + onOpenChange={(val) => {
  623 + return !val && onClose();
469 624 }}
470   - fieldProps={{
471   - optionItemRender(item) {
472   - if (item.type === 'add') {
  625 + >
  626 + {optType('after-sales') ? (
  627 + <>
  628 + <h2>售后信息</h2>
  629 + <ProFormSelect
  630 + key="key"
  631 + label="售后方案"
  632 + width="lg"
  633 + showSearch
  634 + name="afterSalesPlan"
  635 + options={enumToSelect(AFTE_SALES_PLAN_OPTIONS)}
  636 + placeholder="请搜索"
  637 + rules={[{ required: true, message: '售后方案必填' }]}
  638 + ></ProFormSelect>
  639 + <ProFormTextArea
  640 + width="lg"
  641 + label="售后原因"
  642 + name="afterSalesNotes"
  643 + rules={[{ required: true, message: '售后原因必填' }]}
  644 + />
  645 + <ProFormUploadDragger
  646 + key="filePaths"
  647 + label="售后附件"
  648 + name="filePaths"
  649 + action="/api/service/order/fileProcess"
  650 + fieldProps={{
  651 + headers: { Authorization: localStorage.getItem('token') },
  652 + }}
  653 + />
  654 + </>
  655 + ) : (
  656 + ''
  657 + )}
  658 +
  659 + <h2>订单基本信息</h2>
  660 + <ProFormText
  661 + key="id"
  662 + name="id"
  663 + width="lg"
  664 + disabled
  665 + label="id"
  666 + placeholder="id"
  667 + hidden
  668 + />
  669 + <ProFormText
  670 + key="empNumber"
  671 + name="empNumber"
  672 + width="lg"
  673 + label="销售职员编码"
  674 + placeholder="销售职员编码"
  675 + hidden
  676 + />
  677 + <ProFormSelect
  678 + name="salesCode"
  679 + key="salesCode"
  680 + width="lg"
  681 + showSearch
  682 + label="销售代表"
  683 + placeholder="请输入销售代表"
  684 + rules={[{ required: true, message: '销售代表必填' }]}
  685 + options={salesCodeOptions}
  686 + onChange={(_, option) => {
  687 + autoFillSalesInfo(option);
  688 + }}
  689 + disabled={optType('after-sales-check')}
  690 + />
  691 + <ProFormText
  692 + key="erpCustomerName"
  693 + name="erpCustomerName"
  694 + hidden
  695 + ></ProFormText>
  696 +
  697 + <ProFormText
  698 + key="contactAddress"
  699 + name="contactAddress"
  700 + hidden
  701 + ></ProFormText>
  702 +
  703 + <ProFormSelect
  704 + name="erpCustomerId"
  705 + key="erpCustomerId"
  706 + width="lg"
  707 + showSearch
  708 + label={
  709 + <>
  710 + <span>客户</span>
  711 + <span
  712 + className="pl-2 text-xs text-[#1677ff] cursor-pointer"
  713 + onClick={() => {
  714 + let customerId = form.getFieldValue('erpCustomerId');
  715 + if (typeof customerId === 'string') {
  716 + setCustomer({ ...customer, id: customerId });
  717 + } else {
  718 + setCustomer({ ...customer, id: customerId.id });
  719 + }
  720 + setKingdeeCstomerModalVisible(true);
  721 + }}
  722 + >
  723 + 编辑客户信息
  724 + </span>
  725 + </>
  726 + }
  727 + placeholder="请选择客户"
  728 + rules={[{ required: true, message: '客户必填' }]}
  729 + onChange={(_, option) => {
  730 + //新增客户
  731 + if (option.type === 'add') {
  732 + setCustomer({ name: option.name });
  733 + setKingdeeCstomerModalVisible(true);
  734 + return;
  735 + }
  736 + autoFillCustomerContactSelectOptions(option.id);
  737 + }}
  738 + initialValue={{
  739 + label: data?.erpCustomerName,
  740 + value: data?.customerId,
  741 + id: data?.customerId,
  742 + }}
  743 + fieldProps={{
  744 + optionItemRender(item) {
  745 + if (item.type === 'add') {
  746 + return (
  747 + <div title={item.name + '(新增客户)'}>
  748 + <span style={{ color: '#333333' }}>{item.name}</span>
  749 + {' | '}
  750 + <span style={{ color: 'orange' }}>自定义</span>
  751 + </div>
  752 + );
  753 + }
473 754 return (
474   - <div title={item.customerName + '(新增商品信息)'}>
475   - <span style={{ color: '#333333' }}>{item.customerName}</span>
476   - {' | '}
477   - <span style={{ color: 'orange' }}>自定义</span>
  755 + <div
  756 + title={
  757 + item.name +
  758 + ' | ' +
  759 + item.customerContactNumber +
  760 + ' | ' +
  761 + (item.customerShippingAddress === undefined
  762 + ? '无地址'
  763 + : item.customerShippingAddress) +
  764 + ' | ' +
  765 + item.institutionContactName +
  766 + ' | ' +
  767 + item.institution
  768 + }
  769 + >
  770 + <span style={{ color: '#333333' }}>{item.name}</span>
478 771 </div>
479 772 );
  773 + },
  774 + }}
  775 + debounceTime={1000}
  776 + request={async (value, {}) => {
  777 + const keywords = value.keyWords;
  778 + const res = await postKingdeeRepCustomer({
  779 + data: { search: keywords },
  780 + });
  781 + let options = res?.rows?.map((c: any) => {
  782 + return {
  783 + ...c,
  784 + label: c.name,
  785 + value: c.id,
  786 + key: c.id,
  787 + };
  788 + });
  789 +
  790 + //第一个商品默认为要新增客户
  791 + if (keywords.trim() !== '') {
  792 + options.unshift({
  793 + name: keywords,
  794 + type: 'add',
  795 + label: keywords,
  796 + value: 3.1415926,
  797 + key: keywords,
  798 + });
480 799 }
481   - return (
482   - <div
483   - title={
484   - item.customerName +
485   - ' | ' +
486   - item.customerContactNumber +
487   - ' | ' +
488   - (item.customerShippingAddress === undefined
489   - ? '无地址'
490   - : item.customerShippingAddress) +
491   - ' | ' +
492   - item.institutionContactName +
493   - ' | ' +
494   - item.institution
495   - }
496   - >
497   - <span style={{ color: '#333333' }}>{item.customerName}</span>
498   - {' | '}
499   - <span style={{ color: '#339999' }}>
500   - {item.customerContactNumber === undefined
501   - ? '无电话号码'
502   - : item.customerContactNumber}
503   - </span>
504   - {' | '}
505   - <span style={{ color: '#666666' }}>
506   - {item.customerShippingAddress === undefined
507   - ? '无地址'
508   - : item.customerShippingAddress}
509   - </span>
510   - {' | '}
511   - <span style={{ color: '#666666' }}>
512   - {item.institutionContactName === undefined
513   - ? '无课题组'
514   - : item.institutionContactName}
515   - </span>
516   - {' | '}
517   - <span style={{ color: '#666666' }}>
518   - {item.institution === undefined ? '无单位' : item.institution}
519   - </span>
520   - </div>
521   - );
522   - },
523   - }}
524   - request={async (value, { params }) => {
525   - const keywords = value.keyWords;
526   - const { data } = await postServiceOrderQueryCustomerNameInformation({
527   - data: { customerName: keywords },
528   - params: params,
529   - });
530   - let options = data.map((c: any) => {
531   - return {
532   - ...c,
533   - label: c.customerName,
534   - value: c.id,
535   - key: c.id,
536   - };
537   - });
  800 + return options;
  801 + }}
  802 + />
  803 + <ProFormSelect
  804 + key="customerName"
  805 + label="收货人"
  806 + width="lg"
  807 + showSearch
  808 + name="customerName"
  809 + placeholder="请选择收货人"
  810 + rules={[{ required: true, message: '收货人必填' }]}
  811 + onChange={(_, option) => {
  812 + autoFillCustomerInfo(option);
  813 + }}
  814 + initialValue={data.contactAddress}
  815 + options={productCustomerContactOptions}
  816 + />
538 817  
539   - //第一个商品默认为要新增的商品
540   - if (keywords.trim() !== '') {
541   - options.unshift({
542   - customerName: keywords,
543   - type: 'add',
544   - label: keywords,
545   - value: 3.1415926,
546   - key: keywords,
547   - });
548   - }
549   - return options;
550   - }}
551   - />
552   - <ProFormText
553   - width="lg"
554   - key="customerContactNumber"
555   - name="customerContactNumber"
556   - label="联系方式"
557   - placeholder="请输入联系方式"
558   - rules={[{ required: true, message: '联系方式必填' }]}
559   - disabled={optType('after-sales-check')}
560   - />
561   - <ProFormText
562   - width="lg"
563   - key="institution"
564   - name="institution"
565   - label="单位"
566   - placeholder="请输入单位"
567   - rules={[{ required: true, message: '单位必填' }]}
568   - disabled={optType('after-sales-check')}
569   - />
570   - <ProFormText
571   - width="lg"
572   - key="institutionContactName"
573   - name="institutionContactName"
574   - label="课题组"
575   - placeholder="请输入课题组"
576   - rules={[{ required: true, message: '课题组必填' }]}
577   - disabled={optType('after-sales-check')}
578   - />
579   - <ProFormTextArea
580   - width="lg"
581   - key="customerShippingAddress"
582   - name="customerShippingAddress"
583   - label="收货地址"
584   - placeholder="请输入收货地址"
585   - rules={[{ required: true, message: '收货地址必填' }]}
586   - disabled={optType('after-sales-check')}
587   - />
588   - <div id="total-payment">
589   - <ProFormDigit
590   - name="totalPayment"
  818 + <ProFormText
591 819 width="lg"
592   - key="totalPayment"
593   - label="支付总额(¥)"
594   - rules={[{ required: true, message: '支付总额必填' }]}
595   - tooltip="点击计算,合计所有子订单金额"
596   - disabled={optType('after-sales-check')}
597   - fieldProps={{
598   - addonAfter: (
599   - <Button
600   - className="rounded-l-none"
601   - type="primary"
602   - onClick={computeTotalPayment}
603   - disabled={optType('after-sales-check')}
604   - >
605   - 计算
606   - </Button>
607   - ),
  820 + key="customerContactNumber"
  821 + name="customerContactNumber"
  822 + label="联系方式"
  823 + placeholder="请输入联系方式"
  824 + rules={[{ required: true, message: '联系方式必填' }]}
  825 + disabled
  826 + />
  827 + <ProFormText
  828 + width="lg"
  829 + key="institution"
  830 + name="institution"
  831 + label="单位"
  832 + placeholder="请输入单位"
  833 + rules={[{ required: true, message: '单位必填' }]}
  834 + disabled
  835 + />
  836 + <ProFormText
  837 + width="lg"
  838 + key="institutionContactName"
  839 + name="institutionContactName"
  840 + label="课题组"
  841 + placeholder="请输入课题组"
  842 + rules={[{ required: true, message: '课题组必填' }]}
  843 + disabled
  844 + />
  845 + <ProFormTextArea
  846 + width="lg"
  847 + key="customerShippingAddress"
  848 + name="customerShippingAddress"
  849 + label="收货地址"
  850 + placeholder="请输入收货地址"
  851 + rules={[{ required: true, message: '收货地址必填' }]}
  852 + disabled
  853 + />
  854 + <div id="total-payment">
  855 + <ProFormDigit
  856 + name="totalPayment"
  857 + width="lg"
  858 + key="totalPayment"
  859 + label="支付总额(¥)"
  860 + rules={[{ required: true, message: '支付总额必填' }]}
  861 + tooltip="点击计算,合计所有子订单金额"
  862 + fieldProps={{
  863 + addonAfter: (
  864 + <Button
  865 + className="rounded-l-none"
  866 + type="primary"
  867 + onClick={computeTotalPayment}
  868 + >
  869 + 计算
  870 + </Button>
  871 + ),
  872 + }}
  873 + // disabled={mainInfoDisbled}
  874 + />
  875 + </div>
  876 +
  877 + <ProFormSelect
  878 + placeholder="请输入支付渠道"
  879 + name="paymentChannel"
  880 + width="lg"
  881 + key="paymentChannel"
  882 + label="支付渠道"
  883 + options={enumToSelect(PAYMENT_CHANNEL_OPTIONS)}
  884 + rules={[{ required: true, message: '支付渠道必填' }]}
  885 + // disabled={mainInfoDisbled}
  886 + />
  887 + <ProFormSelect
  888 + placeholder="请输入支付方式"
  889 + name="paymentMethod"
  890 + width="lg"
  891 + key="paymentMethod"
  892 + label="支付方式"
  893 + options={enumToSelect(PAYMENT_METHOD_OPTIONS)}
  894 + rules={[{ required: true, message: '支付方式必填' }]}
  895 + // disabled={mainInfoDisbled}
  896 + />
  897 + <ProFormSelect
  898 + placeholder="选择是否需要开票"
  899 + name="invoicingStatus"
  900 + width="lg"
  901 + key="invoicingStatus"
  902 + label="是否需要开票"
  903 + options={getInvoicingSelect()}
  904 + // disabled={mainInfoDisbled}
  905 + onChange={(_, option) => {
  906 + setInvoicingStatus(option.value);
  907 + if (option.value === 'UN_INVOICE') {
  908 + form.setFieldValue('invoiceIdentificationNumber', undefined);
  909 + form.setFieldValue('bank', undefined);
  910 + form.setFieldValue('bankAccountNumber', undefined);
  911 + }
608 912 }}
  913 + rules={[{ required: true, message: '是否需要开票必填' }]}
  914 + />
  915 + <ProFormText
  916 + width="lg"
  917 + name="invoiceIdentificationNumber"
  918 + label="开票信息"
  919 + key="invoiceIdentificationNumber"
609 920 // disabled={mainInfoDisbled}
  921 + hidden={invoicingStatus === 'UN_INVOICE'}
  922 + placeholder="请输入开票信息"
  923 + rules={[
  924 + {
  925 + required: invoicingStatus === 'UN_INVOICE' ? false : true,
  926 + message: '开票信息必填',
  927 + },
  928 + ]}
610 929 />
611   - </div>
612   -
613   - <ProFormSelect
614   - placeholder="请输入支付渠道"
615   - name="paymentChannel"
616   - width="lg"
617   - key="paymentChannel"
618   - label="支付渠道"
619   - options={enumToSelect(PAYMENT_CHANNEL_OPTIONS)}
620   - rules={[{ required: true, message: '支付渠道必填' }]}
621   - disabled={optType('after-sales-check')}
622   - />
623   - <ProFormSelect
624   - placeholder="请输入支付方式"
625   - name="paymentMethod"
626   - width="lg"
627   - key="paymentMethod"
628   - label="支付方式"
629   - options={enumToSelect(PAYMENT_METHOD_OPTIONS)}
630   - rules={[{ required: true, message: '支付方式必填' }]}
631   - disabled={optType('after-sales-check')}
632   - />
633   - <ProFormSelect
634   - placeholder="选择是否需要开票"
635   - name="invoicingStatus"
636   - width="lg"
637   - key="invoicingStatus"
638   - label="是否需要开票"
639   - options={getInvoicingSelect()}
640   - disabled={optType('after-sales-check')}
641   - onChange={(_, option) => {
642   - setInvoicingStatus(option.value);
643   - if (option.value === 'UN_INVOICE') {
644   - form.setFieldValue('invoiceIdentificationNumber', undefined);
645   - form.setFieldValue('bank', undefined);
646   - form.setFieldValue('bankAccountNumber', undefined);
647   - }
648   - }}
649   - rules={[{ required: true, message: '是否需要开票必填' }]}
650   - />
651   - <ProFormText
652   - width="lg"
653   - name="invoiceIdentificationNumber"
654   - label="开票信息"
655   - key="invoiceIdentificationNumber"
656   - disabled={optType('after-sales-check')}
657   - hidden={invoicingStatus === 'UN_INVOICE'}
658   - placeholder="请输入开票信息"
659   - rules={[
660   - {
661   - required: invoicingStatus === 'UN_INVOICE' ? false : true,
662   - message: '开票信息必填',
663   - },
664   - ]}
665   - />
666 930  
667   - {getUserInfo().roleSmallVO?.code === 'admin' ? (
668   - <ProFormDateTimePicker
  931 + {getUserInfo().roleSmallVO?.code === 'admin' ? (
  932 + <ProFormDateTimePicker
  933 + width="lg"
  934 + key="invoicingTime"
  935 + name="invoicingTime"
  936 + // disabled={mainInfoDisbled}
  937 + hidden={invoicingStatus === 'UN_INVOICE'}
  938 + label="开票时间"
  939 + placeholder="请输入开票时间"
  940 + />
  941 + ) : (
  942 + ''
  943 + )}
  944 + <ProFormText
669 945 width="lg"
670   - key="invoicingTime"
671   - name="invoicingTime"
672   - disabled={optType('after-sales-check')}
  946 + name="bank"
  947 + key="bank"
  948 + label="开户银行"
  949 + // disabled={mainInfoDisbled}
673 950 hidden={invoicingStatus === 'UN_INVOICE'}
674   - label="开票时间"
675   - placeholder="请输入开票时间"
  951 + placeholder="请输入开户银行"
676 952 />
677   - ) : (
678   - ''
679   - )}
680   - <ProFormText
681   - width="lg"
682   - name="bank"
683   - key="bank"
684   - label="开户银行"
685   - disabled={optType('after-sales-check')}
686   - hidden={invoicingStatus === 'UN_INVOICE'}
687   - placeholder="请输入开户银行"
688   - />
689   - <ProFormText
690   - width="lg"
691   - key="bankAccountNumber"
692   - name="bankAccountNumber"
693   - hidden={invoicingStatus === 'UN_INVOICE'}
694   - label="银行账号"
695   - disabled={optType('after-sales-check')}
696   - placeholder="请输入银行账号"
697   - />
698   - <ProFormTextArea
699   - width="lg"
700   - name="notes"
701   - label="备注"
702   - key="notes"
703   - disabled={optType('after-sales-check')}
704   - placeholder="请输入备注"
705   - rules={[
706   - {
707   - max: 120, // 最大长度为120个字符
708   - message: '备注不能超过120个字符',
709   - },
710   - ]}
711   - />
712   -
713   - <h2>商品信息</h2>
714   - <ProFormList
715   - creatorButtonProps={{ disabled: optType('after-sales-check') }}
716   - name="list"
717   - label=""
718   - copyIconProps={false} //复制按钮不显示
719   - initialValue={[
720   - {
721   - productCode: '',
722   - productName: '',
723   - quantity: '',
724   - productPrice: '',
725   - parameters: '',
726   - subOrderPayment: '',
727   - },
728   - ]}
729   - actionGuard={{
730   - beforeRemoveRow: async () => {
731   - return new Promise((resolve) => {
732   - let list = form.getFieldValue('list');
733   - if (list?.length === 1) {
734   - message.error('删除失败,至少要有一个商品');
735   - resolve(false);
736   - return;
737   - }
738   - resolve(true);
739   - });
740   - },
741   - }}
742   - itemRender={(doms, listMeta) => {
743   - if (optType('edit')) {
744   - let i = 0;
745   - let defaultFileList = listMeta.record?.listAnnex?.map((annex) => {
746   - return {
747   - uid: i++,
748   - name: annex,
749   - status: 'uploaded',
750   - url: annex,
751   - response: { data: [annex] },
752   - };
753   - });
754   - fileList[listMeta.index] = defaultFileList;
755   - }
756   - let itemFileList = fileList[listMeta.index];
757   - return (
758   - <ProCard
759   - bordered
760   - extra={doms.action}
761   - title={'商品' + (listMeta.index + 1)}
762   - style={{
763   - marginBlockEnd: 8,
764   - }}
765   - >
766   - {[
767   - <ProFormSelect
768   - key="key"
769   - label="商品名称"
770   - width="lg"
771   - showSearch
772   - name="productName"
773   - // options={options}
774   - placeholder="请搜索商品"
775   - rules={[{ required: true, message: '商品名称必填' }]}
776   - onChange={(_, option) => {
777   - autoFillProductInfo(option, listMeta, listMeta.index);
778   - }}
779   - disabled={optType('after-sales-check')}
780   - fieldProps={{
781   - optionItemRender(item) {
782   - if (item.type === 'add') {
  953 + <ProFormText
  954 + width="lg"
  955 + key="bankAccountNumber"
  956 + name="bankAccountNumber"
  957 + hidden={invoicingStatus === 'UN_INVOICE'}
  958 + label="银行账号"
  959 + // disabled={mainInfoDisbled}
  960 + placeholder="请输入银行账号"
  961 + />
  962 + <ProFormTextArea
  963 + width="lg"
  964 + name="notes"
  965 + label="备注"
  966 + key="notes"
  967 + // disabled={mainInfoDisbled}
  968 + placeholder="请输入备注"
  969 + rules={[
  970 + {
  971 + max: 120, // 最大长度为120个字符
  972 + message: '备注不能超过120个字符',
  973 + },
  974 + ]}
  975 + />
  976 +
  977 + <h2>商品信息</h2>
  978 + <ProFormList
  979 + creatorButtonProps={{ disabled: false }}
  980 + name="list"
  981 + label=""
  982 + copyIconProps={false} //复制按钮不显示
  983 + initialValue={[
  984 + {
  985 + productCode: '',
  986 + productName: '',
  987 + quantity: '',
  988 + productPrice: '',
  989 + parameters: '',
  990 + subOrderPayment: '',
  991 + },
  992 + ]}
  993 + actionGuard={{
  994 + beforeRemoveRow: async (index) => {
  995 + return new Promise((resolve) => {
  996 + if (index === 0) {
  997 + message.error('第一行数据不能删除');
  998 + resolve(false);
  999 + return;
  1000 + }
  1001 + resolve(true);
  1002 + });
  1003 + },
  1004 + }}
  1005 + itemRender={(doms, listMeta) => {
  1006 + if (optType('edit')) {
  1007 + let i = 0;
  1008 + let defaultFileList = listMeta.record?.listAnnex?.map((annex) => {
  1009 + return {
  1010 + uid: i++,
  1011 + name: annex,
  1012 + status: 'uploaded',
  1013 + url: annex,
  1014 + response: { data: [annex] },
  1015 + };
  1016 + });
  1017 + fileList[listMeta.index] = defaultFileList;
  1018 + }
  1019 + let itemFileList = fileList[listMeta.index];
  1020 + return (
  1021 + <ProCard
  1022 + bordered
  1023 + extra={doms.action}
  1024 + title={'商品' + (listMeta.index + 1)}
  1025 + style={{
  1026 + marginBlockEnd: 8,
  1027 + }}
  1028 + >
  1029 + {[
  1030 + <ProFormText
  1031 + key={'material' + listMeta.index}
  1032 + name="materialId"
  1033 + hidden
  1034 + ></ProFormText>,
  1035 + <ProFormSelect
  1036 + key="key"
  1037 + label="商品名称"
  1038 + width="lg"
  1039 + showSearch
  1040 + name="productName"
  1041 + // options={options}
  1042 + placeholder="请搜索商品"
  1043 + rules={[{ required: true, message: '商品名称必填' }]}
  1044 + onChange={(_, option) => {
  1045 + autoFillProductInfo(option, listMeta, listMeta.index);
  1046 + }}
  1047 + initialValue={{
  1048 + label: listMeta?.record?.productName,
  1049 + value: listMeta?.record?.materialId,
  1050 + }}
  1051 + fieldProps={{
  1052 + optionItemRender(item) {
  1053 + if (item.type === 'add') {
  1054 + return (
  1055 + <div title={item.name + '(新增商品信息)'}>
  1056 + <span style={{ color: '#333333' }}>
  1057 + {item.label}
  1058 + </span>
  1059 + {' | '}
  1060 + <span style={{ color: 'orange' }}>新增商品</span>
  1061 + </div>
  1062 + );
  1063 + }
783 1064 return (
784   - <div title={item.productName + '(新增商品信息)'}>
  1065 + <div
  1066 + title={
  1067 + item.label +
  1068 + ' | ' +
  1069 + (item.model === undefined
  1070 + ? '无参数'
  1071 + : item.model) +
  1072 + ' | ' +
  1073 + item.base_unit_name
  1074 + }
  1075 + >
785 1076 <span style={{ color: '#333333' }}>
786   - {item.productName}
  1077 + {item.label}
787 1078 </span>
788 1079 {' | '}
789   - <span style={{ color: 'orange' }}>新增商品</span>
  1080 + <span style={{ color: '#339999' }}>
  1081 + {item.model === undefined ? '无参数' : item.model}
  1082 + </span>
  1083 + {' | '}
  1084 + <span style={{ color: '#666666' }}>
  1085 + {item.base_unit_name === undefined
  1086 + ? '无单位'
  1087 + : item.base_unit_name}
  1088 + </span>
790 1089 </div>
791 1090 );
792   - }
793   - return (
794   - <div
795   - title={
796   - item.label +
797   - ' | ' +
798   - (item.specifications === undefined
799   - ? '无参数'
800   - : item.specifications) +
801   - ' | ' +
802   - item.unit
803   - }
804   - >
805   - <span style={{ color: '#333333' }}>{item.label}</span>
806   - {' | '}
807   - <span style={{ color: '#339999' }}>
808   - {item.specifications === undefined
809   - ? '无参数'
810   - : item.specifications}
811   - </span>
812   - {' | '}
813   - <span style={{ color: '#666666' }}>
814   - {item.unit === undefined ? '无单位' : item.unit}
815   - </span>
816   - </div>
817   - );
818   - },
819   - }}
820   - request={async (value, { params }) => {
821   - const keywords = value.keyWords;
822   - const { data } =
823   - await postServiceOrderQueryProductInformation({
824   - data: { productName: keywords },
825   - params: params,
  1091 + },
  1092 + }}
  1093 + debounceTime={1000}
  1094 + request={async (value) => {
  1095 + const keywords = value.keyWords;
  1096 + const res = await postKingdeeRepMaterial({
  1097 + data: { search: keywords },
826 1098 });
827   - let options = data.map((p: any) => {
828   - return {
829   - ...p,
830   - label: p.productName,
831   - value: p.id + '|' + p.productName,
832   - key: p.id,
833   - };
834   - });
835   -
836   - //第一个商品默认为要新增的商品
837   - if (keywords.trim() !== '') {
838   - options.unshift({
839   - productName: keywords,
840   - type: 'add',
841   - label: keywords,
842   - value: 13 + '|' + keywords,
843   - key: keywords,
  1099 + let options = res?.rows?.map((p: any) => {
  1100 + return {
  1101 + ...p,
  1102 + label: p.name,
  1103 + value: p.id + '|' + p.name,
  1104 + key: p.id,
  1105 + };
844 1106 });
  1107 +
  1108 + //第一个商品默认为要新增的商品
  1109 + if (keywords.trim() !== '') {
  1110 + options.unshift({
  1111 + productName: keywords,
  1112 + type: 'add',
  1113 + label: keywords,
  1114 + value: 13 + '|' + keywords,
  1115 + key: keywords,
  1116 + });
  1117 + }
  1118 + return options;
  1119 + }}
  1120 + />,
  1121 + <ProFormText
  1122 + key={'productCode' + listMeta.index}
  1123 + width="lg"
  1124 + name="productCode"
  1125 + disabled
  1126 + label={
  1127 + <>
  1128 + <span>商品编码</span>
  1129 + <span className="pl-2 text-xs text-gray-400">
  1130 + 新增商品时,商品编码由系统自动生成
  1131 + </span>
  1132 + </>
845 1133 }
846   - return options;
847   - }}
848   - />,
849   - <ProFormText
850   - key={'productCode' + listMeta.index}
851   - width="lg"
852   - name="productCode"
853   - disabled
854   - label={
855   - <>
856   - <span>商品编码</span>
857   - <span className="pl-2 text-xs text-gray-400">
858   - 新增商品时,商品编码由系统自动生成
859   - </span>
860   - </>
861   - }
862   - placeholder="未输入商品名称"
863   - />,
864   - <ProFormText
865   - key={'parameters' + listMeta.index}
866   - width="lg"
867   - name="parameters"
868   - label="商品参数"
869   - placeholder="请输入商品参数"
870   - disabled={optType('after-sales-check')}
871   - rules={[{ required: true, message: '商品参数必填' }]}
872   - />,
873   - <ProFormDigit
874   - key={'quantity' + listMeta.index}
875   - width="lg"
876   - name="quantity"
877   - label="商品数量"
878   - fieldProps={{
879   - onChange: (value) => {
880   - listMeta.record.quantity = value;
881   - computeSubOrderPayment(listMeta);
882   - },
883   - precision: 0,
884   - }}
885   - placeholder="请输入商品数量"
886   - disabled={optType('after-sales-check')}
887   - rules={[{ required: true, message: '商品数量必填' }]}
888   - />,
889   - <ProFormDigit
890   - key={'productPrice' + listMeta.index}
891   - width="lg"
892   - name="productPrice"
893   - label="商品单价"
894   - fieldProps={{
895   - onChange: (value) => {
896   - listMeta.record.productPrice = value;
897   - computeSubOrderPayment(listMeta);
898   - },
899   - precision: 2,
900   - }}
901   - placeholder="请输入商品单价"
902   - disabled={optType('after-sales-check')}
903   - rules={[{ required: true, message: '商品单价必填' }]}
904   - />,
905   - <ProFormText
906   - key={'unit' + listMeta.index}
907   - width="lg"
908   - name="unit"
909   - label="商品单位"
910   - placeholder="请输入商品单位"
911   - disabled={optType('after-sales-check')}
912   - rules={[{ required: true, message: '商品单位必填' }]}
913   - />,
914   -
915   - <ProFormDigit
916   - width="lg"
917   - key={'subOrderPayment' + listMeta.index}
918   - name="subOrderPayment"
919   - label="子订单金额"
920   - placeholder="请输入子订单金额"
921   - tooltip="商品数量和单价变化后会自动计算子订单金额"
922   - disabled={optType('after-sales-check')}
923   - rules={[{ required: true, message: '子订单金额必填' }]}
924   - />,
925   - <ProFormSelect
926   - key={'productBelongBusiness' + listMeta.index}
927   - placeholder="请输入所属事业部"
928   - name="productBelongBusiness"
929   - width="lg"
930   - label="所属事业部"
931   - options={enumToSelect(PRODUCT_BELONG_DEPARTMENT_OPTIONS)}
932   - initialValue={'EXPERIMENTAL_CONSUMABLES'}
933   - rules={[{ required: true, message: '所属事业部必填' }]}
934   - disabled={optType('after-sales-check')}
935   - />,
936   - <ProFormTextArea
937   - key={'notes' + listMeta.index}
938   - width="lg"
939   - name="notes"
940   - disabled={optType('after-sales-check')}
941   - label={
942   - <div>
943   - <span>备注</span>
944   - <span className="pl-2 text-xs text-gray-400">
945   - 备注将体现在出货单上,请将需要仓管看见的信息写在备注上,例如需要开收据等信息。
946   - </span>
947   - </div>
948   - }
949   - placeholder="请输入备注"
950   - rules={[
951   - {
952   - max: 120, // 最大长度为120个字符
953   - message: '备注不能超过120个字符',
954   - },
955   - ]}
956   - />,
957   - <>
958   - <ProFormUploadDragger
959   - key={'filePaths' + listMeta.index}
960   - label="附件"
961   - name="filePaths"
962   - action="/api/service/order/fileProcess"
963   - disabled={optType('after-sales-check')}
  1134 + placeholder="未输入商品名称"
  1135 + />,
  1136 + // <ProFormSelect
  1137 + // key="inv_stock"
  1138 + // placeholder="请选择仓库"
  1139 + // name="invStockId"
  1140 + // width="lg"
  1141 + // label="仓库"
  1142 + // options={productInvStockOptionsList[listMeta.index]}
  1143 + // />,
  1144 + <ProFormText
  1145 + key={'parameters' + listMeta.index}
  1146 + width="lg"
  1147 + name="parameters"
  1148 + label="商品参数"
  1149 + placeholder="请输入商品参数"
  1150 + rules={[{ required: true, message: '商品参数必填' }]}
  1151 + disabled={
  1152 + productParametersDisabledFlagList[listMeta.index] !==
  1153 + false
  1154 + }
  1155 + />,
  1156 + <ProFormDigit
  1157 + key={'quantity' + listMeta.index}
  1158 + width="lg"
  1159 + name="quantity"
  1160 + label="商品数量"
964 1161 fieldProps={{
965   - headers: { Authorization: localStorage.getItem('token') },
966   - itemFileList,
  1162 + onChange: (value) => {
  1163 + listMeta.record.quantity = value;
  1164 + computeSubOrderPayment(listMeta);
  1165 + },
967 1166 }}
968   - />
969   - </>,
970   - ]}
971   - </ProCard>
972   - );
973   - }}
974   - actionRef={actionRef}
975   - ></ProFormList>
976   - </DrawerForm>
  1167 + placeholder="请输入商品数量"
  1168 + rules={[{ required: true, message: '商品数量必填' }]}
  1169 + />,
  1170 + <ProFormDigit
  1171 + key={'productPrice' + listMeta.index}
  1172 + width="lg"
  1173 + name="productPrice"
  1174 + label="商品单价"
  1175 + fieldProps={{
  1176 + onChange: (value) => {
  1177 + listMeta.record.productPrice = value;
  1178 + computeSubOrderPayment(listMeta);
  1179 + },
  1180 + }}
  1181 + placeholder="请输入商品单价"
  1182 + rules={[{ required: true, message: '商品单价必填' }]}
  1183 + />,
  1184 + <ProFormText
  1185 + key={'unit' + listMeta.index}
  1186 + width="lg"
  1187 + name="unit"
  1188 + label="商品单位"
  1189 + placeholder="请输入商品单位"
  1190 + disabled={optType('after-sales-check')}
  1191 + rules={[{ required: true, message: '商品单位必填' }]}
  1192 + />,
  1193 +
  1194 + <ProFormDigit
  1195 + width="lg"
  1196 + key={'subOrderPayment' + listMeta.index}
  1197 + name="subOrderPayment"
  1198 + label="子订单金额"
  1199 + placeholder="请输入子订单金额"
  1200 + tooltip="商品数量和单价变化后会自动计算子订单金额"
  1201 + disabled={optType('after-sales-check')}
  1202 + rules={[{ required: true, message: '子订单金额必填' }]}
  1203 + />,
  1204 + <ProFormSelect
  1205 + key={'productBelongBusiness' + listMeta.index}
  1206 + placeholder="请输入所属事业部"
  1207 + name="productBelongBusiness"
  1208 + width="lg"
  1209 + label="所属事业部"
  1210 + options={enumToSelect(PRODUCT_BELONG_DEPARTMENT_OPTIONS)}
  1211 + initialValue={'EXPERIMENTAL_CONSUMABLES'}
  1212 + rules={[{ required: true, message: '所属事业部必填' }]}
  1213 + disabled={optType('after-sales-check')}
  1214 + />,
  1215 + <ProFormTextArea
  1216 + key={'notes' + listMeta.index}
  1217 + width="lg"
  1218 + name="notes"
  1219 + disabled={optType('after-sales-check')}
  1220 + label={
  1221 + <div>
  1222 + <span>备注</span>
  1223 + <span className="pl-2 text-xs text-gray-400">
  1224 + 备注将体现在出货单上,请将需要仓管看见的信息写在备注上,例如需要开收据等信息。
  1225 + </span>
  1226 + </div>
  1227 + }
  1228 + placeholder="请输入备注"
  1229 + rules={[
  1230 + {
  1231 + max: 120, // 最大长度为120个字符
  1232 + message: '备注不能超过120个字符',
  1233 + },
  1234 + ]}
  1235 + />,
  1236 + <>
  1237 + <ProFormUploadDragger
  1238 + key={'filePaths' + listMeta.index}
  1239 + label="附件"
  1240 + name="filePaths"
  1241 + action="/api/service/order/fileProcess"
  1242 + disabled={optType('after-sales-check')}
  1243 + fieldProps={{
  1244 + headers: {
  1245 + Authorization: localStorage.getItem('token'),
  1246 + },
  1247 + itemFileList,
  1248 + }}
  1249 + />
  1250 + </>,
  1251 + ]}
  1252 + </ProCard>
  1253 + );
  1254 + }}
  1255 + actionRef={actionRef}
  1256 + ></ProFormList>
  1257 + </DrawerForm>
  1258 + {kingdeeCstomerModalVisible && (
  1259 + <KingdeeCustomerModal
  1260 + setVisible={setKingdeeCstomerModalVisible}
  1261 + data={customer}
  1262 + onClose={(customerId: any) => {
  1263 + setKingdeeCstomerModalVisible(false);
  1264 + //回显已经新建好的客户
  1265 + autoFillCustomerContactSelectOptions(customerId);
  1266 + }}
  1267 + />
  1268 + )}
  1269 + </>
977 1270 );
978 1271 };
... ...
src/pages/Order/index.tsx
1 1 import ButtonConfirm from '@/components/ButtomConfirm';
2 2 import { RESPONSE_CODE } from '@/constants/enum';
3 3 import {
  4 + postKingdeeRepSalBillOutbound,
  5 + postKingdeeRepSalOrderSave,
4 6 postServiceOrderNoNeedSend,
5 7 postServiceOrderOrderCancel,
6 8 postServiceOrderProcureOrder,
... ... @@ -1988,6 +1990,50 @@ const OrderPage = () =&gt; {
1988 1990 ''
1989 1991 )} */}
1990 1992  
  1993 + {record.mainPath?.includes('salOrderSave') ? (
  1994 + <ButtonConfirm
  1995 + className="p-0"
  1996 + title="是否推送至金蝶ERP?"
  1997 + text="推送ERP"
  1998 + onConfirm={async () => {
  1999 + let res = await postKingdeeRepSalOrderSave({
  2000 + data: {
  2001 + id: record.id,
  2002 + },
  2003 + });
  2004 +
  2005 + if (res && res.result === RESPONSE_CODE.SUCCESS) {
  2006 + message.success('推送成功');
  2007 + mainTableRef.current.reload();
  2008 + }
  2009 + }}
  2010 + />
  2011 + ) : (
  2012 + ''
  2013 + )}
  2014 +
  2015 + {record.mainPath?.includes('salBillOutbound') ? (
  2016 + <ButtonConfirm
  2017 + className="p-0"
  2018 + title="是否下推金蝶ERP出库单?"
  2019 + text="下推出库"
  2020 + onConfirm={async () => {
  2021 + let res = await postKingdeeRepSalBillOutbound({
  2022 + data: {
  2023 + id: record.id,
  2024 + },
  2025 + });
  2026 +
  2027 + if (res && res.result === RESPONSE_CODE.SUCCESS) {
  2028 + message.success('下推成功');
  2029 + mainTableRef.current.reload();
  2030 + }
  2031 + }}
  2032 + />
  2033 + ) : (
  2034 + ''
  2035 + )}
  2036 +
1991 2037 {record.mainPath?.includes('orderCancel') ? (
1992 2038 <ButtonConfirm
1993 2039 className="p-0"
... ...
src/services/definition.ts
... ... @@ -324,6 +324,63 @@ export interface AuditVO {
324 324 total?: number;
325 325 }
326 326  
  327 +export interface BillEntry {
  328 + auditLock?: boolean;
  329 + baseEntityNumber?: string;
  330 + defValue?: string;
  331 + displayName?: string;
  332 + entityNumber?: string;
  333 + /** @format int32 */
  334 + fieldType?: number;
  335 + id?: string;
  336 + mustInput?: boolean;
  337 + number?: string;
  338 + typeId?: string;
  339 +}
  340 +
  341 +export interface Bomentity {
  342 + birthday?: string;
  343 + contactAddress?: string;
  344 + contactCityId?: string;
  345 + contactCityName?: string;
  346 + contactCityNumber?: string;
  347 + contactCountryId?: string;
  348 + contactCountryName?: string;
  349 + contactCountryNumber?: string;
  350 + contactDistrictId?: string;
  351 + contactDistrictName?: string;
  352 + contactDistrictNumber?: string;
  353 + contactPerson?: string;
  354 + contactProvinceId?: string;
  355 + contactProvinceName?: string;
  356 + contactProvinceNumber?: string;
  357 + email?: string;
  358 + gender?: string;
  359 + groupNumber?: string;
  360 + id?: string;
  361 + isDefaultLinkman?: boolean;
  362 + mobile?: string;
  363 + phone?: string;
  364 + qq?: string;
  365 + rate?: string;
  366 + seq?: string;
  367 + wechat?: string;
  368 +}
  369 +
  370 +export interface CancelInvoiceAndBankStatementDto {
  371 + /**
  372 + * @description
  373 + * 取消关联的银行流水id集合
  374 + */
  375 + cancelId?: Array<number>;
  376 + /**
  377 + * @description
  378 + * 发票id
  379 + * @format int64
  380 + */
  381 + invoiceId?: number;
  382 +}
  383 +
327 384 export interface CaptchaMessageVO {
328 385 /** @format int32 */
329 386 current?: number;
... ... @@ -337,6 +394,187 @@ export interface CaptchaMessageVO {
337 394 type?: string;
338 395 }
339 396  
  397 +export interface Contactperson {
  398 + birthday?: string;
  399 + contactAddress?: string;
  400 + contactCityId?: string;
  401 + contactCountryId?: string;
  402 + contactDistrictId?: string;
  403 + contactPerson?: string;
  404 + contactProvinceId?: string;
  405 + email?: string;
  406 + /** @format int32 */
  407 + gender?: number;
  408 + id?: string;
  409 + isDefaultLinkman?: boolean;
  410 + mobile?: string;
  411 + phone?: string;
  412 + qq?: string;
  413 + wechat?: string;
  414 +}
  415 +
  416 +export interface CustomField {
  417 + baseEntityNumber?: string;
  418 + comboItems?: Array<Item>;
  419 + defValue?: string;
  420 + displayName?: string;
  421 + /** @format int32 */
  422 + fieldType?: number;
  423 + id?: string;
  424 + mustInput?: boolean;
  425 + number?: string;
  426 +}
  427 +
  428 +export interface CustomFieldRes {
  429 + head?: Array<CustomField>;
  430 + instantPayFromToEntry?: Array<BillEntry>;
  431 + materialEntity?: Array<CustomField>;
  432 + payFromToEntry?: Array<BillEntry>;
  433 +}
  434 +
  435 +export interface CustomerCustomerListReq {
  436 + clevel?: string;
  437 + contactPersonMain?: string;
  438 + createEndTime?: string;
  439 + createStartTime?: string;
  440 + customerMaturity?: string;
  441 + /** @format int32 */
  442 + enable?: number;
  443 + group?: Array<string>;
  444 + isDataPerm?: boolean;
  445 + mobileMain?: string;
  446 + modifyEndTime?: string;
  447 + modifyStartTime?: string;
  448 + orderBy?: string;
  449 + page?: string;
  450 + pageSize?: string;
  451 + saleDeptId?: string;
  452 + salerId?: string;
  453 + search?: string;
  454 + showAlarm?: boolean;
  455 + showBusinessTime?: boolean;
  456 + showContactDetail?: boolean;
  457 + showDebt?: boolean;
  458 + showTraceInfo?: boolean;
  459 + showUnVisitDays?: boolean;
  460 + traceEndDate?: string;
  461 + traceStartDate?: string;
  462 +}
  463 +
  464 +export interface CustomerDetailDto {
  465 + id?: string;
  466 + number?: string;
  467 + showBusinessTime?: boolean;
  468 + showDebt?: boolean;
  469 + showPeriod?: boolean;
  470 + showUnVisitDays?: boolean;
  471 +}
  472 +
  473 +export interface CustomerDetailRes {
  474 + accountOpenAddr?: string;
  475 + addr?: string;
  476 + bank?: string;
  477 + bankAccount?: string;
  478 + bomentity?: Array<Bomentity>;
  479 + cityId?: string;
  480 + cityName?: string;
  481 + cityNumber?: string;
  482 + clevelId?: string;
  483 + clevelName?: string;
  484 + clevelNumber?: string;
  485 + countryId?: string;
  486 + countryName?: string;
  487 + countryNumber?: string;
  488 + createTime?: string;
  489 + createrFieldName?: string;
  490 + customField?: {
  491 + [propertyName: string]: string;
  492 + };
  493 + districtId?: string;
  494 + districtName?: string;
  495 + districtNumber?: string;
  496 + enable?: string;
  497 + groupId?: string;
  498 + groupName?: string;
  499 + groupNumber?: string;
  500 + id?: string;
  501 + invoiceName?: string;
  502 + invoiceType?: string;
  503 + modifyTime?: string;
  504 + name?: string;
  505 + number?: string;
  506 + provinceId?: string;
  507 + provinceName?: string;
  508 + provinceNumber?: string;
  509 + rate?: string;
  510 + remark?: string;
  511 + saleDeptId?: string;
  512 + saleDeptName?: string;
  513 + saleDeptNumber?: string;
  514 + salerId?: string;
  515 + salerName?: string;
  516 + salerNumber?: string;
  517 + taxpayerNo?: string;
  518 +}
  519 +
  520 +export interface CustomerListRes {
  521 + count?: string;
  522 + /** @format int32 */
  523 + currentPage?: number;
  524 + /** @format int32 */
  525 + currentPageSize?: number;
  526 + /** @format int32 */
  527 + page?: number;
  528 + /** @format int32 */
  529 + pageSize?: number;
  530 + rows?: Array<CustomerListResRow>;
  531 + /** @format int32 */
  532 + totalPage?: number;
  533 +}
  534 +
  535 +export interface CustomerListResRow {
  536 + clevelId?: string;
  537 + enable?: string;
  538 + groupName?: string;
  539 + id?: string;
  540 + name?: string;
  541 + number?: string;
  542 + remark?: string;
  543 +}
  544 +
  545 +export interface CustomerSaveReq {
  546 + accountOpenAddr?: string;
  547 + addr?: string;
  548 + bank?: string;
  549 + bankAccount?: string;
  550 + cityId?: string;
  551 + clevelId?: string;
  552 + contactPersons?: Array<Contactperson>;
  553 + countryId?: string;
  554 + customField?: {
  555 + [propertyName: string]: string;
  556 + };
  557 + districtId?: string;
  558 + groupId?: string;
  559 + groupNumber?: string;
  560 + id?: string;
  561 + ignoreWarn?: boolean;
  562 + invoiceName?: string;
  563 + /** @format int32 */
  564 + invoiceType?: number;
  565 + mulLabel?: Array<Mullabel>;
  566 + name?: string;
  567 + number?: string;
  568 + provinceId?: string;
  569 + rate?: string;
  570 + remark?: string;
  571 + saleDeptId?: string;
  572 + saleDeptNumber?: string;
  573 + salerId?: string;
  574 + salerNumber?: string;
  575 + taxpayerNo?: string;
  576 +}
  577 +
340 578 export interface DictionaryQueryVO {
341 579 /** @format int32 */
342 580 current?: number;
... ... @@ -366,10 +604,188 @@ export interface DictionaryVO {
366 604 sort?: number;
367 605 }
368 606  
  607 +export interface Entry {
  608 + bankAccount?: string;
  609 + bankName?: string;
  610 + birthInsurance?: string;
  611 + birthInsuranceC?: string;
  612 + childrenCare?: string;
  613 + childrenEdu?: string;
  614 + continueEdu?: string;
  615 + depId?: string;
  616 + empId?: string;
  617 + empInjuryInsurance?: string;
  618 + empInjuryInsuranceC?: string;
  619 + hireDate?: string;
  620 + housingLoan?: string;
  621 + housingRent?: string;
  622 + hpf?: string;
  623 + hpfC?: string;
  624 + idNumber?: string;
  625 + medicalInsurance?: string;
  626 + medicalInsuranceC?: string;
  627 + mobile?: string;
  628 + oldInsurance?: string;
  629 + oldInsuranceC?: string;
  630 + payAmount?: string;
  631 + saItemList?: Array<ItemSaItem>;
  632 + specialDeductTotal?: string;
  633 + supportElderly?: string;
  634 + taxaMount?: string;
  635 + unEmpInsurance?: string;
  636 + unEmpInsuranceC?: string;
  637 +}
  638 +
369 639 export interface FilePathDto {
370 640 url?: string;
371 641 }
372 642  
  643 +export interface InventoryMaterialStockReq {
  644 + auxPropId?: string;
  645 + isShowStockPosition?: boolean;
  646 + isShowZeroImQty?: boolean;
  647 + materialId?: string;
  648 +}
  649 +
  650 +export interface Item {
  651 + billDate?: string;
  652 + billNo?: string;
  653 + entryList?: Array<Entry>;
  654 + id?: string;
  655 + remark?: string;
  656 +}
  657 +
  658 +export interface ItemSaItem {
  659 + itemId?: string;
  660 + itemValue?: string;
  661 +}
  662 +
  663 +export interface MaterialListReply {
  664 + count?: string;
  665 + /** @format int32 */
  666 + currentPage?: number;
  667 + /** @format int32 */
  668 + currentPageSize?: number;
  669 + /** @format int32 */
  670 + page?: number;
  671 + /** @format int32 */
  672 + pageSize?: number;
  673 + rows?: Array<MaterialListReplyRow>;
  674 + /** @format int32 */
  675 + totalPage?: number;
  676 +}
  677 +
  678 +export interface MaterialListReplyRow {
  679 + barcode?: string;
  680 + baseUnitId?: string;
  681 + baseUnitName?: string;
  682 + baseUnitNumber?: string;
  683 + brandId?: string;
  684 + brandName?: string;
  685 + brandNumber?: string;
  686 + checkType?: string;
  687 + helpCode?: string;
  688 + id?: string;
  689 + isAsstAttr?: boolean;
  690 + isBatch?: boolean;
  691 + isKfPeriod?: boolean;
  692 + isMultiUnit?: boolean;
  693 + isSerial?: boolean;
  694 + isShowAuxBarcode?: boolean;
  695 + isWeight?: boolean;
  696 + model?: string;
  697 + mulLabel?: Array<Mullabel>;
  698 + name?: string;
  699 + number?: string;
  700 + parentId?: string;
  701 + parentName?: string;
  702 + parentNumber?: string;
  703 + producingPace?: string;
  704 + remark?: string;
  705 + units?: Array<Unit>;
  706 + url?: string;
  707 +}
  708 +
  709 +export interface MaterialMaterialListReq {
  710 + createEndTime?: string;
  711 + createStartTime?: string;
  712 + enable?: string;
  713 + ids?: Array<string>;
  714 + isDataPerm?: boolean;
  715 + modifyEndTime?: string;
  716 + modifyStartTime?: string;
  717 + page?: string;
  718 + pageSize?: string;
  719 + parent?: Array<string>;
  720 + search?: string;
  721 + showUnits?: boolean;
  722 +}
  723 +
  724 +export interface MaterialStockRes {
  725 + rows?: Array<MaterialStockRow>;
  726 +}
  727 +
  728 +export interface MaterialStockRow {
  729 + invBaseUnit?: string;
  730 + invImQty?: string;
  731 + invQty?: string;
  732 + invStock?: string;
  733 + invStockId?: string;
  734 + invStockPosition?: string;
  735 +}
  736 +
  737 +export interface MaterialUnitListRes {
  738 + count?: string;
  739 + /** @format int32 */
  740 + currentPage?: number;
  741 + /** @format int32 */
  742 + currentPageSize?: number;
  743 + /** @format int32 */
  744 + page?: number;
  745 + /** @format int32 */
  746 + pageSize?: number;
  747 + rows?: Array<MaterialUnitListResRow>;
  748 + /** @format int32 */
  749 + totalPage?: number;
  750 +}
  751 +
  752 +export interface MaterialUnitListResRow {
  753 + /** @format double */
  754 + coefficient?: number;
  755 + conversionUnitId?: string;
  756 + conversionUnitName?: string;
  757 + id?: string;
  758 + /** @format int32 */
  759 + index?: number;
  760 + isDefault?: boolean;
  761 + isFloat?: boolean;
  762 + materialId?: string;
  763 + unitId?: string;
  764 + unitName?: string;
  765 +}
  766 +
  767 +export interface MeasureUnitListRes {
  768 + count?: string;
  769 + /** @format int32 */
  770 + currentPage?: number;
  771 + /** @format int32 */
  772 + currentPageSize?: number;
  773 + /** @format int32 */
  774 + page?: number;
  775 + /** @format int32 */
  776 + pageSize?: number;
  777 + rows?: Array<MeasureUnitListResRow>;
  778 + /** @format int32 */
  779 + totalPage?: number;
  780 +}
  781 +
  782 +export interface MeasureUnitListResRow {
  783 + id?: string;
  784 + name?: string;
  785 + number?: string;
  786 + precision?: string;
  787 +}
  788 +
373 789 export interface ModelAndView {
374 790 empty?: boolean;
375 791 model?: any;
... ... @@ -382,6 +798,12 @@ export interface ModelAndView {
382 798 viewName?: string;
383 799 }
384 800  
  801 +export interface Mullabel {
  802 + id?: string;
  803 + name?: string;
  804 + number?: string;
  805 +}
  806 +
385 807 export interface OrderAddVO {
386 808 baseInfo?: OrderBaseInfoVO;
387 809 inspectionStageInfo?: OrderInspectionStageVO;
... ... @@ -761,6 +1183,185 @@ export interface QueryAnnexDto {
761 1183 subId?: number;
762 1184 }
763 1185  
  1186 +export interface QueryBankStatementDto {
  1187 + /**
  1188 + * @description
  1189 + * 帐号名称
  1190 + */
  1191 + accountName?: string;
  1192 + /**
  1193 + * @description
  1194 + * 账号
  1195 + */
  1196 + accountNumber?: string;
  1197 + /**
  1198 + * @description
  1199 + * 实付金额
  1200 + */
  1201 + actualPaymentAmount?: number;
  1202 + /**
  1203 + * @description
  1204 + * 余额
  1205 + */
  1206 + balance?: number;
  1207 + /**
  1208 + * @description
  1209 + * 银行订单号
  1210 + */
  1211 + bankOrderNumber?: string;
  1212 + /**
  1213 + * @description
  1214 + * 交易日-开始
  1215 + * @format date
  1216 + */
  1217 + beginTransactionDate?: string;
  1218 + /**
  1219 + * @description
  1220 + * 起息日-开始
  1221 + * @format date
  1222 + */
  1223 + beginValueDate?: string;
  1224 + /**
  1225 + * @description
  1226 + * 借方金额
  1227 + */
  1228 + borrowedAmount?: number;
  1229 + /**
  1230 + * @description
  1231 + * 收银员
  1232 + */
  1233 + cashier?: string;
  1234 + /**
  1235 + * @description
  1236 + * 收款渠道
  1237 + */
  1238 + collectionChannel?: string;
  1239 + /**
  1240 + * @description
  1241 + * 币种
  1242 + */
  1243 + currency?: string;
  1244 + /** @format int32 */
  1245 + current?: number;
  1246 + /**
  1247 + * @description
  1248 + * 交易日-结束
  1249 + * @format date
  1250 + */
  1251 + endTransactionDate?: string;
  1252 + /**
  1253 + * @description
  1254 + * 起息日-结束
  1255 + * @format date
  1256 + */
  1257 + endValueDate?: string;
  1258 + /**
  1259 + * @description
  1260 + * 扩展摘要
  1261 + */
  1262 + extendedSummary?: string;
  1263 + /**
  1264 + * @description
  1265 + * id
  1266 + * @format int64
  1267 + */
  1268 + id?: number;
  1269 + /**
  1270 + * @description
  1271 + * 贷方金额
  1272 + */
  1273 + loanAmount?: number;
  1274 + /**
  1275 + * @description
  1276 + * 商户订单号
  1277 + */
  1278 + merchantOrderNumber?: string;
  1279 + /** @format int32 */
  1280 + pageSize?: number;
  1281 + /**
  1282 + * @description
  1283 + * 收(付)方账号
  1284 + */
  1285 + payeePayerAccountNumber?: string;
  1286 + /**
  1287 + * @description
  1288 + * 收(付)方开户行地址
  1289 + */
  1290 + payeePayerBankAddress?: string;
  1291 + /**
  1292 + * @description
  1293 + * 收(付)方开户行行号
  1294 + */
  1295 + payeePayerBankBranchCode?: string;
  1296 + /**
  1297 + * @description
  1298 + * 收(付)方开户行名
  1299 + */
  1300 + payeePayerBankName?: string;
  1301 + /**
  1302 + * @description
  1303 + * 收(付)方名称
  1304 + */
  1305 + payeePayerName?: string;
  1306 + /**
  1307 + * @description
  1308 + * 收(付)方单位
  1309 + */
  1310 + payeePayerUnit?: string;
  1311 + /**
  1312 + * @description
  1313 + * 支付类型
  1314 + */
  1315 + paymentType?: string;
  1316 + /**
  1317 + * @description
  1318 + * 附言
  1319 + */
  1320 + remarkNote?: string;
  1321 + /**
  1322 + * @description
  1323 + * 流水号
  1324 + */
  1325 + serialNumber?: string;
  1326 + /**
  1327 + * @description
  1328 + * 状态
  1329 + */
  1330 + status?: string;
  1331 + /**
  1332 + * @description
  1333 + * 摘要
  1334 + */
  1335 + summary?: string;
  1336 + /**
  1337 + * @description
  1338 + * 第三方订单号
  1339 + */
  1340 + thirdPartyOrderNumber?: string;
  1341 + /** @format int32 */
  1342 + total?: number;
  1343 + /**
  1344 + * @description
  1345 + * 交易金额
  1346 + */
  1347 + transactionAmount?: number;
  1348 + /**
  1349 + * @description
  1350 + * 交易分析码
  1351 + */
  1352 + transactionAnalysisCode?: string;
  1353 + /**
  1354 + * @description
  1355 + * 交易行所
  1356 + */
  1357 + transactionBankBranch?: string;
  1358 + /**
  1359 + * @description
  1360 + * 交易类型
  1361 + */
  1362 + transactionType?: string;
  1363 +}
  1364 +
764 1365 export interface QueryCustomerInformationDto {
765 1366 /**
766 1367 * @description
... ... @@ -792,6 +1393,15 @@ export interface QueryHistoryRecordDto {
792 1393 isDeleteQueryOrder?: boolean;
793 1394 }
794 1395  
  1396 +export interface QueryInvoiceDetailDto {
  1397 + /**
  1398 + * @description
  1399 + * 发票id
  1400 + * @format int64
  1401 + */
  1402 + invoiceId?: number;
  1403 +}
  1404 +
795 1405 export interface QueryMainOrderDto {
796 1406 /**
797 1407 * @description
... ... @@ -830,6 +1440,17 @@ export interface ResetPwdVO {
830 1440 userId?: number;
831 1441 }
832 1442  
  1443 +export interface SalOrderSaveDto {
  1444 + id?: string;
  1445 +}
  1446 +
  1447 +export interface SaveReply {
  1448 + idNumberMap?: {
  1449 + [propertyName: string]: string;
  1450 + };
  1451 + ids?: Array<string>;
  1452 +}
  1453 +
833 1454 export interface ServerResult {
834 1455 data?: any;
835 1456 message?: string;
... ... @@ -860,6 +1481,73 @@ export interface SysLogQueryVO {
860 1481 username?: string;
861 1482 }
862 1483  
  1484 +export interface SystemCustomFieldReq {
  1485 + entityNumber?: string;
  1486 +}
  1487 +
  1488 +export interface Unit {
  1489 + /** @format float */
  1490 + coefficient?: number;
  1491 + conversionUnitConversionType?: string;
  1492 + conversionUnitCreatetime?: string;
  1493 + conversionUnitDisableDate?: string;
  1494 + conversionUnitEnable?: string;
  1495 + conversionUnitId?: string;
  1496 + conversionUnitIsLeaf?: boolean;
  1497 + /** @format int32 */
  1498 + conversionUnitLevel?: number;
  1499 + conversionUnitLongNumber?: string;
  1500 + conversionUnitModifyTime?: string;
  1501 + conversionUnitName?: string;
  1502 + conversionUnitNumber?: string;
  1503 + conversionUnitPrecision?: string;
  1504 + conversionUnitPrecisionAccount?: string;
  1505 + id?: string;
  1506 + /** @format int32 */
  1507 + index?: number;
  1508 + isDefault?: boolean;
  1509 + isFloat?: boolean;
  1510 + materialId?: string;
  1511 + unitConversionType?: string;
  1512 + unitCreateTime?: string;
  1513 + unitDisableDate?: string;
  1514 + unitEnable?: string;
  1515 + unitId?: string;
  1516 + unitIsLeaf?: boolean;
  1517 + /** @format int32 */
  1518 + unitLevel?: number;
  1519 + unitLongNumber?: string;
  1520 + unitModifyTime?: string;
  1521 + unitNumber?: string;
  1522 + unitPrecision?: string;
  1523 + /** @format int32 */
  1524 + unitPrecisionAccount?: number;
  1525 + unitidName?: string;
  1526 +}
  1527 +
  1528 +export interface UnitMaterialUnitListReq {
  1529 + createEndTime?: string;
  1530 + createStartTime?: string;
  1531 + materialId?: Array<string>;
  1532 + modifyEndTime?: string;
  1533 + modifyStartTime?: string;
  1534 + page?: string;
  1535 + pageSize?: string;
  1536 + search?: string;
  1537 + unPage?: string;
  1538 +}
  1539 +
  1540 +export interface UnitMeasureUnitListReq {
  1541 + createEndTime?: string;
  1542 + createStartTime?: string;
  1543 + enable?: string;
  1544 + modifyEndTime?: string;
  1545 + modifyStartTime?: string;
  1546 + page?: string;
  1547 + pageSize?: string;
  1548 + search?: string;
  1549 +}
  1550 +
863 1551 export interface UpdateHirePurchase {
864 1552 /**
865 1553 * @description
... ... @@ -884,6 +1572,20 @@ export interface UpdateHirePurchase {
884 1572 updateTime?: string;
885 1573 }
886 1574  
  1575 +export interface UpdateHirePurchaseDto {
  1576 + /**
  1577 + * @description
  1578 + * 修改分期付款集合
  1579 + */
  1580 + list?: Array<UpdateHirePurchase>;
  1581 + /**
  1582 + * @description
  1583 + * 主订单id
  1584 + * @format int64
  1585 + */
  1586 + mainOrderId?: number;
  1587 +}
  1588 +
887 1589 export interface UpdatePwdVO {
888 1590 confirmPassword?: string;
889 1591 password?: string;
... ...