随车详情

This commit is contained in:
xielue 2023-07-24 21:07:56 +08:00
parent b8d2650237
commit 8c2d2d1735
4 changed files with 338 additions and 54 deletions

View File

@ -16,7 +16,7 @@ export default {
},
props: {
value: {
type: [String,Number]
type: [String,Number,Object]
},
params: Object,
},
@ -41,6 +41,9 @@ export default {
let v = this.value;
this.valueShow = v ? "是" :"否";
}
else if(params && params.dataType == "object"){
this.valueShow = this.value && this.value[params.textField] ? this.value[params.textField] :"";
}
else if(params && params.dataType == "date"){
let v = this.value;
if(typeof(v) == "number"){

View File

@ -0,0 +1,256 @@
<template>
<div class="page-body">
<a-collapse v-model="groupbox1_activeKey">
<a-collapse-panel key="1" header="布产单信息">
<vxe-form :data="formOptionsOrder.data" ref="xForm" :title-width="formOptionsOrder.titleWidth"
:title-align="formOptionsOrder.titleAlign" :rules="formOptionsOrder.rules" :items="formOptionsOrder.items"
titleColon>
</vxe-form>
</a-collapse-panel>
<a-collapse-panel key="2" header="随车联信息">
<vxe-form :data="formOptions.data" ref="xForm" :title-width="formOptions.titleWidth"
:title-align="formOptions.titleAlign" :rules="formOptions.rules" :items="formOptions.items" titleColon>
</vxe-form>
</a-collapse-panel>
<a-collapse-panel key="3" header="报工信息">
<div style="margin-bottom: 5px;">
<a-button type="primary">新增报工</a-button>
</div>
<vxe-table border show-overflow keep-source ref="xTable" :height="table1Height" :data="detailsData">
<vxe-column field="step_name" title="工序名称" width="120">
</vxe-column>
<vxe-column field="production_unit" title="单位" width="120">
</vxe-column>
<vxe-column field="production_num" title="生产数量" width="120">
</vxe-column>
<vxe-column field="员工" title="员工" width="120">
</vxe-column>
<vxe-column field="create_uid" title="报工日期" formatter= "formatDate" width="120">
</vxe-column>
<vxe-column field="embryo_type" title="查坯方式" width="120">
</vxe-column>
<vxe-column field="是否计件" title="是否计件" width="120">
</vxe-column>
<vxe-column field="备注" title="备注" width="120">
</vxe-column>
</vxe-table>
</a-collapse-panel>
</a-collapse>
</div>
</template>
<script>
import BASE_URL from '@/services/mes/api.js';
export default {
components: {},
props: {
pageMode: {
type: String,
default: "edit"
},
dataId: {
}
},
data() {
//let _this = this;
//
var pageData = {
groupbox1_activeKey: ["1", "2", "3"],
//
currentConfigName: "",
// ID
currentBeid: 0,
uploadDefaultImg: null,
detailDataFieldName: "production_order_array",
actions: {
get: `${BASE_URL.BASE_URL}/MesProductionOrder/v1/production/order/array/detail`
},
keyName: 'id',
//
isEdit: false,
formOptionsOrder: {
data: {
},
titleWidth: 100,
titleAlign: 'right',
rules: {
},
items: [
{ field: 'production_number', title: '布产单号', span: 8, itemRender: { name: 'MkFormInputShow' } },
{ field: 'contract_number', title: '合同号', span: 8, itemRender: { name: 'MkFormInputShow' } },
{ field: 'production_department', title: '布产部门', span: 8, itemRender: { name: 'MkFormInputShow',props:{params:{dataType:'object',textField:'name'}} } },
{ field: 'remark', title: '备注', span: 8, itemRender: { name: 'MkFormInputShow' } },
{ field: 'start_time', title: '开始时间', span: 8, itemRender: { name: 'MkFormInputShow' ,props:{params:{dataType:'date'}}} },
{ field: 'actual_finish_time', title: '结束时间', span: 8, itemRender: { name: 'MkFormInputShow',props:{params:{dataType:'date'}} } },
]
},
formOptions: {
data: {
},
titleWidth: 100,
titleAlign: 'right',
rules: {
},
items: [
{ field: 'batch_no', title: '批次编号', span: 8, itemRender: { name: 'MkFormInputShow' } },
{ field: 'number', title: '数量', span: 8, itemRender: { name: 'MkFormInputShow' } },
{ field: 'start_time', title: '开始日期', span: 8, itemRender: { name: 'MkFormInputShow',props:{params:{dataType:'date'}} } },
{ field: 'pick_time', title: '领料日期', span: 8, itemRender: { name: 'MkFormInputShow',props:{params:{dataType:'date'}} } },
{ field: 'finish_time', title: '结束时间', span: 8, itemRender: { name: 'MkFormInputShow',props:{params:{dataType:'date'}} } },
]
},
//
addModeItems: [
],
table1Height: 400,
detailsSourceData: [
],
detailsData: [
],
deletedDetailsData: [
],
};
return pageData;
},
computed: {
desc() {
return this.$t('editPageDesc')
}
},
created() {
// id
let dataId = this.getDataId();
// id
if (dataId) {
this.$mk.post({
url: this.actions.get,
loading: "加载中...",
data: { id: this.$mk.toBigInt(dataId) },
useBigInt: true
}).then(a => {
let d = a.data[this.detailDataFieldName];
this.formOptions.data = d;
this.formOptionsOrder.data = d.mes_production_order;
this.detailsData = JSON.parse(JSON.stringify(d.mes_reporting));
console.log(this.detailsData)
}).catch((a) => {
this.$mk.error(a.data.msg);
});
this.isEdit = true;
}
},
//
methods: {
// id
getDataId() {
let dataId = this.dataId;
if (this.$route.params.id) {
dataId = this.$route.params.id;
}
if (!dataId) {
dataId = 0;
}
return dataId;
},
getDataId_BigInt() {
let dataId = this.getDataId();
return this.$mk.toBigInt(dataId);
},
},
//
watch: {
}
};
</script>
<style scoped lang="less">
.page-body {
padding: 30px;
background: @base-bg-color;
}
.formtabs .ant-tabs-tabpane {
/* background: white; */
padding: 12px;
}
.gridPanel {
height: calc(100vh - 600px);
}
.footerbar {
padding-left: 10px;
}
.imagePanel {
cursor: pointer;
padding: 10px;
width: 100px;
img {
width: 80px;
height: 80px;
}
}
.oplinks2 svg {
width: 18px;
height: 18px;
}
.oplinks2 i {
margin-left: 5px;
}
</style>

View File

@ -4,6 +4,11 @@
<template v-slot:column2="{ row }">
<vue-qr class="qr-code" :text="row.qr_code" :size="120" />
</template>
<template v-slot:column3="{ row }">
<a-button type="link" @click.stop="pageDetail(row)" >{{row.batch_no}}</a-button>
</template>
</basic-page-list>
</template>
@ -111,7 +116,9 @@ export default {
{ title: '操作', slots: { default: 'op' }, width: 100 },
{ slots: { default: 'column2' }, title: '扫码', width: 130 },
{ field: 'batch_no', sortable: true, title: '批次编号', width: 150 },
{ title: '批次编号', slots: { default: 'column3' }, width: 210 },
//{ field: 'batch_no', sortable: true, title: '', width: 150 },
{ field: 'materials_name', title: '料品名称', width: 150 },
{ field: 'production_number', title: '布产单编号', width: 150 },
{ field: 'start_time', formatter: 'formatDate', title: '开始日期', width: 150 },
@ -133,6 +140,11 @@ export default {
this.pageOptions = pageData;
},
pageDetail(row){
this.$openPage('/MesProductionOrder/MesProductionOrderBatchDetail/' + row.id);
}
},
watch: {

View File

@ -1,7 +1,7 @@
const FunName = 'MesProductionOrder';
const FunName = 'MesProductionOrder';
const FunTitle = '布产单';
const InvisibleRouters = 'Detail,Delete,BatchDelete,BatchUpdate,BatchCreate,ExportExcel,LogDetail,LogList,Settings,SettingsUpdate,ImportExcel'.split(',')
const InvisibleRouters2 = ''.split(',')
@ -11,11 +11,11 @@ const view = {
blank: () => import('@/layouts/BlankView'),
page: () => import('@/layouts/PageView')
}
// 路由组件注册
const routerMap = {
};
routerMap[FunName]= {
routerMap[FunName] = {
name: FunTitle,
icon: 'idcard',
component: view.blank,
@ -23,79 +23,92 @@ routerMap[FunName]= {
},
authority: {
permission: [],
}
}
};
routerMap[FunName + 'List']= {
name: FunTitle,
routerMap[FunName + 'List'] = {
name: FunTitle,
icon: 'idcard',
path: `/${FunName}/${FunName}List`,
meta:{
meta: {
invisible: true,
page:{ cacheAble:false}
page: { cacheAble: false }
},
component: () => import(`@/pages/Middle/Mes/MesProductionOrder/MesProductionOrder/List`),
authority: {
permission: [],
permission: [],
}
};
routerMap[FunName + 'Create'] = {
name: '布产单',
icon: 'idcard',
path: `/${FunName}/${FunName}Voucher`,
component: () => import(`@/pages/Middle/Mes/MesProductionOrder/MesProductionOrder/voucher`),
meta: {
},
authority: {
permission: [],
}
};
routerMap[FunName + 'Update'] = {
name: FunTitle,
icon: 'idcard',
path: `/${FunName}/${FunName}Update/:id`,
component: () => import(`@/pages/Middle/Mes/MesProductionOrder/MesProductionOrder/Edit`),
meta: {
invisible: true,
},
authority: {
permission: [],
}
};
routerMap['MesProductionOrderBatch'] = {
name: '随车联',
icon: 'idcard',
path: `/MesProductionOrder/MesProductionOrderBatch`,
component: () => import(`@/pages/Middle/Mes/MesProductionOrder/Batch/List`),
authority: {
permission: [],
}
};
routerMap['MesProductionOrderBatchDetail'] = {
name: '随车联详情',
icon: 'idcard',
meta: {
invisible: true,
},
path: `/MesProductionOrder/MesProductionOrderBatchDetail/:id`,
component: () => import(`@/pages/Middle/Mes/MesProductionOrder/Batch/Detail`),
authority: {
permission: [],
}
};
routerMap[FunName + 'Create']= {
name: '布产单',
icon: 'idcard',
path: `/${FunName}/${FunName}Voucher`,
component: () => import(`@/pages/Middle/Mes/MesProductionOrder/MesProductionOrder/voucher`),
meta: {
},
authority: {
permission: [],
}
};
routerMap[FunName + 'Update']= {
name: FunTitle,
icon: 'idcard',
path: `/${FunName}/${FunName}Update/:id`,
component: () => import(`@/pages/Middle/Mes/MesProductionOrder/MesProductionOrder/Edit`),
meta: {
invisible: true,
},
authority: {
permission: [],
}
};
routerMap['MesProductionOrderBatch']= {
name: '随车连',
icon: 'idcard',
path: `/MesProductionOrder/MesProductionOrderBatch`,
component: () => import(`@/pages/Middle/Mes/MesProductionOrder/Batch/List`),
authority: {
permission: [],
}
};
InvisibleRouters.forEach(item => {
let name = FunName + item;
if (!(name in routerMap)) {
if (!(name in routerMap)) {
routerMap[name] = {
meta: {
invisible: true
}
}
}
}
})
InvisibleRouters2.forEach(item => {
let name = item;
if (!(name in routerMap)) {
if (!(name in routerMap)) {
routerMap[name] = {
meta: {
invisible: true
}
}
}
}
})
export default routerMap