|
@@ -3,69 +3,52 @@
|
|
<!-- 搜索区 -->
|
|
<!-- 搜索区 -->
|
|
<el-form class="list-search-container" :model="queryParams" ref="queryRef" :inline="true" style="margin-right: 0px">
|
|
<el-form class="list-search-container" :model="queryParams" ref="queryRef" :inline="true" style="margin-right: 0px">
|
|
<el-form-item label="单据号:" prop="formCode">
|
|
<el-form-item label="单据号:" prop="formCode">
|
|
- <el-input
|
|
|
|
- v-model="queryParams.formCode"
|
|
|
|
- placeholder="请输入单据号"
|
|
|
|
- style="width: 144px"
|
|
|
|
- clearable
|
|
|
|
- @keyup.enter="handleQuery"
|
|
|
|
- />
|
|
|
|
|
|
+ <el-input v-model="queryParams.formCode" placeholder="请输入单据号" style="width: 144px" clearable
|
|
|
|
+ @keyup.enter="handleQuery" />
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<el-form-item label="批次号:" prop="lotCode">
|
|
<el-form-item label="批次号:" prop="lotCode">
|
|
- <el-input
|
|
|
|
- v-model="queryParams.lotCode"
|
|
|
|
- placeholder="请输入批次号"
|
|
|
|
- style="width: 144px"
|
|
|
|
- clearable
|
|
|
|
- @keyup.enter="handleQuery"
|
|
|
|
- />
|
|
|
|
|
|
+ <el-input v-model="queryParams.lotCode" placeholder="请输入批次号" style="width: 144px" clearable
|
|
|
|
+ @keyup.enter="handleQuery" />
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<el-form-item label="产品描述:" prop="productDescription">
|
|
<el-form-item label="产品描述:" prop="productDescription">
|
|
- <el-input
|
|
|
|
- v-model="queryParams.productDescription"
|
|
|
|
- placeholder="请输入产品描述"
|
|
|
|
- style="width: 144px"
|
|
|
|
- clearable
|
|
|
|
- @keyup.enter="handleQuery"
|
|
|
|
- />
|
|
|
|
|
|
+ <el-input v-model="queryParams.productDescription" placeholder="请输入产品描述" style="width: 144px" clearable
|
|
|
|
+ @keyup.enter="handleQuery" />
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<el-form-item label="外协商:" prop="supplierName">
|
|
<el-form-item label="外协商:" prop="supplierName">
|
|
- <el-input
|
|
|
|
- v-model="queryParams.supplierName"
|
|
|
|
- placeholder="请输入外协商"
|
|
|
|
- style="width: 144px"
|
|
|
|
- clearable
|
|
|
|
- @keyup.enter="handleQuery"
|
|
|
|
- />
|
|
|
|
|
|
+ <el-input v-model="queryParams.supplierName" placeholder="请输入外协商" style="width: 144px" clearable
|
|
|
|
+ @keyup.enter="handleQuery" />
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item label="状态:" prop="supplierName">
|
|
|
|
+ <el-select v-model="queryParams.statusValue" placeholder="请选择周转状态" style="width: 120px;">
|
|
|
|
+ <el-option v-for="item in statusLabels" :key="item.value" :label="item.label" :value="item.value"></el-option>
|
|
|
|
+ </el-select>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item label="标识:">
|
|
|
|
+ <el-select style="width: 360px" multiple v-model="queryParams.flags" clearable placeholder="请选择标识"
|
|
|
|
+ @change="handleFlagChange">
|
|
|
|
+ <el-option v-for="item in is_identification" :key="item.value" :label="item.label"
|
|
|
|
+ :value="item.value"></el-option>
|
|
|
|
+ </el-select>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<el-form-item label="收回日期:" prop="startTime">
|
|
<el-form-item label="收回日期:" prop="startTime">
|
|
- <el-date-picker
|
|
|
|
- v-model="queryParams.startTime"
|
|
|
|
- type="date"
|
|
|
|
- style="width: 144px"
|
|
|
|
- value-format="YYYY-MM-DD"
|
|
|
|
- placeholder="选择起始日期"
|
|
|
|
- clearable
|
|
|
|
- />
|
|
|
|
|
|
+ <el-date-picker v-model="queryParams.startTime" type="date" style="width: 144px" value-format="YYYY-MM-DD"
|
|
|
|
+ placeholder="选择起始日期" clearable />
|
|
<span style="margin: 0 4px">~</span>
|
|
<span style="margin: 0 4px">~</span>
|
|
- <el-date-picker
|
|
|
|
- v-model="queryParams.endTime"
|
|
|
|
- type="date"
|
|
|
|
- style="width: 144px"
|
|
|
|
- value-format="YYYY-MM-DD"
|
|
|
|
- placeholder="选择结束日期"
|
|
|
|
- clearable
|
|
|
|
- />
|
|
|
|
|
|
+ <el-date-picker v-model="queryParams.endTime" type="date" style="width: 144px" value-format="YYYY-MM-DD"
|
|
|
|
+ placeholder="选择结束日期" clearable />
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<el-form-item>
|
|
<el-form-item>
|
|
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
|
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
|
|
|
+ <el-button type="success" icon="Search" @click="handleBatchTurnover">批量周转</el-button>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</el-form>
|
|
</el-form>
|
|
<!-- 渲染数据区 -->
|
|
<!-- 渲染数据区 -->
|
|
<div class="el-table-container">
|
|
<div class="el-table-container">
|
|
<div class="el-table-inner-container">
|
|
<div class="el-table-inner-container">
|
|
- <el-table v-loading="loading" :data="dataList" size="small" border height="100%">
|
|
|
|
- <el-table-column label="收回单号" align="center" prop="formCode" width="120" />
|
|
|
|
|
|
+ <el-table v-loading="loading" :data="dataList" size="small" border height="100%"
|
|
|
|
+ @selection-change="handleOutsourceOrderSelectionChange">
|
|
|
|
+ <el-table-column type="selection" align="center" />
|
|
|
|
+ <!-- <el-table-column label="收回单号" align="center" prop="formCode" width="120" /> -->
|
|
<el-table-column label="外协商" align="center" prop="supplierName" width="120" />
|
|
<el-table-column label="外协商" align="center" prop="supplierName" width="120" />
|
|
<el-table-column label="批次号" align="center" prop="lotCode" width="240" />
|
|
<el-table-column label="批次号" align="center" prop="lotCode" width="240" />
|
|
<el-table-column label="产品描述" align="center" prop="productDescription" width="240" />
|
|
<el-table-column label="产品描述" align="center" prop="productDescription" width="240" />
|
|
@@ -76,11 +59,30 @@
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
<el-table-column label="备注" align="center" prop="remark" />
|
|
<el-table-column label="备注" align="center" prop="remark" />
|
|
- <el-table-column label="周转箱号" align="center" prop="productionCarrier" />
|
|
|
|
|
|
+ <el-table-column label="周转箱号" align="center" prop="productionCarrier">
|
|
|
|
+ <template #default="scope">
|
|
|
|
+ <div>{{ scope.row.productionDeptId === '0' ? scope.row.newCarrierName : scope.row.productionCarrier }}
|
|
|
|
+ </div>
|
|
|
|
+ </template>
|
|
|
|
+ </el-table-column>
|
|
<el-table-column label="周转工段" align="center" prop="productionDeptName" />
|
|
<el-table-column label="周转工段" align="center" prop="productionDeptName" />
|
|
|
|
+ <el-table-column label="状态" align="center" prop="status">
|
|
|
|
+ <template #default="scope">
|
|
|
|
+ <div>{{ scope.row.productionDeptId === '0' ? '待周转' : '已周转' }}</div>
|
|
|
|
+ </template>
|
|
|
|
+ </el-table-column>
|
|
|
|
+ <el-table-column label="批次标识" align="center" prop="lotID">
|
|
|
|
+ <template #default="scope">
|
|
|
|
+ <el-tag v-if="scope.row.isAmend == 1" class="spacing" type="danger">{{ "工艺修改" }}</el-tag>
|
|
|
|
+ <el-tag v-if="scope.row.isWasteRecycling == 1" class="spacing" type="danger">{{ "废品回用" }}</el-tag>
|
|
|
|
+ <el-tag v-if="scope.row.isWasteRecycling == 0 && scope.row.isAmend == 0" class="spacing">{{
|
|
|
|
+ "正常批次" }}</el-tag>
|
|
|
|
+ </template>
|
|
|
|
+ </el-table-column>
|
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="64">
|
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="64">
|
|
<template #default="scope">
|
|
<template #default="scope">
|
|
- <el-button v-if="scope.row.flag" link type="warning" icon="Edit" @click="handleShowTurnoverDialog(scope.row)"> 编辑 </el-button>
|
|
|
|
|
|
+ <el-button v-if="scope.row.flag" link type="warning" icon="Edit"
|
|
|
|
+ @click="handleShowTurnoverDialog(scope.row)"> 编辑 </el-button>
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
</el-table>
|
|
</el-table>
|
|
@@ -88,34 +90,55 @@
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<!-- 分页 -->
|
|
<!-- 分页 -->
|
|
- <pagination
|
|
|
|
- v-show="total > 0"
|
|
|
|
- :total="total"
|
|
|
|
- v-model:page="queryParams.pageNum"
|
|
|
|
- v-model:limit="queryParams.pageSize"
|
|
|
|
- @pagination="getList"
|
|
|
|
- />
|
|
|
|
|
|
+ <pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum"
|
|
|
|
+ v-model:limit="queryParams.pageSize" @pagination="getList" />
|
|
<!-- 周转信息弹窗 -->
|
|
<!-- 周转信息弹窗 -->
|
|
<dialog-return-turnover ref="dialogReturnTurnoverRef" @handleSaveSuccess=getList() />
|
|
<dialog-return-turnover ref="dialogReturnTurnoverRef" @handleSaveSuccess=getList() />
|
|
|
|
+ <dialog-return-turnover-batch ref="dialogReturnTurnoverBatchRef" @handleSaveSuccess="getList" />
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script setup name="ReturnTurnover">
|
|
<script setup name="ReturnTurnover">
|
|
-import { getFinishedReturnList ,getProcessInspectionList } from '@/api/business/returnTurnover'
|
|
|
|
-import {getP2NeedCheckProcess} from '@/api/business/p2'
|
|
|
|
|
|
+import { getFinishedReturnList, getProcessInspectionList, checkCarriers } from '@/api/business/returnTurnover'
|
|
|
|
+import { getP2NeedCheckProcess } from '@/api/business/p2'
|
|
import dialogReturnTurnover from './DialogReturnTurnover.vue';
|
|
import dialogReturnTurnover from './DialogReturnTurnover.vue';
|
|
|
|
+import DialogReturnTurnoverBatch from './DialogReturnTurnoverBatch.vue';
|
|
const { proxy } = getCurrentInstance()
|
|
const { proxy } = getCurrentInstance()
|
|
const dataList = ref([])
|
|
const dataList = ref([])
|
|
const loading = ref(false)
|
|
const loading = ref(false)
|
|
const ids = ref([])
|
|
const ids = ref([])
|
|
const total = ref(0)
|
|
const total = ref(0)
|
|
|
|
+const selections = ref([])
|
|
|
|
+const statusLabels = ref([{
|
|
|
|
+ value: '0',
|
|
|
|
+ label: '全部'
|
|
|
|
+}, {
|
|
|
|
+ value: '1',
|
|
|
|
+ label: '待周转'
|
|
|
|
+}, {
|
|
|
|
+ value: '2',
|
|
|
|
+ label: '已周转'
|
|
|
|
+}])
|
|
/** 查询对象 */
|
|
/** 查询对象 */
|
|
const queryParams = ref({
|
|
const queryParams = ref({
|
|
pageNum: 1,
|
|
pageNum: 1,
|
|
pageSize: 10,
|
|
pageSize: 10,
|
|
formCode: null,
|
|
formCode: null,
|
|
- formDate: null
|
|
|
|
|
|
+ formDate: null,
|
|
|
|
+ statusValue: '1'
|
|
})
|
|
})
|
|
|
|
+/** 字典数组区 */
|
|
|
|
+// const { is_identification } = proxy.useDict("is_identification");
|
|
|
|
+const is_identification = ref([{
|
|
|
|
+ value: '1',
|
|
|
|
+ label: '废品回用'
|
|
|
|
+}, {
|
|
|
|
+ value: '2',
|
|
|
|
+ label: '工艺修改'
|
|
|
|
+}, {
|
|
|
|
+ value: '3',
|
|
|
|
+ label: '正常批次'
|
|
|
|
+}])
|
|
|
|
|
|
/*********************** 方法区 ****************************/
|
|
/*********************** 方法区 ****************************/
|
|
|
|
|
|
@@ -138,6 +161,7 @@ function handleQuery() {
|
|
/** 重置按钮操作 */
|
|
/** 重置按钮操作 */
|
|
function resetQuery() {
|
|
function resetQuery() {
|
|
proxy.resetForm('queryRef')
|
|
proxy.resetForm('queryRef')
|
|
|
|
+ queryParams.value.statusValue = '1'
|
|
handleQuery()
|
|
handleQuery()
|
|
}
|
|
}
|
|
|
|
|
|
@@ -146,15 +170,16 @@ function handleShowTurnoverDialog(row) {
|
|
console.log(row)
|
|
console.log(row)
|
|
//proxy.$refs.dialogReturnTurnoverRef.open(row)
|
|
//proxy.$refs.dialogReturnTurnoverRef.open(row)
|
|
//判断该批次的工序是否需要审核
|
|
//判断该批次的工序是否需要审核
|
|
|
|
+ /*
|
|
getP2NeedCheckProcess("Y").then(res => {
|
|
getP2NeedCheckProcess("Y").then(res => {
|
|
- if(res.code == 200) {
|
|
|
|
|
|
+ if (res.code == 200) {
|
|
//需要序检的工序
|
|
//需要序检的工序
|
|
var process = []
|
|
var process = []
|
|
let needCheckProcessCodeList = res.rows.map(item => item.prcode.trim())
|
|
let needCheckProcessCodeList = res.rows.map(item => item.prcode.trim())
|
|
- let returnReceiptProcessCodeList=row.finishedProcesses.map(v => ({ processCode: v.processCode, processStepNumber: v.processStepNumber,returnReceiptDetailId:v.returnReceiptDetailId }))
|
|
|
|
- for(let i = 0;i<needCheckProcessCodeList.length;i++) {
|
|
|
|
- for(let j = 0;j<returnReceiptProcessCodeList.length;j++) {
|
|
|
|
- if(needCheckProcessCodeList[i] == returnReceiptProcessCodeList[j].processCode) {
|
|
|
|
|
|
+ let returnReceiptProcessCodeList = row.finishedProcesses.map(v => ({ processCode: v.processCode, processStepNumber: v.processStepNumber, returnReceiptDetailId: v.returnReceiptDetailId }))
|
|
|
|
+ for (let i = 0; i < needCheckProcessCodeList.length; i++) {
|
|
|
|
+ for (let j = 0; j < returnReceiptProcessCodeList.length; j++) {
|
|
|
|
+ if (needCheckProcessCodeList[i] == returnReceiptProcessCodeList[j].processCode) {
|
|
process.push(returnReceiptProcessCodeList[j])
|
|
process.push(returnReceiptProcessCodeList[j])
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -162,22 +187,25 @@ function handleShowTurnoverDialog(row) {
|
|
console.log(needCheckProcessCodeList)
|
|
console.log(needCheckProcessCodeList)
|
|
console.log(returnReceiptProcessCodeList)
|
|
console.log(returnReceiptProcessCodeList)
|
|
console.log(process)
|
|
console.log(process)
|
|
- if(process.length >0) {
|
|
|
|
|
|
+ if (process.length > 0) {
|
|
getProcessInspectionList(process[process.length - 1]).then(res => {
|
|
getProcessInspectionList(process[process.length - 1]).then(res => {
|
|
- if(res.code == 200) {
|
|
|
|
- if(res.data){
|
|
|
|
- proxy.$refs.dialogReturnTurnoverRef.open(row)
|
|
|
|
|
|
+ if (res.code == 200) {
|
|
|
|
+ if (res.data) {
|
|
|
|
+ proxy.$refs.dialogReturnTurnoverRef.open(row)
|
|
}
|
|
}
|
|
else {
|
|
else {
|
|
proxy.$modal.msgError('当前批次检查未处于合格状态,暂时无法周转')
|
|
proxy.$modal.msgError('当前批次检查未处于合格状态,暂时无法周转')
|
|
}
|
|
}
|
|
}
|
|
}
|
|
})
|
|
})
|
|
- }else {
|
|
|
|
|
|
+ } else {
|
|
proxy.$refs.dialogReturnTurnoverRef.open(row)
|
|
proxy.$refs.dialogReturnTurnoverRef.open(row)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
})
|
|
})
|
|
|
|
+ // */
|
|
|
|
+
|
|
|
|
+ proxy.$refs.dialogReturnTurnoverRef.open(row)
|
|
}
|
|
}
|
|
|
|
|
|
/** 导出按钮操作 */
|
|
/** 导出按钮操作 */
|
|
@@ -191,5 +219,77 @@ function handleExport() {
|
|
)
|
|
)
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+function handleFlagChange() {
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+function handleOutsourceOrderSelectionChange(selection) {
|
|
|
|
+ selections.value = selection
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+async function handleBatchTurnover() {
|
|
|
|
+ // 批量周转
|
|
|
|
+ // 判断是否选择批次周转项
|
|
|
|
+ if (selections.value.some(v => v.productionDeptId != '0')) {
|
|
|
|
+ proxy.$modal.msgError('请选择未周转外协单进行周转')
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ if (selections.value.length === 0) {
|
|
|
|
+ proxy.$modal.msgError('请选择一条外协单进行周转')
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ // 先判断批量周转是否是同一个产品
|
|
|
|
+ if (selections.value.findIndex(v => v.productId != selections.value[0].productId) >= 0) {
|
|
|
|
+ proxy.$modal.msgError('请选择同一产品进行批量周转')
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ // 判断批量周转中是否存在单批单改
|
|
|
|
+ if (selections.value.length > 1 && selections.value.findIndex(v => v.isAmend == 1 || v.isWasteRecycling == 1) >= 0) {
|
|
|
|
+ proxy.$modal.msgError('请选择标准工艺批次进行批量周转')
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ const carriers = selections.value.map(v => v.newCarrierName).join()
|
|
|
|
+ const res = await checkCarriers({ carriers: carriers })
|
|
|
|
+ if (!res.data) {
|
|
|
|
+ proxy.$modal.msgError('请不要选择外协箱外协单进行批量周转')
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ /*
|
|
|
|
+ getP2NeedCheckProcess("Y").then(res => {
|
|
|
|
+ if (res.code == 200) {
|
|
|
|
+ //需要序检的工序
|
|
|
|
+ var process = []
|
|
|
|
+ let needCheckProcessCodeList = res.rows.map(item => item.prcode.trim())
|
|
|
|
+ let returnReceiptProcessCodeList = row.finishedProcesses.map(v => ({ processCode: v.processCode, processStepNumber: v.processStepNumber, returnReceiptDetailId: v.returnReceiptDetailId }))
|
|
|
|
+ for (let i = 0; i < needCheckProcessCodeList.length; i++) {
|
|
|
|
+ for (let j = 0; j < returnReceiptProcessCodeList.length; j++) {
|
|
|
|
+ if (needCheckProcessCodeList[i] == returnReceiptProcessCodeList[j].processCode) {
|
|
|
|
+ process.push(returnReceiptProcessCodeList[j])
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ console.log(needCheckProcessCodeList)
|
|
|
|
+ console.log(returnReceiptProcessCodeList)
|
|
|
|
+ console.log(process)
|
|
|
|
+ if (process.length > 0) {
|
|
|
|
+ getProcessInspectionList(process[process.length - 1]).then(res => {
|
|
|
|
+ if (res.code == 200) {
|
|
|
|
+ if (res.data) {
|
|
|
|
+ proxy.$refs.dialogReturnTurnoverRef.openBatch(selections.value)
|
|
|
|
+ }
|
|
|
|
+ else {
|
|
|
|
+ proxy.$modal.msgError('当前批次检查未处于合格状态,暂时无法周转')
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ } else {
|
|
|
|
+ proxy.$refs.dialogReturnTurnoverBatchRef.openBatch(selections.value)
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ // */
|
|
|
|
+
|
|
|
|
+ proxy.$refs.dialogReturnTurnoverBatchRef.openBatch(selections.value)
|
|
|
|
+}
|
|
|
|
+
|
|
getList();
|
|
getList();
|
|
</script>
|
|
</script>
|