ออกคำสั่ง => คำสั้งปรับโครงสร้าง
This commit is contained in:
parent
dc079e31fd
commit
e9367dea5c
7 changed files with 94 additions and 30 deletions
|
|
@ -11,6 +11,9 @@ import config from "@/app.config";
|
|||
import axios from "axios";
|
||||
import genReport from "@/plugins/genreport";
|
||||
|
||||
import { useOrderPlacementDataStore } from "@/modules/10_order/store";
|
||||
|
||||
const DataStore = useOrderPlacementDataStore();
|
||||
const mixin = useCounterMixin();
|
||||
const {
|
||||
date2Thai,
|
||||
|
|
@ -72,7 +75,8 @@ const attachmentStatus = computed(() => {
|
|||
code.value != "c-pm-29" &&
|
||||
code.value != "c-pm-30" &&
|
||||
code.value != "c-pm-31" &&
|
||||
code.value != "c-pm-32"
|
||||
code.value != "c-pm-32" &&
|
||||
code.value != "c-pm-38"
|
||||
? true
|
||||
: false;
|
||||
});
|
||||
|
|
@ -100,7 +104,10 @@ const getCommandDetail = async () => {
|
|||
.get(config.API.detailOrder(orderId.value))
|
||||
.then(async (res) => {
|
||||
const data = await res.data.result;
|
||||
|
||||
DataStore.typeOrder = data.orderTypeCode.toUpperCase();
|
||||
const orderTypeCode = await data.orderTypeCode;
|
||||
|
||||
code.value = orderTypeCode ?? "";
|
||||
orderName.value = res.data.result.orderTitle;
|
||||
orderStatusName.value = data.orderStatusName;
|
||||
|
|
@ -284,7 +291,7 @@ const saveUpload = () => {
|
|||
dialogConfirm($q, async () => {
|
||||
showLoader();
|
||||
await postfileOrder();
|
||||
if (attachmentStatus.value) {
|
||||
if (attachmentStatus.value || code.value === "c-pm-38") {
|
||||
await postfileTailer();
|
||||
}
|
||||
await fetchAttachment(orderId.value);
|
||||
|
|
@ -309,7 +316,7 @@ const saveDetail = () => {
|
|||
await fetchReportCover("pdf", orderId.value); // ดึงรายงานคำสั่งใหม่
|
||||
|
||||
// เช็คประเภทคำสั่งถ้าไม่ใช่ type เหล่านี้จะมีแนบท้าย
|
||||
if (attachmentStatus.value) {
|
||||
if (attachmentStatus.value || code.value === "c-pm-38") {
|
||||
// ดึงรายงานในส่วนของแนบท้ายมาใหม่
|
||||
await fetchReportAttachment("pdf", orderId.value);
|
||||
|
||||
|
|
@ -398,7 +405,7 @@ const clickExecute = async (id: string) => {
|
|||
};
|
||||
const validateFormUpload = () => {
|
||||
if (
|
||||
attachmentStatus.value &&
|
||||
(attachmentStatus.value || code.value === "c-pm-38") &&
|
||||
fileOrder.value !== null &&
|
||||
fileTailer.value !== null
|
||||
) {
|
||||
|
|
@ -652,7 +659,7 @@ const viewFileUpload = async (url: string) => {
|
|||
</template>
|
||||
</q-file>
|
||||
</div>
|
||||
<div v-if="attachmentStatus">
|
||||
<div v-if="attachmentStatus || code === 'c-pm-38'">
|
||||
<label class="text-file">เอกสารแนบท้าย</label>
|
||||
<div v-if="TailerPDFUpload != ''" class="text-right">
|
||||
<q-btn
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue