| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286 |
- <template>
- <div>
- <ele-pro-table
- ref="table"
- :columns="columns"
- max-height="68vh"
- :datasource="dataList"
- cache-key="pickingDetails"
- highlight-current-row
- @row-click="rowClick"
- :need-page="false"
- @refresh="refresh"
- >
- <template v-slot:type="{ row }">
- <!-- <el-button type="text" size="mini" @click="handDetailed(row)"
- >详情</el-button
- > -->
- <el-tag v-if="row.type == 1">自建领料</el-tag>
- <el-tag v-if="row.type == 2">工单领料</el-tag>
- <el-tag v-if="row.type == 3">委外领料</el-tag>
- </template>
- <template v-slot:action="{ row }">
- <el-button type="text" size="mini" @click="handDetailed(row)"
- >详情</el-button
- >
- </template>
- <template v-slot:status="{ row }">
- <el-tag
- :type="['danger', 'success', 'warning', 'danger'][row.status]"
- effect="dark"
- style="margin: 3px 0"
- >{{ statusList[row.status] }}</el-tag
- >
- </template>
- </ele-pro-table>
- <detailed
- @detailedClose="detailedClose"
- v-if="detailedShow"
- :detailedObj="detailedObj"
- ></detailed>
- <!-- <outsourcingPickingList
- v-if="outsourcingPickingShow"
- ref="outsourcingPickingListRef"
- :workTaskId="workListIds[0]"
- :taskId="taskId"
- :workList="workList"
- @closeOutsourcingPicking="closeOutsourcingPicking"
- ></outsourcingPickingList> -->
- <!-- <picking
- v-if="pickingShow"
- @close="pickingClose"
- :workListIds="workListIds"
- ></picking> -->
- </div>
- </template>
- <script>
- import { pickDetails } from '@/api/produce/picking';
- import { workorderList } from '@/api/produce/workOrder';
- import detailed from '@/views/produce/components/picking/detailed.vue';
- // import outsourcingPickingList from './outsourcingPickingList.vue';
- import { getTaskInstanceById } from '@/api/produce/index';
- import { checkOutsource, listOutsource } from '@/api/produce/picking';
- // import picking from './outsourceIndex.vue';
- import { boolean } from 'mathjs';
- export default {
- name: 'picking-details',
- components: { detailed },
- props: {
- isDetails: {
- type: Boolean,
- default: false
- },
- workTaskId: {},
- taskId: {},
- workOrderInfo: {
- type: Object,
- default: {}
- }
- },
- data() {
- return {
- dataList: [],
- detailedShow: false,
- detailedObj: null,
- statusList: ['未领料', '领料中', '已出库', '已驳回'],
- outsourcingPickingShow: false,
- workList: [],
- pickingShow: false
- };
- },
- computed: {
- // 表格列配置
- columns() {
- return [
- {
- columnKey: 'index',
- label: '序号',
- type: 'index',
- width: 55,
- align: 'center',
- showOverflowTooltip: true
- },
- // {
- // label: '工序',
- // prop: 'taskName',
- // width: 120,
- // align: 'center',
- // showOverflowTooltip: true
- // },
- {
- prop: 'createTime',
- label: '领料时间',
- align: 'center',
- showOverflowTooltip: true
- },
- {
- prop: 'code',
- label: '领料单编号',
- align: 'center',
- showOverflowTooltip: true
- },
- {
- prop: 'name',
- label: '领料单名称',
- align: 'center',
- showOverflowTooltip: true
- },
- {
- prop: 'type',
- label: '领料类型',
- align: 'center',
- slot: 'type',
- showOverflowTooltip: true
- },
- {
- prop: 'executorName',
- label: '领料人',
- align: 'center'
- },
- {
- prop: 'status',
- slot: 'status',
- label: '状态',
- align: 'center'
- },
- {
- prop: '',
- label: '操作',
- width: 80,
- align: 'center',
- resizable: false,
- fixed: 'right',
- slot: 'action'
- }
- ];
- },
- taskObj() {
- return this.$store.state.user.taskObj;
- },
- clientEnvironmentId() {
- return this.$store.state.user.info.clientEnvironmentId;
- }
- },
- mounted() {
- const ids = [];
- ids.push(this.workOrderInfo.id);
- this.getList(ids);
- },
- methods: {
- getList(workListIds) {
- this.workListIds = workListIds || [];
- pickDetails(workListIds).then((res) => {
- this.dataList = res || [];
- this.$forceUpdate();
- });
- },
- rowClick(row) {},
- handleAdd() {
- this.$emit('pickAdd', 'pick');
- },
- refresh() {
- this.getList(this.workListIds);
- },
- handDetailed(row) {
- this.detailedObj = JSON.stringify(row);
- this.detailedShow = true;
- },
- detailedClose() {
- this.detailedShow = false;
- },
- openOutsourcingPicking() {
- if (this.workListIds) {
- this.getTaskInstanceByIdFn();
- // this.outsourcingPickingShow=true
- } else {
- this.$message.warning('请选择工单');
- }
- },
- closeOutsourcingPicking() {
- this.outsourcingPickingShow = false;
- },
- pickingClose() {
- this.pickingShow = false;
- this.getList(this.workListIds);
- },
- //获取工单列表
- getTaskInstanceByIdFn() {
- if (this.workListIds.length == 1) {
- this.pickingShow = true;
- } else {
- this.$message.warning('只能选择一个工单进行委外领料');
- }
- // let param = {
- // ids: [this.workListIds[0]],
- // taskId: this.taskId
- // };
- // workorderList(param)
- // .then((res) => {
- // let _arr = res.map((e) => {
- // e.pickList = [...e.bomDetailDTOS];
- // e.bomDetailDTOS = [];
- // return e;
- // });
- // this.workList = JSON.parse(JSON.stringify(_arr));
- // console.log(this.workList, 'this.workList');
- // this.outsourcingPickingShow = true;
- // this.getOutsourcingDataList(
- // this.workList[0].currentTaskDiagram.taskId
- // );
- // this.$forceUpdate();
- // })
- // .finally(() => {});
- // checkOutsource({
- // ids: [this.workListIds[0]],
- // taskId: this.workTaskId
- // }).then((res) => {
- // console.log(res);
- // });
- // getTaskInstanceById(this.workListIds[0]).then((res) => {
- // // console.log(res,this.workTaskId, 'res2345678');
- // let { data } = res;
- // if (data.length) {
- // let arr = data.filter((item) => item.taskId == this.workTaskId);
- // console.log(arr, 'arr');
- // console.log(arr, this.workTaskId, 'res2345678');
- // if (arr[0].existOutsource) {
- // } else {
- // this.$message.warning('当前工序不能委外领料');
- // }
- // }
- // });
- }
- },
- created() {}
- };
- </script>
- <style lang="scss" scoped></style>
|