• 新增多条数据手动添加


    <el-dialog title="配件更换" :visible.sync="dialogFormVisible" width="86%">
    			<div class="bad">
    				<div class="bad-item">
    					<!-- <div>
    						<h3>序号</h3>
    					</div> -->
    					<div>
    						<h3>部件名称</h3>
    					</div>
    					<div>
    						<h3>配件型号</h3>
    					</div>
    					<div>
    						<h3>更换原因</h3>
    					</div>
    					<div>
    						<h3>数量</h3>
    					</div>
    				</div>
    				<div class="bad-item list" v-for="(item,index) in badData" :key="index">
    					<!-- <div>
    						<el-input :disabled="item.id?true:false" v-model="item.index" size="small"></el-input>
    					</div> -->
    					<div>
    						<el-select v-model="item.fDevicePartId" placeholder="请选择" filterable @change="choosePartModel"
    							@focus="elDatePickerOnFocus">
    							<el-option v-for="(item, index) in GetDevicepartsList" :key="item.fid" :label="item.fName"
    								:value="item.fid">
    							</el-option>
    						</el-select>
    					</div>
    					<div>
    						<el-input style="100%" v-model="item.fPartModel" disabled size="small" placeholder="配件型号">
    						</el-input>
    					</div>
    					<div>
    						<el-input style="100%"  v-model="item.fReplaceReason" size="small" placeholder="请输入更换原因">
    						</el-input>
    					</div>
    					<div style="display:flex; align-items: center;">
    						<el-input style="90%" v-model="item.fQty" size="small" placeholder="请输入" type="number"
    							oninput="if(value.length > 8) value = value.slice(0,8)"></el-input>
    						<i @click="badFocus(item)" style="margin-right: 15px;" class="el-icon-plus"></i>
    						<i @click="deleteBad(item,i)" :class="badData.length==1?'forbid':''" class="el-icon-delete"></i>
    					</div>
    				</div>
    			</div>
    
    			<div slot="footer" class="dialog-footer">
    				<el-button @click="dialogFormVisible = false">取消</el-button>
    				<el-button type="primary" @click="changePartsOK()">确定</el-button>
    			</div>
    		</el-dialog>
    
    --------------------------
    //追加
    badFocus(item) {
    				//最后一个,自动下一个
    				let obj = {
    					"fid": "",
    					"fEntryId": "",
    					"fDevicePartId": "",
    					"fDevicePartName": "",
    					"fPartModel": "",
    					"fQty": '',
    					"fReplaceReason": "",
    					"fModel": "",
    					sortNum: parseInt(item.sortNum + 1),
    					index: parseInt(item.index + 1),
    				};
    				this.badData.push(obj);
    			},
    //删除
    deleteBad(item, index) {
    				this.badData.splice(index, 1);
    			},
    
    
  • 相关阅读:
    Mysql5.6主从复制-基于binlog
    mysql 1449 : The user specified as a definer ('root'@'%') does not exist 解决方法
    socket recv阻塞与非阻塞error总结
    linux socket talkclient talkserver示例
    linux-socket connect阻塞和非阻塞模式 示例
    OPENSSL FIPS
    epoll的LT和ET使用EPOLLONESHOT
    如何在socket编程的Tcp连接中实现心跳协议
    linux网络编程:splice函数和tee( )函数高效的零拷贝
    Linux网络编程--sendfile零拷贝高效率发送文件
  • 原文地址:https://www.cnblogs.com/Fancy1486450630/p/15726019.html
Copyright © 2020-2023  润新知