This commit is contained in:
mkm 2024-08-01 22:41:34 +08:00
parent 4945bbbe62
commit 17b7539d9c
11 changed files with 640 additions and 198 deletions

View File

@ -2,7 +2,8 @@ NODE_ENV = 'development'
VITE_NOW_TYPE = 'dist'
# Base API
VITE_APP_BASE_URL='http://192.168.1.231:8545'
#VITE_APP_BASE_URL='http://192.168.1.231:8545'
# VITE_APP_BASE_URL='https://test-multi-store.lihaink.cn'
# VITE_APP_BASE_URL='https://multi-store.lihaink.cn'
VITE_APP_BASE_URL='http://192.168.1.6:8545'

View File

@ -4,12 +4,19 @@ import request from '@/utils/request'
export function apiPurchaseOrderLists(params: any) {
return request.get({ url: '/purchase_order/purchaseorder/lists', params })
}
// 采购订单详情列表
export function apiPurchaseOrderInfoLists(params: any) {
return request.get({ url: '/purchase_order/purchaseorder/info_lists', params })
}
// 添加采购订单
export function apiPurchaseOrderAdd(params: any) {
return request.post({ url: '/purchase_order/purchaseorder/add', params })
}
// 添加采购订单平台
export function apiPurchaseOrderPlatform(params: any) {
return request.post({ url: '/purchase_order/purchaseorder/platform', params })
}
// 编辑采购订单
export function apiPurchaseOrderEdit(params: any) {
return request.post({ url: '/purchase_order/purchaseorder/edit', params })

View File

@ -0,0 +1,90 @@
<template>
<el-drawer v-model="showDialog" title="订单详情" :size="1000">
<div class="flex items-center justify-between">
<div>门店{{ formData.system_store }}</div>
</div>
<div class="flex items-center justify-between mt-3">
<div>订单编号{{ formData.order_id }}</div>
</div>
<div class="flex items-center justify-between m-4">
<div class="flex flex-col">
<div style="color: gray">订单状态</div>
<div style="color: black">{{ formData.storage_name }}</div>
</div>
<div class="flex flex-col">
<div style="color: gray">实际支付</div>
<div style="color: black">{{ formData.money }}</div>
</div>
<div class="flex flex-col flex-2">
<div style="color: gray">时间</div>
<div style="color: black">{{ formData.create_time }}</div>
</div>
</div>
<el-tabs v-model="activeName" class="demo-tabs" @tab-click="handleClick" type="border-card">
<el-tab-pane label="订单信息" name="second">
<storeTable ref="storeRef"></storeTable>
</el-tab-pane>
</el-tabs>
</el-drawer>
</template>
<script lang="ts" setup name="storeOrderDETAILS">
import { ElMessage, type FormInstance } from 'element-plus'
import Popup from '@/components/popup/index.vue'
import { apiPurchaseOrderDetail } from '@/api/purchase_order'
import { timeFormat } from '@/utils/util'
import moment from 'moment'
import storeTable from './storeTable.vue'
import type { PropType } from 'vue'
import feedback from '@/utils/feedback'
defineProps({
dictData: {
type: Object as PropType<Record<string, any[]>>,
default: () => ({})
}
})
const emit = defineEmits(['success', 'close'])
const formRef = shallowRef<FormInstance>()
const showDialog = ref(false)
const mode = ref('add')
const storeRef = ref(null)
//
const formData = ref({
id: ''
})
//
const setFormData = async (data: Record<any, any>) => {
formData.value = { ...data }
}
const getDetail = async (row: Record<string, any>) => {
formData.value.id = row.id
handleClick({
paneName: activeName.value
})
const data = await apiPurchaseOrderDetail({
id: row.id
})
setFormData(data)
}
const activeName = ref('second')
const handleClick = (tab: any) => {
console.log(tab.paneName)
if (tab.paneName == 'second') storeRef.value?.getList({ oid: formData.value.id })
}
//
const open = () => {
showDialog.value = true
}
defineExpose({
open,
setFormData,
getDetail
})
</script>

View File

@ -0,0 +1,154 @@
<template>
<div>
<el-table :data="pager.lists" border style="width: 100%; margin-top: 10px">
<el-table-column prop="id" label="ID" width="120" />
<!-- <el-table-column prop="order_id" label="采购订单id" width="120" /> -->
<el-table-column label="商品名称" prop="goods_name" show-overflow-tooltip width="220" />
<el-table-column label="单位" prop="unit_name" width="80" show-overflow-tooltip />
<el-table-column
label="供应商"
prop="supplier_name"
show-overflow-tooltip
width="160"
/>
<el-table-column label="入库数量" prop="nums" show-overflow-tooltip width="100" />
<el-table-column label="报价" prop="price" show-overflow-tooltip />
<el-table-column label="状态" prop="is_storage" show-overflow-tooltip>
<template #default="{ row }">
<el-tag v-if="row.is_storage" type="success">已入库</el-tag>
<el-tag v-else type="info">未入库</el-tag>
</template>
</el-table-column>
<el-table-column label="备注" prop="notes" show-overflow-tooltip />
<el-table-column
label="入库时间"
prop="update_time"
show-overflow-tooltip
width="160"
/>
<el-table-column v-if="false" label="操作" fixed="right">
<template #default="{ row }">
<el-button
type="primary"
v-if="row.is_adopt === 1 && row.price > 0"
size="small"
@click="offerGood(row, 0)"
>采纳</el-button
>
<span v-if="row.is_storage">已入库</span>
<el-button
type="success"
v-else-if="row.is_adopt === 2 && row.price > 0"
size="small"
@click="offerGood(row, 1)"
>入库</el-button
>
<span v-if="row.is_adopt === 0 && row.price == 0" style="color: #e6a23c"
>等待供应商报价</span
>
</template>
</el-table-column>
</el-table>
<div class="flex mt-4 justify-end">
<pagination v-if="pager.lists" v-model="pager" @change="getLists" />
</div>
<el-dialog v-model="dialogVisible" title="入库" width="600">
<el-descriptions class="margin-top" :column="1" border>
<el-descriptions-item label="供应商名称">
{{ updateInfo.supplier_name }}
</el-descriptions-item>
<el-descriptions-item label="商品名称">
{{ updateInfo.goods_name }}
</el-descriptions-item>
<el-descriptions-item label="商品报价">
¥ {{ updateInfo.price }} / {{ updateInfo.unit_name }}
</el-descriptions-item>
<el-descriptions-item label="应入库数量">
{{ updateInfo.q_nums }}
</el-descriptions-item>
<el-descriptions-item label="实际入库数量">
<el-input-number v-model="updateInfo.nums" :step="1" :min="1" />
</el-descriptions-item>
<el-descriptions-item label="备注">
<el-input
v-model="updateInfo.notes"
type="textarea"
placeholder="请输入备注"
></el-input>
</el-descriptions-item>
</el-descriptions>
<template #footer>
<div class="dialog-footer">
<el-button @click="dialogVisible = false">取消</el-button>
<el-button type="primary" @click="goodsOfferUpdate"> 确认 </el-button>
</div>
</template>
</el-dialog>
</div>
</template>
<script lang="ts" setup name="subOrder">
import { usePaging } from '@/hooks/usePaging'
import {
opurchaseclassStorageListApi,
apiOpurchaseclassGoodsOfferUpdate
} from '@/api/opurchaseclass'
import { useRoute } from 'vue-router'
const route = useRoute()
const isAdopt = ref('')
const queryParams = reactive({
order_id: route.query.id,
is_storage: 1
})
//
const { pager, getLists, resetParams, resetPage } = usePaging({
fetchFun: opurchaseclassStorageListApi,
params: queryParams
})
defineExpose({
getLists
})
const changeType = (e: any) => {
queryParams.is_adopt = isAdopt.value
getLists()
}
const dialogVisible = ref(false)
const updateInfo = ref({
id: '',
type: 0,
notes: '', //
nums: 0, //
q_nums: 0 //
})
const offerGood = (row: any, type: number) => {
//type:0 1
updateInfo.value = Object.assign(
{
id: '',
type: type,
notes: '', //
nums: 0
},
row
)
if (type == 0) return goodsOfferUpdate() // ,
updateInfo.value.q_nums = row.nums
dialogVisible.value = true
}
const goodsOfferUpdate = () => {
apiOpurchaseclassGoodsOfferUpdate({
id: updateInfo.value.id,
type: updateInfo.value.type,
notes: updateInfo.value.notes, //
nums: updateInfo.value.nums
}).then((res) => {
getLists()
dialogVisible.value = false
})
}
</script>

View File

@ -0,0 +1,79 @@
<template>
<div>
<div>
<el-table
:data="pager.lists"
v-loading="pager.loading"
@selection-change="handleSelectionChange"
>
<el-table-column
label="商品信息"
prop="store_name"
show-overflow-tooltip
width="400"
>
<template #default="{ row }">
<div class="flex items-center">
<el-image
:src="row.image"
class="w-16 h-16 mr-2"
:preview-teleported="true"
></el-image>
<div>{{ row.store_name }}</div>
</div>
</template>
</el-table-column>
<el-table-column label="规格" prop="store_info" show-overflow-tooltip />
<el-table-column label="数量" prop="cart_num" show-overflow-tooltip />
<el-table-column label="合计" prop="total_price" show-overflow-tooltip />
</el-table>
</div>
<div class="flex mt-4 justify-end" v-if="pager.lists.length < pager.count">
<pagination v-model="pager" @change="getLists" />
</div>
</div>
</template>
<script lang="ts" setup name="storeTable">
import { usePaging } from '@/hooks/usePaging'
import { useDictData } from '@/hooks/useDictOptions'
import { apiPurchaseOrderInfoLists } from '@/api/purchase_order'
import { timeFormat } from '@/utils/util'
import feedback from '@/utils/feedback'
const emit = defineEmits(['change'])
//
const selectionList = ref([])
//
const handleSelectionChange = (val: any) => {
selectionList.value = val
emit('change', selectionList.value)
}
//
const queryParams = reactive({
oid: '',
pay_type: ''
})
//
const { dictData } = useDictData('')
//
const { pager, getLists, resetParams, resetPage } = usePaging({
fetchFun: apiPurchaseOrderInfoLists,
params: queryParams
})
const getList = (e: any) => {
queryParams.oid = e.oid
getLists()
}
defineExpose({
getList,
getLists
})
</script>

View File

@ -0,0 +1,80 @@
<template>
<div>
<el-table :data="pager.lists" border style="width: 100%">
<el-table-column prop="id" label="ID" width="120" />
<el-table-column label="门店" prop="system_store" show-overflow-tooltip />
<el-table-column label="单据编号" prop="order_id" show-overflow-tooltip />
<el-table-column label="单据金额" prop="total" show-overflow-tooltip />
<!-- <el-table-column label="抵扣金额" prop="deduction_price" show-overflow-tooltip /> -->
<el-table-column label="实际金额" prop="actual" show-overflow-tooltip />
<el-table-column label="实收金额" prop="money" show-overflow-tooltip />
<!-- <el-table-column label="单据时间" prop="create_time" show-overflow-tooltip /> -->
<el-table-column label="操作" fixed="right">
<template #default="{ row }">
<el-button type="primary" link @click="handleDetai(row)">详情</el-button>
</template>
</el-table-column>
</el-table>
<div class="flex mt-4 justify-end">
<pagination v-if="pager.lists" v-model="pager" @change="getLists" />
</div>
<!-- <detail
ref="detailRef"
v-if="showDetail"
:dictData="dictData"
@close="showDetail = false"
/> -->
<details-popup
v-if="showDetails"
ref="detailsRef"
@success="getLists"
@close="showDetails = false"
:dictData="dictData"
/>
</div>
</template>
<script lang="ts" setup name="subOrder">
import { usePaging } from '@/hooks/usePaging'
import { useDictData } from '@/hooks/useDictOptions'
import { apiPurchaseOrderLists } from '@/api/purchase_order'
import { useRoute } from 'vue-router'
import DetailsPopup from './details.vue'
// import detail from "@/views/retail/cashierclass/detail.vue";
//
const showDetails = ref(false)
const detailsRef = shallowRef<InstanceType<typeof DetailsPopup>>()
const route = useRoute()
const queryParams = reactive({
o_id: route.query.id,
is_mer: 1
})
//
const { pager, getLists, resetParams, resetPage } = usePaging({
fetchFun: apiPurchaseOrderLists,
params: queryParams
})
defineExpose({
getLists
})
const handleDetai = async (data: any) => {
showDetails.value = true
await nextTick()
detailsRef.value?.open()
detailsRef.value?.getDetail(data)
}
//
const { dictData } = useDictData('pay_type,auditing_type')
const showDetail = ref(false)
const detailRef = ref(null)
const openDetail = async (row: any) => {
showDetail.value = true
await nextTick()
detailRef.value?.open('edit')
detailRef.value?.getDetail(row)
}
</script>

View File

@ -0,0 +1,96 @@
<template>
<div>
<el-card class="!border-none mb-4" shadow="never">
<el-tabs v-model="activeName" class="demo-tabs" @tab-change="tabChange">
<el-tab-pane label="概况" name="detail">
<el-descriptions class="margin-top" :column="4" border>
<el-descriptions-item :span="4" label="单据编号">
{{ form.order_id }}
</el-descriptions-item>
<el-descriptions-item :span="2" label="单据金额">
{{ form.total }}
</el-descriptions-item>
<el-descriptions-item :span="2" label="实际金额">
{{ form.actual }}
</el-descriptions-item>
<el-descriptions-item :span="2" label="实收金额">
{{ form.money }}
</el-descriptions-item>
<el-descriptions-item label="所属商户">
{{ form.system_store }}
</el-descriptions-item>
</el-descriptions>
<el-table :data="pager.lists" border style="width: 100%; margin-top: 20px">
<el-table-column prop="id" label="ID" width="120" />
<el-table-column prop="store_name" label="商品名称" />
<el-table-column prop="unit_name" label="单位" />
<el-table-column prop="store_info" label="规格" />
<el-table-column prop="cart_num" label="数量" />
<el-table-column prop="price" label="单价(元)" />
<el-table-column prop="total_price" label="总价" />
</el-table>
</el-tab-pane>
<el-tab-pane label="商户订单" name="order" v-if="form.is_mer == 2">
<subOrder ref="subOrderRef" />
</el-tab-pane>
<!-- <el-tab-pane label="入库记录" name="putStorage">
<putStorage ref="putStorageRef" />
</el-tab-pane>
<el-tab-pane label="出库记录" name="outStorage">
<outStorage ref="outStorageRef" />
</el-tab-pane> -->
</el-tabs>
</el-card>
</div>
</template>
<script lang="ts" setup name="purchaseOrderDetail">
import { usePaging } from '@/hooks/usePaging'
import { useDictData } from '@/hooks/useDictOptions'
import { apiPurchaseOrderDetail, apiPurchaseOrderInfoLists } from '@/api/purchase_order'
import { useRoute } from 'vue-router'
import subOrder from './component/subOrder.vue'
// import goodsOffer from "./component/goodsOffer.vue";
// import noPush from "./component/noPush.vue";
// import putStorage from "./component/putStorage.vue";
// import outStorage from "./component/outStorage.vue";
const route = useRoute()
const form = ref({})
const activeName = ref('detail')
const getDetail = async () => {
const data = await apiPurchaseOrderDetail({
id: route.query.id
})
form.value = data
}
getDetail()
const subOrderRef = ref(null)
const goodsOfferRef = ref(null)
const noPushRef = ref(null)
const putStorageRef = ref(null)
const outStorageRef = ref(null)
const tabChange = (type: any) => {
if (type == 'order') subOrderRef.value?.getLists()
// if (type == 'offer') goodsOfferRef.value?.getLists()
// if (type == 'notPushedGoods') noPushRef.value?.getLists()
// if (type == 'putStorage') putStorageRef.value?.getLists()
// if (type == 'outStorage') outStorageRef.value?.getLists()
}
//
const queryParams = reactive({
oid: route.query.id
})
//
//
const { pager, getLists, resetParams, resetPage } = usePaging({
fetchFun: apiPurchaseOrderInfoLists,
params: queryParams
})
getLists()
</script>

View File

@ -2,13 +2,25 @@
<div>
<el-card class="!border-none mb-4" shadow="never">
<el-form class="mb-[-16px]" :model="queryParams" inline>
<el-form-item label="所属商户" prop="store_id">
<el-input
class="w-[280px]"
<el-form-item label="所属门店" prop="store_id">
<el-select
v-model="queryParams.store_id"
clearable
placeholder="请输入所属商户"
/>
filterable
remote
reserve-keyword
placeholder="输入门店名称搜索"
remote-show-suffix
:remote-method="remoteMethod"
:loading="storeloading"
style="width: 240px"
>
<el-option
v-for="item in storeList"
:key="item.id"
:label="item.name"
:value="item.id"
/>
</el-select>
</el-form-item>
<el-form-item label="单据编号" prop="order_id">
<el-input
@ -18,6 +30,29 @@
placeholder="请输入单据编号"
/>
</el-form-item>
<el-form-item label="类型" prop="is_mer">
<el-select
class="w-[280px]"
v-model="queryParams.is_mer"
placeholder="请选择类型"
@change="resetPage"
>
<el-option label="商户" value="1" />
<el-option label="平台" value="2" />
</el-select>
</el-form-item>
<el-form-item label="入库状态" prop="storage">
<el-select
class="w-[280px]"
v-model="queryParams.storage"
placeholder="请选择入库状态"
@change="resetPage"
>
<el-option label="未入库" value="0" />
<el-option label="部分入库" value="1" />
<el-option label="已入库" value="2" />
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="resetPage">查询</el-button>
<el-button @click="resetParams">重置</el-button>
@ -35,35 +70,33 @@
</template>
提交今日商户采购订单
</el-button>
<el-button
v-perms="['purchase_order.purchase_order/add']"
type="primary"
@click="submitPlatformOrder"
>
<template #icon>
<icon name="el-icon-Plus" />
</template>
生成今日平台采购订单
</el-button>
<div class="mt-4">
<el-table :data="pager.lists" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" />
<el-table-column label="所属商户" prop="store_id" show-overflow-tooltip />
<el-table-column label="所属商户" prop="system_store" show-overflow-tooltip />
<el-table-column label="单据编号" prop="order_id" show-overflow-tooltip />
<el-table-column label="单据金额" prop="total" show-overflow-tooltip />
<el-table-column label="实际金额" prop="actual" show-overflow-tooltip />
<el-table-column label="实收金额" prop="money" show-overflow-tooltip />
<el-table-column label="是否采购" prop="opurchase_name" show-overflow-tooltip />
<el-table-column label="类型" prop="mer_name" show-overflow-tooltip />
<el-table-column label="入库状态" prop="storage_name" show-overflow-tooltip />
<el-table-column label="备注信息" prop="data" show-overflow-tooltip />
<el-table-column label="是否采购" prop="is_opurchase" show-overflow-tooltip />
<el-table-column label="类型" prop="is_mer" show-overflow-tooltip />
<el-table-column label="入库状态" prop="storage" show-overflow-tooltip />
<el-table-column label="操作" width="120" fixed="right">
<template #default="{ row }">
<el-button
v-perms="['purchase_order.purchase_order/edit']"
type="primary"
link
@click="handleEdit(row)"
>
编辑
</el-button>
<el-button
v-perms="['purchase_order.purchase_order/delete']"
type="danger"
link
@click="handleDelete(row.id)"
>
删除
<el-button type="primary" link @click="handleDetail(row)">
详情
</el-button>
</template>
</el-table-column>
@ -89,23 +122,48 @@ import { useDictData } from '@/hooks/useDictOptions'
import {
apiPurchaseOrderLists,
apiPurchaseOrderDelete,
apiPurchaseOrderAdd
apiPurchaseOrderAdd,
apiPurchaseOrderPlatform
} from '@/api/purchase_order'
import { timeFormat } from '@/utils/util'
import feedback from '@/utils/feedback'
import EditPopup from './edit.vue'
import { ElMessage, type FormInstance } from 'element-plus'
import { apiSystemStoreLists } from '@/api/system_store'
import { useRouter, useRoute } from 'vue-router'
const editRef = shallowRef<InstanceType<typeof EditPopup>>()
//
const showEdit = ref(false)
const storeloading = ref(false)
const storeList = ref([])
const router = useRouter()
//
const queryParams = reactive({
store_id: '',
order_id: ''
order_id: '',
is_mer: '',
storage: ''
})
const remoteMethod = (e = '') => {
storeloading.value = true
apiSystemStoreLists({
name: e,
page_size: 50
})
.then((res) => {
storeList.value = res.lists
setTimeout(() => {
storeloading.value = false
}, 300)
})
.catch((err) => {
setTimeout(() => {
storeloading.value = false
}, 300)
})
}
//
const selectData = ref<any[]>([])
@ -130,20 +188,19 @@ const submitOrder = async () => {
ElMessage.success('提交成功')
})
}
//
const handleEdit = async (data: any) => {
showEdit.value = true
await nextTick()
editRef.value?.open('edit')
editRef.value?.setFormData(data)
const submitPlatformOrder = async () => {
apiPurchaseOrderPlatform().then((res) => {
ElMessage.success('提交成功')
})
}
//
const handleDelete = async (id: number | any[]) => {
await feedback.confirm('确定要删除?')
await apiPurchaseOrderDelete({ id })
getLists()
const handleDetail = async (data: any) => {
router.push({
path: '/order/purchase_order/details',
query: {
id: data.id
}
})
}
getLists()

View File

@ -13,24 +13,26 @@
</div>
<div class="flex items-center justify-between m-4">
<div class="flex flex-col">
<div style="color: gray;">订单状态</div>
<div style="color: black;">{{ formData.status_name }}</div>
<div style="color: gray">订单状态</div>
<div style="color: black">{{ formData.status_name }}</div>
</div>
<div class="flex flex-col">
<div style="color: gray;">实际支付</div>
<div style="color: black;">{{ formData.pay_price }}</div>
<div style="color: gray">实际支付</div>
<div style="color: black">{{ formData.pay_price }}</div>
</div>
<div class="flex flex-col">
<div style="color: gray;">支付方式</div>
<div style="color: black;">
<dict-value :options="dictData.pay_type" :value="formData.pay_type"></dict-value>
<div style="color: gray">支付方式</div>
<div style="color: black">
<dict-value
:options="dictData.pay_type"
:value="formData.pay_type"
></dict-value>
</div>
</div>
<div class="flex flex-col flex-2">
<div style="color: gray;">支付时间</div>
<div style="color: black;">{{ formData.pay_time }}</div>
<div style="color: gray">支付时间</div>
<div style="color: black">{{ formData.pay_time }}</div>
</div>
</div>
<el-tabs v-model="activeName" class="demo-tabs" @tab-click="handleClick" type="border-card">
<el-tab-pane label="订单信息" name="first">
@ -52,7 +54,12 @@
<script lang="ts" setup name="storeOrderDETAILS">
import { ElMessage, type FormInstance } from 'element-plus'
import Popup from '@/components/popup/index.vue'
import { apiStoreOrderAdd, apiStoreOrderEdit, apiStoreOrderDetail, apiStoreOrderRefund } from '@/api/store_order'
import {
apiStoreOrderAdd,
apiStoreOrderEdit,
apiStoreOrderDetail,
apiStoreOrderRefund
} from '@/api/store_order'
import { timeFormat } from '@/utils/util'
import moment from 'moment'
import orderInfo from './components/orderInfo.vue'
@ -72,27 +79,25 @@ const formRef = shallowRef<FormInstance>()
const showDialog = ref(false)
const mode = ref('add')
const storeRef = ref(null);
const orderRef = ref(null);
const deliverRef = ref(null);
const storeRef = ref(null)
const orderRef = ref(null)
const deliverRef = ref(null)
//
const formData = ref({
id: ''
})
//
const setFormData = async (data: Record<any, any>) => {
formData.value = { ...data };
formData.value = { ...data }
}
const getDetail = async (row: Record<string, any>) => {
formData.value.id = row.id;
formData.value.id = row.id
handleClick({
paneName: activeName.value
});
})
const data = await apiStoreOrderDetail({
id: row.id
})
@ -101,31 +106,31 @@ const getDetail = async (row: Record<string, any>) => {
//
const open = () => {
showDialog.value = true;
showDialog.value = true
}
const activeName = ref('first')
const handleClick = (tab: any) => {
if (tab.paneName == 'second') storeRef.value?.getList({oid: formData.value.id});
else if (tab.paneName == 'third') orderRef.value?.getLists();
else if (tab.paneName == 'fourth') deliverRef.value?.getLists();
console.log(storeRef.value)
if (tab.paneName == 'second') storeRef.value?.getList({ oid: formData.value.id })
else if (tab.paneName == 'third') orderRef.value?.getLists()
else if (tab.paneName == 'fourth') deliverRef.value?.getLists()
}
const command = (type: any)=>{
if(type==1) return refund();
const command = (type: any) => {
if (type == 1) return refund()
}
const refund = async ()=>{
const refund = async () => {
await feedback.confirm('确定要退款吗?')
apiStoreOrderRefund({
order_id: formData.value.order_id
}).then(res=>{
}).then((res) => {
ElMessage.success('退款成功')
})
}
defineExpose({
open,
setFormData,

View File

@ -1,127 +0,0 @@
<template>
<div class="edit-popup">
<popup
ref="popupRef"
title="详情"
:async="true"
width="550px"
:cancelButtonText="false"
:confirmButtonText="false"
>
<el-form ref="formRef" :model="formData" label-width="90px">
<el-form-item label="所属商户" prop="store_id">
<el-input v-model="formData.store_id" clearable placeholder="请输入所属商户" :readonly="true"/>
</el-form-item>
<el-form-item label="零售订单id" prop="order_arr">
<el-input v-model="formData.order_arr" clearable placeholder="请输入零售订单id" :readonly="true"/>
</el-form-item>
<el-form-item label="单据编号" prop="order_id">
<el-input v-model="formData.order_id" clearable placeholder="请输入单据编号" :readonly="true"/>
</el-form-item>
<el-form-item label="单据金额" prop="total">
<el-input v-model="formData.total" clearable placeholder="请输入单据金额" :readonly="true"/>
</el-form-item>
<el-form-item label="实际金额" prop="actual">
<el-input v-model="formData.actual" clearable placeholder="请输入实际金额" :readonly="true"/>
</el-form-item>
<el-form-item label="实收金额" prop="money">
<el-input v-model="formData.money" clearable placeholder="请输入实收金额" :readonly="true"/>
</el-form-item>
<el-form-item label="是否支付" prop="paid">
<el-input v-model="formData.paid" clearable placeholder="请输入是否支付" :readonly="true"/>
</el-form-item>
<el-form-item label="单据附件" prop="file">
<el-input v-model="formData.file" clearable placeholder="请输入单据附件" :readonly="true"/>
</el-form-item>
<el-form-item label="备注信息" prop="data">
<el-input v-model="formData.data" clearable placeholder="请输入备注信息" :readonly="true"/>
</el-form-item>
<el-form-item label="是否采购" prop="is_opurchase">
<el-input v-model="formData.is_opurchase" clearable placeholder="请输入是否采购" :readonly="true"/>
</el-form-item>
<el-form-item label="类型" prop="is_mer">
<el-input v-model="formData.is_mer" clearable placeholder="请输入类型" :readonly="true"/>
</el-form-item>
<el-form-item label="入库状态" prop="storage">
<el-input v-model="formData.storage" clearable placeholder="请输入入库状态" :readonly="true"/>
</el-form-item>
</el-form>
</popup>
</div>
</template>
<script lang="ts" setup name="purchaseOrderDETAILS">
import type { FormInstance } from 'element-plus'
import Popup from '@/components/popup/index.vue'
import { apiPurchaseOrderAdd, apiPurchaseOrderEdit, apiPurchaseOrderDetail } from '@/api/purchase_order'
import { timeFormat } from '@/utils/util'
import type { PropType } from 'vue'
defineProps({
dictData: {
type: Object as PropType<Record<string, any[]>>,
default: () => ({})
}
})
const emit = defineEmits(['success', 'close'])
const formRef = shallowRef<FormInstance>()
const popupRef = shallowRef<InstanceType<typeof Popup>>()
const mode = ref('add')
//
const formData = reactive({
id: '',
store_id: '',
order_arr: '',
order_id: '',
total: '',
actual: '',
money: '',
paid: '',
file: '',
data: '',
is_opurchase: '',
is_mer: '',
storage: '',
})
//
const setFormData = async (data: Record<any, any>) => {
for (const key in formData) {
if (data[key] != null && data[key] != undefined) {
//@ts-ignore
formData[key] = data[key]
}
}
}
const getDetail = async (row: Record<string, any>) => {
const data = await apiPurchaseOrderDetail({
id: row.id
})
setFormData(data)
}
//
const open = () => {
popupRef.value?.open()
}
//
const handleClose = () => {
emit('close')
}
defineExpose({
open,
setFormData,
getDetail
})
</script>