2024-09-20 15:13:30 +08:00

60 lines
1.2 KiB
Vue

<template>
<view>
<uni-card>
<text>{{ title }}</text>
</uni-card>
<uni-list style="width: 100%">
<uni-list-item v-for="(item, index) in taskList" :key="index" :title="item.title" :note="item.note" :rightText="item.rightText"></uni-list-item>
</uni-list>
</view>
</template>
<script>
import { getTaskInfosByLine } from '@/api/preparationTask/index.js';
export default {
onLoad: function (option) {
this.taskCode = option.taskCode;
this.title = option.title;
},
onShow:function(){
this.$nextTick(() => {
this.doGetTaskInfoList();
});
},
data() {
return {
title:'',
taskCode: '',
taskList: []
};
},
methods: {
doGetTaskInfoList() {
uni.showLoading();
const params = {
task_code: this.taskCode
};
getTaskInfosByLine(params)
.then((res) => {
if (res.code === 200) {
this.taskList = res.data.map((item) => {
return {
id: item.id,
title: `物料号:${item.materialCode}`,
note: `描述:${item.materialName ?? ''} 规格:${item.specification ?? ''}`,
rightText: `配料数量:${item.quantity}`
};
});
}
})
.finally(() => {
uni.hideLoading();
});
}
}
};
</script>
<style></style>