You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
143 lines
4.5 KiB
143 lines
4.5 KiB
"use strict"; |
|
const common_vendor = require("../../../common/vendor.js"); |
|
if (!Array) { |
|
const _easycom_u_navbar2 = common_vendor.resolveComponent("u-navbar"); |
|
const _component_tips = common_vendor.resolveComponent("tips"); |
|
const _component_tiplist = common_vendor.resolveComponent("tiplist"); |
|
const _component_saomiao2 = common_vendor.resolveComponent("saomiao2"); |
|
(_easycom_u_navbar2 + _component_tips + _component_tiplist + _component_saomiao2)(); |
|
} |
|
const _easycom_u_navbar = () => "../../../uni_modules/uview-plus/components/u-navbar/u-navbar.js"; |
|
if (!Math) { |
|
_easycom_u_navbar(); |
|
} |
|
const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({ |
|
__name: "createTask", |
|
setup(__props) { |
|
let details = common_vendor.reactive({ |
|
taskname: "", |
|
scandate: [], |
|
editindex: "" |
|
}); |
|
const tiplists = common_vendor.ref(null); |
|
const tip = common_vendor.ref(null); |
|
common_vendor.onLoad((op) => { |
|
details.taskname = op.name; |
|
details.editindex = op.editindex; |
|
if (details.editindex) { |
|
details.scandate = common_vendor.index.getStorageSync("HistoryDate")[details.editindex]["numberarr"]; |
|
} |
|
common_vendor.index.$on("scancodedate", function(code) { |
|
if (code) { |
|
console.log(code); |
|
details.scandate.push(code); |
|
} |
|
}); |
|
}); |
|
function inputnumb() { |
|
tiplists.value.setdetails({ |
|
tipstate: 1, |
|
title: "请输入包件码", |
|
placeholder: "请输入包件码", |
|
inputtext: "", |
|
isshow: true, |
|
success: (detai) => { |
|
details.scandate.push(detai.inputtext); |
|
tiplists.value.setdetails({ isshow: false }); |
|
}, |
|
cancel: () => { |
|
tiplists.value.setdetails({ isshow: false }); |
|
}, |
|
close: () => { |
|
tiplists.value.setdetails({ isshow: false }); |
|
} |
|
}); |
|
} |
|
function submitsave() { |
|
if (details.scandate.length == 0) { |
|
common_vendor.index.showToast({ |
|
title: "请先扫描包件码再进行保存", |
|
duration: 1500, |
|
icon: "none" |
|
}); |
|
return; |
|
} |
|
if (!details.editindex) { |
|
let HistoryDatearr = common_vendor.index.getStorageSync("HistoryDate"); |
|
if (HistoryDatearr) { |
|
HistoryDatearr.push({ |
|
name: details.taskname, |
|
numberarr: details.scandate |
|
}); |
|
} else { |
|
HistoryDatearr = [{ |
|
name: details.taskname, |
|
numberarr: details.scandate |
|
}]; |
|
} |
|
common_vendor.index.setStorageSync("HistoryDate", HistoryDatearr); |
|
} else { |
|
let HistoryDatearr = common_vendor.index.getStorageSync("HistoryDate"); |
|
HistoryDatearr.splice(Number(details.editindex), 1, { |
|
name: details.taskname, |
|
numberarr: details.scandate |
|
}); |
|
common_vendor.index.setStorageSync("HistoryDate", HistoryDatearr); |
|
} |
|
common_vendor.index.showToast({ |
|
title: "保存成功", |
|
duration: 1500, |
|
icon: "none" |
|
}); |
|
setTimeout(() => { |
|
common_vendor.index.navigateBack(); |
|
}, 1500); |
|
} |
|
function remove(index) { |
|
tip.value.setdetails({ |
|
content: "确认删除?", |
|
isshow: true, |
|
confirmTxt: "删除", |
|
success: () => { |
|
details.scandate.splice(index, 1); |
|
tip.value.setdetails({ isshow: false }); |
|
}, |
|
cancel: () => { |
|
tip.value.setdetails({ isshow: false }); |
|
}, |
|
close: () => { |
|
tip.value.setdetails({ isshow: false }); |
|
} |
|
}); |
|
} |
|
return (_ctx, _cache) => { |
|
return { |
|
a: common_vendor.p({ |
|
title: "离线扫描", |
|
bgColor: "#D3832A", |
|
leftIconColor: "#ffffff", |
|
titleStyle: "color:#ffffff", |
|
placeholder: true, |
|
autoBack: true, |
|
leftIconSize: "35" |
|
}), |
|
b: common_vendor.f(common_vendor.unref(details).scandate, (item, index, i0) => { |
|
return { |
|
a: common_vendor.t(item), |
|
b: common_vendor.o(($event) => remove(index)) |
|
}; |
|
}), |
|
c: common_vendor.o(inputnumb), |
|
d: common_vendor.o(submitsave), |
|
e: common_vendor.sr(tip, "04604260-1", { |
|
"k": "tip" |
|
}), |
|
f: common_vendor.sr(tiplists, "04604260-2", { |
|
"k": "tiplists" |
|
}) |
|
}; |
|
}; |
|
} |
|
}); |
|
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__file", "F:/物流/logPm/pagesHome/pages/createTask/createTask.vue"]]); |
|
wx.createPage(MiniProgramPage);
|
|
|