ออกคำสั้ง

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2023-12-19 17:46:35 +07:00
parent f16295f335
commit 5e8a3b1f5e
4 changed files with 217 additions and 2 deletions

View file

@ -31,6 +31,7 @@ const route = useRoute();
const router = useRouter();
const orderId = route.params.orderid;
const orderId_paramsName = route.name;
const props = defineProps({
next: {
@ -115,6 +116,12 @@ const conclusionFireResolution = ref<string>("");
const conclusionTranferNo = ref<string>("");
const conclusionTranferDate = ref<Date>(new Date());
// C-PM-25-32
const faultLevel = ref<string>("");
const caseFault = ref<string>("");
const result = ref<string>("");
const refRaw = ref<string>("");
const typeOrderFilter = ref<any>({
typeOrderOption: [],
});
@ -143,20 +150,44 @@ watch(nameCommand, async () => {
positionCommand.value = nameCommand.value.positionName;
}
});
const commandCodes = ref<string[]>([
"C-PM-19",
"C-PM-20",
"C-PM-25",
"C-PM-26",
"C-PM-27",
"C-PM-28",
"C-PM-29",
"C-PM-30",
"C-PM-31",
"C-PM-32",
]);
//
const fecthTypeOption = async (actions: string) => {
showLoader();
await http
.get(config.API.typeOrder())
.then((res) => {
typeOrderOption.value = res.data.result.map((e: OrederResult) => ({
const response = res.data.result;
const filterRes = response.filter((e: any) =>
commandCodes.value.includes(e.commandCode)
);
const data =
orderId_paramsName === "OrderDetail" ||
orderId_paramsName === "OrderAdd"
? response
: filterRes;
typeOrderOption.value = data.map((e: OrederResult) => ({
id: e.id,
name: e.name,
category: e.category,
commandCode: e.commandCode,
fullname: e.commandCode + " " + e.name,
}));
typeOrderFilter.value = res.data.result.map((e: OrederResult) => ({
typeOrderFilter.value = data.map((e: OrederResult) => ({
id: e.id,
name: e.name,
category: e.category,
@ -246,6 +277,12 @@ const fetchdetailOrder = async () => {
conclusionTranferNo.value = data.conclusionTranferNo;
conclusionTranferDate.value = data.conclusionTranferDate;
// 25-32
faultLevel.value = data.faultLevel;
caseFault.value = data.caseFault;
result.value = data.result;
refRaw.value = data.refRaw;
fecthExamRoundOption(data.orderTypeCode);
})
.catch((e) => {
@ -324,6 +361,11 @@ const selectCMP = (selectOrder: OrederResult) => {
// 24
conclusionTranferNo.value = "";
conclusionTranferDate.value = new Date();
// 25-32
faultLevel.value = "";
caseFault.value = "";
result.value = "";
refRaw.value = "";
};
//
const fecthExamRoundOption = async (commandCode: string) => {
@ -456,6 +498,22 @@ const submit = async () => {
conclusionTranferNo: conclusionTranferNo.value,
conclusionTranferDate: conclusionTranferDate.value,
});
} else if (
typeOrder.value.commandCode == "C-PM-25" ||
typeOrder.value.commandCode == "C-PM-26" ||
typeOrder.value.commandCode == "C-PM-27" ||
typeOrder.value.commandCode == "C-PM-28" ||
typeOrder.value.commandCode == "C-PM-29" ||
typeOrder.value.commandCode == "C-PM-30" ||
typeOrder.value.commandCode == "C-PM-31" ||
typeOrder.value.commandCode == "C-PM-32"
) {
Object.assign(formdata, {
faultLevel: faultLevel.value,
caseFault: caseFault.value,
result: result.value,
refRaw: refRaw.value,
});
}
//
@ -1894,6 +1952,71 @@ const getClass = (val: boolean) => {
</datepicker>
</div>
</div>
<!-- C-PM-25 -32 -->
<div
class="row col-12 q-col-gutter-x-lg q-col-gutter-y-md"
v-if="
typeOrder != null &&
(typeOrder.commandCode === 'C-PM-25' ||
typeOrder.commandCode === 'C-PM-26' ||
typeOrder.commandCode === 'C-PM-27' ||
typeOrder.commandCode === 'C-PM-28' ||
typeOrder.commandCode === 'C-PM-29' ||
typeOrder.commandCode === 'C-PM-30' ||
typeOrder.commandCode === 'C-PM-31' ||
typeOrder.commandCode === 'C-PM-32')
"
>
<div class="col-xs-12 col-md-6">
<q-input
:class="getClass(true)"
outlined
dense
lazy-rules
v-model="faultLevel"
:rules="[(val) => !!val || `${'กรุณากรอกระดับความผิด'}`]"
:label="`${'ระดับความผิด'}`"
hide-bottom-space
/>
</div>
<div class="col-xs-12 col-md-6">
<q-input
:class="getClass(true)"
outlined
dense
lazy-rules
v-model="caseFault"
:rules="[(val) => !!val || `${'กรุณากรอกกรณีความผิด'}`]"
:label="`${'กรณีความผิด'}`"
hide-bottom-space
/>
</div>
<div class="col-xs-12 col-md-6">
<q-input
:class="getClass(true)"
outlined
dense
lazy-rules
v-model="result"
:rules="[(val) => !!val || `${'กรุณากรอกผลดำเนินการพิจารณา'}`]"
:label="`${'ผลดำเนินการพิจารณา'}`"
hide-bottom-space
/>
</div>
<div class="col-xs-12 col-md-6">
<q-input
:class="getClass(true)"
outlined
dense
lazy-rules
v-model="refRaw"
:rules="[(val) => !!val || `${'กรุณากรอกอ้างอิงมาตราตามกฎหมาย'}`]"
:label="`${'อ้างอิงมาตราตามกฎหมาย'}`"
hide-bottom-space
/>
</div>
</div>
</q-form>
</div>