123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275 |
- <template>
- <div class="tenant">
- <div class="content">
- <byTable
- :source="sourceList.data"
- :pagination="sourceList.pagination"
- :config="config"
- :loading="loading"
- :selectConfig="selectConfig"
- highlight-current-row
- :action-list="[
- {
- text: '导出Excel',
- action: () => deriveExcel(),
- },
- ]"
- @get-list="getList"
- >
- <template #warehouseName="{ item }">
- <div>
- <!-- <span v-if="item.opType == 1">{{ item.toWarehouseName }}</span>
- <span v-else>{{ item.warehouseName }}</span> -->
- <span>{{ item.warehouseName }}</span>
- </div>
- </template>
- </byTable>
- </div>
- </div>
- </template>
- <script setup>
- import { computed, ref } from "vue";
- import byTable from "@/components/byTable/index";
- const { proxy } = getCurrentInstance();
- const route = useRoute();
- const opTypeList = ref([
- {
- label: "入库",
- value: "1",
- },
- {
- label: "出库",
- value: "2",
- },
- ]);
- const typeList = ref([
- {
- label: "手动入库",
- value: "1",
- },
- {
- label: "手动出库",
- value: "2",
- },
- {
- label: "调仓入库",
- value: "3",
- },
- {
- label: "待入库入库",
- value: "4",
- },
- {
- label: "待出库出库",
- value: "5",
- },
- {
- label: "组合入库",
- value: "6",
- },
- {
- label: "组合出库",
- value: "7",
- },
- {
- label: "组合拆分入库",
- value: "8",
- },
- {
- label: "组合拆分出库",
- value: "9",
- },
- {
- label: "京东销售出库",
- value: "10",
- },
- {
- label: "调仓出库",
- value: "11",
- },
- {
- label: "销售订单出库",
- value: "12",
- },
- {
- label: "退货出库",
- value: "13",
- },
- {
- label: "到货入库",
- value: "14",
- },
- {
- label: "京东退货入库",
- value: "15",
- },
- {
- label: "生产任务出库",
- value: "20",
- },
- ]);
- const warehouseList = ref([]);
- const productUnit = ref([]);
- const sourceList = ref({
- data: [],
- pagination: {
- total: 0,
- pageNum: 1,
- pageSize: 10,
- keyword: "",
- opType: "",
- productId: "",
- },
- });
- const loading = ref(false);
- const selectConfig = computed(() => {
- return [
- {
- label: "操作类型",
- prop: "opType",
- data: opTypeList.value,
- },
- {
- label: "出入库类型",
- prop: "type",
- data: typeList.value,
- },
- ];
- });
- const config = computed(() => {
- return [
- {
- attrs: {
- label: "操作类型",
- prop: "opType",
- width: 140,
- },
- render(type) {
- return proxy.dictValueLabel(type, opTypeList.value);
- },
- },
- {
- attrs: {
- label: "出入库类型",
- prop: "type",
- width: 140,
- },
- render(type) {
- return proxy.dictValueLabel(type, typeList.value);
- },
- },
- {
- attrs: {
- label: "仓库名称",
- slot: "warehouseName",
- width: 200,
- },
- },
- {
- attrs: {
- label: "物品编码",
- prop: "productCode",
- width: 160,
- },
- },
- {
- attrs: {
- label: "物品名称",
- prop: "productName",
- "min-width": 220,
- },
- },
- {
- attrs: {
- label: "规格",
- prop: "productSpec",
- width: 160,
- },
- },
- {
- attrs: {
- label: "单位",
- prop: "productUnit",
- width: 120,
- },
- render(unit) {
- return proxy.dictValueLabel(unit, productUnit.value);
- },
- },
- {
- attrs: {
- label: "操作数量",
- prop: "quantity",
- width: 120,
- },
- },
- {
- attrs: {
- label: "操作人",
- prop: "opUserName",
- width: 120,
- },
- },
- {
- attrs: {
- label: "操作时间",
- prop: "createTime",
- width: 160,
- },
- },
- ];
- });
- const getDict = () => {
- proxy.post("/warehouse/page", { pageNum: 1, pageSize: 999 }).then((res) => {
- if (res.rows && res.rows.length > 0) {
- warehouseList.value = res.rows.map((item) => {
- return {
- label: item.name,
- value: item.id,
- };
- });
- }
- });
- proxy.getDictOne(["unit"]).then((res) => {
- productUnit.value = res["unit"].map((x) => ({
- label: x.dictValue,
- value: x.dictKey,
- }));
- });
- };
- const getList = async (req) => {
- sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
- loading.value = true;
- proxy
- .post("/stockJournalDetails/page", sourceList.value.pagination)
- .then((res) => {
- sourceList.value.data = res.rows;
- sourceList.value.pagination.total = res.total;
- setTimeout(() => {
- loading.value = false;
- }, 200);
- });
- };
- getDict();
- onMounted(() => {
- if (route.query.productId) {
- sourceList.value.pagination.productId = route.query.productId;
- }
- getList();
- });
- const deriveExcel = () => {
- console.log("deriveExcel");
- };
- </script>
- <style lang="scss" scoped>
- .tenant {
- padding: 20px;
- }
- ::v-deep(.el-input-number .el-input__inner) {
- text-align: left;
- }
- </style>
|