王震
2023-11-18 c8a12052a457e33f5acf6e03d3904d50eee40b42
Merge branch 'master' of http://114.132.189.42:9002/r/mes-ocea-before
已修改4个文件
137 ■■■■ 文件已修改
src/views/product/workbench/operation-task-pane.vue 107 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/quality/rawMaterial/index.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/quality/rawMaterial/rawMaterial-print.vue 24 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
vue.config.js 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/product/workbench/operation-task-pane.vue
@@ -8,11 +8,13 @@
    >
    </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" >
@@ -58,25 +60,10 @@
    </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>
@@ -105,28 +92,28 @@
  
  &.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;
@@ -347,28 +334,32 @@
    }
  },
  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) {
src/views/quality/rawMaterial/index.vue
@@ -276,7 +276,7 @@
                type: "html",
                maxWidth: 880,
                // header: "原材料检测报告",
                style: '@page {margin: 0 5mm;}',
                style: '@page {margin: 10mm 5mm;}',
                targetStyles: ["*"],
                ignoreElements: ["no-ignore"],
                orientation: 'portrait'
src/views/quality/rawMaterial/rawMaterial-print.vue
@@ -1,6 +1,6 @@
<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">
@@ -184,17 +184,17 @@
                </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:&quot;Arial&quot;,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:&quot;Arial&quot;,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:&quot;Arial&quot;,sans-serif"  v-text="item.children[0].required"></span></p>
                        </td>
@@ -211,21 +211,20 @@
                                    style="font-family:&quot;Arial&quot;,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:&quot;Arial&quot;,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:&quot;Arial&quot;,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:&quot;Arial&quot;,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:&quot;Arial&quot;,sans-serif">
                                    {{ j.testState | formatState}}
@@ -235,7 +234,7 @@
                    </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
@@ -491,6 +490,9 @@
    margin:72.0pt 2.0cm 2.0cm 2.0cm;
    layout-grid:15.6pt;
}
.pageTr{
    page-break-inside: avoid;
}
div.WordSection1{
    page : WordSection1;
}
vue.config.js
@@ -2,10 +2,10 @@
 * 配置参考:
 * 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'