	
	var mrcomponent = {
		template:`
		<div>
			<div style="display: flex;">
				<div style="float: left;width: 45%;">
					<div style="display: flex;">
						<el-input v-model="rid_v" placeholder="订单号" clearable style="width: 105px;" @change="input_change"></el-input>
						<el-input v-model="pid_v" placeholder="产品编号" clearable style="width: 105px;" @change="input_change"></el-input>
						
						<el-checkbox style="margin: 0px;" v-model="checked" @change="if_fin_cahnge" border>已处理</el-checkbox>
						
						<el-button id ="bt_serach" plain type="primary" icon="el-icon-search" @click="get_ma_plan()" style="padding-left: 10px;padding-right: 10px;">搜索</el-button>
						<el-button id ="bt_export_process" plain type="primary" icon="el-icon-document" @click="show_export_time_1()" style="margin-left: 0px;padding-left: 10px;padding-right: 10px;">导出工序</el-button>
					</div>
					
					<div >
						<div class="span">
							<el-table
							    :data="tableData"
							    style="width: 100%;font-size:14px"
							    :height="tHeight"
								:row-class-name="tableRowClassName"
								@selection-change="handleSelectionChange"
								border
								@cell-dblclick="celldblclick_1"
								>
								<el-table-column
								  prop="repair_id"
								  label="维修单号"
								  width="120"
								  :show-overflow-tooltip="true"
								  :resizable="false">
								</el-table-column>
								
								<el-table-column
								  prop="p_id"
								  label="产品编号"
								 width="100"
								 :show-overflow-tooltip="true"
								 :resizable="false">
								</el-table-column>
								
								<el-table-column
								  prop="p_serial"
								  label="序列号"
								 width="80"
								 :show-overflow-tooltip="true"
								 :resizable="false">
								</el-table-column>
								<el-table-column
								  prop="state"
								  label="审核状态"
								 width="80"
								 :show-overflow-tooltip="true"
								 :resizable="false">
								</el-table-column>
								
								<el-table-column
								  prop="acd"
								  label="实际完成"
								 width="80"
								 :resizable="false">
								</el-table-column>
							  </el-table>
						</div>
						<div class="block">
						    <span class="demonstration"></span>
						    <el-pagination
						      @size-change="handleSizeChange"
						      @current-change="handleCurrentChange"
						      :current-page="currentPage"
							  :page-sizes="[50,100, 200, 300]"
						      :page-size="pagesize"
							  :total="recordTotal"
						      layout="total, sizes, prev, pager, next, jumper"
						      >
						    </el-pagination>
						  </div>
					</div>
				</div>
				<div style="float: left;width: 45%;margin-left: 50px;">
					<div style="display: flex;">
							<el-input v-model="return_task_v" placeholder="退货任务" clearable style="width: 105px;" @change="input_change"></el-input>
							<el-input v-model="p_id_v" placeholder="产品编号" clearable style="width: 105px;" @change="input_change"></el-input>
							
							<el-checkbox style="margin: 0px;" v-model="checked1" @change="if_fin_cahnge1" border>已处理</el-checkbox>
							
							<el-button id ="bt_serach1" plain type="primary" icon="el-icon-search" @click="get_ma_temp_plan()" style="padding-left: 10px;padding-right: 10px;">搜索</el-button>
							<el-button id ="bt_export_process1" plain type="primary" icon="el-icon-document" @click="show_export_time_2()" style="margin-left: 0px;padding-left: 10px;padding-right: 10px;">导出工序</el-button>
						</div>
						
						<div >
							<div class="span">
								<el-table
								    :data="tableData1"
								    style="width: 100%;font-size:14px"
								    :height="tHeight"
									:row-class-name="tableRowClassName"
									@selection-change="handleSelectionChange"
									border
									@cell-dblclick="celldblclick_2"
									>
									<el-table-column
									  prop="return_task"
									  label="退货任务"
									  width="120"
									  :show-overflow-tooltip="true"
									  :resizable="false">
									</el-table-column>
									
									<el-table-column
									  prop="p_id"
									  label="产品编号"
									 width="100"
									 :show-overflow-tooltip="true"
									 :resizable="false">
									</el-table-column>
									
									<el-table-column
									  prop="p_serial"
									  label="序列号"
									 width="80"
									 :show-overflow-tooltip="true"
									 :resizable="false">
									</el-table-column>
									<el-table-column
									  prop="state"
									  label="审核状态"
									 width="80"
									 :show-overflow-tooltip="true"
									 :resizable="false">
									</el-table-column>
									
									<el-table-column
									  prop="acd"
									  label="实际完成"
									 width="80"
									 :resizable="false">
									</el-table-column>
								  </el-table>
							</div>
							<div class="block">
							    <span class="demonstration"></span>
							    <el-pagination
							      @size-change="handleSizeChange1"
							      @current-change="handleCurrentChange1"
							      :current-page="currentPage1"
								  :page-sizes="[50,100, 200, 300]"
							      :page-size="pagesize1"
								  :total="recordTotal1"
							      layout="total, sizes, prev, pager, next, jumper"
							      >
							    </el-pagination>
							  </div>
						</div>
				</div>
			</div>
			
			<el-dialog
			 title="维保计划"
			 :visible.sync="updatedialogVisible_ex"
			 :lock-scroll ="false"
			 width="95%">
			 <el-form ref="authform_ex" :model="form" :rules="rules" label-width="100px" :inline="false" class="demo-form-inline" size="medium">
				  <el-row :gutter="10">
					  <el-col :span="5">
					  						  <el-form-item label="产品编号" prop="p_id">
					  						  <el-select style="width: 150px;" v-model="form.p_id" :disabled="disabled" clearable filterable placeholder="请选择" remote  :remote-method="remoteMethod" :loading="loading" @change="pid_selectChanged">
					  							 <el-option
					  							   v-for="item in p_id_options"
					  							   :key="item.value"
					  							   :label="item.label"
					  							   :value="item.value">
					  							 </el-option>
					  						   </el-select>
					  						  </el-form-item>
					  </el-col>
					  <el-col :span="5" >
					  							<el-form-item label="产品名称" prop="p_name">
					  							<el-input v-model="form.p_name" :disabled="true"></el-input>
					  							</el-form-item>
					  </el-col>
					  
					  <el-col :span="5" >
					  	<el-form-item label="维保人员" prop="repairer">
					  	<el-select  v-model="form.repairer" clearable filterable placeholder="请选择" :disabled="disabled">
					  	   <el-option
					  		 v-for="item in ma_users"
					  		 :key="item.value"
					  		 :label="item.label"
					  		 :value="item.value">
					  	   </el-option>
					  	 </el-select>
					  	</el-form-item>
					  </el-col>
					  
					  <el-col :span="5" >
					  <el-form-item label="序列号" >
					  <el-input v-model="form.p_serial"></el-input>
					  </el-form-item>
					  </el-col>
				  </el-row>
				  
				  <el-row :gutter="10">
					  <el-col :span="24" >
							<el-form-item label="维修方案" prop="rp">
							<el-input v-model="form.rp"></el-input>
							</el-form-item>
					  </el-col>
				  </el-row>
				<el-row :gutter="10">
					<el-col :span="5" >
						<el-form-item label="实际完成" prop="acd">
						<el-date-picker
							style="width: 150px;"
							 v-model="form.acd"
							 type="date"
							format="yyyy/MM/dd"
							value-format="yyyy/MM/dd">
						</el-date-picker>
						</el-form-item>
					</el-col>
					<el-col :span="5" >
						<el-form-item label="自检记录链接" >
						<el-input v-model="form.link"></el-input>
						</el-form-item>
					</el-col>
					<el-col :span="5" >
						<el-form-item label="是否维修" prop="if_repair">
						<el-select clearable v-model="form.if_repair" style="width: 150px;" clearable >
							 <el-option-group
								   key="1"
								   label="">
								   <el-option label="保外维修" value="保外维修"></el-option>
								   <el-option label="保内维修" value="保内维修"></el-option>
								   <el-option label="不维修" value="不维修"></el-option>
							 </el-option-group>
						</el-select>
						</el-form-item>
					</el-col>
				</el-row>
			 </el-form>
			 
			 <div style="margin-top: 20px;">
				<div>
					<el-button id ="bt_add" plain type="primary" icon="el-icon-circle-plus-outline" @click="showAddkpiplan_1()">新增工序</el-button>
					<span style="margin-left: 10px;">总工时：{{form.total_work_time}}</span>
					<span style="margin-left: 10px;">总费用：{{form.total_work_time*25}}</span>
				</div>
				 <el-table
						:data="form.plan_data"
						style="font-size:14px;margin-top: 10px;width: 100%;"
						:row-class-name="tableRowClassName"
						stripe border>
						<el-table-column
						  prop="produce_plan"
						  label="维修工序"
						  width="160"
						  :show-overflow-tooltip="true">
						</el-table-column>
						<el-table-column
						  prop="produce_plan_use_t"
						  label="工时"
						  width="120">
						</el-table-column>
						<el-table-column
						  prop="times"
						  label="次数"
						  width="120">
						</el-table-column>
						
						<el-table-column
						  prop="produce_user"
						  label="维保人员"
						  width="120">
						</el-table-column>
										
						 <el-table-column
						   prop="p_actual_finished_t"
						   label="完成日期"
						  width="120">
						  </el-table-column>
						  
						  <el-table-column
						    prop="state"
						    label="审核状态"
						   width="120">
						   </el-table-column>
						<el-table-column
							  label="操作"
							  width="120">
							  <template slot-scope="scope">
								  <el-button @click="show_updateplan_dialog(scope.row)" type="text" size="medium" >修改</el-button>
								  <el-button @click="delKpiplan(scope.row)" type="text" size="medium" >删除</el-button>
							  </template>
							</el-table-column>
					  </el-table>
			 </div>
			 <span slot="footer" class="dialog-footer">
			 <el-button @click="updatedialogVisible_ex = false">取 消</el-button>
			 <el-button id ="bt_ok" plain type="primary" @click="update_ma_ex();">审核通过</el-button>
			 </span>
			</el-dialog>
			
			<el-dialog
			 title="维保计划"
			 :visible.sync="updatedialogVisible_ex1"
			 :lock-scroll ="false"
			 width="95%">
			 <el-form ref="authform_ex1" :model="form1" :rules="rules" label-width="120px" :inline="false" class="demo-form-inline" size="medium">
				  <el-row :gutter="10">
					  <el-col :span="5">
							  <el-form-item label="产品编号" prop="p_id">
							  <el-select style="width: 150px;" v-model="form1.p_id" :disabled="disabled" clearable filterable placeholder="请选择" remote  :remote-method="remoteMethod" :loading="loading" @change="pid_selectChanged">
								 <el-option
								   v-for="item in p_id_options"
								   :key="item.value"
								   :label="item.label"
								   :value="item.value">
								 </el-option>
							   </el-select>
							  </el-form-item>
					  </el-col>
					  <el-col :span="5" >
							<el-form-item label="产品名称" prop="p_name">
							<el-input v-model="form1.p_name" :disabled="true"></el-input>
							</el-form-item>
					  </el-col>
					  
					  <el-col :span="5" >
					  	<el-form-item label="维保人员" prop="repairer">
					  	<el-select  v-model="form1.repairer" clearable filterable placeholder="请选择" :disabled="disabled">
					  	   <el-option
					  		 v-for="item in ma_users"
					  		 :key="item.value"
					  		 :label="item.label"
					  		 :value="item.value">
					  	   </el-option>
					  	 </el-select>
					  	</el-form-item>
					  </el-col>
					  
					  <el-col :span="5" >
					  <el-form-item label="序列号" >
					  <el-input v-model="form1.p_serial"></el-input>
					  </el-form-item>
					  </el-col>
					  <el-col :span="4" >
					  	<el-form-item label="维修类型" prop="rt">
					  	<el-select clearable v-model="form1.rt" clearable :disabled="disabled">
					  		 <el-option label="天工" value="天工"></el-option>
					  		  <el-option label="退库" value="退库"></el-option>
					  	</el-select>
					  	</el-form-item>
					  </el-col>
				  </el-row>
				  
				 <el-row>
					  <el-col :span="20" >
							<el-form-item label="工作内容(天工)" prop="work">
							<el-input v-model="form1.work" :disabled="disabled"></el-input>
							</el-form-item>
					  </el-col>
					  <el-col :span="4" >
							<el-form-item label="天工工时(h)" prop="work_h">
							<el-input v-model="form1.work_h" :disabled="disabled"></el-input>
							</el-form-item>
					  </el-col>
				 </el-row>
				  
				  <el-row :gutter="10">
						<el-col :span="12" >
							<el-form-item label="初检分析" >
							<el-input v-model="form1.ia"></el-input>
							</el-form-item>
						</el-col>
						<el-col :span="12" >
							<el-form-item label="维修方案" prop="rp">
							<el-input v-model="form1.rp"></el-input>
							</el-form-item>
						</el-col>
				  </el-row>
				<el-row :gutter="10">
					<el-col :span="5" >
						<el-form-item label="实际完成" prop="acd">
						<el-date-picker
							style="width: 150px;"
							 v-model="form1.acd"
							 type="date"
							format="yyyy/MM/dd"
							value-format="yyyy/MM/dd">
						</el-date-picker>
						</el-form-item>
					</el-col>
					<el-col :span="5" >
						<el-form-item label="自检记录链接" >
						<el-input v-model="form1.link"></el-input>
						</el-form-item>
					</el-col>
				</el-row>
			 </el-form>
			 
			 <div style="margin-top: 20px;">
				<div>
					<el-button id ="bt_add" plain type="primary" icon="el-icon-circle-plus-outline" @click="showAddkpiplan_2()">新增工序</el-button>
					<span style="margin-left: 10px;">总工时：{{form1.total_work_time}}</span>
					<span style="margin-left: 10px;">总费用：{{form1.total_work_time*25}}</span>
				</div>
				 <el-table
						:data="form1.plan_data"
						style="font-size:14px;margin-top: 10px;width: 100%;"
						:row-class-name="tableRowClassName"
						stripe border>
						<el-table-column
						  prop="produce_plan"
						  label="维修工序"
						  width="160"
						  :show-overflow-tooltip="true">
						</el-table-column>
						<el-table-column
						  prop="produce_plan_use_t"
						  label="工时"
						  width="120">
						</el-table-column>
						<el-table-column
						  prop="times"
						  label="次数"
						  width="120">
						</el-table-column>
						
						<el-table-column
						  prop="produce_user"
						  label="维保人员"
						  width="120">
						</el-table-column>
										
						 <el-table-column
						   prop="p_actual_finished_t"
						   label="完成日期"
						  width="120">
						  </el-table-column>
						  
						  <el-table-column
						    prop="state"
						    label="审核状态"
						   width="120">
						   </el-table-column>
						<el-table-column
							  label="操作"
							  width="120">
							  <template slot-scope="scope">
								  <el-button @click="show_updateplan_dialog1(scope.row)" type="text" size="medium" >修改</el-button>
								  <el-button @click="delKpiplan1(scope.row)" type="text" size="medium" >删除</el-button>
							  </template>
							</el-table-column>
					  </el-table>
			 </div>
			 <span slot="footer" class="dialog-footer">
			 <el-button @click="updatedialogVisible_ex1 = false">取 消</el-button>
			 <el-button id ="bt_ok" plain type="primary" @click="update_ma_temp_ex();">审核通过</el-button>
			 </span>
			</el-dialog>
			
			<el-dialog
			v-dialogDrag
			 title="维修工序"
			 :visible.sync="addplanVisible_1"
			 :lock-scroll ="false"
			 width="45%">
			 <el-form ref="planform_1" :model="planform" :rules="rules" label-width="100px" :inline="false" class="demo-form-inline" size="medium">
				  <el-row :gutter="10">
					  <el-col :span="12">
						  <el-form-item label="维修工序" prop="produce_plan">
						  <el-select style="width: 190px;" v-model="planform.produce_plan" clearable filterable placeholder="请选择" @change="process_selectChanged" @clear="setValueNull">
						     <el-option
						       v-for="item in p_process_options"
						       :key="item.value"
						       :label="item.label"
						       :value="item.value">
						     </el-option>
						   </el-select>
						  </el-form-item>
					  </el-col>
					  <el-col :span="12">
						  <el-form-item label="工时" prop="produce_plan_use_t">
						  <el-input style="width: 190px;" v-model="planform.produce_plan_use_t" :disabled="true"></el-input>
						  </el-form-item>
					  </el-col>
				  </el-row>
				  
				  <el-row :gutter="10">
					  <el-col :span="12">
						  <el-form-item label="维保人员" prop="produce_user">
						   <el-select style="width: 190px;" v-model="planform.produce_user" filterable placeholder="请选择">
							  <el-option
								v-for="item in ma_users"
								:key="item.value"
								:label="item.label"
								:value="item.value">
							  </el-option>
							</el-select>
						  </el-form-item>
					  </el-col>
					  <el-col :span="12">
						  <el-form-item label="完成日期" prop="p_actual_finished_t">
						  <el-date-picker
								v-model="planform.p_actual_finished_t"
								type="date"
								placeholder="完成日期"
							  style="width: 190px;"
							  format="yyyy/MM/dd"
							  value-format="yyyy/MM/dd">
						  </el-date-picker>
						  </el-form-item>
					  </el-col>
					</el-row>
					
					<el-row :gutter="10">
						  <el-col :span="12">
							  <el-form-item label="次数" prop="times">
							  <el-input-number v-model="planform.times" :min="1" :max="1000" ></el-input-number>
							  </el-form-item>
						  </el-col>
					</el-row>
						
			 </el-form>
			 <span slot="footer" class="dialog-footer">
			 <el-button @click="addplanVisible_1 = false">取 消</el-button>
			 <el-button id ="bt_ok" plain type="primary" @click="addkpiplan_1();">确 定</el-button>
			 </span>
			</el-dialog>
			
			<el-dialog
			v-dialogDrag
			 title="维修工序"
			 :visible.sync="addplanVisible_2"
			 :lock-scroll ="false"
			 width="45%">
			 <el-form ref="planform_2" :model="planform" :rules="rules" label-width="100px" :inline="false" class="demo-form-inline" size="medium">
				  <el-row :gutter="10">
					  <el-col :span="12">
						  <el-form-item label="维修工序" prop="produce_plan">
						  <el-select style="width: 190px;" v-model="planform.produce_plan" clearable filterable placeholder="请选择" @change="process_selectChanged" @clear="setValueNull">
						     <el-option
						       v-for="item in p_process_options"
						       :key="item.value"
						       :label="item.label"
						       :value="item.value">
						     </el-option>
						   </el-select>
						  </el-form-item>
					  </el-col>
					  <el-col :span="12">
						  <el-form-item label="工时" prop="produce_plan_use_t">
						  <el-input style="width: 190px;" v-model="planform.produce_plan_use_t" :disabled="true"></el-input>
						  </el-form-item>
					  </el-col>
				  </el-row>
				  
				  <el-row :gutter="10">
					  <el-col :span="12">
						  <el-form-item label="维保人员" prop="produce_user">
						   <el-select style="width: 190px;" v-model="planform.produce_user" filterable placeholder="请选择">
							  <el-option
								v-for="item in ma_users"
								:key="item.value"
								:label="item.label"
								:value="item.value">
							  </el-option>
							</el-select>
						  </el-form-item>
					  </el-col>
					  <el-col :span="12">
						  <el-form-item label="完成日期" prop="p_actual_finished_t">
						  <el-date-picker
								v-model="planform.p_actual_finished_t"
								type="date"
								placeholder="完成日期"
							  style="width: 190px;"
							  format="yyyy/MM/dd"
							  value-format="yyyy/MM/dd">
						  </el-date-picker>
						  </el-form-item>
					  </el-col>
					</el-row>
					
					<el-row :gutter="10">
						  <el-col :span="12">
							  <el-form-item label="次数" prop="times">
							  <el-input-number v-model="planform.times" :min="1" :max="1000" ></el-input-number>
							  </el-form-item>
						  </el-col>
					</el-row>
						
			 </el-form>
			 <span slot="footer" class="dialog-footer">
			 <el-button @click="addplanVisible_2 = false">取 消</el-button>
			 <el-button id ="bt_ok" plain type="primary" @click="addkpiplan_2();">确 定</el-button>
			 </span>
			</el-dialog>
			
			<el-dialog
			v-dialogDrag
			 title="时间选择"
			 :visible.sync="export_time_Visible"
			 :lock-scroll ="false"
			 width="45%">
			 <el-form ref="timeform_1" :model="timeform" :rules="rules" label-width="100px" :inline="false" class="demo-form-inline" size="medium">
				  <el-row :gutter="10">
					  <el-col :span="12">
						  <el-form-item label="开始日期" >
						  <el-date-picker
								v-model="timeform.bt"
								type="date"
								placeholder="开始日期"
							  style="width: 190px;"
							  format="yyyy/MM/dd"
							  value-format="yyyy/MM/dd">
						  </el-date-picker>
						  </el-form-item>
					  </el-col>
					  
					  <el-col :span="12">
						  <el-form-item label="结束日期" >
						  <el-date-picker
								v-model="timeform.et"
								type="date"
								placeholder="结束日期"
							  style="width: 190px;"
							  format="yyyy/MM/dd"
							  value-format="yyyy/MM/dd">
						  </el-date-picker>
						  </el-form-item>
					  </el-col>
					</el-row>
			 </el-form>
			 <span slot="footer" class="dialog-footer">
			 <el-button @click="export_time_Visible = false">取 消</el-button>
			 <el-button v-if="export_type==1" id ="bt_ok" plain type="primary" @click="export_plan_process();">确 定</el-button>
			 <el-button v-if="export_type==2" id ="bt_ok" plain type="primary" @click="export_temp_plan_process();">确 定</el-button>
			 </span>
			</el-dialog>
			
		</div>
		`,
	data(){
		// 获取当前屏幕的分辨率
		let screenW = window.screen.width;
		let screenH = window.screen.height;
		console.log("screen width:",screenW);
		console.log("screen height:",screenH);
	  return {
		tHeight:screenH*0.7,
		tableData: Array(0),
		tableData1: Array(0),
		currentPage: 1,
		currentPage1: 1,
		pagesize:50,
		pagesize1:50,
		pagecnt:1,
		pagecnt1:1,
		recordTotal:0,
		recordTotal1:0,
		
		checked:false,
		id_v:'',
		rid_v:'',
		pid_v:'',
		pname_v:'',
		repairer_v:'',
		rs_v:'',
		regional_head_v:'',
		ms_v:'',
		asc_v:'',
		location_v:'',
		m_station_v:'',
		
		updatedialogVisible_ex:false,
		form: {
			id:0,
			recv_date:'',
			dispath_date:'',
			repair_id:'',
			repair_report_id:'',
			customer:'',
			regional_head:'',
			p_id:'',
			p_name:'',
			
			repairer:'',
			rp:'',
			ms:'',
			rc:'',
			rqd:'',
			rs:'',
			rod:'',
			if_repair:'',
			ccd:'',
			acd:'',
			overdue:'',
			quotation:'',
			mcd:'',
			mt:'',
			
			p_serial:'',
			inventory:'',
			
			doi:'',
			link:'',
			
			total_work_time:0,
			total_cost:0,
			
			plan_data:[],
			
			work_h:'',
		},
		rules: {
			product_id: [
			    { required: true, message: '产品编号不可为空', trigger: 'blur' }
			],
			produce_plan: [
			    { required: true, message: '工序名称不可为空', trigger: 'blur' }
			],
			produce_user: [
			    { required: true, message: '维保人员不可为空', trigger: 'blur' }
			],
			p_actual_finished_t: [
			    { required: true, message: '完成日期不可为空', trigger: 'blur' }
			],
			times: [
			    { required: true, message: '次数不可为空', trigger: 'blur' }
			],
		},
		
		options: [],
		multipleSelection: [],

		if_del_show:false,
		if_del:false,
		
		p_id_options:[],
		
		loading: false,
		
		ma_users:[],
		disabled:false,
		
		if_do:true,
		rs_data:[],
		
		level:0,
		
		addplanVisible_1:false,
		maxid:-1,
		planform: {
			id:0,
			produce_plan:'',
			produce_plan_use_t:'',
			produce_user:'',
			p_actual_finished_t:'',
			times:1,
		},
		plan_op_type:0,
		
		p_process_options:[],
		cur_p_process:'',
		
		approve_flag:false,
		
		loc:'',
		
		return_task_v:'',
		p_id_v:'',
		checked1:false,
		
		updatedialogVisible_ex1:false,
		form1: {
			id:0,
			recv_date:'',
			dispath_date:'',
			
			return_task:'',
			head:'',
			p_id:'',
			p_name:'',
			p_serial:'',
						
			repairer:'',
			rt:'',
			work:'',
			ia:'',
			rp:'',
			acd:'',
			link:'',
			ms:'',
			mt:'',
			
			total_work_time:0,
			total_cost:0,
			plan_data:[],
		},
		addplanVisible_2:false,
		
		timeform:{
			bt:'',
			et:'',
		},
		export_time_Visible:false,
		export_type:1,
	  }
	},
	mounted() {
		var op_user = localStorage.getItem("online_user");
		if (op_user =="霍涛"){
			this.$data.approve_flag=true;
		}
		var loc = localStorage.getItem("loc");
		this.$data.loc=loc;
		
		var level = localStorage.getItem("level");
		this.$data.level=level;
		var did = localStorage.getItem("did");
		
		if (level==1 ){
			this.$data.if_del_show =true;
		}
		this.get_ma_user();
		this.get_rs();
		this.get_ma_plan();
		this.get_ma_temp_plan();
	},
	methods: {
		show_export_time_1(){
			this.$data.timeform.bt="";
			this.$data.timeform.et="";
			this.export_time_Visible=true;
			this.export_type =1;
		},
		
		show_export_time_2(){
			this.$data.timeform.bt="";
			this.$data.timeform.et="";
			this.export_time_Visible=true;
			this.export_type =2;
		},
		
		export_temp_plan_process(){
			this.$data.export_time_Visible = false;
			document.getElementById("bt_export_process1").blur();
			
			var _this = this;
			var objs;
			axios.post('/u_ma/export_ma_plan_processes', {
				opuser:localStorage.getItem("online_user"),
				opuser_uuid:localStorage.getItem("uuid"),
				rid:this.$data.rid_v,
				pid:this.$data.pid_v,
				bt:this.$data.timeform.bt,
				et:this.$data.timeform.et,
			  })
			  .then(function (response) {
				  
				var date = new Date();
				//年 getFullYear()：四位数字返回年份
				var year = date.getFullYear()%2000; //getFullYear()代替getYear()
				console.log(year.toString());
				//月 getMonth()：0 ~ 11
				var month = date.getMonth() + 1;
				if(month<10){
					month='0'+month
				}
				//日 getDate()：(1 ~ 31)
				var day = date.getDate();
				if(day<10){
					day='0'+day;
				}
				//时 getHours()：(0 ~ 23)
				var hour = date.getHours();
				if (hour<10){
					hour='0'+hour;
				}
				//分 getMinutes()： (0 ~ 59)
				var minute = date.getMinutes();
				if (minute<10){
					minute='0'+minute;
				}
				//秒 getSeconds()：(0 ~ 59)
				var second = date.getSeconds();
				if (second<10){
					second='0'+second;
				}
				
				var filename=year.toString()+month.toString()+day.toString() +" " + hour.toString()+minute.toString()+second.toString();
				filename = "临时工作工序 "+filename+".xlsx"
				console.log(response.data);
				var fileid = response.data.fileId;
				
				var downUrl = '/u_ma/download_file'+"?id="+fileid;
				downloadUrl(filename,downUrl);
			  })
			  .catch(function (error) {
				console.log(error);
			  });
		},
		
		update_ma_temp_ex(){
			  this.$refs['authform_ex1'].validate((valid) => {
				if (valid) {
					var _this = this;
					axios.post('/u_ma/update_ma_temp_ex', {
						opuser:localStorage.getItem("online_user"),
						opuser_uuid:localStorage.getItem("uuid"),
						data:{
							id:_this.form1.id,
							recv_date:_this.form1.recv_date,
							
							return_task:_this.form1.return_task,
							head:_this.form1.head,
							p_id:_this.form1.p_id,
							p_name:_this.form1.p_name,
							p_serial:_this.form1.p_serial,
										
							repairer:_this.form1.repairer,
							rt:_this.form1.rt,
							work:_this.form1.work,
							ia:_this.form1.ia,
							rp:_this.form1.rp,
							acd:_this.form1.acd,
							link:_this.form1.link,
							ms:_this.form1.ms,
							mt:_this.form1.mt,
							
							total_work_time:_this.form1.total_work_time.toString(),
							plan_data:_this.form1.plan_data,
						}
					})
					.then(function (response) {
						
						let r = response.data.r;
						let s = ""
						let errType = ""
						if (r == 0) {
							errType = "success"
							s = "修改成功！";
						} else if(r==1){
							errType = "error"
							s = "无权限!";
						}else{
							errType = "error"
							s = "修改失败！";
						}
						_this.$message({
							message: s,
							type: errType,
							duration: 1500
						});
						//更新页面
						
						if(r==0){
							_this.get_ma_temp_plan();
							_this.$data.updatedialogVisible_ex1 = false;
						}
					})
					.catch(function (error) {
					  console.log(error);
					});
				}
			  });
		  },
		delKpiplan1(row){
			var op_user = localStorage.getItem("online_user");
			var level = localStorage.getItem("level");
			if (op_user !="霍涛" && level!=1 && row.state == "已审核"){
				this.$message({
					message: "工序已审核，用户无权限修改",
					type: "warning",
					duration: 1500
				});
				return;
			}
			
			var index =-1;
			for(var i=0;i<this.$data.form1.plan_data.length;++i){
				if(this.$data.form1.plan_data[i].id==row.id){
					index=i;
					break;
				}
			}
			if (index > -1) { 
				this.$data.form1.plan_data.splice(index, 1); 
			} 
		},
		show_updateplan_dialog1(row){
			
			var op_user = localStorage.getItem("online_user");
			var level = localStorage.getItem("level");
			if (op_user !="霍涛" && level!=1 && row.state == "已审核"){
				this.$message({
					message: "工序已审核，用户无权限修改",
					type: "warning",
					duration: 1500
				});
				return;
			}
			
			var _this = this;
			  
			axios.post('/u_ma/get_p_process_options',{
				opuser:localStorage.getItem("online_user"),
				opuser_uuid:localStorage.getItem("uuid"),
				pid:_this.$data.form1.p_id,
			})
			  .then(function (response) {
				_this.$data.p_process_options=[];
				console.log(response.data);
				_this.$data.cur_p_process = response.data;
				objs = response.data.data;
				for(var i=0;i<objs.length;++i){
					var obj ={
						value:objs[i].process_name,
						label:objs[i].process_name,
					}
					_this.$data.p_process_options.push(obj);
				}
			  })
			  .catch(function (error) {
			    console.log(error);
			  });
			  
			this.$data.planform.produce_plan=row.produce_plan;
			this.$data.planform.produce_plan_use_t=row.produce_plan_use_t;
			this.$data.planform.produce_user=row.produce_user;
			this.$data.planform.id =row.id;
			
			this.$data.planform.p_actual_finished_t=row.p_actual_finished_t;
			this.$data.planform.times=row.times;
			
			this.$data.plan_op_type=2;
			this.$nextTick(() => {
				this.$refs['planform_2'].clearValidate()
			});
			this.$data.addplanVisible_2=true;
		},
		
		addkpiplan_2(){
			this.$refs['planform_2'].validate((valid) => {
				if (valid) {
					if (this.$data.plan_op_type==1) {
						var obj ={
							id:this.$data.maxid,
							produce_plan:this.$data.planform.produce_plan,
							produce_plan_use_t:this.$data.planform.produce_plan_use_t,
							produce_user:this.$data.planform.produce_user,
							p_actual_finished_t:this.$data.planform.p_actual_finished_t,
							times:this.$data.planform.times,
						}
						console.log(this.$data.form1);
						this.$data.form1.plan_data.push(obj);
						
						this.$data.maxid+=1;
						console.log("id:",this.$data.maxid);
					} else if (this.$data.plan_op_type==2){
						console.log(this.$data.form1.plan_data);
						for(var i=0;i<this.$data.form1.plan_data.length;++i){
							if(this.$data.form1.plan_data[i].id==this.$data.planform.id){
								this.$data.form1.plan_data[i].produce_plan=this.$data.planform.produce_plan;
								this.$data.form1.plan_data[i].produce_plan_use_t=this.$data.planform.produce_plan_use_t;
								this.$data.form1.plan_data[i].produce_user=this.$data.planform.produce_user;
								this.$data.form1.plan_data[i].p_actual_finished_t=this.$data.planform.p_actual_finished_t;
								this.$data.form1.plan_data[i].times=this.$data.planform.times;
								console.log(this.$data.form1.plan_data);
								break;
							}
						}
					}
					
					var total =0
					for(var i=0;i<this.$data.form1.plan_data.length;++i){
						console.log("工时：",parseFloat(this.$data.form1.plan_data[i].produce_plan_use_t));
						var t = parseFloat(this.$data.form1.plan_data[i].produce_plan_use_t)
						t = t * this.$data.form1.plan_data[i].times;
						total = total+t;
					}
					console.log("总工时：",total.toFixed(2));
					this.$data.form1.total_work_time=total.toFixed(2);
					this.$data.addplanVisible_2 = false;
				}
			});
		},
		showAddkpiplan_2(){
			var _this = this;
			  
			axios.post('/u_ma/get_p_process_options',{
				opuser:localStorage.getItem("online_user"),
				opuser_uuid:localStorage.getItem("uuid"),
				pid:_this.$data.form1.p_id,
			})
			  .then(function (response) {
				_this.$data.p_process_options=[];
				console.log(response.data);
				_this.$data.cur_p_process = response.data;
				objs = response.data.data;
				for(var i=0;i<objs.length;++i){
					var obj ={
						value:objs[i].process_name,
						label:objs[i].process_name,
					}
					_this.$data.p_process_options.push(obj);
				}
			  })
			  .catch(function (error) {
			    console.log(error);
			  });
			  
			this.$data.planform.produce_plan='';
			this.$data.planform.produce_plan_use_t='';
			this.$data.planform.produce_user='';
			this.$data.planform.p_actual_finished_t='';
			this.$data.planform.times=1;
			this.$data.plan_op_type=1;
			
			for (var i = 0; i < this.$data.form1.plan_data.length; i++) {
				 if(this.$data.form1.plan_data[i].id >this.$data.maxid){
					 this.$data.maxid = this.$data.form1.plan_data[i].id
				 }
			}
			if(this.$data.maxid !=-1){
				this.$data.maxid+=1;
			}else{
				this.$data.maxid = 0;
			}
			
			this.$nextTick(() => {
				this.$refs['planform_2'].clearValidate()
			});
			this.$data.addplanVisible_2=true;
		},
		show_update_dialog1(row){
			console.log(row);
			  var recv_date;
			  if(row.recv_date !=undefined &&row.recv_date.length>0){
				  recv_date="20"+row.recv_date
			  }else{
				  recv_date=''
			  }
			  
			  var acd;
			  if (row.acd != undefined && row.acd.length>0){
					acd="20"+row.acd;
			  }else{
					acd='';
			  }
			  
			  this.$data.form1 = {
			  	id:row.id,
			  	recv_date:recv_date,
			  	
			  	return_task:row.return_task,
			  	head:row.head,
			  	p_id:row.p_id,
			  	p_name:row.p_name,
			  	p_serial:row.p_serial,
			  				
			  	repairer:row.repairer,
			  	rt:row.rt,
			  	work:row.work,
				work_h:row.work_h,
			  	ia:row.ia,
			  	rp:row.rp,
			  	acd:acd,
			  	link:row.link,
			  	ms:row.ms,
			  	mt:row.mt,
				
				total_work_time:row.total_work_time,
				total_cost:row.total_cost,
				
				if_repair:row.if_repair,
				
				plan_data:[],
			  };
			
			for(var i=0;i<row.plan_data.length;++i){
				let times = 1
				if(row.plan_data[i].times>times){
					times=row.plan_data[i].times;
				}
				
				let obj = {
					id:row.plan_data[i].id,
					produce_plan:row.plan_data[i].produce_plan,
					produce_plan_use_t:row.plan_data[i].produce_plan_use_t,
					produce_user:row.plan_data[i].produce_user,
					p_actual_finished_t:row.plan_data[i].p_actual_finished_t,
					state:row.plan_data[i].state,
					times:times,
				}
				this.$data.form1.plan_data.push(obj);
			}
			console.log(this.$data.form1)
			  
			this.get_ma_user();
			//this.get_rs();
			
			var op_user = localStorage.getItem("online_user");
			var level = localStorage.getItem("level");
			var did = localStorage.getItem("did");
			if(level==1){
				this.$data.disabled=false;
			}else{
				this.$data.disabled =true;
			}
			this.$data.updatedialogVisible_ex1 = true;
		  },
		
		if_fin_cahnge1(val){
			this.get_ma_temp_plan();
		},
		get_ma_temp_plan(){
			document.getElementById("bt_serach1").blur();
			var _this = this;
			var objs;
			axios.post('/u_ma/get_ma_temp_plan_fin', {
				opuser:localStorage.getItem("online_user"),
				opuser_uuid:localStorage.getItem("uuid"),
				index: this.$data.currentPage,
				count: this.$data.pagesize,
				rid:this.$data.return_task_v,
				p_id:this.$data.p_id_v,
				if_done:this.$data.checked1,
			  })
			  .then(function (response) {
				console.log(response.data);
				objs = response.data.data;
				rcnt = response.data.total;
				_this.$data.tableData1 = objs;
				_this.$data.recordTotal1 = rcnt;
			  })
			  .catch(function (error) {
				console.log(error);
			  });
		},
		 
		handleSizeChange1(val) {
			  //console.log(`每页 ${val} 条`);
			this.$data.pagesize = val;
			this.get_ma_temp_plan();
		},
		
		handleCurrentChange1(val) {
		  //console.log(`当前页: ${val}`);
		  this.$data.currentPage = val;
		  this.get_ma_temp_plan();
		},
		
		export_plan_process(){
			this.$data.export_time_Visible = false;
			document.getElementById("bt_export_process").blur();
			
			var _this = this;
			var objs;
			axios.post('/u_ma/export_processes', {
				opuser:localStorage.getItem("online_user"),
				opuser_uuid:localStorage.getItem("uuid"),
				rid:this.$data.rid_v,
				if_done:this.$data.checked,
				repairer:this.$data.repairer_v,
				rs:this.$data.rs_v,
				regional_head:this.$data.regional_head_v,
				ms:this.$data.ms_v,
				sort_field:this.$data.asc_v,
				location:this.$data.location_v,
				pid:this.$data.pid_v,
				pname:this.$data.pname_v,
				station:this.$data.m_station_v,
				bt:this.$data.timeform.bt,
				et:this.$data.timeform.et,
			  })
			  .then(function (response) {
				  
				var date = new Date();
				//年 getFullYear()：四位数字返回年份
				var year = date.getFullYear()%2000; //getFullYear()代替getYear()
				console.log(year.toString());
				//月 getMonth()：0 ~ 11
				var month = date.getMonth() + 1;
				if(month<10){
					month='0'+month
				}
				//日 getDate()：(1 ~ 31)
				var day = date.getDate();
				if(day<10){
					day='0'+day;
				}
				//时 getHours()：(0 ~ 23)
				var hour = date.getHours();
				if (hour<10){
					hour='0'+hour;
				}
				//分 getMinutes()： (0 ~ 59)
				var minute = date.getMinutes();
				if (minute<10){
					minute='0'+minute;
				}
				//秒 getSeconds()：(0 ~ 59)
				var second = date.getSeconds();
				if (second<10){
					second='0'+second;
				}
				
				var filename=year.toString()+month.toString()+day.toString() +" " + hour.toString()+minute.toString()+second.toString();
				filename = "工序 "+filename+".xlsx"
				console.log(response.data);
				var fileid = response.data.fileId;
				
				var downUrl = '/u_ma/download_file'+"?id="+fileid;
				downloadUrl(filename,downUrl);
			  })
			  .catch(function (error) {
				console.log(error);
			  });
		},
		
		delKpiplan(row){
			var op_user = localStorage.getItem("online_user");
			var level = localStorage.getItem("level");
			if (op_user !="霍涛" && level!=1 && row.state == "已审核"){
				this.$message({
					message: "工序已审核，用户无权限修改",
					type: "warning",
					duration: 1500
				});
				return;
			}
			
			var index =-1;
			for(var i=0;i<this.$data.form.plan_data.length;++i){
				if(this.$data.form.plan_data[i].id==row.id){
					index=i;
					break;
				}
			}
			if (index > -1) { 
				this.$data.form.plan_data.splice(index, 1); 
			} 
		},
		show_updateplan_dialog(row){
			
			var op_user = localStorage.getItem("online_user");
			var level = localStorage.getItem("level");
			if (op_user !="霍涛" && level!=1 && row.state == "已审核"){
				this.$message({
					message: "工序已审核，用户无权限修改",
					type: "warning",
					duration: 1500
				});
				return;
			}
			
			var _this = this;
			  
			axios.post('/u_ma/get_p_process_options',{
				opuser:localStorage.getItem("online_user"),
				opuser_uuid:localStorage.getItem("uuid"),
				pid:_this.$data.form.p_id,
			})
			  .then(function (response) {
				_this.$data.p_process_options=[];
				console.log(response.data);
				_this.$data.cur_p_process = response.data;
				objs = response.data.data;
				for(var i=0;i<objs.length;++i){
					var obj ={
						value:objs[i].process_name,
						label:objs[i].process_name,
					}
					_this.$data.p_process_options.push(obj);
				}
			  })
			  .catch(function (error) {
			    console.log(error);
			  });
			  
			this.$data.planform.produce_plan=row.produce_plan;
			this.$data.planform.produce_plan_use_t=row.produce_plan_use_t;
			this.$data.planform.produce_user=row.produce_user;
			this.$data.planform.id =row.id;
			
			this.$data.planform.p_actual_finished_t=row.p_actual_finished_t;
			this.$data.planform.times=row.times;
			
			this.$data.plan_op_type=2;
			this.$nextTick(() => {
				this.$refs['planform_1'].clearValidate()
			});
			this.$data.addplanVisible_1=true;
		},
		
		setValueNull(val) {
			this.$data.planform.produce_plan_use_t='';
		},
		process_selectChanged(value){
			console.log("select change");
			console.log(value);
			console.log(this.$data.cur_p_process.data);
			for(var i=0; i <this.$data.cur_p_process.data.length;++i){
				if(this.$data.cur_p_process.data[i].process_name == value){
					this.$data.planform.produce_plan_use_t = this.$data.cur_p_process.data[i].process_t
					console.log("find");
					console.log(this.$data.planform.produce_plan_use_t);
					break;
				}
			}
		},
		addkpiplan_1(){
			
			this.$refs['planform_1'].validate((valid) => {
				if (valid) {
					if (this.$data.plan_op_type==1) {
						var obj ={
							id:this.$data.maxid,
							produce_plan:this.$data.planform.produce_plan,
							produce_plan_use_t:this.$data.planform.produce_plan_use_t,
							produce_user:this.$data.planform.produce_user,
							p_actual_finished_t:this.$data.planform.p_actual_finished_t,
							times:this.$data.planform.times,
						}
						console.log(this.$data.form);
						this.$data.form.plan_data.push(obj);
						
						this.$data.maxid+=1;
						console.log("id:",this.$data.maxid);
					} else if (this.$data.plan_op_type==2){
						console.log(this.$data.form.plan_data);
						for(var i=0;i<this.$data.form.plan_data.length;++i){
							if(this.$data.form.plan_data[i].id==this.$data.planform.id){
								this.$data.form.plan_data[i].produce_plan=this.$data.planform.produce_plan;
								this.$data.form.plan_data[i].produce_plan_use_t=this.$data.planform.produce_plan_use_t;
								this.$data.form.plan_data[i].produce_user=this.$data.planform.produce_user;
								this.$data.form.plan_data[i].p_actual_finished_t=this.$data.planform.p_actual_finished_t;
								this.$data.form.plan_data[i].times=this.$data.planform.times;
								console.log(this.$data.form.plan_data);
								break;
							}
						}
					}
					
					var total =0
					for(var i=0;i<this.$data.form.plan_data.length;++i){
						console.log("工时：",parseFloat(this.$data.form.plan_data[i].produce_plan_use_t));
						var t = parseFloat(this.$data.form.plan_data[i].produce_plan_use_t)
						t = t * this.$data.form.plan_data[i].times;
						total = total+t;
					}
					console.log("总工时：",total);
					this.$data.form.total_work_time=total;
					this.$data.addplanVisible_1 = false;
				}
			});
		},
		showAddkpiplan_1(){
			var _this = this;
			  
			axios.post('/u_ma/get_p_process_options',{
				opuser:localStorage.getItem("online_user"),
				opuser_uuid:localStorage.getItem("uuid"),
				pid:_this.$data.form.p_id,
			})
			  .then(function (response) {
				_this.$data.p_process_options=[];
				console.log(response.data);
				_this.$data.cur_p_process = response.data;
				objs = response.data.data;
				for(var i=0;i<objs.length;++i){
					var obj ={
						value:objs[i].process_name,
						label:objs[i].process_name,
					}
					_this.$data.p_process_options.push(obj);
				}
			  })
			  .catch(function (error) {
			    console.log(error);
			  });
			  
			this.$data.planform.produce_plan='';
			this.$data.planform.produce_plan_use_t='';
			this.$data.planform.produce_user='';
			this.$data.planform.p_actual_finished_t='';
			this.$data.planform.times=1;
			this.$data.plan_op_type=1;
			
			for (var i = 0; i < this.$data.form.plan_data.length; i++) {
				 if(this.$data.form.plan_data[i].id >this.$data.maxid){
					 this.$data.maxid = this.$data.form.plan_data[i].id
				 }
			}
			if(this.$data.maxid !=-1){
				this.$data.maxid+=1;
			}else{
				this.$data.maxid = 0;
			}
			
			this.$nextTick(() => {
				this.$refs['planform_1'].clearValidate()
			});
			this.$data.addplanVisible_1=true;
		},
		
		get_rs(){
			var _this = this;
			axios.post('/u_ma/get_rs',{
				opuser:localStorage.getItem("online_user"),
				opuser_uuid:localStorage.getItem("uuid"),
			})
			  .then(function (response) {
				_this.$data.rs_data=[];
				console.log(response.data);
				
				objs = response.data.data;
				for(var i=0;i<objs.length;++i){
					var obj ={
						value:objs[i].rs,
						label:objs[i].rs
					}
					_this.$data.rs_data.push(obj);
				}
			  })
			  .catch(function (error) {
			    console.log(error);
			  });
		},
		
		
		get_ma_user(){
			var _this = this;
			axios.post('/u_ma/get_ma_username',{
				opuser:localStorage.getItem("online_user"),
				opuser_uuid:localStorage.getItem("uuid"),
				location:_this.$data.location_v,
			})
			  .then(function (response) {
				_this.$data.ma_users=[];
				console.log(response.data);
				
				objs = response.data.data;
				for(var i=0;i<objs.length;++i){
					var obj ={
						value:objs[i],
						label:objs[i]
					}
					_this.$data.ma_users.push(obj);
				}
			  })
			  .catch(function (error) {
			    console.log(error);
			  });
		},
		celldblclick_2(row, column, cell, event){
		  this.show_update_dialog1(row);
		},
		
		celldblclick_1(row, column, cell, event){
		  this.show_update_dialog(row);
		},
		to_redmine(row){
			if(row.mt!=""){
				url = encodeURI("http://123.54.1.214:10010/redmine/issues/"+row.mt);
				window.open(url, "");
			}
		},
		input_change(value) {
			console.log(value);
			this.get_ma_plan();
			
			if(this.$data.location_v !=""){
				this.get_ma_user();
			}
		},
		pid_selectChanged(value){
			console.log("select change");
			this.loading = true;
			var _this=this;
			axios.post('/u_ma/get_p_name',{
				opuser:localStorage.getItem("online_user"),
				opuser_uuid:localStorage.getItem("uuid"),
				p_id:value,
			})
			  .then(function (response) {
					_this.$data.form.p_name = response.data.p_name;
			  })
			  .catch(function (error) {
			    console.log(error);
			  });
		},
		remoteMethod(query) {
			  if (query !== '') {
				this.loading = true;
				setTimeout(() => {
				  
				  var _this=this;
				  axios.post('/u_ma/get_p_id_options',{
				  	opuser:localStorage.getItem("online_user"),
				  	opuser_uuid:localStorage.getItem("uuid"),
					p_like_id:query,
				  })
				    .then(function (response) {
						_this.$data.p_id_options=[];
						console.log(response.data);
						objs = response.data.data;
						for(var i=0;i<objs.length;++i){
							var obj ={
								value:objs[i],
								label:objs[i],
							}
							_this.$data.p_id_options.push(obj);
						}
						_this.$data.loading = false;
						console.log(_this.$data.loading)
				    })
				    .catch(function (error) {
				      console.log(error);
					  _this.$data.loading = false;
				    });
				}, 200);
			  } else {
				_this.$data.p_id_options = [];
			  }
		},
		if_fin_cahnge(val){
			if(val){
				this.$data.if_do=false;
			}else{
				this.$data.if_do=true;
			}
			
			this.get_ma_plan();
		},
		
		download_template(){
			document.getElementById("bt_download").blur();
			
			var downUrl = '/u_ma/download_file'+"?id="+"导入维保计划.csv";
			downloadUrl("维保计划导入文件模板.csv",downUrl);
		},
		
		handleSelectionChange(val) {
			console.log("已选择");
			console.log(val);
			this.multipleSelection = val;
		},
		
		tableRowClassName({row, rowIndex}) {
				var n = rowIndex%2;
				if (n == 1) {
					return 'success-row';
				}
				return '';
		},
		show_update_dialog(row){
			console.log(row);
			
			
			  var recv_date;
			  if(row.recv_date !=undefined &&row.recv_date.length>0){
				  recv_date="20"+row.recv_date
			  }else{
				  recv_date=''
			  }
			  
			  var dispath_date;
			  if (row.dispath_date !=undefined &&row.dispath_date.length>0){
				  dispath_date="20"+row.dispath_date;
			  }else{
				  dispath_date=''
			  }
			  
			  var rqd;
			  if (row.rqd != undefined && row.rqd.length>0){
				   rqd="20"+row.rqd;
			  }else{
				  rqd='';
			  }
			  
			  var rod;
			  if (row.rod != undefined && row.rod.length>0){
					rod="20"+row.rod;
			  }else{
					rod='';
			  }
			  
			  var ccd;
			  if (row.ccd != undefined && row.ccd.length>0){
					ccd="20"+row.ccd;
			  }else{
					ccd='';
			  }
			  
			  var acd;
			  if (row.acd != undefined && row.acd.length>0){
					acd="20"+row.acd;
			  }else{
					acd='';
			  }
			  
			  var mcd;
			  if (row.mcd != undefined && row.mcd.length>0){
					mcd="20"+row.mcd;
			  }else{
					mcd='';
			  }
			  
			  var doi;
			  if (row.doi != undefined && row.doi.length>0){
					doi="20"+row.doi;
			  }else{
					doi='';
			  }
			  
			  this.$data.form = {
			  	id:row.id,
			  	recv_date:recv_date,
			  	dispath_date:dispath_date,
			  	repair_id:row.repair_id,
			  	repair_report_id:row.repair_report_id,
			  	customer:row.customer,
			  	regional_head:row.regional_head,
			  	p_id:row.p_id,
			  	p_name:row.p_name,
			  	
			  	repairer:row.repairer,
			  	rp:row.rp,
			  	ms:row.ms,
			  	rc:row.rc,
			  	rqd:rqd,
			  	rs:row.rs,
			  	rod:rod,
			  	if_repair:row.if_repair,
			  	ccd:ccd,
			  	acd:acd,
			  	overdue:row.overdue,
			  	quotation:row.quotation,
			  	mcd:mcd,
			  	mt:row.mt,
				
				p_serial:row.p_serial,
				inventory:row.inventory,
				
				doi:doi,
				link:row.link,
				
				total_work_time:row.total_work_time,
				total_cost:row.total_cost,
				
				plan_data:[],
			  };
			
			for(var i=0;i<row.plan_data.length;++i){
				let times = 1
				if(row.plan_data[i].times>times){
					times=row.plan_data[i].times;
				}
				
				let obj = {
					id:row.plan_data[i].id,
					produce_plan:row.plan_data[i].produce_plan,
					produce_plan_use_t:row.plan_data[i].produce_plan_use_t,
					produce_user:row.plan_data[i].produce_user,
					p_actual_finished_t:row.plan_data[i].p_actual_finished_t,
					state:row.plan_data[i].state,
					times:times,
				}
				this.$data.form.plan_data.push(obj);
			}
			console.log(this.$data.form)
			  
			this.get_ma_user();
			this.get_rs();
			
			var op_user = localStorage.getItem("online_user");
			var level = localStorage.getItem("level");
			var did = localStorage.getItem("did");
			if(level==1){
				this.$data.disabled=false;
			}else{
				this.$data.disabled =true;
			}
			this.$data.updatedialogVisible_ex = true;
		  },
		  
		update_ma_ex(){
			  this.$refs['authform_ex'].validate((valid) => {
				if (valid) {
					var _this = this;
					axios.post('/u_ma/update_ma_plan_ex1', {
						opuser:localStorage.getItem("online_user"),
						opuser_uuid:localStorage.getItem("uuid"),
						data:{
							id:_this.form.id,
							recv_date:_this.form.recv_date,
							dispath_date:_this.form.dispath_date,
							repair_id:_this.form.repair_id,
							repair_report_id:_this.form.repair_report_id,
							customer:_this.form.customer,
							regional_head:_this.form.regional_head,
							p_id:_this.form.p_id,
							p_name:_this.form.p_name,
							
							repairer:_this.form.repairer,
							rp:_this.form.rp,
							ms:_this.form.ms,
							rc:_this.form.rc,
							rqd:_this.form.rqd,
							rs:_this.form.rs,
							rod:_this.form.rod,
							if_repair:_this.form.if_repair,
							ccd:_this.form.ccd,
							acd:_this.form.acd,
							overdue:_this.form.overdue,
							quotation:_this.form.quotation,
							mcd:_this.form.mcd,
							mt:_this.form.mt,
							
							p_serial:_this.form.p_serial,
							inventory:_this.form.inventory,
							
							doi:_this.form.doi,
							link:_this.form.link,
							total_work_time:_this.form.total_work_time.toString(),
							plan_data:_this.form.plan_data,
						}
					})
					.then(function (response) {
						
						let r = response.data.r;
						let s = ""
						let errType = ""
						if (r == 0) {
							errType = "success"
							s = "修改成功！";
						} else if(r==1){
							errType = "error"
							s = "无权限!";
						}else{
							errType = "error"
							s = "修改失败！";
						}
						_this.$message({
							message: s,
							type: errType,
							duration: 1500
						});
						//更新页面
						
						if(r==0){
							_this.get_ma_plan(_this.$data.currentPage);
							_this.$data.updatedialogVisible_ex = false;
						}
					})
					.catch(function (error) {
					  console.log(error);
					});
				}
			  });
		  },
		
		get_ma_plan(cur_page){
			
			console.log("cur_page:",cur_page);
		  
			document.getElementById("bt_serach").blur();
			var _this = this;
			
			if (cur_page==undefined){
				_this.$data.currentPage=1;
			} else {
				_this.$data.currentPage=cur_page;
			}
			
			var objs;
			axios.post('/u_ma/get_processes', {
				opuser:localStorage.getItem("online_user"),
				opuser_uuid:localStorage.getItem("uuid"),
				index: this.$data.currentPage,
				count: this.$data.pagesize,
				id:this.$data.id_v,
				rid:this.$data.rid_v,
				if_done:this.$data.checked,
				repairer:this.$data.repairer_v,
				rs:this.$data.rs_v,
				regional_head:this.$data.regional_head_v,
				ms:this.$data.ms_v,
				sort_field:this.$data.asc_v,
				location:this.$data.location_v,
				pid:this.$data.pid_v,
				pname:this.$data.pname_v,
				station:this.$data.m_station_v,
			  })
			  .then(function (response) {
				console.log(response.data);
				objs = response.data.data;
				rcnt = response.data.total;
				_this.$data.tableData = objs;
				_this.$data.recordTotal = rcnt;
				//_this.$data.pagecnt = response.data.pagecnt;
			  })
			  .catch(function (error) {
				console.log(error);
			  });
		},
		  
		handleSizeChange(val) {
			  //console.log(`每页 ${val} 条`);
			  this.$data.pagesize = val;
			  
			  var _this = this;
			  
			  var objs;
			 axios.post('/u_ma/get_processes', {
			 	opuser:localStorage.getItem("online_user"),
			 	opuser_uuid:localStorage.getItem("uuid"),
			 			index: this.$data.currentPage,
			 			count: this.$data.pagesize,
			 			id:this.$data.id_v,
			 			rid:this.$data.rid_v,
			 			if_done:this.$data.checked,
			 			repairer:this.$data.repairer_v,
			 			rs:this.$data.rs_v,
			 			regional_head:this.$data.regional_head_v,
			 			ms:this.$data.ms_v,
			 			sort_field:this.$data.asc_v,
						location:this.$data.location_v,
						pid:this.$data.pid_v,
						pname:this.$data.pname_v,
						station:this.$data.m_station_v,
			   })
				.then(function (response) {
				  console.log(response.data);
				objs = response.data.data;
				rcnt = response.data.total;
				_this.$data.tableData = objs;
				_this.$data.recordTotal = rcnt;
				})
				.catch(function (error) {
				  console.log(error);
				});
		},
		
		handleCurrentChange(val) {
		  //console.log(`当前页: ${val}`);
		  this.$data.currentPage = val;
		  
		  var _this = this;
		  
		  var objs;
		 axios.post('/u_ma/get_processes', {
		 	opuser:localStorage.getItem("online_user"),
		 	opuser_uuid:localStorage.getItem("uuid"),
			index: this.$data.currentPage,
			count: this.$data.pagesize,
			id:this.$data.id_v,
			rid:this.$data.rid_v,
			if_done:this.$data.checked,
			repairer:this.$data.repairer_v,
			rs:this.$data.rs_v,
			regional_head:this.$data.regional_head_v,
			ms:this.$data.ms_v,
			sort_field:this.$data.asc_v,
			location:this.$data.location_v,
			pid:this.$data.pid_v,
			pname:this.$data.pname_v,
			station:this.$data.m_station_v,
		   })
				.then(function (response) {
				  console.log(response.data);
				objs = response.data.data;
				rcnt = response.data.total;
				_this.$data.tableData = objs;
				_this.$data.recordTotal = rcnt;
				})
				.catch(function (error) {
				  console.log(error);
				});
		},
		
	  }
	}
			