生产订单 UI/UX

main
siontion 7 months ago
parent 75a8548fb0
commit a8b8282648

@ -10,6 +10,9 @@
<vxe-button type="text" status="primary" content="编辑" icon="vxe-icon-edit"
@click="fnProductionOrderForm('edit', row)"></vxe-button>
</template>
<template #slotPlanStartDate="{ row }">
{{ dayjs(row.PlanStartDate).format("YYYY-MM-DD") }}
</template>
<template #slotManufactureDate="{ row }">
{{ dayjs(row.ManufactureDate).format("YYYY-MM-DD") }}
</template>
@ -48,23 +51,32 @@ const xGrid = ref()
const gridOptionsA: any = reactive({
columns: [
{ field: 'PurchaserHqCode', title: '采购方总部编码', width: '120px', fixed: 'left' },
{ field: 'IpoType', title: '订单类型', sortable: true, width: '160px', fixed: 'left' },
{ field: 'SupplierCode', title: '供应商编码', sortable: true, width: '160px' },
{ field: 'SupplierName', title: '供应商名称', width: '220px' },
{ field: 'IpoNo', title: '生产订单号', width: '200px' },
{ field: 'PlanStartDate', title: '计划开始日期', sortable: true, width: '160px' },
{ field: 'PlanFinishDate', title: '计划完成日期', sortable: true, width: '160px' },
{ field: 'ActualStartDate', title: '实际开始日期', sortable: true, width: '160px' },
{ field: 'ActualFinishDate', title: '实际完成日期', sortable: true, width: '160px' },
{ field: 'PlantName', title: '生产工厂名称', sortable: true, width: '160px' },
{ field: 'WorkshopName', title: '生产车间名称 ', sortable: true, width: '160px' },
{ field: 'IpoStatus', title: '生产订单状态', sortable: true, width: '160px' },
{ field: 'Center', title: '生产中心', sortable: true, width: '160px' },
{ field: 'DataSource', title: '数据来源', sortable: true, width: '160px' },
{ field: 'DataSourceCreatetime', title: '来源数据创建时间', sortable: true, width: '160px' },
{ field: 'OwnerId', title: '数据拥有方', sortable: true, width: '160px' },
{ field: 'OpenId', title: '数据可见方', sortable: true, width: '160px' },
// { field: 'PurchaserHqCode', title: '', width: '120px', fixed: 'left' },
// { field: 'IpoType', title: '', sortable: true, width: '160px', fixed: 'left' },
// { field: 'SupplierCode', title: '', sortable: true, width: '160px' },
// { field: 'SupplierName', title: '', width: '220px' },
{ field: 'BuyerName', title: '采购方公司名称', fixed: 'left'},
{ field: 'Amount', title: '采购数量', fixed: 'left'},
{ field: 'PoItemId', title: '采购订单行项目id', fixed: 'left' },
{ field: 'IpoNo', title: '生产订单号', fixed: 'left' },
{ field: 'PlanStartDate', title: '计划开始日期',formatter:formatTime},
{ field: 'PlanFinishDate', title: '计划完成日期' ,formatter:formatTime},
// { field: 'ActualStartDate', title: '' ,formatter:formatTime},
// { field: 'ActualFinishDate', title: '' ,formatter:formatTime},
{ field: 'MaterialCode', title: '物料编码' },
{ field: 'MaterialName', title: '物料名称' },
{ field: 'MaterialUnit', title: '物料单位' },
{ field: 'MaterialDesc', title: '物料描述' },
// { field: 'PlantName', title: '', sortable: true, width: '160px' },
// { field: 'WorkshopName', title: ' ', sortable: true, width: '160px' },
// { field: 'IpoStatus', title: '', sortable: true, width: '160px' },
// { field: 'Center', title: '', sortable: true, width: '160px' },
// { field: 'DataSource', title: '', sortable: true, width: '160px' },
// { field: 'DataSourceCreatetime', title: '', sortable: true, width: '160px' },
// { field: 'OwnerId', title: '', sortable: true, width: '160px' },
// { field: 'OpenId', title: '', sortable: true, width: '160px' },
{ title: '操作', width: 160, fixed: 'right', slots: { default: 'operate' } }
],
pagerConfig: {
@ -169,6 +181,10 @@ const gridOptionsA: any = reactive({
}
}
})
function formatTime ({ cellValue, row, column }) {
if(cellValue != undefined)
return dayjs(cellValue).format("YYYY-MM-DD")
}
//
const proxyReload = () => {
const $grid = xGrid.value

@ -1,14 +1,14 @@
<template>
<div class="xyp-sale-order-form" v-if="refShow">
<vxe-form title-colon ref="refFormA" title-align="right" title-width="210" :data="formDataA" :rules="formRulesA"
<vxe-form title-colon ref="refFormA" title-align="right" title-width="240" :data="formDataA" :rules="formRulesA"
@submit="fnSubmitA" @reset="fnResetA" custom-layout title-overflow="title">
<vxe-modal v-model="refShow" width="1160" height="770" show-zoom show-footer>
<vxe-modal v-model="refShow" width="1160" height="500" show-zoom show-footer>
<template #title>
<span style="color:#ffffff">{{ modalTitle }}</span>
</template>
<template #default>
<a-card title="基本数据" :bordered="false" style="margin: 10px">
<vxe-form-item title="采购方总部编码" field="PurchaserHqCode" span="12">
<!-- <vxe-form-item title="采购方总部编码" field="PurchaserHqCode" span="12">
<template #default="params">
<div style="width: 196px;">{{ params.data.PurchaserHqCode }}</div>
</template>
@ -33,13 +33,13 @@
<template #default="params">
<div style="width: 196px;">{{ params.data.SupplierName }}</div>
</template>
</vxe-form-item>
</vxe-form-item> -->
<vxe-form-item title="生产订单号" field="IpoNo" span="12">
<template #default="params">
<div style="width: 196px;">{{ params.data.IpoNo }}</div>
</template>
</vxe-form-item>
<vxe-form-item title="品类编码" field="CategoryCode" span="12">
<!-- <vxe-form-item title="品类编码" field="CategoryCode" span="12">
<template #default="params">
<vxe-select v-model="params.data.CategoryCode" clearable filterable>
<template v-for="(item) in dictCategoryCode">
@ -61,13 +61,25 @@
<template #default="params">
<div style="width: 196px;">{{ params.data.ScheduleCode }}</div>
</template>
</vxe-form-item>
<vxe-form-item title="采购订单行项目id(供货单行项目id)或销售订单号" field="PoItemId" span="12">
</vxe-form-item> -->
<vxe-form-item title="采购订单行项目id" field="PoItemId" span="12">
<template #default="params">
<div style="width: 196px;">{{ params.data.PoItemId }}</div>
</template>
</vxe-form-item>
<vxe-form-item title="数据关联类型" field="DateType" span="12">
<vxe-form-item title="计划开始日期" field="PlanStartDate" span="12">
<template #default="params">
<vxe-input v-model="params.data.PlanStartDate" type="date" placeholder="请输入计划开始日期" style="width: 197px;" v-bind:disabled="formTypeA == 'info'"
clearable @change="fnChangeA(params)"></vxe-input>
</template>
</vxe-form-item>
<vxe-form-item title="计划完成日期" field="PlanFinishDate" span="12">
<template #default="params">
<vxe-input v-model="params.data.PlanFinishDate" type="date" placeholder="请输入计划完成日期" style="width: 197px;" v-bind:disabled="formTypeA == 'info'"
clearable @change="fnChangeA(params)"></vxe-input>
</template>
</vxe-form-item>
<!-- <vxe-form-item title="数据关联类型" field="DateType" span="12">
<template #default="params">
<div style="width: 196px;">{{ params.data.DateType }}</div>
</template>
@ -76,50 +88,55 @@
<template #default="params">
<div style="width: 196px;">{{ params.data.SoItemNo }}</div>
</template>
</vxe-form-item>
</vxe-form-item> -->
<vxe-form-item title="厂家物料编码" field="MaterialCode" span="12">
<template #default="params">
<vxe-input v-model="params.data.MaterialCode" placeholder="请输入"
clearable @change="fnChangeA(params)"></vxe-input>
<vxe-select v-model="params.data.MaterialCode" clearable filterable @change="fnMatCodeChange(params)" v-bind:disabled="formTypeA == 'info'">
<template v-for="(item) in ipoMats">
<vxe-option :value="item.key" :label="item.val"></vxe-option>
</template>
</vxe-select>
<!-- <vxe-input v-model="params.data.MaterialCode" placeholder="请输入"
clearable @change="fnChangeA(params)"></vxe-input> -->
<!-- <div style="width: 196px;">{{ params.data.MaterialCode }}</div> -->
</template>
</vxe-form-item>
<vxe-form-item title="厂家物料名称" field="MaterialName" span="12">
<template #default="params">
<vxe-input v-model="params.data.MaterialName" placeholder="请输入"
<vxe-input v-model="params.data.MaterialName" placeholder="请输入" v-bind:disabled="formTypeA == 'info'"
clearable @change="fnChangeA(params)"></vxe-input>
<!-- <div style="width: 196px;">{{ params.data.MaterialName }}</div> -->
</template>
</vxe-form-item>
<vxe-form-item title="厂家物资单位" field="MaterialUnit" span="12">
<template #default="params">
<vxe-input v-model="params.data.MaterialUnit" placeholder="请输入"
<vxe-input v-model="params.data.MaterialUnit" placeholder="请输入" v-bind:disabled="formTypeA == 'info'"
clearable @change="fnChangeA(params)"></vxe-input>
<!-- <div style="width: 196px;">{{ params.data.MaterialUnit }}</div> -->
</template>
</vxe-form-item>
<vxe-form-item title="厂家物料描述" field="MaterialDesc" span="12">
<template #default="params">
<vxe-input v-model="params.data.MaterialDesc" placeholder="请输入"
<vxe-input v-model="params.data.MaterialDesc" placeholder="请输入" v-bind:disabled="formTypeA == 'info'"
clearable @change="fnChangeA(params)"></vxe-input>
<!-- <div style="width: 196px;">{{ params.data.MaterialDesc }}</div> -->
</template>
</vxe-form-item>
<vxe-form-item title="生产数量" field="Amount" span="12">
<template #default="params">
<vxe-input v-model="params.data.Amount" placeholder="请输入"
<vxe-input v-model="params.data.Amount" placeholder="请输入" v-bind:disabled="formTypeA == 'info'"
clearable @change="fnChangeA(params)"></vxe-input>
<!-- <div style="width: 196px;">{{ params.data.Amount }}</div> -->
</template>
</vxe-form-item>
<vxe-form-item title="计量单位" field="Unit" span="12">
<template #default="params">
<vxe-input v-model="params.data.Unit" placeholder="请输入"
<vxe-input v-model="params.data.Unit" placeholder="请输入" v-bind:disabled="formTypeA == 'info'"
clearable @change="fnChangeA(params)"></vxe-input>
<!-- <div style="width: 196px;">{{ params.data.Unit }}</div> -->
</template>
</vxe-form-item>
<vxe-form-item title="物资id分组" field="ProductIdGrpNo" span="12">
<!-- <vxe-form-item title="物资id分组" field="ProductIdGrpNo" span="12">
<template #default="params">
<div style="width: 196px;">{{ params.data.ProductIdGrpNo }}</div>
</template>
@ -133,20 +150,9 @@
<template #default="params">
<div style="width: 196px;">{{ params.data.ProductModel }}</div>
</template>
</vxe-form-item>
<vxe-form-item title="计划开始日期" field="PlanStartDate" span="12">
<template #default="params">
<vxe-input v-model="params.data.PlanStartDate" type="date" placeholder="请输入计划开始日期"
clearable @change="fnChangeA(params)"></vxe-input>
</template>
</vxe-form-item>
<vxe-form-item title="计划完成日期" field="PlanFinishDate" span="12">
<template #default="params">
<vxe-input v-model="params.data.PlanFinishDate" type="date" placeholder="请输入计划完成日期"
clearable @change="fnChangeA(params)"></vxe-input>
</template>
</vxe-form-item>
<vxe-form-item title="实际开始日期" field="ActualStartDate " span="12">
</vxe-form-item> -->
<!-- <vxe-form-item title="实际开始日期" field="ActualStartDate " span="12">
<template #default="params">
<vxe-input v-model="params.data.ActualStartDate" type="date" placeholder="请输入实际开始日期"
clearable @change="fnChangeA(params)"></vxe-input>
@ -157,8 +163,8 @@
<vxe-input v-model="params.data.ActualFinishDate" type="date" placeholder="请输入来料检验日期"
clearable @change="fnChangeA(params)"></vxe-input>
</template>
</vxe-form-item>
<vxe-form-item title="生产工厂名称" field="PlantName " span="12">
</vxe-form-item> -->
<!-- <vxe-form-item title="生产工厂名称" field="PlantName " span="12">
<template #default="params">
<vxe-input v-model="params.data.PlantName" placeholder="请输入生产工厂名称" clearable
@change="fnChangeA(params)"></vxe-input>
@ -169,7 +175,7 @@
<vxe-input v-model="params.data.WorkshopName" placeholder="请输入生产车间名称" clearable
@change="fnChangeA(params)"></vxe-input>
</template>
</vxe-form-item>
</vxe-form-item>
<vxe-form-item title="生产订单状态" field="IpoStatus " span="12">
<template #default="params">
<template v-if="params.data.IpoStatus == 1">
@ -187,11 +193,11 @@
<template v-else-if="params.data.IpoStatus == 5">
<div style="width: 196px;">包装入库</div>
</template>
<!-- <vxe-input v-model="params.data.IpoStatus" placeholder="请输入生产订单状态" clearable
@change="fnChangeA(params)"></vxe-input> -->
<vxe-input v-model="params.data.IpoStatus" placeholder="请输入生产订单状态" clearable
@change="fnChangeA(params)"></vxe-input>
</template>
</vxe-form-item>
<vxe-form-item title="生产中心" field="Center" span="12">
</vxe-form-item> -->
<!-- <vxe-form-item title="生产中心" field="Center" span="12">
<template #default="params">
<vxe-input v-model="params.data.Center" placeholder="请输入生产中心" clearable
@change="fnChangeA(params)"></vxe-input>
@ -226,13 +232,14 @@
<template #default="params">
<div style="width: 196px;">{{ params.data.OpenId }}</div>
</template>
</vxe-form-item>
</a-card>
</vxe-form-item> -->
</template>
<template #footer>
<template v-if="formTypeA == 'edit'">
<vxe-button type="submit" status="primary" content="保存"></vxe-button>
<vxe-button type="reset" content="取消" @click="fnEventCancel"></vxe-button>
</template>
</template>
</vxe-modal>
</vxe-form>
@ -247,6 +254,7 @@ import { map as _map } from 'lodash'
import * as ProductionOrderApi from '@/api/gw/productionOrder'
import { useDictStore } from '@/stores/dict'
import { storeToRefs } from 'pinia'
import * as BaseMaterialApi from '@/api/gw/baseMaterial'
//
const dictStore = useDictStore()
const { dictCategoryCode, dictSubClassCode, dictWoStatus, dictIpoType } = storeToRefs(dictStore)
@ -292,15 +300,15 @@ const formDataA: any = ref(
})
//
const formRulesA: any = ref({
IpoType: [
{ required: true, message: '请输入订单类型' }
],
CategoryCode: [
{ required: true, message: '请输入品类编码' }
],
SupplierCode: [
{ required: true, message: '请输入种类编码' }
],
// IpoType: [
// { required: true, message: '' }
// ],
// CategoryCode: [
// { required: true, message: '' }
// ],
// SupplierCode: [
// { required: true, message: '' }
// ],
MaterialCode: [
{ required: true, message: '请输入厂家物料编码' }
],
@ -326,13 +334,32 @@ const formRulesA: any = ref({
{ required: true, message: '请输入计划完成日期' }
],
})
const baseMats = ref([])
const ipoMats = ref([])
//
onMounted(() => {
})
//
const open = async (type: string, row?: any) => {
console.log(type)
console.log(row)
const filterReq = {
"filter": {
"field": "MatNo",
"operator": "1",
"value": null
}
}
baseMats.value =await BaseMaterialApi.GetBaseMaterialList(filterReq)
baseMats.value.Data.forEach( (item) => {
if(ipoMats.value.indexOf(item.MatNo)==-1)
ipoMats.value.push({key:item.MatNo,val:item.MatNo})
})
formTypeA.value = type
switch (type) {
case 'add':
@ -342,7 +369,7 @@ const open = async (type: string, row?: any) => {
break;
case 'info':
await fnResetA()
modalTitle.value = '编辑生产订单'
modalTitle.value = '查看生产订单'
refShow.value = true
formDataA.value = row
break;
@ -360,6 +387,7 @@ const open = async (type: string, row?: any) => {
const rowInfoA = await ProductionOrderApi.getProductionOrder(paramsA)
console.log(rowInfoA)
formDataA.value = rowInfoA.Data
break;
case 'copy':
await fnResetA()
@ -384,6 +412,19 @@ const open = async (type: string, row?: any) => {
}
// open
defineExpose({ open })
const fnMatCodeChange = (params: any) => {
if (params.data.MaterialCode) {
baseMats.value.Data.forEach( (item) => {
if(item.MatNo == params.data.MaterialCode)
{
params.data.MaterialName = item.MatName;
params.data.MaterialUnit = item.MatUnit;
params.data.MaterialDesc = item.MatDescption;
}
})
}
}
// A
const fnChangeA = (params: any) => {
const $form = refFormA.value
@ -479,5 +520,10 @@ const fnResetA = () => {
"Width": undefined,
}
}
//
const fnEventCancel = () => {
refShow.value = false
}
</script>
<style scoped></style>

@ -157,7 +157,7 @@ import { VXETable } from 'vxe-table'
import dayjs from 'dayjs'
import { map as _map } from 'lodash'
import * as SaleOrderApi from '@/api/gw/saleOrder'
import * as BaseMaterialApi from '@/api/gw/baseMaterial'
// [success]
const emit = defineEmits(['success'])
//

Loading…
Cancel
Save