add record detail

main
chenshuichuan 2 years ago
parent 7425d09f36
commit c40fe153e1

@ -48,7 +48,7 @@ export function deleteById(id) {
// 查询明细列表 // 查询明细列表
export function getDetailByRecordId(id) { export function getDetailByRecordId(id) {
return request({ return request({
url: '/admin-api/mes/feeding-record/feeding-record-detail/list-by-record-id?id='+id, url: '/admin-api/mes/feeding-record/feeding-record-detail/list-by-record-id?recordId='+id,
method: 'get' method: 'get'
}) })
} }

@ -63,7 +63,12 @@ export const groupTypes = [
{text: '白班', value: 1}, {text: '夜班', value: 2}, {text: '白班', value: 1}, {text: '夜班', value: 2},
{text: '长白班', value: 3} {text: '长白班', value: 3}
] ]
export const pipelineTypes = [
{text: '2立方制浆', value: 'zhijiang2'}, {text: '5立方制浆', value: 'zhijiang5'}
]
export const feedingTypes = [
{text: '领料', value: 'org'}, {text: '干废品', value: 'dry'}, {text: '湿废品', value: 'wet'}
]
export function findTextByValue(enums,value){ export function findTextByValue(enums,value){
const foundItem = enums.find(item => item.value === value); const foundItem = enums.find(item => item.value === value);
return foundItem ? foundItem.text : null; return foundItem ? foundItem.text : null;

@ -1,7 +1,7 @@
// 应用全局配置 // 应用全局配置
const config = { const config = {
// baseUrl: 'http://47.106.185.127:48080',127.0.0.1 // baseUrl: 'http://47.106.185.127:48080',127.0.0.1
baseUrl: 'http://47.106.185.127:48080', baseUrl: 'http://127.0.0.1:48080',
// 应用信息 // 应用信息
appInfo: { appInfo: {
// 应用名称 // 应用名称

@ -15,7 +15,8 @@
{ {
"path": "pages/index", "path": "pages/index",
"style": { "style": {
"navigationBarTitleText": "生产计划" "navigationBarTitleText": "生产计划",
"enablePullDownRefresh": true
} }
}, },
{ {
@ -27,7 +28,8 @@
{ {
"path": "pages/work", "path": "pages/work",
"style": { "style": {
"navigationBarTitleText": "工作台" "navigationBarTitleText": "近三天投料记录",
"enablePullDownRefresh": true
} }
}, },
@ -52,7 +54,8 @@
{ {
"path": "pages/report", "path": "pages/report",
"style": { "style": {
"navigationBarTitleText": "生产报工" "navigationBarTitleText": "生产报工",
"enablePullDownRefresh": true
} }
} }
], ],

@ -1,9 +1,8 @@
<template> <template>
<view > <view >
<uni-notice-bar show-icon scrollable <uni-notice-bar show-icon scrollable text="安全生产!有序生产!高效生产!" />
text="安全生产!有序生产!高效生产!" />
<!-- 开工中--> <uni-section title="开工中" type="line" title-color="#18bc37"> </uni-section>
<uni-section title="开工中" type="line" title-color="#18bc37"></uni-section>
<el-collapse accordion> <el-collapse accordion>
<el-collapse-item v-for="(item, index) in startList" :name="item.id"> <el-collapse-item v-for="(item, index) in startList" :name="item.id">
<template #title> <template #title>
@ -134,7 +133,6 @@
<el-text>备注:{{ item.remark }}</el-text> <el-text>备注:{{ item.remark }}</el-text>
</el-collapse-item> </el-collapse-item>
</el-collapse> </el-collapse>
<!-- <view class="charts-box">--> <!-- <view class="charts-box">-->
<!-- <qiun-data-charts :chartData="chartData" type="column"/>--> <!-- <qiun-data-charts :chartData="chartData" type="column"/>-->
<!-- </view>--> <!-- </view>-->

@ -5,34 +5,33 @@
<!-- 已提交--> <!-- 已提交-->
<uni-section title="已提交" type="line" title-color="#18bc37"></uni-section> <uni-section title="已提交" type="line" title-color="#18bc37"></uni-section>
<el-collapse accordion> <el-collapse accordion>
<el-collapse-item v-for="(item, index) in finishList" :name="item.id"> <el-collapse-item v-for="(item, index) in finishList" :name="item.id" @click="handleFinishClick(item.id,index)">
<template #title> <template #title>
<el-icon><Tickets /></el-icon> <el-icon><Tickets /></el-icon>
<el-text type="success">{{item.feedingTime}}</el-text>- <el-text type="success">{{timestampToTime(item.feedingTime)}}</el-text>-
<el-text size="large">{{item.feedingRecordCode}}</el-text> <el-text size="large">{{item.feedingRecordCode}}</el-text>-
<el-text type="warning">{{ findTextByValue(pipelineTypes, item.feedingPipeline)}}</el-text>
</template> </template>
<el-row> <el-row>
<el-col :span="12"> <el-col :span="6">投料类型:
<el-text type="success">制浆线:{{ timestampToTime(item.planStartTime) }}</el-text> <el-text type="warning">{{findTextByValue(feedingTypes, item.feedingType) }}</el-text>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">记录人:
<el-text type="success">记录人:{{ item.userName }}</el-text> <el-text type="success">{{ item.userName }}</el-text>
</el-col> </el-col>
</el-row> <el-col :span="8" v-if="item.feedingType !=='org'">/kg:
<el-row> <el-text>{{ item.weight }} </el-text>
<el-col :span="12">
<el-text type="warning">计划结束:{{ timestampToTime(item.planEndTime) }}</el-text>
</el-col>
<el-col :span="8">
<el-text type="warning">投料类型:{{ item.feedingType }}</el-text>
</el-col> </el-col>
</el-row> </el-row>
<el-row> <el-row v-for="(item2, index2) in finishList[index].detailList">
<el-col :span="20"> <el-col :span="8">原料:
<el-text>备注:{{ item.remark }}</el-text> <el-text type="warning">{{item2.itemName}}</el-text>
</el-col> </el-col>
<el-col :span="4"> <el-col :span="8">数量:
<el-text type="success">{{ item2.weight }}</el-text>
</el-col>
<el-col :span="8">单位:
<el-text>{{item2.unitName }} </el-text>
</el-col> </el-col>
</el-row> </el-row>
</el-collapse-item> </el-collapse-item>
@ -40,39 +39,39 @@
<!-- 草稿状态--> <!-- 草稿状态-->
<uni-section title="草稿" type="line" title-color="#f3a73f"></uni-section> <uni-section title="草稿" type="line" title-color="#f3a73f"></uni-section>
<el-collapse accordion> <el-collapse accordion>
<el-collapse-item v-for="(item, index) in draftList" :name="item.id"> <el-collapse-item v-for="(item, index) in draftList" :name="item.id" @click="handleDraftClick(item.id,index)">
<template #title> <template #title>
<el-icon><Tickets /></el-icon> <el-icon><Tickets /></el-icon>
<el-text type="success">{{item.feedingTime}}</el-text>- <el-text type="success">{{timestampToTime(item.feedingTime)}}</el-text>-
<el-text size="large">{{item.feedingRecordCode}}</el-text> <el-text size="large">{{item.feedingRecordCode}}</el-text>-
<el-text type="warning">{{ findTextByValue(pipelineTypes, item.feedingPipeline)}}</el-text>
</template> </template>
<el-row> <el-row>
<el-col :span="12"> <el-col :span="6">投料类型:
<el-text type="success">制浆线:{{ timestampToTime(item.planStartTime) }}</el-text> <el-text type="warning">{{findTextByValue(feedingTypes, item.feedingType) }}</el-text>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">记录人:
<el-text type="success">记录人:{{ item.userName }}</el-text> <el-text type="success">{{ item.userName }}</el-text>
</el-col> </el-col>
<el-col v-if="auth.hasPermi('mes:plan:update')" :span="4"> <el-col :span="4" v-if="item.feedingType !=='org'">/kg:
<el-button type="success" plain @click="updatePlan(item.id, item.code,'end')">提交</el-button> <el-text>{{ item.weight }} </el-text>
</el-col> </el-col>
</el-row> <el-col :span="3">
<el-row> <el-button type="info" @click="handleUpdate(item.id)"></el-button>
<el-col :span="12">
<el-text type="warning">计划结束:{{ timestampToTime(item.planEndTime) }}</el-text>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="3">
<el-text type="warning">投料类型:{{ item.feedingType }}</el-text> <el-button type="danger" @click="handleDelete(item.id)"></el-button>
</el-col>
<el-col v-if="auth.hasPermi('mes:plan:update')" :span="4">
<el-button type="warning" plain @click="updatePlan(item.id,item.code,'pause')"></el-button>
</el-col> </el-col>
</el-row> </el-row>
<el-row> <el-row v-for="(item2, index2) in draftList[index].detailList">
<el-col :span="20"> <el-col :span="8">原料:
<el-text>备注:{{ item.remark }}</el-text> <el-text type="warning">{{item2.itemName}}</el-text>
</el-col> </el-col>
<el-col :span="4"> <el-col :span="8">数量:
<el-text type="success">{{ item2.weight }}</el-text>
</el-col>
<el-col :span="8">单位:
<el-text>{{item2.unitName }} </el-text>
</el-col> </el-col>
</el-row> </el-row>
</el-collapse-item> </el-collapse-item>
@ -83,7 +82,8 @@
<script setup> <script setup>
import {ref, onMounted} from 'vue'; import {ref, onMounted} from 'vue';
import {getRecordList, updateStatus, deleteById, getDetailByRecordId} from "@/api/mes/record" import {getRecordList, updateStatus, deleteById, getDetailByRecordId} from "@/api/mes/record"
import {timestampToTime} from "@/utils/dateUtil"; import {timestampToTime,timestampToDateTime} from "@/utils/dateUtil";
import { pipelineTypes,feedingTypes, findTextByValue} from "@/api/system/dict/data";
import {Tickets} from "@element-plus/icons-vue"; import {Tickets} from "@element-plus/icons-vue";
import modal from "@/plugins/modal"; import modal from "@/plugins/modal";
import tab from "@/plugins/tab"; import tab from "@/plugins/tab";
@ -95,6 +95,7 @@ const finishList = ref([]);
//稿 //稿
const draftList = ref([]); const draftList = ref([]);
onMounted(() => { onMounted(() => {
getList() getList()
}); });
@ -107,6 +108,38 @@ function getList() {
draftList.value = response.data 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 => {
draftList.value[index].detailList = response.data
})
}
/** 提交 */
function handleUpdate(id){
showConfirm("确认提交投料记录吗?").then(res => {
if (res.confirm) {
updateStatus(id, 2).then(response => {
modal.msgSuccess("操作成功")
getList()
})
}
})
}
/** 提交 */
function handleDelete(id){
showConfirm("确认删除投料记录吗?").then(res => {
if (res.confirm) {
deleteById(id).then(response => {
modal.msgSuccess("操作成功")
getList()
})
}
})
}
// //
function planProgress(plan){ function planProgress(plan){

@ -12,6 +12,17 @@ export function timestampToTime(timestamp: number | null): string {
// let s = date.getSeconds() < 10 ? '0' + date.getSeconds() : date.getSeconds(); // let s = date.getSeconds() < 10 ? '0' + date.getSeconds() : date.getSeconds();
return Y + M + D; return Y + M + D;
} }
export function timestampToDateTime(timestamp: number | null): string {
timestamp = timestamp ? timestamp : null;
let date = new Date(timestamp!); // 时间戳为10位需*1000时间戳为13位的话不需乘1000
let Y = date.getFullYear() + '-';
let M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '-';
let D = (date.getDate() < 10 ? '0' + date.getDate() : date.getDate());
let h = (date.getHours() < 10 ? '0' + date.getHours() : date.getHours()) + ':';
let m = (date.getMinutes() < 10 ? '0' + date.getMinutes() : date.getMinutes()) + ':';
let s = date.getSeconds() < 10 ? '0' + date.getSeconds() : date.getSeconds();
return Y + M + D +' '+ h + m + s;
}
export function getCurrentDate(){ export function getCurrentDate(){
let result = ''; let result = '';
let now = new Date(); let now = new Date();

Loading…
Cancel
Save