Browse Source

基础数据页面

master
李胜楠 1 year ago
parent
commit
efe55c7b8b
  1. 380
      src/views/wms/areabasic/index.vue
  2. 345
      src/views/wms/currencyexchange/index.vue
  3. 479
      src/views/wms/customer/index.vue
  4. 413
      src/views/wms/customerdock/index.vue
  5. 454
      src/views/wms/customeritem/index.vue
  6. 414
      src/views/wms/dock/index.vue
  7. 358
      src/views/wms/locationgroup/index.vue
  8. 370
      src/views/wms/process/index.vue
  9. 385
      src/views/wms/productionline/index.vue
  10. 345
      src/views/wms/productionlineitem/index.vue
  11. 343
      src/views/wms/project/index.vue
  12. 366
      src/views/wms/purchaseprice/index.vue
  13. 366
      src/views/wms/saleprice/index.vue
  14. 368
      src/views/wms/stdcostprice/index.vue
  15. 477
      src/views/wms/supplier/index.vue
  16. 495
      src/views/wms/supplieritem/index.vue
  17. 361
      src/views/wms/systemcalendar/index.vue
  18. 352
      src/views/wms/warehouse/index.vue
  19. 348
      src/views/wms/workshop/index.vue
  20. 411
      src/views/wms/workstation/index.vue

380
src/views/wms/areabasic/index.vue

@ -1,290 +1,138 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<el-form
class="-mb-15px"
:model="queryParams"
ref="queryFormRef"
:inline="true"
label-width="68px"
>
<el-form-item label="代码" prop="code">
<el-input
v-model="queryParams.code"
placeholder="请输入代码"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="名称" prop="name">
<el-input
v-model="queryParams.name"
placeholder="请输入名称"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="仓库代码" prop="warehouseCode">
<el-input
v-model="queryParams.warehouseCode"
placeholder="请输入仓库代码"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="类型" prop="type">
<el-select v-model="queryParams.type" placeholder="请选择类型" clearable class="!w-240px">
<el-option
v-for="dict in getStrDictOptions(DICT_TYPE.AREA_TYPE)"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item label="是否是功能区" prop="isFunctional">
<el-select
v-model="queryParams.isFunctional"
placeholder="请选择是否是功能区"
clearable
class="!w-240px"
>
<el-option
v-for="dict in getIntDictOptions(DICT_TYPE.TRUE_FALSE)"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item label="是否可用" prop="available">
<el-select
v-model="queryParams.available"
placeholder="请选择是否可用"
clearable
class="!w-240px"
>
<el-option
v-for="dict in getIntDictOptions(DICT_TYPE.TRUE_FALSE)"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item label="生效时间" prop="activeTime">
<el-date-picker
v-model="queryParams.activeTime"
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-240px"
/>
</el-form-item>
<el-form-item label="失效时间" prop="expireTime">
<el-date-picker
v-model="queryParams.expireTime"
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-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-240px"
/>
</el-form-item>
<el-form-item label="创建者ID" prop="creator">
<el-input
v-model="queryParams.creator"
placeholder="请输入创建者ID"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item>
<el-button type="info" plain @click="handleQuery"><Icon icon="ep:search" class="mr-5px" /> 搜索</el-button>
<el-button type="info" plain @click="resetQuery"><Icon icon="ep:refresh" class="mr-5px" /> 重置</el-button>
<el-button type="primary" @click="openForm('create')" v-hasPermi="['wms:areabasic:create']">
<Icon icon="ep:plus" class="mr-5px" /> 新增
</el-button>
<el-button
type="success"
@click="handleExport"
:loading="exportLoading"
v-hasPermi="['wms:areabasic:export']"
>
<Icon icon="ep:download" class="mr-5px" /> 导出
</el-button>
</el-form-item>
</el-form>
<Search :schema="Area.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
</ContentWrap>
<!-- 列表头部 -->
<TableHead :HeadButttondata="HeadButttondata" @button-base-click="buttonBaseClick" />
<!-- 列表 -->
<ContentWrap>
<el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true">
<el-table-column label="代码" align="center" prop="code" width="150px" />
<el-table-column label="名称" align="center" prop="name" width="150px" />
<el-table-column label="描述" align="center" prop="description" width="150px" />
<el-table-column label="仓库代码" align="center" prop="warehouseCode" width="150px" />
<el-table-column label="类型" align="center" prop="type" width="150px">
<template #default="scope">
<dict-tag :type="DICT_TYPE.AREA_TYPE" :value="scope.row.type" />
</template>
</el-table-column>
<el-table-column label="是否是功能区" align="center" prop="isFunctional" width="150px">
<template #default="scope">
<dict-tag :type="DICT_TYPE.TRUE_FALSE" :value="scope.row.isFunctional" />
</template>
</el-table-column>
<el-table-column label="是否可用" align="center" prop="available" width="150px">
<template #default="scope">
<dict-tag :type="DICT_TYPE.TRUE_FALSE" :value="scope.row.available" />
</template>
</el-table-column>
<el-table-column
label="生效时间"
align="center"
prop="activeTime"
:formatter="dateFormatter"
width="150px"
/>
<el-table-column
label="失效时间"
align="center"
prop="expireTime"
:formatter="dateFormatter"
width="150px"
/>
<el-table-column label="备注" align="center" prop="remark" width="150px" />
<el-table-column
label="创建时间"
align="center"
prop="createTime"
:formatter="dateFormatter"
width="150px"
/>
<el-table-column label="创建者ID" align="center" prop="creator" width="150px" />
<el-table-column label="操作" align="center" width="150px" fixed="right">
<template #default="scope">
<el-button
link
type="primary"
@click="openForm('update', scope.row.id)"
v-hasPermi="['wms:areabasic:update']"
>
编辑
</el-button>
<el-button
link
type="danger"
@click="handleDelete(scope.row.id)"
v-hasPermi="['wms:areabasic:delete']"
>
删除
</el-button>
</template>
</el-table-column>
</el-table>
<!-- 分页 -->
<Pagination
:total="total"
v-model:page="queryParams.pageNo"
v-model:limit="queryParams.pageSize"
@pagination="getList"
/>
<Table
:columns="Area.allSchemas.tableColumns"
:data="tableObject.tableList"
:loading="tableObject.loading"
:pagination="{
total: tableObject.total
}"
v-model:pageSize="tableObject.pageSize"
v-model:currentPage="tableObject.currentPage"
v-model:sort="tableObject.sort"
>
<template #code="{row}">
<el-button type="primary" link @click="openDetail(row, '代码', row.code)">
<span>{{ row.code }}</span>
</el-button>
</template>
<template #action="{ row }">
<ButtonBase :Butttondata="butttondata" @button-base-click="buttonTableClick($event,row)" />
</template>
</Table>
</ContentWrap>
<!-- 表单弹窗添加/修改 -->
<AreaForm ref="formRef" @success="getList" />
<BasicForm
ref="basicFormRef"
@success="getList"
:rules="AreaRules"
:formAllSchemas="Area.allSchemas"
searchTableTitle="物料基础信息"
:searchTableAllSchemas="ItemBasic.allSchemas"
:searchTablePage="ItembasicApi.getItembasicPage"
:apiUpdate="AreaApi.updateArea"
:apiCreate="AreaApi.createArea"
/>
<!-- 详情 -->
<Detail ref="detailRef" :isBasic="true" :allSchemas="Area.allSchemas" />
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/wms/area/import" :importTemplateData="importTemplateData" @success="importSuccess" />
</template>
<script setup lang="ts">
import { DICT_TYPE, getStrDictOptions, getIntDictOptions } from '@/utils/dict'
import { dateFormatter } from '@/utils/formatTime'
import download from '@/utils/download'
import * as AreaApi from '@/api/wms/areabasic'
import AreaForm from './AreaForm.vue'
import * as ItembasicApi from '@/api/wms/itembasic'
import BasicForm from '@/components/BasicForm/src/BasicForm.vue'
import { Area, AreaRules, ItemBasic } from '@/utils/disposition/tableColumns'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import TableHead from '@/components/TableHead/src/TableHead.vue'
import ImportForm from '@/components/ImportForm/src/ImportForm.vue'
import Detail from '@/components/Detail/src/Detail.vue'
defineOptions({ name: 'Area' })
const message = useMessage() //
const { t } = useI18n() //
const loading = ref(true) //
const total = ref(0) //
const list = ref([]) //
const queryParams = reactive({
pageNo: 1,
pageSize: 10,
code: null,
name: null,
description: null,
warehouseCode: null,
type: null,
isFunctional: null,
available: null,
activeTime: [],
expireTime: [],
remark: null,
createTime: [],
creator: null
const { tableObject, tableMethods } = useTable({
getListApi: AreaApi.getAreaPage //
})
const queryFormRef = ref() //
const exportLoading = ref(false) //
/** 查询列表 */
const getList = async () => {
loading.value = true
try {
const data = await AreaApi.getAreaPage(queryParams)
list.value = data.list
total.value = data.total
} finally {
loading.value = false
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultAddBtn({hasPermi:'wms:areabasic:create'}), //
defaultButtons.defaultImportBtn({hasPermi:'wms:areabasic:import'}), //
defaultButtons.defaultExportBtn({hasPermi:'wms:areabasic:export'}), //
// defaultButtons.defaultFilterBtn(), //
defaultButtons.defaultFreshBtn(null), //
// {
// label: '',
// name: 'zdy',
// hide: false,
// type: 'primary',
// icon: 'Select',
// color: ''
// },
]
//
const buttonBaseClick = (val, item) => {
if (val == 'add') { //
openForm('create')
} else if (val == 'import') { //
handleImport()
} else if (val == 'export') { //
handleExport()
} else if (val == 'refresh') { //
getList()
} else if (val == 'filtrate') { //
} else { //
console.log('其他按钮', item)
}
}
/** 搜索按钮操作 */
const handleQuery = () => {
queryParams.pageNo = 1
getList()
}
// -
const butttondata = [
defaultButtons.mainListEditBtn({hasPermi:'wms:areabasic:update'}), //
defaultButtons.mainListDeleteBtn({hasPermi:'wms:areabasic:delete'}), //
]
/** 重置按钮操作 */
const resetQuery = () => {
queryFormRef.value.resetFields()
handleQuery()
// -
const buttonTableClick = async (val, row) => {
if (val == 'edit') { //
// const res = await AreaApi.getItempackaging(row.id)
openForm('update', row)
} else if (val == 'delete') { //
handleDelete(row.id)
}
}
/** 添加/修改操作 */
const formRef = ref()
const openForm = (type: string, id?: number) => {
formRef.value.open(type, id)
const basicFormRef = ref()
const openForm = (type: string, row?: any) => {
basicFormRef.value.open(type, row)
}
/** 详情操作 */
const detailRef = ref()
const openDetail = (row: any, titleName: any, titleValue: any) => {
detailRef.value.openDetail(row, titleName, titleValue)
}
/** 删除按钮操作 */
@ -301,13 +149,14 @@ const handleDelete = async (id: number) => {
}
/** 导出按钮操作 */
const exportLoading = ref(false) //
const handleExport = async () => {
try {
//
await message.exportConfirm()
//
exportLoading.value = true
const data = await AreaApi.exportArea(queryParams)
const data = await AreaApi.exportArea(setSearchParams)
download.excel(data, '库区.xls')
} catch {
} finally {
@ -315,6 +164,21 @@ const handleExport = async () => {
}
}
/** 导入 */
const importFormRef = ref()
const handleImport = () => {
importFormRef.value.open()
}
//
const importTemplateData = reactive({
templateUrl: '',
templateTitle: '库区导入模版.xls'
})
//
const importSuccess = () => {
getList()
}
/** 初始化 **/
onMounted(() => {
getList()

345
src/views/wms/currencyexchange/index.vue

@ -1,255 +1,138 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<el-form
class="-mb-15px"
:model="queryParams"
ref="queryFormRef"
:inline="true"
label-width="68px"
>
<el-form-item label="货币" prop="currency">
<el-input
v-model="queryParams.currency"
placeholder="请输入货币"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="基础货币" prop="basiccurrency">
<el-input
v-model="queryParams.basiccurrency"
placeholder="请输入基础货币"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="比率" prop="rate">
<el-input
v-model="queryParams.rate"
placeholder="请输入比率"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="是否可用" prop="available">
<el-select
v-model="queryParams.available"
placeholder="请选择是否可用"
clearable
class="!w-240px"
>
<el-option
v-for="dict in getIntDictOptions(DICT_TYPE.TRUE_FALSE)"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item label="生效时间" prop="activeTime">
<el-date-picker
v-model="queryParams.activeTime"
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-240px"
/>
</el-form-item>
<el-form-item label="失效时间" prop="expireTime">
<el-date-picker
v-model="queryParams.expireTime"
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-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-240px"
/>
</el-form-item>
<el-form-item label="创建者ID" prop="creator">
<el-input
v-model="queryParams.creator"
placeholder="请输入创建者ID"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item>
<el-button type="info" plain @click="handleQuery"><Icon icon="ep:search" class="mr-5px" /> 搜索</el-button>
<el-button type="info" plain @click="resetQuery"><Icon icon="ep:refresh" class="mr-5px" /> 重置</el-button>
<el-button
type="primary"
@click="openForm('create')"
v-hasPermi="['wms:currencyexchange:create']"
>
<Icon icon="ep:plus" class="mr-5px" /> 新增
</el-button>
<el-button
type="success"
@click="handleExport"
:loading="exportLoading"
v-hasPermi="['wms:currencyexchange:export']"
>
<Icon icon="ep:download" class="mr-5px" /> 导出
</el-button>
</el-form-item>
</el-form>
<Search :schema="Currencyexchange.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
</ContentWrap>
<!-- 列表头部 -->
<TableHead :HeadButttondata="HeadButttondata" @button-base-click="buttonBaseClick" />
<!-- 列表 -->
<ContentWrap>
<el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true">
<el-table-column label="货币" align="center" prop="currency" width="150px" />
<el-table-column label="基础货币" align="center" prop="basiccurrency" width="150px" />
<el-table-column label="比率" align="center" prop="rate" width="150px" />
<el-table-column label="是否可用" align="center" prop="available" width="150px">
<template #default="scope">
<dict-tag :type="DICT_TYPE.TRUE_FALSE" :value="scope.row.available" />
</template>
</el-table-column>
<el-table-column
label="生效时间"
align="center"
prop="activeTime"
:formatter="dateFormatter"
width="150px"
/>
<el-table-column
label="失效时间"
align="center"
prop="expireTime"
:formatter="dateFormatter"
width="150px"
/>
<el-table-column label="备注" align="center" prop="remark" width="150px" />
<el-table-column
label="创建时间"
align="center"
prop="createTime"
:formatter="dateFormatter"
width="150px"
/>
<el-table-column label="创建者ID" align="center" prop="creator" width="150px" />
<el-table-column label="操作" align="center" width="150px" fixed="right">
<template #default="scope">
<el-button
link
type="primary"
@click="openForm('update', scope.row.id)"
v-hasPermi="['wms:currencyexchange:update']"
>
编辑
</el-button>
<el-button
link
type="danger"
@click="handleDelete(scope.row.id)"
v-hasPermi="['wms:currencyexchange:delete']"
>
删除
</el-button>
</template>
</el-table-column>
</el-table>
<!-- 分页 -->
<Pagination
:total="total"
v-model:page="queryParams.pageNo"
v-model:limit="queryParams.pageSize"
@pagination="getList"
/>
<Table
:columns="Currencyexchange.allSchemas.tableColumns"
:data="tableObject.tableList"
:loading="tableObject.loading"
:pagination="{
total: tableObject.total
}"
v-model:pageSize="tableObject.pageSize"
v-model:currentPage="tableObject.currentPage"
v-model:sort="tableObject.sort"
>
<template #currency="{row}">
<el-button type="primary" link @click="openDetail(row, '货币', row.currency)">
<span>{{ row.currency }}</span>
</el-button>
</template>
<template #action="{ row }">
<ButtonBase :Butttondata="butttondata" @button-base-click="buttonTableClick($event,row)" />
</template>
</Table>
</ContentWrap>
<!-- 表单弹窗添加/修改 -->
<CurrencyexchangeForm ref="formRef" @success="getList" />
<BasicForm
ref="basicFormRef"
@success="getList"
:rules="CurrencyexchangeRules"
:formAllSchemas="Currencyexchange.allSchemas"
searchTableTitle="物料基础信息"
:searchTableAllSchemas="ItemBasic.allSchemas"
:searchTablePage="ItembasicApi.getItembasicPage"
:apiUpdate="CurrencyexchangeApi.updateCurrencyexchange"
:apiCreate="CurrencyexchangeApi.createCurrencyexchange"
/>
<!-- 详情 -->
<Detail ref="detailRef" :isBasic="true" :allSchemas="Currencyexchange.allSchemas" />
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/wms/currencyexchange/import" :importTemplateData="importTemplateData" @success="importSuccess" />
</template>
<script setup lang="ts">
import { DICT_TYPE, getIntDictOptions } from '@/utils/dict'
import { dateFormatter } from '@/utils/formatTime'
import download from '@/utils/download'
import * as CurrencyexchangeApi from '@/api/wms/currencyexchange'
import CurrencyexchangeForm from './CurrencyexchangeForm.vue'
import * as ItembasicApi from '@/api/wms/itembasic'
import BasicForm from '@/components/BasicForm/src/BasicForm.vue'
import { Currencyexchange, CurrencyexchangeRules, ItemBasic } from '@/utils/disposition/tableColumns'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import TableHead from '@/components/TableHead/src/TableHead.vue'
import ImportForm from '@/components/ImportForm/src/ImportForm.vue'
import Detail from '@/components/Detail/src/Detail.vue'
defineOptions({ name: 'Currencyexchange' })
const message = useMessage() //
const { t } = useI18n() //
const loading = ref(true) //
const total = ref(0) //
const list = ref([]) //
const queryParams = reactive({
pageNo: 1,
pageSize: 10,
currency: null,
basiccurrency: null,
rate: null,
available: null,
activeTime: [],
expireTime: [],
remark: null,
createTime: [],
creator: null
const { tableObject, tableMethods } = useTable({
getListApi: CurrencyexchangeApi.getCurrencyexchangePage //
})
const queryFormRef = ref() //
const exportLoading = ref(false) //
/** 查询列表 */
const getList = async () => {
loading.value = true
try {
const data = await CurrencyexchangeApi.getCurrencyexchangePage(queryParams)
list.value = data.list
total.value = data.total
} finally {
loading.value = false
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultAddBtn({hasPermi:'wms:currencyexchange:create'}), //
defaultButtons.defaultImportBtn({hasPermi:'wms:currencyexchange:import'}), //
defaultButtons.defaultExportBtn({hasPermi:'wms:currencyexchange:export'}), //
// defaultButtons.defaultFilterBtn(), //
defaultButtons.defaultFreshBtn(null), //
// {
// label: '',
// name: 'zdy',
// hide: false,
// type: 'primary',
// icon: 'Select',
// color: ''
// },
]
//
const buttonBaseClick = (val, item) => {
if (val == 'add') { //
openForm('create')
} else if (val == 'import') { //
handleImport()
} else if (val == 'export') { //
handleExport()
} else if (val == 'refresh') { //
getList()
} else if (val == 'filtrate') { //
} else { //
console.log('其他按钮', item)
}
}
/** 搜索按钮操作 */
const handleQuery = () => {
queryParams.pageNo = 1
getList()
}
// -
const butttondata = [
defaultButtons.mainListEditBtn({hasPermi:'wms:currencyexchange:update'}), //
defaultButtons.mainListDeleteBtn({hasPermi:'wms:currencyexchange:delete'}), //
]
/** 重置按钮操作 */
const resetQuery = () => {
queryFormRef.value.resetFields()
handleQuery()
// -
const buttonTableClick = async (val, row) => {
if (val == 'edit') { //
// const res = await CurrencyexchangeApi.getItempackaging(row.id)
openForm('update', row)
} else if (val == 'delete') { //
handleDelete(row.id)
}
}
/** 添加/修改操作 */
const formRef = ref()
const openForm = (type: string, id?: number) => {
formRef.value.open(type, id)
const basicFormRef = ref()
const openForm = (type: string, row?: any) => {
basicFormRef.value.open(type, row)
}
/** 详情操作 */
const detailRef = ref()
const openDetail = (row: any, titleName: any, titleValue: any) => {
detailRef.value.openDetail(row, titleName, titleValue)
}
/** 删除按钮操作 */
@ -266,13 +149,14 @@ const handleDelete = async (id: number) => {
}
/** 导出按钮操作 */
const exportLoading = ref(false) //
const handleExport = async () => {
try {
//
await message.exportConfirm()
//
exportLoading.value = true
const data = await CurrencyexchangeApi.exportCurrencyexchange(queryParams)
const data = await CurrencyexchangeApi.exportCurrencyexchange(setSearchParams)
download.excel(data, '货币转换.xls')
} catch {
} finally {
@ -280,6 +164,21 @@ const handleExport = async () => {
}
}
/** 导入 */
const importFormRef = ref()
const handleImport = () => {
importFormRef.value.open()
}
//
const importTemplateData = reactive({
templateUrl: '',
templateTitle: '货币转换导入模版.xls'
})
//
const importSuccess = () => {
getList()
}
/** 初始化 **/
onMounted(() => {
getList()

479
src/views/wms/customer/index.vue

@ -1,387 +1,138 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<el-form
class="-mb-15px"
:model="queryParams"
ref="queryFormRef"
:inline="true"
label-width="68px"
>
<el-form-item label="代码" prop="code">
<el-input
v-model="queryParams.code"
placeholder="请输入代码"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="名称" prop="name">
<el-input
v-model="queryParams.name"
placeholder="请输入名称"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="简称" prop="shortName">
<el-input
v-model="queryParams.shortName"
placeholder="请输入简称"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="地址" prop="address">
<el-input
v-model="queryParams.address"
placeholder="请输入地址"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="国家" prop="country">
<el-input
v-model="queryParams.country"
placeholder="请输入国家"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="城市" prop="city">
<el-input
v-model="queryParams.city"
placeholder="请输入城市"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="电话" prop="phone">
<el-input
v-model="queryParams.phone"
placeholder="请输入电话"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="传真" prop="fax">
<el-input
v-model="queryParams.fax"
placeholder="请输入传真"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="邮编" prop="postId">
<el-input
v-model="queryParams.postId"
placeholder="请输入邮编"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="联系人" prop="contacts">
<el-input
v-model="queryParams.contacts"
placeholder="请输入联系人"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="银行" prop="bank">
<el-input
v-model="queryParams.bank"
placeholder="请输入银行"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="币种" prop="currency">
<el-select
v-model="queryParams.currency"
placeholder="请选择币种"
clearable
class="!w-240px"
>
<el-option
v-for="dict in getStrDictOptions(DICT_TYPE.CURRENCY)"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item label="税率" prop="taxRate">
<el-input
v-model="queryParams.taxRate"
placeholder="请输入税率"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="类型" prop="type">
<el-select v-model="queryParams.type" placeholder="请选择类型" clearable class="!w-240px">
<el-option
v-for="dict in getStrDictOptions(DICT_TYPE.CUSTOMER_TYPE)"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item label="是否可用" prop="available">
<el-select
v-model="queryParams.available"
placeholder="请选择是否可用"
clearable
class="!w-240px"
>
<el-option
v-for="dict in getIntDictOptions(DICT_TYPE.TRUE_FALSE)"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item label="生效时间" prop="activeTime">
<el-date-picker
v-model="queryParams.activeTime"
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-240px"
/>
</el-form-item>
<el-form-item label="失效时间" prop="expireTime">
<el-date-picker
v-model="queryParams.expireTime"
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-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-240px"
/>
</el-form-item>
<el-form-item label="创建者ID" prop="creator">
<el-input
v-model="queryParams.creator"
placeholder="请输入创建者ID"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item>
<el-button type="info" plain @click="handleQuery"><Icon icon="ep:search" class="mr-5px" /> 搜索</el-button>
<el-button type="info" plain @click="resetQuery"><Icon icon="ep:refresh" class="mr-5px" /> 重置</el-button>
<el-button type="primary" @click="openForm('create')" v-hasPermi="['wms:customer:create']">
<Icon icon="ep:plus" class="mr-5px" /> 新增
</el-button>
<el-button
type="success"
@click="handleExport"
:loading="exportLoading"
v-hasPermi="['wms:customer:export']"
>
<Icon icon="ep:download" class="mr-5px" /> 导出
</el-button>
</el-form-item>
</el-form>
<Search :schema="Customer.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
</ContentWrap>
<!-- 列表头部 -->
<TableHead :HeadButttondata="HeadButttondata" @button-base-click="buttonBaseClick" />
<!-- 列表 -->
<ContentWrap>
<el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true">
<el-table-column label="代码" align="center" prop="code" width="150px" />
<el-table-column label="名称" align="center" prop="name" width="150px" />
<el-table-column label="简称" align="center" prop="shortName" width="150px" />
<el-table-column label="地址" align="center" prop="address" width="150px" />
<el-table-column label="国家" align="center" prop="country" width="150px" />
<el-table-column label="城市" align="center" prop="city" width="150px" />
<el-table-column label="电话" align="center" prop="phone" width="150px" />
<el-table-column label="传真" align="center" prop="fax" width="150px" />
<el-table-column label="邮编" align="center" prop="postId" width="150px" />
<el-table-column label="联系人" align="center" prop="contacts" width="150px" />
<el-table-column label="银行" align="center" prop="bank" width="150px" />
<el-table-column label="币种" align="center" prop="currency" width="150px">
<template #default="scope">
<dict-tag :type="DICT_TYPE.CURRENCY" :value="scope.row.currency" />
</template>
</el-table-column>
<el-table-column label="税率" align="center" prop="taxRate" width="150px" />
<el-table-column label="类型" align="center" prop="type" width="150px">
<template #default="scope">
<dict-tag :type="DICT_TYPE.CUSTOMER_TYPE" :value="scope.row.type" />
</template>
</el-table-column>
<el-table-column label="是否可用" align="center" prop="available" width="150px">
<template #default="scope">
<dict-tag :type="DICT_TYPE.TRUE_FALSE" :value="scope.row.available" />
</template>
</el-table-column>
<el-table-column
label="生效时间"
align="center"
prop="activeTime"
:formatter="dateFormatter"
width="150px"
/>
<el-table-column
label="失效时间"
align="center"
prop="expireTime"
:formatter="dateFormatter"
width="150px"
/>
<el-table-column label="备注" align="center" prop="remark" width="150px" />
<el-table-column
label="创建时间"
align="center"
prop="createTime"
:formatter="dateFormatter"
width="150px"
/>
<el-table-column label="创建者ID" align="center" prop="creator" width="150px" />
<el-table-column label="操作" align="center" width="150px" fixed="right">
<template #default="scope">
<el-button
link
type="primary"
@click="openForm('update', scope.row.id)"
v-hasPermi="['wms:customer:update']"
>
编辑
</el-button>
<el-button
link
type="danger"
@click="handleDelete(scope.row.id)"
v-hasPermi="['wms:customer:delete']"
>
删除
</el-button>
</template>
</el-table-column>
</el-table>
<!-- 分页 -->
<Pagination
:total="total"
v-model:page="queryParams.pageNo"
v-model:limit="queryParams.pageSize"
@pagination="getList"
/>
<Table
:columns="Customer.allSchemas.tableColumns"
:data="tableObject.tableList"
:loading="tableObject.loading"
:pagination="{
total: tableObject.total
}"
v-model:pageSize="tableObject.pageSize"
v-model:currentPage="tableObject.currentPage"
v-model:sort="tableObject.sort"
>
<template #code="{row}">
<el-button type="primary" link @click="openDetail(row, '代码', row.code)">
<span>{{ row.code }}</span>
</el-button>
</template>
<template #action="{ row }">
<ButtonBase :Butttondata="butttondata" @button-base-click="buttonTableClick($event,row)" />
</template>
</Table>
</ContentWrap>
<!-- 表单弹窗添加/修改 -->
<CustomerForm ref="formRef" @success="getList" />
<BasicForm
ref="basicFormRef"
@success="getList"
:rules="CustomerRules"
:formAllSchemas="Customer.allSchemas"
searchTableTitle="物料基础信息"
:searchTableAllSchemas="ItemBasic.allSchemas"
:searchTablePage="ItembasicApi.getItembasicPage"
:apiUpdate="CustomerApi.updateCustomer"
:apiCreate="CustomerApi.createCustomer"
/>
<!-- 详情 -->
<Detail ref="detailRef" :isBasic="true" :allSchemas="Customer.allSchemas" />
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/wms/customer/import" :importTemplateData="importTemplateData" @success="importSuccess" />
</template>
<script setup lang="ts">
import { DICT_TYPE, getStrDictOptions, getIntDictOptions } from '@/utils/dict'
import { dateFormatter } from '@/utils/formatTime'
import download from '@/utils/download'
import * as CustomerApi from '@/api/wms/customer'
import CustomerForm from './CustomerForm.vue'
import * as ItembasicApi from '@/api/wms/itembasic'
import BasicForm from '@/components/BasicForm/src/BasicForm.vue'
import { Customer, CustomerRules, ItemBasic } from '@/utils/disposition/tableColumns'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import TableHead from '@/components/TableHead/src/TableHead.vue'
import ImportForm from '@/components/ImportForm/src/ImportForm.vue'
import Detail from '@/components/Detail/src/Detail.vue'
defineOptions({ name: 'Customer' })
const message = useMessage() //
const { t } = useI18n() //
const loading = ref(true) //
const total = ref(0) //
const list = ref([]) //
const queryParams = reactive({
pageNo: 1,
pageSize: 10,
code: null,
name: null,
shortName: null,
address: null,
country: null,
city: null,
phone: null,
fax: null,
postId: null,
contacts: null,
bank: null,
currency: null,
taxRate: null,
type: null,
available: null,
activeTime: [],
expireTime: [],
remark: null,
createTime: [],
creator: null
const { tableObject, tableMethods } = useTable({
getListApi: CustomerApi.getCustomerPage //
})
const queryFormRef = ref() //
const exportLoading = ref(false) //
/** 查询列表 */
const getList = async () => {
loading.value = true
try {
const data = await CustomerApi.getCustomerPage(queryParams)
list.value = data.list
total.value = data.total
} finally {
loading.value = false
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultAddBtn({hasPermi:'wms:customer:create'}), //
defaultButtons.defaultImportBtn({hasPermi:'wms:customer:import'}), //
defaultButtons.defaultExportBtn({hasPermi:'wms:customer:export'}), //
// defaultButtons.defaultFilterBtn(), //
defaultButtons.defaultFreshBtn(null), //
// {
// label: '',
// name: 'zdy',
// hide: false,
// type: 'primary',
// icon: 'Select',
// color: ''
// },
]
//
const buttonBaseClick = (val, item) => {
if (val == 'add') { //
openForm('create')
} else if (val == 'import') { //
handleImport()
} else if (val == 'export') { //
handleExport()
} else if (val == 'refresh') { //
getList()
} else if (val == 'filtrate') { //
} else { //
console.log('其他按钮', item)
}
}
/** 搜索按钮操作 */
const handleQuery = () => {
queryParams.pageNo = 1
getList()
}
// -
const butttondata = [
defaultButtons.mainListEditBtn({hasPermi:'wms:customer:update'}), //
defaultButtons.mainListDeleteBtn({hasPermi:'wms:customer:delete'}), //
]
/** 重置按钮操作 */
const resetQuery = () => {
queryFormRef.value.resetFields()
handleQuery()
// -
const buttonTableClick = async (val, row) => {
if (val == 'edit') { //
// const res = await CustomerApi.getItempackaging(row.id)
openForm('update', row)
} else if (val == 'delete') { //
handleDelete(row.id)
}
}
/** 添加/修改操作 */
const formRef = ref()
const openForm = (type: string, id?: number) => {
formRef.value.open(type, id)
const basicFormRef = ref()
const openForm = (type: string, row?: any) => {
basicFormRef.value.open(type, row)
}
/** 详情操作 */
const detailRef = ref()
const openDetail = (row: any, titleName: any, titleValue: any) => {
detailRef.value.openDetail(row, titleName, titleValue)
}
/** 删除按钮操作 */
@ -398,20 +149,36 @@ const handleDelete = async (id: number) => {
}
/** 导出按钮操作 */
const exportLoading = ref(false) //
const handleExport = async () => {
try {
//
await message.exportConfirm()
//
exportLoading.value = true
const data = await CustomerApi.exportCustomer(queryParams)
download.excel(data, '客户.xls')
const data = await CustomerApi.exportCustomer(setSearchParams)
download.excel(data, '客户 .xls')
} catch {
} finally {
exportLoading.value = false
}
}
/** 导入 */
const importFormRef = ref()
const handleImport = () => {
importFormRef.value.open()
}
//
const importTemplateData = reactive({
templateUrl: '',
templateTitle: '客户导入模版.xls'
})
//
const importSuccess = () => {
getList()
}
/** 初始化 **/
onMounted(() => {
getList()

413
src/views/wms/customerdock/index.vue

@ -1,323 +1,138 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<el-form
class="-mb-15px"
:model="queryParams"
ref="queryFormRef"
:inline="true"
label-width="68px"
>
<el-form-item label="代码" prop="code">
<el-input
v-model="queryParams.code"
placeholder="请输入代码"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="名称" prop="name">
<el-input
v-model="queryParams.name"
placeholder="请输入名称"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="城市" prop="city">
<el-input
v-model="queryParams.city"
placeholder="请输入城市"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="地址" prop="address">
<el-input
v-model="queryParams.address"
placeholder="请输入地址"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="联系人姓名" prop="contactPerson">
<el-input
v-model="queryParams.contactPerson"
placeholder="请输入联系人姓名"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="联系人电话" prop="contactPhone">
<el-input
v-model="queryParams.contactPhone"
placeholder="请输入联系人电话"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="客户代码" prop="customerCode">
<el-input
v-model="queryParams.customerCode"
placeholder="请输入客户代码"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="仓库" prop="warehouseCode">
<el-input
v-model="queryParams.warehouseCode"
placeholder="请输入仓库"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="默认库位" prop="defaultLocationCode">
<el-input
v-model="queryParams.defaultLocationCode"
placeholder="请输入默认库位"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="是否可用" prop="available">
<el-select
v-model="queryParams.available"
placeholder="请选择是否可用"
clearable
class="!w-240px"
>
<el-option
v-for="dict in getIntDictOptions(DICT_TYPE.TRUE_FALSE)"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item label="生效时间" prop="activeTime">
<el-date-picker
v-model="queryParams.activeTime"
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-240px"
/>
</el-form-item>
<el-form-item label="失效时间" prop="expireTime">
<el-date-picker
v-model="queryParams.expireTime"
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-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-240px"
/>
</el-form-item>
<el-form-item label="创建者ID" prop="creator">
<el-input
v-model="queryParams.creator"
placeholder="请输入创建者ID"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item>
<el-button type="info" plain @click="handleQuery"><Icon icon="ep:search" class="mr-5px" /> 搜索</el-button>
<el-button type="info" plain @click="resetQuery"><Icon icon="ep:refresh" class="mr-5px" /> 重置</el-button>
<el-button
type="primary"
@click="openForm('create')"
v-hasPermi="['wms:customerdock:create']"
>
<Icon icon="ep:plus" class="mr-5px" /> 新增
</el-button>
<el-button
type="success"
@click="handleExport"
:loading="exportLoading"
v-hasPermi="['wms:customerdock:export']"
>
<Icon icon="ep:download" class="mr-5px" /> 导出
</el-button>
</el-form-item>
</el-form>
<Search :schema="Customerdock.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
</ContentWrap>
<!-- 列表头部 -->
<TableHead :HeadButttondata="HeadButttondata" @button-base-click="buttonBaseClick" />
<!-- 列表 -->
<ContentWrap>
<el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true">
<el-table-column label="代码" align="center" prop="code" width="150px" />
<el-table-column label="名称" align="center" prop="name" width="150px" />
<el-table-column label="描述" align="center" prop="description" width="150px" />
<el-table-column label="城市" align="center" prop="city" width="150px" />
<el-table-column label="地址" align="center" prop="address" width="150px" />
<el-table-column label="联系人姓名" align="center" prop="contactPerson" width="150px" />
<el-table-column label="联系人电话" align="center" prop="contactPhone" width="150px" />
<el-table-column label="客户代码" align="center" prop="customerCode" width="150px" />
<el-table-column label="仓库" align="center" prop="warehouseCode" width="150px" />
<el-table-column label="默认库位" align="center" prop="defaultLocationCode" width="150px" />
<el-table-column label="是否可用" align="center" prop="available" width="150px">
<template #default="scope">
<dict-tag :type="DICT_TYPE.TRUE_FALSE" :value="scope.row.available" />
</template>
</el-table-column>
<el-table-column
label="生效时间"
align="center"
prop="activeTime"
:formatter="dateFormatter"
width="150px"
/>
<el-table-column
label="失效时间"
align="center"
prop="expireTime"
:formatter="dateFormatter"
width="150px"
/>
<el-table-column label="备注" align="center" prop="remark" width="150px" />
<el-table-column
label="创建时间"
align="center"
prop="createTime"
:formatter="dateFormatter"
width="150px"
/>
<el-table-column label="创建者ID" align="center" prop="creator" width="150px" />
<el-table-column label="操作" align="center" width="150px" fixed="right">
<template #default="scope">
<el-button
link
type="primary"
@click="openForm('update', scope.row.id)"
v-hasPermi="['wms:customerdock:update']"
>
编辑
</el-button>
<el-button
link
type="danger"
@click="handleDelete(scope.row.id)"
v-hasPermi="['wms:customerdock:delete']"
>
删除
</el-button>
</template>
</el-table-column>
</el-table>
<!-- 分页 -->
<Pagination
:total="total"
v-model:page="queryParams.pageNo"
v-model:limit="queryParams.pageSize"
@pagination="getList"
/>
<Table
:columns="Customerdock.allSchemas.tableColumns"
:data="tableObject.tableList"
:loading="tableObject.loading"
:pagination="{
total: tableObject.total
}"
v-model:pageSize="tableObject.pageSize"
v-model:currentPage="tableObject.currentPage"
v-model:sort="tableObject.sort"
>
<template #code="{row}">
<el-button type="primary" link @click="openDetail(row, '代码', row.code)">
<span>{{ row.code }}</span>
</el-button>
</template>
<template #action="{ row }">
<ButtonBase :Butttondata="butttondata" @button-base-click="buttonTableClick($event,row)" />
</template>
</Table>
</ContentWrap>
<!-- 表单弹窗添加/修改 -->
<CustomerdockForm ref="formRef" @success="getList" />
<BasicForm
ref="basicFormRef"
@success="getList"
:rules="CustomerdockRules"
:formAllSchemas="Customerdock.allSchemas"
searchTableTitle="物料基础信息"
:searchTableAllSchemas="ItemBasic.allSchemas"
:searchTablePage="ItembasicApi.getItembasicPage"
:apiUpdate="CustomerdockApi.updateCustomerdock"
:apiCreate="CustomerdockApi.createCustomerdock"
/>
<!-- 详情 -->
<Detail ref="detailRef" :isBasic="true" :allSchemas="Customerdock.allSchemas" />
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/wms/customerdock/import" :importTemplateData="importTemplateData" @success="importSuccess" />
</template>
<script setup lang="ts">
import { DICT_TYPE, getIntDictOptions } from '@/utils/dict'
import { dateFormatter } from '@/utils/formatTime'
import download from '@/utils/download'
import * as CustomerdockApi from '@/api/wms/customerdock'
import CustomerdockForm from './CustomerdockForm.vue'
import * as ItembasicApi from '@/api/wms/itembasic'
import BasicForm from '@/components/BasicForm/src/BasicForm.vue'
import { Customerdock, CustomerdockRules, ItemBasic } from '@/utils/disposition/tableColumns'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import TableHead from '@/components/TableHead/src/TableHead.vue'
import ImportForm from '@/components/ImportForm/src/ImportForm.vue'
import Detail from '@/components/Detail/src/Detail.vue'
defineOptions({ name: 'Customerdock' })
const message = useMessage() //
const { t } = useI18n() //
const loading = ref(true) //
const total = ref(0) //
const list = ref([]) //
const queryParams = reactive({
pageNo: 1,
pageSize: 10,
code: null,
name: null,
description: null,
city: null,
address: null,
contactPerson: null,
contactPhone: null,
customerCode: null,
warehouseCode: null,
defaultLocationCode: null,
available: null,
activeTime: [],
expireTime: [],
remark: null,
createTime: [],
creator: null
const { tableObject, tableMethods } = useTable({
getListApi: CustomerdockApi.getCustomerdockPage //
})
const queryFormRef = ref() //
const exportLoading = ref(false) //
/** 查询列表 */
const getList = async () => {
loading.value = true
try {
const data = await CustomerdockApi.getCustomerdockPage(queryParams)
list.value = data.list
total.value = data.total
} finally {
loading.value = false
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultAddBtn({hasPermi:'wms:customerdock:create'}), //
defaultButtons.defaultImportBtn({hasPermi:'wms:customerdock:import'}), //
defaultButtons.defaultExportBtn({hasPermi:'wms:customerdock:export'}), //
// defaultButtons.defaultFilterBtn(), //
defaultButtons.defaultFreshBtn(null), //
// {
// label: '',
// name: 'zdy',
// hide: false,
// type: 'primary',
// icon: 'Select',
// color: ''
// },
]
//
const buttonBaseClick = (val, item) => {
if (val == 'add') { //
openForm('create')
} else if (val == 'import') { //
handleImport()
} else if (val == 'export') { //
handleExport()
} else if (val == 'refresh') { //
getList()
} else if (val == 'filtrate') { //
} else { //
console.log('其他按钮', item)
}
}
/** 搜索按钮操作 */
const handleQuery = () => {
queryParams.pageNo = 1
getList()
}
// -
const butttondata = [
defaultButtons.mainListEditBtn({hasPermi:'wms:customerdock:update'}), //
defaultButtons.mainListDeleteBtn({hasPermi:'wms:customerdock:delete'}), //
]
/** 重置按钮操作 */
const resetQuery = () => {
queryFormRef.value.resetFields()
handleQuery()
// -
const buttonTableClick = async (val, row) => {
if (val == 'edit') { //
// const res = await CustomerdockApi.getItempackaging(row.id)
openForm('update', row)
} else if (val == 'delete') { //
handleDelete(row.id)
}
}
/** 添加/修改操作 */
const formRef = ref()
const openForm = (type: string, id?: number) => {
formRef.value.open(type, id)
const basicFormRef = ref()
const openForm = (type: string, row?: any) => {
basicFormRef.value.open(type, row)
}
/** 详情操作 */
const detailRef = ref()
const openDetail = (row: any, titleName: any, titleValue: any) => {
detailRef.value.openDetail(row, titleName, titleValue)
}
/** 删除按钮操作 */
@ -334,13 +149,14 @@ const handleDelete = async (id: number) => {
}
/** 导出按钮操作 */
const exportLoading = ref(false) //
const handleExport = async () => {
try {
//
await message.exportConfirm()
//
exportLoading.value = true
const data = await CustomerdockApi.exportCustomerdock(queryParams)
const data = await CustomerdockApi.exportCustomerdock(setSearchParams)
download.excel(data, '客户月台.xls')
} catch {
} finally {
@ -348,6 +164,21 @@ const handleExport = async () => {
}
}
/** 导入 */
const importFormRef = ref()
const handleImport = () => {
importFormRef.value.open()
}
//
const importTemplateData = reactive({
templateUrl: '',
templateTitle: '客户月台导入模版.xls'
})
//
const importSuccess = () => {
getList()
}
/** 初始化 **/
onMounted(() => {
getList()

454
src/views/wms/customeritem/index.vue

@ -1,362 +1,138 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<el-form
class="-mb-15px"
:model="queryParams"
ref="queryFormRef"
:inline="true"
label-width="68px"
>
<el-form-item label="客户代码" prop="customerCode">
<el-input
v-model="queryParams.customerCode"
placeholder="请输入客户代码"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="物料代码" prop="itemCode">
<el-input
v-model="queryParams.itemCode"
placeholder="请输入物料代码"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="客户物料代码" prop="customerItemCode">
<el-input
v-model="queryParams.customerItemCode"
placeholder="请输入客户物料代码"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="客户计量单位" prop="cusotmerUom">
<el-select
v-model="queryParams.cusotmerUom"
placeholder="请选择客户计量单位"
clearable
class="!w-240px"
>
<el-option
v-for="dict in getStrDictOptions(DICT_TYPE.UOM)"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item label="转换率" prop="convertRate">
<el-input
v-model="queryParams.convertRate"
placeholder="请输入转换率"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="客户包装单位" prop="packUnit">
<el-select
v-model="queryParams.packUnit"
placeholder="请选择客户包装单位"
clearable
class="!w-240px"
>
<el-option
v-for="dict in getStrDictOptions(DICT_TYPE.PACK_UNIT)"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item label="客户包装量" prop="packQty">
<el-input
v-model="queryParams.packQty"
placeholder="请输入客户包装量"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="客户替代包装单位" prop="altPackUnit">
<el-select
v-model="queryParams.altPackUnit"
placeholder="请选择客户替代包装单位"
clearable
class="!w-240px"
>
<el-option
v-for="dict in getStrDictOptions(DICT_TYPE.PACK_UNIT)"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item label="客户替代包装量" prop="altPackQty">
<el-input
v-model="queryParams.altPackQty"
placeholder="请输入客户替代包装量"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="每器具包装数" prop="packQtyOfContainer">
<el-input
v-model="queryParams.packQtyOfContainer"
placeholder="请输入每器具包装数"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="是否可用" prop="available">
<el-select
v-model="queryParams.available"
placeholder="请选择是否可用"
clearable
class="!w-240px"
>
<el-option
v-for="dict in getIntDictOptions(DICT_TYPE.TRUE_FALSE)"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item label="生效时间" prop="activeTime">
<el-date-picker
v-model="queryParams.activeTime"
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-240px"
/>
</el-form-item>
<el-form-item label="失效时间" prop="expireTime">
<el-date-picker
v-model="queryParams.expireTime"
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-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-240px"
/>
</el-form-item>
<el-form-item label="创建者ID" prop="creator">
<el-input
v-model="queryParams.creator"
placeholder="请输入创建者ID"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item>
<el-button type="info" plain @click="handleQuery"><Icon icon="ep:search" class="mr-5px" /> 搜索</el-button>
<el-button type="info" plain @click="resetQuery"><Icon icon="ep:refresh" class="mr-5px" /> 重置</el-button>
<el-button
type="primary"
@click="openForm('create')"
v-hasPermi="['wms:customeritem:create']"
>
<Icon icon="ep:plus" class="mr-5px" /> 新增
</el-button>
<el-button
type="success"
@click="handleExport"
:loading="exportLoading"
v-hasPermi="['wms:customeritem:export']"
>
<Icon icon="ep:download" class="mr-5px" /> 导出
</el-button>
</el-form-item>
</el-form>
<Search :schema="Customeritem.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
</ContentWrap>
<!-- 列表头部 -->
<TableHead :HeadButttondata="HeadButttondata" @button-base-click="buttonBaseClick" />
<!-- 列表 -->
<ContentWrap>
<el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true">
<el-table-column label="客户代码" align="center" prop="customerCode" width="150px" />
<el-table-column label="物料代码" align="center" prop="itemCode" width="150px" />
<el-table-column label="客户物料代码" align="center" prop="customerItemCode" width="150px" />
<el-table-column label="客户计量单位" align="center" prop="cusotmerUom" width="150px">
<template #default="scope">
<dict-tag :type="DICT_TYPE.UOM" :value="scope.row.cusotmerUom" />
</template>
</el-table-column>
<el-table-column label="转换率" align="center" prop="convertRate" width="150px" />
<el-table-column label="客户包装单位" align="center" prop="packUnit" width="150px">
<template #default="scope">
<dict-tag :type="DICT_TYPE.PACK_UNIT" :value="scope.row.packUnit" />
</template>
</el-table-column>
<el-table-column label="客户包装量" align="center" prop="packQty" width="150px" />
<el-table-column label="客户替代包装单位" align="center" prop="altPackUnit" width="150px">
<template #default="scope">
<dict-tag :type="DICT_TYPE.PACK_UNIT" :value="scope.row.altPackUnit" />
</template>
</el-table-column>
<el-table-column label="客户替代包装量" align="center" prop="altPackQty" width="150px" />
<el-table-column label="每器具包装数" align="center" prop="packQtyOfContainer" width="150px" />
<el-table-column label="是否可用" align="center" prop="available" width="150px">
<template #default="scope">
<dict-tag :type="DICT_TYPE.TRUE_FALSE" :value="scope.row.available" />
</template>
</el-table-column>
<el-table-column
label="生效时间"
align="center"
prop="activeTime"
:formatter="dateFormatter"
width="150px"
/>
<el-table-column
label="失效时间"
align="center"
prop="expireTime"
:formatter="dateFormatter"
width="150px"
/>
<el-table-column label="备注" align="center" prop="remark" width="150px" />
<el-table-column
label="创建时间"
align="center"
prop="createTime"
:formatter="dateFormatter"
width="150px"
/>
<el-table-column label="创建者ID" align="center" prop="creator" width="150px" />
<el-table-column label="操作" align="center" width="150px" fixed="right">
<template #default="scope">
<el-button
link
type="primary"
@click="openForm('update', scope.row.id)"
v-hasPermi="['wms:customeritem:update']"
>
编辑
</el-button>
<el-button
link
type="danger"
@click="handleDelete(scope.row.id)"
v-hasPermi="['wms:customeritem:delete']"
>
删除
</el-button>
</template>
</el-table-column>
</el-table>
<!-- 分页 -->
<Pagination
:total="total"
v-model:page="queryParams.pageNo"
v-model:limit="queryParams.pageSize"
@pagination="getList"
/>
<Table
:columns="Customeritem.allSchemas.tableColumns"
:data="tableObject.tableList"
:loading="tableObject.loading"
:pagination="{
total: tableObject.total
}"
v-model:pageSize="tableObject.pageSize"
v-model:currentPage="tableObject.currentPage"
v-model:sort="tableObject.sort"
>
<template #customerCode="{row}">
<el-button type="primary" link @click="openDetail(row, '客户代码', row.customerCode)">
<span>{{ row.customerCode }}</span>
</el-button>
</template>
<template #action="{ row }">
<ButtonBase :Butttondata="butttondata" @button-base-click="buttonTableClick($event,row)" />
</template>
</Table>
</ContentWrap>
<!-- 表单弹窗添加/修改 -->
<CustomeritemForm ref="formRef" @success="getList" />
<BasicForm
ref="basicFormRef"
@success="getList"
:rules="CustomeritemRules"
:formAllSchemas="Customeritem.allSchemas"
searchTableTitle="物料基础信息"
:searchTableAllSchemas="ItemBasic.allSchemas"
:searchTablePage="ItembasicApi.getItembasicPage"
:apiUpdate="CustomeritemApi.updateCustomeritem"
:apiCreate="CustomeritemApi.createCustomeritem"
/>
<!-- 详情 -->
<Detail ref="detailRef" :isBasic="true" :allSchemas="Customeritem.allSchemas" />
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/wms/customeritem/import" :importTemplateData="importTemplateData" @success="importSuccess" />
</template>
<script setup lang="ts">
import { DICT_TYPE, getStrDictOptions, getIntDictOptions } from '@/utils/dict'
import { dateFormatter } from '@/utils/formatTime'
import download from '@/utils/download'
import * as CustomeritemApi from '@/api/wms/customeritem'
import CustomeritemForm from './CustomeritemForm.vue'
import * as ItembasicApi from '@/api/wms/itembasic'
import BasicForm from '@/components/BasicForm/src/BasicForm.vue'
import { Customeritem, CustomeritemRules, ItemBasic } from '@/utils/disposition/tableColumns'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import TableHead from '@/components/TableHead/src/TableHead.vue'
import ImportForm from '@/components/ImportForm/src/ImportForm.vue'
import Detail from '@/components/Detail/src/Detail.vue'
defineOptions({ name: 'Customeritem' })
const message = useMessage() //
const { t } = useI18n() //
const loading = ref(true) //
const total = ref(0) //
const list = ref([]) //
const queryParams = reactive({
pageNo: 1,
pageSize: 10,
customerCode: null,
itemCode: null,
customerItemCode: null,
cusotmerUom: null,
convertRate: null,
packUnit: null,
packQty: null,
altPackUnit: null,
altPackQty: null,
packQtyOfContainer: null,
available: null,
activeTime: [],
expireTime: [],
remark: null,
createTime: [],
creator: null
const { tableObject, tableMethods } = useTable({
getListApi: CustomeritemApi.getCustomeritemPage //
})
const queryFormRef = ref() //
const exportLoading = ref(false) //
/** 查询列表 */
const getList = async () => {
loading.value = true
try {
const data = await CustomeritemApi.getCustomeritemPage(queryParams)
list.value = data.list
total.value = data.total
} finally {
loading.value = false
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultAddBtn({hasPermi:'wms:customeritem:create'}), //
defaultButtons.defaultImportBtn({hasPermi:'wms:customeritem:import'}), //
defaultButtons.defaultExportBtn({hasPermi:'wms:customeritem:export'}), //
// defaultButtons.defaultFilterBtn(), //
defaultButtons.defaultFreshBtn(null), //
// {
// label: '',
// name: 'zdy',
// hide: false,
// type: 'primary',
// icon: 'Select',
// color: ''
// },
]
//
const buttonBaseClick = (val, item) => {
if (val == 'add') { //
openForm('create')
} else if (val == 'import') { //
handleImport()
} else if (val == 'export') { //
handleExport()
} else if (val == 'refresh') { //
getList()
} else if (val == 'filtrate') { //
} else { //
console.log('其他按钮', item)
}
}
/** 搜索按钮操作 */
const handleQuery = () => {
queryParams.pageNo = 1
getList()
}
// -
const butttondata = [
defaultButtons.mainListEditBtn({hasPermi:'wms:customeritem:update'}), //
defaultButtons.mainListDeleteBtn({hasPermi:'wms:customeritem:delete'}), //
]
/** 重置按钮操作 */
const resetQuery = () => {
queryFormRef.value.resetFields()
handleQuery()
// -
const buttonTableClick = async (val, row) => {
if (val == 'edit') { //
// const res = await CustomeritemApi.getItempackaging(row.id)
openForm('update', row)
} else if (val == 'delete') { //
handleDelete(row.id)
}
}
/** 添加/修改操作 */
const formRef = ref()
const openForm = (type: string, id?: number) => {
formRef.value.open(type, id)
const basicFormRef = ref()
const openForm = (type: string, row?: any) => {
basicFormRef.value.open(type, row)
}
/** 详情操作 */
const detailRef = ref()
const openDetail = (row: any, titleName: any, titleValue: any) => {
detailRef.value.openDetail(row, titleName, titleValue)
}
/** 删除按钮操作 */
@ -373,20 +149,36 @@ const handleDelete = async (id: number) => {
}
/** 导出按钮操作 */
const exportLoading = ref(false) //
const handleExport = async () => {
try {
//
await message.exportConfirm()
//
exportLoading.value = true
const data = await CustomeritemApi.exportCustomeritem(queryParams)
download.excel(data, '客户物品.xls')
const data = await CustomeritemApi.exportCustomeritem(setSearchParams)
download.excel(data, '客户物品 .xls')
} catch {
} finally {
exportLoading.value = false
}
}
/** 导入 */
const importFormRef = ref()
const handleImport = () => {
importFormRef.value.open()
}
//
const importTemplateData = reactive({
templateUrl: '',
templateTitle: '客户物品导入模版.xls'
})
//
const importSuccess = () => {
getList()
}
/** 初始化 **/
onMounted(() => {
getList()

414
src/views/wms/dock/index.vue

@ -1,324 +1,138 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<el-form
class="-mb-15px"
:model="queryParams"
ref="queryFormRef"
:inline="true"
label-width="68px"
>
<el-form-item label="代码" prop="code">
<el-input
v-model="queryParams.code"
placeholder="请输入代码"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="名称" prop="name">
<el-input
v-model="queryParams.name"
placeholder="请输入名称"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="城市" prop="city">
<el-input
v-model="queryParams.city"
placeholder="请输入城市"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="地址" prop="address">
<el-input
v-model="queryParams.address"
placeholder="请输入地址"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="类型" prop="type">
<el-select v-model="queryParams.type" placeholder="请选择类型" clearable class="!w-240px">
<el-option
v-for="dict in getStrDictOptions(DICT_TYPE.DOCK_TYPE)"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item label="仓库代码" prop="warehouseCode">
<el-input
v-model="queryParams.warehouseCode"
placeholder="请输入仓库代码"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="默认库位代码" prop="defaultLocationCode">
<el-input
v-model="queryParams.defaultLocationCode"
placeholder="请输入默认库位代码"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="联系人姓名" prop="contactPerson">
<el-input
v-model="queryParams.contactPerson"
placeholder="请输入联系人姓名"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="联系人电话" prop="contactPhone">
<el-input
v-model="queryParams.contactPhone"
placeholder="请输入联系人电话"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="是否可用" prop="available">
<el-select
v-model="queryParams.available"
placeholder="请选择是否可用"
clearable
class="!w-240px"
>
<el-option
v-for="dict in getIntDictOptions(DICT_TYPE.TRUE_FALSE)"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item label="生效时间" prop="activeTime">
<el-date-picker
v-model="queryParams.activeTime"
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-240px"
/>
</el-form-item>
<el-form-item label="失效时间" prop="expireTime">
<el-date-picker
v-model="queryParams.expireTime"
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-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-240px"
/>
</el-form-item>
<el-form-item label="创建者ID" prop="creator">
<el-input
v-model="queryParams.creator"
placeholder="请输入创建者ID"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item>
<el-button type="info" plain @click="handleQuery"><Icon icon="ep:search" class="mr-5px" /> 搜索</el-button>
<el-button type="info" plain @click="resetQuery"><Icon icon="ep:refresh" class="mr-5px" /> 重置</el-button>
<el-button type="primary" @click="openForm('create')" v-hasPermi="['wms:dock:create']">
<Icon icon="ep:plus" class="mr-5px" /> 新增
</el-button>
<el-button
type="success"
@click="handleExport"
:loading="exportLoading"
v-hasPermi="['wms:dock:export']"
>
<Icon icon="ep:download" class="mr-5px" /> 导出
</el-button>
</el-form-item>
</el-form>
<Search :schema="Dock.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
</ContentWrap>
<!-- 列表头部 -->
<TableHead :HeadButttondata="HeadButttondata" @button-base-click="buttonBaseClick" />
<!-- 列表 -->
<ContentWrap>
<el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true">
<el-table-column label="代码" align="center" prop="code" width="150px" />
<el-table-column label="名称" align="center" prop="name" width="150px" />
<el-table-column label="描述" align="center" prop="description" width="150px" />
<el-table-column label="城市" align="center" prop="city" width="150px" />
<el-table-column label="地址" align="center" prop="address" width="150px" />
<el-table-column label="类型" align="center" prop="type" width="150px">
<template #default="scope">
<dict-tag :type="DICT_TYPE.DOCK_TYPE" :value="scope.row.type" />
</template>
</el-table-column>
<el-table-column label="仓库代码" align="center" prop="warehouseCode" width="150px" />
<el-table-column label="默认库位代码" align="center" prop="defaultLocationCode" width="150px" />
<el-table-column label="联系人姓名" align="center" prop="contactPerson" width="150px" />
<el-table-column label="联系人电话" align="center" prop="contactPhone" width="150px" />
<el-table-column label="是否可用" align="center" prop="available" width="150px">
<template #default="scope">
<dict-tag :type="DICT_TYPE.TRUE_FALSE" :value="scope.row.available" />
</template>
</el-table-column>
<el-table-column
label="生效时间"
align="center"
prop="activeTime"
:formatter="dateFormatter"
width="150px"
/>
<el-table-column
label="失效时间"
align="center"
prop="expireTime"
:formatter="dateFormatter"
width="150px"
/>
<el-table-column label="备注" align="center" prop="remark" width="150px" />
<el-table-column
label="创建时间"
align="center"
prop="createTime"
:formatter="dateFormatter"
width="150px"
/>
<el-table-column label="创建者ID" align="center" prop="creator" width="150px" />
<el-table-column label="操作" align="center" width="150px" fixed="right">
<template #default="scope">
<el-button
link
type="primary"
@click="openForm('update', scope.row.id)"
v-hasPermi="['wms:dock:update']"
>
编辑
</el-button>
<el-button
link
type="danger"
@click="handleDelete(scope.row.id)"
v-hasPermi="['wms:dock:delete']"
>
删除
</el-button>
</template>
</el-table-column>
</el-table>
<!-- 分页 -->
<Pagination
:total="total"
v-model:page="queryParams.pageNo"
v-model:limit="queryParams.pageSize"
@pagination="getList"
/>
<Table
:columns="Dock.allSchemas.tableColumns"
:data="tableObject.tableList"
:loading="tableObject.loading"
:pagination="{
total: tableObject.total
}"
v-model:pageSize="tableObject.pageSize"
v-model:currentPage="tableObject.currentPage"
v-model:sort="tableObject.sort"
>
<template #code="{row}">
<el-button type="primary" link @click="openDetail(row, '代码', row.code)">
<span>{{ row.code }}</span>
</el-button>
</template>
<template #action="{ row }">
<ButtonBase :Butttondata="butttondata" @button-base-click="buttonTableClick($event,row)" />
</template>
</Table>
</ContentWrap>
<!-- 表单弹窗添加/修改 -->
<DockForm ref="formRef" @success="getList" />
<BasicForm
ref="basicFormRef"
@success="getList"
:rules="DockRules"
:formAllSchemas="Dock.allSchemas"
searchTableTitle="物料基础信息"
:searchTableAllSchemas="ItemBasic.allSchemas"
:searchTablePage="ItembasicApi.getItembasicPage"
:apiUpdate="DockApi.updateDock"
:apiCreate="DockApi.createDock"
/>
<!-- 详情 -->
<Detail ref="detailRef" :isBasic="true" :allSchemas="Dock.allSchemas" />
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/wms/dock/import" :importTemplateData="importTemplateData" @success="importSuccess" />
</template>
<script setup lang="ts">
import { DICT_TYPE, getStrDictOptions, getIntDictOptions } from '@/utils/dict'
import { dateFormatter } from '@/utils/formatTime'
import download from '@/utils/download'
import * as DockApi from '@/api/wms/dock'
import DockForm from './DockForm.vue'
import * as ItembasicApi from '@/api/wms/itembasic'
import BasicForm from '@/components/BasicForm/src/BasicForm.vue'
import { Dock, DockRules, ItemBasic } from '@/utils/disposition/tableColumns'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import TableHead from '@/components/TableHead/src/TableHead.vue'
import ImportForm from '@/components/ImportForm/src/ImportForm.vue'
import Detail from '@/components/Detail/src/Detail.vue'
defineOptions({ name: 'Dock' })
const message = useMessage() //
const { t } = useI18n() //
const loading = ref(true) //
const total = ref(0) //
const list = ref([]) //
const queryParams = reactive({
pageNo: 1,
pageSize: 10,
code: null,
name: null,
description: null,
city: null,
address: null,
type: null,
warehouseCode: null,
defaultLocationCode: null,
contactPerson: null,
contactPhone: null,
available: null,
activeTime: [],
expireTime: [],
remark: null,
createTime: [],
creator: null
const { tableObject, tableMethods } = useTable({
getListApi: DockApi.getDockPage //
})
const queryFormRef = ref() //
const exportLoading = ref(false) //
/** 查询列表 */
const getList = async () => {
loading.value = true
try {
const data = await DockApi.getDockPage(queryParams)
list.value = data.list
total.value = data.total
} finally {
loading.value = false
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultAddBtn({hasPermi:'wms:dock:create'}), //
defaultButtons.defaultImportBtn({hasPermi:'wms:dock:import'}), //
defaultButtons.defaultExportBtn({hasPermi:'wms:dock:export'}), //
// defaultButtons.defaultFilterBtn(), //
defaultButtons.defaultFreshBtn(null), //
// {
// label: '',
// name: 'zdy',
// hide: false,
// type: 'primary',
// icon: 'Select',
// color: ''
// },
]
//
const buttonBaseClick = (val, item) => {
if (val == 'add') { //
openForm('create')
} else if (val == 'import') { //
handleImport()
} else if (val == 'export') { //
handleExport()
} else if (val == 'refresh') { //
getList()
} else if (val == 'filtrate') { //
} else { //
console.log('其他按钮', item)
}
}
/** 搜索按钮操作 */
const handleQuery = () => {
queryParams.pageNo = 1
getList()
}
// -
const butttondata = [
defaultButtons.mainListEditBtn({hasPermi:'wms:dock:update'}), //
defaultButtons.mainListDeleteBtn({hasPermi:'wms:dock:delete'}), //
]
/** 重置按钮操作 */
const resetQuery = () => {
queryFormRef.value.resetFields()
handleQuery()
// -
const buttonTableClick = async (val, row) => {
if (val == 'edit') { //
// const res = await DockApi.getItempackaging(row.id)
openForm('update', row)
} else if (val == 'delete') { //
handleDelete(row.id)
}
}
/** 添加/修改操作 */
const formRef = ref()
const openForm = (type: string, id?: number) => {
formRef.value.open(type, id)
const basicFormRef = ref()
const openForm = (type: string, row?: any) => {
basicFormRef.value.open(type, row)
}
/** 详情操作 */
const detailRef = ref()
const openDetail = (row: any, titleName: any, titleValue: any) => {
detailRef.value.openDetail(row, titleName, titleValue)
}
/** 删除按钮操作 */
@ -335,13 +149,14 @@ const handleDelete = async (id: number) => {
}
/** 导出按钮操作 */
const exportLoading = ref(false) //
const handleExport = async () => {
try {
//
await message.exportConfirm()
//
exportLoading.value = true
const data = await DockApi.exportDock(queryParams)
const data = await DockApi.exportDock(setSearchParams)
download.excel(data, '月台.xls')
} catch {
} finally {
@ -349,6 +164,21 @@ const handleExport = async () => {
}
}
/** 导入 */
const importFormRef = ref()
const handleImport = () => {
importFormRef.value.open()
}
//
const importTemplateData = reactive({
templateUrl: '',
templateTitle: '月台导入模版.xls'
})
//
const importSuccess = () => {
getList()
}
/** 初始化 **/
onMounted(() => {
getList()

358
src/views/wms/locationgroup/index.vue

@ -1,268 +1,138 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<el-form
class="-mb-15px"
:model="queryParams"
ref="queryFormRef"
:inline="true"
label-width="68px"
>
<el-form-item label="代码" prop="code">
<el-input
v-model="queryParams.code"
placeholder="请输入代码"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="名称" prop="name">
<el-input
v-model="queryParams.name"
placeholder="请输入名称"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="仓库代码" prop="warehouseCode">
<el-input
v-model="queryParams.warehouseCode"
placeholder="请输入仓库代码"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="区域代码" prop="areaCode">
<el-input
v-model="queryParams.areaCode"
placeholder="请输入区域代码"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="是否可用" prop="available">
<el-select
v-model="queryParams.available"
placeholder="请选择是否可用"
clearable
class="!w-240px"
>
<el-option
v-for="dict in getIntDictOptions(DICT_TYPE.TRUE_FALSE)"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item label="生效时间" prop="activeTime">
<el-date-picker
v-model="queryParams.activeTime"
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-240px"
/>
</el-form-item>
<el-form-item label="失效时间" prop="expireTime">
<el-date-picker
v-model="queryParams.expireTime"
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-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-240px"
/>
</el-form-item>
<el-form-item label="创建者ID" prop="creator">
<el-input
v-model="queryParams.creator"
placeholder="请输入创建者ID"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item>
<el-button type="info" plain @click="handleQuery"><Icon icon="ep:search" class="mr-5px" /> 搜索</el-button>
<el-button type="info" plain @click="resetQuery"><Icon icon="ep:refresh" class="mr-5px" /> 重置</el-button>
<el-button
type="primary"
@click="openForm('create')"
v-hasPermi="['wms:locationgroup:create']"
>
<Icon icon="ep:plus" class="mr-5px" /> 新增
</el-button>
<el-button
type="success"
@click="handleExport"
:loading="exportLoading"
v-hasPermi="['wms:locationgroup:export']"
>
<Icon icon="ep:download" class="mr-5px" /> 导出
</el-button>
</el-form-item>
</el-form>
<Search :schema="Locationgroup.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
</ContentWrap>
<!-- 列表头部 -->
<TableHead :HeadButttondata="HeadButttondata" @button-base-click="buttonBaseClick" />
<!-- 列表 -->
<ContentWrap>
<el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true">
<el-table-column label="代码" align="center" prop="code" width="150px" />
<el-table-column label="名称" align="center" prop="name" width="150px" />
<el-table-column label="描述" align="center" prop="description" width="150px" />
<el-table-column label="仓库代码" align="center" prop="warehouseCode" width="150px" />
<el-table-column label="区域代码" align="center" prop="areaCode" width="150px" />
<el-table-column label="是否可用" align="center" prop="available" width="150px">
<template #default="scope">
<dict-tag :type="DICT_TYPE.TRUE_FALSE" :value="scope.row.available" />
</template>
</el-table-column>
<el-table-column
label="生效时间"
align="center"
prop="activeTime"
:formatter="dateFormatter"
width="150px"
/>
<el-table-column
label="失效时间"
align="center"
prop="expireTime"
:formatter="dateFormatter"
width="150px"
/>
<el-table-column label="备注" align="center" prop="remark" width="150px" />
<el-table-column
label="创建时间"
align="center"
prop="createTime"
:formatter="dateFormatter"
width="150px"
/>
<el-table-column label="创建者ID" align="center" prop="creator" width="150px" />
<el-table-column label="操作" align="center" width="150px" fixed="right">
<template #default="scope">
<el-button
link
type="primary"
@click="openForm('update', scope.row.id)"
v-hasPermi="['wms:locationgroup:update']"
>
编辑
</el-button>
<el-button
link
type="danger"
@click="handleDelete(scope.row.id)"
v-hasPermi="['wms:locationgroup:delete']"
>
删除
</el-button>
</template>
</el-table-column>
</el-table>
<!-- 分页 -->
<Pagination
:total="total"
v-model:page="queryParams.pageNo"
v-model:limit="queryParams.pageSize"
@pagination="getList"
/>
<Table
:columns="Locationgroup.allSchemas.tableColumns"
:data="tableObject.tableList"
:loading="tableObject.loading"
:pagination="{
total: tableObject.total
}"
v-model:pageSize="tableObject.pageSize"
v-model:currentPage="tableObject.currentPage"
v-model:sort="tableObject.sort"
>
<template #code="{row}">
<el-button type="primary" link @click="openDetail(row, '代码', row.code)">
<span>{{ row.code }}</span>
</el-button>
</template>
<template #action="{ row }">
<ButtonBase :Butttondata="butttondata" @button-base-click="buttonTableClick($event,row)" />
</template>
</Table>
</ContentWrap>
<!-- 表单弹窗添加/修改 -->
<LocationgroupForm ref="formRef" @success="getList" />
<BasicForm
ref="basicFormRef"
@success="getList"
:rules="LocationgroupRules"
:formAllSchemas="Locationgroup.allSchemas"
searchTableTitle="物料基础信息"
:searchTableAllSchemas="ItemBasic.allSchemas"
:searchTablePage="ItembasicApi.getItembasicPage"
:apiUpdate="LocationgroupApi.updateLocationgroup"
:apiCreate="LocationgroupApi.createLocationgroup"
/>
<!-- 详情 -->
<Detail ref="detailRef" :isBasic="true" :allSchemas="Locationgroup.allSchemas" />
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/wms/locationgroup/import" :importTemplateData="importTemplateData" @success="importSuccess" />
</template>
<script setup lang="ts">
import { DICT_TYPE, getIntDictOptions } from '@/utils/dict'
import { dateFormatter } from '@/utils/formatTime'
import download from '@/utils/download'
import * as LocationgroupApi from '@/api/wms/locationgroup'
import LocationgroupForm from './LocationgroupForm.vue'
import * as ItembasicApi from '@/api/wms/itembasic'
import BasicForm from '@/components/BasicForm/src/BasicForm.vue'
import { Locationgroup, LocationgroupRules, ItemBasic } from '@/utils/disposition/tableColumns'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import TableHead from '@/components/TableHead/src/TableHead.vue'
import ImportForm from '@/components/ImportForm/src/ImportForm.vue'
import Detail from '@/components/Detail/src/Detail.vue'
defineOptions({ name: 'Locationgroup' })
const message = useMessage() //
const { t } = useI18n() //
const loading = ref(true) //
const total = ref(0) //
const list = ref([]) //
const queryParams = reactive({
pageNo: 1,
pageSize: 10,
code: null,
name: null,
description: null,
warehouseCode: null,
areaCode: null,
available: null,
activeTime: [],
expireTime: [],
remark: null,
createTime: [],
creator: null
const { tableObject, tableMethods } = useTable({
getListApi: LocationgroupApi.getLocationgroupPage //
})
const queryFormRef = ref() //
const exportLoading = ref(false) //
/** 查询列表 */
const getList = async () => {
loading.value = true
try {
const data = await LocationgroupApi.getLocationgroupPage(queryParams)
list.value = data.list
total.value = data.total
} finally {
loading.value = false
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultAddBtn({hasPermi:'wms:locationgroup:create'}), //
defaultButtons.defaultImportBtn({hasPermi:'wms:locationgroup:import'}), //
defaultButtons.defaultExportBtn({hasPermi:'wms:locationgroup:export'}), //
// defaultButtons.defaultFilterBtn(), //
defaultButtons.defaultFreshBtn(null), //
// {
// label: '',
// name: 'zdy',
// hide: false,
// type: 'primary',
// icon: 'Select',
// color: ''
// },
]
//
const buttonBaseClick = (val, item) => {
if (val == 'add') { //
openForm('create')
} else if (val == 'import') { //
handleImport()
} else if (val == 'export') { //
handleExport()
} else if (val == 'refresh') { //
getList()
} else if (val == 'filtrate') { //
} else { //
console.log('其他按钮', item)
}
}
/** 搜索按钮操作 */
const handleQuery = () => {
queryParams.pageNo = 1
getList()
}
// -
const butttondata = [
defaultButtons.mainListEditBtn({hasPermi:'wms:locationgroup:update'}), //
defaultButtons.mainListDeleteBtn({hasPermi:'wms:locationgroup:delete'}), //
]
/** 重置按钮操作 */
const resetQuery = () => {
queryFormRef.value.resetFields()
handleQuery()
// -
const buttonTableClick = async (val, row) => {
if (val == 'edit') { //
// const res = await LocationgroupApi.getItempackaging(row.id)
openForm('update', row)
} else if (val == 'delete') { //
handleDelete(row.id)
}
}
/** 添加/修改操作 */
const formRef = ref()
const openForm = (type: string, id?: number) => {
formRef.value.open(type, id)
const basicFormRef = ref()
const openForm = (type: string, row?: any) => {
basicFormRef.value.open(type, row)
}
/** 详情操作 */
const detailRef = ref()
const openDetail = (row: any, titleName: any, titleValue: any) => {
detailRef.value.openDetail(row, titleName, titleValue)
}
/** 删除按钮操作 */
@ -279,13 +149,14 @@ const handleDelete = async (id: number) => {
}
/** 导出按钮操作 */
const exportLoading = ref(false) //
const handleExport = async () => {
try {
//
await message.exportConfirm()
//
exportLoading.value = true
const data = await LocationgroupApi.exportLocationgroup(queryParams)
const data = await LocationgroupApi.exportLocationgroup(setSearchParams)
download.excel(data, '库位组.xls')
} catch {
} finally {
@ -293,6 +164,21 @@ const handleExport = async () => {
}
}
/** 导入 */
const importFormRef = ref()
const handleImport = () => {
importFormRef.value.open()
}
//
const importTemplateData = reactive({
templateUrl: '',
templateTitle: '库位组导入模版.xls'
})
//
const importSuccess = () => {
getList()
}
/** 初始化 **/
onMounted(() => {
getList()

370
src/views/wms/process/index.vue

@ -1,280 +1,138 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<el-form
class="-mb-15px"
:model="queryParams"
ref="queryFormRef"
:inline="true"
label-width="68px"
>
<el-form-item label="代码" prop="code">
<el-input
v-model="queryParams.code"
placeholder="请输入代码"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="名称" prop="name">
<el-input
v-model="queryParams.name"
placeholder="请输入名称"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="类型" prop="type">
<el-select v-model="queryParams.type" placeholder="请选择类型" clearable class="!w-240px">
<el-option
v-for="dict in getStrDictOptions(DICT_TYPE.PROCESS_TYPE)"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item label="车间代码" prop="workshopCode">
<el-input
v-model="queryParams.workshopCode"
placeholder="请输入车间代码"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="生产线代码" prop="productionLineCode">
<el-input
v-model="queryParams.productionLineCode"
placeholder="请输入生产线代码"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="是否可用" prop="available">
<el-select
v-model="queryParams.available"
placeholder="请选择是否可用"
clearable
class="!w-240px"
>
<el-option
v-for="dict in getIntDictOptions(DICT_TYPE.TRUE_FALSE)"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item label="生效时间" prop="activeTime">
<el-date-picker
v-model="queryParams.activeTime"
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-240px"
/>
</el-form-item>
<el-form-item label="失效时间" prop="expireTime">
<el-date-picker
v-model="queryParams.expireTime"
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-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-240px"
/>
</el-form-item>
<el-form-item label="创建者ID" prop="creator">
<el-input
v-model="queryParams.creator"
placeholder="请输入创建者ID"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item>
<el-button type="info" plain @click="handleQuery"><Icon icon="ep:search" class="mr-5px" /> 搜索</el-button>
<el-button type="info" plain @click="resetQuery"><Icon icon="ep:refresh" class="mr-5px" /> 重置</el-button>
<el-button type="primary" @click="openForm('create')" v-hasPermi="['wms:process:create']">
<Icon icon="ep:plus" class="mr-5px" /> 新增
</el-button>
<el-button
type="success"
@click="handleExport"
:loading="exportLoading"
v-hasPermi="['wms:process:export']"
>
<Icon icon="ep:download" class="mr-5px" /> 导出
</el-button>
</el-form-item>
</el-form>
<Search :schema="Process.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
</ContentWrap>
<!-- 列表头部 -->
<TableHead :HeadButttondata="HeadButttondata" @button-base-click="buttonBaseClick" />
<!-- 列表 -->
<ContentWrap>
<el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true">
<el-table-column label="代码" align="center" prop="code" width="150px" />
<el-table-column label="名称" align="center" prop="name" width="150px" />
<el-table-column label="描述" align="center" prop="description" width="150px" />
<el-table-column label="类型" align="center" prop="type" width="150px">
<template #default="scope">
<dict-tag :type="DICT_TYPE.PROCESS_TYPE" :value="scope.row.type" />
</template>
</el-table-column>
<el-table-column label="车间代码" align="center" prop="workshopCode" width="150px" />
<el-table-column label="生产线代码" align="center" prop="productionLineCode" width="150px" />
<el-table-column label="是否可用" align="center" prop="available" width="150px">
<template #default="scope">
<dict-tag :type="DICT_TYPE.TRUE_FALSE" :value="scope.row.available" />
</template>
</el-table-column>
<el-table-column
label="生效时间"
align="center"
prop="activeTime"
:formatter="dateFormatter"
width="150px"
/>
<el-table-column
label="失效时间"
align="center"
prop="expireTime"
:formatter="dateFormatter"
width="150px"
/>
<el-table-column label="备注" align="center" prop="remark" width="150px" />
<el-table-column
label="创建时间"
align="center"
prop="createTime"
:formatter="dateFormatter"
width="150px"
/>
<el-table-column label="创建者ID" align="center" prop="creator" width="150px" />
<el-table-column label="操作" align="center" width="150px" fixed="right">
<template #default="scope">
<el-button
link
type="primary"
@click="openForm('update', scope.row.id)"
v-hasPermi="['wms:process:update']"
>
编辑
</el-button>
<el-button
link
type="danger"
@click="handleDelete(scope.row.id)"
v-hasPermi="['wms:process:delete']"
>
删除
</el-button>
</template>
</el-table-column>
</el-table>
<!-- 分页 -->
<Pagination
:total="total"
v-model:page="queryParams.pageNo"
v-model:limit="queryParams.pageSize"
@pagination="getList"
/>
<Table
:columns="Process.allSchemas.tableColumns"
:data="tableObject.tableList"
:loading="tableObject.loading"
:pagination="{
total: tableObject.total
}"
v-model:pageSize="tableObject.pageSize"
v-model:currentPage="tableObject.currentPage"
v-model:sort="tableObject.sort"
>
<template #code="{row}">
<el-button type="primary" link @click="openDetail(row, '代码', row.code)">
<span>{{ row.code }}</span>
</el-button>
</template>
<template #action="{ row }">
<ButtonBase :Butttondata="butttondata" @button-base-click="buttonTableClick($event,row)" />
</template>
</Table>
</ContentWrap>
<!-- 表单弹窗添加/修改 -->
<ProcessForm ref="formRef" @success="getList" />
<BasicForm
ref="basicFormRef"
@success="getList"
:rules="ProcessRules"
:formAllSchemas="Process.allSchemas"
searchTableTitle="物料基础信息"
:searchTableAllSchemas="ItemBasic.allSchemas"
:searchTablePage="ItembasicApi.getItembasicPage"
:apiUpdate="ProcessApi.updateProcess"
:apiCreate="ProcessApi.createProcess"
/>
<!-- 详情 -->
<Detail ref="detailRef" :isBasic="true" :allSchemas="Process.allSchemas" />
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/wms/process/import" :importTemplateData="importTemplateData" @success="importSuccess" />
</template>
<script setup lang="ts">
import { DICT_TYPE, getStrDictOptions, getIntDictOptions } from '@/utils/dict'
import { dateFormatter } from '@/utils/formatTime'
import download from '@/utils/download'
import * as ProcessApi from '@/api/wms/process'
import ProcessForm from './ProcessForm.vue'
import * as ItembasicApi from '@/api/wms/itembasic'
import BasicForm from '@/components/BasicForm/src/BasicForm.vue'
import { Process, ProcessRules, ItemBasic } from '@/utils/disposition/tableColumns'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import TableHead from '@/components/TableHead/src/TableHead.vue'
import ImportForm from '@/components/ImportForm/src/ImportForm.vue'
import Detail from '@/components/Detail/src/Detail.vue'
defineOptions({ name: 'Process' })
const message = useMessage() //
const { t } = useI18n() //
const loading = ref(true) //
const total = ref(0) //
const list = ref([]) //
const queryParams = reactive({
pageNo: 1,
pageSize: 10,
code: null,
name: null,
description: null,
type: null,
workshopCode: null,
productionLineCode: null,
available: null,
activeTime: [],
expireTime: [],
remark: null,
createTime: [],
creator: null
const { tableObject, tableMethods } = useTable({
getListApi: ProcessApi.getProcessPage //
})
const queryFormRef = ref() //
const exportLoading = ref(false) //
/** 查询列表 */
const getList = async () => {
loading.value = true
try {
const data = await ProcessApi.getProcessPage(queryParams)
list.value = data.list
total.value = data.total
} finally {
loading.value = false
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultAddBtn({hasPermi:'wms:process:create'}), //
defaultButtons.defaultImportBtn({hasPermi:'wms:process:import'}), //
defaultButtons.defaultExportBtn({hasPermi:'wms:process:export'}), //
// defaultButtons.defaultFilterBtn(), //
defaultButtons.defaultFreshBtn(null), //
// {
// label: '',
// name: 'zdy',
// hide: false,
// type: 'primary',
// icon: 'Select',
// color: ''
// },
]
//
const buttonBaseClick = (val, item) => {
if (val == 'add') { //
openForm('create')
} else if (val == 'import') { //
handleImport()
} else if (val == 'export') { //
handleExport()
} else if (val == 'refresh') { //
getList()
} else if (val == 'filtrate') { //
} else { //
console.log('其他按钮', item)
}
}
/** 搜索按钮操作 */
const handleQuery = () => {
queryParams.pageNo = 1
getList()
}
// -
const butttondata = [
defaultButtons.mainListEditBtn({hasPermi:'wms:process:update'}), //
defaultButtons.mainListDeleteBtn({hasPermi:'wms:process:delete'}), //
]
/** 重置按钮操作 */
const resetQuery = () => {
queryFormRef.value.resetFields()
handleQuery()
// -
const buttonTableClick = async (val, row) => {
if (val == 'edit') { //
// const res = await ProcessApi.getItempackaging(row.id)
openForm('update', row)
} else if (val == 'delete') { //
handleDelete(row.id)
}
}
/** 添加/修改操作 */
const formRef = ref()
const openForm = (type: string, id?: number) => {
formRef.value.open(type, id)
const basicFormRef = ref()
const openForm = (type: string, row?: any) => {
basicFormRef.value.open(type, row)
}
/** 详情操作 */
const detailRef = ref()
const openDetail = (row: any, titleName: any, titleValue: any) => {
detailRef.value.openDetail(row, titleName, titleValue)
}
/** 删除按钮操作 */
@ -291,13 +149,14 @@ const handleDelete = async (id: number) => {
}
/** 导出按钮操作 */
const exportLoading = ref(false) //
const handleExport = async () => {
try {
//
await message.exportConfirm()
//
exportLoading.value = true
const data = await ProcessApi.exportProcess(queryParams)
const data = await ProcessApi.exportProcess(setSearchParams)
download.excel(data, '工序.xls')
} catch {
} finally {
@ -305,6 +164,21 @@ const handleExport = async () => {
}
}
/** 导入 */
const importFormRef = ref()
const handleImport = () => {
importFormRef.value.open()
}
//
const importTemplateData = reactive({
templateUrl: '',
templateTitle: '工序导入模版.xls'
})
//
const importSuccess = () => {
getList()
}
/** 初始化 **/
onMounted(() => {
getList()

385
src/views/wms/productionline/index.vue

@ -1,295 +1,138 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<el-form
class="-mb-15px"
:model="queryParams"
ref="queryFormRef"
:inline="true"
label-width="68px"
>
<el-form-item label="代码" prop="code">
<el-input
v-model="queryParams.code"
placeholder="请输入代码"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="名称" prop="name">
<el-input
v-model="queryParams.name"
placeholder="请输入名称"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="类型" prop="type">
<el-select v-model="queryParams.type" placeholder="请选择类型" clearable class="!w-240px">
<el-option
v-for="dict in getStrDictOptions(DICT_TYPE.PRODUCTION_LINE_TYPE)"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item label="车间代码" prop="workshopCode">
<el-input
v-model="queryParams.workshopCode"
placeholder="请输入车间代码"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="原料库位" prop="rawLocationCode">
<el-input
v-model="queryParams.rawLocationCode"
placeholder="请输入原料库位"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="成品库位" prop="fgLocationCode">
<el-input
v-model="queryParams.fgLocationCode"
placeholder="请输入成品库位"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="是否可用" prop="available">
<el-select
v-model="queryParams.available"
placeholder="请选择是否可用"
clearable
class="!w-240px"
>
<el-option
v-for="dict in getIntDictOptions(DICT_TYPE.TRUE_FALSE)"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item label="生效时间" prop="activeTime">
<el-date-picker
v-model="queryParams.activeTime"
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-240px"
/>
</el-form-item>
<el-form-item label="失效时间" prop="expireTime">
<el-date-picker
v-model="queryParams.expireTime"
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-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-240px"
/>
</el-form-item>
<el-form-item label="创建者ID" prop="creator">
<el-input
v-model="queryParams.creator"
placeholder="请输入创建者ID"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item>
<el-button type="info" plain @click="handleQuery"><Icon icon="ep:search" class="mr-5px" /> 搜索</el-button>
<el-button type="info" plain @click="resetQuery"><Icon icon="ep:refresh" class="mr-5px" /> 重置</el-button>
<el-button
type="primary"
@click="openForm('create')"
v-hasPermi="['wms:productionline:create']"
>
<Icon icon="ep:plus" class="mr-5px" /> 新增
</el-button>
<el-button
type="success"
@click="handleExport"
:loading="exportLoading"
v-hasPermi="['wms:productionline:export']"
>
<Icon icon="ep:download" class="mr-5px" /> 导出
</el-button>
</el-form-item>
</el-form>
<Search :schema="Productionline.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
</ContentWrap>
<!-- 列表头部 -->
<TableHead :HeadButttondata="HeadButttondata" @button-base-click="buttonBaseClick" />
<!-- 列表 -->
<ContentWrap>
<el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true">
<el-table-column label="代码" align="center" prop="code" width="150px" />
<el-table-column label="名称" align="center" prop="name" width="150px" />
<el-table-column label="描述" align="center" prop="description" width="150px" />
<el-table-column label="类型" align="center" prop="type" width="150px">
<template #default="scope">
<dict-tag :type="DICT_TYPE.PRODUCTION_LINE_TYPE" :value="scope.row.type" />
</template>
</el-table-column>
<el-table-column label="车间代码" align="center" prop="workshopCode" width="150px" />
<el-table-column label="原料库位" align="center" prop="rawLocationCode" width="150px" />
<el-table-column label="成品库位" align="center" prop="fgLocationCode" width="150px" />
<el-table-column label="是否可用" align="center" prop="available" width="150px">
<template #default="scope">
<dict-tag :type="DICT_TYPE.TRUE_FALSE" :value="scope.row.available" />
</template>
</el-table-column>
<el-table-column
label="生效时间"
align="center"
prop="activeTime"
:formatter="dateFormatter"
width="150px"
/>
<el-table-column
label="失效时间"
align="center"
prop="expireTime"
:formatter="dateFormatter"
width="150px"
/>
<el-table-column label="备注" align="center" prop="remark" width="150px" />
<el-table-column
label="创建时间"
align="center"
prop="createTime"
:formatter="dateFormatter"
width="150px"
/>
<el-table-column label="创建者ID" align="center" prop="creator" width="150px" />
<el-table-column label="操作" align="center" width="150px" fixed="right">
<template #default="scope">
<el-button
link
type="primary"
@click="openForm('update', scope.row.id)"
v-hasPermi="['wms:productionline:update']"
>
编辑
</el-button>
<el-button
link
type="danger"
@click="handleDelete(scope.row.id)"
v-hasPermi="['wms:productionline:delete']"
>
删除
</el-button>
</template>
</el-table-column>
</el-table>
<!-- 分页 -->
<Pagination
:total="total"
v-model:page="queryParams.pageNo"
v-model:limit="queryParams.pageSize"
@pagination="getList"
/>
<Table
:columns="Productionline.allSchemas.tableColumns"
:data="tableObject.tableList"
:loading="tableObject.loading"
:pagination="{
total: tableObject.total
}"
v-model:pageSize="tableObject.pageSize"
v-model:currentPage="tableObject.currentPage"
v-model:sort="tableObject.sort"
>
<template #code="{row}">
<el-button type="primary" link @click="openDetail(row, '代码', row.code)">
<span>{{ row.code }}</span>
</el-button>
</template>
<template #action="{ row }">
<ButtonBase :Butttondata="butttondata" @button-base-click="buttonTableClick($event,row)" />
</template>
</Table>
</ContentWrap>
<!-- 表单弹窗添加/修改 -->
<ProductionlineForm ref="formRef" @success="getList" />
<BasicForm
ref="basicFormRef"
@success="getList"
:rules="ProductionlineRules"
:formAllSchemas="Productionline.allSchemas"
searchTableTitle="物料基础信息"
:searchTableAllSchemas="ItemBasic.allSchemas"
:searchTablePage="ItembasicApi.getItembasicPage"
:apiUpdate="ProductionlineApi.updateProductionline"
:apiCreate="ProductionlineApi.createProductionline"
/>
<!-- 详情 -->
<Detail ref="detailRef" :isBasic="true" :allSchemas="Productionline.allSchemas" />
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/wms/productionline/import" :importTemplateData="importTemplateData" @success="importSuccess" />
</template>
<script setup lang="ts">
import { DICT_TYPE, getStrDictOptions, getIntDictOptions } from '@/utils/dict'
import { dateFormatter } from '@/utils/formatTime'
import download from '@/utils/download'
import * as ProductionlineApi from '@/api/wms/productionline'
import ProductionlineForm from './ProductionlineForm.vue'
import * as ItembasicApi from '@/api/wms/itembasic'
import BasicForm from '@/components/BasicForm/src/BasicForm.vue'
import { Productionline, ProductionlineRules, ItemBasic } from '@/utils/disposition/tableColumns'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import TableHead from '@/components/TableHead/src/TableHead.vue'
import ImportForm from '@/components/ImportForm/src/ImportForm.vue'
import Detail from '@/components/Detail/src/Detail.vue'
defineOptions({ name: 'Productionline' })
const message = useMessage() //
const { t } = useI18n() //
const loading = ref(true) //
const total = ref(0) //
const list = ref([]) //
const queryParams = reactive({
pageNo: 1,
pageSize: 10,
code: null,
name: null,
description: null,
type: null,
workshopCode: null,
rawLocationCode: null,
fgLocationCode: null,
available: null,
activeTime: [],
expireTime: [],
remark: null,
createTime: [],
creator: null
const { tableObject, tableMethods } = useTable({
getListApi: ProductionlineApi.getProductionlinePage //
})
const queryFormRef = ref() //
const exportLoading = ref(false) //
/** 查询列表 */
const getList = async () => {
loading.value = true
try {
const data = await ProductionlineApi.getProductionlinePage(queryParams)
list.value = data.list
total.value = data.total
} finally {
loading.value = false
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultAddBtn({hasPermi:'wms:productionline:create'}), //
defaultButtons.defaultImportBtn({hasPermi:'wms:productionline:import'}), //
defaultButtons.defaultExportBtn({hasPermi:'wms:productionline:export'}), //
// defaultButtons.defaultFilterBtn(), //
defaultButtons.defaultFreshBtn(null), //
// {
// label: '',
// name: 'zdy',
// hide: false,
// type: 'primary',
// icon: 'Select',
// color: ''
// },
]
//
const buttonBaseClick = (val, item) => {
if (val == 'add') { //
openForm('create')
} else if (val == 'import') { //
handleImport()
} else if (val == 'export') { //
handleExport()
} else if (val == 'refresh') { //
getList()
} else if (val == 'filtrate') { //
} else { //
console.log('其他按钮', item)
}
}
/** 搜索按钮操作 */
const handleQuery = () => {
queryParams.pageNo = 1
getList()
}
// -
const butttondata = [
defaultButtons.mainListEditBtn({hasPermi:'wms:productionline:update'}), //
defaultButtons.mainListDeleteBtn({hasPermi:'wms:productionline:delete'}), //
]
/** 重置按钮操作 */
const resetQuery = () => {
queryFormRef.value.resetFields()
handleQuery()
// -
const buttonTableClick = async (val, row) => {
if (val == 'edit') { //
// const res = await ProductionlineApi.getItempackaging(row.id)
openForm('update', row)
} else if (val == 'delete') { //
handleDelete(row.id)
}
}
/** 添加/修改操作 */
const formRef = ref()
const openForm = (type: string, id?: number) => {
formRef.value.open(type, id)
const basicFormRef = ref()
const openForm = (type: string, row?: any) => {
basicFormRef.value.open(type, row)
}
/** 详情操作 */
const detailRef = ref()
const openDetail = (row: any, titleName: any, titleValue: any) => {
detailRef.value.openDetail(row, titleName, titleValue)
}
/** 删除按钮操作 */
@ -306,13 +149,14 @@ const handleDelete = async (id: number) => {
}
/** 导出按钮操作 */
const exportLoading = ref(false) //
const handleExport = async () => {
try {
//
await message.exportConfirm()
//
exportLoading.value = true
const data = await ProductionlineApi.exportProductionline(queryParams)
const data = await ProductionlineApi.exportProductionline(setSearchParams)
download.excel(data, '生产线.xls')
} catch {
} finally {
@ -320,6 +164,21 @@ const handleExport = async () => {
}
}
/** 导入 */
const importFormRef = ref()
const handleImport = () => {
importFormRef.value.open()
}
//
const importTemplateData = reactive({
templateUrl: '',
templateTitle: '生产线导入模版.xls'
})
//
const importSuccess = () => {
getList()
}
/** 初始化 **/
onMounted(() => {
getList()

345
src/views/wms/productionlineitem/index.vue

@ -1,255 +1,138 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<el-form
class="-mb-15px"
:model="queryParams"
ref="queryFormRef"
:inline="true"
label-width="68px"
>
<el-form-item label="完工收货库位" prop="fgLocationCode">
<el-input
v-model="queryParams.fgLocationCode"
placeholder="请输入完工收货库位"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="产线代码" prop="productionLineCode">
<el-input
v-model="queryParams.productionLineCode"
placeholder="请输入产线代码"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="物品代码" prop="itemCode">
<el-input
v-model="queryParams.itemCode"
placeholder="请输入物品代码"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="是否可用" prop="available">
<el-select
v-model="queryParams.available"
placeholder="请选择是否可用"
clearable
class="!w-240px"
>
<el-option
v-for="dict in getIntDictOptions(DICT_TYPE.TRUE_FALSE)"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item label="生效时间" prop="activeTime">
<el-date-picker
v-model="queryParams.activeTime"
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-240px"
/>
</el-form-item>
<el-form-item label="失效时间" prop="expireTime">
<el-date-picker
v-model="queryParams.expireTime"
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-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-240px"
/>
</el-form-item>
<el-form-item label="创建者ID" prop="creator">
<el-input
v-model="queryParams.creator"
placeholder="请输入创建者ID"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item>
<el-button type="info" plain @click="handleQuery"><Icon icon="ep:search" class="mr-5px" /> 搜索</el-button>
<el-button type="info" plain @click="resetQuery"><Icon icon="ep:refresh" class="mr-5px" /> 重置</el-button>
<el-button
type="primary"
@click="openForm('create')"
v-hasPermi="['wms:productionlineitem:create']"
>
<Icon icon="ep:plus" class="mr-5px" /> 新增
</el-button>
<el-button
type="success"
@click="handleExport"
:loading="exportLoading"
v-hasPermi="['wms:productionlineitem:export']"
>
<Icon icon="ep:download" class="mr-5px" /> 导出
</el-button>
</el-form-item>
</el-form>
<Search :schema="Productionlineitem.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
</ContentWrap>
<!-- 列表头部 -->
<TableHead :HeadButttondata="HeadButttondata" @button-base-click="buttonBaseClick" />
<!-- 列表 -->
<ContentWrap>
<el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true">
<el-table-column label="完工收货库位" align="center" prop="fgLocationCode" width="150px" />
<el-table-column label="产线代码" align="center" prop="productionLineCode" width="150px" />
<el-table-column label="物品代码" align="center" prop="itemCode" width="150px" />
<el-table-column label="是否可用" align="center" prop="available" width="150px">
<template #default="scope">
<dict-tag :type="DICT_TYPE.TRUE_FALSE" :value="scope.row.available" />
</template>
</el-table-column>
<el-table-column
label="生效时间"
align="center"
prop="activeTime"
:formatter="dateFormatter"
width="150px"
/>
<el-table-column
label="失效时间"
align="center"
prop="expireTime"
:formatter="dateFormatter"
width="150px"
/>
<el-table-column label="备注" align="center" prop="remark" width="150px" />
<el-table-column
label="创建时间"
align="center"
prop="createTime"
:formatter="dateFormatter"
width="150px"
/>
<el-table-column label="创建者ID" align="center" prop="creator" width="150px" />
<el-table-column label="操作" align="center" width="150px" fixed="right">
<template #default="scope">
<el-button
link
type="primary"
@click="openForm('update', scope.row.id)"
v-hasPermi="['wms:productionlineitem:update']"
>
编辑
</el-button>
<el-button
link
type="danger"
@click="handleDelete(scope.row.id)"
v-hasPermi="['wms:productionlineitem:delete']"
>
删除
</el-button>
</template>
</el-table-column>
</el-table>
<!-- 分页 -->
<Pagination
:total="total"
v-model:page="queryParams.pageNo"
v-model:limit="queryParams.pageSize"
@pagination="getList"
/>
<Table
:columns="Productionlineitem.allSchemas.tableColumns"
:data="tableObject.tableList"
:loading="tableObject.loading"
:pagination="{
total: tableObject.total
}"
v-model:pageSize="tableObject.pageSize"
v-model:currentPage="tableObject.currentPage"
v-model:sort="tableObject.sort"
>
<template #fgLocationCode="{row}">
<el-button type="primary" link @click="openDetail(row, '完工收货库位', row.fgLocationCode)">
<span>{{ row.fgLocationCode }}</span>
</el-button>
</template>
<template #action="{ row }">
<ButtonBase :Butttondata="butttondata" @button-base-click="buttonTableClick($event,row)" />
</template>
</Table>
</ContentWrap>
<!-- 表单弹窗添加/修改 -->
<ProductionlineitemForm ref="formRef" @success="getList" />
<BasicForm
ref="basicFormRef"
@success="getList"
:rules="ProductionlineitemRules"
:formAllSchemas="Productionlineitem.allSchemas"
searchTableTitle="物料基础信息"
:searchTableAllSchemas="ItemBasic.allSchemas"
:searchTablePage="ItembasicApi.getItembasicPage"
:apiUpdate="ProductionlineitemApi.updateProductionlineitem"
:apiCreate="ProductionlineitemApi.createProductionlineitem"
/>
<!-- 详情 -->
<Detail ref="detailRef" :isBasic="true" :allSchemas="Productionlineitem.allSchemas" />
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/wms/productionlineitem/import" :importTemplateData="importTemplateData" @success="importSuccess" />
</template>
<script setup lang="ts">
import { DICT_TYPE, getIntDictOptions } from '@/utils/dict'
import { dateFormatter } from '@/utils/formatTime'
import download from '@/utils/download'
import * as ProductionlineitemApi from '@/api/wms/productionlineitem'
import ProductionlineitemForm from './ProductionlineitemForm.vue'
import * as ItembasicApi from '@/api/wms/itembasic'
import BasicForm from '@/components/BasicForm/src/BasicForm.vue'
import { Productionlineitem, ProductionlineitemRules, ItemBasic } from '@/utils/disposition/tableColumns'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import TableHead from '@/components/TableHead/src/TableHead.vue'
import ImportForm from '@/components/ImportForm/src/ImportForm.vue'
import Detail from '@/components/Detail/src/Detail.vue'
defineOptions({ name: 'Productionlineitem' })
const message = useMessage() //
const { t } = useI18n() //
const loading = ref(true) //
const total = ref(0) //
const list = ref([]) //
const queryParams = reactive({
pageNo: 1,
pageSize: 10,
fgLocationCode: null,
productionLineCode: null,
itemCode: null,
available: null,
activeTime: [],
expireTime: [],
remark: null,
createTime: [],
creator: null
const { tableObject, tableMethods } = useTable({
getListApi: ProductionlineitemApi.getProductionlineitemPage //
})
const queryFormRef = ref() //
const exportLoading = ref(false) //
/** 查询列表 */
const getList = async () => {
loading.value = true
try {
const data = await ProductionlineitemApi.getProductionlineitemPage(queryParams)
list.value = data.list
total.value = data.total
} finally {
loading.value = false
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultAddBtn({hasPermi:'wms:productionlineitem:create'}), //
defaultButtons.defaultImportBtn({hasPermi:'wms:productionlineitem:import'}), //
defaultButtons.defaultExportBtn({hasPermi:'wms:productionlineitem:export'}), //
// defaultButtons.defaultFilterBtn(), //
defaultButtons.defaultFreshBtn(null), //
// {
// label: '',
// name: 'zdy',
// hide: false,
// type: 'primary',
// icon: 'Select',
// color: ''
// },
]
//
const buttonBaseClick = (val, item) => {
if (val == 'add') { //
openForm('create')
} else if (val == 'import') { //
handleImport()
} else if (val == 'export') { //
handleExport()
} else if (val == 'refresh') { //
getList()
} else if (val == 'filtrate') { //
} else { //
console.log('其他按钮', item)
}
}
/** 搜索按钮操作 */
const handleQuery = () => {
queryParams.pageNo = 1
getList()
}
// -
const butttondata = [
defaultButtons.mainListEditBtn({hasPermi:'wms:productionlineitem:update'}), //
defaultButtons.mainListDeleteBtn({hasPermi:'wms:productionlineitem:delete'}), //
]
/** 重置按钮操作 */
const resetQuery = () => {
queryFormRef.value.resetFields()
handleQuery()
// -
const buttonTableClick = async (val, row) => {
if (val == 'edit') { //
// const res = await ProductionlineitemApi.getItempackaging(row.id)
openForm('update', row)
} else if (val == 'delete') { //
handleDelete(row.id)
}
}
/** 添加/修改操作 */
const formRef = ref()
const openForm = (type: string, id?: number) => {
formRef.value.open(type, id)
const basicFormRef = ref()
const openForm = (type: string, row?: any) => {
basicFormRef.value.open(type, row)
}
/** 详情操作 */
const detailRef = ref()
const openDetail = (row: any, titleName: any, titleValue: any) => {
detailRef.value.openDetail(row, titleName, titleValue)
}
/** 删除按钮操作 */
@ -266,13 +149,14 @@ const handleDelete = async (id: number) => {
}
/** 导出按钮操作 */
const exportLoading = ref(false) //
const handleExport = async () => {
try {
//
await message.exportConfirm()
//
exportLoading.value = true
const data = await ProductionlineitemApi.exportProductionlineitem(queryParams)
const data = await ProductionlineitemApi.exportProductionlineitem(setSearchParams)
download.excel(data, '生产线物料关系.xls')
} catch {
} finally {
@ -280,6 +164,21 @@ const handleExport = async () => {
}
}
/** 导入 */
const importFormRef = ref()
const handleImport = () => {
importFormRef.value.open()
}
//
const importTemplateData = reactive({
templateUrl: '',
templateTitle: '生产线物料关系导入模版.xls'
})
//
const importSuccess = () => {
getList()
}
/** 初始化 **/
onMounted(() => {
getList()

343
src/views/wms/project/index.vue

@ -1,253 +1,138 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<el-form
class="-mb-15px"
:model="queryParams"
ref="queryFormRef"
:inline="true"
label-width="68px"
>
<el-form-item label="代码" prop="code">
<el-input
v-model="queryParams.code"
placeholder="请输入代码"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="名称" prop="name">
<el-input
v-model="queryParams.name"
placeholder="请输入名称"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="客户代码" prop="customerCode">
<el-input
v-model="queryParams.customerCode"
placeholder="请输入客户代码"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="是否可用" prop="available">
<el-select
v-model="queryParams.available"
placeholder="请选择是否可用"
clearable
class="!w-240px"
>
<el-option
v-for="dict in getIntDictOptions(DICT_TYPE.TRUE_FALSE)"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item label="生效时间" prop="activeTime">
<el-date-picker
v-model="queryParams.activeTime"
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-240px"
/>
</el-form-item>
<el-form-item label="失效时间" prop="expireTime">
<el-date-picker
v-model="queryParams.expireTime"
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-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-240px"
/>
</el-form-item>
<el-form-item label="创建者ID" prop="creator">
<el-input
v-model="queryParams.creator"
placeholder="请输入创建者ID"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item>
<el-button type="info" plain @click="handleQuery"><Icon icon="ep:search" class="mr-5px" /> 搜索</el-button>
<el-button type="info" plain @click="resetQuery"><Icon icon="ep:refresh" class="mr-5px" /> 重置</el-button>
<el-button type="primary" @click="openForm('create')" v-hasPermi="['wms:project:create']">
<Icon icon="ep:plus" class="mr-5px" /> 新增
</el-button>
<el-button
type="success"
@click="handleExport"
:loading="exportLoading"
v-hasPermi="['wms:project:export']"
>
<Icon icon="ep:download" class="mr-5px" /> 导出
</el-button>
</el-form-item>
</el-form>
<Search :schema="Project.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
</ContentWrap>
<!-- 列表头部 -->
<TableHead :HeadButttondata="HeadButttondata" @button-base-click="buttonBaseClick" />
<!-- 列表 -->
<ContentWrap>
<el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true">
<el-table-column label="代码" align="center" prop="code" width="150px" />
<el-table-column label="名称" align="center" prop="name" width="150px" />
<el-table-column label="描述" align="center" prop="description" width="150px" />
<el-table-column label="客户代码" align="center" prop="customerCode" width="150px" />
<el-table-column label="是否可用" align="center" prop="available" width="150px">
<template #default="scope">
<dict-tag :type="DICT_TYPE.TRUE_FALSE" :value="scope.row.available" />
</template>
</el-table-column>
<el-table-column
label="生效时间"
align="center"
prop="activeTime"
:formatter="dateFormatter"
width="150px"
/>
<el-table-column
label="失效时间"
align="center"
prop="expireTime"
:formatter="dateFormatter"
width="150px"
/>
<el-table-column label="备注" align="center" prop="remark" width="150px" />
<el-table-column
label="创建时间"
align="center"
prop="createTime"
:formatter="dateFormatter"
width="150px"
/>
<el-table-column label="创建者ID" align="center" prop="creator" width="150px" />
<el-table-column label="操作" align="center" width="150px" fixed="right">
<template #default="scope">
<el-button
link
type="primary"
@click="openForm('update', scope.row.id)"
v-hasPermi="['wms:project:update']"
>
编辑
</el-button>
<el-button
link
type="danger"
@click="handleDelete(scope.row.id)"
v-hasPermi="['wms:project:delete']"
>
删除
</el-button>
</template>
</el-table-column>
</el-table>
<!-- 分页 -->
<Pagination
:total="total"
v-model:page="queryParams.pageNo"
v-model:limit="queryParams.pageSize"
@pagination="getList"
/>
<Table
:columns="Project.allSchemas.tableColumns"
:data="tableObject.tableList"
:loading="tableObject.loading"
:pagination="{
total: tableObject.total
}"
v-model:pageSize="tableObject.pageSize"
v-model:currentPage="tableObject.currentPage"
v-model:sort="tableObject.sort"
>
<template #code="{row}">
<el-button type="primary" link @click="openDetail(row, '代码', row.code)">
<span>{{ row.code }}</span>
</el-button>
</template>
<template #action="{ row }">
<ButtonBase :Butttondata="butttondata" @button-base-click="buttonTableClick($event,row)" />
</template>
</Table>
</ContentWrap>
<!-- 表单弹窗添加/修改 -->
<ProjectForm ref="formRef" @success="getList" />
<BasicForm
ref="basicFormRef"
@success="getList"
:rules="ProjectRules"
:formAllSchemas="Project.allSchemas"
searchTableTitle="物料基础信息"
:searchTableAllSchemas="ItemBasic.allSchemas"
:searchTablePage="ItembasicApi.getItembasicPage"
:apiUpdate="ProjectApi.updateProject"
:apiCreate="ProjectApi.createProject"
/>
<!-- 详情 -->
<Detail ref="detailRef" :isBasic="true" :allSchemas="Project.allSchemas" />
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/wms/project/import" :importTemplateData="importTemplateData" @success="importSuccess" />
</template>
<script setup lang="ts">
import { DICT_TYPE, getIntDictOptions } from '@/utils/dict'
import { dateFormatter } from '@/utils/formatTime'
import download from '@/utils/download'
import * as ProjectApi from '@/api/wms/project'
import ProjectForm from './ProjectForm.vue'
import * as ItembasicApi from '@/api/wms/itembasic'
import BasicForm from '@/components/BasicForm/src/BasicForm.vue'
import { Project, ProjectRules, ItemBasic } from '@/utils/disposition/tableColumns'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import TableHead from '@/components/TableHead/src/TableHead.vue'
import ImportForm from '@/components/ImportForm/src/ImportForm.vue'
import Detail from '@/components/Detail/src/Detail.vue'
defineOptions({ name: 'Project' })
const message = useMessage() //
const { t } = useI18n() //
const loading = ref(true) //
const total = ref(0) //
const list = ref([]) //
const queryParams = reactive({
pageNo: 1,
pageSize: 10,
code: null,
name: null,
description: null,
customerCode: null,
available: null,
activeTime: [],
expireTime: [],
remark: null,
createTime: [],
creator: null
const { tableObject, tableMethods } = useTable({
getListApi: ProjectApi.getProjectPage //
})
const queryFormRef = ref() //
const exportLoading = ref(false) //
/** 查询列表 */
const getList = async () => {
loading.value = true
try {
const data = await ProjectApi.getProjectPage(queryParams)
list.value = data.list
total.value = data.total
} finally {
loading.value = false
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultAddBtn({hasPermi:'wms:project:create'}), //
defaultButtons.defaultImportBtn({hasPermi:'wms:project:import'}), //
defaultButtons.defaultExportBtn({hasPermi:'wms:project:export'}), //
// defaultButtons.defaultFilterBtn(), //
defaultButtons.defaultFreshBtn(null), //
// {
// label: '',
// name: 'zdy',
// hide: false,
// type: 'primary',
// icon: 'Select',
// color: ''
// },
]
//
const buttonBaseClick = (val, item) => {
if (val == 'add') { //
openForm('create')
} else if (val == 'import') { //
handleImport()
} else if (val == 'export') { //
handleExport()
} else if (val == 'refresh') { //
getList()
} else if (val == 'filtrate') { //
} else { //
console.log('其他按钮', item)
}
}
/** 搜索按钮操作 */
const handleQuery = () => {
queryParams.pageNo = 1
getList()
}
// -
const butttondata = [
defaultButtons.mainListEditBtn({hasPermi:'wms:project:update'}), //
defaultButtons.mainListDeleteBtn({hasPermi:'wms:project:delete'}), //
]
/** 重置按钮操作 */
const resetQuery = () => {
queryFormRef.value.resetFields()
handleQuery()
// -
const buttonTableClick = async (val, row) => {
if (val == 'edit') { //
// const res = await ProjectApi.getItempackaging(row.id)
openForm('update', row)
} else if (val == 'delete') { //
handleDelete(row.id)
}
}
/** 添加/修改操作 */
const formRef = ref()
const openForm = (type: string, id?: number) => {
formRef.value.open(type, id)
const basicFormRef = ref()
const openForm = (type: string, row?: any) => {
basicFormRef.value.open(type, row)
}
/** 详情操作 */
const detailRef = ref()
const openDetail = (row: any, titleName: any, titleValue: any) => {
detailRef.value.openDetail(row, titleName, titleValue)
}
/** 删除按钮操作 */
@ -264,13 +149,14 @@ const handleDelete = async (id: number) => {
}
/** 导出按钮操作 */
const exportLoading = ref(false) //
const handleExport = async () => {
try {
//
await message.exportConfirm()
//
exportLoading.value = true
const data = await ProjectApi.exportProject(queryParams)
const data = await ProjectApi.exportProject(setSearchParams)
download.excel(data, '项目.xls')
} catch {
} finally {
@ -278,6 +164,21 @@ const handleExport = async () => {
}
}
/** 导入 */
const importFormRef = ref()
const handleImport = () => {
importFormRef.value.open()
}
//
const importTemplateData = reactive({
templateUrl: '',
templateTitle: '项目导入模版.xls'
})
//
const importSuccess = () => {
getList()
}
/** 初始化 **/
onMounted(() => {
getList()

366
src/views/wms/purchaseprice/index.vue

@ -1,276 +1,138 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<el-form
class="-mb-15px"
:model="queryParams"
ref="queryFormRef"
:inline="true"
label-width="68px"
>
<el-form-item label="供应商代码" prop="supplierCode">
<el-input
v-model="queryParams.supplierCode"
placeholder="请输入供应商代码"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="物料代码" prop="itemCode">
<el-input
v-model="queryParams.itemCode"
placeholder="请输入物料代码"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="货币" prop="currency">
<el-select
v-model="queryParams.currency"
placeholder="请选择货币"
clearable
class="!w-240px"
>
<el-option
v-for="dict in getStrDictOptions(DICT_TYPE.CURRENCY)"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item label="价格" prop="price">
<el-input
v-model="queryParams.price"
placeholder="请输入价格"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="是否可用" prop="available">
<el-select
v-model="queryParams.available"
placeholder="请选择是否可用"
clearable
class="!w-240px"
>
<el-option
v-for="dict in getIntDictOptions(DICT_TYPE.TRUE_FALSE)"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item label="生效时间" prop="activeTime">
<el-date-picker
v-model="queryParams.activeTime"
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-240px"
/>
</el-form-item>
<el-form-item label="失效时间" prop="expireTime">
<el-date-picker
v-model="queryParams.expireTime"
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-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-240px"
/>
</el-form-item>
<el-form-item label="创建者ID" prop="creator">
<el-input
v-model="queryParams.creator"
placeholder="请输入创建者ID"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item>
<el-button type="info" plain @click="handleQuery"><Icon icon="ep:search" class="mr-5px" /> 搜索</el-button>
<el-button type="info" plain @click="resetQuery"><Icon icon="ep:refresh" class="mr-5px" /> 重置</el-button>
<el-button
type="primary"
@click="openForm('create')"
v-hasPermi="['wms:purchaseprice:create']"
>
<Icon icon="ep:plus" class="mr-5px" /> 新增
</el-button>
<el-button
type="success"
@click="handleExport"
:loading="exportLoading"
v-hasPermi="['wms:purchaseprice:export']"
>
<Icon icon="ep:download" class="mr-5px" /> 导出
</el-button>
</el-form-item>
</el-form>
<Search :schema="Purchaseprice.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
</ContentWrap>
<!-- 列表头部 -->
<TableHead :HeadButttondata="HeadButttondata" @button-base-click="buttonBaseClick" />
<!-- 列表 -->
<ContentWrap>
<el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true">
<el-table-column label="供应商代码" align="center" prop="supplierCode" width="150px" />
<el-table-column label="物料代码" align="center" prop="itemCode" width="150px" />
<el-table-column label="货币" align="center" prop="currency" width="150px">
<template #default="scope">
<dict-tag :type="DICT_TYPE.CURRENCY" :value="scope.row.currency" />
</template>
</el-table-column>
<el-table-column label="价格" align="center" prop="price" width="150px" />
<el-table-column label="是否可用" align="center" prop="available" width="150px">
<template #default="scope">
<dict-tag :type="DICT_TYPE.TRUE_FALSE" :value="scope.row.available" />
</template>
</el-table-column>
<el-table-column
label="生效时间"
align="center"
prop="activeTime"
:formatter="dateFormatter"
width="150px"
/>
<el-table-column
label="失效时间"
align="center"
prop="expireTime"
:formatter="dateFormatter"
width="150px"
/>
<el-table-column label="备注" align="center" prop="remark" width="150px" />
<el-table-column
label="创建时间"
align="center"
prop="createTime"
:formatter="dateFormatter"
width="150px"
/>
<el-table-column label="创建者ID" align="center" prop="creator" width="150px" />
<el-table-column label="操作" align="center" width="150px" fixed="right">
<template #default="scope">
<el-button
link
type="primary"
@click="openForm('update', scope.row.id)"
v-hasPermi="['wms:purchaseprice:update']"
>
编辑
</el-button>
<el-button
link
type="danger"
@click="handleDelete(scope.row.id)"
v-hasPermi="['wms:purchaseprice:delete']"
>
删除
</el-button>
</template>
</el-table-column>
</el-table>
<!-- 分页 -->
<Pagination
:total="total"
v-model:page="queryParams.pageNo"
v-model:limit="queryParams.pageSize"
@pagination="getList"
/>
<Table
:columns="Purchaseprice.allSchemas.tableColumns"
:data="tableObject.tableList"
:loading="tableObject.loading"
:pagination="{
total: tableObject.total
}"
v-model:pageSize="tableObject.pageSize"
v-model:currentPage="tableObject.currentPage"
v-model:sort="tableObject.sort"
>
<template #supplierCode="{row}">
<el-button type="primary" link @click="openDetail(row, '供应商代码', row.supplierCode)">
<span>{{ row.supplierCode }}</span>
</el-button>
</template>
<template #action="{ row }">
<ButtonBase :Butttondata="butttondata" @button-base-click="buttonTableClick($event,row)" />
</template>
</Table>
</ContentWrap>
<!-- 表单弹窗添加/修改 -->
<PurchasepriceForm ref="formRef" @success="getList" />
<BasicForm
ref="basicFormRef"
@success="getList"
:rules="PurchasepriceRules"
:formAllSchemas="Purchaseprice.allSchemas"
searchTableTitle="物料基础信息"
:searchTableAllSchemas="ItemBasic.allSchemas"
:searchTablePage="ItembasicApi.getItembasicPage"
:apiUpdate="PurchasepriceApi.updatePurchaseprice"
:apiCreate="PurchasepriceApi.createPurchaseprice"
/>
<!-- 详情 -->
<Detail ref="detailRef" :isBasic="true" :allSchemas="Purchaseprice.allSchemas" />
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/wms/purchaseprice/import" :importTemplateData="importTemplateData" @success="importSuccess" />
</template>
<script setup lang="ts">
import { DICT_TYPE, getStrDictOptions, getIntDictOptions } from '@/utils/dict'
import { dateFormatter } from '@/utils/formatTime'
import download from '@/utils/download'
import * as PurchasepriceApi from '@/api/wms/purchaseprice'
import PurchasepriceForm from './PurchasepriceForm.vue'
import * as ItembasicApi from '@/api/wms/itembasic'
import BasicForm from '@/components/BasicForm/src/BasicForm.vue'
import { Purchaseprice, PurchasepriceRules, ItemBasic } from '@/utils/disposition/tableColumns'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import TableHead from '@/components/TableHead/src/TableHead.vue'
import ImportForm from '@/components/ImportForm/src/ImportForm.vue'
import Detail from '@/components/Detail/src/Detail.vue'
defineOptions({ name: 'Purchaseprice' })
const message = useMessage() //
const { t } = useI18n() //
const loading = ref(true) //
const total = ref(0) //
const list = ref([]) //
const queryParams = reactive({
pageNo: 1,
pageSize: 10,
supplierCode: null,
itemCode: null,
currency: null,
price: null,
available: null,
activeTime: [],
expireTime: [],
remark: null,
createTime: [],
creator: null
const { tableObject, tableMethods } = useTable({
getListApi: PurchasepriceApi.getPurchasepricePage //
})
const queryFormRef = ref() //
const exportLoading = ref(false) //
/** 查询列表 */
const getList = async () => {
loading.value = true
try {
const data = await PurchasepriceApi.getPurchasepricePage(queryParams)
list.value = data.list
total.value = data.total
} finally {
loading.value = false
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultAddBtn({hasPermi:'wms:purchaseprice:create'}), //
defaultButtons.defaultImportBtn({hasPermi:'wms:purchaseprice:import'}), //
defaultButtons.defaultExportBtn({hasPermi:'wms:purchaseprice:export'}), //
// defaultButtons.defaultFilterBtn(), //
defaultButtons.defaultFreshBtn(null), //
// {
// label: '',
// name: 'zdy',
// hide: false,
// type: 'primary',
// icon: 'Select',
// color: ''
// },
]
//
const buttonBaseClick = (val, item) => {
if (val == 'add') { //
openForm('create')
} else if (val == 'import') { //
handleImport()
} else if (val == 'export') { //
handleExport()
} else if (val == 'refresh') { //
getList()
} else if (val == 'filtrate') { //
} else { //
console.log('其他按钮', item)
}
}
/** 搜索按钮操作 */
const handleQuery = () => {
queryParams.pageNo = 1
getList()
}
// -
const butttondata = [
defaultButtons.mainListEditBtn({hasPermi:'wms:purchaseprice:update'}), //
defaultButtons.mainListDeleteBtn({hasPermi:'wms:purchaseprice:delete'}), //
]
/** 重置按钮操作 */
const resetQuery = () => {
queryFormRef.value.resetFields()
handleQuery()
// -
const buttonTableClick = async (val, row) => {
if (val == 'edit') { //
// const res = await PurchasepriceApi.getItempackaging(row.id)
openForm('update', row)
} else if (val == 'delete') { //
handleDelete(row.id)
}
}
/** 添加/修改操作 */
const formRef = ref()
const openForm = (type: string, id?: number) => {
formRef.value.open(type, id)
const basicFormRef = ref()
const openForm = (type: string, row?: any) => {
basicFormRef.value.open(type, row)
}
/** 详情操作 */
const detailRef = ref()
const openDetail = (row: any, titleName: any, titleValue: any) => {
detailRef.value.openDetail(row, titleName, titleValue)
}
/** 删除按钮操作 */
@ -287,13 +149,14 @@ const handleDelete = async (id: number) => {
}
/** 导出按钮操作 */
const exportLoading = ref(false) //
const handleExport = async () => {
try {
//
await message.exportConfirm()
//
exportLoading.value = true
const data = await PurchasepriceApi.exportPurchaseprice(queryParams)
const data = await PurchasepriceApi.exportPurchaseprice(setSearchParams)
download.excel(data, '采购价格单.xls')
} catch {
} finally {
@ -301,6 +164,21 @@ const handleExport = async () => {
}
}
/** 导入 */
const importFormRef = ref()
const handleImport = () => {
importFormRef.value.open()
}
//
const importTemplateData = reactive({
templateUrl: '',
templateTitle: '采购价格单导入模版.xls'
})
//
const importSuccess = () => {
getList()
}
/** 初始化 **/
onMounted(() => {
getList()

366
src/views/wms/saleprice/index.vue

@ -1,276 +1,138 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<el-form
class="-mb-15px"
:model="queryParams"
ref="queryFormRef"
:inline="true"
label-width="68px"
>
<el-form-item label="客户代码" prop="customercode">
<el-input
v-model="queryParams.customercode"
placeholder="请输入客户代码"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="物料代码" prop="itemcode">
<el-input
v-model="queryParams.itemcode"
placeholder="请输入物料代码"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="货币" prop="currency">
<el-select
v-model="queryParams.currency"
placeholder="请选择货币"
clearable
class="!w-240px"
>
<el-option
v-for="dict in getStrDictOptions(DICT_TYPE.CURRENCY)"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item label="价格" prop="price">
<el-input
v-model="queryParams.price"
placeholder="请输入价格"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="是否可用" prop="available">
<el-select
v-model="queryParams.available"
placeholder="请选择是否可用"
clearable
class="!w-240px"
>
<el-option
v-for="dict in getIntDictOptions(DICT_TYPE.TRUE_FALSE)"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item label="生效时间" prop="activeTime">
<el-date-picker
v-model="queryParams.activeTime"
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-240px"
/>
</el-form-item>
<el-form-item label="失效时间" prop="expireTime">
<el-date-picker
v-model="queryParams.expireTime"
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-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-240px"
/>
</el-form-item>
<el-form-item label="创建者ID" prop="creator">
<el-input
v-model="queryParams.creator"
placeholder="请输入创建者ID"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item>
<el-button type="info" plain @click="handleQuery"><Icon icon="ep:search" class="mr-5px" /> 搜索</el-button>
<el-button type="info" plain @click="resetQuery"><Icon icon="ep:refresh" class="mr-5px" /> 重置</el-button>
<el-button
type="primary"
@click="openForm('create')"
v-hasPermi="['wms:saleprice:create']"
>
<Icon icon="ep:plus" class="mr-5px" /> 新增
</el-button>
<el-button
type="success"
@click="handleExport"
:loading="exportLoading"
v-hasPermi="['wms:saleprice:export']"
>
<Icon icon="ep:download" class="mr-5px" /> 导出
</el-button>
</el-form-item>
</el-form>
<Search :schema="Saleprice.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
</ContentWrap>
<!-- 列表头部 -->
<TableHead :HeadButttondata="HeadButttondata" @button-base-click="buttonBaseClick" />
<!-- 列表 -->
<ContentWrap>
<el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true">
<el-table-column label="客户代码" align="center" prop="customercode" width="150px" />
<el-table-column label="物料代码" align="center" prop="itemcode" width="150px" />
<el-table-column label="货币" align="center" prop="currency" width="150px">
<template #default="scope">
<dict-tag :type="DICT_TYPE.CURRENCY" :value="scope.row.currency" />
</template>
</el-table-column>
<el-table-column label="价格" align="center" prop="price" width="150px" />
<el-table-column label="是否可用" align="center" prop="available" width="150px">
<template #default="scope">
<dict-tag :type="DICT_TYPE.TRUE_FALSE" :value="scope.row.available" />
</template>
</el-table-column>
<el-table-column
label="生效时间"
align="center"
prop="activeTime"
:formatter="dateFormatter"
width="150px"
/>
<el-table-column
label="失效时间"
align="center"
prop="expireTime"
:formatter="dateFormatter"
width="150px"
/>
<el-table-column label="备注" align="center" prop="remark" width="150px" />
<el-table-column
label="创建时间"
align="center"
prop="createTime"
:formatter="dateFormatter"
width="150px"
/>
<el-table-column label="创建者ID" align="center" prop="creator" width="150px" />
<el-table-column label="操作" align="center" width="150px" fixed="right">
<template #default="scope">
<el-button
link
type="primary"
@click="openForm('update', scope.row.id)"
v-hasPermi="['wms:saleprice:update']"
>
编辑
</el-button>
<el-button
link
type="danger"
@click="handleDelete(scope.row.id)"
v-hasPermi="['wms:saleprice:delete']"
>
删除
</el-button>
</template>
</el-table-column>
</el-table>
<!-- 分页 -->
<Pagination
:total="total"
v-model:page="queryParams.pageNo"
v-model:limit="queryParams.pageSize"
@pagination="getList"
/>
<Table
:columns="Saleprice.allSchemas.tableColumns"
:data="tableObject.tableList"
:loading="tableObject.loading"
:pagination="{
total: tableObject.total
}"
v-model:pageSize="tableObject.pageSize"
v-model:currentPage="tableObject.currentPage"
v-model:sort="tableObject.sort"
>
<template #customercode="{row}">
<el-button type="primary" link @click="openDetail(row, '客户代码', row.customercode)">
<span>{{ row.customercode }}</span>
</el-button>
</template>
<template #action="{ row }">
<ButtonBase :Butttondata="butttondata" @button-base-click="buttonTableClick($event,row)" />
</template>
</Table>
</ContentWrap>
<!-- 表单弹窗添加/修改 -->
<SalepriceForm ref="formRef" @success="getList" />
<BasicForm
ref="basicFormRef"
@success="getList"
:rules="SalepriceRules"
:formAllSchemas="Saleprice.allSchemas"
searchTableTitle="物料基础信息"
:searchTableAllSchemas="ItemBasic.allSchemas"
:searchTablePage="ItembasicApi.getItembasicPage"
:apiUpdate="SalepriceApi.updateSaleprice"
:apiCreate="SalepriceApi.createSaleprice"
/>
<!-- 详情 -->
<Detail ref="detailRef" :isBasic="true" :allSchemas="Saleprice.allSchemas" />
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/wms/saleprice/import" :importTemplateData="importTemplateData" @success="importSuccess" />
</template>
<script setup lang="ts">
import { DICT_TYPE, getStrDictOptions, getIntDictOptions } from '@/utils/dict'
import { dateFormatter } from '@/utils/formatTime'
import download from '@/utils/download'
import * as SalepriceApi from '@/api/wms/saleprice'
import SalepriceForm from './SalepriceForm.vue'
import * as ItembasicApi from '@/api/wms/itembasic'
import BasicForm from '@/components/BasicForm/src/BasicForm.vue'
import { Saleprice, SalepriceRules, ItemBasic } from '@/utils/disposition/tableColumns'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import TableHead from '@/components/TableHead/src/TableHead.vue'
import ImportForm from '@/components/ImportForm/src/ImportForm.vue'
import Detail from '@/components/Detail/src/Detail.vue'
defineOptions({ name: 'Saleprice' })
const message = useMessage() //
const { t } = useI18n() //
const loading = ref(true) //
const total = ref(0) //
const list = ref([]) //
const queryParams = reactive({
pageNo: 1,
pageSize: 10,
customercode: null,
itemcode: null,
currency: null,
price: null,
available: null,
activeTime: [],
expireTime: [],
remark: null,
createTime: [],
creator: null
const { tableObject, tableMethods } = useTable({
getListApi: SalepriceApi.getSalepricePage //
})
const queryFormRef = ref() //
const exportLoading = ref(false) //
/** 查询列表 */
const getList = async () => {
loading.value = true
try {
const data = await SalepriceApi.getSalepricePage(queryParams)
list.value = data.list
total.value = data.total
} finally {
loading.value = false
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultAddBtn({hasPermi:'wms:saleprice:create'}), //
defaultButtons.defaultImportBtn({hasPermi:'wms:saleprice:import'}), //
defaultButtons.defaultExportBtn({hasPermi:'wms:saleprice:export'}), //
// defaultButtons.defaultFilterBtn(), //
defaultButtons.defaultFreshBtn(null), //
// {
// label: '',
// name: 'zdy',
// hide: false,
// type: 'primary',
// icon: 'Select',
// color: ''
// },
]
//
const buttonBaseClick = (val, item) => {
if (val == 'add') { //
openForm('create')
} else if (val == 'import') { //
handleImport()
} else if (val == 'export') { //
handleExport()
} else if (val == 'refresh') { //
getList()
} else if (val == 'filtrate') { //
} else { //
console.log('其他按钮', item)
}
}
/** 搜索按钮操作 */
const handleQuery = () => {
queryParams.pageNo = 1
getList()
}
// -
const butttondata = [
defaultButtons.mainListEditBtn({hasPermi:'wms:saleprice:update'}), //
defaultButtons.mainListDeleteBtn({hasPermi:'wms:saleprice:delete'}), //
]
/** 重置按钮操作 */
const resetQuery = () => {
queryFormRef.value.resetFields()
handleQuery()
// -
const buttonTableClick = async (val, row) => {
if (val == 'edit') { //
// const res = await SalepriceApi.getItempackaging(row.id)
openForm('update', row)
} else if (val == 'delete') { //
handleDelete(row.id)
}
}
/** 添加/修改操作 */
const formRef = ref()
const openForm = (type: string, id?: number) => {
formRef.value.open(type, id)
const basicFormRef = ref()
const openForm = (type: string, row?: any) => {
basicFormRef.value.open(type, row)
}
/** 详情操作 */
const detailRef = ref()
const openDetail = (row: any, titleName: any, titleValue: any) => {
detailRef.value.openDetail(row, titleName, titleValue)
}
/** 删除按钮操作 */
@ -287,13 +149,14 @@ const handleDelete = async (id: number) => {
}
/** 导出按钮操作 */
const exportLoading = ref(false) //
const handleExport = async () => {
try {
//
await message.exportConfirm()
//
exportLoading.value = true
const data = await SalepriceApi.exportSaleprice(queryParams)
const data = await SalepriceApi.exportSaleprice(setSearchParams)
download.excel(data, '销售价格单.xls')
} catch {
} finally {
@ -301,6 +164,21 @@ const handleExport = async () => {
}
}
/** 导入 */
const importFormRef = ref()
const handleImport = () => {
importFormRef.value.open()
}
//
const importTemplateData = reactive({
templateUrl: '',
templateTitle: '销售价格单导入模版.xls'
})
//
const importSuccess = () => {
getList()
}
/** 初始化 **/
onMounted(() => {
getList()

368
src/views/wms/stdcostprice/index.vue

@ -1,276 +1,138 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<el-form
class="-mb-15px"
:model="queryParams"
ref="queryFormRef"
:inline="true"
label-width="68px"
>
<el-form-item label="供应商代码" prop="supplierCode">
<el-input
v-model="queryParams.supplierCode"
placeholder="请输入供应商代码"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="物料代码" prop="itemCode">
<el-input
v-model="queryParams.itemCode"
placeholder="请输入物料代码"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="货币" prop="currency">
<el-select
v-model="queryParams.currency"
placeholder="请选择货币"
clearable
class="!w-240px"
>
<el-option
v-for="dict in getStrDictOptions(DICT_TYPE.CURRENCY)"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item label="价格" prop="price">
<el-input
v-model="queryParams.price"
placeholder="请输入价格"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="是否可用" prop="available">
<el-select
v-model="queryParams.available"
placeholder="请选择是否可用"
clearable
class="!w-240px"
>
<el-option
v-for="dict in getIntDictOptions(DICT_TYPE.TRUE_FALSE)"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item label="生效时间" prop="activeTime">
<el-date-picker
v-model="queryParams.activeTime"
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-240px"
/>
</el-form-item>
<el-form-item label="失效时间" prop="expireTime">
<el-date-picker
v-model="queryParams.expireTime"
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-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-240px"
/>
</el-form-item>
<el-form-item label="创建者ID" prop="creator">
<el-input
v-model="queryParams.creator"
placeholder="请输入创建者ID"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item>
<el-button type="info" plain @click="handleQuery"><Icon icon="ep:search" class="mr-5px" /> 搜索</el-button>
<el-button type="info" plain @click="resetQuery"><Icon icon="ep:refresh" class="mr-5px" /> 重置</el-button>
<el-button
type="primary"
@click="openForm('create')"
v-hasPermi="['wms:stdcostprice:create']"
>
<Icon icon="ep:plus" class="mr-5px" /> 新增
</el-button>
<el-button
type="success"
@click="handleExport"
:loading="exportLoading"
v-hasPermi="['wms:stdcostprice:export']"
>
<Icon icon="ep:download" class="mr-5px" /> 导出
</el-button>
</el-form-item>
</el-form>
<Search :schema="Stdcostprice.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
</ContentWrap>
<!-- 列表头部 -->
<TableHead :HeadButttondata="HeadButttondata" @button-base-click="buttonBaseClick" />
<!-- 列表 -->
<ContentWrap>
<el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true">
<el-table-column label="供应商代码" align="center" prop="supplierCode" width="150px" />
<el-table-column label="物料代码" align="center" prop="itemCode" width="150px" />
<el-table-column label="货币" align="center" prop="currency" width="150px">
<template #default="scope">
<dict-tag :type="DICT_TYPE.CURRENCY" :value="scope.row.currency" />
</template>
</el-table-column>
<el-table-column label="价格" align="center" prop="price" width="150px" />
<el-table-column label="是否可用" align="center" prop="available" width="150px">
<template #default="scope">
<dict-tag :type="DICT_TYPE.TRUE_FALSE" :value="scope.row.available" />
</template>
</el-table-column>
<el-table-column
label="生效时间"
align="center"
prop="activeTime"
:formatter="dateFormatter"
width="150px"
/>
<el-table-column
label="失效时间"
align="center"
prop="expireTime"
:formatter="dateFormatter"
width="150px"
/>
<el-table-column label="备注" align="center" prop="remark" width="150px" />
<el-table-column
label="创建时间"
align="center"
prop="createTime"
:formatter="dateFormatter"
width="150px"
/>
<el-table-column label="创建者ID" align="center" prop="creator" width="150px" />
<el-table-column label="操作" align="center" width="150px" fixed="right">
<template #default="scope">
<el-button
link
type="primary"
@click="openForm('update', scope.row.id)"
v-hasPermi="['wms:stdcostprice:update']"
>
编辑
</el-button>
<el-button
link
type="danger"
@click="handleDelete(scope.row.id)"
v-hasPermi="['wms:stdcostprice:delete']"
>
删除
</el-button>
</template>
</el-table-column>
</el-table>
<!-- 分页 -->
<Pagination
:total="total"
v-model:page="queryParams.pageNo"
v-model:limit="queryParams.pageSize"
@pagination="getList"
/>
<Table
:columns="Stdcostprice.allSchemas.tableColumns"
:data="tableObject.tableList"
:loading="tableObject.loading"
:pagination="{
total: tableObject.total
}"
v-model:pageSize="tableObject.pageSize"
v-model:currentPage="tableObject.currentPage"
v-model:sort="tableObject.sort"
>
<template #supplierCode="{row}">
<el-button type="primary" link @click="openDetail(row, '供应商代码', row.supplierCode)">
<span>{{ row.supplierCode }}</span>
</el-button>
</template>
<template #action="{ row }">
<ButtonBase :Butttondata="butttondata" @button-base-click="buttonTableClick($event,row)" />
</template>
</Table>
</ContentWrap>
<!-- 表单弹窗添加/修改 -->
<StdcostpriceForm ref="formRef" @success="getList" />
<BasicForm
ref="basicFormRef"
@success="getList"
:rules="StdcostpriceRules"
:formAllSchemas="Stdcostprice.allSchemas"
searchTableTitle="物料基础信息"
:searchTableAllSchemas="ItemBasic.allSchemas"
:searchTablePage="ItembasicApi.getItembasicPage"
:apiUpdate="StdcostpriceApi.updateStdcostprice"
:apiCreate="StdcostpriceApi.createStdcostprice"
/>
<!-- 详情 -->
<Detail ref="detailRef" :isBasic="true" :allSchemas="Stdcostprice.allSchemas" />
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/wms/stdcostprice/import" :importTemplateData="importTemplateData" @success="importSuccess" />
</template>
<script setup lang="ts">
import { DICT_TYPE, getStrDictOptions, getIntDictOptions } from '@/utils/dict'
import { dateFormatter } from '@/utils/formatTime'
import download from '@/utils/download'
import * as StdcostpriceApi from '@/api/wms/stdcostprice'
import StdcostpriceForm from './StdcostpriceForm.vue'
import * as ItembasicApi from '@/api/wms/itembasic'
import BasicForm from '@/components/BasicForm/src/BasicForm.vue'
import { Stdcostprice, StdcostpriceRules, ItemBasic } from '@/utils/disposition/tableColumns'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import TableHead from '@/components/TableHead/src/TableHead.vue'
import ImportForm from '@/components/ImportForm/src/ImportForm.vue'
import Detail from '@/components/Detail/src/Detail.vue'
defineOptions({ name: 'Stdcostprice' })
const message = useMessage() //
const { t } = useI18n() //
const loading = ref(true) //
const total = ref(0) //
const list = ref([]) //
const queryParams = reactive({
pageNo: 1,
pageSize: 10,
supplierCode: null,
itemCode: null,
currency: null,
price: null,
available: null,
activeTime: [],
expireTime: [],
remark: null,
createTime: [],
creator: null
const { tableObject, tableMethods } = useTable({
getListApi: StdcostpriceApi.getStdcostpricePage //
})
const queryFormRef = ref() //
const exportLoading = ref(false) //
/** 查询列表 */
const getList = async () => {
loading.value = true
try {
const data = await StdcostpriceApi.getStdcostpricePage(queryParams)
list.value = data.list
total.value = data.total
} finally {
loading.value = false
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultAddBtn({hasPermi:'wms:stdcostprice:create'}), //
defaultButtons.defaultImportBtn({hasPermi:'wms:stdcostprice:import'}), //
defaultButtons.defaultExportBtn({hasPermi:'wms:stdcostprice:export'}), //
// defaultButtons.defaultFilterBtn(), //
defaultButtons.defaultFreshBtn(null), //
// {
// label: '',
// name: 'zdy',
// hide: false,
// type: 'primary',
// icon: 'Select',
// color: ''
// },
]
//
const buttonBaseClick = (val, item) => {
if (val == 'add') { //
openForm('create')
} else if (val == 'import') { //
handleImport()
} else if (val == 'export') { //
handleExport()
} else if (val == 'refresh') { //
getList()
} else if (val == 'filtrate') { //
} else { //
console.log('其他按钮', item)
}
}
/** 搜索按钮操作 */
const handleQuery = () => {
queryParams.pageNo = 1
getList()
}
// -
const butttondata = [
defaultButtons.mainListEditBtn({hasPermi:'wms:stdcostprice:update'}), //
defaultButtons.mainListDeleteBtn({hasPermi:'wms:stdcostprice:delete'}), //
]
/** 重置按钮操作 */
const resetQuery = () => {
queryFormRef.value.resetFields()
handleQuery()
// -
const buttonTableClick = async (val, row) => {
if (val == 'edit') { //
// const res = await StdcostpriceApi.getItempackaging(row.id)
openForm('update', row)
} else if (val == 'delete') { //
handleDelete(row.id)
}
}
/** 添加/修改操作 */
const formRef = ref()
const openForm = (type: string, id?: number) => {
formRef.value.open(type, id)
const basicFormRef = ref()
const openForm = (type: string, row?: any) => {
basicFormRef.value.open(type, row)
}
/** 详情操作 */
const detailRef = ref()
const openDetail = (row: any, titleName: any, titleValue: any) => {
detailRef.value.openDetail(row, titleName, titleValue)
}
/** 删除按钮操作 */
@ -287,20 +149,36 @@ const handleDelete = async (id: number) => {
}
/** 导出按钮操作 */
const exportLoading = ref(false) //
const handleExport = async () => {
try {
//
await message.exportConfirm()
//
exportLoading.value = true
const data = await StdcostpriceApi.exportStdcostprice(queryParams)
download.excel(data, '标准成本价格单.xls')
const data = await StdcostpriceApi.exportStdcostprice(setSearchParams)
download.excel(data, '标准成本价格单 .xls')
} catch {
} finally {
exportLoading.value = false
}
}
/** 导入 */
const importFormRef = ref()
const handleImport = () => {
importFormRef.value.open()
}
//
const importTemplateData = reactive({
templateUrl: '',
templateTitle: '标准成本价格单导入模版.xls'
})
//
const importSuccess = () => {
getList()
}
/** 初始化 **/
onMounted(() => {
getList()

477
src/views/wms/supplier/index.vue

@ -1,387 +1,138 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<el-form
class="-mb-15px"
:model="queryParams"
ref="queryFormRef"
:inline="true"
label-width="68px"
>
<el-form-item label="代码" prop="code">
<el-input
v-model="queryParams.code"
placeholder="请输入代码"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="名称" prop="name">
<el-input
v-model="queryParams.name"
placeholder="请输入名称"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="简称" prop="shortName">
<el-input
v-model="queryParams.shortName"
placeholder="请输入简称"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="地址" prop="address">
<el-input
v-model="queryParams.address"
placeholder="请输入地址"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="国家" prop="country">
<el-input
v-model="queryParams.country"
placeholder="请输入国家"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="城市" prop="city">
<el-input
v-model="queryParams.city"
placeholder="请输入城市"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="电话" prop="phone">
<el-input
v-model="queryParams.phone"
placeholder="请输入电话"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="传真" prop="fax">
<el-input
v-model="queryParams.fax"
placeholder="请输入传真"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="邮编" prop="postId">
<el-input
v-model="queryParams.postId"
placeholder="请输入邮编"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="联系人" prop="contacts">
<el-input
v-model="queryParams.contacts"
placeholder="请输入联系人"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="银行" prop="bank">
<el-input
v-model="queryParams.bank"
placeholder="请输入银行"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="币种" prop="currency">
<el-select
v-model="queryParams.currency"
placeholder="请选择币种"
clearable
class="!w-240px"
>
<el-option
v-for="dict in getStrDictOptions(DICT_TYPE.CURRENCY)"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item label="税率" prop="taxRate">
<el-input
v-model="queryParams.taxRate"
placeholder="请输入税率"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="类型" prop="type">
<el-select v-model="queryParams.type" placeholder="请选择类型" clearable class="!w-240px">
<el-option
v-for="dict in getStrDictOptions(DICT_TYPE.SUPPLIER_TYPE)"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item label="是否可用" prop="available">
<el-select
v-model="queryParams.available"
placeholder="请选择是否可用"
clearable
class="!w-240px"
>
<el-option
v-for="dict in getIntDictOptions(DICT_TYPE.TRUE_FALSE)"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item label="生效时间" prop="activeTime">
<el-date-picker
v-model="queryParams.activeTime"
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-240px"
/>
</el-form-item>
<el-form-item label="失效时间" prop="expireTime">
<el-date-picker
v-model="queryParams.expireTime"
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-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-240px"
/>
</el-form-item>
<el-form-item label="创建者ID" prop="creator">
<el-input
v-model="queryParams.creator"
placeholder="请输入创建者ID"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item>
<el-button type="info" plain @click="handleQuery"><Icon icon="ep:search" class="mr-5px" /> 搜索</el-button>
<el-button type="info" plain @click="resetQuery"><Icon icon="ep:refresh" class="mr-5px" /> 重置</el-button>
<el-button type="primary" @click="openForm('create')" v-hasPermi="['wms:supplier:create']">
<Icon icon="ep:plus" class="mr-5px" /> 新增
</el-button>
<el-button
type="success"
@click="handleExport"
:loading="exportLoading"
v-hasPermi="['wms:supplier:export']"
>
<Icon icon="ep:download" class="mr-5px" /> 导出
</el-button>
</el-form-item>
</el-form>
<Search :schema="Supplier.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
</ContentWrap>
<!-- 列表头部 -->
<TableHead :HeadButttondata="HeadButttondata" @button-base-click="buttonBaseClick" />
<!-- 列表 -->
<ContentWrap>
<el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true">
<el-table-column label="代码" align="center" prop="code" width="150px" />
<el-table-column label="名称" align="center" prop="name" width="150px" />
<el-table-column label="简称" align="center" prop="shortName" width="150px" />
<el-table-column label="地址" align="center" prop="address" width="150px" />
<el-table-column label="国家" align="center" prop="country" width="150px" />
<el-table-column label="城市" align="center" prop="city" width="150px" />
<el-table-column label="电话" align="center" prop="phone" width="150px" />
<el-table-column label="传真" align="center" prop="fax" width="150px" />
<el-table-column label="邮编" align="center" prop="postId" width="150px" />
<el-table-column label="联系人" align="center" prop="contacts" width="150px" />
<el-table-column label="银行" align="center" prop="bank" width="150px" />
<el-table-column label="币种" align="center" prop="currency" width="150px">
<template #default="scope">
<dict-tag :type="DICT_TYPE.CURRENCY" :value="scope.row.currency" />
</template>
</el-table-column>
<el-table-column label="税率" align="center" prop="taxRate" width="150px" />
<el-table-column label="类型" align="center" prop="type" width="150px">
<template #default="scope">
<dict-tag :type="DICT_TYPE.SUPPLIER_TYPE" :value="scope.row.type" />
</template>
</el-table-column>
<el-table-column label="是否可用" align="center" prop="available" width="150px">
<template #default="scope">
<dict-tag :type="DICT_TYPE.TRUE_FALSE" :value="scope.row.available" />
</template>
</el-table-column>
<el-table-column
label="生效时间"
align="center"
prop="activeTime"
:formatter="dateFormatter"
width="150px"
/>
<el-table-column
label="失效时间"
align="center"
prop="expireTime"
:formatter="dateFormatter"
width="150px"
/>
<el-table-column label="备注" align="center" prop="remark" width="150px" />
<el-table-column
label="创建时间"
align="center"
prop="createTime"
:formatter="dateFormatter"
width="150px"
/>
<el-table-column label="创建者ID" align="center" prop="creator" width="150px" />
<el-table-column label="操作" align="center" width="150px" fixed="right">
<template #default="scope">
<el-button
link
type="primary"
@click="openForm('update', scope.row.id)"
v-hasPermi="['wms:supplier:update']"
>
编辑
</el-button>
<el-button
link
type="danger"
@click="handleDelete(scope.row.id)"
v-hasPermi="['wms:supplier:delete']"
>
删除
</el-button>
</template>
</el-table-column>
</el-table>
<!-- 分页 -->
<Pagination
:total="total"
v-model:page="queryParams.pageNo"
v-model:limit="queryParams.pageSize"
@pagination="getList"
/>
<Table
:columns="Supplier.allSchemas.tableColumns"
:data="tableObject.tableList"
:loading="tableObject.loading"
:pagination="{
total: tableObject.total
}"
v-model:pageSize="tableObject.pageSize"
v-model:currentPage="tableObject.currentPage"
v-model:sort="tableObject.sort"
>
<template #code="{row}">
<el-button type="primary" link @click="openDetail(row, '代码', row.code)">
<span>{{ row.code }}</span>
</el-button>
</template>
<template #action="{ row }">
<ButtonBase :Butttondata="butttondata" @button-base-click="buttonTableClick($event,row)" />
</template>
</Table>
</ContentWrap>
<!-- 表单弹窗添加/修改 -->
<SupplierForm ref="formRef" @success="getList" />
<BasicForm
ref="basicFormRef"
@success="getList"
:rules="SupplierRules"
:formAllSchemas="Supplier.allSchemas"
searchTableTitle="物料基础信息"
:searchTableAllSchemas="ItemBasic.allSchemas"
:searchTablePage="ItembasicApi.getItembasicPage"
:apiUpdate="SupplierApi.updateSupplier"
:apiCreate="SupplierApi.createSupplier"
/>
<!-- 详情 -->
<Detail ref="detailRef" :isBasic="true" :allSchemas="Supplier.allSchemas" />
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/wms/supplier/import" :importTemplateData="importTemplateData" @success="importSuccess" />
</template>
<script setup lang="ts">
import { DICT_TYPE, getStrDictOptions, getIntDictOptions } from '@/utils/dict'
import { dateFormatter } from '@/utils/formatTime'
import download from '@/utils/download'
import * as SupplierApi from '@/api/wms/supplier'
import SupplierForm from './SupplierForm.vue'
import * as ItembasicApi from '@/api/wms/itembasic'
import BasicForm from '@/components/BasicForm/src/BasicForm.vue'
import { Supplier, SupplierRules, ItemBasic } from '@/utils/disposition/tableColumns'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import TableHead from '@/components/TableHead/src/TableHead.vue'
import ImportForm from '@/components/ImportForm/src/ImportForm.vue'
import Detail from '@/components/Detail/src/Detail.vue'
defineOptions({ name: 'Supplier' })
const message = useMessage() //
const { t } = useI18n() //
const loading = ref(true) //
const total = ref(0) //
const list = ref([]) //
const queryParams = reactive({
pageNo: 1,
pageSize: 10,
code: null,
name: null,
shortName: null,
address: null,
country: null,
city: null,
phone: null,
fax: null,
postId: null,
contacts: null,
bank: null,
currency: null,
taxRate: null,
type: null,
available: null,
activeTime: [],
expireTime: [],
remark: null,
createTime: [],
creator: null
const { tableObject, tableMethods } = useTable({
getListApi: SupplierApi.getSupplierPage //
})
const queryFormRef = ref() //
const exportLoading = ref(false) //
/** 查询列表 */
const getList = async () => {
loading.value = true
try {
const data = await SupplierApi.getSupplierPage(queryParams)
list.value = data.list
total.value = data.total
} finally {
loading.value = false
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultAddBtn({hasPermi:'wms:supplier:create'}), //
defaultButtons.defaultImportBtn({hasPermi:'wms:supplier:import'}), //
defaultButtons.defaultExportBtn({hasPermi:'wms:supplier:export'}), //
// defaultButtons.defaultFilterBtn(), //
defaultButtons.defaultFreshBtn(null), //
// {
// label: '',
// name: 'zdy',
// hide: false,
// type: 'primary',
// icon: 'Select',
// color: ''
// },
]
//
const buttonBaseClick = (val, item) => {
if (val == 'add') { //
openForm('create')
} else if (val == 'import') { //
handleImport()
} else if (val == 'export') { //
handleExport()
} else if (val == 'refresh') { //
getList()
} else if (val == 'filtrate') { //
} else { //
console.log('其他按钮', item)
}
}
/** 搜索按钮操作 */
const handleQuery = () => {
queryParams.pageNo = 1
getList()
}
// -
const butttondata = [
defaultButtons.mainListEditBtn({hasPermi:'wms:supplier:update'}), //
defaultButtons.mainListDeleteBtn({hasPermi:'wms:supplier:delete'}), //
]
/** 重置按钮操作 */
const resetQuery = () => {
queryFormRef.value.resetFields()
handleQuery()
// -
const buttonTableClick = async (val, row) => {
if (val == 'edit') { //
// const res = await SupplierApi.getItempackaging(row.id)
openForm('update', row)
} else if (val == 'delete') { //
handleDelete(row.id)
}
}
/** 添加/修改操作 */
const formRef = ref()
const openForm = (type: string, id?: number) => {
formRef.value.open(type, id)
const basicFormRef = ref()
const openForm = (type: string, row?: any) => {
basicFormRef.value.open(type, row)
}
/** 详情操作 */
const detailRef = ref()
const openDetail = (row: any, titleName: any, titleValue: any) => {
detailRef.value.openDetail(row, titleName, titleValue)
}
/** 删除按钮操作 */
@ -398,13 +149,14 @@ const handleDelete = async (id: number) => {
}
/** 导出按钮操作 */
const exportLoading = ref(false) //
const handleExport = async () => {
try {
//
await message.exportConfirm()
//
exportLoading.value = true
const data = await SupplierApi.exportSupplier(queryParams)
const data = await SupplierApi.exportSupplier(setSearchParams)
download.excel(data, '供应商.xls')
} catch {
} finally {
@ -412,6 +164,21 @@ const handleExport = async () => {
}
}
/** 导入 */
const importFormRef = ref()
const handleImport = () => {
importFormRef.value.open()
}
//
const importTemplateData = reactive({
templateUrl: '',
templateTitle: '供应商导入模版.xls'
})
//
const importSuccess = () => {
getList()
}
/** 初始化 **/
onMounted(() => {
getList()

495
src/views/wms/supplieritem/index.vue

@ -1,405 +1,138 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<el-form
class="-mb-15px"
:model="queryParams"
ref="queryFormRef"
:inline="true"
label-width="68px"
>
<el-form-item label="供应商代码" prop="supplierCode">
<el-input
v-model="queryParams.supplierCode"
placeholder="请输入供应商代码"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="物料代码" prop="itemCode">
<el-input
v-model="queryParams.itemCode"
placeholder="请输入物料代码"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="供应商物料代码" prop="supplierItemCode">
<el-input
v-model="queryParams.supplierItemCode"
placeholder="请输入供应商物料代码"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="供应商计量单位" prop="supplierUom">
<el-select
v-model="queryParams.supplierUom"
placeholder="请选择供应商计量单位"
clearable
class="!w-240px"
>
<el-option
v-for="dict in getStrDictOptions(DICT_TYPE.UOM)"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item label="转换率" prop="convertRate">
<el-input
v-model="queryParams.convertRate"
placeholder="请输入转换率"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="供应商包装单位" prop="packUnit">
<el-select
v-model="queryParams.packUnit"
placeholder="请选择供应商包装单位"
clearable
class="!w-240px"
>
<el-option
v-for="dict in getStrDictOptions(DICT_TYPE.PACK_UNIT)"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item label="供应商包装量" prop="packQty">
<el-input
v-model="queryParams.packQty"
placeholder="请输入供应商包装量"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="供应商替代包装单位" prop="altPackUnit">
<el-select
v-model="queryParams.altPackUnit"
placeholder="请选择供应商替代包装单位"
clearable
class="!w-240px"
>
<el-option
v-for="dict in getStrDictOptions(DICT_TYPE.PACK_UNIT)"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item label="供应商替代包装量" prop="altPackQty">
<el-input
v-model="queryParams.altPackQty"
placeholder="请输入供应商替代包装量"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="每器具包装数" prop="packQtyOfContainer">
<el-input
v-model="queryParams.packQtyOfContainer"
placeholder="请输入每器具包装数"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="默认收货仓库" prop="defaultWarehouseCode">
<el-input
v-model="queryParams.defaultWarehouseCode"
placeholder="请输入默认收货仓库"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="默认收货库位" prop="defaultLocationCode">
<el-input
v-model="queryParams.defaultLocationCode"
placeholder="请输入默认收货库位"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="结算方式" prop="settlementType">
<el-select
v-model="queryParams.settlementType"
placeholder="请选择结算方式"
clearable
class="!w-240px"
>
<el-option
v-for="dict in getStrDictOptions(DICT_TYPE.SETTLEMENT_TYPE)"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item label="是否可用" prop="available">
<el-select
v-model="queryParams.available"
placeholder="请选择是否可用"
clearable
class="!w-240px"
>
<el-option
v-for="dict in getIntDictOptions(DICT_TYPE.TRUE_FALSE)"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item label="生效时间" prop="activeTime">
<el-date-picker
v-model="queryParams.activeTime"
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-240px"
/>
</el-form-item>
<el-form-item label="失效时间" prop="expireTime">
<el-date-picker
v-model="queryParams.expireTime"
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-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-240px"
/>
</el-form-item>
<el-form-item label="创建者ID" prop="creator">
<el-input
v-model="queryParams.creator"
placeholder="请输入创建者ID"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item>
<el-button type="info" plain @click="handleQuery"><Icon icon="ep:search" class="mr-5px" /> 搜索</el-button>
<el-button type="info" plain @click="resetQuery"><Icon icon="ep:refresh" class="mr-5px" /> 重置</el-button>
<el-button
type="primary"
@click="openForm('create')"
v-hasPermi="['wms:supplieritem:create']"
>
<Icon icon="ep:plus" class="mr-5px" /> 新增
</el-button>
<el-button
type="success"
@click="handleExport"
:loading="exportLoading"
v-hasPermi="['wms:supplieritem:export']"
>
<Icon icon="ep:download" class="mr-5px" /> 导出
</el-button>
</el-form-item>
</el-form>
<Search :schema="Supplieritem.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
</ContentWrap>
<!-- 列表头部 -->
<TableHead :HeadButttondata="HeadButttondata" @button-base-click="buttonBaseClick" />
<!-- 列表 -->
<ContentWrap>
<el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true">
<el-table-column label="供应商代码" align="center" prop="supplierCode" width="150px" />
<el-table-column label="物料代码" align="center" prop="itemCode" width="150px" />
<el-table-column label="供应商物料代码" align="center" prop="supplierItemCode" width="150px" />
<el-table-column label="供应商计量单位" align="center" prop="supplierUom" width="150px">
<template #default="scope">
<dict-tag :type="DICT_TYPE.UOM" :value="scope.row.supplierUom" />
</template>
</el-table-column>
<el-table-column label="转换率" align="center" prop="convertRate" width="150px" />
<el-table-column label="供应商包装单位" align="center" prop="packUnit" width="150px">
<template #default="scope">
<dict-tag :type="DICT_TYPE.PACK_UNIT" :value="scope.row.packUnit" />
</template>
</el-table-column>
<el-table-column label="供应商包装量" align="center" prop="packQty" width="150px" />
<el-table-column label="供应商替代包装单位" align="center" prop="altPackUnit" width="150px">
<template #default="scope">
<dict-tag :type="DICT_TYPE.PACK_UNIT" :value="scope.row.altPackUnit" />
</template>
</el-table-column>
<el-table-column label="供应商替代包装量" align="center" prop="altPackQty" width="150px" />
<el-table-column label="每器具包装数" align="center" prop="packQtyOfContainer" width="150px" />
<el-table-column label="默认收货仓库" align="center" prop="defaultWarehouseCode" width="150px" />
<el-table-column label="默认收货库位" align="center" prop="defaultLocationCode" width="150px" />
<el-table-column label="结算方式" align="center" prop="settlementType" width="150px">
<template #default="scope">
<dict-tag :type="DICT_TYPE.SETTLEMENT_TYPE" :value="scope.row.settlementType" />
</template>
</el-table-column>
<el-table-column label="是否可用" align="center" prop="available" width="150px">
<template #default="scope">
<dict-tag :type="DICT_TYPE.TRUE_FALSE" :value="scope.row.available" />
</template>
</el-table-column>
<el-table-column
label="生效时间"
align="center"
prop="activeTime"
:formatter="dateFormatter"
width="150px"
/>
<el-table-column
label="失效时间"
align="center"
prop="expireTime"
:formatter="dateFormatter"
width="150px"
/>
<el-table-column label="备注" align="center" prop="remark" width="150px" />
<el-table-column
label="创建时间"
align="center"
prop="createTime"
:formatter="dateFormatter"
width="150px"
/>
<el-table-column label="创建者ID" align="center" prop="creator" width="150px" />
<el-table-column label="操作" align="center" width="150px" fixed="right">
<template #default="scope">
<el-button
link
type="primary"
@click="openForm('update', scope.row.id)"
v-hasPermi="['wms:supplieritem:update']"
>
编辑
</el-button>
<el-button
link
type="danger"
@click="handleDelete(scope.row.id)"
v-hasPermi="['wms:supplieritem:delete']"
>
删除
</el-button>
</template>
</el-table-column>
</el-table>
<!-- 分页 -->
<Pagination
:total="total"
v-model:page="queryParams.pageNo"
v-model:limit="queryParams.pageSize"
@pagination="getList"
/>
<Table
:columns="Supplieritem.allSchemas.tableColumns"
:data="tableObject.tableList"
:loading="tableObject.loading"
:pagination="{
total: tableObject.total
}"
v-model:pageSize="tableObject.pageSize"
v-model:currentPage="tableObject.currentPage"
v-model:sort="tableObject.sort"
>
<template #supplierCode="{row}">
<el-button type="primary" link @click="openDetail(row, '供应商代码', row.supplierCode)">
<span>{{ row.supplierCode }}</span>
</el-button>
</template>
<template #action="{ row }">
<ButtonBase :Butttondata="butttondata" @button-base-click="buttonTableClick($event,row)" />
</template>
</Table>
</ContentWrap>
<!-- 表单弹窗添加/修改 -->
<SupplieritemForm ref="formRef" @success="getList" />
<BasicForm
ref="basicFormRef"
@success="getList"
:rules="SupplieritemRules"
:formAllSchemas="Supplieritem.allSchemas"
searchTableTitle="物料基础信息"
:searchTableAllSchemas="ItemBasic.allSchemas"
:searchTablePage="ItembasicApi.getItembasicPage"
:apiUpdate="SupplieritemApi.updateSupplieritem"
:apiCreate="SupplieritemApi.createSupplieritem"
/>
<!-- 详情 -->
<Detail ref="detailRef" :isBasic="true" :allSchemas="Supplieritem.allSchemas" />
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/wms/Supplieritem/import" :importTemplateData="importTemplateData" @success="importSuccess" />
</template>
<script setup lang="ts">
import { DICT_TYPE, getStrDictOptions, getIntDictOptions } from '@/utils/dict'
import { dateFormatter } from '@/utils/formatTime'
import download from '@/utils/download'
import * as SupplieritemApi from '@/api/wms/supplieritem'
import SupplieritemForm from './SupplieritemForm.vue'
import * as ItembasicApi from '@/api/wms/itembasic'
import BasicForm from '@/components/BasicForm/src/BasicForm.vue'
import { Supplieritem, SupplieritemRules, ItemBasic } from '@/utils/disposition/tableColumns'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import TableHead from '@/components/TableHead/src/TableHead.vue'
import ImportForm from '@/components/ImportForm/src/ImportForm.vue'
import Detail from '@/components/Detail/src/Detail.vue'
defineOptions({ name: 'Supplieritem' })
const message = useMessage() //
const { t } = useI18n() //
const loading = ref(true) //
const total = ref(0) //
const list = ref([]) //
const queryParams = reactive({
pageNo: 1,
pageSize: 10,
supplierCode: null,
itemCode: null,
supplierItemCode: null,
supplierUom: null,
convertRate: null,
packUnit: null,
packQty: null,
altPackUnit: null,
altPackQty: null,
packQtyOfContainer: null,
defaultWarehouseCode: null,
defaultLocationCode: null,
settlementType: null,
available: null,
activeTime: [],
expireTime: [],
remark: null,
createTime: [],
creator: null
const { tableObject, tableMethods } = useTable({
getListApi: SupplieritemApi.getSupplieritemPage //
})
const queryFormRef = ref() //
const exportLoading = ref(false) //
/** 查询列表 */
const getList = async () => {
loading.value = true
try {
const data = await SupplieritemApi.getSupplieritemPage(queryParams)
list.value = data.list
total.value = data.total
} finally {
loading.value = false
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultAddBtn({hasPermi:'wms:supplieritem:create'}), //
defaultButtons.defaultImportBtn({hasPermi:'wms:supplieritem:import'}), //
defaultButtons.defaultExportBtn({hasPermi:'wms:supplieritem:export'}), //
// defaultButtons.defaultFilterBtn(), //
defaultButtons.defaultFreshBtn(null), //
// {
// label: '',
// name: 'zdy',
// hide: false,
// type: 'primary',
// icon: 'Select',
// color: ''
// },
]
//
const buttonBaseClick = (val, item) => {
if (val == 'add') { //
openForm('create')
} else if (val == 'import') { //
handleImport()
} else if (val == 'export') { //
handleExport()
} else if (val == 'refresh') { //
getList()
} else if (val == 'filtrate') { //
} else { //
console.log('其他按钮', item)
}
}
/** 搜索按钮操作 */
const handleQuery = () => {
queryParams.pageNo = 1
getList()
}
// -
const butttondata = [
defaultButtons.mainListEditBtn({hasPermi:'wms:supplieritem:update'}), //
defaultButtons.mainListDeleteBtn({hasPermi:'wms:supplieritem:delete'}), //
]
/** 重置按钮操作 */
const resetQuery = () => {
queryFormRef.value.resetFields()
handleQuery()
// -
const buttonTableClick = async (val, row) => {
if (val == 'edit') { //
// const res = await SupplieritemApi.getItempackaging(row.id)
openForm('update', row)
} else if (val == 'delete') { //
handleDelete(row.id)
}
}
/** 添加/修改操作 */
const formRef = ref()
const openForm = (type: string, id?: number) => {
formRef.value.open(type, id)
const basicFormRef = ref()
const openForm = (type: string, row?: any) => {
basicFormRef.value.open(type, row)
}
/** 详情操作 */
const detailRef = ref()
const openDetail = (row: any, titleName: any, titleValue: any) => {
detailRef.value.openDetail(row, titleName, titleValue)
}
/** 删除按钮操作 */
@ -416,13 +149,14 @@ const handleDelete = async (id: number) => {
}
/** 导出按钮操作 */
const exportLoading = ref(false) //
const handleExport = async () => {
try {
//
await message.exportConfirm()
//
exportLoading.value = true
const data = await SupplieritemApi.exportSupplieritem(queryParams)
const data = await SupplieritemApi.exportSupplieritem(setSearchParams)
download.excel(data, '供应商物品.xls')
} catch {
} finally {
@ -430,6 +164,21 @@ const handleExport = async () => {
}
}
/** 导入 */
const importFormRef = ref()
const handleImport = () => {
importFormRef.value.open()
}
//
const importTemplateData = reactive({
templateUrl: '',
templateTitle: '供应商物品导入模版.xls'
})
//
const importSuccess = () => {
getList()
}
/** 初始化 **/
onMounted(() => {
getList()

361
src/views/wms/systemcalendar/index.vue

@ -1,271 +1,138 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<el-form
class="-mb-15px"
:model="queryParams"
ref="queryFormRef"
:inline="true"
label-width="68px"
>
<el-form-item label="模块" prop="module">
<el-input
v-model="queryParams.module"
placeholder="请输入模块"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="开始时间" prop="startTime">
<el-date-picker
v-model="queryParams.startTime"
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-240px"
/>
</el-form-item>
<el-form-item label="结束时间" prop="stopTime">
<el-date-picker
v-model="queryParams.stopTime"
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-240px"
/>
</el-form-item>
<el-form-item label="是否可用" prop="available">
<el-select
v-model="queryParams.available"
placeholder="请选择是否可用"
clearable
class="!w-240px"
>
<el-option
v-for="dict in getIntDictOptions(DICT_TYPE.TRUE_FALSE)"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item label="生效时间" prop="activeTime">
<el-date-picker
v-model="queryParams.activeTime"
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-240px"
/>
</el-form-item>
<el-form-item label="失效时间" prop="expireTime">
<el-date-picker
v-model="queryParams.expireTime"
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-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-240px"
/>
</el-form-item>
<el-form-item label="创建者ID" prop="creator">
<el-input
v-model="queryParams.creator"
placeholder="请输入创建者ID"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item>
<el-button type="info" plain @click="handleQuery"><Icon icon="ep:search" class="mr-5px" /> 搜索</el-button>
<el-button type="info" plain @click="resetQuery"><Icon icon="ep:refresh" class="mr-5px" /> 重置</el-button>
<el-button
type="primary"
@click="openForm('create')"
v-hasPermi="['wms:systemcalendar:create']"
>
<Icon icon="ep:plus" class="mr-5px" /> 新增
</el-button>
<el-button
type="success"
@click="handleExport"
:loading="exportLoading"
v-hasPermi="['wms:systemcalendar:export']"
>
<Icon icon="ep:download" class="mr-5px" /> 导出
</el-button>
</el-form-item>
</el-form>
<Search :schema="Systemcalendar.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
</ContentWrap>
<!-- 列表头部 -->
<TableHead :HeadButttondata="HeadButttondata" @button-base-click="buttonBaseClick" />
<!-- 列表 -->
<ContentWrap>
<el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true">
<el-table-column label="模块" align="center" prop="module" width="150px" />
<el-table-column
label="开始时间"
align="center"
prop="startTime"
:formatter="dateFormatter"
width="150px"
/>
<el-table-column
label="结束时间"
align="center"
prop="stopTime"
:formatter="dateFormatter"
width="150px"
/>
<el-table-column label="是否可用" align="center" prop="available" width="150px">
<template #default="scope">
<dict-tag :type="DICT_TYPE.TRUE_FALSE" :value="scope.row.available" />
</template>
</el-table-column>
<el-table-column
label="生效时间"
align="center"
prop="activeTime"
:formatter="dateFormatter"
width="150px"
/>
<el-table-column
label="失效时间"
align="center"
prop="expireTime"
:formatter="dateFormatter"
width="150px"
/>
<el-table-column label="备注" align="center" prop="remark" width="150px" />
<el-table-column
label="创建时间"
align="center"
prop="createTime"
:formatter="dateFormatter"
width="150px"
/>
<el-table-column label="创建者ID" align="center" prop="creator" width="150px" />
<el-table-column label="操作" align="center" width="150px" fixed="right">
<template #default="scope">
<el-button
link
type="primary"
@click="openForm('update', scope.row.id)"
v-hasPermi="['wms:systemcalendar:update']"
>
编辑
</el-button>
<el-button
link
type="danger"
@click="handleDelete(scope.row.id)"
v-hasPermi="['wms:systemcalendar:delete']"
>
删除
</el-button>
</template>
</el-table-column>
</el-table>
<!-- 分页 -->
<Pagination
:total="total"
v-model:page="queryParams.pageNo"
v-model:limit="queryParams.pageSize"
@pagination="getList"
/>
<Table
:columns="Systemcalendar.allSchemas.tableColumns"
:data="tableObject.tableList"
:loading="tableObject.loading"
:pagination="{
total: tableObject.total
}"
v-model:pageSize="tableObject.pageSize"
v-model:currentPage="tableObject.currentPage"
v-model:sort="tableObject.sort"
>
<template #module="{row}">
<el-button type="primary" link @click="openDetail(row, '模块', row.module)">
<span>{{ row.module }}</span>
</el-button>
</template>
<template #action="{ row }">
<ButtonBase :Butttondata="butttondata" @button-base-click="buttonTableClick($event,row)" />
</template>
</Table>
</ContentWrap>
<!-- 表单弹窗添加/修改 -->
<SystemcalendarForm ref="formRef" @success="getList" />
<BasicForm
ref="basicFormRef"
@success="getList"
:rules="SystemcalendarRules"
:formAllSchemas="Systemcalendar.allSchemas"
searchTableTitle="物料基础信息"
:searchTableAllSchemas="ItemBasic.allSchemas"
:searchTablePage="ItembasicApi.getItembasicPage"
:apiUpdate="SystemcalendarApi.updateSystemcalendar"
:apiCreate="SystemcalendarApi.createSystemcalendar"
/>
<!-- 详情 -->
<Detail ref="detailRef" :isBasic="true" :allSchemas="Systemcalendar.allSchemas" />
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/wms/systemcalendar/import" :importTemplateData="importTemplateData" @success="importSuccess" />
</template>
<script setup lang="ts">
import { DICT_TYPE, getIntDictOptions } from '@/utils/dict'
import { dateFormatter } from '@/utils/formatTime'
import download from '@/utils/download'
import * as SystemcalendarApi from '@/api/wms/systemcalendar'
import SystemcalendarForm from './SystemcalendarForm.vue'
import * as ItembasicApi from '@/api/wms/itembasic'
import BasicForm from '@/components/BasicForm/src/BasicForm.vue'
import { Systemcalendar, SystemcalendarRules, ItemBasic } from '@/utils/disposition/tableColumns'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import TableHead from '@/components/TableHead/src/TableHead.vue'
import ImportForm from '@/components/ImportForm/src/ImportForm.vue'
import Detail from '@/components/Detail/src/Detail.vue'
defineOptions({ name: 'Systemcalendar' })
const message = useMessage() //
const { t } = useI18n() //
const loading = ref(true) //
const total = ref(0) //
const list = ref([]) //
const queryParams = reactive({
pageNo: 1,
pageSize: 10,
module: null,
startTime: [],
stopTime: [],
available: null,
activeTime: [],
expireTime: [],
remark: null,
createTime: [],
creator: null
const { tableObject, tableMethods } = useTable({
getListApi: SystemcalendarApi.getSystemcalendarPage //
})
const queryFormRef = ref() //
const exportLoading = ref(false) //
/** 查询列表 */
const getList = async () => {
loading.value = true
try {
const data = await SystemcalendarApi.getSystemcalendarPage(queryParams)
list.value = data.list
total.value = data.total
} finally {
loading.value = false
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultAddBtn({hasPermi:'wms:systemcalendar:create'}), //
defaultButtons.defaultImportBtn({hasPermi:'wms:systemcalendar:import'}), //
defaultButtons.defaultExportBtn({hasPermi:'wms:systemcalendar:export'}), //
// defaultButtons.defaultFilterBtn(), //
defaultButtons.defaultFreshBtn(null), //
// {
// label: '',
// name: 'zdy',
// hide: false,
// type: 'primary',
// icon: 'Select',
// color: ''
// },
]
//
const buttonBaseClick = (val, item) => {
if (val == 'add') { //
openForm('create')
} else if (val == 'import') { //
handleImport()
} else if (val == 'export') { //
handleExport()
} else if (val == 'refresh') { //
getList()
} else if (val == 'filtrate') { //
} else { //
console.log('其他按钮', item)
}
}
/** 搜索按钮操作 */
const handleQuery = () => {
queryParams.pageNo = 1
getList()
}
// -
const butttondata = [
defaultButtons.mainListEditBtn({hasPermi:'wms:systemcalendar:update'}), //
defaultButtons.mainListDeleteBtn({hasPermi:'wms:systemcalendar:delete'}), //
]
/** 重置按钮操作 */
const resetQuery = () => {
queryFormRef.value.resetFields()
handleQuery()
// -
const buttonTableClick = async (val, row) => {
if (val == 'edit') { //
// const res = await SystemcalendarApi.getItempackaging(row.id)
openForm('update', row)
} else if (val == 'delete') { //
handleDelete(row.id)
}
}
/** 添加/修改操作 */
const formRef = ref()
const openForm = (type: string, id?: number) => {
formRef.value.open(type, id)
const basicFormRef = ref()
const openForm = (type: string, row?: any) => {
basicFormRef.value.open(type, row)
}
/** 详情操作 */
const detailRef = ref()
const openDetail = (row: any, titleName: any, titleValue: any) => {
detailRef.value.openDetail(row, titleName, titleValue)
}
/** 删除按钮操作 */
@ -282,13 +149,14 @@ const handleDelete = async (id: number) => {
}
/** 导出按钮操作 */
const exportLoading = ref(false) //
const handleExport = async () => {
try {
//
await message.exportConfirm()
//
exportLoading.value = true
const data = await SystemcalendarApi.exportSystemcalendar(queryParams)
const data = await SystemcalendarApi.exportSystemcalendar(setSearchParams)
download.excel(data, '系统日历.xls')
} catch {
} finally {
@ -296,6 +164,21 @@ const handleExport = async () => {
}
}
/** 导入 */
const importFormRef = ref()
const handleImport = () => {
importFormRef.value.open()
}
//
const importTemplateData = reactive({
templateUrl: '',
templateTitle: '系统日历导入模版.xls'
})
//
const importSuccess = () => {
getList()
}
/** 初始化 **/
onMounted(() => {
getList()

352
src/views/wms/warehouse/index.vue

@ -1,262 +1,138 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<el-form
class="-mb-15px"
:model="queryParams"
ref="queryFormRef"
:inline="true"
label-width="68px"
>
<el-form-item label="代码" prop="code">
<el-input
v-model="queryParams.code"
placeholder="请输入代码"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="名称" prop="name">
<el-input
v-model="queryParams.name"
placeholder="请输入名称"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="类型" prop="type">
<el-select v-model="queryParams.type" placeholder="请选择类型" clearable class="!w-240px">
<el-option
v-for="dict in getStrDictOptions(DICT_TYPE.WAREHOUSE_TYPE)"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item label="是否可用" prop="available">
<el-select
v-model="queryParams.available"
placeholder="请选择是否可用"
clearable
class="!w-240px"
>
<el-option
v-for="dict in getIntDictOptions(DICT_TYPE.TRUE_FALSE)"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item label="生效时间" prop="activeTime">
<el-date-picker
v-model="queryParams.activeTime"
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-240px"
/>
</el-form-item>
<el-form-item label="失效时间" prop="expireTime">
<el-date-picker
v-model="queryParams.expireTime"
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-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-240px"
/>
</el-form-item>
<el-form-item label="创建者ID" prop="creator">
<el-input
v-model="queryParams.creator"
placeholder="请输入创建者ID"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item>
<el-button type="info" plain @click="handleQuery"><Icon icon="ep:search" class="mr-5px" /> 搜索</el-button>
<el-button type="info" plain @click="resetQuery"><Icon icon="ep:refresh" class="mr-5px" /> 重置</el-button>
<el-button
type="primary"
@click="openForm('create')"
v-hasPermi="['wms:warehouse:create']"
>
<Icon icon="ep:plus" class="mr-5px" /> 新增
</el-button>
<el-button
type="success"
@click="handleExport"
:loading="exportLoading"
v-hasPermi="['wms:warehouse:export']"
>
<Icon icon="ep:download" class="mr-5px" /> 导出
</el-button>
</el-form-item>
</el-form>
<Search :schema="Warehouse.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
</ContentWrap>
<!-- 列表头部 -->
<TableHead :HeadButttondata="HeadButttondata" @button-base-click="buttonBaseClick" />
<!-- 列表 -->
<ContentWrap>
<el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true">
<el-table-column label="代码" align="center" prop="code" width="150px" />
<el-table-column label="名称" align="center" prop="name" width="150px" />
<el-table-column label="描述" align="center" prop="description" width="150px" />
<el-table-column label="类型" align="center" prop="type" width="150px">
<template #default="scope">
<dict-tag :type="DICT_TYPE.WAREHOUSE_TYPE" :value="scope.row.type" />
</template>
</el-table-column>
<el-table-column label="是否可用" align="center" prop="available" width="150px">
<template #default="scope">
<dict-tag :type="DICT_TYPE.TRUE_FALSE" :value="scope.row.available" />
</template>
</el-table-column>
<el-table-column
label="生效时间"
align="center"
prop="activeTime"
:formatter="dateFormatter"
width="150px"
/>
<el-table-column
label="失效时间"
align="center"
prop="expireTime"
:formatter="dateFormatter"
width="150px"
/>
<el-table-column label="备注" align="center" prop="remark" width="150px" />
<el-table-column
label="创建时间"
align="center"
prop="createTime"
:formatter="dateFormatter"
width="150px"
/>
<el-table-column label="创建者ID" align="center" prop="creator" width="150px" />
<el-table-column label="操作" align="center" width="150px" fixed="right">
<template #default="scope">
<el-button
link
type="primary"
@click="openForm('update', scope.row.id)"
v-hasPermi="['wms:warehouse:update']"
>
编辑
</el-button>
<el-button
link
type="danger"
@click="handleDelete(scope.row.id)"
v-hasPermi="['wms:warehouse:delete']"
>
删除
</el-button>
</template>
</el-table-column>
</el-table>
<!-- 分页 -->
<Pagination
:total="total"
v-model:page="queryParams.pageNo"
v-model:limit="queryParams.pageSize"
@pagination="getList"
/>
<Table
:columns="Warehouse.allSchemas.tableColumns"
:data="tableObject.tableList"
:loading="tableObject.loading"
:pagination="{
total: tableObject.total
}"
v-model:pageSize="tableObject.pageSize"
v-model:currentPage="tableObject.currentPage"
v-model:sort="tableObject.sort"
>
<template #code="{row}">
<el-button type="primary" link @click="openDetail(row, '代码', row.code)">
<span>{{ row.code }}</span>
</el-button>
</template>
<template #action="{ row }">
<ButtonBase :Butttondata="butttondata" @button-base-click="buttonTableClick($event,row)" />
</template>
</Table>
</ContentWrap>
<!-- 表单弹窗添加/修改 -->
<WarehouseForm ref="formRef" @success="getList" />
<BasicForm
ref="basicFormRef"
@success="getList"
:rules="WarehouseRules"
:formAllSchemas="Warehouse.allSchemas"
searchTableTitle="物料基础信息"
:searchTableAllSchemas="ItemBasic.allSchemas"
:searchTablePage="ItembasicApi.getItembasicPage"
:apiUpdate="WarehouseApi.updateWarehouse"
:apiCreate="WarehouseApi.createWarehouse"
/>
<!-- 详情 -->
<Detail ref="detailRef" :isBasic="true" :allSchemas="Warehouse.allSchemas" />
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/wms/warehouse/import" :importTemplateData="importTemplateData" @success="importSuccess" />
</template>
<script setup lang="ts">
import { DICT_TYPE, getStrDictOptions, getIntDictOptions } from '@/utils/dict'
import { dateFormatter } from '@/utils/formatTime'
import download from '@/utils/download'
import * as WarehouseApi from '@/api/wms/warehouse'
import WarehouseForm from './WarehouseForm.vue'
import * as ItembasicApi from '@/api/wms/itembasic'
import BasicForm from '@/components/BasicForm/src/BasicForm.vue'
import { Warehouse, WarehouseRules, ItemBasic } from '@/utils/disposition/tableColumns'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import TableHead from '@/components/TableHead/src/TableHead.vue'
import ImportForm from '@/components/ImportForm/src/ImportForm.vue'
import Detail from '@/components/Detail/src/Detail.vue'
defineOptions({ name: 'Warehouse' })
const message = useMessage() //
const { t } = useI18n() //
const loading = ref(true) //
const total = ref(0) //
const list = ref([]) //
const queryParams = reactive({
pageNo: 1,
pageSize: 10,
code: null,
name: null,
description: null,
type: null,
available: null,
activeTime: [],
expireTime: [],
remark: null,
createTime: [],
creator: null
const { tableObject, tableMethods } = useTable({
getListApi: WarehouseApi.getWarehousePage //
})
const queryFormRef = ref() //
const exportLoading = ref(false) //
/** 查询列表 */
const getList = async () => {
loading.value = true
try {
const data = await WarehouseApi.getWarehousePage(queryParams)
list.value = data.list
total.value = data.total
} finally {
loading.value = false
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultAddBtn({hasPermi:'wms:warehouse:create'}), //
defaultButtons.defaultImportBtn({hasPermi:'wms:warehouse:import'}), //
defaultButtons.defaultExportBtn({hasPermi:'wms:warehouse:export'}), //
// defaultButtons.defaultFilterBtn(), //
defaultButtons.defaultFreshBtn(null), //
// {
// label: '',
// name: 'zdy',
// hide: false,
// type: 'primary',
// icon: 'Select',
// color: ''
// },
]
//
const buttonBaseClick = (val, item) => {
if (val == 'add') { //
openForm('create')
} else if (val == 'import') { //
handleImport()
} else if (val == 'export') { //
handleExport()
} else if (val == 'refresh') { //
getList()
} else if (val == 'filtrate') { //
} else { //
console.log('其他按钮', item)
}
}
/** 搜索按钮操作 */
const handleQuery = () => {
queryParams.pageNo = 1
getList()
}
// -
const butttondata = [
defaultButtons.mainListEditBtn({hasPermi:'wms:warehouse:update'}), //
defaultButtons.mainListDeleteBtn({hasPermi:'wms:warehouse:delete'}), //
]
/** 重置按钮操作 */
const resetQuery = () => {
queryFormRef.value.resetFields()
handleQuery()
// -
const buttonTableClick = async (val, row) => {
if (val == 'edit') { //
// const res = await WarehouseApi.getItempackaging(row.id)
openForm('update', row)
} else if (val == 'delete') { //
handleDelete(row.id)
}
}
/** 添加/修改操作 */
const formRef = ref()
const openForm = (type: string, id?: number) => {
formRef.value.open(type, id)
const basicFormRef = ref()
const openForm = (type: string, row?: any) => {
basicFormRef.value.open(type, row)
}
/** 详情操作 */
const detailRef = ref()
const openDetail = (row: any, titleName: any, titleValue: any) => {
detailRef.value.openDetail(row, titleName, titleValue)
}
/** 删除按钮操作 */
@ -273,13 +149,14 @@ const handleDelete = async (id: number) => {
}
/** 导出按钮操作 */
const exportLoading = ref(false) //
const handleExport = async () => {
try {
//
await message.exportConfirm()
//
exportLoading.value = true
const data = await WarehouseApi.exportWarehouse(queryParams)
const data = await WarehouseApi.exportWarehouse(setSearchParams)
download.excel(data, '仓库.xls')
} catch {
} finally {
@ -287,6 +164,21 @@ const handleExport = async () => {
}
}
/** 导入 */
const importFormRef = ref()
const handleImport = () => {
importFormRef.value.open()
}
//
const importTemplateData = reactive({
templateUrl: '',
templateTitle: '仓库导入模版.xls'
})
//
const importSuccess = () => {
getList()
}
/** 初始化 **/
onMounted(() => {
getList()

348
src/views/wms/workshop/index.vue

@ -1,258 +1,138 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<el-form
class="-mb-15px"
:model="queryParams"
ref="queryFormRef"
:inline="true"
label-width="68px"
>
<el-form-item label="代码" prop="code">
<el-input
v-model="queryParams.code"
placeholder="请输入代码"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="名称" prop="name">
<el-input
v-model="queryParams.name"
placeholder="请输入名称"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="类型" prop="type">
<el-select v-model="queryParams.type" placeholder="请选择类型" clearable class="!w-240px">
<el-option
v-for="dict in getStrDictOptions(DICT_TYPE.WORKSHOP_TYPE)"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item label="是否可用" prop="available">
<el-select
v-model="queryParams.available"
placeholder="请选择是否可用"
clearable
class="!w-240px"
>
<el-option
v-for="dict in getIntDictOptions(DICT_TYPE.TRUE_FALSE)"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item label="生效时间" prop="activeTime">
<el-date-picker
v-model="queryParams.activeTime"
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-240px"
/>
</el-form-item>
<el-form-item label="失效时间" prop="expireTime">
<el-date-picker
v-model="queryParams.expireTime"
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-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-240px"
/>
</el-form-item>
<el-form-item label="创建者ID" prop="creator">
<el-input
v-model="queryParams.creator"
placeholder="请输入创建者ID"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item>
<el-button type="info" plain @click="handleQuery"><Icon icon="ep:search" class="mr-5px" /> 搜索</el-button>
<el-button type="info" plain @click="resetQuery"><Icon icon="ep:refresh" class="mr-5px" /> 重置</el-button>
<el-button type="primary" @click="openForm('create')" v-hasPermi="['wms:workshop:create']">
<Icon icon="ep:plus" class="mr-5px" /> 新增
</el-button>
<el-button
type="success"
@click="handleExport"
:loading="exportLoading"
v-hasPermi="['wms:workshop:export']"
>
<Icon icon="ep:download" class="mr-5px" /> 导出
</el-button>
</el-form-item>
</el-form>
<Search :schema="Workshop.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
</ContentWrap>
<!-- 列表头部 -->
<TableHead :HeadButttondata="HeadButttondata" @button-base-click="buttonBaseClick" />
<!-- 列表 -->
<ContentWrap>
<el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true">
<el-table-column label="代码" align="center" prop="code" width="150px" />
<el-table-column label="名称" align="center" prop="name" width="150px" />
<el-table-column label="描述" align="center" prop="description" width="150px" />
<el-table-column label="类型" align="center" prop="type" width="150px">
<template #default="scope">
<dict-tag :type="DICT_TYPE.WORKSHOP_TYPE" :value="scope.row.type" />
</template>
</el-table-column>
<el-table-column label="是否可用" align="center" prop="available" width="150px">
<template #default="scope">
<dict-tag :type="DICT_TYPE.TRUE_FALSE" :value="scope.row.available" />
</template>
</el-table-column>
<el-table-column
label="生效时间"
align="center"
prop="activeTime"
:formatter="dateFormatter"
width="150px"
/>
<el-table-column
label="失效时间"
align="center"
prop="expireTime"
:formatter="dateFormatter"
width="150px"
/>
<el-table-column label="备注" align="center" prop="remark" width="150px" />
<el-table-column
label="创建时间"
align="center"
prop="createTime"
:formatter="dateFormatter"
width="150px"
/>
<el-table-column label="创建者ID" align="center" prop="creator" width="150px" />
<el-table-column label="操作" align="center" width="150px" fixed="right">
<template #default="scope">
<el-button
link
type="primary"
@click="openForm('update', scope.row.id)"
v-hasPermi="['wms:workshop:update']"
>
编辑
</el-button>
<el-button
link
type="danger"
@click="handleDelete(scope.row.id)"
v-hasPermi="['wms:workshop:delete']"
>
删除
</el-button>
</template>
</el-table-column>
</el-table>
<!-- 分页 -->
<Pagination
:total="total"
v-model:page="queryParams.pageNo"
v-model:limit="queryParams.pageSize"
@pagination="getList"
/>
<Table
:columns="Workshop.allSchemas.tableColumns"
:data="tableObject.tableList"
:loading="tableObject.loading"
:pagination="{
total: tableObject.total
}"
v-model:pageSize="tableObject.pageSize"
v-model:currentPage="tableObject.currentPage"
v-model:sort="tableObject.sort"
>
<template #code="{row}">
<el-button type="primary" link @click="openDetail(row, '代码', row.code)">
<span>{{ row.code }}</span>
</el-button>
</template>
<template #action="{ row }">
<ButtonBase :Butttondata="butttondata" @button-base-click="buttonTableClick($event,row)" />
</template>
</Table>
</ContentWrap>
<!-- 表单弹窗添加/修改 -->
<WorkshopForm ref="formRef" @success="getList" />
<BasicForm
ref="basicFormRef"
@success="getList"
:rules="WorkshopRules"
:formAllSchemas="Workshop.allSchemas"
searchTableTitle="物料基础信息"
:searchTableAllSchemas="ItemBasic.allSchemas"
:searchTablePage="ItembasicApi.getItembasicPage"
:apiUpdate="WorkshopApi.updateWorkshop"
:apiCreate="WorkshopApi.createWorkshop"
/>
<!-- 详情 -->
<Detail ref="detailRef" :isBasic="true" :allSchemas="Workshop.allSchemas" />
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/wms/workshop/import" :importTemplateData="importTemplateData" @success="importSuccess" />
</template>
<script setup lang="ts">
import { DICT_TYPE, getStrDictOptions, getIntDictOptions } from '@/utils/dict'
import { dateFormatter } from '@/utils/formatTime'
import download from '@/utils/download'
import * as WorkshopApi from '@/api/wms/workshop'
import WorkshopForm from './WorkshopForm.vue'
import * as ItembasicApi from '@/api/wms/itembasic'
import BasicForm from '@/components/BasicForm/src/BasicForm.vue'
import { Workshop, WorkshopRules, ItemBasic } from '@/utils/disposition/tableColumns'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import TableHead from '@/components/TableHead/src/TableHead.vue'
import ImportForm from '@/components/ImportForm/src/ImportForm.vue'
import Detail from '@/components/Detail/src/Detail.vue'
defineOptions({ name: 'Workshop' })
const message = useMessage() //
const { t } = useI18n() //
const loading = ref(true) //
const total = ref(0) //
const list = ref([]) //
const queryParams = reactive({
pageNo: 1,
pageSize: 10,
code: null,
name: null,
description: null,
type: null,
available: null,
activeTime: [],
expireTime: [],
remark: null,
createTime: [],
creator: null
const { tableObject, tableMethods } = useTable({
getListApi: WorkshopApi.getWorkshopPage //
})
const queryFormRef = ref() //
const exportLoading = ref(false) //
/** 查询列表 */
const getList = async () => {
loading.value = true
try {
const data = await WorkshopApi.getWorkshopPage(queryParams)
list.value = data.list
total.value = data.total
} finally {
loading.value = false
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultAddBtn({hasPermi:'wms:workshop:create'}), //
defaultButtons.defaultImportBtn({hasPermi:'wms:workshop:import'}), //
defaultButtons.defaultExportBtn({hasPermi:'wms:workshop:export'}), //
// defaultButtons.defaultFilterBtn(), //
defaultButtons.defaultFreshBtn(null), //
// {
// label: '',
// name: 'zdy',
// hide: false,
// type: 'primary',
// icon: 'Select',
// color: ''
// },
]
//
const buttonBaseClick = (val, item) => {
if (val == 'add') { //
openForm('create')
} else if (val == 'import') { //
handleImport()
} else if (val == 'export') { //
handleExport()
} else if (val == 'refresh') { //
getList()
} else if (val == 'filtrate') { //
} else { //
console.log('其他按钮', item)
}
}
/** 搜索按钮操作 */
const handleQuery = () => {
queryParams.pageNo = 1
getList()
}
// -
const butttondata = [
defaultButtons.mainListEditBtn({hasPermi:'wms:workshop:update'}), //
defaultButtons.mainListDeleteBtn({hasPermi:'wms:workshop:delete'}), //
]
/** 重置按钮操作 */
const resetQuery = () => {
queryFormRef.value.resetFields()
handleQuery()
// -
const buttonTableClick = async (val, row) => {
if (val == 'edit') { //
// const res = await WorkshopApi.getItempackaging(row.id)
openForm('update', row)
} else if (val == 'delete') { //
handleDelete(row.id)
}
}
/** 添加/修改操作 */
const formRef = ref()
const openForm = (type: string, id?: number) => {
formRef.value.open(type, id)
const basicFormRef = ref()
const openForm = (type: string, row?: any) => {
basicFormRef.value.open(type, row)
}
/** 详情操作 */
const detailRef = ref()
const openDetail = (row: any, titleName: any, titleValue: any) => {
detailRef.value.openDetail(row, titleName, titleValue)
}
/** 删除按钮操作 */
@ -269,13 +149,14 @@ const handleDelete = async (id: number) => {
}
/** 导出按钮操作 */
const exportLoading = ref(false) //
const handleExport = async () => {
try {
//
await message.exportConfirm()
//
exportLoading.value = true
const data = await WorkshopApi.exportWorkshop(queryParams)
const data = await WorkshopApi.exportWorkshop(setSearchParams)
download.excel(data, '车间.xls')
} catch {
} finally {
@ -283,6 +164,21 @@ const handleExport = async () => {
}
}
/** 导入 */
const importFormRef = ref()
const handleImport = () => {
importFormRef.value.open()
}
//
const importTemplateData = reactive({
templateUrl: '',
templateTitle: '车间导入模版.xls'
})
//
const importSuccess = () => {
getList()
}
/** 初始化 **/
onMounted(() => {
getList()

411
src/views/wms/workstation/index.vue

@ -1,323 +1,138 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<el-form
class="-mb-15px"
:model="queryParams"
ref="queryFormRef"
:inline="true"
label-width="68px"
>
<el-form-item label="代码" prop="code">
<el-input
v-model="queryParams.code"
placeholder="请输入代码"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="名称" prop="name">
<el-input
v-model="queryParams.name"
placeholder="请输入名称"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="类型" prop="type">
<el-select v-model="queryParams.type" placeholder="请选择类型" clearable class="!w-240px">
<el-option
v-for="dict in getStrDictOptions(DICT_TYPE.WORK_STATION_TYPE)"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item label="车间代码" prop="workshopCode">
<el-input
v-model="queryParams.workshopCode"
placeholder="请输入车间代码"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="生产线代码" prop="productionLineCode">
<el-input
v-model="queryParams.productionLineCode"
placeholder="请输入生产线代码"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="原料库位" prop="rawLocationCode">
<el-input
v-model="queryParams.rawLocationCode"
placeholder="请输入原料库位"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="成品库位" prop="fgLocationCode">
<el-input
v-model="queryParams.fgLocationCode"
placeholder="请输入成品库位"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="是否可用" prop="available">
<el-select
v-model="queryParams.available"
placeholder="请选择是否可用"
clearable
class="!w-240px"
>
<el-option
v-for="dict in getStrDictOptions(DICT_TYPE.TRUE_FALSE)"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item label="生效时间" prop="activeTime">
<el-date-picker
v-model="queryParams.activeTime"
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-240px"
/>
</el-form-item>
<el-form-item label="失效时间" prop="expireTime">
<el-date-picker
v-model="queryParams.expireTime"
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-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-240px"
/>
</el-form-item>
<el-form-item label="创建者ID" prop="creator">
<el-input
v-model="queryParams.creator"
placeholder="请输入创建者ID"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item>
<el-button type="info" plain @click="handleQuery"><Icon icon="ep:search" class="mr-5px" /> 搜索</el-button>
<el-button type="info" plain @click="resetQuery"><Icon icon="ep:refresh" class="mr-5px" /> 重置</el-button>
<el-button
type="primary"
@click="openForm('create')"
v-hasPermi="['wms:workstation:create']"
>
<Icon icon="ep:plus" class="mr-5px" /> 新增
</el-button>
<el-button
type="warning"
@click="handleImport"
v-hasPermi="['wms:workstation:import']">
<Icon icon="ep:upload" /> 导入
</el-button>
<el-button
type="success"
@click="handleExport"
:loading="exportLoading"
v-hasPermi="['wms:workstation:export']"
>
<Icon icon="ep:download" class="mr-5px" /> 导出
</el-button>
</el-form-item>
</el-form>
<Search :schema="Workstation.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
</ContentWrap>
<!-- 列表头部 -->
<TableHead :HeadButttondata="HeadButttondata" @button-base-click="buttonBaseClick" />
<!-- 列表 -->
<ContentWrap>
<el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true">
<el-table-column label="代码" align="center" prop="code" width="150px" />
<el-table-column label="名称" align="center" prop="name" width="150px" />
<el-table-column label="描述" align="center" prop="description" width="150px" />
<el-table-column label="类型" align="center" prop="type" width="150px">
<template #default="scope">
<dict-tag :type="DICT_TYPE.WORK_STATION_TYPE" :value="scope.row.type" />
</template>
</el-table-column>
<el-table-column label="车间代码" align="center" prop="workshopCode" width="150px" />
<el-table-column label="生产线代码" align="center" prop="productionLineCode" width="150px" />
<el-table-column label="原料库位" align="center" prop="rawLocationCode" width="150px" />
<el-table-column label="成品库位" align="center" prop="fgLocationCode" width="150px" />
<el-table-column label="是否可用" align="center" prop="available" width="150px">
<template #default="scope">
<dict-tag :type="DICT_TYPE.TRUE_FALSE" :value="scope.row.available" />
</template>
</el-table-column>
<el-table-column
label="生效时间"
align="center"
prop="activeTime"
:formatter="dateFormatter"
width="150px"
/>
<el-table-column
label="失效时间"
align="center"
prop="expireTime"
:formatter="dateFormatter"
width="150px"
/>
<el-table-column label="备注" align="center" prop="remark" width="150px" />
<el-table-column
label="创建时间"
align="center"
prop="createTime"
:formatter="dateFormatter"
width="150px"
/>
<el-table-column label="创建者ID" align="center" prop="creator" width="150px" />
<el-table-column label="操作" align="center" width="150px" fixed="right">
<template #default="scope">
<el-button
link
type="primary"
@click="openForm('update', scope.row.id)"
v-hasPermi="['wms:workstation:update']"
>
编辑
</el-button>
<el-button
link
type="danger"
@click="handleDelete(scope.row.id)"
v-hasPermi="['wms:workstation:delete']"
>
删除
</el-button>
</template>
</el-table-column>
</el-table>
<!-- 分页 -->
<Pagination
:total="total"
v-model:page="queryParams.pageNo"
v-model:limit="queryParams.pageSize"
@pagination="getList"
/>
<Table
:columns="Workstation.allSchemas.tableColumns"
:data="tableObject.tableList"
:loading="tableObject.loading"
:pagination="{
total: tableObject.total
}"
v-model:pageSize="tableObject.pageSize"
v-model:currentPage="tableObject.currentPage"
v-model:sort="tableObject.sort"
>
<template #code="{row}">
<el-button type="primary" link @click="openDetail(row, '代码', row.code)">
<span>{{ row.code }}</span>
</el-button>
</template>
<template #action="{ row }">
<ButtonBase :Butttondata="butttondata" @button-base-click="buttonTableClick($event,row)" />
</template>
</Table>
</ContentWrap>
<!-- 表单弹窗添加/修改 -->
<WorkstationForm ref="formRef" @success="getList" />
<BasicForm
ref="basicFormRef"
@success="getList"
:rules="WorkstationRules"
:formAllSchemas="Workstation.allSchemas"
searchTableTitle="物料基础信息"
:searchTableAllSchemas="ItemBasic.allSchemas"
:searchTablePage="ItembasicApi.getItembasicPage"
:apiUpdate="WorkstationApi.updateWorkstation"
:apiCreate="WorkstationApi.createWorkstation"
/>
<!-- 用户导入对话框 -->
<WorkstationImportForm ref="importFormRef" @success="getList" />
<!-- 详情 -->
<Detail ref="detailRef" :isBasic="true" :allSchemas="Workstation.allSchemas" />
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/wms/workstation/import" :importTemplateData="importTemplateData" @success="importSuccess" />
</template>
<script setup lang="ts">
import { DICT_TYPE, getStrDictOptions} from '@/utils/dict'
import { dateFormatter } from '@/utils/formatTime'
import download from '@/utils/download'
import * as WorkstationApi from '@/api/wms/workstation'
import WorkstationForm from './WorkstationForm.vue'
import WorkstationImportForm from './WorkstationImportForm.vue'
import * as ItembasicApi from '@/api/wms/itembasic'
import BasicForm from '@/components/BasicForm/src/BasicForm.vue'
import { Workstation, WorkstationRules, ItemBasic } from '@/utils/disposition/tableColumns'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import TableHead from '@/components/TableHead/src/TableHead.vue'
import ImportForm from '@/components/ImportForm/src/ImportForm.vue'
import Detail from '@/components/Detail/src/Detail.vue'
defineOptions({ name: 'Workstation' })
const message = useMessage() //
const { t } = useI18n() //
const loading = ref(true) //
const total = ref(0) //
const list = ref([]) //
const queryParams = reactive({
pageNo: 1,
pageSize: 10,
code: null,
name: null,
description: null,
type: null,
workshopCode: null,
productionLineCode: null,
rawLocationCode: null,
fgLocationCode: null,
available: null,
activeTime: [],
expireTime: [],
remark: null,
createTime: [],
creator: null
const { tableObject, tableMethods } = useTable({
getListApi: WorkstationApi.getWorkstationPage //
})
const queryFormRef = ref() //
const exportLoading = ref(false) //
/** 查询列表 */
const getList = async () => {
loading.value = true
try {
const data = await WorkstationApi.getWorkstationPage(queryParams)
list.value = data.list
total.value = data.total
} finally {
loading.value = false
}
}
//
const { getList, setSearchParams } = tableMethods
/** 搜索按钮操作 */
const handleQuery = () => {
queryParams.pageNo = 1
getList()
}
//
const HeadButttondata = [
defaultButtons.defaultAddBtn({hasPermi:'wms:workstation:create'}), //
defaultButtons.defaultImportBtn({hasPermi:'wms:workstation:import'}), //
defaultButtons.defaultExportBtn({hasPermi:'wms:workstation:export'}), //
// defaultButtons.defaultFilterBtn(), //
defaultButtons.defaultFreshBtn(null), //
// {
// label: '',
// name: 'zdy',
// hide: false,
// type: 'primary',
// icon: 'Select',
// color: ''
// },
]
/** 重置按钮操作 */
const resetQuery = () => {
queryFormRef.value.resetFields()
handleQuery()
//
const buttonBaseClick = (val, item) => {
if (val == 'add') { //
openForm('create')
} else if (val == 'import') { //
handleImport()
} else if (val == 'export') { //
handleExport()
} else if (val == 'refresh') { //
getList()
} else if (val == 'filtrate') { //
} else { //
console.log('其他按钮', item)
}
}
/** 用户导入 */
const importFormRef = ref()
const handleImport = () => {
importFormRef.value.open()
// -
const butttondata = [
defaultButtons.mainListEditBtn({hasPermi:'wms:workstation:update'}), //
defaultButtons.mainListDeleteBtn({hasPermi:'wms:workstation:delete'}), //
]
// -
const buttonTableClick = async (val, row) => {
if (val == 'edit') { //
// const res = await WorkstationApi.getItempackaging(row.id)
openForm('update', row)
} else if (val == 'delete') { //
handleDelete(row.id)
}
}
/** 添加/修改操作 */
const formRef = ref()
const openForm = (type: string, id?: number) => {
console.log(id)
formRef.value.open(type, id)
const basicFormRef = ref()
const openForm = (type: string, row?: any) => {
basicFormRef.value.open(type, row)
}
/** 详情操作 */
const detailRef = ref()
const openDetail = (row: any, titleName: any, titleValue: any) => {
detailRef.value.openDetail(row, titleName, titleValue)
}
/** 删除按钮操作 */
@ -334,13 +149,14 @@ const handleDelete = async (id: number) => {
}
/** 导出按钮操作 */
const exportLoading = ref(false) //
const handleExport = async () => {
try {
//
await message.exportConfirm()
//
exportLoading.value = true
const data = await WorkstationApi.exportWorkstation(queryParams)
const data = await WorkstationApi.exportWorkstation(setSearchParams)
download.excel(data, '工位.xls')
} catch {
} finally {
@ -348,6 +164,21 @@ const handleExport = async () => {
}
}
/** 导入 */
const importFormRef = ref()
const handleImport = () => {
importFormRef.value.open()
}
//
const importTemplateData = reactive({
templateUrl: '',
templateTitle: '工位导入模版.xls'
})
//
const importSuccess = () => {
getList()
}
/** 初始化 **/
onMounted(() => {
getList()

Loading…
Cancel
Save