实现表格能修改,用能编辑、新增的效果

vue的源代码

<template>
	<div class="DefectList">
		<div class="dutyEvent-header">
			<h5 class="section-title" style="float:left">缺陷统计</h5>
			<!-- <el-button type="primary" size="small" @click="clickEditButton" class="duty-event-edit fr" icon="edit"> 编辑
			</el-button> -->
			<!-- <el-button type="primary" size="small" style="float:right;margin-left:10px;" @click="printOpt" :disabled="defectList.length===0">导出world</el-button> -->
			<el-button type="danger" size="small" @click="eidtButton" class="duty-event-add fr" :disabled="defectList.length===0" > 编辑 </el-button>
			<el-button type="primary" size="small" @click="clickAddButton" class="duty-event-add fr" :disabled="defectList.length===1"> 新增 </el-button>
			
		</div>
		<el-date-picker class="query-write-date" v-model="timedate" format="yyyy-MM-dd" type="date" placeholder="值班日期"
			@change="getDefectList" size="small">
		</el-date-picker>
	
		<el-table ref="defectList" :data="defectList" border tooltip-effect="light" style="width: 100%" @selection-change="handleSelectionChange">
			<!-- <el-table-column type="selection" width="55">
			</el-table-column> -->
			<el-table-column label="值班日期">
				<template scope="scope">{{ scope.row.dutyDateStr }}</template>
			</el-table-column>
			<el-table-column prop="num1" label="缺陷统计"  align="center">
				<template scope="scope">
					<el-badge  class="item">
							<el-button size="small" @click="clickEditButton(1)" >缺陷统计</el-button>
					</el-badge>
        </template>
			</el-table-column>
			<el-table-column prop="num2" label="工作票统计" align="center">
				<template scope="scope">
					<el-badge class="item"  >
							<el-button size="small" @click="clickEditButton(2)">工作票统计</el-button>
					</el-badge>
           <!-- <el-button type="button" @click="editCheckInfo(scope.row,false)" size="small">工作票统计</el-button> -->
        </template>
			</el-table-column>
			<el-table-column prop="num3" label="动火票统计" align="center">
				<template scope="scope">
						<el-badge  class="item">
							<el-button size="small" @click="clickEditButton(3)">动火票统计</el-button>
						</el-badge>
            <!-- <el-button type="button" @click="editCheckInfo(scope.row,false)" size="small">动火票统计</el-button> -->
        </template>
			</el-table-column>
			<el-table-column prop="num4" label="定期工作统计" align="center">
				<template scope="scope">
						<el-badge  class="item">
							<el-button size="small" @click="clickEditButton(4)">定期工作统计</el-button>
					</el-badge>
           <!-- <el-button type="button" @click="editCheckInfo(scope.row,false)" size="small">定期工作统计</el-button> -->
        </template>
			</el-table-column>

		  <!-- <el-table-column label="操作"  align="center">
        <template scope="scope">
          <el-button type="button" :disabled="!scope.row.id"  @click="clickEditButton" size="small">修改</el-button>
        </template>
      </el-table-column> -->

		</el-table>
			<div style="margin-top: 20px">
		</div>
		<el-dialog :visible.sync="dialogFormVisible2" :title="dialogTitle" :close-on-click-modal="false" width="600" id="popop">
			
			<el-form :model="dutyEvent" ref="dutyEvent" :rules="rulesDutyEvent" label-width="120px" >
				<el-form-item label="值班日期" prop="dutyDate" required>
					<el-date-picker v-model="dutyEvent.dutyDate" type="date" placeholder="请选择值班日期" size="small" format="yyyy-MM-dd"></el-date-picker>
				</el-form-item>
					<div style="margin-left:50px;line-height:40px">
						昨日至今新增三类缺陷<el-input  v-model="dutyEvent.num1" size="mini" style="width:50px">
						</el-input>
						条,累计正在消除缺陷<el-input  v-model="dutyEvent.num2" size="mini" style="width:50px">
						</el-input>条:<br/>
						<div>
							#1机组<el-input  v-model="dutyEvent.num3" size="mini" style="width:50px"></el-input>条;
							#2机组<el-input  v-model="dutyEvent.num4" size="mini" style="width:50px"></el-input>条;
							公用系统<el-input  v-model="dutyEvent.num5" size="mini" style="width:50px"></el-input>条。
							超期<el-input  v-model="dutyEvent.num6" size="mini" style="width:50px"></el-input>条
						</div>
					</div>
			</el-form>
			<div slot="footer" class="dialog-footer">
				<el-button @click="dialogFormVisible2=false" size="small">
					取消
				</el-button>
				<el-button type="primary" @click="submitSaveDutyEvent()" size="small">保 存</el-button>
			</div>
		</el-dialog>
		<el-dialog :visible.sync="dialogFormVisible" :title="dialogTitle" :close-on-click-modal="false" width="800" id="pop">
			<el-button type="primary" size="small" @click="addNewCustoemr" class="duty-event-add fr" style="margin-bottom:10px;"> 新增 </el-button>
			<el-table :data="popupList" border style="width: 100%;" :height="500" v-show="buttonActive===1" >
				<el-table-column align="center" prop="status" label="流转状态" className="slo"  v-if="popupType===1">
					<template scope="scope">
						<div v-show="scope.row.canEditor">
							<el-input placeholder="请输入" v-model="parameterData.status" size="mini">
							</el-input>
						</div>
						<div class="slo" v-show="!scope.row.canEditor">{{ scope.row.status }}</div>
					</template>
				</el-table-column>
				<el-table-column align="center" prop="specialty" label="所属专业" className="slo"  v-if="popupType===1">
					<template scope="scope">
						<div v-show="scope.row.canEditor">
							<el-input placeholder="请输入" v-model="parameterData.specialty" size="mini">
							</el-input>
						</div>
						<div class="slo" v-show="!scope.row.canEditor">{{ scope.row.specialty }}</div>
					</template>
				</el-table-column>
				<el-table-column align="center" prop="jizu" label="机组号" className="slo"  v-if="popupType===1"> 
					<template scope="scope">
						<div v-show="scope.row.canEditor">
							<el-input placeholder="请输入" v-model="parameterData.jizu" size="mini">
							</el-input>
						</div>
						<div class="slo" v-show="!scope.row.canEditor">{{ scope.row.jizu }}</div>
					</template>
				</el-table-column>
				<el-table-column align="center" prop="canEditor" label="登记时间" className="slo" v-if="popupType===1">
					<template scope="scope">
						<div v-show="scope.row.canEditor">
							    <el-date-picker
									type="datetime"
									size="mini"
									v-model="parameterData.createTime"
									placeholder="选择日期"
									>
								</el-date-picker>
						</div>
						<div class="slo" v-show="!scope.row.canEditor">{{ scope.row.createTimeStr }}</div>
					</template>
				</el-table-column>
				<el-table-column align="center" prop="content" label="缺陷内容" className="slo" v-if="popupType===1"  >
					<template scope="scope">
						<div v-show="scope.row.canEditor">
							<el-input placeholder="请输入" type="textarea" v-model="parameterData.content" size="mini">
							</el-input>
						</div>
						<div class="slo" v-show="!scope.row.canEditor" :title="scope.row.content">{{ scope.row.content }}</div>
					</template>
				</el-table-column>
				<el-table-column align="center" prop="type" label="动火票类型" className="slo" v-if="popupType===3">
					<template scope="scope">
						<div v-show="scope.row.canEditor">
							<el-input placeholder="请输入" v-model="DynamicCount.type" size="mini">
							</el-input>
						</div>
						<div class="slo" v-show="!scope.row.canEditor">{{ scope.row.type }}</div>
					</template>
				</el-table-column>
					<el-table-column align="center" prop="specialty" label="专业" className="slo" v-if="popupType===3">
					<template scope="scope">
						<div v-show="scope.row.canEditor">
							<el-input placeholder="请输入" v-model="DynamicCount.specialty" size="mini">
							</el-input>
						</div>
						<div class="slo" v-show="!scope.row.canEditor">{{ scope.row.specialty }}</div>
					</template>
				</el-table-column>
				<el-table-column align="center" prop="content" label="内容" className="slo" v-if="popupType===3" >
					<template scope="scope">
						<div v-show="scope.row.canEditor">
							<el-input placeholder="请输入"  type="textarea" v-model="DynamicCount.content" size="mini">
							</el-input>
						</div>
						<div class="slo" v-show="!scope.row.canEditor" :title="scope.row.content">{{ scope.row.content }}</div>
					</template>
				</el-table-column>
				<!-- 3 -->
				<!-- 4 -->
				<el-table-column align="center" prop="specialty" label="专业" className="slo" v-if="popupType===4">
					<template scope="scope">
						<div v-show="scope.row.canEditor">
							<el-input placeholder="请输入" v-model="RegularWork.specialty" size="mini">
							</el-input>
						</div>
						<div class="slo" v-show="!scope.row.canEditor">{{ scope.row.specialty }}</div>
					</template>
				</el-table-column>

				<el-table-column align="center" prop="content" label="内容" className="slo" v-if="popupType===4" >
						<template scope="scope">
							<div v-show="scope.row.canEditor">
								<el-input placeholder="请输入" type="textarea" v-model="RegularWork.content" size="mini">
								</el-input>
							</div>
							<div class="slo" v-show="!scope.row.canEditor">{{ scope.row.content }}</div>
						</template>
				</el-table-column>
				<el-table-column align="center" prop="executionStatus" label="执行情况" className="slo" v-if="popupType===4">
					<template scope="scope">
						<div v-show="scope.row.canEditor">
							<el-input placeholder="请输入" v-model="RegularWork.executionStatus" size="mini">
							</el-input>
						</div>
						<div class="slo" v-show="!scope.row.canEditor" :title="scope.row.executionStatus">{{ scope.row.executionStatus }}</div>
					</template>
				</el-table-column>
				<!-- 4 -->
				<el-table-column label="操作" width="120">
					<template scope="scope">
						<div v-show="scope.row.canEditor">
							<el-button type="text" size="small" @click="handleSaveCustomerInfo">保存</el-button>
							<el-button type="text" size="small" @click="handleCancelCustomerInfo(scope.row)">取消</el-button>
						</div>
						<div v-show="!scope.row.canEditor">
							<el-button type="text" @click="editParameter(scope.row)">编辑</el-button>
							<el-button type="text" @click="deleteParameter(scope.row)">删除</el-button>
						</div>
					</template>
				</el-table-column>
			</el-table>
		</el-dialog>

		<el-dialog :visible.sync="dialogFormVisible3" :title="dialogTitle" :close-on-click-modal="false" id="popopws">
			
			<el-form :model="Workticketstatistics" ref="Workticketstatistics" :rules="rulesDutyEvent" label-width="120px" >
				<el-form-item label="热力机械票" prop="mechanicalTicket" required>
					<template>
						<el-input-number v-model="Workticketstatistics.mechanicalTicket" controls-position="right" @change="handleChange" :min="0"  size="small"></el-input-number>
					</template>
				</el-form-item>
				<el-form-item label="电气一种票" prop="oneElectricTicket" required>
					<template>
						<el-input-number v-model="Workticketstatistics.oneElectricTicket" controls-position="right" @change="handleChange" :min="0"  size="small"></el-input-number>
					</template>
				</el-form-item>
				<el-form-item label="电气二种票" prop="twoElectricTicket" required>
					<template>
						<el-input-number v-model="Workticketstatistics.twoElectricTicket" controls-position="right" @change="handleChange" :min="0"  size="small"></el-input-number>
					</template>
				</el-form-item>
				<el-form-item label="热控工作票" prop="thermalTicket" required>
					<template>
						<el-input-number v-model="Workticketstatistics.thermalTicket" controls-position="right" @change="handleChange" :min="0"  size="small"></el-input-number>
					</template>
				</el-form-item>
				<el-form-item label="工作票总数" prop="total" style="width:250px" >
					<template >
						<el-input :disabled="true" v-model="totalcomput" size="small" ></el-input>
					</template>
				</el-form-item>
			</el-form>
			<div slot="footer" class="dialog-footer">
				<!-- <el-button @click="dialogFormVisible2=false" size="small">
					取消
				</el-button> -->
				<el-button type="primary" @click="handleSaveCustomerInfo()" size="small">保 存</el-button>
			</div>
		</el-dialog>


	</div>
</template>

<script>
	import {
		assign
	} from '@/shared/util';
	import {
		getDefectList,
		saveWorkOrder,
		editWorkOrder,

		findDefectiveCount,//缺陷统计
		saveDefectiveCount,
		deleteDefectiveCount,


		findWorkCount,//工作票统计
		saveWorkCount,
		deleteWorkCount,
		findDynamicCount,//动火票统计
		saveDynamicCount,
		deleteDynamicCount,
		findRegularWork,//定期工作统计
		saveRegularWork,
		deleteRegularWork,
	} from '@/api/check';
	
	function yesterDate(){
	  let timer = new Date().getTime() - (60 * 60 * 24 * 1000)
	  return new Date(timer)
	}
	function getnowDateStr(time){
		if(time){
				let datetime = new Date(time)
				return datetime.getFullYear()+'-'+(datetime.getMonth()+1)+'-'+datetime.getDate()
		}else {
			let datetime = new Date()
			return datetime.getFullYear()+'-'+(datetime.getMonth()+1)+'-'+datetime.getDate()
		}
	}
	
	function gettime(time){
		if(time){
			let datetime = new Date(time)
			return datetime.getHours()+':'+(datetime.getMinutes())+':'+datetime.getSeconds()
		}
	}
	function initDutyEvent() {
	  return {
			id: '',
			dutyDateStr:'',
			dutyDate:'',
			num1:'',
			num2:'',
			num3:'',
			num4:'',
			num5:'',
			num6:''
	  }
	}

//1、缺陷统计
	function initDefectiveCount() {
	  return {
			id: '',
			content:'',
			createTime:'',
			createTimeStr:'',
			dutyId:'1',
			jizu:'',
			specialty:'',
			status:'',
	  }
	}
	function initWorkticketstatistics(){
					return {
							id: '',
							dutyId:'1',
							mechanicalTicket:0,
							oneElectricTicket:0,
							thermalTicket:0,
							total:0,
							twoElectricTicket:0
					}
		}

	function initDynamicCount(){
				return {
					id: '',
					dutyId:'1',
					type: '',
					specialty: '',
					content: '',
				}
	}	

function initRegularWork(){
			return {
					id: '',
					dutyId:'1',
					executionStatus: '',
					specialty: '',
					content: '',
				}
	}
	
	export default {
		data() {
			return {
				timedate:new Date(),
				defectList: [],
				multipleSelection: [],
				rulesDutyEvent: {},
				dialogFormVisible: false,
				dialogFormVisible2:false,
				dialogFormVisible3:false,
				dialogTitle: '',
				dutyEvent: initDutyEvent(),
				buttonActive: 1,
				popupList: [],
				popupType: 1,
				parameterData: initDefectiveCount(),
				Workticketstatistics:initWorkticketstatistics(),
				DynamicCount:initDynamicCount(),
				RegularWork:initRegularWork(),
			};
		},
		mounted: function() {
			this.getDefectList()
		},
		computed:{
			totalcomput(){
			 	return  parseInt(this.Workticketstatistics.mechanicalTicket||0)+parseInt(this.Workticketstatistics.oneElectricTicket||0) +
			 	parseInt(this.Workticketstatistics.thermalTicket||0)+parseInt(this.Workticketstatistics.twoElectricTicket||0) 
			 }
		}
		,
		methods: {
			getDefectList(){
				this.Workticketstatistics=initWorkticketstatistics()
				getDefectList(getnowDateStr(this.timedate)).then(res => {
					if(res.success){
						this.defectList=[]
						if(res.data){
							this.dutyEvent=res.data
							this.dutyEvent.dutyDateStr=getnowDateStr(this.dutyEvent.dutyDate)
							this.defectList.push(this.dutyEvent);
						}
						// this.defectList=res.data;
					}
				})
			},
			handleChange(value) {
				this.Workticketstatistics.total=this.totalcomput
				},
			// 缺陷,工作编辑
			eidtButton(){
			  this.dialogTitle = "报缺陷、工作票统计";
			  this.dialogFormVisible2 = true
			},
			handleSelectionChange(val) {
			  this.multipleSelection = val;
			},
			clickAddButton: function () {
			  this.dutyEvent = initDutyEvent()
			  this.dialogTitle = "报缺陷、工作票统计";
			  this.dialogFormVisible2 = true
			},
			clickEditButton: function (type) {
				this.dialogTitle = "编辑";
				this.dialogFormVisible = true;
				this.popupType = type
					if(type===1){
							this.dialogTitle = "缺陷统计";
					}else if(type===2){
							this.dialogTitle = "工作票统计";
							this.dialogFormVisible = false;
							this.dialogFormVisible3 = true;
					}else if(type===3){
						this.dialogTitle = "动火票统计";
					}else if(type===4){
						this.dialogTitle = "定期工作统计";
					}
				this.getPopupList(type)
				
			},
			submitSaveDutyEvent(){
				saveWorkOrder(this.dutyEvent).then(res=>{
					if(res.success){
						 this.$message.success('保存成功')
						 this.dialogFormVisible2=false
						 this.getDefectList()
					}
				})
			},
			getPopupList(type) { //获取缺陷统计列表参数
				if(type == 1){
					findDefectiveCount(this.defectList[0].id).then(res => {
						if (res.code == 0) {
							this.popupList = res.data
							this.popupList.forEach(res=>{
								if(!res.createTimeStr){
								 	res.createTimeStr=gettime(res.createTime)
								}	
							})
							for (let n in this.popupList) {
								this.$set(this.popupList[n], 'canEditor', false)
							}
						} else {
							this.$message.warning(res.msg)
						}
					})
				}else if(type == 2){
					findWorkCount(this.defectList[0].id).then(res => {
						if (res.code == 0) {
							if(res.data){
								this.popupList=[];
								this.popupList.push(res.data) 
								this.Workticketstatistics=res.data; 
								for (let n in this.popupList) {
									this.$set(this.popupList[n], 'canEditor', false)
								}
							}
						} else {
							this.$message.warning(res.msg)
						}
					})
				}else if(type == 3){
					findDynamicCount(this.defectList[0].id).then(res => {
						if (res.code == 0) {
							this.popupList = res.data
							for (let n in this.popupList) {
								this.$set(this.popupList[n], 'canEditor', false)
							}
						} else {
							this.$message.warning(res.msg)
						}
					})
				}else if(type == 4){
					findRegularWork(this.defectList[0].id).then(res => {
						if (res.code == 0) {
							this.popupList = res.data
							for (let n in this.popupList) {
								this.$set(this.popupList[n], 'canEditor', false)
							}
						} else {
							this.$message.warning(res.msg)
						}
					})
				}
			},
			addNewCustoemr() { //新增
				if(this.popupType == 1){
						this.parameterData = initDefectiveCount()
						const parameterInfo = this.parameterData
						Object.assign(parameterInfo, {
							canEditor: true,
							isNew: true
						})
						this.popupList.unshift(parameterInfo)
				}else if(this.popupType == 2){
						this.Workticketstatistics = initWorkticketstatistics()
						const WorkticketstatisticsInfo = this.Workticketstatistics
						Object.assign(WorkticketstatisticsInfo, {
							canEditor: true,
							isNew: true
						})
						this.popupList.unshift(WorkticketstatisticsInfo)
				}else if(this.popupType == 3){
						this.DynamicCount = initDynamicCount()
						const DynamicCountInfo = this.DynamicCount
						Object.assign(DynamicCountInfo, {
							canEditor: true,
							isNew: true
						})
						this.popupList.unshift(DynamicCountInfo)
						
				}else if(this.popupType == 4){
						this.RegularWork = initRegularWork()
						const RegularWorkInfo = this.RegularWork
						Object.assign(RegularWorkInfo, {
							canEditor: true,
							isNew: true
						})
						this.popupList.unshift(RegularWorkInfo)
				}
				
			},
			editParameter(customer) { //编辑
				if (this.disabledAddNewCustomer === true) {
					this.$alert('请先完成上一个编辑操作!', '提示', {
						confirmButtonText: '确定'
					});
					return
				}
				this.disabledAddNewCustomer = true
				const editingcustomer = this.popupList.find(item => item.canEditor)
				if (editingcustomer) editingcustomer.canEditor = false
				customer.canEditor = true
				if(this.popupType == 1){
						assign(this.parameterData, customer)
				}else if(this.popupType == 2){
					assign(this.Workticketstatistics, customer)
				}else if(this.popupType == 3){
					assign(this.DynamicCount, customer)
				}else if(this.popupType == 4){
						assign(this.RegularWork, customer)
				}
			},
			handleCancelCustomerInfo(customer) { //取消修改
				this.disabledAddNewCustomer = false
				if (customer.isNew) return this.popupList.shift()
				customer.canEditor = false
			},
			handleSaveCustomerInfo() { //保存
				if(this.popupType == 1){
					this.parameterData.dutyId=this.defectList[0].id;
					if (!this.parameterData.status) {
						this.$alert('请输入!', '提示', {
							confirmButtonText: '确定'
						});
						return
					}
					if (!this.parameterData.specialty) {
						this.$alert('请输入!', '提示', {
							confirmButtonText: '确定'
						});
						return
					}
					if (!this.parameterData.jizu) {
						this.$alert('请输入!', '提示', {
							confirmButtonText: '确定'
						});
						return
					}
					if (!this.parameterData.canEditor) {
						this.$alert('请输入!', '提示', {
							confirmButtonText: '确定'
						});
						return
					}
					if (!this.parameterData.content) {
						this.$alert('请输入!', '提示', {
							confirmButtonText: '确定'
						});
						return
					}
					saveDefectiveCount(this.parameterData).then(res => {
						if (res.success) {
							this.$message.success('保存成功!')
							this.disabledAddNewCustomer = false
							this.getPopupList(this.popupType);
						} else if (!res.success && res.code == 0) {
							this.$alert(res.msg, '提示', {
								confirmButtonText: '确定'
							});
							return;
						} else {
							this.$message.warning(response.msg);
						}
					})
				}else if(this.popupType == 2){	
					this.Workticketstatistics.dutyId=this.defectList[0].id;
					this.Workticketstatistics.total=this.totalcomput;
						if (!this.Workticketstatistics.mechanicalTicket&&this.Workticketstatistics.oneElectricTicket!==0) {
						this.$alert('请输入!', '提示', {
							confirmButtonText: '确定'
						});
						return
					}
					if (!this.Workticketstatistics.oneElectricTicket&&this.Workticketstatistics.oneElectricTicket!==0) {
						this.$alert('请输入!', '提示', {
							confirmButtonText: '确定'
						});
						return
					}
					if (!this.Workticketstatistics.thermalTicket&&this.Workticketstatistics.thermalTicket!==0) {
						this.$alert('请输入!', '提示', {
							confirmButtonText: '确定'
						});
						return
					}
					if (!this.Workticketstatistics.total&&this.Workticketstatistics.total!==0) {
						this.$alert('请输入!', '提示', {
							confirmButtonText: '确定'
						});
						return
					}
					if (!this.Workticketstatistics.twoElectricTicket&&this.Workticketstatistics.twoElectricTicket!==0) {
						this.$alert('请输入!', '提示', {
							confirmButtonText: '确定'
						});
						return
					}
					saveWorkCount(this.Workticketstatistics).then(res => {
						if (res.success) {
							this.$message.success('保存成功!')
							this.disabledAddNewCustomer = false
							this.dialogFormVisible3=false;
							//this.getPopupList(this.popupType);
						} else if (!res.success && res.code == 0) {
							this.$alert(res.msg, '提示', {
								confirmButtonText: '确定'
							});
							return;
						} else {
							this.$message.warning(response.msg);
						}
					})


				}else if(this.popupType == 3){
					this.DynamicCount.dutyId=this.defectList[0].id;
					if (!this.DynamicCount.type) {
						this.$alert('请输入类型!', '提示', {
							confirmButtonText: '确定'
						});
						return
					}
					if (!this.DynamicCount.specialty) {
						this.$alert('请输入专业!', '提示', {
							confirmButtonText: '确定'
						});
						return
					}
					if (!this.DynamicCount.content) {
						this.$alert('请输入内容!', '提示', {
							confirmButtonText: '确定'
						});
						return
					}
					saveDynamicCount(this.DynamicCount).then(res => {
						if (res.success) {
							this.$message.success('保存成功!')
							this.disabledAddNewCustomer = false
							this.getPopupList(this.popupType);
						} else if (!res.success && res.code == 0) {
							this.$alert(res.msg, '提示', {
								confirmButtonText: '确定'
							});
							return;
						} else {
							this.$message.warning(response.msg);
						}
					})
				}else if(this.popupType == 4){
					this.RegularWork.dutyId=this.defectList[0].id;
						if (!this.RegularWork.specialty) {
						this.$alert('请输入专业!', '提示', {
							confirmButtonText: '确定'
						});
						return
					}
					if (!this.RegularWork.content) {
						this.$alert('请输入内容!', '提示', {
							confirmButtonText: '确定'
						});
						return
					}
					if (!this.RegularWork.executionStatus) {
						this.$alert('请输入执行情况!', '提示', {
							confirmButtonText: '确定'
						});
						return
					}
					saveRegularWork(this.RegularWork).then(res => {
						if (res.success) {
							this.$message.success('保存成功!')
							this.disabledAddNewCustomer = false
							this.getPopupList(this.popupType);
						} else if (!res.success && res.code == 0) {
							this.$alert(res.msg, '提示', {
								confirmButtonText: '确定'
							});
							return;
						} else {
							this.$message.warning(response.msg);
						}
					})
				}
			},
			deleteParameter(row) { //删除
				this.$confirm('是否确定删除?', '提示', {
					type: 'warning',
					cancelButtonClass: 'btn-fr'
				}).then(() => {
					if(this.popupType == 1){
						deleteDefectiveCount(row.id).then(response => {
							if (response.success) {
								this.$message.success('删除成功!')
								this.getPopupList(this.popupType);
							} else {
								this.$message.warning(response.msg)
							}
						})
					}else if(this.popupType == 2){
							deleteWorkCount(row.id).then(response => {
							if (response.success) {
								this.$message.success('删除成功!')
								this.getPopupList(this.popupType);
							} else {
								this.$message.warning(response.msg)
							}
						})
					}else if(this.popupType == 3){
								deleteDynamicCount(row.id).then(response => {
							if (response.success) {
								this.$message.success('删除成功!')
								this.getPopupList(this.popupType);
							} else {
								this.$message.warning(response.msg)
							}
						})
					}else if(this.popupType == 4){
							deleteRegularWork(row.id).then(response => {
											if (response.success) {
												this.$message.success('删除成功!')
												this.getPopupList(this.popupType);
											} else {
												this.$message.warning(response.msg)
											}
							})
					}
				}).catch(res => {})
			}
		}
	};
</script>

</script>
<style scoped>
	.DefectList .dutyEvent-header {
		overflow: hidden;
	}

	.DefectList .query-write-date {
		margin-bottom: 10px;
	}

	.DefectList .fr {
		float: right;
	}

	.DefectList .duty-event-add {
		margin-right: 10px;
	}
</style>
<style>
	.DefectList .el-tooltip__popper {
		width: 700px;
	}
	.DefectList .el-badge__content.is-fixed{
		top:9px!important;
	}
	 .DefectList .el-dialog--small{
		width: 800px;
	}
	.DefectList #popop .el-dialog--small{
		width: 619px;
	}
	.DefectList #popopws .el-dialog--small{
		width: 480px;
	}
	
	.slo{
		overflow: hidden;
		text-overflow:ellipsis;
		white-space:nowrap;
	}
	.DefectList #pop  .el-date-editor.el-input{
		width: 107px;
	}
</style>

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值