list.vue 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. <template>
  2. <el-container class="is-vertical">
  3. <sc-page-header></sc-page-header>
  4. <scTable ref="xGridTable" v-bind="xGridOptions">
  5. <template #code_link="{ row }">
  6. <vxe-text status="primary" @click="table_detail(row)">{{ row.code }}</vxe-text>
  7. </template>
  8. <template #action="{ row }">
  9. <el-button type="primary" link @click="table_freeze(row)">
  10. <template #icon><sc-iconify icon="ant-design:edit-outlined"></sc-iconify></template>冻结
  11. </el-button>
  12. </template>
  13. </scTable>
  14. </el-container>
  15. </template>
  16. <script setup>
  17. import moment from "moment";
  18. import XEUtils from "xe-utils";
  19. import API from "@/api";
  20. import TOOL from "@/utils/tool";
  21. import { mapFormItemInput, mapFormItemSelect, mapFormItemDatePicker } from "@/components/scTable/helper";
  22. import store from "@/store";
  23. const route = useRoute();
  24. console.log('route',route)
  25. const daterangeConfig = reactive({
  26. resetValue: () => [],
  27. props: {
  28. type: "daterange",
  29. startPlaceholder: "开始日期",
  30. endPlaceholder: "结束日期",
  31. format: "YYYY-MM-DD"
  32. }
  33. });
  34. const xGridOptions = reactive({
  35. // apiObj: API.production.prePlan,
  36. toolbarConfig: { enabled: false },
  37. formConfig: {
  38. data: {},
  39. items: [
  40. mapFormItemInput("nameLike", "产品名称"),
  41. mapFormItemInput("codeLike", "产品编号"),
  42. mapFormItemDatePicker("confirmDate", "确认日期", daterangeConfig)
  43. ]
  44. },
  45. paramsColums: [
  46. { column: "orderBy", defaultValue: "createTime_desc" },
  47. { column: "nameLike" },
  48. { column: "codeLike" },
  49. { column: "confirmDateBegin", field: "confirmDate[0]" },
  50. { column: "confirmDateEnd", field: "confirmDate[1]" }
  51. ],
  52. columns: [
  53. { type: "seq", fixed: "left", width: 60 },
  54. { type: "html", field: "warehouseName", title: "仓库", fixed: "left", minWidth: 150, sortable: true },
  55. { type: "html", field: "batchNumber", title: "批号", minWidth: 150, sortable: true },
  56. { type: "html", field: "serialNumber", title: "序列号", minWidth: 150, sortable: true },
  57. { type: "html", field: "productionDate", title: "生产日期", minWidth: 150, sortable: true },
  58. { type: "html", field: "validityDate", title: "有效日期", minWidth: 150, sortable: true },
  59. { type: "html", field: "num", title: "数量", minWidth: 150 },
  60. { type: "html", field: "storageDate", title: "入库日期", minWidth: 150, sortable: true },
  61. { field: "code", title: "关联入库单", minWidth: 150, sortable: true, className: "vxe-table-link-cell", slots: { default: "code_link" } },
  62. { title: "操作", fixed: "right", width: 120, slots: { default: "action" } }
  63. ]
  64. });
  65. // 显示隐藏 筛选表单
  66. const xGridTable = ref();
  67. const refreshTable = (mode = "add") => (xGridTable.value.searchData(mode), xGridTable.value.reloadColumn(columns));
  68. const dispatchRef = ref();
  69. const dispatchDescRef = ref();
  70. const dialog = reactive({
  71. detail: false,
  72. desc: false
  73. });
  74. const table_detail = row => {
  75. dialog.desc = true;
  76. nextTick(() => dispatchDescRef.value?.setData(row));
  77. }
  78. const table_freeze = ({ id }) => {
  79. ElMessageBox.confirm("是否确认冻结该库存?", "删除警告", {
  80. type: "warning",
  81. confirmButtonText: "确定",
  82. cancelButtonText: "取消"
  83. }).then(() => {
  84. // API.production.plan.del({ id }).then(() => {
  85. // ElMessage.success("操作成功");
  86. // refreshTable();
  87. // });
  88. }).catch(() => {});
  89. }
  90. </script>
  91. <style scoped>
  92. .el-descriptions {padding-left: 10px;}
  93. .el-descriptions :deep(.el-descriptions__cell) {width: calc(100% / 4);}
  94. </style>