Merge branch 'master' of http://114.132.189.42:9002/r/mes-ocea-before
| | |
| | | > |
| | | </el-alert> |
| | | <el-card |
| | | |
| | | v-for="(item, index) in operationTasks" |
| | | @click.native="setCheckFlag(item)" |
| | | shadow="hover" |
| | | :key="index" |
| | | :class="['task-item', item.checkFlag ? 'card-checked' : 'card-unchecked']" |
| | | :style="{ backgroundColor: getBackgroundColor(item.planFinishDay) }" |
| | | > |
| | | <!-- <img class="selectedImg" /> --> |
| | | <div class="header" > |
| | |
| | | </div> --> |
| | | <div class="row"> |
| | | <div class="l">计划完成时间:</div> |
| | | <div class="r">{{ item.planFinishDay }}</div> |
| | | <div class="r" >{{ item.planFinishDay }}</div> |
| | | </div> |
| | | </div> |
| | | |
| | | <el-progress |
| | | class="task-progress" |
| | | :text-inside="true" |
| | | :stroke-width="20" |
| | | :percentage=" |
| | | Number((item.completedQuantity / item.plannedQuantity).toFixed(2)) * |
| | | 100 > |
| | | 100 |
| | | ? 100 |
| | | : Number( |
| | | (item.completedQuantity / item.plannedQuantity).toFixed(2) |
| | | ) * 100 |
| | | " |
| | | :format="formatPercentage(item.completedQuantity, item.plannedQuantity)" |
| | | ></el-progress> |
| | | </el-card> |
| | | </div> |
| | | </template> |
| | |
| | | |
| | | &.card-checked { |
| | | // color: white; |
| | | background-image: -webkit-linear-gradient( |
| | | 90deg, |
| | | rgba(12, 149, 255, 0.7) 0%, |
| | | rgba(38, 176, 254, 0.8) 34%, |
| | | rgba(12, 149, 255, 0.8) 100% |
| | | ), |
| | | -webkit-linear-gradient(#5a97fa, #5a97fa); |
| | | background-image: -moz-linear-gradient( |
| | | 90deg, |
| | | rgba(12, 149, 255, 0.7) 0%, |
| | | rgba(38, 176, 254, 0.8) 34%, |
| | | rgba(12, 149, 255, 0.8) 100% |
| | | ), |
| | | -moz-linear-gradient(#5a97fa, #5a97fa); |
| | | background-image: linear-gradient( |
| | | 90deg, |
| | | rgba(12, 149, 255, 0.7) 0%, |
| | | rgba(38, 176, 254, 0.8) 34%, |
| | | rgba(12, 149, 255, 0.8) 100% |
| | | ), |
| | | linear-gradient(#5a97fa, #5a97fa); |
| | | background-blend-mode: normal, normal; |
| | | // background-image: -webkit-linear-gradient( |
| | | // 90deg, |
| | | // rgba(12, 149, 255, 0.7) 0%, |
| | | // rgba(38, 176, 254, 0.8) 34%, |
| | | // rgba(12, 149, 255, 0.8) 100% |
| | | // ), |
| | | // -webkit-linear-gradient(#5a97fa, #5a97fa); |
| | | // background-image: -moz-linear-gradient( |
| | | // 90deg, |
| | | // rgba(12, 149, 255, 0.7) 0%, |
| | | // rgba(38, 176, 254, 0.8) 34%, |
| | | // rgba(12, 149, 255, 0.8) 100% |
| | | // ), |
| | | // -moz-linear-gradient(#5a97fa, #5a97fa); |
| | | // background-image: linear-gradient( |
| | | // 90deg, |
| | | // rgba(12, 149, 255, 0.7) 0%, |
| | | // rgba(38, 176, 254, 0.8) 34%, |
| | | // rgba(12, 149, 255, 0.8) 100% |
| | | // ), |
| | | // linear-gradient(#5a97fa, #5a97fa); |
| | | // background-blend-mode: normal, normal; |
| | | } |
| | | .selectedImg { |
| | | position: absolute; |
| | |
| | | } |
| | | }, |
| | | methods: { |
| | | getBackgroundColor(planFinishDay) { |
| | | const currentDate = new Date(); |
| | | currentDate.setHours(0, 0, 0, 0); // 设置时间为当天的开始,忽略时分秒毫秒 |
| | | const planFinishDayObj = new Date(planFinishDay); |
| | | planFinishDayObj.setHours(0, 0, 0, 0); // 同样设置时间为计划完成日的开始 |
| | | |
| | | // setCheckFlag(item) { |
| | | // this.$nextTick(() => { |
| | | // this.changeBackgroundColor(item.planFinishDay); |
| | | // }); |
| | | // }, |
| | | // changeBackgroundColor(dateString) { |
| | | // const date = new Date(dateString); |
| | | // const threeDaysAgo = new Date(); |
| | | // threeDaysAgo.setDate(threeDaysAgo.getDate() - 3); |
| | | // const oneDayAgo = new Date(); |
| | | // oneDayAgo.setDate(oneDayAgo.getDate() - 1); |
| | | if (planFinishDayObj < currentDate) { |
| | | // 如果计划完成日在当前日之前,返回'blue'表示过期 |
| | | return 'red'; |
| | | } else { |
| | | const timeDifference = currentDate - planFinishDayObj; |
| | | const daysDifference = Math.ceil(timeDifference / (1000 * 60 * 60 * 24)); |
| | | |
| | | // if (date <= threeDaysAgo) { |
| | | // document.body.style.backgroundColor = "blue"; |
| | | // } else if (date <= oneDayAgo) { |
| | | // document.body.style.backgroundColor = "yellow"; |
| | | // } else { |
| | | // document.body.style.backgroundColor = "red"; |
| | | // } |
| | | // }, |
| | | |
| | | if (daysDifference < 0) { |
| | | // 如果计划完成日在未来,计算它是否在10天内 |
| | | const daysUntilDue = Math.abs(daysDifference); |
| | | if (daysUntilDue <= 10) { |
| | | // 如果在10天内,返回'yellow'表示即将到期 |
| | | return 'yellow'; |
| | | } |
| | | } |
| | | } |
| | | // 如果不是即将到期或已过期,返回'red'表示已到期 |
| | | return 'blue'; |
| | | }, |
| | | |
| | | // 点击工单,选中工单 |
| | | setCheckFlag(item) { |
| | | if (item.checkFlag) { |
| | |
| | | type: "html", |
| | | maxWidth: 880, |
| | | // header: "原材料检测报告", |
| | | style: '@page {margin: 0 5mm;}', |
| | | style: '@page {margin: 10mm 5mm;}', |
| | | targetStyles: ["*"], |
| | | ignoreElements: ["no-ignore"], |
| | | orientation: 'portrait' |
| | |
| | | <template> |
| | | <div style="word-wrap:break-word;text-justify-trim:punctuation"> |
| | | <div class="WordSection1" style="layout-grid:15.6pt;margin-top: 20pt;"> |
| | | <div class="WordSection1" style="layout-grid:15.6pt;"> |
| | | <div align="center"> |
| | | <table class="MsoTableGrid" border="1" cellspacing="0" cellpadding="0" width="629" |
| | | style="width:620pt;border-collapse:collapse;border:1pt solid windowtext"> |
| | |
| | | </tbody> |
| | | <tbody v-for="(item,index) in projectList" :key="index"> |
| | | <tr style="height:19.85pt"> |
| | | <td width="85" :rowspan="item.children.length" style="width:63.95pt;border:solid windowtext 1.0pt;border-top:1pt solid windowtext;padding:0.2cm 5.4pt 0.2cm 5.4pt;height:19.85pt"> |
| | | <td width="85" :rowspan="item.children.length" style="width:63.95pt;border:solid windowtext 1.0pt;padding:0.2cm 5.4pt 0.2cm 5.4pt;height:19.85pt"> |
| | | <p class="MsoNormal" align="center" style="text-align:center"><span |
| | | style="font-family:宋体" v-text="item.rpFather"></span></p> |
| | | <p class="MsoNormal" align="center" style="text-align:center"><span lang="EN-US" |
| | | style="font-family:"Arial",sans-serif"></span></p> |
| | | </td> |
| | | <td width="60" colspan="2" style="width:65.15pt;border-top:1pt solid windowtext;border-left:1pt solid windowtext;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;padding:0.2cm 5.4pt 0.2cm 5.4pt;height:19.85pt"> |
| | | <td width="60" colspan="2" style="width:65.15pt;border:1pt solid windowtext;padding:0.2cm 5.4pt 0.2cm 5.4pt;height:19.85pt"> |
| | | <p class="MsoNormal" align="center" style="text-align:center"><span lang="EN-US" |
| | | style="font-family:"Arial",sans-serif" v-text="item.children[0].rpName"></span></p> |
| | | </td> |
| | | <td width="59" colspan="3" style="width:44.4pt;border-top:1pt solid windowtext;border-left:1pt solid windowtext;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;padding:0.2cm 5.4pt 0.2cm 5.4pt;height:19.85pt"> |
| | | <td width="59" colspan="3" style="width:44.4pt;border:1pt solid windowtext;padding:0.2cm 5.4pt 0.2cm 5.4pt;height:19.85pt"> |
| | | <p class="MsoNormal" align="center" style="text-align:center"><span lang="EN-US" |
| | | style="font-family:"Arial",sans-serif" v-text="item.children[0].required"></span></p> |
| | | </td> |
| | |
| | | style="font-family:"Arial",sans-serif"></span></p> |
| | | </td> |
| | | </tr> |
| | | <tr style="height:19.85pt" v-for="(j,index) in (item.children.slice(1))" :key="index"> |
| | | <td width="60" colspan="2" style="width:45.15pt;border-top:1pt solid windowtext;border-left:1pt solid windowtext; |
| | | border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;padding:0.2cm 5.4pt 0.2cm 5.4pt;height:19.85pt"> |
| | | <tr class="pageTr" style="height:19.85pt" v-for="(j,index) in (item.children.slice(1))" :key="index"> |
| | | <td width="60" colspan="2" style="width:45.15pt;border:1pt solid windowtext;padding:0.2cm 5.4pt 0.2cm 5.4pt;height:19.85pt"> |
| | | <p class="MsoNormal" align="center" style="text-align:center"><span lang="EN-US" |
| | | style="font-family:"Arial",sans-serif">{{j.rpName}}</span></p> |
| | | </td> |
| | | <td width="59" colspan="3" style="width:44.4pt;border-top:1pt solid windowtext;border-left:1pt solid windowtext;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;padding:0.2cm 5.4pt 0.2cm 5.4pt;height:19.85pt"> |
| | | <td width="59" colspan="3" style="width:44.4pt;border:1pt solid windowtext;padding:0.2cm 5.4pt 0.2cm 5.4pt;height:19.85pt"> |
| | | <p class="MsoNormal" align="center" style="text-align:center"><span lang="EN-US" |
| | | style="font-family:"Arial",sans-serif">{{j.required}}</span></p> |
| | | </td> |
| | | <td width="59" v-for="(testValue,index) in j.testValueList" :key="index" style="width:44.4pt;border-top:1pt solid windowtext;border-left:1pt solid windowtext;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;padding:0.2cm 5.4pt 0.2cm 5.4pt;height:19.85pt"> |
| | | <td width="59" v-for="(testValue,index) in j.testValueList" :key="index" style="width:44.4pt;border:1pt solid windowtext;padding:0.2cm 5.4pt 0.2cm 5.4pt;height:19.85pt"> |
| | | <p class="MsoNormal" align="center" style="text-align:center"><span lang="EN-US" |
| | | style="font-family:"Arial",sans-serif">{{testValue}}</span></p> |
| | | </td> |
| | | <td width="43" colspan="1" style="width:70pt;border-top:1pt solid windowtext;border-left:1pt solid windowtext;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;padding:0.1cm 2.4pt 0.1cm 2.4pt;height:19.85pt"> |
| | | <td width="43" colspan="1" style="width:70pt;border:1pt solid windowtext;padding:0.1cm 2.4pt 0.1cm 2.4pt;height:19.85pt"> |
| | | <p class="MsoNormal" align="center" style="text-align:center"> |
| | | <span lang="EN-US" style="font-family:"Arial",sans-serif"> |
| | | {{ j.testState | formatState}} |
| | |
| | | </tr> |
| | | </tbody> |
| | | <!-- bottom --> |
| | | <tr style="height:40.95pt"> |
| | | <tr style="height:40.95pt" class="pageTr"> |
| | | <td width="145" colspan="3" style="width:109.1pt;border:solid windowtext 1.0pt; |
| | | border-top:1pt solid windowtext;padding:0cm 5.4pt 0cm 5.4pt;height:40.95pt"> |
| | | <p class="MsoNormal" align="center" style="text-align:center"><span |
| | |
| | | margin:72.0pt 2.0cm 2.0cm 2.0cm; |
| | | layout-grid:15.6pt; |
| | | } |
| | | .pageTr{ |
| | | page-break-inside: avoid; |
| | | } |
| | | div.WordSection1{ |
| | | page : WordSection1; |
| | | } |
| | |
| | | * 配置参考: |
| | | * https://cli.vuejs.org/zh/config/ |
| | | */ |
| | | const url = 'http://192.168.0.23:9999' |
| | | // const url = 'http://192.168.0.23:9999' |
| | | |
| | | // const url = 'http://192.168.0.60:9999' |
| | | // const url = 'http://localhost:9999' |
| | | const url = 'http://localhost:9999' |
| | | |
| | | // const url = 'http://ztt-gateway:9999' |
| | | const localUrl = 'http://localhost:8089' |