| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753 |
- <template>
- <!-- 工单列表 -->
- <el-dialog
- :visible.sync="equipmentdialog"
- :before-close="handleClose"
- :close-on-click-modal="true"
- :close-on-press-escape="false"
- append-to-body
- width="70%"
- title="生产工单"
- >
- <div>
- <seek-page :seekList="seekList" @search="search"></seek-page>
- <el-row>
- <el-col :span="24" class="table_col" v-if="equipmentdialog">
- <ele-pro-table
- ref="equiTable"
- :columns="columns"
- :datasource="datasource"
- :selection.sync="selection"
- :current.sync="current"
- highlight-current-row
- row-key="id"
- height="50vh"
- :pageSize="20"
- @update:selection="handleSelectionChange"
- >
- </ele-pro-table>
- </el-col>
- </el-row>
- </div>
- <div class="btns">
- <el-button type="primary" size="small" @click="selected">选择</el-button>
- <el-button size="small" @click="handleClose">关闭</el-button>
- </div>
- </el-dialog>
- </template>
- <script>
- import { produceOrder } from '@/api/aps/index.js';
- import produceOrderSearch from './produceOrderSearch.vue';
- export default {
- components: { produceOrderSearch },
- props: {
- selectList: Array,
- type: {
- default: 2 //1多选 2单选
- }
- },
- data() {
- return {
- planType: [
- { label: '所有计划类型', value: null },
- { label: '内销计划', value: '1' },
- { label: '外销计划', value: '2' },
- { label: '预制计划', value: '3' }
- ],
- statusOpt: {
- first: [
- { label: '所有状态', value: '5,4' },
- { label: '待生产', value: '4' },
- { label: '生产中', value: '5' }
- // { label: '已延期', value: '7' }
- ],
- second: [{ label: '已完成', value: '6' }]
- },
- equipmentdialog: false,
- current: null,
- columns: [
- {
- width: 45,
- type: 'selection',
- columnKey: 'selection',
- align: 'center',
- reserveSelection: true
- },
- {
- label: '生产工单号',
- align: 'center',
- prop: 'code',
- minWidth: 110,
- showOverflowTooltip: true
- },
- {
- prop: 'productionPlanCode',
- label: '计划编号',
- align: 'center',
- minWidth: 110,
- showOverflowTooltip: true
- },
- {
- prop: 'planType',
- label: '计划类型',
- align: 'center',
- formatter: (row) => {
- const obj = this.planType.find((i) => i.value == row.planType);
- return obj && obj.label;
- },
- showOverflowTooltip: true
- },
- {
- prop: 'produceRoutingName',
- label: '工艺路线',
- align: 'center',
- showOverflowTooltip: true
- },
- {
- prop: 'productCode',
- label: '产品编码',
- align: 'center',
- showOverflowTooltip: true
- },
- {
- prop: 'productName',
- label: '产品名称',
- align: 'center',
- showOverflowTooltip: true
- },
- {
- prop: 'brandNo',
- label: '牌号',
- align: 'center',
- showOverflowTooltip: true
- },
- {
- prop: 'specification',
- label: '规格',
- align: 'center',
- showOverflowTooltip: true
- },
- {
- prop: 'model',
- label: '型号',
- align: 'center',
- showOverflowTooltip: true
- },
- {
- prop: 'batchNo',
- label: '批次号',
- align: 'center',
- minWidth: 100,
- showOverflowTooltip: true
- },
- {
- prop: 'priority',
- label: '优先级',
- align: 'center',
- minWidth: 120,
- sortable: 'custom',
- showOverflowTooltip: true
- },
- {
- prop: 'formingNum',
- label: '要求生产数量',
- align: 'center',
- showOverflowTooltip: true,
- minWidth: 110
- },
- {
- prop: 'formingWeight',
- label: '要求生产重量',
- align: 'center',
- showOverflowTooltip: true,
- minWidth: 110
- },
- {
- prop: 'formedNum',
- label: '已生产数量',
- align: 'center',
- showOverflowTooltip: true,
- minWidth: 110
- },
- {
- prop: 'formedWeight',
- label: '已生产重量',
- align: 'center',
- showOverflowTooltip: true,
- minWidth: 110
- },
- {
- prop: 'planStartTime',
- label: '计划开始时间',
- align: 'center',
- showOverflowTooltip: true,
- minWidth: 110
- },
- {
- prop: 'planCompleteTime',
- label: '计划结束时间',
- align: 'center',
- showOverflowTooltip: true,
- minWidth: 110
- },
- {
- prop: 'startTime',
- label: '实际开始时间',
- align: 'center',
- showOverflowTooltip: true,
- minWidth: 110
- },
- {
- prop: 'createTime',
- label: '创建时间',
- align: 'center',
- showOverflowTooltip: true,
- minWidth: 110
- },
- {
- prop: 'teamName',
- label: '班组',
- align: 'center',
- showOverflowTooltip: true
- }
- ],
- categoryLevelId: null,
- code: null,
- selection: [],
- ids: [],
- allSelection: [],
- activeName: 'first'
- };
- },
- computed: {
- // 表格列配置
- seekList() {
- return [
- {
- label: '关键字:',
- value: 'keyWord',
- type: 'input',
- placeholder: ''
- },
- {
- label: '生产工单号:',
- value: 'code',
- type: 'input',
- placeholder: '',
- labelWidth: 100
- },
- {
- label: '生产订单号:',
- value: 'apsWorkOrderCode',
- type: 'input',
- labelWidth: 100
- },
- {
- label: '计划编号:',
- value: 'productionPlanCode',
- type: 'input',
- width: 240
- },
- {
- label: '计划类型:',
- value: 'planType',
- type: 'select',
- placeholder: '',
- width: 240,
- // 加载状态
- planList: this.planType
- },
- {
- label: '工艺路线',
- value: 'produceRoutingName',
- type: 'input',
- placeholder: '',
- width: 240
- },
- {
- label: '产品编码',
- value: 'productCode',
- type: 'input',
- placeholder: '',
- width: 240
- },
- {
- label: '产品名称:',
- value: 'productName',
- type: 'input',
- placeholder: '',
- width: 240
- },
- {
- label: '牌号',
- value: 'brandNo',
- type: 'input',
- placeholder: '',
- width: 240
- },
- {
- label: '型号',
- value: 'model',
- type: 'input',
- placeholder: '',
- width: 240
- },
- {
- label: '创建时间:',
- value: 'createTime',
- type: 'date',
- dateType: 'daterange',
- placeholder: '',
- width: 240
- }
- ];
- },
- basicColumns() {
- const num = this.columnsVersion;
- const opt = {
- first: [
- // {
- // prop: 'deliveryTime',
- // label: '预测交货日期',
- // align: 'center',
- // showOverflowTooltip: true,
- // minWidth: 110
- // }
- ],
- second: [
- {
- prop: 'completeTime',
- label: '完成时间',
- align: 'center'
- },
- {
- prop: 'cycle',
- label: '生产周期',
- align: 'center'
- }
- ]
- };
- return [
- {
- width: 45,
- type: 'selection',
- columnKey: 'selection',
- align: 'center',
- fixed: 'left'
- },
- {
- prop: 'batchNo',
- label: '批次号',
- align: 'center',
- minWidth: 130,
- showOverflowTooltip: true
- },
- {
- prop: 'lineNumber',
- label: '行号',
- align: 'center',
- minWidth: 130,
- showOverflowTooltip: true
- },
- {
- prop: 'code',
- slot: 'code',
- label: '生产工单号',
- align: 'center',
- minWidth: 110,
- showOverflowTooltip: true
- },
- // {
- // prop: 'originalCode',
- // label: '原始工单号',
- // align: 'center',
- // minWidth: 110
- // },
- {
- prop: 'QRcode',
- slot: 'QRcode',
- label: '二维码',
- align: 'center',
- minWidth: 110,
- showOverflowTooltip: true
- },
- {
- prop: 'apsWorkOrderCode',
- label: '生产订单号',
- slot: 'apsWorkOrderCode',
- align: 'center',
- minWidth: 110,
- showOverflowTooltip: true
- },
- {
- prop: 'productionPlanCode',
- label: '计划编号',
- align: 'center',
- minWidth: 110,
- showOverflowTooltip: true
- },
- {
- prop: 'planType',
- label: '计划类型',
- align: 'center',
- showOverflowTooltip: true,
- formatter: (row) => {
- const obj = this.planType.find((i) => i.value == row.planType);
- return obj && obj.label;
- }
- },
- {
- prop: 'bomType',
- label: '生产类型',
- align: 'center',
- showOverflowTooltip: true,
- width: 120,
- formatter: (row) => {
- if (row.bomType == 1) {
- return '产品(PBOM)';
- }
- if (row.bomType == 2) {
- return '加工(MBOM)';
- }
- if (row.bomType == 3) {
- return '装配(ABOM)';
- }
- // if (row.bomType == 4) {
- // return '装配(EBOM)';
- // }
- return '';
- }
- },
- {
- prop: 'bomCategoryName',
- label: 'BOM版本',
- align: 'center',
- width: 130,
- showOverflowTooltip: true,
- formatter: (row) => {
- if (row.bomCategoryName) {
- return `${row.bomCategoryName} (V${row.bomCategoryVersions}.0)`;
- }
- return '';
- }
- },
- {
- prop: 'produceRoutingName',
- label: '工艺路线',
- align: 'center',
- showOverflowTooltip: true
- },
- {
- prop: 'productCode',
- label: '编码',
- align: 'center',
- showOverflowTooltip: true
- },
- {
- prop: 'colorKey',
- label: '颜色',
- align: 'center',
- showOverflowTooltip: true,
- minWidth: 110
- },
- {
- prop: 'modelKey',
- label: '机型',
- align: 'center',
- showOverflowTooltip: true,
- minWidth: 110
- },
- {
- prop: 'productName',
- label: '名称',
- align: 'center',
- showOverflowTooltip: true
- },
- {
- prop: 'model',
- label: '型号',
- align: 'center',
- showOverflowTooltip: true
- },
- {
- prop: 'specification',
- label: '规格',
- align: 'center',
- showOverflowTooltip: true
- },
- {
- prop: 'productionCodes',
- label: '生产编号',
- align: 'center',
- minWidth: 150,
- showOverflowTooltip: true
- },
- {
- prop: 'brandNo',
- label: '牌号',
- align: 'center',
- showOverflowTooltip: true
- },
- {
- prop: 'taskName',
- label: '工序进度',
- align: 'center',
- showOverflowTooltip: true
- },
- {
- prop: 'singleReport',
- slot: 'singleReport',
- label: '报工类型',
- align: 'center',
- showOverflowTooltip: true
- },
- {
- prop: 'outsourceStatus',
- label: '委外状态',
- align: 'center',
- slot: 'outsourceStatus',
- showOverflowTooltip: true
- },
- {
- prop: 'entrustStatus',
- label: '请托状态',
- align: 'center',
- slot: 'entrustStatus',
- showOverflowTooltip: true
- },
- {
- prop: 'priority',
- label: '优先级',
- align: 'center',
- minWidth: 120,
- slot: 'priority',
- sortable: 'custom'
- },
- {
- prop: 'formingNum',
- label: '要求生产数量',
- align: 'center',
- slot: 'formingNum',
- showOverflowTooltip: true,
- minWidth: 110
- },
- {
- prop: 'unit',
- label: '单位',
- align: 'center',
- showOverflowTooltip: true,
- minWidth: 110
- },
- {
- prop: 'factoriesName',
- label: '所属工厂',
- align: 'center',
- showOverflowTooltip: true,
- minWidth: 110
- },
- {
- prop: 'formingWeight',
- label: '要求生产重量',
- slot: 'formingWeight',
- align: 'center',
- showOverflowTooltip: true,
- minWidth: 110
- },
- {
- prop: 'formedNum',
- label: '已生产数量',
- align: 'center',
- showOverflowTooltip: true,
- minWidth: 110
- },
- {
- prop: 'formedWeight',
- label: '已生产重量',
- align: 'center',
- showOverflowTooltip: true,
- minWidth: 110
- },
- {
- prop: 'planStartTime',
- label: '计划开始时间',
- align: 'center',
- showOverflowTooltip: true,
- minWidth: 150,
- sortable: 'custom'
- },
- {
- prop: 'planCompleteTime',
- label: '计划结束时间',
- align: 'center',
- showOverflowTooltip: true,
- minWidth: 150,
- sortable: 'custom'
- },
- {
- prop: 'startTime',
- label: '实际开始时间',
- align: 'center',
- showOverflowTooltip: true,
- minWidth: 150,
- sortable: 'custom'
- },
- {
- prop: 'completeTime',
- label: '实际完成时间',
- align: 'center',
- showOverflowTooltip: true,
- minWidth: 150,
- sortable: 'custom'
- },
- ...opt[this.activeName],
- {
- prop: 'createTime',
- label: '创建时间',
- align: 'center',
- showOverflowTooltip: true,
- minWidth: 150,
- sortable: 'custom'
- },
- // {
- // prop: 'status',
- // slot: 'status',
- // label: '状态',
- // align: 'center',
- // formatter: (row) => {
- // const obj = this.statusOpt[this.activeName].find(
- // (i) => i.value == row.status
- // );
- // return obj && obj.label;
- // }
- // },
- {
- prop: 'deviceName',
- slot: 'deviceName',
- label: '设备名称',
- align: 'center',
- showOverflowTooltip: true
- },
- {
- prop: 'crewNames',
- slot: 'crewNames',
- label: '报工人员',
- align: 'center',
- showOverflowTooltip: true
- },
- {
- prop: 'teamName',
- label: '班组',
- align: 'center',
- showOverflowTooltip: true
- }
- ];
- },
- clientEnvironmentId() {
- return this.$store.state.user.info.clientEnvironmentId;
- }
- },
- methods: {
- datasource({ page, where, limit }) {
- return produceOrder({
- ...where,
- pageNum: page,
- size: limit
- });
- },
- open(list) {
- this.equipmentdialog = true;
- this.allSelection = list;
- this.$nextTick(() => {
- this.allSelection.forEach((item) => {
- this.$refs.equiTable.toggleRowSelection(item, true);
- });
- });
- },
- search(e) {
- if (Array.isArray(e.createTime) && e.createTime.length) {
- e.createTimeStart = e.createTime[0];
- e.createTimeEnd = e.createTime[1];
- }
- this.reload(e);
- },
- /* 刷新表格 */
- reload(where = {}) {
- this.$nextTick(() => {
- where.statusList = (
- where.status || this.statusOpt[this.activeName][0].value
- ).split(',');
- this.$refs.equiTable.reload({ page: 1, where });
- });
- },
- handleClose() {
- this.equipmentdialog = false;
- this.$refs.equiTable.clearSelection();
- },
- handleSelectionChange(data) {
- this.allSelection = data;
- },
- // 选择
- selected() {
- this.$emit('choose', this.selection);
- this.handleClose();
- }
- }
- };
- </script>
- <style lang="scss" scoped>
- .tree_col {
- border: 1px solid #eee;
- padding: 10px 0;
- box-sizing: border-box;
- max-height: 530px;
- overflow: auto;
- }
- .table_col {
- padding-left: 10px;
- ::v-deep .el-table th.el-table__cell {
- background: #f2f2f2;
- }
- }
- .pagination {
- text-align: right;
- padding: 10px 0;
- }
- .btns {
- text-align: center;
- padding: 10px 0;
- }
- .topsearch {
- margin-bottom: 15px;
- }
- </style>
|