Commit 9851e9515f01601dfe481c030c478782b4e17ea9
Merge branch 'main' of http://git.xlyprint.cn/zhangz/xlyUmi
Showing
7 changed files
with
4184 additions
and
9 deletions
src/components/Common/CommonBase.js
| ... | ... | @@ -21,18 +21,18 @@ export default (ChildComponent) => { |
| 21 | 21 | super(props); |
| 22 | 22 | this.state = { |
| 23 | 23 | pageLoading: true, |
| 24 | - token: props.routing ? props.formRoute === '/indexOee' ? props.app.token : '' : props.app.token, // /indexOee为oee报产页面 | |
| 24 | + token: props.routing ? (props.formRoute === '/indexOee' || props.formRoute === '/indexMobile') ? props.app.token : '' : props.app.token, // /indexOee为oee报产页面 | |
| 25 | 25 | sTabId: this.handleConfigValue('key', props.formRoute), // type无论是indexoee和一般的都使用eles |
| 26 | 26 | sSrcModelsId: props.app.currentPane.sSrcModelsId, /* 获取配置数据用的modelId */ |
| 27 | - sModelsId: props.routing ? props.sModelsId : (commonUtils.isNotEmptyStr(props.formRoute) && props.formRoute.indexOf('/indexOee') > -1) ? props.sModelsId : this.handleConfigValue('formId'), /* 获取配置数据用的modelId */ | |
| 28 | - formRoute: props.routing ? props.formRoute : (commonUtils.isNotEmptyStr(props.formRoute) && props.formRoute.indexOf('/indexOee') > -1) ? props.formRoute : this.handleConfigValue('route'), /* 组件名: 路由名称 */ | |
| 27 | + sModelsId: props.routing ? props.sModelsId : (commonUtils.isNotEmptyStr(props.formRoute) && (props.formRoute.indexOf('/indexOee') > -1 || props.formRoute.indexOf('/indexMobile') > -1)) ? props.sModelsId : this.handleConfigValue('formId'), /* 获取配置数据用的modelId */ | |
| 28 | + formRoute: props.routing ? props.formRoute : (commonUtils.isNotEmptyStr(props.formRoute) && (props.formRoute.indexOf('/indexOee') > -1 || props.formRoute.indexOf('/indexMobile') > -1)) ? props.formRoute : this.handleConfigValue('route'), /* 组件名: 路由名称 */ | |
| 29 | 29 | formSrcRoute: props.routing ? props.routing.pathname.replace('/', '') : commonUtils.isNotEmptyObject(location.pathname) && location.pathname.toLowerCase() === '/loginoee' ? '/commonAuto' : '', |
| 30 | 30 | sModelsType: this.handleConfigValue('sModelsType', props.formRoute), /* 组件名: 路由名称 */ |
| 31 | 31 | bFastOrderView: this.handleConfigValue('bFastOrderView'), /* 是否显示快速下单 */ |
| 32 | 32 | formData: [], /* 所有配置 */ |
| 33 | 33 | gdsformconst: [], /* 获取配置常量 */ |
| 34 | 34 | gdsjurisdiction: [], /* 获取配置权限 */ |
| 35 | - currentId: (commonUtils.isNotEmptyStr(props.formRoute) && props.formRoute.indexOf('/indexOee') > -1) ? props.checkedId : props.app.currentPane.checkedId, /* 当前数据的Id */ | |
| 35 | + currentId: (commonUtils.isNotEmptyStr(props.formRoute) && (props.formRoute.indexOf('/indexOee') > -1 || props.formRoute.indexOf('/indexMobile') > -1)) ? props.checkedId : props.app.currentPane.checkedId, /* 当前数据的Id */ | |
| 36 | 36 | selectedRowKeys: [], /* 已选择的数据行(数据格式:数组) */ |
| 37 | 37 | clearArray: [], /* table清除数组 */ |
| 38 | 38 | calculated: false, // 工单是否经过计算 |
| ... | ... | @@ -84,7 +84,7 @@ export default (ChildComponent) => { |
| 84 | 84 | if (this.state.sTabId && !this.state.noChangeDiffMap) { |
| 85 | 85 | this.props.dispatch({ type: 'app/changeDiffMap', payload: { sTabId: this.state.sTabId, changed: false } }); |
| 86 | 86 | } |
| 87 | - if (this.state.formRoute && this.state.formRoute.indexOf('/indexOee') > -1 && this.state.sModelsId && this.state.formRoute) { | |
| 87 | + if (this.state.formRoute && (this.state.formRoute.indexOf('/indexOee') > -1 || this.state.formRoute.indexOf('/indexMobile') > -1) && this.state.sModelsId && this.state.formRoute) { | |
| 88 | 88 | const sModelData = { |
| 89 | 89 | sModelsId: this.state.sModelsId, |
| 90 | 90 | formRoute: this.state.formRoute, |
| ... | ... | @@ -110,7 +110,7 @@ export default (ChildComponent) => { |
| 110 | 110 | // } |
| 111 | 111 | const currentKey = nextProps.app.currentPane.key; /* 当前页签key */ |
| 112 | 112 | const { formData } = nextState; |
| 113 | - if (commonUtils.isNotEmptyObject(nextProps.formRoute) && nextProps.formRoute.indexOf('/indexOee') > -1) { | |
| 113 | + if (commonUtils.isNotEmptyObject(nextProps.formRoute) && (nextProps.formRoute.indexOf('/indexOee') > -1 || nextProps.formRoute.indexOf('/indexMobile') > -1)) { | |
| 114 | 114 | return (formData.length > 0); |
| 115 | 115 | } |
| 116 | 116 | /* 处理loginOee下拉框切换 重新渲染 */ |
| ... | ... | @@ -716,7 +716,7 @@ export default (ChildComponent) => { |
| 716 | 716 | |
| 717 | 717 | /* 获取配置数据用的sTabId,formId,formRoute */ |
| 718 | 718 | handleConfigValue = (value, type) => { |
| 719 | - if (commonUtils.isNotEmptyObject(type) && type.indexOf('/indexOee') > -1) { | |
| 719 | + if (commonUtils.isNotEmptyObject(type) && (type.indexOf('/indexOee') > -1 || type.indexOf('/indexMobile') > -1)) { | |
| 720 | 720 | return this.props[value]; |
| 721 | 721 | } else { |
| 722 | 722 | const { secondppopupPane, ppopupPane, currentPane } = this.props.app; | ... | ... |
src/components/Common/CommonNewBillEvent.js
| ... | ... | @@ -45,7 +45,7 @@ export default ChildComponent => { |
| 45 | 45 | // }; |
| 46 | 46 | this.form = {}; /* 表单对象 */ |
| 47 | 47 | this.copyName = ""; |
| 48 | - const { sModelsId, sModelsType } = props; | |
| 48 | + const { sModelsId, sModelsType = "" } = props; | |
| 49 | 49 | if (sModelsType.includes("cashier/")) { |
| 50 | 50 | commonUtils.setStoreDropDownData(sModelsId, "master", "sCustomerId", []); |
| 51 | 51 | commonUtils.setStoreDropDownData(sModelsId, "master", "sCustomerNo", []); | ... | ... |
src/components/Common/ToolBar/ToolBarNew.js
| ... | ... | @@ -4525,6 +4525,7 @@ class ToolBarComponent extends Component { |
| 4525 | 4525 | pageLoading: false, |
| 4526 | 4526 | }; |
| 4527 | 4527 | |
| 4528 | + if (this.props.customRender) return this.props.customRender({ ...this.props, menuDataCopy, getMenuProps: this.getMenuProps, handleClick: this.handleClick }); | |
| 4528 | 4529 | |
| 4529 | 4530 | return ( |
| 4530 | 4531 | <div className={styles.toolBar} onMouseEnter={this.handleMouseEnterTooBar}> | ... | ... |
src/mobile/common/CommobilePadBill/index.js
0 → 100644
| 1 | +/* eslint-disable */ | |
| 2 | + | |
| 3 | +import React, { Component, useState, useRef, useEffect } from "react"; | |
| 4 | +import { Form } from "@ant-design/compatible"; | |
| 5 | +// import '@ant-design/compatible/assets/index.css'; | |
| 6 | +import { Row, Col, Checkbox, Layout, Spin, Tabs, Dropdown, Avatar, Button, Menu, Table, Upload } from "antd-v4"; | |
| 7 | +import { message } from "@/utils/common/message"; | |
| 8 | +import { DownOutlined, UploadOutlined } from "@ant-design/icons"; | |
| 9 | +import CommonNewSales from "@/components/Common/CommonNewBillEvent"; /* 继承销售模块业务功能 */ | |
| 10 | +import * as commonFunc from "@/components/Common/commonFunc"; /* 通用单据方法 */ /* 通用单据方法 */ | |
| 11 | +import Toolbar from "@/components/Common/ToolBar/ToolBarNew"; | |
| 12 | +import StaticEditTable from "@/components/Common/CommonTable"; /* 可编辑表格 */ | |
| 13 | +import styles from "@/index.less"; | |
| 14 | +import stylesNew from "./index.less" | |
| 15 | +import AssignmentField from "@/components/Common/AssignmentField"; | |
| 16 | +import CommonView from "@/components/Common/CommonView"; | |
| 17 | +import CommonViewTable from "@/components/Common/CommonViewTable"; | |
| 18 | +import CommonBase from "@/components/Common/CommonBase"; /* 获取配置及数据 */ | |
| 19 | +import * as commonBusiness from "@/components/Common/commonBusiness"; /* 单据业务功能 */ | |
| 20 | +import commonConfig from "@/utils/config"; | |
| 21 | +import * as commonUtils from "@/utils/utils"; /* 通用方法 */ | |
| 22 | +import * as commonServices from "@/services/services"; /* 服务类 */ | |
| 23 | +import AddIcon from "@/assets/add.svg"; | |
| 24 | +import DisableAddIcon from "@/assets/disableadd.svg"; | |
| 25 | +import CopyIcon from "@/assets/copy.svg"; | |
| 26 | +import CopyAllIcon from "@/assets/copyall.svg"; | |
| 27 | +import DisableCopyIcon from "@/assets/disablecopy.svg"; | |
| 28 | +import DisableCopyAllIcon from "@/assets/disablecopyall.svg"; | |
| 29 | +import DelIcon from "@/assets/delete.svg"; | |
| 30 | +import DisableDelIcon from "@/assets/disabledelete.svg"; /* 获取配置及数据 */ | |
| 31 | +import AntdDraggableModal from "@/components/Common/AntdDraggableModal"; | |
| 32 | +import CommonListSelect from "@/components/Common/CommonListSelect"; | |
| 33 | +import WorkCalendar from "@/components/Common/WorkCalendar/WorkCalendar"; | |
| 34 | +import ContextMenuModal from "@/components/Common/ContextMenuModal"; | |
| 35 | +import CommonViewDragable from "@/components/Common/CommonViewDragable"; | |
| 36 | +import CommonExamInfo from "@/components/Common/CommonExamInfo"; | |
| 37 | +import JsonFormatter from "@/components/Common/Json/JsonFormatter"; | |
| 38 | +import lodash from "lodash"; | |
| 39 | +import userImgs from "@/assets/user.svg"; | |
| 40 | + | |
| 41 | +// import ProcessIcon from '../../assets/process.svg'; | |
| 42 | +// import DisableProcessIcon from '../../assets/disableprocess.svg'; | |
| 43 | +// import MateriallIcon from '../../assets/material.svg'; | |
| 44 | +// import DisableMateriallIcon from '../../assets/disablematerial.svg'; | |
| 45 | +// import SlaveMemo from './SlaveMemo'; | |
| 46 | + | |
| 47 | +const width = "18px"; | |
| 48 | +const height = "18px"; | |
| 49 | +const setAdd = { | |
| 50 | + title: "增加", | |
| 51 | + width: { width }, | |
| 52 | + height: { height }, | |
| 53 | + img: <img src={AddIcon} alt="添加" width={width} height={height} />, | |
| 54 | + disableimg: <img src={DisableAddIcon} alt="删除" width={width} height={height} />, | |
| 55 | +}; | |
| 56 | +const setCopy = { | |
| 57 | + title: "复制", | |
| 58 | + width: { width }, | |
| 59 | + height: { height }, | |
| 60 | + img: <img src={CopyIcon} alt="复制" width="20px" height="20px" />, | |
| 61 | + disableimg: <img src={DisableCopyIcon} alt="复制" width="20px" height="20px" />, | |
| 62 | +}; | |
| 63 | +const setCopyAll = { | |
| 64 | + title: "复制部件", | |
| 65 | + width: { width }, | |
| 66 | + height: { height }, | |
| 67 | + img: <img src={CopyAllIcon} alt="复制部件" width="16px" height="16px" />, | |
| 68 | + disableimg: <img src={DisableCopyAllIcon} alt="复制部件" width="16px" height="16px" />, | |
| 69 | +}; | |
| 70 | +const setDelete = { | |
| 71 | + title: "删除", | |
| 72 | + width: { width }, | |
| 73 | + height: { height }, | |
| 74 | + img: <img src={DelIcon} alt="删除" width={width} height={height} />, | |
| 75 | + disableimg: <img src={DisableDelIcon} alt="删除" width={width} height={height} />, | |
| 76 | +}; | |
| 77 | +// const setProcess = { | |
| 78 | +// title: '工序', | |
| 79 | +// width: { width }, | |
| 80 | +// height: { height }, | |
| 81 | +// img: <img src={ProcessIcon} alt="选择工序" width="16px" height="16px" />, | |
| 82 | +// disableimg: <img src={DisableProcessIcon} alt="删除" width="16px" height="16px" />, | |
| 83 | +// }; | |
| 84 | +// const setMaterial = { | |
| 85 | +// title: '材料', | |
| 86 | +// width: { width }, | |
| 87 | +// height: { height }, | |
| 88 | +// img: <img src={MateriallIcon} alt="选择材料" width="22px" height="22px" />, | |
| 89 | +// disableimg: <img src={DisableMateriallIcon} alt="选择材料" width="22px" height="22px" />, | |
| 90 | +// }; | |
| 91 | + | |
| 92 | +// console.log('btn; ', setAdd, setDelete, setCopy); | |
| 93 | +const { Header, Content } = Layout; | |
| 94 | +const { TabPane } = Tabs; | |
| 95 | + | |
| 96 | +let _this = {}; | |
| 97 | + | |
| 98 | +// const { confirm } = Modal; | |
| 99 | +class CommonNewBill0 extends Component { | |
| 100 | + constructor(props) { | |
| 101 | + super(props); | |
| 102 | + this.state = { | |
| 103 | + currentTab: "", | |
| 104 | + }; | |
| 105 | + _this = this; | |
| 106 | + } | |
| 107 | + | |
| 108 | + componentDidUpdate() { | |
| 109 | + // 没有默认页签情况下, 非编辑状态进入,展示第一个tab | |
| 110 | + const { enabled, masterConfig } = this.props; | |
| 111 | + // 获取默认展开tab | |
| 112 | + const defaultTabConfig = | |
| 113 | + masterConfig && | |
| 114 | + masterConfig.gdsconfigformslave.find( | |
| 115 | + item => | |
| 116 | + ["MainContent", "zMaterials", "zCheck", ...new Array(10).fill("").map((_, index) => `zSlaveInfo${index}`)].includes(item.sControlName) && | |
| 117 | + item.sDefault | |
| 118 | + ); | |
| 119 | + if (!enabled && !this.firstLoaded && commonUtils.isEmptyObject(defaultTabConfig)) { | |
| 120 | + clearTimeout(this.timer); | |
| 121 | + this.timer = setTimeout(() => { | |
| 122 | + this.firstLoaded = true; | |
| 123 | + if (this.slaveTabsRef) { | |
| 124 | + const oFirstTab = this.slaveTabsRef.querySelector(".ant-tabs-nav-list")?.querySelector(".ant-tabs-tab"); | |
| 125 | + if (oFirstTab) { | |
| 126 | + // 创建一个自定义的 click 事件 | |
| 127 | + const clickEvent = new Event("click", { bubbles: true, cancelable: true }); | |
| 128 | + // 触发该元素的 click 事件 | |
| 129 | + oFirstTab.dispatchEvent(clickEvent); | |
| 130 | + } | |
| 131 | + } | |
| 132 | + }, 500); | |
| 133 | + } | |
| 134 | + } | |
| 135 | + | |
| 136 | + /** 行选择 */ | |
| 137 | + onRowClick = (name, record) => { | |
| 138 | + if (name === "control") { | |
| 139 | + this.props.onTableSelectRowChange(name, [record.sId]); | |
| 140 | + } | |
| 141 | + }; | |
| 142 | + | |
| 143 | + onChange = checkedValues => { | |
| 144 | + this.props.onSaveState({ | |
| 145 | + dataPersonArray: checkedValues, | |
| 146 | + }); | |
| 147 | + }; | |
| 148 | + getMenuStatus = menu => { | |
| 149 | + if (menu.sControlName === "BtnImport") { | |
| 150 | + return !this.props.enabled; | |
| 151 | + } | |
| 152 | + }; | |
| 153 | + | |
| 154 | + /** 上传后执行函数 */ | |
| 155 | + // handleUploadChange = (info) => { | |
| 156 | + // const { file } = info; | |
| 157 | + // console.log(info, 'infoinfoinfoinfoinfoinfoinfoinfoinfo'); | |
| 158 | + // const { masterData, sModelsId, slaveConfig } = this.props; | |
| 159 | + // if (file.response) { | |
| 160 | + // if (file.response.code === 1) { | |
| 161 | + // /* 数据查询成功 */ | |
| 162 | + // const errorInfo = file.response.dataset.rows[0].nocanbeInsert; | |
| 163 | + // if (commonUtils.isNotEmptyObject(errorInfo)) { | |
| 164 | + // message.error(errorInfo[0].sReason); | |
| 165 | + // return; | |
| 166 | + // } | |
| 167 | + // const returnData = file.response.dataset.rows[0].canbeInsert; | |
| 168 | + // returnData.forEach(async (tableDataRow) => { | |
| 169 | + // tableDataRow.handleType = 'add'; | |
| 170 | + // tableDataRow.sId = commonUtils.createSid(); | |
| 171 | + // tableDataRow.sParentId = masterData.sId; | |
| 172 | + // tableDataRow.key = tableDataRow.sId; | |
| 173 | + // for (const child of Object.keys(tableDataRow)) { | |
| 174 | + // const index = child.indexOf('_sRealValue_'); | |
| 175 | + // if (index > -1) { | |
| 176 | + // const property = child.substring(0, child.length - 12); | |
| 177 | + // tableDataRow[property] = tableDataRow[child]; | |
| 178 | + // } | |
| 179 | + // } | |
| 180 | + // // const productIdDropDown = commonUtils.getStoreDropDownData(sModelsId, 'slave', 'sProductId'); | |
| 181 | + // let productIdDropDown; | |
| 182 | + // const slaveIndex = slaveConfig.gdsconfigformslave.findIndex(item => item.sName === 'sProductId'); | |
| 183 | + // if (slaveIndex > -1) { | |
| 184 | + // const sqlDropDownData = await this.props.getSqlDropDownData(sModelsId, 'slave', slaveConfig.gdsconfigformslave[slaveIndex]); | |
| 185 | + // productIdDropDown = sqlDropDownData.dropDownData; | |
| 186 | + // } | |
| 187 | + // if (productIdDropDown !== undefined) { | |
| 188 | + // const iProductIdIndex = productIdDropDown.findIndex(item => item.sId === tableDataRow.sProductId); | |
| 189 | + // if (iProductIdIndex === -1) { | |
| 190 | + // tableDataRow.sProductInfo = JSON.stringify({ | |
| 191 | + // sProductId: tableDataRow.sProductName, | |
| 192 | + // sProductName: tableDataRow.sProductName, | |
| 193 | + // sProductStyle: tableDataRow.sProductStyle, | |
| 194 | + // sProductUnit: tableDataRow.sProductUnit, | |
| 195 | + // sProductNo: tableDataRow.sProductNo, | |
| 196 | + // sCustomerProductNo: tableDataRow.sCustomerProductNo, | |
| 197 | + // sProductClassifyId: tableDataRow.sProductClassifyId, | |
| 198 | + // sProductClassifyName: tableDataRow.sProductClassifyName, | |
| 199 | + // }); | |
| 200 | + // } | |
| 201 | + // } | |
| 202 | + // }); | |
| 203 | + // this.props.onSaveState({ slaveData: returnData }); | |
| 204 | + // } else { /* 失败 */ | |
| 205 | + // this.props.getServiceError(file.response); | |
| 206 | + // } | |
| 207 | + // } | |
| 208 | + // }; | |
| 209 | + /** 图片上传后执行函数 */ | |
| 210 | + handleUploadChange = (info, name) => { | |
| 211 | + const { file } = info; | |
| 212 | + if (file.response && file.response.code === 1) { | |
| 213 | + const sPicturePath = file.response.dataset.rows[0].savePathStr; | |
| 214 | + const uploadInfo = { | |
| 215 | + sPicturePath, | |
| 216 | + sFileName: file.name, | |
| 217 | + }; | |
| 218 | + const tableDataRow = this.props.onDataRowAdd(name, true); | |
| 219 | + const { [`${name}Column`]: tableColumn, masterData, [`${name}Data`]: tableData } = this.props; | |
| 220 | + tableColumn.forEach(slaveChild => { | |
| 221 | + const ckey = slaveChild.dataIndex; | |
| 222 | + if (ckey === "sProductNo" || ckey === "sProductName") { | |
| 223 | + tableDataRow[ckey] = masterData[ckey] !== undefined ? masterData[ckey] : ""; | |
| 224 | + } else if (ckey === "iOrder") { | |
| 225 | + tableDataRow[ckey] = ""; | |
| 226 | + } else if (file.response && file.response.code === 1) { | |
| 227 | + if (uploadInfo[ckey] !== undefined) { | |
| 228 | + tableDataRow[ckey] = uploadInfo[ckey]; | |
| 229 | + } | |
| 230 | + } | |
| 231 | + }); | |
| 232 | + tableData.push(tableDataRow); | |
| 233 | + this.props.onSaveState({ [`${name}Data`]: tableData, enabled: true }); | |
| 234 | + } else if (file.response && file.response.code === -1) { | |
| 235 | + message.error(file.response.msg); | |
| 236 | + } | |
| 237 | + }; | |
| 238 | + handleUploadPropsSales = () => { | |
| 239 | + const { masterData, sModelsType } = this.props; | |
| 240 | + if (commonUtils.isNotEmptyObject(masterData)) { | |
| 241 | + const sCustomerId = commonUtils.isEmptyStr(masterData.sCustomerId) ? undefined : masterData.sCustomerId; | |
| 242 | + let existCustomerId = false; | |
| 243 | + if (sModelsType.includes("sales/") && commonUtils.isNotEmptyStr(sCustomerId)) { | |
| 244 | + existCustomerId = true; | |
| 245 | + } else if (!sModelsType.includes("sales/")) { | |
| 246 | + existCustomerId = true; | |
| 247 | + } | |
| 248 | + return { | |
| 249 | + disabled: !this.props.enabled || !existCustomerId /* 是否可用 */, | |
| 250 | + style: { display: commonUtils.convertBooleanToDisplayBlock(true) } /* 是否显示 */, | |
| 251 | + }; | |
| 252 | + } | |
| 253 | + }; | |
| 254 | + | |
| 255 | + handleOk = async (flag, tmpCheck, isWait) => { | |
| 256 | + const { sModelsId, masterData, app, checkConditions, sCheckModelId, checkPersonData, currentId, masterConfig, slaveConfig, checkConfig } = | |
| 257 | + this.props; | |
| 258 | + const { currentPane } = app; | |
| 259 | + const bCkxTmpCheck = app.systemData.filter(item => item.sName === "CkxTmpCheck")[0].sValue; | |
| 260 | + if (bCkxTmpCheck === "1") { | |
| 261 | + const returnData = await this.props.onDataAudit(flag, tmpCheck, isWait); | |
| 262 | + if (returnData.code === 1) { | |
| 263 | + if (returnData.dataset.rows[0].dataSet.outData[0].sCode === 1) { | |
| 264 | + this.props.onGetData(masterConfig, slaveConfig, checkConfig); | |
| 265 | + message.success(returnData.msg); | |
| 266 | + } else { | |
| 267 | + message.error(returnData.dataset.rows[0].dataSet.outData[0].sReturn); | |
| 268 | + } | |
| 269 | + } else { | |
| 270 | + /* 失败 */ | |
| 271 | + this.props.getServiceError(returnData); | |
| 272 | + } | |
| 273 | + } else { | |
| 274 | + const dataPersonArray = commonUtils.isEmptyObject(this.props.dataPersonArray) ? [] : this.props.dataPersonArray; | |
| 275 | + if (commonUtils.isEmptyObject(dataPersonArray)) { | |
| 276 | + checkPersonData.forEach(item => { | |
| 277 | + dataPersonArray.push(item.sUserId); | |
| 278 | + }); | |
| 279 | + } | |
| 280 | + const dataPersonString = dataPersonArray.join(","); | |
| 281 | + const url = `${commonConfig.server_host}business/getProData?sModelsId=${sModelsId}`; | |
| 282 | + const value = { | |
| 283 | + sProName: "Sp_System_AutoSendCheckMsg", | |
| 284 | + paramsMap: { | |
| 285 | + sFormGuid: sModelsId, | |
| 286 | + sBillKey: currentPane.sProcName, | |
| 287 | + sTbName: masterConfig.sTbName, | |
| 288 | + sGuid: masterData.sId, | |
| 289 | + sBillNo: masterData.sBillNo, | |
| 290 | + sCheckCondition: checkConditions, | |
| 291 | + sMemo: "", | |
| 292 | + sCheckModelGuid: sCheckModelId, | |
| 293 | + sCheckPerson: dataPersonString, | |
| 294 | + }, | |
| 295 | + }; | |
| 296 | + | |
| 297 | + const returnData = (await commonServices.postValueService(app.token, value, url)).data; | |
| 298 | + if (returnData.code === 1) { | |
| 299 | + const noCheckMsg = commonFunc.showMessage(app.commonConst, "NoCheckMsg"); /* 您有消息待审核 */ | |
| 300 | + if (returnData.dataset.rows[0].dataSet.outData[0].sCode === 1) { | |
| 301 | + this.props.handleSendSocketMessage("examine", "showImg", currentId, dataPersonString, noCheckMsg, null); | |
| 302 | + const urlCanCheckBill = `${commonConfig.server_host}checkModel/getCanCheckBill?sModelsId=${sModelsId}`; | |
| 303 | + const valueCanCheckBill = { sCheckModelId, checkPersonData, sBillId: masterData.sId }; | |
| 304 | + const returnCanCheckBill = (await commonServices.postValueService(app.token, valueCanCheckBill, urlCanCheckBill)).data; | |
| 305 | + if (returnCanCheckBill.code === 1) { | |
| 306 | + if (returnCanCheckBill.dataset.rows[0].iCount === 1) { | |
| 307 | + this.props.onDataAudit(1, 1); | |
| 308 | + this.props.onSaveState({ | |
| 309 | + visible: false, | |
| 310 | + }); | |
| 311 | + return; | |
| 312 | + } | |
| 313 | + } else { | |
| 314 | + /* 失败 */ | |
| 315 | + this.props.getServiceError(returnCanCheckBill); | |
| 316 | + } | |
| 317 | + this.props.handleSendSocketMessage("reflush", "showImg", currentId, dataPersonString, noCheckMsg, null); | |
| 318 | + message.success(returnData.msg); | |
| 319 | + } else { | |
| 320 | + message.error(returnData.dataset.rows[0].dataSet.outData[0].sReturn); | |
| 321 | + } | |
| 322 | + } else { | |
| 323 | + /* 失败 */ | |
| 324 | + this.props.getServiceError(returnData); | |
| 325 | + } | |
| 326 | + } | |
| 327 | + this.props.onSaveState({ | |
| 328 | + visible: false, | |
| 329 | + }); | |
| 330 | + }; | |
| 331 | + | |
| 332 | + handleCancel = () => { | |
| 333 | + this.props.onSaveState({ | |
| 334 | + visible: false, | |
| 335 | + }); | |
| 336 | + }; | |
| 337 | + handleTableModal = async () => { | |
| 338 | + const { sModelsId, controlData, masterData, slaveData, controlConfig, slaveSelectedRowKeys, enabled, slaveConfig } = this.props; | |
| 339 | + const addState = {}; | |
| 340 | + if (this.props.sModelsType === "sales/salesOrder") { | |
| 341 | + const iSlaveIndex = slaveData.findIndex(item => item.sId === slaveSelectedRowKeys[0]); | |
| 342 | + const iIndex = controlData.findIndex(item => item.sSlaveId === slaveSelectedRowKeys[0]); | |
| 343 | + if (iIndex === -1 && iSlaveIndex > -1 && enabled) { | |
| 344 | + const allTableData = {}; | |
| 345 | + allTableData.master = masterData; | |
| 346 | + allTableData.slaveData = slaveData; | |
| 347 | + // let dropdownProductClassifyId = commonUtils.getStoreDropDownData(sModelsId, 'slave', 'sProductClassifyId'); | |
| 348 | + let dropdownProductClassifyId; | |
| 349 | + const slaveIndex = slaveConfig.gdsconfigformslave.findIndex(item => item.sName === "sProductClassifyId"); | |
| 350 | + if (slaveIndex > -1) { | |
| 351 | + const sqlDropDownData = await this.props.getSqlDropDownData(sModelsId, "slave", slaveConfig.gdsconfigformslave[slaveIndex]); | |
| 352 | + dropdownProductClassifyId = sqlDropDownData.dropDownData; | |
| 353 | + } | |
| 354 | + if (commonUtils.isEmptyArr(dropdownProductClassifyId)) { | |
| 355 | + const iIndex = slaveConfig.gdsconfigformslave.findIndex(item => item.sName === "sProductClassifyName"); | |
| 356 | + if (iIndex > -1) { | |
| 357 | + const sqlDropDownData = await this.props.getSqlDropDownData(sModelsId, "slave", slaveConfig.gdsconfigformslave[iIndex]); | |
| 358 | + dropdownProductClassifyId = sqlDropDownData.dropDownData; | |
| 359 | + } | |
| 360 | + // dropdownProductClassifyId = commonUtils.getStoreDropDownData(sModelsId, 'slave', 'sProductClassifyName'); | |
| 361 | + } | |
| 362 | + if (commonUtils.isNotEmptyArr(dropdownProductClassifyId)) { | |
| 363 | + const iProductClassifyIdIndex = dropdownProductClassifyId.findIndex(item => item.sId === slaveData[iSlaveIndex].sProductClassifyId); | |
| 364 | + if (commonUtils.isNotEmptyObject(dropdownProductClassifyId[iProductClassifyIdIndex])) { | |
| 365 | + const sAllPartsName = dropdownProductClassifyId[iProductClassifyIdIndex].sAllPartsName; | |
| 366 | + if (commonUtils.isNotEmptyStr(sAllPartsName)) { | |
| 367 | + const sAssignFieldObj = sAllPartsName.split(","); | |
| 368 | + for (const child of sAssignFieldObj) { | |
| 369 | + const tableDataRowAdd = commonFunc.getDefaultData(controlConfig, allTableData); | |
| 370 | + tableDataRowAdd.handleType = "add"; | |
| 371 | + tableDataRowAdd.sId = commonUtils.createSid(); | |
| 372 | + tableDataRowAdd.sParentId = masterData && masterData.sId ? masterData.sId : null; | |
| 373 | + tableDataRowAdd.sSlaveId = slaveSelectedRowKeys[0]; | |
| 374 | + tableDataRowAdd.key = tableDataRowAdd.sId; | |
| 375 | + tableDataRowAdd.bDefault = false; | |
| 376 | + tableDataRowAdd.iOrder = 0; | |
| 377 | + tableDataRowAdd.sPartsName = child; | |
| 378 | + tableDataRowAdd.dPartsQty = slaveData[iSlaveIndex].dProductQty; | |
| 379 | + controlData.push(tableDataRowAdd); | |
| 380 | + } | |
| 381 | + } | |
| 382 | + } | |
| 383 | + } | |
| 384 | + addState.controlData = controlData; | |
| 385 | + } | |
| 386 | + | |
| 387 | + if (controlData !== undefined) { | |
| 388 | + const iControlIndex = controlData.findIndex(item => item.sSlaveId === slaveSelectedRowKeys[0]); | |
| 389 | + if (iControlIndex > -1) { | |
| 390 | + addState.controlSelectedRowKeys = [controlData[iControlIndex].sId]; | |
| 391 | + } | |
| 392 | + } | |
| 393 | + } | |
| 394 | + | |
| 395 | + this.props.onSaveState({ | |
| 396 | + visibleModal: true, | |
| 397 | + ...addState, | |
| 398 | + }); | |
| 399 | + }; | |
| 400 | + handleTableChooseProcess = () => { | |
| 401 | + const { processConfig } = this.props; | |
| 402 | + const iIndex = processConfig.gdsconfigformslave.findIndex(item => item.sControlName === "BtnChooseProcess"); | |
| 403 | + | |
| 404 | + if (iIndex > -1) { | |
| 405 | + this.props.onBtnChoose("process", "BtnChooseProcess", processConfig.gdsconfigformslave[iIndex]); | |
| 406 | + } | |
| 407 | + }; | |
| 408 | + handleCancelModal = modelVisible => { | |
| 409 | + this.props.onSaveState({ | |
| 410 | + [modelVisible]: false, | |
| 411 | + }); | |
| 412 | + }; | |
| 413 | + handleOkModal = () => { | |
| 414 | + const { controlData, slave0Data, processData, sModelsId, slaveData, slaveSelectedRowKeys, materialsConfig, processConfig } = this.props; | |
| 415 | + const ctData = controlData.filter(item => item.handleType !== "del" && item.sSlaveId === slaveSelectedRowKeys[0]); | |
| 416 | + const mtData = slave0Data.filter(item => item.handleType !== "del" && item.sSlaveId === slaveSelectedRowKeys[0]); | |
| 417 | + const pData = processData.filter(item => item.handleType !== "del" && item.sSlaveId === slaveSelectedRowKeys[0] && item.sType === "2"); | |
| 418 | + if (commonUtils.isNotEmptyArr(ctData)) { | |
| 419 | + let mDetail = ""; | |
| 420 | + let pDetail = ""; | |
| 421 | + const slaveIndex = slaveData.findIndex(item => item.sId === slaveSelectedRowKeys[0]); | |
| 422 | + ctData.forEach(async (controlItem, n) => { | |
| 423 | + if (commonUtils.isNotEmptyObject(controlItem.sPartsName)) { | |
| 424 | + const qz = n === 0 ? "" : " "; | |
| 425 | + if (commonUtils.isNotEmptyObject(controlItem.sPartsName)) { | |
| 426 | + const yDetail = `${mDetail}${qz}#${controlItem.sPartsName}:`; | |
| 427 | + const gDetail = `${pDetail}${qz}#${controlItem.sPartsName}:`; | |
| 428 | + let imDetail = ""; | |
| 429 | + let ipDetail = ""; | |
| 430 | + const materials = mtData.filter(materialsItem => materialsItem.sControlId === controlItem.sId); | |
| 431 | + // const materialsIdDropDown = commonUtils.getStoreDropDownData(sModelsId, 'materials', 'sMaterialsName'); | |
| 432 | + let materialsIdDropDown; | |
| 433 | + const materialsIndex = materialsConfig.gdsconfigformslave.findIndex(item => item.sName === "sMaterialsName"); | |
| 434 | + if (materialsIndex > -1) { | |
| 435 | + const sqlDropDownData = await this.props.getSqlDropDownData(sModelsId, "materials", materialsConfig.gdsconfigformslave[materialsIndex]); | |
| 436 | + materialsIdDropDown = sqlDropDownData.dropDownData; | |
| 437 | + } | |
| 438 | + materials.forEach((mItem, i) => { | |
| 439 | + const fh = i === 0 ? "" : ","; | |
| 440 | + if (materialsIdDropDown) { | |
| 441 | + const materialsIdIndex = materialsIdDropDown.findIndex(item => item.sId === mItem.sMaterialsId); | |
| 442 | + if (materialsIdIndex > -1) { | |
| 443 | + imDetail = `${imDetail}${fh} ${materialsIdDropDown[materialsIdIndex].sMaterialsName}`; | |
| 444 | + } | |
| 445 | + } | |
| 446 | + }); | |
| 447 | + // processPropsType | |
| 448 | + const process = pData.filter(processItem => processItem.sControlId === controlItem.sId); | |
| 449 | + // const processIdDropDown = commonUtils.getStoreDropDownData(sModelsId, 'process', 'sProcessName'); | |
| 450 | + let processIdDropDown; | |
| 451 | + const processIndex = processConfig.gdsconfigformslave.findIndex(item => item.sName === "sProcessName"); | |
| 452 | + if (processIndex > -1) { | |
| 453 | + const sqlDropDownData = await this.props.getSqlDropDownData(sModelsId, "process", processConfig.gdsconfigformslave[processIndex]); | |
| 454 | + processIdDropDown = sqlDropDownData.dropDownData; | |
| 455 | + } | |
| 456 | + process.forEach((pItem, i) => { | |
| 457 | + const fh = i === 0 ? "" : ","; | |
| 458 | + if (processIdDropDown) { | |
| 459 | + const processIdIndex = processIdDropDown.findIndex(item => item.sId === pItem.sProcessId); | |
| 460 | + if (processIdIndex > -1) { | |
| 461 | + ipDetail = `${ipDetail}${fh} ${processIdDropDown[processIdIndex].sProcessName}`; | |
| 462 | + } | |
| 463 | + } | |
| 464 | + }); | |
| 465 | + if (commonUtils.isNotEmptyObject(imDetail)) { | |
| 466 | + mDetail = `${yDetail}${imDetail}`; | |
| 467 | + } | |
| 468 | + if (commonUtils.isNotEmptyObject(ipDetail)) { | |
| 469 | + pDetail = `${gDetail}${ipDetail}`; | |
| 470 | + } | |
| 471 | + } | |
| 472 | + } | |
| 473 | + }); | |
| 474 | + slaveData[slaveIndex].sMaterialsMemo = mDetail; | |
| 475 | + slaveData[slaveIndex].sProcessMemo = pDetail; | |
| 476 | + slaveData[slaveIndex].handleType = commonUtils.isEmpty(slaveData[slaveIndex].handleType) ? "update" : slaveData[slaveIndex].handleType; | |
| 477 | + } else if (commonUtils.isNotEmptyArr(controlData) && commonUtils.isEmptyArr(ctData)) { | |
| 478 | + const sSlaveId = controlData[0].sSlaveId; | |
| 479 | + const slaveIndex = slaveData.findIndex(item => item.sId === sSlaveId); | |
| 480 | + slaveData[slaveIndex].sMaterialsMemo = ""; | |
| 481 | + slaveData[slaveIndex].sProcessMemo = ""; | |
| 482 | + slaveData[slaveIndex].handleType = commonUtils.isEmpty(slaveData[slaveIndex].handleType) ? "update" : slaveData[slaveIndex].handleType; | |
| 483 | + } | |
| 484 | + this.props.onSaveState({ | |
| 485 | + visibleModal: false, | |
| 486 | + controlData, | |
| 487 | + slave0Data, | |
| 488 | + processData, | |
| 489 | + slaveData, | |
| 490 | + }); | |
| 491 | + }; | |
| 492 | + /** 控制选择控制表时,显示部件工序与成品工序 */ | |
| 493 | + handleFilterSlaveData = (name, dataIndex, value, record) => { | |
| 494 | + return commonUtils.isNotEmptyStr(record.sSlaveId) && record.sSlaveId.toString().toLowerCase().includes(value.toLowerCase()); | |
| 495 | + }; | |
| 496 | + /** 控制选择控制表时,显示部件工序与成品工序 */ | |
| 497 | + // eslint-disable-next-line no-unused-vars | |
| 498 | + handleFilterData = (name, dataIndex, value, record) => { | |
| 499 | + return true; | |
| 500 | + // const { slaveSelectedRowKeys } = this.props; | |
| 501 | + // if (name === 'process') { | |
| 502 | + // return (commonUtils.isNotEmptyStr(record.sType) && record.sType === '3' && | |
| 503 | + // commonUtils.isNotEmptyStr(record.sSlaveId) && record.sSlaveId.toString().toLowerCase().includes(slaveSelectedRowKeys.toString().toLowerCase())) || | |
| 504 | + // (commonUtils.isNotEmptyStr(record.sControlId) && record.sControlId.toString().toLowerCase().includes(value.toLowerCase()) && | |
| 505 | + // commonUtils.isNotEmptyStr(record.sSlaveId) && record.sSlaveId.toString().toLowerCase().includes(slaveSelectedRowKeys.toString().toLowerCase())); | |
| 506 | + // } else { | |
| 507 | + // return (commonUtils.isNotEmptyStr(record.sType) && record.sType === '2' && | |
| 508 | + // commonUtils.isNotEmptyStr(record.sSlaveId) && record.sSlaveId.toString().toLowerCase().includes(slaveSelectedRowKeys.toString().toLowerCase())) || | |
| 509 | + // (commonUtils.isNotEmptyStr(record.sControlId) && record.sControlId.toString().toLowerCase().includes(value.toLowerCase()) && | |
| 510 | + // commonUtils.isNotEmptyStr(record.sSlaveId) && record.sSlaveId.toString().toLowerCase().includes(slaveSelectedRowKeys.toString().toLowerCase())); | |
| 511 | + // } | |
| 512 | + // (commonUtils.isNotEmptyStr(record.sControlId) && record.sControlId.toString().toLowerCase().includes(value.toLowerCase())); | |
| 513 | + }; | |
| 514 | + /* 控制表过滤材料表 工序表数据 */ | |
| 515 | + handleGetFilterData = name => { | |
| 516 | + const { [`${name}Data`]: data, controlSelectedRowKeys, slaveSelectedRowKeys } = this.props; | |
| 517 | + if (data !== undefined) { | |
| 518 | + const newArr = data.filter(item => { | |
| 519 | + if (name === "control") { | |
| 520 | + return commonUtils.isNotEmptyStr(item.sSlaveId) && item.sSlaveId.toString().toLowerCase().includes(slaveSelectedRowKeys.toString()); | |
| 521 | + } else { | |
| 522 | + return ( | |
| 523 | + commonUtils.isNotEmptyStr(item.sControlId) && | |
| 524 | + item.sControlId.toString().toLowerCase().includes(controlSelectedRowKeys.toString()) && | |
| 525 | + commonUtils.isNotEmptyStr(item.sSlaveId) && | |
| 526 | + item.sSlaveId.toString().toLowerCase().includes(slaveSelectedRowKeys.toString()) | |
| 527 | + ); | |
| 528 | + } | |
| 529 | + }); | |
| 530 | + return newArr.length; | |
| 531 | + } | |
| 532 | + }; | |
| 533 | + /** 添加表格空行 */ | |
| 534 | + handleTableAdd = async (name, flag) => { | |
| 535 | + /* 外置处理业务 */ | |
| 536 | + const { | |
| 537 | + sModelsId, | |
| 538 | + sModelsType, | |
| 539 | + gdsformconst, | |
| 540 | + slaveData, | |
| 541 | + controlData, | |
| 542 | + controlSelectedRowKeys, | |
| 543 | + [`${name}Data`]: tableData, | |
| 544 | + slaveSelectedRowKeys, | |
| 545 | + slaveConfig, | |
| 546 | + } = this.props; | |
| 547 | + let tableDataRow = {}; | |
| 548 | + if (name === "control") { | |
| 549 | + tableDataRow = this.props.onDataRowAdd(name, true); | |
| 550 | + if (commonUtils.isEmptyObject(tableDataRow)) { | |
| 551 | + return; | |
| 552 | + } | |
| 553 | + let dPartsQty = 0; | |
| 554 | + if (commonUtils.isNotEmptyArr(slaveData)) { | |
| 555 | + slaveData.forEach(item => { | |
| 556 | + dPartsQty += commonUtils.isNull(item.dProductQty, 0) + commonUtils.isNull(item.dGiveQty, 0) + commonUtils.isNull(item.dStockupQty, 0); | |
| 557 | + }); | |
| 558 | + // const productIdDropDown = commonUtils.getStoreDropDownData(sModelsId, 'slave', 'sProductName'); | |
| 559 | + let productIdDropDown; | |
| 560 | + const slaveIndex = slaveConfig.gdsconfigformslave.findIndex(item => item.sName === "sProductName"); | |
| 561 | + if (slaveIndex > -1) { | |
| 562 | + const sqlDropDownData = await this.props.getSqlDropDownData(sModelsId, "slave", slaveConfig.gdsconfigformslave[slaveIndex]); | |
| 563 | + productIdDropDown = sqlDropDownData.dropDownData; | |
| 564 | + } | |
| 565 | + if (productIdDropDown) { | |
| 566 | + const iProductIdIndex = productIdDropDown.findIndex(item => item.sId === slaveData[0].sProductId); | |
| 567 | + if (iProductIdIndex > -1) { | |
| 568 | + tableDataRow.sPartsName = productIdDropDown[iProductIdIndex].sProductName; | |
| 569 | + } | |
| 570 | + } | |
| 571 | + } | |
| 572 | + const iSlaveIndex = slaveData.findIndex(item => item.sId === slaveSelectedRowKeys[0]); | |
| 573 | + if (iSlaveIndex > -1) { | |
| 574 | + if (sModelsType === "sales/salesOrder") { | |
| 575 | + if (!commonUtils.isEmpty(slaveData[iSlaveIndex].dProductQty)) { | |
| 576 | + tableDataRow.dPartsQty = | |
| 577 | + commonUtils.isNull(slaveData[iSlaveIndex].dProductQty, 0) + commonUtils.isNull(slaveData[iSlaveIndex].dGiveQty, 0); | |
| 578 | + } | |
| 579 | + } else { | |
| 580 | + tableDataRow.dPartsQty = dPartsQty; | |
| 581 | + } | |
| 582 | + tableDataRow.sSlaveId = slaveData[iSlaveIndex].sId; | |
| 583 | + } | |
| 584 | + tableData.push(tableDataRow); | |
| 585 | + this.props.onSaveState({ [`${name}Data`]: tableData, [`${name}SelectedRowKeys`]: [tableDataRow.sId] }); | |
| 586 | + } else if (name === "materials" || name === "process") { | |
| 587 | + tableDataRow = this.props.onDataRowAdd(name, true); | |
| 588 | + if (commonUtils.isEmptyArr(controlSelectedRowKeys)) { | |
| 589 | + const msg = commonFunc.showMessage(gdsformconst, "pleaseChooseParts"); | |
| 590 | + message.warn(msg === "" ? "请选择部件" : msg); // 请选择部件 | |
| 591 | + return; | |
| 592 | + } | |
| 593 | + const iIndex = controlData.findIndex(item => item.sId === controlSelectedRowKeys[0]); | |
| 594 | + const iSlaveIndex = slaveData.findIndex(item => item.sId === slaveSelectedRowKeys[0]); | |
| 595 | + if (iIndex > -1 && iSlaveIndex > -1) { | |
| 596 | + if (commonUtils.isEmpty(controlData[iIndex].sPartsName) === "") { | |
| 597 | + message.warn(commonFunc.showMessage(gdsformconst, "partsNameNotNull")); // 部件名称不能为空 | |
| 598 | + return; | |
| 599 | + } | |
| 600 | + tableDataRow.sSlaveId = slaveData[iSlaveIndex].sId; | |
| 601 | + tableDataRow.sControlId = controlData[iIndex].sId; | |
| 602 | + tableDataRow.sPartsName = controlData[iIndex].sPartsName; | |
| 603 | + } | |
| 604 | + tableData.push(tableDataRow); | |
| 605 | + this.props.onSaveState({ [`${name}Data`]: tableData, [`${name}SelectedRowKeys`]: [tableDataRow.sId] }); | |
| 606 | + } else { | |
| 607 | + this.props.onDataRowAdd(name, flag); | |
| 608 | + } | |
| 609 | + }; | |
| 610 | + /** 删除表格数据 */ | |
| 611 | + otherTableDel = (name, tableSelectedRowKeys) => { | |
| 612 | + const tableData = this.props[`${name}Data`]; | |
| 613 | + let tableDelData = this.props[`${name}DelData`]; | |
| 614 | + tableDelData = commonUtils.isEmptyArr(tableDelData) ? [] : tableDelData; | |
| 615 | + for (const sId of tableSelectedRowKeys) { | |
| 616 | + /* 看看删除集合和从表中是否都存在该条数据 */ | |
| 617 | + let tableDataIndex = tableData.findIndex(item => item.sControlId === sId); | |
| 618 | + while (tableDataIndex > -1) { | |
| 619 | + /* 删除从表中的数据并存入删除集合中 */ | |
| 620 | + const slaveDataFilter = tableData[tableDataIndex]; | |
| 621 | + tableData.splice(tableDataIndex, 1); | |
| 622 | + slaveDataFilter.handleType = "del"; | |
| 623 | + tableDelData.push(slaveDataFilter); | |
| 624 | + tableDataIndex = tableData.findIndex(item => item.sControlId === sId); | |
| 625 | + } | |
| 626 | + } | |
| 627 | + return { [`${name}Data`]: tableData, [`${name}DelData`]: tableDelData, [`${name}SelectedRowKeys`]: [] }; | |
| 628 | + }; | |
| 629 | + /** 删除表格数据 */ | |
| 630 | + handleTableDel = (name, isWait, tableSelectedRowKeys) => { | |
| 631 | + const { slaveSelectedRowKeys, slaveData, slaveConfig, sModelsId, masterData } = this.props; | |
| 632 | + if (name === "control") { | |
| 633 | + const tableSelectedRowKeys = this.props[`${name}SelectedRowKeys`]; | |
| 634 | + if (commonUtils.isNotEmptyArr(tableSelectedRowKeys)) { | |
| 635 | + const materialsReturnData = this.otherTableDel("materials", tableSelectedRowKeys); | |
| 636 | + const processReturnData = this.otherTableDel("process", tableSelectedRowKeys); | |
| 637 | + const controlReturnData = this.props.onDataRowDel(name, isWait, tableSelectedRowKeys); | |
| 638 | + this.props.onSaveState({ | |
| 639 | + ...materialsReturnData, | |
| 640 | + ...processReturnData, | |
| 641 | + ...controlReturnData, | |
| 642 | + }); | |
| 643 | + return true; | |
| 644 | + } else { | |
| 645 | + return false; | |
| 646 | + } | |
| 647 | + } else if (name === "slave") { | |
| 648 | + /* 删除子表 */ | |
| 649 | + if (slaveConfig.sTableType === "single") { | |
| 650 | + /* 单表删除 */ | |
| 651 | + if (commonUtils.isNotEmptyArr(slaveSelectedRowKeys)) { | |
| 652 | + let slaveSelectedRowNewKeys = slaveSelectedRowKeys; | |
| 653 | + const newSelectedRowKeys = this.handleDelSlaveChild(slaveData, slaveSelectedRowKeys[0], slaveSelectedRowKeys); | |
| 654 | + if (commonUtils.isNotEmptyArr(newSelectedRowKeys)) { | |
| 655 | + slaveSelectedRowNewKeys = newSelectedRowKeys; | |
| 656 | + } | |
| 657 | + const slaveReturnData = this.props.onDataRowDel(name, isWait, slaveSelectedRowNewKeys); | |
| 658 | + this.props.onSaveState({ | |
| 659 | + ...slaveReturnData, | |
| 660 | + }); | |
| 661 | + return true; | |
| 662 | + } | |
| 663 | + } else if (sModelsId === "12710101117000994807090") { | |
| 664 | + /* 从表删除 更新主表入仓数量 */ | |
| 665 | + const slaveReturnData = this.props.onDataRowDel(name, true, slaveSelectedRowKeys); | |
| 666 | + if ( | |
| 667 | + commonUtils.isNotEmptyObject(slaveReturnData) && | |
| 668 | + commonUtils.isNotEmptyArr(slaveReturnData.slaveData) && | |
| 669 | + commonUtils.isNotEmptyObject(masterData) | |
| 670 | + ) { | |
| 671 | + let dSumProductQty = 0; | |
| 672 | + slaveReturnData.slaveData.forEach((item, index) => { | |
| 673 | + dSumProductQty = commonUtils.convertFixNum( | |
| 674 | + commonUtils.convertFixNum(commonUtils.isNull(dSumProductQty, 0), 6) + commonUtils.convertFixNum(commonUtils.isNull(item.dSampleQty), 6), | |
| 675 | + 6 | |
| 676 | + ); | |
| 677 | + }); | |
| 678 | + masterData.dInspectQty = commonUtils.convertFixNum(dSumProductQty * 10000, 6); | |
| 679 | + masterData.handleType = commonUtils.isEmpty(masterData.handleType) ? "update" : masterData.handleType; | |
| 680 | + slaveReturnData.masterData = masterData; | |
| 681 | + } | |
| 682 | + this.props.onSaveState({ | |
| 683 | + ...slaveReturnData, | |
| 684 | + }); | |
| 685 | + return true; | |
| 686 | + } else { | |
| 687 | + const slaveReturnData = this.props.onDataRowDel(name, isWait, slaveSelectedRowKeys); | |
| 688 | + this.props.onSaveState({ | |
| 689 | + ...slaveReturnData, | |
| 690 | + }); | |
| 691 | + return true; | |
| 692 | + } | |
| 693 | + } else { | |
| 694 | + return this.props.onDataRowDel(name, isWait, tableSelectedRowKeys); | |
| 695 | + } | |
| 696 | + }; | |
| 697 | + | |
| 698 | + /* 迭代删除从表子表数据 */ | |
| 699 | + handleDelSlaveChild = (tableData, sId, tableSelectedKeys) => { | |
| 700 | + const filterData = tableData.filter(item => item.sFatherSlaveId === sId); | |
| 701 | + filterData.forEach(item => { | |
| 702 | + tableSelectedKeys.push(item.sId); | |
| 703 | + this.handleDelSlaveChild(tableData, item.sId, tableSelectedKeys); | |
| 704 | + }); | |
| 705 | + return tableSelectedKeys; | |
| 706 | + }; | |
| 707 | + | |
| 708 | + /** 销售订单删除从表数据时也删除控制材料工序表数据 */ | |
| 709 | + handleSlaveTableDel = (name, isWait, tableSelectedRowKeys) => { | |
| 710 | + const { sModelsType, controlData, processData, materialsData } = this.props; | |
| 711 | + if (sModelsType === "sales/salesOrder" && name === "slave") { | |
| 712 | + const controlDataDel = controlData.filter(item => item.sSlaveId === tableSelectedRowKeys[0]); | |
| 713 | + const controlDataSelectedRowKeys = []; | |
| 714 | + if (!commonUtils.isEmpty(controlDataDel)) { | |
| 715 | + for (const item of controlDataDel) { | |
| 716 | + const materialsDataSelectedRowKey = item.sId; | |
| 717 | + controlDataSelectedRowKeys.push(materialsDataSelectedRowKey); | |
| 718 | + } | |
| 719 | + if (commonUtils.isNotEmptyArr(controlDataSelectedRowKeys)) { | |
| 720 | + this.props.onDataRowDel("control", isWait, controlDataSelectedRowKeys, true); | |
| 721 | + } | |
| 722 | + const materialsDataDel = materialsData.filter(item => item.sSlaveId === tableSelectedRowKeys[0]); | |
| 723 | + const materialsDataSelectedRowKeys = []; | |
| 724 | + if (!commonUtils.isEmpty(materialsDataDel)) { | |
| 725 | + for (const item of materialsDataDel) { | |
| 726 | + const materialsDataSelectedRowKey = item.sId; | |
| 727 | + materialsDataSelectedRowKeys.push(materialsDataSelectedRowKey); | |
| 728 | + } | |
| 729 | + } | |
| 730 | + if (commonUtils.isNotEmptyArr(materialsDataSelectedRowKeys)) { | |
| 731 | + this.props.onDataRowDel("materials", isWait, materialsDataSelectedRowKeys, true); | |
| 732 | + } | |
| 733 | + const processDataDel = processData.filter(item => item.sSlaveId === tableSelectedRowKeys[0]); | |
| 734 | + const processDataSelectedRowKeys = []; | |
| 735 | + if (!commonUtils.isEmpty(processDataDel)) { | |
| 736 | + for (const item of processDataDel) { | |
| 737 | + const processDataSelectedRowKey = item.sId; | |
| 738 | + processDataSelectedRowKeys.push(processDataSelectedRowKey); | |
| 739 | + } | |
| 740 | + } | |
| 741 | + if (commonUtils.isNotEmptyArr(processDataSelectedRowKeys)) { | |
| 742 | + this.props.onDataRowDel("process", isWait, processDataSelectedRowKeys, true); | |
| 743 | + } | |
| 744 | + } | |
| 745 | + } | |
| 746 | + return this.props.onDataRowDel(name, isWait, tableSelectedRowKeys); | |
| 747 | + }; | |
| 748 | + handleSelect = async (name, selectConfig, selectData) => { | |
| 749 | + const { | |
| 750 | + [`${name}Data`]: tableData, | |
| 751 | + [`${name}Config`]: tableConfig, | |
| 752 | + masterData, | |
| 753 | + masterConfig, | |
| 754 | + controlSelectedRowKeys, | |
| 755 | + sModelsId, | |
| 756 | + token, | |
| 757 | + app, | |
| 758 | + } = this.props; | |
| 759 | + const tableSelectedRowKeys = []; | |
| 760 | + if (name === "productProcessInfo") { | |
| 761 | + if (commonUtils.isNotEmptyArr(selectData)) { | |
| 762 | + let slaveData = []; | |
| 763 | + let controlData = []; | |
| 764 | + let materialsData = []; | |
| 765 | + let processData = []; | |
| 766 | + let sConfigMasterIdSlave = ""; | |
| 767 | + let sConfigMasterIdControl = ""; | |
| 768 | + let sConfigMasterIdMaterials = ""; | |
| 769 | + let sConfigMasterIdProcess = ""; | |
| 770 | + const selectRowData = selectData[0]; | |
| 771 | + const sConfigIdString = masterConfig.gdsconfigformslave.filter(item => item.sName === "sConfigId")[0].showDropDown; | |
| 772 | + if (commonUtils.isNotEmptyStr(sConfigIdString)) { | |
| 773 | + const sConfigId = JSON.parse(sConfigIdString); | |
| 774 | + sConfigMasterIdSlave = sConfigId.sConfigMasterIdSlave; | |
| 775 | + sConfigMasterIdControl = sConfigId.sConfigMasterIdControl; | |
| 776 | + sConfigMasterIdMaterials = sConfigId.sConfigMasterIdMaterials; | |
| 777 | + sConfigMasterIdProcess = sConfigId.sConfigMasterIdProcess; | |
| 778 | + } | |
| 779 | + if (commonUtils.isEmptyStr(sConfigMasterIdSlave)) { | |
| 780 | + message.warning(commonFunc.showMessage(app.commonConst, "slaveParameterErro")); | |
| 781 | + } | |
| 782 | + if (commonUtils.isEmptyStr(sConfigMasterIdControl)) { | |
| 783 | + message.warning(commonFunc.showMessage(app.commonConst, "controlParameterErro")); | |
| 784 | + } | |
| 785 | + if (commonUtils.isEmptyStr(sConfigMasterIdMaterials)) { | |
| 786 | + message.warning(commonFunc.showMessage(app.commonConst, "materialsParameterErro")); | |
| 787 | + } | |
| 788 | + if (commonUtils.isEmptyStr(sConfigMasterIdProcess)) { | |
| 789 | + message.warning(commonFunc.showMessage(app.commonConst, "processParameterErro")); | |
| 790 | + } | |
| 791 | + const slaveUrl = `${commonConfig.server_host}business/getBusinessDataByFormcustomId/${sConfigMasterIdSlave}?sModelsId=${sModelsId}`; | |
| 792 | + const value = { sSqlCondition: { sParentId: selectRowData.sId } }; | |
| 793 | + const slaveReturnData = (await commonServices.postValueService(token, value, slaveUrl)).data; | |
| 794 | + if (slaveReturnData.code === 1) { | |
| 795 | + slaveData = slaveReturnData.dataset.rows[0].dataSet; | |
| 796 | + slaveData.forEach(item => { | |
| 797 | + item.handleType = "add"; | |
| 798 | + item.sId = commonUtils.createSid(); | |
| 799 | + item.sParentId = masterData.sId; | |
| 800 | + }); | |
| 801 | + } else { | |
| 802 | + this.props.getServiceError(slaveReturnData); | |
| 803 | + } | |
| 804 | + | |
| 805 | + const controlUrl = `${commonConfig.server_host}business/getBusinessDataByFormcustomId/${sConfigMasterIdControl}?sModelsId=${sModelsId}`; | |
| 806 | + const controlReturnData = (await commonServices.postValueService(token, value, controlUrl)).data; | |
| 807 | + if (controlReturnData.code === 1) { | |
| 808 | + controlData = controlReturnData.dataset.rows[0].dataSet; | |
| 809 | + controlData.forEach(item => { | |
| 810 | + item.handleType = "add"; | |
| 811 | + item.sId = commonUtils.createSid(); | |
| 812 | + item.sParentId = masterData.sId; | |
| 813 | + }); | |
| 814 | + } else { | |
| 815 | + this.props.getServiceError(controlReturnData); | |
| 816 | + } | |
| 817 | + const materialsUrl = `${commonConfig.server_host}business/getBusinessDataByFormcustomId/${sConfigMasterIdMaterials}?sModelsId=${sModelsId}`; | |
| 818 | + const materialsReturnData = (await commonServices.postValueService(token, value, materialsUrl)).data; | |
| 819 | + if (materialsReturnData.code === 1) { | |
| 820 | + materialsData = materialsReturnData.dataset.rows[0].dataSet; | |
| 821 | + materialsData.forEach(item => { | |
| 822 | + item.handleType = "add"; | |
| 823 | + item.sId = commonUtils.createSid(); | |
| 824 | + item.sParentId = masterData.sId; | |
| 825 | + }); | |
| 826 | + } else { | |
| 827 | + this.props.getServiceError(materialsReturnData); | |
| 828 | + } | |
| 829 | + const processUrl = `${commonConfig.server_host}business/getBusinessDataByFormcustomId/${sConfigMasterIdProcess}?sModelsId=${sModelsId}`; | |
| 830 | + const processReturnData = (await commonServices.postValueService(token, value, processUrl)).data; | |
| 831 | + if (processReturnData.code === 1) { | |
| 832 | + processData = processReturnData.dataset.rows[0].dataSet; | |
| 833 | + processData.forEach(item => { | |
| 834 | + item.handleType = "add"; | |
| 835 | + item.sId = commonUtils.createSid(); | |
| 836 | + item.sParentId = masterData.sId; | |
| 837 | + }); | |
| 838 | + } else { | |
| 839 | + this.props.getServiceError(processReturnData); | |
| 840 | + } | |
| 841 | + this.props.onSaveState({ | |
| 842 | + processData, | |
| 843 | + materialsData, | |
| 844 | + controlData, | |
| 845 | + slaveData, | |
| 846 | + [`${name}ChooseVisible`]: false, | |
| 847 | + [`${name}SelectedRowKeys`]: tableSelectedRowKeys, | |
| 848 | + }); | |
| 849 | + } | |
| 850 | + } else { | |
| 851 | + const { controlData, slaveData, slaveSelectedRowKeys } = this.props; | |
| 852 | + const iIndex = commonUtils.isNotEmptyArr(controlSelectedRowKeys) ? controlData.findIndex(item => item.sId === controlSelectedRowKeys[0]) : -1; | |
| 853 | + if (commonUtils.isNotEmptyArr(selectData)) { | |
| 854 | + selectData.forEach(item => { | |
| 855 | + const newCopyTo = {}; | |
| 856 | + newCopyTo.master = masterData; | |
| 857 | + if (iIndex > -1) { | |
| 858 | + newCopyTo.control = controlData[iIndex]; | |
| 859 | + } | |
| 860 | + let tableDataRow = commonFunc.getDefaultData(tableConfig, newCopyTo); // 取默认值 | |
| 861 | + tableDataRow = { ...tableDataRow, ...commonFunc.getAssignFieldValue(selectConfig.sAssignField, item, newCopyTo) }; // 取赋值字段 | |
| 862 | + tableDataRow.handleType = "add"; | |
| 863 | + tableDataRow.sId = commonUtils.createSid(); | |
| 864 | + tableDataRow.sParentId = masterData.sId; | |
| 865 | + if (this.props.sModelsType === "sales/salesOrder") { | |
| 866 | + const iSlaveIndex = commonUtils.isNotEmptyArr(slaveSelectedRowKeys) | |
| 867 | + ? slaveData.findIndex(item => item.sId === slaveSelectedRowKeys[0]) | |
| 868 | + : -1; | |
| 869 | + if (iSlaveIndex > -1) { | |
| 870 | + tableDataRow.sSlaveId = slaveData[iSlaveIndex].sId; | |
| 871 | + } | |
| 872 | + } | |
| 873 | + if (iIndex > -1 && tableDataRow.sType !== "3") { | |
| 874 | + tableDataRow.sControlId = controlData[iIndex].sId; | |
| 875 | + tableDataRow.sPartsName = controlData[iIndex].sPartsName; | |
| 876 | + tableData.push(tableDataRow); | |
| 877 | + } else if (tableDataRow.sType === "3") { | |
| 878 | + tableData.push(tableDataRow); | |
| 879 | + } | |
| 880 | + tableSelectedRowKeys.push(tableDataRow.sId); | |
| 881 | + }); | |
| 882 | + } | |
| 883 | + const tableDataNew = this.sortData(controlData, tableData); | |
| 884 | + this.props.onSaveState({ [`${name}Data`]: tableDataNew, [`${name}ChooseVisible`]: false, [`${name}SelectedRowKeys`]: tableSelectedRowKeys }); | |
| 885 | + } | |
| 886 | + }; | |
| 887 | + | |
| 888 | + sortData = (tableData, processData) => { | |
| 889 | + processData.sort((g1, g2) => { | |
| 890 | + const iIndex1 = tableData.findIndex(item => item.sId === g1.sControlId) === -1 ? 999 : tableData.findIndex(item => item.sId === g1.sControlId); | |
| 891 | + let sPartOrder1 = `0000${iIndex1}`; | |
| 892 | + sPartOrder1 = sPartOrder1.substring(sPartOrder1.length - 3); | |
| 893 | + let sOrder1 = `000${g1.iOrder}`; | |
| 894 | + sOrder1 = sOrder1.substring(sOrder1.length - 3); | |
| 895 | + | |
| 896 | + const iIndex2 = tableData.findIndex(item => item.sId === g2.sControlId) === -1 ? 999 : tableData.findIndex(item => item.sId === g2.sControlId); | |
| 897 | + let sPartOrder2 = `0000${iIndex2}`; | |
| 898 | + sPartOrder2 = sPartOrder2.substring(sPartOrder2.length - 3); | |
| 899 | + let sOrder2 = `000${g2.iOrder}`; | |
| 900 | + sOrder2 = sOrder2.substring(sOrder2.length - 3); | |
| 901 | + return parseInt(sPartOrder1 + g1.sType + sOrder1, 10) - parseInt(sPartOrder2 + g2.sType + sOrder2, 10); | |
| 902 | + }); | |
| 903 | + return processData; | |
| 904 | + }; | |
| 905 | + /** 上传后执行函数 */ | |
| 906 | + handleBeforeUpload = () => { | |
| 907 | + // const isLt10M = file.size / 1024 / 1024 < 10; | |
| 908 | + // if (!isLt10M) { | |
| 909 | + // message.error(commonFunc.showMessage(this.props.app.commonConst, 'picMax'));/* 图片大小需小于10MB! */ | |
| 910 | + // } | |
| 911 | + }; | |
| 912 | + | |
| 913 | + handleTabChange = key => { | |
| 914 | + setTimeout(() => { | |
| 915 | + this.setState({ | |
| 916 | + currentTab: key, | |
| 917 | + }); | |
| 918 | + }, 0); | |
| 919 | + }; | |
| 920 | + | |
| 921 | + handleMenuClick = e => { | |
| 922 | + let { sId } = this.props.masterData; | |
| 923 | + const Type = e.key; | |
| 924 | + const { token } = this.props.app; | |
| 925 | + const { sType } = this.props.app.userinfo; | |
| 926 | + if (Type === "formSlave") { | |
| 927 | + /* 根据从表勾选数据 生成从表数据 */ | |
| 928 | + const { slaveSelectedRowKeys } = this.props; | |
| 929 | + if (commonUtils.isEmptyObject(slaveSelectedRowKeys)) { | |
| 930 | + message.warn("请选择数据"); | |
| 931 | + return; | |
| 932 | + } | |
| 933 | + sId = slaveSelectedRowKeys; | |
| 934 | + } | |
| 935 | + const downloadUrl = `${commonConfig.server_host}sqlfile/scriptSqlDownload?methodName=${Type}&sId=${sId}&token=${token}&sType=${sType}`; | |
| 936 | + window.open(downloadUrl); | |
| 937 | + this.props.onSaveState({ | |
| 938 | + downloadUrl, | |
| 939 | + }); | |
| 940 | + }; | |
| 941 | + handleSlaveInit = async name => { | |
| 942 | + const { app, masterData, [`${name}Data`]: slaveData } = this.props; | |
| 943 | + if (masterData.sName !== null && masterData.sName !== undefined) { | |
| 944 | + message.warn("该节点不能初始化!"); | |
| 945 | + return; | |
| 946 | + } | |
| 947 | + // const comfiled = service.service_path.filter(item => (item.route === | |
| 948 | + // app.currentPane.route)).length <= 0 ? {} : | |
| 949 | + // service.service_path.filter(item => (item.route === | |
| 950 | + // app.currentPane.route))[0]; | |
| 951 | + const comfiled = { | |
| 952 | + path: "gdsconfigform", | |
| 953 | + pathTwo: "Gdsconfigformmaster", | |
| 954 | + pathSlave: "Gdsconfigformslave", | |
| 955 | + pathCustom: "Customslave", | |
| 956 | + pathInit: "GdsconfigformslaveByMaster", | |
| 957 | + pathSlaveSelect: "gdsmodule", | |
| 958 | + pathSlaveSelectTwo: "SelectFormData", | |
| 959 | + }; | |
| 960 | + const url = `${commonConfig.server_host}${comfiled.path}/get${comfiled.pathInit}?sParentId=${masterData.sId}&sTbName=${masterData.sTbName}&sType=${masterData.sType}`; | |
| 961 | + const dataReturn = (await commonServices.getService(this.props.app.token, url)).data; | |
| 962 | + if (dataReturn.code === 1) { | |
| 963 | + /* 数据查询成功 */ | |
| 964 | + if (commonUtils.isNotEmptyArr(dataReturn.dataset.rows)) { | |
| 965 | + const tempData = dataReturn.dataset.rows; | |
| 966 | + const initData = []; | |
| 967 | + tempData.forEach(item => { | |
| 968 | + item.handleType = "add"; | |
| 969 | + initData.push(item); | |
| 970 | + }); | |
| 971 | + const newData = [...slaveData, ...initData]; | |
| 972 | + this.props.onSaveState({ slaveData: newData, enabled: true }); | |
| 973 | + message.success("初始化成功!"); | |
| 974 | + } else { | |
| 975 | + message.warn("当前表格无需初始化!"); | |
| 976 | + } | |
| 977 | + } else { | |
| 978 | + /* 失败 */ | |
| 979 | + this.props.getServiceError(dataReturn); | |
| 980 | + } | |
| 981 | + }; | |
| 982 | + handleCopyRow = (name, toname) => { | |
| 983 | + this.props.onCopyRow(name, toname); | |
| 984 | + }; | |
| 985 | + handleCopy2Custom = () => { | |
| 986 | + let toname = "slave2"; | |
| 987 | + for (let i = 0; i < 10; i++) { | |
| 988 | + const slaveConfigName = `slave${i}Config`; | |
| 989 | + const slaveConfig = this.props[slaveConfigName]; | |
| 990 | + if (slaveConfig && commonUtils.isNotEmptyObject(slaveConfig)) { | |
| 991 | + if (slaveConfig.sTbName === "gdsconfigformcustomslave") { | |
| 992 | + toname = `slave${i}`; | |
| 993 | + break; | |
| 994 | + } | |
| 995 | + } | |
| 996 | + } | |
| 997 | + this.props.onCopyRow("slave", toname); | |
| 998 | + }; | |
| 999 | + /** 添加行 */ | |
| 1000 | + handleAddRow = (name, index) => { | |
| 1001 | + this.props.onDataRowAdd(name, null, index); | |
| 1002 | + }; | |
| 1003 | + /** 删除行 */ | |
| 1004 | + handleDelRow = name => { | |
| 1005 | + const { [`${name}SelectedRowKeys`]: tableSelectedRowKeys } = this.props; | |
| 1006 | + if (this.props.onDataRowDel(name, false, tableSelectedRowKeys)) { | |
| 1007 | + message.success("删除成功!"); | |
| 1008 | + } | |
| 1009 | + }; | |
| 1010 | + | |
| 1011 | + /* 字段双击弹出 */ | |
| 1012 | + handleFieldDoubleClick = (sValue, showConfig, tbName) => { | |
| 1013 | + const { [`${tbName}SelectedRowKeys`]: tableSelectedRowKeys, [`${tbName}Data`]: tableData } = this.props; | |
| 1014 | + if (commonUtils.isNotEmptyObject(showConfig) && showConfig.sName === "sAssignField") { | |
| 1015 | + let tableDataRow = {}; | |
| 1016 | + if (commonUtils.isNotEmptyArr(tableData)) { | |
| 1017 | + const tableFilterData = tableData.filter(item => tableSelectedRowKeys.includes(item.sId)); | |
| 1018 | + if (commonUtils.isNotEmptyArr(tableFilterData)) { | |
| 1019 | + tableDataRow = tableFilterData[0]; | |
| 1020 | + } | |
| 1021 | + } | |
| 1022 | + const sAssignFieldColumn = [ | |
| 1023 | + { | |
| 1024 | + sId: commonUtils.createSid(), | |
| 1025 | + sParentId: tableDataRow.sId, | |
| 1026 | + dataIndex: "sNewName", | |
| 1027 | + title: "现字段", | |
| 1028 | + width: "220px", | |
| 1029 | + editable: true, | |
| 1030 | + bNotSort: true, | |
| 1031 | + }, | |
| 1032 | + { | |
| 1033 | + sId: commonUtils.createSid(), | |
| 1034 | + sParentId: tableDataRow.sId, | |
| 1035 | + dataIndex: "sOldName", | |
| 1036 | + title: "源字段", | |
| 1037 | + width: "220px", | |
| 1038 | + editable: true, | |
| 1039 | + bNotSort: true, | |
| 1040 | + }, | |
| 1041 | + ]; | |
| 1042 | + const sAssignFieldData = []; | |
| 1043 | + if (commonUtils.isNotEmptyObject(tableDataRow) && commonUtils.isNotEmptyObject(sValue)) { | |
| 1044 | + const selectedRowKeys = []; | |
| 1045 | + const sAssignFieldDataTemp = sValue.split(","); | |
| 1046 | + sAssignFieldDataTemp.forEach(index => { | |
| 1047 | + const aAssignFieldObj = {}; | |
| 1048 | + const splitData = index.split(":"); | |
| 1049 | + if (commonUtils.isNotEmptyArr(splitData)) { | |
| 1050 | + aAssignFieldObj.sId = commonUtils.createSid(); | |
| 1051 | + aAssignFieldObj.sNewName = splitData[0]; | |
| 1052 | + aAssignFieldObj.sOldName = splitData[1]; | |
| 1053 | + sAssignFieldData.push(aAssignFieldObj); | |
| 1054 | + } | |
| 1055 | + selectedRowKeys[0] = sAssignFieldData[0].sId; | |
| 1056 | + }); | |
| 1057 | + const { enabled } = this.props; | |
| 1058 | + this.props.onSaveState({ | |
| 1059 | + sAssignFieldColumn, | |
| 1060 | + visibleAssignmentField: true, | |
| 1061 | + sAssignFieldData, | |
| 1062 | + sAssignFieldName: tbName, | |
| 1063 | + sAssignFieldRowId: tableDataRow.sId /* 选中行的sId */, | |
| 1064 | + enabled, | |
| 1065 | + }); | |
| 1066 | + } else { | |
| 1067 | + this.props.onSaveState({ | |
| 1068 | + sAssignFieldColumn, | |
| 1069 | + visibleAssignmentField: true, | |
| 1070 | + sAssignFieldData: [], | |
| 1071 | + sAssignFieldName: tbName, | |
| 1072 | + sAssignFieldRowId: tableDataRow.sId /* 选中行的sId */, | |
| 1073 | + }); | |
| 1074 | + } | |
| 1075 | + } else if (showConfig?.sName === "sInstruct") { | |
| 1076 | + /* 指令集弹窗 */ | |
| 1077 | + // const sInstructJsonString = sValue; | |
| 1078 | + // this.props.onSaveState({ | |
| 1079 | + // visibleInstructField: true, | |
| 1080 | + // sInstructJsonString, | |
| 1081 | + // }); | |
| 1082 | + } | |
| 1083 | + }; | |
| 1084 | + /* 拿到赋值字段 */ | |
| 1085 | + handleGetsAssignField = (data, sFieldName) => { | |
| 1086 | + if (sFieldName === "sAssignField") { | |
| 1087 | + const { sAssignFieldRowId, sAssignFieldName } = this.props; /* 双击弹出赋值窗体的行ID */ | |
| 1088 | + const { [`${sAssignFieldName}Data`]: tableData } = this.props; | |
| 1089 | + if (commonUtils.isNotEmptyArr(tableData)) { | |
| 1090 | + const iIndex = tableData.findIndex(item => item.sId === sAssignFieldRowId); | |
| 1091 | + const newData = {}; | |
| 1092 | + /* 将数组变成赋值字符串 */ | |
| 1093 | + let sAssignFieldStr = ""; | |
| 1094 | + const len = data.length; | |
| 1095 | + data.forEach((item, index) => { | |
| 1096 | + sAssignFieldStr += `${item.sNewName}:${item.sOldName}`; | |
| 1097 | + if (index !== len - 1) { | |
| 1098 | + sAssignFieldStr += ","; | |
| 1099 | + } | |
| 1100 | + }); | |
| 1101 | + newData.sAssignField = sAssignFieldStr; | |
| 1102 | + newData.handleType = commonUtils.isEmpty(tableData[iIndex].handleType) ? "update" : tableData[iIndex].handleType; | |
| 1103 | + tableData[iIndex] = { ...tableData[iIndex], ...newData }; | |
| 1104 | + this.props.onSaveState({ [`${sAssignFieldName}Data`]: tableData }); | |
| 1105 | + } | |
| 1106 | + } | |
| 1107 | + }; | |
| 1108 | + | |
| 1109 | + handleUploadPropsSales = () => { | |
| 1110 | + const { masterData, sModelsType } = this.props; | |
| 1111 | + if (commonUtils.isNotEmptyObject(masterData)) { | |
| 1112 | + const sCustomerId = commonUtils.isEmptyStr(masterData.sCustomerId) ? undefined : masterData.sCustomerId; | |
| 1113 | + let existCustomerId = false; | |
| 1114 | + if (sModelsType.includes("sales/") && commonUtils.isNotEmptyStr(sCustomerId)) { | |
| 1115 | + existCustomerId = true; | |
| 1116 | + } else if (!sModelsType.includes("sales/")) { | |
| 1117 | + existCustomerId = true; | |
| 1118 | + } | |
| 1119 | + return { | |
| 1120 | + disabled: !this.props.enabled || !existCustomerId /* 是否可用 */, | |
| 1121 | + style: { display: commonUtils.convertBooleanToDisplayBlock(true) } /* 是否显示 */, | |
| 1122 | + }; | |
| 1123 | + } | |
| 1124 | + }; | |
| 1125 | + | |
| 1126 | + handleUploadChangeFile = async info => { | |
| 1127 | + const { file } = info; | |
| 1128 | + const { formData = [] } = this.props; | |
| 1129 | + | |
| 1130 | + const templateData = formData.filter(item => item.sGrd === 'importTemplate'); | |
| 1131 | + const name = commonUtils.isNotEmptyArr(templateData) ? templateData[0].sTableAlias : 'slave' | |
| 1132 | + const { | |
| 1133 | + masterData, sModelsId, app, token, sModelsType, | |
| 1134 | + [`${name}Config`]: slaveConfig, [`${name}Data`]: slaveData | |
| 1135 | + } = this.props; | |
| 1136 | + if (file.response) { | |
| 1137 | + if (file.response.code === 1) { | |
| 1138 | + if (file.response.dataset.rows.length > 1) { | |
| 1139 | + const addState = {}; | |
| 1140 | + for (let i = 0; i < file.response.dataset.rows.length; i++) { | |
| 1141 | + const row = file.response.dataset.rows[i]; | |
| 1142 | + /* 数据查询成功 */ | |
| 1143 | + const errorInfo = row.nocanbeInsert; | |
| 1144 | + if (commonUtils.isNotEmptyObject(errorInfo)) { | |
| 1145 | + const importErrorData = errorInfo; | |
| 1146 | + this.props.onSaveState({ | |
| 1147 | + showImportErrorVisible: true, | |
| 1148 | + importData: importErrorData, | |
| 1149 | + }); | |
| 1150 | + return; | |
| 1151 | + } | |
| 1152 | + | |
| 1153 | + const tableName = ["", 0, 1, 2, 3, 4, 5, 6, 7, 8, 9] | |
| 1154 | + .filter(item => { | |
| 1155 | + const name = `slave${item}Config`; | |
| 1156 | + const config = this.props[name] || {}; | |
| 1157 | + return config.sGrd === row.sGrd || config.sTableName === row.sTableName; | |
| 1158 | + }) | |
| 1159 | + .map(item => `slave${item}`)[0]; | |
| 1160 | + | |
| 1161 | + if (!tableName) continue; | |
| 1162 | + | |
| 1163 | + const tableDelData = []; | |
| 1164 | + const { [`${tableName}Data`]: tableData = [], [`${tableName}Config`]: tableConfig } = this.props; | |
| 1165 | + /* 把之前存放的数据删除 */ | |
| 1166 | + addState[`${tableName}DelData`] = []; | |
| 1167 | + tableData.forEach(item => { | |
| 1168 | + if (item.handleType !== "add") { | |
| 1169 | + item.handleType = "del"; | |
| 1170 | + tableDelData.push(item); | |
| 1171 | + } | |
| 1172 | + }); | |
| 1173 | + | |
| 1174 | + const returnData = row.canbeInsert; | |
| 1175 | + let iCount = 0; | |
| 1176 | + let productIdDropDown; | |
| 1177 | + if (productIdDropDown === undefined && commonUtils.isNotEmptyArr(returnData)) { | |
| 1178 | + /* 无论导入多少条数据 都只调用1次接口,获取产品下拉数据集 */ | |
| 1179 | + const iIndex = tableConfig.gdsconfigformslave.findIndex(item => item.sName === "sProductName"); | |
| 1180 | + if (iIndex > -1) { | |
| 1181 | + const sqlDropDownData = await this.props.getSqlDropDownData( | |
| 1182 | + sModelsId, | |
| 1183 | + tableName, | |
| 1184 | + tableConfig.gdsconfigformslave[iIndex], | |
| 1185 | + returnData[0] | |
| 1186 | + ); | |
| 1187 | + productIdDropDown = sqlDropDownData.dropDownData; | |
| 1188 | + } | |
| 1189 | + } | |
| 1190 | + | |
| 1191 | + await returnData.forEach(async tableDataRow => { | |
| 1192 | + tableDataRow.handleType = "add"; | |
| 1193 | + tableDataRow.sId = commonUtils.createSid(); | |
| 1194 | + tableDataRow.sParentId = masterData.sId; | |
| 1195 | + tableDataRow.key = tableDataRow.sId; | |
| 1196 | + /* 若导入模板没有序号,则序号从1自增 */ | |
| 1197 | + if (commonUtils.isEmptyObject(tableDataRow.iOrder)) { | |
| 1198 | + iCount += 1; | |
| 1199 | + tableDataRow.iOrder = iCount; | |
| 1200 | + } | |
| 1201 | + for (const child of Object.keys(tableDataRow)) { | |
| 1202 | + const index = child.indexOf("_sRealValue_"); | |
| 1203 | + if (index > -1) { | |
| 1204 | + const property = child.substring(0, child.length - 12); | |
| 1205 | + tableDataRow[property] = tableDataRow[child]; | |
| 1206 | + } | |
| 1207 | + } | |
| 1208 | + if (productIdDropDown !== undefined) { | |
| 1209 | + const iProductIdIndex = productIdDropDown.findIndex( | |
| 1210 | + item => | |
| 1211 | + (item.sId === tableDataRow.sProductId || item.sNId === tableDataRow.sProductId) && | |
| 1212 | + item.sProductStyle === tableDataRow.sProductStyle | |
| 1213 | + ); | |
| 1214 | + if (iProductIdIndex === -1 && commonUtils.isNotEmptyObject(sModelsType) && sModelsType.includes("sales/salesOrder")) { | |
| 1215 | + /* 只有销售模块生成新产品 盘点 ,期间 不生成新的产品 */ | |
| 1216 | + tableDataRow.sProductId = tableDataRow.sProductName; | |
| 1217 | + tableDataRow.sProductInfo = JSON.stringify({ | |
| 1218 | + sProductId: tableDataRow.sProductName, | |
| 1219 | + sProductName: tableDataRow.sProductName, | |
| 1220 | + sProductStyle: tableDataRow.sProductStyle, | |
| 1221 | + sProductUnit: tableDataRow.sProductUnit, | |
| 1222 | + sProductNo: tableDataRow.sProductNo, | |
| 1223 | + sCustomerProductNo: tableDataRow.sCustomerProductNo, | |
| 1224 | + sProductClassifyId: tableDataRow.sProductClassifyId, | |
| 1225 | + sProductClassifyName: tableDataRow.sProductClassifyName, | |
| 1226 | + }); | |
| 1227 | + } | |
| 1228 | + } | |
| 1229 | + // if (!tableDataRow.dNProductPrice) { | |
| 1230 | + // tableDataRow.dNProductPrice = tableDataRow.dProductForeignPrice; | |
| 1231 | + // } | |
| 1232 | + // const models = sModelsType.includes('sales/') || sModelsType.includes('manufacture/') || sModelsType.includes('quotation/') || sModelsType.includes('productStock/') ? 'Product' : 'Materials'; | |
| 1233 | + // if (sModelsType.includes('purchase/') || sModelsType.includes('quotation/') || sModelsType.includes('manufacture/') || sModelsType.includes('materialsStock/') || sModelsType.includes('outside/')) { | |
| 1234 | + // tableDataRow = await this.props.onMaterialsChange(tableDataRow, sModelsId, masterData, {}, 'dAuxiliaryQty', app, token, models); | |
| 1235 | + // tableDataRow = commonBusiness.getCalculateAllMoney(app, models, 'dAuxiliaryQty', masterData, tableDataRow); | |
| 1236 | + // } else { | |
| 1237 | + // tableDataRow = commonBusiness.getCalculateAllMoney(app, models, 'dProductQty', masterData, tableDataRow); | |
| 1238 | + // } | |
| 1239 | + }); | |
| 1240 | + | |
| 1241 | + addState[`${tableName}Data`] = returnData; | |
| 1242 | + addState[`${tableName}DelData`] = tableDelData; | |
| 1243 | + } | |
| 1244 | + this.props.onSaveState(addState); | |
| 1245 | + } else { | |
| 1246 | + /* 数据查询成功 */ | |
| 1247 | + const errorInfo = file.response.dataset.rows[0].nocanbeInsert; | |
| 1248 | + if (commonUtils.isNotEmptyObject(errorInfo)) { | |
| 1249 | + // message.error(errorInfo[0].sReason); | |
| 1250 | + const importErrorData = errorInfo; | |
| 1251 | + this.props.onSaveState({ | |
| 1252 | + showImportErrorVisible: true, | |
| 1253 | + importData: importErrorData, | |
| 1254 | + }); | |
| 1255 | + return; | |
| 1256 | + } | |
| 1257 | + /* 把之前存放的数据删除 */ | |
| 1258 | + const slaveDelData = []; | |
| 1259 | + if (commonUtils.isNotEmptyArr(slaveData)) { | |
| 1260 | + slaveData.forEach(item => { | |
| 1261 | + if (commonUtils.isEmptyObject(item.handleType)) { | |
| 1262 | + item.handleType = "del"; | |
| 1263 | + slaveDelData.push(item); | |
| 1264 | + } | |
| 1265 | + }); | |
| 1266 | + } | |
| 1267 | + const returnData = file.response.dataset.rows[0].canbeInsert; | |
| 1268 | + let iCount = 0; | |
| 1269 | + let productIdDropDown; | |
| 1270 | + if (productIdDropDown === undefined && commonUtils.isNotEmptyArr(returnData)) { | |
| 1271 | + /* 无论导入多少条数据 都只调用1次接口,获取产品下拉数据集 */ | |
| 1272 | + const iIndex = slaveConfig.gdsconfigformslave.findIndex(item => item.sName === "sProductName"); | |
| 1273 | + if (iIndex > -1) { | |
| 1274 | + const sqlDropDownData = await this.props.getSqlDropDownData(sModelsId, "slave", slaveConfig.gdsconfigformslave[iIndex], returnData[0]); | |
| 1275 | + productIdDropDown = sqlDropDownData.dropDownData; | |
| 1276 | + } | |
| 1277 | + } | |
| 1278 | + await returnData.forEach(async tableDataRow => { | |
| 1279 | + tableDataRow.handleType = "add"; | |
| 1280 | + tableDataRow.sId = commonUtils.createSid(); | |
| 1281 | + tableDataRow.sParentId = masterData.sId; | |
| 1282 | + tableDataRow.key = tableDataRow.sId; | |
| 1283 | + /* 若导入模板没有序号,则序号从1自增 */ | |
| 1284 | + if (commonUtils.isEmptyObject(tableDataRow.iOrder)) { | |
| 1285 | + iCount += 1; | |
| 1286 | + tableDataRow.iOrder = iCount; | |
| 1287 | + } | |
| 1288 | + for (const child of Object.keys(tableDataRow)) { | |
| 1289 | + const index = child.indexOf("_sRealValue_"); | |
| 1290 | + if (index > -1) { | |
| 1291 | + const property = child.substring(0, child.length - 12); | |
| 1292 | + tableDataRow[property] = tableDataRow[child]; | |
| 1293 | + } | |
| 1294 | + } | |
| 1295 | + if (productIdDropDown !== undefined) { | |
| 1296 | + const iProductIdIndex = productIdDropDown.findIndex( | |
| 1297 | + item => | |
| 1298 | + (item.sId === tableDataRow.sProductId || item.sNId === tableDataRow.sProductId) && item.sProductStyle === tableDataRow.sProductStyle | |
| 1299 | + ); | |
| 1300 | + if (iProductIdIndex === -1 && commonUtils.isNotEmptyObject(sModelsType) && sModelsType.includes("sales/salesOrder")) { | |
| 1301 | + /* 只有销售模块生成新产品 盘点 ,期间 不生成新的产品 */ | |
| 1302 | + tableDataRow.sProductId = tableDataRow.sProductName; | |
| 1303 | + tableDataRow.sProductInfo = JSON.stringify({ | |
| 1304 | + sProductId: tableDataRow.sProductName, | |
| 1305 | + sProductName: tableDataRow.sProductName, | |
| 1306 | + sProductStyle: tableDataRow.sProductStyle, | |
| 1307 | + sProductUnit: tableDataRow.sProductUnit, | |
| 1308 | + sProductNo: tableDataRow.sProductNo, | |
| 1309 | + sCustomerProductNo: tableDataRow.sCustomerProductNo, | |
| 1310 | + sProductClassifyId: tableDataRow.sProductClassifyId, | |
| 1311 | + sProductClassifyName: tableDataRow.sProductClassifyName, | |
| 1312 | + }); | |
| 1313 | + } | |
| 1314 | + } | |
| 1315 | + if (!tableDataRow.dNProductPrice) { | |
| 1316 | + tableDataRow.dNProductPrice = tableDataRow.dProductForeignPrice; | |
| 1317 | + } | |
| 1318 | + const models = | |
| 1319 | + sModelsType.includes("sales/") || | |
| 1320 | + sModelsType.includes("manufacture/") || | |
| 1321 | + sModelsType.includes("quotation/") || | |
| 1322 | + sModelsType.includes("productStock/") | |
| 1323 | + ? "Product" | |
| 1324 | + : "Materials"; | |
| 1325 | + if ( | |
| 1326 | + sModelsType.includes("purchase/") || | |
| 1327 | + sModelsType.includes("quotation/") || | |
| 1328 | + sModelsType.includes("manufacture/") || | |
| 1329 | + sModelsType.includes("materialsStock/") || | |
| 1330 | + sModelsType.includes("outside/") | |
| 1331 | + ) { | |
| 1332 | + tableDataRow = await this.props.onMaterialsChange(tableDataRow, sModelsId, masterData, {}, "dAuxiliaryQty", app, token, models); | |
| 1333 | + tableDataRow = commonBusiness.getCalculateAllMoney(app, models, "dAuxiliaryQty", masterData, tableDataRow); | |
| 1334 | + } else { | |
| 1335 | + tableDataRow = commonBusiness.getCalculateAllMoney(app, models, "dProductQty", masterData, tableDataRow); | |
| 1336 | + } | |
| 1337 | + }); | |
| 1338 | + this.props.onSaveState({ slaveData: returnData, slaveDelData }); | |
| 1339 | + } | |
| 1340 | + } else { | |
| 1341 | + /* 失败s */ | |
| 1342 | + this.props.getServiceError(file.response); | |
| 1343 | + } | |
| 1344 | + } | |
| 1345 | + }; | |
| 1346 | + | |
| 1347 | + handleSetTabNumList = tabNumList => { | |
| 1348 | + this.tabNumList = tabNumList; | |
| 1349 | + }; | |
| 1350 | + | |
| 1351 | + /** 通用下载 */ | |
| 1352 | + handleDownload = (name, flag, tableSelectedRowKeys) => { | |
| 1353 | + const { [`${name}Data`]: tableData, sModelsId, app } = this.props; | |
| 1354 | + if (tableSelectedRowKeys === undefined || tableSelectedRowKeys.length !== 1) { | |
| 1355 | + message.warn(commonFunc.showMessage(app.commonConst, "selectedRowKeysNo")); /* 请先选择一条数据 */ | |
| 1356 | + return; | |
| 1357 | + } | |
| 1358 | + const dataSelect = tableData.filter(item => item.sId === tableSelectedRowKeys[0]); | |
| 1359 | + const { token } = this.props.app; | |
| 1360 | + const { sPicturePath } = dataSelect[0]; | |
| 1361 | + const urlPrint = `${commonConfig.file_host}file/download?sModelsId=${sModelsId}&token=${token}&savePathStr=${sPicturePath}`; | |
| 1362 | + window.open(urlPrint); | |
| 1363 | + }; | |
| 1364 | + handleJSONModalOk = value => { | |
| 1365 | + const { masterData } = this.props; | |
| 1366 | + const textAreaValue = value; // 获取 textarea 的值 | |
| 1367 | + const handleType = commonUtils.isEmpty(masterData.handleType) ? "update" : masterData.handleType; | |
| 1368 | + const newMasterData = { ...masterData, sInstruct: textAreaValue, handleType }; // 更新 masterData.sInstruct | |
| 1369 | + this.props.onSaveState({ masterData: newMasterData, visibleInstructField: false }); // 关闭弹窗 | |
| 1370 | + }; | |
| 1371 | + | |
| 1372 | + // ----------------------------数据修改回带wend ---------------------------- // | |
| 1373 | + | |
| 1374 | + render() { | |
| 1375 | + const { pageLoading, visible, checkConditions, checkPersonData, app } = this.props; | |
| 1376 | + const checkCondition = commonFunc.showMessage(app.commonConst, "checkCondition"); /* 审核条件 */ | |
| 1377 | + const checkSmemo = commonFunc.showMessage(app.commonConst, "checkSmemo"); /* 备注 */ | |
| 1378 | + const columns = [ | |
| 1379 | + { | |
| 1380 | + title: checkCondition, | |
| 1381 | + dataIndex: "condition", | |
| 1382 | + key: "condition", | |
| 1383 | + }, | |
| 1384 | + { | |
| 1385 | + title: checkSmemo, | |
| 1386 | + dataIndex: "sMemo", | |
| 1387 | + key: "sMemo", | |
| 1388 | + }, | |
| 1389 | + ]; | |
| 1390 | + const btnSure = commonFunc.showMessage(app.commonConst, "btnSure"); /* 确认 */ | |
| 1391 | + const check = commonFunc.showMessage(app.commonConst, "check"); /* 审核 */ | |
| 1392 | + const BtnClose = commonFunc.showMessage(app.commonConst, "BtnClose"); /* 关闭 */ | |
| 1393 | + const checkPerson = commonFunc.showMessage(app.commonConst, "checkPerson"); /* 审核人 */ | |
| 1394 | + return ( | |
| 1395 | + <div> | |
| 1396 | + <Spin spinning={pageLoading}> | |
| 1397 | + <div> | |
| 1398 | + <BillComponent | |
| 1399 | + {...this.props} | |
| 1400 | + {...this.state} | |
| 1401 | + onUploadChangeFile={this.handleUploadChangeFile} /* xls文件导入 */ | |
| 1402 | + onTabChange={this.handleTabChange} | |
| 1403 | + onUploadChange={this.handleUploadChange} | |
| 1404 | + getMenuStatus={this.getMenuStatus} | |
| 1405 | + onBeforeUpload={this.handleBeforeUpload} | |
| 1406 | + onUploadPropsSales={this.handleUploadPropsSales} | |
| 1407 | + onDataRowModal={this.handleTableModal} | |
| 1408 | + onDataRowDel={this.handleSlaveTableDel} | |
| 1409 | + handleMenuClick={this.handleMenuClick} | |
| 1410 | + handleSlaveInit={this.handleSlaveInit} | |
| 1411 | + handleCopy2Custom={this.handleCopy2Custom} | |
| 1412 | + handleCopyRow={this.handleCopyRow} | |
| 1413 | + handleAddRow={this.handleAddRow} | |
| 1414 | + handleDelRow={this.handleDelRow} | |
| 1415 | + getSlaveInfos={this.getSlaveInfos} | |
| 1416 | + onGetsAssignField={this.handleGetsAssignField} | |
| 1417 | + handleFieldDoubleClick={this.handleFieldDoubleClick} | |
| 1418 | + onGetTabNumList={() => this.tabNumList} | |
| 1419 | + onSetTabNumList={this.handleSetTabNumList} | |
| 1420 | + onDataRowDownload={this.handleDownload} | |
| 1421 | + onDelRow={this.handleTableDel} | |
| 1422 | + onJsonModalOk={this.handleJSONModalOk} | |
| 1423 | + /> | |
| 1424 | + {visible ? ( | |
| 1425 | + <AntdDraggableModal | |
| 1426 | + title={check} | |
| 1427 | + visible={visible} | |
| 1428 | + onCancel={this.handleCancel} | |
| 1429 | + footer={[ | |
| 1430 | + <Button key="back" onClick={this.handleCancel}> | |
| 1431 | + {BtnClose} | |
| 1432 | + </Button>, | |
| 1433 | + <Button key="submit" type="primary" onClick={this.handleOk.bind(this, 1, 1, true)}> | |
| 1434 | + {btnSure} | |
| 1435 | + </Button>, | |
| 1436 | + ]} | |
| 1437 | + > | |
| 1438 | + <Table columns={columns} dataSource={checkConditions} bordered pagination={false} className={styles.checkTable} /> | |
| 1439 | + <div style={{ float: "left", width: "15%" }}>{checkPerson}</div> | |
| 1440 | + <div style={{ float: "left", width: "60%" }}> | |
| 1441 | + <Checkbox.Group style={{ width: "100%" }} onChange={this.onChange}> | |
| 1442 | + <Row> | |
| 1443 | + {commonUtils.isNotEmptyObject(checkPersonData) | |
| 1444 | + ? checkPersonData.map(item => { | |
| 1445 | + return ( | |
| 1446 | + <Col span={8}> | |
| 1447 | + <Checkbox value={item.sUserId}>{item.sUserName}</Checkbox> | |
| 1448 | + </Col> | |
| 1449 | + ); | |
| 1450 | + }) | |
| 1451 | + : ""} | |
| 1452 | + </Row> | |
| 1453 | + </Checkbox.Group> | |
| 1454 | + </div> | |
| 1455 | + </AntdDraggableModal> | |
| 1456 | + ) : ( | |
| 1457 | + "" | |
| 1458 | + )} | |
| 1459 | + </div> | |
| 1460 | + </Spin> | |
| 1461 | + </div> | |
| 1462 | + ); | |
| 1463 | + } | |
| 1464 | +} | |
| 1465 | + | |
| 1466 | +const BillComponent = Form.create({ | |
| 1467 | + mapPropsToFields(props) { | |
| 1468 | + const { masterData, masterConfig } = props; | |
| 1469 | + const obj = commonFunc.mapPropsToFields(masterData, Form, masterConfig); | |
| 1470 | + return obj; | |
| 1471 | + }, | |
| 1472 | +})(props => { | |
| 1473 | + const { | |
| 1474 | + form, | |
| 1475 | + onReturnForm, | |
| 1476 | + AutoTableHeight, | |
| 1477 | + onlySlave, | |
| 1478 | + onlySlave0, | |
| 1479 | + onlySlave1, | |
| 1480 | + onlyslave2, | |
| 1481 | + onlyslave3, | |
| 1482 | + onlyslave4, | |
| 1483 | + onlyslave5, | |
| 1484 | + onlyslave6, | |
| 1485 | + onlyslave7, | |
| 1486 | + onlyslave8, | |
| 1487 | + onlyslave9, | |
| 1488 | + onlyslave10, | |
| 1489 | + slaveData, | |
| 1490 | + slave0Data, | |
| 1491 | + slave1Data, | |
| 1492 | + slave2Data, | |
| 1493 | + slave3Data, | |
| 1494 | + slave4Data, | |
| 1495 | + slave5Data, | |
| 1496 | + slave6Data, | |
| 1497 | + slave7Data, | |
| 1498 | + slave8Data, | |
| 1499 | + slave9Data, | |
| 1500 | + slave10Data, | |
| 1501 | + slaveConfig, | |
| 1502 | + slave0Config, | |
| 1503 | + slave1Config, | |
| 1504 | + slave2Config, | |
| 1505 | + slave3Config, | |
| 1506 | + slave4Config, | |
| 1507 | + slave5Config, | |
| 1508 | + slave6Config, | |
| 1509 | + slave7Config, | |
| 1510 | + slave8Config, | |
| 1511 | + slave9Config, | |
| 1512 | + slave10Config, | |
| 1513 | + slaveSelectedRowKeys, | |
| 1514 | + slave0SelectedRowKeys, | |
| 1515 | + slave1SelectedRowKeys, | |
| 1516 | + slave2SelectedRowKeys, | |
| 1517 | + slave3SelectedRowKeys, | |
| 1518 | + slave4SelectedRowKeys, | |
| 1519 | + app, | |
| 1520 | + slavePagination, | |
| 1521 | + slave0Pagination, | |
| 1522 | + slave1Pagination, | |
| 1523 | + slave2Pagination, | |
| 1524 | + slave3Pagination, | |
| 1525 | + slave4Pagination, | |
| 1526 | + slave5Pagination, | |
| 1527 | + slave6Pagination, | |
| 1528 | + slave7Pagination, | |
| 1529 | + slave8Pagination, | |
| 1530 | + slave9Pagination, | |
| 1531 | + slave10Pagination, | |
| 1532 | + slavePageSize, | |
| 1533 | + slave0PageSize, | |
| 1534 | + slave1PageSize, | |
| 1535 | + slave2PageSize, | |
| 1536 | + slave3PageSize, | |
| 1537 | + slave4PageSize, | |
| 1538 | + slave5PageSize, | |
| 1539 | + slave6PageSize, | |
| 1540 | + slave7PageSize, | |
| 1541 | + slave8PageSize, | |
| 1542 | + slave9PageSize, | |
| 1543 | + slave10PageSize, | |
| 1544 | + sModelsType, | |
| 1545 | + sModelsId, | |
| 1546 | + bDelegate, | |
| 1547 | + sInstructJsonString = "", | |
| 1548 | + } = props; | |
| 1549 | + const masterConfig = props.onMergeMasterConfig(); | |
| 1550 | + const masterConfigOld = { ...masterConfig }; | |
| 1551 | + /* 回带表单 */ | |
| 1552 | + onReturnForm(form); | |
| 1553 | + const autoHeight = `calc( ${AutoTableHeight} - 96px)`; | |
| 1554 | + const isSmall = false; | |
| 1555 | + let pageSize = commonConfig.pageSize; | |
| 1556 | + if (props.slaveConfig && props.slaveConfig.iPageSize) { | |
| 1557 | + pageSize = props.slaveConfig.iPageSize; | |
| 1558 | + } | |
| 1559 | + | |
| 1560 | + const { currentPane } = app; | |
| 1561 | + let bFlow = currentPane?.bFlow; /* 是否需要展示审批流程信息 */ | |
| 1562 | + if (bDelegate) { | |
| 1563 | + bFlow = false; | |
| 1564 | + } | |
| 1565 | + | |
| 1566 | + const bPagination = commonUtils.isNotEmptyObject(slaveConfig) ? slaveConfig.bPagination : false; | |
| 1567 | + const bPagination0 = commonUtils.isNotEmptyObject(slave0Config) ? slave0Config.bPagination : false; | |
| 1568 | + const bPagination1 = commonUtils.isNotEmptyObject(slave1Config) ? slave1Config.bPagination : false; | |
| 1569 | + const bPagination2 = commonUtils.isNotEmptyObject(slave2Config) ? slave2Config.bPagination : false; | |
| 1570 | + const bPagination3 = commonUtils.isNotEmptyObject(slave3Config) ? slave3Config.bPagination : false; | |
| 1571 | + const bPagination4 = commonUtils.isNotEmptyObject(slave4Config) ? slave4Config.bPagination : false; | |
| 1572 | + const bPagination5 = commonUtils.isNotEmptyObject(slave5Config) ? slave5Config.bPagination : false; | |
| 1573 | + const bPagination6 = commonUtils.isNotEmptyObject(slave6Config) ? slave6Config.bPagination : false; | |
| 1574 | + const bPagination7 = commonUtils.isNotEmptyObject(slave7Config) ? slave7Config.bPagination : false; | |
| 1575 | + const bPagination8 = commonUtils.isNotEmptyObject(slave8Config) ? slave8Config.bPagination : false; | |
| 1576 | + const bPagination9 = commonUtils.isNotEmptyObject(slave9Config) ? slave9Config.bPagination : false; | |
| 1577 | + const bPagination10 = commonUtils.isNotEmptyObject(slave10Config) ? slave10Config.bPagination : false; | |
| 1578 | + | |
| 1579 | + const pagination = !bPagination | |
| 1580 | + ? false | |
| 1581 | + : { | |
| 1582 | + pageSize, | |
| 1583 | + total: commonUtils.isEmptyArr(slaveData) ? 0 : slaveData.length, | |
| 1584 | + current: commonUtils.isEmptyObject(slavePagination) ? 1 : slavePagination.current, | |
| 1585 | + ...slavePagination, | |
| 1586 | + // showQuickJumper: true, | |
| 1587 | + hideOnSinglePage: false, | |
| 1588 | + size: isSmall ? "small" : "large", | |
| 1589 | + pageSizeOptions: commonConfig.pageSizeOptions, | |
| 1590 | + showSizeChanger: !isSmall, | |
| 1591 | + showQuickJumper: !isSmall, | |
| 1592 | + }; | |
| 1593 | + const pagination0 = !bPagination0 | |
| 1594 | + ? false | |
| 1595 | + : { | |
| 1596 | + pageSize: commonUtils.isNotEmptyNumber(slave0PageSize) && slave0PageSize !== 0 ? slave0PageSize : commonConfig.pageSize, | |
| 1597 | + total: commonUtils.isEmptyArr(slave0Data) ? 0 : slave0Data.length, | |
| 1598 | + current: commonUtils.isEmptyObject(slave0Pagination) ? 1 : slave0Pagination.current, | |
| 1599 | + ...slave0Pagination, | |
| 1600 | + // showQuickJumper: true, | |
| 1601 | + hideOnSinglePage: false, | |
| 1602 | + size: isSmall ? "small" : "large", | |
| 1603 | + pageSizeOptions: commonConfig.pageSizeOptions, | |
| 1604 | + showSizeChanger: !isSmall, | |
| 1605 | + showQuickJumper: !isSmall, | |
| 1606 | + }; | |
| 1607 | + const pagination1 = !bPagination1 | |
| 1608 | + ? false | |
| 1609 | + : { | |
| 1610 | + pageSize: commonUtils.isNotEmptyNumber(slave1PageSize) && slave1PageSize !== 0 ? slave1PageSize : commonConfig.pageSize, | |
| 1611 | + total: commonUtils.isEmptyArr(slave1Data) ? 0 : slave1Data.length, | |
| 1612 | + current: commonUtils.isEmptyObject(slave1Pagination) ? 1 : slave1Pagination.current, | |
| 1613 | + ...slave1Pagination, | |
| 1614 | + // showQuickJumper: true, | |
| 1615 | + hideOnSinglePage: true, | |
| 1616 | + size: isSmall ? "small" : "large", | |
| 1617 | + pageSizeOptions: commonConfig.pageSizeOptions, | |
| 1618 | + showSizeChanger: !isSmall, | |
| 1619 | + showQuickJumper: !isSmall, | |
| 1620 | + }; | |
| 1621 | + const pagination2 = !bPagination2 | |
| 1622 | + ? false | |
| 1623 | + : { | |
| 1624 | + pageSize: commonUtils.isNotEmptyNumber(slave2PageSize) && slave2PageSize !== 0 ? slave2PageSize : commonConfig.pageSize, | |
| 1625 | + total: commonUtils.isEmptyArr(slave2Data) ? 0 : slave2Data.length, | |
| 1626 | + current: commonUtils.isEmptyObject(slave2Pagination) ? 1 : slave2Pagination.current, | |
| 1627 | + ...slave2Pagination, | |
| 1628 | + // showQuickJumper: true, | |
| 1629 | + hideOnSinglePage: true, | |
| 1630 | + size: isSmall ? "small" : "large", | |
| 1631 | + pageSizeOptions: commonConfig.pageSizeOptions, | |
| 1632 | + showSizeChanger: !isSmall, | |
| 1633 | + showQuickJumper: !isSmall, | |
| 1634 | + }; | |
| 1635 | + const pagination3 = !bPagination3 | |
| 1636 | + ? false | |
| 1637 | + : { | |
| 1638 | + pageSize: commonUtils.isNotEmptyNumber(slave3PageSize) && slave3PageSize !== 0 ? slave3PageSize : commonConfig.pageSize, | |
| 1639 | + total: commonUtils.isEmptyArr(slave3Data) ? 0 : slave3Data.length, | |
| 1640 | + current: commonUtils.isEmptyObject(slave3Pagination) ? 1 : slave3Pagination.current, | |
| 1641 | + ...slave3Pagination, | |
| 1642 | + // showQuickJumper: true, | |
| 1643 | + hideOnSinglePage: true, | |
| 1644 | + size: isSmall ? "small" : "large", | |
| 1645 | + pageSizeOptions: commonConfig.pageSizeOptions, | |
| 1646 | + showSizeChanger: !isSmall, | |
| 1647 | + showQuickJumper: !isSmall, | |
| 1648 | + }; | |
| 1649 | + const pagination4 = !bPagination4 | |
| 1650 | + ? false | |
| 1651 | + : { | |
| 1652 | + pageSize: commonUtils.isNotEmptyNumber(slave4PageSize) && slave4PageSize !== 0 ? slave4PageSize : commonConfig.pageSize, | |
| 1653 | + total: commonUtils.isEmptyArr(slave4Data) ? 0 : slave4Data.length, | |
| 1654 | + current: commonUtils.isEmptyObject(slave4Pagination) ? 1 : slave4Pagination.current, | |
| 1655 | + ...slave4Pagination, | |
| 1656 | + // showQuickJumper: true, | |
| 1657 | + hideOnSinglePage: true, | |
| 1658 | + size: isSmall ? "small" : "large", | |
| 1659 | + pageSizeOptions: commonConfig.pageSizeOptions, | |
| 1660 | + showSizeChanger: !isSmall, | |
| 1661 | + showQuickJumper: !isSmall, | |
| 1662 | + }; | |
| 1663 | + | |
| 1664 | + const pagination5 = !bPagination5 | |
| 1665 | + ? false | |
| 1666 | + : { | |
| 1667 | + pageSize: commonUtils.isNotEmptyNumber(slave5PageSize) && slave5PageSize !== 0 ? slave5PageSize : commonConfig.pageSize, | |
| 1668 | + total: commonUtils.isEmptyArr(slave5Data) ? 0 : slave5Data.length, | |
| 1669 | + current: commonUtils.isEmptyObject(slave5Pagination) ? 1 : slave5Pagination.current, | |
| 1670 | + ...slave5Pagination, | |
| 1671 | + // showQuickJumper: true, | |
| 1672 | + hideOnSinglePage: true, | |
| 1673 | + size: isSmall ? "small" : "large", | |
| 1674 | + pageSizeOptions: commonConfig.pageSizeOptions, | |
| 1675 | + showSizeChanger: !isSmall, | |
| 1676 | + showQuickJumper: !isSmall, | |
| 1677 | + }; | |
| 1678 | + const pagination6 = !bPagination6 | |
| 1679 | + ? false | |
| 1680 | + : { | |
| 1681 | + pageSize: commonUtils.isNotEmptyNumber(slave6PageSize) && slave6PageSize !== 0 ? slave6PageSize : commonConfig.pageSize, | |
| 1682 | + total: commonUtils.isEmptyArr(slave6Data) ? 0 : slave6Data.length, | |
| 1683 | + current: commonUtils.isEmptyObject(slave6Pagination) ? 1 : slave6Pagination.current, | |
| 1684 | + ...slave6Pagination, | |
| 1685 | + // showQuickJumper: true, | |
| 1686 | + hideOnSinglePage: true, | |
| 1687 | + size: isSmall ? "small" : "large", | |
| 1688 | + pageSizeOptions: commonConfig.pageSizeOptions, | |
| 1689 | + showSizeChanger: !isSmall, | |
| 1690 | + showQuickJumper: !isSmall, | |
| 1691 | + }; | |
| 1692 | + const pagination7 = !bPagination7 | |
| 1693 | + ? false | |
| 1694 | + : { | |
| 1695 | + pageSize: commonUtils.isNotEmptyNumber(slave7PageSize) && slave7PageSize !== 0 ? slave7PageSize : commonConfig.pageSize, | |
| 1696 | + total: commonUtils.isEmptyArr(slave7Data) ? 0 : slave7Data.length, | |
| 1697 | + current: commonUtils.isEmptyObject(slave7Pagination) ? 1 : slave7Pagination.current, | |
| 1698 | + ...slave7Pagination, | |
| 1699 | + // showQuickJumper: true, | |
| 1700 | + hideOnSinglePage: true, | |
| 1701 | + size: isSmall ? "small" : "large", | |
| 1702 | + pageSizeOptions: commonConfig.pageSizeOptions, | |
| 1703 | + showSizeChanger: !isSmall, | |
| 1704 | + showQuickJumper: !isSmall, | |
| 1705 | + }; | |
| 1706 | + const pagination8 = !bPagination8 | |
| 1707 | + ? false | |
| 1708 | + : { | |
| 1709 | + pageSize: commonUtils.isNotEmptyNumber(slave8PageSize) && slave8PageSize !== 0 ? slave8PageSize : commonConfig.pageSize, | |
| 1710 | + total: commonUtils.isEmptyArr(slave8Data) ? 0 : slave8Data.length, | |
| 1711 | + current: commonUtils.isEmptyObject(slave8Pagination) ? 1 : slave8Pagination.current, | |
| 1712 | + ...slave8Pagination, | |
| 1713 | + // showQuickJumper: true, | |
| 1714 | + hideOnSinglePage: true, | |
| 1715 | + size: isSmall ? "small" : "large", | |
| 1716 | + pageSizeOptions: commonConfig.pageSizeOptions, | |
| 1717 | + showSizeChanger: !isSmall, | |
| 1718 | + showQuickJumper: !isSmall, | |
| 1719 | + }; | |
| 1720 | + const pagination9 = !bPagination9 | |
| 1721 | + ? false | |
| 1722 | + : { | |
| 1723 | + pageSize: commonUtils.isNotEmptyNumber(slave9PageSize) && slave9PageSize !== 0 ? slave9PageSize : commonConfig.pageSize, | |
| 1724 | + total: commonUtils.isEmptyArr(slave9Data) ? 0 : slave9Data.length, | |
| 1725 | + current: commonUtils.isEmptyObject(slave9Pagination) ? 1 : slave9Pagination.current, | |
| 1726 | + ...slave9Pagination, | |
| 1727 | + // showQuickJumper: true, | |
| 1728 | + hideOnSinglePage: true, | |
| 1729 | + size: isSmall ? "small" : "large", | |
| 1730 | + pageSizeOptions: commonConfig.pageSizeOptions, | |
| 1731 | + showSizeChanger: !isSmall, | |
| 1732 | + showQuickJumper: !isSmall, | |
| 1733 | + }; | |
| 1734 | + const pagination10 = !bPagination10 | |
| 1735 | + ? false | |
| 1736 | + : { | |
| 1737 | + pageSize: commonUtils.isNotEmptyNumber(slave10PageSize) && slave10PageSize !== 0 ? slave10PageSize : commonConfig.pageSize, | |
| 1738 | + total: commonUtils.isEmptyArr(slave10Data) ? 0 : slave10Data.length, | |
| 1739 | + current: commonUtils.isEmptyObject(slave10Pagination) ? 1 : slave10Pagination.current, | |
| 1740 | + ...slave10Pagination, | |
| 1741 | + // showQuickJumper: true, | |
| 1742 | + hideOnSinglePage: true, | |
| 1743 | + size: isSmall ? "small" : "large", | |
| 1744 | + pageSizeOptions: commonConfig.pageSizeOptions, | |
| 1745 | + showSizeChanger: !isSmall, | |
| 1746 | + showQuickJumper: !isSmall, | |
| 1747 | + }; | |
| 1748 | + | |
| 1749 | + /* 表1-commonView显示区域 */ | |
| 1750 | + const ableConfigs = commonUtils.isNotEmptyObject(slaveConfig) | |
| 1751 | + ? slaveConfig.gdsconfigformslave.filter(item => item.sName !== "" && item.bControl && item.sControlName.indexOf("Btn") === -1) | |
| 1752 | + : []; | |
| 1753 | + /* 选中行 */ | |
| 1754 | + let showAll = true; /* 只显示表格 */ | |
| 1755 | + let bShowLeft = true; /* 表格显示在左侧 */ | |
| 1756 | + let iColValueView = 12; | |
| 1757 | + let iColValueTable = 12; | |
| 1758 | + let slaveRow = {}; | |
| 1759 | + if (commonUtils.isNotEmptyArr(slaveSelectedRowKeys)) { | |
| 1760 | + const iIndex = slaveData.findIndex(item => slaveSelectedRowKeys.includes(item.sId)); | |
| 1761 | + if (iIndex > -1) { | |
| 1762 | + slaveRow = slaveData[iIndex]; | |
| 1763 | + } else { | |
| 1764 | + slaveRow = slaveData[0]; | |
| 1765 | + } | |
| 1766 | + } else if (commonUtils.isNotEmptyArr(slaveData)) { | |
| 1767 | + slaveRow = slaveData[0]; | |
| 1768 | + } | |
| 1769 | + if (commonUtils.isNotEmptyObject(slaveConfig) && commonUtils.isNotEmptyArr(slaveConfig.gdsconfigformslave)) { | |
| 1770 | + const iIndexArea = slaveConfig.gdsconfigformslave.findIndex(item => item.sControlName !== "" && item.sControlName.includes("bShow")); | |
| 1771 | + if (iIndexArea > -1) { | |
| 1772 | + showAll = false; | |
| 1773 | + } | |
| 1774 | + if (commonUtils.isNotEmptyObject(slaveConfig) && commonUtils.isNotEmptyArr(slaveConfig.gdsconfigformslave)) { | |
| 1775 | + const iShowLeft = slaveConfig.gdsconfigformslave.findIndex(item => item.sControlName === "bShowLeft" && item.bVisible); | |
| 1776 | + const iShowRight = slaveConfig.gdsconfigformslave.findIndex(item => item.sControlName === "bShowRight" && item.bVisible); | |
| 1777 | + if (iShowLeft > -1) { | |
| 1778 | + bShowLeft = true; | |
| 1779 | + iColValueTable = slaveConfig.gdsconfigformslave[iShowLeft].iColValue; | |
| 1780 | + } else if (iShowRight > -1) { | |
| 1781 | + bShowLeft = false; | |
| 1782 | + iColValueTable = slaveConfig.gdsconfigformslave[iShowRight].iColValue; | |
| 1783 | + } | |
| 1784 | + } | |
| 1785 | + } | |
| 1786 | + iColValueView = commonUtils.isNotEmptyNumber(iColValueTable) ? 24 - iColValueTable : 12; | |
| 1787 | + const iShowOrder = bShowLeft ? 1 : 100; | |
| 1788 | + | |
| 1789 | + /* 表2-commonView显示区域 */ | |
| 1790 | + const ableConfigs0 = commonUtils.isNotEmptyObject(slave0Config) | |
| 1791 | + ? slave0Config.gdsconfigformslave.filter(item => item.sName !== "" && item.bControl && item.sControlName.indexOf("Btn") === -1) | |
| 1792 | + : []; | |
| 1793 | + let showAll0 = true; /* 只显示表格 */ | |
| 1794 | + let bShowLeft0 = true; /* 表格显示在左侧 */ | |
| 1795 | + let iColValueView0 = 12; | |
| 1796 | + let iColValueTable0 = 12; | |
| 1797 | + let slave0Row = {}; | |
| 1798 | + if (commonUtils.isNotEmptyArr(slave0SelectedRowKeys)) { | |
| 1799 | + const iIndex = slave0Data.findIndex(item => slave0SelectedRowKeys.includes(item.sId)); | |
| 1800 | + if (iIndex > -1) { | |
| 1801 | + slave0Row = slave0Data[iIndex]; | |
| 1802 | + } else { | |
| 1803 | + slave0Row = slave0Data[0]; | |
| 1804 | + } | |
| 1805 | + } else if (commonUtils.isNotEmptyArr(slave0Data)) { | |
| 1806 | + slave0Row = slave0Data[0]; | |
| 1807 | + } | |
| 1808 | + if (commonUtils.isNotEmptyObject(slave0Config) && commonUtils.isNotEmptyArr(slave0Config.gdsconfigformslave)) { | |
| 1809 | + const iIndexArea = slave0Config.gdsconfigformslave.findIndex(item => item.sControlName !== "" && item.sControlName.includes("bShow")); | |
| 1810 | + if (iIndexArea > -1) { | |
| 1811 | + showAll0 = false; | |
| 1812 | + } | |
| 1813 | + if (commonUtils.isNotEmptyObject(slave0Config) && commonUtils.isNotEmptyArr(slave0Config.gdsconfigformslave)) { | |
| 1814 | + const iShowLeft0 = slave0Config.gdsconfigformslave.findIndex(item => item.sControlName === "bShowLeft" && item.bVisible); | |
| 1815 | + const iShowRight0 = slave0Config.gdsconfigformslave.findIndex(item => item.sControlName === "bShowRight" && item.bVisible); | |
| 1816 | + if (iShowLeft0 > -1) { | |
| 1817 | + bShowLeft0 = true; | |
| 1818 | + iColValueTable0 = slave0Config.gdsconfigformslave[iShowLeft0].iColValue; | |
| 1819 | + } else if (iShowRight0 > -1) { | |
| 1820 | + bShowLeft0 = false; | |
| 1821 | + iColValueTable0 = slave0Config.gdsconfigformslave[iShowRight0].iColValue; | |
| 1822 | + } | |
| 1823 | + } | |
| 1824 | + } | |
| 1825 | + iColValueView0 = commonUtils.isNotEmptyNumber(iColValueTable0) ? 24 - iColValueTable0 : 12; | |
| 1826 | + const iShowOrder0 = bShowLeft0 ? 1 : 100; | |
| 1827 | + | |
| 1828 | + /* 表3-commonView显示区域 */ | |
| 1829 | + const ableConfigs1 = commonUtils.isNotEmptyObject(slave1Config) | |
| 1830 | + ? slave1Config.gdsconfigformslave.filter(item => item.sName !== "" && item.bControl && item.sControlName.indexOf("Btn") === -1) | |
| 1831 | + : []; | |
| 1832 | + let showAll1 = true; /* 只显示表格 */ | |
| 1833 | + let bShowLeft1 = true; /* 表格显示在左侧 */ | |
| 1834 | + let iColValueView1 = 12; | |
| 1835 | + let iColValueTable1 = 12; | |
| 1836 | + let slave1Row = {}; | |
| 1837 | + if (commonUtils.isNotEmptyArr(slave1SelectedRowKeys)) { | |
| 1838 | + const iIndex = slave1Data.findIndex(item => slave1SelectedRowKeys.includes(item.sId)); | |
| 1839 | + if (iIndex > -1) { | |
| 1840 | + slave1Row = slave1Data[iIndex]; | |
| 1841 | + } else { | |
| 1842 | + slave1Row = slave1Data[0]; | |
| 1843 | + } | |
| 1844 | + } else if (commonUtils.isNotEmptyArr(slave1Data)) { | |
| 1845 | + slave1Row = slave1Data[0]; | |
| 1846 | + } | |
| 1847 | + if (commonUtils.isNotEmptyObject(slave1Config) && commonUtils.isNotEmptyArr(slave1Config.gdsconfigformslave)) { | |
| 1848 | + const iIndexArea = slave1Config.gdsconfigformslave.findIndex(item => item.sControlName !== "" && item.sControlName.includes("bShow")); | |
| 1849 | + if (iIndexArea > -1) { | |
| 1850 | + showAll1 = false; | |
| 1851 | + } | |
| 1852 | + if (commonUtils.isNotEmptyObject(slave1Config) && commonUtils.isNotEmptyArr(slave1Config.gdsconfigformslave)) { | |
| 1853 | + const iShowLeft1 = slave1Config.gdsconfigformslave.findIndex(item => item.sControlName === "bShowLeft" && item.bVisible); | |
| 1854 | + const iShowRight1 = slave1Config.gdsconfigformslave.findIndex(item => item.sControlName === "bShowRight" && item.bVisible); | |
| 1855 | + if (iShowLeft1 > -1) { | |
| 1856 | + bShowLeft1 = true; | |
| 1857 | + iColValueTable1 = slave1Config.gdsconfigformslave[iShowLeft1].iColValue; | |
| 1858 | + } else if (iShowRight1 > -1) { | |
| 1859 | + bShowLeft1 = false; | |
| 1860 | + iColValueTable1 = slave1Config.gdsconfigformslave[iShowRight1].iColValue; | |
| 1861 | + } | |
| 1862 | + } | |
| 1863 | + } | |
| 1864 | + iColValueView1 = commonUtils.isNotEmptyNumber(iColValueTable1) ? 24 - iColValueTable1 : 12; | |
| 1865 | + const iShowOrder1 = bShowLeft1 ? 1 : 100; | |
| 1866 | + | |
| 1867 | + /* 表4-commonView显示区域 */ | |
| 1868 | + const ableConfigs2 = commonUtils.isNotEmptyObject(slave2Config) | |
| 1869 | + ? slave2Config.gdsconfigformslave.filter(item => item.sName !== "" && item.bControl && item.sControlName.indexOf("Btn") === -1) | |
| 1870 | + : []; | |
| 1871 | + let showAll2 = true; /* 只显示表格 */ | |
| 1872 | + let bShowLeft2 = true; /* 表格显示在左侧 */ | |
| 1873 | + let iColValueView2 = 12; | |
| 1874 | + let iColValueTable2 = 12; | |
| 1875 | + let slave2Row = {}; | |
| 1876 | + if (commonUtils.isNotEmptyArr(slave2SelectedRowKeys)) { | |
| 1877 | + const iIndex = slave2Data.findIndex(item => slave2SelectedRowKeys.includes(item.sId)); | |
| 1878 | + if (iIndex > -1) { | |
| 1879 | + slave2Row = slave2Data[iIndex]; | |
| 1880 | + } else { | |
| 1881 | + slave2Row = slave2Data[0]; | |
| 1882 | + } | |
| 1883 | + } else if (commonUtils.isNotEmptyArr(slave2Data)) { | |
| 1884 | + slave2Row = slave2Data[0]; | |
| 1885 | + } | |
| 1886 | + if (commonUtils.isNotEmptyObject(slave2Config) && commonUtils.isNotEmptyArr(slave2Config.gdsconfigformslave)) { | |
| 1887 | + const iIndexArea = slave2Config.gdsconfigformslave.findIndex(item => item.sControlName !== "" && item.sControlName.includes("bShow")); | |
| 1888 | + if (iIndexArea > -1) { | |
| 1889 | + showAll2 = false; | |
| 1890 | + } | |
| 1891 | + if (commonUtils.isNotEmptyObject(slave2Config) && commonUtils.isNotEmptyArr(slave2Config.gdsconfigformslave)) { | |
| 1892 | + const iShowLeft2 = slave2Config.gdsconfigformslave.findIndex(item => item.sControlName === "bShowLeft" && item.bVisible); | |
| 1893 | + const iShowRight2 = slave2Config.gdsconfigformslave.findIndex(item => item.sControlName === "bShowRight" && item.bVisible); | |
| 1894 | + if (iShowLeft2 > -1) { | |
| 1895 | + bShowLeft2 = true; | |
| 1896 | + iColValueTable2 = slave2Config.gdsconfigformslave[iShowLeft2].iColValue; | |
| 1897 | + } else if (iShowRight2 > -1) { | |
| 1898 | + bShowLeft2 = false; | |
| 1899 | + iColValueTable2 = slave2Config.gdsconfigformslave[iShowRight2].iColValue; | |
| 1900 | + } | |
| 1901 | + } | |
| 1902 | + } | |
| 1903 | + iColValueView2 = commonUtils.isNotEmptyNumber(iColValueTable2) ? 24 - iColValueTable2 : 12; | |
| 1904 | + if (slave2Config && slave2Config.sChinese === "上批对比") { | |
| 1905 | + iColValueView2 = iColValueView1; | |
| 1906 | + } | |
| 1907 | + const iShowOrder2 = bShowLeft2 ? 1 : 100; | |
| 1908 | + | |
| 1909 | + /* 表5-commonView显示区域 */ | |
| 1910 | + const ableConfigs3 = commonUtils.isNotEmptyObject(slave3Config) | |
| 1911 | + ? slave3Config.gdsconfigformslave.filter(item => item.sName !== "" && item.bControl && item.sControlName.indexOf("Btn") === -1) | |
| 1912 | + : []; | |
| 1913 | + let showAll3 = true; /* 只显示表格 */ | |
| 1914 | + let bShowLeft3 = true; /* 表格显示在左侧 */ | |
| 1915 | + let iColValueView3 = 12; | |
| 1916 | + let iColValueTable3 = 12; | |
| 1917 | + let slave3Row = {}; | |
| 1918 | + if (commonUtils.isNotEmptyArr(slave3SelectedRowKeys)) { | |
| 1919 | + const iIndex = slave3Data.findIndex(item => slave3SelectedRowKeys.includes(item.sId)); | |
| 1920 | + if (iIndex > -1) { | |
| 1921 | + slave3Row = slave3Data[iIndex]; | |
| 1922 | + } else { | |
| 1923 | + slave3Row = slave3Data[0]; | |
| 1924 | + } | |
| 1925 | + } else if (commonUtils.isNotEmptyArr(slave3Data)) { | |
| 1926 | + slave3Row = slave3Data[0]; | |
| 1927 | + } | |
| 1928 | + if (commonUtils.isNotEmptyObject(slave3Config) && commonUtils.isNotEmptyArr(slave3Config.gdsconfigformslave)) { | |
| 1929 | + const iIndexArea = slave3Config.gdsconfigformslave.findIndex(item => item.sControlName !== "" && item.sControlName.includes("bShow")); | |
| 1930 | + if (iIndexArea > -1) { | |
| 1931 | + showAll3 = false; | |
| 1932 | + } | |
| 1933 | + if (commonUtils.isNotEmptyObject(slave3Config) && commonUtils.isNotEmptyArr(slave3Config.gdsconfigformslave)) { | |
| 1934 | + const iShowLeft3 = slave3Config.gdsconfigformslave.findIndex(item => item.sControlName === "bShowLeft" && item.bVisible); | |
| 1935 | + const iShowRight3 = slave3Config.gdsconfigformslave.findIndex(item => item.sControlName === "bShowRight" && item.bVisible); | |
| 1936 | + if (iShowLeft3 > -1) { | |
| 1937 | + bShowLeft3 = true; | |
| 1938 | + iColValueTable3 = slave3Config.gdsconfigformslave[iShowLeft3].iColValue; | |
| 1939 | + } else if (iShowRight3 > -1) { | |
| 1940 | + bShowLeft3 = false; | |
| 1941 | + iColValueTable3 = slave3Config.gdsconfigformslave[iShowRight3].iColValue; | |
| 1942 | + } | |
| 1943 | + } | |
| 1944 | + } | |
| 1945 | + iColValueView3 = commonUtils.isNotEmptyNumber(iColValueTable3) ? 24 - iColValueTable3 : 12; | |
| 1946 | + const iShowOrder3 = bShowLeft3 ? 1 : 100; | |
| 1947 | + | |
| 1948 | + /* 表6-commonView显示区域 */ | |
| 1949 | + const ableConfigs4 = commonUtils.isNotEmptyObject(slave4Config) | |
| 1950 | + ? slave4Config.gdsconfigformslave.filter(item => item.sName !== "" && item.bControl && item.sControlName.indexOf("Btn") === -1) | |
| 1951 | + : []; | |
| 1952 | + let showAll4 = true; /* 只显示表格 */ | |
| 1953 | + let bShowLeft4 = true; /* 表格显示在左侧 */ | |
| 1954 | + let iColValueView4 = 12; | |
| 1955 | + let iColValueTable4 = 12; | |
| 1956 | + let slave4Row = {}; | |
| 1957 | + if (commonUtils.isNotEmptyArr(slave4SelectedRowKeys)) { | |
| 1958 | + const iIndex = slave4Data.findIndex(item => slave4SelectedRowKeys.includes(item.sId)); | |
| 1959 | + if (iIndex > -1) { | |
| 1960 | + slave4Row = slave4Data[iIndex]; | |
| 1961 | + } else { | |
| 1962 | + slave4Row = slave4Data[0]; | |
| 1963 | + } | |
| 1964 | + } else if (commonUtils.isNotEmptyArr(slave4Data)) { | |
| 1965 | + slave4Row = slave4Data[0]; | |
| 1966 | + } | |
| 1967 | + if (commonUtils.isNotEmptyObject(slave4Config) && commonUtils.isNotEmptyArr(slave4Config.gdsconfigformslave)) { | |
| 1968 | + const iIndexArea = slave4Config.gdsconfigformslave.findIndex(item => item.sControlName !== "" && item.sControlName.includes("bShow")); | |
| 1969 | + if (iIndexArea > -1) { | |
| 1970 | + showAll4 = false; | |
| 1971 | + } | |
| 1972 | + if (commonUtils.isNotEmptyObject(slave4Config) && commonUtils.isNotEmptyArr(slave4Config.gdsconfigformslave)) { | |
| 1973 | + const iShowLeft4 = slave4Config.gdsconfigformslave.findIndex(item => item.sControlName === "bShowLeft" && item.bVisible); | |
| 1974 | + const iShowRight4 = slave4Config.gdsconfigformslave.findIndex(item => item.sControlName === "bShowRight" && item.bVisible); | |
| 1975 | + if (iShowLeft4 > -1) { | |
| 1976 | + bShowLeft4 = true; | |
| 1977 | + iColValueTable4 = slave4Config.gdsconfigformslave[iShowLeft4].iColValue; | |
| 1978 | + } else if (iShowRight4 > -1) { | |
| 1979 | + bShowLeft4 = false; | |
| 1980 | + iColValueTable4 = slave4Config.gdsconfigformslave[iShowRight4].iColValue; | |
| 1981 | + } | |
| 1982 | + } | |
| 1983 | + } | |
| 1984 | + iColValueView4 = commonUtils.isNotEmptyNumber(iColValueTable4) ? 24 - iColValueTable4 : 12; | |
| 1985 | + const iShowOrder4 = bShowLeft4 ? 1 : 100; | |
| 1986 | + | |
| 1987 | + const listType = "commonMultiList"; | |
| 1988 | + const bCheck = commonUtils.isNotEmptyObject(slaveConfig) && slaveConfig.sTbName === "sysbillcheckresult" ? true : false; | |
| 1989 | + | |
| 1990 | + const bSingleTree = commonUtils.isNotEmptyObject(slaveConfig) && slaveConfig.sTableType === "single"; /* 单表数据 */ | |
| 1991 | + const bShowTreeAddChild = | |
| 1992 | + commonUtils.isNotEmptyObject(slaveConfig) && | |
| 1993 | + commonUtils.isNotEmptyArr(slaveConfig.gdsconfigformslave.filter(item => item.sControlName.includes("BtnAddChildNode") && item.bVisible)) | |
| 1994 | + ? true | |
| 1995 | + : false; /* 是否是树形的单据 */ | |
| 1996 | + | |
| 1997 | + const bSlaveSort = slaveConfig?.gdsconfigformslave?.find(item => item.sControlName === "handleSort")?.bVisible || false; | |
| 1998 | + | |
| 1999 | + const slaveTableProps = { | |
| 2000 | + ...commonBusiness.getTableTypes("slave", props), | |
| 2001 | + tableBelone: sModelsType === listType ? "list" : "" /* 新需求:做个1带N的只可查看不可编辑的表格,模块类型名:commonMultiList */, | |
| 2002 | + tableProps: { | |
| 2003 | + setAdd, | |
| 2004 | + setCopy, | |
| 2005 | + setCopyAll, | |
| 2006 | + setDelete, | |
| 2007 | + bShowTreeAddChild: bShowTreeAddChild, | |
| 2008 | + pagination, | |
| 2009 | + onChange: props.onTitleChange.bind(this, "slave"), | |
| 2010 | + dragTableHeight: 344 | |
| 2011 | + }, | |
| 2012 | + noVlistTable: bPagination, | |
| 2013 | + onDelRow: props.onDelRow, | |
| 2014 | + data: bSingleTree && commonUtils.isNotEmptyArr(slaveData) ? commonUtils.genTreeByArr(slaveData, "sId", "sFatherSlaveId") : slaveData, | |
| 2015 | + onTreeAddChild: props.onDataRowAddChild, | |
| 2016 | + customConfig: props.customConfig, | |
| 2017 | + isDragAndDrop: bSlaveSort, | |
| 2018 | + onMoveRow: props.onMoveRow, | |
| 2019 | + isSettingFunctions: true | |
| 2020 | + }; | |
| 2021 | + | |
| 2022 | + const bCheck0 = commonUtils.isNotEmptyObject(slave0Config) && slave0Config.sTbName === "sysbillcheckresult" ? true : false; | |
| 2023 | + const slave0TableProps = { | |
| 2024 | + ...commonBusiness.getTableTypes("slave0", props), | |
| 2025 | + tableBelone: sModelsType === listType || bCheck ? "list" : "" /* 新需求:做个1带N的只可查看不可编辑的表格,模块类型名:commonMultiList */, | |
| 2026 | + tableProps: { | |
| 2027 | + setAdd, | |
| 2028 | + setCopy, | |
| 2029 | + setCopyAll, | |
| 2030 | + setDelete, | |
| 2031 | + pagination: pagination0, | |
| 2032 | + onChange: props.onTitleChange.bind(this, "slave0"), | |
| 2033 | + }, | |
| 2034 | + }; | |
| 2035 | + const bCheck1 = commonUtils.isNotEmptyObject(slave1Config) && slave1Config.sTbName === "sysbillcheckresult" ? true : false; | |
| 2036 | + const slave1TableProps = { | |
| 2037 | + ...commonBusiness.getTableTypes("slave1", props), | |
| 2038 | + tableBelone: sModelsType === listType ? "list" : "" /* 新需求:做个1带N的只可查看不可编辑的表格,模块类型名:commonMultiList */, | |
| 2039 | + tableProps: { | |
| 2040 | + setAdd, | |
| 2041 | + setCopy, | |
| 2042 | + setCopyAll, | |
| 2043 | + setDelete, | |
| 2044 | + pagination: pagination1, | |
| 2045 | + onChange: props.onTitleChange.bind(this, "slave1"), | |
| 2046 | + }, | |
| 2047 | + }; | |
| 2048 | + const bCheck2 = commonUtils.isNotEmptyObject(slave2Config) && slave2Config.sTbName === "sysbillcheckresult" ? true : false; | |
| 2049 | + const slave2TableProps = { | |
| 2050 | + ...commonBusiness.getTableTypes("slave2", props), | |
| 2051 | + tableBelone: sModelsType === listType ? "list" : "" /* 新需求:做个1带N的只可查看不可编辑的表格,模块类型名:commonMultiList */, | |
| 2052 | + tableProps: { | |
| 2053 | + setAdd, | |
| 2054 | + setCopy, | |
| 2055 | + setCopyAll, | |
| 2056 | + setDelete, | |
| 2057 | + pagination: pagination2, | |
| 2058 | + onChange: props.onTitleChange.bind(this, "slave2"), | |
| 2059 | + }, | |
| 2060 | + }; | |
| 2061 | + const slave3TableProps = { | |
| 2062 | + ...commonBusiness.getTableTypes("slave3", props), | |
| 2063 | + tableBelone: sModelsType === listType ? "list" : "" /* 新需求:做个1带N的只可查看不可编辑的表格,模块类型名:commonMultiList */, | |
| 2064 | + tableProps: { | |
| 2065 | + setAdd, | |
| 2066 | + setCopy, | |
| 2067 | + setCopyAll, | |
| 2068 | + setDelete, | |
| 2069 | + pagination: pagination3, | |
| 2070 | + onChange: props.onTitleChange.bind(this, "slave3"), | |
| 2071 | + }, | |
| 2072 | + }; | |
| 2073 | + const slave4TableProps = { | |
| 2074 | + ...commonBusiness.getTableTypes("slave4", props), | |
| 2075 | + tableBelone: sModelsType === listType ? "list" : "" /* 新需求:做个1带N的只可查看不可编辑的表格,模块类型名:commonMultiList */, | |
| 2076 | + tableProps: { | |
| 2077 | + setAdd, | |
| 2078 | + setCopy, | |
| 2079 | + setCopyAll, | |
| 2080 | + setDelete, | |
| 2081 | + pagination: pagination4, | |
| 2082 | + onChange: props.onTitleChange.bind(this, "slave4"), | |
| 2083 | + }, | |
| 2084 | + }; | |
| 2085 | + const slave5TableProps = { | |
| 2086 | + ...commonBusiness.getTableTypes("slave5", props), | |
| 2087 | + tableBelone: sModelsType === listType ? "list" : "" /* 新需求:做个1带N的只可查看不可编辑的表格,模块类型名:commonMultiList */, | |
| 2088 | + tableProps: { | |
| 2089 | + setAdd, | |
| 2090 | + setCopy, | |
| 2091 | + setCopyAll, | |
| 2092 | + setDelete, | |
| 2093 | + pagination: pagination5, | |
| 2094 | + onChange: props.onTitleChange.bind(this, "slave5"), | |
| 2095 | + }, | |
| 2096 | + }; | |
| 2097 | + | |
| 2098 | + const slave6TableProps = { | |
| 2099 | + ...commonBusiness.getTableTypes("slave6", props), | |
| 2100 | + tableBelone: sModelsType === listType ? "list" : "" /* 新需求:做个1带N的只可查看不可编辑的表格,模块类型名:commonMultiList */, | |
| 2101 | + tableProps: { | |
| 2102 | + setAdd, | |
| 2103 | + setCopy, | |
| 2104 | + setCopyAll, | |
| 2105 | + setDelete, | |
| 2106 | + pagination: pagination6, | |
| 2107 | + onChange: props.onTitleChange.bind(this, "slave6"), | |
| 2108 | + }, | |
| 2109 | + }; | |
| 2110 | + | |
| 2111 | + const slave7TableProps = { | |
| 2112 | + ...commonBusiness.getTableTypes("slave7", props), | |
| 2113 | + tableBelone: sModelsType === listType ? "list" : "" /* 新需求:做个1带N的只可查看不可编辑的表格,模块类型名:commonMultiList */, | |
| 2114 | + tableProps: { | |
| 2115 | + setAdd, | |
| 2116 | + setCopy, | |
| 2117 | + setCopyAll, | |
| 2118 | + setDelete, | |
| 2119 | + pagination: pagination7, | |
| 2120 | + onChange: props.onTitleChange.bind(this, "slave7"), | |
| 2121 | + }, | |
| 2122 | + }; | |
| 2123 | + | |
| 2124 | + const slave8TableProps = { | |
| 2125 | + ...commonBusiness.getTableTypes("slave8", props), | |
| 2126 | + tableBelone: sModelsType === listType ? "list" : "" /* 新需求:做个1带N的只可查看不可编辑的表格,模块类型名:commonMultiList */, | |
| 2127 | + tableProps: { | |
| 2128 | + setAdd, | |
| 2129 | + setCopy, | |
| 2130 | + setCopyAll, | |
| 2131 | + setDelete, | |
| 2132 | + pagination: pagination8, | |
| 2133 | + onChange: props.onTitleChange.bind(this, "slave8"), | |
| 2134 | + }, | |
| 2135 | + }; | |
| 2136 | + | |
| 2137 | + const slave9TableProps = { | |
| 2138 | + ...commonBusiness.getTableTypes("slave9", props), | |
| 2139 | + tableBelone: sModelsType === listType ? "list" : "" /* 新需求:做个1带N的只可查看不可编辑的表格,模块类型名:commonMultiList */, | |
| 2140 | + tableProps: { | |
| 2141 | + setAdd, | |
| 2142 | + setCopy, | |
| 2143 | + setCopyAll, | |
| 2144 | + setDelete, | |
| 2145 | + pagination: pagination9, | |
| 2146 | + onChange: props.onTitleChange.bind(this, "slave9"), | |
| 2147 | + }, | |
| 2148 | + }; | |
| 2149 | + | |
| 2150 | + const slave10TableProps = { | |
| 2151 | + ...commonBusiness.getTableTypes("slave10", props), | |
| 2152 | + tableBelone: sModelsType === listType ? "list" : "" /* 新需求:做个1带N的只可查看不可编辑的表格,模块类型名:commonMultiList */, | |
| 2153 | + tableProps: { | |
| 2154 | + setAdd, | |
| 2155 | + setCopy, | |
| 2156 | + setCopyAll, | |
| 2157 | + setDelete, | |
| 2158 | + pagination: pagination10, | |
| 2159 | + onChange: props.onTitleChange.bind(this, "slave10"), | |
| 2160 | + }, | |
| 2161 | + }; | |
| 2162 | + | |
| 2163 | + /* 从表view */ | |
| 2164 | + const slaveViewProps = { | |
| 2165 | + ...props, | |
| 2166 | + viewConfigs: ableConfigs, | |
| 2167 | + tableConfig: slaveConfig, | |
| 2168 | + iColValueView, | |
| 2169 | + viewRow: slaveRow, | |
| 2170 | + tableName: "slave", | |
| 2171 | + handleFieldDoubleClick: props.handleFieldDoubleClick, | |
| 2172 | + }; | |
| 2173 | + | |
| 2174 | + /* 第二张表 */ | |
| 2175 | + const slave0ViewProps = { | |
| 2176 | + ...props, | |
| 2177 | + viewConfigs: ableConfigs0, | |
| 2178 | + tableConfig: slave0Config, | |
| 2179 | + iColValueView: iColValueView0, | |
| 2180 | + viewRow: slave0Row, | |
| 2181 | + tableName: "slave0", | |
| 2182 | + }; | |
| 2183 | + /* */ | |
| 2184 | + const slave1ViewProps = { | |
| 2185 | + ...props, | |
| 2186 | + viewConfigs: ableConfigs1, | |
| 2187 | + tableConfig: slave1Config, | |
| 2188 | + iColValueView: iColValueView1, | |
| 2189 | + viewRow: slave1Row, | |
| 2190 | + tableName: "slave1", | |
| 2191 | + }; | |
| 2192 | + /* 从表view */ | |
| 2193 | + const slave2ViewProps = { | |
| 2194 | + ...props, | |
| 2195 | + viewConfigs: ableConfigs2, | |
| 2196 | + tableConfig: slave2Config, | |
| 2197 | + iColValueView: iColValueView2, | |
| 2198 | + viewRow: slave2Row, | |
| 2199 | + tableName: "slave2", | |
| 2200 | + }; | |
| 2201 | + | |
| 2202 | + /* pack表view */ | |
| 2203 | + const slave3ViewProps = { | |
| 2204 | + ...props, | |
| 2205 | + viewConfigs: ableConfigs3, | |
| 2206 | + tableConfig: slave3Config, | |
| 2207 | + iColValueView: iColValueView3, | |
| 2208 | + viewRow: slave3Row, | |
| 2209 | + tableName: "slave3", | |
| 2210 | + }; | |
| 2211 | + | |
| 2212 | + const slave4ViewProps = { | |
| 2213 | + ...props, | |
| 2214 | + viewConfigs: ableConfigs4, | |
| 2215 | + tableConfig: slave4Config, | |
| 2216 | + iColValueView: iColValueView4, | |
| 2217 | + viewRow: slave4Row, | |
| 2218 | + tableName: "slave4", | |
| 2219 | + }; | |
| 2220 | + | |
| 2221 | + /* 获取AssignmentField中的props */ | |
| 2222 | + const assignmentFieldProps = { | |
| 2223 | + visibleAssignmentField: props.visibleAssignmentField /* 是否展示 */, | |
| 2224 | + sAssignFieldData: props.sAssignFieldData /* 数据 */, | |
| 2225 | + sAssignFieldColumn: props.sAssignFieldColumn /* 表头 */, | |
| 2226 | + selectedRowKeys: props.selectedRowKeys /* 选中 */, | |
| 2227 | + sAssignFieldSelectedRowKeys: props.selectedRowKeys /* 选中 */, | |
| 2228 | + onSaveState: props.onSaveState /* 保存数据方法 */, | |
| 2229 | + onDataRowAdd: props.handleAddRow.bind(this, "sAssignField"), | |
| 2230 | + onDataRowDel: props.handleDelRow.bind(this, "sAssignField"), | |
| 2231 | + onDataRowCopy: props.handleCopyRow.bind(this, "sAssignField"), | |
| 2232 | + // onRowClick: props.handleRowClick.bind(this, 'sAssignField'), | |
| 2233 | + config: props.config, | |
| 2234 | + app: props.app, | |
| 2235 | + enabled: props.enabled, | |
| 2236 | + onDataChange: props.onChange, | |
| 2237 | + onGetsAssignField: props.onGetsAssignField, | |
| 2238 | + handleFieldDoubleClick: props.handleFieldDoubleClick, | |
| 2239 | + }; | |
| 2240 | + | |
| 2241 | + // const slaveInfo = commonFunc.showMessage(app.commonConst, 'MainContent'); /* 从表信息 */ | |
| 2242 | + // const materialsInfo = commonFunc.showMessage(app.commonConst, 'zMaterials'); /* 材料表 */ | |
| 2243 | + // const checkInfo = commonFunc.showMessage(app.commonConst, 'zCheck'); /* 审核表 */ | |
| 2244 | + // const slaveInfo0 = commonFunc.showMessage(app.commonConst, 'zSlaveInfo0'); /* 工序表 */ | |
| 2245 | + // const slaveInfo1 = commonFunc.showMessage(app.commonConst, 'zSlaveInfo1'); /* 表二 */ | |
| 2246 | + // const slaveInfo2 = commonFunc.showMessage(app.commonConst, 'zSlaveInfo2'); /* 表三 */ | |
| 2247 | + let slaveInfo = ""; | |
| 2248 | + let materialsInfo = ""; | |
| 2249 | + let checkInfo = ""; | |
| 2250 | + let slaveInfo0 = ""; | |
| 2251 | + let slaveInfo1 = ""; | |
| 2252 | + let slaveInfo2 = ""; | |
| 2253 | + let slaveInfo3 = ""; | |
| 2254 | + let slaveInfo4 = ""; | |
| 2255 | + let slaveInfo5 = ""; | |
| 2256 | + let slaveInfo6 = ""; | |
| 2257 | + let slaveInfo7 = ""; | |
| 2258 | + let slaveInfo8 = ""; | |
| 2259 | + | |
| 2260 | + let defaultTab = ""; | |
| 2261 | + | |
| 2262 | + if (commonUtils.isNotEmptyObject(masterConfig) && commonUtils.isNotEmptyArr(masterConfig.gdsconfigformslave)) { | |
| 2263 | + slaveInfo = commonUtils.isNotEmptyArr(masterConfig.gdsconfigformslave.filter(item => item.sControlName === "MainContent")) | |
| 2264 | + ? masterConfig.gdsconfigformslave.filter(item => item.sControlName === "MainContent")[0].showName | |
| 2265 | + : commonFunc.showMessage(app.commonConst, "MainContent"); /* 从表信息 */ | |
| 2266 | + materialsInfo = commonUtils.isNotEmptyArr(masterConfig.gdsconfigformslave.filter(item => item.sControlName === "zMaterials")) | |
| 2267 | + ? masterConfig.gdsconfigformslave.filter(item => item.sControlName === "zMaterials")[0].showName | |
| 2268 | + : commonFunc.showMessage(app.commonConst, "zMaterials"); /* 表一 */ | |
| 2269 | + checkInfo = commonUtils.isNotEmptyArr(masterConfig.gdsconfigformslave.filter(item => item.sControlName === "zCheck")) | |
| 2270 | + ? masterConfig.gdsconfigformslave.filter(item => item.sControlName === "zCheck")[0].showName | |
| 2271 | + : commonFunc.showMessage(app.commonConst, "zCheck"); /* 表二 */ | |
| 2272 | + slaveInfo0 = commonUtils.isNotEmptyArr(masterConfig.gdsconfigformslave.filter(item => item.sControlName === "zSlaveInfo0")) | |
| 2273 | + ? masterConfig.gdsconfigformslave.filter(item => item.sControlName === "zSlaveInfo0")[0].showName | |
| 2274 | + : commonFunc.showMessage(app.commonConst, "zSlaveInfo0"); /* 表三 */ | |
| 2275 | + slaveInfo1 = commonUtils.isNotEmptyArr(masterConfig.gdsconfigformslave.filter(item => item.sControlName === "zSlaveInfo1")) | |
| 2276 | + ? masterConfig.gdsconfigformslave.filter(item => item.sControlName === "zSlaveInfo1")[0].showName | |
| 2277 | + : commonFunc.showMessage(app.commonConst, "zSlaveInfo1"); /* 表四 */ | |
| 2278 | + slaveInfo2 = commonUtils.isNotEmptyArr(masterConfig.gdsconfigformslave.filter(item => item.sControlName === "zSlaveInfo2")) | |
| 2279 | + ? masterConfig.gdsconfigformslave.filter(item => item.sControlName === "zSlaveInfo2")[0].showName | |
| 2280 | + : commonFunc.showMessage(app.commonConst, "zSlaveInfo2"); /* 表五 */ | |
| 2281 | + slaveInfo3 = commonUtils.isNotEmptyArr(masterConfig.gdsconfigformslave.filter(item => item.sControlName === "zSlaveInfo3")) | |
| 2282 | + ? masterConfig.gdsconfigformslave.filter(item => item.sControlName === "zSlaveInfo3")[0].showName | |
| 2283 | + : commonFunc.showMessage(app.commonConst, "zSlaveInfo3"); /* 表六 */ | |
| 2284 | + slaveInfo4 = commonUtils.isNotEmptyArr(masterConfig.gdsconfigformslave.filter(item => item.sControlName === "zSlaveInfo4")) | |
| 2285 | + ? masterConfig.gdsconfigformslave.filter(item => item.sControlName === "zSlaveInfo4")[0].showName | |
| 2286 | + : commonFunc.showMessage(app.commonConst, "zSlaveInfo4"); /* 表七 */ | |
| 2287 | + slaveInfo5 = commonUtils.isNotEmptyArr(masterConfig.gdsconfigformslave.filter(item => item.sControlName === "zSlaveInfo5")) | |
| 2288 | + ? masterConfig.gdsconfigformslave.filter(item => item.sControlName === "zSlaveInfo5")[0].showName | |
| 2289 | + : commonFunc.showMessage(app.commonConst, "zSlaveInfo5"); /* 表八 */ | |
| 2290 | + slaveInfo6 = commonUtils.isNotEmptyArr(masterConfig.gdsconfigformslave.filter(item => item.sControlName === "zSlaveInfo6")) | |
| 2291 | + ? masterConfig.gdsconfigformslave.filter(item => item.sControlName === "zSlaveInfo6")[0].showName | |
| 2292 | + : commonFunc.showMessage(app.commonConst, "zSlaveInfo6"); /* 表九 */ | |
| 2293 | + slaveInfo7 = commonUtils.isNotEmptyArr(masterConfig.gdsconfigformslave.filter(item => item.sControlName === "zSlaveInfo7")) | |
| 2294 | + ? masterConfig.gdsconfigformslave.filter(item => item.sControlName === "zSlaveInfo7")[0].showName | |
| 2295 | + : commonFunc.showMessage(app.commonConst, "zSlaveInfo7"); /* 表十 */ | |
| 2296 | + slaveInfo8 = commonUtils.isNotEmptyArr(masterConfig.gdsconfigformslave.filter(item => item.sControlName === "zSlaveInfo8")) | |
| 2297 | + ? masterConfig.gdsconfigformslave.filter(item => item.sControlName === "zSlaveInfo8")[0].showName | |
| 2298 | + : commonFunc.showMessage(app.commonConst, "zSlaveInfo8"); /* 表十一 */ | |
| 2299 | + | |
| 2300 | + // 获取默认展开tab | |
| 2301 | + const defaultTabConfig = masterConfig.gdsconfigformslave.find( | |
| 2302 | + item => | |
| 2303 | + ["MainContent", "zMaterials", "zCheck", ...new Array(10).fill("").map((_, index) => `zSlaveInfo${index}`)].includes(item.sControlName) && | |
| 2304 | + item.sDefault | |
| 2305 | + ); | |
| 2306 | + if (defaultTabConfig) { | |
| 2307 | + if (defaultTabConfig.sControlName === "MainContent") { | |
| 2308 | + defaultTab = "10"; | |
| 2309 | + } else if (defaultTabConfig.sControlName === "zMaterials") { | |
| 2310 | + defaultTab = "20"; | |
| 2311 | + } else if (defaultTabConfig.sControlName === "zCheck") { | |
| 2312 | + defaultTab = "30"; | |
| 2313 | + } else { | |
| 2314 | + try { | |
| 2315 | + defaultTab = `${Number(defaultTabConfig.sControlName.split("zSlaveInfo")[1]) * 10 + 40}`; | |
| 2316 | + } catch (error) { } | |
| 2317 | + } | |
| 2318 | + } | |
| 2319 | + if (defaultTab && props.currentTab === "") { | |
| 2320 | + props.onTabChange(defaultTab); | |
| 2321 | + } | |
| 2322 | + } | |
| 2323 | + | |
| 2324 | + let productProcessInfoType = {}; | |
| 2325 | + let productProcessInfoConfig = {}; | |
| 2326 | + let processCardSearchResult = commonFunc.showMessage(app.commonConst, "processCardSearchResult"); /* 复制从工艺卡查询结果 */ | |
| 2327 | + if (commonUtils.isNotEmptyObject(props.productProcessInfoChooseData)) { | |
| 2328 | + const productProcessInfoCopyFromKey = props.productProcessInfoCopyFromKey; | |
| 2329 | + const iIndex = masterConfig.gdsconfigformslave.findIndex(item => item.sControlName === productProcessInfoCopyFromKey); | |
| 2330 | + if (iIndex > -1) { | |
| 2331 | + productProcessInfoConfig = masterConfig.gdsconfigformslave[iIndex]; | |
| 2332 | + processCardSearchResult = | |
| 2333 | + commonUtils.isNotEmptyObject(productProcessInfoConfig) && commonUtils.isNotEmptyObject(productProcessInfoConfig.sActiveName) | |
| 2334 | + ? productProcessInfoConfig.sActiveName | |
| 2335 | + : processCardSearchResult; | |
| 2336 | + } | |
| 2337 | + productProcessInfoType = { | |
| 2338 | + app: { | |
| 2339 | + ...props.app, | |
| 2340 | + currentPane: { | |
| 2341 | + name: "productProcessInfo", | |
| 2342 | + config: productProcessInfoConfig, | |
| 2343 | + conditonValues: props.getSqlCondition(productProcessInfoConfig), | |
| 2344 | + title: props.productProcessInfoChooseData.sMenuName, | |
| 2345 | + route: props.productProcessInfoChooseData.sName, | |
| 2346 | + formId: props.productProcessInfoChooseData.sId, | |
| 2347 | + key: props.sModelsId + props.productProcessInfoChooseData.sId, | |
| 2348 | + sModelsType: props.productProcessInfoChooseData.sModelType, | |
| 2349 | + select: props.onSelect, | |
| 2350 | + selectCancel: props.onSelectCancel, | |
| 2351 | + }, | |
| 2352 | + }, | |
| 2353 | + dispatch: props.dispatch, | |
| 2354 | + content: props.content, | |
| 2355 | + id: new Date().getTime().toString(), | |
| 2356 | + }; | |
| 2357 | + } | |
| 2358 | + | |
| 2359 | + let isSysSetting = false; | |
| 2360 | + if ( | |
| 2361 | + props && | |
| 2362 | + props.app && | |
| 2363 | + props.app.currentPane && | |
| 2364 | + props.app.currentPane.title && | |
| 2365 | + props.app.currentPane && | |
| 2366 | + props.app.currentPane.title === "功能模块界面设置单据" | |
| 2367 | + ) { | |
| 2368 | + isSysSetting = true; | |
| 2369 | + } | |
| 2370 | + const templateProps = props.formData.filter(item => item.sGrd === "importTemplate")[0]; | |
| 2371 | + let gdsconfigformmasterId = ""; | |
| 2372 | + if (templateProps !== undefined) { | |
| 2373 | + gdsconfigformmasterId = templateProps.sId; | |
| 2374 | + } | |
| 2375 | + const sNotEmpty = "sParentId,sProductId"; | |
| 2376 | + let uploadUrl = `${commonConfig.server_host}import/checkExcel?sModelsId=${sModelsId}&gdsconfigformmasterId=${gdsconfigformmasterId}&sNotEmpty=${sNotEmpty}&token=${app.token}`; | |
| 2377 | + /* 送货单需要传客户id */ | |
| 2378 | + if (commonUtils.isNotEmptyObject(sModelsType) && sModelsType === "sales/salesSgoods" && commonUtils.isNotEmptyObject(masterData)) { | |
| 2379 | + const sCustomerId = masterData.sCustomerId; | |
| 2380 | + if (commonUtils.isNotEmptyObject(sCustomerId)) { | |
| 2381 | + uploadUrl = `${commonConfig.server_host}import/checkExcel?sModelsId=${sModelsId}&gdsconfigformmasterId=${gdsconfigformmasterId}&sNotEmpty=${sNotEmpty}&sCustomerId=${sCustomerId}&token=${app.token}`; | |
| 2382 | + } | |
| 2383 | + } | |
| 2384 | + const outProps = { | |
| 2385 | + action: uploadUrl, | |
| 2386 | + onChange: props.onUploadChangeFile /* 文件上传 */, | |
| 2387 | + accept: "xls/*", | |
| 2388 | + showUploadList: false, | |
| 2389 | + beforeUpload: () => { | |
| 2390 | + /* 查看时不可上传 */ | |
| 2391 | + if (!props.enabled) return false; | |
| 2392 | + }, | |
| 2393 | + }; | |
| 2394 | + | |
| 2395 | + const uploadPropsSales = props.onUploadPropsSales(); | |
| 2396 | + const BtnimportData = commonFunc.showMessage(app.commonConst, "importData"); /* 导入数据 */ | |
| 2397 | + const ImportData = commonUtils.isNotEmptyObject(masterConfig) | |
| 2398 | + ? masterConfig.gdsconfigformslave.filter(item => item.sControlName.includes("ImportData") && item.bVisible) | |
| 2399 | + : ""; /* 后台是否配置导入 */ | |
| 2400 | + | |
| 2401 | + /* 显示导入报错信息 */ | |
| 2402 | + let importExcelProps = {}; | |
| 2403 | + let importExcelTitle = commonUtils.isNotEmptyObject(commonFunc.showMessage(app.commonConst, "processCardSearchResult")) | |
| 2404 | + ? commonFunc.showMessage(app.commonConst, "importErrorMsg") | |
| 2405 | + : "导入校验信息"; /* 导入校验信息 */ | |
| 2406 | + if (commonUtils.isNotEmptyObject(props)) { | |
| 2407 | + importExcelProps = { | |
| 2408 | + ...commonBusiness.getTableTypes("import", props), | |
| 2409 | + tableProps: { | |
| 2410 | + pagination: null, | |
| 2411 | + AutoTableHeight: 400, | |
| 2412 | + }, | |
| 2413 | + // data: bSingleTree && commonUtils.isNotEmptyArr(slaveData) ? commonUtils.genTreeByArr(slaveData, 'sId', 'sFatherSlaveId') : slaveData, | |
| 2414 | + onDelRow: props.onDelRow, | |
| 2415 | + onKeyDown: props.onKeyDown, | |
| 2416 | + onContextMenu: props.onContextMenu, | |
| 2417 | + masterData: props.masterData, // 为通用弹窗提供主表数据(孟总需求:产品新增需要带上客户信息) | |
| 2418 | + tableBelone: "list", | |
| 2419 | + }; | |
| 2420 | + } | |
| 2421 | + const sProcessParams = commonFunc.showMessage(app.commonConst, "sProcessParams"); /* 选择工艺参数标题 */ | |
| 2422 | + | |
| 2423 | + const sProcessParamsNew = commonUtils.isNotEmptyObject(commonFunc.showMessage(app.commonConst, "sProcessParamsNew")) | |
| 2424 | + ? commonFunc.showMessage(app.commonConst, "sProcessParamsNew") | |
| 2425 | + : "选择新的工艺参数"; /* 选择工艺参数标题 */ | |
| 2426 | + /* 新方式的工艺参数 */ | |
| 2427 | + const sParamProps = { | |
| 2428 | + ...commonBusiness.getTableTypes("sParam", props), | |
| 2429 | + tableProps: { | |
| 2430 | + rowKey: "sId", | |
| 2431 | + // pagination, | |
| 2432 | + onChange: props.onTitleChange, | |
| 2433 | + sModelsType, | |
| 2434 | + AutoTableHeight: 350, | |
| 2435 | + }, | |
| 2436 | + bRowClick: true, | |
| 2437 | + enabled: false, | |
| 2438 | + }; | |
| 2439 | + | |
| 2440 | + const sParamNewProps = { | |
| 2441 | + ...commonBusiness.getTableTypes("sParamNew", props), | |
| 2442 | + tableProps: { | |
| 2443 | + rowKey: "sId", | |
| 2444 | + // pagination, | |
| 2445 | + onChange: props.onTitleChange, | |
| 2446 | + sModelsType, | |
| 2447 | + AutoTableHeight: 350, | |
| 2448 | + }, | |
| 2449 | + bRowClick: true, | |
| 2450 | + }; | |
| 2451 | + // | |
| 2452 | + // const menu = ( | |
| 2453 | + // <Menu onClick={props.handleMenuClick}> | |
| 2454 | + // <Menu.Item key="formMaster"><a href={props.downloadUrl}>生成主表当前数据(完全)</a></Menu.Item> | |
| 2455 | + // <Menu.Item key="fromMasterSlave"><a href={props.downloadUrl}>生成整表当前数据(完全)</a></Menu.Item> | |
| 2456 | + // <Menu.Item key="formSlave"><a href={props.downloadUrl}>生成从表当前数据</a></Menu.Item> | |
| 2457 | + // </Menu> | |
| 2458 | + // ); | |
| 2459 | + /* 取 masterConfig中有多少个Tab页签配置 */ | |
| 2460 | + const masterShowConfig = commonUtils.isNotEmptyObject(masterConfigOld) | |
| 2461 | + ? masterConfigOld.gdsconfigformslave.filter(item => item.bVisible && item.sName !== "") | |
| 2462 | + : []; | |
| 2463 | + const diliverConfigTypeArr = []; /* 有Tab的配置 */ | |
| 2464 | + masterShowConfig.forEach(child => { | |
| 2465 | + if (child.sControlName.indexOf("_") > -1) { | |
| 2466 | + const tableType = child.sControlName.split("_")[1]; | |
| 2467 | + const isIndex = diliverConfigTypeArr.findIndex(item => item === tableType); | |
| 2468 | + if (isIndex === -1) { | |
| 2469 | + diliverConfigTypeArr.push(tableType); | |
| 2470 | + } | |
| 2471 | + } | |
| 2472 | + }); | |
| 2473 | + | |
| 2474 | + /* 主表页签+表格页签排序规则,表格页签以10位一个间隔,10,20,30,40,50,60,如果想进行排序 则页签顺序介入其间即可 */ | |
| 2475 | + /* 找到各个主表页签Tab所处的区间 */ | |
| 2476 | + let diliverConfigTypeArr1 = []; | |
| 2477 | + let diliverConfigTypeArr2 = []; | |
| 2478 | + let diliverConfigTypeArr3 = []; | |
| 2479 | + let diliverConfigTypeArr4 = []; | |
| 2480 | + let diliverConfigTypeArr5 = []; | |
| 2481 | + let diliverConfigTypeArr6 = []; | |
| 2482 | + for (const item of diliverConfigTypeArr) { | |
| 2483 | + let numStr = item.replace(/[^\d]/g, "").trim(); | |
| 2484 | + let num = Number(numStr); | |
| 2485 | + if (!commonUtils.isEmpty(num)) { | |
| 2486 | + if (num < 10) { | |
| 2487 | + /* 0- 10 */ | |
| 2488 | + diliverConfigTypeArr1.push(item); | |
| 2489 | + } else if (num < 20) { | |
| 2490 | + /* 10- 20 */ | |
| 2491 | + diliverConfigTypeArr2.push(item); | |
| 2492 | + } else if (num < 30) { | |
| 2493 | + /* 20- 30 */ | |
| 2494 | + diliverConfigTypeArr3.push(item); | |
| 2495 | + } else if (num < 40) { | |
| 2496 | + /* 30- 40 */ | |
| 2497 | + diliverConfigTypeArr4.push(item); | |
| 2498 | + } else if (num < 50) { | |
| 2499 | + /* 40- 50 */ | |
| 2500 | + diliverConfigTypeArr5.push(item); | |
| 2501 | + } else if (num < 60) { | |
| 2502 | + /* 50- 60 */ | |
| 2503 | + diliverConfigTypeArr6.push(item); | |
| 2504 | + } | |
| 2505 | + } | |
| 2506 | + } | |
| 2507 | + | |
| 2508 | + const tabNumList = [ | |
| 2509 | + ...diliverConfigTypeArr1, | |
| 2510 | + onlySlave ? "10" : "", | |
| 2511 | + ...diliverConfigTypeArr2, | |
| 2512 | + onlySlave0 ? "20" : "", | |
| 2513 | + ...diliverConfigTypeArr3, | |
| 2514 | + onlySlave1 ? "30" : "", | |
| 2515 | + ...diliverConfigTypeArr4, | |
| 2516 | + onlyslave2 ? "40" : "", | |
| 2517 | + ...diliverConfigTypeArr5, | |
| 2518 | + onlyslave3 ? "50" : "", | |
| 2519 | + ...diliverConfigTypeArr6, | |
| 2520 | + onlyslave4 ? "60" : "", | |
| 2521 | + onlyslave5 ? "70" : "", | |
| 2522 | + onlyslave6 ? "80" : "", | |
| 2523 | + onlyslave7 ? "90" : "", | |
| 2524 | + onlyslave8 ? "100" : "", | |
| 2525 | + onlyslave9 ? "110" : "", | |
| 2526 | + onlyslave10 ? "150" : "", | |
| 2527 | + ].filter(item => item); | |
| 2528 | + const { enabled } = props.masterData || {}; | |
| 2529 | + if (enabled) { | |
| 2530 | + // 只有修改状态才会根据数据改变tab页 | |
| 2531 | + const tabNumListOld = props.onGetTabNumList(tabNumList); | |
| 2532 | + if (tabNumListOld && JSON.stringify(tabNumListOld) !== JSON.stringify(tabNumList)) { | |
| 2533 | + const addData = tabNumList.find(item => tabNumListOld.indexOf(item) === -1); | |
| 2534 | + props.onSetTabNumList(tabNumList); | |
| 2535 | + if (addData) { | |
| 2536 | + const activeKey = addData.replace(/[^\d]/g, "").trim(); | |
| 2537 | + props.onTabChange(activeKey); | |
| 2538 | + } else if (!tabNumList.some(item => props.currentTab === item.replace(/[^\d]/g, "").trim())) { | |
| 2539 | + const activeKey = tabNumList[0].replace(/[^\d]/g, "").trim(); | |
| 2540 | + props.onTabChange(activeKey); | |
| 2541 | + } | |
| 2542 | + } | |
| 2543 | + } | |
| 2544 | + | |
| 2545 | + if (!defaultTab && props.currentTab === "" && commonUtils.isNotEmptyArr(tabNumList)) { | |
| 2546 | + const activeKey = tabNumList[0].replace(/[^\d]/g, "").trim(); | |
| 2547 | + props.onSetTabNumList(tabNumList); | |
| 2548 | + props.onTabChange(activeKey); | |
| 2549 | + } | |
| 2550 | + | |
| 2551 | + // 组件展示是否单独Tab页 | |
| 2552 | + let bControlSeparateTab = false; | |
| 2553 | + let bControlSeparateTab0 = false; | |
| 2554 | + let bControlSeparateTab1 = false; | |
| 2555 | + let bControlSeparateTab2 = false; | |
| 2556 | + let bControlSeparateTab3 = false; | |
| 2557 | + let bControlSeparateTab4 = false; | |
| 2558 | + let bControlSeparateTab5 = false; | |
| 2559 | + let bControlSeparateTab6 = false; | |
| 2560 | + let bControlSeparateTab7 = false; | |
| 2561 | + let bControlSeparateTab8 = false; | |
| 2562 | + let bControlSeparateTab9 = false; | |
| 2563 | + let bControlSeparateTab10 = false; | |
| 2564 | + | |
| 2565 | + let separateTabName, | |
| 2566 | + separateTabName0, | |
| 2567 | + separateTabName1, | |
| 2568 | + separateTabName2, | |
| 2569 | + separateTabName3, | |
| 2570 | + separateTabName4, | |
| 2571 | + separateTabName5, | |
| 2572 | + separateTabName6, | |
| 2573 | + separateTabName7, | |
| 2574 | + separateTabName8, | |
| 2575 | + separateTabName9, | |
| 2576 | + separateTabName10; | |
| 2577 | + | |
| 2578 | + if (commonUtils.isNotEmptyObject(slaveConfig) && commonUtils.isNotEmptyArr(slaveConfig.gdsconfigformslave)) { | |
| 2579 | + const iIndex = slaveConfig.gdsconfigformslave.findIndex(item => item.sControlName === "bControlSeparateTab"); | |
| 2580 | + if (iIndex !== -1) { | |
| 2581 | + const separateTabConfig = slaveConfig.gdsconfigformslave[iIndex]; | |
| 2582 | + bControlSeparateTab = true; | |
| 2583 | + separateTabName = separateTabConfig.showName; | |
| 2584 | + } | |
| 2585 | + } | |
| 2586 | + if (commonUtils.isNotEmptyObject(slave0Config) && commonUtils.isNotEmptyArr(slave0Config.gdsconfigformslave)) { | |
| 2587 | + const iIndex = slave0Config.gdsconfigformslave.findIndex(item => item.sControlName === "bControlSeparateTab"); | |
| 2588 | + if (iIndex !== -1) { | |
| 2589 | + const separateTabConfig = slave0Config.gdsconfigformslave[iIndex]; | |
| 2590 | + bControlSeparateTab0 = true; | |
| 2591 | + separateTabName0 = separateTabConfig.showName; | |
| 2592 | + } | |
| 2593 | + } | |
| 2594 | + if (commonUtils.isNotEmptyObject(slave1Config) && commonUtils.isNotEmptyArr(slave1Config.gdsconfigformslave)) { | |
| 2595 | + const iIndex = slave1Config.gdsconfigformslave.findIndex(item => item.sControlName === "bControlSeparateTab"); | |
| 2596 | + if (iIndex !== -1) { | |
| 2597 | + const separateTabConfig = slave1Config.gdsconfigformslave[iIndex]; | |
| 2598 | + bControlSeparateTab1 = true; | |
| 2599 | + separateTabName1 = separateTabConfig.showName; | |
| 2600 | + } | |
| 2601 | + } | |
| 2602 | + if (commonUtils.isNotEmptyObject(slave2Config) && commonUtils.isNotEmptyArr(slave2Config.gdsconfigformslave)) { | |
| 2603 | + const iIndex = slave2Config.gdsconfigformslave.findIndex(item => item.sControlName === "bControlSeparateTab"); | |
| 2604 | + if (iIndex !== -1) { | |
| 2605 | + const separateTabConfig = slave2Config.gdsconfigformslave[iIndex]; | |
| 2606 | + bControlSeparateTab2 = true; | |
| 2607 | + separateTabName2 = separateTabConfig.showName; | |
| 2608 | + } | |
| 2609 | + } | |
| 2610 | + if (commonUtils.isNotEmptyObject(slave3Config) && commonUtils.isNotEmptyArr(slave3Config.gdsconfigformslave)) { | |
| 2611 | + const iIndex = slave3Config.gdsconfigformslave.findIndex(item => item.sControlName === "bControlSeparateTab"); | |
| 2612 | + if (iIndex !== -1) { | |
| 2613 | + const separateTabConfig = slave3Config.gdsconfigformslave[iIndex]; | |
| 2614 | + bControlSeparateTab3 = true; | |
| 2615 | + separateTabName3 = separateTabConfig.showName; | |
| 2616 | + } | |
| 2617 | + } | |
| 2618 | + if (commonUtils.isNotEmptyObject(slave4Config) && commonUtils.isNotEmptyArr(slave4Config.gdsconfigformslave)) { | |
| 2619 | + const iIndex = slave4Config.gdsconfigformslave.findIndex(item => item.sControlName === "bControlSeparateTab"); | |
| 2620 | + if (iIndex !== -1) { | |
| 2621 | + const separateTabConfig = slave4Config.gdsconfigformslave[iIndex]; | |
| 2622 | + bControlSeparateTab4 = true; | |
| 2623 | + separateTabName4 = separateTabConfig.showName; | |
| 2624 | + } | |
| 2625 | + } | |
| 2626 | + if (commonUtils.isNotEmptyObject(slave5Config) && commonUtils.isNotEmptyArr(slave5Config.gdsconfigformslave)) { | |
| 2627 | + const iIndex = slave5Config.gdsconfigformslave.findIndex(item => item.sControlName === "bControlSeparateTab"); | |
| 2628 | + if (iIndex !== -1) { | |
| 2629 | + const separateTabConfig = slave5Config.gdsconfigformslave[iIndex]; | |
| 2630 | + bControlSeparateTab5 = true; | |
| 2631 | + separateTabName5 = separateTabConfig.showName; | |
| 2632 | + } | |
| 2633 | + } | |
| 2634 | + if (commonUtils.isNotEmptyObject(slave6Config) && commonUtils.isNotEmptyArr(slave6Config.gdsconfigformslave)) { | |
| 2635 | + const iIndex = slave6Config.gdsconfigformslave.findIndex(item => item.sControlName === "bControlSeparateTab"); | |
| 2636 | + if (iIndex !== -1) { | |
| 2637 | + const separateTabConfig = slave6Config.gdsconfigformslave[iIndex]; | |
| 2638 | + bControlSeparateTab6 = true; | |
| 2639 | + separateTabName6 = separateTabConfig.showName; | |
| 2640 | + } | |
| 2641 | + } | |
| 2642 | + if (commonUtils.isNotEmptyObject(slave7Config) && commonUtils.isNotEmptyArr(slave7Config.gdsconfigformslave)) { | |
| 2643 | + const iIndex = slave7Config.gdsconfigformslave.findIndex(item => item.sControlName === "bControlSeparateTab"); | |
| 2644 | + if (iIndex !== -1) { | |
| 2645 | + const separateTabConfig = slave7Config.gdsconfigformslave[iIndex]; | |
| 2646 | + bControlSeparateTab7 = true; | |
| 2647 | + separateTabName7 = separateTabConfig.showName; | |
| 2648 | + } | |
| 2649 | + } | |
| 2650 | + if (commonUtils.isNotEmptyObject(slave8Config) && commonUtils.isNotEmptyArr(slave8Config.gdsconfigformslave)) { | |
| 2651 | + const iIndex = slave8Config.gdsconfigformslave.findIndex(item => item.sControlName === "bControlSeparateTab"); | |
| 2652 | + if (iIndex !== -1) { | |
| 2653 | + const separateTabConfig = slave8Config.gdsconfigformslave[iIndex]; | |
| 2654 | + bControlSeparateTab8 = true; | |
| 2655 | + separateTabName8 = separateTabConfig.showName; | |
| 2656 | + } | |
| 2657 | + } | |
| 2658 | + if (commonUtils.isNotEmptyObject(slave9Config) && commonUtils.isNotEmptyArr(slave9Config.gdsconfigformslave)) { | |
| 2659 | + const iIndex = slave9Config.gdsconfigformslave.findIndex(item => item.sControlName === "bControlSeparateTab"); | |
| 2660 | + if (iIndex !== -1) { | |
| 2661 | + const separateTabConfig = slave9Config.gdsconfigformslave[iIndex]; | |
| 2662 | + bControlSeparateTab9 = true; | |
| 2663 | + separateTabName9 = separateTabConfig.showName; | |
| 2664 | + } | |
| 2665 | + } | |
| 2666 | + if (commonUtils.isNotEmptyObject(slave10Config) && commonUtils.isNotEmptyArr(slave10Config.gdsconfigformslave)) { | |
| 2667 | + const iIndex = slave10Config.gdsconfigformslave.findIndex(item => item.sControlName === "bControlSeparateTab"); | |
| 2668 | + if (iIndex !== -1) { | |
| 2669 | + const separateTabConfig = slave10Config.gdsconfigformslave[iIndex]; | |
| 2670 | + bControlSeparateTab10 = true; | |
| 2671 | + separateTabName10 = separateTabConfig.showName; | |
| 2672 | + } | |
| 2673 | + } | |
| 2674 | + | |
| 2675 | + const flexRowStyle = bFlow ? { display: "flex", flexDirection: "row" } : {}; | |
| 2676 | + const flexContentStyle = bFlow ? { width: "75%" } : {}; | |
| 2677 | + // 设置初始宽度 | |
| 2678 | + const [containerWidth, setContainerWidth] = useState(410); | |
| 2679 | + const containerRef = useRef(null); | |
| 2680 | + const dividerRef = useRef(null); | |
| 2681 | + const [isDragging, setIsDragging] = useState(false); | |
| 2682 | + const [startX, setStartX] = useState(0); | |
| 2683 | + const [initialWidth, setInitialWidth] = useState(0); | |
| 2684 | + const handleMouseDown = e => { | |
| 2685 | + setIsDragging(true); | |
| 2686 | + setStartX(e.clientX); | |
| 2687 | + if (containerRef.current) { | |
| 2688 | + setInitialWidth(containerRef.current.offsetWidth); | |
| 2689 | + } | |
| 2690 | + }; | |
| 2691 | + const handleMouseMove = e => { | |
| 2692 | + if (!isDragging) return; | |
| 2693 | + // 当前鼠标移动位置 | |
| 2694 | + const currentX = e.clientX; | |
| 2695 | + // 移动距离 | |
| 2696 | + const diffX = currentX - startX; | |
| 2697 | + const newWidth = initialWidth + diffX; | |
| 2698 | + // 限制宽度在一定范围内最小宽度为200 | |
| 2699 | + if (newWidth < 200) { | |
| 2700 | + setContainerWidth(200); | |
| 2701 | + return; | |
| 2702 | + } | |
| 2703 | + setContainerWidth(newWidth); | |
| 2704 | + }; | |
| 2705 | + const handleMouseUp = () => { | |
| 2706 | + setIsDragging(false); | |
| 2707 | + document.removeEventListener("mousemove", handleMouseMove); | |
| 2708 | + document.removeEventListener("mouseup", handleMouseUp); | |
| 2709 | + }; | |
| 2710 | + | |
| 2711 | + useEffect(() => { | |
| 2712 | + document.addEventListener("mousemove", handleMouseMove); | |
| 2713 | + document.addEventListener("mouseup", handleMouseUp); | |
| 2714 | + return () => { | |
| 2715 | + document.removeEventListener("mousemove", handleMouseMove); | |
| 2716 | + document.removeEventListener("mouseup", handleMouseUp); | |
| 2717 | + }; | |
| 2718 | + }, [isDragging]); | |
| 2719 | + return ( | |
| 2720 | + <Form> | |
| 2721 | + <Layout> | |
| 2722 | + <Header className={styles.header}> | |
| 2723 | + <div className="billToolBar"> | |
| 2724 | + <Toolbar | |
| 2725 | + {...props} | |
| 2726 | + className="billBtnGroup btnGroupHasImport" | |
| 2727 | + style={{ backgroundColor: "#646464", color: "rgb(255,255,255)" }} | |
| 2728 | + pageFrom="billList" | |
| 2729 | + /> | |
| 2730 | + </div> | |
| 2731 | + {commonUtils.isNotEmptyArr(ImportData) ? ( | |
| 2732 | + <div id="btnImportData" className={`importData ${props.enabled}`}> | |
| 2733 | + <Upload {...outProps}> | |
| 2734 | + <UploadOutlined /> | |
| 2735 | + {BtnimportData} | |
| 2736 | + <Button {...uploadPropsSales} /> | |
| 2737 | + </Upload> | |
| 2738 | + </div> | |
| 2739 | + ) : ( | |
| 2740 | + "" | |
| 2741 | + )} | |
| 2742 | + </Header> | |
| 2743 | + | |
| 2744 | + <Layout className={styles.clayout} style={flexRowStyle}> | |
| 2745 | + <Content className={styles.content} style={flexContentStyle}> | |
| 2746 | + <div | |
| 2747 | + style={{ | |
| 2748 | + border: "1px solid #c2c3c5", | |
| 2749 | + margin: "0 8px", | |
| 2750 | + marginTop: 8, | |
| 2751 | + backgroundColor: "#fff", | |
| 2752 | + }} | |
| 2753 | + > | |
| 2754 | + <div className="bill-search-group" style={{ display: 'flex' }}> | |
| 2755 | + <div style={{ flex: 1 }}> | |
| 2756 | + <CommonView {...props} /> | |
| 2757 | + </div> | |
| 2758 | + { | |
| 2759 | + ["contacts"].includes(props.sModelsType) && ( | |
| 2760 | + <img | |
| 2761 | + style={{ width: 202 / 1.336, height: 202, margin: '5px 5px 0 -40px' }} | |
| 2762 | + src={`${commonConfig.file_host}file/download?savePathStr=${props.masterData?.sPicturePath}&sModelsId=100&token=${props.token}`} | |
| 2763 | + onError={event => { | |
| 2764 | + event.target.src = userImgs; | |
| 2765 | + }} | |
| 2766 | + /> | |
| 2767 | + ) | |
| 2768 | + } | |
| 2769 | + </div> | |
| 2770 | + </div> | |
| 2771 | + {props.sModelsType === "element/workcalendar" ? ( | |
| 2772 | + <div className={`${styles.bShow}`}> | |
| 2773 | + <div> | |
| 2774 | + <Avatar src={props.imgSrc} /> | |
| 2775 | + </div> | |
| 2776 | + <WorkCalendar {...props} /> | |
| 2777 | + </div> | |
| 2778 | + ) : ( | |
| 2779 | + <div | |
| 2780 | + id="slaveTabs" | |
| 2781 | + className={`${styles.bShow} commonNewBillContainer`} | |
| 2782 | + ref={ref => { | |
| 2783 | + _this.slaveTabsRef = ref; | |
| 2784 | + }} | |
| 2785 | + > | |
| 2786 | + <div> | |
| 2787 | + {props.imgSrc && <Avatar src={props.imgSrc} />} | |
| 2788 | + </div> | |
| 2789 | + <Tabs activeKey={props.currentTab} onChange={props.onTabChange} className={styles.slaveTabs} tabBarStyle={{ margin: "0 8px" }}> | |
| 2790 | + {commonUtils.isNotEmptyArr(diliverConfigTypeArr1) | |
| 2791 | + ? diliverConfigTypeArr1.map(item => { | |
| 2792 | + // 匹配数字 | |
| 2793 | + // eslint-disable-next-line no-unused-vars | |
| 2794 | + let num = item.replace(/[^\d]/g, "").trim(); | |
| 2795 | + let tabName = item.replace(/\d+/g, ""); | |
| 2796 | + /* 从主表配置 找到控件名=tabName,否则取他的showName */ | |
| 2797 | + const tableConfigArr = masterConfig?.gdsconfigformslave.filter(row => row.sControlName === item.trim()); | |
| 2798 | + if (commonUtils.isNotEmptyArr(tableConfigArr)) { | |
| 2799 | + tabName = tableConfigArr[0].showName; | |
| 2800 | + } | |
| 2801 | + return ( | |
| 2802 | + <TabPane tab={tabName} key={num} className="xly-bill-list"> | |
| 2803 | + <div> | |
| 2804 | + <CommonView | |
| 2805 | + {...props} | |
| 2806 | + // 使高度和从表高度一直 | |
| 2807 | + // isAutoHeight="ture" | |
| 2808 | + tableConfigType={item} | |
| 2809 | + tableConfigTypeArr={diliverConfigTypeArr} | |
| 2810 | + /> | |
| 2811 | + </div> | |
| 2812 | + </TabPane> | |
| 2813 | + ); | |
| 2814 | + }) | |
| 2815 | + : ""} | |
| 2816 | + {onlySlave ? ( | |
| 2817 | + <> | |
| 2818 | + <TabPane tab={slaveInfo} className="xly-bill-list" key={10}> | |
| 2819 | + <div className="TabPaneStyle"> | |
| 2820 | + {app.currentPane.title !== "功能模块界面设置单据" ? ( | |
| 2821 | + <Row gutter={[8, 0]}> | |
| 2822 | + <Col span={showAll ? 24 : iColValueTable} order={iShowOrder}> | |
| 2823 | + <StaticEditTable | |
| 2824 | + {...slaveTableProps} | |
| 2825 | + noVlist | |
| 2826 | + setOpterationColumn={props.sModelsType !== "cost/cosexpenseshare" && sModelsType !== listType && !bCheck ? "Y" : ""} | |
| 2827 | + /> | |
| 2828 | + </Col> | |
| 2829 | + {!bControlSeparateTab && <CommonViewTable {...slaveViewProps} />} | |
| 2830 | + </Row> | |
| 2831 | + ) : ( | |
| 2832 | + <div className="SetModelTable"> | |
| 2833 | + <div | |
| 2834 | + style={{ | |
| 2835 | + width: `${containerWidth}px`, | |
| 2836 | + marginRight: "10px", | |
| 2837 | + borderRight: "1px solid #e8e8e8", | |
| 2838 | + paddingRight: "4px", | |
| 2839 | + position: "relative", | |
| 2840 | + maxWidth: "100%", | |
| 2841 | + }} | |
| 2842 | + ref={containerRef} | |
| 2843 | + > | |
| 2844 | + <div | |
| 2845 | + ref={dividerRef} | |
| 2846 | + style={{ | |
| 2847 | + position: "absolute", | |
| 2848 | + right: "-5px", | |
| 2849 | + top: "0", | |
| 2850 | + bottom: "0", | |
| 2851 | + width: "10px", | |
| 2852 | + cursor: "col-resize", | |
| 2853 | + background: "linear-gradient(to right, transparent, #e8e8e8, transparent)", | |
| 2854 | + }} | |
| 2855 | + onMouseDown={handleMouseDown} | |
| 2856 | + /> | |
| 2857 | + <StaticEditTable | |
| 2858 | + {...slaveTableProps} | |
| 2859 | + noVlist | |
| 2860 | + setOpterationColumn={props.sModelsType !== "cost/cosexpenseshare" && sModelsType !== listType && !bCheck ? "Y" : ""} | |
| 2861 | + /> | |
| 2862 | + </div> | |
| 2863 | + {!bControlSeparateTab && <CommonViewTable {...slaveViewProps} style={{ flex: 1 }} />} | |
| 2864 | + </div> | |
| 2865 | + )} | |
| 2866 | + </div> | |
| 2867 | + </TabPane> | |
| 2868 | + {bControlSeparateTab && ( | |
| 2869 | + <TabPane tab={separateTabName} className="xly-bill-list" key={11}> | |
| 2870 | + <CommonViewTable {...slaveViewProps} iColValueView={24} /> | |
| 2871 | + </TabPane> | |
| 2872 | + )} | |
| 2873 | + </> | |
| 2874 | + ) : ( | |
| 2875 | + "" | |
| 2876 | + )} | |
| 2877 | + {commonUtils.isNotEmptyArr(diliverConfigTypeArr2) | |
| 2878 | + ? diliverConfigTypeArr2.map(item => { | |
| 2879 | + // 匹配数字 | |
| 2880 | + // eslint-disable-next-line no-unused-vars | |
| 2881 | + let num = item.replace(/[^\d]/g, "").trim(); | |
| 2882 | + let tabName = item.replace(/\d+/g, ""); | |
| 2883 | + /* 从主表配置 找到控件名=tabName,否则取他的showName */ | |
| 2884 | + const tableConfigArr = masterConfig?.gdsconfigformslave.filter(row => row.sControlName === item.trim()); | |
| 2885 | + if (commonUtils.isNotEmptyArr(tableConfigArr)) { | |
| 2886 | + tabName = tableConfigArr[0].showName; | |
| 2887 | + } | |
| 2888 | + return ( | |
| 2889 | + <TabPane tab={tabName} key={num} className="xly-bill-list"> | |
| 2890 | + <div> | |
| 2891 | + <CommonView | |
| 2892 | + {...props} | |
| 2893 | + // 使高度和从表高度一直 | |
| 2894 | + // isAutoHeight="ture" | |
| 2895 | + tableConfigType={item} | |
| 2896 | + tableConfigTypeArr={diliverConfigTypeArr2} | |
| 2897 | + /> | |
| 2898 | + </div> | |
| 2899 | + </TabPane> | |
| 2900 | + ); | |
| 2901 | + }) | |
| 2902 | + : ""} | |
| 2903 | + {onlySlave0 ? ( | |
| 2904 | + <> | |
| 2905 | + <TabPane tab={materialsInfo} className="xly-bill-list" key={20}> | |
| 2906 | + <div className="TabPaneStyle"> | |
| 2907 | + {app.currentPane.title !== "功能模块界面设置单据" ? ( | |
| 2908 | + <Row gutter={[8, 0]}> | |
| 2909 | + <Col span={showAll0 ? 24 : iColValueTable0} order={iShowOrder0}> | |
| 2910 | + <StaticEditTable | |
| 2911 | + {...slave0TableProps} | |
| 2912 | + noVlist | |
| 2913 | + setOpterationColumn={sModelsType !== listType && !bCheck0 ? "Y" : ""} | |
| 2914 | + /> | |
| 2915 | + </Col> | |
| 2916 | + {!bControlSeparateTab0 && <CommonViewTable {...slave0ViewProps} />} | |
| 2917 | + {getChildTableComponent(props, "slave0")} | |
| 2918 | + </Row> | |
| 2919 | + ) : ( | |
| 2920 | + <div className="SetModelTable"> | |
| 2921 | + <div | |
| 2922 | + style={{ | |
| 2923 | + width: `${containerWidth}px`, | |
| 2924 | + marginRight: "10px", | |
| 2925 | + borderRight: "1px solid #e8e8e8", | |
| 2926 | + paddingRight: "4px", | |
| 2927 | + position: "relative", | |
| 2928 | + maxWidth: "100%", | |
| 2929 | + }} | |
| 2930 | + ref={containerRef} | |
| 2931 | + > | |
| 2932 | + <div | |
| 2933 | + ref={dividerRef} | |
| 2934 | + style={{ | |
| 2935 | + position: "absolute", | |
| 2936 | + right: "-5px", | |
| 2937 | + top: "0", | |
| 2938 | + bottom: "0", | |
| 2939 | + width: "10px", | |
| 2940 | + cursor: "col-resize", | |
| 2941 | + background: "linear-gradient(to right, transparent, #e8e8e8, transparent)", | |
| 2942 | + }} | |
| 2943 | + onMouseDown={handleMouseDown} | |
| 2944 | + /> | |
| 2945 | + <StaticEditTable | |
| 2946 | + {...slave0TableProps} | |
| 2947 | + noVlist | |
| 2948 | + setOpterationColumn={sModelsType !== listType && !bCheck0 ? "Y" : ""} | |
| 2949 | + /> | |
| 2950 | + </div> | |
| 2951 | + {!bControlSeparateTab0 && <CommonViewTable {...slave0ViewProps} style={{ flex: 1 }} />} | |
| 2952 | + </div> | |
| 2953 | + )} | |
| 2954 | + </div> | |
| 2955 | + </TabPane> | |
| 2956 | + {bControlSeparateTab0 && ( | |
| 2957 | + <TabPane tab={separateTabName0} className="xly-bill-list" key={21}> | |
| 2958 | + <CommonViewTable {...slave0ViewProps} iColValueView={24} /> | |
| 2959 | + </TabPane> | |
| 2960 | + )} | |
| 2961 | + </> | |
| 2962 | + ) : ( | |
| 2963 | + "" | |
| 2964 | + )} | |
| 2965 | + {commonUtils.isNotEmptyArr(diliverConfigTypeArr3) | |
| 2966 | + ? diliverConfigTypeArr3.map(item => { | |
| 2967 | + // 匹配数字 | |
| 2968 | + // eslint-disable-next-line no-unused-vars | |
| 2969 | + let num = item.replace(/[^\d]/g, "").trim(); | |
| 2970 | + let tabName = item.replace(/\d+/g, ""); | |
| 2971 | + /* 从主表配置 找到控件名=tabName,否则取他的showName */ | |
| 2972 | + const tableConfigArr = masterConfig?.gdsconfigformslave.filter(row => row.sControlName === item.trim()); | |
| 2973 | + if (commonUtils.isNotEmptyArr(tableConfigArr)) { | |
| 2974 | + tabName = tableConfigArr[0].showName; | |
| 2975 | + } | |
| 2976 | + return ( | |
| 2977 | + <TabPane tab={tabName} key={num} className="xly-bill-list"> | |
| 2978 | + <div> | |
| 2979 | + <CommonView | |
| 2980 | + {...props} | |
| 2981 | + // 使高度和从表高度一直 | |
| 2982 | + // isAutoHeight="ture" | |
| 2983 | + tableConfigType={item} | |
| 2984 | + tableConfigTypeArr={diliverConfigTypeArr3} | |
| 2985 | + /> | |
| 2986 | + </div> | |
| 2987 | + </TabPane> | |
| 2988 | + ); | |
| 2989 | + }) | |
| 2990 | + : ""} | |
| 2991 | + {onlySlave1 ? ( | |
| 2992 | + <> | |
| 2993 | + <TabPane tab={checkInfo} className="xly-bill-list" key={30}> | |
| 2994 | + <div className="TabPaneStyle"> | |
| 2995 | + {props.app.currentPane.title !== "功能模块界面设置单据" ? ( | |
| 2996 | + <div> | |
| 2997 | + <Row gutter={[8, 0]}> | |
| 2998 | + <Col span={showAll1 ? 24 : iColValueTable1} order={iShowOrder1}> | |
| 2999 | + <StaticEditTable | |
| 3000 | + {...slave1TableProps} | |
| 3001 | + noVlist | |
| 3002 | + setOpterationColumn={sModelsType !== listType && !bCheck1 ? "Y" : ""} | |
| 3003 | + /> | |
| 3004 | + </Col> | |
| 3005 | + {!bControlSeparateTab1 && <CommonViewTable {...slave1ViewProps} />} | |
| 3006 | + {getChildTableComponent(props, "slave1")} | |
| 3007 | + </Row> | |
| 3008 | + {/* <Row gutter={[8, 0]}> | |
| 3009 | + {slave2Config && slave2Config.sChinese === '上批对比' && <CommonViewTable {...slave2ViewProps} />} | |
| 3010 | + </Row> */} | |
| 3011 | + </div> | |
| 3012 | + ) : ( | |
| 3013 | + <div className="SetModelTable"> | |
| 3014 | + <div | |
| 3015 | + style={{ | |
| 3016 | + width: `${containerWidth}px`, | |
| 3017 | + marginRight: "10px", | |
| 3018 | + borderRight: "1px solid #e8e8e8", | |
| 3019 | + paddingRight: "4px", | |
| 3020 | + position: "relative", | |
| 3021 | + maxWidth: "100%", | |
| 3022 | + }} | |
| 3023 | + ref={containerRef} | |
| 3024 | + > | |
| 3025 | + <div | |
| 3026 | + ref={dividerRef} | |
| 3027 | + style={{ | |
| 3028 | + position: "absolute", | |
| 3029 | + right: "-5px", | |
| 3030 | + top: "0", | |
| 3031 | + bottom: "0", | |
| 3032 | + width: "10px", | |
| 3033 | + cursor: "col-resize", | |
| 3034 | + background: "linear-gradient(to right, transparent, #e8e8e8, transparent)", | |
| 3035 | + }} | |
| 3036 | + onMouseDown={handleMouseDown} | |
| 3037 | + /> | |
| 3038 | + <StaticEditTable | |
| 3039 | + {...slave1TableProps} | |
| 3040 | + noVlist | |
| 3041 | + setOpterationColumn={sModelsType !== listType && !bCheck0 ? "Y" : ""} | |
| 3042 | + /> | |
| 3043 | + </div> | |
| 3044 | + {!bControlSeparateTab1 && <CommonViewTable {...slave1ViewProps} style={{ flex: 1 }} />} | |
| 3045 | + </div> | |
| 3046 | + )} | |
| 3047 | + </div> | |
| 3048 | + </TabPane> | |
| 3049 | + {bControlSeparateTab1 && ( | |
| 3050 | + <TabPane tab={separateTabName1} className="xly-bill-list" key={31}> | |
| 3051 | + <CommonViewTable {...slave1ViewProps} iColValueView={24} /> | |
| 3052 | + </TabPane> | |
| 3053 | + )} | |
| 3054 | + </> | |
| 3055 | + ) : ( | |
| 3056 | + "" | |
| 3057 | + )} | |
| 3058 | + {commonUtils.isNotEmptyArr(diliverConfigTypeArr4) | |
| 3059 | + ? diliverConfigTypeArr4.map(item => { | |
| 3060 | + // 匹配数字 | |
| 3061 | + // eslint-disable-next-line no-unused-vars | |
| 3062 | + let num = item.replace(/[^\d]/g, "").trim(); | |
| 3063 | + let tabName = item.replace(/\d+/g, ""); | |
| 3064 | + /* 从主表配置 找到控件名=tabName,否则取他的showName */ | |
| 3065 | + const tableConfigArr = masterConfig?.gdsconfigformslave.filter(row => row.sControlName === item.trim()); | |
| 3066 | + if (commonUtils.isNotEmptyArr(tableConfigArr)) { | |
| 3067 | + tabName = tableConfigArr[0].showName; | |
| 3068 | + } | |
| 3069 | + return ( | |
| 3070 | + <TabPane tab={tabName} key={num} className="xly-bill-list"> | |
| 3071 | + <div> | |
| 3072 | + <CommonView | |
| 3073 | + {...props} | |
| 3074 | + // 使高度和从表高度一直 | |
| 3075 | + // isAutoHeight="ture" | |
| 3076 | + tableConfigType={item} | |
| 3077 | + tableConfigTypeArr={diliverConfigTypeArr4} | |
| 3078 | + /> | |
| 3079 | + </div> | |
| 3080 | + </TabPane> | |
| 3081 | + ); | |
| 3082 | + }) | |
| 3083 | + : ""} | |
| 3084 | + {onlyslave2 ? ( | |
| 3085 | + <> | |
| 3086 | + <TabPane tab={slaveInfo0} className="xly-bill-list" key={40}> | |
| 3087 | + <div className="TabPaneStyle"> | |
| 3088 | + <Row gutter={[8, 0]}> | |
| 3089 | + <Col span={showAll2 ? 24 : iColValueTable2} order={iShowOrder2}> | |
| 3090 | + <StaticEditTable {...slave2TableProps} noVlist setOpterationColumn={sModelsType !== listType && !bCheck2 ? "Y" : ""} /> | |
| 3091 | + </Col> | |
| 3092 | + {!bControlSeparateTab2 && <CommonViewTable {...slave2ViewProps} />} | |
| 3093 | + {getChildTableComponent(props, "slave2")} | |
| 3094 | + </Row> | |
| 3095 | + </div> | |
| 3096 | + </TabPane> | |
| 3097 | + {bControlSeparateTab2 && ( | |
| 3098 | + <TabPane tab={separateTabName2} className="xly-bill-list" key={41}> | |
| 3099 | + <CommonViewTable {...slave2ViewProps} iColValueView={24} /> | |
| 3100 | + </TabPane> | |
| 3101 | + )} | |
| 3102 | + </> | |
| 3103 | + ) : ( | |
| 3104 | + "" | |
| 3105 | + )} | |
| 3106 | + {commonUtils.isNotEmptyArr(diliverConfigTypeArr5) | |
| 3107 | + ? diliverConfigTypeArr5.map(item => { | |
| 3108 | + // 匹配数字 | |
| 3109 | + // eslint-disable-next-line no-unused-vars | |
| 3110 | + let num = item.replace(/[^\d]/g, "").trim(); | |
| 3111 | + let tabName = item.replace(/\d+/g, ""); | |
| 3112 | + /* 从主表配置 找到控件名=tabName,否则取他的showName */ | |
| 3113 | + const tableConfigArr = masterConfig?.gdsconfigformslave.filter(row => row.sControlName === item.trim()); | |
| 3114 | + if (commonUtils.isNotEmptyArr(tableConfigArr)) { | |
| 3115 | + tabName = tableConfigArr[0].showName; | |
| 3116 | + } | |
| 3117 | + return ( | |
| 3118 | + <TabPane tab={tabName} key={num} className="xly-bill-list"> | |
| 3119 | + <div> | |
| 3120 | + <CommonView | |
| 3121 | + {...props} | |
| 3122 | + // 使高度和从表高度一直 | |
| 3123 | + // isAutoHeight="ture" | |
| 3124 | + tableConfigType={item} | |
| 3125 | + tableConfigTypeArr={diliverConfigTypeArr5} | |
| 3126 | + /> | |
| 3127 | + </div> | |
| 3128 | + </TabPane> | |
| 3129 | + ); | |
| 3130 | + }) | |
| 3131 | + : ""} | |
| 3132 | + {onlyslave3 ? ( | |
| 3133 | + <> | |
| 3134 | + <TabPane tab={slaveInfo1} className="xly-bill-list" key={50}> | |
| 3135 | + <div className="TabPaneStyle"> | |
| 3136 | + <Row gutter={[8, 0]}> | |
| 3137 | + <Col span={showAll3 ? 24 : iColValueTable3} order={iShowOrder3}> | |
| 3138 | + <StaticEditTable {...slave3TableProps} noVlist setOpterationColumn={sModelsType !== listType ? "Y" : ""} /> | |
| 3139 | + </Col> | |
| 3140 | + {!bControlSeparateTab3 && <CommonViewTable {...slave3ViewProps} />} | |
| 3141 | + {getChildTableComponent(props, "slave3")} | |
| 3142 | + </Row> | |
| 3143 | + </div> | |
| 3144 | + </TabPane> | |
| 3145 | + {bControlSeparateTab3 && ( | |
| 3146 | + <TabPane tab={separateTabName3} className="xly-bill-list" key={51}> | |
| 3147 | + <CommonViewTable {...slave3ViewProps} iColValueView={24} /> | |
| 3148 | + </TabPane> | |
| 3149 | + )} | |
| 3150 | + </> | |
| 3151 | + ) : ( | |
| 3152 | + "" | |
| 3153 | + )} | |
| 3154 | + {commonUtils.isNotEmptyArr(diliverConfigTypeArr6) | |
| 3155 | + ? diliverConfigTypeArr6.map(item => { | |
| 3156 | + // 匹配数字 | |
| 3157 | + // eslint-disable-next-line no-unused-vars | |
| 3158 | + let num = item.replace(/[^\d]/g, "").trim(); | |
| 3159 | + let tabName = item.replace(/\d+/g, ""); | |
| 3160 | + /* 从主表配置 找到控件名=tabName,否则取他的showName */ | |
| 3161 | + const tableConfigArr = masterConfig?.gdsconfigformslave.filter(row => row.sControlName === item.trim()); | |
| 3162 | + if (commonUtils.isNotEmptyArr(tableConfigArr)) { | |
| 3163 | + tabName = tableConfigArr[0].showName; | |
| 3164 | + } | |
| 3165 | + return ( | |
| 3166 | + <TabPane tab={tabName} key={num} className="xly-bill-list"> | |
| 3167 | + <div> | |
| 3168 | + <CommonView | |
| 3169 | + {...props} | |
| 3170 | + // 使高度和从表高度一直 | |
| 3171 | + // isAutoHeight="ture" | |
| 3172 | + tableConfigType={item} | |
| 3173 | + tableConfigTypeArr={diliverConfigTypeArr6} | |
| 3174 | + /> | |
| 3175 | + </div> | |
| 3176 | + </TabPane> | |
| 3177 | + ); | |
| 3178 | + }) | |
| 3179 | + : ""} | |
| 3180 | + {onlyslave4 ? ( | |
| 3181 | + <> | |
| 3182 | + <TabPane tab={slaveInfo2} className="xly-bill-list" key={60}> | |
| 3183 | + <div className="TabPaneStyle"> | |
| 3184 | + <Row gutter={[8, 0]}> | |
| 3185 | + <Col span={showAll4 ? 24 : iColValueTable4} order={iShowOrder4}> | |
| 3186 | + <StaticEditTable {...slave4TableProps} setOpterationColumn={sModelsType !== listType ? "Y" : ""} /> | |
| 3187 | + </Col> | |
| 3188 | + {!bControlSeparateTab4 && <CommonViewTable {...slave4ViewProps} />} | |
| 3189 | + {getChildTableComponent(props, "slave4")} | |
| 3190 | + </Row> | |
| 3191 | + </div> | |
| 3192 | + </TabPane> | |
| 3193 | + {bControlSeparateTab4 && ( | |
| 3194 | + <TabPane tab={separateTabName4} className="xly-bill-list" key={61}> | |
| 3195 | + <CommonViewTable {...slave4ViewProps} iColValueView={24} /> | |
| 3196 | + </TabPane> | |
| 3197 | + )} | |
| 3198 | + </> | |
| 3199 | + ) : ( | |
| 3200 | + "" | |
| 3201 | + )} | |
| 3202 | + {onlyslave5 ? ( | |
| 3203 | + <> | |
| 3204 | + <TabPane tab={slaveInfo3} className="xly-bill-list" key={70}> | |
| 3205 | + <div className="TabPaneStyle"> | |
| 3206 | + <Row gutter={[8, 0]}> | |
| 3207 | + <Col span={showAll4 ? 24 : iColValueTable4} order={iShowOrder4}> | |
| 3208 | + <StaticEditTable {...slave5TableProps} setOpterationColumn={sModelsType !== listType ? "Y" : ""} /> | |
| 3209 | + </Col> | |
| 3210 | + <CommonViewTable {...slave4ViewProps} /> | |
| 3211 | + </Row> | |
| 3212 | + </div> | |
| 3213 | + </TabPane> | |
| 3214 | + </> | |
| 3215 | + ) : ( | |
| 3216 | + "" | |
| 3217 | + )} | |
| 3218 | + {onlyslave6 ? ( | |
| 3219 | + <> | |
| 3220 | + <TabPane tab={slaveInfo4} className="xly-bill-list" key={80}> | |
| 3221 | + <div className="TabPaneStyle"> | |
| 3222 | + <Row gutter={[8, 0]}> | |
| 3223 | + <Col span={showAll4 ? 24 : iColValueTable4} order={iShowOrder4}> | |
| 3224 | + <StaticEditTable {...slave6TableProps} setOpterationColumn={sModelsType !== listType ? "Y" : ""} /> | |
| 3225 | + </Col> | |
| 3226 | + <CommonViewTable {...slave4ViewProps} /> | |
| 3227 | + </Row> | |
| 3228 | + </div> | |
| 3229 | + </TabPane> | |
| 3230 | + </> | |
| 3231 | + ) : ( | |
| 3232 | + "" | |
| 3233 | + )} | |
| 3234 | + {onlyslave7 ? ( | |
| 3235 | + <> | |
| 3236 | + <TabPane tab={slaveInfo5} className="xly-bill-list" key={90}> | |
| 3237 | + <div className="TabPaneStyle"> | |
| 3238 | + <Row gutter={[8, 0]}> | |
| 3239 | + <Col span={showAll4 ? 24 : iColValueTable4} order={iShowOrder4}> | |
| 3240 | + <StaticEditTable {...slave7TableProps} setOpterationColumn={sModelsType !== listType ? "Y" : ""} /> | |
| 3241 | + </Col> | |
| 3242 | + <CommonViewTable {...slave4ViewProps} /> | |
| 3243 | + </Row> | |
| 3244 | + </div> | |
| 3245 | + </TabPane> | |
| 3246 | + </> | |
| 3247 | + ) : ( | |
| 3248 | + "" | |
| 3249 | + )} | |
| 3250 | + {onlyslave8 ? ( | |
| 3251 | + <> | |
| 3252 | + <TabPane tab={slaveInfo6} className="xly-bill-list" key={100}> | |
| 3253 | + <div className="TabPaneStyle"> | |
| 3254 | + <Row gutter={[8, 0]}> | |
| 3255 | + <Col span={showAll4 ? 24 : iColValueTable4} order={iShowOrder4}> | |
| 3256 | + <StaticEditTable {...slave8TableProps} setOpterationColumn={sModelsType !== listType ? "Y" : ""} /> | |
| 3257 | + </Col> | |
| 3258 | + <CommonViewTable {...slave4ViewProps} /> | |
| 3259 | + </Row> | |
| 3260 | + </div> | |
| 3261 | + </TabPane> | |
| 3262 | + </> | |
| 3263 | + ) : ( | |
| 3264 | + "" | |
| 3265 | + )} | |
| 3266 | + {onlyslave9 ? ( | |
| 3267 | + <> | |
| 3268 | + <TabPane tab={slaveInfo7} className="xly-bill-list" key={110}> | |
| 3269 | + <div className="TabPaneStyle"> | |
| 3270 | + <Row gutter={[8, 0]}> | |
| 3271 | + <Col span={showAll4 ? 24 : iColValueTable4} order={iShowOrder4}> | |
| 3272 | + <StaticEditTable {...slave9TableProps} setOpterationColumn={sModelsType !== listType ? "Y" : ""} /> | |
| 3273 | + </Col> | |
| 3274 | + <CommonViewTable {...slave4ViewProps} /> | |
| 3275 | + </Row> | |
| 3276 | + </div> | |
| 3277 | + </TabPane> | |
| 3278 | + </> | |
| 3279 | + ) : ( | |
| 3280 | + "" | |
| 3281 | + )} | |
| 3282 | + {onlyslave10 ? ( | |
| 3283 | + <> | |
| 3284 | + <TabPane tab={slaveInfo8} className="xly-bill-list" key={150}> | |
| 3285 | + <div className="TabPaneStyle"> | |
| 3286 | + <Row gutter={[8, 0]}> | |
| 3287 | + <Col span={showAll4 ? 24 : iColValueTable4} order={iShowOrder4}> | |
| 3288 | + <StaticEditTable {...slave10TableProps} setOpterationColumn={sModelsType !== listType ? "Y" : ""} /> | |
| 3289 | + </Col> | |
| 3290 | + <CommonViewTable {...slave4ViewProps} /> | |
| 3291 | + </Row> | |
| 3292 | + </div> | |
| 3293 | + </TabPane> | |
| 3294 | + </> | |
| 3295 | + ) : ( | |
| 3296 | + "" | |
| 3297 | + )} | |
| 3298 | + </Tabs> | |
| 3299 | + </div> | |
| 3300 | + )} | |
| 3301 | + </Content> | |
| 3302 | + {bFlow ? ( | |
| 3303 | + <div | |
| 3304 | + id="examInfo" | |
| 3305 | + style={{ width: "25%", textAlign: "center", height: "900px", maxHeight: "calc(100vh - 130px)", backgroundColor: "#f0f0f0" }} | |
| 3306 | + > | |
| 3307 | + <CommonExamInfo {...props} /> | |
| 3308 | + </div> | |
| 3309 | + ) : ( | |
| 3310 | + "" | |
| 3311 | + )} | |
| 3312 | + {props.productProcessInfoChooseVisible ? ( | |
| 3313 | + <AntdDraggableModal | |
| 3314 | + width={1200} | |
| 3315 | + title={processCardSearchResult} | |
| 3316 | + visible={props.productProcessInfoChooseVisible} | |
| 3317 | + onCancel={props.onCancelProductProcessInfoChooseModal} | |
| 3318 | + footer={null} | |
| 3319 | + > | |
| 3320 | + <CommonListSelect {...productProcessInfoType} /> | |
| 3321 | + </AntdDraggableModal> | |
| 3322 | + ) : ( | |
| 3323 | + "" | |
| 3324 | + )} | |
| 3325 | + {props.showImportErrorVisible ? ( | |
| 3326 | + <AntdDraggableModal | |
| 3327 | + width={1480} | |
| 3328 | + zIndex={1000} | |
| 3329 | + title={importExcelTitle} | |
| 3330 | + bodyStyle={{ height: "450px" }} | |
| 3331 | + visible={props.showImportErrorVisible} | |
| 3332 | + onCancel={props.handleCancelModal.bind(this, "showImportErrorVisible")} | |
| 3333 | + onOk={props.handleCancelModal.bind(this, "showImportErrorVisible")} | |
| 3334 | + onSaveState={props.onSaveState} | |
| 3335 | + // footer={null} | |
| 3336 | + > | |
| 3337 | + <StaticEditTable {...importExcelProps} /> | |
| 3338 | + </AntdDraggableModal> | |
| 3339 | + ) : ( | |
| 3340 | + "" | |
| 3341 | + )} | |
| 3342 | + {false && props.sParamsModalVisible ? ( | |
| 3343 | + <AntdDraggableModal | |
| 3344 | + width="920px" | |
| 3345 | + className="paramModal" | |
| 3346 | + title={sProcessParams} | |
| 3347 | + visible={props.sParamsModalVisible} | |
| 3348 | + onOk={props.onParamsOk} | |
| 3349 | + onCancel={props.onCancelModal.bind(this, "sParamsModalVisible")} | |
| 3350 | + // footer={null} | |
| 3351 | + > | |
| 3352 | + <div className="xly-bill-list"> | |
| 3353 | + <StaticEditTable {...sParamProps} footer="hidden" noVlist /> | |
| 3354 | + </div> | |
| 3355 | + </AntdDraggableModal> | |
| 3356 | + ) : ( | |
| 3357 | + "" | |
| 3358 | + )} | |
| 3359 | + | |
| 3360 | + {false && props.sParamsNewModalVisible ? ( | |
| 3361 | + <AntdDraggableModal | |
| 3362 | + width="920px" | |
| 3363 | + className="paramModal" | |
| 3364 | + title={sProcessParamsNew} | |
| 3365 | + visible={props.sParamsNewModalVisible} | |
| 3366 | + onOk={props.onParamsNewOk} | |
| 3367 | + onCancel={props.onCancelModal.bind(this, "sParamsNewModalVisible")} | |
| 3368 | + // footer={null} | |
| 3369 | + > | |
| 3370 | + <div className="xly-bill-list"> | |
| 3371 | + <StaticEditTable {...sParamNewProps} footer="hidden" noVlist /> | |
| 3372 | + </div> | |
| 3373 | + </AntdDraggableModal> | |
| 3374 | + ) : ( | |
| 3375 | + "" | |
| 3376 | + )} | |
| 3377 | + | |
| 3378 | + {props.contextMenuModalVisible ? <ContextMenuModal {...props} /> : ""} | |
| 3379 | + {props.visibleInstructField ? ( | |
| 3380 | + <AntdDraggableModal width="1500px" className="paramModal" title="JSON格式化" visible={props.visibleInstructField} footer={null}> | |
| 3381 | + <div> | |
| 3382 | + <JsonFormatter | |
| 3383 | + onJsonFormatOk={props.onJsonModalOk} | |
| 3384 | + onJsonFormatCancel={props.onCancelModal.bind(this, "visibleInstructField")} | |
| 3385 | + initialJsonString={sInstructJsonString} | |
| 3386 | + /> | |
| 3387 | + </div> | |
| 3388 | + </AntdDraggableModal> | |
| 3389 | + ) : ( | |
| 3390 | + "" | |
| 3391 | + )} | |
| 3392 | + <div> | |
| 3393 | + <AssignmentField {...assignmentFieldProps} /> | |
| 3394 | + </div> | |
| 3395 | + <ModalComponent {...props} /> | |
| 3396 | + <CommonEffectEvent {...props} /> | |
| 3397 | + </Layout> | |
| 3398 | + </Layout> | |
| 3399 | + </Form> | |
| 3400 | + ); | |
| 3401 | +}); | |
| 3402 | + | |
| 3403 | +// 函数式组件 | |
| 3404 | +const CommonEffectEvent = props => { | |
| 3405 | + const { masterData = {} } = props; | |
| 3406 | + const { sBmRule } = masterData; | |
| 3407 | + | |
| 3408 | + const [watchFields, setWatchFields] = useState([]); | |
| 3409 | + const preValue = useRef(""); | |
| 3410 | + | |
| 3411 | + useEffect(() => { | |
| 3412 | + if (!sBmRule) { | |
| 3413 | + setWatchFields([]); | |
| 3414 | + preValue.current = ""; | |
| 3415 | + return; | |
| 3416 | + } | |
| 3417 | + | |
| 3418 | + const sBmRuleObj = commonUtils.convertStrToObj(sBmRule); | |
| 3419 | + const { showName = "" } = sBmRuleObj; | |
| 3420 | + setWatchFields(showName.split(",")); | |
| 3421 | + }, [sBmRule]); | |
| 3422 | + | |
| 3423 | + useEffect(() => { | |
| 3424 | + if (!watchFields.length) return; | |
| 3425 | + const newValue = watchFields.map(key => masterData[key] || "").join(""); | |
| 3426 | + if (preValue.current === newValue) return; | |
| 3427 | + preValue.current = newValue; | |
| 3428 | + | |
| 3429 | + const sBmRuleObj = commonUtils.convertStrToObj(sBmRule); | |
| 3430 | + const addState = Object.keys(sBmRuleObj).filter(key => key !== "showName").reduce((result, key) => { | |
| 3431 | + const list = sBmRuleObj[key]?.split("+") || []; | |
| 3432 | + result[key] = list.map(item => item.trim().replace(/\'/g, '')).map(item => { | |
| 3433 | + if (item !== '.' && item?.includes('.')) { | |
| 3434 | + const [tableName, sFieldName] = item.split('.'); | |
| 3435 | + return props[`${tableName}Data`]?.[sFieldName] || ""; | |
| 3436 | + } | |
| 3437 | + return item; | |
| 3438 | + }).join(''); | |
| 3439 | + return result; | |
| 3440 | + }, {}); | |
| 3441 | + | |
| 3442 | + props.onSaveState({ | |
| 3443 | + masterData: { | |
| 3444 | + ...masterData, | |
| 3445 | + ...addState, | |
| 3446 | + handleType: masterData.handleType || 'update', | |
| 3447 | + } | |
| 3448 | + }); | |
| 3449 | + | |
| 3450 | + }, [watchFields, masterData]); | |
| 3451 | + | |
| 3452 | + return null; | |
| 3453 | +} | |
| 3454 | + | |
| 3455 | +// 工艺参数弹窗 | |
| 3456 | +const ModalComponent = props => { | |
| 3457 | + if (!props.sParamsModalVisible && !props.sParamsNewModalVisible) return ""; | |
| 3458 | + | |
| 3459 | + const sProcessParams = props.sParamsModalVisible ? "原工艺参数" : "工艺参数新"; | |
| 3460 | + const bVisible = props.sParamsModalVisible || props.sParamsNewModalVisible; | |
| 3461 | + return bVisible ? ( | |
| 3462 | + <AntdDraggableModal | |
| 3463 | + width="80%" | |
| 3464 | + className="commonParamDrag" | |
| 3465 | + title={sProcessParams} | |
| 3466 | + visible={bVisible} | |
| 3467 | + onCancel={() => { | |
| 3468 | + props.onSaveState({ | |
| 3469 | + sParamsModalVisible: false, | |
| 3470 | + sParamsNewModalVisible: false, | |
| 3471 | + }); | |
| 3472 | + }} | |
| 3473 | + footer={ | |
| 3474 | + // <div style={{display:'flex', justifyContent: 'space-between'}}> | |
| 3475 | + // <div className='oper'> | |
| 3476 | + // <Button type='primary' onClick={() => { handleBtnParamPage(props, props.processTableId, 'first')}} >首条</Button> | |
| 3477 | + // <Button type='primary' onClick={() => { handleBtnParamPage(props, props.processTableId, 'before')}} >上一条</Button> | |
| 3478 | + // <Button type='primary' onClick={() => { handleBtnParamPage(props, props.processTableId, 'next')}} >下一条</Button> | |
| 3479 | + // <Button type='primary' onClick={() => { handleBtnParamPage(props, props.processTableId, 'last')}} >末条</Button> | |
| 3480 | + // </div> | |
| 3481 | + | |
| 3482 | + // <div style={{ width: '20%'}}> | |
| 3483 | + // <Button | |
| 3484 | + // type="primary" | |
| 3485 | + // onClick={() => { | |
| 3486 | + // props.onSaveState({ [modalName]: false }); | |
| 3487 | + // }} | |
| 3488 | + // > | |
| 3489 | + // 确定 | |
| 3490 | + // </Button> | |
| 3491 | + // </div> | |
| 3492 | + | |
| 3493 | + // </div> | |
| 3494 | + <Button | |
| 3495 | + type="primary" | |
| 3496 | + onClick={() => { | |
| 3497 | + props.onSaveState({ | |
| 3498 | + sParamsModalVisible: false, | |
| 3499 | + sParamsNewModalVisible: false, | |
| 3500 | + }); | |
| 3501 | + }} | |
| 3502 | + > | |
| 3503 | + 确定 | |
| 3504 | + </Button> | |
| 3505 | + } | |
| 3506 | + > | |
| 3507 | + {[""].map(() => { | |
| 3508 | + const commonViewDragableProps = { | |
| 3509 | + ...props, | |
| 3510 | + hideTabsNav: true, | |
| 3511 | + comparedTableId: props.processTableId, | |
| 3512 | + sParamData: [ | |
| 3513 | + { | |
| 3514 | + sParamType: "sWorkOrder", | |
| 3515 | + sParamName: "工单参数", | |
| 3516 | + }, | |
| 3517 | + ], | |
| 3518 | + tableName: "slave", | |
| 3519 | + }; | |
| 3520 | + | |
| 3521 | + // 如果是工艺参数新 | |
| 3522 | + if (props.sParamsNewModalVisible) { | |
| 3523 | + const { slaveData = [] } = props; | |
| 3524 | + const slaveDataNew = lodash.cloneDeep(slaveData); | |
| 3525 | + slaveDataNew.forEach(item => { | |
| 3526 | + item.handleType = commonUtils.isEmpty(item.handleType) ? "update" : item.handleType; | |
| 3527 | + item.sParams = item.sParamsNew; | |
| 3528 | + item.sWorkOrderParams = item.sWorkOrderParamsNew; | |
| 3529 | + }); | |
| 3530 | + commonViewDragableProps.slaveData = slaveDataNew; | |
| 3531 | + commonViewDragableProps.onCostomSaveData = tableData => { | |
| 3532 | + const slaveDataTemp = lodash.cloneDeep(slaveData); | |
| 3533 | + slaveDataTemp.forEach(item => { | |
| 3534 | + const rowData = tableData.find(i => i.sId === item.sId); | |
| 3535 | + item.handleType = commonUtils.isEmpty(item.handleType) ? "update" : item.handleType; | |
| 3536 | + item.sParamsNew = rowData.sParams; | |
| 3537 | + item.sWorkOrderParamsNew = rowData.sWorkOrderParams; | |
| 3538 | + }); | |
| 3539 | + props.onSaveState({ slaveData: slaveDataTemp }); | |
| 3540 | + }; | |
| 3541 | + } | |
| 3542 | + return <CommonViewDragable {...commonViewDragableProps} />; | |
| 3543 | + })} | |
| 3544 | + </AntdDraggableModal> | |
| 3545 | + ) : ( | |
| 3546 | + "" | |
| 3547 | + ); | |
| 3548 | +}; | |
| 3549 | + | |
| 3550 | +/** | |
| 3551 | + * 加载子从表格组件 | |
| 3552 | + */ | |
| 3553 | +const getChildTableComponent = (props, tableName) => { | |
| 3554 | + const { | |
| 3555 | + sModelsType, | |
| 3556 | + addStateMap, | |
| 3557 | + bHasChildSlave, | |
| 3558 | + slaveChildOrder, | |
| 3559 | + salveIColValue, | |
| 3560 | + [`${tableName}Config`]: fatherConfig, | |
| 3561 | + masterData, | |
| 3562 | + masterConfig = [], | |
| 3563 | + slaveConfig, | |
| 3564 | + slaveSelectedRowKeys, | |
| 3565 | + slaveData, | |
| 3566 | + } = props; | |
| 3567 | + | |
| 3568 | + if (commonUtils.isEmptyStr(tableName)) { | |
| 3569 | + return null; | |
| 3570 | + } | |
| 3571 | + let slaveRow = {}; | |
| 3572 | + if (commonUtils.isNotEmptyArr(slaveSelectedRowKeys)) { | |
| 3573 | + const iIndex = slaveData.findIndex(item => slaveSelectedRowKeys.includes(item.sId)); | |
| 3574 | + if (iIndex > -1) { | |
| 3575 | + slaveRow = slaveData[iIndex]; | |
| 3576 | + } else { | |
| 3577 | + slaveRow = slaveData[0]; | |
| 3578 | + } | |
| 3579 | + } else if (commonUtils.isNotEmptyArr(slaveData)) { | |
| 3580 | + slaveRow = slaveData[0]; | |
| 3581 | + } | |
| 3582 | + // 是否有表单字段 | |
| 3583 | + const bHasViewConfigs = fatherConfig.gdsconfigformslave.some(item => item.sName !== "" && item.bControl && item.sControlName.indexOf("Btn") === -1); | |
| 3584 | + | |
| 3585 | + /* 找到父层下面有多少子级 */ | |
| 3586 | + const slaveChildNameArr = Object.keys(addStateMap).filter( | |
| 3587 | + key => commonUtils.isNotEmptyObject(fatherConfig.sChildTableName) && fatherConfig.sChildTableName.split(",").includes(addStateMap[key].sGrd) | |
| 3588 | + ); | |
| 3589 | + | |
| 3590 | + if (slaveChildNameArr.length === 0) { | |
| 3591 | + return null; // 如果没有有效配置,返回 null 避免渲染 | |
| 3592 | + } | |
| 3593 | + return slaveChildNameArr.map(slaveChildName => { | |
| 3594 | + let viewConfigs = []; | |
| 3595 | + // 是否展示操作按钮 | |
| 3596 | + const config = props[`${slaveChildName}`]; | |
| 3597 | + const { gdsconfigformslave = [] } = config; | |
| 3598 | + | |
| 3599 | + if (commonUtils.isNotEmptyArr(gdsconfigformslave)) { | |
| 3600 | + viewConfigs = gdsconfigformslave.filter(item => item.sName !== "" && item.bControl && item.sControlName.indexOf("Btn") === -1); | |
| 3601 | + if (viewConfigs.length === 0) { | |
| 3602 | + return null; // 如果没有有效配置,返回 null 避免渲染 | |
| 3603 | + } | |
| 3604 | + } | |
| 3605 | + | |
| 3606 | + /* 从表view */ | |
| 3607 | + const tableViewProps = { | |
| 3608 | + ...props, | |
| 3609 | + viewConfigs, | |
| 3610 | + tableConfig: config, | |
| 3611 | + iColValueView: 24, | |
| 3612 | + viewRow: slaveRow, | |
| 3613 | + tableName: slaveChildName, | |
| 3614 | + // handleFieldDoubleClick: props.handleFieldDoubleClick | |
| 3615 | + }; | |
| 3616 | + | |
| 3617 | + /* 区分TabPane1 还是单纯的commonView */ | |
| 3618 | + | |
| 3619 | + return ( | |
| 3620 | + // 新增标题行和子 CommonViewTable | |
| 3621 | + <Col key={config?.sId} span={24} order={10} style={{ textAlign: "center", background: "#ffffff" }}> | |
| 3622 | + <div style={{ fontWeight: "bold", fontSize: "16px" }}>上批数据</div> | |
| 3623 | + <CommonViewTable {...tableViewProps} /> | |
| 3624 | + </Col> | |
| 3625 | + ); | |
| 3626 | + }); | |
| 3627 | +}; | |
| 3628 | + | |
| 3629 | +const useCommonNewBillEvent = (props) => { | |
| 3630 | + return { | |
| 3631 | + ...props, | |
| 3632 | + } | |
| 3633 | +}; | |
| 3634 | + | |
| 3635 | +const CommonNewBill = Form.create({ | |
| 3636 | + mapPropsToFields(props) { | |
| 3637 | + const { masterData, masterConfig } = props; | |
| 3638 | + const obj = commonFunc.mapPropsToFields(masterData, Form, masterConfig); | |
| 3639 | + return obj; | |
| 3640 | + }, | |
| 3641 | +})((props) => { | |
| 3642 | + const { | |
| 3643 | + onReturnForm, form | |
| 3644 | + } = props; | |
| 3645 | + onReturnForm(form); | |
| 3646 | + return <CommonNewBillComponent {...props} /> | |
| 3647 | +}) | |
| 3648 | + | |
| 3649 | +const CommonNewBillComponent = (baseProps) => { | |
| 3650 | + const props = useCommonNewBillEvent(baseProps); | |
| 3651 | + const { | |
| 3652 | + enabled, | |
| 3653 | + billType = "add", | |
| 3654 | + masterConfig, | |
| 3655 | + masterData = {}, | |
| 3656 | + } = props; | |
| 3657 | + | |
| 3658 | + if (commonUtils.isEmptyObject(masterConfig)) { | |
| 3659 | + return null; | |
| 3660 | + } | |
| 3661 | + | |
| 3662 | + const bCheckModel = false; | |
| 3663 | + const { bSubmit, bCheck } = masterData; | |
| 3664 | + const bStatus = bCheckModel ? bCheck : bSubmit; | |
| 3665 | + | |
| 3666 | + return <div className={stylesNew.verifyScrapBill}> | |
| 3667 | + <div className={stylesNew.billForm}> | |
| 3668 | + <div> | |
| 3669 | + <FormComponent {...props} /> | |
| 3670 | + </div> | |
| 3671 | + <div> | |
| 3672 | + <Toolbar | |
| 3673 | + {...props} | |
| 3674 | + pageFrom="padBill" | |
| 3675 | + customRender={(params) => { | |
| 3676 | + const { menuDataCopy, getMenuProps, handleClick } = params; | |
| 3677 | + return menuDataCopy.filter(item => commonUtils.isEmptyArr(item.child)).map(item => { | |
| 3678 | + const { showName } = item; | |
| 3679 | + const menuItemProps = getMenuProps(item, "key"); | |
| 3680 | + | |
| 3681 | + return <div> | |
| 3682 | + <Button | |
| 3683 | + type="primary" | |
| 3684 | + size="large" | |
| 3685 | + {...menuItemProps} | |
| 3686 | + onClick={() => { | |
| 3687 | + handleClick(menuItemProps); | |
| 3688 | + }} | |
| 3689 | + > | |
| 3690 | + {showName} | |
| 3691 | + </Button> | |
| 3692 | + </div> | |
| 3693 | + }) | |
| 3694 | + }} | |
| 3695 | + /> | |
| 3696 | + </div> | |
| 3697 | + </div> | |
| 3698 | + <div className={stylesNew.table} key={masterData.sWorkOrderNo}> | |
| 3699 | + <TabsComponent {...props} /> | |
| 3700 | + {/* <TableComponent {...props} /> */} | |
| 3701 | + </div> | |
| 3702 | + </div> | |
| 3703 | +}; | |
| 3704 | + | |
| 3705 | +// 表单 | |
| 3706 | +const FormComponent = props => { | |
| 3707 | + const { masterConfig, masterData = {} } = props; | |
| 3708 | + const viewConfigs = masterConfig.gdsconfigformslave.filter( | |
| 3709 | + item => | |
| 3710 | + item.sName && | |
| 3711 | + item.bVisible && | |
| 3712 | + item.sControlName.indexOf("Btn") === -1 && | |
| 3713 | + item.sControlName.indexOf("_") === -1 | |
| 3714 | + ); | |
| 3715 | + | |
| 3716 | + const viewProps = { | |
| 3717 | + ...props, | |
| 3718 | + viewConfigs, | |
| 3719 | + tableConfig: masterConfig, | |
| 3720 | + iColValueView: 24, | |
| 3721 | + viewRow: masterData, | |
| 3722 | + tableName: "master", | |
| 3723 | + onDataChange: props.onChange, | |
| 3724 | + }; | |
| 3725 | + | |
| 3726 | + return <CommonViewTable {...viewProps} />; | |
| 3727 | +}; | |
| 3728 | + | |
| 3729 | +// Tabs | |
| 3730 | +const TabsComponent = props => { | |
| 3731 | + const { slaveConfig } = props; | |
| 3732 | + const tableList = []; | |
| 3733 | + if (slaveConfig?.showName) { | |
| 3734 | + tableList.push('slave'); | |
| 3735 | + } | |
| 3736 | + for (let i = 0; i < 12; i++) { | |
| 3737 | + const tableName = `slave${i}`; | |
| 3738 | + const tableConfigName = `slave${i}Config`; | |
| 3739 | + if (props[tableConfigName]?.showName) { | |
| 3740 | + tableList.push(tableName); | |
| 3741 | + } | |
| 3742 | + } | |
| 3743 | + | |
| 3744 | + return <Tabs onChange={props.onTabChange} className={styles.slaveTabs} tabBarStyle={{ margin: "0 8px" }}> | |
| 3745 | + { | |
| 3746 | + tableList.map(tableName => { | |
| 3747 | + const config = props[`${tableName}Config`]; | |
| 3748 | + const { showName } = config; | |
| 3749 | + return <TabPane tab={showName} className="xly-bill-list" key={tableName}> | |
| 3750 | + <TableComponent {...props} tableName={tableName} /> | |
| 3751 | + </TabPane> | |
| 3752 | + }) | |
| 3753 | + } | |
| 3754 | + </Tabs> | |
| 3755 | +}; | |
| 3756 | + | |
| 3757 | +// 表格 | |
| 3758 | +const TableComponent = props => { | |
| 3759 | + const { tableName } = props; | |
| 3760 | + const baseProps = commonBusiness.getTableTypes(tableName, { | |
| 3761 | + ...props, | |
| 3762 | + noStorageColumn: true | |
| 3763 | + }); | |
| 3764 | + const tableProps = { | |
| 3765 | + ...baseProps, | |
| 3766 | + setOpterationColumn: "Y", | |
| 3767 | + tableProps: { | |
| 3768 | + onChange: props.onTitleChange.bind(this, tableName), | |
| 3769 | + }, | |
| 3770 | + fixedHeight: "calc(100vh - 350px)" | |
| 3771 | + }; | |
| 3772 | + return <StaticEditTable {...tableProps} />; | |
| 3773 | +}; | |
| 3774 | + | |
| 3775 | +export default CommonBase(CommonNewSales(CommonNewBill)); | ... | ... |
src/mobile/common/CommobilePadBill/index.less
0 → 100644
| 1 | +.flex(@align-item: initial, @justify-content: initial) { | |
| 2 | + display: flex; | |
| 3 | + align-items: @align-item; | |
| 4 | + justify-content: @justify-content; | |
| 5 | +} | |
| 6 | + | |
| 7 | +.size(@width: 100%, @height: 100%) { | |
| 8 | + width: @width; | |
| 9 | + height: @height; | |
| 10 | +} | |
| 11 | + | |
| 12 | +.verifyScrapBill { | |
| 13 | + .size(); | |
| 14 | +} | |
| 15 | + | |
| 16 | +.toolBar { | |
| 17 | + position: relative; | |
| 18 | + .size(100%, 40px); | |
| 19 | + background: rgb(197, 197, 197); | |
| 20 | +} | |
| 21 | + | |
| 22 | +.content { | |
| 23 | + .size(); | |
| 24 | + .flex(center, center); | |
| 25 | + font-size: 18px; | |
| 26 | + font-weight: bold; | |
| 27 | +} | |
| 28 | + | |
| 29 | +.bakTools { | |
| 30 | + .size(auto, 100%); | |
| 31 | + .flex(center); | |
| 32 | + position: absolute; | |
| 33 | + top: 0; | |
| 34 | + left: 0; | |
| 35 | + | |
| 36 | + :global { | |
| 37 | + .ant-btn { | |
| 38 | + font-weight: bold; | |
| 39 | + font-size: 18px; | |
| 40 | + } | |
| 41 | + } | |
| 42 | +} | |
| 43 | + | |
| 44 | +.tools { | |
| 45 | + .size(auto, 100%); | |
| 46 | + .flex(center); | |
| 47 | + position: absolute; | |
| 48 | + top: 0; | |
| 49 | + right: 0; | |
| 50 | + | |
| 51 | + :global { | |
| 52 | + .ant-btn { | |
| 53 | + font-weight: bold; | |
| 54 | + font-size: 18px; | |
| 55 | + } | |
| 56 | + } | |
| 57 | +} | |
| 58 | + | |
| 59 | +.billForm { | |
| 60 | + .size(100%, auto); | |
| 61 | + .flex(); | |
| 62 | + | |
| 63 | + >div:nth-child(1) { | |
| 64 | + .size(calc(100% - 230px), 100%); | |
| 65 | + padding-top: 5px; | |
| 66 | + } | |
| 67 | + | |
| 68 | + >div:nth-child(2) { | |
| 69 | + .size(230px, auto); | |
| 70 | + padding-top: 10px; | |
| 71 | + // max-height: 140px; | |
| 72 | + display: grid; | |
| 73 | + grid-template-columns: repeat(2, 1fr); | |
| 74 | + grid-template-rows: repeat(4, 1fr); | |
| 75 | + | |
| 76 | + >div { | |
| 77 | + .size(); | |
| 78 | + .flex(center, center); | |
| 79 | + | |
| 80 | + :global { | |
| 81 | + .ant-btn-lg { | |
| 82 | + min-width: 50px; | |
| 83 | + width: 100px; | |
| 84 | + height: 38px; | |
| 85 | + border-radius: 5px; | |
| 86 | + font-size: 18px; | |
| 87 | + } | |
| 88 | + } | |
| 89 | + } | |
| 90 | + } | |
| 91 | + | |
| 92 | + :global { | |
| 93 | + .ant-col { | |
| 94 | + height: 45px; | |
| 95 | + } | |
| 96 | + | |
| 97 | + .ant-col.ant-col-24.ant-col-order-5 { | |
| 98 | + height: auto; | |
| 99 | + | |
| 100 | + .viewStyle:last-child { | |
| 101 | + overflow: hidden !important; | |
| 102 | + padding-bottom: 5px; | |
| 103 | + } | |
| 104 | + } | |
| 105 | + | |
| 106 | + .ant-col.ant-form-item-label:not(.skipFlexBasis) { | |
| 107 | + flex-basis: 160px !important; | |
| 108 | + max-width: 160px !important; | |
| 109 | + height: 40px; | |
| 110 | + line-height: 27px; | |
| 111 | + border-right: 1px solid #aaa; | |
| 112 | + display: flex; | |
| 113 | + align-items: center; | |
| 114 | + justify-content: flex-start; | |
| 115 | + border: none !important; | |
| 116 | + background-color: transparent !important; | |
| 117 | + | |
| 118 | + label { | |
| 119 | + font-size: 18px !important; | |
| 120 | + } | |
| 121 | + | |
| 122 | + } | |
| 123 | + | |
| 124 | + .ant-form-item { | |
| 125 | + border: none !important; | |
| 126 | + } | |
| 127 | + | |
| 128 | + .ant-form-item-control { | |
| 129 | + flex-basis: 100px; | |
| 130 | + max-width: 100%; | |
| 131 | + flex-grow: 1; | |
| 132 | + padding: 0 !important; | |
| 133 | + } | |
| 134 | + | |
| 135 | + .ant-form-item-control-input-content { | |
| 136 | + .flex(); | |
| 137 | + | |
| 138 | + >* { | |
| 139 | + flex-grow: 1; | |
| 140 | + } | |
| 141 | + } | |
| 142 | + | |
| 143 | + .ant-input, | |
| 144 | + .ant-input[disabled], | |
| 145 | + .viewStyle .ant-picker.ant-picker-disabled, | |
| 146 | + .viewStyle .ant-select-disabled .ant-select-selector { | |
| 147 | + flex-grow: 1; | |
| 148 | + text-indent: 8px; | |
| 149 | + font-size: 18px; | |
| 150 | + background: #f0f0f0 !important; | |
| 151 | + border-radius: 5px !important; | |
| 152 | + } | |
| 153 | + | |
| 154 | + .ant-input-number { | |
| 155 | + padding: 0 !important; | |
| 156 | + | |
| 157 | + input { | |
| 158 | + background: #f0f0f0 !important; | |
| 159 | + border-radius: 5px !important; | |
| 160 | + height: 40px !important; | |
| 161 | + padding-left: 0; | |
| 162 | + padding-right: 0; | |
| 163 | + text-indent: 8px; | |
| 164 | + } | |
| 165 | + } | |
| 166 | + | |
| 167 | + .ant-picker, | |
| 168 | + .ant-select { | |
| 169 | + background: #f0f0f0 !important; | |
| 170 | + border-radius: 5px !important; | |
| 171 | + height: 40px !important; | |
| 172 | + | |
| 173 | + .ant-select-selector, | |
| 174 | + .ant-select-selection-search { | |
| 175 | + height: 100%; | |
| 176 | + background-color: transparent; | |
| 177 | + | |
| 178 | + input { | |
| 179 | + height: 100% !important; | |
| 180 | + } | |
| 181 | + } | |
| 182 | + | |
| 183 | + input { | |
| 184 | + background-color: transparent !important; | |
| 185 | + } | |
| 186 | + } | |
| 187 | + | |
| 188 | + .ant-input-search-button { | |
| 189 | + height: 38px; | |
| 190 | + } | |
| 191 | + | |
| 192 | + // .ant-select-selector { | |
| 193 | + // border: none !important; | |
| 194 | + // background: #f0f0f0 !important; | |
| 195 | + // border-radius: 5px !important; | |
| 196 | + // height: 32px !important; | |
| 197 | + | |
| 198 | + // .ant-select-selection-item, | |
| 199 | + // .ant-select-selection-placeholder { | |
| 200 | + // line-height: 32px !important; | |
| 201 | + // } | |
| 202 | + // } | |
| 203 | + | |
| 204 | + // .ant-input-affix-wrapper { | |
| 205 | + // height: 28px; | |
| 206 | + // line-height: 23px; | |
| 207 | + // border: none !important; | |
| 208 | + // background: #f0f0f0 !important; | |
| 209 | + // border-radius: 5px !important; | |
| 210 | + // height: 32px !important; | |
| 211 | + // box-shadow: none !important; | |
| 212 | + // padding-left: 0 !important; | |
| 213 | + // } | |
| 214 | + | |
| 215 | + | |
| 216 | + // .ant-picker.ant-picker-range { | |
| 217 | + // input { | |
| 218 | + // font-size: 14px !important; | |
| 219 | + // } | |
| 220 | + // } | |
| 221 | + } | |
| 222 | +} | |
| 223 | + | |
| 224 | +.table { | |
| 225 | + .size(100%, auto); | |
| 226 | + flex-grow: 1; | |
| 227 | + | |
| 228 | + :global { | |
| 229 | + | |
| 230 | + .ant-tabs:not(.noXlyTabs) { | |
| 231 | + .ant-tabs-nav-wrap { | |
| 232 | + background: #fff; | |
| 233 | + | |
| 234 | + .ant-tabs-nav-list { | |
| 235 | + background: #fff; | |
| 236 | + | |
| 237 | + .ant-tabs-tab { | |
| 238 | + border: 1px solid #d9d9d9; | |
| 239 | + border-right: 0; | |
| 240 | + padding: 0 18px; | |
| 241 | + height: 40px; | |
| 242 | + line-height: 40px; | |
| 243 | + margin-left: 0; | |
| 244 | + background: #fafafa; | |
| 245 | + | |
| 246 | + &:nth-last-of-type(2) { | |
| 247 | + border-right: 1px solid #d9d9d9; | |
| 248 | + } | |
| 249 | + } | |
| 250 | + | |
| 251 | + .ant-tabs-tab-active { | |
| 252 | + border-bottom: 1px solid transparent; | |
| 253 | + background: #fff; | |
| 254 | + } | |
| 255 | + | |
| 256 | + .ant-tabs-ink-bar { | |
| 257 | + top: 0; | |
| 258 | + bottom: unset; | |
| 259 | + } | |
| 260 | + | |
| 261 | + .ant-tabs-tab-btn { | |
| 262 | + font-size: 20px; | |
| 263 | + } | |
| 264 | + } | |
| 265 | + } | |
| 266 | + } | |
| 267 | + | |
| 268 | + table { | |
| 269 | + border-top: 1px solid #aaa !important; | |
| 270 | + } | |
| 271 | + | |
| 272 | + .ant-table-thead>tr>th { | |
| 273 | + border-right: 1px solid #aaa !important; | |
| 274 | + font-size: 18px; | |
| 275 | + color: rgba(0, 0, 0, .85); | |
| 276 | + font-weight: 500; | |
| 277 | + text-align: left; | |
| 278 | + background: #e6e6e6; | |
| 279 | + // border-bottom: 1px solid #aaa; | |
| 280 | + font-weight: 600; | |
| 281 | + white-space: nowrap; | |
| 282 | + background: #ddd; | |
| 283 | + border-radius: 0 !important; | |
| 284 | + padding: 4px; | |
| 285 | + } | |
| 286 | + | |
| 287 | + .ant-table-cell { | |
| 288 | + span { | |
| 289 | + box-shadow: none !important; | |
| 290 | + } | |
| 291 | + | |
| 292 | + >div { | |
| 293 | + .size(100%, 34px); | |
| 294 | + } | |
| 295 | + | |
| 296 | + .noInput { | |
| 297 | + .size(); | |
| 298 | + .flex(center, flex-start); | |
| 299 | + } | |
| 300 | + | |
| 301 | + .changeClassName { | |
| 302 | + height: 100%; | |
| 303 | + | |
| 304 | + * { | |
| 305 | + height: 100%; | |
| 306 | + } | |
| 307 | + } | |
| 308 | + } | |
| 309 | + | |
| 310 | + .ant-btn[class*="mesAdd"], | |
| 311 | + .ant-btn[class*="mesDel"], | |
| 312 | + .ant-btn[class*="mesSave"] { | |
| 313 | + .size(30px, 30px); | |
| 314 | + } | |
| 315 | + | |
| 316 | + .ant-btn[class*="mesSave"] { | |
| 317 | + margin-right: 5px; | |
| 318 | + } | |
| 319 | + | |
| 320 | + .ant-table-cell-fix-right { | |
| 321 | + .operate-bar { | |
| 322 | + .size(); | |
| 323 | + .flex(center, center); | |
| 324 | + | |
| 325 | + >span { | |
| 326 | + display: none !important; | |
| 327 | + } | |
| 328 | + } | |
| 329 | + } | |
| 330 | + } | |
| 331 | +} | |
| 332 | + | |
| 333 | +.tdDiv { | |
| 334 | + .flex(); | |
| 335 | + .size(); | |
| 336 | + flex-direction: column; | |
| 337 | + | |
| 338 | + :global { | |
| 339 | + .ant-btn-lg { | |
| 340 | + padding: 0 0 0 2px; | |
| 341 | + min-width: 0; | |
| 342 | + height: 32px; | |
| 343 | + } | |
| 344 | + } | |
| 345 | +} | |
| 346 | + | |
| 347 | +.tdDetail { | |
| 348 | + flex-grow: 1; | |
| 349 | + .size(100%, auto); | |
| 350 | + min-height: 50px; | |
| 351 | + background-color: #f0f0f0; | |
| 352 | + border-top: 1px solid #AAA; | |
| 353 | + font-size: 12px; | |
| 354 | + padding-left: 4px; | |
| 355 | +} | |
| 0 | 356 | \ No newline at end of file | ... | ... |
src/routes/mobile/IndexMobile.js
| ... | ... | @@ -16,6 +16,7 @@ import MyselfMobile from "./common/MyselfMobile"; |
| 16 | 16 | import ContactsInfoMobile from "./common/ContactsInfoMobile"; |
| 17 | 17 | import RevisePasswordMobile from "./common/RevisePasswordMobile"; |
| 18 | 18 | import CommobileBill from "./common/commobileBill"; |
| 19 | +import CommobilePadBill from "./common/commobilePadBill"; | |
| 19 | 20 | import CommobilePrintPdf from "./common/commobilePrintPdf"; |
| 20 | 21 | import ExamineMobile from "./common/ExamineMobile"; |
| 21 | 22 | import Icon1 from "../../assets/mobile/1.png"; |
| ... | ... | @@ -188,7 +189,13 @@ class IndexMobile extends React.Component { |
| 188 | 189 | <CommobileBill {...this.props} /> |
| 189 | 190 | </div> |
| 190 | 191 | ); |
| 191 | - } else { | |
| 192 | + } else if (location.pathname === "/indexMobile/commobilePadBill") { | |
| 193 | + return ( | |
| 194 | + <div className={styles.demoContainer}> | |
| 195 | + <CommobilePadBill {...this.props} /> | |
| 196 | + </div> | |
| 197 | + ); | |
| 198 | + } else { | |
| 192 | 199 | return ( |
| 193 | 200 | <div className={styles.demoContainer}> |
| 194 | 201 | <SceneMobile {...this.props} sModelType={pageText} sModelsId="101251240115015916850901130" /> | ... | ... |
src/routes/mobile/common/commobilePadBill.js
0 → 100644
| 1 | +/** | |
| 2 | + * @Date: 2019-05-20T16:45:00+08:00 | |
| 3 | + * @Last modified time: 2019-06-26T18:40:44+08:00 | |
| 4 | + */ | |
| 5 | + | |
| 6 | +import React from 'react'; | |
| 7 | +import { connect } from 'umi'; | |
| 8 | +import CommobilePadBillComponent from '../../../mobile/common/CommobilePadBill'; | |
| 9 | +import * as commonUtils from '../../../utils/utils'; | |
| 10 | + | |
| 11 | +function commobileBill({ | |
| 12 | + dispatch, app, content, location, | |
| 13 | +}) { | |
| 14 | + if (location.state === null) { | |
| 15 | + return (<div />); | |
| 16 | + } | |
| 17 | + // const param = commonUtils.convertStrToObj(location.state.sParam); | |
| 18 | + let param = {}; | |
| 19 | + if (location.state.sParam) { | |
| 20 | + param = commonUtils.convertStrToObj(location.state.sParam); | |
| 21 | + } else { | |
| 22 | + param = commonUtils.convertStrToObj(location.state); | |
| 23 | + } | |
| 24 | + | |
| 25 | + const commonListProps = { | |
| 26 | + app, | |
| 27 | + content, | |
| 28 | + ...param, | |
| 29 | + dispatch, | |
| 30 | + }; | |
| 31 | + return ( | |
| 32 | + <CommobilePadBillComponent {...commonListProps} style={{ height: '100%' }} /> | |
| 33 | + ); | |
| 34 | +} | |
| 35 | + | |
| 36 | +export default connect(({ routing, app, content }) => | |
| 37 | + ({ routing, app, content }))(commobileBill); | ... | ... |