huminmin
2 天以前 176ca08ce83bedeb8766b3b1dfd047856d643837
src/views/productionManagement/productionOrder/index.vue
@@ -41,6 +41,7 @@
        </el-form-item>
      </el-form>
      <div>
        <el-button type="primary" @click="isShowNewModal = true">新增</el-button>
        <el-button @click="handleOut">导出</el-button>
      </div>
    </div>
@@ -50,6 +51,7 @@
                :tableData="tableData"
                :page="page"
                :tableLoading="tableLoading"
                :row-class-name="tableRowClassName"
                @pagination="pagination">
        <template #completionStatus="{ row }">
          <el-progress
@@ -85,6 +87,10 @@
        </span>
      </template>
    </el-dialog>
    <new-product-order v-if="isShowNewModal"
                         v-model:visible="isShowNewModal"
                         @completed="handleQuery" />
  </div>
</template>
@@ -100,9 +106,12 @@
    listProcessBom,
  } from "@/api/productionManagement/productionOrder.js";
  import { listMain as getOrderProcessRouteMain } from "@/api/productionManagement/productProcessRoute.js";
  const NewProductOrder = defineAsyncComponent(() => import("@/views/productionManagement/productionOrder/New.vue"));
  const { proxy } = getCurrentInstance();
  const router = useRouter();
  const isShowNewModal = ref(false);
  const tableColumn = ref([
    {
@@ -159,6 +168,12 @@
    {
      label: "结束日期",
      prop: "endTime",
      formatData: val => (val ? dayjs(val).format("YYYY-MM-DD") : ""),
      width: 120,
    },
    {
      label: "交付日期",
      prop: "deliveryDate",
      formatData: val => (val ? dayjs(val).format("YYYY-MM-DD") : ""),
      width: 120,
    },
@@ -228,6 +243,22 @@
    if (p < 50) return "#e6a23c";
    if (p < 80) return "#409eff";
    return "#67c23a";
  };
  // 添加表行类名方法
  const tableRowClassName = ({ row }) => {
    if (row.isFh) return '';
    const diff = row.deliveryDaysDiff;
    if (diff === 15) {
      return 'yellow';
    } else if (diff === 10) {
      return 'pink';
    } else if (diff === 2) {
      return 'purple';
    } else if (diff < 2) {
      return 'red';
    }
  };
  // 绑定工艺路线弹框
@@ -388,4 +419,21 @@
<style scoped lang="scss">
.search_form{
  align-items: start;
}</style>
}
::v-deep .yellow {
  background-color: #FAF0DE;
}
::v-deep .pink {
  background-color: #FAE1DE;
}
::v-deep .red {
  background-color: #f80202;
}
::v-deep .purple{
  background-color: #F4DEFA;
}
</style>