update the createRemarkLogic, so all modules are able to use it

create a RemarkFormComponent
update order page to use this API
clean up old remark API
This commit is contained in:
edmondlang
2022-03-10 19:39:47 +08:00
parent 59ee063186
commit ced07a293e
14 changed files with 49 additions and 270 deletions
@@ -35,39 +35,25 @@
<div class="row">
<div class="col-auto d-flex align-items-center">
<h6 class="no-margin"><b>Remark:</b></h6>
<modal-component class="animate__animated animate__fast animate__fadeIn" type="orderRemark">
<remark-form-component module_type="Order" :data="order" :section="section"></remark-form-component>
</modal-component>
</div>
<div class="col-auto p-l-0" v-if="!addComment && order.remarks.length == 0">
<div class="btn btn-xs btn-outline-info b-rad-none pointer" @click="addComment = !addComment">Add a Remark</div>
<div class="col-auto p-l-0" v-if="order.remarks.length == 0">
<div class="btn btn-xs btn-outline-info b-rad-none pointer requestModal" data-type="orderRemark">Add a Remark</div>
</div>
<div class="col d-flex align-items-center pl-3 pl-md-0" v-if="order.remarks.length >= 1 && !isEditRemark">
<h6 class="no-margin">{{order.remarks[0].content}}</h6>
<span class="btn btn-md btn-default m-l-10" @click="isEditRemark = !isEditRemark">
<div class="col d-flex align-items-center pl-3 pl-md-0" v-if="order.remarks.length >= 1">
<h6 class="no-margin">{{ order.remarks[0].content }}</h6>
<span class="btn btn-md btn-default m-l-10 requestModal" data-type="orderRemark">
<i class="fa fa-edit"></i>
</span>
<span class="btn btn-md btn-default m-l-5 requestModal" data-type="deleteOrderRemark">
<i class="fa fa-trash"></i>
</span>
<modal-component class="animate__animated animate__fast animate__fadeIn" styleType="fill-in" type="deleteOrderRemark">
<delete-order-remark-form-component :section="section" :data="order.remarks[0]" v-on:submit="addComment=false"></delete-order-remark-form-component>
<modal-component class="animate__animated animate__fast animate__fadeIn" type="deleteOrderRemark">
<delete-remark-form-component :section="section" :data="order.remarks[0]"></delete-remark-form-component>
</modal-component>
</div>
<div class="col pl-2 pl-md-0" v-if="isEditRemark">
<div class="row">
<div class="col">
<order-remark-form-component :section="section" :data="order.remarks[0]" :id="order.id" v-on:submit="isEditRemark=false"></order-remark-form-component>
</div>
<div class="col-auto d-flex align-items-center">
<div class="row m-l-5">
<div class="col b-a btn btn-sm btn-default" @click="isEditRemark = !isEditRemark">
Cancel
</div>
</div>
</div>
</div>
</div>
<div class="col p-l-0" v-if="order.remarks.length === 0 && addComment">
<order-remark-form-component :section="section" :id="order.id"></order-remark-form-component>
</div>
</div>
</div>
</div>
@@ -465,7 +451,6 @@
section: 'orderProfileSection',
isLoading: true,
order: null,
isEditRemark: false,
addComment: false,
}
},