From a2299a6d4a6f99e9c11132138f5d3e9ec68f03ea Mon Sep 17 00:00:00 2001 From: jiangping <jp@doumee.com> Date: 星期五, 06 六月 2025 19:19:34 +0800 Subject: [PATCH] 开发更新 --- admin/src/views/stock/record.vue | 223 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 223 insertions(+), 0 deletions(-) diff --git a/admin/src/views/stock/record.vue b/admin/src/views/stock/record.vue index e69de29..94cc276 100644 --- a/admin/src/views/stock/record.vue +++ b/admin/src/views/stock/record.vue @@ -0,0 +1,223 @@ +<template> + <div class="main_app"> + <QueryForm v-model="filters" :query-form-config="queryFormConfig" @handleQuery="getList(1)" @clear="clear" /> + <div class="mt20"> + <el-button @click="handleEx()" v-permissions="['business:ywoutinboundrecord:exportExcel']">瀵煎嚭</el-button> + </div> + <el-table v-loading="loading" :data="list" stripe> + <el-table-column prop="doneDate" label="鍗曟嵁鏃ユ湡" min-width="100" show-overflow-tooltip /> + <el-table-column prop="materialCode" label="鐗╂枡缂栫爜" min-width="90" show-overflow-tooltip /> + <el-table-column prop="materialName" label="鐗╂枡鍚嶇О" min-width="90" show-overflow-tooltip /> + <el-table-column prop="carCodeFront" label="鐗╂枡鍒嗙被" min-width="120" show-overflow-tooltip> + <template v-slot="{ row }"> + <span>{{ row.categoryParentName }}/{{ row.categoryName }}</span> + </template> + </el-table-column> + <el-table-column prop="carCodeBack" label="鏁伴噺" min-width="80" show-overflow-tooltip> + <template v-slot="{ row }"> + <span>{{ row.stock }}{{ row.materialUnitName }}</span> + </template> + </el-table-column> + <el-table-column prop="param1" label="绫诲瀷" min-width="70" show-overflow-tooltip> + <template v-slot="{ row }"> + <span v-if="row.type || row.type == 0">{{ StoreTypeOps[row.type].name }}</span> + </template> + </el-table-column> + <el-table-column prop="warehouseName" label="浠撳簱" min-width="90" show-overflow-tooltip /> + <el-table-column prop="code" label="鍗曟嵁缂栧彿" min-width="140"> + <template v-slot="{ row }"> + <span class="primaryColor pointer" @click='detailClick(row)'>{{ row.code }}</span> + </template> + </el-table-column> + <el-table-column prop="createUserName" label="鍒涘缓浜�" min-width="80" show-overflow-tooltip /> + <el-table-column prop="createDate" label="鍒涘缓鏃堕棿" min-width="140" show-overflow-tooltip /> + </el-table> + <div class="mt20"> + <Pagination @size-change="handleSizeChange" @current-change="getList" :pagination="pagination" /> + </div> + <!-- --> + <OutDetail v-if="isShowOutDetail" ref="OutDetailRef" /> + <InDetail v-if="isShowInDetail" ref="InDetailRef" /> + </div> +</template> + +<script> +import Pagination from '@/components/common/Pagination' +import QueryForm from '@/components/common/QueryForm' +import InDetail from './components/InDetail' +import OutDetail from './components/OutDetail.vue' + +import dayjs from 'dayjs' +import duration from 'dayjs/plugin/duration' + +dayjs.extend(duration) +import { ywOutinboundRecord, ywOutinboundRecordEx } from '@/api' +import { fetchList as getStoreList } from '@/api/ywWarehouse' +import { StoreTypeOps } from './components/config' +export default { + components: { + Pagination, + QueryForm, + InDetail, + OutDetail + }, + data() { + return { + loading: false, + isShowInDetail: false, + isShowOutDetail: false, + pagination: { + pageSize: 10, + page: 1, + total: 0 + }, + filters: {}, + list: [], + total: 0, + StoreTypeOps, + queryFormConfig: { + formItems: [ + { + filed: 'materialCode', + type: 'input', + label: '鐗╂枡缂栫爜', + }, + { + filed: 'warehouseId', + type: 'select', + labelCode: 'name', + valueCode: 'id', + label: '鎵�鍦ㄤ粨搴�', + options: [] + }, + { + filed: 'code', + type: 'input', + label: '鍗曟嵁缂栧彿', + }, + { + filed: 'type', + type: 'select', + label: '鍗曟嵁绫诲瀷', + labelCode: 'name', + valueCode: 'id', + options: StoreTypeOps + }, + { + filed: 'selDate', + type: 'daterange', + label: '鍗曟嵁鏃ユ湡', + }, + { + filed: 'selTime', + type: 'datetimerange', + label: '鍒涘缓鏃堕棿', + }, + ], + online: true + } + } + }, + created() { + this.getList() + this.initData() + }, + methods: { + handleSub() { + this.$refs.ruleForm.validate((valid) => { + if (valid) { + alert('submit!') + } + }) + }, + detailClick(item) { + const index = item.code.indexOf('RK') + if(index > -1){ + this.isShowInDetail = true + this.$nextTick(() => { + this.$refs.InDetailRef.visible = true + this.$refs.InDetailRef.getDetail(item.outInBoundId) + }) + }else{ + this.isShowOutDetail = true + this.$nextTick(() => { + this.$refs.OutDetailRef.visible = true + this.$refs.OutDetailRef.getDetail(item.outInBoundId) + }) + } + }, + handleEx() { + this.$dialog.exportConfirm('纭瀵煎嚭鍚楋紵') + .then(() => { + this.loading = true + ywOutinboundRecordEx({ + page: this.pagination.page, + capacity: 1000000, + model: this.filters + }) + .then(response => { + this.download(response) + }) + .catch(e => { + this.$tip.apiFailed(e) + }) + .finally(() => { + this.loading = false + }) + }) + .catch(() => { }) + }, + initData() { + getStoreList({ capacity: 9999, page: 1, model: {} }).then(res => { + this.queryFormConfig.formItems[1].options = res.records || [] + }) + }, + getList(page) { + const { pagination, filters } = this + this.loading = true + if (filters.selDate && filters.selDate.length > 0) { + filters.doneDateStart = filters.selDate[0] + filters.doneDateEnd = filters.selDate[1] + } else { + filters.doneDateStart = null + filters.doneDateEnd = null + } + if (filters.selTime && filters.selTime.length > 0) { + filters.createDateStart = filters.selTime[0] + filters.createDateEnd = filters.selTime[1] + } else { + filters.createDateStart = null + filters.createDateEnd = null + } + if(page){ + pagination.page = page + } + ywOutinboundRecord({ + model: { + ...filters + }, + capacity: pagination.pageSize, + page: pagination.page, + }).then(res => { + this.loading = false + this.list = res.records || [] + this.pagination.total = res.total || 0 + }, () => { + this.loading = false + }) + }, + clear() { + this.filters = {} + this.pagination.pageSize = 10 + this.pagination.page = 1 + this.getList() + }, + handleSizeChange(capacity) { + this.pagination.pageSize = capacity + this.getList() + } + } +} +</script> + +<style></style> -- Gitblit v1.9.3