Kaynağa Gözat

好了 好了。

wukai 1 ay önce
ebeveyn
işleme
c095d43a05
2 değiştirilmiş dosya ile 131 ekleme ve 93 silme
  1. 120 88
      src/views/lean/news/index.vue
  2. 11 5
      src/views/lean/scs/index.vue

+ 120 - 88
src/views/lean/news/index.vue

@@ -1,93 +1,59 @@
 <template>
   <div class="app-container">
-<!--    <el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="68px">-->
-<!--      <el-form-item label="信息时间" prop="newsTime">-->
-<!--        <el-date-picker clearable-->
-<!--          v-model="queryParams.newsTime"-->
-<!--          type="date"-->
-<!--          value-format="YYYY-MM-DD"-->
-<!--          placeholder="请选择信息时间">-->
-<!--        </el-date-picker>-->
-<!--      </el-form-item>-->
-<!--      <el-form-item label="信息标题" prop="title">-->
-<!--        <el-input-->
-<!--          v-model="queryParams.title"-->
-<!--          placeholder="请输入信息标题"-->
-<!--          clearable-->
-<!--          @keyup.enter="handleQuery"-->
-<!--        />-->
-<!--      </el-form-item>-->
-<!--      <el-form-item label="链接地址" prop="addr">-->
-<!--        <el-input-->
-<!--          v-model="queryParams.addr"-->
-<!--          placeholder="请输入链接地址"-->
-<!--          clearable-->
-<!--          @keyup.enter="handleQuery"-->
-<!--        />-->
-<!--      </el-form-item>-->
-<!--      <el-form-item>-->
-<!--        <el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>-->
-<!--        <el-button icon="Refresh" @click="resetQuery">重置</el-button>-->
-<!--      </el-form-item>-->
-<!--    </el-form>-->
-
-<!--    <el-row :gutter="10" class="mb8">-->
-<!--      <el-col :span="1.5">-->
-<!--        <el-button-->
-<!--          type="primary"-->
-<!--          plain-->
-<!--          icon="Plus"-->
-<!--          @click="handleAdd"-->
-<!--        >新增</el-button>-->
-<!--      </el-col>-->
-<!--      <el-col :span="1.5">-->
-<!--        <el-button-->
-<!--          type="success"-->
-<!--          plain-->
-<!--          icon="Edit"-->
-<!--          :disabled="single"-->
-<!--          @click="handleUpdate"-->
-<!--        >修改</el-button>-->
-<!--      </el-col>-->
-<!--      <el-col :span="1.5">-->
-<!--        <el-button-->
-<!--          type="danger"-->
-<!--          plain-->
-<!--          icon="Delete"-->
-<!--          :disabled="multiple"-->
-<!--          @click="handleDelete"-->
-<!--        >删除</el-button>-->
-<!--      </el-col>-->
-<!--      <right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>-->
-<!--    </el-row>-->
-
-    <el-table v-loading="loading" :data="newsList" @selection-change="handleSelectionChange">
-<!--      <el-table-column type="selection" width="55" align="center" />-->
-      <el-table-column label="信息时间" align="center" prop="newsTime" width="180">
-        <template #default="scope">
-          <span>{{ parseTime(scope.row.newsTime, '{y}-{m}-{d}') }}</span>
-        </template>
-      </el-table-column>
-      <el-table-column label="信息标题" align="center" prop="title">
-        <template #default="scope">
-          <span style="color: #409eff; cursor: pointer;" @click="openLink(scope.row.addr)">{{ scope.row.title }}</span>
-        </template>
-      </el-table-column>
-<!--      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">-->
-<!--        <template #default="scope">-->
-<!--          <el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)">修改</el-button>-->
-<!--          <el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)">删除</el-button>-->
-<!--        </template>-->
-<!--      </el-table-column>-->
-    </el-table>
-
-    <pagination
-      v-show="total>0"
-      :total="total"
-      v-model:page="queryParams.pageNum"
-      v-model:limit="queryParams.pageSize"
-      @pagination="getList"
-    />
+    <el-card class="news-card">
+      <template #header>
+        <div class="card-header">
+          <span class="card-title">原料行情资讯</span>
+        </div>
+      </template>
+
+      <el-table 
+        v-loading="loading" 
+        :data="newsList" 
+        @selection-change="handleSelectionChange"
+        class="news-table"
+        :header-cell-style="{background:'#f5f7fa', color:'#606266'}"
+        stripe
+        @sort-change="handleSortChange"
+      >
+        <el-table-column 
+          label="信息时间" 
+          align="center" 
+          prop="newsTime" 
+          width="180"
+          sortable="custom"
+        >
+          <template #default="scope">
+            <span class="news-date">{{ parseTime(scope.row.newsTime, '{y}-{m}-{d}') }}</span>
+          </template>
+        </el-table-column>
+        
+        <el-table-column 
+          label="信息标题" 
+          align="left" 
+          prop="title"
+          min-width="400"
+        >
+          <template #default="scope">
+            <span 
+              class="news-title-link" 
+              @click="openLink(scope.row.addr)"
+            >
+              {{ scope.row.title }}
+            </span>
+          </template>
+        </el-table-column>
+      </el-table>
+
+      <pagination
+        v-show="total>0"
+        :total="total"
+        v-model:page="queryParams.pageNum"
+        v-model:limit="queryParams.pageSize"
+        @pagination="getList"
+        class="pagination-container"
+      />
+    </el-card>
 
     <!-- 添加或修改原料行情对话框 -->
     <el-dialog :title="title" v-model="open" width="500px" append-to-body>
@@ -159,6 +125,13 @@ function getList() {
   });
 }
 
+/** 排序 */
+function handleSortChange(column) {
+  queryParams.value.orderByColumn = column.prop;
+  queryParams.value.isAsc = column.order === "ascending" ? "asc" : "desc";
+  getList();
+}
+
 /** 打开链接 */
 function openLink(url) {
   if (url) {
@@ -261,3 +234,62 @@ function handleExport() {
 
 getList();
 </script>
+
+<style scoped>
+.news-card {
+  border-radius: 8px;
+  box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
+}
+
+.card-header {
+  display: flex;
+  align-items: center;
+  justify-content: space-between;
+}
+
+.card-title {
+  font-weight: bold;
+  font-size: 18px;
+  color: #303133;
+}
+
+.news-table {
+  margin-top: 10px;
+}
+
+.news-table :deep(.el-table__row:hover) {
+  background-color: #f5f7fa;
+  cursor: pointer;
+}
+
+.news-date {
+  font-weight: 500;
+  color: #606266;
+}
+
+.news-title-link {
+  color: #409eff;
+  cursor: pointer;
+  font-weight: 500;
+  transition: all 0.3s ease;
+  padding: 5px 0;
+  display: inline-block;
+}
+
+.news-title-link:hover {
+  color: #1890ff;
+  text-decoration: underline;
+}
+
+.pagination-container {
+  margin-top: 20px;
+  display: flex;
+  justify-content: center;
+}
+
+.dialog-footer {
+  display: flex;
+  justify-content: flex-end;
+  padding: 0 20px 20px 0;
+}
+</style>

+ 11 - 5
src/views/lean/scs/index.vue

@@ -8,7 +8,9 @@
       </template>
       <el-descriptions :column="4" border class="result-descriptions">
         <el-descriptions-item label="近十天订单需求量" label-class-name="short-label">
-          <el-link type="primary" @click="openOrderDetailsDialog">{{ formatNumber(result.weight) }} 吨</el-link>
+          <el-link type="primary" @click="openOrderDetailsDialog"><span class="clickable-icon">👉</span>
+            {{ formatNumber(result.weight) }} 吨
+          </el-link>
         </el-descriptions-item>
         <el-descriptions-item label="DTY+POY需求量" label-class-name="short-label">
           {{ formatNumber(result.dtyPoyRequired) }} 吨
@@ -289,9 +291,10 @@
         </el-table-column>
         <el-table-column prop="gyPoy" label="供应商库存(吨)" width="150" align="center">
           <template #default="scope">
+
             <span v-if="scope.row.gyPoy !== null" :style="getSupplierInventoryStyle(scope.row)"
                   @click="openSupplierInventoryDialog" class="supplier-inventory-link">
-              {{ formatNumber(scope.row.gyPoy) }}
+              <span class="clickable-icon">👉</span> {{ formatNumber(scope.row.gyPoy) }}
             </span>
             <span v-else>--</span>
           </template>
@@ -339,7 +342,7 @@
         </el-table-column>
         <el-table-column prop="num" label="数量" width="110">
           <template #default="scope">
-            {{ scope.row.num }} ({{scope.row.unit}})
+            {{ scope.row.num }} ({{ scope.row.unit }})
           </template>
         </el-table-column>
         <el-table-column prop="totalPrice" label="总价(元)" width="100"/>
@@ -690,7 +693,7 @@ const flattenedOrderDetails = computed(() => {
 });
 
 // 订单表格合并行函数
-const orderSpanMethod = ({ row, column, rowIndex, columnIndex }) => {
+const orderSpanMethod = ({row, column, rowIndex, columnIndex}) => {
   // 只对订单编号、客户名称和下单时间三列进行合并
   if (columnIndex === 0 || columnIndex === 1 || columnIndex === 2) {
     const orderCode = row.orderCode;
@@ -705,7 +708,7 @@ const orderSpanMethod = ({ row, column, rowIndex, columnIndex }) => {
       let count = 1;
       let nextRowIndex = rowIndex + 1;
       while (nextRowIndex < flattenedOrderDetails.value.length &&
-             flattenedOrderDetails.value[nextRowIndex].orderCode === orderCode) {
+      flattenedOrderDetails.value[nextRowIndex].orderCode === orderCode) {
         count++;
         nextRowIndex++;
       }
@@ -894,6 +897,9 @@ getList();
 
 .supplier-inventory-link {
   cursor: pointer;
+}
+
+.supplier-inventory-link:hover {
   text-decoration: underline;
 }