This commit is contained in:
parent
baa7abcc77
commit
dc24336da2
|
@ -170,6 +170,7 @@ const offerGood = (row: any, type: number) => {
|
|||
dialogVisible.value = true;
|
||||
};
|
||||
|
||||
|
||||
const goodsOfferUpdate = () => {
|
||||
apiOpurchaseclassGoodsOfferUpdate({
|
||||
id: updateInfo.value.id,
|
||||
|
@ -181,4 +182,7 @@ const goodsOfferUpdate = () => {
|
|||
dialogVisible.value = false;
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
|
|
|
@ -25,15 +25,17 @@
|
|||
<div class="flex mt-4 justify-end">
|
||||
<pagination v-model="pager" @change="getLists" />
|
||||
</div>
|
||||
<goodList ref="goodListRef" />
|
||||
<detail ref="detailRef" v-if="showDetail" :dictData="dictData"
|
||||
@close="showDetail = false"/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup name="subOrder">
|
||||
import { usePaging } from "@/hooks/usePaging";
|
||||
import { useDictData } from '@/hooks/useDictOptions'
|
||||
import { apiOpurchaseclassSubOrders } from "@/api/opurchaseclass";
|
||||
import { useRoute } from "vue-router";
|
||||
import goodList from "./goodList.vue";
|
||||
import detail from "@/views/retail/cashierclass/detail.vue";
|
||||
|
||||
const route = useRoute();
|
||||
|
||||
|
@ -50,10 +52,16 @@ defineExpose({
|
|||
getLists
|
||||
})
|
||||
|
||||
const goodListRef = ref(null);
|
||||
// 获取字典数据
|
||||
const { dictData } = useDictData('pay_type,auditing_type')
|
||||
|
||||
const openDetail = (row: any) => {
|
||||
goodListRef.value?.open(row);
|
||||
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>
|
||||
|
|
|
@ -77,6 +77,7 @@ const activeMap = ref(
|
|||
);
|
||||
console.log(activeMap.value);
|
||||
|
||||
|
||||
const getDetail = async () => {
|
||||
const data = await apiOpurchaseclassDetail({
|
||||
id: route.query.id,
|
||||
|
|
|
@ -3,10 +3,10 @@
|
|||
<popup ref="popupRef" :async="true" width="60vw" @close="handleClose" :bottom-btn="false">
|
||||
<el-descriptions class="margin-top" :title="popupTitle" :column="3" border>
|
||||
<el-descriptions-item label="所属商户">
|
||||
<material-picker v-model="formData.merchant" disabled />
|
||||
<material-picker v-model="formData.merchant_info" disabled />
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="客户">
|
||||
{{ formData.user_name }}
|
||||
<el-descriptions-item label="收货人">
|
||||
{{ formData.real_name }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="单据时间">
|
||||
{{ formData.create_time }}
|
||||
|
@ -70,6 +70,7 @@ import Popup from '@/components/popup/index.vue'
|
|||
import type { PropType } from 'vue'
|
||||
import { usePaging } from '@/hooks/usePaging'
|
||||
import { apiCashierinfoLists } from '@/api/cashierinfo'
|
||||
import { apiCashierclassDetail } from '@/api/cashierclass'
|
||||
defineProps({
|
||||
dictData: {
|
||||
type: Object as PropType<Record<string, any[]>>,
|
||||
|
@ -79,12 +80,14 @@ defineProps({
|
|||
const emit = defineEmits(['success', 'close'])
|
||||
const popupRef = shallowRef<InstanceType<typeof Popup>>()
|
||||
const mode = ref('add')
|
||||
let pid;
|
||||
const queryParams = reactive({
|
||||
pid: ''
|
||||
})
|
||||
|
||||
// 分页相关
|
||||
const { pager, getLists, resetParams, resetPage } = usePaging({
|
||||
fetchFun: apiCashierinfoLists,
|
||||
params: { pid: pid }
|
||||
params: queryParams
|
||||
})
|
||||
|
||||
// 弹窗标题
|
||||
|
@ -93,27 +96,7 @@ const popupTitle = computed(() => {
|
|||
})
|
||||
|
||||
// 表单数据
|
||||
const formData = reactive({
|
||||
id: '',
|
||||
merchant: '',
|
||||
user_name: "",
|
||||
create_time: "",
|
||||
store_id: '',
|
||||
customer: '',
|
||||
time: '',
|
||||
number: '',
|
||||
total: '',
|
||||
deduction_price: '',
|
||||
actual: '',
|
||||
money: '',
|
||||
pay_type: '',
|
||||
data: '',
|
||||
type: '',
|
||||
auditinguser: '',
|
||||
auditinguser_name: "",
|
||||
auditingtime: '',
|
||||
more: '',
|
||||
})
|
||||
const formData = ref({})
|
||||
|
||||
// 表单验证
|
||||
const formRules = reactive<any>({
|
||||
|
@ -127,34 +110,21 @@ const formRules = reactive<any>({
|
|||
|
||||
// 获取详情
|
||||
const setFormData = async (data: Record<any, any>) => {
|
||||
|
||||
console.log(data.id, 'pid')
|
||||
return
|
||||
for (const key in formData) {
|
||||
if (data[key] != null && data[key] != undefined) {
|
||||
//@ts-ignore
|
||||
formData[key] = data[key]
|
||||
}
|
||||
}
|
||||
pid = data.id
|
||||
console.log(pid, 'pid')
|
||||
// let res = await apiCashierinfoLists({ pid: data.id })
|
||||
getLists()
|
||||
formData.value = data
|
||||
|
||||
}
|
||||
|
||||
const getDetail = (data:any)=>{
|
||||
apiCashierclassDetail({
|
||||
id: data.id
|
||||
}).then(res=>{
|
||||
setFormData(res);
|
||||
})
|
||||
queryParams.pid = data.id
|
||||
getLists()
|
||||
}
|
||||
|
||||
|
||||
// 提交按钮
|
||||
// const handleSubmit = async () => {
|
||||
// await formRef.value?.validate()
|
||||
// const data = { ...formData, }
|
||||
// mode.value == 'edit'
|
||||
// ? await apiBrandEdit(data)
|
||||
// : await apiBrandAdd(data)
|
||||
// popupRef.value?.close()
|
||||
// emit('success')
|
||||
// }
|
||||
|
||||
//打开弹窗
|
||||
const open = (type = 'add') => {
|
||||
|
@ -172,5 +142,6 @@ const handleClose = () => {
|
|||
defineExpose({
|
||||
open,
|
||||
setFormData,
|
||||
getDetail
|
||||
})
|
||||
</script>
|
||||
|
|
|
@ -172,12 +172,12 @@ const handleEdit = async (data: any) => {
|
|||
}
|
||||
|
||||
// 详情
|
||||
const handleDetail = async (data) => {
|
||||
let res = await apiCashierclassDetail({ id: data.id })
|
||||
const handleDetail = async (data: any) => {
|
||||
// let res = await apiCashierclassDetail({ id: data.id })
|
||||
showDetail.value = true
|
||||
await nextTick()
|
||||
detailRef.value?.open('edit')
|
||||
detailRef.value?.setFormData(res)
|
||||
detailRef.value?.getDetail(data)
|
||||
}
|
||||
|
||||
// 删除
|
||||
|
|
Loading…
Reference in New Issue