尝试销售
parent
52c41bc869
commit
b039614aec
|
|
@ -0,0 +1,51 @@
|
|||
import request from '@/config/axios'
|
||||
|
||||
// ERP 销售出库项二维码 VO
|
||||
export interface SaleOutItemsQrVO {
|
||||
id: number // 编号
|
||||
outId: number // 销售出库编号
|
||||
orderItemId: number // 销售订单项编号
|
||||
outItemId: number // 销售出库单项编号
|
||||
warehouseId: number // 仓库编号
|
||||
productId: number // 产品编号
|
||||
productUnitId: number // 产品单位单位
|
||||
productPrice: number // 产品单价
|
||||
count: number // 数量
|
||||
totalPrice: number // 总价
|
||||
taxPercent: number // 税率,百分比
|
||||
taxPrice: number // 税额,单位:元
|
||||
remark: string // 备注
|
||||
}
|
||||
|
||||
// ERP 销售出库项二维码 API
|
||||
export const SaleOutItemsQrApi = {
|
||||
// 查询ERP 销售出库项二维码分页
|
||||
getSaleOutItemsQrPage: async (params: any) => {
|
||||
return await request.get({ url: `/erp/sale-out-items-qr/page`, params })
|
||||
},
|
||||
|
||||
// 查询ERP 销售出库项二维码详情
|
||||
getSaleOutItemsQr: async (id: number) => {
|
||||
return await request.get({ url: `/erp/sale-out-items-qr/get?id=` + id })
|
||||
},
|
||||
|
||||
// 新增ERP 销售出库项二维码
|
||||
createSaleOutItemsQr: async (data: SaleOutItemsQrVO) => {
|
||||
return await request.post({ url: `/erp/sale-out-items-qr/create`, data })
|
||||
},
|
||||
|
||||
// 修改ERP 销售出库项二维码
|
||||
updateSaleOutItemsQr: async (data: SaleOutItemsQrVO) => {
|
||||
return await request.put({ url: `/erp/sale-out-items-qr/update`, data })
|
||||
},
|
||||
|
||||
// 删除ERP 销售出库项二维码
|
||||
deleteSaleOutItemsQr: async (id: number) => {
|
||||
return await request.delete({ url: `/erp/sale-out-items-qr/delete?id=` + id })
|
||||
},
|
||||
|
||||
// 导出ERP 销售出库项二维码 Excel
|
||||
exportSaleOutItemsQr: async (params) => {
|
||||
return await request.download({ url: `/erp/sale-out-items-qr/export-excel`, params })
|
||||
}
|
||||
}
|
||||
|
|
@ -8,13 +8,38 @@
|
|||
<el-table-column label="仓库名称" min-width="125">
|
||||
<template #default="{ row, $index }">
|
||||
<el-form-item :prop="`${$index}.warehouseId`" :rules="formRules.warehouseId" class="mb-0px!">
|
||||
<el-select v-model="row.warehouseId" clearable filterable placeholder="请选择仓库"
|
||||
<el-select :disabled="!row.ifQr" v-model="row.warehouseId" clearable filterable placeholder="请选择仓库"
|
||||
@change="onChangeWarehouse($event, row)">
|
||||
<el-option v-for="item in warehouseList" :key="item.id" :label="item.name" :value="item.id" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="货位" min-width="125">
|
||||
<template #default="{ row, $index }">
|
||||
<el-form-item
|
||||
:prop="`${$index}.warehouseLocationId`"
|
||||
:rules="formRules.warehouseLocationId"
|
||||
class="mb-0px!"
|
||||
>
|
||||
<el-select
|
||||
v-model="row.warehouseLocationId"
|
||||
:disabled="!row.ifQr"
|
||||
clearable
|
||||
filterable
|
||||
placeholder="请选择货位"
|
||||
|
||||
>
|
||||
<el-option
|
||||
v-for="item in locationList"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="产品名称" min-width="180">
|
||||
<template #default="{ row }">
|
||||
<el-form-item class="mb-0px!">
|
||||
|
|
@ -180,12 +205,14 @@ const formLoading = ref(false) // 表单的加载中
|
|||
const formData = ref([])
|
||||
const formRules = reactive({
|
||||
warehouseId: [{ required: true, message: '仓库不能为空', trigger: 'blur' }],
|
||||
warehouseLocationId: [{ required: true, message: '货位不能为空', trigger: 'blur' }],
|
||||
productId: [{ required: true, message: '产品不能为空', trigger: 'blur' }],
|
||||
count: [{ required: true, message: '产品数量不能为空', trigger: 'blur' }]
|
||||
})
|
||||
|
||||
const formRef = ref([]) // 表单 Ref
|
||||
const warehouseList = ref<WarehouseVO[]>([]) // 仓库列表
|
||||
const locationList = ref<WarehouseLocationVO[]>([]) // 仓库列表
|
||||
const defaultWarehouse = ref<WarehouseVO>(undefined) // 默认仓库
|
||||
//一物一码弹窗
|
||||
const qrDialogVisible = ref(false)
|
||||
|
|
@ -204,6 +231,11 @@ const message = useMessage() // 消息弹窗
|
|||
// 引用二维码表格弹窗组件
|
||||
const qrCodeTableDialogRef = ref();
|
||||
|
||||
const queryLocationParams = reactive({
|
||||
pageNo: 1,
|
||||
pageSize: 100,
|
||||
warehouseId: undefined as unknown
|
||||
})
|
||||
//接收子组件传过来的数据
|
||||
const onQrCodeList = (qrCodeList, index) => {
|
||||
//判断qrCodeList是否为空
|
||||
|
|
@ -432,5 +464,7 @@ defineExpose({ validate })
|
|||
onMounted(async () => {
|
||||
warehouseList.value = await WarehouseApi.getWarehouseSimpleList()
|
||||
defaultWarehouse.value = warehouseList.value.find((item) => item.defaultStatus)
|
||||
locationList.value = onChangeWarehouse({pageNo: 1,pageSize: 100,warehouseId: defaultWarehouse.value?.id})
|
||||
|
||||
})
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,146 @@
|
|||
<template>
|
||||
<Dialog v-model="dialogVisible" title="二维码列表" width="60%">
|
||||
|
||||
<el-form ref="formRef" label-width="100px">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="20">
|
||||
<el-form-item label="二维码" prop="no">
|
||||
<el-input v-model="qr" ref="qrInputRef" placeholder="扫描二维码" @keyup.enter="handleQrEnter" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-form-item v-show="false" label="隐藏字段">
|
||||
<el-input v-model="qrHiden" placeholder="隐藏字段" @keyup.enter="handleQrEnter" />
|
||||
</el-form-item>
|
||||
</el-row>
|
||||
|
||||
<ContentWrap>
|
||||
<el-table :data="qrCodeRowList">
|
||||
<!-- 序号 -->
|
||||
<el-table-column label="序号" type="index" align="center" width="60" />
|
||||
<el-table-column prop="qr" label="二维码" />
|
||||
<el-table-column prop="warehouseName" label="仓库" />
|
||||
<el-table-column prop="warehouseLocationName" label="货位" />
|
||||
<el-table-column prop="productName" label="产品名称" />
|
||||
<el-table-column prop="productUnitName" label="产品单位" />
|
||||
<!-- 操作列 -->
|
||||
<el-table-column label="操作">
|
||||
<template #default="scope">
|
||||
<el-button @click="deleteRow(scope.$index)" link>
|
||||
—
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</ContentWrap>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<el-button type="primary" @click="submitQr">确 定</el-button>
|
||||
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||
</template>
|
||||
</Dialog>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref, defineProps, defineEmits } from 'vue';
|
||||
import {
|
||||
matchRulesFromDictOptions
|
||||
} from '@/utils'
|
||||
|
||||
const props = defineProps({
|
||||
currentRow: {
|
||||
type: Object,
|
||||
required: true
|
||||
},
|
||||
currentRowIndex: {
|
||||
type: Number,
|
||||
required: true
|
||||
}
|
||||
});
|
||||
// 监听 currentRowIndex 的变化
|
||||
watch(() => props.currentRowIndex, (newIndex) => {
|
||||
// 在这里处理 currentRowIndex 变化的逻辑
|
||||
console.log('currentRowIndex 已更新为:', newIndex);
|
||||
});
|
||||
|
||||
const formRef = ref();
|
||||
const qr = ref('');
|
||||
const qrHiden = ref('');
|
||||
// 新增 ref 用于获取输入框 DOM 元素
|
||||
const qrInputRef = ref(null);
|
||||
|
||||
const emits = defineEmits(['submit-data', 'close']);
|
||||
|
||||
const dialogVisible = ref(false);
|
||||
const qrCodeRowList = ref([]);
|
||||
const message = useMessage() // 消息弹窗
|
||||
|
||||
|
||||
const open = async (row,index)=>{
|
||||
// 当 currentRow 变化时,更新 qrCodeRowList
|
||||
qrCodeRowList.value = [];
|
||||
if (row.qrcodes) {
|
||||
row.qrcodes.split('\n').forEach((item) => {
|
||||
const newRow = { ...row, qr: item };
|
||||
qrCodeRowList.value.push(newRow);
|
||||
});
|
||||
}
|
||||
|
||||
dialogVisible.value = true;
|
||||
};
|
||||
|
||||
const close = () => {
|
||||
dialogVisible.value = false;
|
||||
emits('close');
|
||||
};
|
||||
|
||||
/** 提交扫码 */
|
||||
const submitQr = async () => {
|
||||
// 扫码内容不能为空
|
||||
if (qrCodeRowList.value.length === 0) {
|
||||
message.warning('请扫描二维码');
|
||||
return;
|
||||
}
|
||||
//判断二维码数与数量是否一致
|
||||
if (qrCodeRowList.value.length !== props.currentRow.count) {
|
||||
message.warning('扫码数量与数量不一致');
|
||||
return;
|
||||
}
|
||||
// 找到当前行在 formData 中的索引
|
||||
const index = props.currentRowIndex; // 获取当前行的索引
|
||||
// 触发自定义事件 'submit-data' 并传递 qrCodeRowList 数据
|
||||
emits('submit-data', qrCodeRowList.value, index);
|
||||
dialogVisible.value = false;
|
||||
|
||||
|
||||
};
|
||||
|
||||
// 处理二维码输入
|
||||
const handleQrEnter = () => {
|
||||
|
||||
if (!matchRulesFromDictOptions(qr.value)) {
|
||||
// 提示用户输入的二维码格式不正确
|
||||
message.warning('二维码格式不正确');
|
||||
|
||||
return;
|
||||
}
|
||||
//将二维码填充到传入的当行数据中,并作为元素添加到列表中
|
||||
const newRow = { ...props.currentRow, qr: qr.value };
|
||||
qrCodeRowList.value.push(newRow);
|
||||
// 清空输入框
|
||||
qr.value = '';
|
||||
// 让光标聚焦到输入框
|
||||
if (qrInputRef.value) {
|
||||
qrInputRef.value.focus();
|
||||
}
|
||||
};
|
||||
|
||||
// 删除行的方法
|
||||
const deleteRow = (index: number) => {
|
||||
qrCodeRowList.value.splice(index, 1);
|
||||
};
|
||||
|
||||
defineExpose({
|
||||
open,
|
||||
close
|
||||
});
|
||||
</script>
|
||||
|
|
@ -0,0 +1,156 @@
|
|||
<template>
|
||||
<Dialog :title="dialogTitle" v-model="dialogVisible">
|
||||
<el-form
|
||||
ref="formRef"
|
||||
:model="formData"
|
||||
:rules="formRules"
|
||||
label-width="100px"
|
||||
v-loading="formLoading"
|
||||
>
|
||||
<el-form-item label="销售出库编号" prop="outId">
|
||||
<el-input v-model="formData.outId" placeholder="请输入销售出库编号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="销售订单项编号" prop="orderItemId">
|
||||
<el-input v-model="formData.orderItemId" placeholder="请输入销售订单项编号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="销售出库单项编号" prop="outItemId">
|
||||
<el-input v-model="formData.outItemId" placeholder="请输入销售出库单项编号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="仓库编号" prop="warehouseId">
|
||||
<el-input v-model="formData.warehouseId" placeholder="请输入仓库编号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="产品编号" prop="productId">
|
||||
<el-input v-model="formData.productId" placeholder="请输入产品编号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="产品单位单位" prop="productUnitId">
|
||||
<el-input v-model="formData.productUnitId" placeholder="请输入产品单位单位" />
|
||||
</el-form-item>
|
||||
<el-form-item label="产品单价" prop="productPrice">
|
||||
<el-input v-model="formData.productPrice" placeholder="请输入产品单价" />
|
||||
</el-form-item>
|
||||
<el-form-item label="数量" prop="count">
|
||||
<el-input v-model="formData.count" placeholder="请输入数量" />
|
||||
</el-form-item>
|
||||
<el-form-item label="总价" prop="totalPrice">
|
||||
<el-input v-model="formData.totalPrice" placeholder="请输入总价" />
|
||||
</el-form-item>
|
||||
<el-form-item label="税率,百分比" prop="taxPercent">
|
||||
<el-input v-model="formData.taxPercent" placeholder="请输入税率,百分比" />
|
||||
</el-form-item>
|
||||
<el-form-item label="税额,单位:元" prop="taxPrice">
|
||||
<el-input v-model="formData.taxPrice" placeholder="请输入税额,单位:元" />
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="formData.remark" placeholder="请输入备注" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<el-button @click="submitForm" type="primary" :disabled="formLoading">确 定</el-button>
|
||||
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||
</template>
|
||||
</Dialog>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { SaleOutItemsQrApi, SaleOutItemsQrVO } from '@/api/erp/sale/out/saleoutitemsqr'
|
||||
|
||||
|
||||
/** ERP 销售出库项二维码 表单 */
|
||||
defineOptions({ name: 'SaleOutItemsQrForm' })
|
||||
|
||||
const { t } = useI18n() // 国际化
|
||||
const message = useMessage() // 消息弹窗
|
||||
|
||||
const dialogVisible = ref(false) // 弹窗的是否展示
|
||||
const dialogTitle = ref('') // 弹窗的标题
|
||||
const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用
|
||||
const formType = ref('') // 表单的类型:create - 新增;update - 修改
|
||||
const formData = ref({
|
||||
id: undefined,
|
||||
outId: undefined,
|
||||
orderItemId: undefined,
|
||||
outItemId: undefined,
|
||||
warehouseId: undefined,
|
||||
productId: undefined,
|
||||
productUnitId: undefined,
|
||||
productPrice: undefined,
|
||||
count: undefined,
|
||||
totalPrice: undefined,
|
||||
taxPercent: undefined,
|
||||
taxPrice: undefined,
|
||||
remark: undefined
|
||||
})
|
||||
const formRules = reactive({
|
||||
outId: [{ required: true, message: '销售出库编号不能为空', trigger: 'blur' }],
|
||||
orderItemId: [{ required: true, message: '销售订单项编号不能为空', trigger: 'blur' }],
|
||||
outItemId: [{ required: true, message: '销售出库单项编号不能为空', trigger: 'blur' }],
|
||||
warehouseId: [{ required: true, message: '仓库编号不能为空', trigger: 'blur' }],
|
||||
productId: [{ required: true, message: '产品编号不能为空', trigger: 'blur' }],
|
||||
productUnitId: [{ required: true, message: '产品单位单位不能为空', trigger: 'blur' }],
|
||||
productPrice: [{ required: true, message: '产品单价不能为空', trigger: 'blur' }],
|
||||
count: [{ required: true, message: '数量不能为空', trigger: 'blur' }],
|
||||
totalPrice: [{ required: true, message: '总价不能为空', trigger: 'blur' }]
|
||||
})
|
||||
const formRef = ref() // 表单 Ref
|
||||
|
||||
/** 打开弹窗 */
|
||||
const open = async (type: string, id?: number) => {
|
||||
dialogVisible.value = true
|
||||
dialogTitle.value = t('action.' + type)
|
||||
formType.value = type
|
||||
resetForm()
|
||||
// 修改时,设置数据
|
||||
if (id) {
|
||||
formLoading.value = true
|
||||
try {
|
||||
formData.value = await SaleOutItemsQrApi.getSaleOutItemsQr(id)
|
||||
} finally {
|
||||
formLoading.value = false
|
||||
}
|
||||
}
|
||||
}
|
||||
defineExpose({ open }) // 提供 open 方法,用于打开弹窗
|
||||
|
||||
/** 提交表单 */
|
||||
const emit = defineEmits(['success']) // 定义 success 事件,用于操作成功后的回调
|
||||
const submitForm = async () => {
|
||||
// 校验表单
|
||||
await formRef.value.validate()
|
||||
// 提交请求
|
||||
formLoading.value = true
|
||||
try {
|
||||
const data = formData.value as unknown as SaleOutItemsQrVO
|
||||
if (formType.value === 'create') {
|
||||
await SaleOutItemsQrApi.createSaleOutItemsQr(data)
|
||||
message.success(t('common.createSuccess'))
|
||||
} else {
|
||||
await SaleOutItemsQrApi.updateSaleOutItemsQr(data)
|
||||
message.success(t('common.updateSuccess'))
|
||||
}
|
||||
dialogVisible.value = false
|
||||
// 发送操作成功的事件
|
||||
emit('success')
|
||||
} finally {
|
||||
formLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
/** 重置表单 */
|
||||
const resetForm = () => {
|
||||
formData.value = {
|
||||
id: undefined,
|
||||
outId: undefined,
|
||||
orderItemId: undefined,
|
||||
outItemId: undefined,
|
||||
warehouseId: undefined,
|
||||
productId: undefined,
|
||||
productUnitId: undefined,
|
||||
productPrice: undefined,
|
||||
count: undefined,
|
||||
totalPrice: undefined,
|
||||
taxPercent: undefined,
|
||||
taxPrice: undefined,
|
||||
remark: undefined
|
||||
}
|
||||
formRef.value?.resetFields()
|
||||
}
|
||||
</script>
|
||||
|
|
@ -0,0 +1,308 @@
|
|||
<template>
|
||||
<ContentWrap>
|
||||
<!-- 搜索工作栏 -->
|
||||
<el-form
|
||||
class="-mb-15px"
|
||||
:model="queryParams"
|
||||
ref="queryFormRef"
|
||||
:inline="true"
|
||||
label-width="68px"
|
||||
>
|
||||
<el-form-item label="销售出库编号" prop="outId">
|
||||
<el-input
|
||||
v-model="queryParams.outId"
|
||||
placeholder="请输入销售出库编号"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
class="!w-240px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="销售订单项编号" prop="orderItemId">
|
||||
<el-input
|
||||
v-model="queryParams.orderItemId"
|
||||
placeholder="请输入销售订单项编号"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
class="!w-240px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="销售出库单项编号" prop="outItemId">
|
||||
<el-input
|
||||
v-model="queryParams.outItemId"
|
||||
placeholder="请输入销售出库单项编号"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
class="!w-240px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="仓库编号" prop="warehouseId">
|
||||
<el-input
|
||||
v-model="queryParams.warehouseId"
|
||||
placeholder="请输入仓库编号"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
class="!w-240px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="产品编号" prop="productId">
|
||||
<el-input
|
||||
v-model="queryParams.productId"
|
||||
placeholder="请输入产品编号"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
class="!w-240px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="产品单位单位" prop="productUnitId">
|
||||
<el-input
|
||||
v-model="queryParams.productUnitId"
|
||||
placeholder="请输入产品单位单位"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
class="!w-240px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="产品单价" prop="productPrice">
|
||||
<el-input
|
||||
v-model="queryParams.productPrice"
|
||||
placeholder="请输入产品单价"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
class="!w-240px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="数量" prop="count">
|
||||
<el-input
|
||||
v-model="queryParams.count"
|
||||
placeholder="请输入数量"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
class="!w-240px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="总价" prop="totalPrice">
|
||||
<el-input
|
||||
v-model="queryParams.totalPrice"
|
||||
placeholder="请输入总价"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
class="!w-240px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="税率,百分比" prop="taxPercent">
|
||||
<el-input
|
||||
v-model="queryParams.taxPercent"
|
||||
placeholder="请输入税率,百分比"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
class="!w-240px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="税额,单位:元" prop="taxPrice">
|
||||
<el-input
|
||||
v-model="queryParams.taxPrice"
|
||||
placeholder="请输入税额,单位:元"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
class="!w-240px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input
|
||||
v-model="queryParams.remark"
|
||||
placeholder="请输入备注"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
class="!w-240px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="创建时间" prop="createTime">
|
||||
<el-date-picker
|
||||
v-model="queryParams.createTime"
|
||||
value-format="YYYY-MM-DD HH:mm:ss"
|
||||
type="daterange"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
:default-time="[new Date('1 00:00:00'), new Date('1 23:59:59')]"
|
||||
class="!w-220px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button @click="handleQuery"><Icon icon="ep:search" class="mr-5px" /> 搜索</el-button>
|
||||
<el-button @click="resetQuery"><Icon icon="ep:refresh" class="mr-5px" /> 重置</el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
@click="openForm('create')"
|
||||
v-hasPermi="['erp:sale-out-items-qr:create']"
|
||||
>
|
||||
<Icon icon="ep:plus" class="mr-5px" /> 新增
|
||||
</el-button>
|
||||
<el-button
|
||||
type="success"
|
||||
plain
|
||||
@click="handleExport"
|
||||
:loading="exportLoading"
|
||||
v-hasPermi="['erp:sale-out-items-qr:export']"
|
||||
>
|
||||
<Icon icon="ep:download" class="mr-5px" /> 导出
|
||||
</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</ContentWrap>
|
||||
|
||||
<!-- 列表 -->
|
||||
<ContentWrap>
|
||||
<el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true">
|
||||
<el-table-column label="编号" align="center" prop="id" />
|
||||
<el-table-column label="销售出库编号" align="center" prop="outId" />
|
||||
<el-table-column label="销售订单项编号" align="center" prop="orderItemId" />
|
||||
<el-table-column label="销售出库单项编号" align="center" prop="outItemId" />
|
||||
<el-table-column label="仓库编号" align="center" prop="warehouseId" />
|
||||
<el-table-column label="产品编号" align="center" prop="productId" />
|
||||
<el-table-column label="产品单位单位" align="center" prop="productUnitId" />
|
||||
<el-table-column label="产品单价" align="center" prop="productPrice" />
|
||||
<el-table-column label="数量" align="center" prop="count" />
|
||||
<el-table-column label="总价" align="center" prop="totalPrice" />
|
||||
<el-table-column label="税率,百分比" align="center" prop="taxPercent" />
|
||||
<el-table-column label="税额,单位:元" align="center" prop="taxPrice" />
|
||||
<el-table-column label="备注" align="center" prop="remark" />
|
||||
<el-table-column
|
||||
label="创建时间"
|
||||
align="center"
|
||||
prop="createTime"
|
||||
:formatter="dateFormatter"
|
||||
width="180px"
|
||||
/>
|
||||
<el-table-column label="操作" align="center" min-width="120px">
|
||||
<template #default="scope">
|
||||
<el-button
|
||||
link
|
||||
type="primary"
|
||||
@click="openForm('update', scope.row.id)"
|
||||
v-hasPermi="['erp:sale-out-items-qr:update']"
|
||||
>
|
||||
编辑
|
||||
</el-button>
|
||||
<el-button
|
||||
link
|
||||
type="danger"
|
||||
@click="handleDelete(scope.row.id)"
|
||||
v-hasPermi="['erp:sale-out-items-qr:delete']"
|
||||
>
|
||||
删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!-- 分页 -->
|
||||
<Pagination
|
||||
:total="total"
|
||||
v-model:page="queryParams.pageNo"
|
||||
v-model:limit="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
</ContentWrap>
|
||||
|
||||
<!-- 表单弹窗:添加/修改 -->
|
||||
<SaleOutItemsQrForm ref="formRef" @success="getList" />
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { dateFormatter } from '@/utils/formatTime'
|
||||
import download from '@/utils/download'
|
||||
import { SaleOutItemsQrApi, SaleOutItemsQrVO } from '@/api/erp/sale/out/saleoutitemsqr'
|
||||
import SaleOutItemsQrForm from './SaleOutItemsQrForm.vue'
|
||||
|
||||
/** ERP 销售出库项二维码 列表 */
|
||||
defineOptions({ name: 'ErpSaleOutItemsQr' })
|
||||
|
||||
const message = useMessage() // 消息弹窗
|
||||
const { t } = useI18n() // 国际化
|
||||
|
||||
const loading = ref(true) // 列表的加载中
|
||||
const list = ref<SaleOutItemsQrVO[]>([]) // 列表的数据
|
||||
const total = ref(0) // 列表的总页数
|
||||
const queryParams = reactive({
|
||||
pageNo: 1,
|
||||
pageSize: 10,
|
||||
outId: undefined,
|
||||
orderItemId: undefined,
|
||||
outItemId: undefined,
|
||||
warehouseId: undefined,
|
||||
productId: undefined,
|
||||
productUnitId: undefined,
|
||||
productPrice: undefined,
|
||||
count: undefined,
|
||||
totalPrice: undefined,
|
||||
taxPercent: undefined,
|
||||
taxPrice: undefined,
|
||||
remark: undefined,
|
||||
createTime: []
|
||||
})
|
||||
const queryFormRef = ref() // 搜索的表单
|
||||
const exportLoading = ref(false) // 导出的加载中
|
||||
|
||||
/** 查询列表 */
|
||||
const getList = async () => {
|
||||
loading.value = true
|
||||
try {
|
||||
const data = await SaleOutItemsQrApi.getSaleOutItemsQrPage(queryParams)
|
||||
list.value = data.list
|
||||
total.value = data.total
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
const handleQuery = () => {
|
||||
queryParams.pageNo = 1
|
||||
getList()
|
||||
}
|
||||
|
||||
/** 重置按钮操作 */
|
||||
const resetQuery = () => {
|
||||
queryFormRef.value.resetFields()
|
||||
handleQuery()
|
||||
}
|
||||
|
||||
/** 添加/修改操作 */
|
||||
const formRef = ref()
|
||||
const openForm = (type: string, id?: number) => {
|
||||
formRef.value.open(type, id)
|
||||
}
|
||||
|
||||
/** 删除按钮操作 */
|
||||
const handleDelete = async (id: number) => {
|
||||
try {
|
||||
// 删除的二次确认
|
||||
await message.delConfirm()
|
||||
// 发起删除
|
||||
await SaleOutItemsQrApi.deleteSaleOutItemsQr(id)
|
||||
message.success(t('common.delSuccess'))
|
||||
// 刷新列表
|
||||
await getList()
|
||||
} catch {}
|
||||
}
|
||||
|
||||
/** 导出按钮操作 */
|
||||
const handleExport = async () => {
|
||||
try {
|
||||
// 导出的二次确认
|
||||
await message.exportConfirm()
|
||||
// 发起导出
|
||||
exportLoading.value = true
|
||||
const data = await SaleOutItemsQrApi.exportSaleOutItemsQr(queryParams)
|
||||
download.excel(data, 'ERP 销售出库项二维码.xls')
|
||||
} catch {
|
||||
} finally {
|
||||
exportLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
/** 初始化 **/
|
||||
onMounted(() => {
|
||||
getList()
|
||||
})
|
||||
</script>
|
||||
Loading…
Reference in New Issue