331 lines
13 KiB
JavaScript
331 lines
13 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_data_select2 = common_vendor.resolveComponent("uni-data-select");
|
||
const _easycom_uni_forms_item2 = common_vendor.resolveComponent("uni-forms-item");
|
||
const _easycom_uni_easyinput2 = common_vendor.resolveComponent("uni-easyinput");
|
||
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_data_select2 + _easycom_uni_forms_item2 + _easycom_uni_easyinput2 + _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_data_select = () => "../../../node-modules/@dcloudio/uni-ui/lib/uni-data-select/uni-data-select.js";
|
||
const _easycom_uni_forms_item = () => "../../../node-modules/@dcloudio/uni-ui/lib/uni-forms-item/uni-forms-item.js";
|
||
const _easycom_uni_easyinput = () => "../../../node-modules/@dcloudio/uni-ui/lib/uni-easyinput/uni-easyinput.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_data_select + _easycom_uni_forms_item + _easycom_uni_easyinput + _easycom_uni_forms + _easycom_uni_popup)();
|
||
}
|
||
const _sfc_main = {
|
||
__name: "ebikehouse",
|
||
setup(__props) {
|
||
const listdata = common_vendor.ref([]);
|
||
const popup = common_vendor.ref(null);
|
||
const typepopup = common_vendor.ref("center");
|
||
common_vendor.ref(0);
|
||
const navButtonGroup = [{
|
||
text: "批量上架",
|
||
backgroundColor: "rgb(0,120,212)",
|
||
color: "#fff"
|
||
}];
|
||
common_vendor.ref(false);
|
||
const paging = common_vendor.ref(null);
|
||
const regindata = common_vendor.ref([]);
|
||
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: "车辆编号不能为空!"
|
||
}]
|
||
}
|
||
});
|
||
const bikeCodeValue = common_vendor.ref("");
|
||
const enterTime = common_vendor.ref(null);
|
||
const statevalue = common_vendor.ref("0,4");
|
||
const statusZT = common_vendor.ref(0);
|
||
const sjztlist = common_vendor.ref([{
|
||
text: "全部",
|
||
value: "0,4"
|
||
}, {
|
||
text: "待维修",
|
||
value: 4
|
||
}, {
|
||
text: "待出库",
|
||
value: 0
|
||
}]);
|
||
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;
|
||
let userZone = common_vendor.index.getStorageSync("userZone");
|
||
userZone.forEach((res) => {
|
||
let quyuemap = {
|
||
"text": res.name,
|
||
"value": res.id
|
||
};
|
||
regindata.value.push(quyuemap);
|
||
});
|
||
});
|
||
const checkboxGroupChange = (e) => {
|
||
selectedItems.value = e.target.value;
|
||
};
|
||
const opendetail = (id) => {
|
||
common_vendor.index.setStorageSync("ebikeId_zcck", id);
|
||
setTimeout(() => {
|
||
common_vendor.index.navigateTo({
|
||
url: `/pages/warehouse/ebikehouse/ebikehouse_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/ebikehouse.vue:260", "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 changeZT = (e) => {
|
||
common_vendor.index.__f__("log", "at pages/warehouse/ebikehouse/ebikehouse.vue:293", "e:", e);
|
||
};
|
||
const changepopup = (e) => {
|
||
};
|
||
const navButtonClick = (index, content) => {
|
||
common_vendor.index.showModal({
|
||
title: "确认上架",
|
||
content: "您确定要进行上架操作吗?",
|
||
success: (res) => {
|
||
if (res.confirm) {
|
||
customFormData.value.deviceValues = selectedItems.value;
|
||
popup.value.open("center");
|
||
statusZT.value = 1;
|
||
} else if (res.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.state == 4
|
||
}, item.state == 4 ? {} : {
|
||
b: item.bikeCode,
|
||
c: common_vendor.o(() => {
|
||
}, index)
|
||
}, {
|
||
d: common_vendor.t(item.bikeCode),
|
||
e: item.state == 0
|
||
}, item.state == 0 ? {} : item.state == 4 ? {} : {}, {
|
||
f: item.state == 4,
|
||
g: common_vendor.o(($event) => opendetail(item.bikeId), index),
|
||
h: common_vendor.t(item.bikeCode),
|
||
i: common_vendor.t(item.bikeModel),
|
||
j: common_vendor.t(item.enterTime),
|
||
k: 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, "f83ad056-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, "f83ad056-3", {
|
||
"k": "showRight"
|
||
}),
|
||
z: common_vendor.p({
|
||
mode: "right",
|
||
["mask-click"]: false
|
||
}),
|
||
A: common_vendor.o(changeZT),
|
||
B: common_vendor.o(($event) => customFormData.value.reginvalue = $event),
|
||
C: common_vendor.p({
|
||
localdata: regindata.value,
|
||
modelValue: customFormData.value.reginvalue
|
||
}),
|
||
D: common_vendor.p({
|
||
required: true,
|
||
name: "reginvalue"
|
||
}),
|
||
E: common_vendor.p({
|
||
title: "运营区域",
|
||
type: "line"
|
||
}),
|
||
F: common_vendor.o(($event) => customFormData.value.deviceValues = $event),
|
||
G: common_vendor.p({
|
||
type: "textarea",
|
||
placeholder: "请输入车辆编号,用逗号(,)隔开,一次最多添加1000个",
|
||
modelValue: customFormData.value.deviceValues
|
||
}),
|
||
H: common_vendor.p({
|
||
required: true,
|
||
name: "deviceValues"
|
||
}),
|
||
I: common_vendor.p({
|
||
title: "请添加设备",
|
||
type: "line"
|
||
}),
|
||
J: common_vendor.sr(customForm, "f83ad056-10,f83ad056-9", {
|
||
"k": "customForm"
|
||
}),
|
||
K: common_vendor.p({
|
||
rules: customRules.value,
|
||
modelValue: customFormData.value
|
||
}),
|
||
L: common_vendor.o(submit),
|
||
M: typepopup.value === "left" || typepopup.value === "right" ? 1 : "",
|
||
N: common_vendor.sr(popup, "f83ad056-9", {
|
||
"k": "popup"
|
||
}),
|
||
O: common_vendor.o(changepopup),
|
||
P: common_vendor.p({
|
||
["background-color"]: "#fff"
|
||
})
|
||
};
|
||
};
|
||
}
|
||
};
|
||
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-f83ad056"]]);
|
||
wx.createPage(MiniProgramPage);
|
||
//# sourceMappingURL=../../../../.sourcemap/mp-weixin/pages/warehouse/ebikehouse/ebikehouse.js.map
|