app_mbo.objectivesSetting.html 14.6 KB
Newer Older
Thitichaipun Wutthisak committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264
<div id="objective_setting">
	<fieldset ng-disabled="(state >= 2 || ( state > 0 && isAppraisee )) || dateNow > TapsstateList[0].dateend">
	<form name="myForm">
		<br/>
		<div class="row">
			<div class="col-md-1" style="border:1px solid black;">Name</div>
			<div class="col-md-4" style="border:1px solid black;">{{ aprraisee_data.fullname }}</div>
			<div class="col-md-2 col-md-offset-1" style="border:1px solid black;">Dep. & Title</div>
			<div class="col-md-4" style="border:1px solid black;">{{ aprraisee_data.positionname }}</div>
		</div>
		<br/>
		<div class="row" ng-show="isApsyear2016">
			<div class="col-md-3" ><strong>1.0 Global basic condition:</strong></div>
			<div class="col-md-9" ><input type="text" style="width:100%;" ng-model="global_basic_condition" name="global_basic_condition" value="{{ global_basic_condition }}"/></div>
		</div>
		<br/>
		<div class="row">
			<div class="col-md-12" >
				<strong>{{ kpi_category_name[0].tdesc }}</strong>
				<strong style="float:right;">
					current:<span style="color:red;">{{ getCat(0).length }}</span>
					min:<span style="color:red;">{{ kpi_category_name[0].itemmin }}</span>
					max:<span style="color:red;">{{ kpi_category_name[0].itemmax }}</span> (row)
				</strong>
			</div>
		</div>
		<table class="table table-bordered" style="width: inherit;">
			<col width="3%" />
			<col width="15%" />
			<col width="15%" />
			<col width="7%" />
			<col width="18%" />
			<col width="18%" />
			<col width="24%" />
			<tr>
				<th class="bold-center bluehead"></th>
				<th class="bold-center bluehead">BU/Region<br>/Function</th>
				<th class="bold-center bluehead">OBJECTIVES</th>
				<th class="bold-center bluehead" style="min-width: 110px;">Weight </th>
				<th class="bold-center bluehead">Commitment</th>
				<th class="bold-center bluehead"><span ng-if="isApsyear2016">Target</span><span ng-if="!isApsyear2016">SST</span></th>
				<th class="bold-center bluehead"><span ng-if="isApsyear2016">ACTION</span><span ng-if="!isApsyear2016">Specific Action</span></th>
			</tr>
			<tr ng-repeat="item in getCat(0)" class="more-data-lg">
				<td><input ng-hide="item.isfix==1" type="checkbox" value="{{$index}}" ng-model="item.isChecked" /></td>
				<td><textarea ng-hide="item.isfix==1" class="text-md" ng-model="item.bu" ></textarea><span ng-show="item.isfix==1">{{ item.bu }}<span></td>
				<td><textarea ng-hide="item.isfix==1" class="text-md" ng-model="item.obj" ></textarea><span ng-show="item.isfix==1">{{ item.obj }}<span></td>
				<td ng-if="item.isfix!=1" style="text-align:center;">
					<md-input-container style="margin-left:10px;" class="md-block">
						<label></label>
						<input ng-model="item.weight" type="number" step="0.5" style="text-align:right;width:60px;">
						<!-- <input ng-hide="item.isfix==1" ng-model="item.weight" type="number" step="0.5" style="text-align:right;width:60px;">
						<span ng-show="item.isfix==1">{{ item.weight }}<span> -->
						<span>%</span>
					</md-input-container>
				</td>
				<td ng-if="item.isfix==1" class="bold-center">{{ item.weight }} %</td>
				<td><textarea class="text-md" ng-model="item.commitment" ></textarea></td>
				<td><textarea class="text-md" ng-model="item.target" ></textarea></td>
				<td><textarea class="text-md" ng-model="item.action" ></textarea></td>
			</tr>
			<tr>
				<td class="bold-center" style="border:0px;"></td>
				<td class="bold-center" style="border:0px;"></td>
				<td class="bold-center" style="border:0px;"></td>
				<td class="bold-center" style="border:0px;">
					<span style="color:red;">
						{{ sumWeight(0) }} / {{ kpi_category_name[0].kpiweight }}
					</span>
				</td>
				<td class="bold-center" style="border:0px;"></td>
				<td class="bold-center" style="border:0px;"></td>
				<td class="bold-center" style="border:0px;"></td>
			</tr>
		</table>
		<div class="row" ng-if="(state == 0 && isAppraisee) || (state < 2 && isAppraiser)">
			<div class="col-md-12" style="text-align:center;">
				<button type="button" class="btn btn-success" ng-show="(ObjectiveSetting | filter:{kpi_category:kpi_category_name[0].kcatid, isDelete:false}).length < kpi_category_name[0].itemmax" ng-click="addRow(kpi_category_name[0].kcatid)"><span ng-if="isApsyear2016">Add 1.1</span><span ng-if="!isApsyear2016">Add 1</span></button>
				<button type="button" class="btn btn-danger" ng-click="delRow(kpi_category_name[0].kcatid)"><span ng-if="isApsyear2016">Delete 1.1</span><span ng-if="!isApsyear2016">Delete 1</span></button>
			</div>
		</div>
		<div class="row">
			<div class="col-md-12" >
				<strong>{{ kpi_category_name[1].tdesc }}</strong>
				<strong ng-if="isApsyear2016" style="float:right;">
					current:<span style="color:red;">{{ getCat(1).length }}</span>
					min:<span style="color:red;">{{ kpi_category_name[1].itemmin }}</span>
					max:<span style="color:red;">{{ kpi_category_name[1].itemmax }}</span> (row)
				</strong>
				<strong ng-if="!isApsyear2016" style="float:right;">
					current:<span style="color:red;">{{ getCat(1).length+getCat(2).length }}</span>
					min:<span style="color:red;">{{ getFloat(kpi_category_name[1].itemmin)+getFloat(kpi_category_name[2].itemmin) }}</span>
					max:<span style="color:red;">{{ getFloat(kpi_category_name[1].itemmax)+getFloat(kpi_category_name[2].itemmax) }}</span> (row)
				</strong>
			</div>
		</div>
		<table class="table table-bordered" style="width: inherit;">
			<col width="3%" />
			<col width="15%" />
			<col width="15%" />
			<col width="7%" />
			<col width="18%" />
			<col width="18%" />
			<col width="24%" />
			<tr>
				<th class="bold-center bluehead"></th>
				<th class="bold-center bluehead">BU/Region<br>/Function</th>
				<th class="bold-center bluehead">OBJECTIVES</th>
				<th class="bold-center bluehead" style="min-width: 110px;">Weight</th>
				<th class="bold-center bluehead">Commitment</th>
				<th class="bold-center bluehead" ng-if="isApsyear2016">Target</th>
				<th class="bold-center bluehead" ng-if="isApsyear2016">ACTION</th>
				<th class="bold-center bluehead" ng-if="!isApsyear2016" colspan="2">Specific Action</th>
			</tr>
			<tr ng-repeat="item in getCat(1)" class="more-data-lg">
				<td><input ng-hide="item.isfix==1" type="checkbox" value="{{$index}}" ng-model="item.isChecked" /></td>
				<td><textarea ng-hide="item.isfix==1" class="text-md" ng-model="item.bu" ></textarea><span ng-show="item.isfix==1">{{ item.bu }}<span></td>
				<td><textarea ng-hide="item.isfix==1" class="text-md" ng-model="item.obj" ></textarea><span ng-show="item.isfix==1">{{ item.obj }}<span></td>
				<td style="text-align:center;">
					<md-input-container style="margin-left:10px;" class="md-block">
						<label></label>
						<input ng-model="item.weight" type="number" step="0.5" style="text-align:right;width:60px;">
						<!-- <input ng-hide="item.isfix==1" ng-model="item.weight" type="number" step="0.5" style="text-align:right;width:60px;">
						<span ng-show="item.isfix==1">{{ item.weight }}<span> -->
						<span>%</span>
					</md-input-container>
				</td>
				<td><textarea class="text-md" ng-model="item.commitment" ></textarea></td>
				<!-- <td><textarea class="text-md" ng-model="item.target" ></textarea></td>
				<td><textarea class="text-md" ng-model="item.action" ></textarea></td> -->
				<td ng-if="isApsyear2016"><textarea class="text-md" ng-model="item.target" ></textarea></td>
				<td ng-if="isApsyear2016"><textarea class="text-md" ng-model="item.action" ></textarea></td>
				<td ng-if="!isApsyear2016" colspan="2"><textarea class="text-md" ng-model="item.action" ></textarea></td>
			</tr>
			<tr ng-if="!isApsyear2016" ng-repeat="item in getCat(2)" class="more-data-lg">
				<td><input ng-hide="item.isfix==1" type="checkbox" value="{{$index}}" ng-model="item.isChecked" /></td>
				<td><textarea ng-hide="item.isfix==1" class="text-md" ng-model="item.bu" ></textarea><span ng-show="item.isfix==1">{{ item.bu }}<span></td>
				<td><textarea ng-hide="item.isfix==1" class="text-md" ng-model="item.obj" ></textarea><span ng-show="item.isfix==1">{{ item.obj }}<span></td>
				<td ng-if="item.isfix!=1" style="text-align:center;">
					<md-input-container style="margin-left:10px;" class="md-block">
						<label></label>
						<input ng-model="item.weight" type="number" step="0.5" style="text-align:right;width:60px;">
						<!-- <input ng-hide="item.isfix==1" ng-model="item.weight" type="number" step="0.5" style="text-align:right;width:60px;">
						<span ng-show="item.isfix==1">{{ item.weight }}<span> -->
						<span>%</span>
					</md-input-container>
				</td>
				<td ng-if="item.isfix==1" class="bold-center">{{ item.weight }} %</td>
				<td><textarea class="text-md" ng-model="item.commitment" ></textarea></td>
				<td ng-if="isApsyear2016"><textarea class="text-md" ng-model="item.target" ></textarea></td>
				<td ng-if="isApsyear2016"><textarea class="text-md" ng-model="item.action" ></textarea></td>
				<td ng-if="!isApsyear2016" colspan="2"><textarea class="text-md" ng-model="item.action" ></textarea></td>
			</tr>
			<tr>
				<td class="bold-center" style="border:0px;"></td>
				<td class="bold-center" style="border:0px;"></td>
				<td class="bold-center" style="border:0px;"></td>
				<td class="bold-center" style="border:0px;">
					<span ng-if="isApsyear2016" style="color:red;">
						{{ sumWeight(1) }} / {{ kpi_category_name[1].kpiweight }}
					</span>
					<span ng-if="!isApsyear2016" style="color:red;">
						{{ sum2Weight(1,2) }} / {{ (getFloat(kpi_category_name[1].kpiweight)+getFloat(kpi_category_name[2].kpiweight)).toFixed(2)  }}
					</span>
				</td>
				<td class="bold-center" style="border:0px;"></td>
				<td class="bold-center" style="border:0px;"></td>
				<td class="bold-center" style="border:0px;"></td>
			</tr>
		</table>
		<div class="row" ng-if="(state == 0 && isAppraisee) || (state < 2 && isAppraiser)">
			<div class="col-md-12" style="text-align:center;">
				<button type="button" class="btn btn-success" ng-show="(ObjectiveSetting | filter:{kpi_category:kpi_category_name[1].kcatid, isDelete:false}).length < kpi_category_name[1].itemmax" ng-click="addRow(kpi_category_name[1].kcatid)"><span ng-if="isApsyear2016">Add 1.2</span><span ng-if="!isApsyear2016">Add 2</span></button>
				<button type="button" class="btn btn-danger" ng-click="delRow( kpi_category_name[1].kcatid )"><span ng-if="isApsyear2016">Delete 1.2</span><span ng-if="!isApsyear2016">Delete 2</span></button>
			</div>
		</div>
		<div ng-if="isApsyear2016" class="row">
			<div class="col-md-12" >
				<strong>{{ kpi_category_name[2].tdesc }}</strong>
				<strong style="float:right;">
					current:<span style="color:red;">{{ getCat(2).length }}</span>
					min:<span style="color:red;">{{ kpi_category_name[2].itemmin }}</span>
					max:<span style="color:red;">{{ kpi_category_name[2].itemmax }}</span> (row)
				</strong>
			</div>
		</div>
		<table ng-if="isApsyear2016" class="table table-bordered" style="width: inherit;">
			<col width="3%" />
			<col width="15%" />
			<col width="15%" />
			<col width="7%" />
			<col width="18%" />
			<col width="18%" />
			<col width="24%" />
			<tr>
				<th class="bold-center bluehead"></th>
				<th class="bold-center bluehead">BU/Region<br>/Function</th>
				<th class="bold-center bluehead">OBJECTIVES</th>
				<th class="bold-center bluehead" style="min-width: 110px;">Weight</th>
				<th class="bold-center bluehead">Commitment</th>
				<th class="bold-center bluehead">Target</th>
				<th class="bold-center bluehead">ACTION</th>
			</tr>
			<tr ng-repeat="item in getCat(2)" class="more-data-lg">
				<td><input ng-hide="item.isfix==1" type="checkbox" value="{{$index}}" ng-model="item.isChecked" /></td>
				<td><textarea ng-hide="item.isfix==1" class="text-md" ng-model="item.bu" ></textarea><span ng-show="item.isfix==1">{{ item.bu }}<span></td>
				<td><textarea ng-hide="item.isfix==1" class="text-md" ng-model="item.obj" ></textarea><span ng-show="item.isfix==1">{{ item.obj }}<span></td>
				<td ng-if="item.isfix!=1" style="text-align:center;">
					<md-input-container style="margin-left:10px;" class="md-block">
						<label></label>
						<input ng-model="item.weight" type="number" step="0.5" style="text-align:right;width:60px;">
						<!-- <input ng-hide="item.isfix==1" ng-model="item.weight" type="number" step="0.5" style="text-align:right;width:60px;">
						<span ng-show="item.isfix==1">{{ item.weight }}<span> -->
						<span>%</span>
					</md-input-container>
				</td>
				<td ng-if="item.isfix==1" class="bold-center">{{ item.weight }} %</td>
				<td><textarea class="text-md" ng-model="item.commitment" ></textarea></td>
				<td><textarea class="text-md" ng-model="item.target" ></textarea></td>
				<td><textarea class="text-md" ng-model="item.action" ></textarea></td>
			</tr>
			<tr>
				<td class="bold-center" style="border:0px;"></td>
				<td class="bold-center" style="border:0px;"></td>
				<td class="bold-center" style="border:0px;"></td>
				<td class="bold-center" style="border:0px;">
					<span style="color:red;">
						{{ sumWeight(2) }} / {{ kpi_category_name[2].kpiweight }}
					</span>
				</td>
				<td class="bold-center" style="border:0px;"></td>
				<td class="bold-center" style="border:0px;"></td>
				<td class="bold-center" style="border:0px;"></td>
			</tr>
		</table>
		<div class="row" ng-if="isApsyear2016 && ((state == 0 && isAppraisee) || (state < 2 && isAppraiser))">
			<div class="col-md-12" style="text-align:center;">
				<button type="button" class="btn btn-success" ng-show="(ObjectiveSetting | filter:{kpi_category:kpi_category_name[2].kcatid, isDelete:false}).length < kpi_category_name[2].itemmax" ng-click="addRow(kpi_category_name[2].kcatid)"><span>Add 1.3</span></button>
				<button type="button" class="btn btn-danger" ng-click="delRow(kpi_category_name[2].kcatid)"><span>Delete 1.3</span></button>
			</div>
		</div>
		<div class="row">
			<div class="col-md-12" ><strong>Total</strong></div>
		</div>
		<table class="table table-bordered" style="width:50%;">
			<col width="70%" />
			<col width="30%" />
			<tr>
				<th class="bold-center bluehead" >Total</th>
				<th class="bold-center bluehead" >Weight</th>
			</tr>
			<tr class="more-data-sm">
				<td style="text-align:center;"><span ng-if="isApsyear2016">Total of 1.1, 1.2, and 1.3</span><span ng-if="!isApsyear2016">Total of 1 and 2</span></td>
				<td style="text-align:center;">{{ sum(ObjectiveSetting, 'weight')+'%' }}</td>
			</tr>
		</table>
		<br/>
		<div class="col-md-12" style="text-align:center;padding-bottom:50px;" ng-hide='Invalid'>
			<button type="button" class="btn btn-primary save-button" ng-if="(state == 0 && isAppraisee) || (state < 2 && isAppraiser)" ng-click="save()">Save Draft</button>
			<button type="button" class="btn btn-success save-button" ng-if="(state == 0 && isAppraisee)" ng-click="Next()">Send To Appraiser</button>
		</div>
	</form>
	</fieldset>
</div>