diff --git a/src/views/modules/pms/order/config.js b/src/views/modules/pms/order/config.js index 3be518c..9377b82 100644 --- a/src/views/modules/pms/order/config.js +++ b/src/views/modules/pms/order/config.js @@ -3,45 +3,80 @@ import TableTextComponent from "@/components/noTemplateComponents/detailComponen import StatusComponent from "@/components/noTemplateComponents/statusComponent"; import { timeFilter, dictFilter } from "@/utils/filters"; +function changeOrderSort(orderId, location) { + /** this - vue instance, 0 - to top, 1 - up, 2 - down, 3 - to bottom */ + return this.$http.get('/pms/order/change', { params: { id: orderId, location } }).then(({ data: res }) => { + if (res.code === 0) { + } else throw new Error(`${res.code}: ${res.msg}`) + }).catch(err => { + this.$message({ + message: err, + type: 'error', + duration: 1500 + }) + }) +} + + export default function () { const operations = { - 'ongoing': ['edit'], - 'pending': ['edit', 'delete'], - 'finished': ['edit'] + 'ongoing': [ + { name: 'view-detail', label: '查看详情' }, + { name: 'end-order', label: '结束订单' }, + { name: 'confirm-order', label: '确认订单' }, + { name: 'move-to-top', label: 'to top', icon: 'top' }, + { name: 'move-up', label: 'up', icon: 'top' }, + { name: 'move-down', label: 'down', icon: 'top' }, + { name: 'move-to-bottom', label: 'to bottom', icon: 'top' }, + { name: 'destroy-order', label: '废除订单' }, + ], + 'pending': [ + { name: 'confirm-order', label: '确认订单' }, + { name: 'edit' }, + { name: 'move-to-top', label: 'to top' }, + { name: 'move-up', label: 'up' }, + { name: 'move-down', label: 'down' }, + { name: 'move-to-bottom', label: 'to bottom' }, + { name: 'delete' }, + + ], + 'finished': [ + { name: 'view-detail', label: '查看详情' } + ] } const genTableProps = (type /** ongoing, pending, finished */) => [ - { type: 'index', label: '序号' }, - { prop: "createTime", label: "添加时间", filter: timeFilter }, - { prop: "statusDictValue", label: "订单状态", filter: dictFilter('order_status') }, // 不可编辑 - { prop: "code", label: "订单号" }, - { prop: "cate", label: "子订单号" }, - { prop: "productCode", label: "物料编号" }, // select, filterable - { prop: "shapeCode", label: "砖型编号" }, // select, filterable - { prop: "brand", label: "牌号" }, // select, filterable - { prop: "addon", label: "addon" }, - { prop: "ai", label: "版本号" }, // auto display according to the 配方 - { prop: "shortDesc", label: "物料号销售文本" }, - { prop: "bomCode", label: "配方编码" }, - { prop: "pressCode", label: "压机号" }, // select, filterable - { prop: "blenderCode", label: "混料机号" }, // select, filterable - { prop: "kilnCode", label: "隧道窑号" }, // select, filterable - { prop: "prodqty", label: "订单砖数" }, - { prop: "ktmp", label: "烧成温度" }, - { prop: "tt", label: "烧成时间" }, - { prop: "yieldqty", label: "已生产数量" }, // uneditable - { prop: "soqty", label: "销售订单数" }, - { prop: "saleNo", label: "销售订单号" }, - { prop: "saleOrderItem", label: "销售订单item号" }, - { prop: "packTechCode", label: "包装工艺代码" }, // select, filterable - { prop: "specifications", label: "生产订单类型" }, - { prop: "deliveryTime", label: "发货时间" }, - { prop: "customerCode", label: "客户" }, + { width: 80, type: 'index', label: '序号' }, + { width: 120, prop: "createTime", label: "添加时间", filter: timeFilter }, + { width: 200, prop: "code", label: "订单号" }, + { width: 120, prop: "statusDictValue", label: "订单状态", filter: dictFilter('order_status') }, // 不可编辑 + { width: 200, prop: "cate", label: "子订单号" }, + { width: 200, prop: "productCode", label: "物料编号" }, // select, filterable + { width: 200, prop: "shapeCode", label: "砖型编号" }, // select, filterable + { width: 120, prop: "brand", label: "牌号" }, // select, filterable + { width: 80, prop: "addon", label: "addon" }, + { width: 120, prop: "ai", label: "版本号" }, // auto display according to the 配方 + { width: 200, prop: "shortDesc", label: "物料号销售文本" }, + { width: 200, prop: "bomCode", label: "配方编码" }, + { width: 200, prop: "pressCode", label: "压机号" }, // select, filterable + { width: 200, prop: "blenderCode", label: "混料机号" }, // select, filterable + { width: 200, prop: "kilnCode", label: "隧道窑号" }, // select, filterable + { width: 120, prop: "prodqty", label: "订单砖数" }, + { width: 120, prop: "ktmp", label: "烧成温度" }, + { width: 120, prop: "tt", label: "烧成时间" }, + { width: 120, prop: "yieldqty", label: "已生产数量" }, // uneditable + { width: 120, prop: "soqty", label: "销售订单数" }, + { width: 200, prop: "saleNo", label: "销售订单号" }, + { width: 200, prop: "saleOrderItem", label: "销售订单item号" }, + { width: 200, prop: "packTechCode", label: "包装工艺代码" }, // select, filterable + { width: 80, prop: "specifications", label: "生产订单类型" }, + { width: 120, prop: "deliveryTime", label: "发货时间" }, + { width: 120, prop: "customerCode", label: "客户" }, // { prop: "description", label: "详情", subcomponent: TableTextComponent }, - { prop: "pcsKilnCar", label: "托盘码放砖数", }, - { prop: "remark", label: "备注" }, + { width: 120, prop: "pcsKilnCar", label: "托盘码放砖数", }, + { width: 200, prop: "remark", label: "备注" }, { prop: "operations", name: "操作", diff --git a/src/views/modules/pms/order/index.vue b/src/views/modules/pms/order/index.vue index 9713950..dab8fae 100644 --- a/src/views/modules/pms/order/index.vue +++ b/src/views/modules/pms/order/index.vue @@ -1,31 +1,73 @@