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