|
|
|
|
@ -7,8 +7,8 @@
|
|
|
|
|
label-width="0px"
|
|
|
|
|
:inline-message="true"
|
|
|
|
|
>
|
|
|
|
|
<el-table :data="formData" class="-mt-10px">
|
|
|
|
|
<el-table-column label="序号" type="index" width="100" />
|
|
|
|
|
<el-table :data="formData" class="-mt-10px" :show-overflow-tooltip="true" highlight-current-row>
|
|
|
|
|
<el-table-column label="序号" type="index" width="80" />
|
|
|
|
|
<el-table-column label="产品" min-width="150">
|
|
|
|
|
<template #default="{ row, $index }">
|
|
|
|
|
<el-form-item :prop="`${$index}.productId`" :rules="formRules.productId" class="mb-0px!">
|
|
|
|
|
@ -28,7 +28,7 @@
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column label="单位" min-width="150">
|
|
|
|
|
<el-table-column label="单位" min-width="100">
|
|
|
|
|
<template #default="{ row, $index }">
|
|
|
|
|
<el-form-item :prop="`${$index}.unitId`" :rules="formRules.unitId" class="mb-0px!">
|
|
|
|
|
<el-select v-model="row.unitId" clearable filterable placeholder="请选择单位" class="w-1/1">
|
|
|
|
|
@ -43,21 +43,28 @@
|
|
|
|
|
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column label="数量" min-width="150">
|
|
|
|
|
<el-table-column label="数量" min-width="180">
|
|
|
|
|
<template #default="{ row, $index }">
|
|
|
|
|
<el-form-item :prop="`${$index}.number`" :rules="formRules.number" class="mb-0px!">
|
|
|
|
|
<el-input v-model="row.number" placeholder="请输入数量" />
|
|
|
|
|
<el-input-number v-model="row.number" :min="0" class="!w-1/1" />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column label="打包要求(每包/个)" min-width="150">
|
|
|
|
|
<el-table-column label="每包/个" min-width="150">
|
|
|
|
|
<template #default="{ row, $index }">
|
|
|
|
|
<el-form-item :prop="`${$index}.packageSize`" :rules="formRules.packageSize" class="mb-0px!">
|
|
|
|
|
<el-input v-model="row.packageSize" placeholder="请输入打包要求(每包/个)" />
|
|
|
|
|
<el-input-number v-model="row.packageSize" :min="0" class="!w-1/1" />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column label="项目名称" min-width="150">
|
|
|
|
|
<el-table-column label="打包数量" min-width="150">
|
|
|
|
|
<template #default="{ row, $index }">
|
|
|
|
|
<el-form-item :prop="`${$index}.packageNumber`" :rules="formRules.packageNumber" class="mb-0px!">
|
|
|
|
|
<el-input-number v-model="row.packageNumber" :min="0" class="!w-1/1" />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column label="项目名称" min-width="100">
|
|
|
|
|
<template #default="{ row, $index }">
|
|
|
|
|
<el-form-item :prop="`${$index}.projectName`" :rules="formRules.projectName" class="mb-0px!">
|
|
|
|
|
<el-input v-model="row.projectName" placeholder="请输入项目名称" />
|
|
|
|
|
@ -78,13 +85,6 @@
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column label="打包数量" min-width="150">
|
|
|
|
|
<template #default="{ row, $index }">
|
|
|
|
|
<el-form-item :prop="`${$index}.packageNumber`" :rules="formRules.packageNumber" class="mb-0px!">
|
|
|
|
|
<el-input v-model="row.packageNumber" placeholder="请输入打包数量" />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column label="工厂完成" min-width="150">
|
|
|
|
|
<template #default="{ row, $index }">
|
|
|
|
|
<el-form-item :prop="`${$index}.finishDate`" :rules="formRules.finishDate" class="mb-0px!">
|
|
|
|
|
@ -128,13 +128,13 @@
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column label="附件" min-width="150">
|
|
|
|
|
<template #default="{ row, $index }">
|
|
|
|
|
<el-form-item :prop="`${$index}.attachment`" :rules="formRules.attachment" class="mb-0px!">
|
|
|
|
|
<UploadFile v-model="row.attachment" :is-show-tip = "false" :limit = "1"/>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<!-- <el-table-column label="附件" min-width="150">-->
|
|
|
|
|
<!-- <template #default="{ row, $index }">-->
|
|
|
|
|
<!-- <el-form-item :prop="`${$index}.attachment`" :rules="formRules.attachment" class="mb-0px!">-->
|
|
|
|
|
<!-- <UploadFile v-model="row.attachment" :is-show-tip = "false" :limit = "1"/>-->
|
|
|
|
|
<!-- </el-form-item>-->
|
|
|
|
|
<!-- </template>-->
|
|
|
|
|
<!-- </el-table-column>-->
|
|
|
|
|
<el-table-column align="center" fixed="right" label="操作" width="60">
|
|
|
|
|
<template #default="{ $index }">
|
|
|
|
|
<el-button type="danger" @click="handleDelete($index)" link>
|
|
|
|
|
@ -157,23 +157,22 @@ import { TaskApi } from '@/api/mes/task'
|
|
|
|
|
import { ProductUnitApi, ProductUnitVO } from '@/api/erp/product/unit'
|
|
|
|
|
import {ProductApi, ProductVO} from "@/api/erp/product/product";
|
|
|
|
|
import SaleOrderIndex from './SaleOrderIndex.vue'
|
|
|
|
|
import {SaleOrderApi, SaleOrderVO} from "@/api/mes/saleorder";
|
|
|
|
|
import {SaleOrderApi, SaleOrderItemsVO, SaleOrderVO} from "@/api/mes/saleorder";
|
|
|
|
|
|
|
|
|
|
const unitList = ref<ProductUnitVO[]>([]) // 产品单位列表
|
|
|
|
|
const productList = ref<ProductVO[]>([]) // 产品列表
|
|
|
|
|
|
|
|
|
|
const props = defineProps<{
|
|
|
|
|
taskId: undefined // task ID(主表的关联字段)
|
|
|
|
|
taskId?: undefined // task ID(主表的关联字段)
|
|
|
|
|
}>()
|
|
|
|
|
const formLoading = ref(false) // 表单的加载中
|
|
|
|
|
const formData = ref([])
|
|
|
|
|
const formRules = reactive({
|
|
|
|
|
productId: [{ required: true, message: '产品ID不能为空', trigger: 'blur' }],
|
|
|
|
|
unitId: [{ required: true, message: '单位ID不能为空', trigger: 'blur' }],
|
|
|
|
|
taskId: [{ required: true, message: 'task ID不能为空', trigger: 'blur' }],
|
|
|
|
|
productId: [{ required: true, message: '产品不能为空', trigger: 'blur' }],
|
|
|
|
|
unitId: [{ required: true, message: '单位不能为空', trigger: 'blur' }],
|
|
|
|
|
taskId: [{ required: true, message: '生产任务不能为空', trigger: 'blur' }],
|
|
|
|
|
number: [{ required: true, message: '数量不能为空', trigger: 'blur' }],
|
|
|
|
|
packageSize: [{ required: true, message: '打包要求(每包/个)不能为空', trigger: 'blur' }],
|
|
|
|
|
isEnable: [{ required: true, message: '是否启用不能为空', trigger: 'blur' }],
|
|
|
|
|
|
|
|
|
|
})
|
|
|
|
|
const formRef = ref() // 表单 Ref
|
|
|
|
|
|
|
|
|
|
@ -183,21 +182,35 @@ const openOrderItemsList = () => {
|
|
|
|
|
orderItemsRef.value.open()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const selectionList = ref<SaleOrderItemsVO[]>([])
|
|
|
|
|
/** 表单值 */
|
|
|
|
|
const dealOrder = async (e) => {
|
|
|
|
|
let queryParams = {
|
|
|
|
|
pageNo: 1,
|
|
|
|
|
pageSize: 100,
|
|
|
|
|
orderId: undefined
|
|
|
|
|
selectionList.value = e
|
|
|
|
|
if(selectionList.value.length > 0){
|
|
|
|
|
selectionList.value.forEach((item, index) => {
|
|
|
|
|
console.log(`Item ${index}:`, item);
|
|
|
|
|
// 在这里处理每个item
|
|
|
|
|
const row = {
|
|
|
|
|
id: undefined,
|
|
|
|
|
productId: item.productId,
|
|
|
|
|
unitId: item.productUnitId,
|
|
|
|
|
taskId: props.taskId,
|
|
|
|
|
number: item.count,
|
|
|
|
|
packageSize: undefined,
|
|
|
|
|
projectName: undefined,
|
|
|
|
|
techRequirements: undefined,
|
|
|
|
|
remark: item.remark,
|
|
|
|
|
isEnable: true,
|
|
|
|
|
packageNumber: undefined,
|
|
|
|
|
finishDate: undefined,
|
|
|
|
|
boxingDate: undefined,
|
|
|
|
|
arriveDate: undefined,
|
|
|
|
|
barCode: undefined,
|
|
|
|
|
attachment: undefined,
|
|
|
|
|
}
|
|
|
|
|
formData.value.push(row)
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
queryParams.orderId = e.id
|
|
|
|
|
console.log(e.no)
|
|
|
|
|
|
|
|
|
|
const data = await SaleOrderApi.getSaleOrderItemsPage(queryParams)
|
|
|
|
|
let orderItems = data.list
|
|
|
|
|
|
|
|
|
|
console.log(orderItems)
|
|
|
|
|
console.log(e)
|
|
|
|
|
}
|
|
|
|
|
/** 初始化 */
|
|
|
|
|
onMounted(async () => {
|
|
|
|
|
@ -206,6 +219,8 @@ onMounted(async () => {
|
|
|
|
|
productList.value = await ProductApi.getMesProductSimpleList()
|
|
|
|
|
// 默认添加一个
|
|
|
|
|
if (formData.value.length === 0) {
|
|
|
|
|
// 1. 重置表单
|
|
|
|
|
formData.value = []
|
|
|
|
|
handleAdd()
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
@ -221,6 +236,8 @@ watch(
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
try {
|
|
|
|
|
console.log("props.taskId:"+props.taskId)
|
|
|
|
|
console.log("val:"+val)
|
|
|
|
|
formLoading.value = true
|
|
|
|
|
formData.value = await TaskApi.getTaskDetailListByTaskId(val)
|
|
|
|
|
} finally {
|
|
|
|
|
|