Browse Source

预估时间还剩状态调整

baishaojie 3 weeks ago
parent
commit
9a5e945599
2 changed files with 34 additions and 27 deletions
  1. 1 1
      package.json
  2. 33 26
      src/views/productManagement/productionWorkOrder/index.vue

+ 1 - 1
package.json

@@ -32,6 +32,7 @@
     "js-table2excel": "^1.0.3",
     "mammoth": "^1.6.0",
     "moment": "^2.24.0",
+    "node-sass": "^4.14.1",
     "normalize.css": "7.0.0",
     "nprogress": "0.2.0",
     "path-to-regexp": "2.4.0",
@@ -68,7 +69,6 @@
     "eslint-plugin-vue": "^7.20.0",
     "html-webpack-plugin": "3.2.0",
     "mockjs": "1.0.1-beta3",
-    "node-sass": "^4.14.1",
     "runjs": "^4.3.2",
     "sass-loader": "^7.3.1",
     "script-ext-html-webpack-plugin": "2.1.3",

+ 33 - 26
src/views/productManagement/productionWorkOrder/index.vue

@@ -178,32 +178,39 @@
             align="center"
             width="160"
           >
-            <template slot-scope="scope">
-              <template
-                v-if="
-                  scope.row.days_diff !== null &&
-                  scope.row.days_diff !== undefined &&
-                  scope.row.days_diff !== ''
-                "
-              >
-                <span
-                  :class="{
-                    'normal-time': scope.row.days_diff > 3,
-                    'warning-time':
-                      scope.row.days_diff >= 0 && scope.row.days_diff <= 3,
-                    'overdue-time': scope.row.days_diff < 0,
-                  }"
-                >
-                  <template v-if="scope.row.days_diff < 0">
-                    已逾期 {{ Math.abs(scope.row.days_diff) }} 天
-                  </template>
-                  <template v-else> {{ scope.row.days_diff }} 天 </template>
-                </span>
-              </template>
-              <template v-else>
-                <!-- 如果 days_diff 是空字符串、null 或 undefined,显示空 -->
-              </template>
-            </template>
+          <template slot-scope="scope">
+  <template
+    v-if="
+      scope.row.days_diff !== null &&
+      scope.row.days_diff !== undefined &&
+      scope.row.days_diff !== ''
+    "
+  >
+    <span
+      :class="{
+        'normal-time': scope.row.days_diff > 3 || (scope.row.days_diff < 0),
+        'warning-time': scope.row.days_diff >= 0 && scope.row.days_diff <= 3,
+        'overdue-time': scope.row.days_diff < 0,
+      }"
+    >
+      <template v-if="scope.row.days_diff < 0">
+        已逾期 {{ Math.abs(scope.row.days_diff) }} 天 <!-- 负数全部显示为已逾期 -->
+      </template>
+      <template v-else>
+        <!-- 如果 orderStatus 是 '生产完成' 且 days_diff > 0,显示 '提前 X 天' -->
+        <template v-if="scope.row.orderStatus === '生产完成' && scope.row.days_diff > 0">
+          提前 {{ scope.row.days_diff }} 天
+        </template>
+        <template v-else>
+          {{ scope.row.days_diff }} 天 <!-- 其他情况直接显示天数 -->
+        </template>
+      </template>
+    </span>
+  </template>
+  <template v-else>
+    <!-- 如果 days_diff 是空字符串、null 或 undefined,显示空 -->
+  </template>
+</template>
           </el-table-column>
 
           <el-table-column