345 lines
12 KiB
JavaScript
345 lines
12 KiB
JavaScript
"use strict";
|
||
const common_vendor = require("../../../common/vendor.js");
|
||
const common_assets = require("../../../common/assets.js");
|
||
const utils_api = require("../../../utils/api.js");
|
||
if (!Array) {
|
||
const _easycom_uni_search_bar2 = common_vendor.resolveComponent("uni-search-bar");
|
||
const _easycom_uni_goods_nav2 = common_vendor.resolveComponent("uni-goods-nav");
|
||
const _easycom_z_paging2 = common_vendor.resolveComponent("z-paging");
|
||
const _easycom_uni_nav_bar2 = common_vendor.resolveComponent("uni-nav-bar");
|
||
const _easycom_uni_datetime_picker2 = common_vendor.resolveComponent("uni-datetime-picker");
|
||
const _easycom_uni_section2 = common_vendor.resolveComponent("uni-section");
|
||
const _easycom_uni_data_checkbox2 = common_vendor.resolveComponent("uni-data-checkbox");
|
||
const _easycom_uni_drawer2 = common_vendor.resolveComponent("uni-drawer");
|
||
const _easycom_uni_easyinput2 = common_vendor.resolveComponent("uni-easyinput");
|
||
const _easycom_uni_forms_item2 = common_vendor.resolveComponent("uni-forms-item");
|
||
const _easycom_uni_forms2 = common_vendor.resolveComponent("uni-forms");
|
||
const _easycom_uni_popup2 = common_vendor.resolveComponent("uni-popup");
|
||
(_easycom_uni_search_bar2 + _easycom_uni_goods_nav2 + _easycom_z_paging2 + _easycom_uni_nav_bar2 + _easycom_uni_datetime_picker2 + _easycom_uni_section2 + _easycom_uni_data_checkbox2 + _easycom_uni_drawer2 + _easycom_uni_easyinput2 + _easycom_uni_forms_item2 + _easycom_uni_forms2 + _easycom_uni_popup2)();
|
||
}
|
||
const _easycom_uni_search_bar = () => "../../../node-modules/@dcloudio/uni-ui/lib/uni-search-bar/uni-search-bar.js";
|
||
const _easycom_uni_goods_nav = () => "../../../node-modules/@dcloudio/uni-ui/lib/uni-goods-nav/uni-goods-nav.js";
|
||
const _easycom_z_paging = () => "../../../uni_modules/z-paging/components/z-paging/z-paging.js";
|
||
const _easycom_uni_nav_bar = () => "../../../node-modules/@dcloudio/uni-ui/lib/uni-nav-bar/uni-nav-bar.js";
|
||
const _easycom_uni_datetime_picker = () => "../../../node-modules/@dcloudio/uni-ui/lib/uni-datetime-picker/uni-datetime-picker.js";
|
||
const _easycom_uni_section = () => "../../../node-modules/@dcloudio/uni-ui/lib/uni-section/uni-section.js";
|
||
const _easycom_uni_data_checkbox = () => "../../../node-modules/@dcloudio/uni-ui/lib/uni-data-checkbox/uni-data-checkbox.js";
|
||
const _easycom_uni_drawer = () => "../../../node-modules/@dcloudio/uni-ui/lib/uni-drawer/uni-drawer.js";
|
||
const _easycom_uni_easyinput = () => "../../../node-modules/@dcloudio/uni-ui/lib/uni-easyinput/uni-easyinput.js";
|
||
const _easycom_uni_forms_item = () => "../../../node-modules/@dcloudio/uni-ui/lib/uni-forms-item/uni-forms-item.js";
|
||
const _easycom_uni_forms = () => "../../../node-modules/@dcloudio/uni-ui/lib/uni-forms/uni-forms.js";
|
||
const _easycom_uni_popup = () => "../../../node-modules/@dcloudio/uni-ui/lib/uni-popup/uni-popup.js";
|
||
if (!Math) {
|
||
(_easycom_uni_search_bar + _easycom_uni_goods_nav + _easycom_z_paging + _easycom_uni_nav_bar + _easycom_uni_datetime_picker + _easycom_uni_section + _easycom_uni_data_checkbox + _easycom_uni_drawer + _easycom_uni_easyinput + _easycom_uni_forms_item + _easycom_uni_forms + _easycom_uni_popup)();
|
||
}
|
||
const _sfc_main = {
|
||
__name: "vehicleoperation",
|
||
setup(__props) {
|
||
const listdata = common_vendor.ref([]);
|
||
const popup = common_vendor.ref(null);
|
||
const typepopup = common_vendor.ref("center");
|
||
const navButtonGroup = [{
|
||
text: "批量投放",
|
||
backgroundColor: "rgb(0,120,212)",
|
||
color: "#fff"
|
||
}, {
|
||
text: "批量下架",
|
||
backgroundColor: "rgb(0,120,212)",
|
||
color: "#fff"
|
||
}];
|
||
common_vendor.ref("");
|
||
common_vendor.ref(0);
|
||
common_vendor.ref([
|
||
{
|
||
value: 0,
|
||
text: "四川"
|
||
},
|
||
{
|
||
value: 1,
|
||
text: "成都"
|
||
},
|
||
{
|
||
value: 2,
|
||
text: "武侯区"
|
||
}
|
||
]);
|
||
const customForm = common_vendor.ref(null);
|
||
const customFormData = common_vendor.ref({
|
||
reginvalue: 0,
|
||
deviceValues: ""
|
||
});
|
||
const customRules = common_vendor.ref({
|
||
reginvalue: {
|
||
rules: [{
|
||
required: true,
|
||
errorMessage: "运营区域不能为空"
|
||
}]
|
||
},
|
||
deviceValues: {
|
||
rules: [{
|
||
required: true,
|
||
errorMessage: "车辆编号不能为空!"
|
||
}]
|
||
}
|
||
});
|
||
common_vendor.ref(1);
|
||
common_vendor.ref(10);
|
||
const bikeCodeValue = common_vendor.ref("");
|
||
const enterTime = common_vendor.ref(null);
|
||
const statevalue = common_vendor.ref("1,2");
|
||
const sjztlist = common_vendor.ref([{
|
||
text: "全部",
|
||
value: "1,2"
|
||
}, {
|
||
text: "待投放",
|
||
value: 1
|
||
}, {
|
||
text: "已投放",
|
||
value: 2
|
||
}]);
|
||
const paging = common_vendor.ref(null);
|
||
common_vendor.ref("more");
|
||
const selectedItems = common_vendor.ref([]);
|
||
const usableHeight = common_vendor.ref(0);
|
||
common_vendor.onMounted(() => {
|
||
const systemInfo = common_vendor.index.getSystemInfoSync();
|
||
const screenHeight = systemInfo.screenHeight;
|
||
const statusBarHeight = systemInfo.statusBarHeight;
|
||
usableHeight.value = screenHeight - statusBarHeight - 170;
|
||
getUserRegionInfo();
|
||
});
|
||
const getUserRegionInfo = () => {
|
||
utils_api.callOperateApi("ebikeRegion/pageSite?pageNum=1&pageSize=20", {}, "get").then((res) => {
|
||
if (res.code == 200)
|
||
;
|
||
});
|
||
};
|
||
const checkboxGroupChange = (e) => {
|
||
selectedItems.value = e.target.value;
|
||
};
|
||
const opendetail = (id) => {
|
||
setTimeout(() => {
|
||
common_vendor.index.navigateTo({
|
||
url: `/pages/warehouse/ebikehouse/vehicleoperation_view?ebikeId_zcck=${id}`
|
||
//
|
||
});
|
||
}, 200);
|
||
};
|
||
const loadMoreData = (pageNo, pageSize) => {
|
||
const params = {
|
||
"bikeCode": bikeCodeValue.value,
|
||
//车辆编号
|
||
"enterTime": enterTime.value,
|
||
//入库时间 例:2025-03-21
|
||
"state": statevalue.value,
|
||
"pageParam": {
|
||
"pageNum": pageNo,
|
||
"pageSize": pageSize
|
||
}
|
||
};
|
||
utils_api.callEbikeInfo("pageQueryEbikeList", params).then((res) => {
|
||
if (res.code === 200) {
|
||
res.data.records;
|
||
paging.value.complete(res.data.records);
|
||
} else {
|
||
paging.value.complete(false);
|
||
}
|
||
});
|
||
};
|
||
const submit = (ref) => {
|
||
customForm.value.validate().then((res) => {
|
||
const params = {
|
||
"bikeCode": customFormData.value.deviceValues,
|
||
//车辆编号
|
||
"status": statusZT.value
|
||
//入库时间 例:2025-03-21
|
||
};
|
||
utils_api.callEbikeInfo("vehicleLeaveWarehouse", params).then((res2) => {
|
||
if (res2.code == 200) {
|
||
popup.value.close("center");
|
||
common_vendor.index.showToast({
|
||
title: "操作成功",
|
||
icon: "success",
|
||
duration: 2e3
|
||
});
|
||
searchInfo();
|
||
} else {
|
||
common_vendor.index.showToast({
|
||
title: "操作失败",
|
||
icon: "error",
|
||
duration: 2e3
|
||
});
|
||
}
|
||
});
|
||
}).catch((err) => {
|
||
common_vendor.index.__f__("log", "at pages/warehouse/ebikehouse/vehicleoperation.vue:266", "err", err);
|
||
});
|
||
};
|
||
const showRight = common_vendor.ref(null);
|
||
const showDrawer = (e) => {
|
||
const drawer = showRight.value;
|
||
drawer.open();
|
||
};
|
||
const closeDrawer = (e) => {
|
||
const drawer = showRight.value;
|
||
drawer.close();
|
||
searchInfo();
|
||
};
|
||
const searchInfo = () => {
|
||
paging.value.reload();
|
||
};
|
||
const statusZT = common_vendor.ref(1);
|
||
const changepopup = (e) => {
|
||
};
|
||
const navButtonClick = (res) => {
|
||
const {
|
||
index,
|
||
content
|
||
} = res;
|
||
if (index == 0) {
|
||
common_vendor.index.showModal({
|
||
title: "批量投放",
|
||
content: "您确定要进行投放操作吗?",
|
||
success: (res2) => {
|
||
if (res2.confirm) {
|
||
customFormData.value.deviceValues = selectedItems.value;
|
||
popup.value.open("center");
|
||
statusZT.value = 2;
|
||
} else if (res2.cancel)
|
||
;
|
||
}
|
||
});
|
||
} else if (index == 1) {
|
||
common_vendor.index.showModal({
|
||
title: "批量下架",
|
||
content: "您确定要进行下架操作吗?",
|
||
success: (res2) => {
|
||
if (res2.confirm) {
|
||
customFormData.value.deviceValues = selectedItems.value;
|
||
popup.value.open("center");
|
||
statusZT.value = 0;
|
||
} else if (res2.cancel)
|
||
;
|
||
}
|
||
});
|
||
}
|
||
};
|
||
return (_ctx, _cache) => {
|
||
return {
|
||
a: common_vendor.o(searchInfo),
|
||
b: common_vendor.o(_ctx.search),
|
||
c: common_vendor.o(($event) => bikeCodeValue.value = $event),
|
||
d: common_vendor.p({
|
||
radius: "5",
|
||
placeholder: "输入车辆编号查询",
|
||
modelValue: bikeCodeValue.value
|
||
}),
|
||
e: common_assets._imports_0$3,
|
||
f: common_vendor.o(($event) => showDrawer()),
|
||
g: common_vendor.f(listdata.value, (item, index, i0) => {
|
||
return common_vendor.e({
|
||
a: item.bikeCode,
|
||
b: common_vendor.o(() => {
|
||
}, index),
|
||
c: common_vendor.t(item.bikeCode),
|
||
d: item.state == 1
|
||
}, item.state == 1 ? {} : item.state == 2 ? {} : {}, {
|
||
e: item.state == 2,
|
||
f: common_vendor.o(($event) => opendetail(item.bikeId), index),
|
||
g: common_vendor.t(item.bikeCode),
|
||
h: common_vendor.t(item.bikeModel),
|
||
i: common_vendor.t(item.enterTime),
|
||
j: index
|
||
});
|
||
}),
|
||
h: common_vendor.o(checkboxGroupChange),
|
||
i: common_vendor.o(navButtonClick),
|
||
j: common_vendor.p({
|
||
fill: true,
|
||
options: [],
|
||
buttonGroup: navButtonGroup
|
||
}),
|
||
k: common_vendor.sr(paging, "0fce36cd-0", {
|
||
"k": "paging"
|
||
}),
|
||
l: common_vendor.o(loadMoreData),
|
||
m: common_vendor.o(($event) => listdata.value = $event),
|
||
n: common_vendor.p({
|
||
["default-page-no"]: 1,
|
||
["default-page-size"]: 4,
|
||
["auto-show-back-to-top"]: true,
|
||
modelValue: listdata.value
|
||
}),
|
||
o: common_vendor.o(($event) => closeDrawer()),
|
||
p: common_vendor.o(($event) => closeDrawer()),
|
||
q: common_vendor.p({
|
||
["left-icon"]: "left",
|
||
leftText: "返回",
|
||
rightText: "X",
|
||
title: "筛选"
|
||
}),
|
||
r: common_vendor.o(($event) => enterTime.value = $event),
|
||
s: common_vendor.p({
|
||
type: "date",
|
||
["return-type"]: "timestamp",
|
||
modelValue: enterTime.value
|
||
}),
|
||
t: common_vendor.p({
|
||
title: "入库时间",
|
||
type: "line"
|
||
}),
|
||
v: common_vendor.o(($event) => statevalue.value = $event),
|
||
w: common_vendor.p({
|
||
mode: "tag",
|
||
localdata: sjztlist.value,
|
||
modelValue: statevalue.value
|
||
}),
|
||
x: common_vendor.p({
|
||
title: "状态",
|
||
type: "line"
|
||
}),
|
||
y: common_vendor.sr(showRight, "0fce36cd-3", {
|
||
"k": "showRight"
|
||
}),
|
||
z: common_vendor.p({
|
||
mode: "right",
|
||
["mask-click"]: false
|
||
}),
|
||
A: common_vendor.o(($event) => customFormData.value.deviceValues = $event),
|
||
B: common_vendor.p({
|
||
type: "textarea",
|
||
placeholder: "请输入车辆编号,用逗号(,)隔开,一次最多添加1000个",
|
||
modelValue: customFormData.value.deviceValues
|
||
}),
|
||
C: common_vendor.p({
|
||
required: true,
|
||
name: "deviceValues"
|
||
}),
|
||
D: common_vendor.p({
|
||
title: "请添加设备",
|
||
type: "line"
|
||
}),
|
||
E: common_vendor.sr(customForm, "0fce36cd-10,0fce36cd-9", {
|
||
"k": "customForm"
|
||
}),
|
||
F: common_vendor.p({
|
||
rules: customRules.value,
|
||
modelValue: customFormData.value
|
||
}),
|
||
G: common_vendor.o(submit),
|
||
H: typepopup.value === "left" || typepopup.value === "right" ? 1 : "",
|
||
I: common_vendor.sr(popup, "0fce36cd-9", {
|
||
"k": "popup"
|
||
}),
|
||
J: common_vendor.o(changepopup),
|
||
K: common_vendor.p({
|
||
["background-color"]: "#fff"
|
||
})
|
||
};
|
||
};
|
||
}
|
||
};
|
||
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-0fce36cd"]]);
|
||
wx.createPage(MiniProgramPage);
|
||
//# sourceMappingURL=../../../../.sourcemap/mp-weixin/pages/warehouse/ebikehouse/vehicleoperation.js.map
|