fix: 新增后页面没有刷新bug以及投料页面详情不显示bug。

main
sunshine 2 years ago
parent cab3cba37c
commit 28ae1cd079

@ -138,13 +138,12 @@ export default {
create(this.formData).then(response => {
modal.msgSuccess("保存成功")
tab.navigateBack()
uni.$emit('saveDraft', true)
})
}
})
}
}).catch(err => {
console.log('err', err);
})
}).catch(err => {})
},
handleTypeChange(e){
this.formData.feedingType =e.detail.value;

@ -44,7 +44,9 @@
:percentage="Number((item.totalQualityNumber / planDo.planNumber) * 100).toFixed(2)"
active-color="#50E0C1"
inactive-color="rgba(139, 237, 215, 0.47)"
/>
>
<text class="u-percentage-slot">{{Number((item.totalQualityNumber / planDo.planNumber) * 100).toFixed(2)}}%</text>
</u-line-progress>
</uni-td>
<uni-td>
<view class="name">{{ item.totalWasteNumber }}</view>
@ -103,4 +105,9 @@ export default {
box-shadow: 0 1px 1px 0 rgba(0, 72, 145, 0.1),
0 0.5px 0 0 rgba(0, 0, 0, 0.1);
}
.u-percentage-slot {
font-size: 10px;
margin-left: 30px;
}
</style>

@ -230,6 +230,8 @@ export default {
createReport(this.customFormData).then(response => {
modal.msgSuccess("保存成功")
tab.navigateBack()
//
uni.$emit('success', true)
})
}
}

@ -227,6 +227,8 @@ export default {
createReport(this.customFormData).then(response => {
modal.msgSuccess("保存成功")
tab.switchTab('/pages/report')
//
uni.$emit('handleSuccess', true)
})
}
}

@ -200,7 +200,17 @@ export default {
onLoad() {
this.loading = true
this.getList();
uni.$on('handleSuccess', data => {
if (data) {
this.getList();
}
});
this.getReplaceReportList()
uni.$on('success', data => {
if (data) {
this.getReplaceReportList();
}
});
this.getOtherReportList()
this.getUserList()
this.loading = false

@ -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,7 +132,7 @@
</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";
@ -141,6 +140,7 @@ import modal from "@/plugins/modal";
import tab from "@/plugins/tab";
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">

@ -8,7 +8,7 @@
<text class="point">.</text>
<text class="title">报工报表</text>
</view>
<uni-data-select v-if="auth.hasPermi('mes:produce-report-detail:replace')" class="select" v-model="userId" :localdata="userList" placement="top" @change="handleChange()">
<uni-data-select v-if="auth.hasPermi('mes:produce-report-detail:replace')" class="select" v-model="userId" :localdata="userList" placement="top">
</uni-data-select>
<view class="top_desc">
<view>
@ -104,7 +104,7 @@ import dataOne from '@/pages/json/1.json';
import { getDayReportTime, getLastMonthSum, getReportTime, getSumReportTime, getThisMonthSum } from "@/api/mes/report";
import useUserStore from "@/store/modules/user";
import Config from '@/pages/js/config'
import { ref } from 'vue';
import { ref, watch } from 'vue';
import { onLoad } from "@dcloudio/uni-app";
import auth from "@/plugins/auth";
import {getOtherPersonalUser} from "@/api/mes/organization";
@ -117,7 +117,8 @@ const nowTime = {
};
const useStore = useUserStore()
const userId = ref(useStore.userId)
const userId = ref()
userId.value = useStore.userId
const isCanvas2d = ref(Config.ISCANVAS2D)
let delayload = ref(false);
@ -161,6 +162,12 @@ const handleChange = ()=>{
getDayReportTimeList()
}
watch(()=>userId.value, (newValue)=> {
if (newValue) {
handleChange()
}
})
const changeHistoryBtn = (type) => {
historyBtn.value.forEach(btn => {
btn.state = false;

Loading…
Cancel
Save