|
@@ -4,24 +4,24 @@
|
|
|
<a-row :gutter="24">
|
|
|
<a-col :span="6">
|
|
|
<a-form-item label="货品名称" name="goodsName">
|
|
|
- <a-input v-model:value="searchFormState.goodsName" placeholder="查询货品名称" />
|
|
|
+ <a-input v-model:value="searchFormState.goodsName" placeholder="查询货品名称" allow-clear />
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
<a-col :span="9">
|
|
|
<a-form-item label="提货开始时间" name="confStartTime">
|
|
|
- <a-range-picker v-model:value="searchFormState.confStartTime" value-format="YYYY-MM-DD HH:mm" show-time />
|
|
|
+ <a-range-picker v-model:value="searchFormState.confStartTime" value-format="YYYY-MM-DD HH:mm" show-time allow-clear />
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
<a-col :span="9">
|
|
|
<a-form-item label="提货结束时间" name="confEndTime">
|
|
|
- <a-range-picker v-model:value="searchFormState.confEndTime" value-format="YYYY-MM-DD HH:mm" show-time />
|
|
|
+ <a-range-picker v-model:value="searchFormState.confEndTime" value-format="YYYY-MM-DD HH:mm" show-time allow-clear />
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
</a-row>
|
|
|
<a-row :gutter="24">
|
|
|
<a-col :span="6">
|
|
|
<a-form-item label="货品编码" name="goodsCode">
|
|
|
- <a-input v-model:value="searchFormState.goodsCode" placeholder="查询货品名称" />
|
|
|
+ <a-input v-model:value="searchFormState.goodsCode" placeholder="查询货品名称" allow-clear />
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
<a-col :span="9"></a-col>
|
|
@@ -49,15 +49,22 @@
|
|
|
<template v-if="column.dataIndex === 'serial'">
|
|
|
{{ index + 1 }}
|
|
|
</template>
|
|
|
+ <template v-if="column.dataIndex === 'confWeight'">
|
|
|
+ {{ record.confWeight / 1000 }}
|
|
|
+ </template>
|
|
|
+ <template v-if="column.dataIndex === 'usedWeight'">
|
|
|
+ {{ record.usedWeight / 1000 }}
|
|
|
+ </template>
|
|
|
+ <template v-if="column.dataIndex === 'lastWeight'">
|
|
|
+ {{ record.lastWeight / 1000 }}
|
|
|
+ </template>
|
|
|
<template v-if="column.dataIndex === 'action'">
|
|
|
<a-space>
|
|
|
<a @click="editFormRef.onOpen(record)" v-if="hasPerm('goodsConfEdit') && Number(record.usedWeight) == 0">编辑</a>
|
|
|
|
|
|
<a-divider type="vertical" v-if="hasPerm(['goodsConfEdit', 'goodsConfDelete'], 'and') && Number(record.usedWeight) == 0" />
|
|
|
- <a-popconfirm title="确定要删除吗?" @confirm="deleteGoodsConf(record)">
|
|
|
- <a-button type="link" danger size="small" v-if="hasPerm('goodsConfDelete') && Number(record.usedWeight) == 0">删除</a-button>
|
|
|
- </a-popconfirm>
|
|
|
-
|
|
|
+ <a-button type="link" danger size="small" v-if="hasPerm('goodsConfDelete')" @click="deleteConfig(record)">删除</a-button>
|
|
|
+
|
|
|
<a-divider type="vertical" v-if="(hasPerm(['goodsConfEdit', 'goodsConfDelete'], 'or') && Number(record.usedWeight) == 0) && hasPerm('goodsConfWeight')" />
|
|
|
<a @click="weightFormRef.onOpen(record)" v-if="hasPerm('goodsConfWeight')">重量</a>
|
|
|
</a-space>
|
|
@@ -76,6 +83,9 @@
|
|
|
import EditForm from './editForm.vue'
|
|
|
import WeightForm from './weightForm.vue'
|
|
|
import goodsConfApi from '@/api/biz/goodsConfApi'
|
|
|
+ import {ExclamationCircleOutlined} from '@ant-design/icons-vue';
|
|
|
+ import {Modal} from 'ant-design-vue';
|
|
|
+ import {createVNode} from 'vue';
|
|
|
|
|
|
const searchFormState = ref({})
|
|
|
const searchFormRef = ref()
|
|
@@ -83,6 +93,7 @@
|
|
|
const addFormRef = ref()
|
|
|
const editFormRef = ref()
|
|
|
const weightFormRef = ref()
|
|
|
+ const submitLoading = ref(false)
|
|
|
|
|
|
const toolConfig = { refresh: true, height: true, columnSetting: true, striped: false }
|
|
|
const columns = [
|
|
@@ -122,19 +133,19 @@
|
|
|
align:'center'
|
|
|
},
|
|
|
{
|
|
|
- title: '可提重量(KG)',
|
|
|
+ title: '可提重量(吨)',
|
|
|
width: 110,
|
|
|
dataIndex: 'confWeight',
|
|
|
align:'center'
|
|
|
},
|
|
|
{
|
|
|
- title: '已提重量(KG)',
|
|
|
+ title: '已提重量(吨)',
|
|
|
width: 110,
|
|
|
dataIndex: 'usedWeight',
|
|
|
align:'center'
|
|
|
},
|
|
|
{
|
|
|
- title: '剩余重量(KG)',
|
|
|
+ title: '剩余重量(吨)',
|
|
|
width: 110,
|
|
|
dataIndex: 'lastWeight',
|
|
|
align:'center'
|
|
@@ -189,20 +200,29 @@
|
|
|
tableRef.value.refresh(true)
|
|
|
}
|
|
|
// 删除
|
|
|
- const deleteGoodsConf = (record) => {
|
|
|
- let params = [
|
|
|
- {
|
|
|
- id: record.id
|
|
|
- }
|
|
|
- ]
|
|
|
- goodsConfApi.goodsConfDelete(params).then(() => {
|
|
|
- tableRef.value.refresh(true)
|
|
|
- })
|
|
|
- }
|
|
|
- // 批量删除
|
|
|
- const deleteBatchGoodsConf = (params) => {
|
|
|
- goodsConfApi.goodsConfDelete(params).then(() => {
|
|
|
- tableRef.value.clearRefreshSelected()
|
|
|
+ const deleteConfig = (record) => {
|
|
|
+ Modal.confirm({
|
|
|
+ title: '确定删除该数据吗?',
|
|
|
+ icon: createVNode(ExclamationCircleOutlined),
|
|
|
+ content: '',
|
|
|
+ onOk() {
|
|
|
+ submitLoading.value = true
|
|
|
+ let params = [
|
|
|
+ {
|
|
|
+ id: record.id
|
|
|
+ }
|
|
|
+ ]
|
|
|
+
|
|
|
+ goodsConfApi
|
|
|
+ .goodsConfDelete(params)
|
|
|
+ .then(() => {
|
|
|
+ tableRef.value.refresh(true)
|
|
|
+ })
|
|
|
+ .finally(() => {
|
|
|
+ submitLoading.value = false
|
|
|
+ })
|
|
|
+ },
|
|
|
+ onCancel() {}
|
|
|
})
|
|
|
}
|
|
|
</script>
|