|
|
|
|
@ -27,11 +27,11 @@
|
|
|
|
|
<el-form-item label="联系人" prop="customerUser">
|
|
|
|
|
<el-input v-model="queryParams.customerUser" placeholder="请输入联系人" clearable @keyup.enter="handleQuery" />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<!-- <el-form-item label="出库(单状态1暂存 2审批中 3完成)" prop="outStockBillStatus">
|
|
|
|
|
<el-select v-model="queryParams.outStockBillStatus" placeholder="请选择出库(单状态1暂存 2审批中 3完成)" clearable>
|
|
|
|
|
<el-option v-for="dict in wms_in_stock_bill_status" :key="dict.value" :label="dict.label" :value="dict.value" />
|
|
|
|
|
</el-select>
|
|
|
|
|
</el-form-item>-->
|
|
|
|
|
<el-form-item label="出库单状态" prop="outStockBillStatus">
|
|
|
|
|
<el-select v-model="queryParams.outStockBillStatus" placeholder="请选择出库单状态" clearable>
|
|
|
|
|
<el-option v-for="dict in wms_out_bill_status" :key="dict.value" :label="dict.label" :value="dict.value" />
|
|
|
|
|
</el-select>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="仓库" prop="warehouseId">
|
|
|
|
|
<el-select v-model="queryParams.warehouseId" placeholder="请选择仓库" clearable filterable>
|
|
|
|
|
<el-option v-for="item in warehouseInfoList" :key="item.warehouseId" :label="item.warehouseName" :value="item.warehouseId" />
|
|
|
|
|
@ -64,16 +64,16 @@
|
|
|
|
|
<el-col :span="1.5">
|
|
|
|
|
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['wms:outStockBill:add']">新增 </el-button>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="1.5">
|
|
|
|
|
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()" v-hasPermi="['wms:outStockBill:edit']"
|
|
|
|
|
>修改
|
|
|
|
|
</el-button>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="1.5">
|
|
|
|
|
<el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()" v-hasPermi="['wms:outStockBill:remove']"
|
|
|
|
|
>删除
|
|
|
|
|
</el-button>
|
|
|
|
|
</el-col>
|
|
|
|
|
<!--<el-col :span="1.5">-->
|
|
|
|
|
<!-- <el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()" v-hasPermi="['wms:outStockBill:edit']"-->
|
|
|
|
|
<!-- >修改-->
|
|
|
|
|
<!-- </el-button>-->
|
|
|
|
|
<!--</el-col>-->
|
|
|
|
|
<!--<el-col :span="1.5">-->
|
|
|
|
|
<!-- <el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()" v-hasPermi="['wms:outStockBill:remove']"-->
|
|
|
|
|
<!-- >删除-->
|
|
|
|
|
<!-- </el-button>-->
|
|
|
|
|
<!--</el-col>-->
|
|
|
|
|
<!--<el-col :span="1.5">-->
|
|
|
|
|
<!-- <el-button type="warning" plain icon="Download" @click="handleExport" v-hasPermi="['wms:outStockBill:export']">导出 </el-button>-->
|
|
|
|
|
<!--</el-col>-->
|
|
|
|
|
@ -105,11 +105,11 @@
|
|
|
|
|
<el-table-column label="出库单ID" align="center" prop="outStockBillId" v-if="columns[0].visible" />
|
|
|
|
|
<el-table-column label="租户编号" align="center" prop="tenantId" v-if="columns[1].visible" />
|
|
|
|
|
<el-table-column label="出库单号" align="center" prop="outStockCode" v-if="columns[2].visible" />
|
|
|
|
|
<el-table-column label="仓库" align="center" prop="warehouseId" v-if="columns[12].visible">
|
|
|
|
|
<template #default="scope">
|
|
|
|
|
<span>{{ getWarehouseName(scope.row.warehouseId) }}</span>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<!--<el-table-column label="仓库" align="center" prop="warehouseId" v-if="columns[12].visible">-->
|
|
|
|
|
<!-- <template #default="scope">-->
|
|
|
|
|
<!-- <span>{{ getWarehouseName(scope.row.warehouseId) }}</span>-->
|
|
|
|
|
<!-- </template>-->
|
|
|
|
|
<!--</el-table-column>-->
|
|
|
|
|
<el-table-column label="出库单类型" align="center" prop="outStockType" v-if="columns[3].visible">
|
|
|
|
|
<template #default="scope">
|
|
|
|
|
<dict-tag :options="out_stock_type" :value="scope.row.outStockType" />
|
|
|
|
|
@ -129,9 +129,9 @@
|
|
|
|
|
<el-table-column label="联系人" align="center" prop="customerUser" v-if="columns[7].visible" />
|
|
|
|
|
<el-table-column label="联系电话" align="center" prop="customerNumber" v-if="columns[8].visible" />
|
|
|
|
|
<el-table-column label="出库说明" align="center" prop="directions" v-if="columns[9].visible" />
|
|
|
|
|
<el-table-column label="出库(单状态1暂存 2审批中 3完成)" align="center" prop="outStockBillStatus" v-if="columns[10].visible">
|
|
|
|
|
<el-table-column label="出库单状态" align="center" prop="outStockBillStatus" v-if="columns[10].visible">
|
|
|
|
|
<template #default="scope">
|
|
|
|
|
<dict-tag :options="wms_in_stock_bill_status" :value="scope.row.outStockBillStatus" />
|
|
|
|
|
<dict-tag :options="wms_out_bill_status" :value="scope.row.outStockBillStatus" />
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column label="流程状态" align="center" prop="flowStatus" v-if="columns[11].visible">
|
|
|
|
|
@ -162,6 +162,20 @@
|
|
|
|
|
<el-tooltip content="删除" placement="top">
|
|
|
|
|
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['wms:outStockBill:remove']"></el-button>
|
|
|
|
|
</el-tooltip>
|
|
|
|
|
<!-- 补录按钮:状态为1或3且projectId为空时显示 -->
|
|
|
|
|
<el-tooltip content="补录项目" placement="top">
|
|
|
|
|
<el-button
|
|
|
|
|
link
|
|
|
|
|
type="success"
|
|
|
|
|
icon="DocumentAdd"
|
|
|
|
|
@click="handleProjectAdd(scope.row)"
|
|
|
|
|
v-hasPermi="['wms:outStockBill:edit']"
|
|
|
|
|
></el-button>
|
|
|
|
|
</el-tooltip>
|
|
|
|
|
<!-- 发货按钮:状态为2时显示 -->
|
|
|
|
|
<el-tooltip content="出库" placement="top">
|
|
|
|
|
<el-button link type="warning" icon="guide" @click="handleDeliver(scope.row)" v-hasPermi="['wms:outStockBill:edit']"></el-button>
|
|
|
|
|
</el-tooltip>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
</el-table>
|
|
|
|
|
@ -300,11 +314,32 @@
|
|
|
|
|
<!--</div>-->
|
|
|
|
|
</template>
|
|
|
|
|
</el-dialog>
|
|
|
|
|
<!--补录项目-->
|
|
|
|
|
<el-dialog :title="addProjectDialog.title" v-model="addProjectDialog.visible" width="500px" append-to-body>
|
|
|
|
|
<el-form ref="outStockBillFormRef" :model="form" :rules="rules" label-width="120px">
|
|
|
|
|
<el-form-item label="项目" prop="projectId">
|
|
|
|
|
<el-select v-model="form.projectId" placeholder="请选择项目" filterable clearable>
|
|
|
|
|
<el-option
|
|
|
|
|
v-for="item in projectInfoList"
|
|
|
|
|
:key="item.projectId"
|
|
|
|
|
:label="`${item.projectCode} - ${item.projectName}`"
|
|
|
|
|
:value="item.projectId"
|
|
|
|
|
></el-option>
|
|
|
|
|
</el-select>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-form>
|
|
|
|
|
<template #footer>
|
|
|
|
|
<div class="dialog-footer">
|
|
|
|
|
<el-button :loading="buttonLoading" type="primary" @click="submitAddProjectForm">确 定</el-button>
|
|
|
|
|
<el-button @click="cancel">取 消</el-button>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
</el-dialog>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script setup name="OutStockBill" lang="ts">
|
|
|
|
|
import { addOutStockBill, delOutStockBill, getOutStockBill, listOutStockBill } from '@/api/wms/outStockBill';
|
|
|
|
|
import { addOutStockBill, deliverOutStockBill, delOutStockBill, getOutStockBill, listOutStockBill, updateOutStockBill } from '@/api/wms/outStockBill';
|
|
|
|
|
import { OutStockBillForm, OutStockBillQuery, OutStockBillVO } from '@/api/wms/outStockBill/types';
|
|
|
|
|
import { getErpProjectInfoList } from '@/api/oa/erp/projectInfo';
|
|
|
|
|
import { getCrmCustomerInfoList } from '@/api/oa/crm/customerInfo';
|
|
|
|
|
@ -314,9 +349,7 @@ import { ElMessage } from 'element-plus';
|
|
|
|
|
import { getWmsOutStockDetailsList } from '@/api/wms/outStockDetails';
|
|
|
|
|
|
|
|
|
|
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
|
|
|
|
const { wms_in_stock_bill_status, out_stock_type, flow_status } = toRefs<any>(
|
|
|
|
|
proxy?.useDict('wms_in_stock_bill_status', 'out_stock_type', 'flow_status')
|
|
|
|
|
);
|
|
|
|
|
const { wms_out_bill_status, out_stock_type, flow_status } = toRefs<any>(proxy?.useDict('wms_out_bill_status', 'out_stock_type', 'flow_status'));
|
|
|
|
|
|
|
|
|
|
const outStockBillList = ref<OutStockBillVO[]>([]);
|
|
|
|
|
const buttonLoading = ref(false);
|
|
|
|
|
@ -345,6 +378,11 @@ const dialog = reactive<DialogOption>({
|
|
|
|
|
visible: false,
|
|
|
|
|
title: ''
|
|
|
|
|
});
|
|
|
|
|
// 补录项目对话框
|
|
|
|
|
const addProjectDialog = reactive<DialogOption>({
|
|
|
|
|
visible: false,
|
|
|
|
|
title: '补录项目'
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// 列显隐信息
|
|
|
|
|
const columns = ref<FieldOption[]>([
|
|
|
|
|
@ -358,9 +396,9 @@ const columns = ref<FieldOption[]>([
|
|
|
|
|
{ key: 7, label: `联系人`, visible: true },
|
|
|
|
|
{ key: 8, label: `联系电话`, visible: true },
|
|
|
|
|
{ key: 9, label: `出库说明`, visible: true },
|
|
|
|
|
{ key: 10, label: `出库(单状态1暂存 2审批中 3完成)`, visible: false },
|
|
|
|
|
{ key: 10, label: `出库单状态`, visible: true },
|
|
|
|
|
{ key: 11, label: `流程状态`, visible: false },
|
|
|
|
|
{ key: 12, label: `仓库ID`, visible: true },
|
|
|
|
|
{ key: 12, label: `仓库ID`, visible: false },
|
|
|
|
|
{ key: 13, label: `备注`, visible: false },
|
|
|
|
|
{ key: 14, label: `删除标志`, visible: false },
|
|
|
|
|
{ key: 15, label: `创建部门`, visible: false },
|
|
|
|
|
@ -550,6 +588,11 @@ const handleAdd = () => {
|
|
|
|
|
|
|
|
|
|
/** 修改按钮操作 */
|
|
|
|
|
const handleUpdate = async (row?: OutStockBillVO) => {
|
|
|
|
|
// 检查出库单状态,不为0时给出提示
|
|
|
|
|
if (row?.outStockBillStatus !== '0') {
|
|
|
|
|
ElMessage.warning('只能修改状态为暂存的出库单');
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
reset();
|
|
|
|
|
const _outStockBillId = row?.outStockBillId || ids.value[0];
|
|
|
|
|
const res = await getOutStockBill(_outStockBillId);
|
|
|
|
|
@ -558,6 +601,28 @@ const handleUpdate = async (row?: OutStockBillVO) => {
|
|
|
|
|
dialog.title = '修改出库单';
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/** 补录 */
|
|
|
|
|
const handleProjectAdd = async (row?: OutStockBillVO) => {
|
|
|
|
|
// if (row.projectId) {
|
|
|
|
|
// ElMessage.warning('出库项目已维护');
|
|
|
|
|
// return;
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
reset();
|
|
|
|
|
const _outStockBillId = row?.outStockBillId || ids.value[0];
|
|
|
|
|
const res = await getOutStockBill(_outStockBillId);
|
|
|
|
|
Object.assign(form.value, res.data);
|
|
|
|
|
addProjectDialog.visible = true;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/** 提交添加项目表单 */
|
|
|
|
|
const submitAddProjectForm = () => {
|
|
|
|
|
outStockBillFormRef.value?.validate(async (valid: boolean) => {
|
|
|
|
|
if (valid && form.value.outStockBillId) {
|
|
|
|
|
await updateOutStockBill(form.value).finally(() => (buttonLoading.value = false));
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
/** 提交按钮 */
|
|
|
|
|
const submitForm = () => {
|
|
|
|
|
outStockBillFormRef.value?.validate(async (valid: boolean) => {
|
|
|
|
|
@ -601,15 +666,36 @@ const submitForm = () => {
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/** 删除按钮操作 */
|
|
|
|
|
const handleDelete = async (row?: OutStockBillVO) => {
|
|
|
|
|
// 检查出库单状态,不为0时给出提示
|
|
|
|
|
if (row?.outStockBillStatus !== '0') {
|
|
|
|
|
ElMessage.warning('只能删除备货状态的出库单');
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
const _outStockBillIds = row?.outStockBillId || ids.value;
|
|
|
|
|
await proxy?.$modal.confirm('是否确认删除出库单编号为"' + _outStockBillIds + '"的数据项?').finally(() => (loading.value = false));
|
|
|
|
|
await delOutStockBill(_outStockBillIds);
|
|
|
|
|
proxy?.$modal.msgSuccess('删除成功');
|
|
|
|
|
await getList();
|
|
|
|
|
};
|
|
|
|
|
/** 发货操作 */
|
|
|
|
|
const handleDeliver = async (row?: OutStockBillVO) => {
|
|
|
|
|
if (row.outStockBillStatus !== '0') {
|
|
|
|
|
ElMessage.warning('不符合发货条件');
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
try {
|
|
|
|
|
await proxy?.$modal.confirm('是否确认出库?').finally(() => (loading.value = false));
|
|
|
|
|
// 调用发货接口
|
|
|
|
|
await deliverOutStockBill(row.outStockBillId);
|
|
|
|
|
ElMessage.success('出库成功');
|
|
|
|
|
// 刷新列表
|
|
|
|
|
await getList();
|
|
|
|
|
} catch (error) {
|
|
|
|
|
ElMessage.error('出库失败');
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/** 导出按钮操作 */
|
|
|
|
|
const handleExport = () => {
|
|
|
|
|
|