|
@@ -1,11 +1,16 @@
|
|
|
<script setup lang="ts">
|
|
|
-import { ref } from "vue";
|
|
|
+import { computed, ref } from "vue";
|
|
|
import { order_columns, order_status } from "../../config/configs";
|
|
|
import SalesModal from "./sales-modal.vue";
|
|
|
|
|
|
+const props = defineProps<{
|
|
|
+ readonly?: boolean;
|
|
|
+}>();
|
|
|
+
|
|
|
const emit = defineEmits(["create-btn-click"]);
|
|
|
const saleOrderList = ref<Array<Record<string, string>>>([]);
|
|
|
const tradFeeMap = ref<Record<string, string>>({});
|
|
|
+const disabled = computed(() => !props.readonly);
|
|
|
|
|
|
const saleModalRef = ref<InstanceType<typeof SalesModal>>(null);
|
|
|
|
|
@@ -26,8 +31,6 @@ function handleCreate() {
|
|
|
})
|
|
|
);
|
|
|
|
|
|
- console.log(orderArr);
|
|
|
-
|
|
|
emit("create-btn-click", orderArr);
|
|
|
}
|
|
|
</script>
|
|
@@ -35,7 +38,10 @@ function handleCreate() {
|
|
|
<template>
|
|
|
<div flex justify-between items-center>
|
|
|
<h1 my-4>关联订单:</h1>
|
|
|
- <el-button type="primary" @click="() => saleModalRef.onDisplay()"
|
|
|
+ <el-button
|
|
|
+ v-if="disabled"
|
|
|
+ type="primary"
|
|
|
+ @click="() => saleModalRef.onDisplay()"
|
|
|
>添加</el-button
|
|
|
>
|
|
|
</div>
|
|
@@ -63,7 +69,7 @@ function handleCreate() {
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
|
|
|
- <div flex justify-end mt-3>
|
|
|
+ <div flex justify-end mt-3 v-if="disabled">
|
|
|
<el-button type="primary" @click="handleCreate">保存</el-button>
|
|
|
</div>
|
|
|
|