556 lines
		
	
	
		
			19 KiB
		
	
	
	
		
			Vue
		
	
	
	
	
	
			
		
		
	
	
			556 lines
		
	
	
		
			19 KiB
		
	
	
	
		
			Vue
		
	
	
	
	
	
<!-- WB013 外包工程危险作业申请编辑 -->
 | 
						|
<template>
 | 
						|
	<view class="todo-page">
 | 
						|
		<view class="background"></view>
 | 
						|
		<view class="card">
 | 
						|
			<!-- <uni-card margin="0" :is-shadow="true"> -->
 | 
						|
			<u--form labelPosition="left" labelWidth="auto" labelAlign="center" :model="model" :rules="rules" ref="wForm" errorType="border-bottom" class="demo-ruleForm">
 | 
						|
				<u-form-item label="驳回意见" prop="AUDIT_OPINION" borderBottom v-if="model.STATUS==40">
 | 
						|
					<u--input disabled disabledColor="#ffffff" v-model="model.CONTEXT" border="none" inputAlign="right" fontSize="14px"></u--input>
 | 
						|
				</u-form-item>
 | 
						|
				<u-form-item label="生产单元:" prop="Product_Unit" @click="handleChange('minetype')" borderBottom>
 | 
						|
					<u--input v-model="model.Product_Unit" disabled disabledColor="#ffffff" placeholder="请选择生产单元" border="none" inputAlign="right" fontSize="14px">
 | 
						|
					</u--input>
 | 
						|
					<u-icon style="margin-left: 4px;"  name="arrow-down" size="12">
 | 
						|
					</u-icon>
 | 
						|
				</u-form-item>
 | 
						|
				<u-form-item label="申请部门" prop="Nav_Project.NAME" borderBottom>
 | 
						|
					<u--input disabled disabledColor="#ffffff" v-model="model.Nav_Department.NAME" border="none" inputAlign="right" fontSize="14px"></u--input>
 | 
						|
				</u-form-item>
 | 
						|
				<u-form-item label="申请人员" prop="USER_ID" borderBottom>
 | 
						|
					<u--input disabled disabledColor="#ffffff" v-model="model.Nav_User.NAME" border="none" inputAlign="right" fontSize="14px"></u--input>
 | 
						|
				</u-form-item>
 | 
						|
 | 
						|
 | 
						|
			</u--form>
 | 
						|
			<u--form labelPosition="left" labelWidth="auto" labelAlign="center" errorType="border-bottom" ref="sForm" class="sub-form" style="margin-top: 20px;" v-if="model.Nav_Details">
 | 
						|
				<view style="position: relative;">
 | 
						|
					<view style="position: absolute;left: -10px;color: #3d4b70;top: -3px;">*</view>
 | 
						|
				</view>
 | 
						|
 | 
						|
				<view style="font-size: 15px; font-weight: bold;color: #3d4b70;margin-bottom: 10px;">申领信息填写</view>
 | 
						|
 | 
						|
				<uni-collapse :border="false" accordion>
 | 
						|
					<view v-for="(item, index) in model.Nav_Details.filter(i => !i.IS_DELETED)" :key="index">
 | 
						|
						<uni-collapse-item title-border="none" :border="false">
 | 
						|
							<template v-slot:title>
 | 
						|
								<view class="uni-collapse-item__title-box">
 | 
						|
									<view class="uni-collapse-item__title-text">
 | 
						|
										{{item.Nav_DeviceBase?index+1+'.'+item.Nav_DeviceBase.NAME:index+1+'.'}}
 | 
						|
									</view>
 | 
						|
									<view @click.stop style="margin-right: 10px;">
 | 
						|
 | 
						|
										<u-icon @click="handleDelRowBefore(item)" name="trash" color="#ff4d4f" size="21" style="margin-right: 10px;"></u-icon>
 | 
						|
										<!-- <u-icon name="arrow-down" size="12"></u-icon> -->
 | 
						|
									</view>
 | 
						|
								</view>
 | 
						|
							</template>
 | 
						|
							<view class="content" style="padding: 0px 0px 0px 10px;">
 | 
						|
								<u-form-item class="subRequired" required label="设备设施名称" prop="Nav_Device.NAME" borderBottom @click="handleShowSheetForArea(item,{title: '设备设施名称', name: 'Nav_DeviceBase'})">
 | 
						|
									<u--input disabled fontSize="14px" placeholder="请选择设备设施名称" disabledColor="#fff" v-model="item.Nav_DeviceBase.NAME" border="none" inputAlign="right"
 | 
						|
										v-if="item.Nav_DeviceBase"></u--input>
 | 
						|
									<u-icon style="margin-left: 4px;" name="arrow-down" size="12" ></u-icon>
 | 
						|
								</u-form-item>
 | 
						|
								<u-form-item class="subRequired" label="规格/型号" prop="SPEC" borderBottom @click="handleShowSheetForArea(item,{title: '规格/型号', name: 'SPEC'})"> <u--input disabled fontSize="14px"
 | 
						|
										placeholder="请选择规格/型号" disabledColor="#fff" v-model="item.SPEC" border="none" inputAlign="right"></u--input><u-icon style="margin-left: 4px;" name="arrow-down" size="12"
 | 
						|
										></u-icon></u-form-item>
 | 
						|
								<u-form-item label="领用量" prop="QTY" borderBottom> <u--input disabled disabledColor="#ffffff" v-model="item.QTY" border="none" inputAlign="right" fontSize="14px"></u--input> </u-form-item>
 | 
						|
								<u-form-item label="单位" prop="UNIT" borderBottom> <u--input disabled disabledColor="#ffffff" v-model="item.UNIT" border="none" inputAlign="right" fontSize="14px"></u--input> </u-form-item>
 | 
						|
								<u-form-item label="用途" prop="USE" borderBottom> <u--input disabledColor="#ffffff" v-model="item.USE" border="none" inputAlign="right" fontSize="14px" placeholder="请输入用途"></u--input>
 | 
						|
								</u-form-item>
 | 
						|
								<u-form-item label="存放位置" prop="POSITION" borderBottom> <u--input disabledColor="#ffffff" v-model="item.POSITION" border="none" inputAlign="right" fontSize="14px"
 | 
						|
										placeholder="请输入存放位置"></u--input>
 | 
						|
								</u-form-item>
 | 
						|
								<u-form-item class="subRequired" required label="使用部门" prop="Nav_Department.NAME" borderBottom @click="handleShowSheetForArea(item,{title: '使用部门', name: 'Nav_Department'})"> <u--input
 | 
						|
										disabled fontSize="14px" placeholder="请选择使用部门" disabledColor="#fff" v-model="item.Nav_Department.NAME" border="none" inputAlign="right"
 | 
						|
										v-if="item.Nav_Department"></u--input><u-icon style="margin-left: 4px;" name="arrow-down" size="12" ></u-icon></u-form-item>
 | 
						|
								<u-form-item class="subRequired" required label="使用岗位" prop="Nav_UserPost.NAME" borderBottom @click="handleShowSheetForArea(item,{title: '使用岗位', name: 'Nav_UserPost'})"> <u--input disabled
 | 
						|
										fontSize="14px" placeholder="请选择使用岗位" disabledColor="#fff" v-model="item.Nav_UserPost.NAME" border="none" inputAlign="right" v-if="item.Nav_UserPost"></u--input><u-icon
 | 
						|
										style="margin-left: 4px;" name="arrow-down" size="12" ></u-icon></u-form-item>
 | 
						|
 | 
						|
 | 
						|
							</view>
 | 
						|
 | 
						|
 | 
						|
						</uni-collapse-item>
 | 
						|
					</view>
 | 
						|
				</uni-collapse>
 | 
						|
				<view style="margin-top: 10px;">
 | 
						|
					<u-button text="新增" type="primary" @click="handleAdd"></u-button>
 | 
						|
				</view>
 | 
						|
			</u--form>
 | 
						|
 | 
						|
			<!-- </uni-card> -->
 | 
						|
		</view>
 | 
						|
		<query-selector :multiple="selectorInfo.isMultiple" :show="selectorInfo.showPopup" :title="selectorInfo.title" :lists="selectorInfo.dataLists" :defaultChecked="selectorInfo.defaultChecked" @search="handleSearch"
 | 
						|
			@select="handleSelected" @close="selectorInfo.showPopup=false" :total="selectorInfo.totalCount" />
 | 
						|
		<u-picker :show="comPickerInfo.showSheet" :columns="comPickerInfo.columns" @confirm="onConfirmPicker" @close="comPickerInfo.showSheet=false" @cancel="comPickerInfo.showSheet=false" keyName="NAME"></u-picker>
 | 
						|
		<view style="padding: 10px 16px;display: flex;flex-direction: row;" class="bottom-button">
 | 
						|
			<u-button type="primary" @click="submit" color="#3d4b70" :disabled="isLoadOK">提交</u-button>
 | 
						|
		</view>
 | 
						|
		<!-- <view style="padding: 10px 16px;" v-if='isLoadOK' class="bottom-button">
 | 
						|
			<u-button type="primary" @click="submit" color="#3d4b70">提交</u-button>
 | 
						|
		</view> -->
 | 
						|
		<!-- 		<view class="bottom-button">
 | 
						|
			<button type="primary" v-if='isLoadOK' @click="submit">提交</button>
 | 
						|
		</view> -->
 | 
						|
	</view>
 | 
						|
</template>
 | 
						|
 | 
						|
<script>
 | 
						|
	import {
 | 
						|
		mapState,
 | 
						|
		mapMutations
 | 
						|
	} from 'vuex'
 | 
						|
	import {
 | 
						|
		extendFilterGroup,
 | 
						|
		extendGroupRule,
 | 
						|
		extendInclude,
 | 
						|
		extendOrder,
 | 
						|
		extendRule,
 | 
						|
		guid,
 | 
						|
		initFilter,
 | 
						|
		initFilterGroup,
 | 
						|
	} from '../../../../utils/common'
 | 
						|
	import {
 | 
						|
		FMProductionUnit,
 | 
						|
		CheckPeriods,
 | 
						|
		CheckLevels,
 | 
						|
		MineTypeIndex,
 | 
						|
		MineTypeName
 | 
						|
	} from '../../../../utils/enums.js'
 | 
						|
	import {
 | 
						|
		DMDeviceApplyGetEdit,
 | 
						|
		DMDeviceApplyFull,
 | 
						|
		DMDeviceBase,
 | 
						|
		DMDepartment,
 | 
						|
		DMDevicePurchase
 | 
						|
	} from '../../../../services/apply/subPages/DM/dm';
 | 
						|
 | 
						|
	import {
 | 
						|
		getEnum
 | 
						|
	} from '../../../../services/common';
 | 
						|
 | 
						|
	import config from '../../../../config/common'
 | 
						|
	export default {
 | 
						|
		data() {
 | 
						|
			return {
 | 
						|
				tableKey: '0',
 | 
						|
				TaskID: '',
 | 
						|
				ID: '',
 | 
						|
				ORG_ID: uni.getStorageSync('orgId'),
 | 
						|
				isLoadOK: true,
 | 
						|
				stepsPageList: 0,
 | 
						|
				listISORNOT: [], //是否涉及
 | 
						|
				listISORNOTText: [],
 | 
						|
				listPropUpload: ['PARENT_ID'],
 | 
						|
				listPropValUpload: [],
 | 
						|
				indexShow: 0,
 | 
						|
 | 
						|
				model: {
 | 
						|
					Nav_Department: {
 | 
						|
						NAME: ''
 | 
						|
					},
 | 
						|
					Nav_User: {
 | 
						|
						NAME: ""
 | 
						|
					},
 | 
						|
					Product_Unit: '',
 | 
						|
					ID: '',
 | 
						|
					ORG_ID: '',
 | 
						|
					TaskID: null,
 | 
						|
					Nav_Details: []
 | 
						|
				},
 | 
						|
				rules: {
 | 
						|
 | 
						|
				},
 | 
						|
				comPickerInfo: {
 | 
						|
					showSheet: false,
 | 
						|
					dataItem: {},
 | 
						|
					columns: [],
 | 
						|
					title: '',
 | 
						|
					dataIndex: undefined,
 | 
						|
					formIndex: undefined,
 | 
						|
					name: ''
 | 
						|
				},
 | 
						|
 | 
						|
				selectorInfo: {
 | 
						|
					name: 'user',
 | 
						|
					isMultiple: false,
 | 
						|
					showPopup: false,
 | 
						|
					totalCount: 0,
 | 
						|
					title: '考核结果选择',
 | 
						|
					dataItem: {},
 | 
						|
					index: 0,
 | 
						|
					columns: [],
 | 
						|
					dataLists: [],
 | 
						|
					defaultText: '',
 | 
						|
					defaultChecked: []
 | 
						|
				},
 | 
						|
			}
 | 
						|
		},
 | 
						|
		onLoad(option) {
 | 
						|
			// this.TaskID = option.taskID ? option.taskID : '';
 | 
						|
			// this.model.ID = option.ID ? option.ID : '';
 | 
						|
			// this.JOBID = option.ID ? option.ID : '';
 | 
						|
			// this.tableKey = option.tableKey ? option.tableKey : '0'
 | 
						|
			// this.loadData();
 | 
						|
 | 
						|
			this.ID = option.ID
 | 
						|
			this.TaskID = option.taskID
 | 
						|
			this.tableKey = option.tableKey
 | 
						|
 | 
						|
			if (option.taskID != null && option.taskID != '')
 | 
						|
				this.model.TaskID = option.taskID
 | 
						|
			this.getEnums()
 | 
						|
			// this.loadData()
 | 
						|
		},
 | 
						|
		methods: {
 | 
						|
			getEnums() {
 | 
						|
				var dataParm = {
 | 
						|
					'name': "FMProductionUnit"
 | 
						|
				}
 | 
						|
				getEnum(dataParm).then(res => {
 | 
						|
					this.listISORNOT = res
 | 
						|
					this.listISORNOTText = []
 | 
						|
					this.listISORNOT.forEach(e => {
 | 
						|
						e.name = e.NAME
 | 
						|
						e.code = e.ID
 | 
						|
						this.listISORNOTText.push(e.NAME)
 | 
						|
					})
 | 
						|
					this.loadData()
 | 
						|
				})
 | 
						|
			},
 | 
						|
			changeConfirm(item) {
 | 
						|
				const validDetails = this.model.Nav_Details.filter(i => !i.IS_DELETED);
 | 
						|
				const index = validDetails.indexOf(item);
 | 
						|
				const realIndex = this.model.Nav_Details.findIndex(item => item === validDetails[index]);
 | 
						|
				this.model.Nav_Details[realIndex].ISOCONFIRM = true;
 | 
						|
			},
 | 
						|
			handleDelRowBefore(item) {
 | 
						|
				item.IS_DELETED = true
 | 
						|
				let indexNotDel = 1
 | 
						|
				this.model.Nav_Details.forEach((e, i) => {
 | 
						|
					if (!e.IS_DELETED) {
 | 
						|
						e.ROW_NO = indexNotDel
 | 
						|
						indexNotDel++
 | 
						|
					}
 | 
						|
				})
 | 
						|
				this.$forceUpdate()
 | 
						|
			},
 | 
						|
			stepAdd() {
 | 
						|
				this.stepsPageList = this.stepsPageList + 1
 | 
						|
 | 
						|
			},
 | 
						|
			stepReduce() {
 | 
						|
				this.stepsPageList = this.stepsPageList - 1
 | 
						|
			},
 | 
						|
			loadData() {
 | 
						|
				if (this.ID == undefined || this.ID == '') {
 | 
						|
 | 
						|
					this.model.Nav_Details = []
 | 
						|
					this.model.ID = guid()
 | 
						|
					this.model.Nav_Department.NAME = uni.getStorageSync('appInfo').User.Nav_Department.NAME
 | 
						|
					this.model.Nav_User.NAME = uni.getStorageSync('appInfo').User.NAME
 | 
						|
					let mint = Number(uni.getStorageSync('appInfo').User.MineType.split(",")[0])
 | 
						|
					this.model.Product_Unit = this.listISORNOT.find(item => item.code === mint).name
 | 
						|
					this.model.MineType = this.listISORNOT.find(item => item.code === mint).code
 | 
						|
					this.isLoadOK = false
 | 
						|
				} else {
 | 
						|
					let json = initFilter(this.ORG_ID);
 | 
						|
					extendRule(json, 'ID', 1, this.ID);
 | 
						|
					extendInclude(json, 'Nav_Department');
 | 
						|
					extendInclude(json, 'Nav_User');
 | 
						|
					extendInclude(json, 'Nav_Details');
 | 
						|
					extendInclude(json, 'Nav_Details.Nav_DeviceBase');
 | 
						|
					extendInclude(json, 'Nav_Details.Nav_Department');
 | 
						|
					extendInclude(json, 'Nav_Details.Nav_User');
 | 
						|
					extendInclude(json, 'Nav_Details.Nav_UserPost');
 | 
						|
 | 
						|
					DMDeviceApplyGetEdit(json).then(ret => {
 | 
						|
						this.isLoadOK = false
 | 
						|
						this.model = ret
 | 
						|
						this.model.ID = this.ID
 | 
						|
						this.model.Product_Unit = this.listISORNOT.find(item => item.code === this.model.MineType).name
 | 
						|
 | 
						|
						// this.model.Nav_Details = this.model.Nav_Details.sort((a, b) => a.ROW_NUM - b.ROW_NUM);
 | 
						|
 | 
						|
						this.listPropValUpload.push(this.ID)
 | 
						|
 | 
						|
						// uni.$updateData()
 | 
						|
 | 
						|
					});
 | 
						|
 | 
						|
 | 
						|
				}
 | 
						|
				this.listPropValUpload.push(this.model.ID)
 | 
						|
			},
 | 
						|
			initializeMissingFields() {
 | 
						|
				const fields = ['Nav_Project', 'Nav_Type', 'Nav_User'];
 | 
						|
				fields.forEach(field => {
 | 
						|
					if (!this.model[field]) {
 | 
						|
						if (field == 'Nav_Project') {
 | 
						|
							this.model[field] = {
 | 
						|
								NAME: '',
 | 
						|
								UNIT_NAME: ''
 | 
						|
							};
 | 
						|
						} else {
 | 
						|
							this.model[field] = {
 | 
						|
								NAME: ''
 | 
						|
							};
 | 
						|
						}
 | 
						|
 | 
						|
					}
 | 
						|
				});
 | 
						|
			},
 | 
						|
 | 
						|
			handleShowSheetForArea(item, todo) {
 | 
						|
				const validDetails = this.model.Nav_Details.filter(i => !i.IS_DELETED);
 | 
						|
				const index = validDetails.indexOf(item);
 | 
						|
				this.handleShowSheet({
 | 
						|
					title: todo.title,
 | 
						|
					name: todo.name,
 | 
						|
					index: index
 | 
						|
				});
 | 
						|
			},
 | 
						|
			async handleShowSheet(p) {
 | 
						|
				const validDetails = this.model.Nav_Details.filter(i => !i.IS_DELETED);
 | 
						|
				let realIndex = this.model.Nav_Details.findIndex(item => item === validDetails[p.index]);
 | 
						|
				const orgId = uni.getStorageSync('orgId')
 | 
						|
				const json = initFilter(orgId, "", "", 0, p.pageIndex ?? 1)
 | 
						|
				// const json = initFilter(this.ORG_ID, "", "", 0, p.pageIndex ?? 1)
 | 
						|
				let dataSelect = []
 | 
						|
				var defaultChecked = []
 | 
						|
				this.selectorInfo.isMultiple = false
 | 
						|
 | 
						|
 | 
						|
				if (p.val) {
 | 
						|
					extendRule(json, 'NAME', 9, p.val);
 | 
						|
				}
 | 
						|
 | 
						|
 | 
						|
				json.Limit = 20
 | 
						|
				if (p.pageIndex) {
 | 
						|
					json.Start = (p.pageIndex - 1) * json.Limit;
 | 
						|
				}
 | 
						|
				json.Sort = 'NAME'
 | 
						|
				// json.Sort = "NAME"
 | 
						|
				// json.Order = 1
 | 
						|
				let data = this.model.Nav_Details[p.index]
 | 
						|
				if (p.name == 'Nav_DeviceBase' || p.name == 'SPEC') {
 | 
						|
 | 
						|
					if (p.name == 'Nav_DeviceBase') {
 | 
						|
						extendRule(json, 'DEVICE_STATUS', 1, '0');
 | 
						|
						dataSelect = await DMDeviceBase(json).then(res => {
 | 
						|
							this.selectorInfo.totalCount = res.TotalCount
 | 
						|
							if (res != undefined && res.Data.length > 0) {
 | 
						|
								for (let i = 0; i < res.Data.length; i++) {
 | 
						|
									res.Data[i].name = res.Data[i].NAME
 | 
						|
								}
 | 
						|
							}
 | 
						|
							return res.Data
 | 
						|
						})
 | 
						|
					} else {
 | 
						|
						if (data.Nav_DeviceBase.NAME && data.Nav_DeviceBase.NAME !== '') {
 | 
						|
							extendRule(json, 'Nav_DeviceBase.NAME', 1, data.Nav_DeviceBase.NAME);
 | 
						|
							json.Sort = 'SPEC'
 | 
						|
						}
 | 
						|
						extendRule(json, 'DEVICE_STATUS', 1, '0');
 | 
						|
						dataSelect = await DMDeviceBase(json).then(res => {
 | 
						|
							this.selectorInfo.totalCount = res.TotalCount
 | 
						|
							if (res != undefined && res.Data.length > 0) {
 | 
						|
								for (let i = 0; i < res.Data.length; i++) {
 | 
						|
									res.Data[i].name = res.Data[i].SPEC
 | 
						|
								}
 | 
						|
							}
 | 
						|
							return res.Data
 | 
						|
						})
 | 
						|
					}
 | 
						|
 | 
						|
				} else if (p.name == 'Nav_Department') {
 | 
						|
					dataSelect = await DMDepartment(json).then(res => {
 | 
						|
						this.selectorInfo.totalCount = res.TotalCount
 | 
						|
						if (res != undefined && res.Data.length > 0) {
 | 
						|
							for (let i = 0; i < res.Data.length; i++) {
 | 
						|
								res.Data[i].name = res.Data[i].NAME
 | 
						|
							}
 | 
						|
						}
 | 
						|
						return res.Data
 | 
						|
					})
 | 
						|
				} else if (p.name == 'Nav_UserPost') {
 | 
						|
					if (data.DEPARTMENT_ID && data.DEPARTMENT_ID !== '') {
 | 
						|
						extendRule(json, 'DEPARTMENT_ID', 1, data.DEPARTMENT_ID);
 | 
						|
					}
 | 
						|
					dataSelect = await DMDevicePurchase(json).then(res => {
 | 
						|
						this.selectorInfo.totalCount = res.TotalCount
 | 
						|
						if (res != undefined && res.Data.length > 0) {
 | 
						|
							for (let i = 0; i < res.Data.length; i++) {
 | 
						|
								res.Data[i].name = res.Data[i].NAME
 | 
						|
							}
 | 
						|
						}
 | 
						|
						return res.Data
 | 
						|
					})
 | 
						|
				}
 | 
						|
 | 
						|
				if (defaultChecked == null)
 | 
						|
					defaultChecked = []
 | 
						|
				if (dataSelect.length) {
 | 
						|
					this.selectorInfo = {
 | 
						|
						itemData: p.itemData != undefined ? p.itemData : this.selectorInfo
 | 
						|
							.itemData, //itemData: p.itemData,  搜索的时候  p.itemData为空  赋值修改 为 她自己本身 this.selectorInfo.itemData
 | 
						|
						isMultiple: this.selectorInfo.isMultiple,
 | 
						|
						totalCount: this.selectorInfo.totalCount,
 | 
						|
						showPopup: true,
 | 
						|
						title: p.title,
 | 
						|
						name: p.name,
 | 
						|
						dataLists: dataSelect,
 | 
						|
						defaultChecked: defaultChecked,
 | 
						|
						index: p.index
 | 
						|
					}
 | 
						|
				} else {
 | 
						|
					// 暂无数据
 | 
						|
				}
 | 
						|
			},
 | 
						|
			//数据加载
 | 
						|
			handleSearch(val, pageIndex) {
 | 
						|
				var p = {
 | 
						|
					name: this.selectorInfo.name,
 | 
						|
					title: this.selectorInfo.title,
 | 
						|
					val: val,
 | 
						|
					pageIndex: pageIndex,
 | 
						|
					index: this.selectorInfo.index
 | 
						|
				}
 | 
						|
				this.handleShowSheet(p)
 | 
						|
			},
 | 
						|
 | 
						|
			handleSelected(e) {
 | 
						|
				this.selectorInfo.showPopup = false
 | 
						|
				const validDetails = this.model.Nav_Details.filter(i => !i.IS_DELETED);
 | 
						|
				const index = this.selectorInfo.index;
 | 
						|
				const realIndex = this.model.Nav_Details.findIndex(item => item === validDetails[index]);
 | 
						|
				if (this.selectorInfo.name == 'Nav_DeviceBase' || this.selectorInfo.name == 'SPEC') {
 | 
						|
					this.model.Nav_Details[realIndex].Nav_DeviceBase = e;
 | 
						|
					this.model.Nav_Details[realIndex].DEVICE_BASE_ID = e.ID;
 | 
						|
					this.model.Nav_Details[realIndex].SPEC = e.SPEC;
 | 
						|
					this.model.Nav_Details[realIndex].UNIT = e.UNIT;
 | 
						|
				} else if (this.selectorInfo.name == 'Nav_Department') {
 | 
						|
					this.model.Nav_Details[realIndex].Nav_Department = e;
 | 
						|
					this.model.Nav_Details[realIndex].DEPARTMENT_ID = e.ID;
 | 
						|
				} else if (this.selectorInfo.name == 'Nav_UserPost') {
 | 
						|
					this.model.Nav_Details[realIndex].Nav_UserPost = e;
 | 
						|
					this.model.Nav_Details[realIndex].USER_POST_ID = e.ID;
 | 
						|
				}
 | 
						|
 | 
						|
 | 
						|
 | 
						|
			},
 | 
						|
			submit() {
 | 
						|
				for(let item of this.model.Nav_Details.filter(i => !i.IS_DELETED)){
 | 
						|
					if(!item.Nav_DeviceBase.NAME){
 | 
						|
						uni.$showErrorInfo('请选择设备设施名称!')
 | 
						|
						return
 | 
						|
					}
 | 
						|
					if(!item.Nav_Department.NAME){
 | 
						|
						uni.$showErrorInfo('请选择使用部门!')
 | 
						|
						return
 | 
						|
					}
 | 
						|
					if(!item.Nav_UserPost.NAME){
 | 
						|
						uni.$showErrorInfo('请选择使用岗位!')
 | 
						|
						return
 | 
						|
					}
 | 
						|
				}
 | 
						|
				this.modelEdit = JSON.parse(JSON.stringify(this.model))
 | 
						|
				delete this.modelEdit.Nav_Department
 | 
						|
				delete this.modelEdit.Nav_User
 | 
						|
				this.modelEdit.Nav_Details.map(item => {
 | 
						|
					item.PUBLISH = 'SaveAndNotify'
 | 
						|
					// item.QTY = Number(item.QTY)
 | 
						|
					delete item.Nav_Department
 | 
						|
					delete item.Nav_DeviceBase
 | 
						|
					delete item.Nav_UserPost
 | 
						|
				})
 | 
						|
				if (this.TaskID == null || this.TaskID == '') {
 | 
						|
					this.modelEdit.TaskID = '00000000-0000-0000-0000-000000000000'
 | 
						|
				} else {
 | 
						|
					this.modelEdit.TaskID = this.TaskID
 | 
						|
				}
 | 
						|
				if (this.modelEdit.ORG_ID == null || this.modelEdit.ORG_ID == '')
 | 
						|
					this.modelEdit.ORG_ID = this.ORG_ID
 | 
						|
 | 
						|
				this.modelEdit.PUBLISH = 'SaveAndNotify'
 | 
						|
				DMDeviceApplyFull(this.modelEdit).then(res => {
 | 
						|
					uni.$showMsgFunc('操作成功!', () => {
 | 
						|
						uni.navigateBack()
 | 
						|
					}, 'success', 1000)
 | 
						|
				})
 | 
						|
 | 
						|
			},
 | 
						|
			handleAdd() {
 | 
						|
				if (this.model.Nav_Details == null) {
 | 
						|
					this.model.Nav_Details = []
 | 
						|
				}
 | 
						|
 | 
						|
				var ROW_NO = 1;
 | 
						|
				if (this.model.Nav_Details.length > 0) {
 | 
						|
					this.model.Nav_Details.forEach(e => {
 | 
						|
						if (e.IS_DELETED == undefined || e.IS_DELETED == false)
 | 
						|
							ROW_NO++
 | 
						|
					})
 | 
						|
				}
 | 
						|
				var modelAdd = {
 | 
						|
					ID: guid(),
 | 
						|
					ORG_ID: this.ORG_ID,
 | 
						|
					DEVICE_APPLY_ID: this.model.ID,
 | 
						|
					ROW_NUM: ROW_NO,
 | 
						|
					Nav_DeviceBase: {
 | 
						|
						NAME: '',
 | 
						|
						MACHINE_CODE: ''
 | 
						|
					},
 | 
						|
					DEVICE_BASE_ID: '',
 | 
						|
					SPEC: '',
 | 
						|
					UNIT: '',
 | 
						|
					QTY: 1,
 | 
						|
					USE: '',
 | 
						|
					POSITION: '',
 | 
						|
					Nav_Department: {
 | 
						|
						NAME: ''
 | 
						|
					},
 | 
						|
					DEPARTMENT_ID: '',
 | 
						|
					USER_POST_ID: '',
 | 
						|
					Nav_UserPost: {
 | 
						|
						NAME: ''
 | 
						|
					},
 | 
						|
					IS_DELETED: false,
 | 
						|
				}
 | 
						|
				this.model.Nav_Details.push(modelAdd)
 | 
						|
				this.indexShow = ROW_NO
 | 
						|
			},
 | 
						|
 | 
						|
			handleChange() {
 | 
						|
				this.comPickerInfo = {
 | 
						|
					showSheet: true,
 | 
						|
					columns: [this.listISORNOTText],
 | 
						|
				}
 | 
						|
			},
 | 
						|
			onConfirmPicker(e) {
 | 
						|
				this.comPickerInfo = {
 | 
						|
					showSheet: false,
 | 
						|
					columns: [],
 | 
						|
					title: '',
 | 
						|
					formIndex: undefined
 | 
						|
				}
 | 
						|
				this.model.Product_Unit = e.value[0]
 | 
						|
				this.model.MineType = this.listISORNOT[e.indexs[0]].code
 | 
						|
 | 
						|
			}
 | 
						|
		}
 | 
						|
	}
 | 
						|
</script>
 | 
						|
 | 
						|
<style scoped>
 | 
						|
	@import url("../../../../style/css/newTemplate.css");
 | 
						|
	/* @import url("../../../../style/css/editTemplate.css"); */
 | 
						|
 | 
						|
	/* .todo-page {
 | 
						|
		padding: 16px 16px 70px;
 | 
						|
	} */
 | 
						|
</style> |