|
|
|
@ -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>
|