|
@@ -15,11 +15,12 @@
|
|
|
<!-- 数据表格 -->
|
|
<!-- 数据表格 -->
|
|
|
<ele-pro-table
|
|
<ele-pro-table
|
|
|
ref="table"
|
|
ref="table"
|
|
|
- :columns="columns"
|
|
|
|
|
|
|
+ :columns="newColumns"
|
|
|
:initLoad="false"
|
|
:initLoad="false"
|
|
|
:datasource="datasource"
|
|
:datasource="datasource"
|
|
|
:selection.sync="selection"
|
|
:selection.sync="selection"
|
|
|
cache-key="systemRoleTable1"
|
|
cache-key="systemRoleTable1"
|
|
|
|
|
+ height="calc(100vh - 335px)"
|
|
|
row-key="id"
|
|
row-key="id"
|
|
|
@sort-change="onSortChange"
|
|
@sort-change="onSortChange"
|
|
|
>
|
|
>
|
|
@@ -88,326 +89,355 @@
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
<script>
|
|
|
-import OrderSearch from './components/order-search.vue';
|
|
|
|
|
-import OrderDetail from './components/order-detail.vue';
|
|
|
|
|
-import CreateOrder from './components/create-order.vue';
|
|
|
|
|
-import { getPageList, deleteOrder, updatePriority } from '@/api/saleOrder';
|
|
|
|
|
-import dictMixins from '@/mixins/dictMixins';
|
|
|
|
|
-import { debounce } from 'lodash';
|
|
|
|
|
-export default {
|
|
|
|
|
- name: 'saleOrder',
|
|
|
|
|
- mixins: [dictMixins],
|
|
|
|
|
- components: {
|
|
|
|
|
- OrderSearch,
|
|
|
|
|
- OrderDetail,
|
|
|
|
|
- CreateOrder
|
|
|
|
|
- },
|
|
|
|
|
- data() {
|
|
|
|
|
- return {
|
|
|
|
|
- // 加载状态
|
|
|
|
|
- loading: false,
|
|
|
|
|
- activeName: 'first',
|
|
|
|
|
- selection: []
|
|
|
|
|
- };
|
|
|
|
|
- },
|
|
|
|
|
|
|
+ import OrderSearch from './components/order-search.vue';
|
|
|
|
|
+ import OrderDetail from './components/order-detail.vue';
|
|
|
|
|
+ import CreateOrder from './components/create-order.vue';
|
|
|
|
|
+ import {
|
|
|
|
|
+ getPageList,
|
|
|
|
|
+ deleteOrder,
|
|
|
|
|
+ updatePriority,
|
|
|
|
|
+ fieldModel
|
|
|
|
|
+ } from '@/api/saleOrder';
|
|
|
|
|
+ import dictMixins from '@/mixins/dictMixins';
|
|
|
|
|
+ import { debounce } from 'lodash';
|
|
|
|
|
+ export default {
|
|
|
|
|
+ name: 'saleOrder',
|
|
|
|
|
+ mixins: [dictMixins],
|
|
|
|
|
+ components: {
|
|
|
|
|
+ OrderSearch,
|
|
|
|
|
+ OrderDetail,
|
|
|
|
|
+ CreateOrder
|
|
|
|
|
+ },
|
|
|
|
|
+ data() {
|
|
|
|
|
+ return {
|
|
|
|
|
+ // 加载状态
|
|
|
|
|
+ loading: false,
|
|
|
|
|
+ activeName: 'first',
|
|
|
|
|
+ selection: [],
|
|
|
|
|
|
|
|
- computed: {
|
|
|
|
|
- // 表格列配置
|
|
|
|
|
- clientEnvironmentId() {
|
|
|
|
|
- return this.$store.state.user.info.clientEnvironmentId;
|
|
|
|
|
|
|
+ newColumns: []
|
|
|
|
|
+ };
|
|
|
},
|
|
},
|
|
|
- columns() {
|
|
|
|
|
- const privateColumn = [];
|
|
|
|
|
- if (this.activeName == 'first') {
|
|
|
|
|
- privateColumn.push({
|
|
|
|
|
- columnKey: 'action',
|
|
|
|
|
- label: '操作',
|
|
|
|
|
- width: 150,
|
|
|
|
|
- align: 'center',
|
|
|
|
|
- resizable: false,
|
|
|
|
|
- slot: 'action',
|
|
|
|
|
- showOverflowTooltip: true,
|
|
|
|
|
- fixed: 'right'
|
|
|
|
|
- });
|
|
|
|
|
- }
|
|
|
|
|
- return [
|
|
|
|
|
- {
|
|
|
|
|
- width: 45,
|
|
|
|
|
- type: 'selection',
|
|
|
|
|
- columnKey: 'selection',
|
|
|
|
|
- align: 'center'
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- columnKey: 'index',
|
|
|
|
|
- label: '序号',
|
|
|
|
|
- type: 'index',
|
|
|
|
|
- width: 55,
|
|
|
|
|
- align: 'center',
|
|
|
|
|
- showOverflowTooltip: true,
|
|
|
|
|
- fixed: 'left'
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- prop: 'code',
|
|
|
|
|
- label: '销售订单号',
|
|
|
|
|
- align: 'center',
|
|
|
|
|
- showOverflowTooltip: true,
|
|
|
|
|
- minWidth: 150,
|
|
|
|
|
- slot: 'code'
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- prop: 'lineNumber',
|
|
|
|
|
- label: '行号',
|
|
|
|
|
- align: 'center',
|
|
|
|
|
- showOverflowTooltip: true
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- prop: 'productCode',
|
|
|
|
|
- label: '产品编码',
|
|
|
|
|
- align: 'center',
|
|
|
|
|
- showOverflowTooltip: true,
|
|
|
|
|
- minWidth: 140,
|
|
|
|
|
- sortable: true
|
|
|
|
|
- },
|
|
|
|
|
|
|
|
|
|
- {
|
|
|
|
|
- prop: 'productName',
|
|
|
|
|
- label: '产品名称',
|
|
|
|
|
- align: 'center',
|
|
|
|
|
- minWidth: 120
|
|
|
|
|
- },
|
|
|
|
|
|
|
+ computed: {
|
|
|
|
|
+ // 表格列配置
|
|
|
|
|
+ clientEnvironmentId() {
|
|
|
|
|
+ return this.$store.state.user.info.clientEnvironmentId;
|
|
|
|
|
+ },
|
|
|
|
|
+ columns() {
|
|
|
|
|
+ return [
|
|
|
|
|
+ {
|
|
|
|
|
+ width: 45,
|
|
|
|
|
+ type: 'selection',
|
|
|
|
|
+ columnKey: 'selection',
|
|
|
|
|
+ align: 'center'
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ columnKey: 'index',
|
|
|
|
|
+ label: '序号',
|
|
|
|
|
+ type: 'index',
|
|
|
|
|
+ width: 55,
|
|
|
|
|
+ align: 'center',
|
|
|
|
|
+ showOverflowTooltip: true,
|
|
|
|
|
+ fixed: 'left'
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ prop: 'code',
|
|
|
|
|
+ label: '销售订单号',
|
|
|
|
|
+ align: 'center',
|
|
|
|
|
+ showOverflowTooltip: true,
|
|
|
|
|
+ minWidth: 150,
|
|
|
|
|
+ slot: 'code'
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ prop: 'lineNumber',
|
|
|
|
|
+ label: '行号',
|
|
|
|
|
+ align: 'center',
|
|
|
|
|
+ showOverflowTooltip: true
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ prop: 'productCode',
|
|
|
|
|
+ label: '产品编码',
|
|
|
|
|
+ align: 'center',
|
|
|
|
|
+ showOverflowTooltip: true,
|
|
|
|
|
+ minWidth: 140,
|
|
|
|
|
+ sortable: true
|
|
|
|
|
+ },
|
|
|
|
|
|
|
|
- {
|
|
|
|
|
- prop: 'produceRoutingName',
|
|
|
|
|
- label: '工艺路线',
|
|
|
|
|
- align: 'center',
|
|
|
|
|
- minWidth: 120
|
|
|
|
|
- },
|
|
|
|
|
|
|
+ {
|
|
|
|
|
+ prop: 'productName',
|
|
|
|
|
+ label: '产品名称',
|
|
|
|
|
+ align: 'center',
|
|
|
|
|
+ minWidth: 120
|
|
|
|
|
+ },
|
|
|
|
|
|
|
|
- {
|
|
|
|
|
- prop: 'brandNo',
|
|
|
|
|
- label: '牌号',
|
|
|
|
|
- align: 'center'
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- prop: 'model',
|
|
|
|
|
- label: '型号',
|
|
|
|
|
- align: 'center',
|
|
|
|
|
- minWidth: 120,
|
|
|
|
|
- sortable: true
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- prop: 'priority',
|
|
|
|
|
- label: '优先级',
|
|
|
|
|
- align: 'center',
|
|
|
|
|
- minWidth: 120,
|
|
|
|
|
- slot: 'priority',
|
|
|
|
|
- sortable: 'custom'
|
|
|
|
|
- },
|
|
|
|
|
|
|
+ {
|
|
|
|
|
+ prop: 'produceRoutingName',
|
|
|
|
|
+ label: '工艺路线',
|
|
|
|
|
+ align: 'center',
|
|
|
|
|
+ minWidth: 120
|
|
|
|
|
+ },
|
|
|
|
|
|
|
|
- {
|
|
|
|
|
- prop: 'productSumWeight',
|
|
|
|
|
- label: '合同重量',
|
|
|
|
|
- align: 'center',
|
|
|
|
|
- slot: 'productSumWeight'
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- prop: 'contractNum',
|
|
|
|
|
- label: '合同数量'+(this.clientEnvironmentId=='4'?'(方)':''),
|
|
|
|
|
- align: 'center'
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- prop: 'lackNum',
|
|
|
|
|
- label: '欠交数量'+(this.clientEnvironmentId=='4'?'(方)':""),
|
|
|
|
|
- align: 'center',
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- prop: 'moCount',
|
|
|
|
|
- label: '模数',
|
|
|
|
|
- align: 'center',
|
|
|
|
|
- show:this.clientEnvironmentId=='4'
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- prop: 'blockCount',
|
|
|
|
|
- label: '块数',
|
|
|
|
|
- align: 'center',
|
|
|
|
|
- show:this.clientEnvironmentId=='4'
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- prop: 'orderLibraryType',
|
|
|
|
|
- label: '按单按库',
|
|
|
|
|
- align: 'center',
|
|
|
|
|
- showOverflowTooltip: true,
|
|
|
|
|
- formatter: (_row, _column, cellValue) => {
|
|
|
|
|
- return this.getDictValue('按单按库', _row.orderLibraryType);
|
|
|
|
|
- }
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- prop: 'deliveryRequirements',
|
|
|
|
|
- label: '交付要求',
|
|
|
|
|
- align: 'center',
|
|
|
|
|
- showOverflowTooltip: true,
|
|
|
|
|
- formatter: (_row, _column, cellValue) => {
|
|
|
|
|
- return this.getDictValue('交付要求', _row.deliveryRequirements);
|
|
|
|
|
- }
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- prop: 'orderType',
|
|
|
|
|
- label: '订单类型',
|
|
|
|
|
- align: 'center',
|
|
|
|
|
- showOverflowTooltip: true,
|
|
|
|
|
- formatter: (_row, _column, cellValue) => {
|
|
|
|
|
- return this.getDictValue('订单类型', _row.orderType);
|
|
|
|
|
- }
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- prop: 'orderSource',
|
|
|
|
|
- label: '订单来源',
|
|
|
|
|
- align: 'center',
|
|
|
|
|
- showOverflowTooltip: true,
|
|
|
|
|
- formatter: (_row, _column, cellValue) => {
|
|
|
|
|
- return this.getDictValue('订单来源', _row.orderSource);
|
|
|
|
|
|
|
+ {
|
|
|
|
|
+ prop: 'brandNo',
|
|
|
|
|
+ label: '牌号',
|
|
|
|
|
+ align: 'center'
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ prop: 'model',
|
|
|
|
|
+ label: '型号',
|
|
|
|
|
+ align: 'center',
|
|
|
|
|
+ minWidth: 120,
|
|
|
|
|
+ sortable: true
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ prop: 'priority',
|
|
|
|
|
+ label: '优先级',
|
|
|
|
|
+ align: 'center',
|
|
|
|
|
+ minWidth: 120,
|
|
|
|
|
+ slot: 'priority',
|
|
|
|
|
+ sortable: 'custom'
|
|
|
|
|
+ },
|
|
|
|
|
+
|
|
|
|
|
+ {
|
|
|
|
|
+ prop: 'productSumWeight',
|
|
|
|
|
+ label: '合同重量',
|
|
|
|
|
+ align: 'center',
|
|
|
|
|
+ slot: 'productSumWeight'
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ prop: 'contractNum',
|
|
|
|
|
+ label: '合同数量' + (this.clientEnvironmentId == '4' ? '(方)' : ''),
|
|
|
|
|
+ align: 'center'
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ prop: 'lackNum',
|
|
|
|
|
+ label: '欠交数量' + (this.clientEnvironmentId == '4' ? '(方)' : ''),
|
|
|
|
|
+ align: 'center'
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ prop: 'moCount',
|
|
|
|
|
+ label: '模数',
|
|
|
|
|
+ align: 'center',
|
|
|
|
|
+ show: this.clientEnvironmentId == '4'
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ prop: 'blockCount',
|
|
|
|
|
+ label: '块数',
|
|
|
|
|
+ align: 'center',
|
|
|
|
|
+ show: this.clientEnvironmentId == '4'
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ prop: 'orderLibraryType',
|
|
|
|
|
+ label: '按单按库',
|
|
|
|
|
+ align: 'center',
|
|
|
|
|
+ showOverflowTooltip: true,
|
|
|
|
|
+ formatter: (_row, _column, cellValue) => {
|
|
|
|
|
+ return this.getDictValue('按单按库', _row.orderLibraryType);
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ prop: 'deliveryRequirements',
|
|
|
|
|
+ label: '交付要求',
|
|
|
|
|
+ align: 'center',
|
|
|
|
|
+ showOverflowTooltip: true,
|
|
|
|
|
+ formatter: (_row, _column, cellValue) => {
|
|
|
|
|
+ return this.getDictValue('交付要求', _row.deliveryRequirements);
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ prop: 'orderType',
|
|
|
|
|
+ label: '订单类型',
|
|
|
|
|
+ align: 'center',
|
|
|
|
|
+ showOverflowTooltip: true,
|
|
|
|
|
+ formatter: (_row, _column, cellValue) => {
|
|
|
|
|
+ return this.getDictValue('订单类型', _row.orderType);
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ prop: 'orderSource',
|
|
|
|
|
+ label: '订单来源',
|
|
|
|
|
+ align: 'center',
|
|
|
|
|
+ showOverflowTooltip: true,
|
|
|
|
|
+ formatter: (_row, _column, cellValue) => {
|
|
|
|
|
+ return this.getDictValue('订单来源', _row.orderSource);
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ prop: 'status',
|
|
|
|
|
+ label: '生产状态',
|
|
|
|
|
+ align: 'center',
|
|
|
|
|
+ showOverflowTooltip: true,
|
|
|
|
|
+ formatter: (_row, _column, cellValue) => {
|
|
|
|
|
+ return this.getDictValue('生产状态', _row.status);
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ prop: 'releaseTime',
|
|
|
|
|
+ label: '下达时间',
|
|
|
|
|
+ align: 'center',
|
|
|
|
|
+ showOverflowTooltip: true
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ prop: 'deliveryTime',
|
|
|
|
|
+ label: '交付日期',
|
|
|
|
|
+ align: 'center',
|
|
|
|
|
+ showOverflowTooltip: true
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ prop: 'customerName',
|
|
|
|
|
+ label: '客户名称',
|
|
|
|
|
+ align: 'center',
|
|
|
|
|
+ showOverflowTooltip: true
|
|
|
|
|
+ },
|
|
|
|
|
+
|
|
|
|
|
+ {
|
|
|
|
|
+ prop: 'serialNo',
|
|
|
|
|
+ label: '客户代号',
|
|
|
|
|
+ align: 'center',
|
|
|
|
|
+ showOverflowTooltip: true
|
|
|
|
|
+ },
|
|
|
|
|
+
|
|
|
|
|
+ {
|
|
|
|
|
+ prop: 'simpleName',
|
|
|
|
|
+ label: '客户简称',
|
|
|
|
|
+ align: 'center',
|
|
|
|
|
+ showOverflowTooltip: true
|
|
|
|
|
+ },
|
|
|
|
|
+
|
|
|
|
|
+ {
|
|
|
|
|
+ prop: 'salesman',
|
|
|
|
|
+ label: '业务员',
|
|
|
|
|
+ showOverflowTooltip: true
|
|
|
}
|
|
}
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- prop: 'status',
|
|
|
|
|
- label: '生产状态',
|
|
|
|
|
- align: 'center',
|
|
|
|
|
- showOverflowTooltip: true,
|
|
|
|
|
- formatter: (_row, _column, cellValue) => {
|
|
|
|
|
- return this.getDictValue('生产状态', _row.status);
|
|
|
|
|
|
|
+ ];
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ created() {
|
|
|
|
|
+ this.getFieldModel();
|
|
|
|
|
+
|
|
|
|
|
+ this.requestDict('按单按库');
|
|
|
|
|
+ this.requestDict('交付要求');
|
|
|
|
|
+ this.requestDict('订单类型');
|
|
|
|
|
+ this.requestDict('订单来源');
|
|
|
|
|
+ this.requestDict('生产状态');
|
|
|
|
|
+ },
|
|
|
|
|
+ methods: {
|
|
|
|
|
+ getFieldModel() {
|
|
|
|
|
+ fieldModel({ fieldModel: 't_main_category' }).then((res) => {
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ const privateColumn = [];
|
|
|
|
|
+ if (this.activeName == 'first') {
|
|
|
|
|
+ privateColumn.push({
|
|
|
|
|
+ columnKey: 'action',
|
|
|
|
|
+ label: '操作',
|
|
|
|
|
+ width: 150,
|
|
|
|
|
+ align: 'center',
|
|
|
|
|
+ resizable: false,
|
|
|
|
|
+ slot: 'action',
|
|
|
|
|
+ showOverflowTooltip: true,
|
|
|
|
|
+ fixed: 'right'
|
|
|
|
|
+ });
|
|
|
|
|
+ } else {
|
|
|
|
|
+ privateColumn = [];
|
|
|
}
|
|
}
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- prop: 'releaseTime',
|
|
|
|
|
- label: '下达时间',
|
|
|
|
|
- align: 'center',
|
|
|
|
|
- showOverflowTooltip: true
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- prop: 'deliveryTime',
|
|
|
|
|
- label: '交付日期',
|
|
|
|
|
- align: 'center',
|
|
|
|
|
- showOverflowTooltip: true
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- prop: 'customerName',
|
|
|
|
|
- label: '客户名称',
|
|
|
|
|
- align: 'center',
|
|
|
|
|
- showOverflowTooltip: true
|
|
|
|
|
- },
|
|
|
|
|
|
|
|
|
|
- {
|
|
|
|
|
- prop: 'serialNo',
|
|
|
|
|
- label: '客户代号',
|
|
|
|
|
- align: 'center',
|
|
|
|
|
- showOverflowTooltip: true
|
|
|
|
|
- },
|
|
|
|
|
|
|
+ let newRes = res.map(m => {
|
|
|
|
|
+ return {
|
|
|
|
|
+ prop: 'extField.' + m.prop,
|
|
|
|
|
+ label: m.label,
|
|
|
|
|
+ align: 'center',
|
|
|
|
|
+ showOverflowTooltip: true
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
|
|
|
- {
|
|
|
|
|
- prop: 'simpleName',
|
|
|
|
|
- label: '客户简称',
|
|
|
|
|
- align: 'center',
|
|
|
|
|
- showOverflowTooltip: true
|
|
|
|
|
- },
|
|
|
|
|
|
|
+ this.newColumns = [...this.columns, ...newRes, ...privateColumn];
|
|
|
|
|
+ console.log(this.newColumns, 55);
|
|
|
|
|
+ this.$forceUpdate();
|
|
|
|
|
+ });
|
|
|
|
|
+ },
|
|
|
|
|
|
|
|
- {
|
|
|
|
|
- prop: 'salesman',
|
|
|
|
|
- label: '业务员',
|
|
|
|
|
- align: 'center',
|
|
|
|
|
- showOverflowTooltip: true
|
|
|
|
|
- },
|
|
|
|
|
- ...privateColumn
|
|
|
|
|
- ];
|
|
|
|
|
- }
|
|
|
|
|
- },
|
|
|
|
|
- created() {
|
|
|
|
|
- this.requestDict('按单按库');
|
|
|
|
|
- this.requestDict('交付要求');
|
|
|
|
|
- this.requestDict('订单类型');
|
|
|
|
|
- this.requestDict('订单来源');
|
|
|
|
|
- this.requestDict('生产状态');
|
|
|
|
|
- },
|
|
|
|
|
- methods: {
|
|
|
|
|
- /* 表格数据源 */
|
|
|
|
|
- async datasource({ page, limit, where, order }) {
|
|
|
|
|
- if (this.activeName == 'first') {
|
|
|
|
|
- where.status = [1];
|
|
|
|
|
- } else {
|
|
|
|
|
- if (where.proStu) {
|
|
|
|
|
- where.status = [where.proStu];
|
|
|
|
|
|
|
+ /* 表格数据源 */
|
|
|
|
|
+ async datasource({ page, limit, where, order }) {
|
|
|
|
|
+ if (this.activeName == 'first') {
|
|
|
|
|
+ where.status = [1];
|
|
|
} else {
|
|
} else {
|
|
|
- where.status = [2, 3, 4, 5, 6, 7];
|
|
|
|
|
|
|
+ if (where.proStu) {
|
|
|
|
|
+ where.status = [where.proStu];
|
|
|
|
|
+ } else {
|
|
|
|
|
+ where.status = [2, 3, 4, 5, 6, 7];
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
- }
|
|
|
|
|
- const params = {
|
|
|
|
|
- size: limit,
|
|
|
|
|
- pageNum: page,
|
|
|
|
|
- ...where,
|
|
|
|
|
- ...this.sort
|
|
|
|
|
- };
|
|
|
|
|
- const data = await getPageList(params);
|
|
|
|
|
- return data;
|
|
|
|
|
- },
|
|
|
|
|
|
|
+ const params = {
|
|
|
|
|
+ size: limit,
|
|
|
|
|
+ pageNum: page,
|
|
|
|
|
+ ...where,
|
|
|
|
|
+ ...this.sort
|
|
|
|
|
+ };
|
|
|
|
|
+ const data = await getPageList(params);
|
|
|
|
|
+ return data;
|
|
|
|
|
+ },
|
|
|
|
|
|
|
|
- /* 刷新表格 */
|
|
|
|
|
- reload(where) {
|
|
|
|
|
- this.$nextTick(() =>
|
|
|
|
|
- this.$refs.table.reload({ page: 1, limit: 10, where })
|
|
|
|
|
- );
|
|
|
|
|
- },
|
|
|
|
|
|
|
+ /* 刷新表格 */
|
|
|
|
|
+ reload(where) {
|
|
|
|
|
+ this.$nextTick(() =>
|
|
|
|
|
+ this.$refs.table.reload({ page: 1, limit: 10, where })
|
|
|
|
|
+ );
|
|
|
|
|
+ },
|
|
|
|
|
|
|
|
- openDetails(row) {
|
|
|
|
|
- this.$refs.detailDialog.open(row);
|
|
|
|
|
- },
|
|
|
|
|
- toUpdate(row) {
|
|
|
|
|
- this.$refs.createDialog.open(row);
|
|
|
|
|
- },
|
|
|
|
|
- remove(row) {
|
|
|
|
|
- deleteOrder([row.id]).then((res) => {
|
|
|
|
|
- this.$message.success(res);
|
|
|
|
|
- this.reload();
|
|
|
|
|
- });
|
|
|
|
|
- },
|
|
|
|
|
|
|
+ openDetails(row) {
|
|
|
|
|
+ this.$refs.detailDialog.open(row);
|
|
|
|
|
+ },
|
|
|
|
|
+ toUpdate(row) {
|
|
|
|
|
+ this.$refs.createDialog.open(row);
|
|
|
|
|
+ },
|
|
|
|
|
+ remove(row) {
|
|
|
|
|
+ deleteOrder([row.id]).then((res) => {
|
|
|
|
|
+ this.$message.success(res);
|
|
|
|
|
+ this.reload();
|
|
|
|
|
+ });
|
|
|
|
|
+ },
|
|
|
|
|
|
|
|
- onSortChange(e) {
|
|
|
|
|
- let sort = {
|
|
|
|
|
- orderBy: e.order,
|
|
|
|
|
- sortName: e.prop
|
|
|
|
|
- };
|
|
|
|
|
- this.sort = sort;
|
|
|
|
|
- this.reload();
|
|
|
|
|
- },
|
|
|
|
|
|
|
+ onSortChange(e) {
|
|
|
|
|
+ let sort = {
|
|
|
|
|
+ orderBy: e.order,
|
|
|
|
|
+ sortName: e.prop
|
|
|
|
|
+ };
|
|
|
|
|
+ this.sort = sort;
|
|
|
|
|
+ this.reload();
|
|
|
|
|
+ },
|
|
|
|
|
|
|
|
- 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);
|
|
|
|
|
- },
|
|
|
|
|
|
|
+ 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) {
|
|
|
|
|
- if (row.priority > 10) {
|
|
|
|
|
- row.priority = 10; // 如果大于 10,则设置为 10
|
|
|
|
|
- } else if (row.priority < 0) {
|
|
|
|
|
- row.priority = 0; // 如果小于 0,则设置为 0
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ 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 = {
|
|
|
|
|
- id: row.id,
|
|
|
|
|
- priority: row.priority
|
|
|
|
|
- };
|
|
|
|
|
- updatePriority(params).then((res) => {});
|
|
|
|
|
- }, 800)
|
|
|
|
|
- }
|
|
|
|
|
-};
|
|
|
|
|
|
|
+ this.priorityFn(row);
|
|
|
|
|
+ },
|
|
|
|
|
+ priorityFn: debounce(function (row) {
|
|
|
|
|
+ let params = {
|
|
|
|
|
+ id: row.id,
|
|
|
|
|
+ priority: row.priority
|
|
|
|
|
+ };
|
|
|
|
|
+ updatePriority(params).then((res) => {});
|
|
|
|
|
+ }, 800)
|
|
|
|
|
+ }
|
|
|
|
|
+ };
|
|
|
</script>
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss" scoped></style>
|
|
<style lang="scss" scoped></style>
|