|
|
@@ -1,155 +1,171 @@
|
|
|
<template>
|
|
|
- <div id="bottom1">
|
|
|
- <div class = "up">
|
|
|
- <div class="bg-color-black">
|
|
|
- <div class="d-flex pt-1 pl-2 pb-2 jc-center">
|
|
|
- <span class="fs-xxl text mx-2 fw-b">当日产线计划</span>
|
|
|
- </div>
|
|
|
- <div class="d-flex jc-center body-box">
|
|
|
- <dv-scroll-board :config="config" ref="scroll-board" />
|
|
|
- </div>
|
|
|
+ <div id="production-plan" class="plan-container">
|
|
|
+ <div class="plan-header">
|
|
|
+ <div class="header-content">
|
|
|
+ <span class="header-title">产线计划</span>
|
|
|
</div>
|
|
|
</div>
|
|
|
-
|
|
|
+ <div class="plan-body">
|
|
|
+ <dv-scroll-board
|
|
|
+ :config="config"
|
|
|
+ ref="scrollBoard"
|
|
|
+ class="scroll-board"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
export default {
|
|
|
- components: {
|
|
|
- },
|
|
|
+ name: 'ProductionPlan',
|
|
|
data() {
|
|
|
return {
|
|
|
config: {
|
|
|
- header: ['线别','销售工单','业务员' ,'产品名称', '订单数', '备料状态', '计划完成数量','完成数量','完成进度', '提醒事项','异常事项'],
|
|
|
+ header: ['线别', '销售工单', '业务员', '产品名称', '订单数', '备料状态', '计划完成数量', '完成数量', '完成进度', '提醒事项', '异常事项'],
|
|
|
data: [],
|
|
|
- rowNum: 9, //表格行数
|
|
|
+ rowNum: 9,
|
|
|
headerHeight: 35,
|
|
|
- headerBGC: 'rgba(15,19,37,0.1)', //表头
|
|
|
- oddRowBGC: 'rgba(15,19,37,0.1)', //奇数行
|
|
|
- evenRowBGC: 'rgba(23,28,51,0.1)', //偶数行
|
|
|
- columnWidth: [130,190,110, 200, 120, 140, 180, 180, 160, 210,180],
|
|
|
- align: ['center','center','left','left','left','left','center','center','center','center','center','center','center']
|
|
|
+ headerBGC: 'rgba(15,19,37,0.1)',
|
|
|
+ oddRowBGC: 'rgba(15,19,37,0.1)',
|
|
|
+ evenRowBGC: 'rgba(23,28,51,0.1)',
|
|
|
+ columnWidth: [130, 190, 110, 200, 120, 140, 180, 180, 160, 210, 180],
|
|
|
+ align: ['center', 'center', 'left', 'left', 'left', 'left', 'center', 'center', 'center', 'center', 'center']
|
|
|
},
|
|
|
- timing: null,
|
|
|
+ refreshInterval: null,
|
|
|
+ apiCaller: 'KB!ZZDayPlan'
|
|
|
}
|
|
|
},
|
|
|
mounted() {
|
|
|
- this.refreshdata()
|
|
|
+ this.initDataRefresh()
|
|
|
},
|
|
|
beforeDestroy() {
|
|
|
- clearInterval(this.timing)
|
|
|
+ this.clearRefreshInterval()
|
|
|
},
|
|
|
methods: {
|
|
|
- refreshdata() {
|
|
|
- this.getdata(); //获取-数据
|
|
|
- this.timing = setInterval(() => {
|
|
|
- this.getdata(); //获取--数据
|
|
|
- }, 10000);
|
|
|
+ initDataRefresh() {
|
|
|
+ this.fetchData()
|
|
|
+ this.refreshInterval = setInterval(this.fetchData, 10000)
|
|
|
},
|
|
|
|
|
|
- async getdata() {
|
|
|
- var caller = 'KB!ZZDayPlan';
|
|
|
- await this.$http.get("kanban/datalist.action?caller=" + caller + "&_noc=1&page=1&pageSize=100", {
|
|
|
- params: {
|
|
|
- condition: "1=1" ,
|
|
|
- }
|
|
|
- }).then((result) => {
|
|
|
- let dataList = JSON.parse(result.data.data);
|
|
|
- let resultList = new Array();
|
|
|
- for (let index = 0; index < dataList.length; index++) {
|
|
|
- const element = dataList[index];
|
|
|
- let item = new Array();
|
|
|
- if(null !=element.v_remark1 && ""!= element.v_remark1){
|
|
|
- item.push("<span class='colorRed fs-xxl'>" + element.v_licode + "</span>");
|
|
|
- item.push("<span class='colorRed fs-xxl'>" + element.v_sacode + "</span>");
|
|
|
- item.push("<span class='colorRed fs-xxl'>" + element.v_seller + "</span>");
|
|
|
- item.push("<span class='colorRed fs-xxl'>" + element.v_jitype + "</span>");
|
|
|
- item.push("<span class='colorRed fs-xxl'>" + element.v_qty + "</span>");
|
|
|
- item.push("<span class='colorRed fs-xxl'>" + element.v_blstatus + "</span>");
|
|
|
- item.push("<span class='colorRed fs-xxl'>" + element.v_planoutqty + "</span>");
|
|
|
- item.push("<span class='colorRed fs-xxl'>" + element.v_madeqty + "</span>");
|
|
|
- item.push("<span class='colorRed fs-xxl'>" + element.v_madejd + "</span>");
|
|
|
- item.push("<span class='colorRed fs-xxl'>" + element.v_remark + "</span>");
|
|
|
- item.push("<span class='colorRed fs-xxl'>" + element.v_remark1 + "</span>");
|
|
|
- item.push("<span class='colorRed fs-xxl'>" + element.v_yc + "</span>");
|
|
|
- }else{
|
|
|
- if (element.v_blstatus == '加工中') { //98%
|
|
|
- item.push("<span class='colorRemind fs-xxl'>" + element.v_licode + "</span>");
|
|
|
- item.push("<span class='colorRemind fs-xxl'>" + element.v_sacode + "</span>");
|
|
|
- item.push("<span class='colorRemind fs-xxl'>" + element.v_seller + "</span>");
|
|
|
- item.push("<span class='colorRemind fs-xxl'>" + element.v_jitype + "</span>");
|
|
|
- item.push("<span class='colorRemind fs-xxl'>" + element.v_qty + "</span>");
|
|
|
- item.push("<span class='colorRemind fs-xxl'>" + element.v_blstatus + "</span>");
|
|
|
- item.push("<span class='colorRemind fs-xxl'>" + element.v_planoutqty + "</span>");
|
|
|
- item.push("<span class='colorRemind fs-xxl'>" + element.v_madeqty + "</span>");
|
|
|
- item.push("<span class='colorRemind fs-xxl'>" + element.v_madejd + "</span>");
|
|
|
- item.push("<span class='colorRemind fs-xxl'>" + element.v_remark + "</span>");
|
|
|
- item.push("<span class='colorRemind fs-xxl'>" + element.v_remark1 + "</span>");
|
|
|
- item.push("<span class='colorRemind fs-xxl'>" + element.v_yc + "</span>");
|
|
|
- } else {
|
|
|
- item.push("<span class='colorGrass fs-xxl'>" + element.v_licode + "</span>");
|
|
|
- item.push("<span class='colorGrass fs-xxl'>" + element.v_sacode + "</span>");
|
|
|
- item.push("<span class='colorGrass fs-xxl'>" + element.v_seller + "</span>");
|
|
|
- item.push("<span class='colorGrass fs-xxl'>" + element.v_jitype + "</span>");
|
|
|
- item.push("<span class='colorGrass fs-xxl'>" + element.v_qty + "</span>");
|
|
|
- item.push("<span class='colorGrass fs-xxl'>" + element.v_blstatus + "</span>");
|
|
|
- item.push("<span class='colorGrass fs-xxl'>" + element.v_planoutqty + "</span>");
|
|
|
- item.push("<span class='colorGrass fs-xxl'>" + element.v_madeqty + "</span>");
|
|
|
- item.push("<span class='colorGrass fs-xxl'>" + element.v_madejd + "</span>");
|
|
|
- item.push("<span class='colorRemind fs-xxl'>" + element.v_remark + "</span>");
|
|
|
- item.push("<span class='colorGrass fs-xxl'>" + element.v_remark1 + "</span>");
|
|
|
- item.push("<span class='colorRemind fs-xxl'>" + element.v_yc + "</span>");
|
|
|
- }
|
|
|
- }
|
|
|
- resultList.push(item);
|
|
|
- }
|
|
|
- const scrollBoard = this.$refs['scroll-board'];
|
|
|
- //刷新数据
|
|
|
- scrollBoard.updateRows(resultList);
|
|
|
- }, (result) => {
|
|
|
- console.error(result)
|
|
|
- }
|
|
|
- );
|
|
|
+ clearRefreshInterval() {
|
|
|
+ if (this.refreshInterval) {
|
|
|
+ clearInterval(this.refreshInterval)
|
|
|
+ this.refreshInterval = null
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
+ async fetchData() {
|
|
|
+ try {
|
|
|
+ const response = await this.$http.get("kanban/datalist.action", {
|
|
|
+ params: {
|
|
|
+ caller: this.apiCaller,
|
|
|
+ _noc: 1,
|
|
|
+ page: 1,
|
|
|
+ pageSize: 100,
|
|
|
+ condition: "1=1"
|
|
|
+ }
|
|
|
+ })
|
|
|
+
|
|
|
+ this.processResponseData(response.data.data)
|
|
|
+ } catch (error) {
|
|
|
+ console.error('数据获取失败:', error)
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
+ processResponseData(rawData) {
|
|
|
+ try {
|
|
|
+ const dataList = JSON.parse(rawData)
|
|
|
+ const formattedData = dataList.map(item => this.formatRowData(item))
|
|
|
+
|
|
|
+ this.$refs.scrollBoard.updateRows(formattedData)
|
|
|
+ } catch (error) {
|
|
|
+ console.error('数据处理失败:', error)
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
+ formatRowData(item) {
|
|
|
+ const hasRemark1 = item.v_remark1 && item.v_remark1.trim() !== ""
|
|
|
+ const isProcessing = item.v_blstatus === '加工中'
|
|
|
+
|
|
|
+ const rowClass = hasRemark1 ? 'colorRed' :
|
|
|
+ isProcessing ? 'colorRemind' : 'colorGrass'
|
|
|
+
|
|
|
+ return [
|
|
|
+ this.createCell(item.v_licode, rowClass),
|
|
|
+ this.createCell(item.v_sacode, rowClass),
|
|
|
+ this.createCell(item.v_seller, rowClass),
|
|
|
+ this.createCell(item.v_jitype, rowClass),
|
|
|
+ this.createCell(item.v_qty, rowClass),
|
|
|
+ this.createCell(item.v_blstatus, rowClass),
|
|
|
+ this.createCell(item.v_planoutqty, rowClass),
|
|
|
+ this.createCell(item.v_madeqty, rowClass),
|
|
|
+ this.createCell(item.v_madejd, rowClass),
|
|
|
+ this.createCell(item.v_remark, hasRemark1 ? 'colorRed' : 'colorRemind'),
|
|
|
+ this.createCell(item.v_remark1, rowClass),
|
|
|
+ this.createCell(item.v_yc, hasRemark1 ? 'colorRed' : 'colorRemind')
|
|
|
+ ]
|
|
|
+ },
|
|
|
+
|
|
|
+ createCell(content, className) {
|
|
|
+ return `<span class="${className} fs-xxl">${content || ''}</span>`
|
|
|
}
|
|
|
}
|
|
|
-};
|
|
|
+}
|
|
|
</script>
|
|
|
|
|
|
-<style lang="scss" class>
|
|
|
-$box-height: 520px;
|
|
|
-$box-width: 100%;
|
|
|
-#bottom1 {
|
|
|
+<style lang="scss" scoped>
|
|
|
+.plan-container {
|
|
|
padding: 13px;
|
|
|
- height: $box-height;
|
|
|
- width: $box-width;
|
|
|
+ height: 520px;
|
|
|
+ width: 100%;
|
|
|
border-radius: 5px;
|
|
|
|
|
|
- .up {
|
|
|
- .bg-color-black {
|
|
|
+ .plan-header {
|
|
|
+ .header-content {
|
|
|
border-radius: 10px;
|
|
|
- height: 495px;
|
|
|
padding: 5px;
|
|
|
- }
|
|
|
+ background-color: rgba(15, 19, 37, 0.1);
|
|
|
|
|
|
- .text {
|
|
|
- color: #c3cbde;
|
|
|
- font-size: 25px;
|
|
|
+ .header-title {
|
|
|
+ color: #c3cbde;
|
|
|
+ font-size: 25px;
|
|
|
+ font-weight: bold;
|
|
|
+ display: flex;
|
|
|
+ justify-content: center;
|
|
|
+ align-items: center;
|
|
|
+ padding: 5px 10px;
|
|
|
+ }
|
|
|
}
|
|
|
+ }
|
|
|
|
|
|
- .body-box {
|
|
|
- width: $box-width;
|
|
|
+ .plan-body {
|
|
|
+ margin-top: 5px;
|
|
|
|
|
|
- .dv-scroll-board .header {
|
|
|
- font-size: 25px;
|
|
|
- }
|
|
|
+ .scroll-board {
|
|
|
+ height: 470px;
|
|
|
+ border-radius: 10px;
|
|
|
|
|
|
- .dv-scroll-board {
|
|
|
- height: 470px;
|
|
|
+ ::v-deep .header {
|
|
|
+ font-size: 25px;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+}
|
|
|
+
|
|
|
+// 颜色类可以放在全局样式中
|
|
|
+.colorRed {
|
|
|
+ color: #ff4d4f;
|
|
|
+}
|
|
|
+
|
|
|
+.colorRemind {
|
|
|
+ color: #faad14;
|
|
|
+}
|
|
|
|
|
|
+.colorGrass {
|
|
|
+ color: #52c41a;
|
|
|
+}
|
|
|
|
|
|
+.fs-xxl {
|
|
|
+ font-size: 16px;
|
|
|
}
|
|
|
</style>
|