|
|
|
|
@ -57,7 +57,7 @@
|
|
|
|
|
<el-text>{{ item.weight }} </el-text>
|
|
|
|
|
</el-col>
|
|
|
|
|
</el-row>
|
|
|
|
|
<el-row v-for="(item2, index2) in handleDraftClick(item.id,index)" :key="index2" class="u-m-b-30">
|
|
|
|
|
<el-row v-for="(item2, index2) in draftList[index].detailList" :key="index2" class="u-m-b-30">
|
|
|
|
|
<el-col :span="8">原料:
|
|
|
|
|
<el-text type="warning">{{item2.itemName}}</el-text>
|
|
|
|
|
</el-col>
|
|
|
|
|
@ -87,7 +87,6 @@
|
|
|
|
|
<u-list-item
|
|
|
|
|
v-for="(item, index) in finishList"
|
|
|
|
|
:key="item"
|
|
|
|
|
@click="handleFinishClick(item.id,index)"
|
|
|
|
|
>
|
|
|
|
|
<view class="content">
|
|
|
|
|
<view class="header">
|
|
|
|
|
@ -113,7 +112,7 @@
|
|
|
|
|
<el-text>{{ item.weight }} </el-text>
|
|
|
|
|
</el-col>
|
|
|
|
|
</el-row>
|
|
|
|
|
<el-row v-for="(item2, index2) in handleFinishClick(item.id,index)" :key="index2" class="u-m-b-30">
|
|
|
|
|
<el-row v-for="(item2, index2) in finishList[index].detailList" :key="index2" class="u-m-b-30">
|
|
|
|
|
<el-col :span="8">原料:
|
|
|
|
|
<el-text type="warning">{{item2.itemName}}</el-text>
|
|
|
|
|
</el-col>
|
|
|
|
|
@ -133,14 +132,15 @@
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script setup>
|
|
|
|
|
import { ref, onMounted } from 'vue';
|
|
|
|
|
import { ref } from 'vue';
|
|
|
|
|
import { getRecordList, updateStatus, deleteById, getDetailByRecordId } from "@/api/mes/record"
|
|
|
|
|
import { timestampToTime } from "@/utils/dateUtil";
|
|
|
|
|
import { pipelineTypes,feedingTypes, findTextByValue} from "@/api/system/dict/data";
|
|
|
|
|
import modal from "@/plugins/modal";
|
|
|
|
|
import tab from "@/plugins/tab";
|
|
|
|
|
import {showConfirm} from "@/utils/common";
|
|
|
|
|
import { showConfirm } from "@/utils/common";
|
|
|
|
|
import auth from "@/plugins/auth";
|
|
|
|
|
import { onLoad } from "@dcloudio/uni-app";
|
|
|
|
|
|
|
|
|
|
const menuList = ref([
|
|
|
|
|
{
|
|
|
|
|
@ -154,6 +154,11 @@ const menuList = ref([
|
|
|
|
|
const current = ref(0)
|
|
|
|
|
const change = (index)=>{
|
|
|
|
|
current.value = index.index
|
|
|
|
|
if(current.value === 0) {
|
|
|
|
|
getDraftList()
|
|
|
|
|
} else {
|
|
|
|
|
getFinishList()
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//已经提交的列表
|
|
|
|
|
@ -168,28 +173,28 @@ const pattern = {
|
|
|
|
|
iconColor: '#fff'
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
onMounted(() => {
|
|
|
|
|
getList()
|
|
|
|
|
});
|
|
|
|
|
// 加载列表数据
|
|
|
|
|
function getList() {
|
|
|
|
|
function getFinishList() {
|
|
|
|
|
getRecordList("2").then(response => {
|
|
|
|
|
finishList.value = response.data
|
|
|
|
|
finishList.value.forEach((item, index) => {
|
|
|
|
|
getDetailByRecordId(item.id).then(response => {
|
|
|
|
|
finishList.value[index].detailList = response.data
|
|
|
|
|
})
|
|
|
|
|
getRecordList("1").then(response => {
|
|
|
|
|
draftList.value = response.data
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
function handleFinishClick(id, index){
|
|
|
|
|
getDetailByRecordId(id).then(response => {
|
|
|
|
|
finishList.value[index].detailList = response.data
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
function handleDraftClick(id, index){
|
|
|
|
|
getDetailByRecordId(id).then(response => {
|
|
|
|
|
function getDraftList(){
|
|
|
|
|
getRecordList("1").then(response => {
|
|
|
|
|
draftList.value = response.data
|
|
|
|
|
draftList.value.forEach((item,index)=>{
|
|
|
|
|
getDetailByRecordId(item.id).then(response => {
|
|
|
|
|
draftList.value[index].detailList = response.data
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/** 提交 */
|
|
|
|
|
function handleUpdate(id){
|
|
|
|
|
showConfirm("确认提交投料记录吗?").then(res => {
|
|
|
|
|
@ -207,7 +212,7 @@ function handleDelete(id){
|
|
|
|
|
if (res.confirm) {
|
|
|
|
|
deleteById(id).then(response => {
|
|
|
|
|
modal.msgSuccess("操作成功")
|
|
|
|
|
getList()
|
|
|
|
|
getDraftList()
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
@ -217,6 +222,15 @@ function handleDelete(id){
|
|
|
|
|
function handleAdd(){
|
|
|
|
|
tab.navigateTo('/page_record/feedingRecordForm')
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
onLoad(() => {
|
|
|
|
|
getDraftList()
|
|
|
|
|
uni.$on('saveDraft', data => {
|
|
|
|
|
if (data) {
|
|
|
|
|
getDraftList();
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<style scoped lang="scss">
|
|
|
|
|
|