@@ -127,6 +127,14 @@ export function rateFormatter(rateObj) { | |||||
} | } | ||||
} | } | ||||
export function rateFormatter2(rateObj) { | |||||
if (rateObj) { | |||||
return rateObj + '%' | |||||
} else { | |||||
return '0.00%' | |||||
} | |||||
} | |||||
export function amountFormatter(param) { | export function amountFormatter(param) { | ||||
if (param) { | if (param) { | ||||
return parseFloat(param).toFixed(2) | return parseFloat(param).toFixed(2) | ||||
@@ -176,16 +176,21 @@ export default { | |||||
const arr = [] | const arr = [] | ||||
const temp = [] | const temp = [] | ||||
const productList = ['2.0-1128*1716', '2.0-1128*2251', '2.0-1128*2272', '3.2-1128*1716', '3.2-1128*1718','3.2-1032*1747', '3.2-1033*2089'] | const productList = ['2.0-1128*1716', '2.0-1128*2251', '2.0-1128*2272', '3.2-1128*1716', '3.2-1128*1718','3.2-1032*1747', '3.2-1033*2089'] | ||||
let cnum = 1 | |||||
for (let i = 0; i < 20; i++) { | for (let i = 0; i < 20; i++) { | ||||
const obj = {} | const obj = {} | ||||
const sj = parseInt(Math.random() * 15) | |||||
obj.time = moment().subtract(sj, 'days').subtract(sj, 'hours').subtract(sj, 'minute').subtract(sj, 'second').format('YYYY-MM-DD HH:mm:ss') | |||||
const sj = parseInt(Math.random() * 3 + 1) | |||||
cnum += sj | |||||
obj.time = moment('20221101 081002').add(cnum, 'days').add(cnum, 'hours').add(cnum, 'minute').add(cnum, 'second').format('YYYY-MM-DD HH:mm:ss') | |||||
obj.productLine = sj % 2 ? 'A' : 'B' | obj.productLine = sj % 2 ? 'A' : 'B' | ||||
obj.spec = productList[parseInt(Math.random() * (productList.length))] | obj.spec = productList[parseInt(Math.random() * (productList.length))] | ||||
obj.batch = moment().subtract(sj, 'days').subtract(sj, 'hours').format('YYYYMMDDHH') | |||||
obj.batch = moment('20221101 081002').add(cnum, 'days').add(cnum, 'hours').add(cnum, 'minute').add(cnum, 'second').format('YYYYMMDDHH') | |||||
obj.num = parseInt(Math.random() * 800 + 100) + ' (片)' | obj.num = parseInt(Math.random() * 800 + 100) + ' (片)' | ||||
arr.push(obj) | arr.push(obj) | ||||
} | } | ||||
arr.sort(function (a, b) { | |||||
return new Date(a.time) - new Date(b.time) | |||||
}) | |||||
this.originalFilmList = arr | this.originalFilmList = arr | ||||
const eqList = [ | const eqList = [ | ||||
{name: '磨边机', fc: ''}, | {name: '磨边机', fc: ''}, | ||||
@@ -193,18 +198,23 @@ export default { | |||||
{name: '镀膜机', fc: ['镀膜液', '异丙醇']}, | {name: '镀膜机', fc: ['镀膜液', '异丙醇']}, | ||||
{name: '包装机', fc: ['隔离纸', '包装辅材']} | {name: '包装机', fc: ['隔离纸', '包装辅材']} | ||||
] | ] | ||||
let cnum2 = 1 | |||||
for (let i = 0; i < 20; i++) { | for (let i = 0; i < 20; i++) { | ||||
const obj = {} | const obj = {} | ||||
const sj = parseInt(Math.random() * 15) | |||||
const sj = parseInt(Math.random() * 3 + 1) | |||||
const sj2 = parseInt(Math.random() * eqList.length) | const sj2 = parseInt(Math.random() * eqList.length) | ||||
const sj3 = sj % 2 ? 1 : 0 | const sj3 = sj % 2 ? 1 : 0 | ||||
obj.time = moment().subtract(sj, 'days').subtract(sj, 'hours').subtract(sj, 'minute').subtract(sj, 'second').format('YYYY-MM-DD HH:mm:ss') | |||||
cnum2 += sj | |||||
obj.time = moment('20221015 110314').add(cnum2, 'days').add(cnum2, 'hours').add(cnum2, 'minute').add(cnum2, 'second').format('YYYY-MM-DD HH:mm:ss') | |||||
obj.eqName = eqList[sj2].name | obj.eqName = eqList[sj2].name | ||||
obj.spec = eqList[sj2].fc ? (eqList[sj2].fc[sj3]) : '' | obj.spec = eqList[sj2].fc ? (eqList[sj2].fc[sj3]) : '' | ||||
obj.batch = moment().subtract(sj, 'days').format('YYYYMMDD') | |||||
obj.batch = moment('20221015 110314').add(cnum2, 'days').add(cnum2, 'hours').add(cnum2, 'minute').add(cnum2, 'second').format('YYYYMMDD') | |||||
obj.num = parseInt(Math.random() * 800 + 100) | obj.num = parseInt(Math.random() * 800 + 100) | ||||
temp.push(obj) | temp.push(obj) | ||||
} | } | ||||
temp.sort(function (a, b) { | |||||
return new Date(a.time) - new Date(b.time) | |||||
}) | |||||
this.materialList = temp | this.materialList = temp | ||||
this.bomMsg = [ | this.bomMsg = [ | ||||
{ name: '2.0-1128*1716' }, | { name: '2.0-1128*1716' }, | ||||
@@ -72,6 +72,7 @@ import screenfull from 'screenfull' | |||||
import BaseTable from './components/baseTable.vue' | import BaseTable from './components/baseTable.vue' | ||||
import moment from 'moment' | import moment from 'moment' | ||||
import orderStatus from './components/orderStatus.vue' | import orderStatus from './components/orderStatus.vue' | ||||
import { rateFormatter2 } from '@/filters/index' | |||||
const orderPool = [ | const orderPool = [ | ||||
{ | { | ||||
prop: 'customerName', | prop: 'customerName', | ||||
@@ -125,6 +126,7 @@ const orderMonitiring = [ | |||||
{ | { | ||||
prop: 'completion', | prop: 'completion', | ||||
label: '完成率', | label: '完成率', | ||||
filter: rateFormatter2, | |||||
minWidth: 24.8 | minWidth: 24.8 | ||||
}, | }, | ||||
{ | { | ||||
@@ -224,17 +226,15 @@ export default { | |||||
arr1.push(obj) | arr1.push(obj) | ||||
} | } | ||||
this.orderList = arr1 | this.orderList = arr1 | ||||
const timeArr = ["2022-10-01", "2022-10-03", "2022-10-04", "2022-10-07","2022-10-11", "2022-10-12", "2022-10-15", "2022-10-18", "2022-10-19", "2022-10-21", "2022-10-23", "2022-10-26", "2022-10-27"] | |||||
for (let i = 0; i < 20; i++) { | for (let i = 0; i < 20; i++) { | ||||
const obj = {} | const obj = {} | ||||
const sj = parseInt(Math.random() * 200) | const sj = parseInt(Math.random() * 200) | ||||
const sj2 = parseInt(Math.random() * 31) | |||||
obj.customerName = compList[parseInt(Math.random() * (compList.length))] | obj.customerName = compList[parseInt(Math.random() * (compList.length))] | ||||
obj.orderCode = 'ODFG' + moment().subtract(sj, 'days').subtract(sj, 'hours').subtract(sj, 'minute').subtract(sj, 'second').format('YYYYMMDDHHmmss') | obj.orderCode = 'ODFG' + moment().subtract(sj, 'days').subtract(sj, 'hours').subtract(sj, 'minute').subtract(sj, 'second').format('YYYYMMDDHHmmss') | ||||
obj.productName = productList[parseInt(Math.random() * (productList.length))] | obj.productName = productList[parseInt(Math.random() * (productList.length))] | ||||
obj.planNum = parseInt(Math.random() * 800 + 100) + '(m²)' | obj.planNum = parseInt(Math.random() * 800 + 100) + '(m²)' | ||||
obj.planDelivery = moment("20221001").add(sj2, 'days').format('YYYY-MM-DD') | |||||
// obj.planDelivery = moment().add(sj, 'days').format('YYYY-MM-DD') | |||||
// obj.status = parseInt(Math.random() * 3 + 1) | |||||
obj.planDelivery = timeArr[i] | |||||
obj.status = 4 | obj.status = 4 | ||||
arr2.push(obj) | arr2.push(obj) | ||||
} | } | ||||
@@ -245,7 +245,7 @@ export default { | |||||
obj.customerName = compList[parseInt(Math.random() * (compList.length))] | obj.customerName = compList[parseInt(Math.random() * (compList.length))] | ||||
obj.orderCode = 'ODFG' + moment().subtract(sj, 'days').subtract(sj, 'hours').subtract(sj, 'minute').subtract(sj, 'second').format('YYYYMMDDHHmmss') | obj.orderCode = 'ODFG' + moment().subtract(sj, 'days').subtract(sj, 'hours').subtract(sj, 'minute').subtract(sj, 'second').format('YYYYMMDDHHmmss') | ||||
obj.status = parseInt(Math.random() * 3 + 1) | obj.status = parseInt(Math.random() * 3 + 1) | ||||
obj.completion = obj.status === 1 ? '0.00%' : (obj.status === 3 ? '100%' : parseInt(Math.random() * 100) + '%') | |||||
obj.completion = obj.status === 1 ? 0.00 : (obj.status === 3 ? 100 : parseInt(Math.random() * 100)) | |||||
obj.yield = parseInt(Math.random() * 10 + 90) + '%' | obj.yield = parseInt(Math.random() * 10 + 90) + '%' | ||||
// obj.shiftCosts = obj.status === 1 ? parseInt(0).toFixed(2) : parseInt(Math.random() * 800 + 100).toFixed(2) | // obj.shiftCosts = obj.status === 1 ? parseInt(0).toFixed(2) : parseInt(Math.random() * 800 + 100).toFixed(2) | ||||
// obj.energyCosts = obj.status === 1 ? parseInt(0).toFixed(2) : parseInt(Math.random() * 800 + 100).toFixed(2) | // obj.energyCosts = obj.status === 1 ? parseInt(0).toFixed(2) : parseInt(Math.random() * 800 + 100).toFixed(2) | ||||
@@ -259,6 +259,9 @@ export default { | |||||
obj.totalCost = '0' | obj.totalCost = '0' | ||||
temp.push(obj) | temp.push(obj) | ||||
} | } | ||||
temp.sort(function (a, b) { | |||||
return new Date(a.completion) - new Date(b.completion) | |||||
}) | |||||
this.orderMonitiringList = temp | this.orderMonitiringList = temp | ||||
}, | }, | ||||
change() { | change() { | ||||