| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238 |
- <template>
- <div id="stocktakingWork_index">
- <el-card shadow="never" v-loading="loading">
- <work-search @search="reload"> </work-search>
- <!-- 数据表格 -->
- <ele-pro-table
- ref="table"
- :columns="columns"
- height="calc(100vh-300px)"
- :pageSize="20"
- :datasource="datasource"
- >
- <template v-slot:code="{ row }">
- <el-link type="primary" @click="goDetail(row)">
- {{ row.code }}
- </el-link>
- </template>
- <template v-slot:action="{ row }">
- <el-link
- v-if="row.status == 0"
- type="primary"
- :underline="false"
- icon="el-icon-edit"
- @click="control(row)"
- >
- 报工
- </el-link>
- </template>
- </ele-pro-table>
- </el-card>
- <DisposeDialog ref="disposeDialogRef" @flushed="reload"></DisposeDialog>
- </div>
- </template>
- <script>
- import DisposeDialog from './components/disposeDialog.vue';
- import WorkSearch from './components/work-search.vue';
- import { getPlanOrderList } from '@/api/warehouseManagement/inventory';
- export default {
- components: {
- WorkSearch,
- DisposeDialog
- },
- data() {
- return {
- visibleDialog: false,
- // 0-待处理,1-执行中,2-已完成
- statusObj: {
- 0: '待处理',
- 1: '执行中',
- 2: '已完成'
- },
- // 表格列配置
- columns: [
- {
- columnKey: 'index',
- label: '序号',
- type: 'index',
- width: 55,
- align: 'center',
- showOverflowTooltip: true,
- fixed: 'left'
- },
- {
- slot: 'code',
- prop: 'code',
- label: '盘点单号',
- align: 'center',
- showOverflowTooltip: true,
- minWidth: 200
- },
- {
- prop: 'status',
- label: '状态',
- align: 'center',
- showOverflowTooltip: true,
- slot: 'status',
- minWidth: 110,
- formatter: (row) => {
- return this.statusObj[Number(row.status)];
- }
- },
- {
- prop: 'planCode',
- label: '计划单号',
- align: 'center',
- showOverflowTooltip: true,
- minWidth: 200
- },
- {
- prop: 'planName',
- 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: 'startTime',
- label: '计划开始时间',
- align: 'center',
- showOverflowTooltip: true,
- minWidth: 110
- },
- {
- prop: 'endTime',
- label: '计划结束时间',
- align: 'center',
- showOverflowTooltip: true,
- minWidth: 110
- },
- {
- columnKey: 'action',
- label: '操作',
- width: 80,
- align: 'center',
- resizable: false,
- slot: 'action',
- showOverflowTooltip: true
- }
- ],
- // 加载状态
- loading: false,
- planOrderId: '',
- userInfo: {}
- };
- },
- computed: {
- userInfo() {
- return this.$store.getters.user.info;
- }
- },
- created() {
- // let info = JSON.parse(localStorage.getItem('info'));
- // this.userInfo = info;
- },
- methods: {
- control(row) {
- console.log(row, this.userInfo);
- if (row.executorId != this.userInfo.userId) {
- this.$message({
- type: 'error',
- message: '您不是盘点人员,不能报工!',
- });
- return;
- }
- this.$refs.disposeDialogRef.open(row.id);
- },
- /* 表格数据源 */
- datasource({ page, limit, where, order }) {
- where.status = 0
- where.executorId = this.userInfo.userId;
- return getPlanOrderList({ 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) {
- window.history.pushState(null, '', '/page-wms/warehouseManagement/stocktaking/work/details?id=' + row.id + '&planId=' + row.planId);
- // this.$router.push({
- // path: '/page-wms/warehouseManagement/stocktaking/work/details',
- // query: {
- // id: row.id,
- // planId: row.planId
- // }
- // });
- }
- }
- };
- </script>
- <style lang="scss" scoped>
- #stocktakingWork_index {
- height: calc(100vh - 96px);
- width: 100%;
- padding: 10px;
- box-sizing: border-box;
- // element-ui样式穿透
- :deep(.el-card) {
- height: 100%;
- .el-card__body {
- height: 100%;
- box-sizing: border-box;
- display: flex;
- flex-direction: column;
- .ele-pro-table {
- flex: 1;
- display: flex;
- flex-direction: column;
- .el-table {
- flex: 1;
- // display: flex;
- // flex-direction: column;
- // .el-table__body-wrapper {
- // flex: 1;
- // }
- }
- }
- }
- .el-form-item {
- margin-bottom: 5px !important;
- }
- }
- }
- </style>
|