|
@@ -3,18 +3,23 @@
|
|
|
<a-form ref="searchFormRef" name="advanced_search" :model="searchFormState" class="ant-advanced-search-form">
|
|
|
<a-row :gutter="24">
|
|
|
<a-col :span="6">
|
|
|
- <a-form-item label="货品名称" name="name">
|
|
|
- <a-input v-model:value="searchFormState.name" placeholder="请输入货品名称" />
|
|
|
+ <a-form-item label="货品名称" name="goodsCode">
|
|
|
+ <a-input v-model:value="searchFormState.goodsCode" placeholder="请输入货品名称" />
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
<a-col :span="6">
|
|
|
- <a-form-item label="货品规格" name="model">
|
|
|
- <a-input v-model:value="searchFormState.model" placeholder="请输入货品规格" />
|
|
|
+ <a-form-item label="货品规格" name="goodsModel">
|
|
|
+ <a-input v-model:value="searchFormState.goodsModel" placeholder="请输入货品规格" />
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
<a-col :span="6">
|
|
|
<a-button type="primary" @click="tableRef.refresh()">查询</a-button>
|
|
|
<a-button style="margin: 0 8px" @click="reset">重置</a-button>
|
|
|
+
|
|
|
+ <a-button type="primary" @click="formRef.onOpen()" v-if="hasPerm('goodsAdd')">
|
|
|
+ <template #icon><plus-outlined /></template>
|
|
|
+ 新增
|
|
|
+ </a-button>
|
|
|
</a-col>
|
|
|
</a-row>
|
|
|
</a-form>
|
|
@@ -25,23 +30,16 @@
|
|
|
bordered
|
|
|
:row-key="(record) => record.id"
|
|
|
>
|
|
|
- <template #operator class="table-operator">
|
|
|
- <a-space>
|
|
|
- <a-button type="primary" @click="formRef.onOpen()" v-if="hasPerm('bizGoodsAdd')">
|
|
|
- <template #icon><plus-outlined /></template>
|
|
|
- 新增
|
|
|
- </a-button>
|
|
|
- </a-space>
|
|
|
- </template>
|
|
|
<template #bodyCell="{ column, record, index }">
|
|
|
<template v-if="column.dataIndex === 'serial'">
|
|
|
{{ index + 1 }}
|
|
|
</template>
|
|
|
<template v-if="column.dataIndex === 'action'">
|
|
|
<a-space>
|
|
|
- <a @click="formRef.onOpen(record)" v-if="hasPerm('bizGoodsEdit')">编辑</a>
|
|
|
- <a-divider type="vertical" v-if="hasPerm(['bizGoodsEdit', 'bizGoodsDelete'], 'and')" />
|
|
|
- <a-button type="link" danger size="small" v-if="hasPerm('bizGoodsDelete')" @click="deleteConfig(record)">删除</a-button>
|
|
|
+ <a @click="formRef.onOpen(record)" v-if="hasPerm('goodsEdit')">编辑</a>
|
|
|
+
|
|
|
+ <a-divider type="vertical" v-if="hasPerm(['goodsEdit', 'goodsDelete'], 'and')" />
|
|
|
+ <a-button type="link" danger size="small" v-if="hasPerm('goodsDelete')" @click="deleteConfig(record)">删除</a-button>
|
|
|
</a-space>
|
|
|
</template>
|
|
|
</template>
|
|
@@ -53,7 +51,7 @@
|
|
|
<script setup name="goods">
|
|
|
import { cloneDeep } from 'lodash-es'
|
|
|
import Form from './form.vue'
|
|
|
- import bizGoodsApi from '@/api/biz/bizGoodsApi'
|
|
|
+ import goodsApi from '@/api/biz/goodsApi'
|
|
|
import {ExclamationCircleOutlined} from '@ant-design/icons-vue';
|
|
|
import {Modal} from 'ant-design-vue';
|
|
|
import {createVNode} from 'vue';
|
|
@@ -67,27 +65,34 @@
|
|
|
const columns = [
|
|
|
{
|
|
|
title: '序号',
|
|
|
- width: 80,
|
|
|
+ width: 50,
|
|
|
dataIndex: 'serial',
|
|
|
align:'center'
|
|
|
},
|
|
|
+ {
|
|
|
+ title: '货品编码',
|
|
|
+ width: 180,
|
|
|
+ dataIndex: 'goodsCode',
|
|
|
+ align:'center'
|
|
|
+ },
|
|
|
{
|
|
|
title: '货品名称',
|
|
|
- dataIndex: 'name',
|
|
|
+ dataIndex: 'goodsName',
|
|
|
align:'center'
|
|
|
},
|
|
|
{
|
|
|
title: '货品规格',
|
|
|
- dataIndex: 'model',
|
|
|
+ width: 180,
|
|
|
+ dataIndex: 'goodsModel',
|
|
|
align:'center'
|
|
|
- }
|
|
|
+ },
|
|
|
]
|
|
|
// 操作栏通过权限判断是否显示
|
|
|
columns.push({
|
|
|
title: '操作',
|
|
|
dataIndex: 'action',
|
|
|
align: 'center',
|
|
|
- width: 150
|
|
|
+ width: 250
|
|
|
})
|
|
|
|
|
|
const selectedRowKeys = ref([])
|
|
@@ -108,7 +113,7 @@
|
|
|
}
|
|
|
const loadData = (parameter) => {
|
|
|
const searchFormParam = cloneDeep(searchFormState.value)
|
|
|
- return bizGoodsApi.bizGoodsPage(Object.assign(parameter, searchFormParam)).then((data) => {
|
|
|
+ return goodsApi.goodsPage(Object.assign(parameter, searchFormParam)).then((data) => {
|
|
|
return data
|
|
|
})
|
|
|
}
|
|
@@ -118,19 +123,7 @@
|
|
|
tableRef.value.refresh(true)
|
|
|
}
|
|
|
// 删除
|
|
|
- const deleteBizGoods = (record) => {
|
|
|
- let params = [
|
|
|
- {
|
|
|
- id: record.id
|
|
|
- }
|
|
|
- ]
|
|
|
- bizGoodsApi.bizGoodsDelete(params).then(() => {
|
|
|
- tableRef.value.refresh(true)
|
|
|
- })
|
|
|
- }
|
|
|
- // 删除
|
|
|
const deleteConfig = (record) => {
|
|
|
-
|
|
|
Modal.confirm({
|
|
|
title: '确定删除该数据吗?',
|
|
|
icon: createVNode(ExclamationCircleOutlined),
|
|
@@ -143,8 +136,8 @@
|
|
|
}
|
|
|
]
|
|
|
|
|
|
- bizGoodsApi
|
|
|
- .bizGoodsDelete(params)
|
|
|
+ goodsApi
|
|
|
+ .goodsDelete(params)
|
|
|
.then(() => {
|
|
|
tableRef.value.refresh(true)
|
|
|
})
|
|
@@ -155,10 +148,4 @@
|
|
|
onCancel() {}
|
|
|
})
|
|
|
}
|
|
|
- // 批量删除
|
|
|
- const deleteBatchBizGoods = (params) => {
|
|
|
- bizGoodsApi.bizGoodsDelete(params).then(() => {
|
|
|
- tableRef.value.clearRefreshSelected()
|
|
|
- })
|
|
|
- }
|
|
|
</script>
|