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