App物资管理
This commit is contained in:
parent
c07d7912a9
commit
94edd0d0f6
@ -17,7 +17,7 @@ const routes = [
|
|||||||
component: () => import('../views/Equipment/EquipmentManagement.vue')
|
component: () => import('../views/Equipment/EquipmentManagement.vue')
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/materialManage',
|
path: '/materialManage/:data',
|
||||||
name: 'MaterialManage',
|
name: 'MaterialManage',
|
||||||
component: () => import('../views//Material/MaterialManagement.vue')
|
component: () => import('../views//Material/MaterialManagement.vue')
|
||||||
},
|
},
|
||||||
@ -31,6 +31,13 @@ const routes = [
|
|||||||
name: 'EquipDetail',
|
name: 'EquipDetail',
|
||||||
component: () => import('../views//Equipment/EquipmentDetails.vue')
|
component: () => import('../views//Equipment/EquipmentDetails.vue')
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
path: '/materialDetail/:yhzDetail/:data',
|
||||||
|
name: 'MaterialDetail',
|
||||||
|
component: () => import('../views//Material/MaterialDetails.vue')
|
||||||
|
},
|
||||||
|
{
|
||||||
|
}
|
||||||
]
|
]
|
||||||
|
|
||||||
const router = createRouter({
|
const router = createRouter({
|
||||||
|
|||||||
@ -13,7 +13,8 @@
|
|||||||
style="font-size: 18px; font-weight: bold; line-height: inherit"
|
style="font-size: 18px; font-weight: bold; line-height: inherit"
|
||||||
>
|
>
|
||||||
<template #value>
|
<template #value>
|
||||||
<span :class="[
|
<span
|
||||||
|
:class="[
|
||||||
'status-tag',
|
'status-tag',
|
||||||
`status-` +
|
`status-` +
|
||||||
(equipmentDetailInfo.sbzt === '完好'
|
(equipmentDetailInfo.sbzt === '完好'
|
||||||
@ -21,9 +22,9 @@
|
|||||||
: equipmentDetailInfo.sbzt === '损坏'
|
: equipmentDetailInfo.sbzt === '损坏'
|
||||||
? 'warning'
|
? 'warning'
|
||||||
: 'danger'),
|
: 'danger'),
|
||||||
]">{{
|
]"
|
||||||
equipmentDetailInfo.sbzt
|
>{{ equipmentDetailInfo.sbzt }}</span
|
||||||
}}</span>
|
>
|
||||||
</template>
|
</template>
|
||||||
</van-cell>
|
</van-cell>
|
||||||
<van-cell :title="'设备名称: ' + equipmentDetailInfo.sbmc"> </van-cell>
|
<van-cell :title="'设备名称: ' + equipmentDetailInfo.sbmc"> </van-cell>
|
||||||
@ -34,20 +35,27 @@
|
|||||||
<van-cell :title="'设备位置: ' + equipmentDetailInfo.sbwz"> </van-cell>
|
<van-cell :title="'设备位置: ' + equipmentDetailInfo.sbwz"> </van-cell>
|
||||||
<van-cell :title="'设备经纬度: '">
|
<van-cell :title="'设备经纬度: '">
|
||||||
<template #label>
|
<template #label>
|
||||||
<span>设备经度: {{ equipmentDetailInfo.jd }}<br />设备纬度: {{ equipmentDetailInfo.wd }}</span>
|
<span
|
||||||
|
>设备经度: {{ equipmentDetailInfo.jd }}<br />设备纬度:
|
||||||
|
{{ equipmentDetailInfo.wd }}</span
|
||||||
|
>
|
||||||
</template>
|
</template>
|
||||||
</van-cell>
|
</van-cell>
|
||||||
<van-cell :title="'设备管理人员: '+ equipmentDetailInfo.glry"> </van-cell>
|
<van-cell :title="'设备管理人员: ' + equipmentDetailInfo.glry">
|
||||||
<van-cell :title="'操作员: '+ equipmentDetailInfo.czy"> </van-cell>
|
</van-cell>
|
||||||
<van-cell :title="'购置日期: '+ equipmentDetailInfo.gzrq"> </van-cell>
|
<van-cell :title="'操作员: ' + equipmentDetailInfo.czy">
|
||||||
<van-cell :title="'购买费用(万元): '+ equipmentDetailInfo.gmfy"> </van-cell>
|
</van-cell>
|
||||||
<van-cell :title="'应急设备: '+ equipmentDetailInfo.sfyjsb"> </van-cell>
|
<van-cell :title="'购置日期: ' + equipmentDetailInfo.gzrq">
|
||||||
<van-cell :title="'纳入市级补助范围: ' + equipmentDetailInfo.sfnrsjbz"> </van-cell>
|
</van-cell>
|
||||||
<van-cell
|
<van-cell :title="'购买费用(万元): ' + equipmentDetailInfo.gmfy">
|
||||||
:title="'辐射范围: '+ equipmentDetailInfo.fsfw"
|
</van-cell>
|
||||||
>
|
<van-cell :title="'应急设备: ' + equipmentDetailInfo.sfyjsb">
|
||||||
|
</van-cell>
|
||||||
|
<van-cell :title="'纳入市级补助范围: ' + equipmentDetailInfo.sfnrsjbz">
|
||||||
|
</van-cell>
|
||||||
|
<van-cell :title="'辐射范围: ' + equipmentDetailInfo.fsfw"> </van-cell>
|
||||||
|
<van-cell :title="'所属服务站: ' + equipmentDetailInfo.sbwz">
|
||||||
</van-cell>
|
</van-cell>
|
||||||
<van-cell :title="'所属服务站: '+ equipmentDetailInfo.sbwz"> </van-cell>
|
|
||||||
</van-cell-group>
|
</van-cell-group>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -79,8 +87,11 @@
|
|||||||
>
|
>
|
||||||
<van-tabbar-item
|
<van-tabbar-item
|
||||||
><template #default>
|
><template #default>
|
||||||
<van-button type="primary" style="width: 80px; border-radius: 10px"
|
<van-button
|
||||||
@click="onEditPopupOpen">
|
type="primary"
|
||||||
|
style="width: 80px; border-radius: 10px"
|
||||||
|
@click="onEditPopupOpen"
|
||||||
|
>
|
||||||
编辑
|
编辑
|
||||||
</van-button>
|
</van-button>
|
||||||
</template></van-tabbar-item
|
</template></van-tabbar-item
|
||||||
@ -103,9 +114,56 @@
|
|||||||
position="bottom"
|
position="bottom"
|
||||||
closeable
|
closeable
|
||||||
close-on-click-overlay
|
close-on-click-overlay
|
||||||
:style="{ height: '20%' }"
|
:style="{ height: '30%' }"
|
||||||
@close="onRemarkPopupClose"
|
@close="onRemarkPopupClose"
|
||||||
>
|
>
|
||||||
|
<div
|
||||||
|
style="
|
||||||
|
height: 100%;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
padding: 0 16px;
|
||||||
|
"
|
||||||
|
>
|
||||||
|
<h1
|
||||||
|
style="
|
||||||
|
margin: 0 0 12px 0;
|
||||||
|
font-size: 18px;
|
||||||
|
color: #333;
|
||||||
|
text-align: center;
|
||||||
|
"
|
||||||
|
>
|
||||||
|
备注信息
|
||||||
|
</h1>
|
||||||
|
<van-field
|
||||||
|
v-model="equipmentDetailInfo.remark"
|
||||||
|
placeholder="请输入备注"
|
||||||
|
style="
|
||||||
|
width: 100%;
|
||||||
|
margin-bottom: 16px;
|
||||||
|
border-radius: 8px;
|
||||||
|
background: #f7f8fa;
|
||||||
|
"
|
||||||
|
/>
|
||||||
|
<div style="display: flex; gap: 20px; width: 100%">
|
||||||
|
<van-button
|
||||||
|
type="default"
|
||||||
|
style="flex: 1; border-radius: 8px"
|
||||||
|
@click="onRemarkPopupClose"
|
||||||
|
>
|
||||||
|
取消
|
||||||
|
</van-button>
|
||||||
|
<van-button
|
||||||
|
type="primary"
|
||||||
|
style="flex: 1; border-radius: 8px"
|
||||||
|
@click="onRemarkConfirm"
|
||||||
|
>
|
||||||
|
确认
|
||||||
|
</van-button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</van-popup>
|
</van-popup>
|
||||||
<van-popup
|
<van-popup
|
||||||
:show="showDeletePopup"
|
:show="showDeletePopup"
|
||||||
@ -160,17 +218,64 @@
|
|||||||
position="bottom"
|
position="bottom"
|
||||||
closeable
|
closeable
|
||||||
close-on-click-overlay
|
close-on-click-overlay
|
||||||
:style="{ height: '20%' }"
|
:style="{ height: '30%' }"
|
||||||
@close="onBrokenPopupClose"
|
@close="onBrokenPopupClose"
|
||||||
>
|
>
|
||||||
|
<div
|
||||||
|
style="
|
||||||
|
height: 100%;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
padding: 0 16px;
|
||||||
|
"
|
||||||
|
>
|
||||||
|
<h1
|
||||||
|
style="
|
||||||
|
margin: 0 0 12px 0;
|
||||||
|
font-size: 18px;
|
||||||
|
color: #333;
|
||||||
|
text-align: center;
|
||||||
|
"
|
||||||
|
>
|
||||||
|
损坏上报
|
||||||
|
</h1>
|
||||||
|
<van-field
|
||||||
|
v-model="brokenReason"
|
||||||
|
placeholder="请填写损坏原因"
|
||||||
|
style="
|
||||||
|
width: 100%;
|
||||||
|
margin-bottom: 16px;
|
||||||
|
border-radius: 8px;
|
||||||
|
background: #f7f8fa;
|
||||||
|
"
|
||||||
|
/>
|
||||||
|
<div style="display: flex; gap: 20px; width: 100%">
|
||||||
|
<van-button
|
||||||
|
type="default"
|
||||||
|
style="flex: 1; border-radius: 8px"
|
||||||
|
@click="onBrokenPopupClose"
|
||||||
|
>
|
||||||
|
取消
|
||||||
|
</van-button>
|
||||||
|
<van-button
|
||||||
|
type="primary"
|
||||||
|
style="flex: 1; border-radius: 8px"
|
||||||
|
@click="onBrokenConfirm"
|
||||||
|
>
|
||||||
|
确认
|
||||||
|
</van-button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</van-popup>
|
</van-popup>
|
||||||
<van-popup
|
<van-popup
|
||||||
:show="show报废Popup"
|
:show="showScrapPopup"
|
||||||
position="bottom"
|
position="bottom"
|
||||||
closeable
|
closeable
|
||||||
close-on-click-overlay
|
close-on-click-overlay
|
||||||
:style="{ height: '30%' }"
|
:style="{ height: '30%' }"
|
||||||
@close="on报废PopupClose"
|
@close="onScrapPopupClose"
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
style="
|
style="
|
||||||
@ -208,14 +313,14 @@
|
|||||||
<van-button
|
<van-button
|
||||||
type="default"
|
type="default"
|
||||||
style="flex: 1; border-radius: 8px"
|
style="flex: 1; border-radius: 8px"
|
||||||
@click="on报废PopupClose"
|
@click="onScrapPopupClose"
|
||||||
>
|
>
|
||||||
取消
|
取消
|
||||||
</van-button>
|
</van-button>
|
||||||
<van-button
|
<van-button
|
||||||
type="primary"
|
type="primary"
|
||||||
style="flex: 1; border-radius: 8px"
|
style="flex: 1; border-radius: 8px"
|
||||||
@click="on报废Confirm"
|
@click="onScrapConfirm"
|
||||||
>
|
>
|
||||||
确认
|
确认
|
||||||
</van-button>
|
</van-button>
|
||||||
@ -223,8 +328,6 @@
|
|||||||
</div>
|
</div>
|
||||||
</van-popup>
|
</van-popup>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<van-popup
|
<van-popup
|
||||||
:show="showEditPopup"
|
:show="showEditPopup"
|
||||||
position="bottom"
|
position="bottom"
|
||||||
@ -501,7 +604,6 @@
|
|||||||
@cancel="showSubsidyPicker = false"
|
@cancel="showSubsidyPicker = false"
|
||||||
/>
|
/>
|
||||||
</van-popup>
|
</van-popup>
|
||||||
|
|
||||||
</van-form>
|
</van-form>
|
||||||
<div
|
<div
|
||||||
style="
|
style="
|
||||||
@ -547,7 +649,7 @@ const onSelect = (action) => {
|
|||||||
showDeletePopup.value = true;
|
showDeletePopup.value = true;
|
||||||
}
|
}
|
||||||
if (action.text === "报废") {
|
if (action.text === "报废") {
|
||||||
show报废Popup.value = true;
|
showScrapPopup.value = true;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
const equipmentInfo = ref({});
|
const equipmentInfo = ref({});
|
||||||
@ -560,11 +662,10 @@ const getEquipmentDetailInfo = async () => {
|
|||||||
url: `/snow-ops-platform/yjsb/getById?rid=${equipmentInfo.value.rid}`,
|
url: `/snow-ops-platform/yjsb/getById?rid=${equipmentInfo.value.rid}`,
|
||||||
method: "GET",
|
method: "GET",
|
||||||
});
|
});
|
||||||
if (res.code && res.code === '00000') {
|
if (res.code && res.code === "00000") {
|
||||||
equipmentDetailInfo.value = res.data;
|
equipmentDetailInfo.value = res.data;
|
||||||
console.log('设备详情',toRaw(equipmentDetailInfo.value))
|
console.log("设备详情", toRaw(equipmentDetailInfo.value));
|
||||||
}
|
} else {
|
||||||
else{
|
|
||||||
throw new Error(res.data.message);
|
throw new Error(res.data.message);
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
@ -585,23 +686,81 @@ const onClickLeft = () => {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
const show报废Popup = ref(false);
|
const showScrapPopup = ref(false);
|
||||||
const scrapReason = ref(''); // 报废原因
|
const scrapReason = ref(""); // 报废原因
|
||||||
const on报废PopupClose = () => {
|
const onScrapPopupClose = () => {
|
||||||
show报废Popup.value = false;
|
showScrapPopup.value = false;
|
||||||
scrapReason.value = '';
|
scrapReason.value = "";
|
||||||
};
|
};
|
||||||
const on报废Confirm = () => {
|
const onScrapConfirm = async () => {
|
||||||
show报废Popup.value = false;
|
try {
|
||||||
scrapReason.value = '';
|
console.log("equipmentDetailInfo", toRaw(equipmentDetailInfo.value));
|
||||||
|
const res = await request({
|
||||||
|
url: `/snow-ops-platform/yjsb/update`,
|
||||||
|
method: "POST",
|
||||||
|
data: {
|
||||||
|
...equipmentDetailInfo.value,
|
||||||
|
sbzt: "报废",
|
||||||
|
remark: scrapReason.value,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
if (res.code && res.code === "00000") {
|
||||||
|
showToast({ type: "success", message: "操作成功" });
|
||||||
|
router.push({
|
||||||
|
name: "EquipManage",
|
||||||
|
params: {
|
||||||
|
data: encodeURIComponent(JSON.stringify(equipmentInfo.value)),
|
||||||
|
},
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
throw new Error(res.data.message);
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
showToast({ type: "error", message: "操作失败" });
|
||||||
|
console.log("error", error);
|
||||||
|
}
|
||||||
|
showScrapPopup.value = false;
|
||||||
|
scrapReason.value = "";
|
||||||
};
|
};
|
||||||
|
|
||||||
const showBrokenPopup = ref(false);
|
const showBrokenPopup = ref(false);
|
||||||
const onBrokenPopupOpen = () => {
|
const onBrokenPopupOpen = () => {
|
||||||
showBrokenPopup.value = true;
|
showBrokenPopup.value = true;
|
||||||
};
|
};
|
||||||
|
// 损坏相关状态
|
||||||
|
const brokenReason = ref(""); // 损坏原因
|
||||||
|
const onBrokenConfirm = async () => {
|
||||||
|
try {
|
||||||
|
const res = await request({
|
||||||
|
url: `/snow-ops-platform/yjsb/update`,
|
||||||
|
method: "POST",
|
||||||
|
data: {
|
||||||
|
...equipmentDetailInfo.value,
|
||||||
|
sbzt: "损坏", // 修改状态为损坏
|
||||||
|
remark: brokenReason.value,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
if (res.code && res.code === "00000") {
|
||||||
|
showToast({ type: "success", message: "损坏上报成功" });
|
||||||
|
router.push({
|
||||||
|
name: "EquipManage",
|
||||||
|
params: {
|
||||||
|
data: encodeURIComponent(JSON.stringify(equipmentInfo.value)),
|
||||||
|
},
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
throw new Error(res.data.message);
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
showToast({ type: "error", message: "操作失败" });
|
||||||
|
console.log("error", error);
|
||||||
|
}
|
||||||
|
showBrokenPopup.value = false;
|
||||||
|
brokenReason.value = "";
|
||||||
|
};
|
||||||
const onBrokenPopupClose = () => {
|
const onBrokenPopupClose = () => {
|
||||||
showBrokenPopup.value = false;
|
showBrokenPopup.value = false;
|
||||||
|
brokenReason.value = "";
|
||||||
};
|
};
|
||||||
|
|
||||||
const showDeletePopup = ref(false);
|
const showDeletePopup = ref(false);
|
||||||
@ -619,22 +778,23 @@ const onDeleteConfirm = async () => {
|
|||||||
url: `/snow-ops-platform/yjsb/delete`,
|
url: `/snow-ops-platform/yjsb/delete`,
|
||||||
method: "POST",
|
method: "POST",
|
||||||
data: {
|
data: {
|
||||||
rid : equipmentDetailInfo.value.rid
|
rid: equipmentDetailInfo.value.rid,
|
||||||
}
|
},
|
||||||
});
|
});
|
||||||
if (res.code && res.code === '00000') {
|
if (res.code && res.code === "00000") {
|
||||||
showToast({ type: "success", message: "删除成功" });
|
showToast({ type: "success", message: "删除成功" });
|
||||||
router.push({
|
router.push({
|
||||||
name: "EquipManage",
|
name: "EquipManage",
|
||||||
params: { data: encodeURIComponent(JSON.stringify(equipmentInfo.value)) },
|
params: {
|
||||||
|
data: encodeURIComponent(JSON.stringify(equipmentInfo.value)),
|
||||||
|
},
|
||||||
});
|
});
|
||||||
}
|
} else {
|
||||||
else{
|
|
||||||
throw new Error(res.data.message);
|
throw new Error(res.data.message);
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
showToast({ type: "error", message: "删除失败" });
|
showToast({ type: "error", message: "删除失败" });
|
||||||
console.log('error',error)
|
console.log("error", error);
|
||||||
}
|
}
|
||||||
showDeletePopup.value = false;
|
showDeletePopup.value = false;
|
||||||
};
|
};
|
||||||
@ -643,23 +803,54 @@ const showRemarkPopup = ref(false);
|
|||||||
const onRemarkPopupOpen = () => {
|
const onRemarkPopupOpen = () => {
|
||||||
showRemarkPopup.value = true;
|
showRemarkPopup.value = true;
|
||||||
};
|
};
|
||||||
|
const onRemarkConfirm = async () => {
|
||||||
|
try {
|
||||||
|
showLoadingToast({
|
||||||
|
message: "提交中...",
|
||||||
|
forbidClick: true,
|
||||||
|
loadingType: "spinner",
|
||||||
|
});
|
||||||
|
|
||||||
|
const res = await request({
|
||||||
|
url: "/snow-ops-platform/yjsb/update",
|
||||||
|
method: "POST",
|
||||||
|
data: {
|
||||||
|
...equipmentDetailInfo.value,
|
||||||
|
|
||||||
|
remark: equipmentDetailInfo.value.remark,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
if (res.code && res.code === "00000") {
|
||||||
|
showToast({ type: "success", message: "备注更新成功" });
|
||||||
|
getEquipmentDetailInfo();
|
||||||
|
showRemarkPopup.value = false;
|
||||||
|
} else {
|
||||||
|
throw new Error(res.data.message);
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
showToast({ type: "error", message: error.message || "备注更新失败" });
|
||||||
|
} finally {
|
||||||
|
showRemarkPopup.value = false;
|
||||||
|
}
|
||||||
|
};
|
||||||
const onRemarkPopupClose = () => {
|
const onRemarkPopupClose = () => {
|
||||||
|
getEquipmentDetailInfo();
|
||||||
showRemarkPopup.value = false;
|
showRemarkPopup.value = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
const showEditPopup = ref(false)
|
const showEditPopup = ref(false);
|
||||||
// 编辑表单
|
// 编辑表单
|
||||||
const editForm = reactive({})
|
const editForm = reactive({});
|
||||||
// 打开编辑弹窗
|
// 打开编辑弹窗
|
||||||
const onEditPopupOpen = () => {
|
const onEditPopupOpen = () => {
|
||||||
Object.assign(editForm, equipmentDetailInfo.value);
|
Object.assign(editForm, equipmentDetailInfo.value);
|
||||||
|
|
||||||
showEditPopup.value = true
|
showEditPopup.value = true;
|
||||||
}
|
};
|
||||||
// 关闭编辑弹窗
|
// 关闭编辑弹窗
|
||||||
const onEditPopupClose = () => {
|
const onEditPopupClose = () => {
|
||||||
showEditPopup.value = false
|
showEditPopup.value = false;
|
||||||
}
|
};
|
||||||
|
|
||||||
const showCategoryPicker = ref(false);
|
const showCategoryPicker = ref(false);
|
||||||
const showTypePicker = ref(false);
|
const showTypePicker = ref(false);
|
||||||
@ -798,26 +989,26 @@ const onSubsidyConfirm = (value) => {
|
|||||||
// 提交修改
|
// 提交修改
|
||||||
const onEditSubmit = async () => {
|
const onEditSubmit = async () => {
|
||||||
try {
|
try {
|
||||||
showLoadingToast({ message: '提交中...', forbidClick: true })
|
showLoadingToast({ message: "提交中...", forbidClick: true });
|
||||||
// console.log('editForm',toRaw(editForm))
|
// console.log('editForm',toRaw(editForm))
|
||||||
|
|
||||||
const res = await request({
|
const res = await request({
|
||||||
url: '/snow-ops-platform/yjsb/update',
|
url: "/snow-ops-platform/yjsb/update",
|
||||||
method: 'POST',
|
method: "POST",
|
||||||
data: editForm
|
data: editForm,
|
||||||
})
|
});
|
||||||
if (res.code && res.code === '00000') {
|
if (res.code && res.code === "00000") {
|
||||||
showToast({ type: 'success', message: '修改成功' })
|
showToast({ type: "success", message: "修改成功" });
|
||||||
getEquipmentDetailInfo() // 刷新详情数据
|
getEquipmentDetailInfo(); // 刷新详情数据
|
||||||
showEditPopup.value = false
|
showEditPopup.value = false;
|
||||||
} else {
|
} else {
|
||||||
throw new Error(res.message)
|
throw new Error(res.message);
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
showToast({ type: 'fail', message: error.message || '修改失败' })
|
showToast({ type: "fail", message: error.message || "修改失败" });
|
||||||
console.log('error',error)
|
console.log("error", error);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
|
|||||||
@ -16,7 +16,14 @@
|
|||||||
params: { data: encodeURIComponent(JSON.stringify(detailData)) },
|
params: { data: encodeURIComponent(JSON.stringify(detailData)) },
|
||||||
}"
|
}"
|
||||||
/>
|
/>
|
||||||
<van-grid-item icon="setting-o" text="物资管理" to="/MaterialManage" />
|
<van-grid-item
|
||||||
|
icon="setting-o"
|
||||||
|
text="物资管理"
|
||||||
|
:to="{
|
||||||
|
name: 'MaterialManage',
|
||||||
|
params: { data: encodeURIComponent(JSON.stringify(detailData)) },
|
||||||
|
}"
|
||||||
|
/>
|
||||||
<van-grid-item icon="setting-o" text="人员管理" to="/StaffManage" />
|
<van-grid-item icon="setting-o" text="人员管理" to="/StaffManage" />
|
||||||
<van-grid-item icon="setting-o" text="冰雪灾害" to="/IceHail" />
|
<van-grid-item icon="setting-o" text="冰雪灾害" to="/IceHail" />
|
||||||
</van-grid>
|
</van-grid>
|
||||||
@ -30,8 +37,8 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import 'vant/es/toast/style';
|
import "vant/es/toast/style";
|
||||||
import 'vant/es/popup/style';
|
import "vant/es/popup/style";
|
||||||
import { ref, onMounted } from "vue";
|
import { ref, onMounted } from "vue";
|
||||||
import { useRouter } from "vue-router";
|
import { useRouter } from "vue-router";
|
||||||
import { showToast } from "vant";
|
import { showToast } from "vant";
|
||||||
|
|||||||
84
packages/mobile/src/views/Material/MaterialDetails.vue
Normal file
84
packages/mobile/src/views/Material/MaterialDetails.vue
Normal file
@ -0,0 +1,84 @@
|
|||||||
|
<template>
|
||||||
|
<div class="home">
|
||||||
|
<van-nav-bar title="物资管理" fixed left-arrow @click-left="onClickLeft" />
|
||||||
|
|
||||||
|
<van-cell-group>
|
||||||
|
<van-cell title="当前站点" :value="''" />
|
||||||
|
</van-cell-group>
|
||||||
|
|
||||||
|
<div class="content">
|
||||||
|
<van-cell-group>
|
||||||
|
<van-cell
|
||||||
|
title="设备信息"
|
||||||
|
style="font-size: 18px; font-weight: bold; line-height: inherit"
|
||||||
|
>
|
||||||
|
</van-cell>
|
||||||
|
</van-cell-group>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
import "vant/es/toast/style";
|
||||||
|
import "vant/es/popup/style";
|
||||||
|
import { ref, onMounted, toRaw, reactive } 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 yhzDetail = ref({});
|
||||||
|
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
console.log('@@@@',decodeURIComponent(route.params.data));
|
||||||
|
yhzDetail.value = JSON.parse(decodeURIComponent(route.params.yhzDetail));
|
||||||
|
console.log('yhzDetail',toRaw(yhzDetail.value));
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
const onClickLeft = () => {
|
||||||
|
router.push({
|
||||||
|
name: "MaterialManage",
|
||||||
|
params: { data: encodeURIComponent(JSON.stringify(yhzDetail)) },
|
||||||
|
});
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.home {
|
||||||
|
padding-top: var(--van-nav-bar-height); /* 自动匹配导航栏高度 */
|
||||||
|
}
|
||||||
|
|
||||||
|
.content {
|
||||||
|
padding: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.grid {
|
||||||
|
margin-top: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn {
|
||||||
|
margin-top: 24px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.status-tag {
|
||||||
|
display: inline-block;
|
||||||
|
padding: 3px 8px;
|
||||||
|
border-radius: 4px;
|
||||||
|
color: white;
|
||||||
|
font-size: 12px;
|
||||||
|
}
|
||||||
|
.status-good {
|
||||||
|
background-color: #07c160;
|
||||||
|
}
|
||||||
|
.status-warning {
|
||||||
|
background-color: #ff976a;
|
||||||
|
}
|
||||||
|
.status-danger {
|
||||||
|
background-color: #ee0a24;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
||||||
@ -4,33 +4,35 @@
|
|||||||
</van-nav-bar>
|
</van-nav-bar>
|
||||||
<van-search
|
<van-search
|
||||||
shape="round"
|
shape="round"
|
||||||
:value="searchValue"
|
v-model="searchValue"
|
||||||
:show-action="false"
|
:show-action="false"
|
||||||
placeholder="请输入物资名称"
|
placeholder="请输入物资名称"
|
||||||
/>
|
/>
|
||||||
<van-cell-group>
|
<van-cell-group>
|
||||||
<van-cell title="当前站点" value="李家坝仓库" />
|
<van-cell title="当前站点" :value="yhzDetail.mc" />
|
||||||
</van-cell-group>
|
</van-cell-group>
|
||||||
|
|
||||||
<div class="content">
|
<div class="content">
|
||||||
<van-cell-group>
|
<van-cell-group>
|
||||||
<van-cell
|
<van-cell
|
||||||
title="融雪剂"
|
v-for="(item, index) in materialList"
|
||||||
|
:key="index"
|
||||||
|
:title="item.wzmc"
|
||||||
is-link
|
is-link
|
||||||
label="余量:2吨"
|
:label="`余量:${item.sl} (${item.dw})`"
|
||||||
|
:to="{
|
||||||
|
name: 'MaterialDetail',
|
||||||
|
params: {
|
||||||
|
yhzDetail: encodeURIComponent(JSON.stringify(yhzDetail.value)),
|
||||||
|
data: encodeURIComponent(JSON.stringify(item)),
|
||||||
|
},
|
||||||
|
}"
|
||||||
>
|
>
|
||||||
</van-cell>
|
</van-cell>
|
||||||
<van-cell title="警示标志杆(柱、牌)" is-link label="余量:131个">
|
|
||||||
</van-cell>
|
|
||||||
</van-cell-group>
|
</van-cell-group>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<van-button
|
<van-button type="primary" class="add-btn" icon="plus" @click="handleAdd">
|
||||||
type="primary"
|
|
||||||
class="add-btn"
|
|
||||||
icon="plus"
|
|
||||||
@click="handleAdd"
|
|
||||||
>
|
|
||||||
添加物资
|
添加物资
|
||||||
</van-button>
|
</van-button>
|
||||||
|
|
||||||
@ -51,13 +53,67 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref } from "vue";
|
import "vant/es/toast/style";
|
||||||
import { useRouter } from "vue-router";
|
import "vant/es/popup/style";
|
||||||
import { showToast } from "vant";
|
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";
|
||||||
|
import { pa } from "element-plus/es/locales.mjs";
|
||||||
|
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
|
const route = useRoute();
|
||||||
const searchValue = ref(""); // 搜索框输入值
|
const searchValue = ref(""); // 搜索框输入值
|
||||||
const showPopup = ref(false); // 控制弹出层显示隐藏
|
const showPopup = ref(false); // 控制弹出层显示隐藏
|
||||||
|
const yhzDetail = ref({}); // 养护站详情数据
|
||||||
|
const materialList = ref([]); // 物资列表数据
|
||||||
|
|
||||||
|
// 根据养护站rid获取物资列表
|
||||||
|
const getMaterialList = async (wzmc) => {
|
||||||
|
try {
|
||||||
|
const yhzid = yhzDetail.value.id;
|
||||||
|
if (!yhzid) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const data = {
|
||||||
|
yhzid,
|
||||||
|
wzmc,
|
||||||
|
paageNum: 1,
|
||||||
|
paageSize: 9999,
|
||||||
|
};
|
||||||
|
const res = await request({
|
||||||
|
url: "/snow-ops-platform/yjwz/list",
|
||||||
|
method: "GET",
|
||||||
|
params: data,
|
||||||
|
});
|
||||||
|
if (res.code && res.code === "00000") {
|
||||||
|
materialList.value = res.data.records;
|
||||||
|
} else {
|
||||||
|
throw new Error(res.message);
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
showToast({
|
||||||
|
type: "error",
|
||||||
|
message: error.message || "获取物资列表失败",
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// 组件挂载时获取数据
|
||||||
|
onMounted(() => {
|
||||||
|
yhzDetail.value = JSON.parse(decodeURIComponent(route.params.data));
|
||||||
|
getMaterialList();
|
||||||
|
console.log("yhzDetail", toRaw(yhzDetail.value));
|
||||||
|
});
|
||||||
|
|
||||||
|
watch(
|
||||||
|
() => searchValue.value,
|
||||||
|
(newVal, oldVal) => {
|
||||||
|
if (newVal !== oldVal) {
|
||||||
|
getMaterialList(newVal);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
const onClickLeft = () => {
|
const onClickLeft = () => {
|
||||||
router.push("/");
|
router.push("/");
|
||||||
@ -78,7 +134,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.content {
|
.content {
|
||||||
padding: 16px;
|
padding: 16px 16px 80px 16px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.content .van-cell-group .van-cell {
|
.content .van-cell-group .van-cell {
|
||||||
|
|||||||
@ -5,7 +5,7 @@ import Components from 'unplugin-vue-components/vite'
|
|||||||
import { VantResolver } from 'unplugin-vue-components/resolvers'
|
import { VantResolver } from 'unplugin-vue-components/resolvers'
|
||||||
|
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
base: '/bxztapp/',
|
// base: '/bxztapp/',
|
||||||
plugins: [
|
plugins: [
|
||||||
vue(),
|
vue(),
|
||||||
Components({
|
Components({
|
||||||
@ -26,6 +26,7 @@ export default defineConfig({
|
|||||||
'/snow-ops-platform': {
|
'/snow-ops-platform': {
|
||||||
target: 'http://8.137.54.85:8661/',
|
target: 'http://8.137.54.85:8661/',
|
||||||
changeOrigin: true,
|
changeOrigin: true,
|
||||||
|
rewrite: (path) => path.replace(/^\/snow-ops-platform/, ''),
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@ -6,7 +6,7 @@ import vue from '@vitejs/plugin-vue'
|
|||||||
import { resolve } from 'path'
|
import { resolve } from 'path'
|
||||||
|
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
base: '/bxztpc/',
|
// base: '/bxztpc/',
|
||||||
plugins: [
|
plugins: [
|
||||||
vue(),
|
vue(),
|
||||||
AutoImport({
|
AutoImport({
|
||||||
@ -30,6 +30,7 @@ export default defineConfig({
|
|||||||
'/snow-ops-platform': {
|
'/snow-ops-platform': {
|
||||||
target: 'http://8.137.54.85:8661/',
|
target: 'http://8.137.54.85:8661/',
|
||||||
changeOrigin: true,
|
changeOrigin: true,
|
||||||
|
rewrite: (path) => path.replace(/^\/snow-ops-platform/, '')
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user