package ui

This commit is contained in:
glovetleong
2021-09-12 14:27:17 +08:00
parent 2d1ec679eb
commit 64f108163a
4 changed files with 152 additions and 2 deletions
@@ -72,7 +72,6 @@ class CreatePackageLogic extends AbstractControllerLogic
$request->input('height'),
$request->input('length'),
$request->input('weight'),
0,
$request->input('quantity'),
ApprovalStatus::PENDING_VERIFICATION);
@@ -0,0 +1,108 @@
<template>
<div class="row" @keyup.enter="submitForm">
<div class="col">
<div class="row m-b-20 text-info">
<div class="col">
<h3 class="text-left">Create Package</h3>
</div>
</div>
<error-message-component class="m-b-20" :error="error"></error-message-component>
<div class="row">
<div class="col">
<validation-wrapper-component class="m-b-15" :validator="$v.parameters.type">
<label class="text-primary">Type</label>
<select-component :options="[{'id': 0, 'text': 'Carton'}, {'id': 1, 'text': 'pallet'}]" v-model="parameters.type"></select-component>
<input type="text" class="form-control fs-12" v-model.trim="parameters.type">
</validation-wrapper-component>
<validation-wrapper-component class="m-b-15" :validator="$v.parameters.description">
<label class="text-primary">Description</label>
<input type="text" class="form-control fs-12" v-model.trim="parameters.description">
</validation-wrapper-component>
<validation-wrapper-component class="m-b-15" :validator="$v.parameters.width">
<label class="text-primary">Width</label>
<input type="text" class="form-control fs-12" v-model.trim="parameters.width">
</validation-wrapper-component>
<validation-wrapper-component class="m-b-15" :validator="$v.parameters.height">
<label class="text-primary">Height</label>
<input type="text" class="form-control fs-12" v-model.trim="parameters.height">
</validation-wrapper-component>
<validation-wrapper-component class="m-b-15" :validator="$v.parameters.length">
<label class="text-primary">Length</label>
<input type="text" class="form-control fs-12" v-model.trim="parameters.length">
</validation-wrapper-component>
<validation-wrapper-component class="m-b-15" :validator="$v.parameters.weight">
<label class="text-primary">Weight</label>
<input type="text" class="form-control fs-12" v-model.trim="parameters.weight">
</validation-wrapper-component>
<validation-wrapper-component class="m-b-15" :validator="$v.parameters.quantity">
<label class="text-primary">Quantity</label>
<input type="text" class="form-control fs-12" v-model.trim="parameters.quantity">
</validation-wrapper-component>
<validation-wrapper-component class="m-b-15" :validator="$v.parameters.reference">
<label class="text-primary">Reference</label>
<input type="text" class="form-control fs-12" v-model.trim="parameters.reference">
</validation-wrapper-component>
<div class="row m-t-15 align-items-center justify-content-center">
<div class="col">
<div class="btn btn-block btn-lg btn-primary b-rad-none no-border" @click="submitForm">Submit</div>
</div>
</div>
</div>
</div>
</div>
</div>
</template>
<script>
import createPackageFormValidation from '../../../general/mixins/orders/validation/createPackageFormValidation';
import componentHandler from '../../../general/mixins/componentHandler';
import modalFormHandler from '../../../general/mixins/modalFormHandler';
export default {
props: {
id: {
type: Number,
required: true
},
section:{
type: String,
required: true
}
},
data() {
return {
error: '',
parameters: {
order_id: this.id,
type: this.type,
description: this.description,
width: this.width,
height: this.height,
length: this.length,
weight: this.weight,
quantity: this.quantity,
reference: this.reference
}
};
},
watch: {
'id': function () {
this.parameters.order_id = this.id;
}
},
methods: {
submitForm(){
this.submit(this.route('api.packing_list.package.create'), 'post', this.section, true, true)
}
},
mixins: [createPackageFormValidation, componentHandler, modalFormHandler]
}
</script>
@@ -218,7 +218,7 @@
<div class="row no-margin">
<div class="col bg-master-lightest padding-30">
<div class="row tabsContainer tabContent active" tab-name="originWarehouse">
<div class="col-4">
<div class="col-5">
<div class="row">
<div class="col bg-complete-lighter p-b-10">
<div class="row align-item-center p-t-10 p-b-10">
@@ -232,6 +232,12 @@
viewBox="0 0 172 172"
style=" fill:#000000;"><g fill="none" fill-rule="nonzero" stroke="none" stroke-width="1" stroke-linecap="butt" stroke-linejoin="miter" stroke-miterlimit="10" stroke-dasharray="" stroke-dashoffset="0" font-family="none" font-weight="none" font-size="none" text-anchor="none" style="mix-blend-mode: normal"><path d="M0,172v-172h172v172z" fill="none"></path><g fill="#000000"><path d="M8.6,23.65c-2.37676,0 -4.3,1.92324 -4.3,4.3c0,2.37676 1.92324,4.3 4.3,4.3c2.37676,0 4.3,-1.92324 4.3,-4.3c4.77031,0 8.6,3.82969 8.6,8.6v85.10137c0,8.28926 6.76074,15.05 15.05,15.05h0.50391c0.99941,2.98145 3.72051,5.19863 7.02109,5.19863h4.43438c-0.74746,1.26816 -1.20938,2.72949 -1.20938,4.3c0,4.72832 3.87168,8.6 8.6,8.6c4.72832,0 8.6,-3.87168 8.6,-8.6c0,-1.57051 -0.46191,-3.03184 -1.20938,-4.3h66.91875c-0.74746,1.26816 -1.20937,2.72949 -1.20937,4.3c0,4.72832 3.87168,8.6 8.6,8.6c4.72832,0 8.6,-3.87168 8.6,-8.6c0,-1.57051 -0.46191,-3.03184 -1.20937,-4.3h4.43437c3.36777,0 6.13926,-2.30117 7.08828,-5.375h0.43672v-2.15c0,-3.90527 -3.04863,-7.12188 -6.87832,-7.45781c0.26035,-0.69707 0.42832,-1.43613 0.42832,-2.21719v-40.85c0,-1.67129 -0.73066,-3.14941 -1.78887,-4.3c1.0582,-1.15059 1.78887,-2.62871 1.78887,-4.3v-43c0,-3.53574 -2.91426,-6.45 -6.45,-6.45h-94.6c-3.53574,0 -6.45,2.91426 -6.45,6.45v43c0,1.67129 0.73066,3.14941 1.78887,4.3c-1.0582,1.15059 -1.78887,2.62871 -1.78887,4.3v40.85c0,0.78105 0.16797,1.52012 0.42832,2.21719c-3.15781,0.27715 -5.75293,2.51953 -6.57598,5.48418h-0.30234c-5.96289,0 -10.75,-4.78711 -10.75,-10.75v-85.10137c0,-7.09668 -5.80332,-12.9 -12.9,-12.9zM49.45,30.1h94.6c1.21777,0 2.15,0.93223 2.15,2.15v43c0,1.21777 -0.93223,2.15 -2.15,2.15c-1.17578,0.0168 -2.11641,0.97422 -2.11641,2.15c0,1.17578 0.94062,2.1332 2.11641,2.15c1.21777,0 2.15,0.93223 2.15,2.15v40.85c0,1.21777 -0.93223,2.15 -2.15,2.15h-94.6c-1.21777,0 -2.15,-0.93223 -2.15,-2.15v-40.85c0,-1.21777 0.93223,-2.15 2.15,-2.15c1.17578,-0.0168 2.11641,-0.97422 2.11641,-2.15c0,-1.17578 -0.94063,-2.1332 -2.11641,-2.15c-1.21777,0 -2.15,-0.93223 -2.15,-2.15v-43c0,-1.21777 0.93223,-2.15 2.15,-2.15zM88.15,38.7c-0.77266,-0.0084 -1.49492,0.39473 -1.88965,1.0666c-0.38633,0.67188 -0.38633,1.49492 0,2.1668c0.39473,0.67188 1.11699,1.075 1.88965,1.0666h17.2c0.77266,0.0084 1.49492,-0.39473 1.88965,-1.0666c0.38633,-0.67187 0.38633,-1.49492 0,-2.1668c-0.39472,-0.67187 -1.11699,-1.075 -1.88965,-1.0666zM58.05,77.4c-1.18418,0 -2.15,0.96582 -2.15,2.15c0,1.18418 0.96582,2.15 2.15,2.15c1.18418,0 2.15,-0.96582 2.15,-2.15c0,-1.18418 -0.96582,-2.15 -2.15,-2.15zM66.65,77.4c-1.18418,0 -2.15,0.96582 -2.15,2.15c0,1.18418 0.96582,2.15 2.15,2.15c1.18418,0 2.15,-0.96582 2.15,-2.15c0,-1.18418 -0.96582,-2.15 -2.15,-2.15zM75.25,77.4c-1.18418,0 -2.15,0.96582 -2.15,2.15c0,1.18418 0.96582,2.15 2.15,2.15c1.18418,0 2.15,-0.96582 2.15,-2.15c0,-1.18418 -0.96582,-2.15 -2.15,-2.15zM83.85,77.4c-1.18418,0 -2.15,0.96582 -2.15,2.15c0,1.18418 0.96582,2.15 2.15,2.15c1.18418,0 2.15,-0.96582 2.15,-2.15c0,-1.18418 -0.96582,-2.15 -2.15,-2.15zM92.45,77.4c-1.18418,0 -2.15,0.96582 -2.15,2.15c0,1.18418 0.96582,2.15 2.15,2.15c1.18418,0 2.15,-0.96582 2.15,-2.15c0,-1.18418 -0.96582,-2.15 -2.15,-2.15zM101.05,77.4c-1.18418,0 -2.15,0.96582 -2.15,2.15c0,1.18418 0.96582,2.15 2.15,2.15c1.18418,0 2.15,-0.96582 2.15,-2.15c0,-1.18418 -0.96582,-2.15 -2.15,-2.15zM109.65,77.4c-1.18418,0 -2.15,0.96582 -2.15,2.15c0,1.18418 0.96582,2.15 2.15,2.15c1.18418,0 2.15,-0.96582 2.15,-2.15c0,-1.18418 -0.96582,-2.15 -2.15,-2.15zM118.25,77.4c-1.18418,0 -2.15,0.96582 -2.15,2.15c0,1.18418 0.96582,2.15 2.15,2.15c1.18418,0 2.15,-0.96582 2.15,-2.15c0,-1.18418 -0.96582,-2.15 -2.15,-2.15zM126.85,77.4c-1.18418,0 -2.15,0.96582 -2.15,2.15c0,1.18418 0.96582,2.15 2.15,2.15c1.18418,0 2.15,-0.96582 2.15,-2.15c0,-1.18418 -0.96582,-2.15 -2.15,-2.15zM135.45,77.4c-1.18418,0 -2.15,0.96582 -2.15,2.15c0,1.18418 0.96582,2.15 2.15,2.15c1.18418,0 2.15,-0.96582 2.15,-2.15c0,-1.18418 -0.96582,-2.15 -2.15,-2.15zM88.15,90.3c-0.77266,-0.0084 -1.49492,0.39473 -1.88965,1.0666c-0.38633,0.67188 -0.38633,1.49492 0,2.1668c0.39473,0.67188 1.11699,1.075 1.88965,1.0666h17.2c0.77266,0.0084 1.49492,-0.39473 1.88965,-1.0666c0.38633,-0.67187 0.38633,-1.49492 0,-2.1668c-0.39472,-0.67187 -1.11699,-1.075 -1.88965,-1.0666zM44.075,131.15h105.35c1.80566,0 3.225,1.41934 3.225,3.225c0,1.80566 -1.41934,3.225 -3.225,3.225h-105.35c-1.80566,0 -3.225,-1.41934 -3.225,-3.225c0,-1.80566 1.41934,-3.225 3.225,-3.225zM55.9,141.9c2.40195,0 4.3,1.89805 4.3,4.3c0,2.40195 -1.89805,4.3 -4.3,4.3c-2.40195,0 -4.3,-1.89805 -4.3,-4.3c0,-2.40195 1.89805,-4.3 4.3,-4.3zM137.6,141.9c2.40195,0 4.3,1.89805 4.3,4.3c0,2.40195 -1.89805,4.3 -4.3,4.3c-2.40195,0 -4.3,-1.89805 -4.3,-4.3c0,-2.40195 1.89805,-4.3 4.3,-4.3z"></path></g></g></svg>
</div>
<div class="col-auto">
<div data-type="createPackage" class="btn btn-sm btn-block bg-white text-info b-rad-sm pointer requestModal">Add</div>
<modal-component class="animate__animated animate__fast animate__fadeIn" styleType="stick-up" type="createPackage" size="large">
<create-package-form-component :id="order.id" :section="section"></create-package-form-component>
</modal-component>
</div>
</div>
<div class="row">
<div class="col">
@@ -0,0 +1,37 @@
import { required, numeric } from "vuelidate/lib/validators";
export default {
validations: {
parameters: {
type: {
required
},
description: {
required
},
width: {
required,
numeric
},
height: {
required,
numeric
},
length: {
required,
numeric
},
weight: {
required,
numeric
},
quantity: {
required,
numeric
},
reference: {
required
}
}
},
}