|
@@ -111,49 +111,63 @@
|
|
|
</div>
|
|
|
<div class="el-table-container">
|
|
|
<div class="el-table-inner-container">
|
|
|
- <el-table v-loading="loading" :data="formatDetails" size="small" border height="100%">
|
|
|
- <el-table-column label="批次号" align="center" prop="lotCode" width="120" />
|
|
|
- <el-table-column label="产品描述" align="center" prop="supplierName" width="320" />
|
|
|
+ <el-table v-loading="loading" :data="form.details" size="small" border height="100%">
|
|
|
+ <el-table-column label="行号" type="index" align="center" width="48" />
|
|
|
+ <el-table-column label="批次号" align="center" prop="lotCode" width="104" />
|
|
|
+ <el-table-column label="产品描述" align="center" prop="productDescription" width="320" />
|
|
|
<el-table-column
|
|
|
- :label="form.packagingMethod === 0 ? '箱号' : '原箱号'"
|
|
|
+ :label="form.packagingMethod === '0' ? '箱号' : '原箱号'"
|
|
|
align="center"
|
|
|
- prop="original_carrier"
|
|
|
+ prop="originalCarrier"
|
|
|
width="320"
|
|
|
/>
|
|
|
<el-table-column
|
|
|
- v-if="form.packagingMethod === 1"
|
|
|
+ v-if="form.packagingMethod === '1'"
|
|
|
label="新箱号"
|
|
|
align="center"
|
|
|
prop="new_carrier"
|
|
|
width="320"
|
|
|
>
|
|
|
<template #default="scope">
|
|
|
- <el-input v-if="editStatus" v-model="scope.row.originalCarrier" readonly placeholder="请选择新箱号">
|
|
|
+ <el-input v-if="editStatus" v-model="scope.row.newCarrier" readonly placeholder="请选择新箱号">
|
|
|
<template #append>
|
|
|
<el-button icon="Search" @click="handleShowDialogOutsourceCarriers" />
|
|
|
</template>
|
|
|
</el-input>
|
|
|
- <span v-else>{{ scope.row.originalCarrier }}</span>
|
|
|
+ <span v-else>{{ scope.row.newCarrier }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="外协工序" align="center" prop="new_carrier" width="320">
|
|
|
+ <template #default="scope">
|
|
|
+ <el-input v-if="editStatus" v-model="scope.row.processNames" readonly placeholder="请选择工序">
|
|
|
+ <template #append>
|
|
|
+ <el-button icon="Search" @click="handleShowDialogProcesses(scope.row)" />
|
|
|
+ </template>
|
|
|
+ </el-input>
|
|
|
+ <span v-else>{{ scope.row.processNames }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="备注" align="center" prop="remark">
|
|
|
+ <template #default="scope">
|
|
|
+ <el-input v-if="editStatus" v-model="scope.row.remark" placeholder="备注" />
|
|
|
+ <span v-else>{{ scope.row.processNames }}</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column label="备注" align="center" prop="remark" />
|
|
|
<el-table-column
|
|
|
v-if="editStatus"
|
|
|
label="操作"
|
|
|
align="center"
|
|
|
class-name="small-padding fixed-width"
|
|
|
- width="144"
|
|
|
+ width="64"
|
|
|
>
|
|
|
<template #default="scope">
|
|
|
<el-button
|
|
|
- link
|
|
|
+ circle
|
|
|
type="danger"
|
|
|
icon="Delete"
|
|
|
- @click="handleDelete(scope.row)"
|
|
|
+ @click="handleDelete(scope.$index)"
|
|
|
v-hasPermi="['business:outsource:remove']"
|
|
|
- >
|
|
|
- 删除
|
|
|
- </el-button>
|
|
|
+ />
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
@@ -168,12 +182,15 @@
|
|
|
:supplier-id="form.supplierId"
|
|
|
:multiple-selected="handleMultipleSelectedProducts"
|
|
|
/>
|
|
|
+ <!-- 工序选择 -->
|
|
|
+ <dialog-processes ref="dialogProcessesRef" :multiple-selected="handleMultipleSelectedProcesses" />
|
|
|
</el-drawer>
|
|
|
</template>
|
|
|
<script setup>
|
|
|
import { getOrder, addOrder, updateOrder } from '@/api/business/outsourcedOrder'
|
|
|
import dialogSuppliers from './DialogSuppliers'
|
|
|
import dialogProducts from './DialogProducts'
|
|
|
+import dialogProcesses from './DialogProcesses'
|
|
|
const { proxy } = getCurrentInstance()
|
|
|
/** 父组件传参 */
|
|
|
const props = defineProps({
|
|
@@ -201,25 +218,11 @@ const editStatus = ref(false)
|
|
|
const isFullscreen = ref(false)
|
|
|
const webHost = import.meta.env.VITE_APP_BASE_API
|
|
|
const form = ref({})
|
|
|
-const formatDetails = ref([])
|
|
|
+// const formatDetails = ref([])
|
|
|
const currentDetail = ref({})
|
|
|
const rules = {
|
|
|
supplierName: [{ required: true, message: '外协商名称不能为空', trigger: 'blur' }]
|
|
|
}
|
|
|
-const emptyDetail = ref({
|
|
|
- id: null,
|
|
|
- lotId: null,
|
|
|
- dayworkId: null,
|
|
|
- productId: null,
|
|
|
- productDescription: null,
|
|
|
- technologicalProcessId: null,
|
|
|
- technologyVersion: null,
|
|
|
- originalCarrier: null,
|
|
|
- originalCarrierCount: null,
|
|
|
- newCarrier: null,
|
|
|
- newCarrierCount: null,
|
|
|
- remark: null
|
|
|
-})
|
|
|
|
|
|
/*********************** 方法区 ****************************/
|
|
|
/** 打开抽屉 */
|
|
@@ -252,6 +255,10 @@ function cancel() {
|
|
|
reset()
|
|
|
}
|
|
|
|
|
|
+const handleDelete = (index) => {
|
|
|
+ form.value.details.splice(index, 1)
|
|
|
+}
|
|
|
+
|
|
|
/** 表单重置 */
|
|
|
function reset() {
|
|
|
form.value = {
|
|
@@ -297,19 +304,39 @@ const handleShowDialogSuppliers = () => {
|
|
|
}
|
|
|
// 外协商选择带回
|
|
|
const handleSingleSelectedSupplier = (data) => {
|
|
|
+ console.log(data)
|
|
|
form.value.supplierId = data.id
|
|
|
form.value.supplierName = data.name
|
|
|
+ form.value.deliveryMethod = data.deliveryMethod.toString()
|
|
|
}
|
|
|
|
|
|
/***************************** 产品对话框相关 *****************************/
|
|
|
// 打开产品选择对话框
|
|
|
const handleShowDialogProducts = () => {
|
|
|
- proxy.$refs.dialogProductsRef.open()
|
|
|
+ const dayworkIds = form.value.details.map((item) => item.dayworkId)
|
|
|
+ console.log(dayworkIds)
|
|
|
+ proxy.$refs.dialogProductsRef.open(dayworkIds)
|
|
|
}
|
|
|
// 产品选择带回
|
|
|
const handleMultipleSelectedProducts = (selection) => {
|
|
|
selection.forEach((item) => {
|
|
|
- const newDetail = {}
|
|
|
+ const newDetail = {
|
|
|
+ lotId: item.lotId,
|
|
|
+ lotCode: item.lotCode,
|
|
|
+ dayworkId: item.id,
|
|
|
+ productId: item.productId,
|
|
|
+ productDescription: item.productDescription,
|
|
|
+ technologicalProcessId: item.technologicalProcessId,
|
|
|
+ technologyVersion: item.technologyVersion,
|
|
|
+ originalCarrier: item.originalCarrier,
|
|
|
+ originalCarrierCount: item.originalCarrier.split(',').length,
|
|
|
+ newCarrier: '',
|
|
|
+ newCarrierCount: 0,
|
|
|
+ processNames: '',
|
|
|
+ remark: item.remark,
|
|
|
+ processes: []
|
|
|
+ }
|
|
|
+ console.log(newDetail)
|
|
|
form.value.details.push(newDetail)
|
|
|
})
|
|
|
}
|
|
@@ -325,6 +352,26 @@ const handleMultipleSelectedOutsourceCarriers = (selection) => {
|
|
|
})
|
|
|
}
|
|
|
|
|
|
+/***************************** 外协工序对话框相关 *****************************/
|
|
|
+// 打开外协工序选择对话框
|
|
|
+const handleShowDialogProcesses = (row) => {
|
|
|
+ currentDetail.value = row
|
|
|
+ proxy.$refs.dialogProcessesRef.open()
|
|
|
+}
|
|
|
+// 工序选择带回
|
|
|
+const handleMultipleSelectedProcesses = (selection) => {
|
|
|
+ const processNames = selection.map((item) => item.processAlias)
|
|
|
+ currentDetail.value.processNames = processNames
|
|
|
+ selection.forEach((item) => {
|
|
|
+ const newProcess = {
|
|
|
+ processId: item.processId,
|
|
|
+ processAlias: item.processAlias,
|
|
|
+ processStepNumber: item.processStepNumber
|
|
|
+ }
|
|
|
+ currentDetail.value.processes.push(newProcess)
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
/** 暴露给父组件的方法 */
|
|
|
defineExpose({
|
|
|
open
|