mirror of
https://git.meshkee.com/cssd/cssd-front.git
synced 2026-10-13 08:03:17 +03:30
fix : add test result testType by id
This commit is contained in:
+5
-1
@@ -14,12 +14,16 @@ const urls = {
|
|||||||
storeCycle: "/Cycles",
|
storeCycle: "/Cycles",
|
||||||
storeItem: "/Items",
|
storeItem: "/Items",
|
||||||
listTestTypeName: "/TestTypes/ListNames",
|
listTestTypeName: "/TestTypes/ListNames",
|
||||||
getInputs: `/GetInputs`,
|
listTestTypeOrigin: "/TestTypes/List",
|
||||||
|
/* getInputs: `/GetInputs`,*/
|
||||||
forgotPassword: `/password/phone`,
|
forgotPassword: `/password/phone`,
|
||||||
sendVerifyCode: `/password/verifyCode`,
|
sendVerifyCode: `/password/verifyCode`,
|
||||||
changePassword: `/password/reset`,
|
changePassword: `/password/reset`,
|
||||||
storeMessages: `/Messages`,
|
storeMessages: `/Messages`,
|
||||||
deleteFile: `/DeleteFile`,
|
deleteFile: `/DeleteFile`,
|
||||||
|
getInputs: function (id) {
|
||||||
|
return "/GetInputs/" + id;
|
||||||
|
},
|
||||||
listMessages: function (page) {
|
listMessages: function (page) {
|
||||||
return `/Messages?page=${page}`;
|
return `/Messages?page=${page}`;
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -9,6 +9,8 @@
|
|||||||
:search-input.sync="searchInput"
|
:search-input.sync="searchInput"
|
||||||
:items="testTypeNames"
|
:items="testTypeNames"
|
||||||
v-model="filter.name"
|
v-model="filter.name"
|
||||||
|
item-text="name"
|
||||||
|
item-value="id"
|
||||||
label="Choose Test Type"
|
label="Choose Test Type"
|
||||||
color="black"
|
color="black"
|
||||||
class="py-3 pr-3"
|
class="py-3 pr-3"
|
||||||
@@ -77,10 +79,10 @@
|
|||||||
<v-switch color="light-green accent-3" v-model="result" :label="'Result: ' + formData.result"/>
|
<v-switch color="light-green accent-3" v-model="result" :label="'Result: ' + formData.result"/>
|
||||||
</v-flex>
|
</v-flex>
|
||||||
<v-spacer/>
|
<v-spacer/>
|
||||||
<v-flex xs12 sm12 md12>
|
<v-flex xs12 sm12 md12 v-if="galleryDataLoaded">
|
||||||
<template v-if="galleryDataLoaded">
|
<template>
|
||||||
<wm-Dropzone :Images="galleries" :BatchID="file_batch_id"
|
<wm-Dropzone :Images="galleries" :BatchID="file_batch_id"
|
||||||
:ModelID="$route.params.testResult" ModelType="TestResult"/>
|
:ModelID="$route.params.testResult||null" ModelType="TestResult"/>
|
||||||
</template>
|
</template>
|
||||||
</v-flex>
|
</v-flex>
|
||||||
</v-layout>
|
</v-layout>
|
||||||
@@ -424,8 +426,8 @@ export default {
|
|||||||
},
|
},
|
||||||
data: () => ({
|
data: () => ({
|
||||||
today: new Date().toISOString().substr(0, 10),
|
today: new Date().toISOString().substr(0, 10),
|
||||||
galleryDataLoaded: false,
|
|
||||||
galleries: [],
|
galleries: [],
|
||||||
|
galleryDataLoaded: false,
|
||||||
file_batch_id: Math.floor(Math.random() * 9000000000) + 1000000000,
|
file_batch_id: Math.floor(Math.random() * 9000000000) + 1000000000,
|
||||||
testTypeNames: [],
|
testTypeNames: [],
|
||||||
testTypeNameSelected: "",
|
testTypeNameSelected: "",
|
||||||
@@ -473,18 +475,18 @@ export default {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
async load() {
|
async load() {
|
||||||
const result = await ApiService.get(urls.listTestTypeName);
|
// const result = await ApiService.get(urls.listTestTypeName);
|
||||||
|
const result = await ApiService.get(urls.listTestTypeOrigin);
|
||||||
this.testTypeNames = result.data.data;
|
this.testTypeNames = result.data.data;
|
||||||
},
|
},
|
||||||
async selectTestType() {
|
async selectTestType() {
|
||||||
const result = await ApiService.post(urls.getInputs, this.filter);
|
let selectedTestType = this.filter.unique_code !== "" ? +this.filter.unique_code : this.filter.name;
|
||||||
if (result && result.status == 200) {
|
const result = await ApiService.get(urls.getInputs(selectedTestType));
|
||||||
|
if (result && result.data.data && result.status == 200) {
|
||||||
this.testTypeNameSelected = result.data.data.testType.name;
|
this.testTypeNameSelected = result.data.data.testType.name;
|
||||||
|
|
||||||
this.form = result.data.data.inputs;
|
this.form = result.data.data.inputs;
|
||||||
this.formData.test_type_id = result.data.data.testType.id;
|
this.formData.test_type_id = result.data.data.testType.id;
|
||||||
this.formData.device_label =
|
this.formData.device_label = result.data.data.testType.device_label;
|
||||||
result.data.data.testType.device_label;
|
|
||||||
for (const key in result.data.data.inputs) {
|
for (const key in result.data.data.inputs) {
|
||||||
if (result.data.data.inputs.hasOwnProperty(key)) {
|
if (result.data.data.inputs.hasOwnProperty(key)) {
|
||||||
if (result.data.data.inputs[key].type == "Form") {
|
if (result.data.data.inputs[key].type == "Form") {
|
||||||
@@ -515,7 +517,7 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// this.images = result.data.data.imagesPath;
|
// this.images = result.data.data.imagesPath;
|
||||||
this.galleries = result.data.data.filesPath;
|
this.galleries = result.data.data.files;
|
||||||
this.galleryDataLoaded = true;
|
this.galleryDataLoaded = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -563,18 +565,10 @@ export default {
|
|||||||
this.formData.imgs = img;
|
this.formData.imgs = img;
|
||||||
},
|
},
|
||||||
result(value) {
|
result(value) {
|
||||||
if (value) {
|
this.formData.result = value ? "Accept" : "Reject";
|
||||||
this.formData.result = "Accept";
|
|
||||||
} else {
|
|
||||||
this.formData.result = "Reject";
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
formData(value) {
|
formData(value) {
|
||||||
if (value.result == "Accept") {
|
this.result = value.result === "Accept";
|
||||||
this.result = true;
|
|
||||||
} else {
|
|
||||||
this.result = false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user