Compare commits
2 Commits
ad2e3c8e53
...
6c56e0786a
| Author | SHA1 | Date | |
|---|---|---|---|
| 6c56e0786a | |||
| 00391b9f6a |
@ -46,6 +46,11 @@ const routes = [
|
|||||||
name: 'MaterialDetail',
|
name: 'MaterialDetail',
|
||||||
component: () => import('../views/Material/MaterialDetails.vue')
|
component: () => import('../views/Material/MaterialDetails.vue')
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
path: '/materialConfirm/:data',
|
||||||
|
name: 'MaterialConfirm',
|
||||||
|
component: () => import('../views/Material/MaterialConfirm.vue')
|
||||||
|
},
|
||||||
{
|
{
|
||||||
path: '/iceEventManage/:data',
|
path: '/iceEventManage/:data',
|
||||||
name: 'IceEventManage',
|
name: 'IceEventManage',
|
||||||
|
|||||||
96
packages/mobile/src/views/Material/MaterialConfirm.vue
Normal file
96
packages/mobile/src/views/Material/MaterialConfirm.vue
Normal file
@ -0,0 +1,96 @@
|
|||||||
|
<template>
|
||||||
|
<div class="home">
|
||||||
|
<van-nav-bar title="确认物资" fixed left-arrow @click-left="onClickLeft" />
|
||||||
|
|
||||||
|
<van-cell-group>
|
||||||
|
<van-cell title="当前站点" :value="yhzInfo.mc" />
|
||||||
|
</van-cell-group>
|
||||||
|
|
||||||
|
<div class="content" v-if="pendingConfirmList">
|
||||||
|
<van-cell-group>
|
||||||
|
<van-cell
|
||||||
|
v-for="(item, index) in pendingConfirmList"
|
||||||
|
:key="index"
|
||||||
|
:title="item.wzmc"
|
||||||
|
is-link
|
||||||
|
:label="`余量:${item.ye}(${item.dw})`"
|
||||||
|
:to="{
|
||||||
|
name: 'MaterialDetail',
|
||||||
|
params: {
|
||||||
|
data: encodeURIComponent(
|
||||||
|
JSON.stringify({
|
||||||
|
material: item,
|
||||||
|
yhzDetail: yhzInfo,
|
||||||
|
isConfirm: true,
|
||||||
|
})
|
||||||
|
),
|
||||||
|
},
|
||||||
|
}"
|
||||||
|
>
|
||||||
|
</van-cell>
|
||||||
|
</van-cell-group>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
import { ref, onMounted, reactive, toRaw, watch } from "vue";
|
||||||
|
import { useRouter, useRoute } from "vue-router";
|
||||||
|
import { showToast, showLoadingToast } from "vant";
|
||||||
|
|
||||||
|
import { request } from "../../../../shared/utils/request";
|
||||||
|
|
||||||
|
const router = useRouter();
|
||||||
|
const route = useRoute();
|
||||||
|
const yhzInfo = ref({}); // 养护站详情数据
|
||||||
|
const pendingConfirmList = ref([]); // 待确认列表数据
|
||||||
|
|
||||||
|
// 获取养护站详情数据
|
||||||
|
onMounted(() => {
|
||||||
|
yhzInfo.value = JSON.parse(decodeURIComponent(route.params.data));
|
||||||
|
console.log("yhzInfo", toRaw(yhzInfo.value));
|
||||||
|
getPendingConfirmList();
|
||||||
|
});
|
||||||
|
|
||||||
|
const getPendingConfirmList = async () => {
|
||||||
|
try {
|
||||||
|
const data = {
|
||||||
|
yhzid: yhzInfo.value.id,
|
||||||
|
pageNum: 1,
|
||||||
|
pageSize: 9999,
|
||||||
|
};
|
||||||
|
const res = await request({
|
||||||
|
url: "/snow-ops-platform/yjwz/pendingConfirmList",
|
||||||
|
method: "get",
|
||||||
|
params: data,
|
||||||
|
});
|
||||||
|
if (res.code === "00000") {
|
||||||
|
pendingConfirmList.value = res.data.records;
|
||||||
|
} else {
|
||||||
|
throw new Error(res.message);
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
showToast({
|
||||||
|
type: "fail",
|
||||||
|
message: error.message,
|
||||||
|
});
|
||||||
|
console.log("error", error);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const onClickLeft = () => {
|
||||||
|
router.push({
|
||||||
|
name: "MaterialManage",
|
||||||
|
params: { data: encodeURIComponent(JSON.stringify(yhzInfo.value)) },
|
||||||
|
});
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
.home {
|
||||||
|
padding-top: var(--van-nav-bar-height); /* 自动匹配导航栏高度 */
|
||||||
|
}
|
||||||
|
.content {
|
||||||
|
padding: 16px 16px 80px 16px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@ -23,7 +23,15 @@
|
|||||||
></van-image>
|
></van-image>
|
||||||
</template>
|
</template>
|
||||||
</van-cell>
|
</van-cell>
|
||||||
<van-cell :title="'余量: ' + wzDetailData.ye + ' ' + wzDetailData.dw">
|
<van-cell
|
||||||
|
v-if="!isConfirm"
|
||||||
|
:title="'余量: ' + wzDetailData.ye + ' ' + wzDetailData.dw"
|
||||||
|
>
|
||||||
|
</van-cell>
|
||||||
|
<van-cell
|
||||||
|
v-if="isConfirm"
|
||||||
|
:title="'数量: ' + wzDetailData.sl + ' ' + wzDetailData.dw"
|
||||||
|
>
|
||||||
</van-cell>
|
</van-cell>
|
||||||
<van-cell :title="'物资经度: ' + wzDetailData.jd"> </van-cell>
|
<van-cell :title="'物资经度: ' + wzDetailData.jd"> </van-cell>
|
||||||
<van-cell :title="'物资纬度: ' + wzDetailData.wd"> </van-cell>
|
<van-cell :title="'物资纬度: ' + wzDetailData.wd"> </van-cell>
|
||||||
@ -35,9 +43,7 @@
|
|||||||
<van-cell :title="'所属养护站: ' + wzDetailData.yhzMc"> </van-cell>
|
<van-cell :title="'所属养护站: ' + wzDetailData.yhzMc"> </van-cell>
|
||||||
<van-cell :title="'备注: ' + wzDetailData.remark"> </van-cell>
|
<van-cell :title="'备注: ' + wzDetailData.remark"> </van-cell>
|
||||||
</van-cell-group>
|
</van-cell-group>
|
||||||
<van-button type="primary" class="remark-btn" @click="handleRemarkOpen">
|
|
||||||
备注
|
|
||||||
</van-button>
|
|
||||||
<van-popup
|
<van-popup
|
||||||
:show="showRemarkPopup"
|
:show="showRemarkPopup"
|
||||||
position="bottom"
|
position="bottom"
|
||||||
@ -67,7 +73,7 @@
|
|||||||
备注信息
|
备注信息
|
||||||
</h1>
|
</h1>
|
||||||
<van-field
|
<van-field
|
||||||
v-model="wzDetailData.remark"
|
v-model="editForm.material.remark"
|
||||||
placeholder="请输入备注"
|
placeholder="请输入备注"
|
||||||
style="
|
style="
|
||||||
width: 100%;
|
width: 100%;
|
||||||
@ -95,6 +101,192 @@
|
|||||||
</div>
|
</div>
|
||||||
</van-popup>
|
</van-popup>
|
||||||
</div>
|
</div>
|
||||||
|
<van-tabbar v-if="isConfirm">
|
||||||
|
<van-tabbar-item>
|
||||||
|
<template #default>
|
||||||
|
<div class="button-box">
|
||||||
|
<van-button
|
||||||
|
type="warning"
|
||||||
|
style="width: 50%; border-radius: 10px"
|
||||||
|
@click="notYHZPopupOpen"
|
||||||
|
>
|
||||||
|
不是本站点设备
|
||||||
|
</van-button>
|
||||||
|
<van-button
|
||||||
|
type="primary"
|
||||||
|
style="width: 50%; border-radius: 10px"
|
||||||
|
@click="addToThisYHZPopupOpen"
|
||||||
|
>
|
||||||
|
添加到服务站
|
||||||
|
</van-button>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</van-tabbar-item>
|
||||||
|
</van-tabbar>
|
||||||
|
<van-tabbar v-else>
|
||||||
|
<van-tabbar-item>
|
||||||
|
<template #default>
|
||||||
|
<van-button
|
||||||
|
type="primary"
|
||||||
|
style="width: 100%; border-radius: 10px; display: block"
|
||||||
|
@click="handleRemarkOpen"
|
||||||
|
>
|
||||||
|
备注
|
||||||
|
</van-button>
|
||||||
|
</template>
|
||||||
|
</van-tabbar-item>
|
||||||
|
</van-tabbar>
|
||||||
|
|
||||||
|
<van-popup
|
||||||
|
:show="notYHZPopup"
|
||||||
|
position="bottom"
|
||||||
|
closeable
|
||||||
|
close-on-click-overlay
|
||||||
|
:style="{ height: '20%' }"
|
||||||
|
@close="notYHZPopupClose"
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
style="
|
||||||
|
height: 100%;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
padding: 0 16px;
|
||||||
|
"
|
||||||
|
>
|
||||||
|
<h1
|
||||||
|
style="
|
||||||
|
margin: 0 0 20px 0;
|
||||||
|
font-size: 18px;
|
||||||
|
color: #333;
|
||||||
|
text-align: center;
|
||||||
|
"
|
||||||
|
>
|
||||||
|
确认不是本站点物资?
|
||||||
|
</h1>
|
||||||
|
|
||||||
|
<div style="display: flex; gap: 20px; width: 100%">
|
||||||
|
<van-button
|
||||||
|
type="default"
|
||||||
|
style="flex: 1; border-radius: 8px"
|
||||||
|
@click="notYHZPopupClose"
|
||||||
|
>
|
||||||
|
取消
|
||||||
|
</van-button>
|
||||||
|
<van-button
|
||||||
|
type="primary"
|
||||||
|
style="flex: 1; border-radius: 8px"
|
||||||
|
@click="notYHZConfirm"
|
||||||
|
>
|
||||||
|
确认
|
||||||
|
</van-button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</van-popup>
|
||||||
|
|
||||||
|
<!-- 负责人弹窗 -->
|
||||||
|
<van-popup
|
||||||
|
:show="showAdminPicker"
|
||||||
|
round
|
||||||
|
position="bottom"
|
||||||
|
close-on-click-overlay
|
||||||
|
@close="showAdminPicker = false"
|
||||||
|
>
|
||||||
|
<van-picker
|
||||||
|
title="选择负责人"
|
||||||
|
:columns="adminOptions"
|
||||||
|
@confirm="onAdminConfirm"
|
||||||
|
@cancel="showAdminPicker = false"
|
||||||
|
/>
|
||||||
|
</van-popup>
|
||||||
|
|
||||||
|
<van-popup
|
||||||
|
:show="addToThisYHZPupup"
|
||||||
|
position="bottom"
|
||||||
|
closeable
|
||||||
|
close-on-click-overlay
|
||||||
|
@close="addToThisYHZPopupClose"
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
style="
|
||||||
|
height: 100%;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
padding: 0 16px;
|
||||||
|
"
|
||||||
|
>
|
||||||
|
<h1
|
||||||
|
v-if="wzDetailData.fzr && wzDetailData.fzrid"
|
||||||
|
style="
|
||||||
|
margin: 20px 0 20px 0;
|
||||||
|
font-size: 18px;
|
||||||
|
color: #333;
|
||||||
|
text-align: center;
|
||||||
|
"
|
||||||
|
>
|
||||||
|
确认添加
|
||||||
|
</h1>
|
||||||
|
|
||||||
|
<div v-else>
|
||||||
|
<h1
|
||||||
|
style="
|
||||||
|
margin: 20px 0 20px 0;
|
||||||
|
font-size: 18px;
|
||||||
|
color: #333;
|
||||||
|
text-align: center;
|
||||||
|
"
|
||||||
|
>
|
||||||
|
添加到服务站
|
||||||
|
</h1>
|
||||||
|
<!-- 负责人 -->
|
||||||
|
<van-field
|
||||||
|
v-model="editForm.material.fzr"
|
||||||
|
is-link
|
||||||
|
arrow-direction="down"
|
||||||
|
readonly
|
||||||
|
label="负责人"
|
||||||
|
placeholder="请选择负责人"
|
||||||
|
@click="showAdminPicker = true"
|
||||||
|
/>
|
||||||
|
<van-field v-model="editForm.material.remark" label="备注(非必填)">
|
||||||
|
</van-field>
|
||||||
|
<van-field label="设备照片(非必填)" center>
|
||||||
|
<template #input>
|
||||||
|
<van-uploader
|
||||||
|
v-model="fileList"
|
||||||
|
@delete="handleDelete"
|
||||||
|
name="photos"
|
||||||
|
:file-list="fileList"
|
||||||
|
:file-type="['image/jpeg', 'image/png']"
|
||||||
|
:after-read="afterRead"
|
||||||
|
multiple
|
||||||
|
:max-count="6"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
</van-field>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div style="display: flex; gap: 20px; width: 100%">
|
||||||
|
<van-button
|
||||||
|
type="default"
|
||||||
|
style="flex: 1; border-radius: 8px"
|
||||||
|
@click="addToThisYHZPopupClose"
|
||||||
|
>
|
||||||
|
取消
|
||||||
|
</van-button>
|
||||||
|
<van-button
|
||||||
|
type="primary"
|
||||||
|
style="flex: 1; border-radius: 8px"
|
||||||
|
@click="AddToThisTHZConfirm"
|
||||||
|
>
|
||||||
|
确认
|
||||||
|
</van-button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</van-popup>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -111,11 +303,14 @@ const yhzDetail = ref({});
|
|||||||
const wzData = ref([]);
|
const wzData = ref([]);
|
||||||
const wzDetailData = ref(); // 物资详情数据
|
const wzDetailData = ref(); // 物资详情数据
|
||||||
const photos = ref([]); // 物资图片数据
|
const photos = ref([]); // 物资图片数据
|
||||||
|
const isConfirm = ref(false); // 是否是在确认物资
|
||||||
|
const editForm = reactive({});
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
const data = JSON.parse(decodeURIComponent(route.params.data));
|
const data = JSON.parse(decodeURIComponent(route.params.data));
|
||||||
yhzDetail.value = data.yhzDetail;
|
yhzDetail.value = data.yhzDetail;
|
||||||
wzData.value = data.material;
|
wzData.value = data.material;
|
||||||
|
isConfirm.value = data.isConfirm;
|
||||||
console.log("传递过来的参数:", data);
|
console.log("传递过来的参数:", data);
|
||||||
getwzDetail();
|
getwzDetail();
|
||||||
});
|
});
|
||||||
@ -129,6 +324,7 @@ const getwzDetail = async () => {
|
|||||||
});
|
});
|
||||||
if (res.code && res.code === "00000") {
|
if (res.code && res.code === "00000") {
|
||||||
wzDetailData.value = res.data.material;
|
wzDetailData.value = res.data.material;
|
||||||
|
// console.log('wzDetailData',toRaw(wzDetailData.value));
|
||||||
photos.value = res.data.photos;
|
photos.value = res.data.photos;
|
||||||
} else {
|
} else {
|
||||||
throw new Error(res.message);
|
throw new Error(res.message);
|
||||||
@ -160,6 +356,8 @@ const showImage = (photos) => {
|
|||||||
// 编辑备注相关
|
// 编辑备注相关
|
||||||
const showRemarkPopup = ref(false);
|
const showRemarkPopup = ref(false);
|
||||||
const handleRemarkOpen = () => {
|
const handleRemarkOpen = () => {
|
||||||
|
editForm.material = JSON.parse(JSON.stringify(wzDetailData.value));
|
||||||
|
editForm.photos = [...photos.value];
|
||||||
showRemarkPopup.value = true;
|
showRemarkPopup.value = true;
|
||||||
};
|
};
|
||||||
const onRemarkPopupClose = () => {
|
const onRemarkPopupClose = () => {
|
||||||
@ -168,15 +366,11 @@ const onRemarkPopupClose = () => {
|
|||||||
};
|
};
|
||||||
const onRemarkConfirm = async () => {
|
const onRemarkConfirm = async () => {
|
||||||
try {
|
try {
|
||||||
const data = {
|
const res = await request({
|
||||||
material: wzDetailData.value,
|
url: `/snow-ops-platform/yjwz/update`,
|
||||||
photos: photos.value,
|
method: "POST",
|
||||||
},
|
data: editForm,
|
||||||
res = await request({
|
});
|
||||||
url: `/snow-ops-platform/yjwz/update`,
|
|
||||||
method: "POST",
|
|
||||||
data,
|
|
||||||
});
|
|
||||||
if (res.code && res.code === "00000") {
|
if (res.code && res.code === "00000") {
|
||||||
showToast({
|
showToast({
|
||||||
message: "备注信息保存成功",
|
message: "备注信息保存成功",
|
||||||
@ -193,6 +387,182 @@ const onRemarkConfirm = async () => {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// 确认物资相关
|
||||||
|
const notYHZPopup = ref(false);
|
||||||
|
const notYHZPopupOpen = () => {
|
||||||
|
notYHZPopup.value = true;
|
||||||
|
};
|
||||||
|
const notYHZPopupClose = () => {
|
||||||
|
notYHZPopup.value = false;
|
||||||
|
};
|
||||||
|
const notYHZConfirm = async () => {
|
||||||
|
try {
|
||||||
|
const res = await request({
|
||||||
|
url: "/snow-ops-platform/yjwz/confirm",
|
||||||
|
method: "POST",
|
||||||
|
data: {
|
||||||
|
rid: wzDetailData.value.rid,
|
||||||
|
confirmType: 2, // 确认类型 1-确认添加到本站,2-拒绝
|
||||||
|
},
|
||||||
|
});
|
||||||
|
if (res.code === "00000") {
|
||||||
|
router.push({
|
||||||
|
name: "MaterialManage",
|
||||||
|
params: { data: encodeURIComponent(JSON.stringify(yhzDetail.value)) },
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
throw new Error(res.message);
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
showToast({ type: "fail", message: error.message || "操作失败" });
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const addToThisYHZPupup = ref(false);
|
||||||
|
const adminOptions = ref([]); // 负责人选项
|
||||||
|
// 获取养护站人员列表
|
||||||
|
const getPersonList = async () => {
|
||||||
|
try {
|
||||||
|
const data = {
|
||||||
|
pageNum: 1,
|
||||||
|
pageSize: 9999,
|
||||||
|
yhzid: yhzDetail.value.id,
|
||||||
|
};
|
||||||
|
const res = await request({
|
||||||
|
url: "/snow-ops-platform/yhzry/list",
|
||||||
|
method: "get",
|
||||||
|
params: data,
|
||||||
|
});
|
||||||
|
if (res.code === "00000") {
|
||||||
|
adminOptions.value = res.data.records.map((item) => ({
|
||||||
|
text: item.xm,
|
||||||
|
value: item.userId,
|
||||||
|
}));
|
||||||
|
} else {
|
||||||
|
throw new Error("人员信息获取失败");
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.log(error);
|
||||||
|
showToast({
|
||||||
|
type: "fail",
|
||||||
|
message: error.message,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
|
// 负责人
|
||||||
|
const showAdminPicker = ref(false);
|
||||||
|
const onAdminConfirm = (value) => {
|
||||||
|
const selectedOption = adminOptions.value.find(
|
||||||
|
(opt) => opt.value === value.selectedValues[0]
|
||||||
|
);
|
||||||
|
if (selectedOption) {
|
||||||
|
editForm.material.fzr = selectedOption.text;
|
||||||
|
editForm.material.fzrid = selectedOption.value;
|
||||||
|
}
|
||||||
|
showAdminPicker.value = false;
|
||||||
|
};
|
||||||
|
const addToThisYHZPopupOpen = async () => {
|
||||||
|
await getPersonList();
|
||||||
|
editForm.material = JSON.parse(JSON.stringify(wzDetailData.value));
|
||||||
|
editForm.photos = [...photos.value];
|
||||||
|
fileList.value = photos.value.map((photo) => ({
|
||||||
|
url: photo.photoUrl,
|
||||||
|
status: "done",
|
||||||
|
message: "上传成功",
|
||||||
|
serverUrl: photo.photoUrl,
|
||||||
|
}));
|
||||||
|
addToThisYHZPupup.value = true;
|
||||||
|
};
|
||||||
|
const addToThisYHZPopupClose = () => {
|
||||||
|
addToThisYHZPupup.value = false;
|
||||||
|
};
|
||||||
|
|
||||||
|
const AddToThisTHZConfirm = async () => {
|
||||||
|
if (!wzDetailData.value.fzr || !wzDetailData.value.fzrid) {
|
||||||
|
await onRemarkConfirm();
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
const data = {
|
||||||
|
rid: wzDetailData.value.rid,
|
||||||
|
confirmType: 1, // 确认类型 1-确认添加到本站,2-拒绝
|
||||||
|
};
|
||||||
|
const res = await request({
|
||||||
|
url: "/snow-ops-platform/yjwz/confirm",
|
||||||
|
method: "POST",
|
||||||
|
data,
|
||||||
|
});
|
||||||
|
if (res.code === "00000") {
|
||||||
|
showToast({
|
||||||
|
message: "操作成功",
|
||||||
|
type: "success",
|
||||||
|
});
|
||||||
|
addToThisYHZPopupClose();
|
||||||
|
router.push({
|
||||||
|
name: "MaterialManage",
|
||||||
|
params: { data: encodeURIComponent(JSON.stringify(yhzDetail.value)) },
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
throw new Error(res.message);
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
showToast({
|
||||||
|
type: "fail",
|
||||||
|
message: error.message || "操作失败",
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// 上传文件相关
|
||||||
|
const fileList = ref([]);
|
||||||
|
// 文件删除
|
||||||
|
const handleDelete = (file) => {
|
||||||
|
if (file.serverUrl) {
|
||||||
|
const index = editForm.photos.findIndex(
|
||||||
|
(p) => p.photoUrl === file.serverUrl
|
||||||
|
);
|
||||||
|
if (index !== -1) {
|
||||||
|
editForm.photos.splice(index, 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// 文件上传
|
||||||
|
const afterRead = async (file) => {
|
||||||
|
try {
|
||||||
|
const toast = showLoadingToast({
|
||||||
|
message: "上传中...",
|
||||||
|
forbidClick: true,
|
||||||
|
duration: 0, // 设置为0表示不会自动关闭
|
||||||
|
});
|
||||||
|
const formData = new FormData();
|
||||||
|
formData.append("file", file.file);
|
||||||
|
const res = await request({
|
||||||
|
url: "/snow-ops-platform/file/upload",
|
||||||
|
method: "post",
|
||||||
|
data: formData,
|
||||||
|
});
|
||||||
|
toast.close();
|
||||||
|
if (res.code === "00000") {
|
||||||
|
editForm.photos.push({ photoUrl: res.data });
|
||||||
|
const index = fileList.value.findIndex((f) => f.file === file.file);
|
||||||
|
if (index !== -1) {
|
||||||
|
fileList.value[index].serverUrl = res.data;
|
||||||
|
}
|
||||||
|
|
||||||
|
console.log("editForm.photos", toRaw(editForm.photos));
|
||||||
|
console.log("fileList.value", fileList.value);
|
||||||
|
} else {
|
||||||
|
throw new Error(res.message);
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
toast.close();
|
||||||
|
showToast({
|
||||||
|
type: "fail",
|
||||||
|
message: error.message,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
@ -228,17 +598,15 @@ const onRemarkConfirm = async () => {
|
|||||||
.status-danger {
|
.status-danger {
|
||||||
background-color: #ee0a24;
|
background-color: #ee0a24;
|
||||||
}
|
}
|
||||||
.remark-btn {
|
:deep(.van-tabbar-item__text) {
|
||||||
position: fixed;
|
width: 90%;
|
||||||
bottom: 20px;
|
display: block;
|
||||||
left: 16px;
|
}
|
||||||
right: 16px;
|
.button-box {
|
||||||
width: calc(100% - 32px);
|
display: flex;
|
||||||
margin: 0 auto;
|
justify-content: center;
|
||||||
border-radius: 24px;
|
width: 100%;
|
||||||
font-size: 16px;
|
gap: 20px;
|
||||||
height: 44px;
|
|
||||||
z-index: 999;
|
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
@ -11,6 +11,12 @@
|
|||||||
<van-cell-group>
|
<van-cell-group>
|
||||||
<van-cell title="当前站点" :value="yhzDetail.mc" />
|
<van-cell title="当前站点" :value="yhzDetail.mc" />
|
||||||
</van-cell-group>
|
</van-cell-group>
|
||||||
|
<van-notice-bar
|
||||||
|
mode="link"
|
||||||
|
v-if="pendingConfirmList.length"
|
||||||
|
@click="handleConfirm"
|
||||||
|
>{{ pendingConfirmList.length }}个物资待确认</van-notice-bar
|
||||||
|
>
|
||||||
|
|
||||||
<div class="content">
|
<div class="content">
|
||||||
<van-cell-group>
|
<van-cell-group>
|
||||||
@ -27,6 +33,7 @@
|
|||||||
JSON.stringify({
|
JSON.stringify({
|
||||||
yhzDetail: yhzDetail,
|
yhzDetail: yhzDetail,
|
||||||
material: item,
|
material: item,
|
||||||
|
isConfirm: false,
|
||||||
})
|
})
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
@ -241,6 +248,43 @@ const getInitForm = () => ({
|
|||||||
photos: [],
|
photos: [],
|
||||||
});
|
});
|
||||||
const form = reactive(getInitForm());
|
const form = reactive(getInitForm());
|
||||||
|
const pendingConfirmList = ref([]); // 待确认物资列表
|
||||||
|
|
||||||
|
// 获取待确认物资列表
|
||||||
|
const getPendingConfirmList = async () => {
|
||||||
|
try {
|
||||||
|
const data = {
|
||||||
|
yhzid: yhzDetail.value.id,
|
||||||
|
pageNum: 1,
|
||||||
|
pageSize: 9999,
|
||||||
|
};
|
||||||
|
const res = await request({
|
||||||
|
url: "/snow-ops-platform/yjwz/pendingConfirmList",
|
||||||
|
method: "GET",
|
||||||
|
params: data,
|
||||||
|
});
|
||||||
|
if (res.code === "00000") {
|
||||||
|
pendingConfirmList.value = res.data.records;
|
||||||
|
} else {
|
||||||
|
throw new Error(res.message);
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
showToast({
|
||||||
|
type: "fail",
|
||||||
|
message: error.message || "获取待确认物资列表失败",
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// 跳转到确认物资页面
|
||||||
|
const handleConfirm = () => {
|
||||||
|
router.push({
|
||||||
|
name: "MaterialConfirm",
|
||||||
|
params: {
|
||||||
|
data: encodeURIComponent(JSON.stringify(yhzDetail.value)),
|
||||||
|
},
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
// 根据养护站rid获取物资列表
|
// 根据养护站rid获取物资列表
|
||||||
const getMaterialList = async (wzmc) => {
|
const getMaterialList = async (wzmc) => {
|
||||||
@ -278,6 +322,7 @@ onMounted(() => {
|
|||||||
yhzDetail.value = JSON.parse(decodeURIComponent(route.params.data));
|
yhzDetail.value = JSON.parse(decodeURIComponent(route.params.data));
|
||||||
console.log("yhzDetail", toRaw(yhzDetail.value));
|
console.log("yhzDetail", toRaw(yhzDetail.value));
|
||||||
getMaterialList();
|
getMaterialList();
|
||||||
|
getPendingConfirmList();
|
||||||
});
|
});
|
||||||
|
|
||||||
// 购置日期相关
|
// 购置日期相关
|
||||||
@ -331,6 +376,7 @@ const handleSubmit = async () => {
|
|||||||
});
|
});
|
||||||
onPopupClose();
|
onPopupClose();
|
||||||
getMaterialList(searchValue.value);
|
getMaterialList(searchValue.value);
|
||||||
|
getPendingConfirmList();
|
||||||
} else {
|
} else {
|
||||||
throw new Error(res.message);
|
throw new Error(res.message);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user