|
|
@@ -42,6 +42,19 @@
|
|
|
</template>
|
|
|
|
|
|
|
|
|
+ <template v-slot:priority="{ row }">
|
|
|
+ <el-input
|
|
|
+ v-model="row.priority"
|
|
|
+ type="number"
|
|
|
+ size="mini"
|
|
|
+ @change="priorityChange(row)"
|
|
|
+ ></el-input>
|
|
|
+ <div class="sort-wrap">
|
|
|
+ <i class="el-icon-caret-top" @click="sortTop(row)"></i>
|
|
|
+ <i class="el-icon-caret-bottom" @click="sortBottom(row)"></i>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ </template>
|
|
|
|
|
|
<template v-slot:status="{ row }">
|
|
|
<span :class="{ 'ele-text-danger': row.status == 3 }">
|
|
|
@@ -87,7 +100,7 @@ import {
|
|
|
getPage,
|
|
|
batchCompletion,
|
|
|
cancelCompletion,
|
|
|
-
|
|
|
+ updatePriority
|
|
|
} from '@/api/produceOrder/index.js';
|
|
|
import produceOrderSearch from './components/produceOrder-search.vue';
|
|
|
import createDialog from './components/createDialog.vue';
|
|
|
@@ -96,7 +109,7 @@ import pickingDialog from './components/pickingDialog.vue';
|
|
|
import print from './components/print.vue';
|
|
|
import printSr from './components/printSr'
|
|
|
import printTg from './components/printTg'
|
|
|
-
|
|
|
+import { debounce } from 'lodash';
|
|
|
|
|
|
export default {
|
|
|
components: {
|
|
|
@@ -240,6 +253,23 @@ export default {
|
|
|
label: '型号',
|
|
|
align: 'center'
|
|
|
},
|
|
|
+ {
|
|
|
+ prop: 'batchNo',
|
|
|
+ label: '批号',
|
|
|
+ align: 'center',
|
|
|
+ minWidth: 100,
|
|
|
+ showOverflowTooltip: true
|
|
|
+ },
|
|
|
+
|
|
|
+ {
|
|
|
+ prop: 'priority',
|
|
|
+ label: '优先级',
|
|
|
+ align: 'center',
|
|
|
+ minWidth: 120,
|
|
|
+ slot: 'priority',
|
|
|
+ sortable: true
|
|
|
+ },
|
|
|
+
|
|
|
{
|
|
|
prop: 'formingNum',
|
|
|
label: '要求生产数量',
|
|
|
@@ -548,6 +578,33 @@ export default {
|
|
|
},
|
|
|
|
|
|
|
|
|
+ sortTop(row) {
|
|
|
+ row.priority = Number(row.priority) + 1;
|
|
|
+ this.priorityChange(row);
|
|
|
+ },
|
|
|
+ sortBottom(row) {
|
|
|
+ if (row.priority <= 1) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ row.priority = Number(row.priority) - 1;
|
|
|
+ this.priorityChange(row);
|
|
|
+ },
|
|
|
+
|
|
|
+ priorityChange(row) {
|
|
|
+ this.priorityFn(row);
|
|
|
+ },
|
|
|
+
|
|
|
+ priorityFn: debounce(function (row) {
|
|
|
+ let params = {
|
|
|
+ id: row.id,
|
|
|
+ priority: row.priority
|
|
|
+ }
|
|
|
+ updatePriority(params).then((res) => {
|
|
|
+
|
|
|
+ })
|
|
|
+ }, 800)
|
|
|
+
|
|
|
+
|
|
|
|
|
|
|
|
|
|