| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218 |
- <template>
- <div class="ele-body">
- <el-card shadow="never" v-loading="loading">
- <reportloss-search @search="reload"> </reportloss-search>
- <!-- 数据表格 -->
- <ele-pro-table
- ref="table"
- :columns="columns"
- :datasource="datasource"
- cache-key="systemRoleTable"
- >
- <template v-slot:code="{ row }">
- <el-link type="primary" @click="goDetail(row)">
- {{ row.code }}
- </el-link>
- </template>
- <!-- 表头工具栏 -->
- <template v-slot:toolbar>
- <el-button
- size="small"
- type="primary"
- icon="el-icon-plus"
- class="ele-btn-icon"
- @click="openEdit()"
- >
- 新建
- </el-button>
- </template>
- <template v-slot:action="{ row }">
- <el-link
- v-if="row.status == 0"
- type="primary"
- :underline="false"
- icon="el-icon-edit"
- @click="openEdit(row)"
- >
- 修改
- </el-link>
- </template>
- </ele-pro-table>
- </el-card>
- <!-- 新建或编辑弹窗 -->
- <AddReportDialog
- ref="addInventoryDialogRef"
- :dialogTile="dialogTitle"
- :id="inventoryId"
- @refreshList="reload"
- :isBindPlan="isBindPlan"
- />
- </div>
- </template>
- <script>
- import ReportlossSearch from './components/reportloss-search.vue';
- import AddReportDialog from './components/addReportDialog.vue';
- import { getReportsList } from '@/api/inventory';
- export default {
- components: {
- ReportlossSearch,
- AddReportDialog
- },
- data() {
- return {
- // 0待审核,1=审核中,2=已审核
- statusOptions: [
- {
- value: 0,
- label: '待审核'
- },
- {
- value: 1,
- label: '审核中'
- },
- {
- value: 2,
- label: '已审核'
- }
- ],
- dialogTitle: '',
- inventoryId: '',
- isBindPlan: false,
- // 表格列配置
- columns: [
- {
- columnKey: 'index',
- label: '序号',
- type: 'index',
- width: 55,
- align: 'center',
- showOverflowTooltip: true,
- fixed: 'left'
- },
- {
- slot: 'code',
- prop: 'code',
- label: '单号',
- align: 'center',
- showOverflowTooltip: true,
- minWidth: 110
- },
- {
- prop: 'name',
- label: '名称',
- align: 'center',
- showOverflowTooltip: true,
- minWidth: 110
- },
- {
- prop: 'warehouseName',
- label: '仓库',
- align: 'center',
- showOverflowTooltip: true,
- minWidth: 110
- },
- {
- prop: 'executeGroupName',
- label: '报损报溢部门',
- align: 'center',
- showOverflowTooltip: true,
- minWidth: 110
- },
- {
- prop: 'executorName',
- label: '报损报溢人',
- align: 'center',
- showOverflowTooltip: true,
- minWidth: 110
- },
- {
- prop: 'createTime',
- label: '报损时间',
- align: 'center',
- showOverflowTooltip: true,
- minWidth: 110
- },
- {
- prop: 'status',
- label: '状态',
- align: 'center',
- showOverflowTooltip: true,
- formatter: (row) => {
- return this.statusOptions.filter(
- (item) => item.value == row.status
- )[0].label;
- }
- },
- {
- columnKey: 'action',
- label: '操作',
- width: 230,
- align: 'center',
- resizable: false,
- slot: 'action',
- showOverflowTooltip: true
- }
- ],
- // 加载状态
- loading: false
- };
- },
- computed: {},
- methods: {
- openEdit(row) {
- if (row) {
- this.dialogTitle = '修改报损报溢';
- this.inventoryId = row.id;
- } else {
- this.dialogTitle = '新增报损报溢';
- this.inventoryId = '';
- }
- this.isBindPlan = false;
- this.$refs.addInventoryDialogRef.dialogVisible = true;
- },
- /* 表格数据源 */
- datasource({ page, limit, where, order }) {
- return getReportsList({ pageNum: page, size: limit, ...where });
- },
- async changeEnable(row) {
- const res = await putRoles(row);
- if (res.code == 0) {
- this.$message({
- type: 'success',
- message: '修改成功',
- customClass: 'ele-message-border'
- });
- this.reload();
- }
- },
- /* 刷新表格 */
- reload(where) {
- this.$refs.table.reload({ page: 1, where });
- },
- // 详情
- goDetail(row) {
- this.dialogTitle = '报损报溢详情';
- this.inventoryId = row.id;
- this.isBindPlan = true;
- this.$refs.addInventoryDialogRef.dialogVisible = true;
- },
- // 新增
- addClick() {
- this.$router.push({
- path: '/warehouseManagement/stocktaking/reportLoss/add'
- // query: {
- // id
- // }
- });
- },
- // 撤回
- editRow(row) {}
- }
- };
- </script>
- <style lang="scss" scoped></style>
|