This commit is contained in:
weipengfei 2024-05-11 18:14:39 +08:00
parent baa7abcc77
commit dc24336da2
5 changed files with 41 additions and 57 deletions

View File

@ -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>

View File

@ -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>

View File

@ -77,6 +77,7 @@ const activeMap = ref(
);
console.log(activeMap.value);
const getDetail = async () => {
const data = await apiOpurchaseclassDetail({
id: route.query.id,

View File

@ -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,35 +110,22 @@ const formRules = reactive<any>({
//
const setFormData = async (data: Record<any, any>) => {
formData.value = data
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 })
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') => {
mode.value = type
@ -172,5 +142,6 @@ const handleClose = () => {
defineExpose({
open,
setFormData,
getDetail
})
</script>

View File

@ -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)
}
//