| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262 |
- <template>
- <div class="ele-body">
- <el-card shadow="never" v-loading="loading">
- <productSearch @search="reload" ref="searchRef" >
- </productSearch>
- <!-- 数据表格 -->
- <ele-pro-table
- ref="table"
- :columns="columns"
- :datasource="datasource"
- row-key="id"
- cache-key="pickKey"
- :selection.sync="selection"
- autoAmendPage
- :parse-data="parseData"
- @update:selection="handleSelectionChange"
- >
- <template v-slot:toolbar>
-
- <el-button
- type="primary"
-
- size="mini"
- @click="handSelfPick"
- >自建处置单</el-button
- >
- </template>
- <template v-slot:formedNum="{ row }">
- {{ row.notFormedNum || 0 }} / {{ row.formedNum || 0 }}
- </template>
- <template v-slot:weight="{ row }">
- {{ row.weight || 0 }} / {{ row.weightUnit }}
- </template>
- <template v-slot:action="{ row }">
- <el-button type="text" size="mini" @click="handDetailed(row)"
- >详情</el-button
- >
- </template>
- </ele-pro-table>
- </el-card>
- <!-- <addPick v-if="addPickShow" @close="close"></addPick>
- <selfBuildPick v-if="selfBuildPickShow" @close="close"></selfBuildPick>
-
- <detailed
- @detailedClose="detailedClose"
- v-if="detailedShow"
- :detailedObj="detailedObj"
- ></detailed>
-
- <selfDetailed
- @detailedClose="detailedClose"
- v-if="selfDetailedShow"
- :detailedObj="detailedObj"
- ></selfDetailed> -->
- </div>
- </template>
- <script>
- import { getPage, returnPage } from '@/api/byProduct/index';
- import productSearch from './components/product-search.vue';
- // import addPick from './components/addPick.vue';
- // import selfBuildPick from './components/selfBuildPick.vue';
- // import detailed from '@/views/produce/components/picking/detailed.vue';
- // import selfDetailed from './components/selfDetailed.vue';
- export default {
- components: {
- productSearch
- // addPick,
- // selfBuildPick,
- // detailed,
- // selfDetailed
- },
- data() {
- return {
- // 加载状态
- loading: false,
- selection: [],
- addPickShow: false,
- selfBuildPickShow: false,
- detailedShow: false,
- detailedObj: null,
- selfDetailedShow: false,
- statusList: ['未领料', '领料中', '已出库', '已驳回']
- };
- },
- computed: {
- columns() {
- return [
-
- {
- prop: 'code',
- label: '处置单号',
- align: 'left',
-
- },
- {
- prop: 'workOrderCode',
- label: '工单编码',
- align: 'center'
- },
- {
- prop: 'taskName',
- label: '工序',
- align: 'center'
- },
-
- {
- prop: 'categoryCode',
- label: '物品编码',
- align: 'center'
- },
- {
- prop: 'categoryName',
- label: '物品名称',
- align: 'center'
- },
- {
- prop: 'formedNum',
- slot: 'formedNum',
- label: '不合格品/合格品数量',
- align: 'center',
- width: 140,
- },
- {
- prop: 'weight',
- slot: 'weight',
- label: '重量',
- align: 'center',
- width: 140,
- },
-
- {
- prop: 'executorName',
- label: '处置人',
- align: 'center',
- width: 95,
- },
- {
- prop: 'createTime',
- label: '创建时间',
- align: 'center',
- width: 95,
- },
- {
- prop: '',
- label: '操作',
- width: 80,
- align: 'center',
- resizable: false,
- fixed: 'right',
- slot: 'action'
- }
- ];
- }
- },
- created() {},
- methods: {
- /* 表格数据源 */
- async datasource({ page, limit, where }) {
- let parma = {
- ...where,
- pageNum: page,
- size: limit
- };
-
- let res = await getPage(parma);
- return res;
- },
- /* 数据转为树形结构 */
- parseData(data) {
- return {
- ...data,
- list: this.$util.toTreeData({
- data: data.list,
- count: data.total,
- idField: 'id',
- parentIdField: 'parentId'
- })
- };
- },
- handPick() {
- this.addPickShow = true;
- },
- close(val) {
- if (val) {
- this.reload();
- }
- this.addPickShow = false;
- this.selfBuildPickShow = false;
- },
- handSelfPick() {
- this.selfBuildPickShow = true;
- },
- selfClose(val) {
- if (val) {
- this.reload();
- }
- this.selfBuildPickShow = false;
- },
- handDetailed(row) {
- this.detailedObj = JSON.stringify(row);
- if (row.type == 1) {
- this.selfDetailedShow = true;
- } else {
- this.detailedShow = true;
- }
- },
- detailedClose() {
- this.detailedShow = false;
- this.selfDetailedShow = false;
- },
- handleSelectionChange(data) {
- let ids = [];
- ids = data.map((item) => item.id);
- this.$emit('selectionChange', ids);
- },
- /* 刷新表格 */
- reload(where = {}) {
- this.$refs.table.reload({ page: 1, where });
- }
- }
- };
- </script>
|