| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341 |
- <template>
- <div class="ele-body">
- <el-card shadow="never" v-loading="loading">
- <search @search="reload" ref="searchRef"> </search>
- <!-- 数据表格 -->
- <ele-pro-table
- ref="table"
- :columns="columns"
- :datasource="datasource"
- cache-key="warehouseIndex"
- :pageSize="20"
- :height="tableHeight"
- @fullscreen-change="fullscreenChange"
- >
- <template v-slot:code="{ row }">
- <el-link type="primary" :underline="false" @click="details(row)">
- {{ row.code }}
- </el-link>
- </template>
- <template v-slot:totalCount="{ row }">
- {{ row.totalCount }} {{ row.measuringUnit }}
- </template>
- <template v-slot:totalPackage="{ row }">
- {{ row.totalPackage
- }}{{
- row.detailList.length != 0 ? row.detailList[0].packingUnit : ''
- }}
- </template>
- <template v-slot:totalWeight="{ row }">
- {{ row.totalWeight }} {{ row.weightUnit }}
- </template>
- <template v-slot:approvalStatus="{ row }">
- <span :class="{ 'ele-text-success': row.approvalStatus == 2 }">
- {{ statusFormatter(row.approvalStatus) }}
- </span>
- </template>
- <template v-slot:action="{ row }">
- <el-link
- type="primary"
- v-if="row.approvalStatus == 0"
- :underline="false"
- @click="storage(row)"
- >
- 入库
- </el-link>
- <el-link
- type="primary"
- :underline="false"
- @click="handleFlow(row)"
- v-if="row.approvalStatus != 0"
- >
- 流程
- </el-link>
- <!-- <el-link type="primary" :underline="false" @click="details(row)">
- 详情
- </el-link> -->
- </template>
- </ele-pro-table>
- </el-card>
- <tgDetails ref="tgDetailsRefs"></tgDetails>
- <flow ref="flowRef"></flow>
- <storage inboundType="2" ref="storageRefs" @success="reload"></storage>
- </div>
- </template>
- <script>
- import { getList } from '@/api/warehousing/index.js';
- import search from './components/search.vue';
- import tgDetails from './components/tgDetails.vue';
- import storage from './storageComponents/storage.vue';
- import flow from '@/views/materialReturn/components/flow.vue';
- export default {
- components: {
- search,
- tgDetails,
- storage,
- flow
- },
- data() {
- return {
- loading: false,
- statusOpt: [
- { label: '未提交', value: 0 },
- { label: '审核中', value: 1 },
- { label: '审核通过', value: 2 },
- { label: '审核不通过', value: 3 }
- ],
- tableHeight: 'calc(100vh - 300px)'
- };
- },
- computed: {
- // 表格列配置
- columns() {
- return [
- {
- columnKey: 'index',
- label: '序号',
- type: 'index',
- width: 55,
- align: 'center',
- showOverflowTooltip: true,
- fixed: 'left'
- },
- {
- prop: 'code',
- slot: 'code',
- label: '编码',
- align: 'center',
- minWidth: 110,
- showOverflowTooltip: true
- },
- {
- prop: 'categoryCode',
- label: '物品编码',
- align: 'center',
- minWidth: 110,
- showOverflowTooltip: true
- },
- {
- prop: 'workOrderCode',
- label: '工单编码',
- align: 'center',
- minWidth: 110,
- showOverflowTooltip: true
- },
- {
- prop: 'warehouseName',
- label: '仓库名称 ',
- align: 'center',
- showOverflowTooltip: true
- },
- {
- prop: 'categoryLevelName',
- label: '物品分类',
- align: 'center',
- showOverflowTooltip: true
- },
- {
- prop: 'categoryName',
- label: '名称',
- align: 'center',
- showOverflowTooltip: true
- },
- {
- label: '批次号',
- prop: 'batchNo',
- width: '90',
- showOverflowTooltip: true
- },
- {
- label: '型号',
- prop: 'modelType',
- width: '150',
- showOverflowTooltip: true
- },
- {
- label: '规格',
- prop: 'specification',
- width: '150',
- showOverflowTooltip: true
- },
- {
- label: '牌号',
- prop: 'brandNum',
- width: '50',
- showOverflowTooltip: true
- },
- {
- prop: 'totalCount',
- slot: 'totalCount',
- label: '总数量',
- align: 'center',
- showOverflowTooltip: true
- },
- {
- prop: 'totalPackage',
- slot: 'totalPackage',
- label: '总包装',
- align: 'center',
- showOverflowTooltip: true
- },
- {
- prop: 'totalWeight',
- slot: 'totalWeight',
- label: '总重量',
- align: 'center',
- showOverflowTooltip: true
- },
- {
- prop: 'colorKey',
- label: '颜色',
- align: 'center',
- showOverflowTooltip: true,
- minWidth: 110
- },
- {
- prop: 'modelKey',
- label: '机型',
- align: 'center',
- showOverflowTooltip: true,
- minWidth: 110
- },
- {
- prop: 'produceRoutingName',
- label: '工艺路线',
- align: 'center',
- showOverflowTooltip: true
- },
- {
- prop: 'salesCode',
- label: '销售订单编码',
- align: 'center',
- width: 110,
- showOverflowTooltip: true
- },
- {
- prop: 'type',
- label: '入库类型',
- align: 'center',
- showOverflowTooltip: true,
- formatter: (row, column, cellValue) => {
- return cellValue == 1
- ? '生产入库'
- : cellValue == 8
- ? '委外入库'
- : cellValue == 3
- ? '退料入库'
- : '';
- }
- },
- {
- prop: 'approvalUserName',
- label: '审核人',
- align: 'center',
- showOverflowTooltip: true
- },
- {
- prop: 'executorName',
- label: '执行人',
- align: 'center',
- showOverflowTooltip: true
- },
- {
- prop: 'createTime',
- label: '创建时间',
- align: 'center',
- showOverflowTooltip: true,
- minWidth: 110
- },
- {
- prop: 'approvalStatus',
- slot: 'approvalStatus',
- label: '状态',
- align: 'center',
- showOverflowTooltip: true
- },
- {
- columnKey: 'action',
- label: '操作',
- width: 120,
- align: 'center',
- resizable: false,
- fixed: 'right',
- slot: 'action',
- showOverflowTooltip: true
- }
- ];
- }
- },
- created() {},
- methods: {
- statusFormatter(status) {
- const obj = this.statusOpt.find((i) => i.value == status);
- return obj && obj.label;
- },
- /* 表格数据源 */
- datasource({ page, limit, where }) {
- return getList({
- pageNum: page,
- size: limit,
- ...where
- });
- },
- details(row) {
- this.$refs.tgDetailsRefs.open(row);
- },
- storage(row) {
- // let data = JSON.parse(JSON.stringify(row))
- // data.detailList.forEach(item=>{
- // if(data.categoryName.includes('砌块')||data.categoryName.includes('板材')){
- // item.packingCount=item.packingCount
- // }
- // })
- this.$refs.storageRefs.pickerSuccess(row);
- },
- handleFlow(row) {
- if (!row.processInstanceId) {
- return this.$message.warning('暂无流程图');
- }
- this.$refs.flowRef.open(row.processInstanceId);
- },
- /* 刷新表格 */
- reload(where) {
- this.$nextTick(() => {
- this.$refs.table.reload({ page: 1, where });
- });
- },
- fullscreenChange(fullscreen) {
- if (fullscreen) {
- this.tableHeight = 'calc(100vh - 120px)';
- } else {
- this.tableHeight = 'calc(100vh - 300px)';
- }
- }
- }
- };
- </script>
- <style lang="scss" scoped></style>
|