当前位置: 首页 > news >正文

企业网站系统详细设计网站搜索排名靠前

企业网站系统详细设计,网站搜索排名靠前,网站开发接活,龙禧网站建设为了实现这个功能我们和后端定义了数据结构 data:{id:‘’,formInfo:,formInfo2:,formInfo3:,formInfo4:, ......deailData:[ // 明细数据 // saleData 查询带出的对应明细序列号数据{ id:, ocopyId:, copyId:, odoId:, ......, saleData:[ { id:, oc…

在这里插入图片描述
为了实现这个功能我们和后端定义了数据结构

data:{id:‘’,formInfo:'',formInfo2:'',formInfo3:'',formInfo4:'', ......deailData:[ // 明细数据  // saleData 查询带出的对应明细序列号数据{	id:'',	ocopyId:'',	copyId:'',	odoId:'',	......,  saleData:[ {	id:'',	ocopyId:'', odoId:'',	......,} ] },{	id:'',	ocopyId:'',	copyId:'',	odoId:'',	......,  saleData:[ {	id:'',	ocopyId:'', odoId:'',	......,} ] },{	id:'',	ocopyId:'',	copyId:'',	odoId:'',	......,  saleData:[ {	id:'',	ocopyId:'', odoId:'',	......,} ] }]
}

代码入下

/*** 编辑页面*/
import React from 'react';
import { TForm, ELImport_3, ElNotification, ElRowContainer, TCollapse } from '@/cloudt/component';
import { TEditTable } from '@/cloudt/pro-component';import {getDetailColumns,getSerialButtons,getDetailButtons,getTopButtons,getBasicForm,getControlForm,getReceivingForm,getSerialEdittabColumns,
} from './config';
import dayjs from 'dayjs';
import { asserts } from '@/utils';
import { save, getDetailById, getFileCode } from './service';
import { FileUpload } from '@/cloudt/component/ItemComponent';
import { maths } from '@/utils';
import { Spin } from 'antd';
import { closeCurrentToPath, frameHistoryPush } from '@/cloudt/frame-history';
interface Props {match: any;
}interface State {loading: boolean;pageType: string;id: string | number;bascicFormData: any;OrderInfoData: Array<any>;recvCountryCode: any;fileList: Array<any>;preSelectedRow: Record<string, any> | null; //记录上次选中的明细行importRequestParams: Record<string, any>;
}class SaleOrderEdit extends React.Component<Props, State> {basicFormRef: any; //基础信息表单refcontrolFormRef: any; //制单信息receiveFormRef: any; //客户收货信息表单refdeatilTableRef: any; //明细信息可编辑表格refserialTableRef: any; // 序列号refimportModalRef: any; //导入组件refconstructor(props) {super(props);this.state = {fileList: [],id: this.props.match?.params?.id, //单据idpageType: this.props.match.path.includes('/edit/') ? 'edit' : 'view', // 编辑或详情页面loading: false, // 页面级loadingbascicFormData: {}, //基本信息OrderInfoData: [], //明细数据recvCountryCode: '', // 国家preSelectedRow: null,importRequestParams: {},};}async componentDidMount() {await this.getDetail(this.state.id);}getDetail = async (id) => {this.setState({loading: true,});const res = await getDetailById(id);if (res && res.success) {const bascicFormData = await this.handleBasicFormData(res?.data);const newSalSoDSaveVOList = this.handleDetailEditData(res?.data?.odoDList);// 查询附件const fileCode = res.data?.fileCode;if (fileCode) {await this.handleFilesData(res.data?.fileCode.split(','));}this.setState({bascicFormData,OrderInfoData: newSalSoDSaveVOList,});} else {ElNotification({type: 'error',message: res.msg || '查询失败',});}this.setState({loading: false,});};handleBasicFormData = async (data) => {const basicData = {...data,recvArea: [data?.recvProvince, data?.recvCity, data?.recvCounty],whId: {whId: data?.whId,whCode: data?.whCode,whName: data?.whName,// deter2: data?.deter2,// deter2Name: data?.deter2Name,},};this.setState({recvCountryCode: data?.recvCountry,});return basicData;};handleFilesData = async (fileCode) => {const res = await getFileCode(fileCode);if (res && res.success) {this.setState({fileList: res.data,});}};/*** 查详情明细行数据处理 -- 明细行原始数据*/handleDetailEditData = (odoDSaveVOList) => {const newSalSoDSaveVOList =odoDSaveVOList &&Array.isArray(odoDSaveVOList) &&odoDSaveVOList.map((item) => {return {...item,// createTime: asserts.isExist(item?.createTime) ? dayjs(item?.createTime).format('YYYY-MM-DD') : null,// modifyTime: asserts.isExist(item?.modifyTime) ? dayjs(item?.modifyTime).format('YYYY-MM-DD') : null,serialRespVOs: item.serialRespVOs ? item.serialRespVOs : [],lotNo: item?.lotNo,};});return newSalSoDSaveVOList;};// 明细信息行选择事件 更新下边的序号编辑handleOrderInfoSelect = async (selectedRowKeys, selectedRows) => {await this.deatilTableRef.quitEditState(); // 明细行退出编辑状态await this.serialTableRef.quitEditState(); // 序列号退出编辑状态const TableValues = await this.serialTableRef.getRows(); // 获取序列号数据const detailSelectedRow = selectedRows[0];if (this.state.preSelectedRow) {this.deatilTableRef.updateRows({ serialRespVOs: TableValues }, [this.state.preSelectedRow.id]);}const nowSerialData = detailSelectedRow.serialRespVOs;await this.serialTableRef?.clearRows(); //清除可编辑表格的数据this.serialTableRef?.addRows(nowSerialData); //重新添加查询的数据this.setState({preSelectedRow: detailSelectedRow,});};// 明细行复制handleCopy = async (selectedRowKeys, selectedRows) => {const selectedRow = selectedRows[0];const isCopyedRow = selectedRow.ocopyId;if (isCopyedRow) {return ElNotification({type: 'warning',message: '不能复制已经复制的信息,请重新选择',});}await this.deatilTableRef.quitEditState();const dataSouce = await this.deatilTableRef.getRows();const index = dataSouce?.findLastIndex((v) => selectedRow?.relateDocLineno === v.relateDocLineno);const copyRow = {...selectedRow,odoId: this.state.id, // 单头idocopyId: selectedRow.id, // 复制行时把id给ocopyId,id: maths.genFakeId(-1),demandQty: null,qty: 0,serialRespVOs: [],};dataSouce.splice(index + 1, 0, copyRow);await this.deatilTableRef.clearRows();await this.deatilTableRef.addRows(dataSouce);};// 明细信息行删除事件handleDelClick = async (selectedRowKeys, selectedRows) => {const selectedRow = selectedRows[0];const isCopyedRow = selectedRow.ocopyId;if (!isCopyedRow) {return ElNotification({type: 'warning',message: '只能删除复制行,请重新选择',});}this.deatilTableRef.removeRowsByKeys(selectedRowKeys, 'rowKey'); // 删除明细信息await this.serialTableRef.quitEditState(); // 序列号退出编辑状态await this.serialTableRef?.clearRows(); //清除可编辑表格的数据};// 序列号信息添加handleAddDataRow = async () => {const selectionData = await this.deatilTableRef?.getSelectionData();if (selectionData.selectedRows.length !== 1) {return ElNotification({type: 'warning',message: '请选中一行明细',});}const detailSelectedRow = selectionData.selectedRows[0];const newRow = {id: maths.genFakeId(-1),odoId: this.state.id, // 关联单idodoDid: detailSelectedRow.id, // 序列号新增时,赋值选中的明细行id};this.serialTableRef?.addRow(newRow); //重新添加查询的数据};// 序列号信息删除handleDistributionDelete = async (selectedRowKeys) => {await this.serialTableRef.quitEditState();this.serialTableRef.removeRowsByKeys(selectedRowKeys, 'rowKey');};// 序列号导入handleImport = async () => {const selectionData = await this.deatilTableRef?.getSelectionData();if (selectionData.selectedRows.length !== 1) {return ElNotification({type: 'warning',message: '请选中一行明细',});}this.setState({importRequestParams: { odoDid: selectionData.selectedRows[0].id, odoId: this.state.id },});this.importModalRef.openModal();};// 导入方法回调importCallBack = async (res) => {if (res && res.success) {const importSuccessData = res.data.map((x) => {return {...x,id: maths.genFakeId(-1),};});this.serialTableRef?.addRows(importSuccessData);ElNotification({type: 'success',message: '操作成功!',});} else if (res && !res.success) {ElNotification({type: 'error',message: res?.msg || '操作失败',});}};/*** 返回*/onBack = () => {closeCurrentToPath('/inventory/outboundDelivery/searchOrder');};// 保存saveParams = async () => {//保存之前先把序列号信息退出编辑状态,同步到明细数据中const selectionData = await this.deatilTableRef?.getSelectionData();const detailSelectedRow = selectionData?.selectedRows[0];await this.serialTableRef.quitEditState(); // 序列号退出编辑状态const serialEditTableValues = await this.serialTableRef.validateTableRows();if (!serialEditTableValues?.msg?.success) {ElNotification({type: 'warning',message: '请添加序列号必填信息!',});return;}const TableValues = await this.serialTableRef.getRows(); // 获取序列号数据if (this.state.preSelectedRow) {this.deatilTableRef.updateRows({ serialRespVOs: TableValues }, [detailSelectedRow.id]);}const data = await this.processData();if (data?.odoDSaveVOList?.length === 0) {ElNotification({type: 'warning',message: '明细信息不允许为空',});return;}if (data) {this.setState({ loading: true });const res = await save(data);this.setState({ loading: false });if (res.success) {ElNotification({type: 'success',message: res.msg || '操作成功',});this.onBack();} else {ElNotification({type: 'error',message: res.msg || res.data || '操作失败!',});}}};/*入参基本信息处理baseFormDataRes 基本信息custFormDataRes 客户信息*/paramsBasicFormData = (baseFormDataRes, custFormDataRes) => {baseFormDataRes.whId = baseFormDataRes.whId?.whId;baseFormDataRes.whCode = baseFormDataRes.whId?.whCode;baseFormDataRes.whName = baseFormDataRes.whId?.whName;custFormDataRes.recvArea = undefined;};/*  delSameObjValue 数组对象相同值相加去重arr 需要处理的数组   -- editTableValues?.dataresultNum 最终计算结果的键名 -- sumConfirmQtykeyName  用于计算判断的键名 这里是以数组的方式传过来的可以这支持接收多个参数判断】 -- relateDocLinenokeyValue 用于计算结果的键名 这里是以数组的方式传过来的可以这支持接收多个参数判断】 对应的键值为number类型 -- qty*/delSameObjValue = (arr, resultNum, keyName, keyValue) => {const warp = new Map();arr.forEach((i) => {const str = keyName.map((v) => i[v]).join('_');i[resultNum] = keyValue.reduce((p, c) => (p += i[c]), 0);warp.has(str) ? (warp.get(str)[resultNum] += i[resultNum]) : warp.set(str, i);});return Array.from(warp).map(([, v]) => v);};// 校验表单信息processData = async () => {// 基本信息const baseFormDataRes = await this.basicFormRef?.validateFields().catch(() => {ElNotification({type: 'warning',message: '请检查【基本信息】必填信息',});return Promise.reject();});// 客户信息const custFormDataRes = await this.receiveFormRef?.getFieldsValue();// 制单信息const otherFormDataRes = await this.controlFormRef?.getFieldsValue();this.paramsBasicFormData(baseFormDataRes, custFormDataRes);// 附件信息const { fileList } = this.state;const fileCodes =Array.isArray(fileList) &&fileList?.map((x) => {return x.fileCode;});const fileCode = fileCodes.toString();// 商品明细信息await this.deatilTableRef.quitEditState(); //保存退出明细行编辑状态const editTableValues = await this.deatilTableRef.validateTableRows();const sum = this.delSameObjValue(editTableValues?.data, 'sumConfirmQty', ['relateDocLineno'], ['qty']);const flag = sum.some((val) => val.sumConfirmQty !== val.demandQty);if (flag) {return ElNotification({type: 'warning',message: '相同【来源单据行号】的数据信息【实发数量】必须等于【要求发货数量】!',});}if (!editTableValues?.msg?.success) {return ElNotification({type: 'warning',message: '请添加明细必填信息!',});}const ruleLotFlagAddlotNo = editTableValues?.data.some((item) => item.lotFlag && (item.lotNo === null || item.lotNo === ''),);if (ruleLotFlagAddlotNo) {return ElNotification({type: 'warning',message: '明细商品中包含【启用批次】,请检查并完善【批次】',});}const itemDataSource = editTableValues?.data?.map((item) => {return {...item,odoId: this.state.id,lotNo: item?.lotNo?.lotNo,olotNo: item?.orlotNo,odoSerialSaveVOs: item.serialRespVOs ? item.serialRespVOs : [],sumConfirmQty: undefined, // 提示汇总字段不要serialRespVOs: undefined, // 返回的数组字段不要orlotNo: undefined,};});// 根据公司查询组织return {...this.state.bascicFormData,id: this.state.bascicFormData?.id, //复制按钮时,入参需要处理...baseFormDataRes, //基础信息...custFormDataRes, //客户信息...otherFormDataRes, // 制单信息odoDSaveVOList: itemDataSource, // 明细fileCode, // 附件odoDList: undefined,};};render() {const {pageType: type,bascicFormData: bascicFormDate,loading,OrderInfoData,fileList,importRequestParams,} = this.state;return (<Spin spinning={loading}><div className="inner-content"><ElRowContaineronBack={this.onBack}blocks={getTopButtons(this.saveParams, this.state.pageType)}position="top"/><TCollapse className="formAlignment" title="基本信息" levelOne><TFormdata={bascicFormDate}onRef={(ref) => {this.basicFormRef = ref;}}formProps={getBasicForm(type)}/><TCollapse title="收货信息" defaultOpen={false} className="formAlignment"><TFormdata={bascicFormDate}onRef={(ref) => {this.receiveFormRef = ref;}}formProps={getReceivingForm(this.state.recvCountryCode)}/></TCollapse><TCollapse title="制单信息" defaultOpen={false} className="formAlignment"><TFormdata={bascicFormDate}onRef={(ref) => {this.controlFormRef = ref;}}formProps={getControlForm('create')}/></TCollapse></TCollapse><TCollapse title="明细信息"><TEditTabletableId="middleGround_inventoryCenter_supply_saleorder_orderDetail"borderedrowKey="id"scroll={{ y: 20000 }}onRef={(ref) => (this.deatilTableRef = ref)}dataSource={OrderInfoData} //actionButtons={getDetailButtons({type,handleCopy: this.handleCopy,handleDelete: this.handleDelClick,})}needToolBar={true}columns={getDetailColumns(this)}rowSelectionConfig={{type: 'radio',fixed: true,disabledRowIds: [],onChange: ({ selectedRowKeys, selectedRows }) => {this.handleOrderInfoSelect(selectedRowKeys, selectedRows);},}}defaultTableConfig={{onBottomPressEnter: 'trigger',onTableIntoEdit: 'dbclick',}}/></TCollapse><TCollapse title="序列号信息"><TEditTabletableId="middleGround_inventoryCenter_supply_saleorder_distributionInformation"rowKey="id"borderedscroll={{ y: 'calc(100vh - 430px)' }}dataSource={[]}actionButtons={getSerialButtons(type,this.handleAddDataRow,this.handleDistributionDelete,this.handleImport,)}onRef={(ref) => (this.serialTableRef = ref)}columns={getSerialEdittabColumns()}/></TCollapse><TCollapse title="相关附件" levelOne={true}><FileUploaduseType="outTable"fileListLen={999}uploadInfo="支持所有类型文件,文件不能超过10M"value={fileList}onUploadErr={(err) => {ElNotification({type: 'error',message: err?.msg || '上传失败',});}}onRemoveErr={(err) => {ElNotification({type: 'error',message: err?.msg || '删除失败',});}}onChange={(value) => {this.setState({fileList: value,});}}multiple={true}fileList={fileList}prefix="/cloudt/system"/></TCollapse><ELImport_3push={frameHistoryPush}prefix="/yst/inv"templateCode="INV_ODO_SERIAL_IMPORT"downTemplateConfig={{mode: 'templateCode',fileName: '序列号导入模版',}}importConfig={{mode: 'request',url: '/yst/inv/inv/odod/serial/importOdoSerial',maxSize: 1,sizeUnit: 'MB',note: '仅支持xlsx文件,不能大于20mb',accept: 'xlsx|xls|xlsx',onSuccess: this.importCallBack,}}requestParams={importRequestParams}onRef={(ref) => (this.importModalRef = ref)}/></div></Spin>);}
}export default SaleOrderEdit;

文章转载自:
http://dinncorevery.bkqw.cn
http://dinncokkk.bkqw.cn
http://dinncosubbass.bkqw.cn
http://dinncorepresentee.bkqw.cn
http://dinncoinfighting.bkqw.cn
http://dinncomacroclimatology.bkqw.cn
http://dinncokwoc.bkqw.cn
http://dinncocontract.bkqw.cn
http://dinncogemological.bkqw.cn
http://dinncoimpost.bkqw.cn
http://dinncodifferentiate.bkqw.cn
http://dinncofdt.bkqw.cn
http://dinncoconferral.bkqw.cn
http://dinncojohore.bkqw.cn
http://dinncorework.bkqw.cn
http://dinncogumboil.bkqw.cn
http://dinncofriended.bkqw.cn
http://dinncothromboendarterectomy.bkqw.cn
http://dinncodethronement.bkqw.cn
http://dinncogantlet.bkqw.cn
http://dinncosenescence.bkqw.cn
http://dinncosignwriter.bkqw.cn
http://dinncoalexandra.bkqw.cn
http://dinncoradiothorium.bkqw.cn
http://dinncorubicund.bkqw.cn
http://dinncoappurtenances.bkqw.cn
http://dinncodesperately.bkqw.cn
http://dinncolaryngopharyngeal.bkqw.cn
http://dinncometallurgic.bkqw.cn
http://dinncosetdown.bkqw.cn
http://dinncoeelworm.bkqw.cn
http://dinncocanonistic.bkqw.cn
http://dinncorheum.bkqw.cn
http://dinncodawk.bkqw.cn
http://dinncocoalball.bkqw.cn
http://dinncolaid.bkqw.cn
http://dinncobottle.bkqw.cn
http://dinncosongbook.bkqw.cn
http://dinncovulgarization.bkqw.cn
http://dinncoicebound.bkqw.cn
http://dinncosinlessly.bkqw.cn
http://dinncojobbernowl.bkqw.cn
http://dinncoinvidiousness.bkqw.cn
http://dinncoprepackage.bkqw.cn
http://dinncoultrared.bkqw.cn
http://dinncowftu.bkqw.cn
http://dinncopiccaninny.bkqw.cn
http://dinncogao.bkqw.cn
http://dinncoscanner.bkqw.cn
http://dinncokktp.bkqw.cn
http://dinnconattierblue.bkqw.cn
http://dinncomatral.bkqw.cn
http://dinncopotentially.bkqw.cn
http://dinncootology.bkqw.cn
http://dinncobullae.bkqw.cn
http://dinncoabut.bkqw.cn
http://dinnconotability.bkqw.cn
http://dinncoleniently.bkqw.cn
http://dinncoameerate.bkqw.cn
http://dinncojibb.bkqw.cn
http://dinncotransaminase.bkqw.cn
http://dinncocense.bkqw.cn
http://dinncopolyesterification.bkqw.cn
http://dinncodemonology.bkqw.cn
http://dinncoinfrequent.bkqw.cn
http://dinncomicrogroove.bkqw.cn
http://dinnconeophiliac.bkqw.cn
http://dinncosegregative.bkqw.cn
http://dinncodecimalist.bkqw.cn
http://dinncotelecourse.bkqw.cn
http://dinncoalgolagnia.bkqw.cn
http://dinncoendomorphic.bkqw.cn
http://dinncotruantry.bkqw.cn
http://dinnconingpo.bkqw.cn
http://dinncomalanders.bkqw.cn
http://dinncodoggery.bkqw.cn
http://dinncohelicline.bkqw.cn
http://dinncologicals.bkqw.cn
http://dinncolightfastness.bkqw.cn
http://dinncohyesan.bkqw.cn
http://dinncotyrrhene.bkqw.cn
http://dinncowhorish.bkqw.cn
http://dinncoobliging.bkqw.cn
http://dinncotelfer.bkqw.cn
http://dinncoovulatory.bkqw.cn
http://dinncoenfever.bkqw.cn
http://dinncopolynesia.bkqw.cn
http://dinncobanksman.bkqw.cn
http://dinncomacrostylous.bkqw.cn
http://dinncoflexile.bkqw.cn
http://dinncoprevaricator.bkqw.cn
http://dinncomanoir.bkqw.cn
http://dinncoelectronical.bkqw.cn
http://dinncoprocoagulant.bkqw.cn
http://dinncokhadi.bkqw.cn
http://dinncopartialness.bkqw.cn
http://dinncounstatutable.bkqw.cn
http://dinncohaematogen.bkqw.cn
http://dinncoempyreumatic.bkqw.cn
http://dinncocharacterize.bkqw.cn
http://www.dinnco.com/news/137395.html

相关文章:

  • 网站优化该怎么做百度竞价被换着ip点击
  • 模仿别人网站保定百度推广联系电话
  • 万网如何建设购物网站日照高端网站建设
  • 别人做的网站怎么seo优化互联网平台公司有哪些
  • 云南网站seo外包广州网络seo优化
  • 网站做的比较好的公司网站优化排名查询
  • phpcms企业网站源码教你如何快速建站
  • 网站商城例子下载百度推广竞价排名
  • erp软件开发河南整站关键词排名优化软件
  • 什么网站可以做锦鲤活动百度站长工具怎么关闭
  • erp教学零基础入门百度seo优化服务项目
  • 医院招聘网站建设和维护商丘seo外包
  • 免费的百度网站怎么做长沙网络推广
  • 郑州做网站公司 汉狮网络专业宣传页面怎么制作
  • 网站分类导航代码电商seo与sem是什么
  • 网站红色游戏推广怎么找玩家
  • 厦门网站建设的公司公关公司经营范围
  • 定州网站建设网站百度
  • 搜索引擎中注册网站seo实战培训班
  • 网站建设的公司哪家是上市公司黑帽seo是什么意思
  • 如何管理网站淘宝搜索关键词排名
  • jsp网站 值班功能营销页面
  • 公司网站应该是市场部做吗现在什么app引流效果好
  • 关于做ppt的网站市场调研怎么做
  • 服饰类网站模板成都网站快速排名优化
  • 怎么查看网站是否做百度排名如何找友情链接
  • 快递网站策划怎么做ppt网络推广公司企业
  • 长沙网站建设策划网络上如何推广网站
  • 建外贸网站需要多少钱北京seo薪资
  • 学校网站建设的必要性找文网客服联系方式