生成不合格检验单
This commit is contained in:
		
							parent
							
								
									1270f5b221
								
							
						
					
					
						commit
						6fb7e758cf
					
				|  | @ -167,11 +167,14 @@ import ReactDOM from 'react-dom'; | |||
| //=============导入高阶组件区=============
 | ||||
| //1导入高阶组件,公共部分
 | ||||
| import {createPage, base, ajax, high, toast, promptBox, deepClone, print, output} from 'nc-lightapp-front'; | ||||
| 
 | ||||
| const {PrintOutput, BillTrack} = high; | ||||
| const {NCDiv, NCAffix, NCTabs, NCScrollElement, NCTooltip, NCToggleViewBtn} = base; | ||||
| //2导入高阶组件, UIExtend的部分
 | ||||
| import {Utils} from './Utils'; | ||||
| const EMPTY_FN = function () { }; //空函数
 | ||||
| 
 | ||||
| const EMPTY_FN = function () { | ||||
| }; //空函数
 | ||||
| 
 | ||||
| import ExcelOutput from 'uap/common/components/ExcelOutput';  // 导出组件
 | ||||
| import excelImportconfig from 'uap/common/components/excelImportconfig';  // 导入配置方法
 | ||||
|  | @ -270,6 +273,7 @@ const FLOW_ACTION = { //审批流单据动作常量 | |||
| 	UNSAVE: 'UNSAVE',//收回
 | ||||
| 	SAVEBASE: 'SAVEBASE'//保存
 | ||||
| } | ||||
| 
 | ||||
| //=============基本变量定义区=============
 | ||||
| 
 | ||||
| /**************************************************************************************************** | ||||
|  | @ -381,7 +385,10 @@ export class ApplicationPage extends Component { | |||
| 	 */ | ||||
| 	pageReady = () => { | ||||
| 		let {context} = this.state; | ||||
|         this.props.search.setSearchValByField('dhjydMasterQuery', FIELDS.PK_ORG, { display: context.org_Name, value: context.pk_org }); | ||||
| 		this.props.search.setSearchValByField('dhjydMasterQuery', FIELDS.PK_ORG, { | ||||
| 			display: context.org_Name, | ||||
| 			value: context.pk_org | ||||
| 		}); | ||||
| 		// 交易类型发布小应用
 | ||||
| 		let {context: {paramMap} = {}} = this.state; | ||||
| 		if (paramMap && paramMap.pk_transtype) { | ||||
|  | @ -398,8 +405,16 @@ export class ApplicationPage extends Component { | |||
| 					return true; | ||||
| 				} | ||||
| 			}); | ||||
|             this.props.search.setSearchValByField('dhjydMasterQuery', FIELDS.TRANSTYPEPK, { display: paramMap.transtype_name, value: paramMap.pk_transtype }); | ||||
| 			this.props.search.setSearchValByField('dhjydMasterQuery', FIELDS.TRANSTYPEPK, { | ||||
| 				display: paramMap.transtype_name, | ||||
| 				value: paramMap.pk_transtype | ||||
| 			}); | ||||
| 			this.props.meta.setMeta(meta); | ||||
| 
 | ||||
| 			if (this.props.getUrlParam('fromPage') == 'dhjyd') {  //如果来自"到货检验单"的"生成不合格检验单"跳转
 | ||||
| 				this.onAddUnPassDone(); | ||||
| 
 | ||||
| 			} | ||||
| 		} | ||||
| 		this.updateBtnStatus(); // 更新按钮状态
 | ||||
| 	} | ||||
|  | @ -465,7 +480,10 @@ export class ApplicationPage extends Component { | |||
| 				return this.props.button.createOprationButton(oprButtons, { | ||||
| 					area: 'dhjydSlave0SubOpr', // 按钮区域编码
 | ||||
| 					buttonLimit: 3, // 允许的按钮最多显示数量
 | ||||
|                     onButtonClick: (props, btncode) => this.onBtnClickFormlist(props, btncode, 'dhjydSlave0Sub', { data: record, index }) // 点击按钮
 | ||||
| 					onButtonClick: (props, btncode) => this.onBtnClickFormlist(props, btncode, 'dhjydSlave0Sub', { | ||||
| 						data: record, | ||||
| 						index | ||||
| 					}) // 点击按钮
 | ||||
| 				}); | ||||
| 			} | ||||
| 		}); | ||||
|  | @ -928,8 +946,12 @@ export class ApplicationPage extends Component { | |||
| 			} | ||||
| 			return ( | ||||
| 				<div className="nc-bill-list"> | ||||
|                     <NCAffix onChange={({ affixed, event }) => { this.state.head.affixed = affixed; this.setState(this.state) }}> | ||||
|                         <NCDiv areaCode={NCDiv.config.HEADER} className="nc-bill-header-area" style={this.state.head.affixed && { backgroundColor: '#e0f2ff' }}> | ||||
| 					<NCAffix onChange={({affixed, event}) => { | ||||
| 						this.state.head.affixed = affixed; | ||||
| 						this.setState(this.state) | ||||
| 					}}> | ||||
| 						<NCDiv areaCode={NCDiv.config.HEADER} className="nc-bill-header-area" | ||||
| 						       style={this.state.head.affixed && {backgroundColor: '#e0f2ff'}}> | ||||
| 							<NCDiv areaCode={NCDiv.config.Title} className='header-title-search-area'> | ||||
| 								{this.props.BillHeadInfo.createBillHeadInfo(head)} | ||||
| 							</NCDiv> | ||||
|  | @ -980,7 +1002,8 @@ export class ApplicationPage extends Component { | |||
| 									<div className="header-button-area"> | ||||
| 										{this.props.button.createButtonApp(headBtn)} | ||||
| 									</div> | ||||
|                                 <NCDiv areaCode={NCDiv.config.TABS} className='header-cardPagination-area' style={cardPagniation.visible ? {} : { display: 'none' }}> | ||||
| 									<NCDiv areaCode={NCDiv.config.TABS} className='header-cardPagination-area' | ||||
| 									       style={cardPagniation.visible ? {} : {display: 'none'}}> | ||||
| 										{this.props.cardPagination.createCardPagination(cardPagniation)} | ||||
| 									</NCDiv> | ||||
| 								</NCDiv> | ||||
|  | @ -1042,7 +1065,7 @@ export class ApplicationPage extends Component { | |||
| 			} | ||||
| 			return ( | ||||
| 				<div> | ||||
|                     <ApproveDetail {...approveDetail} /> | ||||
| 					<ApproveDetail {...approveDetail} /> | ||||
| 					{approvalTrans.display && <ApprovalTrans {...approvalTrans} />} | ||||
| 				</div> | ||||
| 			); | ||||
|  | @ -1096,7 +1119,7 @@ export class ApplicationPage extends Component { | |||
| 			[ACTIONS.SAVEADD]: showmode == SHOWMODE_CARD && !isBrowse && !hasCheckedRow, | ||||
| 			[ACTIONS.CANCEL]: showmode == SHOWMODE_CARD && !isBrowse, | ||||
| 			[ACTIONS.COPY]: (showmode == SHOWMODE_LIST || showmode == SHOWMODE_CARD) && isBrowse, | ||||
|             [ACTIONS.ADDUNPASS]: (showmode == SHOWMODE_LIST || showmode == SHOWMODE_CARD) && isBrowse, | ||||
| 			[ACTIONS.ADDUNPASS]: (showmode == SHOWMODE_LIST || SHOWMODE_CARD) && isBrowse, | ||||
| 			[ACTIONS.MORE]: (showmode == SHOWMODE_LIST || showmode == SHOWMODE_CARD) && isBrowse | ||||
| 			// ,'ShowModal': (showmode == SHOWMODE_LIST || showmode == SHOWMODE_CARD) && isBrowse
 | ||||
| 		} | ||||
|  | @ -1726,10 +1749,25 @@ export class ApplicationPage extends Component { | |||
| 					// 处理编码规则
 | ||||
| 					this.handleCodeRule({billCodeContext}); | ||||
| 					// 如果存在组织属性,并且个性化设置-业务设置那设置了组织,则默认在新增时把组织字段在界面上
 | ||||
|                     context && context.pk_org && this.props.form.setFormItemsValue(areaInfo.formId, { [FIELDS.PK_ORG]: { display: context.org_Name, value: context.pk_org } }); | ||||
| 					context && context.pk_org && this.props.form.setFormItemsValue(areaInfo.formId, { | ||||
| 						[FIELDS.PK_ORG]: { | ||||
| 							display: context.org_Name, | ||||
| 							value: context.pk_org | ||||
| 						} | ||||
| 					}); | ||||
| 					if (context && context && context.paramMap && context.paramMap.pk_transtype) { | ||||
|                         this.props.form.setFormItemsValue(areaInfo.formId, { [FIELDS.TRANSTYPEPK]: { display: context.paramMap.transtype_name, value: context.paramMap.pk_transtype } }); | ||||
|                         this.props.form.setFormItemsValue(areaInfo.formId, { [FIELDS.TRANSTYPE]: { display: context.paramMap.transtype, value: context.paramMap.transtype } }); | ||||
| 						this.props.form.setFormItemsValue(areaInfo.formId, { | ||||
| 							[FIELDS.TRANSTYPEPK]: { | ||||
| 								display: context.paramMap.transtype_name, | ||||
| 								value: context.paramMap.pk_transtype | ||||
| 							} | ||||
| 						}); | ||||
| 						this.props.form.setFormItemsValue(areaInfo.formId, { | ||||
| 							[FIELDS.TRANSTYPE]: { | ||||
| 								display: context.paramMap.transtype, | ||||
| 								value: context.paramMap.transtype | ||||
| 							} | ||||
| 						}); | ||||
| 					} | ||||
| 					// 更新按钮状态
 | ||||
| 					this.updateBtnStatus(); | ||||
|  | @ -1978,7 +2016,9 @@ export class ApplicationPage extends Component { | |||
| 		let tableTypeObj = { | ||||
| 			[areaInfo.formId]: 'form' | ||||
| 		}; | ||||
|         areaInfo.tableId.forEach(areacode => { tableTypeObj[areacode] = 'editTable' }); | ||||
| 		areaInfo.tableId.forEach(areacode => { | ||||
| 			tableTypeObj[areacode] = 'editTable' | ||||
| 		}); | ||||
| 		// 保存前执行校验公式
 | ||||
| 		this.props.validateToSave(saveData, () => { | ||||
| 			// 保存请求
 | ||||
|  | @ -2043,7 +2083,9 @@ export class ApplicationPage extends Component { | |||
| 		let tableTypeObj = { | ||||
| 			[areaInfo.formId]: 'form' | ||||
| 		}; | ||||
|         areaInfo.tableId.forEach(areacode => { tableTypeObj[areacode] = 'editTable' }); | ||||
| 		areaInfo.tableId.forEach(areacode => { | ||||
| 			tableTypeObj[areacode] = 'editTable' | ||||
| 		}); | ||||
| 		// 保存前执行校验公式
 | ||||
| 		this.props.validateToSave(saveData, () => { | ||||
| 			// 保存请求
 | ||||
|  | @ -2072,10 +2114,25 @@ export class ApplicationPage extends Component { | |||
| 								// 处理编码规则
 | ||||
| 								this.handleCodeRule({billCodeContext}); | ||||
| 								// 如果存在组织属性,并且个性化设置-业务设置那设置了组织,则默认在新增时把组织字段在界面上
 | ||||
|                                 context && context.pk_org && this.props.form.setFormItemsValue(areaInfo.formId, { [FIELDS.PK_ORG]: { display: context.org_Name, value: context.pk_org } }); | ||||
| 								context && context.pk_org && this.props.form.setFormItemsValue(areaInfo.formId, { | ||||
| 									[FIELDS.PK_ORG]: { | ||||
| 										display: context.org_Name, | ||||
| 										value: context.pk_org | ||||
| 									} | ||||
| 								}); | ||||
| 								if (context && context && context.paramMap && context.paramMap.pk_transtype) { | ||||
|                                     this.props.form.setFormItemsValue(areaInfo.formId, { [FIELDS.TRANSTYPEPK]: { display: context.paramMap.transtype_name, value: context.paramMap.pk_transtype } }); | ||||
|                                     this.props.form.setFormItemsValue(areaInfo.formId, { [FIELDS.TRANSTYPE]: { display: context.paramMap.transtype, value: context.paramMap.transtype } }); | ||||
| 									this.props.form.setFormItemsValue(areaInfo.formId, { | ||||
| 										[FIELDS.TRANSTYPEPK]: { | ||||
| 											display: context.paramMap.transtype_name, | ||||
| 											value: context.paramMap.pk_transtype | ||||
| 										} | ||||
| 									}); | ||||
| 									this.props.form.setFormItemsValue(areaInfo.formId, { | ||||
| 										[FIELDS.TRANSTYPE]: { | ||||
| 											display: context.paramMap.transtype, | ||||
| 											value: context.paramMap.transtype | ||||
| 										} | ||||
| 									}); | ||||
| 								} | ||||
| 								// 更新按钮状态
 | ||||
| 								this.updateBtnStatus(); | ||||
|  | @ -2206,35 +2263,99 @@ export class ApplicationPage extends Component { | |||
| 		let billId = checkedDatas[0].values[FIELDS.PRIMARYKEY].value; | ||||
| 		// 获取卡片区域编码
 | ||||
| 		let areaInfo = this.getCardAreaCode(); | ||||
|         ajax({ | ||||
|             url: URLS.addUnPassUrl, | ||||
|             data: { | ||||
|                 pk: billId, // 主键
 | ||||
| 
 | ||||
| 		this.addUnPass({ | ||||
| 			billId, | ||||
| 			pageCode: this.config.pagecode, // pagecode
 | ||||
|                 ...areaInfo // 区域编码
 | ||||
|             }, | ||||
|             success: (res = {}) => { | ||||
|                 // 提示
 | ||||
| 			areaInfo, | ||||
| 			callback: ({data, billCodeContext}) => { | ||||
| 				toast({color: 'success', content: '操作成功'}); | ||||
| 				let info = JSON.stringify(data) | ||||
| 				billCodeContext = JSON.stringify(billCodeContext) | ||||
| 				this.props.openTo('/pu/dhjyd/dhjydmaster/main/#/card', { | ||||
| 					appcode: '4004012H9400', | ||||
| 					pagecode: '4004012H9_dhjydMaster', | ||||
| 					fromPage: 'dhjyd', | ||||
| 					info: info, | ||||
| 					billCodeContext | ||||
| 				}); | ||||
| 
 | ||||
| 
 | ||||
| 				/*// 设置页面模式为卡片编辑态 | ||||
| 				this.state.showmode = SHOWMODE_CARD; | ||||
| 				this.state.editmode = EDITMODE_ADD; | ||||
| 				// 设置标题栏返回按钮
 | ||||
| 				this.state.head.initShowBackBtn = false; | ||||
| 				this.setState(this.state, () => { | ||||
| 					 // 获取卡片区域编码
 | ||||
| 					 let areaInfo = this.getCardAreaCode(); | ||||
| 					 // 设置卡片主表单为编辑态
 | ||||
| 					 this.updateCardStatus({ areaInfo, editmode: EDITMODE_ADD }); | ||||
| 				});*/ | ||||
| 			} | ||||
| 		}); | ||||
| 	} | ||||
| 
 | ||||
|     // addUnPass = ({ billId, callback = EMPTY_FN }) => {
 | ||||
|     //     ajax({
 | ||||
|     //         url: URLS.addUnPassUrl,
 | ||||
|     //         data: {
 | ||||
|     //             pk: billId, // 主键
 | ||||
|     //             pageCode: this.config.pagecode, // pagecode
 | ||||
|     //             ...areaInfo // 区域编码
 | ||||
|     //         },
 | ||||
|     //         success: (res = {}) => {
 | ||||
|     //             let { data: { data, externalData: { billCodeContext } = {} } = {} } = res;
 | ||||
|     //             callback({ data, billCodeContext });
 | ||||
|     //         }
 | ||||
|     //     });
 | ||||
|     // }
 | ||||
| 	addUnPass = ({billId, pageCode, areaInfo, callback = EMPTY_FN}) => { | ||||
| 		ajax({ | ||||
| 			url: URLS.addUnPassUrl, | ||||
| 			data: { | ||||
| 				pk: billId, // 主键
 | ||||
| 				pageCode: pageCode, // pagecode
 | ||||
| 				...areaInfo // 区域编码
 | ||||
| 			}, | ||||
| 			success: (res = {}) => { | ||||
| 				let {data: {data, externalData: {billCodeContext} = {}} = {}} = res; | ||||
| 				callback({data, billCodeContext}); | ||||
| 			} | ||||
| 		}); | ||||
| 	} | ||||
| 
 | ||||
| 	/** | ||||
| 	 * 方法功能: | ||||
| 	 *      点击"生成不合格检验单"跳转后的操作 | ||||
| 	 */ | ||||
| 	onAddUnPassDone = (param = {}) => { | ||||
| 		let {showmode} = this.state; | ||||
| 		// 列表操作列的参数
 | ||||
| 		let {record, index} = param; | ||||
| 		// 获取选中行
 | ||||
| 		// let checkedDatas = this.getCheckedDatas();
 | ||||
| 		// 获取选中行主键,多行取第一条,适配列表操作列优先从record中取值
 | ||||
| 		// let billId = record ? record[FIELDS.PRIMARYKEY].value : checkedDatas[0].values[FIELDS.PRIMARYKEY].value;
 | ||||
| 		// 设置页面模式为卡片编辑态
 | ||||
| 		this.state.showmode = SHOWMODE_CARD; | ||||
| 		this.state.editmode = EDITMODE_EDIT; | ||||
| 		// 设置标题栏返回按钮
 | ||||
| 		this.state.head.initShowBackBtn = false; | ||||
| 		this.setState(this.state, () => { | ||||
| 			// 获取卡片区域编码
 | ||||
| 			let areaInfo = this.getCardAreaCode(); | ||||
| 			// 修改卡片组件状态
 | ||||
| 			this.updateCardStatus({areaInfo, editmode: EDITMODE_EDIT}); | ||||
| 			let info = this.props.getUrlParam('info') ? JSON.parse(this.props.getUrlParam('info')) : {} | ||||
| 			let billCodeContext = this.props.getUrlParam('billCodeContext') ? JSON.parse(this.props.getUrlParam('billCodeContext')) : {} | ||||
| 			this.addUnPassDone({ | ||||
| 				info, | ||||
| 				billCodeContext, | ||||
| 				callback: ({data, billCodeContext}) => { | ||||
| 					console.log(data) | ||||
| 					data ? this.fillCardData({data}) : this.clearCardData(); | ||||
| 					// 处理编码规则
 | ||||
| 					this.handleCodeRule({billCodeContext}); | ||||
| 					// 根据列表数据初始化卡片翻页器
 | ||||
| 					showmode == SHOWMODE_LIST && this.initCardPaginationWithAllpks(); | ||||
| 					// 更新按钮状态
 | ||||
| 					this.updateBtnStatus(); | ||||
| 				} | ||||
| 			}); | ||||
| 		}); | ||||
| 	} | ||||
| 
 | ||||
| 	addUnPassDone = ({info, billCodeContext, callback = EMPTY_FN}) => { | ||||
| 		let data = info | ||||
| 		callback({data, billCodeContext}); | ||||
| 	} | ||||
| 
 | ||||
| 	/** | ||||
| 	 * 方法功能: | ||||
|  | @ -2312,7 +2433,8 @@ export class ApplicationPage extends Component { | |||
| 		this.state.uploader.visible = true; | ||||
| 		// 设置附件管理组件的主键
 | ||||
| 		this.state.uploader.billId = billId; | ||||
|         this.setState(this.state, () => { }); | ||||
| 		this.setState(this.state, () => { | ||||
| 		}); | ||||
| 	} | ||||
| 
 | ||||
| 	/** | ||||
|  | @ -2431,7 +2553,9 @@ export class ApplicationPage extends Component { | |||
| 		let tableTypeObj = { | ||||
| 			[areaInfo.formId]: 'form' | ||||
| 		}; | ||||
|         areaInfo.tableId.forEach(areacode => { tableTypeObj[areacode] = 'editTable' }); | ||||
| 		areaInfo.tableId.forEach(areacode => { | ||||
| 			tableTypeObj[areacode] = 'editTable' | ||||
| 		}); | ||||
| 		// 保存前执行校验公式
 | ||||
| 		this.props.validateToSave(saveData, () => { | ||||
| 			// 保存请求
 | ||||
|  | @ -2529,7 +2653,8 @@ export class ApplicationPage extends Component { | |||
| 	onCardTableExpandLine = (tableId, row) => { | ||||
| 		let {editmode} = this.state; | ||||
| 		let status = editmode == EDITMODE_BROWSE ? EDITMODE_BROWSE : EDITMODE_EDIT; | ||||
|         this.props.cardTable.openModel(tableId, status, row.data, row.index, () => { }); | ||||
| 		this.props.cardTable.openModel(tableId, status, row.data, row.index, () => { | ||||
| 		}); | ||||
| 	} | ||||
| 
 | ||||
| 	onCardTableCopy = (tableId, row) => { | ||||
|  | @ -2591,7 +2716,6 @@ export class ApplicationPage extends Component { | |||
| 	} | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 	/** | ||||
| 	 * 方法功能: | ||||
| 	 *      提交/撤回/审批  等 流程操作 | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue