|
|
@@ -108,7 +108,7 @@ function onSelect(e) {
|
|
|
}
|
|
|
|
|
|
const list = ref([]);
|
|
|
-
|
|
|
+let sa_aftersalesbomid = ""
|
|
|
onLoad(() => {
|
|
|
console.log("$Http.basicsData", result)
|
|
|
uni.setNavigationBarTitle({
|
|
|
@@ -130,7 +130,9 @@ onLoad(() => {
|
|
|
getList(true);
|
|
|
} else {
|
|
|
// 存在BOM
|
|
|
- getBomList();
|
|
|
+ sa_aftersalesbomid = res.data;
|
|
|
+ getList(true);
|
|
|
+ // getBomList();
|
|
|
}
|
|
|
})
|
|
|
})
|
|
|
@@ -164,12 +166,61 @@ function changeCollapse(e, id) {
|
|
|
}, 330);
|
|
|
}
|
|
|
|
|
|
+function getList(init = false) {
|
|
|
+ if (isBom.value) return;
|
|
|
+ if (content.loading) return;
|
|
|
+ if (init) content.pageNumber = 1;
|
|
|
+ content.loading = true;
|
|
|
+ try {
|
|
|
+ if (sa_aftersalesbomid) {
|
|
|
+ content.itemid = $Http.workDetail.itemid
|
|
|
+ content.sa_orderid = $Http.workDetail.sa_orderid
|
|
|
+ } else {
|
|
|
+ delete content.itemid;
|
|
|
+ delete content.sa_orderid;
|
|
|
+ }
|
|
|
+ } catch (error) {
|
|
|
+
|
|
|
+ }
|
|
|
+ $Http.basic({
|
|
|
+ id: sa_aftersalesbomid ? 2025080511204503 : 2025080610425103,
|
|
|
+ content
|
|
|
+ }).then(res => {
|
|
|
+ console.log("获取配件列表", res)
|
|
|
+ content.loading = false;
|
|
|
+ listBox.value.refreshToComplete();
|
|
|
+ listBox.value.setHeight();
|
|
|
+ if (res.data.length == 0 && res.pageNumber == 2 && sa_aftersalesbomid) {
|
|
|
+ sa_aftersalesbomid = "";
|
|
|
+ getList(true);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ res.data = res.data.map(item => {
|
|
|
+ item.imageUrl = item.attinfos.length ? $Http.getSpecifiedImage(item.attinfos[0]) : ''
|
|
|
+ return item;
|
|
|
+ });
|
|
|
+ if (res.code == 1) {
|
|
|
+ list.value = reactive(res.firstPage ? res.data : list.value.concat(res.data));
|
|
|
+ content.pageTotal = res.pageTotal;
|
|
|
+ content.pageNumber = res.pageNumber;
|
|
|
+ } else {
|
|
|
+ if (res.msg) uni.showToast({
|
|
|
+ title: res.msg,
|
|
|
+ icon: 'none'
|
|
|
+ });
|
|
|
+ }
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
// 有bom
|
|
|
function getBomList() {
|
|
|
+
|
|
|
+
|
|
|
+ return;
|
|
|
$Http.basic({
|
|
|
"id": "2025080610425503",
|
|
|
content: {
|
|
|
- "sa_aftersalesbomid": content.sa_workorderid,
|
|
|
+ sa_aftersalesbomid,
|
|
|
"sys_enterpriseid": content.sys_enterpriseid,
|
|
|
}
|
|
|
}).then(res => {
|
|
|
@@ -178,10 +229,10 @@ function getBomList() {
|
|
|
listBox.value.setHeight();
|
|
|
if (res.code == 1) {
|
|
|
// 判断有无数据
|
|
|
- if(res.pageNumber==2 && res.data[0].bom.length == 0){
|
|
|
+ if (res.pageNumber == 2 && res.data[0].bom.length == 0) {
|
|
|
getList(true);
|
|
|
return;
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
isBom.value = true;
|
|
|
bomList.value = processBomData(res.data)
|
|
|
}
|
|
|
@@ -245,36 +296,6 @@ function onSearch(e) {
|
|
|
keyword.value = e;
|
|
|
getList(true);
|
|
|
}
|
|
|
-
|
|
|
-function getList(init = false) {
|
|
|
- if (isBom.value) return;
|
|
|
- if (content.loading) return;
|
|
|
- if (init) content.pageNumber = 1;
|
|
|
- content.loading = true;
|
|
|
- $Http.basic({
|
|
|
- "id": "2025080610425103",
|
|
|
- content
|
|
|
- }).then(res => {
|
|
|
- console.log("获取配件列表", res)
|
|
|
- content.loading = false;
|
|
|
- listBox.value.refreshToComplete();
|
|
|
- listBox.value.setHeight();
|
|
|
- res.data = res.data.map(item => {
|
|
|
- item.imageUrl = item.attinfos.length ? $Http.getSpecifiedImage(item.attinfos[0]) : ''
|
|
|
- return item;
|
|
|
- });
|
|
|
- if (res.code == 1) {
|
|
|
- list.value = reactive(res.firstPage ? res.data : list.value.concat(res.data));
|
|
|
- content.pageTotal = res.pageTotal;
|
|
|
- content.pageNumber = res.pageNumber;
|
|
|
- } else {
|
|
|
- if (res.msg) uni.showToast({
|
|
|
- title: res.msg,
|
|
|
- icon: 'none'
|
|
|
- });
|
|
|
- }
|
|
|
- })
|
|
|
-}
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|