|
@@ -398,7 +398,7 @@
|
|
|
type="primary"
|
|
type="primary"
|
|
|
size="small"
|
|
size="small"
|
|
|
>
|
|
>
|
|
|
- {{ scope.row.viewUrl ? "查看" : "上传" }}
|
|
|
|
|
|
|
+ {{ scope.row.files ? "查看" : "上传" }}
|
|
|
</el-button>
|
|
</el-button>
|
|
|
</template>
|
|
</template>
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
@@ -685,18 +685,16 @@ export default {
|
|
|
let coordinates = ref([]);
|
|
let coordinates = ref([]);
|
|
|
let previewSrcList = ref([]);
|
|
let previewSrcList = ref([]);
|
|
|
|
|
|
|
|
- async function getVoyageDetail(type) {
|
|
|
|
|
|
|
+ async function getVoyageDetail() {
|
|
|
let res = await api.getVoyageDetail({
|
|
let res = await api.getVoyageDetail({
|
|
|
type: localStorage.userType,
|
|
type: localStorage.userType,
|
|
|
voyageId: route.query.id,
|
|
voyageId: route.query.id,
|
|
|
});
|
|
});
|
|
|
if (res.data.status == 0) {
|
|
if (res.data.status == 0) {
|
|
|
- if (type) {
|
|
|
|
|
- ElNotification({
|
|
|
|
|
- type: "success",
|
|
|
|
|
- title: res.data.msg,
|
|
|
|
|
- });
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ ElNotification({
|
|
|
|
|
+ type: "success",
|
|
|
|
|
+ title: res.data.msg,
|
|
|
|
|
+ });
|
|
|
|
|
|
|
|
coordinates.value = res.data.result.coordinates;
|
|
coordinates.value = res.data.result.coordinates;
|
|
|
voyage.value = res.data.result.voyage;
|
|
voyage.value = res.data.result.voyage;
|
|
@@ -734,15 +732,16 @@ export default {
|
|
|
async function addDischarge() {
|
|
async function addDischarge() {
|
|
|
if (!formInline.value.dischargeTime || !formInline.value.dischargeTons)
|
|
if (!formInline.value.dischargeTime || !formInline.value.dischargeTons)
|
|
|
return;
|
|
return;
|
|
|
- if (
|
|
|
|
|
- poundBillList.value.length &&
|
|
|
|
|
- poundBillList.value[0].response.result.id
|
|
|
|
|
- ) {
|
|
|
|
|
- formInline.value.voyageFileId =
|
|
|
|
|
- poundBillList.value[0].response.result.id;
|
|
|
|
|
|
|
+ let arr = [];
|
|
|
|
|
+
|
|
|
|
|
+ if (poundBillList.value.length) {
|
|
|
|
|
+ for (let i of poundBillList.value) {
|
|
|
|
|
+ arr.push(i.response.result.id);
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
let res = await api.addDischarge({
|
|
let res = await api.addDischarge({
|
|
|
...formInline.value,
|
|
...formInline.value,
|
|
|
|
|
+ voyageFileIds: arr.join(","),
|
|
|
voyageId: route.query.id,
|
|
voyageId: route.query.id,
|
|
|
});
|
|
});
|
|
|
if (res.data.status == 0) {
|
|
if (res.data.status == 0) {
|
|
@@ -775,7 +774,7 @@ export default {
|
|
|
let dischargeCurrentPage = ref(1);
|
|
let dischargeCurrentPage = ref(1);
|
|
|
let dischargeList = ref([]);
|
|
let dischargeList = ref([]);
|
|
|
let formInline = ref({});
|
|
let formInline = ref({});
|
|
|
- async function getDischargeList(type) {
|
|
|
|
|
|
|
+ async function getDischargeList() {
|
|
|
let res = await api.getDischargeList({
|
|
let res = await api.getDischargeList({
|
|
|
voyageId: route.query.id,
|
|
voyageId: route.query.id,
|
|
|
currentPage: dischargeCurrentPage.value,
|
|
currentPage: dischargeCurrentPage.value,
|
|
@@ -783,11 +782,6 @@ export default {
|
|
|
});
|
|
});
|
|
|
if (res.data.status == 0) {
|
|
if (res.data.status == 0) {
|
|
|
dischargeList.value = res.data.result;
|
|
dischargeList.value = res.data.result;
|
|
|
- for (let i of dischargeList.value) {
|
|
|
|
|
- if (i.viewUrl) {
|
|
|
|
|
- previewPoundList.value.push(i.viewUrl);
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
total.value = res.data.total;
|
|
total.value = res.data.total;
|
|
|
} else {
|
|
} else {
|
|
|
console.log(res);
|
|
console.log(res);
|
|
@@ -800,15 +794,14 @@ export default {
|
|
|
let postData = {
|
|
let postData = {
|
|
|
...updateForm.value,
|
|
...updateForm.value,
|
|
|
};
|
|
};
|
|
|
|
|
+ let arr = [];
|
|
|
if (updatePoundBillList.value.length) {
|
|
if (updatePoundBillList.value.length) {
|
|
|
- if (updatePoundBillList.value[0].id) {
|
|
|
|
|
- postData.voyageFileId = updatePoundBillList.value[0].id;
|
|
|
|
|
- } else {
|
|
|
|
|
- postData.voyageFileId =
|
|
|
|
|
- updatePoundBillList.value[0].response.result.id;
|
|
|
|
|
|
|
+ for (let i of updatePoundBillList.value) {
|
|
|
|
|
+ arr.push(i.id || i.response.result.id);
|
|
|
}
|
|
}
|
|
|
|
|
+ postData.voyageFileIds = arr.join(",");
|
|
|
} else {
|
|
} else {
|
|
|
- postData.voyageFileId = 0;
|
|
|
|
|
|
|
+ postData.voyageFileIds = "";
|
|
|
}
|
|
}
|
|
|
let res = await api.updateDischarge({
|
|
let res = await api.updateDischarge({
|
|
|
...postData,
|
|
...postData,
|
|
@@ -830,17 +823,18 @@ export default {
|
|
|
}
|
|
}
|
|
|
function showUpdateDischarge(item, index) {
|
|
function showUpdateDischarge(item, index) {
|
|
|
updateDischargeDialog.value = true;
|
|
updateDischargeDialog.value = true;
|
|
|
|
|
+ updatePoundBillList.value = [];
|
|
|
|
|
|
|
|
- let { id, dischargeTons, dischargeTime, voyageFileId, viewUrl } = item;
|
|
|
|
|
- if (viewUrl) {
|
|
|
|
|
- updatePoundBillList.value[0] = { id, url: viewUrl };
|
|
|
|
|
|
|
+ let { id, dischargeTons, dischargeTime, voyageId, files } = item;
|
|
|
|
|
+ if (files && files.length) {
|
|
|
|
|
+ for (let i of files)
|
|
|
|
|
+ updatePoundBillList.value.push({ id: i.id, url: i.viewUrl });
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
updateForm.value = {
|
|
updateForm.value = {
|
|
|
id,
|
|
id,
|
|
|
dischargeTons,
|
|
dischargeTons,
|
|
|
dischargeTime,
|
|
dischargeTime,
|
|
|
- voyageFileId,
|
|
|
|
|
};
|
|
};
|
|
|
currentUpdateIndex.value = index;
|
|
currentUpdateIndex.value = index;
|
|
|
}
|
|
}
|
|
@@ -1187,6 +1181,7 @@ export default {
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
function getPoundBillList(list) {
|
|
function getPoundBillList(list) {
|
|
|
|
|
+ console.log(list);
|
|
|
poundBillList.value = list;
|
|
poundBillList.value = list;
|
|
|
}
|
|
}
|
|
|
let poundBillList = ref([]);
|
|
let poundBillList = ref([]);
|
|
@@ -1211,6 +1206,7 @@ export default {
|
|
|
});
|
|
});
|
|
|
let updatePoundBillList = ref([]);
|
|
let updatePoundBillList = ref([]);
|
|
|
function getupdatePoundBillList(list) {
|
|
function getupdatePoundBillList(list) {
|
|
|
|
|
+ console.log(list);
|
|
|
updatePoundBillList.value = list;
|
|
updatePoundBillList.value = list;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -1290,8 +1286,8 @@ export default {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
onMounted(() => {
|
|
onMounted(() => {
|
|
|
- getVoyageDetail(1);
|
|
|
|
|
- getDischargeList(1);
|
|
|
|
|
|
|
+ getVoyageDetail();
|
|
|
|
|
+ getDischargeList();
|
|
|
});
|
|
});
|
|
|
return {
|
|
return {
|
|
|
certs,
|
|
certs,
|