Compare commits

...

5 Commits

14 changed files with 785 additions and 723 deletions

View File

@ -83,7 +83,6 @@ public class FinishingController {
@GetMapping("segregate-inventory")
public String segregateFinishedItems(Model model) {
model.addAttribute("accounts", inventoryAccountService.findInventoryAccountsForFinishedItems() );
model.addAttribute("wrapper", new FinishedItemWrapper());
return "/finishing/segregate-inventory";
}
@ -94,7 +93,7 @@ public class FinishingController {
RedirectAttributes redirectAttributes,
Model model) {
try {
inventoryService.segregateFinishedItems( wrapper );
inventoryService.segregateFinishedItems(wrapper, wrapper.getQaStatus());
redirectAttributes.addFlashAttribute("success", "Items Successfully saved !");
} catch (Exception e) {
redirectAttributes.addFlashAttribute("error", e.getMessage());

View File

@ -87,7 +87,7 @@ public class QualityControlController {
public String postFinishedItemsAfterQc(@ModelAttribute StitchedItemWrapper wrapper,
RedirectAttributes redirectAttributes) {
try {
inventoryService.createFinishedItemsAgainstStitchedItems( wrapper );
inventoryService.createFinishedItemsAgainstStitchedItems(wrapper, wrapper.getQaStatus());
redirectAttributes.addFlashAttribute("success", " Finished Items Are Generated Against Stitched Items");
} catch (Exception ex) {
redirectAttributes.addFlashAttribute("error", ex.getMessage());

View File

@ -29,9 +29,9 @@ public class FinishedItemDAO {
private final String SELECT_BY_LIMIT = String.format("SELECT * FROM %s ORDER BY id DESC LIMIT :limit", TABLE_NAME);
private final String SELECT_BY_IDS = String.format("SELECT * FROM %s WHERE id IN (:ids)", TABLE_NAME);
private final String FIND_TOTAL_COUNT = String.format("SELECT COUNT(*) FROM %s where job_card_id = :job_card_id And item_id = :item_id", TABLE_NAME);
private final String SELECT_BY_TERM = String.format( "SELECT * FROM %s WHERE barcode LIKE :term AND is_segregated = :is_segregated ORDER BY ID DESC", TABLE_NAME );
private final String SELECT_BY_TERM = String.format("SELECT * FROM %s WHERE barcode LIKE :term AND is_qa = :is_qa AND is_packed = FALSE ORDER BY ID DESC", TABLE_NAME);
private final String SELECT_BY_TERM_FOR_PACKAGING = String.format("SELECT * FROM %s WHERE barcode LIKE :term AND is_segregated = :is_segregated AND qa_status = 'APPROVED' AND is_packed = FALSE ORDER BY ID DESC", TABLE_NAME);
private final String SELECT_BY_STITCHED_ITEM_ID = String.format( "SELECT * FROM %s WHERE stitched_item_id = :stitched_item_id", TABLE_NAME );
private final String SELECT_BY_STITCHED_ITEM_ID = String.format("SELECT * FROM %s WHERE stitched_item_id = :stitched_item_id AND is_packed = FALSE", TABLE_NAME);
private final String SELECT_BY_STITCHED_ITEM_IDS = String.format("SELECT * FROM %s WHERE stitched_item_id IN (:stitched_item_ids)", TABLE_NAME);
private final String COUNT_TOTAL_FINISH_ITEM = String.format("SELECT COUNT(*) FROM %s WHERE job_card_id = :job_card_id AND is_segregated IS TRUE ", TABLE_NAME);
private final String SELECT_BY_JOB_CARD_AND_DATE = String.format("SELECT * FROM %s WHERE job_card_id = :job_card_id AND (:start_date IS NULL OR :end_date IS NULL OR created_at BETWEEN :start_date AND :end_date)", TABLE_NAME);
@ -115,10 +115,10 @@ public class FinishedItemDAO {
return namedParameterJdbcTemplate.query(SELECT_BY_IDS, params, new FinishedItemRowMapper());
}
public List<FinishedItem> findByTerm( String term , boolean isSegregated ){
public List<FinishedItem> findByTerm(String term, boolean isQa) {
MapSqlParameterSource params = new MapSqlParameterSource();
params.addValue("term", "%" + term + "%");
params.addValue("is_segregated", isSegregated );
params.addValue("is_qa", isQa);
return namedParameterJdbcTemplate.query(SELECT_BY_TERM, params, new FinishedItemRowMapper());
}

View File

@ -4,6 +4,8 @@ import java.util.List;
public class FinishedItemWrapper {
private String qaStatus;
private List<FinishedItem> items;
public List<FinishedItem> getItems() {
@ -14,6 +16,14 @@ public class FinishedItemWrapper {
this.items = items;
}
public String getQaStatus() {
return qaStatus;
}
public void setQaStatus(String qaStatus) {
this.qaStatus = qaStatus;
}
@Override
public String toString() {
return "FinishedItemWrapper{" +

View File

@ -1,12 +1,20 @@
package com.utopiaindustries.model.ctp;
import java.util.*;
public class StitchedItemWrapper {
private String qaStatus;
private List<StitchingOfflineItem> items;
private Long finishedAccountId;
public String getQaStatus() {
return qaStatus;
}
public void setQaStatus(String qaStatus) {
this.qaStatus = qaStatus;
}
public List<StitchingOfflineItem> getItems() {
return items;

View File

@ -22,8 +22,9 @@ public class FinishedItemRestController {
@GetMapping("/search")
public List<FinishedItem> searchFinishedItems(@RequestParam("term") String term,
@RequestParam("is-segregated") boolean isSegregated) {
return finishedItemDAO.findByTerm( term, isSegregated );
return finishedItemDAO.findByTerm(term, true);
}
@GetMapping("/search-packaging")
public List<FinishedItem> searchFinishedItemsForPackaging(@RequestParam("term") String term,
@RequestParam("is-segregated") boolean isSegregated) {

View File

@ -464,13 +464,14 @@ public class InventoryService {
* generate finished items against stitched items
* */
@Transactional(rollbackFor = Exception.class)
public void createFinishedItemsAgainstStitchedItems( StitchedItemWrapper wrapper ) {
public void createFinishedItemsAgainstStitchedItems(StitchedItemWrapper wrapper, String qaStatus) {
if (wrapper.getItems() != null && wrapper.getFinishedAccountId() != 0) {
Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
List<StitchingOfflineItem> stitchingOfflineItems = wrapper.getItems();
List<StitchingOfflineItem> updatedStitchedItems = new ArrayList<>();
List<FinishedItem> finishedItems = new ArrayList<>();
List<FinishedItem> finishedItemsForUlter = new ArrayList<>();
List<Long> stitchedItemIds = stitchingOfflineItems.stream()
.map(StitchingOfflineItem::getId)
@ -495,7 +496,7 @@ public class InventoryService {
// generate FI for SI
for (StitchingOfflineItem stitchingOfflineItem : stitchingOfflineItems) {
if ( stitchingOfflineItem.getQaStatus( ).equalsIgnoreCase( "APPROVED" )) {
if (qaStatus.equalsIgnoreCase("APPROVED")) {
// check finished item is already created
FinishedItem preCreatedItem = finishedItemDAO.findByStitchedItem(stitchingOfflineItem.getId());
if (preCreatedItem == null) {
@ -507,7 +508,7 @@ public class InventoryService {
finishedItem.setCreatedAt(LocalDateTime.now());
finishedItem.setStitchedItemId(stitchingOfflineItem.getId());
finishedItem.setJobCardId(stitchingOfflineItem.getJobCardId());
finishedItem.setIsQa( false);
finishedItem.setIsQa(true);
finishedItem.setId(finishedItemDAO.save(finishedItem));
finishedItems.add(finishedItem);
InventoryTransactionLeg lastInvTransaction = lastStitchedIdInTransactionMap.getOrDefault(stitchingOfflineItem.getId(), null);
@ -518,6 +519,8 @@ public class InventoryService {
}
// update stitched item
stitchingOfflineItem.setIsQa(true);
stitchingOfflineItem.setQaStatus(qaStatus);
updatedStitchedItems.add(stitchingOfflineItem);
// if FI is already created
} else {
// create OUT from stitching account Finished Item
@ -527,17 +530,27 @@ public class InventoryService {
long fromAccount = lastInvTransaction.getAccountId();
createInventoryTransactionLeg(transaction, stitchingOfflineItem, fromAccount, InventoryTransactionLeg.Type.OUT.name(), InventoryArtifactType.FINISHED_ITEM.name());
}
preCreatedItem.setIsQa(true);
finishedItemsForUlter.add(preCreatedItem);
// create IN in finishing Account Finished Item
finishedItems.add(preCreatedItem);
}
} else {
FinishedItem preCreatedItem = finishedItemDAO.findByStitchedItem(stitchingOfflineItem.getId());
preCreatedItem.setIsQa(false);
finishedItemsForUlter.add(preCreatedItem);
}
stitchingOfflineItem.setIsQa(true);
stitchingOfflineItem.setQaStatus(qaStatus);
updatedStitchedItems.add(stitchingOfflineItem);
}
for (FinishedItem finishedItem : finishedItems) {
// IN
createInventoryTransactionLeg(transaction, finishedItem, wrapper.getFinishedAccountId(), InventoryTransactionLeg.Type.IN.name(), InventoryArtifactType.FINISHED_ITEM.name());
}
// save updated stitched items
stitchingOfflineItemDAO.saveAll( wrapper.getItems( ));
finishedItemDAO.saveAll(finishedItemsForUlter);
stitchingOfflineItemDAO.saveAll(updatedStitchedItems);
}
}
@ -546,7 +559,7 @@ public class InventoryService {
* segregate finish items
* */
@Transactional(rollbackFor = Exception.class, propagation = Propagation.NESTED)
public void segregateFinishedItems( FinishedItemWrapper wrapper) {
public void segregateFinishedItems(FinishedItemWrapper wrapper, String status) {
if (wrapper != null && wrapper.getItems() != null) {
List<FinishedItem> items = wrapper.getItems();
@ -573,19 +586,15 @@ public class InventoryService {
// create transaction
InventoryTransaction transaction = createInventoryTransaction("Against Segregation of Finished Items");
// create IN and OUT for all approved items
for (FinishedItem finishedItem : items) {
InventoryTransactionLeg lastInvTransaction = lastFinishedItemIdInTransactionMap.getOrDefault(finishedItem.getId(), null);
finishedItem.setIsQa(true);
/*
* item is not approved and washed is selected then item remain in Finishing account
* */
/*
* item is approved and alter is selected then finished item will to stitching account
* */
if ( finishedItem.getQaStatus( ).equalsIgnoreCase( "ALTER")) {
if (status.equalsIgnoreCase("ALTER")) {
// create OUT and IN transactions for FI
if (lastInvTransaction != null) {
// OUT
@ -595,14 +604,43 @@ public class InventoryService {
// get the stitching account id
long stitchedItemId = finishedItem.getStitchedItemId();
InventoryTransactionLeg lastOutTransaction = lastStitchedItemOutTransactionMap.getOrDefault(stitchedItemId, null);
createInventoryTransactionLeg( transaction, finishedItem, lastOutTransaction.getAccountId( ), InventoryTransactionLeg.Type.IN.name( ), InventoryArtifactType.FINISHED_ITEM.name( ));
createInventoryTransactionLeg(transaction, finishedItem, lastOutTransaction.getAccountId(), InventoryTransactionLeg.Type.IN.name(), InventoryArtifactType.STITCHING_OFFLINE.name());
finishedItem.setQaStatus("ALTER");
finishedItem.setIsSegregated(false);
}
}
/*
* item is not approved and washed is selected then item remain in Finishing account
* */
if (status.equalsIgnoreCase("WASHED")) {
finishedItem.setIsSegregated(false);
finishedItem.setQaStatus("WASHED");
}
/*
* item is not approved and B grade is selected then item remain in Finishing account because after
* alteration item will be moved to A grade account for segregation
* */
if (status.equalsIgnoreCase("B GRADE")) {
finishedItem.setIsSegregated(false);
finishedItem.setQaStatus("B GRADE");
}
/*
* item is not approved and C grade is selected then item remain in Finishing account because after
* alteration item will be moved to A grade account for segregation
* */
if (status.equalsIgnoreCase("C GRADE")) {
finishedItem.setIsSegregated(false);
finishedItem.setQaStatus("C GRADE");
}
/*
* item is approved and grade is selected then fI is move to grade account
*/
if ( finishedItem.getQaStatus( ).equalsIgnoreCase( "APPROVED") && finishedItem.getAccountId( ) != 0) {
if (status.equalsIgnoreCase("APPROVED")) {
finishedItem.setQaStatus("APPROVED");
finishedItem.setIsSegregated(true);
}
updatedItems.add(finishedItem);
@ -668,7 +706,6 @@ public class InventoryService {
}
/*
* find item summary by account
* */

View File

@ -213,31 +213,27 @@ public class ReportingService {
return new HashMap<>();
}else {
HashMap<String,Integer> gradingItems = new HashMap<>();
List<InventoryAccount> inventoryAccounts = inventoryAccountDAO.getPackagingAccounts();
List<FinishedItem> finishedItems = finishedItemDAO.findByJobCardId(Long.parseLong(jobCardID));
List<PackagingItems> packagingItems = packagingItemsDAO.findByJobCardId(Long.parseLong(jobCardID));
List<Long> finishItemsIds = finishedItems.stream()
.map(FinishedItem::getId).collect(Collectors.toList());
List<FinishedItem> bGradeFinishItemsIds= finishedItems.stream()
.filter(item -> "B GRADE".equals(item.getQaStatus())).collect(Collectors.toList());
List<Long> packagingItemsIds = packagingItems.stream()
.map(PackagingItems::getId).collect(Collectors.toList());
List<FinishedItem> cGradeFinishItemsIds= finishedItems.stream()
.filter(item -> "C GRADE".equals(item.getQaStatus())).collect(Collectors.toList());
if (finishItemsIds.isEmpty()){
List<FinishedItem> aGradeFinishItemsIds= finishedItems.stream()
.filter(item -> "APPROVED".equals(item.getQaStatus())).collect(Collectors.toList());
if (finishedItems.isEmpty()){
gradingItems.put("A GRADE",0);
gradingItems.put("B GRADE",0);
gradingItems.put("C GRADE",0);
return gradingItems;
}else {
for (InventoryAccount inventoryAccount : inventoryAccounts){
if (inventoryAccount.getIsPackaging()){
long totalGradingItems = inventoryTransactionLegDAO.CalculateTotalGradingItems(packagingItemsIds,(int) inventoryAccount.getId());
gradingItems.put(inventoryAccount.getTitle(), (int) totalGradingItems);
}else {
long totalGradingItems = inventoryTransactionLegDAO.CalculateTotalGradingItems(finishItemsIds,(int) inventoryAccount.getId());
gradingItems.put(inventoryAccount.getTitle(), (int) totalGradingItems);
}
}
gradingItems.put("B GRADE",bGradeFinishItemsIds.size());
gradingItems.put("C GRADE",cGradeFinishItemsIds.size());
gradingItems.put("A GRADE",aGradeFinishItemsIds.size());
return gradingItems;
}
}
@ -386,11 +382,6 @@ public class ReportingService {
}
List<InventoryAccount> inventoryAccounts = inventoryAccountDAO.findByParentEntityTypeAndParentId("PROCESS",6L);
List<JobCardItem> jobCardItems = jobCardItemDAO.findByCardId(Long.parseLong(jobCardID));
BigDecimal actualProduction = jobCardItems.stream()
.map(item -> Optional.ofNullable(item.getActualProduction()).orElse(BigDecimal.ZERO))
.reduce(BigDecimal.ZERO, BigDecimal::add);
LocalDateTime startDate = jobCardDAO.find(Long.parseLong(jobCardID)).getCreatedAt();
HashMap<String, List<?>> barChartData = new HashMap<>();
@ -437,15 +428,9 @@ public class ReportingService {
stitchingList.set(index, stitchingList.get(index) + leg.getQuantity().intValue());
}
else if ("FINISHED_ITEM".equals(leg.getParentDocumentType()) && (leg.getAccountId().equals(7) || leg.getAccountId().equals(12))) {
if (index == 0 || !dateIndexMap.containsKey(dateKey)) {
qualityList.set(index, 0);
}
qualityList.set(index, qualityList.get(index) + leg.getQuantity().intValue());
}
else if ("PACKAGING".equals(leg.getParentDocumentType()) && inventoryAccounts.stream().anyMatch(e -> e.getId() == leg.getAccountId().longValue())) {
if (index == 0 || !dateIndexMap.containsKey(dateKey)) {
finishItems.set(index, 0);
}
finishItems.set(index, finishItems.get(index) + leg.getQuantity().intValue());
}
}

View File

@ -1,5 +1,4 @@
(async function () {
Vue.prototype.$accounts = window.ctp.accounts;
Vue.component('finished-item-table', {
@ -27,23 +26,22 @@
<th>Job Card ID</th>
<th>Barcode</th>
<th>Status</th>
<th>Account</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<tr v-for="(item,index) in items">
<td>
<input hidden="hidden" v-bind:name="'items[' + index + '].id'" v-bind:value="item.id">
<input hidden="hidden" v-bind:name="'items[' + index + '].itemId'" v-bind:value="item.itemId">
<input hidden="hidden" v-bind:name="'items[' + index + '].sku'" v-bind:value="item.sku">
<input hidden="hidden" v-bind:name="'items[' + index + '].createdBy'" v-bind:value="item.createdBy">
<input hidden="hidden" v-bind:name="'items[' + index + '].createdAt'" v-bind:value="getFormattedDateTime(item.createdAt)">
<input hidden="hidden" v-bind:name="'items[' + index + '].jobCardId'" v-bind:value="item.jobCardId">
<input hidden="hidden" v-bind:name="'items[' + index + '].barcode'" v-bind:value="item.barcode" >
<input hidden="hidden" v-bind:name="'items[' + index + '].isQa'" v-bind:value="item.isQa">
<input hidden="hidden" v-bind:name="'items[' + index + '].stitchedItemId'" v-bind:value="item.stitchedItemId">
<input hidden="hidden" v-bind:name="'items[' + index + '].isSegregated'" v-bind:value="item.isSegregated">
<input type="hidden" v-bind:name="'items[' + index + '].id'" v-bind:value="item.id">
<input type="hidden" v-bind:name="'items[' + index + '].itemId'" v-bind:value="item.itemId">
<input type="hidden" v-bind:name="'items[' + index + '].sku'" v-bind:value="item.sku">
<input type="hidden" v-bind:name="'items[' + index + '].createdBy'" v-bind:value="item.createdBy">
<input type="hidden" v-bind:name="'items[' + index + '].createdAt'" v-bind:value="getFormattedDateTime(item.createdAt)">
<input type="hidden" v-bind:name="'items[' + index + '].jobCardId'" v-bind:value="item.jobCardId">
<input type="hidden" v-bind:name="'items[' + index + '].barcode'" v-bind:value="item.barcode">
<input type="hidden" v-bind:name="'items[' + index + '].isQa'" v-bind:value="item.isQa">
<input type="hidden" v-bind:name="'items[' + index + '].stitchedItemId'" v-bind:value="item.stitchedItemId">
<input type="hidden" v-bind:name="'items[' + index + '].isSegregated'" v-bind:value="item.isSegregated">
<span> {{item.id}} </span>
</td>
<td> {{item.itemId}} </td>
@ -53,40 +51,26 @@
<td> {{item.jobCardId}} </td>
<td> {{item.barcode}} </td>
<td>
<select class="w-100" required v-bind:name="'items[' + index + '].qaStatus'" v-model="item.qaStatus">
<option value="WASHED">WASHED</option>
<option value="ALTER">ALTER</option>
<option value="APPROVED">APPROVED</option>
</select><br>
<!-- <textarea class="w-100 mt-1" rows="2" v-model="item.qaRemarks" -->
<!-- v-if="item.accountId === '0'" -->
<!-- v-bind:name="'items[' + index + '].qaRemarks'"></textarea> -->
</td>
<span v-if="!item.qaStatus" class="badge badge-danger">NOT PERFORMED</span>
<span v-else-if="item.qaStatus === 'APPROVED'" class="font-lg badge badge-success">{{ item.qaStatus }}</span>
<span v-else-if="item.qaStatus === 'ALTER' || item.qaStatus === 'B GRADE' || item.qaStatus === 'C GRADE' " class="font-lg badge badge-danger">{{ item.qaStatus }}</span>
<span v-else-if="item.qaStatus === 'WASHED'" class="font-lg badge badge-APPROVED">{{ item.qaStatus }}</span>
<td>
<select class="w-100" required v-bind:name="'items[' + index + '].accountId'"
v-model="item.accountId"
v-bind:disabled="item.qaStatus !== 'APPROVED'"
v-bind:required="item.qaStatus === 'APPROVED'">
<option v-for="(option,index) in $accounts"
v-bind:value="option.id">{{option.title}}</option>
</select>
</td>
<td>
<button type="button" title="Remove" class="btn btn-light text-left" v-on:click="removeItem(index)">
<button type="button" class="btn btn-light" v-on:click="removeItem(index)">
<i class="bi bi-trash"></i>
</button>
</td>
</tr>
</tbody>
</table>
`,
})
`
});
let app = new Vue({
el: '#finishedApp',
data: {
items : []
items: [],
QaStatus: 'APPROVED'
},
methods: {
onItemSelect: function (id, item) {
@ -100,10 +84,15 @@
const uniqueIds = new Set(ids);
return ids.length !== uniqueIds.size;
},
submitWithQaStatus: function (status) {
this.QaStatus = status;
this.$nextTick(() => {
document.getElementById('finishedApp').submit();
});
}
},
mounted: function () {
console.log( this.$accounts )
console.log(this.$accounts);
}
})
})(jQuery)
});
})(jQuery);

View File

@ -53,7 +53,13 @@
<td> {{ getFormattedDateTime( item.createdAt) }} </td>
<td> {{item.jobCardId}}</td>
<td> {{item.barcode}} </td>
<td > {{item.qaStatus}} </td>
<td >
<span v-if="!item.qaStatus" class="badge badge-danger">NOT PERFORMED</span>
<span v-else-if="item.qaStatus === 'APPROVED'" class="font-lg badge badge-success">{{ item.qaStatus }}</span>
<span v-else-if="item.qaStatus === 'ALTER' || item.qaStatus === 'B GRADE'" class="font-lg badge badge-danger">{{ item.qaStatus }}</span>
<span v-else-if="item.qaStatus === 'WASHED'" class="font-lg badge badge-APPROVED">{{ item.qaStatus }}</span>
</td>
<td>
<button type="button" title="Remove" class="btn btn-light text-left" v-on:click="removeItem(index)">
<i class="bi bi-trash"></i>

View File

@ -50,11 +50,9 @@
<td> {{item.jobCardId}}</td>
<td> {{item.barcode}} </td>
<td>
<select class="w-100" required v-bind:name="'items[' + index + '].qaStatus'" v-model="item.qaStatus">
<option value="APPROVED">APPROVED</option>
<option value="REJECT">REJECT</option>
</select><br>
<textarea class="w-100 mt-1" rows="2" v-model="item.remarks" v-if="item.qaStatus === 'REJECT'" v-bind:name="'items[' + index + '].qaRemarks'"></textarea>
<span v-if="!item.qaStatus" class="badge badge-danger">NOT PERFORMED</span>
<span v-else-if="item.qaStatus === 'APPROVED'" class="font-lg badge badge-success">{{ item.qaStatus }}</span>
<span v-else-if="item.qaStatus === 'REJECT'" class="font-lg badge badge-danger">{{ item.qaStatus }}</span>
</td>
<td>
<button type="button" title="Remove" class="btn btn-light text-left" v-on:click="removeItem(index)">
@ -72,6 +70,7 @@
el: '#qcForm',
data: {
items: [],
QaStatus: 'APPROVED'
},
methods: {
onItemSelect: function (id, item) {
@ -86,6 +85,12 @@
const uniqueIds = new Set(ids);
return ids.length !== uniqueIds.size;
},
submitWithQaStatus: function (status) {
this.QaStatus = status;
this.$nextTick(() => {
document.getElementById('qcForm').submit();
});
}
},
mounted: function () {

View File

@ -28,7 +28,9 @@
<!-- th:text="${account.title}"></option>-->
<!-- </select>-->
</div>
</div>
<input type="hidden" name="qaStatus" v-model="QaStatus">
</div>
<div class="bg-light p-3 mb-3">
<h6 class="mb-3">Finished Items</h6>
@ -38,7 +40,21 @@
></finished-item-table>
</div>
<div class="alert alert-danger" v-if="hasDuplicates()">Duplicate Item Selected</div>
<button class="btn btn-primary" type="submit" v-bind:disabled="hasDuplicates()">Submit</button>
<button class="btn btn-primary mr-2" type="button" :disabled="hasDuplicates() || items.length === 0"
@click="submitWithQaStatus('APPROVED')">APPROVED
</button>
<button class="btn btn-danger mr-2" type="button" :disabled="hasDuplicates() || items.length === 0"
@click="submitWithQaStatus('ALTER')">ALTER
</button>
<button class="btn btn-danger mr-2" type="button" :disabled="hasDuplicates() || items.length === 0"
@click="submitWithQaStatus('B GRADE')">B GRADE
</button>
<button class="btn btn-danger mr-2" type="button" :disabled="hasDuplicates() || items.length === 0"
@click="submitWithQaStatus('C GRADE')">C GRADE
</button>
<button class="btn btn-success mr-2" type="button" :disabled="hasDuplicates() || items.length === 0"
@click="submitWithQaStatus('WASHED')">WASHED
</button>
<a th:href="@{/finishing/finished-items}" class="btn btn-light">Cancel</a>
</form>
<script th:inline="javascript">

View File

@ -21,6 +21,7 @@
v-on:finished-item-select="onItemSelect">
</search-item>
</div>
<input type="hidden" name="qaStatus" v-model="QaStatus">
<div class="col-sm-3 form-group">
<label>Finishing Account</label>
<select class="form-control" name="account-id" th:field="*{finishedAccountId}" required>
@ -40,7 +41,12 @@
</stitched-item-table>
</div>
<div class="alert alert-danger" v-if="hasDuplicates()">Duplicate Item Selected</div>
<button class="btn btn-primary" type="submit" v-bind:disabled="hasDuplicates()">Submit</button>
<button class="btn btn-primary mr-2" type="button" :disabled="hasDuplicates() || items.length === 0"
@click="submitWithQaStatus('APPROVED')">APPROVED
</button>
<button class="btn btn-danger mr-2" type="button" :disabled="hasDuplicates() || items.length === 0"
@click="submitWithQaStatus('REJECT')">REJECT
</button>
<a th:href="@{/quality-control/qc-finished-items}" class="btn btn-light">Cancel</a>
</form>
<script th:inline="javascript">