detail.vue 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219
  1. <template>
  2. <LjDetail
  3. name="configureTypeListLeftDetail"
  4. ref="LjDetailLeftRef"
  5. v-bind="detailProps_left"
  6. v-model:order-status="orderStatus"
  7. :data="mainData"
  8. :init-param="mainData[0]"
  9. :if-fold-layout="false"
  10. :if-layout-editable="false"
  11. :search-col="{ xs: 4, sm: 4, md: 4, lg: 4, xl: 4 }"
  12. :basic-group-col="{ xs: 4, sm: 4, md: 4, lg: 4, xl: 4 }"
  13. :enum="props.enum"
  14. v-if="props.type === 0"
  15. >
  16. </LjDetail>
  17. <LjDetail
  18. name="configureCodeListMidDetail"
  19. ref="LjDetailMidRef"
  20. v-bind="detailProps_mid"
  21. v-model:order-status="orderStatus"
  22. :data="mainData"
  23. :init-param="mainData[0]"
  24. :if-fold-layout="false"
  25. :if-layout-editable="false"
  26. :search-col="{ xs: 4, sm: 4, md: 4, lg: 4, xl: 4 }"
  27. :basic-group-col="{ xs: 4, sm: 4, md: 4, lg: 4, xl: 4 }"
  28. :enum="props.enum"
  29. v-if="props.type === 1"
  30. >
  31. </LjDetail>
  32. <LjDetail
  33. name="configureCodeMxListRightDetail"
  34. ref="LjDetailRightRef"
  35. v-bind="detailProps_right"
  36. v-model:order-status="orderStatus"
  37. :data="mainData"
  38. :init-param="mainData[0]"
  39. :if-fold-layout="false"
  40. :if-layout-editable="false"
  41. :search-col="{ xs: 4, sm: 4, md: 4, lg: 4, xl: 4 }"
  42. :basic-group-col="{ xs: 4, sm: 4, md: 4, lg: 4, xl: 4 }"
  43. :enum="props.enum"
  44. v-if="props.type === 2"
  45. >
  46. </LjDetail>
  47. <LjDetail
  48. name="configureCodeMxBomListRightDetail"
  49. ref="LjDetailBottomRef"
  50. v-bind="detailProps_bottom"
  51. v-model:order-status="orderStatus"
  52. :data="mainData"
  53. :init-param="mainData[0]"
  54. :if-fold-layout="false"
  55. :if-layout-editable="false"
  56. :search-col="{ xs: 4, sm: 4, md: 4, lg: 4, xl: 4 }"
  57. :basic-group-col="{ xs: 4, sm: 4, md: 4, lg: 4, xl: 4 }"
  58. :enum="props.enum"
  59. v-if="props.type === 3"
  60. >
  61. </LjDetail>
  62. <ErpMtrldefDialog ref="MtrldefDialogRef" v-bind="MtrldefDialogProps" />
  63. </template>
  64. <script setup lang="tsx" name="configureTypeListDetail">
  65. import { ref, watch, reactive, inject, onMounted } from "vue";
  66. import { DwnameEnum } from "@/enums/dwnameEnum";
  67. import LjDetail from "@/components/LjDetail/index.vue";
  68. import { DetailProp } from "@/components/LjDetail/interface";
  69. import { useI18n } from "vue-i18n";
  70. import { useHooks } from "./hooks/index";
  71. import { useAuthButtons } from "@/hooks/useAuthButtons";
  72. import ErpMtrldefDialog from "@/views/system/selector/erpMtrlPrice/index.vue";
  73. interface detailProp {
  74. /**
  75. * @argument any 页面数据
  76. */
  77. data?: any;
  78. /**
  79. * @argument string 请求数据的api ==> 非必传
  80. */
  81. requestApi?: (params: any) => Promise<any>;
  82. /**
  83. * @argument any 基础信息,表格展示数据
  84. */
  85. // columns?: any;
  86. /**
  87. * @description 是否可编辑
  88. */
  89. status: "edit" | "new" | string;
  90. enum?: any;
  91. type: Number; // 0-left 1-mid 2-right
  92. }
  93. const props = withDefaults(defineProps<detailProp>(), {});
  94. const { t } = useI18n();
  95. const {
  96. LjDetailLeftRef,
  97. LjDetailMidRef,
  98. LjDetailRightRef,
  99. LjDetailBottomRef,
  100. columns_left,
  101. columns_mid,
  102. columns_right,
  103. columns_bottom,
  104. MtrldefDialogRef,
  105. MtrldefDialogProps
  106. } = useHooks(t);
  107. const { CheckPower, CheckOption, buttonNew, buttonDefault } = useAuthButtons(t);
  108. const mainData = ref([{}]);
  109. /**
  110. * @description 是否可编辑
  111. */
  112. const orderStatus = ref("");
  113. const detailProps_left = reactive<DetailProp>({
  114. dwname: DwnameEnum.configuretypelist,
  115. columns: columns_left,
  116. // addPower: 5,
  117. // editPower: 4359,
  118. header: {
  119. fieldNames: {
  120. code: "deptname",
  121. codeLabel: t("table.u_cust.cuscode") + ":",
  122. name: "name"
  123. },
  124. icon: "iconuser-01",
  125. tabsProp: {
  126. scrollspy: false,
  127. sticky: true
  128. }
  129. },
  130. mould: []
  131. });
  132. const detailProps_mid = reactive<DetailProp>({
  133. dwname: DwnameEnum.configurecodelist,
  134. columns: columns_mid,
  135. // addPower: 5,
  136. // editPower: 4359,
  137. header: {
  138. fieldNames: {
  139. code: "deptname",
  140. codeLabel: t("table.u_cust.cuscode") + ":",
  141. name: "name"
  142. },
  143. icon: "iconuser-01",
  144. tabsProp: {
  145. scrollspy: false,
  146. sticky: true
  147. }
  148. },
  149. mould: []
  150. });
  151. const detailProps_right = reactive<DetailProp>({
  152. dwname: DwnameEnum.configurecodemxlist,
  153. columns: columns_right,
  154. // addPower: 5,
  155. // editPower: 4359,
  156. header: {
  157. fieldNames: {
  158. code: "deptname",
  159. codeLabel: t("table.u_cust.cuscode") + ":",
  160. name: "name"
  161. },
  162. icon: "iconuser-01",
  163. tabsProp: {
  164. scrollspy: false,
  165. sticky: true
  166. }
  167. },
  168. mould: []
  169. });
  170. const detailProps_bottom = reactive<DetailProp>({
  171. dwname: DwnameEnum.configurecodemxbomlist,
  172. columns: columns_bottom,
  173. // addPower: 5,
  174. // editPower: 4359,
  175. header: {
  176. fieldNames: {
  177. code: "deptname",
  178. codeLabel: t("table.u_cust.cuscode") + ":",
  179. name: "name"
  180. },
  181. icon: "iconuser-01",
  182. tabsProp: {
  183. scrollspy: false,
  184. sticky: true
  185. }
  186. },
  187. mould: []
  188. });
  189. watch(
  190. () => props.data,
  191. val => {
  192. console.log("props.data, val :>> ", val);
  193. mainData.value = [val];
  194. // getDetailData(val).then(res => {
  195. // detailData.value = res;
  196. // });
  197. },
  198. { immediate: true }
  199. );
  200. watch(
  201. () => props.status,
  202. val => {
  203. console.log("props.status val :>> ", val);
  204. orderStatus.value = val;
  205. },
  206. { immediate: true, deep: true }
  207. );
  208. </script>