|
|
@@ -17,28 +17,32 @@
|
|
|
</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>
|
|
|
-
|
|
|
-
|
|
|
+ <el-input
|
|
|
+ v-model="row.priority"
|
|
|
+ type="number"
|
|
|
+ size="mini"
|
|
|
+ :min="0"
|
|
|
+ :max="10"
|
|
|
+ @change="priorityChange(row)"
|
|
|
+ ></el-input>
|
|
|
+ <el-popover
|
|
|
+ placement="right"
|
|
|
+ width="200"
|
|
|
+ trigger="hover"
|
|
|
+ content="数值越大优先级越高(0-3普通, 4-6优先, 7-10紧急)"
|
|
|
+ >
|
|
|
+ <div class="sort-wrap" slot="reference">
|
|
|
+ <i class="el-icon-caret-top" @click="sortTop(row)"></i>
|
|
|
+ <i class="el-icon-caret-bottom" @click="sortBottom(row)"></i>
|
|
|
+ </div>
|
|
|
+ </el-popover>
|
|
|
+ </template>
|
|
|
|
|
|
<template v-slot:status="{ row }">
|
|
|
<span :class="{ 'ele-text-danger': row.status == 3 }">
|
|
|
{{ statusFormatter(row.status) }}
|
|
|
</span>
|
|
|
</template>
|
|
|
-
|
|
|
-
|
|
|
</ele-pro-table>
|
|
|
</el-card>
|
|
|
|
|
|
@@ -54,14 +58,18 @@
|
|
|
|
|
|
<div class="footer" slot="footer">
|
|
|
<el-button @click="visible = false">取消</el-button>
|
|
|
- <el-button type="primary" >确定</el-button>
|
|
|
+ <el-button type="primary">确定</el-button>
|
|
|
</div>
|
|
|
</el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
- import { getList, releaseWorkOrder, updatePriority } from '@/api/produceWord/index.js';
|
|
|
+ import {
|
|
|
+ getList,
|
|
|
+ releaseWorkOrder,
|
|
|
+ updatePriority
|
|
|
+ } from '@/api/produceWord/index.js';
|
|
|
|
|
|
import OrderSearch from './components/order-search.vue';
|
|
|
import { debounce } from 'lodash';
|
|
|
@@ -69,7 +77,7 @@
|
|
|
components: {
|
|
|
OrderSearch
|
|
|
},
|
|
|
- data () {
|
|
|
+ data() {
|
|
|
return {
|
|
|
visible: false,
|
|
|
loading: false,
|
|
|
@@ -90,7 +98,7 @@
|
|
|
},
|
|
|
computed: {
|
|
|
// 表格列配置
|
|
|
- columns () {
|
|
|
+ columns() {
|
|
|
return [
|
|
|
{
|
|
|
columnKey: 'index',
|
|
|
@@ -155,7 +163,6 @@
|
|
|
sortable: true
|
|
|
},
|
|
|
|
|
|
-
|
|
|
{
|
|
|
prop: 'formingNum',
|
|
|
label: '要求生产数量',
|
|
|
@@ -212,11 +219,8 @@
|
|
|
prop: 'teamName',
|
|
|
label: '班组',
|
|
|
align: 'center',
|
|
|
- showOverflowTooltip: true,
|
|
|
- },
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
+ showOverflowTooltip: true
|
|
|
+ }
|
|
|
|
|
|
// {
|
|
|
// columnKey: 'action',
|
|
|
@@ -231,16 +235,14 @@
|
|
|
];
|
|
|
}
|
|
|
},
|
|
|
- created () {
|
|
|
-
|
|
|
- },
|
|
|
+ created() {},
|
|
|
methods: {
|
|
|
- statusFormatter (status) {
|
|
|
+ statusFormatter(status) {
|
|
|
const obj = this.statusOpt.find((i) => i.value == status);
|
|
|
return obj && obj.label;
|
|
|
},
|
|
|
/* 表格数据源 */
|
|
|
- datasource ({ page, limit, where }) {
|
|
|
+ datasource({ page, limit, where }) {
|
|
|
if (where.status) {
|
|
|
where.statusList = [];
|
|
|
where.statusList.push(where.status);
|
|
|
@@ -252,16 +254,13 @@
|
|
|
});
|
|
|
},
|
|
|
|
|
|
-
|
|
|
-
|
|
|
/* 刷新表格 */
|
|
|
- reload (where) {
|
|
|
+ reload(where) {
|
|
|
this.$nextTick(() => {
|
|
|
this.$refs.table.reload({ page: 1, where });
|
|
|
});
|
|
|
},
|
|
|
|
|
|
-
|
|
|
sortTop(row) {
|
|
|
row.priority = Number(row.priority) + 1;
|
|
|
this.priorityChange(row);
|
|
|
@@ -275,19 +274,22 @@
|
|
|
},
|
|
|
|
|
|
priorityChange(row) {
|
|
|
+ if (row.priority > 10) {
|
|
|
+ row.priority = 10; // 如果大于 10,则设置为 10
|
|
|
+ } else if (row.priority < 0) {
|
|
|
+ row.priority = 0; // 如果小于 0,则设置为 0
|
|
|
+ }
|
|
|
+
|
|
|
this.priorityFn(row);
|
|
|
},
|
|
|
|
|
|
priorityFn: debounce(function (row) {
|
|
|
- let params = {
|
|
|
+ let params = {
|
|
|
id: row.id,
|
|
|
priority: row.priority
|
|
|
- }
|
|
|
- updatePriority(params).then((res) => {
|
|
|
-
|
|
|
- })
|
|
|
+ };
|
|
|
+ updatePriority(params).then((res) => {});
|
|
|
}, 800)
|
|
|
-
|
|
|
}
|
|
|
};
|
|
|
</script>
|