|
@@ -94,14 +94,16 @@
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
<script setup>
|
|
<script setup>
|
|
|
-import { showSuccessToast } from 'vant';
|
|
|
|
|
|
|
+import { showSuccessToast, showFailToast } from 'vant';
|
|
|
import {computed, onMounted, ref, watch} from "vue";
|
|
import {computed, onMounted, ref, watch} from "vue";
|
|
|
import {useRoute} from "vue-router";
|
|
import {useRoute} from "vue-router";
|
|
|
|
|
+import { getToken } from "@/utils/auth";
|
|
|
|
|
+import { useAppStore } from '@/stores/app';
|
|
|
|
|
+import {useUserStore} from "@/stores/user";
|
|
|
import tacObjPblmstbList from './TacObjPblmstbList.vue';
|
|
import tacObjPblmstbList from './TacObjPblmstbList.vue';
|
|
|
import {getTacQuestionById} from "@/api/inspect";
|
|
import {getTacQuestionById} from "@/api/inspect";
|
|
|
import { showConfirmDialog } from 'vant';
|
|
import { showConfirmDialog } from 'vant';
|
|
|
import {addTacQuestion, getIllegalActById, getTacUnitList} from "@/api/questions";
|
|
import {addTacQuestion, getIllegalActById, getTacUnitList} from "@/api/questions";
|
|
|
-import {useUserStore} from "@/stores/user";
|
|
|
|
|
import request from "@/utils/request";
|
|
import request from "@/utils/request";
|
|
|
const route = useRoute();
|
|
const route = useRoute();
|
|
|
const userStore = useUserStore();
|
|
const userStore = useUserStore();
|
|
@@ -284,13 +286,16 @@ async function save(){
|
|
|
delete tacObjPblmstb.value.inspPblmCode;
|
|
delete tacObjPblmstb.value.inspPblmCode;
|
|
|
delete tacObjPblmstb.value.pblmsTypeId;
|
|
delete tacObjPblmstb.value.pblmsTypeId;
|
|
|
delete tacObjPblmstb.value.collTime;
|
|
delete tacObjPblmstb.value.collTime;
|
|
|
|
|
+ uploadFileToServer(newFile.value, parData.value.pblmId)
|
|
|
await request.post('/dc/insp/pblm/update', tacObjPblmstb.value).then((res) => {
|
|
await request.post('/dc/insp/pblm/update', tacObjPblmstb.value).then((res) => {
|
|
|
if (res.success) {
|
|
if (res.success) {
|
|
|
-
|
|
|
|
|
- if(newFile.value && newFile.value.id){
|
|
|
|
|
- uploadFileToServer(newFile.value, parData.value.pblmId)
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ fileList.value.forEach(item => {
|
|
|
|
|
+ if(!item.id){
|
|
|
|
|
+ uploadFileToServer(item, parData.value.pblmId)
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
showSuccessToast('保存成功!');
|
|
showSuccessToast('保存成功!');
|
|
|
|
|
+ fileList.value = []
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
getDe();
|
|
getDe();
|
|
@@ -480,7 +485,7 @@ watch(() => fileList.value, (newVal, oldVal) => {
|
|
|
if (newVal.length>oldVal.length) {
|
|
if (newVal.length>oldVal.length) {
|
|
|
isAdding.value = true;
|
|
isAdding.value = true;
|
|
|
newFile.value = getObjectArrayDiff(newVal, oldVal, 'id').onlyInArr1[0]
|
|
newFile.value = getObjectArrayDiff(newVal, oldVal, 'id').onlyInArr1[0]
|
|
|
- console.log(newFile.value.onlyInArr1);
|
|
|
|
|
|
|
+ console.log(newFile.value);
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
else{
|
|
else{
|