	
	var Wellcomponent = {
		template:`
		<div>
			<div v-if="!if_show_d1" style="display: flex;">
				<el-input v-model="value1" placeholder="Y/M/D-Y/M/D" clearable style="width: 160px;"  @change="input_change"></el-input>
				<el-input v-model="id_v" placeholder="序号" clearable style="width: 100px;" @change="input_change"></el-input>
				<el-input v-model="sapid_v" placeholder="计划/项目号" clearable style="width: 120px;" @change="input_change"></el-input>
				<el-input v-model="pid_v" placeholder="编号" clearable style="width: 105px;" @change="input_change"></el-input>
				<el-input v-model="pname_v" placeholder="名称" clearable style="width: 105px;" @change="input_change"></el-input>
				<el-input v-model="conveyer_v" placeholder="交付人" clearable style="width: 120px;"  @change="input_change"></el-input>
				<el-select clearable v-if="if_show_processed" filterable allow-create v-model="plan_state_v" placeholder="生产状态"
				style="width: 110px;" @change="selectChanged">
				 <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 label="生产中" value="生产中"></el-option>
						<el-option label="外协" value="需外协"></el-option>
						<el-option label="交检" value="交检"></el-option>
						<el-option label="做账" value="做账"></el-option>
						<el-option label="入库" value="入库"></el-option>
						<el-option label="物料不足" value="物料不足"></el-option>
						<el-option label="物料未到" value="物料未到"></el-option>
						<el-option label="物料超期" value="物料超期"></el-option>
						<el-option label="文件错误" value="文件错误"></el-option>
						<el-option label="设计文件错误" value="设计文件错误"></el-option>
						<el-option label="工艺文件错误" value="工艺文件错误"></el-option>
						<el-option label="未导入" value="未导入"></el-option>
						<el-option label="检验不合格" value="检验不合格"></el-option>
						<el-option label="未满足分解条件" value="未满足分解条件"></el-option>
				 </el-option-group>
				</el-select>
				<el-tooltip v-if="if_show_d1" content="格式：Y/M/D-Y/M/D" placement="top">
					<el-input v-model="search_promise_date" placeholder="承诺到料" clearable style="width: 160px;"  @change="input_change"></el-input>
				</el-tooltip>
				<el-checkbox v-if="if_show_processed" style="margin: 0px;" v-model="checked" @change="if_fin_cahnge" border>已处理</el-checkbox>
				<el-checkbox v-if="if_del_show" style="margin: 0px;" v-model="if_del" @change="if_del_cahnge" border>已删除</el-checkbox>
				<el-select clearable v-if="if_show_task_finished" v-model="group_name_v" placeholder="生产分组"
					style="width: 110px;" @change="selectChanged">
					<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 label="保温瓶组" value="保温瓶组"></el-option>
					</el-option-group>
				</el-select>
				<el-button id ="bt_serach" plain type="primary" icon="el-icon-search" @click="getkpi()" style="padding-left: 10px;padding-right: 10px;">搜索</el-button>
				<el-button v-if="!if_show_task_finished" id ="bt_add" plain type="primary" icon="el-icon-document-add" @click="importCsv()" style="margin-left: 0px;padding-left: 10px;padding-right: 10px;">导入</el-button>
				<el-button v-if="if_show_export" id ="bt_export" plain type="primary" icon="el-icon-document" @click="exportkpi()" style="margin-left: 0px;padding-left: 10px;padding-right: 10px;">导出</el-button>
				
				<el-button id ="bt_task_transfer" plain type="primary" icon="el-icon-right" @click="show_taskTransfer_disalog()" style="margin-left: 0px;padding-left: 10px;padding-right: 10px;" :disabled="trans_disabled">任务转出</el-button>
				<el-button v-if="if_show_task_finished" id ="bt_copy" plain type="primary" icon="el-icon-finished" @click="copy_link()" style="margin-left: 0px;padding-left: 10px;padding-right: 10px;">复制链接</el-button>
				<el-dropdown v-if="if_show_task_finished" @command="handleCommand">
					<el-button type="primary" plain style="padding-left: 10px;padding-right: 10px;">
						更多<i class="el-icon-arrow-down el-icon--right"></i>
					</el-button>
				  <el-dropdown-menu slot="dropdown">
					<el-dropdown-item command='export_plan_over'>导出已完成工序</el-dropdown-item>
					<el-dropdown-item v-if="if_del_show" command='export_transfer_history'>导出转出记录</el-dropdown-item>
					<el-dropdown-item>
						<el-upload
						style="margin-left: 0px;"
						 class="upload-demo"
						 action=""
						 :on-change="mul_update_kpi_1"
						 :file-list="fileListUpload1"
						 :show-file-list="false"
						  accept=".csv"
						  :auto-upload="false">导入生产计划(csv文件)</el-upload>
					</el-dropdown-item>
					
				  </el-dropdown-menu>
				</el-dropdown>
			</div>
			
			<div v-if="if_show_d1" style="display: flex;">
				
				<el-input v-model="id_v" placeholder="序号" clearable style="width: 100px;" @change="input_change"></el-input>
				<el-input v-model="pid_v" placeholder="编号" clearable style="width: 105px;" @change="input_change"></el-input>
				<el-input v-model="pname_v" placeholder="名称" clearable style="width: 105px;" @change="input_change"></el-input>
				<el-select clearable filterable allow-create v-model="plan_state_v" placeholder="生产状态"
				style="width: 110px;" @change="selectChanged">
				 <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 label="生产中" value="生产中"></el-option>
						<el-option label="外协" value="需外协"></el-option>
						<el-option label="交检" value="交检"></el-option>
						<el-option label="做账" value="做账"></el-option>
						<el-option label="入库" value="入库"></el-option>
						<el-option label="物料不足" value="物料不足"></el-option>
						<el-option label="物料未到" value="物料未到"></el-option>
						<el-option label="物料超期" value="物料超期"></el-option>
						<el-option label="文件错误" value="文件错误"></el-option>
						<el-option label="设计文件错误" value="设计文件错误"></el-option>
						<el-option label="工艺文件错误" value="工艺文件错误"></el-option>
						<el-option label="未导入" value="未导入"></el-option>
						<el-option label="检验不合格" value="检验不合格"></el-option>
						<el-option label="未满足分解条件" value="未满足分解条件"></el-option>
				 </el-option-group>
				</el-select>
				
				<el-select clearable filterable v-model="more_query_v" placeholder="更多查询"
					style="width: 110px;" @change="more_query_select">
				 <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 label="生产分组" value="生产分组"></el-option>
					   <el-option label="交付人" value="交付人"></el-option>
					   <el-option label="RDM" value="RDM"></el-option>
					    <el-option label="生产人员" value="生产人员"></el-option>
				 </el-option-group>
				</el-select>
				<el-input v-if="more_query_v=='时间段'" v-model="value1" placeholder="Y/M/D-Y/M/D" clearable style="width: 160px;"  @change="input_change"></el-input>
				<el-input v-if="more_query_v=='计划号'" v-model="sapid_v" placeholder="计划/项目号" clearable style="width: 120px;" @change="input_change"></el-input>
				<el-tooltip v-if="more_query_v=='承诺到料'" content="格式：Y/M/D-Y/M/D" placement="top">
					<el-input v-model="search_promise_date" placeholder="承诺到料" clearable style="width: 160px;"  @change="input_change"></el-input>
				</el-tooltip>
				<el-select clearable v-if="more_query_v=='生产分组'" v-model="group_name_v" placeholder="生产分组"
					style="width: 110px;" @change="selectChanged">
					<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 label="保温瓶组" value="保温瓶组"></el-option>
					</el-option-group>
				</el-select>
				<el-input v-if="more_query_v=='交付人'" v-model="conveyer_v" placeholder="" clearable style="width: 120px;"  @change="input_change"></el-input>
				<el-input v-if="more_query_v=='RDM'" v-model="rdm_v" placeholder="" clearable style="width: 120px;"  @change="input_change"></el-input>
				<!--<el-input v-if="more_query_v=='生产人员'" v-model="product_user_v" placeholder="" clearable style="width: 120px;"  @change="input_change"></el-input>
				-->
				<el-select v-if="more_query_v=='生产人员'" v-model="product_user_v" filterable placeholder="请选择" style="width: 120px;" >
				  <el-option
					v-for="item in product_users"
					:key="item.value"
					:label="item.label"
					:value="item.value">
				  </el-option>
				</el-select>
				
				<el-checkbox v-if="if_show_processed" style="margin: 0px;" v-model="checked" @change="if_fin_cahnge" border>已处理</el-checkbox>
				<el-checkbox v-if="if_del_show" style="margin: 0px;" v-model="if_del" @change="if_del_cahnge" border>已删除</el-checkbox>
				<el-button id ="bt_serach" plain type="primary" icon="el-icon-search" @click="getkpi()" style="padding-left: 10px;padding-right: 10px;">搜索</el-button>
				
				<div v-if="role_id !=4" style="display: flex;">
					<el-button v-if="!if_show_task_finished" id ="bt_add" plain type="primary" icon="el-icon-document-add" @click="importCsv()" style="margin-left: 0px;padding-left: 10px;padding-right: 10px;">导入</el-button>
					
					<el-button id ="bt_task_transfer" plain type="primary" icon="el-icon-right" @click="show_taskTransfer_disalog()" style="margin-left: 0px;padding-left: 10px;padding-right: 10px;" :disabled="trans_disabled">任务转出</el-button>
					<el-button v-if="if_show_task_finished" id ="bt_copy" plain type="primary" icon="el-icon-finished" @click="copy_link()" style="margin-left: 0px;padding-left: 10px;padding-right: 10px;">复制链接</el-button>
					<el-dropdown v-if="if_show_task_finished" @command="handleCommand">
						<el-button type="primary" plain style="padding-left: 10px;padding-right: 10px;">
							更多<i class="el-icon-arrow-down el-icon--right"></i>
						</el-button>
					  <el-dropdown-menu slot="dropdown">
						<el-dropdown-item command='export_undo_plan'>导出未完成计划</el-dropdown-item>
						<el-dropdown-item command='export_plan_over'>导出已完成工序</el-dropdown-item>
						<el-dropdown-item command='export_plan_inspection_not_completed'>导出质检未完成工序</el-dropdown-item>
						<el-dropdown-item command='export_plan_inspection_completed'>导出质检已完成工序</el-dropdown-item>
						<el-dropdown-item v-if="if_del_show" command='export_transfer_history'>导出转出记录</el-dropdown-item>
						<el-dropdown-item>
							<el-upload
							style="margin-left: 0px;"
							 class="upload-demo"
							 action=""
							 :on-change="mul_update_kpi_1"
							 :file-list="fileListUpload1"
							 :show-file-list="false"
							  accept=".csv"
							  :auto-upload="false">导入生产计划(csv文件)</el-upload>
						</el-dropdown-item>
						<el-dropdown-item v-if="if_del_show" command='export_plan_collect'>汇总分解</el-dropdown-item>
					  </el-dropdown-menu>
					</el-dropdown>
				</div>
				
			</div>
			
			<div>
				<el-progress v-if="if_show_process1" :percentage="percent_len1" ></el-progress>
			</div>
			<div v-if="if_show_d1">
				<div class="span">
					<el-table
					    :data="tableData"
					    style="width: 100%;font-size:14px"
					    :height="tHeight"
						:row-class-name="tableRowClassName"
						@selection-change="handleSelectionChange"
						border
						:row-style="selectedRowStyle"
						@cell-dblclick="celldblclick_1">
						<el-table-column
						  type="selection"
						  width="30"
						  >
						</el-table-column>
						<el-table-column
						  prop="id"
						  label="序号"
						  width="60">
						</el-table-column>
						<el-table-column
						  prop="CreateTime"
						  label="订单日期"
						  width="70">
						</el-table-column>
						<el-table-column
						  prop="department_name"
						  label="部门"
						  width="60">
						</el-table-column>
						<el-table-column
						  prop="task_id"
						  label="计划/项目号"
						  width="130"
						  :show-overflow-tooltip="true">
						</el-table-column>
					    <el-table-column
					      prop="product_id"
					      label="编号"
						  width="100"
						  :show-overflow-tooltip="true">
					    </el-table-column>
						<el-table-column
						  prop="product_name"
						  label="名称"
						 width="100"
						 :show-overflow-tooltip="true">
						</el-table-column>
						<el-table-column
						  prop="total_num"
						  label="数量"
						 width="40">
						</el-table-column>
						
						<el-table-column
						  prop="demand_date"
						  label="需求日期"
						 width="70">
						</el-table-column>
						<el-table-column
						  prop="rdm_id"
						  label="RDM"
						 width="60"
						 :show-overflow-tooltip="true">
							 <template slot-scope="scope">
								<el-button :style="scope.row.redmine_color" @click="to_redmine(scope.row)" type="text" size="medium">{{scope.row.rdm_id}}</el-button>
							 </template>
						</el-table-column>
						<el-table-column
						  prop="conveyer"
						  label="交付人"
						 width="60">
						</el-table-column>
						<el-table-column
						  prop="promise_date"
						  label="承诺到料"
						 width="70">
						</el-table-column>
						<el-table-column
						  prop="m_overdue"
						  label="物料超期"
						 width="70">
						</el-table-column>
						
						<el-table-column
						  prop="group_name"
						  label="班组"
						 width="50"
						 :show-overflow-tooltip="true">
						</el-table-column>
						<el-table-column
						  prop="dispath_num"
						  label="派产量"
						 width="50">
						</el-table-column>
						<el-table-column
						  prop="plan_dispath_date"
						  label="计划"
						 width="70">
						</el-table-column>
						<el-table-column
						  prop="plan_finished_date"
						  label="承诺"
						 width="70">
						</el-table-column>
						<el-table-column
						  prop="plan_fin_state"
						  label="进度"
						 width="40">
						 </el-table-column>
						<el-table-column
						  prop="plan_actual_finished_date"
						  label="实际完成"
						 width="70">
						</el-table-column>
						<el-table-column
						  prop="overdue"
						  label="超期"
						 :width="40">
						</el-table-column>
						<el-table-column
						  prop="plan_state"
						  label="生产状态"
						 width="60"
						 :show-overflow-tooltip="true">
						</el-table-column>
						<el-table-column
						  prop="code_state"
						  label="编程"
						 width="50"
						 :show-overflow-tooltip="true">
						</el-table-column>
						
						<el-table-column
						  label="归档"
						  width="100">
						  <template slot-scope="scope">
							  <div v-if='check_code_state(scope.row)'>
								<el-tooltip placement="left-start" popper-class="packageDownLoad-tooltip">
									<div v-if='tip_show(scope.row.f_c)' slot="content" >无<br/></div>
									<div v-if='!tip_show(scope.row.f_c)' slot="content" v-for="item in scope.row.f_c">{{item.f_name}} {{item.filing_t}}<br/></div>
									<el-button :style="check_file_color_c(scope.row)" @click="down_files(scope.row.f_c)" type="text" size="medium" >Turning</el-button>
								</el-tooltip>
								<el-tooltip placement="right-start" style="margin-left: 0px;" popper-class="packageDownLoad-tooltip">
									<div v-if='tip_show(scope.row.f_x)' slot="content" >无<br/></div>
									<div v-if='!tip_show(scope.row.f_x)' slot="content" v-for="item in scope.row.f_x">{{item.f_name}} {{item.filing_t}}<br/></div>
									<el-button :style="check_file_color_x(scope.row)" @click="down_files(scope.row.f_x)" type="text" size="medium" >Milling</el-button>
								</el-tooltip>
							  </div>
							  </template>
						</el-table-column>
						
						<el-table-column
						  label="派产"
						 width="50">
							<template slot-scope="scope">
								<el-button :style="check_his_color(scope.row)" @click="show_dis_detail(scope.row)" type="text" size="medium">详情</el-button>
							</template>
						</el-table-column>
						
						<el-table-column
						  prop="welltime"
						  label="日志"
						 width="50">
							<template slot-scope="scope">
								<el-button @click="showUpdatehistory(scope.row)" type="text" size="medium">详情</el-button>
							</template>
						</el-table-column>
						
						<el-table-column
						  label="注"
						  width="30">
						  <template slot-scope="scope">
							  <div >
								<el-tooltip placement="left-start" popper-class="packageDownLoad-tooltip">
									<div v-if='scope.row.notes==""' slot="content">无</div>
									<div v-if='scope.row.notes!=""' slot="content">{{scope.row.notes}}</div>
									<el-button :style="check_note_color_x(scope.row)" @click="show_update_notes(scope.row)" type="text" size="medium" >注</el-button>
								</el-tooltip>
							  </div>
							  </template>
						</el-table-column>
						
						<el-table-column
						      label="操作"
						      width="140">
						      <template slot-scope="scope">
								  <el-button class="t_hover_button" v-show="scope.row.if_show_update && role_id!=4" @click="show_update_dialog(scope.row)" type="text" size="medium" >修改</el-button>
								  <el-button style="margin-left: 3px;margin-right: 0px;"  v-show="scope.row.if_show_del && role_id!=4" @click="delKpi(scope.row)" type="text" size="medium" >删除</el-button>
								  <el-button style="margin-left: 3px;margin-right: 0px;" :style="scope.row.flink_color"   @click="to_feishu(scope.row)" type="text" size="medium" >飞书链接</el-button>
								  <el-button  style="margin-left: 3px;margin-right: 0px;" v-show="scope.row.if_show_del_his" @click="show_kpi_del_his(scope.row)" type="text" size="medium" >删除详情</el-button>
						      </template>
						    </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 v-if="if_show_d3">
				<div class="span">
					<el-table
					    :data="tableData"
					    style="width: 100%;font-size:14px"
					    :height="tHeight"
						:row-class-name="tableRowClassName"
						@selection-change="handleSelectionChange"
						border
						:row-style="selectedRowStyle">
						<el-table-column
						  type="selection"
						  width="30"
						  >
						</el-table-column>
						<el-table-column
						  prop="id"
						  label="序号"
						  width="60">
						</el-table-column>
						<el-table-column
						  prop="CreateTime"
						  label="订单日期"
						  width="80">
						</el-table-column>
						<el-table-column
						  prop="department_name"
						  label="部门"
						  width="60">
						</el-table-column>
						<el-table-column
						  prop="task_id"
						  label="计划/项目号"
						  width="150"
						  :show-overflow-tooltip="true">
						</el-table-column>
					    <el-table-column
					      prop="product_id"
					      label="编号"
						  width="100"
						  :show-overflow-tooltip="true">
					    </el-table-column>
						<el-table-column
						  prop="product_name"
						  label="名称"
						 width="100"
						 :show-overflow-tooltip="true">
						</el-table-column>
						<el-table-column
						  prop="total_num"
						  label="数量"
						 width="60">
						</el-table-column>
						
						<el-table-column
						  prop="demand_date"
						  label="需求日期"
						 width="80">
						</el-table-column>
						<el-table-column
						  prop="rdm_id"
						  label="RDM"
						 width="60"
						 :show-overflow-tooltip="true">
							<template slot-scope="scope">
								<el-button @click="to_redmine(scope.row)" type="text" size="medium">{{scope.row.rdm_id}}</el-button>
							</template>
						</el-table-column>
						<el-table-column
						  prop="conveyer"
						  label="交付人"
						 width="60">
						</el-table-column>
						<el-table-column
						  prop="Material_p"
						  label="物料属性"
						 width="60">
						</el-table-column>
						
						<el-table-column
						  prop="Material_inventory"
						  label="物料库存"
						 width="80">
						</el-table-column>
						<el-table-column
						  prop="promise_date"
						  label="承诺到料"
						 width="80">
						</el-table-column>
						<el-table-column
						  prop="promised_date"
						  label="实际到料"
						 width="80">
						</el-table-column>
						<el-table-column
						  prop="Material_overdue"
						  label="是否超期"
						 :width="60">
						</el-table-column>
						<el-table-column
						  prop="buyer"
						  label="采购员"
						 width="60">
						</el-table-column>
						<el-table-column
							prop="plan_state"
							label="生产状态"
							width="80"
							:show-overflow-tooltip="true">
						</el-table-column>
						
						<el-table-column
						  prop="welltime"
						  label="日志"
						 width="50">
							<template slot-scope="scope">
								<el-button @click="showUpdatehistory(scope.row)" type="text" size="medium">详情</el-button>
							</template>
						</el-table-column>
						
						<el-table-column
						  label="注"
						  width="30">
						  <template slot-scope="scope">
							  <div >
								<el-tooltip placement="left-start" popper-class="packageDownLoad-tooltip">
									<div v-if='scope.row.notes==""' slot="content">无</div>
									<div v-if='scope.row.notes!=""' slot="content">{{scope.row.notes}}</div>
									<el-button :style="check_note_color_x(scope.row)" type="text" size="medium" >注</el-button>
								</el-tooltip>
							  </div>
							  </template>
						</el-table-column>
						
						<el-table-column
						      label="操作"
						      width="80">
						      <template slot-scope="scope">
								  <el-button  v-show="scope.row.if_show_update" @click="show_update_dialog(scope.row)" type="text" size="medium" >修改</el-button>
								  <el-button  v-show="scope.row.if_show_del" @click="delKpi(scope.row)" type="text" size="medium" >删除</el-button>
						      </template>
						    </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 v-if="if_show_d5">
				<div class="span">
					<el-table
					    :data="tableData"
					    style="width: 100%;font-size:14px"
					    :height="tHeight"
						:row-class-name="tableRowClassName"
						@selection-change="handleSelectionChange"
						border
						:row-style="selectedRowStyle">
						<el-table-column
						  type="selection"
						  width="30"
						  >
						</el-table-column>
						<el-table-column
						  prop="id"
						  label="序号"
						  width="60">
						</el-table-column>
						<el-table-column
						  prop="CreateTime"
						  label="订单日期"
						  width="80">
						</el-table-column>
						<el-table-column
						  prop="department_name"
						  label="部门"
						  width="60">
						</el-table-column>
						<el-table-column
						  prop="task_id"
						  label="计划/项目号"
						  width="150"
						  :show-overflow-tooltip="true">
						</el-table-column>
					    <el-table-column
					      prop="product_id"
					      label="编号"
						  width="100"
						  :show-overflow-tooltip="true">
					    </el-table-column>
						<el-table-column
						  prop="product_name"
						  label="名称"
						 width="100"
						 :show-overflow-tooltip="true">
						</el-table-column>
						<el-table-column
						  prop="total_num"
						  label="数量"
						 width="60">
						</el-table-column>
						
						<el-table-column
						  prop="demand_date"
						  label="需求日期"
						 width="80">
						</el-table-column>
						<el-table-column
						  prop="rdm_id"
						  label="RDM"
						 width="60"
						 :show-overflow-tooltip="true">
							<template slot-scope="scope">
								<el-button @click="to_redmine(scope.row)" type="text" size="medium">{{scope.row.rdm_id}}</el-button>
							</template>
						</el-table-column>
						<el-table-column
						  prop="conveyer"
						  label="交付人"
						 width="60">
						</el-table-column>
						
						<el-table-column
							prop="Material_inventory"
							label="物料库存"
							width="80">
						</el-table-column>
						<el-table-column
							prop="plan_state"
							label="生产状态"
							width="80"
							:show-overflow-tooltip="true">
						</el-table-column>
						<el-table-column
							prop="plan_finished_date"
							label="承诺完成"
							width="80">
						</el-table-column>
						<el-table-column
							prop="plan_actual_finished_date"
							label="实际完成"
							width="80">
						</el-table-column>
						<el-table-column
							prop="overdue"
							label="超期"
							width="40">
						</el-table-column>
						
						<el-table-column
						  prop="welltime"
						  label="日志"
						 width="50">
							<template slot-scope="scope">
								<el-button @click="showUpdatehistory(scope.row)" type="text" size="medium">详情</el-button>
							</template>
						</el-table-column>
						
						<el-table-column
						  label="注"
						  width="30">
						  <template slot-scope="scope">
							  <div >
								<el-tooltip placement="left-start" popper-class="packageDownLoad-tooltip">
									<div v-if='scope.row.notes==""' slot="content">无</div>
									<div v-if='scope.row.notes!=""' slot="content">{{scope.row.notes}}</div>
									<el-button :style="check_note_color_x(scope.row)" type="text" size="medium" >注</el-button>
								</el-tooltip>
							  </div>
							  </template>
						</el-table-column>
						
						<el-table-column
						      label="操作"
						      width="80">
						      <template slot-scope="scope">
								  <el-button  v-show="scope.row.if_show_update" @click="show_update_dialog(scope.row)" type="text" size="medium" >修改</el-button>
								  <el-button  v-show="scope.row.if_show_del" @click="delKpi(scope.row)" type="text" size="medium" >删除</el-button>
						      </template>
						    </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>
			  
			<el-drawer
			  title="质检详情"
			  :visible.sync="delivery_detaile_show"
			  direction="rtl"
			  :before-close="handleClose">
					<el-table
					  :data="deliveryTableData"
					  style="font-size:14px;margin-left: 20px;width: 90%;"
					:cell-style="{background:'#fff'}"
					border
					>
						<el-table-column
						  prop="delivery_user"
						  label="检验员"
						  width="100">
						</el-table-column>
						<el-table-column
						  prop="num_ok"
						  label="合格数量"
						  width="100">
						</el-table-column>
					</el-table>
			</el-drawer>
		  
			<el-dialog
			   title="质检"
			   :visible.sync="add_deliveryVisible_2"
			   :lock-scroll ="false"
			   width="30%">
				<el-form ref="authform" :model="delivery_form" :rules="rules" label-width="80px" :inline="false" class="demo-form-inline" size="medium">
				  <el-row :gutter="10">
					  <el-col :span="12">
						  <el-form-item label="检验员" prop="delivery_user">
						  <el-input v-model="delivery_form.delivery_user"></el-input>
						  </el-form-item>
					  </el-col>
					  <el-col :span="12">
						  <el-form-item label="合格数量" prop="num_ok">
						  <el-input v-model="delivery_form.num_ok" ></el-input>
						  </el-form-item>
					  </el-col>
				  </el-row>
				</el-form>
			   <span slot="footer" class="dialog-footer">
			   <el-button @click="add_deliveryVisible_2 = false">取 消</el-button>
			   <el-button id ="bt_ok" plain type="primary" @click="add_deliveryplan_2();add_deliveryVisible_2 = false">确 定</el-button>
			   </span>
		  </el-dialog>
		  
			<el-dialog
			   title="生产计划"
			   :visible.sync="updatedialogVisible_2"
			   :lock-scroll ="false"
			   width="50%">
			   <el-form ref="authform" :model="form" :rules="rules" label-width="80px" :inline="false" class="demo-form-inline" size="medium">
				  <el-row>
					  <el-col :span="8">
							<el-form-item label="计划状态">
							<el-select filterable allow-create v-model="form.plan_state" placeholder="请选择">
							 <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 label="生产中" value="生产中"></el-option>
									<el-option label="外协" value="需外协"></el-option>
									<el-option label="交检" value="交检"></el-option>
									<el-option label="做账" value="做账"></el-option>
									<el-option label="入库" value="入库"></el-option>
									<el-option label="物料不足" value="物料不足"></el-option>
									<el-option label="物料未到" value="物料未到"></el-option>
									<el-option label="物料超期" value="物料超期"></el-option>
									<el-option label="文件错误" value="文件错误"></el-option>
									<el-option label="设计文件错误" value="设计文件错误"></el-option>
									<el-option label="工艺文件错误" value="工艺文件错误"></el-option>
									<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-col :span="8">
						  <el-form-item label="备注">
						  <el-input v-model="form.notes"></el-input>
						  </el-form-item>
					  </el-col>
				  </el-row>
				  
				  <div style="margin-top: 20px;">
					 <el-button id ="bt_add" plain type="primary" icon="el-icon-circle-plus-outline" @click="showAdd_deliveryplan_2()">新增检验</el-button>
					 <el-table
							:data="deliveryTableData"
							style="font-size:14px;margin-top: 10px;width: 100%;"
							:row-class-name="tableRowClassName"
							stripe border>
							<el-table-column
							  prop="delivery_user"
							  label="检验员"
							  width="100">
							</el-table-column>
							<el-table-column
							  prop="num_ok"
							  label="合格数量"
							  width="100">
							</el-table-column>
											
							<el-table-column
								  label="操作"
								  width="80">
								  <template slot-scope="scope">
									  <el-button @click="show_updatedeliveryplan_dialog(scope.row)" type="text" size="medium" >修改</el-button>
									  <el-button @click="del_deliveryplan(scope.row)" type="text" size="medium" >删除</el-button>
								  </template>
								</el-table-column>
						  </el-table>
				  </div>
			   </el-form>
			   <span slot="footer" class="dialog-footer">
			   <el-button @click="updatedialogVisible_2 = false">取 消</el-button>
			   <el-button id ="bt_ok" plain type="primary" @click="updatekpi_2();updatedialogVisible_2 = false">确 定</el-button>
			   </span>
		  </el-dialog>
			  
			<el-drawer
			    title="派产详情"
			    :visible.sync="dis_detaile_show"
			    direction="rtl"
			    :before-close="handleClose"
				size="50%"
				>
				<el-tag type="success" style="font-size:14px;margin-left: 20px;margin-bottom: 10px;">
					计划部门：{{plan_page_data.department}}
					&nbsp;&nbsp;
					计划/项目号：{{plan_page_data.task_id}}
					&nbsp;&nbsp;
					日期：{{plan_page_data.task_date}}
					&nbsp;&nbsp;
					时间：{{plan_page_data.task_time}}
					</el-tag>
			    <el-table
			        :data="planTableData"
			        style="font-size:14px;margin-left: 20px;"
			    	:cell-style="{background:'#fff'}"
			    	border
			    	>
			    	<el-table-column
			    	  prop="produce_plan"
			    	  label="工序"
			    	  width="60">
			    	</el-table-column>
					<el-table-column
					  prop="produce_plan_use_t"
					  label="工时"
					  width="60">
					</el-table-column>
					<el-table-column
					  prop="pre_time"
					  label="准备时间"
					  width="70">
					</el-table-column>
					<el-table-column
					  prop="code_time"
					  label="编程时间"
					  width="70">
					</el-table-column>
			        <el-table-column
			          prop="produce_user"
			          label="生产人员"
			          width="70">
			        </el-table-column>
			        <el-table-column
			          prop="dispath_num"
			          label="派产数量"
			    	 width="70">
					 </el-table-column>
					 
					 <el-table-column
					   prop="plan_dispath_date"
					   label="计划派产"
					  width="80">
			        </el-table-column>
					<el-table-column
					  prop="p_plan_finished_t"
					  label="计划完成"
					 width="80">
					 </el-table-column>
					 <el-table-column
					   prop="p_actual_finished_t"
					   label="实际完成"
					  width="80">
					  </el-table-column>
					  <el-table-column
					    prop="p_finished_overdue_day"
					    label="超期天数"
					   width="80">
					   </el-table-column>
			      </el-table>
			</el-drawer>
			
			<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="生产工序" >
						  <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="生产工时" >
						  <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="准备时间" >
				  			<el-checkbox v-model="planform.pre_time_checked" @change="pre_time_checked_change">有</el-checkbox>
				  			<el-input-number v-model="planform.pre_time" :min="0.5" :max="9999" :step="0.5" style="width: 150px;"></el-input-number>
				  	  </el-form-item>
				  	</el-col>
				  	<el-col :span="12">
				  	  <el-form-item label="编程时间" >
				  		  <el-checkbox v-model="planform.code_time_checked" @change="code_time_checked_change">有</el-checkbox>
				  			<el-input-number v-model="planform.code_time" :min="0.5" :max="9999" :step="0.5" style="width: 150px;"></el-input-number>
				  	  </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 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="派工数量" >
						  <el-input-number v-model="planform.dispath_num" :min="0.5" :max="9999" :step="0.5" style="width: 190px;"></el-input-number>
					  	  </el-form-item>
					  </el-col>
					</el-row>
						
				  <el-row :gutter="10">
					  <el-col :span="12">
						  <el-form-item label="计划派产" prop="plan_dispath_date">
						  <el-date-picker
						        v-model="planform.plan_dispath_date"
						        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="计划完成" prop="p_plan_finished_t">
						  <el-date-picker
								v-model="planform.p_plan_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="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-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="update_notes_visible_1"
			 :lock-scroll ="false"
			 width="56%">
			 <el-form ref="authform_1" :model="form" :rules="rules" label-width="80px" :inline="false" class="demo-form-inline" size="medium">
				   <el-row :gutter="10">
					   <el-col :span="24">
						  <el-form-item label="内容">
						  <el-input v-model="form.notes"></el-input>
						  </el-form-item>
					   </el-col>
				   </el-row>
			 </el-form>
			 <span slot="footer" class="dialog-footer">
			 <el-button @click="update_notes_visible_1 = false">取 消</el-button>
			 <el-button id ="bt_ok" plain type="primary" @click="update_notes_1();">确 定</el-button>
			 </span>
			</el-dialog>
			  
			
			<el-dialog
			v-dialogDrag
			 title="生产计划"
			 :visible.sync="updatedialogVisible_1"
			 :lock-scroll ="false"
			 width="56%">
			 <el-form ref="authform_1" :model="form" :rules="rules" label-width="80px" :inline="false" class="demo-form-inline" size="medium">
				  <el-row :gutter="10">
				  <el-col :span="8">
				  					  <el-form-item label="生产班组" prop="group_name">
									  <el-select v-model="form.group_name" placeholder="请选择分组">
										 <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 label="保温瓶组" value="保温瓶组"></el-option>
												<el-option label="质检组" value="质检组"></el-option>
										 </el-option-group>
									  </el-select>
				  					  </el-form-item>
				  </el-col>
				  <el-col :span="8">
				  					<el-form-item label="生产状态" prop="plan_state">
				  					<el-select filterable allow-create v-model="form.plan_state" placeholder="请选择">
				  					 <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 label="生产中" value="生产中"></el-option>
											<el-option label="外协" value="需外协"></el-option>
											<el-option label="交检" value="交检"></el-option>
											<el-option label="做账" value="做账"></el-option>
											<el-option label="入库" value="入库"></el-option>
											<el-option label="物料不足" value="物料不足"></el-option>
											<el-option label="物料未到" value="物料未到"></el-option>
											<el-option label="物料超期" value="物料超期"></el-option>
											<el-option label="文件错误" value="文件错误"></el-option>
											<el-option label="设计文件错误" value="设计文件错误"></el-option>
											<el-option label="工艺文件错误" value="工艺文件错误"></el-option>
											<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-col :span="8">
				  						  <el-form-item label="派产数量" prop="dispath_num">
				  						  <el-input-number v-model="form.dispath_num" :min="1" :max="9999" style="width: 150px;"></el-input-number>
										  </el-form-item>
				  					  </el-col>
				  </el-row>
				  <el-row :gutter="10">
						  <el-col :span="8">
							  <el-form-item label="飞书链接" prop="feishu_link">
							  <el-input v-model="form.feishu_link"></el-input>
							  </el-form-item>
						  </el-col>
						  <el-col :span="8">
							<el-form-item label="编程状态" prop="code_state">
							<el-select filterable allow-create v-model="form.code_state" placeholder="请选择">
							 <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 label="完成" value="完成"></el-option>
							 </el-option-group>
							</el-select>
							</el-form-item>
						  </el-col>
				   </el-row>
				   
				   <el-row :gutter="10">
				   					   <el-col :span="24">
				   						  <el-form-item label="注">
				   						  <el-input v-model="form.notes"></el-input>
				   						  </el-form-item>
				   					   </el-col>
				   </el-row>
				  
				  <div style="margin-top: 20px;">
					 <el-button id ="bt_add" plain type="primary" icon="el-icon-circle-plus-outline" @click="showAddkpiplan_1()">新增工序</el-button>
					 <el-table
					  	    :data="planTableData"
					  	    style="font-size:14px;margin-top: 10px;width: 100%;"
					  		:row-class-name="tableRowClassName"
					  		stripe border>
					  		<el-table-column
					  		  prop="produce_plan"
					  		  label="工序"
					  		  width="60">
					  		</el-table-column>
							<el-table-column
							  prop="produce_plan_use_t"
							  label="工时"
							  width="60">
							</el-table-column>
							<el-table-column
							  prop="pre_time"
							  label="准备时间"
							  width="70">
							</el-table-column>
							<el-table-column
							  prop="code_time"
							  label="编程时间"
							  width="70">
							</el-table-column>
					  		<el-table-column
					  		  prop="produce_user"
					  		  label="生产人员"
					  		  width="70">
					  		</el-table-column>
					  						
							<el-table-column
							  prop="dispath_num"
							  label="派工数量"
							  width="70">
							</el-table-column>
							
							<el-table-column
							   prop="plan_dispath_date"
							   label="计划派产"
							  width="80">
							</el-table-column>
							<el-table-column
							  prop="p_plan_finished_t"
							  label="计划完成"
							 width="80">
							 </el-table-column>
							 <el-table-column
							   prop="p_actual_finished_t"
							   label="实际完成"
							  width="80">
							  </el-table-column>
							  <el-table-column
							    prop="p_finished_overdue_day"
							    label="超期天数"
							   width="80">
							   </el-table-column>
							<el-table-column
								  label="操作"
								  width="80">
								  <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>
			 </el-form>
			 <span slot="footer" class="dialog-footer">
			 <el-button @click="updatedialogVisible_1 = false">取 消</el-button>
			 <el-button id ="bt_ok" plain type="primary" @click="updatekpi_1();">确 定</el-button>
			 </span>
			</el-dialog>
			  
			<el-dialog
			v-dialogDrag
			 title="生产计划"
			 :visible.sync="updatedialogVisible_1_ex"
			 :lock-scroll ="false"
			 width="56%">
			 <el-form ref="authform_1_ex" :model="form" :rules="rules" label-width="100px" :inline="false" class="demo-form-inline" size="medium">
				  <el-row :gutter="10">
					  <el-col :span="8">
						  <el-form-item label="计划/项目号" prop="task_id">
						  <el-input v-model="form.task_id" style="width: 150px;"></el-input>
						  </el-form-item>
					  </el-col>
					  <el-col :span="8">
						  <el-form-item label="产品编号" prop="product_id">
						  <el-select style="width: 150px;" v-model="form.product_id" filterable placeholder="请选择" remote  :remote-method="remoteMethod" :loading="loading">
						     <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="8" >
							<el-form-item label="数量" prop="total_num">
							<el-input-number v-model="form.total_num" :min="1" :max="9999" style="width: 150px;"></el-input-number>
							</el-form-item>
					  </el-col>
				  </el-row>
				  <el-row :gutter="10">
					  <el-col :span="8">
						  <el-form-item label="需求日期" prop="demand_date">
						  <el-date-picker
							style="width: 150px;"
							 v-model="form.demand_date"
							 type="date"
							 format="yyyy/MM/dd"
							value-format="yyyy/MM/dd"
							>
						  </el-date-picker>
						  </el-form-item>
					  </el-col>
				  
					  <el-col :span="8" >
							<el-form-item label="RDM任务号" >
							<el-input style="width: 150px;" v-model="form.rdm_id" maxlength="7" onkeyup="value=value.replace(/[^0-9]/g,'');" ></el-input>
							</el-form-item>
					  </el-col>
					  
					  <el-col :span="8" >
							<el-form-item label="交付人">
							<el-input style="width: 150px;" v-model="form.conveyer" onkeyup="this.value=this.value.replace(/[^\u4e00-\u9fa5]/g,'')"></el-input>
							</el-form-item>
					  </el-col>
				  
				   </el-row>
				  <el-row :gutter="10">
				  <el-col :span="8">
					  <el-form-item label="生产班组" prop="group_name">
					  <el-select style="width: 150px;" v-model="form.group_name" placeholder="请选择分组">
						 <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 label="保温瓶组" value="保温瓶组"></el-option>
								<el-option label="质检组" value="质检组"></el-option>
						 </el-option-group>
					  </el-select>
					  </el-form-item>
				  </el-col>
				 <el-col :span="8">
				 					<el-form-item label="生产状态" prop="plan_state">
				 					<el-select style="width: 150px;" filterable allow-create v-model="form.plan_state" placeholder="请选择">
				 					 <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 label="生产中" value="生产中"></el-option>
											<el-option label="外协" value="需外协"></el-option>
											<el-option label="交检" value="交检"></el-option>
											<el-option label="做账" value="做账"></el-option>
											<el-option label="入库" value="入库"></el-option>
											<el-option label="物料不足" value="物料不足"></el-option>
											<el-option label="物料未到" value="物料未到"></el-option>
											<el-option label="物料超期" value="物料超期"></el-option>
											<el-option label="文件错误" value="文件错误"></el-option>
											<el-option label="设计文件错误" value="设计文件错误"></el-option>
											<el-option label="工艺文件错误" value="工艺文件错误"></el-option>
											<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-col :span="8">
				 						  <el-form-item label="派产数量" prop="dispath_num">
				 						  <el-input-number v-model="form.dispath_num" :min="1" :max="9999" style="width: 150px;"></el-input-number>
										  </el-form-item>
				 					  </el-col>
				  </el-row>
				  
				  <el-row :gutter="10">
					  <el-col :span="8">
						  <el-form-item label="飞书链接" prop="feishu_link">
						  <el-input style="width: 150px;" v-model="form.feishu_link"></el-input>
						  </el-form-item>
					  </el-col>
					  <el-col :span="8">
						<el-form-item label="编程状态" prop="code_state">
						<el-select style="width: 150px;" filterable allow-create v-model="form.code_state" placeholder="请选择">
						 <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 label="完成" value="完成"></el-option>
						 </el-option-group>
						</el-select>
						</el-form-item>
					  </el-col>
				   </el-row>
				   
				   <el-row :gutter="10">
					   <el-col :span="24">
						  <el-form-item label="注">
						  <el-input v-model="form.notes"></el-input>
						  </el-form-item>
					   </el-col>
				   </el-row>
				  
				  <div style="margin-top: 20px;">
					 <el-button id ="bt_add" plain type="primary" icon="el-icon-circle-plus-outline" @click="showAddkpiplan_1()">新增工序</el-button>
					 <el-table
					  	    :data="planTableData"
					  	    style="font-size:14px;margin-top: 10px;width: 100%;"
					  		:row-class-name="tableRowClassName"
					  		stripe border>
					  		<el-table-column
					  		  prop="produce_plan"
					  		  label="工序"
					  		  width="60">
					  		</el-table-column>
							<el-table-column
							  prop="produce_plan_use_t"
							  label="工时"
							  width="60">
							</el-table-column>
							<el-table-column
							  prop="pre_time"
							  label="准备时间"
							  width="70">
							</el-table-column>
							<el-table-column
							  prop="code_time"
							  label="编程时间"
							  width="70">
							</el-table-column>
					  		<el-table-column
					  		  prop="produce_user"
					  		  label="生产人员"
					  		  width="70">
					  		</el-table-column>
					  						
							<el-table-column
							  prop="dispath_num"
							  label="派工数量"
							  width="70">
							</el-table-column>
							
							<el-table-column
							   prop="plan_dispath_date"
							   label="计划派产"
							  width="80">
							</el-table-column>
							<el-table-column
							  prop="p_plan_finished_t"
							  label="计划完成"
							 width="80">
							 </el-table-column>
							 <el-table-column
							   prop="p_actual_finished_t"
							   label="实际完成"
							  width="80">
							  </el-table-column>
							  <el-table-column
							    prop="p_finished_overdue_day"
							    label="超期天数"
							   width="80">
							   </el-table-column>
							<el-table-column
								  label="操作"
								  width="80">
								  <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>
			 </el-form>
			 <span slot="footer" class="dialog-footer">
			 <el-button @click="updatedialogVisible_1_ex = false">取 消</el-button>
			 <el-button id ="bt_ok" plain type="primary" @click="updatekpi_1_ex();">确 定</el-button>
			 </span>
			</el-dialog>
			
			<el-dialog
			 title="生产计划"
			 :visible.sync="adddialogVisible_5"
			 :lock-scroll ="false"
			 width="60%">
			 <el-form ref="authform_5_add" :model="form" :rules="rules" label-width="100px" :inline="false" class="demo-form-inline" size="medium">
				  <el-row :gutter="10">
					  <el-col :span="8">
						  <el-form-item label="计划/项目号" prop="task_id">
						  <el-input v-model="form.task_id" ></el-input>
						  </el-form-item>
					  </el-col>
					  <el-col :span="8">
						  <el-form-item label="产品编号" prop="product_id">
						  <el-select v-model="form.product_id" filterable placeholder="请选择" remote  :remote-method="remoteMethod" :loading="loading">
						     <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="8" >
							<el-form-item label="数量" prop="total_num">
							<el-input v-model="form.total_num" :disabled="false" maxlength="4" οnkeyup="value=value.replace(/[^\d]/g,'')"></el-input>
							</el-form-item>
					  </el-col>
				  </el-row>
				  
				  <el-row :gutter="10">
					 <el-col :span="8">
						  <el-form-item label="需求日期" prop="demand_date">
						  <el-date-picker
							style="width: 150px;"
							 v-model="form.demand_date"
							 type="date"
							 format="yyyy/MM/dd"
							value-format="yyyy/MM/dd">
						  </el-date-picker>
						  </el-form-item>
					 </el-col>
				 
					 <el-col :span="8" >
						<el-form-item label="RDM任务号" >
						<el-input v-model="form.rdm_id" maxlength="7" onkeyup="value=value.replace(/[^0-9]/g,'');"></el-input>
						</el-form-item>
					 </el-col>
					 <el-col :span="8" >
						<el-form-item label="交付人" prop="conveyer">
						<el-input v-model="form.conveyer" onkeyup="this.value=this.value.replace(/[^\u4e00-\u9fa5]/g,'')"></el-input>
						</el-form-item>
					 </el-col>
				  </el-row>
			 </el-form>
			 <span slot="footer" class="dialog-footer">
			 <el-button @click="adddialogVisible_5 = false">取 消</el-button>
			 <el-button id ="bt_ok" plain type="primary" @click="addkpi_5();">确 定</el-button>
			 </span>
			</el-dialog>
			
			<el-dialog
			 title="生产计划"
			 :visible.sync="updatedialogVisible_5"
			 :lock-scroll ="false"
			 width="60%">
			 <el-form ref="authform_5" :model="form" :rules="rules" label-width="100px" :inline="false" class="demo-form-inline" size="medium">
				  <el-row :gutter="10">
					  <el-col :span="8">
						  <el-form-item label="计划/项目号" prop="task_id">
						  <el-input v-model="form.task_id" ></el-input>
						  </el-form-item>
					  </el-col>
					  <el-col :span="8">
						  <el-form-item label="产品编号" prop="product_id">
						  <el-select v-model="form.product_id" filterable placeholder="请选择" remote  :remote-method="remoteMethod" :loading="loading">
						     <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="8" >
							<el-form-item label="数量" prop="total_num">
							 <el-input-number v-model="form.total_num" :min="1" :max="9999" style="width: 150px;"></el-input-number>
							</el-form-item>
					  </el-col>
				  </el-row>
				  
				  <el-row :gutter="10">
					  <el-col :span="8">
						  <el-form-item label="需求日期" prop="demand_date">
						  <el-date-picker
							style="width: 150px;"
							 v-model="form.demand_date"
							 type="date"
							 format="yyyy/MM/dd"
							value-format="yyyy/MM/dd">
						  </el-date-picker>
						  </el-form-item>
					  </el-col>
					  <el-col :span="8" >
							<el-form-item label="RDM任务号" >
							<el-input v-model="form.rdm_id" maxlength="7" onkeyup="value=value.replace(/[^0-9]/g,'');"></el-input>
							</el-form-item>
					  </el-col>
					  <el-col :span="8" >
							<el-form-item label="交付人" prop="conveyer">
							<el-input v-model="form.conveyer" onkeyup="this.value=this.value.replace(/[^\u4e00-\u9fa5]/g,'')"></el-input>
							</el-form-item>
					  </el-col>
				  </el-row>
			 </el-form>
			 <span slot="footer" class="dialog-footer">
			 <el-button @click="updatedialogVisible_5 = false">取 消</el-button>
			 <el-button id ="bt_ok" plain type="primary" @click="updatekpi_5();">确 定</el-button>
			 </span>
			</el-dialog>
			
			<el-dialog
			 title="生产计划"
			 :visible.sync="updatedialogVisible_5_ex"
			 :lock-scroll ="false"
			 width="60%">
			 <el-form ref="authform_5_ex" :model="form" :rules="rules" label-width="100px" :inline="false" class="demo-form-inline" size="medium">
				  <el-row :gutter="10">
					  <el-col :span="8">
						  <el-form-item label="计划/项目号" prop="task_id">
						  <el-input v-model="form.task_id" ></el-input>
						  </el-form-item>
					  </el-col>
					  <el-col :span="8">
						  <el-form-item label="产品编号" prop="product_id">
						  <el-select v-model="form.product_id" filterable placeholder="请选择" remote  :remote-method="remoteMethod" :loading="loading">
						     <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="8" >
							<el-form-item label="数量" prop="total_num">
							<el-input v-model="form.total_num" :disabled="false" maxlength="4" οnkeyup="value=value.replace(/[^\d]/g,'')"></el-input>
							</el-form-item>
					  </el-col>
				  </el-row>
			 </el-form>
			 <span slot="footer" class="dialog-footer">
			 <el-button @click="updatedialogVisible_5_ex = false">取 消</el-button>
			 <el-button id ="bt_ok" plain type="primary" @click="updatekpi_5_ex();">确 定</el-button>
			 </span>
			</el-dialog>
			
			<el-dialog
			 title="生产计划"
			 :visible.sync="adddialogVisible_3"
			 :lock-scroll ="false"
			 width="60%">
			 <el-form ref="authform_3_add" :model="form" :rules="rules" label-width="100px" :inline="false" class="demo-form-inline" size="medium">
				  <el-row :gutter="10">
					  <el-col :span="8">
						  <el-form-item label="计划/项目号" prop="task_id">
						  <el-input v-model="form.task_id" ></el-input>
						  </el-form-item>
					  </el-col>
					  <el-col :span="8">
						  <el-form-item label="产品编号" prop="product_id">
						  <el-select v-model="form.product_id" filterable placeholder="请选择" remote  :remote-method="remoteMethod" :loading="loading">
						     <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="8" >
							<el-form-item label="数量" prop="total_num">
							<el-input v-model="form.total_num" :disabled="false" maxlength="4" οnkeyup="value=value.replace(/[^\d]/g,'')"></el-input>
							</el-form-item>
					  </el-col>
				  </el-row>
				  
				  <el-row :gutter="10">
					  <el-col :span="8">
							<el-form-item label="物料库存" >
							<el-select v-model="form.Material_inventory" placeholder="请选择">
							<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-col :span="8">
							<el-form-item label="采购员" >
							<el-select v-model="form.buyer" filterable placeholder="请选择">
							   <el-option
								 v-for="item in buyer_options"
								 :key="item.value"
								 :label="item.label"
								 :value="item.value">
							   </el-option>
							 </el-select>
							</el-form-item>
					  </el-col>
					  <el-col :span="8" >
					  	<el-form-item label="物料属性" prop="Material_p">
						<el-select v-model="form.Material_p" placeholder="请选择">
						<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-row :gutter="10">
				  <el-col :span="8">
					  <el-form-item label="承诺到料">
					  <el-date-picker
						style="width: 150px;"
					  	 v-model="form.promise_date"
					  	 type="date"
						 format="yyyy/MM/dd"
					  	value-format="yyyy/MM/dd">
					  </el-date-picker>
					  </el-form-item>
				  </el-col>
				  <el-col :span="8" >
					<el-form-item label="实际到料">
					<el-date-picker
						style="width: 150px;"
						 v-model="form.promised_date"
						 type="date"
						format="yyyy/MM/dd"
						value-format="yyyy/MM/dd">
					</el-date-picker>
					</el-form-item>
				  </el-col>
				   <el-col :span="8">
					  <el-form-item label="需求日期" prop="demand_date">
					  <el-date-picker
						style="width: 150px;"
						 v-model="form.demand_date"
						 type="date"
						 format="yyyy/MM/dd"
						value-format="yyyy/MM/dd">
					  </el-date-picker>
					  </el-form-item>
				  </el-col>
				  </el-row>
				  <el-row>
					  <el-col :span="8" >
						<el-form-item label="RDM任务号" >
						<el-input v-model="form.rdm_id" maxlength="7" onkeyup="value=value.replace(/[^0-9]/g,'');"></el-input>
						</el-form-item>
					</el-col>
					<el-col :span="8" >
						<el-form-item label="交付人" prop="conveyer">
						<el-input v-model="form.conveyer" onkeyup="this.value=this.value.replace(/[^\u4e00-\u9fa5]/g,'')"></el-input>
						</el-form-item>
					  </el-col>
				  </el-row>
			 </el-form>
			 <span slot="footer" class="dialog-footer">
			 <el-button @click="adddialogVisible_3 = false">取 消</el-button>
			 <el-button id ="bt_ok" plain type="primary" @click="addkpi_3();">确 定</el-button>
			 </span>
			</el-dialog>
			
			<el-dialog
			 title="生产计划"
			 :visible.sync="updatedialogVisible_3_ex"
			 :lock-scroll ="false"
			 width="60%">
			 <el-form ref="authform_3_ex" :model="form" :rules="rules" label-width="100px" :inline="false" class="demo-form-inline" size="medium">
				  <el-row :gutter="10">
					  <el-col :span="8">
						  <el-form-item label="计划/项目号" prop="task_id">
						  <el-input v-model="form.task_id" ></el-input>
						  </el-form-item>
					  </el-col>
					  <el-col :span="8">
							<el-form-item label="产品编号" prop="product_id">
							<el-select v-model="form.product_id" filterable placeholder="请选择" remote  :remote-method="remoteMethod" :loading="loading">
							   <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="8" >
							<el-form-item label="数量" prop="total_num">
							<el-input-number v-model="form.total_num" :min="1" :max="9999" style="width: 150px;"></el-input-number>
							</el-form-item>
					  </el-col>
				  </el-row>
				  
				  <el-row :gutter="10">
				  
					  <el-col :span="8">
							<el-form-item label="物料库存" >
							<el-select v-model="form.Material_inventory" placeholder="请选择">
							<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-col :span="8">
							<el-form-item label="采购员" >
							<el-select v-model="form.buyer" filterable placeholder="请选择">
							   <el-option
								 v-for="item in buyer_options"
								 :key="item.value"
								 :label="item.label"
								 :value="item.value">
							   </el-option>
							 </el-select>
							</el-form-item>
					  </el-col>
					  <el-col :span="8" >
							<el-form-item label="物料属性" prop="Material_p">
								<el-select v-model="form.Material_p" placeholder="请选择">
								<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-row :gutter="10">
				  <el-col :span="8">
					  <el-form-item label="承诺到料">
					  <el-date-picker
						style="width: 150px;"
					  	 v-model="form.promise_date"
					  	 type="date"
					  	format="yyyy/MM/dd"
					  	value-format="yyyy/MM/dd">
					  </el-date-picker>
					  </el-form-item>
				  </el-col>
				  <el-col :span="8" >
					<el-form-item label="实际到料">
					<el-date-picker
						style="width: 150px;"
						 v-model="form.promised_date"
						 type="date"
						format="yyyy/MM/dd"
						value-format="yyyy/MM/dd">
					</el-date-picker>
					</el-form-item>
				  </el-col>
				  <el-col :span="8">
					  <el-form-item label="需求日期" prop="demand_date">
					  <el-date-picker
						style="width: 150px;"
						 v-model="form.demand_date"
						 type="date"
						 format="yyyy/MM/dd"
						value-format="yyyy/MM/dd">
					  </el-date-picker>
					  </el-form-item>
				  </el-col>
				  </el-row>
				  <el-row>
					  <el-col :span="8" >
						<el-form-item label="RDM任务号" >
						<el-input v-model="form.rdm_id" maxlength="7" onkeyup="value=value.replace(/[^0-9]/g,'');"></el-input>
						</el-form-item>
					</el-col>
					<el-col :span="8" >
						<el-form-item label="交付人" prop="conveyer">
						<el-input v-model="form.conveyer" onkeyup="this.value=this.value.replace(/[^\u4e00-\u9fa5]/g,'')"></el-input>
						</el-form-item>
					  </el-col>
					  
				  </el-row>
			 </el-form>
			 <span slot="footer" class="dialog-footer">
			 <el-button @click="updatedialogVisible_3_ex = false">取 消</el-button>
			 <el-button id ="bt_ok" plain type="primary" @click="updatekpi_3_ex();">确 定</el-button>
			 </span>
			</el-dialog>
			
			<el-dialog
			 title="生产计划"
			 :visible.sync="updatedialogVisible_3"
			 :lock-scroll ="false"
			 width="60%">
			 <el-form ref="authform_3" :model="form" :rules="rules" label-width="80px" :inline="false" class="demo-form-inline" size="medium">
				  <el-row :gutter="10">
				  <el-col :span="8">
					  <el-form-item label="物料库存" >
					  <el-select v-model="form.Material_inventory" placeholder="请选择">
					   <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-col :span="8">
					  <el-form-item label="承诺到料">
					  <el-date-picker
						style="width: 150px;"
						 v-model="form.promise_date"
						 type="date"
						format="yyyy/MM/dd"
						value-format="yyyy/MM/dd">
					  </el-date-picker>
					  </el-form-item>
				  </el-col>
				  <el-col :span="8" >
					<el-form-item label="实际到料">
					<el-date-picker
						style="width: 150px;"
						 v-model="form.promised_date"
						 type="date"
						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="8">
							<el-form-item label="采购员" >
							<el-select v-model="form.buyer" filterable placeholder="请选择">
							   <el-option
								 v-for="item in buyer_options"
								 :key="item.value"
								 :label="item.label"
								 :value="item.value">
							   </el-option>
							 </el-select>
							</el-form-item>
					  </el-col>
					  <el-col :span="8" >
						<el-form-item label="物料属性" prop="Material_p">
							<el-select v-model="form.Material_p" placeholder="请选择">
							<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>
			 <span slot="footer" class="dialog-footer">
			 <el-button @click="updatedialogVisible_3 = false">取 消</el-button>
			 <el-button id ="bt_ok" plain type="primary" @click="updatekpi_3()">确 定</el-button>
			 </span>
			</el-dialog>
			
			<el-drawer
			    title="日志"
			    :visible.sync="drawer"
			    :direction="direction"
			    :before-close="handleClose"
				size="40%"
				>
				<el-tag type="success" style="font-size:14px;margin-left: 20px;margin-bottom: 10px;">
					计划当前处理部门：{{cur_did_name}}
					</el-tag>
			    <el-table
			        :data="tableData1"
			        style="font-size:14px;margin-left: 20px;width: 90%;"
			        :height="tHeight*0.5"
			    	:cell-style="{background:'#fff'}"
			    	border
			    	>
			    	<el-table-column
			    	  prop="op_time"
			    	  label="操作时间"
			    	  width="150">
			    	</el-table-column>
			        <el-table-column
			          prop="op_user"
			          label="操作人"
			          width="80">
			        </el-table-column>
			        <el-table-column
			          prop="op_context"
			          label="记录内容"
					  width="200"
			    	 :show-overflow-tooltip="true">
			        </el-table-column>
			      </el-table>
				  <el-table
				      :data="usetime_t_data"
				      style="font-size:14px;margin-left: 20px;width: 90%;"
				      :height="tHeight*0.5"
				  	:cell-style="{background:'#fff'}"
				  	border
				  	>
				  	<el-table-column
				  	  prop="department_name"
				  	  label="部门"
				  	  width="100">
				  	</el-table-column>
				      <el-table-column
				        prop="usetime_h"
				        label="处理时间(h)"
				        width="100">
				      </el-table-column>
				      <el-table-column
				        prop="task_in_time"
				        label="转入时间"
				  	 width="150">
				      </el-table-column>
				  	<el-table-column
				  	  prop="task_out_time"
				  	  label="转出时间"
				  	 width="150">
				  	</el-table-column>
				    </el-table>
			</el-drawer>
			
			<el-dialog
			 title="生产计划导入"
			 :visible.sync="importdialogVisible"
			 :lock-scroll ="false"
			 :before-close="importDialog_close"
			 width="50%">
				<div style="display: flex;">
					<el-upload
					 class="upload-demo"
					 action=""
					 :on-change="handleChange"
					 :file-list="fileListUpload"
					 :show-file-list="false"
					  accept=".csv"
					  :auto-upload="false">
					  <el-button id ="bt_upload" size="small" plain type="primary">点击上传（csv文件）</el-button>
					</el-upload>
					 <el-button id ="bt_import" size="small" plain type="primary" @click="importData" style="margin-left: 10px;">确认导入</el-button>
				<el-button id ="bt_download" size="small" plain type="primary" @click="download_template" style="margin-left: 10px;">下载导入模板文件</el-button>
				</div>
				<div>
					<el-progress v-if="if_show_process" :percentage="percent_len" :stroke-width="2"></el-progress>
				</div>
				<el-table
					    :data="importTableData"
					    style="font-size:14px;margin-top: 10px;width: 100%;"
						:row-class-name="tableRowClassName"
						stripe border>
						
						<el-table-column
						  prop="task_id"
						  label="计划/项目号"
						  width="150"
						  :show-overflow-tooltip="true">
						</el-table-column>
						<el-table-column
						  prop="product_id"
						  label="产品编号"
						  width="120"
						  :show-overflow-tooltip="true">
						</el-table-column>
						<el-table-column
						  prop="total_num"
						  label="数量"
						 width="60">
						</el-table-column>
						
						<el-table-column
						  prop="demand_date"
						  label="需求日期"
						 width="80">
						</el-table-column>
						<el-table-column
						  prop="rdm_id"
						  label="RDM任务号"
						 width="80">
						</el-table-column>
						<el-table-column
						  prop="conveyer"
						  label="交付人"
						 width="60">
						</el-table-column>
						
						<el-table-column
						  prop="plan_state"
						  label="生产状态"
						 width="80">
						</el-table-column>
					  </el-table>
			</el-dialog>
			
			<el-dialog
			 title="任务转出"
			 :visible.sync="transdialogVisible"
			 :lock-scroll ="false"
			 width="30%">
				<div style="display: flex;">
					<el-select v-model="transform.department_name" placeholder="请选择转出部门">
						<el-option
						  v-for="item in units_options"
						  :key="item.value"
						  :label="item.label"
						  :value="item.value">
						</el-option>
					</el-select>
				</div>
				<span slot="footer" class="dialog-footer">
				<el-button @click="transdialogVisible = false">取 消</el-button>
				<el-button id ="bt_ok_transfer" plain type="primary" @click="task_transfer();transdialogVisible = false">确 定</el-button>
				</span>
			</el-dialog>
		</div>
		`,
	data(){
		// 获取当前屏幕的分辨率
		let screenW = window.screen.width;
		let screenH = window.innerHeight;
		console.log("screen width:",screenW);
		console.log("screen height:",screenH);
	  return {
		tHeight:screenH-240,
		tableData: Array(0),
		tableData1: Array(0),
		currentPage: 1,
		pagesize:50,
		pagecnt:1,
		recordTotal:0,
		drawer:false,
		direction: 'rtl',
		
		checked:false,
		value1:'',
		value2:'',
		id_v:'',
		sapid_v:'',
		pid_v:'',
		pname_v:'',
		puser_v:'',
		group_name_v:'',
		plan_state_v:'',
		
		conveyer_v:'',
		rdm_v:'',
		product_user_v:'',
		
		adddialogVisible_5:false,
		updatedialogVisible_5:false,
		updatedialogVisible_5_ex:false,
		adddialogVisible_3:false,
		updatedialogVisible_3:false,
		updatedialogVisible_3_ex:false,
		updatedialogVisible_1:false,
		updatedialogVisible_1_ex:false,
		updatedialogVisible_2:false,
		oper_type:0,
		form: {
			id:0,
			change:false,
			priority:'',
			department_name:'',
			task_id:'',
			product_id:'',
			product_name:'',
			total_num:1,
			
			demand_date:'',
			rdm_id:'',
			conveyer:'',
			Material_p:'',
			
			Material_inventory:'',
			promise_date:'',
			promised_date:'',
			buyer:'',
			
			plan_state:'',
			group_name:'',
			dispath_num:1,
			notes:'',
			feishu_link:'',
			code_state:'',
		},
		rules: {
			task_id: [
			    { required: true, message: '计划/项目号不可为空', trigger: 'blur' }
			],
			product_id: [
			    { required: true, message: '产品编号不可为空', trigger: 'blur' }
			],
			product_name: [
			    { required: true, message: '产品名称不可为空', trigger: 'blur' }
			],
			total_num: [
			    { required: true, message: '数量不可为空', trigger: 'blur' }
			],
			Material_inventory: [
			    { required: true, message: '库存不可为空', trigger: 'blur' }
			],
			buyer: [
			    { required: true, message: '采购者不可为空', trigger: 'blur' }
			],
			group_name: [
			    { required: true, message: '生产组不可为空', trigger: 'blur' }
			],
			plan_state: [
			    { required: true, message: '生产状态不可为空', trigger: 'blur' }
			],
			dispath_num: [
			    { required: true, message: '派发数量不可为空', trigger: 'blur' }
			],
			demand_date:[
			    { required: true, message: '需求日期不可为空', trigger: 'blur' }
			],
			rdm_id:[
			    { required: true, message: 'RDM任务号不可为空', trigger: 'blur' }
			],
			conveyer:[
			    { required: true, message: '交付人不可为空', trigger: 'blur' }
			],
			produce_plan:[
			    { required: true, message: '工序不可为空', trigger: 'blur' }
			],
			produce_plan_use_t:[
			    { required: true, message: '工时不可为空', trigger: 'blur' }
			],
			produce_user:[
			    { required: true, message: '生产人员不可为空', trigger: 'blur' }
			],
			code_state:[
			    { required: true, message: '编程状态不可为空', trigger: 'blur' }
			],
		},
		
		options: [],
		
		importdialogVisible:false,
		fileTemp: null,
		fileListUpload: [],
		importTableData: [],
		
		transdialogVisible:false,
		multipleSelection: [],
		transform: {
			department_name:'',
		},
	
		addplanVisible_1:false,
		planTableData:[],
		plan_op_type:0,
		plan_page_data:{
			department:'',
			task_id:'',
			task_date:'',
			task_time:'',
		},
		maxid:-1,
		planform: {
			id:0,
			produce_plan:'',
			produce_plan_use_t:'',
			produce_user:'',
			dispath_num:1,
			plan_dispath_date:'',
			p_plan_finished_t:'',
			p_actual_finished_t:'',
			p_finished_overdue_day:'',
			pre_time:'',
			code_time:'',
			pre_time_checked:false,
			code_time_checked:false,
		},
		dis_detaile_show:false,
		add_deliveryVisible_2:false,
		delivery_form:{
			id:0,
			delivery_user:'',
			num_ok:0,
		},
		deliveryTableData:[],
		delivery_op_type:0,
		delivery_maxid:-1,
		delivery_detaile_show:false,
		
		if_show_task_finished:false,
		if_show_processed:true,
		if_show_task_add:true,
		if_show_export:false,
		
		if_show_d1:false,
		if_show_d3:false,
		if_show_d5:false,
		
		usetime_t_data:[],
		buyer_options:[],
		
		b_color:'',
		if_del_show:false,
		if_del:false,
		
		p_id_options:[],
		p_process_options:[],
		cur_p_process:'',
		loading: false,
		trans_disabled:false,
		units_options:[],
		percent_len:0,
		if_show_process:false,
		interval:'',
		cur_did_name:'',
		search_promise_date:'',
		
		if_show_process1:false,
		percent_len1:0,
		interval1:'',
		fileListUpload1:[],
		
		more_query_v:'',
		product_users:[],
		update_notes_visible_1:false,
		
		role_id:0,
	  }
	},
	mounted() {
		var _this = this;
		
		var op_user = localStorage.getItem("online_user");
		var level = localStorage.getItem("level")
		this.$data.role_id = level;
		var did = localStorage.getItem("did");
		
		if (level==1 ){
			this.$data.if_del_show =true;
		}
		
		if(did==1){
			this.$data.if_show_d1=true;
			
			this.$data.if_show_export=true;
			this.$data.if_show_task_finished=true;
		} else if (did==3){
			this.$data.if_show_d3=true;
		} else if(did>=4){
			this.$data.if_show_d5=true;
		}
		
		  axios.post('/pkpi/getbUsers',{
		  	opuser:localStorage.getItem("online_user"),
		  	opuser_uuid:localStorage.getItem("uuid"),
		  	buser: '',
		  	index: 1,
		  	count: 1000,
		  })
		    .then(function (response) {
		      console.log(response.data);
		  	objs = response.data.data;
		  	for(var i=0;i<objs.length;++i){
		  		var obj ={
		  			value:objs[i].busername,
		  			label:objs[i].busername
		  		}
		  		_this.$data.buyer_options.push(obj);
		  	}
		    })
		    .catch(function (error) {
		      console.log(error);
		    });
			
		this.get_product_user();
		
		var objs;
		axios.post('/pkpi/getkpi', {
			opuser:localStorage.getItem("online_user"),
			opuser_uuid:localStorage.getItem("uuid"),
		    index: this.$data.currentPage,
		    count: this.$data.pagesize
		  })
		  .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);
		  });
		  
		  
	},
	filters: {
		show_upload_file(file){
			console.log("file:",file);
			if(file.f_name==""){
				return "无";
			}else{
				return file.f_name+" "+file.filing_t;
			}
		},
	},
	methods: {
		check_his_color(row){
			console.log("flag1:",row.flag1);
			if(row.flag1){
				return "color: #FFA500;"
			}else{
				return "color: #409EFF;"
			}
		},
		
		check_note_color_x(row){
			
			if (typeof(row.notes)=="null" || row.notes==""){
				return "color: #C0C4CC;"
			}else{
				return "color: #409EFF;"
			}
		},
		update_notes_1(){
			var _this = this;
			axios.post('/pkpi/update_notes_1', {
				opuser:localStorage.getItem("online_user"),
				opuser_uuid:localStorage.getItem("uuid"),
				id:_this.$data.form.id,
				notes:_this.$data.form.notes,
			})
			.then(function (response) {
				
				let r = response.data.r;
				let s = ""
				let errType = ""
				if (r == 0) {
					errType = "success"
					s = "修改成功！";
				} else{
					errType = "error"
					s = "修改失败！";
				}
				_this.$message({
					message: s,
					type: errType,
					duration: 1500
				});
				
				//更新页面
				if(r==0){
					_this.getkpi(_this.$data.currentPage);
					_this.$data.update_notes_visible_1 = false;
				}
			})
			.catch(function (error) {
			  console.log(error);
			});
		},
		show_update_notes(row){
			this.$data.form.id = row.id;
			this.$data.form.notes = row.notes;
			this.$data.update_notes_visible_1=true;
		},
		
		get_product_user(){
			var _this=this;
			axios.post('/pkpi/getpUsers',{
				opuser:localStorage.getItem("online_user"),
				opuser_uuid:localStorage.getItem("uuid"),
				puser: '',
				group_name_v:'',
				index: 1,
				count: 1000,
			})
			  .then(function (response) {
				  _this.$data.product_users=[];
			    console.log(response.data);
				objs = response.data.data;
				for(var i=0;i<objs.length;++i){
					var obj ={
						value:objs[i].pusername,
						label:objs[i].pusername,
					}
					_this.$data.product_users.push(obj);
				}
			  })
			  .catch(function (error) {
			    console.log(error);
			  });
		},
		
		more_query_select(value){
			console.log(value);
			console.log(this.$data.more_query_v);
			if(value=="时间段"){
				this.$data.sapid_v='';
				this.$data.search_promise_date='';
				this.$data.group_name_v='';
				this.$data.conveyer_v='';
				this.$data.rdm_v='';
				this.$data.product_user_v='';
			} else if (value=="计划号"){
				this.$data.value1='';
				this.$data.search_promise_date='';
				this.$data.group_name_v='';
				this.$data.conveyer_v='';
				this.$data.rdm_v='';
				this.$data.product_user_v='';
			} else if (value=="承诺到料"){
				this.$data.value1='';
				this.$data.sapid_v='';
				this.$data.group_name_v='';
				this.$data.conveyer_v='';
				this.$data.rdm_v='';
				this.$data.product_user_v='';
			} else if(value=="生产分组"){
				this.$data.value1='';
				this.$data.sapid_v='';
				this.$data.search_promise_date='';
				this.$data.conveyer_v='';
				this.$data.rdm_v='';
				this.$data.product_user_v='';
			} else if(value=="交付人"){
				this.$data.value1='';
				this.$data.sapid_v='';
				this.$data.search_promise_date='';
				this.$data.group_name_v='';
				this.$data.rdm_v='';
				this.$data.product_user_v='';
			} else if(value=="RDM"){
				this.$data.value1='';
				this.$data.sapid_v='';
				this.$data.search_promise_date='';
				this.$data.group_name_v='';
				this.$data.conveyer_v='';
				this.$data.product_user_v='';
			} else if(value=="生产人员"){
				this.$data.value1='';
				this.$data.sapid_v='';
				this.$data.search_promise_date='';
				this.$data.group_name_v='';
				this.$data.conveyer_v='';
				this.$data.rdm_v='';
			} else{
				this.$data.value1='';
				this.$data.sapid_v='';
				this.$data.search_promise_date='';
				this.$data.group_name_v='';
				this.$data.conveyer_v='';
				this.$data.rdm_v='';
				this.$data.product_user_v='';
				
				this.getkpi();
			}
		},
		tip_show(files){
			console.log("files:",files);
			if(files==null ||files.length==0){
				return true;
			}else{
				return false;
			}
		},
		down_files(files){
			if(files.length==0){
				this.$message({message: '无文件可下载', type:'warning'}) //加提示
				return;
			}
			
			let _this = this;
			for(let i=0;i<files.length;i++){
				
				downloadUrl(files[i].f_name,"/upload/"+files[i].f_name);
				/*const iframe = document.createElement("iframe");
				iframe.style.display = "none"; // 防止影响页面
				iframe.style.height = 0; // 防止影响页面
				iframe.src = "/upload/"+files[i].f_name; 
				document.body.appendChild(iframe); // 这一行必须，iframe挂在到dom树上才会发请求
				iframe.onload = function () {
					document.body.removeAttribute(iframe) // 之后删除iframe
				}*/
			}
		},
		check_file_color_c(row){
			console.log("row.f_c",row.id,row.f_c);
			console.log("row.f_x",row.id,row.f_x);
			
			if(row.f_c==null && row.f_x==null){
				//return "color: #c04851;"
				return "color:#ed5a65"
			}
			
			if(row.f_c.length==0 && row.f_x==null){
				//return "color: #c04851;"
				return "color:#ed5a65"
			}
			
			if(row.f_c==null && row.f_x.length==0){
				//return "color: #c04851;"
				return "color:#ed5a65"
			}
			
			if(row.f_c.length==0 && row.f_x.length==0){
				//return "color: #c04851;"
				return "color:#ed5a65"
			}
			
			if(row.f_c ==null || row.f_c.length==0){
				return "color: #C0C4CC;"
			}else{
				return "color: #409EFF;"
			}
		},
		check_file_color_x(row){
			if(row.f_c==null && row.f_x==null){
				//return "color: #c04851;"
				return "color:#ed5a65"
			}
			
			if(row.f_c.length==0 && row.f_x==null){
				//return "color: #c04851;"
				return "color:#ed5a65"
			}
			
			if(row.f_c==null && row.f_x.length==0){
				//return "color: #c04851;"
				return "color:#ed5a65"
			}
			
			if(row.f_c.length==0 && row.f_x.length==0){
				//return "color: #c04851;"
				return "color:#ed5a65"
			}
			
			if(row.f_x==null || row.f_x.length==0){
				return "color: #C0C4CC;"
			}else{
				return "color: #409EFF;"
			}
		},
		check_code_state(row){
			if(row.code_state=="无需" || row.code_state==""){
				return false;
			}else{
				return true;
			}
		},
		celldblclick_1(row, column, cell, event){
		  if( event.type === "dblclick"){
			  console.log("列",column.id);
			  console.log(event.target.innerText);
			  if(column.id=="el-table_1_column_2" || column.id=="el-table_1_column_5" || column.id=="el-table_1_column_6"){
				  var save = function (e){
				  　　　　　　e.clipboardData.setData('text/plain',row.id+" "+row.task_id+" "+row.product_id); 
				  　　　　　　e.preventDefault();//阻止默认行为
				  　　　　}
		  　　　　document.addEventListener('copy',save);
		  　　　　document.execCommand("copy");
		  　　　　document.removeEventListener('copy',save);
		  
				this.$message({message: '复制成功', type:'success'}) //加提示
			  }
		  }
		},
		setValueNull(val) {
			this.$data.planform.produce_plan_use_t='';
		},
		mul_update_kpi_1(file, fileList) {
			this.$data.fileListUpload1=[];
		   
			this.fileTemp = file.raw
			console.log("filetype:",this.fileTemp);
		   	if (this.fileTemp) {
				console.log("begin ...")
				console.log(this.fileTemp.type);
		      	if ((this.fileTemp.type == 'text/csv') || (this.fileTemp.type == '.csv') || (this.fileTemp.type == 'application/vnd.ms-excel')) {
					let _this = this//如果需要点击事件结束之后对DOM进行操作使用)_this.xx=xx进行操作
					Papa.parse(_this.fileTemp, {
						encoding:'gb2312',
					  complete (results) {
						console.log(results)//这个是csv文件的数据
						let objs = []
						//遍历csv文件中的数据，存放到data中 方法不唯一，可自己更改
						for (let i = 0; i < results.data.length; ++i) {
							if(i==0){
								continue;
							}
							let obj = {}
							obj.produce_plan_data=[];
							
							obj.id =parseInt(results.data[i][0]);
							obj.group_name = results.data[i][12];
							obj.plan_state =results.data[i][18];
							obj.dispath_num= results.data[i][13];
							obj.feishu_link=results.data[i][19];
							obj.code_state=results.data[i][20];
							
							var t_obj ={
								produce_plan:results.data[i][21],
								produce_plan_use_t:results.data[i][22],
								produce_user:results.data[i][25],
								dispath_num:results.data[i][26],
								plan_dispath_date:results.data[i][27],
								p_plan_finished_t:results.data[i][28],
								p_actual_finished_t:results.data[i][29],
								pre_time:results.data[i][23],
								code_time:results.data[i][24],
							}
							obj.produce_plan_data.push(t_obj);
							if(obj.id==""|| obj.id==undefined||isNaN(obj.id)){
								continue;
							}
							console.log("id",obj.id);
							objs.push(obj);
						}
						console.log('data', objs)
						
						_this.$data.percent_len1=0;
						_this.$data.if_show_process1=true;
						_this.$data.interval1= setInterval(()=>{
						   if(_this.$data.percent_len>=99){
								clearInterval(_this.$data.interval1);
								return;
						   }
						   
						   if (_this.$data.percent_len1<98){
							   _this.$data.percent_len1+=2
						   }
						},20)
						
						//send to server
						axios.post('/pkpi/mul_update_kpi_1', {
							opuser:localStorage.getItem("online_user"),
							opuser_uuid:localStorage.getItem("uuid"),
							data:objs,
						})
						.then(function (response) {
							
							let r = response.data.r;
							let s = ""
							let errType = ""
							if (r == 0) {
								let len = objs.length;
								errType = "success"
								s = "导入"+len+"条生产计划成功！";
								
								_this.$data.percent_len1=100;
								_this.$data.if_show_process1=false;
							} else if(r==1){
								errType = "error"
								s = "工序派产数量总和不可大于派产总数量！";
								clearInterval(_this.$data.interval1);
							} else if (r ==3) {
								errType = "error"
								s = "派产总数量不可大于计划数量！";
								clearInterval(_this.$data.interval1);
							} else if (r==2){
								errType = "error"
								s = response.data.err_text;
								clearInterval(_this.$data.interval1);
							} else {
								errType = "error"
								s = "导入生产计划失败！";
								clearInterval(_this.$data.interval1);
							}
							
							_this.$data.if_show_process1=false;
											
							_this.$message({
								message: s,
								type: errType,
								duration: 3000
							});
											
							//更新页面
							_this.getkpi();
							
						})
						.catch(function (error) {
						  console.log(error);
						});
					  }
					})
							
				} else {
					this.$data.fileListUpload1=[];
					this.$message({
					type: 'warning',
						message: '附件格式错误，请删除后重新上传！'
					})
				}
		   	} else {
		    	this.$message({
		   			type: 'warning',
		            message: '请上传附件！'
		        	})
			}
		},
		code_time_checked_change(val){
			if(val){
				this.$data.planform.code_time=1;
			}
		},
		pre_time_checked_change(val){
			if(val){
				this.$data.planform.pre_time=1;
			}
		},
		to_redmine(row){
			let id = parseInt(row.rdm_id);
			if (id<10000){
				return;
			}
			url = encodeURI("http://123.54.1.214:10010/redmine/issues/"+row.rdm_id);
			window.open(url, "");
		},
		handleCommand(command) {
			if (command === 'export_undo_plan') {
				this.exportkpi();
			} else if (command === 'export_plan_over') {
				//document.getElementById("bt_export").blur();
				
				var _this = this;
				var objs;
				axios.post('/pkpi/exportKpi_ex', {
					opuser:localStorage.getItem("online_user"),
					opuser_uuid:localStorage.getItem("uuid"),
					id:this.$data.id_v,
					task_id:this.$data.sapid_v,
					pid:this.$data.pid_v,
					pname:this.$data.pname_v,
					group_name:this.$data.group_name_v,
					month:this.$data.value1,
					if_checked:this.$data.checked,
					plan_state:this.$data.plan_state_v,
					if_del:this.$data.if_del,
					plan_finished:true,
				  })
				  .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+".csv"
					console.log(response.data);
					var fileid = response.data.fileId;
					
					var downUrl = 'file/'+fileid;
					downloadUrl(filename,downUrl);
				  })
				  .catch(function (error) {
					console.log(error);
				  });
			} else if (command==='export_transfer_history'){
				var _this = this;
				var objs;
				axios.post('/pkpi/export_transfer_history', {
					opuser:localStorage.getItem("online_user"),
					opuser_uuid:localStorage.getItem("uuid"),
					month:this.$data.value1,
				  })
				  .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+".csv"
					console.log(response.data);
					var fileid = response.data.fileId;
					
					var downUrl = 'file/'+fileid;
					downloadUrl(filename,downUrl);
				  })
				  .catch(function (error) {
					console.log(error);
				  });
			} else if(command == "export_plan_collect"){
				var _this = this;
				var objs;
				axios.post('/pkpi/export_plan_collect', {
					opuser:localStorage.getItem("online_user"),
					opuser_uuid:localStorage.getItem("uuid"),
				  })
				  .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+".csv"
					console.log(response.data);
					var fileid = response.data.fileId;
					
					var downUrl = 'file/'+fileid;
					downloadUrl(filename,downUrl);
				})
				.catch(function (error) {
					console.log(error);
				});
			} else if(command == "export_plan_inspection_not_completed"){
				var _this = this;
				var objs;
				axios.post('/pkpi/export_not_completed_Kpi', {
					opuser:localStorage.getItem("online_user"),
					opuser_uuid:localStorage.getItem("uuid"),
					id:this.$data.id_v,
					task_id:this.$data.sapid_v,
					pid:this.$data.pid_v,
					pname:this.$data.pname_v,
					group_name:this.$data.group_name_v,
					month:this.$data.value1,
					if_checked:this.$data.checked,
					plan_state:this.$data.plan_state_v,
					if_del:this.$data.if_del,
					plan_finished:true,
				  })
				  .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+".csv"
					console.log(response.data);
					var fileid = response.data.fileId;
					
					var downUrl = 'file/'+fileid;
					downloadUrl(filename,downUrl);
				  })
				  .catch(function (error) {
					console.log(error);
				  });
			}else if(command == "export_plan_inspection_completed"){
				var _this = this;
				var objs;
				axios.post('/pkpi/export_completed_Kpi', {
					opuser:localStorage.getItem("online_user"),
					opuser_uuid:localStorage.getItem("uuid"),
					id:this.$data.id_v,
					task_id:this.$data.sapid_v,
					pid:this.$data.pid_v,
					pname:this.$data.pname_v,
					group_name:this.$data.group_name_v,
					month:this.$data.value1,
					if_checked:this.$data.checked,
					plan_state:this.$data.plan_state_v,
					if_del:this.$data.if_del,
					plan_finished:true,
				  })
				  .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+".csv"
					console.log(response.data);
					var fileid = response.data.fileId;
					
					var downUrl = 'file/'+fileid;
					downloadUrl(filename,downUrl);
				  })
				  .catch(function (error) {
					console.log(error);
				  });
			}
			
		},
		selectChanged(value) {
			console.log(value)
			this.getkpi();
		},
		input_change(value) {
			console.log(value);
			this.getkpi();
		},
		show_kpi_del_his(row){
			var _this =this;
			axios.post('/pkpi/get_del_kpi_his', {
				opuser:localStorage.getItem("online_user"),
				opuser_uuid:localStorage.getItem("uuid"),
				id: row.id,
			  })
			  .then(function (response) {
				console.log(response.data);
				const h = _this.$createElement;
				obj=response.data.data
				_this.$notify({
				  title: '删除详情',
				  message: h('p', { style: 'color: teal'}, obj)
				});
			  })
			  .catch(function (error) {
				console.log(error);
			  });
		},
		copy_link(){
			document.getElementById("bt_copy").blur();
			var _this = this;
			var objs;
			axios.post('/pkpi/getkpi', {
				opuser:localStorage.getItem("online_user"),
				opuser_uuid:localStorage.getItem("uuid"),
				index: 1,
				count: 100000,
				id:_this.$data.id_v,
				sap_id:_this.$data.sapid_v,
				pid:_this.$data.pid_v,
				pname:_this.$data.pname_v,
				puser:_this.$data.puser_v,
				bt:_this.$data.value1,
				et:_this.$data.value2,
				if_checked:_this.$data.checked,
				group_name:_this.$data.group_name_v,
				plan_state:_this.$data.plan_state_v,
				if_del:_this.$data.if_del,
				promise_date:this.$data.search_promise_date,
			  })
			  .then(function (response) {
				console.log(response.data);
				objs = response.data.data;
				rcnt = response.data.total;
				
				let text='';
				let save = function (e){
					for(var i=0;i<objs.length;++i){
						if (i==0){
							text=objs[i].feishu_link.toString();
						}else{
							text+="\r"+objs[i].feishu_link.toString();
						}
					}
					console.log("feishu_link fin");
					e.clipboardData.setData('text/plain',text); 
					e.preventDefault();  //阻止默认行为
				}
				document.addEventListener('copy',save);//添加一个copy事件
				document.execCommand("copy");//执行copy方法
				_this.$message({message: '复制成功', type:'success'})//提示
			  })
			  .catch(function (error) {
				console.log(error);
			  });
		},
		remoteMethod(query) {
			  if (query !== '') {
				this.loading = true;
				setTimeout(() => {
				  
				  var _this=this;
				  axios.post('/pkpi/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 = [];
			  }
		},
		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].plan_process_name == value){
					this.$data.planform.produce_plan_use_t = this.$data.cur_p_process.data[i].plan_process_t
					console.log("find");
					console.log(this.$data.planform.produce_plan_use_t);
					break;
				}
			}
		},
		if_fin_cahnge(val){
			if(val){
				this.$data.if_del=false;
				this.$data.trans_disabled=true;
			}else{
				if(this.$data.if_del==false){
					this.$data.trans_disabled=false;
				}
			}
			
			this.getkpi();
		},
		if_del_cahnge(val){
			if(val){
				this.$data.checked=false;
				this.$data.trans_disabled=true;
			}else{
				if(this.$data.checked==false){
					this.$data.trans_disabled=false;
				}
			}
			this.getkpi();
		},
		to_feishu(row){
			url = encodeURI(row.feishu_link);
			window.open(url, "");
		},
		selectedRowStyle({ row, rowIndex }) {
			
			for(var i=0; i< this.$data.multipleSelection.length;i++){
				if(this.$data.multipleSelection[i].id == row.id){
					let styleJson ={
						"background":"#134857",
						"color":"#FFFFFF",
					};
					return styleJson;
				}
			}
		},
		handleMouseEnter(row, column, cell, event){
			console.log("enter in")
			console.log(row);
			row.style="background: #ffffff;";
		  },
		download_template(){
			document.getElementById("bt_download").blur();
			
			var _this = this;
			var objs;
			axios.post('/pkpi/download_template_file', {
				opuser:localStorage.getItem("online_user"),
				opuser_uuid:localStorage.getItem("uuid"),
			  })
			  .then(function (response) {
				console.log(response.data);
				var fileid = response.data.fileId;
				
				var downUrl = 'file/'+fileid;
				downloadUrl("生产计划导入文件模板.csv",downUrl);
			  })
			  .catch(function (error) {
				console.log(error);
			  });
		},
		task_finished(){
			document.getElementById("bt_task_finished").blur();
			
			if (this.$data.checked){
				this.$message({
					message: "已处理任务不允许操作",
					type: "warning",
					duration: 1500
				});
				return
			}
						  
			var selectdata = this.multipleSelection;
			if(selectdata.length==0){
			  this.$message({
				message: "请选择入库任务",
				type: "warning",
				duration: 1500
			  });
			return
			}
			console.log("select cnt:",selectdata.length);

			var req = [];
			for (var i = 0; i < selectdata.length; i++) {
				for(var j=0; j < selectdata[i].produce_plan_data.length;j++){
					if(selectdata[i].produce_plan_data[j].p_actual_finished_t ==""){
						this.$message({
							message: "入库任务实际完成日期不可为空！",
							type: "warning",
							duration: 2000
						  });
						return
					}
				}
				req.push(selectdata[i].id);
			}

			var _this = this;
			axios.post('/pkpi/task_finished', {
			opuser:localStorage.getItem("online_user"),
			opuser_uuid:localStorage.getItem("uuid"),
			id:req
			})
			.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 = response.data.err_text;
			} else{
				errType = "error"
				s = "生产计划入库失败！";
			}
						
			_this.$message({
				message: s,
				type: errType,
				duration: 1500
			});

			//更新页面
			_this.getkpi();
			}).catch(function (error) {
				 console.log(error);
			   });
		},
		show_delivery_detail(row){
			this.$data.deliveryTableData = row.DeliveryDetailInfo;
			this.$data.delivery_detaile_show = true;
		},
		add_deliveryplan_2(){
			if (this.$data.delivery_op_type==1) {
				var obj ={
					id:this.$data.delivery_maxid,
					delivery_user:this.$data.delivery_form.delivery_user,
					num_ok:this.$data.delivery_form.num_ok
				}
				this.$data.deliveryTableData.push(obj);
				
				this.$data.delivery_maxid+=1;
				console.log("id:",this.$data.delivery_maxid);
			} else if (this.$data.delivery_op_type==2){
				for(var i=0;i<this.$data.deliveryTableData.length;++i){
					if(this.$data.deliveryTableData[i].id==this.$data.delivery_form.id){
						
						this.$data.deliveryTableData[i].delivery_user=this.$data.delivery_form.delivery_user;
						this.$data.deliveryTableData[i].num_ok=this.$data.delivery_form.num_ok;
						break;
					}
				}
			}
		},
		del_deliveryplan(row){
			var index =-1;
			for(var i=0;i<this.$data.deliveryTableData.length;++i){
				if(this.$data.deliveryTableData[i].id==row.id){
					index=i;
					break;
				}
			}
			if (index > -1) { 
				this.$data.deliveryTableData.splice(index, 1); 
			} 
		},
		show_updatedeliveryplan_dialog(row){
			this.$data.delivery_form.id=row.id;
			this.$data.delivery_form.delivery_user=row.delivery_user;
			this.$data.delivery_form.num_ok=row.num_ok;
			
			this.$data.delivery_op_type=2;
			this.$data.add_deliveryVisible_2=true;
		},
		showAdd_deliveryplan_2(){
			this.$data.delivery_form.id=0;
			this.$data.delivery_form.delivery_user='';
			this.$data.delivery_form.num_ok='';
			
			this.$data.delivery_op_type=1;
			
			for (var i = 0; i < this.$data.deliveryTableData.length; i++) {
				 if(this.$data.deliveryTableData[i].id >this.$data.delivery_maxid){
					 this.$data.delivery_maxid = this.$data.deliveryTableData[i].id
				 }
			}
			if(this.$data.delivery_maxid !=-1){
				this.$data.delivery_maxid+=1;
			}else{
				this.$data.delivery_maxid = 0;
			}
			
			this.$data.add_deliveryVisible_2=true;
		},
		show_dis_detail(row){
			this.$data.planTableData = row.produce_plan_data;
			
			this.$data.plan_page_data.department=row.department_name;
			this.$data.plan_page_data.task_id=row.task_id;
			this.$data.plan_page_data.task_date = row.CreateTime;
			this.$data.plan_page_data.task_time=row.time;
			
			this.$data.dis_detaile_show = true;
		},
		delKpiplan(row){
			var index =-1;
			for(var i=0;i<this.$data.planTableData.length;++i){
				if(this.$data.planTableData[i].id==row.id){
					index=i;
					break;
				}
			}
			if (index > -1) { 
				this.$data.planTableData.splice(index, 1); 
			} 
		},
		show_updateplan_dialog(row){
			var _this=this;
			axios.post('/pkpi/getpUsers',{
				opuser:localStorage.getItem("online_user"),
				opuser_uuid:localStorage.getItem("uuid"),
				puser: '',
				group_name_v:_this.$data.form.group_name,
				index: 1,
				count: 1000,
			})
			  .then(function (response) {
				  _this.$data.options=[];
			    console.log(response.data);
				objs = response.data.data;
				for(var i=0;i<objs.length;++i){
					var obj ={
						value:objs[i].pusername,
						label:objs[i].pusername,
					}
					_this.$data.options.push(obj);
				}
			  })
			  .catch(function (error) {
			    console.log(error);
			  });
			  
			axios.post('/pkpi/get_p_process_options',{
				opuser:localStorage.getItem("online_user"),
				opuser_uuid:localStorage.getItem("uuid"),
				p_id:_this.$data.form.product_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].plan_process_name,
						label:objs[i].plan_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.dispath_num=row.dispath_num;
			this.$data.planform.id =row.id;
			
			this.$data.planform.plan_dispath_date=row.plan_dispath_date;
			this.$data.planform.p_plan_finished_t=row.p_plan_finished_t;
			this.$data.planform.p_actual_finished_t=row.p_actual_finished_t;
			this.$data.planform.p_finished_overdue_day=row.p_finished_overdue_day;
			
			this.$data.planform.pre_time=row.pre_time;
			this.$data.planform.code_time=row.code_time;
			this.$data.planform.pre_time_checked=row.pre_time_checked;
			this.$data.planform.code_time_checked=row.code_time_checked;
			
			this.$data.plan_op_type=2;
			this.$nextTick(() => {
				this.$refs['planform_1'].clearValidate()
			});
			this.$data.addplanVisible_1=true;
		},
		addkpiplan_1(){
			
			var t_pre_time = '';
			var t_code_time = '';
			if(this.$data.planform.pre_time_checked){
				t_pre_time=this.$data.planform.pre_time;
			}
			if(this.$data.planform.code_time_checked){
				t_code_time=this.$data.planform.code_time;
			}
			
			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,
							dispath_num:this.$data.planform.dispath_num,
							plan_dispath_date:this.$data.planform.plan_dispath_date,
							p_plan_finished_t:this.$data.planform.p_plan_finished_t,
							p_actual_finished_t:this.$data.planform.p_actual_finished_t,
							p_finished_overdue_day:this.$data.planform.p_finished_overdue_day,
							pre_time:t_pre_time,
							code_time:t_code_time,
							pre_time_checked:this.$data.planform.pre_time_checked,
							code_time_checked:this.$data.planform.code_time_checked,
						}
						this.$data.planTableData.push(obj);
						
						this.$data.maxid+=1;
						console.log("id:",this.$data.maxid);
					} else if (this.$data.plan_op_type==2){
						for(var i=0;i<this.$data.planTableData.length;++i){
							if(this.$data.planTableData[i].id==this.$data.planform.id){
								this.$data.planTableData[i].produce_plan=this.$data.planform.produce_plan;
								this.$data.planTableData[i].produce_plan_use_t=this.$data.planform.produce_plan_use_t;
								this.$data.planTableData[i].produce_user=this.$data.planform.produce_user;
								this.$data.planTableData[i].dispath_num=this.$data.planform.dispath_num;
								this.$data.planTableData[i].plan_dispath_date=this.$data.planform.plan_dispath_date;
								this.$data.planTableData[i].p_plan_finished_t=this.$data.planform.p_plan_finished_t;
								this.$data.planTableData[i].p_actual_finished_t=this.$data.planform.p_actual_finished_t;
								this.$data.planTableData[i].p_finished_overdue_day=this.$data.planform.p_finished_overdue_day;
								this.$data.planTableData[i].pre_time=t_pre_time;
								this.$data.planTableData[i].code_time=t_code_time;
								this.$data.planTableData[i].pre_time_checked=this.$data.planform.pre_time_checked;
								this.$data.planTableData[i].code_time_checked=this.$data.planform.code_time_checked;
								console.log(this.$data.planTableData);
								break;
							}
						}
					}
					this.$data.addplanVisible_1 = false;
				}
			});
		},
		showAddkpiplan_1(){
			var op_user = localStorage.getItem("online_user");
			var _this=this;
			axios.post('/pkpi/getpUsers',{
				opuser:localStorage.getItem("online_user"),
				opuser_uuid:localStorage.getItem("uuid"),
				puser: '',
				group_name_v:_this.$data.form.group_name,
				index: 1,
				count: 1000,
			})
			  .then(function (response) {
				  _this.$data.options=[];
			    console.log(response.data);
				objs = response.data.data;
				for(var i=0;i<objs.length;++i){
					var obj ={
						value:objs[i].pusername,
						label:objs[i].pusername,
					}
					_this.$data.options.push(obj);
				}
			  })
			  .catch(function (error) {
			    console.log(error);
			  });
			  
			axios.post('/pkpi/get_p_process_options',{
				opuser:localStorage.getItem("online_user"),
				opuser_uuid:localStorage.getItem("uuid"),
				p_id:_this.$data.form.product_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].plan_process_name,
						label:objs[i].plan_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='';
			if(op_user=="温亚辉" || op_user=="尚永强" || op_user=="刘卫忠"){
				this.$data.planform.dispath_num=this.$data.form.dispath_num;
			}
			//this.$data.planform.dispath_num='';
			this.$data.planform.plan_dispath_date='';
			this.$data.planform.p_plan_finished_t='';
			this.$data.planform.p_actual_finished_t='';
			this.$data.planform.p_finished_overdue_day='';
			
			this.$data.planform.pre_time=0.5;
			this.$data.planform.code_time=0.5;
			this.$data.planform.pre_time_checked=false;
			this.$data.planform.code_time_checked=false;
			
			this.$data.plan_op_type=1;
			
			for (var i = 0; i < this.$data.planTableData.length; i++) {
				 if(this.$data.planTableData[i].id >this.$data.maxid){
					 this.$data.maxid = this.$data.planTableData[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;
		},
		
		handleSelectionChange(val) {
			console.log("已选择");
			console.log(val);
			this.multipleSelection = val;
		},
		  task_transfer(){
			  document.getElementById("bt_ok_transfer").blur();
			  
			  var selectdata = this.multipleSelection;
			  if(selectdata.length==0){
				  this.$message({
				  	message: "请选择转出任务",
				  	type: "warning",
				  	duration: 1500
				  });
				return
			  }
			  console.log("select cnt:",selectdata.length);
			  
			  var req = [];
			  for (var i = 0; i < selectdata.length; i++) {
			  	req.push(selectdata[i].id);
			  }
			  
			  var _this = this;
			  axios.post('/pkpi/task_transfer', {
				opuser:localStorage.getItem("online_user"),
				opuser_uuid:localStorage.getItem("uuid"),
				id:req,
				department_name:this.$data.transform.department_name
			  })
			  .then(function (response) {
			  	
			  	let r = response.data.r;
			  	let s = ""
			  	let errType = ""
			  	if (r == 0) {
			  		errType = "success"
					s = "生产计划转出成功！";
			  	} else{
			  		errType = "error"
					s = "生产计划转出失败！";
			  	}
			  				
			  	_this.$message({
			  		message: s,
			  		type: errType,
			  		duration: 1500
			  	});
				
				//更新页面
				_this.getkpi();
			  
			  this.$data.form.department_name = '';
			  this.$data.transdialogVisible = false;
		  }).catch(function (error) {
			     console.log(error);
			   });
		},
		  show_taskTransfer_disalog(){
			  if (this.$data.checked){
				  this.$message({
				  	message: "已处理任务不允许操作",
				  	type: "warning",
				  	duration: 1500
				    });
				  return
			  }
			  
			  document.getElementById("bt_task_transfer").blur();
			  var selectdata = this.multipleSelection;
			  if(selectdata.length==0){
				  this.$message({
					message: "请选择转出任务",
					type: "warning",
					duration: 1500
				  });
				return
			  }
			  
			  this.$data.units_options=[];
			  
			  var obj ={
			  	value:"供应链",
			  	label:"供应链",
			  }
			  this.$data.units_options.push(obj);
			  
			  obj ={
			  	value:"生产",
			  	label:"生产",
			  }
			  this.$data.units_options.push(obj);
			  
			  obj ={
			  	value:"研发",
			  	label:"研发",
			  }
			  this.$data.units_options.push(obj);
			  
			  obj ={
			  	value:"技术",
			  	label:"技术",
			  }
			  this.$data.units_options.push(obj);
			  
			  obj ={
			  	value:"交付",
			  	label:"交付",
			  }
			  this.$data.units_options.push(obj);
			  
			  obj ={
			  	value:"保温瓶",
			  	label:"保温瓶",
			  }
			  this.$data.units_options.push(obj);
			  
			  obj ={
			  	value:"生产订单",
			  	label:"生产订单",
			  }
			  this.$data.units_options.push(obj);
			  
			  this.$data.transdialogVisible=true;
		  },
		  
		  importData(){
				document.getElementById("bt_import").blur();
				if(this.$data.importTableData.length==0){
				   this.$message({
					message: "请选择导入文件",
					type: "warning",
					duration: 1500
				   });
				   return;
				}
			   
			   this.$data.percent_len=0;
			   this.$data.if_show_process=true;
			   this.$data.interval= setInterval(()=>{
				   if(this.$data.percent_len>=99){
						clearInterval(this.$data.interval);
						return;
				   }
				   this.$data.percent_len+=1
			   },20)
			   var _this = this;
			   
			   axios.post('/pkpi/importKpi', {
					opuser:localStorage.getItem("online_user"),
					opuser_uuid:localStorage.getItem("uuid"),
					data:this.$data.importTableData,
			   })
			   .then(function (response) {
			   	
			   	let r = response.data.r;
			   	let s = ""
			   	let errType = ""
			   	if (r == 0) {
					let len = _this.$data.importTableData.length;
					 _this.$data.percent_len=100;
					 _this.$data.if_show_process=false;
					 
					 errType = "success"
					 s = "导入"+len+"生产计划成功！";
			   	} else if(r==1){
			   		errType = "error"
					s = response.data.err_text;
					clearInterval(_this.$data.interval);
			   	} else{
			   		errType = "error"
					s = "导入生产计划失败！";
					clearInterval(_this.$data.interval);
			   	}
				
			   	_this.$message({
			   		message: s,
			   		type: errType,
			   		duration: 1500
			   	});
				
				_this.$data.importdialogVisible=false;
			   	//更新页面
			   	_this.getkpi();
			   	
			   })
			   .catch(function (error) {
			     console.log(error);
			   });
		  },
		  importDialog_close(done){
			  console.log("关闭导入对话框");
			  done();
		  },
		  handleChange(file, fileList) {
			   document.getElementById("bt_upload").blur();
			   
				this.fileTemp = file.raw
				console.log("filetype:",this.fileTemp);
		     	if (this.fileTemp) {
					console.log("begin ...")
					console.log(this.fileTemp.type);
		        	if ((this.fileTemp.type == 'text/csv') || (this.fileTemp.type == '.csv') || (this.fileTemp.type == 'application/vnd.ms-excel')) {
						let _this = this//如果需要点击事件结束之后对DOM进行操作使用)_this.xx=xx进行操作
						Papa.parse(_this.fileTemp, {
						  encoding:'gb2312',
						  complete (results) {
							console.log(results)//这个是csv文件的数据
							let data = []
							//遍历csv文件中的数据，存放到data中 方法不唯一，可自己更改
							for (let i = 0; i < results.data.length; ++i) {
								if(i==0){
									continue;
								}
								  let obj = {}
								  obj.task_id = results.data[i][0]
								  if(obj.task_id==""|| obj.task_id==undefined){
									  continue;
								  }
								  obj.product_id = results.data[i][1]
								  obj.total_num = results.data[i][2]
								  obj.demand_date = results.data[i][3]
								  obj.rdm_id = results.data[i][4]
								  obj.conveyer = results.data[i][5]
								  obj.plan_state=results.data[i][6]
								  data.push(obj)
							}
							//data.splice(0, 1)//将数组第一位的表格名称去除
							let num = 0
							console.log('data', data)
							_this.$data.importTableData=data;
						  }
						})
								
					} else {
						this.$data.fileListUpload=[];
						this.$message({
						type: 'warning',
							message: '附件格式错误，请删除后重新上传！'
						})
					}
		     	} else {
		      	this.$message({
		     			type: 'warning',
		              message: '请上传附件！'
		          	})
		    		}
		  },
		
			handleRemove(file, fileList) {
		          console.log(file, fileList);
		        },
		  importCsv(){
			  this.$data.fileListUpload=[];
			  this.$data.importTableData=[];
			  this.$data.importdialogVisible=true;
			  
			   this.$data.if_show_process=false;
		  },
		  
		  exportkpi(){
				
				var _this = this;
				var objs;
				axios.post('/pkpi/exportKpi', {
					opuser:localStorage.getItem("online_user"),
					opuser_uuid:localStorage.getItem("uuid"),
					id:this.$data.id_v,
					task_id:this.$data.sapid_v,
					pid:this.$data.pid_v,
					pname:this.$data.pname_v,
					group_name:this.$data.group_name_v,
					month:this.$data.value1,
					if_checked:this.$data.checked,
					plan_state:this.$data.plan_state_v,
					if_del:this.$data.if_del,
					promise_date:this.$data.search_promise_date,
					conveyer:this.$data.conveyer_v,
					rdm_id:this.$data.rdm_v,
					product_user:this.$data.product_user_v,
				  })
				  .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+".csv"
					console.log(response.data);
					var fileid = response.data.fileId;
					
					var downUrl = 'file/'+fileid;
					downloadUrl(filename,downUrl);
				  })
				  .catch(function (error) {
					console.log(error);
				  });
		  },
		  
		  tableRowClassName({row, rowIndex}) {
				var n = rowIndex%2;
				if (n == 1) {
					return 'success-row';
				}
				
				this.$data.b_color="color: #FF0000;"
				return '';
		  },
		  
		show_update_dialog(row){
			  var promise_date;
			  if(row.promise_date !=undefined &&row.promise_date.length>0){
				  promise_date="20"+row.promise_date
			  }else{
				  promise_date=''
			  }
			  
			  var promised_date;
			  if (row.promised_date !=undefined &&row.promised_date.length>0){
				  promised_date="20"+row.promised_date;
			  }else{
				  promised_date=''
			  }
			  
			  var demand_d;
			  if (row.demand_date != undefined && row.demand_date.length>0){
				   demand_d="20"+row.demand_date;
			  }else{
				  demand_d='';
			  }
			  
			  this.$data.form = {
			  	id:row.id,
			  	priority:row.priority,
			  	department_name:row.department_name,
			  	task_id:row.task_id,
			  	product_id:row.product_id,
			  	product_name:row.product_name,
			  	total_num:row.total_num,
				
				demand_date:demand_d,
				rdm_id:row.rdm_id,
				conveyer:row.conveyer,
				Material_p:row.Material_p,
			  	
			  	Material_inventory:row.Material_inventory,
			  	promise_date:promise_date,
			  	promised_date:promised_date,
				buyer:row.buyer,
				
				group_name:row.group_name,
				dispath_num:row.dispath_num,
				plan_state:row.plan_state,
				
				notes:row.notes,
				feishu_link:row.feishu_link,
				code_state:row.code_state,
			  };
			  
			 
			var op_user = localStorage.getItem("online_user");
			var level = localStorage.getItem("level");
			 var did = localStorage.getItem("did");
			 if(did>=4){
				  if(row.if_show_del){
					  this.$nextTick(() => {
					  	this.$refs['authform_5'].clearValidate()
					  });
					  this.$data.updatedialogVisible_5 = true;
				  }else{
					  this.$nextTick(() => {
					  	this.$refs['authform_5_ex'].clearValidate()
					  });
					  this.$data.updatedialogVisible_5_ex = true;
				  }
			 	
			 }else if(did==3){
				 if(row.if_show_del){
					 this.$nextTick(() => {
					 	this.$refs['authform_3_ex'].clearValidate()
					 });
					 this.$data.updatedialogVisible_3_ex = true;
				 }else{
					 this.$nextTick(() => {
					 	this.$refs['authform_3'].clearValidate()
					 });
					 this.$data.updatedialogVisible_3 = true;
				 }
			 }else if (did==1){
				 this.$data.planTableData=[];
				 if(row.produce_plan_data != null){
					  for(var i=0;i<row.produce_plan_data.length;++i){
						  var obj ={
							  id:row.produce_plan_data[i].id,
							  produce_plan:row.produce_plan_data[i].produce_plan,
							  produce_plan_use_t:row.produce_plan_data[i].produce_plan_use_t,
							  produce_user:row.produce_plan_data[i].produce_user,
							  dispath_num:row.produce_plan_data[i].dispath_num,
							  plan_dispath_date:row.produce_plan_data[i].plan_dispath_date,
							  p_plan_finished_t:row.produce_plan_data[i].p_plan_finished_t,
							  p_actual_finished_t:row.produce_plan_data[i].p_actual_finished_t,
							  p_finished_overdue_day:row.produce_plan_data[i].p_finished_overdue_day,
							  pre_time:row.produce_plan_data[i].pre_time,
							  code_time:row.produce_plan_data[i].code_time,
							  pre_time_checked:row.produce_plan_data[i].pre_time_checked,
							  code_time_checked:row.produce_plan_data[i].code_time_checked
						  }
						  this.$data.planTableData.push(obj);
					  }
				 }
				 console.log("planTableData:",row.produce_plan_data);
				 if(op_user=="温亚辉"){
					 this.$data.form.group_name="生产组";
				 } else if(op_user=="尚永强"){
					 this.$data.form.group_name="电装组";
				 } else if (op_user=="刘卫忠"){
					 this.$data.form.group_name="保温瓶组";
				 }
				 if(op_user=="温亚辉" || op_user=="尚永强" || op_user=="刘卫忠"){
					 if(this.$data.form.plan_state=="待分解"){
						 this.$data.form.plan_state="待派产";
					 }
					 this.$data.form.dispath_num=this.$data.form.total_num;
				 }
				
				if(row.if_show_del){
					 this.$nextTick(() => {
						this.$refs['authform_1_ex'].clearValidate()
					 });
					 this.$data.updatedialogVisible_1_ex = true;
				}else{
					 this.$nextTick(() => {
						this.$refs['authform_1'].clearValidate()
					 });
					 this.$data.updatedialogVisible_1 = true;
				}
			 } else if (did==2){
				 this.$data.deliveryTableData=[];
				 if(row.DeliveryDetailInfo != null){
					  for(var i=0;i<row.DeliveryDetailInfo.length;++i){
						  var obj ={
							  id:row.DeliveryDetailInfo[i].id,
							  delivery_user:row.DeliveryDetailInfo[i].delivery_user,
							  num_ok:row.DeliveryDetailInfo[i].num_ok
						  }
						  this.$data.deliveryTableData.push(obj);
					  }
				 }
				 console.log("planTableData:",row.DeliveryDetailInfo);
				 this.$data.updatedialogVisible_2 =true;
			 }
		  },
		  updatekpi_2(){
				this.$refs['authform'].validate((valid) => {
					if (valid) {
						var _this = this;
						console.log(_this.$data.form);
						axios.post('/pkpi/updatekpi_2', {
							opuser:localStorage.getItem("online_user"),
							opuser_uuid:localStorage.getItem("uuid"),
							data:{
								id:_this.$data.form.id,
								plan_state:_this.$data.form.plan_state,
								notes:_this.$data.form.notes,
								DeliveryDetailInfo:_this.$data.deliveryTableData,
							}
						})
						.then(function (response) {
							
							let r = response.data.r;
							let s = ""
							let errType = ""
							if (r == 0) {
								errType = "success"
								s = "修改生产计划成功！";
							} else{
								errType = "error"
								s = "修改生产计划失败！";
							}
							_this.$message({
								message: s,
								type: errType,
								duration: 1500
							});
							//更新页面
							_this.getkpi();
						})
						.catch(function (error) {
						  console.log(error);
						});
					}
				}); 
		  },
		  updatekpi_1(){
			  this.$refs['authform_1'].validate((valid) => {
				if (valid) {
					var _this = this;
					let p_data = [];
					for(var i=0; i<_this.$data.planTableData.length;++i){
						var obj ={
							id:_this.$data.planTableData[i].id,
							produce_plan:_this.$data.planTableData[i].produce_plan,
							produce_plan_use_t:_this.$data.planTableData[i].produce_plan_use_t,
							produce_user:_this.$data.planTableData[i].produce_user,
							dispath_num:_this.$data.planTableData[i].dispath_num.toString(),
							plan_dispath_date:_this.$data.planTableData[i].plan_dispath_date,
							p_plan_finished_t:_this.$data.planTableData[i].p_plan_finished_t,
							p_actual_finished_t:_this.$data.planTableData[i].p_actual_finished_t,
							p_finished_overdue_day:_this.$data.planTableData[i].p_finished_overdue_day,
							pre_time:_this.$data.planTableData[i].pre_time.toString(),
							code_time:_this.$data.planTableData[i].code_time.toString(),
							pre_time_checked:_this.$data.planTableData[i].pre_time_checked,
							code_time_checked:_this.$data.planTableData[i].code_time_checked,
						}
						p_data.push(obj);
					}
					
					console.log(_this.$data.form);
					axios.post('/pkpi/updatekpi_1', {
						opuser:localStorage.getItem("online_user"),
						opuser_uuid:localStorage.getItem("uuid"),
						data:{
							id:_this.$data.form.id,
							product_id:_this.$data.form.product_id,
							total_num:_this.$data.form.total_num.toString(),
							group_name:_this.$data.form.group_name,
							plan_state:_this.$data.form.plan_state,
							dispath_num:_this.$data.form.dispath_num.toString(),
							produce_plan_data:p_data,
							feishu_link:_this.$data.form.feishu_link,
							code_state:_this.$data.form.code_state,
							notes:_this.$data.form.notes,
						}
					})
					.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 if (r ==3) {
								errType = "error"
								s = "派产总数量不可大于计划数量！";
						} else if (r==2){
							errType = "error"
							s = response.data.err_text;
						} else{
							errType = "error"
							s = "修改生产计划失败！";
						}
						_this.$message({
							message: s,
							type: errType,
							duration: 1500
						});
						//更新页面
						
						if(r==0){
							_this.getkpi(_this.$data.currentPage);
							_this.$data.updatedialogVisible_1 = false;
						}
					})
					.catch(function (error) {
					  console.log(error);
					});
				}
			  });
		  },
		  updatekpi_1_ex(){
		  			  this.$refs['authform_1_ex'].validate((valid) => {
		  				if (valid) {
		  					var _this = this;
							
							let p_data = [];
							for(var i=0; i<_this.$data.planTableData.length;++i){
								var obj ={
									id:_this.$data.planTableData[i].id,
									produce_plan:_this.$data.planTableData[i].produce_plan,
									produce_plan_use_t:_this.$data.planTableData[i].produce_plan_use_t,
									produce_user:_this.$data.planTableData[i].produce_user,
									dispath_num:_this.$data.planTableData[i].dispath_num.toString(),
									plan_dispath_date:_this.$data.planTableData[i].plan_dispath_date,
									p_plan_finished_t:_this.$data.planTableData[i].p_plan_finished_t,
									p_actual_finished_t:_this.$data.planTableData[i].p_actual_finished_t,
									p_finished_overdue_day:_this.$data.planTableData[i].p_finished_overdue_day,
									pre_time:_this.$data.planTableData[i].pre_time.toString(),
									code_time:_this.$data.planTableData[i].code_time.toString(),
									pre_time_checked:_this.$data.planTableData[i].pre_time_checked,
									code_time_checked:_this.$data.planTableData[i].code_time_checked,
								}
								p_data.push(obj);
							}
		  					console.log(_this.$data.form);
		  					axios.post('/pkpi/updatekpi_1_ex', {
		  						opuser:localStorage.getItem("online_user"),
		  						opuser_uuid:localStorage.getItem("uuid"),
		  						data:{
		  							id:_this.$data.form.id,
									task_id:_this.$data.form.task_id,
									product_id:_this.$data.form.product_id,
									total_num:_this.$data.form.total_num.toString(),
									demand_date:_this.$data.form.demand_date,
									rdm_id:_this.$data.form.rdm_id,
									conveyer:_this.$data.form.conveyer,
									group_name:_this.$data.form.group_name,
									plan_state:_this.$data.form.plan_state,
									dispath_num:_this.$data.form.dispath_num.toString(),
									feishu_link:_this.$data.form.feishu_link,
									code_state:_this.$data.form.code_state,
									produce_plan_data:p_data,
									notes:_this.$data.form.notes,
		  						}
		  					})
		  					.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 if (r ==3) {
									errType = "error"
									s = "派产总数量不可大于计划数量！";
								} else if(r==2){
									errType = "error"
									s = response.data.err_text;
								} else{
		  							errType = "error"
		  							s = "修改生产计划失败！";
		  						}
		  						_this.$message({
		  							message: s,
		  							type: errType,
		  							duration: 1500
		  						});
		  						//更新页面
		  						
		  						if(r==0){
		  							_this.getkpi(_this.$data.currentPage);
		  							_this.$data.updatedialogVisible_1_ex = false;
		  						}
		  					})
		  					.catch(function (error) {
		  					  console.log(error);
		  					});
		  				}
		  			  });
		  },
		  updatekpi_5(){
			  this.$refs['authform_5'].validate((valid) => {
				if (valid) {
					var _this = this;
					console.log(_this.$data.form);
					axios.post('/pkpi/updatekpi_5', {
						opuser:localStorage.getItem("online_user"),
						opuser_uuid:localStorage.getItem("uuid"),
						data:{
							id:_this.$data.form.id,
							priority:_this.$data.form.priority,
							department_name:_this.$data.form.department,
							task_id:_this.$data.form.task_id,
							product_id:_this.$data.form.product_id,
							product_name:_this.$data.form.product_name,
							total_num:_this.$data.form.total_num.toString(),
							plan_state:_this.$data.form.plan_state,
							demand_date:_this.$data.form.demand_date,
							rdm_id:_this.$data.form.rdm_id,
							conveyer:_this.$data.form.conveyer,
						}
					})
					.then(function (response) {
						
						let r = response.data.r;
						let s = ""
						let errType = ""
						if (r == 0) {
							errType = "success"
							s = "修改生产计划成功！";
						} else if (r==2){
							errType = "error"
							s = response.data.err_text;
						} else{
							errType = "error"
							s = "修改生产计划失败！";
						}
						_this.$message({
							message: s,
							type: errType,
							duration: 1500
						});
						//更新页面
						_this.getkpi(_this.$data.currentPage);
						_this.$data.updatedialogVisible_5 = false;
					})
					.catch(function (error) {
					  console.log(error);
					});
				}
			  });
		  },
		  updatekpi_5_ex(){
		  			  this.$refs['authform_5_ex'].validate((valid) => {
		  				if (valid) {
		  					var _this = this;
		  					console.log(_this.$data.form);
		  					axios.post('/pkpi/updatekpi_5_ex', {
		  						opuser:localStorage.getItem("online_user"),
		  						opuser_uuid:localStorage.getItem("uuid"),
		  						data:{
		  							id:_this.$data.form.id,
		  							task_id:_this.$data.form.task_id,
		  							product_id:_this.$data.form.product_id,
		  							product_name:_this.$data.form.product_name,
		  							total_num:_this.$data.form.total_num.toString(),
		  						}
		  					})
		  					.then(function (response) {
		  						
		  						let r = response.data.r;
		  						let s = ""
		  						let errType = ""
		  						if (r == 0) {
		  							errType = "success"
		  							s = "修改生产计划成功！";
		  						} else if(r==2){
									errType = "error"
									s = response.data.err_text;
								} else{
		  							errType = "error"
		  							s = "修改生产计划失败！";
		  						}
		  						_this.$message({
		  							message: s,
		  							type: errType,
		  							duration: 1500
		  						});
		  						//更新页面
		  						_this.getkpi(_this.$data.currentPage);
		  						_this.$data.updatedialogVisible_5_ex = false;
		  					})
		  					.catch(function (error) {
		  					  console.log(error);
		  					});
		  				}
		  			  });
		  },
		updatekpi_3_ex(){
		  			  this.$refs['authform_3_ex'].validate((valid) => {
		  				if (valid) {
		  					if ((this.$data.form.Material_inventory =="不足" || this.$data.form.Material_inventory =="无") && this.$data.form.promise_date==""){
		  						this.$message({
		  							message: "承诺到料日期不可为空！",
		  							type : "warning",
		  							duration: 1500
		  						});
		  						return;
		  					}
		  					
		  					var _this = this;
		  					console.log(_this.$data.form);
		  					axios.post('/pkpi/updatekpi_3_ex', {
		  						opuser:localStorage.getItem("online_user"),
		  						opuser_uuid:localStorage.getItem("uuid"),
		  						data:{
		  							id:_this.$data.form.id,
									department_name:_this.$data.form.department,
									task_id:_this.$data.form.task_id,
									product_id:_this.$data.form.product_id,
									product_name:_this.$data.form.product_name,
									total_num:_this.$data.form.total_num.toString(),
		  							plan_state:_this.$data.form.plan_state,
		  							Material_inventory:_this.$data.form.Material_inventory,
		  							promise_date:_this.$data.form.promise_date,
		  							promised_date:_this.$data.form.promised_date,
									buyer:_this.$data.form.buyer,
									demand_date:_this.$data.form.demand_date,
									rdm_id:_this.$data.form.rdm_id,
									conveyer:_this.$data.form.conveyer,
									Material_p:_this.$data.form.Material_p,
		  						}
		  					})
		  					.then(function (response) {
		  						
		  						let r = response.data.r;
		  						let s = ""
		  						let errType = ""
		  						if (r == 0) {
		  							errType = "success"
		  							s = "修改生产计划成功！";
		  						} else if (r==2){
									errType = "error"
									s = response.data.err_text;
								} else{
		  							errType = "error"
		  							s = "修改生产计划失败！";
		  						}
		  						_this.$message({
		  							message: s,
		  							type: errType,
		  							duration: 1500
		  						});
		  						//更新页面
		  						_this.getkpi(_this.$data.currentPage);
								_this.$data.updatedialogVisible_3_ex = false;
		  					})
		  					.catch(function (error) {
		  					  console.log(error);
		  					});
		  					
		  					this.$data.updatedialogVisible_3_ex = false;
		  				}
		  			  });
		  },
		updatekpi_3(){
			  this.$refs['authform_3'].validate((valid) => {
				if (valid) {
					if ((this.$data.form.Material_inventory =="不足" || this.$data.form.Material_inventory =="无") && this.$data.form.promise_date==""){
						this.$message({
							message: "承诺到料日期不可为空！",
							type : "warning",
							duration: 1500
						});
						return;
					}
					
					var _this = this;
					console.log(_this.$data.form);
					axios.post('/pkpi/updatekpi_3', {
						opuser:localStorage.getItem("online_user"),
						opuser_uuid:localStorage.getItem("uuid"),
						data:{
							id:_this.$data.form.id,
							product_id:_this.$data.form.product_id,
							plan_state:_this.$data.form.plan_state,
							Material_inventory:_this.$data.form.Material_inventory,
							promise_date:_this.$data.form.promise_date,
							promised_date:_this.$data.form.promised_date,
							buyer:_this.$data.form.buyer,
							Material_p:_this.$data.form.Material_p,
						}
					})
					.then(function (response) {
						
						let r = response.data.r;
						let s = ""
						let errType = ""
						if (r == 0) {
							errType = "success"
							s = "修改生产计划成功！";
						} else if(r==2){
							errType = "error"
							s = response.data.err_text;
						} else{
							errType = "error"
							s = "修改生产计划失败！";
						}
						_this.$message({
							message: s,
							type: errType,
							duration: 1500
						});
						//更新页面
						_this.getkpi(_this.$data.currentPage);
						_this.$data.updatedialogVisible_3 = false;
					})
					.catch(function (error) {
					  console.log(error);
					});
				}
			  });
		  },
		  
		delKpi(row){
			  
			   this.$confirm('此操作将永久删除, 是否继续?', '提示', {
			            confirmButtonText: '确定',
			            cancelButtonText: '取消',
			            type: 'warning'
			          }).then(() => {
			            var _this = this;
			            axios.post('/pkpi/delKpi', {
			            	opuser:localStorage.getItem("online_user"),
			            	opuser_uuid:localStorage.getItem("uuid"),
			            	id:row.id
			            })
			            .then(function (response) {
			            	
			            	let r = response.data.r;
			            	let s = ""
			            	let errType = ""
			            	if (r == 0) {
			            		errType = "success"
								s = "删除生产计划成功！";
			            	} else{
			            		errType = "error"
								s = "删除生产计划失败！";
			            	}
			            	_this.$message({
			            		message: s,
			            		type: errType,
			            		duration: 1500
			            	});
			            	
			            	//更新页面
			            	_this.getkpi();
			            	
			            })
			            .catch(function (error) {
			              console.log(error);
			            });
			          }).catch(() => {
			          });
		  },
		  
		addkpi_5(){
					  
			this.$refs['authform_5_add'].validate((valid) => {
				if (valid) {
						
					if (this.$data.form.Material_inventory =="不足" && this.$data.form.promise_date==""){
						this.$message({
							message: "承诺到料日期不可为空！",
							type : "warning",
							duration: 1500
						});
						return;
					}
						  
				var _this = this;
				
				console.log(_this.$data.form);
				 
				axios.post('/pkpi/addkpi', {
					opuser:localStorage.getItem("online_user"),
					opuser_uuid:localStorage.getItem("uuid"),
					oper_type: _this.$data.oper_type,
					data:{
						priority:_this.$data.form.priority,
						department_name:_this.$data.form.department,
						task_id:_this.$data.form.task_id,
						product_id:_this.$data.form.product_id,
						product_name:_this.$data.form.product_name,
						total_num:_this.$data.form.total_num,
						plan_state:_this.$data.form.plan_state,
						Material_inventory:_this.$data.form.Material_inventory,
						promise_date:_this.$data.form.promise_date,
						promised_date:_this.$data.form.promised_date,
						buyer:_this.$data.form.buyer,
						demand_date:_this.$data.form.demand_date,
						rdm_id:_this.$data.form.rdm_id,
						conveyer:_this.$data.form.conveyer,
					}
				})
				.then(function (response) {
					
					let r = response.data.r;
					let s = ""
					let errType = ""
					if (r == 0) {
						errType = "success"
						s = "新增生产计划成功！";
					} else if (r ==2) {
						errType = "error"
						s = response.data.err_text;
					} else {
						errType = "error"
						s = "新增生产计划失败！";
					}
					
					_this.$message({
						message: s,
						type: errType,
						duration: 1500
					});
					
					//更新页面
					_this.getkpi();
					_this.$data.adddialogVisible_5 = false;
					
				})
				.catch(function (error) {
				  console.log(error);
				});
			}
			});
		},
		addkpi_3(){
					  
			this.$refs['authform_3_add'].validate((valid) => {
				if (valid) {
						
					if (this.$data.form.Material_inventory =="不足" && this.$data.form.promise_date==""){
						this.$message({
							message: "承诺到料日期不可为空！",
							type : "warning",
							duration: 1500
						});
						return;
					}
						  
				var _this = this;
				
				console.log(_this.$data.form);
				 
				axios.post('/pkpi/addkpi', {
					opuser:localStorage.getItem("online_user"),
					opuser_uuid:localStorage.getItem("uuid"),
					oper_type: _this.$data.oper_type,
					data:{
						priority:_this.$data.form.priority,
						department_name:_this.$data.form.department,
						task_id:_this.$data.form.task_id,
						product_id:_this.$data.form.product_id,
						product_name:_this.$data.form.product_name,
						total_num:_this.$data.form.total_num,
						plan_state:_this.$data.form.plan_state,
						Material_inventory:_this.$data.form.Material_inventory,
						promise_date:_this.$data.form.promise_date,
						promised_date:_this.$data.form.promised_date,
						buyer:_this.$data.form.buyer,
						demand_date:_this.$data.form.demand_date,
						rdm_id:_this.$data.form.rdm_id,
						conveyer:_this.$data.form.conveyer,
						Material_p:_this.$data.form.Material_p,
					}
				})
				.then(function (response) {
					
					let r = response.data.r;
					let s = ""
					let errType = ""
					if (r == 0) {
						errType = "success"
						s = "新增生产计划成功！";
					} else if (r ==2) {
						errType = "error"
						s = response.data.err_text;
					} else {
						errType = "error"
						s = "新增生产计划失败！";
					}
					
					_this.$message({
						message: s,
						type: errType,
						duration: 1500
					});
					
					//更新页面
					_this.getkpi();
					_this.$data.adddialogVisible_3 = false;
					
				})
				.catch(function (error) {
				  console.log(error);
				});
			}
			});
		},
		
		showUpdatehistory(row){
			
			var _this = this;
			axios.post('/pkpi/getkpihis', {
				opuser:localStorage.getItem("online_user"),
				opuser_uuid:localStorage.getItem("uuid"),
				id:row.id,
			  })
			  .then(function (response) {
			    console.log(response.data);
				objs = response.data.data;
				_this.$data.tableData1 = objs;
			  })
			  .catch(function (error) {
			    console.log(error);
			  });
			  
			  axios.post('/pkpi/get_cur_did_from_task', {
			  	opuser:localStorage.getItem("online_user"),
			  	opuser_uuid:localStorage.getItem("uuid"),
			  	id:row.id,
			    })
			    .then(function (response) {
					console.log(response.data);
					_this.$data.cur_did_name = response.data.d_name;
					
					_this.$data.drawer = true;
			    })
			    .catch(function (error) {
			      console.log(error);
			    });
				
				this.$data.usetime_t_data=[];
				let obj = {
					department_name : "生产部",
					usetime_h : row.d1_ut,
					task_in_time : row.d1_bt,
					task_out_time : row.d1_et,
				};
				
				this.$data.usetime_t_data.push(obj);
				
				obj = {
					department_name : "供应链",
					usetime_h : row.d3_ut,
					task_in_time : row.d3_bt,
					task_out_time : row.d3_et,
				};
				
				this.$data.usetime_t_data.push(obj);
				
				obj = {
					department_name : "交付",
					usetime_h : row.d4_ut,
					task_in_time : row.d4_bt,
					task_out_time : row.d4_et,
				};
				
				this.$data.usetime_t_data.push(obj);
				
				
				obj = {
					department_name : "研发",
					usetime_h : row.d5_ut,
					task_in_time : row.d5_bt,
					task_out_time : row.d5_et,
				};
				
				this.$data.usetime_t_data.push(obj);
				
				obj = {
					department_name : "保温瓶",
					usetime_h : row.d6_ut,
					task_in_time : row.d6_bt,
					task_out_time : row.d6_et,
				};
				
				this.$data.usetime_t_data.push(obj);
				
				obj = {
					department_name : "技术",
					usetime_h : row.d7_ut,
					task_in_time : row.d7_bt,
					task_out_time : row.d7_et,
				};
				
				this.$data.usetime_t_data.push(obj);
		},
		handleClose(done) {
			done();
		},
	  
		getkpi(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('/pkpi/getkpi', {
				opuser:localStorage.getItem("online_user"),
				opuser_uuid:localStorage.getItem("uuid"),
				index: this.$data.currentPage,
				count: this.$data.pagesize,
				id:this.$data.id_v,
				sap_id:this.$data.sapid_v,
				pid:this.$data.pid_v,
				pname:this.$data.pname_v,
				bt:this.$data.value1,
				et:this.$data.value2,
				if_checked:this.$data.checked,
				group_name:this.$data.group_name_v,
				plan_state:this.$data.plan_state_v,
				if_del:this.$data.if_del,
				promise_date:this.$data.search_promise_date,
				conveyer:this.$data.conveyer_v,
				rdm_id:this.$data.rdm_v,
				product_user:this.$data.product_user_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('/pkpi/getkpi', {
			 	opuser:localStorage.getItem("online_user"),
			 	opuser_uuid:localStorage.getItem("uuid"),
				index: this.$data.currentPage,
				count: this.$data.pagesize,
				id:this.$data.id_v,
				sap_id:this.$data.sapid_v,
				pid:this.$data.pid_v,
				pname:this.$data.pname_v,
				puser:this.$data.puser_v,
				bt:this.$data.value1,
				et:this.$data.value2,
				if_checked:this.$data.checked,
				group_name:this.$data.group_name_v,
				plan_state:this.$data.plan_state_v,
				if_del:this.$data.if_del,
				promise_date:this.$data.search_promise_date,
				conveyer:this.$data.conveyer_v,
				rdm_id:this.$data.rdm_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('/pkpi/getkpi', {
		 	opuser:localStorage.getItem("online_user"),
		 	opuser_uuid:localStorage.getItem("uuid"),
			index: this.$data.currentPage,
			count: this.$data.pagesize,
			id:this.$data.id_v,
			sap_id:this.$data.sapid_v,
			pid:this.$data.pid_v,
			pname:this.$data.pname_v,
			puser:this.$data.puser_v,
			bt:this.$data.value1,
			et:this.$data.value2,
			if_checked:this.$data.checked,
			group_name:this.$data.group_name_v,
			plan_state:this.$data.plan_state_v,
			if_del:this.$data.if_del,
			promise_date:this.$data.search_promise_date,
			conveyer:this.$data.conveyer_v,
			rdm_id:this.$data.rdm_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);
				});
		},
		
	  }
	}
			