This commit is contained in:
1 parent
af0cf2bbb3
commit
4e578d027d
7 files changed
+9
-100
No files matched your search
@@ -242,7 +242,6 @@ const state = reactive<{
|
|||||||
editableTableData: any[]
|
editableTableData: any[]
|
||||||
erpSpuItemsMemo: any[]
|
erpSpuItemsMemo: any[]
|
||||||
selectedRowsErpSpuIds: string[]
|
selectedRowsErpSpuIds: string[]
|
||||||
insertedRowNumber: number
|
|
||||||
erpSpuSimpleAll: any
|
erpSpuSimpleAll: any
|
||||||
linkCodeVisible: boolean
|
linkCodeVisible: boolean
|
||||||
erpSpuSelectDialogVisible: boolean
|
erpSpuSelectDialogVisible: boolean
|
||||||
@@ -251,7 +250,6 @@ const state = reactive<{
|
|||||||
editableTableData: [], // 可编辑表格数据
|
editableTableData: [], // 可编辑表格数据
|
||||||
erpSpuItemsMemo: [], // 请求到的可编辑表格商品数据的缓存
|
erpSpuItemsMemo: [], // 请求到的可编辑表格商品数据的缓存
|
||||||
selectedRowsErpSpuIds: [], // 可编辑表格已选行的ErpSpuId
|
selectedRowsErpSpuIds: [], // 可编辑表格已选行的ErpSpuId
|
||||||
insertedRowNumber: 0, // 可编辑表格插入行的行号
|
|
||||||
erpSpuSimpleAll: [], // 简要商品列表
|
erpSpuSimpleAll: [], // 简要商品列表
|
||||||
|
|
||||||
linkCodeVisible: false, // 关联采购申请单对话框开关
|
linkCodeVisible: false, // 关联采购申请单对话框开关
|
||||||
@@ -433,7 +431,6 @@ const clearData = () => {
|
|||||||
if (key === "id" || key === "inventoryCode" || key === "inventoryDate" || key === "inventoryType" || key === "orderType") continue
|
if (key === "id" || key === "inventoryCode" || key === "inventoryDate" || key === "inventoryType" || key === "orderType") continue
|
||||||
baseDataForm[key] = ""
|
baseDataForm[key] = ""
|
||||||
}
|
}
|
||||||
state.insertedRowNumber = 0
|
|
||||||
state.editableTableData = []
|
state.editableTableData = []
|
||||||
state.erpSpuItemsMemo = []
|
state.erpSpuItemsMemo = []
|
||||||
state.selectedRowsErpSpuIds = []
|
state.selectedRowsErpSpuIds = []
|
||||||
|
|||||||
@@ -248,7 +248,6 @@ const state = reactive<{
|
|||||||
editableTableData: any[]
|
editableTableData: any[]
|
||||||
erpSpuItemsMemo: any[]
|
erpSpuItemsMemo: any[]
|
||||||
selectedRowsErpSpuIds: string[]
|
selectedRowsErpSpuIds: string[]
|
||||||
insertedRowNumber: number
|
|
||||||
erpSpuSimpleAll: any
|
erpSpuSimpleAll: any
|
||||||
linkCodeVisible: boolean
|
linkCodeVisible: boolean
|
||||||
erpSpuSelectDialogVisible: boolean
|
erpSpuSelectDialogVisible: boolean
|
||||||
@@ -257,7 +256,6 @@ const state = reactive<{
|
|||||||
editableTableData: [], // 可编辑表格数据
|
editableTableData: [], // 可编辑表格数据
|
||||||
erpSpuItemsMemo: [], // 请求到的可编辑表格商品数据的缓存
|
erpSpuItemsMemo: [], // 请求到的可编辑表格商品数据的缓存
|
||||||
selectedRowsErpSpuIds: [], // 可编辑表格已选行的ErpSpuId
|
selectedRowsErpSpuIds: [], // 可编辑表格已选行的ErpSpuId
|
||||||
insertedRowNumber: 0, // 可编辑表格插入行的行号
|
|
||||||
erpSpuSimpleAll: [], // 简要商品列表
|
erpSpuSimpleAll: [], // 简要商品列表
|
||||||
linkCodeVisible: false, // 关联采购申请单对话框开关
|
linkCodeVisible: false, // 关联采购申请单对话框开关
|
||||||
erpSpuSelectDialogVisible: false, // 商品选择对话框开关
|
erpSpuSelectDialogVisible: false, // 商品选择对话框开关
|
||||||
@@ -438,7 +436,6 @@ const clearData = () => {
|
|||||||
if (key === "code" || key === "id" || key === "dDate") continue
|
if (key === "code" || key === "id" || key === "dDate") continue
|
||||||
baseDataForm[key] = ""
|
baseDataForm[key] = ""
|
||||||
}
|
}
|
||||||
state.insertedRowNumber = 0
|
|
||||||
state.editableTableData = []
|
state.editableTableData = []
|
||||||
state.erpSpuItemsMemo = []
|
state.erpSpuItemsMemo = []
|
||||||
state.selectedRowsErpSpuIds = []
|
state.selectedRowsErpSpuIds = []
|
||||||
|
|||||||
@@ -140,7 +140,13 @@
|
|||||||
</template>
|
</template>
|
||||||
</vxe-column>
|
</vxe-column>
|
||||||
<vxe-column field="realPrice" title="实际进价" :edit-render="{ autoFocus: 'input', placeholder: '请输入' }">
|
<vxe-column field="realPrice" title="实际进价" :edit-render="{ autoFocus: 'input', placeholder: '请输入' }">
|
||||||
<template #default="{ row }">{{ row.realPrice }}</template>
|
<template #default="{ row }">
|
||||||
|
{{
|
||||||
|
row.realPrice
|
||||||
|
? displayPrice(row.realPrice)
|
||||||
|
: displayPrice(row.erpUnitVos?.find((item: any) => item.id == row.unitId)?.realPrice)
|
||||||
|
}}
|
||||||
|
</template>
|
||||||
<template #edit="{ row }">
|
<template #edit="{ row }">
|
||||||
<el-input v-model="row.realPrice" />
|
<el-input v-model="row.realPrice" />
|
||||||
</template>
|
</template>
|
||||||
@@ -148,10 +154,10 @@
|
|||||||
<vxe-column field="totalAmount" title="累计总金额">
|
<vxe-column field="totalAmount" title="累计总金额">
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
<span v-if="row.unitId && row.quantity && row.unit && !row.erpUnitVos">
|
<span v-if="row.unitId && row.quantity && row.unit && !row.erpUnitVos">
|
||||||
{{ Number(row.quantity * parseFloat(row.realPrice)).toFixed(2) }}
|
{{ Number(row.quantity * parseFloat(row.realPrice || 0)).toFixed(2) }}
|
||||||
</span>
|
</span>
|
||||||
<span v-if="row.unitId && row.quantity && row.erpUnitVos">
|
<span v-if="row.unitId && row.quantity && row.erpUnitVos">
|
||||||
{{ Number(Number(row.erpUnitVos?.find((item: any) => item.id == row.unitId)?.realPrice) * row.quantity).toFixed(2) }}
|
{{ Number(Number(row.erpUnitVos?.find((item: any) => item.id == row.unitId)?.realPrice || 0) * row.quantity).toFixed(2) }}
|
||||||
</span>
|
</span>
|
||||||
</template>
|
</template>
|
||||||
</vxe-column>
|
</vxe-column>
|
||||||
@@ -248,7 +254,6 @@ const state = reactive<{
|
|||||||
editableTableData: any[]
|
editableTableData: any[]
|
||||||
erpSpuItemsMemo: any[]
|
erpSpuItemsMemo: any[]
|
||||||
selectedRowsErpSpuIds: string[]
|
selectedRowsErpSpuIds: string[]
|
||||||
insertedRowNumber: number
|
|
||||||
erpSpuSimpleAll: any
|
erpSpuSimpleAll: any
|
||||||
linkCodeVisible: boolean
|
linkCodeVisible: boolean
|
||||||
erpSpuSelectDialogVisible: boolean
|
erpSpuSelectDialogVisible: boolean
|
||||||
@@ -257,7 +262,6 @@ const state = reactive<{
|
|||||||
editableTableData: [], // 可编辑表格数据
|
editableTableData: [], // 可编辑表格数据
|
||||||
erpSpuItemsMemo: [], // 请求到的可编辑表格商品数据的缓存
|
erpSpuItemsMemo: [], // 请求到的可编辑表格商品数据的缓存
|
||||||
selectedRowsErpSpuIds: [], // 可编辑表格已选行的ErpSpuId
|
selectedRowsErpSpuIds: [], // 可编辑表格已选行的ErpSpuId
|
||||||
insertedRowNumber: 0, // 可编辑表格插入行的行号
|
|
||||||
erpSpuSimpleAll: [], // 简要商品列表
|
erpSpuSimpleAll: [], // 简要商品列表
|
||||||
|
|
||||||
linkCodeVisible: false, // 关联采购申请单对话框开关
|
linkCodeVisible: false, // 关联采购申请单对话框开关
|
||||||
@@ -442,7 +446,6 @@ const clearData = () => {
|
|||||||
if (key === "id" || key === "inventoryCode" || key === "inventoryDate" || key === "inventoryType" || key === "orderType") continue
|
if (key === "id" || key === "inventoryCode" || key === "inventoryDate" || key === "inventoryType" || key === "orderType") continue
|
||||||
baseDataForm[key] = ""
|
baseDataForm[key] = ""
|
||||||
}
|
}
|
||||||
state.insertedRowNumber = 0
|
|
||||||
state.editableTableData = []
|
state.editableTableData = []
|
||||||
state.erpSpuItemsMemo = []
|
state.erpSpuItemsMemo = []
|
||||||
state.selectedRowsErpSpuIds = []
|
state.selectedRowsErpSpuIds = []
|
||||||
|
|||||||
@@ -58,22 +58,6 @@
|
|||||||
<el-button type="primary" plain @click="handleClickSpuSelect">商品选择</el-button>
|
<el-button type="primary" plain @click="handleClickSpuSelect">商品选择</el-button>
|
||||||
<el-button @click="removeSelectRowEvent" :disabled="state.selectedRowsErpSpuIds.length <= 0">删除选中</el-button>
|
<el-button @click="removeSelectRowEvent" :disabled="state.selectedRowsErpSpuIds.length <= 0">删除选中</el-button>
|
||||||
<el-button type="danger" plain @click="clearData">清空数据</el-button>
|
<el-button type="danger" plain @click="clearData">清空数据</el-button>
|
||||||
<!-- <el-button @click="addEvent">新增(顶部)</el-button>
|
|
||||||
<el-button @click="pushEvent">新增(尾部)</el-button>
|
|
||||||
<el-button @click="insertEvent">
|
|
||||||
在第
|
|
||||||
<el-input-number
|
|
||||||
@click.stop
|
|
||||||
v-model="state.insertedRowNumber"
|
|
||||||
:min="0"
|
|
||||||
:max="state.editableTableData.length"
|
|
||||||
:precision="0"
|
|
||||||
size="small"
|
|
||||||
controls-position="right"
|
|
||||||
style="min-width: 50px; margin: 0 5px"
|
|
||||||
/>
|
|
||||||
行新增
|
|
||||||
</el-button> -->
|
|
||||||
</el-row>
|
</el-row>
|
||||||
|
|
||||||
<vxe-table
|
<vxe-table
|
||||||
@@ -208,14 +192,12 @@ const state = reactive<{
|
|||||||
editableTableData: any[]
|
editableTableData: any[]
|
||||||
erpSpuItemsMemo: any[]
|
erpSpuItemsMemo: any[]
|
||||||
selectedRowsErpSpuIds: string[]
|
selectedRowsErpSpuIds: string[]
|
||||||
insertedRowNumber: number
|
|
||||||
erpSpuSimpleAll: any
|
erpSpuSimpleAll: any
|
||||||
erpSpuSelectDialogVisible: boolean
|
erpSpuSelectDialogVisible: boolean
|
||||||
}>({
|
}>({
|
||||||
editableTableData: [], // 可编辑表格数据
|
editableTableData: [], // 可编辑表格数据
|
||||||
erpSpuItemsMemo: [], // 请求到的可编辑表格商品数据的缓存
|
erpSpuItemsMemo: [], // 请求到的可编辑表格商品数据的缓存
|
||||||
selectedRowsErpSpuIds: [], // 可编辑表格已选行的ErpSpuId
|
selectedRowsErpSpuIds: [], // 可编辑表格已选行的ErpSpuId
|
||||||
insertedRowNumber: 0, // 可编辑表格插入行的行号
|
|
||||||
erpSpuSimpleAll: [], // 简要商品列表
|
erpSpuSimpleAll: [], // 简要商品列表
|
||||||
erpSpuSelectDialogVisible: false, // 商品选择对话框开关
|
erpSpuSelectDialogVisible: false, // 商品选择对话框开关
|
||||||
})
|
})
|
||||||
@@ -262,66 +244,6 @@ const getInitData = async () => {
|
|||||||
planCode && planCode.code === 0 && (baseDataForm.planCode = planCode.data)
|
planCode && planCode.code === 0 && (baseDataForm.planCode = planCode.data)
|
||||||
}
|
}
|
||||||
|
|
||||||
// 顶部表格行新增
|
|
||||||
const addEvent = () => {
|
|
||||||
const newRow: any = {
|
|
||||||
id: "",
|
|
||||||
erpSpuId: "",
|
|
||||||
quantity: null,
|
|
||||||
unitPrice: null,
|
|
||||||
totalAmount: null,
|
|
||||||
remark: "",
|
|
||||||
unitId: "",
|
|
||||||
}
|
|
||||||
state.editableTableData.unshift(newRow)
|
|
||||||
nextTick(() => {
|
|
||||||
const $table = editableTableRef.value
|
|
||||||
if ($table) {
|
|
||||||
$table.setEditRow(newRow)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
// 底部表格行新增
|
|
||||||
const pushEvent = () => {
|
|
||||||
const newRow: any = {
|
|
||||||
id: "",
|
|
||||||
erpSpuId: "",
|
|
||||||
quantity: null,
|
|
||||||
unitPrice: null,
|
|
||||||
totalAmount: null,
|
|
||||||
remark: "",
|
|
||||||
unitId: "",
|
|
||||||
}
|
|
||||||
state.editableTableData.push(newRow)
|
|
||||||
nextTick(() => {
|
|
||||||
const $table = editableTableRef.value
|
|
||||||
if ($table) {
|
|
||||||
$table.setEditRow(newRow)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
// 在指定行插入
|
|
||||||
const insertEvent = () => {
|
|
||||||
const newRow: any = {
|
|
||||||
id: "",
|
|
||||||
erpSpuId: "",
|
|
||||||
quantity: null,
|
|
||||||
unitPrice: null,
|
|
||||||
totalAmount: null,
|
|
||||||
remark: "",
|
|
||||||
unitId: "",
|
|
||||||
}
|
|
||||||
state.editableTableData.splice(state.insertedRowNumber, 0, newRow)
|
|
||||||
nextTick(() => {
|
|
||||||
const $table = editableTableRef.value
|
|
||||||
if ($table) {
|
|
||||||
$table.setEditRow(newRow)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
// 删除选中的行
|
// 删除选中的行
|
||||||
const removeSelectRowEvent = () => {
|
const removeSelectRowEvent = () => {
|
||||||
const $table = editableTableRef.value
|
const $table = editableTableRef.value
|
||||||
@@ -423,7 +345,6 @@ const clearData = () => {
|
|||||||
if (key === "planCode" || key === "id" || key === "planDate") continue
|
if (key === "planCode" || key === "id" || key === "planDate") continue
|
||||||
baseDataForm[key] = ""
|
baseDataForm[key] = ""
|
||||||
}
|
}
|
||||||
state.insertedRowNumber = 0
|
|
||||||
state.editableTableData = []
|
state.editableTableData = []
|
||||||
state.erpSpuItemsMemo = []
|
state.erpSpuItemsMemo = []
|
||||||
state.selectedRowsErpSpuIds = []
|
state.selectedRowsErpSpuIds = []
|
||||||
|
|||||||
@@ -275,7 +275,6 @@ const state = reactive<{
|
|||||||
editableTableData: any[]
|
editableTableData: any[]
|
||||||
erpSpuItemsMemo: any[]
|
erpSpuItemsMemo: any[]
|
||||||
selectedRowsErpSpuIds: string[]
|
selectedRowsErpSpuIds: string[]
|
||||||
insertedRowNumber: number
|
|
||||||
erpSpuSimpleAll: any
|
erpSpuSimpleAll: any
|
||||||
linkCodeVisible: boolean
|
linkCodeVisible: boolean
|
||||||
erpSpuSelectDialogVisible: boolean
|
erpSpuSelectDialogVisible: boolean
|
||||||
@@ -284,7 +283,6 @@ const state = reactive<{
|
|||||||
editableTableData: [], // 可编辑表格数据
|
editableTableData: [], // 可编辑表格数据
|
||||||
erpSpuItemsMemo: [], // 请求到的可编辑表格商品数据的缓存
|
erpSpuItemsMemo: [], // 请求到的可编辑表格商品数据的缓存
|
||||||
selectedRowsErpSpuIds: [], // 可编辑表格已选行的ErpSpuId
|
selectedRowsErpSpuIds: [], // 可编辑表格已选行的ErpSpuId
|
||||||
insertedRowNumber: 0, // 可编辑表格插入行的行号
|
|
||||||
erpSpuSimpleAll: [], // 简要商品列表
|
erpSpuSimpleAll: [], // 简要商品列表
|
||||||
|
|
||||||
linkCodeVisible: false, // 关联采购申请单对话框开关
|
linkCodeVisible: false, // 关联采购申请单对话框开关
|
||||||
@@ -482,7 +480,6 @@ const clearData = () => {
|
|||||||
if (key === "id" || key === "inventoryCode" || key === "inventoryDate" || key === "inventoryType" || key === "orderType") continue
|
if (key === "id" || key === "inventoryCode" || key === "inventoryDate" || key === "inventoryType" || key === "orderType") continue
|
||||||
baseDataForm[key] = ""
|
baseDataForm[key] = ""
|
||||||
}
|
}
|
||||||
state.insertedRowNumber = 0
|
|
||||||
state.editableTableData = []
|
state.editableTableData = []
|
||||||
state.erpSpuItemsMemo = []
|
state.erpSpuItemsMemo = []
|
||||||
state.selectedRowsErpSpuIds = []
|
state.selectedRowsErpSpuIds = []
|
||||||
|
|||||||
@@ -267,7 +267,6 @@ const state = reactive<{
|
|||||||
editableTableData: any[]
|
editableTableData: any[]
|
||||||
erpSpuItemsMemo: any[]
|
erpSpuItemsMemo: any[]
|
||||||
selectedRowsErpSpuIds: string[]
|
selectedRowsErpSpuIds: string[]
|
||||||
insertedRowNumber: number
|
|
||||||
erpSpuSimpleAll: any
|
erpSpuSimpleAll: any
|
||||||
linkCodeVisible: boolean
|
linkCodeVisible: boolean
|
||||||
erpSpuSelectDialogVisible: boolean
|
erpSpuSelectDialogVisible: boolean
|
||||||
@@ -276,7 +275,6 @@ const state = reactive<{
|
|||||||
editableTableData: [], // 可编辑表格数据
|
editableTableData: [], // 可编辑表格数据
|
||||||
erpSpuItemsMemo: [], // 请求到的可编辑表格商品数据的缓存
|
erpSpuItemsMemo: [], // 请求到的可编辑表格商品数据的缓存
|
||||||
selectedRowsErpSpuIds: [], // 可编辑表格已选行的ErpSpuId
|
selectedRowsErpSpuIds: [], // 可编辑表格已选行的ErpSpuId
|
||||||
insertedRowNumber: 0, // 可编辑表格插入行的行号
|
|
||||||
erpSpuSimpleAll: [], // 简要商品列表
|
erpSpuSimpleAll: [], // 简要商品列表
|
||||||
|
|
||||||
linkCodeVisible: false, // 关联采购申请单对话框开关
|
linkCodeVisible: false, // 关联采购申请单对话框开关
|
||||||
@@ -474,7 +472,6 @@ const clearData = () => {
|
|||||||
if (key === "id" || key === "inventoryCode" || key === "inventoryDate" || key === "inventoryType" || key === "orderType") continue
|
if (key === "id" || key === "inventoryCode" || key === "inventoryDate" || key === "inventoryType" || key === "orderType") continue
|
||||||
baseDataForm[key] = ""
|
baseDataForm[key] = ""
|
||||||
}
|
}
|
||||||
state.insertedRowNumber = 0
|
|
||||||
state.editableTableData = []
|
state.editableTableData = []
|
||||||
state.erpSpuItemsMemo = []
|
state.erpSpuItemsMemo = []
|
||||||
state.selectedRowsErpSpuIds = []
|
state.selectedRowsErpSpuIds = []
|
||||||
|
|||||||
@@ -247,7 +247,6 @@ const state = reactive<{
|
|||||||
editableTableData: any[]
|
editableTableData: any[]
|
||||||
erpSpuItemsMemo: any[]
|
erpSpuItemsMemo: any[]
|
||||||
selectedRowsErpSpuIds: string[]
|
selectedRowsErpSpuIds: string[]
|
||||||
insertedRowNumber: number
|
|
||||||
erpSpuSimpleAll: any
|
erpSpuSimpleAll: any
|
||||||
linkCodeVisible: boolean
|
linkCodeVisible: boolean
|
||||||
erpSpuSelectDialogVisible: boolean
|
erpSpuSelectDialogVisible: boolean
|
||||||
@@ -256,7 +255,6 @@ const state = reactive<{
|
|||||||
editableTableData: [], // 可编辑表格数据
|
editableTableData: [], // 可编辑表格数据
|
||||||
erpSpuItemsMemo: [], // 请求到的可编辑表格商品数据的缓存
|
erpSpuItemsMemo: [], // 请求到的可编辑表格商品数据的缓存
|
||||||
selectedRowsErpSpuIds: [], // 可编辑表格已选行的ErpSpuId
|
selectedRowsErpSpuIds: [], // 可编辑表格已选行的ErpSpuId
|
||||||
insertedRowNumber: 0, // 可编辑表格插入行的行号
|
|
||||||
erpSpuSimpleAll: [], // 简要商品列表
|
erpSpuSimpleAll: [], // 简要商品列表
|
||||||
|
|
||||||
linkCodeVisible: false, // 关联采购申请单对话框开关
|
linkCodeVisible: false, // 关联采购申请单对话框开关
|
||||||
@@ -491,7 +489,6 @@ const clearData = () => {
|
|||||||
if (key === "id" || key === "inventoryCode" || key === "inventoryDate" || key === "inventoryType" || key === "orderType") continue
|
if (key === "id" || key === "inventoryCode" || key === "inventoryDate" || key === "inventoryType" || key === "orderType") continue
|
||||||
baseDataForm[key] = ""
|
baseDataForm[key] = ""
|
||||||
}
|
}
|
||||||
state.insertedRowNumber = 0
|
|
||||||
state.editableTableData = []
|
state.editableTableData = []
|
||||||
state.erpSpuItemsMemo = []
|
state.erpSpuItemsMemo = []
|
||||||
state.selectedRowsErpSpuIds = []
|
state.selectedRowsErpSpuIds = []
|
||||||
|
|||||||
Reference in new issue
Block a user